From 07d6e07694da0f9e5910517077f4c8a99e06d1b6 Mon Sep 17 00:00:00 2001 From: Maksim Bondarenkov <119937608+ognevny@users.noreply.github.com> Date: Tue, 13 Aug 2024 20:40:39 +0300 Subject: [PATCH 001/192] [iso] fix MSVC-only definition * It should be defined for MSVC only. This fixes UCRT build. * Closes #2540. --- src/libcdio/config.h | 3 +++ src/rufus.rc | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/libcdio/config.h b/src/libcdio/config.h index b0ee3c99..a782044f 100644 --- a/src/libcdio/config.h +++ b/src/libcdio/config.h @@ -39,8 +39,11 @@ /* Define to 1 if you have the `fseeko64' function. */ #define HAVE_FSEEKO64 1 + +#if defined(_MSC_VER) /* The equivalent of fseeko64 for MSVC is _fseeki64 */ #define fseeko64 _fseeki64 +#endif /* Define to 1 if you have the `ftruncate' function. */ /* #undef HAVE_FTRUNCATE */ diff --git a/src/rufus.rc b/src/rufus.rc index 2696caf1..7d45ba76 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.6.2191" +CAPTION "Rufus 4.6.2192" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -397,8 +397,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2191,0 - PRODUCTVERSION 4,6,2191,0 + FILEVERSION 4,6,2192,0 + PRODUCTVERSION 4,6,2192,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -416,13 +416,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2191" + VALUE "FileVersion", "4.6.2192" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "� 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2191" + VALUE "ProductVersion", "4.6.2192" END END BLOCK "VarFileInfo" From 0ee7d7a2c033bb3a245c2a78be7ca81b51fd4baf Mon Sep 17 00:00:00 2001 From: Jakub Zieciak Date: Sat, 17 Aug 2024 16:13:30 +0100 Subject: [PATCH 002/192] [loc] update Polish translation --- res/loc/po/pl-PL.po | 64 ++++++++++++++++++++++----------------------- res/loc/rufus.loc | 52 ++++++++++++++++++------------------ src/rufus.rc | 10 +++---- 3 files changed, 63 insertions(+), 63 deletions(-) diff --git a/res/loc/po/pl-PL.po b/res/loc/po/pl-PL.po index 3d91def0..303214be 100644 --- a/res/loc/po/pl-PL.po +++ b/res/loc/po/pl-PL.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: 4.5\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-05-09 19:08+0100\n" -"PO-Revision-Date: 2024-05-09 19:38+0100\n" +"POT-Creation-Date: 2024-08-13 12:38+0100\n" +"PO-Revision-Date: 2024-08-13 13:22+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: pl_PL\n" @@ -173,7 +173,7 @@ msgstr "Szukaj aktualizacji - Rufus" #. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT msgid "A newer version is available. Please download the latest version!" -msgstr "Jest dostępna nowsza wersja. Proszę pobrać najnowszą wersję!" +msgstr "Nowsza wersja jest dostępna. Proszę pobrać najnowszą wersję!" #. • IDD_NEW_VERSION → IDC_WEBSITE msgid "Click here to go to the website" @@ -491,7 +491,7 @@ msgstr "Nie można skopiować plików na dysk docelowy." #. • MSG_070 msgid "Cancelled by user." -msgstr "Przerwane przez użytkwonika." +msgstr "Przerwane przez użytkownika." #. • MSG_071 #. @@ -517,7 +517,7 @@ msgstr "Nie można ponownie zamontować woluminu." #. • MSG_076 msgid "Unable to patch/setup files for boot." -msgstr "Nie można załatać/skonfigurować plików do bootowania." +msgstr "Nie można załatać/skonfigurować plików do rozruchu." #. • MSG_077 msgid "Unable to assign a drive letter." @@ -551,7 +551,7 @@ msgstr "Niewspierany obraz" #. • MSG_082 msgid "This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus..." -msgstr "Ten obraz nie jest bootowalny lub używa kompresji sektora rozruchowego niewspieranej przez Rufusa..." +msgstr "Ten obraz nie jest rozruchowy lub używa kompresji sektora rozruchowego niewspieranej przez Rufusa..." #. • MSG_083 msgid "Replace %s?" @@ -612,7 +612,7 @@ msgstr "Niewspierane ISO" #. • MSG_091 msgid "When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS." -msgstr "Podczas używania Systemu Typu UEFI, tylko bootowalne obrazy ISO EFI są wspierane. Proszę wybrać bootowalny obraz ISO EFI lub ustawić System Docelowy na BIOS." +msgstr "Podczas używania Systemu Typu UEFI, tylko rozruchowe obrazy ISO EFI są wspierane. Proszę wybrać rozruchowy obraz ISO EFI lub ustawić System Docelowy na BIOS." #. • MSG_092 msgid "Unsupported filesystem" @@ -652,7 +652,7 @@ msgid "" "\n" "Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public..." msgstr "" -"WAŻNE: Próbujesz zainstalować 'Windows To Go', lecz dysk docelowy nie ma atrybytu 'LOKALNY'. Z tego powodu Windows prawdopodobnie zawiesi się podczas startu, ponieważ Microsoft nie zaprojektował go do działania z dyskami, które zamiast tego mają atrybut 'WYMIENNY'.\n" +"WAŻNE: Próbujesz zainstalować 'Windows To Go', lecz dysk docelowy nie ma atrybutu 'LOKALNY'. Z tego powodu Windows prawdopodobnie zawiesi się podczas startu, ponieważ Microsoft nie zaprojektował go do działania z dyskami, które zamiast tego mają atrybut 'WYMIENNY'.\n" "\n" "Czy nadal chcesz kontynuować?\n" "\n" @@ -675,7 +675,7 @@ msgid "" "Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\n" "Do you want to visit the 7-zip download page?" msgstr "" -"Twoja platforma nie może wypakować plików z archiwów WIM. Wypakowanie WIM jest wymagane aby utworzyć bootowalny dysk USB EFI z Windows 7 i Windows Vista. Możesz to naprawić instalując aktualną wersję 7-Zip.\n" +"Twoja platforma nie może wypakować plików z archiwów WIM. Wypakowanie WIM jest wymagane aby utworzyć rozruchowy dysk USB EFI z Windows 7 i Windows Vista. Możesz to naprawić instalując aktualną wersję 7-Zip.\n" "Czy chcesz odwiedzić stronę pobierania 7-zip?" #. • MSG_103 @@ -700,7 +700,7 @@ msgstr "" "Ponieważ ten plik jest większy niż 100 KB i zawsze jest obecny na obrazach ISO %s, nie jest dołączony do Rufusa.\n" "\n" "Rufus może pobrać brakujący plik dla ciebie:\n" -"- Wybierz 'Yes', aby połączyć sie z internetem i pobrać plik\n" +"- Wybierz 'Yes', aby połączyć się z internetem i pobrać plik\n" "- Wybierz 'No', jeśli chcesz później ręcznie skopiować ten plik na dysk \n" "\n" "Informacja: Plik zostanie pobrany do obecnego folderu i jeśli '%s' istnieje, zostanie użyty ponownie automatycznie." @@ -710,7 +710,7 @@ msgid "" "Cancelling may leave the device in an UNUSABLE state.\n" "If you are sure you want to cancel, click YES. Otherwise, click NO." msgstr "" -"Przerwanie operacji może pozostawic urządzenie w stanie NIEZDATNYM DO UŻYTKU.\n" +"Przerwanie operacji może pozostawić urządzenie w stanie NIEZDATNYM DO UŻYTKU.\n" "Jeśli jesteś pewien, że chcesz przerwać operację, naciśnij TAK. W innym razie naciśnij NIE." #. • MSG_106 @@ -860,7 +860,7 @@ msgstr "Nie pokazuj więcej tej wiadomości" #. • MSG_128 msgid "Important notice about %s" -msgstr "Ważna informacjoa o %s" +msgstr "Ważna informacja o %s" #. • MSG_129 msgid "" @@ -896,7 +896,7 @@ msgid "" msgstr "" "Rufus wykrył, że próbujesz utworzyć nośnik \"Windows To Go\" bazujący na ISO 1809.\n" "\n" -"Z powodu *BŁĘDU MICROSOFTU*, ten nośnik ulegnie awarii podczas bootowania systemu (Blue Screen of Death), chyba że ręcznie zastąpisz plik \"WppRecorder.sys\" wersją z 1803.\n" +"Z powodu *BŁĘDU MICROSOFTU*, ten nośnik ulegnie awarii podczas rozruchu systemu (Blue Screen of Death), chyba że ręcznie zastąpisz plik \"WppRecorder.sys\" wersją z 1803.\n" "\n" "Należy również pamiętać, że powodem, dla którego Rufus nie może automatycznie rozwiązać tego problemu, jest to, że \"WppRecorder.sys” jest plikiem chronionym prawem autorskim firmy Microsoft, więc nie możemy zgodnie z prawem osadzić kopii pliku w aplikacji." @@ -968,7 +968,7 @@ msgstr "Pobierz obraz ISO" #. • MSG_150 msgid "Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise." -msgstr "Typ komputera, na którym chcesz użyć bootowalnego dysku. Przed stworzeniem dysku musisz sam określić, czy docelowy komputer posiada BIOS, czy UEFI, inaczej może się nie uruchomić." +msgstr "Typ komputera, na którym chcesz użyć dysku rozruchowego. Przed stworzeniem dysku musisz sam określić, czy docelowy komputer posiada BIOS, czy UEFI, inaczej może się nie uruchomić." #. • MSG_151 #. @@ -1018,7 +1018,7 @@ msgstr "Przełącz opcje zaawansowane" #. • MSG_161 msgid "Check the device for bad blocks using a test pattern" -msgstr "Sprawdź urządzenie pod kątem błędnych sektorów używając wzoru testoego" +msgstr "Sprawdź urządzenie pod kątem błędnych sektorów używając wzoru testowego" #. • MSG_162 msgid "Uncheck this box to use the \"slow\" format method" @@ -1030,7 +1030,7 @@ msgstr "Metoda, która zostanie użyta do stworzenia partycji" #. • MSG_164 msgid "Method that will be used to make the drive bootable" -msgstr "Metoda, która zostanie użyta, aby uczynić dysk bootowalnym" +msgstr "Metoda, która zostanie użyta, aby uczynić dysk rozruchowym" #. • MSG_165 msgid "Click to select or download an image..." @@ -1128,7 +1128,7 @@ msgid "" "Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\line\n" "Internet access is of course required when checking for updates." msgstr "" -"Rufus nie instaluje lub uruchamia procesów w tle, dlatego aktualizacje są sprawdzane wylącznie przy starcie głównego okna aplikacji.\\line\n" +"Rufus nie instaluje lub uruchamia procesów w tle, dlatego aktualizacje są sprawdzane wyłącznie przy starcie głównego okna aplikacji.\\line\n" "Dostęp do internetu jest wymagany podczas sprawdzania aktualizacji." #. • MSG_187 @@ -1182,7 +1182,7 @@ msgid "" msgstr "" "WAŻNE: TEN DYSK UŻYWA NIESTANDARDOWEGO ROZMIARU SEKTORA!\n" "\n" -"Standardowe dyski używają 512-bajtowego rozmiaru sektora, lecz ten dysk używa %d-bajtowego. W wielu przypadkach oznacza to, że NIE będziesz mógł bootować z tego dysku.\n" +"Standardowe dyski używają 512-bajtowego rozmiaru sektora, lecz ten dysk używa %d-bajtowego. W wielu przypadkach oznacza to, że NIE będziesz mógł startować z tego dysku.\n" "Rufus może spróbować utworzyć dysk rozruchowy, ale NIE MA GWARANCJI, że to zadziała." #. • MSG_197 @@ -1350,7 +1350,7 @@ msgstr "Kopiowanie plików ISO: %s" #. • MSG_232 msgid "Win7 EFI boot setup (%s)..." -msgstr "Ustawianie bootowania Win7 EFI (%s)..." +msgstr "Ustawianie rozruchu Win7 EFI (%s)..." #. • MSG_233 msgid "Finalizing, please wait..." @@ -1552,9 +1552,9 @@ msgid "" "\n" "Please select the mode that you want to use to write this image:" msgstr "" -"Obraz, który wybrałeś to obraz 'ISOHybrid'. To znacza iż może zostać zapisany w trybie %s (kopia plików) lub trybie %s (obraz dysku).\n" +"Obraz, który wybrałeś to obraz 'ISOHybrid'. Oznacza to, że może zostać zapisany w trybie %s (kopia plików) lub trybie %s (obraz dysku).\n" "Rufus zaleca użycie trybu %s, abyś zawsze miał pełny dostęp do dysku po jego zapisaniu.\n" -"Jednak jeśli napotkasz problemy podczas bootowania możesz spróbować zapisać ten obraz ponownie w trybie %s.\n" +"Jednak jeśli napotkasz problemy podczas rozruchu możesz spróbować zapisać ten obraz ponownie w trybie %s.\n" "\n" "Proszę wybrać tryb którego chcesz użyć do zapisania tego obrazu:" @@ -1739,13 +1739,13 @@ msgid "" "\n" "Please select the mode that you want to use to write this image:" msgstr "" -"Obraz ISO, który został wybrany używa UEFI i jest dość mały, żeby być zapisanym jako partycja systemowa EFI (ESP). Zapisywanie do ESP zamiast to ogólnej partycji zajmującej cały dysk. Może być bardziej odpowiedni dla niektórych typów instalacji.\n" +"Wybrany plik ISO używa UEFI i jest na tyle mały, że można go zapisać jako partycję systemową EFI (ESP). Zapisanie na ESP, zamiast zapisywania na ogólnej partycji danych zajmującej cały dysk, może być preferowane dla niektórych typów instalacji.\n" "\n" -"Proszę wybrać tryb którym chesz zapisać ten obraz:" +"Proszę wybrać tryb, w którym chcesz zapisać ten obraz:" #. • MSG_311 msgid "Use %s (in the main application window) to enable." -msgstr "Użyj %s w głownym oknie aplikacji, żeby włączyć." +msgstr "Użyj %s w głównym oknie aplikacji, żeby włączyć." #. • MSG_312 msgid "Extra hashes (SHA512)" @@ -1853,9 +1853,9 @@ msgid "" msgstr "" "Dodatkowy plik (\"diskcopy.dll\") musi zostać pobrany od Microsoft, żeby zainstalować MS-DOS:\n" "- Wybierz opcję \"Tak\", aby pobrać pliku z internetu\n" -"- Wybierz opcję \"Nie\", aby anulować operajcę\n" +"- Wybierz opcję \"Nie\", aby anulować operację\n" "\n" -"Uwaga: Plik zostanie pobrany do folderu aplikacji i będzie użyty pownownie, gdy będzie dostępny." +"Uwaga: Plik zostanie pobrany do folderu aplikacji i będzie użyty ponownie, gdy będzie dostępny." #. • MSG_338 msgid "Revoked UEFI bootloader detected" @@ -1868,9 +1868,9 @@ msgid "" "- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\n" "- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning." msgstr "" -"Rufus wykrył, że wybrany plik ISO zawiera bootloader UEFI, który został unieważniony, i który wygenereuje %s. gdy włączony zostanie \"Secure Boot\" w pełni zaktualizowanym systemie UEFI.\n" +"Rufus wykrył, że wybrany plik ISO zawiera bootloader UEFI, który został unieważniony, i który wygeneruje %s. gdy włączony zostanie \"Secure Boot\" w pełni zaktualizowanym systemie UEFI.\n" "\n" -"- Jeśli uzyskałeś ten obraz ISO z niezaufanego źródła, powinienneś rozważyć możliwość, że może on zawierać złośliwe oprogramowanie dla UEFI i unikać jego uruchamiania.\n" +"- Jeśli uzyskałeś ten obraz ISO z niezaufanego źródła, powinieneś rozważyć możliwość, że może on zawierać złośliwe oprogramowanie dla UEFI i unikać jego uruchamiania.\n" "- Jeśli uzyskałeś go z zaufanego źródła, powinieneś spróbować znaleźć nowszą wersję, która nie wygeneruje tego ostrzeżenia." #. • MSG_340 @@ -1923,7 +1923,7 @@ msgstr "Użyj Rufus MBR" #. #. The following messages are for the Windows Store listing only and are not used by the application msgid "Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc." -msgstr "Rufus to narzędzie, które pomaga formatować i tworzyć bootowalne dyski flash USB, takie jak klucze USB / pendrive, pendrive'y itp." +msgstr "Rufus to narzędzie, które pomaga formatować i tworzyć dyski rozruchowe flash USB, takie jak klucze USB, pendrive-y itp." #. • MSG_901 msgid "Official site: %s" @@ -1962,7 +1962,7 @@ msgstr "Sformatuj nośnik używając: FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" #. • MSG_911 msgid "Create FreeDOS bootable USB drives" -msgstr "Stwórz bootowalny nośnik USB FreeDOS" +msgstr "Stwórz nośnik rozruchowy USB FreeDOS" #. • MSG_912 msgid "Create bootable drives from bootable ISOs (Windows, Linux, etc.)" @@ -1986,7 +1986,7 @@ msgstr "Twórz dyski instalacyjne systemu Windows 11 dla komputerów, które nie #. • MSG_917 msgid "Create persistent Linux partitions" -msgstr "Stwórz particje persistent Linuxa" +msgstr "Utwórz trwałe partycje Linux" #. • MSG_918 msgid "Create VHD/DD images of the selected drive" @@ -1998,7 +1998,7 @@ msgstr "Oblicz sumy kontrolne MD5, SHA-1, SHA-256 i SHA-512 dla wybranego obrazu #. • MSG_920 msgid "Perform bad blocks checks, including detection of \"fake\" flash drives" -msgstr "Sprawdź dysk pod względem spójności danych lub wykryj \"nieorginalny\" pendrive" +msgstr "Sprawdź dysk pod względem spójności danych lub wykryj \"nieoryginalny\" pendrive" #. • MSG_921 msgid "Download official Microsoft Windows retail ISOs" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 2b562a4b..0849e65b 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -10280,7 +10280,7 @@ t IDC_LOG_SAVE "Zapisz" g IDD_NEW_VERSION t IDCANCEL "Zamknij" t IDD_NEW_VERSION "Szukaj aktualizacji - Rufus" -t IDS_NEW_VERSION_AVAIL_TXT "Jest dostępna nowsza wersja. Proszę pobrać najnowszą wersję!" +t IDS_NEW_VERSION_AVAIL_TXT "Nowsza wersja jest dostępna. Proszę pobrać najnowszą wersję!" t IDC_WEBSITE "Kliknij tutaj, aby przejść na stronę www" t IDS_NEW_VERSION_NOTES_GRP "Informacje o wydaniu" t IDS_NEW_VERSION_DOWNLOAD_GRP "Pobierz" @@ -10363,19 +10363,19 @@ t MSG_066 "Niepowodzenie instalacji" t MSG_067 "Nie można otworzyć nośnika. Może być używany przez inny proces. Proszę podłączyć ponownie nośnik i spróbować jeszcze raz." t MSG_068 "Nie można podzielić dysku na partycje." t MSG_069 "Nie można skopiować plików na dysk docelowy." -t MSG_070 "Przerwane przez użytkwonika." +t MSG_070 "Przerwane przez użytkownika." t MSG_071 "Nie można rozpocząć wątku." t MSG_072 "Nie ukończono sprawdzania błędnych sektorów." t MSG_073 "Niepowodzenie skanowania pliku ISO." t MSG_074 "Niepowodzenie wypakowywania pliku ISO." t MSG_075 "Nie można ponownie zamontować woluminu." -t MSG_076 "Nie można załatać/skonfigurować plików do bootowania." +t MSG_076 "Nie można załatać/skonfigurować plików do rozruchu." t MSG_077 "Nie można przypisać litery dysku." t MSG_078 "Nie można zamontować woluminu GUID." t MSG_079 "Urządzenie nie jest gotowe." t MSG_080 "Rufus wykrył, że Windows wciąż opróżnia swoje bufory na urządzenie USB.\n\nZależnie od prędkości twojego urządzenia USB, ta operacja może zająć dużo czasu, zwłaszcza dla dużych plików.\n\nZalecamy, abyś pozwolił Windowsowi skończyć, żeby uniknąć uszkodzeń. Jeśli jesteś już zmęczony czekaniem, możesz po prostu odłączyć urządzenie..." t MSG_081 "Niewspierany obraz" -t MSG_082 "Ten obraz nie jest bootowalny lub używa kompresji sektora rozruchowego niewspieranej przez Rufusa..." +t MSG_082 "Ten obraz nie jest rozruchowy lub używa kompresji sektora rozruchowego niewspieranej przez Rufusa..." t MSG_083 "Zastąpić %s?" t MSG_084 "Ten obraz ISO wydaje się używać przestarzałej wersji '%s'.\nZ tego powodu menu rozruchowe może nie wyświetlać się poprawnie.\n\nNowsza wersja może być pobrana przez Rufus, aby naprawić ten błąd:\n- Wybierz 'Tak', aby połączyć się z internetem i pobrać plik\n- Wybierz 'Nie', aby zostawić istniejący plik ISO niezmienionym\nJeśli nie wiesz co zrobić, powinieneś wybrać 'Tak'.\n\nInformacja: Nowy plik będzie pobrany do aktualnej lokalizacji i jeśli '%s' istnieje, zostanie ponownie użyte automatycznie." t MSG_085 "Pobieranie %s" @@ -10384,21 +10384,21 @@ t MSG_087 "dla NAND %s" t MSG_088 "Obraz jest zbyt duży" t MSG_089 "Ten obraz jest zbyt duży dla wybranego celu." t MSG_090 "Niewspierane ISO" -t MSG_091 "Podczas używania Systemu Typu UEFI, tylko bootowalne obrazy ISO EFI są wspierane. Proszę wybrać bootowalny obraz ISO EFI lub ustawić System Docelowy na BIOS." +t MSG_091 "Podczas używania Systemu Typu UEFI, tylko rozruchowe obrazy ISO EFI są wspierane. Proszę wybrać rozruchowy obraz ISO EFI lub ustawić System Docelowy na BIOS." t MSG_092 "Niewspierany system plików" t MSG_093 "WAŻNE: TEN NAPĘD ZAWIERA WIELE PARTYCJI!!\n\nMoże to obejmować partycje/woluminy, które nie są wymienione lub nawet widoczne z poziomu Windows. Jeżeli chcesz kontynuować, jesteś odpowiedzialny za utratę danych na tych partycjach." t MSG_094 "Wykryto wiele partycji" t MSG_095 "Obraz DD" t MSG_096 "Aktualnie zaznaczony system plików nie może zostać użyty z tym typem ISO. Proszę wybrać inny system plików lub użyć innego ISO." t MSG_097 "'%s' może zostać użyte wyłącznie, jeżeli system plików to NTFS." -t MSG_098 "WAŻNE: Próbujesz zainstalować 'Windows To Go', lecz dysk docelowy nie ma atrybytu 'LOKALNY'. Z tego powodu Windows prawdopodobnie zawiesi się podczas startu, ponieważ Microsoft nie zaprojektował go do działania z dyskami, które zamiast tego mają atrybut 'WYMIENNY'.\n\nCzy nadal chcesz kontynuować?\n\nInformacja: Atrybut 'LOKALNY/WYMIENNY' to właściwość sprzętowa, która może jedynie zostać zmieniona używając narzędzi dostarczanych przez producenta dysku. Jednak te narzędzia PRAWIE NIGDY nie są udostępniane publicznie..." +t MSG_098 "WAŻNE: Próbujesz zainstalować 'Windows To Go', lecz dysk docelowy nie ma atrybutu 'LOKALNY'. Z tego powodu Windows prawdopodobnie zawiesi się podczas startu, ponieważ Microsoft nie zaprojektował go do działania z dyskami, które zamiast tego mają atrybut 'WYMIENNY'.\n\nCzy nadal chcesz kontynuować?\n\nInformacja: Atrybut 'LOKALNY/WYMIENNY' to właściwość sprzętowa, która może jedynie zostać zmieniona używając narzędzi dostarczanych przez producenta dysku. Jednak te narzędzia PRAWIE NIGDY nie są udostępniane publicznie..." t MSG_099 "Ograniczenia systemu plików" t MSG_100 "Ten obraz ISO zawiera plik większy niż 4 GB, większy niż maksymalny dozwolony rozmiar dla systemu plików FAT lub FAT32." t MSG_101 "Brakujące wsparcie WIM" -t MSG_102 "Twoja platforma nie może wypakować plików z archiwów WIM. Wypakowanie WIM jest wymagane aby utworzyć bootowalny dysk USB EFI z Windows 7 i Windows Vista. Możesz to naprawić instalując aktualną wersję 7-Zip.\nCzy chcesz odwiedzić stronę pobierania 7-zip?" +t MSG_102 "Twoja platforma nie może wypakować plików z archiwów WIM. Wypakowanie WIM jest wymagane aby utworzyć rozruchowy dysk USB EFI z Windows 7 i Windows Vista. Możesz to naprawić instalując aktualną wersję 7-Zip.\nCzy chcesz odwiedzić stronę pobierania 7-zip?" t MSG_103 "Pobrać %s?" -t MSG_104 "%s lub późniejszy wymaga zainstalowania pliku '%s'.\nPonieważ ten plik jest większy niż 100 KB i zawsze jest obecny na obrazach ISO %s, nie jest dołączony do Rufusa.\n\nRufus może pobrać brakujący plik dla ciebie:\n- Wybierz 'Yes', aby połączyć sie z internetem i pobrać plik\n- Wybierz 'No', jeśli chcesz później ręcznie skopiować ten plik na dysk \n\nInformacja: Plik zostanie pobrany do obecnego folderu i jeśli '%s' istnieje, zostanie użyty ponownie automatycznie." -t MSG_105 "Przerwanie operacji może pozostawic urządzenie w stanie NIEZDATNYM DO UŻYTKU.\nJeśli jesteś pewien, że chcesz przerwać operację, naciśnij TAK. W innym razie naciśnij NIE." +t MSG_104 "%s lub późniejszy wymaga zainstalowania pliku '%s'.\nPonieważ ten plik jest większy niż 100 KB i zawsze jest obecny na obrazach ISO %s, nie jest dołączony do Rufusa.\n\nRufus może pobrać brakujący plik dla ciebie:\n- Wybierz 'Yes', aby połączyć się z internetem i pobrać plik\n- Wybierz 'No', jeśli chcesz później ręcznie skopiować ten plik na dysk \n\nInformacja: Plik zostanie pobrany do obecnego folderu i jeśli '%s' istnieje, zostanie użyty ponownie automatycznie." +t MSG_105 "Przerwanie operacji może pozostawić urządzenie w stanie NIEZDATNYM DO UŻYTKU.\nJeśli jesteś pewien, że chcesz przerwać operację, naciśnij TAK. W innym razie naciśnij NIE." t MSG_106 "Proszę wybrać folder" t MSG_107 "Wszystkie pliki" t MSG_108 "Dziennik Rufusa" @@ -10420,12 +10420,12 @@ t MSG_124 "Brak trwałości" t MSG_125 "Ustaw rozmiar stałej partycji dla nośnika live USB. Ustawienie rozmiaru na 0 wyłącza trwałą partycję." t MSG_126 "Wybierz jednostkę rozmiaru partycji." t MSG_127 "Nie pokazuj więcej tej wiadomości" -t MSG_128 "Ważna informacjoa o %s" +t MSG_128 "Ważna informacja o %s" t MSG_129 "Właśnie utworzyłeś nośnik, który używa bootloadera UEFI:NTFS. Pamiętaj, że aby wystartować z tego medium, MUSISZ WYŁĄCZYĆ \"SECURE BOOT\".\nAby dowiedzieć się więcej dlaczego jest to wymagane, kliknij poniżej przycisk \"Więcej informacji\"." t MSG_130 "Wybór obrazu Windows" t MSG_131 "To ISO zawiera wiele obrazów Windows.\nWybierz obraz, którego chcesz użyć dla tej instalacji:" t MSG_132 "Inny program lub proces używa tego dysku. Czy chcesz go sformatować mimo to?" -t MSG_133 "Rufus wykrył, że próbujesz utworzyć nośnik \"Windows To Go\" bazujący na ISO 1809.\n\nZ powodu *BŁĘDU MICROSOFTU*, ten nośnik ulegnie awarii podczas bootowania systemu (Blue Screen of Death), chyba że ręcznie zastąpisz plik \"WppRecorder.sys\" wersją z 1803.\n\nNależy również pamiętać, że powodem, dla którego Rufus nie może automatycznie rozwiązać tego problemu, jest to, że \"WppRecorder.sys” jest plikiem chronionym prawem autorskim firmy Microsoft, więc nie możemy zgodnie z prawem osadzić kopii pliku w aplikacji." +t MSG_133 "Rufus wykrył, że próbujesz utworzyć nośnik \"Windows To Go\" bazujący na ISO 1809.\n\nZ powodu *BŁĘDU MICROSOFTU*, ten nośnik ulegnie awarii podczas rozruchu systemu (Blue Screen of Death), chyba że ręcznie zastąpisz plik \"WppRecorder.sys\" wersją z 1803.\n\nNależy również pamiętać, że powodem, dla którego Rufus nie może automatycznie rozwiązać tego problemu, jest to, że \"WppRecorder.sys” jest plikiem chronionym prawem autorskim firmy Microsoft, więc nie możemy zgodnie z prawem osadzić kopii pliku w aplikacji." t MSG_134 "Ponieważ MBR został wybrany jako schemat partycji, Rufus może utworzyć partycję o rozmiarze do 2 TB na tym nośniku, co spowoduje, że %s miejsca na dysku będzie niedostępne.\n\nJesteś pewien, że chcesz kontynuować?" t MSG_135 "Wersja" t MSG_136 "Wydanie" @@ -10441,7 +10441,7 @@ t MSG_145 "PowerShell 3.0 albo nowszy wymagany do uruchomienia tego skryptu." t MSG_146 "Czy chcesz przejść do trybu online i go pobrać?" t MSG_148 "Uruchamianie skryptu pobierania..." t MSG_149 "Pobierz obraz ISO" -t MSG_150 "Typ komputera, na którym chcesz użyć bootowalnego dysku. Przed stworzeniem dysku musisz sam określić, czy docelowy komputer posiada BIOS, czy UEFI, inaczej może się nie uruchomić." +t MSG_150 "Typ komputera, na którym chcesz użyć dysku rozruchowego. Przed stworzeniem dysku musisz sam określić, czy docelowy komputer posiada BIOS, czy UEFI, inaczej może się nie uruchomić." t MSG_151 "'UEFI-CSM' oznacza, że urządzenie uruchomi się jedynie w trybie emulacji BIOSu (znanej jako 'Legacy Mode') w UEFI, ale nie w natywnym trybie UEFI." t MSG_152 "'bez CSM' oznacza, że urządzenie uruchomi się jedynie w natywnym trybie UEFI, ale nie w trybie emulacji BIOSu (znanej jako 'Legacy Mode')." t MSG_153 "Wzorzec testowy: 0x%02X" @@ -10452,10 +10452,10 @@ t MSG_157 "Ustawia docelowy system plików" t MSG_158 "Minimalny rozmiar jaki blok będzie zajmował w systemie plików" t MSG_159 "Użyj tego pola, aby ustawić etykietę dysku.\nZnaki międzynarodowe są dozwolone." t MSG_160 "Przełącz opcje zaawansowane" -t MSG_161 "Sprawdź urządzenie pod kątem błędnych sektorów używając wzoru testoego" +t MSG_161 "Sprawdź urządzenie pod kątem błędnych sektorów używając wzoru testowego" t MSG_162 "Odznacz to pole, aby użyć \"powolnej\" metody formatowania" t MSG_163 "Metoda, która zostanie użyta do stworzenia partycji" -t MSG_164 "Metoda, która zostanie użyta, aby uczynić dysk bootowalnym" +t MSG_164 "Metoda, która zostanie użyta, aby uczynić dysk rozruchowym" t MSG_165 "Kliknij, aby wybrać lub pobrać obraz..." t MSG_166 "Zaznacz to pole, aby zezwolić na wyświetlanie etykiet międzynarodowych i ustawić ikonę urządzenia (tworzy plik autorun.inf)" t MSG_167 "Zainstaluj bootloader UEFI, który przeprowadzi weryfikację typu MD5SUM na nośniku" @@ -10476,7 +10476,7 @@ t MSG_182 "Wersja aplikacji, z której korzystasz" t MSG_183 "Twój adres IP" t MSG_184 "W celu generowania poufnych statystyk użytkowania tego programu możemy przechowywać zebrane informacje \\b co najwyżej rok\\b0, jednak nie będziemy udostępniać żadnych z indywidualnych danych osobom trzecim." t MSG_185 "Proces aktualizacji:" -t MSG_186 "Rufus nie instaluje lub uruchamia procesów w tle, dlatego aktualizacje są sprawdzane wylącznie przy starcie głównego okna aplikacji.\\line\nDostęp do internetu jest wymagany podczas sprawdzania aktualizacji." +t MSG_186 "Rufus nie instaluje lub uruchamia procesów w tle, dlatego aktualizacje są sprawdzane wyłącznie przy starcie głównego okna aplikacji.\\line\nDostęp do internetu jest wymagany podczas sprawdzania aktualizacji." t MSG_187 "Obraz nieprawidłowy dla wybranej opcji rozruchowej" t MSG_188 "Obecny obraz nie pasuje do wybranej opcji rozruchowej. Proszę użyć innego obrazu lub wybrać inną opcję rozruchową." t MSG_189 "Ten obraz ISO jest niekompatybilny z wybranym systemem plików" @@ -10486,7 +10486,7 @@ t MSG_192 "Postęp odczytu" t MSG_193 "Pobrano %s" t MSG_194 "Nie można pobrać %s" t MSG_195 "Używanie wbudowanej wersji pliku(ów) %s" -t MSG_196 "WAŻNE: TEN DYSK UŻYWA NIESTANDARDOWEGO ROZMIARU SEKTORA!\n\nStandardowe dyski używają 512-bajtowego rozmiaru sektora, lecz ten dysk używa %d-bajtowego. W wielu przypadkach oznacza to, że NIE będziesz mógł bootować z tego dysku.\nRufus może spróbować utworzyć dysk rozruchowy, ale NIE MA GWARANCJI, że to zadziała." +t MSG_196 "WAŻNE: TEN DYSK UŻYWA NIESTANDARDOWEGO ROZMIARU SEKTORA!\n\nStandardowe dyski używają 512-bajtowego rozmiaru sektora, lecz ten dysk używa %d-bajtowego. W wielu przypadkach oznacza to, że NIE będziesz mógł startować z tego dysku.\nRufus może spróbować utworzyć dysk rozruchowy, ale NIE MA GWARANCJI, że to zadziała." t MSG_197 "Wykryto niestandardowy rozmiar sektora" t MSG_198 "'Windows To Go' może zostać zainstalowany jedynie na dysku ze strukturą GPT jeżeli ma on ustawiony atrybut LOKALNY. Obecny dysk nie został wykryty jako LOKALNY." t MSG_199 "Ta funkcja nie jest dostępna na tej platformie." @@ -10521,7 +10521,7 @@ t MSG_228 "Zapisywanie Master Boot Record..." t MSG_229 "Zapisywanie Partition Boot Record..." t MSG_230 "Kopiowanie plików DOS..." t MSG_231 "Kopiowanie plików ISO: %s" -t MSG_232 "Ustawianie bootowania Win7 EFI (%s)..." +t MSG_232 "Ustawianie rozruchu Win7 EFI (%s)..." t MSG_233 "Finalizacja, proszę czekać..." t MSG_234 "Instalowanie Syslinux %s..." t MSG_235 "Błędne Sektory: %s %d/%d - %0.2f%% (%d/%d/%d błędów)" @@ -10564,7 +10564,7 @@ t MSG_271 "Obliczanie sum kontrolnych obrazu: %s" t MSG_272 "Oblicz sumy kontrolne MD5, SHA1 oraz SHA256 dla wybranego obrazu" t MSG_273 "Zmień język aplikacji" t MSG_274 "Wykryto obraz %s" -t MSG_275 "Obraz, który wybrałeś to obraz 'ISOHybrid'. To znacza iż może zostać zapisany w trybie %s (kopia plików) lub trybie %s (obraz dysku).\nRufus zaleca użycie trybu %s, abyś zawsze miał pełny dostęp do dysku po jego zapisaniu.\nJednak jeśli napotkasz problemy podczas bootowania możesz spróbować zapisać ten obraz ponownie w trybie %s.\n\nProszę wybrać tryb którego chcesz użyć do zapisania tego obrazu:" +t MSG_275 "Obraz, który wybrałeś to obraz 'ISOHybrid'. Oznacza to, że może zostać zapisany w trybie %s (kopia plików) lub trybie %s (obraz dysku).\nRufus zaleca użycie trybu %s, abyś zawsze miał pełny dostęp do dysku po jego zapisaniu.\nJednak jeśli napotkasz problemy podczas rozruchu możesz spróbować zapisać ten obraz ponownie w trybie %s.\n\nProszę wybrać tryb którego chcesz użyć do zapisania tego obrazu:" t MSG_276 "Zapisz w trybie %s (zalecane)" t MSG_277 "Zapisz w trybie %s" t MSG_278 "Sprawdzanie kolidujących procesów..." @@ -10599,8 +10599,8 @@ t MSG_306 "Szybkie zerowanie dysku: %s" t MSG_307 "to może chwilę potrwać" t MSG_308 "Detekcja VHD" t MSG_309 "Skompresowane archiwum" -t MSG_310 "Obraz ISO, który został wybrany używa UEFI i jest dość mały, żeby być zapisanym jako partycja systemowa EFI (ESP). Zapisywanie do ESP zamiast to ogólnej partycji zajmującej cały dysk. Może być bardziej odpowiedni dla niektórych typów instalacji.\n\nProszę wybrać tryb którym chesz zapisać ten obraz:" -t MSG_311 "Użyj %s w głownym oknie aplikacji, żeby włączyć." +t MSG_310 "Wybrany plik ISO używa UEFI i jest na tyle mały, że można go zapisać jako partycję systemową EFI (ESP). Zapisanie na ESP, zamiast zapisywania na ogólnej partycji danych zajmującej cały dysk, może być preferowane dla niektórych typów instalacji.\n\nProszę wybrać tryb, w którym chcesz zapisać ten obraz:" +t MSG_311 "Użyj %s w głównym oknie aplikacji, żeby włączyć." t MSG_312 "Dodatkowe hasze (SHA512)" t MSG_313 "Zapisz do VHD" t MSG_314 "Oblicz sumy kontrolne obrazu" @@ -10623,9 +10623,9 @@ t MSG_333 "Stwórz konto lokalne o nazwie użytkownika:" t MSG_334 "Ustaw taką samą lokalizację i wartości jak obecny użytkownik" t MSG_335 "Dezaktywuj automatyczne szyfrowanie BitLocker" t MSG_336 "Stały dziennik (log)" -t MSG_337 "Dodatkowy plik (\"diskcopy.dll\") musi zostać pobrany od Microsoft, żeby zainstalować MS-DOS:\n- Wybierz opcję \"Tak\", aby pobrać pliku z internetu\n- Wybierz opcję \"Nie\", aby anulować operajcę\n\nUwaga: Plik zostanie pobrany do folderu aplikacji i będzie użyty pownownie, gdy będzie dostępny." +t MSG_337 "Dodatkowy plik (\"diskcopy.dll\") musi zostać pobrany od Microsoft, żeby zainstalować MS-DOS:\n- Wybierz opcję \"Tak\", aby pobrać pliku z internetu\n- Wybierz opcję \"Nie\", aby anulować operację\n\nUwaga: Plik zostanie pobrany do folderu aplikacji i będzie użyty ponownie, gdy będzie dostępny." t MSG_338 "Wykryto unieważniony bootloader UEFI" -t MSG_339 "Rufus wykrył, że wybrany plik ISO zawiera bootloader UEFI, który został unieważniony, i który wygenereuje %s. gdy włączony zostanie \"Secure Boot\" w pełni zaktualizowanym systemie UEFI.\n\n- Jeśli uzyskałeś ten obraz ISO z niezaufanego źródła, powinienneś rozważyć możliwość, że może on zawierać złośliwe oprogramowanie dla UEFI i unikać jego uruchamiania.\n- Jeśli uzyskałeś go z zaufanego źródła, powinieneś spróbować znaleźć nowszą wersję, która nie wygeneruje tego ostrzeżenia." +t MSG_339 "Rufus wykrył, że wybrany plik ISO zawiera bootloader UEFI, który został unieważniony, i który wygeneruje %s. gdy włączony zostanie \"Secure Boot\" w pełni zaktualizowanym systemie UEFI.\n\n- Jeśli uzyskałeś ten obraz ISO z niezaufanego źródła, powinieneś rozważyć możliwość, że może on zawierać złośliwe oprogramowanie dla UEFI i unikać jego uruchamiania.\n- Jeśli uzyskałeś go z zaufanego źródła, powinieneś spróbować znaleźć nowszą wersję, która nie wygeneruje tego ostrzeżenia." t MSG_340 "ekran \"Naruszenie Bezpieczeństwa\"" t MSG_341 "\"Ekran odzyskiwania systemu Windows\" (BSOD) z '%s'" t MSG_342 "Zkompresowany obraz VHDX" @@ -10636,22 +10636,22 @@ t MSG_346 "Ogranicz system Windows do trybu S (NIEZGODNY z obejściem konta onli t MSG_347 "Tryb eksperta" t MSG_348 "Wypakowywanie plików z archiwum: %s" t MSG_349 "Użyj Rufus MBR" -t MSG_900 "Rufus to narzędzie, które pomaga formatować i tworzyć bootowalne dyski flash USB, takie jak klucze USB / pendrive, pendrive'y itp." +t MSG_900 "Rufus to narzędzie, które pomaga formatować i tworzyć dyski rozruchowe flash USB, takie jak klucze USB, pendrive-y itp." t MSG_901 "Oficjalna strona: %s" t MSG_902 "Kod źródłowy: %s" t MSG_903 "Zmiany: %s" t MSG_904 "Ta aplikacja jest objęta licencją na warunkach licencji publicznej GNU (GPL) w wersji 3.\nZ obacz https://www.gnu.org/licenses/gpl-3.0.html, aby uzyskać szczegółowe informacje." t MSG_910 "Sformatuj nośnik używając: FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" -t MSG_911 "Stwórz bootowalny nośnik USB FreeDOS" +t MSG_911 "Stwórz nośnik rozruchowy USB FreeDOS" t MSG_912 "Twórz dyski rozruchowe z obrazów ISO (Windows, Linux itp.)" t MSG_913 "Twórz dyski rozruchowe z obrazów dysków, włączając skompresowane" t MSG_914 "Stwórz dysk rozruchowy BIOS lub UEFI, włączając bootowalny dysk UEFI NTFS" t MSG_915 "Stwórz dysk 'Windows To Go'" t MSG_916 "Twórz dyski instalacyjne systemu Windows 11 dla komputerów, które nie posiadają modułu TPM ani Secure Boot" -t MSG_917 "Stwórz particje persistent Linuxa" +t MSG_917 "Utwórz trwałe partycje Linux" t MSG_918 "Stwórz obraz VHD/DD z wybranego dysku" t MSG_919 "Oblicz sumy kontrolne MD5, SHA-1, SHA-256 i SHA-512 dla wybranego obrazu" -t MSG_920 "Sprawdź dysk pod względem spójności danych lub wykryj \"nieorginalny\" pendrive" +t MSG_920 "Sprawdź dysk pod względem spójności danych lub wykryj \"nieoryginalny\" pendrive" t MSG_921 "Pobierz oficjalny obraz ISO systemu Microsoft Windows" t MSG_922 "Ściągnij obrazy ISO UEFI Shell" diff --git a/src/rufus.rc b/src/rufus.rc index 7d45ba76..059c0c01 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.6.2192" +CAPTION "Rufus 4.6.2193" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -397,8 +397,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2192,0 - PRODUCTVERSION 4,6,2192,0 + FILEVERSION 4,6,2193,0 + PRODUCTVERSION 4,6,2193,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -416,13 +416,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2192" + VALUE "FileVersion", "4.6.2193" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "� 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2192" + VALUE "ProductVersion", "4.6.2193" END END BLOCK "VarFileInfo" From 248a37e3084f519a02141a72a11289c1d22e7f31 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sat, 14 Sep 2024 12:21:22 +0100 Subject: [PATCH 003/192] [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. --- .github/dependabot.yml | 2 +- .github/issue_template.md | 1 + _sign.cmd | 2 +- res/appstore/packme.cmd | 4 ++-- res/mbr/mbr.S | 4 ++-- src/rufus.c | 10 +++++----- src/rufus.rc | 10 +++++----- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 12301490..5ace4600 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,4 +3,4 @@ updates: - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "daily" + interval: "weekly" diff --git a/.github/issue_template.md b/.github/issue_template.md index 78f390bc..2da326fd 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -23,6 +23,7 @@ YOU HAVE BEEN WARNED. Checklist --------- +- [ ] I have been made aware that if my problem can be summarized as _"I've created or tried to create a media using Rufus, and ..."_, and I am not including a log, **this issue will be summarily closed**. - [ ] I looked at https://github.com/pbatard/rufus/wiki/FAQ to see if my question has already been answered. - [ ] I performed a search in the issue tracker for similar issues using keywords relevant to my problem, such as the error message I got from the log. - [ ] I clicked the 'Log' button (🗒️) or pressed Ctrl-L in Rufus, or used [DebugView](https://learn.microsoft.com/en-us/sysinternals/downloads/debugview), and copy/pasted the log into the section that says `` below. diff --git a/_sign.cmd b/_sign.cmd index ca68f4f1..1da906b6 100644 --- a/_sign.cmd +++ b/_sign.cmd @@ -1,2 +1,2 @@ @echo off -"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64\signtool" sign /v /sha1 3dbc3a2a0e9ce8803b422cfdbc60acd33164965d /fd SHA256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /td SHA256 %* +"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64\signtool" sign /v /sha1 fc4686753937a93fdcd48c2bb4375e239af92dcb /fd SHA256 /tr http://timestamp.acs.microsoft.com /td SHA256 %* diff --git a/res/appstore/packme.cmd b/res/appstore/packme.cmd index 04b8f0dc..193124aa 100644 --- a/res/appstore/packme.cmd +++ b/res/appstore/packme.cmd @@ -27,7 +27,7 @@ del /q *.map >NUL 2>&1 set WDK_PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64 set ZIP_PATH=C:\Program Files\7-Zip -set SIGNATURE_SHA1=3dbc3a2a0e9ce8803b422cfdbc60acd33164965d +set SIGNATURE_SHA1=fc4686753937a93fdcd48c2bb4375e239af92dcb set MANIFEST=AppxManifest.xml set ARCHS=x86 x64 arm arm64 set DEFAULT_SCALE=200 @@ -98,7 +98,7 @@ if "%VERSION_OVERRIDE%"=="" ( echo Will create %VERSION% AppStore Bundle pause -"%WDK_PATH%\signtool" sign /v /sha1 %SIGNATURE_SHA1% /fd SHA256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /td SHA256 *.exe +"%WDK_PATH%\signtool" sign /v /sha1 %SIGNATURE_SHA1% /fd SHA256 /tr http://timestamp.acs.microsoft.com /td SHA256 *.exe if ERRORLEVEL 1 goto out echo [Files]> bundle.map diff --git a/res/mbr/mbr.S b/res/mbr/mbr.S index 746eb2b2..312fa471 100644 --- a/res/mbr/mbr.S +++ b/res/mbr/mbr.S @@ -67,9 +67,9 @@ mbr: push es mov ds, ax # Original MBR is in segment 0 mov bx, 0x0413 # McAfee thinks we are a virus if we use 413 directly... - mov ax,[bx] + mov ax,ds:[bx] dec ax # Remove 1KB from the RAM for our copy - mov [bx],ax + mov ds:[bx],ax shl ax, 6 # Convert to segment address sub ax, MBR_ADDR>>4 # For convenience of disassembly, so that irrespective mov es, ax # of the segment, our base address remains MBR_ADDR diff --git a/src/rufus.c b/src/rufus.c index 37747e25..7c017afc 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -65,7 +65,7 @@ enum bootcheck_return { BOOTCHECK_GENERAL_ERROR = -3, }; -static const char* cmdline_hogger = "rufus.com"; +static const char* cmdline_hogger = ".\\rufus.com"; static const char* ep_reg = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer"; static const char* vs_reg = "Software\\Microsoft\\VisualStudio"; static const char* arch_name[ARCH_MAX] = { @@ -3125,13 +3125,13 @@ static HANDLE SetHogger(void) int i; hog_data = GetResource(hMainInstance, MAKEINTRESOURCEA(IDR_XT_HOGGER), - _RT_RCDATA, cmdline_hogger, &hog_size, FALSE); + _RT_RCDATA, &cmdline_hogger[2], &hog_size, FALSE); if (hog_data != NULL) { // Create our synchronisation mutex hogmutex = CreateMutexA(NULL, TRUE, "Global/Rufus_CmdLine"); // Extract the hogger resource - hFile = CreateFileA(cmdline_hogger, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, + hFile = CreateFileA(&cmdline_hogger[2], GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile != INVALID_HANDLE_VALUE) { // coverity[check_return] @@ -3140,7 +3140,7 @@ static HANDLE SetHogger(void) safe_closehandle(hFile); // Now launch the file from the commandline, by simulating keypresses - input = (INPUT*)calloc(strlen(cmdline_hogger)+1, sizeof(INPUT)); + input = (INPUT*)calloc(strlen(cmdline_hogger) + 1, sizeof(INPUT)); if (input != NULL) { for (i = 0; i < (int)strlen(cmdline_hogger); i++) { input[i].type = INPUT_KEYBOARD; @@ -4083,7 +4083,7 @@ out: ReleaseMutex(hogmutex); safe_closehandle(hogmutex); // Unconditional delete with retry, just in case... - for (i = 0; (!DeleteFileA(cmdline_hogger)) && (i <= 10); i++) + for (i = 0; (!DeleteFileA(&cmdline_hogger[2])) && (i <= 10); i++) Sleep(200); } // Kill the update check thread if running diff --git a/src/rufus.rc b/src/rufus.rc index 059c0c01..e81d2d42 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.6.2193" +CAPTION "Rufus 4.6.2194" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -397,8 +397,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2193,0 - PRODUCTVERSION 4,6,2193,0 + FILEVERSION 4,6,2194,0 + PRODUCTVERSION 4,6,2194,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -416,13 +416,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2193" + VALUE "FileVersion", "4.6.2194" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "� 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2193" + VALUE "ProductVersion", "4.6.2194" END END BLOCK "VarFileInfo" From f453dc272b93adb0d63dd045197f4661fc653211 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Mon, 30 Sep 2024 17:38:47 +0100 Subject: [PATCH 004/192] [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. --- src/dev.c | 4 ++-- src/drive.c | 6 ++++-- src/hash.c | 7 +++++-- src/iso.c | 2 +- src/rufus.rc | 10 +++++----- src/stdio.c | 6 +++--- 6 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/dev.c b/src/dev.c index 801fb124..5ea2b2a0 100644 --- a/src/dev.c +++ b/src/dev.c @@ -877,8 +877,8 @@ BOOL GetDevices(DWORD devnum) continue; } - hDrive = CreateFileA(devint_detail_data->DevicePath, GENERIC_READ|GENERIC_WRITE, - FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + hDrive = CreateFileWithTimeout(devint_detail_data->DevicePath, GENERIC_READ|GENERIC_WRITE, + FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL, 3000); if(hDrive == INVALID_HANDLE_VALUE) { uprintf("Could not open '%s': %s", devint_detail_data->DevicePath, WindowsErrorString()); continue; diff --git a/src/drive.c b/src/drive.c index 8d0514d8..5f378e24 100644 --- a/src/drive.c +++ b/src/drive.c @@ -1894,10 +1894,12 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys SelectedDrive.SectorsPerTrack = DiskGeometry->Geometry.SectorsPerTrack; SelectedDrive.MediaType = DiskGeometry->Geometry.MediaType; - suprintf("Disk type: %s, Disk size: %s, Sector size: %d bytes", (SelectedDrive.MediaType == FixedMedia)?"FIXED":"Removable", + suprintf("Disk type: %s, Disk size: %s, Sector size: %d bytes", + (SelectedDrive.MediaType == FixedMedia) ? "FIXED" : "Removable", SizeToHumanReadable(SelectedDrive.DiskSize, FALSE, TRUE), SelectedDrive.SectorSize); suprintf("Cylinders: %" PRIi64 ", Tracks per cylinder: %d, Sectors per track: %d", DiskGeometry->Geometry.Cylinders, DiskGeometry->Geometry.TracksPerCylinder, DiskGeometry->Geometry.SectorsPerTrack); + assert(SelectedDrive.SectorSize != 0); r = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_LAYOUT_EX, NULL, 0, layout, sizeof(layout), &size, NULL ); if (!r || size <= 0) { @@ -1965,7 +1967,7 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys SizeToHumanReadable(DriveLayout->PartitionEntry[i].PartitionLength.QuadPart, TRUE, FALSE), DriveLayout->PartitionEntry[i].PartitionLength.QuadPart, DriveLayout->PartitionEntry[i].StartingOffset.QuadPart / SelectedDrive.SectorSize, - DriveLayout->PartitionEntry[i].Mbr.BootIndicator?"Yes":"No"); + DriveLayout->PartitionEntry[i].Mbr.BootIndicator ? "Yes" : "No"); // suprintf(" GUID: %s", GuidToString(&DriveLayout->PartitionEntry[i].Mbr.PartitionId)); SelectedDrive.FirstDataSector = min(SelectedDrive.FirstDataSector, (DWORD)(DriveLayout->PartitionEntry[i].StartingOffset.QuadPart / SelectedDrive.SectorSize)); diff --git a/src/hash.c b/src/hash.c index a99d297b..76315edc 100644 --- a/src/hash.c +++ b/src/hash.c @@ -1607,8 +1607,7 @@ static int cmp_pe_section(const void* arg1, const void* arg2) * @len: Size of @efi * @regp: Pointer to a list of regions * - * Parse image binary in PE32(+) format, assuming that sanity of PE image - * has been checked by a caller. + * Parse image binary in PE32(+) format. * * Return: TRUE on success, FALSE on error */ @@ -1623,7 +1622,11 @@ BOOL efi_image_parse(uint8_t* efi, size_t len, struct efi_image_regions** regp) uint32_t align, size, authsz; size_t bytes_hashed; + if (len < 0x80) + return FALSE; dos = (void*)efi; + if (dos->e_lfanew > len - 0x40) + return FALSE; nt = (void*)(efi + dos->e_lfanew); authsz = 0; diff --git a/src/iso.c b/src/iso.c index a5b978be..485de74c 100644 --- a/src/iso.c +++ b/src/iso.c @@ -1268,7 +1268,7 @@ out: sl_index = i; } } - free(buf); + safe_free(buf); } DeleteFileU(isolinux_tmp); } diff --git a/src/rufus.rc b/src/rufus.rc index e81d2d42..9a2845eb 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.6.2194" +CAPTION "Rufus 4.6.2195" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -397,8 +397,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2194,0 - PRODUCTVERSION 4,6,2194,0 + FILEVERSION 4,6,2195,0 + PRODUCTVERSION 4,6,2195,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -416,13 +416,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2194" + VALUE "FileVersion", "4.6.2195" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "� 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2194" + VALUE "ProductVersion", "4.6.2195" END END BLOCK "VarFileInfo" diff --git a/src/stdio.c b/src/stdio.c index 59909196..40045751 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -260,8 +260,8 @@ const char *WindowsErrorString(void) // coverity[var_deref_model] size = FormatMessageU(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | ((hModule != NULL) ? FORMAT_MESSAGE_FROM_HMODULE : 0), hModule, - HRESULT_CODE(error_code), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), - &err_string[presize], (DWORD)(sizeof(err_string)-strlen(err_string)), NULL); + error_code, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), + &err_string[presize], (DWORD)(sizeof(err_string) - strlen(err_string)), NULL); if (size == 0) { format_error = GetLastError(); switch (format_error) { @@ -519,7 +519,7 @@ HANDLE CreateFileWithTimeout(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwS if (hThread != NULL) { if (WaitForSingleObject(hThread, dwTimeOut) == WAIT_TIMEOUT) { CancelSynchronousIo(hThread); - WaitForSingleObject(hThread, INFINITE); + WaitForSingleObject(hThread, 30000); params.dwError = WAIT_TIMEOUT; } CloseHandle(hThread); From c5d61f6696506e5397ea67f8d31b4040f374c57e Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Thu, 3 Oct 2024 20:25:19 +0100 Subject: [PATCH 005/192] [iso] add SBAT revocation validation and reporting --- src/hash.c | 123 +++++++++++++++++++++++++++++++-------------------- src/iso.c | 47 +++++++++++--------- src/parser.c | 51 +++++++++++++++++++++ src/rufus.c | 58 +++++++++++++----------- src/rufus.h | 16 ++++--- src/rufus.rc | 10 ++--- src/stdlg.c | 16 ++++++- 7 files changed, 217 insertions(+), 104 deletions(-) diff --git a/src/hash.c b/src/hash.c index 76315edc..84ab9c5c 100644 --- a/src/hash.c +++ b/src/hash.c @@ -115,7 +115,7 @@ uint64_t md5sum_totalbytes; StrArray modified_files = { 0 }; extern int default_thread_priority; -extern const char* efi_bootname[ARCH_MAX]; +extern const char* efi_archname[ARCH_MAX]; /* * Rotate 32 or 64 bit integers by n bytes. @@ -1760,36 +1760,18 @@ err: * for some part of this but you'd be very, very wrong since the PE sections it * feeds to the hash function does include the PE header checksum field... */ -BOOL PE256File(const char* path, uint8_t* hash) +BOOL PE256Buffer(uint8_t* buf, uint32_t len, uint8_t* hash) { BOOL r = FALSE; HASH_CONTEXT hash_ctx = { {0} }; int i; - uint32_t rb; - uint8_t* buf = NULL; - struct __stat64 stat64 = { 0 }; struct efi_image_regions* regs = NULL; - if ((path == NULL) || (hash == NULL)) - goto out; - - /* Filter anything that would be out of place as a EFI bootloader */ - if (_stat64U(path, &stat64) != 0) { - uprintf("Could not open '%s", path); - goto out; - } - if ((stat64.st_size < 1 * KB) || (stat64.st_size > 64 * MB)) { - uprintf("'%s' is either too small or too large for PE-256", path); - goto out; - } - - /* Read the executable into a memory buffer */ - rb = read_file(path, &buf); - if (rb < 1 * KB) + if ((buf == NULL) || (len == 0) || (len < 1 * KB) || (len > 64 * MB) || (hash == NULL)) goto out; /* Isolate the PE sections to hash */ - if (!efi_image_parse(buf, rb, ®s)) + if (!efi_image_parse(buf, len, ®s)) goto out; /* Hash the relevant PE data */ @@ -1803,7 +1785,6 @@ BOOL PE256File(const char* path, uint8_t* hash) out: free(regs); - free(buf); return r; } @@ -2098,36 +2079,82 @@ BOOL IsFileInDB(const char* path) return FALSE; } -int IsBootloaderRevoked(const char* path) +BOOL IsRevokedBySbat(uint8_t* buf, uint32_t len) +{ + static const char section_name[IMAGE_SIZEOF_SHORT_NAME] = { '.', 's', 'b', 'a', 't', '\0', '\0', '\0' }; + char* sbat = NULL, * version_str; + uint32_t i, j; + sbat_entry_t entry; + IMAGE_SECTION_HEADER* section_header; + + if (buf == NULL || len < 0x100 || sbat_entries == NULL) + return FALSE; + + for (i = 0x40; i < MIN(len, 0x800); i++) { + if (memcmp(section_name, &buf[i], sizeof(section_name)) == 0) { + section_header = (IMAGE_SECTION_HEADER*)&buf[i]; + if (section_header->SizeOfRawData >= len || section_header->PointerToRawData >= len) + return TRUE; + sbat = (char*)&buf[section_header->PointerToRawData]; + break; + } + } + if (sbat == NULL) + return FALSE; + + for (i = 0; sbat[i] != '\0'; ) { + while (sbat[i] == '\n') + i++; + if (sbat[i] == '\0') + break; + entry.product = &sbat[i]; + for (; sbat[i] != ',' && sbat[i] != '\0' && sbat[i] != '\n'; i++); + if (sbat[i] == '\0' || sbat[i] == '\n') + break; + sbat[i++] = '\0'; + version_str = &sbat[i]; + for (; sbat[i] != ',' && sbat[i] != '\0' && sbat[i] != '\n'; i++); + sbat[i++] = '\0'; + entry.version = atoi(version_str); + for (; sbat[i] != '\0' && sbat[i] != '\n'; i++); + if (entry.version == 0) + continue; + for (j = 0; sbat_entries[j].product != NULL; j++) { + if (strcmp(entry.product, sbat_entries[j].product) == 0 && entry.version < sbat_entries[j].version) + return TRUE; + } + } + + return FALSE; +} + +int IsBootloaderRevoked(uint8_t* buf, uint32_t len) { - version_t* ver; uint32_t i; uint8_t hash[SHA256_HASHSIZE]; - if (!PE256File(path, hash)) + if (!PE256Buffer(buf, len, hash)) return -1; + // Check for UEFI DBX revocation for (i = 0; i < ARRAYSIZE(pe256dbx); i += SHA256_HASHSIZE) if (memcmp(hash, &pe256dbx[i], SHA256_HASHSIZE) == 0) return 1; + // Check for Microsoft SSP revocation for (i = 0; i < pe256ssp_size * SHA256_HASHSIZE; i += SHA256_HASHSIZE) if (memcmp(hash, &pe256ssp[i], SHA256_HASHSIZE) == 0) return 2; - ver = GetExecutableVersion(path); - // Blanket filter for Windows 10 1607 (excluded) to Windows 10 20H1 (excluded) - // TODO: Revoke all bootloaders prior to 2023.05 once Microsoft does -// uprintf("Found UEFI bootloader version: %d.%d.%d.%d", ver->Major, ver->Minor, ver->Micro, ver->Nano); - if (ver != NULL && ver->Major == 10 && ver->Minor == 0 && ver->Micro > 14393 && ver->Micro < 19041) + // Check for SBAT revocation + if (IsRevokedBySbat(buf, len)) return 3; + return 0; } void PrintRevokedBootloaderInfo(void) { - uprintf("Found %d officially revoked UEFI bootloaders from embedded list", sizeof(pe256dbx) / SHA256_HASHSIZE); - if (ParseSKUSiPolicy()) + uprintf("Found %d revoked UEFI bootloaders from embedded list", sizeof(pe256dbx) / SHA256_HASHSIZE); + if (ParseSKUSiPolicy() && pe256ssp_size != 0) uprintf("Found %d additional revoked UEFI bootloaders from this system's SKUSiPolicy.p7b", pe256ssp_size); - else - uprintf("WARNING: Could not parse this system's SkuSiPolicy.p7b for additional revoked UEFI bootloaders"); } /* @@ -2148,8 +2175,8 @@ void UpdateMD5Sum(const char* dest_dir, const char* md5sum_name) intptr_t pos; uint32_t i, j, size, md5_size, new_size; uint8_t sum[MD5_HASHSIZE]; - char md5_path[64], path1[64], path2[64], *md5_data = NULL, *new_data = NULL, *str_pos; - char *d, *s, *p; + char md5_path[64], path1[64], path2[64], bootloader_name[32]; + char *md5_data = NULL, *new_data = NULL, *str_pos, *d, *s, *p; if (!img_report.has_md5sum && !validate_md5sum) goto out; @@ -2200,12 +2227,13 @@ void UpdateMD5Sum(const char* dest_dir, const char* md5sum_name) } s = md5_data; // Extract the MD5Sum bootloader(s) - for (i = 1; i < ARRAYSIZE(efi_bootname); i++) { - static_sprintf(path1, "%s\\efi\\boot\\%s", dest_dir, efi_bootname[i]); + for (i = 1; i < ARRAYSIZE(efi_archname); i++) { + static_sprintf(bootloader_name, "boot%s.efi", efi_archname[i]); + static_sprintf(path1, "%s\\efi\\boot\\boot%s.efi", dest_dir, efi_archname[i]); if (!PathFileExistsA(path1)) continue; res_data = (BYTE*)GetResource(hMainInstance, MAKEINTRESOURCEA(IDR_MD5_BOOT + i), - _RT_RCDATA, efi_bootname[i], &res_size, FALSE); + _RT_RCDATA, bootloader_name, &res_size, FALSE); static_strcpy(path2, path1); path2[strlen(path2) - 4] = 0; static_strcat(path2, "_original.efi"); @@ -2232,20 +2260,21 @@ void UpdateMD5Sum(const char* dest_dir, const char* md5sum_name) } // Rename the original bootloaders if present in md5sum.txt for (p = md5_data; (p = StrStrIA(p, " ./efi/boot/boot")) != NULL; ) { - for (i = 1; i < ARRAYSIZE(efi_bootname); i++) { - if (p[12 + strlen(efi_bootname[i])] != 0x0a) + for (i = 1; i < ARRAYSIZE(efi_archname); i++) { + static_sprintf(bootloader_name, "boot%s.efi", efi_archname[i]); + if (p[12 + strlen(bootloader_name)] != 0x0a) continue; - p[12 + strlen(efi_bootname[i])] = 0; - if (lstrcmpiA(&p[12], efi_bootname[i]) == 0) { - size = (uint32_t)(p - s) + 12 + (uint32_t)strlen(efi_bootname[i]) - 4; + p[12 + strlen(bootloader_name)] = 0; + if (lstrcmpiA(&p[12], bootloader_name) == 0) { + size = (uint32_t)(p - s) + 12 + (uint32_t)strlen(bootloader_name) - 4; memcpy(d, s, size); d = &d[size]; strcpy(d, "_original.efi\n"); new_size += 9; d = &d[14]; - s = &p[12 + strlen(efi_bootname[i]) + 1]; + s = &p[12 + strlen(bootloader_name) + 1]; } - p[12 + strlen(efi_bootname[i])] = 0x0a; + p[12 + strlen(bootloader_name)] = 0x0a; } p = &p[12]; } diff --git a/src/iso.c b/src/iso.c index 485de74c..eed8c5a3 100644 --- a/src/iso.c +++ b/src/iso.c @@ -98,9 +98,8 @@ const char* md5sum_name[2] = { "md5sum.txt", "MD5SUMS" }; static const char* casper_dirname = "/casper"; static const char* proxmox_dirname = "/proxmox"; const char* efi_dirname = "/efi/boot"; -const char* efi_bootname[ARCH_MAX] = { - "boot.efi", "bootia32.efi", "bootx64.efi", "bootarm.efi", "bootaa64.efi", "bootia64.efi", - "bootriscv32.efi", "bootriscv64.efi", "bootriscv128.efi", "bootebc.efi" }; +const char* efi_bootname[3] = { "boot", "grub", "mm" }; +const char* efi_archname[ARCH_MAX] = { "", "ia32", "x64", "arm", "aa64", "ia64", "riscv64", "ebc" }; static const char* sources_str = "/sources"; static const char* wininst_name[] = { "install.wim", "install.esd", "install.swm" }; // We only support GRUB/BIOS (x86) that uses a standard config dir (/boot/grub/i386-pc/) @@ -146,8 +145,8 @@ static __inline char* sanitize_filename(char* filename, BOOL* is_identical) } // Must start after the drive part (D:\...) so that we don't eliminate the first column - for (i=2; i 12) + if (strlen(bootloader_name) > 12) continue; - for (j = 0, k = 0; efi_bootname[i][j] != 0; j++) { - if (efi_bootname[i][j] == '.') { + for (j = 0, k = 0; bootloader_name[j] != 0; j++) { + if (bootloader_name[j] == '.') { while (k < 8) name[k++] = ' '; } else { - name[k++] = toupper(efi_bootname[i][j]); + name[k++] = toupper(bootloader_name[j]); } } c = libfat_searchdir(lf_fs, dc, name, &direntry); if (c > 0) { if (!ret) uprintf(" Detected EFI bootloader(s) (from '%s'):", img_report.efi_img_path); - uprintf(" ● '%s'", efi_bootname[i]); + uprintf(" ● '%s'", bootloader_name); ret = TRUE; } } diff --git a/src/parser.c b/src/parser.c index c331167e..2cb09ccf 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1544,3 +1544,54 @@ int sanitize_label(char* label) return 0; } + +/* + * Parse an sbat_level.txt file and returns an array of (product_name, min_version) tuples. + * Array must be freed by caller. + */ +sbat_entry_t* GetSbatEntries(char* sbatlevel) +{ + BOOL eol, eof; + char* version_str; + uint32_t i, num_entries; + sbat_entry_t* sbat_entries; + + if (sbatlevel == NULL) + return FALSE; + + num_entries = 0; + for (i = 0; sbatlevel[i] != '\0'; i++) + if (sbatlevel[i] == '\n') + num_entries++; + + sbat_entries = calloc(num_entries + 2, sizeof(sbat_entry_t)); + if (sbat_entries == NULL) + return NULL; + + num_entries = 0; + for (i = 0; sbatlevel[i] != '\0'; ) { + while (sbatlevel[i] == '\n') + i++; + if (sbatlevel[i] == '\0') + break; + sbat_entries[num_entries].product = &sbatlevel[i]; + for (; sbatlevel[i] != ',' && sbatlevel[i] != '\0' && sbatlevel[i] != '\n'; i++); + if (sbatlevel[i] == '\0' || sbatlevel[i] == '\n') + break; + sbatlevel[i++] = '\0'; + version_str = &sbatlevel[i]; + for (; sbatlevel[i] != ',' && sbatlevel[i] != '\0' && sbatlevel[i] != '\n'; i++); + eol = (sbatlevel[i] == '\0' || sbatlevel[i] == '\n'); + eof = (sbatlevel[i] == '\0'); + sbatlevel[i] = '\0'; + if (!eof) + i++; + sbat_entries[num_entries].version = atoi(version_str); + if (!eol) + for (; sbatlevel[i] != '\0' && sbatlevel[i] != '\n'; i++); + if (sbat_entries[num_entries].version != 0) + num_entries++; + } + + return sbat_entries; +} diff --git a/src/rufus.c b/src/rufus.c index 7c017afc..bb4647c0 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -69,7 +69,7 @@ static const char* cmdline_hogger = ".\\rufus.com"; static const char* ep_reg = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer"; static const char* vs_reg = "Software\\Microsoft\\VisualStudio"; static const char* arch_name[ARCH_MAX] = { - "unknown", "x86_32", "x86_64", "ARM", "ARM64", "Itanic", "RISC-V 32", "RISC-V 64", "RISC-V 128", "EBC" }; + "unknown", "x86_32", "x86_64", "ARM", "ARM64", "Itanic", "RISC-V 64", "EBC" }; static BOOL existing_key = FALSE; // For LGP set/restore static BOOL size_check = TRUE; static BOOL log_displayed = FALSE; @@ -141,11 +141,13 @@ char embedded_sl_version_ext[2][32]; char ClusterSizeLabel[MAX_CLUSTER_SIZES][64]; char msgbox[1024], msgbox_title[32], *ini_file = NULL, *image_path = NULL, *short_image_path; char *archive_path = NULL, image_option_txt[128], *fido_url = NULL, *save_image_type = NULL; +char* sbat_level_txt = NULL; StrArray BlockingProcessList, ImageList; // Number of steps for each FS for FCC_STRUCTURE_PROGRESS const int nb_steps[FS_MAX] = { 5, 5, 12, 1, 10, 1, 1, 1, 1 }; const char* flash_type[BADLOCKS_PATTERN_TYPES] = { "SLC", "MLC", "TLC" }; RUFUS_DRIVE rufus_drive[MAX_DRIVES] = { 0 }; +sbat_entry_t* sbat_entries = NULL; // TODO: Remember to update copyright year in stdlg's AboutCallback() WM_INITDIALOG, // localization_data.sh and the .rc when the year changes! @@ -1210,15 +1212,9 @@ static uint8_t FindArch(const char* path) case IMAGE_FILE_MACHINE_IA64: ret = ARCH_IA_64; break; - case IMAGE_FILE_MACHINE_RISCV32: - ret = ARCH_RISCV_32; - break; case IMAGE_FILE_MACHINE_RISCV64: ret = ARCH_RISCV_64; break; - case IMAGE_FILE_MACHINE_RISCV128: - ret = ARCH_RISCV_128; - break; case IMAGE_FILE_MACHINE_EBC: ret = ARCH_EBC; break; @@ -1298,7 +1294,7 @@ DWORD WINAPI ImageScanThread(LPVOID param) arch = FindArch(tmp_path); if (arch != 0) { uprintf(" Image contains a%s %s EFI boot manager", - (arch >= ARCH_RISCV_32 && arch <= ARCH_RISCV_128) ? "" : "n", arch_name[arch]); + (arch == ARCH_RISCV_64) ? "" : "n", arch_name[arch]); img_report.has_efi = 1 | (1 << arch); img_report.has_bootmgr_efi = TRUE; img_report.wininst_index = 1; @@ -1607,26 +1603,36 @@ static DWORD WINAPI BootCheckThread(LPVOID param) // Check UEFI bootloaders for revocation if (IS_EFI_BOOTABLE(img_report)) { - // coverity[swapped_arguments] - if (GetTempFileNameU(temp_dir, APPLICATION_NAME, 0, tmp) != 0) { - // ExtractISOFile() is case sensitive, so we must use - for (i = 0; i < ARRAYSIZE(img_report.efi_boot_path) && img_report.efi_boot_path[i][0] != 0; i++) { - if (ExtractISOFile(image_path, img_report.efi_boot_path[i], tmp, FILE_ATTRIBUTE_NORMAL) == 0) { - uprintf("Warning: Failed to extract '%s' to check for UEFI revocation", img_report.efi_boot_path[i]); - continue; - } - r = IsBootloaderRevoked(tmp); - if (r > 0) { - is_bootloader_revoked = TRUE; - r = MessageBoxExU(hMainDialog, lmprintf(MSG_339, - (r == 1) ? lmprintf(MSG_340) : lmprintf(MSG_341, "Error code: 0xc0000428")), - lmprintf(MSG_338), MB_OKCANCEL | MB_ICONWARNING | MB_IS_RTL, selected_langid); - if (r == IDCANCEL) - goto out; + uint8_t* buf = NULL; + uint32_t len; + const char* msg; + + for (i = 0; i < ARRAYSIZE(img_report.efi_boot_path) && img_report.efi_boot_path[i][0] != 0; i++) { + len = ReadISOFileToBuffer(image_path, img_report.efi_boot_path[i], &buf); + if (len == 0) { + uprintf("Warning: Failed to extract '%s' to check for UEFI revocation", img_report.efi_boot_path[i]); + continue; + } + r = IsBootloaderRevoked(buf, len); + safe_free(buf); + if (r > 0) { + uprintf("Warning: '%s' is revoked by %s", img_report.efi_boot_path[i], + (r == 1) ? "UEFI DBX" : ((r == 2) ? "Windows SSP" : "Linux SBAT")); + is_bootloader_revoked = TRUE; + switch (r) { + case 2: + msg = lmprintf(MSG_341, "Error code: 0xc0000428"); + break; + default: + msg = lmprintf(MSG_340); break; } + r = MessageBoxExU(hMainDialog, lmprintf(MSG_339, msg), lmprintf(MSG_338), + MB_OKCANCEL | MB_ICONWARNING | MB_IS_RTL, selected_langid); + if (r == IDCANCEL) + goto out; + break; } - DeleteFileU(tmp); } } @@ -4105,6 +4111,8 @@ out: safe_free(fido_url); safe_free(fido_script); safe_free(pe256ssp); + safe_free(sbat_entries); + safe_free(sbat_level_txt); if (argv != NULL) { for (i = 0; i < argc; i++) safe_free(argv[i]); diff --git a/src/rufus.h b/src/rufus.h index 471de019..3fafca66 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -378,9 +378,7 @@ enum ArchType { ARCH_ARM_32, ARCH_ARM_64, ARCH_IA_64, - ARCH_RISCV_32, ARCH_RISCV_64, - ARCH_RISCV_128, ARCH_EBC, ARCH_MAX }; @@ -391,7 +389,7 @@ typedef struct { char cfg_path[128]; // path to the ISO's isolinux.cfg char reactos_path[128]; // path to the ISO's freeldr.sys or setupldr.sys char wininst_path[MAX_WININST][64]; // path to the Windows install image(s) - char efi_boot_path[ARCH_MAX][30]; // paths of detected UEFI bootloaders + char efi_boot_path[64][32]; // paths of detected UEFI bootloaders char efi_img_path[128]; // path to an efi.img file uint64_t image_size; uint64_t projected_size; @@ -487,6 +485,12 @@ typedef struct { uint32_t* address; // 32-bit will do, as we're not dealing with >4GB DLLs... } dll_resolver_t; +/* SBAT entry */ +typedef struct { + char* product; + uint32_t version; +} sbat_entry_t; + /* Alignment macro */ #if defined(__GNUC__) #define ALIGNED(m) __attribute__ ((__aligned__(m))) @@ -687,6 +691,7 @@ extern size_t ubuffer_pos; extern const int nb_steps[FS_MAX]; extern float fScale; extern windows_version_t WindowsVersion; +extern sbat_entry_t* sbat_entries; extern int dialog_showing, force_update, fs_type, boot_type, partition_type, target_type; extern unsigned long syslinux_ldlinux_len[2]; extern char ubuffer[UBUFFER_SIZE], embedded_sl_version_str[2][12]; @@ -798,11 +803,11 @@ extern HANDLE CreateFileWithTimeout(LPCSTR lpFileName, DWORD dwDesiredAccess, DW HANDLE hTemplateFile, DWORD dwTimeOut); extern BOOL SetThreadAffinity(DWORD_PTR* thread_affinity, size_t num_threads); extern BOOL HashFile(const unsigned type, const char* path, uint8_t* sum); -extern BOOL PE256File(const char* path, uint8_t* hash); +extern BOOL PE256Buffer(uint8_t* buf, uint32_t len, uint8_t* hash); extern void UpdateMD5Sum(const char* dest_dir, const char* md5sum_name); extern BOOL HashBuffer(const unsigned type, const uint8_t* buf, const size_t len, uint8_t* sum); extern BOOL IsFileInDB(const char* path); -extern int IsBootloaderRevoked(const char* path); +extern int IsBootloaderRevoked(uint8_t* buf, uint32_t len); extern void PrintRevokedBootloaderInfo(void); extern BOOL IsBufferInDB(const unsigned char* buf, const size_t len); #define printbits(x) _printbits(sizeof(x), &x, 0) @@ -825,6 +830,7 @@ extern HANDLE CreatePreallocatedFile(const char* lpFileName, DWORD dwDesiredAcce DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, LONGLONG fileSize); extern uint32_t ResolveDllAddress(dll_resolver_t* resolver); +extern sbat_entry_t* GetSbatEntries(char* sbatlevel); #define GetTextWidth(hDlg, id) GetTextSize(GetDlgItem(hDlg, id), NULL).cx DWORD WINAPI HashThread(void* param); diff --git a/src/rufus.rc b/src/rufus.rc index 9a2845eb..13274611 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.6.2195" +CAPTION "Rufus 4.6.2196" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -397,8 +397,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2195,0 - PRODUCTVERSION 4,6,2195,0 + FILEVERSION 4,6,2196,0 + PRODUCTVERSION 4,6,2196,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -416,13 +416,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2195" + VALUE "FileVersion", "4.6.2196" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "� 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2195" + VALUE "ProductVersion", "4.6.2196" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index 39e0e127..45c4673e 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -46,7 +46,7 @@ /* Globals */ extern BOOL is_x86_64, appstore_version; -extern char unattend_username[MAX_USERNAME_LENGTH]; +extern char unattend_username[MAX_USERNAME_LENGTH], *sbat_level_txt; static HICON hMessageIcon = (HICON)INVALID_HANDLE_VALUE; static char* szMessageText = NULL; static char* szMessageTitle = NULL; @@ -1372,6 +1372,7 @@ static DWORD WINAPI CheckForFidoThread(LPVOID param) static BOOL is_active = FALSE; LONG_PTR style; char* loc = NULL; + uint32_t i; uint64_t len; HWND hCtrl; @@ -1382,6 +1383,19 @@ static DWORD WINAPI CheckForFidoThread(LPVOID param) return -1; is_active = TRUE; safe_free(fido_url); + safe_free(sbat_entries); + safe_free(sbat_level_txt); + + // Get the latest sbat_level.txt data while we're poking the network for Fido. + len = DownloadToFileOrBuffer(RUFUS_URL "/sbat_level.txt", NULL, (BYTE**)&sbat_level_txt, NULL, FALSE); + if (len != 0 && len < 512) { + sbat_entries = GetSbatEntries(sbat_level_txt); + if (sbat_entries != 0) { + for (i = 0; sbat_entries[i].product != NULL; i++); + if (i > 0) + uprintf("Found %d additional revoked UEFI bootloader filters from remote SBAT", i); + } + } // Get the Fido URL from parsing a 'Fido.ver' on our server. This enables the use of different // Fido versions from different versions of Rufus, if needed, as opposed to always downloading From 15c28434c0ca3594fdf63925da78daac3e4137a7 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sat, 5 Oct 2024 01:05:55 +0100 Subject: [PATCH 006/192] [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. --- src/db.h | 12 +++++ src/hash.c | 83 +++++++++++++++++++++++++++------- src/net.c | 2 +- src/parser.c | 123 +++++++++++++++++++++++++++++++++++++++++++++++++-- src/rufus.c | 5 ++- src/rufus.h | 3 ++ src/rufus.rc | 10 ++--- src/stdlg.c | 2 +- 8 files changed, 210 insertions(+), 30 deletions(-) diff --git a/src/db.h b/src/db.h index 686980f6..30aa301a 100644 --- a/src/db.h +++ b/src/db.h @@ -656,3 +656,15 @@ static uint8_t pe256dbx[] = { 0xff, 0xd7, 0x68, 0x8e, 0x7d, 0x2b, 0x8c, 0x3c, 0x31, 0x40, 0xb4, 0x15, 0xe7, 0x28, 0xbb, 0xe7, 0x66, 0x3c, 0x54, 0xe2, 0x3b, 0xd2, 0x88, 0xff, 0x2c, 0xf4, 0x61, 0x78, 0x35, 0x08, 0x8f, 0x39, 0xff, 0xf4, 0x21, 0xa9, 0xdc, 0xd3, 0xef, 0x38, 0xad, 0x58, 0x5e, 0x8b, 0xac, 0xa4, 0x08, 0xac, 0x2e, 0x4c, 0xdb, 0xdf, 0xa6, 0x79, 0x90, 0x0e, 0xc1, 0x70, 0x89, 0x62, 0x4e, 0x31, 0x0a, 0xda, }; + +/* + * Extended SBATLevel.txt that merges Linux SBAT with Microsoft's SVN + * See https://github.com/pbatard/rufus/issues/2244#issuecomment-2243661539 + * Use as fallback when https://rufus.ie/sbat_level.txt cannot be accessed. + */ +static const char db_sbat_level_txt[] = + "sbat,1,2024010900\n" + "shim,4\n" + "grub,3\n" + "grub.debian,4\n" + "BOOTMGRSECURITYVERSIONNUMBER,0x30000"; diff --git a/src/hash.c b/src/hash.c index 84ab9c5c..1fd58c1f 100644 --- a/src/hash.c +++ b/src/hash.c @@ -116,6 +116,7 @@ StrArray modified_files = { 0 }; extern int default_thread_priority; extern const char* efi_archname[ARCH_MAX]; +extern char* sbat_level_txt; /* * Rotate 32 or 64 bit integers by n bytes. @@ -2081,25 +2082,16 @@ BOOL IsFileInDB(const char* path) BOOL IsRevokedBySbat(uint8_t* buf, uint32_t len) { - static const char section_name[IMAGE_SIZEOF_SHORT_NAME] = { '.', 's', 'b', 'a', 't', '\0', '\0', '\0' }; - char* sbat = NULL, * version_str; - uint32_t i, j; + char* sbat = NULL, *version_str; + uint32_t i, j, sbat_len; sbat_entry_t entry; - IMAGE_SECTION_HEADER* section_header; - if (buf == NULL || len < 0x100 || sbat_entries == NULL) + if (sbat_entries == NULL) return FALSE; - for (i = 0x40; i < MIN(len, 0x800); i++) { - if (memcmp(section_name, &buf[i], sizeof(section_name)) == 0) { - section_header = (IMAGE_SECTION_HEADER*)&buf[i]; - if (section_header->SizeOfRawData >= len || section_header->PointerToRawData >= len) - return TRUE; - sbat = (char*)&buf[section_header->PointerToRawData]; - break; - } - } - if (sbat == NULL) + // Look for a .sbat section + sbat = GetPeSection(buf, &sbat_len, ".sbat"); + if (sbat == NULL || sbat < buf || sbat >= buf + len) return FALSE; for (i = 0; sbat[i] != '\0'; ) { @@ -2128,11 +2120,66 @@ BOOL IsRevokedBySbat(uint8_t* buf, uint32_t len) return FALSE; } +BOOL IsRevokedBySvn(uint8_t* buf, uint32_t len) +{ + wchar_t* rsrc_name = NULL; + uint8_t *base; + uint32_t i, j, rsrc_rva, rsrc_len, *svn_ver; + IMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf; + IMAGE_NT_HEADERS* pe_header; + IMAGE_NT_HEADERS64* pe64_header; + IMAGE_DATA_DIRECTORY img_data_dir; + + if (sbat_entries == NULL) + return FALSE; + + for (i = 0; sbat_entries[i].product != NULL; i++) { + // SVN entries are expected to be uppercase + for (j = 0; j < strlen(sbat_entries[i].product) && isupper(sbat_entries[i].product[j]); j++); + if (j < strlen(sbat_entries[i].product)) + continue; + rsrc_name = utf8_to_wchar(sbat_entries[i].product); + if (rsrc_name == NULL) + continue; + + pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; + if (pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 || pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_ARM) { + img_data_dir = pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE]; + } else { + pe64_header = (IMAGE_NT_HEADERS64*)pe_header; + img_data_dir = pe64_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE]; + } + + base = RvaToPhysical(buf, img_data_dir.VirtualAddress); + rsrc_rva = FindResourceRva(FALSE, base, base, rsrc_name, &rsrc_len); + safe_free(rsrc_name); + if (rsrc_rva != 0) { + if (rsrc_len == sizeof(uint32_t)) { + svn_ver = (uint32_t*)RvaToPhysical(buf, rsrc_rva); + if (svn_ver != NULL && *svn_ver < sbat_entries[i].version) + return TRUE; + } else { + uprintf("WARNING: Unexpected Microsoft SVN version size"); + } + } + } + return FALSE; +} + int IsBootloaderRevoked(uint8_t* buf, uint32_t len) { uint32_t i; uint8_t hash[SHA256_HASHSIZE]; + // Fall back to embedded sbat_level.txt if we couldn't access remote + if (sbat_entries == NULL) { + sbat_level_txt = safe_strdup(db_sbat_level_txt); + sbat_entries = GetSbatEntries(sbat_level_txt); + } + + // TODO: More elaborate PE checks? + if (buf == NULL || len < 0x100 || buf[0] != 'M' || buf[1] != 'Z') + return -2; if (!PE256Buffer(buf, len, hash)) return -1; // Check for UEFI DBX revocation @@ -2143,10 +2190,12 @@ int IsBootloaderRevoked(uint8_t* buf, uint32_t len) for (i = 0; i < pe256ssp_size * SHA256_HASHSIZE; i += SHA256_HASHSIZE) if (memcmp(hash, &pe256ssp[i], SHA256_HASHSIZE) == 0) return 2; - // Check for SBAT revocation + // Check for Linux SBAT revocation if (IsRevokedBySbat(buf, len)) return 3; - + // Sheck for Microsoft SVN revocation + if (IsRevokedBySvn(buf, len)) + return 4; return 0; } diff --git a/src/net.c b/src/net.c index 8e486ca0..f5fc8215 100644 --- a/src/net.c +++ b/src/net.c @@ -240,7 +240,7 @@ uint64_t DownloadToFileOrBufferEx(const char* url, const char* file, const char* if (DownloadStatus != 200) { error_code = ERROR_INTERNET_ITEM_NOT_FOUND; SetLastError(RUFUS_ERROR(error_code)); - uprintf("%s: %d", (DownloadStatus == 404) ? "File not found" : "Unable to access file", DownloadStatus); + uprintf("%s '%s': %d", (DownloadStatus == 404) ? "File not found" : "Unable to access file", url, DownloadStatus); goto out; } dwSize = sizeof(strsize); diff --git a/src/parser.c b/src/parser.c index 2cb09ccf..48905642 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1570,10 +1570,17 @@ sbat_entry_t* GetSbatEntries(char* sbatlevel) num_entries = 0; for (i = 0; sbatlevel[i] != '\0'; ) { - while (sbatlevel[i] == '\n') + // Eliminate blank lines + if (sbatlevel[i] == '\n') { i++; - if (sbatlevel[i] == '\0') - break; + continue; + } + // Eliminate comments + if (sbatlevel[i] == '#') { + while (sbatlevel[i] != '\n' && sbatlevel[i] != '\0') + i++; + continue; + } sbat_entries[num_entries].product = &sbatlevel[i]; for (; sbatlevel[i] != ',' && sbatlevel[i] != '\0' && sbatlevel[i] != '\n'; i++); if (sbatlevel[i] == '\0' || sbatlevel[i] == '\n') @@ -1586,7 +1593,11 @@ sbat_entry_t* GetSbatEntries(char* sbatlevel) sbatlevel[i] = '\0'; if (!eof) i++; - sbat_entries[num_entries].version = atoi(version_str); + // Allow the provision of an hex version + if (version_str[0] == '0' && version_str[1] == 'x') + sbat_entries[num_entries].version = strtoul(version_str, NULL, 16); + else + sbat_entries[num_entries].version = strtoul(version_str, NULL, 10); if (!eol) for (; sbatlevel[i] != '\0' && sbatlevel[i] != '\n'; i++); if (sbat_entries[num_entries].version != 0) @@ -1595,3 +1606,107 @@ sbat_entry_t* GetSbatEntries(char* sbatlevel) return sbat_entries; } + +/* + * PE parsing functions + */ + +// Return the address of a PE section from a PE buffer +uint8_t* GetPeSection(uint8_t* buf, uint32_t* sec_len, const char* name) +{ + char section_name[IMAGE_SIZEOF_SHORT_NAME] = { 0 }; + uint32_t i, nb_sections; + IMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf; + IMAGE_NT_HEADERS* pe_header; + IMAGE_NT_HEADERS64* pe64_header; + IMAGE_SECTION_HEADER* section_header; + + static_strcpy(section_name, name); + + pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; + if (pe_header == NULL) + return NULL; + if (pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 || pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_ARM) { + section_header = (IMAGE_SECTION_HEADER*)(&pe_header[1]); + nb_sections = pe_header->FileHeader.NumberOfSections; + } else { + pe64_header = (IMAGE_NT_HEADERS64*)pe_header; + section_header = (IMAGE_SECTION_HEADER*)(&pe64_header[1]); + nb_sections = pe64_header->FileHeader.NumberOfSections; + } + for (i = 0; i < nb_sections; i++) { + if (memcmp(section_header[i].Name, section_name, sizeof(section_name)) == 0) { + *sec_len = section_header->SizeOfRawData; + return &buf[section_header[i].PointerToRawData]; + } + } + return NULL; +} + +// Convert an RVA address to a physical address from a PE buffer +uint8_t* RvaToPhysical(uint8_t* buf, uint32_t rva) +{ + uint32_t i, nb_sections; + IMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf; + IMAGE_NT_HEADERS* pe_header; + IMAGE_NT_HEADERS64* pe64_header; + IMAGE_SECTION_HEADER* section_header; + + pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; + if (pe_header == NULL) + return NULL; + + if (pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 || pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_ARM) { + section_header = (IMAGE_SECTION_HEADER*)(pe_header + 1); + nb_sections = pe_header->FileHeader.NumberOfSections; + } else { + pe64_header = (IMAGE_NT_HEADERS64*)pe_header; + section_header = (IMAGE_SECTION_HEADER*)(pe64_header + 1); + nb_sections = pe64_header->FileHeader.NumberOfSections; + } + + for (i = 0; i < nb_sections; i++) { + if ((section_header[i].VirtualAddress <= rva && rva < (section_header[i].VirtualAddress + section_header[i].Misc.VirtualSize))) + break; + } + if (i >= nb_sections) + return NULL; + + return &buf[section_header[i].PointerToRawData + (rva - section_header[i].VirtualAddress)]; +} + +// Using the MS APIs to poke the resources of the EFI bootloaders is simply TOO. DAMN. SLOW. +// So, to QUICKLY access the resources we need, we reivent Microsoft's sub-optimal resource parser. +uint32_t FindResourceRva(BOOL found, uint8_t* base, uint8_t* cur, const wchar_t* name, uint32_t* len) +{ + uint32_t rva; + WORD i; + IMAGE_RESOURCE_DIRECTORY* dir = (IMAGE_RESOURCE_DIRECTORY*)cur; + IMAGE_RESOURCE_DIRECTORY_ENTRY* dir_entry = (IMAGE_RESOURCE_DIRECTORY_ENTRY*)&dir[1]; + IMAGE_RESOURCE_DIR_STRING_U* dir_string; + IMAGE_RESOURCE_DATA_ENTRY* data_entry; + + if (base == NULL || cur == NULL || name == NULL) + return 0; + + for (i = 0; i < dir->NumberOfNamedEntries + dir->NumberOfIdEntries; i++) { + if (!found && i < dir->NumberOfNamedEntries) { + dir_string = (IMAGE_RESOURCE_DIR_STRING_U*)(base + dir_entry[i].NameOffset); + if (dir_string->Length != wcslen(name) || + memcmp(name, dir_string->NameString, wcslen(name)) != 0) + continue; + found = TRUE; + } + if (dir_entry[i].OffsetToData & IMAGE_RESOURCE_DATA_IS_DIRECTORY) { + rva = FindResourceRva(found, base, &base[dir_entry[i].OffsetToDirectory], name, len); + if (rva != 0) + return rva; + } else if (found) { + data_entry = (IMAGE_RESOURCE_DATA_ENTRY*)(base + dir_entry[i].OffsetToData); + if (len != NULL) + *len = data_entry->Size; + return data_entry->OffsetToData; + } + } + return 0; +} diff --git a/src/rufus.c b/src/rufus.c index bb4647c0..cdf10b86 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1608,6 +1608,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) const char* msg; for (i = 0; i < ARRAYSIZE(img_report.efi_boot_path) && img_report.efi_boot_path[i][0] != 0; i++) { + static const char* revocation_type[] = { "UEFI DBX", "Windows SecuritySiPolicy", "Linux SBAT", "Windows SVN" }; len = ReadISOFileToBuffer(image_path, img_report.efi_boot_path[i], &buf); if (len == 0) { uprintf("Warning: Failed to extract '%s' to check for UEFI revocation", img_report.efi_boot_path[i]); @@ -1616,8 +1617,8 @@ static DWORD WINAPI BootCheckThread(LPVOID param) r = IsBootloaderRevoked(buf, len); safe_free(buf); if (r > 0) { - uprintf("Warning: '%s' is revoked by %s", img_report.efi_boot_path[i], - (r == 1) ? "UEFI DBX" : ((r == 2) ? "Windows SSP" : "Linux SBAT")); + assert(r <= ARRAYSIZE(revocation_type)); + uprintf("Warning: '%s' has been revoked by %s", img_report.efi_boot_path[i], revocation_type[r - 1]); is_bootloader_revoked = TRUE; switch (r) { case 2: diff --git a/src/rufus.h b/src/rufus.h index 3fafca66..0ff7f209 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -831,6 +831,9 @@ extern HANDLE CreatePreallocatedFile(const char* lpFileName, DWORD dwDesiredAcce DWORD dwFlagsAndAttributes, LONGLONG fileSize); extern uint32_t ResolveDllAddress(dll_resolver_t* resolver); extern sbat_entry_t* GetSbatEntries(char* sbatlevel); +extern uint8_t* GetPeSection(uint8_t* buf, uint32_t* sec_len, const char* name); +extern uint8_t* RvaToPhysical(uint8_t* buf, uint32_t rva); +extern uint32_t FindResourceRva(BOOL found, uint8_t* base, uint8_t* cur, const wchar_t* name, uint32_t* len); #define GetTextWidth(hDlg, id) GetTextSize(GetDlgItem(hDlg, id), NULL).cx DWORD WINAPI HashThread(void* param); diff --git a/src/rufus.rc b/src/rufus.rc index 13274611..ec45982a 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.6.2196" +CAPTION "Rufus 4.6.2197" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -397,8 +397,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2196,0 - PRODUCTVERSION 4,6,2196,0 + FILEVERSION 4,6,2197,0 + PRODUCTVERSION 4,6,2197,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -416,13 +416,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2196" + VALUE "FileVersion", "4.6.2197" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "� 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2196" + VALUE "ProductVersion", "4.6.2197" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index 45c4673e..0be69245 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -1393,7 +1393,7 @@ static DWORD WINAPI CheckForFidoThread(LPVOID param) if (sbat_entries != 0) { for (i = 0; sbat_entries[i].product != NULL; i++); if (i > 0) - uprintf("Found %d additional revoked UEFI bootloader filters from remote SBAT", i); + uprintf("Found %d additional UEFI revocation filters from remote SBAT", i); } } From 3e840a94ce33840c45c503d8cb113ac0b1746dfb Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sat, 5 Oct 2024 11:03:42 +0100 Subject: [PATCH 007/192] [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. --- _sign.cmd | 2 +- res/appstore/packme.cmd | 2 +- res/hogger/hogger.asm | 2 +- res/hogger/hogger.c | 2 +- src/hash.c | 10 +++++----- src/parser.c | 43 ++++++++++++++++++++++++----------------- src/rufus.c | 2 +- src/rufus.h | 4 ++-- src/rufus.rc | 10 +++++----- src/stdfn.c | 2 +- src/wue.c | 6 ++++++ 11 files changed, 49 insertions(+), 36 deletions(-) diff --git a/_sign.cmd b/_sign.cmd index 1da906b6..40f24e22 100644 --- a/_sign.cmd +++ b/_sign.cmd @@ -1,2 +1,2 @@ @echo off -"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64\signtool" sign /v /sha1 fc4686753937a93fdcd48c2bb4375e239af92dcb /fd SHA256 /tr http://timestamp.acs.microsoft.com /td SHA256 %* +"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64\signtool" sign /v /sha1 fc4686753937a93fdcd48c2bb4375e239af92dcb /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 %* diff --git a/res/appstore/packme.cmd b/res/appstore/packme.cmd index 193124aa..bf7a62ee 100644 --- a/res/appstore/packme.cmd +++ b/res/appstore/packme.cmd @@ -98,7 +98,7 @@ if "%VERSION_OVERRIDE%"=="" ( echo Will create %VERSION% AppStore Bundle pause -"%WDK_PATH%\signtool" sign /v /sha1 %SIGNATURE_SHA1% /fd SHA256 /tr http://timestamp.acs.microsoft.com /td SHA256 *.exe +"%WDK_PATH%\signtool" sign /v /sha1 %SIGNATURE_SHA1% /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 *.exe if ERRORLEVEL 1 goto out echo [Files]> bundle.map diff --git a/res/hogger/hogger.asm b/res/hogger/hogger.asm index dbab990c..836b8e92 100644 --- a/res/hogger/hogger.asm +++ b/res/hogger/hogger.asm @@ -1,6 +1,6 @@ ; Rufus: The Reliable USB Formatting Utility ; Commandline hogger, assembly version (NASM) - ; Copyright 2014 Pete Batard + ; Copyright © 2014 Pete Batard ; ; This program is free software: you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by diff --git a/res/hogger/hogger.c b/res/hogger/hogger.c index a03b76ee..01164b37 100644 --- a/res/hogger/hogger.c +++ b/res/hogger/hogger.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Commandline hogger, C version - * Copyright 2014 Pete Batard + * Copyright © 2014 Pete Batard * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/hash.c b/src/hash.c index 1fd58c1f..c5dd18f8 100644 --- a/src/hash.c +++ b/src/hash.c @@ -2090,7 +2090,7 @@ BOOL IsRevokedBySbat(uint8_t* buf, uint32_t len) return FALSE; // Look for a .sbat section - sbat = GetPeSection(buf, &sbat_len, ".sbat"); + sbat = GetPeSection(buf, ".sbat", &sbat_len); if (sbat == NULL || sbat < buf || sbat >= buf + len) return FALSE; @@ -2123,7 +2123,7 @@ BOOL IsRevokedBySbat(uint8_t* buf, uint32_t len) BOOL IsRevokedBySvn(uint8_t* buf, uint32_t len) { wchar_t* rsrc_name = NULL; - uint8_t *base; + uint8_t *root; uint32_t i, j, rsrc_rva, rsrc_len, *svn_ver; IMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf; IMAGE_NT_HEADERS* pe_header; @@ -2150,8 +2150,8 @@ BOOL IsRevokedBySvn(uint8_t* buf, uint32_t len) img_data_dir = pe64_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE]; } - base = RvaToPhysical(buf, img_data_dir.VirtualAddress); - rsrc_rva = FindResourceRva(FALSE, base, base, rsrc_name, &rsrc_len); + root = RvaToPhysical(buf, img_data_dir.VirtualAddress); + rsrc_rva = FindResourceRva(rsrc_name, root, root, &rsrc_len); safe_free(rsrc_name); if (rsrc_rva != 0) { if (rsrc_len == sizeof(uint32_t)) { @@ -2159,7 +2159,7 @@ BOOL IsRevokedBySvn(uint8_t* buf, uint32_t len) if (svn_ver != NULL && *svn_ver < sbat_entries[i].version) return TRUE; } else { - uprintf("WARNING: Unexpected Microsoft SVN version size"); + uprintf("WARNING: Unexpected Secure Version Number size"); } } } diff --git a/src/parser.c b/src/parser.c index 48905642..2f000650 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1611,8 +1611,8 @@ sbat_entry_t* GetSbatEntries(char* sbatlevel) * PE parsing functions */ -// Return the address of a PE section from a PE buffer -uint8_t* GetPeSection(uint8_t* buf, uint32_t* sec_len, const char* name) +// Return the address and (optionally) the length of a PE section from a PE buffer +uint8_t* GetPeSection(uint8_t* buf, const char* name, uint32_t* len) { char section_name[IMAGE_SIZEOF_SHORT_NAME] = { 0 }; uint32_t i, nb_sections; @@ -1623,9 +1623,10 @@ uint8_t* GetPeSection(uint8_t* buf, uint32_t* sec_len, const char* name) static_strcpy(section_name, name); - pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; - if (pe_header == NULL) + if (buf == NULL || name == NULL) return NULL; + + pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; if (pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 || pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_ARM) { section_header = (IMAGE_SECTION_HEADER*)(&pe_header[1]); nb_sections = pe_header->FileHeader.NumberOfSections; @@ -1636,7 +1637,8 @@ uint8_t* GetPeSection(uint8_t* buf, uint32_t* sec_len, const char* name) } for (i = 0; i < nb_sections; i++) { if (memcmp(section_header[i].Name, section_name, sizeof(section_name)) == 0) { - *sec_len = section_header->SizeOfRawData; + if (len != NULL) + *len = section_header->SizeOfRawData; return &buf[section_header[i].PointerToRawData]; } } @@ -1652,10 +1654,10 @@ uint8_t* RvaToPhysical(uint8_t* buf, uint32_t rva) IMAGE_NT_HEADERS64* pe64_header; IMAGE_SECTION_HEADER* section_header; - pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; - if (pe_header == NULL) + if (buf == NULL) return NULL; + pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; if (pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 || pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_ARM) { section_header = (IMAGE_SECTION_HEADER*)(pe_header + 1); nb_sections = pe_header->FileHeader.NumberOfSections; @@ -1677,32 +1679,37 @@ uint8_t* RvaToPhysical(uint8_t* buf, uint32_t rva) // Using the MS APIs to poke the resources of the EFI bootloaders is simply TOO. DAMN. SLOW. // So, to QUICKLY access the resources we need, we reivent Microsoft's sub-optimal resource parser. -uint32_t FindResourceRva(BOOL found, uint8_t* base, uint8_t* cur, const wchar_t* name, uint32_t* len) +static BOOL FoundResourceRva = FALSE; +uint32_t FindResourceRva(const wchar_t* name, uint8_t* root, uint8_t* dir, uint32_t* len) { uint32_t rva; WORD i; - IMAGE_RESOURCE_DIRECTORY* dir = (IMAGE_RESOURCE_DIRECTORY*)cur; - IMAGE_RESOURCE_DIRECTORY_ENTRY* dir_entry = (IMAGE_RESOURCE_DIRECTORY_ENTRY*)&dir[1]; + IMAGE_RESOURCE_DIRECTORY* _dir = (IMAGE_RESOURCE_DIRECTORY*)dir; + IMAGE_RESOURCE_DIRECTORY_ENTRY* dir_entry = (IMAGE_RESOURCE_DIRECTORY_ENTRY*)&_dir[1]; IMAGE_RESOURCE_DIR_STRING_U* dir_string; IMAGE_RESOURCE_DATA_ENTRY* data_entry; - if (base == NULL || cur == NULL || name == NULL) + if (root == NULL || dir == NULL || name == NULL) return 0; - for (i = 0; i < dir->NumberOfNamedEntries + dir->NumberOfIdEntries; i++) { - if (!found && i < dir->NumberOfNamedEntries) { - dir_string = (IMAGE_RESOURCE_DIR_STRING_U*)(base + dir_entry[i].NameOffset); + // Initial invocation should always start at the root + if (root == dir) + FoundResourceRva = FALSE; + + for (i = 0; i < _dir->NumberOfNamedEntries + _dir->NumberOfIdEntries; i++) { + if (!FoundResourceRva && i < _dir->NumberOfNamedEntries) { + dir_string = (IMAGE_RESOURCE_DIR_STRING_U*)(root + dir_entry[i].NameOffset); if (dir_string->Length != wcslen(name) || memcmp(name, dir_string->NameString, wcslen(name)) != 0) continue; - found = TRUE; + FoundResourceRva = TRUE; } if (dir_entry[i].OffsetToData & IMAGE_RESOURCE_DATA_IS_DIRECTORY) { - rva = FindResourceRva(found, base, &base[dir_entry[i].OffsetToDirectory], name, len); + rva = FindResourceRva(name, root, &root[dir_entry[i].OffsetToDirectory], len); if (rva != 0) return rva; - } else if (found) { - data_entry = (IMAGE_RESOURCE_DATA_ENTRY*)(base + dir_entry[i].OffsetToData); + } else if (FoundResourceRva) { + data_entry = (IMAGE_RESOURCE_DATA_ENTRY*)(root + dir_entry[i].OffsetToData); if (len != NULL) *len = data_entry->Size; return data_entry->OffsetToData; diff --git a/src/rufus.c b/src/rufus.c index cdf10b86..dade331f 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1608,7 +1608,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) const char* msg; for (i = 0; i < ARRAYSIZE(img_report.efi_boot_path) && img_report.efi_boot_path[i][0] != 0; i++) { - static const char* revocation_type[] = { "UEFI DBX", "Windows SecuritySiPolicy", "Linux SBAT", "Windows SVN" }; + static const char* revocation_type[] = { "UEFI DBX", "Windows SSP", "Linux SBAT", "Windows SVN" }; len = ReadISOFileToBuffer(image_path, img_report.efi_boot_path[i], &buf); if (len == 0) { uprintf("Warning: Failed to extract '%s' to check for UEFI revocation", img_report.efi_boot_path[i]); diff --git a/src/rufus.h b/src/rufus.h index 0ff7f209..389fb12b 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -831,9 +831,9 @@ extern HANDLE CreatePreallocatedFile(const char* lpFileName, DWORD dwDesiredAcce DWORD dwFlagsAndAttributes, LONGLONG fileSize); extern uint32_t ResolveDllAddress(dll_resolver_t* resolver); extern sbat_entry_t* GetSbatEntries(char* sbatlevel); -extern uint8_t* GetPeSection(uint8_t* buf, uint32_t* sec_len, const char* name); +extern uint8_t* GetPeSection(uint8_t* buf, const char* name, uint32_t* len); extern uint8_t* RvaToPhysical(uint8_t* buf, uint32_t rva); -extern uint32_t FindResourceRva(BOOL found, uint8_t* base, uint8_t* cur, const wchar_t* name, uint32_t* len); +extern uint32_t FindResourceRva(const wchar_t* name, uint8_t* root, uint8_t* dir, uint32_t* len); #define GetTextWidth(hDlg, id) GetTextSize(GetDlgItem(hDlg, id), NULL).cx DWORD WINAPI HashThread(void* param); diff --git a/src/rufus.rc b/src/rufus.rc index ec45982a..ffba8ce1 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.6.2197" +CAPTION "Rufus 4.6.2198" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -397,8 +397,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2197,0 - PRODUCTVERSION 4,6,2197,0 + FILEVERSION 4,6,2198,0 + PRODUCTVERSION 4,6,2198,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -416,13 +416,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2197" + VALUE "FileVersion", "4.6.2198" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "� 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2197" + VALUE "ProductVersion", "4.6.2198" END END BLOCK "VarFileInfo" diff --git a/src/stdfn.c b/src/stdfn.c index 5265bf94..ec4933a0 100644 --- a/src/stdfn.c +++ b/src/stdfn.c @@ -738,7 +738,7 @@ out: /* * Get a resource from the RC. If needed that resource can be duplicated. * If duplicate is true and len is non-zero, the a zeroed buffer of 'len' - * size is allocated for the resource. Else the buffer is allocate for + * size is allocated for the resource. Else the buffer is allocated for * the resource size. */ uint8_t* GetResource(HMODULE module, char* name, char* type, const char* desc, DWORD* len, BOOL duplicate) diff --git a/src/wue.c b/src/wue.c index 9fadd53d..197ed5a7 100644 --- a/src/wue.c +++ b/src/wue.c @@ -194,6 +194,12 @@ char* CreateUnattendXml(int arch, int flags) fprintf(fd, " %d\n", order++); fprintf(fd, " net user "%s" /logonpasswordchg:yes\n", unattend_username); fprintf(fd, " \n"); + // Some people report that using the `net user` command above might reset the password expiration to 90 days... + // To alleviate that, blanket set passwords on the target machine to never expire. + fprintf(fd, " \n"); + fprintf(fd, " %d\n", order++); + fprintf(fd, " net accounts /maxpwage:unlimited\n"); + fprintf(fd, " \n"); fprintf(fd, " \n"); } } From 98a42a235f67f6e535b6ab07c23bd4eb5f8ba770 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sat, 5 Oct 2024 20:00:40 +0100 Subject: [PATCH 008/192] [wue] add setup wrapper project for Windows 11 24H2 in-place upgrades --- .github/workflows/setup.yml | 52 ++++++ res/icons/license.txt | 5 + res/icons/setup.ico | Bin 0 -> 31354 bytes res/icons/setup.svg | 11 ++ res/setup/.editorconfig | 9 ++ res/setup/readme.txt | 29 ++++ res/setup/resource.h | 16 ++ res/setup/setup.c | 125 +++++++++++++++ res/setup/setup.rc | 116 ++++++++++++++ res/setup/setup.sln | 37 +++++ res/setup/setup.vcxproj | 272 ++++++++++++++++++++++++++++++++ res/setup/setup.vcxproj.filters | 27 ++++ src/rufus.rc | 12 +- 13 files changed, 705 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/setup.yml create mode 100644 res/icons/setup.ico create mode 100644 res/icons/setup.svg create mode 100644 res/setup/.editorconfig create mode 100644 res/setup/readme.txt create mode 100644 res/setup/resource.h create mode 100644 res/setup/setup.c create mode 100644 res/setup/setup.rc create mode 100644 res/setup/setup.sln create mode 100644 res/setup/setup.vcxproj create mode 100644 res/setup/setup.vcxproj.filters diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml new file mode 100644 index 00000000..98c62dc3 --- /dev/null +++ b/.github/workflows/setup.yml @@ -0,0 +1,52 @@ +name: setup +run-name: Windows setup wrapper build + +on: + workflow_dispatch: + branches: [ master ] + +env: + SOLUTION_FILE_PATH: ./res/setup/setup.sln + BUILD_CONFIGURATION: Release + +jobs: + VS2022-Build: + runs-on: windows-latest + + strategy: + matrix: + TARGET_PLATFORM: [x64, arm64] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v2 + with: + msbuild-architecture: x64 + + - name: Build + shell: cmd + run: | + msbuild ${{ env.SOLUTION_FILE_PATH }} /m /p:Configuration=${{ env.BUILD_CONFIGURATION }},Platform=${{ matrix.TARGET_PLATFORM }} + move .\res\setup\${{ matrix.TARGET_PLATFORM }}\Release\setup.exe .\setup_${{ matrix.TARGET_PLATFORM }}.exe + + - name: Display SHA-256 + run: sha256sum ./setup_${{ matrix.TARGET_PLATFORM }}.exe + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.TARGET_PLATFORM }} + path: ./*.exe + + Extra-Step-To-Merge-Artifacts-Thanks-To-Upload-Artifact-v4-Breaking-Backwards-Compatibility: + runs-on: windows-latest + needs: VS2022-Build + steps: + - name: Merge Artifacts + uses: actions/upload-artifact/merge@v4 + with: + name: setup + delete-merged: true diff --git a/res/icons/license.txt b/res/icons/license.txt index 4d78ab29..cd9f039c 100644 --- a/res/icons/license.txt +++ b/res/icons/license.txt @@ -8,6 +8,11 @@ o hash-*.png, info-*.png, lang-*.png, log-*.png, save-*.png, settings-*.png CC BY-ND 4.0 when used as native resolution bitmaps, Commercial License otherwise See https://www.axialis.com/icongenerator/iconset-license.html#free +o setup.ico + Base SVG from https://tablericons.com/ + No attribution required. + With arrow overlay from Axialis Icon Set. + NB: To be on the safe side with regards to icon use and redistribution, we did purchase a Commercial License for the Axialis icons. If you are planning to use these icons outside of this project, you may diff --git a/res/icons/setup.ico b/res/icons/setup.ico new file mode 100644 index 0000000000000000000000000000000000000000..fcfba3ec3259ddabc4e69d216f9558cf7536940a GIT binary patch literal 31354 zcmeIb1z1&C+dsTHv^1!6NTVX%DWM<=5`rj5my}3Ja}WWMMi8V+LXlFifa8E5QVNQM z#E8<}NStqN;bs<_hS~F!CUOKhIGz(N&#W)_oD)*f)7?OGa3B$}yOG^CFTn)!LUM70$ynZ{#6v*pHol!TFu>1AIj= zKMXSucE1akS^Y3&xNf)X59DE=*8o0Xd>2X!{X>sBFb_|McyNDdlwwLgUG!iuQ)I2C_rNj=mUkC8c zp2NPKHf8u0KYO4H*v9CaI%Cbm9deFOB*j`3{(jN{FyBx0wX;XyPkigQt>e4*2fr6g z{jX9q8iH1^AjlsezypF(cOZG24gngpx&wd?IvWTHWMLzqtAgN{4EI0q&lvPs|JQzg zI)_POO@$7DZ$mB9R{V6FsSwpa@(jM(hlpYMI}Va+;5}Ug2n8qrXaE=mSOfjU21wVp zF$2=mKeCa3Nm2pST?hCk58B&0ERO-GTLx$ccmQw{z%|QG{0!)CMN+IpMM1e1U^d=N zc<)XdfEIe!NgDQH9^fs&H+j%b&m>p~ivU_3K;=%k-T7oIQJ8NX#OvELL>mk80NNTr zT#)_|yxlUGGOQas$1nA}sq=8a`ZMjs&tl}_%!GB}=TEc{;la>;l)}3IO26|-ZVp&i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ZZ5b*u!nET&Is&+hqf%h#cK zL#)K-%v3US0K^ctAcN<0B|x5-Np!q~nl1H|T*c64QdiYQin+;HJ-SOEu+1F%Q@zg7lbQZh%{@9m3q~xYzDMFzB}f(%`tA`TqU%nH zrj=|k$C&y@bXbBfgv!zU?58X_u#Q+rQY5PN%@|p#uDR?l|JL7XkvxQ*%=ENc2g&|& z<`Z$x&nHP^d5w>sbw-~OwmSQ%tQrWJr)(eus>dI#xp0jY604qLNeJ@1|LG(;^~6Ia zT?9q_=G9s`tmWJ^A2R=KIXbK&Ly&&!m6)+{&H>ygqhu3WQm(t}KQa3n4 zlE%iZ!Cy((MCHyRkn$|#1Ymmp_Y;(6BO2Q|FoQ;8)KCHZ*%qX#tgdul!8qXm1MK`m ARR910 literal 0 HcmV?d00001 diff --git a/res/icons/setup.svg b/res/icons/setup.svg new file mode 100644 index 00000000..0d500c4f --- /dev/null +++ b/res/icons/setup.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/res/setup/.editorconfig b/res/setup/.editorconfig new file mode 100644 index 00000000..12383cac --- /dev/null +++ b/res/setup/.editorconfig @@ -0,0 +1,9 @@ +# indicate this is the root of the project +root = true + +[*] +indent_style = tab +indent_size = 4 +trim_trailing_whitespace = true +insert_final_newline = true +charset = utf-8 diff --git a/res/setup/readme.txt b/res/setup/readme.txt new file mode 100644 index 00000000..74622688 --- /dev/null +++ b/res/setup/readme.txt @@ -0,0 +1,29 @@ +Rufus: The Reliable USB Formatting Utility - Windows 11 setup.exe wrapper + +# Description + +This small executable aims at solving the issue of Windows 11 24H2 having made the +bypass requirements for in-place upgrades more difficult to enact. + +Basically, per https://github.com/pbatard/rufus/issues/2568#issuecomment-2387934171, +and if the user chose to apply the hardware requirement bypasses in Rufus, you want +to apply a set of registry key creation and deletion *before* setup.exe is run. + +While we could obviously provide a simple batch file to accomplish this, the fact +that the registry commands require elevation, combined with expectations of just +being able double click setup.exe to upgrade makes us want to accomplish this in +a more user-friendly manner. + +Our solution then is to have Rufus rename the original 'setup.exe' to 'setup.dll' +insert a small 'setup.exe' that'll perform elevation, add the registry key, and +launch the original setup, which is exactly what this project does. + +Now, obviously, the fact that we "inject" a setup executable may leave people +uncomfortable about the possibility that we might use this as a malware vector, +which is also why we make sure that the one we sign and embed in Rufus does get +built using GitHub Actions and can be validated to not have been tampered through +SHA-256 validation (Since we produce SHA-256 hashes during the build process per: +https://github.com/pbatard/rufus/blob/master/.github/workflows/setup.yml). + +Also note that, since these are the only platforms Windows 11 supports, we only +build for x64 and ARM64. diff --git a/res/setup/resource.h b/res/setup/resource.h new file mode 100644 index 00000000..75aac6a4 --- /dev/null +++ b/res/setup/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by setup.rc +// +#define IDI_ICON 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/res/setup/setup.c b/res/setup/setup.c new file mode 100644 index 00000000..1ad736b5 --- /dev/null +++ b/res/setup/setup.c @@ -0,0 +1,125 @@ +/* + * Setup - Wrapper around Microsoft's setup.exe that adds registry + * bypasses for in-place Windows 11 upgrade. + * + * Copyright © 2024 Pete Batard + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#define WIN32_LEAN_AND_MEAN +#include +#include +#include + +static BOOL RegDeleteNodeRecurse(HKEY hKeyRoot, CHAR* lpSubKey) +{ + CHAR* lpEnd; + LONG lResult; + DWORD dwSize; + CHAR szName[MAX_PATH]; + HKEY hKey; + FILETIME ftWrite; + + // First, see if we can delete the key without having to recurse. + if (RegDeleteKeyA(hKeyRoot, lpSubKey) == ERROR_SUCCESS) + return TRUE; + + lResult = RegOpenKeyExA(hKeyRoot, lpSubKey, 0, KEY_READ, &hKey); + if (lResult != ERROR_SUCCESS) + return (lResult == ERROR_FILE_NOT_FOUND); + + // Check for an ending slash and add one if it is missing. + lpEnd = lpSubKey + strlen(lpSubKey); + if (*(lpEnd - 1) != '\\') { + *lpEnd++ = '\\'; + *lpEnd = '\0'; + } + + // Enumerate the keys + dwSize = MAX_PATH; + if (RegEnumKeyExA(hKey, 0, szName, &dwSize, NULL, NULL, NULL, &ftWrite) == ERROR_SUCCESS) { + do { + *lpEnd = '\0'; + strcat_s(lpSubKey, MAX_PATH, szName); + if (!RegDeleteNodeRecurse(hKeyRoot, lpSubKey)) + break; + dwSize = MAX_PATH; + lResult = RegEnumKeyExA(hKey, 0, szName, &dwSize, NULL, NULL, NULL, &ftWrite); + } while (lResult == ERROR_SUCCESS); + } + + *--lpEnd = '\0'; + RegCloseKey(hKey); + + // Try again to delete the key. + return (RegDeleteKeyA(hKeyRoot, lpSubKey) == ERROR_SUCCESS); +} + +static BOOL RegDeleteNode(HKEY hKeyRoot, CHAR* lpSubKey) +{ + CHAR szDelKey[MAX_PATH]; + + strcpy_s(szDelKey, MAX_PATH, lpSubKey); + return RegDeleteNodeRecurse(hKeyRoot, szDelKey); +} + +static BOOL RegWriteKey(HKEY hKeyRoot, CHAR* lpKeyParent, CHAR* lpKeyName, DWORD dwType, LPBYTE lpData, DWORD dwDataSize) +{ + BOOL r = FALSE; + HKEY hRoot = NULL, hApp = NULL; + DWORD dwDisp; + HKEY hKey; + + if (RegCreateKeyExA(hKeyRoot, lpKeyParent, 0, NULL, 0, KEY_SET_VALUE | KEY_QUERY_VALUE, NULL, &hKey, &dwDisp) != ERROR_SUCCESS) + return FALSE; + + r = (RegSetValueExA(hKey, lpKeyName, 0, dwType, lpData, dwDataSize) == ERROR_SUCCESS); + RegCloseKey(hKey); + + return r; +} + +int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + CHAR lpBypasses[] = "SQ_SecureBootCapable=TRUE\0SQ_SecureBootEnabled=TRUE\0SQ_TpmVersion=2\0SQ_RamMB=8192\0"; + DWORD dwUpgrade = 1, dwAttrib; + STARTUPINFOA si = { 0 }; + PROCESS_INFORMATION pi = { 0 }; + SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE }; + + // Make sure we have 'setup.dll' in the same directory + dwAttrib = GetFileAttributesA("setup.dll"); + if (dwAttrib == INVALID_FILE_ATTRIBUTES || dwAttrib & FILE_ATTRIBUTE_DIRECTORY) + MessageBoxA(NULL, "ERROR: 'setup.dll' was not found", "Windows setup error", MB_OK | MB_ICONWARNING); + + // Apply the registry bypasses to enable Windows 11 24H2 in-place upgrade + RegDeleteNode(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers"); + RegDeleteNode(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Shared"); + RegDeleteNode(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators"); + RegWriteKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\HwReqChk", + "HwReqChkVars", REG_MULTI_SZ, lpBypasses, sizeof(lpBypasses)); + RegWriteKey(HKEY_LOCAL_MACHINE, "SYSTEM\\Setup\\MoSetup", "AllowUpgradesWithUnsupportedTPMOrCPU", + REG_DWORD, (LPBYTE)&dwUpgrade, sizeof(dwUpgrade)); + + // Launch the original 'setup.exe' (that was renamed to 'setup.dll') + si.cb = sizeof(si); + si.dwFlags = STARTF_USESHOWWINDOW; + si.wShowWindow = SW_SHOWNORMAL; + CreateProcessA("setup.dll", NULL, NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi); + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + + return GetLastError(); +} diff --git a/res/setup/setup.rc b/res/setup/setup.rc new file mode 100644 index 00000000..0be07642 --- /dev/null +++ b/res/setup/setup.rc @@ -0,0 +1,116 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#ifndef _USING_V110_SDK71_ +#define _USING_V110_SDK71_ +#endif +#include +#ifndef IDC_STATIC +#define IDC_STATIC -1 +#endif + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (Neutral) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +#pragma code_page(1252) + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON ICON "../icons/setup.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "CompanyName", "Akeo Consulting" + VALUE "FileDescription", "Windows Setup Wrapper" + VALUE "FileVersion", "1.0" + VALUE "InternalName", "Setup" + VALUE "LegalCopyright", " 2024 Pete Batard (GPL v3)" + VALUE "LegalTrademarks", "https://rufus.ie/setup" + VALUE "OriginalFilename", "setup.exe" + VALUE "ProductName", "Setup" + VALUE "ProductVersion", "1.0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END + +#endif // English (Neutral) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/res/setup/setup.sln b/res/setup/setup.sln new file mode 100644 index 00000000..dc034893 --- /dev/null +++ b/res/setup/setup.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29926.136 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "setup", "setup.vcxproj", "{6C2BED99-5A0A-42A2-AEBE-66717FA92232}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|arm64 = Debug|arm64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|arm64 = Release|arm64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|arm64.ActiveCfg = Debug|ARM64 + {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|arm64.Build.0 = Debug|ARM64 + {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|x64.ActiveCfg = Debug|x64 + {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|x64.Build.0 = Debug|x64 + {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|x86.ActiveCfg = Debug|Win32 + {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|x86.Build.0 = Debug|Win32 + {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|arm64.ActiveCfg = Release|ARM64 + {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|arm64.Build.0 = Release|ARM64 + {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|x64.ActiveCfg = Release|x64 + {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|x64.Build.0 = Release|x64 + {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|x86.ActiveCfg = Release|Win32 + {6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7994FC0C-9D7C-4AD7-855B-C3525FD8709A} + EndGlobalSection +EndGlobal diff --git a/res/setup/setup.vcxproj b/res/setup/setup.vcxproj new file mode 100644 index 00000000..b4043bc7 --- /dev/null +++ b/res/setup/setup.vcxproj @@ -0,0 +1,272 @@ + + + + + Debug + ARM64 + + + Debug + Win32 + + + Release + ARM64 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + {6C2BED99-5A0A-42A2-AEBE-66717FA92232} + Win32Proj + baseconsole + + + + Application + true + Unicode + v143 + + + Application + false + true + Unicode + v143 + + + Application + true + Unicode + v143 + + + Application + true + Unicode + v143 + + + Application + false + true + Unicode + v143 + + + Application + false + true + Unicode + v143 + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)arm64\$(Configuration)\ + $(SolutionDir)arm64\$(Configuration)\$(ProjectName)\ + $(SolutionDir)arm64\$(Configuration)\ + $(SolutionDir)arm64\$(Configuration)\$(ProjectName)\ + $(SolutionDir)x86\$(Configuration)\ + $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ + $(SolutionDir)x86\$(Configuration)\ + $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ + $(SolutionDir)x64\$(Configuration)\ + $(SolutionDir)x64\$(Configuration)\$(ProjectName)\ + $(SolutionDir)x64\$(Configuration)\ + $(SolutionDir)x64\$(Configuration)\$(ProjectName)\ + false + false + false + false + false + false + + + true + + + true + + + true + + + false + + + false + + + false + + + + /DAPP_VERSION=$(AppVersion) %(AdditionalOptions) + + + + + /DAPP_FILE_VERSION=$(AppFileVersion) %(AdditionalOptions) + + + + + /DAPP_COMMENTS="$(AppComments)" %(AdditionalOptions) + + + + + Level3 + WIN32;_DEBUG;%(PreprocessorDefinitions) + false + CompileAsC + MultiThreadedDebug + + + + + Windows + true + RequireAdministrator + + + + + Level3 + _DEBUG;%(PreprocessorDefinitions) + false + CompileAsC + MultiThreadedDebug + + + + + Windows + true + RequireAdministrator + + + + + Level3 + _DEBUG;%(PreprocessorDefinitions) + false + CompileAsC + MultiThreadedDebug + + + + + Windows + true + RequireAdministrator + + + + + Level3 + WIN32;NDEBUG;%(PreprocessorDefinitions) + false + CompileAsC + MultiThreaded + + + MinSpace + Size + + + Windows + true + true + true + RequireAdministrator + + + + + Level3 + NDEBUG;%(PreprocessorDefinitions) + false + CompileAsC + MultiThreaded + + + MinSpace + Size + + + Windows + true + true + true + RequireAdministrator + + + + + Level3 + NDEBUG;%(PreprocessorDefinitions) + false + CompileAsC + MultiThreaded + + + MinSpace + Size + + + Windows + true + true + true + RequireAdministrator + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/setup/setup.vcxproj.filters b/res/setup/setup.vcxproj.filters new file mode 100644 index 00000000..31d4927c --- /dev/null +++ b/res/setup/setup.vcxproj.filters @@ -0,0 +1,27 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx + + + {e9f75410-9e5d-4ea8-b75a-0c45bb23e331} + + + + + Source Files + + + + + Resources + + + + + Source Files + + + \ No newline at end of file diff --git a/src/rufus.rc b/src/rufus.rc index ffba8ce1..9c702576 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.6.2198" +CAPTION "Rufus 4.6.2199" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -397,8 +397,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2198,0 - PRODUCTVERSION 4,6,2198,0 + FILEVERSION 4,6,2199,0 + PRODUCTVERSION 4,6,2199,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -416,13 +416,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2198" + VALUE "FileVersion", "4.6.2199" VALUE "InternalName", "Rufus" - VALUE "LegalCopyright", "� 2011-2024 Pete Batard (GPL v3)" + VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2198" + VALUE "ProductVersion", "4.6.2199" END END BLOCK "VarFileInfo" From c800448c620a3767565e038e29739a9dccfe5e71 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sun, 6 Oct 2024 13:39:53 +0100 Subject: [PATCH 009/192] [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. --- _pre-commit.sh | 1 + res/setup/readme.txt | 30 ++++++++++++++++++++++-------- res/setup/setup.c | 5 +++-- res/setup/setup_arm64.exe | Bin 0 -> 144688 bytes res/setup/setup_x64.exe | Bin 0 -> 152880 bytes src/hash.c | 2 +- src/parser.c | 33 ++++++++++++++++++++++++--------- src/resource.h | 2 ++ src/rufus.c | 10 ++++------ src/rufus.h | 1 + src/rufus.rc | 14 +++++++++----- src/wue.c | 30 +++++++++++++++++++++++++++++- 12 files changed, 96 insertions(+), 32 deletions(-) create mode 100644 res/setup/setup_arm64.exe create mode 100644 res/setup/setup_x64.exe diff --git a/_pre-commit.sh b/_pre-commit.sh index 12469c41..3a2b65bf 100755 --- a/_pre-commit.sh +++ b/_pre-commit.sh @@ -32,6 +32,7 @@ s/^\([ \t]*\)*\(FILE\|PRODUCT\)VERSION\([ \t]*\)\([0-9]*\),\([0-9]*\),[0-9]*,\(. s/^\([ \t]*\)VALUE\([ \t]*\)"\(File\|Product\)Version",\([ \t]*\)"\(.*\)\..*"[ \t]*/\1VALUE\2"\3Version",\4"\5.@@BUILD@@"/ s/^\(.*\)"Rufus \(.*\)\..*"\(.*\)/\1"Rufus \2.@@BUILD@@"\3/ s/^\([ \t]*\)Version="\([0-9]*\)\.\([0-9]*\)\.[0-9]*\.\([0-9]*\)"\(.*\)/\1Version="\2.\3.@@BUILD@@.\4"\5/ +s/\xef\xbf\xbd/\xa9/ _EOF # First run sed to substitute our variable in the sed command file diff --git a/res/setup/readme.txt b/res/setup/readme.txt index 74622688..005b521f 100644 --- a/res/setup/readme.txt +++ b/res/setup/readme.txt @@ -1,4 +1,4 @@ -Rufus: The Reliable USB Formatting Utility - Windows 11 setup.exe wrapper +Rufus: The Reliable USB Formatting Utility - Windows 11 Setup wrapper # Description @@ -18,12 +18,26 @@ Our solution then is to have Rufus rename the original 'setup.exe' to 'setup.dll insert a small 'setup.exe' that'll perform elevation, add the registry key, and launch the original setup, which is exactly what this project does. -Now, obviously, the fact that we "inject" a setup executable may leave people -uncomfortable about the possibility that we might use this as a malware vector, -which is also why we make sure that the one we sign and embed in Rufus does get -built using GitHub Actions and can be validated to not have been tampered through -SHA-256 validation (Since we produce SHA-256 hashes during the build process per: +Oh and it should be noted that, the issues you might see with Setup not restarting +in the foreground after it updates, or not being able to launch at all for a while +if you happen to cancel before starting the installation, have *NOTHING* to do with +using this setup wrapper, but come from Microsoft themselves. You can validate that +these issues exist even when running setup.exe without the wrapper... + +# Security considerations + +Obviously, the fact that we "inject" a setup executable may leave people uncomfortable +about the possibility that we might use this as a malware vector, which is also why we +make sure that the one we sign and embed in Rufus does get built using GitHub Actions +and can be validated to not have been tampered through SHA-256 validation (Since we +produce SHA-256 hashes during the build process per: https://github.com/pbatard/rufus/blob/master/.github/workflows/setup.yml). -Also note that, since these are the only platforms Windows 11 supports, we only -build for x64 and ARM64. +Per the https://github.com/pbatard/rufus/actions/runs/11195726475 GitHub Actions +workflow run, the SHA-256 for the executables (before signature was applied) were: +* 4e99f49b456781c92d2010a626706557df69334c6fc71ac129625f41fa311dd8 *./setup_x64.exe +* a0d7dea2228415eb5afe34419a31eeda90f9b51338f47bc8a5ef591054277f4b *./setup_arm64.exe + +You will also find the VirusTotal reports for the current signed executable at: +* https://www.virustotal.com/gui/file/a74dbfc0e2a5b2e3fd4ad3f9fdaea0060c5d29a16151b9a570a9bd653db966a7/detection +* https://www.virustotal.com/gui/file/629fdda27e200ec98703a7606ca4e2d0e44c578341779e4d5c447d45fc860c69/detection diff --git a/res/setup/setup.c b/res/setup/setup.c index 1ad736b5..641bfb66 100644 --- a/res/setup/setup.c +++ b/res/setup/setup.c @@ -84,7 +84,7 @@ static BOOL RegWriteKey(HKEY hKeyRoot, CHAR* lpKeyParent, CHAR* lpKeyName, DWORD if (RegCreateKeyExA(hKeyRoot, lpKeyParent, 0, NULL, 0, KEY_SET_VALUE | KEY_QUERY_VALUE, NULL, &hKey, &dwDisp) != ERROR_SUCCESS) return FALSE; - + r = (RegSetValueExA(hKey, lpKeyName, 0, dwType, lpData, dwDataSize) == ERROR_SUCCESS); RegCloseKey(hKey); @@ -104,7 +104,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if (dwAttrib == INVALID_FILE_ATTRIBUTES || dwAttrib & FILE_ATTRIBUTE_DIRECTORY) MessageBoxA(NULL, "ERROR: 'setup.dll' was not found", "Windows setup error", MB_OK | MB_ICONWARNING); - // Apply the registry bypasses to enable Windows 11 24H2 in-place upgrade + // Apply the registry bypasses to enable Windows 11 24H2 in-place upgrade. Credits to: + // https://forums.mydigitallife.net/threads/win-11-boot-and-upgrade-fix-kit-v5-0-released.83724/ RegDeleteNode(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers"); RegDeleteNode(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Shared"); RegDeleteNode(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators"); diff --git a/res/setup/setup_arm64.exe b/res/setup/setup_arm64.exe new file mode 100644 index 0000000000000000000000000000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gYCUSz$^KFnaNP!8yVRY8M@^Jm&_~WN!_Vxxu_6A4;I;>dA|jNyp2X4tenM7 z{>v+SkdCmt0Ts!M0`fN2+9fYCbswxe85Ub8eSbvxcH6`7ns$WadZxPAR~W{v;B?2X zaoR|M>y${4ZrYMU{R|vQ^ENnrbD6=8j%^=HfgS9%BLmmAud@wsYWXFKn62fP8u zfBJ`@t$pD)j}Y{=&)PLHP@uRc3%KWOJ+SNXm!XJ+4W$IYhD-qLLmM9qS-UYlAnrZ0 z>wHB$jBz;BNbWBt_@R+!h$RPfY8yk*1BrT4z~{pqB3#RNVu?xaUs(mq5CNg{qw_#d zd&B_HJ%_>4^ES?_<6AXaL*(CYWY7he)(L@ zRqb%J<-lM2`dIA>SyM0xGevw*aeHa+sw~iYZLE9QnlT?uHxKj>G;8N_ETu8XM4d;cO6nW z+b7i|G_^jFa;tA%oX?D%S6)0Lv-pNRLu`-1k1)4+uVJs@PWJ-_*Cx|ty{XpywQ8La zCdv3wW6zT7*}7?CxmTwJ=1ZD<4?C_Hw37J71>M$-2yN91n!7-U1XBgSN9b8CqS9zL z9mbw!+UozLz$K2nqqiGB`I70&nw_o*?aVysl@+u0sK=N?En28Hvl_+UN*>&JB<(Zb z(-t~Pt!0q?rDTjC$$|?GuW#dCR;nd+6BqVspTyy8xvyKa#6)$+r`$==<*u?|WX~2g zPas(Z%10TCec!1Eha2Kl+2WQLNh--6SD-Z)!QA;Q6h;SBxD(!M2s`H$`8W&ll3>+T z2tOmuB(6_*gN!|qeau~d;iaPIME5~9swdbJ8@b%Mlru~CP&4UUZ3 z{0#amdI(d@D)hrkpA7t%eU xMC==sU!rOR+{kGdeGcMpuIHU0~yo+z|*HTR83Y{vV%ki&g*t literal 0 HcmV?d00001 diff --git a/res/setup/setup_x64.exe b/res/setup/setup_x64.exe new file mode 100644 index 0000000000000000000000000000000000000000..ec2ee74b4a8059c8f977822dd155e44d80533357 GIT binary patch literal 152880 zcmd?Sdwi6|+4#Mi>?R9j*+p3m0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+1;d_zQ#8sDK zsi(1&FI(!D;YDl>#epO*=~HPT;94_b{#dUiI#UzffS&{^>NGHOAr%hsYQ4>)8jMV~ zOAN;Au&zFTRvzm4Fe8kb^9IDBliS48r=~pS2BKqJ+aZVh1A()vEwP{`{Io#E+eMTl z9xVQLs;m~g1UhDxBET%!uX~x_f%Q!uodlNldclvo$^B6Lr>vaS#ZdDx<5hhenx)|qU2v>%z=Vh&sHKX7c4jwyHVMWmAF$MyqVs(EX1L>J z963nI`njtstn%s9oxAWn?X}i#%{_+%%e}CJKD^?);eH;xo;*iP4QAqk;ggC}TXnef zkG4UMaQigANwv(Fs>QgBDZ~73h z+TZ;_5dvEKxYnemfYE>2-=5HVK=k;#Pb8&zjEN{v=Kt1-^T#uJZ-SggOF%%7lqhdy_`ocY{mF9%|Ikjxs#_$!agTrP(Yqz zv3aH2&XQbk8bw}c)wl)bZ~{F;G4A@1A_Wgm%$zw1wlDHr-uU8?^pmK~)s_4zgJc@f z1>o;DE;(go9A(mzF3;|Figi=fJq|rhPT_tWATt+ zy4`0>w>~{wVArKGy;hRy*&S4-Vk3t#Zg>Eah-c9*?5DE55qd>($EE*vYv~K0f16+o zxf|#?0#lTVk-GMRqk#tCY!HhzihOMuJbdVvW%VD3f$Rn+o8@Ec=rBhvYZO-PCl#*m z=i1}uqctaZg$_xB4$QrEmONYFXOSMRJCt#|6idyOIt!W!R8q%9g(vdt__qdHYoMO() zP{*|9+@9%7*CxrtL@>USjlQ*F5W>XD>t|ubs2Urjps)O9Yn>w@sB$Vffv8FeUc zDyp4+{wCG5CR_w;(({gz_k(Mf!|{-JUU;Vfg(b^{%U<@ap$rtn}1EYe*x^_;l2O> literal 0 HcmV?d00001 diff --git a/src/hash.c b/src/hash.c index c5dd18f8..d39f68ab 100644 --- a/src/hash.c +++ b/src/hash.c @@ -2091,7 +2091,7 @@ BOOL IsRevokedBySbat(uint8_t* buf, uint32_t len) // Look for a .sbat section sbat = GetPeSection(buf, ".sbat", &sbat_len); - if (sbat == NULL || sbat < buf || sbat >= buf + len) + if (sbat == NULL || sbat < (char*)buf || sbat >= (char*)buf + len) return FALSE; for (i = 0; sbat[i] != '\0'; ) { diff --git a/src/parser.c b/src/parser.c index 2f000650..94ece799 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1554,18 +1554,20 @@ sbat_entry_t* GetSbatEntries(char* sbatlevel) BOOL eol, eof; char* version_str; uint32_t i, num_entries; - sbat_entry_t* sbat_entries; + sbat_entry_t* _sbat_entries; if (sbatlevel == NULL) - return FALSE; + return NULL; num_entries = 0; for (i = 0; sbatlevel[i] != '\0'; i++) if (sbatlevel[i] == '\n') num_entries++; - sbat_entries = calloc(num_entries + 2, sizeof(sbat_entry_t)); - if (sbat_entries == NULL) + if (num_entries == 0) + return NULL; + _sbat_entries = calloc(num_entries + 2, sizeof(sbat_entry_t)); + if (_sbat_entries == NULL) return NULL; num_entries = 0; @@ -1581,7 +1583,7 @@ sbat_entry_t* GetSbatEntries(char* sbatlevel) i++; continue; } - sbat_entries[num_entries].product = &sbatlevel[i]; + _sbat_entries[num_entries].product = &sbatlevel[i]; for (; sbatlevel[i] != ',' && sbatlevel[i] != '\0' && sbatlevel[i] != '\n'; i++); if (sbatlevel[i] == '\0' || sbatlevel[i] == '\n') break; @@ -1595,22 +1597,35 @@ sbat_entry_t* GetSbatEntries(char* sbatlevel) i++; // Allow the provision of an hex version if (version_str[0] == '0' && version_str[1] == 'x') - sbat_entries[num_entries].version = strtoul(version_str, NULL, 16); + _sbat_entries[num_entries].version = strtoul(version_str, NULL, 16); else - sbat_entries[num_entries].version = strtoul(version_str, NULL, 10); + _sbat_entries[num_entries].version = strtoul(version_str, NULL, 10); if (!eol) for (; sbatlevel[i] != '\0' && sbatlevel[i] != '\n'; i++); - if (sbat_entries[num_entries].version != 0) + if (_sbat_entries[num_entries].version != 0) num_entries++; } - return sbat_entries; + return _sbat_entries; } /* * PE parsing functions */ +// Return the arch of a PE executable buffer +uint16_t GetPeArch(uint8_t* buf) +{ + IMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf; + IMAGE_NT_HEADERS* pe_header; + + if (buf == NULL) + return IMAGE_FILE_MACHINE_UNKNOWN; + + pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; + return pe_header->FileHeader.Machine; +} + // Return the address and (optionally) the length of a PE section from a PE buffer uint8_t* GetPeSection(uint8_t* buf, const char* name, uint32_t* len) { diff --git a/src/resource.h b/src/resource.h index 90646d70..b8994a76 100644 --- a/src/resource.h +++ b/src/resource.h @@ -69,6 +69,8 @@ #define IDR_LC_RUFUS_LOC 500 #define IDR_XT_HOGGER 501 #define IDR_UEFI_NTFS 502 +#define IDR_SETUP_X64 503 +#define IDR_SETUP_ARM64 504 // The following should match the ArchType array values + 600 #define IDR_MD5_BOOT 600 #define IDR_MD5_BOOTIA32 601 diff --git a/src/rufus.c b/src/rufus.c index dade331f..4ba8c378 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1401,10 +1401,12 @@ static DWORD WINAPI BootCheckThread(LPVOID param) { int i, r, username_index = -1; FILE *fd; - DWORD len; + uint32_t len; + uint8_t* buf = NULL; WPARAM ret = BOOTCHECK_CANCEL; BOOL in_files_dir = FALSE, esp_already_asked = FALSE; BOOL is_windows_to_go = ((image_options & IMOP_WINTOGO) && (ComboBox_GetCurItemData(hImageOption) == IMOP_WIN_TO_GO)); + const char* msg; const char* grub = "grub"; const char* core_img = "core.img"; const char* ldlinux = "ldlinux"; @@ -1603,10 +1605,6 @@ static DWORD WINAPI BootCheckThread(LPVOID param) // Check UEFI bootloaders for revocation if (IS_EFI_BOOTABLE(img_report)) { - uint8_t* buf = NULL; - uint32_t len; - const char* msg; - for (i = 0; i < ARRAYSIZE(img_report.efi_boot_path) && img_report.efi_boot_path[i][0] != 0; i++) { static const char* revocation_type[] = { "UEFI DBX", "Windows SSP", "Linux SBAT", "Windows SVN" }; len = ReadISOFileToBuffer(image_path, img_report.efi_boot_path[i], &buf); @@ -1720,7 +1718,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) if ((partition_type == PARTITION_STYLE_MBR) && HAS_SYSLINUX(img_report)) { if (SL_MAJOR(img_report.sl_version) < 5) { IGNORE_RETVAL(_chdirU(app_data_dir)); - for (i = 0; i= 26000) { + setup_exe[0] = drive_letter; + setup_dll[0] = drive_letter; + dwSize = read_file(setup_exe, &buf); + if (dwSize != 0) { + setup_arch = GetPeArch(buf); + free(buf); + if (setup_arch != IMAGE_FILE_MACHINE_AMD64 && setup_arch != IMAGE_FILE_MACHINE_ARM64) { + uprintf("WARNING: Unsupported arch 0x%x -- in-place upgrade wrapper can not be added"); + } else if (!MoveFileExU(setup_exe, setup_dll, 0)) { + uprintf("Could not rename '%s': %s", setup_exe, WindowsErrorString()); + } else { + uprintf("Renamed '%s' → '%s'", setup_exe, setup_dll); + uprintf("Created '%s' bypass wrapper (from embedded)", setup_exe); + buf = GetResource(hMainInstance, MAKEINTRESOURCEA(setup_arch == IMAGE_FILE_MACHINE_AMD64 ? IDR_SETUP_X64 : IDR_SETUP_ARM64), + _RT_RCDATA, "setup.exe", &dwSize, FALSE); + if (buf == NULL) + uprintf("Could not access embedded 'setup.exe'"); + else + write_file(setup_exe, buf, dwSize); + } + } + } } UpdateProgressWithInfoForce(OP_PATCH, MSG_325, 0, PATCH_PROGRESS_TOTAL); From fd5c366938affd8e56cbda0b3369bcf42c152b06 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Wed, 9 Oct 2024 00:40:15 +0100 Subject: [PATCH 010/192] [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. --- res/loc/rufus.loc | 1 + src/msapi_utf8.h | 73 +++++++++++++++++++++++ src/parser.c | 31 ++++++++-- src/rufus.c | 6 +- src/rufus.h | 12 +++- src/rufus.rc | 10 ++-- src/stdfn.c | 72 +++++++++++++++++++++++ src/stdio.c | 61 +++++++++++++++++++- src/wue.c | 143 ++++++++++++++++++++++++++++++++++------------ 9 files changed, 360 insertions(+), 49 deletions(-) diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 0849e65b..32744328 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -609,6 +609,7 @@ t MSG_346 "Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)" t MSG_347 "Expert Mode" t MSG_348 "Extracting archive files: %s" t MSG_349 "Use Rufus MBR" +t MSG_350 "Use 'Windows UEFI CA 2023' signed bootloaders [EXPERIMENTAL]" # The following messages are for the Windows Store listing only and are not used by the application t MSG_900 "Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc." t MSG_901 "Official site: %s" diff --git a/src/msapi_utf8.h b/src/msapi_utf8.h index 7532c262..e0510f41 100644 --- a/src/msapi_utf8.h +++ b/src/msapi_utf8.h @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include #include @@ -89,6 +91,9 @@ static __inline char* wchar_to_utf8(const wchar_t* wstr) int size = 0; char* str = NULL; + if (wstr == NULL) + return NULL; + // Convert the empty string too if (wstr[0] == 0) return (char*)calloc(1, 1); @@ -568,6 +573,52 @@ static __inline const char* PathFindFileNameU(const char* szPath) return &szPath[i]; } +static __inline char* PathCombineU(char* lpDest, char* lpDir, char* lpFile) +{ + wchar_t* wret = NULL; + DWORD err = ERROR_INVALID_DATA; + wchar_t wlpDest[MAX_PATH]; + wconvert(lpDir); + wconvert(lpFile); + wret = PathCombineW(wlpDest, wlpDir, wlpFile); + err = GetLastError(); + wfree(lpDir); + wfree(lpFile); + if (wret == NULL) + return NULL; + wchar_to_utf8_no_alloc(wlpDest, lpDest, MAX_PATH); + SetLastError(err); + return lpDest; +} + +static __inline HANDLE FindFirstFileU(char* lpFileName, LPWIN32_FIND_DATAA lpFindFileData) +{ + HANDLE ret = INVALID_HANDLE_VALUE; + WIN32_FIND_DATAW wFindFileData = { 0 }; + wconvert(lpFileName); + ret = FindFirstFileW(wlpFileName, &wFindFileData); + if (ret != INVALID_HANDLE_VALUE) { + memcpy(lpFindFileData, &wFindFileData, offsetof(WIN32_FIND_DATAW, cFileName)); + wchar_to_utf8_no_alloc(wFindFileData.cFileName, lpFindFileData->cFileName, sizeof(lpFindFileData->cFileName)); + wchar_to_utf8_no_alloc(wFindFileData.cAlternateFileName, lpFindFileData->cAlternateFileName, sizeof(lpFindFileData->cAlternateFileName)); + } + wfree(lpFileName); + return ret; +} + +static __inline BOOL FindNextFileU(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData) +{ + BOOL ret = FALSE; + WIN32_FIND_DATAW wFindFileData = { 0 }; + ret = FindNextFileW(hFindFile, &wFindFileData); + if (ret) { + memcpy(lpFindFileData, &wFindFileData, offsetof(WIN32_FIND_DATAW, cFileName)); + wchar_to_utf8_no_alloc(wFindFileData.cFileName, lpFindFileData->cFileName, sizeof(lpFindFileData->cFileName)); + wchar_to_utf8_no_alloc(wFindFileData.cAlternateFileName, lpFindFileData->cAlternateFileName, sizeof(lpFindFileData->cAlternateFileName)); + } + return ret; +} + // This function differs from regular GetTextExtentPoint in that it uses a zero terminated string static __inline BOOL GetTextExtentPointU(HDC hdc, const char* lpString, LPSIZE lpSize) { @@ -819,6 +870,28 @@ static __inline BOOL SetFileAttributesU(const char* lpFileName, DWORD dwFileAttr return ret; } +static __inline DWORD GetNamedSecurityInfoU(const char* lpObjectName, SE_OBJECT_TYPE ObjectType, + SECURITY_INFORMATION SecurityInfo, PSID* ppsidOwner, PSID* ppsidGroup, PACL* ppDacl, + PACL* ppSacl, PSECURITY_DESCRIPTOR* ppSecurityDescriptor) +{ + DWORD ret; + wconvert(lpObjectName); + ret = GetNamedSecurityInfoW(wlpObjectName, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup, + ppDacl, ppSacl, ppSecurityDescriptor); + wfree(lpObjectName); + return ret; +} + +static __inline DWORD SetNamedSecurityInfoU(const char* lpObjectName, SE_OBJECT_TYPE ObjectType, + SECURITY_INFORMATION SecurityInfo, PSID psidOwner, PSID psidGroup, PACL pDacl, PACL pSacl) +{ + DWORD ret; + wconvert(lpObjectName); + ret = SetNamedSecurityInfoW(wlpObjectName, ObjectType, SecurityInfo, psidOwner, psidGroup, pDacl, pSacl); + wfree(lpObjectName); + return ret; +} + static __inline int SHCreateDirectoryExU(HWND hwnd, const char* pszPath, SECURITY_ATTRIBUTES *psa) { int ret = ERROR_INVALID_DATA; diff --git a/src/parser.c b/src/parser.c index 94ece799..ca48c61e 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1267,7 +1267,7 @@ out: } /* - * Replace all 'c' characters in string 'src' with the substring 'rep' + * Replace all 'c' characters in string 'src' with the substring 'rep'. * The returned string is allocated and must be freed by the caller. */ char* replace_char(const char* src, const char c, const char* rep) @@ -1300,6 +1300,30 @@ char* replace_char(const char* src, const char c, const char* rep) return res; } +/* + * Remove all instances of substring 'sub' form string 'src. + * The returned string is allocated and must be freed by the caller. + */ +char* remove_substr(const char* src, const char* sub) +{ + size_t i, j, str_len = safe_strlen(src), sub_len = safe_strlen(sub); + char* res; + + if ((src == NULL) || (sub == NULL) || (sub_len > str_len)) + return NULL; + + res = (char*)calloc(str_len + 1, 1); + if (res == NULL) + return NULL; + for (i = 0, j = 0; i <= str_len; ) { + if (i <= str_len - sub_len && memcmp(&src[i], sub, sub_len) == 0) + i += sub_len; + else + res[j++] = src[i++]; + } + return res; +} + /* * Internal recursive call for get_data_from_asn1(). Returns FALSE on error, TRUE otherwise. */ @@ -1697,8 +1721,7 @@ uint8_t* RvaToPhysical(uint8_t* buf, uint32_t rva) static BOOL FoundResourceRva = FALSE; uint32_t FindResourceRva(const wchar_t* name, uint8_t* root, uint8_t* dir, uint32_t* len) { - uint32_t rva; - WORD i; + uint32_t i, rva; IMAGE_RESOURCE_DIRECTORY* _dir = (IMAGE_RESOURCE_DIRECTORY*)dir; IMAGE_RESOURCE_DIRECTORY_ENTRY* dir_entry = (IMAGE_RESOURCE_DIRECTORY_ENTRY*)&_dir[1]; IMAGE_RESOURCE_DIR_STRING_U* dir_string; @@ -1711,7 +1734,7 @@ uint32_t FindResourceRva(const wchar_t* name, uint8_t* root, uint8_t* dir, uint3 if (root == dir) FoundResourceRva = FALSE; - for (i = 0; i < _dir->NumberOfNamedEntries + _dir->NumberOfIdEntries; i++) { + for (i = 0; i < (uint32_t)_dir->NumberOfNamedEntries + _dir->NumberOfIdEntries; i++) { if (!FoundResourceRva && i < _dir->NumberOfNamedEntries) { dir_string = (IMAGE_RESOURCE_DIR_STRING_U*)(root + dir_entry[i].NameOffset); if (dir_string->Length != wcslen(name) || diff --git a/src/rufus.c b/src/rufus.c index 4ba8c378..8e083734 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1586,6 +1586,10 @@ static DWORD WINAPI BootCheckThread(LPVOID param) StrArrayAdd(&options, lmprintf(MSG_335), TRUE); MAP_BIT(UNATTEND_DISABLE_BITLOCKER); if (expert_mode) { + if (!appstore_version && img_report.win_version.build >= 26100) { + StrArrayAdd(&options, lmprintf(MSG_350), TRUE); + MAP_BIT(UNATTEND_USE_MS2023_BOOTLOADERS); + } StrArrayAdd(&options, lmprintf(MSG_346), TRUE); MAP_BIT(UNATTEND_FORCE_S_MODE); } @@ -1597,7 +1601,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) i = remap16(i, map, TRUE); unattend_xml_path = CreateUnattendXml(arch, i); // Remember the user preferences for the current session. - unattend_xml_mask &= ~(remap16(0x1ff, map, TRUE)); + unattend_xml_mask &= ~(remap16(UNATTEND_FULL_MASK, map, TRUE)); unattend_xml_mask |= i; WriteSetting32(SETTING_WUE_OPTIONS, (UNATTEND_DEFAULT_MASK << 16) | unattend_xml_mask); } diff --git a/src/rufus.h b/src/rufus.h index 24a4dfb0..9240784a 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -629,6 +629,8 @@ typedef struct { #define UNATTEND_SET_USER 0x00040 #define UNATTEND_DISABLE_BITLOCKER 0x00080 #define UNATTEND_FORCE_S_MODE 0x00100 +#define UNATTEND_USE_MS2023_BOOTLOADERS 0x00200 +#define UNATTEND_FULL_MASK 0x003FF #define UNATTEND_DEFAULT_MASK 0x000FF #define UNATTEND_WINDOWS_TO_GO 0x10000 // Special flag for Windows To Go @@ -636,10 +638,15 @@ typedef struct { #define UNATTEND_SPECIALIZE_DEPLOYMENT_MASK (UNATTEND_NO_ONLINE_ACCOUNT) #define UNATTEND_OOBE_SHELL_SETUP_MASK (UNATTEND_NO_DATA_COLLECTION | UNATTEND_SET_USER | UNATTEND_DUPLICATE_LOCALE) #define UNATTEND_OOBE_INTERNATIONAL_MASK (UNATTEND_DUPLICATE_LOCALE) -#define UNATTEND_OOBE_MASK (UNATTEND_OOBE_SHELL_SETUP_MASK | UNATTEND_OOBE_INTERNATIONAL_MASK | UNATTEND_DISABLE_BITLOCKER) +#define UNATTEND_OOBE_MASK (UNATTEND_OOBE_SHELL_SETUP_MASK | UNATTEND_OOBE_INTERNATIONAL_MASK | UNATTEND_DISABLE_BITLOCKER | UNATTEND_USE_MS2023_BOOTLOADERS) #define UNATTEND_OFFLINE_SERVICING_MASK (UNATTEND_OFFLINE_INTERNAL_DRIVES | UNATTEND_FORCE_S_MODE) #define UNATTEND_DEFAULT_SELECTION_MASK (UNATTEND_SECUREBOOT_TPM_MINRAM | UNATTEND_NO_ONLINE_ACCOUNT | UNATTEND_OFFLINE_INTERNAL_DRIVES) +/* Used with ListDirectoryContent */ +#define LIST_DIR_TYPE_FILE 0x01 +#define LIST_DIR_TYPE_DIRECTORY 0x02 +#define LIST_DIR_TYPE_RECURSIVE 0x80 + /* Hash tables */ typedef struct htab_entry { uint32_t used; @@ -786,6 +793,7 @@ extern char* get_token_data_buffer(const char* token, unsigned int n, const char extern char* insert_section_data(const char* filename, const char* section, const char* data, BOOL dos2unix); extern char* replace_in_token_data(const char* filename, const char* token, const char* src, const char* rep, BOOL dos2unix); extern char* replace_char(const char* src, const char c, const char* rep); +extern char* remove_substr(const char* src, const char* sub); extern void parse_update(char* buf, size_t len); extern void* get_data_from_asn1(const uint8_t* buf, size_t buf_len, const char* oid_str, uint8_t asn1_type, size_t* data_len); extern int sanitize_label(char* label); @@ -835,6 +843,8 @@ extern uint16_t GetPeArch(uint8_t* buf); extern uint8_t* GetPeSection(uint8_t* buf, const char* name, uint32_t* len); extern uint8_t* RvaToPhysical(uint8_t* buf, uint32_t rva); extern uint32_t FindResourceRva(const wchar_t* name, uint8_t* root, uint8_t* dir, uint32_t* len); +extern DWORD ListDirectoryContent(StrArray* arr, char* dir, uint8_t type); +extern BOOL TakeOwnership(LPCSTR lpszOwnFile); #define GetTextWidth(hDlg, id) GetTextSize(GetDlgItem(hDlg, id), NULL).cx DWORD WINAPI HashThread(void* param); diff --git a/src/rufus.rc b/src/rufus.rc index f63f9294..7236b2c2 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.6.2200" +CAPTION "Rufus 4.6.2201" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2200,0 - PRODUCTVERSION 4,6,2200,0 + FILEVERSION 4,6,2201,0 + PRODUCTVERSION 4,6,2201,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2200" + VALUE "FileVersion", "4.6.2201" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2200" + VALUE "ProductVersion", "4.6.2201" END END BLOCK "VarFileInfo" diff --git a/src/stdfn.c b/src/stdfn.c index ec4933a0..c299967b 100644 --- a/src/stdfn.c +++ b/src/stdfn.c @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include "re.h" #include "rufus.h" @@ -1242,3 +1244,73 @@ BOOL UnmountRegistryHive(const HKEY key, const char* pszHiveName) return (status == ERROR_SUCCESS); } + +/* + * Take administrative ownership of a file or directory, and grant all access rights. + */ +BOOL TakeOwnership(LPCSTR lpszOwnFile) +{ + BOOL ret = FALSE; + HANDLE hToken = NULL; + PSID pSIDAdmin = NULL; + PACL pOldDACL = NULL, pNewDACL = NULL; + PSECURITY_DESCRIPTOR pSD = NULL; + SID_IDENTIFIER_AUTHORITY SIDAuthNT = SECURITY_NT_AUTHORITY; + EXPLICIT_ACCESS ea = { 0 }; + + if (lpszOwnFile == NULL) + return FALSE; + + // Create a SID for the BUILTIN\Administrators group. + if (!AllocateAndInitializeSid(&SIDAuthNT, 2, SECURITY_BUILTIN_DOMAIN_RID, + DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &pSIDAdmin)) + goto out; + + // Open a handle to the access token for the calling process. + if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken)) + goto out; + + // Enable the SE_TAKE_OWNERSHIP_NAME privilege. + if (!SetPrivilege(hToken, SE_TAKE_OWNERSHIP_NAME, TRUE)) + goto out; + + // Set the owner in the object's security descriptor. + if (SetNamedSecurityInfoU(lpszOwnFile, SE_FILE_OBJECT, OWNER_SECURITY_INFORMATION, + pSIDAdmin, NULL, NULL, NULL) != ERROR_SUCCESS) + goto out; + + // Disable the SE_TAKE_OWNERSHIP_NAME privilege. + if (!SetPrivilege(hToken, SE_TAKE_OWNERSHIP_NAME, FALSE)) + goto out; + + // Get a pointer to the existing DACL. + if (GetNamedSecurityInfoU(lpszOwnFile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, + NULL, NULL, &pOldDACL, NULL, &pSD) != ERROR_SUCCESS) + goto out; + + // Initialize an EXPLICIT_ACCESS structure for the new ACE + // with full control for Administrators. + ea.grfAccessPermissions = GENERIC_ALL; + ea.grfAccessMode = GRANT_ACCESS; + ea.grfInheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT; + ea.Trustee.TrusteeForm = TRUSTEE_IS_SID; + ea.Trustee.TrusteeType = TRUSTEE_IS_GROUP; + ea.Trustee.ptstrName = (LPTSTR)pSIDAdmin; + + // Create a new ACL that merges the new ACE into the existing DACL. + if (SetEntriesInAcl(1, &ea, pOldDACL, &pNewDACL) != ERROR_SUCCESS) + goto out; + + // Try to modify the object's DACL. + if (SetNamedSecurityInfoU(lpszOwnFile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, + NULL, NULL, pNewDACL, NULL) != ERROR_SUCCESS) + goto out; + + ret = TRUE; + +out: + FreeSid(pSIDAdmin); + LocalFree(pNewDACL); + safe_closehandle(hToken); + return ret; +} diff --git a/src/stdio.c b/src/stdio.c index 40045751..a6c257b4 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -203,7 +203,7 @@ void DumpBufferHex(void *buf, size_t size) uprintf("%s\n", line); line[0] = 0; sprintf(&line[strlen(line)], " %08x ", (unsigned int)i); - for(j=0,k=0; k<16; j++,k++) { + for(j = 0,k = 0; k < 16; j++,k++) { if (i+j < size) { sprintf(&line[strlen(line)], "%02x", buffer[i+j]); } else { @@ -212,7 +212,7 @@ void DumpBufferHex(void *buf, size_t size) sprintf(&line[strlen(line)], " "); } sprintf(&line[strlen(line)], " "); - for(j=0,k=0; k<16; j++,k++) { + for(j = 0,k = 0; k < 16; j++,k++) { if (i+j < size) { if ((buffer[i+j] < 32) || (buffer[i+j] > 126)) { sprintf(&line[strlen(line)], "."); @@ -920,3 +920,60 @@ BOOL ExtractZip(const char* src_zip, const char* dest_dir) bled_exit(); return (extracted_bytes > 0); } + +// Returns a list of all the files or folders from a directory +DWORD ListDirectoryContent(StrArray* arr, char* dir, uint8_t type) +{ + WIN32_FIND_DATAA FindFileData = { 0 }; + HANDLE hFind; + DWORD dwError, dwResult; + char mask[MAX_PATH + 1], path[MAX_PATH + 1]; + + if (arr == NULL || dir == NULL || (type & 0x03) == 0) + return ERROR_INVALID_PARAMETER; + + if (PathCombineU(mask, dir, "*") == NULL) + return GetLastError(); + + hFind = FindFirstFileU(mask, &FindFileData); + if (hFind == INVALID_HANDLE_VALUE) + return GetLastError(); + + dwResult = ERROR_FILE_NOT_FOUND; + do { + if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + if (strcmp(FindFileData.cFileName, ".") == 0 || + strcmp(FindFileData.cFileName, "..") == 0 || + (type & LIST_DIR_TYPE_RECURSIVE) == 0) + continue; + if (PathCombineU(path, dir, FindFileData.cFileName) == NULL) + break; + // Append a trailing backslash to directories + if (path[strlen(path) - 1] != '\\') { + path[strlen(path) + 1] = '\0'; + path[strlen(path)] = '\\'; + } + if (type & LIST_DIR_TYPE_DIRECTORY) + StrArrayAdd(arr, path, TRUE); + dwError = ListDirectoryContent(arr, path, type); + if (dwError != NO_ERROR && dwError != ERROR_FILE_NOT_FOUND) { + SetLastError(dwError); + break; + } + } else { + if (type & LIST_DIR_TYPE_FILE) { + if (PathCombineU(path, dir, FindFileData.cFileName) == NULL) + break; + StrArrayAdd(arr, path, TRUE); + } + dwResult = NO_ERROR; + } + } while (FindNextFileU(hFind, &FindFileData)); + + dwError = GetLastError(); + FindClose(hFind); + + if (dwError != ERROR_NO_MORE_FILES) + return dwError; + return dwResult; +} diff --git a/src/wue.c b/src/wue.c index 6318aede..46db5bfd 100644 --- a/src/wue.c +++ b/src/wue.c @@ -51,6 +51,7 @@ extern uint32_t wim_nb_files, wim_proc_files, wim_extra_files; extern BOOL validate_md5sum; extern uint64_t md5sum_totalbytes; extern StrArray modified_files; +extern const char* efi_archname[ARCH_MAX]; /// /// Create an installation answer file containing the sections specified by the flags. @@ -162,43 +163,56 @@ char* CreateUnattendXml(int arch, int flags) free(tzstr); } } - if (flags & UNATTEND_SET_USER) { - for (i = 0; (i < ARRAYSIZE(unallowed_account_names)) && (stricmp(unattend_username, unallowed_account_names[i]) != 0); i++); - if (i < ARRAYSIZE(unallowed_account_names)) { - uprintf("WARNING: '%s' is not allowed as local account name - Option ignored", unattend_username); - } else if (unattend_username[0] != 0) { - uprintf("• Use '%s' for local account name", unattend_username); - // If we create a local account in unattend.xml, then we can get Windows 11 - // 22H2 to skip MSA even if the network is connected during installation. - fprintf(fd, " \n"); - fprintf(fd, " \n"); - fprintf(fd, " \n"); - fprintf(fd, " %s\n", unattend_username); - fprintf(fd, " %s\n", unattend_username); - fprintf(fd, " Administrators;Power Users\n"); - // Sets an empty password for the account (which, in Microsoft's convoluted ways, - // needs to be initialized to the Base64 encoded UTF-16 string "Password"). - // The use of an empty password has both the advantage of not having to ask users - // to type in a password in Rufus (which they might be weary of) as well as allowing - // automated logon during setup. - fprintf(fd, " \n"); - fprintf(fd, " UABhAHMAcwB3AG8AcgBkAA==\n"); - fprintf(fd, " false</PlainText>\n"); - fprintf(fd, " </Password>\n"); - fprintf(fd, " </LocalAccount>\n"); - fprintf(fd, " </LocalAccounts>\n"); - fprintf(fd, " </UserAccounts>\n"); - // Since we set a blank password, we'll ask the user to change it at next logon. + if (flags & UNATTEND_SET_USER || flags & UNATTEND_USE_MS2023_BOOTLOADERS) { + if (flags & UNATTEND_SET_USER) { + for (i = 0; (i < ARRAYSIZE(unallowed_account_names)) && (stricmp(unattend_username, unallowed_account_names[i]) != 0); i++); + if (i < ARRAYSIZE(unallowed_account_names)) { + uprintf("WARNING: '%s' is not allowed as local account name - Option ignored", unattend_username); + } else if (unattend_username[0] != 0) { + uprintf("• Use '%s' for local account name", unattend_username); + // If we create a local account in unattend.xml, then we can get Windows 11 + // 22H2 to skip MSA even if the network is connected during installation. + fprintf(fd, " <UserAccounts>\n"); + fprintf(fd, " <LocalAccounts>\n"); + fprintf(fd, " <LocalAccount wcm:action=\"add\">\n"); + fprintf(fd, " <Name>%s</Name>\n", unattend_username); + fprintf(fd, " <DisplayName>%s</DisplayName>\n", unattend_username); + fprintf(fd, " <Group>Administrators;Power Users</Group>\n"); + // Sets an empty password for the account (which, in Microsoft's convoluted ways, + // needs to be initialized to the Base64 encoded UTF-16 string "Password"). + // The use of an empty password has both the advantage of not having to ask users + // to type in a password in Rufus (which they might be weary of) as well as allowing + // automated logon during setup. + fprintf(fd, " <Password>\n"); + fprintf(fd, " <Value>UABhAHMAcwB3AG8AcgBkAA==</Value>\n"); + fprintf(fd, " <PlainText>false</PlainText>\n"); + fprintf(fd, " </Password>\n"); + fprintf(fd, " </LocalAccount>\n"); + fprintf(fd, " </LocalAccounts>\n"); + fprintf(fd, " </UserAccounts>\n"); + // Since we set a blank password, we'll ask the user to change it at next logon. + fprintf(fd, " <FirstLogonCommands>\n"); + fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n"); + fprintf(fd, " <Order>%d</Order>\n", order++); + fprintf(fd, " <CommandLine>net user &quot;%s&quot; /logonpasswordchg:yes</CommandLine>\n", unattend_username); + fprintf(fd, " </SynchronousCommand>\n"); + // Some people report that using the `net user` command above might reset the password expiration to 90 days... + // To alleviate that, blanket set passwords on the target machine to never expire. + fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n"); + fprintf(fd, " <Order>%d</Order>\n", order++); + fprintf(fd, " <CommandLine>net accounts /maxpwage:unlimited</CommandLine>\n"); + fprintf(fd, " </SynchronousCommand>\n"); + fprintf(fd, " </FirstLogonCommands>\n"); + } + } + if (flags & UNATTEND_USE_MS2023_BOOTLOADERS) { + uprintf("• Use 'Windows UEFI CA 2023' signed bootloaders"); + // TODO: Validate that we can have multiple <FirstLogonCommands> sections fprintf(fd, " <FirstLogonCommands>\n"); fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n"); fprintf(fd, " <Order>%d</Order>\n", order++); - fprintf(fd, " <CommandLine>net user &quot;%s&quot; /logonpasswordchg:yes</CommandLine>\n", unattend_username); - fprintf(fd, " </SynchronousCommand>\n"); - // Some people report that using the `net user` command above might reset the password expiration to 90 days... - // To alleviate that, blanket set passwords on the target machine to never expire. - fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n"); - fprintf(fd, " <Order>%d</Order>\n", order++); - fprintf(fd, " <CommandLine>net accounts /maxpwage:unlimited</CommandLine>\n"); + // TODO: Validate the actual value on a machine where updates have been applied + fprintf(fd, " <CommandLine>reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Secureboot /v AvailableUpdates /t REG_DWORD /d 0x3c0 /f\n"); fprintf(fd, " </SynchronousCommand>\n"); fprintf(fd, " </FirstLogonCommands>\n"); } @@ -845,7 +859,7 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) setup_arch = GetPeArch(buf); free(buf); if (setup_arch != IMAGE_FILE_MACHINE_AMD64 && setup_arch != IMAGE_FILE_MACHINE_ARM64) { - uprintf("WARNING: Unsupported arch 0x%x -- in-place upgrade wrapper can not be added"); + uprintf("WARNING: Unsupported arch 0x%x -- in-place upgrade wrapper will not be added", setup_arch); } else if (!MoveFileExU(setup_exe, setup_dll, 0)) { uprintf("Could not rename '%s': %s", setup_exe, WindowsErrorString()); } else { @@ -865,7 +879,8 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) UpdateProgressWithInfoForce(OP_PATCH, MSG_325, 0, PATCH_PROGRESS_TOTAL); // We only need to mount boot.wim if we have windowsPE data to deal with. If // not, we can just copy our unattend.xml in \sources\$OEM$\$$\Panther\. - if (flags & UNATTEND_WINPE_SETUP_MASK) { + // We also need to mount it if we use the 'Windows UEFI CA 2023' signed bootloaders. + if (flags & UNATTEND_WINPE_SETUP_MASK || flags & UNATTEND_USE_MS2023_BOOTLOADERS) { if (validate_md5sum) md5sum_totalbytes -= _filesizeU(boot_wim_path); uprintf("Mounting '%s[%d]'...", boot_wim_path, wim_index); @@ -969,6 +984,62 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) } UpdateProgressWithInfoForce(OP_PATCH, MSG_325, 103, PATCH_PROGRESS_TOTAL); } + + if (flags & UNATTEND_USE_MS2023_BOOTLOADERS) { + if_not_assert(mount_path != NULL) + goto out; + static_sprintf(path, "%s\\Windows\\Boot\\EFI_EX\\bootmgfw_EX.efi", mount_path); + if (!PathFileExistsU(path)) { + uprintf("Could not find 2023 signed UEFI bootloader - Ignoring option"); + } else { + char path2[MAX_PATH], *rep; + StrArray files, dirs; + // Replace /EFI/Boot/boot###.efi + for (i = 1; i < ARRAYSIZE(efi_archname); i++) { + static_sprintf(path2, "%c:\\efi\\boot\\boot%s.efi", drive_letter, efi_archname[i]); + if (!PathFileExistsA(path2)) + continue; + if (!CopyFileU(path, path2, FALSE)) + uprintf("WARNING: Could not replace 'boot%s.efi': %s", efi_archname[i], WindowsErrorString()); + break; + } + // Replace /bootmgr.efi + static_sprintf(path, "%s\\Windows\\Boot\\EFI_EX\\bootmgr_EX.efi", mount_path); + static_sprintf(path2, "%c:\\bootmgr.efi", drive_letter); + if (!CopyFileU(path, path2, FALSE)) + uprintf("WARNING: Could not replace 'bootmgr.efi': %s", WindowsErrorString()); + // Microsoft "secures" the Windows\Boot\ dir through their SUPER OBNOXIOUS AND + // WORTHLESS use of DACLs + read-only flags, so we first need to re-take control + // of all directories under there recursively. + StrArrayCreate(&dirs, 64); + StrArrayCreate(&files, 64); + static_sprintf(path, "%s\\Windows\\Boot\\", mount_path); + StrArrayAdd(&dirs, path, TRUE); + static_sprintf(path, "%s\\Windows\\Boot\\EFI_EX\\", mount_path); + StrArrayAdd(&dirs, path, TRUE); + ListDirectoryContent(&dirs, path, LIST_DIR_TYPE_DIRECTORY | LIST_DIR_TYPE_RECURSIVE); + for (i = 0; i < (int)dirs.Index; i++) { + rep = remove_substr(dirs.String[i], "_EX"); + assert(rep != NULL); + TakeOwnership(rep); + safe_free(rep); + } + // Now that we should be able to write to the destination directories, copy the content. + ListDirectoryContent(&files, path, LIST_DIR_TYPE_FILE | LIST_DIR_TYPE_RECURSIVE); + for (i = 0; r && i < (int)files.Index; i++) { + rep = remove_substr(files.String[i], "_EX"); + assert(rep != NULL); + TakeOwnership(rep); + if (!CopyFileU(files.String[i], rep, FALSE) && rep != NULL) + uprintf("WARNING: Could not replace '%s': %s", &rep[strlen(mount_path) + 1], WindowsErrorString()); + safe_free(rep); + } + StrArrayDestroy(&dirs); + StrArrayDestroy(&files); + uprintf("Replaced EFI bootloader files with 'Windows UEFI CA 2023' signed versions"); + } + } + r = TRUE; out: From 6b5837dbb5fc97b72770ccd792bb38ba5c583b7e Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 9 Oct 2024 13:20:30 +0100 Subject: [PATCH 011/192] [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. --- src/db.h | 10 ++++- src/hash.c | 37 ++++++++++++++-- src/parser.c | 39 +++++++++++++++-- src/pki.c | 121 ++++++++++++++++++++++++++++++++++++++++++++++----- src/rufus.c | 2 +- src/rufus.h | 10 ++++- src/rufus.rc | 10 ++--- src/wue.c | 2 +- 8 files changed, 204 insertions(+), 27 deletions(-) diff --git a/src/db.h b/src/db.h index 30aa301a..52c02659 100644 --- a/src/db.h +++ b/src/db.h @@ -2,7 +2,7 @@ * Rufus: The Reliable USB Formatting Utility * DB of the known SHA256 hash values for Rufus downloadable content (GRUB, Syslinux, etc.) * as well PE256 hash values for UEFI revoked content (DBX, SkuSiPolicy.p7b) - * Copyright © 2016-2023 Pete Batard <pete@akeo.ie> + * Copyright © 2016-2024 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -657,6 +657,14 @@ static uint8_t pe256dbx[] = { 0xff, 0xf4, 0x21, 0xa9, 0xdc, 0xd3, 0xef, 0x38, 0xad, 0x58, 0x5e, 0x8b, 0xac, 0xa4, 0x08, 0xac, 0x2e, 0x4c, 0xdb, 0xdf, 0xa6, 0x79, 0x90, 0x0e, 0xc1, 0x70, 0x89, 0x62, 0x4e, 0x31, 0x0a, 0xda, }; +/* + * Contains the SHA-1 thumbprint of certificates that are being revoked by DBX. + * This only includes the 'Microsoft Windows Production PCA 2011' for now. + */ +static uint8_t certdbx[] = { + 0x58, 0x0a, 0x6f, 0x4c, 0xc4, 0xe4, 0xb6, 0x69, 0xb9, 0xeb, 0xdc, 0x1b, 0x2b, 0x3e, 0x08, 0x7b, 0x80, 0xd0, 0x67, 0x8d +}; + /* * Extended SBATLevel.txt that merges Linux SBAT with Microsoft's SVN * See https://github.com/pbatard/rufus/issues/2244#issuecomment-2243661539 diff --git a/src/hash.c b/src/hash.c index d39f68ab..5ff7df10 100644 --- a/src/hash.c +++ b/src/hash.c @@ -117,6 +117,7 @@ StrArray modified_files = { 0 }; extern int default_thread_priority; extern const char* efi_archname[ARCH_MAX]; extern char* sbat_level_txt; +extern BOOL expert_mode; /* * Rotate 32 or 64 bit integers by n bytes. @@ -2166,10 +2167,35 @@ BOOL IsRevokedBySvn(uint8_t* buf, uint32_t len) return FALSE; } +BOOL IsRevokedByCert(uint8_t* buf, uint32_t len) +{ + int i; + uint8_t* cert; + cert_info_t info; + + cert = GetPeSignatureData(buf); + if (cert == NULL) + return FALSE; + if (!GetIssuerCertificateInfo(cert, &info)) + return FALSE; + + for (i = 0; i < ARRAYSIZE(certdbx); i += SHA1_HASHSIZE) { + if (!expert_mode) + continue; + if (memcmp(info.thumbprint, &certdbx[i], SHA1_HASHSIZE) == 0) { + uprintf("Found '%s' revoked certificate", info.name); + return TRUE; + } + } + return FALSE; +} + int IsBootloaderRevoked(uint8_t* buf, uint32_t len) { uint32_t i; uint8_t hash[SHA256_HASHSIZE]; + IMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf; + IMAGE_NT_HEADERS* pe_header; // Fall back to embedded sbat_level.txt if we couldn't access remote if (sbat_entries == NULL) { @@ -2177,8 +2203,10 @@ int IsBootloaderRevoked(uint8_t* buf, uint32_t len) sbat_entries = GetSbatEntries(sbat_level_txt); } - // TODO: More elaborate PE checks? - if (buf == NULL || len < 0x100 || buf[0] != 'M' || buf[1] != 'Z') + if (buf == NULL || len < 0x100 || dos_header->e_magic != IMAGE_DOS_SIGNATURE) + return -2; + pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; + if (pe_header->Signature != IMAGE_NT_SIGNATURE) return -2; if (!PE256Buffer(buf, len, hash)) return -1; @@ -2193,9 +2221,12 @@ int IsBootloaderRevoked(uint8_t* buf, uint32_t len) // Check for Linux SBAT revocation if (IsRevokedBySbat(buf, len)) return 3; - // Sheck for Microsoft SVN revocation + // Check for Microsoft SVN revocation if (IsRevokedBySvn(buf, len)) return 4; + // Check for DBX certificate revocation + if (IsRevokedByCert(buf, len)) + return 5; return 0; } diff --git a/src/parser.c b/src/parser.c index ca48c61e..7bc21692 100644 --- a/src/parser.c +++ b/src/parser.c @@ -24,6 +24,8 @@ #endif #include <windows.h> +#include <wincrypt.h> +#include <wintrust.h> #include <stdio.h> #include <wchar.h> #include <string.h> @@ -1643,10 +1645,12 @@ uint16_t GetPeArch(uint8_t* buf) IMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf; IMAGE_NT_HEADERS* pe_header; - if (buf == NULL) + if (buf == NULL || dos_header->e_magic != IMAGE_DOS_SIGNATURE) return IMAGE_FILE_MACHINE_UNKNOWN; pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; + if (pe_header->Signature != IMAGE_NT_SIGNATURE) + return IMAGE_FILE_MACHINE_UNKNOWN; return pe_header->FileHeader.Machine; } @@ -1662,10 +1666,12 @@ uint8_t* GetPeSection(uint8_t* buf, const char* name, uint32_t* len) static_strcpy(section_name, name); - if (buf == NULL || name == NULL) + if (buf == NULL || name == NULL || dos_header->e_magic != IMAGE_DOS_SIGNATURE) return NULL; pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; + if (pe_header->Signature != IMAGE_NT_SIGNATURE) + return NULL; if (pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 || pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_ARM) { section_header = (IMAGE_SECTION_HEADER*)(&pe_header[1]); nb_sections = pe_header->FileHeader.NumberOfSections; @@ -1693,10 +1699,12 @@ uint8_t* RvaToPhysical(uint8_t* buf, uint32_t rva) IMAGE_NT_HEADERS64* pe64_header; IMAGE_SECTION_HEADER* section_header; - if (buf == NULL) + if (buf == NULL || dos_header->e_magic != IMAGE_DOS_SIGNATURE) return NULL; pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; + if (pe_header->Signature != IMAGE_NT_SIGNATURE) + return NULL; if (pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 || pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_ARM) { section_header = (IMAGE_SECTION_HEADER*)(pe_header + 1); nb_sections = pe_header->FileHeader.NumberOfSections; @@ -1755,3 +1763,28 @@ uint32_t FindResourceRva(const wchar_t* name, uint8_t* root, uint8_t* dir, uint3 } return 0; } + +uint8_t* GetPeSignatureData(uint8_t* buf) +{ + IMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf; + IMAGE_NT_HEADERS* pe_header; + IMAGE_DATA_DIRECTORY sec_dir; + WIN_CERTIFICATE* cert; + + if (buf == NULL || dos_header->e_magic != IMAGE_DOS_SIGNATURE) + return NULL; + + pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; + if (pe_header->Signature != IMAGE_NT_SIGNATURE) + return NULL; + + sec_dir = pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY]; + if (sec_dir.VirtualAddress == 0 || sec_dir.Size == 0) + return NULL; + + cert = (WIN_CERTIFICATE*)&buf[sec_dir.VirtualAddress]; + if (cert->dwLength == 0 || cert->wCertificateType != WIN_CERT_TYPE_PKCS_SIGNED_DATA) + return NULL; + + return (uint8_t*)cert; +} diff --git a/src/pki.c b/src/pki.c index 5c69d3fc..09dda43c 100644 --- a/src/pki.c +++ b/src/pki.c @@ -271,9 +271,9 @@ char* GetSignatureName(const char* path, const char* country_code, BOOL bSilent) HCERTSTORE hStore = NULL; HCRYPTMSG hMsg = NULL; PCCERT_CONTEXT pCertContext = NULL; - DWORD dwSize, dwEncoding, dwContentType, dwFormatType; + DWORD dwSize, dwEncoding, dwContentType, dwFormatType, dwSignerInfoSize = 0; PCMSG_SIGNER_INFO pSignerInfo = NULL; - DWORD dwSignerInfo = 0; + // TODO: Do we really need CertInfo? Or can we just reference pSignerInfo? CERT_INFO CertInfo = { 0 }; SPROG_PUBLISHERINFO ProgPubInfo = { 0 }; wchar_t *szFileName; @@ -311,21 +311,21 @@ char* GetSignatureName(const char* path, const char* country_code, BOOL bSilent) goto out; // Get signer information size. - r = CryptMsgGetParam(hMsg, CMSG_SIGNER_INFO_PARAM, 0, NULL, &dwSignerInfo); + r = CryptMsgGetParam(hMsg, CMSG_SIGNER_INFO_PARAM, 0, NULL, &dwSignerInfoSize); if (!r) { uprintf("PKI: Failed to get signer size: %s", WinPKIErrorString()); goto out; } // Allocate memory for signer information. - pSignerInfo = (PCMSG_SIGNER_INFO)calloc(dwSignerInfo, 1); + pSignerInfo = (PCMSG_SIGNER_INFO)calloc(dwSignerInfoSize, 1); if (!pSignerInfo) { uprintf("PKI: Could not allocate memory for signer information"); goto out; } // Get Signer Information. - r = CryptMsgGetParam(hMsg, CMSG_SIGNER_INFO_PARAM, 0, (PVOID)pSignerInfo, &dwSignerInfo); + r = CryptMsgGetParam(hMsg, CMSG_SIGNER_INFO_PARAM, 0, (PVOID)pSignerInfo, &dwSignerInfoSize); if (!r) { uprintf("PKI: Failed to get signer information: %s", WinPKIErrorString()); goto out; @@ -334,10 +334,9 @@ char* GetSignatureName(const char* path, const char* country_code, BOOL bSilent) // Search for the signer certificate in the temporary certificate store. CertInfo.Issuer = pSignerInfo->Issuer; CertInfo.SerialNumber = pSignerInfo->SerialNumber; - pCertContext = CertFindCertificateInStore(hStore, ENCODING, 0, CERT_FIND_SUBJECT_CERT, (PVOID)&CertInfo, NULL); if (!pCertContext) { - uprintf("PKI: Failed to locate signer certificate in temporary store: %s", WinPKIErrorString()); + uprintf("PKI: Failed to locate signer certificate in store: %s", WinPKIErrorString()); goto out; } @@ -385,6 +384,105 @@ out: return p; } +// Return the issuer certificate's name and thumbprint +BOOL GetIssuerCertificateInfo(uint8_t* cert, cert_info_t* info) +{ + BOOL ret = FALSE; + DWORD dwSize, dwEncoding, dwContentType, dwFormatType, dwSignerInfoSize = 0; + WIN_CERTIFICATE* pWinCert = (WIN_CERTIFICATE*)cert; + CRYPT_DATA_BLOB signedDataBlob; + HCERTSTORE hStore = NULL; + HCRYPTMSG hMsg = NULL; + PCMSG_SIGNER_INFO pSignerInfo = NULL; + PCCERT_CONTEXT pCertContext = NULL, pIssuerCertContext = NULL; + PCCERT_CHAIN_CONTEXT pChainContext = NULL; + CERT_CHAIN_PARA chainPara; + + if (cert == NULL || info == NULL || pWinCert->dwLength == 0) + return FALSE; + + signedDataBlob.cbData = pWinCert->dwLength - sizeof(WIN_CERTIFICATE); + signedDataBlob.pbData = pWinCert->bCertificate; + + // Get message handle and store handle from the signed file. + if (!CryptQueryObject(CERT_QUERY_OBJECT_BLOB, &signedDataBlob, + CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED, CERT_QUERY_FORMAT_FLAG_BINARY, + 0, &dwEncoding, &dwContentType, &dwFormatType, &hStore, &hMsg, NULL)) { + uprintf("PKI: Failed to get signature: %s", WinPKIErrorString()); + goto out; + } + + // Get signer information size. + if (!CryptMsgGetParam(hMsg, CMSG_SIGNER_CERT_INFO_PARAM, 0, NULL, &dwSignerInfoSize)) { + uprintf("PKI: Failed to get signer size: %s", WinPKIErrorString()); + goto out; + } + + // Allocate memory for signer information. + pSignerInfo = (PCMSG_SIGNER_INFO)calloc(dwSignerInfoSize, 1); + if (!pSignerInfo) { + uprintf("PKI: Could not allocate memory for signer information"); + goto out; + } + + // Get Signer Information. + if (!CryptMsgGetParam(hMsg, CMSG_SIGNER_CERT_INFO_PARAM, 0, pSignerInfo, &dwSignerInfoSize)) { + uprintf("PKI: Failed to get signer info: %s", WinPKIErrorString()); + goto out; + } + + // Search for the signer certificate in the temporary certificate store. + pCertContext = CertFindCertificateInStore(hStore, ENCODING, 0, CERT_FIND_SUBJECT_CERT, (PVOID)pSignerInfo, NULL); + if (!pCertContext) { + uprintf("PKI: Failed to locate signer certificate in store: %s", WinPKIErrorString()); + goto out; + } + + // Build a certificate chain to get the issuer (CA) certificate. + memset(&chainPara, 0, sizeof(chainPara)); + chainPara.cbSize = sizeof(CERT_CHAIN_PARA); + if (!CertGetCertificateChain(NULL, pCertContext, NULL, hStore, &chainPara, 0, NULL, &pChainContext)) { + uprintf("PKI: Failed to build certificate chain. Error code: %s", WinPKIErrorString()); + goto out; + } + + // Get the issuer's certificate (second certificate in the chain) + if (pChainContext->cChain > 0 && pChainContext->rgpChain[0]->cElement > 1) { + pIssuerCertContext = pChainContext->rgpChain[0]->rgpElement[1]->pCertContext; + } else { + uprintf("PKI: Failed to retrieve issuer's certificate: %s", WinPKIErrorString()); + goto out; + } + + // Isolate the signing certificate subject name + dwSize = CertGetNameStringA(pIssuerCertContext, CERT_NAME_ATTR_TYPE, 0, szOID_COMMON_NAME, + info->name, sizeof(info->name)); + if (dwSize <= 1) { + uprintf("PKI: Failed to get Subject Name"); + goto out; + } + + dwSize = SHA1_HASHSIZE; + if (!CryptHashCertificate(0, CALG_SHA1, 0, pIssuerCertContext->pbCertEncoded, + pIssuerCertContext->cbCertEncoded, info->thumbprint, &dwSize)) { + uprintf("PKI: Failed to compute the thumbprint: %s", WinPKIErrorString()); + goto out; + } + ret = TRUE; + +out: + safe_free(pSignerInfo); + if (pIssuerCertContext != NULL) + CertFreeCertificateContext(pIssuerCertContext); + if (pCertContext != NULL) + CertFreeCertificateContext(pCertContext); + if (hStore != NULL) + CertCloseStore(hStore, 0); + if (hMsg != NULL) + CryptMsgClose(hMsg); + return ret; +} + // The timestamping authorities we use are RFC 3161 compliant static uint64_t GetRFC3161TimeStamp(PCMSG_SIGNER_INFO pSignerInfo) { @@ -523,9 +621,8 @@ uint64_t GetSignatureTimeStamp(const char* path) HMODULE hm; HCERTSTORE hStore = NULL; HCRYPTMSG hMsg = NULL; - DWORD dwSize, dwEncoding, dwContentType, dwFormatType; + DWORD dwSize, dwEncoding, dwContentType, dwFormatType, dwSignerInfoSize = 0; PCMSG_SIGNER_INFO pSignerInfo = NULL; - DWORD dwSignerInfo = 0; wchar_t *szFileName; uint64_t timestamp = 0ULL, nested_timestamp; @@ -559,21 +656,21 @@ uint64_t GetSignatureTimeStamp(const char* path) } // Get signer information size. - r = CryptMsgGetParam(hMsg, CMSG_SIGNER_INFO_PARAM, 0, NULL, &dwSignerInfo); + r = CryptMsgGetParam(hMsg, CMSG_SIGNER_INFO_PARAM, 0, NULL, &dwSignerInfoSize); if (!r) { uprintf("PKI: Failed to get signer size: %s", WinPKIErrorString()); goto out; } // Allocate memory for signer information. - pSignerInfo = (PCMSG_SIGNER_INFO)calloc(dwSignerInfo, 1); + pSignerInfo = (PCMSG_SIGNER_INFO)calloc(dwSignerInfoSize, 1); if (!pSignerInfo) { uprintf("PKI: Could not allocate memory for signer information"); goto out; } // Get Signer Information. - r = CryptMsgGetParam(hMsg, CMSG_SIGNER_INFO_PARAM, 0, (PVOID)pSignerInfo, &dwSignerInfo); + r = CryptMsgGetParam(hMsg, CMSG_SIGNER_INFO_PARAM, 0, (PVOID)pSignerInfo, &dwSignerInfoSize); if (!r) { uprintf("PKI: Failed to get signer information: %s", WinPKIErrorString()); goto out; diff --git a/src/rufus.c b/src/rufus.c index 8e083734..09dcc29f 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1610,7 +1610,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) // Check UEFI bootloaders for revocation if (IS_EFI_BOOTABLE(img_report)) { for (i = 0; i < ARRAYSIZE(img_report.efi_boot_path) && img_report.efi_boot_path[i][0] != 0; i++) { - static const char* revocation_type[] = { "UEFI DBX", "Windows SSP", "Linux SBAT", "Windows SVN" }; + static const char* revocation_type[] = { "UEFI DBX", "Windows SSP", "Linux SBAT", "Windows SVN", "Cert DBX" }; len = ReadISOFileToBuffer(image_path, img_report.efi_boot_path[i], &buf); if (len == 0) { uprintf("Warning: Failed to extract '%s' to check for UEFI revocation", img_report.efi_boot_path[i]); diff --git a/src/rufus.h b/src/rufus.h index 9240784a..61e26ff8 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -528,6 +528,12 @@ typedef struct ALIGNED(64) { uint64_t bytecount; } HASH_CONTEXT; +/* Certificate info */ +typedef struct { + char name[256]; + uint8_t thumbprint[SHA1_HASHSIZE]; +} cert_info_t; + /* Hash functions */ typedef void hash_init_t(HASH_CONTEXT* ctx); typedef void hash_write_t(HASH_CONTEXT* ctx, const uint8_t* buf, size_t len); @@ -658,7 +664,7 @@ typedef struct htab_table { uint32_t size; uint32_t filled; } htab_table; -#define HTAB_EMPTY {NULL, 0, 0} +#define HTAB_EMPTY { NULL, 0, 0 } extern BOOL htab_create(uint32_t nel, htab_table* htab); extern void htab_destroy(htab_table* htab); extern uint32_t htab_hash(char* str, htab_table* htab); @@ -799,6 +805,7 @@ extern void* get_data_from_asn1(const uint8_t* buf, size_t buf_len, const char* extern int sanitize_label(char* label); extern int IsHDD(DWORD DriveIndex, uint16_t vid, uint16_t pid, const char* strid); extern char* GetSignatureName(const char* path, const char* country_code, BOOL bSilent); +extern BOOL GetIssuerCertificateInfo(uint8_t* cert, cert_info_t* info); extern uint64_t GetSignatureTimeStamp(const char* path); extern LONG ValidateSignature(HWND hDlg, const char* path); extern BOOL ValidateOpensslSignature(BYTE* pbBuffer, DWORD dwBufferLen, BYTE* pbSignature, DWORD dwSigLen); @@ -841,6 +848,7 @@ extern uint32_t ResolveDllAddress(dll_resolver_t* resolver); extern sbat_entry_t* GetSbatEntries(char* sbatlevel); extern uint16_t GetPeArch(uint8_t* buf); extern uint8_t* GetPeSection(uint8_t* buf, const char* name, uint32_t* len); +extern uint8_t* GetPeSignatureData(uint8_t* buf); extern uint8_t* RvaToPhysical(uint8_t* buf, uint32_t rva); extern uint32_t FindResourceRva(const wchar_t* name, uint8_t* root, uint8_t* dir, uint32_t* len); extern DWORD ListDirectoryContent(StrArray* arr, char* dir, uint8_t type); diff --git a/src/rufus.rc b/src/rufus.rc index 7236b2c2..ac354696 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.6.2201" +CAPTION "Rufus 4.6.2202" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2201,0 - PRODUCTVERSION 4,6,2201,0 + FILEVERSION 4,6,2202,0 + PRODUCTVERSION 4,6,2202,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2201" + VALUE "FileVersion", "4.6.2202" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2201" + VALUE "ProductVersion", "4.6.2202" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index 46db5bfd..d7b14cf4 100644 --- a/src/wue.c +++ b/src/wue.c @@ -1026,7 +1026,7 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) } // Now that we should be able to write to the destination directories, copy the content. ListDirectoryContent(&files, path, LIST_DIR_TYPE_FILE | LIST_DIR_TYPE_RECURSIVE); - for (i = 0; r && i < (int)files.Index; i++) { + for (i = 0; i < (int)files.Index; i++) { rep = remove_substr(files.String[i], "_EX"); assert(rep != NULL); TakeOwnership(rep); From ede52c57e65ff25d9b27591eb233705ced62a30d Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 9 Oct 2024 20:18:42 +0100 Subject: [PATCH 012/192] [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. --- res/loc/rufus.loc | 1 + src/hash.c | 33 +++++++++++++++++------------ src/parser.c | 24 +++++++++++++-------- src/pki.c | 54 ++++++++++++++++++++++++----------------------- src/rufus.c | 45 +++++++++++++++++++++++++-------------- src/rufus.h | 2 +- src/rufus.rc | 10 ++++----- 7 files changed, 98 insertions(+), 71 deletions(-) diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 32744328..63d590fd 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -610,6 +610,7 @@ t MSG_347 "Expert Mode" t MSG_348 "Extracting archive files: %s" t MSG_349 "Use Rufus MBR" t MSG_350 "Use 'Windows UEFI CA 2023' signed bootloaders [EXPERIMENTAL]" +t MSG_351 "Checking for UEFI bootloader revocation..." # The following messages are for the Windows Store listing only and are not used by the application t MSG_900 "Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc." t MSG_901 "Official site: %s" diff --git a/src/hash.c b/src/hash.c index 5ff7df10..1b0b2ce9 100644 --- a/src/hash.c +++ b/src/hash.c @@ -117,7 +117,7 @@ StrArray modified_files = { 0 }; extern int default_thread_priority; extern const char* efi_archname[ARCH_MAX]; extern char* sbat_level_txt; -extern BOOL expert_mode; +extern BOOL expert_mode, usb_debug; /* * Rotate 32 or 64 bit integers by n bytes. @@ -2081,7 +2081,7 @@ BOOL IsFileInDB(const char* path) return FALSE; } -BOOL IsRevokedBySbat(uint8_t* buf, uint32_t len) +static BOOL IsRevokedBySbat(uint8_t* buf, uint32_t len) { char* sbat = NULL, *version_str; uint32_t i, j, sbat_len; @@ -2109,6 +2109,7 @@ BOOL IsRevokedBySbat(uint8_t* buf, uint32_t len) for (; sbat[i] != ',' && sbat[i] != '\0' && sbat[i] != '\n'; i++); sbat[i++] = '\0'; entry.version = atoi(version_str); + uuprintf(" SBAT: %s,%d", entry.product, entry.version); for (; sbat[i] != '\0' && sbat[i] != '\n'; i++); if (entry.version == 0) continue; @@ -2121,13 +2122,13 @@ BOOL IsRevokedBySbat(uint8_t* buf, uint32_t len) return FALSE; } -BOOL IsRevokedBySvn(uint8_t* buf, uint32_t len) +static BOOL IsRevokedBySvn(uint8_t* buf, uint32_t len) { wchar_t* rsrc_name = NULL; uint8_t *root; uint32_t i, j, rsrc_rva, rsrc_len, *svn_ver; IMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf; - IMAGE_NT_HEADERS* pe_header; + IMAGE_NT_HEADERS32* pe_header; IMAGE_NT_HEADERS64* pe64_header; IMAGE_DATA_DIRECTORY img_data_dir; @@ -2143,7 +2144,7 @@ BOOL IsRevokedBySvn(uint8_t* buf, uint32_t len) if (rsrc_name == NULL) continue; - pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; + pe_header = (IMAGE_NT_HEADERS32*)&buf[dos_header->e_lfanew]; if (pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 || pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_ARM) { img_data_dir = pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE]; } else { @@ -2157,6 +2158,7 @@ BOOL IsRevokedBySvn(uint8_t* buf, uint32_t len) if (rsrc_rva != 0) { if (rsrc_len == sizeof(uint32_t)) { svn_ver = (uint32_t*)RvaToPhysical(buf, rsrc_rva); + uuprintf(" SVN version: %d.%d", *svn_ver >> 16, *svn_ver & 0xffff); if (svn_ver != NULL && *svn_ver < sbat_entries[i].version) return TRUE; } else { @@ -2167,18 +2169,20 @@ BOOL IsRevokedBySvn(uint8_t* buf, uint32_t len) return FALSE; } -BOOL IsRevokedByCert(uint8_t* buf, uint32_t len) +static BOOL IsRevokedByCert(uint8_t* buf, uint32_t len) { int i; uint8_t* cert; cert_info_t info; cert = GetPeSignatureData(buf); - if (cert == NULL) - return FALSE; - if (!GetIssuerCertificateInfo(cert, &info)) + i = GetIssuerCertificateInfo(cert, &info); + if (i == 0) + uuprintf(" (Unsigned Bootloader)"); + if (i <= 0) return FALSE; + uuprintf(" Signed by: %s", info.name); for (i = 0; i < ARRAYSIZE(certdbx); i += SHA1_HASHSIZE) { if (!expert_mode) continue; @@ -2195,7 +2199,7 @@ int IsBootloaderRevoked(uint8_t* buf, uint32_t len) uint32_t i; uint8_t hash[SHA256_HASHSIZE]; IMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf; - IMAGE_NT_HEADERS* pe_header; + IMAGE_NT_HEADERS32* pe_header; // Fall back to embedded sbat_level.txt if we couldn't access remote if (sbat_entries == NULL) { @@ -2205,11 +2209,15 @@ int IsBootloaderRevoked(uint8_t* buf, uint32_t len) if (buf == NULL || len < 0x100 || dos_header->e_magic != IMAGE_DOS_SIGNATURE) return -2; - pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; + pe_header = (IMAGE_NT_HEADERS32*)&buf[dos_header->e_lfanew]; if (pe_header->Signature != IMAGE_NT_SIGNATURE) return -2; if (!PE256Buffer(buf, len, hash)) return -1; + // Check for UEFI DBX certificate revocation + // This also displays the name of the signer/issuer cert if available + if (IsRevokedByCert(buf, len)) + return 5; // Check for UEFI DBX revocation for (i = 0; i < ARRAYSIZE(pe256dbx); i += SHA256_HASHSIZE) if (memcmp(hash, &pe256dbx[i], SHA256_HASHSIZE) == 0) @@ -2224,9 +2232,6 @@ int IsBootloaderRevoked(uint8_t* buf, uint32_t len) // Check for Microsoft SVN revocation if (IsRevokedBySvn(buf, len)) return 4; - // Check for DBX certificate revocation - if (IsRevokedByCert(buf, len)) - return 5; return 0; } diff --git a/src/parser.c b/src/parser.c index 7bc21692..4c582826 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1643,12 +1643,12 @@ sbat_entry_t* GetSbatEntries(char* sbatlevel) uint16_t GetPeArch(uint8_t* buf) { IMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf; - IMAGE_NT_HEADERS* pe_header; + IMAGE_NT_HEADERS32* pe_header; if (buf == NULL || dos_header->e_magic != IMAGE_DOS_SIGNATURE) return IMAGE_FILE_MACHINE_UNKNOWN; - pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; + pe_header = (IMAGE_NT_HEADERS32*)&buf[dos_header->e_lfanew]; if (pe_header->Signature != IMAGE_NT_SIGNATURE) return IMAGE_FILE_MACHINE_UNKNOWN; return pe_header->FileHeader.Machine; @@ -1660,7 +1660,7 @@ uint8_t* GetPeSection(uint8_t* buf, const char* name, uint32_t* len) char section_name[IMAGE_SIZEOF_SHORT_NAME] = { 0 }; uint32_t i, nb_sections; IMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf; - IMAGE_NT_HEADERS* pe_header; + IMAGE_NT_HEADERS32* pe_header; IMAGE_NT_HEADERS64* pe64_header; IMAGE_SECTION_HEADER* section_header; @@ -1669,7 +1669,7 @@ uint8_t* GetPeSection(uint8_t* buf, const char* name, uint32_t* len) if (buf == NULL || name == NULL || dos_header->e_magic != IMAGE_DOS_SIGNATURE) return NULL; - pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; + pe_header = (IMAGE_NT_HEADERS32*)&buf[dos_header->e_lfanew]; if (pe_header->Signature != IMAGE_NT_SIGNATURE) return NULL; if (pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 || pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_ARM) { @@ -1695,14 +1695,14 @@ uint8_t* RvaToPhysical(uint8_t* buf, uint32_t rva) { uint32_t i, nb_sections; IMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf; - IMAGE_NT_HEADERS* pe_header; + IMAGE_NT_HEADERS32* pe_header; IMAGE_NT_HEADERS64* pe64_header; IMAGE_SECTION_HEADER* section_header; if (buf == NULL || dos_header->e_magic != IMAGE_DOS_SIGNATURE) return NULL; - pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; + pe_header = (IMAGE_NT_HEADERS32*)&buf[dos_header->e_lfanew]; if (pe_header->Signature != IMAGE_NT_SIGNATURE) return NULL; if (pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 || pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_ARM) { @@ -1767,18 +1767,24 @@ uint32_t FindResourceRva(const wchar_t* name, uint8_t* root, uint8_t* dir, uint3 uint8_t* GetPeSignatureData(uint8_t* buf) { IMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf; - IMAGE_NT_HEADERS* pe_header; + IMAGE_NT_HEADERS32* pe_header; + IMAGE_NT_HEADERS64* pe64_header; IMAGE_DATA_DIRECTORY sec_dir; WIN_CERTIFICATE* cert; if (buf == NULL || dos_header->e_magic != IMAGE_DOS_SIGNATURE) return NULL; - pe_header = (IMAGE_NT_HEADERS*)&buf[dos_header->e_lfanew]; + pe_header = (IMAGE_NT_HEADERS32*)&buf[dos_header->e_lfanew]; if (pe_header->Signature != IMAGE_NT_SIGNATURE) return NULL; - sec_dir = pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY]; + if (pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 || pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_ARM) { + sec_dir = pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY]; + } else { + pe64_header = (IMAGE_NT_HEADERS64*)pe_header; + sec_dir = pe64_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY]; + } if (sec_dir.VirtualAddress == 0 || sec_dir.Size == 0) return NULL; diff --git a/src/pki.c b/src/pki.c index 09dda43c..fe923c15 100644 --- a/src/pki.c +++ b/src/pki.c @@ -384,27 +384,31 @@ out: return p; } -// Return the issuer certificate's name and thumbprint -BOOL GetIssuerCertificateInfo(uint8_t* cert, cert_info_t* info) +// Fills the certificate's name and thumbprint. +// Tries the issuer first, and if none is available, falls back to current cert. +// Returns 0 for unsigned, -1 on error, 1 for signer or 2 for issuer. +int GetIssuerCertificateInfo(uint8_t* cert, cert_info_t* info) { - BOOL ret = FALSE; + int ret = 0; DWORD dwSize, dwEncoding, dwContentType, dwFormatType, dwSignerInfoSize = 0; WIN_CERTIFICATE* pWinCert = (WIN_CERTIFICATE*)cert; CRYPT_DATA_BLOB signedDataBlob; HCERTSTORE hStore = NULL; HCRYPTMSG hMsg = NULL; PCMSG_SIGNER_INFO pSignerInfo = NULL; - PCCERT_CONTEXT pCertContext = NULL, pIssuerCertContext = NULL; + PCCERT_CONTEXT pCertContext[2] = { NULL, NULL }; PCCERT_CHAIN_CONTEXT pChainContext = NULL; CERT_CHAIN_PARA chainPara; + int CertIndex = 0; - if (cert == NULL || info == NULL || pWinCert->dwLength == 0) - return FALSE; - - signedDataBlob.cbData = pWinCert->dwLength - sizeof(WIN_CERTIFICATE); - signedDataBlob.pbData = pWinCert->bCertificate; + if (info == NULL) + return -1; + if (pWinCert == NULL || pWinCert->dwLength == 0) + return 0; // Get message handle and store handle from the signed file. + signedDataBlob.cbData = pWinCert->dwLength; + signedDataBlob.pbData = pWinCert->bCertificate; if (!CryptQueryObject(CERT_QUERY_OBJECT_BLOB, &signedDataBlob, CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED, CERT_QUERY_FORMAT_FLAG_BINARY, 0, &dwEncoding, &dwContentType, &dwFormatType, &hStore, &hMsg, NULL)) { @@ -420,7 +424,7 @@ BOOL GetIssuerCertificateInfo(uint8_t* cert, cert_info_t* info) // Allocate memory for signer information. pSignerInfo = (PCMSG_SIGNER_INFO)calloc(dwSignerInfoSize, 1); - if (!pSignerInfo) { + if (pSignerInfo == NULL) { uprintf("PKI: Could not allocate memory for signer information"); goto out; } @@ -432,8 +436,8 @@ BOOL GetIssuerCertificateInfo(uint8_t* cert, cert_info_t* info) } // Search for the signer certificate in the temporary certificate store. - pCertContext = CertFindCertificateInStore(hStore, ENCODING, 0, CERT_FIND_SUBJECT_CERT, (PVOID)pSignerInfo, NULL); - if (!pCertContext) { + pCertContext[0] = CertFindCertificateInStore(hStore, ENCODING, 0, CERT_FIND_SUBJECT_CERT, (PVOID)pSignerInfo, NULL); + if (pCertContext[0] == NULL) { uprintf("PKI: Failed to locate signer certificate in store: %s", WinPKIErrorString()); goto out; } @@ -441,21 +445,19 @@ BOOL GetIssuerCertificateInfo(uint8_t* cert, cert_info_t* info) // Build a certificate chain to get the issuer (CA) certificate. memset(&chainPara, 0, sizeof(chainPara)); chainPara.cbSize = sizeof(CERT_CHAIN_PARA); - if (!CertGetCertificateChain(NULL, pCertContext, NULL, hStore, &chainPara, 0, NULL, &pChainContext)) { + if (!CertGetCertificateChain(NULL, pCertContext[0], NULL, hStore, &chainPara, 0, NULL, &pChainContext)) { uprintf("PKI: Failed to build certificate chain. Error code: %s", WinPKIErrorString()); goto out; } - // Get the issuer's certificate (second certificate in the chain) + // Try to get the issuer's certificate (second certificate in the chain) if available if (pChainContext->cChain > 0 && pChainContext->rgpChain[0]->cElement > 1) { - pIssuerCertContext = pChainContext->rgpChain[0]->rgpElement[1]->pCertContext; - } else { - uprintf("PKI: Failed to retrieve issuer's certificate: %s", WinPKIErrorString()); - goto out; + pCertContext[1] = pChainContext->rgpChain[0]->rgpElement[1]->pCertContext; + CertIndex = 1; } // Isolate the signing certificate subject name - dwSize = CertGetNameStringA(pIssuerCertContext, CERT_NAME_ATTR_TYPE, 0, szOID_COMMON_NAME, + dwSize = CertGetNameStringA(pCertContext[CertIndex], CERT_NAME_ATTR_TYPE, 0, szOID_COMMON_NAME, info->name, sizeof(info->name)); if (dwSize <= 1) { uprintf("PKI: Failed to get Subject Name"); @@ -463,19 +465,19 @@ BOOL GetIssuerCertificateInfo(uint8_t* cert, cert_info_t* info) } dwSize = SHA1_HASHSIZE; - if (!CryptHashCertificate(0, CALG_SHA1, 0, pIssuerCertContext->pbCertEncoded, - pIssuerCertContext->cbCertEncoded, info->thumbprint, &dwSize)) { + if (!CryptHashCertificate(0, CALG_SHA1, 0, pCertContext[CertIndex]->pbCertEncoded, + pCertContext[CertIndex]->cbCertEncoded, info->thumbprint, &dwSize)) { uprintf("PKI: Failed to compute the thumbprint: %s", WinPKIErrorString()); goto out; } - ret = TRUE; + ret = CertIndex + 1; out: safe_free(pSignerInfo); - if (pIssuerCertContext != NULL) - CertFreeCertificateContext(pIssuerCertContext); - if (pCertContext != NULL) - CertFreeCertificateContext(pCertContext); + if (pCertContext[1] != NULL) + CertFreeCertificateContext(pCertContext[1]); + if (pCertContext[0] != NULL) + CertFreeCertificateContext(pCertContext[0]); if (hStore != NULL) CertCloseStore(hStore, 0); if (hMsg != NULL) diff --git a/src/rufus.c b/src/rufus.c index 09dcc29f..2f317ae5 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1399,7 +1399,7 @@ out: // Likewise, boot check will block message processing => use a thread static DWORD WINAPI BootCheckThread(LPVOID param) { - int i, r, username_index = -1; + int i, r, rr, username_index = -1; FILE *fd; uint32_t len; uint8_t* buf = NULL; @@ -1609,33 +1609,43 @@ static DWORD WINAPI BootCheckThread(LPVOID param) // Check UEFI bootloaders for revocation if (IS_EFI_BOOTABLE(img_report)) { + assert(ARRAYSIZE(img_report.efi_boot_path) > 0); + PrintStatus(0, MSG_351); + uuprintf("UEFI Secure Boot revocation checks:"); + rr = 0; for (i = 0; i < ARRAYSIZE(img_report.efi_boot_path) && img_report.efi_boot_path[i][0] != 0; i++) { static const char* revocation_type[] = { "UEFI DBX", "Windows SSP", "Linux SBAT", "Windows SVN", "Cert DBX" }; + cdio_loglevel_default = CDIO_LOG_WARN; len = ReadISOFileToBuffer(image_path, img_report.efi_boot_path[i], &buf); + cdio_loglevel_default = usb_debug ? CDIO_LOG_DEBUG : CDIO_LOG_WARN; if (len == 0) { uprintf("Warning: Failed to extract '%s' to check for UEFI revocation", img_report.efi_boot_path[i]); continue; } + uuprintf("• %s", img_report.efi_boot_path[i]); r = IsBootloaderRevoked(buf, len); safe_free(buf); if (r > 0) { assert(r <= ARRAYSIZE(revocation_type)); + if (rr == 0) + rr = r; uprintf("Warning: '%s' has been revoked by %s", img_report.efi_boot_path[i], revocation_type[r - 1]); is_bootloader_revoked = TRUE; - switch (r) { - case 2: - msg = lmprintf(MSG_341, "Error code: 0xc0000428"); - break; - default: - msg = lmprintf(MSG_340); - break; - } - r = MessageBoxExU(hMainDialog, lmprintf(MSG_339, msg), lmprintf(MSG_338), - MB_OKCANCEL | MB_ICONWARNING | MB_IS_RTL, selected_langid); - if (r == IDCANCEL) - goto out; + } + } + if (rr > 0) { + switch (rr) { + case 2: + msg = lmprintf(MSG_341, "Error code: 0xc0000428"); + break; + default: + msg = lmprintf(MSG_340); break; } + r = MessageBoxExU(hMainDialog, lmprintf(MSG_339, msg), lmprintf(MSG_338), + MB_OKCANCEL | MB_ICONWARNING | MB_IS_RTL, selected_langid); + if (r == IDCANCEL) + goto out; } } @@ -1691,7 +1701,6 @@ static DWORD WINAPI BootCheckThread(LPVOID param) IGNORE_RETVAL(_chdir(tmp)); // The following loops through the grub2 version (which may have the ISO label appended) // and breaks it according to '.' or '-' until it finds a match on the server. - // for (i = (int)strlen(img_report.grub2_version), grub2_len = 0; i > 0 && grub2_len <= 0; i--) { c = img_report.grub2_version[i]; if (c != 0 && c != '.' && c != '-') @@ -1761,7 +1770,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) IGNORE_RETVAL(_chdirU(app_data_dir)); IGNORE_RETVAL(_mkdir(FILES_DIR)); IGNORE_RETVAL(_chdir(FILES_DIR)); - for (i=0; i<2; i++) { + for (i = 0; i < 2; i++) { // Check if we already have the relevant ldlinux_v#.##.sys & ldlinux_v#.##.bss files static_sprintf(tmp, "%s-%s%s\\%s.%s", syslinux, img_report.sl_version_str, img_report.sl_version_ext, ldlinux, ldlinux_ext[i]); @@ -1783,7 +1792,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) lmprintf(MSG_115), MB_YESNO | MB_ICONWARNING | MB_IS_RTL, selected_langid); if (r != IDYES) goto out; - for (i=0; i<2; i++) { + for (i = 0; i < 2; i++) { static_sprintf(tmp, "%s-%s", syslinux, img_report.sl_version_str); IGNORE_RETVAL(_mkdir(tmp)); if (*img_report.sl_version_ext != 0) { @@ -2970,6 +2979,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA if (!Notification(MSG_WARNING_QUESTION, NULL, NULL, title, lmprintf(MSG_132))) goto aborted_start; } + PrintStatus(0, MSG_142); GetWindowTextU(hDeviceList, tmp, ARRAYSIZE(tmp)); if (MessageBoxExU(hMainDialog, lmprintf(MSG_003, tmp), @@ -3005,6 +3015,9 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA if (queued_hotplug_event) SendMessage(hDlg, UM_MEDIA_CHANGE, 0, 0); if (wParam == BOOTCHECK_CANCEL) { + nb_devices = ComboBox_GetCount(hDeviceList); + PrintStatus(0, (nb_devices == 1) ? MSG_208 : MSG_209, nb_devices); + PrintStatus(5000, MSG_041); if (unattend_xml_path != NULL) { DeleteFileU(unattend_xml_path); unattend_xml_path = NULL; diff --git a/src/rufus.h b/src/rufus.h index 61e26ff8..1d5a7adb 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -805,7 +805,7 @@ extern void* get_data_from_asn1(const uint8_t* buf, size_t buf_len, const char* extern int sanitize_label(char* label); extern int IsHDD(DWORD DriveIndex, uint16_t vid, uint16_t pid, const char* strid); extern char* GetSignatureName(const char* path, const char* country_code, BOOL bSilent); -extern BOOL GetIssuerCertificateInfo(uint8_t* cert, cert_info_t* info); +extern int GetIssuerCertificateInfo(uint8_t* cert, cert_info_t* info); extern uint64_t GetSignatureTimeStamp(const char* path); extern LONG ValidateSignature(HWND hDlg, const char* path); extern BOOL ValidateOpensslSignature(BYTE* pbBuffer, DWORD dwBufferLen, BYTE* pbSignature, DWORD dwSigLen); diff --git a/src/rufus.rc b/src/rufus.rc index ac354696..a8100027 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.6.2202" +CAPTION "Rufus 4.6.2203" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2202,0 - PRODUCTVERSION 4,6,2202,0 + FILEVERSION 4,6,2203,0 + PRODUCTVERSION 4,6,2203,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2202" + VALUE "FileVersion", "4.6.2203" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2202" + VALUE "ProductVersion", "4.6.2203" END END BLOCK "VarFileInfo" From 5439ca8a8325bec0bb2ac015d6ada9005d6d30ad Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 10 Oct 2024 13:04:58 +0100 Subject: [PATCH 013/192] [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. --- src/hash.c | 18 ++++++++---------- src/iso.c | 2 +- src/rufus.c | 2 ++ src/rufus.h | 1 + src/rufus.rc | 10 +++++----- src/vhd.c | 10 +++++++--- src/wue.c | 22 ++++++++++++++++++---- 7 files changed, 42 insertions(+), 23 deletions(-) diff --git a/src/hash.c b/src/hash.c index 1b0b2ce9..ee21cc51 100644 --- a/src/hash.c +++ b/src/hash.c @@ -2158,9 +2158,11 @@ static BOOL IsRevokedBySvn(uint8_t* buf, uint32_t len) if (rsrc_rva != 0) { if (rsrc_len == sizeof(uint32_t)) { svn_ver = (uint32_t*)RvaToPhysical(buf, rsrc_rva); - uuprintf(" SVN version: %d.%d", *svn_ver >> 16, *svn_ver & 0xffff); - if (svn_ver != NULL && *svn_ver < sbat_entries[i].version) - return TRUE; + if (svn_ver != NULL) { + uuprintf(" SVN version: %d.%d", *svn_ver >> 16, *svn_ver & 0xffff); + if (*svn_ver < sbat_entries[i].version) + return TRUE; + } } else { uprintf("WARNING: Unexpected Secure Version Number size"); } @@ -2264,12 +2266,12 @@ void UpdateMD5Sum(const char* dest_dir, const char* md5sum_name) char *md5_data = NULL, *new_data = NULL, *str_pos, *d, *s, *p; if (!img_report.has_md5sum && !validate_md5sum) - goto out; + return; static_sprintf(md5_path, "%s\\%s", dest_dir, md5sum_name); md5_size = read_file(md5_path, (uint8_t**)&md5_data); if (md5_size == 0) - goto out; + return; for (i = 0; i < modified_files.Index; i++) { for (j = 0; j < (uint32_t)strlen(modified_files.String[i]); j++) @@ -2301,7 +2303,7 @@ void UpdateMD5Sum(const char* dest_dir, const char* md5sum_name) new_data = malloc(md5_size + 1024); assert(new_data != NULL); if (new_data == NULL) - goto out; + return; // Will be nonzero if we created the file, otherwise zero if (md5sum_totalbytes != 0) { snprintf(new_data, md5_size + 1024, "# md5sum_totalbytes = 0x%llx\n", md5sum_totalbytes); @@ -2372,10 +2374,6 @@ void UpdateMD5Sum(const char* dest_dir, const char* md5sum_name) write_file(md5_path, md5_data, md5_size); free(md5_data); - -out: - // We no longer need the string array at this stage - StrArrayDestroy(&modified_files); } #if defined(_DEBUG) || defined(TEST) || defined(ALPHA) diff --git a/src/iso.c b/src/iso.c index eed8c5a3..ab043607 100644 --- a/src/iso.c +++ b/src/iso.c @@ -1134,7 +1134,7 @@ BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan) last_nb_blocks = 0; iso_blocking_status = 0; symlinked_syslinux[0] = 0; - StrArrayCreate(&modified_files, 8); + StrArrayClear(&modified_files); if (validate_md5sum) { md5sum_totalbytes = 0; // If there isn't an already existing md5sum.txt create one diff --git a/src/rufus.c b/src/rufus.c index 2f317ae5..0ed225bd 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -2103,6 +2103,7 @@ static void InitDialog(HWND hDlg) // Create the string arrays StrArrayCreate(&BlockingProcessList, 16); StrArrayCreate(&ImageList, 16); + StrArrayCreate(&modified_files, 8); // Set various checkboxes CheckDlgButton(hDlg, IDC_QUICK_FORMAT, BST_CHECKED); CheckDlgButton(hDlg, IDC_EXTENDED_LABEL, BST_CHECKED); @@ -2277,6 +2278,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA StopProcessSearch(); StrArrayDestroy(&BlockingProcessList); StrArrayDestroy(&ImageList); + StrArrayDestroy(&modified_files); DestroyAllTooltips(); DestroyWindow(hLogDialog); GetWindowRect(hDlg, &relaunch_rc); diff --git a/src/rufus.h b/src/rufus.h index 1d5a7adb..0f3d44bc 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -710,6 +710,7 @@ extern unsigned long syslinux_ldlinux_len[2]; extern char ubuffer[UBUFFER_SIZE], embedded_sl_version_str[2][12]; extern char szFolderPath[MAX_PATH], app_dir[MAX_PATH], temp_dir[MAX_PATH], system_dir[MAX_PATH]; extern char sysnative_dir[MAX_PATH], app_data_dir[MAX_PATH], *image_path, *fido_url; +extern StrArray modified_files; /* * Shared prototypes diff --git a/src/rufus.rc b/src/rufus.rc index a8100027..cffac279 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.6.2203" +CAPTION "Rufus 4.6.2204" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2203,0 - PRODUCTVERSION 4,6,2203,0 + FILEVERSION 4,6,2204,0 + PRODUCTVERSION 4,6,2204,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2203" + VALUE "FileVersion", "4.6.2204" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2203" + VALUE "ProductVersion", "4.6.2204" END END BLOCK "VarFileInfo" diff --git a/src/vhd.c b/src/vhd.c index 4446d89a..a184b2f6 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -729,7 +729,7 @@ BOOL WimExtractFile(const char* image, int index, const char* src, const char* d /// <returns>TRUE if the index was found in the image, FALSE otherwise.</returns> BOOL WimIsValidIndex(const char* image, int index) { - int i = 1; + int i = 1, cur_index; BOOL r = FALSE; DWORD dw = 0; HANDLE hWim = NULL; @@ -768,7 +768,9 @@ BOOL WimIsValidIndex(const char* image, int index) goto out; while ((str = get_token_data_file_indexed("IMAGE INDEX", xml_file, i)) != NULL) { - if (atoi(str) == index) { + cur_index = atoi(str); + safe_free(str); + if (cur_index == index) { r = TRUE; break; } @@ -1061,7 +1063,7 @@ static DWORD WINAPI VhdSaveImageThread(void* param) r = 0; UpdateProgressWithInfo(OP_FORMAT, MSG_261, SelectedDrive.DiskSize, SelectedDrive.DiskSize); - uprintf("Operation complete."); + uprintf("Saved '%s'", img_save->ImagePath); out: safe_closehandle(overlapped.hEvent); @@ -1100,6 +1102,8 @@ static DWORD WINAPI FfuSaveImageThread(void* param) safe_free(img_save->DevicePath); safe_free(img_save->ImagePath); PostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)TRUE, 0); + if (!IS_ERROR(ErrorStatus)) + uprintf("Saved '%s'", img_save->ImagePath); ExitThread(r); } diff --git a/src/wue.c b/src/wue.c index d7b14cf4..8281a6f4 100644 --- a/src/wue.c +++ b/src/wue.c @@ -806,12 +806,14 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) char appraiserres_dll_dst[] = "?:\\sources\\appraiserres.bak"; char setup_exe[] = "?:\\setup.exe"; char setup_dll[] = "?:\\setup.dll"; + char md5sum_path[] = "?:\\md5sum.txt"; char *mount_path = NULL, path[MAX_PATH]; uint8_t* buf = NULL; uint16_t setup_arch; HKEY hKey = NULL, hSubKey = NULL; LSTATUS status; DWORD dwDisp, dwVal = 1, dwSize; + FILE* fd_md5sum; assert(unattend_xml_path != NULL); uprintf("Applying Windows customization:"); @@ -854,6 +856,7 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) if (img_report.win_version.build >= 26000) { setup_exe[0] = drive_letter; setup_dll[0] = drive_letter; + md5sum_path[0] = drive_letter; dwSize = read_file(setup_exe, &buf); if (dwSize != 0) { setup_arch = GetPeArch(buf); @@ -864,13 +867,24 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) uprintf("Could not rename '%s': %s", setup_exe, WindowsErrorString()); } else { uprintf("Renamed '%s' → '%s'", setup_exe, setup_dll); - uprintf("Created '%s' bypass wrapper (from embedded)", setup_exe); buf = GetResource(hMainInstance, MAKEINTRESOURCEA(setup_arch == IMAGE_FILE_MACHINE_AMD64 ? IDR_SETUP_X64 : IDR_SETUP_ARM64), _RT_RCDATA, "setup.exe", &dwSize, FALSE); - if (buf == NULL) + if (buf == NULL) { uprintf("Could not access embedded 'setup.exe'"); - else - write_file(setup_exe, buf, dwSize); + } else if (write_file(setup_exe, buf, dwSize) == dwSize) { + uprintf("Created '%s' bypass wrapper (from embedded)", setup_exe); + if (validate_md5sum) { + if ((fd_md5sum = fopenU(md5sum_path, "ab")) != NULL) { + fprintf(fd_md5sum, "00000000000000000000000000000000 ./setup.dll\n"); + fclose(fd_md5sum); + } + StrArrayAdd(&modified_files, setup_exe, TRUE); + StrArrayAdd(&modified_files, setup_dll, TRUE); + md5sum_totalbytes += dwSize; + } + } else { + uprintf("Could not create '%s' bypass wrapper", setup_exe); + } } } } From 4d42b7a73a036a01bf3676852f9eb10fd9f1a16c Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 10 Oct 2024 13:08:33 +0100 Subject: [PATCH 014/192] [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. --- ChangeLog.txt | 8 +++++ src/db.h | 19 ++++++++++-- src/hash.c | 56 +++++++++++++++++++++++---------- src/iso.c | 16 ++++++---- src/rufus.c | 86 +++++++++++++++++++++++++++++++-------------------- src/rufus.h | 15 ++++++++- src/rufus.rc | 10 +++--- 7 files changed, 145 insertions(+), 65 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 3200c139..66f61081 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,11 @@ +o Version 4.6 (2024.10.??) + Add a new setup.exe wrapper to bypass Windows 11 24H2 in-place upgrade restrictions + Add TimeZone to regional options replication + Set local account passwords to not expire by default + Fix an error when trying to write compressed VHD images + Fix an error when invoking Rufus from the PowerShell commandline + Improve revoked UEFI bootloaders check to support Linux SBAT, Windows SVN and cert DBX + o Version 4.5 (2024.05.22) Add new advanced option to perform runtime UEFI media validation of suitable images (Windows, most Linux) Move the 'Use Rufus MBR' advanced option to a cheat mode (Alt-A) diff --git a/src/db.h b/src/db.h index 52c02659..1b4f4e85 100644 --- a/src/db.h +++ b/src/db.h @@ -658,11 +658,26 @@ static uint8_t pe256dbx[] = { }; /* - * Contains the SHA-1 thumbprint of certificates that are being revoked by DBX. + * Contains the SHA-1 thumbprints of the issuer certificate of the official + * Secure Boot signing authority (i.e. Microsoft). + */ +static uint8_t certauth[] = { + // 'Microsoft Windows Production PCA 2011' + 0x58, 0x0a, 0x6f, 0x4c, 0xc4, 0xe4, 0xb6, 0x69, 0xb9, 0xeb, 0xdc, 0x1b, 0x2b, 0x3e, 0x08, 0x7b, 0x80, 0xd0, 0x67, 0x8d, + // 'Microsoft Corporation UEFI CA 2011' + 0x46, 0xde, 0xf6, 0x3b, 0x5c, 0xe6, 0x1c, 0xf8, 0xba, 0x0d, 0xe2, 0xe6, 0x63, 0x9c, 0x10, 0x19, 0xd0, 0xed, 0x14, 0xf3, + // 'Windows UEFI CA 2023' + 0x45, 0xa0, 0xfa, 0x32, 0x60, 0x47, 0x73, 0xc8, 0x24, 0x33, 0xc3, 0xb7, 0xd5, 0x9e, 0x74, 0x66, 0xb3, 0xac, 0x0c, 0x67, + // 'Microsoft UEFI CA 2023' + 0xb5, 0xee, 0xb4, 0xa6, 0x70, 0x60, 0x48, 0x07, 0x3f, 0x0e, 0xd2, 0x96, 0xe7, 0xf5, 0x80, 0xa7, 0x90, 0xb5, 0x9e, 0xaa, +}; + +/* + * Contains the SHA-1 thumbprints of certificates that are being revoked by DBX. * This only includes the 'Microsoft Windows Production PCA 2011' for now. */ static uint8_t certdbx[] = { - 0x58, 0x0a, 0x6f, 0x4c, 0xc4, 0xe4, 0xb6, 0x69, 0xb9, 0xeb, 0xdc, 0x1b, 0x2b, 0x3e, 0x08, 0x7b, 0x80, 0xd0, 0x67, 0x8d + 0x58, 0x0a, 0x6f, 0x4c, 0xc4, 0xe4, 0xb6, 0x69, 0xb9, 0xeb, 0xdc, 0x1b, 0x2b, 0x3e, 0x08, 0x7b, 0x80, 0xd0, 0x67, 0x8d, }; /* diff --git a/src/hash.c b/src/hash.c index ee21cc51..88ffca31 100644 --- a/src/hash.c +++ b/src/hash.c @@ -2171,27 +2171,38 @@ static BOOL IsRevokedBySvn(uint8_t* buf, uint32_t len) return FALSE; } -static BOOL IsRevokedByCert(uint8_t* buf, uint32_t len) +static BOOL IsRevokedByCert(cert_info_t* info) +{ + int i; + + for (i = 0; i < ARRAYSIZE(certdbx); i += SHA1_HASHSIZE) { + if (!expert_mode) + continue; + if (memcmp(info->thumbprint, &certdbx[i], SHA1_HASHSIZE) == 0) { + uprintf("Found '%s' revoked certificate", info->name); + return TRUE; + } + } + return FALSE; +} + +BOOL IsSignedBySecureBootAuthority(uint8_t* buf, uint32_t len) { int i; uint8_t* cert; cert_info_t info; - cert = GetPeSignatureData(buf); - i = GetIssuerCertificateInfo(cert, &info); - if (i == 0) - uuprintf(" (Unsigned Bootloader)"); - if (i <= 0) + if (buf == NULL || len < 0x100) return FALSE; - uuprintf(" Signed by: %s", info.name); - for (i = 0; i < ARRAYSIZE(certdbx); i += SHA1_HASHSIZE) { - if (!expert_mode) - continue; - if (memcmp(info.thumbprint, &certdbx[i], SHA1_HASHSIZE) == 0) { - uprintf("Found '%s' revoked certificate", info.name); + // Get the signer/issuer info + cert = GetPeSignatureData(buf); + // Secure Boot Authority is always an issuer + if (GetIssuerCertificateInfo(cert, &info) != 2) + return FALSE; + for (i = 0; i < ARRAYSIZE(certauth); i += SHA1_HASHSIZE) { + if (memcmp(info.thumbprint, &certauth[i], SHA1_HASHSIZE) == 0) return TRUE; - } } return FALSE; } @@ -2202,6 +2213,9 @@ int IsBootloaderRevoked(uint8_t* buf, uint32_t len) uint8_t hash[SHA256_HASHSIZE]; IMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf; IMAGE_NT_HEADERS32* pe_header; + uint8_t* cert; + cert_info_t info; + int r; // Fall back to embedded sbat_level.txt if we couldn't access remote if (sbat_entries == NULL) { @@ -2214,12 +2228,17 @@ int IsBootloaderRevoked(uint8_t* buf, uint32_t len) pe_header = (IMAGE_NT_HEADERS32*)&buf[dos_header->e_lfanew]; if (pe_header->Signature != IMAGE_NT_SIGNATURE) return -2; + + // Get the signer/issuer info + cert = GetPeSignatureData(buf); + r = GetIssuerCertificateInfo(cert, &info); + if (r == 0) + uuprintf(" (Unsigned Bootloader)"); + else if (r > 0) + uuprintf(" Signed by: %s", info.name); + if (!PE256Buffer(buf, len, hash)) return -1; - // Check for UEFI DBX certificate revocation - // This also displays the name of the signer/issuer cert if available - if (IsRevokedByCert(buf, len)) - return 5; // Check for UEFI DBX revocation for (i = 0; i < ARRAYSIZE(pe256dbx); i += SHA256_HASHSIZE) if (memcmp(hash, &pe256dbx[i], SHA256_HASHSIZE) == 0) @@ -2234,6 +2253,9 @@ int IsBootloaderRevoked(uint8_t* buf, uint32_t len) // Check for Microsoft SVN revocation if (IsRevokedBySvn(buf, len)) return 4; + // Check for UEFI DBX certificate revocation + if (IsRevokedByCert(&info)) + return 5; return 0; } diff --git a/src/iso.c b/src/iso.c index ab043607..45efbbde 100644 --- a/src/iso.c +++ b/src/iso.c @@ -249,9 +249,10 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const // We may extract the bootloaders for revocation validation later but // to do so, since we're working with case sensitive file systems, we // must store all found UEFI bootloader paths with the right case. - for (j = 0; j < ARRAYSIZE(img_report.efi_boot_path); j++) { - if (img_report.efi_boot_path[j][0] == 0) { - static_strcpy(img_report.efi_boot_path[j], psz_fullpath); + for (j = 0; j < ARRAYSIZE(img_report.efi_boot_entry); j++) { + if (img_report.efi_boot_entry[j].path[0] == 0) { + img_report.efi_boot_entry[j].type = EBT_BOOTMGR; + static_strcpy(img_report.efi_boot_entry[j].path, psz_fullpath); break; } } @@ -291,9 +292,10 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const if (safe_stricmp(psz_basename, bootloader_name) == 0) { if (k == 0) img_report.has_efi |= (2 << i); // start at 2 since "bootmgr.efi" is bit 0 - for (j = 0; j < ARRAYSIZE(img_report.efi_boot_path); j++) { - if (img_report.efi_boot_path[j][0] == 0) { - static_strcpy(img_report.efi_boot_path[j], psz_fullpath); + for (j = 0; j < ARRAYSIZE(img_report.efi_boot_entry); j++) { + if (img_report.efi_boot_entry[j].path[0] == 0) { + img_report.efi_boot_entry[j].type = (uint8_t)k; + static_strcpy(img_report.efi_boot_entry[j].path, psz_fullpath); break; } } @@ -1559,6 +1561,7 @@ uint32_t ReadISOFileToBuffer(const char* iso, const char* iso_file, uint8_t** bu iso9660_stat_t* p_statbuf = NULL; *buf = NULL; + cdio_loglevel_default = CDIO_LOG_WARN; // First try to open as UDF - fallback to ISO if it failed p_udf = udf_open(iso); @@ -1632,6 +1635,7 @@ out: udf_dirent_free(p_udf_file); iso9660_close(p_iso); udf_close(p_udf); + cdio_loglevel_default = usb_debug ? CDIO_LOG_INFO : CDIO_LOG_WARN; if (ret == 0) safe_free(*buf); return ret; diff --git a/src/rufus.c b/src/rufus.c index 0ed225bd..b343c0c9 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1609,43 +1609,61 @@ static DWORD WINAPI BootCheckThread(LPVOID param) // Check UEFI bootloaders for revocation if (IS_EFI_BOOTABLE(img_report)) { - assert(ARRAYSIZE(img_report.efi_boot_path) > 0); + BOOL has_secureboot_signed_bootloader = FALSE; + assert(ARRAYSIZE(img_report.efi_boot_entry) > 0); PrintStatus(0, MSG_351); uuprintf("UEFI Secure Boot revocation checks:"); - rr = 0; - for (i = 0; i < ARRAYSIZE(img_report.efi_boot_path) && img_report.efi_boot_path[i][0] != 0; i++) { - static const char* revocation_type[] = { "UEFI DBX", "Windows SSP", "Linux SBAT", "Windows SVN", "Cert DBX" }; - cdio_loglevel_default = CDIO_LOG_WARN; - len = ReadISOFileToBuffer(image_path, img_report.efi_boot_path[i], &buf); - cdio_loglevel_default = usb_debug ? CDIO_LOG_DEBUG : CDIO_LOG_WARN; - if (len == 0) { - uprintf("Warning: Failed to extract '%s' to check for UEFI revocation", img_report.efi_boot_path[i]); - continue; - } - uuprintf("• %s", img_report.efi_boot_path[i]); - r = IsBootloaderRevoked(buf, len); - safe_free(buf); - if (r > 0) { - assert(r <= ARRAYSIZE(revocation_type)); - if (rr == 0) - rr = r; - uprintf("Warning: '%s' has been revoked by %s", img_report.efi_boot_path[i], revocation_type[r - 1]); - is_bootloader_revoked = TRUE; + // Make sure we have at least one regular EFI bootloader that is formally signed + // for Secure Boot, since it doesn't make sense to report revocation otherwise. + for (i = 0; !has_secureboot_signed_bootloader && i < ARRAYSIZE(img_report.efi_boot_entry) && + img_report.efi_boot_entry[i].path[0] != 0; i++) { + if (img_report.efi_boot_entry[i].type == EBT_MAIN) { + len = ReadISOFileToBuffer(image_path, img_report.efi_boot_entry[i].path, &buf); + if (len == 0) { + uprintf("Warning: Failed to extract '%s' to check for UEFI revocation", img_report.efi_boot_entry[i].path); + continue; + } + if (IsSignedBySecureBootAuthority(buf, len)) + has_secureboot_signed_bootloader = TRUE; + free(buf); } } - if (rr > 0) { - switch (rr) { - case 2: - msg = lmprintf(MSG_341, "Error code: 0xc0000428"); - break; - default: - msg = lmprintf(MSG_340); - break; + if (!has_secureboot_signed_bootloader) { + uuprintf(" No Secure Boot signed bootloader found -- skipping"); + } else { + rr = 0; + for (i = 0; i < ARRAYSIZE(img_report.efi_boot_entry) && img_report.efi_boot_entry[i].path[0] != 0; i++) { + static const char* revocation_type[] = { "UEFI DBX", "Windows SSP", "Linux SBAT", "Windows SVN", "Cert DBX" }; + len = ReadISOFileToBuffer(image_path, img_report.efi_boot_entry[i].path, &buf); + if (len == 0) { + uprintf("Warning: Failed to extract '%s' to check for UEFI revocation", img_report.efi_boot_entry[i].path); + continue; + } + uuprintf("• %s", img_report.efi_boot_entry[i].path); + r = IsBootloaderRevoked(buf, len); + safe_free(buf); + if (r > 0) { + assert(r <= ARRAYSIZE(revocation_type)); + if (rr == 0) + rr = r; + uprintf("Warning: '%s' has been revoked by %s", img_report.efi_boot_entry[i].path, revocation_type[r - 1]); + is_bootloader_revoked = TRUE; + } + } + if (rr > 0) { + switch (rr) { + case 2: + msg = lmprintf(MSG_341, "Error code: 0xc0000428"); + break; + default: + msg = lmprintf(MSG_340); + break; + } + r = MessageBoxExU(hMainDialog, lmprintf(MSG_339, msg), lmprintf(MSG_338), + MB_OKCANCEL | MB_ICONWARNING | MB_IS_RTL, selected_langid); + if (r == IDCANCEL) + goto out; } - r = MessageBoxExU(hMainDialog, lmprintf(MSG_339, msg), lmprintf(MSG_338), - MB_OKCANCEL | MB_ICONWARNING | MB_IS_RTL, selected_langid); - if (r == IDCANCEL) - goto out; } } @@ -3516,7 +3534,7 @@ skip_args_processing: is_vds_available = IsVdsAvailable(FALSE); use_vds = ReadSettingBool(SETTING_USE_VDS) && is_vds_available; usb_debug = ReadSettingBool(SETTING_ENABLE_USB_DEBUG); - cdio_loglevel_default = usb_debug ? CDIO_LOG_DEBUG : CDIO_LOG_WARN; + cdio_loglevel_default = usb_debug ? CDIO_LOG_INFO : CDIO_LOG_WARN; use_rufus_mbr = !ReadSettingBool(SETTING_DISABLE_RUFUS_MBR); // validate_md5sum = ReadSettingBool(SETTING_ENABLE_RUNTIME_VALIDATION); detect_fakes = !ReadSettingBool(SETTING_DISABLE_FAKE_DRIVES_CHECK); @@ -3807,7 +3825,7 @@ extern int TestHashes(void); // Alt-. => Enable USB enumeration debug if ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == VK_OEM_PERIOD)) { usb_debug = !usb_debug; - cdio_loglevel_default = usb_debug ? CDIO_LOG_DEBUG : CDIO_LOG_WARN; + cdio_loglevel_default = usb_debug ? CDIO_LOG_INFO : CDIO_LOG_WARN; WriteSettingBool(SETTING_ENABLE_USB_DEBUG, usb_debug); PrintStatusTimeout(lmprintf(MSG_270), usb_debug); GetDevices(0); diff --git a/src/rufus.h b/src/rufus.h index 0f3d44bc..540a1bd7 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -327,6 +327,13 @@ enum file_io_type { FILE_IO_APPEND }; +enum EFI_BOOT_TYPE { + EBT_MAIN = 0, + EBT_GRUB, + EBT_MOKMANAGER, + EBT_BOOTMGR +}; + /* Special handling for old .c32 files we need to replace */ #define NB_OLD_C32 2 #define OLD_C32_NAMES { "menu.c32", "vesamenu.c32" } @@ -383,13 +390,18 @@ enum ArchType { ARCH_MAX }; +typedef struct { + uint8_t type; + char path[64]; +} efi_boot_entry_t; + typedef struct { char label[192]; // 3*64 to account for UTF-8 char usb_label[192]; // converted USB label for workaround char cfg_path[128]; // path to the ISO's isolinux.cfg char reactos_path[128]; // path to the ISO's freeldr.sys or setupldr.sys char wininst_path[MAX_WININST][64]; // path to the Windows install image(s) - char efi_boot_path[64][32]; // paths of detected UEFI bootloaders + efi_boot_entry_t efi_boot_entry[64];// types and paths of detected UEFI bootloaders char efi_img_path[128]; // path to an efi.img file uint64_t image_size; uint64_t projected_size; @@ -823,6 +835,7 @@ extern BOOL PE256Buffer(uint8_t* buf, uint32_t len, uint8_t* hash); extern void UpdateMD5Sum(const char* dest_dir, const char* md5sum_name); extern BOOL HashBuffer(const unsigned type, const uint8_t* buf, const size_t len, uint8_t* sum); extern BOOL IsFileInDB(const char* path); +extern BOOL IsSignedBySecureBootAuthority(uint8_t* buf, uint32_t len); extern int IsBootloaderRevoked(uint8_t* buf, uint32_t len); extern void PrintRevokedBootloaderInfo(void); extern BOOL IsBufferInDB(const unsigned char* buf, const size_t len); diff --git a/src/rufus.rc b/src/rufus.rc index cffac279..2e094160 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.6.2204" +CAPTION "Rufus 4.6.2205" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2204,0 - PRODUCTVERSION 4,6,2204,0 + FILEVERSION 4,6,2205,0 + PRODUCTVERSION 4,6,2205,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2204" + VALUE "FileVersion", "4.6.2205" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2204" + VALUE "ProductVersion", "4.6.2205" END END BLOCK "VarFileInfo" From eb282642ff8981d663f9e5807d7d6a94fe3d708e Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 14 Oct 2024 17:39:17 +0100 Subject: [PATCH 015/192] [misc] fix conversion of windows error codes * Commit f453dc272b93adb0d63dd045197f4661fc653211 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. --- src/rufus.rc | 10 +++++----- src/stdio.c | 20 +++++++++++++------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/rufus.rc b/src/rufus.rc index 2e094160..7d3c20ae 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.6.2205" +CAPTION "Rufus 4.6.2206" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2205,0 - PRODUCTVERSION 4,6,2205,0 + FILEVERSION 4,6,2206,0 + PRODUCTVERSION 4,6,2206,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2205" + VALUE "FileVersion", "4.6.2206" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2205" + VALUE "ProductVersion", "4.6.2206" END END BLOCK "VarFileInfo" diff --git a/src/stdio.c b/src/stdio.c index a6c257b4..db6d9086 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -233,16 +233,18 @@ const char *WindowsErrorString(void) static char err_string[256] = { 0 }; DWORD size, presize; - DWORD error_code, format_error; + DWORD error_code, _error_code, format_error; HANDLE hModule = NULL; error_code = GetLastError(); + _error_code = error_code; +retry: // Check for specific facility error codes - switch (HRESULT_FACILITY(error_code)) { + switch (HRESULT_FACILITY(_error_code)) { case FACILITY_NULL: // Special case for internet related errors, that don't actually have a facility // set but still require a hModule into wininet to display the messages. - if ((error_code >= INTERNET_ERROR_BASE) && (error_code <= INTERNET_ERROR_LAST)) + if ((_error_code >= INTERNET_ERROR_BASE) && (_error_code <= INTERNET_ERROR_LAST)) hModule = GetModuleHandleA("wininet.dll"); break; case FACILITY_ITF: @@ -260,22 +262,26 @@ const char *WindowsErrorString(void) // coverity[var_deref_model] size = FormatMessageU(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | ((hModule != NULL) ? FORMAT_MESSAGE_FROM_HMODULE : 0), hModule, - error_code, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), + _error_code, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), &err_string[presize], (DWORD)(sizeof(err_string) - strlen(err_string)), NULL); if (size == 0) { format_error = GetLastError(); switch (format_error) { case ERROR_SUCCESS: - static_sprintf(err_string, "[0x%08lX] (No Windows Error String)", error_code); + static_sprintf(err_string, "[0x%08lX] (No Windows Error String)", _error_code); break; case ERROR_MR_MID_NOT_FOUND: case ERROR_MUI_FILE_NOT_FOUND: case ERROR_MUI_FILE_NOT_LOADED: + // We might be trying with the wrong facility. Remove it and try again. + if (HRESULT_FACILITY(_error_code) != FACILITY_NULL) { + _error_code = HRESULT_CODE(_error_code); + goto retry; + } static_sprintf(err_string, "[0x%08lX] (NB: This system was unable to provide an English error message)", error_code); break; default: - static_sprintf(err_string, "[0x%08lX] (FormatMessage error code 0x%08lX)", - error_code, format_error); + static_sprintf(err_string, "[0x%08lX] (FormatMessage error code 0x%08lX)", error_code, format_error); break; } } else { From accc7c000bf833fb2606002a80cced5774f0907c Mon Sep 17 00:00:00 2001 From: Justin Miller <justin.miller@reactos.org> Date: Thu, 17 Oct 2024 14:47:52 -0700 Subject: [PATCH 016/192] [iso] check for freeldr.sys as well for ReactOS * Closes #2589. Signed-off-by: Justin Miller <justin.miller@reactos.org> --- src/iso.c | 11 +++++++---- src/rufus.rc | 10 +++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/iso.c b/src/iso.c index 45efbbde..66413656 100644 --- a/src/iso.c +++ b/src/iso.c @@ -112,7 +112,7 @@ static const char* syslinux_cfg[] = { "isolinux.cfg", "syslinux.cfg", "extlinux. static const char* isolinux_bin[] = { "isolinux.bin", "boot.bin" }; static const char* pe_dirname[] = { "/i386", "/amd64", "/minint" }; static const char* pe_file[] = { "ntdetect.com", "setupldr.bin", "txtsetup.sif" }; -static const char* reactos_name = "setupldr.sys"; // TODO: freeldr.sys doesn't seem to work +static const char* reactos_name[] = { "setupldr.sys", "freeldr.sys" }; static const char* kolibri_name = "kolibri.img"; static const char* autorun_name = "autorun.inf"; static const char* manjaro_marker = ".miso"; @@ -274,9 +274,12 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const } } - // Check for ReactOS' setupldr.sys anywhere - if ((img_report.reactos_path[0] == 0) && (safe_stricmp(psz_basename, reactos_name) == 0)) - static_strcpy(img_report.reactos_path, psz_fullpath); + // Check for ReactOS presence anywhere + if (img_report.reactos_path[0] == 0) { + for (i = 0; i < ARRAYSIZE(reactos_name); i++) + if (safe_stricmp(psz_basename, reactos_name[i]) == 0) + static_strcpy(img_report.reactos_path, psz_fullpath); + } // Check for the first 'efi*.img' we can find (that hopefully contains EFI boot files) if (!HAS_EFI_IMG(img_report) && (safe_strlen(psz_basename) >= 7) && diff --git a/src/rufus.rc b/src/rufus.rc index 7d3c20ae..bf9da232 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.6.2206" +CAPTION "Rufus 4.6.2207" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2206,0 - PRODUCTVERSION 4,6,2206,0 + FILEVERSION 4,6,2207,0 + PRODUCTVERSION 4,6,2207,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2206" + VALUE "FileVersion", "4.6.2207" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2206" + VALUE "ProductVersion", "4.6.2207" END END BLOCK "VarFileInfo" From 7488e4464d9c46904fd0fff1d1128ad0fc50f2b3 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 21 Oct 2024 15:38:40 +0100 Subject: [PATCH 017/192] Rufus 4.6 (Build 2208) --- ChangeLog.txt | 3 ++- res/appstore/listing/listing.csv | 43 ++++++++++++++++---------------- res/loc/ChangeLog.txt | 4 +++ src/rufus.rc | 10 ++++---- 4 files changed, 32 insertions(+), 28 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 66f61081..b19101d0 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,10 +1,11 @@ -o Version 4.6 (2024.10.??) +o Version 4.6 (2024.10.21) Add a new setup.exe wrapper to bypass Windows 11 24H2 in-place upgrade restrictions Add TimeZone to regional options replication Set local account passwords to not expire by default Fix an error when trying to write compressed VHD images Fix an error when invoking Rufus from the PowerShell commandline Improve revoked UEFI bootloaders check to support Linux SBAT, Windows SVN and cert DBX + Improve support for ReactOS boot media o Version 4.5 (2024.05.22) Add new advanced option to perform runtime UEFI media validation of suitable images (Windows, most Linux) diff --git a/res/appstore/listing/listing.csv b/res/appstore/listing/listing.csv index 6df2d8c7..4a5bf2da 100644 --- a/res/appstore/listing/listing.csv +++ b/res/appstore/listing/listing.csv @@ -1,4 +1,4 @@ -"Field","ID","Type (Type)","default","en-us","ar-sa","bg-bg","zh-cn","zh-tw","hr-hr","cs-cz","da-dk","nl-nl","fi-fi","fr-fr","de-de","el-gr","he-il","hu-hu","id-id","it-it","ja-jp","ko-kr","lv-lv","lt-lt","ms-my","nb-no","fa-ir","pl-pl","pt-br","pt-pt","ro-ro","ru-ru","sr-latn-rs","sk-sk","sl-si","es-es","sv-se","th-th","tr-tr","uk-ua","vi-vn" +"Field","ID","Type (Type)","default","en-us","ar-sa","bg-bg","zh-cn","zh-tw","hr-hr","cs-cz","da-dk","nl-nl","fi-fi","fr-fr","de-de","el-gr","he-il","hu-hu","id-id","it-it","ja-jp","ko-kr","lv-lv","lt-lt","ms-my","nb-no","fa-ir","pl-pl","pt-br","pt-pt","ro-ro","ru-ru","sr-latn-rs","sk-sk","sl-si","es-es","sv-se","th-th","tr-tr","uk-ua","vi-vn" "Description","2","Text","","Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc. • Official site: https://rufus.ie • Source Code: https://github.com/pbatard/rufus @@ -11,9 +11,9 @@ • Лог на промените: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus 是一个帮助您格式化并创建可启动 USB 驱动器(如 U 盘和存储卡)的工具。 • 官方网站: https://rufus.ie • 源代码: https://github.com/pbatard/rufus -• 更新日志: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus 是個能格式化並製作可開機 USB 快閃磁碟機(USB 隨身碟、Memory Stick 等等)的工具。 +• 更新日志: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus 是個能格式化並製作可開機 USB 快閃磁碟 (如 USB 隨身碟等) 的工具。 • 官方網站: https://rufus.ie -• 源始碼: https://github.com/pbatard/rufus +• 原始碼: https://github.com/pbatard/rufus • 更新日誌: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus je aplikacija koja olakšava formatiranje i stvaranje USB pokretačkih jedinica. • Službena stranica: https://rufus.ie • Šifra izvora: https://github.com/pbatard/rufus @@ -71,7 +71,7 @@ • Endringslogg: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus ابزاری است که به فرمت و ایجاد درایوهای فلش USB قابل بوت، مانند کلیدهای USB/pendrives، مموری استیک ها و غیره به شما کمک می کند. • سایت رسمی: https://rufus.ie • منبع کد: https://github.com/pbatard/rufus -• لیست تغییرات https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus to narzędzie, które pomaga formatować i tworzyć bootowalne dyski flash USB, takie jak klucze USB / pendrive, pendrive'y itp. +• لیست تغییرات https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus to narzędzie, które pomaga formatować i tworzyć dyski rozruchowe flash USB, takie jak klucze USB, pendrive-y itp. • Oficjalna strona: https://rufus.ie • Kod źródłowy: https://github.com/pbatard/rufus • Zmiany: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus é um utilitário que ajuda a formatar e a criar unidades flash USB inicializáveis, tais como pendrives USB, cartões de memória, etc. @@ -114,16 +114,14 @@ • 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","• Add new advanced option to perform runtime UEFI media validation of suitable images (Windows, most Linux) -• Move the 'Use Rufus MBR' advanced option to a cheat mode (Alt-A) -• Fix truncation of VHDX images, as well as a benign error message when writing VHD/VHDX -• Fix support for Linux persistence in some configurations (Mint, Ubuntu 24.04) -• Fix multiple potential vulnerabilities (with thanks to Mansour Gashasbi) -• Update internal GRUB to version 2.12 -• Update UEFI:NTFS to latest (now always uses the ntfs-3g driver, rather than the buggy AMI NTFS one) -• Increase buffer size when copying ISO files, in an attempt to minimize the AMI NTFS UEFI driver bug -• Improve partition creation handling -• Don't display the WUE dialog when a conflicting 'unattend.xml' already exists",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"ReleaseNotes","3","Text","• Add a new setup.exe wrapper to bypass Windows 11 24H2 in-place upgrade restrictions +• Add TimeZone to regional options replication +• Set local account passwords to not expire by default +• Fix an error when trying to write compressed VHD images +• Fix an error when invoking Rufus from the PowerShell commandline +• Improve revoked UEFI bootloaders check to support Linux SBAT, Windows SVN and cert DBX +• Improve support for ReactOS boot media + ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "Title","4","Text","Rufus",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "ShortTitle","5","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "SortTitle","6","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, @@ -265,16 +263,17 @@ Xem tại https://www.gnu.org/licenses/gpl-3.0.html để biết thêm chi tiế "OptionalPromo1000x800","612","Relative path (or URL to file in Partner Center)","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "OptionalPromo414x180","613","Relative path (or URL to file in Partner Center)","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "Feature1","700","Text","","Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","تهيئة USB وبطاقة الفلاش ومحركات الأقراص الافتراضية إلى FAT / FAT32 / NTFS / UDF / exFAT / ReFS / ext2 / ext3","Форматиране на USB, карти памет и виртуални устройства с FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","将 U 盘、存储卡或虚拟驱动器格式化为 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 格式","將隨身碟、記憶卡或虛擬光碟機格式化為 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 格式","Formatirajte USB, flash karticu i virtualne pogone na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formátování USB, flash karet a virtuálních jednotek na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formater USB, flash kort og virtuelle drev til FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","USB, flashkaart en virtuele schijven formatteren naar FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Alusta USB-asemia, muistikortteja ja virtuaalisia asemia muotoon FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatez des périphériques USB, des cartes flash et des disques virtuels en FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatieren von USB, Flash-Karte und virtuellen Laufwerken in FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Μορφοποίηση USB, κάρτας flash και εικονικών μονάδων δίσκου σε FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","אתחול USB, כרטיסי זיכרון וכוננים וירטואליים ל־FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","USB, flash memóriakártyák és virtuális meghajtók formázása FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 fájlrendszerre","Format USB, kartu flash dan penyimpanan maya ke FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatta USB, flash card e unità virtuali in FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","USBメモリやSDカード、仮想ドライブをFAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3でフォーマットします。","USB, 플래시 카드 및 가상 드라이브를 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3로 포맷","Formatē USB, atmiņas kartes un virtuālos diskus formātos FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Suformatuokite USB, flash kortelę ir virtualius diskus į FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatkan USB, kad flash dan pemacu maya kepada FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formater USB, minnekort og virtuelle disker til FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","فرمت USB، فلش کارت و درایوهای مجازی به FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Sformatuj nośnik używając: FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatar dispositivos USB, cartões flash e discos virtuais com FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatar dispositivos USB, cartão de memória e drives virtuais em FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatează USB, card flash si drive-uri virtuale la FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Форматирование USB, флешек и виртуальных дисков в FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatiraj USB, flash kartice, i virtualne diskove u FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Naformátujte USB, kartu a virtuálne disky do FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatiranje USB, bliskavice in virtualnih pogonov na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatee USB, tarjetas flash y unidades virtuales a FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatera USB-enheter, flash-kort och virtuella enheter till FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","ฟอร์แมต USB, แฟลชการ์ด หรือไดรฟ์เสมือน ให้อยู่ในรูปแบบของ FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","USB, flash kart ve sanal sürücüleri FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 olarak biçimlendirin","Форматування USB-накопичувачів, флешок, карток пам'яті у FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Định dạng USB, thẻ nhớ hoặc ổ nhớ ảo với FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" -"Feature2","701","Text","","Create FreeDOS bootable USB drives","إنشاء محركات أقراص USB قابلة للإقلاع من FreeDOS","Създаване на FreeDOS стартиращ USB устройства","创建 FreeDOS 可启动驱动器","建立 FreeDOS 可啟隨身碟","Stvaranje FreeDOS USB pogona za pokretanje","Vytvoření bootovacích disků USB se systémem FreeDOS","Lav FreeDOS opstartsbare USB drev","FreeDOS opstartbare USB-schijven aanmaken","Luo boottaavia FreeDOS USB-asemia","Créez des disques amorçable FreeDOS","FreeDOS-bootfähige USB-Laufwerke erstellen","Δημιουργήστε μονάδες USB με δυνατότητα εκκίνησης FreeDOS","יצירת כונני USB הניתנים לאתחול של FreeDOS","Bootolható FreeDOS USB meghajtó készítése","Buat perangkat USB FreeDOS yang dapat di boot","Crea unità USB avviabili FreeDOS","FreeDOSの起動可能ドライブを作成します。","FreeDOS 부팅 가능한 USB 드라이브 만들기","Izveido FreeDOS ielādes USB ierīces","Sukurkite FreeDOS įkrovos USB diskus","Buat pemacu USB boleh boot FreeDOS","Lag FreeDos oppstartbar USB stick","درایوهای USB قابل بوت FreeDOS را ایجاد کنید","Stwórz bootowalny nośnik USB FreeDOS","Criar discos USB inicializáveis FreeDOS","Criar unidades USB inicializáveis FreeDOS","Crează drive USB bootabil FreeDOS","Создание загрузочных USB-дисков FreeDOS","Kreiraj FreeDOS butabilni USB disk","Vytvorte bootovacie usb zariadenia FreeDOS","Ustvarite FreeDOS zagonske USB pogone","Crear unidades USB de arranque FreeDOS","Skapa FreeDOS startbara USB-enheter","สร้าง USB ไดรฟ์บูตสำหรับระบบ FreeDOS","FreeDOS önyüklenebilir USB sürücüleri oluşturun","Створення завантажувальних пристроїв FreeDOS","Tạo USB có thể khởi động với FreeDOS" -"Feature3","702","Text","","Create bootable drives from bootable ISOs (Windows, Linux, etc.)","إنشاء محركات أقراص قابلة للإقلاع من ملفات ISO القابلة للإقلاع (Windows و Linux وما إلى ذلك)","Създаване на стартиращи устройства от ISO образи (Windows, Linux и др.)","从可启动 ISO 文件 (Windows 和 Linux 等) 创建可启动驱动器","從可啟動 ISO 檔案 (Windows 和 Linux 等) 建立可啟動隨身碟","Stvaranje pogona za pokretanje iz ISO-ova za pokretanje (Windows, Linux itd.)","Vytváření bootovacích jednotek ze zaváděcích ISO (Windows, Linux atd.)","Lav opstartsbarer drev fra opstartsbarer ISOer (Window, Linux, osv.)","Opstartbare schijven aanmaken via opstartbare ISO's (Windows, Linux, enz)","Luo käynnistysasemia boottaavista ISO-kuvista (Windows, Linux jne.)","Créez des disques amorçables à partir d'images ISOs (Windows, Linux, etc.)","Erstellen bootfähiger Laufwerke aus bootfähigen ISOs (Windows, Linux, etc.)","Δημιουργήστε εκκινήσιμες μονάδες από ISO με δυνατότητα εκκίνησης (Windows, Linux, κ.λπ.)","יצירת כוננים הניתנים לאתחול מקובצי ISO הניתנים לאתחול (Windows‏, Linux וכו')","Bootolható meghajtók készítése bootolható ISO képfájlokból (Windows, Linux, stb.)","Buat perangkat yang dapat di boot dari ISO (Windows, Linux, dll.)","Crea unità avviabili da ISO avviabili (Windows, Linux, ecc.)","WindowsやLinuxなどのISOファイルから起動可能ドライブを作成します。","부팅 가능한 ISO (Windows, Linux 등)에서 부팅 가능한 드라이브 만들기","Izveido ielādes ierīces no ISO failiem (Windows, Linux, u.c.)","Sukurkite įkrovos diskus iš įkrovos ISO (Windows, Linux ir kt.)","Buat pemacu boleh boot daripada ISO boleh boot (Windows, Linux, dll.)","Lag oppstartabar enhet/disk fra ISOer (Windows, Linux, etc.)","ایجاد درایوهای قابل بوت از ISOهای قابل بوت (ویندوز، لینوکس و غیره)","Twórz dyski rozruchowe z obrazów ISO (Windows, Linux itp.)","Criar discos inicializáveis a partir de ISOs inicializáveis (Windows, Linux, etc.)","Criar unidades inicializáveis a partir de ISOs inicializáveis (Windows, Linux, etc.)","Crează drive-uri bootabile de la ISO-uri bootabile (Windows, Linux, etc.)","Создание загрузочных дисков из загрузочных образов ISO (Windows, Linux и т.д.)","Kreirajte disk jedinice za pokretanje sistema od ISO-a koji se mogu pokretanja sistema (Windows, Linux itd.)","Vytvorte bootovacie jednotky z ISO súborov (Windows, Linux atď.)","Ustvarite zagonske pogone iz zagonskih ISO-jev (Windows, Linux itd.)","Cree unidades de arranque desde ISO de arranque (Windows, Linux, etc.)","Skapa startbara enheter från startbara ISO-filer (Windows, Linux, etc.)","สร้าง USB ไดรฟ์บูตจากไฟล์ ISO ที่บูตได้ (เช่น ไฟล์ติดตั้ง Windows หรือ Linux เป็นต้น)","Önyüklenebilir ISO'lardan önyüklenebilir sürücüler oluşturun (Windows, Linux, vb.)","Створення завантажувальних пристроїв з завантажувальних образів (Windows, Linux, тощо)","Tạo ổ đĩa có thể khởi động từ các file ISO có thể khởi động (Windows, Linux, v.v...)" -"Feature4","703","Text","","Create bootable drives from bootable disk images, including compressed ones","إنشاء محركات أقراص قابلة للإقلاع من صور الأقراص القابلة للإقلاع ، بما في ذلك الأقراص المضغوطة","Създаване на стартиращи устройства от образи, включително компресирани такива","从可启动硬盘镜像 (包括压缩镜像) 创建可启动驱动器","從可啟動硬碟映像檔 (包括壓縮映像檔) 建立可啟動隨身碟","Stvaranje pogona za pokretanje iz slika diska za pokretanje, uključujući komprimirane","Vytváření zaváděcích jednotek ze zaváděcích obrazů disků, včetně komprimovaných","Lav opstartsbarer drev fra opstartsbarer disk billeder, inklusiv komprimerede billeder","Opstartbare schijven aanmaken van opstartbare schijf-images, inclusief gecomprimeerde images","Luo käynnistysasemia boottaavista levykuvista, pakatut kuvat mukaanlukien","Créez des disques amorçables à partir d'images disque, y compris à partir d'images compressées","Erstellen bootfähiger Laufwerke aus bootfähigen Festplatten-Images, einschließlich komprimierter Images","Δημιουργήστε μονάδες εκκίνησης από εικόνες δίσκου με δυνατότητα εκκίνησης, συμπεριλαμβανομένων συμπιεσμένων","יצירת כוננים הניתנים לאתחול מקובצי תמונת דיסק הניתנים לאתחול, כולל קבצים דחוסים","Bootolható meghajtók készítése bootolható lemez képfájlokból, beleértve a tömörítetteket is","Buat perangkat yang dapat di boot dari Disk Image, termasuk yang Disk Image yang terkompresi","Crea unità avviabili da immagini disco avviabili, incluse quelle compresse","圧縮済みのものを含むディスクイメージから起動可能ドライブを作成します。","압축된 이미지를 포함하여 부팅 가능한 디스크 이미지에서 부팅 가능한 드라이브 만들기","Izveido ielādes ierīces no ielādes disku virtuālajiem attēliem, tai skaitā arī no saspiestajiem","Sukurkite įkrovos diskus iš įkrovos disko vaizdų, įskaitant suspaustus","Buat pemacu boleh boot daripada imej cakera boleh boot, termasuk yang dimampatkan","Lag oppstartbare disker fra images, inkludert komprimerte sådan","درایوهای قابل بوت را از تصاویر دیسک قابل بوت، از جمله موارد فشرده، ایجاد کنید","Twórz dyski rozruchowe z obrazów dysków, włączając skompresowane","Criar discos inicializáveis a partir de imagens de disco inicializáveis, inclusive de imagens compactadas","Criar unidades inicializáveis a partir de imagens de disco inicializáveis, inclusive de imagens compactadas","Crează drive-uri de la imagini de disc bootabile, incluzând cele compresate","Создание загрузочных дисков из образов загрузочных дисков, в том числе сжатых","Kreiranje disk jedinica za pokretanje sistema sa slika diska koji se može pokretanja, uključujući kompresovane","Vytvorte bootovacie jednotky z diskových obrazov, vrátane tých komprimovaných","Ustvarite zagonske pogone iz slik diska, ki jih je mogoče zagnati, vključno s stisnjenimi","Cree unidades de arranque a partir de imágenes de disco de arranque, incluidas las comprimidas","Skapa startbara enheter från startbara diskavbildningar, inklusive komprimerade","สร้างไดรฟ์บูตจากดิสก์อิมเมจที่บูตได้ (รองรับไฟล์ดิสก์อิมเมจที่ถูกบีบอัด)","Sıkıştırılmış olanlar da dahil olmak üzere önyüklenebilir disk yansısından önyüklenebilir sürücüler oluşturun","Створення завантажувальних пристроїв з завантажувальних образів, у тому числі стиснутих","Tạo ổ đĩa có thể khởi động từ các tệp đĩa có thể khởi động, bao gồm cả tệp nén" -"Feature5","704","Text","","Create BIOS or UEFI bootable drives, including UEFI bootable NTFS","إنشاء BIOS أو محركات أقراص UEFI قابلة للإقلاع ، بما في ذلك UEFI NTFS القابل للتشغيل","Създаване на BIOS или UEFI стартиращи устройства, включително UEFI стартиращ NTFS","创建 BIOS 或 UEFI 可启动驱动器,包括 UEFI 可启动的 NTFS 驱动器","建立 BIOS 或 UEFI 可啟動隨身碟,包括 UEFI 可啟動的 NTFS 隨身碟","Stvaranje BIOS ili UEFI pogona za pokretanje, uključujući UEFI NTFS za pokretanje","Vytvořte zaváděcí jednotky BIOS nebo UEFI, včetně zaváděcích souborů NTFS UEFI","Lav BIOS eller UEFI opstartsbarer drev, inklusiv UEFI opstartsbarer NTFS","BIOS of UEFI opstartbare schijven aanmaken, inclusief UEFI opstartbare NTFS","Luo BIOS- tai UEFI-boottaavia asemia, mukaanlukien UEFI-boottaavat NTFS-asemat","Créez des disques amorçables BIOS ou UEFI, y compris des disques UEFI amorçables utilisant NTFS","Erstellen von BIOS- oder UEFI-bootfähigen Laufwerken, einschließlich UEFI-bootfähigem NTFS","Δημιουργήστε μονάδες δίσκου με δυνατότητα εκκίνησης BIOS ή UEFI, συμπεριλαμβανομένων NTFS με δυνατότητα εκκίνησης UEFI","יצירת כוננים הניתנים לאתחול ממחשבים התומכים ב־BIOS או UEFI, לרבות כוננים הניתנים לאתחול מ־UEFI, המשתמשים במערכת הקבצים NTFS","BIOS-ból vagy UEFI-ből bootolható meghajtók készítése, beleértve az UEFI-ből bootolható NTFS meghajtókat is","Buat perangkat BIOS atau UEFI yang dapat di boot, termasuk perangkat NTFS yang dapat di boot oleh UEFI","Crea unità avviabili BIOS o UEFI, incluso NTFS avviabile UEFI","UEFI:NTFSを含むBIOS及びUEFIで起動可能なドライブを作成します。","UEFI 부팅 가능한 NTFS를 포함하여 BIOS 또는 UEFI 부팅 가능 드라이브 만들기","Izveido BIOS vai UEFI ielādes ierīces, ieskaitot UEFI ielādi no NTFS","Sukurkite BIOS arba UEFI įkrovos diskus, įskaitant UEFI įkrovos NTFS","Buat pemacu boleh boot BIOS atau UEFI, termasuk NTFS boleh boot UEFI","Lag BIOS eller UEFI oppstartbare disker, inkludert UEFI oppstartbar NTFS","درایوهای قابل بوت بایوس یا UEFI از جمله NTFS قابل بوت UEFI ایجاد کنید","Stwórz dysk rozruchowy BIOS lub UEFI, włączając bootowalny dysk UEFI NTFS","Criar discos inicializáveis ​​BIOS ou UEFI, inclusive discos UEFI inicializáveis ​​usando NTFS","Criar discos inicializáveis ​​BIOS ou UEFI, inclusive discos UEFI inicializáveis ​​usando NTFS","Crează discuri bootabile BIOS sau UEFI, incluzând NTFS-uri bootabile de UEFI","Создание загрузочных дисков BIOS или UEFI, включая загрузочный UEFI NTFS","Kreiranje BIOS ili UEFI disk jedinica za pokretanje sistema, uključujući NTFS sa UEFI pokretanjem sistema","Vytvorte bootovacie jednotky systému BIOS alebo UEFI vrátane UEFI bootovateľnej jednotky NTFS","Ustvarite zagonske pogone BIOS ali UEFI, vključno z UEFI bootable NTFS","Cree unidades de arranque BIOS o UEFI, incluido NTFS de arranque UEFI","Skapa BIOS- eller UEFI-startbara enheter, inklusive UEFI-startbar NTFS","สร้างไดรฟ์บูตสำหรับระบบ BIOS หรือ UEFI และ UEFI bootable NTFS","UEFI önyüklenebilir NTFS dahil BIOS ya da UEFI önyüklenebilir sürücüler oluşturun","Створення завантажувальних пристроїв BIOS чи UEFI, включаючи завантажувальний UEFI NTFS","Tạo ổ đĩa có thể khởi động với hệ thống BIOS hoặc UEFI, bao gồm cả NTFS có thể khởi động với UEFI" +"Feature2","701","Text","","Create FreeDOS bootable USB drives","إنشاء محركات أقراص USB قابلة للإقلاع من FreeDOS","Създаване на FreeDOS стартиращ USB устройства","创建 FreeDOS 可启动驱动器","建立 FreeDOS 可開機隨身碟","Stvaranje FreeDOS USB pogona za pokretanje","Vytvoření bootovacích disků USB se systémem FreeDOS","Lav FreeDOS opstartsbare USB drev","FreeDOS opstartbare USB-schijven aanmaken","Luo boottaavia FreeDOS USB-asemia","Créez des disques amorçable FreeDOS","FreeDOS-bootfähige USB-Laufwerke erstellen","Δημιουργήστε μονάδες USB με δυνατότητα εκκίνησης FreeDOS","יצירת כונני USB הניתנים לאתחול של FreeDOS","Bootolható FreeDOS USB meghajtó készítése","Buat perangkat USB FreeDOS yang dapat di boot","Crea unità USB avviabili FreeDOS","FreeDOSの起動可能ドライブを作成します。","FreeDOS 부팅 가능한 USB 드라이브 만들기","Izveido FreeDOS ielādes USB ierīces","Sukurkite FreeDOS įkrovos USB diskus","Buat pemacu USB boleh boot FreeDOS","Lag FreeDos oppstartbar USB stick","درایوهای USB قابل بوت FreeDOS را ایجاد کنید","Stwórz nośnik rozruchowy USB FreeDOS","Criar discos USB inicializáveis FreeDOS","Criar unidades USB inicializáveis FreeDOS","Crează drive USB bootabil FreeDOS","Создание загрузочных USB-дисков FreeDOS","Kreiraj FreeDOS butabilni USB disk","Vytvorte bootovacie usb zariadenia FreeDOS","Ustvarite FreeDOS zagonske USB pogone","Crear unidades USB de arranque FreeDOS","Skapa FreeDOS startbara USB-enheter","สร้าง USB ไดรฟ์บูตสำหรับระบบ FreeDOS","FreeDOS önyüklenebilir USB sürücüleri oluşturun","Створення завантажувальних пристроїв FreeDOS","Tạo USB có thể khởi động với FreeDOS" +"Feature3","702","Text","","Create bootable drives from bootable ISOs (Windows, Linux, etc.)","إنشاء محركات أقراص قابلة للإقلاع من ملفات ISO القابلة للإقلاع (Windows و Linux وما إلى ذلك)","Създаване на стартиращи устройства от ISO образи (Windows, Linux и др.)","从可启动 ISO 文件 (Windows 和 Linux 等) 创建可启动驱动器","從可開機 ISO 檔案 (Windows 和 Linux 等) 建立可開機隨身碟","Stvaranje pogona za pokretanje iz ISO-ova za pokretanje (Windows, Linux itd.)","Vytváření bootovacích jednotek ze zaváděcích ISO (Windows, Linux atd.)","Lav opstartsbarer drev fra opstartsbarer ISOer (Window, Linux, osv.)","Opstartbare schijven aanmaken via opstartbare ISO's (Windows, Linux, enz)","Luo käynnistysasemia boottaavista ISO-kuvista (Windows, Linux jne.)","Créez des disques amorçables à partir d'images ISOs (Windows, Linux, etc.)","Erstellen bootfähiger Laufwerke aus bootfähigen ISOs (Windows, Linux, etc.)","Δημιουργήστε εκκινήσιμες μονάδες από ISO με δυνατότητα εκκίνησης (Windows, Linux, κ.λπ.)","יצירת כוננים הניתנים לאתחול מקובצי ISO הניתנים לאתחול (Windows‏, Linux וכו')","Bootolható meghajtók készítése bootolható ISO képfájlokból (Windows, Linux, stb.)","Buat perangkat yang dapat di boot dari ISO (Windows, Linux, dll.)","Crea unità avviabili da ISO avviabili (Windows, Linux, ecc.)","WindowsやLinuxなどのISOファイルから起動可能ドライブを作成します。","부팅 가능한 ISO (Windows, Linux 등)에서 부팅 가능한 드라이브 만들기","Izveido ielādes ierīces no ISO failiem (Windows, Linux, u.c.)","Sukurkite įkrovos diskus iš įkrovos ISO (Windows, Linux ir kt.)","Buat pemacu boleh boot daripada ISO boleh boot (Windows, Linux, dll.)","Lag oppstartabar enhet/disk fra ISOer (Windows, Linux, etc.)","ایجاد درایوهای قابل بوت از ISOهای قابل بوت (ویندوز، لینوکس و غیره)","Twórz dyski rozruchowe z obrazów ISO (Windows, Linux itp.)","Criar discos inicializáveis a partir de ISOs inicializáveis (Windows, Linux, etc.)","Criar unidades inicializáveis a partir de ISOs inicializáveis (Windows, Linux, etc.)","Crează drive-uri bootabile de la ISO-uri bootabile (Windows, Linux, etc.)","Создание загрузочных дисков из загрузочных образов ISO (Windows, Linux и т.д.)","Kreirajte disk jedinice za pokretanje sistema od ISO-a koji se mogu pokretanja sistema (Windows, Linux itd.)","Vytvorte bootovacie jednotky z ISO súborov (Windows, Linux atď.)","Ustvarite zagonske pogone iz zagonskih ISO-jev (Windows, Linux itd.)","Cree unidades de arranque desde ISO de arranque (Windows, Linux, etc.)","Skapa startbara enheter från startbara ISO-filer (Windows, Linux, etc.)","สร้าง USB ไดรฟ์บูตจากไฟล์ ISO ที่บูตได้ (เช่น ไฟล์ติดตั้ง Windows หรือ Linux เป็นต้น)","Önyüklenebilir ISO'lardan önyüklenebilir sürücüler oluşturun (Windows, Linux, vb.)","Створення завантажувальних пристроїв з завантажувальних образів (Windows, Linux, тощо)","Tạo ổ đĩa có thể khởi động từ các file ISO có thể khởi động (Windows, Linux, v.v...)" +"Feature4","703","Text","","Create bootable drives from bootable disk images, including compressed ones","إنشاء محركات أقراص قابلة للإقلاع من صور الأقراص القابلة للإقلاع ، بما في ذلك الأقراص المضغوطة","Създаване на стартиращи устройства от образи, включително компресирани такива","从可启动硬盘镜像 (包括压缩镜像) 创建可启动驱动器","從可開機硬碟映像檔 (包括壓縮映像檔) 建立可開機隨身碟","Stvaranje pogona za pokretanje iz slika diska za pokretanje, uključujući komprimirane","Vytváření zaváděcích jednotek ze zaváděcích obrazů disků, včetně komprimovaných","Lav opstartsbarer drev fra opstartsbarer disk billeder, inklusiv komprimerede billeder","Opstartbare schijven aanmaken van opstartbare schijf-images, inclusief gecomprimeerde images","Luo käynnistysasemia boottaavista levykuvista, pakatut kuvat mukaanlukien","Créez des disques amorçables à partir d'images disque, y compris à partir d'images compressées","Erstellen bootfähiger Laufwerke aus bootfähigen Festplatten-Images, einschließlich komprimierter Images","Δημιουργήστε μονάδες εκκίνησης από εικόνες δίσκου με δυνατότητα εκκίνησης, συμπεριλαμβανομένων συμπιεσμένων","יצירת כוננים הניתנים לאתחול מקובצי תמונת דיסק הניתנים לאתחול, כולל קבצים דחוסים","Bootolható meghajtók készítése bootolható lemez képfájlokból, beleértve a tömörítetteket is","Buat perangkat yang dapat di boot dari Disk Image, termasuk yang Disk Image yang terkompresi","Crea unità avviabili da immagini disco avviabili, incluse quelle compresse","圧縮済みのものを含むディスクイメージから起動可能ドライブを作成します。","압축된 이미지를 포함하여 부팅 가능한 디스크 이미지에서 부팅 가능한 드라이브 만들기","Izveido ielādes ierīces no ielādes disku virtuālajiem attēliem, tai skaitā arī no saspiestajiem","Sukurkite įkrovos diskus iš įkrovos disko vaizdų, įskaitant suspaustus","Buat pemacu boleh boot daripada imej cakera boleh boot, termasuk yang dimampatkan","Lag oppstartbare disker fra images, inkludert komprimerte sådan","درایوهای قابل بوت را از تصاویر دیسک قابل بوت، از جمله موارد فشرده، ایجاد کنید","Twórz dyski rozruchowe z obrazów dysków, włączając skompresowane","Criar discos inicializáveis a partir de imagens de disco inicializáveis, inclusive de imagens compactadas","Criar unidades inicializáveis a partir de imagens de disco inicializáveis, inclusive de imagens compactadas","Crează drive-uri de la imagini de disc bootabile, incluzând cele compresate","Создание загрузочных дисков из образов загрузочных дисков, в том числе сжатых","Kreiranje disk jedinica za pokretanje sistema sa slika diska koji se može pokretanja, uključujući kompresovane","Vytvorte bootovacie jednotky z diskových obrazov, vrátane tých komprimovaných","Ustvarite zagonske pogone iz slik diska, ki jih je mogoče zagnati, vključno s stisnjenimi","Cree unidades de arranque a partir de imágenes de disco de arranque, incluidas las comprimidas","Skapa startbara enheter från startbara diskavbildningar, inklusive komprimerade","สร้างไดรฟ์บูตจากดิสก์อิมเมจที่บูตได้ (รองรับไฟล์ดิสก์อิมเมจที่ถูกบีบอัด)","Sıkıştırılmış olanlar da dahil olmak üzere önyüklenebilir disk yansısından önyüklenebilir sürücüler oluşturun","Створення завантажувальних пристроїв з завантажувальних образів, у тому числі стиснутих","Tạo ổ đĩa có thể khởi động từ các tệp đĩa có thể khởi động, bao gồm cả tệp nén" +"Feature5","704","Text","","Create BIOS or UEFI bootable drives, including UEFI bootable NTFS","إنشاء BIOS أو محركات أقراص UEFI قابلة للإقلاع ، بما في ذلك UEFI NTFS القابل للتشغيل","Създаване на BIOS или UEFI стартиращи устройства, включително UEFI стартиращ NTFS","创建 BIOS 或 UEFI 可启动驱动器,包括 UEFI 可启动的 NTFS 驱动器","建立 BIOS 或 UEFI 可開機隨身碟,包括 UEFI 下的可開機 NTFS 隨身碟","Stvaranje BIOS ili UEFI pogona za pokretanje, uključujući UEFI NTFS za pokretanje","Vytvořte zaváděcí jednotky BIOS nebo UEFI, včetně zaváděcích souborů NTFS UEFI","Lav BIOS eller UEFI opstartsbarer drev, inklusiv UEFI opstartsbarer NTFS","BIOS of UEFI opstartbare schijven aanmaken, inclusief UEFI opstartbare NTFS","Luo BIOS- tai UEFI-boottaavia asemia, mukaanlukien UEFI-boottaavat NTFS-asemat","Créez des disques amorçables BIOS ou UEFI, y compris des disques UEFI amorçables utilisant NTFS","Erstellen von BIOS- oder UEFI-bootfähigen Laufwerken, einschließlich UEFI-bootfähigem NTFS","Δημιουργήστε μονάδες δίσκου με δυνατότητα εκκίνησης BIOS ή UEFI, συμπεριλαμβανομένων NTFS με δυνατότητα εκκίνησης UEFI","יצירת כוננים הניתנים לאתחול ממחשבים התומכים ב־BIOS או UEFI, לרבות כוננים הניתנים לאתחול מ־UEFI, המשתמשים במערכת הקבצים NTFS","BIOS-ból vagy UEFI-ből bootolható meghajtók készítése, beleértve az UEFI-ből bootolható NTFS meghajtókat is","Buat perangkat BIOS atau UEFI yang dapat di boot, termasuk perangkat NTFS yang dapat di boot oleh UEFI","Crea unità avviabili BIOS o UEFI, incluso NTFS avviabile UEFI","UEFI:NTFSを含むBIOS及びUEFIで起動可能なドライブを作成します。","UEFI 부팅 가능한 NTFS를 포함하여 BIOS 또는 UEFI 부팅 가능 드라이브 만들기","Izveido BIOS vai UEFI ielādes ierīces, ieskaitot UEFI ielādi no NTFS","Sukurkite BIOS arba UEFI įkrovos diskus, įskaitant UEFI įkrovos NTFS","Buat pemacu boleh boot BIOS atau UEFI, termasuk NTFS boleh boot UEFI","Lag BIOS eller UEFI oppstartbare disker, inkludert UEFI oppstartbar NTFS","درایوهای قابل بوت بایوس یا UEFI از جمله NTFS قابل بوت UEFI ایجاد کنید","Stwórz dysk rozruchowy BIOS lub UEFI, włączając bootowalny dysk UEFI NTFS","Criar discos inicializáveis ​​BIOS ou UEFI, inclusive discos UEFI inicializáveis ​​usando NTFS","Criar discos inicializáveis ​​BIOS ou UEFI, inclusive discos UEFI inicializáveis ​​usando NTFS","Crează discuri bootabile BIOS sau UEFI, incluzând NTFS-uri bootabile de UEFI","Создание загрузочных дисков BIOS или UEFI, включая загрузочный UEFI NTFS","Kreiranje BIOS ili UEFI disk jedinica za pokretanje sistema, uključujući NTFS sa UEFI pokretanjem sistema","Vytvorte bootovacie jednotky systému BIOS alebo UEFI vrátane UEFI bootovateľnej jednotky NTFS","Ustvarite zagonske pogone BIOS ali UEFI, vključno z UEFI bootable NTFS","Cree unidades de arranque BIOS o UEFI, incluido NTFS de arranque UEFI","Skapa BIOS- eller UEFI-startbara enheter, inklusive UEFI-startbar NTFS","สร้างไดรฟ์บูตสำหรับระบบ BIOS หรือ UEFI และ UEFI bootable NTFS","UEFI önyüklenebilir NTFS dahil BIOS ya da UEFI önyüklenebilir sürücüler oluşturun","Створення завантажувальних пристроїв BIOS чи UEFI, включаючи завантажувальний UEFI NTFS","Tạo ổ đĩa có thể khởi động với hệ thống BIOS hoặc UEFI, bao gồm cả NTFS có thể khởi động với UEFI" "Feature6","705","Text","","Create 'Windows To Go' drives","إنشاء محركات أقراص ""Windows To Go\","Създаване на 'Windows To Go' устройства","创建 'Windows To Go' 驱动器","建立 'Windows To Go' 隨身碟","Stvaranje pogona ""Windows To Go\","Vytvoření jednotek ""Windows To Go","Lav 'Windows To Go' drev","'Windows To Go'-schijven aanmaken","Luo 'Windows To Go' -asemia","Créez des disques 'Windows To Go'","Erstellen von ""Windows To Go""-Laufwerken","Δημιουργήστε μονάδες δίσκου ""Windows To Go\","יצירת כונני Windows To Go","'Windows To Go' meghajtók készítése","Buat perangkat Windows To Go","Crea unità 'Windows To Go'","Windows To Goドライブを作成します。","'Windows To Go' 드라이브 만들기","Izveido 'Windows To Go' ierīces","Sukurkite ""Windows To Go"" diskus","Buat pemacu 'Windows To Go'","Lag 'Windows To Go' disker","درایوهای ""Windows To Go"" را ایجاد کنید","Stwórz dysk 'Windows To Go'","Criar discos 'Windows To Go'","Criar discos 'Windows To Go'","Crează discuri 'Windows To Go'","Создание дисков Windows To Go","Kreiranje disk jedinica ""Windows to Go\","Vytvorte jednotky „Windows To Go\","Ustvarjanje pogonov »Windows To Go'","Cree unidades 'Windows To Go'","Skapa ""Windows To Go""-enheter","สร้างไดรฟ์ของ 'Windows To Go'","'Windows To Go' sürücüleri oluşturun","Створення пристроїв 'Windows To Go'","Tạo ổ đĩa 'Windows To Go'" "Feature7","706","Text","","Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot","قم بإنشاء محركات تثبيت ويندوز 11 لأجهزة الكمبيوتر التي لا تحتوي على TPM أو الإقلاع الآمن (Secure Boot)","Създаване на Windows 11 инсталационно устройство за компютри, които нямат TPM или Secure Boot","为没有 TPM 或安全启动功能的电脑创建 Windows 11 安装驱动器","為沒有 TPM 或安全開機功能的電腦建立 Windows 11 安裝隨身碟","Stvaranje instalacijskih pogona sustava Windows 11 za PC-jeve koji nemaju TPM ili Sigurno pokretanje","Vytvoření instalačních jednotek systému Windows 11 pro počítače bez čipu TPM nebo Secure Boot","Lav Windows 11 installations drev for PCer der ikker har TPM eller Secure Boot","Windows 11 installatieschijven aanmaken voor pc's die geen TPM of Secure Boot hebben","Luo Windows 11 -asennusasemia tietokoneille, jotka eivät tue TPM- tai Secure Boot -ominaisuuksia","Créez des disques d'installation Windows 11 pour des PCs qui ne disposent pas de TPM ou Secure Boot","Erstellen von Windows 11-Installationslaufwerken für PCs ohne TPM oder Secure Boot","Δημιουργήστε μονάδες εγκατάστασης των Windows 11 για υπολογιστές που δεν διαθέτουν TPM ή Ασφαλή Εκκίνηση","יצירת כונני התקנה של Windows 11 עבור מחשבים שאין להם TPM או Secure Boot","Windows 11 telepítési meghajtók készítése olyan PC-k számára, amelyek nem rendelkeznek TPM vagy Secure Boot funkciókkal","Buat perangkat pemasang Windows 11 untuk PC yang tidak mempunyai TPM atau Secure Boot","Crea unità di installazione di Windows 11 per PC che non dispongono di TPM o avvio protetto","TPM及びセキュアブート非対応のPC向けのWindows 11インストールドライブを作成します","TPM 또는 보안 부팅이 없는 PC용 Windows 11 설치 드라이브 만들기","Izveido Windows 11 instalācijas ierīces datoriem, kam nav TPM vai Secure Boot","Sukurkite Windows 11 diegimo diskus kompiuteriams, kuriuose nėra TPM arba saugaus įkrovimo","Buat pemacu pemasangan Windows 11 untuk PC yang tidak mempunyai TPM atau But Selamat","Lag oppstartsmedia for Windows 11 som ikke krever TPM eller Secure Boot","درایوهای نصب ویندوز 11 را برای رایانه هایی که TPM یا Secure Boot ندارند ایجاد کنید","Twórz dyski instalacyjne systemu Windows 11 dla komputerów, które nie posiadają modułu TPM ani Secure Boot","Criar discos de instalação do Windows 11 para PCs que não possuem TPM ou Secure Boot","Criar discos de instalação do Windows 11 para PCs que não possuem TPM ou Arranque Seguro","Crează drive de instalare Windows 11 pe computere care nu au TPM sau Bootare Securizată","Создание установочных дисков Windows 11 для компьютеров без TPM или безопасной загрузки","Kreiranje windows 11 instalacionih disk jedinica za računare koji nemaju TPM ili bezbedno pokretanje sistema","Vytvorte inštalačné jednotky Windows 11 pre počítače, ktoré nemajú modul TPM, ani Secure Boot","Ustvarjanje namestitvenih pogonov za Windows 11 za računalnike, ki nimate TPM ali Varnega zagona","Cree unidades de instalación de Windows 11 para PC que no tienen TPM o Arranque seguro","Skapa installationsenheter till Windows 11 för datorer som inte har TPM eller säker start","สร้างไดรฟ์ติดตั้ง Windows 11 สำหรับคอมพิวเตอร์ที่ไม่มี TPM หรือ Secure Boot","TPM ya da Güvenli Önyüklemeye sahip olmayan bilgisayarlar için Windows 11 kurulum sürücüleri oluşturun","Створення інсталяційних дисків Windows 11 для ПК, які не мають TPM чи Secure Boot","Tạo ổ đĩa cài đặt Windows 11 cho các máy tính không có TPM hoặc Secure Boot" -"Feature8","707","Text","","Create persistent Linux partitions","إنشاء Persistent Linux partitions","Създаване на устойчиви Linux дялове","创建持久 Linux 分区","建立持續性 Linux 磁區","Stvaranje trajnih Linux particija","Vytvoření trvalých oddílů systému Linux","Lav vedvarende Linux adskillelser","Persistent Linux partities aanmaken","Luo pysyviä Linux-osioita","Créez des partitions persistentes pour Linux","Persistente Linux-Partitionen erstellen","Δημιουργήστε μόνιμα διαμερίσματα Linux","יצירת מחיצות Linux קבועות","Tartós Linux partíciók készítése","Buat partisi Linux yang tetap/persistent","Crea partizioni persistenti Linux","記録用Linuxパーティションを作成します。","영구 리눅스 파티션 만들기","Izveido pastāvīgas Linux partīcijas","Sukurkite nuolatinius Linux skaidinius","Buat partition Linux berterusan","Lag persistente Linux partisjoner","ایجاد پارتیشن های لینوکس دائمی","Stwórz particje persistent Linuxa","Criar partições persistentes para Linux","Crie partições persistentes para Linux","Crează partiție de Linux persistentă","Создание постоянных разделов Linux","Kreiranje upornih Linux particija","Vytvorte trvalé oblasti systému Linux","Ustvarjanje trajnih Linux particij","Crear particiones persistentes de Linux","Skapa beständiga Linux-partitioner","สร้าง Linux partition แบบ persistent","Kalıcı Linux bölümleri oluşturun","Створення розділу збереження Linux","Tạo phân vùng Linux liên tục" -"Feature9","708","Text","","Create VHD/DD images of the selected drive","إنشاء صور VHD / DD لمحرك الأقراص المحدد","Създаване на VHD/DD образи на избраното устройство","为选择的驱动器创建 VHD/DD 镜像","為選中的磁碟機建立 VHD/DD 映像檔","Stvaranje VHD/DD slika odabranog pogona","Vytvoření obrazů VHD/DD z vybrané jednotky","Lav VHD/DD billeder af det valgte drev","VHD/DD-images van de geselecteerde schijf aanmaken","Luo VHD/DD-kuvia valitusta asemasta","Créez des images VHD/DD du périphérique sélectionné","VHD/DD-Images des ausgewählten Laufwerks erstellen","Δημιουργήστε εικόνες VHD/DD της επιλεγμένης μονάδας δίσκου","יצירת קובצי תמונה מסוג VHD/DD של הכונן שנבחר","VHD/DD képfájl készítése a kiválasztott meghajtóról","Buat image VHD/DD dari penyimpanan yang dipilih","Crea immagini VHD/DD dell'unità selezionata","選択されたドライブのVHD/DDイメージを作成します。","선택한 드라이브의 VHD/DD 이미지 만들기","Izveido izvēlētā diska VHD/DD virtuālos attēlus","Sukurkite pasirinkto disko VHD / DD vaizdus","Buat imej VHD/DD bagi pemacu yang dipilih","Lag VHD/DD speilinger av valgt disk","تصاویر VHD/DD از درایو انتخاب شده ایجاد کنید","Stwórz obraz VHD/DD z wybranego dysku","Criar imagens VHD/DD do dispositivo selecionado","Criar imagens VHD/DD do dispositivo selecionado","Crează imagini VHD/DD de pe drive-ul selectat","Создание образов VHD/DD выбранного диска","Kreiranje VHD/DD slika izabrane disk jedinice","Vytvorte obrazy VHD/DD z vybratej jednotky","Ustvarjanje VHD/DD slik izbranega pogona","Cree imágenes VHD/DD de la unidad seleccionada","Skapa VHD/DD-avbilder av den valda enheten","สร้างอิมเมจไฟล์แบบ VHD/DD จากไดรฟ์ที่เลือก","Seçilen sürücünün VHD/DD yansılarını oluşturun","Створення образів VHD/DD з вибраних дисків","Tạo tệp VHD/DD từ ổ đĩa đã chọn" -"Feature10","709","Text","","Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image","حساب المجاميع الإختبارية MD5 و SHA-1 و SHA-256 و SHA-512 للصورة المحددة","Изчисляване на MD5, SHA-1, SHA-256 и SHA-512 чексуми на избраният образ","计算被选择镜像的 MD5、SHA-1、SHA-256 和 SHA-512 校验码","計算被選中映像的 MD5、SHA-1、SHA-256 和 SHA-512 檢查碼","Izračunajte kontrolne zbrojeve odabrane slike MD5, SHA-1, SHA-256 i SHA-512","Výpočet kontrolních součtů MD5, SHA-1, SHA-256 a SHA-512 vybraného obrazu","Beregn MD5, SHA-1, SHA-256 og SHA-512 checksums af det valgte billede","MD5, SHA-1, SHA-256 en SHA-512 controlesommen berekenen van de geselecteerde image","Laske MD5, SHA-1, SHA-256 ja SHA-512 tarkistussummia valitusta levykuvasta","Calculez les sommes de contrôle MD5, SHA-1, SHA-256 et SHA-512 de l'image sélectionnée","Berechnung von MD5-, SHA-1-, SHA-256- und SHA-512-Prüfsummen für das ausgewählte Bild","Υπολογίστε τα αθροίσματα ελέγχου MD5, SHA-1, SHA-256 και SHA-512 της επιλεγμένης εικόνας","חישוב סיכומי ביקורת מסוג MD5,‏ SHA-1,‏ SHA-256 ו־SHA-512 של קובץ התמונה שנבחרה","A kiválasztott képfájl MD5, SHA-1, SHA-256 és SHA-512 ellenőrző összegének kiszámítása","Hitung checksum MD5, SHA-1, SHA-256 dan SHA-512 dari image yang dipilih","Calcola i checksum MD5, SHA-1, SHA-256 e SHA-512 dell'immagine selezionata","選択されたイメージのMD5、SHA-1、SHA-256及びSHA-512チェックサムを計算します。","선택한 이미지의 MD5, SHA-1, SHA-256 및 SHA-512 체크섬 계산","Izskaitļo izvēlētā virtuālā attēla MD5, SHA-1, SHA-256 un SHA-512 kontrolsummas","Apskaičiuokite pasirinkto vaizdo MD5, SHA-1, SHA-256 ir SHA-512 kontrolines sumas","Kira MD5, SHA-1, SHA-256 dan SHA-512 checksum imej yang dipilih","Kalkuler MD5, SHA-1, SHA-256 og SHA-512 sjekksummer fra valgt speiling","MD5، SHA-1، SHA-256 و SHA-512 را برای تصویر انتخابی محاسبه کنید","Oblicz sumy kontrolne MD5, SHA-1, SHA-256 i SHA-512 dla wybranego obrazu","Calcular somas de verificação MD5, SHA-1, SHA-256 e SHA-512 da imagem selecionada","Calcular checksums MD5, SHA-1, SHA-256 e SHA-512 da imagem selecionada","Compută MD5, SHA-1, SHA-256 și SHA-512 suma de control ale imaginilor selectate","Вычисление контрольных сумм MD5, SHA-1, SHA-256 и SHA-512 выбранного образа","Izračunajte MD5, SHA-1, SHA-256 i SHA-512 kontrolne preglede izabrane slike","Vypočítajte kontrolné súčty vybratého obrazu (MD5, SHA-1, SHA-256 a SHA-512)","Račun MD5, SHA-1, SHA-256 in SHA-512 kontrolni vsoti izbrane slike","Calcule las sumas de comprobación MD5, SHA-1, SHA-256 y SHA-512 de la imagen seleccionada","Beräkna kontrollsummor MD5, SHA-1, SHA-256 och SHA-512 för den valda avbilden","คำนวณรหัส MD5, SHA-1, SHA-256, SHA-512 ของไฟล์อิมเมจที่เลือก","Seçilen yansının MD5, SHA-1, SHA-256 ve SHA-512 sağlama toplamlarını hesaplayın","Обчислення контрольних сум MD5, SHA-1, SHA-256 та SHA-512 для вибраних образів","Tính tổng kiểm MD5, SHA-1, SHA-256 và SHA-512 của tệp đã chọn" -"Feature11","710","Text","","Perform bad blocks checks, including detection of ""fake"" flash drives","إجراء فحوصات كتل تالفة ، بما في ذلك الكشف عن محركات أقراص فلاش ""زائفة\","Проверяване за лоши блокове, включително засичане на ""фалшиви"" устройства","执行坏块检查,包括对”假“U盘的检测","執行壞軌檢查,包括對”假“USB 快閃磁碟機的偵測","Izvršite provjere loših blokova, uključujući otkrivanje ""lažnih"" flash pogona","Provést kontrolu vadných bloků, včetně detekce ""falešných"" bloků. flash disky","Udøv dårlige blokke tjeks, inklusiv opdagelse af ""falske"" flashdrev","Controles uitvoeren op slechte blokken, inclusief detectie van ""valse"" flashdrives","Suorita viallisten lohkojen tarkistuksia, sisältäen ""valheellisten"" muistitikkujen tunnistamisen","Executez un test de mauvais secteurs avec detection des ""fake drives\","Durchführung von Prüfungen auf fehlerhafte Blöcke, einschließlich der Erkennung von ""gefälschten"" Flash-Laufwerken","Εκτελέστε ελέγχους εσφαλμένων block, συμπεριλαμβανομένου του εντοπισμού ""ψευδών"" μονάδων flash","ביצוע בדיקות אחר בלוקים (אזורים) פגומים, כולל זיהוי של כונני הבזק ""מזוייפים\","Hibás blokkok ellenőrzése, beleértve a ""hamis"" flash meghajtók detektálását","Lakukan cek Blok yang buruk, termasuk deteksi USB Flash Disk ""PALSU\","Esegui controlli dei blocchi danneggiati, incluso il rilevamento di unità flash ""false\","不良ブロックチェック及び容量詐欺ドライブの検知を行います。","""위조"" 플래시 드라이브 감지를 포함하여 불량 블록 검사 수행","Izpilda bojāto bloku pārbaudi ieskaitot ""falsificēto"" nesēju noteikšanu","Atlikite blogų blokų patikrinimus, įskaitant ""netikrų"" flash diskų aptikimą","Melakukan pemeriksaan blok buruk, termasuk pengesanan pemacu kilat ""palsu\","Utfør sjekk for dårlige sektorer, inkludert sjekk for forfalskede flash disker","بررسی بلوک های بد، از جمله تشخیص درایوهای فلش ""جعلی"" را انجام دهید","Sprawdź dysk pod względem spójności danych lub wykryj ""nieorginalny"" pendrive","Executar verificações de blocos defeituosos, incluindo detecção de unidades flash ""falsificadas\","Executar verificações de blocos inválidos, incluindo a deteção de unidades flash ""falsas\","Verifică blocuri rele, incluzând detectarea de drive-uri flash ""false\","Проверка на плохие блоки, обнаружение ""поддельных"" флешек","Izvršite provere loših blokova, uključujući otkrivanje ""lažnih"" fleš diskova","Vykonajte kontroly zlých blokov vrátane detekcie „falošných"" prenosných diskov","Izvajanje preverjanj slabih blokov, vključno z odkrivanjem »lažnih« bliskavic","Realice comprobaciones de bloques defectuosos, incluida la detección de unidades flash ""falsas\","Utför kontroll av trasiga block, inklusive upptäckt av ""falska"" USB-minnen","ตรวจสอบจุดบกพร่อง รวมไปถึงการทดสอบแฟลชไดรฟ์ว่าเป็น ""ของปลอม"" หรือไม่","""Sahte"" flash sürücülerin tespiti de dahil olmak üzere hatalı blok kontrolleri gerçekleştirin","Перевірка дисків (включаючи фальшиві диски)","Thực hiện kiểm tra điểm lỗi, bao gồm phát hiện ổ đĩa ""giả\" +"Feature8","707","Text","","Create persistent Linux partitions","إنشاء Persistent Linux partitions","Създаване на устойчиви Linux дялове","创建持久 Linux 分区","建立持續性 Linux 磁區","Stvaranje trajnih Linux particija","Vytvoření trvalých oddílů systému Linux","Lav vedvarende Linux adskillelser","Persistent Linux partities aanmaken","Luo pysyviä Linux-osioita","Créez des partitions persistentes pour Linux","Persistente Linux-Partitionen erstellen","Δημιουργήστε μόνιμα διαμερίσματα Linux","יצירת מחיצות Linux קבועות","Tartós Linux partíciók készítése","Buat partisi Linux yang tetap/persistent","Crea partizioni persistenti Linux","記録用Linuxパーティションを作成します。","영구 리눅스 파티션 만들기","Izveido pastāvīgas Linux partīcijas","Sukurkite nuolatinius Linux skaidinius","Buat partition Linux berterusan","Lag persistente Linux partisjoner","ایجاد پارتیشن های لینوکس دائمی","Utwórz trwałe partycje Linux","Criar partições persistentes para Linux","Crie partições persistentes para Linux","Crează partiție de Linux persistentă","Создание постоянных разделов Linux","Kreiranje upornih Linux particija","Vytvorte trvalé oblasti systému Linux","Ustvarjanje trajnih Linux particij","Crear particiones persistentes de Linux","Skapa beständiga Linux-partitioner","สร้าง Linux partition แบบ persistent","Kalıcı Linux bölümleri oluşturun","Створення розділу збереження Linux","Tạo phân vùng Linux liên tục" +"Feature9","708","Text","","Create VHD/DD images of the selected drive","إنشاء صور VHD / DD لمحرك الأقراص المحدد","Създаване на VHD/DD образи на избраното устройство","为选择的驱动器创建 VHD/DD 镜像","為選取的磁碟機建立 VHD/DD 映像檔","Stvaranje VHD/DD slika odabranog pogona","Vytvoření obrazů VHD/DD z vybrané jednotky","Lav VHD/DD billeder af det valgte drev","VHD/DD-images van de geselecteerde schijf aanmaken","Luo VHD/DD-kuvia valitusta asemasta","Créez des images VHD/DD du périphérique sélectionné","VHD/DD-Images des ausgewählten Laufwerks erstellen","Δημιουργήστε εικόνες VHD/DD της επιλεγμένης μονάδας δίσκου","יצירת קובצי תמונה מסוג VHD/DD של הכונן שנבחר","VHD/DD képfájl készítése a kiválasztott meghajtóról","Buat image VHD/DD dari penyimpanan yang dipilih","Crea immagini VHD/DD dell'unità selezionata","選択されたドライブのVHD/DDイメージを作成します。","선택한 드라이브의 VHD/DD 이미지 만들기","Izveido izvēlētā diska VHD/DD virtuālos attēlus","Sukurkite pasirinkto disko VHD / DD vaizdus","Buat imej VHD/DD bagi pemacu yang dipilih","Lag VHD/DD speilinger av valgt disk","تصاویر VHD/DD از درایو انتخاب شده ایجاد کنید","Stwórz obraz VHD/DD z wybranego dysku","Criar imagens VHD/DD do dispositivo selecionado","Criar imagens VHD/DD do dispositivo selecionado","Crează imagini VHD/DD de pe drive-ul selectat","Создание образов VHD/DD выбранного диска","Kreiranje VHD/DD slika izabrane disk jedinice","Vytvorte obrazy VHD/DD z vybratej jednotky","Ustvarjanje VHD/DD slik izbranega pogona","Cree imágenes VHD/DD de la unidad seleccionada","Skapa VHD/DD-avbilder av den valda enheten","สร้างอิมเมจไฟล์แบบ VHD/DD จากไดรฟ์ที่เลือก","Seçilen sürücünün VHD/DD yansılarını oluşturun","Створення образів VHD/DD з вибраних дисків","Tạo tệp VHD/DD từ ổ đĩa đã chọn" +"Feature10","709","Text","","Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image","حساب المجاميع الإختبارية MD5 و SHA-1 و SHA-256 و SHA-512 للصورة المحددة","Изчисляване на MD5, SHA-1, SHA-256 и SHA-512 чексуми на избраният образ","计算被选择镜像的 MD5、SHA-1、SHA-256 和 SHA-512 校验码","計算被選取映像的 MD5、SHA-1、SHA-256 和 SHA-512 檢查碼","Izračunajte kontrolne zbrojeve odabrane slike MD5, SHA-1, SHA-256 i SHA-512","Výpočet kontrolních součtů MD5, SHA-1, SHA-256 a SHA-512 vybraného obrazu","Beregn MD5, SHA-1, SHA-256 og SHA-512 checksums af det valgte billede","MD5, SHA-1, SHA-256 en SHA-512 controlesommen berekenen van de geselecteerde image","Laske MD5, SHA-1, SHA-256 ja SHA-512 tarkistussummia valitusta levykuvasta","Calculez les sommes de contrôle MD5, SHA-1, SHA-256 et SHA-512 de l'image sélectionnée","Berechnung von MD5-, SHA-1-, SHA-256- und SHA-512-Prüfsummen für das ausgewählte Bild","Υπολογίστε τα αθροίσματα ελέγχου MD5, SHA-1, SHA-256 και SHA-512 της επιλεγμένης εικόνας","חישוב סיכומי ביקורת מסוג MD5,‏ SHA-1,‏ SHA-256 ו־SHA-512 של קובץ התמונה שנבחרה","A kiválasztott képfájl MD5, SHA-1, SHA-256 és SHA-512 ellenőrző összegének kiszámítása","Hitung checksum MD5, SHA-1, SHA-256 dan SHA-512 dari image yang dipilih","Calcola i checksum MD5, SHA-1, SHA-256 e SHA-512 dell'immagine selezionata","選択されたイメージのMD5、SHA-1、SHA-256及びSHA-512チェックサムを計算します。","선택한 이미지의 MD5, SHA-1, SHA-256 및 SHA-512 체크섬 계산","Izskaitļo izvēlētā virtuālā attēla MD5, SHA-1, SHA-256 un SHA-512 kontrolsummas","Apskaičiuokite pasirinkto vaizdo MD5, SHA-1, SHA-256 ir SHA-512 kontrolines sumas","Kira MD5, SHA-1, SHA-256 dan SHA-512 checksum imej yang dipilih","Kalkuler MD5, SHA-1, SHA-256 og SHA-512 sjekksummer fra valgt speiling","MD5، SHA-1، SHA-256 و SHA-512 را برای تصویر انتخابی محاسبه کنید","Oblicz sumy kontrolne MD5, SHA-1, SHA-256 i SHA-512 dla wybranego obrazu","Calcular somas de verificação MD5, SHA-1, SHA-256 e SHA-512 da imagem selecionada","Calcular checksums MD5, SHA-1, SHA-256 e SHA-512 da imagem selecionada","Compută MD5, SHA-1, SHA-256 și SHA-512 suma de control ale imaginilor selectate","Вычисление контрольных сумм MD5, SHA-1, SHA-256 и SHA-512 выбранного образа","Izračunajte MD5, SHA-1, SHA-256 i SHA-512 kontrolne preglede izabrane slike","Vypočítajte kontrolné súčty vybratého obrazu (MD5, SHA-1, SHA-256 a SHA-512)","Račun MD5, SHA-1, SHA-256 in SHA-512 kontrolni vsoti izbrane slike","Calcule las sumas de comprobación MD5, SHA-1, SHA-256 y SHA-512 de la imagen seleccionada","Beräkna kontrollsummor MD5, SHA-1, SHA-256 och SHA-512 för den valda avbilden","คำนวณรหัส MD5, SHA-1, SHA-256, SHA-512 ของไฟล์อิมเมจที่เลือก","Seçilen yansının MD5, SHA-1, SHA-256 ve SHA-512 sağlama toplamlarını hesaplayın","Обчислення контрольних сум MD5, SHA-1, SHA-256 та SHA-512 для вибраних образів","Tính tổng kiểm MD5, SHA-1, SHA-256 và SHA-512 của tệp đã chọn" +"Feature11","710","Text","","Perform bad blocks checks, including detection of ""fake"" flash drives","إجراء فحوصات كتل تالفة ، بما في ذلك الكشف عن محركات أقراص فلاش ""زائفة\","Проверяване за лоши блокове, включително засичане на ""фалшиви"" устройства","执行坏块检查,包括对”假“U盘的检测","執行壞軌檢查,包括對”假“USB 快閃磁碟 +的偵測","Izvršite provjere loših blokova, uključujući otkrivanje ""lažnih"" flash pogona","Provést kontrolu vadných bloků, včetně detekce ""falešných"" bloků. flash disky","Udøv dårlige blokke tjeks, inklusiv opdagelse af ""falske"" flashdrev","Controles uitvoeren op slechte blokken, inclusief detectie van ""valse"" flashdrives","Suorita viallisten lohkojen tarkistuksia, sisältäen ""valheellisten"" muistitikkujen tunnistamisen","Executez un test de mauvais secteurs avec detection des ""fake drives\","Durchführung von Prüfungen auf fehlerhafte Blöcke, einschließlich der Erkennung von ""gefälschten"" Flash-Laufwerken","Εκτελέστε ελέγχους εσφαλμένων block, συμπεριλαμβανομένου του εντοπισμού ""ψευδών"" μονάδων flash","ביצוע בדיקות אחר בלוקים (אזורים) פגומים, כולל זיהוי של כונני הבזק ""מזוייפים\","Hibás blokkok ellenőrzése, beleértve a ""hamis"" flash meghajtók detektálását","Lakukan cek Blok yang buruk, termasuk deteksi USB Flash Disk ""PALSU\","Esegui controlli dei blocchi danneggiati, incluso il rilevamento di unità flash ""false\","不良ブロックチェック及び容量詐欺ドライブの検知を行います。","""위조"" 플래시 드라이브 감지를 포함하여 불량 블록 검사 수행","Izpilda bojāto bloku pārbaudi ieskaitot ""falsificēto"" nesēju noteikšanu","Atlikite blogų blokų patikrinimus, įskaitant ""netikrų"" flash diskų aptikimą","Melakukan pemeriksaan blok buruk, termasuk pengesanan pemacu kilat ""palsu\","Utfør sjekk for dårlige sektorer, inkludert sjekk for forfalskede flash disker","بررسی بلوک های بد، از جمله تشخیص درایوهای فلش ""جعلی"" را انجام دهید","Sprawdź dysk pod względem spójności danych lub wykryj ""nieoryginalny"" pendrive","Executar verificações de blocos defeituosos, incluindo detecção de unidades flash ""falsificadas\","Executar verificações de blocos inválidos, incluindo a deteção de unidades flash ""falsas\","Verifică blocuri rele, incluzând detectarea de drive-uri flash ""false\","Проверка на плохие блоки, обнаружение ""поддельных"" флешек","Izvršite provere loših blokova, uključujući otkrivanje ""lažnih"" fleš diskova","Vykonajte kontroly zlých blokov vrátane detekcie „falošných"" prenosných diskov","Izvajanje preverjanj slabih blokov, vključno z odkrivanjem »lažnih« bliskavic","Realice comprobaciones de bloques defectuosos, incluida la detección de unidades flash ""falsas\","Utför kontroll av trasiga block, inklusive upptäckt av ""falska"" USB-minnen","ตรวจสอบจุดบกพร่อง รวมไปถึงการทดสอบแฟลชไดรฟ์ว่าเป็น ""ของปลอม"" หรือไม่","""Sahte"" flash sürücülerin tespiti de dahil olmak üzere hatalı blok kontrolleri gerçekleştirin","Перевірка дисків (включаючи фальшиві диски)","Thực hiện kiểm tra điểm lỗi, bao gồm phát hiện ổ đĩa ""giả\" "Feature12","711","Text","","Download official Microsoft Windows retail ISOs","قم بتنزيل ملفات ISO الرسمية الخاصة بـ Microsoft Windows","Изтегляне на официални Microsoft Windows ISO образи","下载微软官方 Windows 镜像","下載微軟官方 Windows 映像檔","Preuzimanje službenih ISO-ova za maloprodaju sustava Microsoft Windows","Stažení oficiálních souborů ISO systému Microsoft Windows","Hent officielle Microsoft Windows detail ISOer","Officiële Microsoft Windows retail ISO's downloaden","Lataa virallisia Microsoft Windowsin jälleenmyyntiversion ISO-levykuvia","Téléchargez des images ISOs commerciales officielles de Microsoft Windows","Offizielle Microsoft Windows-ISOs herunterladen","Κατεβάστε τα επίσημα retail ISO των Microsoft Windows","הורדת קובצי ה־ISO הקמעונאיים הרשמיים של Microsoft Windows","Hivatalos Microsoft Windows kiskereskedelmi ISO képfájlok letöltése","Unduh ISO Microsoft Windows resmi","Scarica le ISO ufficiali di Microsoft Windows","マイクロソフト公式のWindows ISOをダウンロードします。","공식 Microsoft Windows 리테일 ISO 다운로드","Lejupielādē oficiālos Microsoft ISO failus","Atsisiųskite oficialius Microsoft Windows mažmeninės prekybos ISO","Muat turun rasmi ISO runcit Microsoft Windows","Last ned offisielle Windows ISOer","ISO های رسمی ماکروسافت را دریافت کنید","Pobierz oficjalny obraz ISO systemu Microsoft Windows","Baixar ISOs oficiais do Microsoft Windows","Transferir ISOs oficiais do Microsoft Windows Retail","Descarcă un Microsoft Windows ISO oficial de vânzare","Загрузка официальных ISO-образов Windows","Preuzmite zvanične Microsoft Windows maloprodajne ISO-ove","Stiahnite si oficiálne ISO pre Microsoft Windows","Prenos uradnih Microsoft Windows maloprodaja ISOs","Descargue los ISO oficiales de Microsoft Windows","Ladda ner officiella Microsoft Windows ISO-filer","ดาวน์โหลดไฟล์ ISO ของ Microsoft Windows จากเว็บไซต์ทางการของ Microsoft","Resmi Microsoft Windows Retail ISO'larını indirin","Завантаження офіційних образів Microsoft Windows","Tải xuống các tệp Microsoft Windows ISO bán lẻ chính thức" "Feature13","712","Text","","Download UEFI Shell ISOs","قم بتنزيل UEFI Shell ISOs","Изтегляне на UEFI Shell образи","下载 UEFI Shell 镜像","下載 UEFI Shell 映像檔","Preuzmite ISO-ove UEFI ljuske","Stažení souborů UEFI Shell ISO","Hent UEFI Shell ISOer","UEFI Shell ISO's downloaden","Lataa UEFI Shell ISO-levykuvia","Téléchargez des images ISOs du Shell UEFI","UEFI-Shell-ISOs herunterladen","Κατεβάστε τα ISO Shell UEFI","הורדת קובצי ISO של מעטפת UEFI","UEFI Shell ISO képfájlok letöltése","Unduh Shell ISO UEFI","Scarica le ISO della shell UEFI","UEFIシェルのISOをダウンロードします。","UEFI Shell ISO 다운로드","Lejupielādē UEFI OS ISO failus","Atsisiųskite UEFI Shell ISO","Muat turun ISO Shell UEFI","Last ned UEFI kommandolinje ISOer","ISO های پوسته UEFI را دانلود کنید","Ściągnij obrazy ISO UEFI Shell","Baixar ISOs do Shell UEFI","Transferir ISOs de UEFI Shell","Descarcă UEFI Shell ISO-uri","Загрузка ISO-образов оболочки UEFI","Preuzmite UEFI Shell ISOs","Stiahnite UEFI Shell ISO","Prenos UEFI Shell ISOs","Descargar ISO de UEFI Shell","Ladda ner UEFI-skal ISO-filer","ดาวน์โหลดไฟล์ ISO ของ UEFI Shell","UEFI Shell ISO'larını indirin","Завантаження командної оболонки UEFI ISO","Tải xuống các tệp UEFI Shell ISO" "Feature14","713","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, diff --git a/res/loc/ChangeLog.txt b/res/loc/ChangeLog.txt index 072325df..6939aa06 100644 --- a/res/loc/ChangeLog.txt +++ b/res/loc/ChangeLog.txt @@ -5,6 +5,10 @@ To edit a translation, please make sure to follow: https://github.com/pbatard/rufus/wiki/Localization#Editing_an_existing_translation Or simply download https://files.akeo.ie/pollock/pollock-1.5.exe and follow its directions. +o v4.? (????.??.??) ** NOT FINAL!!! PLEASE DO NOT SEND UNSOLICITED TRANSLATIONS! ** + - *NEW* MSG_350 "Use 'Windows UEFI CA 2023' signed bootloaders [EXPERIMENTAL]" + - *NEW* MSG_351 "Checking for UEFI bootloader revocation..." + o v4.5 (2024.05.??) - *UPDATED* IDC_RUFUS_MBR -> IDC_UEFI_MEDIA_VALIDATION "Enable runtime UEFI media validation" - *UPDATED* MSG_167 "Install a UEFI bootloader, that will perform MD5Sum file validation of the media" diff --git a/src/rufus.rc b/src/rufus.rc index bf9da232..63419a76 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.6.2207" +CAPTION "Rufus 4.6.2208" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2207,0 - PRODUCTVERSION 4,6,2207,0 + FILEVERSION 4,6,2208,0 + PRODUCTVERSION 4,6,2208,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2207" + VALUE "FileVersion", "4.6.2208" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2207" + VALUE "ProductVersion", "4.6.2208" END END BLOCK "VarFileInfo" From 37e383ade6eebe40c41f09f8f6b8f135118b4907 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 22 Nov 2024 00:03:13 +0000 Subject: [PATCH 018/192] [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. --- configure | 20 ++++++++++---------- configure.ac | 2 +- src/dev.c | 3 +++ src/drive.c | 42 ++++++++++++++++++++++++++++++++++++++++++ src/drive.h | 1 + src/rufus.rc | 12 ++++++------ 6 files changed, 63 insertions(+), 17 deletions(-) diff --git a/configure b/configure index 667af6b2..a385d034 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for rufus 4.6. +# Generated by GNU Autoconf 2.71 for rufus 4.7. # # Report bugs to <https://github.com/pbatard/rufus/issues>. # @@ -611,8 +611,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rufus' PACKAGE_TARNAME='rufus' -PACKAGE_VERSION='4.6' -PACKAGE_STRING='rufus 4.6' +PACKAGE_VERSION='4.7' +PACKAGE_STRING='rufus 4.7' PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues' PACKAGE_URL='https://rufus.ie' @@ -1269,7 +1269,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rufus 4.6 to adapt to many kinds of systems. +\`configure' configures rufus 4.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1336,7 +1336,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rufus 4.6:";; + short | recursive ) echo "Configuration of rufus 4.7:";; esac cat <<\_ACEOF @@ -1428,7 +1428,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rufus configure 4.6 +rufus configure 4.7 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1504,7 +1504,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rufus $as_me 4.6, which was +It was created by rufus $as_me 4.7, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2767,7 +2767,7 @@ fi # Define the identity of the package. PACKAGE='rufus' - VERSION='4.6' + VERSION='4.7' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -5309,7 +5309,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rufus $as_me 4.6, which was +This file was extended by rufus $as_me 4.7, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5365,7 +5365,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -rufus config.status 4.6 +rufus config.status 4.7 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 513ab26d..c530cd10 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([rufus], [4.6], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) +AC_INIT([rufus], [4.7], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies]) AC_CONFIG_SRCDIR([src/rufus.c]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/src/dev.c b/src/dev.c index 5ea2b2a0..a5768a8f 100644 --- a/src/dev.c +++ b/src/dev.c @@ -943,6 +943,9 @@ BOOL GetDevices(DWORD devnum) uprintf("Device eliminated because it was detected as a Microsoft Dev Drive"); safe_free(devint_detail_data); break; + } else if (IsFilteredDrive(drive_index)) { + safe_free(devint_detail_data); + break; } // Windows 10 19H1 mounts a 'PortableBaseLayer' for its Windows Sandbox feature => unlist those if (safe_strcmp(label, windows_sandbox_vhd_label) == 0) { diff --git a/src/drive.c b/src/drive.c index 5f378e24..6be48e3a 100644 --- a/src/drive.c +++ b/src/drive.c @@ -2647,3 +2647,45 @@ out: safe_closehandle(hPhysical); return ret; } + +/* + * Detect filtered drives, that have been added by users through the registry + * entries IgnoreDisk01 - IgnoreDisk08. These entries must contain *decorated* + * string GUIDs that match the GPT Disk GUID of the drive to filter out, as + * reported by Rufus, such as "{F333EC2E-25C9-488D-A7FC-9147C2367623}". + */ +BOOL IsFilteredDrive(DWORD DriveIndex) +{ + char setting_name[32]; + DWORD i, size = 0; + BOOL r, ret = FALSE; + HANDLE hPhysical = INVALID_HANDLE_VALUE; + BYTE layout[4096] = { 0 }; + PDRIVE_LAYOUT_INFORMATION_EX DriveLayout = (PDRIVE_LAYOUT_INFORMATION_EX)(void*)layout; + GUID* DiskGuid; + + hPhysical = GetPhysicalHandle(DriveIndex, FALSE, FALSE, TRUE); + if (hPhysical == INVALID_HANDLE_VALUE) + goto out; + + r = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_LAYOUT_EX, NULL, 0, layout, sizeof(layout), &size, NULL); + if (!r || size <= 0) + goto out; + + // Only works for GPT drives + if (DriveLayout->PartitionStyle != PARTITION_STYLE_GPT) + goto out; + for (i = 1; i <= MAX_IGNORE_USB; i++) { + static_sprintf(setting_name, "IgnoreDisk%02d", i); + DiskGuid = StringToGuid(ReadSettingStr(setting_name)); + if (CompareGUID(&DriveLayout->Gpt.DiskId, DiskGuid)) { + uprintf("Device eliminated because it matches Disk GUID %s", GuidToString(DiskGuid, TRUE)); + ret = TRUE; + goto out; + } + } + +out: + safe_closehandle(hPhysical); + return ret; +} diff --git a/src/drive.h b/src/drive.h index 01e9c6b8..bee39f39 100644 --- a/src/drive.h +++ b/src/drive.h @@ -425,3 +425,4 @@ BOOL GetOpticalMedia(IMG_SAVE* img_save); uint64_t GetEspOffset(DWORD DriveIndex); BOOL ToggleEsp(DWORD DriveIndex, uint64_t PartitionOffset); BOOL IsMsDevDrive(DWORD DriveIndex); +BOOL IsFilteredDrive(DWORD DriveIndex); diff --git a/src/rufus.rc b/src/rufus.rc index 63419a76..6e5aacdf 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.6.2208" +CAPTION "Rufus 4.7.2209" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2208,0 - PRODUCTVERSION 4,6,2208,0 + FILEVERSION 4,7,2209,0 + PRODUCTVERSION 4,7,2209,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2208" + VALUE "FileVersion", "4.7.2209" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" - VALUE "OriginalFilename", "rufus-4.6.exe" + VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2208" + VALUE "ProductVersion", "4.7.2209" END END BLOCK "VarFileInfo" From fcdde3dcb8db1f31d530470ad3c48f2313570705 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 22 Nov 2024 00:18:58 +0000 Subject: [PATCH 019/192] [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. --- .github/workflows/vs2022.yml | 2 +- src/rufus.rc | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vs2022.yml b/.github/workflows/vs2022.yml index 249f7ad4..457b2f58 100644 --- a/.github/workflows/vs2022.yml +++ b/.github/workflows/vs2022.yml @@ -35,7 +35,7 @@ jobs: strategy: matrix: - TARGET_PLATFORM: [x64, x86, arm64, arm] + TARGET_PLATFORM: [x64, x86, arm64] steps: - name: Checkout repository diff --git a/src/rufus.rc b/src/rufus.rc index 6e5aacdf..a391c4f5 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.7.2209" +CAPTION "Rufus 4.7.2210" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2209,0 - PRODUCTVERSION 4,7,2209,0 + FILEVERSION 4,7,2210,0 + PRODUCTVERSION 4,7,2210,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2209" + VALUE "FileVersion", "4.7.2210" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2209" + VALUE "ProductVersion", "4.7.2210" END END BLOCK "VarFileInfo" From cef7a5cb0cbcd6dd3e5341e05d0cbcecb87cbb29 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 22 Nov 2024 23:24:37 +0000 Subject: [PATCH 020/192] [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. --- .vs/bled.vcxproj | 24 + .vs/bled.vcxproj.filters | 72 ++ src/bled/Makefile.am | 7 +- src/bled/Makefile.in | 64 +- src/bled/bb_archive.h | 7 + src/bled/bled.c | 15 +- src/bled/bled.h | 3 +- src/bled/decompress_unzstd.c | 147 +++ src/bled/fse.h | 700 +++++++++++ src/bled/fse_bitstream.h | 458 +++++++ src/bled/fse_decompress.c | 390 ++++++ src/bled/huf.h | 344 ++++++ src/bled/huf_decompress.c | 1747 +++++++++++++++++++++++++++ src/bled/libbb.h | 1 - src/bled/open_transformer.c | 12 + src/bled/xxhash.c | 821 +++++++++++++ src/bled/xxhash.h | 276 +++++ src/bled/xz_config.h | 1 - src/bled/xz_dec_lzma2.c | 1 + src/bled/zstd.h | 148 +++ src/bled/zstd_compiler.h | 242 ++++ src/bled/zstd_config.h | 49 + src/bled/zstd_cpu.h | 213 ++++ src/bled/zstd_ddict.h | 49 + src/bled/zstd_decompress.c | 1248 +++++++++++++++++++ src/bled/zstd_decompress_block.c | 1489 +++++++++++++++++++++++ src/bled/zstd_decompress_block.h | 62 + src/bled/zstd_decompress_internal.h | 205 ++++ src/bled/zstd_deps.h | 130 ++ src/bled/zstd_entropy_common.c | 362 ++++++ src/bled/zstd_error_private.c | 56 + src/bled/zstd_error_private.h | 157 +++ src/bled/zstd_errors.h | 77 ++ src/bled/zstd_internal.h | 449 +++++++ src/bled/zstd_mem.h | 423 +++++++ src/rufus.c | 2 +- src/rufus.rc | 10 +- src/vhd.c | 1 + 38 files changed, 10440 insertions(+), 22 deletions(-) create mode 100644 src/bled/decompress_unzstd.c create mode 100644 src/bled/fse.h create mode 100644 src/bled/fse_bitstream.h create mode 100644 src/bled/fse_decompress.c create mode 100644 src/bled/huf.h create mode 100644 src/bled/huf_decompress.c create mode 100644 src/bled/xxhash.c create mode 100644 src/bled/xxhash.h create mode 100644 src/bled/zstd.h create mode 100644 src/bled/zstd_compiler.h create mode 100644 src/bled/zstd_config.h create mode 100644 src/bled/zstd_cpu.h create mode 100644 src/bled/zstd_ddict.h create mode 100644 src/bled/zstd_decompress.c create mode 100644 src/bled/zstd_decompress_block.c create mode 100644 src/bled/zstd_decompress_block.h create mode 100644 src/bled/zstd_decompress_internal.h create mode 100644 src/bled/zstd_deps.h create mode 100644 src/bled/zstd_entropy_common.c create mode 100644 src/bled/zstd_error_private.c create mode 100644 src/bled/zstd_error_private.h create mode 100644 src/bled/zstd_errors.h create mode 100644 src/bled/zstd_internal.h create mode 100644 src/bled/zstd_mem.h diff --git a/.vs/bled.vcxproj b/.vs/bled.vcxproj index 94e9e48e..2c25bf54 100644 --- a/.vs/bled.vcxproj +++ b/.vs/bled.vcxproj @@ -46,32 +46,56 @@ <ClCompile Include="..\src\bled\decompress_unlzma.c" /> <ClCompile Include="..\src\bled\decompress_unxz.c" /> <ClCompile Include="..\src\bled\decompress_unzip.c" /> + <ClCompile Include="..\src\bled\decompress_unzstd.c" /> <ClCompile Include="..\src\bled\decompress_vtsi.c" /> <ClCompile Include="..\src\bled\filter_accept_all.c" /> <ClCompile Include="..\src\bled\filter_accept_list.c" /> <ClCompile Include="..\src\bled\filter_accept_reject_list.c" /> <ClCompile Include="..\src\bled\find_list_entry.c" /> + <ClCompile Include="..\src\bled\fse_decompress.c" /> <ClCompile Include="..\src\bled\header_list.c" /> <ClCompile Include="..\src\bled\header_skip.c" /> <ClCompile Include="..\src\bled\header_verbose_list.c" /> + <ClCompile Include="..\src\bled\huf_decompress.c" /> <ClCompile Include="..\src\bled\init_handle.c" /> <ClCompile Include="..\src\bled\open_transformer.c" /> <ClCompile Include="..\src\bled\seek_by_jump.c" /> <ClCompile Include="..\src\bled\seek_by_read.c" /> + <ClCompile Include="..\src\bled\xxhash.c" /> <ClCompile Include="..\src\bled\xz_dec_bcj.c" /> <ClCompile Include="..\src\bled\xz_dec_lzma2.c" /> <ClCompile Include="..\src\bled\xz_dec_stream.c" /> + <ClCompile Include="..\src\bled\zstd_decompress.c" /> + <ClCompile Include="..\src\bled\zstd_decompress_block.c" /> + <ClCompile Include="..\src\bled\zstd_entropy_common.c" /> + <ClCompile Include="..\src\bled\zstd_error_private.c" /> </ItemGroup> <ItemGroup> <ClInclude Include="..\src\bled\bb_archive.h" /> <ClInclude Include="..\src\bled\bled.h" /> + <ClInclude Include="..\src\bled\fse.h" /> + <ClInclude Include="..\src\bled\fse_bitstream.h" /> + <ClInclude Include="..\src\bled\huf.h" /> <ClInclude Include="..\src\bled\libbb.h" /> <ClInclude Include="..\src\bled\platform.h" /> + <ClInclude Include="..\src\bled\xxhash.h" /> <ClInclude Include="..\src\bled\xz.h" /> <ClInclude Include="..\src\bled\xz_config.h" /> <ClInclude Include="..\src\bled\xz_lzma2.h" /> <ClInclude Include="..\src\bled\xz_private.h" /> <ClInclude Include="..\src\bled\xz_stream.h" /> + <ClInclude Include="..\src\bled\zstd.h" /> + <ClInclude Include="..\src\bled\zstd_compiler.h" /> + <ClInclude Include="..\src\bled\zstd_config.h" /> + <ClInclude Include="..\src\bled\zstd_cpu.h" /> + <ClInclude Include="..\src\bled\zstd_ddict.h" /> + <ClInclude Include="..\src\bled\zstd_decompress_block.h" /> + <ClInclude Include="..\src\bled\zstd_decompress_internal.h" /> + <ClInclude Include="..\src\bled\zstd_deps.h" /> + <ClInclude Include="..\src\bled\zstd_errors.h" /> + <ClInclude Include="..\src\bled\zstd_error_private.h" /> + <ClInclude Include="..\src\bled\zstd_internal.h" /> + <ClInclude Include="..\src\bled\zstd_mem.h" /> </ItemGroup> <PropertyGroup Label="Globals"> <ProjectName>bled</ProjectName> diff --git a/.vs/bled.vcxproj.filters b/.vs/bled.vcxproj.filters index f7370b6b..aec23207 100644 --- a/.vs/bled.vcxproj.filters +++ b/.vs/bled.vcxproj.filters @@ -87,6 +87,30 @@ <ClCompile Include="..\src\bled\decompress_vtsi.c"> <Filter>Source Files</Filter> </ClCompile> + <ClCompile Include="..\src\bled\decompress_unzstd.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\bled\fse_decompress.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\bled\huf_decompress.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\bled\xxhash.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\bled\zstd_decompress.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\bled\zstd_decompress_block.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\bled\zstd_entropy_common.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\bled\zstd_error_private.c"> + <Filter>Source Files</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\src\bled\bb_archive.h"> @@ -116,5 +140,53 @@ <ClInclude Include="..\src\bled\xz_stream.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="..\src\bled\fse.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\bled\fse_bitstream.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\bled\huf.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\bled\xxhash.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\bled\zstd.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\bled\zstd_compiler.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\bled\zstd_config.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\bled\zstd_cpu.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\bled\zstd_ddict.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\bled\zstd_decompress_block.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\bled\zstd_decompress_internal.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\bled\zstd_deps.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\bled\zstd_error_private.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\bled\zstd_errors.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\bled\zstd_internal.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\bled\zstd_mem.h"> + <Filter>Header Files</Filter> + </ClInclude> </ItemGroup> </Project> \ No newline at end of file diff --git a/src/bled/Makefile.am b/src/bled/Makefile.am index c4e7d800..07417ca2 100644 --- a/src/bled/Makefile.am +++ b/src/bled/Makefile.am @@ -2,7 +2,8 @@ noinst_LIBRARIES = libbled.a libbled_a_SOURCES = bled.c crc32.c data_align.c data_extract_all.c data_skip.c decompress_bunzip2.c \ decompress_gunzip.c decompress_uncompress.c decompress_unlzma.c decompress_unxz.c decompress_unzip.c \ - decompress_vtsi.c filter_accept_all.c filter_accept_list.c filter_accept_reject_list.c find_list_entry.c \ - header_list.c header_skip.c header_verbose_list.c 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 + decompress_unzstd.c decompress_vtsi.c filter_accept_all.c filter_accept_list.c filter_accept_reject_list.c \ + find_list_entry.c fse_decompress.c header_list.c header_skip.c header_verbose_list.c huf_decompress.c \ + 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_decompress.c zstd_decompress_block.c zstd_entropy_common.c zstd_error_private.c libbled_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -Wno-undef -Wno-strict-aliasing diff --git a/src/bled/Makefile.in b/src/bled/Makefile.in index 7ca170f8..cc7463e3 100644 --- a/src/bled/Makefile.in +++ b/src/bled/Makefile.in @@ -103,21 +103,28 @@ am_libbled_a_OBJECTS = libbled_a-bled.$(OBJEXT) \ libbled_a-decompress_unlzma.$(OBJEXT) \ libbled_a-decompress_unxz.$(OBJEXT) \ libbled_a-decompress_unzip.$(OBJEXT) \ + libbled_a-decompress_unzstd.$(OBJEXT) \ libbled_a-decompress_vtsi.$(OBJEXT) \ libbled_a-filter_accept_all.$(OBJEXT) \ libbled_a-filter_accept_list.$(OBJEXT) \ libbled_a-filter_accept_reject_list.$(OBJEXT) \ libbled_a-find_list_entry.$(OBJEXT) \ + libbled_a-fse_decompress.$(OBJEXT) \ libbled_a-header_list.$(OBJEXT) \ libbled_a-header_skip.$(OBJEXT) \ libbled_a-header_verbose_list.$(OBJEXT) \ + libbled_a-huf_decompress.$(OBJEXT) \ libbled_a-init_handle.$(OBJEXT) \ libbled_a-open_transformer.$(OBJEXT) \ libbled_a-seek_by_jump.$(OBJEXT) \ libbled_a-seek_by_read.$(OBJEXT) \ libbled_a-xz_dec_bcj.$(OBJEXT) \ libbled_a-xz_dec_lzma2.$(OBJEXT) \ - libbled_a-xz_dec_stream.$(OBJEXT) + libbled_a-xz_dec_stream.$(OBJEXT) libbled_a-xxhash.$(OBJEXT) \ + libbled_a-zstd_decompress.$(OBJEXT) \ + libbled_a-zstd_decompress_block.$(OBJEXT) \ + libbled_a-zstd_entropy_common.$(OBJEXT) \ + libbled_a-zstd_error_private.$(OBJEXT) libbled_a_OBJECTS = $(am_libbled_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -269,9 +276,10 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libbled.a libbled_a_SOURCES = bled.c crc32.c data_align.c data_extract_all.c data_skip.c decompress_bunzip2.c \ decompress_gunzip.c decompress_uncompress.c decompress_unlzma.c decompress_unxz.c decompress_unzip.c \ - decompress_vtsi.c filter_accept_all.c filter_accept_list.c filter_accept_reject_list.c find_list_entry.c \ - header_list.c header_skip.c header_verbose_list.c 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 + decompress_unzstd.c decompress_vtsi.c filter_accept_all.c filter_accept_list.c filter_accept_reject_list.c \ + find_list_entry.c fse_decompress.c header_list.c header_skip.c header_verbose_list.c huf_decompress.c \ + 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_decompress.c zstd_decompress_block.c zstd_entropy_common.c zstd_error_private.c libbled_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -Wno-undef -Wno-strict-aliasing all: all-am @@ -395,6 +403,12 @@ libbled_a-decompress_unzip.o: decompress_unzip.c libbled_a-decompress_unzip.obj: decompress_unzip.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_unzip.obj `if test -f 'decompress_unzip.c'; then $(CYGPATH_W) 'decompress_unzip.c'; else $(CYGPATH_W) '$(srcdir)/decompress_unzip.c'; fi` +libbled_a-decompress_unzstd.o: decompress_unzstd.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_unzstd.o `test -f 'decompress_unzstd.c' || echo '$(srcdir)/'`decompress_unzstd.c + +libbled_a-decompress_unzstd.obj: decompress_unzstd.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_unzstd.obj `if test -f 'decompress_unzstd.c'; then $(CYGPATH_W) 'decompress_unzstd.c'; else $(CYGPATH_W) '$(srcdir)/decompress_unzstd.c'; fi` + libbled_a-decompress_vtsi.o: decompress_vtsi.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_vtsi.o `test -f 'decompress_vtsi.c' || echo '$(srcdir)/'`decompress_vtsi.c @@ -425,6 +439,12 @@ libbled_a-find_list_entry.o: find_list_entry.c libbled_a-find_list_entry.obj: find_list_entry.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-find_list_entry.obj `if test -f 'find_list_entry.c'; then $(CYGPATH_W) 'find_list_entry.c'; else $(CYGPATH_W) '$(srcdir)/find_list_entry.c'; fi` +libbled_a-fse_decompress.o: fse_decompress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-fse_decompress.o `test -f 'fse_decompress.c' || echo '$(srcdir)/'`fse_decompress.c + +libbled_a-fse_decompress.obj: fse_decompress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-fse_decompress.obj `if test -f 'fse_decompress.c'; then $(CYGPATH_W) 'fse_decompress.c'; else $(CYGPATH_W) '$(srcdir)/fse_decompress.c'; fi` + libbled_a-header_list.o: header_list.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-header_list.o `test -f 'header_list.c' || echo '$(srcdir)/'`header_list.c @@ -443,6 +463,12 @@ libbled_a-header_verbose_list.o: header_verbose_list.c libbled_a-header_verbose_list.obj: header_verbose_list.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-header_verbose_list.obj `if test -f 'header_verbose_list.c'; then $(CYGPATH_W) 'header_verbose_list.c'; else $(CYGPATH_W) '$(srcdir)/header_verbose_list.c'; fi` +libbled_a-huf_decompress.o: huf_decompress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-huf_decompress.o `test -f 'huf_decompress.c' || echo '$(srcdir)/'`huf_decompress.c + +libbled_a-huf_decompress.obj: huf_decompress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-huf_decompress.obj `if test -f 'huf_decompress.c'; then $(CYGPATH_W) 'huf_decompress.c'; else $(CYGPATH_W) '$(srcdir)/huf_decompress.c'; fi` + libbled_a-init_handle.o: init_handle.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-init_handle.o `test -f 'init_handle.c' || echo '$(srcdir)/'`init_handle.c @@ -485,6 +511,36 @@ libbled_a-xz_dec_stream.o: xz_dec_stream.c libbled_a-xz_dec_stream.obj: xz_dec_stream.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-xz_dec_stream.obj `if test -f 'xz_dec_stream.c'; then $(CYGPATH_W) 'xz_dec_stream.c'; else $(CYGPATH_W) '$(srcdir)/xz_dec_stream.c'; fi` +libbled_a-xxhash.o: xxhash.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-xxhash.o `test -f 'xxhash.c' || echo '$(srcdir)/'`xxhash.c + +libbled_a-xxhash.obj: xxhash.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-xxhash.obj `if test -f 'xxhash.c'; then $(CYGPATH_W) 'xxhash.c'; else $(CYGPATH_W) '$(srcdir)/xxhash.c'; fi` + +libbled_a-zstd_decompress.o: zstd_decompress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_decompress.o `test -f 'zstd_decompress.c' || echo '$(srcdir)/'`zstd_decompress.c + +libbled_a-zstd_decompress.obj: zstd_decompress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_decompress.obj `if test -f 'zstd_decompress.c'; then $(CYGPATH_W) 'zstd_decompress.c'; else $(CYGPATH_W) '$(srcdir)/zstd_decompress.c'; fi` + +libbled_a-zstd_decompress_block.o: zstd_decompress_block.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_decompress_block.o `test -f 'zstd_decompress_block.c' || echo '$(srcdir)/'`zstd_decompress_block.c + +libbled_a-zstd_decompress_block.obj: zstd_decompress_block.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_decompress_block.obj `if test -f 'zstd_decompress_block.c'; then $(CYGPATH_W) 'zstd_decompress_block.c'; else $(CYGPATH_W) '$(srcdir)/zstd_decompress_block.c'; fi` + +libbled_a-zstd_entropy_common.o: zstd_entropy_common.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_entropy_common.o `test -f 'zstd_entropy_common.c' || echo '$(srcdir)/'`zstd_entropy_common.c + +libbled_a-zstd_entropy_common.obj: zstd_entropy_common.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_entropy_common.obj `if test -f 'zstd_entropy_common.c'; then $(CYGPATH_W) 'zstd_entropy_common.c'; else $(CYGPATH_W) '$(srcdir)/zstd_entropy_common.c'; fi` + +libbled_a-zstd_error_private.o: zstd_error_private.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_error_private.o `test -f 'zstd_error_private.c' || echo '$(srcdir)/'`zstd_error_private.c + +libbled_a-zstd_error_private.obj: zstd_error_private.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_error_private.obj `if test -f 'zstd_error_private.c'; then $(CYGPATH_W) 'zstd_error_private.c'; else $(CYGPATH_W) '$(srcdir)/zstd_error_private.c'; fi` + ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am diff --git a/src/bled/bb_archive.h b/src/bled/bb_archive.h index 5e059a5a..36fca55c 100644 --- a/src/bled/bb_archive.h +++ b/src/bled/bb_archive.h @@ -17,6 +17,9 @@ enum { /* (unsigned) cast suppresses "integer overflow in expression" warning */ XZ_MAGIC1a = 256 * (unsigned)(256 * (256 * 0xfd + '7') + 'z') + 'X', XZ_MAGIC2a = 256 * 'Z' + 0, + ZSTD_MAGIC1 = 0x28B5, + ZSTD_MAGIC2 = 0x2FFD, + ZSTD_MAGIC = 0x28B52FFD, #else COMPRESS_MAGIC = 0x9d1f, GZIP_MAGIC = 0x8b1f, @@ -25,6 +28,9 @@ enum { XZ_MAGIC2 = 'z' + ('X' + ('Z' + 0 * 256) * 256) * 256, XZ_MAGIC1a = 0xfd + ('7' + ('z' + 'X' * 256) * 256) * 256, XZ_MAGIC2a = 'Z' + 0 * 256, + ZSTD_MAGIC1 = 0xB528, + ZSTD_MAGIC2 = 0xFD2F, + ZSTD_MAGIC = 0xFD2FB528, #endif }; @@ -290,6 +296,7 @@ IF_DESKTOP(long long) int unpack_bz2_stream(transformer_state_t *xstate) FAST_FU IF_DESKTOP(long long) int unpack_lzma_stream(transformer_state_t *xstate) FAST_FUNC; IF_DESKTOP(long long) int unpack_xz_stream(transformer_state_t *xstate) FAST_FUNC; IF_DESKTOP(long long) int unpack_vtsi_stream(transformer_state_t *xstate) FAST_FUNC; +IF_DESKTOP(long long) int unpack_zstd_stream(transformer_state_t *xstate) FAST_FUNC; char* append_ext(char *filename, const char *expected_ext) FAST_FUNC; int bbunpack(char **argv, diff --git a/src/bled/bled.c b/src/bled/bled.c index 7d1c813c..f73508e1 100644 --- a/src/bled/bled.c +++ b/src/bled/bled.c @@ -1,7 +1,7 @@ /* * Bled (Base Library for Easy Decompression) * - * Copyright © 2014-2023 Pete Batard <pete@akeo.ie> + * Copyright © 2014-2024 Pete Batard <pete@akeo.ie> * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ @@ -31,7 +31,9 @@ jmp_buf bb_error_jmp; char* bb_virtual_buf = NULL; size_t bb_virtual_len = 0, bb_virtual_pos = 0; int bb_virtual_fd = -1; -uint32_t BB_BUFSIZE = 0x10000; +// ZSTD has a minimal buffer size of (1 << ZSTD_BLOCKSIZELOG_MAX) + ZSTD_blockHeaderSize = 128 KB + 3 +// So we set our bufsize to 256 KB +uint32_t BB_BUFSIZE = 0x40000; static long long int unpack_none(transformer_state_t *xstate) { @@ -49,6 +51,7 @@ unpacker_t unpacker[BLED_COMPRESSION_MAX] = { unpack_xz_stream, unpack_none, unpack_vtsi_stream, + unpack_zstd_stream, }; /* Uncompress file 'src', compressed using 'type', to file 'dst' */ @@ -267,7 +270,7 @@ int64_t bled_uncompress_from_buffer_to_buffer(const char* src, const size_t src_ /* Initialize the library. * When the parameters are not NULL or zero you can: - * - specify the buffer size to use (must be larger than 64KB and a power of two) + * - specify the buffer size to use (must be larger than 256KB and a power of two) * - specify the printf-like function you want to use to output message * void print_function(const char* format, ...); * - specify the read/write functions you want to use; @@ -283,11 +286,11 @@ int bled_init(uint32_t buffer_size, printf_t print_function, read_t read_functio if (bled_initialized) return -1; BB_BUFSIZE = buffer_size; - /* buffer_size must be larger than 64 KB and a power of two */ - if (buffer_size < 0x10000 || (buffer_size & (buffer_size - 1)) != 0) { + /* buffer_size must be larger than 256 KB and a power of two */ + if (buffer_size < 0x40000 || (buffer_size & (buffer_size - 1)) != 0) { if (buffer_size != 0 && print_function != NULL) print_function("bled_init: invalid buffer_size, defaulting to 64 KB"); - BB_BUFSIZE = 0x10000; + BB_BUFSIZE = 0x40000; } bled_printf = print_function; bled_read = read_function; diff --git a/src/bled/bled.h b/src/bled/bled.h index 480498cf..7a354cad 100644 --- a/src/bled/bled.h +++ b/src/bled/bled.h @@ -1,7 +1,7 @@ /* * Bled (Base Library for Easy Decompression) * - * Copyright © 2014-2015 Pete Batard <pete@akeo.ie> + * Copyright © 2014-2024 Pete Batard <pete@akeo.ie> * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ @@ -31,6 +31,7 @@ typedef enum { BLED_COMPRESSION_XZ, // .xz BLED_COMPRESSION_7ZIP, // .7z BLED_COMPRESSION_VTSI, // .vtsi + BLED_COMPRESSION_ZSTD, // .zst BLED_COMPRESSION_MAX } bled_compression_type; diff --git a/src/bled/decompress_unzstd.c b/src/bled/decompress_unzstd.c new file mode 100644 index 00000000..1792571f --- /dev/null +++ b/src/bled/decompress_unzstd.c @@ -0,0 +1,147 @@ +/* vi: set sw=4 ts=4: */ +/* + * Glue for zstd decompression + * Copyright (c) 2021 Norbert Lange <nolange79@gmail.com> + * Copyright (c) 2024 Pete Batard <pete@akeo.ie> + * + * Based on compress.c from the systemd project, + * provided by Norbert Lange <nolange79@gmail.com>. + * Which originally was copied from the streaming_decompression.c + * example from the zstd project, written by Yann Collet + * + * Licensed under GPLv2 or later, see file LICENSE in this source tree. + */ + +#include "libbb.h" +#include "bb_archive.h" +#include "zstd_deps.h" +#include "zstd_internal.h" + +ZSTD_customMem ZSTD_defaultCMem = { ZSTD_customMalloc, ZSTD_customFree, NULL }; + +ZSTDLIB_API const char* ZSTD_getErrorName(size_t code) { + return ERR_getErrorName(code); +} + +ALWAYS_INLINE static size_t roundupsize(size_t size, size_t align) +{ + return (size + align - 1U) & ~(align - 1); +} + +ALWAYS_INLINE static IF_DESKTOP(long long) int +unpack_zstd_stream_inner(transformer_state_t *xstate, + ZSTD_DStream *dctx, void *out_buff) +{ + const U32 zstd_magic = ZSTD_MAGIC; + const size_t in_allocsize = roundupsize(ZSTD_DStreamInSize(), 1024), + out_allocsize = roundupsize(ZSTD_DStreamOutSize(), 1024); + + IF_DESKTOP(long long int total = 0;) + size_t last_result = ZSTD_error_maxCode + 1; + ssize_t nwrote = 0; + unsigned input_fixup; + void *in_buff = (char *)out_buff + out_allocsize; + + memcpy(in_buff, &zstd_magic, 4); + input_fixup = xstate->signature_skipped ? 4 : 0; + + /* This loop assumes that the input file is one or more concatenated + * zstd streams. This example won't work if there is trailing non-zstd + * data at the end, but streaming decompression in general handles this + * case. ZSTD_decompressStream() returns 0 exactly when the frame is + * completed, and doesn't consume input after the frame. + */ + for (;;) { + bool has_error = false; + ZSTD_inBuffer input; + ssize_t red; + + red = safe_read(xstate->src_fd, (char *)in_buff + input_fixup, (unsigned int)(in_allocsize - input_fixup)); + if (red < 0) { + bb_perror_msg(bb_msg_read_error); + return -1; + } + if (red == 0) { + break; + } + + input.src = in_buff; + input.size = (size_t)red + input_fixup; + input.pos = 0; + input_fixup = 0; + + /* Given a valid frame, zstd won't consume the last byte of the + * frame until it has flushed all of the decompressed data of + * the frame. So input.pos < input.size means frame is not done + * or there is still output available. + */ + while (input.pos < input.size) { + ZSTD_outBuffer output = { out_buff, out_allocsize, 0 }; + /* The return code is zero if the frame is complete, but + * there may be multiple frames concatenated together. + * Zstd will automatically reset the context when a + * frame is complete. Still, calling ZSTD_DCtx_reset() + * can be useful to reset the context to a clean state, + * for instance if the last decompression call returned + * an error. + */ + last_result = ZSTD_decompressStream(dctx, &output, &input); + if (ZSTD_isError(last_result)) { + has_error = true; + break; + } + + nwrote = transformer_write(xstate, output.dst, output.pos); + if (nwrote < 0 && nwrote != -ENOSPC) { + has_error = true; + break; + } + IF_DESKTOP(total = (nwrote == -ENOSPC) ? xstate->mem_output_size_max : total + output.pos); + } + if (has_error) + break; + } + + if (last_result != 0) { + /* The last return value from ZSTD_decompressStream did not end + * on a frame, but we reached the end of the file! We assume + * this is an error, and the input was truncated. + */ + if (last_result == ZSTD_error_maxCode + 1) { + bb_simple_error_msg("could not read zstd data"); + } else { +#if defined(ZSTD_STRIP_ERROR_STRINGS) && ZSTD_STRIP_ERROR_STRINGS == 1 + bb_error_msg("zstd decoder error: %u", (unsigned)last_result); +#else + bb_error_msg("zstd decoder error: %s", ZSTD_getErrorName(last_result)); +#endif + } + return -1; + } + + return IF_DESKTOP(total) + 0; +} + +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); + + IF_DESKTOP(long long) int result; + void *out_buff; + ZSTD_DStream *dctx; + + dctx = ZSTD_createDStream(); + if (!dctx) { + /* should be the only possibly reason of failure */ + bb_error_msg_and_die("memory exhausted"); + } + + out_buff = xmalloc(in_allocsize + out_allocsize); + + result = unpack_zstd_stream_inner(xstate, dctx, out_buff); + free(out_buff); + ZSTD_freeDStream(dctx); + return result; +} diff --git a/src/bled/fse.h b/src/bled/fse.h new file mode 100644 index 00000000..9bf7cb43 --- /dev/null +++ b/src/bled/fse.h @@ -0,0 +1,700 @@ +/* ****************************************************************** + * FSE : Finite State Entropy codec + * Public Prototypes declaration + * Copyright (c) Yann Collet, Facebook, Inc. + * + * You can contact the author at : + * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. +****************************************************************** */ + + +#ifndef FSE_H +#define FSE_H + + +/*-***************************************** +* Dependencies +******************************************/ +#include "zstd_deps.h" /* size_t, ptrdiff_t */ + + +# define FSE_PUBLIC_API MEM_STATIC + +/*------ Version ------*/ +#define FSE_VERSION_MAJOR 0 +#define FSE_VERSION_MINOR 9 +#define FSE_VERSION_RELEASE 0 + +#define FSE_LIB_VERSION FSE_VERSION_MAJOR.FSE_VERSION_MINOR.FSE_VERSION_RELEASE +#define FSE_QUOTE(str) #str +#define FSE_EXPAND_AND_QUOTE(str) FSE_QUOTE(str) +#define FSE_VERSION_STRING FSE_EXPAND_AND_QUOTE(FSE_LIB_VERSION) + +#define FSE_VERSION_NUMBER (FSE_VERSION_MAJOR *100*100 + FSE_VERSION_MINOR *100 + FSE_VERSION_RELEASE) +FSE_PUBLIC_API unsigned FSE_versionNumber(void); /**< library version number; to be used when checking dll version */ + + +/*-**************************************** +* FSE simple functions +******************************************/ +/*! FSE_compress() : + Compress content of buffer 'src', of size 'srcSize', into destination buffer 'dst'. + 'dst' buffer must be already allocated. Compression runs faster is dstCapacity >= FSE_compressBound(srcSize). + @return : size of compressed data (<= dstCapacity). + Special values : if return == 0, srcData is not compressible => Nothing is stored within dst !!! + if return == 1, srcData is a single byte symbol * srcSize times. Use RLE compression instead. + if FSE_isError(return), compression failed (more details using FSE_getErrorName()) +*/ +FSE_PUBLIC_API size_t FSE_compress(void* dst, size_t dstCapacity, + const void* src, size_t srcSize); + +/*! FSE_decompress(): + Decompress FSE data from buffer 'cSrc', of size 'cSrcSize', + into already allocated destination buffer 'dst', of size 'dstCapacity'. + @return : size of regenerated data (<= maxDstSize), + or an error code, which can be tested using FSE_isError() . + + ** Important ** : FSE_decompress() does not decompress non-compressible nor RLE data !!! + Why ? : making this distinction requires a header. + Header management is intentionally delegated to the user layer, which can better manage special cases. +*/ +FSE_PUBLIC_API size_t FSE_decompress(void* dst, size_t dstCapacity, + const void* cSrc, size_t cSrcSize); + + +/*-***************************************** +* Tool functions +******************************************/ +FSE_PUBLIC_API size_t FSE_compressBound(size_t size); /* maximum compressed size */ + +/* Error Management */ +unsigned FSE_isError(size_t code); /* tells if a return value is an error code */ +FSE_PUBLIC_API const char* FSE_getErrorName(size_t code); /* provides error code string (useful for debugging) */ + + +/*-***************************************** +* FSE advanced functions +******************************************/ +/*! FSE_compress2() : + Same as FSE_compress(), but allows the selection of 'maxSymbolValue' and 'tableLog' + Both parameters can be defined as '0' to mean : use default value + @return : size of compressed data + Special values : if return == 0, srcData is not compressible => Nothing is stored within cSrc !!! + if return == 1, srcData is a single byte symbol * srcSize times. Use RLE compression. + if FSE_isError(return), it's an error code. +*/ +FSE_PUBLIC_API size_t FSE_compress2 (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog); + + +/*-***************************************** +* FSE detailed API +******************************************/ +/*! +FSE_compress() does the following: +1. count symbol occurrence from source[] into table count[] (see hist.h) +2. normalize counters so that sum(count[]) == Power_of_2 (2^tableLog) +3. save normalized counters to memory buffer using writeNCount() +4. build encoding table 'CTable' from normalized counters +5. encode the data stream using encoding table 'CTable' + +FSE_decompress() does the following: +1. read normalized counters with readNCount() +2. build decoding table 'DTable' from normalized counters +3. decode the data stream using decoding table 'DTable' + +The following API allows targeting specific sub-functions for advanced tasks. +For example, it's possible to compress several blocks using the same 'CTable', +or to save and provide normalized distribution using external method. +*/ + +/* *** COMPRESSION *** */ + +/*! FSE_optimalTableLog(): + dynamically downsize 'tableLog' when conditions are met. + It saves CPU time, by using smaller tables, while preserving or even improving compression ratio. + @return : recommended tableLog (necessarily <= 'maxTableLog') */ +FSE_PUBLIC_API unsigned FSE_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue); + +/*! FSE_normalizeCount(): + normalize counts so that sum(count[]) == Power_of_2 (2^tableLog) + 'normalizedCounter' is a table of short, of minimum size (maxSymbolValue+1). + useLowProbCount is a boolean parameter which trades off compressed size for + faster header decoding. When it is set to 1, the compressed data will be slightly + smaller. And when it is set to 0, FSE_readNCount() and FSE_buildDTable() will be + faster. If you are compressing a small amount of data (< 2 KB) then useLowProbCount=0 + is a good default, since header deserialization makes a big speed difference. + Otherwise, useLowProbCount=1 is a good default, since the speed difference is small. + @return : tableLog, + or an errorCode, which can be tested using FSE_isError() */ +FSE_PUBLIC_API size_t FSE_normalizeCount(short* normalizedCounter, unsigned tableLog, + const unsigned* count, size_t srcSize, unsigned maxSymbolValue, unsigned useLowProbCount); + +/*! FSE_NCountWriteBound(): + Provides the maximum possible size of an FSE normalized table, given 'maxSymbolValue' and 'tableLog'. + Typically useful for allocation purpose. */ +FSE_PUBLIC_API size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog); + +/*! FSE_writeNCount(): + Compactly save 'normalizedCounter' into 'buffer'. + @return : size of the compressed table, + or an errorCode, which can be tested using FSE_isError(). */ +FSE_PUBLIC_API size_t FSE_writeNCount (void* buffer, size_t bufferSize, + const short* normalizedCounter, + unsigned maxSymbolValue, unsigned tableLog); + +/*! Constructor and Destructor of FSE_CTable. + Note that FSE_CTable size depends on 'tableLog' and 'maxSymbolValue' */ +typedef unsigned FSE_CTable; /* don't allocate that. It's only meant to be more restrictive than void* */ +FSE_PUBLIC_API FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog); +FSE_PUBLIC_API void FSE_freeCTable (FSE_CTable* ct); + +/*! FSE_buildCTable(): + Builds `ct`, which must be already allocated, using FSE_createCTable(). + @return : 0, or an errorCode, which can be tested using FSE_isError() */ +FSE_PUBLIC_API size_t FSE_buildCTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog); + +/*! FSE_compress_usingCTable(): + Compress `src` using `ct` into `dst` which must be already allocated. + @return : size of compressed data (<= `dstCapacity`), + or 0 if compressed data could not fit into `dst`, + or an errorCode, which can be tested using FSE_isError() */ +FSE_PUBLIC_API size_t FSE_compress_usingCTable (void* dst, size_t dstCapacity, const void* src, size_t srcSize, const FSE_CTable* ct); + +/*! +Tutorial : +---------- +The first step is to count all symbols. FSE_count() does this job very fast. +Result will be saved into 'count', a table of unsigned int, which must be already allocated, and have 'maxSymbolValuePtr[0]+1' cells. +'src' is a table of bytes of size 'srcSize'. All values within 'src' MUST be <= maxSymbolValuePtr[0] +maxSymbolValuePtr[0] will be updated, with its real value (necessarily <= original value) +FSE_count() will return the number of occurrence of the most frequent symbol. +This can be used to know if there is a single symbol within 'src', and to quickly evaluate its compressibility. +If there is an error, the function will return an ErrorCode (which can be tested using FSE_isError()). + +The next step is to normalize the frequencies. +FSE_normalizeCount() will ensure that sum of frequencies is == 2 ^'tableLog'. +It also guarantees a minimum of 1 to any Symbol with frequency >= 1. +You can use 'tableLog'==0 to mean "use default tableLog value". +If you are unsure of which tableLog value to use, you can ask FSE_optimalTableLog(), +which will provide the optimal valid tableLog given sourceSize, maxSymbolValue, and a user-defined maximum (0 means "default"). + +The result of FSE_normalizeCount() will be saved into a table, +called 'normalizedCounter', which is a table of signed short. +'normalizedCounter' must be already allocated, and have at least 'maxSymbolValue+1' cells. +The return value is tableLog if everything proceeded as expected. +It is 0 if there is a single symbol within distribution. +If there is an error (ex: invalid tableLog value), the function will return an ErrorCode (which can be tested using FSE_isError()). + +'normalizedCounter' can be saved in a compact manner to a memory area using FSE_writeNCount(). +'buffer' must be already allocated. +For guaranteed success, buffer size must be at least FSE_headerBound(). +The result of the function is the number of bytes written into 'buffer'. +If there is an error, the function will return an ErrorCode (which can be tested using FSE_isError(); ex : buffer size too small). + +'normalizedCounter' can then be used to create the compression table 'CTable'. +The space required by 'CTable' must be already allocated, using FSE_createCTable(). +You can then use FSE_buildCTable() to fill 'CTable'. +If there is an error, both functions will return an ErrorCode (which can be tested using FSE_isError()). + +'CTable' can then be used to compress 'src', with FSE_compress_usingCTable(). +Similar to FSE_count(), the convention is that 'src' is assumed to be a table of char of size 'srcSize' +The function returns the size of compressed data (without header), necessarily <= `dstCapacity`. +If it returns '0', compressed data could not fit into 'dst'. +If there is an error, the function will return an ErrorCode (which can be tested using FSE_isError()). +*/ + + +/* *** DECOMPRESSION *** */ + +/*! FSE_readNCount(): + Read compactly saved 'normalizedCounter' from 'rBuffer'. + @return : size read from 'rBuffer', + or an errorCode, which can be tested using FSE_isError(). + maxSymbolValuePtr[0] and tableLogPtr[0] will also be updated with their respective values */ +size_t FSE_readNCount (short* normalizedCounter, + unsigned* maxSymbolValuePtr, unsigned* tableLogPtr, + const void* rBuffer, size_t rBuffSize); + +/*! FSE_readNCount_bmi2(): + * Same as FSE_readNCount() but pass bmi2=1 when your CPU supports BMI2 and 0 otherwise. + */ +size_t FSE_readNCount_bmi2(short* normalizedCounter, + unsigned* maxSymbolValuePtr, unsigned* tableLogPtr, + const void* rBuffer, size_t rBuffSize, int bmi2); + +/*! Constructor and Destructor of FSE_DTable. + Note that its size depends on 'tableLog' */ +typedef unsigned FSE_DTable; /* don't allocate that. It's just a way to be more restrictive than void* */ +FSE_PUBLIC_API FSE_DTable* FSE_createDTable(unsigned tableLog); +FSE_PUBLIC_API void FSE_freeDTable(FSE_DTable* dt); + +/*! FSE_buildDTable(): + Builds 'dt', which must be already allocated, using FSE_createDTable(). + return : 0, or an errorCode, which can be tested using FSE_isError() */ +FSE_PUBLIC_API size_t FSE_buildDTable (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog); + +/*! FSE_decompress_usingDTable(): + Decompress compressed source `cSrc` of size `cSrcSize` using `dt` + into `dst` which must be already allocated. + @return : size of regenerated data (necessarily <= `dstCapacity`), + or an errorCode, which can be tested using FSE_isError() */ +FSE_PUBLIC_API size_t FSE_decompress_usingDTable(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, const FSE_DTable* dt); + +/*! +Tutorial : +---------- +(Note : these functions only decompress FSE-compressed blocks. + If block is uncompressed, use memcpy() instead + If block is a single repeated byte, use memset() instead ) + +The first step is to obtain the normalized frequencies of symbols. +This can be performed by FSE_readNCount() if it was saved using FSE_writeNCount(). +'normalizedCounter' must be already allocated, and have at least 'maxSymbolValuePtr[0]+1' cells of signed short. +In practice, that means it's necessary to know 'maxSymbolValue' beforehand, +or size the table to handle worst case situations (typically 256). +FSE_readNCount() will provide 'tableLog' and 'maxSymbolValue'. +The result of FSE_readNCount() is the number of bytes read from 'rBuffer'. +Note that 'rBufferSize' must be at least 4 bytes, even if useful information is less than that. +If there is an error, the function will return an error code, which can be tested using FSE_isError(). + +The next step is to build the decompression tables 'FSE_DTable' from 'normalizedCounter'. +This is performed by the function FSE_buildDTable(). +The space required by 'FSE_DTable' must be already allocated using FSE_createDTable(). +If there is an error, the function will return an error code, which can be tested using FSE_isError(). + +`FSE_DTable` can then be used to decompress `cSrc`, with FSE_decompress_usingDTable(). +`cSrcSize` must be strictly correct, otherwise decompression will fail. +FSE_decompress_usingDTable() result will tell how many bytes were regenerated (<=`dstCapacity`). +If there is an error, the function will return an error code, which can be tested using FSE_isError(). (ex: dst buffer too small) +*/ + +#endif /* FSE_H */ + +#if !defined(FSE_H_FSE_STATIC_LINKING_ONLY) +#define FSE_H_FSE_STATIC_LINKING_ONLY + +/* *** Dependency *** */ +#include "fse_bitstream.h" + + +/* ***************************************** +* Static allocation +*******************************************/ +/* FSE buffer bounds */ +#define FSE_NCOUNTBOUND 512 +#define FSE_BLOCKBOUND(size) ((size) + ((size)>>7) + 4 /* fse states */ + sizeof(size_t) /* bitContainer */) +#define FSE_COMPRESSBOUND(size) (FSE_NCOUNTBOUND + FSE_BLOCKBOUND(size)) /* Macro version, useful for static allocation */ + +/* It is possible to statically allocate FSE CTable/DTable as a table of FSE_CTable/FSE_DTable using below macros */ +#define FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) (1 + (1<<((maxTableLog)-1)) + (((maxSymbolValue)+1)*2)) +#define FSE_DTABLE_SIZE_U32(maxTableLog) (1 + (1<<(maxTableLog))) + +/* or use the size to malloc() space directly. Pay attention to alignment restrictions though */ +#define FSE_CTABLE_SIZE(maxTableLog, maxSymbolValue) (FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(FSE_CTable)) +#define FSE_DTABLE_SIZE(maxTableLog) (FSE_DTABLE_SIZE_U32(maxTableLog) * sizeof(FSE_DTable)) + + +/* ***************************************** + * FSE advanced API + ***************************************** */ + +MEM_STATIC unsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, unsigned minus); +/**< same as FSE_optimalTableLog(), which used `minus==2` */ + +/* FSE_compress_wksp() : + * Same as FSE_compress2(), but using an externally allocated scratch buffer (`workSpace`). + * FSE_COMPRESS_WKSP_SIZE_U32() provides the minimum size required for `workSpace` as a table of FSE_CTable. + */ +#define FSE_COMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) ( FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) + ((maxTableLog > 12) ? (1 << (maxTableLog - 2)) : 1024) ) +MEM_STATIC size_t FSE_compress_wksp(void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize); + +MEM_STATIC size_t FSE_buildCTable_raw(FSE_CTable* ct, unsigned nbBits); +/**< build a fake FSE_CTable, designed for a flat distribution, where each symbol uses nbBits */ + +MEM_STATIC size_t FSE_buildCTable_rle(FSE_CTable* ct, unsigned char symbolValue); +/**< build a fake FSE_CTable, designed to compress always the same symbolValue */ + +/* FSE_buildCTable_wksp() : + * Same as FSE_buildCTable(), but using an externally allocated scratch buffer (`workSpace`). + * `wkspSize` must be >= `FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog)` of `unsigned`. + * See FSE_buildCTable_wksp() for breakdown of workspace usage. + */ +#define FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog) (((maxSymbolValue + 2) + (1ull << (tableLog)))/2 + sizeof(U64)/sizeof(U32) /* additional 8 bytes for potential table overwrite */) +#define FSE_BUILD_CTABLE_WORKSPACE_SIZE(maxSymbolValue, tableLog) (sizeof(unsigned) * FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog)) +MEM_STATIC size_t FSE_buildCTable_wksp(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize); + +#define FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) (sizeof(short) * (maxSymbolValue + 1) + (1ULL << maxTableLog) + 8) +#define FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) ((FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) + sizeof(unsigned) - 1) / sizeof(unsigned)) +FSE_PUBLIC_API size_t FSE_buildDTable_wksp(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize); +/**< Same as FSE_buildDTable(), using an externally allocated `workspace` produced with `FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxSymbolValue)` */ + +MEM_STATIC size_t FSE_buildDTable_raw(FSE_DTable* dt, unsigned nbBits); +/**< build a fake FSE_DTable, designed to read a flat distribution where each symbol uses nbBits */ + +MEM_STATIC size_t FSE_buildDTable_rle(FSE_DTable* dt, unsigned char symbolValue); +/**< build a fake FSE_DTable, designed to always generate the same symbolValue */ + +#define FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) (FSE_DTABLE_SIZE_U32(maxTableLog) + FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) + (FSE_MAX_SYMBOL_VALUE + 1) / 2 + 1) +#define FSE_DECOMPRESS_WKSP_SIZE(maxTableLog, maxSymbolValue) (FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(unsigned)) +MEM_STATIC size_t FSE_decompress_wksp(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize); +/**< same as FSE_decompress(), using an externally allocated `workSpace` produced with `FSE_DECOMPRESS_WKSP_SIZE_U32(maxLog, maxSymbolValue)` */ + +size_t FSE_decompress_wksp_bmi2(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize, int bmi2); +/**< Same as FSE_decompress_wksp() but with dynamic BMI2 support. Pass 1 if your CPU supports BMI2 or 0 if it doesn't. */ + +typedef enum { + FSE_repeat_none, /**< Cannot use the previous table */ + FSE_repeat_check, /**< Can use the previous table but it must be checked */ + FSE_repeat_valid /**< Can use the previous table and it is assumed to be valid */ + } FSE_repeat; + +/* ***************************************** +* FSE symbol compression API +*******************************************/ +/*! + This API consists of small unitary functions, which highly benefit from being inlined. + Hence their body are included in next section. +*/ +typedef struct { + ptrdiff_t value; + const void* stateTable; + const void* symbolTT; + unsigned stateLog; +} FSE_CState_t; + +static void FSE_initCState(FSE_CState_t* CStatePtr, const FSE_CTable* ct); + +static void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* CStatePtr, unsigned symbol); + +static void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* CStatePtr); + +/**< +These functions are inner components of FSE_compress_usingCTable(). +They allow the creation of custom streams, mixing multiple tables and bit sources. + +A key property to keep in mind is that encoding and decoding are done **in reverse direction**. +So the first symbol you will encode is the last you will decode, like a LIFO stack. + +You will need a few variables to track your CStream. They are : + +FSE_CTable ct; // Provided by FSE_buildCTable() +BIT_CStream_t bitStream; // bitStream tracking structure +FSE_CState_t state; // State tracking structure (can have several) + + +The first thing to do is to init bitStream and state. + size_t errorCode = BIT_initCStream(&bitStream, dstBuffer, maxDstSize); + FSE_initCState(&state, ct); + +Note that BIT_initCStream() can produce an error code, so its result should be tested, using FSE_isError(); +You can then encode your input data, byte after byte. +FSE_encodeSymbol() outputs a maximum of 'tableLog' bits at a time. +Remember decoding will be done in reverse direction. + FSE_encodeByte(&bitStream, &state, symbol); + +At any time, you can also add any bit sequence. +Note : maximum allowed nbBits is 25, for compatibility with 32-bits decoders + BIT_addBits(&bitStream, bitField, nbBits); + +The above methods don't commit data to memory, they just store it into local register, for speed. +Local register size is 64-bits on 64-bits systems, 32-bits on 32-bits systems (size_t). +Writing data to memory is a manual operation, performed by the flushBits function. + BIT_flushBits(&bitStream); + +Your last FSE encoding operation shall be to flush your last state value(s). + FSE_flushState(&bitStream, &state); + +Finally, you must close the bitStream. +The function returns the size of CStream in bytes. +If data couldn't fit into dstBuffer, it will return a 0 ( == not compressible) +If there is an error, it returns an errorCode (which can be tested using FSE_isError()). + size_t size = BIT_closeCStream(&bitStream); +*/ + + +/* ***************************************** +* FSE symbol decompression API +*******************************************/ +typedef struct { + size_t state; + const void* table; /* precise table may vary, depending on U16 */ +} FSE_DState_t; + + +static void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt); + +static unsigned char FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD); + +static unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr); + +/**< +Let's now decompose FSE_decompress_usingDTable() into its unitary components. +You will decode FSE-encoded symbols from the bitStream, +and also any other bitFields you put in, **in reverse order**. + +You will need a few variables to track your bitStream. They are : + +BIT_DStream_t DStream; // Stream context +FSE_DState_t DState; // State context. Multiple ones are possible +FSE_DTable* DTablePtr; // Decoding table, provided by FSE_buildDTable() + +The first thing to do is to init the bitStream. + errorCode = BIT_initDStream(&DStream, srcBuffer, srcSize); + +You should then retrieve your initial state(s) +(in reverse flushing order if you have several ones) : + errorCode = FSE_initDState(&DState, &DStream, DTablePtr); + +You can then decode your data, symbol after symbol. +For information the maximum number of bits read by FSE_decodeSymbol() is 'tableLog'. +Keep in mind that symbols are decoded in reverse order, like a LIFO stack (last in, first out). + unsigned char symbol = FSE_decodeSymbol(&DState, &DStream); + +You can retrieve any bitfield you eventually stored into the bitStream (in reverse order) +Note : maximum allowed nbBits is 25, for 32-bits compatibility + size_t bitField = BIT_readBits(&DStream, nbBits); + +All above operations only read from local register (which size depends on size_t). +Refueling the register from memory is manually performed by the reload method. + endSignal = FSE_reloadDStream(&DStream); + +BIT_reloadDStream() result tells if there is still some more data to read from DStream. +BIT_DStream_unfinished : there is still some data left into the DStream. +BIT_DStream_endOfBuffer : Dstream reached end of buffer. Its container may no longer be completely filled. +BIT_DStream_completed : Dstream reached its exact end, corresponding in general to decompression completed. +BIT_DStream_tooFar : Dstream went too far. Decompression result is corrupted. + +When reaching end of buffer (BIT_DStream_endOfBuffer), progress slowly, notably if you decode multiple symbols per loop, +to properly detect the exact end of stream. +After each decoded symbol, check if DStream is fully consumed using this simple test : + BIT_reloadDStream(&DStream) >= BIT_DStream_completed + +When it's done, verify decompression is fully completed, by checking both DStream and the relevant states. +Checking if DStream has reached its end is performed by : + BIT_endOfDStream(&DStream); +Check also the states. There might be some symbols left there, if some high probability ones (>50%) are possible. + FSE_endOfDState(&DState); +*/ + + +/* ***************************************** +* FSE unsafe API +*******************************************/ +static unsigned char FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD); +/* faster, but works only if nbBits is always >= 1 (otherwise, result will be corrupted) */ + + +/* ***************************************** +* Implementation of inlined functions +*******************************************/ +typedef struct { + int deltaFindState; + U32 deltaNbBits; +} FSE_symbolCompressionTransform; /* total 8 bytes */ + +MEM_STATIC void FSE_initCState(FSE_CState_t* statePtr, const FSE_CTable* ct) +{ + const void* ptr = ct; + const U16* u16ptr = (const U16*) ptr; + const U32 tableLog = MEM_read16(ptr); + statePtr->value = (ptrdiff_t)1<<tableLog; + statePtr->stateTable = u16ptr+2; + statePtr->symbolTT = ct + 1 + (tableLog ? (1<<(tableLog-1)) : 1); + statePtr->stateLog = tableLog; +} + + +/*! FSE_initCState2() : +* Same as FSE_initCState(), but the first symbol to include (which will be the last to be read) +* uses the smallest state value possible, saving the cost of this symbol */ +MEM_STATIC void FSE_initCState2(FSE_CState_t* statePtr, const FSE_CTable* ct, U32 symbol) +{ + FSE_initCState(statePtr, ct); + { const FSE_symbolCompressionTransform symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol]; + const U16* stateTable = (const U16*)(statePtr->stateTable); + U32 nbBitsOut = (U32)((symbolTT.deltaNbBits + (1<<15)) >> 16); + statePtr->value = (nbBitsOut << 16) - symbolTT.deltaNbBits; + statePtr->value = stateTable[(statePtr->value >> nbBitsOut) + symbolTT.deltaFindState]; + } +} + +MEM_STATIC void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* statePtr, unsigned symbol) +{ + FSE_symbolCompressionTransform const symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol]; + const U16* const stateTable = (const U16*)(statePtr->stateTable); + U32 const nbBitsOut = (U32)((statePtr->value + symbolTT.deltaNbBits) >> 16); + BIT_addBits(bitC, statePtr->value, nbBitsOut); + statePtr->value = stateTable[ (statePtr->value >> nbBitsOut) + symbolTT.deltaFindState]; +} + +MEM_STATIC void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* statePtr) +{ + BIT_addBits(bitC, statePtr->value, statePtr->stateLog); + BIT_flushBits(bitC); +} + + +/* FSE_getMaxNbBits() : + * Approximate maximum cost of a symbol, in bits. + * Fractional get rounded up (i.e : a symbol with a normalized frequency of 3 gives the same result as a frequency of 2) + * note 1 : assume symbolValue is valid (<= maxSymbolValue) + * note 2 : if freq[symbolValue]==0, @return a fake cost of tableLog+1 bits */ +MEM_STATIC U32 FSE_getMaxNbBits(const void* symbolTTPtr, U32 symbolValue) +{ + const FSE_symbolCompressionTransform* symbolTT = (const FSE_symbolCompressionTransform*) symbolTTPtr; + return (symbolTT[symbolValue].deltaNbBits + ((1<<16)-1)) >> 16; +} + +/* FSE_bitCost() : + * Approximate symbol cost, as fractional value, using fixed-point format (accuracyLog fractional bits) + * note 1 : assume symbolValue is valid (<= maxSymbolValue) + * note 2 : if freq[symbolValue]==0, @return a fake cost of tableLog+1 bits */ +MEM_STATIC U32 FSE_bitCost(const void* symbolTTPtr, U32 tableLog, U32 symbolValue, U32 accuracyLog) +{ + const FSE_symbolCompressionTransform* symbolTT = (const FSE_symbolCompressionTransform*) symbolTTPtr; + U32 const minNbBits = symbolTT[symbolValue].deltaNbBits >> 16; + U32 const threshold = (minNbBits+1) << 16; + assert(tableLog < 16); + assert(accuracyLog < 31-tableLog); /* ensure enough room for renormalization double shift */ + { U32 const tableSize = 1 << tableLog; + U32 const deltaFromThreshold = threshold - (symbolTT[symbolValue].deltaNbBits + tableSize); + U32 const normalizedDeltaFromThreshold = (deltaFromThreshold << accuracyLog) >> tableLog; /* linear interpolation (very approximate) */ + U32 const bitMultiplier = 1 << accuracyLog; + assert(symbolTT[symbolValue].deltaNbBits + tableSize <= threshold); + assert(normalizedDeltaFromThreshold <= bitMultiplier); + return (minNbBits+1)*bitMultiplier - normalizedDeltaFromThreshold; + } +} + + +/* ====== Decompression ====== */ + +typedef struct { + U16 tableLog; + U16 fastMode; +} FSE_DTableHeader; /* sizeof U32 */ + +typedef struct +{ + unsigned short newState; + unsigned char symbol; + unsigned char nbBits; +} FSE_decode_t; /* size == U32 */ + +MEM_STATIC void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt) +{ + const void* ptr = dt; + const FSE_DTableHeader* const DTableH = (const FSE_DTableHeader*)ptr; + DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog); + BIT_reloadDStream(bitD); + DStatePtr->table = dt + 1; +} + +MEM_STATIC BYTE FSE_peekSymbol(const FSE_DState_t* DStatePtr) +{ + FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state]; + return DInfo.symbol; +} + +MEM_STATIC void FSE_updateState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD) +{ + FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state]; + U32 const nbBits = DInfo.nbBits; + size_t const lowBits = BIT_readBits(bitD, nbBits); + DStatePtr->state = DInfo.newState + lowBits; +} + +MEM_STATIC BYTE FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD) +{ + FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state]; + U32 const nbBits = DInfo.nbBits; + BYTE const symbol = DInfo.symbol; + size_t const lowBits = BIT_readBits(bitD, nbBits); + + DStatePtr->state = DInfo.newState + lowBits; + return symbol; +} + +/*! FSE_decodeSymbolFast() : + unsafe, only works if no symbol has a probability > 50% */ +MEM_STATIC BYTE FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD) +{ + FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state]; + U32 const nbBits = DInfo.nbBits; + BYTE const symbol = DInfo.symbol; + size_t const lowBits = BIT_readBitsFast(bitD, nbBits); + + DStatePtr->state = DInfo.newState + lowBits; + return symbol; +} + +MEM_STATIC unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr) +{ + return DStatePtr->state == 0; +} + + + +#ifndef FSE_COMMONDEFS_ONLY + +/* ************************************************************** +* Tuning parameters +****************************************************************/ +/*!MEMORY_USAGE : +* Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.) +* Increasing memory usage improves compression ratio +* Reduced memory usage can improve speed, due to cache effect +* Recommended max value is 14, for 16KB, which nicely fits into Intel x86 L1 cache */ +#ifndef FSE_MAX_MEMORY_USAGE +# define FSE_MAX_MEMORY_USAGE 14 +#endif +#ifndef FSE_DEFAULT_MEMORY_USAGE +# define FSE_DEFAULT_MEMORY_USAGE 13 +#endif +#if (FSE_DEFAULT_MEMORY_USAGE > FSE_MAX_MEMORY_USAGE) +# error "FSE_DEFAULT_MEMORY_USAGE must be <= FSE_MAX_MEMORY_USAGE" +#endif + +/*!FSE_MAX_SYMBOL_VALUE : +* Maximum symbol value authorized. +* Required for proper stack allocation */ +#ifndef FSE_MAX_SYMBOL_VALUE +# define FSE_MAX_SYMBOL_VALUE 255 +#endif + +/* ************************************************************** +* template functions type & suffix +****************************************************************/ +#define FSE_FUNCTION_TYPE BYTE +#define FSE_FUNCTION_EXTENSION +#define FSE_DECODE_TYPE FSE_decode_t + + +#endif /* !FSE_COMMONDEFS_ONLY */ + + +/* *************************************************************** +* Constants +*****************************************************************/ +#define FSE_MAX_TABLELOG (FSE_MAX_MEMORY_USAGE-2) +#define FSE_MAX_TABLESIZE (1U<<FSE_MAX_TABLELOG) +#define FSE_MAXTABLESIZE_MASK (FSE_MAX_TABLESIZE-1) +#define FSE_DEFAULT_TABLELOG (FSE_DEFAULT_MEMORY_USAGE-2) +#define FSE_MIN_TABLELOG 5 + +#define FSE_TABLELOG_ABSOLUTE_MAX 15 +#if FSE_MAX_TABLELOG > FSE_TABLELOG_ABSOLUTE_MAX +# error "FSE_MAX_TABLELOG > FSE_TABLELOG_ABSOLUTE_MAX is not supported" +#endif + +#define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3) + + +#endif /* FSE_STATIC_LINKING_ONLY */ + + diff --git a/src/bled/fse_bitstream.h b/src/bled/fse_bitstream.h new file mode 100644 index 00000000..a6f36229 --- /dev/null +++ b/src/bled/fse_bitstream.h @@ -0,0 +1,458 @@ +/* ****************************************************************** + * bitstream + * Part of FSE library + * Copyright (c) Yann Collet, Facebook, Inc. + * + * You can contact the author at : + * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. +****************************************************************** */ +#ifndef BITSTREAM_H_MODULE +#define BITSTREAM_H_MODULE + +/* +* This API consists of small unitary functions, which must be inlined for best performance. +* Since link-time-optimization is not available for all compilers, +* these functions are defined into a .h to be included. +*/ + +/*-**************************************** +* Dependencies +******************************************/ +#include "zstd_mem.h" /* unaligned access routines */ +#include "zstd_compiler.h" /* UNLIKELY() */ +#include "zstd_error_private.h" /* error codes and messages */ + + +/*========================================= +* Target specific +=========================================*/ + +#define STREAM_ACCUMULATOR_MIN_32 25 +#define STREAM_ACCUMULATOR_MIN_64 57 +#define STREAM_ACCUMULATOR_MIN ((U32)(MEM_32bits() ? STREAM_ACCUMULATOR_MIN_32 : STREAM_ACCUMULATOR_MIN_64)) + + +/*-****************************************** +* bitStream encoding API (write forward) +********************************************/ +/* bitStream can mix input from multiple sources. + * A critical property of these streams is that they encode and decode in **reverse** direction. + * So the first bit sequence you add will be the last to be read, like a LIFO stack. + */ +typedef struct { + size_t bitContainer; + unsigned bitPos; + char* startPtr; + char* ptr; + char* endPtr; +} BIT_CStream_t; + +MEM_STATIC size_t BIT_initCStream(BIT_CStream_t* bitC, void* dstBuffer, size_t dstCapacity); +MEM_STATIC void BIT_addBits(BIT_CStream_t* bitC, size_t value, unsigned nbBits); +MEM_STATIC void BIT_flushBits(BIT_CStream_t* bitC); +MEM_STATIC size_t BIT_closeCStream(BIT_CStream_t* bitC); + +/* Start with initCStream, providing the size of buffer to write into. +* bitStream will never write outside of this buffer. +* `dstCapacity` must be >= sizeof(bitD->bitContainer), otherwise @return will be an error code. +* +* bits are first added to a local register. +* Local register is size_t, hence 64-bits on 64-bits systems, or 32-bits on 32-bits systems. +* Writing data into memory is an explicit operation, performed by the flushBits function. +* Hence keep track how many bits are potentially stored into local register to avoid register overflow. +* After a flushBits, a maximum of 7 bits might still be stored into local register. +* +* Avoid storing elements of more than 24 bits if you want compatibility with 32-bits bitstream readers. +* +* Last operation is to close the bitStream. +* The function returns the final size of CStream in bytes. +* If data couldn't fit into `dstBuffer`, it will return a 0 ( == not storable) +*/ + + +/*-******************************************** +* bitStream decoding API (read backward) +**********************************************/ +typedef struct { + size_t bitContainer; + unsigned bitsConsumed; + const char* ptr; + const char* start; + const char* limitPtr; +} BIT_DStream_t; + +typedef enum { BIT_DStream_unfinished = 0, + BIT_DStream_endOfBuffer = 1, + BIT_DStream_completed = 2, + BIT_DStream_overflow = 3 } BIT_DStream_status; /* result of BIT_reloadDStream() */ + /* 1,2,4,8 would be better for bitmap combinations, but slows down performance a bit ... :( */ + +MEM_STATIC size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize); +MEM_STATIC size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits); +MEM_STATIC BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD); +MEM_STATIC unsigned BIT_endOfDStream(const BIT_DStream_t* bitD); + + +/* Start by invoking BIT_initDStream(). +* A chunk of the bitStream is then stored into a local register. +* Local register size is 64-bits on 64-bits systems, 32-bits on 32-bits systems (size_t). +* You can then retrieve bitFields stored into the local register, **in reverse order**. +* Local register is explicitly reloaded from memory by the BIT_reloadDStream() method. +* A reload guarantee a minimum of ((8*sizeof(bitD->bitContainer))-7) bits when its result is BIT_DStream_unfinished. +* Otherwise, it can be less than that, so proceed accordingly. +* Checking if DStream has reached its end can be performed with BIT_endOfDStream(). +*/ + + +/*-**************************************** +* unsafe API +******************************************/ +MEM_STATIC void BIT_addBitsFast(BIT_CStream_t* bitC, size_t value, unsigned nbBits); +/* faster, but works only if value is "clean", meaning all high bits above nbBits are 0 */ + +MEM_STATIC void BIT_flushBitsFast(BIT_CStream_t* bitC); +/* unsafe version; does not check buffer overflow */ + +MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits); +/* faster, but works only if nbBits >= 1 */ + + + +/*-************************************************************** +* Internal functions +****************************************************************/ +MEM_STATIC unsigned BIT_highbit32 (U32 val) +{ + assert(val != 0); + { +# if defined(_MSC_VER) /* Visual */ +# if STATIC_BMI2 == 1 + return _lzcnt_u32(val) ^ 31; +# else + unsigned long r = 0; + return _BitScanReverse(&r, val) ? (unsigned)r : 0; +# endif +# elif defined(__GNUC__) && (__GNUC__ >= 3) /* Use GCC Intrinsic */ + return __builtin_clz (val) ^ 31; +# elif defined(__ICCARM__) /* IAR Intrinsic */ + return 31 - __CLZ(val); +# else /* Software version */ + static const unsigned DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, + 11, 14, 16, 18, 22, 25, 3, 30, + 8, 12, 20, 28, 15, 17, 24, 7, + 19, 27, 23, 6, 26, 5, 4, 31 }; + U32 v = val; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + return DeBruijnClz[ (U32) (v * 0x07C4ACDDU) >> 27]; +# endif + } +} + +/*===== Local Constants =====*/ +static const unsigned BIT_mask[] = { + 0, 1, 3, 7, 0xF, 0x1F, + 0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF, + 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0x1FFFF, + 0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF, 0x7FFFFF, + 0xFFFFFF, 0x1FFFFFF, 0x3FFFFFF, 0x7FFFFFF, 0xFFFFFFF, 0x1FFFFFFF, + 0x3FFFFFFF, 0x7FFFFFFF}; /* up to 31 bits */ +#define BIT_MASK_SIZE (sizeof(BIT_mask) / sizeof(BIT_mask[0])) + +/*-************************************************************** +* bitStream encoding +****************************************************************/ +/*! BIT_initCStream() : + * `dstCapacity` must be > sizeof(size_t) + * @return : 0 if success, + * otherwise an error code (can be tested using ERR_isError()) */ +MEM_STATIC size_t BIT_initCStream(BIT_CStream_t* bitC, + void* startPtr, size_t dstCapacity) +{ + bitC->bitContainer = 0; + bitC->bitPos = 0; + bitC->startPtr = (char*)startPtr; + bitC->ptr = bitC->startPtr; + bitC->endPtr = bitC->startPtr + dstCapacity - sizeof(bitC->bitContainer); + if (dstCapacity <= sizeof(bitC->bitContainer)) return ERROR(dstSize_tooSmall); + return 0; +} + +/*! BIT_addBits() : + * can add up to 31 bits into `bitC`. + * Note : does not check for register overflow ! */ +MEM_STATIC void BIT_addBits(BIT_CStream_t* bitC, + size_t value, unsigned nbBits) +{ + DEBUG_STATIC_ASSERT(BIT_MASK_SIZE == 32); + assert(nbBits < BIT_MASK_SIZE); + assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8); + bitC->bitContainer |= (value & BIT_mask[nbBits]) << bitC->bitPos; + bitC->bitPos += nbBits; +} + +/*! BIT_addBitsFast() : + * works only if `value` is _clean_, + * meaning all high bits above nbBits are 0 */ +MEM_STATIC void BIT_addBitsFast(BIT_CStream_t* bitC, + size_t value, unsigned nbBits) +{ + assert((value>>nbBits) == 0); + assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8); + bitC->bitContainer |= value << bitC->bitPos; + bitC->bitPos += nbBits; +} + +/*! BIT_flushBitsFast() : + * assumption : bitContainer has not overflowed + * unsafe version; does not check buffer overflow */ +MEM_STATIC void BIT_flushBitsFast(BIT_CStream_t* bitC) +{ + size_t const nbBytes = bitC->bitPos >> 3; + assert(bitC->bitPos < sizeof(bitC->bitContainer) * 8); + assert(bitC->ptr <= bitC->endPtr); + MEM_writeLEST(bitC->ptr, bitC->bitContainer); + bitC->ptr += nbBytes; + bitC->bitPos &= 7; + bitC->bitContainer >>= nbBytes*8; +} + +/*! BIT_flushBits() : + * assumption : bitContainer has not overflowed + * safe version; check for buffer overflow, and prevents it. + * note : does not signal buffer overflow. + * overflow will be revealed later on using BIT_closeCStream() */ +MEM_STATIC void BIT_flushBits(BIT_CStream_t* bitC) +{ + size_t const nbBytes = bitC->bitPos >> 3; + assert(bitC->bitPos < sizeof(bitC->bitContainer) * 8); + assert(bitC->ptr <= bitC->endPtr); + MEM_writeLEST(bitC->ptr, bitC->bitContainer); + bitC->ptr += nbBytes; + if (bitC->ptr > bitC->endPtr) bitC->ptr = bitC->endPtr; + bitC->bitPos &= 7; + bitC->bitContainer >>= nbBytes*8; +} + +/*! BIT_closeCStream() : + * @return : size of CStream, in bytes, + * or 0 if it could not fit into dstBuffer */ +MEM_STATIC size_t BIT_closeCStream(BIT_CStream_t* bitC) +{ + BIT_addBitsFast(bitC, 1, 1); /* endMark */ + BIT_flushBits(bitC); + if (bitC->ptr >= bitC->endPtr) return 0; /* overflow detected */ + return (bitC->ptr - bitC->startPtr) + (bitC->bitPos > 0); +} + + +/*-******************************************************** +* bitStream decoding +**********************************************************/ +/*! BIT_initDStream() : + * Initialize a BIT_DStream_t. + * `bitD` : a pointer to an already allocated BIT_DStream_t structure. + * `srcSize` must be the *exact* size of the bitStream, in bytes. + * @return : size of stream (== srcSize), or an errorCode if a problem is detected + */ +MEM_STATIC size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize) +{ + if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); } + + bitD->start = (const char*)srcBuffer; + bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer); + + if (srcSize >= sizeof(bitD->bitContainer)) { /* normal case */ + bitD->ptr = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer); + bitD->bitContainer = MEM_readLEST(bitD->ptr); + { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1]; + bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0; /* ensures bitsConsumed is always set */ + if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ } + } else { + bitD->ptr = bitD->start; + bitD->bitContainer = *(const BYTE*)(bitD->start); + switch(srcSize) + { + case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16); + ZSTD_FALLTHROUGH; + + case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24); + ZSTD_FALLTHROUGH; + + case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32); + ZSTD_FALLTHROUGH; + + case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24; + ZSTD_FALLTHROUGH; + + case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16; + ZSTD_FALLTHROUGH; + + case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) << 8; + ZSTD_FALLTHROUGH; + + default: break; + } + { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1]; + bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0; + if (lastByte == 0) return ERROR(corruption_detected); /* endMark not present */ + } + bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8; + } + + return srcSize; +} + +MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getUpperBits(size_t bitContainer, U32 const start) +{ + return bitContainer >> start; +} + +MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getMiddleBits(size_t bitContainer, U32 const start, U32 const nbBits) +{ + U32 const regMask = sizeof(bitContainer)*8 - 1; + /* if start > regMask, bitstream is corrupted, and result is undefined */ + assert(nbBits < BIT_MASK_SIZE); + /* x86 transform & ((1 << nbBits) - 1) to bzhi instruction, it is better + * than accessing memory. When bmi2 instruction is not present, we consider + * such cpus old (pre-Haswell, 2013) and their performance is not of that + * importance. + */ +#if defined(__x86_64__) || defined(_M_X86) + return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1); +#else + return (bitContainer >> (start & regMask)) & BIT_mask[nbBits]; +#endif +} + +MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getLowerBits(size_t bitContainer, U32 const nbBits) +{ +#if defined(STATIC_BMI2) && STATIC_BMI2 == 1 + return _bzhi_u64(bitContainer, nbBits); +#else + assert(nbBits < BIT_MASK_SIZE); + return bitContainer & BIT_mask[nbBits]; +#endif +} + +/*! BIT_lookBits() : + * Provides next n bits from local register. + * local register is not modified. + * On 32-bits, maxNbBits==24. + * On 64-bits, maxNbBits==56. + * @return : value extracted */ +MEM_STATIC FORCE_INLINE_ATTR size_t BIT_lookBits(const BIT_DStream_t* bitD, U32 nbBits) +{ + /* arbitrate between double-shift and shift+mask */ +#if 1 + /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8, + * bitstream is likely corrupted, and result is undefined */ + return BIT_getMiddleBits(bitD->bitContainer, (sizeof(bitD->bitContainer)*8) - bitD->bitsConsumed - nbBits, nbBits); +#else + /* this code path is slower on my os-x laptop */ + U32 const regMask = sizeof(bitD->bitContainer)*8 - 1; + return ((bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> 1) >> ((regMask-nbBits) & regMask); +#endif +} + +/*! BIT_lookBitsFast() : + * unsafe version; only works if nbBits >= 1 */ +MEM_STATIC size_t BIT_lookBitsFast(const BIT_DStream_t* bitD, U32 nbBits) +{ + U32 const regMask = sizeof(bitD->bitContainer)*8 - 1; + assert(nbBits >= 1); + return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask); +} + +MEM_STATIC FORCE_INLINE_ATTR void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits) +{ + bitD->bitsConsumed += nbBits; +} + +/*! BIT_readBits() : + * Read (consume) next n bits from local register and update. + * Pay attention to not read more than nbBits contained into local register. + * @return : extracted value. */ +MEM_STATIC FORCE_INLINE_ATTR size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits) +{ + size_t const value = BIT_lookBits(bitD, nbBits); + BIT_skipBits(bitD, nbBits); + return value; +} + +/*! BIT_readBitsFast() : + * unsafe version; only works only if nbBits >= 1 */ +MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits) +{ + size_t const value = BIT_lookBitsFast(bitD, nbBits); + assert(nbBits >= 1); + BIT_skipBits(bitD, nbBits); + return value; +} + +/*! BIT_reloadDStreamFast() : + * Similar to BIT_reloadDStream(), but with two differences: + * 1. bitsConsumed <= sizeof(bitD->bitContainer)*8 must hold! + * 2. Returns BIT_DStream_overflow when bitD->ptr < bitD->limitPtr, at this + * point you must use BIT_reloadDStream() to reload. + */ +MEM_STATIC BIT_DStream_status BIT_reloadDStreamFast(BIT_DStream_t* bitD) +{ + if (UNLIKELY(bitD->ptr < bitD->limitPtr)) + return BIT_DStream_overflow; + assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8); + bitD->ptr -= bitD->bitsConsumed >> 3; + bitD->bitsConsumed &= 7; + bitD->bitContainer = MEM_readLEST(bitD->ptr); + return BIT_DStream_unfinished; +} + +/*! BIT_reloadDStream() : + * Refill `bitD` from buffer previously set in BIT_initDStream() . + * This function is safe, it guarantees it will not read beyond src buffer. + * @return : status of `BIT_DStream_t` internal register. + * when status == BIT_DStream_unfinished, internal register is filled with at least 25 or 57 bits */ +MEM_STATIC BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD) +{ + if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8)) /* overflow detected, like end of stream */ + return BIT_DStream_overflow; + + if (bitD->ptr >= bitD->limitPtr) { + return BIT_reloadDStreamFast(bitD); + } + if (bitD->ptr == bitD->start) { + if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer; + return BIT_DStream_completed; + } + /* start < ptr < limitPtr */ + { U32 nbBytes = bitD->bitsConsumed >> 3; + BIT_DStream_status result = BIT_DStream_unfinished; + if (bitD->ptr - nbBytes < bitD->start) { + nbBytes = (U32)(bitD->ptr - bitD->start); /* ptr > start */ + result = BIT_DStream_endOfBuffer; + } + bitD->ptr -= nbBytes; + bitD->bitsConsumed -= nbBytes*8; + bitD->bitContainer = MEM_readLEST(bitD->ptr); /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */ + return result; + } +} + +/*! BIT_endOfDStream() : + * @return : 1 if DStream has _exactly_ reached its end (all bits consumed). + */ +MEM_STATIC unsigned BIT_endOfDStream(const BIT_DStream_t* DStream) +{ + return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8)); +} + + +#endif /* BITSTREAM_H_MODULE */ diff --git a/src/bled/fse_decompress.c b/src/bled/fse_decompress.c new file mode 100644 index 00000000..610898e8 --- /dev/null +++ b/src/bled/fse_decompress.c @@ -0,0 +1,390 @@ +/* ****************************************************************** + * FSE : Finite State Entropy decoder + * Copyright (c) Yann Collet, Facebook, Inc. + * + * You can contact the author at : + * - FSE source repository : https://github.com/Cyan4973/FiniteStateEntropy + * - Public forum : https://groups.google.com/forum/#!forum/lz4c + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. +****************************************************************** */ + + +/* ************************************************************** +* Includes +****************************************************************/ +//#include "debug.h" /* assert */ +#include "fse_bitstream.h" +#include "zstd_compiler.h" +#define FSE_STATIC_LINKING_ONLY +#include "fse.h" +#include "zstd_error_private.h" +#define ZSTD_DEPS_NEED_MALLOC +#include "zstd_deps.h" + + +/* ************************************************************** +* Error Management +****************************************************************/ +#define FSE_isError ERR_isError +#define FSE_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c) /* use only *after* variable declarations */ + + +/* ************************************************************** +* Templates +****************************************************************/ +/* + designed to be included + for type-specific functions (template emulation in C) + Objective is to write these functions only once, for improved maintenance +*/ + +/* safety checks */ +#ifndef FSE_FUNCTION_EXTENSION +# error "FSE_FUNCTION_EXTENSION must be defined" +#endif +#ifndef FSE_FUNCTION_TYPE +# error "FSE_FUNCTION_TYPE must be defined" +#endif + +/* Function names */ +#define FSE_CAT(X,Y) X##Y +#define FSE_FUNCTION_NAME(X,Y) FSE_CAT(X,Y) +#define FSE_TYPE_NAME(X,Y) FSE_CAT(X,Y) + + +/* Function templates */ +FSE_DTable* FSE_createDTable (unsigned tableLog) +{ + if (tableLog > FSE_TABLELOG_ABSOLUTE_MAX) tableLog = FSE_TABLELOG_ABSOLUTE_MAX; + return (FSE_DTable*)ZSTD_malloc( FSE_DTABLE_SIZE_U32(tableLog) * sizeof (U32) ); +} + +void FSE_freeDTable (FSE_DTable* dt) +{ + ZSTD_free(dt); +} + +static size_t FSE_buildDTable_internal(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize) +{ + void* const tdPtr = dt+1; /* because *dt is unsigned, 32-bits aligned on 32-bits */ + FSE_DECODE_TYPE* const tableDecode = (FSE_DECODE_TYPE*) (tdPtr); + U16* symbolNext = (U16*)workSpace; + BYTE* spread = (BYTE*)(symbolNext + maxSymbolValue + 1); + + U32 const maxSV1 = maxSymbolValue + 1; + U32 const tableSize = 1 << tableLog; + U32 highThreshold = tableSize-1; + + /* Sanity Checks */ + if (FSE_BUILD_DTABLE_WKSP_SIZE(tableLog, maxSymbolValue) > wkspSize) return ERROR(maxSymbolValue_tooLarge); + if (maxSymbolValue > FSE_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge); + if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge); + + /* Init, lay down lowprob symbols */ + { FSE_DTableHeader DTableH; + DTableH.tableLog = (U16)tableLog; + DTableH.fastMode = 1; + { S16 const largeLimit= (S16)(1 << (tableLog-1)); + U32 s; + for (s=0; s<maxSV1; s++) { + if (normalizedCounter[s]==-1) { + tableDecode[highThreshold--].symbol = (FSE_FUNCTION_TYPE)s; + symbolNext[s] = 1; + } else { + if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0; + symbolNext[s] = normalizedCounter[s]; + } } } + ZSTD_memcpy(dt, &DTableH, sizeof(DTableH)); + } + + /* Spread symbols */ + if (highThreshold == tableSize - 1) { + size_t const tableMask = tableSize-1; + size_t const step = FSE_TABLESTEP(tableSize); + /* First lay down the symbols in order. + * We use a uint64_t to lay down 8 bytes at a time. This reduces branch + * misses since small blocks generally have small table logs, so nearly + * all symbols have counts <= 8. We ensure we have 8 bytes at the end of + * our buffer to handle the over-write. + */ + { + U64 const add = 0x0101010101010101ull; + size_t pos = 0; + U64 sv = 0; + U32 s; + for (s=0; s<maxSV1; ++s, sv += add) { + int i; + int const n = normalizedCounter[s]; + MEM_write64(spread + pos, sv); + for (i = 8; i < n; i += 8) { + MEM_write64(spread + pos + i, sv); + } + pos += n; + } + } + /* Now we spread those positions across the table. + * The benefit of doing it in two stages is that we avoid the the + * variable size inner loop, which caused lots of branch misses. + * Now we can run through all the positions without any branch misses. + * We unroll the loop twice, since that is what emperically worked best. + */ + { + size_t position = 0; + size_t s; + size_t const unroll = 2; + assert(tableSize % unroll == 0); /* FSE_MIN_TABLELOG is 5 */ + for (s = 0; s < (size_t)tableSize; s += unroll) { + size_t u; + for (u = 0; u < unroll; ++u) { + size_t const uPosition = (position + (u * step)) & tableMask; + tableDecode[uPosition].symbol = spread[s + u]; + } + position = (position + (unroll * step)) & tableMask; + } + assert(position == 0); + } + } else { + U32 const tableMask = tableSize-1; + U32 const step = FSE_TABLESTEP(tableSize); + U32 s, position = 0; + for (s=0; s<maxSV1; s++) { + int i; + for (i=0; i<normalizedCounter[s]; i++) { + tableDecode[position].symbol = (FSE_FUNCTION_TYPE)s; + position = (position + step) & tableMask; + while (position > highThreshold) position = (position + step) & tableMask; /* lowprob area */ + } } + if (position!=0) return ERROR(GENERIC); /* position must reach all cells once, otherwise normalizedCounter is incorrect */ + } + + /* Build Decoding table */ + { U32 u; + for (u=0; u<tableSize; u++) { + FSE_FUNCTION_TYPE const symbol = (FSE_FUNCTION_TYPE)(tableDecode[u].symbol); + U32 const nextState = symbolNext[symbol]++; + tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) ); + tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize); + } } + + return 0; +} + +size_t FSE_buildDTable_wksp(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize) +{ + return FSE_buildDTable_internal(dt, normalizedCounter, maxSymbolValue, tableLog, workSpace, wkspSize); +} + + +#ifndef FSE_COMMONDEFS_ONLY + +/*-******************************************************* +* Decompression (Byte symbols) +*********************************************************/ +size_t FSE_buildDTable_rle (FSE_DTable* dt, BYTE symbolValue) +{ + void* ptr = dt; + FSE_DTableHeader* const DTableH = (FSE_DTableHeader*)ptr; + void* dPtr = dt + 1; + FSE_decode_t* const cell = (FSE_decode_t*)dPtr; + + DTableH->tableLog = 0; + DTableH->fastMode = 0; + + cell->newState = 0; + cell->symbol = symbolValue; + cell->nbBits = 0; + + return 0; +} + + +size_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits) +{ + void* ptr = dt; + FSE_DTableHeader* const DTableH = (FSE_DTableHeader*)ptr; + void* dPtr = dt + 1; + FSE_decode_t* const dinfo = (FSE_decode_t*)dPtr; + const unsigned tableSize = 1 << nbBits; + const unsigned tableMask = tableSize - 1; + const unsigned maxSV1 = tableMask+1; + unsigned s; + + /* Sanity checks */ + if (nbBits < 1) return ERROR(GENERIC); /* min size */ + + /* Build Decoding Table */ + DTableH->tableLog = (U16)nbBits; + DTableH->fastMode = 1; + for (s=0; s<maxSV1; s++) { + dinfo[s].newState = 0; + dinfo[s].symbol = (BYTE)s; + dinfo[s].nbBits = (BYTE)nbBits; + } + + return 0; +} + +FORCE_INLINE_TEMPLATE size_t FSE_decompress_usingDTable_generic( + void* dst, size_t maxDstSize, + const void* cSrc, size_t cSrcSize, + const FSE_DTable* dt, const unsigned fast) +{ + BYTE* const ostart = (BYTE*) dst; + BYTE* op = ostart; + BYTE* const omax = op + maxDstSize; + BYTE* const olimit = omax-3; + + BIT_DStream_t bitD; + FSE_DState_t state1; + FSE_DState_t state2; + + /* Init */ + CHECK_F(BIT_initDStream(&bitD, cSrc, cSrcSize)); + + FSE_initDState(&state1, &bitD, dt); + FSE_initDState(&state2, &bitD, dt); + +#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD) + + /* 4 symbols per loop */ + for ( ; (BIT_reloadDStream(&bitD)==BIT_DStream_unfinished) & (op<olimit) ; op+=4) { + op[0] = FSE_GETSYMBOL(&state1); + + if (FSE_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8) /* This test must be static */ + BIT_reloadDStream(&bitD); + + op[1] = FSE_GETSYMBOL(&state2); + + if (FSE_MAX_TABLELOG*4+7 > sizeof(bitD.bitContainer)*8) /* This test must be static */ + { if (BIT_reloadDStream(&bitD) > BIT_DStream_unfinished) { op+=2; break; } } + + op[2] = FSE_GETSYMBOL(&state1); + + if (FSE_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8) /* This test must be static */ + BIT_reloadDStream(&bitD); + + op[3] = FSE_GETSYMBOL(&state2); + } + + /* tail */ + /* note : BIT_reloadDStream(&bitD) >= FSE_DStream_partiallyFilled; Ends at exactly BIT_DStream_completed */ + while (1) { + if (op>(omax-2)) return ERROR(dstSize_tooSmall); + *op++ = FSE_GETSYMBOL(&state1); + if (BIT_reloadDStream(&bitD)==BIT_DStream_overflow) { + *op++ = FSE_GETSYMBOL(&state2); + break; + } + + if (op>(omax-2)) return ERROR(dstSize_tooSmall); + *op++ = FSE_GETSYMBOL(&state2); + if (BIT_reloadDStream(&bitD)==BIT_DStream_overflow) { + *op++ = FSE_GETSYMBOL(&state1); + break; + } } + + return op-ostart; +} + + +size_t FSE_decompress_usingDTable(void* dst, size_t originalSize, + const void* cSrc, size_t cSrcSize, + const FSE_DTable* dt) +{ + const void* ptr = dt; + const FSE_DTableHeader* DTableH = (const FSE_DTableHeader*)ptr; + const U32 fastMode = DTableH->fastMode; + + /* select fast mode (static) */ + if (fastMode) return FSE_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 1); + return FSE_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 0); +} + + +size_t FSE_decompress_wksp(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize) +{ + return FSE_decompress_wksp_bmi2(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize, /* bmi2 */ 0); +} + +typedef struct { + short ncount[FSE_MAX_SYMBOL_VALUE + 1]; + FSE_DTable dtable[1]; /* Dynamically sized */ +} FSE_DecompressWksp; + + +FORCE_INLINE_TEMPLATE size_t FSE_decompress_wksp_body( + void* dst, size_t dstCapacity, + const void* cSrc, size_t cSrcSize, + unsigned maxLog, void* workSpace, size_t wkspSize, + int bmi2) +{ + const BYTE* const istart = (const BYTE*)cSrc; + const BYTE* ip = istart; + unsigned tableLog; + unsigned maxSymbolValue = FSE_MAX_SYMBOL_VALUE; + FSE_DecompressWksp* const wksp = (FSE_DecompressWksp*)workSpace; + + DEBUG_STATIC_ASSERT((FSE_MAX_SYMBOL_VALUE + 1) % 2 == 0); + if (wkspSize < sizeof(*wksp)) return ERROR(GENERIC); + + /* normal FSE decoding mode */ + { + size_t const NCountLength = FSE_readNCount_bmi2(wksp->ncount, &maxSymbolValue, &tableLog, istart, cSrcSize, bmi2); + if (FSE_isError(NCountLength)) return NCountLength; + if (tableLog > maxLog) return ERROR(tableLog_tooLarge); + assert(NCountLength <= cSrcSize); + ip += NCountLength; + cSrcSize -= NCountLength; + } + + if (FSE_DECOMPRESS_WKSP_SIZE(tableLog, maxSymbolValue) > wkspSize) return ERROR(tableLog_tooLarge); + workSpace = wksp->dtable + FSE_DTABLE_SIZE_U32(tableLog); + wkspSize -= sizeof(*wksp) + FSE_DTABLE_SIZE(tableLog); + + CHECK_F( FSE_buildDTable_internal(wksp->dtable, wksp->ncount, maxSymbolValue, tableLog, workSpace, wkspSize) ); + + { + const void* ptr = wksp->dtable; + const FSE_DTableHeader* DTableH = (const FSE_DTableHeader*)ptr; + const U32 fastMode = DTableH->fastMode; + + /* select fast mode (static) */ + if (fastMode) return FSE_decompress_usingDTable_generic(dst, dstCapacity, ip, cSrcSize, wksp->dtable, 1); + return FSE_decompress_usingDTable_generic(dst, dstCapacity, ip, cSrcSize, wksp->dtable, 0); + } +} + +/* Avoids the FORCE_INLINE of the _body() function. */ +static size_t FSE_decompress_wksp_body_default(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize) +{ + return FSE_decompress_wksp_body(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize, 0); +} + +#if DYNAMIC_BMI2 +TARGET_ATTRIBUTE("bmi2") static size_t FSE_decompress_wksp_body_bmi2(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize) +{ + return FSE_decompress_wksp_body(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize, 1); +} +#endif + +size_t FSE_decompress_wksp_bmi2(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize, int bmi2) +{ +#if DYNAMIC_BMI2 + if (bmi2) { + return FSE_decompress_wksp_body_bmi2(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize); + } +#endif + (void)bmi2; + return FSE_decompress_wksp_body_default(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize); +} + + +typedef FSE_DTable DTable_max_t[FSE_DTABLE_SIZE_U32(FSE_MAX_TABLELOG)]; + + + +#endif /* FSE_COMMONDEFS_ONLY */ diff --git a/src/bled/huf.h b/src/bled/huf.h new file mode 100644 index 00000000..91e33c54 --- /dev/null +++ b/src/bled/huf.h @@ -0,0 +1,344 @@ +/* ****************************************************************** + * huff0 huffman codec, + * part of Finite State Entropy library + * Copyright (c) Yann Collet, Facebook, Inc. + * + * You can contact the author at : + * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. +****************************************************************** */ + + +#ifndef HUF_H_298734234 +#define HUF_H_298734234 + +/* *** Dependencies *** */ +#include "zstd_deps.h" /* size_t */ + +# define HUF_PUBLIC_API + +/* ========================== */ +/* *** simple functions *** */ +/* ========================== */ + +/** HUF_compress() : + * Compress content from buffer 'src', of size 'srcSize', into buffer 'dst'. + * 'dst' buffer must be already allocated. + * Compression runs faster if `dstCapacity` >= HUF_compressBound(srcSize). + * `srcSize` must be <= `HUF_BLOCKSIZE_MAX` == 128 KB. + * @return : size of compressed data (<= `dstCapacity`). + * Special values : if return == 0, srcData is not compressible => Nothing is stored within dst !!! + * if HUF_isError(return), compression failed (more details using HUF_getErrorName()) + */ +HUF_PUBLIC_API size_t HUF_compress(void* dst, size_t dstCapacity, + const void* src, size_t srcSize); + +/** HUF_decompress() : + * Decompress HUF data from buffer 'cSrc', of size 'cSrcSize', + * into already allocated buffer 'dst', of minimum size 'dstSize'. + * `originalSize` : **must** be the ***exact*** size of original (uncompressed) data. + * Note : in contrast with FSE, HUF_decompress can regenerate + * RLE (cSrcSize==1) and uncompressed (cSrcSize==dstSize) data, + * because it knows size to regenerate (originalSize). + * @return : size of regenerated data (== originalSize), + * or an error code, which can be tested using HUF_isError() + */ +HUF_PUBLIC_API size_t HUF_decompress(void* dst, size_t originalSize, + const void* cSrc, size_t cSrcSize); + + +/* *** Tool functions *** */ +#define HUF_BLOCKSIZE_MAX (128 * 1024) /**< maximum input size for a single block compressed with HUF_compress */ +HUF_PUBLIC_API size_t HUF_compressBound(size_t size); /**< maximum compressed size (worst case) */ + +/* Error Management */ +HUF_PUBLIC_API unsigned HUF_isError(size_t code); /**< tells if a return value is an error code */ +HUF_PUBLIC_API const char* HUF_getErrorName(size_t code); /**< provides error code string (useful for debugging) */ + + +/* *** Advanced function *** */ + +/** HUF_compress2() : + * Same as HUF_compress(), but offers control over `maxSymbolValue` and `tableLog`. + * `maxSymbolValue` must be <= HUF_SYMBOLVALUE_MAX . + * `tableLog` must be `<= HUF_TABLELOG_MAX` . */ +HUF_PUBLIC_API size_t HUF_compress2 (void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + unsigned maxSymbolValue, unsigned tableLog); + +/** HUF_compress4X_wksp() : + * Same as HUF_compress2(), but uses externally allocated `workSpace`. + * `workspace` must be at least as large as HUF_WORKSPACE_SIZE */ +#define HUF_WORKSPACE_SIZE ((8 << 10) + 512 /* sorting scratch space */) +#define HUF_WORKSPACE_SIZE_U64 (HUF_WORKSPACE_SIZE / sizeof(U64)) +HUF_PUBLIC_API size_t HUF_compress4X_wksp (void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + unsigned maxSymbolValue, unsigned tableLog, + void* workSpace, size_t wkspSize); + +#endif /* HUF_H_298734234 */ + +/* ****************************************************************** + * WARNING !! + * The following section contains advanced and experimental definitions + * which shall never be used in the context of a dynamic library, + * because they are not guaranteed to remain stable in the future. + * Only consider them in association with static linking. + * *****************************************************************/ +#if !defined(HUF_H_HUF_STATIC_LINKING_ONLY) +#define HUF_H_HUF_STATIC_LINKING_ONLY + +/* *** Dependencies *** */ +#include "zstd_mem.h" /* U32 */ +#define FSE_STATIC_LINKING_ONLY +#include "fse.h" + + +/* *** Constants *** */ +#define HUF_TABLELOG_MAX 12 /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */ +#define HUF_TABLELOG_DEFAULT 11 /* default tableLog value when none specified */ +#define HUF_SYMBOLVALUE_MAX 255 + +#define HUF_TABLELOG_ABSOLUTEMAX 12 /* absolute limit of HUF_MAX_TABLELOG. Beyond that value, code does not work */ +#if (HUF_TABLELOG_MAX > HUF_TABLELOG_ABSOLUTEMAX) +# error "HUF_TABLELOG_MAX is too large !" +#endif + + +/* **************************************** +* Static allocation +******************************************/ +/* HUF buffer bounds */ +#define HUF_CTABLEBOUND 129 +#define HUF_BLOCKBOUND(size) (size + (size>>8) + 8) /* only true when incompressible is pre-filtered with fast heuristic */ +#define HUF_COMPRESSBOUND(size) (HUF_CTABLEBOUND + HUF_BLOCKBOUND(size)) /* Macro version, useful for static allocation */ + +/* static allocation of HUF's Compression Table */ +/* this is a private definition, just exposed for allocation and strict aliasing purpose. never EVER access its members directly */ +typedef size_t HUF_CElt; /* consider it an incomplete type */ +#define HUF_CTABLE_SIZE_ST(maxSymbolValue) ((maxSymbolValue)+2) /* Use tables of size_t, for proper alignment */ +#define HUF_CTABLE_SIZE(maxSymbolValue) (HUF_CTABLE_SIZE_ST(maxSymbolValue) * sizeof(size_t)) +#define HUF_CREATE_STATIC_CTABLE(name, maxSymbolValue) \ + HUF_CElt name[HUF_CTABLE_SIZE_ST(maxSymbolValue)] /* no final ; */ + +/* static allocation of HUF's DTable */ +typedef U32 HUF_DTable; +#define HUF_DTABLE_SIZE(maxTableLog) (1 + (1<<(maxTableLog))) +#define HUF_CREATE_STATIC_DTABLEX1(DTable, maxTableLog) \ + HUF_DTable DTable[HUF_DTABLE_SIZE((maxTableLog)-1)] = { ((U32)((maxTableLog)-1) * 0x01000001) } +#define HUF_CREATE_STATIC_DTABLEX2(DTable, maxTableLog) \ + HUF_DTable DTable[HUF_DTABLE_SIZE(maxTableLog)] = { ((U32)(maxTableLog) * 0x01000001) } + + +/* **************************************** +* Advanced decompression functions +******************************************/ +HUF_PUBLIC_API size_t HUF_decompress4X1(void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< single-symbol decoder */ +#ifndef HUF_FORCE_DECOMPRESS_X1 +HUF_PUBLIC_API size_t HUF_decompress4X2(void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< double-symbols decoder */ +#endif + +HUF_PUBLIC_API size_t HUF_decompress4X_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< decodes RLE and uncompressed */ +HUF_PUBLIC_API size_t HUF_decompress4X_hufOnly(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< considers RLE and uncompressed as errors */ +HUF_PUBLIC_API size_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< considers RLE and uncompressed as errors */ +HUF_PUBLIC_API size_t HUF_decompress4X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< single-symbol decoder */ +HUF_PUBLIC_API size_t HUF_decompress4X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< single-symbol decoder */ +#ifndef HUF_FORCE_DECOMPRESS_X1 +HUF_PUBLIC_API size_t HUF_decompress4X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< double-symbols decoder */ +HUF_PUBLIC_API size_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< double-symbols decoder */ +#endif + + +/* **************************************** + * HUF detailed API + * ****************************************/ + +/*! HUF_compress() does the following: + * 1. count symbol occurrence from source[] into table count[] using FSE_count() (exposed within "fse.h") + * 2. (optional) refine tableLog using HUF_optimalTableLog() + * 3. build Huffman table from count using HUF_buildCTable() + * 4. save Huffman table to memory buffer using HUF_writeCTable() + * 5. encode the data stream using HUF_compress4X_usingCTable() + * + * The following API allows targeting specific sub-functions for advanced tasks. + * For example, it's possible to compress several blocks using the same 'CTable', + * or to save and regenerate 'CTable' using external methods. + */ +HUF_PUBLIC_API unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue); +HUF_PUBLIC_API size_t HUF_buildCTable(HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue, unsigned maxNbBits); /* @return : maxNbBits; CTable and count can overlap. In which case, CTable will overwrite count content */ +HUF_PUBLIC_API size_t HUF_writeCTable(void* dst, size_t maxDstSize, const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog); +HUF_PUBLIC_API size_t HUF_writeCTable_wksp(void* dst, size_t maxDstSize, const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog, void* workspace, size_t workspaceSize); +HUF_PUBLIC_API size_t HUF_compress4X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable); +HUF_PUBLIC_API size_t HUF_compress4X_usingCTable_bmi2(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable, int bmi2); +HUF_PUBLIC_API size_t HUF_estimateCompressedSize(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue); +HUF_PUBLIC_API int HUF_validateCTable(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue); + +typedef enum { + HUF_repeat_none, /**< Cannot use the previous table */ + HUF_repeat_check, /**< Can use the previous table but it must be checked. Note : The previous table must have been constructed by HUF_compress{1, 4}X_repeat */ + HUF_repeat_valid /**< Can use the previous table and it is assumed to be valid */ + } HUF_repeat; +/** HUF_compress4X_repeat() : + * Same as HUF_compress4X_wksp(), but considers using hufTable if *repeat != HUF_repeat_none. + * If it uses hufTable it does not modify hufTable or repeat. + * If it doesn't, it sets *repeat = HUF_repeat_none, and it sets hufTable to the table used. + * If preferRepeat then the old table will always be used if valid. + * If suspectUncompressible then some sampling checks will be run to potentially skip huffman coding */ +HUF_PUBLIC_API size_t HUF_compress4X_repeat(void* dst, size_t dstSize, + const void* src, size_t srcSize, + unsigned maxSymbolValue, unsigned tableLog, + void* workSpace, size_t wkspSize, /**< `workSpace` must be aligned on 4-bytes boundaries, `wkspSize` must be >= HUF_WORKSPACE_SIZE */ + HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat, int bmi2, unsigned suspectUncompressible); + +/** HUF_buildCTable_wksp() : + * Same as HUF_buildCTable(), but using externally allocated scratch buffer. + * `workSpace` must be aligned on 4-bytes boundaries, and its size must be >= HUF_CTABLE_WORKSPACE_SIZE. + */ +#define HUF_CTABLE_WORKSPACE_SIZE_U32 (2*HUF_SYMBOLVALUE_MAX +1 +1) +#define HUF_CTABLE_WORKSPACE_SIZE (HUF_CTABLE_WORKSPACE_SIZE_U32 * sizeof(unsigned)) +HUF_PUBLIC_API size_t HUF_buildCTable_wksp(HUF_CElt* tree, + const unsigned* count, U32 maxSymbolValue, U32 maxNbBits, + void* workSpace, size_t wkspSize); + +/*! HUF_readStats() : + * Read compact Huffman tree, saved by HUF_writeCTable(). + * `huffWeight` is destination buffer. + * @return : size read from `src` , or an error Code . + * Note : Needed by HUF_readCTable() and HUF_readDTableXn() . */ +HUF_PUBLIC_API size_t HUF_readStats(BYTE* huffWeight, size_t hwSize, + U32* rankStats, U32* nbSymbolsPtr, U32* tableLogPtr, + const void* src, size_t srcSize); + +/*! HUF_readStats_wksp() : + * Same as HUF_readStats() but takes an external workspace which must be + * 4-byte aligned and its size must be >= HUF_READ_STATS_WORKSPACE_SIZE. + * If the CPU has BMI2 support, pass bmi2=1, otherwise pass bmi2=0. + */ +#define HUF_READ_STATS_WORKSPACE_SIZE_U32 FSE_DECOMPRESS_WKSP_SIZE_U32(6, HUF_TABLELOG_MAX-1) +#define HUF_READ_STATS_WORKSPACE_SIZE (HUF_READ_STATS_WORKSPACE_SIZE_U32 * sizeof(unsigned)) +HUF_PUBLIC_API size_t HUF_readStats_wksp(BYTE* huffWeight, size_t hwSize, + U32* rankStats, U32* nbSymbolsPtr, U32* tableLogPtr, + const void* src, size_t srcSize, + void* workspace, size_t wkspSize, + int bmi2); + +/** HUF_readCTable() : + * Loading a CTable saved with HUF_writeCTable() */ +HUF_PUBLIC_API size_t HUF_readCTable(HUF_CElt* CTable, unsigned* maxSymbolValuePtr, const void* src, size_t srcSize, unsigned *hasZeroWeights); + +/** HUF_getNbBitsFromCTable() : + * Read nbBits from CTable symbolTable, for symbol `symbolValue` presumed <= HUF_SYMBOLVALUE_MAX + * Note 1 : is not inlined, as HUF_CElt definition is private */ +HUF_PUBLIC_API U32 HUF_getNbBitsFromCTable(const HUF_CElt* symbolTable, U32 symbolValue); + +/* + * HUF_decompress() does the following: + * 1. select the decompression algorithm (X1, X2) based on pre-computed heuristics + * 2. build Huffman table from save, using HUF_readDTableX?() + * 3. decode 1 or 4 segments in parallel using HUF_decompress?X?_usingDTable() + */ + +/** HUF_selectDecoder() : + * Tells which decoder is likely to decode faster, + * based on a set of pre-computed metrics. + * @return : 0==HUF_decompress4X1, 1==HUF_decompress4X2 . + * Assumption : 0 < dstSize <= 128 KB */ +HUF_PUBLIC_API U32 HUF_selectDecoder(size_t dstSize, size_t cSrcSize); + +/** + * The minimum workspace size for the `workSpace` used in + * HUF_readDTableX1_wksp() and HUF_readDTableX2_wksp(). + * + * The space used depends on HUF_TABLELOG_MAX, ranging from ~1500 bytes when + * HUF_TABLE_LOG_MAX=12 to ~1850 bytes when HUF_TABLE_LOG_MAX=15. + * Buffer overflow errors may potentially occur if code modifications result in + * a required workspace size greater than that specified in the following + * macro. + */ +#define HUF_DECOMPRESS_WORKSPACE_SIZE ((2 << 10) + (1 << 9)) +#define HUF_DECOMPRESS_WORKSPACE_SIZE_U32 (HUF_DECOMPRESS_WORKSPACE_SIZE / sizeof(U32)) + +#ifndef HUF_FORCE_DECOMPRESS_X2 +HUF_PUBLIC_API size_t HUF_readDTableX1(HUF_DTable* DTable, const void* src, size_t srcSize); +HUF_PUBLIC_API size_t HUF_readDTableX1_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize); +#endif +#ifndef HUF_FORCE_DECOMPRESS_X1 +HUF_PUBLIC_API size_t HUF_readDTableX2(HUF_DTable* DTable, const void* src, size_t srcSize); +HUF_PUBLIC_API size_t HUF_readDTableX2_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize); +#endif + +HUF_PUBLIC_API size_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); +#ifndef HUF_FORCE_DECOMPRESS_X2 +HUF_PUBLIC_API size_t HUF_decompress4X1_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); +#endif +#ifndef HUF_FORCE_DECOMPRESS_X1 +HUF_PUBLIC_API size_t HUF_decompress4X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); +#endif + + +/* ====================== */ +/* single stream variants */ +/* ====================== */ + +HUF_PUBLIC_API size_t HUF_compress1X(void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog); +HUF_PUBLIC_API size_t HUF_compress1X_wksp(void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize); /**< `workSpace` must be a table of at least HUF_WORKSPACE_SIZE_U64 U64 */ +HUF_PUBLIC_API size_t HUF_compress1X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable); +HUF_PUBLIC_API size_t HUF_compress1X_usingCTable_bmi2(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable, int bmi2); +/** HUF_compress1X_repeat() : + * Same as HUF_compress1X_wksp(), but considers using hufTable if *repeat != HUF_repeat_none. + * If it uses hufTable it does not modify hufTable or repeat. + * If it doesn't, it sets *repeat = HUF_repeat_none, and it sets hufTable to the table used. + * If preferRepeat then the old table will always be used if valid. + * If suspectUncompressible then some sampling checks will be run to potentially skip huffman coding */ +HUF_PUBLIC_API size_t HUF_compress1X_repeat(void* dst, size_t dstSize, + const void* src, size_t srcSize, + unsigned maxSymbolValue, unsigned tableLog, + void* workSpace, size_t wkspSize, /**< `workSpace` must be aligned on 4-bytes boundaries, `wkspSize` must be >= HUF_WORKSPACE_SIZE */ + HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat, int bmi2, unsigned suspectUncompressible); + +HUF_PUBLIC_API size_t HUF_decompress1X1(void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /* single-symbol decoder */ +#ifndef HUF_FORCE_DECOMPRESS_X1 +HUF_PUBLIC_API size_t HUF_decompress1X2(void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /* double-symbol decoder */ +#endif + +HUF_PUBLIC_API size_t HUF_decompress1X_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); +HUF_PUBLIC_API size_t HUF_decompress1X_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); +#ifndef HUF_FORCE_DECOMPRESS_X2 +HUF_PUBLIC_API size_t HUF_decompress1X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< single-symbol decoder */ +HUF_PUBLIC_API size_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< single-symbol decoder */ +#endif +#ifndef HUF_FORCE_DECOMPRESS_X1 +HUF_PUBLIC_API size_t HUF_decompress1X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< double-symbols decoder */ +HUF_PUBLIC_API size_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< double-symbols decoder */ +#endif + +HUF_PUBLIC_API size_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); /**< automatic selection of sing or double symbol decoder, based on DTable */ +#ifndef HUF_FORCE_DECOMPRESS_X2 +HUF_PUBLIC_API size_t HUF_decompress1X1_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); +#endif +#ifndef HUF_FORCE_DECOMPRESS_X1 +HUF_PUBLIC_API size_t HUF_decompress1X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); +#endif + +/* BMI2 variants. + * If the CPU has BMI2 support, pass bmi2=1, otherwise pass bmi2=0. + */ +size_t HUF_decompress1X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2); +#ifndef HUF_FORCE_DECOMPRESS_X2 +HUF_PUBLIC_API size_t HUF_decompress1X1_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2); +#endif +HUF_PUBLIC_API size_t HUF_decompress4X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2); +size_t HUF_decompress4X_hufOnly_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2); +#ifndef HUF_FORCE_DECOMPRESS_X2 +HUF_PUBLIC_API size_t HUF_readDTableX1_wksp_bmi2(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int bmi2); +#endif +#ifndef HUF_FORCE_DECOMPRESS_X1 +HUF_PUBLIC_API size_t HUF_readDTableX2_wksp_bmi2(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int bmi2); +#endif + +#endif /* HUF_STATIC_LINKING_ONLY */ + diff --git a/src/bled/huf_decompress.c b/src/bled/huf_decompress.c new file mode 100644 index 00000000..5a019c7d --- /dev/null +++ b/src/bled/huf_decompress.c @@ -0,0 +1,1747 @@ +/* ****************************************************************** + * huff0 huffman decoder, + * part of Finite State Entropy library + * Copyright (c) Yann Collet, Facebook, Inc. + * + * You can contact the author at : + * - FSE+HUF source repository : https://github.com/Cyan4973/FiniteStateEntropy + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. +****************************************************************** */ + +/* ************************************************************** +* Dependencies +****************************************************************/ +#include "zstd_deps.h" /* ZSTD_memcpy, ZSTD_memset */ +#include "zstd_compiler.h" +#include "fse_bitstream.h" /* BIT_* */ +#include "fse.h" /* to compress headers */ +#define HUF_STATIC_LINKING_ONLY +#include "huf.h" +#include "zstd_error_private.h" +#include "zstd_internal.h" + +/* ************************************************************** +* Constants +****************************************************************/ + +#define HUF_DECODER_FAST_TABLELOG 11 + +/* ************************************************************** +* Macros +****************************************************************/ + +/* These two optional macros force the use one way or another of the two + * Huffman decompression implementations. You can't force in both directions + * at the same time. + */ +#if defined(HUF_FORCE_DECOMPRESS_X1) && \ + defined(HUF_FORCE_DECOMPRESS_X2) +#error "Cannot force the use of the X1 and X2 decoders at the same time!" +#endif + +# define HUF_ASM_SUPPORTED 0 + +/* HUF_DISABLE_ASM: Disables all ASM implementations. */ +#define HUF_ENABLE_ASM_X86_64_BMI2 0 + +#if HUF_ENABLE_ASM_X86_64_BMI2 && DYNAMIC_BMI2 +# define HUF_ASM_X86_64_BMI2_ATTRS TARGET_ATTRIBUTE("bmi2") +#else +# define HUF_ASM_X86_64_BMI2_ATTRS +#endif + +#define HUF_EXTERN_C +#define HUF_ASM_DECL HUF_EXTERN_C + +#if DYNAMIC_BMI2 || (HUF_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__)) +# define HUF_NEED_BMI2_FUNCTION 1 +#else +# define HUF_NEED_BMI2_FUNCTION 0 +#endif + +#if !(HUF_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__)) +# define HUF_NEED_DEFAULT_FUNCTION 1 +#else +# define HUF_NEED_DEFAULT_FUNCTION 0 +#endif + +/* ************************************************************** +* Error Management +****************************************************************/ +#define HUF_isError ERR_isError + + +/* ************************************************************** +* Byte alignment for workSpace management +****************************************************************/ +#define HUF_ALIGN(x, a) HUF_ALIGN_MASK((x), (a) - 1) +#define HUF_ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask)) + + +/* ************************************************************** +* BMI2 Variant Wrappers +****************************************************************/ +#if DYNAMIC_BMI2 + +#define HUF_DGEN(fn) \ + \ + static size_t fn##_default( \ + void* dst, size_t dstSize, \ + const void* cSrc, size_t cSrcSize, \ + const HUF_DTable* DTable) \ + { \ + return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable); \ + } \ + \ + static TARGET_ATTRIBUTE("bmi2") size_t fn##_bmi2( \ + void* dst, size_t dstSize, \ + const void* cSrc, size_t cSrcSize, \ + const HUF_DTable* DTable) \ + { \ + return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable); \ + } \ + \ + static size_t fn(void* dst, size_t dstSize, void const* cSrc, \ + size_t cSrcSize, HUF_DTable const* DTable, int bmi2) \ + { \ + if (bmi2) { \ + return fn##_bmi2(dst, dstSize, cSrc, cSrcSize, DTable); \ + } \ + return fn##_default(dst, dstSize, cSrc, cSrcSize, DTable); \ + } + +#else + +#define HUF_DGEN(fn) \ + static size_t fn(void* dst, size_t dstSize, void const* cSrc, \ + size_t cSrcSize, HUF_DTable const* DTable, int bmi2) \ + { \ + (void)bmi2; \ + return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable); \ + } + +#endif + + +/*-***************************/ +/* generic DTableDesc */ +/*-***************************/ +typedef struct { BYTE maxTableLog; BYTE tableType; BYTE tableLog; BYTE reserved; } DTableDesc; + +static DTableDesc HUF_getDTableDesc(const HUF_DTable* table) +{ + DTableDesc dtd; + ZSTD_memcpy(&dtd, table, sizeof(dtd)); + return dtd; +} + +#if HUF_ENABLE_ASM_X86_64_BMI2 + +static size_t HUF_initDStream(BYTE const* ip) { + BYTE const lastByte = ip[7]; + size_t const bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0; + size_t const value = MEM_readLEST(ip) | 1; + assert(bitsConsumed <= 8); + return value << bitsConsumed; +} +typedef struct { + BYTE const* ip[4]; + BYTE* op[4]; + U64 bits[4]; + void const* dt; + BYTE const* ilimit; + BYTE* oend; + BYTE const* iend[4]; +} HUF_DecompressAsmArgs; + +/** + * Initializes args for the asm decoding loop. + * @returns 0 on success + * 1 if the fallback implementation should be used. + * Or an error code on failure. + */ +static size_t HUF_DecompressAsmArgs_init(HUF_DecompressAsmArgs* args, void* dst, size_t dstSize, void const* src, size_t srcSize, const HUF_DTable* DTable) +{ + void const* dt = DTable + 1; + U32 const dtLog = HUF_getDTableDesc(DTable).tableLog; + + const BYTE* const ilimit = (const BYTE*)src + 6 + 8; + + BYTE* const oend = (BYTE*)dst + dstSize; + + /* We're assuming x86-64 BMI2 - assure that this is the case. */ + assert(MEM_isLittleEndian() && !MEM_32bits()); + + /* strict minimum : jump table + 1 byte per stream */ + if (srcSize < 10) + return ERROR(corruption_detected); + + /* Must have at least 8 bytes per stream because we don't handle initializing smaller bit containers. + * If table log is not correct at this point, fallback to the old decoder. + * On small inputs we don't have enough data to trigger the fast loop, so use the old decoder. + */ + if (dtLog != HUF_DECODER_FAST_TABLELOG) + return 1; + + /* Read the jump table. */ + { + const BYTE* const istart = (const BYTE*)src; + size_t const length1 = MEM_readLE16(istart); + size_t const length2 = MEM_readLE16(istart+2); + size_t const length3 = MEM_readLE16(istart+4); + size_t const length4 = srcSize - (length1 + length2 + length3 + 6); + args->iend[0] = istart + 6; /* jumpTable */ + args->iend[1] = args->iend[0] + length1; + args->iend[2] = args->iend[1] + length2; + args->iend[3] = args->iend[2] + length3; + + /* HUF_initDStream() requires this, and this small of an input + * won't benefit from the ASM loop anyways. + * length1 must be >= 16 so that ip[0] >= ilimit before the loop + * starts. + */ + if (length1 < 16 || length2 < 8 || length3 < 8 || length4 < 8) + return 1; + if (length4 > srcSize) return ERROR(corruption_detected); /* overflow */ + } + /* ip[] contains the position that is currently loaded into bits[]. */ + args->ip[0] = args->iend[1] - sizeof(U64); + args->ip[1] = args->iend[2] - sizeof(U64); + args->ip[2] = args->iend[3] - sizeof(U64); + args->ip[3] = (BYTE const*)src + srcSize - sizeof(U64); + + /* op[] contains the output pointers. */ + args->op[0] = (BYTE*)dst; + args->op[1] = args->op[0] + (dstSize+3)/4; + args->op[2] = args->op[1] + (dstSize+3)/4; + args->op[3] = args->op[2] + (dstSize+3)/4; + + /* No point to call the ASM loop for tiny outputs. */ + if (args->op[3] >= oend) + return 1; + + /* bits[] is the bit container. + * It is read from the MSB down to the LSB. + * It is shifted left as it is read, and zeros are + * shifted in. After the lowest valid bit a 1 is + * set, so that CountTrailingZeros(bits[]) can be used + * to count how many bits we've consumed. + */ + args->bits[0] = HUF_initDStream(args->ip[0]); + args->bits[1] = HUF_initDStream(args->ip[1]); + args->bits[2] = HUF_initDStream(args->ip[2]); + args->bits[3] = HUF_initDStream(args->ip[3]); + + /* If ip[] >= ilimit, it is guaranteed to be safe to + * reload bits[]. It may be beyond its section, but is + * guaranteed to be valid (>= istart). + */ + args->ilimit = ilimit; + + args->oend = oend; + args->dt = dt; + + return 0; +} + +static size_t HUF_initRemainingDStream(BIT_DStream_t* bit, HUF_DecompressAsmArgs const* args, int stream, BYTE* segmentEnd) +{ + /* Validate that we haven't overwritten. */ + if (args->op[stream] > segmentEnd) + return ERROR(corruption_detected); + /* Validate that we haven't read beyond iend[]. + * Note that ip[] may be < iend[] because the MSB is + * the next bit to read, and we may have consumed 100% + * of the stream, so down to iend[i] - 8 is valid. + */ + if (args->ip[stream] < args->iend[stream] - 8) + return ERROR(corruption_detected); + + /* Construct the BIT_DStream_t. */ + bit->bitContainer = MEM_readLE64(args->ip[stream]); + bit->bitsConsumed = ZSTD_countTrailingZeros((size_t)args->bits[stream]); + bit->start = (const char*)args->iend[0]; + bit->limitPtr = bit->start + sizeof(size_t); + bit->ptr = (const char*)args->ip[stream]; + + return 0; +} +#endif + + +#ifndef HUF_FORCE_DECOMPRESS_X2 + +/*-***************************/ +/* single-symbol decoding */ +/*-***************************/ +typedef struct { BYTE nbBits; BYTE byte; } HUF_DEltX1; /* single-symbol decoding */ + +/** + * Packs 4 HUF_DEltX1 structs into a U64. This is used to lay down 4 entries at + * a time. + */ +static U64 HUF_DEltX1_set4(BYTE symbol, BYTE nbBits) { + U64 D4; + if (MEM_isLittleEndian()) { + D4 = (symbol << 8) + nbBits; + } else { + D4 = symbol + (nbBits << 8); + } + D4 *= 0x0001000100010001ULL; + return D4; +} + +/** + * Increase the tableLog to targetTableLog and rescales the stats. + * If tableLog > targetTableLog this is a no-op. + * @returns New tableLog + */ +static U32 HUF_rescaleStats(BYTE* huffWeight, U32* rankVal, U32 nbSymbols, U32 tableLog, U32 targetTableLog) +{ + if (tableLog > targetTableLog) + return tableLog; + if (tableLog < targetTableLog) { + U32 const scale = targetTableLog - tableLog; + U32 s; + /* Increase the weight for all non-zero probability symbols by scale. */ + for (s = 0; s < nbSymbols; ++s) { + huffWeight[s] += (BYTE)((huffWeight[s] == 0) ? 0 : scale); + } + /* Update rankVal to reflect the new weights. + * All weights except 0 get moved to weight + scale. + * Weights [1, scale] are empty. + */ + for (s = targetTableLog; s > scale; --s) { + rankVal[s] = rankVal[s - scale]; + } + for (s = scale; s > 0; --s) { + rankVal[s] = 0; + } + } + return targetTableLog; +} + +typedef struct { + U32 rankVal[HUF_TABLELOG_ABSOLUTEMAX + 1]; + U32 rankStart[HUF_TABLELOG_ABSOLUTEMAX + 1]; + U32 statsWksp[HUF_READ_STATS_WORKSPACE_SIZE_U32]; + BYTE symbols[HUF_SYMBOLVALUE_MAX + 1]; + BYTE huffWeight[HUF_SYMBOLVALUE_MAX + 1]; +} HUF_ReadDTableX1_Workspace; + + +size_t HUF_readDTableX1_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize) +{ + return HUF_readDTableX1_wksp_bmi2(DTable, src, srcSize, workSpace, wkspSize, /* bmi2 */ 0); +} + +size_t HUF_readDTableX1_wksp_bmi2(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int bmi2) +{ + U32 tableLog = 0; + U32 nbSymbols = 0; + size_t iSize; + void* const dtPtr = DTable + 1; + HUF_DEltX1* const dt = (HUF_DEltX1*)dtPtr; + HUF_ReadDTableX1_Workspace* wksp = (HUF_ReadDTableX1_Workspace*)workSpace; + + DEBUG_STATIC_ASSERT(HUF_DECOMPRESS_WORKSPACE_SIZE >= sizeof(*wksp)); + if (sizeof(*wksp) > wkspSize) return ERROR(tableLog_tooLarge); + + DEBUG_STATIC_ASSERT(sizeof(DTableDesc) == sizeof(HUF_DTable)); + /* ZSTD_memset(huffWeight, 0, sizeof(huffWeight)); */ /* is not necessary, even though some analyzer complain ... */ + + iSize = HUF_readStats_wksp(wksp->huffWeight, HUF_SYMBOLVALUE_MAX + 1, wksp->rankVal, &nbSymbols, &tableLog, src, srcSize, wksp->statsWksp, sizeof(wksp->statsWksp), bmi2); + if (HUF_isError(iSize)) return iSize; + + + /* Table header */ + { DTableDesc dtd = HUF_getDTableDesc(DTable); + U32 const maxTableLog = dtd.maxTableLog + 1; + U32 const targetTableLog = MIN(maxTableLog, HUF_DECODER_FAST_TABLELOG); + tableLog = HUF_rescaleStats(wksp->huffWeight, wksp->rankVal, nbSymbols, tableLog, targetTableLog); + if (tableLog > (U32)(dtd.maxTableLog+1)) return ERROR(tableLog_tooLarge); /* DTable too small, Huffman tree cannot fit in */ + dtd.tableType = 0; + dtd.tableLog = (BYTE)tableLog; + ZSTD_memcpy(DTable, &dtd, sizeof(dtd)); + } + + /* Compute symbols and rankStart given rankVal: + * + * rankVal already contains the number of values of each weight. + * + * symbols contains the symbols ordered by weight. First are the rankVal[0] + * weight 0 symbols, followed by the rankVal[1] weight 1 symbols, and so on. + * symbols[0] is filled (but unused) to avoid a branch. + * + * rankStart contains the offset where each rank belongs in the DTable. + * rankStart[0] is not filled because there are no entries in the table for + * weight 0. + */ + { + int n; + int nextRankStart = 0; + int const unroll = 4; + int const nLimit = (int)nbSymbols - unroll + 1; + for (n=0; n<(int)tableLog+1; n++) { + U32 const curr = nextRankStart; + nextRankStart += wksp->rankVal[n]; + wksp->rankStart[n] = curr; + } + for (n=0; n < nLimit; n += unroll) { + int u; + for (u=0; u < unroll; ++u) { + size_t const w = wksp->huffWeight[n+u]; + wksp->symbols[wksp->rankStart[w]++] = (BYTE)(n+u); + } + } + for (; n < (int)nbSymbols; ++n) { + size_t const w = wksp->huffWeight[n]; + wksp->symbols[wksp->rankStart[w]++] = (BYTE)n; + } + } + + /* fill DTable + * We fill all entries of each weight in order. + * That way length is a constant for each iteration of the outter loop. + * We can switch based on the length to a different inner loop which is + * optimized for that particular case. + */ + { + U32 w; + int symbol=wksp->rankVal[0]; + int rankStart=0; + for (w=1; w<tableLog+1; ++w) { + int const symbolCount = wksp->rankVal[w]; + int const length = (1 << w) >> 1; + int uStart = rankStart; + BYTE const nbBits = (BYTE)(tableLog + 1 - w); + int s; + int u; + switch (length) { + case 1: + for (s=0; s<symbolCount; ++s) { + HUF_DEltX1 D; + D.byte = wksp->symbols[symbol + s]; + D.nbBits = nbBits; + dt[uStart] = D; + uStart += 1; + } + break; + case 2: + for (s=0; s<symbolCount; ++s) { + HUF_DEltX1 D; + D.byte = wksp->symbols[symbol + s]; + D.nbBits = nbBits; + dt[uStart+0] = D; + dt[uStart+1] = D; + uStart += 2; + } + break; + case 4: + for (s=0; s<symbolCount; ++s) { + U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits); + MEM_write64(dt + uStart, D4); + uStart += 4; + } + break; + case 8: + for (s=0; s<symbolCount; ++s) { + U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits); + MEM_write64(dt + uStart, D4); + MEM_write64(dt + uStart + 4, D4); + uStart += 8; + } + break; + default: + for (s=0; s<symbolCount; ++s) { + U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits); + for (u=0; u < length; u += 16) { + MEM_write64(dt + uStart + u + 0, D4); + MEM_write64(dt + uStart + u + 4, D4); + MEM_write64(dt + uStart + u + 8, D4); + MEM_write64(dt + uStart + u + 12, D4); + } + assert(u == length); + uStart += length; + } + break; + } + symbol += symbolCount; + rankStart += symbolCount * length; + } + } + return iSize; +} + +FORCE_INLINE_TEMPLATE BYTE +HUF_decodeSymbolX1(BIT_DStream_t* Dstream, const HUF_DEltX1* dt, const U32 dtLog) +{ + size_t const val = BIT_lookBitsFast(Dstream, dtLog); /* note : dtLog >= 1 */ + BYTE const c = dt[val].byte; + BIT_skipBits(Dstream, dt[val].nbBits); + return c; +} + +#define HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr) \ + *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog) + +#define HUF_DECODE_SYMBOLX1_1(ptr, DStreamPtr) \ + if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \ + HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr) + +#define HUF_DECODE_SYMBOLX1_2(ptr, DStreamPtr) \ + if (MEM_64bits()) \ + HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr) + +HINT_INLINE size_t +HUF_decodeStreamX1(BYTE* p, BIT_DStream_t* const bitDPtr, BYTE* const pEnd, const HUF_DEltX1* const dt, const U32 dtLog) +{ + BYTE* const pStart = p; + + /* up to 4 symbols at a time */ + if ((pEnd - p) > 3) { + while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-3)) { + HUF_DECODE_SYMBOLX1_2(p, bitDPtr); + HUF_DECODE_SYMBOLX1_1(p, bitDPtr); + HUF_DECODE_SYMBOLX1_2(p, bitDPtr); + HUF_DECODE_SYMBOLX1_0(p, bitDPtr); + } + } + + /* [0-3] symbols remaining */ + if (MEM_32bits()) + while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd)) + HUF_DECODE_SYMBOLX1_0(p, bitDPtr); + + /* no more data to retrieve from bitstream, no need to reload */ + while (p < pEnd) + HUF_DECODE_SYMBOLX1_0(p, bitDPtr); + + return pEnd-pStart; +} + +FORCE_INLINE_TEMPLATE size_t +HUF_decompress1X1_usingDTable_internal_body( + void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + const HUF_DTable* DTable) +{ + BYTE* op = (BYTE*)dst; + BYTE* const oend = op + dstSize; + const void* dtPtr = DTable + 1; + const HUF_DEltX1* const dt = (const HUF_DEltX1*)dtPtr; + BIT_DStream_t bitD; + DTableDesc const dtd = HUF_getDTableDesc(DTable); + U32 const dtLog = dtd.tableLog; + + CHECK_F( BIT_initDStream(&bitD, cSrc, cSrcSize) ); + + HUF_decodeStreamX1(op, &bitD, oend, dt, dtLog); + + if (!BIT_endOfDStream(&bitD)) return ERROR(corruption_detected); + + return dstSize; +} + +FORCE_INLINE_TEMPLATE size_t +HUF_decompress4X1_usingDTable_internal_body( + void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + const HUF_DTable* DTable) +{ + /* Check */ + if (cSrcSize < 10) return ERROR(corruption_detected); /* strict minimum : jump table + 1 byte per stream */ + + { const BYTE* const istart = (const BYTE*) cSrc; + BYTE* const ostart = (BYTE*) dst; + BYTE* const oend = ostart + dstSize; + BYTE* const olimit = oend - 3; + const void* const dtPtr = DTable + 1; + const HUF_DEltX1* const dt = (const HUF_DEltX1*)dtPtr; + + /* Init */ + BIT_DStream_t bitD1; + BIT_DStream_t bitD2; + BIT_DStream_t bitD3; + BIT_DStream_t bitD4; + size_t const length1 = MEM_readLE16(istart); + size_t const length2 = MEM_readLE16(istart+2); + size_t const length3 = MEM_readLE16(istart+4); + size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6); + const BYTE* const istart1 = istart + 6; /* jumpTable */ + const BYTE* const istart2 = istart1 + length1; + const BYTE* const istart3 = istart2 + length2; + const BYTE* const istart4 = istart3 + length3; + const size_t segmentSize = (dstSize+3) / 4; + BYTE* const opStart2 = ostart + segmentSize; + BYTE* const opStart3 = opStart2 + segmentSize; + BYTE* const opStart4 = opStart3 + segmentSize; + BYTE* op1 = ostart; + BYTE* op2 = opStart2; + BYTE* op3 = opStart3; + BYTE* op4 = opStart4; + DTableDesc const dtd = HUF_getDTableDesc(DTable); + U32 const dtLog = dtd.tableLog; + U32 endSignal = 1; + + if (length4 > cSrcSize) return ERROR(corruption_detected); /* overflow */ + if (opStart4 > oend) return ERROR(corruption_detected); /* overflow */ + CHECK_F( BIT_initDStream(&bitD1, istart1, length1) ); + CHECK_F( BIT_initDStream(&bitD2, istart2, length2) ); + CHECK_F( BIT_initDStream(&bitD3, istart3, length3) ); + CHECK_F( BIT_initDStream(&bitD4, istart4, length4) ); + + /* up to 16 symbols per loop (4 symbols per stream) in 64-bit mode */ + if ((size_t)(oend - op4) >= sizeof(size_t)) { + for ( ; (endSignal) & (op4 < olimit) ; ) { + HUF_DECODE_SYMBOLX1_2(op1, &bitD1); + HUF_DECODE_SYMBOLX1_2(op2, &bitD2); + HUF_DECODE_SYMBOLX1_2(op3, &bitD3); + HUF_DECODE_SYMBOLX1_2(op4, &bitD4); + HUF_DECODE_SYMBOLX1_1(op1, &bitD1); + HUF_DECODE_SYMBOLX1_1(op2, &bitD2); + HUF_DECODE_SYMBOLX1_1(op3, &bitD3); + HUF_DECODE_SYMBOLX1_1(op4, &bitD4); + HUF_DECODE_SYMBOLX1_2(op1, &bitD1); + HUF_DECODE_SYMBOLX1_2(op2, &bitD2); + HUF_DECODE_SYMBOLX1_2(op3, &bitD3); + HUF_DECODE_SYMBOLX1_2(op4, &bitD4); + HUF_DECODE_SYMBOLX1_0(op1, &bitD1); + HUF_DECODE_SYMBOLX1_0(op2, &bitD2); + HUF_DECODE_SYMBOLX1_0(op3, &bitD3); + HUF_DECODE_SYMBOLX1_0(op4, &bitD4); + endSignal &= BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished; + endSignal &= BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished; + endSignal &= BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished; + endSignal &= BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished; + } + } + + /* check corruption */ + /* note : should not be necessary : op# advance in lock step, and we control op4. + * but curiously, binary generated by gcc 7.2 & 7.3 with -mbmi2 runs faster when >=1 test is present */ + if (op1 > opStart2) return ERROR(corruption_detected); + if (op2 > opStart3) return ERROR(corruption_detected); + if (op3 > opStart4) return ERROR(corruption_detected); + /* note : op4 supposed already verified within main loop */ + + /* finish bitStreams one by one */ + HUF_decodeStreamX1(op1, &bitD1, opStart2, dt, dtLog); + HUF_decodeStreamX1(op2, &bitD2, opStart3, dt, dtLog); + HUF_decodeStreamX1(op3, &bitD3, opStart4, dt, dtLog); + HUF_decodeStreamX1(op4, &bitD4, oend, dt, dtLog); + + /* check */ + { U32 const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4); + if (!endCheck) return ERROR(corruption_detected); } + + /* decoded size */ + return dstSize; + } +} + +#if HUF_NEED_BMI2_FUNCTION +static TARGET_ATTRIBUTE("bmi2") +size_t HUF_decompress4X1_usingDTable_internal_bmi2(void* dst, size_t dstSize, void const* cSrc, + size_t cSrcSize, HUF_DTable const* DTable) { + return HUF_decompress4X1_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable); +} +#endif + +#if HUF_NEED_DEFAULT_FUNCTION +static +size_t HUF_decompress4X1_usingDTable_internal_default(void* dst, size_t dstSize, void const* cSrc, + size_t cSrcSize, HUF_DTable const* DTable) { + return HUF_decompress4X1_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable); +} +#endif + +#if HUF_ENABLE_ASM_X86_64_BMI2 + +HUF_ASM_DECL void HUF_decompress4X1_usingDTable_internal_bmi2_asm_loop(HUF_DecompressAsmArgs* args); + +static HUF_ASM_X86_64_BMI2_ATTRS +size_t +HUF_decompress4X1_usingDTable_internal_bmi2_asm( + void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + const HUF_DTable* DTable) +{ + void const* dt = DTable + 1; + const BYTE* const iend = (const BYTE*)cSrc + 6; + BYTE* const oend = (BYTE*)dst + dstSize; + HUF_DecompressAsmArgs args; + { + size_t const ret = HUF_DecompressAsmArgs_init(&args, dst, dstSize, cSrc, cSrcSize, DTable); + FORWARD_IF_ERROR(ret, "Failed to init asm args"); + if (ret != 0) + return HUF_decompress4X1_usingDTable_internal_bmi2(dst, dstSize, cSrc, cSrcSize, DTable); + } + + assert(args.ip[0] >= args.ilimit); + HUF_decompress4X1_usingDTable_internal_bmi2_asm_loop(&args); + + /* Our loop guarantees that ip[] >= ilimit and that we haven't + * overwritten any op[]. + */ + assert(args.ip[0] >= iend); + assert(args.ip[1] >= iend); + assert(args.ip[2] >= iend); + assert(args.ip[3] >= iend); + assert(args.op[3] <= oend); + (void)iend; + + /* finish bit streams one by one. */ + { + size_t const segmentSize = (dstSize+3) / 4; + BYTE* segmentEnd = (BYTE*)dst; + int i; + for (i = 0; i < 4; ++i) { + BIT_DStream_t bit; + if (segmentSize <= (size_t)(oend - segmentEnd)) + segmentEnd += segmentSize; + else + segmentEnd = oend; + FORWARD_IF_ERROR(HUF_initRemainingDStream(&bit, &args, i, segmentEnd), "corruption"); + /* Decompress and validate that we've produced exactly the expected length. */ + args.op[i] += HUF_decodeStreamX1(args.op[i], &bit, segmentEnd, (HUF_DEltX1 const*)dt, HUF_DECODER_FAST_TABLELOG); + if (args.op[i] != segmentEnd) return ERROR(corruption_detected); + } + } + + /* decoded size */ + return dstSize; +} +#endif /* HUF_ENABLE_ASM_X86_64_BMI2 */ + +typedef size_t (*HUF_decompress_usingDTable_t)(void *dst, size_t dstSize, + const void *cSrc, + size_t cSrcSize, + const HUF_DTable *DTable); + +HUF_DGEN(HUF_decompress1X1_usingDTable_internal) + +static size_t HUF_decompress4X1_usingDTable_internal(void* dst, size_t dstSize, void const* cSrc, + size_t cSrcSize, HUF_DTable const* DTable, int bmi2) +{ +#if DYNAMIC_BMI2 + if (bmi2) { +# if HUF_ENABLE_ASM_X86_64_BMI2 + return HUF_decompress4X1_usingDTable_internal_bmi2_asm(dst, dstSize, cSrc, cSrcSize, DTable); +# else + return HUF_decompress4X1_usingDTable_internal_bmi2(dst, dstSize, cSrc, cSrcSize, DTable); +# endif + } +#else + (void)bmi2; +#endif + +#if HUF_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__) + return HUF_decompress4X1_usingDTable_internal_bmi2_asm(dst, dstSize, cSrc, cSrcSize, DTable); +#else + return HUF_decompress4X1_usingDTable_internal_default(dst, dstSize, cSrc, cSrcSize, DTable); +#endif +} + + +size_t HUF_decompress1X1_usingDTable( + void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + const HUF_DTable* DTable) +{ + DTableDesc dtd = HUF_getDTableDesc(DTable); + if (dtd.tableType != 0) return ERROR(GENERIC); + return HUF_decompress1X1_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); +} + +size_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* DCtx, void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + void* workSpace, size_t wkspSize) +{ + const BYTE* ip = (const BYTE*) cSrc; + + size_t const hSize = HUF_readDTableX1_wksp(DCtx, cSrc, cSrcSize, workSpace, wkspSize); + if (HUF_isError(hSize)) return hSize; + if (hSize >= cSrcSize) return ERROR(srcSize_wrong); + ip += hSize; cSrcSize -= hSize; + + return HUF_decompress1X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, DCtx, /* bmi2 */ 0); +} + + +size_t HUF_decompress4X1_usingDTable( + void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + const HUF_DTable* DTable) +{ + DTableDesc dtd = HUF_getDTableDesc(DTable); + if (dtd.tableType != 0) return ERROR(GENERIC); + return HUF_decompress4X1_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); +} + +static size_t HUF_decompress4X1_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + void* workSpace, size_t wkspSize, int bmi2) +{ + const BYTE* ip = (const BYTE*) cSrc; + + size_t const hSize = HUF_readDTableX1_wksp_bmi2(dctx, cSrc, cSrcSize, workSpace, wkspSize, bmi2); + if (HUF_isError(hSize)) return hSize; + if (hSize >= cSrcSize) return ERROR(srcSize_wrong); + ip += hSize; cSrcSize -= hSize; + + return HUF_decompress4X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, bmi2); +} + +size_t HUF_decompress4X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + void* workSpace, size_t wkspSize) +{ + return HUF_decompress4X1_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, 0); +} + + +#endif /* HUF_FORCE_DECOMPRESS_X2 */ + + +#ifndef HUF_FORCE_DECOMPRESS_X1 + +/* *************************/ +/* double-symbols decoding */ +/* *************************/ + +typedef struct { U16 sequence; BYTE nbBits; BYTE length; } HUF_DEltX2; /* double-symbols decoding */ +typedef struct { BYTE symbol; } sortedSymbol_t; +typedef U32 rankValCol_t[HUF_TABLELOG_MAX + 1]; +typedef rankValCol_t rankVal_t[HUF_TABLELOG_MAX]; + +/** + * Constructs a HUF_DEltX2 in a U32. + */ +static U32 HUF_buildDEltX2U32(U32 symbol, U32 nbBits, U32 baseSeq, int level) +{ + U32 seq; + DEBUG_STATIC_ASSERT(offsetof(HUF_DEltX2, sequence) == 0); + DEBUG_STATIC_ASSERT(offsetof(HUF_DEltX2, nbBits) == 2); + DEBUG_STATIC_ASSERT(offsetof(HUF_DEltX2, length) == 3); + DEBUG_STATIC_ASSERT(sizeof(HUF_DEltX2) == sizeof(U32)); + if (MEM_isLittleEndian()) { + seq = level == 1 ? symbol : (baseSeq + (symbol << 8)); + return seq + (nbBits << 16) + ((U32)level << 24); + } else { + seq = level == 1 ? (symbol << 8) : ((baseSeq << 8) + symbol); + return (seq << 16) + (nbBits << 8) + (U32)level; + } +} + +/** + * Constructs a HUF_DEltX2. + */ +static HUF_DEltX2 HUF_buildDEltX2(U32 symbol, U32 nbBits, U32 baseSeq, int level) +{ + HUF_DEltX2 DElt; + U32 const val = HUF_buildDEltX2U32(symbol, nbBits, baseSeq, level); + DEBUG_STATIC_ASSERT(sizeof(DElt) == sizeof(val)); + ZSTD_memcpy(&DElt, &val, sizeof(val)); + return DElt; +} + +/** + * Constructs 2 HUF_DEltX2s and packs them into a U64. + */ +static U64 HUF_buildDEltX2U64(U32 symbol, U32 nbBits, U16 baseSeq, int level) +{ + U32 DElt = HUF_buildDEltX2U32(symbol, nbBits, baseSeq, level); + return (U64)DElt + ((U64)DElt << 32); +} + +/** + * Fills the DTable rank with all the symbols from [begin, end) that are each + * nbBits long. + * + * @param DTableRank The start of the rank in the DTable. + * @param begin The first symbol to fill (inclusive). + * @param end The last symbol to fill (exclusive). + * @param nbBits Each symbol is nbBits long. + * @param tableLog The table log. + * @param baseSeq If level == 1 { 0 } else { the first level symbol } + * @param level The level in the table. Must be 1 or 2. + */ +static void HUF_fillDTableX2ForWeight( + HUF_DEltX2* DTableRank, + sortedSymbol_t const* begin, sortedSymbol_t const* end, + U32 nbBits, U32 tableLog, + U16 baseSeq, int const level) +{ + U32 const length = 1U << ((tableLog - nbBits) & 0x1F /* quiet static-analyzer */); + const sortedSymbol_t* ptr; + assert(level >= 1 && level <= 2); + switch (length) { + case 1: + for (ptr = begin; ptr != end; ++ptr) { + HUF_DEltX2 const DElt = HUF_buildDEltX2(ptr->symbol, nbBits, baseSeq, level); + *DTableRank++ = DElt; + } + break; + case 2: + for (ptr = begin; ptr != end; ++ptr) { + HUF_DEltX2 const DElt = HUF_buildDEltX2(ptr->symbol, nbBits, baseSeq, level); + DTableRank[0] = DElt; + DTableRank[1] = DElt; + DTableRank += 2; + } + break; + case 4: + for (ptr = begin; ptr != end; ++ptr) { + U64 const DEltX2 = HUF_buildDEltX2U64(ptr->symbol, nbBits, baseSeq, level); + ZSTD_memcpy(DTableRank + 0, &DEltX2, sizeof(DEltX2)); + ZSTD_memcpy(DTableRank + 2, &DEltX2, sizeof(DEltX2)); + DTableRank += 4; + } + break; + case 8: + for (ptr = begin; ptr != end; ++ptr) { + U64 const DEltX2 = HUF_buildDEltX2U64(ptr->symbol, nbBits, baseSeq, level); + ZSTD_memcpy(DTableRank + 0, &DEltX2, sizeof(DEltX2)); + ZSTD_memcpy(DTableRank + 2, &DEltX2, sizeof(DEltX2)); + ZSTD_memcpy(DTableRank + 4, &DEltX2, sizeof(DEltX2)); + ZSTD_memcpy(DTableRank + 6, &DEltX2, sizeof(DEltX2)); + DTableRank += 8; + } + break; + default: + for (ptr = begin; ptr != end; ++ptr) { + U64 const DEltX2 = HUF_buildDEltX2U64(ptr->symbol, nbBits, baseSeq, level); + HUF_DEltX2* const DTableRankEnd = DTableRank + length; + for (; DTableRank != DTableRankEnd; DTableRank += 8) { + ZSTD_memcpy(DTableRank + 0, &DEltX2, sizeof(DEltX2)); + ZSTD_memcpy(DTableRank + 2, &DEltX2, sizeof(DEltX2)); + ZSTD_memcpy(DTableRank + 4, &DEltX2, sizeof(DEltX2)); + ZSTD_memcpy(DTableRank + 6, &DEltX2, sizeof(DEltX2)); + } + } + break; + } +} + +/* HUF_fillDTableX2Level2() : + * `rankValOrigin` must be a table of at least (HUF_TABLELOG_MAX + 1) U32 */ +static void HUF_fillDTableX2Level2(HUF_DEltX2* DTable, U32 targetLog, const U32 consumedBits, + const U32* rankVal, const int minWeight, const int maxWeight1, + const sortedSymbol_t* sortedSymbols, U32 const* rankStart, + U32 nbBitsBaseline, U16 baseSeq) +{ + /* Fill skipped values (all positions up to rankVal[minWeight]). + * These are positions only get a single symbol because the combined weight + * is too large. + */ + if (minWeight>1) { + U32 const length = 1U << ((targetLog - consumedBits) & 0x1F /* quiet static-analyzer */); + U64 const DEltX2 = HUF_buildDEltX2U64(baseSeq, consumedBits, /* baseSeq */ 0, /* level */ 1); + int const skipSize = rankVal[minWeight]; + assert(length > 1); + assert((U32)skipSize < length); + switch (length) { + case 2: + assert(skipSize == 1); + ZSTD_memcpy(DTable, &DEltX2, sizeof(DEltX2)); + break; + case 4: + assert(skipSize <= 4); + ZSTD_memcpy(DTable + 0, &DEltX2, sizeof(DEltX2)); + ZSTD_memcpy(DTable + 2, &DEltX2, sizeof(DEltX2)); + break; + default: + { + int i; + for (i = 0; i < skipSize; i += 8) { + ZSTD_memcpy(DTable + i + 0, &DEltX2, sizeof(DEltX2)); + ZSTD_memcpy(DTable + i + 2, &DEltX2, sizeof(DEltX2)); + ZSTD_memcpy(DTable + i + 4, &DEltX2, sizeof(DEltX2)); + ZSTD_memcpy(DTable + i + 6, &DEltX2, sizeof(DEltX2)); + } + } + } + } + + /* Fill each of the second level symbols by weight. */ + { + int w; + for (w = minWeight; w < maxWeight1; ++w) { + int const begin = rankStart[w]; + int const end = rankStart[w+1]; + U32 const nbBits = nbBitsBaseline - w; + U32 const totalBits = nbBits + consumedBits; + HUF_fillDTableX2ForWeight( + DTable + rankVal[w], + sortedSymbols + begin, sortedSymbols + end, + totalBits, targetLog, + baseSeq, /* level */ 2); + } + } +} + +static void HUF_fillDTableX2(HUF_DEltX2* DTable, const U32 targetLog, + const sortedSymbol_t* sortedList, + const U32* rankStart, rankVal_t rankValOrigin, const U32 maxWeight, + const U32 nbBitsBaseline) +{ + U32* const rankVal = rankValOrigin[0]; + const int scaleLog = nbBitsBaseline - targetLog; /* note : targetLog >= srcLog, hence scaleLog <= 1 */ + const U32 minBits = nbBitsBaseline - maxWeight; + int w; + int const wEnd = (int)maxWeight + 1; + + /* Fill DTable in order of weight. */ + for (w = 1; w < wEnd; ++w) { + int const begin = (int)rankStart[w]; + int const end = (int)rankStart[w+1]; + U32 const nbBits = nbBitsBaseline - w; + + if (targetLog-nbBits >= minBits) { + /* Enough room for a second symbol. */ + int start = rankVal[w]; + U32 const length = 1U << ((targetLog - nbBits) & 0x1F /* quiet static-analyzer */); + int minWeight = nbBits + scaleLog; + int s; + if (minWeight < 1) minWeight = 1; + /* Fill the DTable for every symbol of weight w. + * These symbols get at least 1 second symbol. + */ + for (s = begin; s != end; ++s) { + HUF_fillDTableX2Level2( + DTable + start, targetLog, nbBits, + rankValOrigin[nbBits], minWeight, wEnd, + sortedList, rankStart, + nbBitsBaseline, sortedList[s].symbol); + start += length; + } + } else { + /* Only a single symbol. */ + HUF_fillDTableX2ForWeight( + DTable + rankVal[w], + sortedList + begin, sortedList + end, + nbBits, targetLog, + /* baseSeq */ 0, /* level */ 1); + } + } +} + +typedef struct { + rankValCol_t rankVal[HUF_TABLELOG_MAX]; + U32 rankStats[HUF_TABLELOG_MAX + 1]; + U32 rankStart0[HUF_TABLELOG_MAX + 3]; + sortedSymbol_t sortedSymbol[HUF_SYMBOLVALUE_MAX + 1]; + BYTE weightList[HUF_SYMBOLVALUE_MAX + 1]; + U32 calleeWksp[HUF_READ_STATS_WORKSPACE_SIZE_U32]; +} HUF_ReadDTableX2_Workspace; + +size_t HUF_readDTableX2_wksp(HUF_DTable* DTable, + const void* src, size_t srcSize, + void* workSpace, size_t wkspSize) +{ + return HUF_readDTableX2_wksp_bmi2(DTable, src, srcSize, workSpace, wkspSize, /* bmi2 */ 0); +} + +size_t HUF_readDTableX2_wksp_bmi2(HUF_DTable* DTable, + const void* src, size_t srcSize, + void* workSpace, size_t wkspSize, int bmi2) +{ + U32 tableLog, maxW, nbSymbols; + DTableDesc dtd = HUF_getDTableDesc(DTable); + U32 maxTableLog = dtd.maxTableLog; + size_t iSize; + void* dtPtr = DTable+1; /* force compiler to avoid strict-aliasing */ + HUF_DEltX2* const dt = (HUF_DEltX2*)dtPtr; + U32 *rankStart; + + HUF_ReadDTableX2_Workspace* const wksp = (HUF_ReadDTableX2_Workspace*)workSpace; + + if (sizeof(*wksp) > wkspSize) return ERROR(GENERIC); + + rankStart = wksp->rankStart0 + 1; + ZSTD_memset(wksp->rankStats, 0, sizeof(wksp->rankStats)); + ZSTD_memset(wksp->rankStart0, 0, sizeof(wksp->rankStart0)); + + DEBUG_STATIC_ASSERT(sizeof(HUF_DEltX2) == sizeof(HUF_DTable)); /* if compiler fails here, assertion is wrong */ + if (maxTableLog > HUF_TABLELOG_MAX) return ERROR(tableLog_tooLarge); + /* ZSTD_memset(weightList, 0, sizeof(weightList)); */ /* is not necessary, even though some analyzer complain ... */ + + iSize = HUF_readStats_wksp(wksp->weightList, HUF_SYMBOLVALUE_MAX + 1, wksp->rankStats, &nbSymbols, &tableLog, src, srcSize, wksp->calleeWksp, sizeof(wksp->calleeWksp), bmi2); + if (HUF_isError(iSize)) return iSize; + + /* check result */ + if (tableLog > maxTableLog) return ERROR(tableLog_tooLarge); /* DTable can't fit code depth */ + if (tableLog <= HUF_DECODER_FAST_TABLELOG && maxTableLog > HUF_DECODER_FAST_TABLELOG) maxTableLog = HUF_DECODER_FAST_TABLELOG; + + /* find maxWeight */ + for (maxW = tableLog; wksp->rankStats[maxW]==0; maxW--) {} /* necessarily finds a solution before 0 */ + + /* Get start index of each weight */ + { U32 w, nextRankStart = 0; + for (w=1; w<maxW+1; w++) { + U32 curr = nextRankStart; + nextRankStart += wksp->rankStats[w]; + rankStart[w] = curr; + } + rankStart[0] = nextRankStart; /* put all 0w symbols at the end of sorted list*/ + rankStart[maxW+1] = nextRankStart; + } + + /* sort symbols by weight */ + { U32 s; + for (s=0; s<nbSymbols; s++) { + U32 const w = wksp->weightList[s]; + U32 const r = rankStart[w]++; + wksp->sortedSymbol[r].symbol = (BYTE)s; + } + rankStart[0] = 0; /* forget 0w symbols; this is beginning of weight(1) */ + } + + /* Build rankVal */ + { U32* const rankVal0 = wksp->rankVal[0]; + { int const rescale = (maxTableLog-tableLog) - 1; /* tableLog <= maxTableLog */ + U32 nextRankVal = 0; + U32 w; + for (w=1; w<maxW+1; w++) { + U32 curr = nextRankVal; + nextRankVal += wksp->rankStats[w] << (w+rescale); + rankVal0[w] = curr; + } } + { U32 const minBits = tableLog+1 - maxW; + U32 consumed; + for (consumed = minBits; consumed < maxTableLog - minBits + 1; consumed++) { + U32* const rankValPtr = wksp->rankVal[consumed]; + U32 w; + for (w = 1; w < maxW+1; w++) { + rankValPtr[w] = rankVal0[w] >> consumed; + } } } } + +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif + HUF_fillDTableX2(dt, maxTableLog, + wksp->sortedSymbol, + wksp->rankStart0, wksp->rankVal, maxW, + tableLog+1); +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + + dtd.tableLog = (BYTE)maxTableLog; + dtd.tableType = 1; + ZSTD_memcpy(DTable, &dtd, sizeof(dtd)); + return iSize; +} + + +FORCE_INLINE_TEMPLATE U32 +HUF_decodeSymbolX2(void* op, BIT_DStream_t* DStream, const HUF_DEltX2* dt, const U32 dtLog) +{ + size_t const val = BIT_lookBitsFast(DStream, dtLog); /* note : dtLog >= 1 */ + ZSTD_memcpy(op, &dt[val].sequence, 2); + BIT_skipBits(DStream, dt[val].nbBits); + return dt[val].length; +} + +FORCE_INLINE_TEMPLATE U32 +HUF_decodeLastSymbolX2(void* op, BIT_DStream_t* DStream, const HUF_DEltX2* dt, const U32 dtLog) +{ + size_t const val = BIT_lookBitsFast(DStream, dtLog); /* note : dtLog >= 1 */ + ZSTD_memcpy(op, &dt[val].sequence, 1); + if (dt[val].length==1) { + BIT_skipBits(DStream, dt[val].nbBits); + } else { + if (DStream->bitsConsumed < (sizeof(DStream->bitContainer)*8)) { + BIT_skipBits(DStream, dt[val].nbBits); + if (DStream->bitsConsumed > (sizeof(DStream->bitContainer)*8)) + /* ugly hack; works only because it's the last symbol. Note : can't easily extract nbBits from just this symbol */ + DStream->bitsConsumed = (sizeof(DStream->bitContainer)*8); + } + } + return 1; +} + +#define HUF_DECODE_SYMBOLX2_0(ptr, DStreamPtr) \ + ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog) + +#define HUF_DECODE_SYMBOLX2_1(ptr, DStreamPtr) \ + if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \ + ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog) + +#define HUF_DECODE_SYMBOLX2_2(ptr, DStreamPtr) \ + if (MEM_64bits()) \ + ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog) + +HINT_INLINE size_t +HUF_decodeStreamX2(BYTE* p, BIT_DStream_t* bitDPtr, BYTE* const pEnd, + const HUF_DEltX2* const dt, const U32 dtLog) +{ + BYTE* const pStart = p; + + /* up to 8 symbols at a time */ + if ((size_t)(pEnd - p) >= sizeof(bitDPtr->bitContainer)) { + if (dtLog <= 11 && MEM_64bits()) { + /* up to 10 symbols at a time */ + while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-9)) { + HUF_DECODE_SYMBOLX2_0(p, bitDPtr); + HUF_DECODE_SYMBOLX2_0(p, bitDPtr); + HUF_DECODE_SYMBOLX2_0(p, bitDPtr); + HUF_DECODE_SYMBOLX2_0(p, bitDPtr); + HUF_DECODE_SYMBOLX2_0(p, bitDPtr); + } + } else { + /* up to 8 symbols at a time */ + while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-(sizeof(bitDPtr->bitContainer)-1))) { + HUF_DECODE_SYMBOLX2_2(p, bitDPtr); + HUF_DECODE_SYMBOLX2_1(p, bitDPtr); + HUF_DECODE_SYMBOLX2_2(p, bitDPtr); + HUF_DECODE_SYMBOLX2_0(p, bitDPtr); + } + } + } + + /* closer to end : up to 2 symbols at a time */ + if ((size_t)(pEnd - p) >= 2) { + while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p <= pEnd-2)) + HUF_DECODE_SYMBOLX2_0(p, bitDPtr); + + while (p <= pEnd-2) + HUF_DECODE_SYMBOLX2_0(p, bitDPtr); /* no need to reload : reached the end of DStream */ + } + + if (p < pEnd) + p += HUF_decodeLastSymbolX2(p, bitDPtr, dt, dtLog); + + return p-pStart; +} + +FORCE_INLINE_TEMPLATE size_t +HUF_decompress1X2_usingDTable_internal_body( + void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + const HUF_DTable* DTable) +{ + BIT_DStream_t bitD; + + /* Init */ + CHECK_F( BIT_initDStream(&bitD, cSrc, cSrcSize) ); + + /* decode */ + { BYTE* const ostart = (BYTE*) dst; + BYTE* const oend = ostart + dstSize; + const void* const dtPtr = DTable+1; /* force compiler to not use strict-aliasing */ + const HUF_DEltX2* const dt = (const HUF_DEltX2*)dtPtr; + DTableDesc const dtd = HUF_getDTableDesc(DTable); + HUF_decodeStreamX2(ostart, &bitD, oend, dt, dtd.tableLog); + } + + /* check */ + if (!BIT_endOfDStream(&bitD)) return ERROR(corruption_detected); + + /* decoded size */ + return dstSize; +} +FORCE_INLINE_TEMPLATE size_t +HUF_decompress4X2_usingDTable_internal_body( + void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + const HUF_DTable* DTable) +{ + if (cSrcSize < 10) return ERROR(corruption_detected); /* strict minimum : jump table + 1 byte per stream */ + + { const BYTE* const istart = (const BYTE*) cSrc; + BYTE* const ostart = (BYTE*) dst; + BYTE* const oend = ostart + dstSize; + BYTE* const olimit = oend - (sizeof(size_t)-1); + const void* const dtPtr = DTable+1; + const HUF_DEltX2* const dt = (const HUF_DEltX2*)dtPtr; + + /* Init */ + BIT_DStream_t bitD1; + BIT_DStream_t bitD2; + BIT_DStream_t bitD3; + BIT_DStream_t bitD4; + size_t const length1 = MEM_readLE16(istart); + size_t const length2 = MEM_readLE16(istart+2); + size_t const length3 = MEM_readLE16(istart+4); + size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6); + const BYTE* const istart1 = istart + 6; /* jumpTable */ + const BYTE* const istart2 = istart1 + length1; + const BYTE* const istart3 = istart2 + length2; + const BYTE* const istart4 = istart3 + length3; + size_t const segmentSize = (dstSize+3) / 4; + BYTE* const opStart2 = ostart + segmentSize; + BYTE* const opStart3 = opStart2 + segmentSize; + BYTE* const opStart4 = opStart3 + segmentSize; + BYTE* op1 = ostart; + BYTE* op2 = opStart2; + BYTE* op3 = opStart3; + BYTE* op4 = opStart4; + U32 endSignal = 1; + DTableDesc const dtd = HUF_getDTableDesc(DTable); + U32 const dtLog = dtd.tableLog; + + if (length4 > cSrcSize) return ERROR(corruption_detected); /* overflow */ + if (opStart4 > oend) return ERROR(corruption_detected); /* overflow */ + CHECK_F( BIT_initDStream(&bitD1, istart1, length1) ); + CHECK_F( BIT_initDStream(&bitD2, istart2, length2) ); + CHECK_F( BIT_initDStream(&bitD3, istart3, length3) ); + CHECK_F( BIT_initDStream(&bitD4, istart4, length4) ); + + /* 16-32 symbols per loop (4-8 symbols per stream) */ + if ((size_t)(oend - op4) >= sizeof(size_t)) { + for ( ; (endSignal) & (op4 < olimit); ) { +#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__)) + HUF_DECODE_SYMBOLX2_2(op1, &bitD1); + HUF_DECODE_SYMBOLX2_1(op1, &bitD1); + HUF_DECODE_SYMBOLX2_2(op1, &bitD1); + HUF_DECODE_SYMBOLX2_0(op1, &bitD1); + HUF_DECODE_SYMBOLX2_2(op2, &bitD2); + HUF_DECODE_SYMBOLX2_1(op2, &bitD2); + HUF_DECODE_SYMBOLX2_2(op2, &bitD2); + HUF_DECODE_SYMBOLX2_0(op2, &bitD2); + endSignal &= BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished; + endSignal &= BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished; + HUF_DECODE_SYMBOLX2_2(op3, &bitD3); + HUF_DECODE_SYMBOLX2_1(op3, &bitD3); + HUF_DECODE_SYMBOLX2_2(op3, &bitD3); + HUF_DECODE_SYMBOLX2_0(op3, &bitD3); + HUF_DECODE_SYMBOLX2_2(op4, &bitD4); + HUF_DECODE_SYMBOLX2_1(op4, &bitD4); + HUF_DECODE_SYMBOLX2_2(op4, &bitD4); + HUF_DECODE_SYMBOLX2_0(op4, &bitD4); + endSignal &= BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished; + endSignal &= BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished; +#else + HUF_DECODE_SYMBOLX2_2(op1, &bitD1); + HUF_DECODE_SYMBOLX2_2(op2, &bitD2); + HUF_DECODE_SYMBOLX2_2(op3, &bitD3); + HUF_DECODE_SYMBOLX2_2(op4, &bitD4); + HUF_DECODE_SYMBOLX2_1(op1, &bitD1); + HUF_DECODE_SYMBOLX2_1(op2, &bitD2); + HUF_DECODE_SYMBOLX2_1(op3, &bitD3); + HUF_DECODE_SYMBOLX2_1(op4, &bitD4); + HUF_DECODE_SYMBOLX2_2(op1, &bitD1); + HUF_DECODE_SYMBOLX2_2(op2, &bitD2); + HUF_DECODE_SYMBOLX2_2(op3, &bitD3); + HUF_DECODE_SYMBOLX2_2(op4, &bitD4); + HUF_DECODE_SYMBOLX2_0(op1, &bitD1); + HUF_DECODE_SYMBOLX2_0(op2, &bitD2); + HUF_DECODE_SYMBOLX2_0(op3, &bitD3); + HUF_DECODE_SYMBOLX2_0(op4, &bitD4); + endSignal = (U32)LIKELY( + (BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished) + & (BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished) + & (BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished) + & (BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished)); +#endif + } + } + + /* check corruption */ + if (op1 > opStart2) return ERROR(corruption_detected); + if (op2 > opStart3) return ERROR(corruption_detected); + if (op3 > opStart4) return ERROR(corruption_detected); + /* note : op4 already verified within main loop */ + + /* finish bitStreams one by one */ + HUF_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog); + HUF_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog); + HUF_decodeStreamX2(op3, &bitD3, opStart4, dt, dtLog); + HUF_decodeStreamX2(op4, &bitD4, oend, dt, dtLog); + + /* check */ + { U32 const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4); + if (!endCheck) return ERROR(corruption_detected); } + + /* decoded size */ + return dstSize; + } +} + +#if HUF_NEED_BMI2_FUNCTION +static TARGET_ATTRIBUTE("bmi2") +size_t HUF_decompress4X2_usingDTable_internal_bmi2(void* dst, size_t dstSize, void const* cSrc, + size_t cSrcSize, HUF_DTable const* DTable) { + return HUF_decompress4X2_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable); +} +#endif + +#if HUF_NEED_DEFAULT_FUNCTION +static +size_t HUF_decompress4X2_usingDTable_internal_default(void* dst, size_t dstSize, void const* cSrc, + size_t cSrcSize, HUF_DTable const* DTable) { + return HUF_decompress4X2_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable); +} +#endif + +#if HUF_ENABLE_ASM_X86_64_BMI2 + +HUF_ASM_DECL void HUF_decompress4X2_usingDTable_internal_bmi2_asm_loop(HUF_DecompressAsmArgs* args); + +static HUF_ASM_X86_64_BMI2_ATTRS size_t +HUF_decompress4X2_usingDTable_internal_bmi2_asm( + void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + const HUF_DTable* DTable) { + void const* dt = DTable + 1; + const BYTE* const iend = (const BYTE*)cSrc + 6; + BYTE* const oend = (BYTE*)dst + dstSize; + HUF_DecompressAsmArgs args; + { + size_t const ret = HUF_DecompressAsmArgs_init(&args, dst, dstSize, cSrc, cSrcSize, DTable); + FORWARD_IF_ERROR(ret, "Failed to init asm args"); + if (ret != 0) + return HUF_decompress4X2_usingDTable_internal_bmi2(dst, dstSize, cSrc, cSrcSize, DTable); + } + + assert(args.ip[0] >= args.ilimit); + HUF_decompress4X2_usingDTable_internal_bmi2_asm_loop(&args); + + /* note : op4 already verified within main loop */ + assert(args.ip[0] >= iend); + assert(args.ip[1] >= iend); + assert(args.ip[2] >= iend); + assert(args.ip[3] >= iend); + assert(args.op[3] <= oend); + (void)iend; + + /* finish bitStreams one by one */ + { + size_t const segmentSize = (dstSize+3) / 4; + BYTE* segmentEnd = (BYTE*)dst; + int i; + for (i = 0; i < 4; ++i) { + BIT_DStream_t bit; + if (segmentSize <= (size_t)(oend - segmentEnd)) + segmentEnd += segmentSize; + else + segmentEnd = oend; + FORWARD_IF_ERROR(HUF_initRemainingDStream(&bit, &args, i, segmentEnd), "corruption"); + args.op[i] += HUF_decodeStreamX2(args.op[i], &bit, segmentEnd, (HUF_DEltX2 const*)dt, HUF_DECODER_FAST_TABLELOG); + if (args.op[i] != segmentEnd) + return ERROR(corruption_detected); + } + } + + /* decoded size */ + return dstSize; +} +#endif /* HUF_ENABLE_ASM_X86_64_BMI2 */ + +static size_t HUF_decompress4X2_usingDTable_internal(void* dst, size_t dstSize, void const* cSrc, + size_t cSrcSize, HUF_DTable const* DTable, int bmi2) +{ +#if DYNAMIC_BMI2 + if (bmi2) { +# if HUF_ENABLE_ASM_X86_64_BMI2 + return HUF_decompress4X2_usingDTable_internal_bmi2_asm(dst, dstSize, cSrc, cSrcSize, DTable); +# else + return HUF_decompress4X2_usingDTable_internal_bmi2(dst, dstSize, cSrc, cSrcSize, DTable); +# endif + } +#else + (void)bmi2; +#endif + +#if HUF_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__) + return HUF_decompress4X2_usingDTable_internal_bmi2_asm(dst, dstSize, cSrc, cSrcSize, DTable); +#else + return HUF_decompress4X2_usingDTable_internal_default(dst, dstSize, cSrc, cSrcSize, DTable); +#endif +} + +HUF_DGEN(HUF_decompress1X2_usingDTable_internal) + +size_t HUF_decompress1X2_usingDTable( + void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + const HUF_DTable* DTable) +{ + DTableDesc dtd = HUF_getDTableDesc(DTable); + if (dtd.tableType != 1) return ERROR(GENERIC); + return HUF_decompress1X2_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); +} + +size_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* DCtx, void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + void* workSpace, size_t wkspSize) +{ + const BYTE* ip = (const BYTE*) cSrc; + + size_t const hSize = HUF_readDTableX2_wksp(DCtx, cSrc, cSrcSize, + workSpace, wkspSize); + if (HUF_isError(hSize)) return hSize; + if (hSize >= cSrcSize) return ERROR(srcSize_wrong); + ip += hSize; cSrcSize -= hSize; + + return HUF_decompress1X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, DCtx, /* bmi2 */ 0); +} + + +size_t HUF_decompress4X2_usingDTable( + void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + const HUF_DTable* DTable) +{ + DTableDesc dtd = HUF_getDTableDesc(DTable); + if (dtd.tableType != 1) return ERROR(GENERIC); + return HUF_decompress4X2_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); +} + +static size_t HUF_decompress4X2_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + void* workSpace, size_t wkspSize, int bmi2) +{ + const BYTE* ip = (const BYTE*) cSrc; + + size_t hSize = HUF_readDTableX2_wksp(dctx, cSrc, cSrcSize, + workSpace, wkspSize); + if (HUF_isError(hSize)) return hSize; + if (hSize >= cSrcSize) return ERROR(srcSize_wrong); + ip += hSize; cSrcSize -= hSize; + + return HUF_decompress4X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, bmi2); +} + +size_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + void* workSpace, size_t wkspSize) +{ + return HUF_decompress4X2_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, /* bmi2 */ 0); +} + + +#endif /* HUF_FORCE_DECOMPRESS_X1 */ + + +/* ***********************************/ +/* Universal decompression selectors */ +/* ***********************************/ + +size_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize, + const void* cSrc, size_t cSrcSize, + const HUF_DTable* DTable) +{ + DTableDesc const dtd = HUF_getDTableDesc(DTable); +#if defined(HUF_FORCE_DECOMPRESS_X1) + (void)dtd; + assert(dtd.tableType == 0); + return HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); +#elif defined(HUF_FORCE_DECOMPRESS_X2) + (void)dtd; + assert(dtd.tableType == 1); + return HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); +#else + return dtd.tableType ? HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0) : + HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); +#endif +} + +size_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize, + const void* cSrc, size_t cSrcSize, + const HUF_DTable* DTable) +{ + DTableDesc const dtd = HUF_getDTableDesc(DTable); +#if defined(HUF_FORCE_DECOMPRESS_X1) + (void)dtd; + assert(dtd.tableType == 0); + return HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); +#elif defined(HUF_FORCE_DECOMPRESS_X2) + (void)dtd; + assert(dtd.tableType == 1); + return HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); +#else + return dtd.tableType ? HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0) : + HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); +#endif +} + + +#if !defined(HUF_FORCE_DECOMPRESS_X1) && !defined(HUF_FORCE_DECOMPRESS_X2) +typedef struct { U32 tableTime; U32 decode256Time; } algo_time_t; +static const algo_time_t algoTime[16 /* Quantization */][2 /* single, double */] = +{ + /* single, double, quad */ + {{0,0}, {1,1}}, /* Q==0 : impossible */ + {{0,0}, {1,1}}, /* Q==1 : impossible */ + {{ 150,216}, { 381,119}}, /* Q == 2 : 12-18% */ + {{ 170,205}, { 514,112}}, /* Q == 3 : 18-25% */ + {{ 177,199}, { 539,110}}, /* Q == 4 : 25-32% */ + {{ 197,194}, { 644,107}}, /* Q == 5 : 32-38% */ + {{ 221,192}, { 735,107}}, /* Q == 6 : 38-44% */ + {{ 256,189}, { 881,106}}, /* Q == 7 : 44-50% */ + {{ 359,188}, {1167,109}}, /* Q == 8 : 50-56% */ + {{ 582,187}, {1570,114}}, /* Q == 9 : 56-62% */ + {{ 688,187}, {1712,122}}, /* Q ==10 : 62-69% */ + {{ 825,186}, {1965,136}}, /* Q ==11 : 69-75% */ + {{ 976,185}, {2131,150}}, /* Q ==12 : 75-81% */ + {{1180,186}, {2070,175}}, /* Q ==13 : 81-87% */ + {{1377,185}, {1731,202}}, /* Q ==14 : 87-93% */ + {{1412,185}, {1695,202}}, /* Q ==15 : 93-99% */ +}; +#endif + +/** HUF_selectDecoder() : + * Tells which decoder is likely to decode faster, + * based on a set of pre-computed metrics. + * @return : 0==HUF_decompress4X1, 1==HUF_decompress4X2 . + * Assumption : 0 < dstSize <= 128 KB */ +U32 HUF_selectDecoder (size_t dstSize, size_t cSrcSize) +{ + assert(dstSize > 0); + assert(dstSize <= 128*1024); +#if defined(HUF_FORCE_DECOMPRESS_X1) + (void)dstSize; + (void)cSrcSize; + return 0; +#elif defined(HUF_FORCE_DECOMPRESS_X2) + (void)dstSize; + (void)cSrcSize; + return 1; +#else + /* decoder timing evaluation */ + { U32 const Q = (cSrcSize >= dstSize) ? 15 : (U32)(cSrcSize * 16 / dstSize); /* Q < 16 */ + U32 const D256 = (U32)(dstSize >> 8); + U32 const DTime0 = algoTime[Q][0].tableTime + (algoTime[Q][0].decode256Time * D256); + U32 DTime1 = algoTime[Q][1].tableTime + (algoTime[Q][1].decode256Time * D256); + DTime1 += DTime1 >> 5; /* small advantage to algorithm using less memory, to reduce cache eviction */ + return DTime1 < DTime0; + } +#endif +} + + +size_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst, + size_t dstSize, const void* cSrc, + size_t cSrcSize, void* workSpace, + size_t wkspSize) +{ + /* validation checks */ + if (dstSize == 0) return ERROR(dstSize_tooSmall); + if (cSrcSize == 0) return ERROR(corruption_detected); + + { U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize); +#if defined(HUF_FORCE_DECOMPRESS_X1) + (void)algoNb; + assert(algoNb == 0); + return HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize); +#elif defined(HUF_FORCE_DECOMPRESS_X2) + (void)algoNb; + assert(algoNb == 1); + return HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize); +#else + return algoNb ? HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, + cSrcSize, workSpace, wkspSize): + HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize); +#endif + } +} + +size_t HUF_decompress1X_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + void* workSpace, size_t wkspSize) +{ + /* validation checks */ + if (dstSize == 0) return ERROR(dstSize_tooSmall); + if (cSrcSize > dstSize) return ERROR(corruption_detected); /* invalid */ + if (cSrcSize == dstSize) { ZSTD_memcpy(dst, cSrc, dstSize); return dstSize; } /* not compressed */ + if (cSrcSize == 1) { ZSTD_memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; } /* RLE */ + + { U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize); +#if defined(HUF_FORCE_DECOMPRESS_X1) + (void)algoNb; + assert(algoNb == 0); + return HUF_decompress1X1_DCtx_wksp(dctx, dst, dstSize, cSrc, + cSrcSize, workSpace, wkspSize); +#elif defined(HUF_FORCE_DECOMPRESS_X2) + (void)algoNb; + assert(algoNb == 1); + return HUF_decompress1X2_DCtx_wksp(dctx, dst, dstSize, cSrc, + cSrcSize, workSpace, wkspSize); +#else + return algoNb ? HUF_decompress1X2_DCtx_wksp(dctx, dst, dstSize, cSrc, + cSrcSize, workSpace, wkspSize): + HUF_decompress1X1_DCtx_wksp(dctx, dst, dstSize, cSrc, + cSrcSize, workSpace, wkspSize); +#endif + } +} + + +size_t HUF_decompress1X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2) +{ + DTableDesc const dtd = HUF_getDTableDesc(DTable); +#if defined(HUF_FORCE_DECOMPRESS_X1) + (void)dtd; + assert(dtd.tableType == 0); + return HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2); +#elif defined(HUF_FORCE_DECOMPRESS_X2) + (void)dtd; + assert(dtd.tableType == 1); + return HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2); +#else + return dtd.tableType ? HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2) : + HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2); +#endif +} + +#ifndef HUF_FORCE_DECOMPRESS_X2 +size_t HUF_decompress1X1_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2) +{ + const BYTE* ip = (const BYTE*) cSrc; + + size_t const hSize = HUF_readDTableX1_wksp_bmi2(dctx, cSrc, cSrcSize, workSpace, wkspSize, bmi2); + if (HUF_isError(hSize)) return hSize; + if (hSize >= cSrcSize) return ERROR(srcSize_wrong); + ip += hSize; cSrcSize -= hSize; + + return HUF_decompress1X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, bmi2); +} +#endif + +size_t HUF_decompress4X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2) +{ + DTableDesc const dtd = HUF_getDTableDesc(DTable); +#if defined(HUF_FORCE_DECOMPRESS_X1) + (void)dtd; + assert(dtd.tableType == 0); + return HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2); +#elif defined(HUF_FORCE_DECOMPRESS_X2) + (void)dtd; + assert(dtd.tableType == 1); + return HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2); +#else + return dtd.tableType ? HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2) : + HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2); +#endif +} + +size_t HUF_decompress4X_hufOnly_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2) +{ + /* validation checks */ + if (dstSize == 0) return ERROR(dstSize_tooSmall); + if (cSrcSize == 0) return ERROR(corruption_detected); + + { U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize); +#if defined(HUF_FORCE_DECOMPRESS_X1) + (void)algoNb; + assert(algoNb == 0); + return HUF_decompress4X1_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2); +#elif defined(HUF_FORCE_DECOMPRESS_X2) + (void)algoNb; + assert(algoNb == 1); + return HUF_decompress4X2_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2); +#else + return algoNb ? HUF_decompress4X2_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2) : + HUF_decompress4X1_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2); +#endif + } +} + diff --git a/src/bled/libbb.h b/src/bled/libbb.h index 000a1a66..7d178236 100644 --- a/src/bled/libbb.h +++ b/src/bled/libbb.h @@ -23,7 +23,6 @@ #include "platform.h" #include "msapi_utf8.h" -#include <assert.h> #include <ctype.h> #include <errno.h> #include <fcntl.h> diff --git a/src/bled/open_transformer.c b/src/bled/open_transformer.c index 4e420c7e..f85855eb 100644 --- a/src/bled/open_transformer.c +++ b/src/bled/open_transformer.c @@ -206,12 +206,24 @@ static transformer_state_t *setup_transformer_on_fd(int fd, int fail_if_not_comp goto found_magic; } } + if (ENABLE_FEATURE_SEAMLESS_ZSTD + && xstate->magic.b16[0] == ZSTD_MAGIC1 + ) { + offset = -4; + xread(fd, &xstate->magic.b16[1], 2); + if (xstate->magic.b16[1] == ZSTD_MAGIC2) { + xstate->xformer = unpack_zstd_stream; + USE_FOR_NOMMU(xstate->xformer_prog = "unzstd";) + goto found_magic; + } + } /* No known magic seen */ if (fail_if_not_compressed) bb_error_msg_and_die("no gzip" IF_FEATURE_SEAMLESS_BZ2("/bzip2") IF_FEATURE_SEAMLESS_XZ("/xz") + IF_FEATURE_SEAMLESS_ZSTD("/zstd") " magic"); /* Some callers expect this function to "consume" fd diff --git a/src/bled/xxhash.c b/src/bled/xxhash.c new file mode 100644 index 00000000..d8e84c68 --- /dev/null +++ b/src/bled/xxhash.c @@ -0,0 +1,821 @@ +/* + * xxHash - Fast Hash algorithm + * Copyright (c) Yann Collet, Facebook, Inc. + * + * You can contact the author at : + * - xxHash homepage: http://www.xxhash.com + * - xxHash source repository : https://github.com/Cyan4973/xxHash + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. +*/ + + +/* ************************************* +* Tuning parameters +***************************************/ +/*!XXH_FORCE_MEMORY_ACCESS : + * By default, access to unaligned memory is controlled by `memcpy()`, which is safe and portable. + * Unfortunately, on some target/compiler combinations, the generated assembly is sub-optimal. + * The below switch allow to select different access method for improved performance. + * Method 0 (default) : use `memcpy()`. Safe and portable. + * Method 1 : `__packed` statement. It depends on compiler extension (ie, not portable). + * This method is safe if your compiler supports it, and *generally* as fast or faster than `memcpy`. + * Method 2 : direct access. This method doesn't depend on compiler but violate C standard. + * It can generate buggy code on targets which do not support unaligned memory accesses. + * But in some circumstances, it's the only known way to get the most performance (ie GCC + ARMv6) + * See http://stackoverflow.com/a/32095106/646947 for details. + * Prefer these methods in priority order (0 > 1 > 2) + */ +#ifndef XXH_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */ +# if (defined(__INTEL_COMPILER) && !defined(WIN32)) || \ + (defined(__GNUC__) && ( defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) )) || \ + defined(__ICCARM__) +# define XXH_FORCE_MEMORY_ACCESS 1 +# endif +#endif + +/*!XXH_ACCEPT_NULL_INPUT_POINTER : + * If the input pointer is a null pointer, xxHash default behavior is to trigger a memory access error, since it is a bad pointer. + * When this option is enabled, xxHash output for null input pointers will be the same as a null-length input. + * By default, this option is disabled. To enable it, uncomment below define : + */ +/* #define XXH_ACCEPT_NULL_INPUT_POINTER 1 */ + +/*!XXH_FORCE_NATIVE_FORMAT : + * By default, xxHash library provides endian-independent Hash values, based on little-endian convention. + * Results are therefore identical for little-endian and big-endian CPU. + * This comes at a performance cost for big-endian CPU, since some swapping is required to emulate little-endian format. + * Should endian-independence be of no importance for your application, you may set the #define below to 1, + * to improve speed for Big-endian CPU. + * This option has no impact on Little_Endian CPU. + */ +#ifndef XXH_FORCE_NATIVE_FORMAT /* can be defined externally */ +# define XXH_FORCE_NATIVE_FORMAT 0 +#endif + +/*!XXH_FORCE_ALIGN_CHECK : + * This is a minor performance trick, only useful with lots of very small keys. + * It means : check for aligned/unaligned input. + * The check costs one initial branch per hash; set to 0 when the input data + * is guaranteed to be aligned. + */ +#ifndef XXH_FORCE_ALIGN_CHECK /* can be defined externally */ +# if defined(__i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64) +# define XXH_FORCE_ALIGN_CHECK 0 +# else +# define XXH_FORCE_ALIGN_CHECK 1 +# endif +#endif + + +/* ************************************* +* Includes & Memory related functions +***************************************/ +/* Modify the local functions below should you wish to use some other memory routines */ +/* for ZSTD_malloc(), ZSTD_free() */ +#define ZSTD_DEPS_NEED_MALLOC +#include "zstd_deps.h" /* size_t, ZSTD_malloc, ZSTD_free, ZSTD_memcpy */ +static void* XXH_malloc(size_t s) { return ZSTD_malloc(s); } +static void XXH_free (void* p) { ZSTD_free(p); } +static void* XXH_memcpy(void* dest, const void* src, size_t size) { return ZSTD_memcpy(dest,src,size); } + +#include "xxhash.h" + + +/* ************************************* +* Compiler Specific Options +***************************************/ +#include "zstd_compiler.h" + + +/* ************************************* +* Basic Types +***************************************/ +#include "zstd_mem.h" /* BYTE, U32, U64, size_t */ + +#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2)) + +/* Force direct memory access. Only works on CPU which support unaligned memory access in hardware */ +static U32 XXH_read32(const void* memPtr) { return *(const U32*) memPtr; } +static U64 XXH_read64(const void* memPtr) { return *(const U64*) memPtr; } + +#elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1)) + +/* __pack instructions are safer, but compiler specific, hence potentially problematic for some compilers */ +/* currently only defined for gcc and icc */ +typedef union { U32 u32; U64 u64; } __attribute__((packed)) unalign; + +static U32 XXH_read32(const void* ptr) { return ((const unalign*)ptr)->u32; } +static U64 XXH_read64(const void* ptr) { return ((const unalign*)ptr)->u64; } + +#else + +/* portable and safe solution. Generally efficient. + * see : http://stackoverflow.com/a/32095106/646947 + */ + +static U32 XXH_read32(const void* memPtr) +{ + U32 val; + ZSTD_memcpy(&val, memPtr, sizeof(val)); + return val; +} + +static U64 XXH_read64(const void* memPtr) +{ + U64 val; + ZSTD_memcpy(&val, memPtr, sizeof(val)); + return val; +} + +#endif /* XXH_FORCE_DIRECT_MEMORY_ACCESS */ + + +/* **************************************** +* Compiler-specific Functions and Macros +******************************************/ +#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) + +/* Note : although _rotl exists for minGW (GCC under windows), performance seems poor */ +#if defined(_MSC_VER) +# define XXH_rotl32(x,r) _rotl(x,r) +# define XXH_rotl64(x,r) _rotl64(x,r) +#else +#if defined(__ICCARM__) +# include <intrinsics.h> +# define XXH_rotl32(x,r) __ROR(x,(32 - r)) +#else +# define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r))) +#endif +# define XXH_rotl64(x,r) ((x << r) | (x >> (64 - r))) +#endif + +#if defined(_MSC_VER) /* Visual Studio */ +# define XXH_swap32 _byteswap_ulong +# define XXH_swap64 _byteswap_uint64 +#elif GCC_VERSION >= 403 +# define XXH_swap32 __builtin_bswap32 +# define XXH_swap64 __builtin_bswap64 +#else +static U32 XXH_swap32 (U32 x) +{ + return ((x << 24) & 0xff000000 ) | + ((x << 8) & 0x00ff0000 ) | + ((x >> 8) & 0x0000ff00 ) | + ((x >> 24) & 0x000000ff ); +} +static U64 XXH_swap64 (U64 x) +{ + return ((x << 56) & 0xff00000000000000ULL) | + ((x << 40) & 0x00ff000000000000ULL) | + ((x << 24) & 0x0000ff0000000000ULL) | + ((x << 8) & 0x000000ff00000000ULL) | + ((x >> 8) & 0x00000000ff000000ULL) | + ((x >> 24) & 0x0000000000ff0000ULL) | + ((x >> 40) & 0x000000000000ff00ULL) | + ((x >> 56) & 0x00000000000000ffULL); +} +#endif + + +/* ************************************* +* Architecture Macros +***************************************/ +typedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianess; + +/* XXH_CPU_LITTLE_ENDIAN can be defined externally, for example on the compiler command line */ +#ifndef XXH_CPU_LITTLE_ENDIAN + static const int g_one = 1; +# define XXH_CPU_LITTLE_ENDIAN (*(const char*)(&g_one)) +#endif + + +/* *************************** +* Memory reads +*****************************/ +typedef enum { XXH_aligned, XXH_unaligned } XXH_alignment; + +FORCE_INLINE_TEMPLATE U32 XXH_readLE32_align(const void* ptr, XXH_endianess endian, XXH_alignment align) +{ + if (align==XXH_unaligned) + return endian==XXH_littleEndian ? XXH_read32(ptr) : XXH_swap32(XXH_read32(ptr)); + else + return endian==XXH_littleEndian ? *(const U32*)ptr : XXH_swap32(*(const U32*)ptr); +} + +FORCE_INLINE_TEMPLATE U32 XXH_readLE32(const void* ptr, XXH_endianess endian) +{ + return XXH_readLE32_align(ptr, endian, XXH_unaligned); +} + +static U32 XXH_readBE32(const void* ptr) +{ + return XXH_CPU_LITTLE_ENDIAN ? XXH_swap32(XXH_read32(ptr)) : XXH_read32(ptr); +} + +FORCE_INLINE_TEMPLATE U64 XXH_readLE64_align(const void* ptr, XXH_endianess endian, XXH_alignment align) +{ + if (align==XXH_unaligned) + return endian==XXH_littleEndian ? XXH_read64(ptr) : XXH_swap64(XXH_read64(ptr)); + else + return endian==XXH_littleEndian ? *(const U64*)ptr : XXH_swap64(*(const U64*)ptr); +} + +FORCE_INLINE_TEMPLATE U64 XXH_readLE64(const void* ptr, XXH_endianess endian) +{ + return XXH_readLE64_align(ptr, endian, XXH_unaligned); +} + +static U64 XXH_readBE64(const void* ptr) +{ + return XXH_CPU_LITTLE_ENDIAN ? XXH_swap64(XXH_read64(ptr)) : XXH_read64(ptr); +} + + +/* ************************************* +* Macros +***************************************/ +#define XXH_STATIC_ASSERT(c) { enum { XXH_static_assert = 1/(int)(!!(c)) }; } /* use only *after* variable declarations */ + + +/* ************************************* +* Constants +***************************************/ +static const U32 PRIME32_1 = 2654435761U; +static const U32 PRIME32_2 = 2246822519U; +static const U32 PRIME32_3 = 3266489917U; +static const U32 PRIME32_4 = 668265263U; +static const U32 PRIME32_5 = 374761393U; + +static const U64 PRIME64_1 = 11400714785074694791ULL; +static const U64 PRIME64_2 = 14029467366897019727ULL; +static const U64 PRIME64_3 = 1609587929392839161ULL; +static const U64 PRIME64_4 = 9650029242287828579ULL; +static const U64 PRIME64_5 = 2870177450012600261ULL; + +XXH_PUBLIC_API unsigned XXH_versionNumber (void) { return XXH_VERSION_NUMBER; } + + +/* ************************** +* Utils +****************************/ +XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* restrict dstState, const XXH32_state_t* restrict srcState) +{ + ZSTD_memcpy(dstState, srcState, sizeof(*dstState)); +} + +XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* restrict dstState, const XXH64_state_t* restrict srcState) +{ + ZSTD_memcpy(dstState, srcState, sizeof(*dstState)); +} + + +/* *************************** +* Simple Hash Functions +*****************************/ + +static U32 XXH32_round(U32 seed, U32 input) +{ + seed += input * PRIME32_2; + seed = XXH_rotl32(seed, 13); + seed *= PRIME32_1; + return seed; +} + +FORCE_INLINE_TEMPLATE U32 XXH32_endian_align(const void* input, size_t len, U32 seed, XXH_endianess endian, XXH_alignment align) +{ + const BYTE* p = (const BYTE*)input; + const BYTE* bEnd = p + len; + U32 h32; +#define XXH_get32bits(p) XXH_readLE32_align(p, endian, align) + +#ifdef XXH_ACCEPT_NULL_INPUT_POINTER + if (p==NULL) { + len=0; + bEnd=p=(const BYTE*)(size_t)16; + } +#endif + + if (len>=16) { + const BYTE* const limit = bEnd - 16; + U32 v1 = seed + PRIME32_1 + PRIME32_2; + U32 v2 = seed + PRIME32_2; + U32 v3 = seed + 0; + U32 v4 = seed - PRIME32_1; + + do { + v1 = XXH32_round(v1, XXH_get32bits(p)); p+=4; + v2 = XXH32_round(v2, XXH_get32bits(p)); p+=4; + v3 = XXH32_round(v3, XXH_get32bits(p)); p+=4; + v4 = XXH32_round(v4, XXH_get32bits(p)); p+=4; + } while (p<=limit); + + h32 = XXH_rotl32(v1, 1) + XXH_rotl32(v2, 7) + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18); + } else { + h32 = seed + PRIME32_5; + } + + h32 += (U32) len; + + while (p+4<=bEnd) { + h32 += XXH_get32bits(p) * PRIME32_3; + h32 = XXH_rotl32(h32, 17) * PRIME32_4 ; + p+=4; + } + + while (p<bEnd) { + h32 += (*p) * PRIME32_5; + h32 = XXH_rotl32(h32, 11) * PRIME32_1 ; + p++; + } + + h32 ^= h32 >> 15; + h32 *= PRIME32_2; + h32 ^= h32 >> 13; + h32 *= PRIME32_3; + h32 ^= h32 >> 16; + + return h32; +} + + +XXH_PUBLIC_API unsigned int XXH32 (const void* input, size_t len, unsigned int seed) +{ +#if 0 + /* Simple version, good for code maintenance, but unfortunately slow for small inputs */ + XXH32_CREATESTATE_STATIC(state); + XXH32_reset(state, seed); + XXH32_update(state, input, len); + return XXH32_digest(state); +#else + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + + if (XXH_FORCE_ALIGN_CHECK) { + if ((((size_t)input) & 3) == 0) { /* Input is 4-bytes aligned, leverage the speed benefit */ + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_aligned); + else + return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_aligned); + } } + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_unaligned); + else + return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_unaligned); +#endif +} + + +static U64 XXH64_round(U64 acc, U64 input) +{ + acc += input * PRIME64_2; + acc = XXH_rotl64(acc, 31); + acc *= PRIME64_1; + return acc; +} + +static U64 XXH64_mergeRound(U64 acc, U64 val) +{ + val = XXH64_round(0, val); + acc ^= val; + acc = acc * PRIME64_1 + PRIME64_4; + return acc; +} + +FORCE_INLINE_TEMPLATE U64 XXH64_endian_align(const void* input, size_t len, U64 seed, XXH_endianess endian, XXH_alignment align) +{ + const BYTE* p = (const BYTE*)input; + const BYTE* const bEnd = p + len; + U64 h64; +#define XXH_get64bits(p) XXH_readLE64_align(p, endian, align) + +#ifdef XXH_ACCEPT_NULL_INPUT_POINTER + if (p==NULL) { + len=0; + bEnd=p=(const BYTE*)(size_t)32; + } +#endif + + if (len>=32) { + const BYTE* const limit = bEnd - 32; + U64 v1 = seed + PRIME64_1 + PRIME64_2; + U64 v2 = seed + PRIME64_2; + U64 v3 = seed + 0; + U64 v4 = seed - PRIME64_1; + + do { + v1 = XXH64_round(v1, XXH_get64bits(p)); p+=8; + v2 = XXH64_round(v2, XXH_get64bits(p)); p+=8; + v3 = XXH64_round(v3, XXH_get64bits(p)); p+=8; + v4 = XXH64_round(v4, XXH_get64bits(p)); p+=8; + } while (p<=limit); + + h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18); + h64 = XXH64_mergeRound(h64, v1); + h64 = XXH64_mergeRound(h64, v2); + h64 = XXH64_mergeRound(h64, v3); + h64 = XXH64_mergeRound(h64, v4); + + } else { + h64 = seed + PRIME64_5; + } + + h64 += (U64) len; + + while (p+8<=bEnd) { + U64 const k1 = XXH64_round(0, XXH_get64bits(p)); + h64 ^= k1; + h64 = XXH_rotl64(h64,27) * PRIME64_1 + PRIME64_4; + p+=8; + } + + if (p+4<=bEnd) { + h64 ^= (U64)(XXH_get32bits(p)) * PRIME64_1; + h64 = XXH_rotl64(h64, 23) * PRIME64_2 + PRIME64_3; + p+=4; + } + + while (p<bEnd) { + h64 ^= (*p) * PRIME64_5; + h64 = XXH_rotl64(h64, 11) * PRIME64_1; + p++; + } + + h64 ^= h64 >> 33; + h64 *= PRIME64_2; + h64 ^= h64 >> 29; + h64 *= PRIME64_3; + h64 ^= h64 >> 32; + + return h64; +} + + +XXH_PUBLIC_API unsigned long long XXH64 (const void* input, size_t len, unsigned long long seed) +{ +#if 0 + /* Simple version, good for code maintenance, but unfortunately slow for small inputs */ + XXH64_CREATESTATE_STATIC(state); + XXH64_reset(state, seed); + XXH64_update(state, input, len); + return XXH64_digest(state); +#else + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + + if (XXH_FORCE_ALIGN_CHECK) { + if ((((size_t)input) & 7)==0) { /* Input is aligned, let's leverage the speed advantage */ + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH64_endian_align(input, len, seed, XXH_littleEndian, XXH_aligned); + else + return XXH64_endian_align(input, len, seed, XXH_bigEndian, XXH_aligned); + } } + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH64_endian_align(input, len, seed, XXH_littleEndian, XXH_unaligned); + else + return XXH64_endian_align(input, len, seed, XXH_bigEndian, XXH_unaligned); +#endif +} + + +/* ************************************************** +* Advanced Hash Functions +****************************************************/ + +XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void) +{ + return (XXH32_state_t*)XXH_malloc(sizeof(XXH32_state_t)); +} +XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr) +{ + XXH_free(statePtr); + return XXH_OK; +} + +XXH_PUBLIC_API XXH64_state_t* XXH64_createState(void) +{ + return (XXH64_state_t*)XXH_malloc(sizeof(XXH64_state_t)); +} +XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr) +{ + XXH_free(statePtr); + return XXH_OK; +} + + +/*** Hash feed ***/ + +XXH_PUBLIC_API XXH_errorcode XXH32_reset(XXH32_state_t* statePtr, unsigned int seed) +{ + XXH32_state_t state; /* using a local state to memcpy() in order to avoid strict-aliasing warnings */ + ZSTD_memset(&state, 0, sizeof(state)-4); /* do not write into reserved, for future removal */ + state.v1 = seed + PRIME32_1 + PRIME32_2; + state.v2 = seed + PRIME32_2; + state.v3 = seed + 0; + state.v4 = seed - PRIME32_1; + ZSTD_memcpy(statePtr, &state, sizeof(state)); + return XXH_OK; +} + + +XXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH64_state_t* statePtr, unsigned long long seed) +{ + XXH64_state_t state; /* using a local state to memcpy() in order to avoid strict-aliasing warnings */ + ZSTD_memset(&state, 0, sizeof(state)-8); /* do not write into reserved, for future removal */ + state.v1 = seed + PRIME64_1 + PRIME64_2; + state.v2 = seed + PRIME64_2; + state.v3 = seed + 0; + state.v4 = seed - PRIME64_1; + ZSTD_memcpy(statePtr, &state, sizeof(state)); + return XXH_OK; +} + + +FORCE_INLINE_TEMPLATE XXH_errorcode XXH32_update_endian (XXH32_state_t* state, const void* input, size_t len, XXH_endianess endian) +{ + const BYTE* p = (const BYTE*)input; + const BYTE* const bEnd = p + len; + +#ifdef XXH_ACCEPT_NULL_INPUT_POINTER + if (input==NULL) return XXH_ERROR; +#endif + + state->total_len_32 += (unsigned)len; + state->large_len |= (len>=16) | (state->total_len_32>=16); + + if (state->memsize + len < 16) { /* fill in tmp buffer */ + XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, len); + state->memsize += (unsigned)len; + return XXH_OK; + } + + if (state->memsize) { /* some data left from previous update */ + XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, 16-state->memsize); + { const U32* p32 = state->mem32; + state->v1 = XXH32_round(state->v1, XXH_readLE32(p32, endian)); p32++; + state->v2 = XXH32_round(state->v2, XXH_readLE32(p32, endian)); p32++; + state->v3 = XXH32_round(state->v3, XXH_readLE32(p32, endian)); p32++; + state->v4 = XXH32_round(state->v4, XXH_readLE32(p32, endian)); p32++; + } + p += 16-state->memsize; + state->memsize = 0; + } + + if (p <= bEnd-16) { + const BYTE* const limit = bEnd - 16; + U32 v1 = state->v1; + U32 v2 = state->v2; + U32 v3 = state->v3; + U32 v4 = state->v4; + + do { + v1 = XXH32_round(v1, XXH_readLE32(p, endian)); p+=4; + v2 = XXH32_round(v2, XXH_readLE32(p, endian)); p+=4; + v3 = XXH32_round(v3, XXH_readLE32(p, endian)); p+=4; + v4 = XXH32_round(v4, XXH_readLE32(p, endian)); p+=4; + } while (p<=limit); + + state->v1 = v1; + state->v2 = v2; + state->v3 = v3; + state->v4 = v4; + } + + if (p < bEnd) { + XXH_memcpy(state->mem32, p, (size_t)(bEnd-p)); + state->memsize = (unsigned)(bEnd-p); + } + + return XXH_OK; +} + +XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* state_in, const void* input, size_t len) +{ + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH32_update_endian(state_in, input, len, XXH_littleEndian); + else + return XXH32_update_endian(state_in, input, len, XXH_bigEndian); +} + + + +FORCE_INLINE_TEMPLATE U32 XXH32_digest_endian (const XXH32_state_t* state, XXH_endianess endian) +{ + const BYTE * p = (const BYTE*)state->mem32; + const BYTE* const bEnd = (const BYTE*)(state->mem32) + state->memsize; + U32 h32; + + if (state->large_len) { + h32 = XXH_rotl32(state->v1, 1) + XXH_rotl32(state->v2, 7) + XXH_rotl32(state->v3, 12) + XXH_rotl32(state->v4, 18); + } else { + h32 = state->v3 /* == seed */ + PRIME32_5; + } + + h32 += state->total_len_32; + + while (p+4<=bEnd) { + h32 += XXH_readLE32(p, endian) * PRIME32_3; + h32 = XXH_rotl32(h32, 17) * PRIME32_4; + p+=4; + } + + while (p<bEnd) { + h32 += (*p) * PRIME32_5; + h32 = XXH_rotl32(h32, 11) * PRIME32_1; + p++; + } + + h32 ^= h32 >> 15; + h32 *= PRIME32_2; + h32 ^= h32 >> 13; + h32 *= PRIME32_3; + h32 ^= h32 >> 16; + + return h32; +} + + +XXH_PUBLIC_API unsigned int XXH32_digest (const XXH32_state_t* state_in) +{ + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH32_digest_endian(state_in, XXH_littleEndian); + else + return XXH32_digest_endian(state_in, XXH_bigEndian); +} + + + +/* **** XXH64 **** */ + +FORCE_INLINE_TEMPLATE XXH_errorcode XXH64_update_endian (XXH64_state_t* state, const void* input, size_t len, XXH_endianess endian) +{ + const BYTE* p = (const BYTE*)input; + const BYTE* const bEnd = p + len; + +#ifdef XXH_ACCEPT_NULL_INPUT_POINTER + if (input==NULL) return XXH_ERROR; +#endif + + state->total_len += len; + + if (state->memsize + len < 32) { /* fill in tmp buffer */ + if (input != NULL) { + XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, len); + } + state->memsize += (U32)len; + return XXH_OK; + } + + if (state->memsize) { /* tmp buffer is full */ + XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, 32-state->memsize); + state->v1 = XXH64_round(state->v1, XXH_readLE64(state->mem64+0, endian)); + state->v2 = XXH64_round(state->v2, XXH_readLE64(state->mem64+1, endian)); + state->v3 = XXH64_round(state->v3, XXH_readLE64(state->mem64+2, endian)); + state->v4 = XXH64_round(state->v4, XXH_readLE64(state->mem64+3, endian)); + p += 32-state->memsize; + state->memsize = 0; + } + + if (p+32 <= bEnd) { + const BYTE* const limit = bEnd - 32; + U64 v1 = state->v1; + U64 v2 = state->v2; + U64 v3 = state->v3; + U64 v4 = state->v4; + + do { + v1 = XXH64_round(v1, XXH_readLE64(p, endian)); p+=8; + v2 = XXH64_round(v2, XXH_readLE64(p, endian)); p+=8; + v3 = XXH64_round(v3, XXH_readLE64(p, endian)); p+=8; + v4 = XXH64_round(v4, XXH_readLE64(p, endian)); p+=8; + } while (p<=limit); + + state->v1 = v1; + state->v2 = v2; + state->v3 = v3; + state->v4 = v4; + } + + if (p < bEnd) { + XXH_memcpy(state->mem64, p, (size_t)(bEnd-p)); + state->memsize = (unsigned)(bEnd-p); + } + + return XXH_OK; +} + +XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* state_in, const void* input, size_t len) +{ + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH64_update_endian(state_in, input, len, XXH_littleEndian); + else + return XXH64_update_endian(state_in, input, len, XXH_bigEndian); +} + + + +FORCE_INLINE_TEMPLATE U64 XXH64_digest_endian (const XXH64_state_t* state, XXH_endianess endian) +{ + const BYTE * p = (const BYTE*)state->mem64; + const BYTE* const bEnd = (const BYTE*)state->mem64 + state->memsize; + U64 h64; + + if (state->total_len >= 32) { + U64 const v1 = state->v1; + U64 const v2 = state->v2; + U64 const v3 = state->v3; + U64 const v4 = state->v4; + + h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18); + h64 = XXH64_mergeRound(h64, v1); + h64 = XXH64_mergeRound(h64, v2); + h64 = XXH64_mergeRound(h64, v3); + h64 = XXH64_mergeRound(h64, v4); + } else { + h64 = state->v3 + PRIME64_5; + } + + h64 += (U64) state->total_len; + + while (p+8<=bEnd) { + U64 const k1 = XXH64_round(0, XXH_readLE64(p, endian)); + h64 ^= k1; + h64 = XXH_rotl64(h64,27) * PRIME64_1 + PRIME64_4; + p+=8; + } + + if (p+4<=bEnd) { + h64 ^= (U64)(XXH_readLE32(p, endian)) * PRIME64_1; + h64 = XXH_rotl64(h64, 23) * PRIME64_2 + PRIME64_3; + p+=4; + } + + while (p<bEnd) { + h64 ^= (*p) * PRIME64_5; + h64 = XXH_rotl64(h64, 11) * PRIME64_1; + p++; + } + + h64 ^= h64 >> 33; + h64 *= PRIME64_2; + h64 ^= h64 >> 29; + h64 *= PRIME64_3; + h64 ^= h64 >> 32; + + return h64; +} + + +XXH_PUBLIC_API unsigned long long XXH64_digest (const XXH64_state_t* state_in) +{ + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH64_digest_endian(state_in, XXH_littleEndian); + else + return XXH64_digest_endian(state_in, XXH_bigEndian); +} + + +/* ************************** +* Canonical representation +****************************/ + +/*! Default XXH result types are basic unsigned 32 and 64 bits. +* The canonical representation follows human-readable write convention, aka big-endian (large digits first). +* These functions allow transformation of hash result into and from its canonical format. +* This way, hash values can be written into a file or buffer, and remain comparable across different systems and programs. +*/ + +XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash) +{ + XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) == sizeof(XXH32_hash_t)); + if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap32(hash); + ZSTD_memcpy(dst, &hash, sizeof(*dst)); +} + +XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash) +{ + XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) == sizeof(XXH64_hash_t)); + if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap64(hash); + ZSTD_memcpy(dst, &hash, sizeof(*dst)); +} + +XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src) +{ + return XXH_readBE32(src); +} + +XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src) +{ + return XXH_readBE64(src); +} diff --git a/src/bled/xxhash.h b/src/bled/xxhash.h new file mode 100644 index 00000000..8865cfd8 --- /dev/null +++ b/src/bled/xxhash.h @@ -0,0 +1,276 @@ +/* + * xxHash - Extremely Fast Hash algorithm + * Header File + * Copyright (c) Yann Collet, Facebook, Inc. + * + * You can contact the author at : + * - xxHash source repository : https://github.com/Cyan4973/xxHash + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. +*/ + +/* Notice extracted from xxHash homepage : + +xxHash is an extremely fast Hash algorithm, running at RAM speed limits. +It also successfully passes all tests from the SMHasher suite. + +Comparison (single thread, Windows Seven 32 bits, using SMHasher on a Core 2 Duo @3GHz) + +Name Speed Q.Score Author +xxHash 5.4 GB/s 10 +CrapWow 3.2 GB/s 2 Andrew +MumurHash 3a 2.7 GB/s 10 Austin Appleby +SpookyHash 2.0 GB/s 10 Bob Jenkins +SBox 1.4 GB/s 9 Bret Mulvey +Lookup3 1.2 GB/s 9 Bob Jenkins +SuperFastHash 1.2 GB/s 1 Paul Hsieh +CityHash64 1.05 GB/s 10 Pike & Alakuijala +FNV 0.55 GB/s 5 Fowler, Noll, Vo +CRC32 0.43 GB/s 9 +MD5-32 0.33 GB/s 10 Ronald L. Rivest +SHA1-32 0.28 GB/s 10 + +Q.Score is a measure of quality of the hash function. +It depends on successfully passing SMHasher test set. +10 is a perfect score. + +A 64-bits version, named XXH64, is available since r35. +It offers much better speed, but for 64-bits applications only. +Name Speed on 64 bits Speed on 32 bits +XXH64 13.8 GB/s 1.9 GB/s +XXH32 6.8 GB/s 6.0 GB/s +*/ + + +#ifndef XXHASH_H_5627135585666179 +#define XXHASH_H_5627135585666179 1 + + +/* **************************** +* Definitions +******************************/ +#include "zstd_deps.h" +typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode; + + +/* **************************** +* API modifier +******************************/ +/** XXH_PRIVATE_API +* This is useful if you want to include xxhash functions in `static` mode +* in order to inline them, and remove their symbol from the public list. +* Methodology : +* #define XXH_PRIVATE_API +* #include "xxhash.h" +* `xxhash.c` is automatically included. +* It's not useful to compile and link it as a separate module anymore. +*/ +#ifdef XXH_PRIVATE_API +# if defined(__GNUC__) +# define XXH_PUBLIC_API static __inline __attribute__((unused)) +# elif (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) +# define XXH_PUBLIC_API static inline +# elif defined(_MSC_VER) +# define XXH_PUBLIC_API static __inline +# else +# define XXH_PUBLIC_API static /* this version may generate warnings for unused static functions; disable the relevant warning */ +# endif +#else +# define XXH_PUBLIC_API /* do nothing */ +#endif /* XXH_PRIVATE_API */ + +/*!XXH_NAMESPACE, aka Namespace Emulation : + +If you want to include _and expose_ xxHash functions from within your own library, +but also want to avoid symbol collisions with another library which also includes xxHash, + +you can use XXH_NAMESPACE, to automatically prefix any public symbol from xxhash library +with the value of XXH_NAMESPACE (so avoid to keep it NULL and avoid numeric values). + +Note that no change is required within the calling program as long as it includes `xxhash.h` : +regular symbol name will be automatically translated by this header. +*/ +#ifdef XXH_NAMESPACE +# define XXH_CAT(A,B) A##B +# define XXH_NAME2(A,B) XXH_CAT(A,B) +# define XXH32 XXH_NAME2(XXH_NAMESPACE, XXH32) +# define XXH64 XXH_NAME2(XXH_NAMESPACE, XXH64) +# define XXH_versionNumber XXH_NAME2(XXH_NAMESPACE, XXH_versionNumber) +# define XXH32_createState XXH_NAME2(XXH_NAMESPACE, XXH32_createState) +# define XXH64_createState XXH_NAME2(XXH_NAMESPACE, XXH64_createState) +# define XXH32_freeState XXH_NAME2(XXH_NAMESPACE, XXH32_freeState) +# define XXH64_freeState XXH_NAME2(XXH_NAMESPACE, XXH64_freeState) +# define XXH32_reset XXH_NAME2(XXH_NAMESPACE, XXH32_reset) +# define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset) +# define XXH32_update XXH_NAME2(XXH_NAMESPACE, XXH32_update) +# define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update) +# define XXH32_digest XXH_NAME2(XXH_NAMESPACE, XXH32_digest) +# define XXH64_digest XXH_NAME2(XXH_NAMESPACE, XXH64_digest) +# define XXH32_copyState XXH_NAME2(XXH_NAMESPACE, XXH32_copyState) +# define XXH64_copyState XXH_NAME2(XXH_NAMESPACE, XXH64_copyState) +# define XXH32_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH32_canonicalFromHash) +# define XXH64_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH64_canonicalFromHash) +# define XXH32_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH32_hashFromCanonical) +# define XXH64_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH64_hashFromCanonical) +#endif + + +/* ************************************* +* Version +***************************************/ +#define XXH_VERSION_MAJOR 0 +#define XXH_VERSION_MINOR 6 +#define XXH_VERSION_RELEASE 2 +#define XXH_VERSION_NUMBER (XXH_VERSION_MAJOR *100*100 + XXH_VERSION_MINOR *100 + XXH_VERSION_RELEASE) +XXH_PUBLIC_API unsigned XXH_versionNumber (void); + + +/* **************************** +* Simple Hash Functions +******************************/ +typedef unsigned int XXH32_hash_t; +typedef unsigned long long XXH64_hash_t; + +XXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t length, unsigned int seed); +XXH_PUBLIC_API XXH64_hash_t XXH64 (const void* input, size_t length, unsigned long long seed); + +/*! +XXH32() : + Calculate the 32-bits hash of sequence "length" bytes stored at memory address "input". + The memory between input & input+length must be valid (allocated and read-accessible). + "seed" can be used to alter the result predictably. + Speed on Core 2 Duo @ 3 GHz (single thread, SMHasher benchmark) : 5.4 GB/s +XXH64() : + Calculate the 64-bits hash of sequence of length "len" stored at memory address "input". + "seed" can be used to alter the result predictably. + This function runs 2x faster on 64-bits systems, but slower on 32-bits systems (see benchmark). +*/ + + +/* **************************** +* Streaming Hash Functions +******************************/ +typedef struct XXH32_state_s XXH32_state_t; /* incomplete type */ +typedef struct XXH64_state_s XXH64_state_t; /* incomplete type */ + +/*! State allocation, compatible with dynamic libraries */ + +XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void); +XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr); + +XXH_PUBLIC_API XXH64_state_t* XXH64_createState(void); +XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr); + + +/* hash streaming */ + +XXH_PUBLIC_API XXH_errorcode XXH32_reset (XXH32_state_t* statePtr, unsigned int seed); +XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length); +XXH_PUBLIC_API XXH32_hash_t XXH32_digest (const XXH32_state_t* statePtr); + +XXH_PUBLIC_API XXH_errorcode XXH64_reset (XXH64_state_t* statePtr, unsigned long long seed); +XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* statePtr, const void* input, size_t length); +XXH_PUBLIC_API XXH64_hash_t XXH64_digest (const XXH64_state_t* statePtr); + +/* +These functions generate the xxHash of an input provided in multiple segments. +Note that, for small input, they are slower than single-call functions, due to state management. +For small input, prefer `XXH32()` and `XXH64()` . + +XXH state must first be allocated, using XXH*_createState() . + +Start a new hash by initializing state with a seed, using XXH*_reset(). + +Then, feed the hash state by calling XXH*_update() as many times as necessary. +Obviously, input must be allocated and read accessible. +The function returns an error code, with 0 meaning OK, and any other value meaning there is an error. + +Finally, a hash value can be produced anytime, by using XXH*_digest(). +This function returns the nn-bits hash as an int or long long. + +It's still possible to continue inserting input into the hash state after a digest, +and generate some new hashes later on, by calling again XXH*_digest(). + +When done, free XXH state space if it was allocated dynamically. +*/ + + +/* ************************** +* Utils +****************************/ +#if !(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) /* ! C99 */ +# define restrict /* disable restrict */ +#endif + +XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* restrict dst_state, const XXH32_state_t* restrict src_state); +XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* restrict dst_state, const XXH64_state_t* restrict src_state); + + +/* ************************** +* Canonical representation +****************************/ +/* Default result type for XXH functions are primitive unsigned 32 and 64 bits. +* The canonical representation uses human-readable write convention, aka big-endian (large digits first). +* These functions allow transformation of hash result into and from its canonical format. +* This way, hash values can be written into a file / memory, and remain comparable on different systems and programs. +*/ +typedef struct { unsigned char digest[4]; } XXH32_canonical_t; +typedef struct { unsigned char digest[8]; } XXH64_canonical_t; + +XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash); +XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash); + +XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src); +XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src); + +#endif /* XXHASH_H_5627135585666179 */ + + + +/* ================================================================================================ + This section contains definitions which are not guaranteed to remain stable. + They may change in future versions, becoming incompatible with a different version of the library. + They shall only be used with static linking. + Never use these definitions in association with dynamic linking ! +=================================================================================================== */ +#if !defined(XXH_STATIC_H_3543687687345) +#define XXH_STATIC_H_3543687687345 + +/* These definitions are only meant to allow allocation of XXH state + statically, on stack, or in a struct for example. + Do not use members directly. */ + + struct XXH32_state_s { + unsigned total_len_32; + unsigned large_len; + unsigned v1; + unsigned v2; + unsigned v3; + unsigned v4; + unsigned mem32[4]; /* buffer defined as U32 for alignment */ + unsigned memsize; + unsigned reserved; /* never read nor write, will be removed in a future version */ + }; /* typedef'd to XXH32_state_t */ + + struct XXH64_state_s { + unsigned long long total_len; + unsigned long long v1; + unsigned long long v2; + unsigned long long v3; + unsigned long long v4; + unsigned long long mem64[4]; /* buffer defined as U64 for alignment */ + unsigned memsize; + unsigned reserved[2]; /* never read nor write, will be removed in a future version */ + }; /* typedef'd to XXH64_state_t */ + + +# ifdef XXH_PRIVATE_API +# include "xxhash.c" /* include xxhash functions as `static`, for inlining */ +# endif + +#endif /* XXH_STATIC_LINKING_ONLY && XXH_STATIC_H_3543687687345 */ + + diff --git a/src/bled/xz_config.h b/src/bled/xz_config.h index 682ec553..05d90af9 100644 --- a/src/bled/xz_config.h +++ b/src/bled/xz_config.h @@ -18,7 +18,6 @@ /* #define XZ_DEC_ARMTHUMB */ /* #define XZ_DEC_SPARC */ -#include <assert.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> diff --git a/src/bled/xz_dec_lzma2.c b/src/bled/xz_dec_lzma2.c index ed519d6d..a6911db8 100644 --- a/src/bled/xz_dec_lzma2.c +++ b/src/bled/xz_dec_lzma2.c @@ -10,6 +10,7 @@ #include "xz_private.h" #include "xz_lzma2.h" +#include <assert.h> /* * Range decoder initialization eats the first five bytes of each LZMA chunk. diff --git a/src/bled/zstd.h b/src/bled/zstd.h new file mode 100644 index 00000000..858d434a --- /dev/null +++ b/src/bled/zstd.h @@ -0,0 +1,148 @@ +/* + * Copyright (c) Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#ifndef ZSTD_H_235446 +#define ZSTD_H_235446 + +/* ====== Dependency ======*/ +#include <limits.h> /* INT_MAX */ +#include <stddef.h> /* size_t */ +#include "zstd_config.h" + + +/* ===== ZSTDLIB_API : control library symbols visibility ===== */ +#define ZSTDLIB_VISIBILITY +#define ZSTDLIB_API ZSTDLIB_VISIBILITY + +/* All magic numbers are supposed read/written to/from files/memory using little-endian convention */ +#define ZSTD_MAGICNUMBER 0xFD2FB528 /* valid since v0.8.0 */ +#define ZSTD_MAGIC_DICTIONARY 0xEC30A437 /* valid since v0.7.0 */ +#define ZSTD_MAGIC_SKIPPABLE_START 0x184D2A50 /* all 16 values, from 0x184D2A50 to 0x184D2A5F, signal the beginning of a skippable frame */ +#define ZSTD_MAGIC_SKIPPABLE_MASK 0xFFFFFFF0 + +#define ZSTD_BLOCKSIZELOG_MAX 17 +#define ZSTD_BLOCKSIZE_MAX (1<<ZSTD_BLOCKSIZELOG_MAX) + +#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1) +#define ZSTD_CONTENTSIZE_ERROR (0ULL - 2) +ZSTDLIB_API unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize); +ZSTDLIB_API unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize); + +typedef struct ZSTD_CCtx_s ZSTD_CCtx; +typedef struct ZSTD_DCtx_s ZSTD_DCtx; +ZSTDLIB_API ZSTD_DCtx* ZSTD_createDCtx(void); +ZSTDLIB_API size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx); /* accept NULL pointer */ + +typedef enum { + ZSTD_reset_session_only = 1, + ZSTD_reset_parameters = 2, + ZSTD_reset_session_and_parameters = 3 +} ZSTD_ResetDirective; +ZSTDLIB_API size_t ZSTD_DCtx_reset(ZSTD_DCtx* dctx, ZSTD_ResetDirective reset); + +typedef struct ZSTD_inBuffer_s { + const void* src; /**< start of input buffer */ + size_t size; /**< size of input buffer */ + size_t pos; /**< position where reading stopped. Will be updated. Necessarily 0 <= pos <= size */ +} ZSTD_inBuffer; + +typedef struct ZSTD_outBuffer_s { + void* dst; /**< start of output buffer */ + size_t size; /**< size of output buffer */ + size_t pos; /**< position where writing stopped. Will be updated. Necessarily 0 <= pos <= size */ +} ZSTD_outBuffer; + +typedef ZSTD_DCtx ZSTD_DStream; /**< DCtx and DStream are now effectively same object (>= v1.3.0) */ +ZSTDLIB_API ZSTD_DStream* ZSTD_createDStream(void); +ZSTDLIB_API size_t ZSTD_freeDStream(ZSTD_DStream* zds); /* accept NULL pointer */ + +ZSTDLIB_API size_t ZSTD_initDStream(ZSTD_DStream* zds); + +ZSTDLIB_API size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input); + +ZSTDLIB_API size_t ZSTD_DStreamInSize(void); /*!< recommended size for input buffer */ +ZSTDLIB_API size_t ZSTD_DStreamOutSize(void); /*!< recommended size for output buffer. Guarantee to successfully flush at least one complete block in all circumstances. */ + +typedef struct ZSTD_DDict_s ZSTD_DDict; +ZSTDLIB_API unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize); +ZSTDLIB_API unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize); + +ZSTDLIB_API size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx); + +#define ZSTD_FRAMEHEADERSIZE_PREFIX(format) ((format) == ZSTD_f_zstd1 ? 5 : 1) /* minimum input size required to query frame header size */ +#define ZSTD_FRAMEHEADERSIZE_MIN(format) ((format) == ZSTD_f_zstd1 ? 6 : 2) +#define ZSTD_FRAMEHEADERSIZE_MAX 18 /* can be useful for static allocation */ +#define ZSTD_SKIPPABLEHEADERSIZE 8 + +/* compression parameter bounds */ +#define ZSTD_WINDOWLOG_MAX_32 30 +#define ZSTD_WINDOWLOG_MAX_64 31 +#define ZSTD_WINDOWLOG_MAX ((int)(sizeof(size_t) == 4 ? ZSTD_WINDOWLOG_MAX_32 : ZSTD_WINDOWLOG_MAX_64)) + + +#define ZSTD_WINDOWLOG_LIMIT_DEFAULT 27 /* by default, the streaming decoder will refuse any frame + */ + + + +typedef enum { + ZSTD_f_zstd1 = 0, /* zstd frame format, specified in zstd_compression_format.md (default) */ + ZSTD_f_zstd1_magicless = 1 /* Variant of zstd frame format, without initial 4-bytes magic number. + * Useful to save 4 bytes per generated frame. + * Decoder cannot recognise automatically this format, requiring this instruction. */ +} ZSTD_format_e; + +typedef enum { + /* Note: this enum controls ZSTD_d_forceIgnoreChecksum */ + ZSTD_d_validateChecksum = 0, + ZSTD_d_ignoreChecksum = 1 +} ZSTD_forceIgnoreChecksum_e; + +typedef enum { + /* Note: this enum controls ZSTD_d_refMultipleDDicts */ + ZSTD_rmd_refSingleDDict = 0, + ZSTD_rmd_refMultipleDDicts = 1 +} ZSTD_refMultipleDDicts_e; + +ZSTDLIB_API unsigned ZSTD_isSkippableFrame(const void* buffer, size_t size); + +ZSTDLIB_API size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict); +ZSTDLIB_API size_t ZSTD_resetDStream(ZSTD_DStream* zds); + +/*===== Buffer-less streaming decompression functions =====*/ +typedef enum { ZSTD_frame, ZSTD_skippableFrame } ZSTD_frameType_e; +typedef struct { + unsigned long long frameContentSize; /* if == ZSTD_CONTENTSIZE_UNKNOWN, it means this field is not available. 0 means "empty" */ + unsigned long long windowSize; /* can be very large, up to <= frameContentSize */ + unsigned blockSizeMax; + ZSTD_frameType_e frameType; /* if == ZSTD_skippableFrame, frameContentSize is the size of skippable content */ + unsigned headerSize; + unsigned dictID; + unsigned checksumFlag; +} ZSTD_frameHeader; + +ZSTDLIB_API size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize); /**< doesn't consume input */ +ZSTDLIB_API size_t ZSTD_getFrameHeader_advanced(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize, ZSTD_format_e format); +ZSTDLIB_API size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize); /**< when frame content size is not known, pass in frameContentSize == ZSTD_CONTENTSIZE_UNKNOWN */ + +ZSTDLIB_API size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx); +ZSTDLIB_API size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize); +ZSTDLIB_API size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict); + +ZSTDLIB_API size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx); +ZSTDLIB_API size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize); + +ZSTDLIB_API void ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx); +typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e; +ZSTDLIB_API ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx); + +ZSTDLIB_API size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize); +#endif /* ZSTD_H_ZSTD_STATIC_LINKING_ONLY */ + diff --git a/src/bled/zstd_compiler.h b/src/bled/zstd_compiler.h new file mode 100644 index 00000000..0064dac0 --- /dev/null +++ b/src/bled/zstd_compiler.h @@ -0,0 +1,242 @@ +/* + * Copyright (c) Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#ifndef ZSTD_COMPILER_H +#define ZSTD_COMPILER_H + +/*-******************************************************* +* Compiler specifics +*********************************************************/ +/* force inlining */ + +#if !defined(ZSTD_NO_INLINE) +#if (defined(__GNUC__) && !defined(__STRICT_ANSI__)) || defined(__cplusplus) || defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */ +# define INLINE_KEYWORD inline +#else +# define INLINE_KEYWORD +#endif + +#if defined(__GNUC__) || defined(__ICCARM__) +# define FORCE_INLINE_ATTR __attribute__((always_inline)) +#elif defined(_MSC_VER) +# define FORCE_INLINE_ATTR __forceinline +#else +# define FORCE_INLINE_ATTR +#endif + +#else + +#define INLINE_KEYWORD +#define FORCE_INLINE_ATTR + +#endif + +/** + On MSVC qsort requires that functions passed into it use the __cdecl calling conversion(CC). + This explictly marks such functions as __cdecl so that the code will still compile + if a CC other than __cdecl has been made the default. +*/ +#if defined(_MSC_VER) +# define WIN_CDECL __cdecl +#else +# define WIN_CDECL +#endif + +/** + * FORCE_INLINE_TEMPLATE is used to define C "templates", which take constant + * parameters. They must be inlined for the compiler to eliminate the constant + * branches. + */ +#define FORCE_INLINE_TEMPLATE static INLINE_KEYWORD FORCE_INLINE_ATTR +/** + * HINT_INLINE is used to help the compiler generate better code. It is *not* + * used for "templates", so it can be tweaked based on the compilers + * performance. + * + * gcc-4.8 and gcc-4.9 have been shown to benefit from leaving off the + * always_inline attribute. + * + * clang up to 5.0.0 (trunk) benefit tremendously from the always_inline + * attribute. + */ +#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8 && __GNUC__ < 5 +# define HINT_INLINE static INLINE_KEYWORD +#else +# define HINT_INLINE static INLINE_KEYWORD FORCE_INLINE_ATTR +#endif + +/* UNUSED_ATTR tells the compiler it is okay if the function is unused. */ +#if defined(__GNUC__) +# define UNUSED_ATTR __attribute__((unused)) +#else +# define UNUSED_ATTR +#endif + +/* force no inlining */ +#ifdef _MSC_VER +# define FORCE_NOINLINE static __declspec(noinline) +#else +# if defined(__GNUC__) || defined(__ICCARM__) +# define FORCE_NOINLINE static __attribute__((__noinline__)) +# else +# define FORCE_NOINLINE static +# endif +#endif + + +/* target attribute */ +#ifndef __has_attribute + #define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */ +#endif +#if defined(__GNUC__) || defined(__ICCARM__) +# define TARGET_ATTRIBUTE(target) __attribute__((__target__(target))) +#else +# define TARGET_ATTRIBUTE(target) +#endif + +/* Enable runtime BMI2 dispatch based on the CPU. + * Enabled for clang & gcc >=4.8 on x86 when BMI2 isn't enabled by default. + */ +#ifndef DYNAMIC_BMI2 + #if ((defined(__clang__) && __has_attribute(__target__)) \ + || (defined(__GNUC__) \ + && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)))) \ + && (defined(__x86_64__) || defined(_M_X64)) \ + && !defined(__BMI2__) + # define DYNAMIC_BMI2 1 + #else + # define DYNAMIC_BMI2 0 + #endif +#endif + +/* prefetch + * can be disabled, by declaring NO_PREFETCH build macro */ +#if defined(NO_PREFETCH) +# define PREFETCH_L1(ptr) (void)(ptr) /* disabled */ +# define PREFETCH_L2(ptr) (void)(ptr) /* disabled */ +#else +# if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_I86)) /* _mm_prefetch() is not defined outside of x86/x64 */ +# include <mmintrin.h> /* https://msdn.microsoft.com/fr-fr/library/84szxsww(v=vs.90).aspx */ +# define PREFETCH_L1(ptr) _mm_prefetch((const char*)(ptr), _MM_HINT_T0) +# define PREFETCH_L2(ptr) _mm_prefetch((const char*)(ptr), _MM_HINT_T1) +# elif defined(__GNUC__) && ( (__GNUC__ >= 4) || ( (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1) ) ) +# define PREFETCH_L1(ptr) __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */) +# define PREFETCH_L2(ptr) __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */) +# elif defined(__aarch64__) +# define PREFETCH_L1(ptr) __asm__ __volatile__("prfm pldl1keep, %0" ::"Q"(*(ptr))) +# define PREFETCH_L2(ptr) __asm__ __volatile__("prfm pldl2keep, %0" ::"Q"(*(ptr))) +# else +# define PREFETCH_L1(ptr) (void)(ptr) /* disabled */ +# define PREFETCH_L2(ptr) (void)(ptr) /* disabled */ +# endif +#endif /* NO_PREFETCH */ + +#define CACHELINE_SIZE 64 + +#define PREFETCH_AREA(p, s) { \ + const char* const _ptr = (const char*)(p); \ + size_t const _size = (size_t)(s); \ + size_t _pos; \ + for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \ + PREFETCH_L2(_ptr + _pos); \ + } \ +} + +/* vectorization + * older GCC (pre gcc-4.3 picked as the cutoff) uses a different syntax, + * and some compilers, like Intel ICC and MCST LCC, do not support it at all. */ +#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__) && !defined(__LCC__) +# if (__GNUC__ == 4 && __GNUC_MINOR__ > 3) || (__GNUC__ >= 5) +# define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize"))) +# else +# define DONT_VECTORIZE _Pragma("GCC optimize(\"no-tree-vectorize\")") +# endif +#else +# define DONT_VECTORIZE +#endif + +/* Tell the compiler that a branch is likely or unlikely. + * Only use these macros if it causes the compiler to generate better code. + * If you can remove a LIKELY/UNLIKELY annotation without speed changes in gcc + * and clang, please do. + */ +#if defined(__GNUC__) +#define LIKELY(x) (__builtin_expect((x), 1)) +#define UNLIKELY(x) (__builtin_expect((x), 0)) +#else +#define LIKELY(x) (x) +#define UNLIKELY(x) (x) +#endif + +/* disable warnings */ +#ifdef _MSC_VER /* Visual Studio */ +# include <intrin.h> /* For Visual 2005 */ +# pragma warning(disable : 4100) /* disable: C4100: unreferenced formal parameter */ +# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ +# pragma warning(disable : 4204) /* disable: C4204: non-constant aggregate initializer */ +# pragma warning(disable : 4214) /* disable: C4214: non-int bitfields */ +# pragma warning(disable : 4324) /* disable: C4324: padded structure */ +#endif + +/*Like DYNAMIC_BMI2 but for compile time determination of BMI2 support*/ +#ifndef STATIC_BMI2 +# if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_I86)) +# ifdef __AVX2__ //MSVC does not have a BMI2 specific flag, but every CPU that supports AVX2 also supports BMI2 +# define STATIC_BMI2 1 +# endif +# endif +#endif + +#ifndef STATIC_BMI2 + #define STATIC_BMI2 0 +#endif + +/* compile time determination of SIMD support */ + +/* compat. with non-clang compilers */ +#ifndef __has_builtin +# define __has_builtin(x) 0 +#endif + +/* compat. with non-clang compilers */ +#ifndef __has_feature +# define __has_feature(x) 0 +#endif + +/* C-language Attributes are added in C23. */ +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201710L) && defined(__has_c_attribute) +# define ZSTD_HAS_C_ATTRIBUTE(x) __has_c_attribute(x) +#else +# define ZSTD_HAS_C_ATTRIBUTE(x) 0 +#endif + +/* Only use C++ attributes in C++. Some compilers report support for C++ + * attributes when compiling with C. + */ +#define ZSTD_HAS_CPP_ATTRIBUTE(x) 0 + +/* Define ZSTD_FALLTHROUGH macro for annotating switch case with the 'fallthrough' attribute. + * - C23: https://en.cppreference.com/w/c/language/attributes/fallthrough + * - CPP17: https://en.cppreference.com/w/cpp/language/attributes/fallthrough + * - Else: __attribute__((__fallthrough__)) + */ +#ifndef ZSTD_FALLTHROUGH +# if ZSTD_HAS_C_ATTRIBUTE(fallthrough) +# define ZSTD_FALLTHROUGH [[fallthrough]] +# elif ZSTD_HAS_CPP_ATTRIBUTE(fallthrough) +# define ZSTD_FALLTHROUGH [[fallthrough]] +# elif __has_attribute(__fallthrough__) +# define ZSTD_FALLTHROUGH __attribute__((__fallthrough__)) +# else +# define ZSTD_FALLTHROUGH +# endif +#endif + +#endif /* ZSTD_COMPILER_H */ diff --git a/src/bled/zstd_config.h b/src/bled/zstd_config.h new file mode 100644 index 00000000..4792e1e2 --- /dev/null +++ b/src/bled/zstd_config.h @@ -0,0 +1,49 @@ +#ifndef ZSTD_CONFIG +#define ZSTD_CONFIG + +#define ZSTD_DEBUGLEVEL 0 +#define ZSTD_LEGACY_SUPPORT 0 +#define ZSTD_LIB_DEPRECATED 0 +#define ZSTD_NO_UNUSED_FUNCTIONS 1 +#define ZSTD_STRIP_ERROR_STRINGS 0 +#define ZSTD_TRACE 0 +#define ZSTD_DECOMPRESS_DICTIONARY 0 +#define ZSTD_DECOMPRESS_MULTIFRAME 0 + +#if CONFIG_FEATURE_ZSTD_SMALL >= 9 +#define ZSTD_NO_INLINE 1 +#endif + +#if CONFIG_FEATURE_ZSTD_SMALL >= 7 +#define HUF_FORCE_DECOMPRESS_X1 1 +#define ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT 1 +#elif CONFIG_FEATURE_ZSTD_SMALL >= 5 +#define HUF_FORCE_DECOMPRESS_X1 1 +#endif + +#if CONFIG_FEATURE_ZSTD_SMALL <= 7 +/* doesnt blow up code too much, -O3 is horrible */ +#ifdef __GNUC__ +#pragma GCC optimize ("O2") +#endif +#endif + +#if CONFIG_FEATURE_ZSTD_SMALL > 0 +/* no dynamic detection of bmi2 instruction, + * prefer using CFLAGS setting to -march=haswell or similar */ +# if !defined(__BMI2__) +# define DYNAMIC_BMI2 0 +# endif +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" +#endif + +/* Include zstd_deps.h first with all the options we need enabled. */ +#define ZSTD_DEPS_NEED_MALLOC +#define ZSTD_DEPS_NEED_MATH64 +#define ZSTD_DEPS_NEED_STDINT + +#endif diff --git a/src/bled/zstd_cpu.h b/src/bled/zstd_cpu.h new file mode 100644 index 00000000..6866f60f --- /dev/null +++ b/src/bled/zstd_cpu.h @@ -0,0 +1,213 @@ +/* + * Copyright (c) Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#ifndef ZSTD_COMMON_CPU_H +#define ZSTD_COMMON_CPU_H + +/** + * Implementation taken from folly/CpuId.h + * https://github.com/facebook/folly/blob/master/folly/CpuId.h + */ + +#include "zstd_mem.h" + +#ifdef _MSC_VER +#include <intrin.h> +#endif + +typedef struct { + U32 f1c; + U32 f1d; + U32 f7b; + U32 f7c; +} ZSTD_cpuid_t; + +MEM_STATIC ZSTD_cpuid_t ZSTD_cpuid(void) { + U32 f1c = 0; + U32 f1d = 0; + U32 f7b = 0; + U32 f7c = 0; +#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86)) + int reg[4]; + __cpuid((int*)reg, 0); + { + int const n = reg[0]; + if (n >= 1) { + __cpuid((int*)reg, 1); + f1c = (U32)reg[2]; + f1d = (U32)reg[3]; + } + if (n >= 7) { + __cpuidex((int*)reg, 7, 0); + f7b = (U32)reg[1]; + f7c = (U32)reg[2]; + } + } +#elif defined(__i386__) && defined(__PIC__) && !defined(__clang__) && defined(__GNUC__) + /* The following block like the normal cpuid branch below, but gcc + * reserves ebx for use of its pic register so we must specially + * handle the save and restore to avoid clobbering the register + */ + U32 n; + __asm__( + "pushl %%ebx\n\t" + "cpuid\n\t" + "popl %%ebx\n\t" + : "=a"(n) + : "a"(0) + : "ecx", "edx"); + if (n >= 1) { + U32 f1a; + __asm__( + "pushl %%ebx\n\t" + "cpuid\n\t" + "popl %%ebx\n\t" + : "=a"(f1a), "=c"(f1c), "=d"(f1d) + : "a"(1)); + } + if (n >= 7) { + __asm__( + "pushl %%ebx\n\t" + "cpuid\n\t" + "movl %%ebx, %%eax\n\t" + "popl %%ebx" + : "=a"(f7b), "=c"(f7c) + : "a"(7), "c"(0) + : "edx"); + } +#elif defined(__x86_64__) || defined(_M_X64) || defined(__i386__) + U32 n; + __asm__("cpuid" : "=a"(n) : "a"(0) : "ebx", "ecx", "edx"); + if (n >= 1) { + U32 f1a; + __asm__("cpuid" : "=a"(f1a), "=c"(f1c), "=d"(f1d) : "a"(1) : "ebx"); + } + if (n >= 7) { + U32 f7a; + __asm__("cpuid" + : "=a"(f7a), "=b"(f7b), "=c"(f7c) + : "a"(7), "c"(0) + : "edx"); + } +#endif + { + ZSTD_cpuid_t cpuid; + cpuid.f1c = f1c; + cpuid.f1d = f1d; + cpuid.f7b = f7b; + cpuid.f7c = f7c; + return cpuid; + } +} + +#define X(name, r, bit) \ + MEM_STATIC int ZSTD_cpuid_##name(ZSTD_cpuid_t const cpuid) { \ + return ((cpuid.r) & (1U << bit)) != 0; \ + } + +/* cpuid(1): Processor Info and Feature Bits. */ +#define C(name, bit) X(name, f1c, bit) + C(sse3, 0) + C(pclmuldq, 1) + C(dtes64, 2) + C(monitor, 3) + C(dscpl, 4) + C(vmx, 5) + C(smx, 6) + C(eist, 7) + C(tm2, 8) + C(ssse3, 9) + C(cnxtid, 10) + C(fma, 12) + C(cx16, 13) + C(xtpr, 14) + C(pdcm, 15) + C(pcid, 17) + C(dca, 18) + C(sse41, 19) + C(sse42, 20) + C(x2apic, 21) + C(movbe, 22) + C(popcnt, 23) + C(tscdeadline, 24) + C(aes, 25) + C(xsave, 26) + C(osxsave, 27) + C(avx, 28) + C(f16c, 29) + C(rdrand, 30) +#undef C +#define D(name, bit) X(name, f1d, bit) + D(fpu, 0) + D(vme, 1) + D(de, 2) + D(pse, 3) + D(tsc, 4) + D(msr, 5) + D(pae, 6) + D(mce, 7) + D(cx8, 8) + D(apic, 9) + D(sep, 11) + D(mtrr, 12) + D(pge, 13) + D(mca, 14) + D(cmov, 15) + D(pat, 16) + D(pse36, 17) + D(psn, 18) + D(clfsh, 19) + D(ds, 21) + D(acpi, 22) + D(mmx, 23) + D(fxsr, 24) + D(sse, 25) + D(sse2, 26) + D(ss, 27) + D(htt, 28) + D(tm, 29) + D(pbe, 31) +#undef D + +/* cpuid(7): Extended Features. */ +#define B(name, bit) X(name, f7b, bit) + B(bmi1, 3) + B(hle, 4) + B(avx2, 5) + B(smep, 7) + B(bmi2, 8) + B(erms, 9) + B(invpcid, 10) + B(rtm, 11) + B(mpx, 14) + B(avx512f, 16) + B(avx512dq, 17) + B(rdseed, 18) + B(adx, 19) + B(smap, 20) + B(avx512ifma, 21) + B(pcommit, 22) + B(clflushopt, 23) + B(clwb, 24) + B(avx512pf, 26) + B(avx512er, 27) + B(avx512cd, 28) + B(sha, 29) + B(avx512bw, 30) + B(avx512vl, 31) +#undef B +#define C(name, bit) X(name, f7c, bit) + C(prefetchwt1, 0) + C(avx512vbmi, 1) +#undef C + +#undef X + +#endif /* ZSTD_COMMON_CPU_H */ diff --git a/src/bled/zstd_ddict.h b/src/bled/zstd_ddict.h new file mode 100644 index 00000000..ca4dccbe --- /dev/null +++ b/src/bled/zstd_ddict.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + + +#ifndef ZSTD_DDICT_H +#define ZSTD_DDICT_H + +/*-******************************************************* + * Dependencies + *********************************************************/ +#include "zstd_deps.h" /* size_t */ +#include "zstd.h" /* ZSTD_DDict, and several public functions */ + + +/*-******************************************************* + * Interface + *********************************************************/ + +/* note: several prototypes are already published in `zstd.h` : + * ZSTD_createDDict() + * ZSTD_createDDict_byReference() + * ZSTD_createDDict_advanced() + * ZSTD_freeDDict() + * ZSTD_initStaticDDict() + * ZSTD_sizeof_DDict() + * ZSTD_estimateDDictSize() + * ZSTD_getDictID_fromDict() + */ + +MEM_STATIC const void* ZSTD_DDict_dictContent(const ZSTD_DDict* ddict); +MEM_STATIC size_t ZSTD_DDict_dictSize(const ZSTD_DDict* ddict); + +MEM_STATIC void ZSTD_copyDDictParameters(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict); + +#if ZSTD_DECOMPRESS_DICTIONARY == 0 +MEM_STATIC void ZSTD_clearDict(ZSTD_DCtx* dctx) { (void)dctx; } +MEM_STATIC size_t ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict) { (void)dctx; (void)ddict; return 0; } +MEM_STATIC size_t ZSTD_checkOutBuffer(ZSTD_DStream const* zds, ZSTD_outBuffer const* output) { (void)zds; (void)output; return 0; } +MEM_STATIC ZSTD_DDict const* ZSTD_getDDict(ZSTD_DCtx* dctx) { (void)dctx; return NULL; } +#endif + +#endif /* ZSTD_DDICT_H */ diff --git a/src/bled/zstd_decompress.c b/src/bled/zstd_decompress.c new file mode 100644 index 00000000..98f2afb6 --- /dev/null +++ b/src/bled/zstd_decompress.c @@ -0,0 +1,1248 @@ +/* + * Copyright (c) Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + + +/* *************************************************************** +* Tuning parameters +*****************************************************************/ + +/*! +* LEGACY_SUPPORT : +* if set to 1+, ZSTD_decompress() can decode older formats (v0.1+) +*/ + +/*! + * MAXWINDOWSIZE_DEFAULT : + * maximum window size accepted by DStream __by default__. + * Frames requiring more memory will be rejected. + * It's possible to set a different limit using ZSTD_DCtx_setMaxWindowSize(). + */ +#ifndef ZSTD_MAXWINDOWSIZE_DEFAULT +# define ZSTD_MAXWINDOWSIZE_DEFAULT (((U32)1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT) + 1) +#endif + +/*! + * NO_FORWARD_PROGRESS_MAX : + * maximum allowed nb of calls to ZSTD_decompressStream() + * without any forward progress + * (defined as: no byte read from input, and no byte flushed to output) + * before triggering an error. + */ +#ifndef ZSTD_NO_FORWARD_PROGRESS_MAX +# define ZSTD_NO_FORWARD_PROGRESS_MAX 16 +#endif + + +/*-******************************************************* +* Dependencies +*********************************************************/ +#include "zstd_deps.h" /* ZSTD_memcpy, ZSTD_memmove, ZSTD_memset */ +#include "zstd_cpu.h" /* bmi2 */ +#include "zstd_mem.h" /* low level memory routines */ +#define FSE_STATIC_LINKING_ONLY +#include "fse.h" +#define HUF_STATIC_LINKING_ONLY +#include "huf.h" +#include "xxhash.h" /* XXH64_reset, XXH64_update, XXH64_digest, XXH64 */ +#include "zstd_internal.h" /* blockProperties_t */ +#include "zstd_decompress_internal.h" /* ZSTD_DCtx */ +#include "zstd_ddict.h" /* ZSTD_DDictDictContent */ +#include "zstd_decompress_block.h" /* ZSTD_decompressBlock_internal */ + +/*-************************************************************* +* Context management +***************************************************************/ +size_t ZSTD_sizeof_DCtx (const ZSTD_DCtx* dctx) +{ + if (dctx==NULL) return 0; /* support sizeof NULL */ + return sizeof(*dctx) +#if ZSTD_DECOMPRESS_DICTIONARY != 0 + + ZSTD_sizeof_DDict(dctx->ddictLocal) +#endif + + dctx->inBuffSize + dctx->outBuffSize; +} + +static size_t ZSTD_startingInputLength(ZSTD_format_e format) +{ + size_t const startingInputLength = ZSTD_FRAMEHEADERSIZE_PREFIX(format); + /* only supports formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless */ + assert( (format == ZSTD_f_zstd1) || (format == ZSTD_f_zstd1_magicless) ); + return startingInputLength; +} + +static void ZSTD_DCtx_resetParameters(ZSTD_DCtx* dctx) +{ + assert(dctx->streamStage == zdss_init); + dctx->format = ZSTD_f_zstd1; + dctx->maxWindowSize = ZSTD_MAXWINDOWSIZE_DEFAULT; + // dctx->outBufferMode = ZSTD_bm_buffered; REMOVED + dctx->forceIgnoreChecksum = ZSTD_d_validateChecksum; +#if ZSTD_DECOMPRESS_DICTIONARY != 0 + dctx->refMultipleDDicts = ZSTD_rmd_refSingleDDict; +#endif +} + +static void ZSTD_initDCtx_internal(ZSTD_DCtx* dctx) +{ + // dctx->staticSize = 0; REMOVED +#if ZSTD_DECOMPRESS_DICTIONARY != 0 + dctx->ddict = NULL; + dctx->ddictLocal = NULL; + dctx->dictEnd = NULL; + dctx->ddictIsCold = 0; + dctx->dictUses = ZSTD_dont_use; + dctx->ddictSet = NULL; +#endif + dctx->inBuff = NULL; + dctx->inBuffSize = 0; + dctx->outBuffSize = 0; + dctx->streamStage = zdss_init; + dctx->noForwardProgress = 0; + dctx->oversizedDuration = 0; +#if DYNAMIC_BMI2 + dctx->bmi2 = ZSTD_cpuid_bmi2(ZSTD_cpuid()); +#endif + ZSTD_DCtx_resetParameters(dctx); +} + +static ZSTD_DCtx* ZSTD_createDCtx_internal(ZSTD_customMem customMem) { + if ((!customMem.customAlloc) ^ (!customMem.customFree)) return NULL; + + { ZSTD_DCtx* const dctx = (ZSTD_DCtx*)ZSTD_customMalloc(sizeof(*dctx), customMem); + if (!dctx) return NULL; + ZSTD_initDCtx_internal(dctx); + return dctx; + } +} + +size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx) +{ + if (dctx==NULL) return 0; /* support free on NULL */ + RETURN_ERROR_IF(ZSTD_DCtx_get_staticSize(zds), memory_allocation, "not compatible with static DCtx"); + { ZSTD_customMem const cMem = ZSTD_defaultCMem; +#if ZSTD_DECOMPRESS_DICTIONARY != 0 + ZSTD_clearDict(dctx); +#endif + ZSTD_customFree(dctx->inBuff, cMem); + dctx->inBuff = NULL; +#if ZSTD_DECOMPRESS_DICTIONARY != 0 + if (dctx->ddictSet) { + ZSTD_freeDDictHashSet(dctx->ddictSet, cMem); + dctx->ddictSet = NULL; + } +#endif + ZSTD_customFree(dctx, cMem); + return 0; + } +} + +/* no longer useful */ +void ZSTD_copyDCtx(ZSTD_DCtx* dstDCtx, const ZSTD_DCtx* srcDCtx) +{ + size_t const toCopy = (size_t)((char*)(&dstDCtx->inBuff) - (char*)dstDCtx); + ZSTD_memcpy(dstDCtx, srcDCtx, toCopy); /* no need to copy workspace */ +} + +/*-************************************************************* + * Frame header decoding + ***************************************************************/ + +/** ZSTD_frameHeaderSize_internal() : + * srcSize must be large enough to reach header size fields. + * note : only works for formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless. + * @return : size of the Frame Header + * or an error code, which can be tested with ZSTD_isError() */ +static size_t ZSTD_frameHeaderSize_internal(const void* src, size_t srcSize, ZSTD_format_e format) +{ + size_t const minInputSize = ZSTD_startingInputLength(format); + RETURN_ERROR_IF(srcSize < minInputSize, srcSize_wrong, ""); + + { BYTE const fhd = ((const BYTE*)src)[minInputSize-1]; + U32 const dictID= fhd & 3; + U32 const singleSegment = (fhd >> 5) & 1; + U32 const fcsId = fhd >> 6; + return minInputSize + !singleSegment + + ZSTD_did_fieldSize[dictID] + ZSTD_fcs_fieldSize[fcsId] + + (singleSegment && !fcsId); + } +} + +/** ZSTD_getFrameHeader_advanced() : + * decode Frame Header, or require larger `srcSize`. + * note : only works for formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless + * @return : 0, `zfhPtr` is correctly filled, + * >0, `srcSize` is too small, value is wanted `srcSize` amount, + * or an error code, which can be tested using ZSTD_isError() */ +size_t ZSTD_getFrameHeader_advanced(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize, ZSTD_format_e format) +{ + const BYTE* ip = (const BYTE*)src; + size_t const minInputSize = ZSTD_startingInputLength(format); + + ZSTD_memset(zfhPtr, 0, sizeof(*zfhPtr)); /* not strictly necessary, but static analyzer do not understand that zfhPtr is only going to be read only if return value is zero, since they are 2 different signals */ + if (srcSize < minInputSize) return minInputSize; + RETURN_ERROR_IF(src==NULL, GENERIC, "invalid parameter"); + + if ( (format != ZSTD_f_zstd1_magicless) + && (MEM_readLE32(src) != ZSTD_MAGICNUMBER) ) { + if ((MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) { + /* skippable frame */ + if (srcSize < ZSTD_SKIPPABLEHEADERSIZE) + return ZSTD_SKIPPABLEHEADERSIZE; /* magic number + frame length */ + ZSTD_memset(zfhPtr, 0, sizeof(*zfhPtr)); + zfhPtr->frameContentSize = MEM_readLE32((const char *)src + ZSTD_FRAMEIDSIZE); + zfhPtr->frameType = ZSTD_skippableFrame; + return 0; + } + RETURN_ERROR(prefix_unknown, ""); + } + + /* ensure there is enough `srcSize` to fully read/decode frame header */ + { size_t const fhsize = ZSTD_frameHeaderSize_internal(src, srcSize, format); + if (srcSize < fhsize) return fhsize; + zfhPtr->headerSize = (U32)fhsize; + } + + { BYTE const fhdByte = ip[minInputSize-1]; + size_t pos = minInputSize; + U32 const dictIDSizeCode = fhdByte&3; + U32 const checksumFlag = (fhdByte>>2)&1; + U32 const singleSegment = (fhdByte>>5)&1; + U32 const fcsID = fhdByte>>6; + U64 windowSize = 0; + U32 dictID = 0; + U64 frameContentSize = ZSTD_CONTENTSIZE_UNKNOWN; + RETURN_ERROR_IF((fhdByte & 0x08) != 0, frameParameter_unsupported, + "reserved bits, must be zero"); + + if (!singleSegment) { + BYTE const wlByte = ip[pos++]; + U32 const windowLog = (wlByte >> 3) + ZSTD_WINDOWLOG_ABSOLUTEMIN; + RETURN_ERROR_IF(windowLog > ZSTD_WINDOWLOG_MAX, frameParameter_windowTooLarge, ""); + windowSize = (1ULL << windowLog); + windowSize += (windowSize >> 3) * (wlByte&7); + } + switch(dictIDSizeCode) + { + default: + assert(0); /* impossible */ + ZSTD_FALLTHROUGH; + case 0 : break; + case 1 : dictID = ip[pos]; pos++; break; + case 2 : dictID = MEM_readLE16(ip+pos); pos+=2; break; + case 3 : dictID = MEM_readLE32(ip+pos); pos+=4; break; + } + switch(fcsID) + { + default: + assert(0); /* impossible */ + ZSTD_FALLTHROUGH; + case 0 : if (singleSegment) frameContentSize = ip[pos]; break; + case 1 : frameContentSize = MEM_readLE16(ip+pos)+256; break; + case 2 : frameContentSize = MEM_readLE32(ip+pos); break; + case 3 : frameContentSize = MEM_readLE64(ip+pos); break; + } + if (singleSegment) windowSize = frameContentSize; + + zfhPtr->frameType = ZSTD_frame; + zfhPtr->frameContentSize = frameContentSize; + zfhPtr->windowSize = windowSize; + zfhPtr->blockSizeMax = (unsigned) MIN(windowSize, ZSTD_BLOCKSIZE_MAX); + zfhPtr->dictID = dictID; + zfhPtr->checksumFlag = checksumFlag; + } + return 0; +} + +/** ZSTD_getFrameHeader() : + * decode Frame Header, or require larger `srcSize`. + * note : this function does not consume input, it only reads it. + * @return : 0, `zfhPtr` is correctly filled, + * >0, `srcSize` is too small, value is wanted `srcSize` amount, + * or an error code, which can be tested using ZSTD_isError() */ +size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize) +{ + return ZSTD_getFrameHeader_advanced(zfhPtr, src, srcSize, ZSTD_f_zstd1); +} + +/** ZSTD_getFrameContentSize() : + * compatible with legacy mode + * @return : decompressed size of the single frame pointed to be `src` if known, otherwise + * - ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined + * - ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small) */ +unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize) +{ + { ZSTD_frameHeader zfh; + if (ZSTD_getFrameHeader(&zfh, src, srcSize) != 0) + return ZSTD_CONTENTSIZE_ERROR; + if (zfh.frameType == ZSTD_skippableFrame) { + return 0; + } else { + return zfh.frameContentSize; + } } +} + + +/** ZSTD_decodeFrameHeader() : + * `headerSize` must be the size provided by ZSTD_frameHeaderSize(). + * If multiple DDict references are enabled, also will choose the correct DDict to use. + * @return : 0 if success, or an error code, which can be tested using ZSTD_isError() */ +static size_t ZSTD_decodeFrameHeader(ZSTD_DCtx* dctx, const void* src, size_t headerSize) +{ + size_t const result = ZSTD_getFrameHeader_advanced(&(dctx->fParams), src, headerSize, dctx->format); + U32 dictID = 0; + if (ZSTD_isError(result)) return result; /* invalid header */ + RETURN_ERROR_IF(result>0, srcSize_wrong, "headerSize too small"); + +#if ZSTD_DECOMPRESS_DICTIONARY != 0 + /* Reference DDict requested by frame if dctx references multiple ddicts */ + if (dctx->refMultipleDDicts == ZSTD_rmd_refMultipleDDicts && dctx->ddictSet) { + ZSTD_DCtx_selectFrameDDict(dctx); + } + dictID = dctx->dictID; +#endif + + /* Skip the dictID check in fuzzing mode, because it makes the search + * harder. + */ + + RETURN_ERROR_IF(dctx->fParams.dictID && (dictID != dctx->fParams.dictID), + dictionary_wrong, ""); + + dctx->validateChecksum = (dctx->fParams.checksumFlag && !dctx->forceIgnoreChecksum) ? 1 : 0; + if (dctx->validateChecksum) XXH64_reset(&dctx->xxhState, 0); + dctx->processedCSize += headerSize; + return 0; +} + +static ZSTD_frameSizeInfo ZSTD_errorFrameSizeInfo(size_t ret) +{ + ZSTD_frameSizeInfo frameSizeInfo; + frameSizeInfo.compressedSize = ret; + frameSizeInfo.decompressedBound = ZSTD_CONTENTSIZE_ERROR; + return frameSizeInfo; +} + +/*-************************************************************* + * Frame decoding + ***************************************************************/ + +static size_t ZSTD_copyRawBlock(void* dst, size_t dstCapacity, + const void* src, size_t srcSize) +{ + DEBUGLOG(5, "ZSTD_copyRawBlock"); + RETURN_ERROR_IF(srcSize > dstCapacity, dstSize_tooSmall, ""); + if (dst == NULL) { + if (srcSize == 0) return 0; + RETURN_ERROR(dstBuffer_null, ""); + } + ZSTD_memcpy(dst, src, srcSize); + return srcSize; +} + +static size_t ZSTD_setRleBlock(void* dst, size_t dstCapacity, + BYTE b, + size_t regenSize) +{ + RETURN_ERROR_IF(regenSize > dstCapacity, dstSize_tooSmall, ""); + if (dst == NULL) { + if (regenSize == 0) return 0; + RETURN_ERROR(dstBuffer_null, ""); + } + ZSTD_memset(dst, b, regenSize); + return regenSize; +} + +static void ZSTD_DCtx_trace_end(ZSTD_DCtx const* dctx, U64 uncompressedSize, U64 compressedSize, unsigned streaming) +{ + (void)dctx; + (void)uncompressedSize; + (void)compressedSize; + (void)streaming; +} + + +/*! ZSTD_decompressFrame() : + * @dctx must be properly initialized + * will update *srcPtr and *srcSizePtr, + * to make *srcPtr progress by one frame. */ +static size_t ZSTD_decompressFrame(ZSTD_DCtx* dctx, + void* dst, size_t dstCapacity, + const void** srcPtr, size_t *srcSizePtr) +{ + const BYTE* const istart = (const BYTE*)(*srcPtr); + const BYTE* ip = istart; + BYTE* const ostart = (BYTE*)dst; + BYTE* const oend = dstCapacity != 0 ? ostart + dstCapacity : ostart; + BYTE* op = ostart; + size_t remainingSrcSize = *srcSizePtr; + + DEBUGLOG(4, "ZSTD_decompressFrame (srcSize:%i)", (int)*srcSizePtr); + + /* check */ + RETURN_ERROR_IF( + remainingSrcSize < ZSTD_FRAMEHEADERSIZE_MIN(dctx->format)+ZSTD_blockHeaderSize, + srcSize_wrong, ""); + + /* Frame Header */ + { size_t const frameHeaderSize = ZSTD_frameHeaderSize_internal( + ip, ZSTD_FRAMEHEADERSIZE_PREFIX(dctx->format), dctx->format); + if (ZSTD_isError(frameHeaderSize)) return frameHeaderSize; + RETURN_ERROR_IF(remainingSrcSize < frameHeaderSize+ZSTD_blockHeaderSize, + srcSize_wrong, ""); + FORWARD_IF_ERROR( ZSTD_decodeFrameHeader(dctx, ip, frameHeaderSize) , ""); + ip += frameHeaderSize; remainingSrcSize -= frameHeaderSize; + } + + /* Loop on each block */ + while (1) { + size_t decodedSize; + blockProperties_t blockProperties; + size_t const cBlockSize = ZSTD_getcBlockSize(ip, remainingSrcSize, &blockProperties); + if (ZSTD_isError(cBlockSize)) return cBlockSize; + + ip += ZSTD_blockHeaderSize; + remainingSrcSize -= ZSTD_blockHeaderSize; + RETURN_ERROR_IF(cBlockSize > remainingSrcSize, srcSize_wrong, ""); + + switch(blockProperties.blockType) + { + case bt_compressed: + decodedSize = ZSTD_decompressBlock_internal(dctx, op, (size_t)(oend-op), ip, cBlockSize, /* frame */ 1); + break; + case bt_raw : + decodedSize = ZSTD_copyRawBlock(op, (size_t)(oend-op), ip, cBlockSize); + break; + case bt_rle : + decodedSize = ZSTD_setRleBlock(op, (size_t)(oend-op), *ip, blockProperties.origSize); + break; + case bt_reserved : + default: + RETURN_ERROR(corruption_detected, "invalid block type"); + } + + if (ZSTD_isError(decodedSize)) return decodedSize; + if (dctx->validateChecksum) + XXH64_update(&dctx->xxhState, op, decodedSize); + if (decodedSize != 0) + op += decodedSize; + assert(ip != NULL); + ip += cBlockSize; + remainingSrcSize -= cBlockSize; + if (blockProperties.lastBlock) break; + } + + if (dctx->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN) { + RETURN_ERROR_IF((U64)(op-ostart) != dctx->fParams.frameContentSize, + corruption_detected, ""); + } + if (dctx->fParams.checksumFlag) { /* Frame content checksum verification */ + RETURN_ERROR_IF(remainingSrcSize<4, checksum_wrong, ""); + if (!dctx->forceIgnoreChecksum) { + U32 const checkCalc = (U32)XXH64_digest(&dctx->xxhState); + U32 checkRead; + checkRead = MEM_readLE32(ip); + RETURN_ERROR_IF(checkRead != checkCalc, checksum_wrong, ""); + } + ip += 4; + remainingSrcSize -= 4; + } + ZSTD_DCtx_trace_end(dctx, (U64)(op-ostart), (U64)(ip-istart), /* streaming */ 0); + /* Allow caller to get size read */ + *srcPtr = ip; + *srcSizePtr = remainingSrcSize; + return (size_t)(op-ostart); +} + +/*-************************************** +* Advanced Streaming Decompression API +* Bufferless and synchronous +****************************************/ +size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx) { return dctx->expected; } + +/** + * Similar to ZSTD_nextSrcSizeToDecompress(), but when when a block input can be streamed, + * we allow taking a partial block as the input. Currently only raw uncompressed blocks can + * be streamed. + * + * For blocks that can be streamed, this allows us to reduce the latency until we produce + * output, and avoid copying the input. + * + * @param inputSize - The total amount of input that the caller currently has. + */ +static size_t ZSTD_nextSrcSizeToDecompressWithInputSize(ZSTD_DCtx* dctx, size_t inputSize) { + if (!(dctx->stage == ZSTDds_decompressBlock || dctx->stage == ZSTDds_decompressLastBlock)) + return dctx->expected; + if (dctx->bType != bt_raw) + return dctx->expected; + return MIN(MAX(inputSize, 1), dctx->expected); +} + +ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx) { + switch(dctx->stage) + { + default: /* should not happen */ + assert(0); + ZSTD_FALLTHROUGH; + case ZSTDds_getFrameHeaderSize: + ZSTD_FALLTHROUGH; + case ZSTDds_decodeFrameHeader: + return ZSTDnit_frameHeader; + case ZSTDds_decodeBlockHeader: + return ZSTDnit_blockHeader; + case ZSTDds_decompressBlock: + return ZSTDnit_block; + case ZSTDds_decompressLastBlock: + return ZSTDnit_lastBlock; + case ZSTDds_checkChecksum: + return ZSTDnit_checksum; + case ZSTDds_decodeSkippableHeader: + ZSTD_FALLTHROUGH; + case ZSTDds_skipFrame: + return ZSTDnit_skippableFrame; + } +} + +static int ZSTD_isSkipFrame(ZSTD_DCtx* dctx) { return dctx->stage == ZSTDds_skipFrame; } + +/** ZSTD_decompressContinue() : + * srcSize : must be the exact nb of bytes expected (see ZSTD_nextSrcSizeToDecompress()) + * @return : nb of bytes generated into `dst` (necessarily <= `dstCapacity) + * or an error code, which can be tested using ZSTD_isError() */ +size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize) +{ + DEBUGLOG(5, "ZSTD_decompressContinue (srcSize:%u)", (unsigned)srcSize); + /* Sanity check */ + RETURN_ERROR_IF(srcSize != ZSTD_nextSrcSizeToDecompressWithInputSize(dctx, srcSize), srcSize_wrong, "not allowed"); + ZSTD_checkContinuity(dctx, dst, dstCapacity); + + dctx->processedCSize += srcSize; + + switch (dctx->stage) + { + case ZSTDds_getFrameHeaderSize : + assert(src != NULL); + if (dctx->format == ZSTD_f_zstd1) { /* allows header */ + assert(srcSize >= ZSTD_FRAMEIDSIZE); /* to read skippable magic number */ + if ((MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) { /* skippable frame */ + ZSTD_memcpy(dctx->headerBuffer, src, srcSize); + dctx->expected = ZSTD_SKIPPABLEHEADERSIZE - srcSize; /* remaining to load to get full skippable frame header */ + dctx->stage = ZSTDds_decodeSkippableHeader; + return 0; + } } + dctx->headerSize = ZSTD_frameHeaderSize_internal(src, srcSize, dctx->format); + if (ZSTD_isError(dctx->headerSize)) return dctx->headerSize; + ZSTD_memcpy(dctx->headerBuffer, src, srcSize); + dctx->expected = dctx->headerSize - srcSize; + dctx->stage = ZSTDds_decodeFrameHeader; + return 0; + + case ZSTDds_decodeFrameHeader: + assert(src != NULL); + ZSTD_memcpy(dctx->headerBuffer + (dctx->headerSize - srcSize), src, srcSize); + FORWARD_IF_ERROR(ZSTD_decodeFrameHeader(dctx, dctx->headerBuffer, dctx->headerSize), ""); + dctx->expected = ZSTD_blockHeaderSize; + dctx->stage = ZSTDds_decodeBlockHeader; + return 0; + + case ZSTDds_decodeBlockHeader: + { blockProperties_t bp; + size_t const cBlockSize = ZSTD_getcBlockSize(src, ZSTD_blockHeaderSize, &bp); + if (ZSTD_isError(cBlockSize)) return cBlockSize; + RETURN_ERROR_IF(cBlockSize > dctx->fParams.blockSizeMax, corruption_detected, "Block Size Exceeds Maximum"); + dctx->expected = cBlockSize; + dctx->bType = bp.blockType; + dctx->rleSize = bp.origSize; + if (cBlockSize) { + dctx->stage = bp.lastBlock ? ZSTDds_decompressLastBlock : ZSTDds_decompressBlock; + return 0; + } + /* empty block */ + if (bp.lastBlock) { + if (dctx->fParams.checksumFlag) { + dctx->expected = 4; + dctx->stage = ZSTDds_checkChecksum; + } else { + dctx->expected = 0; /* end of frame */ + dctx->stage = ZSTDds_getFrameHeaderSize; + } + } else { + dctx->expected = ZSTD_blockHeaderSize; /* jump to next header */ + dctx->stage = ZSTDds_decodeBlockHeader; + } + return 0; + } + + case ZSTDds_decompressLastBlock: + case ZSTDds_decompressBlock: + DEBUGLOG(5, "ZSTD_decompressContinue: case ZSTDds_decompressBlock"); + { size_t rSize; + switch(dctx->bType) + { + case bt_compressed: + DEBUGLOG(5, "ZSTD_decompressContinue: case bt_compressed"); + rSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize, /* frame */ 1); + dctx->expected = 0; /* Streaming not supported */ + break; + case bt_raw : + assert(srcSize <= dctx->expected); + rSize = ZSTD_copyRawBlock(dst, dstCapacity, src, srcSize); + FORWARD_IF_ERROR(rSize, "ZSTD_copyRawBlock failed"); + assert(rSize == srcSize); + dctx->expected -= rSize; + break; + case bt_rle : + rSize = ZSTD_setRleBlock(dst, dstCapacity, *(const BYTE*)src, dctx->rleSize); + dctx->expected = 0; /* Streaming not supported */ + break; + case bt_reserved : /* should never happen */ + default: + RETURN_ERROR(corruption_detected, "invalid block type"); + } + FORWARD_IF_ERROR(rSize, ""); + RETURN_ERROR_IF(rSize > dctx->fParams.blockSizeMax, corruption_detected, "Decompressed Block Size Exceeds Maximum"); + DEBUGLOG(5, "ZSTD_decompressContinue: decoded size from block : %u", (unsigned)rSize); + dctx->decodedSize += rSize; + if (dctx->validateChecksum) XXH64_update(&dctx->xxhState, dst, rSize); + dctx->previousDstEnd = (char*)dst + rSize; + + /* Stay on the same stage until we are finished streaming the block. */ + if (dctx->expected > 0) { + return rSize; + } + + if (dctx->stage == ZSTDds_decompressLastBlock) { /* end of frame */ + DEBUGLOG(4, "ZSTD_decompressContinue: decoded size from frame : %u", (unsigned)dctx->decodedSize); + RETURN_ERROR_IF( + dctx->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN + && dctx->decodedSize != dctx->fParams.frameContentSize, + corruption_detected, ""); + if (dctx->fParams.checksumFlag) { /* another round for frame checksum */ + dctx->expected = 4; + dctx->stage = ZSTDds_checkChecksum; + } else { + ZSTD_DCtx_trace_end(dctx, dctx->decodedSize, dctx->processedCSize, /* streaming */ 1); + dctx->expected = 0; /* ends here */ + dctx->stage = ZSTDds_getFrameHeaderSize; + } + } else { + dctx->stage = ZSTDds_decodeBlockHeader; + dctx->expected = ZSTD_blockHeaderSize; + } + return rSize; + } + + case ZSTDds_checkChecksum: + assert(srcSize == 4); /* guaranteed by dctx->expected */ + { + if (dctx->validateChecksum) { + U32 const h32 = (U32)XXH64_digest(&dctx->xxhState); + U32 const check32 = MEM_readLE32(src); + DEBUGLOG(4, "ZSTD_decompressContinue: checksum : calculated %08X :: %08X read", (unsigned)h32, (unsigned)check32); + RETURN_ERROR_IF(check32 != h32, checksum_wrong, ""); + } + ZSTD_DCtx_trace_end(dctx, dctx->decodedSize, dctx->processedCSize, /* streaming */ 1); + dctx->expected = 0; + dctx->stage = ZSTDds_getFrameHeaderSize; + return 0; + } + + case ZSTDds_decodeSkippableHeader: + assert(src != NULL); + assert(srcSize <= ZSTD_SKIPPABLEHEADERSIZE); + ZSTD_memcpy(dctx->headerBuffer + (ZSTD_SKIPPABLEHEADERSIZE - srcSize), src, srcSize); /* complete skippable header */ + dctx->expected = MEM_readLE32(dctx->headerBuffer + ZSTD_FRAMEIDSIZE); /* note : dctx->expected can grow seriously large, beyond local buffer size */ + dctx->stage = ZSTDds_skipFrame; + return 0; + + case ZSTDds_skipFrame: + dctx->expected = 0; + dctx->stage = ZSTDds_getFrameHeaderSize; + return 0; + + default: + assert(0); /* impossible */ + RETURN_ERROR(GENERIC, "impossible to reach"); /* some compiler require default to do something */ + } +} + + +static size_t ZSTD_refDictContent(ZSTD_DCtx* dctx, const void* dict, size_t dictSize) +{ + dctx->dictEnd = dctx->previousDstEnd; + dctx->virtualStart = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->prefixStart)); + dctx->prefixStart = dict; + dctx->previousDstEnd = (const char*)dict + dictSize; + return 0; +} + +/*! ZSTD_loadDEntropy() : + * dict : must point at beginning of a valid zstd dictionary. + * @return : size of entropy tables read */ +size_t +ZSTD_loadDEntropy(ZSTD_entropyDTables_t* entropy, + const void* const dict, size_t const dictSize) +{ + const BYTE* dictPtr = (const BYTE*)dict; + const BYTE* const dictEnd = dictPtr + dictSize; + + RETURN_ERROR_IF(dictSize <= 8, dictionary_corrupted, "dict is too small"); + assert(MEM_readLE32(dict) == ZSTD_MAGIC_DICTIONARY); /* dict must be valid */ + dictPtr += 8; /* skip header = magic + dictID */ + + ZSTD_STATIC_ASSERT(offsetof(ZSTD_entropyDTables_t, OFTable) == offsetof(ZSTD_entropyDTables_t, LLTable) + sizeof(entropy->LLTable)); + ZSTD_STATIC_ASSERT(offsetof(ZSTD_entropyDTables_t, MLTable) == offsetof(ZSTD_entropyDTables_t, OFTable) + sizeof(entropy->OFTable)); + ZSTD_STATIC_ASSERT(sizeof(entropy->LLTable) + sizeof(entropy->OFTable) + sizeof(entropy->MLTable) >= HUF_DECOMPRESS_WORKSPACE_SIZE); + { void* const workspace = &entropy->LLTable; /* use fse tables as temporary workspace; implies fse tables are grouped together */ + size_t const workspaceSize = sizeof(entropy->LLTable) + sizeof(entropy->OFTable) + sizeof(entropy->MLTable); +#ifdef HUF_FORCE_DECOMPRESS_X1 + /* in minimal huffman, we always use X1 variants */ + size_t const hSize = HUF_readDTableX1_wksp(entropy->hufTable, + dictPtr, dictEnd - dictPtr, + workspace, workspaceSize); +#else + size_t const hSize = HUF_readDTableX2_wksp(entropy->hufTable, + dictPtr, (size_t)(dictEnd - dictPtr), + workspace, workspaceSize); +#endif + RETURN_ERROR_IF(HUF_isError(hSize), dictionary_corrupted, ""); + dictPtr += hSize; + } + + { short offcodeNCount[MaxOff+1]; + unsigned offcodeMaxValue = MaxOff, offcodeLog; + size_t const offcodeHeaderSize = FSE_readNCount(offcodeNCount, &offcodeMaxValue, &offcodeLog, dictPtr, (size_t)(dictEnd-dictPtr)); + RETURN_ERROR_IF(FSE_isError(offcodeHeaderSize), dictionary_corrupted, ""); + RETURN_ERROR_IF(offcodeMaxValue > MaxOff, dictionary_corrupted, ""); + RETURN_ERROR_IF(offcodeLog > OffFSELog, dictionary_corrupted, ""); + ZSTD_buildFSETable( entropy->OFTable, + offcodeNCount, offcodeMaxValue, + OF_base, OF_bits, + offcodeLog, + entropy->workspace, sizeof(entropy->workspace), + /* bmi2 */0); + dictPtr += offcodeHeaderSize; + } + + { short matchlengthNCount[MaxML+1]; + unsigned matchlengthMaxValue = MaxML, matchlengthLog; + size_t const matchlengthHeaderSize = FSE_readNCount(matchlengthNCount, &matchlengthMaxValue, &matchlengthLog, dictPtr, (size_t)(dictEnd-dictPtr)); + RETURN_ERROR_IF(FSE_isError(matchlengthHeaderSize), dictionary_corrupted, ""); + RETURN_ERROR_IF(matchlengthMaxValue > MaxML, dictionary_corrupted, ""); + RETURN_ERROR_IF(matchlengthLog > MLFSELog, dictionary_corrupted, ""); + ZSTD_buildFSETable( entropy->MLTable, + matchlengthNCount, matchlengthMaxValue, + ML_base, ML_bits, + matchlengthLog, + entropy->workspace, sizeof(entropy->workspace), + /* bmi2 */ 0); + dictPtr += matchlengthHeaderSize; + } + + { short litlengthNCount[MaxLL+1]; + unsigned litlengthMaxValue = MaxLL, litlengthLog; + size_t const litlengthHeaderSize = FSE_readNCount(litlengthNCount, &litlengthMaxValue, &litlengthLog, dictPtr, (size_t)(dictEnd-dictPtr)); + RETURN_ERROR_IF(FSE_isError(litlengthHeaderSize), dictionary_corrupted, ""); + RETURN_ERROR_IF(litlengthMaxValue > MaxLL, dictionary_corrupted, ""); + RETURN_ERROR_IF(litlengthLog > LLFSELog, dictionary_corrupted, ""); + ZSTD_buildFSETable( entropy->LLTable, + litlengthNCount, litlengthMaxValue, + LL_base, LL_bits, + litlengthLog, + entropy->workspace, sizeof(entropy->workspace), + /* bmi2 */ 0); + dictPtr += litlengthHeaderSize; + } + + RETURN_ERROR_IF(dictPtr+12 > dictEnd, dictionary_corrupted, ""); + { int i; + size_t const dictContentSize = (size_t)(dictEnd - (dictPtr+12)); + for (i=0; i<3; i++) { + U32 const rep = MEM_readLE32(dictPtr); dictPtr += 4; + RETURN_ERROR_IF(rep==0 || rep > dictContentSize, + dictionary_corrupted, ""); + entropy->rep[i] = rep; + } } + + return (size_t)(dictPtr - (const BYTE*)dict); +} + +size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx) +{ + assert(dctx != NULL); + dctx->expected = ZSTD_startingInputLength(dctx->format); /* dctx->format must be properly set */ + dctx->stage = ZSTDds_getFrameHeaderSize; + dctx->processedCSize = 0; + dctx->decodedSize = 0; + dctx->previousDstEnd = NULL; + dctx->prefixStart = NULL; + dctx->virtualStart = NULL; + dctx->dictEnd = NULL; + dctx->entropy.hufTable[0] = (HUF_DTable)((HufLog)*0x1000001); /* cover both little and big endian */ + dctx->litEntropy = dctx->fseEntropy = 0; +#if ZSTD_DECOMPRESS_DICTIONARY != 0 + dctx->dictID = 0; +#endif + dctx->bType = bt_reserved; + ZSTD_STATIC_ASSERT(sizeof(dctx->entropy.rep) == sizeof(repStartValue)); + ZSTD_memcpy(dctx->entropy.rep, repStartValue, sizeof(repStartValue)); /* initial repcodes */ + dctx->LLTptr = dctx->entropy.LLTable; + dctx->MLTptr = dctx->entropy.MLTable; + dctx->OFTptr = dctx->entropy.OFTable; + dctx->HUFptr = dctx->entropy.hufTable; + return 0; +} + +size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize) +{ + FORWARD_IF_ERROR( ZSTD_decompressBegin(dctx) , ""); +#if ZSTD_DECOMPRESS_DICTIONARY != 0 + if (dict && dictSize) + RETURN_ERROR_IF( + ZSTD_isError(ZSTD_decompress_insertDictionary(dctx, dict, dictSize)), + dictionary_corrupted, ""); +#endif + (void)dict; (void)dictSize; + return 0; +} + + +/* ====== ZSTD_DDict ====== */ + +size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict) +{ + DEBUGLOG(4, "ZSTD_decompressBegin_usingDDict"); + assert(dctx != NULL); + (void)ddict; +#if ZSTD_DECOMPRESS_DICTIONARY != 0 + if (ddict) { + const char* const dictStart = (const char*)ZSTD_DDict_dictContent(ddict); + size_t const dictSize = ZSTD_DDict_dictSize(ddict); + const void* const dictEnd = dictStart + dictSize; + dctx->ddictIsCold = (dctx->dictEnd != dictEnd); + DEBUGLOG(4, "DDict is %s", + dctx->ddictIsCold ? "~cold~" : "hot!"); + } +#endif + FORWARD_IF_ERROR( ZSTD_decompressBegin(dctx) , ""); +#if ZSTD_DECOMPRESS_DICTIONARY != 0 + if (ddict) { /* NULL ddict is equivalent to no dictionary */ + ZSTD_copyDDictParameters(dctx, ddict); + } +#endif + return 0; +} + +/*! ZSTD_getDictID_fromDict() : + * Provides the dictID stored within dictionary. + * if @return == 0, the dictionary is not conformant with Zstandard specification. + * It can still be loaded, but as a content-only dictionary. */ +unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize) +{ + if (dictSize < 8) return 0; + if (MEM_readLE32(dict) != ZSTD_MAGIC_DICTIONARY) return 0; + return MEM_readLE32((const char*)dict + ZSTD_FRAMEIDSIZE); +} + +/*! ZSTD_getDictID_fromFrame() : + * Provides the dictID required to decompress frame stored within `src`. + * If @return == 0, the dictID could not be decoded. + * This could for one of the following reasons : + * - The frame does not require a dictionary (most common case). + * - The frame was built with dictID intentionally removed. + * Needed dictionary is a hidden information. + * Note : this use case also happens when using a non-conformant dictionary. + * - `srcSize` is too small, and as a result, frame header could not be decoded. + * Note : possible if `srcSize < ZSTD_FRAMEHEADERSIZE_MAX`. + * - This is not a Zstandard frame. + * When identifying the exact failure cause, it's possible to use + * ZSTD_getFrameHeader(), which will provide a more precise error code. */ +unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize) +{ + ZSTD_frameHeader zfp = { 0, 0, 0, ZSTD_frame, 0, 0, 0 }; + size_t const hError = ZSTD_getFrameHeader(&zfp, src, srcSize); + if (ZSTD_isError(hError)) return 0; + return zfp.dictID; +} + +/*===================================== +* Streaming decompression +*====================================*/ + +ZSTD_DStream* ZSTD_createDStream(void) +{ + DEBUGLOG(3, "ZSTD_createDStream"); + return ZSTD_createDCtx_internal(ZSTD_defaultCMem); +} + +size_t ZSTD_freeDStream(ZSTD_DStream* zds) +{ + return ZSTD_freeDCtx(zds); +} + + +/* *** Initialization *** */ + +size_t ZSTD_DStreamInSize(void) { return ZSTD_BLOCKSIZE_MAX + ZSTD_blockHeaderSize; } +size_t ZSTD_DStreamOutSize(void) { return ZSTD_BLOCKSIZE_MAX; } + + +/* note : this variant can't fail */ +size_t ZSTD_initDStream(ZSTD_DStream* zds) +{ + DEBUGLOG(4, "ZSTD_initDStream"); + return ZSTD_initDStream_usingDDict(zds, NULL); +} + +/* ZSTD_initDStream_usingDDict() : + * ddict will just be referenced, and must outlive decompression session + * this function cannot fail */ +size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* dctx, const ZSTD_DDict* ddict) +{ + FORWARD_IF_ERROR( ZSTD_DCtx_reset(dctx, ZSTD_reset_session_only) , ""); + FORWARD_IF_ERROR( ZSTD_DCtx_refDDict(dctx, ddict) , ""); + return ZSTD_startingInputLength(dctx->format); +} + +/* ZSTD_resetDStream() : + * return : expected size, aka ZSTD_startingInputLength(). + * this function cannot fail */ +size_t ZSTD_resetDStream(ZSTD_DStream* dctx) +{ + FORWARD_IF_ERROR(ZSTD_DCtx_reset(dctx, ZSTD_reset_session_only), ""); + return ZSTD_startingInputLength(dctx->format); +} + + + +size_t ZSTD_DCtx_reset(ZSTD_DCtx* dctx, ZSTD_ResetDirective reset) +{ + if ( (reset == ZSTD_reset_session_only) + || (reset == ZSTD_reset_session_and_parameters) ) { + dctx->streamStage = zdss_init; + dctx->noForwardProgress = 0; + } + if ( (reset == ZSTD_reset_parameters) + || (reset == ZSTD_reset_session_and_parameters) ) { + RETURN_ERROR_IF(dctx->streamStage != zdss_init, stage_wrong, ""); + ZSTD_clearDict(dctx); + ZSTD_DCtx_resetParameters(dctx); + } + return 0; +} + +size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize) +{ + size_t const blockSize = (size_t) MIN(windowSize, ZSTD_BLOCKSIZE_MAX); + unsigned long long const neededRBSize = windowSize + blockSize + (WILDCOPY_OVERLENGTH * 2); + unsigned long long const neededSize = MIN(frameContentSize, neededRBSize); + size_t const minRBSize = (size_t) neededSize; + RETURN_ERROR_IF((unsigned long long)minRBSize != neededSize, + frameParameter_windowTooLarge, ""); + return minRBSize; +} + + +/* ***** Decompression ***** */ + +static int ZSTD_DCtx_isOverflow(ZSTD_DStream* zds, size_t const neededInBuffSize, size_t const neededOutBuffSize) +{ + return (zds->inBuffSize + zds->outBuffSize) >= (neededInBuffSize + neededOutBuffSize) * ZSTD_WORKSPACETOOLARGE_FACTOR; +} + +static void ZSTD_DCtx_updateOversizedDuration(ZSTD_DStream* zds, size_t const neededInBuffSize, size_t const neededOutBuffSize) +{ + if (ZSTD_DCtx_isOverflow(zds, neededInBuffSize, neededOutBuffSize)) + zds->oversizedDuration++; + else + zds->oversizedDuration = 0; +} + +static int ZSTD_DCtx_isOversizedTooLong(ZSTD_DStream* zds) +{ + return zds->oversizedDuration >= ZSTD_WORKSPACETOOLARGE_MAXDURATION; +} + +/* Calls ZSTD_decompressContinue() with the right parameters for ZSTD_decompressStream() + * and updates the stage and the output buffer state. This call is extracted so it can be + * used both when reading directly from the ZSTD_inBuffer, and in buffered input mode. + * NOTE: You must break after calling this function since the streamStage is modified. + */ +static size_t ZSTD_decompressContinueStream( + ZSTD_DStream* zds, char** op, char* oend, + void const* src, size_t srcSize) { + int const isSkipFrame = ZSTD_isSkipFrame(zds); + if (ZSTD_DCtx_get_outBufferMode(zds) == ZSTD_bm_buffered) { + size_t const dstSize = isSkipFrame ? 0 : zds->outBuffSize - zds->outStart; + size_t const decodedSize = ZSTD_decompressContinue(zds, + zds->outBuff + zds->outStart, dstSize, src, srcSize); + FORWARD_IF_ERROR(decodedSize, ""); + if (!decodedSize && !isSkipFrame) { + zds->streamStage = zdss_read; + } else { + zds->outEnd = zds->outStart + decodedSize; + zds->streamStage = zdss_flush; + } + } else { + /* Write directly into the output buffer */ + size_t const dstSize = isSkipFrame ? 0 : (size_t)(oend - *op); + size_t const decodedSize = ZSTD_decompressContinue(zds, *op, dstSize, src, srcSize); + FORWARD_IF_ERROR(decodedSize, ""); + *op += decodedSize; + /* Flushing is not needed. */ + zds->streamStage = zdss_read; + assert(*op <= oend); + assert(ZSTD_DCtx_get_outBufferMode(zds) == ZSTD_bm_stable); + } + return 0; +} + +size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input) +{ + const char* const src = (const char*)input->src; + const char* const istart = input->pos != 0 ? src + input->pos : src; + const char* const iend = input->size != 0 ? src + input->size : src; + const char* ip = istart; + char* const dst = (char*)output->dst; + char* const ostart = output->pos != 0 ? dst + output->pos : dst; + char* const oend = output->size != 0 ? dst + output->size : dst; + char* op = ostart; + U32 someMoreWork = 1; + + DEBUGLOG(5, "ZSTD_decompressStream"); + RETURN_ERROR_IF( + input->pos > input->size, + srcSize_wrong, + "forbidden. in: pos: %u vs size: %u", + (U32)input->pos, (U32)input->size); + RETURN_ERROR_IF( + output->pos > output->size, + dstSize_tooSmall, + "forbidden. out: pos: %u vs size: %u", + (U32)output->pos, (U32)output->size); + DEBUGLOG(5, "input size : %u", (U32)(input->size - input->pos)); + FORWARD_IF_ERROR(ZSTD_checkOutBuffer(zds, output), ""); + + while (someMoreWork) { + switch(zds->streamStage) + { + case zdss_init : + DEBUGLOG(5, "stage zdss_init => transparent reset "); + zds->streamStage = zdss_loadHeader; + zds->lhSize = zds->inPos = zds->outStart = zds->outEnd = 0; + zds->hostageByte = 0; + zds->expectedOutBuffer = *output; + ZSTD_FALLTHROUGH; + + case zdss_loadHeader : + DEBUGLOG(5, "stage zdss_loadHeader (srcSize : %u)", (U32)(iend - ip)); + { size_t const hSize = ZSTD_getFrameHeader_advanced(&zds->fParams, zds->headerBuffer, zds->lhSize, zds->format); +#if ZSTD_DECOMPRESS_DICTIONARY != 0 + if (zds->refMultipleDDicts && zds->ddictSet) { + ZSTD_DCtx_selectFrameDDict(zds); + } +#endif + DEBUGLOG(5, "header size : %u", (U32)hSize); + if (ZSTD_isError(hSize)) { + return hSize; /* error */ + } + if (hSize != 0) { /* need more input */ + size_t const toLoad = hSize - zds->lhSize; /* if hSize!=0, hSize > zds->lhSize */ + size_t const remainingInput = (size_t)(iend-ip); + assert(iend >= ip); + if (toLoad > remainingInput) { /* not enough input to load full header */ + if (remainingInput > 0) { + ZSTD_memcpy(zds->headerBuffer + zds->lhSize, ip, remainingInput); + zds->lhSize += remainingInput; + } + input->pos = input->size; + return (MAX((size_t)ZSTD_FRAMEHEADERSIZE_MIN(zds->format), hSize) - zds->lhSize) + ZSTD_blockHeaderSize; /* remaining header bytes + next block header */ + } + assert(ip != NULL); + ZSTD_memcpy(zds->headerBuffer + zds->lhSize, ip, toLoad); zds->lhSize = hSize; ip += toLoad; + break; + } } + + /* Check output buffer is large enough for ZSTD_odm_stable. */ + if (ZSTD_DCtx_get_outBufferMode(zds) == ZSTD_bm_stable + && zds->fParams.frameType != ZSTD_skippableFrame + && zds->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN + && (U64)(size_t)(oend-op) < zds->fParams.frameContentSize) { + RETURN_ERROR(dstSize_tooSmall, "ZSTD_obm_stable passed but ZSTD_outBuffer is too small"); + } + + /* Consume header (see ZSTDds_decodeFrameHeader) */ + DEBUGLOG(4, "Consume header"); + FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDDict(zds, ZSTD_getDDict(zds)), ""); + + if ((MEM_readLE32(zds->headerBuffer) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) { /* skippable frame */ + zds->expected = MEM_readLE32(zds->headerBuffer + ZSTD_FRAMEIDSIZE); + zds->stage = ZSTDds_skipFrame; + } else { + FORWARD_IF_ERROR(ZSTD_decodeFrameHeader(zds, zds->headerBuffer, zds->lhSize), ""); + zds->expected = ZSTD_blockHeaderSize; + zds->stage = ZSTDds_decodeBlockHeader; + } + + /* control buffer memory usage */ + DEBUGLOG(4, "Control max memory usage (%u KB <= max %u KB)", + (U32)(zds->fParams.windowSize >>10), + (U32)(zds->maxWindowSize >> 10) ); + zds->fParams.windowSize = MAX(zds->fParams.windowSize, 1U << ZSTD_WINDOWLOG_ABSOLUTEMIN); + RETURN_ERROR_IF(zds->fParams.windowSize > zds->maxWindowSize, + frameParameter_windowTooLarge, ""); + + /* Adapt buffer sizes to frame header instructions */ + { size_t const neededInBuffSize = MAX(zds->fParams.blockSizeMax, 4 /* frame checksum */); + size_t const neededOutBuffSize = ZSTD_DCtx_get_outBufferMode(zds) == ZSTD_bm_buffered + ? ZSTD_decodingBufferSize_min(zds->fParams.windowSize, zds->fParams.frameContentSize) + : 0; + + ZSTD_DCtx_updateOversizedDuration(zds, neededInBuffSize, neededOutBuffSize); + + { int const tooSmall = (zds->inBuffSize < neededInBuffSize) || (zds->outBuffSize < neededOutBuffSize); + int const tooLarge = ZSTD_DCtx_isOversizedTooLong(zds); + + if (tooSmall || tooLarge) { + size_t const bufferSize = neededInBuffSize + neededOutBuffSize; + DEBUGLOG(4, "inBuff : from %u to %u", + (U32)zds->inBuffSize, (U32)neededInBuffSize); + DEBUGLOG(4, "outBuff : from %u to %u", + (U32)zds->outBuffSize, (U32)neededOutBuffSize); + if (ZSTD_DCtx_get_staticSize(zds)) { /* static DCtx */ + DEBUGLOG(4, "staticSize : %u", (U32)ZSTD_DCtx_get_staticSize(zds)); + assert(ZSTD_DCtx_get_staticSize(zds) >= sizeof(ZSTD_DCtx)); /* controlled at init */ + RETURN_ERROR_IF( + bufferSize > ZSTD_DCtx_get_staticSize(zds) - sizeof(ZSTD_DCtx), + memory_allocation, ""); + } else { + ZSTD_customFree(zds->inBuff, ZSTD_defaultCMem); + zds->inBuffSize = 0; + zds->outBuffSize = 0; + zds->inBuff = (char*)ZSTD_customMalloc(bufferSize, ZSTD_defaultCMem); + RETURN_ERROR_IF(zds->inBuff == NULL, memory_allocation, ""); + } + zds->inBuffSize = neededInBuffSize; + zds->outBuff = zds->inBuff + zds->inBuffSize; + zds->outBuffSize = neededOutBuffSize; + } } } + zds->streamStage = zdss_read; + ZSTD_FALLTHROUGH; + + case zdss_read: + DEBUGLOG(5, "stage zdss_read"); + { size_t const neededInSize = ZSTD_nextSrcSizeToDecompressWithInputSize(zds, (size_t)(iend - ip)); + DEBUGLOG(5, "neededInSize = %u", (U32)neededInSize); + if (neededInSize==0) { /* end of frame */ + zds->streamStage = zdss_init; + someMoreWork = 0; + break; + } + if ((size_t)(iend-ip) >= neededInSize) { /* decode directly from src */ + FORWARD_IF_ERROR(ZSTD_decompressContinueStream(zds, &op, oend, ip, neededInSize), ""); + ip += neededInSize; + /* Function modifies the stage so we must break */ + break; + } } + if (ip==iend) { someMoreWork = 0; break; } /* no more input */ + zds->streamStage = zdss_load; + ZSTD_FALLTHROUGH; + + case zdss_load: + { size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds); + size_t const toLoad = neededInSize - zds->inPos; + int const isSkipFrame = ZSTD_isSkipFrame(zds); + size_t loadedSize; + /* At this point we shouldn't be decompressing a block that we can stream. */ + assert(neededInSize == ZSTD_nextSrcSizeToDecompressWithInputSize(zds, iend - ip)); + if (isSkipFrame) { + loadedSize = MIN(toLoad, (size_t)(iend-ip)); + } else { + RETURN_ERROR_IF(toLoad > zds->inBuffSize - zds->inPos, + corruption_detected, + "should never happen"); + loadedSize = ZSTD_limitCopy(zds->inBuff + zds->inPos, toLoad, ip, (size_t)(iend-ip)); + } + ip += loadedSize; + zds->inPos += loadedSize; + if (loadedSize < toLoad) { someMoreWork = 0; break; } /* not enough input, wait for more */ + + /* decode loaded input */ + zds->inPos = 0; /* input is consumed */ + FORWARD_IF_ERROR(ZSTD_decompressContinueStream(zds, &op, oend, zds->inBuff, neededInSize), ""); + /* Function modifies the stage so we must break */ + break; + } + case zdss_flush: + { size_t const toFlushSize = zds->outEnd - zds->outStart; + size_t const flushedSize = ZSTD_limitCopy(op, (size_t)(oend-op), zds->outBuff + zds->outStart, toFlushSize); + op += flushedSize; + zds->outStart += flushedSize; + if (flushedSize == toFlushSize) { /* flush completed */ + zds->streamStage = zdss_read; + if ( (zds->outBuffSize < zds->fParams.frameContentSize) + && (zds->outStart + zds->fParams.blockSizeMax > zds->outBuffSize) ) { + DEBUGLOG(5, "restart filling outBuff from beginning (left:%i, needed:%u)", + (int)(zds->outBuffSize - zds->outStart), + (U32)zds->fParams.blockSizeMax); + zds->outStart = zds->outEnd = 0; + } + break; + } } + /* cannot complete flush */ + someMoreWork = 0; + break; + + default: + assert(0); /* impossible */ + RETURN_ERROR(GENERIC, "impossible to reach"); /* some compiler require default to do something */ + } } + + /* result */ + input->pos = (size_t)(ip - (const char*)(input->src)); + output->pos = (size_t)(op - (char*)(output->dst)); + + /* Update the expected output buffer for ZSTD_obm_stable. */ + zds->expectedOutBuffer = *output; + + if ((ip==istart) && (op==ostart)) { /* no forward progress */ + zds->noForwardProgress ++; + if (zds->noForwardProgress >= ZSTD_NO_FORWARD_PROGRESS_MAX) { + RETURN_ERROR_IF(op==oend, dstSize_tooSmall, ""); + RETURN_ERROR_IF(ip==iend, srcSize_wrong, ""); + assert(0); + } + } else { + zds->noForwardProgress = 0; + } + { size_t nextSrcSizeHint = ZSTD_nextSrcSizeToDecompress(zds); + if (!nextSrcSizeHint) { /* frame fully decoded */ + if (zds->outEnd == zds->outStart) { /* output fully flushed */ + if (zds->hostageByte) { + if (input->pos >= input->size) { + /* can't release hostage (not present) */ + zds->streamStage = zdss_read; + return 1; + } + input->pos++; /* release hostage */ + } /* zds->hostageByte */ + return 0; + } /* zds->outEnd == zds->outStart */ + if (!zds->hostageByte) { /* output not fully flushed; keep last byte as hostage; will be released when all output is flushed */ + input->pos--; /* note : pos > 0, otherwise, impossible to finish reading last block */ + zds->hostageByte=1; + } + return 1; + } /* nextSrcSizeHint==0 */ + nextSrcSizeHint += ZSTD_blockHeaderSize * (ZSTD_nextInputType(zds) == ZSTDnit_block); /* preload header of next block */ + assert(zds->inPos <= nextSrcSizeHint); + nextSrcSizeHint -= zds->inPos; /* part already loaded*/ + return nextSrcSizeHint; + } +} diff --git a/src/bled/zstd_decompress_block.c b/src/bled/zstd_decompress_block.c new file mode 100644 index 00000000..0f44c1ed --- /dev/null +++ b/src/bled/zstd_decompress_block.c @@ -0,0 +1,1489 @@ +/* + * Copyright (c) Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +/* zstd_decompress_block : + * this module takes care of decompressing _compressed_ block */ + +/*-******************************************************* +* Dependencies +*********************************************************/ +#include "zstd_deps.h" /* ZSTD_memcpy, ZSTD_memmove, ZSTD_memset */ +#include "zstd_compiler.h" /* prefetch */ +#include "zstd_cpu.h" /* bmi2 */ +#include "zstd_mem.h" /* low level memory routines */ +#define FSE_STATIC_LINKING_ONLY +#include "fse.h" +#define HUF_STATIC_LINKING_ONLY +#include "huf.h" +#include "zstd_internal.h" +#include "zstd_decompress_internal.h" /* ZSTD_DCtx */ +#include "zstd_ddict.h" /* ZSTD_DDictDictContent */ +#include "zstd_decompress_block.h" + +/*_******************************************************* +* Macros +**********************************************************/ + +/* These two optional macros force the use one way or another of the two + * ZSTD_decompressSequences implementations. You can't force in both directions + * at the same time. + */ +#if defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \ + defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG) +#error "Cannot force the use of the short and the long ZSTD_decompressSequences variants!" +#endif + + +/*_******************************************************* +* Memory operations +**********************************************************/ +static void ZSTD_copy4(void* dst, const void* src) { ZSTD_memcpy(dst, src, 4); } + + +/*-************************************************************* + * Block decoding + ***************************************************************/ + +/*! ZSTD_getcBlockSize() : + * Provides the size of compressed block from block header `src` */ +size_t ZSTD_getcBlockSize(const void* src, size_t srcSize, + blockProperties_t* bpPtr) +{ + RETURN_ERROR_IF(srcSize < ZSTD_blockHeaderSize, srcSize_wrong, ""); + + { U32 const cBlockHeader = MEM_readLE24(src); + U32 const cSize = cBlockHeader >> 3; + bpPtr->lastBlock = cBlockHeader & 1; + bpPtr->blockType = (blockType_e)((cBlockHeader >> 1) & 3); + bpPtr->origSize = cSize; /* only useful for RLE */ + if (bpPtr->blockType == bt_rle) return 1; + RETURN_ERROR_IF(bpPtr->blockType == bt_reserved, corruption_detected, ""); + return cSize; + } +} + + +/* Hidden declaration for fullbench */ +static size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, + const void* src, size_t srcSize); +/*! ZSTD_decodeLiteralsBlock() : + * @return : nb of bytes read from src (< srcSize ) + * note : symbol not declared but exposed for fullbench */ +size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, + const void* src, size_t srcSize) /* note : srcSize < BLOCKSIZE */ +{ + DEBUGLOG(5, "ZSTD_decodeLiteralsBlock"); + RETURN_ERROR_IF(srcSize < MIN_CBLOCK_SIZE, corruption_detected, ""); + + { const BYTE* const istart = (const BYTE*) src; + symbolEncodingType_e const litEncType = (symbolEncodingType_e)(istart[0] & 3); + + switch(litEncType) + { + case set_repeat: + DEBUGLOG(5, "set_repeat flag : re-using stats from previous compressed literals block"); + RETURN_ERROR_IF(dctx->litEntropy==0, dictionary_corrupted, ""); + ZSTD_FALLTHROUGH; + + case set_compressed: + RETURN_ERROR_IF(srcSize < 5, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for case 3"); + { size_t lhSize, litSize, litCSize; + U32 singleStream=0; + U32 const lhlCode = (istart[0] >> 2) & 3; + U32 const lhc = MEM_readLE32(istart); + size_t hufSuccess; + switch(lhlCode) + { + case 0: case 1: default: /* note : default is impossible, since lhlCode into [0..3] */ + /* 2 - 2 - 10 - 10 */ + singleStream = !lhlCode; + lhSize = 3; + litSize = (lhc >> 4) & 0x3FF; + litCSize = (lhc >> 14) & 0x3FF; + break; + case 2: + /* 2 - 2 - 14 - 14 */ + lhSize = 4; + litSize = (lhc >> 4) & 0x3FFF; + litCSize = lhc >> 18; + break; + case 3: + /* 2 - 2 - 18 - 18 */ + lhSize = 5; + litSize = (lhc >> 4) & 0x3FFFF; + litCSize = (lhc >> 22) + ((size_t)istart[4] << 10); + break; + } + RETURN_ERROR_IF(litSize > ZSTD_BLOCKSIZE_MAX, corruption_detected, ""); + RETURN_ERROR_IF(litCSize + lhSize > srcSize, corruption_detected, ""); + +#if ZSTD_DECOMPRESS_DICTIONARY != 0 + /* prefetch huffman table if cold */ + if (dctx->ddictIsCold && (litSize > 768 /* heuristic */)) { + PREFETCH_AREA(dctx->HUFptr, sizeof(dctx->entropy.hufTable)); + } +#endif + + if (litEncType==set_repeat) { + if (singleStream) { + hufSuccess = HUF_decompress1X_usingDTable_bmi2( + dctx->litBuffer, litSize, istart+lhSize, litCSize, + dctx->HUFptr, ZSTD_DCtx_get_bmi2(dctx)); + } else { + hufSuccess = HUF_decompress4X_usingDTable_bmi2( + dctx->litBuffer, litSize, istart+lhSize, litCSize, + dctx->HUFptr, ZSTD_DCtx_get_bmi2(dctx)); + } + } else { + if (singleStream) { +#if defined(HUF_FORCE_DECOMPRESS_X2) + hufSuccess = HUF_decompress1X_DCtx_wksp( + dctx->entropy.hufTable, dctx->litBuffer, litSize, + istart+lhSize, litCSize, dctx->workspace, + sizeof(dctx->workspace)); +#else + hufSuccess = HUF_decompress1X1_DCtx_wksp_bmi2( + dctx->entropy.hufTable, dctx->litBuffer, litSize, + istart+lhSize, litCSize, dctx->workspace, + sizeof(dctx->workspace), ZSTD_DCtx_get_bmi2(dctx)); +#endif + } else { + hufSuccess = HUF_decompress4X_hufOnly_wksp_bmi2( + dctx->entropy.hufTable, dctx->litBuffer, litSize, + istart+lhSize, litCSize, dctx->workspace, + sizeof(dctx->workspace), ZSTD_DCtx_get_bmi2(dctx)); + } + } + + RETURN_ERROR_IF(HUF_isError(hufSuccess), corruption_detected, ""); + + dctx->litPtr = dctx->litBuffer; + dctx->litSize = litSize; + dctx->litEntropy = 1; + if (litEncType==set_compressed) dctx->HUFptr = dctx->entropy.hufTable; + ZSTD_memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH); + return litCSize + lhSize; + } + + case set_basic: + { size_t litSize, lhSize; + U32 const lhlCode = ((istart[0]) >> 2) & 3; + switch(lhlCode) + { + case 0: case 2: default: /* note : default is impossible, since lhlCode into [0..3] */ + lhSize = 1; + litSize = istart[0] >> 3; + break; + case 1: + lhSize = 2; + litSize = MEM_readLE16(istart) >> 4; + break; + case 3: + lhSize = 3; + litSize = MEM_readLE24(istart) >> 4; + break; + } + + if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) { /* risk reading beyond src buffer with wildcopy */ + RETURN_ERROR_IF(litSize+lhSize > srcSize, corruption_detected, ""); + ZSTD_memcpy(dctx->litBuffer, istart+lhSize, litSize); + dctx->litPtr = dctx->litBuffer; + dctx->litSize = litSize; + ZSTD_memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH); + return lhSize+litSize; + } + /* direct reference into compressed stream */ + dctx->litPtr = istart+lhSize; + dctx->litSize = litSize; + return lhSize+litSize; + } + + case set_rle: + { U32 const lhlCode = ((istart[0]) >> 2) & 3; + size_t litSize, lhSize; + switch(lhlCode) + { + case 0: case 2: default: /* note : default is impossible, since lhlCode into [0..3] */ + lhSize = 1; + litSize = istart[0] >> 3; + break; + case 1: + lhSize = 2; + litSize = MEM_readLE16(istart) >> 4; + break; + case 3: + lhSize = 3; + litSize = MEM_readLE24(istart) >> 4; + RETURN_ERROR_IF(srcSize<4, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 3; here we need lhSize+1 = 4"); + break; + } + RETURN_ERROR_IF(litSize > ZSTD_BLOCKSIZE_MAX, corruption_detected, ""); + ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize + WILDCOPY_OVERLENGTH); + dctx->litPtr = dctx->litBuffer; + dctx->litSize = litSize; + return lhSize+1; + } + default: + RETURN_ERROR(corruption_detected, "impossible"); + } + } +} + +/* Default FSE distribution tables. + * These are pre-calculated FSE decoding tables using default distributions as defined in specification : + * https://github.com/facebook/zstd/blob/release/doc/zstd_compression_format.md#default-distributions + * They were generated programmatically with following method : + * - start from default distributions, present in /lib/common/zstd_internal.h + * - generate tables normally, using ZSTD_buildFSETable() + * - printout the content of tables + * - pretify output, report below, test with fuzzer to ensure it's correct */ + +/* Default FSE distribution table for Literal Lengths */ +static const ZSTD_seqSymbol LL_defaultDTable[(1<<LL_DEFAULTNORMLOG)+1] = { + { 1, 1, 1, LL_DEFAULTNORMLOG}, /* header : fastMode, tableLog */ + /* nextState, nbAddBits, nbBits, baseVal */ + { 0, 0, 4, 0}, { 16, 0, 4, 0}, + { 32, 0, 5, 1}, { 0, 0, 5, 3}, + { 0, 0, 5, 4}, { 0, 0, 5, 6}, + { 0, 0, 5, 7}, { 0, 0, 5, 9}, + { 0, 0, 5, 10}, { 0, 0, 5, 12}, + { 0, 0, 6, 14}, { 0, 1, 5, 16}, + { 0, 1, 5, 20}, { 0, 1, 5, 22}, + { 0, 2, 5, 28}, { 0, 3, 5, 32}, + { 0, 4, 5, 48}, { 32, 6, 5, 64}, + { 0, 7, 5, 128}, { 0, 8, 6, 256}, + { 0, 10, 6, 1024}, { 0, 12, 6, 4096}, + { 32, 0, 4, 0}, { 0, 0, 4, 1}, + { 0, 0, 5, 2}, { 32, 0, 5, 4}, + { 0, 0, 5, 5}, { 32, 0, 5, 7}, + { 0, 0, 5, 8}, { 32, 0, 5, 10}, + { 0, 0, 5, 11}, { 0, 0, 6, 13}, + { 32, 1, 5, 16}, { 0, 1, 5, 18}, + { 32, 1, 5, 22}, { 0, 2, 5, 24}, + { 32, 3, 5, 32}, { 0, 3, 5, 40}, + { 0, 6, 4, 64}, { 16, 6, 4, 64}, + { 32, 7, 5, 128}, { 0, 9, 6, 512}, + { 0, 11, 6, 2048}, { 48, 0, 4, 0}, + { 16, 0, 4, 1}, { 32, 0, 5, 2}, + { 32, 0, 5, 3}, { 32, 0, 5, 5}, + { 32, 0, 5, 6}, { 32, 0, 5, 8}, + { 32, 0, 5, 9}, { 32, 0, 5, 11}, + { 32, 0, 5, 12}, { 0, 0, 6, 15}, + { 32, 1, 5, 18}, { 32, 1, 5, 20}, + { 32, 2, 5, 24}, { 32, 2, 5, 28}, + { 32, 3, 5, 40}, { 32, 4, 5, 48}, + { 0, 16, 6,65536}, { 0, 15, 6,32768}, + { 0, 14, 6,16384}, { 0, 13, 6, 8192}, +}; /* LL_defaultDTable */ + +/* Default FSE distribution table for Offset Codes */ +static const ZSTD_seqSymbol OF_defaultDTable[(1<<OF_DEFAULTNORMLOG)+1] = { + { 1, 1, 1, OF_DEFAULTNORMLOG}, /* header : fastMode, tableLog */ + /* nextState, nbAddBits, nbBits, baseVal */ + { 0, 0, 5, 0}, { 0, 6, 4, 61}, + { 0, 9, 5, 509}, { 0, 15, 5,32765}, + { 0, 21, 5,2097149}, { 0, 3, 5, 5}, + { 0, 7, 4, 125}, { 0, 12, 5, 4093}, + { 0, 18, 5,262141}, { 0, 23, 5,8388605}, + { 0, 5, 5, 29}, { 0, 8, 4, 253}, + { 0, 14, 5,16381}, { 0, 20, 5,1048573}, + { 0, 2, 5, 1}, { 16, 7, 4, 125}, + { 0, 11, 5, 2045}, { 0, 17, 5,131069}, + { 0, 22, 5,4194301}, { 0, 4, 5, 13}, + { 16, 8, 4, 253}, { 0, 13, 5, 8189}, + { 0, 19, 5,524285}, { 0, 1, 5, 1}, + { 16, 6, 4, 61}, { 0, 10, 5, 1021}, + { 0, 16, 5,65533}, { 0, 28, 5,268435453}, + { 0, 27, 5,134217725}, { 0, 26, 5,67108861}, + { 0, 25, 5,33554429}, { 0, 24, 5,16777213}, +}; /* OF_defaultDTable */ + + +/* Default FSE distribution table for Match Lengths */ +static const ZSTD_seqSymbol ML_defaultDTable[(1<<ML_DEFAULTNORMLOG)+1] = { + { 1, 1, 1, ML_DEFAULTNORMLOG}, /* header : fastMode, tableLog */ + /* nextState, nbAddBits, nbBits, baseVal */ + { 0, 0, 6, 3}, { 0, 0, 4, 4}, + { 32, 0, 5, 5}, { 0, 0, 5, 6}, + { 0, 0, 5, 8}, { 0, 0, 5, 9}, + { 0, 0, 5, 11}, { 0, 0, 6, 13}, + { 0, 0, 6, 16}, { 0, 0, 6, 19}, + { 0, 0, 6, 22}, { 0, 0, 6, 25}, + { 0, 0, 6, 28}, { 0, 0, 6, 31}, + { 0, 0, 6, 34}, { 0, 1, 6, 37}, + { 0, 1, 6, 41}, { 0, 2, 6, 47}, + { 0, 3, 6, 59}, { 0, 4, 6, 83}, + { 0, 7, 6, 131}, { 0, 9, 6, 515}, + { 16, 0, 4, 4}, { 0, 0, 4, 5}, + { 32, 0, 5, 6}, { 0, 0, 5, 7}, + { 32, 0, 5, 9}, { 0, 0, 5, 10}, + { 0, 0, 6, 12}, { 0, 0, 6, 15}, + { 0, 0, 6, 18}, { 0, 0, 6, 21}, + { 0, 0, 6, 24}, { 0, 0, 6, 27}, + { 0, 0, 6, 30}, { 0, 0, 6, 33}, + { 0, 1, 6, 35}, { 0, 1, 6, 39}, + { 0, 2, 6, 43}, { 0, 3, 6, 51}, + { 0, 4, 6, 67}, { 0, 5, 6, 99}, + { 0, 8, 6, 259}, { 32, 0, 4, 4}, + { 48, 0, 4, 4}, { 16, 0, 4, 5}, + { 32, 0, 5, 7}, { 32, 0, 5, 8}, + { 32, 0, 5, 10}, { 32, 0, 5, 11}, + { 0, 0, 6, 14}, { 0, 0, 6, 17}, + { 0, 0, 6, 20}, { 0, 0, 6, 23}, + { 0, 0, 6, 26}, { 0, 0, 6, 29}, + { 0, 0, 6, 32}, { 0, 16, 6,65539}, + { 0, 15, 6,32771}, { 0, 14, 6,16387}, + { 0, 13, 6, 8195}, { 0, 12, 6, 4099}, + { 0, 11, 6, 2051}, { 0, 10, 6, 1027}, +}; /* ML_defaultDTable */ + + +static void ZSTD_buildSeqTable_rle(ZSTD_seqSymbol* dt, U32 baseValue, U32 nbAddBits) +{ + void* ptr = dt; + ZSTD_seqSymbol_header* const DTableH = (ZSTD_seqSymbol_header*)ptr; + ZSTD_seqSymbol* const cell = dt + 1; + + DTableH->tableLog = 0; + DTableH->fastMode = 0; + + cell->nbBits = 0; + cell->nextState = 0; + assert(nbAddBits < 255); + cell->nbAdditionalBits = (BYTE)nbAddBits; + cell->baseValue = baseValue; +} + + +/* ZSTD_buildFSETable() : + * generate FSE decoding table for one symbol (ll, ml or off) + * cannot fail if input is valid => + * all inputs are presumed validated at this stage */ +FORCE_INLINE_TEMPLATE +void ZSTD_buildFSETable_body(ZSTD_seqSymbol* dt, + const short* normalizedCounter, unsigned maxSymbolValue, + const U32* baseValue, const U32* nbAdditionalBits, + unsigned tableLog, void* wksp, size_t wkspSize) +{ + ZSTD_seqSymbol* const tableDecode = dt+1; + U32 const maxSV1 = maxSymbolValue + 1; + U32 const tableSize = 1 << tableLog; + + U16* symbolNext = (U16*)wksp; + BYTE* spread = (BYTE*)(symbolNext + MaxSeq + 1); + U32 highThreshold = tableSize - 1; + + + /* Sanity Checks */ + assert(maxSymbolValue <= MaxSeq); + assert(tableLog <= MaxFSELog); + assert(wkspSize >= ZSTD_BUILD_FSE_TABLE_WKSP_SIZE); + (void)wkspSize; + /* Init, lay down lowprob symbols */ + { ZSTD_seqSymbol_header DTableH; + DTableH.tableLog = tableLog; + DTableH.fastMode = 1; + { S16 const largeLimit= (S16)(1 << (tableLog-1)); + U32 s; + for (s=0; s<maxSV1; s++) { + if (normalizedCounter[s]==-1) { + tableDecode[highThreshold--].baseValue = s; + symbolNext[s] = 1; + } else { + if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0; + assert(normalizedCounter[s]>=0); + symbolNext[s] = (U16)normalizedCounter[s]; + } } } + ZSTD_memcpy(dt, &DTableH, sizeof(DTableH)); + } + + /* Spread symbols */ + assert(tableSize <= 512); + /* Specialized symbol spreading for the case when there are + * no low probability (-1 count) symbols. When compressing + * small blocks we avoid low probability symbols to hit this + * case, since header decoding speed matters more. + */ + if (highThreshold == tableSize - 1) { + size_t const tableMask = tableSize-1; + size_t const step = FSE_TABLESTEP(tableSize); + /* First lay down the symbols in order. + * We use a uint64_t to lay down 8 bytes at a time. This reduces branch + * misses since small blocks generally have small table logs, so nearly + * all symbols have counts <= 8. We ensure we have 8 bytes at the end of + * our buffer to handle the over-write. + */ + { + U64 const add = 0x0101010101010101ull; + size_t pos = 0; + U64 sv = 0; + U32 s; + for (s=0; s<maxSV1; ++s, sv += add) { + int i; + int const n = normalizedCounter[s]; + MEM_write64(spread + pos, sv); + for (i = 8; i < n; i += 8) { + MEM_write64(spread + pos + i, sv); + } + pos += n; + } + } + /* Now we spread those positions across the table. + * The benefit of doing it in two stages is that we avoid the the + * variable size inner loop, which caused lots of branch misses. + * Now we can run through all the positions without any branch misses. + * We unroll the loop twice, since that is what emperically worked best. + */ + { + size_t position = 0; + size_t s; + size_t const unroll = 2; + assert(tableSize % unroll == 0); /* FSE_MIN_TABLELOG is 5 */ + for (s = 0; s < (size_t)tableSize; s += unroll) { + size_t u; + for (u = 0; u < unroll; ++u) { + size_t const uPosition = (position + (u * step)) & tableMask; + tableDecode[uPosition].baseValue = spread[s + u]; + } + position = (position + (unroll * step)) & tableMask; + } + assert(position == 0); + } + } else { + U32 const tableMask = tableSize-1; + U32 const step = FSE_TABLESTEP(tableSize); + U32 s, position = 0; + for (s=0; s<maxSV1; s++) { + int i; + int const n = normalizedCounter[s]; + for (i=0; i<n; i++) { + tableDecode[position].baseValue = s; + position = (position + step) & tableMask; + while (position > highThreshold) position = (position + step) & tableMask; /* lowprob area */ + } } + assert(position == 0); /* position must reach all cells once, otherwise normalizedCounter is incorrect */ + } + + /* Build Decoding table */ + { + U32 u; + for (u=0; u<tableSize; u++) { + U32 const symbol = tableDecode[u].baseValue; + U32 const nextState = symbolNext[symbol]++; + tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) ); + tableDecode[u].nextState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize); + assert(nbAdditionalBits[symbol] < 255); + tableDecode[u].nbAdditionalBits = (BYTE)nbAdditionalBits[symbol]; + tableDecode[u].baseValue = baseValue[symbol]; + } + } +} + +/* Avoids the FORCE_INLINE of the _body() function. */ +static void ZSTD_buildFSETable_body_default(ZSTD_seqSymbol* dt, + const short* normalizedCounter, unsigned maxSymbolValue, + const U32* baseValue, const U32* nbAdditionalBits, + unsigned tableLog, void* wksp, size_t wkspSize) +{ + ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue, + baseValue, nbAdditionalBits, tableLog, wksp, wkspSize); +} + +#if DYNAMIC_BMI2 +TARGET_ATTRIBUTE("bmi2") static void ZSTD_buildFSETable_body_bmi2(ZSTD_seqSymbol* dt, + const short* normalizedCounter, unsigned maxSymbolValue, + const U32* baseValue, const U32* nbAdditionalBits, + unsigned tableLog, void* wksp, size_t wkspSize) +{ + ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue, + baseValue, nbAdditionalBits, tableLog, wksp, wkspSize); +} +#endif + +void ZSTD_buildFSETable(ZSTD_seqSymbol* dt, + const short* normalizedCounter, unsigned maxSymbolValue, + const U32* baseValue, const U32* nbAdditionalBits, + unsigned tableLog, void* wksp, size_t wkspSize, int bmi2) +{ +#if DYNAMIC_BMI2 + if (bmi2) { + ZSTD_buildFSETable_body_bmi2(dt, normalizedCounter, maxSymbolValue, + baseValue, nbAdditionalBits, tableLog, wksp, wkspSize); + return; + } +#endif + (void)bmi2; + ZSTD_buildFSETable_body_default(dt, normalizedCounter, maxSymbolValue, + baseValue, nbAdditionalBits, tableLog, wksp, wkspSize); +} + + +/*! ZSTD_buildSeqTable() : + * @return : nb bytes read from src, + * or an error code if it fails */ +static size_t ZSTD_buildSeqTable(ZSTD_seqSymbol* DTableSpace, const ZSTD_seqSymbol** DTablePtr, + symbolEncodingType_e type, unsigned max, U32 maxLog, + const void* src, size_t srcSize, + const U32* baseValue, const U32* nbAdditionalBits, + const ZSTD_seqSymbol* defaultTable, U32 flagRepeatTable, + int ddictIsCold, int nbSeq, U32* wksp, size_t wkspSize, + int bmi2) +{ + switch(type) + { + case set_rle : + RETURN_ERROR_IF(!srcSize, srcSize_wrong, ""); + RETURN_ERROR_IF((*(const BYTE*)src) > max, corruption_detected, ""); + { U32 const symbol = *(const BYTE*)src; + U32 const baseline = baseValue[symbol]; + U32 const nbBits = nbAdditionalBits[symbol]; + ZSTD_buildSeqTable_rle(DTableSpace, baseline, nbBits); + } + *DTablePtr = DTableSpace; + return 1; + case set_basic : + *DTablePtr = defaultTable; + return 0; + case set_repeat: + RETURN_ERROR_IF(!flagRepeatTable, corruption_detected, ""); + /* prefetch FSE table if used */ + if (ddictIsCold && (nbSeq > 24 /* heuristic */)) { + const void* const pStart = *DTablePtr; + size_t const pSize = sizeof(ZSTD_seqSymbol) * (SEQSYMBOL_TABLE_SIZE(maxLog)); + PREFETCH_AREA(pStart, pSize); + } + return 0; + case set_compressed : + { unsigned tableLog; + S16 norm[MaxSeq+1]; + size_t const headerSize = FSE_readNCount(norm, &max, &tableLog, src, srcSize); + RETURN_ERROR_IF(FSE_isError(headerSize), corruption_detected, ""); + RETURN_ERROR_IF(tableLog > maxLog, corruption_detected, ""); + ZSTD_buildFSETable(DTableSpace, norm, max, baseValue, nbAdditionalBits, tableLog, wksp, wkspSize, bmi2); + *DTablePtr = DTableSpace; + return headerSize; + } + default : + assert(0); + RETURN_ERROR(GENERIC, "impossible"); + } +} + +size_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr, + const void* src, size_t srcSize) +{ + const BYTE* const istart = (const BYTE*)src; + const BYTE* const iend = istart + srcSize; + const BYTE* ip = istart; + int nbSeq; + DEBUGLOG(5, "ZSTD_decodeSeqHeaders"); + + /* check */ + RETURN_ERROR_IF(srcSize < MIN_SEQUENCES_SIZE, srcSize_wrong, ""); + + /* SeqHead */ + nbSeq = *ip++; + if (!nbSeq) { + *nbSeqPtr=0; + RETURN_ERROR_IF(srcSize != 1, srcSize_wrong, ""); + return 1; + } + if (nbSeq > 0x7F) { + if (nbSeq == 0xFF) { + RETURN_ERROR_IF(ip+2 > iend, srcSize_wrong, ""); + nbSeq = MEM_readLE16(ip) + LONGNBSEQ; + ip+=2; + } else { + RETURN_ERROR_IF(ip >= iend, srcSize_wrong, ""); + nbSeq = ((nbSeq-0x80)<<8) + *ip++; + } + } + *nbSeqPtr = nbSeq; + + /* FSE table descriptors */ + RETURN_ERROR_IF(ip+1 > iend, srcSize_wrong, ""); /* minimum possible size: 1 byte for symbol encoding types */ + { symbolEncodingType_e const LLtype = (symbolEncodingType_e)(*ip >> 6); + symbolEncodingType_e const OFtype = (symbolEncodingType_e)((*ip >> 4) & 3); + symbolEncodingType_e const MLtype = (symbolEncodingType_e)((*ip >> 2) & 3); + int ddictIsCold = 0; + ip++; +#if ZSTD_DECOMPRESS_DICTIONARY != 0 + ddictIsCold = dctx->ddictIsCold; +#endif + + /* Build DTables */ + { size_t const llhSize = ZSTD_buildSeqTable(dctx->entropy.LLTable, &dctx->LLTptr, + LLtype, MaxLL, LLFSELog, + ip, iend-ip, + LL_base, LL_bits, + LL_defaultDTable, dctx->fseEntropy, + ddictIsCold, nbSeq, + dctx->workspace, sizeof(dctx->workspace), + ZSTD_DCtx_get_bmi2(dctx)); + RETURN_ERROR_IF(ZSTD_isError(llhSize), corruption_detected, "ZSTD_buildSeqTable failed"); + ip += llhSize; + } + + { size_t const ofhSize = ZSTD_buildSeqTable(dctx->entropy.OFTable, &dctx->OFTptr, + OFtype, MaxOff, OffFSELog, + ip, iend-ip, + OF_base, OF_bits, + OF_defaultDTable, dctx->fseEntropy, + ddictIsCold, nbSeq, + dctx->workspace, sizeof(dctx->workspace), + ZSTD_DCtx_get_bmi2(dctx)); + RETURN_ERROR_IF(ZSTD_isError(ofhSize), corruption_detected, "ZSTD_buildSeqTable failed"); + ip += ofhSize; + } + + { size_t const mlhSize = ZSTD_buildSeqTable(dctx->entropy.MLTable, &dctx->MLTptr, + MLtype, MaxML, MLFSELog, + ip, iend-ip, + ML_base, ML_bits, + ML_defaultDTable, dctx->fseEntropy, + ddictIsCold, nbSeq, + dctx->workspace, sizeof(dctx->workspace), + ZSTD_DCtx_get_bmi2(dctx)); + RETURN_ERROR_IF(ZSTD_isError(mlhSize), corruption_detected, "ZSTD_buildSeqTable failed"); + ip += mlhSize; + } + } + + return ip-istart; +} + + +typedef struct { + size_t litLength; + size_t matchLength; + size_t offset; +} seq_t; + +typedef struct { + size_t state; + const ZSTD_seqSymbol* table; +} ZSTD_fseState; + +typedef struct { + BIT_DStream_t DStream; + ZSTD_fseState stateLL; + ZSTD_fseState stateOffb; + ZSTD_fseState stateML; + size_t prevOffset[ZSTD_REP_NUM]; +} seqState_t; + +/*! ZSTD_overlapCopy8() : + * Copies 8 bytes from ip to op and updates op and ip where ip <= op. + * If the offset is < 8 then the offset is spread to at least 8 bytes. + * + * Precondition: *ip <= *op + * Postcondition: *op - *op >= 8 + */ +HINT_INLINE void ZSTD_overlapCopy8(BYTE** op, BYTE const** ip, size_t offset) { + assert(*ip <= *op); + if (offset < 8) { + /* close range match, overlap */ + static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 }; /* added */ + static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 }; /* subtracted */ + int const sub2 = dec64table[offset]; + (*op)[0] = (*ip)[0]; + (*op)[1] = (*ip)[1]; + (*op)[2] = (*ip)[2]; + (*op)[3] = (*ip)[3]; + *ip += dec32table[offset]; + ZSTD_copy4(*op+4, *ip); + *ip -= sub2; + } else { + ZSTD_copy8(*op, *ip); + } + *ip += 8; + *op += 8; + assert(*op - *ip >= 8); +} + +/*! ZSTD_safecopy() : + * Specialized version of memcpy() that is allowed to READ up to WILDCOPY_OVERLENGTH past the input buffer + * and write up to 16 bytes past oend_w (op >= oend_w is allowed). + * This function is only called in the uncommon case where the sequence is near the end of the block. It + * should be fast for a single long sequence, but can be slow for several short sequences. + * + * @param ovtype controls the overlap detection + * - ZSTD_no_overlap: The source and destination are guaranteed to be at least WILDCOPY_VECLEN bytes apart. + * - ZSTD_overlap_src_before_dst: The src and dst may overlap and may be any distance apart. + * The src buffer must be before the dst buffer. + */ +static void ZSTD_safecopy(BYTE* op, BYTE* const oend_w, BYTE const* ip, ptrdiff_t length, ZSTD_overlap_e ovtype) { + ptrdiff_t const diff = op - ip; + BYTE* const oend = op + length; + + assert((ovtype == ZSTD_no_overlap && (diff <= -8 || diff >= 8 || op >= oend_w)) || + (ovtype == ZSTD_overlap_src_before_dst && diff >= 0)); + + if (length < 8) { + /* Handle short lengths. */ + while (op < oend) *op++ = *ip++; + return; + } + if (ovtype == ZSTD_overlap_src_before_dst) { + /* Copy 8 bytes and ensure the offset >= 8 when there can be overlap. */ + assert(length >= 8); + ZSTD_overlapCopy8(&op, &ip, diff); + assert(op - ip >= 8); + assert(op <= oend); + } + + if (oend <= oend_w) { + /* No risk of overwrite. */ + ZSTD_wildcopy(op, ip, length, ovtype); + return; + } + if (op <= oend_w) { + /* Wildcopy until we get close to the end. */ + assert(oend > oend_w); + ZSTD_wildcopy(op, ip, oend_w - op, ovtype); + ip += oend_w - op; + op = oend_w; + } + /* Handle the leftovers. */ + while (op < oend) *op++ = *ip++; +} + +/* ZSTD_execSequenceEnd(): + * This version handles cases that are near the end of the output buffer. It requires + * more careful checks to make sure there is no overflow. By separating out these hard + * and unlikely cases, we can speed up the common cases. + * + * NOTE: This function needs to be fast for a single long sequence, but doesn't need + * to be optimized for many small sequences, since those fall into ZSTD_execSequence(). + */ +FORCE_NOINLINE +size_t ZSTD_execSequenceEnd(BYTE* op, + BYTE* const oend, seq_t sequence, + const BYTE** litPtr, const BYTE* const litLimit, + const BYTE* const prefixStart, const BYTE* const virtualStart, const BYTE* const dictEnd) +{ + BYTE* const oLitEnd = op + sequence.litLength; + size_t const sequenceLength = sequence.litLength + sequence.matchLength; + const BYTE* const iLitEnd = *litPtr + sequence.litLength; + const BYTE* match = oLitEnd - sequence.offset; + BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH; + + /* bounds checks : careful of address space overflow in 32-bit mode */ + RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, "last match must fit within dstBuffer"); + RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, "try to read beyond literal buffer"); + assert(op < op + sequenceLength); + assert(oLitEnd < op + sequenceLength); + + /* copy literals */ + ZSTD_safecopy(op, oend_w, *litPtr, sequence.litLength, ZSTD_no_overlap); + op = oLitEnd; + *litPtr = iLitEnd; + + /* copy Match */ + if (sequence.offset > (size_t)(oLitEnd - prefixStart)) { + /* offset beyond prefix */ + RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, ""); + match = dictEnd - (prefixStart-match); + if (match + sequence.matchLength <= dictEnd) { + ZSTD_memmove(oLitEnd, match, sequence.matchLength); + return sequenceLength; + } + /* span extDict & currentPrefixSegment */ + { size_t const length1 = dictEnd - match; + ZSTD_memmove(oLitEnd, match, length1); + op = oLitEnd + length1; + sequence.matchLength -= length1; + match = prefixStart; + } } + ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst); + return sequenceLength; +} + +HINT_INLINE +size_t ZSTD_execSequence(BYTE* op, + BYTE* const oend, seq_t sequence, + const BYTE** litPtr, const BYTE* const litLimit, + const BYTE* const prefixStart, const BYTE* const virtualStart, const BYTE* const dictEnd) +{ + BYTE* const oLitEnd = op + sequence.litLength; + size_t const sequenceLength = sequence.litLength + sequence.matchLength; + BYTE* const oMatchEnd = op + sequenceLength; /* risk : address space overflow (32-bits) */ + BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH; /* risk : address space underflow on oend=NULL */ + const BYTE* const iLitEnd = *litPtr + sequence.litLength; + const BYTE* match = oLitEnd - sequence.offset; + + assert(op != NULL /* Precondition */); + assert(oend_w < oend /* No underflow */); + /* Handle edge cases in a slow path: + * - Read beyond end of literals + * - Match end is within WILDCOPY_OVERLIMIT of oend + * - 32-bit mode and the match length overflows + */ + if (UNLIKELY( + iLitEnd > litLimit || + oMatchEnd > oend_w || + (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH))) + return ZSTD_execSequenceEnd(op, oend, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd); + + /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */ + assert(op <= oLitEnd /* No overflow */); + assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */); + assert(oMatchEnd <= oend /* No underflow */); + assert(iLitEnd <= litLimit /* Literal length is in bounds */); + assert(oLitEnd <= oend_w /* Can wildcopy literals */); + assert(oMatchEnd <= oend_w /* Can wildcopy matches */); + + /* Copy Literals: + * Split out litLength <= 16 since it is nearly always true. +1.6% on gcc-9. + * We likely don't need the full 32-byte wildcopy. + */ + assert(WILDCOPY_OVERLENGTH >= 16); + ZSTD_copy16(op, (*litPtr)); + if (UNLIKELY(sequence.litLength > 16)) { + ZSTD_wildcopy(op+16, (*litPtr)+16, sequence.litLength-16, ZSTD_no_overlap); + } + op = oLitEnd; + *litPtr = iLitEnd; /* update for next sequence */ + + /* Copy Match */ + if (sequence.offset > (size_t)(oLitEnd - prefixStart)) { + /* offset beyond prefix -> go into extDict */ + RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected, ""); + match = dictEnd + (match - prefixStart); + if (match + sequence.matchLength <= dictEnd) { + ZSTD_memmove(oLitEnd, match, sequence.matchLength); + return sequenceLength; + } + /* span extDict & currentPrefixSegment */ + { size_t const length1 = dictEnd - match; + ZSTD_memmove(oLitEnd, match, length1); + op = oLitEnd + length1; + sequence.matchLength -= length1; + match = prefixStart; + } } + /* Match within prefix of 1 or more bytes */ + assert(op <= oMatchEnd); + assert(oMatchEnd <= oend_w); + assert(match >= prefixStart); + assert(sequence.matchLength >= 1); + + /* Nearly all offsets are >= WILDCOPY_VECLEN bytes, which means we can use wildcopy + * without overlap checking. + */ + if (LIKELY(sequence.offset >= WILDCOPY_VECLEN)) { + /* We bet on a full wildcopy for matches, since we expect matches to be + * longer than literals (in general). In silesia, ~10% of matches are longer + * than 16 bytes. + */ + ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength, ZSTD_no_overlap); + return sequenceLength; + } + assert(sequence.offset < WILDCOPY_VECLEN); + + /* Copy 8 bytes and spread the offset to be >= 8. */ + ZSTD_overlapCopy8(&op, &match, sequence.offset); + + /* If the match length is > 8 bytes, then continue with the wildcopy. */ + if (sequence.matchLength > 8) { + assert(op < oMatchEnd); + ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8, ZSTD_overlap_src_before_dst); + } + return sequenceLength; +} + +static void +ZSTD_initFseState(ZSTD_fseState* DStatePtr, BIT_DStream_t* bitD, const ZSTD_seqSymbol* dt) +{ + const void* ptr = dt; + const ZSTD_seqSymbol_header* const DTableH = (const ZSTD_seqSymbol_header*)ptr; + DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog); + DEBUGLOG(6, "ZSTD_initFseState : val=%u using %u bits", + (U32)DStatePtr->state, DTableH->tableLog); + BIT_reloadDStream(bitD); + DStatePtr->table = dt + 1; +} + +FORCE_INLINE_TEMPLATE void +ZSTD_updateFseStateWithDInfo(ZSTD_fseState* DStatePtr, BIT_DStream_t* bitD, U16 nextState, U32 nbBits) +{ + size_t const lowBits = BIT_readBits(bitD, nbBits); + DStatePtr->state = nextState + lowBits; +} + +/* We need to add at most (ZSTD_WINDOWLOG_MAX_32 - 1) bits to read the maximum + * offset bits. But we can only read at most (STREAM_ACCUMULATOR_MIN_32 - 1) + * bits before reloading. This value is the maximum number of bytes we read + * after reloading when we are decoding long offsets. + */ +#define LONG_OFFSETS_MAX_EXTRA_BITS_32 \ + (ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32 \ + ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32 \ + : 0) + +typedef enum { ZSTD_lo_isRegularOffset, ZSTD_lo_isLongOffset=1 } ZSTD_longOffset_e; + +FORCE_INLINE_TEMPLATE seq_t +ZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets) +{ + seq_t seq; + const ZSTD_seqSymbol* const llDInfo = seqState->stateLL.table + seqState->stateLL.state; + const ZSTD_seqSymbol* const mlDInfo = seqState->stateML.table + seqState->stateML.state; + const ZSTD_seqSymbol* const ofDInfo = seqState->stateOffb.table + seqState->stateOffb.state; + seq.matchLength = mlDInfo->baseValue; + seq.litLength = llDInfo->baseValue; + { U32 const ofBase = ofDInfo->baseValue; + BYTE const llBits = llDInfo->nbAdditionalBits; + BYTE const mlBits = mlDInfo->nbAdditionalBits; + BYTE const ofBits = ofDInfo->nbAdditionalBits; + BYTE const totalBits = llBits+mlBits+ofBits; + + U16 const llNext = llDInfo->nextState; + U16 const mlNext = mlDInfo->nextState; + U16 const ofNext = ofDInfo->nextState; + U32 const llnbBits = llDInfo->nbBits; + U32 const mlnbBits = mlDInfo->nbBits; + U32 const ofnbBits = ofDInfo->nbBits; + /* + * As gcc has better branch and block analyzers, sometimes it is only + * valuable to mark likelyness for clang, it gives around 3-4% of + * performance. + */ + + /* sequence */ + { size_t offset; + #if defined(__clang__) + if (LIKELY(ofBits > 1)) { + #else + if (ofBits > 1) { + #endif + ZSTD_STATIC_ASSERT(ZSTD_lo_isLongOffset == 1); + ZSTD_STATIC_ASSERT(LONG_OFFSETS_MAX_EXTRA_BITS_32 == 5); + assert(ofBits <= MaxOff); + if (MEM_32bits() && longOffsets && (ofBits >= STREAM_ACCUMULATOR_MIN_32)) { + U32 const extraBits = ofBits - MIN(ofBits, 32 - seqState->DStream.bitsConsumed); + offset = ofBase + (BIT_readBitsFast(&seqState->DStream, ofBits - extraBits) << extraBits); + BIT_reloadDStream(&seqState->DStream); + if (extraBits) offset += BIT_readBitsFast(&seqState->DStream, extraBits); + assert(extraBits <= LONG_OFFSETS_MAX_EXTRA_BITS_32); /* to avoid another reload */ + } else { + offset = ofBase + BIT_readBitsFast(&seqState->DStream, ofBits/*>0*/); /* <= (ZSTD_WINDOWLOG_MAX-1) bits */ + if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream); + } + seqState->prevOffset[2] = seqState->prevOffset[1]; + seqState->prevOffset[1] = seqState->prevOffset[0]; + seqState->prevOffset[0] = offset; + } else { + U32 const ll0 = (llDInfo->baseValue == 0); + if (LIKELY((ofBits == 0))) { + offset = seqState->prevOffset[ll0]; + seqState->prevOffset[1] = seqState->prevOffset[!ll0]; + seqState->prevOffset[0] = offset; + } else { + offset = ofBase + ll0 + BIT_readBitsFast(&seqState->DStream, 1); + { size_t temp = (offset==3) ? seqState->prevOffset[0] - 1 : seqState->prevOffset[offset]; + temp += !temp; /* 0 is not valid; input is corrupted; force offset to 1 */ + if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1]; + seqState->prevOffset[1] = seqState->prevOffset[0]; + seqState->prevOffset[0] = offset = temp; + } } } + seq.offset = offset; + } + + #if defined(__clang__) + if (UNLIKELY(mlBits > 0)) + #else + if (mlBits > 0) + #endif + seq.matchLength += BIT_readBitsFast(&seqState->DStream, mlBits/*>0*/); + + if (MEM_32bits() && (mlBits+llBits >= STREAM_ACCUMULATOR_MIN_32-LONG_OFFSETS_MAX_EXTRA_BITS_32)) + BIT_reloadDStream(&seqState->DStream); + if (MEM_64bits() && UNLIKELY(totalBits >= STREAM_ACCUMULATOR_MIN_64-(LLFSELog+MLFSELog+OffFSELog))) + BIT_reloadDStream(&seqState->DStream); + /* Ensure there are enough bits to read the rest of data in 64-bit mode. */ + ZSTD_STATIC_ASSERT(16+LLFSELog+MLFSELog+OffFSELog < STREAM_ACCUMULATOR_MIN_64); + + #if defined(__clang__) + if (UNLIKELY(llBits > 0)) + #else + if (llBits > 0) + #endif + seq.litLength += BIT_readBitsFast(&seqState->DStream, llBits/*>0*/); + + if (MEM_32bits()) + BIT_reloadDStream(&seqState->DStream); + + DEBUGLOG(6, "seq: litL=%u, matchL=%u, offset=%u", + (U32)seq.litLength, (U32)seq.matchLength, (U32)seq.offset); + + ZSTD_updateFseStateWithDInfo(&seqState->stateLL, &seqState->DStream, llNext, llnbBits); /* <= 9 bits */ + ZSTD_updateFseStateWithDInfo(&seqState->stateML, &seqState->DStream, mlNext, mlnbBits); /* <= 9 bits */ + if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream); /* <= 18 bits */ + ZSTD_updateFseStateWithDInfo(&seqState->stateOffb, &seqState->DStream, ofNext, ofnbBits); /* <= 8 bits */ + } + + return seq; +} + + +#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG +FORCE_INLINE_TEMPLATE size_t +DONT_VECTORIZE +ZSTD_decompressSequences_body( ZSTD_DCtx* dctx, + void* dst, size_t maxDstSize, + const void* seqStart, size_t seqSize, int nbSeq, + const ZSTD_longOffset_e isLongOffset, + const int frame) +{ + const BYTE* ip = (const BYTE*)seqStart; + const BYTE* const iend = ip + seqSize; + BYTE* const ostart = (BYTE*)dst; + BYTE* const oend = ostart + maxDstSize; + BYTE* op = ostart; + const BYTE* litPtr = dctx->litPtr; + const BYTE* const litEnd = litPtr + dctx->litSize; + const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart); + const BYTE* const vBase = (const BYTE*) (dctx->virtualStart); + const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd); + DEBUGLOG(5, "ZSTD_decompressSequences_body"); + (void)frame; + + /* Regen sequences */ + if (nbSeq) { + seqState_t seqState; + dctx->fseEntropy = 1; + { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; } + RETURN_ERROR_IF( + ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)), + corruption_detected, ""); + ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr); + ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr); + ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr); + assert(dst != NULL); + + ZSTD_STATIC_ASSERT( + BIT_DStream_unfinished < BIT_DStream_completed && + BIT_DStream_endOfBuffer < BIT_DStream_completed && + BIT_DStream_completed < BIT_DStream_overflow); + +#if defined(__GNUC__) && defined(__x86_64__) + /* Align the decompression loop to 32 + 16 bytes. + * + * zstd compiled with gcc-9 on an Intel i9-9900k shows 10% decompression + * speed swings based on the alignment of the decompression loop. This + * performance swing is caused by parts of the decompression loop falling + * out of the DSB. The entire decompression loop should fit in the DSB, + * when it can't we get much worse performance. You can measure if you've + * hit the good case or the bad case with this perf command for some + * compressed file test.zst: + * + * perf stat -e cycles -e instructions -e idq.all_dsb_cycles_any_uops \ + * -e idq.all_mite_cycles_any_uops -- ./zstd -tq test.zst + * + * If you see most cycles served out of the MITE you've hit the bad case. + * If you see most cycles served out of the DSB you've hit the good case. + * If it is pretty even then you may be in an okay case. + * + * This issue has been reproduced on the following CPUs: + * - Kabylake: Macbook Pro (15-inch, 2019) 2.4 GHz Intel Core i9 + * Use Instruments->Counters to get DSB/MITE cycles. + * I never got performance swings, but I was able to + * go from the good case of mostly DSB to half of the + * cycles served from MITE. + * - Coffeelake: Intel i9-9900k + * - Coffeelake: Intel i7-9700k + * + * I haven't been able to reproduce the instability or DSB misses on any + * of the following CPUS: + * - Haswell + * - Broadwell: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GH + * - Skylake + * + * If you are seeing performance stability this script can help test. + * It tests on 4 commits in zstd where I saw performance change. + * + * https://gist.github.com/terrelln/9889fc06a423fd5ca6e99351564473f4 + */ + __asm__(".p2align 6"); + __asm__("nop"); + __asm__(".p2align 5"); + __asm__("nop"); +# if __GNUC__ >= 9 && __GNUC__ < 11 + /* better for gcc-9 and gcc-10, worse for clang and gcc-8, gcc-11 */ + __asm__(".p2align 3"); +# else + __asm__(".p2align 4"); +# endif +#endif + for ( ; ; ) { + seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset); + size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litEnd, prefixStart, vBase, dictEnd); + if (UNLIKELY(ZSTD_isError(oneSeqSize))) + return oneSeqSize; + DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize); + op += oneSeqSize; + if (UNLIKELY(!--nbSeq)) + break; + BIT_reloadDStream(&(seqState.DStream)); + } + + /* check if reached exact end */ + DEBUGLOG(5, "ZSTD_decompressSequences_body: after decode loop, remaining nbSeq : %i", nbSeq); + RETURN_ERROR_IF(nbSeq, corruption_detected, ""); + RETURN_ERROR_IF(BIT_reloadDStream(&seqState.DStream) < BIT_DStream_completed, corruption_detected, ""); + /* save reps for next block */ + { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); } + } + + /* last literal segment */ + { size_t const lastLLSize = litEnd - litPtr; + RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, ""); + if (op != NULL) { + ZSTD_memcpy(op, litPtr, lastLLSize); + op += lastLLSize; + } + } + + return op-ostart; +} + +static size_t +ZSTD_decompressSequences_default(ZSTD_DCtx* dctx, + void* dst, size_t maxDstSize, + const void* seqStart, size_t seqSize, int nbSeq, + const ZSTD_longOffset_e isLongOffset, + const int frame) +{ + return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame); +} +#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG */ + +#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT + +FORCE_INLINE_TEMPLATE size_t +ZSTD_prefetchMatch(size_t prefetchPos, seq_t const sequence, + const BYTE* const prefixStart, const BYTE* const dictEnd) +{ + prefetchPos += sequence.litLength; + { const BYTE* const matchBase = (sequence.offset > prefetchPos) ? dictEnd : prefixStart; + const BYTE* const match = matchBase + prefetchPos - sequence.offset; /* note : this operation can overflow when seq.offset is really too large, which can only happen when input is corrupted. + * No consequence though : memory address is only used for prefetching, not for dereferencing */ + PREFETCH_L1(match); PREFETCH_L1(match+CACHELINE_SIZE); /* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */ + } + return prefetchPos + sequence.matchLength; +} + +/* This decoding function employs prefetching + * to reduce latency impact of cache misses. + * It's generally employed when block contains a significant portion of long-distance matches + * or when coupled with a "cold" dictionary */ +FORCE_INLINE_TEMPLATE size_t +ZSTD_decompressSequencesLong_body( + ZSTD_DCtx* dctx, + void* dst, size_t maxDstSize, + const void* seqStart, size_t seqSize, int nbSeq, + const ZSTD_longOffset_e isLongOffset, + const int frame) +{ + const BYTE* ip = (const BYTE*)seqStart; + const BYTE* const iend = ip + seqSize; + BYTE* const ostart = (BYTE*)dst; + BYTE* const oend = ostart + maxDstSize; + BYTE* op = ostart; + const BYTE* litPtr = dctx->litPtr; + const BYTE* const litEnd = litPtr + dctx->litSize; + const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart); + const BYTE* const dictStart = (const BYTE*) (dctx->virtualStart); + const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd); + (void)frame; + + /* Regen sequences */ + if (nbSeq) { +#define STORED_SEQS 8 +#define STORED_SEQS_MASK (STORED_SEQS-1) +#define ADVANCED_SEQS STORED_SEQS + seq_t sequences[STORED_SEQS]; + int const seqAdvance = MIN(nbSeq, ADVANCED_SEQS); + seqState_t seqState; + int seqNb; + size_t prefetchPos = (size_t)(op-prefixStart); /* track position relative to prefixStart */ + + dctx->fseEntropy = 1; + { int i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; } + assert(dst != NULL); + assert(iend >= ip); + RETURN_ERROR_IF( + ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)), + corruption_detected, ""); + ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr); + ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr); + ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr); + + /* prepare in advance */ + for (seqNb=0; (BIT_reloadDStream(&seqState.DStream) <= BIT_DStream_completed) && (seqNb<seqAdvance); seqNb++) { + seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset); + prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd); + sequences[seqNb] = sequence; + } + RETURN_ERROR_IF(seqNb<seqAdvance, corruption_detected, ""); + + /* decode and decompress */ + for ( ; (BIT_reloadDStream(&(seqState.DStream)) <= BIT_DStream_completed) && (seqNb<nbSeq) ; seqNb++) { + seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset); + size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[(seqNb-ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litEnd, prefixStart, dictStart, dictEnd); + if (ZSTD_isError(oneSeqSize)) return oneSeqSize; + + prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd); + sequences[seqNb & STORED_SEQS_MASK] = sequence; + op += oneSeqSize; + } + RETURN_ERROR_IF(seqNb<nbSeq, corruption_detected, ""); + + /* finish queue */ + seqNb -= seqAdvance; + for ( ; seqNb<nbSeq ; seqNb++) { + size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[seqNb&STORED_SEQS_MASK], &litPtr, litEnd, prefixStart, dictStart, dictEnd); + if (ZSTD_isError(oneSeqSize)) return oneSeqSize; + op += oneSeqSize; + } + + /* save reps for next block */ + { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); } + } + + /* last literal segment */ + { size_t const lastLLSize = litEnd - litPtr; + RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, ""); + if (op != NULL) { + ZSTD_memcpy(op, litPtr, lastLLSize); + op += lastLLSize; + } + } + + return op-ostart; +} + +static size_t +ZSTD_decompressSequencesLong_default(ZSTD_DCtx* dctx, + void* dst, size_t maxDstSize, + const void* seqStart, size_t seqSize, int nbSeq, + const ZSTD_longOffset_e isLongOffset, + const int frame) +{ + return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame); +} +#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT */ + + + +#if DYNAMIC_BMI2 + +#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG +static TARGET_ATTRIBUTE("bmi2") size_t +DONT_VECTORIZE +ZSTD_decompressSequences_bmi2(ZSTD_DCtx* dctx, + void* dst, size_t maxDstSize, + const void* seqStart, size_t seqSize, int nbSeq, + const ZSTD_longOffset_e isLongOffset, + const int frame) +{ + return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame); +} +#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG */ + +#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT +static TARGET_ATTRIBUTE("bmi2") size_t +ZSTD_decompressSequencesLong_bmi2(ZSTD_DCtx* dctx, + void* dst, size_t maxDstSize, + const void* seqStart, size_t seqSize, int nbSeq, + const ZSTD_longOffset_e isLongOffset, + const int frame) +{ + return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame); +} +#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT */ + +#endif /* DYNAMIC_BMI2 */ + +typedef size_t (*ZSTD_decompressSequences_t)( + ZSTD_DCtx* dctx, + void* dst, size_t maxDstSize, + const void* seqStart, size_t seqSize, int nbSeq, + const ZSTD_longOffset_e isLongOffset, + const int frame); + +#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG +static size_t +ZSTD_decompressSequences(ZSTD_DCtx* dctx, void* dst, size_t maxDstSize, + const void* seqStart, size_t seqSize, int nbSeq, + const ZSTD_longOffset_e isLongOffset, + const int frame) +{ + DEBUGLOG(5, "ZSTD_decompressSequences"); +#if DYNAMIC_BMI2 + if (ZSTD_DCtx_get_bmi2(dctx)) { + return ZSTD_decompressSequences_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame); + } +#endif + return ZSTD_decompressSequences_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame); +} +#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG */ + + +#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT +/* ZSTD_decompressSequencesLong() : + * decompression function triggered when a minimum share of offsets is considered "long", + * aka out of cache. + * note : "long" definition seems overloaded here, sometimes meaning "wider than bitstream register", and sometimes meaning "farther than memory cache distance". + * This function will try to mitigate main memory latency through the use of prefetching */ +static size_t +ZSTD_decompressSequencesLong(ZSTD_DCtx* dctx, + void* dst, size_t maxDstSize, + const void* seqStart, size_t seqSize, int nbSeq, + const ZSTD_longOffset_e isLongOffset, + const int frame) +{ + DEBUGLOG(5, "ZSTD_decompressSequencesLong"); +#if DYNAMIC_BMI2 + if (ZSTD_DCtx_get_bmi2(dctx)) { + return ZSTD_decompressSequencesLong_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame); + } +#endif + return ZSTD_decompressSequencesLong_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame); +} +#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT */ + + + +#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \ + !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG) +/* ZSTD_getLongOffsetsShare() : + * condition : offTable must be valid + * @return : "share" of long offsets (arbitrarily defined as > (1<<23)) + * compared to maximum possible of (1<<OffFSELog) */ +static unsigned +ZSTD_getLongOffsetsShare(const ZSTD_seqSymbol* offTable) +{ + const void* ptr = offTable; + U32 const tableLog = ((const ZSTD_seqSymbol_header*)ptr)[0].tableLog; + const ZSTD_seqSymbol* table = offTable + 1; + U32 const max = 1 << tableLog; + U32 u, total = 0; + DEBUGLOG(5, "ZSTD_getLongOffsetsShare: (tableLog=%u)", tableLog); + + assert(max <= (1 << OffFSELog)); /* max not too large */ + for (u=0; u<max; u++) { + if (table[u].nbAdditionalBits > 22) total += 1; + } + + assert(tableLog <= OffFSELog); + total <<= (OffFSELog - tableLog); /* scale to OffFSELog */ + + return total; +} +#endif + +size_t +ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, const int frame) +{ /* blockType == blockCompressed */ + const BYTE* ip = (const BYTE*)src; + /* isLongOffset must be true if there are long offsets. + * Offsets are long if they are larger than 2^STREAM_ACCUMULATOR_MIN. + * We don't expect that to be the case in 64-bit mode. + * In block mode, window size is not known, so we have to be conservative. + * (note: but it could be evaluated from current-lowLimit) + */ + ZSTD_longOffset_e const isLongOffset = (ZSTD_longOffset_e)(MEM_32bits() && (!frame || (dctx->fParams.windowSize > (1ULL << STREAM_ACCUMULATOR_MIN)))); + DEBUGLOG(5, "ZSTD_decompressBlock_internal (size : %u)", (U32)srcSize); + + RETURN_ERROR_IF(srcSize >= ZSTD_BLOCKSIZE_MAX, srcSize_wrong, ""); + + /* Decode literals section */ + { size_t const litCSize = ZSTD_decodeLiteralsBlock(dctx, src, srcSize); + DEBUGLOG(5, "ZSTD_decodeLiteralsBlock : %u", (U32)litCSize); + if (ZSTD_isError(litCSize)) return litCSize; + ip += litCSize; + srcSize -= litCSize; + } + + /* Build Decoding Tables */ + { + /* These macros control at build-time which decompressor implementation + * we use. If neither is defined, we do some inspection and dispatch at + * runtime. + */ +#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \ + !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG) + int usePrefetchDecoder = 0; +#if ZSTD_DECOMPRESS_DICTIONARY != 0 + usePrefetchDecoder = dctx->ddictIsCold; +#endif +#endif + int nbSeq; + size_t const seqHSize = ZSTD_decodeSeqHeaders(dctx, &nbSeq, ip, srcSize); + if (ZSTD_isError(seqHSize)) return seqHSize; + ip += seqHSize; + srcSize -= seqHSize; + + RETURN_ERROR_IF(dst == NULL && nbSeq > 0, dstSize_tooSmall, "NULL not handled"); + +#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \ + !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG) + if ( !usePrefetchDecoder + && (!frame || (dctx->fParams.windowSize > (1<<24))) + && (nbSeq>ADVANCED_SEQS) ) { /* could probably use a larger nbSeq limit */ + U32 const shareLongOffsets = ZSTD_getLongOffsetsShare(dctx->OFTptr); + U32 const minShare = MEM_64bits() ? 7 : 20; /* heuristic values, correspond to 2.73% and 7.81% */ + usePrefetchDecoder = (shareLongOffsets >= minShare); + } +#endif +#if ZSTD_DECOMPRESS_DICTIONARY != 0 + dctx->ddictIsCold = 0; +#endif + +#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \ + !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG) + if (usePrefetchDecoder) +#endif +#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT + return ZSTD_decompressSequencesLong(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset, frame); +#endif + +#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG + /* else */ + return ZSTD_decompressSequences(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset, frame); +#endif + } +} + + +void ZSTD_checkContinuity(ZSTD_DCtx* dctx, const void* dst, size_t dstSize) +{ + if (dst != dctx->previousDstEnd && dstSize > 0) { /* not contiguous */ + dctx->dictEnd = dctx->previousDstEnd; + dctx->virtualStart = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->prefixStart)); + dctx->prefixStart = dst; + dctx->previousDstEnd = dst; + } +} + + +size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize) +{ + size_t dSize; + ZSTD_checkContinuity(dctx, dst, dstCapacity); + dSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize, /* frame */ 0); + dctx->previousDstEnd = (char*)dst + dSize; + return dSize; +} diff --git a/src/bled/zstd_decompress_block.h b/src/bled/zstd_decompress_block.h new file mode 100644 index 00000000..47653414 --- /dev/null +++ b/src/bled/zstd_decompress_block.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + + +#ifndef ZSTD_DEC_BLOCK_H +#define ZSTD_DEC_BLOCK_H + +/*-******************************************************* + * Dependencies + *********************************************************/ +#include "zstd_deps.h" /* size_t */ +#include "zstd.h" /* DCtx, and some public functions */ +#include "zstd_internal.h" /* blockProperties_t, and some public functions */ +#include "zstd_decompress_internal.h" /* ZSTD_seqSymbol */ + + +/* === Prototypes === */ + +/* note: prototypes already published within `zstd.h` : + * ZSTD_decompressBlock() + */ + +/* note: prototypes already published within `zstd_internal.h` : + * ZSTD_getcBlockSize() + * ZSTD_decodeSeqHeaders() + */ + + +/* ZSTD_decompressBlock_internal() : + * decompress block, starting at `src`, + * into destination buffer `dst`. + * @return : decompressed block size, + * or an error code (which can be tested using ZSTD_isError()) + */ +size_t ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, const int frame); + +/* ZSTD_buildFSETable() : + * generate FSE decoding table for one symbol (ll, ml or off) + * this function must be called with valid parameters only + * (dt is large enough, normalizedCounter distribution total is a power of 2, max is within range, etc.) + * in which case it cannot fail. + * The workspace must be 4-byte aligned and at least ZSTD_BUILD_FSE_TABLE_WKSP_SIZE bytes, which is + * defined in zstd_decompress_internal.h. + * Internal use only. + */ +void ZSTD_buildFSETable(ZSTD_seqSymbol* dt, + const short* normalizedCounter, unsigned maxSymbolValue, + const U32* baseValue, const U32* nbAdditionalBits, + unsigned tableLog, void* wksp, size_t wkspSize, + int bmi2); + + +#endif /* ZSTD_DEC_BLOCK_H */ diff --git a/src/bled/zstd_decompress_internal.h b/src/bled/zstd_decompress_internal.h new file mode 100644 index 00000000..19841485 --- /dev/null +++ b/src/bled/zstd_decompress_internal.h @@ -0,0 +1,205 @@ +/* + * Copyright (c) Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + + +/* zstd_decompress_internal: + * objects and definitions shared within lib/decompress modules */ + + #ifndef ZSTD_DECOMPRESS_INTERNAL_H + #define ZSTD_DECOMPRESS_INTERNAL_H + + +/*-******************************************************* + * Dependencies + *********************************************************/ +#include "zstd_mem.h" /* BYTE, U16, U32 */ +#include "zstd_internal.h" /* ZSTD_seqSymbol */ + + + +/*-******************************************************* + * Constants + *********************************************************/ +static UNUSED_ATTR const U32 LL_base[MaxLL+1] = { + 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, + 16, 18, 20, 22, 24, 28, 32, 40, + 48, 64, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000, + 0x2000, 0x4000, 0x8000, 0x10000 }; + +static UNUSED_ATTR const U32 OF_base[MaxOff+1] = { + 0, 1, 1, 5, 0xD, 0x1D, 0x3D, 0x7D, + 0xFD, 0x1FD, 0x3FD, 0x7FD, 0xFFD, 0x1FFD, 0x3FFD, 0x7FFD, + 0xFFFD, 0x1FFFD, 0x3FFFD, 0x7FFFD, 0xFFFFD, 0x1FFFFD, 0x3FFFFD, 0x7FFFFD, + 0xFFFFFD, 0x1FFFFFD, 0x3FFFFFD, 0x7FFFFFD, 0xFFFFFFD, 0x1FFFFFFD, 0x3FFFFFFD, 0x7FFFFFFD }; + +static UNUSED_ATTR const U32 OF_bits[MaxOff+1] = { + 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31 }; + +static UNUSED_ATTR const U32 ML_base[MaxML+1] = { + 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, + 35, 37, 39, 41, 43, 47, 51, 59, + 67, 83, 99, 0x83, 0x103, 0x203, 0x403, 0x803, + 0x1003, 0x2003, 0x4003, 0x8003, 0x10003 }; + + +/*-******************************************************* + * Decompression types + *********************************************************/ + typedef struct { + U32 fastMode; + U32 tableLog; + } ZSTD_seqSymbol_header; + + typedef struct { + U16 nextState; + BYTE nbAdditionalBits; + BYTE nbBits; + U32 baseValue; + } ZSTD_seqSymbol; + + #define SEQSYMBOL_TABLE_SIZE(log) (1 + (1 << (log))) + +#define ZSTD_BUILD_FSE_TABLE_WKSP_SIZE (sizeof(S16) * (MaxSeq + 1) + (1u << MaxFSELog) + sizeof(U64)) +#define ZSTD_BUILD_FSE_TABLE_WKSP_SIZE_U32 ((ZSTD_BUILD_FSE_TABLE_WKSP_SIZE + sizeof(U32) - 1) / sizeof(U32)) + +typedef struct { + ZSTD_seqSymbol LLTable[SEQSYMBOL_TABLE_SIZE(LLFSELog)]; /* Note : Space reserved for FSE Tables */ + ZSTD_seqSymbol OFTable[SEQSYMBOL_TABLE_SIZE(OffFSELog)]; /* is also used as temporary workspace while building hufTable during DDict creation */ + ZSTD_seqSymbol MLTable[SEQSYMBOL_TABLE_SIZE(MLFSELog)]; /* and therefore must be at least HUF_DECOMPRESS_WORKSPACE_SIZE large */ + HUF_DTable hufTable[HUF_DTABLE_SIZE(HufLog)]; /* can accommodate HUF_decompress4X */ + U32 rep[ZSTD_REP_NUM]; + U32 workspace[ZSTD_BUILD_FSE_TABLE_WKSP_SIZE_U32]; +} ZSTD_entropyDTables_t; + +typedef enum { ZSTDds_getFrameHeaderSize, ZSTDds_decodeFrameHeader, + ZSTDds_decodeBlockHeader, ZSTDds_decompressBlock, + ZSTDds_decompressLastBlock, ZSTDds_checkChecksum, + ZSTDds_decodeSkippableHeader, ZSTDds_skipFrame } ZSTD_dStage; + +typedef enum { zdss_init=0, zdss_loadHeader, + zdss_read, zdss_load, zdss_flush } ZSTD_dStreamStage; + +typedef enum { + ZSTD_use_indefinitely = -1, /* Use the dictionary indefinitely */ + ZSTD_dont_use = 0, /* Do not use the dictionary (if one exists free it) */ + ZSTD_use_once = 1 /* Use the dictionary once and set to ZSTD_dont_use */ +} ZSTD_dictUses_e; + +/* Hashset for storing references to multiple ZSTD_DDict within ZSTD_DCtx */ +typedef struct { + const ZSTD_DDict** ddictPtrTable; + size_t ddictPtrTableSize; + size_t ddictPtrCount; +} ZSTD_DDictHashSet; + +struct ZSTD_DCtx_s +{ + const ZSTD_seqSymbol* LLTptr; + const ZSTD_seqSymbol* MLTptr; + const ZSTD_seqSymbol* OFTptr; + const HUF_DTable* HUFptr; + ZSTD_entropyDTables_t entropy; + U32 workspace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32]; /* space needed when building huffman tables */ + const void* previousDstEnd; /* detect continuity */ + const void* prefixStart; /* start of current segment */ + const void* virtualStart; /* virtual start of previous segment if it was just before current one */ + const void* dictEnd; /* end of previous segment */ + size_t expected; + ZSTD_frameHeader fParams; + U64 processedCSize; + U64 decodedSize; + blockType_e bType; /* used in ZSTD_decompressContinue(), store blockType between block header decoding and block decompression stages */ + ZSTD_dStage stage; + U32 litEntropy; + U32 fseEntropy; + XXH64_state_t xxhState; + size_t headerSize; + ZSTD_format_e format; + ZSTD_forceIgnoreChecksum_e forceIgnoreChecksum; /* User specified: if == 1, will ignore checksums in compressed frame. Default == 0 */ + U32 validateChecksum; /* if == 1, will validate checksum. Is == 1 if (fParams.checksumFlag == 1) and (forceIgnoreChecksum == 0). */ + const BYTE* litPtr; + size_t litSize; + size_t rleSize; +#if DYNAMIC_BMI2 != 0 + int bmi2; /* == 1 if the CPU supports BMI2 and 0 otherwise. CPU support is determined dynamically once per context lifetime. */ +#endif + +#if ZSTD_DECOMPRESS_DICTIONARY != 0 + /* dictionary */ + ZSTD_DDict* ddictLocal; + const ZSTD_DDict* ddict; /* set by ZSTD_initDStream_usingDDict(), or ZSTD_DCtx_refDDict() */ + U32 dictID; + int ddictIsCold; /* if == 1 : dictionary is "new" for working context, and presumed "cold" (not in cpu cache) */ + ZSTD_dictUses_e dictUses; + ZSTD_DDictHashSet* ddictSet; /* Hash set for multiple ddicts */ + ZSTD_refMultipleDDicts_e refMultipleDDicts; /* User specified: if == 1, will allow references to multiple DDicts. Default == 0 (disabled) */ +#endif + + /* streaming */ + ZSTD_dStreamStage streamStage; + char* inBuff; + size_t inBuffSize; + size_t inPos; + size_t maxWindowSize; + char* outBuff; + size_t outBuffSize; + size_t outStart; + size_t outEnd; + size_t lhSize; + U32 hostageByte; + int noForwardProgress; + ZSTD_outBuffer expectedOutBuffer; + + /* workspace */ + BYTE litBuffer[ZSTD_BLOCKSIZE_MAX + WILDCOPY_OVERLENGTH]; + BYTE headerBuffer[ZSTD_FRAMEHEADERSIZE_MAX]; + + size_t oversizedDuration; + + + /* Tracing */ +}; /* typedef'd to ZSTD_DCtx within "zstd.h" */ + +MEM_STATIC int ZSTD_DCtx_get_bmi2(const struct ZSTD_DCtx_s *dctx) { +#if DYNAMIC_BMI2 != 0 + return dctx->bmi2; +#else + (void)dctx; + return 0; +#endif +} +#define ZSTD_DCtx_get_staticSize(dctx) (0) +#define ZSTD_DCtx_get_outBufferMode(dctx) (ZSTD_bm_buffered) +/*-******************************************************* + * Shared internal functions + *********************************************************/ + +/*! ZSTD_loadDEntropy() : + * dict : must point at beginning of a valid zstd dictionary. + * @return : size of dictionary header (size of magic number + dict ID + entropy tables) */ +size_t ZSTD_loadDEntropy(ZSTD_entropyDTables_t* entropy, + const void* const dict, size_t const dictSize); + +/*! ZSTD_checkContinuity() : + * check if next `dst` follows previous position, where decompression ended. + * If yes, do nothing (continue on current segment). + * If not, classify previous segment as "external dictionary", and start a new segment. + * This function cannot fail. */ +void ZSTD_checkContinuity(ZSTD_DCtx* dctx, const void* dst, size_t dstSize); + + +#endif /* ZSTD_DECOMPRESS_INTERNAL_H */ diff --git a/src/bled/zstd_deps.h b/src/bled/zstd_deps.h new file mode 100644 index 00000000..8a62920e --- /dev/null +++ b/src/bled/zstd_deps.h @@ -0,0 +1,130 @@ +/* + * Copyright (c) Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +/* This file provides common libc dependencies that zstd requires. + * The purpose is to allow replacing this file with a custom implementation + * to compile zstd without libc support. + */ + +/* Need: + * NULL + * INT_MAX + * UINT_MAX + * ZSTD_memcpy() + * ZSTD_memset() + * ZSTD_memmove() + */ +#ifndef ZSTD_DEPS_COMMON +#define ZSTD_DEPS_COMMON + +#include <assert.h> +#include <limits.h> +#include <stddef.h> +#include <string.h> +#include <crtdefs.h> +#include "zstd_config.h" + +#if defined(__GNUC__) && __GNUC__ >= 4 +# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l)) +# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l)) +# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l)) +#else +# define ZSTD_memcpy(d,s,l) memcpy((d),(s),(l)) +# define ZSTD_memmove(d,s,l) memmove((d),(s),(l)) +# define ZSTD_memset(p,v,l) memset((p),(v),(l)) +#endif + +#endif /* ZSTD_DEPS_COMMON */ + +/* Need: + * ZSTD_malloc() + * ZSTD_free() + * ZSTD_calloc() + */ +#ifdef ZSTD_DEPS_NEED_MALLOC +#ifndef ZSTD_DEPS_MALLOC +#define ZSTD_DEPS_MALLOC + +#include <stdlib.h> + +#define ZSTD_malloc(s) malloc(s) +#define ZSTD_calloc(n,s) calloc((n), (s)) +#define ZSTD_free(p) free((p)) + +#endif /* ZSTD_DEPS_MALLOC */ +#endif /* ZSTD_DEPS_NEED_MALLOC */ + +/* + * Provides 64-bit math support. + * Need: + * U64 ZSTD_div64(U64 dividend, U32 divisor) + */ +#ifdef ZSTD_DEPS_NEED_MATH64 +#ifndef ZSTD_DEPS_MATH64 +#define ZSTD_DEPS_MATH64 + +#define ZSTD_div64(dividend, divisor) ((dividend) / (divisor)) + +#endif /* ZSTD_DEPS_MATH64 */ +#endif /* ZSTD_DEPS_NEED_MATH64 */ + +/* Need: + * assert() + */ +#ifdef ZSTD_DEPS_NEED_ASSERT +#ifndef ZSTD_DEPS_ASSERT +#define ZSTD_DEPS_ASSERT + +#include <assert.h> + +#endif /* ZSTD_DEPS_ASSERT */ +#endif /* ZSTD_DEPS_NEED_ASSERT */ + +/* Need: + * ZSTD_DEBUG_PRINT() + */ +#ifdef ZSTD_DEPS_NEED_IO +#ifndef ZSTD_DEPS_IO +#define ZSTD_DEPS_IO + +#include <stdio.h> +#define ZSTD_DEBUG_PRINT(...) fprintf(stderr, __VA_ARGS__) + +#endif /* ZSTD_DEPS_IO */ +#endif /* ZSTD_DEPS_NEED_IO */ + +/* Only requested when <stdint.h> is known to be present. + * Need: + * intptr_t + */ +#ifdef ZSTD_DEPS_NEED_STDINT +#ifndef ZSTD_DEPS_STDINT +#define ZSTD_DEPS_STDINT + +#include <stdint.h> + +#endif /* ZSTD_DEPS_STDINT */ +#endif /* ZSTD_DEPS_NEED_STDINT */ + +#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1]) +#include "libbb.h" +#define RAWLOG(l, ...) { if (l <= ZSTD_DEBUGLEVEL) bb_printf(__VA_ARGS__); } +#define DEBUGLOG(l, ...) { if (l <= ZSTD_DEBUGLEVEL) bb_printf(__VA_ARGS__); } + +#if defined(__GNUC__) +# define MEM_STATIC static __inline __attribute__((unused)) +#elif (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) +# define MEM_STATIC static inline +#elif defined(_MSC_VER) +# define MEM_STATIC static __inline +#else +# define MEM_STATIC static /* this version may generate warnings for unused static functions; disable the relevant warning */ +#endif + diff --git a/src/bled/zstd_entropy_common.c b/src/bled/zstd_entropy_common.c new file mode 100644 index 00000000..5103f0f0 --- /dev/null +++ b/src/bled/zstd_entropy_common.c @@ -0,0 +1,362 @@ +/* ****************************************************************** + * Common functions of New Generation Entropy library + * Copyright (c) Yann Collet, Facebook, Inc. + * + * You can contact the author at : + * - FSE+HUF source repository : https://github.com/Cyan4973/FiniteStateEntropy + * - Public forum : https://groups.google.com/forum/#!forum/lz4c + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. +****************************************************************** */ + +/* ************************************* +* Dependencies +***************************************/ +#include "zstd_mem.h" +#include "zstd_error_private.h" /* ERR_*, ERROR */ +#define FSE_STATIC_LINKING_ONLY /* FSE_MIN_TABLELOG */ +#include "fse.h" +#define HUF_STATIC_LINKING_ONLY /* HUF_TABLELOG_ABSOLUTEMAX */ +#include "huf.h" + + +/*=== Version ===*/ +unsigned FSE_versionNumber(void) { return FSE_VERSION_NUMBER; } + + +/*=== Error Management ===*/ +#define FSE_isError ERR_isError +const char* FSE_getErrorName(size_t code) { return ERR_getErrorName(code); } + +#define HUF_isError ERR_isError +const char* HUF_getErrorName(size_t code) { return ERR_getErrorName(code); } + + +/*-************************************************************** +* FSE NCount encoding-decoding +****************************************************************/ +static U32 FSE_ctz(U32 val) +{ + assert(val != 0); + { +# if defined(_MSC_VER) /* Visual */ + unsigned long r=0; + return _BitScanForward(&r, val) ? (unsigned)r : 0; +# elif defined(__GNUC__) && (__GNUC__ >= 3) /* GCC Intrinsic */ + return __builtin_ctz(val); +# elif defined(__ICCARM__) /* IAR Intrinsic */ + return __CTZ(val); +# else /* Software version */ + U32 count = 0; + while ((val & 1) == 0) { + val >>= 1; + ++count; + } + return count; +# endif + } +} + +FORCE_INLINE_TEMPLATE +size_t FSE_readNCount_body(short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr, + const void* headerBuffer, size_t hbSize) +{ + const BYTE* const istart = (const BYTE*) headerBuffer; + const BYTE* const iend = istart + hbSize; + const BYTE* ip = istart; + int nbBits; + int remaining; + int threshold; + U32 bitStream; + int bitCount; + unsigned charnum = 0; + unsigned const maxSV1 = *maxSVPtr + 1; + int previous0 = 0; + + if (hbSize < 8) { + /* This function only works when hbSize >= 8 */ + char buffer[8] = {0}; + ZSTD_memcpy(buffer, headerBuffer, hbSize); + { size_t const countSize = FSE_readNCount(normalizedCounter, maxSVPtr, tableLogPtr, + buffer, sizeof(buffer)); + if (FSE_isError(countSize)) return countSize; + if (countSize > hbSize) return ERROR(corruption_detected); + return countSize; + } } + assert(hbSize >= 8); + + /* init */ + ZSTD_memset(normalizedCounter, 0, (*maxSVPtr+1) * sizeof(normalizedCounter[0])); /* all symbols not present in NCount have a frequency of 0 */ + bitStream = MEM_readLE32(ip); + nbBits = (bitStream & 0xF) + FSE_MIN_TABLELOG; /* extract tableLog */ + if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge); + bitStream >>= 4; + bitCount = 4; + *tableLogPtr = nbBits; + remaining = (1<<nbBits)+1; + threshold = 1<<nbBits; + nbBits++; + + for (;;) { + if (previous0) { + /* Count the number of repeats. Each time the + * 2-bit repeat code is 0b11 there is another + * repeat. + * Avoid UB by setting the high bit to 1. + */ + int repeats = FSE_ctz(~bitStream | 0x80000000) >> 1; + while (repeats >= 12) { + charnum += 3 * 12; + if (LIKELY(ip <= iend-7)) { + ip += 3; + } else { + bitCount -= (int)(8 * (iend - 7 - ip)); + bitCount &= 31; + ip = iend - 4; + } + bitStream = MEM_readLE32(ip) >> bitCount; + repeats = FSE_ctz(~bitStream | 0x80000000) >> 1; + } + charnum += 3 * repeats; + bitStream >>= 2 * repeats; + bitCount += 2 * repeats; + + /* Add the final repeat which isn't 0b11. */ + assert((bitStream & 3) < 3); + charnum += bitStream & 3; + bitCount += 2; + + /* This is an error, but break and return an error + * at the end, because returning out of a loop makes + * it harder for the compiler to optimize. + */ + if (charnum >= maxSV1) break; + + /* We don't need to set the normalized count to 0 + * because we already memset the whole buffer to 0. + */ + + if (LIKELY(ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) { + assert((bitCount >> 3) <= 3); /* For first condition to work */ + ip += bitCount>>3; + bitCount &= 7; + } else { + bitCount -= (int)(8 * (iend - 4 - ip)); + bitCount &= 31; + ip = iend - 4; + } + bitStream = MEM_readLE32(ip) >> bitCount; + } + { + int const max = (2*threshold-1) - remaining; + int count; + + if ((bitStream & (threshold-1)) < (U32)max) { + count = bitStream & (threshold-1); + bitCount += nbBits-1; + } else { + count = bitStream & (2*threshold-1); + if (count >= threshold) count -= max; + bitCount += nbBits; + } + + count--; /* extra accuracy */ + /* When it matters (small blocks), this is a + * predictable branch, because we don't use -1. + */ + if (count >= 0) { + remaining -= count; + } else { + assert(count == -1); + remaining += count; + } + normalizedCounter[charnum++] = (short)count; + previous0 = !count; + + assert(threshold > 1); + if (remaining < threshold) { + /* This branch can be folded into the + * threshold update condition because we + * know that threshold > 1. + */ + if (remaining <= 1) break; + nbBits = BIT_highbit32(remaining) + 1; + threshold = 1 << (nbBits - 1); + } + if (charnum >= maxSV1) break; + + if (LIKELY(ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) { + ip += bitCount>>3; + bitCount &= 7; + } else { + bitCount -= (int)(8 * (iend - 4 - ip)); + bitCount &= 31; + ip = iend - 4; + } + bitStream = MEM_readLE32(ip) >> bitCount; + } } + if (remaining != 1) return ERROR(corruption_detected); + /* Only possible when there are too many zeros. */ + if (charnum > maxSV1) return ERROR(maxSymbolValue_tooSmall); + if (bitCount > 32) return ERROR(corruption_detected); + *maxSVPtr = charnum-1; + + ip += (bitCount+7)>>3; + return ip-istart; +} + +/* Avoids the FORCE_INLINE of the _body() function. */ +static size_t FSE_readNCount_body_default( + short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr, + const void* headerBuffer, size_t hbSize) +{ + return FSE_readNCount_body(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize); +} + +#if DYNAMIC_BMI2 +TARGET_ATTRIBUTE("bmi2") static size_t FSE_readNCount_body_bmi2( + short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr, + const void* headerBuffer, size_t hbSize) +{ + return FSE_readNCount_body(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize); +} +#endif + +size_t FSE_readNCount_bmi2( + short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr, + const void* headerBuffer, size_t hbSize, int bmi2) +{ +#if DYNAMIC_BMI2 + if (bmi2) { + return FSE_readNCount_body_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize); + } +#endif + (void)bmi2; + return FSE_readNCount_body_default(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize); +} + +size_t FSE_readNCount( + short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr, + const void* headerBuffer, size_t hbSize) +{ + return FSE_readNCount_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize, /* bmi2 */ 0); +} + + +/*! HUF_readStats() : + Read compact Huffman tree, saved by HUF_writeCTable(). + `huffWeight` is destination buffer. + `rankStats` is assumed to be a table of at least HUF_TABLELOG_MAX U32. + @return : size read from `src` , or an error Code . + Note : Needed by HUF_readCTable() and HUF_readDTableX?() . +*/ +size_t HUF_readStats(BYTE* huffWeight, size_t hwSize, U32* rankStats, + U32* nbSymbolsPtr, U32* tableLogPtr, + const void* src, size_t srcSize) +{ + U32 wksp[HUF_READ_STATS_WORKSPACE_SIZE_U32]; + return HUF_readStats_wksp(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, wksp, sizeof(wksp), /* bmi2 */ 0); +} + +FORCE_INLINE_TEMPLATE size_t +HUF_readStats_body(BYTE* huffWeight, size_t hwSize, U32* rankStats, + U32* nbSymbolsPtr, U32* tableLogPtr, + const void* src, size_t srcSize, + void* workSpace, size_t wkspSize, + int bmi2) +{ + U32 weightTotal; + const BYTE* ip = (const BYTE*) src; + size_t iSize; + size_t oSize; + + if (!srcSize) return ERROR(srcSize_wrong); + iSize = ip[0]; + /* ZSTD_memset(huffWeight, 0, hwSize); *//* is not necessary, even though some analyzer complain ... */ + + if (iSize >= 128) { /* special header */ + oSize = iSize - 127; + iSize = ((oSize+1)/2); + if (iSize+1 > srcSize) return ERROR(srcSize_wrong); + if (oSize >= hwSize) return ERROR(corruption_detected); + ip += 1; + { U32 n; + for (n=0; n<oSize; n+=2) { + huffWeight[n] = ip[n/2] >> 4; + huffWeight[n+1] = ip[n/2] & 15; + } } } + else { /* header compressed with FSE (normal case) */ + if (iSize+1 > srcSize) return ERROR(srcSize_wrong); + /* max (hwSize-1) values decoded, as last one is implied */ + oSize = FSE_decompress_wksp_bmi2(huffWeight, hwSize-1, ip+1, iSize, 6, workSpace, wkspSize, bmi2); + if (FSE_isError(oSize)) return oSize; + } + + /* collect weight stats */ + ZSTD_memset(rankStats, 0, (HUF_TABLELOG_MAX + 1) * sizeof(U32)); + weightTotal = 0; + { U32 n; for (n=0; n<oSize; n++) { + if (huffWeight[n] > HUF_TABLELOG_MAX) return ERROR(corruption_detected); + rankStats[huffWeight[n]]++; + weightTotal += (1 << huffWeight[n]) >> 1; + } } + if (weightTotal == 0) return ERROR(corruption_detected); + + /* get last non-null symbol weight (implied, total must be 2^n) */ + { U32 const tableLog = BIT_highbit32(weightTotal) + 1; + if (tableLog > HUF_TABLELOG_MAX) return ERROR(corruption_detected); + *tableLogPtr = tableLog; + /* determine last weight */ + { U32 const total = 1 << tableLog; + U32 const rest = total - weightTotal; + U32 const verif = 1 << BIT_highbit32(rest); + U32 const lastWeight = BIT_highbit32(rest) + 1; + if (verif != rest) return ERROR(corruption_detected); /* last value must be a clean power of 2 */ + huffWeight[oSize] = (BYTE)lastWeight; + rankStats[lastWeight]++; + } } + + /* check tree construction validity */ + if ((rankStats[1] < 2) || (rankStats[1] & 1)) return ERROR(corruption_detected); /* by construction : at least 2 elts of rank 1, must be even */ + + /* results */ + *nbSymbolsPtr = (U32)(oSize+1); + return iSize+1; +} + +/* Avoids the FORCE_INLINE of the _body() function. */ +static size_t HUF_readStats_body_default(BYTE* huffWeight, size_t hwSize, U32* rankStats, + U32* nbSymbolsPtr, U32* tableLogPtr, + const void* src, size_t srcSize, + void* workSpace, size_t wkspSize) +{ + return HUF_readStats_body(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize, 0); +} + +#if DYNAMIC_BMI2 +static TARGET_ATTRIBUTE("bmi2") size_t HUF_readStats_body_bmi2(BYTE* huffWeight, size_t hwSize, U32* rankStats, + U32* nbSymbolsPtr, U32* tableLogPtr, + const void* src, size_t srcSize, + void* workSpace, size_t wkspSize) +{ + return HUF_readStats_body(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize, 1); +} +#endif + +size_t HUF_readStats_wksp(BYTE* huffWeight, size_t hwSize, U32* rankStats, + U32* nbSymbolsPtr, U32* tableLogPtr, + const void* src, size_t srcSize, + void* workSpace, size_t wkspSize, + int bmi2) +{ +#if DYNAMIC_BMI2 + if (bmi2) { + return HUF_readStats_body_bmi2(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize); + } +#endif + (void)bmi2; + return HUF_readStats_body_default(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize); +} diff --git a/src/bled/zstd_error_private.c b/src/bled/zstd_error_private.c new file mode 100644 index 00000000..531d1ee7 --- /dev/null +++ b/src/bled/zstd_error_private.c @@ -0,0 +1,56 @@ +/* + * Copyright (c) Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +/* The purpose of this file is to have a single list of error strings embedded in binary */ + +#include "zstd_error_private.h" + +const char* ERR_getErrorString(ERR_enum code) +{ +#ifdef ZSTD_STRIP_ERROR_STRINGS + (void)code; + return "Error strings stripped"; +#else + static const char* const notErrorCode = "Unspecified error code"; + switch( code ) + { + case PREFIX(no_error): return "No error detected"; + case PREFIX(GENERIC): return "Error (generic)"; + case PREFIX(prefix_unknown): return "Unknown frame descriptor"; + case PREFIX(version_unsupported): return "Version not supported"; + case PREFIX(frameParameter_unsupported): return "Unsupported frame parameter"; + case PREFIX(frameParameter_windowTooLarge): return "Frame requires too much memory for decoding"; + case PREFIX(corruption_detected): return "Corrupted block detected"; + case PREFIX(checksum_wrong): return "Restored data doesn't match checksum"; + case PREFIX(parameter_unsupported): return "Unsupported parameter"; + case PREFIX(parameter_outOfBound): return "Parameter is out of bound"; + case PREFIX(init_missing): return "Context should be init first"; + case PREFIX(memory_allocation): return "Allocation error : not enough memory"; + case PREFIX(workSpace_tooSmall): return "workSpace buffer is not large enough"; + case PREFIX(stage_wrong): return "Operation not authorized at current processing stage"; + case PREFIX(tableLog_tooLarge): return "tableLog requires too much memory : unsupported"; + case PREFIX(maxSymbolValue_tooLarge): return "Unsupported max Symbol Value : too large"; + case PREFIX(maxSymbolValue_tooSmall): return "Specified maxSymbolValue is too small"; + case PREFIX(dictionary_corrupted): return "Dictionary is corrupted"; + case PREFIX(dictionary_wrong): return "Dictionary mismatch"; + case PREFIX(dictionaryCreation_failed): return "Cannot create Dictionary from provided samples"; + case PREFIX(dstSize_tooSmall): return "Destination buffer is too small"; + case PREFIX(srcSize_wrong): return "Src size is incorrect"; + case PREFIX(dstBuffer_null): return "Operation on NULL destination buffer"; + /* following error codes are not stable and may be removed or changed in a future version */ + case PREFIX(frameIndex_tooLarge): return "Frame index is too large"; + case PREFIX(seekableIO): return "An I/O error occurred when reading/seeking"; + case PREFIX(dstBuffer_wrong): return "Destination buffer is wrong"; + case PREFIX(srcBuffer_wrong): return "Source buffer is wrong"; + case PREFIX(maxCode): + default: return notErrorCode; + } +#endif +} diff --git a/src/bled/zstd_error_private.h b/src/bled/zstd_error_private.h new file mode 100644 index 00000000..fa75e32a --- /dev/null +++ b/src/bled/zstd_error_private.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +/* Note : this module is expected to remain private, do not expose it */ + +#ifndef ERROR_H_MODULE +#define ERROR_H_MODULE + + + +/* **************************************** +* Dependencies +******************************************/ +#include "zstd_errors.h" /* enum list */ +#include "zstd_compiler.h" +#include "zstd_deps.h" /* size_t */ + + +/* **************************************** +* Compiler-specific +******************************************/ +#if defined(__GNUC__) +# define ERR_STATIC static __attribute__((unused)) +#elif (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) +# define ERR_STATIC static inline +#elif defined(_MSC_VER) +# define ERR_STATIC static __inline +#else +# define ERR_STATIC static /* this version may generate warnings for unused static functions; disable the relevant warning */ +#endif + + +/*-**************************************** +* Customization (error_public.h) +******************************************/ +typedef ZSTD_ErrorCode ERR_enum; +#define PREFIX(name) ZSTD_error_##name + + +/*-**************************************** +* Error codes handling +******************************************/ +#undef ERROR /* already defined on Visual Studio */ +#define ERROR(name) ZSTD_ERROR(name) +#define ZSTD_ERROR(name) ((size_t)-PREFIX(name)) + +ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); } + +ERR_STATIC ERR_enum ERR_getErrorCode(size_t code) { if (!ERR_isError(code)) return (ERR_enum)0; return (ERR_enum) (0-code); } + +/* check and forward error code */ +#define CHECK_V_F(e, f) size_t const e = f; if (ERR_isError(e)) return e +#define CHECK_F(f) { CHECK_V_F(_var_err__, f); } + + +/*-**************************************** +* Error Strings +******************************************/ + +const char* ERR_getErrorString(ERR_enum code); /* error_private.c */ + +ERR_STATIC const char* ERR_getErrorName(size_t code) +{ +#ifdef ZSTD_STRIP_ERROR_STRINGS + (void)code; + return "Error strings stripped"; +#else + return ERR_getErrorString(ERR_getErrorCode(code)); +#endif +} + +/** + * Ignore: this is an internal helper. + * + * This is a helper function to help force C99-correctness during compilation. + * Under strict compilation modes, variadic macro arguments can't be empty. + * However, variadic function arguments can be. Using a function therefore lets + * us statically check that at least one (string) argument was passed, + * independent of the compilation flags. + */ +static INLINE_KEYWORD UNUSED_ATTR +void _force_has_format_string(const char *format, ...) { + (void)format; +} + +/** + * Ignore: this is an internal helper. + * + * We want to force this function invocation to be syntactically correct, but + * we don't want to force runtime evaluation of its arguments. + */ +#define _FORCE_HAS_FORMAT_STRING(...) \ + if (0) { \ + _force_has_format_string(__VA_ARGS__); \ + } + +#define ERR_QUOTE(str) #str + +/** + * Return the specified error if the condition evaluates to true. + * + * In debug modes, prints additional information. + * In order to do that (particularly, printing the conditional that failed), + * this can't just wrap RETURN_ERROR(). + */ +#define RETURN_ERROR_IF(cond, err, ...) \ + if (cond) { \ + RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s", \ + __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \ + _FORCE_HAS_FORMAT_STRING(__VA_ARGS__); \ + RAWLOG(3, ": " __VA_ARGS__); \ + RAWLOG(3, "\n"); \ + return ERROR(err); \ + } + +/** + * Unconditionally return the specified error. + * + * In debug modes, prints additional information. + */ +#define RETURN_ERROR(err, ...) \ + do { \ + RAWLOG(3, "%s:%d: ERROR!: unconditional check failed, returning %s", \ + __FILE__, __LINE__, ERR_QUOTE(ERROR(err))); \ + _FORCE_HAS_FORMAT_STRING(__VA_ARGS__); \ + RAWLOG(3, ": " __VA_ARGS__); \ + RAWLOG(3, "\n"); \ + return ERROR(err); \ + } while(0); + +/** + * If the provided expression evaluates to an error code, returns that error code. + * + * In debug modes, prints additional information. + */ +#define FORWARD_IF_ERROR(err, ...) \ + do { \ + size_t const err_code = (err); \ + if (ERR_isError(err_code)) { \ + RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s", \ + __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \ + _FORCE_HAS_FORMAT_STRING(__VA_ARGS__); \ + RAWLOG(3, ": " __VA_ARGS__); \ + RAWLOG(3, "\n"); \ + return err_code; \ + } \ + } while(0); + + +#endif /* ERROR_H_MODULE */ diff --git a/src/bled/zstd_errors.h b/src/bled/zstd_errors.h new file mode 100644 index 00000000..576d46df --- /dev/null +++ b/src/bled/zstd_errors.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#ifndef ZSTD_ERRORS_H_398273423 +#define ZSTD_ERRORS_H_398273423 + + +/*===== dependency =====*/ +#include "zstd_deps.h" + + +/* ===== ZSTDERRORLIB_API : control library symbols visibility ===== */ +#define ZSTDERRORLIB_VISIBILITY MEM_STATIC +#define ZSTDERRORLIB_API ZSTDERRORLIB_VISIBILITY + +/*-********************************************* + * Error codes list + *-********************************************* + * Error codes _values_ are pinned down since v1.3.1 only. + * Therefore, don't rely on values if you may link to any version < v1.3.1. + * + * Only values < 100 are considered stable. + * + * note 1 : this API shall be used with static linking only. + * dynamic linking is not yet officially supported. + * note 2 : Prefer relying on the enum than on its value whenever possible + * This is the only supported way to use the error list < v1.3.1 + * note 3 : ZSTD_isError() is always correct, whatever the library version. + **********************************************/ +typedef enum { + ZSTD_error_no_error = 0, + ZSTD_error_GENERIC = 1, + ZSTD_error_prefix_unknown = 10, + ZSTD_error_version_unsupported = 12, + ZSTD_error_frameParameter_unsupported = 14, + ZSTD_error_frameParameter_windowTooLarge = 16, + ZSTD_error_corruption_detected = 20, + ZSTD_error_checksum_wrong = 22, + ZSTD_error_dictionary_corrupted = 30, + ZSTD_error_dictionary_wrong = 32, + ZSTD_error_dictionaryCreation_failed = 34, + ZSTD_error_parameter_unsupported = 40, + ZSTD_error_parameter_outOfBound = 42, + ZSTD_error_tableLog_tooLarge = 44, + ZSTD_error_maxSymbolValue_tooLarge = 46, + ZSTD_error_maxSymbolValue_tooSmall = 48, + ZSTD_error_stage_wrong = 60, + ZSTD_error_init_missing = 62, + ZSTD_error_memory_allocation = 64, + ZSTD_error_workSpace_tooSmall= 66, + ZSTD_error_dstSize_tooSmall = 70, + ZSTD_error_srcSize_wrong = 72, + ZSTD_error_dstBuffer_null = 74, + /* following error codes are __NOT STABLE__, they can be removed or changed in future versions */ + ZSTD_error_frameIndex_tooLarge = 100, + ZSTD_error_seekableIO = 102, + ZSTD_error_dstBuffer_wrong = 104, + ZSTD_error_srcBuffer_wrong = 105, + ZSTD_error_maxCode = 120 /* never EVER use this value directly, it can change in future versions! Use ZSTD_isError() instead */ +} ZSTD_ErrorCode; + +/*! ZSTD_getErrorCode() : + convert a `size_t` function result into a `ZSTD_ErrorCode` enum type, + which can be used to compare with enum list published above */ +ZSTDERRORLIB_API ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult); +ZSTDERRORLIB_API const char* ZSTD_getErrorString(ZSTD_ErrorCode code); /**< Same as ZSTD_getErrorName, but using a `ZSTD_ErrorCode` enum argument */ + + + +#endif /* ZSTD_ERRORS_H_398273423 */ diff --git a/src/bled/zstd_internal.h b/src/bled/zstd_internal.h new file mode 100644 index 00000000..549a259e --- /dev/null +++ b/src/bled/zstd_internal.h @@ -0,0 +1,449 @@ +/* + * Copyright (c) Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#ifndef ZSTD_CCOMMON_H_MODULE +#define ZSTD_CCOMMON_H_MODULE + +/* this module contains definitions which must be identical + * across compression, decompression and dictBuilder. + * It also contains a few functions useful to at least 2 of them + * and which benefit from being inlined */ + +/*-************************************* +* Dependencies +***************************************/ +#include "zstd_compiler.h" +#include "zstd_mem.h" +#include "zstd_error_private.h" +#define ZSTD_STATIC_LINKING_ONLY +#include "zstd.h" +#define FSE_STATIC_LINKING_ONLY +#include "fse.h" +#define HUF_STATIC_LINKING_ONLY +#include "huf.h" +#include "xxhash.h" /* XXH_reset, update, digest */ +#define ZSTD_TRACE 0 + + +/* ---- static assert (debug) --- */ +#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c) +#define ZSTD_isError ERR_isError /* for inlining */ +#define FSE_isError ERR_isError +#define HUF_isError ERR_isError + + +/*-************************************* +* shared macros +***************************************/ +#undef MIN +#undef MAX +#define MIN(a,b) ((a)<(b) ? (a) : (b)) +#define MAX(a,b) ((a)>(b) ? (a) : (b)) + + +/*-************************************* +* Common constants +***************************************/ +#define ZSTD_OPT_NUM (1<<12) + +#define ZSTD_REP_NUM 3 /* number of repcodes */ +#define ZSTD_REP_MOVE (ZSTD_REP_NUM-1) +static UNUSED_ATTR const U32 repStartValue[ZSTD_REP_NUM] = { 1, 4, 8 }; + +#define KB *(1 <<10) +#define MB *(1 <<20) +#define GB *(1U<<30) + +#define BIT7 128 +#define BIT6 64 +#define BIT5 32 +#define BIT4 16 +#define BIT1 2 +#define BIT0 1 + +#define ZSTD_WINDOWLOG_ABSOLUTEMIN 10 +static UNUSED_ATTR const size_t ZSTD_fcs_fieldSize[4] = { 0, 2, 4, 8 }; +static UNUSED_ATTR const size_t ZSTD_did_fieldSize[4] = { 0, 1, 2, 4 }; + +#define ZSTD_FRAMEIDSIZE 4 /* magic number size */ + +#define ZSTD_BLOCKHEADERSIZE 3 /* C standard doesn't allow `static const` variable to be init using another `static const` variable */ +static UNUSED_ATTR const size_t ZSTD_blockHeaderSize = ZSTD_BLOCKHEADERSIZE; +typedef enum { bt_raw, bt_rle, bt_compressed, bt_reserved } blockType_e; + +#define ZSTD_FRAMECHECKSUMSIZE 4 + +#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */ +#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */ + MIN_SEQUENCES_SIZE /* nbSeq==0 */) /* for a non-null block */ + +#define HufLog 12 +typedef enum { set_basic, set_rle, set_compressed, set_repeat } symbolEncodingType_e; + +#define LONGNBSEQ 0x7F00 + +#define MINMATCH 3 + +#define Litbits 8 +#define MaxLit ((1<<Litbits) - 1) +#define MaxML 52 +#define MaxLL 35 +#define DefaultMaxOff 28 +#define MaxOff 31 +#define MaxSeq MAX(MaxLL, MaxML) /* Assumption : MaxOff < MaxLL,MaxML */ +#define MLFSELog 9 +#define LLFSELog 9 +#define OffFSELog 8 +#define MaxFSELog MAX(MAX(MLFSELog, LLFSELog), OffFSELog) + +#define ZSTD_MAX_HUF_HEADER_SIZE 128 /* header + <= 127 byte tree description */ +/* Each table cannot take more than #symbols * FSELog bits */ +#define ZSTD_MAX_FSE_HEADERS_SIZE (((MaxML + 1) * MLFSELog + (MaxLL + 1) * LLFSELog + (MaxOff + 1) * OffFSELog + 7) / 8) + +static UNUSED_ATTR const U32 LL_bits[MaxLL+1] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 2, 2, 3, 3, + 4, 6, 7, 8, 9,10,11,12, + 13,14,15,16 +}; +static UNUSED_ATTR const S16 LL_defaultNorm[MaxLL+1] = { + 4, 3, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 3, 2, 1, 1, 1, 1, 1, + -1,-1,-1,-1 +}; +#define LL_DEFAULTNORMLOG 6 /* for static allocation */ +static UNUSED_ATTR const U32 LL_defaultNormLog = LL_DEFAULTNORMLOG; + +static UNUSED_ATTR const U32 ML_bits[MaxML+1] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 2, 2, 3, 3, + 4, 4, 5, 7, 8, 9,10,11, + 12,13,14,15,16 +}; +static UNUSED_ATTR const S16 ML_defaultNorm[MaxML+1] = { + 1, 4, 3, 2, 2, 2, 2, 2, + 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1,-1,-1, + -1,-1,-1,-1,-1 +}; +#define ML_DEFAULTNORMLOG 6 /* for static allocation */ +static UNUSED_ATTR const U32 ML_defaultNormLog = ML_DEFAULTNORMLOG; + +static UNUSED_ATTR const S16 OF_defaultNorm[DefaultMaxOff+1] = { + 1, 1, 1, 1, 1, 1, 2, 2, + 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + -1,-1,-1,-1,-1 +}; +#define OF_DEFAULTNORMLOG 5 /* for static allocation */ +static UNUSED_ATTR const U32 OF_defaultNormLog = OF_DEFAULTNORMLOG; + + +/*-******************************************* +* Shared functions to include for inlining +*********************************************/ +static void ZSTD_copy8(void* dst, const void* src) { +#if defined(ZSTD_ARCH_ARM_NEON) + vst1_u8((uint8_t*)dst, vld1_u8((const uint8_t*)src)); +#else + ZSTD_memcpy(dst, src, 8); +#endif +} + +#define COPY8(d,s) { ZSTD_copy8(d,s); d+=8; s+=8; } +static void ZSTD_copy16(void* dst, const void* src) { +#if defined(ZSTD_ARCH_ARM_NEON) + vst1q_u8((uint8_t*)dst, vld1q_u8((const uint8_t*)src)); +#else + ZSTD_memcpy(dst, src, 16); +#endif +} +#define COPY16(d,s) { ZSTD_copy16(d,s); d+=16; s+=16; } + +#define WILDCOPY_OVERLENGTH 32 +#define WILDCOPY_VECLEN 16 + +typedef enum { + ZSTD_no_overlap, + ZSTD_overlap_src_before_dst + /* ZSTD_overlap_dst_before_src, */ +} ZSTD_overlap_e; + +/*! ZSTD_wildcopy() : + * Custom version of ZSTD_memcpy(), can over read/write up to WILDCOPY_OVERLENGTH bytes (if length==0) + * @param ovtype controls the overlap detection + * - ZSTD_no_overlap: The source and destination are guaranteed to be at least WILDCOPY_VECLEN bytes apart. + * - ZSTD_overlap_src_before_dst: The src and dst may overlap, but they MUST be at least 8 bytes apart. + * The src buffer must be before the dst buffer. + */ +MEM_STATIC FORCE_INLINE_ATTR +void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e const ovtype) +{ + ptrdiff_t diff = (BYTE*)dst - (const BYTE*)src; + const BYTE* ip = (const BYTE*)src; + BYTE* op = (BYTE*)dst; + BYTE* const oend = op + length; + + assert(diff >= 8 || (ovtype == ZSTD_no_overlap && diff <= -WILDCOPY_VECLEN)); + + if (ovtype == ZSTD_overlap_src_before_dst && diff < WILDCOPY_VECLEN) { + /* Handle short offset copies. */ + do { + COPY8(op, ip) + } while (op < oend); + } else { + assert(diff >= WILDCOPY_VECLEN || diff <= -WILDCOPY_VECLEN); + /* Separate out the first COPY16() call because the copy length is + * almost certain to be short, so the branches have different + * probabilities. Since it is almost certain to be short, only do + * one COPY16() in the first call. Then, do two calls per loop since + * at that point it is more likely to have a high trip count. + */ +#ifdef __aarch64__ + do { + COPY16(op, ip); + } + while (op < oend); +#else + ZSTD_copy16(op, ip); + if (16 >= length) return; + op += 16; + ip += 16; + do { + COPY16(op, ip); + COPY16(op, ip); + } + while (op < oend); +#endif + } +} + +MEM_STATIC size_t ZSTD_limitCopy(void* dst, size_t dstCapacity, const void* src, size_t srcSize) +{ + size_t const length = MIN(dstCapacity, srcSize); + if (length > 0) { + ZSTD_memcpy(dst, src, length); + } + return length; +} + +/* define "workspace is too large" as this number of times larger than needed */ +#define ZSTD_WORKSPACETOOLARGE_FACTOR 3 + +/* when workspace is continuously too large + * during at least this number of times, + * context's memory usage is considered wasteful, + * because it's sized to handle a worst case scenario which rarely happens. + * In which case, resize it down to free some memory */ +#define ZSTD_WORKSPACETOOLARGE_MAXDURATION 128 + +/* Controls whether the input/output buffer is buffered or stable. */ +typedef enum { + ZSTD_bm_buffered = 0, /* Buffer the input/output */ + ZSTD_bm_stable = 1 /* ZSTD_inBuffer/ZSTD_outBuffer is stable */ +} ZSTD_bufferMode_e; + + +/*-******************************************* +* Private declarations +*********************************************/ +typedef struct seqDef_s { + U32 offset; /* offset == rawOffset + ZSTD_REP_NUM, or equivalently, offCode + 1 */ + U16 litLength; + U16 matchLength; +} seqDef; + +/* Controls whether seqStore has a single "long" litLength or matchLength. See seqStore_t. */ +typedef enum { + ZSTD_llt_none = 0, /* no longLengthType */ + ZSTD_llt_literalLength = 1, /* represents a long literal */ + ZSTD_llt_matchLength = 2 /* represents a long match */ +} ZSTD_longLengthType_e; + +typedef struct { + seqDef* sequencesStart; + seqDef* sequences; /* ptr to end of sequences */ + BYTE* litStart; + BYTE* lit; /* ptr to end of literals */ + BYTE* llCode; + BYTE* mlCode; + BYTE* ofCode; + size_t maxNbSeq; + size_t maxNbLit; + + /* longLengthPos and longLengthType to allow us to represent either a single litLength or matchLength + * in the seqStore that has a value larger than U16 (if it exists). To do so, we increment + * the existing value of the litLength or matchLength by 0x10000. + */ + ZSTD_longLengthType_e longLengthType; + U32 longLengthPos; /* Index of the sequence to apply long length modification to */ +} seqStore_t; + +typedef struct { + U32 litLength; + U32 matchLength; +} ZSTD_sequenceLength; + +/** + * Returns the ZSTD_sequenceLength for the given sequences. It handles the decoding of long sequences + * indicated by longLengthPos and longLengthType, and adds MINMATCH back to matchLength. + */ +MEM_STATIC ZSTD_sequenceLength ZSTD_getSequenceLength(seqStore_t const* seqStore, seqDef const* seq) +{ + ZSTD_sequenceLength seqLen; + seqLen.litLength = seq->litLength; + seqLen.matchLength = seq->matchLength + MINMATCH; + if (seqStore->longLengthPos == (U32)(seq - seqStore->sequencesStart)) { + if (seqStore->longLengthType == ZSTD_llt_literalLength) { + seqLen.litLength += 0xFFFF; + } + if (seqStore->longLengthType == ZSTD_llt_matchLength) { + seqLen.matchLength += 0xFFFF; + } + } + return seqLen; +} + +/** + * Contains the compressed frame size and an upper-bound for the decompressed frame size. + * Note: before using `compressedSize`, check for errors using ZSTD_isError(). + * similarly, before using `decompressedBound`, check for errors using: + * `decompressedBound != ZSTD_CONTENTSIZE_ERROR` + */ +typedef struct { + size_t compressedSize; + unsigned long long decompressedBound; +} ZSTD_frameSizeInfo; /* decompress & legacy */ + +const seqStore_t* ZSTD_getSeqStore(const ZSTD_CCtx* ctx); /* compress & dictBuilder */ +void ZSTD_seqToCodes(const seqStore_t* seqStorePtr); /* compress, dictBuilder, decodeCorpus (shouldn't get its definition from here) */ + +MEM_STATIC U32 ZSTD_highbit32(U32 val) /* compress, dictBuilder, decodeCorpus */ +{ + assert(val != 0); + { +# if defined(_MSC_VER) /* Visual */ +# if STATIC_BMI2 == 1 + return _lzcnt_u32(val)^31; +# else + unsigned long r=0; + return _BitScanReverse(&r, val) ? (unsigned)r : 0; +# endif +# elif defined(__GNUC__) && (__GNUC__ >= 3) /* GCC Intrinsic */ + return __builtin_clz (val) ^ 31; +# elif defined(__ICCARM__) /* IAR Intrinsic */ + return 31 - __CLZ(val); +# else /* Software version */ + static const U32 DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 }; + U32 v = val; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + return DeBruijnClz[(v * 0x07C4ACDDU) >> 27]; +# endif + } +} + +/** + * Computes CTZ on a U64. + * This will be slow on 32-bit mode, and on unsupported compilers. + * If you need this function to be fast (because it is hot) expand + * support. + */ +MEM_STATIC unsigned ZSTD_countTrailingZeros(size_t val) +{ + if (MEM_64bits()) { +# if defined(_MSC_VER) && defined(_WIN64) +# if STATIC_BMI2 + return _tzcnt_u64(val); +# else + unsigned long r = 0; + return _BitScanForward64( &r, (U64)val ) ? (unsigned)(r >> 3) : 0; +# endif +# elif defined(__GNUC__) && (__GNUC__ >= 4) + return __builtin_ctzll((U64)val); +# else + static const int DeBruijnBytePos[64] = { 0, 1, 2, 7, 3, 13, 8, 19, + 4, 25, 14, 28, 9, 34, 20, 56, + 5, 17, 26, 54, 15, 41, 29, 43, + 10, 31, 38, 35, 21, 45, 49, 57, + 63, 6, 12, 18, 24, 27, 33, 55, + 16, 53, 40, 42, 30, 37, 44, 48, + 62, 11, 23, 32, 52, 39, 36, 47, + 61, 22, 51, 46, 60, 50, 59, 58 }; + return DeBruijnBytePos[((U64)((val & -(long long)val) * 0x0218A392CDABBD3FULL)) >> 58]; +# endif + } else { /* 32 bits */ +# if defined(_MSC_VER) + unsigned long r=0; + return _BitScanForward( &r, (U32)val ) ? (unsigned)(r >> 3) : 0; +# elif defined(__GNUC__) && (__GNUC__ >= 3) + return (__builtin_ctz((U32)val) >> 3); +# else + static const int DeBruijnBytePos[32] = { 0, 1, 28, 2, 29, 14, 24, 3, + 30, 22, 20, 15, 25, 17, 4, 8, + 31, 27, 13, 23, 21, 19, 16, 7, + 26, 12, 18, 6, 11, 5, 10, 9 }; + return DeBruijnBytePos[((U32)((val & -(S32)val) * 0x077CB531U)) >> 27]; +# endif + } +} + + +/* ZSTD_invalidateRepCodes() : + * ensures next compression will not use repcodes from previous block. + * Note : only works with regular variant; + * do not use with extDict variant ! */ +void ZSTD_invalidateRepCodes(ZSTD_CCtx* cctx); /* zstdmt, adaptive_compression (shouldn't get this definition from here) */ + + +typedef struct { + blockType_e blockType; + U32 lastBlock; + U32 origSize; +} blockProperties_t; /* declared here for decompress and fullbench */ + +/*! ZSTD_getcBlockSize() : + * Provides the size of compressed block from block header `src` */ +/* Used by: decompress, fullbench (does not get its definition from here) */ +size_t ZSTD_getcBlockSize(const void* src, size_t srcSize, + blockProperties_t* bpPtr); + +/*! ZSTD_decodeSeqHeaders() : + * decode sequence header from src */ +/* Used by: decompress, fullbench (does not get its definition from here) */ +size_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr, + const void* src, size_t srcSize); + +/* + * Custom memory allocation functions + */ +typedef struct { void* customAlloc; void* customFree; void* opaque; } ZSTD_customMem; +extern ZSTD_customMem ZSTD_defaultCMem; +static inline void* ZSTD_customMalloc(size_t size, ZSTD_customMem customMem) { + (void)customMem; + return malloc(size); +} +static inline void ZSTD_customFree(void* ptr, ZSTD_customMem customMem) { + (void)customMem; + free(ptr); +} + +#endif /* ZSTD_CCOMMON_H_MODULE */ diff --git a/src/bled/zstd_mem.h b/src/bled/zstd_mem.h new file mode 100644 index 00000000..b5d15f1a --- /dev/null +++ b/src/bled/zstd_mem.h @@ -0,0 +1,423 @@ +/* + * Copyright (c) Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#ifndef MEM_H_MODULE +#define MEM_H_MODULE + + +/*-**************************************** +* Dependencies +******************************************/ +#include <stddef.h> /* size_t, ptrdiff_t */ +#include "zstd_compiler.h" /* __has_builtin */ +//#include "debug.h" /* DEBUG_STATIC_ASSERT */ +#include "zstd_deps.h" /* ZSTD_memcpy */ + + +/*-**************************************** +* Compiler specifics +******************************************/ +#if defined(_MSC_VER) /* Visual Studio */ +# include <stdlib.h> /* _byteswap_ulong */ +# include <intrin.h> /* _byteswap_* */ +#endif + +/*-************************************************************** +* Basic Types +*****************************************************************/ +#if !defined (__VMS) && (defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) ) +# if defined(_AIX) +# include <inttypes.h> +# else +# include <stdint.h> /* intptr_t */ +# endif + typedef uint8_t BYTE; + typedef uint16_t U16; + typedef int16_t S16; + typedef uint32_t U32; + typedef int32_t S32; + typedef uint64_t U64; + typedef int64_t S64; +#else +# include <limits.h> +#if CHAR_BIT != 8 +# error "this implementation requires char to be exactly 8-bit type" +#endif + typedef unsigned char BYTE; +#if USHRT_MAX != 65535 +# error "this implementation requires short to be exactly 16-bit type" +#endif + typedef unsigned short U16; + typedef signed short S16; +#if UINT_MAX != 4294967295 +# error "this implementation requires int to be exactly 32-bit type" +#endif + typedef unsigned int U32; + typedef signed int S32; +/* note : there are no limits defined for long long type in C90. + * limits exist in C99, however, in such case, <stdint.h> is preferred */ + typedef unsigned long long U64; + typedef signed long long S64; +#endif + + +/*-************************************************************** +* Memory I/O API +*****************************************************************/ +/*=== Static platform detection ===*/ +MEM_STATIC unsigned MEM_32bits(void); +MEM_STATIC unsigned MEM_64bits(void); +MEM_STATIC unsigned MEM_isLittleEndian(void); + +/*=== Native unaligned read/write ===*/ +MEM_STATIC U16 MEM_read16(const void* memPtr); +MEM_STATIC U32 MEM_read32(const void* memPtr); +MEM_STATIC U64 MEM_read64(const void* memPtr); +MEM_STATIC size_t MEM_readST(const void* memPtr); + +MEM_STATIC void MEM_write16(void* memPtr, U16 value); +MEM_STATIC void MEM_write32(void* memPtr, U32 value); +MEM_STATIC void MEM_write64(void* memPtr, U64 value); + +/*=== Little endian unaligned read/write ===*/ +MEM_STATIC U16 MEM_readLE16(const void* memPtr); +MEM_STATIC U32 MEM_readLE24(const void* memPtr); +MEM_STATIC U32 MEM_readLE32(const void* memPtr); +MEM_STATIC U64 MEM_readLE64(const void* memPtr); +MEM_STATIC size_t MEM_readLEST(const void* memPtr); + +MEM_STATIC void MEM_writeLE16(void* memPtr, U16 val); +MEM_STATIC void MEM_writeLE24(void* memPtr, U32 val); +MEM_STATIC void MEM_writeLE32(void* memPtr, U32 val32); +MEM_STATIC void MEM_writeLE64(void* memPtr, U64 val64); +MEM_STATIC void MEM_writeLEST(void* memPtr, size_t val); + +/*=== Big endian unaligned read/write ===*/ +MEM_STATIC U32 MEM_readBE32(const void* memPtr); +MEM_STATIC U64 MEM_readBE64(const void* memPtr); +MEM_STATIC size_t MEM_readBEST(const void* memPtr); + +MEM_STATIC void MEM_writeBE32(void* memPtr, U32 val32); +MEM_STATIC void MEM_writeBE64(void* memPtr, U64 val64); +MEM_STATIC void MEM_writeBEST(void* memPtr, size_t val); + +/*=== Byteswap ===*/ +MEM_STATIC U32 MEM_swap32(U32 in); +MEM_STATIC U64 MEM_swap64(U64 in); +MEM_STATIC size_t MEM_swapST(size_t in); + + +/*-************************************************************** +* Memory I/O Implementation +*****************************************************************/ +/* MEM_FORCE_MEMORY_ACCESS : + * By default, access to unaligned memory is controlled by `memcpy()`, which is safe and portable. + * Unfortunately, on some target/compiler combinations, the generated assembly is sub-optimal. + * The below switch allow to select different access method for improved performance. + * Method 0 (default) : use `memcpy()`. Safe and portable. + * Method 1 : `__packed` statement. It depends on compiler extension (i.e., not portable). + * This method is safe if your compiler supports it, and *generally* as fast or faster than `memcpy`. + * Method 2 : direct access. This method is portable but violate C standard. + * It can generate buggy code on targets depending on alignment. + * In some circumstances, it's the only known way to get the most performance (i.e. GCC + ARMv6) + * See http://fastcompression.blogspot.fr/2015/08/accessing-unaligned-memory.html for details. + * Prefer these methods in priority order (0 > 1 > 2) + */ +#ifndef MEM_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */ +# if defined(__INTEL_COMPILER) || defined(__GNUC__) || defined(__ICCARM__) +# define MEM_FORCE_MEMORY_ACCESS 1 +# endif +#endif + +MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; } +MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; } + +MEM_STATIC unsigned MEM_isLittleEndian(void) +{ +#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) + return 1; +#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) + return 0; +#elif defined(__clang__) && __LITTLE_ENDIAN__ + return 1; +#elif defined(__clang__) && __BIG_ENDIAN__ + return 0; +#elif defined(_MSC_VER) && (_M_AMD64 || _M_IX86) + return 1; +#elif defined(__DMC__) && defined(_M_IX86) + return 1; +#else + const union { U32 u; BYTE c[4]; } one = { 1 }; /* don't use static : performance detrimental */ + return one.c[0]; +#endif +} + +#if defined(MEM_FORCE_MEMORY_ACCESS) && (MEM_FORCE_MEMORY_ACCESS==2) + +/* violates C standard, by lying on structure alignment. +Only use if no other choice to achieve best performance on target platform */ +MEM_STATIC U16 MEM_read16(const void* memPtr) { return *(const U16*) memPtr; } +MEM_STATIC U32 MEM_read32(const void* memPtr) { return *(const U32*) memPtr; } +MEM_STATIC U64 MEM_read64(const void* memPtr) { return *(const U64*) memPtr; } +MEM_STATIC size_t MEM_readST(const void* memPtr) { return *(const size_t*) memPtr; } + +MEM_STATIC void MEM_write16(void* memPtr, U16 value) { *(U16*)memPtr = value; } +MEM_STATIC void MEM_write32(void* memPtr, U32 value) { *(U32*)memPtr = value; } +MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(U64*)memPtr = value; } + +#elif defined(MEM_FORCE_MEMORY_ACCESS) && (MEM_FORCE_MEMORY_ACCESS==1) + +/* __pack instructions are safer, but compiler specific, hence potentially problematic for some compilers */ +/* currently only defined for gcc and icc */ +#if defined(_MSC_VER) || (defined(__INTEL_COMPILER) && defined(WIN32)) + __pragma( pack(push, 1) ) + typedef struct { U16 v; } unalign16; + typedef struct { U32 v; } unalign32; + typedef struct { U64 v; } unalign64; + typedef struct { size_t v; } unalignArch; + __pragma( pack(pop) ) +#else + typedef struct { U16 v; } __attribute__((packed)) unalign16; + typedef struct { U32 v; } __attribute__((packed)) unalign32; + typedef struct { U64 v; } __attribute__((packed)) unalign64; + typedef struct { size_t v; } __attribute__((packed)) unalignArch; +#endif + +MEM_STATIC U16 MEM_read16(const void* ptr) { return ((const unalign16*)ptr)->v; } +MEM_STATIC U32 MEM_read32(const void* ptr) { return ((const unalign32*)ptr)->v; } +MEM_STATIC U64 MEM_read64(const void* ptr) { return ((const unalign64*)ptr)->v; } +MEM_STATIC size_t MEM_readST(const void* ptr) { return ((const unalignArch*)ptr)->v; } + +MEM_STATIC void MEM_write16(void* memPtr, U16 value) { ((unalign16*)memPtr)->v = value; } +MEM_STATIC void MEM_write32(void* memPtr, U32 value) { ((unalign32*)memPtr)->v = value; } +MEM_STATIC void MEM_write64(void* memPtr, U64 value) { ((unalign64*)memPtr)->v = value; } + +#else + +/* default method, safe and standard. + can sometimes prove slower */ + +MEM_STATIC U16 MEM_read16(const void* memPtr) +{ + U16 val; ZSTD_memcpy(&val, memPtr, sizeof(val)); return val; +} + +MEM_STATIC U32 MEM_read32(const void* memPtr) +{ + U32 val; ZSTD_memcpy(&val, memPtr, sizeof(val)); return val; +} + +MEM_STATIC U64 MEM_read64(const void* memPtr) +{ + U64 val; ZSTD_memcpy(&val, memPtr, sizeof(val)); return val; +} + +MEM_STATIC size_t MEM_readST(const void* memPtr) +{ + size_t val; ZSTD_memcpy(&val, memPtr, sizeof(val)); return val; +} + +MEM_STATIC void MEM_write16(void* memPtr, U16 value) +{ + ZSTD_memcpy(memPtr, &value, sizeof(value)); +} + +MEM_STATIC void MEM_write32(void* memPtr, U32 value) +{ + ZSTD_memcpy(memPtr, &value, sizeof(value)); +} + +MEM_STATIC void MEM_write64(void* memPtr, U64 value) +{ + ZSTD_memcpy(memPtr, &value, sizeof(value)); +} + +#endif /* MEM_FORCE_MEMORY_ACCESS */ + +MEM_STATIC U32 MEM_swap32(U32 in) +{ +#if defined(_MSC_VER) /* Visual Studio */ + return _byteswap_ulong(in); +#elif (defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)) \ + || (defined(__clang__) && __has_builtin(__builtin_bswap32)) + return __builtin_bswap32(in); +#else + return ((in << 24) & 0xff000000 ) | + ((in << 8) & 0x00ff0000 ) | + ((in >> 8) & 0x0000ff00 ) | + ((in >> 24) & 0x000000ff ); +#endif +} + +MEM_STATIC U64 MEM_swap64(U64 in) +{ +#if defined(_MSC_VER) /* Visual Studio */ + return _byteswap_uint64(in); +#elif (defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)) \ + || (defined(__clang__) && __has_builtin(__builtin_bswap64)) + return __builtin_bswap64(in); +#else + return ((in << 56) & 0xff00000000000000ULL) | + ((in << 40) & 0x00ff000000000000ULL) | + ((in << 24) & 0x0000ff0000000000ULL) | + ((in << 8) & 0x000000ff00000000ULL) | + ((in >> 8) & 0x00000000ff000000ULL) | + ((in >> 24) & 0x0000000000ff0000ULL) | + ((in >> 40) & 0x000000000000ff00ULL) | + ((in >> 56) & 0x00000000000000ffULL); +#endif +} + +MEM_STATIC size_t MEM_swapST(size_t in) +{ + if (MEM_32bits()) + return (size_t)MEM_swap32((U32)in); + else + return (size_t)MEM_swap64((U64)in); +} + +/*=== Little endian r/w ===*/ + +MEM_STATIC U16 MEM_readLE16(const void* memPtr) +{ + if (MEM_isLittleEndian()) + return MEM_read16(memPtr); + else { + const BYTE* p = (const BYTE*)memPtr; + return (U16)(p[0] + (p[1]<<8)); + } +} + +MEM_STATIC void MEM_writeLE16(void* memPtr, U16 val) +{ + if (MEM_isLittleEndian()) { + MEM_write16(memPtr, val); + } else { + BYTE* p = (BYTE*)memPtr; + p[0] = (BYTE)val; + p[1] = (BYTE)(val>>8); + } +} + +MEM_STATIC U32 MEM_readLE24(const void* memPtr) +{ + return (U32)MEM_readLE16(memPtr) + ((U32)(((const BYTE*)memPtr)[2]) << 16); +} + +MEM_STATIC void MEM_writeLE24(void* memPtr, U32 val) +{ + MEM_writeLE16(memPtr, (U16)val); + ((BYTE*)memPtr)[2] = (BYTE)(val>>16); +} + +MEM_STATIC U32 MEM_readLE32(const void* memPtr) +{ + if (MEM_isLittleEndian()) + return MEM_read32(memPtr); + else + return MEM_swap32(MEM_read32(memPtr)); +} + +MEM_STATIC void MEM_writeLE32(void* memPtr, U32 val32) +{ + if (MEM_isLittleEndian()) + MEM_write32(memPtr, val32); + else + MEM_write32(memPtr, MEM_swap32(val32)); +} + +MEM_STATIC U64 MEM_readLE64(const void* memPtr) +{ + if (MEM_isLittleEndian()) + return MEM_read64(memPtr); + else + return MEM_swap64(MEM_read64(memPtr)); +} + +MEM_STATIC void MEM_writeLE64(void* memPtr, U64 val64) +{ + if (MEM_isLittleEndian()) + MEM_write64(memPtr, val64); + else + MEM_write64(memPtr, MEM_swap64(val64)); +} + +MEM_STATIC size_t MEM_readLEST(const void* memPtr) +{ + if (MEM_32bits()) + return (size_t)MEM_readLE32(memPtr); + else + return (size_t)MEM_readLE64(memPtr); +} + +MEM_STATIC void MEM_writeLEST(void* memPtr, size_t val) +{ + if (MEM_32bits()) + MEM_writeLE32(memPtr, (U32)val); + else + MEM_writeLE64(memPtr, (U64)val); +} + +/*=== Big endian r/w ===*/ + +MEM_STATIC U32 MEM_readBE32(const void* memPtr) +{ + if (MEM_isLittleEndian()) + return MEM_swap32(MEM_read32(memPtr)); + else + return MEM_read32(memPtr); +} + +MEM_STATIC void MEM_writeBE32(void* memPtr, U32 val32) +{ + if (MEM_isLittleEndian()) + MEM_write32(memPtr, MEM_swap32(val32)); + else + MEM_write32(memPtr, val32); +} + +MEM_STATIC U64 MEM_readBE64(const void* memPtr) +{ + if (MEM_isLittleEndian()) + return MEM_swap64(MEM_read64(memPtr)); + else + return MEM_read64(memPtr); +} + +MEM_STATIC void MEM_writeBE64(void* memPtr, U64 val64) +{ + if (MEM_isLittleEndian()) + MEM_write64(memPtr, MEM_swap64(val64)); + else + MEM_write64(memPtr, val64); +} + +MEM_STATIC size_t MEM_readBEST(const void* memPtr) +{ + if (MEM_32bits()) + return (size_t)MEM_readBE32(memPtr); + else + return (size_t)MEM_readBE64(memPtr); +} + +MEM_STATIC void MEM_writeBEST(void* memPtr, size_t val) +{ + if (MEM_32bits()) + MEM_writeBE32(memPtr, (U32)val); + else + MEM_writeBE64(memPtr, (U64)val); +} + +/* code only tested on 32 and 64 bits systems */ +MEM_STATIC void MEM_check(void) { DEBUG_STATIC_ASSERT((sizeof(size_t)==4) || (sizeof(size_t)==8)); } + + + +#endif /* MEM_H_MODULE */ diff --git a/src/rufus.c b/src/rufus.c index b343c0c9..fa06a813 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -2538,7 +2538,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA img_provided = FALSE; // One off thing... } else { char* old_image_path = image_path; - char extensions[128] = "*.iso;*.img;*.vhd;*.vhdx;*.usb;*.bz2;*.bzip2;*.gz;*.lzma;*.xz;*.Z;*.zip;*.wic;*.wim;*.esd;*.vtsi"; + char extensions[128] = "*.iso;*.img;*.vhd;*.vhdx;*.usb;*.bz2;*.bzip2;*.gz;*.lzma;*.xz;*.Z;*.zip;*.zst;*.wic;*.wim;*.esd;*.vtsi"; if (has_ffu_support) strcat(extensions, ";*.ffu"); // If declared globaly, lmprintf(MSG_280) would be called on each message... diff --git a/src/rufus.rc b/src/rufus.rc index a391c4f5..59fd437a 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.7.2210" +CAPTION "Rufus 4.7.2211" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2210,0 - PRODUCTVERSION 4,7,2210,0 + FILEVERSION 4,7,2211,0 + PRODUCTVERSION 4,7,2211,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2210" + VALUE "FileVersion", "4.7.2211" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2210" + VALUE "ProductVersion", "4.7.2211" END END BLOCK "VarFileInfo" diff --git a/src/vhd.c b/src/vhd.c index a184b2f6..eef595bc 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -104,6 +104,7 @@ static comp_assoc file_assoc[] = { { ".bz2", BLED_COMPRESSION_BZIP2 }, { ".xz", BLED_COMPRESSION_XZ }, { ".vtsi", BLED_COMPRESSION_VTSI }, + { ".zst", BLED_COMPRESSION_ZSTD }, { ".ffu", BLED_COMPRESSION_MAX }, { ".vhd", BLED_COMPRESSION_MAX + 1 }, { ".vhdx", BLED_COMPRESSION_MAX + 2 }, From 8f3a9c1c7c6c1538a4d65ec15d06bc199aafe115 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 27 Nov 2024 17:19:36 +0000 Subject: [PATCH 021/192] [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. --- .vs/bled.vcxproj | 3 + .vs/bled.vcxproj.filters | 9 + configure | 2 +- configure.ac | 2 +- src/bled/Makefile.am | 3 +- src/bled/Makefile.in | 17 +- src/bled/data_align.c | 1 - src/bled/data_skip.c | 1 - src/bled/decompress_bunzip2.c | 2 +- src/bled/decompress_gunzip.c | 1 - src/bled/decompress_unzip.c | 2 - src/bled/decompress_unzstd.c | 6 - src/bled/filter_accept_all.c | 1 - src/bled/filter_accept_list.c | 1 - src/bled/find_list_entry.c | 1 - src/bled/fse.h | 126 +- src/bled/fse_bitstream.h | 156 +- src/bled/fse_decompress.c | 134 +- src/bled/header_verbose_list.c | 2 +- src/bled/huf.h | 262 +- src/bled/huf_decompress.c | 947 ++-- src/bled/init_handle.c | 1 - src/bled/libbb.h | 64 +- src/bled/open_transformer.c | 134 +- src/bled/seek_by_jump.c | 1 - src/bled/seek_by_read.c | 1 - src/bled/xxhash.c | 815 +-- src/bled/xxhash.h | 7136 ++++++++++++++++++++++++++- src/bled/xz_dec_lzma2.c | 8 +- src/bled/zstd.h | 3069 +++++++++++- src/bled/zstd_bits.h | 208 + src/bled/zstd_common.c | 48 + src/bled/zstd_compiler.h | 319 +- src/bled/zstd_config.h | 11 + src/bled/zstd_cpu.h | 38 +- src/bled/zstd_ddict.c | 244 + src/bled/zstd_ddict.h | 15 +- src/bled/zstd_decompress.c | 1336 ++++- src/bled/zstd_decompress_block.c | 1261 ++++- src/bled/zstd_decompress_block.h | 17 +- src/bled/zstd_decompress_internal.h | 53 +- src/bled/zstd_deps.h | 36 +- src/bled/zstd_entropy_common.c | 54 +- src/bled/zstd_error_private.c | 11 +- src/bled/zstd_error_private.h | 96 +- src/bled/zstd_errors.h | 51 +- src/bled/zstd_internal.h | 182 +- src/bled/zstd_mem.h | 103 +- src/rufus.rc | 10 +- 49 files changed, 14351 insertions(+), 2650 deletions(-) create mode 100644 src/bled/zstd_bits.h create mode 100644 src/bled/zstd_common.c create mode 100644 src/bled/zstd_ddict.c diff --git a/.vs/bled.vcxproj b/.vs/bled.vcxproj index 2c25bf54..12050177 100644 --- a/.vs/bled.vcxproj +++ b/.vs/bled.vcxproj @@ -65,6 +65,8 @@ <ClCompile Include="..\src\bled\xz_dec_bcj.c" /> <ClCompile Include="..\src\bled\xz_dec_lzma2.c" /> <ClCompile Include="..\src\bled\xz_dec_stream.c" /> + <ClCompile Include="..\src\bled\zstd_common.c" /> + <ClCompile Include="..\src\bled\zstd_ddict.c" /> <ClCompile Include="..\src\bled\zstd_decompress.c" /> <ClCompile Include="..\src\bled\zstd_decompress_block.c" /> <ClCompile Include="..\src\bled\zstd_entropy_common.c" /> @@ -85,6 +87,7 @@ <ClInclude Include="..\src\bled\xz_private.h" /> <ClInclude Include="..\src\bled\xz_stream.h" /> <ClInclude Include="..\src\bled\zstd.h" /> + <ClInclude Include="..\src\bled\zstd_bits.h" /> <ClInclude Include="..\src\bled\zstd_compiler.h" /> <ClInclude Include="..\src\bled\zstd_config.h" /> <ClInclude Include="..\src\bled\zstd_cpu.h" /> diff --git a/.vs/bled.vcxproj.filters b/.vs/bled.vcxproj.filters index aec23207..abbc6ed8 100644 --- a/.vs/bled.vcxproj.filters +++ b/.vs/bled.vcxproj.filters @@ -111,6 +111,12 @@ <ClCompile Include="..\src\bled\zstd_error_private.c"> <Filter>Source Files</Filter> </ClCompile> + <ClCompile Include="..\src\bled\zstd_common.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\bled\zstd_ddict.c"> + <Filter>Source Files</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\src\bled\bb_archive.h"> @@ -188,5 +194,8 @@ <ClInclude Include="..\src\bled\zstd_mem.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="..\src\bled\zstd_bits.h"> + <Filter>Header Files</Filter> + </ClInclude> </ItemGroup> </Project> \ No newline at end of file diff --git a/configure b/configure index a385d034..69e58bcd 100755 --- a/configure +++ b/configure @@ -4725,7 +4725,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="${saved_CFLAGS}" -AM_CFLAGS="$AM_CFLAGS -DUNICODE -D_UNICODE -UNDEBUG -DCOBJMACROS -D__USE_MINGW_ANSI_STDIO=0 -std=gnu99 -Wshadow -Wall -Wformat-security -Wundef -Wunused -Wstrict-prototypes -Wno-restrict -Wno-array-bounds -Werror-implicit-function-declaration -Wbidi-chars=none $nopointersign_cflags" +AM_CFLAGS="$AM_CFLAGS -DUNICODE -D_UNICODE -UNDEBUG -DCOBJMACROS -D__USE_MINGW_ANSI_STDIO=0 -std=gnu11 -Wshadow -Wall -Wformat-security -Wundef -Wunused -Wstrict-prototypes -Wno-restrict -Wno-array-bounds -Werror-implicit-function-declaration -Wbidi-chars=none $nopointersign_cflags" diff --git a/configure.ac b/configure.ac index c530cd10..27ccdbfa 100644 --- a/configure.ac +++ b/configure.ac @@ -64,7 +64,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [nopointersign_cflags="-Wno-pointer-sign"], [nopointersign_cflags=""]) CFLAGS="${saved_CFLAGS}" -AM_CFLAGS="$AM_CFLAGS -DUNICODE -D_UNICODE -UNDEBUG -DCOBJMACROS -D__USE_MINGW_ANSI_STDIO=0 -std=gnu99 -Wshadow -Wall -Wformat-security -Wundef -Wunused -Wstrict-prototypes -Wno-restrict -Wno-array-bounds -Werror-implicit-function-declaration -Wbidi-chars=none $nopointersign_cflags" +AM_CFLAGS="$AM_CFLAGS -DUNICODE -D_UNICODE -UNDEBUG -DCOBJMACROS -D__USE_MINGW_ANSI_STDIO=0 -std=gnu11 -Wshadow -Wall -Wformat-security -Wundef -Wunused -Wstrict-prototypes -Wno-restrict -Wno-array-bounds -Werror-implicit-function-declaration -Wbidi-chars=none $nopointersign_cflags" AC_SUBST([VISIBILITY_CFLAGS]) AC_SUBST([AM_CFLAGS]) diff --git a/src/bled/Makefile.am b/src/bled/Makefile.am index 07417ca2..23b00401 100644 --- a/src/bled/Makefile.am +++ b/src/bled/Makefile.am @@ -5,5 +5,6 @@ libbled_a_SOURCES = bled.c crc32.c data_align.c data_extract_all.c data_skip.c d decompress_unzstd.c decompress_vtsi.c filter_accept_all.c filter_accept_list.c filter_accept_reject_list.c \ find_list_entry.c fse_decompress.c header_list.c header_skip.c header_verbose_list.c huf_decompress.c \ 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_decompress.c zstd_decompress_block.c zstd_entropy_common.c zstd_error_private.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 diff --git a/src/bled/Makefile.in b/src/bled/Makefile.in index cc7463e3..7619dc50 100644 --- a/src/bled/Makefile.in +++ b/src/bled/Makefile.in @@ -121,8 +121,10 @@ am_libbled_a_OBJECTS = libbled_a-bled.$(OBJEXT) \ libbled_a-xz_dec_bcj.$(OBJEXT) \ libbled_a-xz_dec_lzma2.$(OBJEXT) \ libbled_a-xz_dec_stream.$(OBJEXT) libbled_a-xxhash.$(OBJEXT) \ + libbled_a-zstd_common.$(OBJEXT) \ libbled_a-zstd_decompress.$(OBJEXT) \ libbled_a-zstd_decompress_block.$(OBJEXT) \ + libbled_a-zstd_ddict.$(OBJEXT) \ libbled_a-zstd_entropy_common.$(OBJEXT) \ libbled_a-zstd_error_private.$(OBJEXT) libbled_a_OBJECTS = $(am_libbled_a_OBJECTS) @@ -279,7 +281,8 @@ libbled_a_SOURCES = bled.c crc32.c data_align.c data_extract_all.c data_skip.c d decompress_unzstd.c decompress_vtsi.c filter_accept_all.c filter_accept_list.c filter_accept_reject_list.c \ find_list_entry.c fse_decompress.c header_list.c header_skip.c header_verbose_list.c huf_decompress.c \ 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_decompress.c zstd_decompress_block.c zstd_entropy_common.c zstd_error_private.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 all: all-am @@ -517,6 +520,12 @@ libbled_a-xxhash.o: xxhash.c libbled_a-xxhash.obj: xxhash.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-xxhash.obj `if test -f 'xxhash.c'; then $(CYGPATH_W) 'xxhash.c'; else $(CYGPATH_W) '$(srcdir)/xxhash.c'; fi` +libbled_a-zstd_common.o: zstd_common.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_common.o `test -f 'zstd_common.c' || echo '$(srcdir)/'`zstd_common.c + +libbled_a-zstd_common.obj: zstd_common.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_common.obj `if test -f 'zstd_common.c'; then $(CYGPATH_W) 'zstd_common.c'; else $(CYGPATH_W) '$(srcdir)/zstd_common.c'; fi` + libbled_a-zstd_decompress.o: zstd_decompress.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_decompress.o `test -f 'zstd_decompress.c' || echo '$(srcdir)/'`zstd_decompress.c @@ -529,6 +538,12 @@ libbled_a-zstd_decompress_block.o: zstd_decompress_block.c libbled_a-zstd_decompress_block.obj: zstd_decompress_block.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_decompress_block.obj `if test -f 'zstd_decompress_block.c'; then $(CYGPATH_W) 'zstd_decompress_block.c'; else $(CYGPATH_W) '$(srcdir)/zstd_decompress_block.c'; fi` +libbled_a-zstd_ddict.o: zstd_ddict.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_ddict.o `test -f 'zstd_ddict.c' || echo '$(srcdir)/'`zstd_ddict.c + +libbled_a-zstd_ddict.obj: zstd_ddict.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_ddict.obj `if test -f 'zstd_ddict.c'; then $(CYGPATH_W) 'zstd_ddict.c'; else $(CYGPATH_W) '$(srcdir)/zstd_ddict.c'; fi` + libbled_a-zstd_entropy_common.o: zstd_entropy_common.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_entropy_common.o `test -f 'zstd_entropy_common.c' || echo '$(srcdir)/'`zstd_entropy_common.c diff --git a/src/bled/data_align.c b/src/bled/data_align.c index a6b84a44..f61fdd93 100644 --- a/src/bled/data_align.c +++ b/src/bled/data_align.c @@ -2,7 +2,6 @@ /* * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - #include "libbb.h" #include "bb_archive.h" diff --git a/src/bled/data_skip.c b/src/bled/data_skip.c index 588167f0..1a608227 100644 --- a/src/bled/data_skip.c +++ b/src/bled/data_skip.c @@ -2,7 +2,6 @@ /* * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - #include "libbb.h" #include "bb_archive.h" diff --git a/src/bled/decompress_bunzip2.c b/src/bled/decompress_bunzip2.c index 39ea43e7..3c54285d 100644 --- a/src/bled/decompress_bunzip2.c +++ b/src/bled/decompress_bunzip2.c @@ -163,7 +163,7 @@ static int get_next_block(bunzip_data *bd) uint32_t *dbuf; unsigned origPtr, t; unsigned dbufCount, runPos; - unsigned runCnt = 0; // runCnt; /* for compiler */ + unsigned runCnt = 0; /* for compiler */ dbuf = bd->dbuf; selectors = bd->selectors; diff --git a/src/bled/decompress_gunzip.c b/src/bled/decompress_gunzip.c index 6f0ddcf9..beb7fb39 100644 --- a/src/bled/decompress_gunzip.c +++ b/src/bled/decompress_gunzip.c @@ -1269,7 +1269,6 @@ unpack_gz_stream(transformer_state_t *xstate) return -1; } to_read = -1; -// bytebuffer_max = 0x8000; bytebuffer = xmalloc(bytebuffer_max); if (bytebuffer == NULL) { bb_error_msg("alloc error"); diff --git a/src/bled/decompress_unzip.c b/src/bled/decompress_unzip.c index ad698352..ef8745a2 100644 --- a/src/bled/decompress_unzip.c +++ b/src/bled/decompress_unzip.c @@ -17,8 +17,6 @@ # define dbg(...) ((void)0) #endif -#define xread safe_read - enum { #if BB_BIG_ENDIAN ZIP_FILEHEADER_MAGIC = 0x504b0304, diff --git a/src/bled/decompress_unzstd.c b/src/bled/decompress_unzstd.c index 1792571f..894ad5cb 100644 --- a/src/bled/decompress_unzstd.c +++ b/src/bled/decompress_unzstd.c @@ -17,12 +17,6 @@ #include "zstd_deps.h" #include "zstd_internal.h" -ZSTD_customMem ZSTD_defaultCMem = { ZSTD_customMalloc, ZSTD_customFree, NULL }; - -ZSTDLIB_API const char* ZSTD_getErrorName(size_t code) { - return ERR_getErrorName(code); -} - ALWAYS_INLINE static size_t roundupsize(size_t size, size_t align) { return (size + align - 1U) & ~(align - 1); diff --git a/src/bled/filter_accept_all.c b/src/bled/filter_accept_all.c index c33f7d3e..5a0ee9c6 100644 --- a/src/bled/filter_accept_all.c +++ b/src/bled/filter_accept_all.c @@ -4,7 +4,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - #include "libbb.h" #include "bb_archive.h" diff --git a/src/bled/filter_accept_list.c b/src/bled/filter_accept_list.c index a2d4b23e..32f80657 100644 --- a/src/bled/filter_accept_list.c +++ b/src/bled/filter_accept_list.c @@ -4,7 +4,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - #include "libbb.h" #include "bb_archive.h" diff --git a/src/bled/find_list_entry.c b/src/bled/find_list_entry.c index 21034dbf..48f3462d 100644 --- a/src/bled/find_list_entry.c +++ b/src/bled/find_list_entry.c @@ -5,7 +5,6 @@ * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ -//#include <fnmatch.h> #include "libbb.h" #include "bb_archive.h" diff --git a/src/bled/fse.h b/src/bled/fse.h index 9bf7cb43..71015df4 100644 --- a/src/bled/fse.h +++ b/src/bled/fse.h @@ -1,7 +1,7 @@ /* ****************************************************************** * FSE : Finite State Entropy codec * Public Prototypes declaration - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * * You can contact the author at : * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy @@ -12,6 +12,9 @@ * You may select, at your option, one of the above-listed licenses. ****************************************************************** */ +#if defined (__cplusplus) +extern "C" { +#endif #ifndef FSE_H #define FSE_H @@ -23,7 +26,18 @@ #include "zstd_deps.h" /* size_t, ptrdiff_t */ -# define FSE_PUBLIC_API MEM_STATIC +/*-***************************************** +* FSE_PUBLIC_API : control library symbols visibility +******************************************/ +#if defined(FSE_DLL_EXPORT) && (FSE_DLL_EXPORT==1) && defined(__GNUC__) && (__GNUC__ >= 4) +# define FSE_PUBLIC_API __attribute__ ((visibility ("default"))) +#elif defined(FSE_DLL_EXPORT) && (FSE_DLL_EXPORT==1) /* Visual expected */ +# define FSE_PUBLIC_API __declspec(dllexport) +#elif defined(FSE_DLL_IMPORT) && (FSE_DLL_IMPORT==1) +# define FSE_PUBLIC_API __declspec(dllimport) /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/ +#else +# define FSE_PUBLIC_API +#endif /*------ Version ------*/ #define FSE_VERSION_MAJOR 0 @@ -39,58 +53,16 @@ FSE_PUBLIC_API unsigned FSE_versionNumber(void); /**< library version number; to be used when checking dll version */ -/*-**************************************** -* FSE simple functions -******************************************/ -/*! FSE_compress() : - Compress content of buffer 'src', of size 'srcSize', into destination buffer 'dst'. - 'dst' buffer must be already allocated. Compression runs faster is dstCapacity >= FSE_compressBound(srcSize). - @return : size of compressed data (<= dstCapacity). - Special values : if return == 0, srcData is not compressible => Nothing is stored within dst !!! - if return == 1, srcData is a single byte symbol * srcSize times. Use RLE compression instead. - if FSE_isError(return), compression failed (more details using FSE_getErrorName()) -*/ -FSE_PUBLIC_API size_t FSE_compress(void* dst, size_t dstCapacity, - const void* src, size_t srcSize); - -/*! FSE_decompress(): - Decompress FSE data from buffer 'cSrc', of size 'cSrcSize', - into already allocated destination buffer 'dst', of size 'dstCapacity'. - @return : size of regenerated data (<= maxDstSize), - or an error code, which can be tested using FSE_isError() . - - ** Important ** : FSE_decompress() does not decompress non-compressible nor RLE data !!! - Why ? : making this distinction requires a header. - Header management is intentionally delegated to the user layer, which can better manage special cases. -*/ -FSE_PUBLIC_API size_t FSE_decompress(void* dst, size_t dstCapacity, - const void* cSrc, size_t cSrcSize); - - /*-***************************************** * Tool functions ******************************************/ FSE_PUBLIC_API size_t FSE_compressBound(size_t size); /* maximum compressed size */ /* Error Management */ -unsigned FSE_isError(size_t code); /* tells if a return value is an error code */ +FSE_PUBLIC_API unsigned FSE_isError(size_t code); /* tells if a return value is an error code */ FSE_PUBLIC_API const char* FSE_getErrorName(size_t code); /* provides error code string (useful for debugging) */ -/*-***************************************** -* FSE advanced functions -******************************************/ -/*! FSE_compress2() : - Same as FSE_compress(), but allows the selection of 'maxSymbolValue' and 'tableLog' - Both parameters can be defined as '0' to mean : use default value - @return : size of compressed data - Special values : if return == 0, srcData is not compressible => Nothing is stored within cSrc !!! - if return == 1, srcData is a single byte symbol * srcSize times. Use RLE compression. - if FSE_isError(return), it's an error code. -*/ -FSE_PUBLIC_API size_t FSE_compress2 (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog); - - /*-***************************************** * FSE detailed API ******************************************/ @@ -150,8 +122,6 @@ FSE_PUBLIC_API size_t FSE_writeNCount (void* buffer, size_t bufferSize, /*! Constructor and Destructor of FSE_CTable. Note that FSE_CTable size depends on 'tableLog' and 'maxSymbolValue' */ typedef unsigned FSE_CTable; /* don't allocate that. It's only meant to be more restrictive than void* */ -FSE_PUBLIC_API FSE_CTable* FSE_createCTable (unsigned maxSymbolValue, unsigned tableLog); -FSE_PUBLIC_API void FSE_freeCTable (FSE_CTable* ct); /*! FSE_buildCTable(): Builds `ct`, which must be already allocated, using FSE_createCTable(). @@ -216,34 +186,18 @@ If there is an error, the function will return an ErrorCode (which can be tested @return : size read from 'rBuffer', or an errorCode, which can be tested using FSE_isError(). maxSymbolValuePtr[0] and tableLogPtr[0] will also be updated with their respective values */ -size_t FSE_readNCount (short* normalizedCounter, +FSE_PUBLIC_API size_t FSE_readNCount (short* normalizedCounter, unsigned* maxSymbolValuePtr, unsigned* tableLogPtr, const void* rBuffer, size_t rBuffSize); /*! FSE_readNCount_bmi2(): * Same as FSE_readNCount() but pass bmi2=1 when your CPU supports BMI2 and 0 otherwise. */ -size_t FSE_readNCount_bmi2(short* normalizedCounter, +FSE_PUBLIC_API size_t FSE_readNCount_bmi2(short* normalizedCounter, unsigned* maxSymbolValuePtr, unsigned* tableLogPtr, const void* rBuffer, size_t rBuffSize, int bmi2); -/*! Constructor and Destructor of FSE_DTable. - Note that its size depends on 'tableLog' */ typedef unsigned FSE_DTable; /* don't allocate that. It's just a way to be more restrictive than void* */ -FSE_PUBLIC_API FSE_DTable* FSE_createDTable(unsigned tableLog); -FSE_PUBLIC_API void FSE_freeDTable(FSE_DTable* dt); - -/*! FSE_buildDTable(): - Builds 'dt', which must be already allocated, using FSE_createDTable(). - return : 0, or an errorCode, which can be tested using FSE_isError() */ -FSE_PUBLIC_API size_t FSE_buildDTable (FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog); - -/*! FSE_decompress_usingDTable(): - Decompress compressed source `cSrc` of size `cSrcSize` using `dt` - into `dst` which must be already allocated. - @return : size of regenerated data (necessarily <= `dstCapacity`), - or an errorCode, which can be tested using FSE_isError() */ -FSE_PUBLIC_API size_t FSE_decompress_usingDTable(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, const FSE_DTable* dt); /*! Tutorial : @@ -275,7 +229,8 @@ If there is an error, the function will return an error code, which can be teste #endif /* FSE_H */ -#if !defined(FSE_H_FSE_STATIC_LINKING_ONLY) + +#if defined(FSE_STATIC_LINKING_ONLY) && !defined(FSE_H_FSE_STATIC_LINKING_ONLY) #define FSE_H_FSE_STATIC_LINKING_ONLY /* *** Dependency *** */ @@ -303,20 +258,10 @@ If there is an error, the function will return an error code, which can be teste * FSE advanced API ***************************************** */ -MEM_STATIC unsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, unsigned minus); +unsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, unsigned minus); /**< same as FSE_optimalTableLog(), which used `minus==2` */ -/* FSE_compress_wksp() : - * Same as FSE_compress2(), but using an externally allocated scratch buffer (`workSpace`). - * FSE_COMPRESS_WKSP_SIZE_U32() provides the minimum size required for `workSpace` as a table of FSE_CTable. - */ -#define FSE_COMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) ( FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) + ((maxTableLog > 12) ? (1 << (maxTableLog - 2)) : 1024) ) -MEM_STATIC size_t FSE_compress_wksp(void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize); - -MEM_STATIC size_t FSE_buildCTable_raw(FSE_CTable* ct, unsigned nbBits); -/**< build a fake FSE_CTable, designed for a flat distribution, where each symbol uses nbBits */ - -MEM_STATIC size_t FSE_buildCTable_rle(FSE_CTable* ct, unsigned char symbolValue); +size_t FSE_buildCTable_rle (FSE_CTable* ct, unsigned char symbolValue); /**< build a fake FSE_CTable, designed to compress always the same symbolValue */ /* FSE_buildCTable_wksp() : @@ -326,26 +271,18 @@ MEM_STATIC size_t FSE_buildCTable_rle(FSE_CTable* ct, unsigned char symbolValue) */ #define FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog) (((maxSymbolValue + 2) + (1ull << (tableLog)))/2 + sizeof(U64)/sizeof(U32) /* additional 8 bytes for potential table overwrite */) #define FSE_BUILD_CTABLE_WORKSPACE_SIZE(maxSymbolValue, tableLog) (sizeof(unsigned) * FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog)) -MEM_STATIC size_t FSE_buildCTable_wksp(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize); +size_t FSE_buildCTable_wksp(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize); #define FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) (sizeof(short) * (maxSymbolValue + 1) + (1ULL << maxTableLog) + 8) #define FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) ((FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) + sizeof(unsigned) - 1) / sizeof(unsigned)) FSE_PUBLIC_API size_t FSE_buildDTable_wksp(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize); /**< Same as FSE_buildDTable(), using an externally allocated `workspace` produced with `FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxSymbolValue)` */ -MEM_STATIC size_t FSE_buildDTable_raw(FSE_DTable* dt, unsigned nbBits); -/**< build a fake FSE_DTable, designed to read a flat distribution where each symbol uses nbBits */ - -MEM_STATIC size_t FSE_buildDTable_rle(FSE_DTable* dt, unsigned char symbolValue); -/**< build a fake FSE_DTable, designed to always generate the same symbolValue */ - -#define FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) (FSE_DTABLE_SIZE_U32(maxTableLog) + FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) + (FSE_MAX_SYMBOL_VALUE + 1) / 2 + 1) +#define FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) (FSE_DTABLE_SIZE_U32(maxTableLog) + 1 + FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) + (FSE_MAX_SYMBOL_VALUE + 1) / 2 + 1) #define FSE_DECOMPRESS_WKSP_SIZE(maxTableLog, maxSymbolValue) (FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(unsigned)) -MEM_STATIC size_t FSE_decompress_wksp(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize); -/**< same as FSE_decompress(), using an externally allocated `workSpace` produced with `FSE_DECOMPRESS_WKSP_SIZE_U32(maxLog, maxSymbolValue)` */ - size_t FSE_decompress_wksp_bmi2(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize, int bmi2); -/**< Same as FSE_decompress_wksp() but with dynamic BMI2 support. Pass 1 if your CPU supports BMI2 or 0 if it doesn't. */ +/**< same as FSE_decompress(), using an externally allocated `workSpace` produced with `FSE_DECOMPRESS_WKSP_SIZE_U32(maxLog, maxSymbolValue)`. + * Set bmi2 to 1 if your CPU supports BMI2 or 0 if it doesn't */ typedef enum { FSE_repeat_none, /**< Cannot use the previous table */ @@ -528,20 +465,20 @@ MEM_STATIC void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* statePtr, un FSE_symbolCompressionTransform const symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol]; const U16* const stateTable = (const U16*)(statePtr->stateTable); U32 const nbBitsOut = (U32)((statePtr->value + symbolTT.deltaNbBits) >> 16); - BIT_addBits(bitC, statePtr->value, nbBitsOut); + BIT_addBits(bitC, (size_t)statePtr->value, nbBitsOut); statePtr->value = stateTable[ (statePtr->value >> nbBitsOut) + symbolTT.deltaFindState]; } MEM_STATIC void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* statePtr) { - BIT_addBits(bitC, statePtr->value, statePtr->stateLog); + BIT_addBits(bitC, (size_t)statePtr->value, statePtr->stateLog); BIT_flushBits(bitC); } /* FSE_getMaxNbBits() : * Approximate maximum cost of a symbol, in bits. - * Fractional get rounded up (i.e : a symbol with a normalized frequency of 3 gives the same result as a frequency of 2) + * Fractional get rounded up (i.e. a symbol with a normalized frequency of 3 gives the same result as a frequency of 2) * note 1 : assume symbolValue is valid (<= maxSymbolValue) * note 2 : if freq[symbolValue]==0, @return a fake cost of tableLog+1 bits */ MEM_STATIC U32 FSE_getMaxNbBits(const void* symbolTTPtr, U32 symbolValue) @@ -698,3 +635,6 @@ MEM_STATIC unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr) #endif /* FSE_STATIC_LINKING_ONLY */ +#if defined (__cplusplus) +} +#endif diff --git a/src/bled/fse_bitstream.h b/src/bled/fse_bitstream.h index a6f36229..ed57e32b 100644 --- a/src/bled/fse_bitstream.h +++ b/src/bled/fse_bitstream.h @@ -1,7 +1,7 @@ /* ****************************************************************** * bitstream * Part of FSE library - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * * You can contact the author at : * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy @@ -14,6 +14,9 @@ #ifndef BITSTREAM_H_MODULE #define BITSTREAM_H_MODULE +#if defined (__cplusplus) +extern "C" { +#endif /* * This API consists of small unitary functions, which must be inlined for best performance. * Since link-time-optimization is not available for all compilers, @@ -26,11 +29,19 @@ #include "zstd_mem.h" /* unaligned access routines */ #include "zstd_compiler.h" /* UNLIKELY() */ #include "zstd_error_private.h" /* error codes and messages */ +#include "zstd_bits.h" /* ZSTD_highbit32 */ /*========================================= * Target specific =========================================*/ +#ifndef ZSTD_NO_INTRINSICS +# if (defined(__BMI__) || defined(__BMI2__)) && defined(__GNUC__) +# include <immintrin.h> /* support for bextr (experimental)/bzhi */ +# elif defined(__ICCARM__) +# include <intrinsics.h> +# endif +#endif #define STREAM_ACCUMULATOR_MIN_32 25 #define STREAM_ACCUMULATOR_MIN_64 57 @@ -78,19 +89,20 @@ MEM_STATIC size_t BIT_closeCStream(BIT_CStream_t* bitC); /*-******************************************** * bitStream decoding API (read backward) **********************************************/ +typedef size_t BitContainerType; typedef struct { - size_t bitContainer; + BitContainerType bitContainer; unsigned bitsConsumed; const char* ptr; const char* start; const char* limitPtr; } BIT_DStream_t; -typedef enum { BIT_DStream_unfinished = 0, - BIT_DStream_endOfBuffer = 1, - BIT_DStream_completed = 2, - BIT_DStream_overflow = 3 } BIT_DStream_status; /* result of BIT_reloadDStream() */ - /* 1,2,4,8 would be better for bitmap combinations, but slows down performance a bit ... :( */ +typedef enum { BIT_DStream_unfinished = 0, /* fully refilled */ + BIT_DStream_endOfBuffer = 1, /* still some bits left in bitstream */ + BIT_DStream_completed = 2, /* bitstream entirely consumed, bit-exact */ + BIT_DStream_overflow = 3 /* user requested more bits than present in bitstream */ + } BIT_DStream_status; /* result of BIT_reloadDStream() */ MEM_STATIC size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize); MEM_STATIC size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits); @@ -100,7 +112,7 @@ MEM_STATIC unsigned BIT_endOfDStream(const BIT_DStream_t* bitD); /* Start by invoking BIT_initDStream(). * A chunk of the bitStream is then stored into a local register. -* Local register size is 64-bits on 64-bits systems, 32-bits on 32-bits systems (size_t). +* Local register size is 64-bits on 64-bits systems, 32-bits on 32-bits systems (BitContainerType). * You can then retrieve bitFields stored into the local register, **in reverse order**. * Local register is explicitly reloaded from memory by the BIT_reloadDStream() method. * A reload guarantee a minimum of ((8*sizeof(bitD->bitContainer))-7) bits when its result is BIT_DStream_unfinished. @@ -121,42 +133,6 @@ MEM_STATIC void BIT_flushBitsFast(BIT_CStream_t* bitC); MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits); /* faster, but works only if nbBits >= 1 */ - - -/*-************************************************************** -* Internal functions -****************************************************************/ -MEM_STATIC unsigned BIT_highbit32 (U32 val) -{ - assert(val != 0); - { -# if defined(_MSC_VER) /* Visual */ -# if STATIC_BMI2 == 1 - return _lzcnt_u32(val) ^ 31; -# else - unsigned long r = 0; - return _BitScanReverse(&r, val) ? (unsigned)r : 0; -# endif -# elif defined(__GNUC__) && (__GNUC__ >= 3) /* Use GCC Intrinsic */ - return __builtin_clz (val) ^ 31; -# elif defined(__ICCARM__) /* IAR Intrinsic */ - return 31 - __CLZ(val); -# else /* Software version */ - static const unsigned DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, - 11, 14, 16, 18, 22, 25, 3, 30, - 8, 12, 20, 28, 15, 17, 24, 7, - 19, 27, 23, 6, 26, 5, 4, 31 }; - U32 v = val; - v |= v >> 1; - v |= v >> 2; - v |= v >> 4; - v |= v >> 8; - v |= v >> 16; - return DeBruijnClz[ (U32) (v * 0x07C4ACDDU) >> 27]; -# endif - } -} - /*===== Local Constants =====*/ static const unsigned BIT_mask[] = { 0, 1, 3, 7, 0xF, 0x1F, @@ -186,6 +162,16 @@ MEM_STATIC size_t BIT_initCStream(BIT_CStream_t* bitC, return 0; } +FORCE_INLINE_TEMPLATE size_t BIT_getLowerBits(size_t bitContainer, U32 const nbBits) +{ +#if defined(STATIC_BMI2) && STATIC_BMI2 == 1 && !defined(ZSTD_NO_INTRINSICS) + return _bzhi_u64(bitContainer, nbBits); +#else + assert(nbBits < BIT_MASK_SIZE); + return bitContainer & BIT_mask[nbBits]; +#endif +} + /*! BIT_addBits() : * can add up to 31 bits into `bitC`. * Note : does not check for register overflow ! */ @@ -195,7 +181,7 @@ MEM_STATIC void BIT_addBits(BIT_CStream_t* bitC, DEBUG_STATIC_ASSERT(BIT_MASK_SIZE == 32); assert(nbBits < BIT_MASK_SIZE); assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8); - bitC->bitContainer |= (value & BIT_mask[nbBits]) << bitC->bitPos; + bitC->bitContainer |= BIT_getLowerBits(value, nbBits) << bitC->bitPos; bitC->bitPos += nbBits; } @@ -274,35 +260,35 @@ MEM_STATIC size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, si bitD->ptr = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer); bitD->bitContainer = MEM_readLEST(bitD->ptr); { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1]; - bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0; /* ensures bitsConsumed is always set */ + bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0; /* ensures bitsConsumed is always set */ if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ } } else { bitD->ptr = bitD->start; bitD->bitContainer = *(const BYTE*)(bitD->start); switch(srcSize) { - case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16); + case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16); ZSTD_FALLTHROUGH; - case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24); + case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24); ZSTD_FALLTHROUGH; - case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32); + case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32); ZSTD_FALLTHROUGH; - case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24; + case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24; ZSTD_FALLTHROUGH; - case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16; + case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16; ZSTD_FALLTHROUGH; - case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) << 8; + case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) << 8; ZSTD_FALLTHROUGH; default: break; } { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1]; - bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0; + bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0; if (lastByte == 0) return ERROR(corruption_detected); /* endMark not present */ } bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8; @@ -311,12 +297,12 @@ MEM_STATIC size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, si return srcSize; } -MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getUpperBits(size_t bitContainer, U32 const start) +FORCE_INLINE_TEMPLATE size_t BIT_getUpperBits(BitContainerType bitContainer, U32 const start) { return bitContainer >> start; } -MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getMiddleBits(size_t bitContainer, U32 const start, U32 const nbBits) +FORCE_INLINE_TEMPLATE size_t BIT_getMiddleBits(BitContainerType bitContainer, U32 const start, U32 const nbBits) { U32 const regMask = sizeof(bitContainer)*8 - 1; /* if start > regMask, bitstream is corrupted, and result is undefined */ @@ -333,23 +319,13 @@ MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getMiddleBits(size_t bitContainer, U32 c #endif } -MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getLowerBits(size_t bitContainer, U32 const nbBits) -{ -#if defined(STATIC_BMI2) && STATIC_BMI2 == 1 - return _bzhi_u64(bitContainer, nbBits); -#else - assert(nbBits < BIT_MASK_SIZE); - return bitContainer & BIT_mask[nbBits]; -#endif -} - /*! BIT_lookBits() : * Provides next n bits from local register. * local register is not modified. * On 32-bits, maxNbBits==24. * On 64-bits, maxNbBits==56. * @return : value extracted */ -MEM_STATIC FORCE_INLINE_ATTR size_t BIT_lookBits(const BIT_DStream_t* bitD, U32 nbBits) +FORCE_INLINE_TEMPLATE size_t BIT_lookBits(const BIT_DStream_t* bitD, U32 nbBits) { /* arbitrate between double-shift and shift+mask */ #if 1 @@ -372,7 +348,7 @@ MEM_STATIC size_t BIT_lookBitsFast(const BIT_DStream_t* bitD, U32 nbBits) return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask); } -MEM_STATIC FORCE_INLINE_ATTR void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits) +FORCE_INLINE_TEMPLATE void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits) { bitD->bitsConsumed += nbBits; } @@ -381,7 +357,7 @@ MEM_STATIC FORCE_INLINE_ATTR void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits) * Read (consume) next n bits from local register and update. * Pay attention to not read more than nbBits contained into local register. * @return : extracted value. */ -MEM_STATIC FORCE_INLINE_ATTR size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits) +FORCE_INLINE_TEMPLATE size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits) { size_t const value = BIT_lookBits(bitD, nbBits); BIT_skipBits(bitD, nbBits); @@ -389,7 +365,7 @@ MEM_STATIC FORCE_INLINE_ATTR size_t BIT_readBits(BIT_DStream_t* bitD, unsigned n } /*! BIT_readBitsFast() : - * unsafe version; only works only if nbBits >= 1 */ + * unsafe version; only works if nbBits >= 1 */ MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits) { size_t const value = BIT_lookBitsFast(bitD, nbBits); @@ -398,6 +374,21 @@ MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits) return value; } +/*! BIT_reloadDStream_internal() : + * Simple variant of BIT_reloadDStream(), with two conditions: + * 1. bitstream is valid : bitsConsumed <= sizeof(bitD->bitContainer)*8 + * 2. look window is valid after shifted down : bitD->ptr >= bitD->start + */ +MEM_STATIC BIT_DStream_status BIT_reloadDStream_internal(BIT_DStream_t* bitD) +{ + assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8); + bitD->ptr -= bitD->bitsConsumed >> 3; + assert(bitD->ptr >= bitD->start); + bitD->bitsConsumed &= 7; + bitD->bitContainer = MEM_readLEST(bitD->ptr); + return BIT_DStream_unfinished; +} + /*! BIT_reloadDStreamFast() : * Similar to BIT_reloadDStream(), but with two differences: * 1. bitsConsumed <= sizeof(bitD->bitContainer)*8 must hold! @@ -408,31 +399,35 @@ MEM_STATIC BIT_DStream_status BIT_reloadDStreamFast(BIT_DStream_t* bitD) { if (UNLIKELY(bitD->ptr < bitD->limitPtr)) return BIT_DStream_overflow; - assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8); - bitD->ptr -= bitD->bitsConsumed >> 3; - bitD->bitsConsumed &= 7; - bitD->bitContainer = MEM_readLEST(bitD->ptr); - return BIT_DStream_unfinished; + return BIT_reloadDStream_internal(bitD); } /*! BIT_reloadDStream() : * Refill `bitD` from buffer previously set in BIT_initDStream() . - * This function is safe, it guarantees it will not read beyond src buffer. + * This function is safe, it guarantees it will not never beyond src buffer. * @return : status of `BIT_DStream_t` internal register. * when status == BIT_DStream_unfinished, internal register is filled with at least 25 or 57 bits */ -MEM_STATIC BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD) +FORCE_INLINE_TEMPLATE BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD) { - if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8)) /* overflow detected, like end of stream */ + /* note : once in overflow mode, a bitstream remains in this mode until it's reset */ + if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) { + static const BitContainerType zeroFilled = 0; + bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */ + /* overflow detected, erroneous scenario or end of stream: no update */ return BIT_DStream_overflow; + } + + assert(bitD->ptr >= bitD->start); if (bitD->ptr >= bitD->limitPtr) { - return BIT_reloadDStreamFast(bitD); + return BIT_reloadDStream_internal(bitD); } if (bitD->ptr == bitD->start) { + /* reached end of bitStream => no update */ if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer; return BIT_DStream_completed; } - /* start < ptr < limitPtr */ + /* start < ptr < limitPtr => cautious update */ { U32 nbBytes = bitD->bitsConsumed >> 3; BIT_DStream_status result = BIT_DStream_unfinished; if (bitD->ptr - nbBytes < bitD->start) { @@ -454,5 +449,8 @@ MEM_STATIC unsigned BIT_endOfDStream(const BIT_DStream_t* DStream) return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8)); } +#if defined (__cplusplus) +} +#endif #endif /* BITSTREAM_H_MODULE */ diff --git a/src/bled/fse_decompress.c b/src/bled/fse_decompress.c index 610898e8..63e478e5 100644 --- a/src/bled/fse_decompress.c +++ b/src/bled/fse_decompress.c @@ -1,6 +1,6 @@ /* ****************************************************************** * FSE : Finite State Entropy decoder - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * * You can contact the author at : * - FSE source repository : https://github.com/Cyan4973/FiniteStateEntropy @@ -16,14 +16,13 @@ /* ************************************************************** * Includes ****************************************************************/ -//#include "debug.h" /* assert */ #include "fse_bitstream.h" #include "zstd_compiler.h" #define FSE_STATIC_LINKING_ONLY #include "fse.h" #include "zstd_error_private.h" -#define ZSTD_DEPS_NEED_MALLOC -#include "zstd_deps.h" +#include "zstd_deps.h" /* ZSTD_memcpy */ +#include "zstd_bits.h" /* ZSTD_highbit32 */ /* ************************************************************** @@ -55,19 +54,6 @@ #define FSE_FUNCTION_NAME(X,Y) FSE_CAT(X,Y) #define FSE_TYPE_NAME(X,Y) FSE_CAT(X,Y) - -/* Function templates */ -FSE_DTable* FSE_createDTable (unsigned tableLog) -{ - if (tableLog > FSE_TABLELOG_ABSOLUTE_MAX) tableLog = FSE_TABLELOG_ABSOLUTE_MAX; - return (FSE_DTable*)ZSTD_malloc( FSE_DTABLE_SIZE_U32(tableLog) * sizeof (U32) ); -} - -void FSE_freeDTable (FSE_DTable* dt) -{ - ZSTD_free(dt); -} - static size_t FSE_buildDTable_internal(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize) { void* const tdPtr = dt+1; /* because *dt is unsigned, 32-bits aligned on 32-bits */ @@ -96,7 +82,7 @@ static size_t FSE_buildDTable_internal(FSE_DTable* dt, const short* normalizedCo symbolNext[s] = 1; } else { if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0; - symbolNext[s] = normalizedCounter[s]; + symbolNext[s] = (U16)normalizedCounter[s]; } } } ZSTD_memcpy(dt, &DTableH, sizeof(DTableH)); } @@ -111,8 +97,7 @@ static size_t FSE_buildDTable_internal(FSE_DTable* dt, const short* normalizedCo * all symbols have counts <= 8. We ensure we have 8 bytes at the end of * our buffer to handle the over-write. */ - { - U64 const add = 0x0101010101010101ull; + { U64 const add = 0x0101010101010101ull; size_t pos = 0; U64 sv = 0; U32 s; @@ -123,14 +108,13 @@ static size_t FSE_buildDTable_internal(FSE_DTable* dt, const short* normalizedCo for (i = 8; i < n; i += 8) { MEM_write64(spread + pos + i, sv); } - pos += n; - } - } + pos += (size_t)n; + } } /* Now we spread those positions across the table. - * The benefit of doing it in two stages is that we avoid the the + * The benefit of doing it in two stages is that we avoid the * variable size inner loop, which caused lots of branch misses. * Now we can run through all the positions without any branch misses. - * We unroll the loop twice, since that is what emperically worked best. + * We unroll the loop twice, since that is what empirically worked best. */ { size_t position = 0; @@ -166,7 +150,7 @@ static size_t FSE_buildDTable_internal(FSE_DTable* dt, const short* normalizedCo for (u=0; u<tableSize; u++) { FSE_FUNCTION_TYPE const symbol = (FSE_FUNCTION_TYPE)(tableDecode[u].symbol); U32 const nextState = symbolNext[symbol]++; - tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) ); + tableDecode[u].nbBits = (BYTE) (tableLog - ZSTD_highbit32(nextState) ); tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize); } } @@ -184,49 +168,6 @@ size_t FSE_buildDTable_wksp(FSE_DTable* dt, const short* normalizedCounter, unsi /*-******************************************************* * Decompression (Byte symbols) *********************************************************/ -size_t FSE_buildDTable_rle (FSE_DTable* dt, BYTE symbolValue) -{ - void* ptr = dt; - FSE_DTableHeader* const DTableH = (FSE_DTableHeader*)ptr; - void* dPtr = dt + 1; - FSE_decode_t* const cell = (FSE_decode_t*)dPtr; - - DTableH->tableLog = 0; - DTableH->fastMode = 0; - - cell->newState = 0; - cell->symbol = symbolValue; - cell->nbBits = 0; - - return 0; -} - - -size_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits) -{ - void* ptr = dt; - FSE_DTableHeader* const DTableH = (FSE_DTableHeader*)ptr; - void* dPtr = dt + 1; - FSE_decode_t* const dinfo = (FSE_decode_t*)dPtr; - const unsigned tableSize = 1 << nbBits; - const unsigned tableMask = tableSize - 1; - const unsigned maxSV1 = tableMask+1; - unsigned s; - - /* Sanity checks */ - if (nbBits < 1) return ERROR(GENERIC); /* min size */ - - /* Build Decoding Table */ - DTableH->tableLog = (U16)nbBits; - DTableH->fastMode = 1; - for (s=0; s<maxSV1; s++) { - dinfo[s].newState = 0; - dinfo[s].symbol = (BYTE)s; - dinfo[s].nbBits = (BYTE)nbBits; - } - - return 0; -} FORCE_INLINE_TEMPLATE size_t FSE_decompress_usingDTable_generic( void* dst, size_t maxDstSize, @@ -248,6 +189,8 @@ FORCE_INLINE_TEMPLATE size_t FSE_decompress_usingDTable_generic( FSE_initDState(&state1, &bitD, dt); FSE_initDState(&state2, &bitD, dt); + RETURN_ERROR_IF(BIT_reloadDStream(&bitD)==BIT_DStream_overflow, corruption_detected, ""); + #define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD) /* 4 symbols per loop */ @@ -287,32 +230,12 @@ FORCE_INLINE_TEMPLATE size_t FSE_decompress_usingDTable_generic( break; } } - return op-ostart; -} - - -size_t FSE_decompress_usingDTable(void* dst, size_t originalSize, - const void* cSrc, size_t cSrcSize, - const FSE_DTable* dt) -{ - const void* ptr = dt; - const FSE_DTableHeader* DTableH = (const FSE_DTableHeader*)ptr; - const U32 fastMode = DTableH->fastMode; - - /* select fast mode (static) */ - if (fastMode) return FSE_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 1); - return FSE_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 0); -} - - -size_t FSE_decompress_wksp(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize) -{ - return FSE_decompress_wksp_bmi2(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize, /* bmi2 */ 0); + assert(op >= ostart); + return (size_t)(op-ostart); } typedef struct { short ncount[FSE_MAX_SYMBOL_VALUE + 1]; - FSE_DTable dtable[1]; /* Dynamically sized */ } FSE_DecompressWksp; @@ -327,13 +250,18 @@ FORCE_INLINE_TEMPLATE size_t FSE_decompress_wksp_body( unsigned tableLog; unsigned maxSymbolValue = FSE_MAX_SYMBOL_VALUE; FSE_DecompressWksp* const wksp = (FSE_DecompressWksp*)workSpace; + size_t const dtablePos = sizeof(FSE_DecompressWksp) / sizeof(FSE_DTable); + FSE_DTable* const dtable = (FSE_DTable*)workSpace + dtablePos; - DEBUG_STATIC_ASSERT((FSE_MAX_SYMBOL_VALUE + 1) % 2 == 0); + FSE_STATIC_ASSERT((FSE_MAX_SYMBOL_VALUE + 1) % 2 == 0); if (wkspSize < sizeof(*wksp)) return ERROR(GENERIC); + /* correct offset to dtable depends on this property */ + FSE_STATIC_ASSERT(sizeof(FSE_DecompressWksp) % sizeof(FSE_DTable) == 0); + /* normal FSE decoding mode */ - { - size_t const NCountLength = FSE_readNCount_bmi2(wksp->ncount, &maxSymbolValue, &tableLog, istart, cSrcSize, bmi2); + { size_t const NCountLength = + FSE_readNCount_bmi2(wksp->ncount, &maxSymbolValue, &tableLog, istart, cSrcSize, bmi2); if (FSE_isError(NCountLength)) return NCountLength; if (tableLog > maxLog) return ERROR(tableLog_tooLarge); assert(NCountLength <= cSrcSize); @@ -342,19 +270,20 @@ FORCE_INLINE_TEMPLATE size_t FSE_decompress_wksp_body( } if (FSE_DECOMPRESS_WKSP_SIZE(tableLog, maxSymbolValue) > wkspSize) return ERROR(tableLog_tooLarge); - workSpace = wksp->dtable + FSE_DTABLE_SIZE_U32(tableLog); + assert(sizeof(*wksp) + FSE_DTABLE_SIZE(tableLog) <= wkspSize); + workSpace = (BYTE*)workSpace + sizeof(*wksp) + FSE_DTABLE_SIZE(tableLog); wkspSize -= sizeof(*wksp) + FSE_DTABLE_SIZE(tableLog); - CHECK_F( FSE_buildDTable_internal(wksp->dtable, wksp->ncount, maxSymbolValue, tableLog, workSpace, wkspSize) ); + CHECK_F( FSE_buildDTable_internal(dtable, wksp->ncount, maxSymbolValue, tableLog, workSpace, wkspSize) ); { - const void* ptr = wksp->dtable; + const void* ptr = dtable; const FSE_DTableHeader* DTableH = (const FSE_DTableHeader*)ptr; const U32 fastMode = DTableH->fastMode; /* select fast mode (static) */ - if (fastMode) return FSE_decompress_usingDTable_generic(dst, dstCapacity, ip, cSrcSize, wksp->dtable, 1); - return FSE_decompress_usingDTable_generic(dst, dstCapacity, ip, cSrcSize, wksp->dtable, 0); + if (fastMode) return FSE_decompress_usingDTable_generic(dst, dstCapacity, ip, cSrcSize, dtable, 1); + return FSE_decompress_usingDTable_generic(dst, dstCapacity, ip, cSrcSize, dtable, 0); } } @@ -365,7 +294,7 @@ static size_t FSE_decompress_wksp_body_default(void* dst, size_t dstCapacity, co } #if DYNAMIC_BMI2 -TARGET_ATTRIBUTE("bmi2") static size_t FSE_decompress_wksp_body_bmi2(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize) +BMI2_TARGET_ATTRIBUTE static size_t FSE_decompress_wksp_body_bmi2(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize) { return FSE_decompress_wksp_body(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize, 1); } @@ -382,9 +311,4 @@ size_t FSE_decompress_wksp_bmi2(void* dst, size_t dstCapacity, const void* cSrc, return FSE_decompress_wksp_body_default(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize); } - -typedef FSE_DTable DTable_max_t[FSE_DTABLE_SIZE_U32(FSE_MAX_TABLELOG)]; - - - #endif /* FSE_COMMONDEFS_ONLY */ diff --git a/src/bled/header_verbose_list.c b/src/bled/header_verbose_list.c index 73e1fee4..a575a08a 100644 --- a/src/bled/header_verbose_list.c +++ b/src/bled/header_verbose_list.c @@ -9,9 +9,9 @@ void FAST_FUNC header_verbose_list(const file_header_t *file_header) { struct tm tm_time; struct tm *ptm = &tm_time; //localtime(&file_header->mtime); + char modestr[12]; #if ENABLE_FEATURE_TAR_UNAME_GNAME - char modestr[12]; char uid[sizeof(int)*3 + 2]; /*char gid[sizeof(int)*3 + 2];*/ char *user; diff --git a/src/bled/huf.h b/src/bled/huf.h index 91e33c54..e4f5a6f4 100644 --- a/src/bled/huf.h +++ b/src/bled/huf.h @@ -1,7 +1,7 @@ /* ****************************************************************** * huff0 huffman codec, * part of Finite State Entropy library - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * * You can contact the author at : * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy @@ -12,92 +12,32 @@ * You may select, at your option, one of the above-listed licenses. ****************************************************************** */ +#if defined (__cplusplus) +extern "C" { +#endif #ifndef HUF_H_298734234 #define HUF_H_298734234 /* *** Dependencies *** */ #include "zstd_deps.h" /* size_t */ - -# define HUF_PUBLIC_API - -/* ========================== */ -/* *** simple functions *** */ -/* ========================== */ - -/** HUF_compress() : - * Compress content from buffer 'src', of size 'srcSize', into buffer 'dst'. - * 'dst' buffer must be already allocated. - * Compression runs faster if `dstCapacity` >= HUF_compressBound(srcSize). - * `srcSize` must be <= `HUF_BLOCKSIZE_MAX` == 128 KB. - * @return : size of compressed data (<= `dstCapacity`). - * Special values : if return == 0, srcData is not compressible => Nothing is stored within dst !!! - * if HUF_isError(return), compression failed (more details using HUF_getErrorName()) - */ -HUF_PUBLIC_API size_t HUF_compress(void* dst, size_t dstCapacity, - const void* src, size_t srcSize); - -/** HUF_decompress() : - * Decompress HUF data from buffer 'cSrc', of size 'cSrcSize', - * into already allocated buffer 'dst', of minimum size 'dstSize'. - * `originalSize` : **must** be the ***exact*** size of original (uncompressed) data. - * Note : in contrast with FSE, HUF_decompress can regenerate - * RLE (cSrcSize==1) and uncompressed (cSrcSize==dstSize) data, - * because it knows size to regenerate (originalSize). - * @return : size of regenerated data (== originalSize), - * or an error code, which can be tested using HUF_isError() - */ -HUF_PUBLIC_API size_t HUF_decompress(void* dst, size_t originalSize, - const void* cSrc, size_t cSrcSize); - - -/* *** Tool functions *** */ -#define HUF_BLOCKSIZE_MAX (128 * 1024) /**< maximum input size for a single block compressed with HUF_compress */ -HUF_PUBLIC_API size_t HUF_compressBound(size_t size); /**< maximum compressed size (worst case) */ - -/* Error Management */ -HUF_PUBLIC_API unsigned HUF_isError(size_t code); /**< tells if a return value is an error code */ -HUF_PUBLIC_API const char* HUF_getErrorName(size_t code); /**< provides error code string (useful for debugging) */ - - -/* *** Advanced function *** */ - -/** HUF_compress2() : - * Same as HUF_compress(), but offers control over `maxSymbolValue` and `tableLog`. - * `maxSymbolValue` must be <= HUF_SYMBOLVALUE_MAX . - * `tableLog` must be `<= HUF_TABLELOG_MAX` . */ -HUF_PUBLIC_API size_t HUF_compress2 (void* dst, size_t dstCapacity, - const void* src, size_t srcSize, - unsigned maxSymbolValue, unsigned tableLog); - -/** HUF_compress4X_wksp() : - * Same as HUF_compress2(), but uses externally allocated `workSpace`. - * `workspace` must be at least as large as HUF_WORKSPACE_SIZE */ -#define HUF_WORKSPACE_SIZE ((8 << 10) + 512 /* sorting scratch space */) -#define HUF_WORKSPACE_SIZE_U64 (HUF_WORKSPACE_SIZE / sizeof(U64)) -HUF_PUBLIC_API size_t HUF_compress4X_wksp (void* dst, size_t dstCapacity, - const void* src, size_t srcSize, - unsigned maxSymbolValue, unsigned tableLog, - void* workSpace, size_t wkspSize); - -#endif /* HUF_H_298734234 */ - -/* ****************************************************************** - * WARNING !! - * The following section contains advanced and experimental definitions - * which shall never be used in the context of a dynamic library, - * because they are not guaranteed to remain stable in the future. - * Only consider them in association with static linking. - * *****************************************************************/ -#if !defined(HUF_H_HUF_STATIC_LINKING_ONLY) -#define HUF_H_HUF_STATIC_LINKING_ONLY - -/* *** Dependencies *** */ -#include "zstd_mem.h" /* U32 */ +#include "zstd_mem.h" /* U32 */ #define FSE_STATIC_LINKING_ONLY #include "fse.h" +/* *** Tool functions *** */ +#define HUF_BLOCKSIZE_MAX (128 * 1024) /**< maximum input size for a single block compressed with HUF_compress */ +size_t HUF_compressBound(size_t size); /**< maximum compressed size (worst case) */ + +/* Error Management */ +unsigned HUF_isError(size_t code); /**< tells if a return value is an error code */ +const char* HUF_getErrorName(size_t code); /**< provides error code string (useful for debugging) */ + + +#define HUF_WORKSPACE_SIZE ((8 << 10) + 512 /* sorting scratch space */) +#define HUF_WORKSPACE_SIZE_U64 (HUF_WORKSPACE_SIZE / sizeof(U64)) + /* *** Constants *** */ #define HUF_TABLELOG_MAX 12 /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */ #define HUF_TABLELOG_DEFAULT 11 /* default tableLog value when none specified */ @@ -137,25 +77,49 @@ typedef U32 HUF_DTable; /* **************************************** * Advanced decompression functions ******************************************/ -HUF_PUBLIC_API size_t HUF_decompress4X1(void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< single-symbol decoder */ -#ifndef HUF_FORCE_DECOMPRESS_X1 -HUF_PUBLIC_API size_t HUF_decompress4X2(void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< double-symbols decoder */ -#endif -HUF_PUBLIC_API size_t HUF_decompress4X_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< decodes RLE and uncompressed */ -HUF_PUBLIC_API size_t HUF_decompress4X_hufOnly(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< considers RLE and uncompressed as errors */ -HUF_PUBLIC_API size_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< considers RLE and uncompressed as errors */ -HUF_PUBLIC_API size_t HUF_decompress4X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< single-symbol decoder */ -HUF_PUBLIC_API size_t HUF_decompress4X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< single-symbol decoder */ -#ifndef HUF_FORCE_DECOMPRESS_X1 -HUF_PUBLIC_API size_t HUF_decompress4X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< double-symbols decoder */ -HUF_PUBLIC_API size_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< double-symbols decoder */ -#endif +/** + * Huffman flags bitset. + * For all flags, 0 is the default value. + */ +typedef enum { + /** + * If compiled with DYNAMIC_BMI2: Set flag only if the CPU supports BMI2 at runtime. + * Otherwise: Ignored. + */ + HUF_flags_bmi2 = (1 << 0), + /** + * If set: Test possible table depths to find the one that produces the smallest header + encoded size. + * If unset: Use heuristic to find the table depth. + */ + HUF_flags_optimalDepth = (1 << 1), + /** + * If set: If the previous table can encode the input, always reuse the previous table. + * If unset: If the previous table can encode the input, reuse the previous table if it results in a smaller output. + */ + HUF_flags_preferRepeat = (1 << 2), + /** + * If set: Sample the input and check if the sample is uncompressible, if it is then don't attempt to compress. + * If unset: Always histogram the entire input. + */ + HUF_flags_suspectUncompressible = (1 << 3), + /** + * If set: Don't use assembly implementations + * If unset: Allow using assembly implementations + */ + HUF_flags_disableAsm = (1 << 4), + /** + * If set: Don't use the fast decoding loop, always use the fallback decoding loop. + * If unset: Use the fast decoding loop when possible. + */ + HUF_flags_disableFast = (1 << 5) +} HUF_flags_e; /* **************************************** * HUF detailed API * ****************************************/ +#define HUF_OPTIMAL_DEPTH_THRESHOLD ZSTD_btultra /*! HUF_compress() does the following: * 1. count symbol occurrence from source[] into table count[] using FSE_count() (exposed within "fse.h") @@ -168,39 +132,40 @@ HUF_PUBLIC_API size_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, s * For example, it's possible to compress several blocks using the same 'CTable', * or to save and regenerate 'CTable' using external methods. */ -HUF_PUBLIC_API unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue); -HUF_PUBLIC_API size_t HUF_buildCTable(HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue, unsigned maxNbBits); /* @return : maxNbBits; CTable and count can overlap. In which case, CTable will overwrite count content */ -HUF_PUBLIC_API size_t HUF_writeCTable(void* dst, size_t maxDstSize, const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog); -HUF_PUBLIC_API size_t HUF_writeCTable_wksp(void* dst, size_t maxDstSize, const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog, void* workspace, size_t workspaceSize); -HUF_PUBLIC_API size_t HUF_compress4X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable); -HUF_PUBLIC_API size_t HUF_compress4X_usingCTable_bmi2(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable, int bmi2); -HUF_PUBLIC_API size_t HUF_estimateCompressedSize(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue); -HUF_PUBLIC_API int HUF_validateCTable(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue); +unsigned HUF_minTableLog(unsigned symbolCardinality); +unsigned HUF_cardinality(const unsigned* count, unsigned maxSymbolValue); +unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, void* workSpace, + size_t wkspSize, HUF_CElt* table, const unsigned* count, int flags); /* table is used as scratch space for building and testing tables, not a return value */ +size_t HUF_writeCTable_wksp(void* dst, size_t maxDstSize, const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog, void* workspace, size_t workspaceSize); +size_t HUF_compress4X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable, int flags); +size_t HUF_estimateCompressedSize(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue); +int HUF_validateCTable(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue); typedef enum { HUF_repeat_none, /**< Cannot use the previous table */ HUF_repeat_check, /**< Can use the previous table but it must be checked. Note : The previous table must have been constructed by HUF_compress{1, 4}X_repeat */ HUF_repeat_valid /**< Can use the previous table and it is assumed to be valid */ } HUF_repeat; + /** HUF_compress4X_repeat() : * Same as HUF_compress4X_wksp(), but considers using hufTable if *repeat != HUF_repeat_none. * If it uses hufTable it does not modify hufTable or repeat. * If it doesn't, it sets *repeat = HUF_repeat_none, and it sets hufTable to the table used. * If preferRepeat then the old table will always be used if valid. * If suspectUncompressible then some sampling checks will be run to potentially skip huffman coding */ -HUF_PUBLIC_API size_t HUF_compress4X_repeat(void* dst, size_t dstSize, +size_t HUF_compress4X_repeat(void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize, /**< `workSpace` must be aligned on 4-bytes boundaries, `wkspSize` must be >= HUF_WORKSPACE_SIZE */ - HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat, int bmi2, unsigned suspectUncompressible); + HUF_CElt* hufTable, HUF_repeat* repeat, int flags); /** HUF_buildCTable_wksp() : * Same as HUF_buildCTable(), but using externally allocated scratch buffer. * `workSpace` must be aligned on 4-bytes boundaries, and its size must be >= HUF_CTABLE_WORKSPACE_SIZE. */ -#define HUF_CTABLE_WORKSPACE_SIZE_U32 (2*HUF_SYMBOLVALUE_MAX +1 +1) +#define HUF_CTABLE_WORKSPACE_SIZE_U32 ((4 * (HUF_SYMBOLVALUE_MAX + 1)) + 192) #define HUF_CTABLE_WORKSPACE_SIZE (HUF_CTABLE_WORKSPACE_SIZE_U32 * sizeof(unsigned)) -HUF_PUBLIC_API size_t HUF_buildCTable_wksp(HUF_CElt* tree, +size_t HUF_buildCTable_wksp (HUF_CElt* tree, const unsigned* count, U32 maxSymbolValue, U32 maxNbBits, void* workSpace, size_t wkspSize); @@ -209,7 +174,7 @@ HUF_PUBLIC_API size_t HUF_buildCTable_wksp(HUF_CElt* tree, * `huffWeight` is destination buffer. * @return : size read from `src` , or an error Code . * Note : Needed by HUF_readCTable() and HUF_readDTableXn() . */ -HUF_PUBLIC_API size_t HUF_readStats(BYTE* huffWeight, size_t hwSize, +size_t HUF_readStats(BYTE* huffWeight, size_t hwSize, U32* rankStats, U32* nbSymbolsPtr, U32* tableLogPtr, const void* src, size_t srcSize); @@ -220,20 +185,33 @@ HUF_PUBLIC_API size_t HUF_readStats(BYTE* huffWeight, size_t hwSize, */ #define HUF_READ_STATS_WORKSPACE_SIZE_U32 FSE_DECOMPRESS_WKSP_SIZE_U32(6, HUF_TABLELOG_MAX-1) #define HUF_READ_STATS_WORKSPACE_SIZE (HUF_READ_STATS_WORKSPACE_SIZE_U32 * sizeof(unsigned)) -HUF_PUBLIC_API size_t HUF_readStats_wksp(BYTE* huffWeight, size_t hwSize, +size_t HUF_readStats_wksp(BYTE* huffWeight, size_t hwSize, U32* rankStats, U32* nbSymbolsPtr, U32* tableLogPtr, const void* src, size_t srcSize, void* workspace, size_t wkspSize, - int bmi2); + int flags); /** HUF_readCTable() : * Loading a CTable saved with HUF_writeCTable() */ -HUF_PUBLIC_API size_t HUF_readCTable(HUF_CElt* CTable, unsigned* maxSymbolValuePtr, const void* src, size_t srcSize, unsigned *hasZeroWeights); +size_t HUF_readCTable (HUF_CElt* CTable, unsigned* maxSymbolValuePtr, const void* src, size_t srcSize, unsigned *hasZeroWeights); /** HUF_getNbBitsFromCTable() : * Read nbBits from CTable symbolTable, for symbol `symbolValue` presumed <= HUF_SYMBOLVALUE_MAX - * Note 1 : is not inlined, as HUF_CElt definition is private */ -HUF_PUBLIC_API U32 HUF_getNbBitsFromCTable(const HUF_CElt* symbolTable, U32 symbolValue); + * Note 1 : If symbolValue > HUF_readCTableHeader(symbolTable).maxSymbolValue, returns 0 + * Note 2 : is not inlined, as HUF_CElt definition is private + */ +U32 HUF_getNbBitsFromCTable(const HUF_CElt* symbolTable, U32 symbolValue); + +typedef struct { + BYTE tableLog; + BYTE maxSymbolValue; + BYTE unused[sizeof(size_t) - 2]; +} HUF_CTableHeader; + +/** HUF_readCTableHeader() : + * @returns The header from the CTable specifying the tableLog and the maxSymbolValue. + */ +HUF_CTableHeader HUF_readCTableHeader(HUF_CElt const* ctable); /* * HUF_decompress() does the following: @@ -247,7 +225,7 @@ HUF_PUBLIC_API U32 HUF_getNbBitsFromCTable(const HUF_CElt* symbolTable, U32 symb * based on a set of pre-computed metrics. * @return : 0==HUF_decompress4X1, 1==HUF_decompress4X2 . * Assumption : 0 < dstSize <= 128 KB */ -HUF_PUBLIC_API U32 HUF_selectDecoder(size_t dstSize, size_t cSrcSize); +U32 HUF_selectDecoder (size_t dstSize, size_t cSrcSize); /** * The minimum workspace size for the `workSpace` used in @@ -262,83 +240,47 @@ HUF_PUBLIC_API U32 HUF_selectDecoder(size_t dstSize, size_t cSrcSize); #define HUF_DECOMPRESS_WORKSPACE_SIZE ((2 << 10) + (1 << 9)) #define HUF_DECOMPRESS_WORKSPACE_SIZE_U32 (HUF_DECOMPRESS_WORKSPACE_SIZE / sizeof(U32)) -#ifndef HUF_FORCE_DECOMPRESS_X2 -HUF_PUBLIC_API size_t HUF_readDTableX1(HUF_DTable* DTable, const void* src, size_t srcSize); -HUF_PUBLIC_API size_t HUF_readDTableX1_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize); -#endif -#ifndef HUF_FORCE_DECOMPRESS_X1 -HUF_PUBLIC_API size_t HUF_readDTableX2(HUF_DTable* DTable, const void* src, size_t srcSize); -HUF_PUBLIC_API size_t HUF_readDTableX2_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize); -#endif - -HUF_PUBLIC_API size_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); -#ifndef HUF_FORCE_DECOMPRESS_X2 -HUF_PUBLIC_API size_t HUF_decompress4X1_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); -#endif -#ifndef HUF_FORCE_DECOMPRESS_X1 -HUF_PUBLIC_API size_t HUF_decompress4X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); -#endif - /* ====================== */ /* single stream variants */ /* ====================== */ -HUF_PUBLIC_API size_t HUF_compress1X(void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog); -HUF_PUBLIC_API size_t HUF_compress1X_wksp(void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize); /**< `workSpace` must be a table of at least HUF_WORKSPACE_SIZE_U64 U64 */ -HUF_PUBLIC_API size_t HUF_compress1X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable); -HUF_PUBLIC_API size_t HUF_compress1X_usingCTable_bmi2(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable, int bmi2); +size_t HUF_compress1X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable, int flags); /** HUF_compress1X_repeat() : * Same as HUF_compress1X_wksp(), but considers using hufTable if *repeat != HUF_repeat_none. * If it uses hufTable it does not modify hufTable or repeat. * If it doesn't, it sets *repeat = HUF_repeat_none, and it sets hufTable to the table used. * If preferRepeat then the old table will always be used if valid. * If suspectUncompressible then some sampling checks will be run to potentially skip huffman coding */ -HUF_PUBLIC_API size_t HUF_compress1X_repeat(void* dst, size_t dstSize, +size_t HUF_compress1X_repeat(void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize, /**< `workSpace` must be aligned on 4-bytes boundaries, `wkspSize` must be >= HUF_WORKSPACE_SIZE */ - HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat, int bmi2, unsigned suspectUncompressible); + HUF_CElt* hufTable, HUF_repeat* repeat, int flags); -HUF_PUBLIC_API size_t HUF_decompress1X1(void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /* single-symbol decoder */ +size_t HUF_decompress1X_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int flags); #ifndef HUF_FORCE_DECOMPRESS_X1 -HUF_PUBLIC_API size_t HUF_decompress1X2(void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /* double-symbol decoder */ -#endif - -HUF_PUBLIC_API size_t HUF_decompress1X_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); -HUF_PUBLIC_API size_t HUF_decompress1X_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); -#ifndef HUF_FORCE_DECOMPRESS_X2 -HUF_PUBLIC_API size_t HUF_decompress1X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< single-symbol decoder */ -HUF_PUBLIC_API size_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< single-symbol decoder */ -#endif -#ifndef HUF_FORCE_DECOMPRESS_X1 -HUF_PUBLIC_API size_t HUF_decompress1X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< double-symbols decoder */ -HUF_PUBLIC_API size_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< double-symbols decoder */ -#endif - -HUF_PUBLIC_API size_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); /**< automatic selection of sing or double symbol decoder, based on DTable */ -#ifndef HUF_FORCE_DECOMPRESS_X2 -HUF_PUBLIC_API size_t HUF_decompress1X1_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); -#endif -#ifndef HUF_FORCE_DECOMPRESS_X1 -HUF_PUBLIC_API size_t HUF_decompress1X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); +size_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int flags); /**< double-symbols decoder */ #endif /* BMI2 variants. * If the CPU has BMI2 support, pass bmi2=1, otherwise pass bmi2=0. */ -size_t HUF_decompress1X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2); +size_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int flags); #ifndef HUF_FORCE_DECOMPRESS_X2 -HUF_PUBLIC_API size_t HUF_decompress1X1_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2); +size_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int flags); #endif -HUF_PUBLIC_API size_t HUF_decompress4X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2); -size_t HUF_decompress4X_hufOnly_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2); +size_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int flags); +size_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int flags); #ifndef HUF_FORCE_DECOMPRESS_X2 -HUF_PUBLIC_API size_t HUF_readDTableX1_wksp_bmi2(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int bmi2); +size_t HUF_readDTableX1_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int flags); #endif #ifndef HUF_FORCE_DECOMPRESS_X1 -HUF_PUBLIC_API size_t HUF_readDTableX2_wksp_bmi2(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int bmi2); +size_t HUF_readDTableX2_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int flags); #endif -#endif /* HUF_STATIC_LINKING_ONLY */ +#endif /* HUF_H_298734234 */ +#if defined (__cplusplus) +} +#endif diff --git a/src/bled/huf_decompress.c b/src/bled/huf_decompress.c index 5a019c7d..d870f112 100644 --- a/src/bled/huf_decompress.c +++ b/src/bled/huf_decompress.c @@ -1,7 +1,7 @@ /* ****************************************************************** * huff0 huffman decoder, * part of Finite State Entropy library - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * * You can contact the author at : * - FSE+HUF source repository : https://github.com/Cyan4973/FiniteStateEntropy @@ -19,10 +19,10 @@ #include "zstd_compiler.h" #include "fse_bitstream.h" /* BIT_* */ #include "fse.h" /* to compress headers */ -#define HUF_STATIC_LINKING_ONLY #include "huf.h" #include "zstd_error_private.h" #include "zstd_internal.h" +#include "zstd_bits.h" /* ZSTD_highbit32, ZSTD_countTrailingZeros64 */ /* ************************************************************** * Constants @@ -34,6 +34,12 @@ * Macros ****************************************************************/ +#ifdef HUF_DISABLE_FAST_DECODE +# define HUF_ENABLE_FAST_DECODE 0 +#else +# define HUF_ENABLE_FAST_DECODE 1 +#endif + /* These two optional macros force the use one way or another of the two * Huffman decompression implementations. You can't force in both directions * at the same time. @@ -43,32 +49,29 @@ #error "Cannot force the use of the X1 and X2 decoders at the same time!" #endif -# define HUF_ASM_SUPPORTED 0 - -/* HUF_DISABLE_ASM: Disables all ASM implementations. */ -#define HUF_ENABLE_ASM_X86_64_BMI2 0 - -#if HUF_ENABLE_ASM_X86_64_BMI2 && DYNAMIC_BMI2 -# define HUF_ASM_X86_64_BMI2_ATTRS TARGET_ATTRIBUTE("bmi2") +/* When DYNAMIC_BMI2 is enabled, fast decoders are only called when bmi2 is + * supported at runtime, so we can add the BMI2 target attribute. + * When it is disabled, we will still get BMI2 if it is enabled statically. + */ +#if DYNAMIC_BMI2 +# define HUF_FAST_BMI2_ATTRS BMI2_TARGET_ATTRIBUTE #else -# define HUF_ASM_X86_64_BMI2_ATTRS +# define HUF_FAST_BMI2_ATTRS #endif -#define HUF_EXTERN_C +#ifdef __cplusplus +# define HUF_EXTERN_C extern "C" +#else +# define HUF_EXTERN_C +#endif #define HUF_ASM_DECL HUF_EXTERN_C -#if DYNAMIC_BMI2 || (HUF_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__)) +#if DYNAMIC_BMI2 # define HUF_NEED_BMI2_FUNCTION 1 #else # define HUF_NEED_BMI2_FUNCTION 0 #endif -#if !(HUF_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__)) -# define HUF_NEED_DEFAULT_FUNCTION 1 -#else -# define HUF_NEED_DEFAULT_FUNCTION 0 -#endif - /* ************************************************************** * Error Management ****************************************************************/ @@ -85,6 +88,11 @@ /* ************************************************************** * BMI2 Variant Wrappers ****************************************************************/ +typedef size_t (*HUF_DecompressUsingDTableFn)(void *dst, size_t dstSize, + const void *cSrc, + size_t cSrcSize, + const HUF_DTable *DTable); + #if DYNAMIC_BMI2 #define HUF_DGEN(fn) \ @@ -97,7 +105,7 @@ return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable); \ } \ \ - static TARGET_ATTRIBUTE("bmi2") size_t fn##_bmi2( \ + static BMI2_TARGET_ATTRIBUTE size_t fn##_bmi2( \ void* dst, size_t dstSize, \ const void* cSrc, size_t cSrcSize, \ const HUF_DTable* DTable) \ @@ -106,9 +114,9 @@ } \ \ static size_t fn(void* dst, size_t dstSize, void const* cSrc, \ - size_t cSrcSize, HUF_DTable const* DTable, int bmi2) \ + size_t cSrcSize, HUF_DTable const* DTable, int flags) \ { \ - if (bmi2) { \ + if (flags & HUF_flags_bmi2) { \ return fn##_bmi2(dst, dstSize, cSrc, cSrcSize, DTable); \ } \ return fn##_default(dst, dstSize, cSrc, cSrcSize, DTable); \ @@ -118,9 +126,9 @@ #define HUF_DGEN(fn) \ static size_t fn(void* dst, size_t dstSize, void const* cSrc, \ - size_t cSrcSize, HUF_DTable const* DTable, int bmi2) \ + size_t cSrcSize, HUF_DTable const* DTable, int flags) \ { \ - (void)bmi2; \ + (void)flags; \ return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable); \ } @@ -139,42 +147,66 @@ static DTableDesc HUF_getDTableDesc(const HUF_DTable* table) return dtd; } -#if HUF_ENABLE_ASM_X86_64_BMI2 - -static size_t HUF_initDStream(BYTE const* ip) { +static size_t HUF_initFastDStream(BYTE const* ip) { BYTE const lastByte = ip[7]; - size_t const bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0; + size_t const bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0; size_t const value = MEM_readLEST(ip) | 1; assert(bitsConsumed <= 8); + assert(sizeof(size_t) == 8); return value << bitsConsumed; } + + +/** + * The input/output arguments to the Huffman fast decoding loop: + * + * ip [in/out] - The input pointers, must be updated to reflect what is consumed. + * op [in/out] - The output pointers, must be updated to reflect what is written. + * bits [in/out] - The bitstream containers, must be updated to reflect the current state. + * dt [in] - The decoding table. + * ilowest [in] - The beginning of the valid range of the input. Decoders may read + * down to this pointer. It may be below iend[0]. + * oend [in] - The end of the output stream. op[3] must not cross oend. + * iend [in] - The end of each input stream. ip[i] may cross iend[i], + * as long as it is above ilowest, but that indicates corruption. + */ typedef struct { BYTE const* ip[4]; BYTE* op[4]; U64 bits[4]; void const* dt; - BYTE const* ilimit; + BYTE const* ilowest; BYTE* oend; BYTE const* iend[4]; -} HUF_DecompressAsmArgs; +} HUF_DecompressFastArgs; + +typedef void (*HUF_DecompressFastLoopFn)(HUF_DecompressFastArgs*); /** - * Initializes args for the asm decoding loop. - * @returns 0 on success - * 1 if the fallback implementation should be used. + * Initializes args for the fast decoding loop. + * @returns 1 on success + * 0 if the fallback implementation should be used. * Or an error code on failure. */ -static size_t HUF_DecompressAsmArgs_init(HUF_DecompressAsmArgs* args, void* dst, size_t dstSize, void const* src, size_t srcSize, const HUF_DTable* DTable) +static size_t HUF_DecompressFastArgs_init(HUF_DecompressFastArgs* args, void* dst, size_t dstSize, void const* src, size_t srcSize, const HUF_DTable* DTable) { void const* dt = DTable + 1; U32 const dtLog = HUF_getDTableDesc(DTable).tableLog; - const BYTE* const ilimit = (const BYTE*)src + 6 + 8; + const BYTE* const istart = (const BYTE*)src; - BYTE* const oend = (BYTE*)dst + dstSize; + BYTE* const oend = ZSTD_maybeNullPtrAdd((BYTE*)dst, dstSize); - /* We're assuming x86-64 BMI2 - assure that this is the case. */ - assert(MEM_isLittleEndian() && !MEM_32bits()); + /* The fast decoding loop assumes 64-bit little-endian. + * This condition is false on x32. + */ + if (!MEM_isLittleEndian() || MEM_32bits()) + return 0; + + /* Avoid nullptr addition */ + if (dstSize == 0) + return 0; + assert(dst != NULL); /* strict minimum : jump table + 1 byte per stream */ if (srcSize < 10) @@ -185,11 +217,10 @@ static size_t HUF_DecompressAsmArgs_init(HUF_DecompressAsmArgs* args, void* dst, * On small inputs we don't have enough data to trigger the fast loop, so use the old decoder. */ if (dtLog != HUF_DECODER_FAST_TABLELOG) - return 1; + return 0; /* Read the jump table. */ { - const BYTE* const istart = (const BYTE*)src; size_t const length1 = MEM_readLE16(istart); size_t const length2 = MEM_readLE16(istart+2); size_t const length3 = MEM_readLE16(istart+4); @@ -199,13 +230,11 @@ static size_t HUF_DecompressAsmArgs_init(HUF_DecompressAsmArgs* args, void* dst, args->iend[2] = args->iend[1] + length2; args->iend[3] = args->iend[2] + length3; - /* HUF_initDStream() requires this, and this small of an input + /* HUF_initFastDStream() requires this, and this small of an input * won't benefit from the ASM loop anyways. - * length1 must be >= 16 so that ip[0] >= ilimit before the loop - * starts. */ - if (length1 < 16 || length2 < 8 || length3 < 8 || length4 < 8) - return 1; + if (length1 < 8 || length2 < 8 || length3 < 8 || length4 < 8) + return 0; if (length4 > srcSize) return ERROR(corruption_detected); /* overflow */ } /* ip[] contains the position that is currently loaded into bits[]. */ @@ -222,7 +251,7 @@ static size_t HUF_DecompressAsmArgs_init(HUF_DecompressAsmArgs* args, void* dst, /* No point to call the ASM loop for tiny outputs. */ if (args->op[3] >= oend) - return 1; + return 0; /* bits[] is the bit container. * It is read from the MSB down to the LSB. @@ -231,24 +260,25 @@ static size_t HUF_DecompressAsmArgs_init(HUF_DecompressAsmArgs* args, void* dst, * set, so that CountTrailingZeros(bits[]) can be used * to count how many bits we've consumed. */ - args->bits[0] = HUF_initDStream(args->ip[0]); - args->bits[1] = HUF_initDStream(args->ip[1]); - args->bits[2] = HUF_initDStream(args->ip[2]); - args->bits[3] = HUF_initDStream(args->ip[3]); + args->bits[0] = HUF_initFastDStream(args->ip[0]); + args->bits[1] = HUF_initFastDStream(args->ip[1]); + args->bits[2] = HUF_initFastDStream(args->ip[2]); + args->bits[3] = HUF_initFastDStream(args->ip[3]); - /* If ip[] >= ilimit, it is guaranteed to be safe to - * reload bits[]. It may be beyond its section, but is - * guaranteed to be valid (>= istart). - */ - args->ilimit = ilimit; + /* The decoders must be sure to never read beyond ilowest. + * This is lower than iend[0], but allowing decoders to read + * down to ilowest can allow an extra iteration or two in the + * fast loop. + */ + args->ilowest = istart; args->oend = oend; args->dt = dt; - return 0; + return 1; } -static size_t HUF_initRemainingDStream(BIT_DStream_t* bit, HUF_DecompressAsmArgs const* args, int stream, BYTE* segmentEnd) +static size_t HUF_initRemainingDStream(BIT_DStream_t* bit, HUF_DecompressFastArgs const* args, int stream, BYTE* segmentEnd) { /* Validate that we haven't overwritten. */ if (args->op[stream] > segmentEnd) @@ -262,15 +292,33 @@ static size_t HUF_initRemainingDStream(BIT_DStream_t* bit, HUF_DecompressAsmArgs return ERROR(corruption_detected); /* Construct the BIT_DStream_t. */ - bit->bitContainer = MEM_readLE64(args->ip[stream]); - bit->bitsConsumed = ZSTD_countTrailingZeros((size_t)args->bits[stream]); - bit->start = (const char*)args->iend[0]; + assert(sizeof(size_t) == 8); + bit->bitContainer = MEM_readLEST(args->ip[stream]); + bit->bitsConsumed = ZSTD_countTrailingZeros64(args->bits[stream]); + bit->start = (const char*)args->ilowest; bit->limitPtr = bit->start + sizeof(size_t); bit->ptr = (const char*)args->ip[stream]; return 0; } -#endif + +/* Calls X(N) for each stream 0, 1, 2, 3. */ +#define HUF_4X_FOR_EACH_STREAM(X) \ + do { \ + X(0); \ + X(1); \ + X(2); \ + X(3); \ + } while (0) + +/* Calls X(N, var) for each stream 0, 1, 2, 3. */ +#define HUF_4X_FOR_EACH_STREAM_WITH_VAR(X, var) \ + do { \ + X(0, (var)); \ + X(1, (var)); \ + X(2, (var)); \ + X(3, (var)); \ + } while (0) #ifndef HUF_FORCE_DECOMPRESS_X2 @@ -287,10 +335,11 @@ typedef struct { BYTE nbBits; BYTE byte; } HUF_DEltX1; /* single-symbol decodi static U64 HUF_DEltX1_set4(BYTE symbol, BYTE nbBits) { U64 D4; if (MEM_isLittleEndian()) { - D4 = (symbol << 8) + nbBits; + D4 = (U64)((symbol << 8) + nbBits); } else { - D4 = symbol + (nbBits << 8); + D4 = (U64)(symbol + (nbBits << 8)); } + assert(D4 < (1U << 16)); D4 *= 0x0001000100010001ULL; return D4; } @@ -333,13 +382,7 @@ typedef struct { BYTE huffWeight[HUF_SYMBOLVALUE_MAX + 1]; } HUF_ReadDTableX1_Workspace; - -size_t HUF_readDTableX1_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize) -{ - return HUF_readDTableX1_wksp_bmi2(DTable, src, srcSize, workSpace, wkspSize, /* bmi2 */ 0); -} - -size_t HUF_readDTableX1_wksp_bmi2(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int bmi2) +size_t HUF_readDTableX1_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int flags) { U32 tableLog = 0; U32 nbSymbols = 0; @@ -354,7 +397,7 @@ size_t HUF_readDTableX1_wksp_bmi2(HUF_DTable* DTable, const void* src, size_t sr DEBUG_STATIC_ASSERT(sizeof(DTableDesc) == sizeof(HUF_DTable)); /* ZSTD_memset(huffWeight, 0, sizeof(huffWeight)); */ /* is not necessary, even though some analyzer complain ... */ - iSize = HUF_readStats_wksp(wksp->huffWeight, HUF_SYMBOLVALUE_MAX + 1, wksp->rankVal, &nbSymbols, &tableLog, src, srcSize, wksp->statsWksp, sizeof(wksp->statsWksp), bmi2); + iSize = HUF_readStats_wksp(wksp->huffWeight, HUF_SYMBOLVALUE_MAX + 1, wksp->rankVal, &nbSymbols, &tableLog, src, srcSize, wksp->statsWksp, sizeof(wksp->statsWksp), flags); if (HUF_isError(iSize)) return iSize; @@ -381,9 +424,8 @@ size_t HUF_readDTableX1_wksp_bmi2(HUF_DTable* DTable, const void* src, size_t sr * rankStart[0] is not filled because there are no entries in the table for * weight 0. */ - { - int n; - int nextRankStart = 0; + { int n; + U32 nextRankStart = 0; int const unroll = 4; int const nLimit = (int)nbSymbols - unroll + 1; for (n=0; n<(int)tableLog+1; n++) { @@ -406,14 +448,13 @@ size_t HUF_readDTableX1_wksp_bmi2(HUF_DTable* DTable, const void* src, size_t sr /* fill DTable * We fill all entries of each weight in order. - * That way length is a constant for each iteration of the outter loop. + * That way length is a constant for each iteration of the outer loop. * We can switch based on the length to a different inner loop which is * optimized for that particular case. */ - { - U32 w; - int symbol=wksp->rankVal[0]; - int rankStart=0; + { U32 w; + int symbol = wksp->rankVal[0]; + int rankStart = 0; for (w=1; w<tableLog+1; ++w) { int const symbolCount = wksp->rankVal[w]; int const length = (1 << w) >> 1; @@ -487,15 +528,19 @@ HUF_decodeSymbolX1(BIT_DStream_t* Dstream, const HUF_DEltX1* dt, const U32 dtLog } #define HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr) \ - *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog) + do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0) -#define HUF_DECODE_SYMBOLX1_1(ptr, DStreamPtr) \ - if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \ - HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr) +#define HUF_DECODE_SYMBOLX1_1(ptr, DStreamPtr) \ + do { \ + if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \ + HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \ + } while (0) -#define HUF_DECODE_SYMBOLX1_2(ptr, DStreamPtr) \ - if (MEM_64bits()) \ - HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr) +#define HUF_DECODE_SYMBOLX1_2(ptr, DStreamPtr) \ + do { \ + if (MEM_64bits()) \ + HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \ + } while (0) HINT_INLINE size_t HUF_decodeStreamX1(BYTE* p, BIT_DStream_t* const bitDPtr, BYTE* const pEnd, const HUF_DEltX1* const dt, const U32 dtLog) @@ -510,6 +555,8 @@ HUF_decodeStreamX1(BYTE* p, BIT_DStream_t* const bitDPtr, BYTE* const pEnd, cons HUF_DECODE_SYMBOLX1_2(p, bitDPtr); HUF_DECODE_SYMBOLX1_0(p, bitDPtr); } + } else { + BIT_reloadDStream(bitDPtr); } /* [0-3] symbols remaining */ @@ -521,7 +568,7 @@ HUF_decodeStreamX1(BYTE* p, BIT_DStream_t* const bitDPtr, BYTE* const pEnd, cons while (p < pEnd) HUF_DECODE_SYMBOLX1_0(p, bitDPtr); - return pEnd-pStart; + return (size_t)(pEnd-pStart); } FORCE_INLINE_TEMPLATE size_t @@ -531,7 +578,7 @@ HUF_decompress1X1_usingDTable_internal_body( const HUF_DTable* DTable) { BYTE* op = (BYTE*)dst; - BYTE* const oend = op + dstSize; + BYTE* const oend = ZSTD_maybeNullPtrAdd(op, dstSize); const void* dtPtr = DTable + 1; const HUF_DEltX1* const dt = (const HUF_DEltX1*)dtPtr; BIT_DStream_t bitD; @@ -547,6 +594,10 @@ HUF_decompress1X1_usingDTable_internal_body( return dstSize; } +/* HUF_decompress4X1_usingDTable_internal_body(): + * Conditions : + * @dstSize >= 6 + */ FORCE_INLINE_TEMPLATE size_t HUF_decompress4X1_usingDTable_internal_body( void* dst, size_t dstSize, @@ -555,6 +606,7 @@ HUF_decompress4X1_usingDTable_internal_body( { /* Check */ if (cSrcSize < 10) return ERROR(corruption_detected); /* strict minimum : jump table + 1 byte per stream */ + if (dstSize < 6) return ERROR(corruption_detected); /* stream 4-split doesn't work */ { const BYTE* const istart = (const BYTE*) cSrc; BYTE* const ostart = (BYTE*) dst; @@ -590,6 +642,7 @@ HUF_decompress4X1_usingDTable_internal_body( if (length4 > cSrcSize) return ERROR(corruption_detected); /* overflow */ if (opStart4 > oend) return ERROR(corruption_detected); /* overflow */ + assert(dstSize >= 6); /* validated above */ CHECK_F( BIT_initDStream(&bitD1, istart1, length1) ); CHECK_F( BIT_initDStream(&bitD2, istart2, length2) ); CHECK_F( BIT_initDStream(&bitD3, istart3, length3) ); @@ -645,59 +698,180 @@ HUF_decompress4X1_usingDTable_internal_body( } #if HUF_NEED_BMI2_FUNCTION -static TARGET_ATTRIBUTE("bmi2") +static BMI2_TARGET_ATTRIBUTE size_t HUF_decompress4X1_usingDTable_internal_bmi2(void* dst, size_t dstSize, void const* cSrc, size_t cSrcSize, HUF_DTable const* DTable) { return HUF_decompress4X1_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable); } #endif -#if HUF_NEED_DEFAULT_FUNCTION static size_t HUF_decompress4X1_usingDTable_internal_default(void* dst, size_t dstSize, void const* cSrc, size_t cSrcSize, HUF_DTable const* DTable) { return HUF_decompress4X1_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable); } + +#if ZSTD_ENABLE_ASM_X86_64_BMI2 + +HUF_ASM_DECL void HUF_decompress4X1_usingDTable_internal_fast_asm_loop(HUF_DecompressFastArgs* args) ZSTDLIB_HIDDEN; + #endif -#if HUF_ENABLE_ASM_X86_64_BMI2 - -HUF_ASM_DECL void HUF_decompress4X1_usingDTable_internal_bmi2_asm_loop(HUF_DecompressAsmArgs* args); - -static HUF_ASM_X86_64_BMI2_ATTRS -size_t -HUF_decompress4X1_usingDTable_internal_bmi2_asm( - void* dst, size_t dstSize, - const void* cSrc, size_t cSrcSize, - const HUF_DTable* DTable) +static HUF_FAST_BMI2_ATTRS +void HUF_decompress4X1_usingDTable_internal_fast_c_loop(HUF_DecompressFastArgs* args) { - void const* dt = DTable + 1; - const BYTE* const iend = (const BYTE*)cSrc + 6; - BYTE* const oend = (BYTE*)dst + dstSize; - HUF_DecompressAsmArgs args; - { - size_t const ret = HUF_DecompressAsmArgs_init(&args, dst, dstSize, cSrc, cSrcSize, DTable); - FORWARD_IF_ERROR(ret, "Failed to init asm args"); - if (ret != 0) - return HUF_decompress4X1_usingDTable_internal_bmi2(dst, dstSize, cSrc, cSrcSize, DTable); + U64 bits[4]; + BYTE const* ip[4]; + BYTE* op[4]; + U16 const* const dtable = (U16 const*)args->dt; + BYTE* const oend = args->oend; + BYTE const* const ilowest = args->ilowest; + + /* Copy the arguments to local variables */ + ZSTD_memcpy(&bits, &args->bits, sizeof(bits)); + ZSTD_memcpy((void*)(&ip), &args->ip, sizeof(ip)); + ZSTD_memcpy(&op, &args->op, sizeof(op)); + + assert(MEM_isLittleEndian()); + assert(!MEM_32bits()); + + for (;;) { + BYTE* olimit; + int stream; + + /* Assert loop preconditions */ +#ifndef NDEBUG + for (stream = 0; stream < 4; ++stream) { + assert(op[stream] <= (stream == 3 ? oend : op[stream + 1])); + assert(ip[stream] >= ilowest); + } +#endif + /* Compute olimit */ + { + /* Each iteration produces 5 output symbols per stream */ + size_t const oiters = (size_t)(oend - op[3]) / 5; + /* Each iteration consumes up to 11 bits * 5 = 55 bits < 7 bytes + * per stream. + */ + size_t const iiters = (size_t)(ip[0] - ilowest) / 7; + /* We can safely run iters iterations before running bounds checks */ + size_t const iters = MIN(oiters, iiters); + size_t const symbols = iters * 5; + + /* We can simply check that op[3] < olimit, instead of checking all + * of our bounds, since we can't hit the other bounds until we've run + * iters iterations, which only happens when op[3] == olimit. + */ + olimit = op[3] + symbols; + + /* Exit fast decoding loop once we reach the end. */ + if (op[3] == olimit) + break; + + /* Exit the decoding loop if any input pointer has crossed the + * previous one. This indicates corruption, and a precondition + * to our loop is that ip[i] >= ip[0]. + */ + for (stream = 1; stream < 4; ++stream) { + if (ip[stream] < ip[stream - 1]) + goto _out; + } + } + +#ifndef NDEBUG + for (stream = 1; stream < 4; ++stream) { + assert(ip[stream] >= ip[stream - 1]); + } +#endif + +#define HUF_4X1_DECODE_SYMBOL(_stream, _symbol) \ + do { \ + int const index = (int)(bits[(_stream)] >> 53); \ + int const entry = (int)dtable[index]; \ + bits[(_stream)] <<= (entry & 0x3F); \ + op[(_stream)][(_symbol)] = (BYTE)((entry >> 8) & 0xFF); \ + } while (0) + +#define HUF_4X1_RELOAD_STREAM(_stream) \ + do { \ + int const ctz = ZSTD_countTrailingZeros64(bits[(_stream)]); \ + int const nbBits = ctz & 7; \ + int const nbBytes = ctz >> 3; \ + op[(_stream)] += 5; \ + ip[(_stream)] -= nbBytes; \ + bits[(_stream)] = MEM_read64(ip[(_stream)]) | 1; \ + bits[(_stream)] <<= nbBits; \ + } while (0) + + /* Manually unroll the loop because compilers don't consistently + * unroll the inner loops, which destroys performance. + */ + do { + /* Decode 5 symbols in each of the 4 streams */ + HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X1_DECODE_SYMBOL, 0); + HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X1_DECODE_SYMBOL, 1); + HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X1_DECODE_SYMBOL, 2); + HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X1_DECODE_SYMBOL, 3); + HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X1_DECODE_SYMBOL, 4); + + /* Reload each of the 4 the bitstreams */ + HUF_4X_FOR_EACH_STREAM(HUF_4X1_RELOAD_STREAM); + } while (op[3] < olimit); + +#undef HUF_4X1_DECODE_SYMBOL +#undef HUF_4X1_RELOAD_STREAM } - assert(args.ip[0] >= args.ilimit); - HUF_decompress4X1_usingDTable_internal_bmi2_asm_loop(&args); +_out: - /* Our loop guarantees that ip[] >= ilimit and that we haven't + /* Save the final values of each of the state variables back to args. */ + ZSTD_memcpy(&args->bits, &bits, sizeof(bits)); + ZSTD_memcpy((void*)(&args->ip), &ip, sizeof(ip)); + ZSTD_memcpy(&args->op, &op, sizeof(op)); +} + +/** + * @returns @p dstSize on success (>= 6) + * 0 if the fallback implementation should be used + * An error if an error occurred + */ +static HUF_FAST_BMI2_ATTRS +size_t +HUF_decompress4X1_usingDTable_internal_fast( + void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + const HUF_DTable* DTable, + HUF_DecompressFastLoopFn loopFn) +{ + void const* dt = DTable + 1; + BYTE const* const ilowest = (BYTE const*)cSrc; + BYTE* const oend = ZSTD_maybeNullPtrAdd((BYTE*)dst, dstSize); + HUF_DecompressFastArgs args; + { size_t const ret = HUF_DecompressFastArgs_init(&args, dst, dstSize, cSrc, cSrcSize, DTable); + FORWARD_IF_ERROR(ret, "Failed to init fast loop args"); + if (ret == 0) + return 0; + } + + assert(args.ip[0] >= args.ilowest); + loopFn(&args); + + /* Our loop guarantees that ip[] >= ilowest and that we haven't * overwritten any op[]. */ - assert(args.ip[0] >= iend); - assert(args.ip[1] >= iend); - assert(args.ip[2] >= iend); - assert(args.ip[3] >= iend); + assert(args.ip[0] >= ilowest); + assert(args.ip[0] >= ilowest); + assert(args.ip[1] >= ilowest); + assert(args.ip[2] >= ilowest); + assert(args.ip[3] >= ilowest); assert(args.op[3] <= oend); - (void)iend; + + assert(ilowest == args.ilowest); + assert(ilowest + 6 == args.iend[0]); + (void)ilowest; /* finish bit streams one by one. */ - { - size_t const segmentSize = (dstSize+3) / 4; + { size_t const segmentSize = (dstSize+3) / 4; BYTE* segmentEnd = (BYTE*)dst; int i; for (i = 0; i < 4; ++i) { @@ -714,97 +888,59 @@ HUF_decompress4X1_usingDTable_internal_bmi2_asm( } /* decoded size */ + assert(dstSize != 0); return dstSize; } -#endif /* HUF_ENABLE_ASM_X86_64_BMI2 */ - -typedef size_t (*HUF_decompress_usingDTable_t)(void *dst, size_t dstSize, - const void *cSrc, - size_t cSrcSize, - const HUF_DTable *DTable); HUF_DGEN(HUF_decompress1X1_usingDTable_internal) static size_t HUF_decompress4X1_usingDTable_internal(void* dst, size_t dstSize, void const* cSrc, - size_t cSrcSize, HUF_DTable const* DTable, int bmi2) + size_t cSrcSize, HUF_DTable const* DTable, int flags) { + HUF_DecompressUsingDTableFn fallbackFn = HUF_decompress4X1_usingDTable_internal_default; + HUF_DecompressFastLoopFn loopFn = HUF_decompress4X1_usingDTable_internal_fast_c_loop; + #if DYNAMIC_BMI2 - if (bmi2) { -# if HUF_ENABLE_ASM_X86_64_BMI2 - return HUF_decompress4X1_usingDTable_internal_bmi2_asm(dst, dstSize, cSrc, cSrcSize, DTable); -# else - return HUF_decompress4X1_usingDTable_internal_bmi2(dst, dstSize, cSrc, cSrcSize, DTable); + if (flags & HUF_flags_bmi2) { + fallbackFn = HUF_decompress4X1_usingDTable_internal_bmi2; +# if ZSTD_ENABLE_ASM_X86_64_BMI2 + if (!(flags & HUF_flags_disableAsm)) { + loopFn = HUF_decompress4X1_usingDTable_internal_fast_asm_loop; + } # endif + } else { + return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable); } -#else - (void)bmi2; #endif -#if HUF_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__) - return HUF_decompress4X1_usingDTable_internal_bmi2_asm(dst, dstSize, cSrc, cSrcSize, DTable); -#else - return HUF_decompress4X1_usingDTable_internal_default(dst, dstSize, cSrc, cSrcSize, DTable); +#if ZSTD_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__) + if (!(flags & HUF_flags_disableAsm)) { + loopFn = HUF_decompress4X1_usingDTable_internal_fast_asm_loop; + } #endif + + if (HUF_ENABLE_FAST_DECODE && !(flags & HUF_flags_disableFast)) { + size_t const ret = HUF_decompress4X1_usingDTable_internal_fast(dst, dstSize, cSrc, cSrcSize, DTable, loopFn); + if (ret != 0) + return ret; + } + return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable); } - -size_t HUF_decompress1X1_usingDTable( - void* dst, size_t dstSize, - const void* cSrc, size_t cSrcSize, - const HUF_DTable* DTable) -{ - DTableDesc dtd = HUF_getDTableDesc(DTable); - if (dtd.tableType != 0) return ERROR(GENERIC); - return HUF_decompress1X1_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); -} - -size_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* DCtx, void* dst, size_t dstSize, +static size_t HUF_decompress4X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, - void* workSpace, size_t wkspSize) + void* workSpace, size_t wkspSize, int flags) { const BYTE* ip = (const BYTE*) cSrc; - size_t const hSize = HUF_readDTableX1_wksp(DCtx, cSrc, cSrcSize, workSpace, wkspSize); + size_t const hSize = HUF_readDTableX1_wksp(dctx, cSrc, cSrcSize, workSpace, wkspSize, flags); if (HUF_isError(hSize)) return hSize; if (hSize >= cSrcSize) return ERROR(srcSize_wrong); ip += hSize; cSrcSize -= hSize; - return HUF_decompress1X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, DCtx, /* bmi2 */ 0); + return HUF_decompress4X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, flags); } - -size_t HUF_decompress4X1_usingDTable( - void* dst, size_t dstSize, - const void* cSrc, size_t cSrcSize, - const HUF_DTable* DTable) -{ - DTableDesc dtd = HUF_getDTableDesc(DTable); - if (dtd.tableType != 0) return ERROR(GENERIC); - return HUF_decompress4X1_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); -} - -static size_t HUF_decompress4X1_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, - const void* cSrc, size_t cSrcSize, - void* workSpace, size_t wkspSize, int bmi2) -{ - const BYTE* ip = (const BYTE*) cSrc; - - size_t const hSize = HUF_readDTableX1_wksp_bmi2(dctx, cSrc, cSrcSize, workSpace, wkspSize, bmi2); - if (HUF_isError(hSize)) return hSize; - if (hSize >= cSrcSize) return ERROR(srcSize_wrong); - ip += hSize; cSrcSize -= hSize; - - return HUF_decompress4X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, bmi2); -} - -size_t HUF_decompress4X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, - const void* cSrc, size_t cSrcSize, - void* workSpace, size_t wkspSize) -{ - return HUF_decompress4X1_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, 0); -} - - #endif /* HUF_FORCE_DECOMPRESS_X2 */ @@ -987,7 +1123,7 @@ static void HUF_fillDTableX2Level2(HUF_DEltX2* DTable, U32 targetLog, const U32 static void HUF_fillDTableX2(HUF_DEltX2* DTable, const U32 targetLog, const sortedSymbol_t* sortedList, - const U32* rankStart, rankVal_t rankValOrigin, const U32 maxWeight, + const U32* rankStart, rankValCol_t* rankValOrigin, const U32 maxWeight, const U32 nbBitsBaseline) { U32* const rankVal = rankValOrigin[0]; @@ -1042,14 +1178,7 @@ typedef struct { size_t HUF_readDTableX2_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, - void* workSpace, size_t wkspSize) -{ - return HUF_readDTableX2_wksp_bmi2(DTable, src, srcSize, workSpace, wkspSize, /* bmi2 */ 0); -} - -size_t HUF_readDTableX2_wksp_bmi2(HUF_DTable* DTable, - const void* src, size_t srcSize, - void* workSpace, size_t wkspSize, int bmi2) + void* workSpace, size_t wkspSize, int flags) { U32 tableLog, maxW, nbSymbols; DTableDesc dtd = HUF_getDTableDesc(DTable); @@ -1071,7 +1200,7 @@ size_t HUF_readDTableX2_wksp_bmi2(HUF_DTable* DTable, if (maxTableLog > HUF_TABLELOG_MAX) return ERROR(tableLog_tooLarge); /* ZSTD_memset(weightList, 0, sizeof(weightList)); */ /* is not necessary, even though some analyzer complain ... */ - iSize = HUF_readStats_wksp(wksp->weightList, HUF_SYMBOLVALUE_MAX + 1, wksp->rankStats, &nbSymbols, &tableLog, src, srcSize, wksp->calleeWksp, sizeof(wksp->calleeWksp), bmi2); + iSize = HUF_readStats_wksp(wksp->weightList, HUF_SYMBOLVALUE_MAX + 1, wksp->rankStats, &nbSymbols, &tableLog, src, srcSize, wksp->calleeWksp, sizeof(wksp->calleeWksp), flags); if (HUF_isError(iSize)) return iSize; /* check result */ @@ -1121,17 +1250,10 @@ size_t HUF_readDTableX2_wksp_bmi2(HUF_DTable* DTable, rankValPtr[w] = rankVal0[w] >> consumed; } } } } -#if defined(__GNUC__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstringop-overflow" -#endif HUF_fillDTableX2(dt, maxTableLog, wksp->sortedSymbol, wksp->rankStart0, wksp->rankVal, maxW, tableLog+1); -#if defined(__GNUC__) -#pragma GCC diagnostic pop -#endif dtd.tableLog = (BYTE)maxTableLog; dtd.tableType = 1; @@ -1168,15 +1290,19 @@ HUF_decodeLastSymbolX2(void* op, BIT_DStream_t* DStream, const HUF_DEltX2* dt, c } #define HUF_DECODE_SYMBOLX2_0(ptr, DStreamPtr) \ - ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog) + do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0) -#define HUF_DECODE_SYMBOLX2_1(ptr, DStreamPtr) \ - if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \ - ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog) +#define HUF_DECODE_SYMBOLX2_1(ptr, DStreamPtr) \ + do { \ + if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \ + ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \ + } while (0) -#define HUF_DECODE_SYMBOLX2_2(ptr, DStreamPtr) \ - if (MEM_64bits()) \ - ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog) +#define HUF_DECODE_SYMBOLX2_2(ptr, DStreamPtr) \ + do { \ + if (MEM_64bits()) \ + ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \ + } while (0) HINT_INLINE size_t HUF_decodeStreamX2(BYTE* p, BIT_DStream_t* bitDPtr, BYTE* const pEnd, @@ -1204,6 +1330,8 @@ HUF_decodeStreamX2(BYTE* p, BIT_DStream_t* bitDPtr, BYTE* const pEnd, HUF_DECODE_SYMBOLX2_0(p, bitDPtr); } } + } else { + BIT_reloadDStream(bitDPtr); } /* closer to end : up to 2 symbols at a time */ @@ -1234,7 +1362,7 @@ HUF_decompress1X2_usingDTable_internal_body( /* decode */ { BYTE* const ostart = (BYTE*) dst; - BYTE* const oend = ostart + dstSize; + BYTE* const oend = ZSTD_maybeNullPtrAdd(ostart, dstSize); const void* const dtPtr = DTable+1; /* force compiler to not use strict-aliasing */ const HUF_DEltX2* const dt = (const HUF_DEltX2*)dtPtr; DTableDesc const dtd = HUF_getDTableDesc(DTable); @@ -1247,6 +1375,11 @@ HUF_decompress1X2_usingDTable_internal_body( /* decoded size */ return dstSize; } + +/* HUF_decompress4X2_usingDTable_internal_body(): + * Conditions: + * @dstSize >= 6 + */ FORCE_INLINE_TEMPLATE size_t HUF_decompress4X2_usingDTable_internal_body( void* dst, size_t dstSize, @@ -1254,6 +1387,7 @@ HUF_decompress4X2_usingDTable_internal_body( const HUF_DTable* DTable) { if (cSrcSize < 10) return ERROR(corruption_detected); /* strict minimum : jump table + 1 byte per stream */ + if (dstSize < 6) return ERROR(corruption_detected); /* stream 4-split doesn't work */ { const BYTE* const istart = (const BYTE*) cSrc; BYTE* const ostart = (BYTE*) dst; @@ -1287,8 +1421,9 @@ HUF_decompress4X2_usingDTable_internal_body( DTableDesc const dtd = HUF_getDTableDesc(DTable); U32 const dtLog = dtd.tableLog; - if (length4 > cSrcSize) return ERROR(corruption_detected); /* overflow */ - if (opStart4 > oend) return ERROR(corruption_detected); /* overflow */ + if (length4 > cSrcSize) return ERROR(corruption_detected); /* overflow */ + if (opStart4 > oend) return ERROR(corruption_detected); /* overflow */ + assert(dstSize >= 6 /* validated above */); CHECK_F( BIT_initDStream(&bitD1, istart1, length1) ); CHECK_F( BIT_initDStream(&bitD2, istart2, length2) ); CHECK_F( BIT_initDStream(&bitD3, istart3, length3) ); @@ -1335,7 +1470,7 @@ HUF_decompress4X2_usingDTable_internal_body( HUF_DECODE_SYMBOLX2_0(op2, &bitD2); HUF_DECODE_SYMBOLX2_0(op3, &bitD3); HUF_DECODE_SYMBOLX2_0(op4, &bitD4); - endSignal = (U32)LIKELY( + endSignal = (U32)LIKELY((U32) (BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished) & (BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished) & (BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished) @@ -1366,51 +1501,198 @@ HUF_decompress4X2_usingDTable_internal_body( } #if HUF_NEED_BMI2_FUNCTION -static TARGET_ATTRIBUTE("bmi2") +static BMI2_TARGET_ATTRIBUTE size_t HUF_decompress4X2_usingDTable_internal_bmi2(void* dst, size_t dstSize, void const* cSrc, size_t cSrcSize, HUF_DTable const* DTable) { return HUF_decompress4X2_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable); } #endif -#if HUF_NEED_DEFAULT_FUNCTION static size_t HUF_decompress4X2_usingDTable_internal_default(void* dst, size_t dstSize, void const* cSrc, size_t cSrcSize, HUF_DTable const* DTable) { return HUF_decompress4X2_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable); } + +#if ZSTD_ENABLE_ASM_X86_64_BMI2 + +HUF_ASM_DECL void HUF_decompress4X2_usingDTable_internal_fast_asm_loop(HUF_DecompressFastArgs* args) ZSTDLIB_HIDDEN; + #endif -#if HUF_ENABLE_ASM_X86_64_BMI2 +static HUF_FAST_BMI2_ATTRS +void HUF_decompress4X2_usingDTable_internal_fast_c_loop(HUF_DecompressFastArgs* args) +{ + U64 bits[4]; + BYTE const* ip[4]; + BYTE* op[4]; + BYTE* oend[4]; + HUF_DEltX2 const* const dtable = (HUF_DEltX2 const*)args->dt; + BYTE const* const ilowest = args->ilowest; -HUF_ASM_DECL void HUF_decompress4X2_usingDTable_internal_bmi2_asm_loop(HUF_DecompressAsmArgs* args); + /* Copy the arguments to local registers. */ + ZSTD_memcpy(&bits, &args->bits, sizeof(bits)); + ZSTD_memcpy((void*)(&ip), &args->ip, sizeof(ip)); + ZSTD_memcpy(&op, &args->op, sizeof(op)); -static HUF_ASM_X86_64_BMI2_ATTRS size_t -HUF_decompress4X2_usingDTable_internal_bmi2_asm( - void* dst, size_t dstSize, - const void* cSrc, size_t cSrcSize, - const HUF_DTable* DTable) { - void const* dt = DTable + 1; - const BYTE* const iend = (const BYTE*)cSrc + 6; - BYTE* const oend = (BYTE*)dst + dstSize; - HUF_DecompressAsmArgs args; - { - size_t const ret = HUF_DecompressAsmArgs_init(&args, dst, dstSize, cSrc, cSrcSize, DTable); - FORWARD_IF_ERROR(ret, "Failed to init asm args"); - if (ret != 0) - return HUF_decompress4X2_usingDTable_internal_bmi2(dst, dstSize, cSrc, cSrcSize, DTable); + oend[0] = op[1]; + oend[1] = op[2]; + oend[2] = op[3]; + oend[3] = args->oend; + + assert(MEM_isLittleEndian()); + assert(!MEM_32bits()); + + for (;;) { + BYTE* olimit; + int stream; + + /* Assert loop preconditions */ +#ifndef NDEBUG + for (stream = 0; stream < 4; ++stream) { + assert(op[stream] <= oend[stream]); + assert(ip[stream] >= ilowest); + } +#endif + /* Compute olimit */ + { + /* Each loop does 5 table lookups for each of the 4 streams. + * Each table lookup consumes up to 11 bits of input, and produces + * up to 2 bytes of output. + */ + /* We can consume up to 7 bytes of input per iteration per stream. + * We also know that each input pointer is >= ip[0]. So we can run + * iters loops before running out of input. + */ + size_t iters = (size_t)(ip[0] - ilowest) / 7; + /* Each iteration can produce up to 10 bytes of output per stream. + * Each output stream my advance at different rates. So take the + * minimum number of safe iterations among all the output streams. + */ + for (stream = 0; stream < 4; ++stream) { + size_t const oiters = (size_t)(oend[stream] - op[stream]) / 10; + iters = MIN(iters, oiters); + } + + /* Each iteration produces at least 5 output symbols. So until + * op[3] crosses olimit, we know we haven't executed iters + * iterations yet. This saves us maintaining an iters counter, + * at the expense of computing the remaining # of iterations + * more frequently. + */ + olimit = op[3] + (iters * 5); + + /* Exit the fast decoding loop once we reach the end. */ + if (op[3] == olimit) + break; + + /* Exit the decoding loop if any input pointer has crossed the + * previous one. This indicates corruption, and a precondition + * to our loop is that ip[i] >= ip[0]. + */ + for (stream = 1; stream < 4; ++stream) { + if (ip[stream] < ip[stream - 1]) + goto _out; + } + } + +#ifndef NDEBUG + for (stream = 1; stream < 4; ++stream) { + assert(ip[stream] >= ip[stream - 1]); + } +#endif + +#define HUF_4X2_DECODE_SYMBOL(_stream, _decode3) \ + do { \ + if ((_decode3) || (_stream) != 3) { \ + int const index = (int)(bits[(_stream)] >> 53); \ + HUF_DEltX2 const entry = dtable[index]; \ + MEM_write16(op[(_stream)], entry.sequence); \ + bits[(_stream)] <<= (entry.nbBits) & 0x3F; \ + op[(_stream)] += (entry.length); \ + } \ + } while (0) + +#define HUF_4X2_RELOAD_STREAM(_stream) \ + do { \ + HUF_4X2_DECODE_SYMBOL(3, 1); \ + { \ + int const ctz = ZSTD_countTrailingZeros64(bits[(_stream)]); \ + int const nbBits = ctz & 7; \ + int const nbBytes = ctz >> 3; \ + ip[(_stream)] -= nbBytes; \ + bits[(_stream)] = MEM_read64(ip[(_stream)]) | 1; \ + bits[(_stream)] <<= nbBits; \ + } \ + } while (0) + + /* Manually unroll the loop because compilers don't consistently + * unroll the inner loops, which destroys performance. + */ + do { + /* Decode 5 symbols from each of the first 3 streams. + * The final stream will be decoded during the reload phase + * to reduce register pressure. + */ + HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X2_DECODE_SYMBOL, 0); + HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X2_DECODE_SYMBOL, 0); + HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X2_DECODE_SYMBOL, 0); + HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X2_DECODE_SYMBOL, 0); + HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X2_DECODE_SYMBOL, 0); + + /* Decode one symbol from the final stream */ + HUF_4X2_DECODE_SYMBOL(3, 1); + + /* Decode 4 symbols from the final stream & reload bitstreams. + * The final stream is reloaded last, meaning that all 5 symbols + * are decoded from the final stream before it is reloaded. + */ + HUF_4X_FOR_EACH_STREAM(HUF_4X2_RELOAD_STREAM); + } while (op[3] < olimit); } - assert(args.ip[0] >= args.ilimit); - HUF_decompress4X2_usingDTable_internal_bmi2_asm_loop(&args); +#undef HUF_4X2_DECODE_SYMBOL +#undef HUF_4X2_RELOAD_STREAM + +_out: + + /* Save the final values of each of the state variables back to args. */ + ZSTD_memcpy(&args->bits, &bits, sizeof(bits)); + ZSTD_memcpy((void*)(&args->ip), &ip, sizeof(ip)); + ZSTD_memcpy(&args->op, &op, sizeof(op)); +} + + +static HUF_FAST_BMI2_ATTRS size_t +HUF_decompress4X2_usingDTable_internal_fast( + void* dst, size_t dstSize, + const void* cSrc, size_t cSrcSize, + const HUF_DTable* DTable, + HUF_DecompressFastLoopFn loopFn) { + void const* dt = DTable + 1; + const BYTE* const ilowest = (const BYTE*)cSrc; + BYTE* const oend = ZSTD_maybeNullPtrAdd((BYTE*)dst, dstSize); + HUF_DecompressFastArgs args; + { + size_t const ret = HUF_DecompressFastArgs_init(&args, dst, dstSize, cSrc, cSrcSize, DTable); + FORWARD_IF_ERROR(ret, "Failed to init asm args"); + if (ret == 0) + return 0; + } + + assert(args.ip[0] >= args.ilowest); + loopFn(&args); /* note : op4 already verified within main loop */ - assert(args.ip[0] >= iend); - assert(args.ip[1] >= iend); - assert(args.ip[2] >= iend); - assert(args.ip[3] >= iend); + assert(args.ip[0] >= ilowest); + assert(args.ip[1] >= ilowest); + assert(args.ip[2] >= ilowest); + assert(args.ip[3] >= ilowest); assert(args.op[3] <= oend); - (void)iend; + + assert(ilowest == args.ilowest); + assert(ilowest + 6 == args.iend[0]); + (void)ilowest; /* finish bitStreams one by one */ { @@ -1433,91 +1715,72 @@ HUF_decompress4X2_usingDTable_internal_bmi2_asm( /* decoded size */ return dstSize; } -#endif /* HUF_ENABLE_ASM_X86_64_BMI2 */ static size_t HUF_decompress4X2_usingDTable_internal(void* dst, size_t dstSize, void const* cSrc, - size_t cSrcSize, HUF_DTable const* DTable, int bmi2) + size_t cSrcSize, HUF_DTable const* DTable, int flags) { + HUF_DecompressUsingDTableFn fallbackFn = HUF_decompress4X2_usingDTable_internal_default; + HUF_DecompressFastLoopFn loopFn = HUF_decompress4X2_usingDTable_internal_fast_c_loop; + #if DYNAMIC_BMI2 - if (bmi2) { -# if HUF_ENABLE_ASM_X86_64_BMI2 - return HUF_decompress4X2_usingDTable_internal_bmi2_asm(dst, dstSize, cSrc, cSrcSize, DTable); -# else - return HUF_decompress4X2_usingDTable_internal_bmi2(dst, dstSize, cSrc, cSrcSize, DTable); + if (flags & HUF_flags_bmi2) { + fallbackFn = HUF_decompress4X2_usingDTable_internal_bmi2; +# if ZSTD_ENABLE_ASM_X86_64_BMI2 + if (!(flags & HUF_flags_disableAsm)) { + loopFn = HUF_decompress4X2_usingDTable_internal_fast_asm_loop; + } # endif + } else { + return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable); } -#else - (void)bmi2; #endif -#if HUF_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__) - return HUF_decompress4X2_usingDTable_internal_bmi2_asm(dst, dstSize, cSrc, cSrcSize, DTable); -#else - return HUF_decompress4X2_usingDTable_internal_default(dst, dstSize, cSrc, cSrcSize, DTable); +#if ZSTD_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__) + if (!(flags & HUF_flags_disableAsm)) { + loopFn = HUF_decompress4X2_usingDTable_internal_fast_asm_loop; + } #endif + + if (HUF_ENABLE_FAST_DECODE && !(flags & HUF_flags_disableFast)) { + size_t const ret = HUF_decompress4X2_usingDTable_internal_fast(dst, dstSize, cSrc, cSrcSize, DTable, loopFn); + if (ret != 0) + return ret; + } + return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable); } HUF_DGEN(HUF_decompress1X2_usingDTable_internal) -size_t HUF_decompress1X2_usingDTable( - void* dst, size_t dstSize, - const void* cSrc, size_t cSrcSize, - const HUF_DTable* DTable) -{ - DTableDesc dtd = HUF_getDTableDesc(DTable); - if (dtd.tableType != 1) return ERROR(GENERIC); - return HUF_decompress1X2_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); -} - size_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* DCtx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, - void* workSpace, size_t wkspSize) + void* workSpace, size_t wkspSize, int flags) { const BYTE* ip = (const BYTE*) cSrc; size_t const hSize = HUF_readDTableX2_wksp(DCtx, cSrc, cSrcSize, - workSpace, wkspSize); + workSpace, wkspSize, flags); if (HUF_isError(hSize)) return hSize; if (hSize >= cSrcSize) return ERROR(srcSize_wrong); ip += hSize; cSrcSize -= hSize; - return HUF_decompress1X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, DCtx, /* bmi2 */ 0); + return HUF_decompress1X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, DCtx, flags); } - -size_t HUF_decompress4X2_usingDTable( - void* dst, size_t dstSize, - const void* cSrc, size_t cSrcSize, - const HUF_DTable* DTable) -{ - DTableDesc dtd = HUF_getDTableDesc(DTable); - if (dtd.tableType != 1) return ERROR(GENERIC); - return HUF_decompress4X2_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); -} - -static size_t HUF_decompress4X2_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, +static size_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, - void* workSpace, size_t wkspSize, int bmi2) + void* workSpace, size_t wkspSize, int flags) { const BYTE* ip = (const BYTE*) cSrc; size_t hSize = HUF_readDTableX2_wksp(dctx, cSrc, cSrcSize, - workSpace, wkspSize); + workSpace, wkspSize, flags); if (HUF_isError(hSize)) return hSize; if (hSize >= cSrcSize) return ERROR(srcSize_wrong); ip += hSize; cSrcSize -= hSize; - return HUF_decompress4X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, bmi2); + return HUF_decompress4X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, flags); } -size_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, - const void* cSrc, size_t cSrcSize, - void* workSpace, size_t wkspSize) -{ - return HUF_decompress4X2_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, /* bmi2 */ 0); -} - - #endif /* HUF_FORCE_DECOMPRESS_X1 */ @@ -1525,44 +1788,6 @@ size_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, /* Universal decompression selectors */ /* ***********************************/ -size_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize, - const void* cSrc, size_t cSrcSize, - const HUF_DTable* DTable) -{ - DTableDesc const dtd = HUF_getDTableDesc(DTable); -#if defined(HUF_FORCE_DECOMPRESS_X1) - (void)dtd; - assert(dtd.tableType == 0); - return HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); -#elif defined(HUF_FORCE_DECOMPRESS_X2) - (void)dtd; - assert(dtd.tableType == 1); - return HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); -#else - return dtd.tableType ? HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0) : - HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); -#endif -} - -size_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize, - const void* cSrc, size_t cSrcSize, - const HUF_DTable* DTable) -{ - DTableDesc const dtd = HUF_getDTableDesc(DTable); -#if defined(HUF_FORCE_DECOMPRESS_X1) - (void)dtd; - assert(dtd.tableType == 0); - return HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); -#elif defined(HUF_FORCE_DECOMPRESS_X2) - (void)dtd; - assert(dtd.tableType == 1); - return HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); -#else - return dtd.tableType ? HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0) : - HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, /* bmi2 */ 0); -#endif -} - #if !defined(HUF_FORCE_DECOMPRESS_X1) && !defined(HUF_FORCE_DECOMPRESS_X2) typedef struct { U32 tableTime; U32 decode256Time; } algo_time_t; @@ -1617,36 +1842,9 @@ U32 HUF_selectDecoder (size_t dstSize, size_t cSrcSize) #endif } - -size_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst, - size_t dstSize, const void* cSrc, - size_t cSrcSize, void* workSpace, - size_t wkspSize) -{ - /* validation checks */ - if (dstSize == 0) return ERROR(dstSize_tooSmall); - if (cSrcSize == 0) return ERROR(corruption_detected); - - { U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize); -#if defined(HUF_FORCE_DECOMPRESS_X1) - (void)algoNb; - assert(algoNb == 0); - return HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize); -#elif defined(HUF_FORCE_DECOMPRESS_X2) - (void)algoNb; - assert(algoNb == 1); - return HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize); -#else - return algoNb ? HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, - cSrcSize, workSpace, wkspSize): - HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize); -#endif - } -} - size_t HUF_decompress1X_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, - void* workSpace, size_t wkspSize) + void* workSpace, size_t wkspSize, int flags) { /* validation checks */ if (dstSize == 0) return ERROR(dstSize_tooSmall); @@ -1659,71 +1857,71 @@ size_t HUF_decompress1X_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, (void)algoNb; assert(algoNb == 0); return HUF_decompress1X1_DCtx_wksp(dctx, dst, dstSize, cSrc, - cSrcSize, workSpace, wkspSize); + cSrcSize, workSpace, wkspSize, flags); #elif defined(HUF_FORCE_DECOMPRESS_X2) (void)algoNb; assert(algoNb == 1); return HUF_decompress1X2_DCtx_wksp(dctx, dst, dstSize, cSrc, - cSrcSize, workSpace, wkspSize); + cSrcSize, workSpace, wkspSize, flags); #else return algoNb ? HUF_decompress1X2_DCtx_wksp(dctx, dst, dstSize, cSrc, - cSrcSize, workSpace, wkspSize): + cSrcSize, workSpace, wkspSize, flags): HUF_decompress1X1_DCtx_wksp(dctx, dst, dstSize, cSrc, - cSrcSize, workSpace, wkspSize); + cSrcSize, workSpace, wkspSize, flags); #endif } } -size_t HUF_decompress1X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2) +size_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int flags) { DTableDesc const dtd = HUF_getDTableDesc(DTable); #if defined(HUF_FORCE_DECOMPRESS_X1) (void)dtd; assert(dtd.tableType == 0); - return HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2); + return HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags); #elif defined(HUF_FORCE_DECOMPRESS_X2) (void)dtd; assert(dtd.tableType == 1); - return HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2); + return HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags); #else - return dtd.tableType ? HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2) : - HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2); + return dtd.tableType ? HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags) : + HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags); #endif } #ifndef HUF_FORCE_DECOMPRESS_X2 -size_t HUF_decompress1X1_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2) +size_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int flags) { const BYTE* ip = (const BYTE*) cSrc; - size_t const hSize = HUF_readDTableX1_wksp_bmi2(dctx, cSrc, cSrcSize, workSpace, wkspSize, bmi2); + size_t const hSize = HUF_readDTableX1_wksp(dctx, cSrc, cSrcSize, workSpace, wkspSize, flags); if (HUF_isError(hSize)) return hSize; if (hSize >= cSrcSize) return ERROR(srcSize_wrong); ip += hSize; cSrcSize -= hSize; - return HUF_decompress1X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, bmi2); + return HUF_decompress1X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, flags); } #endif -size_t HUF_decompress4X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2) +size_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int flags) { DTableDesc const dtd = HUF_getDTableDesc(DTable); #if defined(HUF_FORCE_DECOMPRESS_X1) (void)dtd; assert(dtd.tableType == 0); - return HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2); + return HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags); #elif defined(HUF_FORCE_DECOMPRESS_X2) (void)dtd; assert(dtd.tableType == 1); - return HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2); + return HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags); #else - return dtd.tableType ? HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2) : - HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, bmi2); + return dtd.tableType ? HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags) : + HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags); #endif } -size_t HUF_decompress4X_hufOnly_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2) +size_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int flags) { /* validation checks */ if (dstSize == 0) return ERROR(dstSize_tooSmall); @@ -1733,15 +1931,14 @@ size_t HUF_decompress4X_hufOnly_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t ds #if defined(HUF_FORCE_DECOMPRESS_X1) (void)algoNb; assert(algoNb == 0); - return HUF_decompress4X1_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2); + return HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags); #elif defined(HUF_FORCE_DECOMPRESS_X2) (void)algoNb; assert(algoNb == 1); - return HUF_decompress4X2_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2); + return HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags); #else - return algoNb ? HUF_decompress4X2_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2) : - HUF_decompress4X1_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2); + return algoNb ? HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags) : + HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags); #endif } } - diff --git a/src/bled/init_handle.c b/src/bled/init_handle.c index c9c3e511..b2d1d984 100644 --- a/src/bled/init_handle.c +++ b/src/bled/init_handle.c @@ -2,7 +2,6 @@ /* * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - #include "libbb.h" #include "bb_archive.h" diff --git a/src/bled/libbb.h b/src/bled/libbb.h index 7d178236..94ae9dd4 100644 --- a/src/bled/libbb.h +++ b/src/bled/libbb.h @@ -39,24 +39,37 @@ #include <sys/types.h> #include <io.h> -#define ONE_TB 1099511627776ULL +#define ONE_TB 1099511627776ULL -#define ENABLE_DESKTOP 1 +#define ENABLE_DESKTOP 1 #if ENABLE_DESKTOP -#define IF_DESKTOP(x) x +#define IF_DESKTOP(x) x #define IF_NOT_DESKTOP(x) #else #define IF_DESKTOP(x) -#define IF_NOT_DESKTOP(x) x +#define IF_NOT_DESKTOP(x) x #endif -#define IF_NOT_FEATURE_LZMA_FAST(x) x -#define ENABLE_FEATURE_UNZIP_CDF 1 -#define ENABLE_FEATURE_UNZIP_BZIP2 1 -#define ENABLE_FEATURE_UNZIP_LZMA 1 -#define ENABLE_FEATURE_UNZIP_XZ 1 +#define IF_NOT_FEATURE_LZMA_FAST(x) x +#define ENABLE_FEATURE_UNZIP_CDF 1 +#define ENABLE_FEATURE_UNZIP_BZIP2 1 +#define ENABLE_FEATURE_UNZIP_LZMA 1 +#define ENABLE_FEATURE_UNZIP_XZ 1 +#define ENABLE_FEATURE_CLEAN_UP 1 +#define uoff_t unsigned off_t +#define OFF_FMT "ll" -#define uoff_t unsigned off_t -#define OFF_FMT "ll" +#define SEAMLESS_COMPRESSION 0 +#if (SEAMLESS_COMPRESSION) +#define ENABLE_FEATURE_SEAMLESS_BZ2 1 +#define ENABLE_FEATURE_SEAMLESS_GZ 1 +#define ENABLE_FEATURE_SEAMLESS_LZMA 1 +#define ENABLE_FEATURE_SEAMLESS_XZ 1 +#define ENABLE_FEATURE_SEAMLESS_Z 1 +#define ENABLE_FEATURE_SEAMLESS_ZSTD 1 +#define IF_FEATURE_SEAMLESS_BZ2(x) x +#define IF_FEATURE_SEAMLESS_XZ(x) x +#define IF_FEATURE_SEAMLESS_ZSTD(x) x +#endif #ifndef _MODE_T_ #define _MODE_T_ @@ -149,8 +162,8 @@ extern unsigned long* bled_cancel_request; #define bb_printf(...) do { if (bled_printf != NULL) bled_printf(__VA_ARGS__); \ else { printf(__VA_ARGS__); putchar('\n'); } } while(0) #define bb_error_msg(...) bb_printf("\nError: " __VA_ARGS__) -#define bb_error_msg_and_die(...) do {bb_error_msg(__VA_ARGS__); xfunc_die();} while(0) -#define bb_error_msg_and_err(...) do {bb_error_msg(__VA_ARGS__); goto err;} while(0) +#define bb_error_msg_and_die(...) do { bb_error_msg(__VA_ARGS__); xfunc_die(); } while(0) +#define bb_error_msg_and_err(...) do { bb_error_msg(__VA_ARGS__); goto err; } while(0) #define bb_perror_msg bb_error_msg #define bb_perror_msg_and_die bb_error_msg_and_die #define bb_simple_error_msg bb_error_msg @@ -167,15 +180,15 @@ static inline void *xrealloc(void *ptr, size_t size) { #define bb_msg_read_error "read error" #define bb_msg_write_error "write error" -#define bb_mode_string(str, mode) "[not implemented]" +#define bb_mode_string(str, mode) str #define bb_make_directory(path, mode, flags) SHCreateDirectoryExU(NULL, path, NULL) -static inline int link(const char *oldpath, const char *newpath) {errno = ENOSYS; return -1;} -static inline int symlink(const char *oldpath, const char *newpath) {errno = ENOSYS; return -1;} -static inline int chown(const char *path, uid_t owner, gid_t group) {errno = ENOSYS; return -1;} -static inline int mknod(const char *pathname, mode_t mode, dev_t dev) {errno = ENOSYS; return -1;} +static inline int link(const char *oldpath, const char *newpath) { errno = ENOSYS; return -1; } +static inline int symlink(const char *oldpath, const char *newpath) { errno = ENOSYS; return -1; } +static inline int chown(const char *path, uid_t owner, gid_t group) { errno = ENOSYS; return -1; } +static inline int mknod(const char *pathname, mode_t mode, dev_t dev) { errno = ENOSYS; return -1; } static inline int utimes64(const char* filename, const struct timeval64 times64[2]) { errno = ENOSYS; return -1; } -static inline int fnmatch(const char *pattern, const char *string, int flags) {return PathMatchSpecA(string, pattern)?0:1;} +static inline int fnmatch(const char *pattern, const char *string, int flags) { return PathMatchSpecA(string, pattern) ? 0 : 1; } static inline pid_t wait(int* status) { *status = 4; return -1; } #define wait_any_nohang wait @@ -283,6 +296,19 @@ static inline struct tm *localtime_r(const time_t *timep, struct tm *result) { #define xzalloc(x) calloc(x, 1) #define malloc_or_warn malloc #define mkdir(x, y) _mkdirU(x) +struct fd_pair { int rd; int wr; }; +void xpipe(int filedes[2]) FAST_FUNC; +#define xpiped_pair(pair) xpipe(&((pair).rd)) +#define xpipe(filedes) _pipe(filedes, 0x1000, _O_BINARY) +#define xlseek lseek +#define xread safe_read +static inline void xmove_fd(int from, int to) +{ + if (from != to) { + _dup2(from, to); + _close(from); + } +} #if defined(_MSC_VER) #define _S_IFBLK 0x3000 diff --git a/src/bled/open_transformer.c b/src/bled/open_transformer.c index f85855eb..2528023f 100644 --- a/src/bled/open_transformer.c +++ b/src/bled/open_transformer.c @@ -2,7 +2,6 @@ /* * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - #include "libbb.h" #include "bb_archive.h" @@ -17,12 +16,9 @@ int FAST_FUNC check_signature16(transformer_state_t *xstate, unsigned magic16) uint16_t magic2; if (full_read(xstate->src_fd, &magic2, 2) != 2 || magic2 != magic16) { bb_error_msg("invalid magic"); -#if 0 /* possible future extension */ - if (xstate->check_signature > 1) - xfunc_die(); -#endif return -1; } + xstate->signature_skipped = 2; } return 0; } @@ -101,7 +97,7 @@ void check_errors_in_children(int signo) /* transformer(), more than meets the eye */ #if BB_MMU void FAST_FUNC fork_transformer(int fd, - int check_signature, + int signature_skipped, IF_DESKTOP(long long) int FAST_FUNC (*transformer)(transformer_state_t *xstate) ) #else @@ -115,20 +111,20 @@ void FAST_FUNC fork_transformer(int fd, const char *transform_prog) pid = BB_MMU ? xfork() : xvfork(); if (pid == 0) { /* Child */ - close(fd_pipe.rd); /* we don't want to read from the parent */ + _close(fd_pipe.rd); /* we don't want to read from the parent */ // FIXME: error check? #if BB_MMU { IF_DESKTOP(long long) int r; transformer_state_t xstate; init_transformer_state(&xstate); - xstate.check_signature = check_signature; + xstate.signature_skipped = signature_skipped; xstate.src_fd = fd; xstate.dst_fd = fd_pipe.wr; r = transformer(&xstate); if (ENABLE_FEATURE_CLEAN_UP) { - close(fd_pipe.wr); /* send EOF */ - close(fd); + _close(fd_pipe.wr); /* send EOF */ + _close(fd); } /* must be _exit! bug was actually seen here */ _exit(/*error if:*/ r < 0); @@ -150,7 +146,7 @@ void FAST_FUNC fork_transformer(int fd, const char *transform_prog) } /* parent process */ - close(fd_pipe.wr); /* don't want to write to the child */ + _close(fd_pipe.wr); /* don't want to write to the child */ xmove_fd(fd_pipe.rd, fd); } @@ -159,48 +155,44 @@ void FAST_FUNC fork_transformer(int fd, const char *transform_prog) */ static transformer_state_t *setup_transformer_on_fd(int fd, int fail_if_not_compressed) { - union { - uint8_t b[4]; - uint16_t b16[2]; - uint32_t b32[1]; - } magic; - int offset; transformer_state_t *xstate; - offset = -2; xstate = xzalloc(sizeof(*xstate)); xstate->src_fd = fd; /* .gz and .bz2 both have 2-byte signature, and their * unpack_XXX_stream wants this header skipped. */ - xread(fd, magic.b16, sizeof(magic.b16[0])); + xstate->signature_skipped = 2; + xread(fd, xstate->magic.b16, 2); if (ENABLE_FEATURE_SEAMLESS_GZ - && magic.b16[0] == GZIP_MAGIC + && xstate->magic.b16[0] == GZIP_MAGIC ) { xstate->xformer = unpack_gz_stream; USE_FOR_NOMMU(xstate->xformer_prog = "gunzip";) goto found_magic; } if (ENABLE_FEATURE_SEAMLESS_Z - && magic.b16[0] == COMPRESS_MAGIC + && xstate->magic.b16[0] == COMPRESS_MAGIC ) { xstate->xformer = unpack_Z_stream; USE_FOR_NOMMU(xstate->xformer_prog = "uncompress";) goto found_magic; } if (ENABLE_FEATURE_SEAMLESS_BZ2 - && magic.b16[0] == BZIP2_MAGIC + && xstate->magic.b16[0] == BZIP2_MAGIC ) { xstate->xformer = unpack_bz2_stream; USE_FOR_NOMMU(xstate->xformer_prog = "bunzip2";) goto found_magic; } if (ENABLE_FEATURE_SEAMLESS_XZ - && magic.b16[0] == XZ_MAGIC1 + && xstate->magic.b16[0] == XZ_MAGIC1 ) { - offset = -6; - xread(fd, magic.b32, sizeof(magic.b32[0])); - if (magic.b32[0] == XZ_MAGIC2) { + uint32_t v32; + xstate->signature_skipped = 6; + xread(fd, &xstate->magic.b16[1], 4); + move_from_unaligned32(v32, &xstate->magic.b16[1]); + if (v32 == XZ_MAGIC2) { xstate->xformer = unpack_xz_stream; USE_FOR_NOMMU(xstate->xformer_prog = "unxz";) goto found_magic; @@ -209,9 +201,11 @@ static transformer_state_t *setup_transformer_on_fd(int fd, int fail_if_not_comp if (ENABLE_FEATURE_SEAMLESS_ZSTD && xstate->magic.b16[0] == ZSTD_MAGIC1 ) { - offset = -4; + uint16_t v16; + xstate->signature_skipped = 4; xread(fd, &xstate->magic.b16[1], 2); - if (xstate->magic.b16[1] == ZSTD_MAGIC2) { + move_from_unaligned16(v16, &xstate->magic.b16[1]); + if (v16 == ZSTD_MAGIC2) { xstate->xformer = unpack_zstd_stream; USE_FOR_NOMMU(xstate->xformer_prog = "unzstd";) goto found_magic; @@ -232,19 +226,25 @@ static transformer_state_t *setup_transformer_on_fd(int fd, int fail_if_not_comp */ // USE_FOR_MMU(xstate->xformer = copy_stream;) // USE_FOR_NOMMU(xstate->xformer_prog = "cat";) - /* fall through to seeking bck over bytes we read earlier */ - USE_FOR_NOMMU(found_magic:) + found_magic: + return xstate; +} + +static void fork_transformer_and_free(transformer_state_t *xstate) +{ +# if BB_MMU + fork_transformer_with_no_sig(xstate->src_fd, xstate->xformer); +# else /* NOMMU version of fork_transformer execs * an external unzipper that wants * file position at the start of the file. */ - xlseek(fd, offset, SEEK_CUR); - - USE_FOR_MMU(found_magic:) - /* In MMU case, if magic was found, seeking back is not necessary */ - - return xstate; + xlseek(xstate->src_fd, - xstate->signature_skipped, SEEK_CUR); + xstate->signature_skipped = 0; + fork_transformer_with_sig(xstate->src_fd, xstate->xformer, xstate->xformer_prog); +# endif + free(xstate); } /* Used by e.g. rpm which gives us a fd without filename, @@ -259,21 +259,27 @@ int FAST_FUNC setup_unzip_on_fd(int fd, int fail_if_not_compressed) return 1; } -# if BB_MMU - fork_transformer_with_no_sig(xstate->src_fd, xstate->xformer); -# else - fork_transformer_with_sig(xstate->src_fd, xstate->xformer, xstate->xformer_prog); -# endif - free(xstate); + fork_transformer_and_free(xstate); return 0; } +#if ENABLE_FEATURE_SEAMLESS_LZMA +/* ...and custom version for LZMA */ +void FAST_FUNC setup_lzma_on_fd(int fd) +{ + transformer_state_t *xstate = xzalloc(sizeof(*xstate)); + xstate->src_fd = fd; + xstate->xformer = unpack_lzma_stream; + USE_FOR_NOMMU(xstate->xformer_prog = "unlzma";) + fork_transformer_and_free(xstate); +} +#endif static transformer_state_t *open_transformer(const char *fname, int fail_if_not_compressed) { transformer_state_t *xstate; int fd; - fd = open(fname, O_RDONLY); + fd = _open(fname, O_RDONLY); if (fd < 0) return NULL; @@ -304,14 +310,22 @@ int FAST_FUNC open_zipped(const char *fname, int fail_if_not_compressed) return -1; fd = xstate->src_fd; - if (xstate->xformer) { # if BB_MMU - fork_transformer_with_no_sig(xstate->src_fd, xstate->xformer); -# else - fork_transformer_with_sig(xstate->src_fd, xstate->xformer, xstate->xformer_prog); -# endif + if (xstate->xformer) { + fork_transformer_with_no_sig(fd, xstate->xformer); + } else { + /* the file is not compressed */ + xlseek(fd, - xstate->signature_skipped, SEEK_CUR); + xstate->signature_skipped = 0; } - /* else: the file is not compressed */ +# else + /* NOMMU can't avoid the seek :( */ + xlseek(fd, - xstate->signature_skipped, SEEK_CUR); + xstate->signature_skipped = 0; + if (xstate->xformer) { + fork_transformer_with_sig(fd, xstate->xformer, xstate->xformer_prog); + } /* else: the file is not compressed */ +# endif free(xstate); return fd; @@ -338,13 +352,29 @@ void* FAST_FUNC xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_ *maxsz_p = xstate->mem_output_size; } } else { - /* File is not compressed */ - image = xmalloc_read(xstate->src_fd, maxsz_p); + /* File is not compressed. + * We already read first few bytes, account for that. + * Example where it happens: + * "modinfo MODULE.ko" (not compressed) + * open("MODULE.ko", O_RDONLY|O_LARGEFILE) = 4 + * read(4, "\177E", 2) = 2 + * fstat64(4, ...) + * mmap(...) + * read(4, "LF\2\1\1\0\0\0\0"... + * ...and we avoided seeking on the fd! :) + */ + image = xmalloc_read_with_initial_buf( + xstate->src_fd, + maxsz_p, + xmemdup(&xstate->magic, xstate->signature_skipped), + xstate->signature_skipped + ); + xstate->signature_skipped = 0; } if (!image) bb_perror_msg("read error from '%s'", fname); - close(xstate->src_fd); + _close(xstate->src_fd); free(xstate); return image; # else diff --git a/src/bled/seek_by_jump.c b/src/bled/seek_by_jump.c index 4fcd99ac..232d97e5 100644 --- a/src/bled/seek_by_jump.c +++ b/src/bled/seek_by_jump.c @@ -2,7 +2,6 @@ /* * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - #include "libbb.h" #include "bb_archive.h" diff --git a/src/bled/seek_by_read.c b/src/bled/seek_by_read.c index c0fde966..df234635 100644 --- a/src/bled/seek_by_read.c +++ b/src/bled/seek_by_read.c @@ -2,7 +2,6 @@ /* * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - #include "libbb.h" #include "bb_archive.h" diff --git a/src/bled/xxhash.c b/src/bled/xxhash.c index d8e84c68..052cd522 100644 --- a/src/bled/xxhash.c +++ b/src/bled/xxhash.c @@ -1,821 +1,18 @@ /* - * xxHash - Fast Hash algorithm - * Copyright (c) Yann Collet, Facebook, Inc. + * xxHash - Extremely Fast Hash algorithm + * Copyright (c) Yann Collet - Meta Platforms, Inc * - * You can contact the author at : - * - xxHash homepage: http://www.xxhash.com - * - xxHash source repository : https://github.com/Cyan4973/xxHash - * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). * You may select, at your option, one of the above-listed licenses. -*/ - - -/* ************************************* -* Tuning parameters -***************************************/ -/*!XXH_FORCE_MEMORY_ACCESS : - * By default, access to unaligned memory is controlled by `memcpy()`, which is safe and portable. - * Unfortunately, on some target/compiler combinations, the generated assembly is sub-optimal. - * The below switch allow to select different access method for improved performance. - * Method 0 (default) : use `memcpy()`. Safe and portable. - * Method 1 : `__packed` statement. It depends on compiler extension (ie, not portable). - * This method is safe if your compiler supports it, and *generally* as fast or faster than `memcpy`. - * Method 2 : direct access. This method doesn't depend on compiler but violate C standard. - * It can generate buggy code on targets which do not support unaligned memory accesses. - * But in some circumstances, it's the only known way to get the most performance (ie GCC + ARMv6) - * See http://stackoverflow.com/a/32095106/646947 for details. - * Prefer these methods in priority order (0 > 1 > 2) */ -#ifndef XXH_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */ -# if (defined(__INTEL_COMPILER) && !defined(WIN32)) || \ - (defined(__GNUC__) && ( defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) )) || \ - defined(__ICCARM__) -# define XXH_FORCE_MEMORY_ACCESS 1 -# endif -#endif -/*!XXH_ACCEPT_NULL_INPUT_POINTER : - * If the input pointer is a null pointer, xxHash default behavior is to trigger a memory access error, since it is a bad pointer. - * When this option is enabled, xxHash output for null input pointers will be the same as a null-length input. - * By default, this option is disabled. To enable it, uncomment below define : +/* + * xxhash.c instantiates functions defined in xxhash.h */ -/* #define XXH_ACCEPT_NULL_INPUT_POINTER 1 */ -/*!XXH_FORCE_NATIVE_FORMAT : - * By default, xxHash library provides endian-independent Hash values, based on little-endian convention. - * Results are therefore identical for little-endian and big-endian CPU. - * This comes at a performance cost for big-endian CPU, since some swapping is required to emulate little-endian format. - * Should endian-independence be of no importance for your application, you may set the #define below to 1, - * to improve speed for Big-endian CPU. - * This option has no impact on Little_Endian CPU. - */ -#ifndef XXH_FORCE_NATIVE_FORMAT /* can be defined externally */ -# define XXH_FORCE_NATIVE_FORMAT 0 -#endif - -/*!XXH_FORCE_ALIGN_CHECK : - * This is a minor performance trick, only useful with lots of very small keys. - * It means : check for aligned/unaligned input. - * The check costs one initial branch per hash; set to 0 when the input data - * is guaranteed to be aligned. - */ -#ifndef XXH_FORCE_ALIGN_CHECK /* can be defined externally */ -# if defined(__i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64) -# define XXH_FORCE_ALIGN_CHECK 0 -# else -# define XXH_FORCE_ALIGN_CHECK 1 -# endif -#endif - - -/* ************************************* -* Includes & Memory related functions -***************************************/ -/* Modify the local functions below should you wish to use some other memory routines */ -/* for ZSTD_malloc(), ZSTD_free() */ -#define ZSTD_DEPS_NEED_MALLOC -#include "zstd_deps.h" /* size_t, ZSTD_malloc, ZSTD_free, ZSTD_memcpy */ -static void* XXH_malloc(size_t s) { return ZSTD_malloc(s); } -static void XXH_free (void* p) { ZSTD_free(p); } -static void* XXH_memcpy(void* dest, const void* src, size_t size) { return ZSTD_memcpy(dest,src,size); } +#define XXH_STATIC_LINKING_ONLY /* access advanced declarations */ +#define XXH_IMPLEMENTATION /* access definitions */ #include "xxhash.h" - - -/* ************************************* -* Compiler Specific Options -***************************************/ -#include "zstd_compiler.h" - - -/* ************************************* -* Basic Types -***************************************/ -#include "zstd_mem.h" /* BYTE, U32, U64, size_t */ - -#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2)) - -/* Force direct memory access. Only works on CPU which support unaligned memory access in hardware */ -static U32 XXH_read32(const void* memPtr) { return *(const U32*) memPtr; } -static U64 XXH_read64(const void* memPtr) { return *(const U64*) memPtr; } - -#elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1)) - -/* __pack instructions are safer, but compiler specific, hence potentially problematic for some compilers */ -/* currently only defined for gcc and icc */ -typedef union { U32 u32; U64 u64; } __attribute__((packed)) unalign; - -static U32 XXH_read32(const void* ptr) { return ((const unalign*)ptr)->u32; } -static U64 XXH_read64(const void* ptr) { return ((const unalign*)ptr)->u64; } - -#else - -/* portable and safe solution. Generally efficient. - * see : http://stackoverflow.com/a/32095106/646947 - */ - -static U32 XXH_read32(const void* memPtr) -{ - U32 val; - ZSTD_memcpy(&val, memPtr, sizeof(val)); - return val; -} - -static U64 XXH_read64(const void* memPtr) -{ - U64 val; - ZSTD_memcpy(&val, memPtr, sizeof(val)); - return val; -} - -#endif /* XXH_FORCE_DIRECT_MEMORY_ACCESS */ - - -/* **************************************** -* Compiler-specific Functions and Macros -******************************************/ -#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) - -/* Note : although _rotl exists for minGW (GCC under windows), performance seems poor */ -#if defined(_MSC_VER) -# define XXH_rotl32(x,r) _rotl(x,r) -# define XXH_rotl64(x,r) _rotl64(x,r) -#else -#if defined(__ICCARM__) -# include <intrinsics.h> -# define XXH_rotl32(x,r) __ROR(x,(32 - r)) -#else -# define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r))) -#endif -# define XXH_rotl64(x,r) ((x << r) | (x >> (64 - r))) -#endif - -#if defined(_MSC_VER) /* Visual Studio */ -# define XXH_swap32 _byteswap_ulong -# define XXH_swap64 _byteswap_uint64 -#elif GCC_VERSION >= 403 -# define XXH_swap32 __builtin_bswap32 -# define XXH_swap64 __builtin_bswap64 -#else -static U32 XXH_swap32 (U32 x) -{ - return ((x << 24) & 0xff000000 ) | - ((x << 8) & 0x00ff0000 ) | - ((x >> 8) & 0x0000ff00 ) | - ((x >> 24) & 0x000000ff ); -} -static U64 XXH_swap64 (U64 x) -{ - return ((x << 56) & 0xff00000000000000ULL) | - ((x << 40) & 0x00ff000000000000ULL) | - ((x << 24) & 0x0000ff0000000000ULL) | - ((x << 8) & 0x000000ff00000000ULL) | - ((x >> 8) & 0x00000000ff000000ULL) | - ((x >> 24) & 0x0000000000ff0000ULL) | - ((x >> 40) & 0x000000000000ff00ULL) | - ((x >> 56) & 0x00000000000000ffULL); -} -#endif - - -/* ************************************* -* Architecture Macros -***************************************/ -typedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianess; - -/* XXH_CPU_LITTLE_ENDIAN can be defined externally, for example on the compiler command line */ -#ifndef XXH_CPU_LITTLE_ENDIAN - static const int g_one = 1; -# define XXH_CPU_LITTLE_ENDIAN (*(const char*)(&g_one)) -#endif - - -/* *************************** -* Memory reads -*****************************/ -typedef enum { XXH_aligned, XXH_unaligned } XXH_alignment; - -FORCE_INLINE_TEMPLATE U32 XXH_readLE32_align(const void* ptr, XXH_endianess endian, XXH_alignment align) -{ - if (align==XXH_unaligned) - return endian==XXH_littleEndian ? XXH_read32(ptr) : XXH_swap32(XXH_read32(ptr)); - else - return endian==XXH_littleEndian ? *(const U32*)ptr : XXH_swap32(*(const U32*)ptr); -} - -FORCE_INLINE_TEMPLATE U32 XXH_readLE32(const void* ptr, XXH_endianess endian) -{ - return XXH_readLE32_align(ptr, endian, XXH_unaligned); -} - -static U32 XXH_readBE32(const void* ptr) -{ - return XXH_CPU_LITTLE_ENDIAN ? XXH_swap32(XXH_read32(ptr)) : XXH_read32(ptr); -} - -FORCE_INLINE_TEMPLATE U64 XXH_readLE64_align(const void* ptr, XXH_endianess endian, XXH_alignment align) -{ - if (align==XXH_unaligned) - return endian==XXH_littleEndian ? XXH_read64(ptr) : XXH_swap64(XXH_read64(ptr)); - else - return endian==XXH_littleEndian ? *(const U64*)ptr : XXH_swap64(*(const U64*)ptr); -} - -FORCE_INLINE_TEMPLATE U64 XXH_readLE64(const void* ptr, XXH_endianess endian) -{ - return XXH_readLE64_align(ptr, endian, XXH_unaligned); -} - -static U64 XXH_readBE64(const void* ptr) -{ - return XXH_CPU_LITTLE_ENDIAN ? XXH_swap64(XXH_read64(ptr)) : XXH_read64(ptr); -} - - -/* ************************************* -* Macros -***************************************/ -#define XXH_STATIC_ASSERT(c) { enum { XXH_static_assert = 1/(int)(!!(c)) }; } /* use only *after* variable declarations */ - - -/* ************************************* -* Constants -***************************************/ -static const U32 PRIME32_1 = 2654435761U; -static const U32 PRIME32_2 = 2246822519U; -static const U32 PRIME32_3 = 3266489917U; -static const U32 PRIME32_4 = 668265263U; -static const U32 PRIME32_5 = 374761393U; - -static const U64 PRIME64_1 = 11400714785074694791ULL; -static const U64 PRIME64_2 = 14029467366897019727ULL; -static const U64 PRIME64_3 = 1609587929392839161ULL; -static const U64 PRIME64_4 = 9650029242287828579ULL; -static const U64 PRIME64_5 = 2870177450012600261ULL; - -XXH_PUBLIC_API unsigned XXH_versionNumber (void) { return XXH_VERSION_NUMBER; } - - -/* ************************** -* Utils -****************************/ -XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* restrict dstState, const XXH32_state_t* restrict srcState) -{ - ZSTD_memcpy(dstState, srcState, sizeof(*dstState)); -} - -XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* restrict dstState, const XXH64_state_t* restrict srcState) -{ - ZSTD_memcpy(dstState, srcState, sizeof(*dstState)); -} - - -/* *************************** -* Simple Hash Functions -*****************************/ - -static U32 XXH32_round(U32 seed, U32 input) -{ - seed += input * PRIME32_2; - seed = XXH_rotl32(seed, 13); - seed *= PRIME32_1; - return seed; -} - -FORCE_INLINE_TEMPLATE U32 XXH32_endian_align(const void* input, size_t len, U32 seed, XXH_endianess endian, XXH_alignment align) -{ - const BYTE* p = (const BYTE*)input; - const BYTE* bEnd = p + len; - U32 h32; -#define XXH_get32bits(p) XXH_readLE32_align(p, endian, align) - -#ifdef XXH_ACCEPT_NULL_INPUT_POINTER - if (p==NULL) { - len=0; - bEnd=p=(const BYTE*)(size_t)16; - } -#endif - - if (len>=16) { - const BYTE* const limit = bEnd - 16; - U32 v1 = seed + PRIME32_1 + PRIME32_2; - U32 v2 = seed + PRIME32_2; - U32 v3 = seed + 0; - U32 v4 = seed - PRIME32_1; - - do { - v1 = XXH32_round(v1, XXH_get32bits(p)); p+=4; - v2 = XXH32_round(v2, XXH_get32bits(p)); p+=4; - v3 = XXH32_round(v3, XXH_get32bits(p)); p+=4; - v4 = XXH32_round(v4, XXH_get32bits(p)); p+=4; - } while (p<=limit); - - h32 = XXH_rotl32(v1, 1) + XXH_rotl32(v2, 7) + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18); - } else { - h32 = seed + PRIME32_5; - } - - h32 += (U32) len; - - while (p+4<=bEnd) { - h32 += XXH_get32bits(p) * PRIME32_3; - h32 = XXH_rotl32(h32, 17) * PRIME32_4 ; - p+=4; - } - - while (p<bEnd) { - h32 += (*p) * PRIME32_5; - h32 = XXH_rotl32(h32, 11) * PRIME32_1 ; - p++; - } - - h32 ^= h32 >> 15; - h32 *= PRIME32_2; - h32 ^= h32 >> 13; - h32 *= PRIME32_3; - h32 ^= h32 >> 16; - - return h32; -} - - -XXH_PUBLIC_API unsigned int XXH32 (const void* input, size_t len, unsigned int seed) -{ -#if 0 - /* Simple version, good for code maintenance, but unfortunately slow for small inputs */ - XXH32_CREATESTATE_STATIC(state); - XXH32_reset(state, seed); - XXH32_update(state, input, len); - return XXH32_digest(state); -#else - XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; - - if (XXH_FORCE_ALIGN_CHECK) { - if ((((size_t)input) & 3) == 0) { /* Input is 4-bytes aligned, leverage the speed benefit */ - if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) - return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_aligned); - else - return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_aligned); - } } - - if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) - return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_unaligned); - else - return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_unaligned); -#endif -} - - -static U64 XXH64_round(U64 acc, U64 input) -{ - acc += input * PRIME64_2; - acc = XXH_rotl64(acc, 31); - acc *= PRIME64_1; - return acc; -} - -static U64 XXH64_mergeRound(U64 acc, U64 val) -{ - val = XXH64_round(0, val); - acc ^= val; - acc = acc * PRIME64_1 + PRIME64_4; - return acc; -} - -FORCE_INLINE_TEMPLATE U64 XXH64_endian_align(const void* input, size_t len, U64 seed, XXH_endianess endian, XXH_alignment align) -{ - const BYTE* p = (const BYTE*)input; - const BYTE* const bEnd = p + len; - U64 h64; -#define XXH_get64bits(p) XXH_readLE64_align(p, endian, align) - -#ifdef XXH_ACCEPT_NULL_INPUT_POINTER - if (p==NULL) { - len=0; - bEnd=p=(const BYTE*)(size_t)32; - } -#endif - - if (len>=32) { - const BYTE* const limit = bEnd - 32; - U64 v1 = seed + PRIME64_1 + PRIME64_2; - U64 v2 = seed + PRIME64_2; - U64 v3 = seed + 0; - U64 v4 = seed - PRIME64_1; - - do { - v1 = XXH64_round(v1, XXH_get64bits(p)); p+=8; - v2 = XXH64_round(v2, XXH_get64bits(p)); p+=8; - v3 = XXH64_round(v3, XXH_get64bits(p)); p+=8; - v4 = XXH64_round(v4, XXH_get64bits(p)); p+=8; - } while (p<=limit); - - h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18); - h64 = XXH64_mergeRound(h64, v1); - h64 = XXH64_mergeRound(h64, v2); - h64 = XXH64_mergeRound(h64, v3); - h64 = XXH64_mergeRound(h64, v4); - - } else { - h64 = seed + PRIME64_5; - } - - h64 += (U64) len; - - while (p+8<=bEnd) { - U64 const k1 = XXH64_round(0, XXH_get64bits(p)); - h64 ^= k1; - h64 = XXH_rotl64(h64,27) * PRIME64_1 + PRIME64_4; - p+=8; - } - - if (p+4<=bEnd) { - h64 ^= (U64)(XXH_get32bits(p)) * PRIME64_1; - h64 = XXH_rotl64(h64, 23) * PRIME64_2 + PRIME64_3; - p+=4; - } - - while (p<bEnd) { - h64 ^= (*p) * PRIME64_5; - h64 = XXH_rotl64(h64, 11) * PRIME64_1; - p++; - } - - h64 ^= h64 >> 33; - h64 *= PRIME64_2; - h64 ^= h64 >> 29; - h64 *= PRIME64_3; - h64 ^= h64 >> 32; - - return h64; -} - - -XXH_PUBLIC_API unsigned long long XXH64 (const void* input, size_t len, unsigned long long seed) -{ -#if 0 - /* Simple version, good for code maintenance, but unfortunately slow for small inputs */ - XXH64_CREATESTATE_STATIC(state); - XXH64_reset(state, seed); - XXH64_update(state, input, len); - return XXH64_digest(state); -#else - XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; - - if (XXH_FORCE_ALIGN_CHECK) { - if ((((size_t)input) & 7)==0) { /* Input is aligned, let's leverage the speed advantage */ - if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) - return XXH64_endian_align(input, len, seed, XXH_littleEndian, XXH_aligned); - else - return XXH64_endian_align(input, len, seed, XXH_bigEndian, XXH_aligned); - } } - - if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) - return XXH64_endian_align(input, len, seed, XXH_littleEndian, XXH_unaligned); - else - return XXH64_endian_align(input, len, seed, XXH_bigEndian, XXH_unaligned); -#endif -} - - -/* ************************************************** -* Advanced Hash Functions -****************************************************/ - -XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void) -{ - return (XXH32_state_t*)XXH_malloc(sizeof(XXH32_state_t)); -} -XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr) -{ - XXH_free(statePtr); - return XXH_OK; -} - -XXH_PUBLIC_API XXH64_state_t* XXH64_createState(void) -{ - return (XXH64_state_t*)XXH_malloc(sizeof(XXH64_state_t)); -} -XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr) -{ - XXH_free(statePtr); - return XXH_OK; -} - - -/*** Hash feed ***/ - -XXH_PUBLIC_API XXH_errorcode XXH32_reset(XXH32_state_t* statePtr, unsigned int seed) -{ - XXH32_state_t state; /* using a local state to memcpy() in order to avoid strict-aliasing warnings */ - ZSTD_memset(&state, 0, sizeof(state)-4); /* do not write into reserved, for future removal */ - state.v1 = seed + PRIME32_1 + PRIME32_2; - state.v2 = seed + PRIME32_2; - state.v3 = seed + 0; - state.v4 = seed - PRIME32_1; - ZSTD_memcpy(statePtr, &state, sizeof(state)); - return XXH_OK; -} - - -XXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH64_state_t* statePtr, unsigned long long seed) -{ - XXH64_state_t state; /* using a local state to memcpy() in order to avoid strict-aliasing warnings */ - ZSTD_memset(&state, 0, sizeof(state)-8); /* do not write into reserved, for future removal */ - state.v1 = seed + PRIME64_1 + PRIME64_2; - state.v2 = seed + PRIME64_2; - state.v3 = seed + 0; - state.v4 = seed - PRIME64_1; - ZSTD_memcpy(statePtr, &state, sizeof(state)); - return XXH_OK; -} - - -FORCE_INLINE_TEMPLATE XXH_errorcode XXH32_update_endian (XXH32_state_t* state, const void* input, size_t len, XXH_endianess endian) -{ - const BYTE* p = (const BYTE*)input; - const BYTE* const bEnd = p + len; - -#ifdef XXH_ACCEPT_NULL_INPUT_POINTER - if (input==NULL) return XXH_ERROR; -#endif - - state->total_len_32 += (unsigned)len; - state->large_len |= (len>=16) | (state->total_len_32>=16); - - if (state->memsize + len < 16) { /* fill in tmp buffer */ - XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, len); - state->memsize += (unsigned)len; - return XXH_OK; - } - - if (state->memsize) { /* some data left from previous update */ - XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, 16-state->memsize); - { const U32* p32 = state->mem32; - state->v1 = XXH32_round(state->v1, XXH_readLE32(p32, endian)); p32++; - state->v2 = XXH32_round(state->v2, XXH_readLE32(p32, endian)); p32++; - state->v3 = XXH32_round(state->v3, XXH_readLE32(p32, endian)); p32++; - state->v4 = XXH32_round(state->v4, XXH_readLE32(p32, endian)); p32++; - } - p += 16-state->memsize; - state->memsize = 0; - } - - if (p <= bEnd-16) { - const BYTE* const limit = bEnd - 16; - U32 v1 = state->v1; - U32 v2 = state->v2; - U32 v3 = state->v3; - U32 v4 = state->v4; - - do { - v1 = XXH32_round(v1, XXH_readLE32(p, endian)); p+=4; - v2 = XXH32_round(v2, XXH_readLE32(p, endian)); p+=4; - v3 = XXH32_round(v3, XXH_readLE32(p, endian)); p+=4; - v4 = XXH32_round(v4, XXH_readLE32(p, endian)); p+=4; - } while (p<=limit); - - state->v1 = v1; - state->v2 = v2; - state->v3 = v3; - state->v4 = v4; - } - - if (p < bEnd) { - XXH_memcpy(state->mem32, p, (size_t)(bEnd-p)); - state->memsize = (unsigned)(bEnd-p); - } - - return XXH_OK; -} - -XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* state_in, const void* input, size_t len) -{ - XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; - - if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) - return XXH32_update_endian(state_in, input, len, XXH_littleEndian); - else - return XXH32_update_endian(state_in, input, len, XXH_bigEndian); -} - - - -FORCE_INLINE_TEMPLATE U32 XXH32_digest_endian (const XXH32_state_t* state, XXH_endianess endian) -{ - const BYTE * p = (const BYTE*)state->mem32; - const BYTE* const bEnd = (const BYTE*)(state->mem32) + state->memsize; - U32 h32; - - if (state->large_len) { - h32 = XXH_rotl32(state->v1, 1) + XXH_rotl32(state->v2, 7) + XXH_rotl32(state->v3, 12) + XXH_rotl32(state->v4, 18); - } else { - h32 = state->v3 /* == seed */ + PRIME32_5; - } - - h32 += state->total_len_32; - - while (p+4<=bEnd) { - h32 += XXH_readLE32(p, endian) * PRIME32_3; - h32 = XXH_rotl32(h32, 17) * PRIME32_4; - p+=4; - } - - while (p<bEnd) { - h32 += (*p) * PRIME32_5; - h32 = XXH_rotl32(h32, 11) * PRIME32_1; - p++; - } - - h32 ^= h32 >> 15; - h32 *= PRIME32_2; - h32 ^= h32 >> 13; - h32 *= PRIME32_3; - h32 ^= h32 >> 16; - - return h32; -} - - -XXH_PUBLIC_API unsigned int XXH32_digest (const XXH32_state_t* state_in) -{ - XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; - - if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) - return XXH32_digest_endian(state_in, XXH_littleEndian); - else - return XXH32_digest_endian(state_in, XXH_bigEndian); -} - - - -/* **** XXH64 **** */ - -FORCE_INLINE_TEMPLATE XXH_errorcode XXH64_update_endian (XXH64_state_t* state, const void* input, size_t len, XXH_endianess endian) -{ - const BYTE* p = (const BYTE*)input; - const BYTE* const bEnd = p + len; - -#ifdef XXH_ACCEPT_NULL_INPUT_POINTER - if (input==NULL) return XXH_ERROR; -#endif - - state->total_len += len; - - if (state->memsize + len < 32) { /* fill in tmp buffer */ - if (input != NULL) { - XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, len); - } - state->memsize += (U32)len; - return XXH_OK; - } - - if (state->memsize) { /* tmp buffer is full */ - XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, 32-state->memsize); - state->v1 = XXH64_round(state->v1, XXH_readLE64(state->mem64+0, endian)); - state->v2 = XXH64_round(state->v2, XXH_readLE64(state->mem64+1, endian)); - state->v3 = XXH64_round(state->v3, XXH_readLE64(state->mem64+2, endian)); - state->v4 = XXH64_round(state->v4, XXH_readLE64(state->mem64+3, endian)); - p += 32-state->memsize; - state->memsize = 0; - } - - if (p+32 <= bEnd) { - const BYTE* const limit = bEnd - 32; - U64 v1 = state->v1; - U64 v2 = state->v2; - U64 v3 = state->v3; - U64 v4 = state->v4; - - do { - v1 = XXH64_round(v1, XXH_readLE64(p, endian)); p+=8; - v2 = XXH64_round(v2, XXH_readLE64(p, endian)); p+=8; - v3 = XXH64_round(v3, XXH_readLE64(p, endian)); p+=8; - v4 = XXH64_round(v4, XXH_readLE64(p, endian)); p+=8; - } while (p<=limit); - - state->v1 = v1; - state->v2 = v2; - state->v3 = v3; - state->v4 = v4; - } - - if (p < bEnd) { - XXH_memcpy(state->mem64, p, (size_t)(bEnd-p)); - state->memsize = (unsigned)(bEnd-p); - } - - return XXH_OK; -} - -XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* state_in, const void* input, size_t len) -{ - XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; - - if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) - return XXH64_update_endian(state_in, input, len, XXH_littleEndian); - else - return XXH64_update_endian(state_in, input, len, XXH_bigEndian); -} - - - -FORCE_INLINE_TEMPLATE U64 XXH64_digest_endian (const XXH64_state_t* state, XXH_endianess endian) -{ - const BYTE * p = (const BYTE*)state->mem64; - const BYTE* const bEnd = (const BYTE*)state->mem64 + state->memsize; - U64 h64; - - if (state->total_len >= 32) { - U64 const v1 = state->v1; - U64 const v2 = state->v2; - U64 const v3 = state->v3; - U64 const v4 = state->v4; - - h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18); - h64 = XXH64_mergeRound(h64, v1); - h64 = XXH64_mergeRound(h64, v2); - h64 = XXH64_mergeRound(h64, v3); - h64 = XXH64_mergeRound(h64, v4); - } else { - h64 = state->v3 + PRIME64_5; - } - - h64 += (U64) state->total_len; - - while (p+8<=bEnd) { - U64 const k1 = XXH64_round(0, XXH_readLE64(p, endian)); - h64 ^= k1; - h64 = XXH_rotl64(h64,27) * PRIME64_1 + PRIME64_4; - p+=8; - } - - if (p+4<=bEnd) { - h64 ^= (U64)(XXH_readLE32(p, endian)) * PRIME64_1; - h64 = XXH_rotl64(h64, 23) * PRIME64_2 + PRIME64_3; - p+=4; - } - - while (p<bEnd) { - h64 ^= (*p) * PRIME64_5; - h64 = XXH_rotl64(h64, 11) * PRIME64_1; - p++; - } - - h64 ^= h64 >> 33; - h64 *= PRIME64_2; - h64 ^= h64 >> 29; - h64 *= PRIME64_3; - h64 ^= h64 >> 32; - - return h64; -} - - -XXH_PUBLIC_API unsigned long long XXH64_digest (const XXH64_state_t* state_in) -{ - XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; - - if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) - return XXH64_digest_endian(state_in, XXH_littleEndian); - else - return XXH64_digest_endian(state_in, XXH_bigEndian); -} - - -/* ************************** -* Canonical representation -****************************/ - -/*! Default XXH result types are basic unsigned 32 and 64 bits. -* The canonical representation follows human-readable write convention, aka big-endian (large digits first). -* These functions allow transformation of hash result into and from its canonical format. -* This way, hash values can be written into a file or buffer, and remain comparable across different systems and programs. -*/ - -XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash) -{ - XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) == sizeof(XXH32_hash_t)); - if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap32(hash); - ZSTD_memcpy(dst, &hash, sizeof(*dst)); -} - -XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash) -{ - XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) == sizeof(XXH64_hash_t)); - if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap64(hash); - ZSTD_memcpy(dst, &hash, sizeof(*dst)); -} - -XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src) -{ - return XXH_readBE32(src); -} - -XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src) -{ - return XXH_readBE64(src); -} diff --git a/src/bled/xxhash.h b/src/bled/xxhash.h index 8865cfd8..e59e4426 100644 --- a/src/bled/xxhash.h +++ b/src/bled/xxhash.h @@ -1,276 +1,7020 @@ /* * xxHash - Extremely Fast Hash algorithm * Header File - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Yann Collet - Meta Platforms, Inc * - * You can contact the author at : - * - xxHash source repository : https://github.com/Cyan4973/xxHash - * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). * You may select, at your option, one of the above-listed licenses. -*/ + */ -/* Notice extracted from xxHash homepage : +/* Local adaptations for Zstandard */ -xxHash is an extremely fast Hash algorithm, running at RAM speed limits. -It also successfully passes all tests from the SMHasher suite. +#ifndef XXH_NO_XXH3 +# define XXH_NO_XXH3 +#endif -Comparison (single thread, Windows Seven 32 bits, using SMHasher on a Core 2 Duo @3GHz) +#ifndef XXH_NAMESPACE +# define XXH_NAMESPACE ZSTD_ +#endif -Name Speed Q.Score Author -xxHash 5.4 GB/s 10 -CrapWow 3.2 GB/s 2 Andrew -MumurHash 3a 2.7 GB/s 10 Austin Appleby -SpookyHash 2.0 GB/s 10 Bob Jenkins -SBox 1.4 GB/s 9 Bret Mulvey -Lookup3 1.2 GB/s 9 Bob Jenkins -SuperFastHash 1.2 GB/s 1 Paul Hsieh -CityHash64 1.05 GB/s 10 Pike & Alakuijala -FNV 0.55 GB/s 5 Fowler, Noll, Vo -CRC32 0.43 GB/s 9 -MD5-32 0.33 GB/s 10 Ronald L. Rivest -SHA1-32 0.28 GB/s 10 - -Q.Score is a measure of quality of the hash function. -It depends on successfully passing SMHasher test set. -10 is a perfect score. - -A 64-bits version, named XXH64, is available since r35. -It offers much better speed, but for 64-bits applications only. -Name Speed on 64 bits Speed on 32 bits -XXH64 13.8 GB/s 1.9 GB/s -XXH32 6.8 GB/s 6.0 GB/s -*/ - - -#ifndef XXHASH_H_5627135585666179 -#define XXHASH_H_5627135585666179 1 +/*! + * @mainpage xxHash + * + * xxHash is an extremely fast non-cryptographic hash algorithm, working at RAM speed + * limits. + * + * It is proposed in four flavors, in three families: + * 1. @ref XXH32_family + * - Classic 32-bit hash function. Simple, compact, and runs on almost all + * 32-bit and 64-bit systems. + * 2. @ref XXH64_family + * - Classic 64-bit adaptation of XXH32. Just as simple, and runs well on most + * 64-bit systems (but _not_ 32-bit systems). + * 3. @ref XXH3_family + * - Modern 64-bit and 128-bit hash function family which features improved + * strength and performance across the board, especially on smaller data. + * It benefits greatly from SIMD and 64-bit without requiring it. + * + * Benchmarks + * --- + * The reference system uses an Intel i7-9700K CPU, and runs Ubuntu x64 20.04. + * The open source benchmark program is compiled with clang v10.0 using -O3 flag. + * + * | Hash Name | ISA ext | Width | Large Data Speed | Small Data Velocity | + * | -------------------- | ------- | ----: | ---------------: | ------------------: | + * | XXH3_64bits() | @b AVX2 | 64 | 59.4 GB/s | 133.1 | + * | MeowHash | AES-NI | 128 | 58.2 GB/s | 52.5 | + * | XXH3_128bits() | @b AVX2 | 128 | 57.9 GB/s | 118.1 | + * | CLHash | PCLMUL | 64 | 37.1 GB/s | 58.1 | + * | XXH3_64bits() | @b SSE2 | 64 | 31.5 GB/s | 133.1 | + * | XXH3_128bits() | @b SSE2 | 128 | 29.6 GB/s | 118.1 | + * | RAM sequential read | | N/A | 28.0 GB/s | N/A | + * | ahash | AES-NI | 64 | 22.5 GB/s | 107.2 | + * | City64 | | 64 | 22.0 GB/s | 76.6 | + * | T1ha2 | | 64 | 22.0 GB/s | 99.0 | + * | City128 | | 128 | 21.7 GB/s | 57.7 | + * | FarmHash | AES-NI | 64 | 21.3 GB/s | 71.9 | + * | XXH64() | | 64 | 19.4 GB/s | 71.0 | + * | SpookyHash | | 64 | 19.3 GB/s | 53.2 | + * | Mum | | 64 | 18.0 GB/s | 67.0 | + * | CRC32C | SSE4.2 | 32 | 13.0 GB/s | 57.9 | + * | XXH32() | | 32 | 9.7 GB/s | 71.9 | + * | City32 | | 32 | 9.1 GB/s | 66.0 | + * | Blake3* | @b AVX2 | 256 | 4.4 GB/s | 8.1 | + * | Murmur3 | | 32 | 3.9 GB/s | 56.1 | + * | SipHash* | | 64 | 3.0 GB/s | 43.2 | + * | Blake3* | @b SSE2 | 256 | 2.4 GB/s | 8.1 | + * | HighwayHash | | 64 | 1.4 GB/s | 6.0 | + * | FNV64 | | 64 | 1.2 GB/s | 62.7 | + * | Blake2* | | 256 | 1.1 GB/s | 5.1 | + * | SHA1* | | 160 | 0.8 GB/s | 5.6 | + * | MD5* | | 128 | 0.6 GB/s | 7.8 | + * @note + * - Hashes which require a specific ISA extension are noted. SSE2 is also noted, + * even though it is mandatory on x64. + * - Hashes with an asterisk are cryptographic. Note that MD5 is non-cryptographic + * by modern standards. + * - Small data velocity is a rough average of algorithm's efficiency for small + * data. For more accurate information, see the wiki. + * - More benchmarks and strength tests are found on the wiki: + * https://github.com/Cyan4973/xxHash/wiki + * + * Usage + * ------ + * All xxHash variants use a similar API. Changing the algorithm is a trivial + * substitution. + * + * @pre + * For functions which take an input and length parameter, the following + * requirements are assumed: + * - The range from [`input`, `input + length`) is valid, readable memory. + * - The only exception is if the `length` is `0`, `input` may be `NULL`. + * - For C++, the objects must have the *TriviallyCopyable* property, as the + * functions access bytes directly as if it was an array of `unsigned char`. + * + * @anchor single_shot_example + * **Single Shot** + * + * These functions are stateless functions which hash a contiguous block of memory, + * immediately returning the result. They are the easiest and usually the fastest + * option. + * + * XXH32(), XXH64(), XXH3_64bits(), XXH3_128bits() + * + * @code{.c} + * #include <string.h> + * #include "xxhash.h" + * + * // Example for a function which hashes a null terminated string with XXH32(). + * XXH32_hash_t hash_string(const char* string, XXH32_hash_t seed) + * { + * // NULL pointers are only valid if the length is zero + * size_t length = (string == NULL) ? 0 : strlen(string); + * return XXH32(string, length, seed); + * } + * @endcode + * + * + * @anchor streaming_example + * **Streaming** + * + * These groups of functions allow incremental hashing of unknown size, even + * more than what would fit in a size_t. + * + * XXH32_reset(), XXH64_reset(), XXH3_64bits_reset(), XXH3_128bits_reset() + * + * @code{.c} + * #include <stdio.h> + * #include <assert.h> + * #include "xxhash.h" + * // Example for a function which hashes a FILE incrementally with XXH3_64bits(). + * XXH64_hash_t hashFile(FILE* f) + * { + * // Allocate a state struct. Do not just use malloc() or new. + * XXH3_state_t* state = XXH3_createState(); + * assert(state != NULL && "Out of memory!"); + * // Reset the state to start a new hashing session. + * XXH3_64bits_reset(state); + * char buffer[4096]; + * size_t count; + * // Read the file in chunks + * while ((count = fread(buffer, 1, sizeof(buffer), f)) != 0) { + * // Run update() as many times as necessary to process the data + * XXH3_64bits_update(state, buffer, count); + * } + * // Retrieve the finalized hash. This will not change the state. + * XXH64_hash_t result = XXH3_64bits_digest(state); + * // Free the state. Do not use free(). + * XXH3_freeState(state); + * return result; + * } + * @endcode + * + * Streaming functions generate the xxHash value from an incremental input. + * This method is slower than single-call functions, due to state management. + * For small inputs, prefer `XXH32()` and `XXH64()`, which are better optimized. + * + * An XXH state must first be allocated using `XXH*_createState()`. + * + * Start a new hash by initializing the state with a seed using `XXH*_reset()`. + * + * Then, feed the hash state by calling `XXH*_update()` as many times as necessary. + * + * The function returns an error code, with 0 meaning OK, and any other value + * meaning there is an error. + * + * Finally, a hash value can be produced anytime, by using `XXH*_digest()`. + * This function returns the nn-bits hash as an int or long long. + * + * It's still possible to continue inserting input into the hash state after a + * digest, and generate new hash values later on by invoking `XXH*_digest()`. + * + * When done, release the state using `XXH*_freeState()`. + * + * + * @anchor canonical_representation_example + * **Canonical Representation** + * + * The default return values from XXH functions are unsigned 32, 64 and 128 bit + * integers. + * This the simplest and fastest format for further post-processing. + * + * However, this leaves open the question of what is the order on the byte level, + * since little and big endian conventions will store the same number differently. + * + * The canonical representation settles this issue by mandating big-endian + * convention, the same convention as human-readable numbers (large digits first). + * + * When writing hash values to storage, sending them over a network, or printing + * them, it's highly recommended to use the canonical representation to ensure + * portability across a wider range of systems, present and future. + * + * The following functions allow transformation of hash values to and from + * canonical format. + * + * XXH32_canonicalFromHash(), XXH32_hashFromCanonical(), + * XXH64_canonicalFromHash(), XXH64_hashFromCanonical(), + * XXH128_canonicalFromHash(), XXH128_hashFromCanonical(), + * + * @code{.c} + * #include <stdio.h> + * #include "xxhash.h" + * + * // Example for a function which prints XXH32_hash_t in human readable format + * void printXxh32(XXH32_hash_t hash) + * { + * XXH32_canonical_t cano; + * XXH32_canonicalFromHash(&cano, hash); + * size_t i; + * for(i = 0; i < sizeof(cano.digest); ++i) { + * printf("%02x", cano.digest[i]); + * } + * printf("\n"); + * } + * + * // Example for a function which converts XXH32_canonical_t to XXH32_hash_t + * XXH32_hash_t convertCanonicalToXxh32(XXH32_canonical_t cano) + * { + * XXH32_hash_t hash = XXH32_hashFromCanonical(&cano); + * return hash; + * } + * @endcode + * + * + * @file xxhash.h + * xxHash prototypes and implementation + */ +#if defined (__cplusplus) +extern "C" { +#endif /* **************************** -* Definitions -******************************/ -#include "zstd_deps.h" -typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode; + * INLINE mode + ******************************/ +/*! + * @defgroup public Public API + * Contains details on the public xxHash functions. + * @{ + */ +#ifdef XXH_DOXYGEN +/*! + * @brief Gives access to internal state declaration, required for static allocation. + * + * Incompatible with dynamic linking, due to risks of ABI changes. + * + * Usage: + * @code{.c} + * #define XXH_STATIC_LINKING_ONLY + * #include "xxhash.h" + * @endcode + */ +# define XXH_STATIC_LINKING_ONLY +/* Do not undef XXH_STATIC_LINKING_ONLY for Doxygen */ +/*! + * @brief Gives access to internal definitions. + * + * Usage: + * @code{.c} + * #define XXH_STATIC_LINKING_ONLY + * #define XXH_IMPLEMENTATION + * #include "xxhash.h" + * @endcode + */ +# define XXH_IMPLEMENTATION +/* Do not undef XXH_IMPLEMENTATION for Doxygen */ -/* **************************** -* API modifier -******************************/ -/** XXH_PRIVATE_API -* This is useful if you want to include xxhash functions in `static` mode -* in order to inline them, and remove their symbol from the public list. -* Methodology : -* #define XXH_PRIVATE_API -* #include "xxhash.h" -* `xxhash.c` is automatically included. -* It's not useful to compile and link it as a separate module anymore. -*/ -#ifdef XXH_PRIVATE_API +/*! + * @brief Exposes the implementation and marks all functions as `inline`. + * + * Use these build macros to inline xxhash into the target unit. + * Inlining improves performance on small inputs, especially when the length is + * expressed as a compile-time constant: + * + * https://fastcompression.blogspot.com/2018/03/xxhash-for-small-keys-impressive-power.html + * + * It also keeps xxHash symbols private to the unit, so they are not exported. + * + * Usage: + * @code{.c} + * #define XXH_INLINE_ALL + * #include "xxhash.h" + * @endcode + * Do not compile and link xxhash.o as a separate object, as it is not useful. + */ +# define XXH_INLINE_ALL +# undef XXH_INLINE_ALL +/*! + * @brief Exposes the implementation without marking functions as inline. + */ +# define XXH_PRIVATE_API +# undef XXH_PRIVATE_API +/*! + * @brief Emulate a namespace by transparently prefixing all symbols. + * + * If you want to include _and expose_ xxHash functions from within your own + * library, but also want to avoid symbol collisions with other libraries which + * may also include xxHash, you can use @ref XXH_NAMESPACE to automatically prefix + * any public symbol from xxhash library with the value of @ref XXH_NAMESPACE + * (therefore, avoid empty or numeric values). + * + * Note that no change is required within the calling program as long as it + * includes `xxhash.h`: Regular symbol names will be automatically translated + * by this header. + */ +# define XXH_NAMESPACE /* YOUR NAME HERE */ +# undef XXH_NAMESPACE +#endif + +#if (defined(XXH_INLINE_ALL) || defined(XXH_PRIVATE_API)) \ + && !defined(XXH_INLINE_ALL_31684351384) + /* this section should be traversed only once */ +# define XXH_INLINE_ALL_31684351384 + /* give access to the advanced API, required to compile implementations */ +# undef XXH_STATIC_LINKING_ONLY /* avoid macro redef */ +# define XXH_STATIC_LINKING_ONLY + /* make all functions private */ +# undef XXH_PUBLIC_API # if defined(__GNUC__) # define XXH_PUBLIC_API static __inline __attribute__((unused)) -# elif (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) +# elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) # define XXH_PUBLIC_API static inline # elif defined(_MSC_VER) # define XXH_PUBLIC_API static __inline # else -# define XXH_PUBLIC_API static /* this version may generate warnings for unused static functions; disable the relevant warning */ + /* note: this version may generate warnings for unused static functions */ +# define XXH_PUBLIC_API static # endif -#else -# define XXH_PUBLIC_API /* do nothing */ -#endif /* XXH_PRIVATE_API */ -/*!XXH_NAMESPACE, aka Namespace Emulation : + /* + * This part deals with the special case where a unit wants to inline xxHash, + * but "xxhash.h" has previously been included without XXH_INLINE_ALL, + * such as part of some previously included *.h header file. + * Without further action, the new include would just be ignored, + * and functions would effectively _not_ be inlined (silent failure). + * The following macros solve this situation by prefixing all inlined names, + * avoiding naming collision with previous inclusions. + */ + /* Before that, we unconditionally #undef all symbols, + * in case they were already defined with XXH_NAMESPACE. + * They will then be redefined for XXH_INLINE_ALL + */ +# undef XXH_versionNumber + /* XXH32 */ +# undef XXH32 +# undef XXH32_createState +# undef XXH32_freeState +# undef XXH32_reset +# undef XXH32_update +# undef XXH32_digest +# undef XXH32_copyState +# undef XXH32_canonicalFromHash +# undef XXH32_hashFromCanonical + /* XXH64 */ +# undef XXH64 +# undef XXH64_createState +# undef XXH64_freeState +# undef XXH64_reset +# undef XXH64_update +# undef XXH64_digest +# undef XXH64_copyState +# undef XXH64_canonicalFromHash +# undef XXH64_hashFromCanonical + /* XXH3_64bits */ +# undef XXH3_64bits +# undef XXH3_64bits_withSecret +# undef XXH3_64bits_withSeed +# undef XXH3_64bits_withSecretandSeed +# undef XXH3_createState +# undef XXH3_freeState +# undef XXH3_copyState +# undef XXH3_64bits_reset +# undef XXH3_64bits_reset_withSeed +# undef XXH3_64bits_reset_withSecret +# undef XXH3_64bits_update +# undef XXH3_64bits_digest +# undef XXH3_generateSecret + /* XXH3_128bits */ +# undef XXH128 +# undef XXH3_128bits +# undef XXH3_128bits_withSeed +# undef XXH3_128bits_withSecret +# undef XXH3_128bits_reset +# undef XXH3_128bits_reset_withSeed +# undef XXH3_128bits_reset_withSecret +# undef XXH3_128bits_reset_withSecretandSeed +# undef XXH3_128bits_update +# undef XXH3_128bits_digest +# undef XXH128_isEqual +# undef XXH128_cmp +# undef XXH128_canonicalFromHash +# undef XXH128_hashFromCanonical + /* Finally, free the namespace itself */ +# undef XXH_NAMESPACE -If you want to include _and expose_ xxHash functions from within your own library, -but also want to avoid symbol collisions with another library which also includes xxHash, + /* employ the namespace for XXH_INLINE_ALL */ +# define XXH_NAMESPACE XXH_INLINE_ + /* + * Some identifiers (enums, type names) are not symbols, + * but they must nonetheless be renamed to avoid redeclaration. + * Alternative solution: do not redeclare them. + * However, this requires some #ifdefs, and has a more dispersed impact. + * Meanwhile, renaming can be achieved in a single place. + */ +# define XXH_IPREF(Id) XXH_NAMESPACE ## Id +# define XXH_OK XXH_IPREF(XXH_OK) +# define XXH_ERROR XXH_IPREF(XXH_ERROR) +# define XXH_errorcode XXH_IPREF(XXH_errorcode) +# define XXH32_canonical_t XXH_IPREF(XXH32_canonical_t) +# define XXH64_canonical_t XXH_IPREF(XXH64_canonical_t) +# define XXH128_canonical_t XXH_IPREF(XXH128_canonical_t) +# define XXH32_state_s XXH_IPREF(XXH32_state_s) +# define XXH32_state_t XXH_IPREF(XXH32_state_t) +# define XXH64_state_s XXH_IPREF(XXH64_state_s) +# define XXH64_state_t XXH_IPREF(XXH64_state_t) +# define XXH3_state_s XXH_IPREF(XXH3_state_s) +# define XXH3_state_t XXH_IPREF(XXH3_state_t) +# define XXH128_hash_t XXH_IPREF(XXH128_hash_t) + /* Ensure the header is parsed again, even if it was previously included */ +# undef XXHASH_H_5627135585666179 +# undef XXHASH_H_STATIC_13879238742 +#endif /* XXH_INLINE_ALL || XXH_PRIVATE_API */ -you can use XXH_NAMESPACE, to automatically prefix any public symbol from xxhash library -with the value of XXH_NAMESPACE (so avoid to keep it NULL and avoid numeric values). +/* **************************************************************** + * Stable API + *****************************************************************/ +#ifndef XXHASH_H_5627135585666179 +#define XXHASH_H_5627135585666179 1 + +/*! @brief Marks a global symbol. */ +#if !defined(XXH_INLINE_ALL) && !defined(XXH_PRIVATE_API) +# if defined(WIN32) && defined(_MSC_VER) && (defined(XXH_IMPORT) || defined(XXH_EXPORT)) +# ifdef XXH_EXPORT +# define XXH_PUBLIC_API __declspec(dllexport) +# elif XXH_IMPORT +# define XXH_PUBLIC_API __declspec(dllimport) +# endif +# else +# define XXH_PUBLIC_API /* do nothing */ +# endif +#endif -Note that no change is required within the calling program as long as it includes `xxhash.h` : -regular symbol name will be automatically translated by this header. -*/ #ifdef XXH_NAMESPACE # define XXH_CAT(A,B) A##B # define XXH_NAME2(A,B) XXH_CAT(A,B) -# define XXH32 XXH_NAME2(XXH_NAMESPACE, XXH32) -# define XXH64 XXH_NAME2(XXH_NAMESPACE, XXH64) # define XXH_versionNumber XXH_NAME2(XXH_NAMESPACE, XXH_versionNumber) +/* XXH32 */ +# define XXH32 XXH_NAME2(XXH_NAMESPACE, XXH32) # define XXH32_createState XXH_NAME2(XXH_NAMESPACE, XXH32_createState) -# define XXH64_createState XXH_NAME2(XXH_NAMESPACE, XXH64_createState) # define XXH32_freeState XXH_NAME2(XXH_NAMESPACE, XXH32_freeState) -# define XXH64_freeState XXH_NAME2(XXH_NAMESPACE, XXH64_freeState) # define XXH32_reset XXH_NAME2(XXH_NAMESPACE, XXH32_reset) -# define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset) # define XXH32_update XXH_NAME2(XXH_NAMESPACE, XXH32_update) -# define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update) # define XXH32_digest XXH_NAME2(XXH_NAMESPACE, XXH32_digest) -# define XXH64_digest XXH_NAME2(XXH_NAMESPACE, XXH64_digest) # define XXH32_copyState XXH_NAME2(XXH_NAMESPACE, XXH32_copyState) -# define XXH64_copyState XXH_NAME2(XXH_NAMESPACE, XXH64_copyState) # define XXH32_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH32_canonicalFromHash) -# define XXH64_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH64_canonicalFromHash) # define XXH32_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH32_hashFromCanonical) +/* XXH64 */ +# define XXH64 XXH_NAME2(XXH_NAMESPACE, XXH64) +# define XXH64_createState XXH_NAME2(XXH_NAMESPACE, XXH64_createState) +# define XXH64_freeState XXH_NAME2(XXH_NAMESPACE, XXH64_freeState) +# define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset) +# define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update) +# define XXH64_digest XXH_NAME2(XXH_NAMESPACE, XXH64_digest) +# define XXH64_copyState XXH_NAME2(XXH_NAMESPACE, XXH64_copyState) +# define XXH64_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH64_canonicalFromHash) # define XXH64_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH64_hashFromCanonical) +/* XXH3_64bits */ +# define XXH3_64bits XXH_NAME2(XXH_NAMESPACE, XXH3_64bits) +# define XXH3_64bits_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSecret) +# define XXH3_64bits_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSeed) +# define XXH3_64bits_withSecretandSeed XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSecretandSeed) +# define XXH3_createState XXH_NAME2(XXH_NAMESPACE, XXH3_createState) +# define XXH3_freeState XXH_NAME2(XXH_NAMESPACE, XXH3_freeState) +# define XXH3_copyState XXH_NAME2(XXH_NAMESPACE, XXH3_copyState) +# define XXH3_64bits_reset XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset) +# define XXH3_64bits_reset_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSeed) +# define XXH3_64bits_reset_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSecret) +# define XXH3_64bits_reset_withSecretandSeed XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSecretandSeed) +# define XXH3_64bits_update XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_update) +# define XXH3_64bits_digest XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_digest) +# define XXH3_generateSecret XXH_NAME2(XXH_NAMESPACE, XXH3_generateSecret) +# define XXH3_generateSecret_fromSeed XXH_NAME2(XXH_NAMESPACE, XXH3_generateSecret_fromSeed) +/* XXH3_128bits */ +# define XXH128 XXH_NAME2(XXH_NAMESPACE, XXH128) +# define XXH3_128bits XXH_NAME2(XXH_NAMESPACE, XXH3_128bits) +# define XXH3_128bits_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSeed) +# define XXH3_128bits_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSecret) +# define XXH3_128bits_withSecretandSeed XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSecretandSeed) +# define XXH3_128bits_reset XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset) +# define XXH3_128bits_reset_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset_withSeed) +# define XXH3_128bits_reset_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset_withSecret) +# define XXH3_128bits_reset_withSecretandSeed XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset_withSecretandSeed) +# define XXH3_128bits_update XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_update) +# define XXH3_128bits_digest XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_digest) +# define XXH128_isEqual XXH_NAME2(XXH_NAMESPACE, XXH128_isEqual) +# define XXH128_cmp XXH_NAME2(XXH_NAMESPACE, XXH128_cmp) +# define XXH128_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH128_canonicalFromHash) +# define XXH128_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH128_hashFromCanonical) #endif +/* ************************************* +* Compiler specifics +***************************************/ + +/* specific declaration modes for Windows */ +#if !defined(XXH_INLINE_ALL) && !defined(XXH_PRIVATE_API) +# if defined(WIN32) && defined(_MSC_VER) && (defined(XXH_IMPORT) || defined(XXH_EXPORT)) +# ifdef XXH_EXPORT +# define XXH_PUBLIC_API __declspec(dllexport) +# elif XXH_IMPORT +# define XXH_PUBLIC_API __declspec(dllimport) +# endif +# else +# define XXH_PUBLIC_API /* do nothing */ +# endif +#endif + +#if defined (__GNUC__) +# define XXH_CONSTF __attribute__((const)) +# define XXH_PUREF __attribute__((pure)) +# define XXH_MALLOCF __attribute__((malloc)) +#else +# define XXH_CONSTF /* disable */ +# define XXH_PUREF +# define XXH_MALLOCF +#endif + /* ************************************* * Version ***************************************/ #define XXH_VERSION_MAJOR 0 -#define XXH_VERSION_MINOR 6 +#define XXH_VERSION_MINOR 8 #define XXH_VERSION_RELEASE 2 +/*! @brief Version number, encoded as two digits each */ #define XXH_VERSION_NUMBER (XXH_VERSION_MAJOR *100*100 + XXH_VERSION_MINOR *100 + XXH_VERSION_RELEASE) -XXH_PUBLIC_API unsigned XXH_versionNumber (void); - - -/* **************************** -* Simple Hash Functions -******************************/ -typedef unsigned int XXH32_hash_t; -typedef unsigned long long XXH64_hash_t; - -XXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t length, unsigned int seed); -XXH_PUBLIC_API XXH64_hash_t XXH64 (const void* input, size_t length, unsigned long long seed); /*! -XXH32() : - Calculate the 32-bits hash of sequence "length" bytes stored at memory address "input". - The memory between input & input+length must be valid (allocated and read-accessible). - "seed" can be used to alter the result predictably. - Speed on Core 2 Duo @ 3 GHz (single thread, SMHasher benchmark) : 5.4 GB/s -XXH64() : - Calculate the 64-bits hash of sequence of length "len" stored at memory address "input". - "seed" can be used to alter the result predictably. - This function runs 2x faster on 64-bits systems, but slower on 32-bits systems (see benchmark). -*/ + * @brief Obtains the xxHash version. + * + * This is mostly useful when xxHash is compiled as a shared library, + * since the returned value comes from the library, as opposed to header file. + * + * @return @ref XXH_VERSION_NUMBER of the invoked library. + */ +XXH_PUBLIC_API XXH_CONSTF unsigned XXH_versionNumber (void); /* **************************** -* Streaming Hash Functions +* Common basic types ******************************/ -typedef struct XXH32_state_s XXH32_state_t; /* incomplete type */ -typedef struct XXH64_state_s XXH64_state_t; /* incomplete type */ - -/*! State allocation, compatible with dynamic libraries */ - -XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void); -XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr); - -XXH_PUBLIC_API XXH64_state_t* XXH64_createState(void); -XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr); +#include <stddef.h> /* size_t */ +/*! + * @brief Exit code for the streaming API. + */ +typedef enum { + XXH_OK = 0, /*!< OK */ + XXH_ERROR /*!< Error */ +} XXH_errorcode; -/* hash streaming */ +/*-********************************************************************** +* 32-bit hash +************************************************************************/ +#if defined(XXH_DOXYGEN) /* Don't show <stdint.h> include */ +/*! + * @brief An unsigned 32-bit integer. + * + * Not necessarily defined to `uint32_t` but functionally equivalent. + */ +typedef uint32_t XXH32_hash_t; -XXH_PUBLIC_API XXH_errorcode XXH32_reset (XXH32_state_t* statePtr, unsigned int seed); -XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length); -XXH_PUBLIC_API XXH32_hash_t XXH32_digest (const XXH32_state_t* statePtr); +#elif !defined (__VMS) \ + && (defined (__cplusplus) \ + || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) ) +# ifdef _AIX +# include <inttypes.h> +# else +# include <stdint.h> +# endif + typedef uint32_t XXH32_hash_t; -XXH_PUBLIC_API XXH_errorcode XXH64_reset (XXH64_state_t* statePtr, unsigned long long seed); -XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* statePtr, const void* input, size_t length); -XXH_PUBLIC_API XXH64_hash_t XXH64_digest (const XXH64_state_t* statePtr); - -/* -These functions generate the xxHash of an input provided in multiple segments. -Note that, for small input, they are slower than single-call functions, due to state management. -For small input, prefer `XXH32()` and `XXH64()` . - -XXH state must first be allocated, using XXH*_createState() . - -Start a new hash by initializing state with a seed, using XXH*_reset(). - -Then, feed the hash state by calling XXH*_update() as many times as necessary. -Obviously, input must be allocated and read accessible. -The function returns an error code, with 0 meaning OK, and any other value meaning there is an error. - -Finally, a hash value can be produced anytime, by using XXH*_digest(). -This function returns the nn-bits hash as an int or long long. - -It's still possible to continue inserting input into the hash state after a digest, -and generate some new hashes later on, by calling again XXH*_digest(). - -When done, free XXH state space if it was allocated dynamically. -*/ - - -/* ************************** -* Utils -****************************/ -#if !(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) /* ! C99 */ -# define restrict /* disable restrict */ +#else +# include <limits.h> +# if UINT_MAX == 0xFFFFFFFFUL + typedef unsigned int XXH32_hash_t; +# elif ULONG_MAX == 0xFFFFFFFFUL + typedef unsigned long XXH32_hash_t; +# else +# error "unsupported platform: need a 32-bit type" +# endif #endif -XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* restrict dst_state, const XXH32_state_t* restrict src_state); -XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* restrict dst_state, const XXH64_state_t* restrict src_state); +/*! + * @} + * + * @defgroup XXH32_family XXH32 family + * @ingroup public + * Contains functions used in the classic 32-bit xxHash algorithm. + * + * @note + * XXH32 is useful for older platforms, with no or poor 64-bit performance. + * Note that the @ref XXH3_family provides competitive speed for both 32-bit + * and 64-bit systems, and offers true 64/128 bit hash results. + * + * @see @ref XXH64_family, @ref XXH3_family : Other xxHash families + * @see @ref XXH32_impl for implementation details + * @{ + */ +/*! + * @brief Calculates the 32-bit hash of @p input using xxHash32. + * + * @param input The block of data to be hashed, at least @p length bytes in size. + * @param length The length of @p input, in bytes. + * @param seed The 32-bit seed to alter the hash's output predictably. + * + * @pre + * The memory between @p input and @p input + @p length must be valid, + * readable, contiguous memory. However, if @p length is `0`, @p input may be + * `NULL`. In C++, this also must be *TriviallyCopyable*. + * + * @return The calculated 32-bit xxHash32 value. + * + * @see @ref single_shot_example "Single Shot Example" for an example. + */ +XXH_PUBLIC_API XXH_PUREF XXH32_hash_t XXH32 (const void* input, size_t length, XXH32_hash_t seed); -/* ************************** -* Canonical representation -****************************/ -/* Default result type for XXH functions are primitive unsigned 32 and 64 bits. -* The canonical representation uses human-readable write convention, aka big-endian (large digits first). -* These functions allow transformation of hash result into and from its canonical format. -* This way, hash values can be written into a file / memory, and remain comparable on different systems and programs. -*/ -typedef struct { unsigned char digest[4]; } XXH32_canonical_t; -typedef struct { unsigned char digest[8]; } XXH64_canonical_t; +#ifndef XXH_NO_STREAM +/*! + * @typedef struct XXH32_state_s XXH32_state_t + * @brief The opaque state struct for the XXH32 streaming API. + * + * @see XXH32_state_s for details. + */ +typedef struct XXH32_state_s XXH32_state_t; +/*! + * @brief Allocates an @ref XXH32_state_t. + * + * @return An allocated pointer of @ref XXH32_state_t on success. + * @return `NULL` on failure. + * + * @note Must be freed with XXH32_freeState(). + */ +XXH_PUBLIC_API XXH_MALLOCF XXH32_state_t* XXH32_createState(void); +/*! + * @brief Frees an @ref XXH32_state_t. + * + * @param statePtr A pointer to an @ref XXH32_state_t allocated with @ref XXH32_createState(). + * + * @return @ref XXH_OK. + * + * @note @p statePtr must be allocated with XXH32_createState(). + * + */ +XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr); +/*! + * @brief Copies one @ref XXH32_state_t to another. + * + * @param dst_state The state to copy to. + * @param src_state The state to copy from. + * @pre + * @p dst_state and @p src_state must not be `NULL` and must not overlap. + */ +XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* dst_state, const XXH32_state_t* src_state); + +/*! + * @brief Resets an @ref XXH32_state_t to begin a new hash. + * + * @param statePtr The state struct to reset. + * @param seed The 32-bit seed to alter the hash result predictably. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return @ref XXH_OK on success. + * @return @ref XXH_ERROR on failure. + * + * @note This function resets and seeds a state. Call it before @ref XXH32_update(). + */ +XXH_PUBLIC_API XXH_errorcode XXH32_reset (XXH32_state_t* statePtr, XXH32_hash_t seed); + +/*! + * @brief Consumes a block of @p input to an @ref XXH32_state_t. + * + * @param statePtr The state struct to update. + * @param input The block of data to be hashed, at least @p length bytes in size. + * @param length The length of @p input, in bytes. + * + * @pre + * @p statePtr must not be `NULL`. + * @pre + * The memory between @p input and @p input + @p length must be valid, + * readable, contiguous memory. However, if @p length is `0`, @p input may be + * `NULL`. In C++, this also must be *TriviallyCopyable*. + * + * @return @ref XXH_OK on success. + * @return @ref XXH_ERROR on failure. + * + * @note Call this to incrementally consume blocks of data. + */ +XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length); + +/*! + * @brief Returns the calculated hash value from an @ref XXH32_state_t. + * + * @param statePtr The state struct to calculate the hash from. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return The calculated 32-bit xxHash32 value from that state. + * + * @note + * Calling XXH32_digest() will not affect @p statePtr, so you can update, + * digest, and update again. + */ +XXH_PUBLIC_API XXH_PUREF XXH32_hash_t XXH32_digest (const XXH32_state_t* statePtr); +#endif /* !XXH_NO_STREAM */ + +/******* Canonical representation *******/ + +/*! + * @brief Canonical (big endian) representation of @ref XXH32_hash_t. + */ +typedef struct { + unsigned char digest[4]; /*!< Hash bytes, big endian */ +} XXH32_canonical_t; + +/*! + * @brief Converts an @ref XXH32_hash_t to a big endian @ref XXH32_canonical_t. + * + * @param dst The @ref XXH32_canonical_t pointer to be stored to. + * @param hash The @ref XXH32_hash_t to be converted. + * + * @pre + * @p dst must not be `NULL`. + * + * @see @ref canonical_representation_example "Canonical Representation Example" + */ XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash); -XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash); -XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src); -XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src); +/*! + * @brief Converts an @ref XXH32_canonical_t to a native @ref XXH32_hash_t. + * + * @param src The @ref XXH32_canonical_t to convert. + * + * @pre + * @p src must not be `NULL`. + * + * @return The converted hash. + * + * @see @ref canonical_representation_example "Canonical Representation Example" + */ +XXH_PUBLIC_API XXH_PUREF XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src); + +/*! @cond Doxygen ignores this part */ +#ifdef __has_attribute +# define XXH_HAS_ATTRIBUTE(x) __has_attribute(x) +#else +# define XXH_HAS_ATTRIBUTE(x) 0 +#endif +/*! @endcond */ + +/*! @cond Doxygen ignores this part */ +/* + * C23 __STDC_VERSION__ number hasn't been specified yet. For now + * leave as `201711L` (C17 + 1). + * TODO: Update to correct value when its been specified. + */ +#define XXH_C23_VN 201711L +/*! @endcond */ + +/*! @cond Doxygen ignores this part */ +/* C-language Attributes are added in C23. */ +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= XXH_C23_VN) && defined(__has_c_attribute) +# define XXH_HAS_C_ATTRIBUTE(x) __has_c_attribute(x) +#else +# define XXH_HAS_C_ATTRIBUTE(x) 0 +#endif +/*! @endcond */ + +/*! @cond Doxygen ignores this part */ +#if defined(__cplusplus) && defined(__has_cpp_attribute) +# define XXH_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x) +#else +# define XXH_HAS_CPP_ATTRIBUTE(x) 0 +#endif +/*! @endcond */ + +/*! @cond Doxygen ignores this part */ +/* + * Define XXH_FALLTHROUGH macro for annotating switch case with the 'fallthrough' attribute + * introduced in CPP17 and C23. + * CPP17 : https://en.cppreference.com/w/cpp/language/attributes/fallthrough + * C23 : https://en.cppreference.com/w/c/language/attributes/fallthrough + */ +#if XXH_HAS_C_ATTRIBUTE(fallthrough) || XXH_HAS_CPP_ATTRIBUTE(fallthrough) +# define XXH_FALLTHROUGH [[fallthrough]] +#elif XXH_HAS_ATTRIBUTE(__fallthrough__) +# define XXH_FALLTHROUGH __attribute__ ((__fallthrough__)) +#else +# define XXH_FALLTHROUGH /* fallthrough */ +#endif +/*! @endcond */ + +/*! @cond Doxygen ignores this part */ +/* + * Define XXH_NOESCAPE for annotated pointers in public API. + * https://clang.llvm.org/docs/AttributeReference.html#noescape + * As of writing this, only supported by clang. + */ +#if XXH_HAS_ATTRIBUTE(noescape) +# define XXH_NOESCAPE __attribute__((noescape)) +#else +# define XXH_NOESCAPE +#endif +/*! @endcond */ + + +/*! + * @} + * @ingroup public + * @{ + */ + +#ifndef XXH_NO_LONG_LONG +/*-********************************************************************** +* 64-bit hash +************************************************************************/ +#if defined(XXH_DOXYGEN) /* don't include <stdint.h> */ +/*! + * @brief An unsigned 64-bit integer. + * + * Not necessarily defined to `uint64_t` but functionally equivalent. + */ +typedef uint64_t XXH64_hash_t; +#elif !defined (__VMS) \ + && (defined (__cplusplus) \ + || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) ) +# ifdef _AIX +# include <inttypes.h> +# else +# include <stdint.h> +# endif + typedef uint64_t XXH64_hash_t; +#else +# include <limits.h> +# if defined(__LP64__) && ULONG_MAX == 0xFFFFFFFFFFFFFFFFULL + /* LP64 ABI says uint64_t is unsigned long */ + typedef unsigned long XXH64_hash_t; +# else + /* the following type must have a width of 64-bit */ + typedef unsigned long long XXH64_hash_t; +# endif +#endif + +/*! + * @} + * + * @defgroup XXH64_family XXH64 family + * @ingroup public + * @{ + * Contains functions used in the classic 64-bit xxHash algorithm. + * + * @note + * XXH3 provides competitive speed for both 32-bit and 64-bit systems, + * and offers true 64/128 bit hash results. + * It provides better speed for systems with vector processing capabilities. + */ + +/*! + * @brief Calculates the 64-bit hash of @p input using xxHash64. + * + * @param input The block of data to be hashed, at least @p length bytes in size. + * @param length The length of @p input, in bytes. + * @param seed The 64-bit seed to alter the hash's output predictably. + * + * @pre + * The memory between @p input and @p input + @p length must be valid, + * readable, contiguous memory. However, if @p length is `0`, @p input may be + * `NULL`. In C++, this also must be *TriviallyCopyable*. + * + * @return The calculated 64-bit xxHash64 value. + * + * @see @ref single_shot_example "Single Shot Example" for an example. + */ +XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH64(XXH_NOESCAPE const void* input, size_t length, XXH64_hash_t seed); + +/******* Streaming *******/ +#ifndef XXH_NO_STREAM +/*! + * @brief The opaque state struct for the XXH64 streaming API. + * + * @see XXH64_state_s for details. + */ +typedef struct XXH64_state_s XXH64_state_t; /* incomplete type */ + +/*! + * @brief Allocates an @ref XXH64_state_t. + * + * @return An allocated pointer of @ref XXH64_state_t on success. + * @return `NULL` on failure. + * + * @note Must be freed with XXH64_freeState(). + */ +XXH_PUBLIC_API XXH_MALLOCF XXH64_state_t* XXH64_createState(void); + +/*! + * @brief Frees an @ref XXH64_state_t. + * + * @param statePtr A pointer to an @ref XXH64_state_t allocated with @ref XXH64_createState(). + * + * @return @ref XXH_OK. + * + * @note @p statePtr must be allocated with XXH64_createState(). + */ +XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr); + +/*! + * @brief Copies one @ref XXH64_state_t to another. + * + * @param dst_state The state to copy to. + * @param src_state The state to copy from. + * @pre + * @p dst_state and @p src_state must not be `NULL` and must not overlap. + */ +XXH_PUBLIC_API void XXH64_copyState(XXH_NOESCAPE XXH64_state_t* dst_state, const XXH64_state_t* src_state); + +/*! + * @brief Resets an @ref XXH64_state_t to begin a new hash. + * + * @param statePtr The state struct to reset. + * @param seed The 64-bit seed to alter the hash result predictably. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return @ref XXH_OK on success. + * @return @ref XXH_ERROR on failure. + * + * @note This function resets and seeds a state. Call it before @ref XXH64_update(). + */ +XXH_PUBLIC_API XXH_errorcode XXH64_reset (XXH_NOESCAPE XXH64_state_t* statePtr, XXH64_hash_t seed); + +/*! + * @brief Consumes a block of @p input to an @ref XXH64_state_t. + * + * @param statePtr The state struct to update. + * @param input The block of data to be hashed, at least @p length bytes in size. + * @param length The length of @p input, in bytes. + * + * @pre + * @p statePtr must not be `NULL`. + * @pre + * The memory between @p input and @p input + @p length must be valid, + * readable, contiguous memory. However, if @p length is `0`, @p input may be + * `NULL`. In C++, this also must be *TriviallyCopyable*. + * + * @return @ref XXH_OK on success. + * @return @ref XXH_ERROR on failure. + * + * @note Call this to incrementally consume blocks of data. + */ +XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH_NOESCAPE XXH64_state_t* statePtr, XXH_NOESCAPE const void* input, size_t length); + +/*! + * @brief Returns the calculated hash value from an @ref XXH64_state_t. + * + * @param statePtr The state struct to calculate the hash from. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return The calculated 64-bit xxHash64 value from that state. + * + * @note + * Calling XXH64_digest() will not affect @p statePtr, so you can update, + * digest, and update again. + */ +XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH64_digest (XXH_NOESCAPE const XXH64_state_t* statePtr); +#endif /* !XXH_NO_STREAM */ +/******* Canonical representation *******/ + +/*! + * @brief Canonical (big endian) representation of @ref XXH64_hash_t. + */ +typedef struct { unsigned char digest[sizeof(XXH64_hash_t)]; } XXH64_canonical_t; + +/*! + * @brief Converts an @ref XXH64_hash_t to a big endian @ref XXH64_canonical_t. + * + * @param dst The @ref XXH64_canonical_t pointer to be stored to. + * @param hash The @ref XXH64_hash_t to be converted. + * + * @pre + * @p dst must not be `NULL`. + * + * @see @ref canonical_representation_example "Canonical Representation Example" + */ +XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH_NOESCAPE XXH64_canonical_t* dst, XXH64_hash_t hash); + +/*! + * @brief Converts an @ref XXH64_canonical_t to a native @ref XXH64_hash_t. + * + * @param src The @ref XXH64_canonical_t to convert. + * + * @pre + * @p src must not be `NULL`. + * + * @return The converted hash. + * + * @see @ref canonical_representation_example "Canonical Representation Example" + */ +XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH64_hashFromCanonical(XXH_NOESCAPE const XXH64_canonical_t* src); + +#ifndef XXH_NO_XXH3 + +/*! + * @} + * ************************************************************************ + * @defgroup XXH3_family XXH3 family + * @ingroup public + * @{ + * + * XXH3 is a more recent hash algorithm featuring: + * - Improved speed for both small and large inputs + * - True 64-bit and 128-bit outputs + * - SIMD acceleration + * - Improved 32-bit viability + * + * Speed analysis methodology is explained here: + * + * https://fastcompression.blogspot.com/2019/03/presenting-xxh3.html + * + * Compared to XXH64, expect XXH3 to run approximately + * ~2x faster on large inputs and >3x faster on small ones, + * exact differences vary depending on platform. + * + * XXH3's speed benefits greatly from SIMD and 64-bit arithmetic, + * but does not require it. + * Most 32-bit and 64-bit targets that can run XXH32 smoothly can run XXH3 + * at competitive speeds, even without vector support. Further details are + * explained in the implementation. + * + * XXH3 has a fast scalar implementation, but it also includes accelerated SIMD + * implementations for many common platforms: + * - AVX512 + * - AVX2 + * - SSE2 + * - ARM NEON + * - WebAssembly SIMD128 + * - POWER8 VSX + * - s390x ZVector + * This can be controlled via the @ref XXH_VECTOR macro, but it automatically + * selects the best version according to predefined macros. For the x86 family, an + * automatic runtime dispatcher is included separately in @ref xxh_x86dispatch.c. + * + * XXH3 implementation is portable: + * it has a generic C90 formulation that can be compiled on any platform, + * all implementations generate exactly the same hash value on all platforms. + * Starting from v0.8.0, it's also labelled "stable", meaning that + * any future version will also generate the same hash value. + * + * XXH3 offers 2 variants, _64bits and _128bits. + * + * When only 64 bits are needed, prefer invoking the _64bits variant, as it + * reduces the amount of mixing, resulting in faster speed on small inputs. + * It's also generally simpler to manipulate a scalar return type than a struct. + * + * The API supports one-shot hashing, streaming mode, and custom secrets. + */ +/*-********************************************************************** +* XXH3 64-bit variant +************************************************************************/ + +/*! + * @brief Calculates 64-bit unseeded variant of XXH3 hash of @p input. + * + * @param input The block of data to be hashed, at least @p length bytes in size. + * @param length The length of @p input, in bytes. + * + * @pre + * The memory between @p input and @p input + @p length must be valid, + * readable, contiguous memory. However, if @p length is `0`, @p input may be + * `NULL`. In C++, this also must be *TriviallyCopyable*. + * + * @return The calculated 64-bit XXH3 hash value. + * + * @note + * This is equivalent to @ref XXH3_64bits_withSeed() with a seed of `0`, however + * it may have slightly better performance due to constant propagation of the + * defaults. + * + * @see + * XXH3_64bits_withSeed(), XXH3_64bits_withSecret(): other seeding variants + * @see @ref single_shot_example "Single Shot Example" for an example. + */ +XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH3_64bits(XXH_NOESCAPE const void* input, size_t length); + +/*! + * @brief Calculates 64-bit seeded variant of XXH3 hash of @p input. + * + * @param input The block of data to be hashed, at least @p length bytes in size. + * @param length The length of @p input, in bytes. + * @param seed The 64-bit seed to alter the hash result predictably. + * + * @pre + * The memory between @p input and @p input + @p length must be valid, + * readable, contiguous memory. However, if @p length is `0`, @p input may be + * `NULL`. In C++, this also must be *TriviallyCopyable*. + * + * @return The calculated 64-bit XXH3 hash value. + * + * @note + * seed == 0 produces the same results as @ref XXH3_64bits(). + * + * This variant generates a custom secret on the fly based on default secret + * altered using the @p seed value. + * + * While this operation is decently fast, note that it's not completely free. + * + * @see @ref single_shot_example "Single Shot Example" for an example. + */ +XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH3_64bits_withSeed(XXH_NOESCAPE const void* input, size_t length, XXH64_hash_t seed); + +/*! + * The bare minimum size for a custom secret. + * + * @see + * XXH3_64bits_withSecret(), XXH3_64bits_reset_withSecret(), + * XXH3_128bits_withSecret(), XXH3_128bits_reset_withSecret(). + */ +#define XXH3_SECRET_SIZE_MIN 136 + +/*! + * @brief Calculates 64-bit variant of XXH3 with a custom "secret". + * + * @param data The block of data to be hashed, at least @p len bytes in size. + * @param len The length of @p data, in bytes. + * @param secret The secret data. + * @param secretSize The length of @p secret, in bytes. + * + * @return The calculated 64-bit XXH3 hash value. + * + * @pre + * The memory between @p data and @p data + @p len must be valid, + * readable, contiguous memory. However, if @p length is `0`, @p data may be + * `NULL`. In C++, this also must be *TriviallyCopyable*. + * + * It's possible to provide any blob of bytes as a "secret" to generate the hash. + * This makes it more difficult for an external actor to prepare an intentional collision. + * The main condition is that @p secretSize *must* be large enough (>= @ref XXH3_SECRET_SIZE_MIN). + * However, the quality of the secret impacts the dispersion of the hash algorithm. + * Therefore, the secret _must_ look like a bunch of random bytes. + * Avoid "trivial" or structured data such as repeated sequences or a text document. + * Whenever in doubt about the "randomness" of the blob of bytes, + * consider employing @ref XXH3_generateSecret() instead (see below). + * It will generate a proper high entropy secret derived from the blob of bytes. + * Another advantage of using XXH3_generateSecret() is that + * it guarantees that all bits within the initial blob of bytes + * will impact every bit of the output. + * This is not necessarily the case when using the blob of bytes directly + * because, when hashing _small_ inputs, only a portion of the secret is employed. + * + * @see @ref single_shot_example "Single Shot Example" for an example. + */ +XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH3_64bits_withSecret(XXH_NOESCAPE const void* data, size_t len, XXH_NOESCAPE const void* secret, size_t secretSize); + + +/******* Streaming *******/ +#ifndef XXH_NO_STREAM +/* + * Streaming requires state maintenance. + * This operation costs memory and CPU. + * As a consequence, streaming is slower than one-shot hashing. + * For better performance, prefer one-shot functions whenever applicable. + */ + +/*! + * @brief The opaque state struct for the XXH3 streaming API. + * + * @see XXH3_state_s for details. + */ +typedef struct XXH3_state_s XXH3_state_t; +XXH_PUBLIC_API XXH_MALLOCF XXH3_state_t* XXH3_createState(void); +XXH_PUBLIC_API XXH_errorcode XXH3_freeState(XXH3_state_t* statePtr); + +/*! + * @brief Copies one @ref XXH3_state_t to another. + * + * @param dst_state The state to copy to. + * @param src_state The state to copy from. + * @pre + * @p dst_state and @p src_state must not be `NULL` and must not overlap. + */ +XXH_PUBLIC_API void XXH3_copyState(XXH_NOESCAPE XXH3_state_t* dst_state, XXH_NOESCAPE const XXH3_state_t* src_state); + +/*! + * @brief Resets an @ref XXH3_state_t to begin a new hash. + * + * @param statePtr The state struct to reset. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return @ref XXH_OK on success. + * @return @ref XXH_ERROR on failure. + * + * @note + * - This function resets `statePtr` and generate a secret with default parameters. + * - Call this function before @ref XXH3_64bits_update(). + * - Digest will be equivalent to `XXH3_64bits()`. + * + */ +XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset(XXH_NOESCAPE XXH3_state_t* statePtr); + +/*! + * @brief Resets an @ref XXH3_state_t with 64-bit seed to begin a new hash. + * + * @param statePtr The state struct to reset. + * @param seed The 64-bit seed to alter the hash result predictably. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return @ref XXH_OK on success. + * @return @ref XXH_ERROR on failure. + * + * @note + * - This function resets `statePtr` and generate a secret from `seed`. + * - Call this function before @ref XXH3_64bits_update(). + * - Digest will be equivalent to `XXH3_64bits_withSeed()`. + * + */ +XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset_withSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH64_hash_t seed); + +/*! + * @brief Resets an @ref XXH3_state_t with secret data to begin a new hash. + * + * @param statePtr The state struct to reset. + * @param secret The secret data. + * @param secretSize The length of @p secret, in bytes. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return @ref XXH_OK on success. + * @return @ref XXH_ERROR on failure. + * + * @note + * `secret` is referenced, it _must outlive_ the hash streaming session. + * + * Similar to one-shot API, `secretSize` must be >= @ref XXH3_SECRET_SIZE_MIN, + * and the quality of produced hash values depends on secret's entropy + * (secret's content should look like a bunch of random bytes). + * When in doubt about the randomness of a candidate `secret`, + * consider employing `XXH3_generateSecret()` instead (see below). + */ +XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset_withSecret(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize); + +/*! + * @brief Consumes a block of @p input to an @ref XXH3_state_t. + * + * @param statePtr The state struct to update. + * @param input The block of data to be hashed, at least @p length bytes in size. + * @param length The length of @p input, in bytes. + * + * @pre + * @p statePtr must not be `NULL`. + * @pre + * The memory between @p input and @p input + @p length must be valid, + * readable, contiguous memory. However, if @p length is `0`, @p input may be + * `NULL`. In C++, this also must be *TriviallyCopyable*. + * + * @return @ref XXH_OK on success. + * @return @ref XXH_ERROR on failure. + * + * @note Call this to incrementally consume blocks of data. + */ +XXH_PUBLIC_API XXH_errorcode XXH3_64bits_update (XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* input, size_t length); + +/*! + * @brief Returns the calculated XXH3 64-bit hash value from an @ref XXH3_state_t. + * + * @param statePtr The state struct to calculate the hash from. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return The calculated XXH3 64-bit hash value from that state. + * + * @note + * Calling XXH3_64bits_digest() will not affect @p statePtr, so you can update, + * digest, and update again. + */ +XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH3_64bits_digest (XXH_NOESCAPE const XXH3_state_t* statePtr); +#endif /* !XXH_NO_STREAM */ + +/* note : canonical representation of XXH3 is the same as XXH64 + * since they both produce XXH64_hash_t values */ + + +/*-********************************************************************** +* XXH3 128-bit variant +************************************************************************/ + +/*! + * @brief The return value from 128-bit hashes. + * + * Stored in little endian order, although the fields themselves are in native + * endianness. + */ +typedef struct { + XXH64_hash_t low64; /*!< `value & 0xFFFFFFFFFFFFFFFF` */ + XXH64_hash_t high64; /*!< `value >> 64` */ +} XXH128_hash_t; + +/*! + * @brief Calculates 128-bit unseeded variant of XXH3 of @p data. + * + * @param data The block of data to be hashed, at least @p length bytes in size. + * @param len The length of @p data, in bytes. + * + * @return The calculated 128-bit variant of XXH3 value. + * + * The 128-bit variant of XXH3 has more strength, but it has a bit of overhead + * for shorter inputs. + * + * This is equivalent to @ref XXH3_128bits_withSeed() with a seed of `0`, however + * it may have slightly better performance due to constant propagation of the + * defaults. + * + * @see XXH3_128bits_withSeed(), XXH3_128bits_withSecret(): other seeding variants + * @see @ref single_shot_example "Single Shot Example" for an example. + */ +XXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH3_128bits(XXH_NOESCAPE const void* data, size_t len); +/*! @brief Calculates 128-bit seeded variant of XXH3 hash of @p data. + * + * @param data The block of data to be hashed, at least @p length bytes in size. + * @param len The length of @p data, in bytes. + * @param seed The 64-bit seed to alter the hash result predictably. + * + * @return The calculated 128-bit variant of XXH3 value. + * + * @note + * seed == 0 produces the same results as @ref XXH3_64bits(). + * + * This variant generates a custom secret on the fly based on default secret + * altered using the @p seed value. + * + * While this operation is decently fast, note that it's not completely free. + * + * @see XXH3_128bits(), XXH3_128bits_withSecret(): other seeding variants + * @see @ref single_shot_example "Single Shot Example" for an example. + */ +XXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH3_128bits_withSeed(XXH_NOESCAPE const void* data, size_t len, XXH64_hash_t seed); +/*! + * @brief Calculates 128-bit variant of XXH3 with a custom "secret". + * + * @param data The block of data to be hashed, at least @p len bytes in size. + * @param len The length of @p data, in bytes. + * @param secret The secret data. + * @param secretSize The length of @p secret, in bytes. + * + * @return The calculated 128-bit variant of XXH3 value. + * + * It's possible to provide any blob of bytes as a "secret" to generate the hash. + * This makes it more difficult for an external actor to prepare an intentional collision. + * The main condition is that @p secretSize *must* be large enough (>= @ref XXH3_SECRET_SIZE_MIN). + * However, the quality of the secret impacts the dispersion of the hash algorithm. + * Therefore, the secret _must_ look like a bunch of random bytes. + * Avoid "trivial" or structured data such as repeated sequences or a text document. + * Whenever in doubt about the "randomness" of the blob of bytes, + * consider employing @ref XXH3_generateSecret() instead (see below). + * It will generate a proper high entropy secret derived from the blob of bytes. + * Another advantage of using XXH3_generateSecret() is that + * it guarantees that all bits within the initial blob of bytes + * will impact every bit of the output. + * This is not necessarily the case when using the blob of bytes directly + * because, when hashing _small_ inputs, only a portion of the secret is employed. + * + * @see @ref single_shot_example "Single Shot Example" for an example. + */ +XXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH3_128bits_withSecret(XXH_NOESCAPE const void* data, size_t len, XXH_NOESCAPE const void* secret, size_t secretSize); + +/******* Streaming *******/ +#ifndef XXH_NO_STREAM +/* + * Streaming requires state maintenance. + * This operation costs memory and CPU. + * As a consequence, streaming is slower than one-shot hashing. + * For better performance, prefer one-shot functions whenever applicable. + * + * XXH3_128bits uses the same XXH3_state_t as XXH3_64bits(). + * Use already declared XXH3_createState() and XXH3_freeState(). + * + * All reset and streaming functions have same meaning as their 64-bit counterpart. + */ + +/*! + * @brief Resets an @ref XXH3_state_t to begin a new hash. + * + * @param statePtr The state struct to reset. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return @ref XXH_OK on success. + * @return @ref XXH_ERROR on failure. + * + * @note + * - This function resets `statePtr` and generate a secret with default parameters. + * - Call it before @ref XXH3_128bits_update(). + * - Digest will be equivalent to `XXH3_128bits()`. + */ +XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset(XXH_NOESCAPE XXH3_state_t* statePtr); + +/*! + * @brief Resets an @ref XXH3_state_t with 64-bit seed to begin a new hash. + * + * @param statePtr The state struct to reset. + * @param seed The 64-bit seed to alter the hash result predictably. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return @ref XXH_OK on success. + * @return @ref XXH_ERROR on failure. + * + * @note + * - This function resets `statePtr` and generate a secret from `seed`. + * - Call it before @ref XXH3_128bits_update(). + * - Digest will be equivalent to `XXH3_128bits_withSeed()`. + */ +XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset_withSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH64_hash_t seed); +/*! + * @brief Resets an @ref XXH3_state_t with secret data to begin a new hash. + * + * @param statePtr The state struct to reset. + * @param secret The secret data. + * @param secretSize The length of @p secret, in bytes. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return @ref XXH_OK on success. + * @return @ref XXH_ERROR on failure. + * + * `secret` is referenced, it _must outlive_ the hash streaming session. + * Similar to one-shot API, `secretSize` must be >= @ref XXH3_SECRET_SIZE_MIN, + * and the quality of produced hash values depends on secret's entropy + * (secret's content should look like a bunch of random bytes). + * When in doubt about the randomness of a candidate `secret`, + * consider employing `XXH3_generateSecret()` instead (see below). + */ +XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset_withSecret(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize); + +/*! + * @brief Consumes a block of @p input to an @ref XXH3_state_t. + * + * Call this to incrementally consume blocks of data. + * + * @param statePtr The state struct to update. + * @param input The block of data to be hashed, at least @p length bytes in size. + * @param length The length of @p input, in bytes. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return @ref XXH_OK on success. + * @return @ref XXH_ERROR on failure. + * + * @note + * The memory between @p input and @p input + @p length must be valid, + * readable, contiguous memory. However, if @p length is `0`, @p input may be + * `NULL`. In C++, this also must be *TriviallyCopyable*. + * + */ +XXH_PUBLIC_API XXH_errorcode XXH3_128bits_update (XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* input, size_t length); + +/*! + * @brief Returns the calculated XXH3 128-bit hash value from an @ref XXH3_state_t. + * + * @param statePtr The state struct to calculate the hash from. + * + * @pre + * @p statePtr must not be `NULL`. + * + * @return The calculated XXH3 128-bit hash value from that state. + * + * @note + * Calling XXH3_128bits_digest() will not affect @p statePtr, so you can update, + * digest, and update again. + * + */ +XXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH3_128bits_digest (XXH_NOESCAPE const XXH3_state_t* statePtr); +#endif /* !XXH_NO_STREAM */ + +/* Following helper functions make it possible to compare XXH128_hast_t values. + * Since XXH128_hash_t is a structure, this capability is not offered by the language. + * Note: For better performance, these functions can be inlined using XXH_INLINE_ALL */ + +/*! + * @brief Check equality of two XXH128_hash_t values + * + * @param h1 The 128-bit hash value. + * @param h2 Another 128-bit hash value. + * + * @return `1` if `h1` and `h2` are equal. + * @return `0` if they are not. + */ +XXH_PUBLIC_API XXH_PUREF int XXH128_isEqual(XXH128_hash_t h1, XXH128_hash_t h2); + +/*! + * @brief Compares two @ref XXH128_hash_t + * + * This comparator is compatible with stdlib's `qsort()`/`bsearch()`. + * + * @param h128_1 Left-hand side value + * @param h128_2 Right-hand side value + * + * @return >0 if @p h128_1 > @p h128_2 + * @return =0 if @p h128_1 == @p h128_2 + * @return <0 if @p h128_1 < @p h128_2 + */ +XXH_PUBLIC_API XXH_PUREF int XXH128_cmp(XXH_NOESCAPE const void* h128_1, XXH_NOESCAPE const void* h128_2); + + +/******* Canonical representation *******/ +typedef struct { unsigned char digest[sizeof(XXH128_hash_t)]; } XXH128_canonical_t; + + +/*! + * @brief Converts an @ref XXH128_hash_t to a big endian @ref XXH128_canonical_t. + * + * @param dst The @ref XXH128_canonical_t pointer to be stored to. + * @param hash The @ref XXH128_hash_t to be converted. + * + * @pre + * @p dst must not be `NULL`. + * @see @ref canonical_representation_example "Canonical Representation Example" + */ +XXH_PUBLIC_API void XXH128_canonicalFromHash(XXH_NOESCAPE XXH128_canonical_t* dst, XXH128_hash_t hash); + +/*! + * @brief Converts an @ref XXH128_canonical_t to a native @ref XXH128_hash_t. + * + * @param src The @ref XXH128_canonical_t to convert. + * + * @pre + * @p src must not be `NULL`. + * + * @return The converted hash. + * @see @ref canonical_representation_example "Canonical Representation Example" + */ +XXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH128_hashFromCanonical(XXH_NOESCAPE const XXH128_canonical_t* src); + + +#endif /* !XXH_NO_XXH3 */ +#endif /* XXH_NO_LONG_LONG */ + +/*! + * @} + */ #endif /* XXHASH_H_5627135585666179 */ -/* ================================================================================================ - This section contains definitions which are not guaranteed to remain stable. - They may change in future versions, becoming incompatible with a different version of the library. - They shall only be used with static linking. - Never use these definitions in association with dynamic linking ! -=================================================================================================== */ -#if !defined(XXH_STATIC_H_3543687687345) -#define XXH_STATIC_H_3543687687345 +#if defined(XXH_STATIC_LINKING_ONLY) && !defined(XXHASH_H_STATIC_13879238742) +#define XXHASH_H_STATIC_13879238742 +/* **************************************************************************** + * This section contains declarations which are not guaranteed to remain stable. + * They may change in future versions, becoming incompatible with a different + * version of the library. + * These declarations should only be used with static linking. + * Never use them in association with dynamic linking! + ***************************************************************************** */ -/* These definitions are only meant to allow allocation of XXH state - statically, on stack, or in a struct for example. - Do not use members directly. */ +/* + * These definitions are only present to allow static allocation + * of XXH states, on stack or in a struct, for example. + * Never **ever** access their members directly. + */ - struct XXH32_state_s { - unsigned total_len_32; - unsigned large_len; - unsigned v1; - unsigned v2; - unsigned v3; - unsigned v4; - unsigned mem32[4]; /* buffer defined as U32 for alignment */ - unsigned memsize; - unsigned reserved; /* never read nor write, will be removed in a future version */ - }; /* typedef'd to XXH32_state_t */ - - struct XXH64_state_s { - unsigned long long total_len; - unsigned long long v1; - unsigned long long v2; - unsigned long long v3; - unsigned long long v4; - unsigned long long mem64[4]; /* buffer defined as U64 for alignment */ - unsigned memsize; - unsigned reserved[2]; /* never read nor write, will be removed in a future version */ - }; /* typedef'd to XXH64_state_t */ +/*! + * @internal + * @brief Structure for XXH32 streaming API. + * + * @note This is only defined when @ref XXH_STATIC_LINKING_ONLY, + * @ref XXH_INLINE_ALL, or @ref XXH_IMPLEMENTATION is defined. Otherwise it is + * an opaque type. This allows fields to safely be changed. + * + * Typedef'd to @ref XXH32_state_t. + * Do not access the members of this struct directly. + * @see XXH64_state_s, XXH3_state_s + */ +struct XXH32_state_s { + XXH32_hash_t total_len_32; /*!< Total length hashed, modulo 2^32 */ + XXH32_hash_t large_len; /*!< Whether the hash is >= 16 (handles @ref total_len_32 overflow) */ + XXH32_hash_t v[4]; /*!< Accumulator lanes */ + XXH32_hash_t mem32[4]; /*!< Internal buffer for partial reads. Treated as unsigned char[16]. */ + XXH32_hash_t memsize; /*!< Amount of data in @ref mem32 */ + XXH32_hash_t reserved; /*!< Reserved field. Do not read nor write to it. */ +}; /* typedef'd to XXH32_state_t */ -# ifdef XXH_PRIVATE_API -# include "xxhash.c" /* include xxhash functions as `static`, for inlining */ +#ifndef XXH_NO_LONG_LONG /* defined when there is no 64-bit support */ + +/*! + * @internal + * @brief Structure for XXH64 streaming API. + * + * @note This is only defined when @ref XXH_STATIC_LINKING_ONLY, + * @ref XXH_INLINE_ALL, or @ref XXH_IMPLEMENTATION is defined. Otherwise it is + * an opaque type. This allows fields to safely be changed. + * + * Typedef'd to @ref XXH64_state_t. + * Do not access the members of this struct directly. + * @see XXH32_state_s, XXH3_state_s + */ +struct XXH64_state_s { + XXH64_hash_t total_len; /*!< Total length hashed. This is always 64-bit. */ + XXH64_hash_t v[4]; /*!< Accumulator lanes */ + XXH64_hash_t mem64[4]; /*!< Internal buffer for partial reads. Treated as unsigned char[32]. */ + XXH32_hash_t memsize; /*!< Amount of data in @ref mem64 */ + XXH32_hash_t reserved32; /*!< Reserved field, needed for padding anyways*/ + XXH64_hash_t reserved64; /*!< Reserved field. Do not read or write to it. */ +}; /* typedef'd to XXH64_state_t */ + +#ifndef XXH_NO_XXH3 + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* >= C11 */ +# include <stdalign.h> +# define XXH_ALIGN(n) alignas(n) +#elif defined(__cplusplus) && (__cplusplus >= 201103L) /* >= C++11 */ +/* In C++ alignas() is a keyword */ +# define XXH_ALIGN(n) alignas(n) +#elif defined(__GNUC__) +# define XXH_ALIGN(n) __attribute__ ((aligned(n))) +#elif defined(_MSC_VER) +# define XXH_ALIGN(n) __declspec(align(n)) +#else +# define XXH_ALIGN(n) /* disabled */ +#endif + +/* Old GCC versions only accept the attribute after the type in structures. */ +#if !(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) /* C11+ */ \ + && ! (defined(__cplusplus) && (__cplusplus >= 201103L)) /* >= C++11 */ \ + && defined(__GNUC__) +# define XXH_ALIGN_MEMBER(align, type) type XXH_ALIGN(align) +#else +# define XXH_ALIGN_MEMBER(align, type) XXH_ALIGN(align) type +#endif + +/*! + * @brief The size of the internal XXH3 buffer. + * + * This is the optimal update size for incremental hashing. + * + * @see XXH3_64b_update(), XXH3_128b_update(). + */ +#define XXH3_INTERNALBUFFER_SIZE 256 + +/*! + * @internal + * @brief Default size of the secret buffer (and @ref XXH3_kSecret). + * + * This is the size used in @ref XXH3_kSecret and the seeded functions. + * + * Not to be confused with @ref XXH3_SECRET_SIZE_MIN. + */ +#define XXH3_SECRET_DEFAULT_SIZE 192 + +/*! + * @internal + * @brief Structure for XXH3 streaming API. + * + * @note This is only defined when @ref XXH_STATIC_LINKING_ONLY, + * @ref XXH_INLINE_ALL, or @ref XXH_IMPLEMENTATION is defined. + * Otherwise it is an opaque type. + * Never use this definition in combination with dynamic library. + * This allows fields to safely be changed in the future. + * + * @note ** This structure has a strict alignment requirement of 64 bytes!! ** + * Do not allocate this with `malloc()` or `new`, + * it will not be sufficiently aligned. + * Use @ref XXH3_createState() and @ref XXH3_freeState(), or stack allocation. + * + * Typedef'd to @ref XXH3_state_t. + * Do never access the members of this struct directly. + * + * @see XXH3_INITSTATE() for stack initialization. + * @see XXH3_createState(), XXH3_freeState(). + * @see XXH32_state_s, XXH64_state_s + */ +struct XXH3_state_s { + XXH_ALIGN_MEMBER(64, XXH64_hash_t acc[8]); + /*!< The 8 accumulators. See @ref XXH32_state_s::v and @ref XXH64_state_s::v */ + XXH_ALIGN_MEMBER(64, unsigned char customSecret[XXH3_SECRET_DEFAULT_SIZE]); + /*!< Used to store a custom secret generated from a seed. */ + XXH_ALIGN_MEMBER(64, unsigned char buffer[XXH3_INTERNALBUFFER_SIZE]); + /*!< The internal buffer. @see XXH32_state_s::mem32 */ + XXH32_hash_t bufferedSize; + /*!< The amount of memory in @ref buffer, @see XXH32_state_s::memsize */ + XXH32_hash_t useSeed; + /*!< Reserved field. Needed for padding on 64-bit. */ + size_t nbStripesSoFar; + /*!< Number or stripes processed. */ + XXH64_hash_t totalLen; + /*!< Total length hashed. 64-bit even on 32-bit targets. */ + size_t nbStripesPerBlock; + /*!< Number of stripes per block. */ + size_t secretLimit; + /*!< Size of @ref customSecret or @ref extSecret */ + XXH64_hash_t seed; + /*!< Seed for _withSeed variants. Must be zero otherwise, @see XXH3_INITSTATE() */ + XXH64_hash_t reserved64; + /*!< Reserved field. */ + const unsigned char* extSecret; + /*!< Reference to an external secret for the _withSecret variants, NULL + * for other variants. */ + /* note: there may be some padding at the end due to alignment on 64 bytes */ +}; /* typedef'd to XXH3_state_t */ + +#undef XXH_ALIGN_MEMBER + +/*! + * @brief Initializes a stack-allocated `XXH3_state_s`. + * + * When the @ref XXH3_state_t structure is merely emplaced on stack, + * it should be initialized with XXH3_INITSTATE() or a memset() + * in case its first reset uses XXH3_NNbits_reset_withSeed(). + * This init can be omitted if the first reset uses default or _withSecret mode. + * This operation isn't necessary when the state is created with XXH3_createState(). + * Note that this doesn't prepare the state for a streaming operation, + * it's still necessary to use XXH3_NNbits_reset*() afterwards. + */ +#define XXH3_INITSTATE(XXH3_state_ptr) \ + do { \ + XXH3_state_t* tmp_xxh3_state_ptr = (XXH3_state_ptr); \ + tmp_xxh3_state_ptr->seed = 0; \ + tmp_xxh3_state_ptr->extSecret = NULL; \ + } while(0) + + +/*! + * @brief Calculates the 128-bit hash of @p data using XXH3. + * + * @param data The block of data to be hashed, at least @p len bytes in size. + * @param len The length of @p data, in bytes. + * @param seed The 64-bit seed to alter the hash's output predictably. + * + * @pre + * The memory between @p data and @p data + @p len must be valid, + * readable, contiguous memory. However, if @p len is `0`, @p data may be + * `NULL`. In C++, this also must be *TriviallyCopyable*. + * + * @return The calculated 128-bit XXH3 value. + * + * @see @ref single_shot_example "Single Shot Example" for an example. + */ +XXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH128(XXH_NOESCAPE const void* data, size_t len, XXH64_hash_t seed); + + +/* === Experimental API === */ +/* Symbols defined below must be considered tied to a specific library version. */ + +/*! + * @brief Derive a high-entropy secret from any user-defined content, named customSeed. + * + * @param secretBuffer A writable buffer for derived high-entropy secret data. + * @param secretSize Size of secretBuffer, in bytes. Must be >= XXH3_SECRET_DEFAULT_SIZE. + * @param customSeed A user-defined content. + * @param customSeedSize Size of customSeed, in bytes. + * + * @return @ref XXH_OK on success. + * @return @ref XXH_ERROR on failure. + * + * The generated secret can be used in combination with `*_withSecret()` functions. + * The `_withSecret()` variants are useful to provide a higher level of protection + * than 64-bit seed, as it becomes much more difficult for an external actor to + * guess how to impact the calculation logic. + * + * The function accepts as input a custom seed of any length and any content, + * and derives from it a high-entropy secret of length @p secretSize into an + * already allocated buffer @p secretBuffer. + * + * The generated secret can then be used with any `*_withSecret()` variant. + * The functions @ref XXH3_128bits_withSecret(), @ref XXH3_64bits_withSecret(), + * @ref XXH3_128bits_reset_withSecret() and @ref XXH3_64bits_reset_withSecret() + * are part of this list. They all accept a `secret` parameter + * which must be large enough for implementation reasons (>= @ref XXH3_SECRET_SIZE_MIN) + * _and_ feature very high entropy (consist of random-looking bytes). + * These conditions can be a high bar to meet, so @ref XXH3_generateSecret() can + * be employed to ensure proper quality. + * + * @p customSeed can be anything. It can have any size, even small ones, + * and its content can be anything, even "poor entropy" sources such as a bunch + * of zeroes. The resulting `secret` will nonetheless provide all required qualities. + * + * @pre + * - @p secretSize must be >= @ref XXH3_SECRET_SIZE_MIN + * - When @p customSeedSize > 0, supplying NULL as customSeed is undefined behavior. + * + * Example code: + * @code{.c} + * #include <stdio.h> + * #include <stdlib.h> + * #include <string.h> + * #define XXH_STATIC_LINKING_ONLY // expose unstable API + * #include "xxhash.h" + * // Hashes argv[2] using the entropy from argv[1]. + * int main(int argc, char* argv[]) + * { + * char secret[XXH3_SECRET_SIZE_MIN]; + * if (argv != 3) { return 1; } + * XXH3_generateSecret(secret, sizeof(secret), argv[1], strlen(argv[1])); + * XXH64_hash_t h = XXH3_64bits_withSecret( + * argv[2], strlen(argv[2]), + * secret, sizeof(secret) + * ); + * printf("%016llx\n", (unsigned long long) h); + * } + * @endcode + */ +XXH_PUBLIC_API XXH_errorcode XXH3_generateSecret(XXH_NOESCAPE void* secretBuffer, size_t secretSize, XXH_NOESCAPE const void* customSeed, size_t customSeedSize); + +/*! + * @brief Generate the same secret as the _withSeed() variants. + * + * @param secretBuffer A writable buffer of @ref XXH3_SECRET_SIZE_MIN bytes + * @param seed The 64-bit seed to alter the hash result predictably. + * + * The generated secret can be used in combination with + *`*_withSecret()` and `_withSecretandSeed()` variants. + * + * Example C++ `std::string` hash class: + * @code{.cpp} + * #include <string> + * #define XXH_STATIC_LINKING_ONLY // expose unstable API + * #include "xxhash.h" + * // Slow, seeds each time + * class HashSlow { + * XXH64_hash_t seed; + * public: + * HashSlow(XXH64_hash_t s) : seed{s} {} + * size_t operator()(const std::string& x) const { + * return size_t{XXH3_64bits_withSeed(x.c_str(), x.length(), seed)}; + * } + * }; + * // Fast, caches the seeded secret for future uses. + * class HashFast { + * unsigned char secret[XXH3_SECRET_SIZE_MIN]; + * public: + * HashFast(XXH64_hash_t s) { + * XXH3_generateSecret_fromSeed(secret, seed); + * } + * size_t operator()(const std::string& x) const { + * return size_t{ + * XXH3_64bits_withSecret(x.c_str(), x.length(), secret, sizeof(secret)) + * }; + * } + * }; + * @endcode + */ +XXH_PUBLIC_API void XXH3_generateSecret_fromSeed(XXH_NOESCAPE void* secretBuffer, XXH64_hash_t seed); + +/*! + * @brief Calculates 64/128-bit seeded variant of XXH3 hash of @p data. + * + * @param data The block of data to be hashed, at least @p len bytes in size. + * @param len The length of @p data, in bytes. + * @param secret The secret data. + * @param secretSize The length of @p secret, in bytes. + * @param seed The 64-bit seed to alter the hash result predictably. + * + * These variants generate hash values using either + * @p seed for "short" keys (< @ref XXH3_MIDSIZE_MAX = 240 bytes) + * or @p secret for "large" keys (>= @ref XXH3_MIDSIZE_MAX). + * + * This generally benefits speed, compared to `_withSeed()` or `_withSecret()`. + * `_withSeed()` has to generate the secret on the fly for "large" keys. + * It's fast, but can be perceptible for "not so large" keys (< 1 KB). + * `_withSecret()` has to generate the masks on the fly for "small" keys, + * which requires more instructions than _withSeed() variants. + * Therefore, _withSecretandSeed variant combines the best of both worlds. + * + * When @p secret has been generated by XXH3_generateSecret_fromSeed(), + * this variant produces *exactly* the same results as `_withSeed()` variant, + * hence offering only a pure speed benefit on "large" input, + * by skipping the need to regenerate the secret for every large input. + * + * Another usage scenario is to hash the secret to a 64-bit hash value, + * for example with XXH3_64bits(), which then becomes the seed, + * and then employ both the seed and the secret in _withSecretandSeed(). + * On top of speed, an added benefit is that each bit in the secret + * has a 50% chance to swap each bit in the output, via its impact to the seed. + * + * This is not guaranteed when using the secret directly in "small data" scenarios, + * because only portions of the secret are employed for small data. + */ +XXH_PUBLIC_API XXH_PUREF XXH64_hash_t +XXH3_64bits_withSecretandSeed(XXH_NOESCAPE const void* data, size_t len, + XXH_NOESCAPE const void* secret, size_t secretSize, + XXH64_hash_t seed); +/*! + * @brief Calculates 128-bit seeded variant of XXH3 hash of @p data. + * + * @param input The block of data to be hashed, at least @p len bytes in size. + * @param length The length of @p data, in bytes. + * @param secret The secret data. + * @param secretSize The length of @p secret, in bytes. + * @param seed64 The 64-bit seed to alter the hash result predictably. + * + * @return @ref XXH_OK on success. + * @return @ref XXH_ERROR on failure. + * + * @see XXH3_64bits_withSecretandSeed() + */ +XXH_PUBLIC_API XXH_PUREF XXH128_hash_t +XXH3_128bits_withSecretandSeed(XXH_NOESCAPE const void* input, size_t length, + XXH_NOESCAPE const void* secret, size_t secretSize, + XXH64_hash_t seed64); +#ifndef XXH_NO_STREAM +/*! + * @brief Resets an @ref XXH3_state_t with secret data to begin a new hash. + * + * @param statePtr A pointer to an @ref XXH3_state_t allocated with @ref XXH3_createState(). + * @param secret The secret data. + * @param secretSize The length of @p secret, in bytes. + * @param seed64 The 64-bit seed to alter the hash result predictably. + * + * @return @ref XXH_OK on success. + * @return @ref XXH_ERROR on failure. + * + * @see XXH3_64bits_withSecretandSeed() + */ +XXH_PUBLIC_API XXH_errorcode +XXH3_64bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3_state_t* statePtr, + XXH_NOESCAPE const void* secret, size_t secretSize, + XXH64_hash_t seed64); +/*! + * @brief Resets an @ref XXH3_state_t with secret data to begin a new hash. + * + * @param statePtr A pointer to an @ref XXH3_state_t allocated with @ref XXH3_createState(). + * @param secret The secret data. + * @param secretSize The length of @p secret, in bytes. + * @param seed64 The 64-bit seed to alter the hash result predictably. + * + * @return @ref XXH_OK on success. + * @return @ref XXH_ERROR on failure. + * + * @see XXH3_64bits_withSecretandSeed() + */ +XXH_PUBLIC_API XXH_errorcode +XXH3_128bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3_state_t* statePtr, + XXH_NOESCAPE const void* secret, size_t secretSize, + XXH64_hash_t seed64); +#endif /* !XXH_NO_STREAM */ + +#endif /* !XXH_NO_XXH3 */ +#endif /* XXH_NO_LONG_LONG */ +#if defined(XXH_INLINE_ALL) || defined(XXH_PRIVATE_API) +# define XXH_IMPLEMENTATION +#endif + +#endif /* defined(XXH_STATIC_LINKING_ONLY) && !defined(XXHASH_H_STATIC_13879238742) */ + + +/* ======================================================================== */ +/* ======================================================================== */ +/* ======================================================================== */ + + +/*-********************************************************************** + * xxHash implementation + *-********************************************************************** + * xxHash's implementation used to be hosted inside xxhash.c. + * + * However, inlining requires implementation to be visible to the compiler, + * hence be included alongside the header. + * Previously, implementation was hosted inside xxhash.c, + * which was then #included when inlining was activated. + * This construction created issues with a few build and install systems, + * as it required xxhash.c to be stored in /include directory. + * + * xxHash implementation is now directly integrated within xxhash.h. + * As a consequence, xxhash.c is no longer needed in /include. + * + * xxhash.c is still available and is still useful. + * In a "normal" setup, when xxhash is not inlined, + * xxhash.h only exposes the prototypes and public symbols, + * while xxhash.c can be built into an object file xxhash.o + * which can then be linked into the final binary. + ************************************************************************/ + +#if ( defined(XXH_INLINE_ALL) || defined(XXH_PRIVATE_API) \ + || defined(XXH_IMPLEMENTATION) ) && !defined(XXH_IMPLEM_13a8737387) +# define XXH_IMPLEM_13a8737387 + +/* ************************************* +* Tuning parameters +***************************************/ + +/*! + * @defgroup tuning Tuning parameters + * @{ + * + * Various macros to control xxHash's behavior. + */ +#ifdef XXH_DOXYGEN +/*! + * @brief Define this to disable 64-bit code. + * + * Useful if only using the @ref XXH32_family and you have a strict C90 compiler. + */ +# define XXH_NO_LONG_LONG +# undef XXH_NO_LONG_LONG /* don't actually */ +/*! + * @brief Controls how unaligned memory is accessed. + * + * By default, access to unaligned memory is controlled by `memcpy()`, which is + * safe and portable. + * + * Unfortunately, on some target/compiler combinations, the generated assembly + * is sub-optimal. + * + * The below switch allow selection of a different access method + * in the search for improved performance. + * + * @par Possible options: + * + * - `XXH_FORCE_MEMORY_ACCESS=0` (default): `memcpy` + * @par + * Use `memcpy()`. Safe and portable. Note that most modern compilers will + * eliminate the function call and treat it as an unaligned access. + * + * - `XXH_FORCE_MEMORY_ACCESS=1`: `__attribute__((aligned(1)))` + * @par + * Depends on compiler extensions and is therefore not portable. + * This method is safe _if_ your compiler supports it, + * and *generally* as fast or faster than `memcpy`. + * + * - `XXH_FORCE_MEMORY_ACCESS=2`: Direct cast + * @par + * Casts directly and dereferences. This method doesn't depend on the + * compiler, but it violates the C standard as it directly dereferences an + * unaligned pointer. It can generate buggy code on targets which do not + * support unaligned memory accesses, but in some circumstances, it's the + * only known way to get the most performance. + * + * - `XXH_FORCE_MEMORY_ACCESS=3`: Byteshift + * @par + * Also portable. This can generate the best code on old compilers which don't + * inline small `memcpy()` calls, and it might also be faster on big-endian + * systems which lack a native byteswap instruction. However, some compilers + * will emit literal byteshifts even if the target supports unaligned access. + * + * + * @warning + * Methods 1 and 2 rely on implementation-defined behavior. Use these with + * care, as what works on one compiler/platform/optimization level may cause + * another to read garbage data or even crash. + * + * See https://fastcompression.blogspot.com/2015/08/accessing-unaligned-memory.html for details. + * + * Prefer these methods in priority order (0 > 3 > 1 > 2) + */ +# define XXH_FORCE_MEMORY_ACCESS 0 + +/*! + * @def XXH_SIZE_OPT + * @brief Controls how much xxHash optimizes for size. + * + * xxHash, when compiled, tends to result in a rather large binary size. This + * is mostly due to heavy usage to forced inlining and constant folding of the + * @ref XXH3_family to increase performance. + * + * However, some developers prefer size over speed. This option can + * significantly reduce the size of the generated code. When using the `-Os` + * or `-Oz` options on GCC or Clang, this is defined to 1 by default, + * otherwise it is defined to 0. + * + * Most of these size optimizations can be controlled manually. + * + * This is a number from 0-2. + * - `XXH_SIZE_OPT` == 0: Default. xxHash makes no size optimizations. Speed + * comes first. + * - `XXH_SIZE_OPT` == 1: Default for `-Os` and `-Oz`. xxHash is more + * conservative and disables hacks that increase code size. It implies the + * options @ref XXH_NO_INLINE_HINTS == 1, @ref XXH_FORCE_ALIGN_CHECK == 0, + * and @ref XXH3_NEON_LANES == 8 if they are not already defined. + * - `XXH_SIZE_OPT` == 2: xxHash tries to make itself as small as possible. + * Performance may cry. For example, the single shot functions just use the + * streaming API. + */ +# define XXH_SIZE_OPT 0 + +/*! + * @def XXH_FORCE_ALIGN_CHECK + * @brief If defined to non-zero, adds a special path for aligned inputs (XXH32() + * and XXH64() only). + * + * This is an important performance trick for architectures without decent + * unaligned memory access performance. + * + * It checks for input alignment, and when conditions are met, uses a "fast + * path" employing direct 32-bit/64-bit reads, resulting in _dramatically + * faster_ read speed. + * + * The check costs one initial branch per hash, which is generally negligible, + * but not zero. + * + * Moreover, it's not useful to generate an additional code path if memory + * access uses the same instruction for both aligned and unaligned + * addresses (e.g. x86 and aarch64). + * + * In these cases, the alignment check can be removed by setting this macro to 0. + * Then the code will always use unaligned memory access. + * Align check is automatically disabled on x86, x64, ARM64, and some ARM chips + * which are platforms known to offer good unaligned memory accesses performance. + * + * It is also disabled by default when @ref XXH_SIZE_OPT >= 1. + * + * This option does not affect XXH3 (only XXH32 and XXH64). + */ +# define XXH_FORCE_ALIGN_CHECK 0 + +/*! + * @def XXH_NO_INLINE_HINTS + * @brief When non-zero, sets all functions to `static`. + * + * By default, xxHash tries to force the compiler to inline almost all internal + * functions. + * + * This can usually improve performance due to reduced jumping and improved + * constant folding, but significantly increases the size of the binary which + * might not be favorable. + * + * Additionally, sometimes the forced inlining can be detrimental to performance, + * depending on the architecture. + * + * XXH_NO_INLINE_HINTS marks all internal functions as static, giving the + * compiler full control on whether to inline or not. + * + * When not optimizing (-O0), using `-fno-inline` with GCC or Clang, or if + * @ref XXH_SIZE_OPT >= 1, this will automatically be defined. + */ +# define XXH_NO_INLINE_HINTS 0 + +/*! + * @def XXH3_INLINE_SECRET + * @brief Determines whether to inline the XXH3 withSecret code. + * + * When the secret size is known, the compiler can improve the performance + * of XXH3_64bits_withSecret() and XXH3_128bits_withSecret(). + * + * However, if the secret size is not known, it doesn't have any benefit. This + * happens when xxHash is compiled into a global symbol. Therefore, if + * @ref XXH_INLINE_ALL is *not* defined, this will be defined to 0. + * + * Additionally, this defaults to 0 on GCC 12+, which has an issue with function pointers + * that are *sometimes* force inline on -Og, and it is impossible to automatically + * detect this optimization level. + */ +# define XXH3_INLINE_SECRET 0 + +/*! + * @def XXH32_ENDJMP + * @brief Whether to use a jump for `XXH32_finalize`. + * + * For performance, `XXH32_finalize` uses multiple branches in the finalizer. + * This is generally preferable for performance, + * but depending on exact architecture, a jmp may be preferable. + * + * This setting is only possibly making a difference for very small inputs. + */ +# define XXH32_ENDJMP 0 + +/*! + * @internal + * @brief Redefines old internal names. + * + * For compatibility with code that uses xxHash's internals before the names + * were changed to improve namespacing. There is no other reason to use this. + */ +# define XXH_OLD_NAMES +# undef XXH_OLD_NAMES /* don't actually use, it is ugly. */ + +/*! + * @def XXH_NO_STREAM + * @brief Disables the streaming API. + * + * When xxHash is not inlined and the streaming functions are not used, disabling + * the streaming functions can improve code size significantly, especially with + * the @ref XXH3_family which tends to make constant folded copies of itself. + */ +# define XXH_NO_STREAM +# undef XXH_NO_STREAM /* don't actually */ +#endif /* XXH_DOXYGEN */ +/*! + * @} + */ + +#ifndef XXH_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */ + /* prefer __packed__ structures (method 1) for GCC + * < ARMv7 with unaligned access (e.g. Raspbian armhf) still uses byte shifting, so we use memcpy + * which for some reason does unaligned loads. */ +# if defined(__GNUC__) && !(defined(__ARM_ARCH) && __ARM_ARCH < 7 && defined(__ARM_FEATURE_UNALIGNED)) +# define XXH_FORCE_MEMORY_ACCESS 1 +# endif +#endif + +#ifndef XXH_SIZE_OPT + /* default to 1 for -Os or -Oz */ +# if (defined(__GNUC__) || defined(__clang__)) && defined(__OPTIMIZE_SIZE__) +# define XXH_SIZE_OPT 1 +# else +# define XXH_SIZE_OPT 0 +# endif +#endif + +#ifndef XXH_FORCE_ALIGN_CHECK /* can be defined externally */ + /* don't check on sizeopt, x86, aarch64, or arm when unaligned access is available */ +# if XXH_SIZE_OPT >= 1 || \ + defined(__i386) || defined(__x86_64__) || defined(__aarch64__) || defined(__ARM_FEATURE_UNALIGNED) \ + || defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM64) || defined(_M_ARM) /* visual */ +# define XXH_FORCE_ALIGN_CHECK 0 +# else +# define XXH_FORCE_ALIGN_CHECK 1 +# endif +#endif + +#ifndef XXH_NO_INLINE_HINTS +# if XXH_SIZE_OPT >= 1 || defined(__NO_INLINE__) /* -O0, -fno-inline */ +# define XXH_NO_INLINE_HINTS 1 +# else +# define XXH_NO_INLINE_HINTS 0 +# endif +#endif + +#ifndef XXH3_INLINE_SECRET +# if (defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 12) \ + || !defined(XXH_INLINE_ALL) +# define XXH3_INLINE_SECRET 0 +# else +# define XXH3_INLINE_SECRET 1 +# endif +#endif + +#ifndef XXH32_ENDJMP +/* generally preferable for performance */ +# define XXH32_ENDJMP 0 +#endif + +/*! + * @defgroup impl Implementation + * @{ + */ + + +/* ************************************* +* Includes & Memory related functions +***************************************/ +#if defined(XXH_NO_STREAM) +/* nothing */ +#elif defined(XXH_NO_STDLIB) + +/* When requesting to disable any mention of stdlib, + * the library loses the ability to invoked malloc / free. + * In practice, it means that functions like `XXH*_createState()` + * will always fail, and return NULL. + * This flag is useful in situations where + * xxhash.h is integrated into some kernel, embedded or limited environment + * without access to dynamic allocation. + */ + +static XXH_CONSTF void* XXH_malloc(size_t s) { (void)s; return NULL; } +static void XXH_free(void* p) { (void)p; } + +#else + +/* + * Modify the local functions below should you wish to use + * different memory routines for malloc() and free() + */ +#include <stdlib.h> + +/*! + * @internal + * @brief Modify this function to use a different routine than malloc(). + */ +static XXH_MALLOCF void* XXH_malloc(size_t s) { return malloc(s); } + +/*! + * @internal + * @brief Modify this function to use a different routine than free(). + */ +static void XXH_free(void* p) { free(p); } + +#endif /* XXH_NO_STDLIB */ + +#include <string.h> + +/*! + * @internal + * @brief Modify this function to use a different routine than memcpy(). + */ +static void* XXH_memcpy(void* dest, const void* src, size_t size) +{ + return memcpy(dest,src,size); +} + +#include <limits.h> /* ULLONG_MAX */ + + +/* ************************************* +* Compiler Specific Options +***************************************/ +#ifdef _MSC_VER /* Visual Studio warning fix */ +# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ +#endif + +#if XXH_NO_INLINE_HINTS /* disable inlining hints */ +# if defined(__GNUC__) || defined(__clang__) +# define XXH_FORCE_INLINE static __attribute__((unused)) +# else +# define XXH_FORCE_INLINE static +# endif +# define XXH_NO_INLINE static +/* enable inlining hints */ +#elif defined(__GNUC__) || defined(__clang__) +# define XXH_FORCE_INLINE static __inline__ __attribute__((always_inline, unused)) +# define XXH_NO_INLINE static __attribute__((noinline)) +#elif defined(_MSC_VER) /* Visual Studio */ +# define XXH_FORCE_INLINE static __forceinline +# define XXH_NO_INLINE static __declspec(noinline) +#elif defined (__cplusplus) \ + || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) /* C99 */ +# define XXH_FORCE_INLINE static inline +# define XXH_NO_INLINE static +#else +# define XXH_FORCE_INLINE static +# define XXH_NO_INLINE static +#endif + +#if XXH3_INLINE_SECRET +# define XXH3_WITH_SECRET_INLINE XXH_FORCE_INLINE +#else +# define XXH3_WITH_SECRET_INLINE XXH_NO_INLINE +#endif + + +/* ************************************* +* Debug +***************************************/ +/*! + * @ingroup tuning + * @def XXH_DEBUGLEVEL + * @brief Sets the debugging level. + * + * XXH_DEBUGLEVEL is expected to be defined externally, typically via the + * compiler's command line options. The value must be a number. + */ +#ifndef XXH_DEBUGLEVEL +# ifdef DEBUGLEVEL /* backwards compat */ +# define XXH_DEBUGLEVEL DEBUGLEVEL +# else +# define XXH_DEBUGLEVEL 0 +# endif +#endif + +#if (XXH_DEBUGLEVEL>=1) +# include <assert.h> /* note: can still be disabled with NDEBUG */ +# define XXH_ASSERT(c) assert(c) +#else +# if defined(__INTEL_COMPILER) +# define XXH_ASSERT(c) XXH_ASSUME((unsigned char) (c)) +# else +# define XXH_ASSERT(c) XXH_ASSUME(c) +# endif +#endif + +/* note: use after variable declarations */ +#ifndef XXH_STATIC_ASSERT +# if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */ +# define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { _Static_assert((c),m); } while(0) +# elif defined(__cplusplus) && (__cplusplus >= 201103L) /* C++11 */ +# define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { static_assert((c),m); } while(0) +# else +# define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { struct xxh_sa { char x[(c) ? 1 : -1]; }; } while(0) +# endif +# define XXH_STATIC_ASSERT(c) XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c) +#endif + +/*! + * @internal + * @def XXH_COMPILER_GUARD(var) + * @brief Used to prevent unwanted optimizations for @p var. + * + * It uses an empty GCC inline assembly statement with a register constraint + * which forces @p var into a general purpose register (eg eax, ebx, ecx + * on x86) and marks it as modified. + * + * This is used in a few places to avoid unwanted autovectorization (e.g. + * XXH32_round()). All vectorization we want is explicit via intrinsics, + * and _usually_ isn't wanted elsewhere. + * + * We also use it to prevent unwanted constant folding for AArch64 in + * XXH3_initCustomSecret_scalar(). + */ +#if defined(__GNUC__) || defined(__clang__) +# define XXH_COMPILER_GUARD(var) __asm__("" : "+r" (var)) +#else +# define XXH_COMPILER_GUARD(var) ((void)0) +#endif + +/* Specifically for NEON vectors which use the "w" constraint, on + * Clang. */ +#if defined(__clang__) && defined(__ARM_ARCH) && !defined(__wasm__) +# define XXH_COMPILER_GUARD_CLANG_NEON(var) __asm__("" : "+w" (var)) +#else +# define XXH_COMPILER_GUARD_CLANG_NEON(var) ((void)0) +#endif + +/* ************************************* +* Basic Types +***************************************/ +#if !defined (__VMS) \ + && (defined (__cplusplus) \ + || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) ) +# ifdef _AIX +# include <inttypes.h> +# else +# include <stdint.h> +# endif + typedef uint8_t xxh_u8; +#else + typedef unsigned char xxh_u8; +#endif +typedef XXH32_hash_t xxh_u32; + +#ifdef XXH_OLD_NAMES +# warning "XXH_OLD_NAMES is planned to be removed starting v0.9. If the program depends on it, consider moving away from it by employing newer type names directly" +# define BYTE xxh_u8 +# define U8 xxh_u8 +# define U32 xxh_u32 +#endif + +/* *** Memory access *** */ + +/*! + * @internal + * @fn xxh_u32 XXH_read32(const void* ptr) + * @brief Reads an unaligned 32-bit integer from @p ptr in native endianness. + * + * Affected by @ref XXH_FORCE_MEMORY_ACCESS. + * + * @param ptr The pointer to read from. + * @return The 32-bit native endian integer from the bytes at @p ptr. + */ + +/*! + * @internal + * @fn xxh_u32 XXH_readLE32(const void* ptr) + * @brief Reads an unaligned 32-bit little endian integer from @p ptr. + * + * Affected by @ref XXH_FORCE_MEMORY_ACCESS. + * + * @param ptr The pointer to read from. + * @return The 32-bit little endian integer from the bytes at @p ptr. + */ + +/*! + * @internal + * @fn xxh_u32 XXH_readBE32(const void* ptr) + * @brief Reads an unaligned 32-bit big endian integer from @p ptr. + * + * Affected by @ref XXH_FORCE_MEMORY_ACCESS. + * + * @param ptr The pointer to read from. + * @return The 32-bit big endian integer from the bytes at @p ptr. + */ + +/*! + * @internal + * @fn xxh_u32 XXH_readLE32_align(const void* ptr, XXH_alignment align) + * @brief Like @ref XXH_readLE32(), but has an option for aligned reads. + * + * Affected by @ref XXH_FORCE_MEMORY_ACCESS. + * Note that when @ref XXH_FORCE_ALIGN_CHECK == 0, the @p align parameter is + * always @ref XXH_alignment::XXH_unaligned. + * + * @param ptr The pointer to read from. + * @param align Whether @p ptr is aligned. + * @pre + * If @p align == @ref XXH_alignment::XXH_aligned, @p ptr must be 4 byte + * aligned. + * @return The 32-bit little endian integer from the bytes at @p ptr. + */ + +#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==3)) +/* + * Manual byteshift. Best for old compilers which don't inline memcpy. + * We actually directly use XXH_readLE32 and XXH_readBE32. + */ +#elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2)) + +/* + * Force direct memory access. Only works on CPU which support unaligned memory + * access in hardware. + */ +static xxh_u32 XXH_read32(const void* memPtr) { return *(const xxh_u32*) memPtr; } + +#elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1)) + +/* + * __attribute__((aligned(1))) is supported by gcc and clang. Originally the + * documentation claimed that it only increased the alignment, but actually it + * can decrease it on gcc, clang, and icc: + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69502, + * https://gcc.godbolt.org/z/xYez1j67Y. + */ +#ifdef XXH_OLD_NAMES +typedef union { xxh_u32 u32; } __attribute__((packed)) unalign; +#endif +static xxh_u32 XXH_read32(const void* ptr) +{ + typedef __attribute__((aligned(1))) xxh_u32 xxh_unalign32; + return *((const xxh_unalign32*)ptr); +} + +#else + +/* + * Portable and safe solution. Generally efficient. + * see: https://fastcompression.blogspot.com/2015/08/accessing-unaligned-memory.html + */ +static xxh_u32 XXH_read32(const void* memPtr) +{ + xxh_u32 val; + XXH_memcpy(&val, memPtr, sizeof(val)); + return val; +} + +#endif /* XXH_FORCE_DIRECT_MEMORY_ACCESS */ + + +/* *** Endianness *** */ + +/*! + * @ingroup tuning + * @def XXH_CPU_LITTLE_ENDIAN + * @brief Whether the target is little endian. + * + * Defined to 1 if the target is little endian, or 0 if it is big endian. + * It can be defined externally, for example on the compiler command line. + * + * If it is not defined, + * a runtime check (which is usually constant folded) is used instead. + * + * @note + * This is not necessarily defined to an integer constant. + * + * @see XXH_isLittleEndian() for the runtime check. + */ +#ifndef XXH_CPU_LITTLE_ENDIAN +/* + * Try to detect endianness automatically, to avoid the nonstandard behavior + * in `XXH_isLittleEndian()` + */ +# if defined(_WIN32) /* Windows is always little endian */ \ + || defined(__LITTLE_ENDIAN__) \ + || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) +# define XXH_CPU_LITTLE_ENDIAN 1 +# elif defined(__BIG_ENDIAN__) \ + || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) +# define XXH_CPU_LITTLE_ENDIAN 0 +# else +/*! + * @internal + * @brief Runtime check for @ref XXH_CPU_LITTLE_ENDIAN. + * + * Most compilers will constant fold this. + */ +static int XXH_isLittleEndian(void) +{ + /* + * Portable and well-defined behavior. + * Don't use static: it is detrimental to performance. + */ + const union { xxh_u32 u; xxh_u8 c[4]; } one = { 1 }; + return one.c[0]; +} +# define XXH_CPU_LITTLE_ENDIAN XXH_isLittleEndian() +# endif +#endif + + + + +/* **************************************** +* Compiler-specific Functions and Macros +******************************************/ +#define XXH_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) + +#ifdef __has_builtin +# define XXH_HAS_BUILTIN(x) __has_builtin(x) +#else +# define XXH_HAS_BUILTIN(x) 0 +#endif + + + +/* + * C23 and future versions have standard "unreachable()". + * Once it has been implemented reliably we can add it as an + * additional case: + * + * ``` + * #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= XXH_C23_VN) + * # include <stddef.h> + * # ifdef unreachable + * # define XXH_UNREACHABLE() unreachable() + * # endif + * #endif + * ``` + * + * Note C++23 also has std::unreachable() which can be detected + * as follows: + * ``` + * #if defined(__cpp_lib_unreachable) && (__cpp_lib_unreachable >= 202202L) + * # include <utility> + * # define XXH_UNREACHABLE() std::unreachable() + * #endif + * ``` + * NB: `__cpp_lib_unreachable` is defined in the `<version>` header. + * We don't use that as including `<utility>` in `extern "C"` blocks + * doesn't work on GCC12 + */ + +#if XXH_HAS_BUILTIN(__builtin_unreachable) +# define XXH_UNREACHABLE() __builtin_unreachable() + +#elif defined(_MSC_VER) +# define XXH_UNREACHABLE() __assume(0) + +#else +# define XXH_UNREACHABLE() +#endif + +#if XXH_HAS_BUILTIN(__builtin_assume) +# define XXH_ASSUME(c) __builtin_assume(c) +#else +# define XXH_ASSUME(c) if (!(c)) { XXH_UNREACHABLE(); } +#endif + +/*! + * @internal + * @def XXH_rotl32(x,r) + * @brief 32-bit rotate left. + * + * @param x The 32-bit integer to be rotated. + * @param r The number of bits to rotate. + * @pre + * @p r > 0 && @p r < 32 + * @note + * @p x and @p r may be evaluated multiple times. + * @return The rotated result. + */ +#if !defined(NO_CLANG_BUILTIN) && XXH_HAS_BUILTIN(__builtin_rotateleft32) \ + && XXH_HAS_BUILTIN(__builtin_rotateleft64) +# define XXH_rotl32 __builtin_rotateleft32 +# define XXH_rotl64 __builtin_rotateleft64 +/* Note: although _rotl exists for minGW (GCC under windows), performance seems poor */ +#elif defined(_MSC_VER) +# define XXH_rotl32(x,r) _rotl(x,r) +# define XXH_rotl64(x,r) _rotl64(x,r) +#else +# define XXH_rotl32(x,r) (((x) << (r)) | ((x) >> (32 - (r)))) +# define XXH_rotl64(x,r) (((x) << (r)) | ((x) >> (64 - (r)))) +#endif + +/*! + * @internal + * @fn xxh_u32 XXH_swap32(xxh_u32 x) + * @brief A 32-bit byteswap. + * + * @param x The 32-bit integer to byteswap. + * @return @p x, byteswapped. + */ +#if defined(_MSC_VER) /* Visual Studio */ +# define XXH_swap32 _byteswap_ulong +#elif XXH_GCC_VERSION >= 403 +# define XXH_swap32 __builtin_bswap32 +#else +static xxh_u32 XXH_swap32 (xxh_u32 x) +{ + return ((x << 24) & 0xff000000 ) | + ((x << 8) & 0x00ff0000 ) | + ((x >> 8) & 0x0000ff00 ) | + ((x >> 24) & 0x000000ff ); +} +#endif + + +/* *************************** +* Memory reads +*****************************/ + +/*! + * @internal + * @brief Enum to indicate whether a pointer is aligned. + */ +typedef enum { + XXH_aligned, /*!< Aligned */ + XXH_unaligned /*!< Possibly unaligned */ +} XXH_alignment; + +/* + * XXH_FORCE_MEMORY_ACCESS==3 is an endian-independent byteshift load. + * + * This is ideal for older compilers which don't inline memcpy. + */ +#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==3)) + +XXH_FORCE_INLINE xxh_u32 XXH_readLE32(const void* memPtr) +{ + const xxh_u8* bytePtr = (const xxh_u8 *)memPtr; + return bytePtr[0] + | ((xxh_u32)bytePtr[1] << 8) + | ((xxh_u32)bytePtr[2] << 16) + | ((xxh_u32)bytePtr[3] << 24); +} + +XXH_FORCE_INLINE xxh_u32 XXH_readBE32(const void* memPtr) +{ + const xxh_u8* bytePtr = (const xxh_u8 *)memPtr; + return bytePtr[3] + | ((xxh_u32)bytePtr[2] << 8) + | ((xxh_u32)bytePtr[1] << 16) + | ((xxh_u32)bytePtr[0] << 24); +} + +#else +XXH_FORCE_INLINE xxh_u32 XXH_readLE32(const void* ptr) +{ + return XXH_CPU_LITTLE_ENDIAN ? XXH_read32(ptr) : XXH_swap32(XXH_read32(ptr)); +} + +static xxh_u32 XXH_readBE32(const void* ptr) +{ + return XXH_CPU_LITTLE_ENDIAN ? XXH_swap32(XXH_read32(ptr)) : XXH_read32(ptr); +} +#endif + +XXH_FORCE_INLINE xxh_u32 +XXH_readLE32_align(const void* ptr, XXH_alignment align) +{ + if (align==XXH_unaligned) { + return XXH_readLE32(ptr); + } else { + return XXH_CPU_LITTLE_ENDIAN ? *(const xxh_u32*)ptr : XXH_swap32(*(const xxh_u32*)ptr); + } +} + + +/* ************************************* +* Misc +***************************************/ +/*! @ingroup public */ +XXH_PUBLIC_API unsigned XXH_versionNumber (void) { return XXH_VERSION_NUMBER; } + + +/* ******************************************************************* +* 32-bit hash functions +*********************************************************************/ +/*! + * @} + * @defgroup XXH32_impl XXH32 implementation + * @ingroup impl + * + * Details on the XXH32 implementation. + * @{ + */ + /* #define instead of static const, to be used as initializers */ +#define XXH_PRIME32_1 0x9E3779B1U /*!< 0b10011110001101110111100110110001 */ +#define XXH_PRIME32_2 0x85EBCA77U /*!< 0b10000101111010111100101001110111 */ +#define XXH_PRIME32_3 0xC2B2AE3DU /*!< 0b11000010101100101010111000111101 */ +#define XXH_PRIME32_4 0x27D4EB2FU /*!< 0b00100111110101001110101100101111 */ +#define XXH_PRIME32_5 0x165667B1U /*!< 0b00010110010101100110011110110001 */ + +#ifdef XXH_OLD_NAMES +# define PRIME32_1 XXH_PRIME32_1 +# define PRIME32_2 XXH_PRIME32_2 +# define PRIME32_3 XXH_PRIME32_3 +# define PRIME32_4 XXH_PRIME32_4 +# define PRIME32_5 XXH_PRIME32_5 +#endif + +/*! + * @internal + * @brief Normal stripe processing routine. + * + * This shuffles the bits so that any bit from @p input impacts several bits in + * @p acc. + * + * @param acc The accumulator lane. + * @param input The stripe of input to mix. + * @return The mixed accumulator lane. + */ +static xxh_u32 XXH32_round(xxh_u32 acc, xxh_u32 input) +{ + acc += input * XXH_PRIME32_2; + acc = XXH_rotl32(acc, 13); + acc *= XXH_PRIME32_1; +#if (defined(__SSE4_1__) || defined(__aarch64__) || defined(__wasm_simd128__)) && !defined(XXH_ENABLE_AUTOVECTORIZE) + /* + * UGLY HACK: + * A compiler fence is the only thing that prevents GCC and Clang from + * autovectorizing the XXH32 loop (pragmas and attributes don't work for some + * reason) without globally disabling SSE4.1. + * + * The reason we want to avoid vectorization is because despite working on + * 4 integers at a time, there are multiple factors slowing XXH32 down on + * SSE4: + * - There's a ridiculous amount of lag from pmulld (10 cycles of latency on + * newer chips!) making it slightly slower to multiply four integers at + * once compared to four integers independently. Even when pmulld was + * fastest, Sandy/Ivy Bridge, it is still not worth it to go into SSE + * just to multiply unless doing a long operation. + * + * - Four instructions are required to rotate, + * movqda tmp, v // not required with VEX encoding + * pslld tmp, 13 // tmp <<= 13 + * psrld v, 19 // x >>= 19 + * por v, tmp // x |= tmp + * compared to one for scalar: + * roll v, 13 // reliably fast across the board + * shldl v, v, 13 // Sandy Bridge and later prefer this for some reason + * + * - Instruction level parallelism is actually more beneficial here because + * the SIMD actually serializes this operation: While v1 is rotating, v2 + * can load data, while v3 can multiply. SSE forces them to operate + * together. + * + * This is also enabled on AArch64, as Clang is *very aggressive* in vectorizing + * the loop. NEON is only faster on the A53, and with the newer cores, it is less + * than half the speed. + * + * Additionally, this is used on WASM SIMD128 because it JITs to the same + * SIMD instructions and has the same issue. + */ + XXH_COMPILER_GUARD(acc); +#endif + return acc; +} + +/*! + * @internal + * @brief Mixes all bits to finalize the hash. + * + * The final mix ensures that all input bits have a chance to impact any bit in + * the output digest, resulting in an unbiased distribution. + * + * @param hash The hash to avalanche. + * @return The avalanched hash. + */ +static xxh_u32 XXH32_avalanche(xxh_u32 hash) +{ + hash ^= hash >> 15; + hash *= XXH_PRIME32_2; + hash ^= hash >> 13; + hash *= XXH_PRIME32_3; + hash ^= hash >> 16; + return hash; +} + +#define XXH_get32bits(p) XXH_readLE32_align(p, align) + +/*! + * @internal + * @brief Processes the last 0-15 bytes of @p ptr. + * + * There may be up to 15 bytes remaining to consume from the input. + * This final stage will digest them to ensure that all input bytes are present + * in the final mix. + * + * @param hash The hash to finalize. + * @param ptr The pointer to the remaining input. + * @param len The remaining length, modulo 16. + * @param align Whether @p ptr is aligned. + * @return The finalized hash. + * @see XXH64_finalize(). + */ +static XXH_PUREF xxh_u32 +XXH32_finalize(xxh_u32 hash, const xxh_u8* ptr, size_t len, XXH_alignment align) +{ +#define XXH_PROCESS1 do { \ + hash += (*ptr++) * XXH_PRIME32_5; \ + hash = XXH_rotl32(hash, 11) * XXH_PRIME32_1; \ +} while (0) + +#define XXH_PROCESS4 do { \ + hash += XXH_get32bits(ptr) * XXH_PRIME32_3; \ + ptr += 4; \ + hash = XXH_rotl32(hash, 17) * XXH_PRIME32_4; \ +} while (0) + + if (ptr==NULL) XXH_ASSERT(len == 0); + + /* Compact rerolled version; generally faster */ + if (!XXH32_ENDJMP) { + len &= 15; + while (len >= 4) { + XXH_PROCESS4; + len -= 4; + } + while (len > 0) { + XXH_PROCESS1; + --len; + } + return XXH32_avalanche(hash); + } else { + switch(len&15) /* or switch(bEnd - p) */ { + case 12: XXH_PROCESS4; + XXH_FALLTHROUGH; /* fallthrough */ + case 8: XXH_PROCESS4; + XXH_FALLTHROUGH; /* fallthrough */ + case 4: XXH_PROCESS4; + return XXH32_avalanche(hash); + + case 13: XXH_PROCESS4; + XXH_FALLTHROUGH; /* fallthrough */ + case 9: XXH_PROCESS4; + XXH_FALLTHROUGH; /* fallthrough */ + case 5: XXH_PROCESS4; + XXH_PROCESS1; + return XXH32_avalanche(hash); + + case 14: XXH_PROCESS4; + XXH_FALLTHROUGH; /* fallthrough */ + case 10: XXH_PROCESS4; + XXH_FALLTHROUGH; /* fallthrough */ + case 6: XXH_PROCESS4; + XXH_PROCESS1; + XXH_PROCESS1; + return XXH32_avalanche(hash); + + case 15: XXH_PROCESS4; + XXH_FALLTHROUGH; /* fallthrough */ + case 11: XXH_PROCESS4; + XXH_FALLTHROUGH; /* fallthrough */ + case 7: XXH_PROCESS4; + XXH_FALLTHROUGH; /* fallthrough */ + case 3: XXH_PROCESS1; + XXH_FALLTHROUGH; /* fallthrough */ + case 2: XXH_PROCESS1; + XXH_FALLTHROUGH; /* fallthrough */ + case 1: XXH_PROCESS1; + XXH_FALLTHROUGH; /* fallthrough */ + case 0: return XXH32_avalanche(hash); + } + XXH_ASSERT(0); + return hash; /* reaching this point is deemed impossible */ + } +} + +#ifdef XXH_OLD_NAMES +# define PROCESS1 XXH_PROCESS1 +# define PROCESS4 XXH_PROCESS4 +#else +# undef XXH_PROCESS1 +# undef XXH_PROCESS4 +#endif + +/*! + * @internal + * @brief The implementation for @ref XXH32(). + * + * @param input , len , seed Directly passed from @ref XXH32(). + * @param align Whether @p input is aligned. + * @return The calculated hash. + */ +XXH_FORCE_INLINE XXH_PUREF xxh_u32 +XXH32_endian_align(const xxh_u8* input, size_t len, xxh_u32 seed, XXH_alignment align) +{ + xxh_u32 h32; + + if (input==NULL) XXH_ASSERT(len == 0); + + if (len>=16) { + const xxh_u8* const bEnd = input + len; + const xxh_u8* const limit = bEnd - 15; + xxh_u32 v1 = seed + XXH_PRIME32_1 + XXH_PRIME32_2; + xxh_u32 v2 = seed + XXH_PRIME32_2; + xxh_u32 v3 = seed + 0; + xxh_u32 v4 = seed - XXH_PRIME32_1; + + do { + v1 = XXH32_round(v1, XXH_get32bits(input)); input += 4; + v2 = XXH32_round(v2, XXH_get32bits(input)); input += 4; + v3 = XXH32_round(v3, XXH_get32bits(input)); input += 4; + v4 = XXH32_round(v4, XXH_get32bits(input)); input += 4; + } while (input < limit); + + h32 = XXH_rotl32(v1, 1) + XXH_rotl32(v2, 7) + + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18); + } else { + h32 = seed + XXH_PRIME32_5; + } + + h32 += (xxh_u32)len; + + return XXH32_finalize(h32, input, len&15, align); +} + +/*! @ingroup XXH32_family */ +XXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t len, XXH32_hash_t seed) +{ +#if !defined(XXH_NO_STREAM) && XXH_SIZE_OPT >= 2 + /* Simple version, good for code maintenance, but unfortunately slow for small inputs */ + XXH32_state_t state; + XXH32_reset(&state, seed); + XXH32_update(&state, (const xxh_u8*)input, len); + return XXH32_digest(&state); +#else + if (XXH_FORCE_ALIGN_CHECK) { + if ((((size_t)input) & 3) == 0) { /* Input is 4-bytes aligned, leverage the speed benefit */ + return XXH32_endian_align((const xxh_u8*)input, len, seed, XXH_aligned); + } } + + return XXH32_endian_align((const xxh_u8*)input, len, seed, XXH_unaligned); +#endif +} + + + +/******* Hash streaming *******/ +#ifndef XXH_NO_STREAM +/*! @ingroup XXH32_family */ +XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void) +{ + return (XXH32_state_t*)XXH_malloc(sizeof(XXH32_state_t)); +} +/*! @ingroup XXH32_family */ +XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr) +{ + XXH_free(statePtr); + return XXH_OK; +} + +/*! @ingroup XXH32_family */ +XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* dstState, const XXH32_state_t* srcState) +{ + XXH_memcpy(dstState, srcState, sizeof(*dstState)); +} + +/*! @ingroup XXH32_family */ +XXH_PUBLIC_API XXH_errorcode XXH32_reset(XXH32_state_t* statePtr, XXH32_hash_t seed) +{ + XXH_ASSERT(statePtr != NULL); + memset(statePtr, 0, sizeof(*statePtr)); + statePtr->v[0] = seed + XXH_PRIME32_1 + XXH_PRIME32_2; + statePtr->v[1] = seed + XXH_PRIME32_2; + statePtr->v[2] = seed + 0; + statePtr->v[3] = seed - XXH_PRIME32_1; + return XXH_OK; +} + + +/*! @ingroup XXH32_family */ +XXH_PUBLIC_API XXH_errorcode +XXH32_update(XXH32_state_t* state, const void* input, size_t len) +{ + if (input==NULL) { + XXH_ASSERT(len == 0); + return XXH_OK; + } + + { const xxh_u8* p = (const xxh_u8*)input; + const xxh_u8* const bEnd = p + len; + + state->total_len_32 += (XXH32_hash_t)len; + state->large_len |= (XXH32_hash_t)((len>=16) | (state->total_len_32>=16)); + + if (state->memsize + len < 16) { /* fill in tmp buffer */ + XXH_memcpy((xxh_u8*)(state->mem32) + state->memsize, input, len); + state->memsize += (XXH32_hash_t)len; + return XXH_OK; + } + + if (state->memsize) { /* some data left from previous update */ + XXH_memcpy((xxh_u8*)(state->mem32) + state->memsize, input, 16-state->memsize); + { const xxh_u32* p32 = state->mem32; + state->v[0] = XXH32_round(state->v[0], XXH_readLE32(p32)); p32++; + state->v[1] = XXH32_round(state->v[1], XXH_readLE32(p32)); p32++; + state->v[2] = XXH32_round(state->v[2], XXH_readLE32(p32)); p32++; + state->v[3] = XXH32_round(state->v[3], XXH_readLE32(p32)); + } + p += 16-state->memsize; + state->memsize = 0; + } + + if (p <= bEnd-16) { + const xxh_u8* const limit = bEnd - 16; + + do { + state->v[0] = XXH32_round(state->v[0], XXH_readLE32(p)); p+=4; + state->v[1] = XXH32_round(state->v[1], XXH_readLE32(p)); p+=4; + state->v[2] = XXH32_round(state->v[2], XXH_readLE32(p)); p+=4; + state->v[3] = XXH32_round(state->v[3], XXH_readLE32(p)); p+=4; + } while (p<=limit); + + } + + if (p < bEnd) { + XXH_memcpy(state->mem32, p, (size_t)(bEnd-p)); + state->memsize = (unsigned)(bEnd-p); + } + } + + return XXH_OK; +} + + +/*! @ingroup XXH32_family */ +XXH_PUBLIC_API XXH32_hash_t XXH32_digest(const XXH32_state_t* state) +{ + xxh_u32 h32; + + if (state->large_len) { + h32 = XXH_rotl32(state->v[0], 1) + + XXH_rotl32(state->v[1], 7) + + XXH_rotl32(state->v[2], 12) + + XXH_rotl32(state->v[3], 18); + } else { + h32 = state->v[2] /* == seed */ + XXH_PRIME32_5; + } + + h32 += state->total_len_32; + + return XXH32_finalize(h32, (const xxh_u8*)state->mem32, state->memsize, XXH_aligned); +} +#endif /* !XXH_NO_STREAM */ + +/******* Canonical representation *******/ + +/*! @ingroup XXH32_family */ +XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash) +{ + XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) == sizeof(XXH32_hash_t)); + if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap32(hash); + XXH_memcpy(dst, &hash, sizeof(*dst)); +} +/*! @ingroup XXH32_family */ +XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src) +{ + return XXH_readBE32(src); +} + + +#ifndef XXH_NO_LONG_LONG + +/* ******************************************************************* +* 64-bit hash functions +*********************************************************************/ +/*! + * @} + * @ingroup impl + * @{ + */ +/******* Memory access *******/ + +typedef XXH64_hash_t xxh_u64; + +#ifdef XXH_OLD_NAMES +# define U64 xxh_u64 +#endif + +#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==3)) +/* + * Manual byteshift. Best for old compilers which don't inline memcpy. + * We actually directly use XXH_readLE64 and XXH_readBE64. + */ +#elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2)) + +/* Force direct memory access. Only works on CPU which support unaligned memory access in hardware */ +static xxh_u64 XXH_read64(const void* memPtr) +{ + return *(const xxh_u64*) memPtr; +} + +#elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1)) + +/* + * __attribute__((aligned(1))) is supported by gcc and clang. Originally the + * documentation claimed that it only increased the alignment, but actually it + * can decrease it on gcc, clang, and icc: + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69502, + * https://gcc.godbolt.org/z/xYez1j67Y. + */ +#ifdef XXH_OLD_NAMES +typedef union { xxh_u32 u32; xxh_u64 u64; } __attribute__((packed)) unalign64; +#endif +static xxh_u64 XXH_read64(const void* ptr) +{ + typedef __attribute__((aligned(1))) xxh_u64 xxh_unalign64; + return *((const xxh_unalign64*)ptr); +} + +#else + +/* + * Portable and safe solution. Generally efficient. + * see: https://fastcompression.blogspot.com/2015/08/accessing-unaligned-memory.html + */ +static xxh_u64 XXH_read64(const void* memPtr) +{ + xxh_u64 val; + XXH_memcpy(&val, memPtr, sizeof(val)); + return val; +} + +#endif /* XXH_FORCE_DIRECT_MEMORY_ACCESS */ + +#if defined(_MSC_VER) /* Visual Studio */ +# define XXH_swap64 _byteswap_uint64 +#elif XXH_GCC_VERSION >= 403 +# define XXH_swap64 __builtin_bswap64 +#else +static xxh_u64 XXH_swap64(xxh_u64 x) +{ + return ((x << 56) & 0xff00000000000000ULL) | + ((x << 40) & 0x00ff000000000000ULL) | + ((x << 24) & 0x0000ff0000000000ULL) | + ((x << 8) & 0x000000ff00000000ULL) | + ((x >> 8) & 0x00000000ff000000ULL) | + ((x >> 24) & 0x0000000000ff0000ULL) | + ((x >> 40) & 0x000000000000ff00ULL) | + ((x >> 56) & 0x00000000000000ffULL); +} +#endif + + +/* XXH_FORCE_MEMORY_ACCESS==3 is an endian-independent byteshift load. */ +#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==3)) + +XXH_FORCE_INLINE xxh_u64 XXH_readLE64(const void* memPtr) +{ + const xxh_u8* bytePtr = (const xxh_u8 *)memPtr; + return bytePtr[0] + | ((xxh_u64)bytePtr[1] << 8) + | ((xxh_u64)bytePtr[2] << 16) + | ((xxh_u64)bytePtr[3] << 24) + | ((xxh_u64)bytePtr[4] << 32) + | ((xxh_u64)bytePtr[5] << 40) + | ((xxh_u64)bytePtr[6] << 48) + | ((xxh_u64)bytePtr[7] << 56); +} + +XXH_FORCE_INLINE xxh_u64 XXH_readBE64(const void* memPtr) +{ + const xxh_u8* bytePtr = (const xxh_u8 *)memPtr; + return bytePtr[7] + | ((xxh_u64)bytePtr[6] << 8) + | ((xxh_u64)bytePtr[5] << 16) + | ((xxh_u64)bytePtr[4] << 24) + | ((xxh_u64)bytePtr[3] << 32) + | ((xxh_u64)bytePtr[2] << 40) + | ((xxh_u64)bytePtr[1] << 48) + | ((xxh_u64)bytePtr[0] << 56); +} + +#else +XXH_FORCE_INLINE xxh_u64 XXH_readLE64(const void* ptr) +{ + return XXH_CPU_LITTLE_ENDIAN ? XXH_read64(ptr) : XXH_swap64(XXH_read64(ptr)); +} + +static xxh_u64 XXH_readBE64(const void* ptr) +{ + return XXH_CPU_LITTLE_ENDIAN ? XXH_swap64(XXH_read64(ptr)) : XXH_read64(ptr); +} +#endif + +XXH_FORCE_INLINE xxh_u64 +XXH_readLE64_align(const void* ptr, XXH_alignment align) +{ + if (align==XXH_unaligned) + return XXH_readLE64(ptr); + else + return XXH_CPU_LITTLE_ENDIAN ? *(const xxh_u64*)ptr : XXH_swap64(*(const xxh_u64*)ptr); +} + + +/******* xxh64 *******/ +/*! + * @} + * @defgroup XXH64_impl XXH64 implementation + * @ingroup impl + * + * Details on the XXH64 implementation. + * @{ + */ +/* #define rather that static const, to be used as initializers */ +#define XXH_PRIME64_1 0x9E3779B185EBCA87ULL /*!< 0b1001111000110111011110011011000110000101111010111100101010000111 */ +#define XXH_PRIME64_2 0xC2B2AE3D27D4EB4FULL /*!< 0b1100001010110010101011100011110100100111110101001110101101001111 */ +#define XXH_PRIME64_3 0x165667B19E3779F9ULL /*!< 0b0001011001010110011001111011000110011110001101110111100111111001 */ +#define XXH_PRIME64_4 0x85EBCA77C2B2AE63ULL /*!< 0b1000010111101011110010100111011111000010101100101010111001100011 */ +#define XXH_PRIME64_5 0x27D4EB2F165667C5ULL /*!< 0b0010011111010100111010110010111100010110010101100110011111000101 */ + +#ifdef XXH_OLD_NAMES +# define PRIME64_1 XXH_PRIME64_1 +# define PRIME64_2 XXH_PRIME64_2 +# define PRIME64_3 XXH_PRIME64_3 +# define PRIME64_4 XXH_PRIME64_4 +# define PRIME64_5 XXH_PRIME64_5 +#endif + +/*! @copydoc XXH32_round */ +static xxh_u64 XXH64_round(xxh_u64 acc, xxh_u64 input) +{ + acc += input * XXH_PRIME64_2; + acc = XXH_rotl64(acc, 31); + acc *= XXH_PRIME64_1; +#if (defined(__AVX512F__)) && !defined(XXH_ENABLE_AUTOVECTORIZE) + /* + * DISABLE AUTOVECTORIZATION: + * A compiler fence is used to prevent GCC and Clang from + * autovectorizing the XXH64 loop (pragmas and attributes don't work for some + * reason) without globally disabling AVX512. + * + * Autovectorization of XXH64 tends to be detrimental, + * though the exact outcome may change depending on exact cpu and compiler version. + * For information, it has been reported as detrimental for Skylake-X, + * but possibly beneficial for Zen4. + * + * The default is to disable auto-vectorization, + * but you can select to enable it instead using `XXH_ENABLE_AUTOVECTORIZE` build variable. + */ + XXH_COMPILER_GUARD(acc); +#endif + return acc; +} + +static xxh_u64 XXH64_mergeRound(xxh_u64 acc, xxh_u64 val) +{ + val = XXH64_round(0, val); + acc ^= val; + acc = acc * XXH_PRIME64_1 + XXH_PRIME64_4; + return acc; +} + +/*! @copydoc XXH32_avalanche */ +static xxh_u64 XXH64_avalanche(xxh_u64 hash) +{ + hash ^= hash >> 33; + hash *= XXH_PRIME64_2; + hash ^= hash >> 29; + hash *= XXH_PRIME64_3; + hash ^= hash >> 32; + return hash; +} + + +#define XXH_get64bits(p) XXH_readLE64_align(p, align) + +/*! + * @internal + * @brief Processes the last 0-31 bytes of @p ptr. + * + * There may be up to 31 bytes remaining to consume from the input. + * This final stage will digest them to ensure that all input bytes are present + * in the final mix. + * + * @param hash The hash to finalize. + * @param ptr The pointer to the remaining input. + * @param len The remaining length, modulo 32. + * @param align Whether @p ptr is aligned. + * @return The finalized hash + * @see XXH32_finalize(). + */ +static XXH_PUREF xxh_u64 +XXH64_finalize(xxh_u64 hash, const xxh_u8* ptr, size_t len, XXH_alignment align) +{ + if (ptr==NULL) XXH_ASSERT(len == 0); + len &= 31; + while (len >= 8) { + xxh_u64 const k1 = XXH64_round(0, XXH_get64bits(ptr)); + ptr += 8; + hash ^= k1; + hash = XXH_rotl64(hash,27) * XXH_PRIME64_1 + XXH_PRIME64_4; + len -= 8; + } + if (len >= 4) { + hash ^= (xxh_u64)(XXH_get32bits(ptr)) * XXH_PRIME64_1; + ptr += 4; + hash = XXH_rotl64(hash, 23) * XXH_PRIME64_2 + XXH_PRIME64_3; + len -= 4; + } + while (len > 0) { + hash ^= (*ptr++) * XXH_PRIME64_5; + hash = XXH_rotl64(hash, 11) * XXH_PRIME64_1; + --len; + } + return XXH64_avalanche(hash); +} + +#ifdef XXH_OLD_NAMES +# define PROCESS1_64 XXH_PROCESS1_64 +# define PROCESS4_64 XXH_PROCESS4_64 +# define PROCESS8_64 XXH_PROCESS8_64 +#else +# undef XXH_PROCESS1_64 +# undef XXH_PROCESS4_64 +# undef XXH_PROCESS8_64 +#endif + +/*! + * @internal + * @brief The implementation for @ref XXH64(). + * + * @param input , len , seed Directly passed from @ref XXH64(). + * @param align Whether @p input is aligned. + * @return The calculated hash. + */ +XXH_FORCE_INLINE XXH_PUREF xxh_u64 +XXH64_endian_align(const xxh_u8* input, size_t len, xxh_u64 seed, XXH_alignment align) +{ + xxh_u64 h64; + if (input==NULL) XXH_ASSERT(len == 0); + + if (len>=32) { + const xxh_u8* const bEnd = input + len; + const xxh_u8* const limit = bEnd - 31; + xxh_u64 v1 = seed + XXH_PRIME64_1 + XXH_PRIME64_2; + xxh_u64 v2 = seed + XXH_PRIME64_2; + xxh_u64 v3 = seed + 0; + xxh_u64 v4 = seed - XXH_PRIME64_1; + + do { + v1 = XXH64_round(v1, XXH_get64bits(input)); input+=8; + v2 = XXH64_round(v2, XXH_get64bits(input)); input+=8; + v3 = XXH64_round(v3, XXH_get64bits(input)); input+=8; + v4 = XXH64_round(v4, XXH_get64bits(input)); input+=8; + } while (input<limit); + + h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18); + h64 = XXH64_mergeRound(h64, v1); + h64 = XXH64_mergeRound(h64, v2); + h64 = XXH64_mergeRound(h64, v3); + h64 = XXH64_mergeRound(h64, v4); + + } else { + h64 = seed + XXH_PRIME64_5; + } + + h64 += (xxh_u64) len; + + return XXH64_finalize(h64, input, len, align); +} + + +/*! @ingroup XXH64_family */ +XXH_PUBLIC_API XXH64_hash_t XXH64 (XXH_NOESCAPE const void* input, size_t len, XXH64_hash_t seed) +{ +#if !defined(XXH_NO_STREAM) && XXH_SIZE_OPT >= 2 + /* Simple version, good for code maintenance, but unfortunately slow for small inputs */ + XXH64_state_t state; + XXH64_reset(&state, seed); + XXH64_update(&state, (const xxh_u8*)input, len); + return XXH64_digest(&state); +#else + if (XXH_FORCE_ALIGN_CHECK) { + if ((((size_t)input) & 7)==0) { /* Input is aligned, let's leverage the speed advantage */ + return XXH64_endian_align((const xxh_u8*)input, len, seed, XXH_aligned); + } } + + return XXH64_endian_align((const xxh_u8*)input, len, seed, XXH_unaligned); + +#endif +} + +/******* Hash Streaming *******/ +#ifndef XXH_NO_STREAM +/*! @ingroup XXH64_family*/ +XXH_PUBLIC_API XXH64_state_t* XXH64_createState(void) +{ + return (XXH64_state_t*)XXH_malloc(sizeof(XXH64_state_t)); +} +/*! @ingroup XXH64_family */ +XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr) +{ + XXH_free(statePtr); + return XXH_OK; +} + +/*! @ingroup XXH64_family */ +XXH_PUBLIC_API void XXH64_copyState(XXH_NOESCAPE XXH64_state_t* dstState, const XXH64_state_t* srcState) +{ + XXH_memcpy(dstState, srcState, sizeof(*dstState)); +} + +/*! @ingroup XXH64_family */ +XXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH_NOESCAPE XXH64_state_t* statePtr, XXH64_hash_t seed) +{ + XXH_ASSERT(statePtr != NULL); + memset(statePtr, 0, sizeof(*statePtr)); + statePtr->v[0] = seed + XXH_PRIME64_1 + XXH_PRIME64_2; + statePtr->v[1] = seed + XXH_PRIME64_2; + statePtr->v[2] = seed + 0; + statePtr->v[3] = seed - XXH_PRIME64_1; + return XXH_OK; +} + +/*! @ingroup XXH64_family */ +XXH_PUBLIC_API XXH_errorcode +XXH64_update (XXH_NOESCAPE XXH64_state_t* state, XXH_NOESCAPE const void* input, size_t len) +{ + if (input==NULL) { + XXH_ASSERT(len == 0); + return XXH_OK; + } + + { const xxh_u8* p = (const xxh_u8*)input; + const xxh_u8* const bEnd = p + len; + + state->total_len += len; + + if (state->memsize + len < 32) { /* fill in tmp buffer */ + XXH_memcpy(((xxh_u8*)state->mem64) + state->memsize, input, len); + state->memsize += (xxh_u32)len; + return XXH_OK; + } + + if (state->memsize) { /* tmp buffer is full */ + XXH_memcpy(((xxh_u8*)state->mem64) + state->memsize, input, 32-state->memsize); + state->v[0] = XXH64_round(state->v[0], XXH_readLE64(state->mem64+0)); + state->v[1] = XXH64_round(state->v[1], XXH_readLE64(state->mem64+1)); + state->v[2] = XXH64_round(state->v[2], XXH_readLE64(state->mem64+2)); + state->v[3] = XXH64_round(state->v[3], XXH_readLE64(state->mem64+3)); + p += 32 - state->memsize; + state->memsize = 0; + } + + if (p+32 <= bEnd) { + const xxh_u8* const limit = bEnd - 32; + + do { + state->v[0] = XXH64_round(state->v[0], XXH_readLE64(p)); p+=8; + state->v[1] = XXH64_round(state->v[1], XXH_readLE64(p)); p+=8; + state->v[2] = XXH64_round(state->v[2], XXH_readLE64(p)); p+=8; + state->v[3] = XXH64_round(state->v[3], XXH_readLE64(p)); p+=8; + } while (p<=limit); + + } + + if (p < bEnd) { + XXH_memcpy(state->mem64, p, (size_t)(bEnd-p)); + state->memsize = (unsigned)(bEnd-p); + } + } + + return XXH_OK; +} + + +/*! @ingroup XXH64_family */ +XXH_PUBLIC_API XXH64_hash_t XXH64_digest(XXH_NOESCAPE const XXH64_state_t* state) +{ + xxh_u64 h64; + + if (state->total_len >= 32) { + h64 = XXH_rotl64(state->v[0], 1) + XXH_rotl64(state->v[1], 7) + XXH_rotl64(state->v[2], 12) + XXH_rotl64(state->v[3], 18); + h64 = XXH64_mergeRound(h64, state->v[0]); + h64 = XXH64_mergeRound(h64, state->v[1]); + h64 = XXH64_mergeRound(h64, state->v[2]); + h64 = XXH64_mergeRound(h64, state->v[3]); + } else { + h64 = state->v[2] /*seed*/ + XXH_PRIME64_5; + } + + h64 += (xxh_u64) state->total_len; + + return XXH64_finalize(h64, (const xxh_u8*)state->mem64, (size_t)state->total_len, XXH_aligned); +} +#endif /* !XXH_NO_STREAM */ + +/******* Canonical representation *******/ + +/*! @ingroup XXH64_family */ +XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH_NOESCAPE XXH64_canonical_t* dst, XXH64_hash_t hash) +{ + XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) == sizeof(XXH64_hash_t)); + if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap64(hash); + XXH_memcpy(dst, &hash, sizeof(*dst)); +} + +/*! @ingroup XXH64_family */ +XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(XXH_NOESCAPE const XXH64_canonical_t* src) +{ + return XXH_readBE64(src); +} + +#ifndef XXH_NO_XXH3 + +/* ********************************************************************* +* XXH3 +* New generation hash designed for speed on small keys and vectorization +************************************************************************ */ +/*! + * @} + * @defgroup XXH3_impl XXH3 implementation + * @ingroup impl + * @{ + */ + +/* === Compiler specifics === */ + +#if ((defined(sun) || defined(__sun)) && __cplusplus) /* Solaris includes __STDC_VERSION__ with C++. Tested with GCC 5.5 */ +# define XXH_RESTRICT /* disable */ +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* >= C99 */ +# define XXH_RESTRICT restrict +#elif (defined (__GNUC__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))) \ + || (defined (__clang__)) \ + || (defined (_MSC_VER) && (_MSC_VER >= 1400)) \ + || (defined (__INTEL_COMPILER) && (__INTEL_COMPILER >= 1300)) +/* + * There are a LOT more compilers that recognize __restrict but this + * covers the major ones. + */ +# define XXH_RESTRICT __restrict +#else +# define XXH_RESTRICT /* disable */ +#endif + +#if (defined(__GNUC__) && (__GNUC__ >= 3)) \ + || (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 800)) \ + || defined(__clang__) +# define XXH_likely(x) __builtin_expect(x, 1) +# define XXH_unlikely(x) __builtin_expect(x, 0) +#else +# define XXH_likely(x) (x) +# define XXH_unlikely(x) (x) +#endif + +#ifndef XXH_HAS_INCLUDE +# ifdef __has_include +/* + * Not defined as XXH_HAS_INCLUDE(x) (function-like) because + * this causes segfaults in Apple Clang 4.2 (on Mac OS X 10.7 Lion) + */ +# define XXH_HAS_INCLUDE __has_include +# else +# define XXH_HAS_INCLUDE(x) 0 +# endif +#endif + +#if defined(__GNUC__) || defined(__clang__) +# if defined(__ARM_FEATURE_SVE) +# include <arm_sve.h> +# endif +# if defined(__ARM_NEON__) || defined(__ARM_NEON) \ + || (defined(_M_ARM) && _M_ARM >= 7) \ + || defined(_M_ARM64) || defined(_M_ARM64EC) \ + || (defined(__wasm_simd128__) && XXH_HAS_INCLUDE(<arm_neon.h>)) /* WASM SIMD128 via SIMDe */ +# define inline __inline__ /* circumvent a clang bug */ +# include <arm_neon.h> +# undef inline +# elif defined(__AVX2__) +# include <immintrin.h> +# elif defined(__SSE2__) +# include <emmintrin.h> +# endif +#endif + +#if defined(_MSC_VER) +# include <intrin.h> +#endif + +/* + * One goal of XXH3 is to make it fast on both 32-bit and 64-bit, while + * remaining a true 64-bit/128-bit hash function. + * + * This is done by prioritizing a subset of 64-bit operations that can be + * emulated without too many steps on the average 32-bit machine. + * + * For example, these two lines seem similar, and run equally fast on 64-bit: + * + * xxh_u64 x; + * x ^= (x >> 47); // good + * x ^= (x >> 13); // bad + * + * However, to a 32-bit machine, there is a major difference. + * + * x ^= (x >> 47) looks like this: + * + * x.lo ^= (x.hi >> (47 - 32)); + * + * while x ^= (x >> 13) looks like this: + * + * // note: funnel shifts are not usually cheap. + * x.lo ^= (x.lo >> 13) | (x.hi << (32 - 13)); + * x.hi ^= (x.hi >> 13); + * + * The first one is significantly faster than the second, simply because the + * shift is larger than 32. This means: + * - All the bits we need are in the upper 32 bits, so we can ignore the lower + * 32 bits in the shift. + * - The shift result will always fit in the lower 32 bits, and therefore, + * we can ignore the upper 32 bits in the xor. + * + * Thanks to this optimization, XXH3 only requires these features to be efficient: + * + * - Usable unaligned access + * - A 32-bit or 64-bit ALU + * - If 32-bit, a decent ADC instruction + * - A 32 or 64-bit multiply with a 64-bit result + * - For the 128-bit variant, a decent byteswap helps short inputs. + * + * The first two are already required by XXH32, and almost all 32-bit and 64-bit + * platforms which can run XXH32 can run XXH3 efficiently. + * + * Thumb-1, the classic 16-bit only subset of ARM's instruction set, is one + * notable exception. + * + * First of all, Thumb-1 lacks support for the UMULL instruction which + * performs the important long multiply. This means numerous __aeabi_lmul + * calls. + * + * Second of all, the 8 functional registers are just not enough. + * Setup for __aeabi_lmul, byteshift loads, pointers, and all arithmetic need + * Lo registers, and this shuffling results in thousands more MOVs than A32. + * + * A32 and T32 don't have this limitation. They can access all 14 registers, + * do a 32->64 multiply with UMULL, and the flexible operand allowing free + * shifts is helpful, too. + * + * Therefore, we do a quick sanity check. + * + * If compiling Thumb-1 for a target which supports ARM instructions, we will + * emit a warning, as it is not a "sane" platform to compile for. + * + * Usually, if this happens, it is because of an accident and you probably need + * to specify -march, as you likely meant to compile for a newer architecture. + * + * Credit: large sections of the vectorial and asm source code paths + * have been contributed by @easyaspi314 + */ +#if defined(__thumb__) && !defined(__thumb2__) && defined(__ARM_ARCH_ISA_ARM) +# warning "XXH3 is highly inefficient without ARM or Thumb-2." +#endif + +/* ========================================== + * Vectorization detection + * ========================================== */ + +#ifdef XXH_DOXYGEN +/*! + * @ingroup tuning + * @brief Overrides the vectorization implementation chosen for XXH3. + * + * Can be defined to 0 to disable SIMD or any of the values mentioned in + * @ref XXH_VECTOR_TYPE. + * + * If this is not defined, it uses predefined macros to determine the best + * implementation. + */ +# define XXH_VECTOR XXH_SCALAR +/*! + * @ingroup tuning + * @brief Possible values for @ref XXH_VECTOR. + * + * Note that these are actually implemented as macros. + * + * If this is not defined, it is detected automatically. + * internal macro XXH_X86DISPATCH overrides this. + */ +enum XXH_VECTOR_TYPE /* fake enum */ { + XXH_SCALAR = 0, /*!< Portable scalar version */ + XXH_SSE2 = 1, /*!< + * SSE2 for Pentium 4, Opteron, all x86_64. + * + * @note SSE2 is also guaranteed on Windows 10, macOS, and + * Android x86. + */ + XXH_AVX2 = 2, /*!< AVX2 for Haswell and Bulldozer */ + XXH_AVX512 = 3, /*!< AVX512 for Skylake and Icelake */ + XXH_NEON = 4, /*!< + * NEON for most ARMv7-A, all AArch64, and WASM SIMD128 + * via the SIMDeverywhere polyfill provided with the + * Emscripten SDK. + */ + XXH_VSX = 5, /*!< VSX and ZVector for POWER8/z13 (64-bit) */ + XXH_SVE = 6, /*!< SVE for some ARMv8-A and ARMv9-A */ +}; +/*! + * @ingroup tuning + * @brief Selects the minimum alignment for XXH3's accumulators. + * + * When using SIMD, this should match the alignment required for said vector + * type, so, for example, 32 for AVX2. + * + * Default: Auto detected. + */ +# define XXH_ACC_ALIGN 8 +#endif + +/* Actual definition */ +#ifndef XXH_DOXYGEN +# define XXH_SCALAR 0 +# define XXH_SSE2 1 +# define XXH_AVX2 2 +# define XXH_AVX512 3 +# define XXH_NEON 4 +# define XXH_VSX 5 +# define XXH_SVE 6 +#endif + +#ifndef XXH_VECTOR /* can be defined on command line */ +# if defined(__ARM_FEATURE_SVE) +# define XXH_VECTOR XXH_SVE +# elif ( \ + defined(__ARM_NEON__) || defined(__ARM_NEON) /* gcc */ \ + || defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC) /* msvc */ \ + || (defined(__wasm_simd128__) && XXH_HAS_INCLUDE(<arm_neon.h>)) /* wasm simd128 via SIMDe */ \ + ) && ( \ + defined(_WIN32) || defined(__LITTLE_ENDIAN__) /* little endian only */ \ + || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) \ + ) +# define XXH_VECTOR XXH_NEON +# elif defined(__AVX512F__) +# define XXH_VECTOR XXH_AVX512 +# elif defined(__AVX2__) +# define XXH_VECTOR XXH_AVX2 +# elif defined(__SSE2__) || defined(_M_AMD64) || defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP == 2)) +# define XXH_VECTOR XXH_SSE2 +# elif (defined(__PPC64__) && defined(__POWER8_VECTOR__)) \ + || (defined(__s390x__) && defined(__VEC__)) \ + && defined(__GNUC__) /* TODO: IBM XL */ +# define XXH_VECTOR XXH_VSX +# else +# define XXH_VECTOR XXH_SCALAR +# endif +#endif + +/* __ARM_FEATURE_SVE is only supported by GCC & Clang. */ +#if (XXH_VECTOR == XXH_SVE) && !defined(__ARM_FEATURE_SVE) +# ifdef _MSC_VER +# pragma warning(once : 4606) +# else +# warning "__ARM_FEATURE_SVE isn't supported. Use SCALAR instead." +# endif +# undef XXH_VECTOR +# define XXH_VECTOR XXH_SCALAR +#endif + +/* + * Controls the alignment of the accumulator, + * for compatibility with aligned vector loads, which are usually faster. + */ +#ifndef XXH_ACC_ALIGN +# if defined(XXH_X86DISPATCH) +# define XXH_ACC_ALIGN 64 /* for compatibility with avx512 */ +# elif XXH_VECTOR == XXH_SCALAR /* scalar */ +# define XXH_ACC_ALIGN 8 +# elif XXH_VECTOR == XXH_SSE2 /* sse2 */ +# define XXH_ACC_ALIGN 16 +# elif XXH_VECTOR == XXH_AVX2 /* avx2 */ +# define XXH_ACC_ALIGN 32 +# elif XXH_VECTOR == XXH_NEON /* neon */ +# define XXH_ACC_ALIGN 16 +# elif XXH_VECTOR == XXH_VSX /* vsx */ +# define XXH_ACC_ALIGN 16 +# elif XXH_VECTOR == XXH_AVX512 /* avx512 */ +# define XXH_ACC_ALIGN 64 +# elif XXH_VECTOR == XXH_SVE /* sve */ +# define XXH_ACC_ALIGN 64 +# endif +#endif + +#if defined(XXH_X86DISPATCH) || XXH_VECTOR == XXH_SSE2 \ + || XXH_VECTOR == XXH_AVX2 || XXH_VECTOR == XXH_AVX512 +# define XXH_SEC_ALIGN XXH_ACC_ALIGN +#elif XXH_VECTOR == XXH_SVE +# define XXH_SEC_ALIGN XXH_ACC_ALIGN +#else +# define XXH_SEC_ALIGN 8 +#endif + +#if defined(__GNUC__) || defined(__clang__) +# define XXH_ALIASING __attribute__((may_alias)) +#else +# define XXH_ALIASING /* nothing */ +#endif + +/* + * UGLY HACK: + * GCC usually generates the best code with -O3 for xxHash. + * + * However, when targeting AVX2, it is overzealous in its unrolling resulting + * in code roughly 3/4 the speed of Clang. + * + * There are other issues, such as GCC splitting _mm256_loadu_si256 into + * _mm_loadu_si128 + _mm256_inserti128_si256. This is an optimization which + * only applies to Sandy and Ivy Bridge... which don't even support AVX2. + * + * That is why when compiling the AVX2 version, it is recommended to use either + * -O2 -mavx2 -march=haswell + * or + * -O2 -mavx2 -mno-avx256-split-unaligned-load + * for decent performance, or to use Clang instead. + * + * Fortunately, we can control the first one with a pragma that forces GCC into + * -O2, but the other one we can't control without "failed to inline always + * inline function due to target mismatch" warnings. + */ +#if XXH_VECTOR == XXH_AVX2 /* AVX2 */ \ + && defined(__GNUC__) && !defined(__clang__) /* GCC, not Clang */ \ + && defined(__OPTIMIZE__) && XXH_SIZE_OPT <= 0 /* respect -O0 and -Os */ +# pragma GCC push_options +# pragma GCC optimize("-O2") +#endif + +#if XXH_VECTOR == XXH_NEON + +/* + * UGLY HACK: While AArch64 GCC on Linux does not seem to care, on macOS, GCC -O3 + * optimizes out the entire hashLong loop because of the aliasing violation. + * + * However, GCC is also inefficient at load-store optimization with vld1q/vst1q, + * so the only option is to mark it as aliasing. + */ +typedef uint64x2_t xxh_aliasing_uint64x2_t XXH_ALIASING; + +/*! + * @internal + * @brief `vld1q_u64` but faster and alignment-safe. + * + * On AArch64, unaligned access is always safe, but on ARMv7-a, it is only + * *conditionally* safe (`vld1` has an alignment bit like `movdq[ua]` in x86). + * + * GCC for AArch64 sees `vld1q_u8` as an intrinsic instead of a load, so it + * prohibits load-store optimizations. Therefore, a direct dereference is used. + * + * Otherwise, `vld1q_u8` is used with `vreinterpretq_u8_u64` to do a safe + * unaligned load. + */ +#if defined(__aarch64__) && defined(__GNUC__) && !defined(__clang__) +XXH_FORCE_INLINE uint64x2_t XXH_vld1q_u64(void const* ptr) /* silence -Wcast-align */ +{ + return *(xxh_aliasing_uint64x2_t const *)ptr; +} +#else +XXH_FORCE_INLINE uint64x2_t XXH_vld1q_u64(void const* ptr) +{ + return vreinterpretq_u64_u8(vld1q_u8((uint8_t const*)ptr)); +} +#endif + +/*! + * @internal + * @brief `vmlal_u32` on low and high halves of a vector. + * + * This is a workaround for AArch64 GCC < 11 which implemented arm_neon.h with + * inline assembly and were therefore incapable of merging the `vget_{low, high}_u32` + * with `vmlal_u32`. + */ +#if defined(__aarch64__) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 11 +XXH_FORCE_INLINE uint64x2_t +XXH_vmlal_low_u32(uint64x2_t acc, uint32x4_t lhs, uint32x4_t rhs) +{ + /* Inline assembly is the only way */ + __asm__("umlal %0.2d, %1.2s, %2.2s" : "+w" (acc) : "w" (lhs), "w" (rhs)); + return acc; +} +XXH_FORCE_INLINE uint64x2_t +XXH_vmlal_high_u32(uint64x2_t acc, uint32x4_t lhs, uint32x4_t rhs) +{ + /* This intrinsic works as expected */ + return vmlal_high_u32(acc, lhs, rhs); +} +#else +/* Portable intrinsic versions */ +XXH_FORCE_INLINE uint64x2_t +XXH_vmlal_low_u32(uint64x2_t acc, uint32x4_t lhs, uint32x4_t rhs) +{ + return vmlal_u32(acc, vget_low_u32(lhs), vget_low_u32(rhs)); +} +/*! @copydoc XXH_vmlal_low_u32 + * Assume the compiler converts this to vmlal_high_u32 on aarch64 */ +XXH_FORCE_INLINE uint64x2_t +XXH_vmlal_high_u32(uint64x2_t acc, uint32x4_t lhs, uint32x4_t rhs) +{ + return vmlal_u32(acc, vget_high_u32(lhs), vget_high_u32(rhs)); +} +#endif + +/*! + * @ingroup tuning + * @brief Controls the NEON to scalar ratio for XXH3 + * + * This can be set to 2, 4, 6, or 8. + * + * ARM Cortex CPUs are _very_ sensitive to how their pipelines are used. + * + * For example, the Cortex-A73 can dispatch 3 micro-ops per cycle, but only 2 of those + * can be NEON. If you are only using NEON instructions, you are only using 2/3 of the CPU + * bandwidth. + * + * This is even more noticeable on the more advanced cores like the Cortex-A76 which + * can dispatch 8 micro-ops per cycle, but still only 2 NEON micro-ops at once. + * + * Therefore, to make the most out of the pipeline, it is beneficial to run 6 NEON lanes + * and 2 scalar lanes, which is chosen by default. + * + * This does not apply to Apple processors or 32-bit processors, which run better with + * full NEON. These will default to 8. Additionally, size-optimized builds run 8 lanes. + * + * This change benefits CPUs with large micro-op buffers without negatively affecting + * most other CPUs: + * + * | Chipset | Dispatch type | NEON only | 6:2 hybrid | Diff. | + * |:----------------------|:--------------------|----------:|-----------:|------:| + * | Snapdragon 730 (A76) | 2 NEON/8 micro-ops | 8.8 GB/s | 10.1 GB/s | ~16% | + * | Snapdragon 835 (A73) | 2 NEON/3 micro-ops | 5.1 GB/s | 5.3 GB/s | ~5% | + * | Marvell PXA1928 (A53) | In-order dual-issue | 1.9 GB/s | 1.9 GB/s | 0% | + * | Apple M1 | 4 NEON/8 micro-ops | 37.3 GB/s | 36.1 GB/s | ~-3% | + * + * It also seems to fix some bad codegen on GCC, making it almost as fast as clang. + * + * When using WASM SIMD128, if this is 2 or 6, SIMDe will scalarize 2 of the lanes meaning + * it effectively becomes worse 4. + * + * @see XXH3_accumulate_512_neon() + */ +# ifndef XXH3_NEON_LANES +# if (defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64) || defined(_M_ARM64EC)) \ + && !defined(__APPLE__) && XXH_SIZE_OPT <= 0 +# define XXH3_NEON_LANES 6 +# else +# define XXH3_NEON_LANES XXH_ACC_NB +# endif +# endif +#endif /* XXH_VECTOR == XXH_NEON */ + +/* + * VSX and Z Vector helpers. + * + * This is very messy, and any pull requests to clean this up are welcome. + * + * There are a lot of problems with supporting VSX and s390x, due to + * inconsistent intrinsics, spotty coverage, and multiple endiannesses. + */ +#if XXH_VECTOR == XXH_VSX +/* Annoyingly, these headers _may_ define three macros: `bool`, `vector`, + * and `pixel`. This is a problem for obvious reasons. + * + * These keywords are unnecessary; the spec literally says they are + * equivalent to `__bool`, `__vector`, and `__pixel` and may be undef'd + * after including the header. + * + * We use pragma push_macro/pop_macro to keep the namespace clean. */ +# pragma push_macro("bool") +# pragma push_macro("vector") +# pragma push_macro("pixel") +/* silence potential macro redefined warnings */ +# undef bool +# undef vector +# undef pixel + +# if defined(__s390x__) +# include <s390intrin.h> +# else +# include <altivec.h> # endif -#endif /* XXH_STATIC_LINKING_ONLY && XXH_STATIC_H_3543687687345 */ +/* Restore the original macro values, if applicable. */ +# pragma pop_macro("pixel") +# pragma pop_macro("vector") +# pragma pop_macro("bool") + +typedef __vector unsigned long long xxh_u64x2; +typedef __vector unsigned char xxh_u8x16; +typedef __vector unsigned xxh_u32x4; + +/* + * UGLY HACK: Similar to aarch64 macOS GCC, s390x GCC has the same aliasing issue. + */ +typedef xxh_u64x2 xxh_aliasing_u64x2 XXH_ALIASING; + +# ifndef XXH_VSX_BE +# if defined(__BIG_ENDIAN__) \ + || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) +# define XXH_VSX_BE 1 +# elif defined(__VEC_ELEMENT_REG_ORDER__) && __VEC_ELEMENT_REG_ORDER__ == __ORDER_BIG_ENDIAN__ +# warning "-maltivec=be is not recommended. Please use native endianness." +# define XXH_VSX_BE 1 +# else +# define XXH_VSX_BE 0 +# endif +# endif /* !defined(XXH_VSX_BE) */ + +# if XXH_VSX_BE +# if defined(__POWER9_VECTOR__) || (defined(__clang__) && defined(__s390x__)) +# define XXH_vec_revb vec_revb +# else +/*! + * A polyfill for POWER9's vec_revb(). + */ +XXH_FORCE_INLINE xxh_u64x2 XXH_vec_revb(xxh_u64x2 val) +{ + xxh_u8x16 const vByteSwap = { 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, + 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08 }; + return vec_perm(val, val, vByteSwap); +} +# endif +# endif /* XXH_VSX_BE */ + +/*! + * Performs an unaligned vector load and byte swaps it on big endian. + */ +XXH_FORCE_INLINE xxh_u64x2 XXH_vec_loadu(const void *ptr) +{ + xxh_u64x2 ret; + XXH_memcpy(&ret, ptr, sizeof(xxh_u64x2)); +# if XXH_VSX_BE + ret = XXH_vec_revb(ret); +# endif + return ret; +} + +/* + * vec_mulo and vec_mule are very problematic intrinsics on PowerPC + * + * These intrinsics weren't added until GCC 8, despite existing for a while, + * and they are endian dependent. Also, their meaning swap depending on version. + * */ +# if defined(__s390x__) + /* s390x is always big endian, no issue on this platform */ +# define XXH_vec_mulo vec_mulo +# define XXH_vec_mule vec_mule +# elif defined(__clang__) && XXH_HAS_BUILTIN(__builtin_altivec_vmuleuw) && !defined(__ibmxl__) +/* Clang has a better way to control this, we can just use the builtin which doesn't swap. */ + /* The IBM XL Compiler (which defined __clang__) only implements the vec_* operations */ +# define XXH_vec_mulo __builtin_altivec_vmulouw +# define XXH_vec_mule __builtin_altivec_vmuleuw +# else +/* gcc needs inline assembly */ +/* Adapted from https://github.com/google/highwayhash/blob/master/highwayhash/hh_vsx.h. */ +XXH_FORCE_INLINE xxh_u64x2 XXH_vec_mulo(xxh_u32x4 a, xxh_u32x4 b) +{ + xxh_u64x2 result; + __asm__("vmulouw %0, %1, %2" : "=v" (result) : "v" (a), "v" (b)); + return result; +} +XXH_FORCE_INLINE xxh_u64x2 XXH_vec_mule(xxh_u32x4 a, xxh_u32x4 b) +{ + xxh_u64x2 result; + __asm__("vmuleuw %0, %1, %2" : "=v" (result) : "v" (a), "v" (b)); + return result; +} +# endif /* XXH_vec_mulo, XXH_vec_mule */ +#endif /* XXH_VECTOR == XXH_VSX */ + +#if XXH_VECTOR == XXH_SVE +#define ACCRND(acc, offset) \ +do { \ + svuint64_t input_vec = svld1_u64(mask, xinput + offset); \ + svuint64_t secret_vec = svld1_u64(mask, xsecret + offset); \ + svuint64_t mixed = sveor_u64_x(mask, secret_vec, input_vec); \ + svuint64_t swapped = svtbl_u64(input_vec, kSwap); \ + svuint64_t mixed_lo = svextw_u64_x(mask, mixed); \ + svuint64_t mixed_hi = svlsr_n_u64_x(mask, mixed, 32); \ + svuint64_t mul = svmad_u64_x(mask, mixed_lo, mixed_hi, swapped); \ + acc = svadd_u64_x(mask, acc, mul); \ +} while (0) +#endif /* XXH_VECTOR == XXH_SVE */ + +/* prefetch + * can be disabled, by declaring XXH_NO_PREFETCH build macro */ +#if defined(XXH_NO_PREFETCH) +# define XXH_PREFETCH(ptr) (void)(ptr) /* disabled */ +#else +# if XXH_SIZE_OPT >= 1 +# define XXH_PREFETCH(ptr) (void)(ptr) +# elif defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86)) /* _mm_prefetch() not defined outside of x86/x64 */ +# include <mmintrin.h> /* https://msdn.microsoft.com/fr-fr/library/84szxsww(v=vs.90).aspx */ +# define XXH_PREFETCH(ptr) _mm_prefetch((const char*)(ptr), _MM_HINT_T0) +# elif defined(__GNUC__) && ( (__GNUC__ >= 4) || ( (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1) ) ) +# define XXH_PREFETCH(ptr) __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */) +# else +# define XXH_PREFETCH(ptr) (void)(ptr) /* disabled */ +# endif +#endif /* XXH_NO_PREFETCH */ +/* ========================================== + * XXH3 default settings + * ========================================== */ + +#define XXH_SECRET_DEFAULT_SIZE 192 /* minimum XXH3_SECRET_SIZE_MIN */ + +#if (XXH_SECRET_DEFAULT_SIZE < XXH3_SECRET_SIZE_MIN) +# error "default keyset is not large enough" +#endif + +/*! Pseudorandom secret taken directly from FARSH. */ +XXH_ALIGN(64) static const xxh_u8 XXH3_kSecret[XXH_SECRET_DEFAULT_SIZE] = { + 0xb8, 0xfe, 0x6c, 0x39, 0x23, 0xa4, 0x4b, 0xbe, 0x7c, 0x01, 0x81, 0x2c, 0xf7, 0x21, 0xad, 0x1c, + 0xde, 0xd4, 0x6d, 0xe9, 0x83, 0x90, 0x97, 0xdb, 0x72, 0x40, 0xa4, 0xa4, 0xb7, 0xb3, 0x67, 0x1f, + 0xcb, 0x79, 0xe6, 0x4e, 0xcc, 0xc0, 0xe5, 0x78, 0x82, 0x5a, 0xd0, 0x7d, 0xcc, 0xff, 0x72, 0x21, + 0xb8, 0x08, 0x46, 0x74, 0xf7, 0x43, 0x24, 0x8e, 0xe0, 0x35, 0x90, 0xe6, 0x81, 0x3a, 0x26, 0x4c, + 0x3c, 0x28, 0x52, 0xbb, 0x91, 0xc3, 0x00, 0xcb, 0x88, 0xd0, 0x65, 0x8b, 0x1b, 0x53, 0x2e, 0xa3, + 0x71, 0x64, 0x48, 0x97, 0xa2, 0x0d, 0xf9, 0x4e, 0x38, 0x19, 0xef, 0x46, 0xa9, 0xde, 0xac, 0xd8, + 0xa8, 0xfa, 0x76, 0x3f, 0xe3, 0x9c, 0x34, 0x3f, 0xf9, 0xdc, 0xbb, 0xc7, 0xc7, 0x0b, 0x4f, 0x1d, + 0x8a, 0x51, 0xe0, 0x4b, 0xcd, 0xb4, 0x59, 0x31, 0xc8, 0x9f, 0x7e, 0xc9, 0xd9, 0x78, 0x73, 0x64, + 0xea, 0xc5, 0xac, 0x83, 0x34, 0xd3, 0xeb, 0xc3, 0xc5, 0x81, 0xa0, 0xff, 0xfa, 0x13, 0x63, 0xeb, + 0x17, 0x0d, 0xdd, 0x51, 0xb7, 0xf0, 0xda, 0x49, 0xd3, 0x16, 0x55, 0x26, 0x29, 0xd4, 0x68, 0x9e, + 0x2b, 0x16, 0xbe, 0x58, 0x7d, 0x47, 0xa1, 0xfc, 0x8f, 0xf8, 0xb8, 0xd1, 0x7a, 0xd0, 0x31, 0xce, + 0x45, 0xcb, 0x3a, 0x8f, 0x95, 0x16, 0x04, 0x28, 0xaf, 0xd7, 0xfb, 0xca, 0xbb, 0x4b, 0x40, 0x7e, +}; + +static const xxh_u64 PRIME_MX1 = 0x165667919E3779F9ULL; /*!< 0b0001011001010110011001111001000110011110001101110111100111111001 */ +static const xxh_u64 PRIME_MX2 = 0x9FB21C651E98DF25ULL; /*!< 0b1001111110110010000111000110010100011110100110001101111100100101 */ + +#ifdef XXH_OLD_NAMES +# define kSecret XXH3_kSecret +#endif + +#ifdef XXH_DOXYGEN +/*! + * @brief Calculates a 32-bit to 64-bit long multiply. + * + * Implemented as a macro. + * + * Wraps `__emulu` on MSVC x86 because it tends to call `__allmul` when it doesn't + * need to (but it shouldn't need to anyways, it is about 7 instructions to do + * a 64x64 multiply...). Since we know that this will _always_ emit `MULL`, we + * use that instead of the normal method. + * + * If you are compiling for platforms like Thumb-1 and don't have a better option, + * you may also want to write your own long multiply routine here. + * + * @param x, y Numbers to be multiplied + * @return 64-bit product of the low 32 bits of @p x and @p y. + */ +XXH_FORCE_INLINE xxh_u64 +XXH_mult32to64(xxh_u64 x, xxh_u64 y) +{ + return (x & 0xFFFFFFFF) * (y & 0xFFFFFFFF); +} +#elif defined(_MSC_VER) && defined(_M_IX86) +# define XXH_mult32to64(x, y) __emulu((unsigned)(x), (unsigned)(y)) +#else +/* + * Downcast + upcast is usually better than masking on older compilers like + * GCC 4.2 (especially 32-bit ones), all without affecting newer compilers. + * + * The other method, (x & 0xFFFFFFFF) * (y & 0xFFFFFFFF), will AND both operands + * and perform a full 64x64 multiply -- entirely redundant on 32-bit. + */ +# define XXH_mult32to64(x, y) ((xxh_u64)(xxh_u32)(x) * (xxh_u64)(xxh_u32)(y)) +#endif + +/*! + * @brief Calculates a 64->128-bit long multiply. + * + * Uses `__uint128_t` and `_umul128` if available, otherwise uses a scalar + * version. + * + * @param lhs , rhs The 64-bit integers to be multiplied + * @return The 128-bit result represented in an @ref XXH128_hash_t. + */ +static XXH128_hash_t +XXH_mult64to128(xxh_u64 lhs, xxh_u64 rhs) +{ + /* + * GCC/Clang __uint128_t method. + * + * On most 64-bit targets, GCC and Clang define a __uint128_t type. + * This is usually the best way as it usually uses a native long 64-bit + * multiply, such as MULQ on x86_64 or MUL + UMULH on aarch64. + * + * Usually. + * + * Despite being a 32-bit platform, Clang (and emscripten) define this type + * despite not having the arithmetic for it. This results in a laggy + * compiler builtin call which calculates a full 128-bit multiply. + * In that case it is best to use the portable one. + * https://github.com/Cyan4973/xxHash/issues/211#issuecomment-515575677 + */ +#if (defined(__GNUC__) || defined(__clang__)) && !defined(__wasm__) \ + && defined(__SIZEOF_INT128__) \ + || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 128) + + __uint128_t const product = (__uint128_t)lhs * (__uint128_t)rhs; + XXH128_hash_t r128; + r128.low64 = (xxh_u64)(product); + r128.high64 = (xxh_u64)(product >> 64); + return r128; + + /* + * MSVC for x64's _umul128 method. + * + * xxh_u64 _umul128(xxh_u64 Multiplier, xxh_u64 Multiplicand, xxh_u64 *HighProduct); + * + * This compiles to single operand MUL on x64. + */ +#elif (defined(_M_X64) || defined(_M_IA64)) && !defined(_M_ARM64EC) + +#ifndef _MSC_VER +# pragma intrinsic(_umul128) +#endif + xxh_u64 product_high; + xxh_u64 const product_low = _umul128(lhs, rhs, &product_high); + XXH128_hash_t r128; + r128.low64 = product_low; + r128.high64 = product_high; + return r128; + + /* + * MSVC for ARM64's __umulh method. + * + * This compiles to the same MUL + UMULH as GCC/Clang's __uint128_t method. + */ +#elif defined(_M_ARM64) || defined(_M_ARM64EC) + +#ifndef _MSC_VER +# pragma intrinsic(__umulh) +#endif + XXH128_hash_t r128; + r128.low64 = lhs * rhs; + r128.high64 = __umulh(lhs, rhs); + return r128; + +#else + /* + * Portable scalar method. Optimized for 32-bit and 64-bit ALUs. + * + * This is a fast and simple grade school multiply, which is shown below + * with base 10 arithmetic instead of base 0x100000000. + * + * 9 3 // D2 lhs = 93 + * x 7 5 // D2 rhs = 75 + * ---------- + * 1 5 // D2 lo_lo = (93 % 10) * (75 % 10) = 15 + * 4 5 | // D2 hi_lo = (93 / 10) * (75 % 10) = 45 + * 2 1 | // D2 lo_hi = (93 % 10) * (75 / 10) = 21 + * + 6 3 | | // D2 hi_hi = (93 / 10) * (75 / 10) = 63 + * --------- + * 2 7 | // D2 cross = (15 / 10) + (45 % 10) + 21 = 27 + * + 6 7 | | // D2 upper = (27 / 10) + (45 / 10) + 63 = 67 + * --------- + * 6 9 7 5 // D4 res = (27 * 10) + (15 % 10) + (67 * 100) = 6975 + * + * The reasons for adding the products like this are: + * 1. It avoids manual carry tracking. Just like how + * (9 * 9) + 9 + 9 = 99, the same applies with this for UINT64_MAX. + * This avoids a lot of complexity. + * + * 2. It hints for, and on Clang, compiles to, the powerful UMAAL + * instruction available in ARM's Digital Signal Processing extension + * in 32-bit ARMv6 and later, which is shown below: + * + * void UMAAL(xxh_u32 *RdLo, xxh_u32 *RdHi, xxh_u32 Rn, xxh_u32 Rm) + * { + * xxh_u64 product = (xxh_u64)*RdLo * (xxh_u64)*RdHi + Rn + Rm; + * *RdLo = (xxh_u32)(product & 0xFFFFFFFF); + * *RdHi = (xxh_u32)(product >> 32); + * } + * + * This instruction was designed for efficient long multiplication, and + * allows this to be calculated in only 4 instructions at speeds + * comparable to some 64-bit ALUs. + * + * 3. It isn't terrible on other platforms. Usually this will be a couple + * of 32-bit ADD/ADCs. + */ + + /* First calculate all of the cross products. */ + xxh_u64 const lo_lo = XXH_mult32to64(lhs & 0xFFFFFFFF, rhs & 0xFFFFFFFF); + xxh_u64 const hi_lo = XXH_mult32to64(lhs >> 32, rhs & 0xFFFFFFFF); + xxh_u64 const lo_hi = XXH_mult32to64(lhs & 0xFFFFFFFF, rhs >> 32); + xxh_u64 const hi_hi = XXH_mult32to64(lhs >> 32, rhs >> 32); + + /* Now add the products together. These will never overflow. */ + xxh_u64 const cross = (lo_lo >> 32) + (hi_lo & 0xFFFFFFFF) + lo_hi; + xxh_u64 const upper = (hi_lo >> 32) + (cross >> 32) + hi_hi; + xxh_u64 const lower = (cross << 32) | (lo_lo & 0xFFFFFFFF); + + XXH128_hash_t r128; + r128.low64 = lower; + r128.high64 = upper; + return r128; +#endif +} + +/*! + * @brief Calculates a 64-bit to 128-bit multiply, then XOR folds it. + * + * The reason for the separate function is to prevent passing too many structs + * around by value. This will hopefully inline the multiply, but we don't force it. + * + * @param lhs , rhs The 64-bit integers to multiply + * @return The low 64 bits of the product XOR'd by the high 64 bits. + * @see XXH_mult64to128() + */ +static xxh_u64 +XXH3_mul128_fold64(xxh_u64 lhs, xxh_u64 rhs) +{ + XXH128_hash_t product = XXH_mult64to128(lhs, rhs); + return product.low64 ^ product.high64; +} + +/*! Seems to produce slightly better code on GCC for some reason. */ +XXH_FORCE_INLINE XXH_CONSTF xxh_u64 XXH_xorshift64(xxh_u64 v64, int shift) +{ + XXH_ASSERT(0 <= shift && shift < 64); + return v64 ^ (v64 >> shift); +} + +/* + * This is a fast avalanche stage, + * suitable when input bits are already partially mixed + */ +static XXH64_hash_t XXH3_avalanche(xxh_u64 h64) +{ + h64 = XXH_xorshift64(h64, 37); + h64 *= PRIME_MX1; + h64 = XXH_xorshift64(h64, 32); + return h64; +} + +/* + * This is a stronger avalanche, + * inspired by Pelle Evensen's rrmxmx + * preferable when input has not been previously mixed + */ +static XXH64_hash_t XXH3_rrmxmx(xxh_u64 h64, xxh_u64 len) +{ + /* this mix is inspired by Pelle Evensen's rrmxmx */ + h64 ^= XXH_rotl64(h64, 49) ^ XXH_rotl64(h64, 24); + h64 *= PRIME_MX2; + h64 ^= (h64 >> 35) + len ; + h64 *= PRIME_MX2; + return XXH_xorshift64(h64, 28); +} + + +/* ========================================== + * Short keys + * ========================================== + * One of the shortcomings of XXH32 and XXH64 was that their performance was + * sub-optimal on short lengths. It used an iterative algorithm which strongly + * favored lengths that were a multiple of 4 or 8. + * + * Instead of iterating over individual inputs, we use a set of single shot + * functions which piece together a range of lengths and operate in constant time. + * + * Additionally, the number of multiplies has been significantly reduced. This + * reduces latency, especially when emulating 64-bit multiplies on 32-bit. + * + * Depending on the platform, this may or may not be faster than XXH32, but it + * is almost guaranteed to be faster than XXH64. + */ + +/* + * At very short lengths, there isn't enough input to fully hide secrets, or use + * the entire secret. + * + * There is also only a limited amount of mixing we can do before significantly + * impacting performance. + * + * Therefore, we use different sections of the secret and always mix two secret + * samples with an XOR. This should have no effect on performance on the + * seedless or withSeed variants because everything _should_ be constant folded + * by modern compilers. + * + * The XOR mixing hides individual parts of the secret and increases entropy. + * + * This adds an extra layer of strength for custom secrets. + */ +XXH_FORCE_INLINE XXH_PUREF XXH64_hash_t +XXH3_len_1to3_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed) +{ + XXH_ASSERT(input != NULL); + XXH_ASSERT(1 <= len && len <= 3); + XXH_ASSERT(secret != NULL); + /* + * len = 1: combined = { input[0], 0x01, input[0], input[0] } + * len = 2: combined = { input[1], 0x02, input[0], input[1] } + * len = 3: combined = { input[2], 0x03, input[0], input[1] } + */ + { xxh_u8 const c1 = input[0]; + xxh_u8 const c2 = input[len >> 1]; + xxh_u8 const c3 = input[len - 1]; + xxh_u32 const combined = ((xxh_u32)c1 << 16) | ((xxh_u32)c2 << 24) + | ((xxh_u32)c3 << 0) | ((xxh_u32)len << 8); + xxh_u64 const bitflip = (XXH_readLE32(secret) ^ XXH_readLE32(secret+4)) + seed; + xxh_u64 const keyed = (xxh_u64)combined ^ bitflip; + return XXH64_avalanche(keyed); + } +} + +XXH_FORCE_INLINE XXH_PUREF XXH64_hash_t +XXH3_len_4to8_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed) +{ + XXH_ASSERT(input != NULL); + XXH_ASSERT(secret != NULL); + XXH_ASSERT(4 <= len && len <= 8); + seed ^= (xxh_u64)XXH_swap32((xxh_u32)seed) << 32; + { xxh_u32 const input1 = XXH_readLE32(input); + xxh_u32 const input2 = XXH_readLE32(input + len - 4); + xxh_u64 const bitflip = (XXH_readLE64(secret+8) ^ XXH_readLE64(secret+16)) - seed; + xxh_u64 const input64 = input2 + (((xxh_u64)input1) << 32); + xxh_u64 const keyed = input64 ^ bitflip; + return XXH3_rrmxmx(keyed, len); + } +} + +XXH_FORCE_INLINE XXH_PUREF XXH64_hash_t +XXH3_len_9to16_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed) +{ + XXH_ASSERT(input != NULL); + XXH_ASSERT(secret != NULL); + XXH_ASSERT(9 <= len && len <= 16); + { xxh_u64 const bitflip1 = (XXH_readLE64(secret+24) ^ XXH_readLE64(secret+32)) + seed; + xxh_u64 const bitflip2 = (XXH_readLE64(secret+40) ^ XXH_readLE64(secret+48)) - seed; + xxh_u64 const input_lo = XXH_readLE64(input) ^ bitflip1; + xxh_u64 const input_hi = XXH_readLE64(input + len - 8) ^ bitflip2; + xxh_u64 const acc = len + + XXH_swap64(input_lo) + input_hi + + XXH3_mul128_fold64(input_lo, input_hi); + return XXH3_avalanche(acc); + } +} + +XXH_FORCE_INLINE XXH_PUREF XXH64_hash_t +XXH3_len_0to16_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed) +{ + XXH_ASSERT(len <= 16); + { if (XXH_likely(len > 8)) return XXH3_len_9to16_64b(input, len, secret, seed); + if (XXH_likely(len >= 4)) return XXH3_len_4to8_64b(input, len, secret, seed); + if (len) return XXH3_len_1to3_64b(input, len, secret, seed); + return XXH64_avalanche(seed ^ (XXH_readLE64(secret+56) ^ XXH_readLE64(secret+64))); + } +} + +/* + * DISCLAIMER: There are known *seed-dependent* multicollisions here due to + * multiplication by zero, affecting hashes of lengths 17 to 240. + * + * However, they are very unlikely. + * + * Keep this in mind when using the unseeded XXH3_64bits() variant: As with all + * unseeded non-cryptographic hashes, it does not attempt to defend itself + * against specially crafted inputs, only random inputs. + * + * Compared to classic UMAC where a 1 in 2^31 chance of 4 consecutive bytes + * cancelling out the secret is taken an arbitrary number of times (addressed + * in XXH3_accumulate_512), this collision is very unlikely with random inputs + * and/or proper seeding: + * + * This only has a 1 in 2^63 chance of 8 consecutive bytes cancelling out, in a + * function that is only called up to 16 times per hash with up to 240 bytes of + * input. + * + * This is not too bad for a non-cryptographic hash function, especially with + * only 64 bit outputs. + * + * The 128-bit variant (which trades some speed for strength) is NOT affected + * by this, although it is always a good idea to use a proper seed if you care + * about strength. + */ +XXH_FORCE_INLINE xxh_u64 XXH3_mix16B(const xxh_u8* XXH_RESTRICT input, + const xxh_u8* XXH_RESTRICT secret, xxh_u64 seed64) +{ +#if defined(__GNUC__) && !defined(__clang__) /* GCC, not Clang */ \ + && defined(__i386__) && defined(__SSE2__) /* x86 + SSE2 */ \ + && !defined(XXH_ENABLE_AUTOVECTORIZE) /* Define to disable like XXH32 hack */ + /* + * UGLY HACK: + * GCC for x86 tends to autovectorize the 128-bit multiply, resulting in + * slower code. + * + * By forcing seed64 into a register, we disrupt the cost model and + * cause it to scalarize. See `XXH32_round()` + * + * FIXME: Clang's output is still _much_ faster -- On an AMD Ryzen 3600, + * XXH3_64bits @ len=240 runs at 4.6 GB/s with Clang 9, but 3.3 GB/s on + * GCC 9.2, despite both emitting scalar code. + * + * GCC generates much better scalar code than Clang for the rest of XXH3, + * which is why finding a more optimal codepath is an interest. + */ + XXH_COMPILER_GUARD(seed64); +#endif + { xxh_u64 const input_lo = XXH_readLE64(input); + xxh_u64 const input_hi = XXH_readLE64(input+8); + return XXH3_mul128_fold64( + input_lo ^ (XXH_readLE64(secret) + seed64), + input_hi ^ (XXH_readLE64(secret+8) - seed64) + ); + } +} + +/* For mid range keys, XXH3 uses a Mum-hash variant. */ +XXH_FORCE_INLINE XXH_PUREF XXH64_hash_t +XXH3_len_17to128_64b(const xxh_u8* XXH_RESTRICT input, size_t len, + const xxh_u8* XXH_RESTRICT secret, size_t secretSize, + XXH64_hash_t seed) +{ + XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); (void)secretSize; + XXH_ASSERT(16 < len && len <= 128); + + { xxh_u64 acc = len * XXH_PRIME64_1; +#if XXH_SIZE_OPT >= 1 + /* Smaller and cleaner, but slightly slower. */ + unsigned int i = (unsigned int)(len - 1) / 32; + do { + acc += XXH3_mix16B(input+16 * i, secret+32*i, seed); + acc += XXH3_mix16B(input+len-16*(i+1), secret+32*i+16, seed); + } while (i-- != 0); +#else + if (len > 32) { + if (len > 64) { + if (len > 96) { + acc += XXH3_mix16B(input+48, secret+96, seed); + acc += XXH3_mix16B(input+len-64, secret+112, seed); + } + acc += XXH3_mix16B(input+32, secret+64, seed); + acc += XXH3_mix16B(input+len-48, secret+80, seed); + } + acc += XXH3_mix16B(input+16, secret+32, seed); + acc += XXH3_mix16B(input+len-32, secret+48, seed); + } + acc += XXH3_mix16B(input+0, secret+0, seed); + acc += XXH3_mix16B(input+len-16, secret+16, seed); +#endif + return XXH3_avalanche(acc); + } +} + +/*! + * @brief Maximum size of "short" key in bytes. + */ +#define XXH3_MIDSIZE_MAX 240 + +XXH_NO_INLINE XXH_PUREF XXH64_hash_t +XXH3_len_129to240_64b(const xxh_u8* XXH_RESTRICT input, size_t len, + const xxh_u8* XXH_RESTRICT secret, size_t secretSize, + XXH64_hash_t seed) +{ + XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); (void)secretSize; + XXH_ASSERT(128 < len && len <= XXH3_MIDSIZE_MAX); + + #define XXH3_MIDSIZE_STARTOFFSET 3 + #define XXH3_MIDSIZE_LASTOFFSET 17 + + { xxh_u64 acc = len * XXH_PRIME64_1; + xxh_u64 acc_end; + unsigned int const nbRounds = (unsigned int)len / 16; + unsigned int i; + XXH_ASSERT(128 < len && len <= XXH3_MIDSIZE_MAX); + for (i=0; i<8; i++) { + acc += XXH3_mix16B(input+(16*i), secret+(16*i), seed); + } + /* last bytes */ + acc_end = XXH3_mix16B(input + len - 16, secret + XXH3_SECRET_SIZE_MIN - XXH3_MIDSIZE_LASTOFFSET, seed); + XXH_ASSERT(nbRounds >= 8); + acc = XXH3_avalanche(acc); +#if defined(__clang__) /* Clang */ \ + && (defined(__ARM_NEON) || defined(__ARM_NEON__)) /* NEON */ \ + && !defined(XXH_ENABLE_AUTOVECTORIZE) /* Define to disable */ + /* + * UGLY HACK: + * Clang for ARMv7-A tries to vectorize this loop, similar to GCC x86. + * In everywhere else, it uses scalar code. + * + * For 64->128-bit multiplies, even if the NEON was 100% optimal, it + * would still be slower than UMAAL (see XXH_mult64to128). + * + * Unfortunately, Clang doesn't handle the long multiplies properly and + * converts them to the nonexistent "vmulq_u64" intrinsic, which is then + * scalarized into an ugly mess of VMOV.32 instructions. + * + * This mess is difficult to avoid without turning autovectorization + * off completely, but they are usually relatively minor and/or not + * worth it to fix. + * + * This loop is the easiest to fix, as unlike XXH32, this pragma + * _actually works_ because it is a loop vectorization instead of an + * SLP vectorization. + */ + #pragma clang loop vectorize(disable) +#endif + for (i=8 ; i < nbRounds; i++) { + /* + * Prevents clang for unrolling the acc loop and interleaving with this one. + */ + XXH_COMPILER_GUARD(acc); + acc_end += XXH3_mix16B(input+(16*i), secret+(16*(i-8)) + XXH3_MIDSIZE_STARTOFFSET, seed); + } + return XXH3_avalanche(acc + acc_end); + } +} + + +/* ======= Long Keys ======= */ + +#define XXH_STRIPE_LEN 64 +#define XXH_SECRET_CONSUME_RATE 8 /* nb of secret bytes consumed at each accumulation */ +#define XXH_ACC_NB (XXH_STRIPE_LEN / sizeof(xxh_u64)) + +#ifdef XXH_OLD_NAMES +# define STRIPE_LEN XXH_STRIPE_LEN +# define ACC_NB XXH_ACC_NB +#endif + +#ifndef XXH_PREFETCH_DIST +# ifdef __clang__ +# define XXH_PREFETCH_DIST 320 +# else +# if (XXH_VECTOR == XXH_AVX512) +# define XXH_PREFETCH_DIST 512 +# else +# define XXH_PREFETCH_DIST 384 +# endif +# endif /* __clang__ */ +#endif /* XXH_PREFETCH_DIST */ + +/* + * These macros are to generate an XXH3_accumulate() function. + * The two arguments select the name suffix and target attribute. + * + * The name of this symbol is XXH3_accumulate_<name>() and it calls + * XXH3_accumulate_512_<name>(). + * + * It may be useful to hand implement this function if the compiler fails to + * optimize the inline function. + */ +#define XXH3_ACCUMULATE_TEMPLATE(name) \ +void \ +XXH3_accumulate_##name(xxh_u64* XXH_RESTRICT acc, \ + const xxh_u8* XXH_RESTRICT input, \ + const xxh_u8* XXH_RESTRICT secret, \ + size_t nbStripes) \ +{ \ + size_t n; \ + for (n = 0; n < nbStripes; n++ ) { \ + const xxh_u8* const in = input + n*XXH_STRIPE_LEN; \ + XXH_PREFETCH(in + XXH_PREFETCH_DIST); \ + XXH3_accumulate_512_##name( \ + acc, \ + in, \ + secret + n*XXH_SECRET_CONSUME_RATE); \ + } \ +} + + +XXH_FORCE_INLINE void XXH_writeLE64(void* dst, xxh_u64 v64) +{ + if (!XXH_CPU_LITTLE_ENDIAN) v64 = XXH_swap64(v64); + XXH_memcpy(dst, &v64, sizeof(v64)); +} + +/* Several intrinsic functions below are supposed to accept __int64 as argument, + * as documented in https://software.intel.com/sites/landingpage/IntrinsicsGuide/ . + * However, several environments do not define __int64 type, + * requiring a workaround. + */ +#if !defined (__VMS) \ + && (defined (__cplusplus) \ + || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) ) + typedef int64_t xxh_i64; +#else + /* the following type must have a width of 64-bit */ + typedef long long xxh_i64; +#endif + + +/* + * XXH3_accumulate_512 is the tightest loop for long inputs, and it is the most optimized. + * + * It is a hardened version of UMAC, based off of FARSH's implementation. + * + * This was chosen because it adapts quite well to 32-bit, 64-bit, and SIMD + * implementations, and it is ridiculously fast. + * + * We harden it by mixing the original input to the accumulators as well as the product. + * + * This means that in the (relatively likely) case of a multiply by zero, the + * original input is preserved. + * + * On 128-bit inputs, we swap 64-bit pairs when we add the input to improve + * cross-pollination, as otherwise the upper and lower halves would be + * essentially independent. + * + * This doesn't matter on 64-bit hashes since they all get merged together in + * the end, so we skip the extra step. + * + * Both XXH3_64bits and XXH3_128bits use this subroutine. + */ + +#if (XXH_VECTOR == XXH_AVX512) \ + || (defined(XXH_DISPATCH_AVX512) && XXH_DISPATCH_AVX512 != 0) + +#ifndef XXH_TARGET_AVX512 +# define XXH_TARGET_AVX512 /* disable attribute target */ +#endif + +XXH_FORCE_INLINE XXH_TARGET_AVX512 void +XXH3_accumulate_512_avx512(void* XXH_RESTRICT acc, + const void* XXH_RESTRICT input, + const void* XXH_RESTRICT secret) +{ + __m512i* const xacc = (__m512i *) acc; + XXH_ASSERT((((size_t)acc) & 63) == 0); + XXH_STATIC_ASSERT(XXH_STRIPE_LEN == sizeof(__m512i)); + + { + /* data_vec = input[0]; */ + __m512i const data_vec = _mm512_loadu_si512 (input); + /* key_vec = secret[0]; */ + __m512i const key_vec = _mm512_loadu_si512 (secret); + /* data_key = data_vec ^ key_vec; */ + __m512i const data_key = _mm512_xor_si512 (data_vec, key_vec); + /* data_key_lo = data_key >> 32; */ + __m512i const data_key_lo = _mm512_srli_epi64 (data_key, 32); + /* product = (data_key & 0xffffffff) * (data_key_lo & 0xffffffff); */ + __m512i const product = _mm512_mul_epu32 (data_key, data_key_lo); + /* xacc[0] += swap(data_vec); */ + __m512i const data_swap = _mm512_shuffle_epi32(data_vec, (_MM_PERM_ENUM)_MM_SHUFFLE(1, 0, 3, 2)); + __m512i const sum = _mm512_add_epi64(*xacc, data_swap); + /* xacc[0] += product; */ + *xacc = _mm512_add_epi64(product, sum); + } +} +XXH_FORCE_INLINE XXH_TARGET_AVX512 XXH3_ACCUMULATE_TEMPLATE(avx512) + +/* + * XXH3_scrambleAcc: Scrambles the accumulators to improve mixing. + * + * Multiplication isn't perfect, as explained by Google in HighwayHash: + * + * // Multiplication mixes/scrambles bytes 0-7 of the 64-bit result to + * // varying degrees. In descending order of goodness, bytes + * // 3 4 2 5 1 6 0 7 have quality 228 224 164 160 100 96 36 32. + * // As expected, the upper and lower bytes are much worse. + * + * Source: https://github.com/google/highwayhash/blob/0aaf66b/highwayhash/hh_avx2.h#L291 + * + * Since our algorithm uses a pseudorandom secret to add some variance into the + * mix, we don't need to (or want to) mix as often or as much as HighwayHash does. + * + * This isn't as tight as XXH3_accumulate, but still written in SIMD to avoid + * extraction. + * + * Both XXH3_64bits and XXH3_128bits use this subroutine. + */ + +XXH_FORCE_INLINE XXH_TARGET_AVX512 void +XXH3_scrambleAcc_avx512(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) +{ + XXH_ASSERT((((size_t)acc) & 63) == 0); + XXH_STATIC_ASSERT(XXH_STRIPE_LEN == sizeof(__m512i)); + { __m512i* const xacc = (__m512i*) acc; + const __m512i prime32 = _mm512_set1_epi32((int)XXH_PRIME32_1); + + /* xacc[0] ^= (xacc[0] >> 47) */ + __m512i const acc_vec = *xacc; + __m512i const shifted = _mm512_srli_epi64 (acc_vec, 47); + /* xacc[0] ^= secret; */ + __m512i const key_vec = _mm512_loadu_si512 (secret); + __m512i const data_key = _mm512_ternarylogic_epi32(key_vec, acc_vec, shifted, 0x96 /* key_vec ^ acc_vec ^ shifted */); + + /* xacc[0] *= XXH_PRIME32_1; */ + __m512i const data_key_hi = _mm512_srli_epi64 (data_key, 32); + __m512i const prod_lo = _mm512_mul_epu32 (data_key, prime32); + __m512i const prod_hi = _mm512_mul_epu32 (data_key_hi, prime32); + *xacc = _mm512_add_epi64(prod_lo, _mm512_slli_epi64(prod_hi, 32)); + } +} + +XXH_FORCE_INLINE XXH_TARGET_AVX512 void +XXH3_initCustomSecret_avx512(void* XXH_RESTRICT customSecret, xxh_u64 seed64) +{ + XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE & 63) == 0); + XXH_STATIC_ASSERT(XXH_SEC_ALIGN == 64); + XXH_ASSERT(((size_t)customSecret & 63) == 0); + (void)(&XXH_writeLE64); + { int const nbRounds = XXH_SECRET_DEFAULT_SIZE / sizeof(__m512i); + __m512i const seed_pos = _mm512_set1_epi64((xxh_i64)seed64); + __m512i const seed = _mm512_mask_sub_epi64(seed_pos, 0xAA, _mm512_set1_epi8(0), seed_pos); + + const __m512i* const src = (const __m512i*) ((const void*) XXH3_kSecret); + __m512i* const dest = ( __m512i*) customSecret; + int i; + XXH_ASSERT(((size_t)src & 63) == 0); /* control alignment */ + XXH_ASSERT(((size_t)dest & 63) == 0); + for (i=0; i < nbRounds; ++i) { + dest[i] = _mm512_add_epi64(_mm512_load_si512(src + i), seed); + } } +} + +#endif + +#if (XXH_VECTOR == XXH_AVX2) \ + || (defined(XXH_DISPATCH_AVX2) && XXH_DISPATCH_AVX2 != 0) + +#ifndef XXH_TARGET_AVX2 +# define XXH_TARGET_AVX2 /* disable attribute target */ +#endif + +XXH_FORCE_INLINE XXH_TARGET_AVX2 void +XXH3_accumulate_512_avx2( void* XXH_RESTRICT acc, + const void* XXH_RESTRICT input, + const void* XXH_RESTRICT secret) +{ + XXH_ASSERT((((size_t)acc) & 31) == 0); + { __m256i* const xacc = (__m256i *) acc; + /* Unaligned. This is mainly for pointer arithmetic, and because + * _mm256_loadu_si256 requires a const __m256i * pointer for some reason. */ + const __m256i* const xinput = (const __m256i *) input; + /* Unaligned. This is mainly for pointer arithmetic, and because + * _mm256_loadu_si256 requires a const __m256i * pointer for some reason. */ + const __m256i* const xsecret = (const __m256i *) secret; + + size_t i; + for (i=0; i < XXH_STRIPE_LEN/sizeof(__m256i); i++) { + /* data_vec = xinput[i]; */ + __m256i const data_vec = _mm256_loadu_si256 (xinput+i); + /* key_vec = xsecret[i]; */ + __m256i const key_vec = _mm256_loadu_si256 (xsecret+i); + /* data_key = data_vec ^ key_vec; */ + __m256i const data_key = _mm256_xor_si256 (data_vec, key_vec); + /* data_key_lo = data_key >> 32; */ + __m256i const data_key_lo = _mm256_srli_epi64 (data_key, 32); + /* product = (data_key & 0xffffffff) * (data_key_lo & 0xffffffff); */ + __m256i const product = _mm256_mul_epu32 (data_key, data_key_lo); + /* xacc[i] += swap(data_vec); */ + __m256i const data_swap = _mm256_shuffle_epi32(data_vec, _MM_SHUFFLE(1, 0, 3, 2)); + __m256i const sum = _mm256_add_epi64(xacc[i], data_swap); + /* xacc[i] += product; */ + xacc[i] = _mm256_add_epi64(product, sum); + } } +} +XXH_FORCE_INLINE XXH_TARGET_AVX2 XXH3_ACCUMULATE_TEMPLATE(avx2) + +XXH_FORCE_INLINE XXH_TARGET_AVX2 void +XXH3_scrambleAcc_avx2(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) +{ + XXH_ASSERT((((size_t)acc) & 31) == 0); + { __m256i* const xacc = (__m256i*) acc; + /* Unaligned. This is mainly for pointer arithmetic, and because + * _mm256_loadu_si256 requires a const __m256i * pointer for some reason. */ + const __m256i* const xsecret = (const __m256i *) secret; + const __m256i prime32 = _mm256_set1_epi32((int)XXH_PRIME32_1); + + size_t i; + for (i=0; i < XXH_STRIPE_LEN/sizeof(__m256i); i++) { + /* xacc[i] ^= (xacc[i] >> 47) */ + __m256i const acc_vec = xacc[i]; + __m256i const shifted = _mm256_srli_epi64 (acc_vec, 47); + __m256i const data_vec = _mm256_xor_si256 (acc_vec, shifted); + /* xacc[i] ^= xsecret; */ + __m256i const key_vec = _mm256_loadu_si256 (xsecret+i); + __m256i const data_key = _mm256_xor_si256 (data_vec, key_vec); + + /* xacc[i] *= XXH_PRIME32_1; */ + __m256i const data_key_hi = _mm256_srli_epi64 (data_key, 32); + __m256i const prod_lo = _mm256_mul_epu32 (data_key, prime32); + __m256i const prod_hi = _mm256_mul_epu32 (data_key_hi, prime32); + xacc[i] = _mm256_add_epi64(prod_lo, _mm256_slli_epi64(prod_hi, 32)); + } + } +} + +XXH_FORCE_INLINE XXH_TARGET_AVX2 void XXH3_initCustomSecret_avx2(void* XXH_RESTRICT customSecret, xxh_u64 seed64) +{ + XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE & 31) == 0); + XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE / sizeof(__m256i)) == 6); + XXH_STATIC_ASSERT(XXH_SEC_ALIGN <= 64); + (void)(&XXH_writeLE64); + XXH_PREFETCH(customSecret); + { __m256i const seed = _mm256_set_epi64x((xxh_i64)(0U - seed64), (xxh_i64)seed64, (xxh_i64)(0U - seed64), (xxh_i64)seed64); + + const __m256i* const src = (const __m256i*) ((const void*) XXH3_kSecret); + __m256i* dest = ( __m256i*) customSecret; + +# if defined(__GNUC__) || defined(__clang__) + /* + * On GCC & Clang, marking 'dest' as modified will cause the compiler: + * - do not extract the secret from sse registers in the internal loop + * - use less common registers, and avoid pushing these reg into stack + */ + XXH_COMPILER_GUARD(dest); +# endif + XXH_ASSERT(((size_t)src & 31) == 0); /* control alignment */ + XXH_ASSERT(((size_t)dest & 31) == 0); + + /* GCC -O2 need unroll loop manually */ + dest[0] = _mm256_add_epi64(_mm256_load_si256(src+0), seed); + dest[1] = _mm256_add_epi64(_mm256_load_si256(src+1), seed); + dest[2] = _mm256_add_epi64(_mm256_load_si256(src+2), seed); + dest[3] = _mm256_add_epi64(_mm256_load_si256(src+3), seed); + dest[4] = _mm256_add_epi64(_mm256_load_si256(src+4), seed); + dest[5] = _mm256_add_epi64(_mm256_load_si256(src+5), seed); + } +} + +#endif + +/* x86dispatch always generates SSE2 */ +#if (XXH_VECTOR == XXH_SSE2) || defined(XXH_X86DISPATCH) + +#ifndef XXH_TARGET_SSE2 +# define XXH_TARGET_SSE2 /* disable attribute target */ +#endif + +XXH_FORCE_INLINE XXH_TARGET_SSE2 void +XXH3_accumulate_512_sse2( void* XXH_RESTRICT acc, + const void* XXH_RESTRICT input, + const void* XXH_RESTRICT secret) +{ + /* SSE2 is just a half-scale version of the AVX2 version. */ + XXH_ASSERT((((size_t)acc) & 15) == 0); + { __m128i* const xacc = (__m128i *) acc; + /* Unaligned. This is mainly for pointer arithmetic, and because + * _mm_loadu_si128 requires a const __m128i * pointer for some reason. */ + const __m128i* const xinput = (const __m128i *) input; + /* Unaligned. This is mainly for pointer arithmetic, and because + * _mm_loadu_si128 requires a const __m128i * pointer for some reason. */ + const __m128i* const xsecret = (const __m128i *) secret; + + size_t i; + for (i=0; i < XXH_STRIPE_LEN/sizeof(__m128i); i++) { + /* data_vec = xinput[i]; */ + __m128i const data_vec = _mm_loadu_si128 (xinput+i); + /* key_vec = xsecret[i]; */ + __m128i const key_vec = _mm_loadu_si128 (xsecret+i); + /* data_key = data_vec ^ key_vec; */ + __m128i const data_key = _mm_xor_si128 (data_vec, key_vec); + /* data_key_lo = data_key >> 32; */ + __m128i const data_key_lo = _mm_shuffle_epi32 (data_key, _MM_SHUFFLE(0, 3, 0, 1)); + /* product = (data_key & 0xffffffff) * (data_key_lo & 0xffffffff); */ + __m128i const product = _mm_mul_epu32 (data_key, data_key_lo); + /* xacc[i] += swap(data_vec); */ + __m128i const data_swap = _mm_shuffle_epi32(data_vec, _MM_SHUFFLE(1,0,3,2)); + __m128i const sum = _mm_add_epi64(xacc[i], data_swap); + /* xacc[i] += product; */ + xacc[i] = _mm_add_epi64(product, sum); + } } +} +XXH_FORCE_INLINE XXH_TARGET_SSE2 XXH3_ACCUMULATE_TEMPLATE(sse2) + +XXH_FORCE_INLINE XXH_TARGET_SSE2 void +XXH3_scrambleAcc_sse2(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) +{ + XXH_ASSERT((((size_t)acc) & 15) == 0); + { __m128i* const xacc = (__m128i*) acc; + /* Unaligned. This is mainly for pointer arithmetic, and because + * _mm_loadu_si128 requires a const __m128i * pointer for some reason. */ + const __m128i* const xsecret = (const __m128i *) secret; + const __m128i prime32 = _mm_set1_epi32((int)XXH_PRIME32_1); + + size_t i; + for (i=0; i < XXH_STRIPE_LEN/sizeof(__m128i); i++) { + /* xacc[i] ^= (xacc[i] >> 47) */ + __m128i const acc_vec = xacc[i]; + __m128i const shifted = _mm_srli_epi64 (acc_vec, 47); + __m128i const data_vec = _mm_xor_si128 (acc_vec, shifted); + /* xacc[i] ^= xsecret[i]; */ + __m128i const key_vec = _mm_loadu_si128 (xsecret+i); + __m128i const data_key = _mm_xor_si128 (data_vec, key_vec); + + /* xacc[i] *= XXH_PRIME32_1; */ + __m128i const data_key_hi = _mm_shuffle_epi32 (data_key, _MM_SHUFFLE(0, 3, 0, 1)); + __m128i const prod_lo = _mm_mul_epu32 (data_key, prime32); + __m128i const prod_hi = _mm_mul_epu32 (data_key_hi, prime32); + xacc[i] = _mm_add_epi64(prod_lo, _mm_slli_epi64(prod_hi, 32)); + } + } +} + +XXH_FORCE_INLINE XXH_TARGET_SSE2 void XXH3_initCustomSecret_sse2(void* XXH_RESTRICT customSecret, xxh_u64 seed64) +{ + XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE & 15) == 0); + (void)(&XXH_writeLE64); + { int const nbRounds = XXH_SECRET_DEFAULT_SIZE / sizeof(__m128i); + +# if defined(_MSC_VER) && defined(_M_IX86) && _MSC_VER < 1900 + /* MSVC 32bit mode does not support _mm_set_epi64x before 2015 */ + XXH_ALIGN(16) const xxh_i64 seed64x2[2] = { (xxh_i64)seed64, (xxh_i64)(0U - seed64) }; + __m128i const seed = _mm_load_si128((__m128i const*)seed64x2); +# else + __m128i const seed = _mm_set_epi64x((xxh_i64)(0U - seed64), (xxh_i64)seed64); +# endif + int i; + + const void* const src16 = XXH3_kSecret; + __m128i* dst16 = (__m128i*) customSecret; +# if defined(__GNUC__) || defined(__clang__) + /* + * On GCC & Clang, marking 'dest' as modified will cause the compiler: + * - do not extract the secret from sse registers in the internal loop + * - use less common registers, and avoid pushing these reg into stack + */ + XXH_COMPILER_GUARD(dst16); +# endif + XXH_ASSERT(((size_t)src16 & 15) == 0); /* control alignment */ + XXH_ASSERT(((size_t)dst16 & 15) == 0); + + for (i=0; i < nbRounds; ++i) { + dst16[i] = _mm_add_epi64(_mm_load_si128((const __m128i *)src16+i), seed); + } } +} + +#endif + +#if (XXH_VECTOR == XXH_NEON) + +/* forward declarations for the scalar routines */ +XXH_FORCE_INLINE void +XXH3_scalarRound(void* XXH_RESTRICT acc, void const* XXH_RESTRICT input, + void const* XXH_RESTRICT secret, size_t lane); + +XXH_FORCE_INLINE void +XXH3_scalarScrambleRound(void* XXH_RESTRICT acc, + void const* XXH_RESTRICT secret, size_t lane); + +/*! + * @internal + * @brief The bulk processing loop for NEON and WASM SIMD128. + * + * The NEON code path is actually partially scalar when running on AArch64. This + * is to optimize the pipelining and can have up to 15% speedup depending on the + * CPU, and it also mitigates some GCC codegen issues. + * + * @see XXH3_NEON_LANES for configuring this and details about this optimization. + * + * NEON's 32-bit to 64-bit long multiply takes a half vector of 32-bit + * integers instead of the other platforms which mask full 64-bit vectors, + * so the setup is more complicated than just shifting right. + * + * Additionally, there is an optimization for 4 lanes at once noted below. + * + * Since, as stated, the most optimal amount of lanes for Cortexes is 6, + * there needs to be *three* versions of the accumulate operation used + * for the remaining 2 lanes. + * + * WASM's SIMD128 uses SIMDe's arm_neon.h polyfill because the intrinsics overlap + * nearly perfectly. + */ + +XXH_FORCE_INLINE void +XXH3_accumulate_512_neon( void* XXH_RESTRICT acc, + const void* XXH_RESTRICT input, + const void* XXH_RESTRICT secret) +{ + XXH_ASSERT((((size_t)acc) & 15) == 0); + XXH_STATIC_ASSERT(XXH3_NEON_LANES > 0 && XXH3_NEON_LANES <= XXH_ACC_NB && XXH3_NEON_LANES % 2 == 0); + { /* GCC for darwin arm64 does not like aliasing here */ + xxh_aliasing_uint64x2_t* const xacc = (xxh_aliasing_uint64x2_t*) acc; + /* We don't use a uint32x4_t pointer because it causes bus errors on ARMv7. */ + uint8_t const* xinput = (const uint8_t *) input; + uint8_t const* xsecret = (const uint8_t *) secret; + + size_t i; +#ifdef __wasm_simd128__ + /* + * On WASM SIMD128, Clang emits direct address loads when XXH3_kSecret + * is constant propagated, which results in it converting it to this + * inside the loop: + * + * a = v128.load(XXH3_kSecret + 0 + $secret_offset, offset = 0) + * b = v128.load(XXH3_kSecret + 16 + $secret_offset, offset = 0) + * ... + * + * This requires a full 32-bit address immediate (and therefore a 6 byte + * instruction) as well as an add for each offset. + * + * Putting an asm guard prevents it from folding (at the cost of losing + * the alignment hint), and uses the free offset in `v128.load` instead + * of adding secret_offset each time which overall reduces code size by + * about a kilobyte and improves performance. + */ + XXH_COMPILER_GUARD(xsecret); +#endif + /* Scalar lanes use the normal scalarRound routine */ + for (i = XXH3_NEON_LANES; i < XXH_ACC_NB; i++) { + XXH3_scalarRound(acc, input, secret, i); + } + i = 0; + /* 4 NEON lanes at a time. */ + for (; i+1 < XXH3_NEON_LANES / 2; i+=2) { + /* data_vec = xinput[i]; */ + uint64x2_t data_vec_1 = XXH_vld1q_u64(xinput + (i * 16)); + uint64x2_t data_vec_2 = XXH_vld1q_u64(xinput + ((i+1) * 16)); + /* key_vec = xsecret[i]; */ + uint64x2_t key_vec_1 = XXH_vld1q_u64(xsecret + (i * 16)); + uint64x2_t key_vec_2 = XXH_vld1q_u64(xsecret + ((i+1) * 16)); + /* data_swap = swap(data_vec) */ + uint64x2_t data_swap_1 = vextq_u64(data_vec_1, data_vec_1, 1); + uint64x2_t data_swap_2 = vextq_u64(data_vec_2, data_vec_2, 1); + /* data_key = data_vec ^ key_vec; */ + uint64x2_t data_key_1 = veorq_u64(data_vec_1, key_vec_1); + uint64x2_t data_key_2 = veorq_u64(data_vec_2, key_vec_2); + + /* + * If we reinterpret the 64x2 vectors as 32x4 vectors, we can use a + * de-interleave operation for 4 lanes in 1 step with `vuzpq_u32` to + * get one vector with the low 32 bits of each lane, and one vector + * with the high 32 bits of each lane. + * + * The intrinsic returns a double vector because the original ARMv7-a + * instruction modified both arguments in place. AArch64 and SIMD128 emit + * two instructions from this intrinsic. + * + * [ dk11L | dk11H | dk12L | dk12H ] -> [ dk11L | dk12L | dk21L | dk22L ] + * [ dk21L | dk21H | dk22L | dk22H ] -> [ dk11H | dk12H | dk21H | dk22H ] + */ + uint32x4x2_t unzipped = vuzpq_u32( + vreinterpretq_u32_u64(data_key_1), + vreinterpretq_u32_u64(data_key_2) + ); + /* data_key_lo = data_key & 0xFFFFFFFF */ + uint32x4_t data_key_lo = unzipped.val[0]; + /* data_key_hi = data_key >> 32 */ + uint32x4_t data_key_hi = unzipped.val[1]; + /* + * Then, we can split the vectors horizontally and multiply which, as for most + * widening intrinsics, have a variant that works on both high half vectors + * for free on AArch64. A similar instruction is available on SIMD128. + * + * sum = data_swap + (u64x2) data_key_lo * (u64x2) data_key_hi + */ + uint64x2_t sum_1 = XXH_vmlal_low_u32(data_swap_1, data_key_lo, data_key_hi); + uint64x2_t sum_2 = XXH_vmlal_high_u32(data_swap_2, data_key_lo, data_key_hi); + /* + * Clang reorders + * a += b * c; // umlal swap.2d, dkl.2s, dkh.2s + * c += a; // add acc.2d, acc.2d, swap.2d + * to + * c += a; // add acc.2d, acc.2d, swap.2d + * c += b * c; // umlal acc.2d, dkl.2s, dkh.2s + * + * While it would make sense in theory since the addition is faster, + * for reasons likely related to umlal being limited to certain NEON + * pipelines, this is worse. A compiler guard fixes this. + */ + XXH_COMPILER_GUARD_CLANG_NEON(sum_1); + XXH_COMPILER_GUARD_CLANG_NEON(sum_2); + /* xacc[i] = acc_vec + sum; */ + xacc[i] = vaddq_u64(xacc[i], sum_1); + xacc[i+1] = vaddq_u64(xacc[i+1], sum_2); + } + /* Operate on the remaining NEON lanes 2 at a time. */ + for (; i < XXH3_NEON_LANES / 2; i++) { + /* data_vec = xinput[i]; */ + uint64x2_t data_vec = XXH_vld1q_u64(xinput + (i * 16)); + /* key_vec = xsecret[i]; */ + uint64x2_t key_vec = XXH_vld1q_u64(xsecret + (i * 16)); + /* acc_vec_2 = swap(data_vec) */ + uint64x2_t data_swap = vextq_u64(data_vec, data_vec, 1); + /* data_key = data_vec ^ key_vec; */ + uint64x2_t data_key = veorq_u64(data_vec, key_vec); + /* For two lanes, just use VMOVN and VSHRN. */ + /* data_key_lo = data_key & 0xFFFFFFFF; */ + uint32x2_t data_key_lo = vmovn_u64(data_key); + /* data_key_hi = data_key >> 32; */ + uint32x2_t data_key_hi = vshrn_n_u64(data_key, 32); + /* sum = data_swap + (u64x2) data_key_lo * (u64x2) data_key_hi; */ + uint64x2_t sum = vmlal_u32(data_swap, data_key_lo, data_key_hi); + /* Same Clang workaround as before */ + XXH_COMPILER_GUARD_CLANG_NEON(sum); + /* xacc[i] = acc_vec + sum; */ + xacc[i] = vaddq_u64 (xacc[i], sum); + } + } +} +XXH_FORCE_INLINE XXH3_ACCUMULATE_TEMPLATE(neon) + +XXH_FORCE_INLINE void +XXH3_scrambleAcc_neon(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) +{ + XXH_ASSERT((((size_t)acc) & 15) == 0); + + { xxh_aliasing_uint64x2_t* xacc = (xxh_aliasing_uint64x2_t*) acc; + uint8_t const* xsecret = (uint8_t const*) secret; + + size_t i; + /* WASM uses operator overloads and doesn't need these. */ +#ifndef __wasm_simd128__ + /* { prime32_1, prime32_1 } */ + uint32x2_t const kPrimeLo = vdup_n_u32(XXH_PRIME32_1); + /* { 0, prime32_1, 0, prime32_1 } */ + uint32x4_t const kPrimeHi = vreinterpretq_u32_u64(vdupq_n_u64((xxh_u64)XXH_PRIME32_1 << 32)); +#endif + + /* AArch64 uses both scalar and neon at the same time */ + for (i = XXH3_NEON_LANES; i < XXH_ACC_NB; i++) { + XXH3_scalarScrambleRound(acc, secret, i); + } + for (i=0; i < XXH3_NEON_LANES / 2; i++) { + /* xacc[i] ^= (xacc[i] >> 47); */ + uint64x2_t acc_vec = xacc[i]; + uint64x2_t shifted = vshrq_n_u64(acc_vec, 47); + uint64x2_t data_vec = veorq_u64(acc_vec, shifted); + + /* xacc[i] ^= xsecret[i]; */ + uint64x2_t key_vec = XXH_vld1q_u64(xsecret + (i * 16)); + uint64x2_t data_key = veorq_u64(data_vec, key_vec); + /* xacc[i] *= XXH_PRIME32_1 */ +#ifdef __wasm_simd128__ + /* SIMD128 has multiply by u64x2, use it instead of expanding and scalarizing */ + xacc[i] = data_key * XXH_PRIME32_1; +#else + /* + * Expanded version with portable NEON intrinsics + * + * lo(x) * lo(y) + (hi(x) * lo(y) << 32) + * + * prod_hi = hi(data_key) * lo(prime) << 32 + * + * Since we only need 32 bits of this multiply a trick can be used, reinterpreting the vector + * as a uint32x4_t and multiplying by { 0, prime, 0, prime } to cancel out the unwanted bits + * and avoid the shift. + */ + uint32x4_t prod_hi = vmulq_u32 (vreinterpretq_u32_u64(data_key), kPrimeHi); + /* Extract low bits for vmlal_u32 */ + uint32x2_t data_key_lo = vmovn_u64(data_key); + /* xacc[i] = prod_hi + lo(data_key) * XXH_PRIME32_1; */ + xacc[i] = vmlal_u32(vreinterpretq_u64_u32(prod_hi), data_key_lo, kPrimeLo); +#endif + } + } +} +#endif + +#if (XXH_VECTOR == XXH_VSX) + +XXH_FORCE_INLINE void +XXH3_accumulate_512_vsx( void* XXH_RESTRICT acc, + const void* XXH_RESTRICT input, + const void* XXH_RESTRICT secret) +{ + /* presumed aligned */ + xxh_aliasing_u64x2* const xacc = (xxh_aliasing_u64x2*) acc; + xxh_u8 const* const xinput = (xxh_u8 const*) input; /* no alignment restriction */ + xxh_u8 const* const xsecret = (xxh_u8 const*) secret; /* no alignment restriction */ + xxh_u64x2 const v32 = { 32, 32 }; + size_t i; + for (i = 0; i < XXH_STRIPE_LEN / sizeof(xxh_u64x2); i++) { + /* data_vec = xinput[i]; */ + xxh_u64x2 const data_vec = XXH_vec_loadu(xinput + 16*i); + /* key_vec = xsecret[i]; */ + xxh_u64x2 const key_vec = XXH_vec_loadu(xsecret + 16*i); + xxh_u64x2 const data_key = data_vec ^ key_vec; + /* shuffled = (data_key << 32) | (data_key >> 32); */ + xxh_u32x4 const shuffled = (xxh_u32x4)vec_rl(data_key, v32); + /* product = ((xxh_u64x2)data_key & 0xFFFFFFFF) * ((xxh_u64x2)shuffled & 0xFFFFFFFF); */ + xxh_u64x2 const product = XXH_vec_mulo((xxh_u32x4)data_key, shuffled); + /* acc_vec = xacc[i]; */ + xxh_u64x2 acc_vec = xacc[i]; + acc_vec += product; + + /* swap high and low halves */ +#ifdef __s390x__ + acc_vec += vec_permi(data_vec, data_vec, 2); +#else + acc_vec += vec_xxpermdi(data_vec, data_vec, 2); +#endif + xacc[i] = acc_vec; + } +} +XXH_FORCE_INLINE XXH3_ACCUMULATE_TEMPLATE(vsx) + +XXH_FORCE_INLINE void +XXH3_scrambleAcc_vsx(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) +{ + XXH_ASSERT((((size_t)acc) & 15) == 0); + + { xxh_aliasing_u64x2* const xacc = (xxh_aliasing_u64x2*) acc; + const xxh_u8* const xsecret = (const xxh_u8*) secret; + /* constants */ + xxh_u64x2 const v32 = { 32, 32 }; + xxh_u64x2 const v47 = { 47, 47 }; + xxh_u32x4 const prime = { XXH_PRIME32_1, XXH_PRIME32_1, XXH_PRIME32_1, XXH_PRIME32_1 }; + size_t i; + for (i = 0; i < XXH_STRIPE_LEN / sizeof(xxh_u64x2); i++) { + /* xacc[i] ^= (xacc[i] >> 47); */ + xxh_u64x2 const acc_vec = xacc[i]; + xxh_u64x2 const data_vec = acc_vec ^ (acc_vec >> v47); + + /* xacc[i] ^= xsecret[i]; */ + xxh_u64x2 const key_vec = XXH_vec_loadu(xsecret + 16*i); + xxh_u64x2 const data_key = data_vec ^ key_vec; + + /* xacc[i] *= XXH_PRIME32_1 */ + /* prod_lo = ((xxh_u64x2)data_key & 0xFFFFFFFF) * ((xxh_u64x2)prime & 0xFFFFFFFF); */ + xxh_u64x2 const prod_even = XXH_vec_mule((xxh_u32x4)data_key, prime); + /* prod_hi = ((xxh_u64x2)data_key >> 32) * ((xxh_u64x2)prime >> 32); */ + xxh_u64x2 const prod_odd = XXH_vec_mulo((xxh_u32x4)data_key, prime); + xacc[i] = prod_odd + (prod_even << v32); + } } +} + +#endif + +#if (XXH_VECTOR == XXH_SVE) + +XXH_FORCE_INLINE void +XXH3_accumulate_512_sve( void* XXH_RESTRICT acc, + const void* XXH_RESTRICT input, + const void* XXH_RESTRICT secret) +{ + uint64_t *xacc = (uint64_t *)acc; + const uint64_t *xinput = (const uint64_t *)(const void *)input; + const uint64_t *xsecret = (const uint64_t *)(const void *)secret; + svuint64_t kSwap = sveor_n_u64_z(svptrue_b64(), svindex_u64(0, 1), 1); + uint64_t element_count = svcntd(); + if (element_count >= 8) { + svbool_t mask = svptrue_pat_b64(SV_VL8); + svuint64_t vacc = svld1_u64(mask, xacc); + ACCRND(vacc, 0); + svst1_u64(mask, xacc, vacc); + } else if (element_count == 2) { /* sve128 */ + svbool_t mask = svptrue_pat_b64(SV_VL2); + svuint64_t acc0 = svld1_u64(mask, xacc + 0); + svuint64_t acc1 = svld1_u64(mask, xacc + 2); + svuint64_t acc2 = svld1_u64(mask, xacc + 4); + svuint64_t acc3 = svld1_u64(mask, xacc + 6); + ACCRND(acc0, 0); + ACCRND(acc1, 2); + ACCRND(acc2, 4); + ACCRND(acc3, 6); + svst1_u64(mask, xacc + 0, acc0); + svst1_u64(mask, xacc + 2, acc1); + svst1_u64(mask, xacc + 4, acc2); + svst1_u64(mask, xacc + 6, acc3); + } else { + svbool_t mask = svptrue_pat_b64(SV_VL4); + svuint64_t acc0 = svld1_u64(mask, xacc + 0); + svuint64_t acc1 = svld1_u64(mask, xacc + 4); + ACCRND(acc0, 0); + ACCRND(acc1, 4); + svst1_u64(mask, xacc + 0, acc0); + svst1_u64(mask, xacc + 4, acc1); + } +} + +XXH_FORCE_INLINE void +XXH3_accumulate_sve(xxh_u64* XXH_RESTRICT acc, + const xxh_u8* XXH_RESTRICT input, + const xxh_u8* XXH_RESTRICT secret, + size_t nbStripes) +{ + if (nbStripes != 0) { + uint64_t *xacc = (uint64_t *)acc; + const uint64_t *xinput = (const uint64_t *)(const void *)input; + const uint64_t *xsecret = (const uint64_t *)(const void *)secret; + svuint64_t kSwap = sveor_n_u64_z(svptrue_b64(), svindex_u64(0, 1), 1); + uint64_t element_count = svcntd(); + if (element_count >= 8) { + svbool_t mask = svptrue_pat_b64(SV_VL8); + svuint64_t vacc = svld1_u64(mask, xacc + 0); + do { + /* svprfd(svbool_t, void *, enum svfprop); */ + svprfd(mask, xinput + 128, SV_PLDL1STRM); + ACCRND(vacc, 0); + xinput += 8; + xsecret += 1; + nbStripes--; + } while (nbStripes != 0); + + svst1_u64(mask, xacc + 0, vacc); + } else if (element_count == 2) { /* sve128 */ + svbool_t mask = svptrue_pat_b64(SV_VL2); + svuint64_t acc0 = svld1_u64(mask, xacc + 0); + svuint64_t acc1 = svld1_u64(mask, xacc + 2); + svuint64_t acc2 = svld1_u64(mask, xacc + 4); + svuint64_t acc3 = svld1_u64(mask, xacc + 6); + do { + svprfd(mask, xinput + 128, SV_PLDL1STRM); + ACCRND(acc0, 0); + ACCRND(acc1, 2); + ACCRND(acc2, 4); + ACCRND(acc3, 6); + xinput += 8; + xsecret += 1; + nbStripes--; + } while (nbStripes != 0); + + svst1_u64(mask, xacc + 0, acc0); + svst1_u64(mask, xacc + 2, acc1); + svst1_u64(mask, xacc + 4, acc2); + svst1_u64(mask, xacc + 6, acc3); + } else { + svbool_t mask = svptrue_pat_b64(SV_VL4); + svuint64_t acc0 = svld1_u64(mask, xacc + 0); + svuint64_t acc1 = svld1_u64(mask, xacc + 4); + do { + svprfd(mask, xinput + 128, SV_PLDL1STRM); + ACCRND(acc0, 0); + ACCRND(acc1, 4); + xinput += 8; + xsecret += 1; + nbStripes--; + } while (nbStripes != 0); + + svst1_u64(mask, xacc + 0, acc0); + svst1_u64(mask, xacc + 4, acc1); + } + } +} + +#endif + +/* scalar variants - universal */ + +#if defined(__aarch64__) && (defined(__GNUC__) || defined(__clang__)) +/* + * In XXH3_scalarRound(), GCC and Clang have a similar codegen issue, where they + * emit an excess mask and a full 64-bit multiply-add (MADD X-form). + * + * While this might not seem like much, as AArch64 is a 64-bit architecture, only + * big Cortex designs have a full 64-bit multiplier. + * + * On the little cores, the smaller 32-bit multiplier is used, and full 64-bit + * multiplies expand to 2-3 multiplies in microcode. This has a major penalty + * of up to 4 latency cycles and 2 stall cycles in the multiply pipeline. + * + * Thankfully, AArch64 still provides the 32-bit long multiply-add (UMADDL) which does + * not have this penalty and does the mask automatically. + */ +XXH_FORCE_INLINE xxh_u64 +XXH_mult32to64_add64(xxh_u64 lhs, xxh_u64 rhs, xxh_u64 acc) +{ + xxh_u64 ret; + /* note: %x = 64-bit register, %w = 32-bit register */ + __asm__("umaddl %x0, %w1, %w2, %x3" : "=r" (ret) : "r" (lhs), "r" (rhs), "r" (acc)); + return ret; +} +#else +XXH_FORCE_INLINE xxh_u64 +XXH_mult32to64_add64(xxh_u64 lhs, xxh_u64 rhs, xxh_u64 acc) +{ + return XXH_mult32to64((xxh_u32)lhs, (xxh_u32)rhs) + acc; +} +#endif + +/*! + * @internal + * @brief Scalar round for @ref XXH3_accumulate_512_scalar(). + * + * This is extracted to its own function because the NEON path uses a combination + * of NEON and scalar. + */ +XXH_FORCE_INLINE void +XXH3_scalarRound(void* XXH_RESTRICT acc, + void const* XXH_RESTRICT input, + void const* XXH_RESTRICT secret, + size_t lane) +{ + xxh_u64* xacc = (xxh_u64*) acc; + xxh_u8 const* xinput = (xxh_u8 const*) input; + xxh_u8 const* xsecret = (xxh_u8 const*) secret; + XXH_ASSERT(lane < XXH_ACC_NB); + XXH_ASSERT(((size_t)acc & (XXH_ACC_ALIGN-1)) == 0); + { + xxh_u64 const data_val = XXH_readLE64(xinput + lane * 8); + xxh_u64 const data_key = data_val ^ XXH_readLE64(xsecret + lane * 8); + xacc[lane ^ 1] += data_val; /* swap adjacent lanes */ + xacc[lane] = XXH_mult32to64_add64(data_key /* & 0xFFFFFFFF */, data_key >> 32, xacc[lane]); + } +} + +/*! + * @internal + * @brief Processes a 64 byte block of data using the scalar path. + */ +XXH_FORCE_INLINE void +XXH3_accumulate_512_scalar(void* XXH_RESTRICT acc, + const void* XXH_RESTRICT input, + const void* XXH_RESTRICT secret) +{ + size_t i; + /* ARM GCC refuses to unroll this loop, resulting in a 24% slowdown on ARMv6. */ +#if defined(__GNUC__) && !defined(__clang__) \ + && (defined(__arm__) || defined(__thumb2__)) \ + && defined(__ARM_FEATURE_UNALIGNED) /* no unaligned access just wastes bytes */ \ + && XXH_SIZE_OPT <= 0 +# pragma GCC unroll 8 +#endif + for (i=0; i < XXH_ACC_NB; i++) { + XXH3_scalarRound(acc, input, secret, i); + } +} +XXH_FORCE_INLINE XXH3_ACCUMULATE_TEMPLATE(scalar) + +/*! + * @internal + * @brief Scalar scramble step for @ref XXH3_scrambleAcc_scalar(). + * + * This is extracted to its own function because the NEON path uses a combination + * of NEON and scalar. + */ +XXH_FORCE_INLINE void +XXH3_scalarScrambleRound(void* XXH_RESTRICT acc, + void const* XXH_RESTRICT secret, + size_t lane) +{ + xxh_u64* const xacc = (xxh_u64*) acc; /* presumed aligned */ + const xxh_u8* const xsecret = (const xxh_u8*) secret; /* no alignment restriction */ + XXH_ASSERT((((size_t)acc) & (XXH_ACC_ALIGN-1)) == 0); + XXH_ASSERT(lane < XXH_ACC_NB); + { + xxh_u64 const key64 = XXH_readLE64(xsecret + lane * 8); + xxh_u64 acc64 = xacc[lane]; + acc64 = XXH_xorshift64(acc64, 47); + acc64 ^= key64; + acc64 *= XXH_PRIME32_1; + xacc[lane] = acc64; + } +} + +/*! + * @internal + * @brief Scrambles the accumulators after a large chunk has been read + */ +XXH_FORCE_INLINE void +XXH3_scrambleAcc_scalar(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) +{ + size_t i; + for (i=0; i < XXH_ACC_NB; i++) { + XXH3_scalarScrambleRound(acc, secret, i); + } +} + +XXH_FORCE_INLINE void +XXH3_initCustomSecret_scalar(void* XXH_RESTRICT customSecret, xxh_u64 seed64) +{ + /* + * We need a separate pointer for the hack below, + * which requires a non-const pointer. + * Any decent compiler will optimize this out otherwise. + */ + const xxh_u8* kSecretPtr = XXH3_kSecret; + XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE & 15) == 0); + +#if defined(__GNUC__) && defined(__aarch64__) + /* + * UGLY HACK: + * GCC and Clang generate a bunch of MOV/MOVK pairs for aarch64, and they are + * placed sequentially, in order, at the top of the unrolled loop. + * + * While MOVK is great for generating constants (2 cycles for a 64-bit + * constant compared to 4 cycles for LDR), it fights for bandwidth with + * the arithmetic instructions. + * + * I L S + * MOVK + * MOVK + * MOVK + * MOVK + * ADD + * SUB STR + * STR + * By forcing loads from memory (as the asm line causes the compiler to assume + * that XXH3_kSecretPtr has been changed), the pipelines are used more + * efficiently: + * I L S + * LDR + * ADD LDR + * SUB STR + * STR + * + * See XXH3_NEON_LANES for details on the pipsline. + * + * XXH3_64bits_withSeed, len == 256, Snapdragon 835 + * without hack: 2654.4 MB/s + * with hack: 3202.9 MB/s + */ + XXH_COMPILER_GUARD(kSecretPtr); +#endif + { int const nbRounds = XXH_SECRET_DEFAULT_SIZE / 16; + int i; + for (i=0; i < nbRounds; i++) { + /* + * The asm hack causes the compiler to assume that kSecretPtr aliases with + * customSecret, and on aarch64, this prevented LDP from merging two + * loads together for free. Putting the loads together before the stores + * properly generates LDP. + */ + xxh_u64 lo = XXH_readLE64(kSecretPtr + 16*i) + seed64; + xxh_u64 hi = XXH_readLE64(kSecretPtr + 16*i + 8) - seed64; + XXH_writeLE64((xxh_u8*)customSecret + 16*i, lo); + XXH_writeLE64((xxh_u8*)customSecret + 16*i + 8, hi); + } } +} + + +typedef void (*XXH3_f_accumulate)(xxh_u64* XXH_RESTRICT, const xxh_u8* XXH_RESTRICT, const xxh_u8* XXH_RESTRICT, size_t); +typedef void (*XXH3_f_scrambleAcc)(void* XXH_RESTRICT, const void*); +typedef void (*XXH3_f_initCustomSecret)(void* XXH_RESTRICT, xxh_u64); + + +#if (XXH_VECTOR == XXH_AVX512) + +#define XXH3_accumulate_512 XXH3_accumulate_512_avx512 +#define XXH3_accumulate XXH3_accumulate_avx512 +#define XXH3_scrambleAcc XXH3_scrambleAcc_avx512 +#define XXH3_initCustomSecret XXH3_initCustomSecret_avx512 + +#elif (XXH_VECTOR == XXH_AVX2) + +#define XXH3_accumulate_512 XXH3_accumulate_512_avx2 +#define XXH3_accumulate XXH3_accumulate_avx2 +#define XXH3_scrambleAcc XXH3_scrambleAcc_avx2 +#define XXH3_initCustomSecret XXH3_initCustomSecret_avx2 + +#elif (XXH_VECTOR == XXH_SSE2) + +#define XXH3_accumulate_512 XXH3_accumulate_512_sse2 +#define XXH3_accumulate XXH3_accumulate_sse2 +#define XXH3_scrambleAcc XXH3_scrambleAcc_sse2 +#define XXH3_initCustomSecret XXH3_initCustomSecret_sse2 + +#elif (XXH_VECTOR == XXH_NEON) + +#define XXH3_accumulate_512 XXH3_accumulate_512_neon +#define XXH3_accumulate XXH3_accumulate_neon +#define XXH3_scrambleAcc XXH3_scrambleAcc_neon +#define XXH3_initCustomSecret XXH3_initCustomSecret_scalar + +#elif (XXH_VECTOR == XXH_VSX) + +#define XXH3_accumulate_512 XXH3_accumulate_512_vsx +#define XXH3_accumulate XXH3_accumulate_vsx +#define XXH3_scrambleAcc XXH3_scrambleAcc_vsx +#define XXH3_initCustomSecret XXH3_initCustomSecret_scalar + +#elif (XXH_VECTOR == XXH_SVE) +#define XXH3_accumulate_512 XXH3_accumulate_512_sve +#define XXH3_accumulate XXH3_accumulate_sve +#define XXH3_scrambleAcc XXH3_scrambleAcc_scalar +#define XXH3_initCustomSecret XXH3_initCustomSecret_scalar + +#else /* scalar */ + +#define XXH3_accumulate_512 XXH3_accumulate_512_scalar +#define XXH3_accumulate XXH3_accumulate_scalar +#define XXH3_scrambleAcc XXH3_scrambleAcc_scalar +#define XXH3_initCustomSecret XXH3_initCustomSecret_scalar + +#endif + +#if XXH_SIZE_OPT >= 1 /* don't do SIMD for initialization */ +# undef XXH3_initCustomSecret +# define XXH3_initCustomSecret XXH3_initCustomSecret_scalar +#endif + +XXH_FORCE_INLINE void +XXH3_hashLong_internal_loop(xxh_u64* XXH_RESTRICT acc, + const xxh_u8* XXH_RESTRICT input, size_t len, + const xxh_u8* XXH_RESTRICT secret, size_t secretSize, + XXH3_f_accumulate f_acc, + XXH3_f_scrambleAcc f_scramble) +{ + size_t const nbStripesPerBlock = (secretSize - XXH_STRIPE_LEN) / XXH_SECRET_CONSUME_RATE; + size_t const block_len = XXH_STRIPE_LEN * nbStripesPerBlock; + size_t const nb_blocks = (len - 1) / block_len; + + size_t n; + + XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); + + for (n = 0; n < nb_blocks; n++) { + f_acc(acc, input + n*block_len, secret, nbStripesPerBlock); + f_scramble(acc, secret + secretSize - XXH_STRIPE_LEN); + } + + /* last partial block */ + XXH_ASSERT(len > XXH_STRIPE_LEN); + { size_t const nbStripes = ((len - 1) - (block_len * nb_blocks)) / XXH_STRIPE_LEN; + XXH_ASSERT(nbStripes <= (secretSize / XXH_SECRET_CONSUME_RATE)); + f_acc(acc, input + nb_blocks*block_len, secret, nbStripes); + + /* last stripe */ + { const xxh_u8* const p = input + len - XXH_STRIPE_LEN; +#define XXH_SECRET_LASTACC_START 7 /* not aligned on 8, last secret is different from acc & scrambler */ + XXH3_accumulate_512(acc, p, secret + secretSize - XXH_STRIPE_LEN - XXH_SECRET_LASTACC_START); + } } +} + +XXH_FORCE_INLINE xxh_u64 +XXH3_mix2Accs(const xxh_u64* XXH_RESTRICT acc, const xxh_u8* XXH_RESTRICT secret) +{ + return XXH3_mul128_fold64( + acc[0] ^ XXH_readLE64(secret), + acc[1] ^ XXH_readLE64(secret+8) ); +} + +static XXH64_hash_t +XXH3_mergeAccs(const xxh_u64* XXH_RESTRICT acc, const xxh_u8* XXH_RESTRICT secret, xxh_u64 start) +{ + xxh_u64 result64 = start; + size_t i = 0; + + for (i = 0; i < 4; i++) { + result64 += XXH3_mix2Accs(acc+2*i, secret + 16*i); +#if defined(__clang__) /* Clang */ \ + && (defined(__arm__) || defined(__thumb__)) /* ARMv7 */ \ + && (defined(__ARM_NEON) || defined(__ARM_NEON__)) /* NEON */ \ + && !defined(XXH_ENABLE_AUTOVECTORIZE) /* Define to disable */ + /* + * UGLY HACK: + * Prevent autovectorization on Clang ARMv7-a. Exact same problem as + * the one in XXH3_len_129to240_64b. Speeds up shorter keys > 240b. + * XXH3_64bits, len == 256, Snapdragon 835: + * without hack: 2063.7 MB/s + * with hack: 2560.7 MB/s + */ + XXH_COMPILER_GUARD(result64); +#endif + } + + return XXH3_avalanche(result64); +} + +#define XXH3_INIT_ACC { XXH_PRIME32_3, XXH_PRIME64_1, XXH_PRIME64_2, XXH_PRIME64_3, \ + XXH_PRIME64_4, XXH_PRIME32_2, XXH_PRIME64_5, XXH_PRIME32_1 } + +XXH_FORCE_INLINE XXH64_hash_t +XXH3_hashLong_64b_internal(const void* XXH_RESTRICT input, size_t len, + const void* XXH_RESTRICT secret, size_t secretSize, + XXH3_f_accumulate f_acc, + XXH3_f_scrambleAcc f_scramble) +{ + XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64 acc[XXH_ACC_NB] = XXH3_INIT_ACC; + + XXH3_hashLong_internal_loop(acc, (const xxh_u8*)input, len, (const xxh_u8*)secret, secretSize, f_acc, f_scramble); + + /* converge into final hash */ + XXH_STATIC_ASSERT(sizeof(acc) == 64); + /* do not align on 8, so that the secret is different from the accumulator */ +#define XXH_SECRET_MERGEACCS_START 11 + XXH_ASSERT(secretSize >= sizeof(acc) + XXH_SECRET_MERGEACCS_START); + return XXH3_mergeAccs(acc, (const xxh_u8*)secret + XXH_SECRET_MERGEACCS_START, (xxh_u64)len * XXH_PRIME64_1); +} + +/* + * It's important for performance to transmit secret's size (when it's static) + * so that the compiler can properly optimize the vectorized loop. + * This makes a big performance difference for "medium" keys (<1 KB) when using AVX instruction set. + * When the secret size is unknown, or on GCC 12 where the mix of NO_INLINE and FORCE_INLINE + * breaks -Og, this is XXH_NO_INLINE. + */ +XXH3_WITH_SECRET_INLINE XXH64_hash_t +XXH3_hashLong_64b_withSecret(const void* XXH_RESTRICT input, size_t len, + XXH64_hash_t seed64, const xxh_u8* XXH_RESTRICT secret, size_t secretLen) +{ + (void)seed64; + return XXH3_hashLong_64b_internal(input, len, secret, secretLen, XXH3_accumulate, XXH3_scrambleAcc); +} + +/* + * It's preferable for performance that XXH3_hashLong is not inlined, + * as it results in a smaller function for small data, easier to the instruction cache. + * Note that inside this no_inline function, we do inline the internal loop, + * and provide a statically defined secret size to allow optimization of vector loop. + */ +XXH_NO_INLINE XXH_PUREF XXH64_hash_t +XXH3_hashLong_64b_default(const void* XXH_RESTRICT input, size_t len, + XXH64_hash_t seed64, const xxh_u8* XXH_RESTRICT secret, size_t secretLen) +{ + (void)seed64; (void)secret; (void)secretLen; + return XXH3_hashLong_64b_internal(input, len, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_accumulate, XXH3_scrambleAcc); +} + +/* + * XXH3_hashLong_64b_withSeed(): + * Generate a custom key based on alteration of default XXH3_kSecret with the seed, + * and then use this key for long mode hashing. + * + * This operation is decently fast but nonetheless costs a little bit of time. + * Try to avoid it whenever possible (typically when seed==0). + * + * It's important for performance that XXH3_hashLong is not inlined. Not sure + * why (uop cache maybe?), but the difference is large and easily measurable. + */ +XXH_FORCE_INLINE XXH64_hash_t +XXH3_hashLong_64b_withSeed_internal(const void* input, size_t len, + XXH64_hash_t seed, + XXH3_f_accumulate f_acc, + XXH3_f_scrambleAcc f_scramble, + XXH3_f_initCustomSecret f_initSec) +{ +#if XXH_SIZE_OPT <= 0 + if (seed == 0) + return XXH3_hashLong_64b_internal(input, len, + XXH3_kSecret, sizeof(XXH3_kSecret), + f_acc, f_scramble); +#endif + { XXH_ALIGN(XXH_SEC_ALIGN) xxh_u8 secret[XXH_SECRET_DEFAULT_SIZE]; + f_initSec(secret, seed); + return XXH3_hashLong_64b_internal(input, len, secret, sizeof(secret), + f_acc, f_scramble); + } +} + +/* + * It's important for performance that XXH3_hashLong is not inlined. + */ +XXH_NO_INLINE XXH64_hash_t +XXH3_hashLong_64b_withSeed(const void* XXH_RESTRICT input, size_t len, + XXH64_hash_t seed, const xxh_u8* XXH_RESTRICT secret, size_t secretLen) +{ + (void)secret; (void)secretLen; + return XXH3_hashLong_64b_withSeed_internal(input, len, seed, + XXH3_accumulate, XXH3_scrambleAcc, XXH3_initCustomSecret); +} + + +typedef XXH64_hash_t (*XXH3_hashLong64_f)(const void* XXH_RESTRICT, size_t, + XXH64_hash_t, const xxh_u8* XXH_RESTRICT, size_t); + +XXH_FORCE_INLINE XXH64_hash_t +XXH3_64bits_internal(const void* XXH_RESTRICT input, size_t len, + XXH64_hash_t seed64, const void* XXH_RESTRICT secret, size_t secretLen, + XXH3_hashLong64_f f_hashLong) +{ + XXH_ASSERT(secretLen >= XXH3_SECRET_SIZE_MIN); + /* + * If an action is to be taken if `secretLen` condition is not respected, + * it should be done here. + * For now, it's a contract pre-condition. + * Adding a check and a branch here would cost performance at every hash. + * Also, note that function signature doesn't offer room to return an error. + */ + if (len <= 16) + return XXH3_len_0to16_64b((const xxh_u8*)input, len, (const xxh_u8*)secret, seed64); + if (len <= 128) + return XXH3_len_17to128_64b((const xxh_u8*)input, len, (const xxh_u8*)secret, secretLen, seed64); + if (len <= XXH3_MIDSIZE_MAX) + return XXH3_len_129to240_64b((const xxh_u8*)input, len, (const xxh_u8*)secret, secretLen, seed64); + return f_hashLong(input, len, seed64, (const xxh_u8*)secret, secretLen); +} + + +/* === Public entry point === */ + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH64_hash_t XXH3_64bits(XXH_NOESCAPE const void* input, size_t length) +{ + return XXH3_64bits_internal(input, length, 0, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_hashLong_64b_default); +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH64_hash_t +XXH3_64bits_withSecret(XXH_NOESCAPE const void* input, size_t length, XXH_NOESCAPE const void* secret, size_t secretSize) +{ + return XXH3_64bits_internal(input, length, 0, secret, secretSize, XXH3_hashLong_64b_withSecret); +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH64_hash_t +XXH3_64bits_withSeed(XXH_NOESCAPE const void* input, size_t length, XXH64_hash_t seed) +{ + return XXH3_64bits_internal(input, length, seed, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_hashLong_64b_withSeed); +} + +XXH_PUBLIC_API XXH64_hash_t +XXH3_64bits_withSecretandSeed(XXH_NOESCAPE const void* input, size_t length, XXH_NOESCAPE const void* secret, size_t secretSize, XXH64_hash_t seed) +{ + if (length <= XXH3_MIDSIZE_MAX) + return XXH3_64bits_internal(input, length, seed, XXH3_kSecret, sizeof(XXH3_kSecret), NULL); + return XXH3_hashLong_64b_withSecret(input, length, seed, (const xxh_u8*)secret, secretSize); +} + + +/* === XXH3 streaming === */ +#ifndef XXH_NO_STREAM +/* + * Malloc's a pointer that is always aligned to align. + * + * This must be freed with `XXH_alignedFree()`. + * + * malloc typically guarantees 16 byte alignment on 64-bit systems and 8 byte + * alignment on 32-bit. This isn't enough for the 32 byte aligned loads in AVX2 + * or on 32-bit, the 16 byte aligned loads in SSE2 and NEON. + * + * This underalignment previously caused a rather obvious crash which went + * completely unnoticed due to XXH3_createState() not actually being tested. + * Credit to RedSpah for noticing this bug. + * + * The alignment is done manually: Functions like posix_memalign or _mm_malloc + * are avoided: To maintain portability, we would have to write a fallback + * like this anyways, and besides, testing for the existence of library + * functions without relying on external build tools is impossible. + * + * The method is simple: Overallocate, manually align, and store the offset + * to the original behind the returned pointer. + * + * Align must be a power of 2 and 8 <= align <= 128. + */ +static XXH_MALLOCF void* XXH_alignedMalloc(size_t s, size_t align) +{ + XXH_ASSERT(align <= 128 && align >= 8); /* range check */ + XXH_ASSERT((align & (align-1)) == 0); /* power of 2 */ + XXH_ASSERT(s != 0 && s < (s + align)); /* empty/overflow */ + { /* Overallocate to make room for manual realignment and an offset byte */ + xxh_u8* base = (xxh_u8*)XXH_malloc(s + align); + if (base != NULL) { + /* + * Get the offset needed to align this pointer. + * + * Even if the returned pointer is aligned, there will always be + * at least one byte to store the offset to the original pointer. + */ + size_t offset = align - ((size_t)base & (align - 1)); /* base % align */ + /* Add the offset for the now-aligned pointer */ + xxh_u8* ptr = base + offset; + + XXH_ASSERT((size_t)ptr % align == 0); + + /* Store the offset immediately before the returned pointer. */ + ptr[-1] = (xxh_u8)offset; + return ptr; + } + return NULL; + } +} +/* + * Frees an aligned pointer allocated by XXH_alignedMalloc(). Don't pass + * normal malloc'd pointers, XXH_alignedMalloc has a specific data layout. + */ +static void XXH_alignedFree(void* p) +{ + if (p != NULL) { + xxh_u8* ptr = (xxh_u8*)p; + /* Get the offset byte we added in XXH_malloc. */ + xxh_u8 offset = ptr[-1]; + /* Free the original malloc'd pointer */ + xxh_u8* base = ptr - offset; + XXH_free(base); + } +} +/*! @ingroup XXH3_family */ +/*! + * @brief Allocate an @ref XXH3_state_t. + * + * @return An allocated pointer of @ref XXH3_state_t on success. + * @return `NULL` on failure. + * + * @note Must be freed with XXH3_freeState(). + */ +XXH_PUBLIC_API XXH3_state_t* XXH3_createState(void) +{ + XXH3_state_t* const state = (XXH3_state_t*)XXH_alignedMalloc(sizeof(XXH3_state_t), 64); + if (state==NULL) return NULL; + XXH3_INITSTATE(state); + return state; +} + +/*! @ingroup XXH3_family */ +/*! + * @brief Frees an @ref XXH3_state_t. + * + * @param statePtr A pointer to an @ref XXH3_state_t allocated with @ref XXH3_createState(). + * + * @return @ref XXH_OK. + * + * @note Must be allocated with XXH3_createState(). + */ +XXH_PUBLIC_API XXH_errorcode XXH3_freeState(XXH3_state_t* statePtr) +{ + XXH_alignedFree(statePtr); + return XXH_OK; +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API void +XXH3_copyState(XXH_NOESCAPE XXH3_state_t* dst_state, XXH_NOESCAPE const XXH3_state_t* src_state) +{ + XXH_memcpy(dst_state, src_state, sizeof(*dst_state)); +} + +static void +XXH3_reset_internal(XXH3_state_t* statePtr, + XXH64_hash_t seed, + const void* secret, size_t secretSize) +{ + size_t const initStart = offsetof(XXH3_state_t, bufferedSize); + size_t const initLength = offsetof(XXH3_state_t, nbStripesPerBlock) - initStart; + XXH_ASSERT(offsetof(XXH3_state_t, nbStripesPerBlock) > initStart); + XXH_ASSERT(statePtr != NULL); + /* set members from bufferedSize to nbStripesPerBlock (excluded) to 0 */ + memset((char*)statePtr + initStart, 0, initLength); + statePtr->acc[0] = XXH_PRIME32_3; + statePtr->acc[1] = XXH_PRIME64_1; + statePtr->acc[2] = XXH_PRIME64_2; + statePtr->acc[3] = XXH_PRIME64_3; + statePtr->acc[4] = XXH_PRIME64_4; + statePtr->acc[5] = XXH_PRIME32_2; + statePtr->acc[6] = XXH_PRIME64_5; + statePtr->acc[7] = XXH_PRIME32_1; + statePtr->seed = seed; + statePtr->useSeed = (seed != 0); + statePtr->extSecret = (const unsigned char*)secret; + XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); + statePtr->secretLimit = secretSize - XXH_STRIPE_LEN; + statePtr->nbStripesPerBlock = statePtr->secretLimit / XXH_SECRET_CONSUME_RATE; +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH_errorcode +XXH3_64bits_reset(XXH_NOESCAPE XXH3_state_t* statePtr) +{ + if (statePtr == NULL) return XXH_ERROR; + XXH3_reset_internal(statePtr, 0, XXH3_kSecret, XXH_SECRET_DEFAULT_SIZE); + return XXH_OK; +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH_errorcode +XXH3_64bits_reset_withSecret(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize) +{ + if (statePtr == NULL) return XXH_ERROR; + XXH3_reset_internal(statePtr, 0, secret, secretSize); + if (secret == NULL) return XXH_ERROR; + if (secretSize < XXH3_SECRET_SIZE_MIN) return XXH_ERROR; + return XXH_OK; +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH_errorcode +XXH3_64bits_reset_withSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH64_hash_t seed) +{ + if (statePtr == NULL) return XXH_ERROR; + if (seed==0) return XXH3_64bits_reset(statePtr); + if ((seed != statePtr->seed) || (statePtr->extSecret != NULL)) + XXH3_initCustomSecret(statePtr->customSecret, seed); + XXH3_reset_internal(statePtr, seed, NULL, XXH_SECRET_DEFAULT_SIZE); + return XXH_OK; +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH_errorcode +XXH3_64bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize, XXH64_hash_t seed64) +{ + if (statePtr == NULL) return XXH_ERROR; + if (secret == NULL) return XXH_ERROR; + if (secretSize < XXH3_SECRET_SIZE_MIN) return XXH_ERROR; + XXH3_reset_internal(statePtr, seed64, secret, secretSize); + statePtr->useSeed = 1; /* always, even if seed64==0 */ + return XXH_OK; +} + +/*! + * @internal + * @brief Processes a large input for XXH3_update() and XXH3_digest_long(). + * + * Unlike XXH3_hashLong_internal_loop(), this can process data that overlaps a block. + * + * @param acc Pointer to the 8 accumulator lanes + * @param nbStripesSoFarPtr In/out pointer to the number of leftover stripes in the block* + * @param nbStripesPerBlock Number of stripes in a block + * @param input Input pointer + * @param nbStripes Number of stripes to process + * @param secret Secret pointer + * @param secretLimit Offset of the last block in @p secret + * @param f_acc Pointer to an XXH3_accumulate implementation + * @param f_scramble Pointer to an XXH3_scrambleAcc implementation + * @return Pointer past the end of @p input after processing + */ +XXH_FORCE_INLINE const xxh_u8 * +XXH3_consumeStripes(xxh_u64* XXH_RESTRICT acc, + size_t* XXH_RESTRICT nbStripesSoFarPtr, size_t nbStripesPerBlock, + const xxh_u8* XXH_RESTRICT input, size_t nbStripes, + const xxh_u8* XXH_RESTRICT secret, size_t secretLimit, + XXH3_f_accumulate f_acc, + XXH3_f_scrambleAcc f_scramble) +{ + const xxh_u8* initialSecret = secret + *nbStripesSoFarPtr * XXH_SECRET_CONSUME_RATE; + /* Process full blocks */ + if (nbStripes >= (nbStripesPerBlock - *nbStripesSoFarPtr)) { + /* Process the initial partial block... */ + size_t nbStripesThisIter = nbStripesPerBlock - *nbStripesSoFarPtr; + + do { + /* Accumulate and scramble */ + f_acc(acc, input, initialSecret, nbStripesThisIter); + f_scramble(acc, secret + secretLimit); + input += nbStripesThisIter * XXH_STRIPE_LEN; + nbStripes -= nbStripesThisIter; + /* Then continue the loop with the full block size */ + nbStripesThisIter = nbStripesPerBlock; + initialSecret = secret; + } while (nbStripes >= nbStripesPerBlock); + *nbStripesSoFarPtr = 0; + } + /* Process a partial block */ + if (nbStripes > 0) { + f_acc(acc, input, initialSecret, nbStripes); + input += nbStripes * XXH_STRIPE_LEN; + *nbStripesSoFarPtr += nbStripes; + } + /* Return end pointer */ + return input; +} + +#ifndef XXH3_STREAM_USE_STACK +# if XXH_SIZE_OPT <= 0 && !defined(__clang__) /* clang doesn't need additional stack space */ +# define XXH3_STREAM_USE_STACK 1 +# endif +#endif +/* + * Both XXH3_64bits_update and XXH3_128bits_update use this routine. + */ +XXH_FORCE_INLINE XXH_errorcode +XXH3_update(XXH3_state_t* XXH_RESTRICT const state, + const xxh_u8* XXH_RESTRICT input, size_t len, + XXH3_f_accumulate f_acc, + XXH3_f_scrambleAcc f_scramble) +{ + if (input==NULL) { + XXH_ASSERT(len == 0); + return XXH_OK; + } + + XXH_ASSERT(state != NULL); + { const xxh_u8* const bEnd = input + len; + const unsigned char* const secret = (state->extSecret == NULL) ? state->customSecret : state->extSecret; +#if defined(XXH3_STREAM_USE_STACK) && XXH3_STREAM_USE_STACK >= 1 + /* For some reason, gcc and MSVC seem to suffer greatly + * when operating accumulators directly into state. + * Operating into stack space seems to enable proper optimization. + * clang, on the other hand, doesn't seem to need this trick */ + XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64 acc[8]; + XXH_memcpy(acc, state->acc, sizeof(acc)); +#else + xxh_u64* XXH_RESTRICT const acc = state->acc; +#endif + state->totalLen += len; + XXH_ASSERT(state->bufferedSize <= XXH3_INTERNALBUFFER_SIZE); + + /* small input : just fill in tmp buffer */ + if (len <= XXH3_INTERNALBUFFER_SIZE - state->bufferedSize) { + XXH_memcpy(state->buffer + state->bufferedSize, input, len); + state->bufferedSize += (XXH32_hash_t)len; + return XXH_OK; + } + + /* total input is now > XXH3_INTERNALBUFFER_SIZE */ + #define XXH3_INTERNALBUFFER_STRIPES (XXH3_INTERNALBUFFER_SIZE / XXH_STRIPE_LEN) + XXH_STATIC_ASSERT(XXH3_INTERNALBUFFER_SIZE % XXH_STRIPE_LEN == 0); /* clean multiple */ + + /* + * Internal buffer is partially filled (always, except at beginning) + * Complete it, then consume it. + */ + if (state->bufferedSize) { + size_t const loadSize = XXH3_INTERNALBUFFER_SIZE - state->bufferedSize; + XXH_memcpy(state->buffer + state->bufferedSize, input, loadSize); + input += loadSize; + XXH3_consumeStripes(acc, + &state->nbStripesSoFar, state->nbStripesPerBlock, + state->buffer, XXH3_INTERNALBUFFER_STRIPES, + secret, state->secretLimit, + f_acc, f_scramble); + state->bufferedSize = 0; + } + XXH_ASSERT(input < bEnd); + if (bEnd - input > XXH3_INTERNALBUFFER_SIZE) { + size_t nbStripes = (size_t)(bEnd - 1 - input) / XXH_STRIPE_LEN; + input = XXH3_consumeStripes(acc, + &state->nbStripesSoFar, state->nbStripesPerBlock, + input, nbStripes, + secret, state->secretLimit, + f_acc, f_scramble); + XXH_memcpy(state->buffer + sizeof(state->buffer) - XXH_STRIPE_LEN, input - XXH_STRIPE_LEN, XXH_STRIPE_LEN); + + } + /* Some remaining input (always) : buffer it */ + XXH_ASSERT(input < bEnd); + XXH_ASSERT(bEnd - input <= XXH3_INTERNALBUFFER_SIZE); + XXH_ASSERT(state->bufferedSize == 0); + XXH_memcpy(state->buffer, input, (size_t)(bEnd-input)); + state->bufferedSize = (XXH32_hash_t)(bEnd-input); +#if defined(XXH3_STREAM_USE_STACK) && XXH3_STREAM_USE_STACK >= 1 + /* save stack accumulators into state */ + XXH_memcpy(state->acc, acc, sizeof(acc)); +#endif + } + + return XXH_OK; +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH_errorcode +XXH3_64bits_update(XXH_NOESCAPE XXH3_state_t* state, XXH_NOESCAPE const void* input, size_t len) +{ + return XXH3_update(state, (const xxh_u8*)input, len, + XXH3_accumulate, XXH3_scrambleAcc); +} + + +XXH_FORCE_INLINE void +XXH3_digest_long (XXH64_hash_t* acc, + const XXH3_state_t* state, + const unsigned char* secret) +{ + xxh_u8 lastStripe[XXH_STRIPE_LEN]; + const xxh_u8* lastStripePtr; + + /* + * Digest on a local copy. This way, the state remains unaltered, and it can + * continue ingesting more input afterwards. + */ + XXH_memcpy(acc, state->acc, sizeof(state->acc)); + if (state->bufferedSize >= XXH_STRIPE_LEN) { + /* Consume remaining stripes then point to remaining data in buffer */ + size_t const nbStripes = (state->bufferedSize - 1) / XXH_STRIPE_LEN; + size_t nbStripesSoFar = state->nbStripesSoFar; + XXH3_consumeStripes(acc, + &nbStripesSoFar, state->nbStripesPerBlock, + state->buffer, nbStripes, + secret, state->secretLimit, + XXH3_accumulate, XXH3_scrambleAcc); + lastStripePtr = state->buffer + state->bufferedSize - XXH_STRIPE_LEN; + } else { /* bufferedSize < XXH_STRIPE_LEN */ + /* Copy to temp buffer */ + size_t const catchupSize = XXH_STRIPE_LEN - state->bufferedSize; + XXH_ASSERT(state->bufferedSize > 0); /* there is always some input buffered */ + XXH_memcpy(lastStripe, state->buffer + sizeof(state->buffer) - catchupSize, catchupSize); + XXH_memcpy(lastStripe + catchupSize, state->buffer, state->bufferedSize); + lastStripePtr = lastStripe; + } + /* Last stripe */ + XXH3_accumulate_512(acc, + lastStripePtr, + secret + state->secretLimit - XXH_SECRET_LASTACC_START); +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_digest (XXH_NOESCAPE const XXH3_state_t* state) +{ + const unsigned char* const secret = (state->extSecret == NULL) ? state->customSecret : state->extSecret; + if (state->totalLen > XXH3_MIDSIZE_MAX) { + XXH_ALIGN(XXH_ACC_ALIGN) XXH64_hash_t acc[XXH_ACC_NB]; + XXH3_digest_long(acc, state, secret); + return XXH3_mergeAccs(acc, + secret + XXH_SECRET_MERGEACCS_START, + (xxh_u64)state->totalLen * XXH_PRIME64_1); + } + /* totalLen <= XXH3_MIDSIZE_MAX: digesting a short input */ + if (state->useSeed) + return XXH3_64bits_withSeed(state->buffer, (size_t)state->totalLen, state->seed); + return XXH3_64bits_withSecret(state->buffer, (size_t)(state->totalLen), + secret, state->secretLimit + XXH_STRIPE_LEN); +} +#endif /* !XXH_NO_STREAM */ + + +/* ========================================== + * XXH3 128 bits (a.k.a XXH128) + * ========================================== + * XXH3's 128-bit variant has better mixing and strength than the 64-bit variant, + * even without counting the significantly larger output size. + * + * For example, extra steps are taken to avoid the seed-dependent collisions + * in 17-240 byte inputs (See XXH3_mix16B and XXH128_mix32B). + * + * This strength naturally comes at the cost of some speed, especially on short + * lengths. Note that longer hashes are about as fast as the 64-bit version + * due to it using only a slight modification of the 64-bit loop. + * + * XXH128 is also more oriented towards 64-bit machines. It is still extremely + * fast for a _128-bit_ hash on 32-bit (it usually clears XXH64). + */ + +XXH_FORCE_INLINE XXH_PUREF XXH128_hash_t +XXH3_len_1to3_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed) +{ + /* A doubled version of 1to3_64b with different constants. */ + XXH_ASSERT(input != NULL); + XXH_ASSERT(1 <= len && len <= 3); + XXH_ASSERT(secret != NULL); + /* + * len = 1: combinedl = { input[0], 0x01, input[0], input[0] } + * len = 2: combinedl = { input[1], 0x02, input[0], input[1] } + * len = 3: combinedl = { input[2], 0x03, input[0], input[1] } + */ + { xxh_u8 const c1 = input[0]; + xxh_u8 const c2 = input[len >> 1]; + xxh_u8 const c3 = input[len - 1]; + xxh_u32 const combinedl = ((xxh_u32)c1 <<16) | ((xxh_u32)c2 << 24) + | ((xxh_u32)c3 << 0) | ((xxh_u32)len << 8); + xxh_u32 const combinedh = XXH_rotl32(XXH_swap32(combinedl), 13); + xxh_u64 const bitflipl = (XXH_readLE32(secret) ^ XXH_readLE32(secret+4)) + seed; + xxh_u64 const bitfliph = (XXH_readLE32(secret+8) ^ XXH_readLE32(secret+12)) - seed; + xxh_u64 const keyed_lo = (xxh_u64)combinedl ^ bitflipl; + xxh_u64 const keyed_hi = (xxh_u64)combinedh ^ bitfliph; + XXH128_hash_t h128; + h128.low64 = XXH64_avalanche(keyed_lo); + h128.high64 = XXH64_avalanche(keyed_hi); + return h128; + } +} + +XXH_FORCE_INLINE XXH_PUREF XXH128_hash_t +XXH3_len_4to8_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed) +{ + XXH_ASSERT(input != NULL); + XXH_ASSERT(secret != NULL); + XXH_ASSERT(4 <= len && len <= 8); + seed ^= (xxh_u64)XXH_swap32((xxh_u32)seed) << 32; + { xxh_u32 const input_lo = XXH_readLE32(input); + xxh_u32 const input_hi = XXH_readLE32(input + len - 4); + xxh_u64 const input_64 = input_lo + ((xxh_u64)input_hi << 32); + xxh_u64 const bitflip = (XXH_readLE64(secret+16) ^ XXH_readLE64(secret+24)) + seed; + xxh_u64 const keyed = input_64 ^ bitflip; + + /* Shift len to the left to ensure it is even, this avoids even multiplies. */ + XXH128_hash_t m128 = XXH_mult64to128(keyed, XXH_PRIME64_1 + (len << 2)); + + m128.high64 += (m128.low64 << 1); + m128.low64 ^= (m128.high64 >> 3); + + m128.low64 = XXH_xorshift64(m128.low64, 35); + m128.low64 *= PRIME_MX2; + m128.low64 = XXH_xorshift64(m128.low64, 28); + m128.high64 = XXH3_avalanche(m128.high64); + return m128; + } +} + +XXH_FORCE_INLINE XXH_PUREF XXH128_hash_t +XXH3_len_9to16_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed) +{ + XXH_ASSERT(input != NULL); + XXH_ASSERT(secret != NULL); + XXH_ASSERT(9 <= len && len <= 16); + { xxh_u64 const bitflipl = (XXH_readLE64(secret+32) ^ XXH_readLE64(secret+40)) - seed; + xxh_u64 const bitfliph = (XXH_readLE64(secret+48) ^ XXH_readLE64(secret+56)) + seed; + xxh_u64 const input_lo = XXH_readLE64(input); + xxh_u64 input_hi = XXH_readLE64(input + len - 8); + XXH128_hash_t m128 = XXH_mult64to128(input_lo ^ input_hi ^ bitflipl, XXH_PRIME64_1); + /* + * Put len in the middle of m128 to ensure that the length gets mixed to + * both the low and high bits in the 128x64 multiply below. + */ + m128.low64 += (xxh_u64)(len - 1) << 54; + input_hi ^= bitfliph; + /* + * Add the high 32 bits of input_hi to the high 32 bits of m128, then + * add the long product of the low 32 bits of input_hi and XXH_PRIME32_2 to + * the high 64 bits of m128. + * + * The best approach to this operation is different on 32-bit and 64-bit. + */ + if (sizeof(void *) < sizeof(xxh_u64)) { /* 32-bit */ + /* + * 32-bit optimized version, which is more readable. + * + * On 32-bit, it removes an ADC and delays a dependency between the two + * halves of m128.high64, but it generates an extra mask on 64-bit. + */ + m128.high64 += (input_hi & 0xFFFFFFFF00000000ULL) + XXH_mult32to64((xxh_u32)input_hi, XXH_PRIME32_2); + } else { + /* + * 64-bit optimized (albeit more confusing) version. + * + * Uses some properties of addition and multiplication to remove the mask: + * + * Let: + * a = input_hi.lo = (input_hi & 0x00000000FFFFFFFF) + * b = input_hi.hi = (input_hi & 0xFFFFFFFF00000000) + * c = XXH_PRIME32_2 + * + * a + (b * c) + * Inverse Property: x + y - x == y + * a + (b * (1 + c - 1)) + * Distributive Property: x * (y + z) == (x * y) + (x * z) + * a + (b * 1) + (b * (c - 1)) + * Identity Property: x * 1 == x + * a + b + (b * (c - 1)) + * + * Substitute a, b, and c: + * input_hi.hi + input_hi.lo + ((xxh_u64)input_hi.lo * (XXH_PRIME32_2 - 1)) + * + * Since input_hi.hi + input_hi.lo == input_hi, we get this: + * input_hi + ((xxh_u64)input_hi.lo * (XXH_PRIME32_2 - 1)) + */ + m128.high64 += input_hi + XXH_mult32to64((xxh_u32)input_hi, XXH_PRIME32_2 - 1); + } + /* m128 ^= XXH_swap64(m128 >> 64); */ + m128.low64 ^= XXH_swap64(m128.high64); + + { /* 128x64 multiply: h128 = m128 * XXH_PRIME64_2; */ + XXH128_hash_t h128 = XXH_mult64to128(m128.low64, XXH_PRIME64_2); + h128.high64 += m128.high64 * XXH_PRIME64_2; + + h128.low64 = XXH3_avalanche(h128.low64); + h128.high64 = XXH3_avalanche(h128.high64); + return h128; + } } +} + +/* + * Assumption: `secret` size is >= XXH3_SECRET_SIZE_MIN + */ +XXH_FORCE_INLINE XXH_PUREF XXH128_hash_t +XXH3_len_0to16_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed) +{ + XXH_ASSERT(len <= 16); + { if (len > 8) return XXH3_len_9to16_128b(input, len, secret, seed); + if (len >= 4) return XXH3_len_4to8_128b(input, len, secret, seed); + if (len) return XXH3_len_1to3_128b(input, len, secret, seed); + { XXH128_hash_t h128; + xxh_u64 const bitflipl = XXH_readLE64(secret+64) ^ XXH_readLE64(secret+72); + xxh_u64 const bitfliph = XXH_readLE64(secret+80) ^ XXH_readLE64(secret+88); + h128.low64 = XXH64_avalanche(seed ^ bitflipl); + h128.high64 = XXH64_avalanche( seed ^ bitfliph); + return h128; + } } +} + +/* + * A bit slower than XXH3_mix16B, but handles multiply by zero better. + */ +XXH_FORCE_INLINE XXH128_hash_t +XXH128_mix32B(XXH128_hash_t acc, const xxh_u8* input_1, const xxh_u8* input_2, + const xxh_u8* secret, XXH64_hash_t seed) +{ + acc.low64 += XXH3_mix16B (input_1, secret+0, seed); + acc.low64 ^= XXH_readLE64(input_2) + XXH_readLE64(input_2 + 8); + acc.high64 += XXH3_mix16B (input_2, secret+16, seed); + acc.high64 ^= XXH_readLE64(input_1) + XXH_readLE64(input_1 + 8); + return acc; +} + + +XXH_FORCE_INLINE XXH_PUREF XXH128_hash_t +XXH3_len_17to128_128b(const xxh_u8* XXH_RESTRICT input, size_t len, + const xxh_u8* XXH_RESTRICT secret, size_t secretSize, + XXH64_hash_t seed) +{ + XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); (void)secretSize; + XXH_ASSERT(16 < len && len <= 128); + + { XXH128_hash_t acc; + acc.low64 = len * XXH_PRIME64_1; + acc.high64 = 0; + +#if XXH_SIZE_OPT >= 1 + { + /* Smaller, but slightly slower. */ + unsigned int i = (unsigned int)(len - 1) / 32; + do { + acc = XXH128_mix32B(acc, input+16*i, input+len-16*(i+1), secret+32*i, seed); + } while (i-- != 0); + } +#else + if (len > 32) { + if (len > 64) { + if (len > 96) { + acc = XXH128_mix32B(acc, input+48, input+len-64, secret+96, seed); + } + acc = XXH128_mix32B(acc, input+32, input+len-48, secret+64, seed); + } + acc = XXH128_mix32B(acc, input+16, input+len-32, secret+32, seed); + } + acc = XXH128_mix32B(acc, input, input+len-16, secret, seed); +#endif + { XXH128_hash_t h128; + h128.low64 = acc.low64 + acc.high64; + h128.high64 = (acc.low64 * XXH_PRIME64_1) + + (acc.high64 * XXH_PRIME64_4) + + ((len - seed) * XXH_PRIME64_2); + h128.low64 = XXH3_avalanche(h128.low64); + h128.high64 = (XXH64_hash_t)0 - XXH3_avalanche(h128.high64); + return h128; + } + } +} + +XXH_NO_INLINE XXH_PUREF XXH128_hash_t +XXH3_len_129to240_128b(const xxh_u8* XXH_RESTRICT input, size_t len, + const xxh_u8* XXH_RESTRICT secret, size_t secretSize, + XXH64_hash_t seed) +{ + XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); (void)secretSize; + XXH_ASSERT(128 < len && len <= XXH3_MIDSIZE_MAX); + + { XXH128_hash_t acc; + unsigned i; + acc.low64 = len * XXH_PRIME64_1; + acc.high64 = 0; + /* + * We set as `i` as offset + 32. We do this so that unchanged + * `len` can be used as upper bound. This reaches a sweet spot + * where both x86 and aarch64 get simple agen and good codegen + * for the loop. + */ + for (i = 32; i < 160; i += 32) { + acc = XXH128_mix32B(acc, + input + i - 32, + input + i - 16, + secret + i - 32, + seed); + } + acc.low64 = XXH3_avalanche(acc.low64); + acc.high64 = XXH3_avalanche(acc.high64); + /* + * NB: `i <= len` will duplicate the last 32-bytes if + * len % 32 was zero. This is an unfortunate necessity to keep + * the hash result stable. + */ + for (i=160; i <= len; i += 32) { + acc = XXH128_mix32B(acc, + input + i - 32, + input + i - 16, + secret + XXH3_MIDSIZE_STARTOFFSET + i - 160, + seed); + } + /* last bytes */ + acc = XXH128_mix32B(acc, + input + len - 16, + input + len - 32, + secret + XXH3_SECRET_SIZE_MIN - XXH3_MIDSIZE_LASTOFFSET - 16, + (XXH64_hash_t)0 - seed); + + { XXH128_hash_t h128; + h128.low64 = acc.low64 + acc.high64; + h128.high64 = (acc.low64 * XXH_PRIME64_1) + + (acc.high64 * XXH_PRIME64_4) + + ((len - seed) * XXH_PRIME64_2); + h128.low64 = XXH3_avalanche(h128.low64); + h128.high64 = (XXH64_hash_t)0 - XXH3_avalanche(h128.high64); + return h128; + } + } +} + +XXH_FORCE_INLINE XXH128_hash_t +XXH3_hashLong_128b_internal(const void* XXH_RESTRICT input, size_t len, + const xxh_u8* XXH_RESTRICT secret, size_t secretSize, + XXH3_f_accumulate f_acc, + XXH3_f_scrambleAcc f_scramble) +{ + XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64 acc[XXH_ACC_NB] = XXH3_INIT_ACC; + + XXH3_hashLong_internal_loop(acc, (const xxh_u8*)input, len, secret, secretSize, f_acc, f_scramble); + + /* converge into final hash */ + XXH_STATIC_ASSERT(sizeof(acc) == 64); + XXH_ASSERT(secretSize >= sizeof(acc) + XXH_SECRET_MERGEACCS_START); + { XXH128_hash_t h128; + h128.low64 = XXH3_mergeAccs(acc, + secret + XXH_SECRET_MERGEACCS_START, + (xxh_u64)len * XXH_PRIME64_1); + h128.high64 = XXH3_mergeAccs(acc, + secret + secretSize + - sizeof(acc) - XXH_SECRET_MERGEACCS_START, + ~((xxh_u64)len * XXH_PRIME64_2)); + return h128; + } +} + +/* + * It's important for performance that XXH3_hashLong() is not inlined. + */ +XXH_NO_INLINE XXH_PUREF XXH128_hash_t +XXH3_hashLong_128b_default(const void* XXH_RESTRICT input, size_t len, + XXH64_hash_t seed64, + const void* XXH_RESTRICT secret, size_t secretLen) +{ + (void)seed64; (void)secret; (void)secretLen; + return XXH3_hashLong_128b_internal(input, len, XXH3_kSecret, sizeof(XXH3_kSecret), + XXH3_accumulate, XXH3_scrambleAcc); +} + +/* + * It's important for performance to pass @p secretLen (when it's static) + * to the compiler, so that it can properly optimize the vectorized loop. + * + * When the secret size is unknown, or on GCC 12 where the mix of NO_INLINE and FORCE_INLINE + * breaks -Og, this is XXH_NO_INLINE. + */ +XXH3_WITH_SECRET_INLINE XXH128_hash_t +XXH3_hashLong_128b_withSecret(const void* XXH_RESTRICT input, size_t len, + XXH64_hash_t seed64, + const void* XXH_RESTRICT secret, size_t secretLen) +{ + (void)seed64; + return XXH3_hashLong_128b_internal(input, len, (const xxh_u8*)secret, secretLen, + XXH3_accumulate, XXH3_scrambleAcc); +} + +XXH_FORCE_INLINE XXH128_hash_t +XXH3_hashLong_128b_withSeed_internal(const void* XXH_RESTRICT input, size_t len, + XXH64_hash_t seed64, + XXH3_f_accumulate f_acc, + XXH3_f_scrambleAcc f_scramble, + XXH3_f_initCustomSecret f_initSec) +{ + if (seed64 == 0) + return XXH3_hashLong_128b_internal(input, len, + XXH3_kSecret, sizeof(XXH3_kSecret), + f_acc, f_scramble); + { XXH_ALIGN(XXH_SEC_ALIGN) xxh_u8 secret[XXH_SECRET_DEFAULT_SIZE]; + f_initSec(secret, seed64); + return XXH3_hashLong_128b_internal(input, len, (const xxh_u8*)secret, sizeof(secret), + f_acc, f_scramble); + } +} + +/* + * It's important for performance that XXH3_hashLong is not inlined. + */ +XXH_NO_INLINE XXH128_hash_t +XXH3_hashLong_128b_withSeed(const void* input, size_t len, + XXH64_hash_t seed64, const void* XXH_RESTRICT secret, size_t secretLen) +{ + (void)secret; (void)secretLen; + return XXH3_hashLong_128b_withSeed_internal(input, len, seed64, + XXH3_accumulate, XXH3_scrambleAcc, XXH3_initCustomSecret); +} + +typedef XXH128_hash_t (*XXH3_hashLong128_f)(const void* XXH_RESTRICT, size_t, + XXH64_hash_t, const void* XXH_RESTRICT, size_t); + +XXH_FORCE_INLINE XXH128_hash_t +XXH3_128bits_internal(const void* input, size_t len, + XXH64_hash_t seed64, const void* XXH_RESTRICT secret, size_t secretLen, + XXH3_hashLong128_f f_hl128) +{ + XXH_ASSERT(secretLen >= XXH3_SECRET_SIZE_MIN); + /* + * If an action is to be taken if `secret` conditions are not respected, + * it should be done here. + * For now, it's a contract pre-condition. + * Adding a check and a branch here would cost performance at every hash. + */ + if (len <= 16) + return XXH3_len_0to16_128b((const xxh_u8*)input, len, (const xxh_u8*)secret, seed64); + if (len <= 128) + return XXH3_len_17to128_128b((const xxh_u8*)input, len, (const xxh_u8*)secret, secretLen, seed64); + if (len <= XXH3_MIDSIZE_MAX) + return XXH3_len_129to240_128b((const xxh_u8*)input, len, (const xxh_u8*)secret, secretLen, seed64); + return f_hl128(input, len, seed64, secret, secretLen); +} + + +/* === Public XXH128 API === */ + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH128_hash_t XXH3_128bits(XXH_NOESCAPE const void* input, size_t len) +{ + return XXH3_128bits_internal(input, len, 0, + XXH3_kSecret, sizeof(XXH3_kSecret), + XXH3_hashLong_128b_default); +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH128_hash_t +XXH3_128bits_withSecret(XXH_NOESCAPE const void* input, size_t len, XXH_NOESCAPE const void* secret, size_t secretSize) +{ + return XXH3_128bits_internal(input, len, 0, + (const xxh_u8*)secret, secretSize, + XXH3_hashLong_128b_withSecret); +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH128_hash_t +XXH3_128bits_withSeed(XXH_NOESCAPE const void* input, size_t len, XXH64_hash_t seed) +{ + return XXH3_128bits_internal(input, len, seed, + XXH3_kSecret, sizeof(XXH3_kSecret), + XXH3_hashLong_128b_withSeed); +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH128_hash_t +XXH3_128bits_withSecretandSeed(XXH_NOESCAPE const void* input, size_t len, XXH_NOESCAPE const void* secret, size_t secretSize, XXH64_hash_t seed) +{ + if (len <= XXH3_MIDSIZE_MAX) + return XXH3_128bits_internal(input, len, seed, XXH3_kSecret, sizeof(XXH3_kSecret), NULL); + return XXH3_hashLong_128b_withSecret(input, len, seed, secret, secretSize); +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH128_hash_t +XXH128(XXH_NOESCAPE const void* input, size_t len, XXH64_hash_t seed) +{ + return XXH3_128bits_withSeed(input, len, seed); +} + + +/* === XXH3 128-bit streaming === */ +#ifndef XXH_NO_STREAM +/* + * All initialization and update functions are identical to 64-bit streaming variant. + * The only difference is the finalization routine. + */ + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH_errorcode +XXH3_128bits_reset(XXH_NOESCAPE XXH3_state_t* statePtr) +{ + return XXH3_64bits_reset(statePtr); +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH_errorcode +XXH3_128bits_reset_withSecret(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize) +{ + return XXH3_64bits_reset_withSecret(statePtr, secret, secretSize); +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH_errorcode +XXH3_128bits_reset_withSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH64_hash_t seed) +{ + return XXH3_64bits_reset_withSeed(statePtr, seed); +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH_errorcode +XXH3_128bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize, XXH64_hash_t seed) +{ + return XXH3_64bits_reset_withSecretandSeed(statePtr, secret, secretSize, seed); +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH_errorcode +XXH3_128bits_update(XXH_NOESCAPE XXH3_state_t* state, XXH_NOESCAPE const void* input, size_t len) +{ + return XXH3_64bits_update(state, input, len); +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_digest (XXH_NOESCAPE const XXH3_state_t* state) +{ + const unsigned char* const secret = (state->extSecret == NULL) ? state->customSecret : state->extSecret; + if (state->totalLen > XXH3_MIDSIZE_MAX) { + XXH_ALIGN(XXH_ACC_ALIGN) XXH64_hash_t acc[XXH_ACC_NB]; + XXH3_digest_long(acc, state, secret); + XXH_ASSERT(state->secretLimit + XXH_STRIPE_LEN >= sizeof(acc) + XXH_SECRET_MERGEACCS_START); + { XXH128_hash_t h128; + h128.low64 = XXH3_mergeAccs(acc, + secret + XXH_SECRET_MERGEACCS_START, + (xxh_u64)state->totalLen * XXH_PRIME64_1); + h128.high64 = XXH3_mergeAccs(acc, + secret + state->secretLimit + XXH_STRIPE_LEN + - sizeof(acc) - XXH_SECRET_MERGEACCS_START, + ~((xxh_u64)state->totalLen * XXH_PRIME64_2)); + return h128; + } + } + /* len <= XXH3_MIDSIZE_MAX : short code */ + if (state->seed) + return XXH3_128bits_withSeed(state->buffer, (size_t)state->totalLen, state->seed); + return XXH3_128bits_withSecret(state->buffer, (size_t)(state->totalLen), + secret, state->secretLimit + XXH_STRIPE_LEN); +} +#endif /* !XXH_NO_STREAM */ +/* 128-bit utility functions */ + +#include <string.h> /* memcmp, memcpy */ + +/* return : 1 is equal, 0 if different */ +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API int XXH128_isEqual(XXH128_hash_t h1, XXH128_hash_t h2) +{ + /* note : XXH128_hash_t is compact, it has no padding byte */ + return !(memcmp(&h1, &h2, sizeof(h1))); +} + +/* This prototype is compatible with stdlib's qsort(). + * @return : >0 if *h128_1 > *h128_2 + * <0 if *h128_1 < *h128_2 + * =0 if *h128_1 == *h128_2 */ +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API int XXH128_cmp(XXH_NOESCAPE const void* h128_1, XXH_NOESCAPE const void* h128_2) +{ + XXH128_hash_t const h1 = *(const XXH128_hash_t*)h128_1; + XXH128_hash_t const h2 = *(const XXH128_hash_t*)h128_2; + int const hcmp = (h1.high64 > h2.high64) - (h2.high64 > h1.high64); + /* note : bets that, in most cases, hash values are different */ + if (hcmp) return hcmp; + return (h1.low64 > h2.low64) - (h2.low64 > h1.low64); +} + + +/*====== Canonical representation ======*/ +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API void +XXH128_canonicalFromHash(XXH_NOESCAPE XXH128_canonical_t* dst, XXH128_hash_t hash) +{ + XXH_STATIC_ASSERT(sizeof(XXH128_canonical_t) == sizeof(XXH128_hash_t)); + if (XXH_CPU_LITTLE_ENDIAN) { + hash.high64 = XXH_swap64(hash.high64); + hash.low64 = XXH_swap64(hash.low64); + } + XXH_memcpy(dst, &hash.high64, sizeof(hash.high64)); + XXH_memcpy((char*)dst + sizeof(hash.high64), &hash.low64, sizeof(hash.low64)); +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH128_hash_t +XXH128_hashFromCanonical(XXH_NOESCAPE const XXH128_canonical_t* src) +{ + XXH128_hash_t h; + h.high64 = XXH_readBE64(src); + h.low64 = XXH_readBE64(src->digest + 8); + return h; +} + + + +/* ========================================== + * Secret generators + * ========================================== + */ +#define XXH_MIN(x, y) (((x) > (y)) ? (y) : (x)) + +XXH_FORCE_INLINE void XXH3_combine16(void* dst, XXH128_hash_t h128) +{ + XXH_writeLE64( dst, XXH_readLE64(dst) ^ h128.low64 ); + XXH_writeLE64( (char*)dst+8, XXH_readLE64((char*)dst+8) ^ h128.high64 ); +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API XXH_errorcode +XXH3_generateSecret(XXH_NOESCAPE void* secretBuffer, size_t secretSize, XXH_NOESCAPE const void* customSeed, size_t customSeedSize) +{ +#if (XXH_DEBUGLEVEL >= 1) + XXH_ASSERT(secretBuffer != NULL); + XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); +#else + /* production mode, assert() are disabled */ + if (secretBuffer == NULL) return XXH_ERROR; + if (secretSize < XXH3_SECRET_SIZE_MIN) return XXH_ERROR; +#endif + + if (customSeedSize == 0) { + customSeed = XXH3_kSecret; + customSeedSize = XXH_SECRET_DEFAULT_SIZE; + } +#if (XXH_DEBUGLEVEL >= 1) + XXH_ASSERT(customSeed != NULL); +#else + if (customSeed == NULL) return XXH_ERROR; +#endif + + /* Fill secretBuffer with a copy of customSeed - repeat as needed */ + { size_t pos = 0; + while (pos < secretSize) { + size_t const toCopy = XXH_MIN((secretSize - pos), customSeedSize); + memcpy((char*)secretBuffer + pos, customSeed, toCopy); + pos += toCopy; + } } + + { size_t const nbSeg16 = secretSize / 16; + size_t n; + XXH128_canonical_t scrambler; + XXH128_canonicalFromHash(&scrambler, XXH128(customSeed, customSeedSize, 0)); + for (n=0; n<nbSeg16; n++) { + XXH128_hash_t const h128 = XXH128(&scrambler, sizeof(scrambler), n); + XXH3_combine16((char*)secretBuffer + n*16, h128); + } + /* last segment */ + XXH3_combine16((char*)secretBuffer + secretSize - 16, XXH128_hashFromCanonical(&scrambler)); + } + return XXH_OK; +} + +/*! @ingroup XXH3_family */ +XXH_PUBLIC_API void +XXH3_generateSecret_fromSeed(XXH_NOESCAPE void* secretBuffer, XXH64_hash_t seed) +{ + XXH_ALIGN(XXH_SEC_ALIGN) xxh_u8 secret[XXH_SECRET_DEFAULT_SIZE]; + XXH3_initCustomSecret(secret, seed); + XXH_ASSERT(secretBuffer != NULL); + memcpy(secretBuffer, secret, XXH_SECRET_DEFAULT_SIZE); +} + + + +/* Pop our optimization override from above */ +#if XXH_VECTOR == XXH_AVX2 /* AVX2 */ \ + && defined(__GNUC__) && !defined(__clang__) /* GCC, not Clang */ \ + && defined(__OPTIMIZE__) && XXH_SIZE_OPT <= 0 /* respect -O0 and -Os */ +# pragma GCC pop_options +#endif + +#endif /* XXH_NO_LONG_LONG */ + +#endif /* XXH_NO_XXH3 */ + +/*! + * @} + */ +#endif /* XXH_IMPLEMENTATION */ + + +#if defined (__cplusplus) +} /* extern "C" */ +#endif diff --git a/src/bled/xz_dec_lzma2.c b/src/bled/xz_dec_lzma2.c index a6911db8..7d936a83 100644 --- a/src/bled/xz_dec_lzma2.c +++ b/src/bled/xz_dec_lzma2.c @@ -10,7 +10,6 @@ #include "xz_private.h" #include "xz_lzma2.h" -#include <assert.h> /* * Range decoder initialization eats the first five bytes of each LZMA chunk. @@ -623,7 +622,7 @@ static void XZ_FUNC lzma_len(struct xz_dec_lzma2 *s, struct lzma_len_dec *l, uint32_t pos_state) { uint16_t *probs; - uint32_t limit, v; + uint32_t limit; if (!rc_bit(&s->rc, &l->choice)) { probs = l->low[pos_state]; @@ -642,9 +641,7 @@ static void XZ_FUNC lzma_len(struct xz_dec_lzma2 *s, struct lzma_len_dec *l, } } - v = s->lzma.len + rc_bittree(&s->rc, probs, limit) - limit; - assert(v >= s->lzma.len); - s->lzma.len = (v < s->lzma.len) ? 0 : v; + s->lzma.len += rc_bittree(&s->rc, probs, limit) - limit; } /* Decode a match. The distance will be stored in s->lzma.rep0. */ @@ -663,7 +660,6 @@ static void XZ_FUNC lzma_match(struct xz_dec_lzma2 *s, uint32_t pos_state) lzma_len(s, &s->lzma.match_len_dec, pos_state); probs = s->lzma.dist_slot[lzma_get_dist_state(s->lzma.len)]; - // coverity[overflow_const] dist_slot = rc_bittree(&s->rc, probs, DIST_SLOTS) - DIST_SLOTS; if (dist_slot < DIST_MODEL_START) { diff --git a/src/bled/zstd.h b/src/bled/zstd.h index 858d434a..9a7b3f53 100644 --- a/src/bled/zstd.h +++ b/src/bled/zstd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the @@ -7,19 +7,130 @@ * in the COPYING file in the root directory of this source tree). * You may select, at your option, one of the above-listed licenses. */ +#if defined (__cplusplus) +extern "C" { +#endif #ifndef ZSTD_H_235446 #define ZSTD_H_235446 -/* ====== Dependency ======*/ -#include <limits.h> /* INT_MAX */ +/* ====== Dependencies ======*/ #include <stddef.h> /* size_t */ #include "zstd_config.h" - /* ===== ZSTDLIB_API : control library symbols visibility ===== */ -#define ZSTDLIB_VISIBILITY -#define ZSTDLIB_API ZSTDLIB_VISIBILITY +#ifndef ZSTDLIB_VISIBLE + /* Backwards compatibility with old macro name */ +# ifdef ZSTDLIB_VISIBILITY +# define ZSTDLIB_VISIBLE ZSTDLIB_VISIBILITY +# elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__) +# define ZSTDLIB_VISIBLE __attribute__ ((visibility ("default"))) +# else +# define ZSTDLIB_VISIBLE +# endif +#endif + +#ifndef ZSTDLIB_HIDDEN +# if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__) +# define ZSTDLIB_HIDDEN __attribute__ ((visibility ("hidden"))) +# else +# define ZSTDLIB_HIDDEN +# endif +#endif + +#if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1) +# define ZSTDLIB_API __declspec(dllexport) ZSTDLIB_VISIBLE +#elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1) +# define ZSTDLIB_API __declspec(dllimport) ZSTDLIB_VISIBLE /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/ +#else +# define ZSTDLIB_API ZSTDLIB_VISIBLE +#endif + +/* Deprecation warnings : + * Should these warnings be a problem, it is generally possible to disable them, + * typically with -Wno-deprecated-declarations for gcc or _CRT_SECURE_NO_WARNINGS in Visual. + * Otherwise, it's also possible to define ZSTD_DISABLE_DEPRECATE_WARNINGS. + */ +#ifdef ZSTD_DISABLE_DEPRECATE_WARNINGS +# define ZSTD_DEPRECATED(message) /* disable deprecation warnings */ +#else +# if defined (__cplusplus) && (__cplusplus >= 201402) /* C++14 or greater */ +# define ZSTD_DEPRECATED(message) [[deprecated(message)]] +# elif (defined(GNUC) && (GNUC > 4 || (GNUC == 4 && GNUC_MINOR >= 5))) || defined(__clang__) || defined(__IAR_SYSTEMS_ICC__) +# define ZSTD_DEPRECATED(message) __attribute__((deprecated(message))) +# elif defined(__GNUC__) && (__GNUC__ >= 3) +# define ZSTD_DEPRECATED(message) __attribute__((deprecated)) +# elif defined(_MSC_VER) +# define ZSTD_DEPRECATED(message) __declspec(deprecated(message)) +# else +# pragma message("WARNING: You need to implement ZSTD_DEPRECATED for this compiler") +# define ZSTD_DEPRECATED(message) +# endif +#endif /* ZSTD_DISABLE_DEPRECATE_WARNINGS */ + + +/******************************************************************************* + Introduction + + zstd, short for Zstandard, is a fast lossless compression algorithm, targeting + real-time compression scenarios at zlib-level and better compression ratios. + The zstd compression library provides in-memory compression and decompression + functions. + + The library supports regular compression levels from 1 up to ZSTD_maxCLevel(), + which is currently 22. Levels >= 20, labeled `--ultra`, should be used with + caution, as they require more memory. The library also offers negative + compression levels, which extend the range of speed vs. ratio preferences. + The lower the level, the faster the speed (at the cost of compression). + + Compression can be done in: + - a single step (described as Simple API) + - a single step, reusing a context (described as Explicit context) + - unbounded multiple steps (described as Streaming compression) + + The compression ratio achievable on small data can be highly improved using + a dictionary. Dictionary compression can be performed in: + - a single step (described as Simple dictionary API) + - a single step, reusing a dictionary (described as Bulk-processing + dictionary API) + + Advanced experimental functions can be accessed using + `#define ZSTD_STATIC_LINKING_ONLY` before including zstd.h. + + Advanced experimental APIs should never be used with a dynamically-linked + library. They are not "stable"; their definitions or signatures may change in + the future. Only static linking is allowed. +*******************************************************************************/ + +/*------ Version ------*/ +#define ZSTD_VERSION_MAJOR 1 +#define ZSTD_VERSION_MINOR 5 +#define ZSTD_VERSION_RELEASE 7 +#define ZSTD_VERSION_NUMBER (ZSTD_VERSION_MAJOR *100*100 + ZSTD_VERSION_MINOR *100 + ZSTD_VERSION_RELEASE) + +/*! ZSTD_versionNumber() : + * Return runtime library version, the value is (MAJOR*100*100 + MINOR*100 + RELEASE). */ +ZSTDLIB_API unsigned ZSTD_versionNumber(void); + +#define ZSTD_LIB_VERSION ZSTD_VERSION_MAJOR.ZSTD_VERSION_MINOR.ZSTD_VERSION_RELEASE +#define ZSTD_QUOTE(str) #str +#define ZSTD_EXPAND_AND_QUOTE(str) ZSTD_QUOTE(str) +#define ZSTD_VERSION_STRING ZSTD_EXPAND_AND_QUOTE(ZSTD_LIB_VERSION) + +/*! ZSTD_versionString() : + * Return runtime library version, like "1.4.5". Requires v1.3.0+. */ +ZSTDLIB_API const char* ZSTD_versionString(void); + +/* ************************************* + * Default constant + ***************************************/ +#ifndef ZSTD_CLEVEL_DEFAULT +# define ZSTD_CLEVEL_DEFAULT 3 +#endif + +/* ************************************* + * Constants + ***************************************/ /* All magic numbers are supposed read/written to/from files/memory using little-endian convention */ #define ZSTD_MAGICNUMBER 0xFD2FB528 /* valid since v0.8.0 */ @@ -30,23 +141,553 @@ #define ZSTD_BLOCKSIZELOG_MAX 17 #define ZSTD_BLOCKSIZE_MAX (1<<ZSTD_BLOCKSIZELOG_MAX) + +/*************************************** +* Simple Core API +***************************************/ +/*! ZSTD_compress() : + * Compresses `src` content as a single zstd compressed frame into already allocated `dst`. + * NOTE: Providing `dstCapacity >= ZSTD_compressBound(srcSize)` guarantees that zstd will have + * enough space to successfully compress the data. + * @return : compressed size written into `dst` (<= `dstCapacity), + * or an error code if it fails (which can be tested using ZSTD_isError()). */ +ZSTDLIB_API size_t ZSTD_compress( void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + int compressionLevel); + +/*! ZSTD_decompress() : + * `compressedSize` : must be the _exact_ size of some number of compressed and/or skippable frames. + * Multiple compressed frames can be decompressed at once with this method. + * The result will be the concatenation of all decompressed frames, back to back. + * `dstCapacity` is an upper bound of originalSize to regenerate. + * First frame's decompressed size can be extracted using ZSTD_getFrameContentSize(). + * If maximum upper bound isn't known, prefer using streaming mode to decompress data. + * @return : the number of bytes decompressed into `dst` (<= `dstCapacity`), + * or an errorCode if it fails (which can be tested using ZSTD_isError()). */ +ZSTDLIB_API size_t ZSTD_decompress( void* dst, size_t dstCapacity, + const void* src, size_t compressedSize); + + +/*====== Decompression helper functions ======*/ + +/*! ZSTD_getFrameContentSize() : requires v1.3.0+ + * `src` should point to the start of a ZSTD encoded frame. + * `srcSize` must be at least as large as the frame header. + * hint : any size >= `ZSTD_frameHeaderSize_max` is large enough. + * @return : - decompressed size of `src` frame content, if known + * - ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined + * - ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small) + * note 1 : a 0 return value means the frame is valid but "empty". + * note 2 : decompressed size is an optional field, it may not be present (typically in streaming mode). + * When `return==ZSTD_CONTENTSIZE_UNKNOWN`, data to decompress could be any size. + * In which case, it's necessary to use streaming mode to decompress data. + * Optionally, application can rely on some implicit limit, + * as ZSTD_decompress() only needs an upper bound of decompressed size. + * (For example, data could be necessarily cut into blocks <= 16 KB). + * note 3 : decompressed size is always present when compression is completed using single-pass functions, + * such as ZSTD_compress(), ZSTD_compressCCtx() ZSTD_compress_usingDict() or ZSTD_compress_usingCDict(). + * note 4 : decompressed size can be very large (64-bits value), + * potentially larger than what local system can handle as a single memory segment. + * In which case, it's necessary to use streaming mode to decompress data. + * note 5 : If source is untrusted, decompressed size could be wrong or intentionally modified. + * Always ensure return value fits within application's authorized limits. + * Each application can set its own limits. + * note 6 : This function replaces ZSTD_getDecompressedSize() */ #define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1) #define ZSTD_CONTENTSIZE_ERROR (0ULL - 2) ZSTDLIB_API unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize); -ZSTDLIB_API unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize); +/*! ZSTD_getDecompressedSize() : + * NOTE: This function is now obsolete, in favor of ZSTD_getFrameContentSize(). + * Both functions work the same way, but ZSTD_getDecompressedSize() blends + * "empty", "unknown" and "error" results to the same return value (0), + * while ZSTD_getFrameContentSize() gives them separate return values. + * @return : decompressed size of `src` frame content _if known and not empty_, 0 otherwise. */ +ZSTD_DEPRECATED("Replaced by ZSTD_getFrameContentSize") +ZSTDLIB_API +unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize); + +/*! ZSTD_findFrameCompressedSize() : Requires v1.4.0+ + * `src` should point to the start of a ZSTD frame or skippable frame. + * `srcSize` must be >= first frame size + * @return : the compressed size of the first frame starting at `src`, + * suitable to pass as `srcSize` to `ZSTD_decompress` or similar, + * or an error code if input is invalid */ +ZSTDLIB_API size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize); + + +/*====== Compression helper functions ======*/ + +/*! ZSTD_compressBound() : + * maximum compressed size in worst case single-pass scenario. + * When invoking `ZSTD_compress()`, or any other one-pass compression function, + * it's recommended to provide @dstCapacity >= ZSTD_compressBound(srcSize) + * as it eliminates one potential failure scenario, + * aka not enough room in dst buffer to write the compressed frame. + * Note : ZSTD_compressBound() itself can fail, if @srcSize > ZSTD_MAX_INPUT_SIZE . + * In which case, ZSTD_compressBound() will return an error code + * which can be tested using ZSTD_isError(). + * + * ZSTD_COMPRESSBOUND() : + * same as ZSTD_compressBound(), but as a macro. + * It can be used to produce constants, which can be useful for static allocation, + * for example to size a static array on stack. + * Will produce constant value 0 if srcSize is too large. + */ +#define ZSTD_MAX_INPUT_SIZE ((sizeof(size_t)==8) ? 0xFF00FF00FF00FF00ULL : 0xFF00FF00U) +#define ZSTD_COMPRESSBOUND(srcSize) (((size_t)(srcSize) >= ZSTD_MAX_INPUT_SIZE) ? 0 : (srcSize) + ((srcSize)>>8) + (((srcSize) < (128<<10)) ? (((128<<10) - (srcSize)) >> 11) /* margin, from 64 to 0 */ : 0)) /* this formula ensures that bound(A) + bound(B) <= bound(A+B) as long as A and B >= 128 KB */ +ZSTDLIB_API size_t ZSTD_compressBound(size_t srcSize); /*!< maximum compressed size in worst case single-pass scenario */ + + +/*====== Error helper functions ======*/ +#include "zstd_errors.h" /* list of errors */ +/* ZSTD_isError() : + * Most ZSTD_* functions returning a size_t value can be tested for error, + * using ZSTD_isError(). + * @return 1 if error, 0 otherwise + */ +ZSTDLIB_API unsigned ZSTD_isError(size_t result); /*!< tells if a `size_t` function result is an error code */ +ZSTDLIB_API ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult); /* convert a result into an error code, which can be compared to error enum list */ +ZSTDLIB_API const char* ZSTD_getErrorName(size_t result); /*!< provides readable string from a function result */ +ZSTDLIB_API int ZSTD_minCLevel(void); /*!< minimum negative compression level allowed, requires v1.4.0+ */ +ZSTDLIB_API int ZSTD_maxCLevel(void); /*!< maximum compression level available */ +ZSTDLIB_API int ZSTD_defaultCLevel(void); /*!< default compression level, specified by ZSTD_CLEVEL_DEFAULT, requires v1.5.0+ */ + + +/*************************************** +* Explicit context +***************************************/ +/*= Compression context + * When compressing many times, + * it is recommended to allocate a compression context just once, + * and reuse it for each successive compression operation. + * This will make the workload easier for system's memory. + * Note : re-using context is just a speed / resource optimization. + * It doesn't change the compression ratio, which remains identical. + * Note 2: For parallel execution in multi-threaded environments, + * use one different context per thread . + */ typedef struct ZSTD_CCtx_s ZSTD_CCtx; +ZSTDLIB_API ZSTD_CCtx* ZSTD_createCCtx(void); +ZSTDLIB_API size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx); /* compatible with NULL pointer */ + +/*! ZSTD_compressCCtx() : + * Same as ZSTD_compress(), using an explicit ZSTD_CCtx. + * Important : in order to mirror `ZSTD_compress()` behavior, + * this function compresses at the requested compression level, + * __ignoring any other advanced parameter__ . + * If any advanced parameter was set using the advanced API, + * they will all be reset. Only @compressionLevel remains. + */ +ZSTDLIB_API size_t ZSTD_compressCCtx(ZSTD_CCtx* cctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + int compressionLevel); + +/*= Decompression context + * When decompressing many times, + * it is recommended to allocate a context only once, + * and reuse it for each successive compression operation. + * This will make workload friendlier for system's memory. + * Use one context per thread for parallel execution. */ typedef struct ZSTD_DCtx_s ZSTD_DCtx; ZSTDLIB_API ZSTD_DCtx* ZSTD_createDCtx(void); ZSTDLIB_API size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx); /* accept NULL pointer */ +/*! ZSTD_decompressDCtx() : + * Same as ZSTD_decompress(), + * requires an allocated ZSTD_DCtx. + * Compatible with sticky parameters (see below). + */ +ZSTDLIB_API size_t ZSTD_decompressDCtx(ZSTD_DCtx* dctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize); + + +/********************************************* +* Advanced compression API (Requires v1.4.0+) +**********************************************/ + +/* API design : + * Parameters are pushed one by one into an existing context, + * using ZSTD_CCtx_set*() functions. + * Pushed parameters are sticky : they are valid for next compressed frame, and any subsequent frame. + * "sticky" parameters are applicable to `ZSTD_compress2()` and `ZSTD_compressStream*()` ! + * __They do not apply to one-shot variants such as ZSTD_compressCCtx()__ . + * + * It's possible to reset all parameters to "default" using ZSTD_CCtx_reset(). + * + * This API supersedes all other "advanced" API entry points in the experimental section. + * In the future, we expect to remove API entry points from experimental which are redundant with this API. + */ + + +/* Compression strategies, listed from fastest to strongest */ +typedef enum { ZSTD_fast=1, + ZSTD_dfast=2, + ZSTD_greedy=3, + ZSTD_lazy=4, + ZSTD_lazy2=5, + ZSTD_btlazy2=6, + ZSTD_btopt=7, + ZSTD_btultra=8, + ZSTD_btultra2=9 + /* note : new strategies _might_ be added in the future. + Only the order (from fast to strong) is guaranteed */ +} ZSTD_strategy; + +typedef enum { + + /* compression parameters + * Note: When compressing with a ZSTD_CDict these parameters are superseded + * by the parameters used to construct the ZSTD_CDict. + * See ZSTD_CCtx_refCDict() for more info (superseded-by-cdict). */ + ZSTD_c_compressionLevel=100, /* Set compression parameters according to pre-defined cLevel table. + * Note that exact compression parameters are dynamically determined, + * depending on both compression level and srcSize (when known). + * Default level is ZSTD_CLEVEL_DEFAULT==3. + * Special: value 0 means default, which is controlled by ZSTD_CLEVEL_DEFAULT. + * Note 1 : it's possible to pass a negative compression level. + * Note 2 : setting a level does not automatically set all other compression parameters + * to default. Setting this will however eventually dynamically impact the compression + * parameters which have not been manually set. The manually set + * ones will 'stick'. */ + /* Advanced compression parameters : + * It's possible to pin down compression parameters to some specific values. + * In which case, these values are no longer dynamically selected by the compressor */ + ZSTD_c_windowLog=101, /* Maximum allowed back-reference distance, expressed as power of 2. + * This will set a memory budget for streaming decompression, + * with larger values requiring more memory + * and typically compressing more. + * Must be clamped between ZSTD_WINDOWLOG_MIN and ZSTD_WINDOWLOG_MAX. + * Special: value 0 means "use default windowLog". + * Note: Using a windowLog greater than ZSTD_WINDOWLOG_LIMIT_DEFAULT + * requires explicitly allowing such size at streaming decompression stage. */ + ZSTD_c_hashLog=102, /* Size of the initial probe table, as a power of 2. + * Resulting memory usage is (1 << (hashLog+2)). + * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX. + * Larger tables improve compression ratio of strategies <= dFast, + * and improve speed of strategies > dFast. + * Special: value 0 means "use default hashLog". */ + ZSTD_c_chainLog=103, /* Size of the multi-probe search table, as a power of 2. + * Resulting memory usage is (1 << (chainLog+2)). + * Must be clamped between ZSTD_CHAINLOG_MIN and ZSTD_CHAINLOG_MAX. + * Larger tables result in better and slower compression. + * This parameter is useless for "fast" strategy. + * It's still useful when using "dfast" strategy, + * in which case it defines a secondary probe table. + * Special: value 0 means "use default chainLog". */ + ZSTD_c_searchLog=104, /* Number of search attempts, as a power of 2. + * More attempts result in better and slower compression. + * This parameter is useless for "fast" and "dFast" strategies. + * Special: value 0 means "use default searchLog". */ + ZSTD_c_minMatch=105, /* Minimum size of searched matches. + * Note that Zstandard can still find matches of smaller size, + * it just tweaks its search algorithm to look for this size and larger. + * Larger values increase compression and decompression speed, but decrease ratio. + * Must be clamped between ZSTD_MINMATCH_MIN and ZSTD_MINMATCH_MAX. + * Note that currently, for all strategies < btopt, effective minimum is 4. + * , for all strategies > fast, effective maximum is 6. + * Special: value 0 means "use default minMatchLength". */ + ZSTD_c_targetLength=106, /* Impact of this field depends on strategy. + * For strategies btopt, btultra & btultra2: + * Length of Match considered "good enough" to stop search. + * Larger values make compression stronger, and slower. + * For strategy fast: + * Distance between match sampling. + * Larger values make compression faster, and weaker. + * Special: value 0 means "use default targetLength". */ + ZSTD_c_strategy=107, /* See ZSTD_strategy enum definition. + * The higher the value of selected strategy, the more complex it is, + * resulting in stronger and slower compression. + * Special: value 0 means "use default strategy". */ + + ZSTD_c_targetCBlockSize=130, /* v1.5.6+ + * Attempts to fit compressed block size into approximately targetCBlockSize. + * Bound by ZSTD_TARGETCBLOCKSIZE_MIN and ZSTD_TARGETCBLOCKSIZE_MAX. + * Note that it's not a guarantee, just a convergence target (default:0). + * No target when targetCBlockSize == 0. + * This is helpful in low bandwidth streaming environments to improve end-to-end latency, + * when a client can make use of partial documents (a prominent example being Chrome). + * Note: this parameter is stable since v1.5.6. + * It was present as an experimental parameter in earlier versions, + * but it's not recommended using it with earlier library versions + * due to massive performance regressions. + */ + /* LDM mode parameters */ + ZSTD_c_enableLongDistanceMatching=160, /* Enable long distance matching. + * This parameter is designed to improve compression ratio + * for large inputs, by finding large matches at long distance. + * It increases memory usage and window size. + * Note: enabling this parameter increases default ZSTD_c_windowLog to 128 MB + * except when expressly set to a different value. + * Note: will be enabled by default if ZSTD_c_windowLog >= 128 MB and + * compression strategy >= ZSTD_btopt (== compression level 16+) */ + ZSTD_c_ldmHashLog=161, /* Size of the table for long distance matching, as a power of 2. + * Larger values increase memory usage and compression ratio, + * but decrease compression speed. + * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX + * default: windowlog - 7. + * Special: value 0 means "automatically determine hashlog". */ + ZSTD_c_ldmMinMatch=162, /* Minimum match size for long distance matcher. + * Larger/too small values usually decrease compression ratio. + * Must be clamped between ZSTD_LDM_MINMATCH_MIN and ZSTD_LDM_MINMATCH_MAX. + * Special: value 0 means "use default value" (default: 64). */ + ZSTD_c_ldmBucketSizeLog=163, /* Log size of each bucket in the LDM hash table for collision resolution. + * Larger values improve collision resolution but decrease compression speed. + * The maximum value is ZSTD_LDM_BUCKETSIZELOG_MAX. + * Special: value 0 means "use default value" (default: 3). */ + ZSTD_c_ldmHashRateLog=164, /* Frequency of inserting/looking up entries into the LDM hash table. + * Must be clamped between 0 and (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN). + * Default is MAX(0, (windowLog - ldmHashLog)), optimizing hash table usage. + * Larger values improve compression speed. + * Deviating far from default value will likely result in a compression ratio decrease. + * Special: value 0 means "automatically determine hashRateLog". */ + + /* frame parameters */ + ZSTD_c_contentSizeFlag=200, /* Content size will be written into frame header _whenever known_ (default:1) + * Content size must be known at the beginning of compression. + * This is automatically the case when using ZSTD_compress2(), + * For streaming scenarios, content size must be provided with ZSTD_CCtx_setPledgedSrcSize() */ + ZSTD_c_checksumFlag=201, /* A 32-bits checksum of content is written at end of frame (default:0) */ + ZSTD_c_dictIDFlag=202, /* When applicable, dictionary's ID is written into frame header (default:1) */ + + /* multi-threading parameters */ + /* These parameters are only active if multi-threading is enabled (compiled with build macro ZSTD_MULTITHREAD). + * Otherwise, trying to set any other value than default (0) will be a no-op and return an error. + * In a situation where it's unknown if the linked library supports multi-threading or not, + * setting ZSTD_c_nbWorkers to any value >= 1 and consulting the return value provides a quick way to check this property. + */ + ZSTD_c_nbWorkers=400, /* Select how many threads will be spawned to compress in parallel. + * When nbWorkers >= 1, triggers asynchronous mode when invoking ZSTD_compressStream*() : + * ZSTD_compressStream*() consumes input and flush output if possible, but immediately gives back control to caller, + * while compression is performed in parallel, within worker thread(s). + * (note : a strong exception to this rule is when first invocation of ZSTD_compressStream2() sets ZSTD_e_end : + * in which case, ZSTD_compressStream2() delegates to ZSTD_compress2(), which is always a blocking call). + * More workers improve speed, but also increase memory usage. + * Default value is `0`, aka "single-threaded mode" : no worker is spawned, + * compression is performed inside Caller's thread, and all invocations are blocking */ + ZSTD_c_jobSize=401, /* Size of a compression job. This value is enforced only when nbWorkers >= 1. + * Each compression job is completed in parallel, so this value can indirectly impact the nb of active threads. + * 0 means default, which is dynamically determined based on compression parameters. + * Job size must be a minimum of overlap size, or ZSTDMT_JOBSIZE_MIN (= 512 KB), whichever is largest. + * The minimum size is automatically and transparently enforced. */ + ZSTD_c_overlapLog=402, /* Control the overlap size, as a fraction of window size. + * The overlap size is an amount of data reloaded from previous job at the beginning of a new job. + * It helps preserve compression ratio, while each job is compressed in parallel. + * This value is enforced only when nbWorkers >= 1. + * Larger values increase compression ratio, but decrease speed. + * Possible values range from 0 to 9 : + * - 0 means "default" : value will be determined by the library, depending on strategy + * - 1 means "no overlap" + * - 9 means "full overlap", using a full window size. + * Each intermediate rank increases/decreases load size by a factor 2 : + * 9: full window; 8: w/2; 7: w/4; 6: w/8; 5:w/16; 4: w/32; 3:w/64; 2:w/128; 1:no overlap; 0:default + * default value varies between 6 and 9, depending on strategy */ + + /* note : additional experimental parameters are also available + * within the experimental section of the API. + * At the time of this writing, they include : + * ZSTD_c_rsyncable + * ZSTD_c_format + * ZSTD_c_forceMaxWindow + * ZSTD_c_forceAttachDict + * ZSTD_c_literalCompressionMode + * ZSTD_c_srcSizeHint + * ZSTD_c_enableDedicatedDictSearch + * ZSTD_c_stableInBuffer + * ZSTD_c_stableOutBuffer + * ZSTD_c_blockDelimiters + * ZSTD_c_validateSequences + * ZSTD_c_blockSplitterLevel + * ZSTD_c_splitAfterSequences + * ZSTD_c_useRowMatchFinder + * ZSTD_c_prefetchCDictTables + * ZSTD_c_enableSeqProducerFallback + * ZSTD_c_maxBlockSize + * Because they are not stable, it's necessary to define ZSTD_STATIC_LINKING_ONLY to access them. + * note : never ever use experimentalParam? names directly; + * also, the enums values themselves are unstable and can still change. + */ + ZSTD_c_experimentalParam1=500, + ZSTD_c_experimentalParam2=10, + ZSTD_c_experimentalParam3=1000, + ZSTD_c_experimentalParam4=1001, + ZSTD_c_experimentalParam5=1002, + /* was ZSTD_c_experimentalParam6=1003; is now ZSTD_c_targetCBlockSize */ + ZSTD_c_experimentalParam7=1004, + ZSTD_c_experimentalParam8=1005, + ZSTD_c_experimentalParam9=1006, + ZSTD_c_experimentalParam10=1007, + ZSTD_c_experimentalParam11=1008, + ZSTD_c_experimentalParam12=1009, + ZSTD_c_experimentalParam13=1010, + ZSTD_c_experimentalParam14=1011, + ZSTD_c_experimentalParam15=1012, + ZSTD_c_experimentalParam16=1013, + ZSTD_c_experimentalParam17=1014, + ZSTD_c_experimentalParam18=1015, + ZSTD_c_experimentalParam19=1016, + ZSTD_c_experimentalParam20=1017 +} ZSTD_cParameter; + +typedef struct { + size_t error; + int lowerBound; + int upperBound; +} ZSTD_bounds; + +/*! ZSTD_cParam_getBounds() : + * All parameters must belong to an interval with lower and upper bounds, + * otherwise they will either trigger an error or be automatically clamped. + * @return : a structure, ZSTD_bounds, which contains + * - an error status field, which must be tested using ZSTD_isError() + * - lower and upper bounds, both inclusive + */ +ZSTDLIB_API ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter cParam); + +/*! ZSTD_CCtx_setParameter() : + * Set one compression parameter, selected by enum ZSTD_cParameter. + * All parameters have valid bounds. Bounds can be queried using ZSTD_cParam_getBounds(). + * Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter). + * Setting a parameter is generally only possible during frame initialization (before starting compression). + * Exception : when using multi-threading mode (nbWorkers >= 1), + * the following parameters can be updated _during_ compression (within same frame): + * => compressionLevel, hashLog, chainLog, searchLog, minMatch, targetLength and strategy. + * new parameters will be active for next job only (after a flush()). + * @return : an error code (which can be tested using ZSTD_isError()). + */ +ZSTDLIB_API size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int value); + +/*! ZSTD_CCtx_setPledgedSrcSize() : + * Total input data size to be compressed as a single frame. + * Value will be written in frame header, unless if explicitly forbidden using ZSTD_c_contentSizeFlag. + * This value will also be controlled at end of frame, and trigger an error if not respected. + * @result : 0, or an error code (which can be tested with ZSTD_isError()). + * Note 1 : pledgedSrcSize==0 actually means zero, aka an empty frame. + * In order to mean "unknown content size", pass constant ZSTD_CONTENTSIZE_UNKNOWN. + * ZSTD_CONTENTSIZE_UNKNOWN is default value for any new frame. + * Note 2 : pledgedSrcSize is only valid once, for the next frame. + * It's discarded at the end of the frame, and replaced by ZSTD_CONTENTSIZE_UNKNOWN. + * Note 3 : Whenever all input data is provided and consumed in a single round, + * for example with ZSTD_compress2(), + * or invoking immediately ZSTD_compressStream2(,,,ZSTD_e_end), + * this value is automatically overridden by srcSize instead. + */ +ZSTDLIB_API size_t ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx* cctx, unsigned long long pledgedSrcSize); + typedef enum { ZSTD_reset_session_only = 1, ZSTD_reset_parameters = 2, ZSTD_reset_session_and_parameters = 3 } ZSTD_ResetDirective; + +/*! ZSTD_CCtx_reset() : + * There are 2 different things that can be reset, independently or jointly : + * - The session : will stop compressing current frame, and make CCtx ready to start a new one. + * Useful after an error, or to interrupt any ongoing compression. + * Any internal data not yet flushed is cancelled. + * Compression parameters and dictionary remain unchanged. + * They will be used to compress next frame. + * Resetting session never fails. + * - The parameters : changes all parameters back to "default". + * This also removes any reference to any dictionary or external sequence producer. + * Parameters can only be changed between 2 sessions (i.e. no compression is currently ongoing) + * otherwise the reset fails, and function returns an error value (which can be tested using ZSTD_isError()) + * - Both : similar to resetting the session, followed by resetting parameters. + */ +ZSTDLIB_API size_t ZSTD_CCtx_reset(ZSTD_CCtx* cctx, ZSTD_ResetDirective reset); + +/*! ZSTD_compress2() : + * Behave the same as ZSTD_compressCCtx(), but compression parameters are set using the advanced API. + * (note that this entry point doesn't even expose a compression level parameter). + * ZSTD_compress2() always starts a new frame. + * Should cctx hold data from a previously unfinished frame, everything about it is forgotten. + * - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*() + * - The function is always blocking, returns when compression is completed. + * NOTE: Providing `dstCapacity >= ZSTD_compressBound(srcSize)` guarantees that zstd will have + * enough space to successfully compress the data, though it is possible it fails for other reasons. + * @return : compressed size written into `dst` (<= `dstCapacity), + * or an error code if it fails (which can be tested using ZSTD_isError()). + */ +ZSTDLIB_API size_t ZSTD_compress2( ZSTD_CCtx* cctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize); + + +/*********************************************** +* Advanced decompression API (Requires v1.4.0+) +************************************************/ + +/* The advanced API pushes parameters one by one into an existing DCtx context. + * Parameters are sticky, and remain valid for all following frames + * using the same DCtx context. + * It's possible to reset parameters to default values using ZSTD_DCtx_reset(). + * Note : This API is compatible with existing ZSTD_decompressDCtx() and ZSTD_decompressStream(). + * Therefore, no new decompression function is necessary. + */ + +typedef enum { + + ZSTD_d_windowLogMax=100, /* Select a size limit (in power of 2) beyond which + * the streaming API will refuse to allocate memory buffer + * in order to protect the host from unreasonable memory requirements. + * This parameter is only useful in streaming mode, since no internal buffer is allocated in single-pass mode. + * By default, a decompression context accepts window sizes <= (1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT). + * Special: value 0 means "use default maximum windowLog". */ + + /* note : additional experimental parameters are also available + * within the experimental section of the API. + * At the time of this writing, they include : + * ZSTD_d_format + * ZSTD_d_stableOutBuffer + * ZSTD_d_forceIgnoreChecksum + * ZSTD_d_refMultipleDDicts + * ZSTD_d_disableHuffmanAssembly + * ZSTD_d_maxBlockSize + * Because they are not stable, it's necessary to define ZSTD_STATIC_LINKING_ONLY to access them. + * note : never ever use experimentalParam? names directly + */ + ZSTD_d_experimentalParam1=1000, + ZSTD_d_experimentalParam2=1001, + ZSTD_d_experimentalParam3=1002, + ZSTD_d_experimentalParam4=1003, + ZSTD_d_experimentalParam5=1004, + ZSTD_d_experimentalParam6=1005 + +} ZSTD_dParameter; + +/*! ZSTD_dParam_getBounds() : + * All parameters must belong to an interval with lower and upper bounds, + * otherwise they will either trigger an error or be automatically clamped. + * @return : a structure, ZSTD_bounds, which contains + * - an error status field, which must be tested using ZSTD_isError() + * - both lower and upper bounds, inclusive + */ +ZSTDLIB_API ZSTD_bounds ZSTD_dParam_getBounds(ZSTD_dParameter dParam); + +/*! ZSTD_DCtx_setParameter() : + * Set one compression parameter, selected by enum ZSTD_dParameter. + * All parameters have valid bounds. Bounds can be queried using ZSTD_dParam_getBounds(). + * Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter). + * Setting a parameter is only possible during frame initialization (before starting decompression). + * @return : 0, or an error code (which can be tested using ZSTD_isError()). + */ +ZSTDLIB_API size_t ZSTD_DCtx_setParameter(ZSTD_DCtx* dctx, ZSTD_dParameter param, int value); + +/*! ZSTD_DCtx_reset() : + * Return a DCtx to clean state. + * Session and parameters can be reset jointly or separately. + * Parameters can only be reset when no active frame is being decompressed. + * @return : 0, or an error code, which can be tested with ZSTD_isError() + */ ZSTDLIB_API size_t ZSTD_DCtx_reset(ZSTD_DCtx* dctx, ZSTD_ResetDirective reset); + +/**************************** +* Streaming +****************************/ + typedef struct ZSTD_inBuffer_s { const void* src; /**< start of input buffer */ size_t size; /**< size of input buffer */ @@ -59,22 +700,543 @@ typedef struct ZSTD_outBuffer_s { size_t pos; /**< position where writing stopped. Will be updated. Necessarily 0 <= pos <= size */ } ZSTD_outBuffer; + + +/*-*********************************************************************** +* Streaming compression - HowTo +* +* A ZSTD_CStream object is required to track streaming operation. +* Use ZSTD_createCStream() and ZSTD_freeCStream() to create/release resources. +* ZSTD_CStream objects can be reused multiple times on consecutive compression operations. +* It is recommended to reuse ZSTD_CStream since it will play nicer with system's memory, by re-using already allocated memory. +* +* For parallel execution, use one separate ZSTD_CStream per thread. +* +* note : since v1.3.0, ZSTD_CStream and ZSTD_CCtx are the same thing. +* +* Parameters are sticky : when starting a new compression on the same context, +* it will reuse the same sticky parameters as previous compression session. +* When in doubt, it's recommended to fully initialize the context before usage. +* Use ZSTD_CCtx_reset() to reset the context and ZSTD_CCtx_setParameter(), +* ZSTD_CCtx_setPledgedSrcSize(), or ZSTD_CCtx_loadDictionary() and friends to +* set more specific parameters, the pledged source size, or load a dictionary. +* +* Use ZSTD_compressStream2() with ZSTD_e_continue as many times as necessary to +* consume input stream. The function will automatically update both `pos` +* fields within `input` and `output`. +* Note that the function may not consume the entire input, for example, because +* the output buffer is already full, in which case `input.pos < input.size`. +* The caller must check if input has been entirely consumed. +* If not, the caller must make some room to receive more compressed data, +* and then present again remaining input data. +* note: ZSTD_e_continue is guaranteed to make some forward progress when called, +* but doesn't guarantee maximal forward progress. This is especially relevant +* when compressing with multiple threads. The call won't block if it can +* consume some input, but if it can't it will wait for some, but not all, +* output to be flushed. +* @return : provides a minimum amount of data remaining to be flushed from internal buffers +* or an error code, which can be tested using ZSTD_isError(). +* +* At any moment, it's possible to flush whatever data might remain stuck within internal buffer, +* using ZSTD_compressStream2() with ZSTD_e_flush. `output->pos` will be updated. +* Note that, if `output->size` is too small, a single invocation with ZSTD_e_flush might not be enough (return code > 0). +* In which case, make some room to receive more compressed data, and call again ZSTD_compressStream2() with ZSTD_e_flush. +* You must continue calling ZSTD_compressStream2() with ZSTD_e_flush until it returns 0, at which point you can change the +* operation. +* note: ZSTD_e_flush will flush as much output as possible, meaning when compressing with multiple threads, it will +* block until the flush is complete or the output buffer is full. +* @return : 0 if internal buffers are entirely flushed, +* >0 if some data still present within internal buffer (the value is minimal estimation of remaining size), +* or an error code, which can be tested using ZSTD_isError(). +* +* Calling ZSTD_compressStream2() with ZSTD_e_end instructs to finish a frame. +* It will perform a flush and write frame epilogue. +* The epilogue is required for decoders to consider a frame completed. +* flush operation is the same, and follows same rules as calling ZSTD_compressStream2() with ZSTD_e_flush. +* You must continue calling ZSTD_compressStream2() with ZSTD_e_end until it returns 0, at which point you are free to +* start a new frame. +* note: ZSTD_e_end will flush as much output as possible, meaning when compressing with multiple threads, it will +* block until the flush is complete or the output buffer is full. +* @return : 0 if frame fully completed and fully flushed, +* >0 if some data still present within internal buffer (the value is minimal estimation of remaining size), +* or an error code, which can be tested using ZSTD_isError(). +* +* *******************************************************************/ + +typedef ZSTD_CCtx ZSTD_CStream; /**< CCtx and CStream are now effectively same object (>= v1.3.0) */ + /* Continue to distinguish them for compatibility with older versions <= v1.2.0 */ +/*===== ZSTD_CStream management functions =====*/ +ZSTDLIB_API ZSTD_CStream* ZSTD_createCStream(void); +ZSTDLIB_API size_t ZSTD_freeCStream(ZSTD_CStream* zcs); /* accept NULL pointer */ + +/*===== Streaming compression functions =====*/ +typedef enum { + ZSTD_e_continue=0, /* collect more data, encoder decides when to output compressed result, for optimal compression ratio */ + ZSTD_e_flush=1, /* flush any data provided so far, + * it creates (at least) one new block, that can be decoded immediately on reception; + * frame will continue: any future data can still reference previously compressed data, improving compression. + * note : multithreaded compression will block to flush as much output as possible. */ + ZSTD_e_end=2 /* flush any remaining data _and_ close current frame. + * note that frame is only closed after compressed data is fully flushed (return value == 0). + * After that point, any additional data starts a new frame. + * note : each frame is independent (does not reference any content from previous frame). + : note : multithreaded compression will block to flush as much output as possible. */ +} ZSTD_EndDirective; + +/*! ZSTD_compressStream2() : Requires v1.4.0+ + * Behaves about the same as ZSTD_compressStream, with additional control on end directive. + * - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*() + * - Compression parameters cannot be changed once compression is started (save a list of exceptions in multi-threading mode) + * - output->pos must be <= dstCapacity, input->pos must be <= srcSize + * - output->pos and input->pos will be updated. They are guaranteed to remain below their respective limit. + * - endOp must be a valid directive + * - When nbWorkers==0 (default), function is blocking : it completes its job before returning to caller. + * - When nbWorkers>=1, function is non-blocking : it copies a portion of input, distributes jobs to internal worker threads, flush to output whatever is available, + * and then immediately returns, just indicating that there is some data remaining to be flushed. + * The function nonetheless guarantees forward progress : it will return only after it reads or write at least 1+ byte. + * - Exception : if the first call requests a ZSTD_e_end directive and provides enough dstCapacity, the function delegates to ZSTD_compress2() which is always blocking. + * - @return provides a minimum amount of data remaining to be flushed from internal buffers + * or an error code, which can be tested using ZSTD_isError(). + * if @return != 0, flush is not fully completed, there is still some data left within internal buffers. + * This is useful for ZSTD_e_flush, since in this case more flushes are necessary to empty all buffers. + * For ZSTD_e_end, @return == 0 when internal buffers are fully flushed and frame is completed. + * - after a ZSTD_e_end directive, if internal buffer is not fully flushed (@return != 0), + * only ZSTD_e_end or ZSTD_e_flush operations are allowed. + * Before starting a new compression job, or changing compression parameters, + * it is required to fully flush internal buffers. + * - note: if an operation ends with an error, it may leave @cctx in an undefined state. + * Therefore, it's UB to invoke ZSTD_compressStream2() of ZSTD_compressStream() on such a state. + * In order to be re-employed after an error, a state must be reset, + * which can be done explicitly (ZSTD_CCtx_reset()), + * or is sometimes implied by methods starting a new compression job (ZSTD_initCStream(), ZSTD_compressCCtx()) + */ +ZSTDLIB_API size_t ZSTD_compressStream2( ZSTD_CCtx* cctx, + ZSTD_outBuffer* output, + ZSTD_inBuffer* input, + ZSTD_EndDirective endOp); + + +/* These buffer sizes are softly recommended. + * They are not required : ZSTD_compressStream*() happily accepts any buffer size, for both input and output. + * Respecting the recommended size just makes it a bit easier for ZSTD_compressStream*(), + * reducing the amount of memory shuffling and buffering, resulting in minor performance savings. + * + * However, note that these recommendations are from the perspective of a C caller program. + * If the streaming interface is invoked from some other language, + * especially managed ones such as Java or Go, through a foreign function interface such as jni or cgo, + * a major performance rule is to reduce crossing such interface to an absolute minimum. + * It's not rare that performance ends being spent more into the interface, rather than compression itself. + * In which cases, prefer using large buffers, as large as practical, + * for both input and output, to reduce the nb of roundtrips. + */ +ZSTDLIB_API size_t ZSTD_CStreamInSize(void); /**< recommended size for input buffer */ +ZSTDLIB_API size_t ZSTD_CStreamOutSize(void); /**< recommended size for output buffer. Guarantee to successfully flush at least one complete compressed block. */ + + +/* ***************************************************************************** + * This following is a legacy streaming API, available since v1.0+ . + * It can be replaced by ZSTD_CCtx_reset() and ZSTD_compressStream2(). + * It is redundant, but remains fully supported. + ******************************************************************************/ + +/*! + * Equivalent to: + * + * ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); + * ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any) + * ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel); + * + * Note that ZSTD_initCStream() clears any previously set dictionary. Use the new API + * to compress with a dictionary. + */ +ZSTDLIB_API size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel); +/*! + * Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue). + * NOTE: The return value is different. ZSTD_compressStream() returns a hint for + * the next read size (if non-zero and not an error). ZSTD_compressStream2() + * returns the minimum nb of bytes left to flush (if non-zero and not an error). + */ +ZSTDLIB_API size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input); +/*! Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush). */ +ZSTDLIB_API size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output); +/*! Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end). */ +ZSTDLIB_API size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output); + + +/*-*************************************************************************** +* Streaming decompression - HowTo +* +* A ZSTD_DStream object is required to track streaming operations. +* Use ZSTD_createDStream() and ZSTD_freeDStream() to create/release resources. +* ZSTD_DStream objects can be re-employed multiple times. +* +* Use ZSTD_initDStream() to start a new decompression operation. +* @return : recommended first input size +* Alternatively, use advanced API to set specific properties. +* +* Use ZSTD_decompressStream() repetitively to consume your input. +* The function will update both `pos` fields. +* If `input.pos < input.size`, some input has not been consumed. +* It's up to the caller to present again remaining data. +* +* The function tries to flush all data decoded immediately, respecting output buffer size. +* If `output.pos < output.size`, decoder has flushed everything it could. +* +* However, when `output.pos == output.size`, it's more difficult to know. +* If @return > 0, the frame is not complete, meaning +* either there is still some data left to flush within internal buffers, +* or there is more input to read to complete the frame (or both). +* In which case, call ZSTD_decompressStream() again to flush whatever remains in the buffer. +* Note : with no additional input provided, amount of data flushed is necessarily <= ZSTD_BLOCKSIZE_MAX. +* @return : 0 when a frame is completely decoded and fully flushed, +* or an error code, which can be tested using ZSTD_isError(), +* or any other value > 0, which means there is still some decoding or flushing to do to complete current frame : +* the return value is a suggested next input size (just a hint for better latency) +* that will never request more than the remaining content of the compressed frame. +* *******************************************************************************/ + typedef ZSTD_DCtx ZSTD_DStream; /**< DCtx and DStream are now effectively same object (>= v1.3.0) */ + /* For compatibility with versions <= v1.2.0, prefer differentiating them. */ +/*===== ZSTD_DStream management functions =====*/ ZSTDLIB_API ZSTD_DStream* ZSTD_createDStream(void); ZSTDLIB_API size_t ZSTD_freeDStream(ZSTD_DStream* zds); /* accept NULL pointer */ +/*===== Streaming decompression functions =====*/ + +/*! ZSTD_initDStream() : + * Initialize/reset DStream state for new decompression operation. + * Call before new decompression operation using same DStream. + * + * Note : This function is redundant with the advanced API and equivalent to: + * ZSTD_DCtx_reset(zds, ZSTD_reset_session_only); + * ZSTD_DCtx_refDDict(zds, NULL); + */ ZSTDLIB_API size_t ZSTD_initDStream(ZSTD_DStream* zds); +/*! ZSTD_decompressStream() : + * Streaming decompression function. + * Call repetitively to consume full input updating it as necessary. + * Function will update both input and output `pos` fields exposing current state via these fields: + * - `input.pos < input.size`, some input remaining and caller should provide remaining input + * on the next call. + * - `output.pos < output.size`, decoder flushed internal output buffer. + * - `output.pos == output.size`, unflushed data potentially present in the internal buffers, + * check ZSTD_decompressStream() @return value, + * if > 0, invoke it again to flush remaining data to output. + * Note : with no additional input, amount of data flushed <= ZSTD_BLOCKSIZE_MAX. + * + * @return : 0 when a frame is completely decoded and fully flushed, + * or an error code, which can be tested using ZSTD_isError(), + * or any other value > 0, which means there is some decoding or flushing to do to complete current frame. + * + * Note: when an operation returns with an error code, the @zds state may be left in undefined state. + * It's UB to invoke `ZSTD_decompressStream()` on such a state. + * In order to re-use such a state, it must be first reset, + * which can be done explicitly (`ZSTD_DCtx_reset()`), + * or is implied for operations starting some new decompression job (`ZSTD_initDStream`, `ZSTD_decompressDCtx()`, `ZSTD_decompress_usingDict()`) + */ ZSTDLIB_API size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input); ZSTDLIB_API size_t ZSTD_DStreamInSize(void); /*!< recommended size for input buffer */ ZSTDLIB_API size_t ZSTD_DStreamOutSize(void); /*!< recommended size for output buffer. Guarantee to successfully flush at least one complete block in all circumstances. */ + +/************************** +* Simple dictionary API +***************************/ +/*! ZSTD_compress_usingDict() : + * Compression at an explicit compression level using a Dictionary. + * A dictionary can be any arbitrary data segment (also called a prefix), + * or a buffer with specified information (see zdict.h). + * Note : This function loads the dictionary, resulting in significant startup delay. + * It's intended for a dictionary used only once. + * Note 2 : When `dict == NULL || dictSize < 8` no dictionary is used. */ +ZSTDLIB_API size_t ZSTD_compress_usingDict(ZSTD_CCtx* ctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + const void* dict,size_t dictSize, + int compressionLevel); + +/*! ZSTD_decompress_usingDict() : + * Decompression using a known Dictionary. + * Dictionary must be identical to the one used during compression. + * Note : This function loads the dictionary, resulting in significant startup delay. + * It's intended for a dictionary used only once. + * Note : When `dict == NULL || dictSize < 8` no dictionary is used. */ +ZSTDLIB_API size_t ZSTD_decompress_usingDict(ZSTD_DCtx* dctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + const void* dict,size_t dictSize); + + +/*********************************** + * Bulk processing dictionary API + **********************************/ +typedef struct ZSTD_CDict_s ZSTD_CDict; + +/*! ZSTD_createCDict() : + * When compressing multiple messages or blocks using the same dictionary, + * it's recommended to digest the dictionary only once, since it's a costly operation. + * ZSTD_createCDict() will create a state from digesting a dictionary. + * The resulting state can be used for future compression operations with very limited startup cost. + * ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only. + * @dictBuffer can be released after ZSTD_CDict creation, because its content is copied within CDict. + * Note 1 : Consider experimental function `ZSTD_createCDict_byReference()` if you prefer to not duplicate @dictBuffer content. + * Note 2 : A ZSTD_CDict can be created from an empty @dictBuffer, + * in which case the only thing that it transports is the @compressionLevel. + * This can be useful in a pipeline featuring ZSTD_compress_usingCDict() exclusively, + * expecting a ZSTD_CDict parameter with any data, including those without a known dictionary. */ +ZSTDLIB_API ZSTD_CDict* ZSTD_createCDict(const void* dictBuffer, size_t dictSize, + int compressionLevel); + +/*! ZSTD_freeCDict() : + * Function frees memory allocated by ZSTD_createCDict(). + * If a NULL pointer is passed, no operation is performed. */ +ZSTDLIB_API size_t ZSTD_freeCDict(ZSTD_CDict* CDict); + +/*! ZSTD_compress_usingCDict() : + * Compression using a digested Dictionary. + * Recommended when same dictionary is used multiple times. + * Note : compression level is _decided at dictionary creation time_, + * and frame parameters are hardcoded (dictID=yes, contentSize=yes, checksum=no) */ +ZSTDLIB_API size_t ZSTD_compress_usingCDict(ZSTD_CCtx* cctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + const ZSTD_CDict* cdict); + + typedef struct ZSTD_DDict_s ZSTD_DDict; + +/*! ZSTD_createDDict() : + * Create a digested dictionary, ready to start decompression operation without startup delay. + * dictBuffer can be released after DDict creation, as its content is copied inside DDict. */ +ZSTDLIB_API ZSTD_DDict* ZSTD_createDDict(const void* dictBuffer, size_t dictSize); + +/*! ZSTD_freeDDict() : + * Function frees memory allocated with ZSTD_createDDict() + * If a NULL pointer is passed, no operation is performed. */ +ZSTDLIB_API size_t ZSTD_freeDDict(ZSTD_DDict* ddict); + +/*! ZSTD_decompress_usingDDict() : + * Decompression using a digested Dictionary. + * Recommended when same dictionary is used multiple times. */ +ZSTDLIB_API size_t ZSTD_decompress_usingDDict(ZSTD_DCtx* dctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + const ZSTD_DDict* ddict); + + +/******************************** + * Dictionary helper functions + *******************************/ + +/*! ZSTD_getDictID_fromDict() : Requires v1.4.0+ + * Provides the dictID stored within dictionary. + * if @return == 0, the dictionary is not conformant with Zstandard specification. + * It can still be loaded, but as a content-only dictionary. */ ZSTDLIB_API unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize); + +/*! ZSTD_getDictID_fromCDict() : Requires v1.5.0+ + * Provides the dictID of the dictionary loaded into `cdict`. + * If @return == 0, the dictionary is not conformant to Zstandard specification, or empty. + * Non-conformant dictionaries can still be loaded, but as content-only dictionaries. */ +ZSTDLIB_API unsigned ZSTD_getDictID_fromCDict(const ZSTD_CDict* cdict); + +/*! ZSTD_getDictID_fromDDict() : Requires v1.4.0+ + * Provides the dictID of the dictionary loaded into `ddict`. + * If @return == 0, the dictionary is not conformant to Zstandard specification, or empty. + * Non-conformant dictionaries can still be loaded, but as content-only dictionaries. */ +ZSTDLIB_API unsigned ZSTD_getDictID_fromDDict(const ZSTD_DDict* ddict); + +/*! ZSTD_getDictID_fromFrame() : Requires v1.4.0+ + * Provides the dictID required to decompressed the frame stored within `src`. + * If @return == 0, the dictID could not be decoded. + * This could for one of the following reasons : + * - The frame does not require a dictionary to be decoded (most common case). + * - The frame was built with dictID intentionally removed. Whatever dictionary is necessary is a hidden piece of information. + * Note : this use case also happens when using a non-conformant dictionary. + * - `srcSize` is too small, and as a result, the frame header could not be decoded (only possible if `srcSize < ZSTD_FRAMEHEADERSIZE_MAX`). + * - This is not a Zstandard frame. + * When identifying the exact failure cause, it's possible to use ZSTD_getFrameHeader(), which will provide a more precise error code. */ ZSTDLIB_API unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize); + +/******************************************************************************* + * Advanced dictionary and prefix API (Requires v1.4.0+) + * + * This API allows dictionaries to be used with ZSTD_compress2(), + * ZSTD_compressStream2(), and ZSTD_decompressDCtx(). + * Dictionaries are sticky, they remain valid when same context is reused, + * they only reset when the context is reset + * with ZSTD_reset_parameters or ZSTD_reset_session_and_parameters. + * In contrast, Prefixes are single-use. + ******************************************************************************/ + + +/*! ZSTD_CCtx_loadDictionary() : Requires v1.4.0+ + * Create an internal CDict from `dict` buffer. + * Decompression will have to use same dictionary. + * @result : 0, or an error code (which can be tested with ZSTD_isError()). + * Special: Loading a NULL (or 0-size) dictionary invalidates previous dictionary, + * meaning "return to no-dictionary mode". + * Note 1 : Dictionary is sticky, it will be used for all future compressed frames, + * until parameters are reset, a new dictionary is loaded, or the dictionary + * is explicitly invalidated by loading a NULL dictionary. + * Note 2 : Loading a dictionary involves building tables. + * It's also a CPU consuming operation, with non-negligible impact on latency. + * Tables are dependent on compression parameters, and for this reason, + * compression parameters can no longer be changed after loading a dictionary. + * Note 3 :`dict` content will be copied internally. + * Use experimental ZSTD_CCtx_loadDictionary_byReference() to reference content instead. + * In such a case, dictionary buffer must outlive its users. + * Note 4 : Use ZSTD_CCtx_loadDictionary_advanced() + * to precisely select how dictionary content must be interpreted. + * Note 5 : This method does not benefit from LDM (long distance mode). + * If you want to employ LDM on some large dictionary content, + * prefer employing ZSTD_CCtx_refPrefix() described below. + */ +ZSTDLIB_API size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize); + +/*! ZSTD_CCtx_refCDict() : Requires v1.4.0+ + * Reference a prepared dictionary, to be used for all future compressed frames. + * Note that compression parameters are enforced from within CDict, + * and supersede any compression parameter previously set within CCtx. + * The parameters ignored are labelled as "superseded-by-cdict" in the ZSTD_cParameter enum docs. + * The ignored parameters will be used again if the CCtx is returned to no-dictionary mode. + * The dictionary will remain valid for future compressed frames using same CCtx. + * @result : 0, or an error code (which can be tested with ZSTD_isError()). + * Special : Referencing a NULL CDict means "return to no-dictionary mode". + * Note 1 : Currently, only one dictionary can be managed. + * Referencing a new dictionary effectively "discards" any previous one. + * Note 2 : CDict is just referenced, its lifetime must outlive its usage within CCtx. */ +ZSTDLIB_API size_t ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict); + +/*! ZSTD_CCtx_refPrefix() : Requires v1.4.0+ + * Reference a prefix (single-usage dictionary) for next compressed frame. + * A prefix is **only used once**. Tables are discarded at end of frame (ZSTD_e_end). + * Decompression will need same prefix to properly regenerate data. + * Compressing with a prefix is similar in outcome as performing a diff and compressing it, + * but performs much faster, especially during decompression (compression speed is tunable with compression level). + * This method is compatible with LDM (long distance mode). + * @result : 0, or an error code (which can be tested with ZSTD_isError()). + * Special: Adding any prefix (including NULL) invalidates any previous prefix or dictionary + * Note 1 : Prefix buffer is referenced. It **must** outlive compression. + * Its content must remain unmodified during compression. + * Note 2 : If the intention is to diff some large src data blob with some prior version of itself, + * ensure that the window size is large enough to contain the entire source. + * See ZSTD_c_windowLog. + * Note 3 : Referencing a prefix involves building tables, which are dependent on compression parameters. + * It's a CPU consuming operation, with non-negligible impact on latency. + * If there is a need to use the same prefix multiple times, consider loadDictionary instead. + * Note 4 : By default, the prefix is interpreted as raw content (ZSTD_dct_rawContent). + * Use experimental ZSTD_CCtx_refPrefix_advanced() to alter dictionary interpretation. */ +ZSTDLIB_API size_t ZSTD_CCtx_refPrefix(ZSTD_CCtx* cctx, + const void* prefix, size_t prefixSize); + +/*! ZSTD_DCtx_loadDictionary() : Requires v1.4.0+ + * Create an internal DDict from dict buffer, to be used to decompress all future frames. + * The dictionary remains valid for all future frames, until explicitly invalidated, or + * a new dictionary is loaded. + * @result : 0, or an error code (which can be tested with ZSTD_isError()). + * Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary, + * meaning "return to no-dictionary mode". + * Note 1 : Loading a dictionary involves building tables, + * which has a non-negligible impact on CPU usage and latency. + * It's recommended to "load once, use many times", to amortize the cost + * Note 2 :`dict` content will be copied internally, so `dict` can be released after loading. + * Use ZSTD_DCtx_loadDictionary_byReference() to reference dictionary content instead. + * Note 3 : Use ZSTD_DCtx_loadDictionary_advanced() to take control of + * how dictionary content is loaded and interpreted. + */ +ZSTDLIB_API size_t ZSTD_DCtx_loadDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize); + +/*! ZSTD_DCtx_refDDict() : Requires v1.4.0+ + * Reference a prepared dictionary, to be used to decompress next frames. + * The dictionary remains active for decompression of future frames using same DCtx. + * + * If called with ZSTD_d_refMultipleDDicts enabled, repeated calls of this function + * will store the DDict references in a table, and the DDict used for decompression + * will be determined at decompression time, as per the dict ID in the frame. + * The memory for the table is allocated on the first call to refDDict, and can be + * freed with ZSTD_freeDCtx(). + * + * If called with ZSTD_d_refMultipleDDicts disabled (the default), only one dictionary + * will be managed, and referencing a dictionary effectively "discards" any previous one. + * + * @result : 0, or an error code (which can be tested with ZSTD_isError()). + * Special: referencing a NULL DDict means "return to no-dictionary mode". + * Note 2 : DDict is just referenced, its lifetime must outlive its usage from DCtx. + */ +ZSTDLIB_API size_t ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict); + +/*! ZSTD_DCtx_refPrefix() : Requires v1.4.0+ + * Reference a prefix (single-usage dictionary) to decompress next frame. + * This is the reverse operation of ZSTD_CCtx_refPrefix(), + * and must use the same prefix as the one used during compression. + * Prefix is **only used once**. Reference is discarded at end of frame. + * End of frame is reached when ZSTD_decompressStream() returns 0. + * @result : 0, or an error code (which can be tested with ZSTD_isError()). + * Note 1 : Adding any prefix (including NULL) invalidates any previously set prefix or dictionary + * Note 2 : Prefix buffer is referenced. It **must** outlive decompression. + * Prefix buffer must remain unmodified up to the end of frame, + * reached when ZSTD_decompressStream() returns 0. + * Note 3 : By default, the prefix is treated as raw content (ZSTD_dct_rawContent). + * Use ZSTD_CCtx_refPrefix_advanced() to alter dictMode (Experimental section) + * Note 4 : Referencing a raw content prefix has almost no cpu nor memory cost. + * A full dictionary is more costly, as it requires building tables. + */ +ZSTDLIB_API size_t ZSTD_DCtx_refPrefix(ZSTD_DCtx* dctx, + const void* prefix, size_t prefixSize); + +/* === Memory management === */ + +/*! ZSTD_sizeof_*() : Requires v1.4.0+ + * These functions give the _current_ memory usage of selected object. + * Note that object memory usage can evolve (increase or decrease) over time. */ +ZSTDLIB_API size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx); ZSTDLIB_API size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx); +ZSTDLIB_API size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs); +ZSTDLIB_API size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds); +ZSTDLIB_API size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict); +ZSTDLIB_API size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict); + +#endif /* ZSTD_H_235446 */ + + +/* ************************************************************************************** + * ADVANCED AND EXPERIMENTAL FUNCTIONS + **************************************************************************************** + * The definitions in the following section are considered experimental. + * They are provided for advanced scenarios. + * They should never be used with a dynamic library, as prototypes may change in the future. + * Use them only in association with static linking. + * ***************************************************************************************/ + +#if defined(ZSTD_STATIC_LINKING_ONLY) && !defined(ZSTD_H_ZSTD_STATIC_LINKING_ONLY) +#define ZSTD_H_ZSTD_STATIC_LINKING_ONLY + +#include <limits.h> /* INT_MAX */ + +/* This can be overridden externally to hide static symbols. */ +#ifndef ZSTDLIB_STATIC_API +# if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1) +# define ZSTDLIB_STATIC_API __declspec(dllexport) ZSTDLIB_VISIBLE +# elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1) +# define ZSTDLIB_STATIC_API __declspec(dllimport) ZSTDLIB_VISIBLE +# else +# define ZSTDLIB_STATIC_API ZSTDLIB_VISIBLE +# endif +#endif + +/**************************************************************************************** + * experimental API (static linking only) + **************************************************************************************** + * The following symbols and constants + * are not planned to join "stable API" status in the near future. + * They can still change in future versions. + * Some of them are planned to remain in the static_only section indefinitely. + * Some of them might be removed in the future (especially when redundant with existing stable functions) + * ***************************************************************************************/ #define ZSTD_FRAMEHEADERSIZE_PREFIX(format) ((format) == ZSTD_f_zstd1 ? 5 : 1) /* minimum input size required to query frame header size */ #define ZSTD_FRAMEHEADERSIZE_MIN(format) ((format) == ZSTD_f_zstd1 ? 6 : 2) @@ -85,12 +1247,123 @@ ZSTDLIB_API size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx); #define ZSTD_WINDOWLOG_MAX_32 30 #define ZSTD_WINDOWLOG_MAX_64 31 #define ZSTD_WINDOWLOG_MAX ((int)(sizeof(size_t) == 4 ? ZSTD_WINDOWLOG_MAX_32 : ZSTD_WINDOWLOG_MAX_64)) +#define ZSTD_WINDOWLOG_MIN 10 +#define ZSTD_HASHLOG_MAX ((ZSTD_WINDOWLOG_MAX < 30) ? ZSTD_WINDOWLOG_MAX : 30) +#define ZSTD_HASHLOG_MIN 6 +#define ZSTD_CHAINLOG_MAX_32 29 +#define ZSTD_CHAINLOG_MAX_64 30 +#define ZSTD_CHAINLOG_MAX ((int)(sizeof(size_t) == 4 ? ZSTD_CHAINLOG_MAX_32 : ZSTD_CHAINLOG_MAX_64)) +#define ZSTD_CHAINLOG_MIN ZSTD_HASHLOG_MIN +#define ZSTD_SEARCHLOG_MAX (ZSTD_WINDOWLOG_MAX-1) +#define ZSTD_SEARCHLOG_MIN 1 +#define ZSTD_MINMATCH_MAX 7 /* only for ZSTD_fast, other strategies are limited to 6 */ +#define ZSTD_MINMATCH_MIN 3 /* only for ZSTD_btopt+, faster strategies are limited to 4 */ +#define ZSTD_TARGETLENGTH_MAX ZSTD_BLOCKSIZE_MAX +#define ZSTD_TARGETLENGTH_MIN 0 /* note : comparing this constant to an unsigned results in a tautological test */ +#define ZSTD_STRATEGY_MIN ZSTD_fast +#define ZSTD_STRATEGY_MAX ZSTD_btultra2 +#define ZSTD_BLOCKSIZE_MAX_MIN (1 << 10) /* The minimum valid max blocksize. Maximum blocksizes smaller than this make compressBound() inaccurate. */ +#define ZSTD_OVERLAPLOG_MIN 0 +#define ZSTD_OVERLAPLOG_MAX 9 + #define ZSTD_WINDOWLOG_LIMIT_DEFAULT 27 /* by default, the streaming decoder will refuse any frame - */ + * requiring larger than (1<<ZSTD_WINDOWLOG_LIMIT_DEFAULT) window size, + * to preserve host's memory from unreasonable requirements. + * This limit can be overridden using ZSTD_DCtx_setParameter(,ZSTD_d_windowLogMax,). + * The limit does not apply for one-pass decoders (such as ZSTD_decompress()), since no additional memory is allocated */ +/* LDM parameter bounds */ +#define ZSTD_LDM_HASHLOG_MIN ZSTD_HASHLOG_MIN +#define ZSTD_LDM_HASHLOG_MAX ZSTD_HASHLOG_MAX +#define ZSTD_LDM_MINMATCH_MIN 4 +#define ZSTD_LDM_MINMATCH_MAX 4096 +#define ZSTD_LDM_BUCKETSIZELOG_MIN 1 +#define ZSTD_LDM_BUCKETSIZELOG_MAX 8 +#define ZSTD_LDM_HASHRATELOG_MIN 0 +#define ZSTD_LDM_HASHRATELOG_MAX (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN) + +/* Advanced parameter bounds */ +#define ZSTD_TARGETCBLOCKSIZE_MIN 1340 /* suitable to fit into an ethernet / wifi / 4G transport frame */ +#define ZSTD_TARGETCBLOCKSIZE_MAX ZSTD_BLOCKSIZE_MAX +#define ZSTD_SRCSIZEHINT_MIN 0 +#define ZSTD_SRCSIZEHINT_MAX INT_MAX + + +/* --- Advanced types --- */ + +typedef struct ZSTD_CCtx_params_s ZSTD_CCtx_params; + +typedef struct { + unsigned int offset; /* The offset of the match. (NOT the same as the offset code) + * If offset == 0 and matchLength == 0, this sequence represents the last + * literals in the block of litLength size. + */ + + unsigned int litLength; /* Literal length of the sequence. */ + unsigned int matchLength; /* Match length of the sequence. */ + + /* Note: Users of this API may provide a sequence with matchLength == litLength == offset == 0. + * In this case, we will treat the sequence as a marker for a block boundary. + */ + + unsigned int rep; /* Represents which repeat offset is represented by the field 'offset'. + * Ranges from [0, 3]. + * + * Repeat offsets are essentially previous offsets from previous sequences sorted in + * recency order. For more detail, see doc/zstd_compression_format.md + * + * If rep == 0, then 'offset' does not contain a repeat offset. + * If rep > 0: + * If litLength != 0: + * rep == 1 --> offset == repeat_offset_1 + * rep == 2 --> offset == repeat_offset_2 + * rep == 3 --> offset == repeat_offset_3 + * If litLength == 0: + * rep == 1 --> offset == repeat_offset_2 + * rep == 2 --> offset == repeat_offset_3 + * rep == 3 --> offset == repeat_offset_1 - 1 + * + * Note: This field is optional. ZSTD_generateSequences() will calculate the value of + * 'rep', but repeat offsets do not necessarily need to be calculated from an external + * sequence provider's perspective. For example, ZSTD_compressSequences() does not + * use this 'rep' field at all (as of now). + */ +} ZSTD_Sequence; + +typedef struct { + unsigned windowLog; /**< largest match distance : larger == more compression, more memory needed during decompression */ + unsigned chainLog; /**< fully searched segment : larger == more compression, slower, more memory (useless for fast) */ + unsigned hashLog; /**< dispatch table : larger == faster, more memory */ + unsigned searchLog; /**< nb of searches : larger == more compression, slower */ + unsigned minMatch; /**< match length searched : larger == faster decompression, sometimes less compression */ + unsigned targetLength; /**< acceptable match size for optimal parser (only) : larger == more compression, slower */ + ZSTD_strategy strategy; /**< see ZSTD_strategy definition above */ +} ZSTD_compressionParameters; + +typedef struct { + int contentSizeFlag; /**< 1: content size will be in frame header (when known) */ + int checksumFlag; /**< 1: generate a 32-bits checksum using XXH64 algorithm at end of frame, for error detection */ + int noDictIDFlag; /**< 1: no dictID will be saved into frame header (dictID is only useful for dictionary compression) */ +} ZSTD_frameParameters; + +typedef struct { + ZSTD_compressionParameters cParams; + ZSTD_frameParameters fParams; +} ZSTD_parameters; + +typedef enum { + ZSTD_dct_auto = 0, /* dictionary is "full" when starting with ZSTD_MAGIC_DICTIONARY, otherwise it is "rawContent" */ + ZSTD_dct_rawContent = 1, /* ensures dictionary is always loaded as rawContent, even if it starts with ZSTD_MAGIC_DICTIONARY */ + ZSTD_dct_fullDict = 2 /* refuses to load a dictionary if it does not respect Zstandard's specification, starting with ZSTD_MAGIC_DICTIONARY */ +} ZSTD_dictContentType_e; + +typedef enum { + ZSTD_dlm_byCopy = 0, /**< Copy dictionary content internally */ + ZSTD_dlm_byRef = 1 /**< Reference dictionary content -- the dictionary buffer must outlive its users. */ +} ZSTD_dictLoadMethod_e; typedef enum { ZSTD_f_zstd1 = 0, /* zstd frame format, specified in zstd_compression_format.md (default) */ @@ -111,12 +1384,112 @@ typedef enum { ZSTD_rmd_refMultipleDDicts = 1 } ZSTD_refMultipleDDicts_e; -ZSTDLIB_API unsigned ZSTD_isSkippableFrame(const void* buffer, size_t size); +typedef enum { + /* Note: this enum and the behavior it controls are effectively internal + * implementation details of the compressor. They are expected to continue + * to evolve and should be considered only in the context of extremely + * advanced performance tuning. + * + * Zstd currently supports the use of a CDict in three ways: + * + * - The contents of the CDict can be copied into the working context. This + * means that the compression can search both the dictionary and input + * while operating on a single set of internal tables. This makes + * the compression faster per-byte of input. However, the initial copy of + * the CDict's tables incurs a fixed cost at the beginning of the + * compression. For small compressions (< 8 KB), that copy can dominate + * the cost of the compression. + * + * - The CDict's tables can be used in-place. In this model, compression is + * slower per input byte, because the compressor has to search two sets of + * tables. However, this model incurs no start-up cost (as long as the + * working context's tables can be reused). For small inputs, this can be + * faster than copying the CDict's tables. + * + * - The CDict's tables are not used at all, and instead we use the working + * context alone to reload the dictionary and use params based on the source + * size. See ZSTD_compress_insertDictionary() and ZSTD_compress_usingDict(). + * This method is effective when the dictionary sizes are very small relative + * to the input size, and the input size is fairly large to begin with. + * + * Zstd has a simple internal heuristic that selects which strategy to use + * at the beginning of a compression. However, if experimentation shows that + * Zstd is making poor choices, it is possible to override that choice with + * this enum. + */ + ZSTD_dictDefaultAttach = 0, /* Use the default heuristic. */ + ZSTD_dictForceAttach = 1, /* Never copy the dictionary. */ + ZSTD_dictForceCopy = 2, /* Always copy the dictionary. */ + ZSTD_dictForceLoad = 3 /* Always reload the dictionary */ +} ZSTD_dictAttachPref_e; -ZSTDLIB_API size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict); -ZSTDLIB_API size_t ZSTD_resetDStream(ZSTD_DStream* zds); +typedef enum { + ZSTD_lcm_auto = 0, /**< Automatically determine the compression mode based on the compression level. + * Negative compression levels will be uncompressed, and positive compression + * levels will be compressed. */ + ZSTD_lcm_huffman = 1, /**< Always attempt Huffman compression. Uncompressed literals will still be + * emitted if Huffman compression is not profitable. */ + ZSTD_lcm_uncompressed = 2 /**< Always emit uncompressed literals. */ +} ZSTD_literalCompressionMode_e; + +typedef enum { + /* Note: This enum controls features which are conditionally beneficial. Zstd typically will make a final + * decision on whether or not to enable the feature (ZSTD_ps_auto), but setting the switch to ZSTD_ps_enable + * or ZSTD_ps_disable allow for a force enable/disable the feature. + */ + ZSTD_ps_auto = 0, /* Let the library automatically determine whether the feature shall be enabled */ + ZSTD_ps_enable = 1, /* Force-enable the feature */ + ZSTD_ps_disable = 2 /* Do not use the feature */ +} ZSTD_paramSwitch_e; + +/*************************************** +* Frame header and size functions +***************************************/ + +/*! ZSTD_findDecompressedSize() : + * `src` should point to the start of a series of ZSTD encoded and/or skippable frames + * `srcSize` must be the _exact_ size of this series + * (i.e. there should be a frame boundary at `src + srcSize`) + * @return : - decompressed size of all data in all successive frames + * - if the decompressed size cannot be determined: ZSTD_CONTENTSIZE_UNKNOWN + * - if an error occurred: ZSTD_CONTENTSIZE_ERROR + * + * note 1 : decompressed size is an optional field, that may not be present, especially in streaming mode. + * When `return==ZSTD_CONTENTSIZE_UNKNOWN`, data to decompress could be any size. + * In which case, it's necessary to use streaming mode to decompress data. + * note 2 : decompressed size is always present when compression is done with ZSTD_compress() + * note 3 : decompressed size can be very large (64-bits value), + * potentially larger than what local system can handle as a single memory segment. + * In which case, it's necessary to use streaming mode to decompress data. + * note 4 : If source is untrusted, decompressed size could be wrong or intentionally modified. + * Always ensure result fits within application's authorized limits. + * Each application can set its own limits. + * note 5 : ZSTD_findDecompressedSize handles multiple frames, and so it must traverse the input to + * read each contained frame header. This is fast as most of the data is skipped, + * however it does mean that all frame data must be present and valid. */ +ZSTDLIB_STATIC_API unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize); + +/*! ZSTD_decompressBound() : + * `src` should point to the start of a series of ZSTD encoded and/or skippable frames + * `srcSize` must be the _exact_ size of this series + * (i.e. there should be a frame boundary at `src + srcSize`) + * @return : - upper-bound for the decompressed size of all data in all successive frames + * - if an error occurred: ZSTD_CONTENTSIZE_ERROR + * + * note 1 : an error can occur if `src` contains an invalid or incorrectly formatted frame. + * note 2 : the upper-bound is exact when the decompressed size field is available in every ZSTD encoded frame of `src`. + * in this case, `ZSTD_findDecompressedSize` and `ZSTD_decompressBound` return the same value. + * note 3 : when the decompressed size field isn't available, the upper-bound for that frame is calculated by: + * upper-bound = # blocks * min(128 KB, Window_Size) + */ +ZSTDLIB_STATIC_API unsigned long long ZSTD_decompressBound(const void* src, size_t srcSize); + +/*! ZSTD_frameHeaderSize() : + * srcSize must be >= ZSTD_FRAMEHEADERSIZE_PREFIX. + * @return : size of the Frame Header, + * or an error code (if srcSize is too small) */ +ZSTDLIB_STATIC_API size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize); -/*===== Buffer-less streaming decompression functions =====*/ typedef enum { ZSTD_frame, ZSTD_skippableFrame } ZSTD_frameType_e; typedef struct { unsigned long long frameContentSize; /* if == ZSTD_CONTENTSIZE_UNKNOWN, it means this field is not available. 0 means "empty" */ @@ -126,23 +1499,1673 @@ typedef struct { unsigned headerSize; unsigned dictID; unsigned checksumFlag; + unsigned _reserved1; + unsigned _reserved2; } ZSTD_frameHeader; -ZSTDLIB_API size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize); /**< doesn't consume input */ -ZSTDLIB_API size_t ZSTD_getFrameHeader_advanced(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize, ZSTD_format_e format); -ZSTDLIB_API size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize); /**< when frame content size is not known, pass in frameContentSize == ZSTD_CONTENTSIZE_UNKNOWN */ +/*! ZSTD_getFrameHeader() : + * decode Frame Header, or requires larger `srcSize`. + * @return : 0, `zfhPtr` is correctly filled, + * >0, `srcSize` is too small, value is wanted `srcSize` amount, + * or an error code, which can be tested using ZSTD_isError() */ +ZSTDLIB_STATIC_API size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize); /**< doesn't consume input */ +/*! ZSTD_getFrameHeader_advanced() : + * same as ZSTD_getFrameHeader(), + * with added capability to select a format (like ZSTD_f_zstd1_magicless) */ +ZSTDLIB_STATIC_API size_t ZSTD_getFrameHeader_advanced(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize, ZSTD_format_e format); -ZSTDLIB_API size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx); -ZSTDLIB_API size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize); -ZSTDLIB_API size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict); +/*! ZSTD_decompressionMargin() : + * Zstd supports in-place decompression, where the input and output buffers overlap. + * In this case, the output buffer must be at least (Margin + Output_Size) bytes large, + * and the input buffer must be at the end of the output buffer. + * + * _______________________ Output Buffer ________________________ + * | | + * | ____ Input Buffer ____| + * | | | + * v v v + * |---------------------------------------|-----------|----------| + * ^ ^ ^ + * |___________________ Output_Size ___________________|_ Margin _| + * + * NOTE: See also ZSTD_DECOMPRESSION_MARGIN(). + * NOTE: This applies only to single-pass decompression through ZSTD_decompress() or + * ZSTD_decompressDCtx(). + * NOTE: This function supports multi-frame input. + * + * @param src The compressed frame(s) + * @param srcSize The size of the compressed frame(s) + * @returns The decompression margin or an error that can be checked with ZSTD_isError(). + */ +ZSTDLIB_STATIC_API size_t ZSTD_decompressionMargin(const void* src, size_t srcSize); -ZSTDLIB_API size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx); -ZSTDLIB_API size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize); +/*! ZSTD_DECOMPRESS_MARGIN() : + * Similar to ZSTD_decompressionMargin(), but instead of computing the margin from + * the compressed frame, compute it from the original size and the blockSizeLog. + * See ZSTD_decompressionMargin() for details. + * + * WARNING: This macro does not support multi-frame input, the input must be a single + * zstd frame. If you need that support use the function, or implement it yourself. + * + * @param originalSize The original uncompressed size of the data. + * @param blockSize The block size == MIN(windowSize, ZSTD_BLOCKSIZE_MAX). + * Unless you explicitly set the windowLog smaller than + * ZSTD_BLOCKSIZELOG_MAX you can just use ZSTD_BLOCKSIZE_MAX. + */ +#define ZSTD_DECOMPRESSION_MARGIN(originalSize, blockSize) ((size_t)( \ + ZSTD_FRAMEHEADERSIZE_MAX /* Frame header */ + \ + 4 /* checksum */ + \ + ((originalSize) == 0 ? 0 : 3 * (((originalSize) + (blockSize) - 1) / blockSize)) /* 3 bytes per block */ + \ + (blockSize) /* One block of margin */ \ + )) -ZSTDLIB_API void ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx); +typedef enum { + ZSTD_sf_noBlockDelimiters = 0, /* Representation of ZSTD_Sequence has no block delimiters, sequences only */ + ZSTD_sf_explicitBlockDelimiters = 1 /* Representation of ZSTD_Sequence contains explicit block delimiters */ +} ZSTD_sequenceFormat_e; + +/*! ZSTD_sequenceBound() : + * `srcSize` : size of the input buffer + * @return : upper-bound for the number of sequences that can be generated + * from a buffer of srcSize bytes + * + * note : returns number of sequences - to get bytes, multiply by sizeof(ZSTD_Sequence). + */ +ZSTDLIB_STATIC_API size_t ZSTD_sequenceBound(size_t srcSize); + +/*! ZSTD_generateSequences() : + * WARNING: This function is meant for debugging and informational purposes ONLY! + * Its implementation is flawed, and it will be deleted in a future version. + * It is not guaranteed to succeed, as there are several cases where it will give + * up and fail. You should NOT use this function in production code. + * + * This function is deprecated, and will be removed in a future version. + * + * Generate sequences using ZSTD_compress2(), given a source buffer. + * + * @param zc The compression context to be used for ZSTD_compress2(). Set any + * compression parameters you need on this context. + * @param outSeqs The output sequences buffer of size @p outSeqsSize + * @param outSeqsSize The size of the output sequences buffer. + * ZSTD_sequenceBound(srcSize) is an upper bound on the number + * of sequences that can be generated. + * @param src The source buffer to generate sequences from of size @p srcSize. + * @param srcSize The size of the source buffer. + * + * Each block will end with a dummy sequence + * with offset == 0, matchLength == 0, and litLength == length of last literals. + * litLength may be == 0, and if so, then the sequence of (of: 0 ml: 0 ll: 0) + * simply acts as a block delimiter. + * + * @returns The number of sequences generated, necessarily less than + * ZSTD_sequenceBound(srcSize), or an error code that can be checked + * with ZSTD_isError(). + */ +ZSTD_DEPRECATED("For debugging only, will be replaced by ZSTD_extractSequences()") +ZSTDLIB_STATIC_API size_t +ZSTD_generateSequences(ZSTD_CCtx* zc, + ZSTD_Sequence* outSeqs, size_t outSeqsSize, + const void* src, size_t srcSize); + +/*! ZSTD_mergeBlockDelimiters() : + * Given an array of ZSTD_Sequence, remove all sequences that represent block delimiters/last literals + * by merging them into the literals of the next sequence. + * + * As such, the final generated result has no explicit representation of block boundaries, + * and the final last literals segment is not represented in the sequences. + * + * The output of this function can be fed into ZSTD_compressSequences() with CCtx + * setting of ZSTD_c_blockDelimiters as ZSTD_sf_noBlockDelimiters + * @return : number of sequences left after merging + */ +ZSTDLIB_STATIC_API size_t ZSTD_mergeBlockDelimiters(ZSTD_Sequence* sequences, size_t seqsSize); + +/*! ZSTD_compressSequences() : + * Compress an array of ZSTD_Sequence, associated with @src buffer, into dst. + * @src contains the entire input (not just the literals). + * If @srcSize > sum(sequence.length), the remaining bytes are considered all literals + * If a dictionary is included, then the cctx should reference the dict. (see: ZSTD_CCtx_refCDict(), ZSTD_CCtx_loadDictionary(), etc.) + * The entire source is compressed into a single frame. + * + * The compression behavior changes based on cctx params. In particular: + * If ZSTD_c_blockDelimiters == ZSTD_sf_noBlockDelimiters, the array of ZSTD_Sequence is expected to contain + * no block delimiters (defined in ZSTD_Sequence). Block boundaries are roughly determined based on + * the block size derived from the cctx, and sequences may be split. This is the default setting. + * + * If ZSTD_c_blockDelimiters == ZSTD_sf_explicitBlockDelimiters, the array of ZSTD_Sequence is expected to contain + * block delimiters (defined in ZSTD_Sequence). Behavior is undefined if no block delimiters are provided. + * + * If ZSTD_c_validateSequences == 0, this function will blindly accept the sequences provided. Invalid sequences cause undefined + * behavior. If ZSTD_c_validateSequences == 1, then if sequence is invalid (see doc/zstd_compression_format.md for + * specifics regarding offset/matchlength requirements) then the function will bail out and return an error. + * + * In addition to the two adjustable experimental params, there are other important cctx params. + * - ZSTD_c_minMatch MUST be set as less than or equal to the smallest match generated by the match finder. It has a minimum value of ZSTD_MINMATCH_MIN. + * - ZSTD_c_compressionLevel accordingly adjusts the strength of the entropy coder, as it would in typical compression. + * - ZSTD_c_windowLog affects offset validation: this function will return an error at higher debug levels if a provided offset + * is larger than what the spec allows for a given window log and dictionary (if present). See: doc/zstd_compression_format.md + * + * Note: Repcodes are, as of now, always re-calculated within this function, so ZSTD_Sequence::rep is unused. + * Note 2: Once we integrate ability to ingest repcodes, the explicit block delims mode must respect those repcodes exactly, + * and cannot emit an RLE block that disagrees with the repcode history + * @return : final compressed size, or a ZSTD error code. + */ +ZSTDLIB_STATIC_API size_t +ZSTD_compressSequences( ZSTD_CCtx* cctx, void* dst, size_t dstSize, + const ZSTD_Sequence* inSeqs, size_t inSeqsSize, + const void* src, size_t srcSize); + + +/*! ZSTD_writeSkippableFrame() : + * Generates a zstd skippable frame containing data given by src, and writes it to dst buffer. + * + * Skippable frames begin with a 4-byte magic number. There are 16 possible choices of magic number, + * ranging from ZSTD_MAGIC_SKIPPABLE_START to ZSTD_MAGIC_SKIPPABLE_START+15. + * As such, the parameter magicVariant controls the exact skippable frame magic number variant used, so + * the magic number used will be ZSTD_MAGIC_SKIPPABLE_START + magicVariant. + * + * Returns an error if destination buffer is not large enough, if the source size is not representable + * with a 4-byte unsigned int, or if the parameter magicVariant is greater than 15 (and therefore invalid). + * + * @return : number of bytes written or a ZSTD error. + */ +ZSTDLIB_STATIC_API size_t ZSTD_writeSkippableFrame(void* dst, size_t dstCapacity, + const void* src, size_t srcSize, unsigned magicVariant); + +/*! ZSTD_readSkippableFrame() : + * Retrieves a zstd skippable frame containing data given by src, and writes it to dst buffer. + * + * The parameter magicVariant will receive the magicVariant that was supplied when the frame was written, + * i.e. magicNumber - ZSTD_MAGIC_SKIPPABLE_START. This can be NULL if the caller is not interested + * in the magicVariant. + * + * Returns an error if destination buffer is not large enough, or if the frame is not skippable. + * + * @return : number of bytes written or a ZSTD error. + */ +ZSTDLIB_API size_t ZSTD_readSkippableFrame(void* dst, size_t dstCapacity, unsigned* magicVariant, + const void* src, size_t srcSize); + +/*! ZSTD_isSkippableFrame() : + * Tells if the content of `buffer` starts with a valid Frame Identifier for a skippable frame. + */ +ZSTDLIB_API unsigned ZSTD_isSkippableFrame(const void* buffer, size_t size); + + + +/*************************************** +* Memory management +***************************************/ + +/*! ZSTD_estimate*() : + * These functions make it possible to estimate memory usage + * of a future {D,C}Ctx, before its creation. + * This is useful in combination with ZSTD_initStatic(), + * which makes it possible to employ a static buffer for ZSTD_CCtx* state. + * + * ZSTD_estimateCCtxSize() will provide a memory budget large enough + * to compress data of any size using one-shot compression ZSTD_compressCCtx() or ZSTD_compress2() + * associated with any compression level up to max specified one. + * The estimate will assume the input may be arbitrarily large, + * which is the worst case. + * + * Note that the size estimation is specific for one-shot compression, + * it is not valid for streaming (see ZSTD_estimateCStreamSize*()) + * nor other potential ways of using a ZSTD_CCtx* state. + * + * When srcSize can be bound by a known and rather "small" value, + * this knowledge can be used to provide a tighter budget estimation + * because the ZSTD_CCtx* state will need less memory for small inputs. + * This tighter estimation can be provided by employing more advanced functions + * ZSTD_estimateCCtxSize_usingCParams(), which can be used in tandem with ZSTD_getCParams(), + * and ZSTD_estimateCCtxSize_usingCCtxParams(), which can be used in tandem with ZSTD_CCtxParams_setParameter(). + * Both can be used to estimate memory using custom compression parameters and arbitrary srcSize limits. + * + * Note : only single-threaded compression is supported. + * ZSTD_estimateCCtxSize_usingCCtxParams() will return an error code if ZSTD_c_nbWorkers is >= 1. + */ +ZSTDLIB_STATIC_API size_t ZSTD_estimateCCtxSize(int maxCompressionLevel); +ZSTDLIB_STATIC_API size_t ZSTD_estimateCCtxSize_usingCParams(ZSTD_compressionParameters cParams); +ZSTDLIB_STATIC_API size_t ZSTD_estimateCCtxSize_usingCCtxParams(const ZSTD_CCtx_params* params); +ZSTDLIB_STATIC_API size_t ZSTD_estimateDCtxSize(void); + +/*! ZSTD_estimateCStreamSize() : + * ZSTD_estimateCStreamSize() will provide a memory budget large enough for streaming compression + * using any compression level up to the max specified one. + * It will also consider src size to be arbitrarily "large", which is a worst case scenario. + * If srcSize is known to always be small, ZSTD_estimateCStreamSize_usingCParams() can provide a tighter estimation. + * ZSTD_estimateCStreamSize_usingCParams() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel. + * ZSTD_estimateCStreamSize_usingCCtxParams() can be used in tandem with ZSTD_CCtxParams_setParameter(). Only single-threaded compression is supported. This function will return an error code if ZSTD_c_nbWorkers is >= 1. + * Note : CStream size estimation is only correct for single-threaded compression. + * ZSTD_estimateCStreamSize_usingCCtxParams() will return an error code if ZSTD_c_nbWorkers is >= 1. + * Note 2 : ZSTD_estimateCStreamSize* functions are not compatible with the Block-Level Sequence Producer API at this time. + * Size estimates assume that no external sequence producer is registered. + * + * ZSTD_DStream memory budget depends on frame's window Size. + * This information can be passed manually, using ZSTD_estimateDStreamSize, + * or deducted from a valid frame Header, using ZSTD_estimateDStreamSize_fromFrame(); + * Any frame requesting a window size larger than max specified one will be rejected. + * Note : if streaming is init with function ZSTD_init?Stream_usingDict(), + * an internal ?Dict will be created, which additional size is not estimated here. + * In this case, get total size by adding ZSTD_estimate?DictSize + */ +ZSTDLIB_STATIC_API size_t ZSTD_estimateCStreamSize(int maxCompressionLevel); +ZSTDLIB_STATIC_API size_t ZSTD_estimateCStreamSize_usingCParams(ZSTD_compressionParameters cParams); +ZSTDLIB_STATIC_API size_t ZSTD_estimateCStreamSize_usingCCtxParams(const ZSTD_CCtx_params* params); +ZSTDLIB_STATIC_API size_t ZSTD_estimateDStreamSize(size_t maxWindowSize); +ZSTDLIB_STATIC_API size_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize); + +/*! ZSTD_estimate?DictSize() : + * ZSTD_estimateCDictSize() will bet that src size is relatively "small", and content is copied, like ZSTD_createCDict(). + * ZSTD_estimateCDictSize_advanced() makes it possible to control compression parameters precisely, like ZSTD_createCDict_advanced(). + * Note : dictionaries created by reference (`ZSTD_dlm_byRef`) are logically smaller. + */ +ZSTDLIB_STATIC_API size_t ZSTD_estimateCDictSize(size_t dictSize, int compressionLevel); +ZSTDLIB_STATIC_API size_t ZSTD_estimateCDictSize_advanced(size_t dictSize, ZSTD_compressionParameters cParams, ZSTD_dictLoadMethod_e dictLoadMethod); +ZSTDLIB_STATIC_API size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod); + +/*! ZSTD_initStatic*() : + * Initialize an object using a pre-allocated fixed-size buffer. + * workspace: The memory area to emplace the object into. + * Provided pointer *must be 8-bytes aligned*. + * Buffer must outlive object. + * workspaceSize: Use ZSTD_estimate*Size() to determine + * how large workspace must be to support target scenario. + * @return : pointer to object (same address as workspace, just different type), + * or NULL if error (size too small, incorrect alignment, etc.) + * Note : zstd will never resize nor malloc() when using a static buffer. + * If the object requires more memory than available, + * zstd will just error out (typically ZSTD_error_memory_allocation). + * Note 2 : there is no corresponding "free" function. + * Since workspace is allocated externally, it must be freed externally too. + * Note 3 : cParams : use ZSTD_getCParams() to convert a compression level + * into its associated cParams. + * Limitation 1 : currently not compatible with internal dictionary creation, triggered by + * ZSTD_CCtx_loadDictionary(), ZSTD_initCStream_usingDict() or ZSTD_initDStream_usingDict(). + * Limitation 2 : static cctx currently not compatible with multi-threading. + * Limitation 3 : static dctx is incompatible with legacy support. + */ +ZSTDLIB_STATIC_API ZSTD_CCtx* ZSTD_initStaticCCtx(void* workspace, size_t workspaceSize); +ZSTDLIB_STATIC_API ZSTD_CStream* ZSTD_initStaticCStream(void* workspace, size_t workspaceSize); /**< same as ZSTD_initStaticCCtx() */ + +ZSTDLIB_STATIC_API ZSTD_DCtx* ZSTD_initStaticDCtx(void* workspace, size_t workspaceSize); +ZSTDLIB_STATIC_API ZSTD_DStream* ZSTD_initStaticDStream(void* workspace, size_t workspaceSize); /**< same as ZSTD_initStaticDCtx() */ + +ZSTDLIB_STATIC_API const ZSTD_CDict* ZSTD_initStaticCDict( + void* workspace, size_t workspaceSize, + const void* dict, size_t dictSize, + ZSTD_dictLoadMethod_e dictLoadMethod, + ZSTD_dictContentType_e dictContentType, + ZSTD_compressionParameters cParams); + +ZSTDLIB_STATIC_API const ZSTD_DDict* ZSTD_initStaticDDict( + void* workspace, size_t workspaceSize, + const void* dict, size_t dictSize, + ZSTD_dictLoadMethod_e dictLoadMethod, + ZSTD_dictContentType_e dictContentType); + + +/*! Custom memory allocation : + * These prototypes make it possible to pass your own allocation/free functions. + * ZSTD_customMem is provided at creation time, using ZSTD_create*_advanced() variants listed below. + * All allocation/free operations will be completed using these custom variants instead of regular <stdlib.h> ones. + */ +typedef void* (*ZSTD_allocFunction) (void* opaque, size_t size); +typedef void (*ZSTD_freeFunction) (void* opaque, void* address); +typedef struct { ZSTD_allocFunction customAlloc; ZSTD_freeFunction customFree; void* opaque; } ZSTD_customMem; +static +#ifdef __GNUC__ +__attribute__((__unused__)) +#endif + +#if defined(__clang__) && __clang_major__ >= 5 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" +#endif +ZSTD_customMem const ZSTD_defaultCMem = { NULL, NULL, NULL }; /**< this constant defers to stdlib's functions */ +#if defined(__clang__) && __clang_major__ >= 5 +#pragma clang diagnostic pop +#endif + +MEM_STATIC void* ZSTD_customMalloc(size_t size, ZSTD_customMem customMem) +{ + if (customMem.customAlloc) + return customMem.customAlloc(customMem.opaque, size); + return ZSTD_malloc(size); +} + +MEM_STATIC void* ZSTD_customCalloc(size_t size, ZSTD_customMem customMem) +{ + if (customMem.customAlloc) { + /* calloc implemented as malloc+memset; + * not as efficient as calloc, but next best guess for custom malloc */ + void* const ptr = customMem.customAlloc(customMem.opaque, size); + ZSTD_memset(ptr, 0, size); + return ptr; + } + return ZSTD_calloc(1, size); +} + +MEM_STATIC void ZSTD_customFree(void* ptr, ZSTD_customMem customMem) +{ + if (ptr != NULL) { + if (customMem.customFree) + customMem.customFree(customMem.opaque, ptr); + else + ZSTD_free(ptr); + } +} + +ZSTDLIB_STATIC_API ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem); +ZSTDLIB_STATIC_API ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem); +ZSTDLIB_STATIC_API ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem); +ZSTDLIB_STATIC_API ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem); + +ZSTDLIB_STATIC_API ZSTD_CDict* ZSTD_createCDict_advanced(const void* dict, size_t dictSize, + ZSTD_dictLoadMethod_e dictLoadMethod, + ZSTD_dictContentType_e dictContentType, + ZSTD_compressionParameters cParams, + ZSTD_customMem customMem); + +/*! Thread pool : + * These prototypes make it possible to share a thread pool among multiple compression contexts. + * This can limit resources for applications with multiple threads where each one uses + * a threaded compression mode (via ZSTD_c_nbWorkers parameter). + * ZSTD_createThreadPool creates a new thread pool with a given number of threads. + * Note that the lifetime of such pool must exist while being used. + * ZSTD_CCtx_refThreadPool assigns a thread pool to a context (use NULL argument value + * to use an internal thread pool). + * ZSTD_freeThreadPool frees a thread pool, accepts NULL pointer. + */ +typedef struct POOL_ctx_s ZSTD_threadPool; +ZSTDLIB_STATIC_API ZSTD_threadPool* ZSTD_createThreadPool(size_t numThreads); +ZSTDLIB_STATIC_API void ZSTD_freeThreadPool (ZSTD_threadPool* pool); /* accept NULL pointer */ +ZSTDLIB_STATIC_API size_t ZSTD_CCtx_refThreadPool(ZSTD_CCtx* cctx, ZSTD_threadPool* pool); + + +/* + * This API is temporary and is expected to change or disappear in the future! + */ +ZSTDLIB_STATIC_API ZSTD_CDict* ZSTD_createCDict_advanced2( + const void* dict, size_t dictSize, + ZSTD_dictLoadMethod_e dictLoadMethod, + ZSTD_dictContentType_e dictContentType, + const ZSTD_CCtx_params* cctxParams, + ZSTD_customMem customMem); + +ZSTDLIB_STATIC_API ZSTD_DDict* ZSTD_createDDict_advanced( + const void* dict, size_t dictSize, + ZSTD_dictLoadMethod_e dictLoadMethod, + ZSTD_dictContentType_e dictContentType, + ZSTD_customMem customMem); + + +/*************************************** +* Advanced compression functions +***************************************/ + +/*! ZSTD_createCDict_byReference() : + * Create a digested dictionary for compression + * Dictionary content is just referenced, not duplicated. + * As a consequence, `dictBuffer` **must** outlive CDict, + * and its content must remain unmodified throughout the lifetime of CDict. + * note: equivalent to ZSTD_createCDict_advanced(), with dictLoadMethod==ZSTD_dlm_byRef */ +ZSTDLIB_STATIC_API ZSTD_CDict* ZSTD_createCDict_byReference(const void* dictBuffer, size_t dictSize, int compressionLevel); + +/*! ZSTD_getCParams() : + * @return ZSTD_compressionParameters structure for a selected compression level and estimated srcSize. + * `estimatedSrcSize` value is optional, select 0 if not known */ +ZSTDLIB_STATIC_API ZSTD_compressionParameters ZSTD_getCParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize); + +/*! ZSTD_getParams() : + * same as ZSTD_getCParams(), but @return a full `ZSTD_parameters` object instead of sub-component `ZSTD_compressionParameters`. + * All fields of `ZSTD_frameParameters` are set to default : contentSize=1, checksum=0, noDictID=0 */ +ZSTDLIB_STATIC_API ZSTD_parameters ZSTD_getParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize); + +/*! ZSTD_checkCParams() : + * Ensure param values remain within authorized range. + * @return 0 on success, or an error code (can be checked with ZSTD_isError()) */ +ZSTDLIB_STATIC_API size_t ZSTD_checkCParams(ZSTD_compressionParameters params); + +/*! ZSTD_adjustCParams() : + * optimize params for a given `srcSize` and `dictSize`. + * `srcSize` can be unknown, in which case use ZSTD_CONTENTSIZE_UNKNOWN. + * `dictSize` must be `0` when there is no dictionary. + * cPar can be invalid : all parameters will be clamped within valid range in the @return struct. + * This function never fails (wide contract) */ +ZSTDLIB_STATIC_API ZSTD_compressionParameters ZSTD_adjustCParams(ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize); + +/*! ZSTD_CCtx_setCParams() : + * Set all parameters provided within @p cparams into the working @p cctx. + * Note : if modifying parameters during compression (MT mode only), + * note that changes to the .windowLog parameter will be ignored. + * @return 0 on success, or an error code (can be checked with ZSTD_isError()). + * On failure, no parameters are updated. + */ +ZSTDLIB_STATIC_API size_t ZSTD_CCtx_setCParams(ZSTD_CCtx* cctx, ZSTD_compressionParameters cparams); + +/*! ZSTD_CCtx_setFParams() : + * Set all parameters provided within @p fparams into the working @p cctx. + * @return 0 on success, or an error code (can be checked with ZSTD_isError()). + */ +ZSTDLIB_STATIC_API size_t ZSTD_CCtx_setFParams(ZSTD_CCtx* cctx, ZSTD_frameParameters fparams); + +/*! ZSTD_CCtx_setParams() : + * Set all parameters provided within @p params into the working @p cctx. + * @return 0 on success, or an error code (can be checked with ZSTD_isError()). + */ +ZSTDLIB_STATIC_API size_t ZSTD_CCtx_setParams(ZSTD_CCtx* cctx, ZSTD_parameters params); + +/*! ZSTD_compress_advanced() : + * Note : this function is now DEPRECATED. + * It can be replaced by ZSTD_compress2(), in combination with ZSTD_CCtx_setParameter() and other parameter setters. + * This prototype will generate compilation warnings. */ +ZSTD_DEPRECATED("use ZSTD_compress2") +ZSTDLIB_STATIC_API +size_t ZSTD_compress_advanced(ZSTD_CCtx* cctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + const void* dict,size_t dictSize, + ZSTD_parameters params); + +/*! ZSTD_compress_usingCDict_advanced() : + * Note : this function is now DEPRECATED. + * It can be replaced by ZSTD_compress2(), in combination with ZSTD_CCtx_loadDictionary() and other parameter setters. + * This prototype will generate compilation warnings. */ +ZSTD_DEPRECATED("use ZSTD_compress2 with ZSTD_CCtx_loadDictionary") +ZSTDLIB_STATIC_API +size_t ZSTD_compress_usingCDict_advanced(ZSTD_CCtx* cctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + const ZSTD_CDict* cdict, + ZSTD_frameParameters fParams); + + +/*! ZSTD_CCtx_loadDictionary_byReference() : + * Same as ZSTD_CCtx_loadDictionary(), but dictionary content is referenced, instead of being copied into CCtx. + * It saves some memory, but also requires that `dict` outlives its usage within `cctx` */ +ZSTDLIB_STATIC_API size_t ZSTD_CCtx_loadDictionary_byReference(ZSTD_CCtx* cctx, const void* dict, size_t dictSize); + +/*! ZSTD_CCtx_loadDictionary_advanced() : + * Same as ZSTD_CCtx_loadDictionary(), but gives finer control over + * how to load the dictionary (by copy ? by reference ?) + * and how to interpret it (automatic ? force raw mode ? full mode only ?) */ +ZSTDLIB_STATIC_API size_t ZSTD_CCtx_loadDictionary_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType); + +/*! ZSTD_CCtx_refPrefix_advanced() : + * Same as ZSTD_CCtx_refPrefix(), but gives finer control over + * how to interpret prefix content (automatic ? force raw mode (default) ? full mode only ?) */ +ZSTDLIB_STATIC_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const void* prefix, size_t prefixSize, ZSTD_dictContentType_e dictContentType); + +/* === experimental parameters === */ +/* these parameters can be used with ZSTD_setParameter() + * they are not guaranteed to remain supported in the future */ + + /* Enables rsyncable mode, + * which makes compressed files more rsync friendly + * by adding periodic synchronization points to the compressed data. + * The target average block size is ZSTD_c_jobSize / 2. + * It's possible to modify the job size to increase or decrease + * the granularity of the synchronization point. + * Once the jobSize is smaller than the window size, + * it will result in compression ratio degradation. + * NOTE 1: rsyncable mode only works when multithreading is enabled. + * NOTE 2: rsyncable performs poorly in combination with long range mode, + * since it will decrease the effectiveness of synchronization points, + * though mileage may vary. + * NOTE 3: Rsyncable mode limits maximum compression speed to ~400 MB/s. + * If the selected compression level is already running significantly slower, + * the overall speed won't be significantly impacted. + */ + #define ZSTD_c_rsyncable ZSTD_c_experimentalParam1 + +/* Select a compression format. + * The value must be of type ZSTD_format_e. + * See ZSTD_format_e enum definition for details */ +#define ZSTD_c_format ZSTD_c_experimentalParam2 + +/* Force back-reference distances to remain < windowSize, + * even when referencing into Dictionary content (default:0) */ +#define ZSTD_c_forceMaxWindow ZSTD_c_experimentalParam3 + +/* Controls whether the contents of a CDict + * are used in place, or copied into the working context. + * Accepts values from the ZSTD_dictAttachPref_e enum. + * See the comments on that enum for an explanation of the feature. */ +#define ZSTD_c_forceAttachDict ZSTD_c_experimentalParam4 + +/* Controlled with ZSTD_paramSwitch_e enum. + * Default is ZSTD_ps_auto. + * Set to ZSTD_ps_disable to never compress literals. + * Set to ZSTD_ps_enable to always compress literals. (Note: uncompressed literals + * may still be emitted if huffman is not beneficial to use.) + * + * By default, in ZSTD_ps_auto, the library will decide at runtime whether to use + * literals compression based on the compression parameters - specifically, + * negative compression levels do not use literal compression. + */ +#define ZSTD_c_literalCompressionMode ZSTD_c_experimentalParam5 + +/* User's best guess of source size. + * Hint is not valid when srcSizeHint == 0. + * There is no guarantee that hint is close to actual source size, + * but compression ratio may regress significantly if guess considerably underestimates */ +#define ZSTD_c_srcSizeHint ZSTD_c_experimentalParam7 + +/* Controls whether the new and experimental "dedicated dictionary search + * structure" can be used. This feature is still rough around the edges, be + * prepared for surprising behavior! + * + * How to use it: + * + * When using a CDict, whether to use this feature or not is controlled at + * CDict creation, and it must be set in a CCtxParams set passed into that + * construction (via ZSTD_createCDict_advanced2()). A compression will then + * use the feature or not based on how the CDict was constructed; the value of + * this param, set in the CCtx, will have no effect. + * + * However, when a dictionary buffer is passed into a CCtx, such as via + * ZSTD_CCtx_loadDictionary(), this param can be set on the CCtx to control + * whether the CDict that is created internally can use the feature or not. + * + * What it does: + * + * Normally, the internal data structures of the CDict are analogous to what + * would be stored in a CCtx after compressing the contents of a dictionary. + * To an approximation, a compression using a dictionary can then use those + * data structures to simply continue what is effectively a streaming + * compression where the simulated compression of the dictionary left off. + * Which is to say, the search structures in the CDict are normally the same + * format as in the CCtx. + * + * It is possible to do better, since the CDict is not like a CCtx: the search + * structures are written once during CDict creation, and then are only read + * after that, while the search structures in the CCtx are both read and + * written as the compression goes along. This means we can choose a search + * structure for the dictionary that is read-optimized. + * + * This feature enables the use of that different structure. + * + * Note that some of the members of the ZSTD_compressionParameters struct have + * different semantics and constraints in the dedicated search structure. It is + * highly recommended that you simply set a compression level in the CCtxParams + * you pass into the CDict creation call, and avoid messing with the cParams + * directly. + * + * Effects: + * + * This will only have any effect when the selected ZSTD_strategy + * implementation supports this feature. Currently, that's limited to + * ZSTD_greedy, ZSTD_lazy, and ZSTD_lazy2. + * + * Note that this means that the CDict tables can no longer be copied into the + * CCtx, so the dict attachment mode ZSTD_dictForceCopy will no longer be + * usable. The dictionary can only be attached or reloaded. + * + * In general, you should expect compression to be faster--sometimes very much + * so--and CDict creation to be slightly slower. Eventually, we will probably + * make this mode the default. + */ +#define ZSTD_c_enableDedicatedDictSearch ZSTD_c_experimentalParam8 + +/* ZSTD_c_stableInBuffer + * Experimental parameter. + * Default is 0 == disabled. Set to 1 to enable. + * + * Tells the compressor that input data presented with ZSTD_inBuffer + * will ALWAYS be the same between calls. + * Technically, the @src pointer must never be changed, + * and the @pos field can only be updated by zstd. + * However, it's possible to increase the @size field, + * allowing scenarios where more data can be appended after compressions starts. + * These conditions are checked by the compressor, + * and compression will fail if they are not respected. + * Also, data in the ZSTD_inBuffer within the range [src, src + pos) + * MUST not be modified during compression or it will result in data corruption. + * + * When this flag is enabled zstd won't allocate an input window buffer, + * because the user guarantees it can reference the ZSTD_inBuffer until + * the frame is complete. But, it will still allocate an output buffer + * large enough to fit a block (see ZSTD_c_stableOutBuffer). This will also + * avoid the memcpy() from the input buffer to the input window buffer. + * + * NOTE: So long as the ZSTD_inBuffer always points to valid memory, using + * this flag is ALWAYS memory safe, and will never access out-of-bounds + * memory. However, compression WILL fail if conditions are not respected. + * + * WARNING: The data in the ZSTD_inBuffer in the range [src, src + pos) MUST + * not be modified during compression or it will result in data corruption. + * This is because zstd needs to reference data in the ZSTD_inBuffer to find + * matches. Normally zstd maintains its own window buffer for this purpose, + * but passing this flag tells zstd to rely on user provided buffer instead. + */ +#define ZSTD_c_stableInBuffer ZSTD_c_experimentalParam9 + +/* ZSTD_c_stableOutBuffer + * Experimental parameter. + * Default is 0 == disabled. Set to 1 to enable. + * + * Tells he compressor that the ZSTD_outBuffer will not be resized between + * calls. Specifically: (out.size - out.pos) will never grow. This gives the + * compressor the freedom to say: If the compressed data doesn't fit in the + * output buffer then return ZSTD_error_dstSizeTooSmall. This allows us to + * always decompress directly into the output buffer, instead of decompressing + * into an internal buffer and copying to the output buffer. + * + * When this flag is enabled zstd won't allocate an output buffer, because + * it can write directly to the ZSTD_outBuffer. It will still allocate the + * input window buffer (see ZSTD_c_stableInBuffer). + * + * Zstd will check that (out.size - out.pos) never grows and return an error + * if it does. While not strictly necessary, this should prevent surprises. + */ +#define ZSTD_c_stableOutBuffer ZSTD_c_experimentalParam10 + +/* ZSTD_c_blockDelimiters + * Default is 0 == ZSTD_sf_noBlockDelimiters. + * + * For use with sequence compression API: ZSTD_compressSequences(). + * + * Designates whether or not the given array of ZSTD_Sequence contains block delimiters + * and last literals, which are defined as sequences with offset == 0 and matchLength == 0. + * See the definition of ZSTD_Sequence for more specifics. + */ +#define ZSTD_c_blockDelimiters ZSTD_c_experimentalParam11 + +/* ZSTD_c_validateSequences + * Default is 0 == disabled. Set to 1 to enable sequence validation. + * + * For use with sequence compression API: ZSTD_compressSequences(). + * Designates whether or not we validate sequences provided to ZSTD_compressSequences() + * during function execution. + * + * Without validation, providing a sequence that does not conform to the zstd spec will cause + * undefined behavior, and may produce a corrupted block. + * + * With validation enabled, if sequence is invalid (see doc/zstd_compression_format.md for + * specifics regarding offset/matchlength requirements) then the function will bail out and + * return an error. + * + */ +#define ZSTD_c_validateSequences ZSTD_c_experimentalParam12 + +/* ZSTD_c_blockSplitterLevel + * note: this parameter only influences the first splitter stage, + * which is active before producing the sequences. + * ZSTD_c_splitAfterSequences controls the next splitter stage, + * which is active after sequence production. + * Note that both can be combined. + * Allowed values are between 0 and ZSTD_BLOCKSPLITTER_LEVEL_MAX included. + * 0 means "auto", which will select a value depending on current ZSTD_c_strategy. + * 1 means no splitting. + * Then, values from 2 to 6 are sorted in increasing cpu load order. + * + * Note that currently the first block is never split, + * to ensure expansion guarantees in presence of incompressible data. + */ +#define ZSTD_BLOCKSPLITTER_LEVEL_MAX 6 +#define ZSTD_c_blockSplitterLevel ZSTD_c_experimentalParam20 + +/* ZSTD_c_splitAfterSequences + * This is a stronger splitter algorithm, + * based on actual sequences previously produced by the selected parser. + * It's also slower, and as a consequence, mostly used for high compression levels. + * While the post-splitter does overlap with the pre-splitter, + * both can nonetheless be combined, + * notably with ZSTD_c_blockSplitterLevel at ZSTD_BLOCKSPLITTER_LEVEL_MAX, + * resulting in higher compression ratio than just one of them. + * + * Default is ZSTD_ps_auto. + * Set to ZSTD_ps_disable to never use block splitter. + * Set to ZSTD_ps_enable to always use block splitter. + * + * By default, in ZSTD_ps_auto, the library will decide at runtime whether to use + * block splitting based on the compression parameters. + */ +#define ZSTD_c_splitAfterSequences ZSTD_c_experimentalParam13 + +/* ZSTD_c_useRowMatchFinder + * Controlled with ZSTD_paramSwitch_e enum. + * Default is ZSTD_ps_auto. + * Set to ZSTD_ps_disable to never use row-based matchfinder. + * Set to ZSTD_ps_enable to force usage of row-based matchfinder. + * + * By default, in ZSTD_ps_auto, the library will decide at runtime whether to use + * the row-based matchfinder based on support for SIMD instructions and the window log. + * Note that this only pertains to compression strategies: greedy, lazy, and lazy2 + */ +#define ZSTD_c_useRowMatchFinder ZSTD_c_experimentalParam14 + +/* ZSTD_c_deterministicRefPrefix + * Default is 0 == disabled. Set to 1 to enable. + * + * Zstd produces different results for prefix compression when the prefix is + * directly adjacent to the data about to be compressed vs. when it isn't. + * This is because zstd detects that the two buffers are contiguous and it can + * use a more efficient match finding algorithm. However, this produces different + * results than when the two buffers are non-contiguous. This flag forces zstd + * to always load the prefix in non-contiguous mode, even if it happens to be + * adjacent to the data, to guarantee determinism. + * + * If you really care about determinism when using a dictionary or prefix, + * like when doing delta compression, you should select this option. It comes + * at a speed penalty of about ~2.5% if the dictionary and data happened to be + * contiguous, and is free if they weren't contiguous. We don't expect that + * intentionally making the dictionary and data contiguous will be worth the + * cost to memcpy() the data. + */ +#define ZSTD_c_deterministicRefPrefix ZSTD_c_experimentalParam15 + +/* ZSTD_c_prefetchCDictTables + * Controlled with ZSTD_paramSwitch_e enum. Default is ZSTD_ps_auto. + * + * In some situations, zstd uses CDict tables in-place rather than copying them + * into the working context. (See docs on ZSTD_dictAttachPref_e above for details). + * In such situations, compression speed is seriously impacted when CDict tables are + * "cold" (outside CPU cache). This parameter instructs zstd to prefetch CDict tables + * when they are used in-place. + * + * For sufficiently small inputs, the cost of the prefetch will outweigh the benefit. + * For sufficiently large inputs, zstd will by default memcpy() CDict tables + * into the working context, so there is no need to prefetch. This parameter is + * targeted at a middle range of input sizes, where a prefetch is cheap enough to be + * useful but memcpy() is too expensive. The exact range of input sizes where this + * makes sense is best determined by careful experimentation. + * + * Note: for this parameter, ZSTD_ps_auto is currently equivalent to ZSTD_ps_disable, + * but in the future zstd may conditionally enable this feature via an auto-detection + * heuristic for cold CDicts. + * Use ZSTD_ps_disable to opt out of prefetching under any circumstances. + */ +#define ZSTD_c_prefetchCDictTables ZSTD_c_experimentalParam16 + +/* ZSTD_c_enableSeqProducerFallback + * Allowed values are 0 (disable) and 1 (enable). The default setting is 0. + * + * Controls whether zstd will fall back to an internal sequence producer if an + * external sequence producer is registered and returns an error code. This fallback + * is block-by-block: the internal sequence producer will only be called for blocks + * where the external sequence producer returns an error code. Fallback parsing will + * follow any other cParam settings, such as compression level, the same as in a + * normal (fully-internal) compression operation. + * + * The user is strongly encouraged to read the full Block-Level Sequence Producer API + * documentation (below) before setting this parameter. */ +#define ZSTD_c_enableSeqProducerFallback ZSTD_c_experimentalParam17 + +/* ZSTD_c_maxBlockSize + * Allowed values are between 1KB and ZSTD_BLOCKSIZE_MAX (128KB). + * The default is ZSTD_BLOCKSIZE_MAX, and setting to 0 will set to the default. + * + * This parameter can be used to set an upper bound on the blocksize + * that overrides the default ZSTD_BLOCKSIZE_MAX. It cannot be used to set upper + * bounds greater than ZSTD_BLOCKSIZE_MAX or bounds lower than 1KB (will make + * compressBound() inaccurate). Only currently meant to be used for testing. + */ +#define ZSTD_c_maxBlockSize ZSTD_c_experimentalParam18 + +/* ZSTD_c_searchForExternalRepcodes + * This parameter affects how zstd parses external sequences, such as sequences + * provided through the compressSequences() API or from an external block-level + * sequence producer. + * + * If set to ZSTD_ps_enable, the library will check for repeated offsets in + * external sequences, even if those repcodes are not explicitly indicated in + * the "rep" field. Note that this is the only way to exploit repcode matches + * while using compressSequences() or an external sequence producer, since zstd + * currently ignores the "rep" field of external sequences. + * + * If set to ZSTD_ps_disable, the library will not exploit repeated offsets in + * external sequences, regardless of whether the "rep" field has been set. This + * reduces sequence compression overhead by about 25% while sacrificing some + * compression ratio. + * + * The default value is ZSTD_ps_auto, for which the library will enable/disable + * based on compression level. + * + * Note: for now, this param only has an effect if ZSTD_c_blockDelimiters is + * set to ZSTD_sf_explicitBlockDelimiters. That may change in the future. + */ +#define ZSTD_c_searchForExternalRepcodes ZSTD_c_experimentalParam19 + + +/*! ZSTD_CCtx_getParameter() : + * Get the requested compression parameter value, selected by enum ZSTD_cParameter, + * and store it into int* value. + * @return : 0, or an error code (which can be tested with ZSTD_isError()). + */ +ZSTDLIB_STATIC_API size_t ZSTD_CCtx_getParameter(const ZSTD_CCtx* cctx, ZSTD_cParameter param, int* value); + + +/*! ZSTD_CCtx_params : + * Quick howto : + * - ZSTD_createCCtxParams() : Create a ZSTD_CCtx_params structure + * - ZSTD_CCtxParams_setParameter() : Push parameters one by one into + * an existing ZSTD_CCtx_params structure. + * This is similar to + * ZSTD_CCtx_setParameter(). + * - ZSTD_CCtx_setParametersUsingCCtxParams() : Apply parameters to + * an existing CCtx. + * These parameters will be applied to + * all subsequent frames. + * - ZSTD_compressStream2() : Do compression using the CCtx. + * - ZSTD_freeCCtxParams() : Free the memory, accept NULL pointer. + * + * This can be used with ZSTD_estimateCCtxSize_advanced_usingCCtxParams() + * for static allocation of CCtx for single-threaded compression. + */ +ZSTDLIB_STATIC_API ZSTD_CCtx_params* ZSTD_createCCtxParams(void); +ZSTDLIB_STATIC_API size_t ZSTD_freeCCtxParams(ZSTD_CCtx_params* params); /* accept NULL pointer */ + +/*! ZSTD_CCtxParams_reset() : + * Reset params to default values. + */ +ZSTDLIB_STATIC_API size_t ZSTD_CCtxParams_reset(ZSTD_CCtx_params* params); + +/*! ZSTD_CCtxParams_init() : + * Initializes the compression parameters of cctxParams according to + * compression level. All other parameters are reset to their default values. + */ +ZSTDLIB_STATIC_API size_t ZSTD_CCtxParams_init(ZSTD_CCtx_params* cctxParams, int compressionLevel); + +/*! ZSTD_CCtxParams_init_advanced() : + * Initializes the compression and frame parameters of cctxParams according to + * params. All other parameters are reset to their default values. + */ +ZSTDLIB_STATIC_API size_t ZSTD_CCtxParams_init_advanced(ZSTD_CCtx_params* cctxParams, ZSTD_parameters params); + +/*! ZSTD_CCtxParams_setParameter() : Requires v1.4.0+ + * Similar to ZSTD_CCtx_setParameter. + * Set one compression parameter, selected by enum ZSTD_cParameter. + * Parameters must be applied to a ZSTD_CCtx using + * ZSTD_CCtx_setParametersUsingCCtxParams(). + * @result : a code representing success or failure (which can be tested with + * ZSTD_isError()). + */ +ZSTDLIB_STATIC_API size_t ZSTD_CCtxParams_setParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, int value); + +/*! ZSTD_CCtxParams_getParameter() : + * Similar to ZSTD_CCtx_getParameter. + * Get the requested value of one compression parameter, selected by enum ZSTD_cParameter. + * @result : 0, or an error code (which can be tested with ZSTD_isError()). + */ +ZSTDLIB_STATIC_API size_t ZSTD_CCtxParams_getParameter(const ZSTD_CCtx_params* params, ZSTD_cParameter param, int* value); + +/*! ZSTD_CCtx_setParametersUsingCCtxParams() : + * Apply a set of ZSTD_CCtx_params to the compression context. + * This can be done even after compression is started, + * if nbWorkers==0, this will have no impact until a new compression is started. + * if nbWorkers>=1, new parameters will be picked up at next job, + * with a few restrictions (windowLog, pledgedSrcSize, nbWorkers, jobSize, and overlapLog are not updated). + */ +ZSTDLIB_STATIC_API size_t ZSTD_CCtx_setParametersUsingCCtxParams( + ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params); + +/*! ZSTD_compressStream2_simpleArgs() : + * Same as ZSTD_compressStream2(), + * but using only integral types as arguments. + * This variant might be helpful for binders from dynamic languages + * which have troubles handling structures containing memory pointers. + */ +ZSTDLIB_STATIC_API size_t ZSTD_compressStream2_simpleArgs ( + ZSTD_CCtx* cctx, + void* dst, size_t dstCapacity, size_t* dstPos, + const void* src, size_t srcSize, size_t* srcPos, + ZSTD_EndDirective endOp); + + +/*************************************** +* Advanced decompression functions +***************************************/ + +/*! ZSTD_isFrame() : + * Tells if the content of `buffer` starts with a valid Frame Identifier. + * Note : Frame Identifier is 4 bytes. If `size < 4`, @return will always be 0. + * Note 2 : Legacy Frame Identifiers are considered valid only if Legacy Support is enabled. + * Note 3 : Skippable Frame Identifiers are considered valid. */ +ZSTDLIB_STATIC_API unsigned ZSTD_isFrame(const void* buffer, size_t size); + +/*! ZSTD_createDDict_byReference() : + * Create a digested dictionary, ready to start decompression operation without startup delay. + * Dictionary content is referenced, and therefore stays in dictBuffer. + * It is important that dictBuffer outlives DDict, + * it must remain read accessible throughout the lifetime of DDict */ +ZSTDLIB_STATIC_API ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize); + +/*! ZSTD_DCtx_loadDictionary_byReference() : + * Same as ZSTD_DCtx_loadDictionary(), + * but references `dict` content instead of copying it into `dctx`. + * This saves memory if `dict` remains around., + * However, it's imperative that `dict` remains accessible (and unmodified) while being used, so it must outlive decompression. */ +ZSTDLIB_STATIC_API size_t ZSTD_DCtx_loadDictionary_byReference(ZSTD_DCtx* dctx, const void* dict, size_t dictSize); + +/*! ZSTD_DCtx_loadDictionary_advanced() : + * Same as ZSTD_DCtx_loadDictionary(), + * but gives direct control over + * how to load the dictionary (by copy ? by reference ?) + * and how to interpret it (automatic ? force raw mode ? full mode only ?). */ +ZSTDLIB_STATIC_API size_t ZSTD_DCtx_loadDictionary_advanced(ZSTD_DCtx* dctx, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType); + +/*! ZSTD_DCtx_refPrefix_advanced() : + * Same as ZSTD_DCtx_refPrefix(), but gives finer control over + * how to interpret prefix content (automatic ? force raw mode (default) ? full mode only ?) */ +ZSTDLIB_STATIC_API size_t ZSTD_DCtx_refPrefix_advanced(ZSTD_DCtx* dctx, const void* prefix, size_t prefixSize, ZSTD_dictContentType_e dictContentType); + +/*! ZSTD_DCtx_setMaxWindowSize() : + * Refuses allocating internal buffers for frames requiring a window size larger than provided limit. + * This protects a decoder context from reserving too much memory for itself (potential attack scenario). + * This parameter is only useful in streaming mode, since no internal buffer is allocated in single-pass mode. + * By default, a decompression context accepts all window sizes <= (1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT) + * @return : 0, or an error code (which can be tested using ZSTD_isError()). + */ +ZSTDLIB_STATIC_API size_t ZSTD_DCtx_setMaxWindowSize(ZSTD_DCtx* dctx, size_t maxWindowSize); + +/*! ZSTD_DCtx_getParameter() : + * Get the requested decompression parameter value, selected by enum ZSTD_dParameter, + * and store it into int* value. + * @return : 0, or an error code (which can be tested with ZSTD_isError()). + */ +ZSTDLIB_STATIC_API size_t ZSTD_DCtx_getParameter(ZSTD_DCtx* dctx, ZSTD_dParameter param, int* value); + +/* ZSTD_d_format + * experimental parameter, + * allowing selection between ZSTD_format_e input compression formats + */ +#define ZSTD_d_format ZSTD_d_experimentalParam1 +/* ZSTD_d_stableOutBuffer + * Experimental parameter. + * Default is 0 == disabled. Set to 1 to enable. + * + * Tells the decompressor that the ZSTD_outBuffer will ALWAYS be the same + * between calls, except for the modifications that zstd makes to pos (the + * caller must not modify pos). This is checked by the decompressor, and + * decompression will fail if it ever changes. Therefore the ZSTD_outBuffer + * MUST be large enough to fit the entire decompressed frame. This will be + * checked when the frame content size is known. The data in the ZSTD_outBuffer + * in the range [dst, dst + pos) MUST not be modified during decompression + * or you will get data corruption. + * + * When this flag is enabled zstd won't allocate an output buffer, because + * it can write directly to the ZSTD_outBuffer, but it will still allocate + * an input buffer large enough to fit any compressed block. This will also + * avoid the memcpy() from the internal output buffer to the ZSTD_outBuffer. + * If you need to avoid the input buffer allocation use the buffer-less + * streaming API. + * + * NOTE: So long as the ZSTD_outBuffer always points to valid memory, using + * this flag is ALWAYS memory safe, and will never access out-of-bounds + * memory. However, decompression WILL fail if you violate the preconditions. + * + * WARNING: The data in the ZSTD_outBuffer in the range [dst, dst + pos) MUST + * not be modified during decompression or you will get data corruption. This + * is because zstd needs to reference data in the ZSTD_outBuffer to regenerate + * matches. Normally zstd maintains its own buffer for this purpose, but passing + * this flag tells zstd to use the user provided buffer. + */ +#define ZSTD_d_stableOutBuffer ZSTD_d_experimentalParam2 + +/* ZSTD_d_forceIgnoreChecksum + * Experimental parameter. + * Default is 0 == disabled. Set to 1 to enable + * + * Tells the decompressor to skip checksum validation during decompression, regardless + * of whether checksumming was specified during compression. This offers some + * slight performance benefits, and may be useful for debugging. + * Param has values of type ZSTD_forceIgnoreChecksum_e + */ +#define ZSTD_d_forceIgnoreChecksum ZSTD_d_experimentalParam3 + +/* ZSTD_d_refMultipleDDicts + * Experimental parameter. + * Default is 0 == disabled. Set to 1 to enable + * + * If enabled and dctx is allocated on the heap, then additional memory will be allocated + * to store references to multiple ZSTD_DDict. That is, multiple calls of ZSTD_refDDict() + * using a given ZSTD_DCtx, rather than overwriting the previous DDict reference, will instead + * store all references. At decompression time, the appropriate dictID is selected + * from the set of DDicts based on the dictID in the frame. + * + * Usage is simply calling ZSTD_refDDict() on multiple dict buffers. + * + * Param has values of byte ZSTD_refMultipleDDicts_e + * + * WARNING: Enabling this parameter and calling ZSTD_DCtx_refDDict(), will trigger memory + * allocation for the hash table. ZSTD_freeDCtx() also frees this memory. + * Memory is allocated as per ZSTD_DCtx::customMem. + * + * Although this function allocates memory for the table, the user is still responsible for + * memory management of the underlying ZSTD_DDict* themselves. + */ +#define ZSTD_d_refMultipleDDicts ZSTD_d_experimentalParam4 + +/* ZSTD_d_disableHuffmanAssembly + * Set to 1 to disable the Huffman assembly implementation. + * The default value is 0, which allows zstd to use the Huffman assembly + * implementation if available. + * + * This parameter can be used to disable Huffman assembly at runtime. + * If you want to disable it at compile time you can define the macro + * ZSTD_DISABLE_ASM. + */ +#define ZSTD_d_disableHuffmanAssembly ZSTD_d_experimentalParam5 + +/* ZSTD_d_maxBlockSize + * Allowed values are between 1KB and ZSTD_BLOCKSIZE_MAX (128KB). + * The default is ZSTD_BLOCKSIZE_MAX, and setting to 0 will set to the default. + * + * Forces the decompressor to reject blocks whose content size is + * larger than the configured maxBlockSize. When maxBlockSize is + * larger than the windowSize, the windowSize is used instead. + * This saves memory on the decoder when you know all blocks are small. + * + * This option is typically used in conjunction with ZSTD_c_maxBlockSize. + * + * WARNING: This causes the decoder to reject otherwise valid frames + * that have block sizes larger than the configured maxBlockSize. + */ +#define ZSTD_d_maxBlockSize ZSTD_d_experimentalParam6 + + +/*! ZSTD_DCtx_setFormat() : + * This function is REDUNDANT. Prefer ZSTD_DCtx_setParameter(). + * Instruct the decoder context about what kind of data to decode next. + * This instruction is mandatory to decode data without a fully-formed header, + * such ZSTD_f_zstd1_magicless for example. + * @return : 0, or an error code (which can be tested using ZSTD_isError()). */ +ZSTD_DEPRECATED("use ZSTD_DCtx_setParameter() instead") +ZSTDLIB_STATIC_API +size_t ZSTD_DCtx_setFormat(ZSTD_DCtx* dctx, ZSTD_format_e format); + +/*! ZSTD_decompressStream_simpleArgs() : + * Same as ZSTD_decompressStream(), + * but using only integral types as arguments. + * This can be helpful for binders from dynamic languages + * which have troubles handling structures containing memory pointers. + */ +ZSTDLIB_STATIC_API size_t ZSTD_decompressStream_simpleArgs ( + ZSTD_DCtx* dctx, + void* dst, size_t dstCapacity, size_t* dstPos, + const void* src, size_t srcSize, size_t* srcPos); + + +/******************************************************************** +* Advanced streaming functions +* Warning : most of these functions are now redundant with the Advanced API. +* Once Advanced API reaches "stable" status, +* redundant functions will be deprecated, and then at some point removed. +********************************************************************/ + +/*===== Advanced Streaming compression functions =====*/ + +/*! ZSTD_initCStream_srcSize() : + * This function is DEPRECATED, and equivalent to: + * ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); + * ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any) + * ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel); + * ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize); + * + * pledgedSrcSize must be correct. If it is not known at init time, use + * ZSTD_CONTENTSIZE_UNKNOWN. Note that, for compatibility with older programs, + * "0" also disables frame content size field. It may be enabled in the future. + * This prototype will generate compilation warnings. + */ +ZSTD_DEPRECATED("use ZSTD_CCtx_reset, see zstd.h for detailed instructions") +ZSTDLIB_STATIC_API +size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, + int compressionLevel, + unsigned long long pledgedSrcSize); + +/*! ZSTD_initCStream_usingDict() : + * This function is DEPRECATED, and is equivalent to: + * ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); + * ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel); + * ZSTD_CCtx_loadDictionary(zcs, dict, dictSize); + * + * Creates of an internal CDict (incompatible with static CCtx), except if + * dict == NULL or dictSize < 8, in which case no dict is used. + * Note: dict is loaded with ZSTD_dct_auto (treated as a full zstd dictionary if + * it begins with ZSTD_MAGIC_DICTIONARY, else as raw content) and ZSTD_dlm_byCopy. + * This prototype will generate compilation warnings. + */ +ZSTD_DEPRECATED("use ZSTD_CCtx_reset, see zstd.h for detailed instructions") +ZSTDLIB_STATIC_API +size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, + const void* dict, size_t dictSize, + int compressionLevel); + +/*! ZSTD_initCStream_advanced() : + * This function is DEPRECATED, and is equivalent to: + * ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); + * ZSTD_CCtx_setParams(zcs, params); + * ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize); + * ZSTD_CCtx_loadDictionary(zcs, dict, dictSize); + * + * dict is loaded with ZSTD_dct_auto and ZSTD_dlm_byCopy. + * pledgedSrcSize must be correct. + * If srcSize is not known at init time, use value ZSTD_CONTENTSIZE_UNKNOWN. + * This prototype will generate compilation warnings. + */ +ZSTD_DEPRECATED("use ZSTD_CCtx_reset, see zstd.h for detailed instructions") +ZSTDLIB_STATIC_API +size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, + const void* dict, size_t dictSize, + ZSTD_parameters params, + unsigned long long pledgedSrcSize); + +/*! ZSTD_initCStream_usingCDict() : + * This function is DEPRECATED, and equivalent to: + * ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); + * ZSTD_CCtx_refCDict(zcs, cdict); + * + * note : cdict will just be referenced, and must outlive compression session + * This prototype will generate compilation warnings. + */ +ZSTD_DEPRECATED("use ZSTD_CCtx_reset and ZSTD_CCtx_refCDict, see zstd.h for detailed instructions") +ZSTDLIB_STATIC_API +size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict); + +/*! ZSTD_initCStream_usingCDict_advanced() : + * This function is DEPRECATED, and is equivalent to: + * ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); + * ZSTD_CCtx_setFParams(zcs, fParams); + * ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize); + * ZSTD_CCtx_refCDict(zcs, cdict); + * + * same as ZSTD_initCStream_usingCDict(), with control over frame parameters. + * pledgedSrcSize must be correct. If srcSize is not known at init time, use + * value ZSTD_CONTENTSIZE_UNKNOWN. + * This prototype will generate compilation warnings. + */ +ZSTD_DEPRECATED("use ZSTD_CCtx_reset and ZSTD_CCtx_refCDict, see zstd.h for detailed instructions") +ZSTDLIB_STATIC_API +size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, + const ZSTD_CDict* cdict, + ZSTD_frameParameters fParams, + unsigned long long pledgedSrcSize); + +/*! ZSTD_resetCStream() : + * This function is DEPRECATED, and is equivalent to: + * ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); + * ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize); + * Note: ZSTD_resetCStream() interprets pledgedSrcSize == 0 as ZSTD_CONTENTSIZE_UNKNOWN, but + * ZSTD_CCtx_setPledgedSrcSize() does not do the same, so ZSTD_CONTENTSIZE_UNKNOWN must be + * explicitly specified. + * + * start a new frame, using same parameters from previous frame. + * This is typically useful to skip dictionary loading stage, since it will reuse it in-place. + * Note that zcs must be init at least once before using ZSTD_resetCStream(). + * If pledgedSrcSize is not known at reset time, use macro ZSTD_CONTENTSIZE_UNKNOWN. + * If pledgedSrcSize > 0, its value must be correct, as it will be written in header, and controlled at the end. + * For the time being, pledgedSrcSize==0 is interpreted as "srcSize unknown" for compatibility with older programs, + * but it will change to mean "empty" in future version, so use macro ZSTD_CONTENTSIZE_UNKNOWN instead. + * @return : 0, or an error code (which can be tested using ZSTD_isError()) + * This prototype will generate compilation warnings. + */ +ZSTD_DEPRECATED("use ZSTD_CCtx_reset, see zstd.h for detailed instructions") +ZSTDLIB_STATIC_API +size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize); + + +typedef struct { + unsigned long long ingested; /* nb input bytes read and buffered */ + unsigned long long consumed; /* nb input bytes actually compressed */ + unsigned long long produced; /* nb of compressed bytes generated and buffered */ + unsigned long long flushed; /* nb of compressed bytes flushed : not provided; can be tracked from caller side */ + unsigned currentJobID; /* MT only : latest started job nb */ + unsigned nbActiveWorkers; /* MT only : nb of workers actively compressing at probe time */ +} ZSTD_frameProgression; + +/* ZSTD_getFrameProgression() : + * tells how much data has been ingested (read from input) + * consumed (input actually compressed) and produced (output) for current frame. + * Note : (ingested - consumed) is amount of input data buffered internally, not yet compressed. + * Aggregates progression inside active worker threads. + */ +ZSTDLIB_STATIC_API ZSTD_frameProgression ZSTD_getFrameProgression(const ZSTD_CCtx* cctx); + +/*! ZSTD_toFlushNow() : + * Tell how many bytes are ready to be flushed immediately. + * Useful for multithreading scenarios (nbWorkers >= 1). + * Probe the oldest active job, defined as oldest job not yet entirely flushed, + * and check its output buffer. + * @return : amount of data stored in oldest job and ready to be flushed immediately. + * if @return == 0, it means either : + * + there is no active job (could be checked with ZSTD_frameProgression()), or + * + oldest job is still actively compressing data, + * but everything it has produced has also been flushed so far, + * therefore flush speed is limited by production speed of oldest job + * irrespective of the speed of concurrent (and newer) jobs. + */ +ZSTDLIB_STATIC_API size_t ZSTD_toFlushNow(ZSTD_CCtx* cctx); + + +/*===== Advanced Streaming decompression functions =====*/ + +/*! + * This function is deprecated, and is equivalent to: + * + * ZSTD_DCtx_reset(zds, ZSTD_reset_session_only); + * ZSTD_DCtx_loadDictionary(zds, dict, dictSize); + * + * note: no dictionary will be used if dict == NULL or dictSize < 8 + */ +ZSTD_DEPRECATED("use ZSTD_DCtx_reset + ZSTD_DCtx_loadDictionary, see zstd.h for detailed instructions") +ZSTDLIB_STATIC_API size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize); + +/*! + * This function is deprecated, and is equivalent to: + * + * ZSTD_DCtx_reset(zds, ZSTD_reset_session_only); + * ZSTD_DCtx_refDDict(zds, ddict); + * + * note : ddict is referenced, it must outlive decompression session + */ +ZSTD_DEPRECATED("use ZSTD_DCtx_reset + ZSTD_DCtx_refDDict, see zstd.h for detailed instructions") +ZSTDLIB_STATIC_API size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict); + +/*! + * This function is deprecated, and is equivalent to: + * + * ZSTD_DCtx_reset(zds, ZSTD_reset_session_only); + * + * reuse decompression parameters from previous init; saves dictionary loading + */ +ZSTD_DEPRECATED("use ZSTD_DCtx_reset, see zstd.h for detailed instructions") +ZSTDLIB_STATIC_API size_t ZSTD_resetDStream(ZSTD_DStream* zds); + + +/* ********************* BLOCK-LEVEL SEQUENCE PRODUCER API ********************* + * + * *** OVERVIEW *** + * The Block-Level Sequence Producer API allows users to provide their own custom + * sequence producer which libzstd invokes to process each block. The produced list + * of sequences (literals and matches) is then post-processed by libzstd to produce + * valid compressed blocks. + * + * This block-level offload API is a more granular complement of the existing + * frame-level offload API compressSequences() (introduced in v1.5.1). It offers + * an easier migration story for applications already integrated with libzstd: the + * user application continues to invoke the same compression functions + * ZSTD_compress2() or ZSTD_compressStream2() as usual, and transparently benefits + * from the specific advantages of the external sequence producer. For example, + * the sequence producer could be tuned to take advantage of known characteristics + * of the input, to offer better speed / ratio, or could leverage hardware + * acceleration not available within libzstd itself. + * + * See contrib/externalSequenceProducer for an example program employing the + * Block-Level Sequence Producer API. + * + * *** USAGE *** + * The user is responsible for implementing a function of type + * ZSTD_sequenceProducer_F. For each block, zstd will pass the following + * arguments to the user-provided function: + * + * - sequenceProducerState: a pointer to a user-managed state for the sequence + * producer. + * + * - outSeqs, outSeqsCapacity: an output buffer for the sequence producer. + * outSeqsCapacity is guaranteed >= ZSTD_sequenceBound(srcSize). The memory + * backing outSeqs is managed by the CCtx. + * + * - src, srcSize: an input buffer for the sequence producer to parse. + * srcSize is guaranteed to be <= ZSTD_BLOCKSIZE_MAX. + * + * - dict, dictSize: a history buffer, which may be empty, which the sequence + * producer may reference as it parses the src buffer. Currently, zstd will + * always pass dictSize == 0 into external sequence producers, but this will + * change in the future. + * + * - compressionLevel: a signed integer representing the zstd compression level + * set by the user for the current operation. The sequence producer may choose + * to use this information to change its compression strategy and speed/ratio + * tradeoff. Note: the compression level does not reflect zstd parameters set + * through the advanced API. + * + * - windowSize: a size_t representing the maximum allowed offset for external + * sequences. Note that sequence offsets are sometimes allowed to exceed the + * windowSize if a dictionary is present, see doc/zstd_compression_format.md + * for details. + * + * The user-provided function shall return a size_t representing the number of + * sequences written to outSeqs. This return value will be treated as an error + * code if it is greater than outSeqsCapacity. The return value must be non-zero + * if srcSize is non-zero. The ZSTD_SEQUENCE_PRODUCER_ERROR macro is provided + * for convenience, but any value greater than outSeqsCapacity will be treated as + * an error code. + * + * If the user-provided function does not return an error code, the sequences + * written to outSeqs must be a valid parse of the src buffer. Data corruption may + * occur if the parse is not valid. A parse is defined to be valid if the + * following conditions hold: + * - The sum of matchLengths and literalLengths must equal srcSize. + * - All sequences in the parse, except for the final sequence, must have + * matchLength >= ZSTD_MINMATCH_MIN. The final sequence must have + * matchLength >= ZSTD_MINMATCH_MIN or matchLength == 0. + * - All offsets must respect the windowSize parameter as specified in + * doc/zstd_compression_format.md. + * - If the final sequence has matchLength == 0, it must also have offset == 0. + * + * zstd will only validate these conditions (and fail compression if they do not + * hold) if the ZSTD_c_validateSequences cParam is enabled. Note that sequence + * validation has a performance cost. + * + * If the user-provided function returns an error, zstd will either fall back + * to an internal sequence producer or fail the compression operation. The user can + * choose between the two behaviors by setting the ZSTD_c_enableSeqProducerFallback + * cParam. Fallback compression will follow any other cParam settings, such as + * compression level, the same as in a normal compression operation. + * + * The user shall instruct zstd to use a particular ZSTD_sequenceProducer_F + * function by calling + * ZSTD_registerSequenceProducer(cctx, + * sequenceProducerState, + * sequenceProducer) + * This setting will persist until the next parameter reset of the CCtx. + * + * The sequenceProducerState must be initialized by the user before calling + * ZSTD_registerSequenceProducer(). The user is responsible for destroying the + * sequenceProducerState. + * + * *** LIMITATIONS *** + * This API is compatible with all zstd compression APIs which respect advanced parameters. + * However, there are three limitations: + * + * First, the ZSTD_c_enableLongDistanceMatching cParam is not currently supported. + * COMPRESSION WILL FAIL if it is enabled and the user tries to compress with a block-level + * external sequence producer. + * - Note that ZSTD_c_enableLongDistanceMatching is auto-enabled by default in some + * cases (see its documentation for details). Users must explicitly set + * ZSTD_c_enableLongDistanceMatching to ZSTD_ps_disable in such cases if an external + * sequence producer is registered. + * - As of this writing, ZSTD_c_enableLongDistanceMatching is disabled by default + * whenever ZSTD_c_windowLog < 128MB, but that's subject to change. Users should + * check the docs on ZSTD_c_enableLongDistanceMatching whenever the Block-Level Sequence + * Producer API is used in conjunction with advanced settings (like ZSTD_c_windowLog). + * + * Second, history buffers are not currently supported. Concretely, zstd will always pass + * dictSize == 0 to the external sequence producer (for now). This has two implications: + * - Dictionaries are not currently supported. Compression will *not* fail if the user + * references a dictionary, but the dictionary won't have any effect. + * - Stream history is not currently supported. All advanced compression APIs, including + * streaming APIs, work with external sequence producers, but each block is treated as + * an independent chunk without history from previous blocks. + * + * Third, multi-threading within a single compression is not currently supported. In other words, + * COMPRESSION WILL FAIL if ZSTD_c_nbWorkers > 0 and an external sequence producer is registered. + * Multi-threading across compressions is fine: simply create one CCtx per thread. + * + * Long-term, we plan to overcome all three limitations. There is no technical blocker to + * overcoming them. It is purely a question of engineering effort. + */ + +#define ZSTD_SEQUENCE_PRODUCER_ERROR ((size_t)(-1)) + +typedef size_t (*ZSTD_sequenceProducer_F) ( + void* sequenceProducerState, + ZSTD_Sequence* outSeqs, size_t outSeqsCapacity, + const void* src, size_t srcSize, + const void* dict, size_t dictSize, + int compressionLevel, + size_t windowSize +); + +/*! ZSTD_registerSequenceProducer() : + * Instruct zstd to use a block-level external sequence producer function. + * + * The sequenceProducerState must be initialized by the caller, and the caller is + * responsible for managing its lifetime. This parameter is sticky across + * compressions. It will remain set until the user explicitly resets compression + * parameters. + * + * Sequence producer registration is considered to be an "advanced parameter", + * part of the "advanced API". This means it will only have an effect on compression + * APIs which respect advanced parameters, such as compress2() and compressStream2(). + * Older compression APIs such as compressCCtx(), which predate the introduction of + * "advanced parameters", will ignore any external sequence producer setting. + * + * The sequence producer can be "cleared" by registering a NULL function pointer. This + * removes all limitations described above in the "LIMITATIONS" section of the API docs. + * + * The user is strongly encouraged to read the full API documentation (above) before + * calling this function. */ +ZSTDLIB_STATIC_API void +ZSTD_registerSequenceProducer( + ZSTD_CCtx* cctx, + void* sequenceProducerState, + ZSTD_sequenceProducer_F sequenceProducer +); + +/*! ZSTD_CCtxParams_registerSequenceProducer() : + * Same as ZSTD_registerSequenceProducer(), but operates on ZSTD_CCtx_params. + * This is used for accurate size estimation with ZSTD_estimateCCtxSize_usingCCtxParams(), + * which is needed when creating a ZSTD_CCtx with ZSTD_initStaticCCtx(). + * + * If you are using the external sequence producer API in a scenario where ZSTD_initStaticCCtx() + * is required, then this function is for you. Otherwise, you probably don't need it. + * + * See tests/zstreamtest.c for example usage. */ +ZSTDLIB_STATIC_API void +ZSTD_CCtxParams_registerSequenceProducer( + ZSTD_CCtx_params* params, + void* sequenceProducerState, + ZSTD_sequenceProducer_F sequenceProducer +); + + +/********************************************************************* +* Buffer-less and synchronous inner streaming functions (DEPRECATED) +* +* This API is deprecated, and will be removed in a future version. +* It allows streaming (de)compression with user allocated buffers. +* However, it is hard to use, and not as well tested as the rest of +* our API. +* +* Please use the normal streaming API instead: ZSTD_compressStream2, +* and ZSTD_decompressStream. +* If there is functionality that you need, but it doesn't provide, +* please open an issue on our GitHub. +********************************************************************* */ + +/** + Buffer-less streaming compression (synchronous mode) + + A ZSTD_CCtx object is required to track streaming operations. + Use ZSTD_createCCtx() / ZSTD_freeCCtx() to manage resource. + ZSTD_CCtx object can be reused multiple times within successive compression operations. + + Start by initializing a context. + Use ZSTD_compressBegin(), or ZSTD_compressBegin_usingDict() for dictionary compression. + + Then, consume your input using ZSTD_compressContinue(). + There are some important considerations to keep in mind when using this advanced function : + - ZSTD_compressContinue() has no internal buffer. It uses externally provided buffers only. + - Interface is synchronous : input is consumed entirely and produces 1+ compressed blocks. + - Caller must ensure there is enough space in `dst` to store compressed data under worst case scenario. + Worst case evaluation is provided by ZSTD_compressBound(). + ZSTD_compressContinue() doesn't guarantee recover after a failed compression. + - ZSTD_compressContinue() presumes prior input ***is still accessible and unmodified*** (up to maximum distance size, see WindowLog). + It remembers all previous contiguous blocks, plus one separated memory segment (which can itself consists of multiple contiguous blocks) + - ZSTD_compressContinue() detects that prior input has been overwritten when `src` buffer overlaps. + In which case, it will "discard" the relevant memory section from its history. + + Finish a frame with ZSTD_compressEnd(), which will write the last block(s) and optional checksum. + It's possible to use srcSize==0, in which case, it will write a final empty block to end the frame. + Without last block mark, frames are considered unfinished (hence corrupted) by compliant decoders. + + `ZSTD_CCtx` object can be reused (ZSTD_compressBegin()) to compress again. +*/ + +/*===== Buffer-less streaming compression functions =====*/ +ZSTD_DEPRECATED("The buffer-less API is deprecated in favor of the normal streaming API. See docs.") +ZSTDLIB_STATIC_API size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, int compressionLevel); +ZSTD_DEPRECATED("The buffer-less API is deprecated in favor of the normal streaming API. See docs.") +ZSTDLIB_STATIC_API size_t ZSTD_compressBegin_usingDict(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, int compressionLevel); +ZSTD_DEPRECATED("The buffer-less API is deprecated in favor of the normal streaming API. See docs.") +ZSTDLIB_STATIC_API size_t ZSTD_compressBegin_usingCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict); /**< note: fails if cdict==NULL */ + +ZSTD_DEPRECATED("This function will likely be removed in a future release. It is misleading and has very limited utility.") +ZSTDLIB_STATIC_API +size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx* preparedCCtx, unsigned long long pledgedSrcSize); /**< note: if pledgedSrcSize is not known, use ZSTD_CONTENTSIZE_UNKNOWN */ + +ZSTD_DEPRECATED("The buffer-less API is deprecated in favor of the normal streaming API. See docs.") +ZSTDLIB_STATIC_API size_t ZSTD_compressContinue(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize); +ZSTD_DEPRECATED("The buffer-less API is deprecated in favor of the normal streaming API. See docs.") +ZSTDLIB_STATIC_API size_t ZSTD_compressEnd(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize); + +/* The ZSTD_compressBegin_advanced() and ZSTD_compressBegin_usingCDict_advanced() are now DEPRECATED and will generate a compiler warning */ +ZSTD_DEPRECATED("use advanced API to access custom parameters") +ZSTDLIB_STATIC_API +size_t ZSTD_compressBegin_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_parameters params, unsigned long long pledgedSrcSize); /**< pledgedSrcSize : If srcSize is not known at init time, use ZSTD_CONTENTSIZE_UNKNOWN */ +ZSTD_DEPRECATED("use advanced API to access custom parameters") +ZSTDLIB_STATIC_API +size_t ZSTD_compressBegin_usingCDict_advanced(ZSTD_CCtx* const cctx, const ZSTD_CDict* const cdict, ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize); /* compression parameters are already set within cdict. pledgedSrcSize must be correct. If srcSize is not known, use macro ZSTD_CONTENTSIZE_UNKNOWN */ +/** + Buffer-less streaming decompression (synchronous mode) + + A ZSTD_DCtx object is required to track streaming operations. + Use ZSTD_createDCtx() / ZSTD_freeDCtx() to manage it. + A ZSTD_DCtx object can be reused multiple times. + + First typical operation is to retrieve frame parameters, using ZSTD_getFrameHeader(). + Frame header is extracted from the beginning of compressed frame, so providing only the frame's beginning is enough. + Data fragment must be large enough to ensure successful decoding. + `ZSTD_frameHeaderSize_max` bytes is guaranteed to always be large enough. + result : 0 : successful decoding, the `ZSTD_frameHeader` structure is correctly filled. + >0 : `srcSize` is too small, please provide at least result bytes on next attempt. + errorCode, which can be tested using ZSTD_isError(). + + It fills a ZSTD_frameHeader structure with important information to correctly decode the frame, + such as the dictionary ID, content size, or maximum back-reference distance (`windowSize`). + Note that these values could be wrong, either because of data corruption, or because a 3rd party deliberately spoofs false information. + As a consequence, check that values remain within valid application range. + For example, do not allocate memory blindly, check that `windowSize` is within expectation. + Each application can set its own limits, depending on local restrictions. + For extended interoperability, it is recommended to support `windowSize` of at least 8 MB. + + ZSTD_decompressContinue() needs previous data blocks during decompression, up to `windowSize` bytes. + ZSTD_decompressContinue() is very sensitive to contiguity, + if 2 blocks don't follow each other, make sure that either the compressor breaks contiguity at the same place, + or that previous contiguous segment is large enough to properly handle maximum back-reference distance. + There are multiple ways to guarantee this condition. + + The most memory efficient way is to use a round buffer of sufficient size. + Sufficient size is determined by invoking ZSTD_decodingBufferSize_min(), + which can return an error code if required value is too large for current system (in 32-bits mode). + In a round buffer methodology, ZSTD_decompressContinue() decompresses each block next to previous one, + up to the moment there is not enough room left in the buffer to guarantee decoding another full block, + which maximum size is provided in `ZSTD_frameHeader` structure, field `blockSizeMax`. + At which point, decoding can resume from the beginning of the buffer. + Note that already decoded data stored in the buffer should be flushed before being overwritten. + + There are alternatives possible, for example using two or more buffers of size `windowSize` each, though they consume more memory. + + Finally, if you control the compression process, you can also ignore all buffer size rules, + as long as the encoder and decoder progress in "lock-step", + aka use exactly the same buffer sizes, break contiguity at the same place, etc. + + Once buffers are setup, start decompression, with ZSTD_decompressBegin(). + If decompression requires a dictionary, use ZSTD_decompressBegin_usingDict() or ZSTD_decompressBegin_usingDDict(). + + Then use ZSTD_nextSrcSizeToDecompress() and ZSTD_decompressContinue() alternatively. + ZSTD_nextSrcSizeToDecompress() tells how many bytes to provide as 'srcSize' to ZSTD_decompressContinue(). + ZSTD_decompressContinue() requires this _exact_ amount of bytes, or it will fail. + + result of ZSTD_decompressContinue() is the number of bytes regenerated within 'dst' (necessarily <= dstCapacity). + It can be zero : it just means ZSTD_decompressContinue() has decoded some metadata item. + It can also be an error code, which can be tested with ZSTD_isError(). + + A frame is fully decoded when ZSTD_nextSrcSizeToDecompress() returns zero. + Context can then be reset to start a new decompression. + + Note : it's possible to know if next input to present is a header or a block, using ZSTD_nextInputType(). + This information is not required to properly decode a frame. + + == Special case : skippable frames == + + Skippable frames allow integration of user-defined data into a flow of concatenated frames. + Skippable frames will be ignored (skipped) by decompressor. + The format of skippable frames is as follows : + a) Skippable frame ID - 4 Bytes, Little endian format, any value from 0x184D2A50 to 0x184D2A5F + b) Frame Size - 4 Bytes, Little endian format, unsigned 32-bits + c) Frame Content - any content (User Data) of length equal to Frame Size + For skippable frames ZSTD_getFrameHeader() returns zfhPtr->frameType==ZSTD_skippableFrame. + For skippable frames ZSTD_decompressContinue() always returns 0 : it only skips the content. +*/ + +/*===== Buffer-less streaming decompression functions =====*/ + +ZSTDLIB_STATIC_API size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize); /**< when frame content size is not known, pass in frameContentSize == ZSTD_CONTENTSIZE_UNKNOWN */ + +ZSTDLIB_STATIC_API size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx); +ZSTDLIB_STATIC_API size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize); +ZSTDLIB_STATIC_API size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict); + +ZSTDLIB_STATIC_API size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx); +ZSTDLIB_STATIC_API size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize); + +/* misc */ +ZSTD_DEPRECATED("This function will likely be removed in the next minor release. It is misleading and has very limited utility.") +ZSTDLIB_STATIC_API void ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx); typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e; -ZSTDLIB_API ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx); +ZSTDLIB_STATIC_API ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx); + + + + +/* ========================================= */ +/** Block level API (DEPRECATED) */ +/* ========================================= */ + +/*! + + This API is deprecated in favor of the regular compression API. + You can get the frame header down to 2 bytes by setting: + - ZSTD_c_format = ZSTD_f_zstd1_magicless + - ZSTD_c_contentSizeFlag = 0 + - ZSTD_c_checksumFlag = 0 + - ZSTD_c_dictIDFlag = 0 + + This API is not as well tested as our normal API, so we recommend not using it. + We will be removing it in a future version. If the normal API doesn't provide + the functionality you need, please open a GitHub issue. + + Block functions produce and decode raw zstd blocks, without frame metadata. + Frame metadata cost is typically ~12 bytes, which can be non-negligible for very small blocks (< 100 bytes). + But users will have to take in charge needed metadata to regenerate data, such as compressed and content sizes. + + A few rules to respect : + - Compressing and decompressing require a context structure + + Use ZSTD_createCCtx() and ZSTD_createDCtx() + - It is necessary to init context before starting + + compression : any ZSTD_compressBegin*() variant, including with dictionary + + decompression : any ZSTD_decompressBegin*() variant, including with dictionary + - Block size is limited, it must be <= ZSTD_getBlockSize() <= ZSTD_BLOCKSIZE_MAX == 128 KB + + If input is larger than a block size, it's necessary to split input data into multiple blocks + + For inputs larger than a single block, consider using regular ZSTD_compress() instead. + Frame metadata is not that costly, and quickly becomes negligible as source size grows larger than a block. + - When a block is considered not compressible enough, ZSTD_compressBlock() result will be 0 (zero) ! + ===> In which case, nothing is produced into `dst` ! + + User __must__ test for such outcome and deal directly with uncompressed data + + A block cannot be declared incompressible if ZSTD_compressBlock() return value was != 0. + Doing so would mess up with statistics history, leading to potential data corruption. + + ZSTD_decompressBlock() _doesn't accept uncompressed data as input_ !! + + In case of multiple successive blocks, should some of them be uncompressed, + decoder must be informed of their existence in order to follow proper history. + Use ZSTD_insertBlock() for such a case. +*/ + +/*===== Raw zstd block functions =====*/ +ZSTD_DEPRECATED("The block API is deprecated in favor of the normal compression API. See docs.") +ZSTDLIB_STATIC_API size_t ZSTD_getBlockSize (const ZSTD_CCtx* cctx); +ZSTD_DEPRECATED("The block API is deprecated in favor of the normal compression API. See docs.") +ZSTDLIB_STATIC_API size_t ZSTD_compressBlock (ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize); +ZSTD_DEPRECATED("The block API is deprecated in favor of the normal compression API. See docs.") +ZSTDLIB_STATIC_API size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize); +ZSTD_DEPRECATED("The block API is deprecated in favor of the normal compression API. See docs.") +ZSTDLIB_STATIC_API size_t ZSTD_insertBlock (ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize); /**< insert uncompressed block into `dctx` history. Useful for multi-blocks decompression. */ -ZSTDLIB_API size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize); #endif /* ZSTD_H_ZSTD_STATIC_LINKING_ONLY */ +#if defined (__cplusplus) +} +#endif diff --git a/src/bled/zstd_bits.h b/src/bled/zstd_bits.h new file mode 100644 index 00000000..8d89111a --- /dev/null +++ b/src/bled/zstd_bits.h @@ -0,0 +1,208 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +#ifndef ZSTD_BITS_H +#define ZSTD_BITS_H + +#include "zstd_mem.h" + +MEM_STATIC unsigned ZSTD_countTrailingZeros32_fallback(U32 val) +{ + assert(val != 0); + { + static const U32 DeBruijnBytePos[32] = {0, 1, 28, 2, 29, 14, 24, 3, + 30, 22, 20, 15, 25, 17, 4, 8, + 31, 27, 13, 23, 21, 19, 16, 7, + 26, 12, 18, 6, 11, 5, 10, 9}; + return DeBruijnBytePos[((U32) ((val & -(S32) val) * 0x077CB531U)) >> 27]; + } +} + +MEM_STATIC unsigned ZSTD_countTrailingZeros32(U32 val) +{ + assert(val != 0); +# if defined(_MSC_VER) +# if STATIC_BMI2 == 1 + return (unsigned)_tzcnt_u32(val); +# else + if (val != 0) { + unsigned long r; + _BitScanForward(&r, val); + return (unsigned)r; + } else { + /* Should not reach this code path */ + __assume(0); + } +# endif +# elif defined(__GNUC__) && (__GNUC__ >= 4) + return (unsigned)__builtin_ctz(val); +# elif defined(__ICCARM__) + return (unsigned)__builtin_ctz(val); +# else + return ZSTD_countTrailingZeros32_fallback(val); +# endif +} + +MEM_STATIC unsigned ZSTD_countLeadingZeros32_fallback(U32 val) { + assert(val != 0); + { + static const U32 DeBruijnClz[32] = {0, 9, 1, 10, 13, 21, 2, 29, + 11, 14, 16, 18, 22, 25, 3, 30, + 8, 12, 20, 28, 15, 17, 24, 7, + 19, 27, 23, 6, 26, 5, 4, 31}; + val |= val >> 1; + val |= val >> 2; + val |= val >> 4; + val |= val >> 8; + val |= val >> 16; + return 31 - DeBruijnClz[(val * 0x07C4ACDDU) >> 27]; + } +} + +MEM_STATIC unsigned ZSTD_countLeadingZeros32(U32 val) +{ + assert(val != 0); +# if defined(_MSC_VER) +# if STATIC_BMI2 == 1 + return (unsigned)_lzcnt_u32(val); +# else + if (val != 0) { + unsigned long r; + _BitScanReverse(&r, val); + return (unsigned)(31 - r); + } else { + /* Should not reach this code path */ + __assume(0); + } +# endif +# elif defined(__GNUC__) && (__GNUC__ >= 4) + return (unsigned)__builtin_clz(val); +# elif defined(__ICCARM__) + return (unsigned)__builtin_clz(val); +# else + return ZSTD_countLeadingZeros32_fallback(val); +# endif +} + +MEM_STATIC unsigned ZSTD_countTrailingZeros64(U64 val) +{ + assert(val != 0); +# if defined(_MSC_VER) && defined(_WIN64) +# if STATIC_BMI2 == 1 + return (unsigned)_tzcnt_u64(val); +# else + if (val != 0) { + unsigned long r; + _BitScanForward64(&r, val); + return (unsigned)r; + } else { + /* Should not reach this code path */ + __assume(0); + } +# endif +# elif defined(__GNUC__) && (__GNUC__ >= 4) && defined(__LP64__) + return (unsigned)__builtin_ctzll(val); +# elif defined(__ICCARM__) + return (unsigned)__builtin_ctzll(val); +# else + { + U32 mostSignificantWord = (U32)(val >> 32); + U32 leastSignificantWord = (U32)val; + if (leastSignificantWord == 0) { + return 32 + ZSTD_countTrailingZeros32(mostSignificantWord); + } else { + return ZSTD_countTrailingZeros32(leastSignificantWord); + } + } +# endif +} + +MEM_STATIC unsigned ZSTD_countLeadingZeros64(U64 val) +{ + assert(val != 0); +# if defined(_MSC_VER) && defined(_WIN64) +# if STATIC_BMI2 == 1 + return (unsigned)_lzcnt_u64(val); +# else + if (val != 0) { + unsigned long r; + _BitScanReverse64(&r, val); + return (unsigned)(63 - r); + } else { + /* Should not reach this code path */ + __assume(0); + } +# endif +# elif defined(__GNUC__) && (__GNUC__ >= 4) + return (unsigned)(__builtin_clzll(val)); +# elif defined(__ICCARM__) + return (unsigned)(__builtin_clzll(val)); +# else + { + U32 mostSignificantWord = (U32)(val >> 32); + U32 leastSignificantWord = (U32)val; + if (mostSignificantWord == 0) { + return 32 + ZSTD_countLeadingZeros32(leastSignificantWord); + } else { + return ZSTD_countLeadingZeros32(mostSignificantWord); + } + } +# endif +} + +MEM_STATIC unsigned ZSTD_NbCommonBytes(size_t val) +{ + if (MEM_isLittleEndian()) { + if (MEM_64bits()) { + return ZSTD_countTrailingZeros64((U64)val) >> 3; + } else { + return ZSTD_countTrailingZeros32((U32)val) >> 3; + } + } else { /* Big Endian CPU */ + if (MEM_64bits()) { + return ZSTD_countLeadingZeros64((U64)val) >> 3; + } else { + return ZSTD_countLeadingZeros32((U32)val) >> 3; + } + } +} + +MEM_STATIC unsigned ZSTD_highbit32(U32 val) /* compress, dictBuilder, decodeCorpus */ +{ + assert(val != 0); + return 31 - ZSTD_countLeadingZeros32(val); +} + +/* ZSTD_rotateRight_*(): + * Rotates a bitfield to the right by "count" bits. + * https://en.wikipedia.org/w/index.php?title=Circular_shift&oldid=991635599#Implementing_circular_shifts + */ +MEM_STATIC +U64 ZSTD_rotateRight_U64(U64 const value, U32 count) { + assert(count < 64); + count &= 0x3F; /* for fickle pattern recognition */ + return (value >> count) | (U64)(value << ((0U - count) & 0x3F)); +} + +MEM_STATIC +U32 ZSTD_rotateRight_U32(U32 const value, U32 count) { + assert(count < 32); + count &= 0x1F; /* for fickle pattern recognition */ + return (value >> count) | (U32)(value << ((0U - count) & 0x1F)); +} + +MEM_STATIC +U16 ZSTD_rotateRight_U16(U16 const value, U32 count) { + assert(count < 16); + count &= 0x0F; /* for fickle pattern recognition */ + return (value >> count) | (U16)(value << ((0U - count) & 0x0F)); +} + +#endif /* ZSTD_BITS_H */ diff --git a/src/bled/zstd_common.c b/src/bled/zstd_common.c new file mode 100644 index 00000000..8c9909d0 --- /dev/null +++ b/src/bled/zstd_common.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + + + +/*-************************************* +* Dependencies +***************************************/ +#define ZSTD_DEPS_NEED_MALLOC +#include "zstd_error_private.h" +#include "zstd_internal.h" + + +/*-**************************************** +* Version +******************************************/ +unsigned ZSTD_versionNumber(void) { return ZSTD_VERSION_NUMBER; } + +const char* ZSTD_versionString(void) { return ZSTD_VERSION_STRING; } + + +/*-**************************************** +* ZSTD Error Management +******************************************/ +#undef ZSTD_isError /* defined within zstd_internal.h */ +/*! ZSTD_isError() : + * tells if a return value is an error code + * symbol is required for external callers */ +unsigned ZSTD_isError(size_t code) { return ERR_isError(code); } + +/*! ZSTD_getErrorName() : + * provides error code string from function result (useful for debugging) */ +const char* ZSTD_getErrorName(size_t code) { return ERR_getErrorName(code); } + +/*! ZSTD_getError() : + * convert a `size_t` function result into a proper ZSTD_errorCode enum */ +ZSTD_ErrorCode ZSTD_getErrorCode(size_t code) { return ERR_getErrorCode(code); } + +/*! ZSTD_getErrorString() : + * provides error code string from enum */ +const char* ZSTD_getErrorString(ZSTD_ErrorCode code) { return ERR_getErrorString(code); } diff --git a/src/bled/zstd_compiler.h b/src/bled/zstd_compiler.h index 0064dac0..2ece5b89 100644 --- a/src/bled/zstd_compiler.h +++ b/src/bled/zstd_compiler.h @@ -1,5 +1,5 @@ /* - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the @@ -11,6 +11,9 @@ #ifndef ZSTD_COMPILER_H #define ZSTD_COMPILER_H +#include <stddef.h> +#include "zstd_deps.h" + /*-******************************************************* * Compiler specifics *********************************************************/ @@ -23,7 +26,7 @@ # define INLINE_KEYWORD #endif -#if defined(__GNUC__) || defined(__ICCARM__) +#if defined(__GNUC__) || defined(__IAR_SYSTEMS_ICC__) # define FORCE_INLINE_ATTR __attribute__((always_inline)) #elif defined(_MSC_VER) # define FORCE_INLINE_ATTR __forceinline @@ -40,7 +43,7 @@ /** On MSVC qsort requires that functions passed into it use the __cdecl calling conversion(CC). - This explictly marks such functions as __cdecl so that the code will still compile + This explicitly marks such functions as __cdecl so that the code will still compile if a CC other than __cdecl has been made the default. */ #if defined(_MSC_VER) @@ -49,12 +52,19 @@ # define WIN_CDECL #endif +/* UNUSED_ATTR tells the compiler it is okay if the function is unused. */ +#if defined(__GNUC__) || defined(__IAR_SYSTEMS_ICC__) +# define UNUSED_ATTR __attribute__((unused)) +#else +# define UNUSED_ATTR +#endif + /** * FORCE_INLINE_TEMPLATE is used to define C "templates", which take constant * parameters. They must be inlined for the compiler to eliminate the constant * branches. */ -#define FORCE_INLINE_TEMPLATE static INLINE_KEYWORD FORCE_INLINE_ATTR +#define FORCE_INLINE_TEMPLATE static INLINE_KEYWORD FORCE_INLINE_ATTR UNUSED_ATTR /** * HINT_INLINE is used to help the compiler generate better code. It is *not* * used for "templates", so it can be tweaked based on the compilers @@ -69,21 +79,37 @@ #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8 && __GNUC__ < 5 # define HINT_INLINE static INLINE_KEYWORD #else -# define HINT_INLINE static INLINE_KEYWORD FORCE_INLINE_ATTR +# define HINT_INLINE FORCE_INLINE_TEMPLATE #endif -/* UNUSED_ATTR tells the compiler it is okay if the function is unused. */ +/* "soft" inline : + * The compiler is free to select if it's a good idea to inline or not. + * The main objective is to silence compiler warnings + * when a defined function in included but not used. + * + * Note : this macro is prefixed `MEM_` because it used to be provided by `mem.h` unit. + * Updating the prefix is probably preferable, but requires a fairly large codemod, + * since this name is used everywhere. + */ +#ifndef MEM_STATIC /* already defined in Linux Kernel mem.h */ #if defined(__GNUC__) -# define UNUSED_ATTR __attribute__((unused)) +# define MEM_STATIC static __inline UNUSED_ATTR +#elif defined(__IAR_SYSTEMS_ICC__) +# define MEM_STATIC static inline UNUSED_ATTR +#elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) +# define MEM_STATIC static inline +#elif defined(_MSC_VER) +# define MEM_STATIC static __inline #else -# define UNUSED_ATTR +# define MEM_STATIC static /* this version may generate warnings for unused static functions; disable the relevant warning */ +#endif #endif /* force no inlining */ #ifdef _MSC_VER # define FORCE_NOINLINE static __declspec(noinline) #else -# if defined(__GNUC__) || defined(__ICCARM__) +# if defined(__GNUC__) || defined(__IAR_SYSTEMS_ICC__) # define FORCE_NOINLINE static __attribute__((__noinline__)) # else # define FORCE_NOINLINE static @@ -92,37 +118,25 @@ /* target attribute */ -#ifndef __has_attribute - #define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */ -#endif -#if defined(__GNUC__) || defined(__ICCARM__) +#if defined(__GNUC__) || defined(__IAR_SYSTEMS_ICC__) # define TARGET_ATTRIBUTE(target) __attribute__((__target__(target))) #else # define TARGET_ATTRIBUTE(target) #endif -/* Enable runtime BMI2 dispatch based on the CPU. - * Enabled for clang & gcc >=4.8 on x86 when BMI2 isn't enabled by default. +/* Target attribute for BMI2 dynamic dispatch. + * Enable lzcnt, bmi, and bmi2. + * We test for bmi1 & bmi2. lzcnt is included in bmi1. */ -#ifndef DYNAMIC_BMI2 - #if ((defined(__clang__) && __has_attribute(__target__)) \ - || (defined(__GNUC__) \ - && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)))) \ - && (defined(__x86_64__) || defined(_M_X64)) \ - && !defined(__BMI2__) - # define DYNAMIC_BMI2 1 - #else - # define DYNAMIC_BMI2 0 - #endif -#endif +#define BMI2_TARGET_ATTRIBUTE TARGET_ATTRIBUTE("lzcnt,bmi,bmi2") /* prefetch * can be disabled, by declaring NO_PREFETCH build macro */ #if defined(NO_PREFETCH) -# define PREFETCH_L1(ptr) (void)(ptr) /* disabled */ -# define PREFETCH_L2(ptr) (void)(ptr) /* disabled */ +# define PREFETCH_L1(ptr) do { (void)(ptr); } while (0) /* disabled */ +# define PREFETCH_L2(ptr) do { (void)(ptr); } while (0) /* disabled */ #else -# if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_I86)) /* _mm_prefetch() is not defined outside of x86/x64 */ +# if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_I86)) && !defined(_M_ARM64EC) /* _mm_prefetch() is not defined outside of x86/x64 */ # include <mmintrin.h> /* https://msdn.microsoft.com/fr-fr/library/84szxsww(v=vs.90).aspx */ # define PREFETCH_L1(ptr) _mm_prefetch((const char*)(ptr), _MM_HINT_T0) # define PREFETCH_L2(ptr) _mm_prefetch((const char*)(ptr), _MM_HINT_T1) @@ -130,24 +144,25 @@ # define PREFETCH_L1(ptr) __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */) # define PREFETCH_L2(ptr) __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */) # elif defined(__aarch64__) -# define PREFETCH_L1(ptr) __asm__ __volatile__("prfm pldl1keep, %0" ::"Q"(*(ptr))) -# define PREFETCH_L2(ptr) __asm__ __volatile__("prfm pldl2keep, %0" ::"Q"(*(ptr))) +# define PREFETCH_L1(ptr) do { __asm__ __volatile__("prfm pldl1keep, %0" ::"Q"(*(ptr))); } while (0) +# define PREFETCH_L2(ptr) do { __asm__ __volatile__("prfm pldl2keep, %0" ::"Q"(*(ptr))); } while (0) # else -# define PREFETCH_L1(ptr) (void)(ptr) /* disabled */ -# define PREFETCH_L2(ptr) (void)(ptr) /* disabled */ +# define PREFETCH_L1(ptr) do { (void)(ptr); } while (0) /* disabled */ +# define PREFETCH_L2(ptr) do { (void)(ptr); } while (0) /* disabled */ # endif #endif /* NO_PREFETCH */ #define CACHELINE_SIZE 64 -#define PREFETCH_AREA(p, s) { \ - const char* const _ptr = (const char*)(p); \ - size_t const _size = (size_t)(s); \ - size_t _pos; \ - for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \ - PREFETCH_L2(_ptr + _pos); \ - } \ -} +#define PREFETCH_AREA(p, s) \ + do { \ + const char* const _ptr = (const char*)(p); \ + size_t const _size = (size_t)(s); \ + size_t _pos; \ + for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \ + PREFETCH_L2(_ptr + _pos); \ + } \ + } while (0) /* vectorization * older GCC (pre gcc-4.3 picked as the cutoff) uses a different syntax, @@ -175,6 +190,12 @@ #define UNLIKELY(x) (x) #endif +#if 0 || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))) +# define ZSTD_UNREACHABLE do { assert(0), __builtin_unreachable(); } while (0) +#else +# define ZSTD_UNREACHABLE do { assert(0); } while (0) +#endif + /* disable warnings */ #ifdef _MSC_VER /* Visual Studio */ # include <intrin.h> /* For Visual 2005 */ @@ -191,6 +212,8 @@ # ifdef __AVX2__ //MSVC does not have a BMI2 specific flag, but every CPU that supports AVX2 also supports BMI2 # define STATIC_BMI2 1 # endif +# elif defined(__BMI2__) && defined(__x86_64__) && defined(__GNUC__) +# define STATIC_BMI2 1 # endif #endif @@ -199,15 +222,19 @@ #endif /* compile time determination of SIMD support */ - -/* compat. with non-clang compilers */ -#ifndef __has_builtin -# define __has_builtin(x) 0 -#endif - -/* compat. with non-clang compilers */ -#ifndef __has_feature -# define __has_feature(x) 0 +#if !defined(ZSTD_NO_INTRINSICS) +# if defined(__SSE2__) || defined(_M_AMD64) || (defined (_M_IX86) && defined(_M_IX86_FP) && (_M_IX86_FP >= 2)) +# define ZSTD_ARCH_X86_SSE2 +# endif +# if defined(__ARM_NEON) || defined(_M_ARM64) +# define ZSTD_ARCH_ARM_NEON +# endif +# +# if defined(ZSTD_ARCH_X86_SSE2) +# include <emmintrin.h> +# elif defined(ZSTD_ARCH_ARM_NEON) +# include <arm_neon.h> +# endif #endif /* C-language Attributes are added in C23. */ @@ -220,7 +247,11 @@ /* Only use C++ attributes in C++. Some compilers report support for C++ * attributes when compiling with C. */ -#define ZSTD_HAS_CPP_ATTRIBUTE(x) 0 +#if defined(__cplusplus) && defined(__has_cpp_attribute) +# define ZSTD_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x) +#else +# define ZSTD_HAS_CPP_ATTRIBUTE(x) 0 +#endif /* Define ZSTD_FALLTHROUGH macro for annotating switch case with the 'fallthrough' attribute. * - C23: https://en.cppreference.com/w/c/language/attributes/fallthrough @@ -233,10 +264,194 @@ # elif ZSTD_HAS_CPP_ATTRIBUTE(fallthrough) # define ZSTD_FALLTHROUGH [[fallthrough]] # elif __has_attribute(__fallthrough__) -# define ZSTD_FALLTHROUGH __attribute__((__fallthrough__)) +/* Leading semicolon is to satisfy gcc-11 with -pedantic. Without the semicolon + * gcc complains about: a label can only be part of a statement and a declaration is not a statement. + */ +# define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__)) # else # define ZSTD_FALLTHROUGH # endif #endif +/*-************************************************************** +* Alignment check +*****************************************************************/ + +/* @return 1 if @u is a 2^n value, 0 otherwise + * useful to check a value is valid for alignment restrictions */ +MEM_STATIC int ZSTD_isPower2(size_t u) { + return (u & (u-1)) == 0; +} + +/* this test was initially positioned in mem.h, + * but this file is removed (or replaced) for linux kernel + * so it's now hosted in compiler.h, + * which remains valid for both user & kernel spaces. + */ + +#ifndef ZSTD_ALIGNOF +# if defined(__GNUC__) || defined(_MSC_VER) +/* covers gcc, clang & MSVC */ +/* note : this section must come first, before C11, + * due to a limitation in the kernel source generator */ +# define ZSTD_ALIGNOF(T) __alignof(T) + +# elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) +/* C11 support */ +# include <stdalign.h> +# define ZSTD_ALIGNOF(T) alignof(T) + +# else +/* No known support for alignof() - imperfect backup */ +# define ZSTD_ALIGNOF(T) (sizeof(void*) < sizeof(T) ? sizeof(void*) : sizeof(T)) + +# endif +#endif /* ZSTD_ALIGNOF */ + +/*-************************************************************** +* Sanitizer +*****************************************************************/ + +/** + * Zstd relies on pointer overflow in its decompressor. + * We add this attribute to functions that rely on pointer overflow. + */ +#ifndef ZSTD_ALLOW_POINTER_OVERFLOW_ATTR +# if __has_attribute(no_sanitize) +# if !defined(__clang__) && defined(__GNUC__) && __GNUC__ < 8 + /* gcc < 8 only has signed-integer-overlow which triggers on pointer overflow */ +# define ZSTD_ALLOW_POINTER_OVERFLOW_ATTR __attribute__((no_sanitize("signed-integer-overflow"))) +# else + /* older versions of clang [3.7, 5.0) will warn that pointer-overflow is ignored. */ +# define ZSTD_ALLOW_POINTER_OVERFLOW_ATTR __attribute__((no_sanitize("pointer-overflow"))) +# endif +# else +# define ZSTD_ALLOW_POINTER_OVERFLOW_ATTR +# endif +#endif + +/** + * Helper function to perform a wrapped pointer difference without triggering + * UBSAN. + * + * @returns lhs - rhs with wrapping + */ +MEM_STATIC +ZSTD_ALLOW_POINTER_OVERFLOW_ATTR +ptrdiff_t ZSTD_wrappedPtrDiff(unsigned char const* lhs, unsigned char const* rhs) +{ + return lhs - rhs; +} + +/** + * Helper function to perform a wrapped pointer add without triggering UBSAN. + * + * @return ptr + add with wrapping + */ +MEM_STATIC +ZSTD_ALLOW_POINTER_OVERFLOW_ATTR +unsigned char const* ZSTD_wrappedPtrAdd(unsigned char const* ptr, ptrdiff_t add) +{ + return ptr + add; +} + +/** + * Helper function to perform a wrapped pointer subtraction without triggering + * UBSAN. + * + * @return ptr - sub with wrapping + */ +MEM_STATIC +ZSTD_ALLOW_POINTER_OVERFLOW_ATTR +unsigned char const* ZSTD_wrappedPtrSub(unsigned char const* ptr, ptrdiff_t sub) +{ + return ptr - sub; +} + +/** + * Helper function to add to a pointer that works around C's undefined behavior + * of adding 0 to NULL. + * + * @returns `ptr + add` except it defines `NULL + 0 == NULL`. + */ +MEM_STATIC +unsigned char* ZSTD_maybeNullPtrAdd(unsigned char* ptr, ptrdiff_t add) +{ + return add > 0 ? ptr + add : ptr; +} + +/* Issue #3240 reports an ASAN failure on an llvm-mingw build. Out of an + * abundance of caution, disable our custom poisoning on mingw. */ +#ifdef __MINGW32__ +#ifndef ZSTD_ASAN_DONT_POISON_WORKSPACE +#define ZSTD_ASAN_DONT_POISON_WORKSPACE 1 +#endif +#ifndef ZSTD_MSAN_DONT_POISON_WORKSPACE +#define ZSTD_MSAN_DONT_POISON_WORKSPACE 1 +#endif +#endif + +#if ZSTD_MEMORY_SANITIZER && !defined(ZSTD_MSAN_DONT_POISON_WORKSPACE) +/* Not all platforms that support msan provide sanitizers/msan_interface.h. + * We therefore declare the functions we need ourselves, rather than trying to + * include the header file... */ +#include <stddef.h> /* size_t */ +#define ZSTD_DEPS_NEED_STDINT +#include "zstd_deps.h" /* intptr_t */ + +/* Make memory region fully initialized (without changing its contents). */ +void __msan_unpoison(const volatile void *a, size_t size); + +/* Make memory region fully uninitialized (without changing its contents). + This is a legacy interface that does not update origin information. Use + __msan_allocated_memory() instead. */ +void __msan_poison(const volatile void *a, size_t size); + +/* Returns the offset of the first (at least partially) poisoned byte in the + memory range, or -1 if the whole range is good. */ +intptr_t __msan_test_shadow(const volatile void *x, size_t size); + +/* Print shadow and origin for the memory range to stderr in a human-readable + format. */ +void __msan_print_shadow(const volatile void *x, size_t size); +#endif + +#if ZSTD_ADDRESS_SANITIZER && !defined(ZSTD_ASAN_DONT_POISON_WORKSPACE) +/* Not all platforms that support asan provide sanitizers/asan_interface.h. + * We therefore declare the functions we need ourselves, rather than trying to + * include the header file... */ +#include <stddef.h> /* size_t */ + +/** + * Marks a memory region (<c>[addr, addr+size)</c>) as unaddressable. + * + * This memory must be previously allocated by your program. Instrumented + * code is forbidden from accessing addresses in this region until it is + * unpoisoned. This function is not guaranteed to poison the entire region - + * it could poison only a subregion of <c>[addr, addr+size)</c> due to ASan + * alignment restrictions. + * + * \note This function is not thread-safe because no two threads can poison or + * unpoison memory in the same memory region simultaneously. + * + * \param addr Start of memory region. + * \param size Size of memory region. */ +void __asan_poison_memory_region(void const volatile *addr, size_t size); + +/** + * Marks a memory region (<c>[addr, addr+size)</c>) as addressable. + * + * This memory must be previously allocated by your program. Accessing + * addresses in this region is allowed until this region is poisoned again. + * This function could unpoison a super-region of <c>[addr, addr+size)</c> due + * to ASan alignment restrictions. + * + * \note This function is not thread-safe because no two threads can + * poison or unpoison memory in the same memory region simultaneously. + * + * \param addr Start of memory region. + * \param size Size of memory region. */ +void __asan_unpoison_memory_region(void const volatile *addr, size_t size); +#endif + #endif /* ZSTD_COMPILER_H */ diff --git a/src/bled/zstd_config.h b/src/bled/zstd_config.h index 4792e1e2..6ed38b23 100644 --- a/src/bled/zstd_config.h +++ b/src/bled/zstd_config.h @@ -9,6 +9,7 @@ #define ZSTD_TRACE 0 #define ZSTD_DECOMPRESS_DICTIONARY 0 #define ZSTD_DECOMPRESS_MULTIFRAME 0 +#define ZSTD_NO_TRACE 1 #if CONFIG_FEATURE_ZSTD_SMALL >= 9 #define ZSTD_NO_INLINE 1 @@ -41,6 +42,16 @@ #pragma GCC diagnostic ignored "-Wunused-function" #endif +#ifndef __has_attribute +#define __has_attribute(x) 0 +#endif +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif +#ifndef __has_feature +#define __has_feature(x) 0 +#endif + /* Include zstd_deps.h first with all the options we need enabled. */ #define ZSTD_DEPS_NEED_MALLOC #define ZSTD_DEPS_NEED_MATH64 diff --git a/src/bled/zstd_cpu.h b/src/bled/zstd_cpu.h index 6866f60f..13b4469d 100644 --- a/src/bled/zstd_cpu.h +++ b/src/bled/zstd_cpu.h @@ -1,5 +1,5 @@ /* - * Copyright (c) Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the @@ -35,6 +35,7 @@ MEM_STATIC ZSTD_cpuid_t ZSTD_cpuid(void) { U32 f7b = 0; U32 f7c = 0; #if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86)) +#if !defined(__clang__) || __clang_major__ >= 16 int reg[4]; __cpuid((int*)reg, 0); { @@ -50,6 +51,41 @@ MEM_STATIC ZSTD_cpuid_t ZSTD_cpuid(void) { f7c = (U32)reg[2]; } } +#else + /* Clang compiler has a bug (fixed in https://reviews.llvm.org/D101338) in + * which the `__cpuid` intrinsic does not save and restore `rbx` as it needs + * to due to being a reserved register. So in that case, do the `cpuid` + * ourselves. Clang supports inline assembly anyway. + */ + U32 n; + __asm__( + "pushq %%rbx\n\t" + "cpuid\n\t" + "popq %%rbx\n\t" + : "=a"(n) + : "a"(0) + : "rcx", "rdx"); + if (n >= 1) { + U32 f1a; + __asm__( + "pushq %%rbx\n\t" + "cpuid\n\t" + "popq %%rbx\n\t" + : "=a"(f1a), "=c"(f1c), "=d"(f1d) + : "a"(1) + :); + } + if (n >= 7) { + __asm__( + "pushq %%rbx\n\t" + "cpuid\n\t" + "movq %%rbx, %%rax\n\t" + "popq %%rbx" + : "=a"(f7b), "=c"(f7c) + : "a"(7), "c"(0) + : "rdx"); + } +#endif #elif defined(__i386__) && defined(__PIC__) && !defined(__clang__) && defined(__GNUC__) /* The following block like the normal cpuid branch below, but gcc * reserves ebx for use of its pic register so we must specially diff --git a/src/bled/zstd_ddict.c b/src/bled/zstd_ddict.c new file mode 100644 index 00000000..6822b7bb --- /dev/null +++ b/src/bled/zstd_ddict.c @@ -0,0 +1,244 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + +/* zstd_ddict.c : + * concentrates all logic that needs to know the internals of ZSTD_DDict object */ + +/*-******************************************************* +* Dependencies +*********************************************************/ +//#include "../common/allocations.h" /* ZSTD_customMalloc, ZSTD_customFree */ +#include "zstd_deps.h" /* ZSTD_memcpy, ZSTD_memmove, ZSTD_memset */ +#include "zstd_cpu.h" /* bmi2 */ +#include "zstd_mem.h" /* low level memory routines */ +#define FSE_STATIC_LINKING_ONLY +#include "fse.h" +#include "huf.h" +#include "zstd_decompress_internal.h" +#include "zstd_ddict.h" + +#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1) +# include "../legacy/zstd_legacy.h" +#endif + + + +/*-******************************************************* +* Types +*********************************************************/ +struct ZSTD_DDict_s { + void* dictBuffer; + const void* dictContent; + size_t dictSize; + ZSTD_entropyDTables_t entropy; + U32 dictID; + U32 entropyPresent; + ZSTD_customMem cMem; +}; /* typedef'd to ZSTD_DDict within "zstd.h" */ + +const void* ZSTD_DDict_dictContent(const ZSTD_DDict* ddict) +{ + assert(ddict != NULL); + return ddict->dictContent; +} + +size_t ZSTD_DDict_dictSize(const ZSTD_DDict* ddict) +{ + assert(ddict != NULL); + return ddict->dictSize; +} + +void ZSTD_copyDDictParameters(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict) +{ + DEBUGLOG(4, "ZSTD_copyDDictParameters"); + assert(dctx != NULL); + assert(ddict != NULL); + dctx->dictID = ddict->dictID; + dctx->prefixStart = ddict->dictContent; + dctx->virtualStart = ddict->dictContent; + dctx->dictEnd = (const BYTE*)ddict->dictContent + ddict->dictSize; + dctx->previousDstEnd = dctx->dictEnd; +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + dctx->dictContentBeginForFuzzing = dctx->prefixStart; + dctx->dictContentEndForFuzzing = dctx->previousDstEnd; +#endif + if (ddict->entropyPresent) { + dctx->litEntropy = 1; + dctx->fseEntropy = 1; + dctx->LLTptr = ddict->entropy.LLTable; + dctx->MLTptr = ddict->entropy.MLTable; + dctx->OFTptr = ddict->entropy.OFTable; + dctx->HUFptr = ddict->entropy.hufTable; + dctx->entropy.rep[0] = ddict->entropy.rep[0]; + dctx->entropy.rep[1] = ddict->entropy.rep[1]; + dctx->entropy.rep[2] = ddict->entropy.rep[2]; + } else { + dctx->litEntropy = 0; + dctx->fseEntropy = 0; + } +} + + +static size_t +ZSTD_loadEntropy_intoDDict(ZSTD_DDict* ddict, + ZSTD_dictContentType_e dictContentType) +{ + ddict->dictID = 0; + ddict->entropyPresent = 0; + if (dictContentType == ZSTD_dct_rawContent) return 0; + + if (ddict->dictSize < 8) { + if (dictContentType == ZSTD_dct_fullDict) + return ERROR(dictionary_corrupted); /* only accept specified dictionaries */ + return 0; /* pure content mode */ + } + { U32 const magic = MEM_readLE32(ddict->dictContent); + if (magic != ZSTD_MAGIC_DICTIONARY) { + if (dictContentType == ZSTD_dct_fullDict) + return ERROR(dictionary_corrupted); /* only accept specified dictionaries */ + return 0; /* pure content mode */ + } + } + ddict->dictID = MEM_readLE32((const char*)ddict->dictContent + ZSTD_FRAMEIDSIZE); + + /* load entropy tables */ + RETURN_ERROR_IF(ZSTD_isError(ZSTD_loadDEntropy( + &ddict->entropy, ddict->dictContent, ddict->dictSize)), + dictionary_corrupted, ""); + ddict->entropyPresent = 1; + return 0; +} + + +static size_t ZSTD_initDDict_internal(ZSTD_DDict* ddict, + const void* dict, size_t dictSize, + ZSTD_dictLoadMethod_e dictLoadMethod, + ZSTD_dictContentType_e dictContentType) +{ + if ((dictLoadMethod == ZSTD_dlm_byRef) || (!dict) || (!dictSize)) { + ddict->dictBuffer = NULL; + ddict->dictContent = dict; + if (!dict) dictSize = 0; + } else { + void* const internalBuffer = ZSTD_customMalloc(dictSize, ddict->cMem); + ddict->dictBuffer = internalBuffer; + ddict->dictContent = internalBuffer; + if (!internalBuffer) return ERROR(memory_allocation); + ZSTD_memcpy(internalBuffer, dict, dictSize); + } + ddict->dictSize = dictSize; + ddict->entropy.hufTable[0] = (HUF_DTable)((ZSTD_HUFFDTABLE_CAPACITY_LOG)*0x1000001); /* cover both little and big endian */ + + /* parse dictionary content */ + FORWARD_IF_ERROR( ZSTD_loadEntropy_intoDDict(ddict, dictContentType) , ""); + + return 0; +} + +ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize, + ZSTD_dictLoadMethod_e dictLoadMethod, + ZSTD_dictContentType_e dictContentType, + ZSTD_customMem customMem) +{ + if ((!customMem.customAlloc) ^ (!customMem.customFree)) return NULL; + + { ZSTD_DDict* const ddict = (ZSTD_DDict*) ZSTD_customMalloc(sizeof(ZSTD_DDict), customMem); + if (ddict == NULL) return NULL; + ddict->cMem = customMem; + { size_t const initResult = ZSTD_initDDict_internal(ddict, + dict, dictSize, + dictLoadMethod, dictContentType); + if (ZSTD_isError(initResult)) { + ZSTD_freeDDict(ddict); + return NULL; + } } + return ddict; + } +} + +/*! ZSTD_createDDict() : +* Create a digested dictionary, to start decompression without startup delay. +* `dict` content is copied inside DDict. +* Consequently, `dict` can be released after `ZSTD_DDict` creation */ +ZSTD_DDict* ZSTD_createDDict(const void* dict, size_t dictSize) +{ + ZSTD_customMem const allocator = { NULL, NULL, NULL }; + return ZSTD_createDDict_advanced(dict, dictSize, ZSTD_dlm_byCopy, ZSTD_dct_auto, allocator); +} + +/*! ZSTD_createDDict_byReference() : + * Create a digested dictionary, to start decompression without startup delay. + * Dictionary content is simply referenced, it will be accessed during decompression. + * Warning : dictBuffer must outlive DDict (DDict must be freed before dictBuffer) */ +ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize) +{ + ZSTD_customMem const allocator = { NULL, NULL, NULL }; + return ZSTD_createDDict_advanced(dictBuffer, dictSize, ZSTD_dlm_byRef, ZSTD_dct_auto, allocator); +} + + +const ZSTD_DDict* ZSTD_initStaticDDict( + void* sBuffer, size_t sBufferSize, + const void* dict, size_t dictSize, + ZSTD_dictLoadMethod_e dictLoadMethod, + ZSTD_dictContentType_e dictContentType) +{ + size_t const neededSpace = sizeof(ZSTD_DDict) + + (dictLoadMethod == ZSTD_dlm_byRef ? 0 : dictSize); + ZSTD_DDict* const ddict = (ZSTD_DDict*)sBuffer; + assert(sBuffer != NULL); + assert(dict != NULL); + if ((size_t)sBuffer & 7) return NULL; /* 8-aligned */ + if (sBufferSize < neededSpace) return NULL; + if (dictLoadMethod == ZSTD_dlm_byCopy) { + ZSTD_memcpy(ddict+1, dict, dictSize); /* local copy */ + dict = ddict+1; + } + if (ZSTD_isError( ZSTD_initDDict_internal(ddict, + dict, dictSize, + ZSTD_dlm_byRef, dictContentType) )) + return NULL; + return ddict; +} + + +size_t ZSTD_freeDDict(ZSTD_DDict* ddict) +{ + if (ddict==NULL) return 0; /* support free on NULL */ + { ZSTD_customMem const cMem = ddict->cMem; + ZSTD_customFree(ddict->dictBuffer, cMem); + ZSTD_customFree(ddict, cMem); + return 0; + } +} + +/*! ZSTD_estimateDDictSize() : + * Estimate amount of memory that will be needed to create a dictionary for decompression. + * Note : dictionary created by reference using ZSTD_dlm_byRef are smaller */ +size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod) +{ + return sizeof(ZSTD_DDict) + (dictLoadMethod == ZSTD_dlm_byRef ? 0 : dictSize); +} + +size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict) +{ + if (ddict==NULL) return 0; /* support sizeof on NULL */ + return sizeof(*ddict) + (ddict->dictBuffer ? ddict->dictSize : 0) ; +} + +/*! ZSTD_getDictID_fromDDict() : + * Provides the dictID of the dictionary loaded into `ddict`. + * If @return == 0, the dictionary is not conformant to Zstandard specification, or empty. + * Non-conformant dictionaries can still be loaded, but as content-only dictionaries. */ +unsigned ZSTD_getDictID_fromDDict(const ZSTD_DDict* ddict) +{ + if (ddict==NULL) return 0; + return ddict->dictID; +} diff --git a/src/bled/zstd_ddict.h b/src/bled/zstd_ddict.h index ca4dccbe..e862b4c7 100644 --- a/src/bled/zstd_ddict.h +++ b/src/bled/zstd_ddict.h @@ -1,5 +1,5 @@ /* - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the @@ -34,16 +34,11 @@ * ZSTD_getDictID_fromDict() */ -MEM_STATIC const void* ZSTD_DDict_dictContent(const ZSTD_DDict* ddict); -MEM_STATIC size_t ZSTD_DDict_dictSize(const ZSTD_DDict* ddict); +const void* ZSTD_DDict_dictContent(const ZSTD_DDict* ddict); +size_t ZSTD_DDict_dictSize(const ZSTD_DDict* ddict); + +void ZSTD_copyDDictParameters(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict); -MEM_STATIC void ZSTD_copyDDictParameters(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict); -#if ZSTD_DECOMPRESS_DICTIONARY == 0 -MEM_STATIC void ZSTD_clearDict(ZSTD_DCtx* dctx) { (void)dctx; } -MEM_STATIC size_t ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict) { (void)dctx; (void)ddict; return 0; } -MEM_STATIC size_t ZSTD_checkOutBuffer(ZSTD_DStream const* zds, ZSTD_outBuffer const* output) { (void)zds; (void)output; return 0; } -MEM_STATIC ZSTD_DDict const* ZSTD_getDDict(ZSTD_DCtx* dctx) { (void)dctx; return NULL; } -#endif #endif /* ZSTD_DDICT_H */ diff --git a/src/bled/zstd_decompress.c b/src/bled/zstd_decompress.c index 98f2afb6..fcf29f75 100644 --- a/src/bled/zstd_decompress.c +++ b/src/bled/zstd_decompress.c @@ -1,5 +1,5 @@ /* - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the @@ -12,11 +12,23 @@ /* *************************************************************** * Tuning parameters *****************************************************************/ +/*! + * HEAPMODE : + * Select how default decompression function ZSTD_decompress() allocates its context, + * on stack (0), or into heap (1, default; requires malloc()). + * Note that functions with explicit context such as ZSTD_decompressDCtx() are unaffected. + */ +#ifndef ZSTD_HEAPMODE +# define ZSTD_HEAPMODE 1 +#endif /*! * LEGACY_SUPPORT : * if set to 1+, ZSTD_decompress() can decode older formats (v0.1+) */ +#ifndef ZSTD_LEGACY_SUPPORT +# define ZSTD_LEGACY_SUPPORT 0 +#endif /*! * MAXWINDOWSIZE_DEFAULT : @@ -43,18 +55,162 @@ /*-******************************************************* * Dependencies *********************************************************/ -#include "zstd_deps.h" /* ZSTD_memcpy, ZSTD_memmove, ZSTD_memset */ -#include "zstd_cpu.h" /* bmi2 */ +#include "zstd_deps.h" /* ZSTD_memcpy, ZSTD_memmove, ZSTD_memset */ +#include "zstd_error_private.h" +#include "zstd_internal.h" /* blockProperties_t */ #include "zstd_mem.h" /* low level memory routines */ +#include "zstd_bits.h" /* ZSTD_highbit32 */ #define FSE_STATIC_LINKING_ONLY #include "fse.h" -#define HUF_STATIC_LINKING_ONLY #include "huf.h" -#include "xxhash.h" /* XXH64_reset, XXH64_update, XXH64_digest, XXH64 */ -#include "zstd_internal.h" /* blockProperties_t */ +#include "xxhash.h" /* XXH64_reset, XXH64_update, XXH64_digest, XXH64 */ #include "zstd_decompress_internal.h" /* ZSTD_DCtx */ -#include "zstd_ddict.h" /* ZSTD_DDictDictContent */ -#include "zstd_decompress_block.h" /* ZSTD_decompressBlock_internal */ +#include "zstd_ddict.h" /* ZSTD_DDictDictContent */ +#include "zstd_decompress_block.h" /* ZSTD_decompressBlock_internal */ + +#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1) +# include "../legacy/zstd_legacy.h" +#endif + +/************************************* + * Multiple DDicts Hashset internals * + *************************************/ + +#define DDICT_HASHSET_MAX_LOAD_FACTOR_COUNT_MULT 4 +#define DDICT_HASHSET_MAX_LOAD_FACTOR_SIZE_MULT 3 /* These two constants represent SIZE_MULT/COUNT_MULT load factor without using a float. + * Currently, that means a 0.75 load factor. + * So, if count * COUNT_MULT / size * SIZE_MULT != 0, then we've exceeded + * the load factor of the ddict hash set. + */ + +#define DDICT_HASHSET_TABLE_BASE_SIZE 64 +#define DDICT_HASHSET_RESIZE_FACTOR 2 + +/* Hash function to determine starting position of dict insertion within the table + * Returns an index between [0, hashSet->ddictPtrTableSize] + */ +static size_t ZSTD_DDictHashSet_getIndex(const ZSTD_DDictHashSet* hashSet, U32 dictID) { + const U64 hash = XXH64(&dictID, sizeof(U32), 0); + /* DDict ptr table size is a multiple of 2, use size - 1 as mask to get index within [0, hashSet->ddictPtrTableSize) */ + return hash & (hashSet->ddictPtrTableSize - 1); +} + +/* Adds DDict to a hashset without resizing it. + * If inserting a DDict with a dictID that already exists in the set, replaces the one in the set. + * Returns 0 if successful, or a zstd error code if something went wrong. + */ +static size_t ZSTD_DDictHashSet_emplaceDDict(ZSTD_DDictHashSet* hashSet, const ZSTD_DDict* ddict) { + const U32 dictID = ZSTD_getDictID_fromDDict(ddict); + size_t idx = ZSTD_DDictHashSet_getIndex(hashSet, dictID); + const size_t idxRangeMask = hashSet->ddictPtrTableSize - 1; + RETURN_ERROR_IF(hashSet->ddictPtrCount == hashSet->ddictPtrTableSize, GENERIC, "Hash set is full!"); + DEBUGLOG(4, "Hashed index: for dictID: %u is %zu", dictID, idx); + while (hashSet->ddictPtrTable[idx] != NULL) { + /* Replace existing ddict if inserting ddict with same dictID */ + if (ZSTD_getDictID_fromDDict(hashSet->ddictPtrTable[idx]) == dictID) { + DEBUGLOG(4, "DictID already exists, replacing rather than adding"); + hashSet->ddictPtrTable[idx] = ddict; + return 0; + } + idx &= idxRangeMask; + idx++; + } + DEBUGLOG(4, "Final idx after probing for dictID %u is: %zu", dictID, idx); + hashSet->ddictPtrTable[idx] = ddict; + hashSet->ddictPtrCount++; + return 0; +} + +/* Expands hash table by factor of DDICT_HASHSET_RESIZE_FACTOR and + * rehashes all values, allocates new table, frees old table. + * Returns 0 on success, otherwise a zstd error code. + */ +static size_t ZSTD_DDictHashSet_expand(ZSTD_DDictHashSet* hashSet, ZSTD_customMem customMem) { + size_t newTableSize = hashSet->ddictPtrTableSize * DDICT_HASHSET_RESIZE_FACTOR; + const ZSTD_DDict** newTable = (const ZSTD_DDict**)ZSTD_customCalloc(sizeof(ZSTD_DDict*) * newTableSize, customMem); + const ZSTD_DDict** oldTable = hashSet->ddictPtrTable; + size_t oldTableSize = hashSet->ddictPtrTableSize; + size_t i; + + DEBUGLOG(4, "Expanding DDict hash table! Old size: %zu new size: %zu", oldTableSize, newTableSize); + RETURN_ERROR_IF(!newTable, memory_allocation, "Expanded hashset allocation failed!"); + hashSet->ddictPtrTable = newTable; + hashSet->ddictPtrTableSize = newTableSize; + hashSet->ddictPtrCount = 0; + for (i = 0; i < oldTableSize; ++i) { + if (oldTable[i] != NULL) { + FORWARD_IF_ERROR(ZSTD_DDictHashSet_emplaceDDict(hashSet, oldTable[i]), ""); + } + } + ZSTD_customFree((void*)oldTable, customMem); + DEBUGLOG(4, "Finished re-hash"); + return 0; +} + +/* Fetches a DDict with the given dictID + * Returns the ZSTD_DDict* with the requested dictID. If it doesn't exist, then returns NULL. + */ +static const ZSTD_DDict* ZSTD_DDictHashSet_getDDict(ZSTD_DDictHashSet* hashSet, U32 dictID) { + size_t idx = ZSTD_DDictHashSet_getIndex(hashSet, dictID); + const size_t idxRangeMask = hashSet->ddictPtrTableSize - 1; + DEBUGLOG(4, "Hashed index: for dictID: %u is %zu", dictID, idx); + for (;;) { + size_t currDictID = ZSTD_getDictID_fromDDict(hashSet->ddictPtrTable[idx]); + if (currDictID == dictID || currDictID == 0) { + /* currDictID == 0 implies a NULL ddict entry */ + break; + } else { + idx &= idxRangeMask; /* Goes to start of table when we reach the end */ + idx++; + } + } + DEBUGLOG(4, "Final idx after probing for dictID %u is: %zu", dictID, idx); + return hashSet->ddictPtrTable[idx]; +} + +/* Allocates space for and returns a ddict hash set + * The hash set's ZSTD_DDict* table has all values automatically set to NULL to begin with. + * Returns NULL if allocation failed. + */ +static ZSTD_DDictHashSet* ZSTD_createDDictHashSet(ZSTD_customMem customMem) { + ZSTD_DDictHashSet* ret = (ZSTD_DDictHashSet*)ZSTD_customMalloc(sizeof(ZSTD_DDictHashSet), customMem); + DEBUGLOG(4, "Allocating new hash set"); + if (!ret) + return NULL; + ret->ddictPtrTable = (const ZSTD_DDict**)ZSTD_customCalloc(DDICT_HASHSET_TABLE_BASE_SIZE * sizeof(ZSTD_DDict*), customMem); + if (!ret->ddictPtrTable) { + ZSTD_customFree(ret, customMem); + return NULL; + } + ret->ddictPtrTableSize = DDICT_HASHSET_TABLE_BASE_SIZE; + ret->ddictPtrCount = 0; + return ret; +} + +/* Frees the table of ZSTD_DDict* within a hashset, then frees the hashset itself. + * Note: The ZSTD_DDict* within the table are NOT freed. + */ +static void ZSTD_freeDDictHashSet(ZSTD_DDictHashSet* hashSet, ZSTD_customMem customMem) { + DEBUGLOG(4, "Freeing ddict hash set"); + if (hashSet && hashSet->ddictPtrTable) { + ZSTD_customFree((void*)hashSet->ddictPtrTable, customMem); + } + if (hashSet) { + ZSTD_customFree(hashSet, customMem); + } +} + +/* Public function: Adds a DDict into the ZSTD_DDictHashSet, possibly triggering a resize of the hash set. + * Returns 0 on success, or a ZSTD error. + */ +static size_t ZSTD_DDictHashSet_addDDict(ZSTD_DDictHashSet* hashSet, const ZSTD_DDict* ddict, ZSTD_customMem customMem) { + DEBUGLOG(4, "Adding dict ID: %u to hashset with - Count: %zu Tablesize: %zu", ZSTD_getDictID_fromDDict(ddict), hashSet->ddictPtrCount, hashSet->ddictPtrTableSize); + if (hashSet->ddictPtrCount * DDICT_HASHSET_MAX_LOAD_FACTOR_COUNT_MULT / hashSet->ddictPtrTableSize * DDICT_HASHSET_MAX_LOAD_FACTOR_SIZE_MULT != 0) { + FORWARD_IF_ERROR(ZSTD_DDictHashSet_expand(hashSet, customMem), ""); + } + FORWARD_IF_ERROR(ZSTD_DDictHashSet_emplaceDDict(hashSet, ddict), ""); + return 0; +} /*-************************************************************* * Context management @@ -63,12 +219,13 @@ size_t ZSTD_sizeof_DCtx (const ZSTD_DCtx* dctx) { if (dctx==NULL) return 0; /* support sizeof NULL */ return sizeof(*dctx) -#if ZSTD_DECOMPRESS_DICTIONARY != 0 + ZSTD_sizeof_DDict(dctx->ddictLocal) -#endif + dctx->inBuffSize + dctx->outBuffSize; } +size_t ZSTD_estimateDCtxSize(void) { return sizeof(ZSTD_DCtx); } + + static size_t ZSTD_startingInputLength(ZSTD_format_e format) { size_t const startingInputLength = ZSTD_FRAMEHEADERSIZE_PREFIX(format); @@ -82,34 +239,53 @@ static void ZSTD_DCtx_resetParameters(ZSTD_DCtx* dctx) assert(dctx->streamStage == zdss_init); dctx->format = ZSTD_f_zstd1; dctx->maxWindowSize = ZSTD_MAXWINDOWSIZE_DEFAULT; - // dctx->outBufferMode = ZSTD_bm_buffered; REMOVED + dctx->outBufferMode = ZSTD_bm_buffered; dctx->forceIgnoreChecksum = ZSTD_d_validateChecksum; -#if ZSTD_DECOMPRESS_DICTIONARY != 0 dctx->refMultipleDDicts = ZSTD_rmd_refSingleDDict; -#endif + dctx->disableHufAsm = 0; + dctx->maxBlockSizeParam = 0; } static void ZSTD_initDCtx_internal(ZSTD_DCtx* dctx) { - // dctx->staticSize = 0; REMOVED -#if ZSTD_DECOMPRESS_DICTIONARY != 0 + dctx->staticSize = 0; dctx->ddict = NULL; dctx->ddictLocal = NULL; dctx->dictEnd = NULL; dctx->ddictIsCold = 0; dctx->dictUses = ZSTD_dont_use; - dctx->ddictSet = NULL; -#endif dctx->inBuff = NULL; dctx->inBuffSize = 0; dctx->outBuffSize = 0; dctx->streamStage = zdss_init; +#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1) + dctx->legacyContext = NULL; + dctx->previousLegacyVersion = 0; +#endif dctx->noForwardProgress = 0; dctx->oversizedDuration = 0; + dctx->isFrameDecompression = 1; #if DYNAMIC_BMI2 - dctx->bmi2 = ZSTD_cpuid_bmi2(ZSTD_cpuid()); + dctx->bmi2 = ZSTD_cpuSupportsBmi2(); #endif + dctx->ddictSet = NULL; ZSTD_DCtx_resetParameters(dctx); +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + dctx->dictContentEndForFuzzing = NULL; +#endif +} + +ZSTD_DCtx* ZSTD_initStaticDCtx(void *workspace, size_t workspaceSize) +{ + ZSTD_DCtx* const dctx = (ZSTD_DCtx*) workspace; + + if ((size_t)workspace & 7) return NULL; /* 8-aligned */ + if (workspaceSize < sizeof(ZSTD_DCtx)) return NULL; /* minimum size */ + + ZSTD_initDCtx_internal(dctx); + dctx->staticSize = workspaceSize; + dctx->inBuff = (char*)(dctx+1); + return dctx; } static ZSTD_DCtx* ZSTD_createDCtx_internal(ZSTD_customMem customMem) { @@ -117,27 +293,47 @@ static ZSTD_DCtx* ZSTD_createDCtx_internal(ZSTD_customMem customMem) { { ZSTD_DCtx* const dctx = (ZSTD_DCtx*)ZSTD_customMalloc(sizeof(*dctx), customMem); if (!dctx) return NULL; + dctx->customMem = customMem; ZSTD_initDCtx_internal(dctx); return dctx; } } +ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem) +{ + return ZSTD_createDCtx_internal(customMem); +} + +ZSTD_DCtx* ZSTD_createDCtx(void) +{ + DEBUGLOG(3, "ZSTD_createDCtx"); + return ZSTD_createDCtx_internal(ZSTD_defaultCMem); +} + +static void ZSTD_clearDict(ZSTD_DCtx* dctx) +{ + ZSTD_freeDDict(dctx->ddictLocal); + dctx->ddictLocal = NULL; + dctx->ddict = NULL; + dctx->dictUses = ZSTD_dont_use; +} + size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx) { if (dctx==NULL) return 0; /* support free on NULL */ - RETURN_ERROR_IF(ZSTD_DCtx_get_staticSize(zds), memory_allocation, "not compatible with static DCtx"); - { ZSTD_customMem const cMem = ZSTD_defaultCMem; -#if ZSTD_DECOMPRESS_DICTIONARY != 0 + RETURN_ERROR_IF(dctx->staticSize, memory_allocation, "not compatible with static DCtx"); + { ZSTD_customMem const cMem = dctx->customMem; ZSTD_clearDict(dctx); -#endif ZSTD_customFree(dctx->inBuff, cMem); dctx->inBuff = NULL; -#if ZSTD_DECOMPRESS_DICTIONARY != 0 +#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1) + if (dctx->legacyContext) + ZSTD_freeLegacyStreamContext(dctx->legacyContext, dctx->previousLegacyVersion); +#endif if (dctx->ddictSet) { ZSTD_freeDDictHashSet(dctx->ddictSet, cMem); dctx->ddictSet = NULL; } -#endif ZSTD_customFree(dctx, cMem); return 0; } @@ -150,10 +346,65 @@ void ZSTD_copyDCtx(ZSTD_DCtx* dstDCtx, const ZSTD_DCtx* srcDCtx) ZSTD_memcpy(dstDCtx, srcDCtx, toCopy); /* no need to copy workspace */ } +/* Given a dctx with a digested frame params, re-selects the correct ZSTD_DDict based on + * the requested dict ID from the frame. If there exists a reference to the correct ZSTD_DDict, then + * accordingly sets the ddict to be used to decompress the frame. + * + * If no DDict is found, then no action is taken, and the ZSTD_DCtx::ddict remains as-is. + * + * ZSTD_d_refMultipleDDicts must be enabled for this function to be called. + */ +static void ZSTD_DCtx_selectFrameDDict(ZSTD_DCtx* dctx) { + assert(dctx->refMultipleDDicts && dctx->ddictSet); + DEBUGLOG(4, "Adjusting DDict based on requested dict ID from frame"); + if (dctx->ddict) { + const ZSTD_DDict* frameDDict = ZSTD_DDictHashSet_getDDict(dctx->ddictSet, dctx->fParams.dictID); + if (frameDDict) { + DEBUGLOG(4, "DDict found!"); + ZSTD_clearDict(dctx); + dctx->dictID = dctx->fParams.dictID; + dctx->ddict = frameDDict; + dctx->dictUses = ZSTD_use_indefinitely; + } + } +} + + /*-************************************************************* * Frame header decoding ***************************************************************/ +/*! ZSTD_isFrame() : + * Tells if the content of `buffer` starts with a valid Frame Identifier. + * Note : Frame Identifier is 4 bytes. If `size < 4`, @return will always be 0. + * Note 2 : Legacy Frame Identifiers are considered valid only if Legacy Support is enabled. + * Note 3 : Skippable Frame Identifiers are considered valid. */ +unsigned ZSTD_isFrame(const void* buffer, size_t size) +{ + if (size < ZSTD_FRAMEIDSIZE) return 0; + { U32 const magic = MEM_readLE32(buffer); + if (magic == ZSTD_MAGICNUMBER) return 1; + if ((magic & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) return 1; + } +#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1) + if (ZSTD_isLegacy(buffer, size)) return 1; +#endif + return 0; +} + +/*! ZSTD_isSkippableFrame() : + * Tells if the content of `buffer` starts with a valid Frame Identifier for a skippable frame. + * Note : Frame Identifier is 4 bytes. If `size < 4`, @return will always be 0. + */ +unsigned ZSTD_isSkippableFrame(const void* buffer, size_t size) +{ + if (size < ZSTD_FRAMEIDSIZE) return 0; + { U32 const magic = MEM_readLE32(buffer); + if ((magic & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) return 1; + } + return 0; +} + /** ZSTD_frameHeaderSize_internal() : * srcSize must be large enough to reach header size fields. * note : only works for formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless. @@ -174,21 +425,55 @@ static size_t ZSTD_frameHeaderSize_internal(const void* src, size_t srcSize, ZST } } +/** ZSTD_frameHeaderSize() : + * srcSize must be >= ZSTD_frameHeaderSize_prefix. + * @return : size of the Frame Header, + * or an error code (if srcSize is too small) */ +size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize) +{ + return ZSTD_frameHeaderSize_internal(src, srcSize, ZSTD_f_zstd1); +} + + /** ZSTD_getFrameHeader_advanced() : * decode Frame Header, or require larger `srcSize`. * note : only works for formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless * @return : 0, `zfhPtr` is correctly filled, * >0, `srcSize` is too small, value is wanted `srcSize` amount, - * or an error code, which can be tested using ZSTD_isError() */ +** or an error code, which can be tested using ZSTD_isError() */ size_t ZSTD_getFrameHeader_advanced(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize, ZSTD_format_e format) { const BYTE* ip = (const BYTE*)src; size_t const minInputSize = ZSTD_startingInputLength(format); - ZSTD_memset(zfhPtr, 0, sizeof(*zfhPtr)); /* not strictly necessary, but static analyzer do not understand that zfhPtr is only going to be read only if return value is zero, since they are 2 different signals */ - if (srcSize < minInputSize) return minInputSize; - RETURN_ERROR_IF(src==NULL, GENERIC, "invalid parameter"); + DEBUGLOG(5, "ZSTD_getFrameHeader_advanced: minInputSize = %zu, srcSize = %zu", minInputSize, srcSize); + if (srcSize > 0) { + /* note : technically could be considered an assert(), since it's an invalid entry */ + RETURN_ERROR_IF(src==NULL, GENERIC, "invalid parameter : src==NULL, but srcSize>0"); + } + if (srcSize < minInputSize) { + if (srcSize > 0 && format != ZSTD_f_zstd1_magicless) { + /* when receiving less than @minInputSize bytes, + * control these bytes at least correspond to a supported magic number + * in order to error out early if they don't. + **/ + size_t const toCopy = MIN(4, srcSize); + unsigned char hbuf[4]; MEM_writeLE32(hbuf, ZSTD_MAGICNUMBER); + assert(src != NULL); + ZSTD_memcpy(hbuf, src, toCopy); + if ( MEM_readLE32(hbuf) != ZSTD_MAGICNUMBER ) { + /* not a zstd frame : let's check if it's a skippable frame */ + MEM_writeLE32(hbuf, ZSTD_MAGIC_SKIPPABLE_START); + ZSTD_memcpy(hbuf, src, toCopy); + if ((MEM_readLE32(hbuf) & ZSTD_MAGIC_SKIPPABLE_MASK) != ZSTD_MAGIC_SKIPPABLE_START) { + RETURN_ERROR(prefix_unknown, + "first bytes don't correspond to any supported magic number"); + } } } + return minInputSize; + } + + ZSTD_memset(zfhPtr, 0, sizeof(*zfhPtr)); /* not strictly necessary, but static analyzers may not understand that zfhPtr will be read only if return value is zero, since they are 2 different signals */ if ( (format != ZSTD_f_zstd1_magicless) && (MEM_readLE32(src) != ZSTD_MAGICNUMBER) ) { if ((MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) { @@ -278,6 +563,12 @@ size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t src * - ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small) */ unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize) { +#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1) + if (ZSTD_isLegacy(src, srcSize)) { + unsigned long long const ret = ZSTD_getDecompressedSize_legacy(src, srcSize); + return ret == 0 ? ZSTD_CONTENTSIZE_UNKNOWN : ret; + } +#endif { ZSTD_frameHeader zfh; if (ZSTD_getFrameHeader(&zfh, src, srcSize) != 0) return ZSTD_CONTENTSIZE_ERROR; @@ -288,6 +579,116 @@ unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize) } } } +static size_t readSkippableFrameSize(void const* src, size_t srcSize) +{ + size_t const skippableHeaderSize = ZSTD_SKIPPABLEHEADERSIZE; + U32 sizeU32; + + RETURN_ERROR_IF(srcSize < ZSTD_SKIPPABLEHEADERSIZE, srcSize_wrong, ""); + + sizeU32 = MEM_readLE32((BYTE const*)src + ZSTD_FRAMEIDSIZE); + RETURN_ERROR_IF((U32)(sizeU32 + ZSTD_SKIPPABLEHEADERSIZE) < sizeU32, + frameParameter_unsupported, ""); + { size_t const skippableSize = skippableHeaderSize + sizeU32; + RETURN_ERROR_IF(skippableSize > srcSize, srcSize_wrong, ""); + return skippableSize; + } +} + +/*! ZSTD_readSkippableFrame() : + * Retrieves content of a skippable frame, and writes it to dst buffer. + * + * The parameter magicVariant will receive the magicVariant that was supplied when the frame was written, + * i.e. magicNumber - ZSTD_MAGIC_SKIPPABLE_START. This can be NULL if the caller is not interested + * in the magicVariant. + * + * Returns an error if destination buffer is not large enough, or if this is not a valid skippable frame. + * + * @return : number of bytes written or a ZSTD error. + */ +size_t ZSTD_readSkippableFrame(void* dst, size_t dstCapacity, + unsigned* magicVariant, /* optional, can be NULL */ + const void* src, size_t srcSize) +{ + RETURN_ERROR_IF(srcSize < ZSTD_SKIPPABLEHEADERSIZE, srcSize_wrong, ""); + + { U32 const magicNumber = MEM_readLE32(src); + size_t skippableFrameSize = readSkippableFrameSize(src, srcSize); + size_t skippableContentSize = skippableFrameSize - ZSTD_SKIPPABLEHEADERSIZE; + + /* check input validity */ + RETURN_ERROR_IF(!ZSTD_isSkippableFrame(src, srcSize), frameParameter_unsupported, ""); + RETURN_ERROR_IF(skippableFrameSize < ZSTD_SKIPPABLEHEADERSIZE || skippableFrameSize > srcSize, srcSize_wrong, ""); + RETURN_ERROR_IF(skippableContentSize > dstCapacity, dstSize_tooSmall, ""); + + /* deliver payload */ + if (skippableContentSize > 0 && dst != NULL) + ZSTD_memcpy(dst, (const BYTE *)src + ZSTD_SKIPPABLEHEADERSIZE, skippableContentSize); + if (magicVariant != NULL) + *magicVariant = magicNumber - ZSTD_MAGIC_SKIPPABLE_START; + return skippableContentSize; + } +} + +/** ZSTD_findDecompressedSize() : + * `srcSize` must be the exact length of some number of ZSTD compressed and/or + * skippable frames + * note: compatible with legacy mode + * @return : decompressed size of the frames contained */ +unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize) +{ + unsigned long long totalDstSize = 0; + + while (srcSize >= ZSTD_startingInputLength(ZSTD_f_zstd1)) { + U32 const magicNumber = MEM_readLE32(src); + + if ((magicNumber & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) { + size_t const skippableSize = readSkippableFrameSize(src, srcSize); + if (ZSTD_isError(skippableSize)) return ZSTD_CONTENTSIZE_ERROR; + assert(skippableSize <= srcSize); + + src = (const BYTE *)src + skippableSize; + srcSize -= skippableSize; + continue; + } + + { unsigned long long const fcs = ZSTD_getFrameContentSize(src, srcSize); + if (fcs >= ZSTD_CONTENTSIZE_ERROR) return fcs; + + if (totalDstSize + fcs < totalDstSize) + return ZSTD_CONTENTSIZE_ERROR; /* check for overflow */ + totalDstSize += fcs; + } + /* skip to next frame */ + { size_t const frameSrcSize = ZSTD_findFrameCompressedSize(src, srcSize); + if (ZSTD_isError(frameSrcSize)) return ZSTD_CONTENTSIZE_ERROR; + assert(frameSrcSize <= srcSize); + + src = (const BYTE *)src + frameSrcSize; + srcSize -= frameSrcSize; + } + } /* while (srcSize >= ZSTD_frameHeaderSize_prefix) */ + + if (srcSize) return ZSTD_CONTENTSIZE_ERROR; + + return totalDstSize; +} + +/** ZSTD_getDecompressedSize() : + * compatible with legacy mode + * @return : decompressed size if known, 0 otherwise + note : 0 can mean any of the following : + - frame content is empty + - decompressed size field is not present in frame header + - frame header unknown / not supported + - frame header not complete (`srcSize` too small) */ +unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize) +{ + unsigned long long const ret = ZSTD_getFrameContentSize(src, srcSize); + ZSTD_STATIC_ASSERT(ZSTD_CONTENTSIZE_ERROR < ZSTD_CONTENTSIZE_UNKNOWN); + return (ret >= ZSTD_CONTENTSIZE_ERROR) ? 0 : ret; +} + /** ZSTD_decodeFrameHeader() : * `headerSize` must be the size provided by ZSTD_frameHeaderSize(). @@ -296,25 +697,21 @@ unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize) static size_t ZSTD_decodeFrameHeader(ZSTD_DCtx* dctx, const void* src, size_t headerSize) { size_t const result = ZSTD_getFrameHeader_advanced(&(dctx->fParams), src, headerSize, dctx->format); - U32 dictID = 0; if (ZSTD_isError(result)) return result; /* invalid header */ RETURN_ERROR_IF(result>0, srcSize_wrong, "headerSize too small"); -#if ZSTD_DECOMPRESS_DICTIONARY != 0 /* Reference DDict requested by frame if dctx references multiple ddicts */ if (dctx->refMultipleDDicts == ZSTD_rmd_refMultipleDDicts && dctx->ddictSet) { ZSTD_DCtx_selectFrameDDict(dctx); } - dictID = dctx->dictID; -#endif +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION /* Skip the dictID check in fuzzing mode, because it makes the search * harder. */ - - RETURN_ERROR_IF(dctx->fParams.dictID && (dictID != dctx->fParams.dictID), + RETURN_ERROR_IF(dctx->fParams.dictID && (dctx->dictID != dctx->fParams.dictID), dictionary_wrong, ""); - +#endif dctx->validateChecksum = (dctx->fParams.checksumFlag && !dctx->forceIgnoreChecksum) ? 1 : 0; if (dctx->validateChecksum) XXH64_reset(&dctx->xxhState, 0); dctx->processedCSize += headerSize; @@ -329,10 +726,168 @@ static ZSTD_frameSizeInfo ZSTD_errorFrameSizeInfo(size_t ret) return frameSizeInfo; } +static ZSTD_frameSizeInfo ZSTD_findFrameSizeInfo(const void* src, size_t srcSize, ZSTD_format_e format) +{ + ZSTD_frameSizeInfo frameSizeInfo; + ZSTD_memset(&frameSizeInfo, 0, sizeof(ZSTD_frameSizeInfo)); + +#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1) + if (format == ZSTD_f_zstd1 && ZSTD_isLegacy(src, srcSize)) + return ZSTD_findFrameSizeInfoLegacy(src, srcSize); +#endif + + if (format == ZSTD_f_zstd1 && (srcSize >= ZSTD_SKIPPABLEHEADERSIZE) + && (MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) { + frameSizeInfo.compressedSize = readSkippableFrameSize(src, srcSize); + assert(ZSTD_isError(frameSizeInfo.compressedSize) || + frameSizeInfo.compressedSize <= srcSize); + return frameSizeInfo; + } else { + const BYTE* ip = (const BYTE*)src; + const BYTE* const ipstart = ip; + size_t remainingSize = srcSize; + size_t nbBlocks = 0; + ZSTD_frameHeader zfh; + + /* Extract Frame Header */ + { size_t const ret = ZSTD_getFrameHeader_advanced(&zfh, src, srcSize, format); + if (ZSTD_isError(ret)) + return ZSTD_errorFrameSizeInfo(ret); + if (ret > 0) + return ZSTD_errorFrameSizeInfo(ERROR(srcSize_wrong)); + } + + ip += zfh.headerSize; + remainingSize -= zfh.headerSize; + + /* Iterate over each block */ + while (1) { + blockProperties_t blockProperties; + size_t const cBlockSize = ZSTD_getcBlockSize(ip, remainingSize, &blockProperties); + if (ZSTD_isError(cBlockSize)) + return ZSTD_errorFrameSizeInfo(cBlockSize); + + if (ZSTD_blockHeaderSize + cBlockSize > remainingSize) + return ZSTD_errorFrameSizeInfo(ERROR(srcSize_wrong)); + + ip += ZSTD_blockHeaderSize + cBlockSize; + remainingSize -= ZSTD_blockHeaderSize + cBlockSize; + nbBlocks++; + + if (blockProperties.lastBlock) break; + } + + /* Final frame content checksum */ + if (zfh.checksumFlag) { + if (remainingSize < 4) + return ZSTD_errorFrameSizeInfo(ERROR(srcSize_wrong)); + ip += 4; + } + + frameSizeInfo.nbBlocks = nbBlocks; + frameSizeInfo.compressedSize = (size_t)(ip - ipstart); + frameSizeInfo.decompressedBound = (zfh.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN) + ? zfh.frameContentSize + : (unsigned long long)nbBlocks * zfh.blockSizeMax; + return frameSizeInfo; + } +} + +static size_t ZSTD_findFrameCompressedSize_advanced(const void *src, size_t srcSize, ZSTD_format_e format) { + ZSTD_frameSizeInfo const frameSizeInfo = ZSTD_findFrameSizeInfo(src, srcSize, format); + return frameSizeInfo.compressedSize; +} + +/** ZSTD_findFrameCompressedSize() : + * See docs in zstd.h + * Note: compatible with legacy mode */ +size_t ZSTD_findFrameCompressedSize(const void *src, size_t srcSize) +{ + return ZSTD_findFrameCompressedSize_advanced(src, srcSize, ZSTD_f_zstd1); +} + +/** ZSTD_decompressBound() : + * compatible with legacy mode + * `src` must point to the start of a ZSTD frame or a skippable frame + * `srcSize` must be at least as large as the frame contained + * @return : the maximum decompressed size of the compressed source + */ +unsigned long long ZSTD_decompressBound(const void* src, size_t srcSize) +{ + unsigned long long bound = 0; + /* Iterate over each frame */ + while (srcSize > 0) { + ZSTD_frameSizeInfo const frameSizeInfo = ZSTD_findFrameSizeInfo(src, srcSize, ZSTD_f_zstd1); + size_t const compressedSize = frameSizeInfo.compressedSize; + unsigned long long const decompressedBound = frameSizeInfo.decompressedBound; + if (ZSTD_isError(compressedSize) || decompressedBound == ZSTD_CONTENTSIZE_ERROR) + return ZSTD_CONTENTSIZE_ERROR; + assert(srcSize >= compressedSize); + src = (const BYTE*)src + compressedSize; + srcSize -= compressedSize; + bound += decompressedBound; + } + return bound; +} + +size_t ZSTD_decompressionMargin(void const* src, size_t srcSize) +{ + size_t margin = 0; + unsigned maxBlockSize = 0; + + /* Iterate over each frame */ + while (srcSize > 0) { + ZSTD_frameSizeInfo const frameSizeInfo = ZSTD_findFrameSizeInfo(src, srcSize, ZSTD_f_zstd1); + size_t const compressedSize = frameSizeInfo.compressedSize; + unsigned long long const decompressedBound = frameSizeInfo.decompressedBound; + ZSTD_frameHeader zfh; + + FORWARD_IF_ERROR(ZSTD_getFrameHeader(&zfh, src, srcSize), ""); + if (ZSTD_isError(compressedSize) || decompressedBound == ZSTD_CONTENTSIZE_ERROR) + return ERROR(corruption_detected); + + if (zfh.frameType == ZSTD_frame) { + /* Add the frame header to our margin */ + margin += zfh.headerSize; + /* Add the checksum to our margin */ + margin += zfh.checksumFlag ? 4 : 0; + /* Add 3 bytes per block */ + margin += 3 * frameSizeInfo.nbBlocks; + + /* Compute the max block size */ + maxBlockSize = MAX(maxBlockSize, zfh.blockSizeMax); + } else { + assert(zfh.frameType == ZSTD_skippableFrame); + /* Add the entire skippable frame size to our margin. */ + margin += compressedSize; + } + + assert(srcSize >= compressedSize); + src = (const BYTE*)src + compressedSize; + srcSize -= compressedSize; + } + + /* Add the max block size back to the margin. */ + margin += maxBlockSize; + + return margin; +} + /*-************************************************************* * Frame decoding ***************************************************************/ +/** ZSTD_insertBlock() : + * insert `src` block into `dctx` history. Useful to track uncompressed blocks. */ +size_t ZSTD_insertBlock(ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize) +{ + DEBUGLOG(5, "ZSTD_insertBlock: %u bytes", (unsigned)blockSize); + ZSTD_checkContinuity(dctx, blockStart, blockSize); + dctx->previousDstEnd = (const char*)blockStart + blockSize; + return blockSize; +} + + static size_t ZSTD_copyRawBlock(void* dst, size_t dstCapacity, const void* src, size_t srcSize) { @@ -342,7 +897,7 @@ static size_t ZSTD_copyRawBlock(void* dst, size_t dstCapacity, if (srcSize == 0) return 0; RETURN_ERROR(dstBuffer_null, ""); } - ZSTD_memcpy(dst, src, srcSize); + ZSTD_memmove(dst, src, srcSize); return srcSize; } @@ -361,10 +916,28 @@ static size_t ZSTD_setRleBlock(void* dst, size_t dstCapacity, static void ZSTD_DCtx_trace_end(ZSTD_DCtx const* dctx, U64 uncompressedSize, U64 compressedSize, unsigned streaming) { +#if ZSTD_TRACE + if (dctx->traceCtx && ZSTD_trace_decompress_end != NULL) { + ZSTD_Trace trace; + ZSTD_memset(&trace, 0, sizeof(trace)); + trace.version = ZSTD_VERSION_NUMBER; + trace.streaming = streaming; + if (dctx->ddict) { + trace.dictionaryID = ZSTD_getDictID_fromDDict(dctx->ddict); + trace.dictionarySize = ZSTD_DDict_dictSize(dctx->ddict); + trace.dictionaryIsCold = dctx->ddictIsCold; + } + trace.uncompressedSize = (size_t)uncompressedSize; + trace.compressedSize = (size_t)compressedSize; + trace.dctx = dctx; + ZSTD_trace_decompress_end(dctx->traceCtx, &trace); + } +#else (void)dctx; (void)uncompressedSize; (void)compressedSize; (void)streaming; +#endif } @@ -400,8 +973,13 @@ static size_t ZSTD_decompressFrame(ZSTD_DCtx* dctx, ip += frameHeaderSize; remainingSrcSize -= frameHeaderSize; } + /* Shrink the blockSizeMax if enabled */ + if (dctx->maxBlockSizeParam != 0) + dctx->fParams.blockSizeMax = MIN(dctx->fParams.blockSizeMax, (unsigned)dctx->maxBlockSizeParam); + /* Loop on each block */ while (1) { + BYTE* oBlockEnd = oend; size_t decodedSize; blockProperties_t blockProperties; size_t const cBlockSize = ZSTD_getcBlockSize(ip, remainingSrcSize, &blockProperties); @@ -411,27 +989,48 @@ static size_t ZSTD_decompressFrame(ZSTD_DCtx* dctx, remainingSrcSize -= ZSTD_blockHeaderSize; RETURN_ERROR_IF(cBlockSize > remainingSrcSize, srcSize_wrong, ""); + if (ip >= op && ip < oBlockEnd) { + /* We are decompressing in-place. Limit the output pointer so that we + * don't overwrite the block that we are currently reading. This will + * fail decompression if the input & output pointers aren't spaced + * far enough apart. + * + * This is important to set, even when the pointers are far enough + * apart, because ZSTD_decompressBlock_internal() can decide to store + * literals in the output buffer, after the block it is decompressing. + * Since we don't want anything to overwrite our input, we have to tell + * ZSTD_decompressBlock_internal to never write past ip. + * + * See ZSTD_allocateLiteralsBuffer() for reference. + */ + oBlockEnd = op + (ip - op); + } + switch(blockProperties.blockType) { case bt_compressed: - decodedSize = ZSTD_decompressBlock_internal(dctx, op, (size_t)(oend-op), ip, cBlockSize, /* frame */ 1); + assert(dctx->isFrameDecompression == 1); + decodedSize = ZSTD_decompressBlock_internal(dctx, op, (size_t)(oBlockEnd-op), ip, cBlockSize, not_streaming); break; case bt_raw : + /* Use oend instead of oBlockEnd because this function is safe to overlap. It uses memmove. */ decodedSize = ZSTD_copyRawBlock(op, (size_t)(oend-op), ip, cBlockSize); break; case bt_rle : - decodedSize = ZSTD_setRleBlock(op, (size_t)(oend-op), *ip, blockProperties.origSize); + decodedSize = ZSTD_setRleBlock(op, (size_t)(oBlockEnd-op), *ip, blockProperties.origSize); break; case bt_reserved : default: RETURN_ERROR(corruption_detected, "invalid block type"); } - - if (ZSTD_isError(decodedSize)) return decodedSize; - if (dctx->validateChecksum) + FORWARD_IF_ERROR(decodedSize, "Block decompression failure"); + DEBUGLOG(5, "Decompressed block of dSize = %u", (unsigned)decodedSize); + if (dctx->validateChecksum) { XXH64_update(&dctx->xxhState, op, decodedSize); - if (decodedSize != 0) + } + if (decodedSize) /* support dst = NULL,0 */ { op += decodedSize; + } assert(ip != NULL); ip += cBlockSize; remainingSrcSize -= cBlockSize; @@ -455,11 +1054,164 @@ static size_t ZSTD_decompressFrame(ZSTD_DCtx* dctx, } ZSTD_DCtx_trace_end(dctx, (U64)(op-ostart), (U64)(ip-istart), /* streaming */ 0); /* Allow caller to get size read */ + DEBUGLOG(4, "ZSTD_decompressFrame: decompressed frame of size %i, consuming %i bytes of input", (int)(op-ostart), (int)(ip - (const BYTE*)*srcPtr)); *srcPtr = ip; *srcSizePtr = remainingSrcSize; return (size_t)(op-ostart); } +static +ZSTD_ALLOW_POINTER_OVERFLOW_ATTR +size_t ZSTD_decompressMultiFrame(ZSTD_DCtx* dctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + const void* dict, size_t dictSize, + const ZSTD_DDict* ddict) +{ + void* const dststart = dst; + int moreThan1Frame = 0; + + DEBUGLOG(5, "ZSTD_decompressMultiFrame"); + assert(dict==NULL || ddict==NULL); /* either dict or ddict set, not both */ + + if (ddict) { + dict = ZSTD_DDict_dictContent(ddict); + dictSize = ZSTD_DDict_dictSize(ddict); + } + + while (srcSize >= ZSTD_startingInputLength(dctx->format)) { + +#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1) + if (dctx->format == ZSTD_f_zstd1 && ZSTD_isLegacy(src, srcSize)) { + size_t decodedSize; + size_t const frameSize = ZSTD_findFrameCompressedSizeLegacy(src, srcSize); + if (ZSTD_isError(frameSize)) return frameSize; + RETURN_ERROR_IF(dctx->staticSize, memory_allocation, + "legacy support is not compatible with static dctx"); + + decodedSize = ZSTD_decompressLegacy(dst, dstCapacity, src, frameSize, dict, dictSize); + if (ZSTD_isError(decodedSize)) return decodedSize; + + { + unsigned long long const expectedSize = ZSTD_getFrameContentSize(src, srcSize); + RETURN_ERROR_IF(expectedSize == ZSTD_CONTENTSIZE_ERROR, corruption_detected, "Corrupted frame header!"); + if (expectedSize != ZSTD_CONTENTSIZE_UNKNOWN) { + RETURN_ERROR_IF(expectedSize != decodedSize, corruption_detected, + "Frame header size does not match decoded size!"); + } + } + + assert(decodedSize <= dstCapacity); + dst = (BYTE*)dst + decodedSize; + dstCapacity -= decodedSize; + + src = (const BYTE*)src + frameSize; + srcSize -= frameSize; + + continue; + } +#endif + + if (dctx->format == ZSTD_f_zstd1 && srcSize >= 4) { + U32 const magicNumber = MEM_readLE32(src); + DEBUGLOG(5, "reading magic number %08X", (unsigned)magicNumber); + if ((magicNumber & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) { + /* skippable frame detected : skip it */ + size_t const skippableSize = readSkippableFrameSize(src, srcSize); + FORWARD_IF_ERROR(skippableSize, "invalid skippable frame"); + assert(skippableSize <= srcSize); + + src = (const BYTE *)src + skippableSize; + srcSize -= skippableSize; + continue; /* check next frame */ + } } + + if (ddict) { + /* we were called from ZSTD_decompress_usingDDict */ + FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDDict(dctx, ddict), ""); + } else { + /* this will initialize correctly with no dict if dict == NULL, so + * use this in all cases but ddict */ + FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDict(dctx, dict, dictSize), ""); + } + ZSTD_checkContinuity(dctx, dst, dstCapacity); + + { const size_t res = ZSTD_decompressFrame(dctx, dst, dstCapacity, + &src, &srcSize); + RETURN_ERROR_IF( + (ZSTD_getErrorCode(res) == ZSTD_error_prefix_unknown) + && (moreThan1Frame==1), + srcSize_wrong, + "At least one frame successfully completed, " + "but following bytes are garbage: " + "it's more likely to be a srcSize error, " + "specifying more input bytes than size of frame(s). " + "Note: one could be unlucky, it might be a corruption error instead, " + "happening right at the place where we expect zstd magic bytes. " + "But this is _much_ less likely than a srcSize field error."); + if (ZSTD_isError(res)) return res; + assert(res <= dstCapacity); + if (res != 0) + dst = (BYTE*)dst + res; + dstCapacity -= res; + } + moreThan1Frame = 1; + } /* while (srcSize >= ZSTD_frameHeaderSize_prefix) */ + + RETURN_ERROR_IF(srcSize, srcSize_wrong, "input not entirely consumed"); + + return (size_t)((BYTE*)dst - (BYTE*)dststart); +} + +size_t ZSTD_decompress_usingDict(ZSTD_DCtx* dctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + const void* dict, size_t dictSize) +{ + return ZSTD_decompressMultiFrame(dctx, dst, dstCapacity, src, srcSize, dict, dictSize, NULL); +} + + +static ZSTD_DDict const* ZSTD_getDDict(ZSTD_DCtx* dctx) +{ + switch (dctx->dictUses) { + default: + assert(0 /* Impossible */); + ZSTD_FALLTHROUGH; + case ZSTD_dont_use: + ZSTD_clearDict(dctx); + return NULL; + case ZSTD_use_indefinitely: + return dctx->ddict; + case ZSTD_use_once: + dctx->dictUses = ZSTD_dont_use; + return dctx->ddict; + } +} + +size_t ZSTD_decompressDCtx(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize) +{ + return ZSTD_decompress_usingDDict(dctx, dst, dstCapacity, src, srcSize, ZSTD_getDDict(dctx)); +} + + +size_t ZSTD_decompress(void* dst, size_t dstCapacity, const void* src, size_t srcSize) +{ +#if defined(ZSTD_HEAPMODE) && (ZSTD_HEAPMODE>=1) + size_t regenSize; + ZSTD_DCtx* const dctx = ZSTD_createDCtx_internal(ZSTD_defaultCMem); + RETURN_ERROR_IF(dctx==NULL, memory_allocation, "NULL pointer!"); + regenSize = ZSTD_decompressDCtx(dctx, dst, dstCapacity, src, srcSize); + ZSTD_freeDCtx(dctx); + return regenSize; +#else /* stack mode */ + ZSTD_DCtx dctx; + ZSTD_initDCtx_internal(&dctx); + return ZSTD_decompressDCtx(&dctx, dst, dstCapacity, src, srcSize); +#endif +} + + /*-************************************** * Advanced Streaming Decompression API * Bufferless and synchronous @@ -467,8 +1219,8 @@ static size_t ZSTD_decompressFrame(ZSTD_DCtx* dctx, size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx) { return dctx->expected; } /** - * Similar to ZSTD_nextSrcSizeToDecompress(), but when when a block input can be streamed, - * we allow taking a partial block as the input. Currently only raw uncompressed blocks can + * Similar to ZSTD_nextSrcSizeToDecompress(), but when a block input can be streamed, we + * allow taking a partial block as the input. Currently only raw uncompressed blocks can * be streamed. * * For blocks that can be streamed, this allows us to reduce the latency until we produce @@ -481,7 +1233,7 @@ static size_t ZSTD_nextSrcSizeToDecompressWithInputSize(ZSTD_DCtx* dctx, size_t return dctx->expected; if (dctx->bType != bt_raw) return dctx->expected; - return MIN(MAX(inputSize, 1), dctx->expected); + return BOUNDED(1, inputSize, dctx->expected); } ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx) { @@ -587,7 +1339,8 @@ size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, c { case bt_compressed: DEBUGLOG(5, "ZSTD_decompressContinue: case bt_compressed"); - rSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize, /* frame */ 1); + assert(dctx->isFrameDecompression == 1); + rSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize, is_streaming); dctx->expected = 0; /* Streaming not supported */ break; case bt_raw : @@ -656,6 +1409,7 @@ size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, c case ZSTDds_decodeSkippableHeader: assert(src != NULL); assert(srcSize <= ZSTD_SKIPPABLEHEADERSIZE); + assert(dctx->format != ZSTD_f_zstd1_magicless); ZSTD_memcpy(dctx->headerBuffer + (ZSTD_SKIPPABLEHEADERSIZE - srcSize), src, srcSize); /* complete skippable header */ dctx->expected = MEM_readLE32(dctx->headerBuffer + ZSTD_FRAMEIDSIZE); /* note : dctx->expected can grow seriously large, beyond local buffer size */ dctx->stage = ZSTDds_skipFrame; @@ -668,7 +1422,7 @@ size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, c default: assert(0); /* impossible */ - RETURN_ERROR(GENERIC, "impossible to reach"); /* some compiler require default to do something */ + RETURN_ERROR(GENERIC, "impossible to reach"); /* some compilers require default to do something */ } } @@ -679,6 +1433,10 @@ static size_t ZSTD_refDictContent(ZSTD_DCtx* dctx, const void* dict, size_t dict dctx->virtualStart = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->prefixStart)); dctx->prefixStart = dict; dctx->previousDstEnd = (const char*)dict + dictSize; +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + dctx->dictContentBeginForFuzzing = dctx->prefixStart; + dctx->dictContentEndForFuzzing = dctx->previousDstEnd; +#endif return 0; } @@ -705,11 +1463,11 @@ ZSTD_loadDEntropy(ZSTD_entropyDTables_t* entropy, /* in minimal huffman, we always use X1 variants */ size_t const hSize = HUF_readDTableX1_wksp(entropy->hufTable, dictPtr, dictEnd - dictPtr, - workspace, workspaceSize); + workspace, workspaceSize, /* flags */ 0); #else size_t const hSize = HUF_readDTableX2_wksp(entropy->hufTable, dictPtr, (size_t)(dictEnd - dictPtr), - workspace, workspaceSize); + workspace, workspaceSize, /* flags */ 0); #endif RETURN_ERROR_IF(HUF_isError(hSize), dictionary_corrupted, ""); dictPtr += hSize; @@ -773,9 +1531,33 @@ ZSTD_loadDEntropy(ZSTD_entropyDTables_t* entropy, return (size_t)(dictPtr - (const BYTE*)dict); } +static size_t ZSTD_decompress_insertDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize) +{ + if (dictSize < 8) return ZSTD_refDictContent(dctx, dict, dictSize); + { U32 const magic = MEM_readLE32(dict); + if (magic != ZSTD_MAGIC_DICTIONARY) { + return ZSTD_refDictContent(dctx, dict, dictSize); /* pure content mode */ + } } + dctx->dictID = MEM_readLE32((const char*)dict + ZSTD_FRAMEIDSIZE); + + /* load entropy tables */ + { size_t const eSize = ZSTD_loadDEntropy(&dctx->entropy, dict, dictSize); + RETURN_ERROR_IF(ZSTD_isError(eSize), dictionary_corrupted, ""); + dict = (const char*)dict + eSize; + dictSize -= eSize; + } + dctx->litEntropy = dctx->fseEntropy = 1; + + /* reference dictionary content */ + return ZSTD_refDictContent(dctx, dict, dictSize); +} + size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx) { assert(dctx != NULL); +#if ZSTD_TRACE + dctx->traceCtx = (ZSTD_trace_decompress_begin != NULL) ? ZSTD_trace_decompress_begin(dctx) : 0; +#endif dctx->expected = ZSTD_startingInputLength(dctx->format); /* dctx->format must be properly set */ dctx->stage = ZSTDds_getFrameHeaderSize; dctx->processedCSize = 0; @@ -784,12 +1566,11 @@ size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx) dctx->prefixStart = NULL; dctx->virtualStart = NULL; dctx->dictEnd = NULL; - dctx->entropy.hufTable[0] = (HUF_DTable)((HufLog)*0x1000001); /* cover both little and big endian */ + dctx->entropy.hufTable[0] = (HUF_DTable)((ZSTD_HUFFDTABLE_CAPACITY_LOG)*0x1000001); /* cover both little and big endian */ dctx->litEntropy = dctx->fseEntropy = 0; -#if ZSTD_DECOMPRESS_DICTIONARY != 0 dctx->dictID = 0; -#endif dctx->bType = bt_reserved; + dctx->isFrameDecompression = 1; ZSTD_STATIC_ASSERT(sizeof(dctx->entropy.rep) == sizeof(repStartValue)); ZSTD_memcpy(dctx->entropy.rep, repStartValue, sizeof(repStartValue)); /* initial repcodes */ dctx->LLTptr = dctx->entropy.LLTable; @@ -802,13 +1583,10 @@ size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx) size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize) { FORWARD_IF_ERROR( ZSTD_decompressBegin(dctx) , ""); -#if ZSTD_DECOMPRESS_DICTIONARY != 0 if (dict && dictSize) RETURN_ERROR_IF( ZSTD_isError(ZSTD_decompress_insertDictionary(dctx, dict, dictSize)), dictionary_corrupted, ""); -#endif - (void)dict; (void)dictSize; return 0; } @@ -819,8 +1597,6 @@ size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict) { DEBUGLOG(4, "ZSTD_decompressBegin_usingDDict"); assert(dctx != NULL); - (void)ddict; -#if ZSTD_DECOMPRESS_DICTIONARY != 0 if (ddict) { const char* const dictStart = (const char*)ZSTD_DDict_dictContent(ddict); size_t const dictSize = ZSTD_DDict_dictSize(ddict); @@ -829,13 +1605,10 @@ size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict) DEBUGLOG(4, "DDict is %s", dctx->ddictIsCold ? "~cold~" : "hot!"); } -#endif FORWARD_IF_ERROR( ZSTD_decompressBegin(dctx) , ""); -#if ZSTD_DECOMPRESS_DICTIONARY != 0 if (ddict) { /* NULL ddict is equivalent to no dictionary */ ZSTD_copyDDictParameters(dctx, ddict); } -#endif return 0; } @@ -856,7 +1629,7 @@ unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize) * This could for one of the following reasons : * - The frame does not require a dictionary (most common case). * - The frame was built with dictID intentionally removed. - * Needed dictionary is a hidden information. + * Needed dictionary is a hidden piece of information. * Note : this use case also happens when using a non-conformant dictionary. * - `srcSize` is too small, and as a result, frame header could not be decoded. * Note : possible if `srcSize < ZSTD_FRAMEHEADERSIZE_MAX`. @@ -865,12 +1638,28 @@ unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize) * ZSTD_getFrameHeader(), which will provide a more precise error code. */ unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize) { - ZSTD_frameHeader zfp = { 0, 0, 0, ZSTD_frame, 0, 0, 0 }; + ZSTD_frameHeader zfp = { 0, 0, 0, ZSTD_frame, 0, 0, 0, 0, 0 }; size_t const hError = ZSTD_getFrameHeader(&zfp, src, srcSize); if (ZSTD_isError(hError)) return 0; return zfp.dictID; } + +/*! ZSTD_decompress_usingDDict() : +* Decompression using a pre-digested Dictionary +* Use dictionary without significant overhead. */ +size_t ZSTD_decompress_usingDDict(ZSTD_DCtx* dctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + const ZSTD_DDict* ddict) +{ + /* pass content and size in case legacy frames are encountered */ + return ZSTD_decompressMultiFrame(dctx, dst, dstCapacity, src, srcSize, + NULL, 0, + ddict); +} + + /*===================================== * Streaming decompression *====================================*/ @@ -881,6 +1670,16 @@ ZSTD_DStream* ZSTD_createDStream(void) return ZSTD_createDCtx_internal(ZSTD_defaultCMem); } +ZSTD_DStream* ZSTD_initStaticDStream(void *workspace, size_t workspaceSize) +{ + return ZSTD_initStaticDCtx(workspace, workspaceSize); +} + +ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem) +{ + return ZSTD_createDCtx_internal(customMem); +} + size_t ZSTD_freeDStream(ZSTD_DStream* zds) { return ZSTD_freeDCtx(zds); @@ -892,12 +1691,63 @@ size_t ZSTD_freeDStream(ZSTD_DStream* zds) size_t ZSTD_DStreamInSize(void) { return ZSTD_BLOCKSIZE_MAX + ZSTD_blockHeaderSize; } size_t ZSTD_DStreamOutSize(void) { return ZSTD_BLOCKSIZE_MAX; } +size_t ZSTD_DCtx_loadDictionary_advanced(ZSTD_DCtx* dctx, + const void* dict, size_t dictSize, + ZSTD_dictLoadMethod_e dictLoadMethod, + ZSTD_dictContentType_e dictContentType) +{ + RETURN_ERROR_IF(dctx->streamStage != zdss_init, stage_wrong, ""); + ZSTD_clearDict(dctx); + if (dict && dictSize != 0) { + dctx->ddictLocal = ZSTD_createDDict_advanced(dict, dictSize, dictLoadMethod, dictContentType, dctx->customMem); + RETURN_ERROR_IF(dctx->ddictLocal == NULL, memory_allocation, "NULL pointer!"); + dctx->ddict = dctx->ddictLocal; + dctx->dictUses = ZSTD_use_indefinitely; + } + return 0; +} + +size_t ZSTD_DCtx_loadDictionary_byReference(ZSTD_DCtx* dctx, const void* dict, size_t dictSize) +{ + return ZSTD_DCtx_loadDictionary_advanced(dctx, dict, dictSize, ZSTD_dlm_byRef, ZSTD_dct_auto); +} + +size_t ZSTD_DCtx_loadDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize) +{ + return ZSTD_DCtx_loadDictionary_advanced(dctx, dict, dictSize, ZSTD_dlm_byCopy, ZSTD_dct_auto); +} + +size_t ZSTD_DCtx_refPrefix_advanced(ZSTD_DCtx* dctx, const void* prefix, size_t prefixSize, ZSTD_dictContentType_e dictContentType) +{ + FORWARD_IF_ERROR(ZSTD_DCtx_loadDictionary_advanced(dctx, prefix, prefixSize, ZSTD_dlm_byRef, dictContentType), ""); + dctx->dictUses = ZSTD_use_once; + return 0; +} + +size_t ZSTD_DCtx_refPrefix(ZSTD_DCtx* dctx, const void* prefix, size_t prefixSize) +{ + return ZSTD_DCtx_refPrefix_advanced(dctx, prefix, prefixSize, ZSTD_dct_rawContent); +} + + +/* ZSTD_initDStream_usingDict() : + * return : expected size, aka ZSTD_startingInputLength(). + * this function cannot fail */ +size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize) +{ + DEBUGLOG(4, "ZSTD_initDStream_usingDict"); + FORWARD_IF_ERROR( ZSTD_DCtx_reset(zds, ZSTD_reset_session_only) , ""); + FORWARD_IF_ERROR( ZSTD_DCtx_loadDictionary(zds, dict, dictSize) , ""); + return ZSTD_startingInputLength(zds->format); +} /* note : this variant can't fail */ size_t ZSTD_initDStream(ZSTD_DStream* zds) { DEBUGLOG(4, "ZSTD_initDStream"); - return ZSTD_initDStream_usingDDict(zds, NULL); + FORWARD_IF_ERROR(ZSTD_DCtx_reset(zds, ZSTD_reset_session_only), ""); + FORWARD_IF_ERROR(ZSTD_DCtx_refDDict(zds, NULL), ""); + return ZSTD_startingInputLength(zds->format); } /* ZSTD_initDStream_usingDDict() : @@ -905,6 +1755,7 @@ size_t ZSTD_initDStream(ZSTD_DStream* zds) * this function cannot fail */ size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* dctx, const ZSTD_DDict* ddict) { + DEBUGLOG(4, "ZSTD_initDStream_usingDDict"); FORWARD_IF_ERROR( ZSTD_DCtx_reset(dctx, ZSTD_reset_session_only) , ""); FORWARD_IF_ERROR( ZSTD_DCtx_refDDict(dctx, ddict) , ""); return ZSTD_startingInputLength(dctx->format); @@ -915,11 +1766,178 @@ size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* dctx, const ZSTD_DDict* ddict) * this function cannot fail */ size_t ZSTD_resetDStream(ZSTD_DStream* dctx) { + DEBUGLOG(4, "ZSTD_resetDStream"); FORWARD_IF_ERROR(ZSTD_DCtx_reset(dctx, ZSTD_reset_session_only), ""); return ZSTD_startingInputLength(dctx->format); } +size_t ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict) +{ + RETURN_ERROR_IF(dctx->streamStage != zdss_init, stage_wrong, ""); + ZSTD_clearDict(dctx); + if (ddict) { + dctx->ddict = ddict; + dctx->dictUses = ZSTD_use_indefinitely; + if (dctx->refMultipleDDicts == ZSTD_rmd_refMultipleDDicts) { + if (dctx->ddictSet == NULL) { + dctx->ddictSet = ZSTD_createDDictHashSet(dctx->customMem); + if (!dctx->ddictSet) { + RETURN_ERROR(memory_allocation, "Failed to allocate memory for hash set!"); + } + } + assert(!dctx->staticSize); /* Impossible: ddictSet cannot have been allocated if static dctx */ + FORWARD_IF_ERROR(ZSTD_DDictHashSet_addDDict(dctx->ddictSet, ddict, dctx->customMem), ""); + } + } + return 0; +} + +/* ZSTD_DCtx_setMaxWindowSize() : + * note : no direct equivalence in ZSTD_DCtx_setParameter, + * since this version sets windowSize, and the other sets windowLog */ +size_t ZSTD_DCtx_setMaxWindowSize(ZSTD_DCtx* dctx, size_t maxWindowSize) +{ + ZSTD_bounds const bounds = ZSTD_dParam_getBounds(ZSTD_d_windowLogMax); + size_t const min = (size_t)1 << bounds.lowerBound; + size_t const max = (size_t)1 << bounds.upperBound; + RETURN_ERROR_IF(dctx->streamStage != zdss_init, stage_wrong, ""); + RETURN_ERROR_IF(maxWindowSize < min, parameter_outOfBound, ""); + RETURN_ERROR_IF(maxWindowSize > max, parameter_outOfBound, ""); + dctx->maxWindowSize = maxWindowSize; + return 0; +} + +size_t ZSTD_DCtx_setFormat(ZSTD_DCtx* dctx, ZSTD_format_e format) +{ + return ZSTD_DCtx_setParameter(dctx, ZSTD_d_format, (int)format); +} + +ZSTD_bounds ZSTD_dParam_getBounds(ZSTD_dParameter dParam) +{ + ZSTD_bounds bounds = { 0, 0, 0 }; + switch(dParam) { + case ZSTD_d_windowLogMax: + bounds.lowerBound = ZSTD_WINDOWLOG_ABSOLUTEMIN; + bounds.upperBound = ZSTD_WINDOWLOG_MAX; + return bounds; + case ZSTD_d_format: + bounds.lowerBound = (int)ZSTD_f_zstd1; + bounds.upperBound = (int)ZSTD_f_zstd1_magicless; + ZSTD_STATIC_ASSERT(ZSTD_f_zstd1 < ZSTD_f_zstd1_magicless); + return bounds; + case ZSTD_d_stableOutBuffer: + bounds.lowerBound = (int)ZSTD_bm_buffered; + bounds.upperBound = (int)ZSTD_bm_stable; + return bounds; + case ZSTD_d_forceIgnoreChecksum: + bounds.lowerBound = (int)ZSTD_d_validateChecksum; + bounds.upperBound = (int)ZSTD_d_ignoreChecksum; + return bounds; + case ZSTD_d_refMultipleDDicts: + bounds.lowerBound = (int)ZSTD_rmd_refSingleDDict; + bounds.upperBound = (int)ZSTD_rmd_refMultipleDDicts; + return bounds; + case ZSTD_d_disableHuffmanAssembly: + bounds.lowerBound = 0; + bounds.upperBound = 1; + return bounds; + case ZSTD_d_maxBlockSize: + bounds.lowerBound = ZSTD_BLOCKSIZE_MAX_MIN; + bounds.upperBound = ZSTD_BLOCKSIZE_MAX; + return bounds; + + default:; + } + bounds.error = ERROR(parameter_unsupported); + return bounds; +} + +/* ZSTD_dParam_withinBounds: + * @return 1 if value is within dParam bounds, + * 0 otherwise */ +static int ZSTD_dParam_withinBounds(ZSTD_dParameter dParam, int value) +{ + ZSTD_bounds const bounds = ZSTD_dParam_getBounds(dParam); + if (ZSTD_isError(bounds.error)) return 0; + if (value < bounds.lowerBound) return 0; + if (value > bounds.upperBound) return 0; + return 1; +} + +#define CHECK_DBOUNDS(p,v) { \ + RETURN_ERROR_IF(!ZSTD_dParam_withinBounds(p, v), parameter_outOfBound, ""); \ +} + +size_t ZSTD_DCtx_getParameter(ZSTD_DCtx* dctx, ZSTD_dParameter param, int* value) +{ + switch (param) { + case ZSTD_d_windowLogMax: + *value = (int)ZSTD_highbit32((U32)dctx->maxWindowSize); + return 0; + case ZSTD_d_format: + *value = (int)dctx->format; + return 0; + case ZSTD_d_stableOutBuffer: + *value = (int)dctx->outBufferMode; + return 0; + case ZSTD_d_forceIgnoreChecksum: + *value = (int)dctx->forceIgnoreChecksum; + return 0; + case ZSTD_d_refMultipleDDicts: + *value = (int)dctx->refMultipleDDicts; + return 0; + case ZSTD_d_disableHuffmanAssembly: + *value = (int)dctx->disableHufAsm; + return 0; + case ZSTD_d_maxBlockSize: + *value = dctx->maxBlockSizeParam; + return 0; + default:; + } + RETURN_ERROR(parameter_unsupported, ""); +} + +size_t ZSTD_DCtx_setParameter(ZSTD_DCtx* dctx, ZSTD_dParameter dParam, int value) +{ + RETURN_ERROR_IF(dctx->streamStage != zdss_init, stage_wrong, ""); + switch(dParam) { + case ZSTD_d_windowLogMax: + if (value == 0) value = ZSTD_WINDOWLOG_LIMIT_DEFAULT; + CHECK_DBOUNDS(ZSTD_d_windowLogMax, value); + dctx->maxWindowSize = ((size_t)1) << value; + return 0; + case ZSTD_d_format: + CHECK_DBOUNDS(ZSTD_d_format, value); + dctx->format = (ZSTD_format_e)value; + return 0; + case ZSTD_d_stableOutBuffer: + CHECK_DBOUNDS(ZSTD_d_stableOutBuffer, value); + dctx->outBufferMode = (ZSTD_bufferMode_e)value; + return 0; + case ZSTD_d_forceIgnoreChecksum: + CHECK_DBOUNDS(ZSTD_d_forceIgnoreChecksum, value); + dctx->forceIgnoreChecksum = (ZSTD_forceIgnoreChecksum_e)value; + return 0; + case ZSTD_d_refMultipleDDicts: + CHECK_DBOUNDS(ZSTD_d_refMultipleDDicts, value); + if (dctx->staticSize != 0) { + RETURN_ERROR(parameter_unsupported, "Static dctx does not support multiple DDicts!"); + } + dctx->refMultipleDDicts = (ZSTD_refMultipleDDicts_e)value; + return 0; + case ZSTD_d_disableHuffmanAssembly: + CHECK_DBOUNDS(ZSTD_d_disableHuffmanAssembly, value); + dctx->disableHufAsm = value != 0; + return 0; + case ZSTD_d_maxBlockSize: + if (value != 0) CHECK_DBOUNDS(ZSTD_d_maxBlockSize, value); + dctx->maxBlockSizeParam = value; + return 0; + default:; + } + RETURN_ERROR(parameter_unsupported, ""); +} size_t ZSTD_DCtx_reset(ZSTD_DCtx* dctx, ZSTD_ResetDirective reset) { @@ -927,6 +1945,7 @@ size_t ZSTD_DCtx_reset(ZSTD_DCtx* dctx, ZSTD_ResetDirective reset) || (reset == ZSTD_reset_session_and_parameters) ) { dctx->streamStage = zdss_init; dctx->noForwardProgress = 0; + dctx->isFrameDecompression = 1; } if ( (reset == ZSTD_reset_parameters) || (reset == ZSTD_reset_session_and_parameters) ) { @@ -937,10 +1956,23 @@ size_t ZSTD_DCtx_reset(ZSTD_DCtx* dctx, ZSTD_ResetDirective reset) return 0; } -size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize) + +size_t ZSTD_sizeof_DStream(const ZSTD_DStream* dctx) { - size_t const blockSize = (size_t) MIN(windowSize, ZSTD_BLOCKSIZE_MAX); - unsigned long long const neededRBSize = windowSize + blockSize + (WILDCOPY_OVERLENGTH * 2); + return ZSTD_sizeof_DCtx(dctx); +} + +static size_t ZSTD_decodingBufferSize_internal(unsigned long long windowSize, unsigned long long frameContentSize, size_t blockSizeMax) +{ + size_t const blockSize = MIN((size_t)MIN(windowSize, ZSTD_BLOCKSIZE_MAX), blockSizeMax); + /* We need blockSize + WILDCOPY_OVERLENGTH worth of buffer so that if a block + * ends at windowSize + WILDCOPY_OVERLENGTH + 1 bytes, we can start writing + * the block at the beginning of the output buffer, and maintain a full window. + * + * We need another blockSize worth of buffer so that we can store split + * literals at the end of the block without overwriting the extDict window. + */ + unsigned long long const neededRBSize = windowSize + (blockSize * 2) + (WILDCOPY_OVERLENGTH * 2); unsigned long long const neededSize = MIN(frameContentSize, neededRBSize); size_t const minRBSize = (size_t) neededSize; RETURN_ERROR_IF((unsigned long long)minRBSize != neededSize, @@ -948,6 +1980,31 @@ size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long return minRBSize; } +size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize) +{ + return ZSTD_decodingBufferSize_internal(windowSize, frameContentSize, ZSTD_BLOCKSIZE_MAX); +} + +size_t ZSTD_estimateDStreamSize(size_t windowSize) +{ + size_t const blockSize = MIN(windowSize, ZSTD_BLOCKSIZE_MAX); + size_t const inBuffSize = blockSize; /* no block can be larger */ + size_t const outBuffSize = ZSTD_decodingBufferSize_min(windowSize, ZSTD_CONTENTSIZE_UNKNOWN); + return ZSTD_estimateDCtxSize() + inBuffSize + outBuffSize; +} + +size_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize) +{ + U32 const windowSizeMax = 1U << ZSTD_WINDOWLOG_MAX; /* note : should be user-selectable, but requires an additional parameter (or a dctx) */ + ZSTD_frameHeader zfh; + size_t const err = ZSTD_getFrameHeader(&zfh, src, srcSize); + if (ZSTD_isError(err)) return err; + RETURN_ERROR_IF(err>0, srcSize_wrong, ""); + RETURN_ERROR_IF(zfh.windowSize > windowSizeMax, + frameParameter_windowTooLarge, ""); + return ZSTD_estimateDStreamSize((size_t)zfh.windowSize); +} + /* ***** Decompression ***** */ @@ -969,6 +2026,24 @@ static int ZSTD_DCtx_isOversizedTooLong(ZSTD_DStream* zds) return zds->oversizedDuration >= ZSTD_WORKSPACETOOLARGE_MAXDURATION; } +/* Checks that the output buffer hasn't changed if ZSTD_obm_stable is used. */ +static size_t ZSTD_checkOutBuffer(ZSTD_DStream const* zds, ZSTD_outBuffer const* output) +{ + ZSTD_outBuffer const expect = zds->expectedOutBuffer; + /* No requirement when ZSTD_obm_stable is not enabled. */ + if (zds->outBufferMode != ZSTD_bm_stable) + return 0; + /* Any buffer is allowed in zdss_init, this must be the same for every other call until + * the context is reset. + */ + if (zds->streamStage == zdss_init) + return 0; + /* The buffer must match our expectation exactly. */ + if (expect.dst == output->dst && expect.pos == output->pos && expect.size == output->size) + return 0; + RETURN_ERROR(dstBuffer_wrong, "ZSTD_d_stableOutBuffer enabled but output differs!"); +} + /* Calls ZSTD_decompressContinue() with the right parameters for ZSTD_decompressStream() * and updates the stage and the output buffer state. This call is extracted so it can be * used both when reading directly from the ZSTD_inBuffer, and in buffered input mode. @@ -978,7 +2053,7 @@ static size_t ZSTD_decompressContinueStream( ZSTD_DStream* zds, char** op, char* oend, void const* src, size_t srcSize) { int const isSkipFrame = ZSTD_isSkipFrame(zds); - if (ZSTD_DCtx_get_outBufferMode(zds) == ZSTD_bm_buffered) { + if (zds->outBufferMode == ZSTD_bm_buffered) { size_t const dstSize = isSkipFrame ? 0 : zds->outBuffSize - zds->outStart; size_t const decodedSize = ZSTD_decompressContinue(zds, zds->outBuff + zds->outStart, dstSize, src, srcSize); @@ -998,7 +2073,7 @@ static size_t ZSTD_decompressContinueStream( /* Flushing is not needed. */ zds->streamStage = zdss_read; assert(*op <= oend); - assert(ZSTD_DCtx_get_outBufferMode(zds) == ZSTD_bm_stable); + assert(zds->outBufferMode == ZSTD_bm_stable); } return 0; } @@ -1036,20 +2111,47 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB DEBUGLOG(5, "stage zdss_init => transparent reset "); zds->streamStage = zdss_loadHeader; zds->lhSize = zds->inPos = zds->outStart = zds->outEnd = 0; +#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1) + zds->legacyVersion = 0; +#endif zds->hostageByte = 0; zds->expectedOutBuffer = *output; ZSTD_FALLTHROUGH; case zdss_loadHeader : DEBUGLOG(5, "stage zdss_loadHeader (srcSize : %u)", (U32)(iend - ip)); +#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1) + if (zds->legacyVersion) { + RETURN_ERROR_IF(zds->staticSize, memory_allocation, + "legacy support is incompatible with static dctx"); + { size_t const hint = ZSTD_decompressLegacyStream(zds->legacyContext, zds->legacyVersion, output, input); + if (hint==0) zds->streamStage = zdss_init; + return hint; + } } +#endif { size_t const hSize = ZSTD_getFrameHeader_advanced(&zds->fParams, zds->headerBuffer, zds->lhSize, zds->format); -#if ZSTD_DECOMPRESS_DICTIONARY != 0 if (zds->refMultipleDDicts && zds->ddictSet) { ZSTD_DCtx_selectFrameDDict(zds); } -#endif - DEBUGLOG(5, "header size : %u", (U32)hSize); if (ZSTD_isError(hSize)) { +#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1) + U32 const legacyVersion = ZSTD_isLegacy(istart, iend-istart); + if (legacyVersion) { + ZSTD_DDict const* const ddict = ZSTD_getDDict(zds); + const void* const dict = ddict ? ZSTD_DDict_dictContent(ddict) : NULL; + size_t const dictSize = ddict ? ZSTD_DDict_dictSize(ddict) : 0; + DEBUGLOG(5, "ZSTD_decompressStream: detected legacy version v0.%u", legacyVersion); + RETURN_ERROR_IF(zds->staticSize, memory_allocation, + "legacy support is incompatible with static dctx"); + FORWARD_IF_ERROR(ZSTD_initLegacyStream(&zds->legacyContext, + zds->previousLegacyVersion, legacyVersion, + dict, dictSize), ""); + zds->legacyVersion = zds->previousLegacyVersion = legacyVersion; + { size_t const hint = ZSTD_decompressLegacyStream(zds->legacyContext, legacyVersion, output, input); + if (hint==0) zds->streamStage = zdss_init; /* or stay in stage zdss_loadHeader */ + return hint; + } } +#endif return hSize; /* error */ } if (hSize != 0) { /* need more input */ @@ -1062,6 +2164,11 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB zds->lhSize += remainingInput; } input->pos = input->size; + /* check first few bytes */ + FORWARD_IF_ERROR( + ZSTD_getFrameHeader_advanced(&zds->fParams, zds->headerBuffer, zds->lhSize, zds->format), + "First few bytes detected incorrect" ); + /* return hint input size */ return (MAX((size_t)ZSTD_FRAMEHEADERSIZE_MIN(zds->format), hSize) - zds->lhSize) + ZSTD_blockHeaderSize; /* remaining header bytes + next block header */ } assert(ip != NULL); @@ -1069,8 +2176,27 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB break; } } + /* check for single-pass mode opportunity */ + if (zds->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN + && zds->fParams.frameType != ZSTD_skippableFrame + && (U64)(size_t)(oend-op) >= zds->fParams.frameContentSize) { + size_t const cSize = ZSTD_findFrameCompressedSize_advanced(istart, (size_t)(iend-istart), zds->format); + if (cSize <= (size_t)(iend-istart)) { + /* shortcut : using single-pass mode */ + size_t const decompressedSize = ZSTD_decompress_usingDDict(zds, op, (size_t)(oend-op), istart, cSize, ZSTD_getDDict(zds)); + if (ZSTD_isError(decompressedSize)) return decompressedSize; + DEBUGLOG(4, "shortcut to single-pass ZSTD_decompress_usingDDict()"); + assert(istart != NULL); + ip = istart + cSize; + op = op ? op + decompressedSize : op; /* can occur if frameContentSize = 0 (empty frame) */ + zds->expected = 0; + zds->streamStage = zdss_init; + someMoreWork = 0; + break; + } } + /* Check output buffer is large enough for ZSTD_odm_stable. */ - if (ZSTD_DCtx_get_outBufferMode(zds) == ZSTD_bm_stable + if (zds->outBufferMode == ZSTD_bm_stable && zds->fParams.frameType != ZSTD_skippableFrame && zds->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN && (U64)(size_t)(oend-op) < zds->fParams.frameContentSize) { @@ -1081,7 +2207,8 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB DEBUGLOG(4, "Consume header"); FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDDict(zds, ZSTD_getDDict(zds)), ""); - if ((MEM_readLE32(zds->headerBuffer) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) { /* skippable frame */ + if (zds->format == ZSTD_f_zstd1 + && (MEM_readLE32(zds->headerBuffer) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) { /* skippable frame */ zds->expected = MEM_readLE32(zds->headerBuffer + ZSTD_FRAMEIDSIZE); zds->stage = ZSTDds_skipFrame; } else { @@ -1097,11 +2224,13 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB zds->fParams.windowSize = MAX(zds->fParams.windowSize, 1U << ZSTD_WINDOWLOG_ABSOLUTEMIN); RETURN_ERROR_IF(zds->fParams.windowSize > zds->maxWindowSize, frameParameter_windowTooLarge, ""); + if (zds->maxBlockSizeParam != 0) + zds->fParams.blockSizeMax = MIN(zds->fParams.blockSizeMax, (unsigned)zds->maxBlockSizeParam); /* Adapt buffer sizes to frame header instructions */ { size_t const neededInBuffSize = MAX(zds->fParams.blockSizeMax, 4 /* frame checksum */); - size_t const neededOutBuffSize = ZSTD_DCtx_get_outBufferMode(zds) == ZSTD_bm_buffered - ? ZSTD_decodingBufferSize_min(zds->fParams.windowSize, zds->fParams.frameContentSize) + size_t const neededOutBuffSize = zds->outBufferMode == ZSTD_bm_buffered + ? ZSTD_decodingBufferSize_internal(zds->fParams.windowSize, zds->fParams.frameContentSize, zds->fParams.blockSizeMax) : 0; ZSTD_DCtx_updateOversizedDuration(zds, neededInBuffSize, neededOutBuffSize); @@ -1115,17 +2244,17 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB (U32)zds->inBuffSize, (U32)neededInBuffSize); DEBUGLOG(4, "outBuff : from %u to %u", (U32)zds->outBuffSize, (U32)neededOutBuffSize); - if (ZSTD_DCtx_get_staticSize(zds)) { /* static DCtx */ - DEBUGLOG(4, "staticSize : %u", (U32)ZSTD_DCtx_get_staticSize(zds)); - assert(ZSTD_DCtx_get_staticSize(zds) >= sizeof(ZSTD_DCtx)); /* controlled at init */ + if (zds->staticSize) { /* static DCtx */ + DEBUGLOG(4, "staticSize : %u", (U32)zds->staticSize); + assert(zds->staticSize >= sizeof(ZSTD_DCtx)); /* controlled at init */ RETURN_ERROR_IF( - bufferSize > ZSTD_DCtx_get_staticSize(zds) - sizeof(ZSTD_DCtx), + bufferSize > zds->staticSize - sizeof(ZSTD_DCtx), memory_allocation, ""); } else { - ZSTD_customFree(zds->inBuff, ZSTD_defaultCMem); + ZSTD_customFree(zds->inBuff, zds->customMem); zds->inBuffSize = 0; zds->outBuffSize = 0; - zds->inBuff = (char*)ZSTD_customMalloc(bufferSize, ZSTD_defaultCMem); + zds->inBuff = (char*)ZSTD_customMalloc(bufferSize, zds->customMem); RETURN_ERROR_IF(zds->inBuff == NULL, memory_allocation, ""); } zds->inBuffSize = neededInBuffSize; @@ -1146,6 +2275,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB } if ((size_t)(iend-ip) >= neededInSize) { /* decode directly from src */ FORWARD_IF_ERROR(ZSTD_decompressContinueStream(zds, &op, oend, ip, neededInSize), ""); + assert(ip != NULL); ip += neededInSize; /* Function modifies the stage so we must break */ break; @@ -1160,7 +2290,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB int const isSkipFrame = ZSTD_isSkipFrame(zds); size_t loadedSize; /* At this point we shouldn't be decompressing a block that we can stream. */ - assert(neededInSize == ZSTD_nextSrcSizeToDecompressWithInputSize(zds, iend - ip)); + assert(neededInSize == ZSTD_nextSrcSizeToDecompressWithInputSize(zds, (size_t)(iend - ip))); if (isSkipFrame) { loadedSize = MIN(toLoad, (size_t)(iend-ip)); } else { @@ -1169,8 +2299,11 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB "should never happen"); loadedSize = ZSTD_limitCopy(zds->inBuff + zds->inPos, toLoad, ip, (size_t)(iend-ip)); } - ip += loadedSize; - zds->inPos += loadedSize; + if (loadedSize != 0) { + /* ip may be NULL */ + ip += loadedSize; + zds->inPos += loadedSize; + } if (loadedSize < toLoad) { someMoreWork = 0; break; } /* not enough input, wait for more */ /* decode loaded input */ @@ -1180,14 +2313,17 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB break; } case zdss_flush: - { size_t const toFlushSize = zds->outEnd - zds->outStart; + { + size_t const toFlushSize = zds->outEnd - zds->outStart; size_t const flushedSize = ZSTD_limitCopy(op, (size_t)(oend-op), zds->outBuff + zds->outStart, toFlushSize); - op += flushedSize; + + op = op ? op + flushedSize : op; + zds->outStart += flushedSize; if (flushedSize == toFlushSize) { /* flush completed */ zds->streamStage = zdss_read; if ( (zds->outBuffSize < zds->fParams.frameContentSize) - && (zds->outStart + zds->fParams.blockSizeMax > zds->outBuffSize) ) { + && (zds->outStart + zds->fParams.blockSizeMax > zds->outBuffSize) ) { DEBUGLOG(5, "restart filling outBuff from beginning (left:%i, needed:%u)", (int)(zds->outBuffSize - zds->outStart), (U32)zds->fParams.blockSizeMax); @@ -1201,7 +2337,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB default: assert(0); /* impossible */ - RETURN_ERROR(GENERIC, "impossible to reach"); /* some compiler require default to do something */ + RETURN_ERROR(GENERIC, "impossible to reach"); /* some compilers require default to do something */ } } /* result */ @@ -1214,8 +2350,8 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB if ((ip==istart) && (op==ostart)) { /* no forward progress */ zds->noForwardProgress ++; if (zds->noForwardProgress >= ZSTD_NO_FORWARD_PROGRESS_MAX) { - RETURN_ERROR_IF(op==oend, dstSize_tooSmall, ""); - RETURN_ERROR_IF(ip==iend, srcSize_wrong, ""); + RETURN_ERROR_IF(op==oend, noForwardProgress_destFull, ""); + RETURN_ERROR_IF(ip==iend, noForwardProgress_inputEmpty, ""); assert(0); } } else { @@ -1246,3 +2382,23 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB return nextSrcSizeHint; } } + +size_t ZSTD_decompressStream_simpleArgs ( + ZSTD_DCtx* dctx, + void* dst, size_t dstCapacity, size_t* dstPos, + const void* src, size_t srcSize, size_t* srcPos) +{ + ZSTD_outBuffer output; + ZSTD_inBuffer input; + output.dst = dst; + output.size = dstCapacity; + output.pos = *dstPos; + input.src = src; + input.size = srcSize; + input.pos = *srcPos; + { size_t const cErr = ZSTD_decompressStream(dctx, &output, &input); + *dstPos = output.pos; + *srcPos = input.pos; + return cErr; + } +} diff --git a/src/bled/zstd_decompress_block.c b/src/bled/zstd_decompress_block.c index 0f44c1ed..1a35ed8e 100644 --- a/src/bled/zstd_decompress_block.c +++ b/src/bled/zstd_decompress_block.c @@ -1,5 +1,5 @@ /* - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the @@ -26,6 +26,7 @@ #include "zstd_decompress_internal.h" /* ZSTD_DCtx */ #include "zstd_ddict.h" /* ZSTD_DDictDictContent */ #include "zstd_decompress_block.h" +#include "zstd_bits.h" /* ZSTD_highbit32 */ /*_******************************************************* * Macros @@ -51,6 +52,13 @@ static void ZSTD_copy4(void* dst, const void* src) { ZSTD_memcpy(dst, src, 4); } * Block decoding ***************************************************************/ +static size_t ZSTD_blockSizeMax(ZSTD_DCtx const* dctx) +{ + size_t const blockSizeMax = dctx->isFrameDecompression ? dctx->fParams.blockSizeMax : ZSTD_BLOCKSIZE_MAX; + assert(blockSizeMax <= ZSTD_BLOCKSIZE_MAX); + return blockSizeMax; +} + /*! ZSTD_getcBlockSize() : * Provides the size of compressed block from block header `src` */ size_t ZSTD_getcBlockSize(const void* src, size_t srcSize, @@ -69,21 +77,71 @@ size_t ZSTD_getcBlockSize(const void* src, size_t srcSize, } } +/* Allocate buffer for literals, either overlapping current dst, or split between dst and litExtraBuffer, or stored entirely within litExtraBuffer */ +static void ZSTD_allocateLiteralsBuffer(ZSTD_DCtx* dctx, void* const dst, const size_t dstCapacity, const size_t litSize, + const streaming_operation streaming, const size_t expectedWriteSize, const unsigned splitImmediately) +{ + size_t const blockSizeMax = ZSTD_blockSizeMax(dctx); + assert(litSize <= blockSizeMax); + assert(dctx->isFrameDecompression || streaming == not_streaming); + assert(expectedWriteSize <= blockSizeMax); + if (streaming == not_streaming && dstCapacity > blockSizeMax + WILDCOPY_OVERLENGTH + litSize + WILDCOPY_OVERLENGTH) { + /* If we aren't streaming, we can just put the literals after the output + * of the current block. We don't need to worry about overwriting the + * extDict of our window, because it doesn't exist. + * So if we have space after the end of the block, just put it there. + */ + dctx->litBuffer = (BYTE*)dst + blockSizeMax + WILDCOPY_OVERLENGTH; + dctx->litBufferEnd = dctx->litBuffer + litSize; + dctx->litBufferLocation = ZSTD_in_dst; + } else if (litSize <= ZSTD_LITBUFFEREXTRASIZE) { + /* Literals fit entirely within the extra buffer, put them there to avoid + * having to split the literals. + */ + dctx->litBuffer = dctx->litExtraBuffer; + dctx->litBufferEnd = dctx->litBuffer + litSize; + dctx->litBufferLocation = ZSTD_not_in_dst; + } else { + assert(blockSizeMax > ZSTD_LITBUFFEREXTRASIZE); + /* Literals must be split between the output block and the extra lit + * buffer. We fill the extra lit buffer with the tail of the literals, + * and put the rest of the literals at the end of the block, with + * WILDCOPY_OVERLENGTH of buffer room to allow for overreads. + * This MUST not write more than our maxBlockSize beyond dst, because in + * streaming mode, that could overwrite part of our extDict window. + */ + if (splitImmediately) { + /* won't fit in litExtraBuffer, so it will be split between end of dst and extra buffer */ + dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH; + dctx->litBufferEnd = dctx->litBuffer + litSize - ZSTD_LITBUFFEREXTRASIZE; + } else { + /* initially this will be stored entirely in dst during huffman decoding, it will partially be shifted to litExtraBuffer after */ + dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize; + dctx->litBufferEnd = (BYTE*)dst + expectedWriteSize; + } + dctx->litBufferLocation = ZSTD_split; + assert(dctx->litBufferEnd <= (BYTE*)dst + expectedWriteSize); + } +} -/* Hidden declaration for fullbench */ -static size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, - const void* src, size_t srcSize); /*! ZSTD_decodeLiteralsBlock() : + * Where it is possible to do so without being stomped by the output during decompression, the literals block will be stored + * in the dstBuffer. If there is room to do so, it will be stored in full in the excess dst space after where the current + * block will be output. Otherwise it will be stored at the end of the current dst blockspace, with a small portion being + * stored in dctx->litExtraBuffer to help keep it "ahead" of the current output write. + * * @return : nb of bytes read from src (< srcSize ) * note : symbol not declared but exposed for fullbench */ -size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, - const void* src, size_t srcSize) /* note : srcSize < BLOCKSIZE */ +static size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, + const void* src, size_t srcSize, /* note : srcSize < BLOCKSIZE */ + void* dst, size_t dstCapacity, const streaming_operation streaming) { DEBUGLOG(5, "ZSTD_decodeLiteralsBlock"); RETURN_ERROR_IF(srcSize < MIN_CBLOCK_SIZE, corruption_detected, ""); { const BYTE* const istart = (const BYTE*) src; symbolEncodingType_e const litEncType = (symbolEncodingType_e)(istart[0] & 3); + size_t const blockSizeMax = ZSTD_blockSizeMax(dctx); switch(litEncType) { @@ -93,12 +151,16 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, ZSTD_FALLTHROUGH; case set_compressed: - RETURN_ERROR_IF(srcSize < 5, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for case 3"); + RETURN_ERROR_IF(srcSize < 5, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need up to 5 for case 3"); { size_t lhSize, litSize, litCSize; U32 singleStream=0; U32 const lhlCode = (istart[0] >> 2) & 3; U32 const lhc = MEM_readLE32(istart); size_t hufSuccess; + size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity); + int const flags = 0 + | (ZSTD_DCtx_get_bmi2(dctx) ? HUF_flags_bmi2 : 0) + | (dctx->disableHufAsm ? HUF_flags_disableAsm : 0); switch(lhlCode) { case 0: case 1: default: /* note : default is impossible, since lhlCode into [0..3] */ @@ -121,25 +183,31 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, litCSize = (lhc >> 22) + ((size_t)istart[4] << 10); break; } - RETURN_ERROR_IF(litSize > ZSTD_BLOCKSIZE_MAX, corruption_detected, ""); + RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled"); + RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, ""); + if (!singleStream) + RETURN_ERROR_IF(litSize < MIN_LITERALS_FOR_4_STREAMS, literals_headerWrong, + "Not enough literals (%zu) for the 4-streams mode (min %u)", + litSize, MIN_LITERALS_FOR_4_STREAMS); RETURN_ERROR_IF(litCSize + lhSize > srcSize, corruption_detected, ""); + RETURN_ERROR_IF(expectedWriteSize < litSize , dstSize_tooSmall, ""); + ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 0); -#if ZSTD_DECOMPRESS_DICTIONARY != 0 /* prefetch huffman table if cold */ if (dctx->ddictIsCold && (litSize > 768 /* heuristic */)) { PREFETCH_AREA(dctx->HUFptr, sizeof(dctx->entropy.hufTable)); } -#endif if (litEncType==set_repeat) { if (singleStream) { - hufSuccess = HUF_decompress1X_usingDTable_bmi2( + hufSuccess = HUF_decompress1X_usingDTable( dctx->litBuffer, litSize, istart+lhSize, litCSize, - dctx->HUFptr, ZSTD_DCtx_get_bmi2(dctx)); + dctx->HUFptr, flags); } else { - hufSuccess = HUF_decompress4X_usingDTable_bmi2( + assert(litSize >= MIN_LITERALS_FOR_4_STREAMS); + hufSuccess = HUF_decompress4X_usingDTable( dctx->litBuffer, litSize, istart+lhSize, litCSize, - dctx->HUFptr, ZSTD_DCtx_get_bmi2(dctx)); + dctx->HUFptr, flags); } } else { if (singleStream) { @@ -147,20 +215,29 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, hufSuccess = HUF_decompress1X_DCtx_wksp( dctx->entropy.hufTable, dctx->litBuffer, litSize, istart+lhSize, litCSize, dctx->workspace, - sizeof(dctx->workspace)); + sizeof(dctx->workspace), flags); #else - hufSuccess = HUF_decompress1X1_DCtx_wksp_bmi2( + hufSuccess = HUF_decompress1X1_DCtx_wksp( dctx->entropy.hufTable, dctx->litBuffer, litSize, istart+lhSize, litCSize, dctx->workspace, - sizeof(dctx->workspace), ZSTD_DCtx_get_bmi2(dctx)); + sizeof(dctx->workspace), flags); #endif } else { - hufSuccess = HUF_decompress4X_hufOnly_wksp_bmi2( + hufSuccess = HUF_decompress4X_hufOnly_wksp( dctx->entropy.hufTable, dctx->litBuffer, litSize, istart+lhSize, litCSize, dctx->workspace, - sizeof(dctx->workspace), ZSTD_DCtx_get_bmi2(dctx)); + sizeof(dctx->workspace), flags); } } + if (dctx->litBufferLocation == ZSTD_split) + { + assert(litSize > ZSTD_LITBUFFEREXTRASIZE); + ZSTD_memcpy(dctx->litExtraBuffer, dctx->litBufferEnd - ZSTD_LITBUFFEREXTRASIZE, ZSTD_LITBUFFEREXTRASIZE); + ZSTD_memmove(dctx->litBuffer + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH, dctx->litBuffer, litSize - ZSTD_LITBUFFEREXTRASIZE); + dctx->litBuffer += ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH; + dctx->litBufferEnd -= WILDCOPY_OVERLENGTH; + assert(dctx->litBufferEnd <= (BYTE*)dst + blockSizeMax); + } RETURN_ERROR_IF(HUF_isError(hufSuccess), corruption_detected, ""); @@ -168,13 +245,13 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, dctx->litSize = litSize; dctx->litEntropy = 1; if (litEncType==set_compressed) dctx->HUFptr = dctx->entropy.hufTable; - ZSTD_memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH); return litCSize + lhSize; } case set_basic: { size_t litSize, lhSize; U32 const lhlCode = ((istart[0]) >> 2) & 3; + size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity); switch(lhlCode) { case 0: case 2: default: /* note : default is impossible, since lhlCode into [0..3] */ @@ -187,27 +264,42 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, break; case 3: lhSize = 3; + RETURN_ERROR_IF(srcSize<3, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize = 3"); litSize = MEM_readLE24(istart) >> 4; break; } + RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled"); + RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, ""); + RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, ""); + ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1); if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) { /* risk reading beyond src buffer with wildcopy */ RETURN_ERROR_IF(litSize+lhSize > srcSize, corruption_detected, ""); - ZSTD_memcpy(dctx->litBuffer, istart+lhSize, litSize); + if (dctx->litBufferLocation == ZSTD_split) + { + ZSTD_memcpy(dctx->litBuffer, istart + lhSize, litSize - ZSTD_LITBUFFEREXTRASIZE); + ZSTD_memcpy(dctx->litExtraBuffer, istart + lhSize + litSize - ZSTD_LITBUFFEREXTRASIZE, ZSTD_LITBUFFEREXTRASIZE); + } + else + { + ZSTD_memcpy(dctx->litBuffer, istart + lhSize, litSize); + } dctx->litPtr = dctx->litBuffer; dctx->litSize = litSize; - ZSTD_memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH); return lhSize+litSize; } /* direct reference into compressed stream */ dctx->litPtr = istart+lhSize; dctx->litSize = litSize; + dctx->litBufferEnd = dctx->litPtr + litSize; + dctx->litBufferLocation = ZSTD_not_in_dst; return lhSize+litSize; } case set_rle: { U32 const lhlCode = ((istart[0]) >> 2) & 3; size_t litSize, lhSize; + size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity); switch(lhlCode) { case 0: case 2: default: /* note : default is impossible, since lhlCode into [0..3] */ @@ -216,16 +308,28 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, break; case 1: lhSize = 2; + RETURN_ERROR_IF(srcSize<3, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize+1 = 3"); litSize = MEM_readLE16(istart) >> 4; break; case 3: lhSize = 3; + RETURN_ERROR_IF(srcSize<4, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize+1 = 4"); litSize = MEM_readLE24(istart) >> 4; - RETURN_ERROR_IF(srcSize<4, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 3; here we need lhSize+1 = 4"); break; } - RETURN_ERROR_IF(litSize > ZSTD_BLOCKSIZE_MAX, corruption_detected, ""); - ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize + WILDCOPY_OVERLENGTH); + RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled"); + RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, ""); + RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, ""); + ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1); + if (dctx->litBufferLocation == ZSTD_split) + { + ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize - ZSTD_LITBUFFEREXTRASIZE); + ZSTD_memset(dctx->litExtraBuffer, istart[lhSize], ZSTD_LITBUFFEREXTRASIZE); + } + else + { + ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize); + } dctx->litPtr = dctx->litBuffer; dctx->litSize = litSize; return lhSize+1; @@ -236,6 +340,18 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, } } +/* Hidden declaration for fullbench */ +size_t ZSTD_decodeLiteralsBlock_wrapper(ZSTD_DCtx* dctx, + const void* src, size_t srcSize, + void* dst, size_t dstCapacity); +size_t ZSTD_decodeLiteralsBlock_wrapper(ZSTD_DCtx* dctx, + const void* src, size_t srcSize, + void* dst, size_t dstCapacity) +{ + dctx->isFrameDecompression = 0; + return ZSTD_decodeLiteralsBlock(dctx, src, srcSize, dst, dstCapacity, not_streaming); +} + /* Default FSE distribution tables. * These are pre-calculated FSE decoding tables using default distributions as defined in specification : * https://github.com/facebook/zstd/blob/release/doc/zstd_compression_format.md#default-distributions @@ -243,7 +359,7 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx, * - start from default distributions, present in /lib/common/zstd_internal.h * - generate tables normally, using ZSTD_buildFSETable() * - printout the content of tables - * - pretify output, report below, test with fuzzer to ensure it's correct */ + * - prettify output, report below, test with fuzzer to ensure it's correct */ /* Default FSE distribution table for Literal Lengths */ static const ZSTD_seqSymbol LL_defaultDTable[(1<<LL_DEFAULTNORMLOG)+1] = { @@ -345,7 +461,7 @@ static const ZSTD_seqSymbol ML_defaultDTable[(1<<ML_DEFAULTNORMLOG)+1] = { }; /* ML_defaultDTable */ -static void ZSTD_buildSeqTable_rle(ZSTD_seqSymbol* dt, U32 baseValue, U32 nbAddBits) +static void ZSTD_buildSeqTable_rle(ZSTD_seqSymbol* dt, U32 baseValue, U8 nbAddBits) { void* ptr = dt; ZSTD_seqSymbol_header* const DTableH = (ZSTD_seqSymbol_header*)ptr; @@ -357,7 +473,7 @@ static void ZSTD_buildSeqTable_rle(ZSTD_seqSymbol* dt, U32 baseValue, U32 nbAddB cell->nbBits = 0; cell->nextState = 0; assert(nbAddBits < 255); - cell->nbAdditionalBits = (BYTE)nbAddBits; + cell->nbAdditionalBits = nbAddBits; cell->baseValue = baseValue; } @@ -369,7 +485,7 @@ static void ZSTD_buildSeqTable_rle(ZSTD_seqSymbol* dt, U32 baseValue, U32 nbAddB FORCE_INLINE_TEMPLATE void ZSTD_buildFSETable_body(ZSTD_seqSymbol* dt, const short* normalizedCounter, unsigned maxSymbolValue, - const U32* baseValue, const U32* nbAdditionalBits, + const U32* baseValue, const U8* nbAdditionalBits, unsigned tableLog, void* wksp, size_t wkspSize) { ZSTD_seqSymbol* const tableDecode = dt+1; @@ -432,14 +548,15 @@ void ZSTD_buildFSETable_body(ZSTD_seqSymbol* dt, for (i = 8; i < n; i += 8) { MEM_write64(spread + pos + i, sv); } - pos += n; + assert(n>=0); + pos += (size_t)n; } } /* Now we spread those positions across the table. - * The benefit of doing it in two stages is that we avoid the the + * The benefit of doing it in two stages is that we avoid the * variable size inner loop, which caused lots of branch misses. * Now we can run through all the positions without any branch misses. - * We unroll the loop twice, since that is what emperically worked best. + * We unroll the loop twice, since that is what empirically worked best. */ { size_t position = 0; @@ -466,7 +583,7 @@ void ZSTD_buildFSETable_body(ZSTD_seqSymbol* dt, for (i=0; i<n; i++) { tableDecode[position].baseValue = s; position = (position + step) & tableMask; - while (position > highThreshold) position = (position + step) & tableMask; /* lowprob area */ + while (UNLIKELY(position > highThreshold)) position = (position + step) & tableMask; /* lowprob area */ } } assert(position == 0); /* position must reach all cells once, otherwise normalizedCounter is incorrect */ } @@ -477,10 +594,10 @@ void ZSTD_buildFSETable_body(ZSTD_seqSymbol* dt, for (u=0; u<tableSize; u++) { U32 const symbol = tableDecode[u].baseValue; U32 const nextState = symbolNext[symbol]++; - tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) ); + tableDecode[u].nbBits = (BYTE) (tableLog - ZSTD_highbit32(nextState) ); tableDecode[u].nextState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize); assert(nbAdditionalBits[symbol] < 255); - tableDecode[u].nbAdditionalBits = (BYTE)nbAdditionalBits[symbol]; + tableDecode[u].nbAdditionalBits = nbAdditionalBits[symbol]; tableDecode[u].baseValue = baseValue[symbol]; } } @@ -489,7 +606,7 @@ void ZSTD_buildFSETable_body(ZSTD_seqSymbol* dt, /* Avoids the FORCE_INLINE of the _body() function. */ static void ZSTD_buildFSETable_body_default(ZSTD_seqSymbol* dt, const short* normalizedCounter, unsigned maxSymbolValue, - const U32* baseValue, const U32* nbAdditionalBits, + const U32* baseValue, const U8* nbAdditionalBits, unsigned tableLog, void* wksp, size_t wkspSize) { ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue, @@ -497,9 +614,9 @@ static void ZSTD_buildFSETable_body_default(ZSTD_seqSymbol* dt, } #if DYNAMIC_BMI2 -TARGET_ATTRIBUTE("bmi2") static void ZSTD_buildFSETable_body_bmi2(ZSTD_seqSymbol* dt, +BMI2_TARGET_ATTRIBUTE static void ZSTD_buildFSETable_body_bmi2(ZSTD_seqSymbol* dt, const short* normalizedCounter, unsigned maxSymbolValue, - const U32* baseValue, const U32* nbAdditionalBits, + const U32* baseValue, const U8* nbAdditionalBits, unsigned tableLog, void* wksp, size_t wkspSize) { ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue, @@ -509,7 +626,7 @@ TARGET_ATTRIBUTE("bmi2") static void ZSTD_buildFSETable_body_bmi2(ZSTD_seqSymbol void ZSTD_buildFSETable(ZSTD_seqSymbol* dt, const short* normalizedCounter, unsigned maxSymbolValue, - const U32* baseValue, const U32* nbAdditionalBits, + const U32* baseValue, const U8* nbAdditionalBits, unsigned tableLog, void* wksp, size_t wkspSize, int bmi2) { #if DYNAMIC_BMI2 @@ -531,7 +648,7 @@ void ZSTD_buildFSETable(ZSTD_seqSymbol* dt, static size_t ZSTD_buildSeqTable(ZSTD_seqSymbol* DTableSpace, const ZSTD_seqSymbol** DTablePtr, symbolEncodingType_e type, unsigned max, U32 maxLog, const void* src, size_t srcSize, - const U32* baseValue, const U32* nbAdditionalBits, + const U32* baseValue, const U8* nbAdditionalBits, const ZSTD_seqSymbol* defaultTable, U32 flagRepeatTable, int ddictIsCold, int nbSeq, U32* wksp, size_t wkspSize, int bmi2) @@ -543,7 +660,7 @@ static size_t ZSTD_buildSeqTable(ZSTD_seqSymbol* DTableSpace, const ZSTD_seqSymb RETURN_ERROR_IF((*(const BYTE*)src) > max, corruption_detected, ""); { U32 const symbol = *(const BYTE*)src; U32 const baseline = baseValue[symbol]; - U32 const nbBits = nbAdditionalBits[symbol]; + U8 const nbBits = nbAdditionalBits[symbol]; ZSTD_buildSeqTable_rle(DTableSpace, baseline, nbBits); } *DTablePtr = DTableSpace; @@ -590,11 +707,6 @@ size_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr, /* SeqHead */ nbSeq = *ip++; - if (!nbSeq) { - *nbSeqPtr=0; - RETURN_ERROR_IF(srcSize != 1, srcSize_wrong, ""); - return 1; - } if (nbSeq > 0x7F) { if (nbSeq == 0xFF) { RETURN_ERROR_IF(ip+2 > iend, srcSize_wrong, ""); @@ -607,16 +719,20 @@ size_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr, } *nbSeqPtr = nbSeq; + if (nbSeq == 0) { + /* No sequence : section ends immediately */ + RETURN_ERROR_IF(ip != iend, corruption_detected, + "extraneous data present in the Sequences section"); + return (size_t)(ip - istart); + } + /* FSE table descriptors */ RETURN_ERROR_IF(ip+1 > iend, srcSize_wrong, ""); /* minimum possible size: 1 byte for symbol encoding types */ + RETURN_ERROR_IF(*ip & 3, corruption_detected, ""); /* The last field, Reserved, must be all-zeroes. */ { symbolEncodingType_e const LLtype = (symbolEncodingType_e)(*ip >> 6); symbolEncodingType_e const OFtype = (symbolEncodingType_e)((*ip >> 4) & 3); symbolEncodingType_e const MLtype = (symbolEncodingType_e)((*ip >> 2) & 3); - int ddictIsCold = 0; ip++; -#if ZSTD_DECOMPRESS_DICTIONARY != 0 - ddictIsCold = dctx->ddictIsCold; -#endif /* Build DTables */ { size_t const llhSize = ZSTD_buildSeqTable(dctx->entropy.LLTable, &dctx->LLTptr, @@ -624,7 +740,7 @@ size_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr, ip, iend-ip, LL_base, LL_bits, LL_defaultDTable, dctx->fseEntropy, - ddictIsCold, nbSeq, + dctx->ddictIsCold, nbSeq, dctx->workspace, sizeof(dctx->workspace), ZSTD_DCtx_get_bmi2(dctx)); RETURN_ERROR_IF(ZSTD_isError(llhSize), corruption_detected, "ZSTD_buildSeqTable failed"); @@ -636,7 +752,7 @@ size_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr, ip, iend-ip, OF_base, OF_bits, OF_defaultDTable, dctx->fseEntropy, - ddictIsCold, nbSeq, + dctx->ddictIsCold, nbSeq, dctx->workspace, sizeof(dctx->workspace), ZSTD_DCtx_get_bmi2(dctx)); RETURN_ERROR_IF(ZSTD_isError(ofhSize), corruption_detected, "ZSTD_buildSeqTable failed"); @@ -648,7 +764,7 @@ size_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr, ip, iend-ip, ML_base, ML_bits, ML_defaultDTable, dctx->fseEntropy, - ddictIsCold, nbSeq, + dctx->ddictIsCold, nbSeq, dctx->workspace, sizeof(dctx->workspace), ZSTD_DCtx_get_bmi2(dctx)); RETURN_ERROR_IF(ZSTD_isError(mlhSize), corruption_detected, "ZSTD_buildSeqTable failed"); @@ -719,7 +835,7 @@ HINT_INLINE void ZSTD_overlapCopy8(BYTE** op, BYTE const** ip, size_t offset) { * - ZSTD_overlap_src_before_dst: The src and dst may overlap and may be any distance apart. * The src buffer must be before the dst buffer. */ -static void ZSTD_safecopy(BYTE* op, BYTE* const oend_w, BYTE const* ip, ptrdiff_t length, ZSTD_overlap_e ovtype) { +static void ZSTD_safecopy(BYTE* op, const BYTE* const oend_w, BYTE const* ip, ptrdiff_t length, ZSTD_overlap_e ovtype) { ptrdiff_t const diff = op - ip; BYTE* const oend = op + length; @@ -735,6 +851,7 @@ static void ZSTD_safecopy(BYTE* op, BYTE* const oend_w, BYTE const* ip, ptrdiff_ /* Copy 8 bytes and ensure the offset >= 8 when there can be overlap. */ assert(length >= 8); ZSTD_overlapCopy8(&op, &ip, diff); + length -= 8; assert(op - ip >= 8); assert(op <= oend); } @@ -749,12 +866,35 @@ static void ZSTD_safecopy(BYTE* op, BYTE* const oend_w, BYTE const* ip, ptrdiff_ assert(oend > oend_w); ZSTD_wildcopy(op, ip, oend_w - op, ovtype); ip += oend_w - op; - op = oend_w; + op += oend_w - op; } /* Handle the leftovers. */ while (op < oend) *op++ = *ip++; } +/* ZSTD_safecopyDstBeforeSrc(): + * This version allows overlap with dst before src, or handles the non-overlap case with dst after src + * Kept separate from more common ZSTD_safecopy case to avoid performance impact to the safecopy common case */ +static void ZSTD_safecopyDstBeforeSrc(BYTE* op, const BYTE* ip, ptrdiff_t length) { + ptrdiff_t const diff = op - ip; + BYTE* const oend = op + length; + + if (length < 8 || diff > -8) { + /* Handle short lengths, close overlaps, and dst not before src. */ + while (op < oend) *op++ = *ip++; + return; + } + + if (op <= oend - WILDCOPY_OVERLENGTH && diff < -WILDCOPY_VECLEN) { + ZSTD_wildcopy(op, ip, oend - WILDCOPY_OVERLENGTH - op, ZSTD_no_overlap); + ip += oend - WILDCOPY_OVERLENGTH - op; + op += oend - WILDCOPY_OVERLENGTH - op; + } + + /* Handle the leftovers. */ + while (op < oend) *op++ = *ip++; +} + /* ZSTD_execSequenceEnd(): * This version handles cases that are near the end of the output buffer. It requires * more careful checks to make sure there is no overflow. By separating out these hard @@ -764,10 +904,11 @@ static void ZSTD_safecopy(BYTE* op, BYTE* const oend_w, BYTE const* ip, ptrdiff_ * to be optimized for many small sequences, since those fall into ZSTD_execSequence(). */ FORCE_NOINLINE +ZSTD_ALLOW_POINTER_OVERFLOW_ATTR size_t ZSTD_execSequenceEnd(BYTE* op, - BYTE* const oend, seq_t sequence, - const BYTE** litPtr, const BYTE* const litLimit, - const BYTE* const prefixStart, const BYTE* const virtualStart, const BYTE* const dictEnd) + BYTE* const oend, seq_t sequence, + const BYTE** litPtr, const BYTE* const litLimit, + const BYTE* const prefixStart, const BYTE* const virtualStart, const BYTE* const dictEnd) { BYTE* const oLitEnd = op + sequence.litLength; size_t const sequenceLength = sequence.litLength + sequence.matchLength; @@ -790,27 +931,78 @@ size_t ZSTD_execSequenceEnd(BYTE* op, if (sequence.offset > (size_t)(oLitEnd - prefixStart)) { /* offset beyond prefix */ RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, ""); - match = dictEnd - (prefixStart-match); + match = dictEnd - (prefixStart - match); if (match + sequence.matchLength <= dictEnd) { ZSTD_memmove(oLitEnd, match, sequence.matchLength); return sequenceLength; } /* span extDict & currentPrefixSegment */ { size_t const length1 = dictEnd - match; - ZSTD_memmove(oLitEnd, match, length1); - op = oLitEnd + length1; - sequence.matchLength -= length1; - match = prefixStart; - } } + ZSTD_memmove(oLitEnd, match, length1); + op = oLitEnd + length1; + sequence.matchLength -= length1; + match = prefixStart; + } + } + ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst); + return sequenceLength; +} + +/* ZSTD_execSequenceEndSplitLitBuffer(): + * This version is intended to be used during instances where the litBuffer is still split. It is kept separate to avoid performance impact for the good case. + */ +FORCE_NOINLINE +ZSTD_ALLOW_POINTER_OVERFLOW_ATTR +size_t ZSTD_execSequenceEndSplitLitBuffer(BYTE* op, + BYTE* const oend, const BYTE* const oend_w, seq_t sequence, + const BYTE** litPtr, const BYTE* const litLimit, + const BYTE* const prefixStart, const BYTE* const virtualStart, const BYTE* const dictEnd) +{ + BYTE* const oLitEnd = op + sequence.litLength; + size_t const sequenceLength = sequence.litLength + sequence.matchLength; + const BYTE* const iLitEnd = *litPtr + sequence.litLength; + const BYTE* match = oLitEnd - sequence.offset; + + + /* bounds checks : careful of address space overflow in 32-bit mode */ + RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, "last match must fit within dstBuffer"); + RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, "try to read beyond literal buffer"); + assert(op < op + sequenceLength); + assert(oLitEnd < op + sequenceLength); + + /* copy literals */ + RETURN_ERROR_IF(op > *litPtr && op < *litPtr + sequence.litLength, dstSize_tooSmall, "output should not catch up to and overwrite literal buffer"); + ZSTD_safecopyDstBeforeSrc(op, *litPtr, sequence.litLength); + op = oLitEnd; + *litPtr = iLitEnd; + + /* copy Match */ + if (sequence.offset > (size_t)(oLitEnd - prefixStart)) { + /* offset beyond prefix */ + RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, ""); + match = dictEnd - (prefixStart - match); + if (match + sequence.matchLength <= dictEnd) { + ZSTD_memmove(oLitEnd, match, sequence.matchLength); + return sequenceLength; + } + /* span extDict & currentPrefixSegment */ + { size_t const length1 = dictEnd - match; + ZSTD_memmove(oLitEnd, match, length1); + op = oLitEnd + length1; + sequence.matchLength -= length1; + match = prefixStart; + } + } ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst); return sequenceLength; } HINT_INLINE +ZSTD_ALLOW_POINTER_OVERFLOW_ATTR size_t ZSTD_execSequence(BYTE* op, - BYTE* const oend, seq_t sequence, - const BYTE** litPtr, const BYTE* const litLimit, - const BYTE* const prefixStart, const BYTE* const virtualStart, const BYTE* const dictEnd) + BYTE* const oend, seq_t sequence, + const BYTE** litPtr, const BYTE* const litLimit, + const BYTE* const prefixStart, const BYTE* const virtualStart, const BYTE* const dictEnd) { BYTE* const oLitEnd = op + sequence.litLength; size_t const sequenceLength = sequence.litLength + sequence.matchLength; @@ -821,6 +1013,104 @@ size_t ZSTD_execSequence(BYTE* op, assert(op != NULL /* Precondition */); assert(oend_w < oend /* No underflow */); + +#if defined(__aarch64__) + /* prefetch sequence starting from match that will be used for copy later */ + PREFETCH_L1(match); +#endif + /* Handle edge cases in a slow path: + * - Read beyond end of literals + * - Match end is within WILDCOPY_OVERLIMIT of oend + * - 32-bit mode and the match length overflows + */ + if (UNLIKELY( + iLitEnd > litLimit || + oMatchEnd > oend_w || + (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH))) + return ZSTD_execSequenceEnd(op, oend, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd); + + /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */ + assert(op <= oLitEnd /* No overflow */); + assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */); + assert(oMatchEnd <= oend /* No underflow */); + assert(iLitEnd <= litLimit /* Literal length is in bounds */); + assert(oLitEnd <= oend_w /* Can wildcopy literals */); + assert(oMatchEnd <= oend_w /* Can wildcopy matches */); + + /* Copy Literals: + * Split out litLength <= 16 since it is nearly always true. +1.6% on gcc-9. + * We likely don't need the full 32-byte wildcopy. + */ + assert(WILDCOPY_OVERLENGTH >= 16); + ZSTD_copy16(op, (*litPtr)); + if (UNLIKELY(sequence.litLength > 16)) { + ZSTD_wildcopy(op + 16, (*litPtr) + 16, sequence.litLength - 16, ZSTD_no_overlap); + } + op = oLitEnd; + *litPtr = iLitEnd; /* update for next sequence */ + + /* Copy Match */ + if (sequence.offset > (size_t)(oLitEnd - prefixStart)) { + /* offset beyond prefix -> go into extDict */ + RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected, ""); + match = dictEnd + (match - prefixStart); + if (match + sequence.matchLength <= dictEnd) { + ZSTD_memmove(oLitEnd, match, sequence.matchLength); + return sequenceLength; + } + /* span extDict & currentPrefixSegment */ + { size_t const length1 = dictEnd - match; + ZSTD_memmove(oLitEnd, match, length1); + op = oLitEnd + length1; + sequence.matchLength -= length1; + match = prefixStart; + } + } + /* Match within prefix of 1 or more bytes */ + assert(op <= oMatchEnd); + assert(oMatchEnd <= oend_w); + assert(match >= prefixStart); + assert(sequence.matchLength >= 1); + + /* Nearly all offsets are >= WILDCOPY_VECLEN bytes, which means we can use wildcopy + * without overlap checking. + */ + if (LIKELY(sequence.offset >= WILDCOPY_VECLEN)) { + /* We bet on a full wildcopy for matches, since we expect matches to be + * longer than literals (in general). In silesia, ~10% of matches are longer + * than 16 bytes. + */ + ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength, ZSTD_no_overlap); + return sequenceLength; + } + assert(sequence.offset < WILDCOPY_VECLEN); + + /* Copy 8 bytes and spread the offset to be >= 8. */ + ZSTD_overlapCopy8(&op, &match, sequence.offset); + + /* If the match length is > 8 bytes, then continue with the wildcopy. */ + if (sequence.matchLength > 8) { + assert(op < oMatchEnd); + ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength - 8, ZSTD_overlap_src_before_dst); + } + return sequenceLength; +} + +HINT_INLINE +ZSTD_ALLOW_POINTER_OVERFLOW_ATTR +size_t ZSTD_execSequenceSplitLitBuffer(BYTE* op, + BYTE* const oend, const BYTE* const oend_w, seq_t sequence, + const BYTE** litPtr, const BYTE* const litLimit, + const BYTE* const prefixStart, const BYTE* const virtualStart, const BYTE* const dictEnd) +{ + BYTE* const oLitEnd = op + sequence.litLength; + size_t const sequenceLength = sequence.litLength + sequence.matchLength; + BYTE* const oMatchEnd = op + sequenceLength; /* risk : address space overflow (32-bits) */ + const BYTE* const iLitEnd = *litPtr + sequence.litLength; + const BYTE* match = oLitEnd - sequence.offset; + + assert(op != NULL /* Precondition */); + assert(oend_w < oend /* No underflow */); /* Handle edge cases in a slow path: * - Read beyond end of literals * - Match end is within WILDCOPY_OVERLIMIT of oend @@ -830,7 +1120,7 @@ size_t ZSTD_execSequence(BYTE* op, iLitEnd > litLimit || oMatchEnd > oend_w || (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH))) - return ZSTD_execSequenceEnd(op, oend, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd); + return ZSTD_execSequenceEndSplitLitBuffer(op, oend, oend_w, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd); /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */ assert(op <= oLitEnd /* No overflow */); @@ -898,6 +1188,7 @@ size_t ZSTD_execSequence(BYTE* op, return sequenceLength; } + static void ZSTD_initFseState(ZSTD_fseState* DStatePtr, BIT_DStream_t* bitD, const ZSTD_seqSymbol* dt) { @@ -918,7 +1209,7 @@ ZSTD_updateFseStateWithDInfo(ZSTD_fseState* DStatePtr, BIT_DStream_t* bitD, U16 } /* We need to add at most (ZSTD_WINDOWLOG_MAX_32 - 1) bits to read the maximum - * offset bits. But we can only read at most (STREAM_ACCUMULATOR_MIN_32 - 1) + * offset bits. But we can only read at most STREAM_ACCUMULATOR_MIN_32 * bits before reloading. This value is the maximum number of bytes we read * after reloading when we are decoding long offsets. */ @@ -929,13 +1220,37 @@ ZSTD_updateFseStateWithDInfo(ZSTD_fseState* DStatePtr, BIT_DStream_t* bitD, U16 typedef enum { ZSTD_lo_isRegularOffset, ZSTD_lo_isLongOffset=1 } ZSTD_longOffset_e; +/** + * ZSTD_decodeSequence(): + * @p longOffsets : tells the decoder to reload more bit while decoding large offsets + * only used in 32-bit mode + * @return : Sequence (litL + matchL + offset) + */ FORCE_INLINE_TEMPLATE seq_t -ZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets) +ZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets, const int isLastSeq) { seq_t seq; + /* + * ZSTD_seqSymbol is a 64 bits wide structure. + * It can be loaded in one operation + * and its fields extracted by simply shifting or bit-extracting on aarch64. + * GCC doesn't recognize this and generates more unnecessary ldr/ldrb/ldrh + * operations that cause performance drop. This can be avoided by using this + * ZSTD_memcpy hack. + */ +#if defined(__aarch64__) && (defined(__GNUC__) && !defined(__clang__)) + ZSTD_seqSymbol llDInfoS, mlDInfoS, ofDInfoS; + ZSTD_seqSymbol* const llDInfo = &llDInfoS; + ZSTD_seqSymbol* const mlDInfo = &mlDInfoS; + ZSTD_seqSymbol* const ofDInfo = &ofDInfoS; + ZSTD_memcpy(llDInfo, seqState->stateLL.table + seqState->stateLL.state, sizeof(ZSTD_seqSymbol)); + ZSTD_memcpy(mlDInfo, seqState->stateML.table + seqState->stateML.state, sizeof(ZSTD_seqSymbol)); + ZSTD_memcpy(ofDInfo, seqState->stateOffb.table + seqState->stateOffb.state, sizeof(ZSTD_seqSymbol)); +#else const ZSTD_seqSymbol* const llDInfo = seqState->stateLL.table + seqState->stateLL.state; const ZSTD_seqSymbol* const mlDInfo = seqState->stateML.table + seqState->stateML.state; const ZSTD_seqSymbol* const ofDInfo = seqState->stateOffb.table + seqState->stateOffb.state; +#endif seq.matchLength = mlDInfo->baseValue; seq.litLength = llDInfo->baseValue; { U32 const ofBase = ofDInfo->baseValue; @@ -950,28 +1265,31 @@ ZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets) U32 const llnbBits = llDInfo->nbBits; U32 const mlnbBits = mlDInfo->nbBits; U32 const ofnbBits = ofDInfo->nbBits; + + assert(llBits <= MaxLLBits); + assert(mlBits <= MaxMLBits); + assert(ofBits <= MaxOff); /* * As gcc has better branch and block analyzers, sometimes it is only - * valuable to mark likelyness for clang, it gives around 3-4% of + * valuable to mark likeliness for clang, it gives around 3-4% of * performance. */ /* sequence */ { size_t offset; - #if defined(__clang__) - if (LIKELY(ofBits > 1)) { - #else if (ofBits > 1) { - #endif ZSTD_STATIC_ASSERT(ZSTD_lo_isLongOffset == 1); ZSTD_STATIC_ASSERT(LONG_OFFSETS_MAX_EXTRA_BITS_32 == 5); - assert(ofBits <= MaxOff); + ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 > LONG_OFFSETS_MAX_EXTRA_BITS_32); + ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 - LONG_OFFSETS_MAX_EXTRA_BITS_32 >= MaxMLBits); if (MEM_32bits() && longOffsets && (ofBits >= STREAM_ACCUMULATOR_MIN_32)) { - U32 const extraBits = ofBits - MIN(ofBits, 32 - seqState->DStream.bitsConsumed); + /* Always read extra bits, this keeps the logic simple, + * avoids branches, and avoids accidentally reading 0 bits. + */ + U32 const extraBits = LONG_OFFSETS_MAX_EXTRA_BITS_32; offset = ofBase + (BIT_readBitsFast(&seqState->DStream, ofBits - extraBits) << extraBits); BIT_reloadDStream(&seqState->DStream); - if (extraBits) offset += BIT_readBitsFast(&seqState->DStream, extraBits); - assert(extraBits <= LONG_OFFSETS_MAX_EXTRA_BITS_32); /* to avoid another reload */ + offset += BIT_readBitsFast(&seqState->DStream, extraBits); } else { offset = ofBase + BIT_readBitsFast(&seqState->DStream, ofBits/*>0*/); /* <= (ZSTD_WINDOWLOG_MAX-1) bits */ if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream); @@ -988,7 +1306,7 @@ ZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets) } else { offset = ofBase + ll0 + BIT_readBitsFast(&seqState->DStream, 1); { size_t temp = (offset==3) ? seqState->prevOffset[0] - 1 : seqState->prevOffset[offset]; - temp += !temp; /* 0 is not valid; input is corrupted; force offset to 1 */ + temp -= !temp; /* 0 is not valid: input corrupted => force offset to -1 => corruption detected at execSequence */ if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1]; seqState->prevOffset[1] = seqState->prevOffset[0]; seqState->prevOffset[0] = offset = temp; @@ -996,11 +1314,7 @@ ZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets) seq.offset = offset; } - #if defined(__clang__) - if (UNLIKELY(mlBits > 0)) - #else if (mlBits > 0) - #endif seq.matchLength += BIT_readBitsFast(&seqState->DStream, mlBits/*>0*/); if (MEM_32bits() && (mlBits+llBits >= STREAM_ACCUMULATOR_MIN_32-LONG_OFFSETS_MAX_EXTRA_BITS_32)) @@ -1010,11 +1324,7 @@ ZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets) /* Ensure there are enough bits to read the rest of data in 64-bit mode. */ ZSTD_STATIC_ASSERT(16+LLFSELog+MLFSELog+OffFSELog < STREAM_ACCUMULATOR_MIN_64); - #if defined(__clang__) - if (UNLIKELY(llBits > 0)) - #else if (llBits > 0) - #endif seq.litLength += BIT_readBitsFast(&seqState->DStream, llBits/*>0*/); if (MEM_32bits()) @@ -1023,39 +1333,92 @@ ZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets) DEBUGLOG(6, "seq: litL=%u, matchL=%u, offset=%u", (U32)seq.litLength, (U32)seq.matchLength, (U32)seq.offset); - ZSTD_updateFseStateWithDInfo(&seqState->stateLL, &seqState->DStream, llNext, llnbBits); /* <= 9 bits */ - ZSTD_updateFseStateWithDInfo(&seqState->stateML, &seqState->DStream, mlNext, mlnbBits); /* <= 9 bits */ - if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream); /* <= 18 bits */ - ZSTD_updateFseStateWithDInfo(&seqState->stateOffb, &seqState->DStream, ofNext, ofnbBits); /* <= 8 bits */ + if (!isLastSeq) { + /* don't update FSE state for last Sequence */ + ZSTD_updateFseStateWithDInfo(&seqState->stateLL, &seqState->DStream, llNext, llnbBits); /* <= 9 bits */ + ZSTD_updateFseStateWithDInfo(&seqState->stateML, &seqState->DStream, mlNext, mlnbBits); /* <= 9 bits */ + if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream); /* <= 18 bits */ + ZSTD_updateFseStateWithDInfo(&seqState->stateOffb, &seqState->DStream, ofNext, ofnbBits); /* <= 8 bits */ + BIT_reloadDStream(&seqState->DStream); + } } return seq; } +#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE) +#if DEBUGLEVEL >= 1 +static int ZSTD_dictionaryIsActive(ZSTD_DCtx const* dctx, BYTE const* prefixStart, BYTE const* oLitEnd) +{ + size_t const windowSize = dctx->fParams.windowSize; + /* No dictionary used. */ + if (dctx->dictContentEndForFuzzing == NULL) return 0; + /* Dictionary is our prefix. */ + if (prefixStart == dctx->dictContentBeginForFuzzing) return 1; + /* Dictionary is not our ext-dict. */ + if (dctx->dictEnd != dctx->dictContentEndForFuzzing) return 0; + /* Dictionary is not within our window size. */ + if ((size_t)(oLitEnd - prefixStart) >= windowSize) return 0; + /* Dictionary is active. */ + return 1; +} +#endif + +static void ZSTD_assertValidSequence( + ZSTD_DCtx const* dctx, + BYTE const* op, BYTE const* oend, + seq_t const seq, + BYTE const* prefixStart, BYTE const* virtualStart) +{ +#if DEBUGLEVEL >= 1 + if (dctx->isFrameDecompression) { + size_t const windowSize = dctx->fParams.windowSize; + size_t const sequenceSize = seq.litLength + seq.matchLength; + BYTE const* const oLitEnd = op + seq.litLength; + DEBUGLOG(6, "Checking sequence: litL=%u matchL=%u offset=%u", + (U32)seq.litLength, (U32)seq.matchLength, (U32)seq.offset); + assert(op <= oend); + assert((size_t)(oend - op) >= sequenceSize); + assert(sequenceSize <= ZSTD_blockSizeMax(dctx)); + if (ZSTD_dictionaryIsActive(dctx, prefixStart, oLitEnd)) { + size_t const dictSize = (size_t)((char const*)dctx->dictContentEndForFuzzing - (char const*)dctx->dictContentBeginForFuzzing); + /* Offset must be within the dictionary. */ + assert(seq.offset <= (size_t)(oLitEnd - virtualStart)); + assert(seq.offset <= windowSize + dictSize); + } else { + /* Offset must be within our window. */ + assert(seq.offset <= windowSize); + } + } +#else + (void)dctx, (void)op, (void)oend, (void)seq, (void)prefixStart, (void)virtualStart; +#endif +} +#endif #ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG + + FORCE_INLINE_TEMPLATE size_t DONT_VECTORIZE -ZSTD_decompressSequences_body( ZSTD_DCtx* dctx, +ZSTD_decompressSequences_bodySplitLitBuffer( ZSTD_DCtx* dctx, void* dst, size_t maxDstSize, const void* seqStart, size_t seqSize, int nbSeq, - const ZSTD_longOffset_e isLongOffset, - const int frame) + const ZSTD_longOffset_e isLongOffset) { const BYTE* ip = (const BYTE*)seqStart; const BYTE* const iend = ip + seqSize; BYTE* const ostart = (BYTE*)dst; - BYTE* const oend = ostart + maxDstSize; + BYTE* const oend = ZSTD_maybeNullPtrAdd(ostart, maxDstSize); BYTE* op = ostart; const BYTE* litPtr = dctx->litPtr; - const BYTE* const litEnd = litPtr + dctx->litSize; + const BYTE* litBufferEnd = dctx->litBufferEnd; const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart); const BYTE* const vBase = (const BYTE*) (dctx->virtualStart); const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd); - DEBUGLOG(5, "ZSTD_decompressSequences_body"); - (void)frame; + DEBUGLOG(5, "ZSTD_decompressSequences_bodySplitLitBuffer (%i seqs)", nbSeq); - /* Regen sequences */ + /* Literals are split between internal buffer & output buffer */ if (nbSeq) { seqState_t seqState; dctx->fseEntropy = 1; @@ -1073,108 +1436,291 @@ ZSTD_decompressSequences_body( ZSTD_DCtx* dctx, BIT_DStream_endOfBuffer < BIT_DStream_completed && BIT_DStream_completed < BIT_DStream_overflow); + /* decompress without overrunning litPtr begins */ + { seq_t sequence = {0,0,0}; /* some static analyzer believe that @sequence is not initialized (it necessarily is, since for(;;) loop as at least one iteration) */ + /* Align the decompression loop to 32 + 16 bytes. + * + * zstd compiled with gcc-9 on an Intel i9-9900k shows 10% decompression + * speed swings based on the alignment of the decompression loop. This + * performance swing is caused by parts of the decompression loop falling + * out of the DSB. The entire decompression loop should fit in the DSB, + * when it can't we get much worse performance. You can measure if you've + * hit the good case or the bad case with this perf command for some + * compressed file test.zst: + * + * perf stat -e cycles -e instructions -e idq.all_dsb_cycles_any_uops \ + * -e idq.all_mite_cycles_any_uops -- ./zstd -tq test.zst + * + * If you see most cycles served out of the MITE you've hit the bad case. + * If you see most cycles served out of the DSB you've hit the good case. + * If it is pretty even then you may be in an okay case. + * + * This issue has been reproduced on the following CPUs: + * - Kabylake: Macbook Pro (15-inch, 2019) 2.4 GHz Intel Core i9 + * Use Instruments->Counters to get DSB/MITE cycles. + * I never got performance swings, but I was able to + * go from the good case of mostly DSB to half of the + * cycles served from MITE. + * - Coffeelake: Intel i9-9900k + * - Coffeelake: Intel i7-9700k + * + * I haven't been able to reproduce the instability or DSB misses on any + * of the following CPUS: + * - Haswell + * - Broadwell: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GH + * - Skylake + * + * Alignment is done for each of the three major decompression loops: + * - ZSTD_decompressSequences_bodySplitLitBuffer - presplit section of the literal buffer + * - ZSTD_decompressSequences_bodySplitLitBuffer - postsplit section of the literal buffer + * - ZSTD_decompressSequences_body + * Alignment choices are made to minimize large swings on bad cases and influence on performance + * from changes external to this code, rather than to overoptimize on the current commit. + * + * If you are seeing performance stability this script can help test. + * It tests on 4 commits in zstd where I saw performance change. + * + * https://gist.github.com/terrelln/9889fc06a423fd5ca6e99351564473f4 + */ #if defined(__GNUC__) && defined(__x86_64__) - /* Align the decompression loop to 32 + 16 bytes. - * - * zstd compiled with gcc-9 on an Intel i9-9900k shows 10% decompression - * speed swings based on the alignment of the decompression loop. This - * performance swing is caused by parts of the decompression loop falling - * out of the DSB. The entire decompression loop should fit in the DSB, - * when it can't we get much worse performance. You can measure if you've - * hit the good case or the bad case with this perf command for some - * compressed file test.zst: - * - * perf stat -e cycles -e instructions -e idq.all_dsb_cycles_any_uops \ - * -e idq.all_mite_cycles_any_uops -- ./zstd -tq test.zst - * - * If you see most cycles served out of the MITE you've hit the bad case. - * If you see most cycles served out of the DSB you've hit the good case. - * If it is pretty even then you may be in an okay case. - * - * This issue has been reproduced on the following CPUs: - * - Kabylake: Macbook Pro (15-inch, 2019) 2.4 GHz Intel Core i9 - * Use Instruments->Counters to get DSB/MITE cycles. - * I never got performance swings, but I was able to - * go from the good case of mostly DSB to half of the - * cycles served from MITE. - * - Coffeelake: Intel i9-9900k - * - Coffeelake: Intel i7-9700k - * - * I haven't been able to reproduce the instability or DSB misses on any - * of the following CPUS: - * - Haswell - * - Broadwell: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GH - * - Skylake - * - * If you are seeing performance stability this script can help test. - * It tests on 4 commits in zstd where I saw performance change. - * - * https://gist.github.com/terrelln/9889fc06a423fd5ca6e99351564473f4 - */ - __asm__(".p2align 6"); - __asm__("nop"); - __asm__(".p2align 5"); - __asm__("nop"); -# if __GNUC__ >= 9 && __GNUC__ < 11 - /* better for gcc-9 and gcc-10, worse for clang and gcc-8, gcc-11 */ - __asm__(".p2align 3"); -# else - __asm__(".p2align 4"); + __asm__(".p2align 6"); +# if __GNUC__ >= 7 + /* good for gcc-7, gcc-9, and gcc-11 */ + __asm__("nop"); + __asm__(".p2align 5"); + __asm__("nop"); + __asm__(".p2align 4"); +# if __GNUC__ == 8 || __GNUC__ == 10 + /* good for gcc-8 and gcc-10 */ + __asm__("nop"); + __asm__(".p2align 3"); +# endif # endif #endif - for ( ; ; ) { - seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset); - size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litEnd, prefixStart, vBase, dictEnd); - if (UNLIKELY(ZSTD_isError(oneSeqSize))) - return oneSeqSize; - DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize); - op += oneSeqSize; - if (UNLIKELY(!--nbSeq)) - break; - BIT_reloadDStream(&(seqState.DStream)); + + /* Handle the initial state where litBuffer is currently split between dst and litExtraBuffer */ + for ( ; nbSeq; nbSeq--) { + sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1); + if (litPtr + sequence.litLength > dctx->litBufferEnd) break; + { size_t const oneSeqSize = ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence.litLength - WILDCOPY_OVERLENGTH, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd); +#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE) + assert(!ZSTD_isError(oneSeqSize)); + ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase); +#endif + if (UNLIKELY(ZSTD_isError(oneSeqSize))) + return oneSeqSize; + DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize); + op += oneSeqSize; + } } + DEBUGLOG(6, "reached: (litPtr + sequence.litLength > dctx->litBufferEnd)"); + + /* If there are more sequences, they will need to read literals from litExtraBuffer; copy over the remainder from dst and update litPtr and litEnd */ + if (nbSeq > 0) { + const size_t leftoverLit = dctx->litBufferEnd - litPtr; + DEBUGLOG(6, "There are %i sequences left, and %zu/%zu literals left in buffer", nbSeq, leftoverLit, sequence.litLength); + if (leftoverLit) { + RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer"); + ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit); + sequence.litLength -= leftoverLit; + op += leftoverLit; + } + litPtr = dctx->litExtraBuffer; + litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE; + dctx->litBufferLocation = ZSTD_not_in_dst; + { size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd); +#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE) + assert(!ZSTD_isError(oneSeqSize)); + ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase); +#endif + if (UNLIKELY(ZSTD_isError(oneSeqSize))) + return oneSeqSize; + DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize); + op += oneSeqSize; + } + nbSeq--; + } + } + + if (nbSeq > 0) { + /* there is remaining lit from extra buffer */ + +#if defined(__GNUC__) && defined(__x86_64__) + __asm__(".p2align 6"); + __asm__("nop"); +# if __GNUC__ != 7 + /* worse for gcc-7 better for gcc-8, gcc-9, and gcc-10 and clang */ + __asm__(".p2align 4"); + __asm__("nop"); + __asm__(".p2align 3"); +# elif __GNUC__ >= 11 + __asm__(".p2align 3"); +# else + __asm__(".p2align 5"); + __asm__("nop"); + __asm__(".p2align 3"); +# endif +#endif + + for ( ; nbSeq ; nbSeq--) { + seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1); + size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd); +#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE) + assert(!ZSTD_isError(oneSeqSize)); + ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase); +#endif + if (UNLIKELY(ZSTD_isError(oneSeqSize))) + return oneSeqSize; + DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize); + op += oneSeqSize; + } } /* check if reached exact end */ - DEBUGLOG(5, "ZSTD_decompressSequences_body: after decode loop, remaining nbSeq : %i", nbSeq); + DEBUGLOG(5, "ZSTD_decompressSequences_bodySplitLitBuffer: after decode loop, remaining nbSeq : %i", nbSeq); RETURN_ERROR_IF(nbSeq, corruption_detected, ""); - RETURN_ERROR_IF(BIT_reloadDStream(&seqState.DStream) < BIT_DStream_completed, corruption_detected, ""); + DEBUGLOG(5, "bitStream : start=%p, ptr=%p, bitsConsumed=%u", seqState.DStream.start, seqState.DStream.ptr, seqState.DStream.bitsConsumed); + RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, ""); /* save reps for next block */ { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); } } /* last literal segment */ - { size_t const lastLLSize = litEnd - litPtr; + if (dctx->litBufferLocation == ZSTD_split) { + /* split hasn't been reached yet, first get dst then copy litExtraBuffer */ + size_t const lastLLSize = (size_t)(litBufferEnd - litPtr); + DEBUGLOG(6, "copy last literals from segment : %u", (U32)lastLLSize); + RETURN_ERROR_IF(lastLLSize > (size_t)(oend - op), dstSize_tooSmall, ""); + if (op != NULL) { + ZSTD_memmove(op, litPtr, lastLLSize); + op += lastLLSize; + } + litPtr = dctx->litExtraBuffer; + litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE; + dctx->litBufferLocation = ZSTD_not_in_dst; + } + /* copy last literals from internal buffer */ + { size_t const lastLLSize = (size_t)(litBufferEnd - litPtr); + DEBUGLOG(6, "copy last literals from internal buffer : %u", (U32)lastLLSize); RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, ""); if (op != NULL) { ZSTD_memcpy(op, litPtr, lastLLSize); op += lastLLSize; + } } + + DEBUGLOG(6, "decoded block of size %u bytes", (U32)(op - ostart)); + return (size_t)(op - ostart); +} + +FORCE_INLINE_TEMPLATE size_t +DONT_VECTORIZE +ZSTD_decompressSequences_body(ZSTD_DCtx* dctx, + void* dst, size_t maxDstSize, + const void* seqStart, size_t seqSize, int nbSeq, + const ZSTD_longOffset_e isLongOffset) +{ + const BYTE* ip = (const BYTE*)seqStart; + const BYTE* const iend = ip + seqSize; + BYTE* const ostart = (BYTE*)dst; + BYTE* const oend = dctx->litBufferLocation == ZSTD_not_in_dst ? ZSTD_maybeNullPtrAdd(ostart, maxDstSize) : dctx->litBuffer; + BYTE* op = ostart; + const BYTE* litPtr = dctx->litPtr; + const BYTE* const litEnd = litPtr + dctx->litSize; + const BYTE* const prefixStart = (const BYTE*)(dctx->prefixStart); + const BYTE* const vBase = (const BYTE*)(dctx->virtualStart); + const BYTE* const dictEnd = (const BYTE*)(dctx->dictEnd); + DEBUGLOG(5, "ZSTD_decompressSequences_body: nbSeq = %d", nbSeq); + + /* Regen sequences */ + if (nbSeq) { + seqState_t seqState; + dctx->fseEntropy = 1; + { U32 i; for (i = 0; i < ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; } + RETURN_ERROR_IF( + ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend - ip)), + corruption_detected, ""); + ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr); + ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr); + ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr); + assert(dst != NULL); + +#if defined(__GNUC__) && defined(__x86_64__) + __asm__(".p2align 6"); + __asm__("nop"); +# if __GNUC__ >= 7 + __asm__(".p2align 5"); + __asm__("nop"); + __asm__(".p2align 3"); +# else + __asm__(".p2align 4"); + __asm__("nop"); + __asm__(".p2align 3"); +# endif +#endif + + for ( ; nbSeq ; nbSeq--) { + seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1); + size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litEnd, prefixStart, vBase, dictEnd); +#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE) + assert(!ZSTD_isError(oneSeqSize)); + ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase); +#endif + if (UNLIKELY(ZSTD_isError(oneSeqSize))) + return oneSeqSize; + DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize); + op += oneSeqSize; } + + /* check if reached exact end */ + assert(nbSeq == 0); + RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, ""); + /* save reps for next block */ + { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); } } - return op-ostart; + /* last literal segment */ + { size_t const lastLLSize = (size_t)(litEnd - litPtr); + DEBUGLOG(6, "copy last literals : %u", (U32)lastLLSize); + RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, ""); + if (op != NULL) { + ZSTD_memcpy(op, litPtr, lastLLSize); + op += lastLLSize; + } } + + DEBUGLOG(6, "decoded block of size %u bytes", (U32)(op - ostart)); + return (size_t)(op - ostart); } static size_t ZSTD_decompressSequences_default(ZSTD_DCtx* dctx, void* dst, size_t maxDstSize, const void* seqStart, size_t seqSize, int nbSeq, - const ZSTD_longOffset_e isLongOffset, - const int frame) + const ZSTD_longOffset_e isLongOffset) { - return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame); + return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset); +} + +static size_t +ZSTD_decompressSequencesSplitLitBuffer_default(ZSTD_DCtx* dctx, + void* dst, size_t maxDstSize, + const void* seqStart, size_t seqSize, int nbSeq, + const ZSTD_longOffset_e isLongOffset) +{ + return ZSTD_decompressSequences_bodySplitLitBuffer(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset); } #endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG */ #ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT -FORCE_INLINE_TEMPLATE size_t -ZSTD_prefetchMatch(size_t prefetchPos, seq_t const sequence, +FORCE_INLINE_TEMPLATE + +size_t ZSTD_prefetchMatch(size_t prefetchPos, seq_t const sequence, const BYTE* const prefixStart, const BYTE* const dictEnd) { prefetchPos += sequence.litLength; { const BYTE* const matchBase = (sequence.offset > prefetchPos) ? dictEnd : prefixStart; - const BYTE* const match = matchBase + prefetchPos - sequence.offset; /* note : this operation can overflow when seq.offset is really too large, which can only happen when input is corrupted. - * No consequence though : memory address is only used for prefetching, not for dereferencing */ + /* note : this operation can overflow when seq.offset is really too large, which can only happen when input is corrupted. + * No consequence though : memory address is only used for prefetching, not for dereferencing */ + const BYTE* const match = ZSTD_wrappedPtrSub(ZSTD_wrappedPtrAdd(matchBase, prefetchPos), sequence.offset); PREFETCH_L1(match); PREFETCH_L1(match+CACHELINE_SIZE); /* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */ } return prefetchPos + sequence.matchLength; @@ -1189,20 +1735,18 @@ ZSTD_decompressSequencesLong_body( ZSTD_DCtx* dctx, void* dst, size_t maxDstSize, const void* seqStart, size_t seqSize, int nbSeq, - const ZSTD_longOffset_e isLongOffset, - const int frame) + const ZSTD_longOffset_e isLongOffset) { const BYTE* ip = (const BYTE*)seqStart; const BYTE* const iend = ip + seqSize; BYTE* const ostart = (BYTE*)dst; - BYTE* const oend = ostart + maxDstSize; + BYTE* const oend = dctx->litBufferLocation == ZSTD_in_dst ? dctx->litBuffer : ZSTD_maybeNullPtrAdd(ostart, maxDstSize); BYTE* op = ostart; const BYTE* litPtr = dctx->litPtr; - const BYTE* const litEnd = litPtr + dctx->litSize; + const BYTE* litBufferEnd = dctx->litBufferEnd; const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart); const BYTE* const dictStart = (const BYTE*) (dctx->virtualStart); const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd); - (void)frame; /* Regen sequences */ if (nbSeq) { @@ -1227,31 +1771,95 @@ ZSTD_decompressSequencesLong_body( ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr); /* prepare in advance */ - for (seqNb=0; (BIT_reloadDStream(&seqState.DStream) <= BIT_DStream_completed) && (seqNb<seqAdvance); seqNb++) { - seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset); + for (seqNb=0; seqNb<seqAdvance; seqNb++) { + seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1); prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd); sequences[seqNb] = sequence; } - RETURN_ERROR_IF(seqNb<seqAdvance, corruption_detected, ""); - /* decode and decompress */ - for ( ; (BIT_reloadDStream(&(seqState.DStream)) <= BIT_DStream_completed) && (seqNb<nbSeq) ; seqNb++) { - seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset); - size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[(seqNb-ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litEnd, prefixStart, dictStart, dictEnd); - if (ZSTD_isError(oneSeqSize)) return oneSeqSize; + /* decompress without stomping litBuffer */ + for (; seqNb < nbSeq; seqNb++) { + seq_t sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1); - prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd); - sequences[seqNb & STORED_SEQS_MASK] = sequence; - op += oneSeqSize; + if (dctx->litBufferLocation == ZSTD_split && litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength > dctx->litBufferEnd) { + /* lit buffer is reaching split point, empty out the first buffer and transition to litExtraBuffer */ + const size_t leftoverLit = dctx->litBufferEnd - litPtr; + if (leftoverLit) + { + RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer"); + ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit); + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength -= leftoverLit; + op += leftoverLit; + } + litPtr = dctx->litExtraBuffer; + litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE; + dctx->litBufferLocation = ZSTD_not_in_dst; + { size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd); +#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE) + assert(!ZSTD_isError(oneSeqSize)); + ZSTD_assertValidSequence(dctx, op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], prefixStart, dictStart); +#endif + if (ZSTD_isError(oneSeqSize)) return oneSeqSize; + + prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd); + sequences[seqNb & STORED_SEQS_MASK] = sequence; + op += oneSeqSize; + } } + else + { + /* lit buffer is either wholly contained in first or second split, or not split at all*/ + size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ? + ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY_OVERLENGTH, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) : + ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd); +#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE) + assert(!ZSTD_isError(oneSeqSize)); + ZSTD_assertValidSequence(dctx, op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], prefixStart, dictStart); +#endif + if (ZSTD_isError(oneSeqSize)) return oneSeqSize; + + prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd); + sequences[seqNb & STORED_SEQS_MASK] = sequence; + op += oneSeqSize; + } } - RETURN_ERROR_IF(seqNb<nbSeq, corruption_detected, ""); + RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, ""); /* finish queue */ seqNb -= seqAdvance; for ( ; seqNb<nbSeq ; seqNb++) { - size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[seqNb&STORED_SEQS_MASK], &litPtr, litEnd, prefixStart, dictStart, dictEnd); - if (ZSTD_isError(oneSeqSize)) return oneSeqSize; - op += oneSeqSize; + seq_t *sequence = &(sequences[seqNb&STORED_SEQS_MASK]); + if (dctx->litBufferLocation == ZSTD_split && litPtr + sequence->litLength > dctx->litBufferEnd) { + const size_t leftoverLit = dctx->litBufferEnd - litPtr; + if (leftoverLit) { + RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer"); + ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit); + sequence->litLength -= leftoverLit; + op += leftoverLit; + } + litPtr = dctx->litExtraBuffer; + litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE; + dctx->litBufferLocation = ZSTD_not_in_dst; + { size_t const oneSeqSize = ZSTD_execSequence(op, oend, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd); +#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE) + assert(!ZSTD_isError(oneSeqSize)); + ZSTD_assertValidSequence(dctx, op, oend, sequences[seqNb&STORED_SEQS_MASK], prefixStart, dictStart); +#endif + if (ZSTD_isError(oneSeqSize)) return oneSeqSize; + op += oneSeqSize; + } + } + else + { + size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ? + ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence->litLength - WILDCOPY_OVERLENGTH, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) : + ZSTD_execSequence(op, oend, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd); +#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE) + assert(!ZSTD_isError(oneSeqSize)); + ZSTD_assertValidSequence(dctx, op, oend, sequences[seqNb&STORED_SEQS_MASK], prefixStart, dictStart); +#endif + if (ZSTD_isError(oneSeqSize)) return oneSeqSize; + op += oneSeqSize; + } } /* save reps for next block */ @@ -1259,25 +1867,34 @@ ZSTD_decompressSequencesLong_body( } /* last literal segment */ - { size_t const lastLLSize = litEnd - litPtr; + if (dctx->litBufferLocation == ZSTD_split) { /* first deplete literal buffer in dst, then copy litExtraBuffer */ + size_t const lastLLSize = litBufferEnd - litPtr; + RETURN_ERROR_IF(lastLLSize > (size_t)(oend - op), dstSize_tooSmall, ""); + if (op != NULL) { + ZSTD_memmove(op, litPtr, lastLLSize); + op += lastLLSize; + } + litPtr = dctx->litExtraBuffer; + litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE; + } + { size_t const lastLLSize = litBufferEnd - litPtr; RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, ""); if (op != NULL) { - ZSTD_memcpy(op, litPtr, lastLLSize); + ZSTD_memmove(op, litPtr, lastLLSize); op += lastLLSize; } } - return op-ostart; + return (size_t)(op - ostart); } static size_t ZSTD_decompressSequencesLong_default(ZSTD_DCtx* dctx, void* dst, size_t maxDstSize, const void* seqStart, size_t seqSize, int nbSeq, - const ZSTD_longOffset_e isLongOffset, - const int frame) + const ZSTD_longOffset_e isLongOffset) { - return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame); + return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset); } #endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT */ @@ -1286,27 +1903,34 @@ ZSTD_decompressSequencesLong_default(ZSTD_DCtx* dctx, #if DYNAMIC_BMI2 #ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG -static TARGET_ATTRIBUTE("bmi2") size_t +static BMI2_TARGET_ATTRIBUTE size_t DONT_VECTORIZE ZSTD_decompressSequences_bmi2(ZSTD_DCtx* dctx, void* dst, size_t maxDstSize, const void* seqStart, size_t seqSize, int nbSeq, - const ZSTD_longOffset_e isLongOffset, - const int frame) + const ZSTD_longOffset_e isLongOffset) { - return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame); + return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset); +} +static BMI2_TARGET_ATTRIBUTE size_t +DONT_VECTORIZE +ZSTD_decompressSequencesSplitLitBuffer_bmi2(ZSTD_DCtx* dctx, + void* dst, size_t maxDstSize, + const void* seqStart, size_t seqSize, int nbSeq, + const ZSTD_longOffset_e isLongOffset) +{ + return ZSTD_decompressSequences_bodySplitLitBuffer(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset); } #endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG */ #ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT -static TARGET_ATTRIBUTE("bmi2") size_t +static BMI2_TARGET_ATTRIBUTE size_t ZSTD_decompressSequencesLong_bmi2(ZSTD_DCtx* dctx, void* dst, size_t maxDstSize, const void* seqStart, size_t seqSize, int nbSeq, - const ZSTD_longOffset_e isLongOffset, - const int frame) + const ZSTD_longOffset_e isLongOffset) { - return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame); + return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset); } #endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT */ @@ -1316,23 +1940,34 @@ typedef size_t (*ZSTD_decompressSequences_t)( ZSTD_DCtx* dctx, void* dst, size_t maxDstSize, const void* seqStart, size_t seqSize, int nbSeq, - const ZSTD_longOffset_e isLongOffset, - const int frame); + const ZSTD_longOffset_e isLongOffset); #ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG static size_t ZSTD_decompressSequences(ZSTD_DCtx* dctx, void* dst, size_t maxDstSize, const void* seqStart, size_t seqSize, int nbSeq, - const ZSTD_longOffset_e isLongOffset, - const int frame) + const ZSTD_longOffset_e isLongOffset) { DEBUGLOG(5, "ZSTD_decompressSequences"); #if DYNAMIC_BMI2 if (ZSTD_DCtx_get_bmi2(dctx)) { - return ZSTD_decompressSequences_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame); + return ZSTD_decompressSequences_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset); } #endif - return ZSTD_decompressSequences_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame); + return ZSTD_decompressSequences_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset); +} +static size_t +ZSTD_decompressSequencesSplitLitBuffer(ZSTD_DCtx* dctx, void* dst, size_t maxDstSize, + const void* seqStart, size_t seqSize, int nbSeq, + const ZSTD_longOffset_e isLongOffset) +{ + DEBUGLOG(5, "ZSTD_decompressSequencesSplitLitBuffer"); +#if DYNAMIC_BMI2 + if (ZSTD_DCtx_get_bmi2(dctx)) { + return ZSTD_decompressSequencesSplitLitBuffer_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset); + } +#endif + return ZSTD_decompressSequencesSplitLitBuffer_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset); } #endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG */ @@ -1347,69 +1982,114 @@ static size_t ZSTD_decompressSequencesLong(ZSTD_DCtx* dctx, void* dst, size_t maxDstSize, const void* seqStart, size_t seqSize, int nbSeq, - const ZSTD_longOffset_e isLongOffset, - const int frame) + const ZSTD_longOffset_e isLongOffset) { DEBUGLOG(5, "ZSTD_decompressSequencesLong"); #if DYNAMIC_BMI2 if (ZSTD_DCtx_get_bmi2(dctx)) { - return ZSTD_decompressSequencesLong_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame); + return ZSTD_decompressSequencesLong_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset); } #endif - return ZSTD_decompressSequencesLong_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset, frame); + return ZSTD_decompressSequencesLong_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset); } #endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT */ +/** + * @returns The total size of the history referenceable by zstd, including + * both the prefix and the extDict. At @p op any offset larger than this + * is invalid. + */ +static size_t ZSTD_totalHistorySize(BYTE* op, BYTE const* virtualStart) +{ + return (size_t)(op - virtualStart); +} -#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \ - !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG) -/* ZSTD_getLongOffsetsShare() : +typedef struct { + unsigned longOffsetShare; + unsigned maxNbAdditionalBits; +} ZSTD_OffsetInfo; + +/* ZSTD_getOffsetInfo() : * condition : offTable must be valid * @return : "share" of long offsets (arbitrarily defined as > (1<<23)) - * compared to maximum possible of (1<<OffFSELog) */ -static unsigned -ZSTD_getLongOffsetsShare(const ZSTD_seqSymbol* offTable) + * compared to maximum possible of (1<<OffFSELog), + * as well as the maximum number additional bits required. + */ +static ZSTD_OffsetInfo +ZSTD_getOffsetInfo(const ZSTD_seqSymbol* offTable, int nbSeq) { - const void* ptr = offTable; - U32 const tableLog = ((const ZSTD_seqSymbol_header*)ptr)[0].tableLog; - const ZSTD_seqSymbol* table = offTable + 1; - U32 const max = 1 << tableLog; - U32 u, total = 0; - DEBUGLOG(5, "ZSTD_getLongOffsetsShare: (tableLog=%u)", tableLog); + ZSTD_OffsetInfo info = {0, 0}; + /* If nbSeq == 0, then the offTable is uninitialized, but we have + * no sequences, so both values should be 0. + */ + if (nbSeq != 0) { + const void* ptr = offTable; + U32 const tableLog = ((const ZSTD_seqSymbol_header*)ptr)[0].tableLog; + const ZSTD_seqSymbol* table = offTable + 1; + U32 const max = 1 << tableLog; + U32 u; + DEBUGLOG(5, "ZSTD_getLongOffsetsShare: (tableLog=%u)", tableLog); - assert(max <= (1 << OffFSELog)); /* max not too large */ - for (u=0; u<max; u++) { - if (table[u].nbAdditionalBits > 22) total += 1; + assert(max <= (1 << OffFSELog)); /* max not too large */ + for (u=0; u<max; u++) { + info.maxNbAdditionalBits = MAX(info.maxNbAdditionalBits, table[u].nbAdditionalBits); + if (table[u].nbAdditionalBits > 22) info.longOffsetShare += 1; + } + + assert(tableLog <= OffFSELog); + info.longOffsetShare <<= (OffFSELog - tableLog); /* scale to OffFSELog */ } - assert(tableLog <= OffFSELog); - total <<= (OffFSELog - tableLog); /* scale to OffFSELog */ - - return total; + return info; +} + +/** + * @returns The maximum offset we can decode in one read of our bitstream, without + * reloading more bits in the middle of the offset bits read. Any offsets larger + * than this must use the long offset decoder. + */ +static size_t ZSTD_maxShortOffset(void) +{ + if (MEM_64bits()) { + /* We can decode any offset without reloading bits. + * This might change if the max window size grows. + */ + ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX <= 31); + return (size_t)-1; + } else { + /* The maximum offBase is (1 << (STREAM_ACCUMULATOR_MIN + 1)) - 1. + * This offBase would require STREAM_ACCUMULATOR_MIN extra bits. + * Then we have to subtract ZSTD_REP_NUM to get the maximum possible offset. + */ + size_t const maxOffbase = ((size_t)1 << (STREAM_ACCUMULATOR_MIN + 1)) - 1; + size_t const maxOffset = maxOffbase - ZSTD_REP_NUM; + assert(ZSTD_highbit32((U32)maxOffbase) == STREAM_ACCUMULATOR_MIN); + return maxOffset; + } } -#endif size_t ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, - const void* src, size_t srcSize, const int frame) + const void* src, size_t srcSize, const streaming_operation streaming) { /* blockType == blockCompressed */ const BYTE* ip = (const BYTE*)src; - /* isLongOffset must be true if there are long offsets. - * Offsets are long if they are larger than 2^STREAM_ACCUMULATOR_MIN. - * We don't expect that to be the case in 64-bit mode. - * In block mode, window size is not known, so we have to be conservative. - * (note: but it could be evaluated from current-lowLimit) - */ - ZSTD_longOffset_e const isLongOffset = (ZSTD_longOffset_e)(MEM_32bits() && (!frame || (dctx->fParams.windowSize > (1ULL << STREAM_ACCUMULATOR_MIN)))); - DEBUGLOG(5, "ZSTD_decompressBlock_internal (size : %u)", (U32)srcSize); + DEBUGLOG(5, "ZSTD_decompressBlock_internal (cSize : %u)", (unsigned)srcSize); - RETURN_ERROR_IF(srcSize >= ZSTD_BLOCKSIZE_MAX, srcSize_wrong, ""); + /* Note : the wording of the specification + * allows compressed block to be sized exactly ZSTD_blockSizeMax(dctx). + * This generally does not happen, as it makes little sense, + * since an uncompressed block would feature same size and have no decompression cost. + * Also, note that decoder from reference libzstd before < v1.5.4 + * would consider this edge case as an error. + * As a consequence, avoid generating compressed blocks of size ZSTD_blockSizeMax(dctx) + * for broader compatibility with the deployed ecosystem of zstd decoders */ + RETURN_ERROR_IF(srcSize > ZSTD_blockSizeMax(dctx), srcSize_wrong, ""); /* Decode literals section */ - { size_t const litCSize = ZSTD_decodeLiteralsBlock(dctx, src, srcSize); - DEBUGLOG(5, "ZSTD_decodeLiteralsBlock : %u", (U32)litCSize); + { size_t const litCSize = ZSTD_decodeLiteralsBlock(dctx, src, srcSize, dst, dstCapacity, streaming); + DEBUGLOG(5, "ZSTD_decodeLiteralsBlock : cSize=%u, nbLiterals=%zu", (U32)litCSize, dctx->litSize); if (ZSTD_isError(litCSize)) return litCSize; ip += litCSize; srcSize -= litCSize; @@ -1417,16 +2097,35 @@ ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx, /* Build Decoding Tables */ { + /* Compute the maximum block size, which must also work when !frame and fParams are unset. + * Additionally, take the min with dstCapacity to ensure that the totalHistorySize fits in a size_t. + */ + size_t const blockSizeMax = MIN(dstCapacity, ZSTD_blockSizeMax(dctx)); + size_t const totalHistorySize = ZSTD_totalHistorySize(ZSTD_maybeNullPtrAdd((BYTE*)dst, blockSizeMax), (BYTE const*)dctx->virtualStart); + /* isLongOffset must be true if there are long offsets. + * Offsets are long if they are larger than ZSTD_maxShortOffset(). + * We don't expect that to be the case in 64-bit mode. + * + * We check here to see if our history is large enough to allow long offsets. + * If it isn't, then we can't possible have (valid) long offsets. If the offset + * is invalid, then it is okay to read it incorrectly. + * + * If isLongOffsets is true, then we will later check our decoding table to see + * if it is even possible to generate long offsets. + */ + ZSTD_longOffset_e isLongOffset = (ZSTD_longOffset_e)(MEM_32bits() && (totalHistorySize > ZSTD_maxShortOffset())); /* These macros control at build-time which decompressor implementation * we use. If neither is defined, we do some inspection and dispatch at * runtime. */ #if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \ !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG) - int usePrefetchDecoder = 0; -#if ZSTD_DECOMPRESS_DICTIONARY != 0 - usePrefetchDecoder = dctx->ddictIsCold; -#endif + int usePrefetchDecoder = dctx->ddictIsCold; +#else + /* Set to 1 to avoid computing offset info if we don't need to. + * Otherwise this value is ignored. + */ + int usePrefetchDecoder = 1; #endif int nbSeq; size_t const seqHSize = ZSTD_decodeSeqHeaders(dctx, &nbSeq, ip, srcSize); @@ -1434,38 +2133,55 @@ ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx, ip += seqHSize; srcSize -= seqHSize; - RETURN_ERROR_IF(dst == NULL && nbSeq > 0, dstSize_tooSmall, "NULL not handled"); + RETURN_ERROR_IF((dst == NULL || dstCapacity == 0) && nbSeq > 0, dstSize_tooSmall, "NULL not handled"); + RETURN_ERROR_IF(MEM_64bits() && sizeof(size_t) == sizeof(void*) && (size_t)(-1) - (size_t)dst < (size_t)(1 << 20), dstSize_tooSmall, + "invalid dst"); -#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \ - !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG) - if ( !usePrefetchDecoder - && (!frame || (dctx->fParams.windowSize > (1<<24))) - && (nbSeq>ADVANCED_SEQS) ) { /* could probably use a larger nbSeq limit */ - U32 const shareLongOffsets = ZSTD_getLongOffsetsShare(dctx->OFTptr); - U32 const minShare = MEM_64bits() ? 7 : 20; /* heuristic values, correspond to 2.73% and 7.81% */ - usePrefetchDecoder = (shareLongOffsets >= minShare); + /* If we could potentially have long offsets, or we might want to use the prefetch decoder, + * compute information about the share of long offsets, and the maximum nbAdditionalBits. + * NOTE: could probably use a larger nbSeq limit + */ + if (isLongOffset || (!usePrefetchDecoder && (totalHistorySize > (1u << 24)) && (nbSeq > 8))) { + ZSTD_OffsetInfo const info = ZSTD_getOffsetInfo(dctx->OFTptr, nbSeq); + if (isLongOffset && info.maxNbAdditionalBits <= STREAM_ACCUMULATOR_MIN) { + /* If isLongOffset, but the maximum number of additional bits that we see in our table is small + * enough, then we know it is impossible to have too long an offset in this block, so we can + * use the regular offset decoder. + */ + isLongOffset = ZSTD_lo_isRegularOffset; + } + if (!usePrefetchDecoder) { + U32 const minShare = MEM_64bits() ? 7 : 20; /* heuristic values, correspond to 2.73% and 7.81% */ + usePrefetchDecoder = (info.longOffsetShare >= minShare); + } } -#endif -#if ZSTD_DECOMPRESS_DICTIONARY != 0 + dctx->ddictIsCold = 0; -#endif #if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \ !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG) - if (usePrefetchDecoder) + if (usePrefetchDecoder) { +#else + (void)usePrefetchDecoder; + { #endif #ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT - return ZSTD_decompressSequencesLong(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset, frame); + return ZSTD_decompressSequencesLong(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset); #endif + } #ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG /* else */ - return ZSTD_decompressSequences(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset, frame); + if (dctx->litBufferLocation == ZSTD_split) + return ZSTD_decompressSequencesSplitLitBuffer(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset); + else + return ZSTD_decompressSequences(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset); #endif } } +ZSTD_ALLOW_POINTER_OVERFLOW_ATTR void ZSTD_checkContinuity(ZSTD_DCtx* dctx, const void* dst, size_t dstSize) { if (dst != dctx->previousDstEnd && dstSize > 0) { /* not contiguous */ @@ -1477,13 +2193,24 @@ void ZSTD_checkContinuity(ZSTD_DCtx* dctx, const void* dst, size_t dstSize) } +size_t ZSTD_decompressBlock_deprecated(ZSTD_DCtx* dctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize) +{ + size_t dSize; + dctx->isFrameDecompression = 0; + ZSTD_checkContinuity(dctx, dst, dstCapacity); + dSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize, not_streaming); + FORWARD_IF_ERROR(dSize, ""); + dctx->previousDstEnd = (char*)dst + dSize; + return dSize; +} + + +/* NOTE: Must just wrap ZSTD_decompressBlock_deprecated() */ size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize) { - size_t dSize; - ZSTD_checkContinuity(dctx, dst, dstCapacity); - dSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize, /* frame */ 0); - dctx->previousDstEnd = (char*)dst + dSize; - return dSize; + return ZSTD_decompressBlock_deprecated(dctx, dst, dstCapacity, src, srcSize); } diff --git a/src/bled/zstd_decompress_block.h b/src/bled/zstd_decompress_block.h index 47653414..08261243 100644 --- a/src/bled/zstd_decompress_block.h +++ b/src/bled/zstd_decompress_block.h @@ -1,5 +1,5 @@ /* - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the @@ -33,6 +33,12 @@ */ + /* Streaming state is used to inform allocation of the literal buffer */ +typedef enum { + not_streaming = 0, + is_streaming = 1 +} streaming_operation; + /* ZSTD_decompressBlock_internal() : * decompress block, starting at `src`, * into destination buffer `dst`. @@ -41,7 +47,7 @@ */ size_t ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, - const void* src, size_t srcSize, const int frame); + const void* src, size_t srcSize, const streaming_operation streaming); /* ZSTD_buildFSETable() : * generate FSE decoding table for one symbol (ll, ml or off) @@ -54,9 +60,14 @@ size_t ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx, */ void ZSTD_buildFSETable(ZSTD_seqSymbol* dt, const short* normalizedCounter, unsigned maxSymbolValue, - const U32* baseValue, const U32* nbAdditionalBits, + const U32* baseValue, const U8* nbAdditionalBits, unsigned tableLog, void* wksp, size_t wkspSize, int bmi2); +/* Internal definition of ZSTD_decompressBlock() to avoid deprecation warnings. */ +size_t ZSTD_decompressBlock_deprecated(ZSTD_DCtx* dctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize); + #endif /* ZSTD_DEC_BLOCK_H */ diff --git a/src/bled/zstd_decompress_internal.h b/src/bled/zstd_decompress_internal.h index 19841485..6abf502f 100644 --- a/src/bled/zstd_decompress_internal.h +++ b/src/bled/zstd_decompress_internal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the @@ -20,7 +20,7 @@ * Dependencies *********************************************************/ #include "zstd_mem.h" /* BYTE, U16, U32 */ -#include "zstd_internal.h" /* ZSTD_seqSymbol */ +#include "zstd_internal.h" /* constants : MaxLL, MaxML, MaxOff, LLFSELog, etc. */ @@ -40,7 +40,7 @@ static UNUSED_ATTR const U32 OF_base[MaxOff+1] = { 0xFFFD, 0x1FFFD, 0x3FFFD, 0x7FFFD, 0xFFFFD, 0x1FFFFD, 0x3FFFFD, 0x7FFFFD, 0xFFFFFD, 0x1FFFFFD, 0x3FFFFFD, 0x7FFFFFD, 0xFFFFFFD, 0x1FFFFFFD, 0x3FFFFFFD, 0x7FFFFFFD }; -static UNUSED_ATTR const U32 OF_bits[MaxOff+1] = { +static UNUSED_ATTR const U8 OF_bits[MaxOff+1] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, @@ -75,12 +75,13 @@ static UNUSED_ATTR const U32 ML_base[MaxML+1] = { #define ZSTD_BUILD_FSE_TABLE_WKSP_SIZE (sizeof(S16) * (MaxSeq + 1) + (1u << MaxFSELog) + sizeof(U64)) #define ZSTD_BUILD_FSE_TABLE_WKSP_SIZE_U32 ((ZSTD_BUILD_FSE_TABLE_WKSP_SIZE + sizeof(U32) - 1) / sizeof(U32)) +#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12 typedef struct { ZSTD_seqSymbol LLTable[SEQSYMBOL_TABLE_SIZE(LLFSELog)]; /* Note : Space reserved for FSE Tables */ ZSTD_seqSymbol OFTable[SEQSYMBOL_TABLE_SIZE(OffFSELog)]; /* is also used as temporary workspace while building hufTable during DDict creation */ ZSTD_seqSymbol MLTable[SEQSYMBOL_TABLE_SIZE(MLFSELog)]; /* and therefore must be at least HUF_DECOMPRESS_WORKSPACE_SIZE large */ - HUF_DTable hufTable[HUF_DTABLE_SIZE(HufLog)]; /* can accommodate HUF_decompress4X */ + HUF_DTable hufTable[HUF_DTABLE_SIZE(ZSTD_HUFFDTABLE_CAPACITY_LOG)]; /* can accommodate HUF_decompress4X */ U32 rep[ZSTD_REP_NUM]; U32 workspace[ZSTD_BUILD_FSE_TABLE_WKSP_SIZE_U32]; } ZSTD_entropyDTables_t; @@ -106,6 +107,22 @@ typedef struct { size_t ddictPtrCount; } ZSTD_DDictHashSet; +#ifndef ZSTD_DECODER_INTERNAL_BUFFER +# define ZSTD_DECODER_INTERNAL_BUFFER (1 << 16) +#endif + +#define ZSTD_LBMIN 64 +#define ZSTD_LBMAX (128 << 10) + +/* extra buffer, compensates when dst is not large enough to store litBuffer */ +#define ZSTD_LITBUFFEREXTRASIZE BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX) + +typedef enum { + ZSTD_not_in_dst = 0, /* Stored entirely within litExtraBuffer */ + ZSTD_in_dst = 1, /* Stored entirely within dst (in memory after current output write) */ + ZSTD_split = 2 /* Split between litExtraBuffer and dst */ +} ZSTD_litLocation_e; + struct ZSTD_DCtx_s { const ZSTD_seqSymbol* LLTptr; @@ -132,13 +149,15 @@ struct ZSTD_DCtx_s ZSTD_forceIgnoreChecksum_e forceIgnoreChecksum; /* User specified: if == 1, will ignore checksums in compressed frame. Default == 0 */ U32 validateChecksum; /* if == 1, will validate checksum. Is == 1 if (fParams.checksumFlag == 1) and (forceIgnoreChecksum == 0). */ const BYTE* litPtr; + ZSTD_customMem customMem; size_t litSize; size_t rleSize; + size_t staticSize; + int isFrameDecompression; #if DYNAMIC_BMI2 != 0 int bmi2; /* == 1 if the CPU supports BMI2 and 0 otherwise. CPU support is determined dynamically once per context lifetime. */ #endif -#if ZSTD_DECOMPRESS_DICTIONARY != 0 /* dictionary */ ZSTD_DDict* ddictLocal; const ZSTD_DDict* ddict; /* set by ZSTD_initDStream_usingDDict(), or ZSTD_DCtx_refDDict() */ @@ -147,7 +166,8 @@ struct ZSTD_DCtx_s ZSTD_dictUses_e dictUses; ZSTD_DDictHashSet* ddictSet; /* Hash set for multiple ddicts */ ZSTD_refMultipleDDicts_e refMultipleDDicts; /* User specified: if == 1, will allow references to multiple DDicts. Default == 0 (disabled) */ -#endif + int disableHufAsm; + int maxBlockSizeParam; /* streaming */ ZSTD_dStreamStage streamStage; @@ -160,18 +180,34 @@ struct ZSTD_DCtx_s size_t outStart; size_t outEnd; size_t lhSize; +#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1) + void* legacyContext; + U32 previousLegacyVersion; + U32 legacyVersion; +#endif U32 hostageByte; int noForwardProgress; + ZSTD_bufferMode_e outBufferMode; ZSTD_outBuffer expectedOutBuffer; /* workspace */ - BYTE litBuffer[ZSTD_BLOCKSIZE_MAX + WILDCOPY_OVERLENGTH]; + BYTE* litBuffer; + const BYTE* litBufferEnd; + ZSTD_litLocation_e litBufferLocation; + BYTE litExtraBuffer[ZSTD_LITBUFFEREXTRASIZE + WILDCOPY_OVERLENGTH]; /* literal buffer can be split between storage within dst and within this scratch buffer */ BYTE headerBuffer[ZSTD_FRAMEHEADERSIZE_MAX]; size_t oversizedDuration; +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + void const* dictContentBeginForFuzzing; + void const* dictContentEndForFuzzing; +#endif /* Tracing */ +#if ZSTD_TRACE + ZSTD_TraceCtx traceCtx; +#endif }; /* typedef'd to ZSTD_DCtx within "zstd.h" */ MEM_STATIC int ZSTD_DCtx_get_bmi2(const struct ZSTD_DCtx_s *dctx) { @@ -182,8 +218,7 @@ MEM_STATIC int ZSTD_DCtx_get_bmi2(const struct ZSTD_DCtx_s *dctx) { return 0; #endif } -#define ZSTD_DCtx_get_staticSize(dctx) (0) -#define ZSTD_DCtx_get_outBufferMode(dctx) (ZSTD_bm_buffered) + /*-******************************************************* * Shared internal functions *********************************************************/ diff --git a/src/bled/zstd_deps.h b/src/bled/zstd_deps.h index 8a62920e..ce6cca4f 100644 --- a/src/bled/zstd_deps.h +++ b/src/bled/zstd_deps.h @@ -1,5 +1,5 @@ /* - * Copyright (c) Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the @@ -24,7 +24,18 @@ #ifndef ZSTD_DEPS_COMMON #define ZSTD_DEPS_COMMON -#include <assert.h> +/* Even though we use qsort_r only for the dictionary builder, the macro + * _GNU_SOURCE has to be declared *before* the inclusion of any standard + * header and the script 'combine.sh' combines the whole zstd source code + * in a single file. + */ +#if defined(__linux) || defined(__linux__) || defined(linux) || defined(__gnu_linux__) || \ + defined(__CYGWIN__) || defined(__MSYS__) +#if !defined(_GNU_SOURCE) && !defined(__ANDROID__) /* NDK doesn't ship qsort_r(). */ +#define _GNU_SOURCE +#endif +#endif + #include <limits.h> #include <stddef.h> #include <string.h> @@ -85,6 +96,13 @@ #include <assert.h> #endif /* ZSTD_DEPS_ASSERT */ + +#else + +#ifndef assert +#define assert(condition) ((void)0) +#endif + #endif /* ZSTD_DEPS_NEED_ASSERT */ /* Need: @@ -114,17 +132,13 @@ #endif /* ZSTD_DEPS_NEED_STDINT */ #define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1]) + #include "libbb.h" + +#if (DEBUGLEVEL >= 1) #define RAWLOG(l, ...) { if (l <= ZSTD_DEBUGLEVEL) bb_printf(__VA_ARGS__); } #define DEBUGLOG(l, ...) { if (l <= ZSTD_DEBUGLEVEL) bb_printf(__VA_ARGS__); } - -#if defined(__GNUC__) -# define MEM_STATIC static __inline __attribute__((unused)) -#elif (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) -# define MEM_STATIC static inline -#elif defined(_MSC_VER) -# define MEM_STATIC static __inline #else -# define MEM_STATIC static /* this version may generate warnings for unused static functions; disable the relevant warning */ +#define RAWLOG(l, ...) do { } while (0) +#define DEBUGLOG(l, ...) do { } while (0) #endif - diff --git a/src/bled/zstd_entropy_common.c b/src/bled/zstd_entropy_common.c index 5103f0f0..e66e7ee2 100644 --- a/src/bled/zstd_entropy_common.c +++ b/src/bled/zstd_entropy_common.c @@ -1,6 +1,6 @@ /* ****************************************************************** * Common functions of New Generation Entropy library - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * * You can contact the author at : * - FSE+HUF source repository : https://github.com/Cyan4973/FiniteStateEntropy @@ -19,8 +19,8 @@ #include "zstd_error_private.h" /* ERR_*, ERROR */ #define FSE_STATIC_LINKING_ONLY /* FSE_MIN_TABLELOG */ #include "fse.h" -#define HUF_STATIC_LINKING_ONLY /* HUF_TABLELOG_ABSOLUTEMAX */ #include "huf.h" +#include "zstd_bits.h" /* ZSDT_highbit32, ZSTD_countTrailingZeros32 */ /*=== Version ===*/ @@ -28,38 +28,16 @@ unsigned FSE_versionNumber(void) { return FSE_VERSION_NUMBER; } /*=== Error Management ===*/ -#define FSE_isError ERR_isError +unsigned FSE_isError(size_t code) { return ERR_isError(code); } const char* FSE_getErrorName(size_t code) { return ERR_getErrorName(code); } -#define HUF_isError ERR_isError +unsigned HUF_isError(size_t code) { return ERR_isError(code); } const char* HUF_getErrorName(size_t code) { return ERR_getErrorName(code); } /*-************************************************************** * FSE NCount encoding-decoding ****************************************************************/ -static U32 FSE_ctz(U32 val) -{ - assert(val != 0); - { -# if defined(_MSC_VER) /* Visual */ - unsigned long r=0; - return _BitScanForward(&r, val) ? (unsigned)r : 0; -# elif defined(__GNUC__) && (__GNUC__ >= 3) /* GCC Intrinsic */ - return __builtin_ctz(val); -# elif defined(__ICCARM__) /* IAR Intrinsic */ - return __CTZ(val); -# else /* Software version */ - U32 count = 0; - while ((val & 1) == 0) { - val >>= 1; - ++count; - } - return count; -# endif - } -} - FORCE_INLINE_TEMPLATE size_t FSE_readNCount_body(short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr, const void* headerBuffer, size_t hbSize) @@ -107,7 +85,7 @@ size_t FSE_readNCount_body(short* normalizedCounter, unsigned* maxSVPtr, unsigne * repeat. * Avoid UB by setting the high bit to 1. */ - int repeats = FSE_ctz(~bitStream | 0x80000000) >> 1; + int repeats = ZSTD_countTrailingZeros32(~bitStream | 0x80000000) >> 1; while (repeats >= 12) { charnum += 3 * 12; if (LIKELY(ip <= iend-7)) { @@ -118,7 +96,7 @@ size_t FSE_readNCount_body(short* normalizedCounter, unsigned* maxSVPtr, unsigne ip = iend - 4; } bitStream = MEM_readLE32(ip) >> bitCount; - repeats = FSE_ctz(~bitStream | 0x80000000) >> 1; + repeats = ZSTD_countTrailingZeros32(~bitStream | 0x80000000) >> 1; } charnum += 3 * repeats; bitStream >>= 2 * repeats; @@ -183,7 +161,7 @@ size_t FSE_readNCount_body(short* normalizedCounter, unsigned* maxSVPtr, unsigne * know that threshold > 1. */ if (remaining <= 1) break; - nbBits = BIT_highbit32(remaining) + 1; + nbBits = ZSTD_highbit32(remaining) + 1; threshold = 1 << (nbBits - 1); } if (charnum >= maxSV1) break; @@ -217,7 +195,7 @@ static size_t FSE_readNCount_body_default( } #if DYNAMIC_BMI2 -TARGET_ATTRIBUTE("bmi2") static size_t FSE_readNCount_body_bmi2( +BMI2_TARGET_ATTRIBUTE static size_t FSE_readNCount_body_bmi2( short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr, const void* headerBuffer, size_t hbSize) { @@ -258,7 +236,7 @@ size_t HUF_readStats(BYTE* huffWeight, size_t hwSize, U32* rankStats, const void* src, size_t srcSize) { U32 wksp[HUF_READ_STATS_WORKSPACE_SIZE_U32]; - return HUF_readStats_wksp(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, wksp, sizeof(wksp), /* bmi2 */ 0); + return HUF_readStats_wksp(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, wksp, sizeof(wksp), /* flags */ 0); } FORCE_INLINE_TEMPLATE size_t @@ -306,14 +284,14 @@ HUF_readStats_body(BYTE* huffWeight, size_t hwSize, U32* rankStats, if (weightTotal == 0) return ERROR(corruption_detected); /* get last non-null symbol weight (implied, total must be 2^n) */ - { U32 const tableLog = BIT_highbit32(weightTotal) + 1; + { U32 const tableLog = ZSTD_highbit32(weightTotal) + 1; if (tableLog > HUF_TABLELOG_MAX) return ERROR(corruption_detected); *tableLogPtr = tableLog; /* determine last weight */ { U32 const total = 1 << tableLog; U32 const rest = total - weightTotal; - U32 const verif = 1 << BIT_highbit32(rest); - U32 const lastWeight = BIT_highbit32(rest) + 1; + U32 const verif = 1 << ZSTD_highbit32(rest); + U32 const lastWeight = ZSTD_highbit32(rest) + 1; if (verif != rest) return ERROR(corruption_detected); /* last value must be a clean power of 2 */ huffWeight[oSize] = (BYTE)lastWeight; rankStats[lastWeight]++; @@ -337,7 +315,7 @@ static size_t HUF_readStats_body_default(BYTE* huffWeight, size_t hwSize, U32* r } #if DYNAMIC_BMI2 -static TARGET_ATTRIBUTE("bmi2") size_t HUF_readStats_body_bmi2(BYTE* huffWeight, size_t hwSize, U32* rankStats, +static BMI2_TARGET_ATTRIBUTE size_t HUF_readStats_body_bmi2(BYTE* huffWeight, size_t hwSize, U32* rankStats, U32* nbSymbolsPtr, U32* tableLogPtr, const void* src, size_t srcSize, void* workSpace, size_t wkspSize) @@ -350,13 +328,13 @@ size_t HUF_readStats_wksp(BYTE* huffWeight, size_t hwSize, U32* rankStats, U32* nbSymbolsPtr, U32* tableLogPtr, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, - int bmi2) + int flags) { #if DYNAMIC_BMI2 - if (bmi2) { + if (flags & HUF_flags_bmi2) { return HUF_readStats_body_bmi2(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize); } #endif - (void)bmi2; + (void)flags; return HUF_readStats_body_default(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize); } diff --git a/src/bled/zstd_error_private.c b/src/bled/zstd_error_private.c index 531d1ee7..23b571dd 100644 --- a/src/bled/zstd_error_private.c +++ b/src/bled/zstd_error_private.c @@ -1,5 +1,5 @@ /* - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the @@ -27,9 +27,11 @@ const char* ERR_getErrorString(ERR_enum code) case PREFIX(version_unsupported): return "Version not supported"; case PREFIX(frameParameter_unsupported): return "Unsupported frame parameter"; case PREFIX(frameParameter_windowTooLarge): return "Frame requires too much memory for decoding"; - case PREFIX(corruption_detected): return "Corrupted block detected"; + case PREFIX(corruption_detected): return "Data corruption detected"; case PREFIX(checksum_wrong): return "Restored data doesn't match checksum"; + case PREFIX(literals_headerWrong): return "Header of Literals' block doesn't respect format specification"; case PREFIX(parameter_unsupported): return "Unsupported parameter"; + case PREFIX(parameter_combination_unsupported): return "Unsupported combination of parameters"; case PREFIX(parameter_outOfBound): return "Parameter is out of bound"; case PREFIX(init_missing): return "Context should be init first"; case PREFIX(memory_allocation): return "Allocation error : not enough memory"; @@ -38,17 +40,22 @@ const char* ERR_getErrorString(ERR_enum code) case PREFIX(tableLog_tooLarge): return "tableLog requires too much memory : unsupported"; case PREFIX(maxSymbolValue_tooLarge): return "Unsupported max Symbol Value : too large"; case PREFIX(maxSymbolValue_tooSmall): return "Specified maxSymbolValue is too small"; + case PREFIX(stabilityCondition_notRespected): return "pledged buffer stability condition is not respected"; case PREFIX(dictionary_corrupted): return "Dictionary is corrupted"; case PREFIX(dictionary_wrong): return "Dictionary mismatch"; case PREFIX(dictionaryCreation_failed): return "Cannot create Dictionary from provided samples"; case PREFIX(dstSize_tooSmall): return "Destination buffer is too small"; case PREFIX(srcSize_wrong): return "Src size is incorrect"; case PREFIX(dstBuffer_null): return "Operation on NULL destination buffer"; + case PREFIX(noForwardProgress_destFull): return "Operation made no progress over multiple calls, due to output buffer being full"; + case PREFIX(noForwardProgress_inputEmpty): return "Operation made no progress over multiple calls, due to input being empty"; /* following error codes are not stable and may be removed or changed in a future version */ case PREFIX(frameIndex_tooLarge): return "Frame index is too large"; case PREFIX(seekableIO): return "An I/O error occurred when reading/seeking"; case PREFIX(dstBuffer_wrong): return "Destination buffer is wrong"; case PREFIX(srcBuffer_wrong): return "Source buffer is wrong"; + case PREFIX(sequenceProducer_failed): return "Block-level external sequence producer returned an error code"; + case PREFIX(externalSequences_invalid): return "External sequences are not valid"; case PREFIX(maxCode): default: return notErrorCode; } diff --git a/src/bled/zstd_error_private.h b/src/bled/zstd_error_private.h index fa75e32a..1463ff98 100644 --- a/src/bled/zstd_error_private.h +++ b/src/bled/zstd_error_private.h @@ -1,5 +1,5 @@ /* - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the @@ -13,6 +13,9 @@ #ifndef ERROR_H_MODULE #define ERROR_H_MODULE +#if defined (__cplusplus) +extern "C" { +#endif /* **************************************** @@ -28,7 +31,7 @@ ******************************************/ #if defined(__GNUC__) # define ERR_STATIC static __attribute__((unused)) -#elif (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) +#elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) # define ERR_STATIC static inline #elif defined(_MSC_VER) # define ERR_STATIC static __inline @@ -56,8 +59,13 @@ ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); } ERR_STATIC ERR_enum ERR_getErrorCode(size_t code) { if (!ERR_isError(code)) return (ERR_enum)0; return (ERR_enum) (0-code); } /* check and forward error code */ -#define CHECK_V_F(e, f) size_t const e = f; if (ERR_isError(e)) return e -#define CHECK_F(f) { CHECK_V_F(_var_err__, f); } +#define CHECK_V_F(e, f) \ + size_t const e = f; \ + do { \ + if (ERR_isError(e)) \ + return e; \ + } while (0) +#define CHECK_F(f) do { CHECK_V_F(_var_err__, f); } while (0) /*-**************************************** @@ -68,12 +76,7 @@ const char* ERR_getErrorString(ERR_enum code); /* error_private.c */ ERR_STATIC const char* ERR_getErrorName(size_t code) { -#ifdef ZSTD_STRIP_ERROR_STRINGS - (void)code; - return "Error strings stripped"; -#else return ERR_getErrorString(ERR_getErrorCode(code)); -#endif } /** @@ -96,10 +99,12 @@ void _force_has_format_string(const char *format, ...) { * We want to force this function invocation to be syntactically correct, but * we don't want to force runtime evaluation of its arguments. */ -#define _FORCE_HAS_FORMAT_STRING(...) \ - if (0) { \ - _force_has_format_string(__VA_ARGS__); \ - } +#define _FORCE_HAS_FORMAT_STRING(...) \ + do { \ + if (0) { \ + _force_has_format_string(__VA_ARGS__); \ + } \ + } while (0) #define ERR_QUOTE(str) #str @@ -110,48 +115,53 @@ void _force_has_format_string(const char *format, ...) { * In order to do that (particularly, printing the conditional that failed), * this can't just wrap RETURN_ERROR(). */ -#define RETURN_ERROR_IF(cond, err, ...) \ - if (cond) { \ - RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s", \ - __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \ - _FORCE_HAS_FORMAT_STRING(__VA_ARGS__); \ - RAWLOG(3, ": " __VA_ARGS__); \ - RAWLOG(3, "\n"); \ - return ERROR(err); \ - } +#define RETURN_ERROR_IF(cond, err, ...) \ + do { \ + if (cond) { \ + RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s", \ + __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \ + _FORCE_HAS_FORMAT_STRING(__VA_ARGS__); \ + RAWLOG(3, ": " __VA_ARGS__); \ + RAWLOG(3, "\n"); \ + return ERROR(err); \ + } \ + } while (0) /** * Unconditionally return the specified error. * * In debug modes, prints additional information. */ -#define RETURN_ERROR(err, ...) \ - do { \ - RAWLOG(3, "%s:%d: ERROR!: unconditional check failed, returning %s", \ - __FILE__, __LINE__, ERR_QUOTE(ERROR(err))); \ - _FORCE_HAS_FORMAT_STRING(__VA_ARGS__); \ - RAWLOG(3, ": " __VA_ARGS__); \ - RAWLOG(3, "\n"); \ - return ERROR(err); \ - } while(0); +#define RETURN_ERROR(err, ...) \ + do { \ + RAWLOG(3, "%s:%d: ERROR!: unconditional check failed, returning %s", \ + __FILE__, __LINE__, ERR_QUOTE(ERROR(err))); \ + _FORCE_HAS_FORMAT_STRING(__VA_ARGS__); \ + RAWLOG(3, ": " __VA_ARGS__); \ + RAWLOG(3, "\n"); \ + return ERROR(err); \ + } while(0) /** * If the provided expression evaluates to an error code, returns that error code. * * In debug modes, prints additional information. */ -#define FORWARD_IF_ERROR(err, ...) \ - do { \ - size_t const err_code = (err); \ - if (ERR_isError(err_code)) { \ - RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s", \ - __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \ - _FORCE_HAS_FORMAT_STRING(__VA_ARGS__); \ - RAWLOG(3, ": " __VA_ARGS__); \ - RAWLOG(3, "\n"); \ - return err_code; \ - } \ - } while(0); +#define FORWARD_IF_ERROR(err, ...) \ + do { \ + size_t const err_code = (err); \ + if (ERR_isError(err_code)) { \ + RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s", \ + __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \ + _FORCE_HAS_FORMAT_STRING(__VA_ARGS__); \ + RAWLOG(3, ": " __VA_ARGS__); \ + RAWLOG(3, "\n"); \ + return err_code; \ + } \ + } while(0) +#if defined (__cplusplus) +} +#endif #endif /* ERROR_H_MODULE */ diff --git a/src/bled/zstd_errors.h b/src/bled/zstd_errors.h index 576d46df..20e488f1 100644 --- a/src/bled/zstd_errors.h +++ b/src/bled/zstd_errors.h @@ -1,5 +1,5 @@ /* - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the @@ -11,14 +11,37 @@ #ifndef ZSTD_ERRORS_H_398273423 #define ZSTD_ERRORS_H_398273423 - -/*===== dependency =====*/ -#include "zstd_deps.h" - +#if defined (__cplusplus) +extern "C" { +#endif /* ===== ZSTDERRORLIB_API : control library symbols visibility ===== */ -#define ZSTDERRORLIB_VISIBILITY MEM_STATIC -#define ZSTDERRORLIB_API ZSTDERRORLIB_VISIBILITY +#ifndef ZSTDERRORLIB_VISIBLE + /* Backwards compatibility with old macro name */ +# ifdef ZSTDERRORLIB_VISIBILITY +# define ZSTDERRORLIB_VISIBLE ZSTDERRORLIB_VISIBILITY +# elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__) +# define ZSTDERRORLIB_VISIBLE __attribute__ ((visibility ("default"))) +# else +# define ZSTDERRORLIB_VISIBLE +# endif +#endif + +#ifndef ZSTDERRORLIB_HIDDEN +# if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__) +# define ZSTDERRORLIB_HIDDEN __attribute__ ((visibility ("hidden"))) +# else +# define ZSTDERRORLIB_HIDDEN +# endif +#endif + +#if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1) +# define ZSTDERRORLIB_API __declspec(dllexport) ZSTDERRORLIB_VISIBLE +#elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1) +# define ZSTDERRORLIB_API __declspec(dllimport) ZSTDERRORLIB_VISIBLE /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/ +#else +# define ZSTDERRORLIB_API ZSTDERRORLIB_VISIBLE +#endif /*-********************************************* * Error codes list @@ -43,14 +66,17 @@ typedef enum { ZSTD_error_frameParameter_windowTooLarge = 16, ZSTD_error_corruption_detected = 20, ZSTD_error_checksum_wrong = 22, + ZSTD_error_literals_headerWrong = 24, ZSTD_error_dictionary_corrupted = 30, ZSTD_error_dictionary_wrong = 32, ZSTD_error_dictionaryCreation_failed = 34, ZSTD_error_parameter_unsupported = 40, + ZSTD_error_parameter_combination_unsupported = 41, ZSTD_error_parameter_outOfBound = 42, ZSTD_error_tableLog_tooLarge = 44, ZSTD_error_maxSymbolValue_tooLarge = 46, ZSTD_error_maxSymbolValue_tooSmall = 48, + ZSTD_error_stabilityCondition_notRespected = 50, ZSTD_error_stage_wrong = 60, ZSTD_error_init_missing = 62, ZSTD_error_memory_allocation = 64, @@ -58,20 +84,23 @@ typedef enum { ZSTD_error_dstSize_tooSmall = 70, ZSTD_error_srcSize_wrong = 72, ZSTD_error_dstBuffer_null = 74, + ZSTD_error_noForwardProgress_destFull = 80, + ZSTD_error_noForwardProgress_inputEmpty = 82, /* following error codes are __NOT STABLE__, they can be removed or changed in future versions */ ZSTD_error_frameIndex_tooLarge = 100, ZSTD_error_seekableIO = 102, ZSTD_error_dstBuffer_wrong = 104, ZSTD_error_srcBuffer_wrong = 105, + ZSTD_error_sequenceProducer_failed = 106, + ZSTD_error_externalSequences_invalid = 107, ZSTD_error_maxCode = 120 /* never EVER use this value directly, it can change in future versions! Use ZSTD_isError() instead */ } ZSTD_ErrorCode; -/*! ZSTD_getErrorCode() : - convert a `size_t` function result into a `ZSTD_ErrorCode` enum type, - which can be used to compare with enum list published above */ -ZSTDERRORLIB_API ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult); ZSTDERRORLIB_API const char* ZSTD_getErrorString(ZSTD_ErrorCode code); /**< Same as ZSTD_getErrorName, but using a `ZSTD_ErrorCode` enum argument */ +#if defined (__cplusplus) +} +#endif #endif /* ZSTD_ERRORS_H_398273423 */ diff --git a/src/bled/zstd_internal.h b/src/bled/zstd_internal.h index 549a259e..40d1436a 100644 --- a/src/bled/zstd_internal.h +++ b/src/bled/zstd_internal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the @@ -20,17 +20,27 @@ * Dependencies ***************************************/ #include "zstd_compiler.h" +#include "zstd_cpu.h" #include "zstd_mem.h" #include "zstd_error_private.h" #define ZSTD_STATIC_LINKING_ONLY #include "zstd.h" #define FSE_STATIC_LINKING_ONLY #include "fse.h" -#define HUF_STATIC_LINKING_ONLY #include "huf.h" +#ifndef XXH_STATIC_LINKING_ONLY +# define XXH_STATIC_LINKING_ONLY /* XXH64_state_t */ +#endif #include "xxhash.h" /* XXH_reset, update, digest */ -#define ZSTD_TRACE 0 +#ifndef ZSTD_NO_TRACE +# include "zstd_trace.h" +#else +# define ZSTD_TRACE 0 +#endif +#if defined (__cplusplus) +extern "C" { +#endif /* ---- static assert (debug) --- */ #define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c) @@ -46,6 +56,7 @@ #undef MAX #define MIN(a,b) ((a)<(b) ? (a) : (b)) #define MAX(a,b) ((a)>(b) ? (a) : (b)) +#define BOUNDED(min,val,max) (MAX(min,MIN(val,max))) /*-************************************* @@ -54,7 +65,6 @@ #define ZSTD_OPT_NUM (1<<12) #define ZSTD_REP_NUM 3 /* number of repcodes */ -#define ZSTD_REP_MOVE (ZSTD_REP_NUM-1) static UNUSED_ATTR const U32 repStartValue[ZSTD_REP_NUM] = { 1, 4, 8 }; #define KB *(1 <<10) @@ -81,9 +91,9 @@ typedef enum { bt_raw, bt_rle, bt_compressed, bt_reserved } blockType_e; #define ZSTD_FRAMECHECKSUMSIZE 4 #define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */ -#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */ + MIN_SEQUENCES_SIZE /* nbSeq==0 */) /* for a non-null block */ +#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */) /* for a non-null block */ +#define MIN_LITERALS_FOR_4_STREAMS 6 -#define HufLog 12 typedef enum { set_basic, set_rle, set_compressed, set_repeat } symbolEncodingType_e; #define LONGNBSEQ 0x7F00 @@ -91,6 +101,7 @@ typedef enum { set_basic, set_rle, set_compressed, set_repeat } symbolEncodingTy #define MINMATCH 3 #define Litbits 8 +#define LitHufLog 11 #define MaxLit ((1<<Litbits) - 1) #define MaxML 52 #define MaxLL 35 @@ -101,12 +112,14 @@ typedef enum { set_basic, set_rle, set_compressed, set_repeat } symbolEncodingTy #define LLFSELog 9 #define OffFSELog 8 #define MaxFSELog MAX(MAX(MLFSELog, LLFSELog), OffFSELog) +#define MaxMLBits 16 +#define MaxLLBits 16 #define ZSTD_MAX_HUF_HEADER_SIZE 128 /* header + <= 127 byte tree description */ /* Each table cannot take more than #symbols * FSELog bits */ #define ZSTD_MAX_FSE_HEADERS_SIZE (((MaxML + 1) * MLFSELog + (MaxLL + 1) * LLFSELog + (MaxOff + 1) * OffFSELog + 7) / 8) -static UNUSED_ATTR const U32 LL_bits[MaxLL+1] = { +static UNUSED_ATTR const U8 LL_bits[MaxLL+1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, @@ -123,7 +136,7 @@ static UNUSED_ATTR const S16 LL_defaultNorm[MaxLL+1] = { #define LL_DEFAULTNORMLOG 6 /* for static allocation */ static UNUSED_ATTR const U32 LL_defaultNormLog = LL_DEFAULTNORMLOG; -static UNUSED_ATTR const U32 ML_bits[MaxML+1] = { +static UNUSED_ATTR const U8 ML_bits[MaxML+1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -164,16 +177,27 @@ static void ZSTD_copy8(void* dst, const void* src) { ZSTD_memcpy(dst, src, 8); #endif } +#define COPY8(d,s) do { ZSTD_copy8(d,s); d+=8; s+=8; } while (0) -#define COPY8(d,s) { ZSTD_copy8(d,s); d+=8; s+=8; } +/* Need to use memmove here since the literal buffer can now be located within + the dst buffer. In circumstances where the op "catches up" to where the + literal buffer is, there can be partial overlaps in this call on the final + copy if the literal is being shifted by less than 16 bytes. */ static void ZSTD_copy16(void* dst, const void* src) { #if defined(ZSTD_ARCH_ARM_NEON) vst1q_u8((uint8_t*)dst, vld1q_u8((const uint8_t*)src)); +#elif defined(ZSTD_ARCH_X86_SSE2) + _mm_storeu_si128((__m128i*)dst, _mm_loadu_si128((const __m128i*)src)); +#elif defined(__clang__) + ZSTD_memmove(dst, src, 16); #else - ZSTD_memcpy(dst, src, 16); + /* ZSTD_memmove is not inlined properly by gcc */ + BYTE copy16_buf[16]; + ZSTD_memcpy(copy16_buf, src, 16); + ZSTD_memcpy(dst, copy16_buf, 16); #endif } -#define COPY16(d,s) { ZSTD_copy16(d,s); d+=16; s+=16; } +#define COPY16(d,s) do { ZSTD_copy16(d,s); d+=16; s+=16; } while (0) #define WILDCOPY_OVERLENGTH 32 #define WILDCOPY_VECLEN 16 @@ -199,12 +223,10 @@ void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e BYTE* op = (BYTE*)dst; BYTE* const oend = op + length; - assert(diff >= 8 || (ovtype == ZSTD_no_overlap && diff <= -WILDCOPY_VECLEN)); - if (ovtype == ZSTD_overlap_src_before_dst && diff < WILDCOPY_VECLEN) { /* Handle short offset copies. */ do { - COPY8(op, ip) + COPY8(op, ip); } while (op < oend); } else { assert(diff >= WILDCOPY_VECLEN || diff <= -WILDCOPY_VECLEN); @@ -214,12 +236,6 @@ void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e * one COPY16() in the first call. Then, do two calls per loop since * at that point it is more likely to have a high trip count. */ -#ifdef __aarch64__ - do { - COPY16(op, ip); - } - while (op < oend); -#else ZSTD_copy16(op, ip); if (16 >= length) return; op += 16; @@ -229,7 +245,6 @@ void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e COPY16(op, ip); } while (op < oend); -#endif } } @@ -263,9 +278,9 @@ typedef enum { * Private declarations *********************************************/ typedef struct seqDef_s { - U32 offset; /* offset == rawOffset + ZSTD_REP_NUM, or equivalently, offCode + 1 */ + U32 offBase; /* offBase == Offset + ZSTD_REP_NUM, or repcode 1,2,3 */ U16 litLength; - U16 matchLength; + U16 mlBase; /* mlBase == matchLength - MINMATCH */ } seqDef; /* Controls whether seqStore has a single "long" litLength or matchLength. See seqStore_t. */ @@ -278,11 +293,11 @@ typedef enum { typedef struct { seqDef* sequencesStart; seqDef* sequences; /* ptr to end of sequences */ - BYTE* litStart; - BYTE* lit; /* ptr to end of literals */ - BYTE* llCode; - BYTE* mlCode; - BYTE* ofCode; + BYTE* litStart; + BYTE* lit; /* ptr to end of literals */ + BYTE* llCode; + BYTE* mlCode; + BYTE* ofCode; size_t maxNbSeq; size_t maxNbLit; @@ -290,8 +305,8 @@ typedef struct { * in the seqStore that has a value larger than U16 (if it exists). To do so, we increment * the existing value of the litLength or matchLength by 0x10000. */ - ZSTD_longLengthType_e longLengthType; - U32 longLengthPos; /* Index of the sequence to apply long length modification to */ + ZSTD_longLengthType_e longLengthType; + U32 longLengthPos; /* Index of the sequence to apply long length modification to */ } seqStore_t; typedef struct { @@ -307,13 +322,13 @@ MEM_STATIC ZSTD_sequenceLength ZSTD_getSequenceLength(seqStore_t const* seqStore { ZSTD_sequenceLength seqLen; seqLen.litLength = seq->litLength; - seqLen.matchLength = seq->matchLength + MINMATCH; + seqLen.matchLength = seq->mlBase + MINMATCH; if (seqStore->longLengthPos == (U32)(seq - seqStore->sequencesStart)) { if (seqStore->longLengthType == ZSTD_llt_literalLength) { - seqLen.litLength += 0xFFFF; + seqLen.litLength += 0x10000; } if (seqStore->longLengthType == ZSTD_llt_matchLength) { - seqLen.matchLength += 0xFFFF; + seqLen.matchLength += 0x10000; } } return seqLen; @@ -326,85 +341,13 @@ MEM_STATIC ZSTD_sequenceLength ZSTD_getSequenceLength(seqStore_t const* seqStore * `decompressedBound != ZSTD_CONTENTSIZE_ERROR` */ typedef struct { + size_t nbBlocks; size_t compressedSize; unsigned long long decompressedBound; } ZSTD_frameSizeInfo; /* decompress & legacy */ const seqStore_t* ZSTD_getSeqStore(const ZSTD_CCtx* ctx); /* compress & dictBuilder */ -void ZSTD_seqToCodes(const seqStore_t* seqStorePtr); /* compress, dictBuilder, decodeCorpus (shouldn't get its definition from here) */ - -MEM_STATIC U32 ZSTD_highbit32(U32 val) /* compress, dictBuilder, decodeCorpus */ -{ - assert(val != 0); - { -# if defined(_MSC_VER) /* Visual */ -# if STATIC_BMI2 == 1 - return _lzcnt_u32(val)^31; -# else - unsigned long r=0; - return _BitScanReverse(&r, val) ? (unsigned)r : 0; -# endif -# elif defined(__GNUC__) && (__GNUC__ >= 3) /* GCC Intrinsic */ - return __builtin_clz (val) ^ 31; -# elif defined(__ICCARM__) /* IAR Intrinsic */ - return 31 - __CLZ(val); -# else /* Software version */ - static const U32 DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 }; - U32 v = val; - v |= v >> 1; - v |= v >> 2; - v |= v >> 4; - v |= v >> 8; - v |= v >> 16; - return DeBruijnClz[(v * 0x07C4ACDDU) >> 27]; -# endif - } -} - -/** - * Computes CTZ on a U64. - * This will be slow on 32-bit mode, and on unsupported compilers. - * If you need this function to be fast (because it is hot) expand - * support. - */ -MEM_STATIC unsigned ZSTD_countTrailingZeros(size_t val) -{ - if (MEM_64bits()) { -# if defined(_MSC_VER) && defined(_WIN64) -# if STATIC_BMI2 - return _tzcnt_u64(val); -# else - unsigned long r = 0; - return _BitScanForward64( &r, (U64)val ) ? (unsigned)(r >> 3) : 0; -# endif -# elif defined(__GNUC__) && (__GNUC__ >= 4) - return __builtin_ctzll((U64)val); -# else - static const int DeBruijnBytePos[64] = { 0, 1, 2, 7, 3, 13, 8, 19, - 4, 25, 14, 28, 9, 34, 20, 56, - 5, 17, 26, 54, 15, 41, 29, 43, - 10, 31, 38, 35, 21, 45, 49, 57, - 63, 6, 12, 18, 24, 27, 33, 55, - 16, 53, 40, 42, 30, 37, 44, 48, - 62, 11, 23, 32, 52, 39, 36, 47, - 61, 22, 51, 46, 60, 50, 59, 58 }; - return DeBruijnBytePos[((U64)((val & -(long long)val) * 0x0218A392CDABBD3FULL)) >> 58]; -# endif - } else { /* 32 bits */ -# if defined(_MSC_VER) - unsigned long r=0; - return _BitScanForward( &r, (U32)val ) ? (unsigned)(r >> 3) : 0; -# elif defined(__GNUC__) && (__GNUC__ >= 3) - return (__builtin_ctz((U32)val) >> 3); -# else - static const int DeBruijnBytePos[32] = { 0, 1, 28, 2, 29, 14, 24, 3, - 30, 22, 20, 15, 25, 17, 4, 8, - 31, 27, 13, 23, 21, 19, 16, 7, - 26, 12, 18, 6, 11, 5, 10, 9 }; - return DeBruijnBytePos[((U32)((val & -(S32)val) * 0x077CB531U)) >> 27]; -# endif - } -} +int ZSTD_seqToCodes(const seqStore_t* seqStorePtr); /* compress, dictBuilder, decodeCorpus (shouldn't get its definition from here) */ /* ZSTD_invalidateRepCodes() : @@ -422,28 +365,27 @@ typedef struct { /*! ZSTD_getcBlockSize() : * Provides the size of compressed block from block header `src` */ -/* Used by: decompress, fullbench (does not get its definition from here) */ +/* Used by: decompress, fullbench */ size_t ZSTD_getcBlockSize(const void* src, size_t srcSize, blockProperties_t* bpPtr); /*! ZSTD_decodeSeqHeaders() : * decode sequence header from src */ -/* Used by: decompress, fullbench (does not get its definition from here) */ +/* Used by: zstd_decompress_block, fullbench */ size_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr, const void* src, size_t srcSize); -/* - * Custom memory allocation functions +/** + * @returns true iff the CPU supports dynamic BMI2 dispatch. */ -typedef struct { void* customAlloc; void* customFree; void* opaque; } ZSTD_customMem; -extern ZSTD_customMem ZSTD_defaultCMem; -static inline void* ZSTD_customMalloc(size_t size, ZSTD_customMem customMem) { - (void)customMem; - return malloc(size); -} -static inline void ZSTD_customFree(void* ptr, ZSTD_customMem customMem) { - (void)customMem; - free(ptr); +MEM_STATIC int ZSTD_cpuSupportsBmi2(void) +{ + ZSTD_cpuid_t cpuid = ZSTD_cpuid(); + return ZSTD_cpuid_bmi1(cpuid) && ZSTD_cpuid_bmi2(cpuid); } +#if defined (__cplusplus) +} +#endif + #endif /* ZSTD_CCOMMON_H_MODULE */ diff --git a/src/bled/zstd_mem.h b/src/bled/zstd_mem.h index b5d15f1a..5e94d813 100644 --- a/src/bled/zstd_mem.h +++ b/src/bled/zstd_mem.h @@ -1,5 +1,5 @@ /* - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the @@ -11,13 +11,15 @@ #ifndef MEM_H_MODULE #define MEM_H_MODULE +#if defined (__cplusplus) +extern "C" { +#endif /*-**************************************** * Dependencies ******************************************/ #include <stddef.h> /* size_t, ptrdiff_t */ #include "zstd_compiler.h" /* __has_builtin */ -//#include "debug.h" /* DEBUG_STATIC_ASSERT */ #include "zstd_deps.h" /* ZSTD_memcpy */ @@ -27,6 +29,8 @@ #if defined(_MSC_VER) /* Visual Studio */ # include <stdlib.h> /* _byteswap_ulong */ # include <intrin.h> /* _byteswap_* */ +#elif defined(__ICCARM__) +# include <intrinsics.h> #endif /*-************************************************************** @@ -39,6 +43,8 @@ # include <stdint.h> /* intptr_t */ # endif typedef uint8_t BYTE; + typedef uint8_t U8; + typedef int8_t S8; typedef uint16_t U16; typedef int16_t S16; typedef uint32_t U32; @@ -51,6 +57,8 @@ # error "this implementation requires char to be exactly 8-bit type" #endif typedef unsigned char BYTE; + typedef unsigned char U8; + typedef signed char S8; #if USHRT_MAX != 65535 # error "this implementation requires short to be exactly 16-bit type" #endif @@ -117,21 +125,15 @@ MEM_STATIC size_t MEM_swapST(size_t in); /*-************************************************************** * Memory I/O Implementation *****************************************************************/ -/* MEM_FORCE_MEMORY_ACCESS : - * By default, access to unaligned memory is controlled by `memcpy()`, which is safe and portable. - * Unfortunately, on some target/compiler combinations, the generated assembly is sub-optimal. - * The below switch allow to select different access method for improved performance. - * Method 0 (default) : use `memcpy()`. Safe and portable. - * Method 1 : `__packed` statement. It depends on compiler extension (i.e., not portable). - * This method is safe if your compiler supports it, and *generally* as fast or faster than `memcpy`. +/* MEM_FORCE_MEMORY_ACCESS : For accessing unaligned memory: + * Method 0 : always use `memcpy()`. Safe and portable. + * Method 1 : Use compiler extension to set unaligned access. * Method 2 : direct access. This method is portable but violate C standard. * It can generate buggy code on targets depending on alignment. - * In some circumstances, it's the only known way to get the most performance (i.e. GCC + ARMv6) - * See http://fastcompression.blogspot.fr/2015/08/accessing-unaligned-memory.html for details. - * Prefer these methods in priority order (0 > 1 > 2) + * Default : method 1 if supported, else method 0 */ #ifndef MEM_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */ -# if defined(__INTEL_COMPILER) || defined(__GNUC__) || defined(__ICCARM__) +# ifdef __GNUC__ # define MEM_FORCE_MEMORY_ACCESS 1 # endif #endif @@ -153,6 +155,8 @@ MEM_STATIC unsigned MEM_isLittleEndian(void) return 1; #elif defined(__DMC__) && defined(_M_IX86) return 1; +#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__ + return 1; #else const union { U32 u; BYTE c[4]; } one = { 1 }; /* don't use static : performance detrimental */ return one.c[0]; @@ -174,30 +178,19 @@ MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(U64*)memPtr = value; } #elif defined(MEM_FORCE_MEMORY_ACCESS) && (MEM_FORCE_MEMORY_ACCESS==1) -/* __pack instructions are safer, but compiler specific, hence potentially problematic for some compilers */ -/* currently only defined for gcc and icc */ -#if defined(_MSC_VER) || (defined(__INTEL_COMPILER) && defined(WIN32)) - __pragma( pack(push, 1) ) - typedef struct { U16 v; } unalign16; - typedef struct { U32 v; } unalign32; - typedef struct { U64 v; } unalign64; - typedef struct { size_t v; } unalignArch; - __pragma( pack(pop) ) -#else - typedef struct { U16 v; } __attribute__((packed)) unalign16; - typedef struct { U32 v; } __attribute__((packed)) unalign32; - typedef struct { U64 v; } __attribute__((packed)) unalign64; - typedef struct { size_t v; } __attribute__((packed)) unalignArch; -#endif +typedef __attribute__((aligned(1))) U16 unalign16; +typedef __attribute__((aligned(1))) U32 unalign32; +typedef __attribute__((aligned(1))) U64 unalign64; +typedef __attribute__((aligned(1))) size_t unalignArch; -MEM_STATIC U16 MEM_read16(const void* ptr) { return ((const unalign16*)ptr)->v; } -MEM_STATIC U32 MEM_read32(const void* ptr) { return ((const unalign32*)ptr)->v; } -MEM_STATIC U64 MEM_read64(const void* ptr) { return ((const unalign64*)ptr)->v; } -MEM_STATIC size_t MEM_readST(const void* ptr) { return ((const unalignArch*)ptr)->v; } +MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; } +MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; } +MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; } +MEM_STATIC size_t MEM_readST(const void* ptr) { return *(const unalignArch*)ptr; } -MEM_STATIC void MEM_write16(void* memPtr, U16 value) { ((unalign16*)memPtr)->v = value; } -MEM_STATIC void MEM_write32(void* memPtr, U32 value) { ((unalign32*)memPtr)->v = value; } -MEM_STATIC void MEM_write64(void* memPtr, U64 value) { ((unalign64*)memPtr)->v = value; } +MEM_STATIC void MEM_write16(void* memPtr, U16 value) { *(unalign16*)memPtr = value; } +MEM_STATIC void MEM_write32(void* memPtr, U32 value) { *(unalign32*)memPtr = value; } +MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; } #else @@ -241,6 +234,14 @@ MEM_STATIC void MEM_write64(void* memPtr, U64 value) #endif /* MEM_FORCE_MEMORY_ACCESS */ +MEM_STATIC U32 MEM_swap32_fallback(U32 in) +{ + return ((in << 24) & 0xff000000 ) | + ((in << 8) & 0x00ff0000 ) | + ((in >> 8) & 0x0000ff00 ) | + ((in >> 24) & 0x000000ff ); +} + MEM_STATIC U32 MEM_swap32(U32 in) { #if defined(_MSC_VER) /* Visual Studio */ @@ -248,14 +249,25 @@ MEM_STATIC U32 MEM_swap32(U32 in) #elif (defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)) \ || (defined(__clang__) && __has_builtin(__builtin_bswap32)) return __builtin_bswap32(in); +#elif defined(__ICCARM__) + return __REV(in); #else - return ((in << 24) & 0xff000000 ) | - ((in << 8) & 0x00ff0000 ) | - ((in >> 8) & 0x0000ff00 ) | - ((in >> 24) & 0x000000ff ); + return MEM_swap32_fallback(in); #endif } +MEM_STATIC U64 MEM_swap64_fallback(U64 in) +{ + return ((in << 56) & 0xff00000000000000ULL) | + ((in << 40) & 0x00ff000000000000ULL) | + ((in << 24) & 0x0000ff0000000000ULL) | + ((in << 8) & 0x000000ff00000000ULL) | + ((in >> 8) & 0x00000000ff000000ULL) | + ((in >> 24) & 0x0000000000ff0000ULL) | + ((in >> 40) & 0x000000000000ff00ULL) | + ((in >> 56) & 0x00000000000000ffULL); +} + MEM_STATIC U64 MEM_swap64(U64 in) { #if defined(_MSC_VER) /* Visual Studio */ @@ -264,14 +276,7 @@ MEM_STATIC U64 MEM_swap64(U64 in) || (defined(__clang__) && __has_builtin(__builtin_bswap64)) return __builtin_bswap64(in); #else - return ((in << 56) & 0xff00000000000000ULL) | - ((in << 40) & 0x00ff000000000000ULL) | - ((in << 24) & 0x0000ff0000000000ULL) | - ((in << 8) & 0x000000ff00000000ULL) | - ((in >> 8) & 0x00000000ff000000ULL) | - ((in >> 24) & 0x0000000000ff0000ULL) | - ((in >> 40) & 0x000000000000ff00ULL) | - ((in >> 56) & 0x00000000000000ffULL); + return MEM_swap64_fallback(in); #endif } @@ -418,6 +423,8 @@ MEM_STATIC void MEM_writeBEST(void* memPtr, size_t val) /* code only tested on 32 and 64 bits systems */ MEM_STATIC void MEM_check(void) { DEBUG_STATIC_ASSERT((sizeof(size_t)==4) || (sizeof(size_t)==8)); } - +#if defined (__cplusplus) +} +#endif #endif /* MEM_H_MODULE */ diff --git a/src/rufus.rc b/src/rufus.rc index 59fd437a..da4048bd 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.7.2211" +CAPTION "Rufus 4.7.2212" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2211,0 - PRODUCTVERSION 4,7,2211,0 + FILEVERSION 4,7,2212,0 + PRODUCTVERSION 4,7,2212,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2211" + VALUE "FileVersion", "4.7.2212" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2211" + VALUE "ProductVersion", "4.7.2212" END END BLOCK "VarFileInfo" From 79f1209ab9abc15ae40994799db921db91a3c031 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 2 Dec 2024 19:04:51 +0000 Subject: [PATCH 022/192] [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. --- .vs/rufus.vcxproj | 2 - .vs/rufus.vcxproj.filters | 6 -- src/Makefile.am | 2 +- src/Makefile.in | 19 ++--- src/bled/header_verbose_list.c | 9 ++- src/bled/libbb.h | 1 - src/cpu.c | 123 --------------------------------- src/cpu.h | 79 --------------------- src/hash.c | 87 ++++++++++++++++++++--- src/iso.c | 4 +- src/missing.h | 5 +- src/net.c | 11 ++- src/parser.c | 3 +- src/rufus.c | 8 +-- src/rufus.h | 12 ++-- src/rufus.rc | 10 +-- 16 files changed, 121 insertions(+), 260 deletions(-) delete mode 100644 src/cpu.c delete mode 100644 src/cpu.h diff --git a/.vs/rufus.vcxproj b/.vs/rufus.vcxproj index 8c9b40f9..befb03f5 100644 --- a/.vs/rufus.vcxproj +++ b/.vs/rufus.vcxproj @@ -381,7 +381,6 @@ </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\src\badblocks.c" /> - <ClCompile Include="..\src\cpu.c" /> <ClCompile Include="..\src\dos_locale.c" /> <ClCompile Include="..\src\drive.c" /> <ClCompile Include="..\src\format.c" /> @@ -413,7 +412,6 @@ <ClInclude Include="..\res\grub\grub_version.h" /> <ClInclude Include="..\src\badblocks.h" /> <ClInclude Include="..\src\bled\bled.h" /> - <ClInclude Include="..\src\cpu.h" /> <ClInclude Include="..\src\drive.h" /> <ClInclude Include="..\src\format.h" /> <ClInclude Include="..\src\gpt_types.h" /> diff --git a/.vs/rufus.vcxproj.filters b/.vs/rufus.vcxproj.filters index fa818f9a..90e4a67b 100644 --- a/.vs/rufus.vcxproj.filters +++ b/.vs/rufus.vcxproj.filters @@ -93,9 +93,6 @@ <ClCompile Include="..\src\wue.c"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="..\src\cpu.c"> - <Filter>Source Files</Filter> - </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\src\rufus.h"> @@ -194,9 +191,6 @@ <ClInclude Include="..\src\vhd.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\src\cpu.h"> - <Filter>Header Files</Filter> - </ClInclude> </ItemGroup> <ItemGroup> <None Include="..\res\rufus.ico"> diff --git a/src/Makefile.am b/src/Makefile.am index 6d3dc08a..f9416588 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -17,7 +17,7 @@ AM_V_WINDRES = $(AM_V_WINDRES_$(V)) %_rc.o: %.rc ../res/loc/embedded.loc $(AM_V_WINDRES) $(AM_RCFLAGS) -i $< -o $@ -rufus_SOURCES = badblocks.c cpu.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ +rufus_SOURCES = badblocks.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio $(AM_CFLAGS) \ -DEXT2_FLAT_INCLUDES=0 -DSOLUTION=rufus diff --git a/src/Makefile.in b/src/Makefile.in index 003ffb8e..1b3d4e3c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -87,12 +87,11 @@ mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) -am_rufus_OBJECTS = rufus-badblocks.$(OBJEXT) rufus-cpu.$(OBJEXT) \ - rufus-dev.$(OBJEXT) rufus-dos.$(OBJEXT) \ - rufus-dos_locale.$(OBJEXT) rufus-drive.$(OBJEXT) \ - rufus-format.$(OBJEXT) rufus-format_ext.$(OBJEXT) \ - rufus-format_fat32.$(OBJEXT) rufus-hash.$(OBJEXT) \ - rufus-icon.$(OBJEXT) rufus-iso.$(OBJEXT) \ +am_rufus_OBJECTS = rufus-badblocks.$(OBJEXT) rufus-dev.$(OBJEXT) \ + rufus-dos.$(OBJEXT) rufus-dos_locale.$(OBJEXT) \ + rufus-drive.$(OBJEXT) rufus-format.$(OBJEXT) \ + rufus-format_ext.$(OBJEXT) rufus-format_fat32.$(OBJEXT) \ + rufus-hash.$(OBJEXT) rufus-icon.$(OBJEXT) rufus-iso.$(OBJEXT) \ rufus-localization.$(OBJEXT) rufus-net.$(OBJEXT) \ rufus-parser.$(OBJEXT) rufus-pki.$(OBJEXT) \ rufus-process.$(OBJEXT) rufus-re.$(OBJEXT) \ @@ -285,7 +284,7 @@ AM_V_WINDRES_0 = @echo " RC $@";$(WINDRES) AM_V_WINDRES_1 = $(WINDRES) AM_V_WINDRES_ = $(AM_V_WINDRES_$(AM_DEFAULT_VERBOSITY)) AM_V_WINDRES = $(AM_V_WINDRES_$(V)) -rufus_SOURCES = badblocks.c cpu.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ +rufus_SOURCES = badblocks.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio $(AM_CFLAGS) \ @@ -355,12 +354,6 @@ rufus-badblocks.o: badblocks.c rufus-badblocks.obj: badblocks.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-badblocks.obj `if test -f 'badblocks.c'; then $(CYGPATH_W) 'badblocks.c'; else $(CYGPATH_W) '$(srcdir)/badblocks.c'; fi` -rufus-cpu.o: cpu.c - $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-cpu.o `test -f 'cpu.c' || echo '$(srcdir)/'`cpu.c - -rufus-cpu.obj: cpu.c - $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-cpu.obj `if test -f 'cpu.c'; then $(CYGPATH_W) 'cpu.c'; else $(CYGPATH_W) '$(srcdir)/cpu.c'; fi` - rufus-dev.o: dev.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-dev.o `test -f 'dev.c' || echo '$(srcdir)/'`dev.c diff --git a/src/bled/header_verbose_list.c b/src/bled/header_verbose_list.c index a575a08a..74b97f95 100644 --- a/src/bled/header_verbose_list.c +++ b/src/bled/header_verbose_list.c @@ -9,7 +9,6 @@ void FAST_FUNC header_verbose_list(const file_header_t *file_header) { struct tm tm_time; struct tm *ptm = &tm_time; //localtime(&file_header->mtime); - char modestr[12]; #if ENABLE_FEATURE_TAR_UNAME_GNAME char uid[sizeof(int)*3 + 2]; @@ -29,8 +28,8 @@ void FAST_FUNC header_verbose_list(const file_header_t *file_header) /*sprintf(gid, "%u", (unsigned)file_header->gid);*/ group = utoa(file_header->gid); } - printf("%s %s/%s %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s", - bb_mode_string(modestr, file_header->mode), + printf("%u %s/%s %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s", + file_header->mode, user, group, file_header->size, @@ -46,8 +45,8 @@ void FAST_FUNC header_verbose_list(const file_header_t *file_header) localtime_r(&file_header->mtime, ptm); - printf("%s %u/%u %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s", - bb_mode_string(modestr, file_header->mode), + printf("%u %u/%u %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s", + file_header->mode, (unsigned)file_header->uid, (unsigned)file_header->gid, file_header->size, diff --git a/src/bled/libbb.h b/src/bled/libbb.h index 94ae9dd4..f1cf7d6e 100644 --- a/src/bled/libbb.h +++ b/src/bled/libbb.h @@ -180,7 +180,6 @@ static inline void *xrealloc(void *ptr, size_t size) { #define bb_msg_read_error "read error" #define bb_msg_write_error "write error" -#define bb_mode_string(str, mode) str #define bb_make_directory(path, mode, flags) SHCreateDirectoryExU(NULL, path, NULL) static inline int link(const char *oldpath, const char *newpath) { errno = ENOSYS; return -1; } diff --git a/src/cpu.c b/src/cpu.c deleted file mode 100644 index 11f84915..00000000 --- a/src/cpu.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Rufus: The Reliable USB Formatting Utility - * CPU features detection - * Copyright © 2022 Pete Batard <pete@akeo.ie> - * Copyright © 2022 Jeffrey Walton <noloader@gmail.com> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "cpu.h" - -#if (defined(CPU_X86_SHA1_ACCELERATION) || defined(CPU_X86_SHA256_ACCELERATION)) -#if defined(RUFUS_MSC_VERSION) -#include <intrin.h> -#elif (defined(RUFUS_GCC_VERSION) || defined(RUFUS_CLANG_VERSION)) -#include <x86Intrin.h> -#elif defined(RUFUS_INTEL_VERSION) -#include <immintrin.h> -#endif -#endif - -BOOL cpu_has_sha1_accel = FALSE; -BOOL cpu_has_sha256_accel = FALSE; - -/* - * Three elements must be in place to make a meaningful call to the - * DetectSHA###Acceleration() calls. First, the compiler must support - * the underlying intrinsics. Second, the platform must provide a - * cpuid() function. And third, the cpu must actually support the SHA-1 - * and SHA-256 instructions. - * - * If any of the conditions are not met, then DetectSHA###Acceleration() - * returns FALSE. - */ - -/* - * Detect if the processor supports SHA-1 acceleration. We only check for - * the three ISAs we need - SSSE3, SSE4.1 and SHA. We don't check for OS - * support or XSAVE because that's been enabled since Windows 2000. - */ -BOOL DetectSHA1Acceleration(void) -{ -#if defined(CPU_X86_SHA1_ACCELERATION) -#if defined(_MSC_VER) - uint32_t regs0[4] = {0,0,0,0}, regs1[4] = {0,0,0,0}, regs7[4] = {0,0,0,0}; - const uint32_t SSSE3_BIT = 1u << 9; /* Function 1, Bit 9 of ECX */ - const uint32_t SSE41_BIT = 1u << 19; /* Function 1, Bit 19 of ECX */ - const uint32_t SHA_BIT = 1u << 29; /* Function 7, Bit 29 of EBX */ - - __cpuid(regs0, 0); - const uint32_t highest = regs0[0]; /*EAX*/ - - if (highest >= 0x01) { - __cpuidex(regs1, 1, 0); - } - if (highest >= 0x07) { - __cpuidex(regs7, 7, 0); - } - - return (regs1[2] /*ECX*/ & SSSE3_BIT) && (regs1[2] /*ECX*/ & SSE41_BIT) && (regs7[1] /*EBX*/ & SHA_BIT) ? TRUE : FALSE; -#elif defined(__GNUC__) || defined(__clang__) - /* __builtin_cpu_supports available in GCC 4.8.1 and above */ - return __builtin_cpu_supports("ssse3") && __builtin_cpu_supports("sse4.1") && __builtin_cpu_supports("sha") ? TRUE : FALSE; -#elif defined(__INTEL_COMPILER) - /* https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_may_i_use_cpu_feature */ - return _may_i_use_cpu_feature(_FEATURE_SSSE3|_FEATURE_SSE4_1|_FEATURE_SHA) ? TRUE : FALSE; -#else - return FALSE; -#endif -#else - return FALSE; -#endif -} - -/* - * Detect if the processor supports SHA-256 acceleration. We only check for - * the three ISAs we need - SSSE3, SSE4.1 and SHA. We don't check for OS - * support or XSAVE because that's been enabled since Windows 2000. - */ -BOOL DetectSHA256Acceleration(void) -{ -#if defined(CPU_X86_SHA256_ACCELERATION) -#if defined(_MSC_VER) - uint32_t regs0[4] = {0,0,0,0}, regs1[4] = {0,0,0,0}, regs7[4] = {0,0,0,0}; - const uint32_t SSSE3_BIT = 1u << 9; /* Function 1, Bit 9 of ECX */ - const uint32_t SSE41_BIT = 1u << 19; /* Function 1, Bit 19 of ECX */ - const uint32_t SHA_BIT = 1u << 29; /* Function 7, Bit 29 of EBX */ - - __cpuid(regs0, 0); - const uint32_t highest = regs0[0]; /*EAX*/ - - if (highest >= 0x01) { - __cpuidex(regs1, 1, 0); - } - if (highest >= 0x07) { - __cpuidex(regs7, 7, 0); - } - - return (regs1[2] /*ECX*/ & SSSE3_BIT) && (regs1[2] /*ECX*/ & SSE41_BIT) && (regs7[1] /*EBX*/ & SHA_BIT) ? TRUE : FALSE; -#elif defined(__GNUC__) || defined(__clang__) - /* __builtin_cpu_supports available in GCC 4.8.1 and above */ - return __builtin_cpu_supports("ssse3") && __builtin_cpu_supports("sse4.1") && __builtin_cpu_supports("sha") ? TRUE : FALSE; -#elif defined(__INTEL_COMPILER) - /* https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_may_i_use_cpu_feature */ - return _may_i_use_cpu_feature(_FEATURE_SSSE3|_FEATURE_SSE4_1|_FEATURE_SHA) ? TRUE : FALSE; -#else - return FALSE; -#endif -#else - return FALSE; -#endif -} diff --git a/src/cpu.h b/src/cpu.h deleted file mode 100644 index 077f19fd..00000000 --- a/src/cpu.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Rufus: The Reliable USB Formatting Utility - * CPU features detection - * Copyright © 2022 Pete Batard <pete@akeo.ie> - * Copyright © 2022 Jeffrey Walton <noloader@gmail.com> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -/* - * Primarily added to support SHA instructions on x86 machines. - * SHA acceleration is becoming as ubiquitous as AES acceleration. - * SHA support was introduced in Intel Goldmont architecture, like - * Celeron J3455 and Pentium J4205. The instructions are now present - * in AMD Ryzen 3 (Zen architecture) and above, and Intel Core - * 10th-gen processors (Ice Lake), 11th-gen processors (Rocket Lake) - * and above. - * - * Typical benchmarks for x86 SHA acceleration is about a 6x to 10x - * speedup over a C/C++ implementation. The rough measurements are - * 1.0 to 1.8 cpb for SHA-1, and 1.5 to 2.5 cpb for SHA-256. On a - * Celeron J3455, that's 1.1 GB/s for SHA-1 and 800 MB/s for SHA-256. - * On a 10th-gen Core i5, that's about 1.65 GB/s for SHA-1 and about - * 1.3 GB/s for SHA-256. - */ - -#include "rufus.h" - -#pragma once - -#ifdef _MSC_VER -#define RUFUS_MSC_VERSION (_MSC_VER) -#if (RUFUS_MSC_VERSION < 1900) -#error "Your compiler is too old to build this application" -#endif -#endif - -#if defined(__GNUC__) -#define RUFUS_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) -#if (RUFUS_GCC_VERSION < 40900) -#error "Your compiler is too old to build this application" -#endif -#endif - -#ifdef __INTEL_COMPILER -#define RUFUS_INTEL_VERSION (__INTEL_COMPILER) -#if (RUFUS_INTEL_VERSION < 1600) -#error "Your compiler is too old to build this application" -#endif -#endif - -#if defined(__clang__) -#define RUFUS_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) -#if (RUFUS_CLANG_VERSION < 30400) -#error "Your compiler is too old to build this application" -#endif -#endif - -#if (defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__i386) || \ - defined(_X86_) || defined(__I86__) || defined(__x86_64__)) -#define CPU_X86_SHA1_ACCELERATION 1 -#define CPU_X86_SHA256_ACCELERATION 1 -#endif - -extern BOOL cpu_has_sha1_accel, cpu_has_sha256_accel; - -extern BOOL DetectSHA1Acceleration(void); -extern BOOL DetectSHA256Acceleration(void); diff --git a/src/hash.c b/src/hash.c index 88ffca31..74e4e99a 100644 --- a/src/hash.c +++ b/src/hash.c @@ -65,11 +65,11 @@ #include <string.h> #include <inttypes.h> #include <errno.h> +#include <intrin.h> #include <windows.h> #include <windowsx.h> #include "db.h" -#include "cpu.h" #include "rufus.h" #include "winio.h" #include "missing.h" @@ -77,14 +77,10 @@ #include "msapi_utf8.h" #include "localization.h" -/* Includes for SHA-1 and SHA-256 intrinsics */ -#if defined(CPU_X86_SHA1_ACCELERATION) || defined(CPU_X86_SHA256_ACCELERATION) -#if defined(_MSC_VER) -#include <immintrin.h> -#elif defined(__GNUC__) -#include <stdint.h> -#include <x86intrin.h> -#endif +#if (defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__i386) || \ + defined(_X86_) || defined(__I86__) || defined(__x86_64__)) +#define CPU_X86_SHA1_ACCELERATION 1 +#define CPU_X86_SHA256_ACCELERATION 1 #endif #if defined(_MSC_VER) @@ -107,6 +103,7 @@ char hash_str[HASH_MAX][150]; HANDLE data_ready[HASH_MAX] = { 0 }, thread_ready[HASH_MAX] = { 0 }; DWORD read_size[NUM_BUFFERS]; BOOL enable_extra_hashes = FALSE, validate_md5sum = FALSE; +BOOL cpu_has_sha1_accel = FALSE, cpu_has_sha256_accel = FALSE; uint8_t ALIGNED(64) buffer[NUM_BUFFERS][BUFFER_SIZE]; uint8_t* pe256ssp = NULL; uint32_t proc_bufnum, hash_count[HASH_MAX] = { MD5_HASHSIZE, SHA1_HASHSIZE, SHA256_HASHSIZE, SHA512_HASHSIZE }; @@ -119,6 +116,78 @@ extern const char* efi_archname[ARCH_MAX]; extern char* sbat_level_txt; extern BOOL expert_mode, usb_debug; +/* + * Detect if the processor supports SHA-1 acceleration. We only check for + * the three ISAs we need - SSSE3, SSE4.1 and SHA. We don't check for OS + * support or XSAVE because that's been enabled since Windows 2000. + */ +BOOL DetectSHA1Acceleration(void) +{ +#if defined(CPU_X86_SHA1_ACCELERATION) +#if defined(_MSC_VER) + uint32_t regs0[4] = { 0,0,0,0 }, regs1[4] = { 0,0,0,0 }, regs7[4] = { 0,0,0,0 }; + const uint32_t SSSE3_BIT = 1u << 9; /* Function 1, Bit 9 of ECX */ + const uint32_t SSE41_BIT = 1u << 19; /* Function 1, Bit 19 of ECX */ + const uint32_t SHA_BIT = 1u << 29; /* Function 7, Bit 29 of EBX */ + + __cpuid(regs0, 0); + const uint32_t highest = regs0[0]; /*EAX*/ + + if (highest >= 0x01) { + __cpuidex(regs1, 1, 0); + } + if (highest >= 0x07) { + __cpuidex(regs7, 7, 0); + } + + return (regs1[2] /*ECX*/ & SSSE3_BIT) && (regs1[2] /*ECX*/ & SSE41_BIT) && (regs7[1] /*EBX*/ & SHA_BIT) ? TRUE : FALSE; +#elif defined(__GNUC__) || defined(__clang__) + /* __builtin_cpu_supports available in GCC 4.8.1 and above */ + return __builtin_cpu_supports("ssse3") && __builtin_cpu_supports("sse4.1") && __builtin_cpu_supports("sha") ? TRUE : FALSE; +#else + return FALSE; +#endif +#else + return FALSE; +#endif +} + +/* + * Detect if the processor supports SHA-256 acceleration. We only check for + * the three ISAs we need - SSSE3, SSE4.1 and SHA. We don't check for OS + * support or XSAVE because that's been enabled since Windows 2000. + */ +BOOL DetectSHA256Acceleration(void) +{ +#if defined(CPU_X86_SHA256_ACCELERATION) +#if defined(_MSC_VER) + uint32_t regs0[4] = { 0,0,0,0 }, regs1[4] = { 0,0,0,0 }, regs7[4] = { 0,0,0,0 }; + const uint32_t SSSE3_BIT = 1u << 9; /* Function 1, Bit 9 of ECX */ + const uint32_t SSE41_BIT = 1u << 19; /* Function 1, Bit 19 of ECX */ + const uint32_t SHA_BIT = 1u << 29; /* Function 7, Bit 29 of EBX */ + + __cpuid(regs0, 0); + const uint32_t highest = regs0[0]; /*EAX*/ + + if (highest >= 0x01) { + __cpuidex(regs1, 1, 0); + } + if (highest >= 0x07) { + __cpuidex(regs7, 7, 0); + } + + return (regs1[2] /*ECX*/ & SSSE3_BIT) && (regs1[2] /*ECX*/ & SSE41_BIT) && (regs7[1] /*EBX*/ & SHA_BIT) ? TRUE : FALSE; +#elif defined(__GNUC__) || defined(__clang__) + /* __builtin_cpu_supports available in GCC 4.8.1 and above */ + return __builtin_cpu_supports("ssse3") && __builtin_cpu_supports("sse4.1") && __builtin_cpu_supports("sha") ? TRUE : FALSE; +#else + return FALSE; +#endif +#else + return FALSE; +#endif +} + /* * Rotate 32 or 64 bit integers by n bytes. * Don't bother trying to hand-optimize those, as the diff --git a/src/iso.c b/src/iso.c index 66413656..66c7bf96 100644 --- a/src/iso.c +++ b/src/iso.c @@ -99,7 +99,7 @@ static const char* casper_dirname = "/casper"; static const char* proxmox_dirname = "/proxmox"; const char* efi_dirname = "/efi/boot"; const char* efi_bootname[3] = { "boot", "grub", "mm" }; -const char* efi_archname[ARCH_MAX] = { "", "ia32", "x64", "arm", "aa64", "ia64", "riscv64", "ebc" }; +const char* efi_archname[ARCH_MAX] = { "", "ia32", "x64", "arm", "aa64", "ia64", "riscv64", "loongarch64", "ebc" }; static const char* sources_str = "/sources"; static const char* wininst_name[] = { "install.wim", "install.esd", "install.swm" }; // We only support GRUB/BIOS (x86) that uses a standard config dir (/boot/grub/i386-pc/) @@ -1801,7 +1801,7 @@ BOOL HasEfiImgBootLoaders(void) for (i = 0; i < ARRAYSIZE(efi_archname); i++) { static_sprintf(bootloader_name, "boot%s.efi", efi_archname[i]); - // TODO: bootriscv###.efi will need LFN support but cross that bridge when/if we get there... + // TODO: bootriscv64.efi and bootloongarch64.efi need LFN support if (strlen(bootloader_name) > 12) continue; for (j = 0, k = 0; bootloader_name[j] != 0; j++) { diff --git a/src/missing.h b/src/missing.h index 3528f745..4bf4b387 100644 --- a/src/missing.h +++ b/src/missing.h @@ -18,6 +18,7 @@ */ #include <windows.h> +#include <intrin.h> #pragma once @@ -40,10 +41,10 @@ * line has already been fetched, or if the address is invalid. */ #if defined(__GNUC__) || defined(__clang__) -#define PREFETCH64(m) do { __builtin_prefetch(m, 0, 0); __builtin_prefetch(m+32, 0, 0); } while(0) +#define PREFETCH64(m) do { __builtin_prefetch((m), 0, 0); __builtin_prefetch((m) + 32, 0, 0); } while(0) #elif defined(_MSC_VER) #if defined(_M_IX86) || defined (_M_X64) -#define PREFETCH64(m) do { _m_prefetch(m); _m_prefetch(m+32); } while(0) +#define PREFETCH64(m) do { _m_prefetch((void*)(m)); _m_prefetch((void*)((m) + 32)); } while(0) #else // _m_prefetch() doesn't seem to exist for MSVC/ARM #define PREFETCH64(m) diff --git a/src/net.c b/src/net.c index f5fc8215..d19d0f93 100644 --- a/src/net.c +++ b/src/net.c @@ -60,6 +60,7 @@ HANDLE update_check_thread = NULL; extern loc_cmd* selected_locale; extern HANDLE dialog_handle; extern BOOL is_x86_64; +extern USHORT NativeMachine; static DWORD error_code, fido_len = 0; static BOOL force_update_check = FALSE; static const char* request_headers = "Accept-Encoding: gzip, deflate"; @@ -522,6 +523,9 @@ static DWORD WINAPI CheckForUpdatesThread(LPVOID param) #endif vuprintf("Using %s for the update check", RUFUS_URL); for (k = 0; (k < max_channel) && (!found_new_version); k++) { + // Get the arch name and convert it lowercase + char* archname = strdup(GetArchName(WindowsVersion.Arch)); + safe_strtolower(archname); // Free any previous buffers we might have used safe_free(buf); safe_free(sig); @@ -533,7 +537,8 @@ static DWORD WINAPI CheckForUpdatesThread(LPVOID param) // This allows sunsetting OS versions (eg XP) or providing different downloads for different archs/groups. // Note that for BETAs, we only catter for x64 regardless of the OS arch. static_sprintf(urlpath, "%s%s%s_win_%s_%lu.%lu.ver", APPLICATION_NAME, (k == 0) ? "": "_", - (k == 0) ? "" : channel[k], GetArchName(WindowsVersion.Arch), WindowsVersion.Major, WindowsVersion.Minor); + (k == 0) ? "" : channel[k], archname, WindowsVersion.Major, WindowsVersion.Minor); + safe_free(archname); vuprintf("Base update check: %s", urlpath); for (i = 0, j = (int)safe_strlen(urlpath) - 5; (j > 0) && (i < ARRAYSIZE(verpos)); j--) { if ((urlpath[j] == '.') || (urlpath[j] == '_')) { @@ -796,8 +801,8 @@ static DWORD WINAPI DownloadISOThread(LPVOID param) } static_sprintf(cmdline, "\"%s\" -NonInteractive -Sta -NoProfile –ExecutionPolicy Bypass " - "-File \"%s\" -PipeName %s -LocData \"%s\" -Icon \"%s\" -AppTitle \"%s\"", - powershell_path, script_path, &pipe[9], locale_str, icon_path, lmprintf(MSG_149)); + "-File \"%s\" -PipeName %s -LocData \"%s\" -Icon \"%s\" -AppTitle \"%s\" -PlatformArch \"%s\"", + powershell_path, script_path, &pipe[9], locale_str, icon_path, lmprintf(MSG_149), GetArchName(NativeMachine)); #ifndef RUFUS_TEST // For extra security, even after we validated that the LZMA download is properly diff --git a/src/parser.c b/src/parser.c index 4c582826..3d6a6a58 100644 --- a/src/parser.c +++ b/src/parser.c @@ -893,7 +893,7 @@ static __inline char* get_sanitized_token_data_buffer(const char* token, unsigne size_t i; char* data = get_token_data_buffer(token, n, buffer, buffer_size); if (data != NULL) { - for (i=0; i<strlen(data); i++) { + for (i = 0; i < strlen(data); i++) { if ((data[i] == '\\') && (data[i+1] == 'n')) { data[i] = '\r'; data[i+1] = '\n'; @@ -953,6 +953,7 @@ void parse_update(char* buf, size_t len) safe_free(data); } static_sprintf(download_url_name, "download_url_%s", GetArchName(WindowsVersion.Arch)); + safe_strtolower(download_url_name); update.download_url = get_sanitized_token_data_buffer(download_url_name, 1, buf, len); if (update.download_url == NULL) update.download_url = get_sanitized_token_data_buffer("download_url", 1, buf, len); diff --git a/src/rufus.c b/src/rufus.c index fa06a813..76f04c59 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -48,7 +48,6 @@ #include "ui.h" #include "re.h" -#include "cpu.h" #include "vhd.h" #include "wue.h" #include "drive.h" @@ -69,7 +68,7 @@ static const char* cmdline_hogger = ".\\rufus.com"; static const char* ep_reg = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer"; static const char* vs_reg = "Software\\Microsoft\\VisualStudio"; static const char* arch_name[ARCH_MAX] = { - "unknown", "x86_32", "x86_64", "ARM", "ARM64", "Itanic", "RISC-V 64", "EBC" }; + "unknown", "x86_32", "x86_64", "ARM", "ARM64", "IA64", "RISC-V 64", "LoongArch 64", "EBC" }; static BOOL existing_key = FALSE; // For LGP set/restore static BOOL size_check = TRUE; static BOOL log_displayed = FALSE; @@ -93,7 +92,7 @@ static char uppercase_select[2][64], uppercase_start[64], uppercase_close[64], u extern HANDLE update_check_thread, wim_thread; extern BOOL enable_iso, enable_joliet, enable_rockridge, enable_extra_hashes, is_bootloader_revoked; -extern BOOL validate_md5sum; +extern BOOL validate_md5sum, cpu_has_sha1_accel, cpu_has_sha256_accel; extern BYTE* fido_script; extern HWND hFidoDlg; extern uint8_t* grub2_buf; @@ -118,6 +117,7 @@ uint32_t dur_mins, dur_secs; loc_cmd* selected_locale = NULL; WORD selected_langid = MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT); DWORD MainThreadId; +USHORT NativeMachine = IMAGE_FILE_MACHINE_UNKNOWN; HWND hDeviceList, hPartitionScheme, hTargetSystem, hFileSystem, hClusterSize, hLabel, hBootType, hNBPasses, hLog = NULL; HWND hImageOption, hLogDialog = NULL, hProgress = NULL; HANDLE dialog_handle = NULL, format_thread = NULL; @@ -1963,7 +1963,7 @@ static void InitDialog(HWND hDlg) { DWORD len; HDC hDC; - USHORT ProcessMachine = IMAGE_FILE_MACHINE_UNKNOWN, NativeMachine = IMAGE_FILE_MACHINE_UNKNOWN; + USHORT ProcessMachine = IMAGE_FILE_MACHINE_UNKNOWN; int i, lfHeight; char tmp[128], *token, *buf, *ext, *msg; static char* resource[2] = { MAKEINTRESOURCEA(IDR_SL_LDLINUX_V4_SYS), MAKEINTRESOURCEA(IDR_SL_LDLINUX_V6_SYS) }; diff --git a/src/rufus.h b/src/rufus.h index 540a1bd7..18839db3 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -183,6 +183,7 @@ static __inline void safe_strcp(char* dst, const size_t dst_max, const char* src #else #define safe_vsnprintf vsnprintf #endif +#define safe_strtolower(str) do { if (str != NULL) CharLowerA(str); } while(0) static __inline void static_repchr(char* p, char s, char r) { if (p != NULL) while (*p != 0) { if (*p == s) *p = r; p++; } } @@ -377,7 +378,7 @@ typedef struct { uint16_t revision; } winver_t; -/* We can't use the Microsoft enums as we want to have RISC-V */ +/* We can't use the Microsoft enums as we want to have RISC-V and LoongArch */ enum ArchType { ARCH_UNKNOWN = 0, ARCH_X86_32, @@ -386,6 +387,7 @@ enum ArchType { ARCH_ARM_64, ARCH_IA_64, ARCH_RISCV_64, + ARCH_LOONGARCH_64, ARCH_EBC, ARCH_MAX }; @@ -597,11 +599,11 @@ static __inline const char* GetArchName(USHORT uArch) case IMAGE_FILE_MACHINE_I386: return "x86"; case IMAGE_FILE_MACHINE_ARM64: - return "arm64"; + return "ARM64"; case IMAGE_FILE_MACHINE_ARM: - return "arm"; + return "ARM32"; default: - return "unknown"; + return "Unknown"; } } @@ -830,6 +832,8 @@ extern HANDLE CreateFileWithTimeout(LPCSTR lpFileName, DWORD dwDesiredAccess, DW LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile, DWORD dwTimeOut); extern BOOL SetThreadAffinity(DWORD_PTR* thread_affinity, size_t num_threads); +extern BOOL DetectSHA1Acceleration(void); +extern BOOL DetectSHA256Acceleration(void); extern BOOL HashFile(const unsigned type, const char* path, uint8_t* sum); extern BOOL PE256Buffer(uint8_t* buf, uint32_t len, uint8_t* hash); extern void UpdateMD5Sum(const char* dest_dir, const char* md5sum_name); diff --git a/src/rufus.rc b/src/rufus.rc index da4048bd..fe49e9e2 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.7.2212" +CAPTION "Rufus 4.7.2213" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2212,0 - PRODUCTVERSION 4,7,2212,0 + FILEVERSION 4,7,2213,0 + PRODUCTVERSION 4,7,2213,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2212" + VALUE "FileVersion", "4.7.2213" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2212" + VALUE "ProductVersion", "4.7.2213" END END BLOCK "VarFileInfo" From 8d1ed44e1ea3c49d12ab7bb28a0f2d3f8731f053 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 3 Dec 2024 11:51:18 +0000 Subject: [PATCH 023/192] [cmd] fix hogger not being deleted on exit when executable is in a different directory * Closes #2622. --- src/rufus.c | 3 ++- src/rufus.rc | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/rufus.c b/src/rufus.c index 76f04c59..430ba9f3 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -3173,6 +3173,7 @@ static HANDLE SetHogger(void) hogmutex = CreateMutexA(NULL, TRUE, "Global/Rufus_CmdLine"); // Extract the hogger resource + _chdirU(cur_dir); hFile = CreateFileA(&cmdline_hogger[2], GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile != INVALID_HANDLE_VALUE) { @@ -4119,7 +4120,7 @@ extern int TestHashes(void); } out: - _chdirU(app_dir); + _chdirU(cur_dir); // Destroy the hogger mutex first, so that the cmdline app can exit and we can delete it if (hogmutex != NULL) { ReleaseMutex(hogmutex); diff --git a/src/rufus.rc b/src/rufus.rc index fe49e9e2..1f5044b8 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.7.2213" +CAPTION "Rufus 4.7.2214" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2213,0 - PRODUCTVERSION 4,7,2213,0 + FILEVERSION 4,7,2214,0 + PRODUCTVERSION 4,7,2214,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2213" + VALUE "FileVersion", "4.7.2214" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2213" + VALUE "ProductVersion", "4.7.2214" END END BLOCK "VarFileInfo" From 3d5ab84ec15cbe03a4b54e9002d8fe9c3eb782b8 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 3 Dec 2024 13:47:30 +0000 Subject: [PATCH 024/192] [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. --- src/iso.c | 29 ++++++++++++----------------- src/rufus.h | 1 + src/rufus.rc | 10 +++++----- src/syslinux/libfat/dumpdir.c | 21 ++++++++++++++------- 4 files changed, 32 insertions(+), 29 deletions(-) diff --git a/src/iso.c b/src/iso.c index 66c7bf96..9f42c3ab 100644 --- a/src/iso.c +++ b/src/iso.c @@ -1758,8 +1758,8 @@ BOOL HasEfiImgBootLoaders(void) int32_t dc, c; struct libfat_filesystem *lf_fs = NULL; struct libfat_direntry direntry; - char name[12] = { 0 }, bootloader_name[32]; - int i, j, k; + char bootloader_name[16]; + int i; if ((image_path == NULL) || !HAS_EFI_IMG(img_report)) return FALSE; @@ -1799,24 +1799,19 @@ BOOL HasEfiImgBootLoaders(void) goto out; dc = direntry.entry[26] + (direntry.entry[27] << 8); - for (i = 0; i < ARRAYSIZE(efi_archname); i++) { - static_sprintf(bootloader_name, "boot%s.efi", efi_archname[i]); - // TODO: bootriscv64.efi and bootloongarch64.efi need LFN support - if (strlen(bootloader_name) > 12) - continue; - for (j = 0, k = 0; bootloader_name[j] != 0; j++) { - if (bootloader_name[j] == '.') { - while (k < 8) - name[k++] = ' '; - } else { - name[k++] = toupper(bootloader_name[j]); - } - } - c = libfat_searchdir(lf_fs, dc, name, &direntry); + for (i = 1; i < ARRAYSIZE(efi_archname); i++) { + // We consider it unlikely that any bootri#####.efi or bootlo#####.efi files + // in the /efi/boot/ subdirectory will be anything but 'bootriscv64.efi' and + // 'bootloongarch64.efi', so we'll use the ~1 LFN shortened names for them. + static_sprintf(bootloader_name, "BOOT%c%c%c%cEFI", efi_archname[i][0], efi_archname[i][1], + strlen(efi_archname[i]) > 4 ? '~' : efi_archname[i][2], + strlen(efi_archname[i]) > 4 ? '1' : (strlen(efi_archname[i]) > 3 ? efi_archname[i][3] : ' ')); + safe_strtoupper(bootloader_name); + c = libfat_searchdir(lf_fs, dc, bootloader_name, &direntry); if (c > 0) { if (!ret) uprintf(" Detected EFI bootloader(s) (from '%s'):", img_report.efi_img_path); - uprintf(" ● '%s'", bootloader_name); + uprintf(" ● 'boot%s.efi'", efi_archname[i]); ret = TRUE; } } diff --git a/src/rufus.h b/src/rufus.h index 18839db3..507e66c4 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -184,6 +184,7 @@ static __inline void safe_strcp(char* dst, const size_t dst_max, const char* src #define safe_vsnprintf vsnprintf #endif #define safe_strtolower(str) do { if (str != NULL) CharLowerA(str); } while(0) +#define safe_strtoupper(str) do { if (str != NULL) CharUpperA(str); } while(0) static __inline void static_repchr(char* p, char s, char r) { if (p != NULL) while (*p != 0) { if (*p == s) *p = r; p++; } } diff --git a/src/rufus.rc b/src/rufus.rc index 1f5044b8..4ba60c56 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.7.2214" +CAPTION "Rufus 4.7.2215" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2214,0 - PRODUCTVERSION 4,7,2214,0 + FILEVERSION 4,7,2215,0 + PRODUCTVERSION 4,7,2215,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2214" + VALUE "FileVersion", "4.7.2215" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2214" + VALUE "ProductVersion", "4.7.2215" END END BLOCK "VarFileInfo" diff --git a/src/syslinux/libfat/dumpdir.c b/src/syslinux/libfat/dumpdir.c index bc037189..3493340a 100644 --- a/src/syslinux/libfat/dumpdir.c +++ b/src/syslinux/libfat/dumpdir.c @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- * * - * Copyright 2019 Pete Batard <pete@akeo.ie> + * Copyright 2019-2024 Pete Batard <pete@akeo.ie> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +19,10 @@ #include <string.h> #include "libfatint.h" +#ifndef ARRAYSIZE +#define ARRAYSIZE(a) (sizeof(a) / sizeof(*(a))) +#endif + static struct fat_dirent* get_next_dirent(struct libfat_filesystem *fs, libfat_sector_t *sector, int *offset) { @@ -41,12 +45,12 @@ static struct fat_dirent* get_next_dirent(struct libfat_filesystem *fs, static void fill_utf16(wchar_t *name, unsigned char *entry) { int i; - for (i=0; i<5; i++) - name[i] = read16((le16_t*)&entry[1 + 2*i]); - for (i=5; i<11; i++) - name[i] = read16((le16_t*)&entry[4 + 2*i]); - for (i=11; i<12; i++) - name[i] = read16((le16_t*)&entry[6 + 2*i]); + for (i = 0; i < 5; i++) + name[i] = read16((le16_t*)&entry[1 + 2 * i]); + for (i = 5; i < 11; i++) + name[i] = read16((le16_t*)&entry[4 + 2 * i]); + for (i = 11; i < 13; i++) + name[i] = read16((le16_t*)&entry[6 + 2 * i]); } int libfat_dumpdir(struct libfat_filesystem *fs, libfat_dirpos_t *dp, @@ -94,11 +98,14 @@ int libfat_dumpdir(struct libfat_filesystem *fs, libfat_dirpos_t *dp, if ((j >= 0) && (i != j - 1)) return -3; j = i; + if (i > ARRAYSIZE(di->name) - 13) + i = ARRAYSIZE(di->name) - 13; fill_utf16(&di->name[13 * i], dep->name); dep = get_next_dirent(fs, &dp->sector, &dp->offset); if (!dep) return -1; } + di->name[ARRAYSIZE(di->name) - 1] = 0; if (di->name[0] == 0) { for (i = 0, j = 0; i < 12; i++) { From 1e2f1c1affc330dadfa97e830bf40ebb6b7e18e3 Mon Sep 17 00:00:00 2001 From: Emmanuel Bourg <ebourg@apache.org> Date: Fri, 13 Dec 2024 14:30:03 +0100 Subject: [PATCH 025/192] [loc] Improve the French translation * Closes #2636. --- res/loc/po/fr-FR.po | 92 ++++++++++++++++++++++----------------------- res/loc/rufus.loc | 86 +++++++++++++++++++++--------------------- src/rufus.rc | 10 ++--- 3 files changed, 94 insertions(+), 94 deletions(-) diff --git a/res/loc/po/fr-FR.po b/res/loc/po/fr-FR.po index 54f9f5f9..46930717 100644 --- a/res/loc/po/fr-FR.po +++ b/res/loc/po/fr-FR.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 3.22\n" +"Project-Id-Version: 4.5\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" "POT-Creation-Date: 2024-04-25 12:25+0100\n" -"PO-Revision-Date: 2024-04-25 12:46+0100\n" +"PO-Revision-Date: 2024-12-17 14:54+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr_FR\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: French (Français)\n" "X-Rufus-LCID: 0x040c, 0x080c, 0x0c0c, 0x100c, 0x140c, 0x180c, 0x1c0c, 0x200c, 0x240c, 0x280c, 0x2c0c, 0x300c, 0x340c, 0x380c, 0xe40c\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.5\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -161,7 +161,7 @@ msgstr "Recherche mises à jour" #. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT msgid "Include beta versions" -msgstr "Inclure les bétas" +msgstr "Inclure les versions bêta" #. • IDD_UPDATE_POLICY → IDC_CHECK_NOW msgid "Check Now" @@ -460,7 +460,7 @@ msgstr "Veuillez insérer un média dans le lecteur." #. • MSG_062 msgid "An unsupported command was received." -msgstr "Commande non supportée." +msgstr "Une commande non prise en charge a été reçue." #. • MSG_063 msgid "Memory allocation error." @@ -484,7 +484,7 @@ msgstr "Impossible d'accéder au média. Il peut être en cours d'utilisation pa #. • MSG_068 msgid "Could not partition drive." -msgstr "Echec de partitionnement." +msgstr "Échec de partitionnement." #. • MSG_069 msgid "Could not copy files to target drive." @@ -506,23 +506,23 @@ msgstr "La vérification de blocs défectueux a été interrompue." #. • MSG_073 msgid "ISO image scan failure." -msgstr "Echec d'analyse de l'image ISO." +msgstr "Échec d'analyse de l'image ISO." #. • MSG_074 msgid "ISO image extraction failure." -msgstr "Echec d'extraction de l'image ISO." +msgstr "Échec d'extraction de l'image ISO." #. • MSG_075 msgid "Unable to remount volume." -msgstr "Echec lors du remontage du volume." +msgstr "Échec lors du remontage du volume." #. • MSG_076 msgid "Unable to patch/setup files for boot." -msgstr "Echec de modification des fichiers de démarrage." +msgstr "Échec de modification des fichiers de démarrage." #. • MSG_077 msgid "Unable to assign a drive letter." -msgstr "Echec d'assignation d'une lettre de volume." +msgstr "Échec d'assignation d'une lettre de volume." #. • MSG_078 msgid "Can't mount GUID volume." @@ -548,7 +548,7 @@ msgstr "" #. • MSG_081 msgid "Unsupported image" -msgstr "Image non supportée" +msgstr "Image non prise en charge" #. • MSG_082 msgid "This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus..." @@ -609,7 +609,7 @@ msgstr "L'image est trop large pour être copiée sur le périphérique sélecti #. • MSG_090 msgid "Unsupported ISO" -msgstr "Image ISO non supportée" +msgstr "Image ISO non prise en charge" #. • MSG_091 msgid "When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS." @@ -617,7 +617,7 @@ msgstr "Quand UEFI est sélectionné, seules les images ISO basées sur EFI sont #. • MSG_092 msgid "Unsupported filesystem" -msgstr "Système de fichiers non supporté" +msgstr "Système de fichiers non pris en charge" #. • MSG_093 msgid "" @@ -669,7 +669,7 @@ msgstr "Cette image ISO contient un fichier de plus de 4 Go, soit plus que la ta #. • MSG_101 msgid "Missing WIM support" -msgstr "Support pour archives WIM non disponible" +msgstr "Prise en charge des archives WIM non disponible" #. • MSG_102 msgid "" @@ -906,7 +906,7 @@ msgid "" msgstr "" "Parce que MBR a été sélectionné pour le schéma de partition, Rufus peut seulement créer une partition sur ce média occupant jusqu’à 2 To, ce qui laissera %s d’espace disque non-disponible.\n" "\n" -"Etes-vous sûr de vouloir continuer ?" +"Êtes-vous sûr de vouloir continuer ?" #. • MSG_135 msgid "Version" @@ -1203,7 +1203,7 @@ msgstr "Analyse de l'image..." #. • MSG_203 msgid "Failed to scan image" -msgstr "Echec d'analyse de l'image" +msgstr "Échec de l'analyse de l'image" #. • MSG_204 #. @@ -1252,7 +1252,7 @@ msgstr "Opération annulée" #. • MSG_212 msgid "Failed" -msgstr "ECHEC" +msgstr "Échec" #. • MSG_213 #. @@ -1262,7 +1262,7 @@ msgstr "Lancement de la nouvelle application..." #. • MSG_214 msgid "Failed to launch new application" -msgstr "Echec de lancement de l'application" +msgstr "Échec de lancement de l'application" #. • MSG_215 #. @@ -1284,11 +1284,11 @@ msgstr "Formatage : %s" #. • MSG_218 msgid "Creating file system: Task %d/%d completed" -msgstr "Système de fichiers : Tâche %d/%d complétée" +msgstr "Système de fichiers : Tâche %d/%d terminée" #. • MSG_219 msgid "NTFS Fixup: %d%% completed" -msgstr "Finalisation NTFS : %d%% complété" +msgstr "Finalisation NTFS : %d%% terminé" #. • MSG_220 #. @@ -1300,7 +1300,7 @@ msgstr "Formatage (%s) - durée estimée %d :%02d..." #. • MSG_221 msgid "Setting label (%s)..." -msgstr "Ecriture du label (%s)..." +msgstr "Écriture du label (%s)..." #. • MSG_222 #. @@ -1330,11 +1330,11 @@ msgstr "Fermeture des volumes existants..." #. • MSG_228 msgid "Writing Master Boot Record..." -msgstr "Ecriture du MBR..." +msgstr "Écriture du MBR..." #. • MSG_229 msgid "Writing Partition Boot Record..." -msgstr "Ecriture du PBR..." +msgstr "Écriture du PBR..." #. • MSG_230 msgid "Copying DOS files..." @@ -1346,7 +1346,7 @@ msgstr "Copie des fichiers ISO : %s" #. • MSG_232 msgid "Win7 EFI boot setup (%s)..." -msgstr "Ecriture boot Win7 EFI (%s)..." +msgstr "Écriture boot Win7 EFI (%s)..." #. • MSG_233 msgid "Finalizing, please wait..." @@ -1392,7 +1392,7 @@ msgid "" "\n" "The download will be deleted. Please check the log for more details." msgstr "" -"La signature de la mise à jour qui vient d’être téléchargée ne peut pas être validée. Cela peut indiquer que votre système n’est pas configuré correctement pour la validation de signatures digitales, ou que le téléchargement contient un fichier malicieux.\n" +"La signature de la mise à jour qui vient d’être téléchargée ne peut pas être validée. Cela peut indiquer que votre système n’est pas configuré correctement pour la validation de signatures numériques, ou que le téléchargement contient un fichier malicieux.\n" "\n" "Le téléchargement va être supprimé. Veuillez consulter le log pour plus de détails." @@ -1402,7 +1402,7 @@ msgstr "Téléchargement : %s" #. • MSG_242 msgid "Failed to download file." -msgstr "Echec de téléchargement du fichier." +msgstr "Échec de téléchargement du fichier." #. • MSG_243 msgid "Checking for Rufus updates..." @@ -1430,7 +1430,7 @@ msgstr "Clés de registre supprimées" #. • MSG_249 msgid "Failed to delete application registry keys" -msgstr "Echec de suppression des clés registres" +msgstr "Échec de suppression des clés registres" #. • MSG_250 #. @@ -1480,7 +1480,7 @@ msgstr "Compression NTFS" #. • MSG_261 msgid "Writing image: %s" -msgstr "Ecriture d'image : %s" +msgstr "Écriture d'image : %s" #. • MSG_262 #. @@ -1524,7 +1524,7 @@ msgstr "Debug USB" #. • MSG_271 msgid "Computing image checksums: %s" -msgstr "Calculation des checksums de l'image : %s" +msgstr "Calcul des checksums de l'image : %s" #. • MSG_272 msgid "Compute the MD5, SHA1 and SHA256 checksums for the selected image" @@ -1558,13 +1558,13 @@ msgstr "" #. #. '%s' will be replaced with your translation for MSG_036 ("ISO Image") msgid "Write in %s mode (Recommended)" -msgstr "Ecrire en mode %s (Recommandé)" +msgstr "Écrire en mode %s (Recommandé)" #. • MSG_277 #. #. '%s' will be replaced with your translation for MSG_095 ("DD Image") msgid "Write in %s mode" -msgstr "Ecrire en mode %s" +msgstr "Écrire en mode %s" #. • MSG_278 msgid "Checking for conflicting processes..." @@ -1592,7 +1592,7 @@ msgstr "Signature invalide" #. • MSG_284 msgid "The downloaded executable is missing a digital signature." -msgstr "L'exécutable téléchargé ne possède pas de signature digitale." +msgstr "L'exécutable téléchargé ne possède pas de signature numérique." #. • MSG_285 msgid "" @@ -1610,7 +1610,7 @@ msgstr "Effacement à zéro : %s" #. • MSG_287 msgid "Detection of non-USB removable drives" -msgstr "Détection disques non-USB détachables" +msgstr "Détection des disques détachables non-USB" #. • MSG_288 msgid "Missing elevated privileges" @@ -1618,15 +1618,15 @@ msgstr "Privilèges élevés manquants" #. • MSG_289 msgid "This application can only run with elevated privileges" -msgstr "Cette application peut seulement être exécutée avec privilèges administratifs" +msgstr "Cette application peut seulement être exécutée avec les privilèges administrateur" #. • MSG_290 msgid "File Indexing" -msgstr "Indexation de fichiers" +msgstr "Indexation des fichiers" #. • MSG_291 msgid "Version selection" -msgstr "Sélection de version" +msgstr "Sélection de la version" #. • MSG_292 msgid "Please select the version of Windows you want to install:" @@ -1634,7 +1634,7 @@ msgstr "Sélectionnez la version de Windows que vous souhaitez installer :" #. • MSG_293 msgid "Unsupported Windows version" -msgstr "Version de Windows non supportée" +msgstr "Version de Windows non prise en charge" #. • MSG_294 msgid "" @@ -1656,7 +1656,7 @@ msgid "" msgstr "" "Cette version de Rufus n'a pas produite par ses développeurs officiels.\n" "\n" -"Etes-vous sur de vouloir la lancer ?" +"Êtes-vous sûr de vouloir la lancer ?" #. • MSG_297 msgid "Truncated ISO detected" @@ -1688,7 +1688,7 @@ msgid "" msgstr "" "Rufus n'a pas pu valider que le timestamp du fichier de mise à jour téléchargé est plus récent que celui de l'exécutable en cours.\n" "\n" -"Afin de mitiger des scenarios d'attaque potentiels, le processus de mise à jour a été interrompu et le téléchargement va être supprimé. Pour plus de détails, veuillez consulter le log." +"Afin d'éviter des scenarios d'attaque potentiels, le processus de mise à jour a été interrompu et le téléchargement va être supprimé. Pour plus de détails, veuillez consulter le log." #. • MSG_301 msgid "Show application settings" @@ -1744,7 +1744,7 @@ msgstr "Utilisez %s (dans la fenêtre d’application principale) pour active." #. • MSG_312 msgid "Extra hashes (SHA512)" -msgstr "Checksum hash supplémentaire (SHA512)" +msgstr "Checksum supplémentaire (SHA512)" #. • MSG_313 msgid "Save to VHD" @@ -1752,7 +1752,7 @@ msgstr "Sauver en image VHD" #. • MSG_314 msgid "Compute image checksums" -msgstr "Calculer les checksums the l’image sélectionnée" +msgstr "Calculer les checksums de l’image sélectionnée" #. • MSG_315 msgid "Multiple buttons" @@ -1768,7 +1768,7 @@ msgstr "ID disque" #. • MSG_318 msgid "Default thread priority: %d" -msgstr "Priorité de thread part default : %d" +msgstr "Priorité de thread par défaut : %d" #. • MSG_319 msgid "Ignore Boot Marker" @@ -1776,7 +1776,7 @@ msgstr "Ignorer le marqueur de démarrage" #. • MSG_320 msgid "Refreshing partition layout (%s)..." -msgstr "Rafraichissement du schéma de partition (%s)..." +msgstr "Rafraîchissement du schéma de partition (%s)..." #. • MSG_321 msgid "" @@ -1784,7 +1784,7 @@ msgid "" "As a result, DD image writing mode will be enforced." msgstr "" "L’image que vous avez sélectionnée est de type ISOHybrid, mais ses créateurs ne l’ont pas rendue compatible avec le mode ISO (i.e. copie de fichier).\n" -"A cause de cela, seule l’écriture en mode DD est applicable." +"À cause de cela, seule l’écriture en mode DD est applicable." #. • MSG_322 msgid "Unable to open or read '%s'" @@ -1832,7 +1832,7 @@ msgstr "Définir les options régionales avec les mêmes valeurs que celles de c #. • MSG_335 msgid "Disable BitLocker automatic device encryption" -msgstr "Désactiver l'encryption automatique BitLocker" +msgstr "Désactiver le cryptage automatique BitLocker" #. • MSG_336 msgid "Persistent log" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 63d590fd..23c963f3 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -4470,7 +4470,7 @@ t IDCANCEL "Fermer" t IDD_UPDATE_POLICY "Paramètres de mises à jour" t IDS_UPDATE_SETTINGS_GRP "Options" t IDS_UPDATE_FREQUENCY_TXT "Recherche mises à jour" -t IDS_INCLUDE_BETAS_TXT "Inclure les bétas" +t IDS_INCLUDE_BETAS_TXT "Inclure les versions bêta" t IDC_CHECK_NOW "Chercher maintenant" t MSG_001 "Autre instance détectée" @@ -4531,26 +4531,26 @@ t MSG_058 "Le handle de périphérique est invalide." t MSG_059 "Cette taille de cluster n'est pas applicable ici." t MSG_060 "La taille du volume est invalide." t MSG_061 "Veuillez insérer un média dans le lecteur." -t MSG_062 "Commande non supportée." +t MSG_062 "Une commande non prise en charge a été reçue." t MSG_063 "Erreur d'allocation mémoire." t MSG_064 "Erreur de lecture." t MSG_065 "Erreur d'écriture." t MSG_066 "L'installation a échoué" t MSG_067 "Impossible d'accéder au média. Il peut être en cours d'utilisation par une autre application. Essayer de déconnecter le média et essayez à nouveau." -t MSG_068 "Echec de partitionnement." +t MSG_068 "Échec de partitionnement." t MSG_069 "Impossible de copier les fichiers sur le périphérique de destination." t MSG_070 "Opération annulée par l'utilisateur." t MSG_071 "Impossible de créer le thread." t MSG_072 "La vérification de blocs défectueux a été interrompue." -t MSG_073 "Echec d'analyse de l'image ISO." -t MSG_074 "Echec d'extraction de l'image ISO." -t MSG_075 "Echec lors du remontage du volume." -t MSG_076 "Echec de modification des fichiers de démarrage." -t MSG_077 "Echec d'assignation d'une lettre de volume." +t MSG_073 "Échec d'analyse de l'image ISO." +t MSG_074 "Échec d'extraction de l'image ISO." +t MSG_075 "Échec lors du remontage du volume." +t MSG_076 "Échec de modification des fichiers de démarrage." +t MSG_077 "Échec d'assignation d'une lettre de volume." t MSG_078 "Impossible de monter le volume GUID." t MSG_079 "Le périphérique n'est pas prêt." t MSG_080 "Rufus a détecté que Windows est en train de finir de vider la mémoire tampon.\n\nEn fonction de la vitesse de votre périphérique et de la taille du fichier, cette opération peut prendre beaucoup de temps.\n\nNous recommandons d'attendre que Windows complète cette opération pour éviter la corruption du périphérique. Mais si jamais vous en avez marre d'attendre, vous pouvez essayer de déconnecter le média..." -t MSG_081 "Image non supportée" +t MSG_081 "Image non prise en charge" t MSG_082 "Cette image n'est pas démarrable, ou bien elle utilise une méthode de démarrage ou de compression qui n'est pas compatible avec Rufus..." t MSG_083 "Remplacer %s ?" t MSG_084 "Cette image ISO utilise une version obsolète du fichier '%s'.\nLes menus de démarrage peuvent de pas fonctionner à cause de cela.\n\nRufus peut télécharger une nouvelle version du fichier pour résoudre ce problème :\n- Choisissez 'Oui' pour télécharger le fichier depuis Internet\n- Choisissez 'Non' pour garder le fichier de l'image ISO\nSi vous ne savez pas quoi faire, sélectionnez 'Oui'.\n\nNote : Le nouveau fichier sera téléchargé dans le répertoire courant. Si un '%s' existe à cet endroit, il sera réutilisé automatiquement." @@ -4559,9 +4559,9 @@ t MSG_086 "Aucune image sélectionnée" t MSG_087 "pour NAND %s" t MSG_088 "Image trop large" t MSG_089 "L'image est trop large pour être copiée sur le périphérique sélectionné." -t MSG_090 "Image ISO non supportée" +t MSG_090 "Image ISO non prise en charge" t MSG_091 "Quand UEFI est sélectionné, seules les images ISO basées sur EFI sont supportées. Veuillez sélectionner une image ISO démarrable avec EFI ou sélectionner BIOS pour le système de destination." -t MSG_092 "Système de fichiers non supporté" +t MSG_092 "Système de fichiers non pris en charge" t MSG_093 "IMPORTANT : CE PÉRIPHÉRIQUE CONTIENT PLUSIEURS PARTITIONS !!\n\nCeci peut inclure des partitions/volumes qui ne sont pas listées ou bien visibles depuis Windows. Si vous décidez de continuer, vous êtes responsable de toute perte de données intervenant sur ces partitions." t MSG_094 "Partitions multiples détectées" t MSG_095 "Image DD" @@ -4570,7 +4570,7 @@ t MSG_097 "'%s' peut seulement être appliqué pour un système de fichiers NTFS t MSG_098 "IMPORTANT : Vous essayez d'installer 'Windows To Go', mais votre périphérique de destination ne possède pas l'attribut 'FIXE'. A cause de cela, Windows va très probablement geler lors du démarrage, car Microsoft ne l'a pas conçu pour fonctionner avec des périphériques qui possèdent l'attribut 'AMOVIBLE'.\n\nVoulez vous continuer malgré celà ?\n\nNote : L'attribut 'FIXE/AMOVIBLE' est une propriété matérielle qui peut uniquement être changée avec des outils propriétaires, que les fabriquants de périphériques ne fournissent PRESQUE JAMAIS au public..." t MSG_099 "Limitation du système de fichiers" t MSG_100 "Cette image ISO contient un fichier de plus de 4 Go, soit plus que la taille maximale autorisée pour un système de fichiers FAT ou FAT32." -t MSG_101 "Support pour archives WIM non disponible" +t MSG_101 "Prise en charge des archives WIM non disponible" t MSG_102 "Votre plateforme ne peut pas extraire les fichiers depuis les archives WIM. L'extraction de données WIM est nécessaire pour créer des médias USB démarrable avec EFI pour Windows 7/8 ou Windows Vista. Vous pouvez adresser ce problème en téléchargeant une version récente de l'utilitaire 7-Zip.\nVoulez-vous visiter la page de téléchargements de 7-zip ?" t MSG_103 "Télécharger %s ?" t MSG_104 "%s ou plus récent requiert l'installation d'un fichier '%s'.\nPuisque ce fichier fait plus de 100 Ko et est toujours présent sur les images ISO à base de %s, il n'est pas inclus dans l'application.\n\nRufus peut télécharger ce fichier pour vous :\n- Choisissez 'Oui' pour télécharger le fichier depuis Internet\n- Choisissez 'Non' si vous compter copier ce fichier manuellement\nNote : Ce fichier est téléchargé dans le répertoire courant. Une fois qu'un fichier'%s' existe à cet endroit, il sera réutilisé automatiquement." @@ -4602,7 +4602,7 @@ t MSG_130 "Sélection d'image Windows" t MSG_131 "Cette ISO contient plusieurs images Windows.\nVeuillez sélectionner l'image que vous souhaitez utiliser pour cette installation :" t MSG_132 "Ce lecteur est utilisé par une autre application ou un autre processus. Voulez-vous quand même le formater ?" t MSG_133 "Rufus a détecté que vous êtes en train de créer un média 'Windows To Go' à partir d'une ISO 1809.\n\nA cause d'un *BUG MICROSOFT*, ce média va planter durant le démarrage de Windows (Blue Screen Of Death), à moins que vous ne remplaciez le fichier 'WppRecorder.sys' par la version 1803.\n\nVeuillez aussi noter que la raison pour laquelle Rufus ne peut pas corriger ce problème pour vous est que le fichier 'WppRecorder.sys' est sujet au copyright de Microsoft, donc nous ne pouvons pas légalement en produire une copie avec cette application..." -t MSG_134 "Parce que MBR a été sélectionné pour le schéma de partition, Rufus peut seulement créer une partition sur ce média occupant jusqu’à 2 To, ce qui laissera %s d’espace disque non-disponible.\n\nEtes-vous sûr de vouloir continuer ?" +t MSG_134 "Parce que MBR a été sélectionné pour le schéma de partition, Rufus peut seulement créer une partition sur ce média occupant jusqu’à 2 To, ce qui laissera %s d’espace disque non-disponible.\n\nÊtes-vous sûr de vouloir continuer ?" t MSG_137 "Édition" t MSG_138 "Langue de produit" t MSG_140 "Continuer" @@ -4664,7 +4664,7 @@ t MSG_198 "'Windows To Go' peut seulement être installé sur un disque partitio t MSG_199 "Cette fonctionalité n'est pas disponible pour cette plateforme." t MSG_201 "Annulation - Veuillez patienter..." t MSG_202 "Analyse de l'image..." -t MSG_203 "Echec d'analyse de l'image" +t MSG_203 "Échec de l'analyse de l'image" t MSG_204 "Fichier %s obsolète détecté" t MSG_205 "Image utilisée : %s" t MSG_206 "Fichier %s manquant" @@ -4673,27 +4673,27 @@ t MSG_208 "%d périphérique détecté" t MSG_209 "%d périphériques détectés" t MSG_210 "PRÊT" t MSG_211 "Opération annulée" -t MSG_212 "ECHEC" +t MSG_212 "Échec" t MSG_213 "Lancement de la nouvelle application..." -t MSG_214 "Echec de lancement de l'application" +t MSG_214 "Échec de lancement de l'application" t MSG_215 "%s ouvert" t MSG_216 "%s sauvegardé" t MSG_217 "Formatage : %s" -t MSG_218 "Système de fichiers : Tâche %d/%d complétée" -t MSG_219 "Finalisation NTFS : %d%% complété" +t MSG_218 "Système de fichiers : Tâche %d/%d terminée" +t MSG_219 "Finalisation NTFS : %d%% terminé" t MSG_220 "Formatage (%s) - durée estimée %d :%02d..." -t MSG_221 "Ecriture du label (%s)..." +t MSG_221 "Écriture du label (%s)..." t MSG_222 "Formatage (%s)..." t MSG_223 "Finalisation NTFS (Checkdisk)..." t MSG_224 "Effacement des structures MBR/PBR/GPT..." t MSG_225 "Requête d'accès disque..." t MSG_226 "Analyse des structures de boot existantes..." t MSG_227 "Fermeture des volumes existants..." -t MSG_228 "Ecriture du MBR..." -t MSG_229 "Ecriture du PBR..." +t MSG_228 "Écriture du MBR..." +t MSG_229 "Écriture du PBR..." t MSG_230 "Copie des fichiers DOS..." t MSG_231 "Copie des fichiers ISO : %s" -t MSG_232 "Ecriture boot Win7 EFI (%s)..." +t MSG_232 "Écriture boot Win7 EFI (%s)..." t MSG_233 "Finalisation, veuillez patienter..." t MSG_234 "Installation de Syslinux %s..." t MSG_235 "Test de défauts : %s %d/%d - %0.2f%% (%d/%d/%d erreurs)" @@ -4701,16 +4701,16 @@ t MSG_236 "Test de défauts : Test avec motif aléatoire" t MSG_237 "Test de défauts : Test avec motif 0x%02X" t MSG_238 "Partitionnement (%s)..." t MSG_239 "Suppression des partitions (%s)..." -t MSG_240 "La signature de la mise à jour qui vient d’être téléchargée ne peut pas être validée. Cela peut indiquer que votre système n’est pas configuré correctement pour la validation de signatures digitales, ou que le téléchargement contient un fichier malicieux.\n\nLe téléchargement va être supprimé. Veuillez consulter le log pour plus de détails." +t MSG_240 "La signature de la mise à jour qui vient d’être téléchargée ne peut pas être validée. Cela peut indiquer que votre système n’est pas configuré correctement pour la validation de signatures numériques, ou que le téléchargement contient un fichier malicieux.\n\nLe téléchargement va être supprimé. Veuillez consulter le log pour plus de détails." t MSG_241 "Téléchargement : %s" -t MSG_242 "Echec de téléchargement du fichier." +t MSG_242 "Échec de téléchargement du fichier." t MSG_243 "Recherche des mises à jour..." t MSG_244 "Mises à jour : Impossible de se connecter" t MSG_245 "Mises à jour : Impossible de lire les données" t MSG_246 "Une nouvelle version de Rufus est disponible !" t MSG_247 "Pas de nouvelle mise à jour" t MSG_248 "Clés de registre supprimées" -t MSG_249 "Echec de suppression des clés registres" +t MSG_249 "Échec de suppression des clés registres" t MSG_250 "%s activé" t MSG_251 "%s désactivé" t MSG_252 "Tests de dépassement de taille" @@ -4722,7 +4722,7 @@ t MSG_257 "Support Joliet" t MSG_258 "Support Rock Ridge" t MSG_259 "Forçage de mise à jour" t MSG_260 "Compression NTFS" -t MSG_261 "Ecriture d'image : %s" +t MSG_261 "Écriture d'image : %s" t MSG_262 "Support ISO" t MSG_263 "Affichage de tailles avec de VRAIES unités" t MSG_264 "Suppression du dossier '%s'" @@ -4732,36 +4732,36 @@ t MSG_267 "Application de l'image Windows : %s" t MSG_268 "Application de l'image Windows..." t MSG_269 "Préservation des dates de fichiers" t MSG_270 "Debug USB" -t MSG_271 "Calculation des checksums de l'image : %s" +t MSG_271 "Calcul des checksums de l'image : %s" t MSG_272 "Calcule les checksums MD5, SHA1 et SHA256 pour l'image sélectionée" t MSG_273 "Change la langue de l'application" t MSG_274 "Image %s détectée" t MSG_275 "L'image que vous avez sélectionnée est une image 'ISOHybrid'. Cela veut dire qu’elle peut être écrite soit en mode %s (copie de fichiers) ou en mode %s (image disque).\nRufus recommande d’utiliser le mode %s, de manière à ce que vous conserviez l’accès à votre périphérique après écriture.\nCependant, si vous rencontrez des erreurs lors du démarrage, vous pouvez à nouveau essayer d’écrire cette image, en mode %s.\n\nVeuillez sélectionner le mode que vous souhaitez utiliser pour écrire cette image :" -t MSG_276 "Ecrire en mode %s (Recommandé)" -t MSG_277 "Ecrire en mode %s" +t MSG_276 "Écrire en mode %s (Recommandé)" +t MSG_277 "Écrire en mode %s" t MSG_278 "Recherche de processus en conflit..." t MSG_279 "Non démarrable" t MSG_280 "Image disque ou ISO" t MSG_281 "%s (Veuillez sélectionner)" t MSG_282 "Verrouillage exclusif de périphérique USB" t MSG_283 "Signature invalide" -t MSG_284 "L'exécutable téléchargé ne possède pas de signature digitale." +t MSG_284 "L'exécutable téléchargé ne possède pas de signature numérique." t MSG_285 "L'exécutable téléchargé est signé par '%s'.\nIl ne s'agit pas d'une signature que nous connaissons et peut indiquer une activité malicieuse...\nÊtes-vous certain de vouloir lancer ce fichier ?" t MSG_286 "Effacement à zéro : %s" -t MSG_287 "Détection disques non-USB détachables" +t MSG_287 "Détection des disques détachables non-USB" t MSG_288 "Privilèges élevés manquants" -t MSG_289 "Cette application peut seulement être exécutée avec privilèges administratifs" -t MSG_290 "Indexation de fichiers" -t MSG_291 "Sélection de version" +t MSG_289 "Cette application peut seulement être exécutée avec les privilèges administrateur" +t MSG_290 "Indexation des fichiers" +t MSG_291 "Sélection de la version" t MSG_292 "Sélectionnez la version de Windows que vous souhaitez installer :" -t MSG_293 "Version de Windows non supportée" +t MSG_293 "Version de Windows non prise en charge" t MSG_294 "Cette version de Windows n'est plus prise en charge par Rufus.\nLa dernière version de Rufus compatible avec cette plateforme est v%d.%d." t MSG_295 "Alerte: Version non-officielle" -t MSG_296 "Cette version de Rufus n'a pas produite par ses développeurs officiels.\n\nEtes-vous sur de vouloir la lancer ?" +t MSG_296 "Cette version de Rufus n'a pas produite par ses développeurs officiels.\n\nÊtes-vous sûr de vouloir la lancer ?" t MSG_297 "ISO tronquée détectée" t MSG_298 "Le fichier ISO que vous avez sélectionné ne fait pas la bonne taille : %s de données sont manquantes !\n\nSi vous avez obtenu ce fichier depuis Internet, vous devriez essayer de le télécharger à nouveau et verifier que le MD5 ou SHA correspond aux valeurs officielles.\n\nNotez que vous pouvez calculer le MD5 ou SHA depuis Rufus en cliquant le bouton (✓)." t MSG_299 "Erreur de validation du timestamp" -t MSG_300 "Rufus n'a pas pu valider que le timestamp du fichier de mise à jour téléchargé est plus récent que celui de l'exécutable en cours.\n\nAfin de mitiger des scenarios d'attaque potentiels, le processus de mise à jour a été interrompu et le téléchargement va être supprimé. Pour plus de détails, veuillez consulter le log." +t MSG_300 "Rufus n'a pas pu valider que le timestamp du fichier de mise à jour téléchargé est plus récent que celui de l'exécutable en cours.\n\nAfin d'éviter des scenarios d'attaque potentiels, le processus de mise à jour a été interrompu et le téléchargement va être supprimé. Pour plus de détails, veuillez consulter le log." t MSG_301 "Affiche les paramètres de l'application" t MSG_302 "Affiche des informations à propos de cette application" t MSG_303 "Affiche le log" @@ -4773,16 +4773,16 @@ t MSG_308 "Détection VHD" t MSG_309 "Archive compressée" t MSG_310 "L’image ISO que vous avez sélectionnée utilise EFI et est suffisamment petite pour être contenue entièrement dans une ESP (EFI System Partition). L’écriture en ESP, plutôt qu’en partition générique occupant la totalité de l’espace disque, peut s’avérer préférable pour certaines méthodes d’installation.\nVeuillez sélectionner le mode d’écriture que vous souhaitez utiliser pour écrire cette image :" t MSG_311 "Utilisez %s (dans la fenêtre d’application principale) pour active." -t MSG_312 "Checksum hash supplémentaire (SHA512)" +t MSG_312 "Checksum supplémentaire (SHA512)" t MSG_313 "Sauver en image VHD" -t MSG_314 "Calculer les checksums the l’image sélectionnée" +t MSG_314 "Calculer les checksums de l’image sélectionnée" t MSG_315 "Multiples boutons" t MSG_316 "Nombre de passes" t MSG_317 "ID disque" -t MSG_318 "Priorité de thread part default : %d" +t MSG_318 "Priorité de thread par défaut : %d" t MSG_319 "Ignorer le marqueur de démarrage" -t MSG_320 "Rafraichissement du schéma de partition (%s)..." -t MSG_321 "L’image que vous avez sélectionnée est de type ISOHybrid, mais ses créateurs ne l’ont pas rendue compatible avec le mode ISO (i.e. copie de fichier).\nA cause de cela, seule l’écriture en mode DD est applicable." +t MSG_320 "Rafraîchissement du schéma de partition (%s)..." +t MSG_321 "L’image que vous avez sélectionnée est de type ISOHybrid, mais ses créateurs ne l’ont pas rendue compatible avec le mode ISO (i.e. copie de fichier).\nÀ cause de cela, seule l’écriture en mode DD est applicable." t MSG_322 "Impossible d'ouvrir ou de lire '%s'" t MSG_325 "Application des options de personnalisation de Windows: %s" t MSG_326 "Application des options utilisateur..." @@ -4794,7 +4794,7 @@ t MSG_331 "Désactiver la collecte de données (Supprime les questions de confid t MSG_332 "Empêcher Windows To Go d'accéder aux disques internes" t MSG_333 "Créer un compte local sous le nom de :" t MSG_334 "Définir les options régionales avec les mêmes valeurs que celles de cet utilisateur" -t MSG_335 "Désactiver l'encryption automatique BitLocker" +t MSG_335 "Désactiver le cryptage automatique BitLocker" t MSG_336 "Log persistent" t MSG_337 "Un fichier supplémentaire ('diskcopy.dll') doit être téléchargé depuis Microsoft pour installer MS-DOS :\n- Sélectionnez 'Oui' pour vous connecter à Internet et le télécharger\n- Sélectionnez 'Non' pour annuler l’opération\n\nNote : Ce fichier sera téléchargé dans le répertoire de l'application et réutilisé automatiquement s'il est présent." t MSG_338 "Bootloader UEFI révoqué détecté" diff --git a/src/rufus.rc b/src/rufus.rc index 4ba60c56..5229cc74 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.7.2215" +CAPTION "Rufus 4.7.2216" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2215,0 - PRODUCTVERSION 4,7,2215,0 + FILEVERSION 4,7,2216,0 + PRODUCTVERSION 4,7,2216,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2215" + VALUE "FileVersion", "4.7.2216" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2215" + VALUE "ProductVersion", "4.7.2216" END END BLOCK "VarFileInfo" From 1c300b428a99673962d6a59407d7b4ba9fcbb83f Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 24 Jan 2025 00:29:53 +0000 Subject: [PATCH 026/192] [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. --- res/loc/po/fa-IR.po | 2 +- res/loc/rufus.loc | 2 +- src/db.h | 47 +++++++++++++++++++++++++++++++++++++++- src/localization_data.sh | 2 +- src/rufus.c | 2 +- src/rufus.rc | 12 +++++----- src/stdlg.c | 4 ++-- 7 files changed, 58 insertions(+), 13 deletions(-) diff --git a/res/loc/po/fa-IR.po b/res/loc/po/fa-IR.po index d140165e..1cc4b9b5 100644 --- a/res/loc/po/fa-IR.po +++ b/res/loc/po/fa-IR.po @@ -1094,7 +1094,7 @@ msgstr "نسخه %d.%d (Build %d)" #. • MSG_176 msgid "English translation: Pete Batard <mailto:pete@akeo.ie>" -msgstr "ترجمه فارسی:\\line‏ •سید عرفان <mailto:aa3245540@gmail.com>\\line‏ •ضیاءالدین عظیمی <mailto:s.zia.azimi@gmail.com>" +msgstr "ترجمه فارسی:\\line‏ •سید عرفان <mailto:mv@mvaop.ir>\\line‏ •ضیاءالدین عظیمی <mailto:s.zia.azimi@gmail.com>" #. • MSG_177 msgid "Report bugs or request enhancements at:" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 23c963f3..a7ea03f1 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -10049,7 +10049,7 @@ t MSG_172 "امضای فایل دانلود شده معتبر نیست" t MSG_173 "برای انتخاب کلیک کنید..." t MSG_174 "Rufus، ابزاری کاربردی و قابل‌اطمینان برای فرمت کردن درایوهای USB" t MSG_175 "نسخه %d.%d (Build %d)" -t MSG_176 "ترجمه فارسی:\\line‏ •سید عرفان <mailto:aa3245540@gmail.com>\\line‏ •ضیاءالدین عظیمی <mailto:s.zia.azimi@gmail.com>" +t MSG_176 "ترجمه فارسی:\\line‏ •سید عرفان <mailto:mv@mvaop.ir>\\line‏ •ضیاءالدین عظیمی <mailto:s.zia.azimi@gmail.com>" t MSG_177 "گزارش اشکال (Bug) یا درخواست قابلیت جدید و بهبود نرم‌افزار در:" t MSG_178 "حقوق نشر دیگران:" t MSG_179 "سیاست به‌روزرسانی:" diff --git a/src/db.h b/src/db.h index 1b4f4e85..3f015805 100644 --- a/src/db.h +++ b/src/db.h @@ -2,7 +2,7 @@ * Rufus: The Reliable USB Formatting Utility * DB of the known SHA256 hash values for Rufus downloadable content (GRUB, Syslinux, etc.) * as well PE256 hash values for UEFI revoked content (DBX, SkuSiPolicy.p7b) - * Copyright © 2016-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2016-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -126,6 +126,7 @@ static uint8_t sha256db[] = { /* * DBX table data was generated through the following shell command: * wget -q -O - https://uefi.org/sites/default/files/resources/dbx_info.csv | tail -n +2 | awk -F "\"*,\"*" '{print $2}' | tr '[:upper:]' '[:lower:]' | sort | uniq -w 64 | awk -F '' '{for(i=1; i<=64; i+=2) {printf "0x%s%s, ", $i,$(i+1);}} {print ""}' + * TODO: Use https://github.com/microsoft/secureboot_objects/blob/main/PreSignedObjects/DBX/dbx_info_msft_DD_MM_YY.json as our source (provided we can get a stable not date specific URL) * * Note that, because we are using the "UEFI Revocation List Contents" to generate the table * below and not the *signed* "UEFI Revocation List file(s)" and the Microsoft terms of use at @@ -150,11 +151,14 @@ static uint8_t pe256d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x84, 0x02, 0x77, 0x51, 0x1b, 0xca, 0x1f, 0xb6, 0x19, 0xfe, 0x15, 0x04, 0xef, 0x78, 0xc8, 0xbf, 0x59, 0x29, 0x4b, 0x16, 0xc6, 0xd9, 0xbf, 0x1d, 0xa7, 0x41, 0xfb, 0x58, 0x2d, 0xe1, 0x25, 0xb6, 0xa0, 0x44, 0xf6, 0x96, 0x1c, 0x57, + 0x20, 0x08, 0x2b, 0x61, 0x01, 0xf8, 0xd7, 0xda, 0xde, 0x20, 0x6f, 0x4f, 0xde, 0xb3, 0x67, 0x62, 0x2c, 0x11, 0xf8, 0x09, 0xc4, 0xcf, 0x2d, 0x21, 0x5d, 0x83, 0x44, 0x60, 0x17, 0x9e, 0xf2, 0xdd, 0x21, 0x16, 0x18, 0x3b, 0xba, 0xb5, 0xd6, 0x96, 0x4c, 0x00, 0x1c, 0x93, 0x1a, 0x09, 0xec, 0xa1, 0xdc, 0x0f, 0xd6, 0x65, 0x1a, 0x61, 0xbe, 0x4a, 0x8a, 0x95, 0x48, 0xdc, 0x47, 0x6b, 0x90, 0xb1, 0x21, 0x25, 0x8f, 0xa3, 0x87, 0x71, 0x77, 0xac, 0x48, 0x0c, 0xb5, 0x71, 0x13, 0x4b, 0xee, 0x7b, 0xa1, 0x53, 0x1d, 0xdd, 0x12, 0x74, 0x21, 0x7d, 0xff, 0x71, 0xbc, 0xd6, 0x18, 0xf6, 0xc3, 0xd5, 0x21, 0x55, 0x4d, 0x1f, 0x3b, 0xf9, 0xf5, 0x2d, 0x3c, 0xd2, 0x97, 0xd2, 0x7d, 0xf5, 0x62, 0x15, 0xc0, 0xfd, 0x08, 0xa0, 0xbf, 0x67, 0x38, 0x68, 0xf3, 0xd8, 0xc6, 0xc0, 0x64, 0xdc, 0x56, 0x09, @@ -216,6 +226,7 @@ static uint8_t pe256dbx[] = { 0x26, 0x79, 0x65, 0x0f, 0xe3, 0x41, 0xf2, 0xcf, 0x1e, 0xa8, 0x83, 0x46, 0x0b, 0x35,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x71, 0xad, 0x4d, 0x16, 0x86, 0xee, 0xde, 0x1f, 0x33, 0x1c, 0xbb, 0x6c, 0x69, 0xe9, 0xbe, 0x74, 0x6e, @@ -286,6 +301,7 @@ static uint8_t pe256dbx[] = { 0x49, 0x53, 0x00, 0x79, 0x0e, 0x6c, 0x9b, 0xf2, 0x51, 0x0d, 0xab, 0xa5, 0x9d, 0xb3, 0xd5, 0x7e, 0x9d, 0x2b, 0x85, 0xd7, 0xd7, 0x64, 0x04, 0x34, 0xec, 0x75, 0xba, 0xa3, 0x85, 0x1c, 0x74, 0xe5, 0x4a, 0x48, 0x73, 0xa3, 0x19, 0xa3, 0xa3, 0xde, 0x35, 0xea, 0x32, 0x57, 0x71, 0xdf, 0xfc, 0xbb, 0x31, 0xec, 0x14, 0x55, 0x0a, 0x4e, 0x02, 0x9c, 0xf0, 0xfe, 0xb9, 0xcd, 0x68, 0x6b, 0x8c, 0x92, 0x4a, 0x9b, 0x1c, 0x43, 0x8b, 0xc8, 0xf1, 0x14, 0xbf, 0xaa, 0x82, 0xf5, 0xd5, 0x33, 0xda, 0x31, 0xcc, 0x61, 0x0c, 0x27, 0x67, 0x11, 0x42, 0x2c, 0x74, 0xa1, 0x67, 0xb8, 0xae, 0xed, 0x7c, 0x82, + 0x4a, 0xa5, 0xf0, 0x9f, 0x50, 0x22, 0xee, 0xfb, 0xee, 0x35, 0x0d, 0x0d, 0xed, 0x72, 0x65, 0x4d, 0x21, 0xa9, 0xe7, 0x7d, 0xee, 0xc4, 0x9f, 0xef, 0xb4, 0x59, 0x94, 0x70, 0x8b, 0xe1, 0x17, 0x03, 0x4a, 0xac, 0x0a, 0x9e, 0x08, 0x9d, 0xf8, 0xe9, 0xac, 0x67, 0x25, 0xe0, 0xdf, 0xca, 0x3a, 0xc1, 0x1a, 0x17, 0x74, 0x7a, 0x2e, 0x35, 0xf4, 0x3a, 0x2b, 0x38, 0xa5, 0x8f, 0x8a, 0xe2, 0xa2, 0x73, 0x4b, 0x59, 0x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 0x02, 0x36, 0x6d, 0xf1, 0xac, 0x84, 0x22, 0x4b, 0x85, 0xab, 0x2d, 0x39, 0x49, 0xf5, 0xae, 0xe7, 0x9c, 0xef, 0xeb, + 0x8c, 0xe9, 0x86, 0x61, 0x4e, 0x70, 0x37, 0x21, 0x8a, 0x61, 0xdb, 0x51, 0xb8, 0x76, 0x34, 0x18, 0x98, 0x81, 0x77, 0x41, 0xad, 0xe8, 0x51, 0x56, 0xcf, 0x54, 0xbd, 0x1c, 0xd1, 0x79, 0x99, 0xa6, 0x8d, 0x53, 0x32, 0xb3, 0x50, 0x57, 0x7a, 0xb7, 0xb1, 0x98, 0x7f, 0x93, 0xfd, 0xa1, 0x04, 0xb2, 0x09, 0x0f, 0x6a, 0x62, 0xe2, 0x62, 0x21, 0x42, 0x64, 0xf5, 0x54, 0xb6, 0x16, 0x3e, 0x80, 0x50, 0x8d, 0x93, 0xd6, 0x0c, 0x69, 0x19, 0x59, 0x65, 0x14, 0x76, 0xe5, 0xdc, 0x46, 0x4b, 0xe1, 0x2a, 0x85, 0xfa, 0x52, 0x80, 0xb6, 0xf5, 0x24, 0xd4, 0xa1, 0xc3, 0xfc, 0xc9, 0xd0, 0x48, 0xcf, 0xad, 0x8e, 0x53, 0xef, 0xdc, 0x15, 0xf8, 0x52, 0xce, 0xe5, 0xa6, 0xe9, 0x29, 0x31, 0xbc, 0x42, 0xe6, 0x16, 0x3c, 0xd3, 0x0f, 0xf6, 0x49, 0xcc, 0xa7, 0xe8, 0x72, 0x52, 0xc3, 0xa4, 0x59, 0x96, 0x0b, @@ -444,6 +469,7 @@ static uint8_t pe256dbx[] = { 0x99, 0xd7, 0xad, 0xa0, 0xd6, 0x7e, 0x52, 0x33, 0x10, 0x8d, 0xbd, 0x76, 0x70, 0x2f, 0x4b, 0x16, 0x80, 0x87, 0xcf, 0xc4, 0xec, 0x65, 0x49, 0x4d, 0x6c, 0xa8, 0xab, 0xa8, 0x58, 0xfe, 0xba, 0xda, 0x9a, 0x22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32, 0xf8, 0x90, 0x9c, 0xa2, 0xc4, 0xab, 0x34, 0x18, 0xed, 0xc3, 0x3a, 0x45, 0xa5, 0x0d, 0x25, 0x21, 0xa3, 0xb5, 0x87, 0x6a, 0xa3, 0xea, 0x2c, 0x9f, 0x13, 0x6f, 0x15, 0x2a, 0x21, 0x88, 0x5d, 0x57, 0x45, 0x19, 0x55, 0x4c, 0x7b, 0x64, 0xc1, 0x5f, 0x01, 0x4e, 0x41, 0x3c, 0xde, 0x6a, 0xd1, 0x60, 0xf2, 0x09, 0x1e, 0xba, 0x9e, 0x64, 0x24, @@ -479,6 +506,7 @@ static uint8_t pe256dbx[] = { 0xa9, 0xce, 0x29, 0x69, 0xa8, 0x39, 0x82, 0xf8, 0x0b, 0x6b, 0x26, 0x85, 0x56, 0x8a, 0x7d, 0x6f, 0x8e, 0x58, 0xbc, 0xb5, 0xfa, 0xba, 0xa2, 0xf8, 0x16, 0x80, 0x92, 0x17, 0x55, 0x18, 0xa0, 0xc9, 0xab, 0x31, 0x1e, 0x73, 0x71, 0x12, 0xe4, 0xd3, 0x4a, 0xbf, 0x54, 0x58, 0x36, 0xbc, 0x67, 0x16, 0x37, 0x66, 0x3e, 0x93, 0x73, 0x8c, 0xef, 0xa3, 0x74, 0x05, 0x21, 0x4c, 0xe8, 0xc9, 0x2a, 0x58, 0xab, 0xee, 0x52, 0x28, 0x92, 0xfa, 0x10, 0xb2, 0x22, 0x08, 0xb4, 0xd1, 0x54, 0x01, 0x84, 0x61, 0x7b, 0xc9, 0x87, 0x5c, 0x9e, 0x03, 0xe5, 0x35, 0x3b, 0x4f, 0xf4, 0x76, 0x57, 0x7d, 0x91, 0x8b, + 0xac, 0xd9, 0xb0, 0x83, 0x02, 0xc0, 0xfa, 0x9c, 0x87, 0xd1, 0x49, 0x20, 0xbe, 0xee, 0x72, 0x4b, 0x92, 0x14, 0x47, 0x74, 0xdc, 0x09, 0x5a, 0x22, 0xee, 0x5d, 0x8f, 0x02, 0x3e, 0x80, 0xd6, 0x77, 0xad, 0x16, 0xde, 0x1e, 0x2b, 0xa2, 0x71, 0x96, 0x39, 0x51, 0x24, 0x68, 0x3b, 0x80, 0xef, 0xc1, 0x86, 0xee, 0x7e, 0x51, 0xd4, 0x34, 0xf8, 0xff, 0x67, 0xd9, 0x73, 0xf4, 0x6e, 0x8e, 0x60, 0x2f, 0xad, 0x3b, 0xe5, 0x89, 0xc0, 0x47, 0x4e, 0x97, 0xde, 0x5b, 0xb2, 0xbf, 0x33, 0x53, 0x49, 0x48, 0xb7, 0x6b, 0xb8, 0x03, 0x76, 0xdf, 0xdc, 0x58, 0xb1, 0xfe, 0xd7, 0x67, 0xb5, 0xa1, 0x5b, 0xfc, 0xad, 0xcc, 0x0b, 0x6f, 0xd6, 0xdc, 0x59, 0x11, 0xbf, 0x42, 0xf0, 0x36, 0xc0, 0x33, 0xfc, 0x3e, 0x43, 0xf0, 0x7a, 0x83, 0x12, 0xe9, 0x1d, 0x0d, 0x8d, 0x32, 0x79, 0x3b, 0x62, 0x94, 0x0c, 0x7e, @@ -488,6 +516,7 @@ static uint8_t pe256dbx[] = { 0xaf, 0x93, 0xd5, 0xa2, 0x23, 0x8f, 0x01, 0xd5, 0x95, 0xa1, 0xbc, 0x20, 0x92, 0xf0, 0xab, 0x29, 0xa5, 0x50, 0xb2, 0xb9, 0x6b, 0xde, 0x73, 0x56, 0xeb, 0xf6, 0x4d, 0x8f, 0x04, 0x23, 0x49, 0x58, 0xb1, 0x33, 0xde, 0x42, 0xa3, 0x73, 0x76, 0xf5, 0xd9, 0x14, 0x39, 0xaf, 0x3d, 0x61, 0xd3, 0x82, 0x01, 0xf1, 0x03, 0x77, 0xc3, 0x6d, 0xac, 0xd9, 0xc2, 0x61, 0x0f, 0x52, 0xaa, 0x12, 0x4a, 0x91, 0xb1, 0x49, 0xb2, 0x9e, 0x82, 0x11, 0xe2, 0x48, 0x27, 0xfb, 0xe0, 0x16, 0x8d, 0x30, 0xcb, 0x26, 0x19, 0xcd,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 0x3e, 0x25, 0x84, 0x3a, 0x98, 0x9e, 0xf5, 0x1a, 0x9b, 0x44, 0xc7, 0xea, 0xfc, 0xbc, + 0xd1, 0x29, 0x24, 0x55, 0x7c, 0x7e, 0x27, 0x14, 0xa9, 0xc7, 0x7f, 0x64, 0xd6, 0xcd, 0x39, 0x1f, 0xdd, 0x65, 0x09, 0xfc, 0x13, 0x8c, 0xcd, 0xe1, 0x65, 0x12, 0xef, 0x22, 0x6d, 0x15, 0xfa, 0x7f, 0xd1, 0x4e, 0xe5, 0x61, 0x6d, 0xc8, 0xec, 0x74, 0xd6, 0x95, 0xaf, 0x08, 0xda, 0xcc, 0x78, 0xbb, 0xef, 0xaf, 0xa7, 0xa9, 0x7a, 0x5c, 0xfe, 0xab, 0x9b, 0x96, 0x1e, 0x86, 0xce, 0x9e, 0xdd, 0x37, 0xd2, 0x8a, 0xec, 0x97, 0xe2, 0x8a, 0x38, 0xd9, 0x4b, 0xe6, 0x53, 0x69, 0xe4, 0x3d, 0x01, 0xf6, 0x26, 0x61, 0x95, 0xd6, 0x11, 0x3e, 0x7e, 0xd1, 0x7a, 0x69, 0x30, 0xa3, 0x09, 0x28, 0x88, 0x00, 0xd3, 0x72, 0xc0, 0xd0, 0xf4, 0xfd, 0xc9, 0xf5, 0x2e, 0x9e, 0x1f, 0x23, 0xfc, 0x56, 0xee, 0x72, 0x41, 0x4a, 0x17, 0xf3, 0x50, 0xd0, 0xce, 0xa6, 0xc2, 0x6a, 0x35, 0xa6, 0xc3, 0x21, 0x7a, 0x13, @@ -572,11 +605,13 @@ static uint8_t pe256dbx[] = { 0xd8, 0x78, 0x17, 0xf7, 0x63, 0x09, 0xb1, 0xe4, 0x20, 0x54, 0x78, 0x08, 0xcb, 0x57, 0x3a, 0xea, 0x0c, 0x8e, 0x7d, 0xe1, 0x41, 0x23, 0x79, 0x3a, 0x42, 0x38, 0x85, 0x82, 0x18, 0x42, 0x86, 0xb7, 0xd8, 0x9a, 0x11, 0xd1, 0x6c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0x9c, 0xd5, 0xee, 0x0a, 0x54, 0xe2, 0xdd, 0x98, 0x48, 0xd7, 0xa2, 0x09, 0xd2, 0xc9, 0x45, 0x44, 0x9a, 0x0b, 0xac, 0x9a, 0x46, 0xc4, 0x5e, 0x5e, 0x03, 0x3c, 0x69, 0x82, 0xd2, 0x92, 0x48, 0x39, 0xac, 0x74, + 0xee, 0x60, 0x6f, 0xa2, 0xcd, 0x68, 0x6d, 0xb7, 0x55, 0x4c, 0x99, 0xc4, 0xbb, 0x37, 0xd8, 0x7e, 0x64, 0xf8, 0x91, 0x53, 0xef, 0x26, 0xb4, 0xcf, 0xf4, 0x18, 0x34, 0xda, 0x74, 0xeb, 0x4c, 0x1c, 0xee, 0x83, 0xa5, 0x66, 0x49, 0x61, 0x09, 0xa7, 0x4f, 0x6a, 0xc6, 0xe4, 0x10, 0xdf, 0x00, 0xbb, 0x29, 0xa2, 0x90, 0xe0, 0x02, 0x15, 0x16, 0xae, 0x3b, 0x8a, 0x23, 0x28, 0x8e, 0x7e, 0x2e, 0x72, 0xee, 0xd7, 0xe0, 0xef, 0xf2, 0xed, 0x55, 0x9e, 0x2a, 0x79, 0xee, 0x36, 0x1f, 0x99, 0x62, 0xaf, 0x3b, 0x1e, 0x99, 0x91, 0x31, 0xe3, 0x0b, 0xb7, 0xfd, 0x07, 0x54, 0x6f, 0xae, 0x0a, 0x72, 0x67, 0xef, 0x87, 0xbe, 0x89, 0xa4, 0x13, 0x65, 0x7d, 0xe8, 0x72, 0x14, 0x98, 0x55, 0x2c, 0xf9, 0xe0, 0xf3, 0xc1, 0xf7, 0x1b, 0xc6, 0x2d, 0xfa, 0x63, 0xb9, 0xf2, 0x5b, 0xbc, 0x66, 0xe8, 0x64, 0x94, @@ -633,12 +674,14 @@ static uint8_t pe256dbx[] = { 0xf3, 0x30, 0xf2, 0x3c, 0x09, 0x77, 0x2a, 0x64, 0xe1, 0x47, 0x8a, 0x19, 0xce, 0x00, 0x3f, 0xab, 0xca, 0x4f, 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7f, 0xed, 0xe6, 0xa1, 0xe0, 0xd6, 0xa0, 0x54, 0x6c, 0xbf, 0x8b, 0x8c, 0xf0, 0xb8, 0x22, 0x58, 0xfc, 0x16, 0xd0, 0x5b, 0xab, 0x58, 0x10, 0x7d, 0x34, + 0xff, 0x6a, 0xcf, 0xbd, 0x59, 0x62, 0x49, 0x9f, 0xb8, 0x84, 0x6d, 0xaf, 0x87, 0xb8, 0x83, 0x20, 0xc1, 0x15, 0xd7, 0x71, 0x1e, 0xa6, 0x45, 0xba, 0x67, 0x42, 0xe8, 0x59, 0x8e, 0x88, 0x4b, 0xd8, 0xff, 0xd7, 0x68, 0x8e, 0x7d, 0x2b, 0x8c, 0x3c, 0x31, 0x40, 0xb4, 0x15, 0xe7, 0x28, 0xbb, 0xe7, 0x66, 0x3c, 0x54, 0xe2, 0x3b, 0xd2, 0x88, 0xff, 0x2c, 0xf4, 0x61, 0x78, 0x35, 0x08, 0x8f, 0x39, 0xff, 0xf4, 0x21, 0xa9, 0xdc, 0xd3, 0xef, 0x38, 0xad, 0x58, 0x5e, 0x8b, 0xac, 0xa4, 0x08, 0xac, 0x2e, 0x4c, 0xdb, 0xdf, 0xa6, 0x79, 0x90, 0x0e, 0xc1, 0x70, 0x89, 0x62, 0x4e, 0x31, 0x0a, 0xda, }; diff --git a/src/localization_data.sh b/src/localization_data.sh index b9568e34..ec2615fc 100755 --- a/src/localization_data.sh +++ b/src/localization_data.sh @@ -12,7 +12,7 @@ cat > cmd.sed <<\_EOF 1i /*\ * Rufus: The Reliable USB Formatting Utility\ * Localization tables - autogenerated from resource.h\ - * Copyright © 2013-2024 Pete Batard <pete@akeo.ie>\ + * Copyright © 2013-2025 Pete Batard <pete@akeo.ie>\ *\ * This program is free software: you can redistribute it and/or modify\ * it under the terms of the GNU General Public License as published by\ diff --git a/src/rufus.c b/src/rufus.c index 430ba9f3..5e3d2ce3 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1,6 +1,6 @@ /* * Rufus: The Reliable USB Formatting Utility - * Copyright © 2011-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2011-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/rufus.rc b/src/rufus.rc index 5229cc74..68eecb10 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.7.2216" +CAPTION "Rufus 4.7.2217" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2216,0 - PRODUCTVERSION 4,7,2216,0 + FILEVERSION 4,7,2217,0 + PRODUCTVERSION 4,7,2217,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2216" + VALUE "FileVersion", "4.7.2217" VALUE "InternalName", "Rufus" - VALUE "LegalCopyright", " 2011-2024 Pete Batard (GPL v3)" + VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2216" + VALUE "ProductVersion", "4.7.2217" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index 0be69245..d0151116 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Standard Dialog Routines (Browse for folder, About, etc) - * Copyright © 2011-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2011-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -386,7 +386,7 @@ INT_PTR CALLBACK AboutCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP ResizeButtonHeight(hDlg, IDOK); static_sprintf(about_blurb, about_blurb_format, lmprintf(MSG_174|MSG_RTF), lmprintf(MSG_175|MSG_RTF, rufus_version[0], rufus_version[1], rufus_version[2]), - "Copyright © 2011-2024 Pete Batard", + "Copyright © 2011-2025 Pete Batard", lmprintf(MSG_176|MSG_RTF), lmprintf(MSG_177|MSG_RTF), lmprintf(MSG_178|MSG_RTF)); for (i = 0; i < ARRAYSIZE(hEdit); i++) { hEdit[i] = GetDlgItem(hDlg, edit_id[i]); From d910441427b691e6c4d4891142010e6b7de8b351 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Sat, 25 Jan 2025 12:12:37 +0000 Subject: [PATCH 027/192] [misc] Fix issue template no longer being processed * Since GitHub broke existing paths and did not bother to alert people. * Closes #2672. --- .github/ISSUE_TEMPLATE/config.yml | 1 + .../issue-report.md} | 105 ++++++++++-------- .github/workflows/codeql.yml | 1 + .github/workflows/coverity.yml | 1 + .github/workflows/mingw.yml | 1 + .github/workflows/vs2022.yml | 1 + SECURITY.md | 10 +- src/rufus.rc | 10 +- 8 files changed, 73 insertions(+), 57 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/config.yml rename .github/{issue_template.md => ISSUE_TEMPLATE/issue-report.md} (94%) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..3ba13e0c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/issue_template.md b/.github/ISSUE_TEMPLATE/issue-report.md similarity index 94% rename from .github/issue_template.md rename to .github/ISSUE_TEMPLATE/issue-report.md index 2da326fd..6166d9fd 100644 --- a/.github/issue_template.md +++ b/.github/ISSUE_TEMPLATE/issue-report.md @@ -1,48 +1,57 @@ -<!-- -PLEASE READ THIS CAREFULLY: - -1. You *MUST* read and complete the steps from the checklist below, by placing - an x into each [ ] (so that it shows '[x]', NOT '[ x]' or '[x ]'), BEFORE - clicking on 'Submit new issue'. - -2. Failure to perform these steps, WHICH ARE ONLY THERE TO HELP *YOU*, will - usually result in your issue being dismissed without notice. - -3. If you are reporting an issue when trying to run Rufus, or when trying to - boot a media created by Rufus, you *MUST* provide a log, period. Please do - not assume that the developer(s) will be able to "guess" the specifics of - your environment, what image you used, what type of media you used it with - or the many many other critical parameters that the log provides data for. - To investigate an issue, a log from Rufus is ALWAYS required. - -4. If you still *choose* not to provide a log when reporting a problem, you - agree that your issue will be closed without any further investigation. - -YOU HAVE BEEN WARNED. ---> - -Checklist ---------- -- [ ] I have been made aware that if my problem can be summarized as _"I've created or tried to create a media using Rufus, and ..."_, and I am not including a log, **this issue will be summarily closed**. -- [ ] I looked at https://github.com/pbatard/rufus/wiki/FAQ to see if my question has already been answered. -- [ ] I performed a search in the issue tracker for similar issues using keywords relevant to my problem, such as the error message I got from the log. -- [ ] I clicked the 'Log' button (🗒️) or pressed <kbd>Ctrl</kbd>-<kbd>L</kbd> in Rufus, or used [DebugView](https://learn.microsoft.com/en-us/sysinternals/downloads/debugview), and copy/pasted the log into the section that says `<FULL LOG>` below. -- [ ] The log I am copying is the FULL log, starting with the line `Rufus version: x.y.z` - I have NOT removed any part of it. - -Additionally (if applicable): -- [ ] I ran a bad blocks check, by clicking _Show advanced format options_ then _Check device for bad blocks_, and confirmed that my USB is not defective. -- [ ] I also tried one or more of the following: - - [ ] Using a different USB drive. - - [ ] Plugging the USB into a different port. - - [ ] Running Rufus on a different computer. -- [ ] If using an image, I clicked on the `(✓)` button to compute the MD5, SHA1 and SHA256 checksums, which are therefore present in the log I copied. I confirmed, by performing an internet search, that these values match the ones from the official image. - -Issue description ------------------ -<Please describe your issue here> - -Log ---- -``` -<FULL LOG> -``` +--- +name: Report an issue with the application +about: Please make sure you follow the check-list carefully! +title: '' +labels: '' +assignees: '' + +--- + +<!-- +PLEASE READ THIS CAREFULLY: + +1. You *MUST* read and complete the steps from the checklist below, by placing + an x into each [ ] (so that it shows '[x]', NOT '[ x]' or '[x ]'), BEFORE + clicking on 'Submit new issue'. + +2. Failure to perform these steps, WHICH ARE ONLY THERE TO HELP *YOU*, will + usually result in your issue being dismissed without notice. + +3. If you are reporting an issue when trying to run Rufus, or when trying to + boot a media created by Rufus, you *MUST* provide a log, period. Please do + not assume that the developer(s) will be able to "guess" the specifics of + your environment, what image you used, what type of media you used it with + or the many many other critical parameters that the log provides data for. + To investigate an issue, a log from Rufus is ALWAYS required. + +4. If you still *choose* not to provide a log when reporting a problem, you + agree that your issue will be closed without any further investigation. + +YOU HAVE BEEN WARNED. +--> + +Checklist +--------- +- [ ] I have been made aware that if my problem can be summarized as _"I've created or tried to create a media using Rufus, and ..."_, and I am not including a log, **this issue will be summarily closed**. +- [ ] I looked at https://github.com/pbatard/rufus/wiki/FAQ to see if my question has already been answered. +- [ ] I performed a search in the issue tracker for similar issues using keywords relevant to my problem, such as the error message I got from the log. +- [ ] I clicked the 'Log' button (🗒️) or pressed <kbd>Ctrl</kbd>-<kbd>L</kbd> in Rufus, or used [DebugView](https://learn.microsoft.com/en-us/sysinternals/downloads/debugview), and copy/pasted the log into the section that says `<FULL LOG>` below. +- [ ] The log I am copying is the FULL log, starting with the line `Rufus version: x.y.z` - I have NOT removed any part of it. + +Additionally (if applicable): +- [ ] I ran a bad blocks check, by clicking _Show advanced format options_ then _Check device for bad blocks_, and confirmed that my USB is not defective. +- [ ] I also tried one or more of the following: + - [ ] Using a different USB drive. + - [ ] Plugging the USB into a different port. + - [ ] Running Rufus on a different computer. +- [ ] If using an image, I clicked on the `(✓)` button to compute the MD5, SHA1 and SHA256 checksums, which are therefore present in the log I copied. I confirmed, by performing an internet search, that these values match the ones from the official image. + +Issue description +----------------- +<Please describe your issue here> + +Log +--- +``` +<FULL LOG> +``` diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 040896d5..fdb0763e 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -4,6 +4,7 @@ on: push: branches: [master] paths-ignore: + - '.github/ISSUE_TEMPLATE/**' - '.gitignore' - '.gitattributes' - 'res/**' diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 98bcca8d..da40284e 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -4,6 +4,7 @@ on: push: branches: [master] paths-ignore: + - '.github/ISSUE_TEMPLATE/**' - '.gitignore' - '.gitattributes' - 'res/**' diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml index c56eacc6..b62435b5 100644 --- a/.github/workflows/mingw.yml +++ b/.github/workflows/mingw.yml @@ -3,6 +3,7 @@ name: MinGW on: push: paths-ignore: + - '.github/ISSUE_TEMPLATE/**' - '.gitignore' - '.gitattributes' - 'res/**' diff --git a/.github/workflows/vs2022.yml b/.github/workflows/vs2022.yml index 457b2f58..963477fe 100644 --- a/.github/workflows/vs2022.yml +++ b/.github/workflows/vs2022.yml @@ -3,6 +3,7 @@ name: VS2022 on: push: paths-ignore: + - '.github/ISSUE_TEMPLATE/**' - '.gitignore' - '.gitattributes' - 'res/**' diff --git a/SECURITY.md b/SECURITY.md index b2dc36bf..55b8812f 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,7 +1,9 @@ -# Reporting a Vulnerability +# Reporting a security vulnerability -To report a vulnerability for Rufus, please e-mail support@akeo.ie. +To report a **security** vulnerability for Rufus (i.e. an issue that you believe could lead to malicious actors being able to exploit the Rufus application), please e-mail support@akeo.ie. -If you find a vulnerability, we will ask you to respect [responsible disclosure](https://en.wikipedia.org/wiki/Responsible_disclosure) practices. +Please do **NOT** use the e-mail above if you have a regular issue, such as a problem creating or using a bootable drive. Instead go back to https://github.com/pbatard/rufus/issues and create an issue using the regular *Issue Report* template. -In return, we will endeavour to respond to vulnerability reports within 48 hours. +For any security vulnerability report, we kindly ask you to respect [responsible disclosure](https://en.wikipedia.org/wiki/Responsible_disclosure) practices. + +In return, we will endeavour to respond to security vulnerability reports within 48 hours. diff --git a/src/rufus.rc b/src/rufus.rc index 68eecb10..c40170ab 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.7.2217" +CAPTION "Rufus 4.7.2218" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2217,0 - PRODUCTVERSION 4,7,2217,0 + FILEVERSION 4,7,2218,0 + PRODUCTVERSION 4,7,2218,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2217" + VALUE "FileVersion", "4.7.2218" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2217" + VALUE "ProductVersion", "4.7.2218" END END BLOCK "VarFileInfo" From ec604f43d61ee95489d18aa240cc567afa99a04a Mon Sep 17 00:00:00 2001 From: lucamosca1 <luca.moscato@gmail.com> Date: Thu, 30 Jan 2025 14:10:15 +0100 Subject: [PATCH 028/192] [loc] fix a typo in the Italian translation * Closes #2675. --- res/loc/po/it-IT.po | 2 +- res/loc/rufus.loc | 2 +- src/rufus.rc | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/res/loc/po/it-IT.po b/res/loc/po/it-IT.po index a6d74069..911eb83a 100644 --- a/res/loc/po/it-IT.po +++ b/res/loc/po/it-IT.po @@ -1875,7 +1875,7 @@ msgid "" msgstr "" "Rufus ha rilevato che l'ISO selezionata contiene un bootloader UEFI che è stato revocato e che quando Secure Boot è abilitato su un sistema UEFI completamente aggiornato produrrà %s. \n" "\n" -"- Se hai ottenuto questa immagine ISO da una so0egente non affidabile, dovresti considerare la possibilità che possa contenere malware UEFI ed evitare di eseguire l'avvio da esso.\n" +"- Se hai ottenuto questa immagine ISO da una sorgente non affidabile, dovresti considerare la possibilità che possa contenere malware UEFI ed evitare di eseguire l'avvio da esso.\n" "- Se l'hai ottenuto da una sorgente attendibile, dovresti provare a cercare una versione più aggiornata, che non genererà questo avviso." #. • MSG_340 diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index a7ea03f1..822189f6 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -7286,7 +7286,7 @@ t MSG_335 "Disabilita la crittografia automatica dei dispositivi BitLocker" t MSG_336 "Log persistente" t MSG_337 "Per installare MS-DOS è necessario scaricare da Microsoft un file aggiuntivo (\"diskcopy.dll\"):\n- Seleziona 'Sì' per connettersi ad internet e scaricarlo\n- Seleziona 'No' per annullare l'operazione\n\nNota: il file verrà scaricato nella cartella dell'applicazione e se presente verrà riutilizzato automaticamente." t MSG_338 "Rilevato bootloader UEFI revocato" -t MSG_339 "Rufus ha rilevato che l'ISO selezionata contiene un bootloader UEFI che è stato revocato e che quando Secure Boot è abilitato su un sistema UEFI completamente aggiornato produrrà %s. \n\n- Se hai ottenuto questa immagine ISO da una so0egente non affidabile, dovresti considerare la possibilità che possa contenere malware UEFI ed evitare di eseguire l'avvio da esso.\n- Se l'hai ottenuto da una sorgente attendibile, dovresti provare a cercare una versione più aggiornata, che non genererà questo avviso." +t MSG_339 "Rufus ha rilevato che l'ISO selezionata contiene un bootloader UEFI che è stato revocato e che quando Secure Boot è abilitato su un sistema UEFI completamente aggiornato produrrà %s. \n\n- Se hai ottenuto questa immagine ISO da una sorgente non affidabile, dovresti considerare la possibilità che possa contenere malware UEFI ed evitare di eseguire l'avvio da esso.\n- Se l'hai ottenuto da una sorgente attendibile, dovresti provare a cercare una versione più aggiornata, che non genererà questo avviso." t MSG_340 "una schermata \"Violazione sicurezza\"" t MSG_341 "una schermata di ripristino Windows (BSOD) con '%s'" t MSG_342 "Immagine VHDX compressa" diff --git a/src/rufus.rc b/src/rufus.rc index c40170ab..17de105f 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.7.2218" +CAPTION "Rufus 4.7.2219" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2218,0 - PRODUCTVERSION 4,7,2218,0 + FILEVERSION 4,7,2219,0 + PRODUCTVERSION 4,7,2219,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2218" + VALUE "FileVersion", "4.7.2219" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2218" + VALUE "ProductVersion", "4.7.2219" END END BLOCK "VarFileInfo" From f3c29bf537e992f49bf5a2dfd17c5adb9c887887 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 13 Feb 2025 12:37:02 +0000 Subject: [PATCH 029/192] [misc] fix and silence some Coverity warnings --- res/loc/po/!update.cmd | 2 +- res/loc/po/fa-IR.po | 6 +++--- res/loc/rufus.loc | 2 +- src/bled/huf_decompress.c | 1 + src/bled/xxhash.h | 1 + src/bled/xz_dec_lzma2.c | 1 + src/bled/zstd_decompress.c | 1 + src/msapi_utf8.h | 14 ++++++++++++-- src/parser.c | 7 ++++--- src/rufus.rc | 10 +++++----- 10 files changed, 30 insertions(+), 15 deletions(-) diff --git a/res/loc/po/!update.cmd b/res/loc/po/!update.cmd index cb184e20..50f09535 100644 --- a/res/loc/po/!update.cmd +++ b/res/loc/po/!update.cmd @@ -1,5 +1,5 @@ @echo off -if not exist pollock.exe curl https://files.akeo.ie/pollock/pollock-1.5.exe --output pollock.exe +if not exist pollock.exe curl https://files.akeo.ie/pollock/pollock-1.6.exe --output pollock.exe cls :menu echo 1 - Import .po into .loc diff --git a/res/loc/po/fa-IR.po b/res/loc/po/fa-IR.po index 1cc4b9b5..0db1fd2c 100644 --- a/res/loc/po/fa-IR.po +++ b/res/loc/po/fa-IR.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: 4.5\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" "POT-Creation-Date: 2024-04-29 19:24+0300\n" -"PO-Revision-Date: 2024-04-29 20:25+0330\n" +"PO-Revision-Date: 2025-02-13 12:00+0000\n" "Last-Translator: MasterVito <mv@mvaop.ir>\n" "Language-Team: \n" "Language: fa_IR\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Persian (پارسی)\n" "X-Rufus-LCID: 0x0429\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.5\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -1094,7 +1094,7 @@ msgstr "نسخه %d.%d (Build %d)" #. • MSG_176 msgid "English translation: Pete Batard <mailto:pete@akeo.ie>" -msgstr "ترجمه فارسی:\\line‏ •سید عرفان <mailto:mv@mvaop.ir>\\line‏ •ضیاءالدین عظیمی <mailto:s.zia.azimi@gmail.com>" +msgstr "ترجمه فارسی:\\line‏ •مستر ویتو <mailto:mv@mvaop.ir>\\line‏ •ضیاءالدین عظیمی <mailto:s.zia.azimi@gmail.com>" #. • MSG_177 msgid "Report bugs or request enhancements at:" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 822189f6..04e3529b 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -10049,7 +10049,7 @@ t MSG_172 "امضای فایل دانلود شده معتبر نیست" t MSG_173 "برای انتخاب کلیک کنید..." t MSG_174 "Rufus، ابزاری کاربردی و قابل‌اطمینان برای فرمت کردن درایوهای USB" t MSG_175 "نسخه %d.%d (Build %d)" -t MSG_176 "ترجمه فارسی:\\line‏ •سید عرفان <mailto:mv@mvaop.ir>\\line‏ •ضیاءالدین عظیمی <mailto:s.zia.azimi@gmail.com>" +t MSG_176 "ترجمه فارسی:\\line‏ •مستر ویتو <mailto:mv@mvaop.ir>\\line‏ •ضیاءالدین عظیمی <mailto:s.zia.azimi@gmail.com>" t MSG_177 "گزارش اشکال (Bug) یا درخواست قابلیت جدید و بهبود نرم‌افزار در:" t MSG_178 "حقوق نشر دیگران:" t MSG_179 "سیاست به‌روزرسانی:" diff --git a/src/bled/huf_decompress.c b/src/bled/huf_decompress.c index d870f112..1f38c40e 100644 --- a/src/bled/huf_decompress.c +++ b/src/bled/huf_decompress.c @@ -1208,6 +1208,7 @@ size_t HUF_readDTableX2_wksp(HUF_DTable* DTable, if (tableLog <= HUF_DECODER_FAST_TABLELOG && maxTableLog > HUF_DECODER_FAST_TABLELOG) maxTableLog = HUF_DECODER_FAST_TABLELOG; /* find maxWeight */ + // coverity[underflow] for (maxW = tableLog; wksp->rankStats[maxW]==0; maxW--) {} /* necessarily finds a solution before 0 */ /* Get start index of each weight */ diff --git a/src/bled/xxhash.h b/src/bled/xxhash.h index e59e4426..76f541b5 100644 --- a/src/bled/xxhash.h +++ b/src/bled/xxhash.h @@ -3402,6 +3402,7 @@ XXH64_finalize(xxh_u64 hash, const xxh_u8* ptr, size_t len, XXH_alignment align) hash ^= (xxh_u64)(XXH_get32bits(ptr)) * XXH_PRIME64_1; ptr += 4; hash = XXH_rotl64(hash, 23) * XXH_PRIME64_2 + XXH_PRIME64_3; + // coverity[overflow_const] len -= 4; } while (len > 0) { diff --git a/src/bled/xz_dec_lzma2.c b/src/bled/xz_dec_lzma2.c index 7d936a83..15deb0d5 100644 --- a/src/bled/xz_dec_lzma2.c +++ b/src/bled/xz_dec_lzma2.c @@ -641,6 +641,7 @@ static void XZ_FUNC lzma_len(struct xz_dec_lzma2 *s, struct lzma_len_dec *l, } } + // coverity[overflow_const] s->lzma.len += rc_bittree(&s->rc, probs, limit) - limit; } diff --git a/src/bled/zstd_decompress.c b/src/bled/zstd_decompress.c index fcf29f75..03b82c29 100644 --- a/src/bled/zstd_decompress.c +++ b/src/bled/zstd_decompress.c @@ -721,6 +721,7 @@ static size_t ZSTD_decodeFrameHeader(ZSTD_DCtx* dctx, const void* src, size_t he static ZSTD_frameSizeInfo ZSTD_errorFrameSizeInfo(size_t ret) { ZSTD_frameSizeInfo frameSizeInfo; + frameSizeInfo.nbBlocks = 0; frameSizeInfo.compressedSize = ret; frameSizeInfo.decompressedBound = ZSTD_CONTENTSIZE_ERROR; return frameSizeInfo; diff --git a/src/msapi_utf8.h b/src/msapi_utf8.h index e0510f41..e6ab9ad2 100644 --- a/src/msapi_utf8.h +++ b/src/msapi_utf8.h @@ -6,7 +6,7 @@ * * See also: https://utf8everywhere.org * - * Copyright © 2010-2023 Pete Batard <pete@akeo.ie> + * Copyright © 2010-2025 Pete Batard <pete@akeo.ie> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -174,14 +174,24 @@ static __inline DWORD FormatMessageU(DWORD dwFlags, LPCVOID lpSource, DWORD dwMe DWORD dwLanguageId, char* lpBuffer, DWORD nSize, va_list *Arguments) { DWORD ret = 0, err = ERROR_INVALID_DATA; - // coverity[returned_null] + // Exclude support for the FORMAT_MESSAGE_ALLOCATE_BUFFER special case. + if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } walloc(lpBuffer, nSize); + if (wlpBuffer == NULL) { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return 0; + } ret = FormatMessageW(dwFlags, lpSource, dwMessageId, dwLanguageId, wlpBuffer, nSize, Arguments); err = GetLastError(); if ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpBuffer, lpBuffer, nSize)) == 0)) { err = GetLastError(); ret = 0; } + // Coverity doesn't realise that we filtered out the FORMAT_MESSAGE_ALLOCATE_BUFFER case + // coverity[leaked_storage] wfree(lpBuffer); SetLastError(err); return ret; diff --git a/src/parser.c b/src/parser.c index 3d6a6a58..2f53b1d0 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Elementary Unicode compliant find/replace parser - * Copyright © 2012-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2012-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -55,7 +55,7 @@ static loc_cmd* get_loc_cmd(char c, char* line) { char *endptr, *expected_endptr, *token; loc_cmd* lcmd = NULL; - for (j=0; j<ARRAYSIZE(parse_cmd); j++) { + for (j = 0; j<ARRAYSIZE(parse_cmd); j++) { if (c == parse_cmd[j].c) break; } @@ -133,10 +133,11 @@ static loc_cmd* get_loc_cmd(char c, char* line) { case 'u': // comma or dot separated list of unsigned integers (to end of line) // count the number of commas lcmd->unum_size = 1; - for (l=i; line[l] != 0; l++) { + for (l = i; line[l] != 0; l++) { if ((line[l] == '.') || (line[l] == ',')) lcmd->unum_size++; } + free(lcmd->unum); lcmd->unum = (uint32_t*)malloc(lcmd->unum_size * sizeof(uint32_t)); if (lcmd->unum == NULL) { luprint("could not allocate memory"); diff --git a/src/rufus.rc b/src/rufus.rc index 17de105f..2093c96a 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.7.2219" +CAPTION "Rufus 4.7.2220" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2219,0 - PRODUCTVERSION 4,7,2219,0 + FILEVERSION 4,7,2220,0 + PRODUCTVERSION 4,7,2220,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2219" + VALUE "FileVersion", "4.7.2220" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2219" + VALUE "ProductVersion", "4.7.2220" END END BLOCK "VarFileInfo" From 50801a47ffc947a450740100ba76019519cb7b6a Mon Sep 17 00:00:00 2001 From: Rairii <2650838+Wack0@users.noreply.github.com> Date: Mon, 10 Feb 2025 16:11:50 +0000 Subject: [PATCH 030/192] [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. --- src/rufus.rc | 10 +++++----- src/stdio.c | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/rufus.rc b/src/rufus.rc index 2093c96a..8c8fc306 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.7.2220" +CAPTION "Rufus 4.7.2221" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2220,0 - PRODUCTVERSION 4,7,2220,0 + FILEVERSION 4,7,2221,0 + PRODUCTVERSION 4,7,2221,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2220" + VALUE "FileVersion", "4.7.2221" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2220" + VALUE "ProductVersion", "4.7.2221" END END BLOCK "VarFileInfo" diff --git a/src/stdio.c b/src/stdio.c index db6d9086..8346ed32 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -234,10 +234,22 @@ const char *WindowsErrorString(void) DWORD size, presize; DWORD error_code, _error_code, format_error; + LCID locale; HANDLE hModule = NULL; error_code = GetLastError(); _error_code = error_code; + // Set thread locale to en-US when in this function. + // This is because kernel32!FormatMessage is documented to try the following order when dwLanguageId==0: + // - Language neutral + // - Thread locale + // - User default locale + // - System default locale + // - English US + // Some Windows localisations do not provide English MUI resources for specific error codes. + // So with thread locale set to en-US, FormatMessage will try neutral, then en-US, then fall back to localised string. + locale = GetThreadLocale(); + SetThreadLocale(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT)); retry: // Check for specific facility error codes switch (HRESULT_FACILITY(_error_code)) { @@ -262,7 +274,7 @@ retry: // coverity[var_deref_model] size = FormatMessageU(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | ((hModule != NULL) ? FORMAT_MESSAGE_FROM_HMODULE : 0), hModule, - _error_code, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), + _error_code, 0, &err_string[presize], (DWORD)(sizeof(err_string) - strlen(err_string)), NULL); if (size == 0) { format_error = GetLastError(); @@ -278,7 +290,7 @@ retry: _error_code = HRESULT_CODE(_error_code); goto retry; } - static_sprintf(err_string, "[0x%08lX] (NB: This system was unable to provide an English error message)", error_code); + static_sprintf(err_string, "[0x%08lX] (NB: This system was unable to provide a descriptive error message)", error_code); break; default: static_sprintf(err_string, "[0x%08lX] (FormatMessage error code 0x%08lX)", error_code, format_error); @@ -293,6 +305,7 @@ retry: err_string[size--] = 0; } + SetThreadLocale(locale); // Set the original thread locale on exit SetLastError(error_code); // Make sure we don't change the errorcode on exit return err_string; } From 622e60659cb0c7c3e69f5255c0e99127eed0ada6 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 18 Feb 2025 21:53:23 +0000 Subject: [PATCH 031/192] [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. --- .mingw/Makefile.am | 2 ++ .mingw/Makefile.in | 2 ++ .mingw/cfgmgr32.def | 10 +++++++ Makefile.am | 3 +++ Makefile.in | 3 +++ src/Makefile.am | 4 +-- src/Makefile.in | 4 +-- src/dev.c | 63 +++++++++++++++++++++++++++++++++------------ src/dev.h | 32 +++-------------------- src/rufus.c | 24 ++++++++++++----- src/rufus.h | 3 ++- src/rufus.rc | 10 +++---- 12 files changed, 99 insertions(+), 61 deletions(-) create mode 100644 .mingw/cfgmgr32.def diff --git a/.mingw/Makefile.am b/.mingw/Makefile.am index ec826d27..e8d55d27 100644 --- a/.mingw/Makefile.am +++ b/.mingw/Makefile.am @@ -14,11 +14,13 @@ AM_V_SED = $(AM_V_SED_$(V)) # target arch. Oh, and we can't use 'target_cpu' or AC definitions on account that we are # switching archs when building on our local machine, and don't want to have to go though # a costly reconf each time when we can simply issue a 'make clean'. +# Oh, and to find the number after the @ sign, just have a look at the MinGW .a libraries. TUPLE := $(shell $(CC) -dumpmachine) TARGET := $(word 1,$(subst -, ,$(TUPLE))) DEF_SUFFIX := $(if $(TARGET:x86_64=),.def,.def64) .PHONY: all +# Ideally, we would also have cfgmgr32-delaylib here, but it doesn't actually delay load... :( all: dwmapi-delaylib.lib version-delaylib.lib virtdisk-delaylib.lib wininet-delaylib.lib wintrust-delaylib.lib %.def64: %.def diff --git a/.mingw/Makefile.in b/.mingw/Makefile.in index 117eb9c4..8174663d 100644 --- a/.mingw/Makefile.in +++ b/.mingw/Makefile.in @@ -212,6 +212,7 @@ AM_V_SED = $(AM_V_SED_$(V)) # target arch. Oh, and we can't use 'target_cpu' or AC definitions on account that we are # switching archs when building on our local machine, and don't want to have to go though # a costly reconf each time when we can simply issue a 'make clean'. +# Oh, and to find the number after the @ sign, just have a look at the MinGW .a libraries. TUPLE := $(shell $(CC) -dumpmachine) TARGET := $(word 1,$(subst -, ,$(TUPLE))) DEF_SUFFIX := $(if $(TARGET:x86_64=),.def,.def64) @@ -367,6 +368,7 @@ uninstall-am: .PHONY: all +# Ideally, we would also have cfgmgr32-delaylib here, but it doesn't actually delay load... :( all: dwmapi-delaylib.lib version-delaylib.lib virtdisk-delaylib.lib wininet-delaylib.lib wintrust-delaylib.lib %.def64: %.def diff --git a/.mingw/cfgmgr32.def b/.mingw/cfgmgr32.def new file mode 100644 index 00000000..81eca2b3 --- /dev/null +++ b/.mingw/cfgmgr32.def @@ -0,0 +1,10 @@ +EXPORTS + CM_Get_Device_IDA@16 + CM_Get_Device_ID_List_SizeA@12 + CM_Get_Device_ID_ListA@16 + CM_Locate_DevNodeA@12 + CM_Get_Child@12 + CM_Get_Sibling@12 + CM_Get_Parent@12 + CM_Get_DevNode_Status@16 + CM_Get_DevNode_Registry_PropertyA@24 diff --git a/Makefile.am b/Makefile.am index dfc8d20d..e3145a67 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,6 +3,9 @@ TARGET = rufus TAGVER = $(shell git log --oneline | wc -l) SEDCMD = s/^\([ \t]*\)Version="\([0-9]*\)\.\([0-9]*\)\.[0-9]*\.\([0-9]*\)"\(.*\)/\1Version="\2.\3.@@TAGVER@@.\4"\5/ +upx: all + @upx --lzma --best src/$(TARGET)$(EXEEXT) + # This step produces the UPX compressed and signed releases that are made available for public download # NB: UPX v3.09 or later is needed for LZMA compression (http://upx.sourceforge.net/) release: all diff --git a/Makefile.in b/Makefile.in index a3c4e7db..ef78f444 100644 --- a/Makefile.in +++ b/Makefile.in @@ -502,6 +502,9 @@ uninstall-am: pdf-am ps ps-am tags tags-am uninstall uninstall-am +upx: all + @upx --lzma --best src/$(TARGET)$(EXEEXT) + # This step produces the UPX compressed and signed releases that are made available for public download # NB: UPX v3.09 or later is needed for LZMA compression (http://upx.sourceforge.net/) release: all diff --git a/src/Makefile.am b/src/Makefile.am index f9416588..7f68b39b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,9 +2,9 @@ SUBDIRS = ../.mingw bled ext2fs ms-sys syslinux/libfat syslinux/libinstaller sys # As far as I can tell, the following libraries are *not* vulnerable to side-loading, so we link using their regular version: NONVULNERABLE_LIBS = -lsetupapi -lole32 -lgdi32 -lshlwapi -lcrypt32 -lcomctl32 -luuid # The following libraries are vulnerable (or have an unknown vulnerability status), so we link using our delay-loaded replacement: -# Ideally there would also be virtdisk and wininet as delaylib's below, but the MinGW folks haven't quite sorted out delay-loading -# for x86_32 so as soon as you try to call APIs from these, the application will crash! # See https://github.com/pbatard/rufus/issues/2272 +# Oh, and don't bother trying to delay load cfgmgr32.dll, even with the DECLSPEC_IMPORT __attribute__((visibility("hidden"))) +# override. It just DOESN'T BLOODY WORK and you will waste HOURS on a wild goose chase!!! VULNERABLE_LIBS = -ldwmapi-delaylib -lversion-delaylib -lvirtdisk-delaylib -lwininet-delaylib -lwintrust-delaylib noinst_PROGRAMS = rufus diff --git a/src/Makefile.in b/src/Makefile.in index 1b3d4e3c..e3132680 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -276,9 +276,9 @@ SUBDIRS = ../.mingw bled ext2fs ms-sys syslinux/libfat syslinux/libinstaller sys # As far as I can tell, the following libraries are *not* vulnerable to side-loading, so we link using their regular version: NONVULNERABLE_LIBS = -lsetupapi -lole32 -lgdi32 -lshlwapi -lcrypt32 -lcomctl32 -luuid # The following libraries are vulnerable (or have an unknown vulnerability status), so we link using our delay-loaded replacement: -# Ideally there would also be virtdisk and wininet as delaylib's below, but the MinGW folks haven't quite sorted out delay-loading -# for x86_32 so as soon as you try to call APIs from these, the application will crash! # See https://github.com/pbatard/rufus/issues/2272 +# Oh, and don't bother trying to delay load cfgmgr32.dll, even with the DECLSPEC_IMPORT __attribute__((visibility("hidden"))) +# override. It just DOESN'T BLOODY WORK and you will waste HOURS on a wild goose chase!!! VULNERABLE_LIBS = -ldwmapi-delaylib -lversion-delaylib -lvirtdisk-delaylib -lwininet-delaylib -lwintrust-delaylib AM_V_WINDRES_0 = @echo " RC $@";$(WINDRES) AM_V_WINDRES_1 = $(WINDRES) diff --git a/src/dev.c b/src/dev.c index a5768a8f..cbecdda2 100644 --- a/src/dev.c +++ b/src/dev.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Device detection and enumeration - * Copyright © 2014-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2014-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,6 +49,21 @@ extern RUFUS_DRIVE rufus_drive[MAX_DRIVES]; extern BOOL enable_HDDs, enable_VHDs, use_fake_units, enable_vmdk, usb_debug; extern BOOL list_non_usb_removable_drives, its_a_me_mario; +/* + * CfgMgr32.dll interface. + * Note that, unlike what is the case with other DLLs, delay-loading of cfgmgr32 + * does *not* work with MinGW, so we have to go through direct hooking yet again... + */ +PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Get_Device_IDA, (DEVINST, CHAR*, ULONG, ULONG)); +PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Get_Device_ID_List_SizeA, (PULONG, PCSTR, ULONG)); +PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Get_Device_ID_ListA, (PCSTR, PCHAR, ULONG, ULONG)); +PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Locate_DevNodeA, (PDEVINST, DEVINSTID_A, ULONG)); +PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Get_Child, (PDEVINST, DEVINST, ULONG)); +PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Get_Parent, (PDEVINST, DEVINST, ULONG)); +PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Get_Sibling, (PDEVINST, DEVINST, ULONG)); +PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Get_DevNode_Status, (PULONG, PULONG, DEVINST, ULONG)); +PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Get_DevNode_Registry_PropertyA, (DEVINST, ULONG, PULONG, PVOID, PULONG, ULONG)); + /* * Get the VID, PID and current device speed */ @@ -65,7 +80,10 @@ static BOOL GetUSBProperties(char* parent_path, char* device_id, usb_device_prop if ((parent_path == NULL) || (device_id == NULL) || (props == NULL)) goto out; - cr = CM_Locate_DevNodeA(&device_inst, device_id, 0); + PF_INIT_OR_OUT(CM_Locate_DevNodeA, CfgMgr32); + PF_INIT_OR_OUT(CM_Get_DevNode_Registry_PropertyA, CfgMgr32); + + cr = pfCM_Locate_DevNodeA(&device_inst, device_id, 0); if (cr != CR_SUCCESS) { uprintf("Could not get device instance handle for '%s': CR error %d", device_id, cr); goto out; @@ -73,7 +91,7 @@ static BOOL GetUSBProperties(char* parent_path, char* device_id, usb_device_prop props->port = 0; size = sizeof(props->port); - cr = CM_Get_DevNode_Registry_PropertyA(device_inst, CM_DRP_ADDRESS, NULL, (PVOID)&props->port, &size, 0); + cr = pfCM_Get_DevNode_Registry_PropertyA(device_inst, CM_DRP_ADDRESS, NULL, (PVOID)&props->port, &size, 0); if (cr != CR_SUCCESS) { uprintf("Could not get port for '%s': CR error %d", device_id, cr); goto out; @@ -196,6 +214,8 @@ int CycleDevice(int index) if ((index < 0) || (safe_strlen(rufus_drive[index].id) < 8)) return ERROR_INVALID_PARAMETER; + PF_INIT_OR_OUT(CM_Get_DevNode_Status, CfgMgr32); + // Need DIGCF_ALLCLASSES else disabled devices won't be listed. dev_info = SetupDiGetClassDevsA(&GUID_DEVINTERFACE_DISK, NULL, NULL, DIGCF_PRESENT | DIGCF_ALLCLASSES); if (dev_info == INVALID_HANDLE_VALUE) { @@ -218,7 +238,7 @@ int CycleDevice(int index) found = TRUE; // Detect if the device is already disabled - if (CM_Get_DevNode_Status(&dev_status, &problem_code, dev_info_data.DevInst, 0) == CR_SUCCESS) + if (pfCM_Get_DevNode_Status(&dev_status, &problem_code, dev_info_data.DevInst, 0) == CR_SUCCESS) disabled = (dev_status & DN_HAS_PROBLEM) && (problem_code == CM_PROB_DISABLED); // Disable the device @@ -267,7 +287,7 @@ int CycleDevice(int index) // successful, but leave the device in an actual disabled state... So we can end up // with zombie devices, that are effectively disabled, but that Windows still sees // as enabled... So we need to detect this. - if (CM_Get_DevNode_Status(&dev_status, &problem_code, dev_info_data.DevInst, 0) == CR_SUCCESS) { + if (pfCM_Get_DevNode_Status(&dev_status, &problem_code, dev_info_data.DevInst, 0) == CR_SUCCESS) { disabled = (dev_status & DN_HAS_PROBLEM) && (problem_code == CM_PROB_DISABLED); if (disabled) ret = ERROR_DEVICE_REINITIALIZATION_NEEDED; @@ -278,6 +298,7 @@ int CycleDevice(int index) SetupDiDestroyDeviceInfoList(dev_info); if (!found) uprintf("Could not find a device to cycle!"); +out: return ret; } @@ -473,7 +494,7 @@ BOOL GetDevices(DWORD devnum) const char* windows_sandbox_vhd_label = "PortableBaseLayer"; // Hash table and String Array used to match a Device ID with the parent hub's Device Interface Path htab_table htab_devid = HTAB_EMPTY; - StrArray dev_if_path; + StrArray dev_if_path = STRARRAY_EMPTY; char letter_name[] = " (?:)"; char drive_name[] = "?:\\"; char setting_name[32]; @@ -497,6 +518,14 @@ BOOL GetDevices(DWORD devnum) uint64_t drive_size = 0; usb_device_props props; + PF_INIT_OR_OUT(CM_Get_Child, CfgMgr32); + PF_INIT_OR_OUT(CM_Get_Parent, CfgMgr32); + PF_INIT_OR_OUT(CM_Get_Sibling, CfgMgr32); + PF_INIT_OR_OUT(CM_Get_Device_IDA, CfgMgr32); + PF_INIT_OR_OUT(CM_Get_Device_ID_ListA, CfgMgr32); + PF_INIT_OR_OUT(CM_Get_Device_ID_List_SizeA, CfgMgr32); + PF_INIT_OR_OUT(CM_Locate_DevNodeA, CfgMgr32); + IGNORE_RETVAL(ComboBox_ResetContent(hDeviceList)); ClearDrives(); StrArrayCreate(&dev_if_path, 128); @@ -526,19 +555,19 @@ BOOL GetDevices(DWORD devnum) if (SetupDiGetDeviceInterfaceDetailA(dev_info, &devint_data, devint_detail_data, size, &size, NULL)) { // Find the Device IDs for all the children of this hub - if (CM_Get_Child(&device_inst, dev_info_data.DevInst, 0) == CR_SUCCESS) { + if (pfCM_Get_Child(&device_inst, dev_info_data.DevInst, 0) == CR_SUCCESS) { device_id[0] = 0; s = StrArrayAdd(&dev_if_path, devint_detail_data->DevicePath, TRUE); uuprintf(" Hub[%d] = '%s'", s, devint_detail_data->DevicePath); - if ((s>= 0) && (CM_Get_Device_IDA(device_inst, device_id, MAX_PATH, 0) == CR_SUCCESS)) { + if ((s>= 0) && (pfCM_Get_Device_IDA(device_inst, device_id, MAX_PATH, 0) == CR_SUCCESS)) { ToUpper(device_id); if ((k = htab_hash(device_id, &htab_devid)) != 0) { htab_devid.table[k].data = (void*)(uintptr_t)s; } uuprintf(" Found ID[%03d]: %s", k, device_id); - while (CM_Get_Sibling(&device_inst, device_inst, 0) == CR_SUCCESS) { + while (pfCM_Get_Sibling(&device_inst, device_inst, 0) == CR_SUCCESS) { device_id[0] = 0; - if (CM_Get_Device_IDA(device_inst, device_id, MAX_PATH, 0) == CR_SUCCESS) { + if (pfCM_Get_Device_IDA(device_inst, device_id, MAX_PATH, 0) == CR_SUCCESS) { ToUpper(device_id); if ((k = htab_hash(device_id, &htab_devid)) != 0) { htab_devid.table[k].data = (void*)(uintptr_t)s; @@ -566,7 +595,7 @@ BOOL GetDevices(DWORD devnum) // Also compute the uasp_start index if (strcmp(usbstor_name[s], "UASPSTOR") == 0) uasp_start = s; - if (CM_Get_Device_ID_List_SizeA(&list_size[s], usbstor_name[s], ulFlags) != CR_SUCCESS) + if (pfCM_Get_Device_ID_List_SizeA(&list_size[s], usbstor_name[s], ulFlags) != CR_SUCCESS) list_size[s] = 0; if (list_size[s] != 0) full_list_size += list_size[s]-1; // remove extra NUL terminator @@ -601,7 +630,7 @@ BOOL GetDevices(DWORD devnum) for (s = 0, i = 0; s < ARRAYSIZE(usbstor_name); s++) { list_start[s] = i; if (list_size[s] > 1) { - if (CM_Get_Device_ID_ListA(usbstor_name[s], &devid_list[i], list_size[s], ulFlags) != CR_SUCCESS) + if (pfCM_Get_Device_ID_ListA(usbstor_name[s], &devid_list[i], list_size[s], ulFlags) != CR_SUCCESS) continue; if (usb_debug) { uprintf("Processing IDs belonging to '%s':", usbstor_name[s]); @@ -708,17 +737,17 @@ BOOL GetDevices(DWORD devnum) // a lookup table, but there shouldn't be that many USB storage devices connected... // NB: Each of these Device IDs should have a child, from which we get the Device Instance match. for (device_id = devid_list; *device_id != 0; device_id += strlen(device_id) + 1) { - if (CM_Locate_DevNodeA(&parent_inst, device_id, 0) != CR_SUCCESS) { + if (pfCM_Locate_DevNodeA(&parent_inst, device_id, 0) != CR_SUCCESS) { uuprintf("Could not locate device node for '%s'", device_id); continue; } - if (CM_Get_Child(&device_inst, parent_inst, 0) != CR_SUCCESS) { + if (pfCM_Get_Child(&device_inst, parent_inst, 0) != CR_SUCCESS) { uuprintf("Could not get children of '%s'", device_id); continue; } if (device_inst != dev_info_data.DevInst) { // Try the siblings - while (CM_Get_Sibling(&device_inst, device_inst, 0) == CR_SUCCESS) { + while (pfCM_Get_Sibling(&device_inst, device_inst, 0) == CR_SUCCESS) { if (device_inst == dev_info_data.DevInst) { uuprintf("NOTE: Matched instance from sibling for '%s'", device_id); break; @@ -759,8 +788,8 @@ BOOL GetDevices(DWORD devnum) // for UASP devices in ASUS "Turbo Mode" or "Apple Mobile Device USB Driver" for iPods) // so try to see if we can match the grandparent. if ( ((uintptr_t)htab_devid.table[j].data == 0) - && (CM_Get_Parent(&grandparent_inst, parent_inst, 0) == CR_SUCCESS) - && (CM_Get_Device_IDA(grandparent_inst, str, MAX_PATH, 0) == CR_SUCCESS) ) { + && (pfCM_Get_Parent(&grandparent_inst, parent_inst, 0) == CR_SUCCESS) + && (pfCM_Get_Device_IDA(grandparent_inst, str, MAX_PATH, 0) == CR_SUCCESS) ) { device_id = str; method_str = "[GP]"; ToUpper(device_id); diff --git a/src/dev.h b/src/dev.h index f7415295..ea610ad5 100644 --- a/src/dev.h +++ b/src/dev.h @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Device detection and enumeration - * Copyright © 2014-2019 Pete Batard <pete@akeo.ie> + * Copyright © 2014-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,20 +46,6 @@ typedef struct usb_device_props { /* * Windows DDK API definitions. Most of it copied from MinGW's includes */ -typedef DWORD DEVNODE, DEVINST; -typedef DEVNODE *PDEVNODE, *PDEVINST; -typedef DWORD RETURN_TYPE; -typedef RETURN_TYPE CONFIGRET; -typedef CHAR *DEVINSTID_A; - -#ifndef CM_GETIDLIST_FILTER_PRESENT -#define CM_GETIDLIST_FILTER_PRESENT 0x00000100 -#endif - -#ifndef FILE_DEVICE_USB -#define FILE_DEVICE_USB FILE_DEVICE_UNKNOWN -#endif - typedef enum USB_CONNECTION_STATUS { NoDeviceConnected, DeviceConnected, @@ -77,26 +63,16 @@ typedef enum USB_HUB_NODE { UsbMIParent } USB_HUB_NODE; -/* Cfgmgr32.dll interface */ -DECLSPEC_IMPORT CONFIGRET WINAPI CM_Get_Device_IDA(DEVINST dnDevInst, CHAR* Buffer, ULONG BufferLen, ULONG ulFlags); -DECLSPEC_IMPORT CONFIGRET WINAPI CM_Get_Device_ID_List_SizeA(PULONG pulLen, PCSTR pszFilter, ULONG ulFlags); -DECLSPEC_IMPORT CONFIGRET WINAPI CM_Get_Device_ID_ListA(PCSTR pszFilter, PCHAR Buffer, ULONG BufferLen, ULONG ulFlags); -DECLSPEC_IMPORT CONFIGRET WINAPI CM_Locate_DevNodeA(PDEVINST pdnDevInst, DEVINSTID_A pDeviceID, ULONG ulFlags); -DECLSPEC_IMPORT CONFIGRET WINAPI CM_Get_Child(PDEVINST pdnDevInst, DEVINST dnDevInst, ULONG ulFlags); -DECLSPEC_IMPORT CONFIGRET WINAPI CM_Get_Parent(PDEVINST pdnDevInst, DEVINST dnDevInst, ULONG ulFlags); -DECLSPEC_IMPORT CONFIGRET WINAPI CM_Get_Sibling(PDEVINST pdnDevInst, DEVINST dnDevInst, ULONG ulFlags); -DECLSPEC_IMPORT CONFIGRET WINAPI CM_Get_DevNode_Status(PULONG pulStatus, PULONG pulProblemNumber, DEVINST dnDevInst, ULONG ulFlags); - #define USB_HUB_CYCLE_PORT 273 #define USB_GET_NODE_CONNECTION_INFORMATION_EX 274 #define USB_GET_NODE_CONNECTION_INFORMATION_EX_V2 279 #define IOCTL_USB_HUB_CYCLE_PORT \ - CTL_CODE(FILE_DEVICE_USB, USB_HUB_CYCLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) + CTL_CODE(FILE_DEVICE_UNKNOWN, USB_HUB_CYCLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_INFORMATION_EX, METHOD_BUFFERED, FILE_ANY_ACCESS) + CTL_CODE(FILE_DEVICE_UNKNOWN, USB_GET_NODE_CONNECTION_INFORMATION_EX, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX_V2 \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_INFORMATION_EX_V2, METHOD_BUFFERED, FILE_ANY_ACCESS) + CTL_CODE(FILE_DEVICE_UNKNOWN, USB_GET_NODE_CONNECTION_INFORMATION_EX_V2, METHOD_BUFFERED, FILE_ANY_ACCESS) /* Most of the structures below need to be packed */ #pragma pack(push, 1) diff --git a/src/rufus.c b/src/rufus.c index 5e3d2ce3..ece1bd6c 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -3257,19 +3257,31 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine {0, 0, NULL, 0} }; - // Disable loading system DLLs from the current directory (sideloading mitigation) + // Disable loading system DLLs from the current directory (side-loading mitigation) // PS: You know that official MSDN documentation for SetDllDirectory() that explicitly // indicates that "If the parameter is an empty string (""), the call removes the current - // directory from the default DLL search order"? Yeah, that doesn't work. At all. - // Still, we invoke it, for platforms where the following call might actually work... - SetDllDirectoryA(""); + // directory from the default DLL search order"? Yeah, that doesn't work. At all. And as + // a matter of fact, Microsoft has now altered their doc to remove that part, though it + // is still *currently* being mentioned in their doc for Dynamic-Link Library Security: + // https://web.archive.org/web/20250206201109/https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-security + // So, Microsoft currently offers NO WAY to easily disable the main vulnerability most + // applications suffer from, which is the loading of bloody DLLs from the current/app + // dir, even for executables, like Rufus, that are designed from the get go to NEVER EVER + // rely on any DLLs there, and would like to DISABLE THIS UTTER BULLSHIT OF AN ENTIRELY + // PREVENTABLE SECURITY RISK! The end result of all this is that we have to contend with + // delay loading (*when* it actually works) or direct hooking (when it doesn't) and no + // longer try to bother with a quick and easy side-loading fix that Microsoft has been + // dangling as a lure, for years, but hasn't actually bothered to implement... + // SetDllDirectoryA(""); // For libraries on the KnownDLLs list, the system will always load them from System32. // For other DLLs we link directly to, we can delay load the DLL and use a delay load // hook to load them from System32. Note that, for this to work, something like: // 'somelib.dll;%(DelayLoadDLLs)' must be added to the 'Delay Loaded Dlls' option of - // the linker properties in Visual Studio (which means this won't work with MinGW). - // For all other DLLs, use SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32). + // the linker properties in Visual Studio... which means this won't work with MinGW. + // For all other DLLs, use SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32), + // though this *STILL* does not prevent the Windows default of looking for DLLs in the + // current directories. SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32); uprintf("*** " APPLICATION_NAME " init ***\n"); diff --git a/src/rufus.h b/src/rufus.h index 507e66c4..50fb29fd 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -1,6 +1,6 @@ /* * Rufus: The Reliable USB Formatting Utility - * Copyright © 2011-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2011-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -690,6 +690,7 @@ typedef struct { uint32_t Index; // Current array size uint32_t Max; // Maximum array size } StrArray; +#define STRARRAY_EMPTY { NULL, 0, 0 }; extern void StrArrayCreate(StrArray* arr, uint32_t initial_size); extern int32_t StrArrayAdd(StrArray* arr, const char* str, BOOL); extern int32_t StrArrayFind(StrArray* arr, const char* str); diff --git a/src/rufus.rc b/src/rufus.rc index 8c8fc306..7d05622c 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.7.2221" +CAPTION "Rufus 4.7.2222" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2221,0 - PRODUCTVERSION 4,7,2221,0 + FILEVERSION 4,7,2222,0 + PRODUCTVERSION 4,7,2222,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2221" + VALUE "FileVersion", "4.7.2222" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2221" + VALUE "ProductVersion", "4.7.2222" END END BLOCK "VarFileInfo" From 9540ca359d4d9353ae6c8cc4d95bb42c2a3c07f8 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 20 Feb 2025 13:13:44 +0000 Subject: [PATCH 032/192] [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. --- src/rufus.c | 5 +++-- src/rufus.rc | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/rufus.c b/src/rufus.c index ece1bd6c..8aaea8a1 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -3427,8 +3427,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if ((strchr(tmp, 'p') != NULL) || ((strchr(tmp, 'P') != NULL) && (strchr(tmp, 'P')[1] != 'H'))) ini_flags[0] = 'a'; - // Now enable the hogger before processing the rest of the arguments - if (!disable_hogger) { + // Now enable the hogger before processing the rest of the arguments. + // Note that with POSIX shells (e.g. msys) we don't enable the hogger as it is not needed. + if (!disable_hogger && getenv("SHELL") == NULL) { // Reattach the console, if we were started from commandline if (AttachConsole(ATTACH_PARENT_PROCESS) != 0) { uprintf("Enabling console line hogger"); diff --git a/src/rufus.rc b/src/rufus.rc index 7d05622c..90208855 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.7.2222" +CAPTION "Rufus 4.7.2223" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2222,0 - PRODUCTVERSION 4,7,2222,0 + FILEVERSION 4,7,2223,0 + PRODUCTVERSION 4,7,2223,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2222" + VALUE "FileVersion", "4.7.2223" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2222" + VALUE "ProductVersion", "4.7.2223" END END BLOCK "VarFileInfo" From 7585a35c2c6f8acb93fdd2c461578a9a46ce9212 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 21 Feb 2025 17:53:38 +0000 Subject: [PATCH 033/192] [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. --- src/rufus.c | 2 +- src/rufus.rc | 10 +++++----- src/vhd.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/rufus.c b/src/rufus.c index 8aaea8a1..8f960c69 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1430,7 +1430,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) if (boot_type == BT_IMAGE) { if_not_assert(image_path != NULL) goto out; - if ((size_check) && (img_report.projected_size > (uint64_t)SelectedDrive.DiskSize)) { + if ((size_check) && (MAX(img_report.image_size, img_report.projected_size) > (uint64_t)SelectedDrive.DiskSize)) { // This ISO image is too big for the selected target MessageBoxExU(hMainDialog, lmprintf(MSG_089), lmprintf(MSG_088), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); goto out; diff --git a/src/rufus.rc b/src/rufus.rc index 90208855..83f37353 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.7.2223" +CAPTION "Rufus 4.7.2224" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2223,0 - PRODUCTVERSION 4,7,2223,0 + FILEVERSION 4,7,2224,0 + PRODUCTVERSION 4,7,2224,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2223" + VALUE "FileVersion", "4.7.2224" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2223" + VALUE "ProductVersion", "4.7.2224" END END BLOCK "VarFileInfo" diff --git a/src/vhd.c b/src/vhd.c index eef595bc..fe73e0ba 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -165,7 +165,7 @@ static int8_t IsCompressedBootableImage(const char* path) uprintf(" An FFU image was selected, but this system does not have FFU support!"); } } else { - physical_disk = VhdMountImage(path); + physical_disk = VhdMountImageAndGetSize(path, &img_report.projected_size); if (physical_disk != NULL) { img_report.is_vhd = TRUE; fd = fopenU(physical_disk, "rb"); From bc75274a9a585073f100e711227592691611e14c Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 4 Mar 2025 11:47:11 +0000 Subject: [PATCH 034/192] [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 https://sourceforge.net/p/mingw-w64/mailman/message/59156023/) * While we're at it, also sure we use /BREPRO everywhere for MSVC reproducible builds. --- .vs/rufus.vcxproj | 12 ++++++++---- src/rufus.rc | 10 +++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.vs/rufus.vcxproj b/.vs/rufus.vcxproj index befb03f5..a0699550 100644 --- a/.vs/rufus.vcxproj +++ b/.vs/rufus.vcxproj @@ -139,6 +139,7 @@ <SubSystem>Windows</SubSystem> <TargetMachine>MachineX86</TargetMachine> <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> </Link> <ResourceCompile> <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> @@ -168,6 +169,7 @@ <SubSystem>Windows</SubSystem> <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\arm</AdditionalLibraryDirectories> <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> </Link> <ResourceCompile> <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> @@ -199,6 +201,7 @@ <SubSystem>Windows</SubSystem> <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.16299.0\um\arm64</AdditionalLibraryDirectories> <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> </Link> <ResourceCompile> <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> @@ -235,6 +238,7 @@ <SubSystem>Windows</SubSystem> <TargetMachine>MachineX64</TargetMachine> <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> </Link> <ResourceCompile> <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> @@ -265,7 +269,7 @@ <GenerateDebugInformation>false</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <TargetMachine>MachineX86</TargetMachine> - <AdditionalOptions>/BREPRO %(AdditionalOptions)</AdditionalOptions> + <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> </Link> <ResourceCompile> @@ -297,7 +301,7 @@ <GenerateDebugInformation>false</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\arm</AdditionalLibraryDirectories> - <AdditionalOptions>/BREPRO %(AdditionalOptions)</AdditionalOptions> + <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> </Link> <ResourceCompile> @@ -331,7 +335,7 @@ <GenerateDebugInformation>false</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.16299.0\um\arm64</AdditionalLibraryDirectories> - <AdditionalOptions>/BREPRO %(AdditionalOptions)</AdditionalOptions> + <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> </Link> <ResourceCompile> @@ -368,7 +372,7 @@ <GenerateDebugInformation>false</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <TargetMachine>MachineX64</TargetMachine> - <AdditionalOptions>/BREPRO %(AdditionalOptions)</AdditionalOptions> + <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> </Link> <ResourceCompile> diff --git a/src/rufus.rc b/src/rufus.rc index 83f37353..3cd098eb 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.7.2224" +CAPTION "Rufus 4.7.2225" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2224,0 - PRODUCTVERSION 4,7,2224,0 + FILEVERSION 4,7,2225,0 + PRODUCTVERSION 4,7,2225,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2224" + VALUE "FileVersion", "4.7.2225" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2224" + VALUE "ProductVersion", "4.7.2225" END END BLOCK "VarFileInfo" From df4f8301d7e89184ea0a59d701ca963f1a92cdde Mon Sep 17 00:00:00 2001 From: ozone10 <positronix10@gmail.com> Date: Sat, 15 Mar 2025 18:38:02 +0100 Subject: [PATCH 035/192] [ui] fix GDI leaks * Closes #2704. --- src/hash.c | 17 ++++--- src/rufus.c | 45 ++++++++++++----- src/rufus.h | 3 +- src/rufus.rc | 10 ++-- src/stdlg.c | 133 ++++++++++++++++++++++++++++++--------------------- src/ui.c | 33 +++++++++---- src/ui.h | 2 +- 7 files changed, 153 insertions(+), 90 deletions(-) diff --git a/src/hash.c b/src/hash.c index 74e4e99a..e2a4652e 100644 --- a/src/hash.c +++ b/src/hash.c @@ -1886,19 +1886,21 @@ out: */ INT_PTR CALLBACK HashCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { + static HFONT hFont = NULL; int i, dw, dh; RECT rc; - HFONT hFont; HDC hDC; switch (message) { case WM_INITDIALOG: apply_localization(IDD_HASH, hDlg); - hDC = GetDC(hDlg); - hFont = CreateFontA(-MulDiv(9, GetDeviceCaps(hDC, LOGPIXELSY), 72), - 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, - 0, 0, PROOF_QUALITY, 0, "Courier New"); - safe_release_dc(hDlg, hDC); + if (hFont == NULL) { + hDC = GetDC(hDlg); + hFont = CreateFontA(-MulDiv(9, GetDeviceCaps(hDC, LOGPIXELSY), 72), + 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, + 0, 0, PROOF_QUALITY, 0, "Courier New"); + safe_release_dc(hDlg, hDC); + } SendDlgItemMessageA(hDlg, IDC_MD5, WM_SETFONT, (WPARAM)hFont, TRUE); SendDlgItemMessageA(hDlg, IDC_SHA1, WM_SETFONT, (WPARAM)hFont, TRUE); SendDlgItemMessageA(hDlg, IDC_SHA256, WM_SETFONT, (WPARAM)hFont, TRUE); @@ -1942,6 +1944,9 @@ INT_PTR CALLBACK HashCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa SendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, IDOK), TRUE); CenterDialog(hDlg, NULL); break; + case WM_NCDESTROY: + safe_delete_object(hFont); + break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: diff --git a/src/rufus.c b/src/rufus.c index 8f960c69..95361a2e 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -91,6 +91,7 @@ static unsigned int timer; static char uppercase_select[2][64], uppercase_start[64], uppercase_close[64], uppercase_cancel[64]; extern HANDLE update_check_thread, wim_thread; +extern HIMAGELIST hUpImageList, hDownImageList; extern BOOL enable_iso, enable_joliet, enable_rockridge, enable_extra_hashes, is_bootloader_revoked; extern BOOL validate_md5sum, cpu_has_sha1_accel, cpu_has_sha256_accel; extern BYTE* fido_script; @@ -110,7 +111,8 @@ OPENED_LIBRARIES_VARS; RUFUS_UPDATE update = { { 0,0,0 },{ 0,0 }, NULL, NULL }; HINSTANCE hMainInstance; HWND hMainDialog, hMultiToolbar, hSaveToolbar, hHashToolbar, hAdvancedDeviceToolbar, hAdvancedFormatToolbar, hUpdatesDlg = NULL; -HFONT hInfoFont; +HFONT hInfoFont = NULL, hSectionHeaderFont = NULL; +HICON hSmallIcon, hBigIcon = NULL; uint8_t image_options = IMOP_WINTOGO; uint16_t rufus_version[3], embedded_sl_version[2]; uint32_t dur_mins, dur_secs; @@ -940,8 +942,8 @@ out: // Callback for the log window BOOL CALLBACK LogCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { + static HFONT hf = NULL; HDC hDC; - HFONT hf; LONG lfHeight; LONG_PTR style; DWORD log_size; @@ -954,12 +956,14 @@ BOOL CALLBACK LogCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) // Increase the size of our log textbox to MAX_LOG_SIZE (unsigned word) PostMessage(hLog, EM_LIMITTEXT, MAX_LOG_SIZE , 0); - // Set the font to Unicode so that we can display anything - hDC = GetDC(NULL); - lfHeight = -MulDiv(9, GetDeviceCaps(hDC, LOGPIXELSY), 72); - safe_release_dc(NULL, hDC); - hf = CreateFontA(lfHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, - DEFAULT_CHARSET, 0, 0, PROOF_QUALITY, 0, "Consolas"); + if (hf == NULL) { + // Set the font to Unicode so that we can display anything + hDC = GetDC(NULL); + lfHeight = -MulDiv(9, GetDeviceCaps(hDC, LOGPIXELSY), 72); + safe_release_dc(NULL, hDC); + hf = CreateFontA(lfHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, + DEFAULT_CHARSET, 0, 0, PROOF_QUALITY, 0, "Consolas"); + } SendDlgItemMessageA(hDlg, IDC_LOG_EDIT, WM_SETFONT, (WPARAM)hf, TRUE); // Set 'Close Log' as the selected button SendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, IDCANCEL), TRUE); @@ -975,6 +979,9 @@ BOOL CALLBACK LogCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) style &= ~(ES_RIGHT); SetWindowLongPtr(hLog, GWL_STYLE, style); break; + case WM_NCDESTROY: + safe_delete_object(hf); + break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDCANCEL: @@ -2023,8 +2030,10 @@ static void InitDialog(HWND hDlg) SetAccessibleName(hNBPasses, lmprintf(MSG_316)); // Create the font and brush for the progress messages - hInfoFont = CreateFontA(lfHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, - 0, 0, PROOF_QUALITY, 0, "Segoe UI"); + if (hInfoFont == NULL) { + hInfoFont = CreateFontA(lfHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, + 0, 0, PROOF_QUALITY, 0, "Segoe UI"); + } // Create the title bar icon SetTitleBarIcon(hDlg); @@ -2127,7 +2136,7 @@ static void InitDialog(HWND hDlg) CheckDlgButton(hDlg, IDC_EXTENDED_LABEL, BST_CHECKED); CreateAdditionalControls(hDlg); - SetSectionHeaders(hDlg); + SetSectionHeaders(hDlg, &hSectionHeaderFont); PositionMainControls(hDlg); AdjustForLowDPI(hDlg); // Because we created the log dialog before we computed our sizes, we need to send a custom message @@ -2135,7 +2144,7 @@ static void InitDialog(HWND hDlg) // Limit the amount of characters for the Persistence size field SendMessage(GetDlgItem(hDlg, IDC_PERSISTENCE_SIZE), EM_LIMITTEXT, 7, 0); // Create the status line and initialize the taskbar icon for progress overlay - CreateStatusBar(); + CreateStatusBar(&hInfoFont); // Set the various tooltips CreateTooltip(hFileSystem, lmprintf(MSG_157), -1); @@ -2826,7 +2835,17 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA CreateStaticFont((HDC)wParam, &hyperlink_font, FALSE); SelectObject((HDC)wParam, hyperlink_font); SetTextColor((HDC)wParam, TOOLBAR_ICON_COLOR); - return (INT_PTR)CreateSolidBrush(GetSysColor(COLOR_BTNFACE)); + return (INT_PTR)GetSysColorBrush(COLOR_BTNFACE); + + case WM_NCDESTROY: + safe_delete_object(hyperlink_font); + safe_delete_object(hInfoFont); + safe_delete_object(hSectionHeaderFont); + safe_delete_object(hUpImageList); + safe_delete_object(hDownImageList); + safe_delete_object(hSmallIcon); + safe_delete_object(hBigIcon); + break; case WM_NOTIFY: switch (((LPNMHDR)lParam)->code) { diff --git a/src/rufus.h b/src/rufus.h index 50fb29fd..7cd5030f 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -172,6 +172,7 @@ static __inline void safe_strcp(char* dst, const size_t dst_max, const char* src #define safe_strnicmp(str1, str2, count) _strnicmp(((str1 == NULL) ? "<NULL>" : str1), ((str2 == NULL) ? "<NULL>" : str2), count) #define safe_closehandle(h) do { if ((h != INVALID_HANDLE_VALUE) && (h != NULL)) { CloseHandle(h); h = INVALID_HANDLE_VALUE; } } while(0) #define safe_release_dc(hDlg, hDC) do { if ((hDC != INVALID_HANDLE_VALUE) && (hDC != NULL)) { ReleaseDC(hDlg, hDC); hDC = NULL; } } while(0) +#define safe_delete_object(hObj) do { if (hObj != NULL) { DeleteObject(hObj); hObj = NULL; } } while(0) #define safe_sprintf(dst, count, ...) do { size_t _count = count; char* _dst = dst; _snprintf_s(_dst, _count, _TRUNCATE, __VA_ARGS__); \ _dst[(_count) - 1] = 0; } while(0) #define static_sprintf(dst, ...) safe_sprintf(dst, sizeof(dst), __VA_ARGS__) @@ -755,7 +756,7 @@ extern INT_PTR MyDialogBox(HINSTANCE hInstance, int Dialog_ID, HWND hWndParent, extern void CenterDialog(HWND hDlg, HWND hParent); extern void ResizeMoveCtrl(HWND hDlg, HWND hCtrl, int dx, int dy, int dw, int dh, float scale); extern void ResizeButtonHeight(HWND hDlg, int id); -extern void CreateStatusBar(void); +extern void CreateStatusBar(HFONT* hFont); extern void CreateStaticFont(HDC hDC, HFONT* hFont, BOOL underlined); extern void SetTitleBarIcon(HWND hDlg); extern BOOL CreateTaskbarList(void); diff --git a/src/rufus.rc b/src/rufus.rc index 3cd098eb..24e93eee 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.7.2225" +CAPTION "Rufus 4.7.2226" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2225,0 - PRODUCTVERSION 4,7,2225,0 + FILEVERSION 4,7,2226,0 + PRODUCTVERSION 4,7,2226,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2225" + VALUE "FileVersion", "4.7.2226" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2225" + VALUE "ProductVersion", "4.7.2226" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index d0151116..0b0c422b 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -47,6 +47,7 @@ /* Globals */ extern BOOL is_x86_64, appstore_version; extern char unattend_username[MAX_USERNAME_LENGTH], *sbat_level_txt; +extern HICON hSmallIcon, hBigIcon; static HICON hMessageIcon = (HICON)INVALID_HANDLE_VALUE; static char* szMessageText = NULL; static char* szMessageTitle = NULL; @@ -213,11 +214,10 @@ out: /* * Create the application status bar */ -void CreateStatusBar(void) +void CreateStatusBar(HFONT* hFont) { RECT rect; int edge[2]; - HFONT hFont; // Create the status bar hStatus = CreateWindowEx(0, STATUSCLASSNAME, NULL, WS_CHILD | WS_VISIBLE | SBARS_TOOLTIPS, @@ -231,10 +231,14 @@ void CreateStatusBar(void) SendMessage(hStatus, SB_SETPARTS, (WPARAM)ARRAYSIZE(edge), (LPARAM)&edge); // Set the font - hFont = CreateFontA(-MulDiv(9, GetDeviceCaps(GetDC(hMainDialog), LOGPIXELSY), 72), - 0, 0, 0, FW_MEDIUM, FALSE, FALSE, FALSE, DEFAULT_CHARSET, - 0, 0, PROOF_QUALITY, 0, "Segoe UI"); - SendMessage(hStatus, WM_SETFONT, (WPARAM)hFont, TRUE); + if (*hFont == NULL) { + HDC hDC = GetDC(hMainDialog); + *hFont = CreateFontA(-MulDiv(9, GetDeviceCaps(hDC, LOGPIXELSY), 72), + 0, 0, 0, FW_MEDIUM, FALSE, FALSE, FALSE, DEFAULT_CHARSET, + 0, 0, PROOF_QUALITY, 0, "Segoe UI"); + safe_release_dc(hMainDialog, hDC); + } + SendMessage(hStatus, WM_SETFONT, (WPARAM)*hFont, TRUE); } /* @@ -468,7 +472,7 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP static HBRUSH background_brush, separator_brush, buttonface_brush; // To use the system message font NONCLIENTMETRICS ncm; - HFONT hDlgFont; + static HFONT hDlgFont = NULL; HWND hCtrl; RECT rc; HDC hDC; @@ -482,8 +486,10 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP #if defined(_MSC_VER) && (_MSC_VER >= 1500) && (_WIN32_WINNT >= _WIN32_WINNT_VISTA) ncm.cbSize -= sizeof(ncm.iPaddedBorderWidth); #endif - SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0); - hDlgFont = CreateFontIndirect(&(ncm.lfMessageFont)); + if (hDlgFont == NULL) { + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0); + hDlgFont = CreateFontIndirect(&(ncm.lfMessageFont)); + } // Set the dialog to use the system message box font SendMessage(hDlg, WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0)); SendMessage(GetDlgItem(hDlg, IDC_NOTIFICATION_TEXT), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0)); @@ -497,9 +503,9 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP } apply_localization(IDD_NOTIFICATION, hDlg); - background_brush = CreateSolidBrush(GetSysColor(COLOR_WINDOW)); - separator_brush = CreateSolidBrush(GetSysColor(COLOR_3DLIGHT)); - buttonface_brush = CreateSolidBrush(GetSysColor(COLOR_BTNFACE)); + background_brush = GetSysColorBrush(COLOR_WINDOW); + separator_brush = GetSysColorBrush(COLOR_3DLIGHT); + buttonface_brush = GetSysColorBrush(COLOR_BTNFACE); SetTitleBarIcon(hDlg); CenterDialog(hDlg, NULL); // Change the default icon @@ -575,6 +581,9 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP } } return (INT_PTR)FALSE; + case WM_NCDESTROY: + safe_delete_object(hDlgFont); + break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: @@ -675,7 +684,7 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM // To use the system message font NONCLIENTMETRICS ncm; RECT rc, rc2; - HFONT hDlgFont; + static HFONT hDlgFont = NULL; HWND hCtrl; HDC hDC; @@ -691,9 +700,11 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM for (i = 0; i < nDialogItems; i++) Button_SetStyle(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), selection_dialog_style, TRUE); // Get the system message box font. See http://stackoverflow.com/a/6057761 - ncm.cbSize = sizeof(ncm); - SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0); - hDlgFont = CreateFontIndirect(&ncm.lfMessageFont); + if (hDlgFont == NULL) { + ncm.cbSize = sizeof(ncm); + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0); + hDlgFont = CreateFontIndirect(&ncm.lfMessageFont); + } // Set the dialog to use the system message box font SendMessage(hDlg, WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0)); SendMessage(GetDlgItem(hDlg, IDC_SELECTION_TEXT), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0)); @@ -703,8 +714,8 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM SendMessage(GetDlgItem(hDlg, IDNO), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0)); apply_localization(IDD_SELECTION, hDlg); - background_brush = CreateSolidBrush(GetSysColor(COLOR_WINDOW)); - separator_brush = CreateSolidBrush(GetSysColor(COLOR_3DLIGHT)); + background_brush = GetSysColorBrush(COLOR_WINDOW); + separator_brush = GetSysColorBrush(COLOR_3DLIGHT); SetTitleBarIcon(hDlg); CenterDialog(hDlg, NULL); @@ -720,7 +731,7 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM SetWindowTextU(GetDlgItem(hDlg, IDCANCEL), lmprintf(MSG_007)); SetWindowTextU(GetDlgItem(hDlg, IDC_SELECTION_TEXT), szMessageText); for (i = 0; i < nDialogItems; i++) { - char *str = szDialogItem[i]; + char* str = szDialogItem[i]; SetWindowTextU(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), str); ShowWindow(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), SW_SHOW); // Compute the maximum line's width (with some extra for the username field if needed) @@ -733,7 +744,7 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM free(str); } // If our maximum line's width is greater than the default, set a nonzero delta width - dw = (mw <= dw) ? 0: mw - dw; + dw = (mw <= dw) ? 0 : mw - dw; // Move/Resize the controls as needed to fit our text hCtrl = GetDlgItem(hDlg, IDC_SELECTION_TEXT); ResizeMoveCtrl(hDlg, hCtrl, 0, 0, dw, 0, 1.0f); @@ -802,6 +813,9 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM } } return (INT_PTR)FALSE; + case WM_NCDESTROY: + safe_delete_object(hDlgFont); + break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: @@ -863,7 +877,7 @@ INT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa // To use the system message font NONCLIENTMETRICS ncm; RECT rc, rc2; - HFONT hDlgFont; + static HFONT hDlgFont = NULL; HWND hCtrl; HDC hDC; @@ -876,9 +890,11 @@ INT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa nDialogItems = IDC_LIST_ITEMMAX - IDC_LIST_ITEM1; } // Get the system message box font. See http://stackoverflow.com/a/6057761 - ncm.cbSize = sizeof(ncm); - SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0); - hDlgFont = CreateFontIndirect(&(ncm.lfMessageFont)); + if (hDlgFont == NULL) { + ncm.cbSize = sizeof(ncm); + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0); + hDlgFont = CreateFontIndirect(&(ncm.lfMessageFont)); + } // Set the dialog to use the system message box font SendMessage(hDlg, WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0)); SendMessage(GetDlgItem(hDlg, IDC_LIST_TEXT), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0)); @@ -888,8 +904,8 @@ INT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa SendMessage(GetDlgItem(hDlg, IDNO), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0)); apply_localization(IDD_LIST, hDlg); - background_brush = CreateSolidBrush(GetSysColor(COLOR_WINDOW)); - separator_brush = CreateSolidBrush(GetSysColor(COLOR_3DLIGHT)); + background_brush = GetSysColorBrush(COLOR_WINDOW); + separator_brush = GetSysColorBrush(COLOR_3DLIGHT); SetTitleBarIcon(hDlg); CenterDialog(hDlg, NULL); // Change the default icon and set the text @@ -942,6 +958,9 @@ INT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa } } return (INT_PTR)FALSE; + case WM_NCDESTROY: + safe_delete_object(hDlgFont); + break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: @@ -1588,7 +1607,10 @@ INT_PTR CALLBACK NewVersionCallback(HWND hDlg, UINT message, WPARAM wParam, LPAR CreateStaticFont((HDC)wParam, &hyperlink_font, TRUE); SelectObject((HDC)wParam, hyperlink_font); SetTextColor((HDC)wParam, RGB(0,0,125)); // DARK_BLUE - return (INT_PTR)CreateSolidBrush(GetSysColor(COLOR_BTNFACE)); + return (INT_PTR)GetSysColorBrush(COLOR_BTNFACE); + case WM_NCDESTROY: + safe_delete_object(hyperlink_font); + break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDCLOSE: @@ -1695,36 +1717,39 @@ void DownloadNewVersion(void) void SetTitleBarIcon(HWND hDlg) { - int i16, s16, s32; - HICON hSmallIcon, hBigIcon; + int i16, s16 = 0, s32 = 0; - // High DPI scaling - i16 = GetSystemMetrics(SM_CXSMICON); - // Adjust icon size lookup - s16 = i16; - s32 = (int)(32.0f*fScale); - if (s16 >= 54) - s16 = 64; - else if (s16 >= 40) - s16 = 48; - else if (s16 >= 28) - s16 = 32; - else if (s16 >= 20) - s16 = 24; - if (s32 >= 54) - s32 = 64; - else if (s32 >= 40) - s32 = 48; - else if (s32 >= 28) - s32 = 32; - else if (s32 >= 20) - s32 = 24; + if (hSmallIcon == NULL || hBigIcon == NULL) { + // High DPI scaling + i16 = GetSystemMetrics(SM_CXSMICON); + // Adjust icon size lookup + s16 = i16; + s32 = (int)(32.0f * fScale); + if (s16 >= 54) + s16 = 64; + else if (s16 >= 40) + s16 = 48; + else if (s16 >= 28) + s16 = 32; + else if (s16 >= 20) + s16 = 24; + if (s32 >= 54) + s32 = 64; + else if (s32 >= 40) + s32 = 48; + else if (s32 >= 28) + s32 = 32; + else if (s32 >= 20) + s32 = 24; + } // Create the title bar icon - hSmallIcon = (HICON)LoadImage(hMainInstance, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, s16, s16, 0); - SendMessage (hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hSmallIcon); - hBigIcon = (HICON)LoadImage(hMainInstance, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, s32, s32, 0); - SendMessage (hDlg, WM_SETICON, ICON_BIG, (LPARAM)hBigIcon); + if (hSmallIcon == NULL) + hSmallIcon = (HICON)LoadImage(hMainInstance, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, s16, s16, 0); + SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hSmallIcon); + if (hBigIcon == NULL) + hBigIcon = (HICON)LoadImage(hMainInstance, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, s32, s32, 0); + SendMessage(hDlg, WM_SETICON, ICON_BIG, (LPARAM)hBigIcon); } // Return the onscreen size of the text displayed by a control diff --git a/src/ui.c b/src/ui.c index e83c77a3..216b9821 100644 --- a/src/ui.c +++ b/src/ui.c @@ -555,22 +555,25 @@ void AdjustForLowDPI(HWND hDlg) InvalidateRect(hDlg, NULL, TRUE); } -void SetSectionHeaders(HWND hDlg) +void SetSectionHeaders(HWND hDlg, HFONT* hFont) { RECT rc; HWND hCtrl; SIZE sz; - HFONT hf; wchar_t wtmp[128]; size_t wlen; int i; // Set the section header fonts and resize the static controls accordingly - hf = CreateFontA(-MulDiv(14, GetDeviceCaps(GetDC(hMainDialog), LOGPIXELSY), 72), 0, 0, 0, - FW_SEMIBOLD, FALSE, FALSE, FALSE, DEFAULT_CHARSET, 0, 0, PROOF_QUALITY, 0, "Segoe UI"); + if (*hFont == NULL) { + HDC hDC = GetDC(hMainDialog); + *hFont = CreateFontA(-MulDiv(14, GetDeviceCaps(hDC, LOGPIXELSY), 72), 0, 0, 0, + FW_SEMIBOLD, FALSE, FALSE, FALSE, DEFAULT_CHARSET, 0, 0, PROOF_QUALITY, 0, "Segoe UI"); + safe_release_dc(hMainDialog, hDC); + } for (i = 0; i < ARRAYSIZE(section_control_ids); i++) { - SendDlgItemMessageA(hDlg, section_control_ids[i], WM_SETFONT, (WPARAM)hf, TRUE); + SendDlgItemMessageA(hDlg, section_control_ids[i], WM_SETFONT, (WPARAM)*hFont, TRUE); hCtrl = GetDlgItem(hDlg, section_control_ids[i]); memset(wtmp, 0, sizeof(wtmp)); GetWindowTextW(hCtrl, wtmp, ARRAYSIZE(wtmp) - 4); @@ -887,6 +890,9 @@ void CreateSmallButtons(HWND hDlg) static INT_PTR CALLBACK ProgressCallback(HWND hCtrl, UINT message, WPARAM wParam, LPARAM lParam) { HDC hDC; + HPEN hOldPen; + HFONT hOldFont; + HBRUSH hOldBrush; RECT rc, rc2; PAINTSTRUCT ps; SIZE size; @@ -957,11 +963,11 @@ static INT_PTR CALLBACK ProgressCallback(HWND hCtrl, UINT message, WPARAM wParam GetClientRect(hCtrl, &rc); rc2 = rc; InflateRect(&rc, -1, -1); - SelectObject(hDC, GetStockObject(DC_PEN)); - SelectObject(hDC, GetStockObject(NULL_BRUSH)); + hOldPen = (HPEN)SelectObject(hDC, GetStockObject(DC_PEN)); + hOldBrush = (HBRUSH)SelectObject(hDC, GetStockObject(NULL_BRUSH)); // TODO: Handle SetText message so we can avoid this call GetWindowTextW(hProgress, winfo, ARRAYSIZE(winfo)); - SelectObject(hDC, hInfoFont); + hOldFont = (hInfoFont != NULL) ? (HFONT)SelectObject(hDC, hInfoFont) : NULL; GetTextExtentPoint32(hDC, winfo, (int)wcslen(winfo), &size); if (size.cx > rc.right) size.cx = rc.right; @@ -1013,6 +1019,10 @@ static INT_PTR CALLBACK ProgressCallback(HWND hCtrl, UINT message, WPARAM wParam // Bounding rectangle SetDCPenColor(hDC, PROGRESS_BAR_BOX_COLOR); Rectangle(hDC, rc2.left, rc2.top, rc2.right, rc2.bottom); + if (hOldFont != NULL) + SelectObject(hDC, hOldFont); + SelectObject(hDC, hOldPen); + SelectObject(hDC, hOldBrush); EndPaint(hCtrl, &ps); return (INT_PTR)TRUE; } @@ -1586,10 +1596,13 @@ void SetBootTypeDropdownWidth(void) void OnPaint(HDC hdc) { int i; - HPEN hp = CreatePen(0, (fScale < 1.5f) ? 2 : 3, RGB(0, 0, 0)); - SelectObject(hdc, hp); + COLORREF cp = GetSysColor(COLOR_WINDOWTEXT); + HPEN hp = CreatePen(0, (fScale < 1.5f) ? 2 : 3, cp); + HPEN hop = (HPEN)SelectObject(hdc, hp); for (i = 0; i < ARRAYSIZE(section_vpos); i++) { MoveToEx(hdc, mw + 10, section_vpos[i], NULL); LineTo(hdc, mw + fw, section_vpos[i]); } + SelectObject(hdc, hop); + DeleteObject(hp); } diff --git a/src/ui.h b/src/ui.h index 746aefc7..446bbbe3 100644 --- a/src/ui.h +++ b/src/ui.h @@ -91,7 +91,7 @@ extern void GetHalfDropwdownWidth(HWND hDlg); extern void GetFullWidth(HWND hDlg); extern void PositionMainControls(HWND hDlg); extern void AdjustForLowDPI(HWND hDlg); -extern void SetSectionHeaders(HWND hDlg); +extern void SetSectionHeaders(HWND hDlg, HFONT* hFont); extern void SetPersistencePos(uint64_t pos); extern void SetPersistenceSize(void); extern void TogglePersistenceControls(BOOL display); From 845d26e3b650361290f2e8d0ae83c8509a330ef9 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 24 Mar 2025 13:00:11 +0000 Subject: [PATCH 036/192] [ui] fix toolbar ImageLists leaks * Also fix erroneous use of safe_delete_object() in previous commit and harmonize names. * Closes #2711. --- src/rufus.c | 22 ++++++++++++++-------- src/rufus.h | 5 +++++ src/rufus.rc | 10 +++++----- src/ui.c | 14 +++++++------- 4 files changed, 31 insertions(+), 20 deletions(-) diff --git a/src/rufus.c b/src/rufus.c index 95361a2e..4883b3bb 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -2204,7 +2204,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA static LPITEMIDLIST pidlDesktop = NULL; static SHChangeNotifyEntry NotifyEntry; static DWORD_PTR thread_affinity[HASH_MAX + 1]; - static HFONT hyperlink_font = NULL; + static HFONT hHyperlinkFont = NULL; static wchar_t wtooltip[128]; LONG lPos; BOOL set_selected_fs; @@ -2832,19 +2832,25 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA if ((HWND)lParam != GetDlgItem(hDlg, IDS_CSM_HELP_TXT)) return FALSE; SetBkMode((HDC)wParam, TRANSPARENT); - CreateStaticFont((HDC)wParam, &hyperlink_font, FALSE); - SelectObject((HDC)wParam, hyperlink_font); + CreateStaticFont((HDC)wParam, &hHyperlinkFont, FALSE); + SelectObject((HDC)wParam, hHyperlinkFont); SetTextColor((HDC)wParam, TOOLBAR_ICON_COLOR); return (INT_PTR)GetSysColorBrush(COLOR_BTNFACE); + case WM_DESTROY: + safe_destroy_imagelist_from_toolbar(hSaveToolbar); + safe_destroy_imagelist_from_toolbar(hHashToolbar); + safe_destroy_imagelist_from_toolbar(hMultiToolbar); + break; + case WM_NCDESTROY: - safe_delete_object(hyperlink_font); + safe_delete_object(hHyperlinkFont); safe_delete_object(hInfoFont); safe_delete_object(hSectionHeaderFont); - safe_delete_object(hUpImageList); - safe_delete_object(hDownImageList); - safe_delete_object(hSmallIcon); - safe_delete_object(hBigIcon); + safe_destroy_imagelist(hUpImageList); + safe_destroy_imagelist(hDownImageList); + safe_destroy_icon(hSmallIcon); + safe_destroy_icon(hBigIcon); break; case WM_NOTIFY: diff --git a/src/rufus.h b/src/rufus.h index 7cd5030f..ddd6b4d2 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -173,6 +173,11 @@ static __inline void safe_strcp(char* dst, const size_t dst_max, const char* src #define safe_closehandle(h) do { if ((h != INVALID_HANDLE_VALUE) && (h != NULL)) { CloseHandle(h); h = INVALID_HANDLE_VALUE; } } while(0) #define safe_release_dc(hDlg, hDC) do { if ((hDC != INVALID_HANDLE_VALUE) && (hDC != NULL)) { ReleaseDC(hDlg, hDC); hDC = NULL; } } while(0) #define safe_delete_object(hObj) do { if (hObj != NULL) { DeleteObject(hObj); hObj = NULL; } } while(0) +#define safe_destroy_icon(hIcon) do { if (hIcon != NULL) { DestroyIcon(hIcon); hIcon = NULL; } } while(0) +#define safe_destroy_imagelist(hImageList) do { if (hImageList != NULL) { ImageList_Destroy(hImageList); hImageList = NULL; } } while(0) +#define safe_destroy_imagelist_from_toolbar(hToolbar) do { if (hToolbar != NULL) { \ + HIMAGELIST _hImageList = (HIMAGELIST)SendMessage(hToolbar, TB_GETIMAGELIST, (WPARAM)0, (LPARAM)0); \ + safe_destroy_imagelist(_hImageList); } } while(0) #define safe_sprintf(dst, count, ...) do { size_t _count = count; char* _dst = dst; _snprintf_s(_dst, _count, _TRUNCATE, __VA_ARGS__); \ _dst[(_count) - 1] = 0; } while(0) #define static_sprintf(dst, ...) safe_sprintf(dst, sizeof(dst), __VA_ARGS__) diff --git a/src/rufus.rc b/src/rufus.rc index 24e93eee..122f3f8c 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.7.2226" +CAPTION "Rufus 4.7.2227" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -399,8 +399,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2226,0 - PRODUCTVERSION 4,7,2226,0 + FILEVERSION 4,7,2227,0 + PRODUCTVERSION 4,7,2227,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +418,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2226" + VALUE "FileVersion", "4.7.2227" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2226" + VALUE "ProductVersion", "4.7.2227" END END BLOCK "VarFileInfo" diff --git a/src/ui.c b/src/ui.c index 216b9821..27eac88d 100644 --- a/src/ui.c +++ b/src/ui.c @@ -840,7 +840,7 @@ void ToggleImageOptions(void) // We need to create the small toolbar buttons first so that we can compute their width void CreateSmallButtons(HWND hDlg) { - HIMAGELIST hImageList; + HIMAGELIST hSaveImageList, hHashImageList; HICON hIconSave, hIconHash; int icon_offset = 0, i16 = GetSystemMetrics(SM_CXSMICON); TBBUTTON tbToolbarButtons[1]; @@ -854,12 +854,12 @@ void CreateSmallButtons(HWND hDlg) hSaveToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, TOOLBAR_STYLE, 0, 0, 0, 0, hMainDialog, (HMENU)IDC_SAVE_TOOLBAR, hMainInstance, NULL); - hImageList = ImageList_Create(i16, i16, ILC_COLOR32 | ILC_HIGHQUALITYSCALE | ILC_MIRROR, 1, 0); + hSaveImageList = ImageList_Create(i16, i16, ILC_COLOR32 | ILC_HIGHQUALITYSCALE | ILC_MIRROR, 1, 0); buffer = GetResource(hMainInstance, MAKEINTRESOURCEA(IDI_SAVE_16 + icon_offset), _RT_RCDATA, "save icon", &bufsize, FALSE); hIconSave = CreateIconFromResourceEx(buffer, bufsize, TRUE, 0x30000, 0, 0, 0); - ImageList_AddIcon(hImageList, hIconSave); + ImageList_AddIcon(hSaveImageList, hIconSave); DestroyIcon(hIconSave); - SendMessage(hSaveToolbar, TB_SETIMAGELIST, (WPARAM)0, (LPARAM)hImageList); + SendMessage(hSaveToolbar, TB_SETIMAGELIST, (WPARAM)0, (LPARAM)hSaveImageList); SendMessage(hSaveToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0); memset(tbToolbarButtons, 0, sizeof(TBBUTTON)); tbToolbarButtons[0].idCommand = IDC_SAVE; @@ -871,12 +871,12 @@ void CreateSmallButtons(HWND hDlg) hHashToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, TOOLBAR_STYLE, 0, 0, 0, 0, hMainDialog, (HMENU)IDC_HASH_TOOLBAR, hMainInstance, NULL); - hImageList = ImageList_Create(i16, i16, ILC_COLOR32 | ILC_HIGHQUALITYSCALE | ILC_MIRROR, 1, 0); + hHashImageList = ImageList_Create(i16, i16, ILC_COLOR32 | ILC_HIGHQUALITYSCALE | ILC_MIRROR, 1, 0); buffer = GetResource(hMainInstance, MAKEINTRESOURCEA(IDI_HASH_16 + icon_offset), _RT_RCDATA, "hash icon", &bufsize, FALSE); hIconHash = CreateIconFromResourceEx(buffer, bufsize, TRUE, 0x30000, 0, 0, 0); - ImageList_AddIcon(hImageList, hIconHash); + ImageList_AddIcon(hHashImageList, hIconHash); DestroyIcon(hIconHash); - SendMessage(hHashToolbar, TB_SETIMAGELIST, (WPARAM)0, (LPARAM)hImageList); + SendMessage(hHashToolbar, TB_SETIMAGELIST, (WPARAM)0, (LPARAM)hHashImageList); SendMessage(hHashToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0); memset(tbToolbarButtons, 0, sizeof(TBBUTTON)); tbToolbarButtons[0].idCommand = IDC_HASH; From fdde687d4681d58b6eaba8e25b1561bea0614eb5 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 27 Mar 2025 16:05:06 +0000 Subject: [PATCH 037/192] [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. --- .mingw/wininet.def | 1 + .vs/rufus.vcxproj | 17 +- .vs/rufus.vcxproj.filters | 3 + res/dbx/amd64_DBXUpdate.bin | Bin 0 -> 23333 bytes res/dbx/arm64_DBXUpdate.bin | Bin 0 -> 4613 bytes res/dbx/arm_DBXUpdate.bin | Bin 0 -> 8645 bytes res/dbx/dbx_info.h | 17 + res/dbx/dbx_update.sh | 50 +++ res/dbx/ia64_DBXUpdate.bin | 0 res/dbx/loongarch64_DBXUpdate.bin | 0 res/dbx/readme.txt | 4 + res/dbx/riscv64_DBXUpdate.bin | 0 res/dbx/x86_DBXUpdate.bin | Bin 0 -> 7781 bytes res/loc/ChangeLog.txt | 5 +- res/loc/rufus.loc | 6 + res/md5/bootloongarch64.efi | Bin 0 -> 35072 bytes src/Makefile.am | 4 +- src/Makefile.in | 4 +- src/db.h | 579 ------------------------------ src/efi.h | 70 ++++ src/hash.c | 77 +++- src/missing.h | 10 +- src/net.c | 130 ++++++- src/resource.h | 15 +- src/rufus.c | 51 +-- src/rufus.h | 11 +- src/rufus.rc | 26 +- 27 files changed, 422 insertions(+), 658 deletions(-) create mode 100644 res/dbx/amd64_DBXUpdate.bin create mode 100644 res/dbx/arm64_DBXUpdate.bin create mode 100644 res/dbx/arm_DBXUpdate.bin create mode 100644 res/dbx/dbx_info.h create mode 100755 res/dbx/dbx_update.sh create mode 100644 res/dbx/ia64_DBXUpdate.bin create mode 100644 res/dbx/loongarch64_DBXUpdate.bin create mode 100644 res/dbx/readme.txt create mode 100644 res/dbx/riscv64_DBXUpdate.bin create mode 100644 res/dbx/x86_DBXUpdate.bin create mode 100644 res/md5/bootloongarch64.efi create mode 100644 src/efi.h diff --git a/.mingw/wininet.def b/.mingw/wininet.def index c1ca40d0..107d3326 100644 --- a/.mingw/wininet.def +++ b/.mingw/wininet.def @@ -2,6 +2,7 @@ EXPORTS HttpQueryInfoA@20 HttpOpenRequestA@32 HttpSendRequestA@20 + HttpAddRequestHeadersA@16 InternetCloseHandle@4 InternetConnectA@32 InternetCrackUrlA@16 diff --git a/.vs/rufus.vcxproj b/.vs/rufus.vcxproj index a0699550..a685a716 100644 --- a/.vs/rufus.vcxproj +++ b/.vs/rufus.vcxproj @@ -124,7 +124,7 @@ <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> - <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ExceptionHandling>Async</ExceptionHandling> @@ -155,7 +155,7 @@ <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> - <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ExceptionHandling>Async</ExceptionHandling> @@ -187,7 +187,7 @@ <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> - <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ExceptionHandling>Async</ExceptionHandling> @@ -219,7 +219,7 @@ <TargetEnvironment>X64</TargetEnvironment> </Midl> <ClCompile> - <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> @@ -254,7 +254,7 @@ <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> - <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ExceptionHandling>Async</ExceptionHandling> @@ -286,7 +286,7 @@ <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> - <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ExceptionHandling>Async</ExceptionHandling> @@ -320,7 +320,7 @@ <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> - <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ExceptionHandling>Async</ExceptionHandling> @@ -357,7 +357,7 @@ <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> - <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ExceptionHandling>Async</ExceptionHandling> @@ -417,6 +417,7 @@ <ClInclude Include="..\src\badblocks.h" /> <ClInclude Include="..\src\bled\bled.h" /> <ClInclude Include="..\src\drive.h" /> + <ClInclude Include="..\src\efi.h" /> <ClInclude Include="..\src\format.h" /> <ClInclude Include="..\src\gpt_types.h" /> <ClInclude Include="..\src\hdd_vs_ufd.h" /> diff --git a/.vs/rufus.vcxproj.filters b/.vs/rufus.vcxproj.filters index 90e4a67b..06a20b21 100644 --- a/.vs/rufus.vcxproj.filters +++ b/.vs/rufus.vcxproj.filters @@ -191,6 +191,9 @@ <ClInclude Include="..\src\vhd.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="..\src\efi.h"> + <Filter>Header Files</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <None Include="..\res\rufus.ico"> diff --git a/res/dbx/amd64_DBXUpdate.bin b/res/dbx/amd64_DBXUpdate.bin new file mode 100644 index 0000000000000000000000000000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WA}yJY%*?cJ zwuDGbmB9ALS0`2G5zp!C@c+o<E?IAL`T6A!sDT11Rr=RpZypH1_7_Owo&`@owle6t z+#TeTz3bTznTV?+RWLnu)7TNjWXk}?|7t$juBI=U(-de`719(y-i^CpM_MG-Vj{e+ z79A?R2;?J4m(2w~P4f-x#8@$Uza&L>xqXL9bZu!#FTLS!KHmcJ+Coh^KH>y$8*$z* zQy-J~dRPQMFnibu3*MnAH-|5S)z6U!!FsZ`oD|`D%koXm>;$QPE<zRi@?R&F+KH## z(u#okOK%-Ml%ryebi%AH`u|<Rf9zUObIADlV+4OK_Q!i-ULb$m7}o8u@hGb+cdf2c zph0W8SY9)sXBB>W9;HpqIBo;vr3%k;zEGY%opPX}p4c17P?Y|Cc%?7rtWGV_Hev%G z8pxL~RR=(IJ!XbXOOkh-+Dpgdh&!$zs#Bh7#Xt%8&V$V_?p^I)6FtbAsGv8my(FBK z5W_;4d$SOJ-54l*tUvVz^M59_o($NW9Vt1Ah@F}%7pe}r7V)v)=RT{uFvtBKg8IOC zwrSvETHHm4jd1(CQ|;XR19J^h=7vnYUaF=XeBb?U1@hyK!>Bw>0sM+@Zx-dPgdWq7 TGm9zy7z(~tKEQhAWJ~-Hd`%T& literal 0 HcmV?d00001 diff --git a/res/dbx/arm64_DBXUpdate.bin b/res/dbx/arm64_DBXUpdate.bin new file mode 100644 index 0000000000000000000000000000000000000000..33520068f2602fbd2c739b7f71e8946f5ba6ccd4 GIT binary patch literal 4613 zcmd6p2{hDeAIE328|x5lhN4pV&y1Z!6N!+0DZ9ZKjK<grV~wjsH%rolEM;qv<;q@H zM3F3&glt)&NcQ(X-P^srbKm>E=e*~<=e%?NXJ&rS^L>8L^Z)(7&*%TVVuP~^@(V$} ze^$7`f3O9fYu#mfL+*1Y5{l%*lq?7Z0F8SP28CjH0VFGjL#!^807t-}ED(T;l|wpK zH+C5bWrNabobvz;Y^1>_>2Men1{1`A=`h4*?xex6tS8?l!7wuXJ_O1IiX$U1TmT0v z+#JC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)5<^g%v4}KL;`{K->UD5_N8*~9 zhyX@A*;|43?A{=A$~VKR=JUm5xa#AMIb5Ds)=QCSJ>IRylTT|yg0`W?{>}kfJRu2p zwg?In-t@$bTr`98b&ERokHRbT1E@w#*>1$JiMSA=O$FaNX15ibV9{qh1oQS*AxI20 zMy}iXT7cNwPnEdu+<xpB(X;V}?C_gVZ5)I7a>PegYr9-Csdau{I^1}o43*a%YAb1y z#?8ELbF5@n^4-fW{3|MPq?pa-zI0PX3?e(ubU43HGD3t0j@UdK55V~bt_{aRV}nl$ z^4-S>A~SOIq!V=S0FMXQpZG-#sYh*s`J$Nb>CCSo-`~8iVTj(&WBZ`;smki7ljhoi z;%hjw{FVAlCAA}GXAFL#B}1k0(8HurAEG27_VZc4!45WE^*fUr;QXlXHZG5$xQP`G zrpUQwA2RRl{K*5+;-sDpJgEFa_m%IjetNsuN~@0(hgeJ2&AYUGF*`7*p9r4N;*@1< z5pVRf1?RuVUZS2$6S7W2Pm&~2QHhw~D8Esz>dr>5IxGLnO7F`4R-o}&`WMB5edudB z2&LYjMHN%qHy70|?=4`eN{8X(im#Z;vcugf$xIUrMTH>60|nx=98KhdA4xM{nr{#y za#y}j!<aje?Ja={af@Tw$TBNn<P?!^9_SWO5~K&?9@da#gU9bg&D$;5nl&P=A1B?b z6hM&J?Pj!P%e4~3DD6%rJc<tHG0O*Y1N*YS?^#W12afI#rccJacoj}8QtSMg{;B)C G!hZop21M}y literal 0 HcmV?d00001 diff --git a/res/dbx/dbx_info.h b/res/dbx/dbx_info.h new file mode 100644 index 00000000..6a032b0e --- /dev/null +++ b/res/dbx/dbx_info.h @@ -0,0 +1,17 @@ +// Autogenerated - DO NOT EDIT + +#include <stdint.h> +#pragma once + +struct { + char* url; + uint64_t timestamp; +} dbx_info[] = { + { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/x86/DBXUpdate.bin", 1740428422 }, + { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/amd64/DBXUpdate.bin", 1740428422 }, + { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/arm/DBXUpdate.bin", 1740428422 }, + { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/arm64/DBXUpdate.bin", 1740428422 }, + { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/ia64/DBXUpdate.bin", 0 }, + { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/riscv64/DBXUpdate.bin", 0 }, + { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/loongarch64/DBXUpdate.bin", 0 }, +}; diff --git a/res/dbx/dbx_update.sh b/res/dbx/dbx_update.sh new file mode 100755 index 00000000..fa472d2c --- /dev/null +++ b/res/dbx/dbx_update.sh @@ -0,0 +1,50 @@ +#!/bin/env bash +# This script downloads the latest UEFI DBXs and creates the dbx_info.h header + +github_url="https://api.github.com/" + +# Retrieve the commit epoch from a GitHub URL or 0 if not available +get_commit_date() { + url=$1 + if [[ "${url}" =~ ^"${github_url}" ]]; then + parts=($(awk -F'contents/' '{ for(i=1;i<=NF;i++) print $i }' <<< ${url})) + date_url="${parts[0]}commits?path=${parts[1]//\//%2F}&page=1&per_page=1" + epoch="$(curl -s -L ${date_url} | grep -m1 \"date\": | sed -e 's/^.*\"date\":.*\"\(.*\)\".*/\1/' | date -f - +%s)" + fi + echo ${epoch:-0} +} + +# Should be in the same order as the ArchType enum in Rufus with the first entry (ARCH_UNKNOWN = 0) skipped +# Note that are GUESSING the RISC-V 64 and LoongArch 64 URLS since there are no DBX revocations for those archs yet. +# Also use api.github.com (which is rate limited) so we don't get the stupid 404 GitHub page on error, which is 10 +# times larger than our largest DBX update binary... +declare -a dbx_urls=( + 'https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/x86/DBXUpdate.bin' + 'https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/amd64/DBXUpdate.bin' + 'https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/arm/DBXUpdate.bin' + 'https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/arm64/DBXUpdate.bin' + 'https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/ia64/DBXUpdate.bin' + 'https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/riscv64/DBXUpdate.bin' + 'https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/loongarch64/DBXUpdate.bin' +) + +cat << EOF > dbx_info.h +// Autogenerated - DO NOT EDIT + +#include <stdint.h> +#pragma once + +struct { + char* url; + uint64_t timestamp; +} dbx_info[] = { +EOF +for url in "${dbx_urls[@]}"; do + if [[ ! -z "${url}" ]]; then + dst=$(echo ${url} | cut -f10,11 -d'/' | tr '/' '_') + curl -L -H "Accept: application/vnd.github.v3.raw" "${url}" -o "${dst}" + fgrep -q "Not Found" "${dst}" && :> "${dst}" + fi + echo " { \"${url}\", $(get_commit_date ${url}) }," >> dbx_info.h +done +echo "};" >> dbx_info.h diff --git a/res/dbx/ia64_DBXUpdate.bin b/res/dbx/ia64_DBXUpdate.bin new file mode 100644 index 00000000..e69de29b diff --git a/res/dbx/loongarch64_DBXUpdate.bin b/res/dbx/loongarch64_DBXUpdate.bin new file mode 100644 index 00000000..e69de29b diff --git a/res/dbx/readme.txt b/res/dbx/readme.txt new file mode 100644 index 00000000..36e98106 --- /dev/null +++ b/res/dbx/readme.txt @@ -0,0 +1,4 @@ +This directory contains the official UEFI revocation databases, as provided by +https://github.com/microsoft/secureboot_objects/tree/main/PostSignedObjects. + +These are used by Rufus to warn the user if a UEFI bootloader has been revoked. \ No newline at end of file diff --git a/res/dbx/riscv64_DBXUpdate.bin b/res/dbx/riscv64_DBXUpdate.bin new file mode 100644 index 00000000..e69de29b diff --git a/res/dbx/x86_DBXUpdate.bin b/res/dbx/x86_DBXUpdate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87Ds*0#{Je( ZI-ROMu19a&zEuZ{;`=q(G3X^U{txNxiU0rr literal 0 HcmV?d00001 diff --git a/res/loc/ChangeLog.txt b/res/loc/ChangeLog.txt index 6939aa06..f1cf6749 100644 --- a/res/loc/ChangeLog.txt +++ b/res/loc/ChangeLog.txt @@ -8,8 +8,11 @@ Or simply download https://files.akeo.ie/pollock/pollock-1.5.exe and follow its o v4.? (????.??.??) ** NOT FINAL!!! PLEASE DO NOT SEND UNSOLICITED TRANSLATIONS! ** - *NEW* MSG_350 "Use 'Windows UEFI CA 2023' signed bootloaders [EXPERIMENTAL]" - *NEW* MSG_351 "Checking for UEFI bootloader revocation..." + - *NEW* MSG_352 "Checking for UEFI DBX updates..." + - *NEW* MSG_353 "DBX update available" + - *NEW* MSG_354 "Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks..." -o v4.5 (2024.05.??) +o v4.5 (2024.05.22) - *UPDATED* IDC_RUFUS_MBR -> IDC_UEFI_MEDIA_VALIDATION "Enable runtime UEFI media validation" - *UPDATED* MSG_167 "Install a UEFI bootloader, that will perform MD5Sum file validation of the media" - *NEW* MSG_337 "An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS (...)" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 04e3529b..8eb0ceb2 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -611,6 +611,12 @@ t MSG_348 "Extracting archive files: %s" t MSG_349 "Use Rufus MBR" t MSG_350 "Use 'Windows UEFI CA 2023' signed bootloaders [EXPERIMENTAL]" t MSG_351 "Checking for UEFI bootloader revocation..." +t MSG_352 "Checking for UEFI DBX updates..." +t MSG_353 "DBX update available" +t MSG_354 "Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" + "- Select 'Yes' to connect to the Internet and download the DBX content\n" + "- Select 'No' to cancel the operation\n\n" + "Note: The files will be downloaded in the application's directory and will be reused automatically if present." # The following messages are for the Windows Store listing only and are not used by the application t MSG_900 "Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc." t MSG_901 "Official site: %s" diff --git a/res/md5/bootloongarch64.efi b/res/md5/bootloongarch64.efi new file mode 100644 index 0000000000000000000000000000000000000000..0a06b633d1c4239159d66c0ede2c1177c3bdb9f9 GIT binary patch literal 35072 zcmeHwdt6mj+W&L*K7bm?K|znHbyC!Q2o*9DN^2trFNH>)(?DtCAwXa_fB`06%57qH zIbOQVXk|e&+U1R7cF)q>B$_j$=u|V-)Fe$fPH%XrY|s?;@B8e1HaD?peBXb5pU->z zZ1-)g=f0lxtY@vYnQ=Q^^iR3ynjIB0(ui{J6gwW^>LiV!O9UcSA@YV8uVmcwVg4Mr z;N!gCgB|7iocFTl2ezIc_xRNN08tIz>|I4Pq{k8$_i#)_US$QUGSAGXdF~9&0db7U z&92DCLtQQ_I?kQT$*4Z2EYDY(W6)~S%;(NOl$+f7{$j3cZxro*3&rLrny^q-os|yN zneA1bi-<;Tpcr}!hY~|_pclms%2kA9(IM83rh+3v3|Yk(FiW2H>nid*f%5J5KJoyT z1h^95O0g&pxFd5ERd5icGrf$L@tL^SqyF1CsOnZv2+B7B4|(!+IOaXWVwenv(hD*e zjw1+<wub2UIV#|Sm+%o*=5J&eV20xGKU*h-;B4)s2+J)x4MzDO|A&TI?acy>WSY2+ z-%>AeJ-rUjT!-J!7!`;KSk{UDFLz0sEPzKepcwf0z3+;jhm+~fQQJUgopW)G>hwb9 z%6yAl*{C{M1~pX{IY4sUrJyx@{&L}VmVF{+;k|@9k_+-dJt;@73(8X#p^z@eB2{&= zPORQXge8jVr1WghQ@B_53Nq_&A=NpTdhz^)n?2#y2ZX9us6g?Ny#Aaf^aakwIC9Yt z3uM$4u6f_mrU{L0BsU9(A**<b7#Ewg<(M{?#ziNwzF6l&UbB%lSj&8p@!AAe{BTtY z#dA7H8DVQhd+4d<Lda^-9y>v_)7A4lzEiqQ#@!>UP9=?GZ9-e7iLd*4)kCP?jQS6w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WXcuMpRyr-Bq3`zA~0k*B2>wc9S{-n4UT#qnqG}JX1X9KV(Uk z=9K!nl%8IaQ(8P9an7B-JjXBc%F5B<5jwsF5dI>^FA7V2dJF_ask2hM)YPd@E6HVb zbd@QjkymziUamvBDmfVL5Oq8p$8nMI3s#>}=<6gp)9TWpj|J!(^`fbuvaGbYupD4r z#-Fwa?-`Di+}tu&3Bs0nzQP=ccABRL-pRc{SDlHt<D8jYR>G0fttCYzr3*_OQ+<o( z>ye=O!j<QP={u%m7y1^IF)`)~!#+Enx4$^g?#&u*IMcii@;gAW037Z`<rR6w24!Xq zmKwL0yA~9d=@yrec-6S8$6qrcDLG|wsw-{EGR@k-%m2q$+MLC|`t+akZ+_>m3tmbX z(GVTKaIx*nKYtwc<P=&r>V~=*FD2I4Q(wPy#%49V_sGkt?|P&pv-b_fA4aW7rkdXu zmR&b&_RQbhmfLavY~tYAcm5jpHyH2ly5;JIOWwi#&BnberuDnW*T>)Z#F!)R9&mj1 zc;e`%zj<KvM^R4>Fz`Lv4gMuT*<KYqNB@5;>;EJD|0M8#68Jv}V38g2OGHgr_|C`7 z$%(<Nh9R4uKSr9opwO2)c2-(?T8cYu?$p%O@nh3(zIo=<lv%0MuDN>bjNI|=1;rUf z`D0yalW(0GydRU>IWn71R0FhoUpn~GCoeU=^v{=i)!J(9wT@b;Hla4DR<4~^n^Bup z>#Z%QonKp7tJFSFyRLRaZB6Y9wOec7u2pOI)*h_=q_(m4pS34zPuEhQSHKpq2OI$@ zkPt`;$bo5rj6hbv8z>0O4^#$}zypDGfenG0zzcz`fwu!{U~k}H;FEyC`T76<KRsa2 A9{>OV literal 0 HcmV?d00001 diff --git a/src/Makefile.am b/src/Makefile.am index 7f68b39b..59cf87f7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,8 +19,8 @@ AM_V_WINDRES = $(AM_V_WINDRES_$(V)) rufus_SOURCES = badblocks.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c -rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio $(AM_CFLAGS) \ +rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/../res $(AM_CFLAGS) \ -DEXT2_FLAT_INCLUDES=0 -DSOLUTION=rufus -rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows -L ../.mingw +rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows -L $(srcdir)/../.mingw rufus_LDADD = rufus_rc.o bled/libbled.a ext2fs/libext2fs.a ms-sys/libmssys.a syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a syslinux/win/libwin.a \ libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a $(NONVULNERABLE_LIBS) $(VULNERABLE_LIBS) diff --git a/src/Makefile.in b/src/Makefile.in index e3132680..c0fa14e6 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -287,10 +287,10 @@ AM_V_WINDRES = $(AM_V_WINDRES_$(V)) rufus_SOURCES = badblocks.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c -rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio $(AM_CFLAGS) \ +rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/../res $(AM_CFLAGS) \ -DEXT2_FLAT_INCLUDES=0 -DSOLUTION=rufus -rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows -L ../.mingw +rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows -L $(srcdir)/../.mingw rufus_LDADD = rufus_rc.o bled/libbled.a ext2fs/libext2fs.a ms-sys/libmssys.a syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a syslinux/win/libwin.a \ libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a $(NONVULNERABLE_LIBS) $(VULNERABLE_LIBS) diff --git a/src/db.h b/src/db.h index 3f015805..b3db434c 100644 --- a/src/db.h +++ b/src/db.h @@ -123,585 +123,6 @@ static uint8_t sha256db[] = { 0xfb, 0x49, 0xfd, 0x45, 0x8c, 0xaf, 0x47, 0x5a, 0x16, 0x05, 0x5e, 0x4a, 0x75, 0x5a, 0xc3, 0xe3, 0x95, 0x52, 0xf4, 0xe9, 0x6c, 0xa2, 0x0d, 0xea, 0x53, 0xf5, 0xc4, 0x09, 0x2b, 0x68, 0xfd, 0x4f, // syslinux-6.00/ldlinux.sys }; -/* - * DBX table data was generated through the following shell command: - * wget -q -O - https://uefi.org/sites/default/files/resources/dbx_info.csv | tail -n +2 | awk -F "\"*,\"*" '{print $2}' | tr '[:upper:]' '[:lower:]' | sort | uniq -w 64 | awk -F '' '{for(i=1; i<=64; i+=2) {printf "0x%s%s, ", $i,$(i+1);}} {print ""}' - * TODO: Use https://github.com/microsoft/secureboot_objects/blob/main/PreSignedObjects/DBX/dbx_info_msft_DD_MM_YY.json as our source (provided we can get a stable not date specific URL) - * - * Note that, because we are using the "UEFI Revocation List Contents" to generate the table - * below and not the *signed* "UEFI Revocation List file(s)" and the Microsoft terms of use at - * https://uefi.org/revocationlistfile make it clear that they governs only the use of the UEFI - * Revocation List file(s), we assert that the utterly moronic and downright user-endangering - * (since they effectively prevent end-users from being able to revoke bootloaders that should - * be revoked, thereby fostering the proliferation of malware) Microsoft terms of use that - * restrict the download and use of the "UEFI Revocation List file(s)" do not apply to the - * table below, especially as it is not used in the context of UEFI itself or for installation - * or update of UEFI systems. - */ -static uint8_t pe256dbx[] = { - 0x00, 0x21, 0xb5, 0xb1, 0x1c, 0xeb, 0x03, 0x40, 0x2d, 0x61, 0x81, 0x34, 0x80, 0x0a, 0x36, 0xc5, 0x4e, 0x1c, 0x43, 0x28, 0xad, 0x38, 0x9d, 0x50, 0xb4, 0x0e, 0xac, 0xc1, 0xe8, 0x81, 0xdc, 0xb5, - 0x00, 0x7f, 0x4c, 0x95, 0x12, 0x57, 0x13, 0xb1, 0x12, 0x09, 0x3e, 0x21, 0x66, 0x3e, 0x2d, 0x23, 0xe3, 0xc1, 0xae, 0x9c, 0xe4, 0xb5, 0xde, 0x0d, 0x58, 0xa2, 0x97, 0x33, 0x23, 0x36, 0xa2, 0xd8, - 0x01, 0xe2, 0xda, 0x8e, 0xc5, 0xa6, 0x92, 0x9d, 0xdb, 0xbb, 0xeb, 0x2e, 0x98, 0x07, 0x58, 0x6f, 0xac, 0xdd, 0xca, 0x6a, 0x7e, 0xf6, 0x2b, 0xfe, 0xbb, 0x58, 0x1b, 0xdc, 0x2d, 0x72, 0x74, 0xd6, - 0x02, 0x57, 0xff, 0x71, 0x0f, 0x2a, 0x16, 0xe4, 0x89, 0xb3, 0x74, 0x93, 0xc0, 0x76, 0x04, 0xa7, 0xcd, 0xa9, 0x61, 0x29, 0xd8, 0xa8, 0xfd, 0x68, 0xd2, 0xb6, 0xaf, 0x63, 0x39, 0x04, 0x31, 0x5d, - 0x02, 0xe6, 0x21, 0x6a, 0xca, 0xef, 0x64, 0x01, 0x40, 0x1f, 0xa5, 0x55, 0xec, 0xbe, 0xd9, 0x40, 0xb1, 0xa5, 0xf2, 0x56, 0x9a, 0xed, 0x92, 0x95, 0x61, 0x37, 0xae, 0x58, 0x48, 0x2e, 0xf1, 0xb7, - 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0x36, 0x80, 0x59, 0x71, 0x30, 0xad, 0x16, 0x1e, 0xee, 0x8c, 0xbc, 0xe3, 0x4b, 0x59, 0xe1, 0x0c, 0x61, 0x67, 0xe9, 0x2a, - 0x27, 0x0c, 0x84, 0xb2, 0x9d, 0x86, 0xf1, 0x63, 0x12, 0xb0, 0x6a, 0xaa, 0xe4, 0xeb, 0xb8, 0xdf, 0xf8, 0xde, 0x7d, 0x08, 0x0d, 0x82, 0x5b, 0x88, 0x39, 0xff, 0x17, 0x66, 0x27, 0x4e, 0xff, 0x47, - 0x28, 0x41, 0x2f, 0xa0, 0x28, 0x02, 0xa3, 0x93, 0x9a, 0x70, 0x9f, 0x51, 0x87, 0x98, 0x40, 0x45, 0x82, 0xff, 0x60, 0x1e, 0x67, 0xea, 0x9c, 0x54, 0x2c, 0x78, 0x96, 0x3f, 0x2e, 0xae, 0x18, 0xff, - 0x28, 0x41, 0x53, 0xe7, 0xd0, 0x4a, 0x9f, 0x18, 0x7e, 0x5c, 0x3d, 0xbf, 0xe1, 0x7b, 0x26, 0x72, 0xad, 0x2f, 0xbd, 0xd1, 0x19, 0xf2, 0x7b, 0xec, 0x78, 0x94, 0x17, 0xb7, 0x91, 0x98, 0x53, 0xec, - 0x28, 0x88, 0x78, 0xf1, 0x2e, 0x8b, 0x9c, 0x6c, 0xcb, 0xf6, 0x01, 0xc7, 0x3d, 0x5f, 0x4e, 0x98, 0x5c, 0xac, 0x0f, 0xf3, 0xfc, 0xb0, 0xc2, 0x4e, 0x44, 0x14, 0x91, 0x2b, 0x3e, 0xb9, 0x1f, 0x15, - 0x28, 0xce, 0x0d, 0xad, 0x50, 0x73, 0x09, 0x00, 0xc5, 0xd1, 0x8c, 0xc5, 0x8d, 0x52, 0x55, 0x29, 0x34, 0x52, 0xca, 0x37, 0xd7, 0x64, 0x86, 0x8c, 0x16, 0xea, 0xa9, 0xea, 0xf6, 0xbd, 0x7c, 0x83, - 0x29, 0x92, 0x06, 0x8e, 0x4f, 0x61, 0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 0x50, 0xd7, 0x68, 0xe3, 0xef, 0x38, 0x80, 0x83, 0x8b, 0x52, 0x84, 0x6a, 0x74, - 0x84, 0xd7, 0x5f, 0x7a, 0x89, 0x13, 0xd6, 0x6d, 0xb9, 0x46, 0xea, 0xf1, 0x48, 0x0e, 0xad, 0xde, 0xc3, 0x06, 0x3d, 0x27, 0xa6, 0xf6, 0x25, 0xf0, 0x40, 0xb4, 0x06, 0x71, 0x8a, 0xbc, 0xac, 0x44, - 0x85, 0x25, 0x57, 0x00, 0x89, 0x09, 0x31, 0xc5, 0xb7, 0x1a, 0x73, 0xdf, 0xf0, 0x9e, 0xa5, 0x12, 0x5c, 0xd7, 0x02, 0xea, 0x65, 0xf4, 0x5b, 0x40, 0x54, 0xc1, 0x46, 0x3e, 0x00, 0x17, 0x3f, 0xdc, - 0x86, 0xe9, 0x38, 0x4c, 0x41, 0xf9, 0x33, 0x9d, 0x9b, 0x0f, 0x80, 0xb4, 0x80, 0x55, 0xd0, 0x2b, 0xe5, 0xff, 0x90, 0x88, 0x60, 0xf2, 0xce, 0xf6, 0x33, 0x59, 0xe0, 0xd8, 0xb7, 0x93, 0x7a, 0x27, - 0x87, 0x17, 0x6a, 0x15, 0xe7, 0x66, 0xbd, 0x06, 0x52, 0x8e, 0xd9, 0x1a, 0x61, 0x48, 0x1c, 0x3b, 0x3c, 0xde, 0x65, 0xee, 0x95, 0x11, 0x54, 0x03, 0xf9, 0xff, 0xc6, 0xd3, 0xa2, 0x6d, 0x43, 0xd0, - 0x88, 0x06, 0xcf, 0x0c, 0x7b, 0xd5, 0xdf, 0x7e, 0x01, 0xd1, 0x20, 0xf5, 0x67, 0x34, 0x11, 0x3b, 0xe9, 0x16, 0xe1, 0x83, 0x75, 0x55, 0x77, 0xbd, 0x48, 0x02, 0x6c, 0x25, 0xdb, 0x26, 0x86, 0x80, - 0x88, 0x10, 0xb3, 0x70, 0x03, 0xe7, 0xcd, 0xda, 0x02, 0x66, 0x63, 0x96, 0x8a, 0xa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x8e, 0x65, 0x72, 0x57, 0xf7, 0x3f, 0x66, 0x01, 0x7d, 0xe4, 0x5e, 0x18, 0xee, 0x74, 0x6e, 0xd7, 0xd5, - 0xe9, 0xd8, 0x73, 0xcb, 0xce, 0xde, 0x36, 0x34, 0xe0, 0xa4, 0xb3, 0x64, 0x4b, 0x51, 0xe1, 0xc8, 0xa0, 0xa0, 0x48, 0x27, 0x29, 0x92, 0xc7, 0x38, 0x51, 0x3e, 0xbc, 0x96, 0xcd, 0x3e, 0x33, 0x60, - 0xe9, 0xe4, 0xb5, 0xa5, 0x1f, 0x6a, 0x55, 0x75, 0xb9, 0xf5, 0xbf, 0xab, 0x18, 0x52, 0xb0, 0xcb, 0x27, 0x95, 0xc6, 0x6f, 0xf4, 0xb2, 0x81, 0x35, 0x09, 0x7c, 0xba, 0x67, 0x1a, 0x54, 0x91, 0xb9, - 0xea, 0x9c, 0x72, 0xc1, 0xce, 0x86, 0x5e, 0x60, 0x44, 0xab, 0xff, 0x57, 0x6f, 0xd7, 0x12, 0xd4, 0xdf, 0x3f, 0x51, 0x14, 0x31, 0x87, 0x53, 0xef, 0xcf, 0xef, 0xed, 0x70, 0xee, 0x58, 0x68, 0x84, - 0xea, 0xff, 0x8c, 0x85, 0xc2, 0x08, 0xba, 0x4d, 0x5b, 0x6b, 0x80, 0x46, 0xf5, 0xd6, 0x08, 0x17, 0x47, 0xd7, 0x79, 0xba, 0xda, 0x77, 0x68, 0xe6, 0x49, 0xd0, 0x47, 0xff, 0x9b, 0x1f, 0x66, 0x0c, - 0xec, 0xb7, 0x89, 0xc1, 0x73, 0xe1, 0xfa, 0x4e, 0x60, 0x4f, 0xf4, 0x5a, 0x57, 0xa4, 0x5b, 0x28, 0x68, 0xd8, 0xac, 0xb1, 0xce, 0x61, 0x6d, 0x8a, 0xee, 0xf0, 0x8d, 0x5e, 0x25, 0x2c, 0xcd, 0x6f, - 0xed, 0xd2, 0xcb, 0x55, 0x72, 0x6e, 0x10, 0xab, 0xed, 0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HA-1 thumbprints of the issuer certificate of the official * Secure Boot signing authority (i.e. Microsoft). diff --git a/src/efi.h b/src/efi.h new file mode 100644 index 00000000..ecfa98a1 --- /dev/null +++ b/src/efi.h @@ -0,0 +1,70 @@ +/* +* Rufus: The Reliable USB Formatting Utility +* UEFI constants and structs +* Copyright © 2025 Pete Batard <pete@akeo.ie> +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include <basetsd.h> +#include <guiddef.h> + +#pragma pack(1) + +typedef struct { + UINT16 Year; + UINT8 Month; + UINT8 Day; + UINT8 Hour; + UINT8 Minute; + UINT8 Second; + UINT8 Pad1; + UINT32 Nanosecond; + INT16 TimeZone; + UINT8 Daylight; + UINT8 Pad2; +} EFI_TIME; + +typedef struct _WIN_CERTIFICATE { + UINT32 dwLength; + UINT16 wRevision; + UINT16 wCertificateType; +} WIN_CERTIFICATE; + +typedef struct _WIN_CERTIFICATE_UEFI_GUID { + WIN_CERTIFICATE Hdr; + GUID CertType; + UINT8 CertData[1]; +} WIN_CERTIFICATE_UEFI_GUID; + +typedef struct { + EFI_TIME TimeStamp; + WIN_CERTIFICATE_UEFI_GUID AuthInfo; +} EFI_VARIABLE_AUTHENTICATION_2; + +typedef struct { + GUID SignatureOwner; + UINT8 SignatureData[1]; +} EFI_SIGNATURE_DATA; + +typedef struct { + GUID SignatureType; + UINT32 SignatureListSize; + UINT32 SignatureHeaderSize; + UINT32 SignatureSize; +} EFI_SIGNATURE_LIST; + +#pragma pack() + +const GUID EFI_CERT_SHA256_GUID = { 0xc1c41626, 0x504c, 0x4092, { 0xac, 0xa9, 0x41, 0xf9, 0x36, 0x93, 0x43, 0x28 } }; diff --git a/src/hash.c b/src/hash.c index e2a4652e..e0e4d173 100644 --- a/src/hash.c +++ b/src/hash.c @@ -5,7 +5,7 @@ * Copyright © 2004-2019 Tom St Denis * Copyright © 2004 g10 Code GmbH * Copyright © 2002-2015 Wei Dai & Igor Pavlov - * Copyright © 2015-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2015-2025 Pete Batard <pete@akeo.ie> * Copyright © 2022 Jeffrey Walton <noloader@gmail.com> * Copyright © 2016 Alexander Graf * @@ -70,6 +70,7 @@ #include <windowsx.h> #include "db.h" +#include "efi.h" #include "rufus.h" #include "winio.h" #include "missing.h" @@ -2196,6 +2197,68 @@ static BOOL IsRevokedBySbat(uint8_t* buf, uint32_t len) return FALSE; } +// NB: Can be tested using en_windows_8_1_x64_dvd_2707217.iso +extern BOOL UseLocalDbx(int arch); +static BOOL IsRevokedByDbx(uint8_t* hash, uint8_t* buf, uint32_t len) +{ + EFI_VARIABLE_AUTHENTICATION_2* efi_var_auth; + EFI_SIGNATURE_LIST* efi_sig_list; + BYTE* dbx_data = NULL; + BOOL ret = FALSE, needs_free = FALSE; + DWORD dbx_size = 0; + char dbx_name[32], path[MAX_PATH]; + uint32_t i, fluff_size, nb_entries; + + i = MachineToArch(GetPeArch(buf)); + if (i == ARCH_UNKNOWN) + goto out; + + // Check if a more recent local DBX should be preferred over embedded + static_sprintf(dbx_name, "dbx_%s.bin", efi_archname[i]); + if (UseLocalDbx(i)) { + static_sprintf(path, "%s\\%s\\%s", app_data_dir, FILES_DIR, dbx_name); + dbx_size = read_file(path, &dbx_data); + needs_free = (dbx_data != NULL); + if (needs_free) + duprintf("Using local %s for revocation check", path); + } + if (dbx_size == 0) { + dbx_data = (BYTE*)GetResource(hMainInstance, MAKEINTRESOURCEA(IDR_DBX + i), + _RT_RCDATA, dbx_name, &dbx_size, FALSE); + } + if (dbx_data == NULL || dbx_size <= sizeof(EFI_VARIABLE_AUTHENTICATION_2)) + goto out; + + efi_var_auth = (EFI_VARIABLE_AUTHENTICATION_2*)dbx_data; + fluff_size = efi_var_auth->AuthInfo.Hdr.dwLength + sizeof(EFI_TIME); // +sizeof(EFI_SIGNATURE_LIST); + if (dbx_size <= fluff_size) + goto out; + efi_sig_list = (EFI_SIGNATURE_LIST*)&dbx_data[fluff_size]; + fluff_size += sizeof(EFI_SIGNATURE_LIST); + if (dbx_size <= fluff_size) + goto out; + // Expect SHA-256 hashes + if (!CompareGUID(&efi_sig_list->SignatureType, &EFI_CERT_SHA256_GUID)) { + uprintf("WARNING: %s is not using SHA-256 hashes - Cannot check for UEFI revocation!", dbx_name); + goto out; + } + fluff_size += efi_sig_list->SignatureHeaderSize; + assert(efi_sig_list->SignatureSize != 0); + nb_entries = (efi_sig_list->SignatureListSize - efi_sig_list->SignatureHeaderSize - sizeof(EFI_SIGNATURE_LIST)) / efi_sig_list->SignatureSize; + assert(dbx_size >= fluff_size + nb_entries * efi_sig_list->SignatureSize); + + fluff_size += sizeof(GUID); + for (i = 0; i < nb_entries && !ret; i++) { + if (memcmp(hash, &dbx_data[fluff_size + i * efi_sig_list->SignatureSize], SHA256_HASHSIZE) == 0) + ret = TRUE; + } + +out: + if (needs_free) + free(dbx_data); + return ret; +} + static BOOL IsRevokedBySvn(uint8_t* buf, uint32_t len) { wchar_t* rsrc_name = NULL; @@ -2314,9 +2377,8 @@ int IsBootloaderRevoked(uint8_t* buf, uint32_t len) if (!PE256Buffer(buf, len, hash)) return -1; // Check for UEFI DBX revocation - for (i = 0; i < ARRAYSIZE(pe256dbx); i += SHA256_HASHSIZE) - if (memcmp(hash, &pe256dbx[i], SHA256_HASHSIZE) == 0) - return 1; + if (IsRevokedByDbx(hash, buf, len)) + return 1; // Check for Microsoft SSP revocation for (i = 0; i < pe256ssp_size * SHA256_HASHSIZE; i += SHA256_HASHSIZE) if (memcmp(hash, &pe256ssp[i], SHA256_HASHSIZE) == 0) @@ -2333,13 +2395,6 @@ int IsBootloaderRevoked(uint8_t* buf, uint32_t len) return 0; } -void PrintRevokedBootloaderInfo(void) -{ - uprintf("Found %d revoked UEFI bootloaders from embedded list", sizeof(pe256dbx) / SHA256_HASHSIZE); - if (ParseSKUSiPolicy() && pe256ssp_size != 0) - uprintf("Found %d additional revoked UEFI bootloaders from this system's SKUSiPolicy.p7b", pe256ssp_size); -} - /* * Updates the MD5SUMS/md5sum.txt file that some distros (Ubuntu, Mint...) * use to validate the media. Because we may alter some of the validated files diff --git a/src/missing.h b/src/missing.h index 4bf4b387..a62203d3 100644 --- a/src/missing.h +++ b/src/missing.h @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Constants and defines missing from various toolchains -* Copyright © 2016-2024 Pete Batard <pete@akeo.ie> +* Copyright © 2016-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -183,7 +183,7 @@ static __inline uint16_t remap16(uint16_t src, uint16_t* map, const BOOL reverse #define ERROR_OFFSET_ALIGNMENT_VIOLATION 327 #endif -/* RISC-V is still bleeding edge */ +/* RISC-V and LoongArch are still bleeding edge */ #ifndef IMAGE_FILE_MACHINE_RISCV32 #define IMAGE_FILE_MACHINE_RISCV32 0x5032 #endif @@ -193,3 +193,9 @@ static __inline uint16_t remap16(uint16_t src, uint16_t* map, const BOOL reverse #ifndef IMAGE_FILE_MACHINE_RISCV128 #define IMAGE_FILE_MACHINE_RISCV128 0x5128 #endif +#ifndef IMAGE_FILE_MACHINE_LOONGARCH32 +#define IMAGE_FILE_MACHINE_LOONGARCH32 0x6232 +#endif +#ifndef IMAGE_FILE_MACHINE_LOONGARCH64 +#define IMAGE_FILE_MACHINE_LOONGARCH64 0x6264 +#endif diff --git a/src/net.c b/src/net.c index d19d0f93..eb7a0b66 100644 --- a/src/net.c +++ b/src/net.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Networking functionality (web file download, check for update, etc.) - * Copyright © 2012-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2012-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,6 +37,7 @@ #include <string.h> #include <inttypes.h> #include <assert.h> +#include <time.h> #include <virtdisk.h> #include "rufus.h" @@ -45,6 +46,7 @@ #include "msapi_utf8.h" #include "localization.h" #include "bled/bled.h" +#include "dbx/dbx_info.h" #include "settings.h" @@ -63,7 +65,8 @@ extern BOOL is_x86_64; extern USHORT NativeMachine; static DWORD error_code, fido_len = 0; static BOOL force_update_check = FALSE; -static const char* request_headers = "Accept-Encoding: gzip, deflate"; +static const char* request_headers[2] = { "Accept-Encoding: none", "Accept-Encoding: gzip, deflate" }; +extern const char* efi_archname[ARCH_MAX]; #if defined(__MINGW32__) #define INetworkListManager_get_IsConnectedToInternet INetworkListManager_IsConnectedToInternet @@ -168,8 +171,8 @@ out: * If hProgressDialog is not NULL, this function will send INIT and EXIT messages * to the dialog in question, with WPARAM being set to nonzero for EXIT on success * and also attempt to indicate progress using an IDC_PROGRESS control - * Note that when a buffer is used, the actual size of the buffer is one more than its reported - * size (with the extra byte set to 0) to accommodate for calls that need a NUL-terminated buffer. + * Note that when a buffer is used, the actual size of the buffer is two more than its reported + * size (with the extra bytes set to 0) to accommodate for calls that need NUL-terminated data. */ uint64_t DownloadToFileOrBufferEx(const char* url, const char* file, const char* user_agent, BYTE** buffer, HWND hProgressDialog, BOOL bTaskBarProgress) @@ -178,12 +181,12 @@ uint64_t DownloadToFileOrBufferEx(const char* url, const char* file, const char* const char* short_name; unsigned char buf[DOWNLOAD_BUFFER_SIZE]; char hostname[64], urlpath[128], strsize[32]; - BOOL r = FALSE; + BOOL r = FALSE, use_github_api; DWORD dwSize, dwWritten, dwDownloaded; HANDLE hFile = INVALID_HANDLE_VALUE; HINTERNET hSession = NULL, hConnection = NULL, hRequest = NULL; - URL_COMPONENTSA UrlParts = {sizeof(URL_COMPONENTSA), NULL, 1, (INTERNET_SCHEME)0, - hostname, sizeof(hostname), 0, NULL, 1, urlpath, sizeof(urlpath), NULL, 1}; + URL_COMPONENTSA UrlParts = { sizeof(URL_COMPONENTSA), NULL, 1, (INTERNET_SCHEME)0, + hostname, sizeof(hostname), 0, NULL, 1, urlpath, sizeof(urlpath), NULL, 1 }; uint64_t size = 0, total_size = 0; ErrorStatus = 0; @@ -224,20 +227,28 @@ uint64_t DownloadToFileOrBufferEx(const char* url, const char* file, const char* hRequest = HttpOpenRequestA(hConnection, "GET", UrlParts.lpszUrlPath, NULL, NULL, accept_types, INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS | INTERNET_FLAG_NO_COOKIES | INTERNET_FLAG_NO_UI | INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_HYPERLINK | - ((UrlParts.nScheme==INTERNET_SCHEME_HTTPS)?INTERNET_FLAG_SECURE:0), (DWORD_PTR)NULL); + ((UrlParts.nScheme == INTERNET_SCHEME_HTTPS) ? INTERNET_FLAG_SECURE : 0), (DWORD_PTR)NULL); if (hRequest == NULL) { uprintf("Could not open URL %s: %s", url, WindowsErrorString()); goto out; } - if (!HttpSendRequestA(hRequest, request_headers, -1L, NULL, 0)) { + // If we are querying the GitHub API, we need to enable raw content and + // set 'Accept-Encoding' to 'none' to get the data length. + use_github_api = (strstr(url, "api.github.com") != NULL); + if (use_github_api && !HttpAddRequestHeadersA(hRequest, "Accept: application/vnd.github.v3.raw", + (DWORD)-1, HTTP_ADDREQ_FLAG_ADD)) { + uprintf("Unable to enable raw content from GitHub API: %s", WindowsErrorString()); + goto out; + } + if (!HttpSendRequestA(hRequest, request_headers[use_github_api ? 0 : 1], -1L, NULL, 0)) { uprintf("Unable to send request: %s", WindowsErrorString()); goto out; } // Get the file size dwSize = sizeof(DownloadStatus); - HttpQueryInfoA(hRequest, HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER, (LPVOID)&DownloadStatus, &dwSize, NULL); + HttpQueryInfoA(hRequest, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, (LPVOID)&DownloadStatus, &dwSize, NULL); if (DownloadStatus != 200) { error_code = ERROR_INTERNET_ITEM_NOT_FOUND; SetLastError(RUFUS_ERROR(error_code)); @@ -272,7 +283,7 @@ uint64_t DownloadToFileOrBufferEx(const char* url, const char* file, const char* goto out; } // Allocate one extra byte, so that caller can rely on NUL-terminated text if needed - *buffer = calloc((size_t)total_size + 1, 1); + *buffer = calloc((size_t)total_size + 2, 1); if (*buffer == NULL) { uprintf("Could not allocate buffer for download"); goto out; @@ -437,8 +448,87 @@ static __inline uint64_t to_uint64_t(uint16_t x[3]) { return ret; } +BOOL UseLocalDbx(int arch) +{ + char reg_name[32]; + static_sprintf(reg_name, "DBXTimestamp_%s", efi_archname[arch]); + return (uint64_t)ReadSetting64(reg_name) > dbx_info[arch - 1].timestamp; +} + +static void CheckForDBXUpdates(int verbose) +{ + int i, r; + char reg_name[32], timestamp_url[256], path[MAX_PATH]; + char *p, *c, *rep, *buf = NULL; + struct tm t = { 0 }; + uint64_t size, timestamp; + BOOL already_prompted = FALSE; + + for (i = 0; i < ARRAYSIZE(dbx_info); i++) { + // Get the epoch of the last commit + timestamp = 0; + static_strcpy(timestamp_url, dbx_info[i].url); + p = strstr(timestamp_url, "contents/"); + if (p == NULL) + continue; + *p = 0; + rep = replace_char(&p[9], '/', "%2F"); + static_strcat(timestamp_url, "commits?path="); + static_strcat(timestamp_url, rep); + free(rep); + static_strcat(timestamp_url, "&page=1&per_page=1"); + vuprintf("Querying %s for DBX update timestamp", timestamp_url); + size = DownloadToFileOrBuffer(timestamp_url, NULL, (BYTE**)&buf, NULL, FALSE); + if (size == 0) + continue; + // Assumes that the GitHub JSON commit dates are of the form: + // "date":[ ]*"2025-02-24T20:20:22Z" + p = strstr(buf, "\"date\":"); + if (p == NULL) { + safe_free(buf); + continue; + } + c = &p[7]; + while (*c == ' ' || *c == '"') + c++; + p = c; + while (*c != '"' && *c != '\0') + c++; + *c = 0; + // "Thank you, X3J11 ANSI committee, for introducing the well thought through 'struct tm'", said ABSOLUTELY NOONE ever! + r = sscanf(p, "%d-%d-%dT%d:%d:%dZ", &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min, &t.tm_sec); + safe_free(buf); + if (r != 6) + continue; + t.tm_year -= 1900; + t.tm_mon -= 1; + timestamp = _mktime64(&t); + vuprintf("DBX update timestamp is %" PRId64, timestamp); + static_sprintf(reg_name, "DBXTimestamp_%s", efi_archname[i + 1]); + // Check if we have an external DBX that is newer than embedded/last downloaded + if (timestamp <= MAX(dbx_info[i].timestamp, (uint64_t)ReadSetting64(reg_name))) + continue; + if (!already_prompted) { + r = MessageBoxExU(hMainDialog, lmprintf(MSG_354), lmprintf(MSG_353), + MB_YESNO | MB_ICONWARNING | MB_IS_RTL, selected_langid); + already_prompted = TRUE; + if (r != IDYES) + break; + IGNORE_RETVAL(_chdirU(app_data_dir)); + IGNORE_RETVAL(_mkdir(FILES_DIR)); + IGNORE_RETVAL(_chdir(FILES_DIR)); + } + static_sprintf(path, "%s\\%s\\dbx_%s.bin", app_data_dir, FILES_DIR, efi_archname[i + 1]); + if (DownloadToFileOrBuffer(dbx_info[i].url, path, NULL, NULL, FALSE) != 0) { + WriteSetting64(reg_name, timestamp); + uprintf("Saved %s as 'dbx_%s.bin'", dbx_info[i].url, efi_archname[i + 1]); + } else + uprintf("Warning: Failed to download %s", dbx_info[i].url); + } +} + /* - * Background thread to check for updates + * Background thread to check for updates (including UEFI DBX updates) */ static DWORD WINAPI CheckForUpdatesThread(LPVOID param) { @@ -492,6 +582,10 @@ static DWORD WINAPI CheckForUpdatesThread(LPVOID param) } } + // Perform the DBX Update check + PrintInfoDebug(3000, MSG_352); + CheckForDBXUpdates(verbose); + PrintInfoDebug(3000, MSG_243); status++; // 1 @@ -549,13 +643,13 @@ static DWORD WINAPI CheckForUpdatesThread(LPVOID param) UrlParts.lpszUrlPath = urlpath; UrlParts.dwUrlPathLength = sizeof(urlpath); - for (i=0; i<ARRAYSIZE(verpos); i++) { + for (i = 0; i < ARRAYSIZE(verpos); i++) { vvuprintf("Trying %s", UrlParts.lpszUrlPath); hRequest = HttpOpenRequestA(hConnection, "GET", UrlParts.lpszUrlPath, NULL, NULL, accept_types, - INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP|INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS| - INTERNET_FLAG_NO_COOKIES|INTERNET_FLAG_NO_UI|INTERNET_FLAG_NO_CACHE_WRITE|INTERNET_FLAG_HYPERLINK| - ((UrlParts.nScheme == INTERNET_SCHEME_HTTPS)?INTERNET_FLAG_SECURE:0), (DWORD_PTR)NULL); - if ((hRequest == NULL) || (!HttpSendRequestA(hRequest, request_headers, -1L, NULL, 0))) { + INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS | + INTERNET_FLAG_NO_COOKIES | INTERNET_FLAG_NO_UI | INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_HYPERLINK | + ((UrlParts.nScheme == INTERNET_SCHEME_HTTPS) ? INTERNET_FLAG_SECURE : 0), (DWORD_PTR)NULL); + if ((hRequest == NULL) || (!HttpSendRequestA(hRequest, request_headers[1], -1L, NULL, 0))) { uprintf("Unable to send request: %s", WindowsErrorString()); goto out; } @@ -929,7 +1023,7 @@ BOOL IsDownloadable(const char* url) if (hRequest == NULL) goto out; - if (!HttpSendRequestA(hRequest, request_headers, -1L, NULL, 0)) + if (!HttpSendRequestA(hRequest, request_headers[1], -1L, NULL, 0)) goto out; // Get the file size diff --git a/src/resource.h b/src/resource.h index b8994a76..9be19993 100644 --- a/src/resource.h +++ b/src/resource.h @@ -71,13 +71,22 @@ #define IDR_UEFI_NTFS 502 #define IDR_SETUP_X64 503 #define IDR_SETUP_ARM64 504 -// The following should match the ArchType array values + 600 +// The following should match the ArchType array values +600/+700 #define IDR_MD5_BOOT 600 #define IDR_MD5_BOOTIA32 601 #define IDR_MD5_BOOTX64 602 #define IDR_MD5_BOOTARM 603 #define IDR_MD5_BOOTAA64 604 -#define IDR_MD5_BOOTRISCV64 607 +#define IDR_MD5_BOOTRISCV64 606 +#define IDR_MD5_BOOTLOONGARCH64 607 +#define IDR_DBX 700 +#define IDR_DBX_IA32 701 +#define IDR_DBX_X64 702 +#define IDR_DBX_ARM 703 +#define IDR_DBX_AA64 704 +#define IDR_DBX_IA64 705 +#define IDR_DBX_RISCV64 706 +#define IDR_DBX_LOONGARCH64 707 #define IDM_SELECT 901 #define IDM_DOWNLOAD 902 #define IDC_DEVICE 1001 @@ -605,7 +614,7 @@ #define MSG_MAX 3400 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 diff --git a/src/rufus.c b/src/rufus.c index 4883b3bb..b450b912 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1162,6 +1162,30 @@ static void UpdateImage(BOOL update_image_option_only) IGNORE_RETVAL(ComboBox_SetCurSel(hImageOption, imop_win_sel)); } +enum ArchType MachineToArch(WORD machine) +{ + switch (machine) { + case IMAGE_FILE_MACHINE_I386: + return ARCH_X86_32; + case IMAGE_FILE_MACHINE_AMD64: + return ARCH_X86_64; + case IMAGE_FILE_MACHINE_ARM: + return ARCH_ARM_32; + case IMAGE_FILE_MACHINE_ARM64: + return ARCH_ARM_64; + case IMAGE_FILE_MACHINE_IA64: + return ARCH_IA_64; + case IMAGE_FILE_MACHINE_RISCV64: + return ARCH_RISCV_64; + case IMAGE_FILE_MACHINE_LOONGARCH64: + return ARCH_LOONGARCH_64; + case IMAGE_FILE_MACHINE_EBC: + return ARCH_EBC; + default: + return ARCH_UNKNOWN; + } +} + /// <summary> /// Parse a PE executable file and return its CPU architecture. /// </summary> @@ -1203,36 +1227,14 @@ static uint8_t FindArch(const char* path) goto out; } - switch (pImageNTHeader->FileHeader.Machine) { - case IMAGE_FILE_MACHINE_I386: - ret = ARCH_X86_32; - break; - case IMAGE_FILE_MACHINE_AMD64: - ret = ARCH_X86_64; - break; - case IMAGE_FILE_MACHINE_ARM: - ret = ARCH_ARM_32; - break; - case IMAGE_FILE_MACHINE_ARM64: - ret = ARCH_ARM_64; - break; - case IMAGE_FILE_MACHINE_IA64: - ret = ARCH_IA_64; - break; - case IMAGE_FILE_MACHINE_RISCV64: - ret = ARCH_RISCV_64; - break; - case IMAGE_FILE_MACHINE_EBC: - ret = ARCH_EBC; - break; - } + ret = MachineToArch(pImageNTHeader->FileHeader.Machine); out: if (pImageDOSHeader != NULL) UnmapViewOfFile(pImageDOSHeader); safe_closehandle(hFileMapping); safe_closehandle(hFile); - assert(ret < ARCH_MAX); + assert(ret != 0 && ret < ARCH_MAX); return ret; } @@ -2101,7 +2103,6 @@ static void InitDialog(HWND hDlg) "one. Because of this, some messages will only be displayed in English.", selected_locale->txt[1]); uprintf("If you think you can help update this translation, please e-mail the author of this application"); } - PrintRevokedBootloaderInfo(); // Detect and report system limitations if (ReadRegistryKeyBool(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Policies\\Microsoft\\FVE")) uprintf("WARNING: This system has a policy set to prevent write access to FIXED drives not using BitLocker"); diff --git a/src/rufus.h b/src/rufus.h index ddd6b4d2..c76a9de4 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -385,7 +385,14 @@ typedef struct { uint16_t revision; } winver_t; -/* We can't use the Microsoft enums as we want to have RISC-V and LoongArch */ +/* + * We can't use the Microsoft enums as we want to have RISC-V and LoongArch + * and we also translate these to IDR_BASE + Value for resource items, which, + * if we were to use the Microsoft IMAGE_FILE_MACHINE constants, would force + * us to leave a 65536 sized gap between bases in order to properly map + * 0x8664 (x86_64), 0xaa64 (ARM64) and so on... + * NB: When editing this, make sure to also update the values in resource.h! + */ enum ArchType { ARCH_UNKNOWN = 0, ARCH_X86_32, @@ -849,7 +856,6 @@ extern BOOL HashBuffer(const unsigned type, const uint8_t* buf, const size_t len extern BOOL IsFileInDB(const char* path); extern BOOL IsSignedBySecureBootAuthority(uint8_t* buf, uint32_t len); extern int IsBootloaderRevoked(uint8_t* buf, uint32_t len); -extern void PrintRevokedBootloaderInfo(void); extern BOOL IsBufferInDB(const unsigned char* buf, const size_t len); #define printbits(x) _printbits(sizeof(x), &x, 0) #define printbitslz(x) _printbits(sizeof(x), &x, 1) @@ -879,6 +885,7 @@ extern uint8_t* RvaToPhysical(uint8_t* buf, uint32_t rva); extern uint32_t FindResourceRva(const wchar_t* name, uint8_t* root, uint8_t* dir, uint32_t* len); extern DWORD ListDirectoryContent(StrArray* arr, char* dir, uint8_t type); extern BOOL TakeOwnership(LPCSTR lpszOwnFile); +extern enum ArchType MachineToArch(WORD machine); #define GetTextWidth(hDlg, id) GetTextSize(GetDlgItem(hDlg, id), NULL).cx DWORD WINAPI HashThread(void* param); diff --git a/src/rufus.rc b/src/rufus.rc index 122f3f8c..47ad27be 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.7.2227" +CAPTION "Rufus 4.7.2228" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -312,6 +312,14 @@ BEGIN "IDR_MD5_BOOTARM RCDATA ""../res/md5/bootarm.efi""\r\n" "IDR_MD5_BOOTAA64 RCDATA ""../res/md5/bootaa64.efi""\r\n" "IDR_MD5_BOOTRISCV64 RCDATA ""../res/md5/bootriscv64.efi""\r\n" + "IDR_MD5_BOOTLOONGARCH64 RCDATA ""../res/md5/bootloongarch64.efi""\r\n" + "IDR_DBX_IA32 RCDATA ""../res/dbx/x86_DBXUpdate.bin""\r\n" + "IDR_DBX_X64 RCDATA ""../res/dbx/amd64_DBXUpdate.bin""\r\n" + "IDR_DBX_ARM RCDATA ""../res/dbx/arm_DBXUpdate.bin""\r\n" + "IDR_DBX_AA64 RCDATA ""../res/dbx/arm64_DBXUpdate.bin""\r\n" + "IDR_DBX_IA64 RCDATA ""../res/dbx/ia64_DBXUpdate.bin""\r\n" + "IDR_DBX_RISCV64 RCDATA ""../res/dbx/riscv64_DBXUpdate.bin""\r\n" + "IDR_DBX_LOONGARCH64 RCDATA ""../res/dbx/loongarch64_DBXUpdate.bin""\r\n" "IDI_LANG_16 RCDATA ""../res/icons/lang-16.png""\r\n" "IDI_INFO_16 RCDATA ""../res/icons/info-16.png""\r\n" "IDI_SETTINGS_16 RCDATA ""../res/icons/settings-16.png""\r\n" @@ -399,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2227,0 - PRODUCTVERSION 4,7,2227,0 + FILEVERSION 4,7,2228,0 + PRODUCTVERSION 4,7,2228,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -418,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2227" + VALUE "FileVersion", "4.7.2228" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2227" + VALUE "ProductVersion", "4.7.2228" END END BLOCK "VarFileInfo" @@ -499,6 +507,14 @@ IDR_MD5_BOOTX64 RCDATA "../res/md5/bootx64.efi" IDR_MD5_BOOTARM RCDATA "../res/md5/bootarm.efi" IDR_MD5_BOOTAA64 RCDATA "../res/md5/bootaa64.efi" IDR_MD5_BOOTRISCV64 RCDATA "../res/md5/bootriscv64.efi" +IDR_MD5_BOOTLOONGARCH64 RCDATA "../res/md5/bootloongarch64.efi" +IDR_DBX_IA32 RCDATA "../res/dbx/x86_DBXUpdate.bin" +IDR_DBX_X64 RCDATA "../res/dbx/amd64_DBXUpdate.bin" +IDR_DBX_ARM RCDATA "../res/dbx/arm_DBXUpdate.bin" +IDR_DBX_AA64 RCDATA "../res/dbx/arm64_DBXUpdate.bin" +IDR_DBX_IA64 RCDATA "../res/dbx/ia64_DBXUpdate.bin" +IDR_DBX_RISCV64 RCDATA "../res/dbx/riscv64_DBXUpdate.bin" +IDR_DBX_LOONGARCH64 RCDATA "../res/dbx/loongarch64_DBXUpdate.bin" IDI_LANG_16 RCDATA "../res/icons/lang-16.png" IDI_INFO_16 RCDATA "../res/icons/info-16.png" IDI_SETTINGS_16 RCDATA "../res/icons/settings-16.png" From 871bc9a25f1eb4bc852d57a6e1a3cf857e9d7353 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 31 Mar 2025 20:39:19 +0100 Subject: [PATCH 038/192] [core] fix ReFS no longer being available unless VDS is enabled --- src/rufus.c | 5 +++++ src/rufus.rc | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/rufus.c b/src/rufus.c index b450b912..4aafec0f 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -405,11 +405,15 @@ static BOOL IsRefsAvailable(MEDIA_TYPE MediaType) // Microsoft in Windows 10 1709, except for the Enterprise and Pro Workstation // versions. Oh and VdsService::QueryFileSystemTypes() is *USELESS* to detect // if ReFS is available on the system. Oh, and it only applies to fixed media. + // Oh and Microsoft removed the ability to format a volume to ReFS unless you + // use VDS... Why do I even bother with this? if (MediaType != FixedMedia) return FALSE; if (WindowsVersion.Version < WINDOWS_8_1 || WindowsVersion.BuildNumber <= 0) return FALSE; + if (!use_vds) + return FALSE; // Per https://gist.github.com/0xbadfca11/da0598e47dd643d933dc if (WindowsVersion.BuildNumber < 16226) return TRUE; @@ -4051,6 +4055,7 @@ extern int TestHashes(void); if ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'V')) { if (is_vds_available) { use_vds = !use_vds; + SetFileSystemAndClusterSize(NULL); WriteSettingBool(SETTING_USE_VDS, use_vds); PrintStatusTimeout("VDS", use_vds); } diff --git a/src/rufus.rc b/src/rufus.rc index 47ad27be..1f1ae63f 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.7.2228" +CAPTION "Rufus 4.7.2229" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2228,0 - PRODUCTVERSION 4,7,2228,0 + FILEVERSION 4,7,2229,0 + PRODUCTVERSION 4,7,2229,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2228" + VALUE "FileVersion", "4.7.2229" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2228" + VALUE "ProductVersion", "4.7.2229" END END BLOCK "VarFileInfo" From 7ff68dc7af95d88cb0133c4894e99ff43931144e Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 2 Apr 2025 12:16:33 +0100 Subject: [PATCH 039/192] [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. --- ChangeLog.txt | 13 ++++++++ res/appstore/get_pe_info.c | 62 ++++++++++++++++++++++++++++++++++++++ res/appstore/packme.cmd | 14 ++++----- res/loc/po/fr-FR.po | 38 ++++++++++++++++++++--- res/loc/rufus.loc | 7 ++++- src/rufus.rc | 10 +++--- 6 files changed, 127 insertions(+), 17 deletions(-) create mode 100644 res/appstore/get_pe_info.c diff --git a/ChangeLog.txt b/ChangeLog.txt index b19101d0..38497dc7 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,16 @@ +o Version 4.7 (2025.04.??) + Add a mechanism to detect and download updated DBXs from the official UEFI repository + Add ztsd compression support for disk images + Add a new exclusion feature in the settings, to ignore disks with a specific GPT GUID + Improve detection for compressed VHD images that are too large to fit the target drive + Fix commandline hogger not being deleted when running Rufus from a different directory + Fix FAT filenames from embedded images being potentially truncated on image extraction + Fix a side-loading vulnerability [CVE-2025-26624] with cfgmgr32.dll (with thanks to @EmperialX) + Fix UI memory leaks (courtesy of @ozone10) + Fall back to user/system default locale when getting error description (courtesy of @Rairii) + Don't run the commandline hogger on POSIX shells + Drop ARM 32-bit support (Note that ARM 64-bit support is *NOT* affected by this) + o Version 4.6 (2024.10.21) Add a new setup.exe wrapper to bypass Windows 11 24H2 in-place upgrade restrictions Add TimeZone to regional options replication diff --git a/res/appstore/get_pe_info.c b/res/appstore/get_pe_info.c new file mode 100644 index 00000000..d803662d --- /dev/null +++ b/res/appstore/get_pe_info.c @@ -0,0 +1,62 @@ +// Compile with: gcc -lversion -o get_pe_info get_pe_info.c + +#include <windows.h> +#include <stdio.h> +#include <stdlib.h> + +int main(int argc, char *argv[]) { + VS_FIXEDFILEINFO *file_info; + DWORD handle, size; + WORD lang, codepage; + UINT len; + void *buffer = NULL, *translation, *version_info; + char sub_block[50]; + int ret = 1; + + if (argc != 3 || argv[1][0] != '-') { + printf("Usage: %s [-i|-v] <path_to_executable>\n", argv[0]); + goto out; + } + + size = GetFileVersionInfoSizeA(argv[2], &handle); + if (size == 0) { + fprintf(stderr, "Failed to get version info size.\n"); + goto out; + } + + buffer = malloc(size); + if (buffer == NULL) + goto out; + + if (!GetFileVersionInfoA(argv[2], handle, size, buffer)) { + fprintf(stderr, "Failed to get version info.\n"); + goto out; + } + + if (argv[1][1] == 'i') { + if (!VerQueryValueA(buffer, "\\VarFileInfo\\Translation", &translation, &len) || len < 4) { + fprintf(stderr, "Failed to retrieve language and codepage information.\n"); + goto out; + } + lang = *(WORD*)translation; + codepage = *((WORD*)translation + 1); + snprintf(sub_block, sizeof(sub_block), "\\StringFileInfo\\%04x%04x\\InternalName", lang, codepage); + if (!VerQueryValueA(buffer, sub_block, &version_info, &len)) { + fprintf(stderr, "Failed to retrieve Internal Name.\n"); + goto out; + } + printf("%s\n", (char*)version_info); + } else { + if (!VerQueryValueA(buffer, "\\", (LPVOID*)&file_info, &len) || len < sizeof(VS_FIXEDFILEINFO)) { + fprintf(stderr, "Failed to retrieve file info.\n"); + goto out; + } + printf("%d.%d.%d.%d\n", HIWORD(file_info->dwFileVersionMS), LOWORD(file_info->dwFileVersionMS), + HIWORD(file_info->dwFileVersionLS), LOWORD(file_info->dwFileVersionLS)); + } + ret = 0; + +out: + free(buffer); + return ret; +} diff --git a/res/appstore/packme.cmd b/res/appstore/packme.cmd index bf7a62ee..cbecd90c 100644 --- a/res/appstore/packme.cmd +++ b/res/appstore/packme.cmd @@ -29,7 +29,7 @@ set WDK_PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64 set ZIP_PATH=C:\Program Files\7-Zip set SIGNATURE_SHA1=fc4686753937a93fdcd48c2bb4375e239af92dcb set MANIFEST=AppxManifest.xml -set ARCHS=x86 x64 arm arm64 +set ARCHS=x86 x64 arm64 set DEFAULT_SCALE=200 set OTHER_SCALES=100 125 150 400 set SCALED_IMAGES=LargeTile SmallTile Square44x44Logo Square150x150Logo StoreLogo Wide310x150Logo @@ -69,25 +69,25 @@ for %%a in (%ARCHS%) do ( ) ) -rem exiftool.exe can't be installed in the Windows system directories... -if not exist exiftool.exe ( - echo exiftool.exe must exist in this directory +rem Use our own get_pe_info executable - source is in this directory +if not exist get_pe_info.exe ( + echo get_pe_info.exe must exist in this directory. Compile it with MinGW. goto out ) rem Make sure we're not trying to create a package from an ALPHA or BETA version! -exiftool -s3 -*InternalName* rufus_x64.exe | findstr /C:"ALPHA" 1>nul && ( +get_pe_info.exe -i rufus_x64.exe | findstr /C:"ALPHA" 1>nul && ( echo Alpha version detected - ABORTED goto out ) -exiftool -s3 -*InternalName* rufus_x64.exe | findstr /C:"BETA" 1>nul && ( +get_pe_info.exe -i rufus_x64.exe | findstr /C:"BETA" 1>nul && ( echo Beta version detected - ABORTED goto out ) rem Populate the version from the executable if "%VERSION_OVERRIDE%"=="" ( - exiftool -s3 -*FileVersionNumber* rufus_x64.exe > version.txt + get_pe_info.exe -v rufus_x64.exe > version.txt set /p VERSION=<version.txt del version.txt ) else ( diff --git a/res/loc/po/fr-FR.po b/res/loc/po/fr-FR.po index 46930717..bb06d746 100644 --- a/res/loc/po/fr-FR.po +++ b/res/loc/po/fr-FR.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: 4.5\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-04-25 12:25+0100\n" -"PO-Revision-Date: 2024-12-17 14:54+0100\n" +"POT-Creation-Date: 2025-04-02 11:34+0100\n" +"PO-Revision-Date: 2025-04-02 11:51+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr_FR\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: French (Français)\n" "X-Rufus-LCID: 0x040c, 0x080c, 0x0c0c, 0x100c, 0x140c, 0x180c, 0x1c0c, 0x200c, 0x240c, 0x280c, 0x2c0c, 0x300c, 0x340c, 0x380c, 0xe40c\n" -"X-Generator: Poedit 3.5\n" +"X-Generator: Poedit 3.6\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -1080,7 +1080,7 @@ msgid "Version %d.%d (Build %d)" msgstr "" #. • MSG_176 -msgid "mailto:support@akeo.ie" +msgid "English translation: Pete Batard <mailto:pete@akeo.ie>" msgstr "Traduction Française : Pete Batard <mailto:pete@akeo.ie>" #. • MSG_177 @@ -1914,6 +1914,36 @@ msgstr "Extraction d'archive : %s" msgid "Use Rufus MBR" msgstr "Utilisation du MBR Rufus" +#. • MSG_350 +msgid "Use 'Windows UEFI CA 2023' signed bootloaders [EXPERIMENTAL]" +msgstr "Utiliser les bootloaders signés par 'Windows UEFI CA 2023' [EXPÉRIMENTAL]" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Vérification de la revocation des bootloaders UEFI..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Vérification des mises à jour de DBX UEFI..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "Mise à jour DBX disponible" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus a trouvé une mise à jour des fichiers DBX utilisés pour effectuer la validation des revocations Secure Boot sous UEFI. Voulez-vous télécharger cette mise à jour ?\n" +"- Sélectionnez 'Oui' pour vous connecter à Internet et le télécharger ce contenu\n" +"- Sélectionnez 'Non' pour annuler l’opération\n" +"\n" +"Note : Ces fichiers seront téléchargés dans le répertoire de l'application et réutilisés automatiquement si ils sont présent." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 8eb0ceb2..cce57c26 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -614,7 +614,7 @@ t MSG_351 "Checking for UEFI bootloader revocation..." t MSG_352 "Checking for UEFI DBX updates..." t MSG_353 "DBX update available" t MSG_354 "Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" - "- Select 'Yes' to connect to the Internet and download the DBX content\n" + "- Select 'Yes' to connect to the Internet and download this content\n" "- Select 'No' to cancel the operation\n\n" "Note: The files will be downloaded in the application's directory and will be reused automatically if present." # The following messages are for the Windows Store listing only and are not used by the application @@ -4815,6 +4815,11 @@ t MSG_346 "Restreint Windows au mode \"S\" (INCOMPATIBLE avec l'option de désac t MSG_347 "Mode expert" t MSG_348 "Extraction d'archive : %s" t MSG_349 "Utilisation du MBR Rufus" +t MSG_350 "Utiliser les bootloaders signés par 'Windows UEFI CA 2023' [EXPÉRIMENTAL]" +t MSG_351 "Vérification de la revocation des bootloaders UEFI..." +t MSG_352 "Vérification des mises à jour de DBX UEFI..." +t MSG_353 "Mise à jour DBX disponible" +t MSG_354 "Rufus a trouvé une mise à jour des fichiers DBX utilisés pour effectuer la validation des revocations Secure Boot sous UEFI. Voulez-vous télécharger cette mise à jour ?\n- Sélectionnez 'Oui' pour vous connecter à Internet et le télécharger ce contenu\n- Sélectionnez 'Non' pour annuler l’opération\n\nNote : Ces fichiers seront téléchargés dans le répertoire de l'application et réutilisés automatiquement si ils sont présent." t MSG_900 "Rufus est un utilitaire permettant de formater et de créer des média USB amorçables, tels que clés USB, mémoire flash, etc." t MSG_901 "Site officiel : %s" t MSG_902 "Code source: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 1f1ae63f..b88c0dbc 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.7.2229" +CAPTION "Rufus 4.7.2230" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2229,0 - PRODUCTVERSION 4,7,2229,0 + FILEVERSION 4,7,2230,0 + PRODUCTVERSION 4,7,2230,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2229" + VALUE "FileVersion", "4.7.2230" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2229" + VALUE "ProductVersion", "4.7.2230" END END BLOCK "VarFileInfo" From 88f023e79623c081944d5f4ea76a9f64414650c3 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 9 Apr 2025 11:06:56 +0100 Subject: [PATCH 040/192] Rufus 4.7 (Build 2231) * Update FreeDOS to v1.4 * Update Grub4DOS to latest --- ChangeLog.txt | 7 ++++--- res/appstore/listing/listing.csv | 24 ++++++++++++++---------- res/freedos/COMMAND.COM | Bin 85480 -> 87772 bytes res/freedos/KEYB.EXE | Bin 11446 -> 11819 bytes res/freedos/KEYBOARD.SYS | Bin 40360 -> 40362 bytes res/freedos/readme.txt | 4 ++-- res/grub/grldr.mbr | Bin 8192 -> 8192 bytes res/grub/readme.txt | 2 +- src/ms-sys/inc/mbr_grub.h | 14 +++++++------- src/rufus.rc | 10 +++++----- 10 files changed, 33 insertions(+), 28 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 38497dc7..9cad6c6e 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,4 +1,4 @@ -o Version 4.7 (2025.04.??) +o Version 4.7 (2025.04.09) Add a mechanism to detect and download updated DBXs from the official UEFI repository Add ztsd compression support for disk images Add a new exclusion feature in the settings, to ignore disks with a specific GPT GUID @@ -7,9 +7,10 @@ o Version 4.7 (2025.04.??) Fix FAT filenames from embedded images being potentially truncated on image extraction Fix a side-loading vulnerability [CVE-2025-26624] with cfgmgr32.dll (with thanks to @EmperialX) Fix UI memory leaks (courtesy of @ozone10) - Fall back to user/system default locale when getting error description (courtesy of @Rairii) + Fall back to user/system default locale when getting error description (courtesy of @Wack0) Don't run the commandline hogger on POSIX shells - Drop ARM 32-bit support (Note that ARM 64-bit support is *NOT* affected by this) + Drop ARM 32-bit builds (Note that ARM 64-bit builds are *NOT* affected by this) + Update FreeDOS and Grub4DOS to latest o Version 4.6 (2024.10.21) Add a new setup.exe wrapper to bypass Windows 11 24H2 in-place upgrade restrictions diff --git a/res/appstore/listing/listing.csv b/res/appstore/listing/listing.csv index 4a5bf2da..69d76122 100644 --- a/res/appstore/listing/listing.csv +++ b/res/appstore/listing/listing.csv @@ -1,4 +1,4 @@ -"Field","ID","Type (Type)","default","en-us","ar-sa","bg-bg","zh-cn","zh-tw","hr-hr","cs-cz","da-dk","nl-nl","fi-fi","fr-fr","de-de","el-gr","he-il","hu-hu","id-id","it-it","ja-jp","ko-kr","lv-lv","lt-lt","ms-my","nb-no","fa-ir","pl-pl","pt-br","pt-pt","ro-ro","ru-ru","sr-latn-rs","sk-sk","sl-si","es-es","sv-se","th-th","tr-tr","uk-ua","vi-vn" +"Field","ID","Type (Type)","default","en-us","ar-sa","bg-bg","zh-cn","zh-tw","hr-hr","cs-cz","da-dk","nl-nl","fi-fi","fr-fr","de-de","el-gr","he-il","hu-hu","id-id","it-it","ja-jp","ko-kr","lv-lv","lt-lt","ms-my","nb-no","fa-ir","pl-pl","pt-br","pt-pt","ro-ro","ru-ru","sr-latn-rs","sk-sk","sl-si","es-es","sv-se","th-th","tr-tr","uk-ua","vi-vn" "Description","2","Text","","Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc. • Official site: https://rufus.ie • Source Code: https://github.com/pbatard/rufus @@ -114,21 +114,25 @@ • 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","• Add a new setup.exe wrapper to bypass Windows 11 24H2 in-place upgrade restrictions -• Add TimeZone to regional options replication -• Set local account passwords to not expire by default -• Fix an error when trying to write compressed VHD images -• Fix an error when invoking Rufus from the PowerShell commandline -• Improve revoked UEFI bootloaders check to support Linux SBAT, Windows SVN and cert DBX -• Improve support for ReactOS boot media - ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"ReleaseNotes","3","Text","• Add a mechanism to detect and download updated DBXs from the official UEFI repository +• Add ztsd compression support for disk images +• Add a new exclusion feature in the settings, to ignore disks with a specific GPT GUID +• Improve detection for compressed VHD images that are too large to fit the target drive +• Fix commandline hogger not being deleted when running Rufus from a different directory +• Fix FAT filenames from embedded images being potentially truncated on image extraction +• Fix a side-loading vulnerability [CVE-2025-26624] with cfgmgr32.dll (with thanks to @EmperialX) +• Fix UI memory leaks (courtesy of @ozone10) +• Fall back to user/system default locale when getting error description (courtesy of @Wack0) +• Don't run the commandline hogger on POSIX shells +• Drop ARM 32-bit builds (Note that ARM 64-bit builds are *NOT* affected by this) +• Update FreeDOS and Grub4DOS to latest",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "Title","4","Text","Rufus",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "ShortTitle","5","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "SortTitle","6","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "VoiceTitle","7","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "ShortDescription","8","Text","","Rufus - The Reliable USB Formatting Utility","Rufus - أداة فرمتة الـ USB جديرة بالثقة","Rufus - Надеждната USB форматираща програма","Rufus - 可靠的 USB 格式化工具","Rufus - 快速可靠的 USB 格式化工具","Rufus - Pouzdan alat za formatiranje USB-a","Rufus - Spolehlivý program pro formátování USB","Rufus - Det pålidelige USB-formateringsværktøj","Rufus - de betrouwbare USB-formatteertool","Rufus - Luotettava USB-alustusohjelma","Rufus - L'utilitaire de formatage USB fiable","Rufus - Das zuverlässige USB-Formatierungstool","Rufus - Μία αξιόπιστη εφαρμογή διαμόρφωσης USB","Rufus - הכלי לאתחול USB האמין ביותר","Rufus - A megbízható USB-formázó segédprogram","Rufus - Utilitas Pemformatan USB yang Handal","Rufus - Utility affidabile per la formattazione di unità USB","Rufus - 信頼性の高い USB フォーマット ユーティリティ","Rufus - 신뢰할 수 있는 USB 포맷 유틸리티","Rufus - uzticama un vienkārša USB formatēšanas utilīta","Rufus - patikima USB formatavimo priemonė","Rufus - Utiliti pemformatan USB yang dipercayai","Rufus - Det pålitelige USB-formateringsprogrammet","Rufus، ابزاری کاربردی و قابل‌اطمینان برای فرمت کردن درایوهای USB","Rufus - niezawodne narzędzie do formatowania USB","Rufus - O Utilitário de Formatação USB Confiável","Rufus - O utilitário de confiança para formatação USB","Rufus - Instrumentul de încredere pentru formatări USB","Rufus - Надёжная утилита для форматирования USB-дисков","Rufus - Pouzdan Alat Za Formatiranje USB diska","Rufus - Spoľahlivý program pre formátovanie USB","Rufus - zanesljivi pripomoček za USB formatiranje","Rufus, la herramienta de formateo de USBs en la que puedes confiar","Rufus - Det pålitliga verktyget för USB-formatering","Rufus - ยูทิลิตี้การฟอร์แมต USB ที่ไว้ใจได้","Rufus - Güvenilir USB Biçimlendirme Programı","Rufus - надійна утиліта для форматування USB-накопичувачів","Rufus - Tiện ích Định dạng USB Đáng tin cậy" "DevStudio","9","Text","Pete Batard",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -"CopyrightTrademarkInformation","12","Text","© 2011-2024 Pete Batard",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"CopyrightTrademarkInformation","12","Text","© 2011-2025 Pete Batard",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "AdditionalLicenseTerms","13","Text","https://www.gnu.org/licenses/gpl-3.0.html","This application is licensed under the terms of the GNU Public License (GPL) version 3. See https://www.gnu.org/licenses/gpl-3.0.en.html for details.","هذا التطبيق مُرخص بموجب شروط رخصة جنو (GNU) العمومية (GPL) الإصدار 3. راجع https://www.gnu.org/licenses/gpl-3.0.ar.html لمزيد من التفاصيل.","Тази програма е лицензирана според условията на GNU Public License (GPL) версия 3. diff --git a/res/freedos/COMMAND.COM b/res/freedos/COMMAND.COM index f56ace7e862ce6669af4faa0854c09cefb3897fe..255525acc562e0411e3e5f000bc1ba788733056d 100644 GIT binary patch delta 33633 zcmZ^L30zZ0*Y~|QWML1AD1z)Diz2uqiwGL53r0}fakti5*92>;1dUoQF?N~O?yZ!z z`m}wz+CDL~ieLfvwU%nDKGy2QOD$E3h?so;xk20ad%ut0?~=K5XU@!=IdkT0GxSa6 z&;M2iO`Q22|1_7%`E#!cE|<ce({kMT@)v`WO@q2|+$22n@oc~|F_`1N#B;MZ$GPw{ zg>c-aP>$P)=Sw^X@HFAMhNlHjTo}ix!a42`p38WC$1@;;<8tuyN#Qs<o)dU}#`DKq zj>}uaaVw30iRXDE7tXzc#OxAe;@OBNK;*c$@ocW(xW$$)u4*-*9$GO@rQPejztun4 z6&9=Bq3ZOnh>PMZVYmH>pJ%*Zr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diff --git a/res/freedos/readme.txt b/res/freedos/readme.txt index 4064bc18..3be4baa8 100644 --- a/res/freedos/readme.txt +++ b/res/freedos/readme.txt @@ -1,5 +1,5 @@ -All of the executables found in this repository where extracted from: -https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.3/official/FD13-FullUSB.zip +All of the executables found in this repository where extracted from FreeDOS v1.4: +https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.4/FD14-FullUSB.zip o COMMAND.COM was extracted from packages\base\freecom.zip o DISPLAY.EXE was extracted from packages\base\display.zip diff --git a/res/grub/grldr.mbr b/res/grub/grldr.mbr index d168da09398e641845e690c4f9dff318acd8f01a..5746f03b906bd0ae71aa668de4a0af7c340d3f39 100644 GIT binary patch delta 876 zcmYjPZA?>V6n@XO++r#BEv2Pjm-afVu}kPGnF~(iC_xO_M;NwBfK(jI%|3oCDd4h+ z<ML4_;1B3AS@uI?9E61Z7>WsTxOdDNP!ow+mVJaj6K3|7n@BTaN#@6PbxXGM<K)RX z&vSCVv}&z-<RVOrUW)jGw!An78XY+9>7TduK6wI3{lkj9H~~OY6=^7UUzPd0B)i%5 zZ;ZG!$w+4JPVa(y7C4DM>)U{+S?djd%bE~JG<_30kKy8t(z1M=AaoU}Uz-Ra>c+Az zsaPq6V0pS#dL9h^r}QA~$0Zsn+5MRI$&WMr^E-O?TGnaGhE7{mv0gOtpJ9V74LMw~ zwe%b}hx1}H(Yk_RZC?u^op$!Umv76ln=%jN*piofa(v31tl*bLeaHVf@Qm|tjoE$t z!5Tkp?${jGwl|X=J|s$kcSx~$LF_KktHPRO)K`zHZI`37lX2d;mbCRgj8Ar1^4|e| zQ&IzSX}in%m6%8tYSI`K@<!Zh4-0oqc+eh#COl!Uk=~T~%zg7e3r-E-ZTkhG^CRpi z-S<WZ490@_TERwB?V$E{Z`$8f7wxhd$Q)A?g$|r027ak78rw-z4AlN^h0uXtNcII# zhierzHAhnuFkCA=1?SM^h?w4!c|E@B*b7-a<#-*E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yMW00XfwgkkzYH{Qy#}Vi6{=!VxKbMPf}Dbu_{%o^U(~Nxb3cw7o6q&Dt4B->K~7 zIDJZsW398+KO*h-^G|Ebrn!Aq(MZk_L99*)GZvDc)SY<T>8C!B^HbG*3p^ounBB(n z&Kmc75*ydEDYEe}rmcUApM!Q$VsGMa&SRyYNz8$VDi4RwuV`!D*S`%8erGmCBClN^ zX$`QmD=qbR2ljMaf?0ARQeaQ5^k{eReq{)@;6tu<n8RbPo3Mnt-J61&C1%SS*;sj2 zyX6Tl@XwIIW8rzemr(Wx(<Z#^F2hsqpy#lceaYBMB%>K4bF4Tr!?aq7rSS{*yXD<p zxt&oacWeE4q^bw{@kUij+VX2=zec!`dozUom7nU%_<1?@M&?fnm5VswX#ypk_H5^1 z41bZL-1;(xd{Ou8GR5l+d>Nr<uLc&!E#yFKmT+tmPx|WMMf}wF7JQHG{tn~CC;SH? RjePZT**Q{5_H=Yj{{t9NT+RRh diff --git a/res/grub/readme.txt b/res/grub/readme.txt index 35183463..c9790ee7 100644 --- a/res/grub/readme.txt +++ b/res/grub/readme.txt @@ -1,6 +1,6 @@ This directory contains the Grub4DOS boot records that are used by Rufus -* grldr.mbr was taken from the official 2023-03-06 release from +* grldr.mbr was taken from the official 2024-02-26 release from https://github.com/chenall/grub4dos/releases/tag/0.4.6a * Note that, for convenience reasons, the first 512 bytes from this grldr.mbr are diff --git a/src/ms-sys/inc/mbr_grub.h b/src/ms-sys/inc/mbr_grub.h index f3b42b11..cfdb28ab 100644 --- a/src/ms-sys/inc/mbr_grub.h +++ b/src/ms-sys/inc/mbr_grub.h @@ -16,18 +16,18 @@ unsigned char mbr_grub_0x0[] = { 0x00, 0x74, 0x02, 0xB2, 0x80, 0x16, 0x07, 0xB0, 0x10, 0x30, 0xF6, 0x31, 0xDB, 0xE8, 0xC2, 0x00, 0x72, 0x29, 0x0E, 0x1F, 0x31, 0xF6, 0x31, 0xFF, 0xB9, 0xDF, 0x00, 0xFC, 0xF3, 0xA5, 0xBB, 0xFC, 0x1F, 0x66, 0xB8, 0x47, - 0x52, 0x55, 0xAA, 0x66, 0x39, 0x07, 0x75, 0x03, 0xE8, 0xB6, 0x19, 0xEA, + 0x52, 0x55, 0xAA, 0x66, 0x39, 0x07, 0x75, 0x03, 0xE8, 0xA7, 0x19, 0xEA, 0xB8, 0x00, 0x00, 0x20, 0x16, 0x1F, 0x66, 0x39, 0x07, 0x74, 0x1F, 0x80, 0xF2, 0x80, 0x68, 0xC0, 0x07, 0x07, 0xB0, 0x10, 0x30, 0xF6, 0x31, 0xDB, 0xE8, 0x87, 0x00, 0x72, 0x05, 0xEA, 0x00, 0x00, 0xC0, 0x07, 0xBE, 0x92, - 0x01, 0xE8, 0xAF, 0x00, 0xEB, 0xFE, 0xBE, 0xBE, 0x01, 0xE8, 0x14, 0x10, - 0xF6, 0x06, 0xA4, 0x01, 0x80, 0x0F, 0x84, 0x8A, 0x19, 0x83, 0xC6, 0x0C, + 0x01, 0xE8, 0xAF, 0x00, 0xEB, 0xFE, 0xBE, 0xBE, 0x01, 0xE8, 0x24, 0x10, + 0xF6, 0x06, 0xA4, 0x01, 0x80, 0x0F, 0x84, 0x7B, 0x19, 0x83, 0xC6, 0x0C, 0x81, 0xFE, 0xFE, 0x01, 0x72, 0xEB, 0x77, 0x2D, 0xF6, 0x06, 0xA7, 0x01, - 0x01, 0x0F, 0x85, 0x3C, 0x17, 0x80, 0x0E, 0xA7, 0x01, 0x01, 0xF6, 0x06, + 0x01, 0x0F, 0x85, 0x2D, 0x17, 0x80, 0x0E, 0xA7, 0x01, 0x01, 0xF6, 0x06, 0xA7, 0x01, 0x02, 0x75, 0xD4, 0x68, 0x00, 0x0D, 0x07, 0xB0, 0x04, 0x31, - 0xD2, 0x31, 0xDB, 0xE8, 0x3C, 0x00, 0x73, 0xC2, 0xBE, 0xCB, 0x1C, 0xE8, - 0x69, 0x00, 0xE9, 0x18, 0x17, 0xF6, 0x06, 0xA7, 0x01, 0x01, 0x0F, 0x85, - 0x0F, 0x17, 0x80, 0x0E, 0xA7, 0x01, 0x01, 0xE9, 0xF0, 0x16, 0x1E, 0x06, + 0xD2, 0x31, 0xDB, 0xE8, 0x3C, 0x00, 0x73, 0xC2, 0xBE, 0xBC, 0x1C, 0xE8, + 0x69, 0x00, 0xE9, 0x09, 0x17, 0xF6, 0x06, 0xA7, 0x01, 0x01, 0x0F, 0x85, + 0x00, 0x17, 0x80, 0x0E, 0xA7, 0x01, 0x01, 0xE9, 0xE1, 0x16, 0x1E, 0x06, 0x52, 0x56, 0x57, 0x55, 0xF9, 0xCD, 0x13, 0x5D, 0x5F, 0x5E, 0x5A, 0x07, 0x1F, 0xC3, 0xFA, 0xB8, 0x00, 0x20, 0x8E, 0xD0, 0xBC, 0xDC, 0x8F, 0xFB, 0x66, 0x61, 0x07, 0x1F, 0xEB, 0x97, 0xB4, 0x02, 0xBF, 0x03, 0x00, 0xB9, diff --git a/src/rufus.rc b/src/rufus.rc index b88c0dbc..c559ee9f 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.7.2230" +CAPTION "Rufus 4.7.2231" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2230,0 - PRODUCTVERSION 4,7,2230,0 + FILEVERSION 4,7,2231,0 + PRODUCTVERSION 4,7,2231,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2230" + VALUE "FileVersion", "4.7.2231" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.7.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2230" + VALUE "ProductVersion", "4.7.2231" END END BLOCK "VarFileInfo" From b895f26ebc4fff7e133135dae88a88f6d71525ef Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 21 Apr 2025 20:20:59 +0100 Subject: [PATCH 041/192] [misc] miscellaneous cleanup * Make sure we use _M_IX86 and _M_X64 where required. * Fix some static analysis warnings. * Update version for rufus-next. --- .vs/rufus.vcxproj | 1 + .vs/rufus.vcxproj.filters | 3 +++ _release.sh | 1 - configure | 20 ++++++++++---------- configure.ac | 2 +- res/appstore/packme.cmd | 10 +++++----- src/bled/decompress_bunzip2.c | 2 +- src/bled/fse_bitstream.h | 2 +- src/bled/libbb.h | 2 +- src/bled/platform.h | 2 +- src/bled/xz_dec_stream.c | 2 +- src/bled/zstd_cpu.h | 2 +- src/hash.c | 4 ++-- src/net.c | 7 ------- src/rufus.rc | 12 ++++++------ src/syslinux/libfat/ulint.h | 2 +- 16 files changed, 35 insertions(+), 39 deletions(-) diff --git a/.vs/rufus.vcxproj b/.vs/rufus.vcxproj index a685a716..99adc9f0 100644 --- a/.vs/rufus.vcxproj +++ b/.vs/rufus.vcxproj @@ -423,6 +423,7 @@ <ClInclude Include="..\src\hdd_vs_ufd.h" /> <ClInclude Include="..\src\mbr_types.h" /> <ClInclude Include="..\src\missing.h" /> + <ClInclude Include="..\src\msvc-missing\unistd.h" /> <ClInclude Include="..\src\process.h" /> <ClInclude Include="..\src\re.h" /> <ClInclude Include="..\src\settings.h" /> diff --git a/.vs/rufus.vcxproj.filters b/.vs/rufus.vcxproj.filters index 06a20b21..cd02009c 100644 --- a/.vs/rufus.vcxproj.filters +++ b/.vs/rufus.vcxproj.filters @@ -194,6 +194,9 @@ <ClInclude Include="..\src\efi.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="..\src\msvc-missing\unistd.h"> + <Filter>Header Files</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <None Include="..\res\rufus.ico"> diff --git a/_release.sh b/_release.sh index 32b3716e..46c58c17 100755 --- a/_release.sh +++ b/_release.sh @@ -1,5 +1,4 @@ #!/bin/sh -rm -f rufus*.exe ./configure --disable-debug "$@" make -j12 clean make -j12 release diff --git a/configure b/configure index 69e58bcd..ea8a7e1a 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for rufus 4.7. +# Generated by GNU Autoconf 2.71 for rufus 4.8. # # Report bugs to <https://github.com/pbatard/rufus/issues>. # @@ -611,8 +611,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rufus' PACKAGE_TARNAME='rufus' -PACKAGE_VERSION='4.7' -PACKAGE_STRING='rufus 4.7' +PACKAGE_VERSION='4.8' +PACKAGE_STRING='rufus 4.8' PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues' PACKAGE_URL='https://rufus.ie' @@ -1269,7 +1269,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rufus 4.7 to adapt to many kinds of systems. +\`configure' configures rufus 4.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1336,7 +1336,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rufus 4.7:";; + short | recursive ) echo "Configuration of rufus 4.8:";; esac cat <<\_ACEOF @@ -1428,7 +1428,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rufus configure 4.7 +rufus configure 4.8 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1504,7 +1504,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rufus $as_me 4.7, which was +It was created by rufus $as_me 4.8, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2767,7 +2767,7 @@ fi # Define the identity of the package. PACKAGE='rufus' - VERSION='4.7' + VERSION='4.8' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -5309,7 +5309,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rufus $as_me 4.7, which was +This file was extended by rufus $as_me 4.8, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5365,7 +5365,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -rufus config.status 4.7 +rufus config.status 4.8 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 27ccdbfa..abf747b5 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([rufus], [4.7], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) +AC_INIT([rufus], [4.8], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies]) AC_CONFIG_SRCDIR([src/rufus.c]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/res/appstore/packme.cmd b/res/appstore/packme.cmd index cbecd90c..c09eb363 100644 --- a/res/appstore/packme.cmd +++ b/res/appstore/packme.cmd @@ -70,24 +70,24 @@ for %%a in (%ARCHS%) do ( ) rem Use our own get_pe_info executable - source is in this directory -if not exist get_pe_info.exe ( - echo get_pe_info.exe must exist in this directory. Compile it with MinGW. +if not exist ..\get_pe_info.exe ( + echo ..\get_pe_info.exe must exist in the parent directory. Compile it with MinGW. goto out ) rem Make sure we're not trying to create a package from an ALPHA or BETA version! -get_pe_info.exe -i rufus_x64.exe | findstr /C:"ALPHA" 1>nul && ( +..\get_pe_info.exe -i rufus_x64.exe | findstr /C:"ALPHA" 1>nul && ( echo Alpha version detected - ABORTED goto out ) -get_pe_info.exe -i rufus_x64.exe | findstr /C:"BETA" 1>nul && ( +..\get_pe_info.exe -i rufus_x64.exe | findstr /C:"BETA" 1>nul && ( echo Beta version detected - ABORTED goto out ) rem Populate the version from the executable if "%VERSION_OVERRIDE%"=="" ( - get_pe_info.exe -v rufus_x64.exe > version.txt + ..\get_pe_info.exe -v rufus_x64.exe > version.txt set /p VERSION=<version.txt del version.txt ) else ( diff --git a/src/bled/decompress_bunzip2.c b/src/bled/decompress_bunzip2.c index 3c54285d..7cb08f93 100644 --- a/src/bled/decompress_bunzip2.c +++ b/src/bled/decompress_bunzip2.c @@ -843,7 +843,7 @@ char* FAST_FUNC unpack_bz2_data(const char *packed, int packed_len, int unpacked_len) { char *outbuf = NULL; - bunzip_data *bd; + bunzip_data *bd = NULL; int i; jmp_buf jmpbuf; diff --git a/src/bled/fse_bitstream.h b/src/bled/fse_bitstream.h index ed57e32b..5359392d 100644 --- a/src/bled/fse_bitstream.h +++ b/src/bled/fse_bitstream.h @@ -312,7 +312,7 @@ FORCE_INLINE_TEMPLATE size_t BIT_getMiddleBits(BitContainerType bitContainer, U3 * such cpus old (pre-Haswell, 2013) and their performance is not of that * importance. */ -#if defined(__x86_64__) || defined(_M_X86) +#if defined(__x86_64__) || defined(_M_X64) return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1); #else return (bitContainer >> (start & regMask)) & BIT_mask[nbBits]; diff --git a/src/bled/libbb.h b/src/bled/libbb.h index f1cf7d6e..eb799206 100644 --- a/src/bled/libbb.h +++ b/src/bled/libbb.h @@ -304,7 +304,7 @@ void xpipe(int filedes[2]) FAST_FUNC; static inline void xmove_fd(int from, int to) { if (from != to) { - _dup2(from, to); + (void)_dup2(from, to); _close(from); } } diff --git a/src/bled/platform.h b/src/bled/platform.h index ce0cf5f3..7c05d31f 100644 --- a/src/bled/platform.h +++ b/src/bled/platform.h @@ -261,7 +261,7 @@ typedef uint64_t bb__aliased_uint64_t FIX_ALIASING; /* NB: unaligned parameter should be a pointer, aligned one - * a lvalue. This makes it more likely to not swap them by mistake */ -#if defined(i386) || defined(__x86_64__) || defined(__powerpc__) +#if defined(i386) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) || defined(__powerpc__) # define BB_UNALIGNED_MEMACCESS_OK 1 # define move_from_unaligned_int(v, intp) ((v) = *(bb__aliased_int*)(intp)) # define move_from_unaligned_long(v, longp) ((v) = *(bb__aliased_long*)(longp)) diff --git a/src/bled/xz_dec_stream.c b/src/bled/xz_dec_stream.c index 31158b4e..b0184228 100644 --- a/src/bled/xz_dec_stream.c +++ b/src/bled/xz_dec_stream.c @@ -368,7 +368,7 @@ static enum xz_ret XZ_FUNC crc32_validate(struct xz_dec *s, struct xz_buf *b) */ static bool XZ_FUNC check_skip(struct xz_dec *s, struct xz_buf *b) { - while (s->pos < check_sizes[s->check_type]) { + while (s->check_type < 16 && s->pos < check_sizes[s->check_type]) { if (b->in_pos == b->in_size) return false; diff --git a/src/bled/zstd_cpu.h b/src/bled/zstd_cpu.h index 13b4469d..26603ba3 100644 --- a/src/bled/zstd_cpu.h +++ b/src/bled/zstd_cpu.h @@ -118,7 +118,7 @@ MEM_STATIC ZSTD_cpuid_t ZSTD_cpuid(void) { : "a"(7), "c"(0) : "edx"); } -#elif defined(__x86_64__) || defined(_M_X64) || defined(__i386__) +#elif defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86) U32 n; __asm__("cpuid" : "=a"(n) : "a"(0) : "ebx", "ecx", "edx"); if (n >= 1) { diff --git a/src/hash.c b/src/hash.c index e0e4d173..663b58d2 100644 --- a/src/hash.c +++ b/src/hash.c @@ -1697,7 +1697,7 @@ BOOL efi_image_parse(uint8_t* efi, size_t len, struct efi_image_regions** regp) if (len < 0x80) return FALSE; dos = (void*)efi; - if (dos->e_lfanew > len - 0x40) + if (dos->e_lfanew > (LONG)len - 0x40) return FALSE; nt = (void*)(efi + dos->e_lfanew); authsz = 0; @@ -2230,7 +2230,7 @@ static BOOL IsRevokedByDbx(uint8_t* hash, uint8_t* buf, uint32_t len) goto out; efi_var_auth = (EFI_VARIABLE_AUTHENTICATION_2*)dbx_data; - fluff_size = efi_var_auth->AuthInfo.Hdr.dwLength + sizeof(EFI_TIME); // +sizeof(EFI_SIGNATURE_LIST); + fluff_size = efi_var_auth->AuthInfo.Hdr.dwLength + sizeof(EFI_TIME); if (dbx_size <= fluff_size) goto out; efi_sig_list = (EFI_SIGNATURE_LIST*)&dbx_data[fluff_size]; diff --git a/src/net.c b/src/net.c index eb7a0b66..76aadcda 100644 --- a/src/net.c +++ b/src/net.c @@ -923,14 +923,7 @@ static DWORD WINAPI DownloadISOThread(LPVOID param) dwSize = (DWORD)strlen(FORCE_URL); #endif IMG_SAVE img_save = { 0 }; -// WTF is wrong with Microsoft's static analyzer reporting a potential buffer overflow here?!? -#if defined(_MSC_VER) -#pragma warning(disable: 6386) -#endif url[min(dwSize, dwAvail)] = 0; -#if defined(_MSC_VER) -#pragma warning(default: 6386) -#endif EXT_DECL(img_ext, GetShortName(url), __VA_GROUP__("*.iso"), __VA_GROUP__(lmprintf(MSG_036))); img_save.Type = VIRTUAL_STORAGE_TYPE_DEVICE_ISO; img_save.ImagePath = FileDialog(TRUE, NULL, &img_ext, NULL); diff --git a/src/rufus.rc b/src/rufus.rc index c559ee9f..adc8dccd 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.7.2231" +CAPTION "Rufus 4.8.2232" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,2231,0 - PRODUCTVERSION 4,7,2231,0 + FILEVERSION 4,8,2232,0 + PRODUCTVERSION 4,8,2232,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.7.2231" + VALUE "FileVersion", "4.8.2232" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" - VALUE "OriginalFilename", "rufus-4.7.exe" + VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.7.2231" + VALUE "ProductVersion", "4.8.2232" END END BLOCK "VarFileInfo" diff --git a/src/syslinux/libfat/ulint.h b/src/syslinux/libfat/ulint.h index c2fadb72..16ef962b 100644 --- a/src/syslinux/libfat/ulint.h +++ b/src/syslinux/libfat/ulint.h @@ -39,7 +39,7 @@ static inline void write8(le8_t * _p, uint8_t _v) *_p = _v; } -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) /* Littleendian architectures which support unaligned memory accesses */ From c31df877323be0dace7385cefa9412f601cd8489 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 2 May 2025 15:17:12 +0100 Subject: [PATCH 042/192] [wue] initial ezxml sources (unmodified) * From the ezxml-0.8.6.tar.gz download at https://ezxml.sourceforge.net/. --- src/rufus.rc | 10 +- src/xml.c | 1015 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/xml.h | 167 +++++++++ 3 files changed, 1187 insertions(+), 5 deletions(-) create mode 100644 src/xml.c create mode 100644 src/xml.h diff --git a/src/rufus.rc b/src/rufus.rc index adc8dccd..53a60431 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.8.2232" +CAPTION "Rufus 4.8.2233" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2232,0 - PRODUCTVERSION 4,8,2232,0 + FILEVERSION 4,8,2233,0 + PRODUCTVERSION 4,8,2233,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2232" + VALUE "FileVersion", "4.8.2233" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2232" + VALUE "ProductVersion", "4.8.2233" END END BLOCK "VarFileInfo" diff --git a/src/xml.c b/src/xml.c new file mode 100644 index 00000000..82b11fb9 --- /dev/null +++ b/src/xml.c @@ -0,0 +1,1015 @@ +/* ezxml.c + * + * Copyright 2004-2006 Aaron Voisine <aaron@voisine.org> + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include <stdlib.h> +#include <stdio.h> +#include <stdarg.h> +#include <string.h> +#include <ctype.h> +#include <unistd.h> +#include <sys/types.h> +#ifndef EZXML_NOMMAP +#include <sys/mman.h> +#endif // EZXML_NOMMAP +#include <sys/stat.h> +#include "ezxml.h" + +#define EZXML_WS "\t\r\n " // whitespace +#define EZXML_ERRL 128 // maximum error string length + +typedef struct ezxml_root *ezxml_root_t; +struct ezxml_root { // additional data for the root tag + struct ezxml xml; // is a super-struct built on top of ezxml struct + ezxml_t cur; // current xml tree insertion point + char *m; // original xml string + size_t len; // length of allocated memory for mmap, -1 for malloc + char *u; // UTF-8 conversion of string if original was UTF-16 + char *s; // start of work area + char *e; // end of work area + char **ent; // general entities (ampersand sequences) + char ***attr; // default attributes + char ***pi; // processing instructions + short standalone; // non-zero if <?xml standalone="yes"?> + char err[EZXML_ERRL]; // error string +}; + +char *EZXML_NIL[] = { NULL }; // empty, null terminated array of strings + +// returns the first child tag with the given name or NULL if not found +ezxml_t ezxml_child(ezxml_t xml, const char *name) +{ + xml = (xml) ? xml->child : NULL; + while (xml && strcmp(name, xml->name)) xml = xml->sibling; + return xml; +} + +// returns the Nth tag with the same name in the same subsection or NULL if not +// found +ezxml_t ezxml_idx(ezxml_t xml, int idx) +{ + for (; xml && idx; idx--) xml = xml->next; + return xml; +} + +// returns the value of the requested tag attribute or NULL if not found +const char *ezxml_attr(ezxml_t xml, const char *attr) +{ + int i = 0, j = 1; + ezxml_root_t root = (ezxml_root_t)xml; + + if (! xml || ! xml->attr) return NULL; + while (xml->attr[i] && strcmp(attr, xml->attr[i])) i += 2; + if (xml->attr[i]) return xml->attr[i + 1]; // found attribute + + while (root->xml.parent) root = (ezxml_root_t)root->xml.parent; // root tag + for (i = 0; root->attr[i] && strcmp(xml->name, root->attr[i][0]); i++); + if (! root->attr[i]) return NULL; // no matching default attributes + while (root->attr[i][j] && strcmp(attr, root->attr[i][j])) j += 3; + return (root->attr[i][j]) ? root->attr[i][j + 1] : NULL; // found default +} + +// same as ezxml_get but takes an already initialized va_list +ezxml_t ezxml_vget(ezxml_t xml, va_list ap) +{ + char *name = va_arg(ap, char *); + int idx = -1; + + if (name && *name) { + idx = va_arg(ap, int); + xml = ezxml_child(xml, name); + } + return (idx < 0) ? xml : ezxml_vget(ezxml_idx(xml, idx), ap); +} + +// Traverses the xml tree to retrieve a specific subtag. Takes a variable +// length list of tag names and indexes. The argument list must be terminated +// by either an index of -1 or an empty string tag name. Example: +// title = ezxml_get(library, "shelf", 0, "book", 2, "title", -1); +// This retrieves the title of the 3rd book on the 1st shelf of library. +// Returns NULL if not found. +ezxml_t ezxml_get(ezxml_t xml, ...) +{ + va_list ap; + ezxml_t r; + + va_start(ap, xml); + r = ezxml_vget(xml, ap); + va_end(ap); + return r; +} + +// returns a null terminated array of processing instructions for the given +// target +const char **ezxml_pi(ezxml_t xml, const char *target) +{ + ezxml_root_t root = (ezxml_root_t)xml; + int i = 0; + + if (! root) return (const char **)EZXML_NIL; + while (root->xml.parent) root = (ezxml_root_t)root->xml.parent; // root tag + while (root->pi[i] && strcmp(target, root->pi[i][0])) i++; // find target + return (const char **)((root->pi[i]) ? root->pi[i] + 1 : EZXML_NIL); +} + +// set an error string and return root +ezxml_t ezxml_err(ezxml_root_t root, char *s, const char *err, ...) +{ + va_list ap; + int line = 1; + char *t, fmt[EZXML_ERRL]; + + for (t = root->s; t < s; t++) if (*t == '\n') line++; + snprintf(fmt, EZXML_ERRL, "[error near line %d]: %s", line, err); + + va_start(ap, err); + vsnprintf(root->err, EZXML_ERRL, fmt, ap); + va_end(ap); + + return &root->xml; +} + +// Recursively decodes entity and character references and normalizes new lines +// ent is a null terminated array of alternating entity names and values. set t +// to '&' for general entity decoding, '%' for parameter entity decoding, 'c' +// for cdata sections, ' ' for attribute normalization, or '*' for non-cdata +// attribute normalization. Returns s, or if the decoded string is longer than +// s, returns a malloced string that must be freed. +char *ezxml_decode(char *s, char **ent, char t) +{ + char *e, *r = s, *m = s; + long b, c, d, l; + + for (; *s; s++) { // normalize line endings + while (*s == '\r') { + *(s++) = '\n'; + if (*s == '\n') memmove(s, (s + 1), strlen(s)); + } + } + + for (s = r; ; ) { + while (*s && *s != '&' && (*s != '%' || t != '%') && !isspace(*s)) s++; + + if (! *s) break; + else if (t != 'c' && ! strncmp(s, "&#", 2)) { // character reference + if (s[2] == 'x') c = strtol(s + 3, &e, 16); // base 16 + else c = strtol(s + 2, &e, 10); // base 10 + if (! c || *e != ';') { s++; continue; } // not a character ref + + if (c < 0x80) *(s++) = c; // US-ASCII subset + else { // multi-byte UTF-8 sequence + for (b = 0, d = c; d; d /= 2) b++; // number of bits in c + b = (b - 2) / 5; // number of bytes in payload + *(s++) = (0xFF << (7 - b)) | (c >> (6 * b)); // head + while (b) *(s++) = 0x80 | ((c >> (6 * --b)) & 0x3F); // payload + } + + memmove(s, strchr(s, ';') + 1, strlen(strchr(s, ';'))); + } + else if ((*s == '&' && (t == '&' || t == ' ' || t == '*')) || + (*s == '%' && t == '%')) { // entity reference + for (b = 0; ent[b] && strncmp(s + 1, ent[b], strlen(ent[b])); + b += 2); // find entity in entity list + + if (ent[b++]) { // found a match + if ((c = strlen(ent[b])) - 1 > (e = strchr(s, ';')) - s) { + l = (d = (s - r)) + c + strlen(e); // new length + r = (r == m) ? strcpy(malloc(l), r) : realloc(r, l); + e = strchr((s = r + d), ';'); // fix up pointers + } + + memmove(s + c, e + 1, strlen(e)); // shift rest of string + strncpy(s, ent[b], c); // copy in replacement text + } + else s++; // not a known entity + } + else if ((t == ' ' || t == '*') && isspace(*s)) *(s++) = ' '; + else s++; // no decoding needed + } + + if (t == '*') { // normalize spaces for non-cdata attributes + for (s = r; *s; s++) { + if ((l = strspn(s, " "))) memmove(s, s + l, strlen(s + l) + 1); + while (*s && *s != ' ') s++; + } + if (--s >= r && *s == ' ') *s = '\0'; // trim any trailing space + } + return r; +} + +// called when parser finds start of new tag +void ezxml_open_tag(ezxml_root_t root, char *name, char **attr) +{ + ezxml_t xml = root->cur; + + if (xml->name) xml = ezxml_add_child(xml, name, strlen(xml->txt)); + else xml->name = name; // first open tag + + xml->attr = attr; + root->cur = xml; // update tag insertion point +} + +// called when parser finds character content between open and closing tag +void ezxml_char_content(ezxml_root_t root, char *s, size_t len, char t) +{ + ezxml_t xml = root->cur; + char *m = s; + size_t l; + + if (! xml || ! xml->name || ! len) return; // sanity check + + s[len] = '\0'; // null terminate text (calling functions anticipate this) + len = strlen(s = ezxml_decode(s, root->ent, t)) + 1; + + if (! *(xml->txt)) xml->txt = s; // initial character content + else { // allocate our own memory and make a copy + xml->txt = (xml->flags & EZXML_TXTM) // allocate some space + ? realloc(xml->txt, (l = strlen(xml->txt)) + len) + : strcpy(malloc((l = strlen(xml->txt)) + len), xml->txt); + strcpy(xml->txt + l, s); // add new char content + if (s != m) free(s); // free s if it was malloced by ezxml_decode() + } + + if (xml->txt != m) ezxml_set_flag(xml, EZXML_TXTM); +} + +// called when parser finds closing tag +ezxml_t ezxml_close_tag(ezxml_root_t root, char *name, char *s) +{ + if (! root->cur || ! root->cur->name || strcmp(name, root->cur->name)) + return ezxml_err(root, s, "unexpected closing tag </%s>", name); + + root->cur = root->cur->parent; + return NULL; +} + +// checks for circular entity references, returns non-zero if no circular +// references are found, zero otherwise +int ezxml_ent_ok(char *name, char *s, char **ent) +{ + int i; + + for (; ; s++) { + while (*s && *s != '&') s++; // find next entity reference + if (! *s) return 1; + if (! strncmp(s + 1, name, strlen(name))) return 0; // circular ref. + for (i = 0; ent[i] && strncmp(ent[i], s + 1, strlen(ent[i])); i += 2); + if (ent[i] && ! ezxml_ent_ok(name, ent[i + 1], ent)) return 0; + } +} + +// called when the parser finds a processing instruction +void ezxml_proc_inst(ezxml_root_t root, char *s, size_t len) +{ + int i = 0, j = 1; + char *target = s; + + s[len] = '\0'; // null terminate instruction + if (*(s += strcspn(s, EZXML_WS))) { + *s = '\0'; // null terminate target + s += strspn(s + 1, EZXML_WS) + 1; // skip whitespace after target + } + + if (! strcmp(target, "xml")) { // <?xml ... ?> + if ((s = strstr(s, "standalone")) && ! strncmp(s + strspn(s + 10, + EZXML_WS "='\"") + 10, "yes", 3)) root->standalone = 1; + return; + } + + if (! root->pi[0]) *(root->pi = malloc(sizeof(char **))) = NULL; //first pi + + while (root->pi[i] && strcmp(target, root->pi[i][0])) i++; // find target + if (! root->pi[i]) { // new target + root->pi = realloc(root->pi, sizeof(char **) * (i + 2)); + root->pi[i] = malloc(sizeof(char *) * 3); + root->pi[i][0] = target; + root->pi[i][1] = (char *)(root->pi[i + 1] = NULL); // terminate pi list + root->pi[i][2] = strdup(""); // empty document position list + } + + while (root->pi[i][j]) j++; // find end of instruction list for this target + root->pi[i] = realloc(root->pi[i], sizeof(char *) * (j + 3)); + root->pi[i][j + 2] = realloc(root->pi[i][j + 1], j + 1); + strcpy(root->pi[i][j + 2] + j - 1, (root->xml.name) ? ">" : "<"); + root->pi[i][j + 1] = NULL; // null terminate pi list for this target + root->pi[i][j] = s; // set instruction +} + +// called when the parser finds an internal doctype subset +short ezxml_internal_dtd(ezxml_root_t root, char *s, size_t len) +{ + char q, *c, *t, *n = NULL, *v, **ent, **pe; + int i, j; + + pe = memcpy(malloc(sizeof(EZXML_NIL)), EZXML_NIL, sizeof(EZXML_NIL)); + + for (s[len] = '\0'; s; ) { + while (*s && *s != '<' && *s != '%') s++; // find next declaration + + if (! *s) break; + else if (! strncmp(s, "<!ENTITY", 8)) { // parse entity definitions + c = s += strspn(s + 8, EZXML_WS) + 8; // skip white space separator + n = s + strspn(s, EZXML_WS "%"); // find name + *(s = n + strcspn(n, EZXML_WS)) = ';'; // append ; to name + + v = s + strspn(s + 1, EZXML_WS) + 1; // find value + if ((q = *(v++)) != '"' && q != '\'') { // skip externals + s = strchr(s, '>'); + continue; + } + + for (i = 0, ent = (*c == '%') ? pe : root->ent; ent[i]; i++); + ent = realloc(ent, (i + 3) * sizeof(char *)); // space for next ent + if (*c == '%') pe = ent; + else root->ent = ent; + + *(++s) = '\0'; // null terminate name + if ((s = strchr(v, q))) *(s++) = '\0'; // null terminate value + ent[i + 1] = ezxml_decode(v, pe, '%'); // set value + ent[i + 2] = NULL; // null terminate entity list + if (! ezxml_ent_ok(n, ent[i + 1], ent)) { // circular reference + if (ent[i + 1] != v) free(ent[i + 1]); + ezxml_err(root, v, "circular entity declaration &%s", n); + break; + } + else ent[i] = n; // set entity name + } + else if (! strncmp(s, "<!ATTLIST", 9)) { // parse default attributes + t = s + strspn(s + 9, EZXML_WS) + 9; // skip whitespace separator + if (! *t) { ezxml_err(root, t, "unclosed <!ATTLIST"); break; } + if (*(s = t + strcspn(t, EZXML_WS ">")) == '>') continue; + else *s = '\0'; // null terminate tag name + for (i = 0; root->attr[i] && strcmp(n, root->attr[i][0]); i++); + + while (*(n = ++s + strspn(s, EZXML_WS)) && *n != '>') { + if (*(s = n + strcspn(n, EZXML_WS))) *s = '\0'; // attr name + else { ezxml_err(root, t, "malformed <!ATTLIST"); break; } + + s += strspn(s + 1, EZXML_WS) + 1; // find next token + c = (strncmp(s, "CDATA", 5)) ? "*" : " "; // is it cdata? + if (! strncmp(s, "NOTATION", 8)) + s += strspn(s + 8, EZXML_WS) + 8; + s = (*s == '(') ? strchr(s, ')') : s + strcspn(s, EZXML_WS); + if (! s) { ezxml_err(root, t, "malformed <!ATTLIST"); break; } + + s += strspn(s, EZXML_WS ")"); // skip white space separator + if (! strncmp(s, "#FIXED", 6)) + s += strspn(s + 6, EZXML_WS) + 6; + if (*s == '#') { // no default value + s += strcspn(s, EZXML_WS ">") - 1; + if (*c == ' ') continue; // cdata is default, nothing to do + v = NULL; + } + else if ((*s == '"' || *s == '\'') && // default value + (s = strchr(v = s + 1, *s))) *s = '\0'; + else { ezxml_err(root, t, "malformed <!ATTLIST"); break; } + + if (! root->attr[i]) { // new tag name + root->attr = (! i) ? malloc(2 * sizeof(char **)) + : realloc(root->attr, + (i + 2) * sizeof(char **)); + root->attr[i] = malloc(2 * sizeof(char *)); + root->attr[i][0] = t; // set tag name + root->attr[i][1] = (char *)(root->attr[i + 1] = NULL); + } + + for (j = 1; root->attr[i][j]; j += 3); // find end of list + root->attr[i] = realloc(root->attr[i], + (j + 4) * sizeof(char *)); + + root->attr[i][j + 3] = NULL; // null terminate list + root->attr[i][j + 2] = c; // is it cdata? + root->attr[i][j + 1] = (v) ? ezxml_decode(v, root->ent, *c) + : NULL; + root->attr[i][j] = n; // attribute name + } + } + else if (! strncmp(s, "<!--", 4)) s = strstr(s + 4, "-->"); // comments + else if (! strncmp(s, "<?", 2)) { // processing instructions + if ((s = strstr(c = s + 2, "?>"))) + ezxml_proc_inst(root, c, s++ - c); + } + else if (*s == '<') s = strchr(s, '>'); // skip other declarations + else if (*(s++) == '%' && ! root->standalone) break; + } + + free(pe); + return ! *root->err; +} + +// Converts a UTF-16 string to UTF-8. Returns a new string that must be freed +// or NULL if no conversion was needed. +char *ezxml_str2utf8(char **s, size_t *len) +{ + char *u; + size_t l = 0, sl, max = *len; + long c, d; + int b, be = (**s == '\xFE') ? 1 : (**s == '\xFF') ? 0 : -1; + + if (be == -1) return NULL; // not UTF-16 + + u = malloc(max); + for (sl = 2; sl < *len - 1; sl += 2) { + c = (be) ? (((*s)[sl] & 0xFF) << 8) | ((*s)[sl + 1] & 0xFF) //UTF-16BE + : (((*s)[sl + 1] & 0xFF) << 8) | ((*s)[sl] & 0xFF); //UTF-16LE + if (c >= 0xD800 && c <= 0xDFFF && (sl += 2) < *len - 1) { // high-half + d = (be) ? (((*s)[sl] & 0xFF) << 8) | ((*s)[sl + 1] & 0xFF) + : (((*s)[sl + 1] & 0xFF) << 8) | ((*s)[sl] & 0xFF); + c = (((c & 0x3FF) << 10) | (d & 0x3FF)) + 0x10000; + } + + while (l + 6 > max) u = realloc(u, max += EZXML_BUFSIZE); + if (c < 0x80) u[l++] = c; // US-ASCII subset + else { // multi-byte UTF-8 sequence + for (b = 0, d = c; d; d /= 2) b++; // bits in c + b = (b - 2) / 5; // bytes in payload + u[l++] = (0xFF << (7 - b)) | (c >> (6 * b)); // head + while (b) u[l++] = 0x80 | ((c >> (6 * --b)) & 0x3F); // payload + } + } + return *s = realloc(u, *len = l); +} + +// frees a tag attribute list +void ezxml_free_attr(char **attr) { + int i = 0; + char *m; + + if (! attr || attr == EZXML_NIL) return; // nothing to free + while (attr[i]) i += 2; // find end of attribute list + m = attr[i + 1]; // list of which names and values are malloced + for (i = 0; m[i]; i++) { + if (m[i] & EZXML_NAMEM) free(attr[i * 2]); + if (m[i] & EZXML_TXTM) free(attr[(i * 2) + 1]); + } + free(m); + free(attr); +} + +// parse the given xml string and return an ezxml structure +ezxml_t ezxml_parse_str(char *s, size_t len) +{ + ezxml_root_t root = (ezxml_root_t)ezxml_new(NULL); + char q, e, *d, **attr, **a = NULL; // initialize a to avoid compile warning + int l, i, j; + + root->m = s; + if (! len) return ezxml_err(root, NULL, "root tag missing"); + root->u = ezxml_str2utf8(&s, &len); // convert utf-16 to utf-8 + root->e = (root->s = s) + len; // record start and end of work area + + e = s[len - 1]; // save end char + s[len - 1] = '\0'; // turn end char into null terminator + + while (*s && *s != '<') s++; // find first tag + if (! *s) return ezxml_err(root, s, "root tag missing"); + + for (; ; ) { + attr = (char **)EZXML_NIL; + d = ++s; + + if (isalpha(*s) || *s == '_' || *s == ':' || *s < '\0') { // new tag + if (! root->cur) + return ezxml_err(root, d, "markup outside of root element"); + + s += strcspn(s, EZXML_WS "/>"); + while (isspace(*s)) *(s++) = '\0'; // null terminate tag name + + if (*s && *s != '/' && *s != '>') // find tag in default attr list + for (i = 0; (a = root->attr[i]) && strcmp(a[0], d); i++); + + for (l = 0; *s && *s != '/' && *s != '>'; l += 2) { // new attrib + attr = (l) ? realloc(attr, (l + 4) * sizeof(char *)) + : malloc(4 * sizeof(char *)); // allocate space + attr[l + 3] = (l) ? realloc(attr[l + 1], (l / 2) + 2) + : malloc(2); // mem for list of maloced vals + strcpy(attr[l + 3] + (l / 2), " "); // value is not malloced + attr[l + 2] = NULL; // null terminate list + attr[l + 1] = ""; // temporary attribute value + attr[l] = s; // set attribute name + + s += strcspn(s, EZXML_WS "=/>"); + if (*s == '=' || isspace(*s)) { + *(s++) = '\0'; // null terminate tag attribute name + q = *(s += strspn(s, EZXML_WS "=")); + if (q == '"' || q == '\'') { // attribute value + attr[l + 1] = ++s; + while (*s && *s != q) s++; + if (*s) *(s++) = '\0'; // null terminate attribute val + else { + ezxml_free_attr(attr); + return ezxml_err(root, d, "missing %c", q); + } + + for (j = 1; a && a[j] && strcmp(a[j], attr[l]); j +=3); + attr[l + 1] = ezxml_decode(attr[l + 1], root->ent, (a + && a[j]) ? *a[j + 2] : ' '); + if (attr[l + 1] < d || attr[l + 1] > s) + attr[l + 3][l / 2] = EZXML_TXTM; // value malloced + } + } + while (isspace(*s)) s++; + } + + if (*s == '/') { // self closing tag + *(s++) = '\0'; + if ((*s && *s != '>') || (! *s && e != '>')) { + if (l) ezxml_free_attr(attr); + return ezxml_err(root, d, "missing >"); + } + ezxml_open_tag(root, d, attr); + ezxml_close_tag(root, d, s); + } + else if ((q = *s) == '>' || (! *s && e == '>')) { // open tag + *s = '\0'; // temporarily null terminate tag name + ezxml_open_tag(root, d, attr); + *s = q; + } + else { + if (l) ezxml_free_attr(attr); + return ezxml_err(root, d, "missing >"); + } + } + else if (*s == '/') { // close tag + s += strcspn(d = s + 1, EZXML_WS ">") + 1; + if (! (q = *s) && e != '>') return ezxml_err(root, d, "missing >"); + *s = '\0'; // temporarily null terminate tag name + if (ezxml_close_tag(root, d, s)) return &root->xml; + if (isspace(*s = q)) s += strspn(s, EZXML_WS); + } + else if (! strncmp(s, "!--", 3)) { // xml comment + if (! (s = strstr(s + 3, "--")) || (*(s += 2) != '>' && *s) || + (! *s && e != '>')) return ezxml_err(root, d, "unclosed <!--"); + } + else if (! strncmp(s, "![CDATA[", 8)) { // cdata + if ((s = strstr(s, "]]>"))) + ezxml_char_content(root, d + 8, (s += 2) - d - 10, 'c'); + else return ezxml_err(root, d, "unclosed <![CDATA["); + } + else if (! strncmp(s, "!DOCTYPE", 8)) { // dtd + for (l = 0; *s && ((! l && *s != '>') || (l && (*s != ']' || + *(s + strspn(s + 1, EZXML_WS) + 1) != '>'))); + l = (*s == '[') ? 1 : l) s += strcspn(s + 1, "[]>") + 1; + if (! *s && e != '>') + return ezxml_err(root, d, "unclosed <!DOCTYPE"); + d = (l) ? strchr(d, '[') + 1 : d; + if (l && ! ezxml_internal_dtd(root, d, s++ - d)) return &root->xml; + } + else if (*s == '?') { // <?...?> processing instructions + do { s = strchr(s, '?'); } while (s && *(++s) && *s != '>'); + if (! s || (! *s && e != '>')) + return ezxml_err(root, d, "unclosed <?"); + else ezxml_proc_inst(root, d + 1, s - d - 2); + } + else return ezxml_err(root, d, "unexpected <"); + + if (! s || ! *s) break; + *s = '\0'; + d = ++s; + if (*s && *s != '<') { // tag character content + while (*s && *s != '<') s++; + if (*s) ezxml_char_content(root, d, s - d, '&'); + else break; + } + else if (! *s) break; + } + + if (! root->cur) return &root->xml; + else if (! root->cur->name) return ezxml_err(root, d, "root tag missing"); + else return ezxml_err(root, d, "unclosed tag <%s>", root->cur->name); +} + +// Wrapper for ezxml_parse_str() that accepts a file stream. Reads the entire +// stream into memory and then parses it. For xml files, use ezxml_parse_file() +// or ezxml_parse_fd() +ezxml_t ezxml_parse_fp(FILE *fp) +{ + ezxml_root_t root; + size_t l, len = 0; + char *s; + + if (! (s = malloc(EZXML_BUFSIZE))) return NULL; + do { + len += (l = fread((s + len), 1, EZXML_BUFSIZE, fp)); + if (l == EZXML_BUFSIZE) s = realloc(s, len + EZXML_BUFSIZE); + } while (s && l == EZXML_BUFSIZE); + + if (! s) return NULL; + root = (ezxml_root_t)ezxml_parse_str(s, len); + root->len = -1; // so we know to free s in ezxml_free() + return &root->xml; +} + +// A wrapper for ezxml_parse_str() that accepts a file descriptor. First +// attempts to mem map the file. Failing that, reads the file into memory. +// Returns NULL on failure. +ezxml_t ezxml_parse_fd(int fd) +{ + ezxml_root_t root; + struct stat st; + size_t l; + void *m; + + if (fd < 0) return NULL; + fstat(fd, &st); + +#ifndef EZXML_NOMMAP + l = (st.st_size + sysconf(_SC_PAGESIZE) - 1) & ~(sysconf(_SC_PAGESIZE) -1); + if ((m = mmap(NULL, l, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0)) != + MAP_FAILED) { + madvise(m, l, MADV_SEQUENTIAL); // optimize for sequential access + root = (ezxml_root_t)ezxml_parse_str(m, st.st_size); + madvise(m, root->len = l, MADV_NORMAL); // put it back to normal + } + else { // mmap failed, read file into memory +#endif // EZXML_NOMMAP + l = read(fd, m = malloc(st.st_size), st.st_size); + root = (ezxml_root_t)ezxml_parse_str(m, l); + root->len = -1; // so we know to free s in ezxml_free() +#ifndef EZXML_NOMMAP + } +#endif // EZXML_NOMMAP + return &root->xml; +} + +// a wrapper for ezxml_parse_fd that accepts a file name +ezxml_t ezxml_parse_file(const char *file) +{ + int fd = open(file, O_RDONLY, 0); + ezxml_t xml = ezxml_parse_fd(fd); + + if (fd >= 0) close(fd); + return xml; +} + +// Encodes ampersand sequences appending the results to *dst, reallocating *dst +// if length excedes max. a is non-zero for attribute encoding. Returns *dst +char *ezxml_ampencode(const char *s, size_t len, char **dst, size_t *dlen, + size_t *max, short a) +{ + const char *e; + + for (e = s + len; s != e; s++) { + while (*dlen + 10 > *max) *dst = realloc(*dst, *max += EZXML_BUFSIZE); + + switch (*s) { + case '\0': return *dst; + case '&': *dlen += sprintf(*dst + *dlen, "&amp;"); break; + case '<': *dlen += sprintf(*dst + *dlen, "&lt;"); break; + case '>': *dlen += sprintf(*dst + *dlen, "&gt;"); break; + case '"': *dlen += sprintf(*dst + *dlen, (a) ? "&quot;" : "\""); break; + case '\n': *dlen += sprintf(*dst + *dlen, (a) ? "&#xA;" : "\n"); break; + case '\t': *dlen += sprintf(*dst + *dlen, (a) ? "&#x9;" : "\t"); break; + case '\r': *dlen += sprintf(*dst + *dlen, "&#xD;"); break; + default: (*dst)[(*dlen)++] = *s; + } + } + return *dst; +} + +// Recursively converts each tag to xml appending it to *s. Reallocates *s if +// its length excedes max. start is the location of the previous tag in the +// parent tag's character content. Returns *s. +char *ezxml_toxml_r(ezxml_t xml, char **s, size_t *len, size_t *max, + size_t start, char ***attr) +{ + int i, j; + char *txt = (xml->parent) ? xml->parent->txt : ""; + size_t off = 0; + + // parent character content up to this tag + *s = ezxml_ampencode(txt + start, xml->off - start, s, len, max, 0); + + while (*len + strlen(xml->name) + 4 > *max) // reallocate s + *s = realloc(*s, *max += EZXML_BUFSIZE); + + *len += sprintf(*s + *len, "<%s", xml->name); // open tag + for (i = 0; xml->attr[i]; i += 2) { // tag attributes + if (ezxml_attr(xml, xml->attr[i]) != xml->attr[i + 1]) continue; + while (*len + strlen(xml->attr[i]) + 7 > *max) // reallocate s + *s = realloc(*s, *max += EZXML_BUFSIZE); + + *len += sprintf(*s + *len, " %s=\"", xml->attr[i]); + ezxml_ampencode(xml->attr[i + 1], -1, s, len, max, 1); + *len += sprintf(*s + *len, "\""); + } + + for (i = 0; attr[i] && strcmp(attr[i][0], xml->name); i++); + for (j = 1; attr[i] && attr[i][j]; j += 3) { // default attributes + if (! attr[i][j + 1] || ezxml_attr(xml, attr[i][j]) != attr[i][j + 1]) + continue; // skip duplicates and non-values + while (*len + strlen(attr[i][j]) + 7 > *max) // reallocate s + *s = realloc(*s, *max += EZXML_BUFSIZE); + + *len += sprintf(*s + *len, " %s=\"", attr[i][j]); + ezxml_ampencode(attr[i][j + 1], -1, s, len, max, 1); + *len += sprintf(*s + *len, "\""); + } + *len += sprintf(*s + *len, ">"); + + *s = (xml->child) ? ezxml_toxml_r(xml->child, s, len, max, 0, attr) //child + : ezxml_ampencode(xml->txt, -1, s, len, max, 0); //data + + while (*len + strlen(xml->name) + 4 > *max) // reallocate s + *s = realloc(*s, *max += EZXML_BUFSIZE); + + *len += sprintf(*s + *len, "</%s>", xml->name); // close tag + + while (txt[off] && off < xml->off) off++; // make sure off is within bounds + return (xml->ordered) ? ezxml_toxml_r(xml->ordered, s, len, max, off, attr) + : ezxml_ampencode(txt + off, -1, s, len, max, 0); +} + +// Converts an ezxml structure back to xml. Returns a string of xml data that +// must be freed. +char *ezxml_toxml(ezxml_t xml) +{ + ezxml_t p = (xml) ? xml->parent : NULL, o = (xml) ? xml->ordered : NULL; + ezxml_root_t root = (ezxml_root_t)xml; + size_t len = 0, max = EZXML_BUFSIZE; + char *s = strcpy(malloc(max), ""), *t, *n; + int i, j, k; + + if (! xml || ! xml->name) return realloc(s, len + 1); + while (root->xml.parent) root = (ezxml_root_t)root->xml.parent; // root tag + + for (i = 0; ! p && root->pi[i]; i++) { // pre-root processing instructions + for (k = 2; root->pi[i][k - 1]; k++); + for (j = 1; (n = root->pi[i][j]); j++) { + if (root->pi[i][k][j - 1] == '>') continue; // not pre-root + while (len + strlen(t = root->pi[i][0]) + strlen(n) + 7 > max) + s = realloc(s, max += EZXML_BUFSIZE); + len += sprintf(s + len, "<?%s%s%s?>\n", t, *n ? " " : "", n); + } + } + + xml->parent = xml->ordered = NULL; + s = ezxml_toxml_r(xml, &s, &len, &max, 0, root->attr); + xml->parent = p; + xml->ordered = o; + + for (i = 0; ! p && root->pi[i]; i++) { // post-root processing instructions + for (k = 2; root->pi[i][k - 1]; k++); + for (j = 1; (n = root->pi[i][j]); j++) { + if (root->pi[i][k][j - 1] == '<') continue; // not post-root + while (len + strlen(t = root->pi[i][0]) + strlen(n) + 7 > max) + s = realloc(s, max += EZXML_BUFSIZE); + len += sprintf(s + len, "\n<?%s%s%s?>", t, *n ? " " : "", n); + } + } + return realloc(s, len + 1); +} + +// free the memory allocated for the ezxml structure +void ezxml_free(ezxml_t xml) +{ + ezxml_root_t root = (ezxml_root_t)xml; + int i, j; + char **a, *s; + + if (! xml) return; + ezxml_free(xml->child); + ezxml_free(xml->ordered); + + if (! xml->parent) { // free root tag allocations + for (i = 10; root->ent[i]; i += 2) // 0 - 9 are default entites (<>&"') + if ((s = root->ent[i + 1]) < root->s || s > root->e) free(s); + free(root->ent); // free list of general entities + + for (i = 0; (a = root->attr[i]); i++) { + for (j = 1; a[j++]; j += 2) // free malloced attribute values + if (a[j] && (a[j] < root->s || a[j] > root->e)) free(a[j]); + free(a); + } + if (root->attr[0]) free(root->attr); // free default attribute list + + for (i = 0; root->pi[i]; i++) { + for (j = 1; root->pi[i][j]; j++); + free(root->pi[i][j + 1]); + free(root->pi[i]); + } + if (root->pi[0]) free(root->pi); // free processing instructions + + if (root->len == -1) free(root->m); // malloced xml data +#ifndef EZXML_NOMMAP + else if (root->len) munmap(root->m, root->len); // mem mapped xml data +#endif // EZXML_NOMMAP + if (root->u) free(root->u); // utf8 conversion + } + + ezxml_free_attr(xml->attr); // tag attributes + if ((xml->flags & EZXML_TXTM)) free(xml->txt); // character content + if ((xml->flags & EZXML_NAMEM)) free(xml->name); // tag name + free(xml); +} + +// return parser error message or empty string if none +const char *ezxml_error(ezxml_t xml) +{ + while (xml && xml->parent) xml = xml->parent; // find root tag + return (xml) ? ((ezxml_root_t)xml)->err : ""; +} + +// returns a new empty ezxml structure with the given root tag name +ezxml_t ezxml_new(const char *name) +{ + static char *ent[] = { "lt;", "&#60;", "gt;", "&#62;", "quot;", "&#34;", + "apos;", "&#39;", "amp;", "&#38;", NULL }; + ezxml_root_t root = (ezxml_root_t)memset(malloc(sizeof(struct ezxml_root)), + '\0', sizeof(struct ezxml_root)); + root->xml.name = (char *)name; + root->cur = &root->xml; + strcpy(root->err, root->xml.txt = ""); + root->ent = memcpy(malloc(sizeof(ent)), ent, sizeof(ent)); + root->attr = root->pi = (char ***)(root->xml.attr = EZXML_NIL); + return &root->xml; +} + +// inserts an existing tag into an ezxml structure +ezxml_t ezxml_insert(ezxml_t xml, ezxml_t dest, size_t off) +{ + ezxml_t cur, prev, head; + + xml->next = xml->sibling = xml->ordered = NULL; + xml->off = off; + xml->parent = dest; + + if ((head = dest->child)) { // already have sub tags + if (head->off <= off) { // not first subtag + for (cur = head; cur->ordered && cur->ordered->off <= off; + cur = cur->ordered); + xml->ordered = cur->ordered; + cur->ordered = xml; + } + else { // first subtag + xml->ordered = head; + dest->child = xml; + } + + for (cur = head, prev = NULL; cur && strcmp(cur->name, xml->name); + prev = cur, cur = cur->sibling); // find tag type + if (cur && cur->off <= off) { // not first of type + while (cur->next && cur->next->off <= off) cur = cur->next; + xml->next = cur->next; + cur->next = xml; + } + else { // first tag of this type + if (prev && cur) prev->sibling = cur->sibling; // remove old first + xml->next = cur; // old first tag is now next + for (cur = head, prev = NULL; cur && cur->off <= off; + prev = cur, cur = cur->sibling); // new sibling insert point + xml->sibling = cur; + if (prev) prev->sibling = xml; + } + } + else dest->child = xml; // only sub tag + + return xml; +} + +// Adds a child tag. off is the offset of the child tag relative to the start +// of the parent tag's character content. Returns the child tag. +ezxml_t ezxml_add_child(ezxml_t xml, const char *name, size_t off) +{ + ezxml_t child; + + if (! xml) return NULL; + child = (ezxml_t)memset(malloc(sizeof(struct ezxml)), '\0', + sizeof(struct ezxml)); + child->name = (char *)name; + child->attr = EZXML_NIL; + child->txt = ""; + + return ezxml_insert(child, xml, off); +} + +// sets the character content for the given tag and returns the tag +ezxml_t ezxml_set_txt(ezxml_t xml, const char *txt) +{ + if (! xml) return NULL; + if (xml->flags & EZXML_TXTM) free(xml->txt); // existing txt was malloced + xml->flags &= ~EZXML_TXTM; + xml->txt = (char *)txt; + return xml; +} + +// Sets the given tag attribute or adds a new attribute if not found. A value +// of NULL will remove the specified attribute. Returns the tag given. +ezxml_t ezxml_set_attr(ezxml_t xml, const char *name, const char *value) +{ + int l = 0, c; + + if (! xml) return NULL; + while (xml->attr[l] && strcmp(xml->attr[l], name)) l += 2; + if (! xml->attr[l]) { // not found, add as new attribute + if (! value) return xml; // nothing to do + if (xml->attr == EZXML_NIL) { // first attribute + xml->attr = malloc(4 * sizeof(char *)); + xml->attr[1] = strdup(""); // empty list of malloced names/vals + } + else xml->attr = realloc(xml->attr, (l + 4) * sizeof(char *)); + + xml->attr[l] = (char *)name; // set attribute name + xml->attr[l + 2] = NULL; // null terminate attribute list + xml->attr[l + 3] = realloc(xml->attr[l + 1], + (c = strlen(xml->attr[l + 1])) + 2); + strcpy(xml->attr[l + 3] + c, " "); // set name/value as not malloced + if (xml->flags & EZXML_DUP) xml->attr[l + 3][c] = EZXML_NAMEM; + } + else if (xml->flags & EZXML_DUP) free((char *)name); // name was strduped + + for (c = l; xml->attr[c]; c += 2); // find end of attribute list + if (xml->attr[c + 1][l / 2] & EZXML_TXTM) free(xml->attr[l + 1]); //old val + if (xml->flags & EZXML_DUP) xml->attr[c + 1][l / 2] |= EZXML_TXTM; + else xml->attr[c + 1][l / 2] &= ~EZXML_TXTM; + + if (value) xml->attr[l + 1] = (char *)value; // set attribute value + else { // remove attribute + if (xml->attr[c + 1][l / 2] & EZXML_NAMEM) free(xml->attr[l]); + memmove(xml->attr + l, xml->attr + l + 2, (c - l + 2) * sizeof(char*)); + xml->attr = realloc(xml->attr, (c + 2) * sizeof(char *)); + memmove(xml->attr[c + 1] + (l / 2), xml->attr[c + 1] + (l / 2) + 1, + (c / 2) - (l / 2)); // fix list of which name/vals are malloced + } + xml->flags &= ~EZXML_DUP; // clear strdup() flag + return xml; +} + +// sets a flag for the given tag and returns the tag +ezxml_t ezxml_set_flag(ezxml_t xml, short flag) +{ + if (xml) xml->flags |= flag; + return xml; +} + +// removes a tag along with its subtags without freeing its memory +ezxml_t ezxml_cut(ezxml_t xml) +{ + ezxml_t cur; + + if (! xml) return NULL; // nothing to do + if (xml->next) xml->next->sibling = xml->sibling; // patch sibling list + + if (xml->parent) { // not root tag + cur = xml->parent->child; // find head of subtag list + if (cur == xml) xml->parent->child = xml->ordered; // first subtag + else { // not first subtag + while (cur->ordered != xml) cur = cur->ordered; + cur->ordered = cur->ordered->ordered; // patch ordered list + + cur = xml->parent->child; // go back to head of subtag list + if (strcmp(cur->name, xml->name)) { // not in first sibling list + while (strcmp(cur->sibling->name, xml->name)) + cur = cur->sibling; + if (cur->sibling == xml) { // first of a sibling list + cur->sibling = (xml->next) ? xml->next + : cur->sibling->sibling; + } + else cur = cur->sibling; // not first of a sibling list + } + + while (cur->next && cur->next != xml) cur = cur->next; + if (cur->next) cur->next = cur->next->next; // patch next list + } + } + xml->ordered = xml->sibling = xml->next = NULL; + return xml; +} + +#ifdef EZXML_TEST // test harness +int main(int argc, char **argv) +{ + ezxml_t xml; + char *s; + int i; + + if (argc != 2) return fprintf(stderr, "usage: %s xmlfile\n", argv[0]); + + xml = ezxml_parse_file(argv[1]); + printf("%s\n", (s = ezxml_toxml(xml))); + free(s); + i = fprintf(stderr, "%s", ezxml_error(xml)); + ezxml_free(xml); + return (i) ? 1 : 0; +} +#endif // EZXML_TEST diff --git a/src/xml.h b/src/xml.h new file mode 100644 index 00000000..3e020788 --- /dev/null +++ b/src/xml.h @@ -0,0 +1,167 @@ +/* ezxml.h + * + * Copyright 2004-2006 Aaron Voisine <aaron@voisine.org> + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _EZXML_H +#define _EZXML_H + +#include <stdlib.h> +#include <stdio.h> +#include <stdarg.h> +#include <fcntl.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#define EZXML_BUFSIZE 1024 // size of internal memory buffers +#define EZXML_NAMEM 0x80 // name is malloced +#define EZXML_TXTM 0x40 // txt is malloced +#define EZXML_DUP 0x20 // attribute name and value are strduped + +typedef struct ezxml *ezxml_t; +struct ezxml { + char *name; // tag name + char **attr; // tag attributes { name, value, name, value, ... NULL } + char *txt; // tag character content, empty string if none + size_t off; // tag offset from start of parent tag character content + ezxml_t next; // next tag with same name in this section at this depth + ezxml_t sibling; // next tag with different name in same section and depth + ezxml_t ordered; // next tag, same section and depth, in original order + ezxml_t child; // head of sub tag list, NULL if none + ezxml_t parent; // parent tag, NULL if current tag is root tag + short flags; // additional information +}; + +// Given a string of xml data and its length, parses it and creates an ezxml +// structure. For efficiency, modifies the data by adding null terminators +// and decoding ampersand sequences. If you don't want this, copy the data and +// pass in the copy. Returns NULL on failure. +ezxml_t ezxml_parse_str(char *s, size_t len); + +// A wrapper for ezxml_parse_str() that accepts a file descriptor. First +// attempts to mem map the file. Failing that, reads the file into memory. +// Returns NULL on failure. +ezxml_t ezxml_parse_fd(int fd); + +// a wrapper for ezxml_parse_fd() that accepts a file name +ezxml_t ezxml_parse_file(const char *file); + +// Wrapper for ezxml_parse_str() that accepts a file stream. Reads the entire +// stream into memory and then parses it. For xml files, use ezxml_parse_file() +// or ezxml_parse_fd() +ezxml_t ezxml_parse_fp(FILE *fp); + +// returns the first child tag (one level deeper) with the given name or NULL +// if not found +ezxml_t ezxml_child(ezxml_t xml, const char *name); + +// returns the next tag of the same name in the same section and depth or NULL +// if not found +#define ezxml_next(xml) ((xml) ? xml->next : NULL) + +// Returns the Nth tag with the same name in the same section at the same depth +// or NULL if not found. An index of 0 returns the tag given. +ezxml_t ezxml_idx(ezxml_t xml, int idx); + +// returns the name of the given tag +#define ezxml_name(xml) ((xml) ? xml->name : NULL) + +// returns the given tag's character content or empty string if none +#define ezxml_txt(xml) ((xml) ? xml->txt : "") + +// returns the value of the requested tag attribute, or NULL if not found +const char *ezxml_attr(ezxml_t xml, const char *attr); + +// Traverses the ezxml sturcture to retrieve a specific subtag. Takes a +// variable length list of tag names and indexes. The argument list must be +// terminated by either an index of -1 or an empty string tag name. Example: +// title = ezxml_get(library, "shelf", 0, "book", 2, "title", -1); +// This retrieves the title of the 3rd book on the 1st shelf of library. +// Returns NULL if not found. +ezxml_t ezxml_get(ezxml_t xml, ...); + +// Converts an ezxml structure back to xml. Returns a string of xml data that +// must be freed. +char *ezxml_toxml(ezxml_t xml); + +// returns a NULL terminated array of processing instructions for the given +// target +const char **ezxml_pi(ezxml_t xml, const char *target); + +// frees the memory allocated for an ezxml structure +void ezxml_free(ezxml_t xml); + +// returns parser error message or empty string if none +const char *ezxml_error(ezxml_t xml); + +// returns a new empty ezxml structure with the given root tag name +ezxml_t ezxml_new(const char *name); + +// wrapper for ezxml_new() that strdup()s name +#define ezxml_new_d(name) ezxml_set_flag(ezxml_new(strdup(name)), EZXML_NAMEM) + +// Adds a child tag. off is the offset of the child tag relative to the start +// of the parent tag's character content. Returns the child tag. +ezxml_t ezxml_add_child(ezxml_t xml, const char *name, size_t off); + +// wrapper for ezxml_add_child() that strdup()s name +#define ezxml_add_child_d(xml, name, off) \ + ezxml_set_flag(ezxml_add_child(xml, strdup(name), off), EZXML_NAMEM) + +// sets the character content for the given tag and returns the tag +ezxml_t ezxml_set_txt(ezxml_t xml, const char *txt); + +// wrapper for ezxml_set_txt() that strdup()s txt +#define ezxml_set_txt_d(xml, txt) \ + ezxml_set_flag(ezxml_set_txt(xml, strdup(txt)), EZXML_TXTM) + +// Sets the given tag attribute or adds a new attribute if not found. A value +// of NULL will remove the specified attribute. Returns the tag given. +ezxml_t ezxml_set_attr(ezxml_t xml, const char *name, const char *value); + +// Wrapper for ezxml_set_attr() that strdup()s name/value. Value cannot be NULL +#define ezxml_set_attr_d(xml, name, value) \ + ezxml_set_attr(ezxml_set_flag(xml, EZXML_DUP), strdup(name), strdup(value)) + +// sets a flag for the given tag and returns the tag +ezxml_t ezxml_set_flag(ezxml_t xml, short flag); + +// removes a tag along with its subtags without freeing its memory +ezxml_t ezxml_cut(ezxml_t xml); + +// inserts an existing tag into an ezxml structure +ezxml_t ezxml_insert(ezxml_t xml, ezxml_t dest, size_t off); + +// Moves an existing tag to become a subtag of dest at the given offset from +// the start of dest's character content. Returns the moved tag. +#define ezxml_move(xml, dest, off) ezxml_insert(ezxml_cut(xml), dest, off) + +// removes a tag along with all its subtags +#define ezxml_remove(xml) ezxml_free(ezxml_cut(xml)) + +#ifdef __cplusplus +} +#endif + +#endif // _EZXML_H From e60dd7edb89b90affc3f0b6abbabf0b43be0d0cc Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 2 May 2025 16:50:25 +0100 Subject: [PATCH 043/192] [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. --- .vs/rufus.vcxproj | 2 + .vs/rufus.vcxproj.filters | 6 ++ src/Makefile.am | 2 +- src/Makefile.in | 11 ++- src/license.h | 4 + src/msapi_utf8.h | 10 +-- src/rufus.rc | 10 +-- src/wue.c | 77 ++++++++++------ src/xml.c | 180 +++++++++++++++++++++++++------------- src/xml.h | 7 ++ 10 files changed, 209 insertions(+), 100 deletions(-) diff --git a/.vs/rufus.vcxproj b/.vs/rufus.vcxproj index 99adc9f0..f1047b25 100644 --- a/.vs/rufus.vcxproj +++ b/.vs/rufus.vcxproj @@ -410,6 +410,7 @@ <ClCompile Include="..\src\ui.c" /> <ClCompile Include="..\src\vhd.c" /> <ClCompile Include="..\src\wue.c" /> + <ClCompile Include="..\src\xml.c" /> </ItemGroup> <ItemGroup> <ClInclude Include="..\res\grub2\grub2_version.h" /> @@ -446,6 +447,7 @@ <ClInclude Include="..\src\vhd.h" /> <ClInclude Include="..\src\winio.h" /> <ClInclude Include="..\src\wue.h" /> + <ClInclude Include="..\src\xml.h" /> </ItemGroup> <ItemGroup> <Manifest Include="..\src\rufus.manifest" /> diff --git a/.vs/rufus.vcxproj.filters b/.vs/rufus.vcxproj.filters index cd02009c..7a980a63 100644 --- a/.vs/rufus.vcxproj.filters +++ b/.vs/rufus.vcxproj.filters @@ -93,6 +93,9 @@ <ClCompile Include="..\src\wue.c"> <Filter>Source Files</Filter> </ClCompile> + <ClCompile Include="..\src\xml.c"> + <Filter>Source Files</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\src\rufus.h"> @@ -197,6 +200,9 @@ <ClInclude Include="..\src\msvc-missing\unistd.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="..\src\xml.h"> + <Filter>Header Files</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <None Include="..\res\rufus.ico"> diff --git a/src/Makefile.am b/src/Makefile.am index 59cf87f7..ab03cd2b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,7 +18,7 @@ AM_V_WINDRES = $(AM_V_WINDRES_$(V)) $(AM_V_WINDRES) $(AM_RCFLAGS) -i $< -o $@ rufus_SOURCES = badblocks.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ - localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c + localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c xml.c rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/../res $(AM_CFLAGS) \ -DEXT2_FLAT_INCLUDES=0 -DSOLUTION=rufus rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows -L $(srcdir)/../.mingw diff --git a/src/Makefile.in b/src/Makefile.in index c0fa14e6..5f27da84 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -98,7 +98,8 @@ am_rufus_OBJECTS = rufus-badblocks.$(OBJEXT) rufus-dev.$(OBJEXT) \ rufus-rufus.$(OBJEXT) rufus-smart.$(OBJEXT) \ rufus-stdfn.$(OBJEXT) rufus-stdio.$(OBJEXT) \ rufus-stdlg.$(OBJEXT) rufus-syslinux.$(OBJEXT) \ - rufus-ui.$(OBJEXT) rufus-vhd.$(OBJEXT) rufus-wue.$(OBJEXT) + rufus-ui.$(OBJEXT) rufus-vhd.$(OBJEXT) rufus-wue.$(OBJEXT) \ + rufus-xml.$(OBJEXT) rufus_OBJECTS = $(am_rufus_OBJECTS) am__DEPENDENCIES_1 = rufus_DEPENDENCIES = rufus_rc.o bled/libbled.a ext2fs/libext2fs.a \ @@ -285,7 +286,7 @@ AM_V_WINDRES_1 = $(WINDRES) AM_V_WINDRES_ = $(AM_V_WINDRES_$(AM_DEFAULT_VERBOSITY)) AM_V_WINDRES = $(AM_V_WINDRES_$(V)) rufus_SOURCES = badblocks.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ - localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c + localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c xml.c rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/../res $(AM_CFLAGS) \ -DEXT2_FLAT_INCLUDES=0 -DSOLUTION=rufus @@ -504,6 +505,12 @@ rufus-wue.o: wue.c rufus-wue.obj: wue.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-wue.obj `if test -f 'wue.c'; then $(CYGPATH_W) 'wue.c'; else $(CYGPATH_W) '$(srcdir)/wue.c'; fi` +rufus-xml.o: xml.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-xml.o `test -f 'xml.c' || echo '$(srcdir)/'`xml.c + +rufus-xml.obj: xml.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-xml.obj `if test -f 'xml.c'; then $(CYGPATH_W) 'xml.c'; else $(CYGPATH_W) '$(srcdir)/xml.c'; fi` + # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, diff --git a/src/license.h b/src/license.h index 9a59e9f5..a14d7131 100644 --- a/src/license.h +++ b/src/license.h @@ -81,6 +81,10 @@ const char* additional_copyrights = "http://www.ridgecrop.demon.co.uk/index.htm?fat32format.htm\\line\n" "GNU General Public License (GPL) v2 or later\\line\n" "\\line\n" +"XML parsing support from ezxml by Aaron Voisine:\\line\n" +"https://ezxml.sourceforge.net/\\line\n" +"MIT license\\line\n" +"\\line\n" "fmifs.dll usage based on Formatx by Mark Russinovich:\\line\n" "https://svn.reactos.org/reactos/trunk/reactos/dll/win32/fmifs\\line\n" "Public Domain\\line\n" diff --git a/src/msapi_utf8.h b/src/msapi_utf8.h index e6ab9ad2..3daef720 100644 --- a/src/msapi_utf8.h +++ b/src/msapi_utf8.h @@ -55,9 +55,9 @@ extern "C" { #define LTEXT(txt) _LTEXT(txt) #define wchar_to_utf8_no_alloc(wsrc, dest, dest_size) \ - WideCharToMultiByte(CP_UTF8, 0, wsrc, -1, dest, dest_size, NULL, NULL) + WideCharToMultiByte(CP_UTF8, 0, wsrc, -1, dest, (int)(dest_size), NULL, NULL) #define utf8_to_wchar_no_alloc(src, wdest, wdest_size) \ - MultiByteToWideChar(CP_UTF8, 0, src, -1, wdest, wdest_size) + MultiByteToWideChar(CP_UTF8, 0, src, -1, wdest, (int)(wdest_size)) #define Edit_ReplaceSelU(hCtrl, str) ((void)SendMessageLU(hCtrl, EM_REPLACESEL, (WPARAM)FALSE, str)) #define ComboBox_AddStringU(hCtrl, str) ((int)(DWORD)SendMessageLU(hCtrl, CB_ADDSTRING, (WPARAM)FALSE, str)) #define ComboBox_InsertStringU(hCtrl, index, str) ((int)(DWORD)SendMessageLU(hCtrl, CB_INSERTSTRING, (WPARAM)index, str)) @@ -83,7 +83,7 @@ extern "C" { #define wfree(p) sfree(w ## p) /* - * Converts an UTF-16 string to UTF8 (allocate returned string) + * Converts an UTF-16 string to UTF8 (allocates returned string) * Returns NULL on error */ static __inline char* wchar_to_utf8(const wchar_t* wstr) @@ -115,7 +115,7 @@ static __inline char* wchar_to_utf8(const wchar_t* wstr) } /* - * Converts an UTF8 string to UTF-16 (allocate returned string) + * Converts an UTF8 string to UTF-16 (allocates returned string) * Returns NULL on error */ static __inline wchar_t* utf8_to_wchar(const char* str) @@ -146,7 +146,7 @@ static __inline wchar_t* utf8_to_wchar(const char* str) } /* -* Converts an non NUL-terminated UTF-16 string of length len to UTF8 (allocate returned string) +* Converts a non NUL-terminated UTF-16 string of length wlen to NUL-terminated UTF8 (allocates returned string) * Returns NULL on error */ static __inline char* wchar_len_to_utf8(const wchar_t* wstr, int wlen) diff --git a/src/rufus.rc b/src/rufus.rc index 53a60431..86fd5f39 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.8.2233" +CAPTION "Rufus 4.8.2234" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2233,0 - PRODUCTVERSION 4,8,2233,0 + FILEVERSION 4,8,2234,0 + PRODUCTVERSION 4,8,2234,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2233" + VALUE "FileVersion", "4.8.2234" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2233" + VALUE "ProductVersion", "4.8.2234" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index 8281a6f4..c2815abf 100644 --- a/src/wue.c +++ b/src/wue.c @@ -25,6 +25,7 @@ #include "rufus.h" #include "vhd.h" +#include "xml.h" #include "drive.h" #include "format.h" #include "missing.h" @@ -418,24 +419,24 @@ out: /// <summary> /// Populate the img_report Window version from an install[.wim|.esd] XML index /// </summary> -/// <param name="xml_file">The path of the extracted index XML.</param> +/// <param name="xml">The index XML data.</param> +/// <param name="xml_len">The length of the index XML data.</param> /// <param name="index">The index of the occurrence to look for.</param> -static void PopulateWindowsVersionFromXml(const char* xml_file, int index) +static void PopulateWindowsVersionFromXml(const char* xml, size_t xml_len, int index) { char* val; + ezxml_t pxml = ezxml_parse_str((char*)xml, xml_len); + if (pxml == NULL) + return; - val = get_token_data_file_indexed("MAJOR", xml_file, index); + val = ezxml_get_val(pxml, "IMAGE", index, "WINDOWS", 0, "VERSION", 0, "MAJOR", -1); img_report.win_version.major = (uint16_t)safe_atoi(val); - free(val); - val = get_token_data_file_indexed("MINOR", xml_file, index); + val = ezxml_get_val(pxml, "IMAGE", index, "WINDOWS", 0, "VERSION", 0, "MINOR", -1); img_report.win_version.minor = (uint16_t)safe_atoi(val); - free(val); - val = get_token_data_file_indexed("BUILD", xml_file, index); + val = ezxml_get_val(pxml, "IMAGE", index, "WINDOWS", 0, "VERSION", 0, "BUILD", -1); img_report.win_version.build = (uint16_t)safe_atoi(val); - free(val); - val = get_token_data_file_indexed("SPBUILD", xml_file, index); + val = ezxml_get_val(pxml, "IMAGE", index, "WINDOWS", 0, "VERSION", 0, "SPBUILD", -1); img_report.win_version.revision = (uint16_t)safe_atoi(val); - free(val); // Adjust versions so that we produce a more accurate report in the log // (and yeah, I know we won't properly report Server, but I don't care) if (img_report.win_version.major <= 5) { @@ -463,10 +464,11 @@ static void PopulateWindowsVersionFromXml(const char* xml_file, int index) if (img_report.win_version.build > 20000) img_report.win_version.major = 11; } + ezxml_free(pxml); } /// <summary> -/// Populate the img_report Window version from an an install[.wim|.esd], mounting the +/// Populate the img_report Window version from an install[.wim|.esd]. /// ISO if needed. Requires Windows 8 or later. /// </summary> /// <param name="">(none)</param> @@ -474,7 +476,8 @@ static void PopulateWindowsVersionFromXml(const char* xml_file, int index) BOOL PopulateWindowsVersion(void) { char *mounted_iso, mounted_image_path[128]; - char xml_file[MAX_PATH] = ""; + char xml_file[MAX_PATH] = "", *xml; + size_t xml_len; memset(&img_report.win_version, 0, sizeof(img_report.win_version)); @@ -506,7 +509,12 @@ BOOL PopulateWindowsVersion(void) goto out; } - PopulateWindowsVersionFromXml(xml_file, 1); + xml_len = read_file(xml_file, (uint8_t**)&xml); + if (xml_len == 0) { + uprintf("Could not read WIM index XML"); + goto out; + } + PopulateWindowsVersionFromXml(xml, xml_len, 1); out: DeleteFileU(xml_file); @@ -549,12 +557,14 @@ BOOL CopySKUSiPolicy(const char* drive_name) /// <returns>-2 on user cancel, -1 on other error, >=0 on success.</returns> int SetWinToGoIndex(void) { - char* mounted_iso, mounted_image_path[128]; - char xml_file[MAX_PATH] = ""; - char* install_names[MAX_WININST]; - StrArray version_name, version_index; int i; + char* mounted_iso, mounted_image_path[128]; + char* install_names[MAX_WININST]; + char xml_file[MAX_PATH] = "", *xml = NULL; + size_t xml_len; + StrArray version_name, version_index; BOOL bNonStandard = FALSE; + ezxml_t index = NULL, image = NULL; // Sanity checks wintogo_index = -1; @@ -600,22 +610,31 @@ int SetWinToGoIndex(void) goto out; } + xml_len = read_file(xml_file, (uint8_t**)&xml); + if (xml_len == 0) { + uprintf("Could not read WIM XML"); + goto out; + } + StrArrayCreate(&version_name, 16); StrArrayCreate(&version_index, 16); - for (i = 0; StrArrayAdd(&version_index, get_token_data_file_indexed("IMAGE INDEX", xml_file, i + 1), FALSE) >= 0; i++) { + index = ezxml_parse_str((char*)xml, xml_len); + if (index == NULL) { + uprintf("Could not parse WIM XML"); + goto out; + } + + for (i = 0, image = ezxml_child(index, "IMAGE"); + StrArrayAdd(&version_index, ezxml_attr(image, "INDEX"), TRUE) >= 0; + image = image->next, i++) { // Some people are apparently creating *unofficial* Windows ISOs that don't have DISPLAYNAME elements. - // If we are parsing such an ISO, try to fall back to using DESCRIPTION. Of course, since we don't use - // a formal XML parser, if an ISO mixes entries with both DISPLAYNAME and DESCRIPTION and others with - // only DESCRIPTION, the version names we report will be wrong. - // But hey, there's only so far I'm willing to go to help people who, not content to have demonstrated - // their utter ignorance on development matters, are also trying to lecture experienced developers - // about specific "noob mistakes"... that don't exist in the code they are trying to criticize. - if (StrArrayAdd(&version_name, get_token_data_file_indexed("DISPLAYNAME", xml_file, i + 1), FALSE) < 0) { - bNonStandard = TRUE; - if (StrArrayAdd(&version_name, get_token_data_file_indexed("DESCRIPTION", xml_file, i + 1), FALSE) < 0) { + // If we are parsing such an ISO, try to fall back to using DESCRIPTION. + if (StrArrayAdd(&version_name, ezxml_child_val(image, "DISPLAYNAME"), TRUE) < 0) { + if (StrArrayAdd(&version_name, ezxml_child_val(image, "DESCRIPTION"), TRUE) < 0) { uprintf("Warning: Could not find a description for image index %d", i + 1); StrArrayAdd(&version_name, "Unknown Windows Version", TRUE); } + bNonStandard = TRUE; } } if (bNonStandard) @@ -632,7 +651,7 @@ int SetWinToGoIndex(void) wintogo_index = atoi(version_index.String[i - 1]); if (i > 0) { // re-populate the version data from the selected XML index - PopulateWindowsVersionFromXml(xml_file, i); + PopulateWindowsVersionFromXml(xml, xml_len, i); // If we couldn't obtain the major and build, we have a problem if (img_report.win_version.major == 0 || img_report.win_version.build == 0) uprintf("Warning: Could not obtain version information from XML index (Nonstandard Windows image?)"); @@ -656,6 +675,8 @@ int SetWinToGoIndex(void) StrArrayDestroy(&version_index); out: + ezxml_free(index); + free(xml); DeleteFileU(xml_file); if (!img_report.is_windows_img) VhdUnmountImage(); diff --git a/src/xml.c b/src/xml.c index 82b11fb9..b344bb73 100644 --- a/src/xml.c +++ b/src/xml.c @@ -24,20 +24,31 @@ #include <stdlib.h> #include <stdio.h> +#include <stdint.h> #include <stdarg.h> #include <string.h> #include <ctype.h> #include <unistd.h> #include <sys/types.h> -#ifndef EZXML_NOMMAP -#include <sys/mman.h> -#endif // EZXML_NOMMAP #include <sys/stat.h> -#include "ezxml.h" +#include "xml.h" +#include "rufus.h" +#include "msapi_utf8.h" +/* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */ +#ifdef _CRTDBG_MAP_ALLOC +#include <stdlib.h> +#include <crtdbg.h> +#endif + +#define EZXML_NOMMAP #define EZXML_WS "\t\r\n " // whitespace -#define EZXML_ERRL 128 // maximum error string length +#define EZXML_ERRL 256 // maximum error string length +#ifdef _MSC_VER +#pragma warning(disable:6011) +#pragma warning(disable:4267) +#endif typedef struct ezxml_root *ezxml_root_t; struct ezxml_root { // additional data for the root tag struct ezxml xml; // is a super-struct built on top of ezxml struct @@ -56,6 +67,15 @@ struct ezxml_root { // additional data for the root tag char *EZXML_NIL[] = { NULL }; // empty, null terminated array of strings +// what realloc should be doing all along +static inline void* _realloc(void* ptr, unsigned int size) { + void* old_ptr = ptr; + ptr = realloc(ptr, size); + if (ptr == NULL) + free(old_ptr); + return ptr; +} + // returns the first child tag with the given name or NULL if not found ezxml_t ezxml_child(ezxml_t xml, const char *name) { @@ -64,6 +84,14 @@ ezxml_t ezxml_child(ezxml_t xml, const char *name) return xml; } +// returns the value of the first child tag with the given name or NULL if not found +char* ezxml_child_val(ezxml_t xml, const char* name) +{ + xml = (xml) ? xml->child : NULL; + while (xml && strcmp(name, xml->name)) xml = xml->sibling; + return xml ? xml->txt : NULL; +} + // returns the Nth tag with the same name in the same subsection or NULL if not // found ezxml_t ezxml_idx(ezxml_t xml, int idx) @@ -119,6 +147,19 @@ ezxml_t ezxml_get(ezxml_t xml, ...) return r; } +// Same as above but returns the text value or NULL if not found +char* ezxml_get_val(ezxml_t xml, ...) +{ + va_list ap; + ezxml_t r; + + va_start(ap, xml); + r = ezxml_vget(xml, ap); + va_end(ap); + return r ? r->txt : NULL; +} + + // returns a null terminated array of processing instructions for the given // target const char **ezxml_pi(ezxml_t xml, const char *target) @@ -138,13 +179,14 @@ ezxml_t ezxml_err(ezxml_root_t root, char *s, const char *err, ...) va_list ap; int line = 1; char *t, fmt[EZXML_ERRL]; - + for (t = root->s; t < s; t++) if (*t == '\n') line++; - snprintf(fmt, EZXML_ERRL, "[error near line %d]: %s", line, err); + snprintf(fmt, EZXML_ERRL, "xml parsing error near line %d: %s", line, err); va_start(ap, err); vsnprintf(root->err, EZXML_ERRL, fmt, ap); va_end(ap); + uprintf("%s", root->err); return &root->xml; } @@ -168,7 +210,7 @@ char *ezxml_decode(char *s, char **ent, char t) } for (s = r; ; ) { - while (*s && *s != '&' && (*s != '%' || t != '%') && !isspace(*s)) s++; + while (*s && *s != '&' && (*s != '%' || t != '%') && !isspace((uint8_t)*s)) s++; if (! *s) break; else if (t != 'c' && ! strncmp(s, "&#", 2)) { // character reference @@ -176,11 +218,13 @@ char *ezxml_decode(char *s, char **ent, char t) else c = strtol(s + 2, &e, 10); // base 10 if (! c || *e != ';') { s++; continue; } // not a character ref - if (c < 0x80) *(s++) = c; // US-ASCII subset + if (c < 0x80) *(s++) = (char)c; // US-ASCII subset else { // multi-byte UTF-8 sequence for (b = 0, d = c; d; d /= 2) b++; // number of bits in c + // UTF-8 can ecode max 36 bits (standard says 21) - noop on 32 bit. + if (b > 36) { s++; continue; } b = (b - 2) / 5; // number of bytes in payload - *(s++) = (0xFF << (7 - b)) | (c >> (6 * b)); // head + *(s++) = (char)(0xFF << (7 - b)) | (char)(c >> (6 * b)); // head while (b) *(s++) = 0x80 | ((c >> (6 * --b)) & 0x3F); // payload } @@ -192,24 +236,24 @@ char *ezxml_decode(char *s, char **ent, char t) b += 2); // find entity in entity list if (ent[b++]) { // found a match - if ((c = strlen(ent[b])) - 1 > (e = strchr(s, ';')) - s) { - l = (d = (s - r)) + c + strlen(e); // new length - r = (r == m) ? strcpy(malloc(l), r) : realloc(r, l); + if ((c = (long)strlen(ent[b])) - 1 > (e = strchr(s, ';')) - s) { + l = (d = (long)(s - r)) + c + (long)strlen(e); // new length + r = (r == m) ? strcpy(malloc(l), r) : _realloc(r, l); e = strchr((s = r + d), ';'); // fix up pointers } memmove(s + c, e + 1, strlen(e)); // shift rest of string - strncpy(s, ent[b], c); // copy in replacement text + strncpy_s(s, c, ent[b], _TRUNCATE); // copy in replacement text } else s++; // not a known entity } - else if ((t == ' ' || t == '*') && isspace(*s)) *(s++) = ' '; + else if ((t == ' ' || t == '*') && isspace((uint8_t)*s)) *(s++) = ' '; else s++; // no decoding needed } if (t == '*') { // normalize spaces for non-cdata attributes for (s = r; *s; s++) { - if ((l = strspn(s, " "))) memmove(s, s + l, strlen(s + l) + 1); + if ((l = (long)strspn(s, " "))) memmove(s, s + l, strlen(s + l) + 1); while (*s && *s != ' ') s++; } if (--s >= r && *s == ' ') *s = '\0'; // trim any trailing space @@ -300,16 +344,16 @@ void ezxml_proc_inst(ezxml_root_t root, char *s, size_t len) while (root->pi[i] && strcmp(target, root->pi[i][0])) i++; // find target if (! root->pi[i]) { // new target - root->pi = realloc(root->pi, sizeof(char **) * (i + 2)); + root->pi = _realloc(root->pi, sizeof(char **) * (i + 2)); root->pi[i] = malloc(sizeof(char *) * 3); root->pi[i][0] = target; root->pi[i][1] = (char *)(root->pi[i + 1] = NULL); // terminate pi list - root->pi[i][2] = strdup(""); // empty document position list + root->pi[i][2] = _strdup(""); // empty document position list } while (root->pi[i][j]) j++; // find end of instruction list for this target - root->pi[i] = realloc(root->pi[i], sizeof(char *) * (j + 3)); - root->pi[i][j + 2] = realloc(root->pi[i][j + 1], j + 1); + root->pi[i] = _realloc(root->pi[i], sizeof(char *) * (j + 3)); + root->pi[i][j + 2] = _realloc(root->pi[i][j + 1], j + 1); strcpy(root->pi[i][j + 2] + j - 1, (root->xml.name) ? ">" : "<"); root->pi[i][j + 1] = NULL; // null terminate pi list for this target root->pi[i][j] = s; // set instruction @@ -320,6 +364,7 @@ short ezxml_internal_dtd(ezxml_root_t root, char *s, size_t len) { char q, *c, *t, *n = NULL, *v, **ent, **pe; int i, j; + size_t n_len, n_off; pe = memcpy(malloc(sizeof(EZXML_NIL)), EZXML_NIL, sizeof(EZXML_NIL)); @@ -330,7 +375,13 @@ short ezxml_internal_dtd(ezxml_root_t root, char *s, size_t len) else if (! strncmp(s, "<!ENTITY", 8)) { // parse entity definitions c = s += strspn(s + 8, EZXML_WS) + 8; // skip white space separator n = s + strspn(s, EZXML_WS "%"); // find name - *(s = n + strcspn(n, EZXML_WS)) = ';'; // append ; to name + n_len = strlen(n); + n_off = strcspn(n, EZXML_WS); + if(n_off >= n_len) { + ezxml_err(root, NULL, "write past buffer (<!ENTITY)"); + break; + } + *(s = n + n_off) = ';'; // append ; to name v = s + strspn(s + 1, EZXML_WS) + 1; // find value if ((q = *(v++)) != '"' && q != '\'') { // skip externals @@ -339,7 +390,7 @@ short ezxml_internal_dtd(ezxml_root_t root, char *s, size_t len) } for (i = 0, ent = (*c == '%') ? pe : root->ent; ent[i]; i++); - ent = realloc(ent, (i + 3) * sizeof(char *)); // space for next ent + ent = _realloc(ent, (i + 3) * sizeof(char *)); // space for next ent if (*c == '%') pe = ent; else root->ent = ent; @@ -359,9 +410,10 @@ short ezxml_internal_dtd(ezxml_root_t root, char *s, size_t len) if (! *t) { ezxml_err(root, t, "unclosed <!ATTLIST"); break; } if (*(s = t + strcspn(t, EZXML_WS ">")) == '>') continue; else *s = '\0'; // null terminate tag name - for (i = 0; root->attr[i] && strcmp(n, root->attr[i][0]); i++); + for (i = 0; n && root->attr[i] && strcmp(n, root->attr[i][0]); i++); - while (*(n = ++s + strspn(s, EZXML_WS)) && *n != '>') { + ++s; + while (*(n = s + strspn(s, EZXML_WS)) && *n != '>') { if (*(s = n + strcspn(n, EZXML_WS))) *s = '\0'; // attr name else { ezxml_err(root, t, "malformed <!ATTLIST"); break; } @@ -386,7 +438,7 @@ short ezxml_internal_dtd(ezxml_root_t root, char *s, size_t len) if (! root->attr[i]) { // new tag name root->attr = (! i) ? malloc(2 * sizeof(char **)) - : realloc(root->attr, + : _realloc(root->attr, (i + 2) * sizeof(char **)); root->attr[i] = malloc(2 * sizeof(char *)); root->attr[i][0] = t; // set tag name @@ -394,7 +446,7 @@ short ezxml_internal_dtd(ezxml_root_t root, char *s, size_t len) } for (j = 1; root->attr[i][j]; j += 3); // find end of list - root->attr[i] = realloc(root->attr[i], + root->attr[i] = _realloc(root->attr[i], (j + 4) * sizeof(char *)); root->attr[i][j + 3] = NULL; // null terminate list @@ -438,23 +490,23 @@ char *ezxml_str2utf8(char **s, size_t *len) c = (((c & 0x3FF) << 10) | (d & 0x3FF)) + 0x10000; } - while (l + 6 > max) u = realloc(u, max += EZXML_BUFSIZE); - if (c < 0x80) u[l++] = c; // US-ASCII subset + while (l + 6 > max) u = _realloc(u, max += EZXML_BUFSIZE); + if (c < 0x80) u[l++] = (char)c; // US-ASCII subset else { // multi-byte UTF-8 sequence for (b = 0, d = c; d; d /= 2) b++; // bits in c b = (b - 2) / 5; // bytes in payload - u[l++] = (0xFF << (7 - b)) | (c >> (6 * b)); // head + u[l++] = (char)(0xFF << (7 - b)) | (char)(c >> (6 * b)); // head while (b) u[l++] = 0x80 | ((c >> (6 * --b)) & 0x3F); // payload } } - return *s = realloc(u, *len = l); + return *s = _realloc(u, *len = l); } // frees a tag attribute list void ezxml_free_attr(char **attr) { int i = 0; char *m; - + if (! attr || attr == EZXML_NIL) return; // nothing to free while (attr[i]) i += 2; // find end of attribute list m = attr[i + 1]; // list of which names and values are malloced @@ -473,6 +525,7 @@ ezxml_t ezxml_parse_str(char *s, size_t len) char q, e, *d, **attr, **a = NULL; // initialize a to avoid compile warning int l, i, j; + if (!root) return NULL; root->m = s; if (! len) return ezxml_err(root, NULL, "root tag missing"); root->u = ezxml_str2utf8(&s, &len); // convert utf-16 to utf-8 @@ -493,7 +546,7 @@ ezxml_t ezxml_parse_str(char *s, size_t len) return ezxml_err(root, d, "markup outside of root element"); s += strcspn(s, EZXML_WS "/>"); - while (isspace(*s)) *(s++) = '\0'; // null terminate tag name + while (isspace((uint8_t)*s)) *(s++) = '\0'; // null terminate tag name if (*s && *s != '/' && *s != '>') // find tag in default attr list for (i = 0; (a = root->attr[i]) && strcmp(a[0], d); i++); @@ -509,7 +562,7 @@ ezxml_t ezxml_parse_str(char *s, size_t len) attr[l] = s; // set attribute name s += strcspn(s, EZXML_WS "=/>"); - if (*s == '=' || isspace(*s)) { + if (*s == '=' || isspace((uint8_t)*s)) { *(s++) = '\0'; // null terminate tag attribute name q = *(s += strspn(s, EZXML_WS "=")); if (q == '"' || q == '\'') { // attribute value @@ -528,7 +581,7 @@ ezxml_t ezxml_parse_str(char *s, size_t len) attr[l + 3][l / 2] = EZXML_TXTM; // value malloced } } - while (isspace(*s)) s++; + while (isspace((uint8_t)*s)) s++; } if (*s == '/') { // self closing tag @@ -555,7 +608,7 @@ ezxml_t ezxml_parse_str(char *s, size_t len) if (! (q = *s) && e != '>') return ezxml_err(root, d, "missing >"); *s = '\0'; // temporarily null terminate tag name if (ezxml_close_tag(root, d, s)) return &root->xml; - if (isspace(*s = q)) s += strspn(s, EZXML_WS); + if (isspace((uint8_t)(*s = q))) s += strspn(s, EZXML_WS); } else if (! strncmp(s, "!--", 3)) { // xml comment if (! (s = strstr(s + 3, "--")) || (*(s += 2) != '>' && *s) || @@ -611,11 +664,11 @@ ezxml_t ezxml_parse_fp(FILE *fp) if (! (s = malloc(EZXML_BUFSIZE))) return NULL; do { len += (l = fread((s + len), 1, EZXML_BUFSIZE, fp)); - if (l == EZXML_BUFSIZE) s = realloc(s, len + EZXML_BUFSIZE); + if (l == EZXML_BUFSIZE) s = _realloc(s, len + EZXML_BUFSIZE); } while (s && l == EZXML_BUFSIZE); if (! s) return NULL; - root = (ezxml_root_t)ezxml_parse_str(s, len); + if (!(root = (ezxml_root_t)ezxml_parse_str(s, len))) { free(s); return NULL; }; root->len = -1; // so we know to free s in ezxml_free() return &root->xml; } @@ -639,12 +692,14 @@ ezxml_t ezxml_parse_fd(int fd) MAP_FAILED) { madvise(m, l, MADV_SEQUENTIAL); // optimize for sequential access root = (ezxml_root_t)ezxml_parse_str(m, st.st_size); + if (!root) { munmap(m,l); return NULL; }; madvise(m, root->len = l, MADV_NORMAL); // put it back to normal } else { // mmap failed, read file into memory #endif // EZXML_NOMMAP - l = read(fd, m = malloc(st.st_size), st.st_size); + l = (long)_read(fd, m = malloc((size_t)st.st_size), (unsigned int)st.st_size); root = (ezxml_root_t)ezxml_parse_str(m, l); + if (!root) { free(m); return NULL; }; root->len = -1; // so we know to free s in ezxml_free() #ifndef EZXML_NOMMAP } @@ -655,10 +710,10 @@ ezxml_t ezxml_parse_fd(int fd) // a wrapper for ezxml_parse_fd that accepts a file name ezxml_t ezxml_parse_file(const char *file) { - int fd = open(file, O_RDONLY, 0); + int fd = _openU(file, O_RDONLY, 0); ezxml_t xml = ezxml_parse_fd(fd); - if (fd >= 0) close(fd); + if (fd >= 0) _close(fd); return xml; } @@ -670,7 +725,7 @@ char *ezxml_ampencode(const char *s, size_t len, char **dst, size_t *dlen, const char *e; for (e = s + len; s != e; s++) { - while (*dlen + 10 > *max) *dst = realloc(*dst, *max += EZXML_BUFSIZE); + while (*dlen + 10 > *max) *dst = _realloc(*dst, *max += EZXML_BUFSIZE); switch (*s) { case '\0': return *dst; @@ -701,13 +756,13 @@ char *ezxml_toxml_r(ezxml_t xml, char **s, size_t *len, size_t *max, *s = ezxml_ampencode(txt + start, xml->off - start, s, len, max, 0); while (*len + strlen(xml->name) + 4 > *max) // reallocate s - *s = realloc(*s, *max += EZXML_BUFSIZE); + *s = _realloc(*s, *max += EZXML_BUFSIZE); *len += sprintf(*s + *len, "<%s", xml->name); // open tag for (i = 0; xml->attr[i]; i += 2) { // tag attributes if (ezxml_attr(xml, xml->attr[i]) != xml->attr[i + 1]) continue; while (*len + strlen(xml->attr[i]) + 7 > *max) // reallocate s - *s = realloc(*s, *max += EZXML_BUFSIZE); + *s = _realloc(*s, *max += EZXML_BUFSIZE); *len += sprintf(*s + *len, " %s=\"", xml->attr[i]); ezxml_ampencode(xml->attr[i + 1], -1, s, len, max, 1); @@ -719,7 +774,7 @@ char *ezxml_toxml_r(ezxml_t xml, char **s, size_t *len, size_t *max, if (! attr[i][j + 1] || ezxml_attr(xml, attr[i][j]) != attr[i][j + 1]) continue; // skip duplicates and non-values while (*len + strlen(attr[i][j]) + 7 > *max) // reallocate s - *s = realloc(*s, *max += EZXML_BUFSIZE); + *s = _realloc(*s, *max += EZXML_BUFSIZE); *len += sprintf(*s + *len, " %s=\"", attr[i][j]); ezxml_ampencode(attr[i][j + 1], -1, s, len, max, 1); @@ -731,7 +786,7 @@ char *ezxml_toxml_r(ezxml_t xml, char **s, size_t *len, size_t *max, : ezxml_ampencode(xml->txt, -1, s, len, max, 0); //data while (*len + strlen(xml->name) + 4 > *max) // reallocate s - *s = realloc(*s, *max += EZXML_BUFSIZE); + *s = _realloc(*s, *max += EZXML_BUFSIZE); *len += sprintf(*s + *len, "</%s>", xml->name); // close tag @@ -747,10 +802,12 @@ char *ezxml_toxml(ezxml_t xml) ezxml_t p = (xml) ? xml->parent : NULL, o = (xml) ? xml->ordered : NULL; ezxml_root_t root = (ezxml_root_t)xml; size_t len = 0, max = EZXML_BUFSIZE; - char *s = strcpy(malloc(max), ""), *t, *n; + char *s = malloc(max), *t, *n; int i, j, k; - if (! xml || ! xml->name) return realloc(s, len + 1); + if (!s) return (NULL); + s = strcpy(s, ""); + if (! xml || ! xml->name) return _realloc(s, len + 1); while (root->xml.parent) root = (ezxml_root_t)root->xml.parent; // root tag for (i = 0; ! p && root->pi[i]; i++) { // pre-root processing instructions @@ -758,7 +815,7 @@ char *ezxml_toxml(ezxml_t xml) for (j = 1; (n = root->pi[i][j]); j++) { if (root->pi[i][k][j - 1] == '>') continue; // not pre-root while (len + strlen(t = root->pi[i][0]) + strlen(n) + 7 > max) - s = realloc(s, max += EZXML_BUFSIZE); + s = _realloc(s, max += EZXML_BUFSIZE); len += sprintf(s + len, "<?%s%s%s?>\n", t, *n ? " " : "", n); } } @@ -773,11 +830,11 @@ char *ezxml_toxml(ezxml_t xml) for (j = 1; (n = root->pi[i][j]); j++) { if (root->pi[i][k][j - 1] == '<') continue; // not post-root while (len + strlen(t = root->pi[i][0]) + strlen(n) + 7 > max) - s = realloc(s, max += EZXML_BUFSIZE); + s = _realloc(s, max += EZXML_BUFSIZE); len += sprintf(s + len, "\n<?%s%s%s?>", t, *n ? " " : "", n); } } - return realloc(s, len + 1); + return _realloc(s, len + 1); } // free the memory allocated for the ezxml structure @@ -835,12 +892,15 @@ ezxml_t ezxml_new(const char *name) { static char *ent[] = { "lt;", "&#60;", "gt;", "&#62;", "quot;", "&#34;", "apos;", "&#39;", "amp;", "&#38;", NULL }; - ezxml_root_t root = (ezxml_root_t)memset(malloc(sizeof(struct ezxml_root)), - '\0', sizeof(struct ezxml_root)); + ezxml_root_t root; + char **p_ent; + if (!(root = malloc(sizeof(struct ezxml_root)))) return NULL; + if (!(p_ent = malloc(sizeof(ent)))) { free(root); return NULL; }; + root = (ezxml_root_t)memset(root, '\0', sizeof(struct ezxml_root)); root->xml.name = (char *)name; root->cur = &root->xml; strcpy(root->err, root->xml.txt = ""); - root->ent = memcpy(malloc(sizeof(ent)), ent, sizeof(ent)); + root->ent = memcpy(p_ent, ent, sizeof(ent)); root->attr = root->pi = (char ***)(root->xml.attr = EZXML_NIL); return &root->xml; } @@ -924,15 +984,17 @@ ezxml_t ezxml_set_attr(ezxml_t xml, const char *name, const char *value) if (! xml->attr[l]) { // not found, add as new attribute if (! value) return xml; // nothing to do if (xml->attr == EZXML_NIL) { // first attribute + if (l >= 1) return NULL; xml->attr = malloc(4 * sizeof(char *)); - xml->attr[1] = strdup(""); // empty list of malloced names/vals + xml->attr[1] = _strdup(""); // empty list of malloced names/vals } - else xml->attr = realloc(xml->attr, (l + 4) * sizeof(char *)); + else xml->attr = _realloc(xml->attr, (l + 4) * sizeof(char *)); xml->attr[l] = (char *)name; // set attribute name xml->attr[l + 2] = NULL; // null terminate attribute list xml->attr[l + 3] = realloc(xml->attr[l + 1], - (c = strlen(xml->attr[l + 1])) + 2); + (c =(long)strlen(xml->attr[l + 1])) + 2); + if (!xml->attr[l + 3]) return NULL; strcpy(xml->attr[l + 3] + c, " "); // set name/value as not malloced if (xml->flags & EZXML_DUP) xml->attr[l + 3][c] = EZXML_NAMEM; } @@ -947,7 +1009,7 @@ ezxml_t ezxml_set_attr(ezxml_t xml, const char *name, const char *value) else { // remove attribute if (xml->attr[c + 1][l / 2] & EZXML_NAMEM) free(xml->attr[l]); memmove(xml->attr + l, xml->attr + l + 2, (c - l + 2) * sizeof(char*)); - xml->attr = realloc(xml->attr, (c + 2) * sizeof(char *)); + xml->attr = _realloc(xml->attr, (c + 2) * sizeof(char *)); memmove(xml->attr[c + 1] + (l / 2), xml->attr[c + 1] + (l / 2) + 1, (c / 2) - (l / 2)); // fix list of which name/vals are malloced } @@ -1006,8 +1068,8 @@ int main(int argc, char **argv) if (argc != 2) return fprintf(stderr, "usage: %s xmlfile\n", argv[0]); xml = ezxml_parse_file(argv[1]); - printf("%s\n", (s = ezxml_toxml(xml))); - free(s); + s = ezxml_toxml(xml); + if (s) { printf("%s\n", s); free(s); } i = fprintf(stderr, "%s", ezxml_error(xml)); ezxml_free(xml); return (i) ? 1 : 0; diff --git a/src/xml.h b/src/xml.h index 3e020788..1b5bf131 100644 --- a/src/xml.h +++ b/src/xml.h @@ -76,6 +76,10 @@ ezxml_t ezxml_parse_fp(FILE *fp); // if not found ezxml_t ezxml_child(ezxml_t xml, const char *name); +// returns the value of the first child tag (one level deeper) with the given +// name or NULL if not found +char* ezxml_child_val(ezxml_t xml, const char* name); + // returns the next tag of the same name in the same section and depth or NULL // if not found #define ezxml_next(xml) ((xml) ? xml->next : NULL) @@ -101,6 +105,9 @@ const char *ezxml_attr(ezxml_t xml, const char *attr); // Returns NULL if not found. ezxml_t ezxml_get(ezxml_t xml, ...); +// Same as above but returns the text value or NULL if not found +char* ezxml_get_val(ezxml_t xml, ...); + // Converts an ezxml structure back to xml. Returns a string of xml data that // must be freed. char *ezxml_toxml(ezxml_t xml); From 1ed92072b8e7d1f13ef3437044826f9089fe7a75 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 16 Apr 2025 13:05:02 +0100 Subject: [PATCH 044/192] [vhd] initial wimlib support (original sources) * From https://wimlib.net/git/?p=wimlib;a=commit;h=4a34203cde54c317f0d277a4c64e19916547bf10 --- src/rufus.rc | 10 +- src/wimlib/avl_tree.c | 801 ++++ src/wimlib/blob_table.c | 1411 +++++++ src/wimlib/compress.c | 193 + src/wimlib/compress_common.c | 671 ++++ src/wimlib/compress_parallel.c | 504 +++ src/wimlib/compress_serial.c | 149 + src/wimlib/config.h | 202 + src/wimlib/cpu_features.c | 298 ++ src/wimlib/decompress.c | 113 + src/wimlib/decompress_common.c | 342 ++ src/wimlib/dentry.c | 1908 +++++++++ src/wimlib/divsufsort.c | 1604 ++++++++ src/wimlib/encoding.c | 483 +++ src/wimlib/error.c | 349 ++ src/wimlib/export_image.c | 295 ++ src/wimlib/extract.c | 2120 ++++++++++ src/wimlib/file_io.c | 212 + src/wimlib/header.c | 293 ++ src/wimlib/inode.c | 640 +++ src/wimlib/inode_fixup.c | 202 + src/wimlib/inode_table.c | 192 + src/wimlib/integrity.c | 452 +++ src/wimlib/iterate_dir.c | 282 ++ src/wimlib/lcpit_matchfinder.c | 752 ++++ src/wimlib/lzms_common.c | 643 +++ src/wimlib/lzms_compress.c | 2228 ++++++++++ src/wimlib/lzms_decompress.c | 937 +++++ src/wimlib/lzx_common.c | 327 ++ src/wimlib/lzx_compress.c | 2969 ++++++++++++++ src/wimlib/lzx_decompress.c | 563 +++ src/wimlib/metadata_resource.c | 259 ++ src/wimlib/pathlist.c | 54 + src/wimlib/paths.c | 151 + src/wimlib/pattern.c | 196 + src/wimlib/progress.c | 59 + src/wimlib/registry.c | 759 ++++ src/wimlib/reparse.c | 445 ++ src/wimlib/resource.c | 1463 +++++++ src/wimlib/scan.c | 439 ++ src/wimlib/security.c | 392 ++ src/wimlib/sha1.c | 642 +++ src/wimlib/solid.c | 242 ++ src/wimlib/split.c | 257 ++ src/wimlib/tagged_items.c | 230 ++ src/wimlib/textfile.c | 404 ++ src/wimlib/threads.c | 244 ++ src/wimlib/timestamp.c | 143 + src/wimlib/update_image.c | 1523 +++++++ src/wimlib/util.c | 310 ++ src/wimlib/wim.c | 1028 +++++ src/wimlib/wimboot.c | 1123 ++++++ src/wimlib/wimlib.h | 4912 +++++++++++++++++++++++ src/wimlib/wimlib/alloca.h | 10 + src/wimlib/wimlib/apply.h | 281 ++ src/wimlib/wimlib/assert.h | 7 + src/wimlib/wimlib/avl_tree.h | 344 ++ src/wimlib/wimlib/bitops.h | 106 + src/wimlib/wimlib/blob_table.h | 437 ++ src/wimlib/wimlib/bt_matchfinder.h | 378 ++ src/wimlib/wimlib/case.h | 32 + src/wimlib/wimlib/chunk_compressor.h | 75 + src/wimlib/wimlib/compiler.h | 162 + src/wimlib/wimlib/compress_common.h | 19 + src/wimlib/wimlib/compressor_ops.h | 36 + src/wimlib/wimlib/cpu_features.h | 37 + src/wimlib/wimlib/decompress_common.h | 553 +++ src/wimlib/wimlib/decompressor_ops.h | 29 + src/wimlib/wimlib/dentry.h | 280 ++ src/wimlib/wimlib/divsufsort.h | 11 + src/wimlib/wimlib/encoding.h | 148 + src/wimlib/wimlib/endianness.h | 125 + src/wimlib/wimlib/error.h | 33 + src/wimlib/wimlib/file_io.h | 59 + src/wimlib/wimlib/glob.h | 34 + src/wimlib/wimlib/guid.h | 40 + src/wimlib/wimlib/hc_matchfinder.h | 391 ++ src/wimlib/wimlib/header.h | 199 + src/wimlib/wimlib/inode.h | 433 ++ src/wimlib/wimlib/inode_table.h | 49 + src/wimlib/wimlib/integrity.h | 29 + src/wimlib/wimlib/lcpit_matchfinder.h | 75 + src/wimlib/wimlib/list.h | 355 ++ src/wimlib/wimlib/lzms_common.h | 143 + src/wimlib/wimlib/lzms_constants.h | 83 + src/wimlib/wimlib/lzx_common.h | 29 + src/wimlib/wimlib/lzx_constants.h | 106 + src/wimlib/wimlib/matchfinder_common.h | 130 + src/wimlib/wimlib/metadata.h | 165 + src/wimlib/wimlib/ntfs_3g.h | 29 + src/wimlib/wimlib/object_id.h | 29 + src/wimlib/wimlib/pathlist.h | 11 + src/wimlib/wimlib/paths.h | 45 + src/wimlib/wimlib/pattern.h | 30 + src/wimlib/wimlib/progress.h | 106 + src/wimlib/wimlib/registry.h | 40 + src/wimlib/wimlib/reparse.h | 112 + src/wimlib/wimlib/resource.h | 332 ++ src/wimlib/wimlib/scan.h | 154 + src/wimlib/wimlib/security.h | 68 + src/wimlib/wimlib/security_descriptor.h | 146 + src/wimlib/wimlib/sha1.h | 87 + src/wimlib/wimlib/solid.h | 9 + src/wimlib/wimlib/tagged_items.h | 31 + src/wimlib/wimlib/test_support.h | 38 + src/wimlib/wimlib/textfile.h | 37 + src/wimlib/wimlib/threads.h | 44 + src/wimlib/wimlib/timestamp.h | 45 + src/wimlib/wimlib/types.h | 53 + src/wimlib/wimlib/unaligned.h | 133 + src/wimlib/wimlib/unix_data.h | 33 + src/wimlib/wimlib/util.h | 149 + src/wimlib/wimlib/wim.h | 234 ++ src/wimlib/wimlib/wimboot.h | 25 + src/wimlib/wimlib/win32.h | 69 + src/wimlib/wimlib/win32_common.h | 164 + src/wimlib/wimlib/win32_vss.h | 45 + src/wimlib/wimlib/wof.h | 430 ++ src/wimlib/wimlib/write.h | 76 + src/wimlib/wimlib/xattr.h | 200 + src/wimlib/wimlib/xml.h | 74 + src/wimlib/wimlib/xml_windows.h | 9 + src/wimlib/wimlib/xmlproc.h | 91 + src/wimlib/wimlib/xpress_constants.h | 22 + src/wimlib/wimlib_tchar.h | 134 + src/wimlib/win32_apply.c | 3362 ++++++++++++++++ src/wimlib/win32_capture.c | 3050 ++++++++++++++ src/wimlib/win32_common.c | 410 ++ src/wimlib/win32_replacements.c | 773 ++++ src/wimlib/win32_vss.c | 528 +++ src/wimlib/write.c | 3367 ++++++++++++++++ src/wimlib/xml.c | 1236 ++++++ src/wimlib/xml_windows.c | 855 ++++ src/wimlib/xmlproc.c | 773 ++++ src/wimlib/xpress_compress.c | 1183 ++++++ src/wimlib/xpress_decompress.c | 186 + 136 files changed, 61895 insertions(+), 5 deletions(-) create mode 100644 src/wimlib/avl_tree.c create mode 100644 src/wimlib/blob_table.c create mode 100644 src/wimlib/compress.c create mode 100644 src/wimlib/compress_common.c create mode 100644 src/wimlib/compress_parallel.c create mode 100644 src/wimlib/compress_serial.c create mode 100644 src/wimlib/config.h create mode 100644 src/wimlib/cpu_features.c create mode 100644 src/wimlib/decompress.c create mode 100644 src/wimlib/decompress_common.c create mode 100644 src/wimlib/dentry.c create mode 100644 src/wimlib/divsufsort.c create mode 100644 src/wimlib/encoding.c create mode 100644 src/wimlib/error.c create mode 100644 src/wimlib/export_image.c create mode 100644 src/wimlib/extract.c create mode 100644 src/wimlib/file_io.c create mode 100644 src/wimlib/header.c create mode 100644 src/wimlib/inode.c create mode 100644 src/wimlib/inode_fixup.c create mode 100644 src/wimlib/inode_table.c create mode 100644 src/wimlib/integrity.c create mode 100644 src/wimlib/iterate_dir.c create mode 100644 src/wimlib/lcpit_matchfinder.c create mode 100644 src/wimlib/lzms_common.c create mode 100644 src/wimlib/lzms_compress.c create mode 100644 src/wimlib/lzms_decompress.c create mode 100644 src/wimlib/lzx_common.c create mode 100644 src/wimlib/lzx_compress.c create mode 100644 src/wimlib/lzx_decompress.c create mode 100644 src/wimlib/metadata_resource.c create mode 100644 src/wimlib/pathlist.c create mode 100644 src/wimlib/paths.c create mode 100644 src/wimlib/pattern.c create mode 100644 src/wimlib/progress.c create mode 100644 src/wimlib/registry.c create mode 100644 src/wimlib/reparse.c create mode 100644 src/wimlib/resource.c create mode 100644 src/wimlib/scan.c create mode 100644 src/wimlib/security.c create mode 100644 src/wimlib/sha1.c create mode 100644 src/wimlib/solid.c create mode 100644 src/wimlib/split.c create mode 100644 src/wimlib/tagged_items.c create mode 100644 src/wimlib/textfile.c create mode 100644 src/wimlib/threads.c create mode 100644 src/wimlib/timestamp.c create mode 100644 src/wimlib/update_image.c create mode 100644 src/wimlib/util.c create mode 100644 src/wimlib/wim.c create mode 100644 src/wimlib/wimboot.c create mode 100644 src/wimlib/wimlib.h create mode 100644 src/wimlib/wimlib/alloca.h create mode 100644 src/wimlib/wimlib/apply.h create mode 100644 src/wimlib/wimlib/assert.h create mode 100644 src/wimlib/wimlib/avl_tree.h create mode 100644 src/wimlib/wimlib/bitops.h create mode 100644 src/wimlib/wimlib/blob_table.h create mode 100644 src/wimlib/wimlib/bt_matchfinder.h create mode 100644 src/wimlib/wimlib/case.h create mode 100644 src/wimlib/wimlib/chunk_compressor.h create mode 100644 src/wimlib/wimlib/compiler.h create mode 100644 src/wimlib/wimlib/compress_common.h create mode 100644 src/wimlib/wimlib/compressor_ops.h create mode 100644 src/wimlib/wimlib/cpu_features.h create mode 100644 src/wimlib/wimlib/decompress_common.h create mode 100644 src/wimlib/wimlib/decompressor_ops.h create mode 100644 src/wimlib/wimlib/dentry.h create mode 100644 src/wimlib/wimlib/divsufsort.h create mode 100644 src/wimlib/wimlib/encoding.h create mode 100644 src/wimlib/wimlib/endianness.h create mode 100644 src/wimlib/wimlib/error.h create mode 100644 src/wimlib/wimlib/file_io.h create mode 100644 src/wimlib/wimlib/glob.h create mode 100644 src/wimlib/wimlib/guid.h create mode 100644 src/wimlib/wimlib/hc_matchfinder.h create mode 100644 src/wimlib/wimlib/header.h create mode 100644 src/wimlib/wimlib/inode.h create mode 100644 src/wimlib/wimlib/inode_table.h create mode 100644 src/wimlib/wimlib/integrity.h create mode 100644 src/wimlib/wimlib/lcpit_matchfinder.h create mode 100644 src/wimlib/wimlib/list.h create mode 100644 src/wimlib/wimlib/lzms_common.h create mode 100644 src/wimlib/wimlib/lzms_constants.h create mode 100644 src/wimlib/wimlib/lzx_common.h create mode 100644 src/wimlib/wimlib/lzx_constants.h create mode 100644 src/wimlib/wimlib/matchfinder_common.h create mode 100644 src/wimlib/wimlib/metadata.h create mode 100644 src/wimlib/wimlib/ntfs_3g.h create mode 100644 src/wimlib/wimlib/object_id.h create mode 100644 src/wimlib/wimlib/pathlist.h create mode 100644 src/wimlib/wimlib/paths.h create mode 100644 src/wimlib/wimlib/pattern.h create mode 100644 src/wimlib/wimlib/progress.h create mode 100644 src/wimlib/wimlib/registry.h create mode 100644 src/wimlib/wimlib/reparse.h create mode 100644 src/wimlib/wimlib/resource.h create mode 100644 src/wimlib/wimlib/scan.h create mode 100644 src/wimlib/wimlib/security.h create mode 100644 src/wimlib/wimlib/security_descriptor.h create mode 100644 src/wimlib/wimlib/sha1.h create mode 100644 src/wimlib/wimlib/solid.h create mode 100644 src/wimlib/wimlib/tagged_items.h create mode 100644 src/wimlib/wimlib/test_support.h create mode 100644 src/wimlib/wimlib/textfile.h create mode 100644 src/wimlib/wimlib/threads.h create mode 100644 src/wimlib/wimlib/timestamp.h create mode 100644 src/wimlib/wimlib/types.h create mode 100644 src/wimlib/wimlib/unaligned.h create mode 100644 src/wimlib/wimlib/unix_data.h create mode 100644 src/wimlib/wimlib/util.h create mode 100644 src/wimlib/wimlib/wim.h create mode 100644 src/wimlib/wimlib/wimboot.h create mode 100644 src/wimlib/wimlib/win32.h create mode 100644 src/wimlib/wimlib/win32_common.h create mode 100644 src/wimlib/wimlib/win32_vss.h create mode 100644 src/wimlib/wimlib/wof.h create mode 100644 src/wimlib/wimlib/write.h create mode 100644 src/wimlib/wimlib/xattr.h create mode 100644 src/wimlib/wimlib/xml.h create mode 100644 src/wimlib/wimlib/xml_windows.h create mode 100644 src/wimlib/wimlib/xmlproc.h create mode 100644 src/wimlib/wimlib/xpress_constants.h create mode 100644 src/wimlib/wimlib_tchar.h create mode 100644 src/wimlib/win32_apply.c create mode 100644 src/wimlib/win32_capture.c create mode 100644 src/wimlib/win32_common.c create mode 100644 src/wimlib/win32_replacements.c create mode 100644 src/wimlib/win32_vss.c create mode 100644 src/wimlib/write.c create mode 100644 src/wimlib/xml.c create mode 100644 src/wimlib/xml_windows.c create mode 100644 src/wimlib/xmlproc.c create mode 100644 src/wimlib/xpress_compress.c create mode 100644 src/wimlib/xpress_decompress.c diff --git a/src/rufus.rc b/src/rufus.rc index 86fd5f39..1e8e01a0 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.8.2234" +CAPTION "Rufus 4.8.2235" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2234,0 - PRODUCTVERSION 4,8,2234,0 + FILEVERSION 4,8,2235,0 + PRODUCTVERSION 4,8,2235,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2234" + VALUE "FileVersion", "4.8.2235" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2234" + VALUE "ProductVersion", "4.8.2235" END END BLOCK "VarFileInfo" diff --git a/src/wimlib/avl_tree.c b/src/wimlib/avl_tree.c new file mode 100644 index 00000000..136e9572 --- /dev/null +++ b/src/wimlib/avl_tree.c @@ -0,0 +1,801 @@ +/* + * avl_tree.c - intrusive, nonrecursive AVL tree data structure (self-balancing + * binary search tree), implementation file + * + * Copyright 2022 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/avl_tree.h" + +/* Returns the left child (sign < 0) or the right child (sign > 0) of the + * specified AVL tree node. + * Note: for all calls of this, 'sign' is constant at compilation time, + * so the compiler can remove the conditional. */ +static AVL_INLINE struct avl_tree_node * +avl_get_child(const struct avl_tree_node *parent, int sign) +{ + if (sign < 0) + return parent->left; + else + return parent->right; +} + +static AVL_INLINE struct avl_tree_node * +avl_tree_first_or_last_in_order(const struct avl_tree_node *root, int sign) +{ + const struct avl_tree_node *first = root; + + if (first) + while (avl_get_child(first, +sign)) + first = avl_get_child(first, +sign); + return (struct avl_tree_node *)first; +} + +/* Starts an in-order traversal of the tree: returns the least-valued node, or + * NULL if the tree is empty. */ +struct avl_tree_node * +avl_tree_first_in_order(const struct avl_tree_node *root) +{ + return avl_tree_first_or_last_in_order(root, -1); +} + +/* Starts a *reverse* in-order traversal of the tree: returns the + * greatest-valued node, or NULL if the tree is empty. */ +struct avl_tree_node * +avl_tree_last_in_order(const struct avl_tree_node *root) +{ + return avl_tree_first_or_last_in_order(root, 1); +} + +static AVL_INLINE struct avl_tree_node * +avl_tree_next_or_prev_in_order(const struct avl_tree_node *node, int sign) +{ + const struct avl_tree_node *next; + + if (avl_get_child(node, +sign)) + for (next = avl_get_child(node, +sign); + avl_get_child(next, -sign); + next = avl_get_child(next, -sign)) + ; + else + for (next = avl_get_parent(node); + next && node == avl_get_child(next, +sign); + node = next, next = avl_get_parent(next)) + ; + return (struct avl_tree_node *)next; +} + +/* Continues an in-order traversal of the tree: returns the next-greatest-valued + * node, or NULL if there is none. */ +struct avl_tree_node * +avl_tree_next_in_order(const struct avl_tree_node *node) +{ + return avl_tree_next_or_prev_in_order(node, 1); +} + +/* Continues a *reverse* in-order traversal of the tree: returns the + * previous-greatest-valued node, or NULL if there is none. */ +struct avl_tree_node * +avl_tree_prev_in_order(const struct avl_tree_node *node) +{ + return avl_tree_next_or_prev_in_order(node, -1); +} + +/* Starts a postorder traversal of the tree. */ +struct avl_tree_node * +avl_tree_first_in_postorder(const struct avl_tree_node *root) +{ + const struct avl_tree_node *first = root; + + if (first) + while (first->left || first->right) + first = first->left ? first->left : first->right; + + return (struct avl_tree_node *)first; +} + +/* Continues a postorder traversal of the tree. @prev will not be deferenced as + * it's allowed that its memory has been freed; @prev_parent must be its saved + * parent node. Returns NULL if there are no more nodes (i.e. @prev was the + * root of the tree). */ +struct avl_tree_node * +avl_tree_next_in_postorder(const struct avl_tree_node *prev, + const struct avl_tree_node *prev_parent) +{ + const struct avl_tree_node *next = prev_parent; + + if (next && prev == next->left && next->right) + for (next = next->right; + next->left || next->right; + next = next->left ? next->left : next->right) + ; + return (struct avl_tree_node *)next; +} + +/* Sets the left child (sign < 0) or the right child (sign > 0) of the + * specified AVL tree node. + * Note: for all calls of this, 'sign' is constant at compilation time, + * so the compiler can remove the conditional. */ +static AVL_INLINE void +avl_set_child(struct avl_tree_node *parent, int sign, + struct avl_tree_node *child) +{ + if (sign < 0) + parent->left = child; + else + parent->right = child; +} + +/* Sets the parent and balance factor of the specified AVL tree node. */ +static AVL_INLINE void +avl_set_parent_balance(struct avl_tree_node *node, struct avl_tree_node *parent, + int balance_factor) +{ + node->parent_balance = (uintptr_t)parent | (balance_factor + 1); +} + +/* Sets the parent of the specified AVL tree node. */ +static AVL_INLINE void +avl_set_parent(struct avl_tree_node *node, struct avl_tree_node *parent) +{ + node->parent_balance = (uintptr_t)parent | (node->parent_balance & 3); +} + +/* Returns the balance factor of the specified AVL tree node --- that is, the + * height of its right subtree minus the height of its left subtree. */ +static AVL_INLINE int +avl_get_balance_factor(const struct avl_tree_node *node) +{ + return (int)(node->parent_balance & 3) - 1; +} + +/* Adds @amount to the balance factor of the specified AVL tree node. + * The caller must ensure this still results in a valid balance factor + * (-1, 0, or 1). */ +static AVL_INLINE void +avl_adjust_balance_factor(struct avl_tree_node *node, int amount) +{ + node->parent_balance += amount; +} + +static AVL_INLINE void +avl_replace_child(struct avl_tree_node **root_ptr, + struct avl_tree_node *parent, + struct avl_tree_node *old_child, + struct avl_tree_node *new_child) +{ + if (parent) { + if (old_child == parent->left) + parent->left = new_child; + else + parent->right = new_child; + } else { + *root_ptr = new_child; + } +} + +/* + * Template for performing a single rotation --- + * + * sign > 0: Rotate clockwise (right) rooted at A: + * + * P? P? + * | | + * A B + * / \ / \ + * B C? => D? A + * / \ / \ + * D? E? E? C? + * + * (nodes marked with ? may not exist) + * + * sign < 0: Rotate counterclockwise (left) rooted at A: + * + * P? P? + * | | + * A B + * / \ / \ + * C? B => A D? + * / \ / \ + * E? D? C? E? + * + * This updates pointers but not balance factors! + */ +static AVL_INLINE void +avl_rotate(struct avl_tree_node ** const root_ptr, + struct avl_tree_node * const A, const int sign) +{ + struct avl_tree_node * const B = avl_get_child(A, -sign); + struct avl_tree_node * const E = avl_get_child(B, +sign); + struct avl_tree_node * const P = avl_get_parent(A); + + avl_set_child(A, -sign, E); + avl_set_parent(A, B); + + avl_set_child(B, +sign, A); + avl_set_parent(B, P); + + if (E) + avl_set_parent(E, A); + + avl_replace_child(root_ptr, P, A, B); +} + +/* + * Template for performing a double rotation --- + * + * sign > 0: Rotate counterclockwise (left) rooted at B, then + * clockwise (right) rooted at A: + * + * P? P? P? + * | | | + * A A E + * / \ / \ / \ + * B C? => E C? => B A + * / \ / \ / \ / \ + * D? E B G? D? F?G? C? + * / \ / \ + * F? G? D? F? + * + * (nodes marked with ? may not exist) + * + * sign < 0: Rotate clockwise (right) rooted at B, then + * counterclockwise (left) rooted at A: + * + * P? P? P? + * | | | + * A A E + * / \ / \ / \ + * C? B => C? E => A B + * / \ / \ / \ / \ + * E D? G? B C? G?F? D? + * / \ / \ + * G? F? F? D? + * + * Returns a pointer to E and updates balance factors. Except for those + * two things, this function is equivalent to: + * avl_rotate(root_ptr, B, -sign); + * avl_rotate(root_ptr, A, +sign); + * + * See comment in avl_handle_subtree_growth() for explanation of balance + * factor updates. + */ +static AVL_INLINE struct avl_tree_node * +avl_do_double_rotate(struct avl_tree_node ** const root_ptr, + struct avl_tree_node * const B, + struct avl_tree_node * const A, const int sign) +{ + struct avl_tree_node * const E = avl_get_child(B, +sign); + struct avl_tree_node * const F = avl_get_child(E, -sign); + struct avl_tree_node * const G = avl_get_child(E, +sign); + struct avl_tree_node * const P = avl_get_parent(A); + const int e = avl_get_balance_factor(E); + + avl_set_child(A, -sign, G); + avl_set_parent_balance(A, E, ((sign * e >= 0) ? 0 : -e)); + + avl_set_child(B, +sign, F); + avl_set_parent_balance(B, E, ((sign * e <= 0) ? 0 : -e)); + + avl_set_child(E, +sign, A); + avl_set_child(E, -sign, B); + avl_set_parent_balance(E, P, 0); + + if (G) + avl_set_parent(G, A); + + if (F) + avl_set_parent(F, B); + + avl_replace_child(root_ptr, P, A, E); + + return E; +} + +/* + * This function handles the growth of a subtree due to an insertion. + * + * @root_ptr + * Location of the tree's root pointer. + * + * @node + * A subtree that has increased in height by 1 due to an insertion. + * + * @parent + * Parent of @node; must not be NULL. + * + * @sign + * -1 if @node is the left child of @parent; + * +1 if @node is the right child of @parent. + * + * This function will adjust @parent's balance factor, then do a (single + * or double) rotation if necessary. The return value will be %true if + * the full AVL tree is now adequately balanced, or %false if the subtree + * rooted at @parent is now adequately balanced but has increased in + * height by 1, so the caller should continue up the tree. + * + * Note that if %false is returned, no rotation will have been done. + * Indeed, a single node insertion cannot require that more than one + * (single or double) rotation be done. + */ +static AVL_INLINE bool +avl_handle_subtree_growth(struct avl_tree_node ** const root_ptr, + struct avl_tree_node * const node, + struct avl_tree_node * const parent, + const int sign) +{ + int old_balance_factor, new_balance_factor; + + old_balance_factor = avl_get_balance_factor(parent); + + if (old_balance_factor == 0) { + avl_adjust_balance_factor(parent, sign); + /* @parent is still sufficiently balanced (-1 or +1 + * balance factor), but must have increased in height. + * Continue up the tree. */ + return false; + } + + new_balance_factor = old_balance_factor + sign; + + if (new_balance_factor == 0) { + avl_adjust_balance_factor(parent, sign); + /* @parent is now perfectly balanced (0 balance factor). + * It cannot have increased in height, so there is + * nothing more to do. */ + return true; + } + + /* @parent is too left-heavy (new_balance_factor == -2) or + * too right-heavy (new_balance_factor == +2). */ + + /* Test whether @node is left-heavy (-1 balance factor) or + * right-heavy (+1 balance factor). + * Note that it cannot be perfectly balanced (0 balance factor) + * because here we are under the invariant that @node has + * increased in height due to the insertion. */ + if (sign * avl_get_balance_factor(node) > 0) { + + /* @node (B below) is heavy in the same direction @parent + * (A below) is heavy. + * + * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + * The comment, diagram, and equations below assume sign < 0. + * The other case is symmetric! + * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + * + * Do a clockwise rotation rooted at @parent (A below): + * + * A B + * / \ / \ + * B C? => D A + * / \ / \ / \ + * D E? F? G?E? C? + * / \ + * F? G? + * + * Before the rotation: + * balance(A) = -2 + * balance(B) = -1 + * Let x = height(C). Then: + * height(B) = x + 2 + * height(D) = x + 1 + * height(E) = x + * max(height(F), height(G)) = x. + * + * After the rotation: + * height(D) = max(height(F), height(G)) + 1 + * = x + 1 + * height(A) = max(height(E), height(C)) + 1 + * = max(x, x) + 1 = x + 1 + * balance(B) = 0 + * balance(A) = 0 + */ + avl_rotate(root_ptr, parent, -sign); + + /* Equivalent to setting @parent's balance factor to 0. */ + avl_adjust_balance_factor(parent, -sign); /* A */ + + /* Equivalent to setting @node's balance factor to 0. */ + avl_adjust_balance_factor(node, -sign); /* B */ + } else { + /* @node (B below) is heavy in the direction opposite + * from the direction @parent (A below) is heavy. + * + * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + * The comment, diagram, and equations below assume sign < 0. + * The other case is symmetric! + * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + * + * Do a counterblockwise rotation rooted at @node (B below), + * then a clockwise rotation rooted at @parent (A below): + * + * A A E + * / \ / \ / \ + * B C? => E C? => B A + * / \ / \ / \ / \ + * D? E B G? D? F?G? C? + * / \ / \ + * F? G? D? F? + * + * Before the rotation: + * balance(A) = -2 + * balance(B) = +1 + * Let x = height(C). Then: + * height(B) = x + 2 + * height(E) = x + 1 + * height(D) = x + * max(height(F), height(G)) = x + * + * After both rotations: + * height(A) = max(height(G), height(C)) + 1 + * = x + 1 + * balance(A) = balance(E{orig}) >= 0 ? 0 : -balance(E{orig}) + * height(B) = max(height(D), height(F)) + 1 + * = x + 1 + * balance(B) = balance(E{orig} <= 0) ? 0 : -balance(E{orig}) + * + * height(E) = x + 2 + * balance(E) = 0 + */ + avl_do_double_rotate(root_ptr, node, parent, -sign); + } + + /* Height after rotation is unchanged; nothing more to do. */ + return true; +} + +/* Rebalance the tree after insertion of the specified node. */ +void +avl_tree_rebalance_after_insert(struct avl_tree_node **root_ptr, + struct avl_tree_node *inserted) +{ + struct avl_tree_node *node, *parent; + bool done; + + inserted->left = NULL; + inserted->right = NULL; + + node = inserted; + + /* Adjust balance factor of new node's parent. + * No rotation will need to be done at this level. */ + + parent = avl_get_parent(node); + if (!parent) + return; + + if (node == parent->left) + avl_adjust_balance_factor(parent, -1); + else + avl_adjust_balance_factor(parent, +1); + + if (avl_get_balance_factor(parent) == 0) + /* @parent did not change in height. Nothing more to do. */ + return; + + /* The subtree rooted at @parent increased in height by 1. */ + + do { + /* Adjust balance factor of next ancestor. */ + + node = parent; + parent = avl_get_parent(node); + if (!parent) + return; + + /* The subtree rooted at @node has increased in height by 1. */ + if (node == parent->left) + done = avl_handle_subtree_growth(root_ptr, node, + parent, -1); + else + done = avl_handle_subtree_growth(root_ptr, node, + parent, +1); + } while (!done); +} + +/* + * This function handles the shrinkage of a subtree due to a deletion. + * + * @root_ptr + * Location of the tree's root pointer. + * + * @parent + * A node in the tree, exactly one of whose subtrees has decreased + * in height by 1 due to a deletion. (This includes the case where + * one of the child pointers has become NULL, since we can consider + * the "NULL" subtree to have a height of 0.) + * + * @sign + * +1 if the left subtree of @parent has decreased in height by 1; + * -1 if the right subtree of @parent has decreased in height by 1. + * + * @left_deleted_ret + * If the return value is not NULL, this will be set to %true if the + * left subtree of the returned node has decreased in height by 1, + * or %false if the right subtree of the returned node has decreased + * in height by 1. + * + * This function will adjust @parent's balance factor, then do a (single + * or double) rotation if necessary. The return value will be NULL if + * the full AVL tree is now adequately balanced, or a pointer to the + * parent of @parent if @parent is now adequately balanced but has + * decreased in height by 1. Also in the latter case, *left_deleted_ret + * will be set. + */ +static AVL_INLINE struct avl_tree_node * +avl_handle_subtree_shrink(struct avl_tree_node ** const root_ptr, + struct avl_tree_node *parent, + const int sign, + bool * const left_deleted_ret) +{ + struct avl_tree_node *node; + int old_balance_factor, new_balance_factor; + + old_balance_factor = avl_get_balance_factor(parent); + + if (old_balance_factor == 0) { + /* Prior to the deletion, the subtree rooted at + * @parent was perfectly balanced. It's now + * unbalanced by 1, but that's okay and its height + * hasn't changed. Nothing more to do. */ + avl_adjust_balance_factor(parent, sign); + return NULL; + } + + new_balance_factor = old_balance_factor + sign; + + if (new_balance_factor == 0) { + /* The subtree rooted at @parent is now perfectly + * balanced, whereas before the deletion it was + * unbalanced by 1. Its height must have decreased + * by 1. No rotation is needed at this location, + * but continue up the tree. */ + avl_adjust_balance_factor(parent, sign); + node = parent; + } else { + /* @parent is too left-heavy (new_balance_factor == -2) or + * too right-heavy (new_balance_factor == +2). */ + + node = avl_get_child(parent, sign); + + /* The rotations below are similar to those done during + * insertion (see avl_handle_subtree_growth()), so full + * comments are not provided. The only new case is the + * one where @node has a balance factor of 0, and that is + * commented. */ + + if (sign * avl_get_balance_factor(node) >= 0) { + + avl_rotate(root_ptr, parent, -sign); + + if (avl_get_balance_factor(node) == 0) { + /* + * @node (B below) is perfectly balanced. + * + * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + * The comment, diagram, and equations + * below assume sign < 0. The other case + * is symmetric! + * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + * + * Do a clockwise rotation rooted at + * @parent (A below): + * + * A B + * / \ / \ + * B C? => D A + * / \ / \ / \ + * D E F? G?E C? + * / \ + * F? G? + * + * Before the rotation: + * balance(A) = -2 + * balance(B) = 0 + * Let x = height(C). Then: + * height(B) = x + 2 + * height(D) = x + 1 + * height(E) = x + 1 + * max(height(F), height(G)) = x. + * + * After the rotation: + * height(D) = max(height(F), height(G)) + 1 + * = x + 1 + * height(A) = max(height(E), height(C)) + 1 + * = max(x + 1, x) + 1 = x + 2 + * balance(A) = -1 + * balance(B) = +1 + */ + + /* A: -2 => -1 (sign < 0) + * or +2 => +1 (sign > 0) + * No change needed --- that's the same as + * old_balance_factor. */ + + /* B: 0 => +1 (sign < 0) + * or 0 => -1 (sign > 0) */ + avl_adjust_balance_factor(node, -sign); + + /* Height is unchanged; nothing more to do. */ + return NULL; + } else { + avl_adjust_balance_factor(parent, -sign); + avl_adjust_balance_factor(node, -sign); + } + } else { + node = avl_do_double_rotate(root_ptr, node, + parent, -sign); + } + } + parent = avl_get_parent(node); + if (parent) + *left_deleted_ret = (node == parent->left); + return parent; +} + +/* Swaps node X, which must have 2 children, with its in-order successor, then + * unlinks node X. Returns the parent of X just before unlinking, without its + * balance factor having been updated to account for the unlink. */ +static AVL_INLINE struct avl_tree_node * +avl_tree_swap_with_successor(struct avl_tree_node **root_ptr, + struct avl_tree_node *X, + bool *left_deleted_ret) +{ + struct avl_tree_node *Y, *ret; + + Y = X->right; + if (!Y->left) { + /* + * P? P? P? + * | | | + * X Y Y + * / \ / \ / \ + * A Y => A X => A B? + * / \ / \ + * (0) B? (0) B? + * + * [ X unlinked, Y returned ] + */ + ret = Y; + *left_deleted_ret = false; + } else { + struct avl_tree_node *Q; + + do { + Q = Y; + Y = Y->left; + } while (Y->left); + + /* + * P? P? P? + * | | | + * X Y Y + * / \ / \ / \ + * A ... => A ... => A ... + * | | | + * Q Q Q + * / / / + * Y X B? + * / \ / \ + * (0) B? (0) B? + * + * + * [ X unlinked, Q returned ] + */ + + Q->left = Y->right; + if (Q->left) + avl_set_parent(Q->left, Q); + Y->right = X->right; + avl_set_parent(X->right, Y); + ret = Q; + *left_deleted_ret = true; + } + + Y->left = X->left; + avl_set_parent(X->left, Y); + + Y->parent_balance = X->parent_balance; + avl_replace_child(root_ptr, avl_get_parent(X), X, Y); + + return ret; +} + +/* + * Removes an item from the specified AVL tree. + * + * @root_ptr + * Location of the AVL tree's root pointer. Indirection is needed + * because the root node may change if the tree needed to be rebalanced + * because of the deletion or if @node was the root node. + * + * @node + * Pointer to the `struct avl_tree_node' embedded in the item to + * remove from the tree. + * + * Note: This function *only* removes the node and rebalances the tree. + * It does not free any memory. + */ +void +avl_tree_remove(struct avl_tree_node **root_ptr, struct avl_tree_node *node) +{ + struct avl_tree_node *parent; + bool left_deleted = false; + + if (node->left && node->right) { + /* @node is fully internal, with two children. Swap it + * with its in-order successor (which must exist in the + * right subtree of @node and can have, at most, a right + * child), then unlink @node. */ + parent = avl_tree_swap_with_successor(root_ptr, node, + &left_deleted); + /* @parent is now the parent of what was @node's in-order + * successor. It cannot be NULL, since @node itself was + * an ancestor of its in-order successor. + * @left_deleted has been set to %true if @node's + * in-order successor was the left child of @parent, + * otherwise %false. */ + } else { + struct avl_tree_node *child; + + /* @node is missing at least one child. Unlink it. Set + * @parent to @node's parent, and set @left_deleted to + * reflect which child of @parent @node was. Or, if + * @node was the root node, simply update the root node + * and return. */ + child = node->left ? node->left : node->right; + parent = avl_get_parent(node); + if (parent) { + if (node == parent->left) { + parent->left = child; + left_deleted = true; + } else { + parent->right = child; + left_deleted = false; + } + if (child) + avl_set_parent(child, parent); + } else { + if (child) + avl_set_parent(child, parent); + *root_ptr = child; + return; + } + } + + /* Rebalance the tree. */ + do { + if (left_deleted) + parent = avl_handle_subtree_shrink(root_ptr, parent, + +1, &left_deleted); + else + parent = avl_handle_subtree_shrink(root_ptr, parent, + -1, &left_deleted); + } while (parent); +} diff --git a/src/wimlib/blob_table.c b/src/wimlib/blob_table.c new file mode 100644 index 00000000..38615503 --- /dev/null +++ b/src/wimlib/blob_table.c @@ -0,0 +1,1411 @@ +/* + * blob_table.c + * + * A blob table maps SHA-1 message digests to "blobs", which are nonempty + * sequences of binary data. Within a WIM file, blobs are single-instanced. + * + * This file also contains code to read and write the corresponding on-disk + * representation of this table in the WIM file format. + */ + +/* + * Copyright (C) 2012-2016 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <stdlib.h> +#include <string.h> +#include <unistd.h> /* for unlink() */ + +#include "wimlib/assert.h" +#include "wimlib/bitops.h" +#include "wimlib/blob_table.h" +#include "wimlib/dentry.h" +#include "wimlib/encoding.h" +#include "wimlib/endianness.h" +#include "wimlib/error.h" +#include "wimlib/metadata.h" +#include "wimlib/ntfs_3g.h" +#include "wimlib/resource.h" +#include "wimlib/unaligned.h" +#include "wimlib/util.h" +#include "wimlib/win32.h" +#include "wimlib/write.h" + +/* A hash table mapping SHA-1 message digests to blob descriptors */ +struct blob_table { + struct hlist_head *array; + size_t num_blobs; + size_t mask; /* capacity - 1; capacity is a power of 2 */ +}; + +struct blob_table * +new_blob_table(size_t capacity) +{ + struct blob_table *table; + struct hlist_head *array; + + capacity = roundup_pow_of_2(capacity); + + table = MALLOC(sizeof(struct blob_table)); + if (table == NULL) + goto oom; + + array = CALLOC(capacity, sizeof(array[0])); + if (array == NULL) { + FREE(table); + goto oom; + } + + table->num_blobs = 0; + table->mask = capacity - 1; + table->array = array; + return table; + +oom: + ERROR("Failed to allocate memory for blob table " + "with capacity %zu", capacity); + return NULL; +} + +static int +do_free_blob_descriptor(struct blob_descriptor *blob, void *_ignore) +{ + free_blob_descriptor(blob); + return 0; +} + +void +free_blob_table(struct blob_table *table) +{ + if (table) { + for_blob_in_table(table, do_free_blob_descriptor, NULL); + FREE(table->array); + FREE(table); + } +} + +struct blob_descriptor * +new_blob_descriptor(void) +{ + STATIC_ASSERT(BLOB_NONEXISTENT == 0); + return CALLOC(1, sizeof(struct blob_descriptor)); +} + +struct blob_descriptor * +clone_blob_descriptor(const struct blob_descriptor *old) +{ + struct blob_descriptor *new; + + new = memdup(old, sizeof(struct blob_descriptor)); + if (new == NULL) + return NULL; + + switch (new->blob_location) { + case BLOB_IN_WIM: + list_add(&new->rdesc_node, &new->rdesc->blob_list); + break; + + case BLOB_IN_FILE_ON_DISK: +#ifdef WITH_FUSE + case BLOB_IN_STAGING_FILE: + STATIC_ASSERT((void*)&old->file_on_disk == + (void*)&old->staging_file_name); +#endif + new->file_on_disk = TSTRDUP(old->file_on_disk); + if (new->file_on_disk == NULL) + goto out_free; + break; +#ifdef _WIN32 + case BLOB_IN_WINDOWS_FILE: + new->windows_file = clone_windows_file(old->windows_file); + break; +#endif + case BLOB_IN_ATTACHED_BUFFER: + new->attached_buffer = memdup(old->attached_buffer, old->size); + if (new->attached_buffer == NULL) + goto out_free; + break; +#ifdef WITH_NTFS_3G + case BLOB_IN_NTFS_VOLUME: + new->ntfs_loc = clone_ntfs_location(old->ntfs_loc); + if (!new->ntfs_loc) + goto out_free; + break; +#endif + } + return new; + +out_free: + free_blob_descriptor(new); + return NULL; +} + +/* Release a blob descriptor from its location, if any, and set its new location + * to BLOB_NONEXISTENT. */ +void +blob_release_location(struct blob_descriptor *blob) +{ + switch (blob->blob_location) { + case BLOB_IN_WIM: { + struct wim_resource_descriptor *rdesc = blob->rdesc; + + list_del(&blob->rdesc_node); + if (list_empty(&rdesc->blob_list)) { + wim_decrement_refcnt(rdesc->wim); + FREE(rdesc); + } + break; + } + case BLOB_IN_FILE_ON_DISK: +#ifdef WITH_FUSE + case BLOB_IN_STAGING_FILE: + STATIC_ASSERT((void*)&blob->file_on_disk == + (void*)&blob->staging_file_name); +#endif + case BLOB_IN_ATTACHED_BUFFER: + STATIC_ASSERT((void*)&blob->file_on_disk == + (void*)&blob->attached_buffer); + FREE(blob->file_on_disk); + break; +#ifdef _WIN32 + case BLOB_IN_WINDOWS_FILE: + free_windows_file(blob->windows_file); + break; +#endif +#ifdef WITH_NTFS_3G + case BLOB_IN_NTFS_VOLUME: + free_ntfs_location(blob->ntfs_loc); + break; +#endif + } + blob->blob_location = BLOB_NONEXISTENT; +} + +void +free_blob_descriptor(struct blob_descriptor *blob) +{ + if (blob) { + blob_release_location(blob); + FREE(blob); + } +} + +/* Should this blob be retained even if it has no references? */ +static bool +should_retain_blob(const struct blob_descriptor *blob) +{ + return blob->blob_location == BLOB_IN_WIM; +} + +static void +finalize_blob(struct blob_descriptor *blob) +{ + if (!should_retain_blob(blob)) + free_blob_descriptor(blob); +} + +/* + * Decrements the reference count of the specified blob, which must be either + * (a) unhashed, or (b) inserted in the specified blob table. + * + * If the blob's reference count reaches 0, we may unlink it from @table and + * free it. However, we retain blobs with 0 reference count that originated + * from WIM files (BLOB_IN_WIM). We do this for two reasons: + * + * 1. This prevents information about valid blobs in a WIM file --- blobs which + * will continue to be present after appending to the WIM file --- from being + * lost merely because we dropped all references to them. + * + * 2. Blob reference counts we read from WIM files can't be trusted. It's + * possible that a WIM has reference counts that are too low; WIMGAPI + * sometimes creates WIMs where this is the case. It's also possible that + * blobs have been referenced from an external WIM; those blobs can + * potentially have any reference count at all, either lower or higher than + * would be expected for this WIM ("this WIM" meaning the owner of @table) if + * it were a standalone WIM. + * + * So we can't take the reference counts too seriously. But at least, we do + * recalculate by default when writing a new WIM file. + */ +void +blob_decrement_refcnt(struct blob_descriptor *blob, struct blob_table *table) +{ + blob_subtract_refcnt(blob, table, 1); +} + +void +blob_subtract_refcnt(struct blob_descriptor *blob, struct blob_table *table, + u32 count) +{ + if (unlikely(blob->refcnt < count)) { + blob->refcnt = 0; /* See comment above */ + return; + } + + blob->refcnt -= count; + + if (blob->refcnt != 0) + return; + + if (blob->unhashed) { + list_del(&blob->unhashed_list); + #ifdef WITH_FUSE + /* If the blob has been extracted to a staging file for a FUSE + * mount, unlink the staging file. (Note that there still may + * be open file descriptors to it.) */ + if (blob->blob_location == BLOB_IN_STAGING_FILE) + unlinkat(blob->staging_dir_fd, + blob->staging_file_name, 0); + #endif + } else { + if (!should_retain_blob(blob)) + blob_table_unlink(table, blob); + } + + /* If FUSE mounts are enabled, then don't actually free the blob + * descriptor until the last file descriptor to it has been closed. */ +#ifdef WITH_FUSE + if (blob->num_opened_fds == 0) +#endif + finalize_blob(blob); +} + +#ifdef WITH_FUSE +void +blob_decrement_num_opened_fds(struct blob_descriptor *blob) +{ + wimlib_assert(blob->num_opened_fds != 0); + + if (--blob->num_opened_fds == 0 && blob->refcnt == 0) + finalize_blob(blob); +} +#endif + +static void +blob_table_insert_raw(struct blob_table *table, struct blob_descriptor *blob) +{ + size_t i = blob->hash_short & table->mask; + + hlist_add_head(&blob->hash_list, &table->array[i]); +} + +static void +enlarge_blob_table(struct blob_table *table) +{ + size_t old_capacity, new_capacity; + struct hlist_head *old_array, *new_array; + struct blob_descriptor *blob; + struct hlist_node *tmp; + size_t i; + + old_capacity = table->mask + 1; + new_capacity = old_capacity * 2; + new_array = CALLOC(new_capacity, sizeof(struct hlist_head)); + if (new_array == NULL) + return; + old_array = table->array; + table->array = new_array; + table->mask = new_capacity - 1; + + for (i = 0; i < old_capacity; i++) + hlist_for_each_entry_safe(blob, tmp, &old_array[i], hash_list) + blob_table_insert_raw(table, blob); + FREE(old_array); +} + +/* Insert a blob descriptor into the blob table. */ +void +blob_table_insert(struct blob_table *table, struct blob_descriptor *blob) +{ + blob_table_insert_raw(table, blob); + if (table->num_blobs++ > table->mask) + enlarge_blob_table(table); +} + +/* Unlinks a blob descriptor from the blob table; does not free it. */ +void +blob_table_unlink(struct blob_table *table, struct blob_descriptor *blob) +{ + wimlib_assert(!blob->unhashed); + wimlib_assert(table->num_blobs != 0); + + hlist_del(&blob->hash_list); + table->num_blobs--; +} + +/* Given a SHA-1 message digest, return the corresponding blob descriptor from + * the specified blob table, or NULL if there is none. */ +struct blob_descriptor * +lookup_blob(const struct blob_table *table, const u8 *hash) +{ + size_t i; + struct blob_descriptor *blob; + + i = load_size_t_unaligned(hash) & table->mask; + hlist_for_each_entry(blob, &table->array[i], hash_list) + if (hashes_equal(hash, blob->hash)) + return blob; + return NULL; +} + +/* Call a function on all blob descriptors in the specified blob table. Stop + * early and return nonzero if any call to the function returns nonzero. */ +int +for_blob_in_table(struct blob_table *table, + int (*visitor)(struct blob_descriptor *, void *), void *arg) +{ + struct blob_descriptor *blob; + struct hlist_node *tmp; + int ret; + + for (size_t i = 0; i <= table->mask; i++) { + hlist_for_each_entry_safe(blob, tmp, &table->array[i], + hash_list) + { + ret = visitor(blob, arg); + if (ret) + return ret; + } + } + return 0; +} + +/* + * This is a qsort() callback that sorts blobs into an order optimized for + * reading. Sorting is done primarily by blob location, then secondarily by a + * location-dependent order. For example, blobs in WIM resources are sorted + * such that the underlying WIM files will be read sequentially. This is + * especially important for WIM files containing solid resources. + */ +int +cmp_blobs_by_sequential_order(const void *p1, const void *p2) +{ + const struct blob_descriptor *blob1, *blob2; + int v; + WIMStruct *wim1, *wim2; + + blob1 = *(const struct blob_descriptor**)p1; + blob2 = *(const struct blob_descriptor**)p2; + + v = (int)blob1->blob_location - (int)blob2->blob_location; + + /* Different locations? Note: "unsafe compaction mode" requires that + * blobs in WIMs sort before all others. For the logic here to ensure + * this, BLOB_IN_WIM must have the lowest value among all defined + * blob_locations. Statically verify that the enum values haven't + * changed. */ + STATIC_ASSERT(BLOB_NONEXISTENT == 0 && BLOB_IN_WIM == 1); + if (v) + return v; + + switch (blob1->blob_location) { + case BLOB_IN_WIM: + wim1 = blob1->rdesc->wim; + wim2 = blob2->rdesc->wim; + + /* Different WIM files? */ + if (wim1 != wim2) { + + /* Resources from the WIM file currently being compacted + * (if any) must always sort first. */ + v = (int)wim2->being_compacted - (int)wim1->being_compacted; + if (v) + return v; + + /* Different split WIMs? */ + v = cmp_guids(wim1->hdr.guid, wim2->hdr.guid); + if (v) + return v; + + /* Different part numbers in the same split WIM? */ + v = (int)wim1->hdr.part_number - (int)wim2->hdr.part_number; + if (v) + return v; + + /* Probably two WIMStructs for the same on-disk file. + * Just sort by pointer. */ + return wim1 < wim2 ? -1 : 1; + } + + /* Same WIM file */ + + /* Sort by increasing resource offset */ + if (blob1->rdesc->offset_in_wim != blob2->rdesc->offset_in_wim) + return cmp_u64(blob1->rdesc->offset_in_wim, + blob2->rdesc->offset_in_wim); + + /* The blobs are in the same solid resource. Sort by increasing + * offset in the resource. */ + return cmp_u64(blob1->offset_in_res, blob2->offset_in_res); + + case BLOB_IN_FILE_ON_DISK: +#ifdef WITH_FUSE + case BLOB_IN_STAGING_FILE: +#endif + /* Compare files by path: just a heuristic that will place files + * in the same directory next to each other. */ + return tstrcmp(blob1->file_on_disk, blob2->file_on_disk); +#ifdef _WIN32 + case BLOB_IN_WINDOWS_FILE: + return cmp_windows_files(blob1->windows_file, blob2->windows_file); +#endif +#ifdef WITH_NTFS_3G + case BLOB_IN_NTFS_VOLUME: + return cmp_ntfs_locations(blob1->ntfs_loc, blob2->ntfs_loc); +#endif + default: + /* No additional sorting order defined for this resource + * location (e.g. BLOB_IN_ATTACHED_BUFFER); simply compare + * everything equal to each other. */ + return 0; + } +} + +int +sort_blob_list(struct list_head *blob_list, size_t list_head_offset, + int (*compar)(const void *, const void*)) +{ + struct list_head *cur; + struct blob_descriptor **array; + size_t i; + size_t array_size; + size_t num_blobs = 0; + + list_for_each(cur, blob_list) + num_blobs++; + + if (num_blobs <= 1) + return 0; + + array_size = num_blobs * sizeof(array[0]); + array = MALLOC(array_size); + if (array == NULL) + return WIMLIB_ERR_NOMEM; + + cur = blob_list->next; + for (i = 0; i < num_blobs; i++) { + array[i] = (struct blob_descriptor*)((u8*)cur - list_head_offset); + cur = cur->next; + } + + qsort(array, num_blobs, sizeof(array[0]), compar); + + INIT_LIST_HEAD(blob_list); + for (i = 0; i < num_blobs; i++) { + list_add_tail((struct list_head*) + ((u8*)array[i] + list_head_offset), blob_list); + } + FREE(array); + return 0; +} + +/* Sort the specified list of blobs in an order optimized for sequential + * reading. */ +int +sort_blob_list_by_sequential_order(struct list_head *blob_list, + size_t list_head_offset) +{ + return sort_blob_list(blob_list, list_head_offset, + cmp_blobs_by_sequential_order); +} + +static int +add_blob_to_array(struct blob_descriptor *blob, void *_pp) +{ + struct blob_descriptor ***pp = _pp; + *(*pp)++ = blob; + return 0; +} + +/* Iterate through the blob descriptors in the specified blob table in an order + * optimized for sequential reading. */ +int +for_blob_in_table_sorted_by_sequential_order(struct blob_table *table, + int (*visitor)(struct blob_descriptor *, void *), + void *arg) +{ + struct blob_descriptor **blob_array, **p; + size_t num_blobs = table->num_blobs; + int ret; + + blob_array = MALLOC(num_blobs * sizeof(blob_array[0])); + if (!blob_array) + return WIMLIB_ERR_NOMEM; + p = blob_array; + for_blob_in_table(table, add_blob_to_array, &p); + + wimlib_assert(p == blob_array + num_blobs); + + qsort(blob_array, num_blobs, sizeof(blob_array[0]), + cmp_blobs_by_sequential_order); + ret = 0; + for (size_t i = 0; i < num_blobs; i++) { + ret = visitor(blob_array[i], arg); + if (ret) + break; + } + FREE(blob_array); + return ret; +} + +/* On-disk format of a blob descriptor in a WIM file. + * + * Note: if the WIM file contains solid resource(s), then this structure is + * sometimes overloaded to describe a "resource" rather than a "blob". See the + * code for details. */ +struct blob_descriptor_disk { + + /* Size, offset, and flags of the blob. */ + struct wim_reshdr_disk reshdr; + + /* Which part of the split WIM this blob is in; indexed from 1. */ + le16 part_number; + + /* Reference count of this blob over all WIM images. (But see comment + * above blob_decrement_refcnt().) */ + le32 refcnt; + + /* SHA-1 message digest of the uncompressed data of this blob, or all + * zeroes if this blob is of zero length. */ + u8 hash[SHA1_HASH_SIZE]; +} __attribute__((packed)); + +/* Given a nonempty run of consecutive blob descriptors with the SOLID flag set, + * count how many specify resources (as opposed to blobs within those + * resources). + * + * Returns the resulting count. */ +static size_t +count_solid_resources(const struct blob_descriptor_disk *entries, size_t max) +{ + size_t count = 0; + do { + struct wim_reshdr reshdr; + + get_wim_reshdr(&(entries++)->reshdr, &reshdr); + + if (!(reshdr.flags & WIM_RESHDR_FLAG_SOLID)) { + /* Run was terminated by a stand-alone blob entry. */ + break; + } + + if (reshdr.uncompressed_size == SOLID_RESOURCE_MAGIC_NUMBER) { + /* This is a resource entry. */ + count++; + } + } while (--max); + return count; +} + +/* + * Given a run of consecutive blob descriptors with the SOLID flag set and + * having @num_rdescs resource entries, load resource information from them into + * the resource descriptors in the @rdescs array. + * + * Returns 0 on success, or a nonzero error code on failure. + */ +static int +do_load_solid_info(WIMStruct *wim, struct wim_resource_descriptor **rdescs, + size_t num_rdescs, + const struct blob_descriptor_disk *entries) +{ + for (size_t i = 0; i < num_rdescs; i++) { + struct wim_reshdr reshdr; + struct alt_chunk_table_header_disk hdr; + struct wim_resource_descriptor *rdesc; + int ret; + + /* Advance to next resource entry. */ + + do { + get_wim_reshdr(&(entries++)->reshdr, &reshdr); + } while (reshdr.uncompressed_size != SOLID_RESOURCE_MAGIC_NUMBER); + + rdesc = rdescs[i]; + + wim_reshdr_to_desc(&reshdr, wim, rdesc); + + /* For solid resources, the uncompressed size, compression type, + * and chunk size are stored in the resource itself, not in the + * blob table. */ + + ret = full_pread(&wim->in_fd, &hdr, + sizeof(hdr), reshdr.offset_in_wim); + if (ret) { + ERROR("Failed to read header of solid resource " + "(offset_in_wim=%"PRIu64")", + reshdr.offset_in_wim); + return ret; + } + + rdesc->uncompressed_size = le64_to_cpu(hdr.res_usize); + + /* Compression format numbers must be the same as in + * WIMGAPI to be compatible here. */ + STATIC_ASSERT(WIMLIB_COMPRESSION_TYPE_NONE == 0); + STATIC_ASSERT(WIMLIB_COMPRESSION_TYPE_XPRESS == 1); + STATIC_ASSERT(WIMLIB_COMPRESSION_TYPE_LZX == 2); + STATIC_ASSERT(WIMLIB_COMPRESSION_TYPE_LZMS == 3); + rdesc->compression_type = le32_to_cpu(hdr.compression_format); + rdesc->chunk_size = le32_to_cpu(hdr.chunk_size); + } + return 0; +} + +/* + * Given a nonempty run of consecutive blob descriptors with the SOLID flag set, + * allocate a 'struct wim_resource_descriptor' for each resource within that + * run. + * + * Returns 0 on success, or a nonzero error code on failure. + * Returns the pointers and count in *rdescs_ret and *num_rdescs_ret. + */ +static int +load_solid_info(WIMStruct *wim, + const struct blob_descriptor_disk *entries, + size_t num_remaining_entries, + struct wim_resource_descriptor ***rdescs_ret, + size_t *num_rdescs_ret) +{ + size_t num_rdescs; + struct wim_resource_descriptor **rdescs; + size_t i; + int ret; + + num_rdescs = count_solid_resources(entries, num_remaining_entries); + rdescs = CALLOC(num_rdescs, sizeof(rdescs[0])); + if (!rdescs) + return WIMLIB_ERR_NOMEM; + + for (i = 0; i < num_rdescs; i++) { + rdescs[i] = MALLOC(sizeof(struct wim_resource_descriptor)); + if (!rdescs[i]) { + ret = WIMLIB_ERR_NOMEM; + goto out_free_rdescs; + } + } + + ret = do_load_solid_info(wim, rdescs, num_rdescs, entries); + if (ret) + goto out_free_rdescs; + + wim->refcnt += num_rdescs; + + *rdescs_ret = rdescs; + *num_rdescs_ret = num_rdescs; + return 0; + +out_free_rdescs: + for (i = 0; i < num_rdescs; i++) + FREE(rdescs[i]); + FREE(rdescs); + return ret; +} + +/* Given a 'struct blob_descriptor' allocated for an on-disk blob descriptor + * with the SOLID flag set, try to assign it to resource in the current solid + * run. */ +static int +assign_blob_to_solid_resource(const struct wim_reshdr *reshdr, + struct blob_descriptor *blob, + struct wim_resource_descriptor **rdescs, + size_t num_rdescs) +{ + u64 offset = reshdr->offset_in_wim; + + /* XXX: This linear search will be slow in the degenerate case where the + * number of solid resources in the run is huge. */ + blob->size = reshdr->size_in_wim; + for (size_t i = 0; i < num_rdescs; i++) { + if (offset + blob->size <= rdescs[i]->uncompressed_size) { + blob_set_is_located_in_wim_resource(blob, rdescs[i], offset); + return 0; + } + offset -= rdescs[i]->uncompressed_size; + } + ERROR("blob could not be assigned to a solid resource"); + return WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY; +} + +static void +free_solid_rdescs(struct wim_resource_descriptor **rdescs, size_t num_rdescs) +{ + if (rdescs) { + for (size_t i = 0; i < num_rdescs; i++) { + if (list_empty(&rdescs[i]->blob_list)) { + rdescs[i]->wim->refcnt--; + FREE(rdescs[i]); + } + } + FREE(rdescs); + } +} + +static int +cmp_blobs_by_offset_in_res(const void *p1, const void *p2) +{ + const struct blob_descriptor *blob1, *blob2; + + blob1 = *(const struct blob_descriptor**)p1; + blob2 = *(const struct blob_descriptor**)p2; + + return cmp_u64(blob1->offset_in_res, blob2->offset_in_res); +} + +/* Validate the size and location of a WIM resource. */ +static int +validate_resource(struct wim_resource_descriptor *rdesc) +{ + struct blob_descriptor *blob; + bool out_of_order; + u64 expected_next_offset; + int ret; + + /* Verify that the resource itself has a valid offset and size. */ + if (rdesc->offset_in_wim + rdesc->size_in_wim < rdesc->size_in_wim) + goto invalid_due_to_overflow; + + /* Verify that each blob in the resource has a valid offset and size. + */ + expected_next_offset = 0; + out_of_order = false; + list_for_each_entry(blob, &rdesc->blob_list, rdesc_node) { + if (blob->offset_in_res + blob->size < blob->size || + blob->offset_in_res + blob->size > rdesc->uncompressed_size) + goto invalid_due_to_overflow; + + if (blob->offset_in_res >= expected_next_offset) + expected_next_offset = blob->offset_in_res + blob->size; + else + out_of_order = true; + } + + /* If the blobs were not located at strictly increasing positions (not + * allowing for overlap), sort them. Then make sure that none overlap. + */ + if (out_of_order) { + ret = sort_blob_list(&rdesc->blob_list, + offsetof(struct blob_descriptor, + rdesc_node), + cmp_blobs_by_offset_in_res); + if (ret) + return ret; + + expected_next_offset = 0; + list_for_each_entry(blob, &rdesc->blob_list, rdesc_node) { + if (blob->offset_in_res >= expected_next_offset) + expected_next_offset = blob->offset_in_res + blob->size; + else + goto invalid_due_to_overlap; + } + } + + return 0; + +invalid_due_to_overflow: + ERROR("Invalid blob table (offset overflow)"); + return WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY; + +invalid_due_to_overlap: + ERROR("Invalid blob table (blobs in solid resource overlap)"); + return WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY; +} + +static int +finish_solid_rdescs(struct wim_resource_descriptor **rdescs, size_t num_rdescs) +{ + int ret = 0; + for (size_t i = 0; i < num_rdescs; i++) { + ret = validate_resource(rdescs[i]); + if (ret) + break; + } + free_solid_rdescs(rdescs, num_rdescs); + return ret; +} + +/* + * read_blob_table() - + * + * Read the blob table from a WIM file. Usually, each entry in this table + * describes a "blob", or equivalently a "resource", that the WIM file contains, + * along with its location and SHA-1 message digest. Descriptors for + * non-metadata blobs will be saved in the in-memory blob table + * (wim->blob_table), whereas descriptors for metadata blobs will be saved in a + * special location per-image (the wim->image_metadata array). + * + * However, in WIM_VERSION_SOLID (3584) WIMs, a resource may contain multiple + * blobs that are compressed together. Such a resource is called a "solid + * resource". Solid resources are still described in the on-disk "blob table", + * although the format is not the most logical. A consecutive sequence of + * entries that all have flag WIM_RESHDR_FLAG_SOLID (0x10) set is a "solid run". + * A solid run describes a set of solid resources, each of which contains a set + * of blobs. In a solid run, a 'struct wim_reshdr_disk' with 'uncompressed_size + * = SOLID_RESOURCE_MAGIC_NUMBER (0x100000000)' specifies a solid resource, + * whereas any other 'struct wim_reshdr_disk' specifies a blob within a solid + * resource. There are some oddities in how we need to determine which solid + * resource a blob is actually in; see the code for details. + * + * Possible return values: + * WIMLIB_ERR_SUCCESS (0) + * WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY + * WIMLIB_ERR_NOMEM + * + * Or an error code caused by failure to read the blob table from the WIM + * file. + */ +int +read_blob_table(WIMStruct *wim) +{ + int ret; + size_t num_entries; + void *buf = NULL; + struct blob_table *table = NULL; + struct blob_descriptor *cur_blob = NULL; + size_t num_duplicate_blobs = 0; + size_t num_empty_blobs = 0; + size_t num_wrong_part_blobs = 0; + u32 image_index = 0; + struct wim_resource_descriptor **cur_solid_rdescs = NULL; + size_t cur_num_solid_rdescs = 0; + + /* Calculate the number of entries in the blob table. */ + num_entries = wim->hdr.blob_table_reshdr.uncompressed_size / + sizeof(struct blob_descriptor_disk); + + /* Read the blob table into a buffer. */ + ret = wim_reshdr_to_data(&wim->hdr.blob_table_reshdr, wim, &buf); + if (ret) + goto out; + + /* Allocate a hash table to map SHA-1 message digests into blob + * descriptors. This is the in-memory "blob table". */ + table = new_blob_table(num_entries); + if (!table) + goto oom; + + /* Allocate and initialize blob descriptors from the raw blob table + * buffer. */ + for (size_t i = 0; i < num_entries; i++) { + const struct blob_descriptor_disk *disk_entry = + &((const struct blob_descriptor_disk*)buf)[i]; + struct wim_reshdr reshdr; + u16 part_number; + + /* Get the resource header */ + get_wim_reshdr(&disk_entry->reshdr, &reshdr); + + /* Ignore SOLID flag if it isn't supposed to be used in this WIM + * version. */ + if (wim->hdr.wim_version == WIM_VERSION_DEFAULT) + reshdr.flags &= ~WIM_RESHDR_FLAG_SOLID; + + /* Allocate a new 'struct blob_descriptor'. */ + cur_blob = new_blob_descriptor(); + if (!cur_blob) + goto oom; + + /* Get the part number, reference count, and hash. */ + part_number = le16_to_cpu(disk_entry->part_number); + cur_blob->refcnt = le32_to_cpu(disk_entry->refcnt); + copy_hash(cur_blob->hash, disk_entry->hash); + + if (reshdr.flags & WIM_RESHDR_FLAG_SOLID) { + + /* SOLID entry */ + + if (!cur_solid_rdescs) { + /* Starting new run */ + ret = load_solid_info(wim, disk_entry, + num_entries - i, + &cur_solid_rdescs, + &cur_num_solid_rdescs); + if (ret) + goto out; + } + + if (reshdr.uncompressed_size == SOLID_RESOURCE_MAGIC_NUMBER) { + /* Resource entry, not blob entry */ + goto free_cur_blob_and_continue; + } + + /* Blob entry */ + + ret = assign_blob_to_solid_resource(&reshdr, + cur_blob, + cur_solid_rdescs, + cur_num_solid_rdescs); + if (ret) + goto out; + + } else { + /* Normal blob/resource entry; SOLID not set. */ + + struct wim_resource_descriptor *rdesc; + + if (unlikely(cur_solid_rdescs)) { + /* This entry terminated a solid run. */ + ret = finish_solid_rdescs(cur_solid_rdescs, + cur_num_solid_rdescs); + cur_solid_rdescs = NULL; + if (ret) + goto out; + } + + if (unlikely(!(reshdr.flags & WIM_RESHDR_FLAG_COMPRESSED) && + (reshdr.size_in_wim != reshdr.uncompressed_size))) + { + ERROR("Uncompressed resource has " + "size_in_wim != uncompressed_size"); + ret = WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY; + goto out; + } + + /* Set up a resource descriptor for this blob. */ + + rdesc = MALLOC(sizeof(struct wim_resource_descriptor)); + if (!rdesc) + goto oom; + + wim_reshdr_to_desc_and_blob(&reshdr, wim, rdesc, cur_blob); + wim->refcnt++; + } + + /* cur_blob is now a blob bound to a resource. */ + + /* Ignore entries with all zeroes in the hash field. */ + if (unlikely(is_zero_hash(cur_blob->hash))) + goto free_cur_blob_and_continue; + + /* Verify that the blob has nonzero size. */ + if (unlikely(cur_blob->size == 0)) { + num_empty_blobs++; + goto free_cur_blob_and_continue; + } + + /* Verify that the part number matches that of the underlying + * WIM file. */ + if (unlikely(part_number != wim->hdr.part_number)) { + num_wrong_part_blobs++; + goto free_cur_blob_and_continue; + } + + if (reshdr.flags & WIM_RESHDR_FLAG_METADATA) { + /* Blob table entry for a metadata resource. */ + + /* Metadata entries with no references must be ignored. + * See, for example, the WinPE WIMs from the WAIK v2.1. + */ + if (cur_blob->refcnt == 0) + goto free_cur_blob_and_continue; + + if (cur_blob->refcnt != 1) { + /* We don't currently support this case due to + * the complications of multiple images sharing + * the same metadata resource or a metadata + * resource also being referenced by files. */ + ERROR("Found metadata resource with refcnt != 1"); + ret = WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY; + goto out; + } + + if (reshdr.flags & WIM_RESHDR_FLAG_SOLID) { + ERROR("Image metadata in solid resources " + "is unsupported."); + ret = WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY; + goto out; + } + + if (wim->hdr.part_number != 1) { + WARNING("Ignoring metadata resource found in a " + "non-first part of the split WIM"); + goto free_cur_blob_and_continue; + } + + /* The number of entries in the blob table with + * WIM_RESHDR_FLAG_METADATA set should be the same as + * the image_count field in the WIM header. */ + if (image_index == wim->hdr.image_count) { + WARNING("Found more metadata resources than images"); + goto free_cur_blob_and_continue; + } + + /* Notice very carefully: We are assigning the metadata + * resources to images in the same order in which their + * blob table entries occur on disk. (This is also the + * behavior of Microsoft's software.) In particular, + * this overrides the actual locations of the metadata + * resources themselves in the WIM file as well as any + * information written in the XML data. */ + wim->image_metadata[image_index] = new_unloaded_image_metadata(cur_blob); + if (!wim->image_metadata[image_index]) + goto oom; + image_index++; + } else { + /* Blob table entry for a non-metadata blob. */ + + /* Ignore this blob if it's a duplicate. */ + if (lookup_blob(table, cur_blob->hash)) { + num_duplicate_blobs++; + goto free_cur_blob_and_continue; + } + + /* Insert the blob into the in-memory blob table, keyed + * by its SHA-1 message digest. */ + blob_table_insert(table, cur_blob); + } + + continue; + + free_cur_blob_and_continue: + if (cur_solid_rdescs && + cur_blob->blob_location == BLOB_IN_WIM) + blob_unset_is_located_in_wim_resource(cur_blob); + free_blob_descriptor(cur_blob); + } + cur_blob = NULL; + + if (cur_solid_rdescs) { + /* End of blob table terminated a solid run. */ + ret = finish_solid_rdescs(cur_solid_rdescs, cur_num_solid_rdescs); + cur_solid_rdescs = NULL; + if (ret) + goto out; + } + + if (wim->hdr.part_number == 1 && image_index != wim->hdr.image_count) { + WARNING("Could not find metadata resources for all images"); + wim->hdr.image_count = image_index; + } + + if (num_duplicate_blobs > 0) + WARNING("Ignoring %zu duplicate blobs", num_duplicate_blobs); + + if (num_empty_blobs > 0) + WARNING("Ignoring %zu empty blobs", num_empty_blobs); + + if (num_wrong_part_blobs > 0) { + WARNING("Ignoring %zu blobs with wrong part number", + num_wrong_part_blobs); + } + + wim->blob_table = table; + ret = 0; + goto out_free_buf; + +oom: + ERROR("Not enough memory to read blob table!"); + ret = WIMLIB_ERR_NOMEM; +out: + free_solid_rdescs(cur_solid_rdescs, cur_num_solid_rdescs); + free_blob_descriptor(cur_blob); + free_blob_table(table); +out_free_buf: + FREE(buf); + return ret; +} + +static void +write_blob_descriptor(struct blob_descriptor_disk *disk_entry, + const struct wim_reshdr *out_reshdr, + u16 part_number, u32 refcnt, const u8 *hash) +{ + put_wim_reshdr(out_reshdr, &disk_entry->reshdr); + disk_entry->part_number = cpu_to_le16(part_number); + disk_entry->refcnt = cpu_to_le32(refcnt); + copy_hash(disk_entry->hash, hash); +} + +/* Note: the list of blob descriptors must be sorted so that all entries for the + * same solid resource are consecutive. In addition, blob descriptors for + * metadata resources must be in the same order as the indices of the underlying + * images. */ +int +write_blob_table_from_blob_list(struct list_head *blob_list, + struct filedes *out_fd, + u16 part_number, + struct wim_reshdr *out_reshdr, + int write_resource_flags) +{ + size_t table_size; + struct blob_descriptor *blob; + struct blob_descriptor_disk *table_buf; + struct blob_descriptor_disk *table_buf_ptr; + int ret; + u64 prev_res_offset_in_wim = ~0ULL; + u64 prev_uncompressed_size; + u64 logical_offset; + + table_size = 0; + list_for_each_entry(blob, blob_list, blob_table_list) { + table_size += sizeof(struct blob_descriptor_disk); + + if (blob->out_reshdr.flags & WIM_RESHDR_FLAG_SOLID && + blob->out_res_offset_in_wim != prev_res_offset_in_wim) + { + table_size += sizeof(struct blob_descriptor_disk); + prev_res_offset_in_wim = blob->out_res_offset_in_wim; + } + } + + table_buf = MALLOC(table_size); + if (table_buf == NULL) { + ERROR("Failed to allocate %zu bytes for temporary blob table", + table_size); + return WIMLIB_ERR_NOMEM; + } + table_buf_ptr = table_buf; + + prev_res_offset_in_wim = ~0ULL; + prev_uncompressed_size = 0; + logical_offset = 0; + list_for_each_entry(blob, blob_list, blob_table_list) { + if (blob->out_reshdr.flags & WIM_RESHDR_FLAG_SOLID) { + struct wim_reshdr tmp_reshdr; + + /* Eww. When WIMGAPI sees multiple solid resources, it + * expects the offsets to be adjusted as if there were + * really only one solid resource. */ + + if (blob->out_res_offset_in_wim != prev_res_offset_in_wim) { + /* Put the resource entry for solid resource */ + tmp_reshdr.offset_in_wim = blob->out_res_offset_in_wim; + tmp_reshdr.size_in_wim = blob->out_res_size_in_wim; + tmp_reshdr.uncompressed_size = SOLID_RESOURCE_MAGIC_NUMBER; + tmp_reshdr.flags = WIM_RESHDR_FLAG_SOLID; + + write_blob_descriptor(table_buf_ptr++, &tmp_reshdr, + part_number, 1, zero_hash); + + logical_offset += prev_uncompressed_size; + + prev_res_offset_in_wim = blob->out_res_offset_in_wim; + prev_uncompressed_size = blob->out_res_uncompressed_size; + } + tmp_reshdr = blob->out_reshdr; + tmp_reshdr.offset_in_wim += logical_offset; + write_blob_descriptor(table_buf_ptr++, &tmp_reshdr, + part_number, blob->out_refcnt, blob->hash); + } else { + write_blob_descriptor(table_buf_ptr++, &blob->out_reshdr, + part_number, blob->out_refcnt, blob->hash); + } + + } + wimlib_assert((u8*)table_buf_ptr - (u8*)table_buf == table_size); + + /* Write the blob table uncompressed. Although wimlib can handle a + * compressed blob table, MS software cannot. */ + ret = write_wim_resource_from_buffer(table_buf, + table_size, + true, + out_fd, + WIMLIB_COMPRESSION_TYPE_NONE, + 0, + out_reshdr, + NULL, + write_resource_flags); + FREE(table_buf); + return ret; +} + +/* Allocate a blob descriptor for the contents of the buffer, or re-use an + * existing descriptor in @blob_table for an identical blob. */ +struct blob_descriptor * +new_blob_from_data_buffer(const void *buffer, size_t size, + struct blob_table *blob_table) +{ + u8 hash[SHA1_HASH_SIZE]; + struct blob_descriptor *blob; + void *buffer_copy; + + sha1(buffer, size, hash); + + blob = lookup_blob(blob_table, hash); + if (blob) + return blob; + + blob = new_blob_descriptor(); + if (!blob) + return NULL; + + buffer_copy = memdup(buffer, size); + if (!buffer_copy) { + free_blob_descriptor(blob); + return NULL; + } + blob_set_is_located_in_attached_buffer(blob, buffer_copy, size); + copy_hash(blob->hash, hash); + blob_table_insert(blob_table, blob); + return blob; +} + +struct blob_descriptor * +after_blob_hashed(struct blob_descriptor *blob, + struct blob_descriptor **back_ptr, + struct blob_table *blob_table, struct wim_inode *inode) +{ + struct blob_descriptor *duplicate_blob; + + list_del(&blob->unhashed_list); + blob->unhashed = 0; + + /* Look for a duplicate blob */ + duplicate_blob = lookup_blob(blob_table, blob->hash); + if (duplicate_blob) { + /* We have a duplicate blob. Transfer the reference counts from + * this blob to the duplicate and update the reference to this + * blob (from a stream) to point to the duplicate. The caller + * is responsible for freeing @blob if needed. */ + if (duplicate_blob->size != blob->size) { + tchar hash_str[SHA1_HASH_STRING_LEN]; + + sprint_hash(blob->hash, hash_str); + WARNING("SHA-1 collision at \"%"TS"\"\n" + " (hash=%"TS", size=%"PRIu64", other_size=%"PRIu64").\n" + " File will be corrupted!", + inode_any_full_path(inode), hash_str, + blob->size, duplicate_blob->size); + } + duplicate_blob->refcnt += blob->refcnt; + blob->refcnt = 0; + *back_ptr = duplicate_blob; + return duplicate_blob; + } else { + /* No duplicate blob, so we need to insert this blob into the + * blob table and treat it as a hashed blob. */ + blob_table_insert(blob_table, blob); + return blob; + } +} + +/* + * Calculate the SHA-1 message digest of a blob and move its descriptor from the + * list of unhashed blobs to the blob table, possibly joining it with an + * identical blob. + * + * @blob: + * The blob to hash + * @blob_table: + * The blob table in which the blob needs to be indexed + * @blob_ret: + * On success, a pointer to the resulting blob descriptor is written to + * this location. This will be the same as @blob if it was inserted into + * the blob table, or different if a duplicate blob was found. + * + * Returns 0 on success; nonzero if there is an error reading the blob data. + */ +int +hash_unhashed_blob(struct blob_descriptor *blob, struct blob_table *blob_table, + struct blob_descriptor **blob_ret) +{ + struct blob_descriptor **back_ptr; + struct wim_inode *inode; + int ret; + + back_ptr = retrieve_pointer_to_unhashed_blob(blob); + inode = blob->back_inode; + + ret = sha1_blob(blob); + if (ret) + return ret; + + *blob_ret = after_blob_hashed(blob, back_ptr, blob_table, inode); + return 0; +} + +void +blob_to_wimlib_resource_entry(const struct blob_descriptor *blob, + struct wimlib_resource_entry *wentry) +{ + memset(wentry, 0, sizeof(*wentry)); + + wentry->uncompressed_size = blob->size; + if (blob->blob_location == BLOB_IN_WIM) { + unsigned res_flags = blob->rdesc->flags; + + wentry->part_number = blob->rdesc->wim->hdr.part_number; + if (res_flags & WIM_RESHDR_FLAG_SOLID) { + wentry->offset = blob->offset_in_res; + } else { + wentry->compressed_size = blob->rdesc->size_in_wim; + wentry->offset = blob->rdesc->offset_in_wim; + } + wentry->raw_resource_offset_in_wim = blob->rdesc->offset_in_wim; + wentry->raw_resource_compressed_size = blob->rdesc->size_in_wim; + wentry->raw_resource_uncompressed_size = blob->rdesc->uncompressed_size; + + wentry->is_compressed = (res_flags & WIM_RESHDR_FLAG_COMPRESSED) != 0; + wentry->is_free = (res_flags & WIM_RESHDR_FLAG_FREE) != 0; + wentry->is_spanned = (res_flags & WIM_RESHDR_FLAG_SPANNED) != 0; + wentry->packed = (res_flags & WIM_RESHDR_FLAG_SOLID) != 0; + } + if (!blob->unhashed) + copy_hash(wentry->sha1_hash, blob->hash); + wentry->reference_count = blob->refcnt; + wentry->is_metadata = blob->is_metadata; +} + +struct iterate_blob_context { + wimlib_iterate_lookup_table_callback_t cb; + void *user_ctx; +}; + +static int +do_iterate_blob(struct blob_descriptor *blob, void *_ctx) +{ + struct iterate_blob_context *ctx = _ctx; + struct wimlib_resource_entry entry; + + blob_to_wimlib_resource_entry(blob, &entry); + return (*ctx->cb)(&entry, ctx->user_ctx); +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_iterate_lookup_table(WIMStruct *wim, int flags, + wimlib_iterate_lookup_table_callback_t cb, + void *user_ctx) +{ + if (flags != 0) + return WIMLIB_ERR_INVALID_PARAM; + + struct iterate_blob_context ctx = { + .cb = cb, + .user_ctx = user_ctx, + }; + if (wim_has_metadata(wim)) { + int ret; + for (int i = 0; i < wim->hdr.image_count; i++) { + struct blob_descriptor *blob; + struct wim_image_metadata *imd = wim->image_metadata[i]; + + ret = do_iterate_blob(imd->metadata_blob, &ctx); + if (ret) + return ret; + image_for_each_unhashed_blob(blob, imd) { + ret = do_iterate_blob(blob, &ctx); + if (ret) + return ret; + } + } + } + return for_blob_in_table(wim->blob_table, do_iterate_blob, &ctx); +} diff --git a/src/wimlib/compress.c b/src/wimlib/compress.c new file mode 100644 index 00000000..8396316d --- /dev/null +++ b/src/wimlib/compress.c @@ -0,0 +1,193 @@ +/* + * compress.c + * + * Generic functions for compression, wrapping around actual compression + * implementations. + */ + +/* + * Copyright (C) 2013, 2014 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib.h" +#include "wimlib/error.h" +#include "wimlib/compressor_ops.h" +#include "wimlib/util.h" + +struct wimlib_compressor { + const struct compressor_ops *ops; + void *private; + enum wimlib_compression_type ctype; + size_t max_block_size; +}; + +static const struct compressor_ops * const compressor_ops[] = { + [WIMLIB_COMPRESSION_TYPE_XPRESS] = &xpress_compressor_ops, + [WIMLIB_COMPRESSION_TYPE_LZX] = &lzx_compressor_ops, + [WIMLIB_COMPRESSION_TYPE_LZMS] = &lzms_compressor_ops, +}; + +/* Scale: 10 = low, 50 = medium, 100 = high */ + +#define DEFAULT_COMPRESSION_LEVEL 50 + +static unsigned int default_compression_levels[ARRAY_LEN(compressor_ops)]; + +static bool +compressor_ctype_valid(int ctype) +{ + return (ctype >= 0 && + ctype < ARRAY_LEN(compressor_ops) && + compressor_ops[ctype] != NULL); +} + +WIMLIBAPI int +wimlib_set_default_compression_level(int ctype, unsigned int compression_level) +{ + if (ctype == -1) { + for (int i = 0; i < ARRAY_LEN(default_compression_levels); i++) + default_compression_levels[i] = compression_level; + } else { + if (!compressor_ctype_valid(ctype)) + return WIMLIB_ERR_INVALID_COMPRESSION_TYPE; + + default_compression_levels[ctype] = compression_level; + } + return 0; +} + +WIMLIBAPI u64 +wimlib_get_compressor_needed_memory(enum wimlib_compression_type ctype, + size_t max_block_size, + unsigned int compression_level) +{ + bool destructive; + const struct compressor_ops *ops; + u64 size; + + destructive = (compression_level & WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE); + compression_level &= ~WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE; + + if (!compressor_ctype_valid(ctype)) + return 0; + + if (compression_level > 0xFFFFFF) + return 0; + + if (max_block_size == 0) + return 0; + + ops = compressor_ops[ctype]; + + if (compression_level == 0) + compression_level = default_compression_levels[ctype]; + if (compression_level == 0) + compression_level = DEFAULT_COMPRESSION_LEVEL; + + if (ops->get_needed_memory) { + size = ops->get_needed_memory(max_block_size, compression_level, + destructive); + + /* 0 is never valid and indicates an invalid max_block_size. */ + if (size == 0) + return 0; + } else { + size = 0; + } + return size + sizeof(struct wimlib_compressor); +} + +WIMLIBAPI int +wimlib_create_compressor(enum wimlib_compression_type ctype, + size_t max_block_size, + unsigned int compression_level, + struct wimlib_compressor **c_ret) +{ + bool destructive; + struct wimlib_compressor *c; + int ret; + + ret = wimlib_global_init(0); + if (ret) + return ret; + + destructive = (compression_level & WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE); + compression_level &= ~WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE; + + if (!compressor_ctype_valid(ctype)) + return WIMLIB_ERR_INVALID_COMPRESSION_TYPE; + + if (compression_level > 0xFFFFFF) + return WIMLIB_ERR_INVALID_PARAM; + + if (c_ret == NULL) + return WIMLIB_ERR_INVALID_PARAM; + + if (max_block_size == 0) + return WIMLIB_ERR_INVALID_PARAM; + + c = MALLOC(sizeof(*c)); + if (c == NULL) + return WIMLIB_ERR_NOMEM; + c->ops = compressor_ops[ctype]; + c->private = NULL; + c->ctype = ctype; + c->max_block_size = max_block_size; + if (c->ops->create_compressor) { + if (compression_level == 0) + compression_level = default_compression_levels[ctype]; + if (compression_level == 0) + compression_level = DEFAULT_COMPRESSION_LEVEL; + + ret = c->ops->create_compressor(max_block_size, + compression_level, + destructive, + &c->private); + if (ret) { + FREE(c); + return ret; + } + } + *c_ret = c; + return 0; +} + +WIMLIBAPI size_t +wimlib_compress(const void *uncompressed_data, size_t uncompressed_size, + void *compressed_data, size_t compressed_size_avail, + struct wimlib_compressor *c) +{ + if (unlikely(uncompressed_size == 0 || uncompressed_size > c->max_block_size)) + return 0; + + return c->ops->compress(uncompressed_data, uncompressed_size, + compressed_data, compressed_size_avail, + c->private); +} + +WIMLIBAPI void +wimlib_free_compressor(struct wimlib_compressor *c) +{ + if (c) { + if (c->ops->free_compressor) + c->ops->free_compressor(c->private); + FREE(c); + } +} diff --git a/src/wimlib/compress_common.c b/src/wimlib/compress_common.c new file mode 100644 index 00000000..0e2ba05a --- /dev/null +++ b/src/wimlib/compress_common.c @@ -0,0 +1,671 @@ +/* + * compress_common.c + * + * Code for compression shared among multiple compression formats. + * + * Copyright 2022 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <string.h> + +#include "wimlib/assert.h" +#include "wimlib/compress_common.h" +#include "wimlib/util.h" + +/* + * Given the binary tree node A[subtree_idx] whose children already satisfy the + * maxheap property, swap the node with its greater child until it is greater + * than or equal to both of its children, so that the maxheap property is + * satisfied in the subtree rooted at A[subtree_idx]. 'A' uses 1-based indices. + */ +static void +heapify_subtree(u32 A[], unsigned length, unsigned subtree_idx) +{ + unsigned parent_idx; + unsigned child_idx; + u32 v; + + v = A[subtree_idx]; + parent_idx = subtree_idx; + while ((child_idx = parent_idx * 2) <= length) { + if (child_idx < length && A[child_idx + 1] > A[child_idx]) + child_idx++; + if (v >= A[child_idx]) + break; + A[parent_idx] = A[child_idx]; + parent_idx = child_idx; + } + A[parent_idx] = v; +} + +/* + * Rearrange the array 'A' so that it satisfies the maxheap property. + * 'A' uses 1-based indices, so the children of A[i] are A[i*2] and A[i*2 + 1]. + */ +static void +heapify_array(u32 A[], unsigned length) +{ + unsigned subtree_idx; + + for (subtree_idx = length / 2; subtree_idx >= 1; subtree_idx--) + heapify_subtree(A, length, subtree_idx); +} + +/* + * Sort the array 'A', which contains 'length' unsigned 32-bit integers. + * + * Note: name this function heap_sort() instead of heapsort() to avoid colliding + * with heapsort() from stdlib.h on BSD-derived systems --- though this isn't + * necessary when compiling with -D_ANSI_SOURCE, which is the better solution. + */ +static void +heap_sort(u32 A[], unsigned length) +{ + A--; /* Use 1-based indices */ + + heapify_array(A, length); + + while (length >= 2) { + u32 tmp = A[length]; + + A[length] = A[1]; + A[1] = tmp; + length--; + heapify_subtree(A, length, 1); + } +} + +#define NUM_SYMBOL_BITS 10 +#define NUM_FREQ_BITS (32 - NUM_SYMBOL_BITS) +#define SYMBOL_MASK ((1 << NUM_SYMBOL_BITS) - 1) +#define FREQ_MASK (~SYMBOL_MASK) + +#define GET_NUM_COUNTERS(num_syms) (num_syms) + +/* + * Sort the symbols primarily by frequency and secondarily by symbol value. + * Discard symbols with zero frequency and fill in an array with the remaining + * symbols, along with their frequencies. The low NUM_SYMBOL_BITS bits of each + * array entry will contain the symbol value, and the remaining bits will + * contain the frequency. + * + * @num_syms + * Number of symbols in the alphabet, at most 1 << NUM_SYMBOL_BITS. + * + * @freqs[num_syms] + * Frequency of each symbol, summing to at most (1 << NUM_FREQ_BITS) - 1. + * + * @lens[num_syms] + * An array that eventually will hold the length of each codeword. This + * function only fills in the codeword lengths for symbols that have zero + * frequency, which are not well defined per se but will be set to 0. + * + * @symout[num_syms] + * The output array, described above. + * + * Returns the number of entries in 'symout' that were filled. This is the + * number of symbols that have nonzero frequency. + */ +static unsigned +sort_symbols(unsigned num_syms, const u32 freqs[], u8 lens[], u32 symout[]) +{ + unsigned sym; + unsigned i; + unsigned num_used_syms; + unsigned num_counters; + unsigned counters[GET_NUM_COUNTERS(MAX_NUM_SYMS)]; + + /* + * We use heapsort, but with an added optimization. Since often most + * symbol frequencies are low, we first do a count sort using a limited + * number of counters. High frequencies are counted in the last + * counter, and only they will be sorted with heapsort. + * + * Note: with more symbols, it is generally beneficial to have more + * counters. About 1 counter per symbol seems fastest. + */ + + num_counters = GET_NUM_COUNTERS(num_syms); + + memset(counters, 0, num_counters * sizeof(counters[0])); + + /* Count the frequencies. */ + for (sym = 0; sym < num_syms; sym++) + counters[MIN(freqs[sym], num_counters - 1)]++; + + /* + * Make the counters cumulative, ignoring the zero-th, which counted + * symbols with zero frequency. As a side effect, this calculates the + * number of symbols with nonzero frequency. + */ + num_used_syms = 0; + for (i = 1; i < num_counters; i++) { + unsigned count = counters[i]; + + counters[i] = num_used_syms; + num_used_syms += count; + } + + /* + * Sort nonzero-frequency symbols using the counters. At the same time, + * set the codeword lengths of zero-frequency symbols to 0. + */ + for (sym = 0; sym < num_syms; sym++) { + u32 freq = freqs[sym]; + + if (freq != 0) { + symout[counters[MIN(freq, num_counters - 1)]++] = + sym | (freq << NUM_SYMBOL_BITS); + } else { + lens[sym] = 0; + } + } + + /* Sort the symbols counted in the last counter. */ + heap_sort(symout + counters[num_counters - 2], + counters[num_counters - 1] - counters[num_counters - 2]); + + return num_used_syms; +} + +/* + * Build a Huffman tree. + * + * This is an optimized implementation that + * (a) takes advantage of the frequencies being already sorted; + * (b) only generates non-leaf nodes, since the non-leaf nodes of a Huffman + * tree are sufficient to generate a canonical code; + * (c) Only stores parent pointers, not child pointers; + * (d) Produces the nodes in the same memory used for input frequency + * information. + * + * Array 'A', which contains 'sym_count' entries, is used for both input and + * output. For this function, 'sym_count' must be at least 2. + * + * For input, the array must contain the frequencies of the symbols, sorted in + * increasing order. Specifically, each entry must contain a frequency left + * shifted by NUM_SYMBOL_BITS bits. Any data in the low NUM_SYMBOL_BITS bits of + * the entries will be ignored by this function. Although these bits will, in + * fact, contain the symbols that correspond to the frequencies, this function + * is concerned with frequencies only and keeps the symbols as-is. + * + * For output, this function will produce the non-leaf nodes of the Huffman + * tree. These nodes will be stored in the first (sym_count - 1) entries of the + * array. Entry A[sym_count - 2] will represent the root node. Each other node + * will contain the zero-based index of its parent node in 'A', left shifted by + * NUM_SYMBOL_BITS bits. The low NUM_SYMBOL_BITS bits of each entry in A will + * be kept as-is. Again, note that although these low bits will, in fact, + * contain a symbol value, this symbol will have *no relationship* with the + * Huffman tree node that happens to occupy the same slot. This is because this + * implementation only generates the non-leaf nodes of the tree. + */ +static void +build_tree(u32 A[], unsigned sym_count) +{ + const unsigned last_idx = sym_count - 1; + + /* Index of the next lowest frequency leaf that still needs a parent */ + unsigned i = 0; + + /* + * Index of the next lowest frequency non-leaf that still needs a + * parent, or 'e' if there is currently no such node + */ + unsigned b = 0; + + /* Index of the next spot for a non-leaf (will overwrite a leaf) */ + unsigned e = 0; + + do { + u32 new_freq; + + /* + * Select the next two lowest frequency nodes among the leaves + * A[i] and non-leaves A[b], and create a new node A[e] to be + * their parent. Set the new node's frequency to the sum of the + * frequencies of its two children. + * + * Usually the next two lowest frequency nodes are of the same + * type (leaf or non-leaf), so check those cases first. + */ + if (i + 1 <= last_idx && + (b == e || (A[i + 1] & FREQ_MASK) <= (A[b] & FREQ_MASK))) { + /* Two leaves */ + new_freq = (A[i] & FREQ_MASK) + (A[i + 1] & FREQ_MASK); + i += 2; + } else if (b + 2 <= e && + (i > last_idx || + (A[b + 1] & FREQ_MASK) < (A[i] & FREQ_MASK))) { + /* Two non-leaves */ + new_freq = (A[b] & FREQ_MASK) + (A[b + 1] & FREQ_MASK); + A[b] = (e << NUM_SYMBOL_BITS) | (A[b] & SYMBOL_MASK); + A[b + 1] = (e << NUM_SYMBOL_BITS) | + (A[b + 1] & SYMBOL_MASK); + b += 2; + } else { + /* One leaf and one non-leaf */ + new_freq = (A[i] & FREQ_MASK) + (A[b] & FREQ_MASK); + A[b] = (e << NUM_SYMBOL_BITS) | (A[b] & SYMBOL_MASK); + i++; + b++; + } + A[e] = new_freq | (A[e] & SYMBOL_MASK); + /* + * A binary tree with 'n' leaves has 'n - 1' non-leaves, so the + * tree is complete once we've created 'n - 1' non-leaves. + */ + } while (++e < last_idx); +} + +/* + * Given the stripped-down Huffman tree constructed by build_tree(), determine + * the number of codewords that should be assigned each possible length, taking + * into account the length-limited constraint. + * + * @A + * The array produced by build_tree(), containing parent index information + * for the non-leaf nodes of the Huffman tree. Each entry in this array is + * a node; a node's parent always has a greater index than that node + * itself. This function will overwrite the parent index information in + * this array, so essentially it will destroy the tree. However, the data + * in the low NUM_SYMBOL_BITS of each entry will be preserved. + * + * @root_idx + * The 0-based index of the root node in 'A', and consequently one less + * than the number of tree node entries in 'A'. (Or, really 2 less than + * the actual length of 'A'.) + * + * @len_counts + * An array of length ('max_codeword_len' + 1) in which the number of + * codewords having each length <= max_codeword_len will be returned. + * + * @max_codeword_len + * The maximum permissible codeword length. + */ +static void +compute_length_counts(u32 A[], unsigned root_idx, unsigned len_counts[], + unsigned max_codeword_len) +{ + unsigned len; + int node; + + /* + * The key observations are: + * + * (1) We can traverse the non-leaf nodes of the tree, always visiting a + * parent before its children, by simply iterating through the array + * in reverse order. Consequently, we can compute the depth of each + * node in one pass, overwriting the parent indices with depths. + * + * (2) We can initially assume that in the real Huffman tree, both + * children of the root are leaves. This corresponds to two + * codewords of length 1. Then, whenever we visit a (non-leaf) node + * during the traversal, we modify this assumption to account for + * the current node *not* being a leaf, but rather its two children + * being leaves. This causes the loss of one codeword for the + * current depth and the addition of two codewords for the current + * depth plus one. + * + * (3) We can handle the length-limited constraint fairly easily by + * simply using the largest length available when a depth exceeds + * max_codeword_len. + */ + + for (len = 0; len <= max_codeword_len; len++) + len_counts[len] = 0; + len_counts[1] = 2; + + /* Set the root node's depth to 0. */ + A[root_idx] &= SYMBOL_MASK; + + for (node = root_idx - 1; node >= 0; node--) { + + /* Calculate the depth of this node. */ + + unsigned parent = A[node] >> NUM_SYMBOL_BITS; + unsigned parent_depth = A[parent] >> NUM_SYMBOL_BITS; + unsigned depth = parent_depth + 1; + unsigned len = depth; + + /* + * Set the depth of this node so that it is available when its + * children (if any) are processed. + */ + A[node] = (A[node] & SYMBOL_MASK) | (depth << NUM_SYMBOL_BITS); + + /* + * If needed, decrease the length to meet the length-limited + * constraint. This is not the optimal method for generating + * length-limited Huffman codes! But it should be good enough. + */ + if (len >= max_codeword_len) { + len = max_codeword_len; + do { + len--; + } while (len_counts[len] == 0); + } + + /* + * Account for the fact that we have a non-leaf node at the + * current depth. + */ + len_counts[len]--; + len_counts[len + 1] += 2; + } +} + +/* + * Generate the codewords for a canonical Huffman code. + * + * @A + * The output array for codewords. In addition, initially this + * array must contain the symbols, sorted primarily by frequency and + * secondarily by symbol value, in the low NUM_SYMBOL_BITS bits of + * each entry. + * + * @len + * Output array for codeword lengths. + * + * @len_counts + * An array that provides the number of codewords that will have + * each possible length <= max_codeword_len. + * + * @max_codeword_len + * Maximum length, in bits, of each codeword. + * + * @num_syms + * Number of symbols in the alphabet, including symbols with zero + * frequency. This is the length of the 'A' and 'len' arrays. + */ +static void +gen_codewords(u32 A[], u8 lens[], const unsigned len_counts[], + unsigned max_codeword_len, unsigned num_syms) +{ + u32 next_codewords[MAX_CODEWORD_LEN + 1]; + unsigned i; + unsigned len; + unsigned sym; + + /* + * Given the number of codewords that will have each length, assign + * codeword lengths to symbols. We do this by assigning the lengths in + * decreasing order to the symbols sorted primarily by increasing + * frequency and secondarily by increasing symbol value. + */ + for (i = 0, len = max_codeword_len; len >= 1; len--) { + unsigned count = len_counts[len]; + + while (count--) + lens[A[i++] & SYMBOL_MASK] = len; + } + + /* + * Generate the codewords themselves. We initialize the + * 'next_codewords' array to provide the lexicographically first + * codeword of each length, then assign codewords in symbol order. This + * produces a canonical code. + */ + next_codewords[0] = 0; + next_codewords[1] = 0; + for (len = 2; len <= max_codeword_len; len++) + next_codewords[len] = + (next_codewords[len - 1] + len_counts[len - 1]) << 1; + + for (sym = 0; sym < num_syms; sym++) + A[sym] = next_codewords[lens[sym]]++; +} + +/* + * --------------------------------------------------------------------- + * make_canonical_huffman_code() + * --------------------------------------------------------------------- + * + * Given an alphabet and the frequency of each symbol in it, construct a + * length-limited canonical Huffman code. + * + * @num_syms + * The number of symbols in the alphabet. The symbols are the integers in + * the range [0, num_syms - 1]. This parameter must be at least 2 and + * must not exceed (1 << NUM_SYMBOL_BITS). + * + * @max_codeword_len + * The maximum permissible codeword length. + * + * @freqs + * An array of length @num_syms that gives the frequency of each symbol. + * It is valid for some, none, or all of the frequencies to be 0. The sum + * of frequencies must not exceed (1 << NUM_FREQ_BITS) - 1. + * + * @lens + * An array of @num_syms entries in which this function will return the + * length, in bits, of the codeword assigned to each symbol. Symbols with + * 0 frequency will not have codewords per se, but their entries in this + * array will be set to 0. No lengths greater than @max_codeword_len will + * be assigned. + * + * @codewords + * An array of @num_syms entries in which this function will return the + * codeword for each symbol, right-justified and padded on the left with + * zeroes. Codewords for symbols with 0 frequency will be undefined. + * + * --------------------------------------------------------------------- + * + * This function builds a length-limited canonical Huffman code. + * + * A length-limited Huffman code contains no codewords longer than some + * specified length, and has exactly (with some algorithms) or approximately + * (with the algorithm used here) the minimum weighted path length from the + * root, given this constraint. + * + * A canonical Huffman code satisfies the properties that a longer codeword + * never lexicographically precedes a shorter codeword, and the lexicographic + * ordering of codewords of the same length is the same as the lexicographic + * ordering of the corresponding symbols. A canonical Huffman code, or more + * generally a canonical prefix code, can be reconstructed from only a list + * containing the codeword length of each symbol. + * + * The classic algorithm to generate a Huffman code creates a node for each + * symbol, then inserts these nodes into a min-heap keyed by symbol frequency. + * Then, repeatedly, the two lowest-frequency nodes are removed from the + * min-heap and added as the children of a new node having frequency equal to + * the sum of its two children, which is then inserted into the min-heap. When + * only a single node remains in the min-heap, it is the root of the Huffman + * tree. The codeword for each symbol is determined by the path needed to reach + * the corresponding node from the root. Descending to the left child appends a + * 0 bit, whereas descending to the right child appends a 1 bit. + * + * The classic algorithm is relatively easy to understand, but it is subject to + * a number of inefficiencies. In practice, it is fastest to first sort the + * symbols by frequency. (This itself can be subject to an optimization based + * on the fact that most frequencies tend to be low.) At the same time, we sort + * secondarily by symbol value, which aids the process of generating a canonical + * code. Then, during tree construction, no heap is necessary because both the + * leaf nodes and the unparented non-leaf nodes can be easily maintained in + * sorted order. Consequently, there can never be more than two possibilities + * for the next-lowest-frequency node. + * + * In addition, because we're generating a canonical code, we actually don't + * need the leaf nodes of the tree at all, only the non-leaf nodes. This is + * because for canonical code generation we don't need to know where the symbols + * are in the tree. Rather, we only need to know how many leaf nodes have each + * depth (codeword length). And this information can, in fact, be quickly + * generated from the tree of non-leaves only. + * + * Furthermore, we can build this stripped-down Huffman tree directly in the + * array in which the codewords are to be generated, provided that these array + * slots are large enough to hold a symbol and frequency value. + * + * Still furthermore, we don't even need to maintain explicit child pointers. + * We only need the parent pointers, and even those can be overwritten in-place + * with depth information as part of the process of extracting codeword lengths + * from the tree. So in summary, we do NOT need a big structure like: + * + * struct huffman_tree_node { + * unsigned int symbol; + * unsigned int frequency; + * unsigned int depth; + * struct huffman_tree_node *left_child; + * struct huffman_tree_node *right_child; + * }; + * + * + * ... which often gets used in "naive" implementations of Huffman code + * generation. + * + * Many of these optimizations are based on the implementation in 7-Zip (source + * file: C/HuffEnc.c), which was placed in the public domain by Igor Pavlov. + * + * NOTE: in general, the same frequencies can be used to generate different + * length-limited canonical Huffman codes. One choice we have is during tree + * construction, when we must decide whether to prefer a leaf or non-leaf when + * there is a tie in frequency. Another choice we have is how to deal with + * codewords that would exceed @max_codeword_len bits in length. Both of these + * choices affect the resulting codeword lengths, which otherwise can be mapped + * uniquely onto the resulting canonical Huffman code. + * + * Normally, there is no problem with choosing one valid code over another, + * provided that they produce similar compression ratios. However, the LZMS + * compression format uses adaptive Huffman coding. It requires that both the + * decompressor and compressor build a canonical code equivalent to that which + * can be generated by using the classic Huffman tree construction algorithm and + * always processing leaves before non-leaves when there is a frequency tie. + * Therefore, we make sure to do this. This method also has the advantage of + * sometimes shortening the longest codeword that is generated. + * + * There also is the issue of how codewords longer than @max_codeword_len are + * dealt with. Fortunately, for LZMS this is irrelevant because for the LZMS + * alphabets no codeword can ever exceed LZMS_MAX_CODEWORD_LEN (= 15). Since + * the LZMS algorithm regularly halves all frequencies, the frequencies cannot + * become high enough for a length 16 codeword to be generated. Specifically, I + * think that if ties are broken in favor of non-leaves (as we do), the lowest + * total frequency that would give a length-16 codeword would be the sum of the + * frequencies 1 1 1 3 4 7 11 18 29 47 76 123 199 322 521 843 1364, which is + * 3570. And in LZMS we can't get a frequency that high based on the alphabet + * sizes, rebuild frequencies, and scaling factors. This worst-case scenario is + * based on the following degenerate case (only the bottom of the tree shown): + * + * ... + * 17 + * / \ + * 10 7 + * / \ + * 6 4 + * / \ + * 3 3 + * / \ + * 2 1 + * / \ + * 1 1 + * + * Excluding the first leaves (those with value 1), each leaf value must be + * greater than the non-leaf up 1 and down 2 from it; otherwise that leaf would + * have taken precedence over that non-leaf and been combined with the leaf + * below, thereby decreasing the height compared to that shown. + * + * Interesting fact: if we were to instead prioritize non-leaves over leaves, + * then the worst case frequencies would be the Fibonacci sequence, plus an + * extra frequency of 1. In this hypothetical scenario, it would be slightly + * easier for longer codewords to be generated. + */ +void +make_canonical_huffman_code(unsigned num_syms, unsigned max_codeword_len, + const u32 freqs[], u8 lens[], u32 codewords[]) +{ + u32 *A = codewords; + unsigned num_used_syms; + + wimlib_assert(num_syms <= MAX_NUM_SYMS); + STATIC_ASSERT(MAX_NUM_SYMS <= 1 << NUM_SYMBOL_BITS); + wimlib_assert(max_codeword_len <= MAX_CODEWORD_LEN); + + /* + * We begin by sorting the symbols primarily by frequency and + * secondarily by symbol value. As an optimization, the array used for + * this purpose ('A') shares storage with the space in which we will + * eventually return the codewords. + */ + num_used_syms = sort_symbols(num_syms, freqs, lens, A); + + /* + * 'num_used_syms' is the number of symbols with nonzero frequency. + * This may be less than @num_syms. 'num_used_syms' is also the number + * of entries in 'A' that are valid. Each entry consists of a distinct + * symbol and a nonzero frequency packed into a 32-bit integer. + */ + + /* + * Handle special cases where only 0 or 1 symbols were used (had nonzero + * frequency). + */ + + if (unlikely(num_used_syms == 0)) { + /* + * Code is empty. sort_symbols() already set all lengths to 0, + * so there is nothing more to do. + */ + return; + } + + if (unlikely(num_used_syms == 1)) { + /* + * Only one symbol was used, so we only need one codeword. But + * two codewords are needed to form the smallest complete + * Huffman code, which uses codewords 0 and 1. Therefore, we + * choose another symbol to which to assign a codeword. We use + * 0 (if the used symbol is not 0) or 1 (if the used symbol is + * 0). In either case, the lesser-valued symbol must be + * assigned codeword 0 so that the resulting code is canonical. + */ + + unsigned sym = A[0] & SYMBOL_MASK; + unsigned nonzero_idx = sym ? sym : 1; + + codewords[0] = 0; + lens[0] = 1; + codewords[nonzero_idx] = 1; + lens[nonzero_idx] = 1; + return; + } + + /* + * Build a stripped-down version of the Huffman tree, sharing the array + * 'A' with the symbol values. Then extract length counts from the tree + * and use them to generate the final codewords. + */ + + build_tree(A, num_used_syms); + + { + unsigned len_counts[MAX_CODEWORD_LEN + 1]; + + compute_length_counts(A, num_used_syms - 2, + len_counts, max_codeword_len); + + gen_codewords(A, lens, len_counts, max_codeword_len, num_syms); + } +} diff --git a/src/wimlib/compress_parallel.c b/src/wimlib/compress_parallel.c new file mode 100644 index 00000000..e8fb7bf1 --- /dev/null +++ b/src/wimlib/compress_parallel.c @@ -0,0 +1,504 @@ +/* + * compress_parallel.c + * + * Compress chunks of data (parallel version). + */ + +/* + * Copyright (C) 2013-2023 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <errno.h> +#include <stdlib.h> +#include <string.h> + +#include "wimlib/assert.h" +#include "wimlib/chunk_compressor.h" +#include "wimlib/error.h" +#include "wimlib/list.h" +#include "wimlib/threads.h" +#include "wimlib/util.h" + +struct message_queue { + struct list_head list; + struct mutex lock; + struct condvar msg_avail_cond; + struct condvar space_avail_cond; + bool terminating; +}; + +struct compressor_thread_data { + struct thread thread; + struct message_queue *chunks_to_compress_queue; + struct message_queue *compressed_chunks_queue; + struct wimlib_compressor *compressor; +}; + +#define MAX_CHUNKS_PER_MSG 16 + +struct message { + u8 *uncompressed_chunks[MAX_CHUNKS_PER_MSG]; + u8 *compressed_chunks[MAX_CHUNKS_PER_MSG]; + u32 uncompressed_chunk_sizes[MAX_CHUNKS_PER_MSG]; + u32 compressed_chunk_sizes[MAX_CHUNKS_PER_MSG]; + size_t num_filled_chunks; + size_t num_alloc_chunks; + struct list_head list; + bool complete; + struct list_head submission_list; +}; + +struct parallel_chunk_compressor { + struct chunk_compressor base; + + struct message_queue chunks_to_compress_queue; + struct message_queue compressed_chunks_queue; + struct compressor_thread_data *thread_data; + unsigned num_thread_data; + unsigned num_started_threads; + + struct message *msgs; + size_t num_messages; + + struct list_head available_msgs; + struct list_head submitted_msgs; + struct message *next_submit_msg; + struct message *next_ready_msg; + size_t next_chunk_idx; +}; + + + +static int +message_queue_init(struct message_queue *q) +{ + if (!mutex_init(&q->lock)) + goto err; + if (!condvar_init(&q->msg_avail_cond)) + goto err_destroy_lock; + if (!condvar_init(&q->space_avail_cond)) + goto err_destroy_msg_avail_cond; + INIT_LIST_HEAD(&q->list); + return 0; + +err_destroy_msg_avail_cond: + condvar_destroy(&q->msg_avail_cond); +err_destroy_lock: + mutex_destroy(&q->lock); +err: + return WIMLIB_ERR_NOMEM; +} + +static void +message_queue_destroy(struct message_queue *q) +{ + if (q->list.next != NULL) { + mutex_destroy(&q->lock); + condvar_destroy(&q->msg_avail_cond); + condvar_destroy(&q->space_avail_cond); + } +} + +static void +message_queue_put(struct message_queue *q, struct message *msg) +{ + mutex_lock(&q->lock); + list_add_tail(&msg->list, &q->list); + condvar_signal(&q->msg_avail_cond); + mutex_unlock(&q->lock); +} + +static struct message * +message_queue_get(struct message_queue *q) +{ + struct message *msg; + + mutex_lock(&q->lock); + while (list_empty(&q->list) && !q->terminating) + condvar_wait(&q->msg_avail_cond, &q->lock); + if (!q->terminating) { + msg = list_entry(q->list.next, struct message, list); + list_del(&msg->list); + } else + msg = NULL; + mutex_unlock(&q->lock); + return msg; +} + +static void +message_queue_terminate(struct message_queue *q) +{ + mutex_lock(&q->lock); + q->terminating = true; + condvar_broadcast(&q->msg_avail_cond); + mutex_unlock(&q->lock); +} + +static int +init_message(struct message *msg, size_t num_chunks, u32 out_chunk_size) +{ + msg->num_alloc_chunks = num_chunks; + for (size_t i = 0; i < num_chunks; i++) { + msg->compressed_chunks[i] = MALLOC(out_chunk_size - 1); + msg->uncompressed_chunks[i] = MALLOC(out_chunk_size); + if (msg->compressed_chunks[i] == NULL || + msg->uncompressed_chunks[i] == NULL) + return WIMLIB_ERR_NOMEM; + } + return 0; +} + +static void +destroy_message(struct message *msg) +{ + for (size_t i = 0; i < msg->num_alloc_chunks; i++) { + FREE(msg->compressed_chunks[i]); + FREE(msg->uncompressed_chunks[i]); + } +} + +static void +free_messages(struct message *msgs, size_t num_messages) +{ + if (msgs) { + for (size_t i = 0; i < num_messages; i++) + destroy_message(&msgs[i]); + FREE(msgs); + } +} + +static struct message * +allocate_messages(size_t count, size_t chunks_per_msg, u32 out_chunk_size) +{ + struct message *msgs; + + msgs = CALLOC(count, sizeof(struct message)); + if (msgs == NULL) + return NULL; + for (size_t i = 0; i < count; i++) { + if (init_message(&msgs[i], chunks_per_msg, out_chunk_size)) { + free_messages(msgs, count); + return NULL; + } + } + return msgs; +} + +static void +compress_chunks(struct message *msg, struct wimlib_compressor *compressor) +{ + + for (size_t i = 0; i < msg->num_filled_chunks; i++) { + wimlib_assert(msg->uncompressed_chunk_sizes[i] != 0); + msg->compressed_chunk_sizes[i] = + wimlib_compress(msg->uncompressed_chunks[i], + msg->uncompressed_chunk_sizes[i], + msg->compressed_chunks[i], + msg->uncompressed_chunk_sizes[i] - 1, + compressor); + } +} + +static void * +compressor_thread_proc(void *arg) +{ + struct compressor_thread_data *params = arg; + struct message *msg; + + while ((msg = message_queue_get(params->chunks_to_compress_queue)) != NULL) { + compress_chunks(msg, params->compressor); + message_queue_put(params->compressed_chunks_queue, msg); + } + return NULL; +} + +static void +parallel_chunk_compressor_destroy(struct chunk_compressor *_ctx) +{ + struct parallel_chunk_compressor *ctx = (struct parallel_chunk_compressor *)_ctx; + unsigned i; + + if (ctx == NULL) + return; + + if (ctx->num_started_threads != 0) { + message_queue_terminate(&ctx->chunks_to_compress_queue); + + for (i = 0; i < ctx->num_started_threads; i++) + thread_join(&ctx->thread_data[i].thread); + } + + message_queue_destroy(&ctx->chunks_to_compress_queue); + message_queue_destroy(&ctx->compressed_chunks_queue); + + if (ctx->thread_data != NULL) + for (i = 0; i < ctx->num_thread_data; i++) + wimlib_free_compressor(ctx->thread_data[i].compressor); + + FREE(ctx->thread_data); + + free_messages(ctx->msgs, ctx->num_messages); + + FREE(ctx); +} + +static void +submit_compression_msg(struct parallel_chunk_compressor *ctx) +{ + struct message *msg = ctx->next_submit_msg; + + msg->complete = false; + list_add_tail(&msg->submission_list, &ctx->submitted_msgs); + message_queue_put(&ctx->chunks_to_compress_queue, msg); + ctx->next_submit_msg = NULL; +} + +static void * +parallel_chunk_compressor_get_chunk_buffer(struct chunk_compressor *_ctx) +{ + struct parallel_chunk_compressor *ctx = (struct parallel_chunk_compressor *)_ctx; + struct message *msg; + + if (ctx->next_submit_msg) { + msg = ctx->next_submit_msg; + } else { + if (list_empty(&ctx->available_msgs)) + return NULL; + + msg = list_entry(ctx->available_msgs.next, struct message, list); + list_del(&msg->list); + ctx->next_submit_msg = msg; + msg->num_filled_chunks = 0; + } + + return msg->uncompressed_chunks[msg->num_filled_chunks]; +} + +static void +parallel_chunk_compressor_signal_chunk_filled(struct chunk_compressor *_ctx, u32 usize) +{ + struct parallel_chunk_compressor *ctx = (struct parallel_chunk_compressor *)_ctx; + struct message *msg; + + wimlib_assert(usize > 0); + wimlib_assert(usize <= ctx->base.out_chunk_size); + wimlib_assert(ctx->next_submit_msg); + + msg = ctx->next_submit_msg; + msg->uncompressed_chunk_sizes[msg->num_filled_chunks] = usize; + if (++msg->num_filled_chunks == msg->num_alloc_chunks) + submit_compression_msg(ctx); +} + +static bool +parallel_chunk_compressor_get_compression_result(struct chunk_compressor *_ctx, + const void **cdata_ret, u32 *csize_ret, + u32 *usize_ret) +{ + struct parallel_chunk_compressor *ctx = (struct parallel_chunk_compressor *)_ctx; + struct message *msg; + + if (ctx->next_submit_msg) + submit_compression_msg(ctx); + + if (ctx->next_ready_msg) { + msg = ctx->next_ready_msg; + } else { + if (list_empty(&ctx->submitted_msgs)) + return false; + + while (!(msg = list_entry(ctx->submitted_msgs.next, + struct message, + submission_list))->complete) + message_queue_get(&ctx->compressed_chunks_queue)->complete = true; + + ctx->next_ready_msg = msg; + ctx->next_chunk_idx = 0; + } + + if (msg->compressed_chunk_sizes[ctx->next_chunk_idx]) { + *cdata_ret = msg->compressed_chunks[ctx->next_chunk_idx]; + *csize_ret = msg->compressed_chunk_sizes[ctx->next_chunk_idx]; + } else { + *cdata_ret = msg->uncompressed_chunks[ctx->next_chunk_idx]; + *csize_ret = msg->uncompressed_chunk_sizes[ctx->next_chunk_idx]; + } + *usize_ret = msg->uncompressed_chunk_sizes[ctx->next_chunk_idx]; + + if (++ctx->next_chunk_idx == msg->num_filled_chunks) { + list_del(&msg->submission_list); + list_add_tail(&msg->list, &ctx->available_msgs); + ctx->next_ready_msg = NULL; + } + return true; +} + +int +new_parallel_chunk_compressor(int out_ctype, u32 out_chunk_size, + unsigned num_threads, u64 max_memory, + struct chunk_compressor **compressor_ret) +{ + u64 approx_mem_required; + size_t chunks_per_msg; + size_t msgs_per_thread; + struct parallel_chunk_compressor *ctx; + unsigned i; + int ret; + unsigned desired_num_threads; + + wimlib_assert(out_chunk_size > 0); + + if (num_threads == 0) + num_threads = get_available_cpus(); + + if (num_threads == 1) + return -1; + + if (max_memory == 0) + max_memory = get_available_memory(); + + desired_num_threads = num_threads; + + if (out_chunk_size < ((u32)1 << 23)) { + /* Relatively small chunks. Use 2 messages per thread, each + * with at least 2 chunks. Use more chunks per message if there + * are lots of threads and/or the chunks are very small. */ + chunks_per_msg = 2; + chunks_per_msg += num_threads * (65536 / out_chunk_size) / 16; + chunks_per_msg = max(chunks_per_msg, 2); + chunks_per_msg = min(chunks_per_msg, MAX_CHUNKS_PER_MSG); + msgs_per_thread = 2; + } else { + /* Big chunks: Just have one buffer per thread --- more would + * just waste memory. */ + chunks_per_msg = 1; + msgs_per_thread = 1; + } + for (;;) { + approx_mem_required = + (u64)chunks_per_msg * + (u64)msgs_per_thread * + (u64)num_threads * + (u64)out_chunk_size + + out_chunk_size + + 1000000 + + num_threads * wimlib_get_compressor_needed_memory(out_ctype, + out_chunk_size, + 0); + if (approx_mem_required <= max_memory) + break; + + if (chunks_per_msg > 1) + chunks_per_msg--; + else if (msgs_per_thread > 1) + msgs_per_thread--; + else if (num_threads > 1) + num_threads--; + else + break; + } + + if (num_threads < desired_num_threads) { + WARNING("Wanted to use %u threads, but limiting to %u " + "to fit in available memory!", + desired_num_threads, num_threads); + } + + if (num_threads == 1) + return -2; + + ret = WIMLIB_ERR_NOMEM; + ctx = CALLOC(1, sizeof(*ctx)); + if (ctx == NULL) + goto err; + + ctx->base.out_ctype = out_ctype; + ctx->base.out_chunk_size = out_chunk_size; + ctx->base.destroy = parallel_chunk_compressor_destroy; + ctx->base.get_chunk_buffer = parallel_chunk_compressor_get_chunk_buffer; + ctx->base.signal_chunk_filled = parallel_chunk_compressor_signal_chunk_filled; + ctx->base.get_compression_result = parallel_chunk_compressor_get_compression_result; + + ctx->num_thread_data = num_threads; + + ret = message_queue_init(&ctx->chunks_to_compress_queue); + if (ret) + goto err; + + ret = message_queue_init(&ctx->compressed_chunks_queue); + if (ret) + goto err; + + ret = WIMLIB_ERR_NOMEM; + ctx->thread_data = CALLOC(num_threads, sizeof(ctx->thread_data[0])); + if (ctx->thread_data == NULL) + goto err; + + for (i = 0; i < num_threads; i++) { + struct compressor_thread_data *dat; + + dat = &ctx->thread_data[i]; + + dat->chunks_to_compress_queue = &ctx->chunks_to_compress_queue; + dat->compressed_chunks_queue = &ctx->compressed_chunks_queue; + ret = wimlib_create_compressor(out_ctype, out_chunk_size, + WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE, + &dat->compressor); + if (ret) + goto err; + } + + for (ctx->num_started_threads = 0; + ctx->num_started_threads < num_threads; + ctx->num_started_threads++) + { + if (!thread_create(&ctx->thread_data[ctx->num_started_threads].thread, + compressor_thread_proc, + &ctx->thread_data[ctx->num_started_threads])) + { + ret = WIMLIB_ERR_NOMEM; + if (ctx->num_started_threads >= 2) + break; + goto err; + } + } + + ctx->base.num_threads = ctx->num_started_threads; + + ret = WIMLIB_ERR_NOMEM; + ctx->num_messages = ctx->num_started_threads * msgs_per_thread; + ctx->msgs = allocate_messages(ctx->num_messages, + chunks_per_msg, out_chunk_size); + if (ctx->msgs == NULL) + goto err; + + INIT_LIST_HEAD(&ctx->available_msgs); + for (size_t i = 0; i < ctx->num_messages; i++) + list_add_tail(&ctx->msgs[i].list, &ctx->available_msgs); + + INIT_LIST_HEAD(&ctx->submitted_msgs); + + *compressor_ret = &ctx->base; + return 0; + +err: + parallel_chunk_compressor_destroy(&ctx->base); + return ret; +} diff --git a/src/wimlib/compress_serial.c b/src/wimlib/compress_serial.c new file mode 100644 index 00000000..24a6795c --- /dev/null +++ b/src/wimlib/compress_serial.c @@ -0,0 +1,149 @@ +/* + * compress_serial.c + * + * Compress chunks of data (serial version). + */ + +/* + * Copyright (C) 2013 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <string.h> + +#include "wimlib.h" +#include "wimlib/assert.h" +#include "wimlib/chunk_compressor.h" +#include "wimlib/util.h" + +struct serial_chunk_compressor { + struct chunk_compressor base; + struct wimlib_compressor *compressor; + u8 *udata; + u8 *cdata; + u32 usize; + u8 *result_data; + u32 result_size; +}; + +static void +serial_chunk_compressor_destroy(struct chunk_compressor *_ctx) +{ + struct serial_chunk_compressor *ctx = (struct serial_chunk_compressor*)_ctx; + + if (ctx == NULL) + return; + + wimlib_free_compressor(ctx->compressor); + FREE(ctx->udata); + FREE(ctx->cdata); + FREE(ctx); +} + +static void * +serial_chunk_compressor_get_chunk_buffer(struct chunk_compressor *_ctx) +{ + struct serial_chunk_compressor *ctx = (struct serial_chunk_compressor*)_ctx; + + if (ctx->result_data) + return NULL; + return ctx->udata; +} + +static void +serial_chunk_compressor_signal_chunk_filled(struct chunk_compressor *_ctx, u32 usize) +{ + struct serial_chunk_compressor *ctx = (struct serial_chunk_compressor*)_ctx; + u32 csize; + + wimlib_assert(usize > 0); + wimlib_assert(usize <= ctx->base.out_chunk_size); + + ctx->usize = usize; + csize = wimlib_compress(ctx->udata, usize, ctx->cdata, usize - 1, + ctx->compressor); + if (csize) { + ctx->result_data = ctx->cdata; + ctx->result_size = csize; + } else { + ctx->result_data = ctx->udata; + ctx->result_size = ctx->usize; + } +} + +static bool +serial_chunk_compressor_get_compression_result(struct chunk_compressor *_ctx, + const void **cdata_ret, u32 *csize_ret, + u32 *usize_ret) +{ + struct serial_chunk_compressor *ctx = (struct serial_chunk_compressor *)_ctx; + + if (!ctx->result_data) + return false; + + *cdata_ret = ctx->result_data; + *csize_ret = ctx->result_size; + *usize_ret = ctx->usize; + + ctx->result_data = NULL; + return true; +} + +int +new_serial_chunk_compressor(int out_ctype, u32 out_chunk_size, + struct chunk_compressor **compressor_ret) +{ + struct serial_chunk_compressor *ctx; + int ret; + + wimlib_assert(out_chunk_size > 0); + + ctx = CALLOC(1, sizeof(*ctx)); + if (ctx == NULL) + return WIMLIB_ERR_NOMEM; + + ctx->base.out_ctype = out_ctype; + ctx->base.out_chunk_size = out_chunk_size; + ctx->base.num_threads = 1; + ctx->base.destroy = serial_chunk_compressor_destroy; + ctx->base.get_chunk_buffer = serial_chunk_compressor_get_chunk_buffer; + ctx->base.signal_chunk_filled = serial_chunk_compressor_signal_chunk_filled; + ctx->base.get_compression_result = serial_chunk_compressor_get_compression_result; + + ret = wimlib_create_compressor(out_ctype, out_chunk_size, + WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE, + &ctx->compressor); + if (ret) + goto err; + + ctx->udata = MALLOC(out_chunk_size); + ctx->cdata = MALLOC(out_chunk_size - 1); + if (ctx->udata == NULL || ctx->cdata == NULL) { + ret = WIMLIB_ERR_NOMEM; + goto err; + } + ctx->result_data = NULL; + + *compressor_ret = &ctx->base; + return 0; + +err: + serial_chunk_compressor_destroy(&ctx->base); + return ret; +} diff --git a/src/wimlib/config.h b/src/wimlib/config.h new file mode 100644 index 00000000..c509663f --- /dev/null +++ b/src/wimlib/config.h @@ -0,0 +1,202 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define to 1 to enable supporting code for tests */ +/* #undef ENABLE_TEST_SUPPORT */ + +/* Define to 1 if you have the <alloca.h> header file. */ +/* #undef HAVE_ALLOCA_H */ + +/* Define to 1 if you have the <byteswap.h> header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the <dlfcn.h> header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define to 1 if you have the <endian.h> header file. */ +/* #undef HAVE_ENDIAN_H */ + +/* Define to 1 if you have the <errno.h> header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the 'fdopendir' function. */ +/* #undef HAVE_FDOPENDIR */ + +/* Define to 1 if you have the 'flock' function. */ +/* #undef HAVE_FLOCK */ + +/* Define to 1 if you have the 'fsetxattr' function. */ +/* #undef HAVE_FSETXATTR */ + +/* Define to 1 if you have the 'fstatat' function. */ +/* #undef HAVE_FSTATAT */ + +/* Define to 1 if you have the 'futimens' function. */ +/* #undef HAVE_FUTIMENS */ + +/* Define to 1 if you have the 'getopt_long_only' function. */ +#define HAVE_GETOPT_LONG_ONLY 1 + +/* Define to 1 if you have the <glob.h> header file. */ +/* #undef HAVE_GLOB_H */ + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the 'lgetxattr' function. */ +/* #undef HAVE_LGETXATTR */ + +/* Define to 1 if you have the 'rt' library (-lrt). */ +/* #undef HAVE_LIBRT */ + +/* Define to 1 if you have the 'llistxattr' function. */ +/* #undef HAVE_LLISTXATTR */ + +/* Define to 1 if you have the 'lsetxattr' function. */ +/* #undef HAVE_LSETXATTR */ + +/* Define to 1 if you have the <machine/endian.h> header file. */ +/* #undef HAVE_MACHINE_ENDIAN_H */ + +/* Define to 1 if you have the 'mempcpy' function. */ +/* #undef HAVE_MEMPCPY */ + +/* Define to 1 if you have the 'openat' function. */ +/* #undef HAVE_OPENAT */ + +/* Define to 1 if you have the 'posix_fallocate' function. */ +/* #undef HAVE_POSIX_FALLOCATE */ + +/* Define if you have POSIX threads libraries and header files. */ +/* #undef HAVE_PTHREAD */ + +/* Have PTHREAD_PRIO_INHERIT. */ +/* #undef HAVE_PTHREAD_PRIO_INHERIT */ + +/* Define to 1 if you have the 'readlinkat' function. */ +/* #undef HAVE_READLINKAT */ + +/* Define to 1 if stat() supports nanosecond precision timestamps */ +/* #undef HAVE_STAT_NANOSECOND_PRECISION */ + +/* Define to 1 if you have the <stdarg.h> header file. */ +#define HAVE_STDARG_H 1 + +/* Define to 1 if you have the <stddef.h> header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdio.h> header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the <sys/byteorder.h> header file. */ +/* #undef HAVE_SYS_BYTEORDER_H */ + +/* Define to 1 if you have the <sys/endian.h> header file. */ +/* #undef HAVE_SYS_ENDIAN_H */ + +/* Define to 1 if you have the <sys/file.h> header file. */ +#define HAVE_SYS_FILE_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/syscall.h> header file. */ +/* #undef HAVE_SYS_SYSCALL_H */ + +/* Define to 1 if you have the <sys/sysctl.h> header file. */ +/* #undef HAVE_SYS_SYSCTL_H */ + +/* Define to 1 if you have the <sys/times.h> header file. */ +/* #undef HAVE_SYS_TIMES_H */ + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <sys/xattr.h> header file. */ +/* #undef HAVE_SYS_XATTR_H */ + +/* Define to 1 if you have the <time.h> header file. */ +#define HAVE_TIME_H 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the 'utimensat' function. */ +/* #undef HAVE_UTIMENSAT */ + +/* Define to 1 if you have the <utime.h> header file. */ +#define HAVE_UTIME_H 1 + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +#ifndef PACKAGE +/* Name of package */ +#define PACKAGE "wimlib" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "https://wimlib.net/forums/" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "wimlib" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "wimlib 1.14.4-3-g4a34203c" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "wimlib" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.14.4-3-g4a34203c" + +/* Version number of package */ +#define VERSION "1.14.4-3-g4a34203c" +#endif + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* Define to 1 if all of the C89 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#define STDC_HEADERS 1 + +/* Define to 1 if using FUSE support */ +/* #undef WITH_FUSE */ + +/* Define to 1 if using NTFS-3G support */ +/* #undef WITH_NTFS_3G */ + +/* Define to 1 if using libcdio support */ +#define WITH_LIBCDIO 1 + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif diff --git a/src/wimlib/cpu_features.c b/src/wimlib/cpu_features.c new file mode 100644 index 00000000..08520c9c --- /dev/null +++ b/src/wimlib/cpu_features.c @@ -0,0 +1,298 @@ +/* + * cpu_features.c - runtime CPU feature detection + * + * Copyright 2022-2023 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/cpu_features.h" + +#if CPU_FEATURES_ENABLED + +#include "wimlib/util.h" + +#include <stdlib.h> +#include <string.h> + +#if defined(__i386__) || defined(__x86_64__) + +/* + * With old GCC versions we have to manually save and restore the x86_32 PIC + * register (ebx). See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47602 + */ +#if defined(__i386__) && defined(__PIC__) +# define EBX_CONSTRAINT "=&r" +#else +# define EBX_CONSTRAINT "=b" +#endif + +/* Execute the CPUID instruction. */ +static inline void +cpuid(u32 leaf, u32 subleaf, u32 *a, u32 *b, u32 *c, u32 *d) +{ + asm volatile(".ifnc %%ebx, %1; mov %%ebx, %1; .endif\n" + "cpuid \n" + ".ifnc %%ebx, %1; xchg %%ebx, %1; .endif\n" + : "=a" (*a), EBX_CONSTRAINT (*b), "=c" (*c), "=d" (*d) + : "a" (leaf), "c" (subleaf)); +} + +/* Read an extended control register. */ +static inline u64 +read_xcr(u32 index) +{ + u32 d, a; + + /* + * Execute the "xgetbv" instruction. Old versions of binutils do not + * recognize this instruction, so list the raw bytes instead. + * + * This must be 'volatile' to prevent this code from being moved out + * from under the check for OSXSAVE. + */ + asm volatile(".byte 0x0f, 0x01, 0xd0" : + "=d" (d), "=a" (a) : "c" (index)); + + return ((u64)d << 32) | a; +} + +static u32 +get_cpu_features(void) +{ + u32 max_leaf, a, b, c, d; + u64 xcr0 = 0; + u32 features = 0; + + /* EAX=0: Highest Function Parameter and Manufacturer ID */ + cpuid(0, 0, &max_leaf, &b, &c, &d); + if (max_leaf < 1) + return features; + + /* EAX=1: Processor Info and Feature Bits */ + cpuid(1, 0, &a, &b, &c, &d); + if (c & (1 << 9)) + features |= X86_CPU_FEATURE_SSSE3; + if (c & (1 << 19)) + features |= X86_CPU_FEATURE_SSE4_1; + if (c & (1 << 20)) + features |= X86_CPU_FEATURE_SSE4_2; + if (c & (1 << 27)) + xcr0 = read_xcr(0); + if ((c & (1 << 28)) && ((xcr0 & 0x6) == 0x6)) + features |= X86_CPU_FEATURE_AVX; + + if (max_leaf < 7) + return features; + + /* EAX=7, ECX=0: Extended Features */ + cpuid(7, 0, &a, &b, &c, &d); + if (b & (1 << 8)) + features |= X86_CPU_FEATURE_BMI2; + if (b & (1 << 29)) + features |= X86_CPU_FEATURE_SHA; + + return features; +} + +#elif defined(__aarch64__) && defined(__linux__) + +/* + * On Linux, arm32 and arm64 CPU features can be detected by reading the + * AT_HWCAP and AT_HWCAP2 values from /proc/self/auxv. + * + * Ideally we'd use the C library function getauxval(), but it's not guaranteed + * to be available: it was only added to glibc in 2.16, and in Android it was + * added to API level 18 for arm32 and level 21 for arm64. + */ + +#include <errno.h> +#include <fcntl.h> +#include <string.h> +#include <unistd.h> + +#define AT_HWCAP 16 +#define AT_HWCAP2 26 + +static void scan_auxv(unsigned long *hwcap, unsigned long *hwcap2) +{ + int fd; + unsigned long auxbuf[32]; + int filled = 0; + int i; + + fd = open("/proc/self/auxv", O_RDONLY); + if (fd < 0) + return; + + for (;;) { + do { + int ret = read(fd, &((char *)auxbuf)[filled], + sizeof(auxbuf) - filled); + if (ret <= 0) { + if (ret < 0 && errno == EINTR) + continue; + goto out; + } + filled += ret; + } while (filled < 2 * sizeof(long)); + + i = 0; + do { + unsigned long type = auxbuf[i]; + unsigned long value = auxbuf[i + 1]; + + if (type == AT_HWCAP) + *hwcap = value; + else if (type == AT_HWCAP2) + *hwcap2 = value; + i += 2; + filled -= 2 * sizeof(long); + } while (filled >= 2 * sizeof(long)); + + memmove(auxbuf, &auxbuf[i], filled); + } +out: + close(fd); +} + +static u32 +get_cpu_features(void) +{ + unsigned long hwcap = 0; + unsigned long hwcap2 = 0; + u32 features = 0; + + scan_auxv(&hwcap, &hwcap2); + + if (hwcap & (1 << 5)) /* HWCAP_SHA1 */ + features |= ARM_CPU_FEATURE_SHA1; + + return features; +} + +#elif defined(__aarch64__) && defined(__APPLE__) + +/* On Apple platforms, arm64 CPU features can be detected via sysctlbyname(). */ + +#include <sys/types.h> +#include <sys/sysctl.h> + +static const struct { + const char *name; + u32 feature; +} feature_sysctls[] = { + { "hw.optional.arm.FEAT_SHA1", ARM_CPU_FEATURE_SHA1 }, +}; + +static u32 +get_cpu_features(void) +{ + u32 features = 0; + + for (size_t i = 0; i < ARRAY_LEN(feature_sysctls); i++) { + const char *name = feature_sysctls[i].name; + u32 val = 0; + size_t valsize = sizeof(val); + + if (sysctlbyname(name, &val, &valsize, NULL, 0) == 0 && + valsize == sizeof(val) && val == 1) + features |= feature_sysctls[i].feature; + } + return features; +} + +#elif defined(__aarch64__) && defined(_WIN32) + +#include <windows.h> + +static u32 +get_cpu_features(void) +{ + u32 features = 0; + + if (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE)) + features |= ARM_CPU_FEATURE_SHA1; + + return features; +} + +#else +# error "CPU_FEATURES_ENABLED was set but no implementation is available!" +#endif + +static const struct { + const char *name; + u32 feature; +} feature_table[] = { +#if defined(__i386__) || defined(__x86_64__) + {"ssse3", X86_CPU_FEATURE_SSSE3}, + {"sse4.1", X86_CPU_FEATURE_SSE4_1}, + {"sse4.2", X86_CPU_FEATURE_SSE4_2}, + {"avx", X86_CPU_FEATURE_AVX}, + {"bmi2", X86_CPU_FEATURE_BMI2}, + {"sha", X86_CPU_FEATURE_SHA}, + {"sha1", X86_CPU_FEATURE_SHA}, +#elif defined(__aarch64__) + {"sha1", ARM_CPU_FEATURE_SHA1}, +#else +# error "CPU_FEATURES_ENABLED was set but no features are defined!" +#endif + {"*", 0xFFFFFFFF}, +}; + +static u32 +find_cpu_feature(const char *name, size_t namelen) +{ + for (size_t i = 0; i < ARRAY_LEN(feature_table); i++) { + if (namelen == strlen(feature_table[i].name) && + memcmp(name, feature_table[i].name, namelen) == 0) + return feature_table[i].feature; + } + return 0; +} + +u32 cpu_features; + +void init_cpu_features(void) +{ + char *p, *sep; + + cpu_features = get_cpu_features(); + + /* + * Allow disabling CPU features via an environmental variable for + * testing purposes. Syntax is comma-separated list of feature names. + */ + p = getenv("WIMLIB_DISABLE_CPU_FEATURES"); + if (likely(p == NULL)) + return; + for (; (sep = strchr(p, ',')) != NULL; p = sep + 1) + cpu_features &= ~find_cpu_feature(p, sep - p); + cpu_features &= ~find_cpu_feature(p, strlen(p)); +} + +#endif /* CPU_FEATURES_ENABLED */ diff --git a/src/wimlib/decompress.c b/src/wimlib/decompress.c new file mode 100644 index 00000000..c2ab5b87 --- /dev/null +++ b/src/wimlib/decompress.c @@ -0,0 +1,113 @@ +/* + * decompress.c + * + * Generic functions for decompression, wrapping around actual decompression + * implementations. + */ + +/* + * Copyright (C) 2013, 2014 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib.h" +#include "wimlib/decompressor_ops.h" +#include "wimlib/util.h" + +struct wimlib_decompressor { + const struct decompressor_ops *ops; + size_t max_block_size; + void *private; +}; + +static const struct decompressor_ops * const decompressor_ops[] = { + [WIMLIB_COMPRESSION_TYPE_XPRESS] = &xpress_decompressor_ops, + [WIMLIB_COMPRESSION_TYPE_LZX] = &lzx_decompressor_ops, + [WIMLIB_COMPRESSION_TYPE_LZMS] = &lzms_decompressor_ops, +}; + +static bool +decompressor_ctype_valid(int ctype) +{ + return (ctype >= 0 && + ctype < ARRAY_LEN(decompressor_ops) && + decompressor_ops[ctype] != NULL); +} + +WIMLIBAPI int +wimlib_create_decompressor(enum wimlib_compression_type ctype, + size_t max_block_size, + struct wimlib_decompressor **dec_ret) +{ + struct wimlib_decompressor *dec; + int ret; + + ret = wimlib_global_init(0); + if (ret) + return ret; + + if (!decompressor_ctype_valid(ctype)) + return WIMLIB_ERR_INVALID_COMPRESSION_TYPE; + + if (dec_ret == NULL) + return WIMLIB_ERR_INVALID_PARAM; + + if (max_block_size == 0) + return WIMLIB_ERR_INVALID_PARAM; + + dec = MALLOC(sizeof(*dec)); + if (dec == NULL) + return WIMLIB_ERR_NOMEM; + dec->ops = decompressor_ops[ctype]; + dec->max_block_size = max_block_size; + dec->private = NULL; + if (dec->ops->create_decompressor) { + ret = dec->ops->create_decompressor(max_block_size, + &dec->private); + if (ret) { + FREE(dec); + return ret; + } + } + *dec_ret = dec; + return 0; +} + +WIMLIBAPI int +wimlib_decompress(const void *compressed_data, size_t compressed_size, + void *uncompressed_data, size_t uncompressed_size, + struct wimlib_decompressor *dec) +{ + if (unlikely(uncompressed_size > dec->max_block_size)) + return -2; + + return dec->ops->decompress(compressed_data, compressed_size, + uncompressed_data, uncompressed_size, + dec->private); +} + +WIMLIBAPI void +wimlib_free_decompressor(struct wimlib_decompressor *dec) +{ + if (dec) { + if (dec->ops->free_decompressor) + dec->ops->free_decompressor(dec->private); + FREE(dec); + } +} diff --git a/src/wimlib/decompress_common.c b/src/wimlib/decompress_common.c new file mode 100644 index 00000000..abdf4df4 --- /dev/null +++ b/src/wimlib/decompress_common.c @@ -0,0 +1,342 @@ +/* + * decompress_common.c + * + * Code for decompression shared among multiple compression formats. + * + * Copyright 2022 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <string.h> + +#ifdef __SSE2__ +# include <emmintrin.h> +#endif + +#include "wimlib/decompress_common.h" + +/* + * make_huffman_decode_table() - + * + * Given an alphabet of symbols and the length of each symbol's codeword in a + * canonical prefix code, build a table for quickly decoding symbols that were + * encoded with that code. + * + * A _prefix code_ is an assignment of bitstrings called _codewords_ to symbols + * such that no whole codeword is a prefix of any other. A prefix code might be + * a _Huffman code_, which means that it is an optimum prefix code for a given + * list of symbol frequencies and was generated by the Huffman algorithm. + * Although the prefix codes processed here will ordinarily be "Huffman codes", + * strictly speaking the decoder cannot know whether a given code was actually + * generated by the Huffman algorithm or not. + * + * A prefix code is _canonical_ if and only if a longer codeword never + * lexicographically precedes a shorter codeword, and the lexicographic ordering + * of codewords of equal length is the same as the lexicographic ordering of the + * corresponding symbols. The advantage of using a canonical prefix code is + * that the codewords can be reconstructed from only the symbol => codeword + * length mapping. This eliminates the need to transmit the codewords + * explicitly. Instead, they can be enumerated in lexicographic order after + * sorting the symbols primarily by increasing codeword length and secondarily + * by increasing symbol value. + * + * However, the decoder's real goal is to decode symbols with the code, not just + * generate the list of codewords. Consequently, this function directly builds + * a table for efficiently decoding symbols using the code. The basic idea is + * that given the next 'max_codeword_len' bits of input, the decoder can look up + * the next decoded symbol by indexing a table containing '2^max_codeword_len' + * entries. A codeword with length 'max_codeword_len' will have exactly one + * entry in this table, whereas a codeword shorter than 'max_codeword_len' will + * have multiple entries in this table. Precisely, a codeword of length 'n' + * will have '2^(max_codeword_len - n)' entries. The index of each such entry, + * considered as a bitstring of length 'max_codeword_len', will contain the + * corresponding codeword as a prefix. + * + * That's the basic idea, but we extend it in two ways: + * + * - Often the maximum codeword length is too long for it to be efficient to + * build the full decode table whenever a new code is used. Instead, we build + * a "root" table using only '2^table_bits' entries, where 'table_bits <= + * max_codeword_len'. Then, a lookup of 'table_bits' bits produces either a + * symbol directly (for codewords not longer than 'table_bits'), or the index + * of a subtable which must be indexed with additional bits of input to fully + * decode the symbol (for codewords longer than 'table_bits'). + * + * - Whenever the decoder decodes a symbol, it needs to know the codeword length + * so that it can remove the appropriate number of input bits. The obvious + * solution would be to simply retain the codeword lengths array and use the + * decoded symbol as an index into it. However, that would require two array + * accesses when decoding each symbol. Our strategy is to instead store the + * codeword length directly in the decode table entry along with the symbol. + * + * See MAKE_DECODE_TABLE_ENTRY() for full details on the format of decode table + * entries, and see read_huffsym() for full details on how symbols are decoded. + * + * @decode_table: + * The array in which to build the decode table. This must have been + * declared by the DECODE_TABLE() macro. This may alias @lens, since all + * @lens are consumed before the decode table is written to. + * + * @num_syms: + * The number of symbols in the alphabet. + * + * @table_bits: + * The log base 2 of the number of entries in the root table. + * + * @lens: + * An array of length @num_syms, indexed by symbol, that gives the length + * of the codeword, in bits, for each symbol. The length can be 0, which + * means that the symbol does not have a codeword assigned. In addition, + * @lens may alias @decode_table, as noted above. + * + * @max_codeword_len: + * The maximum codeword length permitted for this code. All entries in + * 'lens' must be less than or equal to this value. + * + * @working_space + * A temporary array that was declared with DECODE_TABLE_WORKING_SPACE(). + * + * Returns 0 on success, or -1 if the lengths do not form a valid prefix code. + */ +int +make_huffman_decode_table(u16 decode_table[], unsigned num_syms, + unsigned table_bits, const u8 lens[], + unsigned max_codeword_len, u16 working_space[]) +{ + u16 * const len_counts = &working_space[0]; + u16 * const offsets = &working_space[1 * (max_codeword_len + 1)]; + u16 * const sorted_syms = &working_space[2 * (max_codeword_len + 1)]; + s32 remainder = 1; + void *entry_ptr = decode_table; + unsigned codeword_len = 1; + unsigned sym_idx; + unsigned codeword; + unsigned subtable_pos; + unsigned subtable_bits; + unsigned subtable_prefix; + + /* Count how many codewords have each length, including 0. */ + for (unsigned len = 0; len <= max_codeword_len; len++) + len_counts[len] = 0; + for (unsigned sym = 0; sym < num_syms; sym++) + len_counts[lens[sym]]++; + + /* It is already guaranteed that all lengths are <= max_codeword_len, + * but it cannot be assumed they form a complete prefix code. A + * codeword of length n should require a proportion of the codespace + * equaling (1/2)^n. The code is complete if and only if, by this + * measure, the codespace is exactly filled by the lengths. */ + for (unsigned len = 1; len <= max_codeword_len; len++) { + remainder = (remainder << 1) - len_counts[len]; + /* Do the lengths overflow the codespace? */ + if (unlikely(remainder < 0)) + return -1; + } + + if (remainder != 0) { + /* The lengths do not fill the codespace; that is, they form an + * incomplete code. This is permitted only if the code is empty + * (contains no symbols). */ + + if (unlikely(remainder != 1U << max_codeword_len)) + return -1; + + /* The code is empty. When processing a well-formed stream, the + * decode table need not be initialized in this case. However, + * we cannot assume the stream is well-formed, so we must + * initialize the decode table anyway. Setting all entries to 0 + * makes the decode table always produce symbol '0' without + * consuming any bits, which is good enough. */ + memset(decode_table, 0, sizeof(decode_table[0]) << table_bits); + return 0; + } + + /* Sort the symbols primarily by increasing codeword length and + * secondarily by increasing symbol value. */ + + /* Initialize 'offsets' so that 'offsets[len]' is the number of + * codewords shorter than 'len' bits, including length 0. */ + offsets[0] = 0; + for (unsigned len = 0; len < max_codeword_len; len++) + offsets[len + 1] = offsets[len] + len_counts[len]; + + /* Use the 'offsets' array to sort the symbols. */ + for (unsigned sym = 0; sym < num_syms; sym++) + sorted_syms[offsets[lens[sym]]++] = sym; + + /* + * Fill the root table entries for codewords no longer than table_bits. + * + * The table will start with entries for the shortest codeword(s), which + * will have the most entries. From there, the number of entries per + * codeword will decrease. As an optimization, we may begin filling + * entries with SSE2 vector accesses (8 entries/store), then change to + * word accesses (2 or 4 entries/store), then change to 16-bit accesses + * (1 entry/store). + */ + sym_idx = offsets[0]; + +#ifdef __SSE2__ + /* Fill entries one 128-bit vector (8 entries) at a time. */ + for (unsigned stores_per_loop = (1U << (table_bits - codeword_len)) / + (sizeof(__m128i) / sizeof(decode_table[0])); + stores_per_loop != 0; codeword_len++, stores_per_loop >>= 1) + { + unsigned end_sym_idx = sym_idx + len_counts[codeword_len]; + for (; sym_idx < end_sym_idx; sym_idx++) { + /* Note: unlike in the "word" version below, the __m128i + * type already has __attribute__((may_alias)), so using + * it to access an array of u16 will not violate strict + * aliasing. */ + __m128i v = _mm_set1_epi16( + MAKE_DECODE_TABLE_ENTRY(sorted_syms[sym_idx], + codeword_len)); + unsigned n = stores_per_loop; + do { + *(__m128i *)entry_ptr = v; + entry_ptr += sizeof(v); + } while (--n); + } + } +#endif /* __SSE2__ */ + +#ifdef __GNUC__ + /* Fill entries one word (2 or 4 entries) at a time. */ + for (unsigned stores_per_loop = (1U << (table_bits - codeword_len)) / + (WORDBYTES / sizeof(decode_table[0])); + stores_per_loop != 0; codeword_len++, stores_per_loop >>= 1) + { + unsigned end_sym_idx = sym_idx + len_counts[codeword_len]; + for (; sym_idx < end_sym_idx; sym_idx++) { + + /* Accessing the array of u16 as u32 or u64 would + * violate strict aliasing and would require compiling + * the code with -fno-strict-aliasing to guarantee + * correctness. To work around this problem, use the + * gcc 'may_alias' extension. */ + typedef machine_word_t + __attribute__((may_alias)) aliased_word_t; + aliased_word_t v = repeat_u16( + MAKE_DECODE_TABLE_ENTRY(sorted_syms[sym_idx], + codeword_len)); + unsigned n = stores_per_loop; + do { + *(aliased_word_t *)entry_ptr = v; + entry_ptr += sizeof(v); + } while (--n); + } + } +#endif /* __GNUC__ */ + + /* Fill entries one at a time. */ + for (unsigned stores_per_loop = (1U << (table_bits - codeword_len)); + stores_per_loop != 0; codeword_len++, stores_per_loop >>= 1) + { + unsigned end_sym_idx = sym_idx + len_counts[codeword_len]; + for (; sym_idx < end_sym_idx; sym_idx++) { + u16 v = MAKE_DECODE_TABLE_ENTRY(sorted_syms[sym_idx], + codeword_len); + unsigned n = stores_per_loop; + do { + *(u16 *)entry_ptr = v; + entry_ptr += sizeof(v); + } while (--n); + } + } + + /* If all symbols were processed, then no subtables are required. */ + if (sym_idx == num_syms) + return 0; + + /* At least one subtable is required. Process the remaining symbols. */ + codeword = ((u16 *)entry_ptr - decode_table) << 1; + subtable_pos = 1U << table_bits; + subtable_bits = table_bits; + subtable_prefix = -1; + do { + while (len_counts[codeword_len] == 0) { + codeword_len++; + codeword <<= 1; + } + + unsigned prefix = codeword >> (codeword_len - table_bits); + + /* Start a new subtable if the first 'table_bits' bits of the + * codeword don't match the prefix for the previous subtable, or + * if this will be the first subtable. */ + if (prefix != subtable_prefix) { + + subtable_prefix = prefix; + + /* + * Calculate the subtable length. If the codeword + * length exceeds 'table_bits' by n, then the subtable + * needs at least 2^n entries. But it may need more; if + * there are fewer than 2^n codewords of length + * 'table_bits + n' remaining, then n will need to be + * incremented to bring in longer codewords until the + * subtable can be filled completely. Note that it + * always will, eventually, be possible to fill the + * subtable, since it was previously verified that the + * code is complete. + */ + subtable_bits = codeword_len - table_bits; + remainder = (s32)1 << subtable_bits; + for (;;) { + remainder -= len_counts[table_bits + + subtable_bits]; + if (remainder <= 0) + break; + subtable_bits++; + remainder <<= 1; + } + + /* Create the entry that points from the root table to + * the subtable. This entry contains the index of the + * start of the subtable and the number of bits with + * which the subtable is indexed (the log base 2 of the + * number of entries it contains). */ + decode_table[subtable_prefix] = + MAKE_DECODE_TABLE_ENTRY(subtable_pos, + subtable_bits); + } + + /* Fill the subtable entries for this symbol. */ + u16 entry = MAKE_DECODE_TABLE_ENTRY(sorted_syms[sym_idx], + codeword_len - table_bits); + unsigned n = 1U << (subtable_bits - (codeword_len - + table_bits)); + do { + decode_table[subtable_pos++] = entry; + } while (--n); + + len_counts[codeword_len]--; + codeword++; + } while (++sym_idx < num_syms); + + return 0; +} diff --git a/src/wimlib/dentry.c b/src/wimlib/dentry.c new file mode 100644 index 00000000..f20d7dff --- /dev/null +++ b/src/wimlib/dentry.c @@ -0,0 +1,1908 @@ +/* + * dentry.c - see description below + */ + +/* + * Copyright 2012-2023 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +/* + * This file contains logic to deal with WIM directory entries, or "dentries": + * + * - Reading a dentry tree from a metadata resource in a WIM file + * - Writing a dentry tree to a metadata resource in a WIM file + * - Iterating through a tree of WIM dentries + * - Path lookup: translating a path into a WIM dentry or inode + * - Creating, modifying, and deleting WIM dentries + * + * Notes: + * + * - A WIM file can contain multiple images, each of which has an independent + * tree of dentries. "On disk", the dentry tree for an image is stored in + * the "metadata resource" for that image. + * + * - Multiple dentries in an image may correspond to the same inode, or "file". + * When this occurs, it means that the file has multiple names, or "hard + * links". A dentry is not a file, but rather the name of a file! + * + * - Inodes are not represented explicitly in the WIM file format. Instead, + * the metadata resource provides a "hard link group ID" for each dentry. + * wimlib handles pulling out actual inodes from this information, but this + * occurs in inode_fixup.c and not in this file. + * + * - wimlib does not allow *directory* hard links, so a WIM image really does + * have a *tree* of dentries (and not an arbitrary graph of dentries). + * + * - wimlib supports both case-sensitive and case-insensitive path lookups. + * The implementation uses a single in-memory index per directory, using a + * collation order like that used by NTFS; see collate_dentry_names(). + * + * - Multiple dentries in a directory might have the same case-insensitive + * name. But wimlib enforces that at most one dentry in a directory can have + * a given case-sensitive name. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <errno.h> + +#include "wimlib/assert.h" +#include "wimlib/dentry.h" +#include "wimlib/inode.h" +#include "wimlib/encoding.h" +#include "wimlib/endianness.h" +#include "wimlib/metadata.h" +#include "wimlib/paths.h" + +/* On-disk format of a WIM dentry (directory entry), located in the metadata + * resource for a WIM image. */ +struct wim_dentry_on_disk { + + /* Length of this directory entry in bytes, not including any extra + * stream entries. Should be a multiple of 8 so that the following + * dentry or extra stream entry is aligned on an 8-byte boundary. (If + * not, wimlib will round it up.) It must be at least as long as the + * fixed-length fields of the dentry (WIM_DENTRY_DISK_SIZE), plus the + * lengths of the file name and/or short name if present, plus the size + * of any "extra" data. + * + * It is also possible for this field to be 0. This case indicates the + * end of a list of sibling entries in a directory. It also means the + * real length is 8, because the dentry included only the length field, + * but that takes up 8 bytes. */ + le64 length; + + /* File attributes for the file or directory. This is a bitwise OR of + * the FILE_ATTRIBUTE_* constants and should correspond to the value + * retrieved by GetFileAttributes() on Windows. */ + le32 attributes; + + /* A value that specifies the security descriptor for this file or + * directory. If 0xFFFFFFFF, the file or directory has no security + * descriptor. Otherwise, it is a 0-based index into the WIM image's + * table of security descriptors (see: `struct wim_security_data') */ + le32 security_id; + + /* Offset, in bytes, from the start of the uncompressed metadata + * resource of this directory's child directory entries, or 0 if this + * directory entry does not correspond to a directory or otherwise does + * not have any children. */ + le64 subdir_offset; + + /* Reserved fields */ + le64 unused_1; + le64 unused_2; + + /* Creation time, last access time, and last write time, in + * 100-nanosecond intervals since 12:00 a.m UTC January 1, 1601. They + * should correspond to the times gotten by calling GetFileTime() on + * Windows. */ + le64 creation_time; + le64 last_access_time; + le64 last_write_time; + + /* + * Usually this is the SHA-1 message digest of the file's contents, or + * all zeroes if the file is a directory or is empty. However, special + * rules apply if the file has FILE_ATTRIBUTE_REPARSE_POINT set or has + * named data streams. See assign_stream_types_unencrypted(). + */ + u8 main_hash[SHA1_HASH_SIZE]; + + /* Unknown field (maybe accidental padding) */ + le32 unknown_0x54; + + /* + * The following 8-byte union contains either information about the + * reparse point (for files with FILE_ATTRIBUTE_REPARSE_POINT set), or + * the "hard link group ID" (for other files). + * + * The reparse point information contains ReparseTag and ReparseReserved + * from the header of the reparse point buffer. It also contains a flag + * that indicates whether a reparse point fixup (for the target of an + * absolute symbolic link or junction) was done or not. + * + * The "hard link group ID" is like an inode number; all dentries for + * the same inode share the same value. See inode_fixup.c for more + * information. + * + * Note that this union creates the limitation that reparse point files + * cannot have multiple names (hard links). + */ + union { + struct { + le32 reparse_tag; + le16 rp_reserved; + le16 rp_flags; + } __attribute__((packed)) reparse; + struct { + le64 hard_link_group_id; + } __attribute__((packed)) nonreparse; + }; + + /* Number of extra stream entries that directly follow this dentry + * on-disk. */ + le16 num_extra_streams; + + /* If nonzero, this is the length, in bytes, of this dentry's UTF-16LE + * encoded short name (8.3 DOS-compatible name), excluding the null + * terminator. If zero, then the long name of this dentry does not have + * a corresponding short name (but this does not exclude the possibility + * that another dentry for the same file has a short name). */ + le16 short_name_nbytes; + + /* If nonzero, this is the length, in bytes, of this dentry's UTF-16LE + * encoded "long" name, excluding the null terminator. If zero, then + * this file has no long name. The root dentry should not have a long + * name, but all other dentries in the image should have long names. */ + le16 name_nbytes; + + /* Beginning of optional, variable-length fields */ + + /* If name_nbytes != 0, the next field will be the UTF-16LE encoded long + * name. This will be null-terminated, so the size of this field will + * really be name_nbytes + 2. */ + /*utf16lechar name[];*/ + + /* If short_name_nbytes != 0, the next field will be the UTF-16LE + * encoded short name. This will be null-terminated, so the size of + * this field will really be short_name_nbytes + 2. */ + /*utf16lechar short_name[];*/ + + /* If there is still space in the dentry (according to the 'length' + * field) after 8-byte alignment, then the remaining space will be a + * variable-length list of tagged metadata items. See tagged_items.c + * for more information. */ + /* u8 tagged_items[] __attribute__((aligned(8))); */ + +} __attribute__((packed)); + /* If num_extra_streams != 0, then there are that many extra stream + * entries following the dentry, starting on the next 8-byte aligned + * boundary. They are not counted in the 'length' field of the dentry. + */ + +/* On-disk format of an extra stream entry. This represents an extra NTFS-style + * "stream" associated with the file, such as a named data stream. */ +struct wim_extra_stream_entry_on_disk { + + /* Length of this extra stream entry, in bytes. This includes all + * fixed-length fields, plus the name and null terminator if present, + * and any needed padding such that the length is a multiple of 8. */ + le64 length; + + /* Reserved field */ + le64 reserved; + + /* SHA-1 message digest of this stream's uncompressed data, or all + * zeroes if this stream's data is of zero length. */ + u8 hash[SHA1_HASH_SIZE]; + + /* Length of this stream's name, in bytes and excluding the null + * terminator; or 0 if this stream is unnamed. */ + le16 name_nbytes; + + /* Stream name in UTF-16LE. It is @name_nbytes bytes long, excluding + * the null terminator. There is a null terminator character if + * @name_nbytes != 0; i.e., if this stream is named. */ + utf16lechar name[]; +} __attribute__((packed)); + +static void +do_dentry_set_name(struct wim_dentry *dentry, utf16lechar *name, + size_t name_nbytes) +{ + FREE(dentry->d_name); + dentry->d_name = name; + dentry->d_name_nbytes = name_nbytes; + + if (dentry_has_short_name(dentry)) { + FREE(dentry->d_short_name); + dentry->d_short_name = NULL; + dentry->d_short_name_nbytes = 0; + } +} + +/* + * Set the name of a WIM dentry from a UTF-16LE string. + * + * This sets the long name of the dentry. The short name will automatically be + * removed, since it may not be appropriate for the new long name. + * + * The @name string need not be null-terminated, since its length is specified + * in @name_nbytes. + * + * If @name_nbytes is 0, both the long and short names of the dentry will be + * removed. + * + * Only use this function on unlinked dentries, since it doesn't update the name + * indices. For dentries that are currently linked into the tree, use + * rename_wim_path(). + * + * Returns 0 or WIMLIB_ERR_NOMEM. + */ +int +dentry_set_name_utf16le(struct wim_dentry *dentry, const utf16lechar *name, + size_t name_nbytes) +{ + utf16lechar *dup = NULL; + + if (name_nbytes) { + dup = utf16le_dupz(name, name_nbytes); + if (!dup) + return WIMLIB_ERR_NOMEM; + } + do_dentry_set_name(dentry, dup, name_nbytes); + return 0; +} + + +/* + * Set the name of a WIM dentry from a 'tchar' string. + * + * This sets the long name of the dentry. The short name will automatically be + * removed, since it may not be appropriate for the new long name. + * + * If @name is NULL or empty, both the long and short names of the dentry will + * be removed. + * + * Only use this function on unlinked dentries, since it doesn't update the name + * indices. For dentries that are currently linked into the tree, use + * rename_wim_path(). + * + * Returns 0 or an error code resulting from a failed string conversion. + */ +int +dentry_set_name(struct wim_dentry *dentry, const tchar *name) +{ + utf16lechar *name_utf16le = NULL; + size_t name_utf16le_nbytes = 0; + int ret; + + if (name && *name) { + ret = tstr_to_utf16le(name, tstrlen(name) * sizeof(tchar), + &name_utf16le, &name_utf16le_nbytes); + if (ret) + return ret; + } + + do_dentry_set_name(dentry, name_utf16le, name_utf16le_nbytes); + return 0; +} + +/* Calculate the minimum unaligned length, in bytes, of an on-disk WIM dentry + * that has names of the specified lengths. (Zero length means the + * corresponding name actually does not exist.) The returned value excludes + * tagged metadata items as well as any extra stream entries that may need to + * follow the dentry. */ +static size_t +dentry_min_len_with_names(u16 name_nbytes, u16 short_name_nbytes) +{ + size_t length = sizeof(struct wim_dentry_on_disk); + if (name_nbytes) + length += (u32)name_nbytes + 2; + if (short_name_nbytes) + length += (u32)short_name_nbytes + 2; + return length; +} + + +/* Return the length, in bytes, required for the specified stream on-disk, when + * represented as an extra stream entry. */ +static size_t +stream_out_total_length(const struct wim_inode_stream *strm) +{ + /* Account for the fixed length portion */ + size_t len = sizeof(struct wim_extra_stream_entry_on_disk); + + /* For named streams, account for the variable-length name. */ + if (stream_is_named(strm)) + len += utf16le_len_bytes(strm->stream_name) + 2; + + /* Account for any necessary padding to the next 8-byte boundary. */ + return ALIGN(len, 8); +} + +/* + * Calculate the total number of bytes that will be consumed when a dentry is + * written. This includes the fixed-length portion of the dentry, the name + * fields, any tagged metadata items, and any extra stream entries. This also + * includes all alignment bytes. + */ +size_t +dentry_out_total_length(const struct wim_dentry *dentry) +{ + const struct wim_inode *inode = dentry->d_inode; + size_t len; + unsigned num_unnamed_streams = 0; + bool have_named_data_stream = false; + + len = dentry_min_len_with_names(dentry->d_name_nbytes, + dentry->d_short_name_nbytes); + len = ALIGN(len, 8); + + if (inode->i_extra) + len += ALIGN(inode->i_extra->size, 8); + + /* + * Calculate the total length of the extra stream entries that will be + * written. To match DISM, some odd rules need to be followed here. + * See write_dentry_streams() for explanation. Keep this in sync with + * write_dentry_streams()! + */ + if (inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED) { + num_unnamed_streams++; + } else { + for (unsigned i = 0; i < inode->i_num_streams; i++) { + const struct wim_inode_stream *strm = &inode->i_streams[i]; + + if (stream_is_named_data_stream(strm)) { + len += stream_out_total_length(strm); + have_named_data_stream = true; + } + } + if (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) + num_unnamed_streams++; + if (!(inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY)) + num_unnamed_streams++; + } + if (num_unnamed_streams > 1 || have_named_data_stream) + len += num_unnamed_streams * + ALIGN(sizeof(struct wim_extra_stream_entry_on_disk), 8); + return len; +} + +/* Internal version of for_dentry_in_tree() that omits the NULL check */ +static int +do_for_dentry_in_tree(struct wim_dentry *dentry, + int (*visitor)(struct wim_dentry *, void *), void *arg) +{ + int ret; + struct wim_dentry *child; + + ret = (*visitor)(dentry, arg); + if (unlikely(ret)) + return ret; + + for_dentry_child(child, dentry) { + ret = do_for_dentry_in_tree(child, visitor, arg); + if (unlikely(ret)) + return ret; + } + return 0; +} + +/* Internal version of for_dentry_in_tree_depth() that omits the NULL check */ +static int +do_for_dentry_in_tree_depth(struct wim_dentry *dentry, + int (*visitor)(struct wim_dentry *, void *), void *arg) +{ + int ret; + struct wim_dentry *child; + + for_dentry_child_postorder(child, dentry) { + ret = do_for_dentry_in_tree_depth(child, visitor, arg); + if (unlikely(ret)) + return ret; + } + return unlikely((*visitor)(dentry, arg)); +} + +/* + * Call a function on all dentries in a tree. + * + * @arg will be passed as the second argument to each invocation of @visitor. + * + * This function does a pre-order traversal --- that is, a parent will be + * visited before its children. Furthermore, siblings will be visited in their + * collation order. + * + * It is safe to pass NULL for @root, which means that the dentry tree is empty. + * In this case, this function does nothing. + * + * @visitor must not modify the structure of the dentry tree during the + * traversal. + * + * The return value will be 0 if all calls to @visitor returned 0. Otherwise, + * the return value will be the first nonzero value returned by @visitor. + */ +int +for_dentry_in_tree(struct wim_dentry *root, + int (*visitor)(struct wim_dentry *, void *), void *arg) +{ + if (unlikely(!root)) + return 0; + return do_for_dentry_in_tree(root, visitor, arg); +} + +/* Like for_dentry_in_tree(), but do a depth-first traversal of the dentry tree. + * That is, the visitor function will be called on a dentry's children before + * itself. It will be safe to free a dentry when visiting it. */ +static int +for_dentry_in_tree_depth(struct wim_dentry *root, + int (*visitor)(struct wim_dentry *, void *), void *arg) +{ + if (unlikely(!root)) + return 0; + return do_for_dentry_in_tree_depth(root, visitor, arg); +} + +/* + * Calculate the full path to @dentry within the WIM image, if not already done. + * + * The full name will be saved in the cached value 'dentry->d_full_path'. + * + * Whenever possible, use dentry_full_path() instead of calling this and + * accessing d_full_path directly. + * + * Returns 0 or an error code resulting from a failed string conversion. + */ +int +calculate_dentry_full_path(struct wim_dentry *dentry) +{ + size_t ulen; + const struct wim_dentry *d; + + if (dentry->d_full_path) + return 0; + + ulen = 0; + d = dentry; + do { + ulen += d->d_name_nbytes / sizeof(utf16lechar); + ulen++; + d = d->d_parent; /* assumes d == d->d_parent for root */ + } while (!dentry_is_root(d)); + + utf16lechar ubuf[ulen]; + utf16lechar *p = &ubuf[ulen]; + + d = dentry; + do { + p -= d->d_name_nbytes / sizeof(utf16lechar); + if (d->d_name_nbytes) + memcpy(p, d->d_name, d->d_name_nbytes); + *--p = cpu_to_le16(WIM_PATH_SEPARATOR); + d = d->d_parent; /* assumes d == d->d_parent for root */ + } while (!dentry_is_root(d)); + + wimlib_assert(p == ubuf); + + return utf16le_to_tstr(ubuf, ulen * sizeof(utf16lechar), + &dentry->d_full_path, NULL); +} + +/* + * Return the full path to the @dentry within the WIM image, or NULL if the full + * path could not be determined due to a string conversion error. + * + * The returned memory will be cached in the dentry, so the caller is not + * responsible for freeing it. + */ +tchar * +dentry_full_path(struct wim_dentry *dentry) +{ + calculate_dentry_full_path(dentry); + return dentry->d_full_path; +} + +static int +dentry_calculate_subdir_offset(struct wim_dentry *dentry, void *_subdir_offset_p) +{ + if (dentry_is_directory(dentry)) { + u64 *subdir_offset_p = _subdir_offset_p; + struct wim_dentry *child; + + /* Set offset of directory's child dentries */ + dentry->d_subdir_offset = *subdir_offset_p; + + /* Account for child dentries */ + for_dentry_child(child, dentry) + *subdir_offset_p += dentry_out_total_length(child); + + /* Account for end-of-directory entry */ + *subdir_offset_p += 8; + } else { + /* Not a directory; set the subdir offset to 0 */ + dentry->d_subdir_offset = 0; + } + return 0; +} + +/* + * Calculate the subdir offsets for a dentry tree, in preparation of writing + * that dentry tree to a metadata resource. + * + * The subdir offset of each dentry is the offset in the uncompressed metadata + * resource at which its child dentries begin, or 0 if that dentry has no + * children. + * + * The caller must initialize *subdir_offset_p to the first subdir offset that + * is available to use after the root dentry is written. + * + * When this function returns, *subdir_offset_p will have been advanced past the + * size needed for the dentry tree within the uncompressed metadata resource. + */ +void +calculate_subdir_offsets(struct wim_dentry *root, u64 *subdir_offset_p) +{ + for_dentry_in_tree(root, dentry_calculate_subdir_offset, subdir_offset_p); +} + +static int +dentry_compare_names(const struct wim_dentry *d1, const struct wim_dentry *d2, + bool ignore_case) +{ + return cmp_utf16le_strings(d1->d_name, d1->d_name_nbytes / 2, + d2->d_name, d2->d_name_nbytes / 2, + ignore_case); +} + +/* + * Collate (compare) the long filenames of two dentries. This first compares + * the names ignoring case, then falls back to a case-sensitive comparison if + * the names are the same ignoring case. + */ +static int +collate_dentry_names(const struct avl_tree_node *n1, + const struct avl_tree_node *n2) +{ + const struct wim_dentry *d1, *d2; + int res; + + d1 = avl_tree_entry(n1, struct wim_dentry, d_index_node); + d2 = avl_tree_entry(n2, struct wim_dentry, d_index_node); + + res = dentry_compare_names(d1, d2, true); + if (res) + return res; + return dentry_compare_names(d1, d2, false); +} + +/* Default case sensitivity behavior for searches with + * WIMLIB_CASE_PLATFORM_DEFAULT specified. This can be modified by passing + * WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE or + * WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE to wimlib_global_init(). */ +bool default_ignore_case = +#ifdef _WIN32 + true +#else + false +#endif +; + +/* + * Find the dentry within the given directory that has the given UTF-16LE + * filename. Return it if found, otherwise return NULL. This has configurable + * case sensitivity, and @name need not be null-terminated. + */ +struct wim_dentry * +get_dentry_child_with_utf16le_name(const struct wim_dentry *dir, + const utf16lechar *name, + size_t name_nbytes, + CASE_SENSITIVITY_TYPE case_type) +{ + struct wim_dentry wanted; + struct avl_tree_node *cur = dir->d_inode->i_children; + struct wim_dentry *ci_match = NULL; + + wanted.d_name = (utf16lechar *)name; + wanted.d_name_nbytes = name_nbytes; + + if (unlikely(wanted.d_name_nbytes != name_nbytes)) + return NULL; /* overflow */ + + /* Note: we can't use avl_tree_lookup_node() here because we need to + * save case-insensitive matches. */ + while (cur) { + struct wim_dentry *child; + int res; + + child = avl_tree_entry(cur, struct wim_dentry, d_index_node); + + res = dentry_compare_names(&wanted, child, true); + if (!res) { + /* case-insensitive match found */ + ci_match = child; + + res = dentry_compare_names(&wanted, child, false); + if (!res) + return child; /* case-sensitive match found */ + } + + if (res < 0) + cur = cur->left; + else + cur = cur->right; + } + + /* No case-sensitive match; use a case-insensitive match if possible. */ + + if (!will_ignore_case(case_type)) + return NULL; + + if (ci_match) { + size_t num_other_ci_matches = 0; + struct wim_dentry *other_ci_match, *d; + + dentry_for_each_ci_match(d, ci_match) { + num_other_ci_matches++; + other_ci_match = d; + } + + if (num_other_ci_matches != 0) { + WARNING("Result of case-insensitive lookup is ambiguous\n" + " (returning \"%"TS"\" of %zu " + "possible files, including \"%"TS"\")", + dentry_full_path(ci_match), num_other_ci_matches, + dentry_full_path(other_ci_match)); + } + } + + return ci_match; +} + +/* + * Find the dentry within the given directory that has the given 'tstr' + * filename. If the filename was successfully converted to UTF-16LE and the + * dentry was found, return it; otherwise return NULL. This has configurable + * case sensitivity. + */ +struct wim_dentry * +get_dentry_child_with_name(const struct wim_dentry *dir, const tchar *name, + CASE_SENSITIVITY_TYPE case_type) +{ + int ret; + const utf16lechar *name_utf16le; + size_t name_utf16le_nbytes; + struct wim_dentry *child; + + ret = tstr_get_utf16le_and_len(name, &name_utf16le, + &name_utf16le_nbytes); + if (ret) + return NULL; + + child = get_dentry_child_with_utf16le_name(dir, + name_utf16le, + name_utf16le_nbytes, + case_type); + tstr_put_utf16le(name_utf16le); + return child; +} + +/* This is the UTF-16LE version of get_dentry(), currently private to this file + * because no one needs it besides get_dentry(). */ +static struct wim_dentry * +get_dentry_utf16le(WIMStruct *wim, const utf16lechar *path, + CASE_SENSITIVITY_TYPE case_type) +{ + struct wim_dentry *cur_dentry; + const utf16lechar *name_start, *name_end; + + /* Start with the root directory of the image. Note: this will be NULL + * if an image has been added directly with wimlib_add_empty_image() but + * no files have been added yet; in that case we fail with ENOENT. */ + cur_dentry = wim_get_current_root_dentry(wim); + + name_start = path; + for (;;) { + if (cur_dentry == NULL) { + errno = ENOENT; + return NULL; + } + + if (*name_start && !dentry_is_directory(cur_dentry)) { + errno = ENOTDIR; + return NULL; + } + + while (*name_start == cpu_to_le16(WIM_PATH_SEPARATOR)) + name_start++; + + if (!*name_start) + return cur_dentry; + + name_end = name_start; + do { + ++name_end; + } while (*name_end != cpu_to_le16(WIM_PATH_SEPARATOR) && *name_end); + + cur_dentry = get_dentry_child_with_utf16le_name(cur_dentry, + name_start, + (u8*)name_end - (u8*)name_start, + case_type); + name_start = name_end; + } +} + +/* + * WIM path lookup: translate a path in the currently selected WIM image to the + * corresponding dentry, if it exists. + * + * @wim + * The WIMStruct for the WIM. The search takes place in the currently + * selected image. + * + * @path + * The path to look up, given relative to the root of the WIM image. + * Characters with value WIM_PATH_SEPARATOR are taken to be path + * separators. Leading path separators are ignored, whereas one or more + * trailing path separators cause the path to only match a directory. + * + * @case_type + * The case-sensitivity behavior of this function, as one of the following + * constants: + * + * - WIMLIB_CASE_SENSITIVE: Perform the search case sensitively. This means + * that names must match exactly. + * + * - WIMLIB_CASE_INSENSITIVE: Perform the search case insensitively. This + * means that names are considered to match if they are equal when + * transformed to upper case. If a path component matches multiple names + * case-insensitively, the name that matches the path component + * case-sensitively is chosen, if existent; otherwise one + * case-insensitively matching name is chosen arbitrarily. + * + * - WIMLIB_CASE_PLATFORM_DEFAULT: Perform either case-sensitive or + * case-insensitive search, depending on the value of the global variable + * default_ignore_case. + * + * In any case, no Unicode normalization is done before comparing strings. + * + * Returns a pointer to the dentry that is the result of the lookup, or NULL if + * no such dentry exists. If NULL is returned, errno is set to one of the + * following values: + * + * ENOTDIR if one of the path components used as a directory existed but + * was not, in fact, a directory. + * + * ENOENT otherwise. + * + * Additional notes: + * + * - This function does not consider a reparse point to be a directory, even + * if it has FILE_ATTRIBUTE_DIRECTORY set. + * + * - This function does not dereference symbolic links or junction points + * when performing the search. + * + * - Since this function ignores leading slashes, the empty path is valid and + * names the root directory of the WIM image. + * + * - An image added with wimlib_add_empty_image() does not have a root + * directory yet, and this function will fail with ENOENT for any path on + * such an image. + */ +struct wim_dentry * +get_dentry(WIMStruct *wim, const tchar *path, CASE_SENSITIVITY_TYPE case_type) +{ + int ret; + const utf16lechar *path_utf16le; + struct wim_dentry *dentry; + + ret = tstr_get_utf16le(path, &path_utf16le); + if (ret) + return NULL; + dentry = get_dentry_utf16le(wim, path_utf16le, case_type); + tstr_put_utf16le(path_utf16le); + return dentry; +} + +/* Modify @path, which is a null-terminated string @len 'tchars' in length, + * in-place to produce the path to its parent directory. */ +static void +to_parent_name(tchar *path, size_t len) +{ + ssize_t i = (ssize_t)len - 1; + while (i >= 0 && path[i] == WIM_PATH_SEPARATOR) + i--; + while (i >= 0 && path[i] != WIM_PATH_SEPARATOR) + i--; + while (i >= 0 && path[i] == WIM_PATH_SEPARATOR) + i--; + path[i + 1] = T('\0'); +} + +/* Similar to get_dentry(), but returns the dentry named by @path with the last + * component stripped off. + * + * Note: The returned dentry is NOT guaranteed to be a directory. */ +struct wim_dentry * +get_parent_dentry(WIMStruct *wim, const tchar *path, + CASE_SENSITIVITY_TYPE case_type) +{ + size_t path_len = tstrlen(path); + tchar buf[path_len + 1]; + + tmemcpy(buf, path, path_len + 1); + to_parent_name(buf, path_len); + return get_dentry(wim, buf, case_type); +} + +/* + * Create an unlinked dentry. + * + * @name specifies the long name to give the new dentry. If NULL or empty, the + * new dentry will be given no long name. + * + * The new dentry will have no short name and no associated inode. + * + * On success, returns 0 and a pointer to the new, allocated dentry is stored in + * *dentry_ret. On failure, returns WIMLIB_ERR_NOMEM or an error code resulting + * from a failed string conversion. + */ +static int +new_dentry(const tchar *name, struct wim_dentry **dentry_ret) +{ + struct wim_dentry *dentry; + int ret; + + dentry = CALLOC(1, sizeof(struct wim_dentry)); + if (!dentry) + return WIMLIB_ERR_NOMEM; + + if (name && *name) { + ret = dentry_set_name(dentry, name); + if (ret) { + FREE(dentry); + return ret; + } + } + dentry->d_parent = dentry; + *dentry_ret = dentry; + return 0; +} + +/* Like new_dentry(), but also allocate an inode and associate it with the + * dentry. If set_timestamps=true, the timestamps for the inode will be set to + * the current time; otherwise, they will be left 0. */ +int +new_dentry_with_new_inode(const tchar *name, bool set_timestamps, + struct wim_dentry **dentry_ret) +{ + struct wim_dentry *dentry; + struct wim_inode *inode; + int ret; + + ret = new_dentry(name, &dentry); + if (ret) + return ret; + + inode = new_inode(dentry, set_timestamps); + if (!inode) { + free_dentry(dentry); + return WIMLIB_ERR_NOMEM; + } + + *dentry_ret = dentry; + return 0; +} + +/* Like new_dentry(), but also associate the new dentry with the specified inode + * and acquire a reference to each of the inode's blobs. */ +int +new_dentry_with_existing_inode(const tchar *name, struct wim_inode *inode, + struct wim_dentry **dentry_ret) +{ + int ret = new_dentry(name, dentry_ret); + if (ret) + return ret; + d_associate(*dentry_ret, inode); + inode_ref_blobs(inode); + return 0; +} + +/* Create an unnamed dentry with a new inode for a directory with the default + * metadata. */ +int +new_filler_directory(struct wim_dentry **dentry_ret) +{ + int ret; + struct wim_dentry *dentry; + + ret = new_dentry_with_new_inode(NULL, true, &dentry); + if (ret) + return ret; + /* Leave the inode number as 0; this is allowed for non + * hard-linked files. */ + dentry->d_inode->i_attributes = FILE_ATTRIBUTE_DIRECTORY; + *dentry_ret = dentry; + return 0; +} + +/* + * Free a WIM dentry. + * + * In addition to freeing the dentry itself, this disassociates the dentry from + * its inode. If the inode is no longer in use, it will be freed as well. + */ +void +free_dentry(struct wim_dentry *dentry) +{ + if (dentry) { + d_disassociate(dentry); + FREE(dentry->d_name); + FREE(dentry->d_short_name); + FREE(dentry->d_full_path); + FREE(dentry); + } +} + +static int +do_free_dentry(struct wim_dentry *dentry, void *_ignore) +{ + free_dentry(dentry); + return 0; +} + +static int +do_free_dentry_and_unref_blobs(struct wim_dentry *dentry, void *blob_table) +{ + inode_unref_blobs(dentry->d_inode, blob_table); + free_dentry(dentry); + return 0; +} + +/* + * Free all dentries in a tree. + * + * @root: + * The root of the dentry tree to free. If NULL, this function has no + * effect. + * + * @blob_table: + * A pointer to the blob table for the WIM, or NULL if not specified. If + * specified, this function will decrement the reference counts of the + * blobs referenced by the dentries. + * + * This function also releases references to the corresponding inodes. + * + * This function does *not* unlink @root from its parent directory, if it has + * one. If @root has a parent, the caller must unlink @root before calling this + * function. + */ +void +free_dentry_tree(struct wim_dentry *root, struct blob_table *blob_table) +{ + int (*f)(struct wim_dentry *, void *); + + if (blob_table) + f = do_free_dentry_and_unref_blobs; + else + f = do_free_dentry; + + for_dentry_in_tree_depth(root, f, blob_table); +} + +/* + * Return the first dentry in the list of dentries which have the same + * case-insensitive name as the one given. + */ +struct wim_dentry * +dentry_get_first_ci_match(struct wim_dentry *dentry) +{ + struct wim_dentry *ci_match = dentry; + + for (;;) { + struct avl_tree_node *node; + struct wim_dentry *prev; + + node = avl_tree_prev_in_order(&ci_match->d_index_node); + if (!node) + break; + prev = avl_tree_entry(node, struct wim_dentry, d_index_node); + if (dentry_compare_names(prev, dentry, true)) + break; + ci_match = prev; + } + + if (ci_match == dentry) + return dentry_get_next_ci_match(dentry, dentry); + + return ci_match; +} + +/* + * Return the next dentry in the list of dentries which have the same + * case-insensitive name as the one given. + */ +struct wim_dentry * +dentry_get_next_ci_match(struct wim_dentry *dentry, struct wim_dentry *ci_match) +{ + do { + struct avl_tree_node *node; + + node = avl_tree_next_in_order(&ci_match->d_index_node); + if (!node) + return NULL; + ci_match = avl_tree_entry(node, struct wim_dentry, d_index_node); + } while (ci_match == dentry); + + if (dentry_compare_names(ci_match, dentry, true)) + return NULL; + + return ci_match; +} + +/* + * Link a dentry into a directory. + * + * @parent: + * The directory into which to link the dentry. + * + * @child: + * The dentry to link into the directory. It must be currently unlinked. + * + * Returns NULL if successful; or, if @parent already contains a dentry with the + * same case-sensitive name as @child, then a pointer to this duplicate dentry + * is returned. + */ +struct wim_dentry * +dentry_add_child(struct wim_dentry *parent, struct wim_dentry *child) +{ + struct wim_inode *dir = parent->d_inode; + struct avl_tree_node *duplicate; + + wimlib_assert(parent != child); + wimlib_assert(inode_is_directory(dir)); + + duplicate = avl_tree_insert(&dir->i_children, &child->d_index_node, + collate_dentry_names); + if (duplicate) + return avl_tree_entry(duplicate, struct wim_dentry, d_index_node); + + child->d_parent = parent; + return NULL; +} + +/* Unlink a dentry from its parent directory. */ +void +unlink_dentry(struct wim_dentry *dentry) +{ + /* Do nothing if the dentry is root or it's already unlinked. Not + * actually necessary based on the current callers, but we do the check + * here to be safe. */ + if (unlikely(dentry->d_parent == dentry)) + return; + + avl_tree_remove(&dentry->d_parent->d_inode->i_children, + &dentry->d_index_node); + + /* Not actually necessary, but to be safe don't retain the now-obsolete + * parent pointer. */ + dentry->d_parent = dentry; +} + +static int +read_extra_data(const u8 *p, const u8 *end, struct wim_inode *inode) +{ + while (((uintptr_t)p & 7) && p < end) + p++; + + if (unlikely(p < end)) { + inode->i_extra = MALLOC(sizeof(struct wim_inode_extra) + + end - p); + if (!inode->i_extra) + return WIMLIB_ERR_NOMEM; + inode->i_extra->size = end - p; + memcpy(inode->i_extra->data, p, end - p); + } + return 0; +} + +/* + * Set the type of each stream for an encrypted file. + * + * All data streams of the encrypted file should have been packed into a single + * stream in the format provided by ReadEncryptedFileRaw() on Windows. We + * assign this stream type STREAM_TYPE_EFSRPC_RAW_DATA. + * + * Encrypted files can't have a reparse point stream. In the on-disk NTFS + * format they can, but as far as I know the reparse point stream of an + * encrypted file can't be stored in the WIM format in a way that's compatible + * with WIMGAPI, nor is there even any way for it to be read or written on + * Windows when the process does not have access to the file encryption key. + */ +static void +assign_stream_types_encrypted(struct wim_inode *inode) +{ + for (unsigned i = 0; i < inode->i_num_streams; i++) { + struct wim_inode_stream *strm = &inode->i_streams[i]; + if (!stream_is_named(strm) && !is_zero_hash(strm->_stream_hash)) + { + strm->stream_type = STREAM_TYPE_EFSRPC_RAW_DATA; + return; + } + } +} + +/* + * Set the type of each stream for an unencrypted file. + * + * To specify the streams of each file, the WIM provides a main_hash and an + * optional list of "extra stream entries". Each extra stream entry is a + * (name, hash) pair where the name is optional. Hashes can be the special + * value of zero_hash, which means the stream is empty (zero-length). + * + * While extra stream entries with names always refer to "named data streams", + * the main hash and any extra unnamed hashes can be hard to interpret. This is + * because the WIM file format unfortunately doesn't make it very clear which is + * the unnamed data stream (i.e. standard file contents) and which is the + * reparse stream. The way this ambiguity is resolved (based on what MS + * software seems to do) is by (1) a file can have at most one unnamed data + * stream and at most one reparse stream, (2) a reparse stream is present if and + * only if the file has FILE_ATTRIBUTE_REPARSE_POINT, and (3) the reparse + * stream, if present, is stored before the unnamed data stream if present + * (considering main_hash to come before any extra hashes). Note: directories + * need not have an unnamed data stream stored, even with a zero hash, as + * "unnamed data stream" isn't meaningful for a directory in the first place. + * + * With those rules in mind, one would expect that the first unnamed stream + * would use main_hash, and the second (if present) would use an extra stream + * entry. However, there is another quirk that we must be compatible with: + * sometimes main_hash isn't used and only extra stream entries are used. To + * handle this, we ignore main_hash if it is zero and there is at least one + * unnamed extra stream entry. This works correctly as long as a zero main_hash + * and an unnamed extra stream entry is never used to represent an empty reparse + * stream and an unnamed data stream. (It's not, as the reparse stream always + * goes in the extra stream entries in this case. See write_dentry_streams().) + */ +static void +assign_stream_types_unencrypted(struct wim_inode *inode) +{ + bool found_reparse_stream = false; + bool found_unnamed_data_stream = false; + + for (unsigned i = 0; i < inode->i_num_streams; i++) { + struct wim_inode_stream *strm = &inode->i_streams[i]; + + if (stream_is_named(strm)) { + /* Named extra stream entry */ + strm->stream_type = STREAM_TYPE_DATA; + } else if (i != 0 || !is_zero_hash(strm->_stream_hash)) { + /* Unnamed extra stream entry or a nonzero main_hash */ + if ((inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) && + !found_reparse_stream) { + found_reparse_stream = true; + strm->stream_type = STREAM_TYPE_REPARSE_POINT; + } else if (!found_unnamed_data_stream) { + found_unnamed_data_stream = true; + strm->stream_type = STREAM_TYPE_DATA; + } /* Else, too many unnamed streams were found. */ + + } /* Else, it's a zero main_hash. */ + } + + /* If needed, use the zero main_hash. */ + if (!found_reparse_stream && !found_unnamed_data_stream) { + inode->i_streams[0].stream_type = + (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) ? + STREAM_TYPE_REPARSE_POINT : STREAM_TYPE_DATA; + } +} + +/* + * Read and interpret the collection of streams for the specified inode. + */ +static int +setup_inode_streams(const u8 *p, const u8 *end, struct wim_inode *inode, + unsigned num_extra_streams, const u8 *main_hash, + u64 *offset_p) +{ + const u8 *orig_p = p; + + inode->i_num_streams = 1 + num_extra_streams; + + if (unlikely(inode->i_num_streams > ARRAY_LEN(inode->i_embedded_streams))) { + inode->i_streams = CALLOC(inode->i_num_streams, + sizeof(inode->i_streams[0])); + if (!inode->i_streams) + return WIMLIB_ERR_NOMEM; + } + + /* Use main_hash for the first stream. */ + inode->i_streams[0].stream_name = (utf16lechar *)NO_STREAM_NAME; + copy_hash(inode->i_streams[0]._stream_hash, main_hash); + inode->i_streams[0].stream_type = STREAM_TYPE_UNKNOWN; + inode->i_streams[0].stream_id = 0; + + /* Read the extra stream entries. */ + for (unsigned i = 1; i < inode->i_num_streams; i++) { + struct wim_inode_stream *strm; + const struct wim_extra_stream_entry_on_disk *disk_strm; + u64 length; + u16 name_nbytes; + + strm = &inode->i_streams[i]; + + strm->stream_id = i; + + /* Do we have at least the size of the fixed-length data we know + * need? */ + if ((end - p) < sizeof(struct wim_extra_stream_entry_on_disk)) + return WIMLIB_ERR_INVALID_METADATA_RESOURCE; + + disk_strm = (const struct wim_extra_stream_entry_on_disk *)p; + + /* Read the length field */ + length = ALIGN(le64_to_cpu(disk_strm->length), 8); + + /* Make sure the length field is neither so small it doesn't + * include all the fixed-length data nor so large it overflows + * the metadata resource buffer. */ + if (length < sizeof(struct wim_extra_stream_entry_on_disk) || + length > (end - p)) + return WIMLIB_ERR_INVALID_METADATA_RESOURCE; + + /* Read the rest of the fixed-length data. */ + + copy_hash(strm->_stream_hash, disk_strm->hash); + name_nbytes = le16_to_cpu(disk_strm->name_nbytes); + + /* If stream_name_nbytes != 0, the stream is named. */ + if (name_nbytes != 0) { + /* The name is encoded in UTF16-LE, which uses 2-byte + * coding units, so the length of the name had better be + * an even number of bytes. */ + if (name_nbytes & 1) + return WIMLIB_ERR_INVALID_METADATA_RESOURCE; + + /* Add the length of the stream name to get the length + * we actually need to read. Make sure this isn't more + * than the specified length of the entry. */ + if (sizeof(struct wim_extra_stream_entry_on_disk) + + name_nbytes > length) + return WIMLIB_ERR_INVALID_METADATA_RESOURCE; + + strm->stream_name = utf16le_dupz(disk_strm->name, + name_nbytes); + if (!strm->stream_name) + return WIMLIB_ERR_NOMEM; + } else { + strm->stream_name = (utf16lechar *)NO_STREAM_NAME; + } + + strm->stream_type = STREAM_TYPE_UNKNOWN; + + p += length; + } + + inode->i_next_stream_id = inode->i_num_streams; + + /* Now, assign a type to each stream. Unfortunately this requires + * various hacks because stream types aren't explicitly provided in the + * WIM on-disk format. */ + + if (unlikely(inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED)) + assign_stream_types_encrypted(inode); + else + assign_stream_types_unencrypted(inode); + + *offset_p += p - orig_p; + return 0; +} + +/* Read a dentry, including all extra stream entries that follow it, from an + * uncompressed metadata resource buffer. */ +static int +read_dentry(const u8 * restrict buf, size_t buf_len, + u64 *offset_p, struct wim_dentry **dentry_ret) +{ + u64 offset = *offset_p; + u64 length; + const u8 *p; + const struct wim_dentry_on_disk *disk_dentry; + struct wim_dentry *dentry; + struct wim_inode *inode; + u16 short_name_nbytes; + u16 name_nbytes; + u64 calculated_size; + int ret; + + STATIC_ASSERT(sizeof(struct wim_dentry_on_disk) == WIM_DENTRY_DISK_SIZE); + + /* Before reading the whole dentry, we need to read just the length. + * This is because a dentry of length 8 (that is, just the length field) + * terminates the list of sibling directory entries. */ + + /* Check for buffer overrun. */ + if (unlikely(offset + sizeof(u64) > buf_len || + offset + sizeof(u64) < offset)) + return WIMLIB_ERR_INVALID_METADATA_RESOURCE; + + /* Get pointer to the dentry data. */ + p = &buf[offset]; + disk_dentry = (const struct wim_dentry_on_disk*)p; + + /* Get dentry length. */ + length = ALIGN(le64_to_cpu(disk_dentry->length), 8); + + /* Check for end-of-directory. */ + if (length <= 8) { + *dentry_ret = NULL; + return 0; + } + + /* Validate dentry length. */ + if (unlikely(length < sizeof(struct wim_dentry_on_disk))) + return WIMLIB_ERR_INVALID_METADATA_RESOURCE; + + /* Check for buffer overrun. */ + if (unlikely(offset + length > buf_len || + offset + length < offset)) + return WIMLIB_ERR_INVALID_METADATA_RESOURCE; + + /* Allocate new dentry structure, along with a preliminary inode. */ + ret = new_dentry_with_new_inode(NULL, false, &dentry); + if (ret) + return ret; + + inode = dentry->d_inode; + + /* Read more fields: some into the dentry, and some into the inode. */ + inode->i_attributes = le32_to_cpu(disk_dentry->attributes); + inode->i_security_id = le32_to_cpu(disk_dentry->security_id); + dentry->d_subdir_offset = le64_to_cpu(disk_dentry->subdir_offset); + inode->i_creation_time = le64_to_cpu(disk_dentry->creation_time); + inode->i_last_access_time = le64_to_cpu(disk_dentry->last_access_time); + inode->i_last_write_time = le64_to_cpu(disk_dentry->last_write_time); + inode->i_unknown_0x54 = le32_to_cpu(disk_dentry->unknown_0x54); + + if (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) { + inode->i_reparse_tag = le32_to_cpu(disk_dentry->reparse.reparse_tag); + inode->i_rp_reserved = le16_to_cpu(disk_dentry->reparse.rp_reserved); + inode->i_rp_flags = le16_to_cpu(disk_dentry->reparse.rp_flags); + /* Leave inode->i_ino at 0. Note: this means that WIM cannot + * represent multiple hard links to a reparse point file. */ + } else { + inode->i_ino = le64_to_cpu(disk_dentry->nonreparse.hard_link_group_id); + } + + /* Now onto reading the names. There are two of them: the (long) file + * name, and the short name. */ + + short_name_nbytes = le16_to_cpu(disk_dentry->short_name_nbytes); + name_nbytes = le16_to_cpu(disk_dentry->name_nbytes); + + if (unlikely((short_name_nbytes & 1) | (name_nbytes & 1))) { + ret = WIMLIB_ERR_INVALID_METADATA_RESOURCE; + goto err_free_dentry; + } + + /* We now know the length of the file name and short name. Make sure + * the length of the dentry is large enough to actually hold them. */ + calculated_size = dentry_min_len_with_names(name_nbytes, + short_name_nbytes); + + if (unlikely(length < calculated_size)) { + ret = WIMLIB_ERR_INVALID_METADATA_RESOURCE; + goto err_free_dentry; + } + + /* Advance p to point past the base dentry, to the first name. */ + p += sizeof(struct wim_dentry_on_disk); + + /* Read the filename if present. Note: if the filename is empty, there + * is no null terminator following it. */ + if (name_nbytes) { + dentry->d_name = utf16le_dupz(p, name_nbytes); + if (unlikely(!dentry->d_name)) { + ret = WIMLIB_ERR_NOMEM; + goto err_free_dentry; + } + dentry->d_name_nbytes = name_nbytes; + p += (u32)name_nbytes + 2; + } + + /* Read the short filename if present. Note: if there is no short + * filename, there is no null terminator following it. */ + if (short_name_nbytes) { + dentry->d_short_name = utf16le_dupz(p, short_name_nbytes); + if (unlikely(!dentry->d_short_name)) { + ret = WIMLIB_ERR_NOMEM; + goto err_free_dentry; + } + dentry->d_short_name_nbytes = short_name_nbytes; + p += (u32)short_name_nbytes + 2; + } + + /* Read extra data at end of dentry (but before extra stream entries). + * This may contain tagged metadata items. */ + ret = read_extra_data(p, &buf[offset + length], inode); + if (ret) + goto err_free_dentry; + + offset += length; + + /* Set up the inode's collection of streams. */ + ret = setup_inode_streams(&buf[offset], + &buf[buf_len], + inode, + le16_to_cpu(disk_dentry->num_extra_streams), + disk_dentry->main_hash, + &offset); + if (ret) + goto err_free_dentry; + + *offset_p = offset; /* Sets offset of next dentry in directory */ + *dentry_ret = dentry; + return 0; + +err_free_dentry: + free_dentry(dentry); + return ret; +} + +static bool +dentry_is_dot_or_dotdot(const struct wim_dentry *dentry) +{ + if (dentry->d_name_nbytes <= 4) { + if (dentry->d_name_nbytes == 4) { + if (dentry->d_name[0] == cpu_to_le16('.') && + dentry->d_name[1] == cpu_to_le16('.')) + return true; + } else if (dentry->d_name_nbytes == 2) { + if (dentry->d_name[0] == cpu_to_le16('.')) + return true; + } + } + return false; +} + +static bool +dentry_contains_embedded_null(const struct wim_dentry *dentry) +{ + for (unsigned i = 0; i < dentry->d_name_nbytes / 2; i++) + if (dentry->d_name[i] == cpu_to_le16('\0')) + return true; + return false; +} + +static bool +should_ignore_dentry(struct wim_dentry *dir, const struct wim_dentry *dentry) +{ + /* All dentries except the root must be named. */ + if (!dentry_has_long_name(dentry)) { + WARNING("Ignoring unnamed file in directory \"%"TS"\"", + dentry_full_path(dir)); + return true; + } + + /* Don't allow files named "." or "..". Such filenames could be used in + * path traversal attacks. */ + if (dentry_is_dot_or_dotdot(dentry)) { + WARNING("Ignoring file named \".\" or \"..\" in directory " + "\"%"TS"\"", dentry_full_path(dir)); + return true; + } + + /* Don't allow filenames containing embedded null characters. Although + * the null character is already considered an unsupported character for + * extraction by all targets, it is probably a good idea to just forbid + * such names entirely. */ + if (dentry_contains_embedded_null(dentry)) { + WARNING("Ignoring filename with embedded null character in " + "directory \"%"TS"\"", dentry_full_path(dir)); + return true; + } + + return false; +} + +static int +read_dentry_tree_recursive(const u8 * restrict buf, size_t buf_len, + struct wim_dentry * restrict dir, unsigned depth) +{ + u64 cur_offset = dir->d_subdir_offset; + + /* Disallow extremely deep or cyclic directory structures */ + if (unlikely(depth >= 16384)) { + ERROR("Directory structure too deep!"); + return WIMLIB_ERR_INVALID_METADATA_RESOURCE; + } + + for (;;) { + struct wim_dentry *child; + struct wim_dentry *duplicate; + int ret; + + /* Read next child of @dir. */ + ret = read_dentry(buf, buf_len, &cur_offset, &child); + if (ret) + return ret; + + /* Check for end of directory. */ + if (child == NULL) + return 0; + + /* Ignore dentries with bad names. */ + if (unlikely(should_ignore_dentry(dir, child))) { + free_dentry(child); + continue; + } + + /* Link the child into the directory. */ + duplicate = dentry_add_child(dir, child); + if (unlikely(duplicate)) { + /* We already found a dentry with this same + * case-sensitive long name. Only keep the first one. + */ + WARNING("Ignoring duplicate file \"%"TS"\" " + "(the WIM image already contains a file " + "at that path with the exact same name)", + dentry_full_path(duplicate)); + free_dentry(child); + continue; + } + + /* If this child is a directory that itself has children, call + * this procedure recursively. */ + if (child->d_subdir_offset != 0) { + if (likely(dentry_is_directory(child))) { + ret = read_dentry_tree_recursive(buf, + buf_len, + child, + depth + 1); + if (ret) + return ret; + } else { + WARNING("Ignoring children of " + "non-directory file \"%"TS"\"", + dentry_full_path(child)); + } + } + } +} + +/* + * Read a tree of dentries from a WIM metadata resource. + * + * @buf: + * Buffer containing an uncompressed WIM metadata resource. + * + * @buf_len: + * Length of the uncompressed metadata resource, in bytes. + * + * @root_offset + * Offset in the metadata resource of the root of the dentry tree. + * + * @root_ret: + * On success, either NULL or a pointer to the root dentry is written to + * this location. The former case only occurs in the unexpected case that + * the tree began with an end-of-directory entry. + * + * Return values: + * WIMLIB_ERR_SUCCESS (0) + * WIMLIB_ERR_INVALID_METADATA_RESOURCE + * WIMLIB_ERR_NOMEM + */ +int +read_dentry_tree(const u8 *buf, size_t buf_len, + u64 root_offset, struct wim_dentry **root_ret) +{ + int ret; + struct wim_dentry *root; + + ret = read_dentry(buf, buf_len, &root_offset, &root); + if (ret) + return ret; + + if (likely(root != NULL)) { + if (unlikely(dentry_has_long_name(root) || + dentry_has_short_name(root))) + { + WARNING("The root directory has a nonempty name; " + "removing it."); + dentry_set_name(root, NULL); + } + + if (unlikely(!dentry_is_directory(root))) { + ERROR("The root of the WIM image is not a directory!"); + ret = WIMLIB_ERR_INVALID_METADATA_RESOURCE; + goto err_free_dentry_tree; + } + + if (likely(root->d_subdir_offset != 0)) { + ret = read_dentry_tree_recursive(buf, buf_len, root, 0); + if (ret) + goto err_free_dentry_tree; + } + } else { + WARNING("The metadata resource has no directory entries; " + "treating as an empty image."); + } + *root_ret = root; + return 0; + +err_free_dentry_tree: + free_dentry_tree(root, NULL); + return ret; +} + +static u8 * +write_extra_stream_entry(u8 * restrict p, const utf16lechar * restrict name, + const u8 * restrict hash) +{ + struct wim_extra_stream_entry_on_disk *disk_strm = + (struct wim_extra_stream_entry_on_disk *)p; + u8 *orig_p = p; + size_t name_nbytes; + + if (name == NO_STREAM_NAME) + name_nbytes = 0; + else + name_nbytes = utf16le_len_bytes(name); + + disk_strm->reserved = 0; + copy_hash(disk_strm->hash, hash); + disk_strm->name_nbytes = cpu_to_le16(name_nbytes); + p += sizeof(struct wim_extra_stream_entry_on_disk); + if (name_nbytes != 0) + p = mempcpy(p, name, name_nbytes + 2); + /* Align to 8-byte boundary */ + while ((uintptr_t)p & 7) + *p++ = 0; + disk_strm->length = cpu_to_le64(p - orig_p); + return p; +} + +/* + * Write the stream references for a WIM dentry. To be compatible with DISM, we + * follow the below rules: + * + * 1. If the file has FILE_ATTRIBUTE_ENCRYPTED, then only the EFSRPC_RAW_DATA + * stream is stored. Otherwise, the streams that are stored are: + * - Reparse stream if the file has FILE_ATTRIBUTE_REPARSE_POINT + * - Unnamed data stream if the file doesn't have FILE_ATTRIBUTE_DIRECTORY + * - Named data streams + * + * 2. If only one stream is being stored and it is the EFSRPC_RAW_DATA, unnamed + * data, or reparse stream, then its hash goes in main_hash, and no extra + * stream entries are stored. Otherwise, *all* streams go in the extra + * stream entries, and main_hash is left zeroed! + * + * 3. If both the reparse stream and unnamed data stream are being stored, then + * the reparse stream comes first. + * + * 4. The unnamed stream(s) come before the named stream(s). (Actually, DISM + * puts the named streams between the first and second unnamed streams, but + * this is incompatible with itself... Tested with DISM 10.0.20348.681.) + * + * wimlib v1.14.1 and earlier behaved slightly differently for directories. + * First, wimlib always put the hash of the reparse stream in an extra stream + * entry, never in main_hash. This difference vs. DISM went unnoticed for a + * long time, but eventually it was found that it broke the Windows 8 setup + * wizard. Second, when a directory had any extra streams, wimlib created an + * extra stream entry to represent the (empty) unnamed data stream. However, + * DISM now rejects that (though I think it used to accept it). There isn't + * really any such thing as "unnamed data stream" for a directory. + * + * Keep this in sync with dentry_out_total_length()! + */ +static u8 * +write_dentry_streams(const struct wim_inode *inode, + struct wim_dentry_on_disk *disk_dentry, u8 *p) +{ + const u8 *unnamed_data_stream_hash = zero_hash; + const u8 *reparse_stream_hash = zero_hash; + const u8 *efsrpc_stream_hash = zero_hash; + const u8 *unnamed_stream_hashes[2] = { zero_hash }; + unsigned num_unnamed_streams = 0; + unsigned num_named_streams = 0; + + for (unsigned i = 0; i < inode->i_num_streams; i++) { + const struct wim_inode_stream *strm = &inode->i_streams[i]; + + switch (strm->stream_type) { + case STREAM_TYPE_DATA: + if (stream_is_named(strm)) + num_named_streams++; + else + unnamed_data_stream_hash = stream_hash(strm); + break; + case STREAM_TYPE_REPARSE_POINT: + reparse_stream_hash = stream_hash(strm); + break; + case STREAM_TYPE_EFSRPC_RAW_DATA: + efsrpc_stream_hash = stream_hash(strm); + break; + } + } + + if (inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED) { + unnamed_stream_hashes[num_unnamed_streams++] = efsrpc_stream_hash; + num_named_streams = 0; + } else { + if (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) + unnamed_stream_hashes[num_unnamed_streams++] = reparse_stream_hash; + if (!(inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY)) + unnamed_stream_hashes[num_unnamed_streams++] = unnamed_data_stream_hash; + } + + if (num_unnamed_streams <= 1 && num_named_streams == 0) { + /* No extra stream entries are needed. */ + copy_hash(disk_dentry->main_hash, unnamed_stream_hashes[0]); + disk_dentry->num_extra_streams = 0; + return p; + } + + /* Else, all streams go in extra stream entries. */ + copy_hash(disk_dentry->main_hash, zero_hash); + wimlib_assert(num_unnamed_streams + num_named_streams <= 0xFFFF); + disk_dentry->num_extra_streams = cpu_to_le16(num_unnamed_streams + + num_named_streams); + for (unsigned i = 0; i < num_unnamed_streams; i++) + p = write_extra_stream_entry(p, NO_STREAM_NAME, + unnamed_stream_hashes[i]); + for (unsigned i = 0; i < inode->i_num_streams; i++) { + const struct wim_inode_stream *strm = &inode->i_streams[i]; + + if (stream_is_named_data_stream(strm)) { + p = write_extra_stream_entry(p, strm->stream_name, + stream_hash(strm)); + } + } + return p; +} + +/* + * Write a WIM dentry to an output buffer. + * + * This includes any extra stream entries that may follow the dentry itself. + * + * @dentry: + * The dentry to write. + * + * @p: + * The memory location to which to write the data. + * + * Returns a pointer to the byte following the last written. + */ +static u8 * +write_dentry(const struct wim_dentry * restrict dentry, u8 * restrict p) +{ + const struct wim_inode *inode; + struct wim_dentry_on_disk *disk_dentry; + const u8 *orig_p; + + wimlib_assert(((uintptr_t)p & 7) == 0); /* 8 byte aligned */ + orig_p = p; + + inode = dentry->d_inode; + disk_dentry = (struct wim_dentry_on_disk*)p; + + disk_dentry->attributes = cpu_to_le32(inode->i_attributes); + disk_dentry->security_id = cpu_to_le32(inode->i_security_id); + disk_dentry->subdir_offset = cpu_to_le64(dentry->d_subdir_offset); + + disk_dentry->unused_1 = cpu_to_le64(0); + disk_dentry->unused_2 = cpu_to_le64(0); + + disk_dentry->creation_time = cpu_to_le64(inode->i_creation_time); + disk_dentry->last_access_time = cpu_to_le64(inode->i_last_access_time); + disk_dentry->last_write_time = cpu_to_le64(inode->i_last_write_time); + disk_dentry->unknown_0x54 = cpu_to_le32(inode->i_unknown_0x54); + if (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) { + disk_dentry->reparse.reparse_tag = cpu_to_le32(inode->i_reparse_tag); + disk_dentry->reparse.rp_reserved = cpu_to_le16(inode->i_rp_reserved); + disk_dentry->reparse.rp_flags = cpu_to_le16(inode->i_rp_flags); + } else { + disk_dentry->nonreparse.hard_link_group_id = + cpu_to_le64((inode->i_nlink == 1) ? 0 : inode->i_ino); + } + + disk_dentry->short_name_nbytes = cpu_to_le16(dentry->d_short_name_nbytes); + disk_dentry->name_nbytes = cpu_to_le16(dentry->d_name_nbytes); + p += sizeof(struct wim_dentry_on_disk); + + wimlib_assert(dentry_is_root(dentry) != dentry_has_long_name(dentry)); + + if (dentry_has_long_name(dentry)) + p = mempcpy(p, dentry->d_name, (u32)dentry->d_name_nbytes + 2); + + if (dentry_has_short_name(dentry)) + p = mempcpy(p, dentry->d_short_name, (u32)dentry->d_short_name_nbytes + 2); + + /* Align to 8-byte boundary */ + while ((uintptr_t)p & 7) + *p++ = 0; + + if (inode->i_extra) { + /* Extra tagged items --- not usually present. */ + p = mempcpy(p, inode->i_extra->data, inode->i_extra->size); + + /* Align to 8-byte boundary */ + while ((uintptr_t)p & 7) + *p++ = 0; + } + + disk_dentry->length = cpu_to_le64(p - orig_p); + + /* + * Set disk_dentry->main_hash and disk_dentry->num_extra_streams, + * and write any extra stream entries that are needed. + */ + return write_dentry_streams(inode, disk_dentry, p); +} + +static int +write_dir_dentries(struct wim_dentry *dir, void *_pp) +{ + if (dir->d_subdir_offset != 0) { + u8 **pp = _pp; + u8 *p = *pp; + struct wim_dentry *child; + + /* write child dentries */ + for_dentry_child(child, dir) + p = write_dentry(child, p); + + /* write end of directory entry */ + *(u64*)p = 0; + p += 8; + *pp = p; + } + return 0; +} + +/* + * Write a directory tree to the metadata resource. + * + * @root: + * The root of a dentry tree on which calculate_subdir_offsets() has been + * called. This cannot be NULL; if the dentry tree is empty, the caller is + * expected to first generate a dummy root directory. + * + * @p: + * Pointer to a buffer with enough space for the dentry tree. This size + * must have been obtained by calculate_subdir_offsets(). + * + * Returns a pointer to the byte following the last written. + */ +u8 * +write_dentry_tree(struct wim_dentry *root, u8 *p) +{ + /* write root dentry and end-of-directory entry following it */ + p = write_dentry(root, p); + *(u64*)p = 0; + p += 8; + + /* write the rest of the dentry tree */ + for_dentry_in_tree(root, write_dir_dentries, &p); + + return p; +} diff --git a/src/wimlib/divsufsort.c b/src/wimlib/divsufsort.c new file mode 100644 index 00000000..81a13f97 --- /dev/null +++ b/src/wimlib/divsufsort.c @@ -0,0 +1,1604 @@ +/* + * divsufsort.c for libdivsufsort-lite + * Copyright (c) 2003-2008 Yuta Mori All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/divsufsort.h" +#include "wimlib/util.h" + +#define DIVSUFSORT_ASSERT(expr) + +/*- Constants -*/ +#define ALPHABET_SIZE 256 +#define BUCKET_A_SIZE (ALPHABET_SIZE) +#define BUCKET_B_SIZE (ALPHABET_SIZE * ALPHABET_SIZE) + +#define SS_INSERTIONSORT_THRESHOLD 8 + +#define SS_BLOCKSIZE 1024 + +/* minstacksize = log(SS_BLOCKSIZE) / log(3) * 2 */ +#if SS_BLOCKSIZE == 0 +# define SS_MISORT_STACKSIZE (96) +#elif SS_BLOCKSIZE <= 4096 +# define SS_MISORT_STACKSIZE (16) +#else +# define SS_MISORT_STACKSIZE (24) +#endif +#define SS_SMERGE_STACKSIZE (32) +#define TR_INSERTIONSORT_THRESHOLD (8) +#define TR_STACKSIZE (64) + + +/*- Macros -*/ + +#define STACK_PUSH(_a, _b, _c, _d)\ + do {\ + DIVSUFSORT_ASSERT(ssize < STACK_SIZE);\ + stack[ssize].a = (_a), stack[ssize].b = (_b),\ + stack[ssize].c = (_c), stack[ssize++].d = (_d);\ + } while(0) +#define STACK_PUSH5(_a, _b, _c, _d, _e)\ + do {\ + DIVSUFSORT_ASSERT(ssize < STACK_SIZE);\ + stack[ssize].a = (_a), stack[ssize].b = (_b),\ + stack[ssize].c = (_c), stack[ssize].d = (_d), stack[ssize++].e = (_e);\ + } while(0) +#define STACK_POP(_a, _b, _c, _d)\ + do {\ + DIVSUFSORT_ASSERT(0 <= ssize);\ + if(ssize == 0) { return; }\ + (_a) = stack[--ssize].a, (_b) = stack[ssize].b,\ + (_c) = stack[ssize].c, (_d) = stack[ssize].d;\ + } while(0) +#define STACK_POP5(_a, _b, _c, _d, _e)\ + do {\ + DIVSUFSORT_ASSERT(0 <= ssize);\ + if(ssize == 0) { return; }\ + (_a) = stack[--ssize].a, (_b) = stack[ssize].b,\ + (_c) = stack[ssize].c, (_d) = stack[ssize].d, (_e) = stack[ssize].e;\ + } while(0) +#define BUCKET_A(_c0) bucket_A[(_c0)] +#if ALPHABET_SIZE == 256 +#define BUCKET_B(_c0, _c1) (bucket_B[((_c1) << 8) | (_c0)]) +#define BUCKET_BSTAR(_c0, _c1) (bucket_B[((_c0) << 8) | (_c1)]) +#else +#define BUCKET_B(_c0, _c1) (bucket_B[(_c1) * ALPHABET_SIZE + (_c0)]) +#define BUCKET_BSTAR(_c0, _c1) (bucket_B[(_c0) * ALPHABET_SIZE + (_c1)]) +#endif + + +/*- Private Functions -*/ + +static const int lg_table[256]= { + -1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 +}; + +#if (SS_BLOCKSIZE == 0) || (SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE) + +static forceinline +int +ss_ilg(int n) { +#if SS_BLOCKSIZE == 0 + return (n & 0xffff0000) ? + ((n & 0xff000000) ? + 24 + lg_table[(n >> 24) & 0xff] : + 16 + lg_table[(n >> 16) & 0xff]) : + ((n & 0x0000ff00) ? + 8 + lg_table[(n >> 8) & 0xff] : + 0 + lg_table[(n >> 0) & 0xff]); +#elif SS_BLOCKSIZE < 256 + return lg_table[n]; +#else + return (n & 0xff00) ? + 8 + lg_table[(n >> 8) & 0xff] : + 0 + lg_table[(n >> 0) & 0xff]; +#endif +} + +#endif /* (SS_BLOCKSIZE == 0) || (SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE) */ + +#if SS_BLOCKSIZE != 0 + +static const int sqq_table[256] = { + 0, 16, 22, 27, 32, 35, 39, 42, 45, 48, 50, 53, 55, 57, 59, 61, + 64, 65, 67, 69, 71, 73, 75, 76, 78, 80, 81, 83, 84, 86, 87, 89, + 90, 91, 93, 94, 96, 97, 98, 99, 101, 102, 103, 104, 106, 107, 108, 109, +110, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, +128, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, +143, 144, 144, 145, 146, 147, 148, 149, 150, 150, 151, 152, 153, 154, 155, 155, +156, 157, 158, 159, 160, 160, 161, 162, 163, 163, 164, 165, 166, 167, 167, 168, +169, 170, 170, 171, 172, 173, 173, 174, 175, 176, 176, 177, 178, 178, 179, 180, +181, 181, 182, 183, 183, 184, 185, 185, 186, 187, 187, 188, 189, 189, 190, 191, +192, 192, 193, 193, 194, 195, 195, 196, 197, 197, 198, 199, 199, 200, 201, 201, +202, 203, 203, 204, 204, 205, 206, 206, 207, 208, 208, 209, 209, 210, 211, 211, +212, 212, 213, 214, 214, 215, 215, 216, 217, 217, 218, 218, 219, 219, 220, 221, +221, 222, 222, 223, 224, 224, 225, 225, 226, 226, 227, 227, 228, 229, 229, 230, +230, 231, 231, 232, 232, 233, 234, 234, 235, 235, 236, 236, 237, 237, 238, 238, +239, 240, 240, 241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, 247, +247, 248, 248, 249, 249, 250, 250, 251, 251, 252, 252, 253, 253, 254, 254, 255 +}; + +static forceinline +int +ss_isqrt(int x) { + int y, e; + + if(x >= (SS_BLOCKSIZE * SS_BLOCKSIZE)) { return SS_BLOCKSIZE; } + e = (x & 0xffff0000) ? + ((x & 0xff000000) ? + 24 + lg_table[(x >> 24) & 0xff] : + 16 + lg_table[(x >> 16) & 0xff]) : + ((x & 0x0000ff00) ? + 8 + lg_table[(x >> 8) & 0xff] : + 0 + lg_table[(x >> 0) & 0xff]); + + if(e >= 16) { + y = sqq_table[x >> ((e - 6) - (e & 1))] << ((e >> 1) - 7); + if(e >= 24) { y = (y + 1 + x / y) >> 1; } + y = (y + 1 + x / y) >> 1; + } else if(e >= 8) { + y = (sqq_table[x >> ((e - 6) - (e & 1))] >> (7 - (e >> 1))) + 1; + } else { + return sqq_table[x] >> 4; + } + + return (x < (y * y)) ? y - 1 : y; +} + +#endif /* SS_BLOCKSIZE != 0 */ + + +/*---------------------------------------------------------------------------*/ + +/* Compares two suffixes. */ +static forceinline +int +ss_compare(const unsigned char *T, + const int *p1, const int *p2, + int depth) { + const unsigned char *U1, *U2, *U1n, *U2n; + + for(U1 = T + depth + *p1, + U2 = T + depth + *p2, + U1n = T + *(p1 + 1) + 2, + U2n = T + *(p2 + 1) + 2; + (U1 < U1n) && (U2 < U2n) && (*U1 == *U2); + ++U1, ++U2) { + } + + return U1 < U1n ? + (U2 < U2n ? *U1 - *U2 : 1) : + (U2 < U2n ? -1 : 0); +} + + +/*---------------------------------------------------------------------------*/ + +#if (SS_BLOCKSIZE != 1) && (SS_INSERTIONSORT_THRESHOLD != 1) + +/* Insertionsort for small size groups */ +static +void +ss_insertionsort(const unsigned char *T, const int *PA, + int *first, int *last, int depth) { + int *i, *j; + int t; + int r; + + for(i = last - 2; first <= i; --i) { + for(t = *i, j = i + 1; 0 < (r = ss_compare(T, PA + t, PA + *j, depth));) { + do { *(j - 1) = *j; } while((++j < last) && (*j < 0)); + if(last <= j) { break; } + } + if(r == 0) { *j = ~*j; } + *(j - 1) = t; + } +} + +#endif /* (SS_BLOCKSIZE != 1) && (SS_INSERTIONSORT_THRESHOLD != 1) */ + + +/*---------------------------------------------------------------------------*/ + +#if (SS_BLOCKSIZE == 0) || (SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE) + +static forceinline +void +ss_fixdown(const unsigned char *Td, const int *PA, + int *SA, int i, int size) { + int j, k; + int v; + int c, d, e; + + for(v = SA[i], c = Td[PA[v]]; (j = 2 * i + 1) < size; SA[i] = SA[k], i = k) { + d = Td[PA[SA[k = j++]]]; + if(d < (e = Td[PA[SA[j]]])) { k = j; d = e; } + if(d <= c) { break; } + } + SA[i] = v; +} + +/* Simple top-down heapsort. */ +static +void +ss_heapsort(const unsigned char *Td, const int *PA, int *SA, int size) { + int i, m; + int t; + + m = size; + if((size % 2) == 0) { + m--; + if(Td[PA[SA[m / 2]]] < Td[PA[SA[m]]]) { SWAP(SA[m], SA[m / 2]); } + } + + for(i = m / 2 - 1; 0 <= i; --i) { ss_fixdown(Td, PA, SA, i, m); } + if((size % 2) == 0) { SWAP(SA[0], SA[m]); ss_fixdown(Td, PA, SA, 0, m); } + for(i = m - 1; 0 < i; --i) { + t = SA[0], SA[0] = SA[i]; + ss_fixdown(Td, PA, SA, 0, i); + SA[i] = t; + } +} + + +/*---------------------------------------------------------------------------*/ + +/* Returns the median of three elements. */ +static forceinline +int * +ss_median3(const unsigned char *Td, const int *PA, + int *v1, int *v2, int *v3) { + if(Td[PA[*v1]] > Td[PA[*v2]]) { SWAP(v1, v2); } + if(Td[PA[*v2]] > Td[PA[*v3]]) { + if(Td[PA[*v1]] > Td[PA[*v3]]) { return v1; } + else { return v3; } + } + return v2; +} + +/* Returns the median of five elements. */ +static forceinline +int * +ss_median5(const unsigned char *Td, const int *PA, + int *v1, int *v2, int *v3, int *v4, int *v5) { + if(Td[PA[*v2]] > Td[PA[*v3]]) { SWAP(v2, v3); } + if(Td[PA[*v4]] > Td[PA[*v5]]) { SWAP(v4, v5); } + if(Td[PA[*v2]] > Td[PA[*v4]]) { SWAP(v2, v4); SWAP(v3, v5); } + if(Td[PA[*v1]] > Td[PA[*v3]]) { SWAP(v1, v3); } + if(Td[PA[*v1]] > Td[PA[*v4]]) { SWAP(v1, v4); SWAP(v3, v5); } + if(Td[PA[*v3]] > Td[PA[*v4]]) { return v4; } + return v3; +} + +/* Returns the pivot element. */ +static forceinline +int * +ss_pivot(const unsigned char *Td, const int *PA, int *first, int *last) { + int *middle; + int t; + + t = last - first; + middle = first + t / 2; + + if(t <= 512) { + if(t <= 32) { + return ss_median3(Td, PA, first, middle, last - 1); + } else { + t >>= 2; + return ss_median5(Td, PA, first, first + t, middle, last - 1 - t, last - 1); + } + } + t >>= 3; + first = ss_median3(Td, PA, first, first + t, first + (t << 1)); + middle = ss_median3(Td, PA, middle - t, middle, middle + t); + last = ss_median3(Td, PA, last - 1 - (t << 1), last - 1 - t, last - 1); + return ss_median3(Td, PA, first, middle, last); +} + + +/*---------------------------------------------------------------------------*/ + +/* Binary partition for substrings. */ +static forceinline +int * +ss_partition(const int *PA, + int *first, int *last, int depth) { + int *a, *b; + int t; + for(a = first - 1, b = last;;) { + for(; (++a < b) && ((PA[*a] + depth) >= (PA[*a + 1] + 1));) { *a = ~*a; } + for(; (a < --b) && ((PA[*b] + depth) < (PA[*b + 1] + 1));) { } + if(b <= a) { break; } + t = ~*b; + *b = *a; + *a = t; + } + if(first < a) { *first = ~*first; } + return a; +} + +/* Multikey introsort for medium size groups. */ +static +void +ss_mintrosort(const unsigned char *T, const int *PA, + int *first, int *last, + int depth) { +#define STACK_SIZE SS_MISORT_STACKSIZE + struct { int *a, *b, c; int d; } stack[STACK_SIZE]; + const unsigned char *Td; + int *a, *b, *c, *d, *e, *f; + int s, t; + int ssize; + int limit; + int v, x = 0; + + for(ssize = 0, limit = ss_ilg(last - first);;) { + + if((last - first) <= SS_INSERTIONSORT_THRESHOLD) { +#if 1 < SS_INSERTIONSORT_THRESHOLD + if(1 < (last - first)) { ss_insertionsort(T, PA, first, last, depth); } +#endif + STACK_POP(first, last, depth, limit); + continue; + } + + Td = T + depth; + if(limit-- == 0) { ss_heapsort(Td, PA, first, last - first); } + if(limit < 0) { + for(a = first + 1, v = Td[PA[*first]]; a < last; ++a) { + if((x = Td[PA[*a]]) != v) { + if(1 < (a - first)) { break; } + v = x; + first = a; + } + } + if(Td[PA[*first] - 1] < v) { + first = ss_partition(PA, first, a, depth); + } + if((a - first) <= (last - a)) { + if(1 < (a - first)) { + STACK_PUSH(a, last, depth, -1); + last = a, depth += 1, limit = ss_ilg(a - first); + } else { + first = a, limit = -1; + } + } else { + if(1 < (last - a)) { + STACK_PUSH(first, a, depth + 1, ss_ilg(a - first)); + first = a, limit = -1; + } else { + last = a, depth += 1, limit = ss_ilg(a - first); + } + } + continue; + } + + /* choose pivot */ + a = ss_pivot(Td, PA, first, last); + v = Td[PA[*a]]; + SWAP(*first, *a); + + /* partition */ + for(b = first; (++b < last) && ((x = Td[PA[*b]]) == v);) { } + if(((a = b) < last) && (x < v)) { + for(; (++b < last) && ((x = Td[PA[*b]]) <= v);) { + if(x == v) { SWAP(*b, *a); ++a; } + } + } + for(c = last; (b < --c) && ((x = Td[PA[*c]]) == v);) { } + if((b < (d = c)) && (x > v)) { + for(; (b < --c) && ((x = Td[PA[*c]]) >= v);) { + if(x == v) { SWAP(*c, *d); --d; } + } + } + for(; b < c;) { + SWAP(*b, *c); + for(; (++b < c) && ((x = Td[PA[*b]]) <= v);) { + if(x == v) { SWAP(*b, *a); ++a; } + } + for(; (b < --c) && ((x = Td[PA[*c]]) >= v);) { + if(x == v) { SWAP(*c, *d); --d; } + } + } + + if(a <= d) { + c = b - 1; + + if((s = a - first) > (t = b - a)) { s = t; } + for(e = first, f = b - s; 0 < s; --s, ++e, ++f) { SWAP(*e, *f); } + if((s = d - c) > (t = last - d - 1)) { s = t; } + for(e = b, f = last - s; 0 < s; --s, ++e, ++f) { SWAP(*e, *f); } + + a = first + (b - a), c = last - (d - c); + b = (v <= Td[PA[*a] - 1]) ? a : ss_partition(PA, a, c, depth); + + if((a - first) <= (last - c)) { + if((last - c) <= (c - b)) { + STACK_PUSH(b, c, depth + 1, ss_ilg(c - b)); + STACK_PUSH(c, last, depth, limit); + last = a; + } else if((a - first) <= (c - b)) { + STACK_PUSH(c, last, depth, limit); + STACK_PUSH(b, c, depth + 1, ss_ilg(c - b)); + last = a; + } else { + STACK_PUSH(c, last, depth, limit); + STACK_PUSH(first, a, depth, limit); + first = b, last = c, depth += 1, limit = ss_ilg(c - b); + } + } else { + if((a - first) <= (c - b)) { + STACK_PUSH(b, c, depth + 1, ss_ilg(c - b)); + STACK_PUSH(first, a, depth, limit); + first = c; + } else if((last - c) <= (c - b)) { + STACK_PUSH(first, a, depth, limit); + STACK_PUSH(b, c, depth + 1, ss_ilg(c - b)); + first = c; + } else { + STACK_PUSH(first, a, depth, limit); + STACK_PUSH(c, last, depth, limit); + first = b, last = c, depth += 1, limit = ss_ilg(c - b); + } + } + } else { + limit += 1; + if(Td[PA[*first] - 1] < v) { + first = ss_partition(PA, first, last, depth); + limit = ss_ilg(last - first); + } + depth += 1; + } + } +#undef STACK_SIZE +} + +#endif /* (SS_BLOCKSIZE == 0) || (SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE) */ + + +/*---------------------------------------------------------------------------*/ + +#if SS_BLOCKSIZE != 0 + +static forceinline +void +ss_blockswap(int *a, int *b, int n) { + int t; + for(; 0 < n; --n, ++a, ++b) { + t = *a, *a = *b, *b = t; + } +} + +static forceinline +void +ss_rotate(int *first, int *middle, int *last) { + int *a, *b, t; + int l, r; + l = middle - first, r = last - middle; + for(; (0 < l) && (0 < r);) { + if(l == r) { ss_blockswap(first, middle, l); break; } + if(l < r) { + a = last - 1, b = middle - 1; + t = *a; + do { + *a-- = *b, *b-- = *a; + if(b < first) { + *a = t; + last = a; + if((r -= l + 1) <= l) { break; } + a -= 1, b = middle - 1; + t = *a; + } + } while(1); + } else { + a = first, b = middle; + t = *a; + do { + *a++ = *b, *b++ = *a; + if(last <= b) { + *a = t; + first = a + 1; + if((l -= r + 1) <= r) { break; } + a += 1, b = middle; + t = *a; + } + } while(1); + } + } +} + + +/*---------------------------------------------------------------------------*/ + +static +void +ss_inplacemerge(const unsigned char *T, const int *PA, + int *first, int *middle, int *last, + int depth) { + const int *p; + int *a, *b; + int len, half; + int q, r; + int x; + + for(;;) { + if(*(last - 1) < 0) { x = 1; p = PA + ~*(last - 1); } + else { x = 0; p = PA + *(last - 1); } + for(a = first, len = middle - first, half = len >> 1, r = -1; + 0 < len; + len = half, half >>= 1) { + b = a + half; + q = ss_compare(T, PA + ((0 <= *b) ? *b : ~*b), p, depth); + if(q < 0) { + a = b + 1; + half -= (len & 1) ^ 1; + } else { + r = q; + } + } + if(a < middle) { + if(r == 0) { *a = ~*a; } + ss_rotate(a, middle, last); + last -= middle - a; + middle = a; + if(first == middle) { break; } + } + --last; + if(x != 0) { while(*--last < 0) { } } + if(middle == last) { break; } + } +} + + +/*---------------------------------------------------------------------------*/ + +/* Merge-forward with internal buffer. */ +static +void +ss_mergeforward(const unsigned char *T, const int *PA, + int *first, int *middle, int *last, + int *buf, int depth) { + int *a, *b, *c, *bufend; + int t; + int r; + + bufend = buf + (middle - first) - 1; + ss_blockswap(buf, first, middle - first); + + for(t = *(a = first), b = buf, c = middle;;) { + r = ss_compare(T, PA + *b, PA + *c, depth); + if(r < 0) { + do { + *a++ = *b; + if(bufend <= b) { *bufend = t; return; } + *b++ = *a; + } while(*b < 0); + } else if(r > 0) { + do { + *a++ = *c, *c++ = *a; + if(last <= c) { + while(b < bufend) { *a++ = *b, *b++ = *a; } + *a = *b, *b = t; + return; + } + } while(*c < 0); + } else { + *c = ~*c; + do { + *a++ = *b; + if(bufend <= b) { *bufend = t; return; } + *b++ = *a; + } while(*b < 0); + + do { + *a++ = *c, *c++ = *a; + if(last <= c) { + while(b < bufend) { *a++ = *b, *b++ = *a; } + *a = *b, *b = t; + return; + } + } while(*c < 0); + } + } +} + +/* Merge-backward with internal buffer. */ +static +void +ss_mergebackward(const unsigned char *T, const int *PA, + int *first, int *middle, int *last, + int *buf, int depth) { + const int *p1, *p2; + int *a, *b, *c, *bufend; + int t; + int r; + int x; + + bufend = buf + (last - middle) - 1; + ss_blockswap(buf, middle, last - middle); + + x = 0; + if(*bufend < 0) { p1 = PA + ~*bufend; x |= 1; } + else { p1 = PA + *bufend; } + if(*(middle - 1) < 0) { p2 = PA + ~*(middle - 1); x |= 2; } + else { p2 = PA + *(middle - 1); } + for(t = *(a = last - 1), b = bufend, c = middle - 1;;) { + r = ss_compare(T, p1, p2, depth); + if(0 < r) { + if(x & 1) { do { *a-- = *b, *b-- = *a; } while(*b < 0); x ^= 1; } + *a-- = *b; + if(b <= buf) { *buf = t; break; } + *b-- = *a; + if(*b < 0) { p1 = PA + ~*b; x |= 1; } + else { p1 = PA + *b; } + } else if(r < 0) { + if(x & 2) { do { *a-- = *c, *c-- = *a; } while(*c < 0); x ^= 2; } + *a-- = *c, *c-- = *a; + if(c < first) { + while(buf < b) { *a-- = *b, *b-- = *a; } + *a = *b, *b = t; + break; + } + if(*c < 0) { p2 = PA + ~*c; x |= 2; } + else { p2 = PA + *c; } + } else { + if(x & 1) { do { *a-- = *b, *b-- = *a; } while(*b < 0); x ^= 1; } + *a-- = ~*b; + if(b <= buf) { *buf = t; break; } + *b-- = *a; + if(x & 2) { do { *a-- = *c, *c-- = *a; } while(*c < 0); x ^= 2; } + *a-- = *c, *c-- = *a; + if(c < first) { + while(buf < b) { *a-- = *b, *b-- = *a; } + *a = *b, *b = t; + break; + } + if(*b < 0) { p1 = PA + ~*b; x |= 1; } + else { p1 = PA + *b; } + if(*c < 0) { p2 = PA + ~*c; x |= 2; } + else { p2 = PA + *c; } + } + } +} + +/* D&C based merge. */ +static +void +ss_swapmerge(const unsigned char *T, const int *PA, + int *first, int *middle, int *last, + int *buf, int bufsize, int depth) { +#define STACK_SIZE SS_SMERGE_STACKSIZE +#define GETIDX(a) ((0 <= (a)) ? (a) : (~(a))) +#define MERGE_CHECK(a, b, c)\ + do {\ + if(((c) & 1) ||\ + (((c) & 2) && (ss_compare(T, PA + GETIDX(*((a) - 1)), PA + *(a), depth) == 0))) {\ + *(a) = ~*(a);\ + }\ + if(((c) & 4) && ((ss_compare(T, PA + GETIDX(*((b) - 1)), PA + *(b), depth) == 0))) {\ + *(b) = ~*(b);\ + }\ + } while(0) + struct { int *a, *b, *c; int d; } stack[STACK_SIZE]; + int *l, *r, *lm, *rm; + int m, len, half; + int ssize; + int check, next; + + for(check = 0, ssize = 0;;) { + if((last - middle) <= bufsize) { + if((first < middle) && (middle < last)) { + ss_mergebackward(T, PA, first, middle, last, buf, depth); + } + MERGE_CHECK(first, last, check); + STACK_POP(first, middle, last, check); + continue; + } + + if((middle - first) <= bufsize) { + if(first < middle) { + ss_mergeforward(T, PA, first, middle, last, buf, depth); + } + MERGE_CHECK(first, last, check); + STACK_POP(first, middle, last, check); + continue; + } + + for(m = 0, len = MIN(middle - first, last - middle), half = len >> 1; + 0 < len; + len = half, half >>= 1) { + if(ss_compare(T, PA + GETIDX(*(middle + m + half)), + PA + GETIDX(*(middle - m - half - 1)), depth) < 0) { + m += half + 1; + half -= (len & 1) ^ 1; + } + } + + if(0 < m) { + lm = middle - m, rm = middle + m; + ss_blockswap(lm, middle, m); + l = r = middle, next = 0; + if(rm < last) { + if(*rm < 0) { + *rm = ~*rm; + if(first < lm) { for(; *--l < 0;) { } next |= 4; } + next |= 1; + } else if(first < lm) { + for(; *r < 0; ++r) { } + next |= 2; + } + } + + if((l - first) <= (last - r)) { + STACK_PUSH(r, rm, last, (next & 3) | (check & 4)); + middle = lm, last = l, check = (check & 3) | (next & 4); + } else { + if((next & 2) && (r == middle)) { next ^= 6; } + STACK_PUSH(first, lm, l, (check & 3) | (next & 4)); + first = r, middle = rm, check = (next & 3) | (check & 4); + } + } else { + if(ss_compare(T, PA + GETIDX(*(middle - 1)), PA + *middle, depth) == 0) { + *middle = ~*middle; + } + MERGE_CHECK(first, last, check); + STACK_POP(first, middle, last, check); + } + } +#undef STACK_SIZE +} + +#endif /* SS_BLOCKSIZE != 0 */ + + +/*---------------------------------------------------------------------------*/ + +/* Substring sort */ +static +void +sssort(const unsigned char *T, const int *PA, + int *first, int *last, + int *buf, int bufsize, + int depth, int n, int lastsuffix) { + int *a; +#if SS_BLOCKSIZE != 0 + int *b, *middle, *curbuf; + int j, k, curbufsize, limit; +#endif + int i; + + if(lastsuffix != 0) { ++first; } + +#if SS_BLOCKSIZE == 0 + ss_mintrosort(T, PA, first, last, depth); +#else + if((bufsize < SS_BLOCKSIZE) && + (bufsize < (last - first)) && + (bufsize < (limit = ss_isqrt(last - first)))) { + if(SS_BLOCKSIZE < limit) { limit = SS_BLOCKSIZE; } + buf = middle = last - limit, bufsize = limit; + } else { + middle = last, limit = 0; + } + for(a = first, i = 0; SS_BLOCKSIZE < (middle - a); a += SS_BLOCKSIZE, ++i) { +#if SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE + ss_mintrosort(T, PA, a, a + SS_BLOCKSIZE, depth); +#elif 1 < SS_BLOCKSIZE + ss_insertionsort(T, PA, a, a + SS_BLOCKSIZE, depth); +#endif + curbufsize = last - (a + SS_BLOCKSIZE); + curbuf = a + SS_BLOCKSIZE; + if(curbufsize <= bufsize) { curbufsize = bufsize, curbuf = buf; } + for(b = a, k = SS_BLOCKSIZE, j = i; j & 1; b -= k, k <<= 1, j >>= 1) { + ss_swapmerge(T, PA, b - k, b, b + k, curbuf, curbufsize, depth); + } + } +#if SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE + ss_mintrosort(T, PA, a, middle, depth); +#elif 1 < SS_BLOCKSIZE + ss_insertionsort(T, PA, a, middle, depth); +#endif + for(k = SS_BLOCKSIZE; i != 0; k <<= 1, i >>= 1) { + if(i & 1) { + ss_swapmerge(T, PA, a - k, a, middle, buf, bufsize, depth); + a -= k; + } + } + if(limit != 0) { +#if SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE + ss_mintrosort(T, PA, middle, last, depth); +#elif 1 < SS_BLOCKSIZE + ss_insertionsort(T, PA, middle, last, depth); +#endif + ss_inplacemerge(T, PA, first, middle, last, depth); + } +#endif + + if(lastsuffix != 0) { + /* Insert last type B* suffix. */ + int PAi[2]; PAi[0] = PA[*(first - 1)], PAi[1] = n - 2; + for(a = first, i = *(first - 1); + (a < last) && ((*a < 0) || (0 < ss_compare(T, &(PAi[0]), PA + *a, depth))); + ++a) { + *(a - 1) = *a; + } + *(a - 1) = i; + } +} + + +/*---------------------------------------------------------------------------*/ + +static forceinline +int +tr_ilg(int n) { + return (n & 0xffff0000) ? + ((n & 0xff000000) ? + 24 + lg_table[(n >> 24) & 0xff] : + 16 + lg_table[(n >> 16) & 0xff]) : + ((n & 0x0000ff00) ? + 8 + lg_table[(n >> 8) & 0xff] : + 0 + lg_table[(n >> 0) & 0xff]); +} + + +/*---------------------------------------------------------------------------*/ + +/* Simple insertionsort for small size groups. */ +static +void +tr_insertionsort(const int *ISAd, int *first, int *last) { + int *a, *b; + int t, r; + + for(a = first + 1; a < last; ++a) { + for(t = *a, b = a - 1; 0 > (r = ISAd[t] - ISAd[*b]);) { + do { *(b + 1) = *b; } while((first <= --b) && (*b < 0)); + if(b < first) { break; } + } + if(r == 0) { *b = ~*b; } + *(b + 1) = t; + } +} + + +/*---------------------------------------------------------------------------*/ + +static forceinline +void +tr_fixdown(const int *ISAd, int *SA, int i, int size) { + int j, k; + int v; + int c, d, e; + + for(v = SA[i], c = ISAd[v]; (j = 2 * i + 1) < size; SA[i] = SA[k], i = k) { + d = ISAd[SA[k = j++]]; + if(d < (e = ISAd[SA[j]])) { k = j; d = e; } + if(d <= c) { break; } + } + SA[i] = v; +} + +/* Simple top-down heapsort. */ +static +void +tr_heapsort(const int *ISAd, int *SA, int size) { + int i, m; + int t; + + m = size; + if((size % 2) == 0) { + m--; + if(ISAd[SA[m / 2]] < ISAd[SA[m]]) { SWAP(SA[m], SA[m / 2]); } + } + + for(i = m / 2 - 1; 0 <= i; --i) { tr_fixdown(ISAd, SA, i, m); } + if((size % 2) == 0) { SWAP(SA[0], SA[m]); tr_fixdown(ISAd, SA, 0, m); } + for(i = m - 1; 0 < i; --i) { + t = SA[0], SA[0] = SA[i]; + tr_fixdown(ISAd, SA, 0, i); + SA[i] = t; + } +} + + +/*---------------------------------------------------------------------------*/ + +/* Returns the median of three elements. */ +static forceinline +int * +tr_median3(const int *ISAd, int *v1, int *v2, int *v3) { + if(ISAd[*v1] > ISAd[*v2]) { SWAP(v1, v2); } + if(ISAd[*v2] > ISAd[*v3]) { + if(ISAd[*v1] > ISAd[*v3]) { return v1; } + else { return v3; } + } + return v2; +} + +/* Returns the median of five elements. */ +static forceinline +int * +tr_median5(const int *ISAd, + int *v1, int *v2, int *v3, int *v4, int *v5) { + if(ISAd[*v2] > ISAd[*v3]) { SWAP(v2, v3); } + if(ISAd[*v4] > ISAd[*v5]) { SWAP(v4, v5); } + if(ISAd[*v2] > ISAd[*v4]) { SWAP(v2, v4); SWAP(v3, v5); } + if(ISAd[*v1] > ISAd[*v3]) { SWAP(v1, v3); } + if(ISAd[*v1] > ISAd[*v4]) { SWAP(v1, v4); SWAP(v3, v5); } + if(ISAd[*v3] > ISAd[*v4]) { return v4; } + return v3; +} + +/* Returns the pivot element. */ +static forceinline +int * +tr_pivot(const int *ISAd, int *first, int *last) { + int *middle; + int t; + + t = last - first; + middle = first + t / 2; + + if(t <= 512) { + if(t <= 32) { + return tr_median3(ISAd, first, middle, last - 1); + } else { + t >>= 2; + return tr_median5(ISAd, first, first + t, middle, last - 1 - t, last - 1); + } + } + t >>= 3; + first = tr_median3(ISAd, first, first + t, first + (t << 1)); + middle = tr_median3(ISAd, middle - t, middle, middle + t); + last = tr_median3(ISAd, last - 1 - (t << 1), last - 1 - t, last - 1); + return tr_median3(ISAd, first, middle, last); +} + + +/*---------------------------------------------------------------------------*/ + +typedef struct _trbudget_t trbudget_t; +struct _trbudget_t { + int chance; + int remain; + int incval; + int count; +}; + +static forceinline +void +trbudget_init(trbudget_t *budget, int chance, int incval) { + budget->chance = chance; + budget->remain = budget->incval = incval; +} + +static forceinline +int +trbudget_check(trbudget_t *budget, int size) { + if(size <= budget->remain) { budget->remain -= size; return 1; } + if(budget->chance == 0) { budget->count += size; return 0; } + budget->remain += budget->incval - size; + budget->chance -= 1; + return 1; +} + + +/*---------------------------------------------------------------------------*/ + +static forceinline +void +tr_partition(const int *ISAd, + int *first, int *middle, int *last, + int **pa, int **pb, int v) { + int *a, *b, *c, *d, *e, *f; + int t, s; + int x = 0; + + for(b = middle - 1; (++b < last) && ((x = ISAd[*b]) == v);) { } + if(((a = b) < last) && (x < v)) { + for(; (++b < last) && ((x = ISAd[*b]) <= v);) { + if(x == v) { SWAP(*b, *a); ++a; } + } + } + for(c = last; (b < --c) && ((x = ISAd[*c]) == v);) { } + if((b < (d = c)) && (x > v)) { + for(; (b < --c) && ((x = ISAd[*c]) >= v);) { + if(x == v) { SWAP(*c, *d); --d; } + } + } + for(; b < c;) { + SWAP(*b, *c); + for(; (++b < c) && ((x = ISAd[*b]) <= v);) { + if(x == v) { SWAP(*b, *a); ++a; } + } + for(; (b < --c) && ((x = ISAd[*c]) >= v);) { + if(x == v) { SWAP(*c, *d); --d; } + } + } + + if(a <= d) { + c = b - 1; + if((s = a - first) > (t = b - a)) { s = t; } + for(e = first, f = b - s; 0 < s; --s, ++e, ++f) { SWAP(*e, *f); } + if((s = d - c) > (t = last - d - 1)) { s = t; } + for(e = b, f = last - s; 0 < s; --s, ++e, ++f) { SWAP(*e, *f); } + first += (b - a), last -= (d - c); + } + *pa = first, *pb = last; +} + +static +void +tr_copy(int *ISA, const int *SA, + int *first, int *a, int *b, int *last, + int depth) { + /* sort suffixes of middle partition + by using sorted order of suffixes of left and right partition. */ + int *c, *d, *e; + int s, v; + + v = b - SA - 1; + for(c = first, d = a - 1; c <= d; ++c) { + if((0 <= (s = *c - depth)) && (ISA[s] == v)) { + *++d = s; + ISA[s] = d - SA; + } + } + for(c = last - 1, e = d + 1, d = b; e < d; --c) { + if((0 <= (s = *c - depth)) && (ISA[s] == v)) { + *--d = s; + ISA[s] = d - SA; + } + } +} + +static +void +tr_partialcopy(int *ISA, const int *SA, + int *first, int *a, int *b, int *last, + int depth) { + int *c, *d, *e; + int s, v; + int rank, lastrank, newrank = -1; + + v = b - SA - 1; + lastrank = -1; + for(c = first, d = a - 1; c <= d; ++c) { + if((0 <= (s = *c - depth)) && (ISA[s] == v)) { + *++d = s; + rank = ISA[s + depth]; + if(lastrank != rank) { lastrank = rank; newrank = d - SA; } + ISA[s] = newrank; + } + } + + lastrank = -1; + for(e = d; first <= e; --e) { + rank = ISA[*e]; + if(lastrank != rank) { lastrank = rank; newrank = e - SA; } + if(newrank != rank) { ISA[*e] = newrank; } + } + + lastrank = -1; + for(c = last - 1, e = d + 1, d = b; e < d; --c) { + if((0 <= (s = *c - depth)) && (ISA[s] == v)) { + *--d = s; + rank = ISA[s + depth]; + if(lastrank != rank) { lastrank = rank; newrank = d - SA; } + ISA[s] = newrank; + } + } +} + +static +void +tr_introsort(int *ISA, const int *ISAd, + int *SA, int *first, int *last, + trbudget_t *budget) { +#define STACK_SIZE TR_STACKSIZE + struct { const int *a; int *b, *c; int d, e; }stack[STACK_SIZE]; + int *a, *b, *c; + int v, x = 0; + int incr = ISAd - ISA; + int limit, next; + int ssize, trlink = -1; + + for(ssize = 0, limit = tr_ilg(last - first);;) { + + if(limit < 0) { + if(limit == -1) { + /* tandem repeat partition */ + tr_partition(ISAd - incr, first, first, last, &a, &b, last - SA - 1); + + /* update ranks */ + if(a < last) { + for(c = first, v = a - SA - 1; c < a; ++c) { ISA[*c] = v; } + } + if(b < last) { + for(c = a, v = b - SA - 1; c < b; ++c) { ISA[*c] = v; } + } + + /* push */ + if(1 < (b - a)) { + STACK_PUSH5(NULL, a, b, 0, 0); + STACK_PUSH5(ISAd - incr, first, last, -2, trlink); + trlink = ssize - 2; + } + if((a - first) <= (last - b)) { + if(1 < (a - first)) { + STACK_PUSH5(ISAd, b, last, tr_ilg(last - b), trlink); + last = a, limit = tr_ilg(a - first); + } else if(1 < (last - b)) { + first = b, limit = tr_ilg(last - b); + } else { + STACK_POP5(ISAd, first, last, limit, trlink); + } + } else { + if(1 < (last - b)) { + STACK_PUSH5(ISAd, first, a, tr_ilg(a - first), trlink); + first = b, limit = tr_ilg(last - b); + } else if(1 < (a - first)) { + last = a, limit = tr_ilg(a - first); + } else { + STACK_POP5(ISAd, first, last, limit, trlink); + } + } + } else if(limit == -2) { + /* tandem repeat copy */ + a = stack[--ssize].b, b = stack[ssize].c; + if(stack[ssize].d == 0) { + tr_copy(ISA, SA, first, a, b, last, ISAd - ISA); + } else { + if(0 <= trlink) { stack[trlink].d = -1; } + tr_partialcopy(ISA, SA, first, a, b, last, ISAd - ISA); + } + STACK_POP5(ISAd, first, last, limit, trlink); + } else { + /* sorted partition */ + if(0 <= *first) { + a = first; + do { ISA[*a] = a - SA; } while((++a < last) && (0 <= *a)); + first = a; + } + if(first < last) { + a = first; do { *a = ~*a; } while(*++a < 0); + next = (ISA[*a] != ISAd[*a]) ? tr_ilg(a - first + 1) : -1; + if(++a < last) { for(b = first, v = a - SA - 1; b < a; ++b) { ISA[*b] = v; } } + + /* push */ + if(trbudget_check(budget, a - first)) { + if((a - first) <= (last - a)) { + STACK_PUSH5(ISAd, a, last, -3, trlink); + ISAd += incr, last = a, limit = next; + } else { + if(1 < (last - a)) { + STACK_PUSH5(ISAd + incr, first, a, next, trlink); + first = a, limit = -3; + } else { + ISAd += incr, last = a, limit = next; + } + } + } else { + if(0 <= trlink) { stack[trlink].d = -1; } + if(1 < (last - a)) { + first = a, limit = -3; + } else { + STACK_POP5(ISAd, first, last, limit, trlink); + } + } + } else { + STACK_POP5(ISAd, first, last, limit, trlink); + } + } + continue; + } + + if((last - first) <= TR_INSERTIONSORT_THRESHOLD) { + tr_insertionsort(ISAd, first, last); + limit = -3; + continue; + } + + if(limit-- == 0) { + tr_heapsort(ISAd, first, last - first); + for(a = last - 1; first < a; a = b) { + for(x = ISAd[*a], b = a - 1; (first <= b) && (ISAd[*b] == x); --b) { *b = ~*b; } + } + limit = -3; + continue; + } + + /* choose pivot */ + a = tr_pivot(ISAd, first, last); + SWAP(*first, *a); + v = ISAd[*first]; + + /* partition */ + tr_partition(ISAd, first, first + 1, last, &a, &b, v); + if((last - first) != (b - a)) { + next = (ISA[*a] != v) ? tr_ilg(b - a) : -1; + + /* update ranks */ + for(c = first, v = a - SA - 1; c < a; ++c) { ISA[*c] = v; } + if(b < last) { for(c = a, v = b - SA - 1; c < b; ++c) { ISA[*c] = v; } } + + /* push */ + if((1 < (b - a)) && (trbudget_check(budget, b - a))) { + if((a - first) <= (last - b)) { + if((last - b) <= (b - a)) { + if(1 < (a - first)) { + STACK_PUSH5(ISAd + incr, a, b, next, trlink); + STACK_PUSH5(ISAd, b, last, limit, trlink); + last = a; + } else if(1 < (last - b)) { + STACK_PUSH5(ISAd + incr, a, b, next, trlink); + first = b; + } else { + ISAd += incr, first = a, last = b, limit = next; + } + } else if((a - first) <= (b - a)) { + if(1 < (a - first)) { + STACK_PUSH5(ISAd, b, last, limit, trlink); + STACK_PUSH5(ISAd + incr, a, b, next, trlink); + last = a; + } else { + STACK_PUSH5(ISAd, b, last, limit, trlink); + ISAd += incr, first = a, last = b, limit = next; + } + } else { + STACK_PUSH5(ISAd, b, last, limit, trlink); + STACK_PUSH5(ISAd, first, a, limit, trlink); + ISAd += incr, first = a, last = b, limit = next; + } + } else { + if((a - first) <= (b - a)) { + if(1 < (last - b)) { + STACK_PUSH5(ISAd + incr, a, b, next, trlink); + STACK_PUSH5(ISAd, first, a, limit, trlink); + first = b; + } else if(1 < (a - first)) { + STACK_PUSH5(ISAd + incr, a, b, next, trlink); + last = a; + } else { + ISAd += incr, first = a, last = b, limit = next; + } + } else if((last - b) <= (b - a)) { + if(1 < (last - b)) { + STACK_PUSH5(ISAd, first, a, limit, trlink); + STACK_PUSH5(ISAd + incr, a, b, next, trlink); + first = b; + } else { + STACK_PUSH5(ISAd, first, a, limit, trlink); + ISAd += incr, first = a, last = b, limit = next; + } + } else { + STACK_PUSH5(ISAd, first, a, limit, trlink); + STACK_PUSH5(ISAd, b, last, limit, trlink); + ISAd += incr, first = a, last = b, limit = next; + } + } + } else { + if((1 < (b - a)) && (0 <= trlink)) { stack[trlink].d = -1; } + if((a - first) <= (last - b)) { + if(1 < (a - first)) { + STACK_PUSH5(ISAd, b, last, limit, trlink); + last = a; + } else if(1 < (last - b)) { + first = b; + } else { + STACK_POP5(ISAd, first, last, limit, trlink); + } + } else { + if(1 < (last - b)) { + STACK_PUSH5(ISAd, first, a, limit, trlink); + first = b; + } else if(1 < (a - first)) { + last = a; + } else { + STACK_POP5(ISAd, first, last, limit, trlink); + } + } + } + } else { + if(trbudget_check(budget, last - first)) { + limit = tr_ilg(last - first), ISAd += incr; + } else { + if(0 <= trlink) { stack[trlink].d = -1; } + STACK_POP5(ISAd, first, last, limit, trlink); + } + } + } +#undef STACK_SIZE +} + + + +/*---------------------------------------------------------------------------*/ + +/* Tandem repeat sort */ +static +void +trsort(int *ISA, int *SA, int n, int depth) { + int *ISAd; + int *first, *last; + trbudget_t budget; + int t, skip, unsorted; + + trbudget_init(&budget, tr_ilg(n) * 2 / 3, n); +/* trbudget_init(&budget, tr_ilg(n) * 3 / 4, n); */ + for(ISAd = ISA + depth; -n < *SA; ISAd += ISAd - ISA) { + first = SA; + skip = 0; + unsorted = 0; + do { + if((t = *first) < 0) { first -= t; skip += t; } + else { + if(skip != 0) { *(first + skip) = skip; skip = 0; } + last = SA + ISA[t] + 1; + if(1 < (last - first)) { + budget.count = 0; + tr_introsort(ISA, ISAd, SA, first, last, &budget); + if(budget.count != 0) { unsorted += budget.count; } + else { skip = first - last; } + } else if((last - first) == 1) { + skip = -1; + } + first = last; + } + } while(first < (SA + n)); + if(skip != 0) { *(first + skip) = skip; } + if(unsorted == 0) { break; } + } +} + + +/*---------------------------------------------------------------------------*/ + +/* Sorts suffixes of type B*. */ +static +int +sort_typeBstar(const unsigned char *T, int *SA, + int *bucket_A, int *bucket_B, + int n) { + int *PAb, *ISAb, *buf; + int i, j, k, t, m, bufsize; + int c0, c1; + + /* Initialize bucket arrays. */ + for(i = 0; i < BUCKET_A_SIZE; ++i) { bucket_A[i] = 0; } + for(i = 0; i < BUCKET_B_SIZE; ++i) { bucket_B[i] = 0; } + + /* Count the number of occurrences of the first one or two characters of each + type A, B and B* suffix. Moreover, store the beginning position of all + type B* suffixes into the array SA. */ + for(i = n - 1, m = n, c0 = T[n - 1]; 0 <= i;) { + /* type A suffix. */ + do { ++BUCKET_A(c1 = c0); } while((0 <= --i) && ((c0 = T[i]) >= c1)); + if(0 <= i) { + /* type B* suffix. */ + ++BUCKET_BSTAR(c0, c1); + SA[--m] = i; + /* type B suffix. */ + for(--i, c1 = c0; (0 <= i) && ((c0 = T[i]) <= c1); --i, c1 = c0) { + ++BUCKET_B(c0, c1); + } + } + } + m = n - m; +/* +note: + A type B* suffix is lexicographically smaller than a type B suffix that + begins with the same first two characters. +*/ + + /* Calculate the index of start/end point of each bucket. */ + for(c0 = 0, i = 0, j = 0; c0 < ALPHABET_SIZE; ++c0) { + t = i + BUCKET_A(c0); + BUCKET_A(c0) = i + j; /* start point */ + i = t + BUCKET_B(c0, c0); + for(c1 = c0 + 1; c1 < ALPHABET_SIZE; ++c1) { + j += BUCKET_BSTAR(c0, c1); + BUCKET_BSTAR(c0, c1) = j; /* end point */ + i += BUCKET_B(c0, c1); + } + } + + if(0 < m) { + /* Sort the type B* suffixes by their first two characters. */ + PAb = SA + n - m; ISAb = SA + m; + for(i = m - 2; 0 <= i; --i) { + t = PAb[i], c0 = T[t], c1 = T[t + 1]; + SA[--BUCKET_BSTAR(c0, c1)] = i; + } + t = PAb[m - 1], c0 = T[t], c1 = T[t + 1]; + SA[--BUCKET_BSTAR(c0, c1)] = m - 1; + + /* Sort the type B* substrings using sssort. */ + buf = SA + m, bufsize = n - (2 * m); + for(c0 = ALPHABET_SIZE - 2, j = m; 0 < j; --c0) { + for(c1 = ALPHABET_SIZE - 1; c0 < c1; j = i, --c1) { + i = BUCKET_BSTAR(c0, c1); + if(1 < (j - i)) { + sssort(T, PAb, SA + i, SA + j, + buf, bufsize, 2, n, *(SA + i) == (m - 1)); + } + } + } + + /* Compute ranks of type B* substrings. */ + for(i = m - 1; 0 <= i; --i) { + if(0 <= SA[i]) { + j = i; + do { ISAb[SA[i]] = i; } while((0 <= --i) && (0 <= SA[i])); + SA[i + 1] = i - j; + if(i <= 0) { break; } + } + j = i; + do { ISAb[SA[i] = ~SA[i]] = j; } while(SA[--i] < 0); + ISAb[SA[i]] = j; + } + + /* Construct the inverse suffix array of type B* suffixes using trsort. */ + trsort(ISAb, SA, m, 1); + + /* Set the sorted order of tyoe B* suffixes. */ + for(i = n - 1, j = m, c0 = T[n - 1]; 0 <= i;) { + for(--i, c1 = c0; (0 <= i) && ((c0 = T[i]) >= c1); --i, c1 = c0) { } + if(0 <= i) { + t = i; + for(--i, c1 = c0; (0 <= i) && ((c0 = T[i]) <= c1); --i, c1 = c0) { } + SA[ISAb[--j]] = ((t == 0) || (1 < (t - i))) ? t : ~t; + } + } + + /* Calculate the index of start/end point of each bucket. */ + BUCKET_B(ALPHABET_SIZE - 1, ALPHABET_SIZE - 1) = n; /* end point */ + for(c0 = ALPHABET_SIZE - 2, k = m - 1; 0 <= c0; --c0) { + i = BUCKET_A(c0 + 1) - 1; + for(c1 = ALPHABET_SIZE - 1; c0 < c1; --c1) { + t = i - BUCKET_B(c0, c1); + BUCKET_B(c0, c1) = i; /* end point */ + + /* Move all type B* suffixes to the correct position. */ + for(i = t, j = BUCKET_BSTAR(c0, c1); + j <= k; + --i, --k) { SA[i] = SA[k]; } + } + BUCKET_BSTAR(c0, c0 + 1) = i - BUCKET_B(c0, c0) + 1; /* start point */ + BUCKET_B(c0, c0) = i; /* end point */ + } + } + + return m; +} + +/* Constructs the suffix array by using the sorted order of type B* suffixes. */ +static +void +construct_SA(const unsigned char *T, int *SA, + int *bucket_A, int *bucket_B, + int n, int m) { + int *i, *j, *k; + int s; + int c0, c1, c2; + + if(0 < m) { + /* Construct the sorted order of type B suffixes by using + the sorted order of type B* suffixes. */ + for(c1 = ALPHABET_SIZE - 2; 0 <= c1; --c1) { + /* Scan the suffix array from right to left. */ + for(i = SA + BUCKET_BSTAR(c1, c1 + 1), + j = SA + BUCKET_A(c1 + 1) - 1, k = NULL, c2 = -1; + i <= j; + --j) { + if(0 < (s = *j)) { + DIVSUFSORT_ASSERT(T[s] == c1); + DIVSUFSORT_ASSERT(((s + 1) < n) && (T[s] <= T[s + 1])); + DIVSUFSORT_ASSERT(T[s - 1] <= T[s]); + *j = ~s; + c0 = T[--s]; + if((0 < s) && (T[s - 1] > c0)) { s = ~s; } + if(c0 != c2) { + if(0 <= c2) { BUCKET_B(c2, c1) = k - SA; } + k = SA + BUCKET_B(c2 = c0, c1); + } + DIVSUFSORT_ASSERT(k < j); + *k-- = s; + } else { + DIVSUFSORT_ASSERT(((s == 0) && (T[s] == c1)) || (s < 0)); + *j = ~s; + } + } + } + } + + /* Construct the suffix array by using + the sorted order of type B suffixes. */ + k = SA + BUCKET_A(c2 = T[n - 1]); + *k++ = (T[n - 2] < c2) ? ~(n - 1) : (n - 1); + /* Scan the suffix array from left to right. */ + for(i = SA, j = SA + n; i < j; ++i) { + if(0 < (s = *i)) { + DIVSUFSORT_ASSERT(T[s - 1] >= T[s]); + c0 = T[--s]; + if((s == 0) || (T[s - 1] < c0)) { s = ~s; } + if(c0 != c2) { + BUCKET_A(c2) = k - SA; + k = SA + BUCKET_A(c2 = c0); + } + DIVSUFSORT_ASSERT(i < k); + *k++ = s; + } else { + DIVSUFSORT_ASSERT(s < 0); + *i = ~s; + } + } +} + +/*---------------------------------------------------------------------------*/ + +/*- Function -*/ + +/* XXX Modified from original: use provided temporary space instead of + * allocating it. */ +void +divsufsort(const u8 *T, u32 *SA, u32 n, u32 *tmp) +{ + u32 *bucket_A = tmp; + u32 *bucket_B = tmp + BUCKET_A_SIZE; + u32 m; + + switch (n) { + case 0: + break; + + case 1: + SA[0] = 0; + break; + + case 2: + m = (T[0] < T[1]); + SA[m ^ 1] = 0; + SA[m] = 1; + break; + + default: + m = sort_typeBstar(T, SA, bucket_A, bucket_B, n); + construct_SA(T, SA, bucket_A, bucket_B, n, m); + break; + } +} diff --git a/src/wimlib/encoding.c b/src/wimlib/encoding.c new file mode 100644 index 00000000..41917c9d --- /dev/null +++ b/src/wimlib/encoding.c @@ -0,0 +1,483 @@ +/* + * encoding.c - UTF-8 and UTF-16LE codecs and utility functions + * + * Copyright 2012-2023 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <errno.h> +#include <string.h> + +#include "wimlib/encoding.h" +#include "wimlib/endianness.h" +#include "wimlib/error.h" +#include "wimlib/unaligned.h" +#include "wimlib/util.h" + +/* + * Allow unpaired surrogates, such as might exist in Windows-style filenames --- + * which are normally valid UTF-16LE, but are actually treated as opaque + * sequences of 16-bit WCHARs by Windows. When decoding "UTF-16LE", unpaired + * surrogates will be decoded as their surrogate codepoints; and when encoding + * to and from "UTF-8", the encoding will actually be WTF-8 ("Wobbly + * Transformation Format - 8-bit"), a superset of UTF-8 which permits the + * surrogate codepoints. + * + * In combination with also allowing the "non-character" codepoints U+FFFE and + * U+FFFF, the result is that every Windows-style filename can be translated to + * a UNIX-style filename. + * + * Unfortunately, the converse is not true: not every UNIX filename can be + * translated to a Windows filename. Only UNIX filenames that are valid "WTF-8" + * can be translated. I considered ways to define a bijective mapping, but + * there did not seem to be a straightforward way. The "UTF-8b" scheme, for + * example, would map each invalid byte 'b' to a surrogate "escape code" 'U+DC00 + * + b'. The problem with this was that surrogate escape codes can be combined + * to create a valid UTF-8 sequence, thus breaking the bijection by mapping + * multiple Windows filenames to a single UNIX filename. + */ +#define ALLOW_UNPAIRED_SURROGATES 1 + +#define INVALID_CODEPOINT 0xFFFFFFFF +#define VALIDATE(expr) if (validate && unlikely(!(expr))) goto invalid +#define IS_SURROGATE(c) ((c) >= 0xD800 && (c) < 0xE000) +#define IS_HIGH_SURROGATE(c) ((c) >= 0xD800 && (c) < 0xDC00) +#define IS_LOW_SURROGATE(c) ((c) >= 0xDC00 && (c) < 0xE000) +#define IS_UTF8_TAIL(c) (((c) & 0xC0) == 0x80) + +/* + * Decode the next Unicode codepoint from the string at @in, which has + * @remaining >= 1 bytes remaining. Return the number of bytes consumed and + * write the decoded codepoint to *c_ret. + * + * If the input might not be a valid string in the source encoding, then + * @validate must be specified as %true, and then on invalid input the function + * consumes at least one byte and sets *c_ret to INVALID_CODEPOINT. If the + * input is guaranteed to be valid, then @validate may be specified as %false. + */ +typedef unsigned (*decode_codepoint_fn)(const u8 *in, size_t remaining, + bool validate, u32 *c_ret); + +/* Encode the Unicode codepoint @c and return the number of bytes used. */ +typedef unsigned (*encode_codepoint_fn)(u32 c, u8 *out); + +static forceinline unsigned +utf8_decode_codepoint(const u8 *in, size_t remaining, bool validate, u32 *c_ret) +{ + if (likely(in[0] < 0x80)) { /* U+0...U+7F */ + *c_ret = in[0]; + return 1; + } + + if (in[0] < 0xE0) { /* U+80...U+7FF */ + VALIDATE(in[0] >= 0xC2 && remaining >= 2 && + IS_UTF8_TAIL(in[1])); + *c_ret = ((u32)(in[0] & 0x1F) << 6) | + ((u32)(in[1] & 0x3F) << 0); + return 2; + } + + if (in[0] < 0xF0) { /* U+800...U+FFFF, possibly excluding surrogates */ + VALIDATE(remaining >= 3 && + IS_UTF8_TAIL(in[1]) && + IS_UTF8_TAIL(in[2])); + *c_ret = ((u32)(in[0] & 0x0F) << 12) | + ((u32)(in[1] & 0x3F) << 6) | + ((u32)(in[2] & 0x3F) << 0); + VALIDATE(*c_ret >= 0x800); + #if !ALLOW_UNPAIRED_SURROGATES + VALIDATE(!IS_SURROGATE(*c_ret)); + #endif + return 3; + } + + /* U+10000...U+10FFFF */ + VALIDATE(in[0] < 0xF8 && remaining >= 4 && + IS_UTF8_TAIL(in[1]) && + IS_UTF8_TAIL(in[2]) && + IS_UTF8_TAIL(in[3])); + *c_ret = ((u32)(in[0] & 0x07) << 18) | + ((u32)(in[1] & 0x3F) << 12) | + ((u32)(in[2] & 0x3F) << 6) | + ((u32)(in[3] & 0x3F) << 0); + VALIDATE(*c_ret >= 0x10000 && *c_ret <= 0x10FFFF); + return 4; + +invalid: + *c_ret = INVALID_CODEPOINT; + return 1; +} + +static forceinline unsigned +utf8_encode_codepoint(u32 c, u8 *out) +{ + if (likely(c < 0x80)) { + out[0] = c; + return 1; + } + + if (c < 0x800) { + out[0] = 0xC0 | (c >> 6); + out[1] = 0x80 | (c & 0x3F); + return 2; + } + + if (c < 0x10000) { + out[0] = 0xE0 | (c >> 12); + out[1] = 0x80 | ((c >> 6) & 0x3F); + out[2] = 0x80 | (c & 0x3F); + return 3; + } + + out[0] = 0xF0 | (c >> 18); + out[1] = 0x80 | ((c >> 12) & 0x3F); + out[2] = 0x80 | ((c >> 6) & 0x3F); + out[3] = 0x80 | (c & 0x3F); + return 4; +} + +static forceinline unsigned +utf16le_decode_codepoint(const u8 *in, size_t remaining, bool validate, + u32 *c_ret) +{ + u32 h, l; + + VALIDATE(remaining >= 2); + h = get_unaligned_le16(in); + if (unlikely(IS_SURROGATE(h))) { + /* Surrogate pairs are U+10000...U+10FFFF. + * Unpaired surrogates are U+D800...U+DFFF. */ + #if ALLOW_UNPAIRED_SURROGATES + if (unlikely(!IS_HIGH_SURROGATE(h) || remaining < 4)) + goto unpaired; + l = get_unaligned_le16(in + 2); + if (unlikely(!IS_LOW_SURROGATE(l))) + goto unpaired; + #else + VALIDATE(IS_HIGH_SURROGATE(h) && remaining >= 4); + l = get_unaligned_le16(in + 2); + VALIDATE(IS_LOW_SURROGATE(l)); + #endif + *c_ret = 0x10000 + ((h - 0xD800) << 10) + (l - 0xDC00); + return 4; + } +#if ALLOW_UNPAIRED_SURROGATES +unpaired: +#endif + *c_ret = h; + return 2; + +invalid: + *c_ret = INVALID_CODEPOINT; + return min(remaining, 2); +} + +static forceinline unsigned +utf16le_encode_codepoint(u32 c, u8 *out) +{ + if (likely(c < 0x10000)) { + put_unaligned_le16(c, out); + return 2; + } + c -= 0x10000; + put_unaligned_le16(0xD800 + (c >> 10), out); + put_unaligned_le16(0xDC00 + (c & 0x3FF), out + 2); + return 4; +} + +/* + * Convert the string @in of size @in_nbytes from the encoding given by the + * @decode_codepoint function to the encoding given by the @encode_codepoint + * function. @in does not need to be null-terminated, but a null terminator + * will be added to the output string. + * + * On success, write the allocated output string to @out_ret (must not be NULL) + * and its size excluding the null terminator to @out_nbytes_ret (may be NULL). + * + * If the input string is malformed, return @ilseq_err with errno set to EILSEQ. + * If out of memory, return WIMLIB_ERR_NOMEM with errno set to ENOMEM. + */ +static forceinline int +convert_string(const u8 * const in, const size_t in_nbytes, + u8 **out_ret, size_t *out_nbytes_ret, + int ilseq_err, + decode_codepoint_fn decode_codepoint, + encode_codepoint_fn encode_codepoint) +{ + size_t i; + u8 *p_out; + size_t out_nbytes = 0; + u8 *out; + u8 tmp[8]; /* assuming no codepoint requires > 8 bytes to encode */ + u32 c; + + /* Validate the input string and compute the output size. */ + for (i = 0; i < in_nbytes; ) { + i += (*decode_codepoint)(&in[i], in_nbytes - i, true, &c); + if (unlikely(c == INVALID_CODEPOINT)) { + errno = EILSEQ; + return ilseq_err; + } + out_nbytes += (*encode_codepoint)(c, tmp); + } + + /* Allocate the output string, including space for a null terminator. */ + out = MALLOC(out_nbytes + (*encode_codepoint)(0, tmp)); + if (unlikely(!out)) + return WIMLIB_ERR_NOMEM; + + /* Do the conversion. */ + p_out = out; + for (i = 0; i < in_nbytes; ) { + i += (*decode_codepoint)(&in[i], in_nbytes - i, false, &c); + p_out += (*encode_codepoint)(c, p_out); + } + + /* Add a null terminator. */ + (*encode_codepoint)(0, p_out); + + /* Return the output string and its size (by reference). */ + *out_ret = out; + if (out_nbytes_ret) + *out_nbytes_ret = out_nbytes; + return 0; +} + +int +utf8_to_utf16le(const char *in, size_t in_nbytes, + utf16lechar **out_ret, size_t *out_nbytes_ret) +{ + return convert_string((const u8 *)in, in_nbytes, + (u8 **)out_ret, out_nbytes_ret, + WIMLIB_ERR_INVALID_UTF8_STRING, + utf8_decode_codepoint, utf16le_encode_codepoint); +} + +int +utf16le_to_utf8(const utf16lechar *in, size_t in_nbytes, + char **out_ret, size_t *out_nbytes_ret) +{ + return convert_string((const u8 *)in, in_nbytes, + (u8 **)out_ret, out_nbytes_ret, + WIMLIB_ERR_INVALID_UTF16_STRING, + utf16le_decode_codepoint, utf8_encode_codepoint); +} + +/* + * A table that maps from UCS-2 characters to their upper case equivalents. + * Index and array values are both CPU endian. + * Note: this is only an *approximation* of real UTF-16 case folding. + */ +u16 upcase[65536]; + +void +init_upcase(void) +{ + /* This is the table used in NTFS volumes formatted by Windows 10. + * It was compressed by tools/compress_upcase_table.c. */ + static const u16 upcase_compressed[] = { + 0x0000, 0x0000, 0x0060, 0x0000, 0x0000, 0xffe0, 0x0019, 0x0061, + 0x0061, 0x0000, 0x001b, 0x005d, 0x0008, 0x0060, 0x0000, 0x0079, + 0x0000, 0x0000, 0x0000, 0xffff, 0x002f, 0x0100, 0x0002, 0x0000, + 0x0007, 0x012b, 0x0011, 0x0121, 0x002f, 0x0103, 0x0006, 0x0101, + 0x0000, 0x00c3, 0x0006, 0x0131, 0x0007, 0x012e, 0x0004, 0x0000, + 0x0003, 0x012f, 0x0000, 0x0061, 0x0004, 0x0130, 0x0000, 0x00a3, + 0x0003, 0x0000, 0x0000, 0x0082, 0x000b, 0x0131, 0x0006, 0x0189, + 0x0008, 0x012f, 0x0007, 0x012e, 0x0000, 0x0038, 0x0006, 0x0000, + 0x0000, 0xfffe, 0x0007, 0x01c4, 0x000f, 0x0101, 0x0000, 0xffb1, + 0x0015, 0x011e, 0x0004, 0x01cc, 0x002a, 0x0149, 0x0014, 0x0149, + 0x0007, 0x0000, 0x0009, 0x018c, 0x000b, 0x0138, 0x0000, 0x2a1f, + 0x0000, 0x2a1c, 0x0000, 0x0000, 0x0000, 0xff2e, 0x0000, 0xff32, + 0x0000, 0x0000, 0x0000, 0xff33, 0x0000, 0xff33, 0x0000, 0x0000, + 0x0000, 0xff36, 0x0000, 0x0000, 0x0000, 0xff35, 0x0004, 0x0000, + 0x0002, 0x0257, 0x0000, 0x0000, 0x0000, 0xff31, 0x0004, 0x0000, + 0x0000, 0xff2f, 0x0000, 0xff2d, 0x0000, 0x0000, 0x0000, 0x29f7, + 0x0003, 0x0000, 0x0002, 0x0269, 0x0000, 0x29fd, 0x0000, 0xff2b, + 0x0002, 0x0000, 0x0000, 0xff2a, 0x0007, 0x0000, 0x0000, 0x29e7, + 0x0002, 0x0000, 0x0000, 0xff26, 0x0005, 0x027e, 0x0003, 0x027e, + 0x0000, 0xffbb, 0x0000, 0xff27, 0x0000, 0xff27, 0x0000, 0xffb9, + 0x0005, 0x0000, 0x0000, 0xff25, 0x0065, 0x007b, 0x0079, 0x0293, + 0x0008, 0x012d, 0x0003, 0x019c, 0x0002, 0x037b, 0x002e, 0x0000, + 0x0000, 0xffda, 0x0000, 0xffdb, 0x0002, 0x03ad, 0x0012, 0x0060, + 0x000a, 0x0060, 0x0000, 0xffc0, 0x0000, 0xffc1, 0x0000, 0xffc1, + 0x0008, 0x0000, 0x0000, 0xfff8, 0x001a, 0x0118, 0x0000, 0x0007, + 0x0008, 0x018d, 0x0009, 0x0233, 0x0046, 0x0035, 0x0006, 0x0061, + 0x0000, 0xffb0, 0x000f, 0x0450, 0x0025, 0x010e, 0x000a, 0x036b, + 0x0032, 0x048b, 0x000e, 0x0100, 0x0000, 0xfff1, 0x0037, 0x048a, + 0x0026, 0x0465, 0x0034, 0x0000, 0x0000, 0xffd0, 0x0025, 0x0561, + 0x00de, 0x0293, 0x1714, 0x0587, 0x0000, 0x8a04, 0x0003, 0x0000, + 0x0000, 0x0ee6, 0x0087, 0x02ee, 0x0092, 0x1e01, 0x0069, 0x1df7, + 0x0000, 0x0008, 0x0007, 0x1f00, 0x0008, 0x0000, 0x000e, 0x1f02, + 0x0008, 0x1f0e, 0x0010, 0x1f06, 0x001a, 0x1f06, 0x0002, 0x1f0f, + 0x0007, 0x1f50, 0x0017, 0x1f19, 0x0000, 0x004a, 0x0000, 0x004a, + 0x0000, 0x0056, 0x0003, 0x1f72, 0x0000, 0x0064, 0x0000, 0x0064, + 0x0000, 0x0080, 0x0000, 0x0080, 0x0000, 0x0070, 0x0000, 0x0070, + 0x0000, 0x007e, 0x0000, 0x007e, 0x0028, 0x1f1e, 0x000c, 0x1f06, + 0x0000, 0x0000, 0x0000, 0x0009, 0x000f, 0x0000, 0x000d, 0x1fb3, + 0x000d, 0x1f44, 0x0008, 0x1fcd, 0x0006, 0x03f2, 0x0015, 0x1fbb, + 0x014e, 0x0587, 0x0000, 0xffe4, 0x0021, 0x0000, 0x0000, 0xfff0, + 0x000f, 0x2170, 0x000a, 0x0238, 0x0346, 0x0587, 0x0000, 0xffe6, + 0x0019, 0x24d0, 0x0746, 0x0587, 0x0026, 0x0561, 0x000b, 0x057e, + 0x0004, 0x012f, 0x0000, 0xd5d5, 0x0000, 0xd5d8, 0x000c, 0x022e, + 0x000e, 0x03f8, 0x006e, 0x1e33, 0x0011, 0x0000, 0x0000, 0xe3a0, + 0x0025, 0x2d00, 0x17f2, 0x0587, 0x6129, 0x2d26, 0x002e, 0x0201, + 0x002a, 0x1def, 0x0098, 0xa5b7, 0x0040, 0x1dff, 0x000e, 0x0368, + 0x000d, 0x022b, 0x034c, 0x2184, 0x5469, 0x2d26, 0x007f, 0x0061, + 0x0040, 0x0000, + }; + + /* Simple LZ decoder */ + const u16 *in_next = upcase_compressed; + for (u32 i = 0; i < ARRAY_LEN(upcase); ) { + u16 length = *in_next++; + u16 src_pos = *in_next++; + if (length == 0) { + /* Literal */ + upcase[i++] = src_pos; + } else { + /* Match */ + do { + upcase[i++] = upcase[src_pos++]; + } while (--length); + } + } + + /* Delta filter */ + for (u32 i = 0; i < ARRAY_LEN(upcase); i++) + upcase[i] += i; +} + +/* + * Compare UTF-16LE strings case-sensitively (%ignore_case == false) or + * case-insensitively (%ignore_case == true). + * + * This is implemented using the default upper-case table used by NTFS. It does + * not handle all possible cases allowed by UTF-16LE. For example, different + * normalizations of the same sequence of "characters" are not considered equal. + * It hopefully does the right thing most of the time though. + */ +int +cmp_utf16le_strings(const utf16lechar *s1, size_t n1, + const utf16lechar *s2, size_t n2, + bool ignore_case) +{ + size_t n = min(n1, n2); + + if (ignore_case) { + for (size_t i = 0; i < n; i++) { + u16 c1 = upcase[le16_to_cpu(s1[i])]; + u16 c2 = upcase[le16_to_cpu(s2[i])]; + if (c1 != c2) + return (c1 < c2) ? -1 : 1; + } + } else { + for (size_t i = 0; i < n; i++) { + u16 c1 = le16_to_cpu(s1[i]); + u16 c2 = le16_to_cpu(s2[i]); + if (c1 != c2) + return (c1 < c2) ? -1 : 1; + } + } + if (n1 == n2) + return 0; + return (n1 < n2) ? -1 : 1; +} + +/* Like cmp_utf16le_strings(), but assumes the strings are null terminated. */ +int +cmp_utf16le_strings_z(const utf16lechar *s1, const utf16lechar *s2, + bool ignore_case) +{ + if (ignore_case) { + for (;;) { + u16 c1 = upcase[le16_to_cpu(*s1)]; + u16 c2 = upcase[le16_to_cpu(*s2)]; + if (c1 != c2) + return (c1 < c2) ? -1 : 1; + if (c1 == 0) + return 0; + s1++, s2++; + } + } else { + while (*s1 && *s1 == *s2) + s1++, s2++; + if (*s1 == *s2) + return 0; + return (le16_to_cpu(*s1) < le16_to_cpu(*s2)) ? -1 : 1; + } +} + +/* Duplicate a UTF-16 string. The input string might not be null terminated and + * might be misaligned, but the returned string is guaranteed to be null + * terminated and properly aligned. */ +utf16lechar * +utf16le_dupz(const void *s, size_t size) +{ + utf16lechar *dup = MALLOC(size + sizeof(utf16lechar)); + if (dup) { + memcpy(dup, s, size); + dup[size / sizeof(utf16lechar)] = 0; + } + return dup; +} + +/* Duplicate a null-terminated UTF-16 string. */ +utf16lechar * +utf16le_dup(const utf16lechar *s) +{ + return memdup(s, utf16le_len_bytes(s) + sizeof(utf16lechar)); +} + +/* Return the length, in bytes, of a null terminated UTF-16 string, excluding + * the null terminator. */ +size_t +utf16le_len_bytes(const utf16lechar *s) +{ + const utf16lechar *p = s; + while (*p) + p++; + return (p - s) * sizeof(utf16lechar); +} + +/* Return the length, in UTF-16 coding units, of a null terminated UTF-16 + * string, excluding the null terminator. */ +size_t +utf16le_len_chars(const utf16lechar *s) +{ + return utf16le_len_bytes(s) / sizeof(utf16lechar); +} + +#ifdef ENABLE_TEST_SUPPORT + +#include "wimlib/test_support.h" + +WIMLIBAPI int +wimlib_utf8_to_utf16le(const char *in, size_t in_nbytes, + utf16lechar **out_ret, size_t *out_nbytes_ret) +{ + return utf8_to_utf16le(in, in_nbytes, out_ret, out_nbytes_ret); +} + +WIMLIBAPI int +wimlib_utf16le_to_utf8(const utf16lechar *in, size_t in_nbytes, + char **out_ret, size_t *out_nbytes_ret) +{ + return utf16le_to_utf8(in, in_nbytes, out_ret, out_nbytes_ret); +} +#endif /* ENABLE_TEST_SUPPORT */ diff --git a/src/wimlib/error.c b/src/wimlib/error.c new file mode 100644 index 00000000..ff3d00bb --- /dev/null +++ b/src/wimlib/error.c @@ -0,0 +1,349 @@ +/* + * error.c - logging and error code translation + */ + +/* + * Copyright (C) 2012, 2013, 2014 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +/* Make sure the POSIX-compatible strerror_r() is declared, rather than the GNU + * version, which has a different return type. */ +#ifdef _GNU_SOURCE +# define GNU_SOURCE_WAS_DEFINED +# undef _GNU_SOURCE +# ifndef _POSIX_C_SOURCE +# define _POSIX_C_SOURCE 200112L +# endif +#endif +#include <string.h> +#ifdef GNU_SOURCE_WAS_DEFINED +# define _GNU_SOURCE +#endif + +#include <errno.h> +#include <stdarg.h> + +#include "wimlib.h" +#include "wimlib/error.h" +#include "wimlib/test_support.h" +#include "wimlib/util.h" +#include "wimlib/win32.h" + +bool wimlib_print_errors = false; +FILE *wimlib_error_file = NULL; /* Set in wimlib_global_init() */ +static bool wimlib_owns_error_file = false; + +static void +wimlib_vmsg(const tchar *tag, const tchar *format, va_list va, bool perror) +{ + if (!wimlib_print_errors) + return; + int errno_save = errno; + fflush(stdout); + tfputs(tag, wimlib_error_file); + tvfprintf(wimlib_error_file, format, va); + if (perror && errno_save != 0) { + tchar buf[64]; + int res; + res = tstrerror_r(errno_save, buf, ARRAY_LEN(buf)); + if (res) { + tsprintf(buf, + T("unknown error (errno=%d)"), + errno_save); + } + #ifdef _WIN32 + if (errno_save == EBUSY) + tstrcpy(buf, T("Resource busy")); + #endif + tfprintf(wimlib_error_file, T(": %"TS), buf); + } + tputc(T('\n'), wimlib_error_file); + fflush(wimlib_error_file); + errno = errno_save; +} + +void +wimlib_error(const tchar *format, ...) +{ + va_list va; + + va_start(va, format); + wimlib_vmsg(T("\r[ERROR] "), format, va, false); + va_end(va); +} + +void +wimlib_error_with_errno(const tchar *format, ...) +{ + va_list va; + + va_start(va, format); + wimlib_vmsg(T("\r[ERROR] "), format, va, true); + va_end(va); +} + +void +wimlib_warning(const tchar *format, ...) +{ + va_list va; + + va_start(va, format); + wimlib_vmsg(T("\r[WARNING] "), format, va, false); + va_end(va); +} + +void +wimlib_warning_with_errno(const tchar *format, ...) +{ + va_list va; + + va_start(va, format); + wimlib_vmsg(T("\r[WARNING] "), format, va, true); + va_end(va); +} + +void +print_byte_field(const u8 *field, size_t len, FILE *out) +{ + while (len--) + tfprintf(out, T("%02hhx"), *field++); +} + +WIMLIBAPI int +wimlib_set_print_errors(bool show_error_messages) +{ + wimlib_print_errors = show_error_messages; + return 0; +} + +WIMLIBAPI int +wimlib_set_error_file(FILE *fp) +{ + if (wimlib_owns_error_file) + fclose(wimlib_error_file); + wimlib_error_file = fp; + wimlib_print_errors = (fp != NULL); + wimlib_owns_error_file = false; + return 0; +} + +WIMLIBAPI int +wimlib_set_error_file_by_name(const tchar *path) +{ + FILE *fp; + +#ifdef _WIN32 + fp = win32_open_logfile(path); +#else + fp = fopen(path, "a"); +#endif + if (!fp) + return WIMLIB_ERR_OPEN; + wimlib_set_error_file(fp); + wimlib_owns_error_file = true; + return 0; +} + +static const tchar * const error_strings[] = { + [WIMLIB_ERR_SUCCESS] + = T("Success"), + [WIMLIB_ERR_ALREADY_LOCKED] + = T("The WIM is already locked for writing"), + [WIMLIB_ERR_DECOMPRESSION] + = T("The WIM contains invalid compressed data"), + [WIMLIB_ERR_FUSE] + = T("An error was returned by fuse_main()"), + [WIMLIB_ERR_GLOB_HAD_NO_MATCHES] + = T("The provided file glob did not match any files"), + [WIMLIB_ERR_IMAGE_COUNT] + = T("Inconsistent image count among the metadata " + "resources, the WIM header, and/or the XML data"), + [WIMLIB_ERR_IMAGE_NAME_COLLISION] + = T("Tried to add an image with a name that is already in use"), + [WIMLIB_ERR_INSUFFICIENT_PRIVILEGES] + = T("The user does not have sufficient privileges"), + [WIMLIB_ERR_INTEGRITY] + = T("The WIM file is corrupted (failed integrity check)"), + [WIMLIB_ERR_INVALID_CAPTURE_CONFIG] + = T("The contents of the capture configuration file were invalid"), + [WIMLIB_ERR_INVALID_CHUNK_SIZE] + = T("The compression chunk size was unrecognized"), + [WIMLIB_ERR_INVALID_COMPRESSION_TYPE] + = T("The compression type was unrecognized"), + [WIMLIB_ERR_INVALID_HEADER] + = T("The WIM header was invalid"), + [WIMLIB_ERR_INVALID_IMAGE] + = T("Tried to select an image that does not exist in the WIM"), + [WIMLIB_ERR_INVALID_INTEGRITY_TABLE] + = T("The WIM's integrity table is invalid"), + [WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY] + = T("An entry in the WIM's lookup table is invalid"), + [WIMLIB_ERR_INVALID_METADATA_RESOURCE] + = T("The metadata resource is invalid"), + [WIMLIB_ERR_INVALID_OVERLAY] + = T("Conflicting files in overlay when creating a WIM image"), + [WIMLIB_ERR_INVALID_PARAM] + = T("An invalid parameter was given"), + [WIMLIB_ERR_INVALID_PART_NUMBER] + = T("The part number or total parts of the WIM is invalid"), + [WIMLIB_ERR_INVALID_PIPABLE_WIM] + = T("The pipable WIM is invalid"), + [WIMLIB_ERR_INVALID_REPARSE_DATA] + = T("The reparse data of a reparse point was invalid"), + [WIMLIB_ERR_INVALID_RESOURCE_HASH] + = T("The SHA-1 message digest of a WIM resource did not match the expected value"), + [WIMLIB_ERR_INVALID_UTF8_STRING] + = T("A string was not a valid UTF-8 string"), + [WIMLIB_ERR_INVALID_UTF16_STRING] + = T("A string was not a valid UTF-16 string"), + [WIMLIB_ERR_IS_DIRECTORY] + = T("One of the specified paths to delete was a directory"), + [WIMLIB_ERR_IS_SPLIT_WIM] + = T("The WIM is part of a split WIM, which is not supported for this operation"), + [WIMLIB_ERR_LINK] + = T("Failed to create a hard or symbolic link when extracting " + "a file from the WIM"), + [WIMLIB_ERR_METADATA_NOT_FOUND] + = T("The WIM does not contain image metadata; it only contains file data"), + [WIMLIB_ERR_MKDIR] + = T("Failed to create a directory"), + [WIMLIB_ERR_MQUEUE] + = T("Failed to create or use a POSIX message queue"), + [WIMLIB_ERR_NOMEM] + = T("Ran out of memory"), + [WIMLIB_ERR_NOTDIR] + = T("Expected a directory"), + [WIMLIB_ERR_NOTEMPTY] + = T("Directory was not empty"), + [WIMLIB_ERR_NOT_A_REGULAR_FILE] + = T("One of the specified paths to extract did not " + "correspond to a regular file"), + [WIMLIB_ERR_NOT_A_WIM_FILE] + = T("The file did not begin with the magic characters that " + "identify a WIM file"), + [WIMLIB_ERR_NO_FILENAME] + = T("The WIM is not identified with a filename"), + [WIMLIB_ERR_NOT_PIPABLE] + = T("The WIM was not captured such that it can be " + "applied from a pipe"), + [WIMLIB_ERR_NTFS_3G] + = T("NTFS-3G encountered an error (check errno)"), + [WIMLIB_ERR_OPEN] + = T("Failed to open a file"), + [WIMLIB_ERR_OPENDIR] + = T("Failed to open a directory"), + [WIMLIB_ERR_PATH_DOES_NOT_EXIST] + = T("The path does not exist in the WIM image"), + [WIMLIB_ERR_READ] + = T("Could not read data from a file"), + [WIMLIB_ERR_READLINK] + = T("Could not read the target of a symbolic link"), + [WIMLIB_ERR_RENAME] + = T("Could not rename a file"), + [WIMLIB_ERR_REPARSE_POINT_FIXUP_FAILED] + = T("Unable to complete reparse point fixup"), + [WIMLIB_ERR_RESOURCE_NOT_FOUND] + = T("A file resource needed to complete the operation was missing from the WIM"), + [WIMLIB_ERR_RESOURCE_ORDER] + = T("The components of the WIM were arranged in an unexpected order"), + [WIMLIB_ERR_SET_ATTRIBUTES] + = T("Failed to set attributes on extracted file"), + [WIMLIB_ERR_SET_REPARSE_DATA] + = T("Failed to set reparse data on extracted file"), + [WIMLIB_ERR_SET_SECURITY] + = T("Failed to set file owner, group, or other permissions on extracted file"), + [WIMLIB_ERR_SET_SHORT_NAME] + = T("Failed to set short name on extracted file"), + [WIMLIB_ERR_SET_TIMESTAMPS] + = T("Failed to set timestamps on extracted file"), + [WIMLIB_ERR_SPLIT_INVALID] + = T("The WIM is part of an invalid split WIM"), + [WIMLIB_ERR_STAT] + = T("Could not read the metadata for a file or directory"), + [WIMLIB_ERR_UNEXPECTED_END_OF_FILE] + = T("Unexpectedly reached the end of the file"), + [WIMLIB_ERR_UNICODE_STRING_NOT_REPRESENTABLE] + = T("A Unicode string could not be represented in the current locale's encoding"), + [WIMLIB_ERR_UNKNOWN_VERSION] + = T("The WIM file is marked with an unknown version number"), + [WIMLIB_ERR_UNSUPPORTED] + = T("The requested operation is unsupported"), + [WIMLIB_ERR_UNSUPPORTED_FILE] + = T("A file in the directory tree to archive was not of a supported type"), + [WIMLIB_ERR_WIM_IS_READONLY] + = T("The WIM is read-only (file permissions, header flag, or split WIM)"), + [WIMLIB_ERR_WRITE] + = T("Failed to write data to a file"), + [WIMLIB_ERR_XML] + = T("The XML data of the WIM is invalid"), + [WIMLIB_ERR_WIM_IS_ENCRYPTED] + = T("The WIM file (or parts of it) is encrypted"), + [WIMLIB_ERR_WIMBOOT] + = T("Failed to set WIMBoot pointer data"), + [WIMLIB_ERR_ABORTED_BY_PROGRESS] + = T("The operation was aborted by the library user"), + [WIMLIB_ERR_UNKNOWN_PROGRESS_STATUS] + = T("The user-provided progress function returned an unrecognized value"), + [WIMLIB_ERR_MKNOD] + = T("Unable to create a special file (e.g. device node or socket)"), + [WIMLIB_ERR_MOUNTED_IMAGE_IS_BUSY] + = T("There are still files open on the mounted WIM image"), + [WIMLIB_ERR_NOT_A_MOUNTPOINT] + = T("There is not a WIM image mounted on the directory"), + [WIMLIB_ERR_NOT_PERMITTED_TO_UNMOUNT] + = T("The current user does not have permission to unmount the WIM image"), + [WIMLIB_ERR_FVE_LOCKED_VOLUME] + = T("The volume must be unlocked before it can be used"), + [WIMLIB_ERR_UNABLE_TO_READ_CAPTURE_CONFIG] + = T("The capture configuration file could not be read"), + [WIMLIB_ERR_WIM_IS_INCOMPLETE] + = T("The WIM file is incomplete"), + [WIMLIB_ERR_COMPACTION_NOT_POSSIBLE] + = T("The WIM file cannot be compacted because of its format, " + "its layout, or the write parameters specified by the user"), + [WIMLIB_ERR_IMAGE_HAS_MULTIPLE_REFERENCES] + = T("The WIM image cannot be modified because it is currently " + "referenced from multiple places"), + [WIMLIB_ERR_DUPLICATE_EXPORTED_IMAGE] + = T("The destination WIM already contains one of the source images"), + [WIMLIB_ERR_CONCURRENT_MODIFICATION_DETECTED] + = T("A file being added to a WIM image was concurrently modified"), + [WIMLIB_ERR_SNAPSHOT_FAILURE] + = T("Unable to create a filesystem snapshot"), + [WIMLIB_ERR_INVALID_XATTR] + = T("An extended attribute entry in the WIM image is invalid"), + [WIMLIB_ERR_SET_XATTR] + = T("Failed to set an extended attribute on an extracted file"), +#ifdef ENABLE_TEST_SUPPORT + [WIMLIB_ERR_IMAGES_ARE_DIFFERENT] + = T("A difference was detected between the two images being compared"), +#endif +}; + +WIMLIBAPI const tchar * +wimlib_get_error_string(enum wimlib_error_code _code) +{ + unsigned int code = (unsigned int)_code; + + if (code >= ARRAY_LEN(error_strings) || error_strings[code] == NULL) + return T("Unknown error"); + + return error_strings[code]; +} diff --git a/src/wimlib/export_image.c b/src/wimlib/export_image.c new file mode 100644 index 00000000..1dff266d --- /dev/null +++ b/src/wimlib/export_image.c @@ -0,0 +1,295 @@ +/* + * export_image.c + */ + +/* + * Copyright (C) 2012-2016 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib.h" +#include "wimlib/blob_table.h" +#include "wimlib/error.h" +#include "wimlib/inode.h" +#include "wimlib/metadata.h" +#include "wimlib/xml.h" + +static int +blob_set_not_exported(struct blob_descriptor *blob, void *_ignore) +{ + blob->out_refcnt = 0; + blob->was_exported = 0; + return 0; +} + +static int +blob_rollback_export(struct blob_descriptor *blob, void *_blob_table) +{ + struct blob_table *blob_table = _blob_table; + + blob->refcnt -= blob->out_refcnt; + if (blob->was_exported) { + blob_table_unlink(blob_table, blob); + free_blob_descriptor(blob); + } + return 0; +} + +static int +inode_export_blobs(struct wim_inode *inode, struct blob_table *src_blob_table, + struct blob_table *dest_blob_table, bool gift) +{ + unsigned i; + const u8 *hash; + struct blob_descriptor *src_blob, *dest_blob; + + for (i = 0; i < inode->i_num_streams; i++) { + + /* Retrieve SHA-1 message digest of blob to export. */ + hash = stream_hash(&inode->i_streams[i]); + if (is_zero_hash(hash)) /* Empty stream? */ + continue; + + /* Search for the blob (via SHA-1 message digest) in the + * destination WIM. */ + dest_blob = lookup_blob(dest_blob_table, hash); + if (!dest_blob) { + /* Blob not yet present in destination WIM. Search for + * it in the source WIM, then export it into the + * destination WIM. */ + src_blob = stream_blob(&inode->i_streams[i], + src_blob_table); + if (!src_blob) + return blob_not_found_error(inode, hash); + + if (gift) { + dest_blob = src_blob; + blob_table_unlink(src_blob_table, src_blob); + } else { + dest_blob = clone_blob_descriptor(src_blob); + if (!dest_blob) + return WIMLIB_ERR_NOMEM; + } + dest_blob->refcnt = 0; + dest_blob->out_refcnt = 0; + dest_blob->was_exported = 1; + blob_table_insert(dest_blob_table, dest_blob); + } + + /* Blob is present in destination WIM (either pre-existing, + * already exported, or just exported above). Increment its + * reference count appropriately. Note: we use 'refcnt' for + * the raw reference count, but 'out_refcnt' for references + * arising just from the export operation; this is used to roll + * back a failed export if needed. */ + dest_blob->refcnt += inode->i_nlink; + dest_blob->out_refcnt += inode->i_nlink; + } + return 0; +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_export_image(WIMStruct *src_wim, + int src_image, + WIMStruct *dest_wim, + const tchar *dest_name, + const tchar *dest_description, + int export_flags) +{ + int ret; + int start_src_image; + int end_src_image; + int orig_dest_image_count; + int image; + bool all_images = (src_image == WIMLIB_ALL_IMAGES); + + /* Check for sane parameters. */ + if (export_flags & ~(WIMLIB_EXPORT_FLAG_BOOT | + WIMLIB_EXPORT_FLAG_NO_NAMES | + WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS | + WIMLIB_EXPORT_FLAG_GIFT | + WIMLIB_EXPORT_FLAG_WIMBOOT)) + return WIMLIB_ERR_INVALID_PARAM; + + if (!src_wim || !dest_wim) + return WIMLIB_ERR_INVALID_PARAM; + + if (!wim_has_metadata(src_wim) || !wim_has_metadata(dest_wim)) + return WIMLIB_ERR_METADATA_NOT_FOUND; + + if (all_images) { + /* Multi-image export. */ + if ((!(export_flags & WIMLIB_EXPORT_FLAG_NO_NAMES) && + dest_name) || + (!(export_flags & WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS) && + dest_description)) + { + ERROR("Image name and description must be " + "left NULL for multi-image export"); + return WIMLIB_ERR_INVALID_PARAM; + } + start_src_image = 1; + end_src_image = src_wim->hdr.image_count; + } else { + start_src_image = src_image; + end_src_image = src_image; + } + orig_dest_image_count = dest_wim->hdr.image_count; + + /* We don't yet support having a single WIMStruct contain duplicate + * 'image_metadata' structures, so we must forbid this from happening. + * A duplication is possible if 'src_wim == dest_wim', if the same image + * is exported to the same destination WIMStruct multiple times, or if + * an image is exported in an A => B => A manner. */ + for (src_image = start_src_image; + src_image <= end_src_image; src_image++) + { + const struct wim_image_metadata *src_imd = + src_wim->image_metadata[src_image - 1]; + for (int i = 0; i < dest_wim->hdr.image_count; i++) + if (dest_wim->image_metadata[i] == src_imd) + return WIMLIB_ERR_DUPLICATE_EXPORTED_IMAGE; + } + + /* Blob checksums must be known before proceeding. */ + ret = wim_checksum_unhashed_blobs(src_wim); + if (ret) + return ret; + ret = wim_checksum_unhashed_blobs(dest_wim); + if (ret) + return ret; + + /* Enable rollbacks */ + for_blob_in_table(dest_wim->blob_table, blob_set_not_exported, NULL); + + /* Forbid exports where the destination WIM already contains image(s) + * with the requested name(s). However, allow multi-image exports where + * there is a duplication among the source names only. */ + if (!(export_flags & WIMLIB_EXPORT_FLAG_NO_NAMES)) { + for (src_image = start_src_image; + src_image <= end_src_image; + src_image++) + { + const tchar *name = dest_name ? dest_name : + wimlib_get_image_name(src_wim, src_image); + + if (wimlib_image_name_in_use(dest_wim, name)) { + ERROR("There is already an image named \"%"TS"\" " + "in the destination WIM", name); + ret = WIMLIB_ERR_IMAGE_NAME_COLLISION; + goto out_rollback; + } + } + } + + /* Export each requested image. */ + for (src_image = start_src_image; + src_image <= end_src_image; + src_image++) + { + const tchar *next_dest_name, *next_dest_description; + struct wim_image_metadata *src_imd; + struct wim_inode *inode; + + /* Determine destination image name and description. */ + + if (export_flags & WIMLIB_EXPORT_FLAG_NO_NAMES) + next_dest_name = NULL; + else if (dest_name) + next_dest_name = dest_name; + else + next_dest_name = wimlib_get_image_name(src_wim, src_image); + + if (export_flags & WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS) + next_dest_description = NULL; + else if (dest_description) + next_dest_description = dest_description; + else + next_dest_description = wimlib_get_image_description(src_wim, src_image); + + /* Load metadata for source image into memory. */ + ret = select_wim_image(src_wim, src_image); + if (ret) + goto out_rollback; + + src_imd = wim_get_current_image_metadata(src_wim); + + /* Iterate through inodes in the source image and export their + * blobs into the destination WIM. */ + image_for_each_inode(inode, src_imd) { + ret = inode_export_blobs(inode, + src_wim->blob_table, + dest_wim->blob_table, + export_flags & WIMLIB_EXPORT_FLAG_GIFT); + if (ret) + goto out_rollback; + } + + /* Export XML information into the destination WIM. */ + ret = xml_export_image(src_wim->xml_info, src_image, + dest_wim->xml_info, next_dest_name, + next_dest_description, + export_flags & WIMLIB_EXPORT_FLAG_WIMBOOT); + if (ret) + goto out_rollback; + + /* Reference the source image metadata from the destination WIM. + */ + ret = append_image_metadata(dest_wim, src_imd); + if (ret) + goto out_rollback; + src_imd->refcnt++; + } + + /* Image export complete. Finish by setting any needed special metadata + * on the destination WIM. */ + + if (src_wim->hdr.flags & WIM_HDR_FLAG_RP_FIX) + dest_wim->hdr.flags |= WIM_HDR_FLAG_RP_FIX; + + for (src_image = start_src_image; + src_image <= end_src_image; + src_image++) + { + int dst_image = orig_dest_image_count + 1 + + (src_image - start_src_image); + + if ((export_flags & WIMLIB_EXPORT_FLAG_BOOT) && + (!all_images || src_image == src_wim->hdr.boot_idx)) + dest_wim->hdr.boot_idx = dst_image; + } + + return 0; + +out_rollback: + while ((image = xml_get_image_count(dest_wim->xml_info)) + > orig_dest_image_count) + { + xml_delete_image(dest_wim->xml_info, image); + } + while (dest_wim->hdr.image_count > orig_dest_image_count) + { + put_image_metadata(dest_wim->image_metadata[ + --dest_wim->hdr.image_count]); + } + for_blob_in_table(dest_wim->blob_table, blob_rollback_export, + dest_wim->blob_table); + return ret; +} diff --git a/src/wimlib/extract.c b/src/wimlib/extract.c new file mode 100644 index 00000000..24b53cbe --- /dev/null +++ b/src/wimlib/extract.c @@ -0,0 +1,2120 @@ +/* + * extract.c + * + * Support for extracting WIM images, or files or directories contained in a WIM + * image. + */ + +/* + * Copyright (C) 2012-2018 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +/* + * This file provides the API functions wimlib_extract_image(), + * wimlib_extract_image_from_pipe(), wimlib_extract_paths(), and + * wimlib_extract_pathlist(). Internally, all end up calling + * do_wimlib_extract_paths() and extract_trees(). + * + * Although wimlib supports multiple extraction modes/backends (NTFS-3G, UNIX, + * Win32), this file does not itself have code to extract files or directories + * to any specific target; instead, it handles generic functionality and relies + * on lower-level callback functions declared in `struct apply_operations' to do + * the actual extraction. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <errno.h> +#include <fcntl.h> +#include <stdlib.h> +#include <sys/stat.h> +#include <unistd.h> + +#include "wimlib/apply.h" +#include "wimlib/assert.h" +#include "wimlib/blob_table.h" +#include "wimlib/dentry.h" +#include "wimlib/encoding.h" +#include "wimlib/endianness.h" +#include "wimlib/error.h" +#include "wimlib/metadata.h" +#include "wimlib/object_id.h" +#include "wimlib/pathlist.h" +#include "wimlib/paths.h" +#include "wimlib/pattern.h" +#include "wimlib/reparse.h" +#include "wimlib/resource.h" +#include "wimlib/security.h" +#include "wimlib/unix_data.h" +#include "wimlib/wim.h" +#include "wimlib/win32.h" /* for realpath() equivalent */ +#include "wimlib/xattr.h" +#include "wimlib/xml.h" + +#define WIMLIB_EXTRACT_FLAG_FROM_PIPE 0x80000000 +#define WIMLIB_EXTRACT_FLAG_IMAGEMODE 0x40000000 + +/* Keep in sync with wimlib.h */ +#define WIMLIB_EXTRACT_MASK_PUBLIC \ + (WIMLIB_EXTRACT_FLAG_NTFS | \ + WIMLIB_EXTRACT_FLAG_RECOVER_DATA | \ + WIMLIB_EXTRACT_FLAG_UNIX_DATA | \ + WIMLIB_EXTRACT_FLAG_NO_ACLS | \ + WIMLIB_EXTRACT_FLAG_STRICT_ACLS | \ + WIMLIB_EXTRACT_FLAG_RPFIX | \ + WIMLIB_EXTRACT_FLAG_NORPFIX | \ + WIMLIB_EXTRACT_FLAG_TO_STDOUT | \ + WIMLIB_EXTRACT_FLAG_REPLACE_INVALID_FILENAMES | \ + WIMLIB_EXTRACT_FLAG_ALL_CASE_CONFLICTS | \ + WIMLIB_EXTRACT_FLAG_STRICT_TIMESTAMPS | \ + WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES | \ + WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS | \ + WIMLIB_EXTRACT_FLAG_GLOB_PATHS | \ + WIMLIB_EXTRACT_FLAG_STRICT_GLOB | \ + WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES | \ + WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE | \ + WIMLIB_EXTRACT_FLAG_WIMBOOT | \ + WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K | \ + WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K | \ + WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K | \ + WIMLIB_EXTRACT_FLAG_COMPACT_LZX \ + ) + +/* Send WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE or + * WIMLIB_PROGRESS_MSG_EXTRACT_METADATA. */ +int +do_file_extract_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg) +{ + ctx->count_until_file_progress = 500; /* Arbitrary value to limit calls */ + return extract_progress(ctx, msg); +} + +static int +start_file_phase(struct apply_ctx *ctx, u64 end_file_count, enum wimlib_progress_msg msg) +{ + ctx->progress.extract.current_file_count = 0; + ctx->progress.extract.end_file_count = end_file_count; + return do_file_extract_progress(ctx, msg); +} + +int +start_file_structure_phase(struct apply_ctx *ctx, u64 end_file_count) +{ + return start_file_phase(ctx, end_file_count, WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE); +} + +int +start_file_metadata_phase(struct apply_ctx *ctx, u64 end_file_count) +{ + return start_file_phase(ctx, end_file_count, WIMLIB_PROGRESS_MSG_EXTRACT_METADATA); +} + +static int +end_file_phase(struct apply_ctx *ctx, enum wimlib_progress_msg msg) +{ + ctx->progress.extract.current_file_count = ctx->progress.extract.end_file_count; + return do_file_extract_progress(ctx, msg); +} + +int +end_file_structure_phase(struct apply_ctx *ctx) +{ + return end_file_phase(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE); +} + +int +end_file_metadata_phase(struct apply_ctx *ctx) +{ + return end_file_phase(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_METADATA); +} + +/* Are all bytes in the specified buffer zero? */ +static bool +is_all_zeroes(const u8 *p, const size_t size) +{ + const u8 * const end = p + size; + + for (; (uintptr_t)p % WORDBYTES && p != end; p++) + if (*p) + return false; + + for (; end - p >= WORDBYTES; p += WORDBYTES) + if (*(const machine_word_t *)p) + return false; + + for (; p != end; p++) + if (*p) + return false; + + return true; +} + +/* + * Sparse regions should be detected at the granularity of the filesystem block + * size. For now just assume 4096 bytes, which is the default block size on + * NTFS and most Linux filesystems. + */ +#define SPARSE_UNIT 4096 + +/* + * Detect whether the specified buffer begins with a region of all zero bytes. + * Return %true if a zero region was found or %false if a nonzero region was + * found, and sets *len_ret to the length of the region. This operates at a + * granularity of SPARSE_UNIT bytes, meaning that to extend a zero region, there + * must be SPARSE_UNIT zero bytes with no interruption, but to extend a nonzero + * region, just one nonzero byte in the next SPARSE_UNIT bytes is sufficient. + * + * Note: besides compression, the WIM format doesn't yet have a way to + * efficiently represent zero regions, so that's why we need to detect them + * ourselves. Things will still fall apart badly on extremely large sparse + * files, but this is a start... + */ +bool +detect_sparse_region(const void *data, size_t size, size_t *len_ret) +{ + const void *p = data; + const void * const end = data + size; + size_t len = 0; + bool zeroes = false; + + while (p != end) { + size_t n = min(end - p, SPARSE_UNIT); + bool z = is_all_zeroes(p, n); + + if (len != 0 && z != zeroes) + break; + zeroes = z; + len += n; + p += n; + } + + *len_ret = len; + return zeroes; +} + +#define PWM_FOUND_WIM_HDR (-1) + +/* Read the header for a blob in a pipable WIM. If @pwm_hdr_ret is not NULL, + * also look for a pipable WIM header and return PWM_FOUND_WIM_HDR if found. */ +static int +read_pwm_blob_header(WIMStruct *pwm, u8 hash_ret[SHA1_HASH_SIZE], + struct wim_reshdr *reshdr_ret, + struct wim_header_disk *pwm_hdr_ret) +{ + int ret; + struct pwm_blob_hdr blob_hdr; + u64 magic; + + ret = full_read(&pwm->in_fd, &blob_hdr, sizeof(blob_hdr)); + if (unlikely(ret)) + goto read_error; + + magic = le64_to_cpu(blob_hdr.magic); + + if (magic == PWM_MAGIC && pwm_hdr_ret != NULL) { + memcpy(pwm_hdr_ret, &blob_hdr, sizeof(blob_hdr)); + ret = full_read(&pwm->in_fd, + (u8 *)pwm_hdr_ret + sizeof(blob_hdr), + sizeof(*pwm_hdr_ret) - sizeof(blob_hdr)); + if (unlikely(ret)) + goto read_error; + return PWM_FOUND_WIM_HDR; + } + + if (unlikely(magic != PWM_BLOB_MAGIC)) { + ERROR("Data read on pipe is invalid (expected blob header)"); + return WIMLIB_ERR_INVALID_PIPABLE_WIM; + } + + copy_hash(hash_ret, blob_hdr.hash); + + reshdr_ret->size_in_wim = 0; /* Not available */ + reshdr_ret->flags = le32_to_cpu(blob_hdr.flags); + reshdr_ret->offset_in_wim = pwm->in_fd.offset; + reshdr_ret->uncompressed_size = le64_to_cpu(blob_hdr.uncompressed_size); + + if (unlikely(reshdr_ret->uncompressed_size == 0)) { + ERROR("Data read on pipe is invalid (resource is of 0 size)"); + return WIMLIB_ERR_INVALID_PIPABLE_WIM; + } + + return 0; + +read_error: + if (ret == WIMLIB_ERR_UNEXPECTED_END_OF_FILE) + ERROR("The pipe ended before all needed data was sent!"); + else + ERROR_WITH_ERRNO("Error reading pipable WIM from pipe"); + return ret; +} + +static int +read_blobs_from_pipe(struct apply_ctx *ctx, const struct read_blob_callbacks *cbs) +{ + int ret; + u8 hash[SHA1_HASH_SIZE]; + struct wim_reshdr reshdr; + struct wim_header_disk pwm_hdr; + struct wim_resource_descriptor rdesc; + struct blob_descriptor *blob; + + copy_guid(ctx->progress.extract.guid, ctx->wim->hdr.guid); + ctx->progress.extract.part_number = ctx->wim->hdr.part_number; + ctx->progress.extract.total_parts = ctx->wim->hdr.total_parts; + ret = extract_progress(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN); + if (ret) + return ret; + + while (ctx->num_blobs_remaining) { + + ret = read_pwm_blob_header(ctx->wim, hash, &reshdr, &pwm_hdr); + + if (ret == PWM_FOUND_WIM_HDR) { + u16 part_number = le16_to_cpu(pwm_hdr.part_number); + u16 total_parts = le16_to_cpu(pwm_hdr.total_parts); + + if (part_number == ctx->progress.extract.part_number && + total_parts == ctx->progress.extract.total_parts && + guids_equal(pwm_hdr.guid, ctx->progress.extract.guid)) + continue; + + copy_guid(ctx->progress.extract.guid, pwm_hdr.guid); + ctx->progress.extract.part_number = part_number; + ctx->progress.extract.total_parts = total_parts; + ret = extract_progress(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN); + if (ret) + return ret; + + continue; + } + + if (ret) + return ret; + + if (!(reshdr.flags & WIM_RESHDR_FLAG_METADATA) + && (blob = lookup_blob(ctx->wim->blob_table, hash)) + && (blob->out_refcnt)) + { + wim_reshdr_to_desc_and_blob(&reshdr, ctx->wim, &rdesc, blob); + ret = read_blob_with_sha1(blob, cbs, + ctx->extract_flags & + WIMLIB_EXTRACT_FLAG_RECOVER_DATA); + blob_unset_is_located_in_wim_resource(blob); + if (ret) + return ret; + ctx->num_blobs_remaining--; + } else { + wim_reshdr_to_desc(&reshdr, ctx->wim, &rdesc); + ret = skip_wim_resource(&rdesc); + if (ret) + return ret; + } + } + + return 0; +} + +static int +handle_pwm_metadata_resource(WIMStruct *pwm, int image, bool is_needed) +{ + struct blob_descriptor *blob; + struct wim_reshdr reshdr; + struct wim_resource_descriptor *rdesc; + int ret; + + ret = WIMLIB_ERR_NOMEM; + blob = new_blob_descriptor(); + if (!blob) + goto out; + + ret = read_pwm_blob_header(pwm, blob->hash, &reshdr, NULL); + if (ret) + goto out; + + ret = WIMLIB_ERR_INVALID_PIPABLE_WIM; + if (!(reshdr.flags & WIM_RESHDR_FLAG_METADATA)) { + ERROR("Expected metadata resource, but found non-metadata " + "resource"); + goto out; + } + + ret = WIMLIB_ERR_NOMEM; + rdesc = MALLOC(sizeof(*rdesc)); + if (!rdesc) + goto out; + + wim_reshdr_to_desc_and_blob(&reshdr, pwm, rdesc, blob); + pwm->refcnt++; + + ret = WIMLIB_ERR_NOMEM; + pwm->image_metadata[image - 1] = new_unloaded_image_metadata(blob); + if (!pwm->image_metadata[image - 1]) + goto out; + blob = NULL; + + /* If the metadata resource is for the image being extracted, then parse + * it and save the metadata in memory. Otherwise, skip over it. */ + if (is_needed) + ret = select_wim_image(pwm, image); + else + ret = skip_wim_resource(rdesc); +out: + free_blob_descriptor(blob); + return ret; +} + +/* Creates a temporary file opened for writing. The open file descriptor is + * returned in @fd_ret and its name is returned in @name_ret (dynamically + * allocated). */ +static int +create_temporary_file(struct filedes *fd_ret, tchar **name_ret) +{ + tchar *name; + int raw_fd; + +#ifdef _WIN32 +retry: + name = _wtempnam(NULL, L"wimlib"); + if (!name) { + ERROR_WITH_ERRNO("Failed to create temporary filename"); + return WIMLIB_ERR_NOMEM; + } + raw_fd = _wopen(name, O_WRONLY | O_CREAT | O_EXCL | O_BINARY | + _O_SHORT_LIVED, 0600); + if (raw_fd < 0 && errno == EEXIST) { + FREE(name); + goto retry; + } +#else /* _WIN32 */ + const char *tmpdir = getenv("TMPDIR"); + if (!tmpdir) + tmpdir = P_tmpdir; + name = MALLOC(strlen(tmpdir) + 1 + 6 + 6 + 1); + if (!name) + return WIMLIB_ERR_NOMEM; + sprintf(name, "%s/wimlibXXXXXX", tmpdir); + raw_fd = mkstemp(name); +#endif /* !_WIN32 */ + + if (raw_fd < 0) { + ERROR_WITH_ERRNO("Failed to create temporary file " + "\"%"TS"\"", name); + FREE(name); + return WIMLIB_ERR_OPEN; + } + + filedes_init(fd_ret, raw_fd); + *name_ret = name; + return 0; +} + +static int +begin_extract_blob(struct blob_descriptor *blob, void *_ctx) +{ + struct apply_ctx *ctx = _ctx; + + if (unlikely(blob->out_refcnt > MAX_OPEN_FILES)) + return create_temporary_file(&ctx->tmpfile_fd, &ctx->tmpfile_name); + + return call_begin_blob(blob, ctx->saved_cbs); +} + +static int +extract_chunk(const struct blob_descriptor *blob, u64 offset, + const void *chunk, size_t size, void *_ctx) +{ + struct apply_ctx *ctx = _ctx; + union wimlib_progress_info *progress = &ctx->progress; + bool last = (offset + size == blob->size); + int ret; + + if (likely(ctx->supported_features.hard_links)) { + progress->extract.completed_bytes += + (u64)size * blob->out_refcnt; + if (last) + progress->extract.completed_streams += blob->out_refcnt; + } else { + const struct blob_extraction_target *targets = + blob_extraction_targets(blob); + for (u32 i = 0; i < blob->out_refcnt; i++) { + const struct wim_inode *inode = targets[i].inode; + const struct wim_dentry *dentry; + + inode_for_each_extraction_alias(dentry, inode) { + progress->extract.completed_bytes += size; + if (last) + progress->extract.completed_streams++; + } + } + } + if (progress->extract.completed_bytes >= ctx->next_progress) { + + ret = extract_progress(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS); + if (ret) + return ret; + + set_next_progress(progress->extract.completed_bytes, + progress->extract.total_bytes, + &ctx->next_progress); + } + + if (unlikely(filedes_valid(&ctx->tmpfile_fd))) { + /* Just extracting to temporary file for now. */ + ret = full_write(&ctx->tmpfile_fd, chunk, size); + if (ret) { + ERROR_WITH_ERRNO("Error writing data to " + "temporary file \"%"TS"\"", + ctx->tmpfile_name); + } + return ret; + } + + return call_continue_blob(blob, offset, chunk, size, ctx->saved_cbs); +} + +/* Copy the blob's data from the temporary file to each of its targets. + * + * This is executed only in the very uncommon case that a blob is being + * extracted to more than MAX_OPEN_FILES targets! */ +static int +extract_from_tmpfile(const tchar *tmpfile_name, + const struct blob_descriptor *orig_blob, + const struct read_blob_callbacks *cbs) +{ + struct blob_descriptor tmpfile_blob; + const struct blob_extraction_target *targets = blob_extraction_targets(orig_blob); + int ret; + + memcpy(&tmpfile_blob, orig_blob, sizeof(struct blob_descriptor)); + tmpfile_blob.blob_location = BLOB_IN_FILE_ON_DISK; + tmpfile_blob.file_on_disk = (tchar *)tmpfile_name; + tmpfile_blob.out_refcnt = 1; + + for (u32 i = 0; i < orig_blob->out_refcnt; i++) { + tmpfile_blob.inline_blob_extraction_targets[0] = targets[i]; + ret = read_blob_with_cbs(&tmpfile_blob, cbs, false); + if (ret) + return ret; + } + return 0; +} + +static void +warn_about_corrupted_file(struct wim_dentry *dentry, + const struct wim_inode_stream *stream) +{ + WARNING("Corruption in %s\"%"TS"\"! Extracting anyway since data recovery mode is enabled.", + stream_is_unnamed_data_stream(stream) ? "" : "alternate stream of ", + dentry_full_path(dentry)); +} + +static int +end_extract_blob(struct blob_descriptor *blob, int status, void *_ctx) +{ + struct apply_ctx *ctx = _ctx; + + if ((ctx->extract_flags & WIMLIB_EXTRACT_FLAG_RECOVER_DATA) && + !status && blob->corrupted) { + const struct blob_extraction_target *targets = + blob_extraction_targets(blob); + for (u32 i = 0; i < blob->out_refcnt; i++) { + struct wim_dentry *dentry = + inode_first_extraction_dentry(targets[i].inode); + + warn_about_corrupted_file(dentry, targets[i].stream); + } + } + + if (unlikely(filedes_valid(&ctx->tmpfile_fd))) { + filedes_close(&ctx->tmpfile_fd); + if (!status) + status = extract_from_tmpfile(ctx->tmpfile_name, blob, + ctx->saved_cbs); + filedes_invalidate(&ctx->tmpfile_fd); + tunlink(ctx->tmpfile_name); + FREE(ctx->tmpfile_name); + return status; + } + + return call_end_blob(blob, status, ctx->saved_cbs); +} + +/* + * Read the list of blobs to extract and feed their data into the specified + * callback functions. + * + * This handles checksumming each blob. + * + * This also handles sending WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS. + * + * This also works if the WIM is being read from a pipe. + * + * This also will split up blobs that will need to be extracted to more than + * MAX_OPEN_FILES locations, as measured by the 'out_refcnt' of each blob. + * Therefore, the apply_operations implementation need not worry about running + * out of file descriptors, unless it might open more than one file descriptor + * per 'blob_extraction_target' (e.g. Win32 currently might because the + * destination file system might not support hard links). + */ +int +extract_blob_list(struct apply_ctx *ctx, const struct read_blob_callbacks *cbs) +{ + struct read_blob_callbacks wrapper_cbs = { + .begin_blob = begin_extract_blob, + .continue_blob = extract_chunk, + .end_blob = end_extract_blob, + .ctx = ctx, + }; + ctx->saved_cbs = cbs; + if (ctx->extract_flags & WIMLIB_EXTRACT_FLAG_FROM_PIPE) { + return read_blobs_from_pipe(ctx, &wrapper_cbs); + } else { + int flags = VERIFY_BLOB_HASHES; + + if (ctx->extract_flags & WIMLIB_EXTRACT_FLAG_RECOVER_DATA) + flags |= RECOVER_DATA; + + return read_blob_list(&ctx->blob_list, + offsetof(struct blob_descriptor, + extraction_list), + &wrapper_cbs, flags); + } +} + +/* Extract a WIM dentry to standard output. + * + * This obviously doesn't make sense in all cases. We return an error if the + * dentry does not correspond to a regular file. Otherwise we extract the + * unnamed data stream only. */ +static int +extract_dentry_to_stdout(struct wim_dentry *dentry, + const struct blob_table *blob_table, int extract_flags) +{ + struct wim_inode *inode = dentry->d_inode; + struct blob_descriptor *blob; + struct filedes _stdout; + bool recover = (extract_flags & WIMLIB_EXTRACT_FLAG_RECOVER_DATA); + int ret; + + if (inode->i_attributes & (FILE_ATTRIBUTE_REPARSE_POINT | + FILE_ATTRIBUTE_DIRECTORY | + FILE_ATTRIBUTE_ENCRYPTED)) + { + ERROR("\"%"TS"\" is not a regular file and therefore cannot be " + "extracted to standard output", dentry_full_path(dentry)); + return WIMLIB_ERR_NOT_A_REGULAR_FILE; + } + + blob = inode_get_blob_for_unnamed_data_stream(inode, blob_table); + if (!blob) { + const u8 *hash = inode_get_hash_of_unnamed_data_stream(inode); + if (!is_zero_hash(hash)) + return blob_not_found_error(inode, hash); + return 0; + } + + filedes_init(&_stdout, STDOUT_FILENO); + ret = extract_blob_to_fd(blob, &_stdout, recover); + if (ret) + return ret; + if (recover && blob->corrupted) + warn_about_corrupted_file(dentry, + inode_get_unnamed_data_stream(inode)); + return 0; +} + +static int +extract_dentries_to_stdout(struct wim_dentry **dentries, size_t num_dentries, + const struct blob_table *blob_table, + int extract_flags) +{ + for (size_t i = 0; i < num_dentries; i++) { + int ret = extract_dentry_to_stdout(dentries[i], blob_table, + extract_flags); + if (ret) + return ret; + } + return 0; +} + +/**********************************************************************/ + +/* + * Removes duplicate dentries from the array. + * + * Returns the new number of dentries, packed at the front of the array. + */ +static size_t +remove_duplicate_trees(struct wim_dentry **trees, size_t num_trees) +{ + size_t i, j = 0; + for (i = 0; i < num_trees; i++) { + if (!trees[i]->d_tmp_flag) { + /* Found distinct dentry. */ + trees[i]->d_tmp_flag = 1; + trees[j++] = trees[i]; + } + } + for (i = 0; i < j; i++) + trees[i]->d_tmp_flag = 0; + return j; +} + +/* + * Remove dentries that are descendants of other dentries in the array. + * + * Returns the new number of dentries, packed at the front of the array. + */ +static size_t +remove_contained_trees(struct wim_dentry **trees, size_t num_trees) +{ + size_t i, j = 0; + for (i = 0; i < num_trees; i++) + trees[i]->d_tmp_flag = 1; + for (i = 0; i < num_trees; i++) { + struct wim_dentry *d = trees[i]; + while (!dentry_is_root(d)) { + d = d->d_parent; + if (d->d_tmp_flag) + goto tree_contained; + } + trees[j++] = trees[i]; + continue; + + tree_contained: + trees[i]->d_tmp_flag = 0; + } + + for (i = 0; i < j; i++) + trees[i]->d_tmp_flag = 0; + return j; +} + +static int +dentry_append_to_list(struct wim_dentry *dentry, void *_dentry_list) +{ + struct list_head *dentry_list = _dentry_list; + list_add_tail(&dentry->d_extraction_list_node, dentry_list); + return 0; +} + +static void +dentry_reset_extraction_list_node(struct wim_dentry *dentry) +{ + dentry->d_extraction_list_node = (struct list_head){NULL, NULL}; +} + +static int +dentry_delete_from_list(struct wim_dentry *dentry, void *_ignore) +{ + if (will_extract_dentry(dentry)) { + list_del(&dentry->d_extraction_list_node); + dentry_reset_extraction_list_node(dentry); + } + return 0; +} + +/* + * Build the preliminary list of dentries to be extracted. + * + * The list maintains the invariant that if d1 and d2 are in the list and d1 is + * an ancestor of d2, then d1 appears before d2 in the list. + */ +static void +build_dentry_list(struct list_head *dentry_list, struct wim_dentry **trees, + size_t num_trees, bool add_ancestors) +{ + INIT_LIST_HEAD(dentry_list); + + /* Add the trees recursively. */ + for (size_t i = 0; i < num_trees; i++) + for_dentry_in_tree(trees[i], dentry_append_to_list, dentry_list); + + /* If requested, add ancestors of the trees. */ + if (add_ancestors) { + for (size_t i = 0; i < num_trees; i++) { + struct wim_dentry *dentry = trees[i]; + struct wim_dentry *ancestor; + struct list_head *place_after; + + if (dentry_is_root(dentry)) + continue; + + place_after = dentry_list; + ancestor = dentry; + do { + ancestor = ancestor->d_parent; + if (will_extract_dentry(ancestor)) { + place_after = &ancestor->d_extraction_list_node; + break; + } + } while (!dentry_is_root(ancestor)); + + ancestor = dentry; + do { + ancestor = ancestor->d_parent; + if (will_extract_dentry(ancestor)) + break; + list_add(&ancestor->d_extraction_list_node, place_after); + } while (!dentry_is_root(ancestor)); + } + } +} + +static void +destroy_dentry_list(struct list_head *dentry_list) +{ + struct wim_dentry *dentry, *tmp; + struct wim_inode *inode; + + list_for_each_entry_safe(dentry, tmp, dentry_list, d_extraction_list_node) { + inode = dentry->d_inode; + dentry_reset_extraction_list_node(dentry); + inode->i_visited = 0; + inode->i_can_externally_back = 0; + if ((void *)dentry->d_extraction_name != (void *)dentry->d_name) + FREE(dentry->d_extraction_name); + dentry->d_extraction_name = NULL; + dentry->d_extraction_name_nchars = 0; + } +} + +static void +destroy_blob_list(struct list_head *blob_list) +{ + struct blob_descriptor *blob; + + list_for_each_entry(blob, blob_list, extraction_list) + if (blob->out_refcnt > ARRAY_LEN(blob->inline_blob_extraction_targets)) + FREE(blob->blob_extraction_targets); +} + +#ifdef _WIN32 +static const utf16lechar replacement_char = cpu_to_le16(0xfffd); +#else +static const utf16lechar replacement_char = cpu_to_le16('?'); +#endif + +static bool +file_name_valid(utf16lechar *name, size_t num_chars, bool fix) +{ + size_t i; + + if (num_chars == 0) + return true; + for (i = 0; i < num_chars; i++) { + switch (le16_to_cpu(name[i])) { + #ifdef _WIN32 + case '\x01'...'\x1F': + case '\\': + case ':': + case '*': + case '?': + case '"': + case '<': + case '>': + case '|': + #endif + case '/': + case '\0': + if (fix) + name[i] = replacement_char; + else + return false; + } + } + + return true; +} + +static int +dentry_calculate_extraction_name(struct wim_dentry *dentry, + struct apply_ctx *ctx) +{ + int ret; + + if (dentry_is_root(dentry)) + return 0; + +#ifdef WITH_NTFS_3G + if (ctx->extract_flags & WIMLIB_EXTRACT_FLAG_NTFS) { + dentry->d_extraction_name = dentry->d_name; + dentry->d_extraction_name_nchars = dentry->d_name_nbytes / + sizeof(utf16lechar); + return 0; + } +#endif + + if (!ctx->supported_features.case_sensitive_filenames) { + struct wim_dentry *other; + dentry_for_each_ci_match(other, dentry) { + if (will_extract_dentry(other)) { + if (ctx->extract_flags & + WIMLIB_EXTRACT_FLAG_ALL_CASE_CONFLICTS) { + WARNING("\"%"TS"\" has the same " + "case-insensitive name as " + "\"%"TS"\"; extracting " + "dummy name instead", + dentry_full_path(dentry), + dentry_full_path(other)); + goto out_replace; + } else { + WARNING("Not extracting \"%"TS"\": " + "has same case-insensitive " + "name as \"%"TS"\"", + dentry_full_path(dentry), + dentry_full_path(other)); + goto skip_dentry; + } + } + } + } + + if (file_name_valid(dentry->d_name, dentry->d_name_nbytes / 2, false)) { + size_t nbytes = 0; + ret = utf16le_get_tstr(dentry->d_name, + dentry->d_name_nbytes, + (const tchar **)&dentry->d_extraction_name, + &nbytes); + dentry->d_extraction_name_nchars = nbytes / sizeof(tchar); + return ret; + } else { + if (ctx->extract_flags & WIMLIB_EXTRACT_FLAG_REPLACE_INVALID_FILENAMES) + { + WARNING("\"%"TS"\" has an invalid filename " + "that is not supported on this platform; " + "extracting dummy name instead", + dentry_full_path(dentry)); + goto out_replace; + } else { + WARNING("Not extracting \"%"TS"\": has an invalid filename " + "that is not supported on this platform", + dentry_full_path(dentry)); + goto skip_dentry; + } + } + +out_replace: + { + utf16lechar utf16_name_copy[dentry->d_name_nbytes / 2]; + + memcpy(utf16_name_copy, dentry->d_name, dentry->d_name_nbytes); + file_name_valid(utf16_name_copy, dentry->d_name_nbytes / 2, true); + + const tchar *tchar_name; + size_t tchar_nchars; + + ret = utf16le_get_tstr(utf16_name_copy, + dentry->d_name_nbytes, + &tchar_name, &tchar_nchars); + if (ret) + return ret; + + tchar_nchars /= sizeof(tchar); + + size_t fixed_name_num_chars = tchar_nchars; + tchar fixed_name[tchar_nchars + 50]; + + tmemcpy(fixed_name, tchar_name, tchar_nchars); + fixed_name_num_chars += tsprintf(fixed_name + tchar_nchars, + T(" (invalid filename #%lu)"), + ++ctx->invalid_sequence); + + utf16le_put_tstr(tchar_name); + + dentry->d_extraction_name = TSTRDUP(fixed_name); + if (!dentry->d_extraction_name) + return WIMLIB_ERR_NOMEM; + dentry->d_extraction_name_nchars = fixed_name_num_chars; + } + return 0; + +skip_dentry: + for_dentry_in_tree(dentry, dentry_delete_from_list, NULL); + return 0; +} + +/* + * Calculate the actual filename component at which each WIM dentry will be + * extracted, with special handling for dentries that are unsupported by the + * extraction backend or have invalid names. + * + * ctx->supported_features must be filled in. + * + * Possible error codes: WIMLIB_ERR_NOMEM, WIMLIB_ERR_INVALID_UTF16_STRING + */ +static int +dentry_list_calculate_extraction_names(struct list_head *dentry_list, + struct apply_ctx *ctx) +{ + struct list_head *prev, *cur; + + /* Can't use list_for_each_entry() because a call to + * dentry_calculate_extraction_name() may delete the current dentry and + * its children from the list. */ + + prev = dentry_list; + for (;;) { + struct wim_dentry *dentry; + int ret; + + cur = prev->next; + if (cur == dentry_list) + break; + + dentry = list_entry(cur, struct wim_dentry, d_extraction_list_node); + + ret = dentry_calculate_extraction_name(dentry, ctx); + if (ret) + return ret; + + if (prev->next == cur) + prev = cur; + else + ; /* Current dentry and its children (which follow in + the list) were deleted. prev stays the same. */ + } + return 0; +} + +static int +dentry_resolve_streams(struct wim_dentry *dentry, int extract_flags, + struct blob_table *blob_table) +{ + struct wim_inode *inode = dentry->d_inode; + struct blob_descriptor *blob; + int ret; + bool force = false; + + /* Special case: when extracting from a pipe, the WIM blob table is + * initially empty, so "resolving" an inode's streams is initially not + * possible. However, we still need to keep track of which blobs, + * identified by SHA-1 message digests, need to be extracted, so we + * "resolve" the inode's streams anyway by allocating a 'struct + * blob_descriptor' for each one. */ + if (extract_flags & WIMLIB_EXTRACT_FLAG_FROM_PIPE) + force = true; + ret = inode_resolve_streams(inode, blob_table, force); + if (ret) + return ret; + for (unsigned i = 0; i < inode->i_num_streams; i++) { + blob = stream_blob_resolved(&inode->i_streams[i]); + if (blob) + blob->out_refcnt = 0; + } + return 0; +} + +/* + * For each dentry to be extracted, resolve all streams in the corresponding + * inode and set 'out_refcnt' in all referenced blob_descriptors to 0. + * + * Possible error codes: WIMLIB_ERR_RESOURCE_NOT_FOUND, WIMLIB_ERR_NOMEM. + */ +static int +dentry_list_resolve_streams(struct list_head *dentry_list, + struct apply_ctx *ctx) +{ + struct wim_dentry *dentry; + int ret; + + list_for_each_entry(dentry, dentry_list, d_extraction_list_node) { + ret = dentry_resolve_streams(dentry, + ctx->extract_flags, + ctx->wim->blob_table); + if (ret) + return ret; + } + return 0; +} + +static int +ref_stream(struct wim_inode_stream *strm, struct wim_dentry *dentry, + struct apply_ctx *ctx) +{ + struct wim_inode *inode = dentry->d_inode; + struct blob_descriptor *blob = stream_blob_resolved(strm); + struct blob_extraction_target *targets; + + if (!blob) + return 0; + + /* Tally the size only for each actual extraction of the stream (not + * additional hard links to the inode). */ + if (inode->i_visited && ctx->supported_features.hard_links) + return 0; + + ctx->progress.extract.total_bytes += blob->size; + ctx->progress.extract.total_streams++; + + if (inode->i_visited) + return 0; + + /* Add each blob to 'ctx->blob_list' only one time, regardless of how + * many extraction targets it will have. */ + if (blob->out_refcnt == 0) { + list_add_tail(&blob->extraction_list, &ctx->blob_list); + ctx->num_blobs_remaining++; + } + + /* Set this stream as an extraction target of 'blob'. */ + + if (blob->out_refcnt < ARRAY_LEN(blob->inline_blob_extraction_targets)) { + targets = blob->inline_blob_extraction_targets; + } else { + struct blob_extraction_target *prev_targets; + size_t alloc_blob_extraction_targets; + + if (blob->out_refcnt == ARRAY_LEN(blob->inline_blob_extraction_targets)) { + prev_targets = NULL; + alloc_blob_extraction_targets = ARRAY_LEN(blob->inline_blob_extraction_targets); + } else { + prev_targets = blob->blob_extraction_targets; + alloc_blob_extraction_targets = blob->alloc_blob_extraction_targets; + } + + if (blob->out_refcnt == alloc_blob_extraction_targets) { + alloc_blob_extraction_targets *= 2; + targets = REALLOC(prev_targets, + alloc_blob_extraction_targets * + sizeof(targets[0])); + if (!targets) + return WIMLIB_ERR_NOMEM; + if (!prev_targets) { + memcpy(targets, + blob->inline_blob_extraction_targets, + sizeof(blob->inline_blob_extraction_targets)); + } + blob->blob_extraction_targets = targets; + blob->alloc_blob_extraction_targets = alloc_blob_extraction_targets; + } + targets = blob->blob_extraction_targets; + } + targets[blob->out_refcnt].inode = inode; + targets[blob->out_refcnt].stream = strm; + blob->out_refcnt++; + return 0; +} + +static int +ref_stream_if_needed(struct wim_dentry *dentry, struct wim_inode *inode, + struct wim_inode_stream *strm, struct apply_ctx *ctx) +{ + bool need_stream = false; + switch (strm->stream_type) { + case STREAM_TYPE_DATA: + if (stream_is_named(strm)) { + /* Named data stream */ + if (ctx->supported_features.named_data_streams) + need_stream = true; + } else if (!(inode->i_attributes & (FILE_ATTRIBUTE_DIRECTORY | + FILE_ATTRIBUTE_ENCRYPTED)) + && !(inode_is_symlink(inode) + && !ctx->supported_features.reparse_points + && ctx->supported_features.symlink_reparse_points)) + { + /* + * Unnamed data stream. Skip if any of the following is true: + * + * - file is a directory + * - file is encrypted + * - backend needs to create the file as UNIX symlink + * - backend will extract the stream as externally + * backed from the WIM archive itself + */ + if (ctx->apply_ops->will_back_from_wim) { + int ret = (*ctx->apply_ops->will_back_from_wim)(dentry, ctx); + if (ret > 0) /* Error? */ + return ret; + if (ret < 0) /* Won't externally back? */ + need_stream = true; + } else { + need_stream = true; + } + } + break; + case STREAM_TYPE_REPARSE_POINT: + wimlib_assert(inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT); + if (ctx->supported_features.reparse_points || + (inode_is_symlink(inode) && + ctx->supported_features.symlink_reparse_points)) + need_stream = true; + break; + case STREAM_TYPE_EFSRPC_RAW_DATA: + wimlib_assert(inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED); + if (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY) { + if (ctx->supported_features.encrypted_directories) + need_stream = true; + } else { + if (ctx->supported_features.encrypted_files) + need_stream = true; + } + break; + } + if (need_stream) + return ref_stream(strm, dentry, ctx); + return 0; +} + +static int +dentry_ref_streams(struct wim_dentry *dentry, struct apply_ctx *ctx) +{ + struct wim_inode *inode = dentry->d_inode; + for (unsigned i = 0; i < inode->i_num_streams; i++) { + int ret = ref_stream_if_needed(dentry, inode, + &inode->i_streams[i], ctx); + if (ret) + return ret; + } + inode->i_visited = 1; + return 0; +} + +/* + * Given a list of dentries to be extracted, build the list of blobs that need + * to be extracted, and for each blob determine the streams to which that blob + * will be extracted. + * + * This also initializes the extract progress info with byte and blob + * information. + * + * ctx->supported_features must be filled in. + */ +static int +dentry_list_ref_streams(struct list_head *dentry_list, struct apply_ctx *ctx) +{ + struct wim_dentry *dentry; + int ret; + + list_for_each_entry(dentry, dentry_list, d_extraction_list_node) { + ret = dentry_ref_streams(dentry, ctx); + if (ret) + return ret; + } + list_for_each_entry(dentry, dentry_list, d_extraction_list_node) + dentry->d_inode->i_visited = 0; + return 0; +} + +static void +dentry_list_build_inode_alias_lists(struct list_head *dentry_list) +{ + struct wim_dentry *dentry; + + list_for_each_entry(dentry, dentry_list, d_extraction_list_node) + dentry->d_inode->i_first_extraction_alias = NULL; + + list_for_each_entry(dentry, dentry_list, d_extraction_list_node) { + dentry->d_next_extraction_alias = dentry->d_inode->i_first_extraction_alias; + dentry->d_inode->i_first_extraction_alias = dentry; + } +} + +static void +inode_tally_features(const struct wim_inode *inode, + struct wim_features *features) +{ + if (inode->i_attributes & FILE_ATTRIBUTE_READONLY) + features->readonly_files++; + if (inode->i_attributes & FILE_ATTRIBUTE_HIDDEN) + features->hidden_files++; + if (inode->i_attributes & FILE_ATTRIBUTE_SYSTEM) + features->system_files++; + if (inode->i_attributes & FILE_ATTRIBUTE_ARCHIVE) + features->archive_files++; + if (inode->i_attributes & FILE_ATTRIBUTE_COMPRESSED) + features->compressed_files++; + if (inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED) { + if (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY) + features->encrypted_directories++; + else + features->encrypted_files++; + } + if (inode->i_attributes & FILE_ATTRIBUTE_NOT_CONTENT_INDEXED) + features->not_context_indexed_files++; + if (inode->i_attributes & FILE_ATTRIBUTE_SPARSE_FILE) + features->sparse_files++; + if (inode_has_named_data_stream(inode)) + features->named_data_streams++; + if (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) { + features->reparse_points++; + if (inode_is_symlink(inode)) + features->symlink_reparse_points++; + else + features->other_reparse_points++; + } + if (inode_has_security_descriptor(inode)) + features->security_descriptors++; + if (inode_has_unix_data(inode)) + features->unix_data++; + if (inode_has_object_id(inode)) + features->object_ids++; + if (inode_has_xattrs(inode)) + features->xattrs++; +} + +/* Tally features necessary to extract a dentry and the corresponding inode. */ +static void +dentry_tally_features(struct wim_dentry *dentry, struct wim_features *features) +{ + struct wim_inode *inode = dentry->d_inode; + + if (dentry_has_short_name(dentry)) + features->short_names++; + + if (inode->i_visited) { + features->hard_links++; + } else { + inode_tally_features(inode, features); + inode->i_visited = 1; + } +} + +/* Tally the features necessary to extract the specified dentries. */ +static void +dentry_list_get_features(struct list_head *dentry_list, + struct wim_features *features) +{ + struct wim_dentry *dentry; + + list_for_each_entry(dentry, dentry_list, d_extraction_list_node) + dentry_tally_features(dentry, features); + + list_for_each_entry(dentry, dentry_list, d_extraction_list_node) + dentry->d_inode->i_visited = 0; +} + +static int +do_feature_check(const struct wim_features *required_features, + const struct wim_features *supported_features, + int extract_flags) +{ + /* Encrypted files. */ + if (required_features->encrypted_files && + !supported_features->encrypted_files) + WARNING("Ignoring EFS-encrypted data of %lu files", + required_features->encrypted_files); + + /* Named data streams. */ + if (required_features->named_data_streams && + !supported_features->named_data_streams) + WARNING("Ignoring named data streams of %lu files", + required_features->named_data_streams); + + /* File attributes. */ + if (!(extract_flags & WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES)) { + + if (required_features->readonly_files && + !supported_features->readonly_files) + WARNING("Ignoring FILE_ATTRIBUTE_READONLY of %lu files", + required_features->readonly_files); + + if (required_features->hidden_files && + !supported_features->hidden_files) + WARNING("Ignoring FILE_ATTRIBUTE_HIDDEN of %lu files", + required_features->hidden_files); + + if (required_features->system_files && + !supported_features->system_files) + WARNING("Ignoring FILE_ATTRIBUTE_SYSTEM of %lu files", + required_features->system_files); + + /* Note: Don't bother the user about FILE_ATTRIBUTE_ARCHIVE. + * We're an archive program, so theoretically we can do what we + * want with it. */ + + if (required_features->compressed_files && + !supported_features->compressed_files) + WARNING("Ignoring FILE_ATTRIBUTE_COMPRESSED of %lu files", + required_features->compressed_files); + + if (required_features->not_context_indexed_files && + !supported_features->not_context_indexed_files) + WARNING("Ignoring FILE_ATTRIBUTE_NOT_CONTENT_INDEXED of %lu files", + required_features->not_context_indexed_files); + + if (required_features->sparse_files && + !supported_features->sparse_files) + WARNING("Ignoring FILE_ATTRIBUTE_SPARSE_FILE of %lu files", + required_features->sparse_files); + + if (required_features->encrypted_directories && + !supported_features->encrypted_directories) + WARNING("Ignoring FILE_ATTRIBUTE_ENCRYPTED of %lu directories", + required_features->encrypted_directories); + } + + /* Hard links. */ + if (required_features->hard_links && !supported_features->hard_links) + WARNING("Extracting %lu hard links as independent files", + required_features->hard_links); + + /* Symbolic links and reparse points. */ + if ((extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS) && + required_features->symlink_reparse_points && + !supported_features->symlink_reparse_points && + !supported_features->reparse_points) + { + ERROR("Extraction backend does not support symbolic links!"); + return WIMLIB_ERR_UNSUPPORTED; + } + if (required_features->reparse_points && + !supported_features->reparse_points) + { + if (supported_features->symlink_reparse_points) { + if (required_features->other_reparse_points) { + WARNING("Ignoring reparse data of %lu non-symlink/junction files", + required_features->other_reparse_points); + } + } else { + WARNING("Ignoring reparse data of %lu files", + required_features->reparse_points); + } + } + + /* Security descriptors. */ + if (((extract_flags & (WIMLIB_EXTRACT_FLAG_STRICT_ACLS | + WIMLIB_EXTRACT_FLAG_UNIX_DATA)) + == WIMLIB_EXTRACT_FLAG_STRICT_ACLS) && + required_features->security_descriptors && + !supported_features->security_descriptors) + { + ERROR("Extraction backend does not support security descriptors!"); + return WIMLIB_ERR_UNSUPPORTED; + } + if (!(extract_flags & WIMLIB_EXTRACT_FLAG_NO_ACLS) && + required_features->security_descriptors && + !supported_features->security_descriptors) + WARNING("Ignoring Windows NT security descriptors of %lu files", + required_features->security_descriptors); + + /* Standard UNIX metadata */ + if (required_features->unix_data && + (!supported_features->unix_data || + !(extract_flags & WIMLIB_EXTRACT_FLAG_UNIX_DATA))) + { + if (extract_flags & WIMLIB_EXTRACT_FLAG_UNIX_DATA) { + ERROR("Requested UNIX metadata extraction, but " + "extraction backend does not support it!"); + return WIMLIB_ERR_UNSUPPORTED; + } + WARNING("Ignoring UNIX metadata (uid/gid/mode/rdev) of %lu files%"TS, + required_features->unix_data, + (supported_features->unix_data ? + T("\n (use --unix-data mode to extract these)") : T(""))); + } + + /* Extended attributes */ + if (required_features->xattrs && + (!supported_features->xattrs || + (supported_features->unix_data && + !(extract_flags & WIMLIB_EXTRACT_FLAG_UNIX_DATA)))) + { + WARNING("Ignoring extended attributes of %lu files%"TS, + required_features->xattrs, + (supported_features->xattrs ? + T("\n (use --unix-data mode to extract these)") : T(""))); + } + + /* Object IDs. */ + if (required_features->object_ids && !supported_features->object_ids) { + WARNING("Ignoring object IDs of %lu files", + required_features->object_ids); + } + + /* DOS Names. */ + if (required_features->short_names && + !supported_features->short_names) + { + if (extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES) { + ERROR("Extraction backend does not support DOS names!"); + return WIMLIB_ERR_UNSUPPORTED; + } + WARNING("Ignoring DOS names of %lu files", + required_features->short_names); + } + + /* Timestamps. */ + if ((extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_TIMESTAMPS) && + !supported_features->timestamps) + { + ERROR("Extraction backend does not support timestamps!"); + return WIMLIB_ERR_UNSUPPORTED; + } + + return 0; +} + +static const struct apply_operations * +select_apply_operations(int extract_flags) +{ +#ifdef WITH_NTFS_3G + if (extract_flags & WIMLIB_EXTRACT_FLAG_NTFS) + return &ntfs_3g_apply_ops; +#endif +#ifdef _WIN32 + return &win32_apply_ops; +#else + return &unix_apply_ops; +#endif +} + +static int +extract_trees(WIMStruct *wim, struct wim_dentry **trees, size_t num_trees, + const tchar *target, int extract_flags) +{ + const struct apply_operations *ops; + struct apply_ctx *ctx; + int ret; + LIST_HEAD(dentry_list); + + if (extract_flags & WIMLIB_EXTRACT_FLAG_TO_STDOUT) { + ret = extract_dentries_to_stdout(trees, num_trees, + wim->blob_table, + extract_flags); + goto out; + } + + num_trees = remove_duplicate_trees(trees, num_trees); + num_trees = remove_contained_trees(trees, num_trees); + + ops = select_apply_operations(extract_flags); + + if (num_trees > 1 && ops->single_tree_only) { + ERROR("Extracting multiple directory trees " + "at once is not supported in %s extraction mode!", + ops->name); + ret = WIMLIB_ERR_UNSUPPORTED; + goto out; + } + + ctx = CALLOC(1, ops->context_size); + if (!ctx) { + ret = WIMLIB_ERR_NOMEM; + goto out; + } + + ctx->wim = wim; + ctx->target = target; + ctx->target_nchars = tstrlen(target); + ctx->extract_flags = extract_flags; + if (ctx->wim->progfunc) { + ctx->progfunc = ctx->wim->progfunc; + ctx->progctx = ctx->wim->progctx; + ctx->progress.extract.image = wim->current_image; + ctx->progress.extract.extract_flags = (extract_flags & + WIMLIB_EXTRACT_MASK_PUBLIC); + ctx->progress.extract.wimfile_name = wim->filename; + ctx->progress.extract.image_name = wimlib_get_image_name(wim, + wim->current_image); + ctx->progress.extract.target = target; + } + INIT_LIST_HEAD(&ctx->blob_list); + filedes_invalidate(&ctx->tmpfile_fd); + ctx->apply_ops = ops; + + ret = (*ops->get_supported_features)(target, &ctx->supported_features); + if (ret) + goto out_cleanup; + + build_dentry_list(&dentry_list, trees, num_trees, + !(extract_flags & + WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE)); + + dentry_list_get_features(&dentry_list, &ctx->required_features); + + ret = do_feature_check(&ctx->required_features, &ctx->supported_features, + ctx->extract_flags); + if (ret) + goto out_cleanup; + + ret = dentry_list_calculate_extraction_names(&dentry_list, ctx); + if (ret) + goto out_cleanup; + + if (unlikely(list_empty(&dentry_list))) { + WARNING("There is nothing to extract!"); + goto out_cleanup; + } + + ret = dentry_list_resolve_streams(&dentry_list, ctx); + if (ret) + goto out_cleanup; + + dentry_list_build_inode_alias_lists(&dentry_list); + + ret = dentry_list_ref_streams(&dentry_list, ctx); + if (ret) + goto out_cleanup; + + if (extract_flags & WIMLIB_EXTRACT_FLAG_FROM_PIPE) { + /* When extracting from a pipe, the number of bytes of data to + * extract can't be determined in the normal way (examining the + * blob table), since at this point all we have is a set of + * SHA-1 message digests of blobs that need to be extracted. + * However, we can get a reasonably accurate estimate by taking + * <TOTALBYTES> from the corresponding <IMAGE> in the WIM XML + * data. This does assume that a full image is being extracted, + * but currently there is no API for doing otherwise. (Also, + * subtract <HARDLINKBYTES> from this if hard links are + * supported by the extraction mode.) */ + ctx->progress.extract.total_bytes = + xml_get_image_total_bytes(wim->xml_info, + wim->current_image); + if (ctx->supported_features.hard_links) { + ctx->progress.extract.total_bytes -= + xml_get_image_hard_link_bytes(wim->xml_info, + wim->current_image); + } + } + + ret = extract_progress(ctx, + ((extract_flags & WIMLIB_EXTRACT_FLAG_IMAGEMODE) ? + WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN : + WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN)); + if (ret) + goto out_cleanup; + + ret = (*ops->extract)(&dentry_list, ctx); + if (ret) + goto out_cleanup; + + if (ctx->progress.extract.completed_bytes < + ctx->progress.extract.total_bytes) + { + ctx->progress.extract.completed_bytes = + ctx->progress.extract.total_bytes; + ret = extract_progress(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS); + if (ret) + goto out_cleanup; + } + + ret = extract_progress(ctx, + ((extract_flags & WIMLIB_EXTRACT_FLAG_IMAGEMODE) ? + WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_END : + WIMLIB_PROGRESS_MSG_EXTRACT_TREE_END)); +out_cleanup: + destroy_blob_list(&ctx->blob_list); + destroy_dentry_list(&dentry_list); + FREE(ctx); +out: + return ret; +} + +static int +mkdir_if_needed(const tchar *target) +{ + if (!tmkdir(target, 0755)) + return 0; + + if (errno == EEXIST) + return 0; + +#ifdef _WIN32 + /* _wmkdir() fails with EACCES if called on a drive root directory. */ + if (errno == EACCES) + return 0; +#endif + + ERROR_WITH_ERRNO("Failed to create directory \"%"TS"\"", target); + return WIMLIB_ERR_MKDIR; +} + +/* Make sure the extraction flags make sense, and update them if needed. */ +static int +check_extract_flags(const WIMStruct *wim, int *extract_flags_p) +{ + int extract_flags = *extract_flags_p; + + /* Check for invalid flag combinations */ + + if ((extract_flags & + (WIMLIB_EXTRACT_FLAG_NO_ACLS | + WIMLIB_EXTRACT_FLAG_STRICT_ACLS)) == (WIMLIB_EXTRACT_FLAG_NO_ACLS | + WIMLIB_EXTRACT_FLAG_STRICT_ACLS)) + return WIMLIB_ERR_INVALID_PARAM; + + if ((extract_flags & + (WIMLIB_EXTRACT_FLAG_RPFIX | + WIMLIB_EXTRACT_FLAG_NORPFIX)) == (WIMLIB_EXTRACT_FLAG_RPFIX | + WIMLIB_EXTRACT_FLAG_NORPFIX)) + return WIMLIB_ERR_INVALID_PARAM; + +#ifndef WITH_NTFS_3G + if (extract_flags & WIMLIB_EXTRACT_FLAG_NTFS) { + ERROR("wimlib was compiled without support for NTFS-3G, so\n" + " it cannot apply a WIM image directly to an NTFS volume."); + return WIMLIB_ERR_UNSUPPORTED; + } +#endif + + if (extract_flags & WIMLIB_EXTRACT_FLAG_WIMBOOT) { +#ifdef _WIN32 + if (!wim->filename) + return WIMLIB_ERR_NO_FILENAME; +#else + ERROR("WIMBoot extraction is only supported on Windows!"); + return WIMLIB_ERR_UNSUPPORTED; +#endif + } + + if (extract_flags & (WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K | + WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K | + WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K | + WIMLIB_EXTRACT_FLAG_COMPACT_LZX)) + { + #ifdef _WIN32 + int count = 0; + count += ((extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K) != 0); + count += ((extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K) != 0); + count += ((extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K) != 0); + count += ((extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_LZX) != 0); + if (count != 1) { + ERROR("Only one compression format can be specified " + "for compact-mode extraction!"); + return WIMLIB_ERR_INVALID_PARAM; + } + if (extract_flags & WIMLIB_EXTRACT_FLAG_WIMBOOT) { + ERROR("Compact-mode extraction and WIMBoot-mode " + "extraction are mutually exclusive!"); + return WIMLIB_ERR_INVALID_PARAM; + } + #else + ERROR("Compact-mode extraction (System Compression) " + "is only supported on Windows!"); + return WIMLIB_ERR_UNSUPPORTED; + #endif + } + + + if ((extract_flags & (WIMLIB_EXTRACT_FLAG_RPFIX | + WIMLIB_EXTRACT_FLAG_NORPFIX | + WIMLIB_EXTRACT_FLAG_IMAGEMODE)) == + WIMLIB_EXTRACT_FLAG_IMAGEMODE) + { + /* For full-image extraction, do reparse point fixups by default + * if the WIM header says they are enabled. */ + if (wim->hdr.flags & WIM_HDR_FLAG_RP_FIX) + extract_flags |= WIMLIB_EXTRACT_FLAG_RPFIX; + } + + *extract_flags_p = extract_flags; + return 0; +} + +struct append_dentry_ctx { + struct wim_dentry **dentries; + size_t num_dentries; + size_t num_alloc_dentries; +}; + +static int +append_dentry_cb(struct wim_dentry *dentry, void *_ctx) +{ + struct append_dentry_ctx *ctx = _ctx; + + if (ctx->num_dentries == ctx->num_alloc_dentries) { + struct wim_dentry **new_dentries; + size_t new_length; + + new_length = max(ctx->num_alloc_dentries + 8, + ctx->num_alloc_dentries * 3 / 2); + new_dentries = REALLOC(ctx->dentries, + new_length * sizeof(ctx->dentries[0])); + if (new_dentries == NULL) + return WIMLIB_ERR_NOMEM; + ctx->dentries = new_dentries; + ctx->num_alloc_dentries = new_length; + } + ctx->dentries[ctx->num_dentries++] = dentry; + return 0; +} + +/* Append dentries matched by a path which can contain wildcard characters. */ +static int +append_matched_dentries(WIMStruct *wim, const tchar *orig_pattern, + int extract_flags, struct append_dentry_ctx *ctx) +{ + const size_t count_before = ctx->num_dentries; + tchar *pattern; + int ret; + + pattern = canonicalize_wim_path(orig_pattern); + if (!pattern) + return WIMLIB_ERR_NOMEM; + ret = expand_path_pattern(wim_get_current_root_dentry(wim), pattern, + append_dentry_cb, ctx); + FREE(pattern); + if (ret || ctx->num_dentries > count_before) + return ret; + if (extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_GLOB) { + ERROR("No matches for path pattern \"%"TS"\"", orig_pattern); + return WIMLIB_ERR_PATH_DOES_NOT_EXIST; + } + WARNING("No matches for path pattern \"%"TS"\"", orig_pattern); + return 0; +} + +static int +do_wimlib_extract_paths(WIMStruct *wim, int image, const tchar *target, + const tchar * const *paths, size_t num_paths, + int extract_flags) +{ + int ret; + struct wim_dentry **trees; + size_t num_trees; + + if (wim == NULL || target == NULL || target[0] == T('\0') || + (num_paths != 0 && paths == NULL)) + return WIMLIB_ERR_INVALID_PARAM; + + ret = check_extract_flags(wim, &extract_flags); + if (ret) + return ret; + + ret = select_wim_image(wim, image); + if (ret) + return ret; + + ret = wim_checksum_unhashed_blobs(wim); + if (ret) + return ret; + + if ((extract_flags & (WIMLIB_EXTRACT_FLAG_NTFS | + WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE)) == + (WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE)) + { + ret = mkdir_if_needed(target); + if (ret) + return ret; + } + + if (extract_flags & WIMLIB_EXTRACT_FLAG_GLOB_PATHS) { + + struct append_dentry_ctx append_dentry_ctx = { + .dentries = NULL, + .num_dentries = 0, + .num_alloc_dentries = 0, + }; + + for (size_t i = 0; i < num_paths; i++) { + ret = append_matched_dentries(wim, paths[i], + extract_flags, + &append_dentry_ctx); + if (ret) { + trees = append_dentry_ctx.dentries; + goto out_free_trees; + } + } + trees = append_dentry_ctx.dentries; + num_trees = append_dentry_ctx.num_dentries; + } else { + trees = MALLOC(num_paths * sizeof(trees[0])); + if (trees == NULL) + return WIMLIB_ERR_NOMEM; + + for (size_t i = 0; i < num_paths; i++) { + + tchar *path = canonicalize_wim_path(paths[i]); + if (path == NULL) { + ret = WIMLIB_ERR_NOMEM; + goto out_free_trees; + } + + trees[i] = get_dentry(wim, path, + WIMLIB_CASE_PLATFORM_DEFAULT); + FREE(path); + if (trees[i] == NULL) { + ERROR("Path \"%"TS"\" does not exist " + "in WIM image %d", + paths[i], wim->current_image); + ret = WIMLIB_ERR_PATH_DOES_NOT_EXIST; + goto out_free_trees; + } + } + num_trees = num_paths; + } + + if (num_trees == 0) { + ret = 0; + goto out_free_trees; + } + + ret = extract_trees(wim, trees, num_trees, target, extract_flags); +out_free_trees: + FREE(trees); + return ret; +} + +static int +extract_single_image(WIMStruct *wim, int image, + const tchar *target, int extract_flags) +{ + const tchar *path = WIMLIB_WIM_ROOT_PATH; + extract_flags |= WIMLIB_EXTRACT_FLAG_IMAGEMODE; + return do_wimlib_extract_paths(wim, image, target, &path, 1, extract_flags); +} + +static const tchar * const filename_forbidden_chars = +#ifdef _WIN32 +T("<>:\"/\\|?*"); +#else +T("/"); +#endif + +/* This function checks if it is okay to use a WIM image's name as a directory + * name. */ +static bool +image_name_ok_as_dir(const tchar *image_name) +{ + return image_name && *image_name && + !tstrpbrk(image_name, filename_forbidden_chars) && + tstrcmp(image_name, T(".")) && + tstrcmp(image_name, T("..")) && + tstrlen(image_name) <= 128; +} + +/* Extracts all images from the WIM to the directory @target, with the images + * placed in subdirectories named by their image names. */ +static int +extract_all_images(WIMStruct *wim, const tchar *target, int extract_flags) +{ + size_t output_path_len = tstrlen(target); + tchar buf[output_path_len + 1 + 128 + 1]; + int ret; + int image; + const tchar *image_name; + + if (extract_flags & WIMLIB_EXTRACT_FLAG_NTFS) { + ERROR("Cannot extract multiple images in NTFS extraction mode."); + return WIMLIB_ERR_INVALID_PARAM; + } + + ret = mkdir_if_needed(target); + if (ret) + return ret; + tmemcpy(buf, target, output_path_len); + buf[output_path_len] = OS_PREFERRED_PATH_SEPARATOR; + for (image = 1; image <= wim->hdr.image_count; image++) { + image_name = wimlib_get_image_name(wim, image); + if (image_name_ok_as_dir(image_name)) { + tstrcpy(buf + output_path_len + 1, image_name); + } else { + /* Image name is empty or contains forbidden characters. + * Use image number instead. */ + tsprintf(buf + output_path_len + 1, T("%d"), image); + } + ret = extract_single_image(wim, image, buf, extract_flags); + if (ret) + return ret; + } + return 0; +} + +static int +do_wimlib_extract_image(WIMStruct *wim, int image, const tchar *target, + int extract_flags) +{ + if (extract_flags & (WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE | + WIMLIB_EXTRACT_FLAG_TO_STDOUT | + WIMLIB_EXTRACT_FLAG_GLOB_PATHS)) + return WIMLIB_ERR_INVALID_PARAM; + + if (image == WIMLIB_ALL_IMAGES) + return extract_all_images(wim, target, extract_flags); + else + return extract_single_image(wim, image, target, extract_flags); +} + + +/**************************************************************************** + * Extraction API * + ****************************************************************************/ + +WIMLIBAPI int +wimlib_extract_paths(WIMStruct *wim, int image, const tchar *target, + const tchar * const *paths, size_t num_paths, + int extract_flags) +{ + if (extract_flags & ~WIMLIB_EXTRACT_MASK_PUBLIC) + return WIMLIB_ERR_INVALID_PARAM; + + return do_wimlib_extract_paths(wim, image, target, paths, num_paths, + extract_flags); +} + +WIMLIBAPI int +wimlib_extract_pathlist(WIMStruct *wim, int image, const tchar *target, + const tchar *path_list_file, int extract_flags) +{ + int ret; + tchar **paths; + size_t num_paths; + void *mem; + + ret = read_path_list_file(path_list_file, &paths, &num_paths, &mem); + if (ret) { + ERROR("Failed to read path list file \"%"TS"\"", + path_list_file ? path_list_file : T("<stdin>")); + return ret; + } + + ret = wimlib_extract_paths(wim, image, target, + (const tchar * const *)paths, num_paths, + extract_flags); + FREE(paths); + FREE(mem); + return ret; +} + +WIMLIBAPI int +wimlib_extract_image_from_pipe_with_progress(int pipe_fd, + const tchar *image_num_or_name, + const tchar *target, + int extract_flags, + wimlib_progress_func_t progfunc, + void *progctx) +{ + int ret; + WIMStruct *pwm; + struct filedes *in_fd; + int image; + unsigned i; + + if (extract_flags & ~WIMLIB_EXTRACT_MASK_PUBLIC) + return WIMLIB_ERR_INVALID_PARAM; + + /* Read the WIM header from the pipe and get a WIMStruct to represent + * the pipable WIM. Caveats: Unlike getting a WIMStruct with + * wimlib_open_wim(), getting a WIMStruct in this way will result in an + * empty blob table, no XML data read, and no filename set. */ + ret = open_wim_as_WIMStruct(&pipe_fd, WIMLIB_OPEN_FLAG_FROM_PIPE, &pwm, + progfunc, progctx); + if (ret) + return ret; + + /* Sanity check to make sure this is a pipable WIM. */ + if (pwm->hdr.magic != PWM_MAGIC) { + ERROR("The WIM being read from file descriptor %d " + "is not pipable!", pipe_fd); + ret = WIMLIB_ERR_NOT_PIPABLE; + goto out_wimlib_free; + } + + /* Sanity check to make sure the first part of a pipable split WIM is + * sent over the pipe first. */ + if (pwm->hdr.part_number != 1) { + ERROR("The first part of the split WIM must be " + "sent over the pipe first."); + ret = WIMLIB_ERR_INVALID_PIPABLE_WIM; + goto out_wimlib_free; + } + + in_fd = &pwm->in_fd; + wimlib_assert(in_fd->offset == WIM_HEADER_DISK_SIZE); + + /* As mentioned, the WIMStruct we created from the pipe does not have + * XML data yet. Fix this by reading the extra copy of the XML data + * that directly follows the header in pipable WIMs. (Note: see + * write_pipable_wim() for more details about the format of pipable + * WIMs.) */ + { + u8 hash[SHA1_HASH_SIZE]; + + ret = read_pwm_blob_header(pwm, hash, + &pwm->hdr.xml_data_reshdr, NULL); + if (ret) + goto out_wimlib_free; + + if (!(pwm->hdr.xml_data_reshdr.flags & WIM_RESHDR_FLAG_METADATA)) { + ERROR("Expected XML data, but found non-metadata resource."); + ret = WIMLIB_ERR_INVALID_PIPABLE_WIM; + goto out_wimlib_free; + } + + ret = read_wim_xml_data(pwm); + if (ret) + goto out_wimlib_free; + + if (xml_get_image_count(pwm->xml_info) != pwm->hdr.image_count) { + ERROR("Image count in XML data is not the same as in WIM header."); + ret = WIMLIB_ERR_IMAGE_COUNT; + goto out_wimlib_free; + } + } + + /* Get image index (this may use the XML data that was just read to + * resolve an image name). */ + if (image_num_or_name) { + image = wimlib_resolve_image(pwm, image_num_or_name); + if (image == WIMLIB_NO_IMAGE) { + ERROR("\"%"TS"\" is not a valid image in the pipable WIM!", + image_num_or_name); + ret = WIMLIB_ERR_INVALID_IMAGE; + goto out_wimlib_free; + } else if (image == WIMLIB_ALL_IMAGES) { + ERROR("Applying all images from a pipe is not supported!"); + ret = WIMLIB_ERR_INVALID_IMAGE; + goto out_wimlib_free; + } + } else { + if (pwm->hdr.image_count != 1) { + ERROR("No image was specified, but the pipable WIM " + "did not contain exactly 1 image"); + ret = WIMLIB_ERR_INVALID_IMAGE; + goto out_wimlib_free; + } + image = 1; + } + + /* Load the needed metadata resource. */ + for (i = 1; i <= pwm->hdr.image_count; i++) { + ret = handle_pwm_metadata_resource(pwm, i, i == image); + if (ret) + goto out_wimlib_free; + } + /* Extract the image. */ + extract_flags |= WIMLIB_EXTRACT_FLAG_FROM_PIPE; + ret = do_wimlib_extract_image(pwm, image, target, extract_flags); + /* Clean up and return. */ +out_wimlib_free: + wimlib_free(pwm); + return ret; +} + + +WIMLIBAPI int +wimlib_extract_image_from_pipe(int pipe_fd, const tchar *image_num_or_name, + const tchar *target, int extract_flags) +{ + return wimlib_extract_image_from_pipe_with_progress(pipe_fd, + image_num_or_name, + target, + extract_flags, + NULL, + NULL); +} + +WIMLIBAPI int +wimlib_extract_image(WIMStruct *wim, int image, const tchar *target, + int extract_flags) +{ + if (extract_flags & ~WIMLIB_EXTRACT_MASK_PUBLIC) + return WIMLIB_ERR_INVALID_PARAM; + return do_wimlib_extract_image(wim, image, target, extract_flags); +} diff --git a/src/wimlib/file_io.c b/src/wimlib/file_io.c new file mode 100644 index 00000000..4cd71ec4 --- /dev/null +++ b/src/wimlib/file_io.c @@ -0,0 +1,212 @@ +/* + * file_io.c - Helper functions for reading and writing to file descriptors. + */ + +/* + * Copyright (C) 2013 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <errno.h> +#include <unistd.h> + +#include "wimlib/error.h" +#include "wimlib/file_io.h" +#include "wimlib/util.h" + +#ifdef _WIN32 +# include "wimlib/win32.h" +# define read win32_read +# define write win32_write +# define pread win32_pread +# define pwrite win32_pwrite +#endif + +/* + * Wrapper around read() that checks for errors and keeps retrying until all + * requested bytes have been read or until end-of file has occurred. + * + * Return values: + * WIMLIB_ERR_SUCCESS (0) + * WIMLIB_ERR_READ (errno set) + * WIMLIB_ERR_UNEXPECTED_END_OF_FILE (errno set to EINVAL) + */ +int +full_read(struct filedes *fd, void *buf, size_t count) +{ + while (count) { + ssize_t ret = read(fd->fd, buf, count); + if (unlikely(ret <= 0)) { + if (ret == 0) { + errno = EINVAL; + return WIMLIB_ERR_UNEXPECTED_END_OF_FILE; + } + if (errno == EINTR) + continue; + return WIMLIB_ERR_READ; + } + buf += ret; + count -= ret; + fd->offset += ret; + } + return 0; +} + +static int +pipe_read(struct filedes *fd, void *buf, size_t count, off_t offset) +{ + int ret; + + /* Verify the offset. */ + if (offset < fd->offset) { + ERROR("Can't seek backwards in pipe " + "(offset %"PRIu64" => %"PRIu64").\n" + " Make sure the WIM was captured as " + "pipable.", fd->offset, offset); + errno = ESPIPE; + return WIMLIB_ERR_RESOURCE_ORDER; + } + + /* Manually seek to the requested position. */ + while (fd->offset != offset) { + size_t bytes_to_read = min(offset - fd->offset, BUFFER_SIZE); + u8 dummy[bytes_to_read]; + + ret = full_read(fd, dummy, bytes_to_read); + if (ret) + return ret; + } + + /* Do the actual read. */ + return full_read(fd, buf, count); +} + +/* + * Wrapper around pread() that checks for errors and keeps retrying until all + * requested bytes have been read or until end-of file has occurred. This also + * transparently handle reading from pipe files, but the caller needs to be sure + * the requested offset is greater than or equal to the current offset, or else + * WIMLIB_ERR_RESOURCE_ORDER will be returned. + * + * Return values: + * WIMLIB_ERR_SUCCESS (0) + * WIMLIB_ERR_READ (errno set) + * WIMLIB_ERR_UNEXPECTED_END_OF_FILE (errno set to EINVAL) + * WIMLIB_ERR_RESOURCE_ORDER (errno set to ESPIPE) + */ +int +full_pread(struct filedes *fd, void *buf, size_t count, off_t offset) +{ + if (fd->is_pipe) + goto is_pipe; + + while (count) { + ssize_t ret = pread(fd->fd, buf, count, offset); + if (unlikely(ret <= 0)) { + if (ret == 0) { + errno = EINVAL; + return WIMLIB_ERR_UNEXPECTED_END_OF_FILE; + } + if (errno == EINTR) + continue; + if (errno == ESPIPE) { + fd->is_pipe = 1; + goto is_pipe; + } + return WIMLIB_ERR_READ; + } + buf += ret; + count -= ret; + offset += ret; + } + return 0; + +is_pipe: + return pipe_read(fd, buf, count, offset); +} + +/* + * Wrapper around write() that checks for errors and keeps retrying until all + * requested bytes have been written. + * + * Return values: + * WIMLIB_ERR_SUCCESS (0) + * WIMLIB_ERR_WRITE (errno set) + */ +int +full_write(struct filedes *fd, const void *buf, size_t count) +{ + while (count) { + ssize_t ret = write(fd->fd, buf, count); + if (unlikely(ret < 0)) { + if (errno == EINTR) + continue; + return WIMLIB_ERR_WRITE; + } + buf += ret; + count -= ret; + fd->offset += ret; + } + return 0; +} + + +/* + * Wrapper around pwrite() that checks for errors and keeps retrying until all + * requested bytes have been written. + * + * Return values: + * WIMLIB_ERR_SUCCESS (0) + * WIMLIB_ERR_WRITE (errno set) + */ +int +full_pwrite(struct filedes *fd, const void *buf, size_t count, off_t offset) +{ + while (count) { + ssize_t ret = pwrite(fd->fd, buf, count, offset); + if (unlikely(ret < 0)) { + if (errno == EINTR) + continue; + return WIMLIB_ERR_WRITE; + } + buf += ret; + count -= ret; + offset += ret; + } + return 0; +} + +off_t filedes_seek(struct filedes *fd, off_t offset) +{ + if (fd->is_pipe) { + errno = ESPIPE; + return -1; + } + if (fd->offset != offset) { + if (lseek(fd->fd, offset, SEEK_SET) == -1) + return -1; + fd->offset = offset; + } + return offset; +} + +bool filedes_is_seekable(struct filedes *fd) +{ + return !fd->is_pipe && lseek(fd->fd, 0, SEEK_CUR) != -1; +} diff --git a/src/wimlib/header.c b/src/wimlib/header.c new file mode 100644 index 00000000..1a476900 --- /dev/null +++ b/src/wimlib/header.c @@ -0,0 +1,293 @@ +/* + * header.c + * + * Read, write, or print a WIM header. + */ + +/* + * Copyright 2012-2023 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <ctype.h> +#include <stdio.h> +#include <string.h> +#include <unistd.h> + +#include "wimlib.h" +#include "wimlib/alloca.h" +#include "wimlib/assert.h" +#include "wimlib/endianness.h" +#include "wimlib/error.h" +#include "wimlib/file_io.h" +#include "wimlib/header.h" +#include "wimlib/util.h" +#include "wimlib/wim.h" + +/* + * Reads the header from a WIM file. + * + * @wim + * WIM to read the header from. @wim->in_fd must be positioned at the + * beginning of the file. + * + * @hdr + * Structure to read the header into. + * + * Return values: + * WIMLIB_ERR_SUCCESS (0) + * WIMLIB_ERR_IMAGE_COUNT + * WIMLIB_ERR_INVALID_PART_NUMBER + * WIMLIB_ERR_NOT_A_WIM_FILE + * WIMLIB_ERR_READ + * WIMLIB_ERR_UNEXPECTED_END_OF_FILE + * WIMLIB_ERR_UNKNOWN_VERSION + */ +int +read_wim_header(WIMStruct *wim, struct wim_header *hdr) +{ + struct wim_header_disk disk_hdr __attribute__((aligned(8))); + struct filedes *in_fd = &wim->in_fd; + const tchar *filename = wim->filename; + int ret; + tchar *pipe_str; + + wimlib_assert(in_fd->offset == 0); + + if (filename == NULL) { + pipe_str = alloca(40); + tsprintf(pipe_str, T("[fd %d]"), in_fd->fd); + filename = pipe_str; + } + + STATIC_ASSERT(sizeof(struct wim_header_disk) == WIM_HEADER_DISK_SIZE); + + ret = full_read(in_fd, &disk_hdr, sizeof(disk_hdr)); + if (ret) + goto read_error; + + hdr->magic = le64_to_cpu(disk_hdr.magic); + + if (hdr->magic != WIM_MAGIC) { + if (hdr->magic == PWM_MAGIC) { + /* Pipable WIM: Use header at end instead, unless + * actually reading from a pipe. */ + if (!in_fd->is_pipe) { + ret = WIMLIB_ERR_READ; + if (-1 == lseek(in_fd->fd, -WIM_HEADER_DISK_SIZE, SEEK_END)) + goto read_error; + ret = full_read(in_fd, &disk_hdr, sizeof(disk_hdr)); + if (ret) + goto read_error; + } + } else { + ERROR("\"%"TS"\": Invalid magic characters in header", filename); + return WIMLIB_ERR_NOT_A_WIM_FILE; + } + } + + if (le32_to_cpu(disk_hdr.hdr_size) != sizeof(struct wim_header_disk)) { + ERROR("\"%"TS"\": Header size is invalid (%u bytes)", + filename, le32_to_cpu(disk_hdr.hdr_size)); + return WIMLIB_ERR_INVALID_HEADER; + } + + hdr->wim_version = le32_to_cpu(disk_hdr.wim_version); + if (hdr->wim_version != WIM_VERSION_DEFAULT && + hdr->wim_version != WIM_VERSION_SOLID) + { + ERROR("\"%"TS"\": Unknown WIM version: %u", + filename, hdr->wim_version); + return WIMLIB_ERR_UNKNOWN_VERSION; + } + + hdr->flags = le32_to_cpu(disk_hdr.wim_flags); + hdr->chunk_size = le32_to_cpu(disk_hdr.chunk_size); + copy_guid(hdr->guid, disk_hdr.guid); + hdr->part_number = le16_to_cpu(disk_hdr.part_number); + hdr->total_parts = le16_to_cpu(disk_hdr.total_parts); + + if (hdr->total_parts == 0 || hdr->part_number == 0 || + hdr->part_number > hdr->total_parts) + { + ERROR("\"%"TS"\": Invalid WIM part number: %hu of %hu", + filename, hdr->part_number, hdr->total_parts); + return WIMLIB_ERR_INVALID_PART_NUMBER; + } + + hdr->image_count = le32_to_cpu(disk_hdr.image_count); + + if (unlikely(hdr->image_count > MAX_IMAGES)) { + ERROR("\"%"TS"\": Invalid image count (%u)", + filename, hdr->image_count); + return WIMLIB_ERR_IMAGE_COUNT; + } + + get_wim_reshdr(&disk_hdr.blob_table_reshdr, &hdr->blob_table_reshdr); + get_wim_reshdr(&disk_hdr.xml_data_reshdr, &hdr->xml_data_reshdr); + get_wim_reshdr(&disk_hdr.boot_metadata_reshdr, &hdr->boot_metadata_reshdr); + hdr->boot_idx = le32_to_cpu(disk_hdr.boot_idx); + get_wim_reshdr(&disk_hdr.integrity_table_reshdr, &hdr->integrity_table_reshdr); + + /* + * Prevent huge memory allocations when processing fuzzed files. The + * blob table, XML data, and integrity table are all uncompressed, so + * they should never be larger than the WIM file itself. + */ + if (wim->file_size > 0 && + (hdr->blob_table_reshdr.uncompressed_size > wim->file_size || + hdr->xml_data_reshdr.uncompressed_size > wim->file_size || + hdr->integrity_table_reshdr.uncompressed_size > wim->file_size)) + return WIMLIB_ERR_INVALID_HEADER; + + return 0; + +read_error: + ERROR_WITH_ERRNO("\"%"TS"\": Error reading header", filename); + return ret; +} + +/* Writes the header for a WIM file at the specified offset. If the offset + * specified is the current one, the position is advanced by the size of the + * header. */ +int +write_wim_header(const struct wim_header *hdr, struct filedes *out_fd, + off_t offset) +{ + struct wim_header_disk disk_hdr __attribute__((aligned(8))); + int ret; + + disk_hdr.magic = cpu_to_le64(hdr->magic); + disk_hdr.hdr_size = cpu_to_le32(sizeof(struct wim_header_disk)); + disk_hdr.wim_version = cpu_to_le32(hdr->wim_version); + disk_hdr.wim_flags = cpu_to_le32(hdr->flags); + disk_hdr.chunk_size = cpu_to_le32(hdr->chunk_size); + copy_guid(disk_hdr.guid, hdr->guid); + disk_hdr.part_number = cpu_to_le16(hdr->part_number); + disk_hdr.total_parts = cpu_to_le16(hdr->total_parts); + disk_hdr.image_count = cpu_to_le32(hdr->image_count); + put_wim_reshdr(&hdr->blob_table_reshdr, &disk_hdr.blob_table_reshdr); + put_wim_reshdr(&hdr->xml_data_reshdr, &disk_hdr.xml_data_reshdr); + put_wim_reshdr(&hdr->boot_metadata_reshdr, &disk_hdr.boot_metadata_reshdr); + disk_hdr.boot_idx = cpu_to_le32(hdr->boot_idx); + put_wim_reshdr(&hdr->integrity_table_reshdr, &disk_hdr.integrity_table_reshdr); + memset(disk_hdr.unused, 0, sizeof(disk_hdr.unused)); + + if (offset == out_fd->offset) + ret = full_write(out_fd, &disk_hdr, sizeof(disk_hdr)); + else + ret = full_pwrite(out_fd, &disk_hdr, sizeof(disk_hdr), offset); + if (ret) + ERROR_WITH_ERRNO("Failed to write WIM header"); + return ret; +} + +/* Update just the wim_flags field. */ +int +write_wim_header_flags(u32 hdr_flags, struct filedes *out_fd) +{ + le32 flags = cpu_to_le32(hdr_flags); + + return full_pwrite(out_fd, &flags, sizeof(flags), + offsetof(struct wim_header_disk, wim_flags)); +} + +static const struct { + u32 flag; + const char *name; +} hdr_flags[] = { + {WIM_HDR_FLAG_RESERVED, "RESERVED"}, + {WIM_HDR_FLAG_COMPRESSION, "COMPRESSION"}, + {WIM_HDR_FLAG_READONLY, "READONLY"}, + {WIM_HDR_FLAG_SPANNED, "SPANNED"}, + {WIM_HDR_FLAG_RESOURCE_ONLY, "RESOURCE_ONLY"}, + {WIM_HDR_FLAG_METADATA_ONLY, "METADATA_ONLY"}, + {WIM_HDR_FLAG_WRITE_IN_PROGRESS,"WRITE_IN_PROGRESS"}, + {WIM_HDR_FLAG_RP_FIX, "RP_FIX"}, + {WIM_HDR_FLAG_COMPRESS_RESERVED,"COMPRESS_RESERVED"}, + {WIM_HDR_FLAG_COMPRESS_LZX, "COMPRESS_LZX"}, + {WIM_HDR_FLAG_COMPRESS_XPRESS, "COMPRESS_XPRESS"}, + {WIM_HDR_FLAG_COMPRESS_LZMS, "COMPRESS_LZMS"}, + {WIM_HDR_FLAG_COMPRESS_XPRESS_2,"COMPRESS_XPRESS_2"}, +}; + +/* API function documented in wimlib.h */ +WIMLIBAPI void +wimlib_print_header(const WIMStruct *wim) +{ + const struct wim_header *hdr = &wim->hdr; + + tprintf(T("Magic Characters = ")); + for (int i = 0; i < sizeof(hdr->magic); i++) { + tchar c = (u8)(hdr->magic >> ((8 * i))); + if (istalpha(c)) + tputchar(c); + else + tprintf(T("\\%o"), c); + } + tputchar(T('\n')); + tprintf(T("Header Size = %u\n"), WIM_HEADER_DISK_SIZE); + tprintf(T("Version = 0x%x\n"), hdr->wim_version); + + tprintf(T("Flags = 0x%x\n"), hdr->flags); + for (size_t i = 0; i < ARRAY_LEN(hdr_flags); i++) + if (hdr_flags[i].flag & hdr->flags) + tprintf(T(" WIM_HDR_FLAG_%s is set\n"), hdr_flags[i].name); + + tprintf(T("Chunk Size = %u\n"), hdr->chunk_size); + tfputs (T("GUID = "), stdout); + print_byte_field(hdr->guid, GUID_SIZE, stdout); + tputchar(T('\n')); + tprintf(T("Part Number = %hu\n"), hdr->part_number); + tprintf(T("Total Parts = %hu\n"), hdr->total_parts); + tprintf(T("Image Count = %u\n"), hdr->image_count); + tprintf(T("Blob Table Size = %"PRIu64"\n"), + (u64)hdr->blob_table_reshdr.size_in_wim); + tprintf(T("Blob Table Flags = 0x%hhx\n"), + (u8)hdr->blob_table_reshdr.flags); + tprintf(T("Blob Table Offset = %"PRIu64"\n"), + hdr->blob_table_reshdr.offset_in_wim); + tprintf(T("Blob Table Original_size = %"PRIu64"\n"), + hdr->blob_table_reshdr.uncompressed_size); + tprintf(T("XML Data Size = %"PRIu64"\n"), + (u64)hdr->xml_data_reshdr.size_in_wim); + tprintf(T("XML Data Flags = 0x%hhx\n"), + (u8)hdr->xml_data_reshdr.flags); + tprintf(T("XML Data Offset = %"PRIu64"\n"), + hdr->xml_data_reshdr.offset_in_wim); + tprintf(T("XML Data Original Size = %"PRIu64"\n"), + hdr->xml_data_reshdr.uncompressed_size); + tprintf(T("Boot Metadata Size = %"PRIu64"\n"), + (u64)hdr->boot_metadata_reshdr.size_in_wim); + tprintf(T("Boot Metadata Flags = 0x%hhx\n"), + (u8)hdr->boot_metadata_reshdr.flags); + tprintf(T("Boot Metadata Offset = %"PRIu64"\n"), + hdr->boot_metadata_reshdr.offset_in_wim); + tprintf(T("Boot Metadata Original Size = %"PRIu64"\n"), + hdr->boot_metadata_reshdr.uncompressed_size); + tprintf(T("Boot Index = %u\n"), hdr->boot_idx); + tprintf(T("Integrity Size = %"PRIu64"\n"), + (u64)hdr->integrity_table_reshdr.size_in_wim); + tprintf(T("Integrity Flags = 0x%hhx\n"), + (u8)hdr->integrity_table_reshdr.flags); + tprintf(T("Integrity Offset = %"PRIu64"\n"), + hdr->integrity_table_reshdr.offset_in_wim); + tprintf(T("Integrity Original_size = %"PRIu64"\n"), + hdr->integrity_table_reshdr.uncompressed_size); +} diff --git a/src/wimlib/inode.c b/src/wimlib/inode.c new file mode 100644 index 00000000..40fe5679 --- /dev/null +++ b/src/wimlib/inode.c @@ -0,0 +1,640 @@ +/* + * inode.c + * + * Functions that operate on WIM inodes. + * + * See dentry.c for a description of the relationship between WIM dentries and + * WIM inodes. + */ + +/* + * Copyright (C) 2012-2018 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <errno.h> + +#include "wimlib/assert.h" +#include "wimlib/blob_table.h" +#include "wimlib/dentry.h" +#include "wimlib/encoding.h" +#include "wimlib/error.h" +#include "wimlib/inode.h" +#include "wimlib/timestamp.h" + +/* + * The 'stream_name' field of unnamed streams always points to this array, which + * is an empty UTF-16 string. + */ +const utf16lechar NO_STREAM_NAME[1]; + +/* Allocate a new inode and associate the specified dentry with it. */ +struct wim_inode * +new_inode(struct wim_dentry *dentry, bool set_timestamps) +{ + struct wim_inode *inode; + + inode = CALLOC(1, sizeof(struct wim_inode)); + if (!inode) + return NULL; + + inode->i_security_id = -1; + /*inode->i_nlink = 0;*/ + inode->i_rp_flags = WIM_RP_FLAG_NOT_FIXED; + INIT_HLIST_HEAD(&inode->i_alias_list); + inode->i_streams = inode->i_embedded_streams; + if (set_timestamps) { + u64 now = now_as_wim_timestamp(); + inode->i_creation_time = now; + inode->i_last_access_time = now; + inode->i_last_write_time = now; + } + d_associate(dentry, inode); + return inode; +} + +static inline void +destroy_stream(struct wim_inode_stream *strm) +{ + if (strm->stream_name != NO_STREAM_NAME) + FREE(strm->stream_name); +} + +static void +free_inode(struct wim_inode *inode) +{ + for (unsigned i = 0; i < inode->i_num_streams; i++) + destroy_stream(&inode->i_streams[i]); + if (inode->i_streams != inode->i_embedded_streams) + FREE(inode->i_streams); + if (inode->i_extra) + FREE(inode->i_extra); + if (!hlist_unhashed(&inode->i_hlist_node)) + hlist_del(&inode->i_hlist_node); + FREE(inode); +} + +static inline void +free_inode_if_unneeded(struct wim_inode *inode) +{ + if (inode->i_nlink) + return; +#ifdef WITH_FUSE + if (inode->i_num_opened_fds) + return; +#endif + free_inode(inode); +} + +/* Associate a dentry with the specified inode. */ +void +d_associate(struct wim_dentry *dentry, struct wim_inode *inode) +{ + wimlib_assert(!dentry->d_inode); + + hlist_add_head(&dentry->d_alias_node, &inode->i_alias_list); + dentry->d_inode = inode; + inode->i_nlink++; +} + +/* Disassociate a dentry from its inode, if any. Following this, free the inode + * if it is no longer in use. */ +void +d_disassociate(struct wim_dentry *dentry) +{ + struct wim_inode *inode = dentry->d_inode; + + if (unlikely(!inode)) + return; + + wimlib_assert(inode->i_nlink > 0); + + hlist_del(&dentry->d_alias_node); + dentry->d_inode = NULL; + inode->i_nlink--; + + free_inode_if_unneeded(inode); +} + +#ifdef WITH_FUSE +void +inode_dec_num_opened_fds(struct wim_inode *inode) +{ + wimlib_assert(inode->i_num_opened_fds > 0); + + if (--inode->i_num_opened_fds == 0) { + /* The last file descriptor to this inode was closed. */ + FREE(inode->i_fds); + inode->i_fds = NULL; + inode->i_num_allocated_fds = 0; + + free_inode_if_unneeded(inode); + } +} +#endif + +/* + * Retrieve a stream of an inode. + * + * @inode + * The inode from which the stream is desired + * @stream_type + * The type of the stream desired + * @stream_name + * The name of the stream desired as a null-terminated UTF-16LE string, or + * NO_STREAM_NAME if an unnamed stream is desired + * + * Returns a pointer to the stream if found, otherwise NULL. + */ +struct wim_inode_stream * +inode_get_stream(const struct wim_inode *inode, int stream_type, + const utf16lechar *stream_name) +{ + if (stream_name == NO_STREAM_NAME) /* Optimization */ + return inode_get_unnamed_stream(inode, stream_type); + + for (unsigned i = 0; i < inode->i_num_streams; i++) { + struct wim_inode_stream *strm = &inode->i_streams[i]; + if (strm->stream_type == stream_type && + !cmp_utf16le_strings_z(strm->stream_name, stream_name, + default_ignore_case)) + { + return strm; + } + } + return NULL; +} + +/* + * This is equivalent to inode_get_stream(inode, stream_type, NO_STREAM_NAME), + * but this optimizes for the unnamed case by not doing full string comparisons. + */ +struct wim_inode_stream * +inode_get_unnamed_stream(const struct wim_inode *inode, int stream_type) +{ + for (unsigned i = 0; i < inode->i_num_streams; i++) { + struct wim_inode_stream *strm = &inode->i_streams[i]; + if (strm->stream_type == stream_type && + strm->stream_name == NO_STREAM_NAME) + { + return strm; + } + } + return NULL; +} + + +static void +inode_set_stream_blob(struct wim_inode *inode, struct wim_inode_stream *strm, + struct blob_descriptor *new_blob) +{ + strm->_stream_blob = new_blob; + strm->stream_resolved = 1; + if (new_blob) + new_blob->refcnt += inode->i_nlink; +} + +static void +inode_unset_stream_blob(struct wim_inode *inode, struct wim_inode_stream *strm, + struct blob_table *blob_table) +{ + struct blob_descriptor *old_blob; + + old_blob = stream_blob(strm, blob_table); + if (old_blob) + blob_subtract_refcnt(old_blob, blob_table, inode->i_nlink); + strm->_stream_blob = NULL; + strm->stream_resolved = 1; +} + +/* + * Replace the blob associated with the specified stream. + * + * @inode + * The inode containing @strm + * @strm + * The stream whose data needs to be replaced + * @new_blob + * The new blob descriptor to assign + * @blob_table + * Pointer to the blob table in which data blobs are being indexed + */ +void +inode_replace_stream_blob(struct wim_inode *inode, + struct wim_inode_stream *strm, + struct blob_descriptor *new_blob, + struct blob_table *blob_table) +{ + inode_unset_stream_blob(inode, strm, blob_table); + inode_set_stream_blob(inode, strm, new_blob); +} + +/* + * Add a new stream to the specified inode. + * + * @inode + * The inode to which to add the stream + * @stream_type + * The type of the stream being added + * @stream_name + * The name of the stream being added as a null-terminated UTF-16LE string, + * or NO_STREAM_NAME if the stream is unnamed + * @blob + * The blob that the new stream will initially reference, or NULL + * + * Returns a pointer to the new stream, or NULL with errno set if it could not + * be added. + */ +struct wim_inode_stream * +inode_add_stream(struct wim_inode *inode, int stream_type, + const utf16lechar *stream_name, struct blob_descriptor *blob) +{ + if (inode->i_num_streams >= 0xFFFF) { + ERROR("Inode has too many streams! Path=\"%"TS"\"", + inode_any_full_path(inode)); + errno = EFBIG; + return NULL; + } + + struct wim_inode_stream *streams; + struct wim_inode_stream *new_strm; + + if (inode->i_streams == inode->i_embedded_streams) { + if (inode->i_num_streams < ARRAY_LEN(inode->i_embedded_streams)) { + streams = inode->i_embedded_streams; + } else { + streams = MALLOC((inode->i_num_streams + 1) * + sizeof(inode->i_streams[0])); + if (!streams) + return NULL; + memcpy(streams, inode->i_streams, + (inode->i_num_streams * + sizeof(inode->i_streams[0]))); + inode->i_streams = streams; + } + } else { + streams = REALLOC(inode->i_streams, + (inode->i_num_streams + 1) * + sizeof(inode->i_streams[0])); + if (!streams) + return NULL; + inode->i_streams = streams; + } + new_strm = &streams[inode->i_num_streams]; + + memset(new_strm, 0, sizeof(*new_strm)); + + new_strm->stream_type = stream_type; + if (!*stream_name) { + /* Unnamed stream */ + new_strm->stream_name = (utf16lechar *)NO_STREAM_NAME; + } else { + /* Named stream */ + new_strm->stream_name = utf16le_dup(stream_name); + if (!new_strm->stream_name) + return NULL; + } + + new_strm->stream_id = inode->i_next_stream_id++; + + inode_set_stream_blob(inode, new_strm, blob); + + inode->i_num_streams++; + + return new_strm; +} + +/* + * Replace the data of the specified stream. + * + * @inode + * The inode containing @strm + * @strm + * The stream whose data needs to be replaced + * @data + * The buffer of data to assign to the stream + * @size + * Size of the @data buffer, in bytes + * @blob_table + * Pointer to the blob table in which data blobs are being indexed + * + * Returns true if successful; false with errno set if unsuccessful. + */ +bool +inode_replace_stream_data(struct wim_inode *inode, + struct wim_inode_stream *strm, + const void *data, size_t size, + struct blob_table *blob_table) +{ + struct blob_descriptor *new_blob = NULL; + + if (size) { + new_blob = new_blob_from_data_buffer(data, size, blob_table); + if (!new_blob) + return false; + } + + inode_replace_stream_blob(inode, strm, new_blob, blob_table); + return true; +} + +/* + * Add a new stream to the specified inode and assign it the specified data. + * + * @inode + * The inode to which to add the stream + * @stream_type + * The type of the stream being added + * @stream_name + * The name of the stream being added as a null-terminated UTF-16LE string, + * or NO_STREAM_NAME if the stream is unnamed + * @data + * The buffer of data to assign to the new stream + * @size + * Size of the @data buffer, in bytes + * @blob_table + * Pointer to the blob table in which data blobs are being indexed + * + * Returns true if successful; false with errno set if unsuccessful. + */ +bool +inode_add_stream_with_data(struct wim_inode *inode, + int stream_type, const utf16lechar *stream_name, + const void *data, size_t size, + struct blob_table *blob_table) +{ + struct wim_inode_stream *strm; + struct blob_descriptor *blob = NULL; + + strm = inode_add_stream(inode, stream_type, stream_name, NULL); + if (!strm) + return false; + + if (size) { + blob = new_blob_from_data_buffer(data, size, blob_table); + if (unlikely(!blob)) { + inode_remove_stream(inode, strm, blob_table); + return false; + } + } + + inode_set_stream_blob(inode, strm, blob); + return true; +} + +/* + * Remove a stream from the specified inode. + * + * This handles releasing the references to the blob descriptor, if any. + */ +void +inode_remove_stream(struct wim_inode *inode, struct wim_inode_stream *strm, + struct blob_table *blob_table) +{ + unsigned idx = strm - inode->i_streams; + + wimlib_assert(idx < inode->i_num_streams); + + inode_unset_stream_blob(inode, strm, blob_table); + + destroy_stream(strm); + + memmove(strm, strm + 1, + (inode->i_num_streams - idx - 1) * sizeof(inode->i_streams[0])); + inode->i_num_streams--; +} + +/* Returns true iff the specified inode has at least one named data stream. */ +bool +inode_has_named_data_stream(const struct wim_inode *inode) +{ + for (unsigned i = 0; i < inode->i_num_streams; i++) + if (stream_is_named_data_stream(&inode->i_streams[i])) + return true; + return false; +} + +/* + * Resolve an inode's streams. + * + * For each stream, this replaces the SHA-1 message digest of the blob data with + * a pointer to the 'struct blob_descriptor' for the blob. Blob descriptors are + * looked up in @table. + * + * If @force is %false: + * If any of the needed blobs do not exist in @table, return + * WIMLIB_ERR_RESOURCE_NOT_FOUND. + * If @force is %true: + * If any of the needed blobs do not exist in @table, allocate new blob + * descriptors for them and insert them into @table. This does not, of + * course, cause the data of these blobs to magically exist, but this is + * needed by the code for extraction from a pipe. + * + * Returns 0 on success; WIMLIB_ERR_NOMEM if out of memory; or + * WIMLIB_ERR_RESOURCE_NOT_FOUND if @force is %false and at least one blob + * referenced by the inode was missing. + */ +int +inode_resolve_streams(struct wim_inode *inode, struct blob_table *table, + bool force) +{ + for (unsigned i = 0; i < inode->i_num_streams; i++) { + struct wim_inode_stream *strm = &inode->i_streams[i]; + + if (strm->stream_resolved) + continue; + + const u8 *hash = stream_hash(strm); + struct blob_descriptor *blob = NULL; + + if (!is_zero_hash(hash)) { + blob = lookup_blob(table, hash); + if (!blob) { + if (!force) + return blob_not_found_error(inode, hash); + blob = new_blob_descriptor(); + if (!blob) + return WIMLIB_ERR_NOMEM; + copy_hash(blob->hash, hash); + blob_table_insert(table, blob); + } + } + strm->_stream_blob = blob; + strm->stream_resolved = 1; + } + return 0; +} + +int +blob_not_found_error(const struct wim_inode *inode, const u8 *hash) +{ + if (wimlib_print_errors) { + tchar hashstr[SHA1_HASH_STRING_LEN]; + + sprint_hash(hash, hashstr); + + ERROR("\"%"TS"\": blob not found\n" + " SHA-1 message digest of missing blob:\n" + " %"TS"", + inode_any_full_path(inode), hashstr); + } + return WIMLIB_ERR_RESOURCE_NOT_FOUND; +} + +/* + * Return the blob descriptor for the specified stream, or NULL if the stream is + * empty or its blob is not available in @table. + */ +struct blob_descriptor * +stream_blob(const struct wim_inode_stream *strm, const struct blob_table *table) +{ + if (strm->stream_resolved) + return strm->_stream_blob; + else + return lookup_blob(table, strm->_stream_hash); +} + +/* + * Return the SHA-1 message digest of the data of the specified stream, or a + * void SHA-1 of all zeroes if the specified stream is empty, or NULL if the + * specified stream is unhashed. (Most callers ensure the stream cannot be + * unhashed.) + */ +const u8 * +stream_hash(const struct wim_inode_stream *strm) +{ + if (!strm->stream_resolved) + return strm->_stream_hash; + + if (!strm->_stream_blob) + return zero_hash; + + if (strm->_stream_blob->unhashed) + return NULL; + + return strm->_stream_blob->hash; +} + +/* + * Return the blob descriptor for the unnamed data stream of the inode, or NULL + * if the inode does not have an unnamed data stream, the inode's unnamed data + * stream is empty, or the blob for the inode's unnamed data stream is not + * available in @blob_table. + */ +struct blob_descriptor * +inode_get_blob_for_unnamed_data_stream(const struct wim_inode *inode, + const struct blob_table *blob_table) +{ + const struct wim_inode_stream *strm; + + strm = inode_get_unnamed_data_stream(inode); + if (!strm) + return NULL; + + return stream_blob(strm, blob_table); +} + +/* Like inode_get_blob_for_unnamed_data_stream(), but assumes the unnamed data + * stream is resolved. */ +struct blob_descriptor * +inode_get_blob_for_unnamed_data_stream_resolved(const struct wim_inode *inode) +{ + const struct wim_inode_stream *strm; + + strm = inode_get_unnamed_data_stream(inode); + if (!strm) + return NULL; + + return stream_blob_resolved(strm); +} + +/* + * Return the SHA-1 message digest of the unnamed data stream of the inode, or a + * void SHA-1 of all zeroes if the inode does not have an unnamed data stream or + * if the inode's unnamed data stream is empty, or NULL if the inode's unnamed + * data stream is unhashed. (Most callers ensure the stream cannot be + * unhashed.) + */ +const u8 * +inode_get_hash_of_unnamed_data_stream(const struct wim_inode *inode) +{ + const struct wim_inode_stream *strm; + + strm = inode_get_unnamed_data_stream(inode); + if (!strm) + return zero_hash; + + return stream_hash(strm); +} + +/* Acquire another reference to each blob referenced by this inode. This is + * necessary when creating a hard link to this inode. + * + * All streams of the inode must be resolved. */ +void +inode_ref_blobs(struct wim_inode *inode) +{ + for (unsigned i = 0; i < inode->i_num_streams; i++) { + struct blob_descriptor *blob; + + blob = stream_blob_resolved(&inode->i_streams[i]); + if (blob) + blob->refcnt++; + } +} + +/* Release a reference to each blob referenced by this inode. This is necessary + * when deleting a hard link to this inode. */ +void +inode_unref_blobs(struct wim_inode *inode, struct blob_table *blob_table) +{ + for (unsigned i = 0; i < inode->i_num_streams; i++) { + struct blob_descriptor *blob; + + blob = stream_blob(&inode->i_streams[i], blob_table); + if (blob) + blob_decrement_refcnt(blob, blob_table); + } +} + +/* + * Given a blob descriptor, return a pointer to the pointer contained in the + * stream that references it. + * + * This is only possible for "unhashed" blobs, which are guaranteed to have only + * one referencing stream, and that reference is guaranteed to be in a resolved + * stream. (It can't be in an unresolved stream, since that would imply the + * hash is known!) + */ +struct blob_descriptor ** +retrieve_pointer_to_unhashed_blob(struct blob_descriptor *blob) +{ + wimlib_assert(blob->unhashed); + + struct wim_inode *inode = blob->back_inode; + for (unsigned i = 0; i < inode->i_num_streams; i++) { + if (inode->i_streams[i].stream_id == blob->back_stream_id) { + wimlib_assert(inode->i_streams[i]._stream_blob == blob); + return &inode->i_streams[i]._stream_blob; + } + } + + wimlib_assert(0); + return NULL; +} diff --git a/src/wimlib/inode_fixup.c b/src/wimlib/inode_fixup.c new file mode 100644 index 00000000..f507c987 --- /dev/null +++ b/src/wimlib/inode_fixup.c @@ -0,0 +1,202 @@ +/* + * inode_fixup.c + */ + +/* + * Copyright (C) 2012, 2013, 2014 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/dentry.h" +#include "wimlib/error.h" +#include "wimlib/inode.h" +#include "wimlib/inode_table.h" + +struct inode_fixup_params { + struct wim_inode_table inode_table; + unsigned long num_dir_hard_links; + unsigned long num_inconsistent_inodes; +}; + +#define MAX_DIR_HARD_LINK_WARNINGS 8 + +static bool +inodes_consistent(const struct wim_inode *inode_1, + const struct wim_inode *inode_2) +{ + /* This certainly isn't the only thing we need to check to make sure the + * inodes are consistent. However, this seems to be the only thing that + * the MS implementation checks when working around its own bug. + * + * (Tested: If two dentries share the same hard link group ID, Windows + * 8.1 DISM will link them if they have the same unnamed stream hash, + * even if the dentries provide different timestamps, attributes, + * alternate data streams, and security IDs! And the one that gets used + * will change if you merely swap the filenames. But if you use + * different unnamed stream hashes with everything else the same, it + * doesn't link the dentries.) + * + * For non-buggy WIMs this function will always return true. */ + return hashes_equal(inode_get_hash_of_unnamed_data_stream(inode_1), + inode_get_hash_of_unnamed_data_stream(inode_2)); +} + +static int +inode_table_insert(struct wim_dentry *dentry, void *_params) +{ + struct inode_fixup_params *params = _params; + struct wim_inode_table *table = &params->inode_table; + struct wim_inode *d_inode = dentry->d_inode; + size_t pos; + struct wim_inode *inode; + + if (d_inode->i_ino == 0) { + hlist_add_head(&d_inode->i_hlist_node, &table->extra_inodes); + return 0; + } + + /* Try adding this dentry to an existing inode. */ + pos = hash_inode(table, d_inode->i_ino, 0); + hlist_for_each_entry(inode, &table->array[pos], i_hlist_node) { + if (inode->i_ino != d_inode->i_ino) { + continue; + } + if (unlikely(!inodes_consistent(inode, d_inode))) { + params->num_inconsistent_inodes++; + continue; + } + if (unlikely((d_inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY) || + (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY))) + { + params->num_dir_hard_links++; + if (params->num_dir_hard_links <= + MAX_DIR_HARD_LINK_WARNINGS) + { + WARNING("Unsupported directory hard link " + "\"%"TS"\" <=> \"%"TS"\"", + dentry_full_path(dentry), + inode_any_full_path(inode)); + } else if (params->num_dir_hard_links == + MAX_DIR_HARD_LINK_WARNINGS + 1) + { + WARNING("Suppressing additional warnings about " + "directory hard links..."); + } + continue; + } + /* Transfer this dentry to the existing inode. */ + d_disassociate(dentry); + d_associate(dentry, inode); + return 0; + } + + /* Keep this dentry's inode. */ + hlist_add_head(&d_inode->i_hlist_node, &table->array[pos]); + if (++table->filled > table->capacity) + enlarge_inode_table(table); + return 0; +} + +static void +hlist_move_all(struct hlist_head *src, struct hlist_head *dest) +{ + struct hlist_node *node; + + while ((node = src->first) != NULL) { + hlist_del(node); + hlist_add_head(node, dest); + } +} + +/* Move the inodes from the 'struct wim_inode_table' to the 'inode_list'. */ +static void +build_inode_list(struct wim_inode_table *inode_table, + struct hlist_head *inode_list) +{ + hlist_move_all(&inode_table->extra_inodes, inode_list); + for (size_t i = 0; i < inode_table->capacity; i++) + hlist_move_all(&inode_table->array[i], inode_list); +} + +/* Re-assign inode numbers to the inodes in the list. */ +static void +reassign_inode_numbers(struct hlist_head *inode_list) +{ + struct wim_inode *inode; + u64 cur_ino = 1; + + hlist_for_each_entry(inode, inode_list, i_hlist_node) + inode->i_ino = cur_ino++; +} + +/* + * Given a WIM image's tree of dentries such that each dentry initially + * has a unique inode associated with it, determine the actual + * dentry/inode information. Following this, a single inode may be named + * by more than one dentry (usually called a hard link). + * + * The 'hard_link_group_id' field of the on-disk WIM dentry, which we + * have read into 'i_ino' of each dentry's initial inode, determines + * which dentries share the same inode. Ideally, dentries share the same + * inode if and only if they have the same value in this field. However, + * exceptions apply: + * + * - If 'hard_link_group_id' is 0, the corresponding dentry is the sole + * name for its inode. + * - Due to bugs in the Microsoft implementation, dentries with different + * 'hard_link_group_id' fields may, in fact, need to be interpreted as + * naming different inodes. This seems to mostly affect images in + * install.wim for Windows 7. I try to work around this in the same way + * the Microsoft implementation works around this. + * + * Returns 0 or WIMLIB_ERR_NOMEM. On success, the resulting inodes will be + * appended to the @inode_list, and they will have consistent numbers in their + * i_ino fields. + */ +int +dentry_tree_fix_inodes(struct wim_dentry *root, struct hlist_head *inode_list) +{ + struct inode_fixup_params params; + int ret; + + /* We use a hash table to map inode numbers to inodes. */ + + ret = init_inode_table(&params.inode_table, 64); + if (ret) + return ret; + + params.num_dir_hard_links = 0; + params.num_inconsistent_inodes = 0; + + for_dentry_in_tree(root, inode_table_insert, &params); + + /* Generate the resulting list of inodes, and if needed reassign + * the inode numbers. */ + build_inode_list(&params.inode_table, inode_list); + destroy_inode_table(&params.inode_table); + + if (unlikely(params.num_dir_hard_links)) + WARNING("Ignoring %lu directory hard links", + params.num_dir_hard_links); + + if (unlikely(params.num_inconsistent_inodes || + params.num_dir_hard_links)) + reassign_inode_numbers(inode_list); + return 0; +} diff --git a/src/wimlib/inode_table.c b/src/wimlib/inode_table.c new file mode 100644 index 00000000..f6842f8a --- /dev/null +++ b/src/wimlib/inode_table.c @@ -0,0 +1,192 @@ +/* + * inode_table.c - hard link detection + */ + +/* + * Copyright (C) 2012-2016 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/bitops.h" +#include "wimlib/dentry.h" +#include "wimlib/error.h" +#include "wimlib/inode.h" +#include "wimlib/inode_table.h" +#include "wimlib/list.h" +#include "wimlib/util.h" + +/* Initialize a hash table for hard link detection. */ +int +init_inode_table(struct wim_inode_table *table, size_t capacity) +{ + capacity = roundup_pow_of_2(capacity); + table->array = CALLOC(capacity, sizeof(table->array[0])); + if (!table->array) + return WIMLIB_ERR_NOMEM; + table->filled = 0; + table->capacity = capacity; + INIT_HLIST_HEAD(&table->extra_inodes); + return 0; +} + +/* Free the memory allocated by init_inode_table(). */ +void +destroy_inode_table(struct wim_inode_table *table) +{ + FREE(table->array); +} + +/* Double the capacity of the inode hash table. */ +void +enlarge_inode_table(struct wim_inode_table *table) +{ + const size_t old_capacity = table->capacity; + const size_t new_capacity = old_capacity * 2; + struct hlist_head *old_array = table->array; + struct hlist_head *new_array; + struct wim_inode *inode; + struct hlist_node *tmp; + + new_array = CALLOC(new_capacity, sizeof(struct hlist_head)); + if (!new_array) + return; + table->array = new_array; + table->capacity = new_capacity; + for (size_t i = 0; i < old_capacity; i++) { + hlist_for_each_entry_safe(inode, tmp, &old_array[i], i_hlist_node) { + hlist_add_head(&inode->i_hlist_node, + &new_array[hash_inode(table, inode->i_ino, + inode->i_devno)]); + } + } + FREE(old_array); +} + +/* + * Allocate a new dentry, with hard link detection. + * + * @table + * The inode table being used for the current directory scan operation. It + * will contain the mapping from (ino, devno) pairs to inodes. + * + * @name + * The name to give the new dentry. + * + * @ino + * The inode number of the file, read from the filesystem. + * + * @devno + * The device number of the file, read from the filesystem. Proper setting + * of this parameter prevents cross-device hardlinks from being created. + * If this is not a problem (perhaps because the current directory scan + * operation is guaranteed to never traverse a filesystem boundary), then + * this parameter can just be a fixed value such as 0. + * + * @noshare + * If %true, the new dentry will not be hard linked to any existing inode, + * regardless of the values of @ino and @devno. If %false, normal hard + * link detection will be done. + * + * @dentry_ret + * On success, a pointer to the new dentry will be returned in this + * location. If i_nlink of the dentry's inode is greater than 1, then this + * function created a hard link to an existing inode rather than creating a + * new inode. + * + * On success, returns 0. On failure, returns WIMLIB_ERR_NOMEM or an error code + * resulting from a failed string conversion. + */ +int +inode_table_new_dentry(struct wim_inode_table *table, const tchar *name, + u64 ino, u64 devno, bool noshare, + struct wim_dentry **dentry_ret) +{ + struct wim_dentry *dentry; + struct wim_inode *inode; + struct hlist_head *list; + int ret; + + if (noshare) { + /* No hard link detection */ + list = &table->extra_inodes; + } else { + /* Hard link detection */ + list = &table->array[hash_inode(table, ino, devno)]; + hlist_for_each_entry(inode, list, i_hlist_node) { + if (inode->i_ino != ino || inode->i_devno != devno) + continue; + if (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY) { + WARNING("Not honoring directory hard link " + "of \"%"TS"\"", + inode_any_full_path(inode)); + continue; + } + /* Inode found; use it. */ + return new_dentry_with_existing_inode(name, inode, + dentry_ret); + } + + /* Inode not found; create it. */ + } + + ret = new_dentry_with_new_inode(name, false, &dentry); + if (ret) + return ret; + inode = dentry->d_inode; + inode->i_ino = ino; + inode->i_devno = devno; + hlist_add_head(&inode->i_hlist_node, list); + if (list != &table->extra_inodes) + if (++table->filled > table->capacity) + enlarge_inode_table(table); + *dentry_ret = dentry; + return 0; +} + +/* + * Following the allocation of dentries with hard link detection using + * inode_table_new_dentry(), this function will assign consecutive inode numbers + * to the new set of inodes. It will also append the list of new inodes to the + * list @head, which must contain any inodes already existing in the WIM image. + */ +void +inode_table_prepare_inode_list(struct wim_inode_table *table, + struct hlist_head *head) +{ + struct wim_inode *inode; + struct hlist_node *tmp; + u64 cur_ino = 1; + + /* Re-assign inode numbers in the existing list to avoid duplicates. */ + hlist_for_each_entry(inode, head, i_hlist_node) + inode->i_ino = cur_ino++; + + /* Assign inode numbers to the new inodes and move them to the image's + * inode list. */ + for (size_t i = 0; i < table->capacity; i++) { + hlist_for_each_entry_safe(inode, tmp, &table->array[i], i_hlist_node) { + inode->i_ino = cur_ino++; + hlist_add_head(&inode->i_hlist_node, head); + } + } + hlist_for_each_entry_safe(inode, tmp, &table->extra_inodes, i_hlist_node) { + inode->i_ino = cur_ino++; + hlist_add_head(&inode->i_hlist_node, head); + } +} diff --git a/src/wimlib/integrity.c b/src/wimlib/integrity.c new file mode 100644 index 00000000..47d3244b --- /dev/null +++ b/src/wimlib/integrity.c @@ -0,0 +1,452 @@ +/* + * integrity.c + * + * WIM files can optionally contain a table of SHA1 message digests at the end, + * one digest for each chunk of the file of some specified size (often 10 MB). + * This file implements the checking and writing of this table. + */ + +/* + * Copyright (C) 2012-2016 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/assert.h" +#include "wimlib/endianness.h" +#include "wimlib/error.h" +#include "wimlib/file_io.h" +#include "wimlib/integrity.h" +#include "wimlib/progress.h" +#include "wimlib/resource.h" +#include "wimlib/sha1.h" +#include "wimlib/wim.h" +#include "wimlib/write.h" + +/* Size, in bytes, of each SHA1-summed chunk, when wimlib writes integrity + * information. */ +#define INTEGRITY_CHUNK_SIZE 10485760 + +/* Only use a different chunk size for compatibility with an existing integrity + * table if the chunk size is between these two numbers. */ +#define INTEGRITY_MIN_CHUNK_SIZE 4096 +#define INTEGRITY_MAX_CHUNK_SIZE 134217728 + +struct integrity_table { + u32 size; + u32 num_entries; + u32 chunk_size; + u8 sha1sums[][20]; +} __attribute__((packed)); + +static int +calculate_chunk_sha1(struct filedes *in_fd, size_t this_chunk_size, + off_t offset, u8 sha1_md[]) +{ + u8 buf[BUFFER_SIZE]; + struct sha1_ctx ctx; + size_t bytes_remaining; + size_t bytes_to_read; + int ret; + + bytes_remaining = this_chunk_size; + sha1_init(&ctx); + do { + bytes_to_read = min(bytes_remaining, sizeof(buf)); + ret = full_pread(in_fd, buf, bytes_to_read, offset); + if (ret) { + ERROR_WITH_ERRNO("Read error while calculating " + "integrity checksums"); + return ret; + } + sha1_update(&ctx, buf, bytes_to_read); + bytes_remaining -= bytes_to_read; + offset += bytes_to_read; + } while (bytes_remaining); + sha1_final(&ctx, sha1_md); + return 0; +} + + +/* + * read_integrity_table: - Reads the integrity table from a WIM file. + * + * @wim: + * WIMStruct for the WIM file; @wim->hdr.integrity_table_reshdr specifies + * the location of the integrity table. @wim->in_fd is expected to be a + * seekable file descriptor to the WIM file opened for reading. + * + * @num_checked_bytes: + * Number of bytes of data that should be checked by the integrity table. + * + * @table_ret: + * On success, a pointer to an in-memory structure containing the integrity + * information is written to this location. + * + * Return values: + * WIMLIB_ERR_SUCCESS (0) + * WIMLIB_ERR_INVALID_INTEGRITY_TABLE + * WIMLIB_ERR_NOMEM + * WIMLIB_ERR_READ + * WIMLIB_ERR_UNEXPECTED_END_OF_FILE + */ +int +read_integrity_table(WIMStruct *wim, u64 num_checked_bytes, + struct integrity_table **table_ret) +{ + void *buf; + struct integrity_table *table; + int ret; + + STATIC_ASSERT(sizeof(struct integrity_table) == 12); + if (wim->hdr.integrity_table_reshdr.uncompressed_size < 12) + return WIMLIB_ERR_INVALID_INTEGRITY_TABLE; + + ret = wim_reshdr_to_data(&wim->hdr.integrity_table_reshdr, wim, &buf); + if (ret) + return ret; + table = buf; + + table->size = le32_to_cpu((_force_attr le32)table->size); + table->num_entries = le32_to_cpu((_force_attr le32)table->num_entries); + table->chunk_size = le32_to_cpu((_force_attr le32)table->chunk_size); + + if (table->size != wim->hdr.integrity_table_reshdr.uncompressed_size || + table->size != (u64)table->num_entries * SHA1_HASH_SIZE + 12 || + table->chunk_size == 0 || + table->num_entries != DIV_ROUND_UP(num_checked_bytes, table->chunk_size)) + { + FREE(table); + return WIMLIB_ERR_INVALID_INTEGRITY_TABLE; + } + + *table_ret = table; + return 0; +} + +/* + * calculate_integrity_table(): + * + * Calculates an integrity table for the data in a file beginning at offset 208 + * (WIM_HEADER_DISK_SIZE). + * + * @in_fd: + * File descriptor for the file to be checked, opened for reading. Does + * not need to be at any specific location in the file. + * + * @new_check_end: + * Offset of byte after the last byte to be checked. + * + * @old_table: + * If non-NULL, a pointer to the table containing the previously calculated + * integrity data for a prefix of this file. + * + * @old_check_end: + * If @old_table is non-NULL, the byte after the last byte that was checked + * in the old table. Must be less than or equal to new_check_end. + * + * @integrity_table_ret: + * On success, a pointer to the calculated integrity table is written into + * this location. + * + * Return values: + * WIMLIB_ERR_SUCCESS (0) + * WIMLIB_ERR_NOMEM + * WIMLIB_ERR_READ + * WIMLIB_ERR_UNEXPECTED_END_OF_FILE + */ +static int +calculate_integrity_table(struct filedes *in_fd, + off_t new_check_end, + const struct integrity_table *old_table, + off_t old_check_end, + struct integrity_table **integrity_table_ret, + wimlib_progress_func_t progfunc, + void *progctx) +{ + int ret; + size_t chunk_size = INTEGRITY_CHUNK_SIZE; + + /* If an old table is provided, set the chunk size to be compatible with + * the old chunk size, unless the old chunk size was weird. */ + if (old_table != NULL) { + if (old_table->num_entries == 0 || + old_table->chunk_size < INTEGRITY_MIN_CHUNK_SIZE || + old_table->chunk_size > INTEGRITY_MAX_CHUNK_SIZE) + old_table = NULL; + else + chunk_size = old_table->chunk_size; + } + + + u64 old_check_bytes = old_check_end - WIM_HEADER_DISK_SIZE; + u64 new_check_bytes = new_check_end - WIM_HEADER_DISK_SIZE; + + u32 old_num_chunks = DIV_ROUND_UP(old_check_bytes, chunk_size); + u32 new_num_chunks = DIV_ROUND_UP(new_check_bytes, chunk_size); + + size_t old_last_chunk_size = MODULO_NONZERO(old_check_bytes, chunk_size); + size_t new_last_chunk_size = MODULO_NONZERO(new_check_bytes, chunk_size); + + size_t new_table_size = 12 + new_num_chunks * SHA1_HASH_SIZE; + + struct integrity_table *new_table = MALLOC(new_table_size); + if (!new_table) + return WIMLIB_ERR_NOMEM; + new_table->num_entries = new_num_chunks; + new_table->size = new_table_size; + new_table->chunk_size = chunk_size; + + u64 offset = WIM_HEADER_DISK_SIZE; + union wimlib_progress_info progress; + + progress.integrity.total_bytes = new_check_bytes; + progress.integrity.total_chunks = new_num_chunks; + progress.integrity.completed_chunks = 0; + progress.integrity.completed_bytes = 0; + progress.integrity.chunk_size = chunk_size; + progress.integrity.filename = NULL; + + ret = call_progress(progfunc, WIMLIB_PROGRESS_MSG_CALC_INTEGRITY, + &progress, progctx); + if (ret) + goto out_free_new_table; + + for (u32 i = 0; i < new_num_chunks; i++) { + size_t this_chunk_size; + if (i == new_num_chunks - 1) + this_chunk_size = new_last_chunk_size; + else + this_chunk_size = chunk_size; + if (old_table && + ((this_chunk_size == chunk_size && i < old_num_chunks - 1) || + (i == old_num_chunks - 1 && this_chunk_size == old_last_chunk_size))) + { + /* Can use SHA1 message digest from old integrity table + * */ + copy_hash(new_table->sha1sums[i], old_table->sha1sums[i]); + } else { + /* Calculate the SHA1 message digest of this chunk */ + ret = calculate_chunk_sha1(in_fd, this_chunk_size, + offset, new_table->sha1sums[i]); + if (ret) + goto out_free_new_table; + } + offset += this_chunk_size; + + progress.integrity.completed_chunks++; + progress.integrity.completed_bytes += this_chunk_size; + ret = call_progress(progfunc, WIMLIB_PROGRESS_MSG_CALC_INTEGRITY, + &progress, progctx); + if (ret) + goto out_free_new_table; + } + *integrity_table_ret = new_table; + return 0; + +out_free_new_table: + FREE(new_table); + return ret; +} + +/* + * write_integrity_table(): + * + * Writes a WIM integrity table (a list of SHA1 message digests of raw 10 MiB + * chunks of the file). + * + * This function can optionally re-use entries from an older integrity table. + * To do this, specify old_blob_table_end and old_table. + * + * On success, @wim->out_hdr.integrity_table_reshdr will be filled in with + * information about the integrity table that was written. + * + * @wim: + * WIMStruct for the WIM file. @wim->out_fd must be a seekable descriptor + * to the new WIM file, opened read-write, positioned at the location at + * which the integrity table is to be written. + * + * @new_blob_table_end: + * The offset of the byte directly following the blob table in the WIM + * being written. + * + * @old_blob_table_end: + * If nonzero, the offset of the byte directly following the old blob table + * in the WIM. + * + * @old_table + * Pointer to the old integrity table read into memory, or NULL if not + * specified. + */ +int +write_integrity_table(WIMStruct *wim, + off_t new_blob_table_end, + off_t old_blob_table_end, + struct integrity_table *old_table) +{ + struct integrity_table *new_table; + int ret; + u32 new_table_size; + + wimlib_assert(old_blob_table_end <= new_blob_table_end); + + ret = calculate_integrity_table(&wim->out_fd, new_blob_table_end, + old_table, old_blob_table_end, + &new_table, wim->progfunc, wim->progctx); + if (ret) + return ret; + + new_table_size = new_table->size; + + new_table->size = (_force_attr u32)cpu_to_le32(new_table->size); + new_table->num_entries = (_force_attr u32)cpu_to_le32(new_table->num_entries); + new_table->chunk_size = (_force_attr u32)cpu_to_le32(new_table->chunk_size); + + ret = write_wim_resource_from_buffer(new_table, + new_table_size, + false, + &wim->out_fd, + WIMLIB_COMPRESSION_TYPE_NONE, + 0, + &wim->out_hdr.integrity_table_reshdr, + NULL, + 0); + FREE(new_table); + return ret; +} + +/* + * verify_integrity(): + * + * Checks a WIM for consistency with the integrity table. + * + * @in_fd: + * File descriptor to the WIM file, opened for reading. + * + * @table: + * The integrity table for the WIM, read into memory. + * + * @bytes_to_check: + * Number of bytes in the WIM that need to be checked (offset of end of the + * blob table minus offset of end of the header). + * + * Returns: + * > 0 (WIMLIB_ERR_READ, WIMLIB_ERR_UNEXPECTED_END_OF_FILE) on error + * 0 (WIM_INTEGRITY_OK) if the integrity was checked successfully and there + * were no inconsistencies. + * -1 (WIM_INTEGRITY_NOT_OK) if the WIM failed the integrity check. + */ +static int +verify_integrity(struct filedes *in_fd, const tchar *filename, + const struct integrity_table *table, + u64 bytes_to_check, + wimlib_progress_func_t progfunc, void *progctx) +{ + int ret; + u64 offset = WIM_HEADER_DISK_SIZE; + u8 sha1_md[SHA1_HASH_SIZE]; + union wimlib_progress_info progress; + + progress.integrity.total_bytes = bytes_to_check; + progress.integrity.total_chunks = table->num_entries; + progress.integrity.completed_chunks = 0; + progress.integrity.completed_bytes = 0; + progress.integrity.chunk_size = table->chunk_size; + progress.integrity.filename = filename; + + ret = call_progress(progfunc, WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY, + &progress, progctx); + if (ret) + return ret; + + for (u32 i = 0; i < table->num_entries; i++) { + size_t this_chunk_size; + if (i == table->num_entries - 1) + this_chunk_size = MODULO_NONZERO(bytes_to_check, + table->chunk_size); + else + this_chunk_size = table->chunk_size; + + ret = calculate_chunk_sha1(in_fd, this_chunk_size, offset, sha1_md); + if (ret) + return ret; + + if (!hashes_equal(sha1_md, table->sha1sums[i])) + return WIM_INTEGRITY_NOT_OK; + + offset += this_chunk_size; + progress.integrity.completed_chunks++; + progress.integrity.completed_bytes += this_chunk_size; + + ret = call_progress(progfunc, WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY, + &progress, progctx); + if (ret) + return ret; + } + return WIM_INTEGRITY_OK; +} + + +/* + * check_wim_integrity(): + * + * Verifies the integrity of the WIM by making sure the SHA1 message digests of + * ~10 MiB chunks of the WIM match up with the values given in the integrity + * table. + * + * @wim: + * The WIM, opened for reading. + * + * Returns: + * > 0 (WIMLIB_ERR_INVALID_INTEGRITY_TABLE, WIMLIB_ERR_READ, + * WIMLIB_ERR_UNEXPECTED_END_OF_FILE) on error + * 0 (WIM_INTEGRITY_OK) if the integrity was checked successfully and there + * were no inconsistencies. + * -1 (WIM_INTEGRITY_NOT_OK) if the WIM failed the integrity check. + * -2 (WIM_INTEGRITY_NONEXISTENT) if the WIM contains no integrity + * information. + */ +int +check_wim_integrity(WIMStruct *wim) +{ + int ret; + u64 bytes_to_check; + struct integrity_table *table; + u64 end_blob_table_offset; + + if (!wim_has_integrity_table(wim)) + return WIM_INTEGRITY_NONEXISTENT; + + end_blob_table_offset = wim->hdr.blob_table_reshdr.offset_in_wim + + wim->hdr.blob_table_reshdr.size_in_wim; + + if (end_blob_table_offset < WIM_HEADER_DISK_SIZE) { + ERROR("WIM blob table ends before WIM header ends!"); + return WIMLIB_ERR_INVALID_INTEGRITY_TABLE; + } + + bytes_to_check = end_blob_table_offset - WIM_HEADER_DISK_SIZE; + + ret = read_integrity_table(wim, bytes_to_check, &table); + if (ret) + return ret; + ret = verify_integrity(&wim->in_fd, wim->filename, table, + bytes_to_check, wim->progfunc, wim->progctx); + FREE(table); + return ret; +} diff --git a/src/wimlib/iterate_dir.c b/src/wimlib/iterate_dir.c new file mode 100644 index 00000000..85857043 --- /dev/null +++ b/src/wimlib/iterate_dir.c @@ -0,0 +1,282 @@ +/* + * iterate_dir.c + * + * Iterate through files in a WIM image. + * This is the stable API; internal code can just use for_dentry_in_tree(). + */ + +/* + * Copyright (C) 2013-2016 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib.h" +#include "wimlib/blob_table.h" +#include "wimlib/dentry.h" +#include "wimlib/encoding.h" +#include "wimlib/metadata.h" +#include "wimlib/object_id.h" +#include "wimlib/paths.h" +#include "wimlib/security.h" +#include "wimlib/timestamp.h" +#include "wimlib/unix_data.h" +#include "wimlib/util.h" +#include "wimlib/wim.h" + +static int +stream_to_wimlib_stream_entry(const struct wim_inode *inode, + const struct wim_inode_stream *strm, + struct wimlib_stream_entry *wstream, + const struct blob_table *blob_table, + int flags) +{ + const struct blob_descriptor *blob; + const u8 *hash; + + if (stream_is_named(strm)) { + int ret; + + ret = utf16le_get_tstr(strm->stream_name, + utf16le_len_bytes(strm->stream_name), + &wstream->stream_name, NULL); + if (ret) + return ret; + } + + blob = stream_blob(strm, blob_table); + if (blob) { + blob_to_wimlib_resource_entry(blob, &wstream->resource); + } else if (!is_zero_hash((hash = stream_hash(strm)))) { + if (flags & WIMLIB_ITERATE_DIR_TREE_FLAG_RESOURCES_NEEDED) + return blob_not_found_error(inode, hash); + copy_hash(wstream->resource.sha1_hash, hash); + wstream->resource.is_missing = 1; + } + return 0; +} + +static int +get_default_stream_type(const struct wim_inode *inode) +{ + if (inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED) + return STREAM_TYPE_EFSRPC_RAW_DATA; + if (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) + return STREAM_TYPE_REPARSE_POINT; + return STREAM_TYPE_DATA; +} + +static int +init_wimlib_dentry(struct wimlib_dir_entry *wdentry, struct wim_dentry *dentry, + WIMStruct *wim, int flags) +{ + int ret; + const struct wim_inode *inode = dentry->d_inode; + const struct wim_inode_stream *strm; + struct wimlib_unix_data unix_data; + const void *object_id; + u32 object_id_len; + + ret = utf16le_get_tstr(dentry->d_name, dentry->d_name_nbytes, + &wdentry->filename, NULL); + if (ret) + return ret; + + ret = utf16le_get_tstr(dentry->d_short_name, dentry->d_short_name_nbytes, + &wdentry->dos_name, NULL); + if (ret) + return ret; + + ret = calculate_dentry_full_path(dentry); + if (ret) + return ret; + wdentry->full_path = dentry->d_full_path; + + for (struct wim_dentry *d = dentry; !dentry_is_root(d); d = d->d_parent) + wdentry->depth++; + + if (inode_has_security_descriptor(inode)) { + struct wim_security_data *sd; + + sd = wim_get_current_security_data(wim); + wdentry->security_descriptor = sd->descriptors[inode->i_security_id]; + wdentry->security_descriptor_size = sd->sizes[inode->i_security_id]; + } + wdentry->reparse_tag = inode->i_reparse_tag; + wdentry->num_links = inode->i_nlink; + wdentry->attributes = inode->i_attributes; + wdentry->hard_link_group_id = inode->i_ino; + + wim_timestamp_to_wimlib_timespec(inode->i_creation_time, + &wdentry->creation_time, + &wdentry->creation_time_high); + + wim_timestamp_to_wimlib_timespec(inode->i_last_write_time, + &wdentry->last_write_time, + &wdentry->last_write_time_high); + + wim_timestamp_to_wimlib_timespec(inode->i_last_access_time, + &wdentry->last_access_time, + &wdentry->last_access_time_high); + + if (inode_get_unix_data(inode, &unix_data)) { + wdentry->unix_uid = unix_data.uid; + wdentry->unix_gid = unix_data.gid; + wdentry->unix_mode = unix_data.mode; + wdentry->unix_rdev = unix_data.rdev; + } + object_id = inode_get_object_id(inode, &object_id_len); + if (unlikely(object_id != NULL)) { + memcpy(&wdentry->object_id, object_id, + min(object_id_len, sizeof(wdentry->object_id))); + } + + strm = inode_get_unnamed_stream(inode, get_default_stream_type(inode)); + if (strm) { + ret = stream_to_wimlib_stream_entry(inode, strm, + &wdentry->streams[0], + wim->blob_table, flags); + if (ret) + return ret; + } + + for (unsigned i = 0; i < inode->i_num_streams; i++) { + + strm = &inode->i_streams[i]; + + if (!stream_is_named_data_stream(strm)) + continue; + + wdentry->num_named_streams++; + + ret = stream_to_wimlib_stream_entry(inode, strm, + &wdentry->streams[ + wdentry->num_named_streams], + wim->blob_table, flags); + if (ret) + return ret; + } + return 0; +} + +static void +free_wimlib_dentry(struct wimlib_dir_entry *wdentry) +{ + utf16le_put_tstr(wdentry->filename); + utf16le_put_tstr(wdentry->dos_name); + for (unsigned i = 1; i <= wdentry->num_named_streams; i++) + utf16le_put_tstr(wdentry->streams[i].stream_name); + FREE(wdentry); +} + +static int +do_iterate_dir_tree(WIMStruct *wim, + struct wim_dentry *dentry, int flags, + wimlib_iterate_dir_tree_callback_t cb, + void *user_ctx) +{ + struct wimlib_dir_entry *wdentry; + int ret = WIMLIB_ERR_NOMEM; + + + wdentry = CALLOC(1, sizeof(struct wimlib_dir_entry) + + (1 + dentry->d_inode->i_num_streams) * + sizeof(struct wimlib_stream_entry)); + if (wdentry == NULL) + goto out; + + ret = init_wimlib_dentry(wdentry, dentry, wim, flags); + if (ret) + goto out_free_wimlib_dentry; + + if (!(flags & WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN)) { + ret = (*cb)(wdentry, user_ctx); + if (ret) + goto out_free_wimlib_dentry; + } + + if (flags & (WIMLIB_ITERATE_DIR_TREE_FLAG_RECURSIVE | + WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN)) + { + struct wim_dentry *child; + + ret = 0; + for_dentry_child(child, dentry) { + ret = do_iterate_dir_tree(wim, child, + flags & ~WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN, + cb, user_ctx); + if (ret) + break; + } + } +out_free_wimlib_dentry: + FREE(dentry->d_full_path); + dentry->d_full_path = NULL; + free_wimlib_dentry(wdentry); +out: + return ret; +} + +struct image_iterate_dir_tree_ctx { + const tchar *path; + int flags; + wimlib_iterate_dir_tree_callback_t cb; + void *user_ctx; +}; + + +static int +image_do_iterate_dir_tree(WIMStruct *wim) +{ + struct image_iterate_dir_tree_ctx *ctx = wim->private; + struct wim_dentry *dentry; + + dentry = get_dentry(wim, ctx->path, WIMLIB_CASE_PLATFORM_DEFAULT); + if (dentry == NULL) + return WIMLIB_ERR_PATH_DOES_NOT_EXIST; + return do_iterate_dir_tree(wim, dentry, ctx->flags, ctx->cb, ctx->user_ctx); +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_iterate_dir_tree(WIMStruct *wim, int image, const tchar *_path, + int flags, + wimlib_iterate_dir_tree_callback_t cb, void *user_ctx) +{ + tchar *path; + int ret; + + if (flags & ~(WIMLIB_ITERATE_DIR_TREE_FLAG_RECURSIVE | + WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN | + WIMLIB_ITERATE_DIR_TREE_FLAG_RESOURCES_NEEDED)) + return WIMLIB_ERR_INVALID_PARAM; + + path = canonicalize_wim_path(_path); + if (path == NULL) + return WIMLIB_ERR_NOMEM; + struct image_iterate_dir_tree_ctx ctx = { + .path = path, + .flags = flags, + .cb = cb, + .user_ctx = user_ctx, + }; + wim->private = &ctx; + ret = for_image(wim, image, image_do_iterate_dir_tree); + FREE(path); + return ret; +} diff --git a/src/wimlib/lcpit_matchfinder.c b/src/wimlib/lcpit_matchfinder.c new file mode 100644 index 00000000..a1a1c02a --- /dev/null +++ b/src/wimlib/lcpit_matchfinder.c @@ -0,0 +1,752 @@ +/* + * lcpit_matchfinder.c + * + * A match-finder for Lempel-Ziv compression based on bottom-up construction and + * traversal of the Longest Common Prefix (LCP) interval tree. + * + * Copyright 2022 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <limits.h> + +#include "wimlib/divsufsort.h" +#include "wimlib/lcpit_matchfinder.h" +#include "wimlib/util.h" + +#define LCP_BITS 6 +#define LCP_MAX (((u32)1 << LCP_BITS) - 1) +#define LCP_SHIFT (32 - LCP_BITS) +#define LCP_MASK (LCP_MAX << LCP_SHIFT) +#define POS_MASK (((u32)1 << (32 - LCP_BITS)) - 1) +#define MAX_NORMAL_BUFSIZE (POS_MASK + 1) + +#define HUGE_LCP_BITS 7 +#define HUGE_LCP_MAX (((u32)1 << HUGE_LCP_BITS) - 1) +#define HUGE_LCP_SHIFT (64 - HUGE_LCP_BITS) +#define HUGE_LCP_MASK ((u64)HUGE_LCP_MAX << HUGE_LCP_SHIFT) +#define HUGE_POS_MASK 0xFFFFFFFF +#define MAX_HUGE_BUFSIZE ((u64)HUGE_POS_MASK + 1) +#define HUGE_UNVISITED_TAG 0x100000000 + +#define PREFETCH_SAFETY 5 + +/* + * Build the LCP (Longest Common Prefix) array in linear time. + * + * LCP[r] will be the length of the longest common prefix between the suffixes + * with positions SA[r - 1] and SA[r]. LCP[0] will be undefined. + * + * Algorithm taken from Kasai et al. (2001), but modified slightly: + * + * - With bytes there is no realistic way to reserve a unique symbol for + * end-of-buffer, so use explicit checks for end-of-buffer. + * + * - For decreased memory usage and improved memory locality, pack the two + * logically distinct SA and LCP arrays into a single array SA_and_LCP. + * + * - Since SA_and_LCP is accessed randomly, improve the cache behavior by + * reading several entries ahead in ISA and prefetching the upcoming + * SA_and_LCP entry. + * + * - If an LCP value is less than the minimum match length, then store 0. This + * avoids having to do comparisons against the minimum match length later. + * + * - If an LCP value is greater than the "nice match length", then store the + * "nice match length". This caps the number of bits needed to store each + * LCP value, and this caps the depth of the LCP-interval tree, without + * usually hurting the compression ratio too much. + * + * References: + * + * Kasai et al. 2001. Linear-Time Longest-Common-Prefix Computation in + * Suffix Arrays and Its Applications. CPM '01 Proceedings of the 12th + * Annual Symposium on Combinatorial Pattern Matching pp. 181-192. + */ +static void +build_LCP(u32 SA_and_LCP[restrict], const u32 ISA[restrict], + const u8 T[restrict], const u32 n, + const u32 min_lcp, const u32 max_lcp) +{ + u32 h = 0; + for (u32 i = 0; i < n; i++) { + const u32 r = ISA[i]; + prefetchw(&SA_and_LCP[ISA[i + PREFETCH_SAFETY]]); + if (r > 0) { + const u32 j = SA_and_LCP[r - 1] & POS_MASK; + const u32 lim = min(n - i, n - j); + while (h < lim && T[i + h] == T[j + h]) + h++; + u32 stored_lcp = h; + if (stored_lcp < min_lcp) + stored_lcp = 0; + else if (stored_lcp > max_lcp) + stored_lcp = max_lcp; + SA_and_LCP[r] |= stored_lcp << LCP_SHIFT; + if (h > 0) + h--; + } + } +} + +/* + * Use the suffix array accompanied with the longest-common-prefix array --- + * which in combination can be called the "enhanced suffix array" --- to + * simulate a bottom-up traversal of the corresponding suffix tree, or + * equivalently the lcp-interval tree. Do so in suffix rank order, but save the + * superinterval references needed for later bottom-up traversal of the tree in + * suffix position order. + * + * To enumerate the lcp-intervals, this algorithm scans the suffix array and its + * corresponding LCP array linearly. While doing so, it maintains a stack of + * lcp-intervals that are currently open, meaning that their left boundaries + * have been seen but their right boundaries have not. The bottom of the stack + * is the interval which covers the entire suffix array (this has lcp=0), and + * the top of the stack is the deepest interval that is currently open (this has + * the greatest lcp of any interval on the stack). When this algorithm opens an + * lcp-interval, it assigns it a unique index in intervals[] and pushes it onto + * the stack. When this algorithm closes an interval, it pops it from the stack + * and sets the intervals[] entry of that interval to the index and lcp of that + * interval's superinterval, which is the new top of the stack. + * + * This algorithm also set pos_data[pos] for each suffix position 'pos' to the + * index and lcp of the deepest lcp-interval containing it. Alternatively, we + * can interpret each suffix as being associated with a singleton lcp-interval, + * or leaf of the suffix tree. With this interpretation, an entry in pos_data[] + * is the superinterval reference for one of these singleton lcp-intervals and + * therefore is not fundamentally different from an entry in intervals[]. + * + * To reduce memory usage, this algorithm re-uses the suffix array's memory to + * store the generated intervals[] array. This is possible because SA and LCP + * are accessed linearly, and no more than one interval is generated per suffix. + * + * The techniques used in this algorithm are described in various published + * papers. The generation of lcp-intervals from the suffix array (SA) and the + * longest-common-prefix array (LCP) is given as Algorithm BottomUpTraverse in + * Kasai et al. (2001) and Algorithm 4.1 ("Computation of lcp-intervals") in + * Abouelhoda et al. (2004). Both these papers note the equivalence between + * lcp-intervals (including the singleton lcp-interval for each suffix) and + * nodes of the suffix tree. Abouelhoda et al. (2004) furthermore applies + * bottom-up traversal of the lcp-interval tree to Lempel-Ziv factorization, as + * does Chen at al. (2008). Algorithm CPS1b of Chen et al. (2008) dynamically + * re-uses the suffix array during bottom-up traversal of the lcp-interval tree. + * + * References: + * + * Kasai et al. Linear-Time Longest-Common-Prefix Computation in Suffix + * Arrays and Its Applications. 2001. CPM '01 Proceedings of the 12th + * Annual Symposium on Combinatorial Pattern Matching pp. 181-192. + * + * M.I. Abouelhoda, S. Kurtz, E. Ohlebusch. 2004. Replacing Suffix Trees + * With Enhanced Suffix Arrays. Journal of Discrete Algorithms Volume 2 + * Issue 1, March 2004, pp. 53-86. + * + * G. Chen, S.J. Puglisi, W.F. Smyth. 2008. Lempel-Ziv Factorization + * Using Less Time & Space. Mathematics in Computer Science June 2008, + * Volume 1, Issue 4, pp. 605-623. + */ +static void +build_LCPIT(u32 intervals[restrict], u32 pos_data[restrict], const u32 n) +{ + u32 * const SA_and_LCP = intervals; + u32 next_interval_idx; + u32 open_intervals[LCP_MAX + 1]; + u32 *top = open_intervals; + u32 prev_pos = SA_and_LCP[0] & POS_MASK; + + *top = 0; + intervals[0] = 0; + next_interval_idx = 1; + + for (u32 r = 1; r < n; r++) { + const u32 next_pos = SA_and_LCP[r] & POS_MASK; + const u32 next_lcp = SA_and_LCP[r] & LCP_MASK; + const u32 top_lcp = *top & LCP_MASK; + + prefetchw(&pos_data[SA_and_LCP[r + PREFETCH_SAFETY] & POS_MASK]); + + if (next_lcp == top_lcp) { + /* Continuing the deepest open interval */ + pos_data[prev_pos] = *top; + } else if (next_lcp > top_lcp) { + /* Opening a new interval */ + *++top = next_lcp | next_interval_idx++; + pos_data[prev_pos] = *top; + } else { + /* Closing the deepest open interval */ + pos_data[prev_pos] = *top; + for (;;) { + const u32 closed_interval_idx = *top-- & POS_MASK; + const u32 superinterval_lcp = *top & LCP_MASK; + + if (next_lcp == superinterval_lcp) { + /* Continuing the superinterval */ + intervals[closed_interval_idx] = *top; + break; + } else if (next_lcp > superinterval_lcp) { + /* Creating a new interval that is a + * superinterval of the one being + * closed, but still a subinterval of + * its superinterval */ + *++top = next_lcp | next_interval_idx++; + intervals[closed_interval_idx] = *top; + break; + } else { + /* Also closing the superinterval */ + intervals[closed_interval_idx] = *top; + } + } + } + prev_pos = next_pos; + } + + /* Close any still-open intervals. */ + pos_data[prev_pos] = *top; + for (; top > open_intervals; top--) + intervals[*top & POS_MASK] = *(top - 1); +} + +/* + * Advance the LCP-interval tree matchfinder by one byte. + * + * If @record_matches is true, then matches are written to the @matches array + * sorted by strictly decreasing length and strictly decreasing offset, and the + * return value is the number of matches found. Otherwise, @matches is ignored + * and the return value is always 0. + * + * How this algorithm works: + * + * 'cur_pos' is the position of the current suffix, which is the suffix being + * matched against. 'cur_pos' starts at 0 and is incremented each time this + * function is called. This function finds each suffix with position less than + * 'cur_pos' that shares a prefix with the current suffix, but for each distinct + * prefix length it finds only the suffix with the greatest position (i.e. the + * most recently seen in the linear traversal by position). This function + * accomplishes this using the lcp-interval tree data structure that was built + * by build_LCPIT() and is updated dynamically by this function. + * + * The first step is to read 'pos_data[cur_pos]', which gives the index and lcp + * value of the deepest lcp-interval containing the current suffix --- or, + * equivalently, the parent of the conceptual singleton lcp-interval that + * contains the current suffix. + * + * The second step is to ascend the lcp-interval tree until reaching an interval + * that has not yet been visited, and link the intervals to the current suffix + * along the way. An lcp-interval has been visited if and only if it has been + * linked to a suffix. Initially, no lcp-intervals are linked to suffixes. + * + * The third step is to continue ascending the lcp-interval tree, but indirectly + * through suffix links rather than through the original superinterval + * references, and continuing to form links with the current suffix along the + * way. Each suffix visited during this step, except in a special case to + * handle outdated suffixes, is a match which can be written to matches[]. Each + * intervals[] entry contains the position of the next suffix to visit, which we + * shall call 'match_pos'; this is the most recently seen suffix that belongs to + * that lcp-interval. 'pos_data[match_pos]' then contains the lcp and interval + * index of the next lcp-interval that should be visited. + * + * We can view these arrays as describing a new set of links that gets overlaid + * on top of the original superinterval references of the lcp-interval tree. + * Each such link can connect a node of the lcp-interval tree to an ancestor + * more than one generation removed. + * + * For each one-byte advance, the current position becomes the most recently + * seen suffix for a continuous sequence of lcp-intervals from a leaf interval + * to the root interval. Conceptually, this algorithm needs to update all these + * nodes to link to 'cur_pos', and then update 'pos_data[cur_pos]' to a "null" + * link. But actually, if some of these nodes have the same most recently seen + * suffix, then this algorithm just visits the pos_data[] entry for that suffix + * and skips over all these nodes in one step. Updating the extra nodes is + * accomplished by creating a redirection from the previous suffix to the + * current suffix. + * + * Using this shortcutting scheme, it's possible for a suffix to become out of + * date, which means that it is no longer the most recently seen suffix for the + * lcp-interval under consideration. This case is detected by noticing when the + * next lcp-interval link actually points deeper in the tree, and it is worked + * around by just continuing until we get to a link that actually takes us + * higher in the tree. This can be described as a lazy-update scheme. + */ +static forceinline u32 +lcpit_advance_one_byte(const u32 cur_pos, + u32 pos_data[restrict], + u32 intervals[restrict], + u32 next[restrict], + struct lz_match matches[restrict], + const bool record_matches) +{ + u32 ref; + u32 super_ref; + u32 match_pos; + struct lz_match *matchptr; + + /* Get the deepest lcp-interval containing the current suffix. */ + ref = pos_data[cur_pos]; + + /* Prefetch upcoming data, up to 3 positions ahead. Assume the + * intervals are already visited. */ + + /* Prefetch the superinterval via a suffix link for the deepest + * lcp-interval containing the suffix starting 1 position from now. */ + prefetchw(&intervals[pos_data[next[0]] & POS_MASK]); + + /* Prefetch suffix link for the deepest lcp-interval containing the + * suffix starting 2 positions from now. */ + next[0] = intervals[next[1]] & POS_MASK; + prefetchw(&pos_data[next[0]]); + + /* Prefetch the deepest lcp-interval containing the suffix starting 3 + * positions from now. */ + next[1] = pos_data[cur_pos + 3] & POS_MASK; + prefetchw(&intervals[next[1]]); + + /* There is no "next suffix" after the current one. */ + pos_data[cur_pos] = 0; + + /* Ascend until we reach a visited interval, the root, or a child of the + * root. Link unvisited intervals to the current suffix as we go. */ + while ((super_ref = intervals[ref & POS_MASK]) & LCP_MASK) { + intervals[ref & POS_MASK] = cur_pos; + ref = super_ref; + } + + if (super_ref == 0) { + /* In this case, the current interval may be any of: + * (1) the root; + * (2) an unvisited child of the root; + * (3) an interval last visited by suffix 0 + * + * We could avoid the ambiguity with (3) by using an lcp + * placeholder value other than 0 to represent "visited", but + * it's fastest to use 0. So we just don't allow matches with + * position 0. */ + + if (ref != 0) /* Not the root? */ + intervals[ref & POS_MASK] = cur_pos; + return 0; + } + + /* Ascend indirectly via pos_data[] links. */ + match_pos = super_ref; + matchptr = matches; + for (;;) { + while ((super_ref = pos_data[match_pos]) > ref) + match_pos = intervals[super_ref & POS_MASK]; + intervals[ref & POS_MASK] = cur_pos; + pos_data[match_pos] = ref; + if (record_matches) { + matchptr->length = ref >> LCP_SHIFT; + matchptr->offset = cur_pos - match_pos; + matchptr++; + } + if (super_ref == 0) + break; + ref = super_ref; + match_pos = intervals[ref & POS_MASK]; + } + return matchptr - matches; +} + +/* Expand SA from 32 bits to 64 bits. */ +static void +expand_SA(void *p, u32 n) +{ + typedef u32 __attribute__((may_alias)) aliased_u32_t; + typedef u64 __attribute__((may_alias)) aliased_u64_t; + + aliased_u32_t *SA = p; + aliased_u64_t *SA64 = p; + + u32 r = n - 1; + do { + SA64[r] = SA[r]; + } while (r--); +} + +/* Like build_LCP(), but for buffers larger than MAX_NORMAL_BUFSIZE. */ +static void +build_LCP_huge(u64 SA_and_LCP64[restrict], const u32 ISA[restrict], + const u8 T[restrict], const u32 n, + const u32 min_lcp, const u32 max_lcp) +{ + u32 h = 0; + for (u32 i = 0; i < n; i++) { + const u32 r = ISA[i]; + prefetchw(&SA_and_LCP64[ISA[i + PREFETCH_SAFETY]]); + if (r > 0) { + const u32 j = SA_and_LCP64[r - 1] & HUGE_POS_MASK; + const u32 lim = min(n - i, n - j); + while (h < lim && T[i + h] == T[j + h]) + h++; + u32 stored_lcp = h; + if (stored_lcp < min_lcp) + stored_lcp = 0; + else if (stored_lcp > max_lcp) + stored_lcp = max_lcp; + SA_and_LCP64[r] |= (u64)stored_lcp << HUGE_LCP_SHIFT; + if (h > 0) + h--; + } + } +} + +/* + * Like build_LCPIT(), but for buffers larger than MAX_NORMAL_BUFSIZE. + * + * This "huge" version is also slightly different in that the lcp value stored + * in each intervals[] entry is the lcp value for that interval, not its + * superinterval. This lcp value stays put in intervals[] and doesn't get moved + * to pos_data[] during lcpit_advance_one_byte_huge(). One consequence of this + * is that we have to use a special flag to distinguish visited from unvisited + * intervals. But overall, this scheme keeps the memory usage at 12n instead of + * 16n. (The non-huge version is 8n.) + */ +static void +build_LCPIT_huge(u64 intervals64[restrict], u32 pos_data[restrict], const u32 n) +{ + u64 * const SA_and_LCP64 = intervals64; + u32 next_interval_idx; + u32 open_intervals[HUGE_LCP_MAX + 1]; + u32 *top = open_intervals; + u32 prev_pos = SA_and_LCP64[0] & HUGE_POS_MASK; + + *top = 0; + intervals64[0] = 0; + next_interval_idx = 1; + + for (u32 r = 1; r < n; r++) { + const u32 next_pos = SA_and_LCP64[r] & HUGE_POS_MASK; + const u64 next_lcp = SA_and_LCP64[r] & HUGE_LCP_MASK; + const u64 top_lcp = intervals64[*top]; + + prefetchw(&pos_data[SA_and_LCP64[r + PREFETCH_SAFETY] & HUGE_POS_MASK]); + + if (next_lcp == top_lcp) { + /* Continuing the deepest open interval */ + pos_data[prev_pos] = *top; + } else if (next_lcp > top_lcp) { + /* Opening a new interval */ + intervals64[next_interval_idx] = next_lcp; + pos_data[prev_pos] = next_interval_idx; + *++top = next_interval_idx++; + } else { + /* Closing the deepest open interval */ + pos_data[prev_pos] = *top; + for (;;) { + const u32 closed_interval_idx = *top--; + const u64 superinterval_lcp = intervals64[*top]; + + if (next_lcp == superinterval_lcp) { + /* Continuing the superinterval */ + intervals64[closed_interval_idx] |= + HUGE_UNVISITED_TAG | *top; + break; + } else if (next_lcp > superinterval_lcp) { + /* Creating a new interval that is a + * superinterval of the one being + * closed, but still a subinterval of + * its superinterval */ + intervals64[next_interval_idx] = next_lcp; + intervals64[closed_interval_idx] |= + HUGE_UNVISITED_TAG | next_interval_idx; + *++top = next_interval_idx++; + break; + } else { + /* Also closing the superinterval */ + intervals64[closed_interval_idx] |= + HUGE_UNVISITED_TAG | *top; + } + } + } + prev_pos = next_pos; + } + + /* Close any still-open intervals. */ + pos_data[prev_pos] = *top; + for (; top > open_intervals; top--) + intervals64[*top] |= HUGE_UNVISITED_TAG | *(top - 1); +} + +/* Like lcpit_advance_one_byte(), but for buffers larger than + * MAX_NORMAL_BUFSIZE. */ +static forceinline u32 +lcpit_advance_one_byte_huge(const u32 cur_pos, + u32 pos_data[restrict], + u64 intervals64[restrict], + u32 prefetch_next[restrict], + struct lz_match matches[restrict], + const bool record_matches) +{ + u32 interval_idx; + u32 next_interval_idx; + u64 cur; + u64 next; + u32 match_pos; + struct lz_match *matchptr; + + interval_idx = pos_data[cur_pos]; + + prefetchw(&intervals64[pos_data[prefetch_next[0]] & HUGE_POS_MASK]); + + prefetch_next[0] = intervals64[prefetch_next[1]] & HUGE_POS_MASK; + prefetchw(&pos_data[prefetch_next[0]]); + + prefetch_next[1] = pos_data[cur_pos + 3] & HUGE_POS_MASK; + prefetchw(&intervals64[prefetch_next[1]]); + + pos_data[cur_pos] = 0; + + while ((next = intervals64[interval_idx]) & HUGE_UNVISITED_TAG) { + intervals64[interval_idx] = (next & HUGE_LCP_MASK) | cur_pos; + interval_idx = next & HUGE_POS_MASK; + } + + matchptr = matches; + while (next & HUGE_LCP_MASK) { + cur = next; + do { + match_pos = next & HUGE_POS_MASK; + next_interval_idx = pos_data[match_pos]; + next = intervals64[next_interval_idx]; + } while (next > cur); + intervals64[interval_idx] = (cur & HUGE_LCP_MASK) | cur_pos; + pos_data[match_pos] = interval_idx; + if (record_matches) { + matchptr->length = cur >> HUGE_LCP_SHIFT; + matchptr->offset = cur_pos - match_pos; + matchptr++; + } + interval_idx = next_interval_idx; + } + return matchptr - matches; +} + +static forceinline u64 +get_pos_data_size(size_t max_bufsize) +{ + return (u64)max((u64)max_bufsize + PREFETCH_SAFETY, + DIVSUFSORT_TMP_LEN) * sizeof(u32); +} + +static forceinline u64 +get_intervals_size(size_t max_bufsize) +{ + return ((u64)max_bufsize + PREFETCH_SAFETY) * + (max_bufsize <= MAX_NORMAL_BUFSIZE ? sizeof(u32) : sizeof(u64)); +} + +/* + * Calculate the number of bytes of memory needed for the LCP-interval tree + * matchfinder. + * + * @max_bufsize - maximum buffer size to support + * + * Returns the number of bytes required. + */ +u64 +lcpit_matchfinder_get_needed_memory(size_t max_bufsize) +{ + return get_pos_data_size(max_bufsize) + get_intervals_size(max_bufsize); +} + +/* + * Initialize the LCP-interval tree matchfinder. + * + * @mf - the matchfinder structure to initialize + * @max_bufsize - maximum buffer size to support + * @min_match_len - minimum match length in bytes + * @nice_match_len - only consider this many bytes of each match + * + * Returns true if successfully initialized; false if out of memory. + */ +bool +lcpit_matchfinder_init(struct lcpit_matchfinder *mf, size_t max_bufsize, + u32 min_match_len, u32 nice_match_len) +{ + if (lcpit_matchfinder_get_needed_memory(max_bufsize) > SIZE_MAX) + return false; + if (max_bufsize > MAX_HUGE_BUFSIZE - PREFETCH_SAFETY) + return false; + + mf->pos_data = MALLOC(get_pos_data_size(max_bufsize)); + mf->intervals = MALLOC(get_intervals_size(max_bufsize)); + if (!mf->pos_data || !mf->intervals) { + lcpit_matchfinder_destroy(mf); + return false; + } + + mf->min_match_len = min_match_len; + mf->orig_nice_match_len = nice_match_len; + return true; +} + +/* + * Build the suffix array SA for the specified byte array T of length n. + * + * The suffix array is a sorted array of the byte array's suffixes, represented + * by indices into the byte array. It can equivalently be viewed as a mapping + * from suffix rank to suffix position. + * + * To build the suffix array, we use libdivsufsort, which uses an + * induced-sorting-based algorithm. In practice, this seems to be the fastest + * suffix array construction algorithm currently available. + * + * References: + * + * Y. Mori. libdivsufsort, a lightweight suffix-sorting library. + * https://github.com/y-256/libdivsufsort + * + * G. Nong, S. Zhang, and W.H. Chan. 2009. Linear Suffix Array + * Construction by Almost Pure Induced-Sorting. Data Compression + * Conference, 2009. DCC '09. pp. 193 - 202. + * + * S.J. Puglisi, W.F. Smyth, and A. Turpin. 2007. A Taxonomy of Suffix + * Array Construction Algorithms. ACM Computing Surveys (CSUR) Volume 39 + * Issue 2, 2007 Article No. 4. + */ +static void +build_SA(u32 SA[], const u8 T[], u32 n, u32 *tmp) +{ + /* Note: divsufsort() requires a fixed amount of temporary space. The + * implementation of divsufsort() has been modified from the original to + * use the provided temporary space instead of allocating its own, since + * we don't want to have to deal with malloc() failures here. */ + divsufsort(T, SA, n, tmp); +} + +/* + * Build the inverse suffix array ISA from the suffix array SA. + * + * Whereas the suffix array is a mapping from suffix rank to suffix position, + * the inverse suffix array is a mapping from suffix position to suffix rank. + */ +static void +build_ISA(u32 ISA[restrict], const u32 SA[restrict], u32 n) +{ + for (u32 r = 0; r < n; r++) + ISA[SA[r]] = r; +} + +/* + * Prepare the LCP-interval tree matchfinder for a new input buffer. + * + * @mf - the initialized matchfinder structure + * @T - the input buffer + * @n - size of the input buffer in bytes. This must be nonzero and can be at + * most the max_bufsize with which lcpit_matchfinder_init() was called. + */ +void +lcpit_matchfinder_load_buffer(struct lcpit_matchfinder *mf, const u8 *T, u32 n) +{ + /* intervals[] temporarily stores SA and LCP packed together. + * pos_data[] temporarily stores ISA. + * pos_data[] is also used as the temporary space for divsufsort(). */ + + build_SA(mf->intervals, T, n, mf->pos_data); + build_ISA(mf->pos_data, mf->intervals, n); + if (n <= MAX_NORMAL_BUFSIZE) { + mf->nice_match_len = min(mf->orig_nice_match_len, LCP_MAX); + for (u32 i = 0; i < PREFETCH_SAFETY; i++) { + mf->intervals[n + i] = 0; + mf->pos_data[n + i] = 0; + } + build_LCP(mf->intervals, mf->pos_data, T, n, + mf->min_match_len, mf->nice_match_len); + build_LCPIT(mf->intervals, mf->pos_data, n); + mf->huge_mode = false; + } else { + mf->nice_match_len = min(mf->orig_nice_match_len, HUGE_LCP_MAX); + for (u32 i = 0; i < PREFETCH_SAFETY; i++) { + mf->intervals64[n + i] = 0; + mf->pos_data[n + i] = 0; + } + expand_SA(mf->intervals, n); + build_LCP_huge(mf->intervals64, mf->pos_data, T, n, + mf->min_match_len, mf->nice_match_len); + build_LCPIT_huge(mf->intervals64, mf->pos_data, n); + mf->huge_mode = true; + } + mf->cur_pos = 0; /* starting at beginning of input buffer */ + for (u32 i = 0; i < ARRAY_LEN(mf->next); i++) + mf->next[i] = 0; +} + +/* + * Retrieve a list of matches with the next position. + * + * The matches will be recorded in the @matches array, ordered by strictly + * decreasing length and strictly decreasing offset. + * + * The return value is the number of matches found and written to @matches. + * This can be any value in [0, nice_match_len - min_match_len + 1]. + */ +u32 +lcpit_matchfinder_get_matches(struct lcpit_matchfinder *mf, + struct lz_match *matches) +{ + if (mf->huge_mode) + return lcpit_advance_one_byte_huge(mf->cur_pos++, mf->pos_data, + mf->intervals64, mf->next, + matches, true); + else + return lcpit_advance_one_byte(mf->cur_pos++, mf->pos_data, + mf->intervals, mf->next, + matches, true); +} + +/* + * Skip the next @count bytes (don't search for matches at them). @count is + * assumed to be > 0. + */ +void +lcpit_matchfinder_skip_bytes(struct lcpit_matchfinder *mf, u32 count) +{ + if (mf->huge_mode) { + do { + lcpit_advance_one_byte_huge(mf->cur_pos++, mf->pos_data, + mf->intervals64, mf->next, + NULL, false); + } while (--count); + } else { + do { + lcpit_advance_one_byte(mf->cur_pos++, mf->pos_data, + mf->intervals, mf->next, + NULL, false); + } while (--count); + } +} + +/* + * Destroy an LCP-interval tree matchfinder that was previously initialized with + * lcpit_matchfinder_init(). + */ +void +lcpit_matchfinder_destroy(struct lcpit_matchfinder *mf) +{ + FREE(mf->pos_data); + FREE(mf->intervals); +} diff --git a/src/wimlib/lzms_common.c b/src/wimlib/lzms_common.c new file mode 100644 index 00000000..50176847 --- /dev/null +++ b/src/wimlib/lzms_common.c @@ -0,0 +1,643 @@ +/* + * lzms_common.c - Common code for LZMS compression and decompression + */ + +/* + * Copyright (C) 2013-2016 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/cpu_features.h" +#include "wimlib/lzms_common.h" +#include "wimlib/unaligned.h" + +#ifdef __x86_64__ +# include <emmintrin.h> +#endif + +/* Table: offset slot => offset slot base value */ +const u32 lzms_offset_slot_base[LZMS_MAX_NUM_OFFSET_SYMS + 1] = { + 0x00000001, 0x00000002, 0x00000003, 0x00000004, + 0x00000005, 0x00000006, 0x00000007, 0x00000008, + 0x00000009, 0x0000000d, 0x00000011, 0x00000015, + 0x00000019, 0x0000001d, 0x00000021, 0x00000025, + 0x00000029, 0x0000002d, 0x00000035, 0x0000003d, + 0x00000045, 0x0000004d, 0x00000055, 0x0000005d, + 0x00000065, 0x00000075, 0x00000085, 0x00000095, + 0x000000a5, 0x000000b5, 0x000000c5, 0x000000d5, + 0x000000e5, 0x000000f5, 0x00000105, 0x00000125, + 0x00000145, 0x00000165, 0x00000185, 0x000001a5, + 0x000001c5, 0x000001e5, 0x00000205, 0x00000225, + 0x00000245, 0x00000265, 0x00000285, 0x000002a5, + 0x000002c5, 0x000002e5, 0x00000325, 0x00000365, + 0x000003a5, 0x000003e5, 0x00000425, 0x00000465, + 0x000004a5, 0x000004e5, 0x00000525, 0x00000565, + 0x000005a5, 0x000005e5, 0x00000625, 0x00000665, + 0x000006a5, 0x00000725, 0x000007a5, 0x00000825, + 0x000008a5, 0x00000925, 0x000009a5, 0x00000a25, + 0x00000aa5, 0x00000b25, 0x00000ba5, 0x00000c25, + 0x00000ca5, 0x00000d25, 0x00000da5, 0x00000e25, + 0x00000ea5, 0x00000f25, 0x00000fa5, 0x00001025, + 0x000010a5, 0x000011a5, 0x000012a5, 0x000013a5, + 0x000014a5, 0x000015a5, 0x000016a5, 0x000017a5, + 0x000018a5, 0x000019a5, 0x00001aa5, 0x00001ba5, + 0x00001ca5, 0x00001da5, 0x00001ea5, 0x00001fa5, + 0x000020a5, 0x000021a5, 0x000022a5, 0x000023a5, + 0x000024a5, 0x000026a5, 0x000028a5, 0x00002aa5, + 0x00002ca5, 0x00002ea5, 0x000030a5, 0x000032a5, + 0x000034a5, 0x000036a5, 0x000038a5, 0x00003aa5, + 0x00003ca5, 0x00003ea5, 0x000040a5, 0x000042a5, + 0x000044a5, 0x000046a5, 0x000048a5, 0x00004aa5, + 0x00004ca5, 0x00004ea5, 0x000050a5, 0x000052a5, + 0x000054a5, 0x000056a5, 0x000058a5, 0x00005aa5, + 0x00005ca5, 0x00005ea5, 0x000060a5, 0x000064a5, + 0x000068a5, 0x00006ca5, 0x000070a5, 0x000074a5, + 0x000078a5, 0x00007ca5, 0x000080a5, 0x000084a5, + 0x000088a5, 0x00008ca5, 0x000090a5, 0x000094a5, + 0x000098a5, 0x00009ca5, 0x0000a0a5, 0x0000a4a5, + 0x0000a8a5, 0x0000aca5, 0x0000b0a5, 0x0000b4a5, + 0x0000b8a5, 0x0000bca5, 0x0000c0a5, 0x0000c4a5, + 0x0000c8a5, 0x0000cca5, 0x0000d0a5, 0x0000d4a5, + 0x0000d8a5, 0x0000dca5, 0x0000e0a5, 0x0000e4a5, + 0x0000eca5, 0x0000f4a5, 0x0000fca5, 0x000104a5, + 0x00010ca5, 0x000114a5, 0x00011ca5, 0x000124a5, + 0x00012ca5, 0x000134a5, 0x00013ca5, 0x000144a5, + 0x00014ca5, 0x000154a5, 0x00015ca5, 0x000164a5, + 0x00016ca5, 0x000174a5, 0x00017ca5, 0x000184a5, + 0x00018ca5, 0x000194a5, 0x00019ca5, 0x0001a4a5, + 0x0001aca5, 0x0001b4a5, 0x0001bca5, 0x0001c4a5, + 0x0001cca5, 0x0001d4a5, 0x0001dca5, 0x0001e4a5, + 0x0001eca5, 0x0001f4a5, 0x0001fca5, 0x000204a5, + 0x00020ca5, 0x000214a5, 0x00021ca5, 0x000224a5, + 0x000234a5, 0x000244a5, 0x000254a5, 0x000264a5, + 0x000274a5, 0x000284a5, 0x000294a5, 0x0002a4a5, + 0x0002b4a5, 0x0002c4a5, 0x0002d4a5, 0x0002e4a5, + 0x0002f4a5, 0x000304a5, 0x000314a5, 0x000324a5, + 0x000334a5, 0x000344a5, 0x000354a5, 0x000364a5, + 0x000374a5, 0x000384a5, 0x000394a5, 0x0003a4a5, + 0x0003b4a5, 0x0003c4a5, 0x0003d4a5, 0x0003e4a5, + 0x0003f4a5, 0x000404a5, 0x000414a5, 0x000424a5, + 0x000434a5, 0x000444a5, 0x000454a5, 0x000464a5, + 0x000474a5, 0x000484a5, 0x000494a5, 0x0004a4a5, + 0x0004b4a5, 0x0004c4a5, 0x0004e4a5, 0x000504a5, + 0x000524a5, 0x000544a5, 0x000564a5, 0x000584a5, + 0x0005a4a5, 0x0005c4a5, 0x0005e4a5, 0x000604a5, + 0x000624a5, 0x000644a5, 0x000664a5, 0x000684a5, + 0x0006a4a5, 0x0006c4a5, 0x0006e4a5, 0x000704a5, + 0x000724a5, 0x000744a5, 0x000764a5, 0x000784a5, + 0x0007a4a5, 0x0007c4a5, 0x0007e4a5, 0x000804a5, + 0x000824a5, 0x000844a5, 0x000864a5, 0x000884a5, + 0x0008a4a5, 0x0008c4a5, 0x0008e4a5, 0x000904a5, + 0x000924a5, 0x000944a5, 0x000964a5, 0x000984a5, + 0x0009a4a5, 0x0009c4a5, 0x0009e4a5, 0x000a04a5, + 0x000a24a5, 0x000a44a5, 0x000a64a5, 0x000aa4a5, + 0x000ae4a5, 0x000b24a5, 0x000b64a5, 0x000ba4a5, + 0x000be4a5, 0x000c24a5, 0x000c64a5, 0x000ca4a5, + 0x000ce4a5, 0x000d24a5, 0x000d64a5, 0x000da4a5, + 0x000de4a5, 0x000e24a5, 0x000e64a5, 0x000ea4a5, + 0x000ee4a5, 0x000f24a5, 0x000f64a5, 0x000fa4a5, + 0x000fe4a5, 0x001024a5, 0x001064a5, 0x0010a4a5, + 0x0010e4a5, 0x001124a5, 0x001164a5, 0x0011a4a5, + 0x0011e4a5, 0x001224a5, 0x001264a5, 0x0012a4a5, + 0x0012e4a5, 0x001324a5, 0x001364a5, 0x0013a4a5, + 0x0013e4a5, 0x001424a5, 0x001464a5, 0x0014a4a5, + 0x0014e4a5, 0x001524a5, 0x001564a5, 0x0015a4a5, + 0x0015e4a5, 0x001624a5, 0x001664a5, 0x0016a4a5, + 0x0016e4a5, 0x001724a5, 0x001764a5, 0x0017a4a5, + 0x0017e4a5, 0x001824a5, 0x001864a5, 0x0018a4a5, + 0x0018e4a5, 0x001924a5, 0x001964a5, 0x0019e4a5, + 0x001a64a5, 0x001ae4a5, 0x001b64a5, 0x001be4a5, + 0x001c64a5, 0x001ce4a5, 0x001d64a5, 0x001de4a5, + 0x001e64a5, 0x001ee4a5, 0x001f64a5, 0x001fe4a5, + 0x002064a5, 0x0020e4a5, 0x002164a5, 0x0021e4a5, + 0x002264a5, 0x0022e4a5, 0x002364a5, 0x0023e4a5, + 0x002464a5, 0x0024e4a5, 0x002564a5, 0x0025e4a5, + 0x002664a5, 0x0026e4a5, 0x002764a5, 0x0027e4a5, + 0x002864a5, 0x0028e4a5, 0x002964a5, 0x0029e4a5, + 0x002a64a5, 0x002ae4a5, 0x002b64a5, 0x002be4a5, + 0x002c64a5, 0x002ce4a5, 0x002d64a5, 0x002de4a5, + 0x002e64a5, 0x002ee4a5, 0x002f64a5, 0x002fe4a5, + 0x003064a5, 0x0030e4a5, 0x003164a5, 0x0031e4a5, + 0x003264a5, 0x0032e4a5, 0x003364a5, 0x0033e4a5, + 0x003464a5, 0x0034e4a5, 0x003564a5, 0x0035e4a5, + 0x003664a5, 0x0036e4a5, 0x003764a5, 0x0037e4a5, + 0x003864a5, 0x0038e4a5, 0x003964a5, 0x0039e4a5, + 0x003a64a5, 0x003ae4a5, 0x003b64a5, 0x003be4a5, + 0x003c64a5, 0x003ce4a5, 0x003d64a5, 0x003de4a5, + 0x003ee4a5, 0x003fe4a5, 0x0040e4a5, 0x0041e4a5, + 0x0042e4a5, 0x0043e4a5, 0x0044e4a5, 0x0045e4a5, + 0x0046e4a5, 0x0047e4a5, 0x0048e4a5, 0x0049e4a5, + 0x004ae4a5, 0x004be4a5, 0x004ce4a5, 0x004de4a5, + 0x004ee4a5, 0x004fe4a5, 0x0050e4a5, 0x0051e4a5, + 0x0052e4a5, 0x0053e4a5, 0x0054e4a5, 0x0055e4a5, + 0x0056e4a5, 0x0057e4a5, 0x0058e4a5, 0x0059e4a5, + 0x005ae4a5, 0x005be4a5, 0x005ce4a5, 0x005de4a5, + 0x005ee4a5, 0x005fe4a5, 0x0060e4a5, 0x0061e4a5, + 0x0062e4a5, 0x0063e4a5, 0x0064e4a5, 0x0065e4a5, + 0x0066e4a5, 0x0067e4a5, 0x0068e4a5, 0x0069e4a5, + 0x006ae4a5, 0x006be4a5, 0x006ce4a5, 0x006de4a5, + 0x006ee4a5, 0x006fe4a5, 0x0070e4a5, 0x0071e4a5, + 0x0072e4a5, 0x0073e4a5, 0x0074e4a5, 0x0075e4a5, + 0x0076e4a5, 0x0077e4a5, 0x0078e4a5, 0x0079e4a5, + 0x007ae4a5, 0x007be4a5, 0x007ce4a5, 0x007de4a5, + 0x007ee4a5, 0x007fe4a5, 0x0080e4a5, 0x0081e4a5, + 0x0082e4a5, 0x0083e4a5, 0x0084e4a5, 0x0085e4a5, + 0x0086e4a5, 0x0087e4a5, 0x0088e4a5, 0x0089e4a5, + 0x008ae4a5, 0x008be4a5, 0x008ce4a5, 0x008de4a5, + 0x008fe4a5, 0x0091e4a5, 0x0093e4a5, 0x0095e4a5, + 0x0097e4a5, 0x0099e4a5, 0x009be4a5, 0x009de4a5, + 0x009fe4a5, 0x00a1e4a5, 0x00a3e4a5, 0x00a5e4a5, + 0x00a7e4a5, 0x00a9e4a5, 0x00abe4a5, 0x00ade4a5, + 0x00afe4a5, 0x00b1e4a5, 0x00b3e4a5, 0x00b5e4a5, + 0x00b7e4a5, 0x00b9e4a5, 0x00bbe4a5, 0x00bde4a5, + 0x00bfe4a5, 0x00c1e4a5, 0x00c3e4a5, 0x00c5e4a5, + 0x00c7e4a5, 0x00c9e4a5, 0x00cbe4a5, 0x00cde4a5, + 0x00cfe4a5, 0x00d1e4a5, 0x00d3e4a5, 0x00d5e4a5, + 0x00d7e4a5, 0x00d9e4a5, 0x00dbe4a5, 0x00dde4a5, + 0x00dfe4a5, 0x00e1e4a5, 0x00e3e4a5, 0x00e5e4a5, + 0x00e7e4a5, 0x00e9e4a5, 0x00ebe4a5, 0x00ede4a5, + 0x00efe4a5, 0x00f1e4a5, 0x00f3e4a5, 0x00f5e4a5, + 0x00f7e4a5, 0x00f9e4a5, 0x00fbe4a5, 0x00fde4a5, + 0x00ffe4a5, 0x0101e4a5, 0x0103e4a5, 0x0105e4a5, + 0x0107e4a5, 0x0109e4a5, 0x010be4a5, 0x010de4a5, + 0x010fe4a5, 0x0111e4a5, 0x0113e4a5, 0x0115e4a5, + 0x0117e4a5, 0x0119e4a5, 0x011be4a5, 0x011de4a5, + 0x011fe4a5, 0x0121e4a5, 0x0123e4a5, 0x0125e4a5, + 0x0127e4a5, 0x0129e4a5, 0x012be4a5, 0x012de4a5, + 0x012fe4a5, 0x0131e4a5, 0x0133e4a5, 0x0135e4a5, + 0x0137e4a5, 0x013be4a5, 0x013fe4a5, 0x0143e4a5, + 0x0147e4a5, 0x014be4a5, 0x014fe4a5, 0x0153e4a5, + 0x0157e4a5, 0x015be4a5, 0x015fe4a5, 0x0163e4a5, + 0x0167e4a5, 0x016be4a5, 0x016fe4a5, 0x0173e4a5, + 0x0177e4a5, 0x017be4a5, 0x017fe4a5, 0x0183e4a5, + 0x0187e4a5, 0x018be4a5, 0x018fe4a5, 0x0193e4a5, + 0x0197e4a5, 0x019be4a5, 0x019fe4a5, 0x01a3e4a5, + 0x01a7e4a5, 0x01abe4a5, 0x01afe4a5, 0x01b3e4a5, + 0x01b7e4a5, 0x01bbe4a5, 0x01bfe4a5, 0x01c3e4a5, + 0x01c7e4a5, 0x01cbe4a5, 0x01cfe4a5, 0x01d3e4a5, + 0x01d7e4a5, 0x01dbe4a5, 0x01dfe4a5, 0x01e3e4a5, + 0x01e7e4a5, 0x01ebe4a5, 0x01efe4a5, 0x01f3e4a5, + 0x01f7e4a5, 0x01fbe4a5, 0x01ffe4a5, 0x0203e4a5, + 0x0207e4a5, 0x020be4a5, 0x020fe4a5, 0x0213e4a5, + 0x0217e4a5, 0x021be4a5, 0x021fe4a5, 0x0223e4a5, + 0x0227e4a5, 0x022be4a5, 0x022fe4a5, 0x0233e4a5, + 0x0237e4a5, 0x023be4a5, 0x023fe4a5, 0x0243e4a5, + 0x0247e4a5, 0x024be4a5, 0x024fe4a5, 0x0253e4a5, + 0x0257e4a5, 0x025be4a5, 0x025fe4a5, 0x0263e4a5, + 0x0267e4a5, 0x026be4a5, 0x026fe4a5, 0x0273e4a5, + 0x0277e4a5, 0x027be4a5, 0x027fe4a5, 0x0283e4a5, + 0x0287e4a5, 0x028be4a5, 0x028fe4a5, 0x0293e4a5, + 0x0297e4a5, 0x029be4a5, 0x029fe4a5, 0x02a3e4a5, + 0x02a7e4a5, 0x02abe4a5, 0x02afe4a5, 0x02b3e4a5, + 0x02bbe4a5, 0x02c3e4a5, 0x02cbe4a5, 0x02d3e4a5, + 0x02dbe4a5, 0x02e3e4a5, 0x02ebe4a5, 0x02f3e4a5, + 0x02fbe4a5, 0x0303e4a5, 0x030be4a5, 0x0313e4a5, + 0x031be4a5, 0x0323e4a5, 0x032be4a5, 0x0333e4a5, + 0x033be4a5, 0x0343e4a5, 0x034be4a5, 0x0353e4a5, + 0x035be4a5, 0x0363e4a5, 0x036be4a5, 0x0373e4a5, + 0x037be4a5, 0x0383e4a5, 0x038be4a5, 0x0393e4a5, + 0x039be4a5, 0x03a3e4a5, 0x03abe4a5, 0x03b3e4a5, + 0x03bbe4a5, 0x03c3e4a5, 0x03cbe4a5, 0x03d3e4a5, + 0x03dbe4a5, 0x03e3e4a5, 0x03ebe4a5, 0x03f3e4a5, + 0x03fbe4a5, 0x0403e4a5, 0x040be4a5, 0x0413e4a5, + 0x041be4a5, 0x0423e4a5, 0x042be4a5, 0x0433e4a5, + 0x043be4a5, 0x0443e4a5, 0x044be4a5, 0x0453e4a5, + 0x045be4a5, 0x0463e4a5, 0x046be4a5, 0x0473e4a5, + 0x047be4a5, 0x0483e4a5, 0x048be4a5, 0x0493e4a5, + 0x049be4a5, 0x04a3e4a5, 0x04abe4a5, 0x04b3e4a5, + 0x04bbe4a5, 0x04c3e4a5, 0x04cbe4a5, 0x04d3e4a5, + 0x04dbe4a5, 0x04e3e4a5, 0x04ebe4a5, 0x04f3e4a5, + 0x04fbe4a5, 0x0503e4a5, 0x050be4a5, 0x0513e4a5, + 0x051be4a5, 0x0523e4a5, 0x052be4a5, 0x0533e4a5, + 0x053be4a5, 0x0543e4a5, 0x054be4a5, 0x0553e4a5, + 0x055be4a5, 0x0563e4a5, 0x056be4a5, 0x0573e4a5, + 0x057be4a5, 0x0583e4a5, 0x058be4a5, 0x0593e4a5, + 0x059be4a5, 0x05a3e4a5, 0x05abe4a5, 0x05b3e4a5, + 0x05bbe4a5, 0x05c3e4a5, 0x05cbe4a5, 0x05d3e4a5, + 0x05dbe4a5, 0x05e3e4a5, 0x05ebe4a5, 0x05f3e4a5, + 0x05fbe4a5, 0x060be4a5, 0x061be4a5, 0x062be4a5, + 0x063be4a5, 0x064be4a5, 0x065be4a5, 0x465be4a5, + /* The last entry is extra; it is equal to LZMS_MAX_MATCH_OFFSET + 1 and + * is here to aid binary search. */ +}; + +/* Table: offset slot => number of extra offset bits */ +const u8 lzms_extra_offset_bits[LZMS_MAX_NUM_OFFSET_SYMS] = { + 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2, + 2 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4, + 4 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5, + 5 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6, + 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7, + 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8, + 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9, + 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9, + 9 , 9 , 9 , 9 , 9 , 9 , 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 30, +}; + +/* Table: length slot => length slot base value */ +const u32 lzms_length_slot_base[LZMS_NUM_LENGTH_SYMS + 1] = { + 0x00000001, 0x00000002, 0x00000003, 0x00000004, + 0x00000005, 0x00000006, 0x00000007, 0x00000008, + 0x00000009, 0x0000000a, 0x0000000b, 0x0000000c, + 0x0000000d, 0x0000000e, 0x0000000f, 0x00000010, + 0x00000011, 0x00000012, 0x00000013, 0x00000014, + 0x00000015, 0x00000016, 0x00000017, 0x00000018, + 0x00000019, 0x0000001a, 0x0000001b, 0x0000001d, + 0x0000001f, 0x00000021, 0x00000023, 0x00000027, + 0x0000002b, 0x0000002f, 0x00000033, 0x00000037, + 0x0000003b, 0x00000043, 0x0000004b, 0x00000053, + 0x0000005b, 0x0000006b, 0x0000007b, 0x0000008b, + 0x0000009b, 0x000000ab, 0x000000cb, 0x000000eb, + 0x0000012b, 0x000001ab, 0x000002ab, 0x000004ab, + 0x000008ab, 0x000108ab, 0x400108ab, + /* The last entry is extra; it is equal to LZMS_MAX_MATCH_LENGTH + 1 and + * is here to aid binary search. */ +}; + +/* Table: length slot => number of extra length bits */ +const u8 lzms_extra_length_bits[LZMS_NUM_LENGTH_SYMS] = { + 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , + 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , + 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , + 0 , 0 , 1 , 1 , 1 , 1 , 2 , 2 , + 2 , 2 , 2 , 2 , 3 , 3 , 3 , 3 , + 4 , 4 , 4 , 4 , 4 , 5 , 5 , 6 , + 7 , 8 , 9 , 10, 16, 30, +}; + +unsigned +lzms_get_slot(u32 value, const u32 slot_base_tab[], unsigned num_slots) +{ + unsigned l = 0; + unsigned r = num_slots - 1; + for (;;) { + unsigned slot = (l + r) / 2; + if (value >= slot_base_tab[slot]) { + if (value < slot_base_tab[slot + 1]) + return slot; + else + l = slot + 1; + } else { + r = slot - 1; + } + } +} + +/* Return the number of offset slots used when processing a buffer having the + * specified uncompressed size. */ +unsigned +lzms_get_num_offset_slots(size_t uncompressed_size) +{ + if (uncompressed_size < 2) + return 0; + return 1 + lzms_get_offset_slot(uncompressed_size - 1); +} + +void +lzms_init_probabilities(struct lzms_probabilites *probs) +{ + struct lzms_probability_entry *entries = + (struct lzms_probability_entry *)probs; + size_t num_entries = sizeof(struct lzms_probabilites) / + sizeof(struct lzms_probability_entry); + for (size_t i = 0; i < num_entries; i++) { + entries[i].num_recent_zero_bits = LZMS_INITIAL_PROBABILITY; + entries[i].recent_bits = LZMS_INITIAL_RECENT_BITS; + } +} + +void +lzms_init_symbol_frequencies(u32 freqs[], unsigned num_syms) +{ + for (unsigned sym = 0; sym < num_syms; sym++) + freqs[sym] = 1; +} + +void +lzms_dilute_symbol_frequencies(u32 freqs[], unsigned num_syms) +{ + for (unsigned sym = 0; sym < num_syms; sym++) + freqs[sym] = (freqs[sym] >> 1) + 1; +} + + +#ifdef __x86_64__ +static forceinline u8 * +find_next_opcode_sse4_2(u8 *p) +{ + const __v16qi potential_opcodes = (__v16qi) {0x48, 0x4C, 0xE8, 0xE9, 0xF0, 0xFF}; + __asm__( + " pcmpestri $0x0, (%[p]), %[potential_opcodes] \n" + " jc 2f \n" + "1: \n" + " add $0x10, %[p] \n" + " pcmpestri $0x0, (%[p]), %[potential_opcodes] \n" + " jnc 1b \n" + "2: \n" + #ifdef __ILP32__ /* x32 ABI (x86_64 with 32-bit pointers) */ + " add %%ecx, %[p] \n" + #else + " add %%rcx, %[p] \n" + #endif + : [p] "+r" (p) + : [potential_opcodes] "x" (potential_opcodes), "a" (6), "d" (16) + : "rcx", "cc" + ); + + return p; +} +#endif /* __x86_64__ */ + +static forceinline u8 * +find_next_opcode_default(u8 *p) +{ + /* + * The following table is used to accelerate the common case where the + * byte has nothing to do with x86 translation and must simply be + * skipped. This was faster than the following alternatives: + * - Jump table with 256 entries + * - Switch statement with default + */ + static const u8 is_potential_opcode[256] = { + [0x48] = 1, [0x4C] = 1, [0xE8] = 1, + [0xE9] = 1, [0xF0] = 1, [0xFF] = 1, + }; + + for (;;) { + if (is_potential_opcode[*p]) + break; + p++; + if (is_potential_opcode[*p]) + break; + p++; + if (is_potential_opcode[*p]) + break; + p++; + if (is_potential_opcode[*p]) + break; + p++; + } + return p; +} + +static forceinline u8 * +translate_if_needed(u8 *data, u8 *p, s32 *last_x86_pos, + s32 last_target_usages[], bool undo) +{ + s32 max_trans_offset; + s32 opcode_nbytes; + u16 target16; + s32 i; + + max_trans_offset = LZMS_X86_MAX_TRANSLATION_OFFSET; + + /* + * p[0] has one of the following values: + * 0x48 0x4C 0xE8 0xE9 0xF0 0xFF + */ + + if (p[0] >= 0xF0) { + if (p[0] & 0x0F) { + /* 0xFF (instruction group) */ + if (p[1] == 0x15) { + /* Call indirect relative */ + opcode_nbytes = 2; + goto have_opcode; + } + } else { + /* 0xF0 (lock prefix) */ + if (p[1] == 0x83 && p[2] == 0x05) { + /* Lock add relative */ + opcode_nbytes = 3; + goto have_opcode; + } + } + } else if (p[0] <= 0x4C) { + + /* 0x48 or 0x4C. In 64-bit code this is a REX prefix byte with + * W=1, R=[01], X=0, and B=0, and it will be followed by the + * actual opcode, then additional bytes depending on the opcode. + * We are most interested in several common instructions that + * access data relative to the instruction pointer. These use a + * 1-byte opcode, followed by a ModR/M byte, followed by a + * 4-byte displacement. */ + + /* Test: does the ModR/M byte indicate RIP-relative addressing? + * Note: there seems to be a mistake in the format here; the + * mask really should be 0xC7 instead of 0x07 so that both the + * MOD and R/M fields of ModR/M are tested, not just R/M. */ + if ((p[2] & 0x07) == 0x05) { + /* Check for the LEA (load effective address) or MOV + * (move) opcodes. For MOV there are additional + * restrictions, although it seems they are only helpful + * due to the overly lax ModR/M test. */ + if (p[1] == 0x8D || + (p[1] == 0x8B && !(p[0] & 0x04) && !(p[2] & 0xF0))) + { + opcode_nbytes = 3; + goto have_opcode; + } + } + } else { + if (p[0] & 0x01) { + /* 0xE9: Jump relative. Theoretically this would be + * useful to translate, but in fact it's explicitly + * excluded. Most likely it creates too many false + * positives for the detection algorithm. */ + p += 4; + } else { + /* 0xE8: Call relative. This is a common case, so it + * uses a reduced max_trans_offset. In other words, we + * have to be more confident that the data actually is + * x86 machine code before we'll do the translation. */ + opcode_nbytes = 1; + max_trans_offset >>= 1; + goto have_opcode; + } + } + + return p + 1; + +have_opcode: + i = p - data; + p += opcode_nbytes; + if (undo) { + if (i - *last_x86_pos <= max_trans_offset) { + u32 n = get_unaligned_le32(p); + put_unaligned_le32(n - i, p); + } + target16 = i + get_unaligned_le16(p); + } else { + target16 = i + get_unaligned_le16(p); + if (i - *last_x86_pos <= max_trans_offset) { + u32 n = get_unaligned_le32(p); + put_unaligned_le32(n + i, p); + } + } + + i += opcode_nbytes + sizeof(le32) - 1; + + if (i - last_target_usages[target16] <= LZMS_X86_ID_WINDOW_SIZE) + *last_x86_pos = i; + + last_target_usages[target16] = i; + + return p + sizeof(le32); +} + +/* + * Translate relative addresses embedded in x86 instructions into absolute + * addresses (@undo == %false), or undo this translation (@undo == %true). + * + * Absolute addresses are usually more compressible by LZ factorization. + * + * @last_target_usages must be a temporary array of length >= 65536. + */ +void +lzms_x86_filter(u8 data[restrict], s32 size, + s32 last_target_usages[restrict], bool undo) +{ + /* + * Note: this filter runs unconditionally and uses a custom algorithm to + * detect data regions that probably contain x86 code. + * + * 'last_x86_pos' tracks the most recent position that has a good chance + * of being the start of an x86 instruction. When the filter detects a + * likely x86 instruction, it updates this variable and considers the + * next LZMS_X86_MAX_TRANSLATION_OFFSET bytes of data as valid for x86 + * translations. + * + * If part of the data does not, in fact, contain x86 machine code, then + * 'last_x86_pos' will, very likely, eventually fall more than + * LZMS_X86_MAX_TRANSLATION_OFFSET bytes behind the current position. + * This results in x86 translations being disabled until the next likely + * x86 instruction is detected. + * + * To identify "likely x86 instructions", the algorithm attempts to + * track the position of the most recent potential relative-addressing + * instruction that referenced each possible memory address. If it + * finds two references to the same memory address within an + * LZMS_X86_ID_WINDOW_SIZE-byte sized window, then the second reference + * is flagged as a likely x86 instruction. Since the instructions + * considered for translation necessarily use relative addressing, the + * algorithm does a tentative translation into absolute addresses. In + * addition, so that memory addresses can be looked up in an array of + * reasonable size (in this code, 'last_target_usages'), only the + * low-order 2 bytes of each address are considered significant. + */ + + u8 *p; + u8 *tail_ptr; + s32 last_x86_pos = -LZMS_X86_MAX_TRANSLATION_OFFSET - 1; + + if (size <= 17) + return; + + for (s32 i = 0; i < 65536; i++) + last_target_usages[i] = -(s32)LZMS_X86_ID_WINDOW_SIZE - 1; + + /* + * Optimization: only check for end-of-buffer when we already have a + * byte that is a potential opcode for x86 translation. To do this, + * overwrite one of the bytes near the end of the buffer, and restore it + * later. The correctness of this optimization relies on two + * characteristics of compressed format: + * + * 1. No translation can follow an opcode beginning in the last 16 + * bytes. + * 2. A translation following an opcode starting at the last possible + * position (17 bytes from the end) never extends more than 7 bytes. + * Consequently, we can overwrite any of the bytes starting at + * data[(size - 16) + 7] and have no effect on the result, as long + * as we restore those bytes later. + */ + + /* Note: the very first byte must be ignored completely! */ + p = data + 1; + tail_ptr = &data[size - 16]; + +#ifdef __x86_64__ + if (cpu_features & X86_CPU_FEATURE_SSE4_2) { + u8 saved_byte = *tail_ptr; + *tail_ptr = 0xE8; + for (;;) { + u8 *new_p = find_next_opcode_sse4_2(p); + if (new_p >= tail_ptr - 8) + break; + p = new_p; + p = translate_if_needed(data, p, &last_x86_pos, + last_target_usages, undo); + } + *tail_ptr = saved_byte; + } +#endif + { + u8 saved_byte = *(tail_ptr + 8); + *(tail_ptr + 8) = 0xE8; + for (;;) { + p = find_next_opcode_default(p); + if (p >= tail_ptr) + break; + p = translate_if_needed(data, p, &last_x86_pos, + last_target_usages, undo); + } + *(tail_ptr + 8) = saved_byte; + } +} diff --git a/src/wimlib/lzms_compress.c b/src/wimlib/lzms_compress.c new file mode 100644 index 00000000..e55a32b8 --- /dev/null +++ b/src/wimlib/lzms_compress.c @@ -0,0 +1,2228 @@ +/* + * lzms_compress.c + * + * A compressor for the LZMS compression format. + */ + +/* + * Copyright (C) 2013, 2014, 2015 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <limits.h> +#include <string.h> + +#include "wimlib/compress_common.h" +#include "wimlib/compressor_ops.h" +#include "wimlib/error.h" +#include "wimlib/lcpit_matchfinder.h" +#include "wimlib/lzms_common.h" +#include "wimlib/matchfinder_common.h" +#include "wimlib/unaligned.h" +#include "wimlib/util.h" + +/* + * MAX_FAST_LENGTH is the maximum match length for which the length slot can be + * looked up directly in 'fast_length_slot_tab' and the length cost can be + * looked up directly in 'fast_length_cost_tab'. + * + * We also limit the 'nice_match_len' parameter to this value. Consequently, if + * the longest match found is shorter than 'nice_match_len', then it must also + * be shorter than MAX_FAST_LENGTH. This makes it possible to do fast lookups + * of length costs using 'fast_length_cost_tab' without having to keep checking + * whether the length exceeds MAX_FAST_LENGTH or not. + */ +#define MAX_FAST_LENGTH 255 + +/* NUM_OPTIM_NODES is the maximum number of bytes the parsing algorithm will + * step forward before forcing the pending items to be encoded. If this value + * is increased, then there will be fewer forced flushes, but the probability + * entries and Huffman codes will be more likely to become outdated. */ +#define NUM_OPTIM_NODES 2048 + +/* COST_SHIFT is a scaling factor that makes it possible to consider fractional + * bit costs. A single bit has a cost of (1 << COST_SHIFT). */ +#define COST_SHIFT 6 + +/* Length of the hash table for finding delta matches */ +#define DELTA_HASH_ORDER 17 +#define DELTA_HASH_LENGTH ((u32)1 << DELTA_HASH_ORDER) + +/* The number of bytes to hash when finding delta matches; also taken to be the + * minimum length of an explicit offset delta match */ +#define NBYTES_HASHED_FOR_DELTA 3 + +/* The number of delta match powers to consider (must be <= + * LZMS_NUM_DELTA_POWER_SYMS) */ +#define NUM_POWERS_TO_CONSIDER 6 + +/* This structure tracks the state of writing bits as a series of 16-bit coding + * units, starting at the end of the output buffer and proceeding backwards. */ +struct lzms_output_bitstream { + + /* Bits that haven't yet been written to the output buffer */ + u64 bitbuf; + + /* Number of bits currently held in @bitbuf */ + unsigned bitcount; + + /* Pointer to the beginning of the output buffer (this is the "end" when + * writing backwards!) */ + u8 *begin; + + /* Pointer to just past the next position in the output buffer at which + * to output a 16-bit coding unit */ + u8 *next; +}; + +/* This structure tracks the state of range encoding and its output, which + * starts at the beginning of the output buffer and proceeds forwards. */ +struct lzms_range_encoder { + + /* The lower boundary of the current range. Logically, this is a 33-bit + * integer whose high bit is needed to detect carries. */ + u64 lower_bound; + + /* The size of the current range */ + u32 range_size; + + /* The next 16-bit coding unit to output */ + u16 cache; + + /* The number of 16-bit coding units whose output has been delayed due + * to possible carrying. The first such coding unit is @cache; all + * subsequent such coding units are 0xffff. */ + u32 cache_size; + + /* Pointer to the beginning of the output buffer */ + u8 *begin; + + /* Pointer to the position in the output buffer at which the next coding + * unit must be written */ + u8 *next; + + /* Pointer to just past the end of the output buffer */ + u8 *end; +}; + +/* Bookkeeping information for an adaptive Huffman code */ +struct lzms_huffman_rebuild_info { + + /* The remaining number of symbols to encode until this code must be + * rebuilt */ + unsigned num_syms_until_rebuild; + + /* The number of symbols in this code */ + unsigned num_syms; + + /* The rebuild frequency of this code, in symbols */ + unsigned rebuild_freq; + + /* The Huffman codeword of each symbol in this code */ + u32 *codewords; + + /* The length of each Huffman codeword, in bits */ + u8 *lens; + + /* The frequency of each symbol in this code */ + u32 *freqs; +}; + +/* + * The compressor-internal representation of a match or literal. + * + * Literals have length=1; matches have length > 1. (We disallow matches of + * length 1, even though this is a valid length in LZMS.) + * + * The source is encoded as follows: + * + * - Literals: the literal byte itself + * - Explicit offset LZ matches: the match offset plus (LZMS_NUM_LZ_REPS - 1) + * - Repeat offset LZ matches: the index of the offset in recent_lz_offsets + * - Explicit offset delta matches: DELTA_SOURCE_TAG is set, the next 3 bits are + * the power, and the remainder is the raw offset plus (LZMS_NUM_DELTA_REPS-1) + * - Repeat offset delta matches: DELTA_SOURCE_TAG is set, and the remainder is + * the index of the (power, raw_offset) pair in recent_delta_pairs + */ +struct lzms_item { + u32 length; + u32 source; +}; + +#define DELTA_SOURCE_TAG ((u32)1 << 31) +#define DELTA_SOURCE_POWER_SHIFT 28 +#define DELTA_SOURCE_RAW_OFFSET_MASK (((u32)1 << DELTA_SOURCE_POWER_SHIFT) - 1) + +static void __attribute__((unused)) +check_that_powers_fit_in_bitfield(void) +{ + STATIC_ASSERT(LZMS_NUM_DELTA_POWER_SYMS <= (1 << (31 - DELTA_SOURCE_POWER_SHIFT))); +} + +/* A stripped-down version of the adaptive state in LZMS which excludes the + * probability entries and Huffman codes */ +struct lzms_adaptive_state { + + /* Recent offsets for LZ matches */ + u32 recent_lz_offsets[LZMS_NUM_LZ_REPS + 1]; + u32 prev_lz_offset; /* 0 means none */ + u32 upcoming_lz_offset; /* 0 means none */ + + /* Recent (power, raw offset) pairs for delta matches. + * The low DELTA_SOURCE_POWER_SHIFT bits of each entry are the raw + * offset, and the high bits are the power. */ + u32 recent_delta_pairs[LZMS_NUM_DELTA_REPS + 1]; + u32 prev_delta_pair; /* 0 means none */ + u32 upcoming_delta_pair; /* 0 means none */ + + /* States for predicting the probabilities of item types */ + u8 main_state; + u8 match_state; + u8 lz_state; + u8 lz_rep_states[LZMS_NUM_LZ_REP_DECISIONS]; + u8 delta_state; + u8 delta_rep_states[LZMS_NUM_DELTA_REP_DECISIONS]; +} __attribute__((aligned(64))); + +/* + * This structure represents a byte position in the preprocessed input data and + * a node in the graph of possible match/literal choices. + * + * Logically, each incoming edge to this node is labeled with a literal or a + * match that can be taken to reach this position from an earlier position; and + * each outgoing edge from this node is labeled with a literal or a match that + * can be taken to advance from this position to a later position. + */ +struct lzms_optimum_node { + + /* + * The cost of the lowest-cost path that has been found to reach this + * position. This can change as progressively lower cost paths are + * found to reach this position. + */ + u32 cost; +#define INFINITE_COST UINT32_MAX + + /* + * @item is the last item that was taken to reach this position to reach + * it with the stored @cost. This can change as progressively lower + * cost paths are found to reach this position. + * + * In some cases we look ahead more than one item. If we looked ahead n + * items to reach this position, then @item is the last item taken, + * @extra_items contains the other items ordered from second-to-last to + * first, and @num_extra_items is n - 1. + */ + unsigned num_extra_items; + struct lzms_item item; + struct lzms_item extra_items[2]; + + /* + * The adaptive state that exists at this position. This is filled in + * lazily, only after the minimum-cost path to this position is found. + * + * Note: the way the algorithm handles this adaptive state in the + * "minimum-cost" parse is actually only an approximation. It's + * possible for the globally optimal, minimum cost path to contain a + * prefix, ending at a position, where that path prefix is *not* the + * minimum cost path to that position. This can happen if such a path + * prefix results in a different adaptive state which results in lower + * costs later. Although the algorithm does do some heuristic + * multi-item lookaheads, it does not solve this problem in general. + * + * Note: this adaptive state structure also does not include the + * probability entries or current Huffman codewords. Those aren't + * maintained per-position and are only updated occasionally. + */ + struct lzms_adaptive_state state; +} __attribute__((aligned(64))); + +/* The main compressor structure */ +struct lzms_compressor { + + /* The matchfinder for LZ matches */ + struct lcpit_matchfinder mf; + + /* The preprocessed buffer of data being compressed */ + u8 *in_buffer; + + /* The number of bytes of data to be compressed, which is the number of + * bytes of data in @in_buffer that are actually valid */ + size_t in_nbytes; + + /* + * Boolean flags to enable consideration of various types of multi-step + * operations during parsing. + * + * Among other cases, multi-step operations can help with gaps where two + * matches are separated by a non-matching byte. + * + * This idea is borrowed from Igor Pavlov's LZMA encoder. + */ + bool try_lit_lzrep0; + bool try_lzrep_lit_lzrep0; + bool try_lzmatch_lit_lzrep0; + + /* + * If true, the compressor can use delta matches. This slows down + * compression. It improves the compression ratio greatly, slightly, or + * not at all, depending on the input data. + */ + bool use_delta_matches; + + /* If true, the compressor need not preserve the input buffer if it + * compresses the data successfully. */ + bool destructive; + + /* 'last_target_usages' is a large array that is only needed for + * preprocessing, so it is in union with fields that don't need to be + * initialized until after preprocessing. */ + union { + struct { + + /* Temporary space to store matches found by the LZ matchfinder */ + struct lz_match matches[MAX_FAST_LENGTH - LZMS_MIN_MATCH_LENGTH + 1]; + + /* Hash table for finding delta matches */ + u32 delta_hash_table[DELTA_HASH_LENGTH]; + + /* For each delta power, the hash code for the next sequence */ + u32 next_delta_hashes[NUM_POWERS_TO_CONSIDER]; + + /* The per-byte graph nodes for near-optimal parsing */ + struct lzms_optimum_node optimum_nodes[NUM_OPTIM_NODES + MAX_FAST_LENGTH + + 1 + MAX_FAST_LENGTH]; + + /* Table: length => current cost for small match lengths */ + u32 fast_length_cost_tab[MAX_FAST_LENGTH + 1]; + + /* Range encoder which outputs to the beginning of the compressed data + * buffer, proceeding forwards */ + struct lzms_range_encoder rc; + + /* Bitstream which outputs to the end of the compressed data buffer, + * proceeding backwards */ + struct lzms_output_bitstream os; + + /* States and probability entries for item type disambiguation */ + unsigned main_state; + unsigned match_state; + unsigned lz_state; + unsigned lz_rep_states[LZMS_NUM_LZ_REP_DECISIONS]; + unsigned delta_state; + unsigned delta_rep_states[LZMS_NUM_DELTA_REP_DECISIONS]; + struct lzms_probabilites probs; + + /* Huffman codes */ + + struct lzms_huffman_rebuild_info literal_rebuild_info; + u32 literal_codewords[LZMS_NUM_LITERAL_SYMS]; + u8 literal_lens[LZMS_NUM_LITERAL_SYMS]; + u32 literal_freqs[LZMS_NUM_LITERAL_SYMS]; + + struct lzms_huffman_rebuild_info lz_offset_rebuild_info; + u32 lz_offset_codewords[LZMS_MAX_NUM_OFFSET_SYMS]; + u8 lz_offset_lens[LZMS_MAX_NUM_OFFSET_SYMS]; + u32 lz_offset_freqs[LZMS_MAX_NUM_OFFSET_SYMS]; + + struct lzms_huffman_rebuild_info length_rebuild_info; + u32 length_codewords[LZMS_NUM_LENGTH_SYMS]; + u8 length_lens[LZMS_NUM_LENGTH_SYMS]; + u32 length_freqs[LZMS_NUM_LENGTH_SYMS]; + + struct lzms_huffman_rebuild_info delta_offset_rebuild_info; + u32 delta_offset_codewords[LZMS_MAX_NUM_OFFSET_SYMS]; + u8 delta_offset_lens[LZMS_MAX_NUM_OFFSET_SYMS]; + u32 delta_offset_freqs[LZMS_MAX_NUM_OFFSET_SYMS]; + + struct lzms_huffman_rebuild_info delta_power_rebuild_info; + u32 delta_power_codewords[LZMS_NUM_DELTA_POWER_SYMS]; + u8 delta_power_lens[LZMS_NUM_DELTA_POWER_SYMS]; + u32 delta_power_freqs[LZMS_NUM_DELTA_POWER_SYMS]; + + }; /* struct */ + + s32 last_target_usages[65536]; + + }; /* union */ + + /* Table: length => length slot for small match lengths */ + u8 fast_length_slot_tab[MAX_FAST_LENGTH + 1]; + + /* Tables for mapping offsets to offset slots */ + + /* slots [0, 167); 0 <= num_extra_bits <= 10 */ + u8 offset_slot_tab_1[0xe4a5]; + + /* slots [167, 427); 11 <= num_extra_bits <= 15 */ + u16 offset_slot_tab_2[0x3d0000 >> 11]; + + /* slots [427, 799); 16 <= num_extra_bits */ + u16 offset_slot_tab_3[((LZMS_MAX_MATCH_OFFSET + 1) - 0xe4a5) >> 16]; +}; + +/****************************************************************************** + * Offset and length slot acceleration * + ******************************************************************************/ + +/* Generate the acceleration table for length slots. */ +static void +lzms_init_fast_length_slot_tab(struct lzms_compressor *c) +{ + unsigned slot = 0; + for (u32 len = LZMS_MIN_MATCH_LENGTH; len <= MAX_FAST_LENGTH; len++) { + if (len >= lzms_length_slot_base[slot + 1]) + slot++; + c->fast_length_slot_tab[len] = slot; + } +} + +/* Generate the acceleration tables for offset slots. */ +static void +lzms_init_offset_slot_tabs(struct lzms_compressor *c) +{ + u32 offset; + unsigned slot = 0; + + /* slots [0, 167); 0 <= num_extra_bits <= 10 */ + for (offset = 1; offset < 0xe4a5; offset++) { + if (offset >= lzms_offset_slot_base[slot + 1]) + slot++; + c->offset_slot_tab_1[offset] = slot; + } + + /* slots [167, 427); 11 <= num_extra_bits <= 15 */ + for (; offset < 0x3de4a5; offset += (u32)1 << 11) { + if (offset >= lzms_offset_slot_base[slot + 1]) + slot++; + c->offset_slot_tab_2[(offset - 0xe4a5) >> 11] = slot; + } + + /* slots [427, 799); 16 <= num_extra_bits */ + for (; offset < LZMS_MAX_MATCH_OFFSET + 1; offset += (u32)1 << 16) { + if (offset >= lzms_offset_slot_base[slot + 1]) + slot++; + c->offset_slot_tab_3[(offset - 0xe4a5) >> 16] = slot; + } +} + +/* + * Return the length slot for the specified match length, using the compressor's + * acceleration table if the length is small enough. + */ +static forceinline unsigned +lzms_comp_get_length_slot(const struct lzms_compressor *c, u32 length) +{ + if (likely(length <= MAX_FAST_LENGTH)) + return c->fast_length_slot_tab[length]; + return lzms_get_length_slot(length); +} + +/* + * Return the offset slot for the specified match offset, using the compressor's + * acceleration tables to speed up the mapping. + */ +static forceinline unsigned +lzms_comp_get_offset_slot(const struct lzms_compressor *c, u32 offset) +{ + if (offset < 0xe4a5) + return c->offset_slot_tab_1[offset]; + offset -= 0xe4a5; + if (offset < 0x3d0000) + return c->offset_slot_tab_2[offset >> 11]; + return c->offset_slot_tab_3[offset >> 16]; +} + +/****************************************************************************** + * Range encoding * + ******************************************************************************/ + +/* + * Initialize the range encoder @rc to write forwards to the specified buffer + * @out that is @size bytes long. + */ +static void +lzms_range_encoder_init(struct lzms_range_encoder *rc, u8 *out, size_t size) +{ + rc->lower_bound = 0; + rc->range_size = 0xffffffff; + rc->cache = 0; + rc->cache_size = 1; + rc->begin = out; + rc->next = out - sizeof(le16); + rc->end = out + (size & ~1); +} + +/* + * Attempt to flush bits from the range encoder. + * + * The basic idea is that we're writing bits from @rc->lower_bound to the + * output. However, due to carrying, the writing of coding units with the + * maximum value, as well as one prior coding unit, must be delayed until it is + * determined whether a carry is needed. + * + * This is based on the public domain code for LZMA written by Igor Pavlov, but + * with the following differences: + * + * - In LZMS, 16-bit coding units are required rather than 8-bit. + * + * - In LZMS, the first coding unit is not ignored by the decompressor, so + * the encoder cannot output a dummy value to that position. + */ +static void +lzms_range_encoder_shift_low(struct lzms_range_encoder *rc) +{ + if ((u32)(rc->lower_bound) < 0xffff0000 || + (u32)(rc->lower_bound >> 32) != 0) + { + /* Carry not needed (rc->lower_bound < 0xffff0000), or carry + * occurred ((rc->lower_bound >> 32) != 0, a.k.a. the carry bit + * is 1). */ + do { + if (likely(rc->next >= rc->begin)) { + if (rc->next != rc->end) { + put_unaligned_le16(rc->cache + + (u16)(rc->lower_bound >> 32), + rc->next); + rc->next += sizeof(le16); + } + } else { + rc->next += sizeof(le16); + } + rc->cache = 0xffff; + } while (--rc->cache_size != 0); + + rc->cache = (rc->lower_bound >> 16) & 0xffff; + } + ++rc->cache_size; + rc->lower_bound = (rc->lower_bound & 0xffff) << 16; +} + +static bool +lzms_range_encoder_flush(struct lzms_range_encoder *rc) +{ + for (int i = 0; i < 4; i++) + lzms_range_encoder_shift_low(rc); + return rc->next != rc->end; +} + +/* + * Encode the next bit using the range encoder. + * + * @prob is the probability out of LZMS_PROBABILITY_DENOMINATOR that the next + * bit is 0 rather than 1. + */ +static forceinline void +lzms_range_encode_bit(struct lzms_range_encoder *rc, int bit, u32 prob) +{ + /* Normalize if needed. */ + if (rc->range_size <= 0xffff) { + rc->range_size <<= 16; + lzms_range_encoder_shift_low(rc); + } + + u32 bound = (rc->range_size >> LZMS_PROBABILITY_BITS) * prob; + if (bit == 0) { + rc->range_size = bound; + } else { + rc->lower_bound += bound; + rc->range_size -= bound; + } +} + +/* + * Encode a bit. This wraps around lzms_range_encode_bit() to handle using and + * updating the state and its corresponding probability entry. + */ +static forceinline void +lzms_encode_bit(int bit, unsigned *state_p, unsigned num_states, + struct lzms_probability_entry *probs, + struct lzms_range_encoder *rc) +{ + struct lzms_probability_entry *prob_entry; + u32 prob; + + /* Load the probability entry for the current state. */ + prob_entry = &probs[*state_p]; + + /* Update the state based on the next bit. */ + *state_p = ((*state_p << 1) | bit) & (num_states - 1); + + /* Get the probability that the bit is 0. */ + prob = lzms_get_probability(prob_entry); + + /* Update the probability entry. */ + lzms_update_probability_entry(prob_entry, bit); + + /* Encode the bit using the range encoder. */ + lzms_range_encode_bit(rc, bit, prob); +} + +/* Helper functions for encoding bits in the various decision classes */ + +static void +lzms_encode_main_bit(struct lzms_compressor *c, int bit) +{ + lzms_encode_bit(bit, &c->main_state, LZMS_NUM_MAIN_PROBS, + c->probs.main, &c->rc); +} + +static void +lzms_encode_match_bit(struct lzms_compressor *c, int bit) +{ + lzms_encode_bit(bit, &c->match_state, LZMS_NUM_MATCH_PROBS, + c->probs.match, &c->rc); +} + +static void +lzms_encode_lz_bit(struct lzms_compressor *c, int bit) +{ + lzms_encode_bit(bit, &c->lz_state, LZMS_NUM_LZ_PROBS, + c->probs.lz, &c->rc); +} + +static void +lzms_encode_lz_rep_bit(struct lzms_compressor *c, int bit, int idx) +{ + lzms_encode_bit(bit, &c->lz_rep_states[idx], LZMS_NUM_LZ_REP_PROBS, + c->probs.lz_rep[idx], &c->rc); +} + +static void +lzms_encode_delta_bit(struct lzms_compressor *c, int bit) +{ + lzms_encode_bit(bit, &c->delta_state, LZMS_NUM_DELTA_PROBS, + c->probs.delta, &c->rc); +} + +static void +lzms_encode_delta_rep_bit(struct lzms_compressor *c, int bit, int idx) +{ + lzms_encode_bit(bit, &c->delta_rep_states[idx], LZMS_NUM_DELTA_REP_PROBS, + c->probs.delta_rep[idx], &c->rc); +} + +/****************************************************************************** + * Huffman encoding and verbatim bits * + ******************************************************************************/ + +/* + * Initialize the output bitstream @os to write backwards to the specified + * buffer @out that is @size bytes long. + */ +static void +lzms_output_bitstream_init(struct lzms_output_bitstream *os, + u8 *out, size_t size) +{ + os->bitbuf = 0; + os->bitcount = 0; + os->begin = out; + os->next = out + (size & ~1); +} + +/* + * Write some bits, contained in the low-order @num_bits bits of @bits, to the + * output bitstream @os. + * + * @max_num_bits is a compile-time constant that specifies the maximum number of + * bits that can ever be written at this call site. + */ +static forceinline void +lzms_write_bits(struct lzms_output_bitstream *os, const u32 bits, + const unsigned num_bits, const unsigned max_num_bits) +{ + /* Add the bits to the bit buffer variable. */ + os->bitcount += num_bits; + os->bitbuf = (os->bitbuf << num_bits) | bits; + + /* Check whether any coding units need to be written. */ + while (os->bitcount >= 16) { + + os->bitcount -= 16; + + /* Write a coding unit, unless it would underflow the buffer. */ + if (os->next != os->begin) { + os->next -= sizeof(le16); + put_unaligned_le16(os->bitbuf >> os->bitcount, os->next); + } + + /* Optimization for call sites that never write more than 16 + * bits at once. */ + if (max_num_bits <= 16) + break; + } +} + +/* + * Flush the output bitstream, ensuring that all bits written to it have been + * written to memory. Return %true if all bits have been output successfully, + * or %false if an overrun occurred. + */ +static bool +lzms_output_bitstream_flush(struct lzms_output_bitstream *os) +{ + if (os->next == os->begin) + return false; + + if (os->bitcount != 0) { + os->next -= sizeof(le16); + put_unaligned_le16(os->bitbuf << (16 - os->bitcount), os->next); + } + + return true; +} + +static void +lzms_build_huffman_code(struct lzms_huffman_rebuild_info *rebuild_info) +{ + make_canonical_huffman_code(rebuild_info->num_syms, + LZMS_MAX_CODEWORD_LENGTH, + rebuild_info->freqs, + rebuild_info->lens, + rebuild_info->codewords); + rebuild_info->num_syms_until_rebuild = rebuild_info->rebuild_freq; +} + +static void +lzms_init_huffman_code(struct lzms_huffman_rebuild_info *rebuild_info, + unsigned num_syms, unsigned rebuild_freq, + u32 *codewords, u8 *lens, u32 *freqs) +{ + rebuild_info->num_syms = num_syms; + rebuild_info->rebuild_freq = rebuild_freq; + rebuild_info->codewords = codewords; + rebuild_info->lens = lens; + rebuild_info->freqs = freqs; + lzms_init_symbol_frequencies(freqs, num_syms); + lzms_build_huffman_code(rebuild_info); +} + +static void +lzms_rebuild_huffman_code(struct lzms_huffman_rebuild_info *rebuild_info) +{ + lzms_build_huffman_code(rebuild_info); + lzms_dilute_symbol_frequencies(rebuild_info->freqs, rebuild_info->num_syms); +} + +/* + * Encode a symbol using the specified Huffman code. Then, if the Huffman code + * needs to be rebuilt, rebuild it and return true; otherwise return false. + */ +static forceinline bool +lzms_huffman_encode_symbol(unsigned sym, + const u32 *codewords, const u8 *lens, u32 *freqs, + struct lzms_output_bitstream *os, + struct lzms_huffman_rebuild_info *rebuild_info) +{ + lzms_write_bits(os, codewords[sym], lens[sym], LZMS_MAX_CODEWORD_LENGTH); + ++freqs[sym]; + if (--rebuild_info->num_syms_until_rebuild == 0) { + lzms_rebuild_huffman_code(rebuild_info); + return true; + } + return false; +} + +/* Helper routines to encode symbols using the various Huffman codes */ + +static bool +lzms_encode_literal_symbol(struct lzms_compressor *c, unsigned sym) +{ + return lzms_huffman_encode_symbol(sym, c->literal_codewords, + c->literal_lens, c->literal_freqs, + &c->os, &c->literal_rebuild_info); +} + +static bool +lzms_encode_lz_offset_symbol(struct lzms_compressor *c, unsigned sym) +{ + return lzms_huffman_encode_symbol(sym, c->lz_offset_codewords, + c->lz_offset_lens, c->lz_offset_freqs, + &c->os, &c->lz_offset_rebuild_info); +} + +static bool +lzms_encode_length_symbol(struct lzms_compressor *c, unsigned sym) +{ + return lzms_huffman_encode_symbol(sym, c->length_codewords, + c->length_lens, c->length_freqs, + &c->os, &c->length_rebuild_info); +} + +static bool +lzms_encode_delta_offset_symbol(struct lzms_compressor *c, unsigned sym) +{ + return lzms_huffman_encode_symbol(sym, c->delta_offset_codewords, + c->delta_offset_lens, c->delta_offset_freqs, + &c->os, &c->delta_offset_rebuild_info); +} + +static bool +lzms_encode_delta_power_symbol(struct lzms_compressor *c, unsigned sym) +{ + return lzms_huffman_encode_symbol(sym, c->delta_power_codewords, + c->delta_power_lens, c->delta_power_freqs, + &c->os, &c->delta_power_rebuild_info); +} + +static void +lzms_update_fast_length_costs(struct lzms_compressor *c); + +/* + * Encode a match length. If this causes the Huffman code for length symbols to + * be rebuilt, also update the length costs array used by the parser. + */ +static void +lzms_encode_length(struct lzms_compressor *c, u32 length) +{ + unsigned slot = lzms_comp_get_length_slot(c, length); + + if (lzms_encode_length_symbol(c, slot)) + lzms_update_fast_length_costs(c); + + lzms_write_bits(&c->os, length - lzms_length_slot_base[slot], + lzms_extra_length_bits[slot], + LZMS_MAX_EXTRA_LENGTH_BITS); +} + +/* Encode the offset of an LZ match. */ +static void +lzms_encode_lz_offset(struct lzms_compressor *c, u32 offset) +{ + unsigned slot = lzms_comp_get_offset_slot(c, offset); + + lzms_encode_lz_offset_symbol(c, slot); + lzms_write_bits(&c->os, offset - lzms_offset_slot_base[slot], + lzms_extra_offset_bits[slot], + LZMS_MAX_EXTRA_OFFSET_BITS); +} + +/* Encode the raw offset of a delta match. */ +static void +lzms_encode_delta_raw_offset(struct lzms_compressor *c, u32 raw_offset) +{ + unsigned slot = lzms_comp_get_offset_slot(c, raw_offset); + + lzms_encode_delta_offset_symbol(c, slot); + lzms_write_bits(&c->os, raw_offset - lzms_offset_slot_base[slot], + lzms_extra_offset_bits[slot], + LZMS_MAX_EXTRA_OFFSET_BITS); +} + +/****************************************************************************** + * Item encoding * + ******************************************************************************/ + +/* Encode the specified item, which may be a literal or any type of match. */ +static void +lzms_encode_item(struct lzms_compressor *c, u32 length, u32 source) +{ + /* Main bit: 0 = literal, 1 = match */ + int main_bit = (length > 1); + lzms_encode_main_bit(c, main_bit); + + if (!main_bit) { + /* Literal */ + unsigned literal = source; + lzms_encode_literal_symbol(c, literal); + } else { + /* Match */ + + /* Match bit: 0 = LZ match, 1 = delta match */ + int match_bit = (source & DELTA_SOURCE_TAG) != 0; + lzms_encode_match_bit(c, match_bit); + + if (!match_bit) { + /* LZ match */ + + /* LZ bit: 0 = explicit offset, 1 = repeat offset */ + int lz_bit = (source < LZMS_NUM_LZ_REPS); + lzms_encode_lz_bit(c, lz_bit); + + if (!lz_bit) { + /* Explicit offset LZ match */ + u32 offset = source - (LZMS_NUM_LZ_REPS - 1); + lzms_encode_lz_offset(c, offset); + } else { + /* Repeat offset LZ match */ + int rep_idx = source; + for (int i = 0; i < rep_idx; i++) + lzms_encode_lz_rep_bit(c, 1, i); + if (rep_idx < LZMS_NUM_LZ_REP_DECISIONS) + lzms_encode_lz_rep_bit(c, 0, rep_idx); + } + } else { + /* Delta match */ + + source &= ~DELTA_SOURCE_TAG; + + /* Delta bit: 0 = explicit offset, 1 = repeat offset */ + int delta_bit = (source < LZMS_NUM_DELTA_REPS); + lzms_encode_delta_bit(c, delta_bit); + + if (!delta_bit) { + /* Explicit offset delta match */ + u32 power = source >> DELTA_SOURCE_POWER_SHIFT; + u32 raw_offset = (source & DELTA_SOURCE_RAW_OFFSET_MASK) - + (LZMS_NUM_DELTA_REPS - 1); + lzms_encode_delta_power_symbol(c, power); + lzms_encode_delta_raw_offset(c, raw_offset); + } else { + /* Repeat offset delta match */ + int rep_idx = source; + for (int i = 0; i < rep_idx; i++) + lzms_encode_delta_rep_bit(c, 1, i); + if (rep_idx < LZMS_NUM_DELTA_REP_DECISIONS) + lzms_encode_delta_rep_bit(c, 0, rep_idx); + } + } + + /* Match length (encoded the same way for any match type) */ + lzms_encode_length(c, length); + } +} + +/* Encode a list of matches and literals chosen by the parsing algorithm. */ +static void +lzms_encode_nonempty_item_list(struct lzms_compressor *c, + struct lzms_optimum_node *end_node) +{ + /* Since we've stored at each node the item we took to arrive at that + * node, we can trace our chosen path in backwards order. However, for + * encoding we need to trace our chosen path in forwards order. To make + * this possible, the following loop moves the items from their + * destination nodes to their source nodes, which effectively reverses + * the path. (Think of it like reversing a singly-linked list.) */ + struct lzms_optimum_node *cur_node = end_node; + struct lzms_item saved_item = cur_node->item; + do { + struct lzms_item item = saved_item; + if (cur_node->num_extra_items > 0) { + /* Handle an arrival via multi-item lookahead. */ + unsigned i = 0; + struct lzms_optimum_node *orig_node = cur_node; + do { + cur_node -= item.length; + cur_node->item = item; + item = orig_node->extra_items[i]; + } while (++i != orig_node->num_extra_items); + } + cur_node -= item.length; + saved_item = cur_node->item; + cur_node->item = item; + } while (cur_node != c->optimum_nodes); + + /* Now trace the chosen path in forwards order, encoding each item. */ + do { + lzms_encode_item(c, cur_node->item.length, cur_node->item.source); + cur_node += cur_node->item.length; + } while (cur_node != end_node); +} + +static forceinline void +lzms_encode_item_list(struct lzms_compressor *c, + struct lzms_optimum_node *end_node) +{ + if (end_node != c->optimum_nodes) + lzms_encode_nonempty_item_list(c, end_node); +} + +/****************************************************************************** + * Cost evaluation * + ******************************************************************************/ + +/* + * If p is the predicted probability of the next bit being a 0, then the number + * of bits required to encode a 0 bit using a binary range encoder is the real + * number -log2(p), and the number of bits required to encode a 1 bit is the + * real number -log2(1 - p). To avoid computing either of these expressions at + * runtime, 'lzms_bit_costs' is a precomputed table that stores a mapping from + * probability to cost for each possible probability. Specifically, the array + * indices are the numerators of the possible probabilities in LZMS, where the + * denominators are LZMS_PROBABILITY_DENOMINATOR; and the stored costs are the + * bit costs multiplied by 1<<COST_SHIFT and rounded to the nearest integer. + * Furthermore, the values stored for 0% and 100% probabilities are equal to the + * adjacent values, since these probabilities are not actually permitted. This + * allows us to use the num_recent_zero_bits value from the + * lzms_probability_entry as the array index without fixing up these two special + * cases. + */ +static const u32 lzms_bit_costs[LZMS_PROBABILITY_DENOMINATOR + 1] = { + 384, 384, 320, 283, 256, 235, 219, 204, + 192, 181, 171, 163, 155, 147, 140, 134, + 128, 122, 117, 112, 107, 103, 99, 94, + 91, 87, 83, 80, 76, 73, 70, 67, + 64, 61, 58, 56, 53, 51, 48, 46, + 43, 41, 39, 37, 35, 33, 30, 29, + 27, 25, 23, 21, 19, 17, 16, 14, + 12, 11, 9, 8, 6, 4, 3, 1, + 1 +}; + +static void __attribute__((unused)) +check_cost_shift(void) +{ + /* lzms_bit_costs is hard-coded to the current COST_SHIFT. */ + STATIC_ASSERT(COST_SHIFT == 6); +} + +#if 0 +#include <math.h> + +static void +lzms_compute_bit_costs(void) +{ + for (u32 i = 0; i <= LZMS_PROBABILITY_DENOMINATOR; i++) { + u32 prob = i; + if (prob == 0) + prob++; + else if (prob == LZMS_PROBABILITY_DENOMINATOR) + prob--; + + lzms_bit_costs[i] = round(-log2((double)prob / LZMS_PROBABILITY_DENOMINATOR) * + (1 << COST_SHIFT)); + } +} +#endif + +/* Return the cost to encode a 0 bit in the specified context. */ +static forceinline u32 +lzms_bit_0_cost(unsigned state, const struct lzms_probability_entry *probs) +{ + return lzms_bit_costs[probs[state].num_recent_zero_bits]; +} + +/* Return the cost to encode a 1 bit in the specified context. */ +static forceinline u32 +lzms_bit_1_cost(unsigned state, const struct lzms_probability_entry *probs) +{ + return lzms_bit_costs[LZMS_PROBABILITY_DENOMINATOR - + probs[state].num_recent_zero_bits]; +} + +/* Return the cost to encode a literal, including the main bit. */ +static forceinline u32 +lzms_literal_cost(struct lzms_compressor *c, unsigned main_state, unsigned literal) +{ + return lzms_bit_0_cost(main_state, c->probs.main) + + ((u32)c->literal_lens[literal] << COST_SHIFT); +} + +/* Update 'fast_length_cost_tab' to use the latest Huffman code. */ +static void +lzms_update_fast_length_costs(struct lzms_compressor *c) +{ + int slot = -1; + u32 cost = 0; + for (u32 len = LZMS_MIN_MATCH_LENGTH; len <= MAX_FAST_LENGTH; len++) { + if (len >= lzms_length_slot_base[slot + 1]) { + slot++; + cost = (u32)(c->length_lens[slot] + + lzms_extra_length_bits[slot]) << COST_SHIFT; + } + c->fast_length_cost_tab[len] = cost; + } +} + +/* Return the cost to encode the specified match length, which must not exceed + * MAX_FAST_LENGTH. */ +static forceinline u32 +lzms_fast_length_cost(const struct lzms_compressor *c, u32 length) +{ + return c->fast_length_cost_tab[length]; +} + +/* Return the cost to encode the specified LZ match offset. */ +static forceinline u32 +lzms_lz_offset_cost(const struct lzms_compressor *c, u32 offset) +{ + unsigned slot = lzms_comp_get_offset_slot(c, offset); + u32 num_bits = c->lz_offset_lens[slot] + lzms_extra_offset_bits[slot]; + return num_bits << COST_SHIFT; +} + +/* Return the cost to encode the specified delta power and raw offset. */ +static forceinline u32 +lzms_delta_source_cost(const struct lzms_compressor *c, u32 power, u32 raw_offset) +{ + unsigned slot = lzms_comp_get_offset_slot(c, raw_offset); + u32 num_bits = c->delta_power_lens[power] + c->delta_offset_lens[slot] + + lzms_extra_offset_bits[slot]; + return num_bits << COST_SHIFT; +} + +/****************************************************************************** + * Adaptive state * + ******************************************************************************/ + +static void +lzms_init_adaptive_state(struct lzms_adaptive_state *state) +{ + for (int i = 0; i < LZMS_NUM_LZ_REPS + 1; i++) + state->recent_lz_offsets[i] = i + 1; + state->prev_lz_offset = 0; + state->upcoming_lz_offset = 0; + + for (int i = 0; i < LZMS_NUM_DELTA_REPS + 1; i++) + state->recent_delta_pairs[i] = i + 1; + state->prev_delta_pair = 0; + state->upcoming_delta_pair = 0; + + state->main_state = 0; + state->match_state = 0; + state->lz_state = 0; + for (int i = 0; i < LZMS_NUM_LZ_REP_DECISIONS; i++) + state->lz_rep_states[i] = 0; + state->delta_state = 0; + for (int i = 0; i < LZMS_NUM_DELTA_REP_DECISIONS; i++) + state->delta_rep_states[i] = 0; +} + +/* + * Update the LRU queues for match sources when advancing by one item. + * + * Note: using LZMA as a point of comparison, the LRU queues in LZMS are more + * complex because: + * - there are separate queues for LZ and delta matches + * - updates to the queues are delayed by one encoded item (this prevents + * sources from being bumped up to index 0 too early) + */ +static void +lzms_update_lru_queues(struct lzms_adaptive_state *state) +{ + if (state->prev_lz_offset != 0) { + for (int i = LZMS_NUM_LZ_REPS - 1; i >= 0; i--) + state->recent_lz_offsets[i + 1] = state->recent_lz_offsets[i]; + state->recent_lz_offsets[0] = state->prev_lz_offset; + } + state->prev_lz_offset = state->upcoming_lz_offset; + + if (state->prev_delta_pair != 0) { + for (int i = LZMS_NUM_DELTA_REPS - 1; i >= 0; i--) + state->recent_delta_pairs[i + 1] = state->recent_delta_pairs[i]; + state->recent_delta_pairs[0] = state->prev_delta_pair; + } + state->prev_delta_pair = state->upcoming_delta_pair; +} + +static forceinline void +lzms_update_state(u8 *state_p, int bit, unsigned num_states) +{ + *state_p = ((*state_p << 1) | bit) & (num_states - 1); +} + +static forceinline void +lzms_update_main_state(struct lzms_adaptive_state *state, int is_match) +{ + lzms_update_state(&state->main_state, is_match, LZMS_NUM_MAIN_PROBS); +} + +static forceinline void +lzms_update_match_state(struct lzms_adaptive_state *state, int is_delta) +{ + lzms_update_state(&state->match_state, is_delta, LZMS_NUM_MATCH_PROBS); +} + +static forceinline void +lzms_update_lz_state(struct lzms_adaptive_state *state, int is_rep) +{ + lzms_update_state(&state->lz_state, is_rep, LZMS_NUM_LZ_PROBS); +} + +static forceinline void +lzms_update_lz_rep_states(struct lzms_adaptive_state *state, int rep_idx) +{ + for (int i = 0; i < rep_idx; i++) + lzms_update_state(&state->lz_rep_states[i], 1, LZMS_NUM_LZ_REP_PROBS); + + if (rep_idx < LZMS_NUM_LZ_REP_DECISIONS) + lzms_update_state(&state->lz_rep_states[rep_idx], 0, LZMS_NUM_LZ_REP_PROBS); +} + +static forceinline void +lzms_update_delta_state(struct lzms_adaptive_state *state, int is_rep) +{ + lzms_update_state(&state->delta_state, is_rep, LZMS_NUM_DELTA_PROBS); +} + +static forceinline void +lzms_update_delta_rep_states(struct lzms_adaptive_state *state, int rep_idx) +{ + for (int i = 0; i < rep_idx; i++) + lzms_update_state(&state->delta_rep_states[i], 1, LZMS_NUM_DELTA_REP_PROBS); + + if (rep_idx < LZMS_NUM_DELTA_REP_DECISIONS) + lzms_update_state(&state->delta_rep_states[rep_idx], 0, LZMS_NUM_DELTA_REP_PROBS); +} + +/****************************************************************************** + * Matchfinding * + ******************************************************************************/ + +/* Note: this code just handles finding delta matches. The code for finding LZ + * matches is elsewhere. */ + + +/* Initialize the delta matchfinder for a new input buffer. */ +static void +lzms_init_delta_matchfinder(struct lzms_compressor *c) +{ + /* Set all entries to use an invalid power, which will never match. */ + STATIC_ASSERT(NUM_POWERS_TO_CONSIDER < (1 << (32 - DELTA_SOURCE_POWER_SHIFT))); + memset(c->delta_hash_table, 0xFF, sizeof(c->delta_hash_table)); + + /* Initialize the next hash code for each power. We can just use zeroes + * initially; it doesn't really matter. */ + for (u32 i = 0; i < NUM_POWERS_TO_CONSIDER; i++) + c->next_delta_hashes[i] = 0; +} + +/* + * Compute a DELTA_HASH_ORDER-bit hash code for the first + * NBYTES_HASHED_FOR_DELTA bytes of the sequence beginning at @p when taken in a + * delta context with the specified @span. + */ +static forceinline u32 +lzms_delta_hash(const u8 *p, const u32 pos, u32 span) +{ + /* A delta match has a certain span and an offset that is a multiple of + * that span. To reduce wasted space we use a single combined hash + * table for all spans and positions, but to minimize collisions we + * include in the hash code computation the span and the low-order bits + * of the current position. */ + + STATIC_ASSERT(NBYTES_HASHED_FOR_DELTA == 3); + u8 d0 = *(p + 0) - *(p + 0 - span); + u8 d1 = *(p + 1) - *(p + 1 - span); + u8 d2 = *(p + 2) - *(p + 2 - span); + u32 v = ((span + (pos & (span - 1))) << 24) | + ((u32)d2 << 16) | ((u32)d1 << 8) | d0; + return lz_hash(v, DELTA_HASH_ORDER); +} + +/* + * Given a match between @in_next and @matchptr in a delta context with the + * specified @span and having the initial @len, extend the match as far as + * possible, up to a limit of @max_len. + */ +static forceinline u32 +lzms_extend_delta_match(const u8 *in_next, const u8 *matchptr, + u32 len, u32 max_len, u32 span) +{ + while (len < max_len && + (u8)(*(in_next + len) - *(in_next + len - span)) == + (u8)(*(matchptr + len) - *(matchptr + len - span))) + { + len++; + } + return len; +} + +static void +lzms_delta_matchfinder_skip_bytes(struct lzms_compressor *c, + const u8 *in_next, u32 count) +{ + u32 pos = in_next - c->in_buffer; + if (unlikely(c->in_nbytes - (pos + count) <= NBYTES_HASHED_FOR_DELTA + 1)) + return; + do { + /* Update the hash table for each power. */ + for (u32 power = 0; power < NUM_POWERS_TO_CONSIDER; power++) { + const u32 span = (u32)1 << power; + if (unlikely(pos < span)) + continue; + const u32 next_hash = lzms_delta_hash(in_next + 1, pos + 1, span); + const u32 hash = c->next_delta_hashes[power]; + c->delta_hash_table[hash] = + (power << DELTA_SOURCE_POWER_SHIFT) | pos; + c->next_delta_hashes[power] = next_hash; + prefetchw(&c->delta_hash_table[next_hash]); + } + } while (in_next++, pos++, --count); +} + +/* + * Skip the next @count bytes (don't search for matches at them). @in_next + * points to the first byte to skip. The return value is @in_next + count. + */ +static const u8 * +lzms_skip_bytes(struct lzms_compressor *c, u32 count, const u8 *in_next) +{ + lcpit_matchfinder_skip_bytes(&c->mf, count); + if (c->use_delta_matches) + lzms_delta_matchfinder_skip_bytes(c, in_next, count); + return in_next + count; +} + +/****************************************************************************** + * "Near-optimal" parsing * + ******************************************************************************/ + +/* + * The main near-optimal parsing routine. + * + * Briefly, the algorithm does an approximate minimum-cost path search to find a + * "near-optimal" sequence of matches and literals to output, based on the + * current cost model. The algorithm steps forward, position by position (byte + * by byte), and updates the minimum cost path to reach each later position that + * can be reached using a match or literal from the current position. This is + * essentially Dijkstra's algorithm in disguise: the graph nodes are positions, + * the graph edges are possible matches/literals to code, and the cost of each + * edge is the estimated number of bits (scaled up by COST_SHIFT) that will be + * required to output the corresponding match or literal. But one difference is + * that we actually compute the lowest-cost path in pieces, where each piece is + * terminated when there are no choices to be made. + * + * The costs of literals and matches are estimated using the range encoder + * states and the semi-adaptive Huffman codes. Except for range encoding + * states, costs are assumed to be constant throughout a single run of the + * parsing algorithm, which can parse up to NUM_OPTIM_NODES bytes of data. This + * introduces a source of non-optimality because the probabilities and Huffman + * codes can change over this part of the data. And of course, there are + * various other reasons why the result isn't optimal in terms of compression + * ratio. + */ +static void +lzms_near_optimal_parse(struct lzms_compressor *c) +{ + const u8 *in_next = c->in_buffer; + const u8 * const in_end = &c->in_buffer[c->in_nbytes]; + struct lzms_optimum_node *cur_node; + struct lzms_optimum_node *end_node; + + /* Set initial length costs for lengths <= MAX_FAST_LENGTH. */ + lzms_update_fast_length_costs(c); + + /* Set up the initial adaptive state. */ + lzms_init_adaptive_state(&c->optimum_nodes[0].state); + +begin: + /* Start building a new list of items, which will correspond to the next + * piece of the overall minimum-cost path. */ + + cur_node = c->optimum_nodes; + cur_node->cost = 0; + end_node = cur_node; + + if (in_next == in_end) + return; + + /* The following loop runs once for each per byte in the input buffer, + * except in a few shortcut cases. */ + for (;;) { + u32 num_matches; + + /* Repeat offset LZ matches */ + if (likely(in_next - c->in_buffer >= LZMS_NUM_LZ_REPS && + in_end - in_next >= 2)) + { + for (int rep_idx = 0; rep_idx < LZMS_NUM_LZ_REPS; rep_idx++) { + + /* Looking for a repeat offset LZ match at queue + * index @rep_idx */ + + const u32 offset = cur_node->state.recent_lz_offsets[rep_idx]; + const u8 * const matchptr = in_next - offset; + + /* Check the first 2 bytes before entering the extension loop. */ + if (load_u16_unaligned(in_next) != load_u16_unaligned(matchptr)) + continue; + + /* Extend the match to its full length. */ + const u32 rep_len = lz_extend(in_next, matchptr, 2, in_end - in_next); + + /* Early out for long repeat offset LZ match */ + if (rep_len >= c->mf.nice_match_len) { + + in_next = lzms_skip_bytes(c, rep_len, in_next); + + lzms_encode_item_list(c, cur_node); + lzms_encode_item(c, rep_len, rep_idx); + + c->optimum_nodes[0].state = cur_node->state; + cur_node = &c->optimum_nodes[0]; + + cur_node->state.upcoming_lz_offset = + cur_node->state.recent_lz_offsets[rep_idx]; + cur_node->state.upcoming_delta_pair = 0; + for (int i = rep_idx; i < LZMS_NUM_LZ_REPS; i++) + cur_node->state.recent_lz_offsets[i] = + cur_node->state.recent_lz_offsets[i + 1]; + lzms_update_lru_queues(&cur_node->state); + lzms_update_main_state(&cur_node->state, 1); + lzms_update_match_state(&cur_node->state, 0); + lzms_update_lz_state(&cur_node->state, 1); + lzms_update_lz_rep_states(&cur_node->state, rep_idx); + goto begin; + } + + while (end_node < cur_node + rep_len) + (++end_node)->cost = INFINITE_COST; + + u32 base_cost = cur_node->cost + + lzms_bit_1_cost(cur_node->state.main_state, + c->probs.main) + + lzms_bit_0_cost(cur_node->state.match_state, + c->probs.match) + + lzms_bit_1_cost(cur_node->state.lz_state, + c->probs.lz); + + for (int i = 0; i < rep_idx; i++) + base_cost += lzms_bit_1_cost(cur_node->state.lz_rep_states[i], + c->probs.lz_rep[i]); + + if (rep_idx < LZMS_NUM_LZ_REP_DECISIONS) + base_cost += lzms_bit_0_cost(cur_node->state.lz_rep_states[rep_idx], + c->probs.lz_rep[rep_idx]); + + u32 len = 2; + do { + u32 cost = base_cost + lzms_fast_length_cost(c, len); + if (cost < (cur_node + len)->cost) { + (cur_node + len)->cost = cost; + (cur_node + len)->item = (struct lzms_item) { + .length = len, + .source = rep_idx, + }; + (cur_node + len)->num_extra_items = 0; + } + } while (++len <= rep_len); + + + /* try LZ-rep + lit + LZ-rep0 */ + if (c->try_lzrep_lit_lzrep0 && + in_end - (in_next + rep_len) >= 3 && + load_u16_unaligned(in_next + rep_len + 1) == + load_u16_unaligned(matchptr + rep_len + 1)) + { + const u32 rep0_len = lz_extend(in_next + rep_len + 1, + matchptr + rep_len + 1, + 2, + min(c->mf.nice_match_len, + in_end - (in_next + rep_len + 1))); + + unsigned main_state = cur_node->state.main_state; + unsigned match_state = cur_node->state.match_state; + unsigned lz_state = cur_node->state.lz_state; + unsigned lz_rep0_state = cur_node->state.lz_rep_states[0]; + + /* update states for LZ-rep */ + main_state = ((main_state << 1) | 1) % LZMS_NUM_MAIN_PROBS; + match_state = ((match_state << 1) | 0) % LZMS_NUM_MATCH_PROBS; + lz_state = ((lz_state << 1) | 1) % LZMS_NUM_LZ_PROBS; + lz_rep0_state = ((lz_rep0_state << 1) | (rep_idx > 0)) % + LZMS_NUM_LZ_REP_PROBS; + + /* LZ-rep cost */ + u32 cost = base_cost + lzms_fast_length_cost(c, rep_len); + + /* add literal cost */ + cost += lzms_literal_cost(c, main_state, *(in_next + rep_len)); + + /* update state for literal */ + main_state = ((main_state << 1) | 0) % LZMS_NUM_MAIN_PROBS; + + /* add LZ-rep0 cost */ + cost += lzms_bit_1_cost(main_state, c->probs.main) + + lzms_bit_0_cost(match_state, c->probs.match) + + lzms_bit_1_cost(lz_state, c->probs.lz) + + lzms_bit_0_cost(lz_rep0_state, c->probs.lz_rep[0]) + + lzms_fast_length_cost(c, rep0_len); + + const u32 total_len = rep_len + 1 + rep0_len; + + while (end_node < cur_node + total_len) + (++end_node)->cost = INFINITE_COST; + + if (cost < (cur_node + total_len)->cost) { + (cur_node + total_len)->cost = cost; + (cur_node + total_len)->item = (struct lzms_item) { + .length = rep0_len, + .source = 0, + }; + (cur_node + total_len)->extra_items[0] = (struct lzms_item) { + .length = 1, + .source = *(in_next + rep_len), + }; + (cur_node + total_len)->extra_items[1] = (struct lzms_item) { + .length = rep_len, + .source = rep_idx, + }; + (cur_node + total_len)->num_extra_items = 2; + } + } + } + } + + /* Repeat offset delta matches */ + if (c->use_delta_matches && + likely(in_next - c->in_buffer >= LZMS_NUM_DELTA_REPS + 1 && + (in_end - in_next >= 2))) + { + for (int rep_idx = 0; rep_idx < LZMS_NUM_DELTA_REPS; rep_idx++) { + + /* Looking for a repeat offset delta match at + * queue index @rep_idx */ + + const u32 pair = cur_node->state.recent_delta_pairs[rep_idx]; + const u32 power = pair >> DELTA_SOURCE_POWER_SHIFT; + const u32 raw_offset = pair & DELTA_SOURCE_RAW_OFFSET_MASK; + const u32 span = (u32)1 << power; + const u32 offset = raw_offset << power; + const u8 * const matchptr = in_next - offset; + + /* Check the first 2 bytes before entering the + * extension loop. */ + if (((u8)(*(in_next + 0) - *(in_next + 0 - span)) != + (u8)(*(matchptr + 0) - *(matchptr + 0 - span))) || + ((u8)(*(in_next + 1) - *(in_next + 1 - span)) != + (u8)(*(matchptr + 1) - *(matchptr + 1 - span)))) + continue; + + /* Extend the match to its full length. */ + const u32 rep_len = lzms_extend_delta_match(in_next, matchptr, + 2, in_end - in_next, + span); + + /* Early out for long repeat offset delta match */ + if (rep_len >= c->mf.nice_match_len) { + + in_next = lzms_skip_bytes(c, rep_len, in_next); + + lzms_encode_item_list(c, cur_node); + lzms_encode_item(c, rep_len, DELTA_SOURCE_TAG | rep_idx); + + c->optimum_nodes[0].state = cur_node->state; + cur_node = &c->optimum_nodes[0]; + + cur_node->state.upcoming_delta_pair = pair; + cur_node->state.upcoming_lz_offset = 0; + for (int i = rep_idx; i < LZMS_NUM_DELTA_REPS; i++) + cur_node->state.recent_delta_pairs[i] = + cur_node->state.recent_delta_pairs[i + 1]; + lzms_update_lru_queues(&cur_node->state); + lzms_update_main_state(&cur_node->state, 1); + lzms_update_match_state(&cur_node->state, 1); + lzms_update_delta_state(&cur_node->state, 1); + lzms_update_delta_rep_states(&cur_node->state, rep_idx); + goto begin; + } + + while (end_node < cur_node + rep_len) + (++end_node)->cost = INFINITE_COST; + + u32 base_cost = cur_node->cost + + lzms_bit_1_cost(cur_node->state.main_state, + c->probs.main) + + lzms_bit_1_cost(cur_node->state.match_state, + c->probs.match) + + lzms_bit_1_cost(cur_node->state.delta_state, + c->probs.delta); + + for (int i = 0; i < rep_idx; i++) + base_cost += lzms_bit_1_cost(cur_node->state.delta_rep_states[i], + c->probs.delta_rep[i]); + + if (rep_idx < LZMS_NUM_DELTA_REP_DECISIONS) + base_cost += lzms_bit_0_cost(cur_node->state.delta_rep_states[rep_idx], + c->probs.delta_rep[rep_idx]); + + u32 len = 2; + do { + u32 cost = base_cost + lzms_fast_length_cost(c, len); + if (cost < (cur_node + len)->cost) { + (cur_node + len)->cost = cost; + (cur_node + len)->item = (struct lzms_item) { + .length = len, + .source = DELTA_SOURCE_TAG | rep_idx, + }; + (cur_node + len)->num_extra_items = 0; + } + } while (++len <= rep_len); + } + } + + /* Explicit offset LZ matches */ + num_matches = lcpit_matchfinder_get_matches(&c->mf, c->matches); + if (num_matches) { + + u32 best_len = c->matches[0].length; + + /* Early out for long explicit offset LZ match */ + if (best_len >= c->mf.nice_match_len) { + + const u32 offset = c->matches[0].offset; + + /* Extend the match as far as possible. + * This is necessary because the LCP-interval + * tree matchfinder only reports up to + * nice_match_len bytes. */ + best_len = lz_extend(in_next, in_next - offset, + best_len, in_end - in_next); + + in_next = lzms_skip_bytes(c, best_len - 1, in_next + 1); + + lzms_encode_item_list(c, cur_node); + lzms_encode_item(c, best_len, offset + LZMS_NUM_LZ_REPS - 1); + + c->optimum_nodes[0].state = cur_node->state; + cur_node = &c->optimum_nodes[0]; + + cur_node->state.upcoming_lz_offset = offset; + cur_node->state.upcoming_delta_pair = 0; + lzms_update_lru_queues(&cur_node->state); + lzms_update_main_state(&cur_node->state, 1); + lzms_update_match_state(&cur_node->state, 0); + lzms_update_lz_state(&cur_node->state, 0); + goto begin; + } + + while (end_node < cur_node + best_len) + (++end_node)->cost = INFINITE_COST; + + u32 base_cost = cur_node->cost + + lzms_bit_1_cost(cur_node->state.main_state, + c->probs.main) + + lzms_bit_0_cost(cur_node->state.match_state, + c->probs.match) + + lzms_bit_0_cost(cur_node->state.lz_state, + c->probs.lz); + + if (c->try_lzmatch_lit_lzrep0 && + likely(in_end - (in_next + c->matches[0].length) >= 3)) + { + /* try LZ-match + lit + LZ-rep0 */ + + u32 l = 2; + u32 i = num_matches - 1; + do { + const u32 len = c->matches[i].length; + const u32 offset = c->matches[i].offset; + const u32 position_cost = base_cost + + lzms_lz_offset_cost(c, offset); + do { + u32 cost = position_cost + lzms_fast_length_cost(c, l); + if (cost < (cur_node + l)->cost) { + (cur_node + l)->cost = cost; + (cur_node + l)->item = (struct lzms_item) { + .length = l, + .source = offset + (LZMS_NUM_LZ_REPS - 1), + }; + (cur_node + l)->num_extra_items = 0; + } + } while (++l <= len); + + const u8 * const matchptr = in_next - offset; + if (load_u16_unaligned(matchptr + len + 1) != + load_u16_unaligned(in_next + len + 1)) + continue; + + const u32 rep0_len = lz_extend(in_next + len + 1, + matchptr + len + 1, + 2, + min(c->mf.nice_match_len, + in_end - (in_next + len + 1))); + + unsigned main_state = cur_node->state.main_state; + unsigned match_state = cur_node->state.match_state; + unsigned lz_state = cur_node->state.lz_state; + + /* update states for LZ-match */ + main_state = ((main_state << 1) | 1) % LZMS_NUM_MAIN_PROBS; + match_state = ((match_state << 1) | 0) % LZMS_NUM_MATCH_PROBS; + lz_state = ((lz_state << 1) | 0) % LZMS_NUM_LZ_PROBS; + + /* LZ-match cost */ + u32 cost = position_cost + lzms_fast_length_cost(c, len); + + /* add literal cost */ + cost += lzms_literal_cost(c, main_state, *(in_next + len)); + + /* update state for literal */ + main_state = ((main_state << 1) | 0) % LZMS_NUM_MAIN_PROBS; + + /* add LZ-rep0 cost */ + cost += lzms_bit_1_cost(main_state, c->probs.main) + + lzms_bit_0_cost(match_state, c->probs.match) + + lzms_bit_1_cost(lz_state, c->probs.lz) + + lzms_bit_0_cost(cur_node->state.lz_rep_states[0], + c->probs.lz_rep[0]) + + lzms_fast_length_cost(c, rep0_len); + + const u32 total_len = len + 1 + rep0_len; + + while (end_node < cur_node + total_len) + (++end_node)->cost = INFINITE_COST; + + if (cost < (cur_node + total_len)->cost) { + (cur_node + total_len)->cost = cost; + (cur_node + total_len)->item = (struct lzms_item) { + .length = rep0_len, + .source = 0, + }; + (cur_node + total_len)->extra_items[0] = (struct lzms_item) { + .length = 1, + .source = *(in_next + len), + }; + (cur_node + total_len)->extra_items[1] = (struct lzms_item) { + .length = len, + .source = offset + LZMS_NUM_LZ_REPS - 1, + }; + (cur_node + total_len)->num_extra_items = 2; + } + } while (i--); + } else { + u32 l = 2; + u32 i = num_matches - 1; + do { + u32 position_cost = base_cost + + lzms_lz_offset_cost(c, c->matches[i].offset); + do { + u32 cost = position_cost + lzms_fast_length_cost(c, l); + if (cost < (cur_node + l)->cost) { + (cur_node + l)->cost = cost; + (cur_node + l)->item = (struct lzms_item) { + .length = l, + .source = c->matches[i].offset + + (LZMS_NUM_LZ_REPS - 1), + }; + (cur_node + l)->num_extra_items = 0; + } + } while (++l <= c->matches[i].length); + } while (i--); + } + } + + /* Explicit offset delta matches */ + if (c->use_delta_matches && + likely(in_end - in_next >= NBYTES_HASHED_FOR_DELTA + 1)) + { + const u32 pos = in_next - c->in_buffer; + + /* Consider each possible power (log2 of span) */ + STATIC_ASSERT(NUM_POWERS_TO_CONSIDER <= LZMS_NUM_DELTA_POWER_SYMS); + for (u32 power = 0; power < NUM_POWERS_TO_CONSIDER; power++) { + + const u32 span = (u32)1 << power; + + if (unlikely(pos < span)) + continue; + + const u32 next_hash = lzms_delta_hash(in_next + 1, pos + 1, span); + const u32 hash = c->next_delta_hashes[power]; + const u32 cur_match = c->delta_hash_table[hash]; + + c->delta_hash_table[hash] = (power << DELTA_SOURCE_POWER_SHIFT) | pos; + c->next_delta_hashes[power] = next_hash; + prefetchw(&c->delta_hash_table[next_hash]); + + if (power != cur_match >> DELTA_SOURCE_POWER_SHIFT) + continue; + + const u32 offset = pos - (cur_match & DELTA_SOURCE_RAW_OFFSET_MASK); + + /* The offset must be a multiple of span. */ + if (offset & (span - 1)) + continue; + + const u8 * const matchptr = in_next - offset; + + /* Check the first 3 bytes before entering the + * extension loop. */ + STATIC_ASSERT(NBYTES_HASHED_FOR_DELTA == 3); + if (((u8)(*(in_next + 0) - *(in_next + 0 - span)) != + (u8)(*(matchptr + 0) - *(matchptr + 0 - span))) || + ((u8)(*(in_next + 1) - *(in_next + 1 - span)) != + (u8)(*(matchptr + 1) - *(matchptr + 1 - span))) || + ((u8)(*(in_next + 2) - *(in_next + 2 - span)) != + (u8)(*(matchptr + 2) - *(matchptr + 2 - span)))) + continue; + + /* Extend the delta match to its full length. */ + const u32 len = lzms_extend_delta_match(in_next, + matchptr, + NBYTES_HASHED_FOR_DELTA, + in_end - in_next, + span); + + const u32 raw_offset = offset >> power; + + if (unlikely(raw_offset > DELTA_SOURCE_RAW_OFFSET_MASK - + (LZMS_NUM_DELTA_REPS - 1))) + continue; + + const u32 pair = (power << DELTA_SOURCE_POWER_SHIFT) | + raw_offset; + const u32 source = DELTA_SOURCE_TAG | + (pair + LZMS_NUM_DELTA_REPS - 1); + + /* Early out for long explicit offset delta match */ + if (len >= c->mf.nice_match_len) { + + in_next = lzms_skip_bytes(c, len - 1, in_next + 1); + + lzms_encode_item_list(c, cur_node); + lzms_encode_item(c, len, source); + + c->optimum_nodes[0].state = cur_node->state; + cur_node = &c->optimum_nodes[0]; + + cur_node->state.upcoming_lz_offset = 0; + cur_node->state.upcoming_delta_pair = pair; + lzms_update_lru_queues(&cur_node->state); + lzms_update_main_state(&cur_node->state, 1); + lzms_update_match_state(&cur_node->state, 1); + lzms_update_delta_state(&cur_node->state, 0); + goto begin; + } + + while (end_node < cur_node + len) + (++end_node)->cost = INFINITE_COST; + + u32 base_cost = cur_node->cost + + lzms_bit_1_cost(cur_node->state.main_state, + c->probs.main) + + lzms_bit_1_cost(cur_node->state.match_state, + c->probs.match) + + lzms_bit_0_cost(cur_node->state.delta_state, + c->probs.delta) + + lzms_delta_source_cost(c, power, raw_offset); + + u32 l = NBYTES_HASHED_FOR_DELTA; + do { + u32 cost = base_cost + lzms_fast_length_cost(c, l); + if (cost < (cur_node + l)->cost) { + (cur_node + l)->cost = cost; + (cur_node + l)->item = (struct lzms_item) { + .length = l, + .source = source, + }; + (cur_node + l)->num_extra_items = 0; + } + } while (++l <= len); + } + } + + /* Literal */ + if (end_node < cur_node + 1) + (++end_node)->cost = INFINITE_COST; + const u32 cur_and_lit_cost = cur_node->cost + + lzms_literal_cost(c, cur_node->state.main_state, + *in_next); + if (cur_and_lit_cost < (cur_node + 1)->cost) { + (cur_node + 1)->cost = cur_and_lit_cost; + (cur_node + 1)->item = (struct lzms_item) { + .length = 1, + .source = *in_next, + }; + (cur_node + 1)->num_extra_items = 0; + } else if (c->try_lit_lzrep0 && in_end - (in_next + 1) >= 2) { + /* try lit + LZ-rep0 */ + const u32 offset = + (cur_node->state.prev_lz_offset) ? + cur_node->state.prev_lz_offset : + cur_node->state.recent_lz_offsets[0]; + + if (load_u16_unaligned(in_next + 1) == + load_u16_unaligned(in_next + 1 - offset)) + { + const u32 rep0_len = lz_extend(in_next + 1, + in_next + 1 - offset, + 2, + min(in_end - (in_next + 1), + c->mf.nice_match_len)); + + unsigned main_state = cur_node->state.main_state; + + /* Update main_state after literal */ + main_state = (main_state << 1 | 0) % LZMS_NUM_MAIN_PROBS; + + /* Add cost of LZ-rep0 */ + const u32 cost = cur_and_lit_cost + + lzms_bit_1_cost(main_state, c->probs.main) + + lzms_bit_0_cost(cur_node->state.match_state, + c->probs.match) + + lzms_bit_1_cost(cur_node->state.lz_state, + c->probs.lz) + + lzms_bit_0_cost(cur_node->state.lz_rep_states[0], + c->probs.lz_rep[0]) + + lzms_fast_length_cost(c, rep0_len); + + const u32 total_len = 1 + rep0_len; + + while (end_node < cur_node + total_len) + (++end_node)->cost = INFINITE_COST; + + if (cost < (cur_node + total_len)->cost) { + (cur_node + total_len)->cost = cost; + (cur_node + total_len)->item = (struct lzms_item) { + .length = rep0_len, + .source = 0, + }; + (cur_node + total_len)->extra_items[0] = (struct lzms_item) { + .length = 1, + .source = *in_next, + }; + (cur_node + total_len)->num_extra_items = 1; + } + } + } + + /* Advance to the next position. */ + in_next++; + cur_node++; + + /* The lowest-cost path to the current position is now known. + * Finalize the adaptive state that results from taking this + * lowest-cost path. */ + struct lzms_item item_to_take = cur_node->item; + struct lzms_optimum_node *source_node = cur_node - item_to_take.length; + int next_item_idx = -1; + for (unsigned i = 0; i < cur_node->num_extra_items; i++) { + item_to_take = cur_node->extra_items[i]; + source_node -= item_to_take.length; + next_item_idx++; + } + cur_node->state = source_node->state; + for (;;) { + const u32 length = item_to_take.length; + u32 source = item_to_take.source; + + cur_node->state.upcoming_lz_offset = 0; + cur_node->state.upcoming_delta_pair = 0; + if (length > 1) { + /* Match */ + + lzms_update_main_state(&cur_node->state, 1); + + if (source & DELTA_SOURCE_TAG) { + /* Delta match */ + + lzms_update_match_state(&cur_node->state, 1); + source &= ~DELTA_SOURCE_TAG; + + if (source >= LZMS_NUM_DELTA_REPS) { + /* Explicit offset delta match */ + lzms_update_delta_state(&cur_node->state, 0); + cur_node->state.upcoming_delta_pair = + source - (LZMS_NUM_DELTA_REPS - 1); + } else { + /* Repeat offset delta match */ + int rep_idx = source; + + lzms_update_delta_state(&cur_node->state, 1); + lzms_update_delta_rep_states(&cur_node->state, rep_idx); + + cur_node->state.upcoming_delta_pair = + cur_node->state.recent_delta_pairs[rep_idx]; + + for (int i = rep_idx; i < LZMS_NUM_DELTA_REPS; i++) + cur_node->state.recent_delta_pairs[i] = + cur_node->state.recent_delta_pairs[i + 1]; + } + } else { + lzms_update_match_state(&cur_node->state, 0); + + if (source >= LZMS_NUM_LZ_REPS) { + /* Explicit offset LZ match */ + lzms_update_lz_state(&cur_node->state, 0); + cur_node->state.upcoming_lz_offset = + source - (LZMS_NUM_LZ_REPS - 1); + } else { + /* Repeat offset LZ match */ + int rep_idx = source; + + lzms_update_lz_state(&cur_node->state, 1); + lzms_update_lz_rep_states(&cur_node->state, rep_idx); + + cur_node->state.upcoming_lz_offset = + cur_node->state.recent_lz_offsets[rep_idx]; + + for (int i = rep_idx; i < LZMS_NUM_LZ_REPS; i++) + cur_node->state.recent_lz_offsets[i] = + cur_node->state.recent_lz_offsets[i + 1]; + } + } + } else { + /* Literal */ + lzms_update_main_state(&cur_node->state, 0); + } + + lzms_update_lru_queues(&cur_node->state); + + if (next_item_idx < 0) + break; + if (next_item_idx == 0) + item_to_take = cur_node->item; + else + item_to_take = cur_node->extra_items[next_item_idx - 1]; + --next_item_idx; + } + + /* + * This loop will terminate when either of the following + * conditions is true: + * + * (1) cur_node == end_node + * + * There are no paths that extend beyond the current + * position. In this case, any path to a later position + * must pass through the current position, so we can go + * ahead and choose the list of items that led to this + * position. + * + * (2) cur_node == &c->optimum_nodes[NUM_OPTIM_NODES] + * + * This bounds the number of times the algorithm can step + * forward before it is guaranteed to start choosing items. + * This limits the memory usage. It also guarantees that + * the parser will not go too long without updating the + * probability tables. + * + * Note: no check for end-of-buffer is needed because + * end-of-buffer will trigger condition (1). + */ + if (cur_node == end_node || + cur_node == &c->optimum_nodes[NUM_OPTIM_NODES]) + { + lzms_encode_nonempty_item_list(c, cur_node); + c->optimum_nodes[0].state = cur_node->state; + goto begin; + } + } +} + +static void +lzms_init_states_and_probabilities(struct lzms_compressor *c) +{ + c->main_state = 0; + c->match_state = 0; + c->lz_state = 0; + for (int i = 0; i < LZMS_NUM_LZ_REP_DECISIONS; i++) + c->lz_rep_states[i] = 0; + c->delta_state = 0; + for (int i = 0; i < LZMS_NUM_DELTA_REP_DECISIONS; i++) + c->delta_rep_states[i] = 0; + + lzms_init_probabilities(&c->probs); +} + +static void +lzms_init_huffman_codes(struct lzms_compressor *c, unsigned num_offset_slots) +{ + lzms_init_huffman_code(&c->literal_rebuild_info, + LZMS_NUM_LITERAL_SYMS, + LZMS_LITERAL_CODE_REBUILD_FREQ, + c->literal_codewords, + c->literal_lens, + c->literal_freqs); + + lzms_init_huffman_code(&c->lz_offset_rebuild_info, + num_offset_slots, + LZMS_LZ_OFFSET_CODE_REBUILD_FREQ, + c->lz_offset_codewords, + c->lz_offset_lens, + c->lz_offset_freqs); + + lzms_init_huffman_code(&c->length_rebuild_info, + LZMS_NUM_LENGTH_SYMS, + LZMS_LENGTH_CODE_REBUILD_FREQ, + c->length_codewords, + c->length_lens, + c->length_freqs); + + lzms_init_huffman_code(&c->delta_offset_rebuild_info, + num_offset_slots, + LZMS_DELTA_OFFSET_CODE_REBUILD_FREQ, + c->delta_offset_codewords, + c->delta_offset_lens, + c->delta_offset_freqs); + + lzms_init_huffman_code(&c->delta_power_rebuild_info, + LZMS_NUM_DELTA_POWER_SYMS, + LZMS_DELTA_POWER_CODE_REBUILD_FREQ, + c->delta_power_codewords, + c->delta_power_lens, + c->delta_power_freqs); +} + +/* + * Flush the output streams, prepare the final compressed data, and return its + * size in bytes. + * + * A return value of 0 indicates that the data could not be compressed to fit in + * the available space. + */ +static size_t +lzms_finalize(struct lzms_compressor *c) +{ + size_t num_forwards_bytes; + size_t num_backwards_bytes; + + /* Flush both the forwards and backwards streams, and make sure they + * didn't cross each other and start overwriting each other's data. */ + if (!lzms_output_bitstream_flush(&c->os)) + return 0; + + if (!lzms_range_encoder_flush(&c->rc)) + return 0; + + if (c->rc.next > c->os.next) + return 0; + + /* Now the compressed buffer contains the data output by the forwards + * bitstream, then empty space, then data output by the backwards + * bitstream. Move the data output by the backwards bitstream to be + * adjacent to the data output by the forward bitstream, and calculate + * the compressed size that this results in. */ + num_forwards_bytes = c->rc.next - c->rc.begin; + num_backwards_bytes = c->rc.end - c->os.next; + + memmove(c->rc.next, c->os.next, num_backwards_bytes); + + return num_forwards_bytes + num_backwards_bytes; +} + +static u64 +lzms_get_needed_memory(size_t max_bufsize, unsigned compression_level, + bool destructive) +{ + u64 size = 0; + + if (max_bufsize > LZMS_MAX_BUFFER_SIZE) + return 0; + + size += sizeof(struct lzms_compressor); + + if (!destructive) + size += max_bufsize; /* in_buffer */ + + /* mf */ + size += lcpit_matchfinder_get_needed_memory(max_bufsize); + + return size; +} + +static int +lzms_create_compressor(size_t max_bufsize, unsigned compression_level, + bool destructive, void **c_ret) +{ + struct lzms_compressor *c; + u32 nice_match_len; + + if (max_bufsize > LZMS_MAX_BUFFER_SIZE) + return WIMLIB_ERR_INVALID_PARAM; + + c = ALIGNED_MALLOC(sizeof(struct lzms_compressor), 64); + if (!c) + goto oom0; + + c->destructive = destructive; + + /* Scale nice_match_len with the compression level. But to allow an + * optimization for length cost calculations, don't allow nice_match_len + * to exceed MAX_FAST_LENGTH. */ + nice_match_len = min(((u64)compression_level * 63) / 50, MAX_FAST_LENGTH); + + c->use_delta_matches = (compression_level >= 35); + c->try_lzmatch_lit_lzrep0 = (compression_level >= 45); + c->try_lit_lzrep0 = (compression_level >= 60); + c->try_lzrep_lit_lzrep0 = (compression_level >= 60); + + if (!c->destructive) { + c->in_buffer = MALLOC(max_bufsize); + if (!c->in_buffer) + goto oom1; + } + + if (!lcpit_matchfinder_init(&c->mf, max_bufsize, 2, nice_match_len)) + goto oom2; + + lzms_init_fast_length_slot_tab(c); + lzms_init_offset_slot_tabs(c); + + *c_ret = c; + return 0; + +oom2: + if (!c->destructive) + FREE(c->in_buffer); +oom1: + ALIGNED_FREE(c); +oom0: + return WIMLIB_ERR_NOMEM; +} + +static size_t +lzms_compress(const void *restrict in, size_t in_nbytes, + void *restrict out, size_t out_nbytes_avail, void *restrict _c) +{ + struct lzms_compressor *c = _c; + size_t result; + + /* Don't bother trying to compress extremely small inputs. */ + if (in_nbytes < 4) + return 0; + + /* Copy the input data into the internal buffer and preprocess it. */ + if (c->destructive) + c->in_buffer = (void *)in; + else + memcpy(c->in_buffer, in, in_nbytes); + c->in_nbytes = in_nbytes; + lzms_x86_filter(c->in_buffer, in_nbytes, c->last_target_usages, false); + + /* Prepare the matchfinders. */ + lcpit_matchfinder_load_buffer(&c->mf, c->in_buffer, c->in_nbytes); + if (c->use_delta_matches) + lzms_init_delta_matchfinder(c); + + /* Initialize the encoder structures. */ + lzms_range_encoder_init(&c->rc, out, out_nbytes_avail); + lzms_output_bitstream_init(&c->os, out, out_nbytes_avail); + lzms_init_states_and_probabilities(c); + lzms_init_huffman_codes(c, lzms_get_num_offset_slots(c->in_nbytes)); + + /* The main loop: parse and encode. */ + lzms_near_optimal_parse(c); + + /* Return the compressed data size or 0. */ + result = lzms_finalize(c); + if (!result && c->destructive) + lzms_x86_filter(c->in_buffer, c->in_nbytes, c->last_target_usages, true); + return result; +} + +static void +lzms_free_compressor(void *_c) +{ + struct lzms_compressor *c = _c; + + if (!c->destructive) + FREE(c->in_buffer); + lcpit_matchfinder_destroy(&c->mf); + ALIGNED_FREE(c); +} + +const struct compressor_ops lzms_compressor_ops = { + .get_needed_memory = lzms_get_needed_memory, + .create_compressor = lzms_create_compressor, + .compress = lzms_compress, + .free_compressor = lzms_free_compressor, +}; diff --git a/src/wimlib/lzms_decompress.c b/src/wimlib/lzms_decompress.c new file mode 100644 index 00000000..c9b5c983 --- /dev/null +++ b/src/wimlib/lzms_decompress.c @@ -0,0 +1,937 @@ +/* + * lzms_decompress.c + * + * A decompressor for the LZMS compression format. + */ + +/* + * Copyright (C) 2013-2016 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +/* + * This is a decompressor for the LZMS compression format used by Microsoft. + * This format is not documented, but it is one of the formats supported by the + * compression API available in Windows 8, and as of Windows 8 it is one of the + * formats that can be used in WIM files. + * + * This decompressor only implements "raw" decompression, which decompresses a + * single LZMS-compressed block. This behavior is the same as that of + * Decompress() in the Windows 8 compression API when using a compression handle + * created with CreateDecompressor() with the Algorithm parameter specified as + * COMPRESS_ALGORITHM_LZMS | COMPRESS_RAW. Presumably, non-raw LZMS data is a + * container format from which the locations and sizes (both compressed and + * uncompressed) of the constituent blocks can be determined. + * + * An LZMS-compressed block must be read in 16-bit little endian units from both + * directions. One logical bitstream starts at the front of the block and + * proceeds forwards. Another logical bitstream starts at the end of the block + * and proceeds backwards. Bits read from the forwards bitstream constitute + * binary range-encoded data, whereas bits read from the backwards bitstream + * constitute Huffman-encoded symbols or verbatim bits. For both bitstreams, + * the ordering of the bits within the 16-bit coding units is such that the + * first bit is the high-order bit and the last bit is the low-order bit. + * + * From these two logical bitstreams, an LZMS decompressor can reconstitute the + * series of items that make up the LZMS data representation. Each such item + * may be a literal byte or a match. Matches may be either traditional LZ77 + * matches or "delta" matches, either of which can have its offset encoded + * explicitly or encoded via a reference to a recently used (repeat) offset. + * + * A traditional LZ77 match consists of a length and offset. It asserts that + * the sequence of bytes beginning at the current position and extending for the + * length is equal to the same-length sequence of bytes at the offset back in + * the data buffer. This type of match can be visualized as follows, with the + * caveat that the sequences may overlap: + * + * offset + * -------------------- + * | | + * B[1...len] A[1...len] + * + * Decoding proceeds as follows: + * + * do { + * *A++ = *B++; + * } while (--length); + * + * On the other hand, a delta match consists of a "span" as well as a length and + * offset. A delta match can be visualized as follows, with the caveat that the + * various sequences may overlap: + * + * offset + * ----------------------------- + * | | + * span | span | + * ------------- ------------- + * | | | | + * D[1...len] C[1...len] B[1...len] A[1...len] + * + * Decoding proceeds as follows: + * + * do { + * *A++ = *B++ + *C++ - *D++; + * } while (--length); + * + * A delta match asserts that the bytewise differences of the A and B sequences + * are equal to the bytewise differences of the C and D sequences. The + * sequences within each pair are separated by the same number of bytes, the + * "span". The inter-pair distance is the "offset". In LZMS, spans are + * restricted to powers of 2 between 2**0 and 2**7 inclusively. Offsets are + * restricted to multiples of the span. The stored value for the offset is the + * "raw offset", which is the real offset divided by the span. + * + * Delta matches can cover data containing a series of power-of-2 sized integers + * that is linearly increasing or decreasing. Another way of thinking about it + * is that a delta match can match a longer sequence that is interrupted by a + * non-matching byte, provided that the non-matching byte is a continuation of a + * linearly changing pattern. Examples of files that may contain data like this + * are uncompressed bitmap images, uncompressed digital audio, and Unicode data + * tables. To some extent, this match type is a replacement for delta filters + * or multimedia filters that are sometimes used in other compression software + * (e.g. 'xz --delta --lzma2'). However, on most types of files, delta matches + * do not seem to be very useful. + * + * Both LZ and delta matches may use overlapping sequences. Therefore, they + * must be decoded as if only one byte is copied at a time. + * + * For both LZ and delta matches, any match length in [1, 1073809578] can be + * represented. Similarly, any match offset in [1, 1180427428] can be + * represented. For delta matches, this range applies to the raw offset, so the + * real offset may be larger. + * + * For LZ matches, up to 3 repeat offsets are allowed, similar to some other + * LZ-based formats such as LZX and LZMA. They must updated in an LRU fashion, + * except for a quirk: inserting anything to the front of the queue must be + * delayed by one LZMS item. The reason for this is presumably that there is + * almost no reason to code the same match offset twice in a row, since you + * might as well have coded a longer match at that offset. For this same + * reason, it also is a requirement that when an offset in the queue is used, + * that offset is removed from the queue immediately (and made pending for + * front-insertion after the following decoded item), and everything to the + * right is shifted left one queue slot. This creates a need for an "overflow" + * fourth entry in the queue, even though it is only possible to decode + * references to the first 3 entries at any given time. The queue must be + * initialized to the offsets {1, 2, 3, 4}. + * + * Repeat delta matches are handled similarly, but for them the queue contains + * (power, raw offset) pairs. This queue must be initialized to + * {(0, 1), (0, 2), (0, 3), (0, 4)}. + * + * Bits from the binary range decoder must be used to disambiguate item types. + * The range decoder must hold two state variables: the range, which must + * initially be set to 0xffffffff, and the current code, which must initially be + * set to the first 32 bits read from the forwards bitstream. The range must be + * maintained above 0xffff; when it falls below 0xffff, both the range and code + * must be left-shifted by 16 bits and the low 16 bits of the code must be + * filled in with the next 16 bits from the forwards bitstream. + * + * To decode each bit, the binary range decoder requires a probability that is + * logically a real number between 0 and 1. Multiplying this probability by the + * current range and taking the floor gives the bound between the 0-bit region of + * the range and the 1-bit region of the range. However, in LZMS, probabilities + * are restricted to values of n/64 where n is an integer is between 1 and 63 + * inclusively, so the implementation may use integer operations instead. + * Following calculation of the bound, if the current code is in the 0-bit + * region, the new range becomes the current code and the decoded bit is 0; + * otherwise, the bound must be subtracted from both the range and the code, and + * the decoded bit is 1. More information about range coding can be found at + * https://en.wikipedia.org/wiki/Range_encoding. Furthermore, note that the + * LZMA format also uses range coding and has public domain code available for + * it. + * + * The probability used to range-decode each bit must be taken from a table, of + * which one instance must exist for each distinct context, or "binary decision + * class", in which a range-decoded bit is needed. At each call of the range + * decoder, the appropriate probability must be obtained by indexing the + * appropriate probability table with the last 4 (in the context disambiguating + * literals from matches), 5 (in the context disambiguating LZ matches from + * delta matches), or 6 (in all other contexts) bits recently range-decoded in + * that context, ordered such that the most recently decoded bit is the + * low-order bit of the index. + * + * Furthermore, each probability entry itself is variable, as its value must be + * maintained as n/64 where n is the number of 0 bits in the most recently + * decoded 64 bits with that same entry. This allows the compressed + * representation to adapt to the input and use fewer bits to represent the most + * likely data; note that LZMA uses a similar scheme. Initially, the most + * recently 64 decoded bits for each probability entry are assumed to be + * 0x0000000055555555 (high order to low order); therefore, all probabilities + * are initially 48/64. During the course of decoding, each probability may be + * updated to as low as 0/64 (as a result of reading many consecutive 1 bits + * with that entry) or as high as 64/64 (as a result of reading many consecutive + * 0 bits with that entry); however, probabilities of 0/64 and 64/64 cannot be + * used as-is but rather must be adjusted to 1/64 and 63/64, respectively, + * before being used for range decoding. + * + * Representations of the LZMS items themselves must be read from the backwards + * bitstream. For this, there are 5 different Huffman codes used: + * + * - The literal code, used for decoding literal bytes. Each of the 256 + * symbols represents a literal byte. This code must be rebuilt whenever + * 1024 symbols have been decoded with it. + * + * - The LZ offset code, used for decoding the offsets of standard LZ77 + * matches. Each symbol represents an offset slot, which corresponds to a + * base value and some number of extra bits which must be read and added to + * the base value to reconstitute the full offset. The number of symbols in + * this code is the number of offset slots needed to represent all possible + * offsets in the uncompressed block. This code must be rebuilt whenever + * 1024 symbols have been decoded with it. + * + * - The length code, used for decoding length symbols. Each of the 54 symbols + * represents a length slot, which corresponds to a base value and some + * number of extra bits which must be read and added to the base value to + * reconstitute the full length. This code must be rebuilt whenever 512 + * symbols have been decoded with it. + * + * - The delta offset code, used for decoding the raw offsets of delta matches. + * Each symbol corresponds to an offset slot, which corresponds to a base + * value and some number of extra bits which must be read and added to the + * base value to reconstitute the full raw offset. The number of symbols in + * this code is equal to the number of symbols in the LZ offset code. This + * code must be rebuilt whenever 1024 symbols have been decoded with it. + * + * - The delta power code, used for decoding the powers of delta matches. Each + * of the 8 symbols corresponds to a power. This code must be rebuilt + * whenever 512 symbols have been decoded with it. + * + * Initially, each Huffman code must be built assuming that each symbol in that + * code has frequency 1. Following that, each code must be rebuilt each time a + * certain number of symbols, as noted above, has been decoded with it. The + * symbol frequencies for a code must be halved after each rebuild of that code; + * this makes the codes adapt to the more recent data. + * + * Like other compression formats such as XPRESS, LZX, and DEFLATE, the LZMS + * format requires that all Huffman codes be constructed in canonical form. + * This form requires that same-length codewords be lexicographically ordered + * the same way as the corresponding symbols and that all shorter codewords + * lexicographically precede longer codewords. Such a code can be constructed + * directly from codeword lengths. + * + * Even with the canonical code restriction, the same frequencies can be used to + * construct multiple valid Huffman codes. Therefore, the decompressor needs to + * construct the right one. Specifically, the LZMS format requires that the + * Huffman code be constructed as if the well-known priority queue algorithm is + * used and frequency ties are always broken in favor of leaf nodes. + * + * Codewords in LZMS are guaranteed to not exceed 15 bits. The format otherwise + * places no restrictions on codeword length. Therefore, the Huffman code + * construction algorithm that a correct LZMS decompressor uses need not + * implement length-limited code construction. But if it does (e.g. by virtue + * of being shared among multiple compression algorithms), the details of how it + * does so are unimportant, provided that the maximum codeword length parameter + * is set to at least 15 bits. + * + * After all LZMS items have been decoded, the data must be postprocessed to + * translate absolute address encoded in x86 instructions into their original + * relative addresses. + * + * Details omitted above can be found in the code. Note that in the absence of + * an official specification there is no guarantee that this decompressor + * handles all possible cases. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/compress_common.h" +#include "wimlib/decompress_common.h" +#include "wimlib/decompressor_ops.h" +#include "wimlib/error.h" +#include "wimlib/lzms_common.h" +#include "wimlib/util.h" + +/* The TABLEBITS values can be changed; they only affect decoding speed. */ +#define LZMS_LITERAL_TABLEBITS 10 +#define LZMS_LENGTH_TABLEBITS 9 +#define LZMS_LZ_OFFSET_TABLEBITS 11 +#define LZMS_DELTA_OFFSET_TABLEBITS 11 +#define LZMS_DELTA_POWER_TABLEBITS 7 + +struct lzms_range_decoder { + + /* The relevant part of the current range. Although the logical range + * for range decoding is a very large integer, only a small portion + * matters at any given time, and it can be normalized (shifted left) + * whenever it gets too small. */ + u32 range; + + /* The current position in the range encoded by the portion of the input + * read so far. */ + u32 code; + + /* Pointer to the next little-endian 16-bit integer in the compressed + * input data (reading forwards). */ + const u8 *next; + + /* Pointer to the end of the compressed input data. */ + const u8 *end; +}; + +typedef u64 bitbuf_t; + +struct lzms_input_bitstream { + + /* Holding variable for bits that have been read from the compressed + * data. The bit ordering is high to low. */ + bitbuf_t bitbuf; + + /* Number of bits currently held in @bitbuf. */ + unsigned bitsleft; + + /* Pointer to the one past the next little-endian 16-bit integer in the + * compressed input data (reading backwards). */ + const u8 *next; + + /* Pointer to the beginning of the compressed input data. */ + const u8 *begin; +}; + +#define BITBUF_NBITS (8 * sizeof(bitbuf_t)) + +/* Bookkeeping information for an adaptive Huffman code */ +struct lzms_huffman_rebuild_info { + unsigned num_syms_until_rebuild; + unsigned num_syms; + unsigned rebuild_freq; + u32 *codewords; + u32 *freqs; + u16 *decode_table; + unsigned table_bits; +}; + +struct lzms_decompressor { + + /* 'last_target_usages' is in union with everything else because it is + * only used for postprocessing. */ + union { + struct { + + struct lzms_probabilites probs; + + DECODE_TABLE(literal_decode_table, LZMS_NUM_LITERAL_SYMS, + LZMS_LITERAL_TABLEBITS, LZMS_MAX_CODEWORD_LENGTH); + u32 literal_freqs[LZMS_NUM_LITERAL_SYMS]; + struct lzms_huffman_rebuild_info literal_rebuild_info; + + DECODE_TABLE(lz_offset_decode_table, LZMS_MAX_NUM_OFFSET_SYMS, + LZMS_LZ_OFFSET_TABLEBITS, LZMS_MAX_CODEWORD_LENGTH); + u32 lz_offset_freqs[LZMS_MAX_NUM_OFFSET_SYMS]; + struct lzms_huffman_rebuild_info lz_offset_rebuild_info; + + DECODE_TABLE(length_decode_table, LZMS_NUM_LENGTH_SYMS, + LZMS_LENGTH_TABLEBITS, LZMS_MAX_CODEWORD_LENGTH); + u32 length_freqs[LZMS_NUM_LENGTH_SYMS]; + struct lzms_huffman_rebuild_info length_rebuild_info; + + DECODE_TABLE(delta_offset_decode_table, LZMS_MAX_NUM_OFFSET_SYMS, + LZMS_DELTA_OFFSET_TABLEBITS, LZMS_MAX_CODEWORD_LENGTH); + u32 delta_offset_freqs[LZMS_MAX_NUM_OFFSET_SYMS]; + struct lzms_huffman_rebuild_info delta_offset_rebuild_info; + + DECODE_TABLE(delta_power_decode_table, LZMS_NUM_DELTA_POWER_SYMS, + LZMS_DELTA_POWER_TABLEBITS, LZMS_MAX_CODEWORD_LENGTH); + u32 delta_power_freqs[LZMS_NUM_DELTA_POWER_SYMS]; + struct lzms_huffman_rebuild_info delta_power_rebuild_info; + + /* Temporary space for lzms_build_huffman_code() */ + union { + u32 codewords[LZMS_MAX_NUM_SYMS]; + DECODE_TABLE_WORKING_SPACE(working_space, LZMS_MAX_NUM_SYMS, + LZMS_MAX_CODEWORD_LENGTH); + }; + + }; // struct + + s32 last_target_usages[65536]; + + }; // union +}; + +/* Initialize the input bitstream @is to read backwards from the compressed data + * buffer @in that is @count bytes long. */ +static void +lzms_input_bitstream_init(struct lzms_input_bitstream *is, + const u8 *in, size_t count) +{ + is->bitbuf = 0; + is->bitsleft = 0; + is->next = in + count; + is->begin = in; +} + +/* Ensure that at least @num_bits bits are in the bitbuffer variable. + * @num_bits cannot be more than 32. */ +static forceinline void +lzms_ensure_bits(struct lzms_input_bitstream *is, unsigned num_bits) +{ + unsigned avail; + + if (is->bitsleft >= num_bits) + return; + + avail = BITBUF_NBITS - is->bitsleft; + + if (UNALIGNED_ACCESS_IS_FAST && CPU_IS_LITTLE_ENDIAN() && + WORDBYTES == 8 && likely(is->next - is->begin >= 8)) + { + is->next -= (avail & ~15) >> 3; + is->bitbuf |= load_u64_unaligned(is->next) << (avail & 15); + is->bitsleft += avail & ~15; + } else { + if (likely(is->next != is->begin)) { + is->next -= sizeof(le16); + is->bitbuf |= (bitbuf_t)get_unaligned_le16(is->next) + << (avail - 16); + } + if (likely(is->next != is->begin)) { + is->next -= sizeof(le16); + is->bitbuf |= (bitbuf_t)get_unaligned_le16(is->next) + << (avail - 32); + } + is->bitsleft += 32; + } +} + +/* Get @num_bits bits from the bitbuffer variable. */ +static forceinline bitbuf_t +lzms_peek_bits(struct lzms_input_bitstream *is, unsigned num_bits) +{ + return (is->bitbuf >> 1) >> (BITBUF_NBITS - num_bits - 1); +} + +/* Remove @num_bits bits from the bitbuffer variable. */ +static forceinline void +lzms_remove_bits(struct lzms_input_bitstream *is, unsigned num_bits) +{ + is->bitbuf <<= num_bits; + is->bitsleft -= num_bits; +} + +/* Remove and return @num_bits bits from the bitbuffer variable. */ +static forceinline bitbuf_t +lzms_pop_bits(struct lzms_input_bitstream *is, unsigned num_bits) +{ + bitbuf_t bits = lzms_peek_bits(is, num_bits); + lzms_remove_bits(is, num_bits); + return bits; +} + +/* Read @num_bits bits from the input bitstream. */ +static forceinline bitbuf_t +lzms_read_bits(struct lzms_input_bitstream *is, unsigned num_bits) +{ + lzms_ensure_bits(is, num_bits); + return lzms_pop_bits(is, num_bits); +} + +/* Initialize the range decoder @rd to read forwards from the compressed data + * buffer @in that is @count bytes long. */ +static void +lzms_range_decoder_init(struct lzms_range_decoder *rd, + const u8 *in, size_t count) +{ + rd->range = 0xffffffff; + rd->code = ((u32)get_unaligned_le16(in) << 16) | + get_unaligned_le16(in + 2); + rd->next = in + 4; + rd->end = in + count; +} + +/* + * Decode a bit using the range coder. The current state specifies the + * probability entry to use. The state and probability entry will be updated + * based on the decoded bit. + */ +static forceinline int +lzms_decode_bit(struct lzms_range_decoder *rd, u32 *state_p, u32 num_states, + struct lzms_probability_entry *probs) +{ + struct lzms_probability_entry *prob_entry; + u32 prob; + u32 bound; + + /* Load the probability entry corresponding to the current state. */ + prob_entry = &probs[*state_p]; + + /* Update the state early. We'll still need to OR the state with 1 + * later if the decoded bit is a 1. */ + *state_p = (*state_p << 1) & (num_states - 1); + + /* Get the probability (out of LZMS_PROBABILITY_DENOMINATOR) that the + * next bit is 0. */ + prob = lzms_get_probability(prob_entry); + + /* Normalize if needed. */ + if (!(rd->range & 0xFFFF0000)) { + rd->range <<= 16; + rd->code <<= 16; + if (likely(rd->next != rd->end)) { + rd->code |= get_unaligned_le16(rd->next); + rd->next += sizeof(le16); + } + } + + /* Based on the probability, calculate the bound between the 0-bit + * region and the 1-bit region of the range. */ + bound = (rd->range >> LZMS_PROBABILITY_BITS) * prob; + + if (rd->code < bound) { + /* Current code is in the 0-bit region of the range. */ + rd->range = bound; + + /* Update the state and probability entry based on the decoded bit. */ + lzms_update_probability_entry(prob_entry, 0); + return 0; + } else { + /* Current code is in the 1-bit region of the range. */ + rd->range -= bound; + rd->code -= bound; + + /* Update the state and probability entry based on the decoded bit. */ + lzms_update_probability_entry(prob_entry, 1); + *state_p |= 1; + return 1; + } +} + +static void +lzms_build_huffman_code(struct lzms_huffman_rebuild_info *rebuild_info) +{ + make_canonical_huffman_code(rebuild_info->num_syms, + LZMS_MAX_CODEWORD_LENGTH, + rebuild_info->freqs, + (u8 *)rebuild_info->decode_table, + rebuild_info->codewords); + + make_huffman_decode_table(rebuild_info->decode_table, + rebuild_info->num_syms, + rebuild_info->table_bits, + (u8 *)rebuild_info->decode_table, + LZMS_MAX_CODEWORD_LENGTH, + (u16 *)rebuild_info->codewords); + + rebuild_info->num_syms_until_rebuild = rebuild_info->rebuild_freq; +} + +static void +lzms_init_huffman_code(struct lzms_huffman_rebuild_info *rebuild_info, + unsigned num_syms, unsigned rebuild_freq, + u32 *codewords, u32 *freqs, + u16 *decode_table, unsigned table_bits) +{ + rebuild_info->num_syms = num_syms; + rebuild_info->rebuild_freq = rebuild_freq; + rebuild_info->codewords = codewords; + rebuild_info->freqs = freqs; + rebuild_info->decode_table = decode_table; + rebuild_info->table_bits = table_bits; + lzms_init_symbol_frequencies(freqs, num_syms); + lzms_build_huffman_code(rebuild_info); +} + +static void +lzms_init_huffman_codes(struct lzms_decompressor *d, unsigned num_offset_slots) +{ + lzms_init_huffman_code(&d->literal_rebuild_info, + LZMS_NUM_LITERAL_SYMS, + LZMS_LITERAL_CODE_REBUILD_FREQ, + d->codewords, + d->literal_freqs, + d->literal_decode_table, + LZMS_LITERAL_TABLEBITS); + + lzms_init_huffman_code(&d->lz_offset_rebuild_info, + num_offset_slots, + LZMS_LZ_OFFSET_CODE_REBUILD_FREQ, + d->codewords, + d->lz_offset_freqs, + d->lz_offset_decode_table, + LZMS_LZ_OFFSET_TABLEBITS); + + lzms_init_huffman_code(&d->length_rebuild_info, + LZMS_NUM_LENGTH_SYMS, + LZMS_LENGTH_CODE_REBUILD_FREQ, + d->codewords, + d->length_freqs, + d->length_decode_table, + LZMS_LENGTH_TABLEBITS); + + lzms_init_huffman_code(&d->delta_offset_rebuild_info, + num_offset_slots, + LZMS_DELTA_OFFSET_CODE_REBUILD_FREQ, + d->codewords, + d->delta_offset_freqs, + d->delta_offset_decode_table, + LZMS_DELTA_OFFSET_TABLEBITS); + + lzms_init_huffman_code(&d->delta_power_rebuild_info, + LZMS_NUM_DELTA_POWER_SYMS, + LZMS_DELTA_POWER_CODE_REBUILD_FREQ, + d->codewords, + d->delta_power_freqs, + d->delta_power_decode_table, + LZMS_DELTA_POWER_TABLEBITS); +} + +static noinline void +lzms_rebuild_huffman_code(struct lzms_huffman_rebuild_info *rebuild_info) +{ + lzms_build_huffman_code(rebuild_info); + lzms_dilute_symbol_frequencies(rebuild_info->freqs, rebuild_info->num_syms); +} + +/* XXX: mostly copied from read_huffsym() in decompress_common.h because LZMS + * needs its own bitstream */ +static forceinline unsigned +lzms_decode_huffman_symbol(struct lzms_input_bitstream *is, u16 decode_table[], + unsigned table_bits, u32 freqs[], + struct lzms_huffman_rebuild_info *rebuild_info) +{ + unsigned entry; + unsigned symbol; + unsigned length; + + lzms_ensure_bits(is, LZMS_MAX_CODEWORD_LENGTH); + + entry = decode_table[lzms_peek_bits(is, table_bits)]; + symbol = entry >> DECODE_TABLE_SYMBOL_SHIFT; + length = entry & DECODE_TABLE_LENGTH_MASK; + + if (entry >= (1U << (table_bits + DECODE_TABLE_SYMBOL_SHIFT))) { + lzms_remove_bits(is, table_bits); + entry = decode_table[symbol + lzms_peek_bits(is, length)]; + symbol = entry >> DECODE_TABLE_SYMBOL_SHIFT; + length = entry & DECODE_TABLE_LENGTH_MASK; + } + + lzms_remove_bits(is, length); + + freqs[symbol]++; + if (--rebuild_info->num_syms_until_rebuild == 0) + lzms_rebuild_huffman_code(rebuild_info); + return symbol; +} + +static forceinline unsigned +lzms_decode_literal(struct lzms_decompressor *d, + struct lzms_input_bitstream *is) +{ + return lzms_decode_huffman_symbol(is, + d->literal_decode_table, + LZMS_LITERAL_TABLEBITS, + d->literal_freqs, + &d->literal_rebuild_info); +} + +static forceinline u32 +lzms_decode_lz_offset(struct lzms_decompressor *d, + struct lzms_input_bitstream *is) +{ + unsigned slot = lzms_decode_huffman_symbol(is, + d->lz_offset_decode_table, + LZMS_LZ_OFFSET_TABLEBITS, + d->lz_offset_freqs, + &d->lz_offset_rebuild_info); + return lzms_offset_slot_base[slot] + + lzms_read_bits(is, lzms_extra_offset_bits[slot]); +} + +static forceinline u32 +lzms_decode_length(struct lzms_decompressor *d, + struct lzms_input_bitstream *is) +{ + unsigned slot = lzms_decode_huffman_symbol(is, + d->length_decode_table, + LZMS_LENGTH_TABLEBITS, + d->length_freqs, + &d->length_rebuild_info); + u32 length = lzms_length_slot_base[slot]; + unsigned num_extra_bits = lzms_extra_length_bits[slot]; + /* Usually most lengths are short and have no extra bits. */ + if (num_extra_bits) + length += lzms_read_bits(is, num_extra_bits); + return length; +} + +static forceinline u32 +lzms_decode_delta_offset(struct lzms_decompressor *d, + struct lzms_input_bitstream *is) +{ + unsigned slot = lzms_decode_huffman_symbol(is, + d->delta_offset_decode_table, + LZMS_DELTA_OFFSET_TABLEBITS, + d->delta_offset_freqs, + &d->delta_offset_rebuild_info); + return lzms_offset_slot_base[slot] + + lzms_read_bits(is, lzms_extra_offset_bits[slot]); +} + +static forceinline unsigned +lzms_decode_delta_power(struct lzms_decompressor *d, + struct lzms_input_bitstream *is) +{ + return lzms_decode_huffman_symbol(is, + d->delta_power_decode_table, + LZMS_DELTA_POWER_TABLEBITS, + d->delta_power_freqs, + &d->delta_power_rebuild_info); +} + +static int +lzms_create_decompressor(size_t max_bufsize, void **d_ret) +{ + struct lzms_decompressor *d; + + if (max_bufsize > LZMS_MAX_BUFFER_SIZE) + return WIMLIB_ERR_INVALID_PARAM; + + d = ALIGNED_MALLOC(sizeof(struct lzms_decompressor), + DECODE_TABLE_ALIGNMENT); + if (!d) + return WIMLIB_ERR_NOMEM; + + *d_ret = d; + return 0; +} + +/* + * Decompress @in_nbytes bytes of LZMS-compressed data at @in and write the + * uncompressed data, which had original size @out_nbytes, to @out. Return 0 if + * successful or -1 if the compressed data is invalid. + */ +static int +lzms_decompress(const void * const restrict in, const size_t in_nbytes, + void * const restrict out, const size_t out_nbytes, + void * const restrict _d) +{ + struct lzms_decompressor *d = _d; + u8 *out_next = out; + u8 * const out_end = out + out_nbytes; + struct lzms_range_decoder rd; + struct lzms_input_bitstream is; + + /* LRU queues for match sources */ + u32 recent_lz_offsets[LZMS_NUM_LZ_REPS + 1]; + u64 recent_delta_pairs[LZMS_NUM_DELTA_REPS + 1]; + + /* Previous item type: 0 = literal, 1 = LZ match, 2 = delta match. + * This is used to handle delayed updates of the LRU queues. Instead of + * actually delaying the updates, we can check when decoding each rep + * match whether a delayed update needs to be taken into account, and if + * so get the match source from slot 'rep_idx + 1' instead of from slot + * 'rep_idx'. */ + unsigned prev_item_type = 0; + + /* States and probability entries for item type disambiguation */ + u32 main_state = 0; + u32 match_state = 0; + u32 lz_state = 0; + u32 delta_state = 0; + u32 lz_rep_states[LZMS_NUM_LZ_REP_DECISIONS] = {}; + u32 delta_rep_states[LZMS_NUM_DELTA_REP_DECISIONS] = {}; + + /* + * Requirements on the compressed data: + * + * 1. LZMS-compressed data is a series of 16-bit integers, so the + * compressed data buffer cannot take up an odd number of bytes. + * 2. There must be at least 4 bytes of compressed data, since otherwise + * we cannot even initialize the range decoder. + */ + if ((in_nbytes & 1) || (in_nbytes < 4)) + return -1; + + lzms_range_decoder_init(&rd, in, in_nbytes); + + lzms_input_bitstream_init(&is, in, in_nbytes); + + lzms_init_probabilities(&d->probs); + + lzms_init_huffman_codes(d, lzms_get_num_offset_slots(out_nbytes)); + + for (int i = 0; i < LZMS_NUM_LZ_REPS + 1; i++) + recent_lz_offsets[i] = i + 1; + + for (int i = 0; i < LZMS_NUM_DELTA_REPS + 1; i++) + recent_delta_pairs[i] = i + 1; + + /* Main decode loop */ + while (out_next != out_end) { + + if (!lzms_decode_bit(&rd, &main_state, + LZMS_NUM_MAIN_PROBS, d->probs.main)) + { + /* Literal */ + *out_next++ = lzms_decode_literal(d, &is); + prev_item_type = 0; + + } else if (!lzms_decode_bit(&rd, &match_state, + LZMS_NUM_MATCH_PROBS, + d->probs.match)) + { + /* LZ match */ + + u32 offset; + u32 length; + + STATIC_ASSERT(LZMS_NUM_LZ_REPS == 3); + + if (!lzms_decode_bit(&rd, &lz_state, + LZMS_NUM_LZ_PROBS, d->probs.lz)) + { + /* Explicit offset */ + offset = lzms_decode_lz_offset(d, &is); + + recent_lz_offsets[3] = recent_lz_offsets[2]; + recent_lz_offsets[2] = recent_lz_offsets[1]; + recent_lz_offsets[1] = recent_lz_offsets[0]; + } else { + /* Repeat offset */ + + if (!lzms_decode_bit(&rd, &lz_rep_states[0], + LZMS_NUM_LZ_REP_PROBS, + d->probs.lz_rep[0])) + { + offset = recent_lz_offsets[0 + (prev_item_type & 1)]; + recent_lz_offsets[0 + (prev_item_type & 1)] = recent_lz_offsets[0]; + } else if (!lzms_decode_bit(&rd, &lz_rep_states[1], + LZMS_NUM_LZ_REP_PROBS, + d->probs.lz_rep[1])) + { + offset = recent_lz_offsets[1 + (prev_item_type & 1)]; + recent_lz_offsets[1 + (prev_item_type & 1)] = recent_lz_offsets[1]; + recent_lz_offsets[1] = recent_lz_offsets[0]; + } else { + offset = recent_lz_offsets[2 + (prev_item_type & 1)]; + recent_lz_offsets[2 + (prev_item_type & 1)] = recent_lz_offsets[2]; + recent_lz_offsets[2] = recent_lz_offsets[1]; + recent_lz_offsets[1] = recent_lz_offsets[0]; + } + } + recent_lz_offsets[0] = offset; + prev_item_type = 1; + + length = lzms_decode_length(d, &is); + + if (unlikely(lz_copy(length, offset, out, out_next, out_end, + LZMS_MIN_MATCH_LENGTH))) + return -1; + + out_next += length; + } else { + /* Delta match */ + + /* (See beginning of file for more information.) */ + + u32 power; + u32 raw_offset; + u32 span; + u32 offset; + const u8 *matchptr; + u32 length; + u64 pair; + + STATIC_ASSERT(LZMS_NUM_DELTA_REPS == 3); + + if (!lzms_decode_bit(&rd, &delta_state, + LZMS_NUM_DELTA_PROBS, + d->probs.delta)) + { + /* Explicit offset */ + power = lzms_decode_delta_power(d, &is); + raw_offset = lzms_decode_delta_offset(d, &is); + + pair = ((u64)power << 32) | raw_offset; + recent_delta_pairs[3] = recent_delta_pairs[2]; + recent_delta_pairs[2] = recent_delta_pairs[1]; + recent_delta_pairs[1] = recent_delta_pairs[0]; + } else { + if (!lzms_decode_bit(&rd, &delta_rep_states[0], + LZMS_NUM_DELTA_REP_PROBS, + d->probs.delta_rep[0])) + { + pair = recent_delta_pairs[0 + (prev_item_type >> 1)]; + recent_delta_pairs[0 + (prev_item_type >> 1)] = recent_delta_pairs[0]; + } else if (!lzms_decode_bit(&rd, &delta_rep_states[1], + LZMS_NUM_DELTA_REP_PROBS, + d->probs.delta_rep[1])) + { + pair = recent_delta_pairs[1 + (prev_item_type >> 1)]; + recent_delta_pairs[1 + (prev_item_type >> 1)] = recent_delta_pairs[1]; + recent_delta_pairs[1] = recent_delta_pairs[0]; + } else { + pair = recent_delta_pairs[2 + (prev_item_type >> 1)]; + recent_delta_pairs[2 + (prev_item_type >> 1)] = recent_delta_pairs[2]; + recent_delta_pairs[2] = recent_delta_pairs[1]; + recent_delta_pairs[1] = recent_delta_pairs[0]; + } + + power = pair >> 32; + raw_offset = (u32)pair; + } + recent_delta_pairs[0] = pair; + prev_item_type = 2; + + length = lzms_decode_length(d, &is); + + span = (u32)1 << power; + offset = raw_offset << power; + + /* raw_offset<<power overflows? */ + if (unlikely(offset >> power != raw_offset)) + return -1; + + /* offset+span overflows? */ + if (unlikely(offset + span < offset)) + return -1; + + /* buffer underrun? */ + if (unlikely(offset + span > out_next - (u8 *)out)) + return -1; + + /* buffer overrun? */ + if (unlikely(length > out_end - out_next)) + return -1; + + matchptr = out_next - offset; + do { + *out_next = *matchptr + *(out_next - span) - + *(matchptr - span); + out_next++; + matchptr++; + } while (--length); + } + } + + lzms_x86_filter(out, out_nbytes, d->last_target_usages, true); + return 0; +} + +static void +lzms_free_decompressor(void *_d) +{ + struct lzms_decompressor *d = _d; + + ALIGNED_FREE(d); +} + +const struct decompressor_ops lzms_decompressor_ops = { + .create_decompressor = lzms_create_decompressor, + .decompress = lzms_decompress, + .free_decompressor = lzms_free_decompressor, +}; diff --git a/src/wimlib/lzx_common.c b/src/wimlib/lzx_common.c new file mode 100644 index 00000000..48a34614 --- /dev/null +++ b/src/wimlib/lzx_common.c @@ -0,0 +1,327 @@ +/* + * lzx_common.c - Common code for LZX compression and decompression. + */ + +/* + * Copyright (C) 2012-2016 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <string.h> + +#ifdef __SSE2__ +# include <emmintrin.h> +#endif + +#ifdef __AVX2__ +# include <immintrin.h> +#endif + +#include "wimlib/bitops.h" +#include "wimlib/endianness.h" +#include "wimlib/lzx_common.h" +#include "wimlib/unaligned.h" +#include "wimlib/util.h" + +/* Mapping: offset slot => first match offset that uses that offset slot. + * The offset slots for repeat offsets map to "fake" offsets < 1. */ +const s32 lzx_offset_slot_base[LZX_MAX_OFFSET_SLOTS + 1] = { + -2 , -1 , 0 , 1 , 2 , /* 0 --- 4 */ + 4 , 6 , 10 , 14 , 22 , /* 5 --- 9 */ + 30 , 46 , 62 , 94 , 126 , /* 10 --- 14 */ + 190 , 254 , 382 , 510 , 766 , /* 15 --- 19 */ + 1022 , 1534 , 2046 , 3070 , 4094 , /* 20 --- 24 */ + 6142 , 8190 , 12286 , 16382 , 24574 , /* 25 --- 29 */ + 32766 , 49150 , 65534 , 98302 , 131070 , /* 30 --- 34 */ + 196606 , 262142 , 393214 , 524286 , 655358 , /* 35 --- 39 */ + 786430 , 917502 , 1048574, 1179646, 1310718, /* 40 --- 44 */ + 1441790, 1572862, 1703934, 1835006, 1966078, /* 45 --- 49 */ + 2097150 /* extra */ +}; + +/* Mapping: offset slot => how many extra bits must be read and added to the + * corresponding offset slot base to decode the match offset. */ +const u8 lzx_extra_offset_bits[LZX_MAX_OFFSET_SLOTS] = { + 0 , 0 , 0 , 0 , 1 , + 1 , 2 , 2 , 3 , 3 , + 4 , 4 , 5 , 5 , 6 , + 6 , 7 , 7 , 8 , 8 , + 9 , 9 , 10, 10, 11, + 11, 12, 12, 13, 13, + 14, 14, 15, 15, 16, + 16, 17, 17, 17, 17, + 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, +}; + +/* Round the specified buffer size up to the next valid LZX window size, and + * return its order (log2). Or, if the buffer size is 0 or greater than the + * largest valid LZX window size, return 0. */ +unsigned +lzx_get_window_order(size_t max_bufsize) +{ + if (max_bufsize == 0 || max_bufsize > LZX_MAX_WINDOW_SIZE) + return 0; + + return max(ilog2_ceil(max_bufsize), LZX_MIN_WINDOW_ORDER); +} + +/* Given a valid LZX window order, return the number of symbols that will exist + * in the main Huffman code. */ +unsigned +lzx_get_num_main_syms(unsigned window_order) +{ + /* Note: one would expect that the maximum match offset would be + * 'window_size - LZX_MIN_MATCH_LEN', which would occur if the first two + * bytes were to match the last two bytes. However, the format + * disallows this case. This reduces the number of needed offset slots + * by 1. */ + u32 window_size = (u32)1 << window_order; + u32 max_offset = window_size - LZX_MIN_MATCH_LEN - 1; + unsigned num_offset_slots = 30; + while (max_offset >= lzx_offset_slot_base[num_offset_slots]) + num_offset_slots++; + + return LZX_NUM_CHARS + (num_offset_slots * LZX_NUM_LEN_HEADERS); +} + +static void +do_translate_target(void *target, s32 input_pos) +{ + s32 abs_offset, rel_offset; + + rel_offset = get_unaligned_le32(target); + if (rel_offset >= -input_pos && rel_offset < LZX_WIM_MAGIC_FILESIZE) { + if (rel_offset < LZX_WIM_MAGIC_FILESIZE - input_pos) { + /* "good translation" */ + abs_offset = rel_offset + input_pos; + } else { + /* "compensating translation" */ + abs_offset = rel_offset - LZX_WIM_MAGIC_FILESIZE; + } + put_unaligned_le32(abs_offset, target); + } +} + +static void +undo_translate_target(void *target, s32 input_pos) +{ + s32 abs_offset, rel_offset; + + abs_offset = get_unaligned_le32(target); + if (abs_offset >= 0) { + if (abs_offset < LZX_WIM_MAGIC_FILESIZE) { + /* "good translation" */ + rel_offset = abs_offset - input_pos; + put_unaligned_le32(rel_offset, target); + } + } else { + if (abs_offset >= -input_pos) { + /* "compensating translation" */ + rel_offset = abs_offset + LZX_WIM_MAGIC_FILESIZE; + put_unaligned_le32(rel_offset, target); + } + } +} + +/* + * Do or undo the 'E8' preprocessing used in LZX. Before compression, the + * uncompressed data is preprocessed by changing the targets of x86 CALL + * instructions from relative offsets to absolute offsets. After decompression, + * the translation is undone by changing the targets of x86 CALL instructions + * from absolute offsets to relative offsets. + * + * Note that despite its intent, E8 preprocessing can be done on any data even + * if it is not actually x86 machine code. In fact, E8 preprocessing appears to + * always be used in LZX-compressed resources in WIM files; there is no bit to + * indicate whether it is used or not, unlike in the LZX compressed format as + * used in cabinet files, where a bit is reserved for that purpose. + * + * E8 preprocessing is disabled in the last 6 bytes of the uncompressed data, + * which really means the 5-byte call instruction cannot start in the last 10 + * bytes of the uncompressed data. This is one of the errors in the LZX + * documentation. + * + * E8 preprocessing does not appear to be disabled after the 32768th chunk of a + * WIM resource, which apparently is another difference from the LZX compression + * used in cabinet files. + * + * E8 processing is supposed to take the file size as a parameter, as it is used + * in calculating the translated jump targets. But in WIM files, this file size + * is always the same (LZX_WIM_MAGIC_FILESIZE == 12000000). + */ +static void +lzx_e8_filter(u8 *data, u32 size, void (*process_target)(void *, s32)) +{ + +#if !defined(__SSE2__) && !defined(__AVX2__) + /* + * A worthwhile optimization is to push the end-of-buffer check into the + * relatively rare E8 case. This is possible if we replace the last six + * bytes of data with E8 bytes; then we are guaranteed to hit an E8 byte + * before reaching end-of-buffer. In addition, this scheme guarantees + * that no translation can begin following an E8 byte in the last 10 + * bytes because a 4-byte offset containing E8 as its high byte is a + * large negative number that is not valid for translation. That is + * exactly what we need. + */ + u8 *tail; + u8 saved_bytes[6]; + u8 *p; + + if (size <= 10) + return; + + tail = &data[size - 6]; + memcpy(saved_bytes, tail, 6); + memset(tail, 0xE8, 6); + p = data; + for (;;) { + while (*p != 0xE8) + p++; + if (p >= tail) + break; + (*process_target)(p + 1, p - data); + p += 5; + } + memcpy(tail, saved_bytes, 6); +#else + /* SSE2 or AVX-2 optimized version for x86_64 */ + + u8 *p = data; + u64 valid_mask = ~0; + + if (size <= 10) + return; +#ifdef __AVX2__ +# define ALIGNMENT_REQUIRED 32 +#else +# define ALIGNMENT_REQUIRED 16 +#endif + + /* Process one byte at a time until the pointer is properly aligned. */ + while ((uintptr_t)p % ALIGNMENT_REQUIRED != 0) { + if (p >= data + size - 10) + return; + if (*p == 0xE8 && (valid_mask & 1)) { + (*process_target)(p + 1, p - data); + valid_mask &= ~0x1F; + } + p++; + valid_mask >>= 1; + valid_mask |= (u64)1 << 63; + } + + if (data + size - p >= 64) { + + /* Vectorized processing */ + + /* Note: we use a "trap" E8 byte to eliminate the need to check + * for end-of-buffer in the inner loop. This byte is carefully + * positioned so that it will never be changed by a previous + * translation before it is detected. */ + + u8 *trap = p + ((data + size - p) & ~31) - 32 + 4; + u8 saved_byte = *trap; + *trap = 0xE8; + + for (;;) { + u32 e8_mask; + u8 *orig_p = p; + #ifdef __AVX2__ + const __m256i e8_bytes = _mm256_set1_epi8(0xE8); + for (;;) { + __m256i bytes = *(const __m256i *)p; + __m256i cmpresult = _mm256_cmpeq_epi8(bytes, e8_bytes); + e8_mask = _mm256_movemask_epi8(cmpresult); + if (e8_mask) + break; + p += 32; + } + #else + const __m128i e8_bytes = _mm_set1_epi8(0xE8); + for (;;) { + /* Read the next 32 bytes of data and test them + * for E8 bytes. */ + __m128i bytes1 = *(const __m128i *)p; + __m128i bytes2 = *(const __m128i *)(p + 16); + __m128i cmpresult1 = _mm_cmpeq_epi8(bytes1, e8_bytes); + __m128i cmpresult2 = _mm_cmpeq_epi8(bytes2, e8_bytes); + u32 mask1 = _mm_movemask_epi8(cmpresult1); + u32 mask2 = _mm_movemask_epi8(cmpresult2); + /* The masks have a bit set for each E8 byte. + * We stay in this fast inner loop as long as + * there are no E8 bytes. */ + if (mask1 | mask2) { + e8_mask = mask1 | (mask2 << 16); + break; + } + p += 32; + } + #endif + + /* Did we pass over data with no E8 bytes? */ + if (p != orig_p) + valid_mask = ~0; + + /* Are we nearing end-of-buffer? */ + if (p == trap - 4) + break; + + /* Process the E8 bytes. However, the AND with + * 'valid_mask' ensures we never process an E8 byte that + * was itself part of a translation target. */ + while ((e8_mask &= valid_mask)) { + unsigned bit = bsf32(e8_mask); + (*process_target)(p + bit + 1, p + bit - data); + valid_mask &= ~((u64)0x1F << bit); + } + + valid_mask >>= 32; + valid_mask |= 0xFFFFFFFF00000000; + p += 32; + } + + *trap = saved_byte; + } + + /* Approaching the end of the buffer; process one byte a time. */ + while (p < data + size - 10) { + if (*p == 0xE8 && (valid_mask & 1)) { + (*process_target)(p + 1, p - data); + valid_mask &= ~0x1F; + } + p++; + valid_mask >>= 1; + valid_mask |= (u64)1 << 63; + } +#endif /* __SSE2__ || __AVX2__ */ +} + +void +lzx_preprocess(u8 *data, u32 size) +{ + lzx_e8_filter(data, size, do_translate_target); +} + +void +lzx_postprocess(u8 *data, u32 size) +{ + lzx_e8_filter(data, size, undo_translate_target); +} diff --git a/src/wimlib/lzx_compress.c b/src/wimlib/lzx_compress.c new file mode 100644 index 00000000..02498bf5 --- /dev/null +++ b/src/wimlib/lzx_compress.c @@ -0,0 +1,2969 @@ +/* + * lzx_compress.c + * + * A compressor for the LZX compression format, as used in WIM archives. + */ + +/* + * Copyright (C) 2012-2017 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + + +/* + * This file contains a compressor for the LZX ("Lempel-Ziv eXtended") + * compression format, as used in the WIM (Windows IMaging) file format. + * + * Two different LZX-compatible algorithms are implemented: "near-optimal" and + * "lazy". "Near-optimal" is significantly slower than "lazy", but results in a + * better compression ratio. The "near-optimal" algorithm is used at the + * default compression level. + * + * This file may need some slight modifications to be used outside of the WIM + * format. In particular, in other situations the LZX block header might be + * slightly different, and sliding window support might be required. + * + * LZX is a compression format derived from DEFLATE, the format used by zlib and + * gzip. Both LZX and DEFLATE use LZ77 matching and Huffman coding. Certain + * details are quite similar, such as the method for storing Huffman codes. + * However, the main differences are: + * + * - LZX preprocesses the data to attempt to make x86 machine code slightly more + * compressible before attempting to compress it further. + * + * - LZX uses a "main" alphabet which combines literals and matches, with the + * match symbols containing a "length header" (giving all or part of the match + * length) and an "offset slot" (giving, roughly speaking, the order of + * magnitude of the match offset). + * + * - LZX does not have static Huffman blocks (that is, the kind with preset + * Huffman codes); however it does have two types of dynamic Huffman blocks + * ("verbatim" and "aligned"). + * + * - LZX has a minimum match length of 2 rather than 3. Length 2 matches can be + * useful, but generally only if the compressor is smart about choosing them. + * + * - In LZX, offset slots 0 through 2 actually represent entries in an LRU queue + * of match offsets. This is very useful for certain types of files, such as + * binary files that have repeating records. + */ + +/******************************************************************************/ +/* General parameters */ +/*----------------------------------------------------------------------------*/ + +/* + * The compressor uses the faster algorithm at levels <= MAX_FAST_LEVEL. It + * uses the slower algorithm at levels > MAX_FAST_LEVEL. + */ +#define MAX_FAST_LEVEL 34 + +/* + * The compressor-side limits on the codeword lengths (in bits) for each Huffman + * code. To make outputting bits slightly faster, some of these limits are + * lower than the limits defined by the LZX format. This does not significantly + * affect the compression ratio. + */ +#define MAIN_CODEWORD_LIMIT 16 +#define LENGTH_CODEWORD_LIMIT 12 +#define ALIGNED_CODEWORD_LIMIT 7 +#define PRE_CODEWORD_LIMIT 7 + + +/******************************************************************************/ +/* Block splitting parameters */ +/*----------------------------------------------------------------------------*/ + +/* + * The compressor always outputs blocks of at least this size in bytes, except + * for the last block which may need to be smaller. + */ +#define MIN_BLOCK_SIZE 6500 + +/* + * The compressor attempts to end a block when it reaches this size in bytes. + * The final size might be slightly larger due to matches extending beyond the + * end of the block. Specifically: + * + * - The near-optimal compressor may choose a match of up to LZX_MAX_MATCH_LEN + * bytes starting at position 'SOFT_MAX_BLOCK_SIZE - 1'. + * + * - The lazy compressor may choose a sequence of literals starting at position + * 'SOFT_MAX_BLOCK_SIZE - 1' when it sees a sequence of increasingly better + * matches. The final match may be up to LZX_MAX_MATCH_LEN bytes. The + * length of the literal sequence is approximately limited by the "nice match + * length" parameter. + */ +#define SOFT_MAX_BLOCK_SIZE 100000 + +/* + * The number of observed items (matches and literals) that represents + * sufficient data for the compressor to decide whether the current block should + * be ended or not. + */ +#define NUM_OBSERVATIONS_PER_BLOCK_CHECK 400 + + +/******************************************************************************/ +/* Parameters for slower algorithm */ +/*----------------------------------------------------------------------------*/ + +/* + * The log base 2 of the number of entries in the hash table for finding length + * 2 matches. This could be as high as 16, but using a smaller hash table + * speeds up compression due to reduced cache pressure. + */ +#define BT_MATCHFINDER_HASH2_ORDER 12 + +/* + * The number of lz_match structures in the match cache, excluding the extra + * "overflow" entries. This value should be high enough so that nearly the + * time, all matches found in a given block can fit in the match cache. + * However, fallback behavior (immediately terminating the block) on cache + * overflow is still required. + */ +#define CACHE_LENGTH (SOFT_MAX_BLOCK_SIZE * 5) + +/* + * An upper bound on the number of matches that can ever be saved in the match + * cache for a single position. Since each match we save for a single position + * has a distinct length, we can use the number of possible match lengths in LZX + * as this bound. This bound is guaranteed to be valid in all cases, although + * if 'nice_match_length < LZX_MAX_MATCH_LEN', then it will never actually be + * reached. + */ +#define MAX_MATCHES_PER_POS LZX_NUM_LENS + +/* + * A scaling factor that makes it possible to consider fractional bit costs. A + * single bit has a cost of BIT_COST. + * + * Note: this is only useful as a statistical trick for when the true costs are + * unknown. Ultimately, each token in LZX requires a whole number of bits to + * output. + */ +#define BIT_COST 64 + +/* + * Should the compressor take into account the costs of aligned offset symbols + * instead of assuming that all are equally likely? + */ +#define CONSIDER_ALIGNED_COSTS 1 + +/* + * Should the "minimum" cost path search algorithm consider "gap" matches, where + * a normal match is followed by a literal, then by a match with the same + * offset? This is one specific, somewhat common situation in which the true + * minimum cost path is often different from the path found by looking only one + * edge ahead. + */ +#define CONSIDER_GAP_MATCHES 1 + +/******************************************************************************/ +/* Includes */ +/*----------------------------------------------------------------------------*/ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/compress_common.h" +#include "wimlib/compressor_ops.h" +#include "wimlib/error.h" +#include "wimlib/lzx_common.h" +#include "wimlib/unaligned.h" +#include "wimlib/util.h" + +/* Note: BT_MATCHFINDER_HASH2_ORDER must be defined before including + * bt_matchfinder.h. */ + +/* Matchfinders with 16-bit positions */ +#define mf_pos_t u16 +#define MF_SUFFIX _16 +#include "wimlib/bt_matchfinder.h" +#include "wimlib/hc_matchfinder.h" + +/* Matchfinders with 32-bit positions */ +#undef mf_pos_t +#undef MF_SUFFIX +#define mf_pos_t u32 +#define MF_SUFFIX _32 +#include "wimlib/bt_matchfinder.h" +#include "wimlib/hc_matchfinder.h" + +/******************************************************************************/ +/* Compressor structure */ +/*----------------------------------------------------------------------------*/ + +/* Codewords for the Huffman codes */ +struct lzx_codewords { + u32 main[LZX_MAINCODE_MAX_NUM_SYMBOLS]; + u32 len[LZX_LENCODE_NUM_SYMBOLS]; + u32 aligned[LZX_ALIGNEDCODE_NUM_SYMBOLS]; +}; + +/* + * Codeword lengths, in bits, for the Huffman codes. + * + * A codeword length of 0 means the corresponding codeword has zero frequency. + * + * The main and length codes each have one extra entry for use as a sentinel. + * See lzx_write_compressed_code(). + */ +struct lzx_lens { + u8 main[LZX_MAINCODE_MAX_NUM_SYMBOLS + 1]; + u8 len[LZX_LENCODE_NUM_SYMBOLS + 1]; + u8 aligned[LZX_ALIGNEDCODE_NUM_SYMBOLS]; +}; + +/* Codewords and lengths for the Huffman codes */ +struct lzx_codes { + struct lzx_codewords codewords; + struct lzx_lens lens; +}; + +/* Symbol frequency counters for the Huffman-encoded alphabets */ +struct lzx_freqs { + u32 main[LZX_MAINCODE_MAX_NUM_SYMBOLS]; + u32 len[LZX_LENCODE_NUM_SYMBOLS]; + u32 aligned[LZX_ALIGNEDCODE_NUM_SYMBOLS]; +}; + +/* Block split statistics. See the "Block splitting algorithm" section later in + * this file for details. */ +#define NUM_LITERAL_OBSERVATION_TYPES 8 +#define NUM_MATCH_OBSERVATION_TYPES 2 +#define NUM_OBSERVATION_TYPES (NUM_LITERAL_OBSERVATION_TYPES + \ + NUM_MATCH_OBSERVATION_TYPES) +struct lzx_block_split_stats { + u32 new_observations[NUM_OBSERVATION_TYPES]; + u32 observations[NUM_OBSERVATION_TYPES]; + u32 num_new_observations; + u32 num_observations; +}; + +/* + * Represents a run of literals followed by a match or end-of-block. This + * structure is needed to temporarily store items chosen by the compressor, + * since items cannot be written until all items for the block have been chosen + * and the block's Huffman codes have been computed. + */ +struct lzx_sequence { + + /* + * Bits 9..31: the number of literals in this run. This may be 0 and + * can be at most about SOFT_MAX_BLOCK_LENGTH. The literals are not + * stored explicitly in this structure; instead, they are read directly + * from the uncompressed data. + * + * Bits 0..8: the length of the match which follows the literals, or 0 + * if this literal run was the last in the block, so there is no match + * which follows it. This can be at most LZX_MAX_MATCH_LEN. + */ + u32 litrunlen_and_matchlen; +#define SEQ_MATCHLEN_BITS 9 +#define SEQ_MATCHLEN_MASK (((u32)1 << SEQ_MATCHLEN_BITS) - 1) + + /* + * If 'matchlen' doesn't indicate end-of-block, then this contains: + * + * Bits 10..31: either the offset plus LZX_OFFSET_ADJUSTMENT or a recent + * offset code, depending on the offset slot encoded in the main symbol. + * + * Bits 0..9: the main symbol. + */ + u32 adjusted_offset_and_mainsym; +#define SEQ_MAINSYM_BITS 10 +#define SEQ_MAINSYM_MASK (((u32)1 << SEQ_MAINSYM_BITS) - 1) +} __attribute__((aligned(8))); + +/* + * This structure represents a byte position in the input buffer and a node in + * the graph of possible match/literal choices. + * + * Logically, each incoming edge to this node is labeled with a literal or a + * match that can be taken to reach this position from an earlier position; and + * each outgoing edge from this node is labeled with a literal or a match that + * can be taken to advance from this position to a later position. + */ +struct lzx_optimum_node { + + /* The cost, in bits, of the lowest-cost path that has been found to + * reach this position. This can change as progressively lower cost + * paths are found to reach this position. */ + u32 cost; + + /* + * The best arrival to this node, i.e. the match or literal that was + * used to arrive to this position at the given 'cost'. This can change + * as progressively lower cost paths are found to reach this position. + * + * For non-gap matches, this variable is divided into two bitfields + * whose meanings depend on the item type: + * + * Literals: + * Low bits are 0, high bits are the literal. + * + * Explicit offset matches: + * Low bits are the match length, high bits are the offset plus + * LZX_OFFSET_ADJUSTMENT. + * + * Repeat offset matches: + * Low bits are the match length, high bits are the queue index. + * + * For gap matches, identified by OPTIMUM_GAP_MATCH set, special + * behavior applies --- see the code. + */ + u32 item; +#define OPTIMUM_OFFSET_SHIFT SEQ_MATCHLEN_BITS +#define OPTIMUM_LEN_MASK SEQ_MATCHLEN_MASK +#if CONSIDER_GAP_MATCHES +# define OPTIMUM_GAP_MATCH 0x80000000 +#endif + +} __attribute__((aligned(8))); + +/* The cost model for near-optimal parsing */ +struct lzx_costs { + + /* + * 'match_cost[offset_slot][len - LZX_MIN_MATCH_LEN]' is the cost of a + * length 'len' match which has an offset belonging to 'offset_slot'. + * The cost includes the main symbol, the length symbol if required, and + * the extra offset bits if any, excluding any entropy-coded bits + * (aligned offset bits). It does *not* include the cost of the aligned + * offset symbol which may be required. + */ + u16 match_cost[LZX_MAX_OFFSET_SLOTS][LZX_NUM_LENS]; + + /* Cost of each symbol in the main code */ + u32 main[LZX_MAINCODE_MAX_NUM_SYMBOLS]; + + /* Cost of each symbol in the length code */ + u32 len[LZX_LENCODE_NUM_SYMBOLS]; + +#if CONSIDER_ALIGNED_COSTS + /* Cost of each symbol in the aligned offset code */ + u32 aligned[LZX_ALIGNEDCODE_NUM_SYMBOLS]; +#endif +}; + +struct lzx_output_bitstream; + +/* The main LZX compressor structure */ +struct lzx_compressor { + + /* The buffer for preprocessed input data, if not using destructive + * compression */ + void *in_buffer; + + /* If true, then the compressor need not preserve the input buffer if it + * compresses the data successfully */ + bool destructive; + + /* Pointer to the compress() implementation chosen at allocation time */ + void (*impl)(struct lzx_compressor *, const u8 *, size_t, + struct lzx_output_bitstream *); + + /* The log base 2 of the window size for match offset encoding purposes. + * This will be >= LZX_MIN_WINDOW_ORDER and <= LZX_MAX_WINDOW_ORDER. */ + unsigned window_order; + + /* The number of symbols in the main alphabet. This depends on the + * window order, since the window order determines the maximum possible + * match offset. */ + unsigned num_main_syms; + + /* The "nice" match length: if a match of this length is found, then it + * is chosen immediately without further consideration. */ + unsigned nice_match_length; + + /* The maximum search depth: at most this many potential matches are + * considered at each position. */ + unsigned max_search_depth; + + /* The number of optimization passes per block */ + unsigned num_optim_passes; + + /* The symbol frequency counters for the current block */ + struct lzx_freqs freqs; + + /* Block split statistics for the current block */ + struct lzx_block_split_stats split_stats; + + /* The Huffman codes for the current and previous blocks. The one with + * index 'codes_index' is for the current block, and the other one is + * for the previous block. */ + struct lzx_codes codes[2]; + unsigned codes_index; + + /* The matches and literals that the compressor has chosen for the + * current block. The required length of this array is limited by the + * maximum number of matches that can ever be chosen for a single block, + * plus one for the special entry at the end. */ + struct lzx_sequence chosen_sequences[ + DIV_ROUND_UP(SOFT_MAX_BLOCK_SIZE, LZX_MIN_MATCH_LEN) + 1]; + + /* Tables for mapping adjusted offsets to offset slots */ + u8 offset_slot_tab_1[32768]; /* offset slots [0, 29] */ + u8 offset_slot_tab_2[128]; /* offset slots [30, 49] */ + + union { + /* Data for lzx_compress_lazy() */ + struct { + /* Hash chains matchfinder (MUST BE LAST!!!) */ + union { + struct hc_matchfinder_16 hc_mf_16; + struct hc_matchfinder_32 hc_mf_32; + }; + }; + + /* Data for lzx_compress_near_optimal() */ + struct { + /* + * Array of nodes, one per position, for running the + * minimum-cost path algorithm. + * + * This array must be large enough to accommodate the + * worst-case number of nodes, which occurs if the + * compressor finds a match of length LZX_MAX_MATCH_LEN + * at position 'SOFT_MAX_BLOCK_SIZE - 1', producing a + * block of size 'SOFT_MAX_BLOCK_SIZE - 1 + + * LZX_MAX_MATCH_LEN'. Add one for the end-of-block + * node. + */ + struct lzx_optimum_node optimum_nodes[ + SOFT_MAX_BLOCK_SIZE - 1 + + LZX_MAX_MATCH_LEN + 1]; + + /* The cost model for the current optimization pass */ + struct lzx_costs costs; + + /* + * Cached matches for the current block. This array + * contains the matches that were found at each position + * in the block. Specifically, for each position, there + * is a special 'struct lz_match' whose 'length' field + * contains the number of matches that were found at + * that position; this is followed by the matches + * themselves, if any, sorted by strictly increasing + * length. + * + * Note: in rare cases, there will be a very high number + * of matches in the block and this array will overflow. + * If this happens, we force the end of the current + * block. CACHE_LENGTH is the length at which we + * actually check for overflow. The extra slots beyond + * this are enough to absorb the worst case overflow, + * which occurs if starting at &match_cache[CACHE_LENGTH + * - 1], we write the match count header, then write + * MAX_MATCHES_PER_POS matches, then skip searching for + * matches at 'LZX_MAX_MATCH_LEN - 1' positions and + * write the match count header for each. + */ + struct lz_match match_cache[CACHE_LENGTH + + MAX_MATCHES_PER_POS + + LZX_MAX_MATCH_LEN - 1]; + + /* Binary trees matchfinder (MUST BE LAST!!!) */ + union { + struct bt_matchfinder_16 bt_mf_16; + struct bt_matchfinder_32 bt_mf_32; + }; + }; + }; +}; + +/******************************************************************************/ +/* Matchfinder utilities */ +/*----------------------------------------------------------------------------*/ + +/* + * Will a matchfinder using 16-bit positions be sufficient for compressing + * buffers of up to the specified size? The limit could be 65536 bytes, but we + * also want to optimize out the use of offset_slot_tab_2 in the 16-bit case. + * This requires that the limit be no more than the length of offset_slot_tab_1 + * (currently 32768). + */ +static forceinline bool +lzx_is_16_bit(size_t max_bufsize) +{ + STATIC_ASSERT(ARRAY_LEN(((struct lzx_compressor *)0)->offset_slot_tab_1) == 32768); + return max_bufsize <= 32768; +} + +/* + * Return the offset slot for the specified adjusted match offset. + */ +static forceinline unsigned +lzx_get_offset_slot(struct lzx_compressor *c, u32 adjusted_offset, + bool is_16_bit) +{ + if (__builtin_constant_p(adjusted_offset) && + adjusted_offset < LZX_NUM_RECENT_OFFSETS) + return adjusted_offset; + if (is_16_bit || adjusted_offset < ARRAY_LEN(c->offset_slot_tab_1)) + return c->offset_slot_tab_1[adjusted_offset]; + return c->offset_slot_tab_2[adjusted_offset >> 14]; +} + +/* + * For a match that has the specified length and adjusted offset, tally its main + * symbol, and if needed its length symbol; then return its main symbol. + */ +static forceinline unsigned +lzx_tally_main_and_lensyms(struct lzx_compressor *c, unsigned length, + u32 adjusted_offset, bool is_16_bit) +{ + unsigned mainsym; + + if (length >= LZX_MIN_SECONDARY_LEN) { + /* Length symbol needed */ + c->freqs.len[length - LZX_MIN_SECONDARY_LEN]++; + mainsym = LZX_NUM_CHARS + LZX_NUM_PRIMARY_LENS; + } else { + /* No length symbol needed */ + mainsym = LZX_NUM_CHARS + length - LZX_MIN_MATCH_LEN; + } + + mainsym += LZX_NUM_LEN_HEADERS * + lzx_get_offset_slot(c, adjusted_offset, is_16_bit); + c->freqs.main[mainsym]++; + return mainsym; +} + +/* + * The following macros call either the 16-bit or the 32-bit version of a + * matchfinder function based on the value of 'is_16_bit', which will be known + * at compilation time. + */ + +#define CALL_HC_MF(is_16_bit, c, funcname, ...) \ + ((is_16_bit) ? CONCAT(funcname, _16)(&(c)->hc_mf_16, ##__VA_ARGS__) : \ + CONCAT(funcname, _32)(&(c)->hc_mf_32, ##__VA_ARGS__)); + +#define CALL_BT_MF(is_16_bit, c, funcname, ...) \ + ((is_16_bit) ? CONCAT(funcname, _16)(&(c)->bt_mf_16, ##__VA_ARGS__) : \ + CONCAT(funcname, _32)(&(c)->bt_mf_32, ##__VA_ARGS__)); + +/******************************************************************************/ +/* Output bitstream */ +/*----------------------------------------------------------------------------*/ + +/* + * The LZX bitstream is encoded as a sequence of little endian 16-bit coding + * units. Bits are ordered from most significant to least significant within + * each coding unit. + */ + +/* + * Structure to keep track of the current state of sending bits to the + * compressed output buffer. + */ +struct lzx_output_bitstream { + + /* Bits that haven't yet been written to the output buffer */ + machine_word_t bitbuf; + + /* Number of bits currently held in @bitbuf */ + machine_word_t bitcount; + + /* Pointer to the start of the output buffer */ + u8 *start; + + /* Pointer to the position in the output buffer at which the next coding + * unit should be written */ + u8 *next; + + /* Pointer to just past the end of the output buffer, rounded down by + * one byte if needed to make 'end - start' a multiple of 2 */ + u8 *end; +}; + +/* Can the specified number of bits always be added to 'bitbuf' after all + * pending 16-bit coding units have been flushed? */ +#define CAN_BUFFER(n) ((n) <= WORDBITS - 15) + +/* Initialize the output bitstream to write to the specified buffer. */ +static void +lzx_init_output(struct lzx_output_bitstream *os, void *buffer, size_t size) +{ + os->bitbuf = 0; + os->bitcount = 0; + os->start = buffer; + os->next = buffer; + os->end = (u8 *)buffer + (size & ~1); +} + +/* + * Add some bits to the bitbuffer variable of the output bitstream. The caller + * must make sure there is enough room. + */ +static forceinline void +lzx_add_bits(struct lzx_output_bitstream *os, u32 bits, unsigned num_bits) +{ + os->bitbuf = (os->bitbuf << num_bits) | bits; + os->bitcount += num_bits; +} + +/* + * Flush bits from the bitbuffer variable to the output buffer. 'max_num_bits' + * specifies the maximum number of bits that may have been added since the last + * flush. + */ +static forceinline void +lzx_flush_bits(struct lzx_output_bitstream *os, unsigned max_num_bits) +{ + /* Masking the number of bits to shift is only needed to avoid undefined + * behavior; we don't actually care about the results of bad shifts. On + * x86, the explicit masking generates no extra code. */ + const u32 shift_mask = WORDBITS - 1; + + if (os->end - os->next < 6) + return; + put_unaligned_le16(os->bitbuf >> ((os->bitcount - 16) & + shift_mask), os->next + 0); + if (max_num_bits > 16) + put_unaligned_le16(os->bitbuf >> ((os->bitcount - 32) & + shift_mask), os->next + 2); + if (max_num_bits > 32) + put_unaligned_le16(os->bitbuf >> ((os->bitcount - 48) & + shift_mask), os->next + 4); + os->next += (os->bitcount >> 4) << 1; + os->bitcount &= 15; +} + +/* Add at most 16 bits to the bitbuffer and flush it. */ +static forceinline void +lzx_write_bits(struct lzx_output_bitstream *os, u32 bits, unsigned num_bits) +{ + lzx_add_bits(os, bits, num_bits); + lzx_flush_bits(os, 16); +} + +/* + * Flush the last coding unit to the output buffer if needed. Return the total + * number of bytes written to the output buffer, or 0 if an overflow occurred. + */ +static size_t +lzx_flush_output(struct lzx_output_bitstream *os) +{ + if (os->end - os->next < 6) + return 0; + + if (os->bitcount != 0) { + put_unaligned_le16(os->bitbuf << (16 - os->bitcount), os->next); + os->next += 2; + } + + return os->next - os->start; +} + +/******************************************************************************/ +/* Preparing Huffman codes */ +/*----------------------------------------------------------------------------*/ + +/* + * Build the Huffman codes. This takes as input the frequency tables for each + * code and produces as output a set of tables that map symbols to codewords and + * codeword lengths. + */ +static void +lzx_build_huffman_codes(struct lzx_compressor *c) +{ + const struct lzx_freqs *freqs = &c->freqs; + struct lzx_codes *codes = &c->codes[c->codes_index]; + + STATIC_ASSERT(MAIN_CODEWORD_LIMIT >= 9 && + MAIN_CODEWORD_LIMIT <= LZX_MAX_MAIN_CODEWORD_LEN); + make_canonical_huffman_code(c->num_main_syms, + MAIN_CODEWORD_LIMIT, + freqs->main, + codes->lens.main, + codes->codewords.main); + + STATIC_ASSERT(LENGTH_CODEWORD_LIMIT >= 8 && + LENGTH_CODEWORD_LIMIT <= LZX_MAX_LEN_CODEWORD_LEN); + make_canonical_huffman_code(LZX_LENCODE_NUM_SYMBOLS, + LENGTH_CODEWORD_LIMIT, + freqs->len, + codes->lens.len, + codes->codewords.len); + + STATIC_ASSERT(ALIGNED_CODEWORD_LIMIT >= LZX_NUM_ALIGNED_OFFSET_BITS && + ALIGNED_CODEWORD_LIMIT <= LZX_MAX_ALIGNED_CODEWORD_LEN); + make_canonical_huffman_code(LZX_ALIGNEDCODE_NUM_SYMBOLS, + ALIGNED_CODEWORD_LIMIT, + freqs->aligned, + codes->lens.aligned, + codes->codewords.aligned); +} + +/* Reset the symbol frequencies for the current block. */ +static void +lzx_reset_symbol_frequencies(struct lzx_compressor *c) +{ + memset(&c->freqs, 0, sizeof(c->freqs)); +} + +static unsigned +lzx_compute_precode_items(const u8 lens[restrict], + const u8 prev_lens[restrict], + u32 precode_freqs[restrict], + unsigned precode_items[restrict]) +{ + unsigned *itemptr; + unsigned run_start; + unsigned run_end; + unsigned extra_bits; + int delta; + u8 len; + + itemptr = precode_items; + run_start = 0; + + while (!((len = lens[run_start]) & 0x80)) { + + /* len = the length being repeated */ + + /* Find the next run of codeword lengths. */ + + run_end = run_start + 1; + + /* Fast case for a single length. */ + if (likely(len != lens[run_end])) { + delta = prev_lens[run_start] - len; + if (delta < 0) + delta += 17; + precode_freqs[delta]++; + *itemptr++ = delta; + run_start++; + continue; + } + + /* Extend the run. */ + do { + run_end++; + } while (len == lens[run_end]); + + if (len == 0) { + /* Run of zeroes. */ + + /* Symbol 18: RLE 20 to 51 zeroes at a time. */ + while ((run_end - run_start) >= 20) { + extra_bits = min((run_end - run_start) - 20, 0x1F); + precode_freqs[18]++; + *itemptr++ = 18 | (extra_bits << 5); + run_start += 20 + extra_bits; + } + + /* Symbol 17: RLE 4 to 19 zeroes at a time. */ + if ((run_end - run_start) >= 4) { + extra_bits = min((run_end - run_start) - 4, 0xF); + precode_freqs[17]++; + *itemptr++ = 17 | (extra_bits << 5); + run_start += 4 + extra_bits; + } + } else { + + /* A run of nonzero lengths. */ + + /* Symbol 19: RLE 4 to 5 of any length at a time. */ + while ((run_end - run_start) >= 4) { + extra_bits = (run_end - run_start) > 4; + delta = prev_lens[run_start] - len; + if (delta < 0) + delta += 17; + precode_freqs[19]++; + precode_freqs[delta]++; + *itemptr++ = 19 | (extra_bits << 5) | (delta << 6); + run_start += 4 + extra_bits; + } + } + + /* Output any remaining lengths without RLE. */ + while (run_start != run_end) { + delta = prev_lens[run_start] - len; + if (delta < 0) + delta += 17; + precode_freqs[delta]++; + *itemptr++ = delta; + run_start++; + } + } + + return itemptr - precode_items; +} + +/******************************************************************************/ +/* Outputting compressed data */ +/*----------------------------------------------------------------------------*/ + +/* + * Output a Huffman code in the compressed form used in LZX. + * + * The Huffman code is represented in the output as a logical series of codeword + * lengths from which the Huffman code, which must be in canonical form, can be + * reconstructed. + * + * The codeword lengths are themselves compressed using a separate Huffman code, + * the "precode", which contains a symbol for each possible codeword length in + * the larger code as well as several special symbols to represent repeated + * codeword lengths (a form of run-length encoding). The precode is itself + * constructed in canonical form, and its codeword lengths are represented + * literally in 20 4-bit fields that immediately precede the compressed codeword + * lengths of the larger code. + * + * Furthermore, the codeword lengths of the larger code are actually represented + * as deltas from the codeword lengths of the corresponding code in the previous + * block. + * + * @os: + * Bitstream to which to write the compressed Huffman code. + * @lens: + * The codeword lengths, indexed by symbol, in the Huffman code. + * @prev_lens: + * The codeword lengths, indexed by symbol, in the corresponding Huffman + * code in the previous block, or all zeroes if this is the first block. + * @num_lens: + * The number of symbols in the Huffman code. + */ +static void +lzx_write_compressed_code(struct lzx_output_bitstream *os, + const u8 lens[restrict], + const u8 prev_lens[restrict], + unsigned num_lens) +{ + u32 precode_freqs[LZX_PRECODE_NUM_SYMBOLS]; + u8 precode_lens[LZX_PRECODE_NUM_SYMBOLS]; + u32 precode_codewords[LZX_PRECODE_NUM_SYMBOLS]; + unsigned precode_items[num_lens]; + unsigned num_precode_items; + unsigned precode_item; + unsigned precode_sym; + unsigned i; + u8 saved = lens[num_lens]; + *(u8 *)(lens + num_lens) = 0x80; + + for (i = 0; i < LZX_PRECODE_NUM_SYMBOLS; i++) + precode_freqs[i] = 0; + + /* Compute the "items" (RLE / literal tokens and extra bits) with which + * the codeword lengths in the larger code will be output. */ + num_precode_items = lzx_compute_precode_items(lens, + prev_lens, + precode_freqs, + precode_items); + + /* Build the precode. */ + STATIC_ASSERT(PRE_CODEWORD_LIMIT >= 5 && + PRE_CODEWORD_LIMIT <= LZX_MAX_PRE_CODEWORD_LEN); + make_canonical_huffman_code(LZX_PRECODE_NUM_SYMBOLS, PRE_CODEWORD_LIMIT, + precode_freqs, precode_lens, + precode_codewords); + + /* Output the lengths of the codewords in the precode. */ + for (i = 0; i < LZX_PRECODE_NUM_SYMBOLS; i++) + lzx_write_bits(os, precode_lens[i], LZX_PRECODE_ELEMENT_SIZE); + + /* Output the encoded lengths of the codewords in the larger code. */ + for (i = 0; i < num_precode_items; i++) { + precode_item = precode_items[i]; + precode_sym = precode_item & 0x1F; + lzx_add_bits(os, precode_codewords[precode_sym], + precode_lens[precode_sym]); + if (precode_sym >= 17) { + if (precode_sym == 17) { + lzx_add_bits(os, precode_item >> 5, 4); + } else if (precode_sym == 18) { + lzx_add_bits(os, precode_item >> 5, 5); + } else { + lzx_add_bits(os, (precode_item >> 5) & 1, 1); + precode_sym = precode_item >> 6; + lzx_add_bits(os, precode_codewords[precode_sym], + precode_lens[precode_sym]); + } + } + STATIC_ASSERT(CAN_BUFFER(2 * PRE_CODEWORD_LIMIT + 1)); + lzx_flush_bits(os, 2 * PRE_CODEWORD_LIMIT + 1); + } + + *(u8 *)(lens + num_lens) = saved; +} + +/* + * Write all matches and literal bytes (which were precomputed) in an LZX + * compressed block to the output bitstream in the final compressed + * representation. + * + * @os + * The output bitstream. + * @block_type + * The chosen type of the LZX compressed block (LZX_BLOCKTYPE_ALIGNED or + * LZX_BLOCKTYPE_VERBATIM). + * @block_data + * The uncompressed data of the block. + * @sequences + * The matches and literals to output, given as a series of sequences. + * @codes + * The main, length, and aligned offset Huffman codes for the block. + */ +static void +lzx_write_sequences(struct lzx_output_bitstream *os, int block_type, + const u8 *block_data, const struct lzx_sequence sequences[], + const struct lzx_codes *codes) +{ + const struct lzx_sequence *seq = sequences; + unsigned min_aligned_offset_slot; + + if (block_type == LZX_BLOCKTYPE_ALIGNED) + min_aligned_offset_slot = LZX_MIN_ALIGNED_OFFSET_SLOT; + else + min_aligned_offset_slot = LZX_MAX_OFFSET_SLOTS; + + for (;;) { + /* Output the next sequence. */ + + u32 litrunlen = seq->litrunlen_and_matchlen >> SEQ_MATCHLEN_BITS; + unsigned matchlen = seq->litrunlen_and_matchlen & SEQ_MATCHLEN_MASK; + STATIC_ASSERT((u32)~SEQ_MATCHLEN_MASK >> SEQ_MATCHLEN_BITS >= + SOFT_MAX_BLOCK_SIZE); + u32 adjusted_offset; + unsigned main_symbol; + unsigned offset_slot; + unsigned num_extra_bits; + u32 extra_bits; + + /* Output the literal run of the sequence. */ + + if (litrunlen) { /* Is the literal run nonempty? */ + + /* Verify optimization is enabled on 64-bit */ + STATIC_ASSERT(WORDBITS < 64 || + CAN_BUFFER(3 * MAIN_CODEWORD_LIMIT)); + + if (CAN_BUFFER(3 * MAIN_CODEWORD_LIMIT)) { + + /* 64-bit: write 3 literals at a time. */ + while (litrunlen >= 3) { + unsigned lit0 = block_data[0]; + unsigned lit1 = block_data[1]; + unsigned lit2 = block_data[2]; + lzx_add_bits(os, codes->codewords.main[lit0], + codes->lens.main[lit0]); + lzx_add_bits(os, codes->codewords.main[lit1], + codes->lens.main[lit1]); + lzx_add_bits(os, codes->codewords.main[lit2], + codes->lens.main[lit2]); + lzx_flush_bits(os, 3 * MAIN_CODEWORD_LIMIT); + block_data += 3; + litrunlen -= 3; + } + if (litrunlen--) { + unsigned lit = *block_data++; + lzx_add_bits(os, codes->codewords.main[lit], + codes->lens.main[lit]); + if (litrunlen--) { + unsigned lit = *block_data++; + lzx_add_bits(os, codes->codewords.main[lit], + codes->lens.main[lit]); + lzx_flush_bits(os, 2 * MAIN_CODEWORD_LIMIT); + } else { + lzx_flush_bits(os, 1 * MAIN_CODEWORD_LIMIT); + } + } + } else { + /* 32-bit: write 1 literal at a time. */ + do { + unsigned lit = *block_data++; + lzx_add_bits(os, codes->codewords.main[lit], + codes->lens.main[lit]); + lzx_flush_bits(os, MAIN_CODEWORD_LIMIT); + } while (--litrunlen); + } + } + + /* Was this the last literal run? */ + if (matchlen == 0) + return; + + /* Nope; output the match. */ + + block_data += matchlen; + + adjusted_offset = seq->adjusted_offset_and_mainsym >> SEQ_MAINSYM_BITS; + main_symbol = seq->adjusted_offset_and_mainsym & SEQ_MAINSYM_MASK; + + offset_slot = (main_symbol - LZX_NUM_CHARS) / LZX_NUM_LEN_HEADERS; + num_extra_bits = lzx_extra_offset_bits[offset_slot]; + extra_bits = adjusted_offset - (lzx_offset_slot_base[offset_slot] + + LZX_OFFSET_ADJUSTMENT); + + #define MAX_MATCH_BITS (MAIN_CODEWORD_LIMIT + \ + LENGTH_CODEWORD_LIMIT + \ + LZX_MAX_NUM_EXTRA_BITS - \ + LZX_NUM_ALIGNED_OFFSET_BITS + \ + ALIGNED_CODEWORD_LIMIT) + + /* Verify optimization is enabled on 64-bit */ + STATIC_ASSERT(WORDBITS < 64 || CAN_BUFFER(MAX_MATCH_BITS)); + + /* Output the main symbol for the match. */ + + lzx_add_bits(os, codes->codewords.main[main_symbol], + codes->lens.main[main_symbol]); + if (!CAN_BUFFER(MAX_MATCH_BITS)) + lzx_flush_bits(os, MAIN_CODEWORD_LIMIT); + + /* If needed, output the length symbol for the match. */ + + if (matchlen >= LZX_MIN_SECONDARY_LEN) { + lzx_add_bits(os, codes->codewords.len[matchlen - + LZX_MIN_SECONDARY_LEN], + codes->lens.len[matchlen - + LZX_MIN_SECONDARY_LEN]); + if (!CAN_BUFFER(MAX_MATCH_BITS)) + lzx_flush_bits(os, LENGTH_CODEWORD_LIMIT); + } + + /* Output the extra offset bits for the match. In aligned + * offset blocks, the lowest 3 bits of the adjusted offset are + * Huffman-encoded using the aligned offset code, provided that + * there are at least extra 3 offset bits required. All other + * extra offset bits are output verbatim. */ + + if (offset_slot >= min_aligned_offset_slot) { + + lzx_add_bits(os, extra_bits >> LZX_NUM_ALIGNED_OFFSET_BITS, + num_extra_bits - LZX_NUM_ALIGNED_OFFSET_BITS); + if (!CAN_BUFFER(MAX_MATCH_BITS)) + lzx_flush_bits(os, LZX_MAX_NUM_EXTRA_BITS - + LZX_NUM_ALIGNED_OFFSET_BITS); + + lzx_add_bits(os, codes->codewords.aligned[adjusted_offset & + LZX_ALIGNED_OFFSET_BITMASK], + codes->lens.aligned[adjusted_offset & + LZX_ALIGNED_OFFSET_BITMASK]); + if (!CAN_BUFFER(MAX_MATCH_BITS)) + lzx_flush_bits(os, ALIGNED_CODEWORD_LIMIT); + } else { + STATIC_ASSERT(CAN_BUFFER(LZX_MAX_NUM_EXTRA_BITS)); + + lzx_add_bits(os, extra_bits, num_extra_bits); + if (!CAN_BUFFER(MAX_MATCH_BITS)) + lzx_flush_bits(os, LZX_MAX_NUM_EXTRA_BITS); + } + + if (CAN_BUFFER(MAX_MATCH_BITS)) + lzx_flush_bits(os, MAX_MATCH_BITS); + + /* Advance to the next sequence. */ + seq++; + } +} + +static void +lzx_write_compressed_block(const u8 *block_begin, + int block_type, + u32 block_size, + unsigned window_order, + unsigned num_main_syms, + const struct lzx_sequence sequences[], + const struct lzx_codes * codes, + const struct lzx_lens * prev_lens, + struct lzx_output_bitstream * os) +{ + /* The first three bits indicate the type of block and are one of the + * LZX_BLOCKTYPE_* constants. */ + lzx_write_bits(os, block_type, 3); + + /* + * Output the block size. + * + * The original LZX format encoded the block size in 24 bits. However, + * the LZX format used in WIM archives uses 1 bit to specify whether the + * block has the default size of 32768 bytes, then optionally 16 bits to + * specify a non-default size. This works fine for Microsoft's WIM + * software (WIMGAPI), which never compresses more than 32768 bytes at a + * time with LZX. However, as an extension, our LZX compressor supports + * compressing up to 2097152 bytes, with a corresponding increase in + * window size. It is possible for blocks in these larger buffers to + * exceed 65535 bytes; such blocks cannot have their size represented in + * 16 bits. + * + * The chosen solution was to use 24 bits for the block size when + * possibly required --- specifically, when the compressor has been + * allocated to be capable of compressing more than 32768 bytes at once + * (which also causes the number of main symbols to be increased). + */ + if (block_size == LZX_DEFAULT_BLOCK_SIZE) { + lzx_write_bits(os, 1, 1); + } else { + lzx_write_bits(os, 0, 1); + + if (window_order >= 16) + lzx_write_bits(os, block_size >> 16, 8); + + lzx_write_bits(os, block_size & 0xFFFF, 16); + } + + /* If it's an aligned offset block, output the aligned offset code. */ + if (block_type == LZX_BLOCKTYPE_ALIGNED) { + for (int i = 0; i < LZX_ALIGNEDCODE_NUM_SYMBOLS; i++) { + lzx_write_bits(os, codes->lens.aligned[i], + LZX_ALIGNEDCODE_ELEMENT_SIZE); + } + } + + /* Output the main code (two parts). */ + lzx_write_compressed_code(os, codes->lens.main, + prev_lens->main, + LZX_NUM_CHARS); + lzx_write_compressed_code(os, codes->lens.main + LZX_NUM_CHARS, + prev_lens->main + LZX_NUM_CHARS, + num_main_syms - LZX_NUM_CHARS); + + /* Output the length code. */ + lzx_write_compressed_code(os, codes->lens.len, + prev_lens->len, + LZX_LENCODE_NUM_SYMBOLS); + + /* Output the compressed matches and literals. */ + lzx_write_sequences(os, block_type, block_begin, sequences, codes); +} + +/* + * Given the frequencies of symbols in an LZX-compressed block and the + * corresponding Huffman codes, return LZX_BLOCKTYPE_ALIGNED or + * LZX_BLOCKTYPE_VERBATIM if an aligned offset or verbatim block, respectively, + * will take fewer bits to output. + */ +static int +lzx_choose_verbatim_or_aligned(const struct lzx_freqs * freqs, + const struct lzx_codes * codes) +{ + u32 verbatim_cost = 0; + u32 aligned_cost = 0; + + /* A verbatim block requires 3 bits in each place that an aligned offset + * symbol would be used in an aligned offset block. */ + for (unsigned i = 0; i < LZX_ALIGNEDCODE_NUM_SYMBOLS; i++) { + verbatim_cost += LZX_NUM_ALIGNED_OFFSET_BITS * freqs->aligned[i]; + aligned_cost += codes->lens.aligned[i] * freqs->aligned[i]; + } + + /* Account for the cost of sending the codeword lengths of the aligned + * offset code. */ + aligned_cost += LZX_ALIGNEDCODE_ELEMENT_SIZE * + LZX_ALIGNEDCODE_NUM_SYMBOLS; + + if (aligned_cost < verbatim_cost) + return LZX_BLOCKTYPE_ALIGNED; + else + return LZX_BLOCKTYPE_VERBATIM; +} + +/* + * Flush an LZX block: + * + * 1. Build the Huffman codes. + * 2. Decide whether to output the block as VERBATIM or ALIGNED. + * 3. Write the block. + * 4. Swap the indices of the current and previous Huffman codes. + * + * Note: we never output UNCOMPRESSED blocks. This probably should be + * implemented sometime, but it doesn't make much difference. + */ +static void +lzx_flush_block(struct lzx_compressor *c, struct lzx_output_bitstream *os, + const u8 *block_begin, u32 block_size, u32 seq_idx) +{ + int block_type; + + lzx_build_huffman_codes(c); + + block_type = lzx_choose_verbatim_or_aligned(&c->freqs, + &c->codes[c->codes_index]); + lzx_write_compressed_block(block_begin, + block_type, + block_size, + c->window_order, + c->num_main_syms, + &c->chosen_sequences[seq_idx], + &c->codes[c->codes_index], + &c->codes[c->codes_index ^ 1].lens, + os); + c->codes_index ^= 1; +} + +/******************************************************************************/ +/* Block splitting algorithm */ +/*----------------------------------------------------------------------------*/ + +/* + * The problem of block splitting is to decide when it is worthwhile to start a + * new block with new entropy codes. There is a theoretically optimal solution: + * recursively consider every possible block split, considering the exact cost + * of each block, and choose the minimum cost approach. But this is far too + * slow. Instead, as an approximation, we can count symbols and after every N + * symbols, compare the expected distribution of symbols based on the previous + * data with the actual distribution. If they differ "by enough", then start a + * new block. + * + * As an optimization and heuristic, we don't distinguish between every symbol + * but rather we combine many symbols into a single "observation type". For + * literals we only look at the high bits and low bits, and for matches we only + * look at whether the match is long or not. The assumption is that for typical + * "real" data, places that are good block boundaries will tend to be noticeable + * based only on changes in these aggregate frequencies, without looking for + * subtle differences in individual symbols. For example, a change from ASCII + * bytes to non-ASCII bytes, or from few matches (generally less compressible) + * to many matches (generally more compressible), would be easily noticed based + * on the aggregates. + * + * For determining whether the frequency distributions are "different enough" to + * start a new block, the simply heuristic of splitting when the sum of absolute + * differences exceeds a constant seems to be good enough. + * + * Finally, for an approximation, it is not strictly necessary that the exact + * symbols being used are considered. With "near-optimal parsing", for example, + * the actual symbols that will be used are unknown until after the block + * boundary is chosen and the block has been optimized. Since the final choices + * cannot be used, we can use preliminary "greedy" choices instead. + */ + +/* Initialize the block split statistics when starting a new block. */ +static void +lzx_init_block_split_stats(struct lzx_block_split_stats *stats) +{ + memset(stats, 0, sizeof(*stats)); +} + +/* Literal observation. Heuristic: use the top 2 bits and low 1 bits of the + * literal, for 8 possible literal observation types. */ +static forceinline void +lzx_observe_literal(struct lzx_block_split_stats *stats, u8 lit) +{ + stats->new_observations[((lit >> 5) & 0x6) | (lit & 1)]++; + stats->num_new_observations++; +} + +/* Match observation. Heuristic: use one observation type for "short match" and + * one observation type for "long match". */ +static forceinline void +lzx_observe_match(struct lzx_block_split_stats *stats, unsigned length) +{ + stats->new_observations[NUM_LITERAL_OBSERVATION_TYPES + (length >= 5)]++; + stats->num_new_observations++; +} + +static bool +lzx_should_end_block(struct lzx_block_split_stats *stats) +{ + if (stats->num_observations > 0) { + + /* Note: to avoid slow divisions, we do not divide by + * 'num_observations', but rather do all math with the numbers + * multiplied by 'num_observations'. */ + u32 total_delta = 0; + for (int i = 0; i < NUM_OBSERVATION_TYPES; i++) { + u32 expected = stats->observations[i] * + stats->num_new_observations; + u32 actual = stats->new_observations[i] * + stats->num_observations; + u32 delta = (actual > expected) ? actual - expected : + expected - actual; + total_delta += delta; + } + + /* Ready to end the block? */ + if (total_delta >= + stats->num_new_observations * 7 / 8 * stats->num_observations) + return true; + } + + for (int i = 0; i < NUM_OBSERVATION_TYPES; i++) { + stats->num_observations += stats->new_observations[i]; + stats->observations[i] += stats->new_observations[i]; + stats->new_observations[i] = 0; + } + stats->num_new_observations = 0; + return false; +} + +/******************************************************************************/ +/* Slower ("near-optimal") compression algorithm */ +/*----------------------------------------------------------------------------*/ + +/* + * Least-recently-used queue for match offsets. + * + * This is represented as a 64-bit integer for efficiency. There are three + * offsets of 21 bits each. Bit 64 is garbage. + */ +struct lzx_lru_queue { + u64 R; +} __attribute__((aligned(8))); + +#define LZX_QUEUE_OFFSET_SHIFT 21 +#define LZX_QUEUE_OFFSET_MASK (((u64)1 << LZX_QUEUE_OFFSET_SHIFT) - 1) + +#define LZX_QUEUE_R0_SHIFT (0 * LZX_QUEUE_OFFSET_SHIFT) +#define LZX_QUEUE_R1_SHIFT (1 * LZX_QUEUE_OFFSET_SHIFT) +#define LZX_QUEUE_R2_SHIFT (2 * LZX_QUEUE_OFFSET_SHIFT) + +#define LZX_QUEUE_R0_MASK (LZX_QUEUE_OFFSET_MASK << LZX_QUEUE_R0_SHIFT) +#define LZX_QUEUE_R1_MASK (LZX_QUEUE_OFFSET_MASK << LZX_QUEUE_R1_SHIFT) +#define LZX_QUEUE_R2_MASK (LZX_QUEUE_OFFSET_MASK << LZX_QUEUE_R2_SHIFT) + +#define LZX_QUEUE_INITIALIZER { \ + ((u64)1 << LZX_QUEUE_R0_SHIFT) | \ + ((u64)1 << LZX_QUEUE_R1_SHIFT) | \ + ((u64)1 << LZX_QUEUE_R2_SHIFT) } + +static forceinline u64 +lzx_lru_queue_R0(struct lzx_lru_queue queue) +{ + return (queue.R >> LZX_QUEUE_R0_SHIFT) & LZX_QUEUE_OFFSET_MASK; +} + +static forceinline u64 +lzx_lru_queue_R1(struct lzx_lru_queue queue) +{ + return (queue.R >> LZX_QUEUE_R1_SHIFT) & LZX_QUEUE_OFFSET_MASK; +} + +static forceinline u64 +lzx_lru_queue_R2(struct lzx_lru_queue queue) +{ + return (queue.R >> LZX_QUEUE_R2_SHIFT) & LZX_QUEUE_OFFSET_MASK; +} + +/* Push a match offset onto the front (most recently used) end of the queue. */ +static forceinline struct lzx_lru_queue +lzx_lru_queue_push(struct lzx_lru_queue queue, u32 offset) +{ + return (struct lzx_lru_queue) { + .R = (queue.R << LZX_QUEUE_OFFSET_SHIFT) | offset, + }; +} + +/* Swap a match offset to the front of the queue. */ +static forceinline struct lzx_lru_queue +lzx_lru_queue_swap(struct lzx_lru_queue queue, unsigned idx) +{ + unsigned shift = idx * 21; + const u64 mask = LZX_QUEUE_R0_MASK; + const u64 mask_high = mask << shift; + + return (struct lzx_lru_queue) { + (queue.R & ~(mask | mask_high)) | + ((queue.R & mask_high) >> shift) | + ((queue.R & mask) << shift) + }; +} + +static forceinline u32 +lzx_walk_item_list(struct lzx_compressor *c, u32 block_size, bool is_16_bit, + bool record) +{ + struct lzx_sequence *seq = + &c->chosen_sequences[ARRAY_LEN(c->chosen_sequences) - 1]; + u32 node_idx = block_size; + u32 litrun_end; /* if record=true: end of the current literal run */ + + if (record) { + /* The last sequence has matchlen 0 */ + seq->litrunlen_and_matchlen = 0; + litrun_end = node_idx; + } + + for (;;) { + u32 item; + unsigned matchlen; + u32 adjusted_offset; + unsigned mainsym; + + /* Tally literals until either a match or the beginning of the + * block is reached. Note: the item in the node at the + * beginning of the block (c->optimum_nodes[0]) has all bits + * set, causing this loop to end when it is reached. */ + for (;;) { + item = c->optimum_nodes[node_idx].item; + if (item & OPTIMUM_LEN_MASK) + break; + c->freqs.main[item >> OPTIMUM_OFFSET_SHIFT]++; + node_idx--; + } + + #if CONSIDER_GAP_MATCHES + if (item & OPTIMUM_GAP_MATCH) { + if (node_idx == 0) + break; + /* Tally/record the rep0 match after the gap. */ + matchlen = item & OPTIMUM_LEN_MASK; + mainsym = lzx_tally_main_and_lensyms(c, matchlen, 0, + is_16_bit); + if (record) { + seq->litrunlen_and_matchlen |= + (litrun_end - node_idx) << + SEQ_MATCHLEN_BITS; + seq--; + seq->litrunlen_and_matchlen = matchlen; + seq->adjusted_offset_and_mainsym = mainsym; + litrun_end = node_idx - matchlen; + } + + /* Tally the literal in the gap. */ + c->freqs.main[(u8)(item >> OPTIMUM_OFFSET_SHIFT)]++; + + /* Fall through and tally the match before the gap. + * (It was temporarily saved in the 'cost' field of the + * previous node, which was free to reuse.) */ + item = c->optimum_nodes[--node_idx].cost; + node_idx -= matchlen; + } + #else /* CONSIDER_GAP_MATCHES */ + if (node_idx == 0) + break; + #endif /* !CONSIDER_GAP_MATCHES */ + + /* Tally/record a match. */ + matchlen = item & OPTIMUM_LEN_MASK; + adjusted_offset = item >> OPTIMUM_OFFSET_SHIFT; + mainsym = lzx_tally_main_and_lensyms(c, matchlen, + adjusted_offset, + is_16_bit); + if (adjusted_offset >= LZX_MIN_ALIGNED_OFFSET + + LZX_OFFSET_ADJUSTMENT) + c->freqs.aligned[adjusted_offset & + LZX_ALIGNED_OFFSET_BITMASK]++; + if (record) { + seq->litrunlen_and_matchlen |= + (litrun_end - node_idx) << SEQ_MATCHLEN_BITS; + seq--; + seq->litrunlen_and_matchlen = matchlen; + seq->adjusted_offset_and_mainsym = + (adjusted_offset << SEQ_MAINSYM_BITS) | mainsym; + litrun_end = node_idx - matchlen; + } + node_idx -= matchlen; + } + + /* Record the literal run length for the first sequence. */ + if (record) { + seq->litrunlen_and_matchlen |= + (litrun_end - node_idx) << SEQ_MATCHLEN_BITS; + } + + /* Return the index in chosen_sequences at which the sequences begin. */ + return seq - &c->chosen_sequences[0]; +} + +/* + * Given the minimum-cost path computed through the item graph for the current + * block, walk the path and count how many of each symbol in each Huffman-coded + * alphabet would be required to output the items (matches and literals) along + * the path. + * + * Note that the path will be walked backwards (from the end of the block to the + * beginning of the block), but this doesn't matter because this function only + * computes frequencies. + */ +static forceinline void +lzx_tally_item_list(struct lzx_compressor *c, u32 block_size, bool is_16_bit) +{ + lzx_walk_item_list(c, block_size, is_16_bit, false); +} + +/* + * Like lzx_tally_item_list(), but this function also generates the list of + * lzx_sequences for the minimum-cost path and writes it to c->chosen_sequences, + * ready to be output to the bitstream after the Huffman codes are computed. + * The lzx_sequences will be written to decreasing memory addresses as the path + * is walked backwards, which means they will end up in the expected + * first-to-last order. The return value is the index in c->chosen_sequences at + * which the lzx_sequences begin. + */ +static forceinline u32 +lzx_record_item_list(struct lzx_compressor *c, u32 block_size, bool is_16_bit) +{ + return lzx_walk_item_list(c, block_size, is_16_bit, true); +} + +/* + * Find an inexpensive path through the graph of possible match/literal choices + * for the current block. The nodes of the graph are + * c->optimum_nodes[0...block_size]. They correspond directly to the bytes in + * the current block, plus one extra node for end-of-block. The edges of the + * graph are matches and literals. The goal is to find the minimum cost path + * from 'c->optimum_nodes[0]' to 'c->optimum_nodes[block_size]', given the cost + * model 'c->costs'. + * + * The algorithm works forwards, starting at 'c->optimum_nodes[0]' and + * proceeding forwards one node at a time. At each node, a selection of matches + * (len >= 2), as well as the literal byte (len = 1), is considered. An item of + * length 'len' provides a new path to reach the node 'len' bytes later. If + * such a path is the lowest cost found so far to reach that later node, then + * that later node is updated with the new cost and the "arrival" which provided + * that cost. + * + * Note that although this algorithm is based on minimum cost path search, due + * to various simplifying assumptions the result is not guaranteed to be the + * true minimum cost, or "optimal", path over the graph of all valid LZX + * representations of this block. + * + * Also, note that because of the presence of the recent offsets queue (which is + * a type of adaptive state), the algorithm cannot work backwards and compute + * "cost to end" instead of "cost to beginning". Furthermore, the way the + * algorithm handles this adaptive state in the "minimum cost" parse is actually + * only an approximation. It's possible for the globally optimal, minimum cost + * path to contain a prefix, ending at a position, where that path prefix is + * *not* the minimum cost path to that position. This can happen if such a path + * prefix results in a different adaptive state which results in lower costs + * later. The algorithm does not solve this problem in general; it only looks + * one step ahead, with the exception of special consideration for "gap + * matches". + */ +static forceinline struct lzx_lru_queue +lzx_find_min_cost_path(struct lzx_compressor * const restrict c, + const u8 * const restrict block_begin, + const u32 block_size, + const struct lzx_lru_queue initial_queue, + bool is_16_bit) +{ + struct lzx_optimum_node *cur_node = c->optimum_nodes; + struct lzx_optimum_node * const end_node = cur_node + block_size; + struct lz_match *cache_ptr = c->match_cache; + const u8 *in_next = block_begin; + const u8 * const block_end = block_begin + block_size; + + /* + * Instead of storing the match offset LRU queues in the + * 'lzx_optimum_node' structures, we save memory (and cache lines) by + * storing them in a smaller array. This works because the algorithm + * only requires a limited history of the adaptive state. Once a given + * state is more than LZX_MAX_MATCH_LEN bytes behind the current node + * (more if gap match consideration is enabled; we just round up to 512 + * so it's a power of 2), it is no longer needed. + * + * The QUEUE() macro finds the queue for the given node. This macro has + * been optimized by taking advantage of 'struct lzx_lru_queue' and + * 'struct lzx_optimum_node' both being 8 bytes in size and alignment. + */ + struct lzx_lru_queue queues[512]; + STATIC_ASSERT(ARRAY_LEN(queues) >= LZX_MAX_MATCH_LEN + 1); + STATIC_ASSERT(sizeof(c->optimum_nodes[0]) == sizeof(queues[0])); +#define QUEUE(node) \ + (*(struct lzx_lru_queue *)((char *)queues + \ + ((uintptr_t)(node) % (ARRAY_LEN(queues) * sizeof(queues[0]))))) + /*(queues[(uintptr_t)(node) / sizeof(*(node)) % ARRAY_LEN(queues)])*/ + +#if CONSIDER_GAP_MATCHES + u32 matches_before_gap[ARRAY_LEN(queues)]; +#define MATCH_BEFORE_GAP(node) \ + (matches_before_gap[(uintptr_t)(node) / sizeof(*(node)) % \ + ARRAY_LEN(matches_before_gap)]) +#endif + + /* + * Initially, the cost to reach each node is "infinity". + * + * The first node actually should have cost 0, but "infinity" + * (0xFFFFFFFF) works just as well because it immediately overflows. + * + * The following statement also intentionally sets the 'item' of the + * first node, which would otherwise have no meaning, to 0xFFFFFFFF for + * use as a sentinel. See lzx_walk_item_list(). + */ + memset(c->optimum_nodes, 0xFF, + (block_size + 1) * sizeof(c->optimum_nodes[0])); + + /* Initialize the recent offsets queue for the first node. */ + QUEUE(cur_node) = initial_queue; + + do { /* For each node in the block in position order... */ + + unsigned num_matches; + unsigned literal; + u32 cost; + + /* + * A selection of matches for the block was already saved in + * memory so that we don't have to run the uncompressed data + * through the matchfinder on every optimization pass. However, + * we still search for repeat offset matches during each + * optimization pass because we cannot predict the state of the + * recent offsets queue. But as a heuristic, we don't bother + * searching for repeat offset matches if the general-purpose + * matchfinder failed to find any matches. + * + * Note that a match of length n at some offset implies there is + * also a match of length l for LZX_MIN_MATCH_LEN <= l <= n at + * that same offset. In other words, we don't necessarily need + * to use the full length of a match. The key heuristic that + * saves a significicant amount of time is that for each + * distinct length, we only consider the smallest offset for + * which that length is available. This heuristic also applies + * to repeat offsets, which we order specially: R0 < R1 < R2 < + * any explicit offset. Of course, this heuristic may be + * produce suboptimal results because offset slots in LZX are + * subject to entropy encoding, but in practice this is a useful + * heuristic. + */ + + num_matches = cache_ptr->length; + cache_ptr++; + + if (num_matches) { + struct lz_match *end_matches = cache_ptr + num_matches; + unsigned next_len = LZX_MIN_MATCH_LEN; + unsigned max_len = min(block_end - in_next, LZX_MAX_MATCH_LEN); + const u8 *matchptr; + + /* Consider rep0 matches. */ + matchptr = in_next - lzx_lru_queue_R0(QUEUE(cur_node)); + if (load_u16_unaligned(matchptr) != load_u16_unaligned(in_next)) + goto rep0_done; + STATIC_ASSERT(LZX_MIN_MATCH_LEN == 2); + do { + u32 cost = cur_node->cost + + c->costs.match_cost[0][ + next_len - LZX_MIN_MATCH_LEN]; + if (cost <= (cur_node + next_len)->cost) { + (cur_node + next_len)->cost = cost; + (cur_node + next_len)->item = + (0 << OPTIMUM_OFFSET_SHIFT) | next_len; + } + if (unlikely(++next_len > max_len)) { + cache_ptr = end_matches; + goto done_matches; + } + } while (in_next[next_len - 1] == matchptr[next_len - 1]); + + rep0_done: + + /* Consider rep1 matches. */ + matchptr = in_next - lzx_lru_queue_R1(QUEUE(cur_node)); + if (load_u16_unaligned(matchptr) != load_u16_unaligned(in_next)) + goto rep1_done; + if (matchptr[next_len - 1] != in_next[next_len - 1]) + goto rep1_done; + for (unsigned len = 2; len < next_len - 1; len++) + if (matchptr[len] != in_next[len]) + goto rep1_done; + do { + u32 cost = cur_node->cost + + c->costs.match_cost[1][ + next_len - LZX_MIN_MATCH_LEN]; + if (cost <= (cur_node + next_len)->cost) { + (cur_node + next_len)->cost = cost; + (cur_node + next_len)->item = + (1 << OPTIMUM_OFFSET_SHIFT) | next_len; + } + if (unlikely(++next_len > max_len)) { + cache_ptr = end_matches; + goto done_matches; + } + } while (in_next[next_len - 1] == matchptr[next_len - 1]); + + rep1_done: + + /* Consider rep2 matches. */ + matchptr = in_next - lzx_lru_queue_R2(QUEUE(cur_node)); + if (load_u16_unaligned(matchptr) != load_u16_unaligned(in_next)) + goto rep2_done; + if (matchptr[next_len - 1] != in_next[next_len - 1]) + goto rep2_done; + for (unsigned len = 2; len < next_len - 1; len++) + if (matchptr[len] != in_next[len]) + goto rep2_done; + do { + u32 cost = cur_node->cost + + c->costs.match_cost[2][ + next_len - LZX_MIN_MATCH_LEN]; + if (cost <= (cur_node + next_len)->cost) { + (cur_node + next_len)->cost = cost; + (cur_node + next_len)->item = + (2 << OPTIMUM_OFFSET_SHIFT) | next_len; + } + if (unlikely(++next_len > max_len)) { + cache_ptr = end_matches; + goto done_matches; + } + } while (in_next[next_len - 1] == matchptr[next_len - 1]); + + rep2_done: + + while (next_len > cache_ptr->length) + if (++cache_ptr == end_matches) + goto done_matches; + + /* Consider explicit offset matches. */ + for (;;) { + u32 offset = cache_ptr->offset; + u32 adjusted_offset = offset + LZX_OFFSET_ADJUSTMENT; + unsigned offset_slot = lzx_get_offset_slot(c, adjusted_offset, is_16_bit); + u32 base_cost = cur_node->cost; + u32 cost; + + #if CONSIDER_ALIGNED_COSTS + if (offset >= LZX_MIN_ALIGNED_OFFSET) + base_cost += c->costs.aligned[adjusted_offset & + LZX_ALIGNED_OFFSET_BITMASK]; + #endif + do { + cost = base_cost + + c->costs.match_cost[offset_slot][ + next_len - LZX_MIN_MATCH_LEN]; + if (cost < (cur_node + next_len)->cost) { + (cur_node + next_len)->cost = cost; + (cur_node + next_len)->item = + (adjusted_offset << OPTIMUM_OFFSET_SHIFT) | next_len; + } + } while (++next_len <= cache_ptr->length); + + if (++cache_ptr == end_matches) { + #if CONSIDER_GAP_MATCHES + /* Also consider the longest explicit + * offset match as a "gap match": match + * + lit + rep0. */ + s32 remaining = (block_end - in_next) - (s32)next_len; + if (likely(remaining >= 2)) { + const u8 *strptr = in_next + next_len; + const u8 *matchptr = strptr - offset; + if (load_u16_unaligned(strptr) == load_u16_unaligned(matchptr)) { + STATIC_ASSERT(ARRAY_LEN(queues) - LZX_MAX_MATCH_LEN - 2 >= 250); + STATIC_ASSERT(ARRAY_LEN(queues) == ARRAY_LEN(matches_before_gap)); + unsigned limit = min(remaining, + min(ARRAY_LEN(queues) - LZX_MAX_MATCH_LEN - 2, + LZX_MAX_MATCH_LEN)); + unsigned rep0_len = lz_extend(strptr, matchptr, 2, limit); + u8 lit = strptr[-1]; + cost += c->costs.main[lit] + + c->costs.match_cost[0][rep0_len - LZX_MIN_MATCH_LEN]; + unsigned total_len = next_len + rep0_len; + if (cost < (cur_node + total_len)->cost) { + (cur_node + total_len)->cost = cost; + (cur_node + total_len)->item = + OPTIMUM_GAP_MATCH | + ((u32)lit << OPTIMUM_OFFSET_SHIFT) | + rep0_len; + MATCH_BEFORE_GAP(cur_node + total_len) = + (adjusted_offset << OPTIMUM_OFFSET_SHIFT) | + (next_len - 1); + } + } + } + #endif /* CONSIDER_GAP_MATCHES */ + break; + } + } + } + + done_matches: + + /* Consider coding a literal. + + * To avoid an extra branch, actually checking the preferability + * of coding the literal is integrated into the queue update + * code below. */ + literal = *in_next++; + cost = cur_node->cost + c->costs.main[literal]; + + /* Advance to the next position. */ + cur_node++; + + /* The lowest-cost path to the current position is now known. + * Finalize the recent offsets queue that results from taking + * this lowest-cost path. */ + + if (cost <= cur_node->cost) { + /* Literal: queue remains unchanged. */ + cur_node->cost = cost; + cur_node->item = (u32)literal << OPTIMUM_OFFSET_SHIFT; + QUEUE(cur_node) = QUEUE(cur_node - 1); + } else { + /* Match: queue update is needed. */ + unsigned len = cur_node->item & OPTIMUM_LEN_MASK; + #if CONSIDER_GAP_MATCHES + s32 adjusted_offset = (s32)cur_node->item >> OPTIMUM_OFFSET_SHIFT; + STATIC_ASSERT(OPTIMUM_GAP_MATCH == 0x80000000); /* assuming sign extension */ + #else + u32 adjusted_offset = cur_node->item >> OPTIMUM_OFFSET_SHIFT; + #endif + + if (adjusted_offset >= LZX_NUM_RECENT_OFFSETS) { + /* Explicit offset match: insert offset at front. */ + QUEUE(cur_node) = + lzx_lru_queue_push(QUEUE(cur_node - len), + adjusted_offset - LZX_OFFSET_ADJUSTMENT); + } + #if CONSIDER_GAP_MATCHES + else if (adjusted_offset < 0) { + /* "Gap match": Explicit offset match, then a + * literal, then rep0 match. Save the explicit + * offset match information in the cost field of + * the previous node, which isn't needed + * anymore. Then insert the offset at the front + * of the queue. */ + u32 match_before_gap = MATCH_BEFORE_GAP(cur_node); + (cur_node - 1)->cost = match_before_gap; + QUEUE(cur_node) = + lzx_lru_queue_push(QUEUE(cur_node - len - 1 - + (match_before_gap & OPTIMUM_LEN_MASK)), + (match_before_gap >> OPTIMUM_OFFSET_SHIFT) - + LZX_OFFSET_ADJUSTMENT); + } + #endif + else { + /* Repeat offset match: swap offset to front. */ + QUEUE(cur_node) = + lzx_lru_queue_swap(QUEUE(cur_node - len), + adjusted_offset); + } + } + } while (cur_node != end_node); + + /* Return the recent offsets queue at the end of the path. */ + return QUEUE(cur_node); +} + +/* + * Given the costs for the main and length codewords (c->costs.main and + * c->costs.len), initialize the match cost array (c->costs.match_cost) which + * directly provides the cost of every possible (length, offset slot) pair. + */ +static void +lzx_compute_match_costs(struct lzx_compressor *c) +{ + unsigned num_offset_slots = (c->num_main_syms - LZX_NUM_CHARS) / + LZX_NUM_LEN_HEADERS; + struct lzx_costs *costs = &c->costs; + unsigned main_symbol = LZX_NUM_CHARS; + + for (unsigned offset_slot = 0; offset_slot < num_offset_slots; + offset_slot++) + { + u32 extra_cost = lzx_extra_offset_bits[offset_slot] * BIT_COST; + unsigned i; + + #if CONSIDER_ALIGNED_COSTS + if (offset_slot >= LZX_MIN_ALIGNED_OFFSET_SLOT) + extra_cost -= LZX_NUM_ALIGNED_OFFSET_BITS * BIT_COST; + #endif + + for (i = 0; i < LZX_NUM_PRIMARY_LENS; i++) { + costs->match_cost[offset_slot][i] = + costs->main[main_symbol++] + extra_cost; + } + + extra_cost += costs->main[main_symbol++]; + + for (; i < LZX_NUM_LENS; i++) { + costs->match_cost[offset_slot][i] = + costs->len[i - LZX_NUM_PRIMARY_LENS] + + extra_cost; + } + } +} + +/* + * Fast approximation for log2f(x). This is not as accurate as the standard C + * version. It does not need to be perfectly accurate because it is only used + * for estimating symbol costs, which is very approximate anyway. + */ +static float +log2f_fast(float x) +{ + union { + float f; + s32 i; + } u = { .f = x }; + + /* Extract the exponent and subtract 127 to remove the bias. This gives + * the integer part of the result. */ + float res = ((u.i >> 23) & 0xFF) - 127; + + /* Set the exponent to 0 (plus bias of 127). This transforms the number + * to the range [1, 2) while retaining the same mantissa. */ + u.i = (u.i & ~(0xFF << 23)) | (127 << 23); + + /* + * Approximate the log2 of the transformed number using a degree 2 + * interpolating polynomial for log2(x) over the interval [1, 2). Then + * add this to the extracted exponent to produce the final approximation + * of log2(x). + * + * The coefficients of the interpolating polynomial used here were found + * using the script tools/log2_interpolation.r. + */ + return res - 1.653124006f + u.f * (1.9941812f - u.f * 0.3347490189f); + +} + +/* + * Return the estimated cost of a symbol which has been estimated to have the + * given probability. + */ +static u32 +lzx_cost_for_probability(float prob) +{ + /* + * The basic formula is: + * + * entropy = -log2(probability) + * + * Use this to get the cost in fractional bits. Then multiply by our + * scaling factor of BIT_COST and convert to an integer. + * + * In addition, the minimum cost is BIT_COST (one bit) because the + * entropy coding method will be Huffman codes. + * + * Careful: even though 'prob' should be <= 1.0, 'log2f_fast(prob)' may + * be positive due to inaccuracy in our log2 approximation. Therefore, + * we cannot, in general, assume the computed cost is non-negative, and + * we should make sure negative costs get rounded up correctly. + */ + s32 cost = -log2f_fast(prob) * BIT_COST; + return max(cost, BIT_COST); +} + +/* + * Mapping: number of used literals => heuristic probability of a literal times + * 6870. Generated by running this R command: + * + * cat(paste(round(6870*2^-((304+(0:256))/64)), collapse=", ")) + */ +static const u8 literal_scaled_probs[257] = { + 255, 253, 250, 247, 244, 242, 239, 237, 234, 232, 229, 227, 224, 222, + 219, 217, 215, 212, 210, 208, 206, 203, 201, 199, 197, 195, 193, 191, + 189, 186, 184, 182, 181, 179, 177, 175, 173, 171, 169, 167, 166, 164, + 162, 160, 159, 157, 155, 153, 152, 150, 149, 147, 145, 144, 142, 141, + 139, 138, 136, 135, 133, 132, 130, 129, 128, 126, 125, 124, 122, 121, + 120, 118, 117, 116, 115, 113, 112, 111, 110, 109, 107, 106, 105, 104, + 103, 102, 101, 100, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, + 86, 85, 84, 83, 82, 81, 80, 79, 78, 78, 77, 76, 75, 74, 73, 73, 72, 71, + 70, 70, 69, 68, 67, 67, 66, 65, 65, 64, 63, 62, 62, 61, 60, 60, 59, 59, + 58, 57, 57, 56, 55, 55, 54, 54, 53, 53, 52, 51, 51, 50, 50, 49, 49, 48, + 48, 47, 47, 46, 46, 45, 45, 44, 44, 43, 43, 42, 42, 41, 41, 40, 40, 40, + 39, 39, 38, 38, 38, 37, 37, 36, 36, 36, 35, 35, 34, 34, 34, 33, 33, 33, + 32, 32, 32, 31, 31, 31, 30, 30, 30, 29, 29, 29, 28, 28, 28, 27, 27, 27, + 27, 26, 26, 26, 25, 25, 25, 25, 24, 24, 24, 24, 23, 23, 23, 23, 22, 22, + 22, 22, 21, 21, 21, 21, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 18, 18, + 18, 18, 18, 17, 17, 17, 17, 17, 16, 16, 16, 16 +}; + +/* + * Mapping: length symbol => default cost of that symbol. This is derived from + * sample data but has been slightly edited to add more bias towards the + * shortest lengths, which are the most common. + */ +static const u16 lzx_default_len_costs[LZX_LENCODE_NUM_SYMBOLS] = { + 300, 310, 320, 330, 360, 396, 399, 416, 451, 448, 463, 466, 505, 492, + 503, 514, 547, 531, 566, 561, 589, 563, 592, 586, 623, 602, 639, 627, + 659, 643, 657, 650, 685, 662, 661, 672, 685, 686, 696, 680, 657, 682, + 666, 699, 674, 699, 679, 709, 688, 712, 692, 714, 694, 716, 698, 712, + 706, 727, 714, 727, 713, 723, 712, 718, 719, 719, 720, 735, 725, 735, + 728, 740, 727, 739, 727, 742, 716, 733, 733, 740, 738, 746, 737, 747, + 738, 745, 736, 748, 742, 749, 745, 749, 743, 748, 741, 752, 745, 752, + 747, 750, 747, 752, 748, 753, 750, 752, 753, 753, 749, 744, 752, 755, + 753, 756, 745, 748, 746, 745, 723, 757, 755, 758, 755, 758, 752, 757, + 754, 757, 755, 759, 755, 758, 753, 755, 755, 758, 757, 761, 755, 750, + 758, 759, 759, 760, 758, 751, 757, 757, 759, 759, 758, 759, 758, 761, + 750, 761, 758, 760, 759, 761, 758, 761, 760, 752, 759, 760, 759, 759, + 757, 762, 760, 761, 761, 748, 761, 760, 762, 763, 752, 762, 762, 763, + 762, 762, 763, 763, 762, 763, 762, 763, 762, 763, 763, 764, 763, 762, + 763, 762, 762, 762, 764, 764, 763, 764, 763, 763, 763, 762, 763, 763, + 762, 764, 764, 763, 762, 763, 763, 763, 763, 762, 764, 763, 762, 764, + 764, 763, 763, 765, 764, 764, 762, 763, 764, 765, 763, 764, 763, 764, + 762, 764, 764, 754, 763, 764, 763, 763, 762, 763, 584, +}; + +/* Set default costs to bootstrap the iterative optimization algorithm. */ +static void +lzx_set_default_costs(struct lzx_compressor *c) +{ + unsigned i; + u32 num_literals = 0; + u32 num_used_literals = 0; + float inv_num_matches = 1.0f / c->freqs.main[LZX_NUM_CHARS]; + float inv_num_items; + float prob_match = 1.0f; + u32 match_cost; + float base_literal_prob; + + /* Some numbers here have been hardcoded to assume a bit cost of 64. */ + STATIC_ASSERT(BIT_COST == 64); + + /* Estimate the number of literals that will used. 'num_literals' is + * the total number, whereas 'num_used_literals' is the number of + * distinct symbols. */ + for (i = 0; i < LZX_NUM_CHARS; i++) { + num_literals += c->freqs.main[i]; + num_used_literals += (c->freqs.main[i] != 0); + } + + /* Note: all match headers were tallied as symbol 'LZX_NUM_CHARS'. We + * don't attempt to estimate which ones will be used. */ + + inv_num_items = 1.0f / (num_literals + c->freqs.main[LZX_NUM_CHARS]); + base_literal_prob = literal_scaled_probs[num_used_literals] * + (1.0f / 6870.0f); + + /* Literal costs. We use two different methods to compute the + * probability of each literal and mix together their results. */ + for (i = 0; i < LZX_NUM_CHARS; i++) { + u32 freq = c->freqs.main[i]; + if (freq != 0) { + float prob = 0.5f * ((freq * inv_num_items) + + base_literal_prob); + c->costs.main[i] = lzx_cost_for_probability(prob); + prob_match -= prob; + } else { + c->costs.main[i] = 11 * BIT_COST; + } + } + + /* Match header costs. We just assume that all match headers are + * equally probable, but we do take into account the relative cost of a + * match header vs. a literal depending on how common matches are + * expected to be vs. literals. */ + prob_match = max(prob_match, 0.15f); + match_cost = lzx_cost_for_probability(prob_match / (c->num_main_syms - + LZX_NUM_CHARS)); + for (; i < c->num_main_syms; i++) + c->costs.main[i] = match_cost; + + /* Length symbol costs. These are just set to fixed values which + * reflect the fact the smallest lengths are typically the most common, + * and therefore are typically the cheapest. */ + for (i = 0; i < LZX_LENCODE_NUM_SYMBOLS; i++) + c->costs.len[i] = lzx_default_len_costs[i]; + +#if CONSIDER_ALIGNED_COSTS + /* Aligned offset symbol costs. These are derived from the estimated + * probability of each aligned offset symbol. */ + for (i = 0; i < LZX_ALIGNEDCODE_NUM_SYMBOLS; i++) { + /* We intentionally tallied the frequencies in the wrong slots, + * not accounting for LZX_OFFSET_ADJUSTMENT, since doing the + * fixup here is faster: a constant 8 subtractions here vs. one + * addition for every match. */ + unsigned j = (i - LZX_OFFSET_ADJUSTMENT) & LZX_ALIGNED_OFFSET_BITMASK; + if (c->freqs.aligned[j] != 0) { + float prob = c->freqs.aligned[j] * inv_num_matches; + c->costs.aligned[i] = lzx_cost_for_probability(prob); + } else { + c->costs.aligned[i] = + (2 * LZX_NUM_ALIGNED_OFFSET_BITS) * BIT_COST; + } + } +#endif +} + +/* Update the current cost model to reflect the computed Huffman codes. */ +static void +lzx_set_costs_from_codes(struct lzx_compressor *c) +{ + unsigned i; + const struct lzx_lens *lens = &c->codes[c->codes_index].lens; + + for (i = 0; i < c->num_main_syms; i++) { + c->costs.main[i] = (lens->main[i] ? lens->main[i] : + MAIN_CODEWORD_LIMIT) * BIT_COST; + } + + for (i = 0; i < LZX_LENCODE_NUM_SYMBOLS; i++) { + c->costs.len[i] = (lens->len[i] ? lens->len[i] : + LENGTH_CODEWORD_LIMIT) * BIT_COST; + } + +#if CONSIDER_ALIGNED_COSTS + for (i = 0; i < LZX_ALIGNEDCODE_NUM_SYMBOLS; i++) { + c->costs.aligned[i] = (lens->aligned[i] ? lens->aligned[i] : + ALIGNED_CODEWORD_LIMIT) * BIT_COST; + } +#endif +} + +/* + * Choose a "near-optimal" literal/match sequence to use for the current block, + * then flush the block. Because the cost of each Huffman symbol is unknown + * until the Huffman codes have been built and the Huffman codes themselves + * depend on the symbol frequencies, this uses an iterative optimization + * algorithm to approximate an optimal solution. The first optimization pass + * for the block uses default costs; additional passes use costs derived from + * the Huffman codes computed in the previous pass. + */ +static forceinline struct lzx_lru_queue +lzx_optimize_and_flush_block(struct lzx_compressor * const restrict c, + struct lzx_output_bitstream * const restrict os, + const u8 * const restrict block_begin, + const u32 block_size, + const struct lzx_lru_queue initial_queue, + bool is_16_bit) +{ + unsigned num_passes_remaining = c->num_optim_passes; + struct lzx_lru_queue new_queue; + u32 seq_idx; + + lzx_set_default_costs(c); + + for (;;) { + lzx_compute_match_costs(c); + new_queue = lzx_find_min_cost_path(c, block_begin, block_size, + initial_queue, is_16_bit); + + if (--num_passes_remaining == 0) + break; + + /* At least one optimization pass remains. Update the costs. */ + lzx_reset_symbol_frequencies(c); + lzx_tally_item_list(c, block_size, is_16_bit); + lzx_build_huffman_codes(c); + lzx_set_costs_from_codes(c); + } + + /* Done optimizing. Generate the sequence list and flush the block. */ + lzx_reset_symbol_frequencies(c); + seq_idx = lzx_record_item_list(c, block_size, is_16_bit); + lzx_flush_block(c, os, block_begin, block_size, seq_idx); + return new_queue; +} + +/* + * This is the "near-optimal" LZX compressor. + * + * For each block, it performs a relatively thorough graph search to find an + * inexpensive (in terms of compressed size) way to output the block. + * + * Note: there are actually many things this algorithm leaves on the table in + * terms of compression ratio. So although it may be "near-optimal", it is + * certainly not "optimal". The goal is not to produce the optimal compression + * ratio, which for LZX is probably impossible within any practical amount of + * time, but rather to produce a compression ratio significantly better than a + * simpler "greedy" or "lazy" parse while still being relatively fast. + */ +static forceinline void +lzx_compress_near_optimal(struct lzx_compressor * restrict c, + const u8 * const restrict in_begin, size_t in_nbytes, + struct lzx_output_bitstream * restrict os, + bool is_16_bit) +{ + const u8 * in_next = in_begin; + const u8 * const in_end = in_begin + in_nbytes; + u32 max_len = LZX_MAX_MATCH_LEN; + u32 nice_len = min(c->nice_match_length, max_len); + u32 next_hashes[2] = {0, 0}; + struct lzx_lru_queue queue = LZX_QUEUE_INITIALIZER; + + /* Initialize the matchfinder. */ + CALL_BT_MF(is_16_bit, c, bt_matchfinder_init); + + do { + /* Starting a new block */ + + const u8 * const in_block_begin = in_next; + const u8 * const in_max_block_end = + in_next + min(SOFT_MAX_BLOCK_SIZE, in_end - in_next); + struct lz_match *cache_ptr = c->match_cache; + const u8 *next_search_pos = in_next; + const u8 *next_observation = in_next; + const u8 *next_pause_point = + min(in_next + min(MIN_BLOCK_SIZE, + in_max_block_end - in_next), + in_max_block_end - min(LZX_MAX_MATCH_LEN - 1, + in_max_block_end - in_next)); + + lzx_init_block_split_stats(&c->split_stats); + lzx_reset_symbol_frequencies(c); + + if (in_next >= next_pause_point) + goto pause; + + /* + * Run the input buffer through the matchfinder, caching the + * matches, until we decide to end the block. + * + * For a tighter matchfinding loop, we compute a "pause point", + * which is the next position at which we may need to check + * whether to end the block or to decrease max_len. We then + * only do these extra checks upon reaching the pause point. + */ + resume_matchfinding: + do { + if (in_next >= next_search_pos) { + /* Search for matches at this position. */ + struct lz_match *lz_matchptr; + u32 best_len; + + lz_matchptr = CALL_BT_MF(is_16_bit, c, + bt_matchfinder_get_matches, + in_begin, + in_next - in_begin, + max_len, + nice_len, + c->max_search_depth, + next_hashes, + &best_len, + cache_ptr + 1); + cache_ptr->length = lz_matchptr - (cache_ptr + 1); + cache_ptr = lz_matchptr; + + /* Accumulate literal/match statistics for block + * splitting and for generating the initial cost + * model. */ + if (in_next >= next_observation) { + best_len = cache_ptr[-1].length; + if (best_len >= 3) { + /* Match (len >= 3) */ + + /* + * Note: for performance reasons this has + * been simplified significantly: + * + * - We wait until later to account for + * LZX_OFFSET_ADJUSTMENT. + * - We don't account for repeat offsets. + * - We don't account for different match headers. + */ + c->freqs.aligned[cache_ptr[-1].offset & + LZX_ALIGNED_OFFSET_BITMASK]++; + c->freqs.main[LZX_NUM_CHARS]++; + + lzx_observe_match(&c->split_stats, best_len); + next_observation = in_next + best_len; + } else { + /* Literal */ + c->freqs.main[*in_next]++; + lzx_observe_literal(&c->split_stats, *in_next); + next_observation = in_next + 1; + } + } + + /* + * If there was a very long match found, then + * don't cache any matches for the bytes covered + * by that match. This avoids degenerate + * behavior when compressing highly redundant + * data, where the number of matches can be very + * large. + * + * This heuristic doesn't actually hurt the + * compression ratio *too* much. If there's a + * long match, then the data must be highly + * compressible, so it doesn't matter as much + * what we do. + */ + if (best_len >= nice_len) + next_search_pos = in_next + best_len; + } else { + /* Don't search for matches at this position. */ + CALL_BT_MF(is_16_bit, c, + bt_matchfinder_skip_byte, + in_begin, + in_next - in_begin, + nice_len, + c->max_search_depth, + next_hashes); + cache_ptr->length = 0; + cache_ptr++; + } + } while (++in_next < next_pause_point && + likely(cache_ptr < &c->match_cache[CACHE_LENGTH])); + + pause: + + /* Adjust max_len and nice_len if we're nearing the end of the + * input buffer. In addition, if we are so close to the end of + * the input buffer that there cannot be any more matches, then + * just advance through the last few positions and record no + * matches. */ + if (unlikely(max_len > in_end - in_next)) { + max_len = in_end - in_next; + nice_len = min(max_len, nice_len); + if (max_len < BT_MATCHFINDER_REQUIRED_NBYTES) { + while (in_next != in_end) { + cache_ptr->length = 0; + cache_ptr++; + in_next++; + } + } + } + + /* End the block if the match cache may overflow. */ + if (unlikely(cache_ptr >= &c->match_cache[CACHE_LENGTH])) + goto end_block; + + /* End the block if the soft maximum size has been reached. */ + if (in_next >= in_max_block_end) + goto end_block; + + /* End the block if the block splitting algorithm thinks this is + * a good place to do so. */ + if (c->split_stats.num_new_observations >= + NUM_OBSERVATIONS_PER_BLOCK_CHECK && + in_max_block_end - in_next >= MIN_BLOCK_SIZE && + lzx_should_end_block(&c->split_stats)) + goto end_block; + + /* It's not time to end the block yet. Compute the next pause + * point and resume matchfinding. */ + next_pause_point = + min(in_next + min(NUM_OBSERVATIONS_PER_BLOCK_CHECK * 2 - + c->split_stats.num_new_observations, + in_max_block_end - in_next), + in_max_block_end - min(LZX_MAX_MATCH_LEN - 1, + in_max_block_end - in_next)); + goto resume_matchfinding; + + end_block: + /* We've decided on a block boundary and cached matches. Now + * choose a match/literal sequence and flush the block. */ + queue = lzx_optimize_and_flush_block(c, os, in_block_begin, + in_next - in_block_begin, + queue, is_16_bit); + } while (in_next != in_end); +} + +static void +lzx_compress_near_optimal_16(struct lzx_compressor *c, const u8 *in, + size_t in_nbytes, struct lzx_output_bitstream *os) +{ + lzx_compress_near_optimal(c, in, in_nbytes, os, true); +} + +static void +lzx_compress_near_optimal_32(struct lzx_compressor *c, const u8 *in, + size_t in_nbytes, struct lzx_output_bitstream *os) +{ + lzx_compress_near_optimal(c, in, in_nbytes, os, false); +} + +/******************************************************************************/ +/* Faster ("lazy") compression algorithm */ +/*----------------------------------------------------------------------------*/ + +/* + * Called when the compressor chooses to use a literal. This tallies the + * Huffman symbol for the literal, increments the current literal run length, + * and "observes" the literal for the block split statistics. + */ +static forceinline void +lzx_choose_literal(struct lzx_compressor *c, unsigned literal, u32 *litrunlen_p) +{ + lzx_observe_literal(&c->split_stats, literal); + c->freqs.main[literal]++; + ++*litrunlen_p; +} + +/* + * Called when the compressor chooses to use a match. This tallies the Huffman + * symbol(s) for a match, saves the match data and the length of the preceding + * literal run, updates the recent offsets queue, and "observes" the match for + * the block split statistics. + */ +static forceinline void +lzx_choose_match(struct lzx_compressor *c, unsigned length, u32 adjusted_offset, + u32 recent_offsets[LZX_NUM_RECENT_OFFSETS], bool is_16_bit, + u32 *litrunlen_p, struct lzx_sequence **next_seq_p) +{ + struct lzx_sequence *next_seq = *next_seq_p; + unsigned mainsym; + + lzx_observe_match(&c->split_stats, length); + + mainsym = lzx_tally_main_and_lensyms(c, length, adjusted_offset, + is_16_bit); + next_seq->litrunlen_and_matchlen = + (*litrunlen_p << SEQ_MATCHLEN_BITS) | length; + next_seq->adjusted_offset_and_mainsym = + (adjusted_offset << SEQ_MAINSYM_BITS) | mainsym; + + /* Update the recent offsets queue. */ + if (adjusted_offset < LZX_NUM_RECENT_OFFSETS) { + /* Repeat offset match. */ + swap(recent_offsets[0], recent_offsets[adjusted_offset]); + } else { + /* Explicit offset match. */ + + /* Tally the aligned offset symbol if needed. */ + if (adjusted_offset >= LZX_MIN_ALIGNED_OFFSET + LZX_OFFSET_ADJUSTMENT) + c->freqs.aligned[adjusted_offset & LZX_ALIGNED_OFFSET_BITMASK]++; + + recent_offsets[2] = recent_offsets[1]; + recent_offsets[1] = recent_offsets[0]; + recent_offsets[0] = adjusted_offset - LZX_OFFSET_ADJUSTMENT; + } + + /* Reset the literal run length and advance to the next sequence. */ + *next_seq_p = next_seq + 1; + *litrunlen_p = 0; +} + +/* + * Called when the compressor ends a block. This finshes the last lzx_sequence, + * which is just a literal run with no following match. This literal run might + * be empty. + */ +static forceinline void +lzx_finish_sequence(struct lzx_sequence *last_seq, u32 litrunlen) +{ + last_seq->litrunlen_and_matchlen = litrunlen << SEQ_MATCHLEN_BITS; +} + +/* + * Find the longest repeat offset match with the current position. If a match + * is found, return its length and set *best_rep_idx_ret to the index of its + * offset in @recent_offsets. Otherwise, return 0. + * + * Don't bother with length 2 matches; consider matches of length >= 3 only. + * Also assume that max_len >= 3. + */ +static unsigned +lzx_find_longest_repeat_offset_match(const u8 * const in_next, + const u32 recent_offsets[], + const unsigned max_len, + unsigned *best_rep_idx_ret) +{ + STATIC_ASSERT(LZX_NUM_RECENT_OFFSETS == 3); /* loop is unrolled */ + + const u32 seq3 = load_u24_unaligned(in_next); + const u8 *matchptr; + unsigned best_rep_len = 0; + unsigned best_rep_idx = 0; + unsigned rep_len; + + /* Check for rep0 match (most recent offset) */ + matchptr = in_next - recent_offsets[0]; + if (load_u24_unaligned(matchptr) == seq3) + best_rep_len = lz_extend(in_next, matchptr, 3, max_len); + + /* Check for rep1 match (second most recent offset) */ + matchptr = in_next - recent_offsets[1]; + if (load_u24_unaligned(matchptr) == seq3) { + rep_len = lz_extend(in_next, matchptr, 3, max_len); + if (rep_len > best_rep_len) { + best_rep_len = rep_len; + best_rep_idx = 1; + } + } + + /* Check for rep2 match (third most recent offset) */ + matchptr = in_next - recent_offsets[2]; + if (load_u24_unaligned(matchptr) == seq3) { + rep_len = lz_extend(in_next, matchptr, 3, max_len); + if (rep_len > best_rep_len) { + best_rep_len = rep_len; + best_rep_idx = 2; + } + } + + *best_rep_idx_ret = best_rep_idx; + return best_rep_len; +} + +/* + * Fast heuristic scoring for lazy parsing: how "good" is this match? + * This is mainly determined by the length: longer matches are better. + * However, we also give a bonus to close (small offset) matches and to repeat + * offset matches, since those require fewer bits to encode. + */ + +static forceinline unsigned +lzx_explicit_offset_match_score(unsigned len, u32 adjusted_offset) +{ + unsigned score = len; + + if (adjusted_offset < 4096) + score++; + if (adjusted_offset < 256) + score++; + + return score; +} + +static forceinline unsigned +lzx_repeat_offset_match_score(unsigned rep_len, unsigned rep_idx) +{ + return rep_len + 3; +} + +/* + * This is the "lazy" LZX compressor. The basic idea is that before it chooses + * a match, it checks to see if there's a longer match at the next position. If + * yes, it chooses a literal and continues to the next position. If no, it + * chooses the match. + * + * Some additional heuristics are used as well. Repeat offset matches are + * considered favorably and sometimes are chosen immediately. In addition, long + * matches (at least "nice_len" bytes) are chosen immediately as well. Finally, + * when we decide whether a match is "better" than another, we take the offset + * into consideration as well as the length. + */ +static forceinline void +lzx_compress_lazy(struct lzx_compressor * restrict c, + const u8 * const restrict in_begin, size_t in_nbytes, + struct lzx_output_bitstream * restrict os, bool is_16_bit) +{ + const u8 * in_next = in_begin; + const u8 * const in_end = in_begin + in_nbytes; + unsigned max_len = LZX_MAX_MATCH_LEN; + unsigned nice_len = min(c->nice_match_length, max_len); + STATIC_ASSERT(LZX_NUM_RECENT_OFFSETS == 3); + u32 recent_offsets[LZX_NUM_RECENT_OFFSETS] = {1, 1, 1}; + u32 next_hashes[2] = {0, 0}; + + /* Initialize the matchfinder. */ + CALL_HC_MF(is_16_bit, c, hc_matchfinder_init); + + do { + /* Starting a new block */ + + const u8 * const in_block_begin = in_next; + const u8 * const in_max_block_end = + in_next + min(SOFT_MAX_BLOCK_SIZE, in_end - in_next); + struct lzx_sequence *next_seq = c->chosen_sequences; + u32 litrunlen = 0; + unsigned cur_len; + u32 cur_offset; + u32 cur_adjusted_offset; + unsigned cur_score; + unsigned next_len; + u32 next_offset; + u32 next_adjusted_offset; + unsigned next_score; + unsigned best_rep_len; + unsigned best_rep_idx; + unsigned rep_score; + unsigned skip_len; + + lzx_reset_symbol_frequencies(c); + lzx_init_block_split_stats(&c->split_stats); + + do { + /* Adjust max_len and nice_len if we're nearing the end + * of the input buffer. */ + if (unlikely(max_len > in_end - in_next)) { + max_len = in_end - in_next; + nice_len = min(max_len, nice_len); + } + + /* Find the longest match (subject to the + * max_search_depth cutoff parameter) with the current + * position. Don't bother with length 2 matches; only + * look for matches of length >= 3. */ + cur_len = CALL_HC_MF(is_16_bit, c, + hc_matchfinder_longest_match, + in_begin, + in_next, + 2, + max_len, + nice_len, + c->max_search_depth, + next_hashes, + &cur_offset); + + /* If there was no match found, or the only match found + * was a distant short match, then choose a literal. */ + if (cur_len < 3 || + (cur_len == 3 && + cur_offset >= 8192 - LZX_OFFSET_ADJUSTMENT && + cur_offset != recent_offsets[0] && + cur_offset != recent_offsets[1] && + cur_offset != recent_offsets[2])) + { + lzx_choose_literal(c, *in_next, &litrunlen); + in_next++; + continue; + } + + /* Heuristic: if this match has the most recent offset, + * then go ahead and choose it as a rep0 match. */ + if (cur_offset == recent_offsets[0]) { + in_next++; + skip_len = cur_len - 1; + cur_adjusted_offset = 0; + goto choose_cur_match; + } + + /* Compute the longest match's score as an explicit + * offset match. */ + cur_adjusted_offset = cur_offset + LZX_OFFSET_ADJUSTMENT; + cur_score = lzx_explicit_offset_match_score(cur_len, cur_adjusted_offset); + + /* Find the longest repeat offset match at this + * position. If we find one and it's "better" than the + * explicit offset match we found, then go ahead and + * choose the repeat offset match immediately. */ + best_rep_len = lzx_find_longest_repeat_offset_match(in_next, + recent_offsets, + max_len, + &best_rep_idx); + in_next++; + + if (best_rep_len != 0 && + (rep_score = lzx_repeat_offset_match_score(best_rep_len, + best_rep_idx)) >= cur_score) + { + cur_len = best_rep_len; + cur_adjusted_offset = best_rep_idx; + skip_len = best_rep_len - 1; + goto choose_cur_match; + } + + have_cur_match: + /* + * We have a match at the current position. If the + * match is very long, then choose it immediately. + * Otherwise, see if there's a better match at the next + * position. + */ + + if (cur_len >= nice_len) { + skip_len = cur_len - 1; + goto choose_cur_match; + } + + if (unlikely(max_len > in_end - in_next)) { + max_len = in_end - in_next; + nice_len = min(max_len, nice_len); + } + + next_len = CALL_HC_MF(is_16_bit, c, + hc_matchfinder_longest_match, + in_begin, + in_next, + cur_len - 2, + max_len, + nice_len, + c->max_search_depth / 2, + next_hashes, + &next_offset); + + if (next_len <= cur_len - 2) { + /* No potentially better match was found. */ + in_next++; + skip_len = cur_len - 2; + goto choose_cur_match; + } + + next_adjusted_offset = next_offset + LZX_OFFSET_ADJUSTMENT; + next_score = lzx_explicit_offset_match_score(next_len, next_adjusted_offset); + + best_rep_len = lzx_find_longest_repeat_offset_match(in_next, + recent_offsets, + max_len, + &best_rep_idx); + in_next++; + + if (best_rep_len != 0 && + (rep_score = lzx_repeat_offset_match_score(best_rep_len, + best_rep_idx)) >= next_score) + { + + if (rep_score > cur_score) { + /* The next match is better, and it's a + * repeat offset match. */ + lzx_choose_literal(c, *(in_next - 2), + &litrunlen); + cur_len = best_rep_len; + cur_adjusted_offset = best_rep_idx; + skip_len = cur_len - 1; + goto choose_cur_match; + } + } else { + if (next_score > cur_score) { + /* The next match is better, and it's an + * explicit offset match. */ + lzx_choose_literal(c, *(in_next - 2), + &litrunlen); + cur_len = next_len; + cur_adjusted_offset = next_adjusted_offset; + cur_score = next_score; + goto have_cur_match; + } + } + + /* The original match was better; choose it. */ + skip_len = cur_len - 2; + + choose_cur_match: + /* Choose a match and have the matchfinder skip over its + * remaining bytes. */ + lzx_choose_match(c, cur_len, cur_adjusted_offset, + recent_offsets, is_16_bit, + &litrunlen, &next_seq); + CALL_HC_MF(is_16_bit, c, + hc_matchfinder_skip_bytes, + in_begin, + in_next, + in_end, + skip_len, + next_hashes); + in_next += skip_len; + + /* Keep going until it's time to end the block. */ + } while (in_next < in_max_block_end && + !(c->split_stats.num_new_observations >= + NUM_OBSERVATIONS_PER_BLOCK_CHECK && + in_next - in_block_begin >= MIN_BLOCK_SIZE && + in_end - in_next >= MIN_BLOCK_SIZE && + lzx_should_end_block(&c->split_stats))); + + /* Flush the block. */ + lzx_finish_sequence(next_seq, litrunlen); + lzx_flush_block(c, os, in_block_begin, in_next - in_block_begin, 0); + + /* Keep going until we've reached the end of the input buffer. */ + } while (in_next != in_end); +} + +static void +lzx_compress_lazy_16(struct lzx_compressor *c, const u8 *in, size_t in_nbytes, + struct lzx_output_bitstream *os) +{ + lzx_compress_lazy(c, in, in_nbytes, os, true); +} + +static void +lzx_compress_lazy_32(struct lzx_compressor *c, const u8 *in, size_t in_nbytes, + struct lzx_output_bitstream *os) +{ + lzx_compress_lazy(c, in, in_nbytes, os, false); +} + +/******************************************************************************/ +/* Compressor operations */ +/*----------------------------------------------------------------------------*/ + +/* + * Generate tables for mapping match offsets (actually, "adjusted" match + * offsets) to offset slots. + */ +static void +lzx_init_offset_slot_tabs(struct lzx_compressor *c) +{ + u32 adjusted_offset = 0; + unsigned slot = 0; + + /* slots [0, 29] */ + for (; adjusted_offset < ARRAY_LEN(c->offset_slot_tab_1); + adjusted_offset++) + { + if (adjusted_offset >= lzx_offset_slot_base[slot + 1] + + LZX_OFFSET_ADJUSTMENT) + slot++; + c->offset_slot_tab_1[adjusted_offset] = slot; + } + + /* slots [30, 49] */ + for (; adjusted_offset < LZX_MAX_WINDOW_SIZE; + adjusted_offset += (u32)1 << 14) + { + if (adjusted_offset >= lzx_offset_slot_base[slot + 1] + + LZX_OFFSET_ADJUSTMENT) + slot++; + c->offset_slot_tab_2[adjusted_offset >> 14] = slot; + } +} + +static size_t +lzx_get_compressor_size(size_t max_bufsize, unsigned compression_level) +{ + if (compression_level <= MAX_FAST_LEVEL) { + if (lzx_is_16_bit(max_bufsize)) + return offsetof(struct lzx_compressor, hc_mf_16) + + hc_matchfinder_size_16(max_bufsize); + else + return offsetof(struct lzx_compressor, hc_mf_32) + + hc_matchfinder_size_32(max_bufsize); + } else { + if (lzx_is_16_bit(max_bufsize)) + return offsetof(struct lzx_compressor, bt_mf_16) + + bt_matchfinder_size_16(max_bufsize); + else + return offsetof(struct lzx_compressor, bt_mf_32) + + bt_matchfinder_size_32(max_bufsize); + } +} + +/* Compute the amount of memory needed to allocate an LZX compressor. */ +static u64 +lzx_get_needed_memory(size_t max_bufsize, unsigned compression_level, + bool destructive) +{ + u64 size = 0; + + if (max_bufsize > LZX_MAX_WINDOW_SIZE) + return 0; + + size += lzx_get_compressor_size(max_bufsize, compression_level); + if (!destructive) + size += max_bufsize; /* account for in_buffer */ + return size; +} + +/* Allocate an LZX compressor. */ +static int +lzx_create_compressor(size_t max_bufsize, unsigned compression_level, + bool destructive, void **c_ret) +{ + unsigned window_order; + struct lzx_compressor *c; + + /* Validate the maximum buffer size and get the window order from it. */ + window_order = lzx_get_window_order(max_bufsize); + if (window_order == 0) + return WIMLIB_ERR_INVALID_PARAM; + + /* Allocate the compressor. */ + c = MALLOC(lzx_get_compressor_size(max_bufsize, compression_level)); + if (!c) + goto oom0; + + c->window_order = window_order; + c->num_main_syms = lzx_get_num_main_syms(window_order); + c->destructive = destructive; + + /* Allocate the buffer for preprocessed data if needed. */ + if (!c->destructive) { + c->in_buffer = MALLOC(max_bufsize); + if (!c->in_buffer) + goto oom1; + } + + if (compression_level <= MAX_FAST_LEVEL) { + + /* Fast compression: Use lazy parsing. */ + if (lzx_is_16_bit(max_bufsize)) + c->impl = lzx_compress_lazy_16; + else + c->impl = lzx_compress_lazy_32; + + /* Scale max_search_depth and nice_match_length with the + * compression level. */ + c->max_search_depth = (60 * compression_level) / 20; + c->nice_match_length = (80 * compression_level) / 20; + + /* lzx_compress_lazy() needs max_search_depth >= 2 because it + * halves the max_search_depth when attempting a lazy match, and + * max_search_depth must be at least 1. */ + c->max_search_depth = max(c->max_search_depth, 2); + } else { + + /* Normal / high compression: Use near-optimal parsing. */ + if (lzx_is_16_bit(max_bufsize)) + c->impl = lzx_compress_near_optimal_16; + else + c->impl = lzx_compress_near_optimal_32; + + /* Scale max_search_depth and nice_match_length with the + * compression level. */ + c->max_search_depth = (24 * compression_level) / 50; + c->nice_match_length = (48 * compression_level) / 50; + + /* Also scale num_optim_passes with the compression level. But + * the more passes there are, the less they help --- so don't + * add them linearly. */ + c->num_optim_passes = 1; + c->num_optim_passes += (compression_level >= 45); + c->num_optim_passes += (compression_level >= 70); + c->num_optim_passes += (compression_level >= 100); + c->num_optim_passes += (compression_level >= 150); + c->num_optim_passes += (compression_level >= 200); + c->num_optim_passes += (compression_level >= 300); + + /* max_search_depth must be at least 1. */ + c->max_search_depth = max(c->max_search_depth, 1); + } + + /* Prepare the offset => offset slot mapping. */ + lzx_init_offset_slot_tabs(c); + + *c_ret = c; + return 0; + +oom1: + FREE(c); +oom0: + return WIMLIB_ERR_NOMEM; +} + +/* Compress a buffer of data. */ +static size_t +lzx_compress(const void *restrict in, size_t in_nbytes, + void *restrict out, size_t out_nbytes_avail, void *restrict _c) +{ + struct lzx_compressor *c = _c; + struct lzx_output_bitstream os; + size_t result; + + /* Don't bother trying to compress very small inputs. */ + if (in_nbytes < 64) + return 0; + + /* If the compressor is in "destructive" mode, then we can directly + * preprocess the input data. Otherwise, we need to copy it into an + * internal buffer first. */ + if (!c->destructive) { + memcpy(c->in_buffer, in, in_nbytes); + in = c->in_buffer; + } + + /* Preprocess the input data. */ + lzx_preprocess((void *)in, in_nbytes); + + /* Initially, the previous Huffman codeword lengths are all zeroes. */ + c->codes_index = 0; + memset(&c->codes[1].lens, 0, sizeof(struct lzx_lens)); + + /* Initialize the output bitstream. */ + lzx_init_output(&os, out, out_nbytes_avail); + + /* Call the compression level-specific compress() function. */ + (*c->impl)(c, in, in_nbytes, &os); + + /* Flush the output bitstream. */ + result = lzx_flush_output(&os); + + /* If the data did not compress to less than its original size and we + * preprocessed the original buffer, then postprocess it to restore it + * to its original state. */ + if (result == 0 && c->destructive) + lzx_postprocess((void *)in, in_nbytes); + + /* Return the number of compressed bytes, or 0 if the input did not + * compress to less than its original size. */ + return result; +} + +/* Free an LZX compressor. */ +static void +lzx_free_compressor(void *_c) +{ + struct lzx_compressor *c = _c; + + if (!c->destructive) + FREE(c->in_buffer); + FREE(c); +} + +const struct compressor_ops lzx_compressor_ops = { + .get_needed_memory = lzx_get_needed_memory, + .create_compressor = lzx_create_compressor, + .compress = lzx_compress, + .free_compressor = lzx_free_compressor, +}; diff --git a/src/wimlib/lzx_decompress.c b/src/wimlib/lzx_decompress.c new file mode 100644 index 00000000..ba923fdd --- /dev/null +++ b/src/wimlib/lzx_decompress.c @@ -0,0 +1,563 @@ +/* + * lzx_decompress.c + * + * A decompressor for the LZX compression format, as used in WIM files. + */ + +/* + * Copyright (C) 2012-2016 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +/* + * LZX is an LZ77 and Huffman-code based compression format that has many + * similarities to DEFLATE (the format used by zlib/gzip). The compression + * ratio is as good or better than DEFLATE. See lzx_compress.c for a format + * overview, and see https://en.wikipedia.org/wiki/LZX_(algorithm) for a + * historical overview. Here I make some pragmatic notes. + * + * The old specification for LZX is the document "Microsoft LZX Data Compression + * Format" (1997). It defines the LZX format as used in cabinet files. Allowed + * window sizes are 2^n where 15 <= n <= 21. However, this document contains + * several errors, so don't read too much into it... + * + * The new specification for LZX is the document "[MS-PATCH]: LZX DELTA + * Compression and Decompression" (2014). It defines the LZX format as used by + * Microsoft's binary patcher. It corrects several errors in the 1997 document + * and extends the format in several ways --- namely, optional reference data, + * up to 2^25 byte windows, and longer match lengths. + * + * WIM files use a more restricted form of LZX. No LZX DELTA extensions are + * present, the window is not "sliding", E8 preprocessing is done + * unconditionally with a fixed file size, and the maximum window size is always + * 2^15 bytes (equal to the size of each "chunk" in a compressed WIM resource). + * This code is primarily intended to implement this form of LZX. But although + * not compatible with WIMGAPI, this code also supports maximum window sizes up + * to 2^21 bytes. + * + * TODO: Add support for window sizes up to 2^25 bytes. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <string.h> + +#include "wimlib/decompressor_ops.h" +#include "wimlib/decompress_common.h" +#include "wimlib/error.h" +#include "wimlib/lzx_common.h" +#include "wimlib/util.h" + +/* These values are chosen for fast decompression. */ +#define LZX_MAINCODE_TABLEBITS 11 +#define LZX_LENCODE_TABLEBITS 9 +#define LZX_PRECODE_TABLEBITS 6 +#define LZX_ALIGNEDCODE_TABLEBITS 7 + +#define LZX_READ_LENS_MAX_OVERRUN 50 + +struct lzx_decompressor { + + DECODE_TABLE(maincode_decode_table, LZX_MAINCODE_MAX_NUM_SYMBOLS, + LZX_MAINCODE_TABLEBITS, LZX_MAX_MAIN_CODEWORD_LEN); + u8 maincode_lens[LZX_MAINCODE_MAX_NUM_SYMBOLS + LZX_READ_LENS_MAX_OVERRUN]; + + DECODE_TABLE(lencode_decode_table, LZX_LENCODE_NUM_SYMBOLS, + LZX_LENCODE_TABLEBITS, LZX_MAX_LEN_CODEWORD_LEN); + u8 lencode_lens[LZX_LENCODE_NUM_SYMBOLS + LZX_READ_LENS_MAX_OVERRUN]; + + union { + DECODE_TABLE(alignedcode_decode_table, LZX_ALIGNEDCODE_NUM_SYMBOLS, + LZX_ALIGNEDCODE_TABLEBITS, LZX_MAX_ALIGNED_CODEWORD_LEN); + u8 alignedcode_lens[LZX_ALIGNEDCODE_NUM_SYMBOLS]; + }; + + union { + DECODE_TABLE(precode_decode_table, LZX_PRECODE_NUM_SYMBOLS, + LZX_PRECODE_TABLEBITS, LZX_MAX_PRE_CODEWORD_LEN); + u8 precode_lens[LZX_PRECODE_NUM_SYMBOLS]; + u8 extra_offset_bits[LZX_MAX_OFFSET_SLOTS]; + }; + + union { + DECODE_TABLE_WORKING_SPACE(maincode_working_space, + LZX_MAINCODE_MAX_NUM_SYMBOLS, + LZX_MAX_MAIN_CODEWORD_LEN); + DECODE_TABLE_WORKING_SPACE(lencode_working_space, + LZX_LENCODE_NUM_SYMBOLS, + LZX_MAX_LEN_CODEWORD_LEN); + DECODE_TABLE_WORKING_SPACE(alignedcode_working_space, + LZX_ALIGNEDCODE_NUM_SYMBOLS, + LZX_MAX_ALIGNED_CODEWORD_LEN); + DECODE_TABLE_WORKING_SPACE(precode_working_space, + LZX_PRECODE_NUM_SYMBOLS, + LZX_MAX_PRE_CODEWORD_LEN); + }; + + unsigned window_order; + unsigned num_main_syms; + + /* Like lzx_extra_offset_bits[], but does not include the entropy-coded + * bits of aligned offset blocks */ + u8 extra_offset_bits_minus_aligned[LZX_MAX_OFFSET_SLOTS]; + +} __attribute__((aligned(DECODE_TABLE_ALIGNMENT))); + +/* Read a Huffman-encoded symbol using the precode. */ +static forceinline unsigned +read_presym(const struct lzx_decompressor *d, struct input_bitstream *is) +{ + return read_huffsym(is, d->precode_decode_table, + LZX_PRECODE_TABLEBITS, LZX_MAX_PRE_CODEWORD_LEN); +} + +/* Read a Huffman-encoded symbol using the main code. */ +static forceinline unsigned +read_mainsym(const struct lzx_decompressor *d, struct input_bitstream *is) +{ + return read_huffsym(is, d->maincode_decode_table, + LZX_MAINCODE_TABLEBITS, LZX_MAX_MAIN_CODEWORD_LEN); +} + +/* Read a Huffman-encoded symbol using the length code. */ +static forceinline unsigned +read_lensym(const struct lzx_decompressor *d, struct input_bitstream *is) +{ + return read_huffsym(is, d->lencode_decode_table, + LZX_LENCODE_TABLEBITS, LZX_MAX_LEN_CODEWORD_LEN); +} + +/* Read a Huffman-encoded symbol using the aligned offset code. */ +static forceinline unsigned +read_alignedsym(const struct lzx_decompressor *d, struct input_bitstream *is) +{ + return read_huffsym(is, d->alignedcode_decode_table, + LZX_ALIGNEDCODE_TABLEBITS, LZX_MAX_ALIGNED_CODEWORD_LEN); +} + +/* + * Read a precode from the compressed input bitstream, then use it to decode + * @num_lens codeword length values and write them to @lens. + */ +static int +lzx_read_codeword_lens(struct lzx_decompressor *d, struct input_bitstream *is, + u8 *lens, unsigned num_lens) +{ + u8 *len_ptr = lens; + u8 *lens_end = lens + num_lens; + + /* Read the lengths of the precode codewords. These are stored + * explicitly. */ + for (int i = 0; i < LZX_PRECODE_NUM_SYMBOLS; i++) { + d->precode_lens[i] = + bitstream_read_bits(is, LZX_PRECODE_ELEMENT_SIZE); + } + + /* Build the decoding table for the precode. */ + if (make_huffman_decode_table(d->precode_decode_table, + LZX_PRECODE_NUM_SYMBOLS, + LZX_PRECODE_TABLEBITS, + d->precode_lens, + LZX_MAX_PRE_CODEWORD_LEN, + d->precode_working_space)) + return -1; + + /* Decode the codeword lengths. */ + do { + unsigned presym; + u8 len; + + /* Read the next precode symbol. */ + presym = read_presym(d, is); + if (presym < 17) { + /* Difference from old length */ + len = *len_ptr - presym; + if ((s8)len < 0) + len += 17; + *len_ptr++ = len; + } else { + /* Special RLE values */ + + unsigned run_len; + + if (presym == 17) { + /* Run of 0's */ + run_len = 4 + bitstream_read_bits(is, 4); + len = 0; + } else if (presym == 18) { + /* Longer run of 0's */ + run_len = 20 + bitstream_read_bits(is, 5); + len = 0; + } else { + /* Run of identical lengths */ + run_len = 4 + bitstream_read_bits(is, 1); + presym = read_presym(d, is); + if (unlikely(presym > 17)) + return -1; + len = *len_ptr - presym; + if ((s8)len < 0) + len += 17; + } + + do { + *len_ptr++ = len; + } while (--run_len); + /* + * The worst case overrun is when presym == 18, + * run_len == 20 + 31, and only 1 length was remaining. + * So LZX_READ_LENS_MAX_OVERRUN == 50. + * + * Overrun while reading the first half of maincode_lens + * can corrupt the previous values in the second half. + * This doesn't really matter because the resulting + * lengths will still be in range, and data that + * generates overruns is invalid anyway. + */ + } + } while (len_ptr < lens_end); + + return 0; +} + +/* + * Read the header of an LZX block. For all block types, the block type and + * size is saved in *block_type_ret and *block_size_ret, respectively. For + * compressed blocks, the codeword lengths are also saved. For uncompressed + * blocks, the recent offsets queue is also updated. + */ +static int +lzx_read_block_header(struct lzx_decompressor *d, struct input_bitstream *is, + u32 recent_offsets[], int *block_type_ret, + u32 *block_size_ret) +{ + int block_type; + u32 block_size; + + bitstream_ensure_bits(is, 4); + + /* Read the block type. */ + block_type = bitstream_pop_bits(is, 3); + + /* Read the block size. */ + if (bitstream_pop_bits(is, 1)) { + block_size = LZX_DEFAULT_BLOCK_SIZE; + } else { + block_size = bitstream_read_bits(is, 16); + if (d->window_order >= 16) { + block_size <<= 8; + block_size |= bitstream_read_bits(is, 8); + } + } + + switch (block_type) { + + case LZX_BLOCKTYPE_ALIGNED: + + /* Read the aligned offset codeword lengths. */ + + for (int i = 0; i < LZX_ALIGNEDCODE_NUM_SYMBOLS; i++) { + d->alignedcode_lens[i] = + bitstream_read_bits(is, + LZX_ALIGNEDCODE_ELEMENT_SIZE); + } + + /* Fall though, since the rest of the header for aligned offset + * blocks is the same as that for verbatim blocks. */ + + case LZX_BLOCKTYPE_VERBATIM: + + /* Read the main codeword lengths, which are divided into two + * parts: literal symbols and match headers. */ + + if (lzx_read_codeword_lens(d, is, d->maincode_lens, + LZX_NUM_CHARS)) + return -1; + + if (lzx_read_codeword_lens(d, is, d->maincode_lens + LZX_NUM_CHARS, + d->num_main_syms - LZX_NUM_CHARS)) + return -1; + + + /* Read the length codeword lengths. */ + + if (lzx_read_codeword_lens(d, is, d->lencode_lens, + LZX_LENCODE_NUM_SYMBOLS)) + return -1; + + break; + + case LZX_BLOCKTYPE_UNCOMPRESSED: + /* + * The header of an uncompressed block contains new values for + * the recent offsets queue, starting on the next 16-bit + * boundary in the bitstream. Careful: if the stream is + * *already* aligned, the correct thing to do is to throw away + * the next 16 bits (this is probably a mistake in the format). + */ + bitstream_ensure_bits(is, 1); + bitstream_align(is); + recent_offsets[0] = bitstream_read_u32(is); + recent_offsets[1] = bitstream_read_u32(is); + recent_offsets[2] = bitstream_read_u32(is); + + /* Offsets of 0 are invalid. */ + if (recent_offsets[0] == 0 || recent_offsets[1] == 0 || + recent_offsets[2] == 0) + return -1; + break; + + default: + /* Unrecognized block type. */ + return -1; + } + + *block_type_ret = block_type; + *block_size_ret = block_size; + return 0; +} + +/* Decompress a block of LZX-compressed data. */ +static int +lzx_decompress_block(struct lzx_decompressor *d, struct input_bitstream *_is, + int block_type, u32 block_size, + u8 * const out_begin, u8 *out_next, u32 recent_offsets[]) +{ + /* + * Redeclare the input bitstream on the stack. This shouldn't be + * needed, but it can improve the main loop's performance significantly + * with both gcc and clang, apparently because the compiler otherwise + * gets confused and doesn't properly allocate registers for + * 'is->bitbuf' et al. and/or thinks 'is->next' may point into 'is'. + */ + struct input_bitstream is_onstack = *_is; + struct input_bitstream *is = &is_onstack; + u8 * const block_end = out_next + block_size; + unsigned min_aligned_offset_slot; + + /* + * Build the Huffman decode tables. We always need to build the main + * and length decode tables. For aligned blocks we additionally need to + * build the aligned offset decode table. + */ + + if (make_huffman_decode_table(d->maincode_decode_table, + d->num_main_syms, + LZX_MAINCODE_TABLEBITS, + d->maincode_lens, + LZX_MAX_MAIN_CODEWORD_LEN, + d->maincode_working_space)) + return -1; + + if (make_huffman_decode_table(d->lencode_decode_table, + LZX_LENCODE_NUM_SYMBOLS, + LZX_LENCODE_TABLEBITS, + d->lencode_lens, + LZX_MAX_LEN_CODEWORD_LEN, + d->lencode_working_space)) + return -1; + + if (block_type == LZX_BLOCKTYPE_ALIGNED) { + if (make_huffman_decode_table(d->alignedcode_decode_table, + LZX_ALIGNEDCODE_NUM_SYMBOLS, + LZX_ALIGNEDCODE_TABLEBITS, + d->alignedcode_lens, + LZX_MAX_ALIGNED_CODEWORD_LEN, + d->alignedcode_working_space)) + return -1; + min_aligned_offset_slot = LZX_MIN_ALIGNED_OFFSET_SLOT; + memcpy(d->extra_offset_bits, d->extra_offset_bits_minus_aligned, + sizeof(lzx_extra_offset_bits)); + } else { + min_aligned_offset_slot = LZX_MAX_OFFSET_SLOTS; + memcpy(d->extra_offset_bits, lzx_extra_offset_bits, + sizeof(lzx_extra_offset_bits)); + } + + /* Decode the literals and matches. */ + + do { + unsigned mainsym; + unsigned length; + u32 offset; + unsigned offset_slot; + + mainsym = read_mainsym(d, is); + if (mainsym < LZX_NUM_CHARS) { + /* Literal */ + *out_next++ = mainsym; + continue; + } + + /* Match */ + + /* Decode the length header and offset slot. */ + STATIC_ASSERT(LZX_NUM_CHARS % LZX_NUM_LEN_HEADERS == 0); + length = mainsym % LZX_NUM_LEN_HEADERS; + offset_slot = (mainsym - LZX_NUM_CHARS) / LZX_NUM_LEN_HEADERS; + + /* If needed, read a length symbol to decode the full length. */ + if (length == LZX_NUM_PRIMARY_LENS) + length += read_lensym(d, is); + length += LZX_MIN_MATCH_LEN; + + if (offset_slot < LZX_NUM_RECENT_OFFSETS) { + /* Repeat offset */ + + /* Note: This isn't a real LRU queue, since using the R2 + * offset doesn't bump the R1 offset down to R2. */ + offset = recent_offsets[offset_slot]; + recent_offsets[offset_slot] = recent_offsets[0]; + } else { + /* Explicit offset */ + offset = bitstream_read_bits(is, d->extra_offset_bits[offset_slot]); + if (offset_slot >= min_aligned_offset_slot) { + offset = (offset << LZX_NUM_ALIGNED_OFFSET_BITS) | + read_alignedsym(d, is); + } + offset += lzx_offset_slot_base[offset_slot]; + + /* Update the match offset LRU queue. */ + STATIC_ASSERT(LZX_NUM_RECENT_OFFSETS == 3); + recent_offsets[2] = recent_offsets[1]; + recent_offsets[1] = recent_offsets[0]; + } + recent_offsets[0] = offset; + + /* Validate the match and copy it to the current position. */ + if (unlikely(lz_copy(length, offset, out_begin, + out_next, block_end, LZX_MIN_MATCH_LEN))) + return -1; + out_next += length; + } while (out_next != block_end); + + *_is = is_onstack; + return 0; +} + +static int +lzx_decompress(const void *restrict compressed_data, size_t compressed_size, + void *restrict uncompressed_data, size_t uncompressed_size, + void *restrict _d) +{ + struct lzx_decompressor *d = _d; + u8 * const out_begin = uncompressed_data; + u8 *out_next = out_begin; + u8 * const out_end = out_begin + uncompressed_size; + struct input_bitstream is; + STATIC_ASSERT(LZX_NUM_RECENT_OFFSETS == 3); + u32 recent_offsets[LZX_NUM_RECENT_OFFSETS] = {1, 1, 1}; + unsigned may_have_e8_byte = 0; + + init_input_bitstream(&is, compressed_data, compressed_size); + + /* Codeword lengths begin as all 0's for delta encoding purposes. */ + memset(d->maincode_lens, 0, d->num_main_syms); + memset(d->lencode_lens, 0, LZX_LENCODE_NUM_SYMBOLS); + + /* Decompress blocks until we have all the uncompressed data. */ + + while (out_next != out_end) { + int block_type; + u32 block_size; + + if (lzx_read_block_header(d, &is, recent_offsets, + &block_type, &block_size)) + return -1; + + if (block_size < 1 || block_size > out_end - out_next) + return -1; + + if (likely(block_type != LZX_BLOCKTYPE_UNCOMPRESSED)) { + + /* Compressed block */ + if (lzx_decompress_block(d, &is, block_type, block_size, + out_begin, out_next, + recent_offsets)) + return -1; + + /* If the first E8 byte was in this block, then it must + * have been encoded as a literal using mainsym E8. */ + may_have_e8_byte |= d->maincode_lens[0xE8]; + } else { + + /* Uncompressed block */ + if (bitstream_read_bytes(&is, out_next, block_size)) + return -1; + + /* Re-align the bitstream if needed. */ + if (block_size & 1) + bitstream_read_byte(&is); + + /* There may have been an E8 byte in the block. */ + may_have_e8_byte = 1; + } + out_next += block_size; + } + + /* Postprocess the data unless it cannot possibly contain E8 bytes. */ + if (may_have_e8_byte) + lzx_postprocess(uncompressed_data, uncompressed_size); + + return 0; +} + +static int +lzx_create_decompressor(size_t max_block_size, void **d_ret) +{ + unsigned window_order; + struct lzx_decompressor *d; + + window_order = lzx_get_window_order(max_block_size); + if (window_order == 0) + return WIMLIB_ERR_INVALID_PARAM; + + d = ALIGNED_MALLOC(sizeof(*d), DECODE_TABLE_ALIGNMENT); + if (!d) + return WIMLIB_ERR_NOMEM; + + d->window_order = window_order; + d->num_main_syms = lzx_get_num_main_syms(window_order); + + /* Initialize 'd->extra_offset_bits_minus_aligned'. */ + STATIC_ASSERT(sizeof(d->extra_offset_bits_minus_aligned) == + sizeof(lzx_extra_offset_bits)); + STATIC_ASSERT(sizeof(d->extra_offset_bits) == + sizeof(lzx_extra_offset_bits)); + memcpy(d->extra_offset_bits_minus_aligned, lzx_extra_offset_bits, + sizeof(lzx_extra_offset_bits)); + for (unsigned offset_slot = LZX_MIN_ALIGNED_OFFSET_SLOT; + offset_slot < LZX_MAX_OFFSET_SLOTS; offset_slot++) + { + d->extra_offset_bits_minus_aligned[offset_slot] -= + LZX_NUM_ALIGNED_OFFSET_BITS; + } + + *d_ret = d; + return 0; +} + +static void +lzx_free_decompressor(void *_d) +{ + ALIGNED_FREE(_d); +} + +const struct decompressor_ops lzx_decompressor_ops = { + .create_decompressor = lzx_create_decompressor, + .decompress = lzx_decompress, + .free_decompressor = lzx_free_decompressor, +}; diff --git a/src/wimlib/metadata_resource.c b/src/wimlib/metadata_resource.c new file mode 100644 index 00000000..71d3d6d0 --- /dev/null +++ b/src/wimlib/metadata_resource.c @@ -0,0 +1,259 @@ +/* + * metadata_resource.c + */ + +/* + * Copyright 2012-2023 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/assert.h" +#include "wimlib/blob_table.h" +#include "wimlib/dentry.h" +#include "wimlib/error.h" +#include "wimlib/metadata.h" +#include "wimlib/resource.h" +#include "wimlib/security.h" +#include "wimlib/write.h" + +/* Fix the security ID for every inode to be either -1 or in bounds. */ +static void +fix_security_ids(struct wim_image_metadata *imd, const u32 num_entries) +{ + struct wim_inode *inode; + unsigned long invalid_count = 0; + + image_for_each_inode(inode, imd) { + if ((u32)inode->i_security_id >= num_entries) { + if (inode->i_security_id >= 0) + invalid_count++; + inode->i_security_id = -1; + } + } + if (invalid_count) + WARNING("%lu inodes had invalid security IDs", invalid_count); +} + +/* + * Reads and parses a metadata resource for an image in the WIM file. + * + * @imd: + * Pointer to the image metadata structure for the image whose metadata + * resource we are reading. Its `metadata_blob' member specifies the blob + * table entry for the metadata resource. The rest of the image metadata + * entry will be filled in by this function. + * + * Return values: + * WIMLIB_ERR_SUCCESS (0) + * WIMLIB_ERR_INVALID_METADATA_RESOURCE + * WIMLIB_ERR_NOMEM + * WIMLIB_ERR_READ + * WIMLIB_ERR_UNEXPECTED_END_OF_FILE + * WIMLIB_ERR_DECOMPRESSION + */ +int +read_metadata_resource(struct wim_image_metadata *imd) +{ + const struct blob_descriptor *metadata_blob; + void *buf; + int ret; + u8 hash[SHA1_HASH_SIZE]; + struct wim_security_data *sd; + struct wim_dentry *root; + + metadata_blob = imd->metadata_blob; + + /* + * Prevent huge memory allocations when processing fuzzed files. The + * case of metadata resources is tough, since a metadata resource can + * legitimately decompress to many times the size of the WIM file + * itself, e.g. in the case of an image containing many empty files with + * similar long filenames. Arbitrarily choose 512x as a generous limit. + */ + if (metadata_blob->blob_location == BLOB_IN_WIM && + metadata_blob->rdesc->wim->file_size > 0 && + metadata_blob->size / 512 > metadata_blob->rdesc->wim->file_size) + return WIMLIB_ERR_INVALID_METADATA_RESOURCE; + + /* Read the metadata resource into memory. (It may be compressed.) */ + ret = read_blob_into_alloc_buf(metadata_blob, &buf); + if (ret) + return ret; + + /* Checksum the metadata resource. */ + sha1(buf, metadata_blob->size, hash); + if (!hashes_equal(metadata_blob->hash, hash)) { + ERROR("Metadata resource is corrupted " + "(invalid SHA-1 message digest)!"); + ret = WIMLIB_ERR_INVALID_METADATA_RESOURCE; + goto out_free_buf; + } + + /* Parse the metadata resource. + * + * Notes: The metadata resource consists of the security data, followed + * by the directory entry for the root directory, followed by all the + * other directory entries in the filesystem. The subdir offset field + * of each directory entry gives the start of its child entries from the + * beginning of the metadata resource. An end-of-directory is signaled + * by a directory entry of length '0', really of length 8, because + * that's how long the 'length' field is. */ + + ret = read_wim_security_data(buf, metadata_blob->size, &sd); + if (ret) + goto out_free_buf; + + ret = read_dentry_tree(buf, metadata_blob->size, sd->total_length, &root); + if (ret) + goto out_free_security_data; + + /* We have everything we need from the buffer now. */ + FREE(buf); + buf = NULL; + + /* Calculate and validate inodes. */ + + ret = dentry_tree_fix_inodes(root, &imd->inode_list); + if (ret) + goto out_free_dentry_tree; + + fix_security_ids(imd, sd->num_entries); + + /* Success; fill in the image_metadata structure. */ + imd->root_dentry = root; + imd->security_data = sd; + INIT_LIST_HEAD(&imd->unhashed_blobs); + return 0; + +out_free_dentry_tree: + free_dentry_tree(root, NULL); +out_free_security_data: + free_wim_security_data(sd); +out_free_buf: + FREE(buf); + return ret; +} + +static void +recalculate_security_data_length(struct wim_security_data *sd) +{ + u32 total_length = sizeof(u64) * sd->num_entries + 2 * sizeof(u32); + for (u32 i = 0; i < sd->num_entries; i++) + total_length += sd->sizes[i]; + sd->total_length = ALIGN(total_length, 8); +} + +static int +prepare_metadata_resource(WIMStruct *wim, int image, + u8 **buf_ret, size_t *len_ret) +{ + u8 *buf; + u8 *p; + int ret; + u64 subdir_offset; + struct wim_dentry *root; + size_t len; + struct wim_security_data *sd; + struct wim_image_metadata *imd; + + ret = select_wim_image(wim, image); + if (ret) + return ret; + + imd = wim->image_metadata[image - 1]; + + root = imd->root_dentry; + sd = imd->security_data; + + if (!root) { + /* Empty image; create a dummy root. */ + ret = new_filler_directory(&root); + if (ret) + return ret; + imd->root_dentry = root; + } + + /* The offset of the first child of the root dentry is equal to the + * total length of the security data, plus the total length of the root + * dentry, plus 8 bytes for an end-of-directory entry following the root + * dentry (shouldn't really be needed, but just in case...) */ + recalculate_security_data_length(sd); + subdir_offset = sd->total_length + dentry_out_total_length(root) + 8; + + /* Calculate the subdirectory offsets for the entire dentry tree. */ + calculate_subdir_offsets(root, &subdir_offset); + + /* Total length of the metadata resource (uncompressed). */ + len = subdir_offset; + + /* Allocate a buffer to contain the uncompressed metadata resource. */ + buf = NULL; + if (likely(len == subdir_offset)) + buf = MALLOC(len); + if (!buf) { + ERROR("Failed to allocate %"PRIu64" bytes for " + "metadata resource", subdir_offset); + return WIMLIB_ERR_NOMEM; + } + + /* Write the security data into the resource buffer. */ + p = write_wim_security_data(sd, buf); + + /* Write the dentry tree into the resource buffer. */ + p = write_dentry_tree(root, p); + + /* We MUST have exactly filled the buffer; otherwise we calculated its + * size incorrectly or wrote the data incorrectly. */ + wimlib_assert(p - buf == len); + + *buf_ret = buf; + *len_ret = len; + return 0; +} + +int +write_metadata_resource(WIMStruct *wim, int image, int write_resource_flags) +{ + int ret; + u8 *buf; + size_t len; + struct wim_image_metadata *imd; + + ret = prepare_metadata_resource(wim, image, &buf, &len); + if (ret) + return ret; + + imd = wim->image_metadata[image - 1]; + + /* Write the metadata resource to the output WIM using the proper + * compression type, in the process updating the blob descriptor for the + * metadata resource. */ + ret = write_wim_resource_from_buffer(buf, + len, + true, + &wim->out_fd, + wim->out_compression_type, + wim->out_chunk_size, + &imd->metadata_blob->out_reshdr, + imd->metadata_blob->hash, + write_resource_flags); + + FREE(buf); + return ret; +} diff --git a/src/wimlib/pathlist.c b/src/wimlib/pathlist.c new file mode 100644 index 00000000..0b623f81 --- /dev/null +++ b/src/wimlib/pathlist.c @@ -0,0 +1,54 @@ +/* + * pathlist.c + * + * Utility function for reading path list files. + */ + +/* + * Copyright (C) 2013 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/pathlist.h" +#include "wimlib/textfile.h" + +int +read_path_list_file(const tchar *listfile, + tchar ***paths_ret, size_t *num_paths_ret, + void **mem_ret) +{ + STRING_LIST(paths); + struct text_file_section tmp = { + .name = T(""), + .strings = &paths, + }; + void *buf; + int ret; + + ret = load_text_file(listfile, NULL, 0, &buf, &tmp, 1, + LOAD_TEXT_FILE_REMOVE_QUOTES | + LOAD_TEXT_FILE_ALLOW_STDIN, NULL); + if (ret) + return ret; + + *paths_ret = paths.strings; + *num_paths_ret = paths.num_strings; + *mem_ret = buf; + return 0; +} diff --git a/src/wimlib/paths.c b/src/wimlib/paths.c new file mode 100644 index 00000000..34d08a5c --- /dev/null +++ b/src/wimlib/paths.c @@ -0,0 +1,151 @@ +/* + * paths.c - Path manipulation routines + */ + +/* + * Copyright (C) 2012, 2013 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <string.h> + +#include "wimlib.h" +#include "wimlib/paths.h" +#include "wimlib/util.h" + +/* Like the basename() function, but does not modify @path; it just returns a + * pointer to it. This assumes the path separator is the + * OS_PREFERRED_PATH_SEPARATOR. */ +const tchar * +path_basename(const tchar *path) +{ + return path_basename_with_len(path, tstrlen(path)); +} + +/* Like path_basename(), but take an explicit string length. */ +const tchar * +path_basename_with_len(const tchar *path, size_t len) +{ + const tchar *p = &path[len]; + + do { + if (p == path) + return &path[len]; + } while (*--p == OS_PREFERRED_PATH_SEPARATOR); + + do { + if (p == path) + return &path[0]; + } while (*--p != OS_PREFERRED_PATH_SEPARATOR); + + return ++p; +} + + +/* Returns a pointer to the part of @path following the first colon in the last + * path component, or NULL if the last path component does not contain a colon + * or has no characters following the first colon. */ +const tchar * +path_stream_name(const tchar *path) +{ + const tchar *base = path_basename(path); + const tchar *stream_name = tstrchr(base, T(':')); + if (stream_name == NULL || *(stream_name + 1) == T('\0')) + return NULL; + else + return stream_name + 1; +} + +/* Collapse and translate path separators, and strip trailing slashes. Doesn't + * add or delete a leading slash. + * + * @in may alias @out. + */ +void +do_canonicalize_path(const tchar *in, tchar *out) +{ + tchar *orig_out = out; + + while (*in) { + if (is_any_path_separator(*in)) { + /* Collapse multiple path separators into one */ + *out++ = WIM_PATH_SEPARATOR; + do { + in++; + } while (is_any_path_separator(*in)); + } else { + /* Copy non-path-separator character */ + *out++ = *in++; + } + } + + /* Remove trailing slash if existent */ + if (out - orig_out > 1 && *(out - 1) == WIM_PATH_SEPARATOR) + --out; + + *out = T('\0'); +} + +/* + * canonicalize_wim_path() - Given a user-provided path to a file within a WIM + * image, translate it into a "canonical" path. + * + * - Translate both types of slash into a consistent type (WIM_PATH_SEPARATOR). + * - Collapse path separators. + * - Add leading slash if missing. + * - Strip trailing slashes. + * + * Examples (with WIM_PATH_SEPARATOR == '/'): + * + * => / [ either NULL or empty string ] + * / => / + * \ => / + * hello => /hello + * \hello => /hello + * \hello => /hello + * /hello/ => /hello + * \hello/ => /hello + * /hello//1 => /hello/1 + * \\hello\\1\\ => /hello/1 + */ +tchar * +canonicalize_wim_path(const tchar *wim_path) +{ + const tchar *in; + tchar *out; + tchar *result; + + in = wim_path; + if (!in) + in = T(""); + + result = MALLOC((1 + tstrlen(in) + 1) * sizeof(result[0])); + if (!result) + return NULL; + + out = result; + + /* Add leading slash if missing */ + if (!is_any_path_separator(*in)) + *out++ = WIM_PATH_SEPARATOR; + + do_canonicalize_path(in, out); + + return result; +} diff --git a/src/wimlib/pattern.c b/src/wimlib/pattern.c new file mode 100644 index 00000000..caad2f5e --- /dev/null +++ b/src/wimlib/pattern.c @@ -0,0 +1,196 @@ +/* + * pattern.c + * + * Wildcard pattern matching functions. + */ + +/* + * Copyright (C) 2013, 2015 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <ctype.h> + +#include "wimlib/dentry.h" +#include "wimlib/encoding.h" +#include "wimlib/paths.h" +#include "wimlib/pattern.h" + +static bool +string_matches_pattern(const tchar *string, const tchar * const string_end, + const tchar *pattern, const tchar * const pattern_end) +{ + for (; string != string_end; string++, pattern++) { + if (pattern == pattern_end) + return false; + if (*pattern == T('*')) { + return string_matches_pattern(string, string_end, + pattern + 1, pattern_end) || + string_matches_pattern(string + 1, string_end, + pattern, pattern_end); + } + if (*string != *pattern && *pattern != T('?') && + !(default_ignore_case && + totlower(*string) == totlower(*pattern))) + return false; + } + + while (pattern != pattern_end && *pattern == T('*')) + pattern++; + return pattern == pattern_end; +} + +/* Advance past zero or more path separators. */ +static const tchar * +advance_to_next_component(const tchar *p) +{ + while (*p == WIM_PATH_SEPARATOR) + p++; + return p; +} + +/* Advance past a nonempty path component. */ +static const tchar * +advance_through_component(const tchar *p) +{ + do { + p++; + } while (*p && *p != WIM_PATH_SEPARATOR); + return p; +} + +/* + * Determine whether a path matches a wildcard pattern. + * + * @path + * The null-terminated path string to match. + * @pattern + * The null-terminated wildcard pattern to match. It can contain the + * wildcard characters '*' (which matches zero or more characters) and '?' + * (which matches any single character). If there is no leading path + * separator, then the match is attempted with the filename component of + * @path only; otherwise, the match is attempted with the entire @path. + * @match_flags + * MATCH_* flags, see the flag definitions. + * + * @path and @pattern can both contain path separators (character + * WIM_PATH_SEPARATOR). Leading and trailing path separators are not + * significant, except when determining whether to match only the filename + * component as noted above. The lengths of interior path separator sequences + * are not significant. The '*' and '?' characters act within a single path + * component only (they do not match path separators). + * + * Matching is done with the default case sensitivity behavior. + * + * Returns %true iff the path matched the pattern. + */ +bool +match_path(const tchar *path, const tchar *pattern, int match_flags) +{ + /* Filename only? */ + if (*pattern != WIM_PATH_SEPARATOR) + path = path_basename(path); + + for (;;) { + const tchar *path_component_end; + const tchar *pattern_component_end; + + path = advance_to_next_component(path); + pattern = advance_to_next_component(pattern); + + /* Is the pattern exhausted? */ + if (!*pattern) + return !*path || (match_flags & MATCH_RECURSIVELY); + + /* Is the path exhausted (but not the pattern)? */ + if (!*path) + return (match_flags & MATCH_ANCESTORS); + + path_component_end = advance_through_component(path); + pattern_component_end = advance_through_component(pattern); + + /* Do the components match? */ + if (!string_matches_pattern(path, path_component_end, + pattern, pattern_component_end)) + return false; + + path = path_component_end; + pattern = pattern_component_end; + } +} + +/* + * Expand a path pattern in an in-memory tree of dentries. + * + * @root + * The root of the directory tree in which to expand the pattern. + * @pattern + * The path pattern to expand, which may contain the '*' and '?' wildcard + * characters. Path separators must be WIM_PATH_SEPARATOR. Leading and + * trailing path separators are ignored. The default case sensitivity + * behavior is used. + * @consume_dentry + * A callback function which will receive each matched directory entry. + * @ctx + * Opaque context argument for @consume_dentry. + * + * @return 0 on success; a positive error code on failure; or the first nonzero + * value returned by @consume_dentry. + */ +int +expand_path_pattern(struct wim_dentry *root, const tchar *pattern, + int (*consume_dentry)(struct wim_dentry *, void *), + void *ctx) +{ + const tchar *pattern_component_end; + struct wim_dentry *child; + + if (!root) + return 0; + + pattern = advance_to_next_component(pattern); + + /* If there are no more components, then 'root' is matched. */ + if (!*pattern) + return (*consume_dentry)(root, ctx); + + pattern_component_end = advance_through_component(pattern); + + /* For each child dentry that matches the current pattern component, + * recurse with the remainder of the pattern. */ + for_dentry_child(child, root) { + const tchar *name; + size_t name_nbytes; + int ret; + + ret = utf16le_get_tstr(child->d_name, child->d_name_nbytes, + &name, &name_nbytes); + if (ret) + return ret; + + if (string_matches_pattern(name, &name[name_nbytes / sizeof(tchar)], + pattern, pattern_component_end)) + ret = expand_path_pattern(child, pattern_component_end, + consume_dentry, ctx); + utf16le_put_tstr(name); + if (ret) + return ret; + } + return 0; +} diff --git a/src/wimlib/progress.c b/src/wimlib/progress.c new file mode 100644 index 00000000..59c70662 --- /dev/null +++ b/src/wimlib/progress.c @@ -0,0 +1,59 @@ +/* + * progress.c + */ + +/* + * Copyright (C) 2014 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/progress.h" + +int +report_error(wimlib_progress_func_t progfunc, + void *progctx, int error_code, const tchar *path) +{ + int ret; + union wimlib_progress_info progress; + tchar *cookie; + + if (error_code == WIMLIB_ERR_SUCCESS || + error_code == WIMLIB_ERR_ABORTED_BY_PROGRESS || + error_code == WIMLIB_ERR_UNKNOWN_PROGRESS_STATUS) + return error_code; + + progress.handle_error.path = path; + progress.handle_error.error_code = error_code; + progress.handle_error.will_ignore = false; + + cookie = progress_get_win32_path(path); + + ret = call_progress(progfunc, WIMLIB_PROGRESS_MSG_HANDLE_ERROR, + &progress, progctx); + + progress_put_win32_path(cookie); + + if (ret) + return ret; + + if (!progress.handle_error.will_ignore) + return error_code; + + return 0; +} diff --git a/src/wimlib/registry.c b/src/wimlib/registry.c new file mode 100644 index 00000000..5672e707 --- /dev/null +++ b/src/wimlib/registry.c @@ -0,0 +1,759 @@ +/* + * registry.c + * + * Extract information from Windows NT registry hives. + */ + +/* + * Copyright (C) 2016 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <string.h> + +#include "wimlib/encoding.h" +#include "wimlib/endianness.h" +#include "wimlib/error.h" +#include "wimlib/registry.h" +#include "wimlib/util.h" + +/* Registry hive file header */ +struct regf { +#define REGF_MAGIC cpu_to_le32(0x66676572) /* "regf" */ + le32 magic; + le32 f1[4]; +#define REGF_MAJOR cpu_to_le32(1) + le32 major_version; + le32 minor_version; + le32 f2[2]; + le32 root_key_offset; /* Offset, in hbin area, to root nk */ + le32 total_hbin_size; /* Total size of all hbins */ + le32 f3[1013]; + u8 hbin_area[0]; /* Start of hbin area */ +} __attribute__((packed)); + + +/* Cell header */ +struct cell { + /* The cell size in bytes, negated for in-use cells */ + le32 size; + + /* Magic characters which identify the cell type */ + le16 magic; +} __attribute__((packed)); + +/* NK cell - represents a registry key */ +struct nk { +#define NK_MAGIC cpu_to_le16(0x6B6E) /* "nk" */ + struct cell base; +#define NK_COMPRESSED_NAME cpu_to_le16(0x0020) + le16 flags; + le64 unknown_0x08; + le32 unknown_0x10; + le32 parent_offset; + le32 num_subkeys; + le32 unknown_0x1C; + le32 subkey_list_offset; + le32 unknown_0x24; + le32 num_values; + le32 value_list_offset; + le32 unknown_0x30; + le32 unknown_0x34; + le16 unknown_0x38; + le16 unknown_0x3A; + le32 unknown_0x3C; + le32 unknown_0x40; + le32 unknown_0x44; + le32 unknown_0x48; + le16 name_size; + le16 unknown_0x4E; + char name[0]; +} __attribute__((packed)); + +/* Subkey list cell. There are four types. LF, LH, and LI cells reference + * subkey NK cells directly, while RI cells reference other subkey lists. All + * contain a count followed by that many 32-bit offsets. But LF and LH cells + * contain a 32-bit hash along with each offset, while LI and RI cells only + * contain offsets. */ +struct subkey_list { +#define LF_MAGIC cpu_to_le16(0x666C) /* "lf" */ +#define LH_MAGIC cpu_to_le16(0x686C) /* "lh" */ +#define LI_MAGIC cpu_to_le16(0x696C) /* "li" */ +#define RI_MAGIC cpu_to_le16(0x6972) /* "ri" */ + struct cell base; + le16 num_offsets; + le32 elements[0]; +} __attribute__((packed)); + +/* Value list cell - contains a list of value references */ +struct value_list { + le32 size; + le32 vk_offsets[0]; +} __attribute__((packed)); + +/* VK cell - contains a value's data, or a reference to it */ +struct vk { +#define VK_MAGIC cpu_to_le16(0x6B76) + struct cell base; + le16 name_size; + le32 data_size; + le32 data_offset; +#define REG_NONE cpu_to_le32(0) +#define REG_SZ cpu_to_le32(1) +#define REG_EXPAND_SZ cpu_to_le32(2) +#define REG_BINARY cpu_to_le32(3) +#define REG_DWORD cpu_to_le32(4) +#define REG_DWORD_LITTLE_ENDIAN cpu_to_le32(4) +#define REG_DWORD_BIG_ENDIAN cpu_to_le32(5) +#define REG_LINK cpu_to_le32(6) +#define REG_MULTI_SZ cpu_to_le32(7) +#define REG_RESOURCE_LIST cpu_to_le32(8) +#define REG_FULL_RESOURCE_DESCRIPTOR cpu_to_le32(9) +#define REG_RESOURCE_REQUIREMENTS_LIST cpu_to_le32(10) +#define REG_QWORD cpu_to_le32(11) +#define REG_QWORD_LITTLE_ENDIAN cpu_to_le32(11) + le32 data_type; +#define VK_COMPRESSED_NAME cpu_to_le16(0x0001) + le16 flags; + le16 unknown_0x16; + char name[0]; +}; + +/* Data cell - contains a value's data */ +struct data_cell { + le32 size; + u8 data[0]; +}; + +/* Arbitrary limits for safety */ +#define MAX_VALUES 65536 +#define MAX_VALUE_SIZE 1048576 +#define MAX_SUBKEYS 65536 +#define MAX_SUBKEY_LIST_LEVELS 5 +#define MAX_SUBKEY_LISTS 4096 + +static enum hive_status +translate_wimlib_error(int ret) +{ + if (likely(!ret)) + return HIVE_OK; + if (ret == WIMLIB_ERR_NOMEM) + return HIVE_OUT_OF_MEMORY; + return HIVE_UNSUPPORTED; +} + +/* Compare a UTF-16LE name with a key or value name in the registry. The + * comparison is case insensitive. */ +static inline bool +names_equal(const utf16lechar *name, size_t name_nchars, + const void *disk_name, size_t disk_name_size, + bool compressed) +{ + if (compressed) { + /* ISO-8859-1 (LATIN1) on-disk */ + const u8 *p = disk_name; + if (disk_name_size != name_nchars) + return false; + for (size_t i = 0; i < name_nchars; i++) + if (upcase[le16_to_cpu(name[i])] != upcase[p[i]]) + return false; + return true; + } else { + /* UTF-16LE on disk */ + disk_name_size /= 2; + if (disk_name_size != name_nchars) + return false; + return !cmp_utf16le_strings(name, name_nchars, + disk_name, disk_name_size, true); + } +} + +/* Get a pointer to a cell, with alignment and bounds checking. Returns NULL if + * the requested information does not specify a properly aligned, sized, and + * in-use cell. */ +static const void * +get_cell_pointer(const struct regf *regf, le32 offset, size_t wanted_size) +{ + u32 total = le32_to_cpu(regf->total_hbin_size); + u32 offs = le32_to_cpu(offset); + const struct cell *cell; + u32 actual_size; + + if ((offs > total) || (offs & 7) || (wanted_size > total - offs)) + return NULL; + + cell = (const struct cell *)&regf->hbin_area[offs]; + actual_size = -le32_to_cpu(cell->size); + if (actual_size > INT32_MAX) /* Cell unused, or size was INT32_MIN? */ + return NULL; + if (wanted_size > actual_size) /* Cell too small? */ + return NULL; + return cell; +} + +/* Revalidate the cell with its full length. Returns true iff the cell is + * valid. */ +static bool +revalidate_cell(const struct regf *regf, le32 offset, size_t wanted_size) +{ + return get_cell_pointer(regf, offset, wanted_size) != NULL; +} + +struct subkey_iteration_stats { + + /* The number of additional levels of descendent subkey lists that may + * be visited (currently, i.e. at this point in the iteration) before + * our safety limit of MAX_SUBKEY_LIST_LEVELS is reached */ + u32 levels_remaining; + + /* The number of additional subkey lists that may be visited until our + * safety limit of MAX_SUBKEY_LISTS is reached */ + u32 subkey_lists_remaining; + + /* The number of subkeys remaining to be found. Since the number of + * subkeys is known from the parent nk cell, this should be 0 at the end + * of the iteration. */ + u32 subkeys_remaining; +}; + +typedef enum hive_status (*subkey_cb_t)(const struct nk *, void *); + +static enum hive_status +iterate_subkeys_recursive(const struct regf *regf, le32 subkey_list_offset, + subkey_cb_t cb, void *cb_ctx, + struct subkey_iteration_stats *stats) +{ + const struct subkey_list *list; + unsigned num_offsets; + size_t extra_size; + unsigned increment; + size_t i = 0; + enum hive_status status; + + if (stats->levels_remaining == 0 || stats->subkey_lists_remaining == 0) + return HIVE_CORRUPT; + + stats->subkey_lists_remaining--; + + list = get_cell_pointer(regf, subkey_list_offset, + sizeof(struct subkey_list)); + if (!list) + return HIVE_CORRUPT; + + num_offsets = le16_to_cpu(list->num_offsets); + extra_size = num_offsets * sizeof(list->elements[0]); + increment = 1; + + if (list->base.magic == LF_MAGIC || list->base.magic == LH_MAGIC) { + /* Hashes are included */ + extra_size *= 2; + increment = 2; + } + + if (!revalidate_cell(regf, subkey_list_offset, + sizeof(struct subkey_list) + extra_size)) + return HIVE_CORRUPT; + + switch (list->base.magic) { + case LF_MAGIC: + case LH_MAGIC: + case LI_MAGIC: + /* Children are subkeys */ + if (stats->subkeys_remaining < num_offsets) + return HIVE_CORRUPT; + stats->subkeys_remaining -= num_offsets; + while (num_offsets--) { + const struct nk *sub_nk; + + sub_nk = get_cell_pointer(regf, list->elements[i], + sizeof(struct nk)); + if (!sub_nk || sub_nk->base.magic != NK_MAGIC) + return HIVE_CORRUPT; + + if (!revalidate_cell(regf, list->elements[i], + sizeof(struct nk) + + le16_to_cpu(sub_nk->name_size))) + return HIVE_CORRUPT; + + status = (*cb)(sub_nk, cb_ctx); + if (status != HIVE_OK) + return status; + i += increment; + } + return HIVE_OK; + case RI_MAGIC: + /* Children are subkey lists */ + status = HIVE_OK; + stats->levels_remaining--; + while (num_offsets--) { + status = iterate_subkeys_recursive(regf, + list->elements[i++], + cb, cb_ctx, stats); + if (status != HIVE_OK) + break; + } + stats->levels_remaining++; + return status; + default: + return HIVE_UNSUPPORTED; + } +} + +/* Call @cb on each subkey cell of the key @nk. */ +static enum hive_status +iterate_subkeys(const struct regf *regf, const struct nk *nk, + subkey_cb_t cb, void *cb_ctx) +{ + u32 num_subkeys = le32_to_cpu(nk->num_subkeys); + struct subkey_iteration_stats stats; + enum hive_status status; + + if (num_subkeys == 0) + return HIVE_OK; + + if (num_subkeys > MAX_SUBKEYS) + return HIVE_CORRUPT; + + stats.levels_remaining = MAX_SUBKEY_LIST_LEVELS; + stats.subkey_lists_remaining = MAX_SUBKEY_LISTS; + stats.subkeys_remaining = num_subkeys; + + status = iterate_subkeys_recursive(regf, nk->subkey_list_offset, + cb, cb_ctx, &stats); + if (stats.subkeys_remaining != 0 && status == HIVE_OK) + status = HIVE_CORRUPT; + return status; +} + +struct lookup_subkey_ctx { + const utf16lechar *key_name; + size_t key_name_nchars; + const struct nk *result; +}; + +static enum hive_status +lookup_subkey_cb(const struct nk *sub_nk, void *_ctx) +{ + struct lookup_subkey_ctx *ctx = _ctx; + + if (names_equal(ctx->key_name, ctx->key_name_nchars, + sub_nk->name, le16_to_cpu(sub_nk->name_size), + (sub_nk->flags & NK_COMPRESSED_NAME) != 0)) + { + ctx->result = sub_nk; + return HIVE_ITERATION_STOPPED; + } + + return HIVE_OK; +} + +/* + * Given a registry key cell @nk, look up the next component of the key + * *key_namep. If found, return HIVE_OK, advance *key_namep past the key name + * component, and return the subkey cell in @sub_nk_ret. Otherwise, return + * another HIVE_* error code. + */ +static enum hive_status +lookup_subkey(const struct regf *regf, const utf16lechar **key_namep, + const struct nk *nk, const struct nk **sub_nk_ret) +{ + const utf16lechar *key_name = *key_namep; + size_t key_name_nchars = 0; + struct lookup_subkey_ctx ctx; + enum hive_status status; + + while (key_name[key_name_nchars] != cpu_to_le16('\0') && + key_name[key_name_nchars] != cpu_to_le16('\\')) + key_name_nchars++; + + ctx.key_name = key_name; + ctx.key_name_nchars = key_name_nchars; + ctx.result = NULL; + + status = iterate_subkeys(regf, nk, lookup_subkey_cb, &ctx); + if (!ctx.result) { + if (status == HIVE_OK) + status = HIVE_KEY_NOT_FOUND; + return status; + } + + key_name += key_name_nchars; + while (*key_name == cpu_to_le16('\\')) + key_name++; + *key_namep = key_name; + *sub_nk_ret = ctx.result; + return HIVE_OK; +} + +/* Find the nk cell for the key named @key_name in the registry hive @regf. */ +static enum hive_status +lookup_key(const struct regf *regf, const tchar *key_name, + const struct nk **nk_ret) +{ + const struct nk *nk; + enum hive_status status; + const utf16lechar *key_uname, *key_unamep; + + nk = get_cell_pointer(regf, regf->root_key_offset, sizeof(struct nk)); + if (!nk || nk->base.magic != NK_MAGIC) + return HIVE_CORRUPT; + + status = translate_wimlib_error(tstr_get_utf16le(key_name, &key_uname)); + if (status != HIVE_OK) + return status; + key_unamep = key_uname; + while (*key_unamep) { + status = lookup_subkey(regf, &key_unamep, nk, &nk); + if (status != HIVE_OK) + goto out; + } + *nk_ret = nk; + status = HIVE_OK; +out: + tstr_put_utf16le(key_uname); + return status; +} + +/* Find the vk cell for the value named @value_name of the key named @key_name + * in the registry hive @regf. */ +static enum hive_status +lookup_value(const struct regf *regf, const tchar *key_name, + const tchar *value_name, const struct vk **vk_ret) +{ + enum hive_status status; + const struct nk *nk; + size_t num_values; + const struct value_list *value_list; + const utf16lechar *value_uname; + size_t value_uname_nchars; + + /* Look up the nk cell for the key. */ + status = lookup_key(regf, key_name, &nk); + if (status != HIVE_OK) + return status; + + num_values = le32_to_cpu(nk->num_values); + + if (num_values == 0) /* No values? */ + return HIVE_VALUE_NOT_FOUND; + + if (num_values > MAX_VALUES) + return HIVE_CORRUPT; + + value_list = get_cell_pointer(regf, nk->value_list_offset, + sizeof(struct value_list) + + (num_values * + sizeof(value_list->vk_offsets[0]))); + if (!value_list) + return HIVE_CORRUPT; + + /* Look for the value in the value list. */ + + status = translate_wimlib_error( + tstr_get_utf16le_and_len(value_name, &value_uname, + &value_uname_nchars)); + if (status != HIVE_OK) + return status; + value_uname_nchars /= 2; + + for (size_t i = 0; i < num_values; i++) { + const struct vk *vk; + size_t name_size; + + status = HIVE_CORRUPT; + vk = get_cell_pointer(regf, value_list->vk_offsets[i], + sizeof(struct vk)); + if (!vk || vk->base.magic != VK_MAGIC) + goto out; + + name_size = le16_to_cpu(vk->name_size); + + if (!revalidate_cell(regf, value_list->vk_offsets[i], + sizeof(struct vk) + name_size)) + goto out; + + if (names_equal(value_uname, value_uname_nchars, + vk->name, name_size, + (vk->flags & VK_COMPRESSED_NAME) != 0)) + { + *vk_ret = vk; + status = HIVE_OK; + goto out; + } + } + + status = HIVE_VALUE_NOT_FOUND; +out: + tstr_put_utf16le(value_uname); + return status; +} + +/* + * Retrieve the data of the value named @value_name of the key named @key_name + * in the registry hive @regf. If the value was found, return HIVE_OK and + * return the data, its size, and its type in @data_ret, @data_size_ret, and + * @data_type_ret. Otherwise, return another HIVE_* error code. + */ +static enum hive_status +retrieve_value(const struct regf *regf, const tchar *key_name, + const tchar *value_name, void **data_ret, + size_t *data_size_ret, le32 *data_type_ret) +{ + enum hive_status status; + const struct vk *vk; + size_t data_size; + bool is_inline; + const void *data; + + /* Find the vk cell. */ + status = lookup_value(regf, key_name, value_name, &vk); + if (status != HIVE_OK) + return status; + + /* Extract the value data from the vk cell (for inline data) or from the + * data cell which it references (for non-inline data). */ + + data_size = le32_to_cpu(vk->data_size); + + is_inline = (data_size & 0x80000000); + data_size &= 0x7FFFFFFF; + + if (data_size > MAX_VALUE_SIZE) + return HIVE_CORRUPT; + + if (is_inline) { + if (data_size > 4) + return HIVE_CORRUPT; + data = &vk->data_offset; + } else { + const struct data_cell *data_cell; + + data_cell = get_cell_pointer(regf, vk->data_offset, + sizeof(struct data_cell)); + if (!data_cell) + return HIVE_CORRUPT; + + if (!revalidate_cell(regf, vk->data_offset, + sizeof(struct data_cell) + data_size)) + return HIVE_UNSUPPORTED; /* Possibly a big data cell */ + + data = data_cell->data; + } + + *data_ret = memdup(data, data_size); + if (!*data_ret) + return HIVE_OUT_OF_MEMORY; + *data_size_ret = data_size; + *data_type_ret = vk->data_type; + return HIVE_OK; +} + +/* Validate the registry hive file given in memory as @hive_mem and @hive_size. + * If valid, return HIVE_OK. If invalid, return another HIVE_* error code. */ +enum hive_status +hive_validate(const void *hive_mem, size_t hive_size) +{ + const struct regf *regf = hive_mem; + + STATIC_ASSERT(sizeof(struct regf) == 4096); + + if (hive_size < sizeof(struct regf)) + return HIVE_CORRUPT; + + if (regf->magic != REGF_MAGIC || regf->major_version != REGF_MAJOR) + return HIVE_UNSUPPORTED; + + if (le32_to_cpu(regf->total_hbin_size) > hive_size - sizeof(struct regf)) + return HIVE_CORRUPT; + + return HIVE_OK; +} + +/* Get a string value from the registry hive file. */ +enum hive_status +hive_get_string(const struct regf *regf, const tchar *key_name, + const tchar *value_name, tchar **value_ret) +{ + void *data; + size_t data_size; + le32 data_type; + enum hive_status status; + + /* Retrieve the raw value data. */ + status = retrieve_value(regf, key_name, value_name, + &data, &data_size, &data_type); + if (status != HIVE_OK) + return status; + + /* Interpret the data as a string, when possible. */ + switch (data_type) { + case REG_SZ: + case REG_MULTI_SZ: + status = translate_wimlib_error( + utf16le_to_tstr(data, data_size, value_ret, &data_size)); + break; + default: + status = HIVE_VALUE_IS_WRONG_TYPE; + break; + } + FREE(data); + return status; +} + +/* Get a number value from the registry hive file. */ +enum hive_status +hive_get_number(const struct regf *regf, const tchar *key_name, + const tchar *value_name, s64 *value_ret) +{ + void *data; + size_t data_size; + le32 data_type; + enum hive_status status; + + /* Retrieve the raw value data. */ + status = retrieve_value(regf, key_name, value_name, + &data, &data_size, &data_type); + if (status != HIVE_OK) + return status; + + /* Interpret the data as a number, when possible. */ + switch (data_type) { + case REG_DWORD_LITTLE_ENDIAN: + if (data_size == 4) { + *value_ret = le32_to_cpu(*(le32 *)data); + status = HIVE_OK; + } else { + status = HIVE_CORRUPT; + } + break; + case REG_DWORD_BIG_ENDIAN: + if (data_size == 4) { + *value_ret = be32_to_cpu(*(be32 *)data); + status = HIVE_OK; + } else { + status = HIVE_CORRUPT; + } + break; + case REG_QWORD_LITTLE_ENDIAN: + if (data_size == 8) { + *value_ret = le64_to_cpu(*(le64 *)data); + status = HIVE_OK; + } else { + status = HIVE_CORRUPT; + } + break; + default: + status = HIVE_VALUE_IS_WRONG_TYPE; + break; + } + + FREE(data); + return status; +} + +static enum hive_status +append_subkey_name(const struct nk *sub_nk, void *_next_subkey_p) +{ + size_t name_size = le16_to_cpu(sub_nk->name_size); + tchar *subkey; + tchar ***next_subkeyp = _next_subkey_p; + + if (sub_nk->flags & NK_COMPRESSED_NAME) { + subkey = MALLOC((name_size + 1) * sizeof(tchar)); + if (!subkey) + return HIVE_OUT_OF_MEMORY; + for (size_t i = 0; i < name_size; i++) + subkey[i] = sub_nk->name[i]; + subkey[name_size] = '\0'; + } else { + enum hive_status status; + + status = translate_wimlib_error( + utf16le_to_tstr((utf16lechar *)sub_nk->name, + name_size, &subkey, NULL)); + if (status != HIVE_OK) + return status; + } + + **next_subkeyp = subkey; + ++*next_subkeyp; + return HIVE_OK; +} + +/* List the subkeys of the specified registry key. */ +enum hive_status +hive_list_subkeys(const struct regf *regf, const tchar *key_name, + tchar ***subkeys_ret) +{ + enum hive_status status; + const struct nk *nk; + tchar **subkeys; + tchar **next_subkey; + + status = lookup_key(regf, key_name, &nk); + if (status != HIVE_OK) + return status; + + if (le32_to_cpu(nk->num_subkeys) > MAX_SUBKEYS) + return HIVE_CORRUPT; + + subkeys = CALLOC(le32_to_cpu(nk->num_subkeys) + 1, sizeof(subkeys[0])); + if (!subkeys) + return HIVE_OUT_OF_MEMORY; + + next_subkey = subkeys; + status = iterate_subkeys(regf, nk, append_subkey_name, &next_subkey); + if (status == HIVE_OK) + *subkeys_ret = subkeys; + else + hive_free_subkeys_list(subkeys); + return status; +} + +void +hive_free_subkeys_list(tchar **subkeys) +{ + for (tchar **p = subkeys; *p; p++) + FREE(*p); + FREE(subkeys); +} + +const char * +hive_status_to_string(enum hive_status status) +{ + switch (status) { + case HIVE_OK: + return "HIVE_OK"; + case HIVE_CORRUPT: + return "HIVE_CORRUPT"; + case HIVE_UNSUPPORTED: + return "HIVE_UNSUPPORTED"; + case HIVE_KEY_NOT_FOUND: + return "HIVE_KEY_NOT_FOUND"; + case HIVE_VALUE_NOT_FOUND: + return "HIVE_VALUE_NOT_FOUND"; + case HIVE_VALUE_IS_WRONG_TYPE: + return "HIVE_VALUE_IS_WRONG_TYPE"; + case HIVE_OUT_OF_MEMORY: + return "HIVE_OUT_OF_MEMORY"; + case HIVE_ITERATION_STOPPED: + return "HIVE_ITERATION_STOPPED"; + } + return NULL; +} diff --git a/src/wimlib/reparse.c b/src/wimlib/reparse.c new file mode 100644 index 00000000..2838f01b --- /dev/null +++ b/src/wimlib/reparse.c @@ -0,0 +1,445 @@ +/* + * reparse.c - Reparse point handling + */ + +/* + * Copyright (C) 2012, 2013, 2015 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <errno.h> + +#include "wimlib/alloca.h" +#include "wimlib/blob_table.h" +#include "wimlib/endianness.h" +#include "wimlib/encoding.h" +#include "wimlib/error.h" +#include "wimlib/guid.h" +#include "wimlib/inode.h" +#include "wimlib/reparse.h" +#include "wimlib/resource.h" + +/* + * Reconstruct the header of a reparse point buffer. This is necessary because + * only reparse data is stored in WIM files. The reparse tag is instead stored + * in the on-disk WIM dentry, and the reparse data length is equal to the size + * of the blob in which the reparse data was stored, minus the size of a GUID + * (16 bytes) if the reparse tag does not have the "Microsoft" bit set. + */ +void +complete_reparse_point(struct reparse_buffer_disk *rpbuf, + const struct wim_inode *inode, u16 blob_size) +{ + rpbuf->rptag = cpu_to_le32(inode->i_reparse_tag); + if (blob_size >= GUID_SIZE && !(inode->i_reparse_tag & 0x80000000)) + blob_size -= GUID_SIZE; + rpbuf->rpdatalen = cpu_to_le16(blob_size); + rpbuf->rpreserved = cpu_to_le16(inode->i_rp_reserved); +} + +/* Parse the buffer for a symbolic link or junction reparse point and fill in a + * 'struct link_reparse_point'. */ +int +parse_link_reparse_point(const struct reparse_buffer_disk *rpbuf, u16 rpbuflen, + struct link_reparse_point *link) +{ + u16 substitute_name_offset; + u16 print_name_offset; + const u8 *data; + + link->rptag = le32_to_cpu(rpbuf->rptag); + + /* Not a symbolic link or junction? */ + if (link->rptag != WIM_IO_REPARSE_TAG_SYMLINK && + link->rptag != WIM_IO_REPARSE_TAG_MOUNT_POINT) + return WIMLIB_ERR_INVALID_REPARSE_DATA; + + /* Is the buffer too small to be a symlink or a junction? */ + if (rpbuflen < offsetof(struct reparse_buffer_disk, link.junction.data)) + return WIMLIB_ERR_INVALID_REPARSE_DATA; + + link->rpreserved = le16_to_cpu(rpbuf->rpreserved); + link->substitute_name_nbytes = le16_to_cpu(rpbuf->link.substitute_name_nbytes); + substitute_name_offset = le16_to_cpu(rpbuf->link.substitute_name_offset); + link->print_name_nbytes = le16_to_cpu(rpbuf->link.print_name_nbytes); + print_name_offset = le16_to_cpu(rpbuf->link.print_name_offset); + + /* The names must be properly sized and aligned. */ + if ((substitute_name_offset | print_name_offset | + link->substitute_name_nbytes | link->print_name_nbytes) & 1) + return WIMLIB_ERR_INVALID_REPARSE_DATA; + + if (link->rptag == WIM_IO_REPARSE_TAG_SYMLINK) { + if (rpbuflen < offsetof(struct reparse_buffer_disk, link.symlink.data)) + return WIMLIB_ERR_INVALID_REPARSE_DATA; + link->symlink_flags = le32_to_cpu(rpbuf->link.symlink.flags); + data = rpbuf->link.symlink.data; + } else { + data = rpbuf->link.junction.data; + } + + /* Verify that the names don't overflow the buffer. */ + if ((data - (const u8 *)rpbuf) + substitute_name_offset + + link->substitute_name_nbytes > rpbuflen) + return WIMLIB_ERR_INVALID_REPARSE_DATA; + + if ((data - (const u8 *)rpbuf) + print_name_offset + + link->print_name_nbytes > rpbuflen) + return WIMLIB_ERR_INVALID_REPARSE_DATA; + + /* Save the name pointers. */ + link->substitute_name = (utf16lechar *)&data[substitute_name_offset]; + link->print_name = (utf16lechar *)&data[print_name_offset]; + return 0; +} + +/* Translate a 'struct link_reparse_point' into a reparse point buffer. */ +int +make_link_reparse_point(const struct link_reparse_point *link, + struct reparse_buffer_disk *rpbuf, u16 *rpbuflen_ret) +{ + u8 *data; + + if (link->rptag == WIM_IO_REPARSE_TAG_SYMLINK) + data = rpbuf->link.symlink.data; + else if (link->rptag == WIM_IO_REPARSE_TAG_MOUNT_POINT) + data = rpbuf->link.junction.data; + else /* Callers should forbid this case, but check anyway. */ + return WIMLIB_ERR_INVALID_REPARSE_DATA; + + /* Check if the names are too long to fit in a reparse point. */ + if ((data - (u8 *)rpbuf) + link->substitute_name_nbytes + + link->print_name_nbytes + + 2 * sizeof(utf16lechar) > REPARSE_POINT_MAX_SIZE) + return WIMLIB_ERR_INVALID_REPARSE_DATA; + + rpbuf->rptag = cpu_to_le32(link->rptag); + rpbuf->rpreserved = cpu_to_le16(link->rpreserved); + rpbuf->link.substitute_name_offset = cpu_to_le16(0); + rpbuf->link.substitute_name_nbytes = cpu_to_le16(link->substitute_name_nbytes); + rpbuf->link.print_name_offset = cpu_to_le16(link->substitute_name_nbytes + + sizeof(utf16lechar)); + rpbuf->link.print_name_nbytes = cpu_to_le16(link->print_name_nbytes); + + if (link->rptag == WIM_IO_REPARSE_TAG_SYMLINK) + rpbuf->link.symlink.flags = cpu_to_le32(link->symlink_flags); + + /* We null-terminate the substitute and print names, although this isn't + * strictly necessary. Note that the nbytes fields do not include the + * null terminators. */ + data = mempcpy(data, link->substitute_name, link->substitute_name_nbytes); + *(utf16lechar *)data = cpu_to_le16(0); + data += sizeof(utf16lechar); + data = mempcpy(data, link->print_name, link->print_name_nbytes); + *(utf16lechar *)data = cpu_to_le16(0); + data += sizeof(utf16lechar); + rpbuf->rpdatalen = cpu_to_le16(data - rpbuf->rpdata); + + *rpbuflen_ret = data - (u8 *)rpbuf; + return 0; +} + +/* UNIX symlink <=> Windows reparse point translation */ +#ifndef _WIN32 + +/* Retrieve the inode's reparse point buffer into @rpbuf and @rpbuflen_ret. + * This gets the reparse data from @blob if specified, otherwise from the + * inode's reparse point stream. The inode's streams must be resolved. */ +static int +wim_inode_get_reparse_point(const struct wim_inode *inode, + struct reparse_buffer_disk *rpbuf, + u16 *rpbuflen_ret, + const struct blob_descriptor *blob) +{ + int ret; + u16 blob_size = 0; + + if (!blob) { + const struct wim_inode_stream *strm; + + strm = inode_get_unnamed_stream(inode, STREAM_TYPE_REPARSE_POINT); + if (strm) + blob = stream_blob_resolved(strm); + } + + if (blob) { + if (blob->size > REPARSE_DATA_MAX_SIZE) + return WIMLIB_ERR_INVALID_REPARSE_DATA; + blob_size = blob->size; + ret = read_blob_into_buf(blob, rpbuf->rpdata); + if (ret) + return ret; + } + + complete_reparse_point(rpbuf, inode, blob_size); + + *rpbuflen_ret = REPARSE_DATA_OFFSET + blob_size; + return 0; +} + +static void +copy(char **buf_p, size_t *bufsize_p, const char *src, size_t src_size) +{ + size_t n = min(*bufsize_p, src_size); + memcpy(*buf_p, src, n); + *buf_p += n; + *bufsize_p -= n; +} + +/* + * Get a UNIX-style symlink target from the WIM inode for a reparse point. + * + * @inode + * The inode from which to read the symlink. If not a symbolic link or + * junction reparse point, then -EINVAL will be returned. + * @buf + * Buffer into which to place the link target. + * @bufsize + * Available space in @buf, in bytes. + * @blob + * If not NULL, the blob from which to read the reparse data. Otherwise, + * the reparse data will be read from the reparse point stream of @inode. + * @altroot + * If @altroot_len != 0 and the link is an absolute link that was stored as + * "fixed", then prepend this path to the link target. + * @altroot_len + * Length of the @altroot string or 0. + * + * Similar to POSIX readlink(), this function writes as much of the symlink + * target as possible (up to @bufsize bytes) to @buf with no null terminator and + * returns the number of bytes written or a negative errno value on error. Note + * that the target is truncated and @bufsize is returned in the overflow case. + */ +int +wim_inode_readlink(const struct wim_inode *inode, char *buf, size_t bufsize, + const struct blob_descriptor *blob, + const char *altroot, size_t altroot_len) +{ + struct reparse_buffer_disk rpbuf; + u16 rpbuflen; + struct link_reparse_point link; + char *target_buffer; + char *target; + size_t target_len; + char *buf_ptr; + bool rpfix_ok = false; + + /* Not a symbolic link or junction? */ + if (!inode_is_symlink(inode)) + return -EINVAL; + + /* Retrieve the native Windows "substitute name". */ + + if (wim_inode_get_reparse_point(inode, &rpbuf, &rpbuflen, blob)) + return -EIO; + + if (parse_link_reparse_point(&rpbuf, rpbuflen, &link)) + return -EINVAL; + + /* Translate the substitute name to a multibyte string. */ + if (utf16le_to_tstr(link.substitute_name, link.substitute_name_nbytes, + &target_buffer, &target_len)) + return -errno; + target = target_buffer; + + /* + * The substitute name is a native Windows NT path. There are two cases: + * + * 1. The reparse point is a symlink (rptag=WIM_IO_REPARSE_TAG_SYMLINK) + * and SYMBOLIC_LINK_RELATIVE is set. Windows resolves the path + * relative to the directory containing the reparse point file. In + * this case, we just translate the path separators. + * 2. Otherwise, Windows resolves the path from the root of the Windows + * NT kernel object namespace. In this case, we attempt to strip the + * device name, in addition to translating the path separators; e.g. + * "\??\C:\Users\Public" is translated to "/Users/Public". + * + * Also in case (2) the link target may have been stored as "fixed", + * meaning that with the device portion stripped off it is effectively + * "relative to the root of the WIM image". If this is the case, and if + * the caller provided an alternate root directory, then rewrite the + * link to be relative to that directory. + */ + if (!link_is_relative_symlink(&link)) { + static const char *const nt_root_dirs[] = { + "\\??\\", "\\DosDevices\\", "\\Device\\", + }; + for (size_t i = 0; i < ARRAY_LEN(nt_root_dirs); i++) { + size_t len = strlen(nt_root_dirs[i]); + if (!strncmp(target, nt_root_dirs[i], len)) { + char *p = target + len; + while (*p == '\\') + p++; + while (*p && *p != '\\') + p++; + target_len -= (p - target); + target = p; + break; + } + } + + if (!(inode->i_rp_flags & WIM_RP_FLAG_NOT_FIXED)) + rpfix_ok = true; + } + + /* Translate backslashes (Windows NT path separator) to forward slashes + * (UNIX path separator). In addition, translate forwards slashes to + * backslashes; this enables lossless handling of UNIX symbolic link + * targets that contain the backslash character. */ + for (char *p = target; *p; p++) { + if (*p == '\\') + *p = '/'; + else if (*p == '/') + *p = '\\'; + } + + /* Copy as much of the link target as possible to the output buffer and + * return the number of bytes copied. */ + buf_ptr = buf; + if (rpfix_ok && altroot_len != 0) { + copy(&buf_ptr, &bufsize, altroot, altroot_len); + } else if (target_len == 0) { + /* An absolute link target that was made relative to the same + * directory pointed to will end up empty if the original target + * did not have a trailing slash. Here, we are reading this + * adjusted link target without prefixing it. This usually + * doesn't happen, but if it does then we need to change it to + * "/" so that it is a valid target. */ + target = "/"; + target_len = 1; + } + copy(&buf_ptr, &bufsize, target, target_len); + FREE(target_buffer); + return buf_ptr - buf; +} + +/* Given a UNIX-style symbolic link target, create a Windows-style reparse point + * buffer and assign it to the specified inode. */ +int +wim_inode_set_symlink(struct wim_inode *inode, const char *_target, + struct blob_table *blob_table) + +{ + int ret; + utf16lechar *target; + size_t target_nbytes; + struct link_reparse_point link; + struct reparse_buffer_disk rpbuf; + u16 rpbuflen; + + /* Translate the link target to UTF-16LE. */ + ret = tstr_to_utf16le(_target, strlen(_target), &target, &target_nbytes); + if (ret) + return ret; + + /* Translate forward slashes (UNIX path separator) to backslashes + * (Windows NT path separator). In addition, translate backslashes to + * forward slashes; this enables lossless handling of UNIX symbolic link + * targets that contain the backslash character. */ + for (utf16lechar *p = target; *p; p++) { + if (*p == cpu_to_le16('/')) + *p = cpu_to_le16('\\'); + else if (*p == cpu_to_le16('\\')) + *p = cpu_to_le16('/'); + } + + link.rptag = WIM_IO_REPARSE_TAG_SYMLINK; + link.rpreserved = 0; + + /* Note: an absolute link that was rewritten to be relative to another + * directory is assumed to either be empty or to have a leading slash. + * See unix_relativize_link_target(). */ + if (*target == cpu_to_le16('\\') || !*target) { + /* + * UNIX link target was absolute. In this case we represent the + * link as a symlink reparse point with SYMBOLIC_LINK_RELATIVE + * cleared. For this to work we need to assign it a path that + * can be resolved from the root of the Windows NT kernel object + * namespace. We do this by using "\??\C:" as a dummy prefix. + * + * Note that we could instead represent UNIX absolute links by + * setting SYMBOLIC_LINK_RELATIVE and then leaving the path + * backslash-prefixed like "\Users\Public". On Windows this is + * valid and denotes a path relative to the root of the + * filesystem on which the reparse point resides. The problem + * with this is that neither WIMGAPI nor wimlib (on Windows) + * will do "reparse point fixups" when extracting such links + * (modifying the link target to point into the actual + * extraction directory). So for the greatest cross-platform + * consistency, we have to use the fake C: drive approach. + */ + static const utf16lechar prefix[6] = { + cpu_to_le16('\\'), + cpu_to_le16('?'), + cpu_to_le16('?'), + cpu_to_le16('\\'), + cpu_to_le16('C'), + cpu_to_le16(':'), + }; + + /* Do not show \??\ in print name */ + const size_t num_unprintable_chars = 4; + + link.symlink_flags = 0; + link.substitute_name_nbytes = sizeof(prefix) + target_nbytes; + link.substitute_name = alloca(link.substitute_name_nbytes); + memcpy(link.substitute_name, prefix, sizeof(prefix)); + memcpy(link.substitute_name + ARRAY_LEN(prefix), target, target_nbytes); + link.print_name_nbytes = link.substitute_name_nbytes - + (num_unprintable_chars * sizeof(utf16lechar)); + link.print_name = link.substitute_name + num_unprintable_chars; + } else { + /* UNIX link target was relative. In this case we represent the + * link as a symlink reparse point with SYMBOLIC_LINK_RELATIVE + * set. This causes Windows to interpret the link relative to + * the directory containing the reparse point file. */ + link.symlink_flags = SYMBOLIC_LINK_RELATIVE; + link.substitute_name_nbytes = target_nbytes; + link.substitute_name = target; + link.print_name_nbytes = target_nbytes; + link.print_name = target; + } + + /* Generate the reparse buffer. */ + ret = make_link_reparse_point(&link, &rpbuf, &rpbuflen); + if (ret) + goto out_free_target; + + /* Save the reparse data with the inode. */ + ret = WIMLIB_ERR_NOMEM; + if (!inode_add_stream_with_data(inode, + STREAM_TYPE_REPARSE_POINT, + NO_STREAM_NAME, + rpbuf.rpdata, + rpbuflen - REPARSE_DATA_OFFSET, + blob_table)) + goto out_free_target; + + /* The inode is now a reparse point. */ + inode->i_reparse_tag = link.rptag; + inode->i_attributes &= ~FILE_ATTRIBUTE_NORMAL; + inode->i_attributes |= FILE_ATTRIBUTE_REPARSE_POINT; + + ret = 0; +out_free_target: + FREE(target); + return ret; +} + +#endif /* !_WIN32 */ diff --git a/src/wimlib/resource.c b/src/wimlib/resource.c new file mode 100644 index 00000000..a2aee42d --- /dev/null +++ b/src/wimlib/resource.c @@ -0,0 +1,1463 @@ +/* + * resource.c + * + * Code for reading blobs and resources, including compressed WIM resources. + */ + +/* + * Copyright (C) 2012, 2013, 2015 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <errno.h> +#include <fcntl.h> +#include <unistd.h> + +#include "wimlib/alloca.h" +#include "wimlib/assert.h" +#include "wimlib/bitops.h" +#include "wimlib/blob_table.h" +#include "wimlib/endianness.h" +#include "wimlib/error.h" +#include "wimlib/file_io.h" +#include "wimlib/ntfs_3g.h" +#include "wimlib/resource.h" +#include "wimlib/sha1.h" +#include "wimlib/wim.h" +#include "wimlib/win32.h" + +/* + * Compressed WIM resources + * + * A compressed resource in a WIM consists of a sequence of chunks. Each chunk + * decompresses to the same size except possibly for the last, which + * decompresses to the remaining size. Chunks that did not compress to less + * than their original size are stored uncompressed. + * + * We support three variations on this resource format, independently of the + * compression type and chunk size which can vary as well: + * + * - Original resource format: immediately before the compressed chunks, the + * "chunk table" provides the offset, in bytes relative to the end of the + * chunk table, of the start of each compressed chunk, except for the first + * chunk which is omitted as it always has an offset of 0. Chunk table + * entries are 32-bit for resources < 4 GiB uncompressed and 64-bit for + * resources >= 4 GiB uncompressed. + * + * - Solid resource format (distinguished by the use of WIM_RESHDR_FLAG_SOLID + * instead of WIM_RESHDR_FLAG_COMPRESSED): similar to the original format, but + * the resource begins with a 16-byte header which specifies the uncompressed + * size of the resource, the compression type, and the chunk size. (In the + * original format, these values were instead determined from outside the + * resource itself, from the blob table and the WIM file header.) In addition, + * in this format the entries in the chunk table contain compressed chunk + * sizes rather than offsets. As a consequence of this, the chunk table + * entries are always 32-bit and there is an entry for chunk 0. + * + * - Pipable resource format (wimlib extension; all resources in a pipable WIM + * have this format): similar to the original format, but the chunk table is + * at the end of the resource rather than the beginning, and each compressed + * chunk is prefixed with its compressed size as a 32-bit integer. This + * format allows a resource to be written without rewinding. + */ + + +struct data_range { + u64 offset; + u64 size; +}; + +static int +decompress_chunk(const void *cbuf, u32 chunk_csize, u8 *ubuf, u32 chunk_usize, + struct wimlib_decompressor *decompressor, bool recover_data) +{ + int res = wimlib_decompress(cbuf, chunk_csize, ubuf, chunk_usize, + decompressor); + if (likely(res == 0)) + return 0; + + if (recover_data) { + WARNING("Failed to decompress data! Continuing anyway since data recovery mode is enabled."); + + /* Continue on with *something*. In the worst case just use a + * zeroed buffer. But, try to fill as much of it with + * decompressed data as we can. This works because if the + * corruption isn't located right at the beginning of the + * compressed chunk, wimlib_decompress() may write some correct + * output at the beginning even if it fails later. */ + memset(ubuf, 0, chunk_usize); + (void)wimlib_decompress(cbuf, chunk_csize, ubuf, + chunk_usize, decompressor); + return 0; + } + ERROR("Failed to decompress data!"); + errno = EINVAL; + return WIMLIB_ERR_DECOMPRESSION; +} + +/* + * Read data from a compressed WIM resource. + * + * @rdesc + * Description of the compressed WIM resource to read from. + * @ranges + * Nonoverlapping, nonempty ranges of the uncompressed resource data to + * read, sorted by increasing offset. + * @num_ranges + * Number of ranges in @ranges; must be at least 1. + * @cb + * Structure which provides the consume_chunk callback into which to feed + * the data being read. Each call provides the next chunk of the requested + * data, uncompressed. Each chunk will be nonempty and will not cross + * range boundaries but otherwise will be of unspecified size. + * @recover_data + * If a chunk can't be fully decompressed due to being corrupted, continue + * with whatever data can be recovered rather than return an error. + * + * Possible return values: + * + * WIMLIB_ERR_SUCCESS (0) + * WIMLIB_ERR_READ (errno set) + * WIMLIB_ERR_UNEXPECTED_END_OF_FILE (errno set to EINVAL) + * WIMLIB_ERR_NOMEM (errno set to ENOMEM) + * WIMLIB_ERR_DECOMPRESSION (errno set to EINVAL) + * WIMLIB_ERR_INVALID_CHUNK_SIZE (errno set to EINVAL) + * + * or other error code returned by the callback function. + */ +static int +read_compressed_wim_resource(const struct wim_resource_descriptor * const rdesc, + const struct data_range * const ranges, + const size_t num_ranges, + const struct consume_chunk_callback *cb, + bool recover_data) +{ + int ret; + u64 *chunk_offsets = NULL; + u8 *ubuf = NULL; + void *cbuf = NULL; + bool chunk_offsets_malloced = false; + bool ubuf_malloced = false; + bool cbuf_malloced = false; + struct wimlib_decompressor *decompressor = NULL; + + /* Sanity checks */ + wimlib_assert(num_ranges != 0); + for (size_t i = 0; i < num_ranges; i++) { + wimlib_assert(ranges[i].offset + ranges[i].size > ranges[i].offset && + ranges[i].offset + ranges[i].size <= rdesc->uncompressed_size); + } + for (size_t i = 0; i < num_ranges - 1; i++) + wimlib_assert(ranges[i].offset + ranges[i].size <= ranges[i + 1].offset); + + /* Get the offsets of the first and last bytes of the read. */ + const u64 first_offset = ranges[0].offset; + const u64 last_offset = ranges[num_ranges - 1].offset + ranges[num_ranges - 1].size - 1; + + /* Get the file descriptor for the WIM. */ + struct filedes * const in_fd = &rdesc->wim->in_fd; + + /* Determine if we're reading a pipable resource from a pipe or not. */ + const bool is_pipe_read = (rdesc->is_pipable && !filedes_is_seekable(in_fd)); + + /* Determine if the chunk table is in an alternate format. */ + const bool alt_chunk_table = (rdesc->flags & WIM_RESHDR_FLAG_SOLID) + && !is_pipe_read; + + /* Get the maximum size of uncompressed chunks in this resource, which + * we require be a power of 2. */ + u64 cur_read_offset = rdesc->offset_in_wim; + int ctype = rdesc->compression_type; + u32 chunk_size = rdesc->chunk_size; + if (alt_chunk_table) { + /* Alternate chunk table format. Its header specifies the chunk + * size and compression format. Note: it could be read here; + * however, the relevant data was already loaded into @rdesc by + * read_blob_table(). */ + cur_read_offset += sizeof(struct alt_chunk_table_header_disk); + } + + if (unlikely(!is_power_of_2(chunk_size))) { + ERROR("Invalid compressed resource: " + "expected power-of-2 chunk size (got %"PRIu32")", + chunk_size); + ret = WIMLIB_ERR_INVALID_CHUNK_SIZE; + errno = EINVAL; + goto out_cleanup; + } + + /* Get valid decompressor. */ + if (likely(ctype == rdesc->wim->decompressor_ctype && + chunk_size == rdesc->wim->decompressor_max_block_size)) + { + /* Cached decompressor. */ + decompressor = rdesc->wim->decompressor; + rdesc->wim->decompressor_ctype = WIMLIB_COMPRESSION_TYPE_NONE; + rdesc->wim->decompressor = NULL; + } else { + ret = wimlib_create_decompressor(ctype, chunk_size, + &decompressor); + if (unlikely(ret)) { + if (ret != WIMLIB_ERR_NOMEM) + errno = EINVAL; + goto out_cleanup; + } + } + + const u32 chunk_order = bsr32(chunk_size); + + /* Calculate the total number of chunks the resource is divided into. */ + const u64 num_chunks = (rdesc->uncompressed_size + chunk_size - 1) >> chunk_order; + + /* Calculate the 0-based indices of the first and last chunks containing + * data that needs to be passed to the callback. */ + const u64 first_needed_chunk = first_offset >> chunk_order; + const u64 last_needed_chunk = last_offset >> chunk_order; + + /* Calculate the 0-based index of the first chunk that actually needs to + * be read. This is normally first_needed_chunk, but for pipe reads we + * must always start from the 0th chunk. */ + const u64 read_start_chunk = (is_pipe_read ? 0 : first_needed_chunk); + + /* Calculate the number of chunk offsets that are needed for the chunks + * being read. */ + const u64 num_needed_chunk_offsets = + last_needed_chunk - read_start_chunk + 1 + + (last_needed_chunk < num_chunks - 1); + + /* Calculate the number of entries in the chunk table. Normally, it's + * one less than the number of chunks, since the first chunk has no + * entry. But in the alternate chunk table format, the chunk entries + * contain chunk sizes, not offsets, and there is one per chunk. */ + const u64 num_chunk_entries = (alt_chunk_table ? num_chunks : num_chunks - 1); + + /* Set the size of each chunk table entry based on the resource's + * uncompressed size. */ + const u64 chunk_entry_size = get_chunk_entry_size(rdesc->uncompressed_size, + alt_chunk_table); + + /* Calculate the size of the chunk table in bytes. */ + const u64 chunk_table_size = num_chunk_entries * chunk_entry_size; + + /* Calculate the size of the chunk table in bytes, including the header + * in the case of the alternate chunk table format. */ + const u64 chunk_table_full_size = + (alt_chunk_table) ? chunk_table_size + sizeof(struct alt_chunk_table_header_disk) + : chunk_table_size; + + if (!is_pipe_read) { + /* Read the needed chunk table entries into memory and use them + * to initialize the chunk_offsets array. */ + + u64 first_chunk_entry_to_read; + u64 num_chunk_entries_to_read; + + if (alt_chunk_table) { + /* The alternate chunk table contains chunk sizes, not + * offsets, so we always must read all preceding entries + * in order to determine offsets. */ + first_chunk_entry_to_read = 0; + num_chunk_entries_to_read = last_needed_chunk + 1; + } else { + + num_chunk_entries_to_read = last_needed_chunk - read_start_chunk + 1; + + /* The first chunk has no explicit chunk table entry. */ + if (read_start_chunk == 0) { + num_chunk_entries_to_read--; + first_chunk_entry_to_read = 0; + } else { + first_chunk_entry_to_read = read_start_chunk - 1; + } + + /* Unless we're reading the final chunk of the resource, + * we need the offset of the chunk following the last + * needed chunk so that the compressed size of the last + * needed chunk can be computed. */ + if (last_needed_chunk < num_chunks - 1) + num_chunk_entries_to_read++; + } + + const u64 chunk_offsets_alloc_size = + max(num_chunk_entries_to_read, + num_needed_chunk_offsets) * sizeof(chunk_offsets[0]); + + if (unlikely((size_t)chunk_offsets_alloc_size != chunk_offsets_alloc_size)) { + errno = ENOMEM; + goto oom; + } + + if (likely(chunk_offsets_alloc_size <= STACK_MAX)) { + chunk_offsets = alloca(chunk_offsets_alloc_size); + } else { + chunk_offsets = MALLOC(chunk_offsets_alloc_size); + if (unlikely(!chunk_offsets)) + goto oom; + chunk_offsets_malloced = true; + } + + const size_t chunk_table_size_to_read = + num_chunk_entries_to_read * chunk_entry_size; + + const u64 file_offset_of_needed_chunk_entries = + cur_read_offset + + (first_chunk_entry_to_read * chunk_entry_size) + + (rdesc->is_pipable ? (rdesc->size_in_wim - chunk_table_size) : 0); + + void * const chunk_table_data = + (u8*)chunk_offsets + + chunk_offsets_alloc_size - + chunk_table_size_to_read; + + ret = full_pread(in_fd, chunk_table_data, chunk_table_size_to_read, + file_offset_of_needed_chunk_entries); + if (unlikely(ret)) + goto read_error; + + /* Now fill in chunk_offsets from the entries we have read in + * chunk_tab_data. We break aliasing rules here to avoid having + * to allocate yet another array. */ + typedef le64 __attribute__((may_alias)) aliased_le64_t; + typedef le32 __attribute__((may_alias)) aliased_le32_t; + u64 * chunk_offsets_p = chunk_offsets; + + if (alt_chunk_table) { + u64 cur_offset = 0; + aliased_le32_t *raw_entries = chunk_table_data; + + for (size_t i = 0; i < num_chunk_entries_to_read; i++) { + u32 entry = le32_to_cpu(raw_entries[i]); + if (i >= read_start_chunk) + *chunk_offsets_p++ = cur_offset; + cur_offset += entry; + } + if (last_needed_chunk < num_chunks - 1) + *chunk_offsets_p = cur_offset; + } else { + if (read_start_chunk == 0) + *chunk_offsets_p++ = 0; + + if (chunk_entry_size == 4) { + aliased_le32_t *raw_entries = chunk_table_data; + for (size_t i = 0; i < num_chunk_entries_to_read; i++) + *chunk_offsets_p++ = le32_to_cpu(raw_entries[i]); + } else { + aliased_le64_t *raw_entries = chunk_table_data; + for (size_t i = 0; i < num_chunk_entries_to_read; i++) + *chunk_offsets_p++ = le64_to_cpu(raw_entries[i]); + } + } + + /* Set offset to beginning of first chunk to read. */ + cur_read_offset += chunk_offsets[0]; + if (rdesc->is_pipable) + cur_read_offset += read_start_chunk * sizeof(struct pwm_chunk_hdr); + else + cur_read_offset += chunk_table_size; + } + + /* Allocate buffer for holding the uncompressed data of each chunk. */ + if (chunk_size <= STACK_MAX) { + ubuf = alloca(chunk_size); + } else { + ubuf = MALLOC(chunk_size); + if (unlikely(!ubuf)) + goto oom; + ubuf_malloced = true; + } + + /* Allocate a temporary buffer for reading compressed chunks, each of + * which can be at most @chunk_size - 1 bytes. This excludes compressed + * chunks that are a full @chunk_size bytes, which are actually stored + * uncompressed. */ + if (chunk_size - 1 <= STACK_MAX) { + cbuf = alloca(chunk_size - 1); + } else { + cbuf = MALLOC(chunk_size - 1); + if (unlikely(!cbuf)) + goto oom; + cbuf_malloced = true; + } + + /* Set current data range. */ + const struct data_range *cur_range = ranges; + const struct data_range * const end_range = &ranges[num_ranges]; + u64 cur_range_pos = cur_range->offset; + u64 cur_range_end = cur_range->offset + cur_range->size; + + /* Read and process each needed chunk. */ + for (u64 i = read_start_chunk; i <= last_needed_chunk; i++) { + + /* Calculate uncompressed size of next chunk. */ + u32 chunk_usize; + if ((i == num_chunks - 1) && (rdesc->uncompressed_size & (chunk_size - 1))) + chunk_usize = (rdesc->uncompressed_size & (chunk_size - 1)); + else + chunk_usize = chunk_size; + + /* Calculate compressed size of next chunk. */ + u32 chunk_csize; + if (is_pipe_read) { + struct pwm_chunk_hdr chunk_hdr; + + ret = full_pread(in_fd, &chunk_hdr, + sizeof(chunk_hdr), cur_read_offset); + if (unlikely(ret)) + goto read_error; + chunk_csize = le32_to_cpu(chunk_hdr.compressed_size); + } else { + if (i == num_chunks - 1) { + chunk_csize = rdesc->size_in_wim - + chunk_table_full_size - + chunk_offsets[i - read_start_chunk]; + if (rdesc->is_pipable) + chunk_csize -= num_chunks * sizeof(struct pwm_chunk_hdr); + } else { + chunk_csize = chunk_offsets[i + 1 - read_start_chunk] - + chunk_offsets[i - read_start_chunk]; + } + } + if (unlikely(chunk_csize == 0 || chunk_csize > chunk_usize)) { + ERROR("Invalid chunk size in compressed resource!"); + errno = EINVAL; + ret = WIMLIB_ERR_DECOMPRESSION; + goto out_cleanup; + } + if (rdesc->is_pipable) + cur_read_offset += sizeof(struct pwm_chunk_hdr); + + /* Offsets in the uncompressed resource at which this chunk + * starts and ends. */ + const u64 chunk_start_offset = i << chunk_order; + const u64 chunk_end_offset = chunk_start_offset + chunk_usize; + + if (chunk_end_offset <= cur_range_pos) { + + /* The next range does not require data in this chunk, + * so skip it. */ + cur_read_offset += chunk_csize; + if (is_pipe_read) { + u8 dummy; + + ret = full_pread(in_fd, &dummy, 1, cur_read_offset - 1); + if (unlikely(ret)) + goto read_error; + } + } else { + + /* Read the chunk and feed data to the callback + * function. */ + u8 *read_buf; + + if (chunk_csize == chunk_usize) + read_buf = ubuf; + else + read_buf = cbuf; + + ret = full_pread(in_fd, + read_buf, + chunk_csize, + cur_read_offset); + if (unlikely(ret)) + goto read_error; + + if (read_buf == cbuf) { + ret = decompress_chunk(cbuf, chunk_csize, + ubuf, chunk_usize, + decompressor, + recover_data); + if (unlikely(ret)) + goto out_cleanup; + } + cur_read_offset += chunk_csize; + + /* At least one range requires data in this chunk. */ + do { + size_t start, end, size; + + /* Calculate how many bytes of data should be + * sent to the callback function, taking into + * account that data sent to the callback + * function must not overlap range boundaries. + */ + start = cur_range_pos - chunk_start_offset; + end = min(cur_range_end, chunk_end_offset) - chunk_start_offset; + size = end - start; + + ret = consume_chunk(cb, &ubuf[start], size); + if (unlikely(ret)) + goto out_cleanup; + + cur_range_pos += size; + if (cur_range_pos == cur_range_end) { + /* Advance to next range. */ + if (++cur_range == end_range) { + cur_range_pos = ~0ULL; + } else { + cur_range_pos = cur_range->offset; + cur_range_end = cur_range->offset + cur_range->size; + } + } + } while (cur_range_pos < chunk_end_offset); + } + } + + if (is_pipe_read && + last_offset == rdesc->uncompressed_size - 1 && + chunk_table_size) + { + u8 dummy; + /* If reading a pipable resource from a pipe and the full data + * was requested, skip the chunk table at the end so that the + * file descriptor is fully clear of the resource after this + * returns. */ + cur_read_offset += chunk_table_size; + ret = full_pread(in_fd, &dummy, 1, cur_read_offset - 1); + if (unlikely(ret)) + goto read_error; + } + ret = 0; + +out_cleanup: + if (decompressor) { + wimlib_free_decompressor(rdesc->wim->decompressor); + rdesc->wim->decompressor = decompressor; + rdesc->wim->decompressor_ctype = ctype; + rdesc->wim->decompressor_max_block_size = chunk_size; + } + if (chunk_offsets_malloced) + FREE(chunk_offsets); + if (ubuf_malloced) + FREE(ubuf); + if (cbuf_malloced) + FREE(cbuf); + return ret; + +oom: + ERROR("Out of memory while reading compressed WIM resource"); + ret = WIMLIB_ERR_NOMEM; + goto out_cleanup; + +read_error: + ERROR_WITH_ERRNO("Error reading data from WIM file"); + goto out_cleanup; +} + +/* Read raw data from a file descriptor at the specified offset, feeding the + * data in nonempty chunks into the specified callback function. */ +static int +read_raw_file_data(struct filedes *in_fd, u64 offset, u64 size, + const struct consume_chunk_callback *cb, + const tchar *filename) +{ + u8 buf[BUFFER_SIZE]; + size_t bytes_to_read; + int ret; + + while (size) { + bytes_to_read = min(sizeof(buf), size); + ret = full_pread(in_fd, buf, bytes_to_read, offset); + if (unlikely(ret)) + goto read_error; + ret = consume_chunk(cb, buf, bytes_to_read); + if (unlikely(ret)) + return ret; + size -= bytes_to_read; + offset += bytes_to_read; + } + return 0; + +read_error: + if (!filename) { + ERROR_WITH_ERRNO("Error reading data from WIM file"); + } else if (ret == WIMLIB_ERR_UNEXPECTED_END_OF_FILE) { + ERROR("\"%"TS"\": File was concurrently truncated", filename); + ret = WIMLIB_ERR_CONCURRENT_MODIFICATION_DETECTED; + } else { + ERROR_WITH_ERRNO("\"%"TS"\": Error reading data", filename); + } + return ret; +} + +/* A consume_chunk implementation which simply concatenates all chunks into an + * in-memory buffer. */ +static int +bufferer_cb(const void *chunk, size_t size, void *_ctx) +{ + void **buf_p = _ctx; + + *buf_p = mempcpy(*buf_p, chunk, size); + return 0; +} + +/* + * Read @size bytes at @offset in the WIM resource described by @rdesc and feed + * the data into the @cb callback function. + * + * @offset and @size are assumed to have already been validated against the + * resource's uncompressed size. + * + * Returns 0 on success; or the first nonzero value returned by the callback + * function; or a nonzero wimlib error code with errno set as well. + */ +static int +read_partial_wim_resource(const struct wim_resource_descriptor *rdesc, + const u64 offset, const u64 size, + const struct consume_chunk_callback *cb, + bool recover_data) +{ + if (rdesc->flags & (WIM_RESHDR_FLAG_COMPRESSED | + WIM_RESHDR_FLAG_SOLID)) + { + /* Compressed resource */ + if (unlikely(!size)) + return 0; + struct data_range range = { + .offset = offset, + .size = size, + }; + return read_compressed_wim_resource(rdesc, &range, 1, cb, + recover_data); + } + + /* Uncompressed resource */ + return read_raw_file_data(&rdesc->wim->in_fd, + rdesc->offset_in_wim + offset, + size, cb, NULL); +} + +/* Read the specified range of uncompressed data from the specified blob, which + * must be located in a WIM file, into the specified buffer. */ +int +read_partial_wim_blob_into_buf(const struct blob_descriptor *blob, + u64 offset, size_t size, void *buf) +{ + struct consume_chunk_callback cb = { + .func = bufferer_cb, + .ctx = &buf, + }; + return read_partial_wim_resource(blob->rdesc, + blob->offset_in_res + offset, + size, + &cb, false); +} + +static int +noop_cb(const void *chunk, size_t size, void *_ctx) +{ + return 0; +} + +/* Skip over the data of the specified WIM resource. */ +int +skip_wim_resource(const struct wim_resource_descriptor *rdesc) +{ + static const struct consume_chunk_callback cb = { + .func = noop_cb, + }; + return read_partial_wim_resource(rdesc, 0, + rdesc->uncompressed_size, &cb, false); +} + +static int +read_wim_blob_prefix(const struct blob_descriptor *blob, u64 size, + const struct consume_chunk_callback *cb, bool recover_data) +{ + return read_partial_wim_resource(blob->rdesc, blob->offset_in_res, + size, cb, recover_data); +} + +/* This function handles reading blob data that is located in an external file, + * such as a file that has been added to the WIM image through execution of a + * wimlib_add_command. + * + * This assumes the file can be accessed using the standard POSIX open(), + * read(), and close(). On Windows this will not necessarily be the case (since + * the file may need FILE_FLAG_BACKUP_SEMANTICS to be opened, or the file may be + * encrypted), so Windows uses its own code for its equivalent case. */ +static int +read_file_on_disk_prefix(const struct blob_descriptor *blob, u64 size, + const struct consume_chunk_callback *cb, + bool recover_data) +{ + int ret; + int raw_fd; + struct filedes fd; + + raw_fd = topen(blob->file_on_disk, O_BINARY | O_RDONLY); + if (unlikely(raw_fd < 0)) { + ERROR_WITH_ERRNO("Can't open \"%"TS"\"", blob->file_on_disk); + return WIMLIB_ERR_OPEN; + } + filedes_init(&fd, raw_fd); + ret = read_raw_file_data(&fd, 0, size, cb, blob->file_on_disk); + filedes_close(&fd); + return ret; +} + +#ifdef WITH_FUSE +static int +read_staging_file_prefix(const struct blob_descriptor *blob, u64 size, + const struct consume_chunk_callback *cb, + bool recover_data) +{ + int raw_fd; + struct filedes fd; + int ret; + + raw_fd = openat(blob->staging_dir_fd, blob->staging_file_name, + O_RDONLY | O_NOFOLLOW); + if (unlikely(raw_fd < 0)) { + ERROR_WITH_ERRNO("Can't open staging file \"%s\"", + blob->staging_file_name); + return WIMLIB_ERR_OPEN; + } + filedes_init(&fd, raw_fd); + ret = read_raw_file_data(&fd, 0, size, cb, blob->staging_file_name); + filedes_close(&fd); + return ret; +} +#endif + +/* This function handles the trivial case of reading blob data that is, in fact, + * already located in an in-memory buffer. */ +static int +read_buffer_prefix(const struct blob_descriptor *blob, + u64 size, const struct consume_chunk_callback *cb, + bool recover_data) +{ + if (unlikely(!size)) + return 0; + return consume_chunk(cb, blob->attached_buffer, size); +} + +typedef int (*read_blob_prefix_handler_t)(const struct blob_descriptor *blob, + u64 size, + const struct consume_chunk_callback *cb, + bool recover_data); + +/* + * Read the first @size bytes from a generic "blob", which may be located in any + * one of several locations, such as in a WIM resource (possibly compressed), in + * an external file, or directly in an in-memory buffer. The blob data will be + * fed to @cb in chunks that are nonempty but otherwise are of unspecified size. + * + * Returns 0 on success; nonzero on error. A nonzero value will be returned if + * the blob data cannot be successfully read (for a number of different reasons, + * depending on the blob location), or if @cb returned nonzero in which case + * that error code will be returned. If @recover_data is true, then errors + * decompressing chunks in WIM resources will be ignored. + */ +static int +read_blob_prefix(const struct blob_descriptor *blob, u64 size, + const struct consume_chunk_callback *cb, bool recover_data) +{ + static const read_blob_prefix_handler_t handlers[] = { + [BLOB_IN_WIM] = read_wim_blob_prefix, + [BLOB_IN_FILE_ON_DISK] = read_file_on_disk_prefix, + [BLOB_IN_ATTACHED_BUFFER] = read_buffer_prefix, + #ifdef WITH_FUSE + [BLOB_IN_STAGING_FILE] = read_staging_file_prefix, + #endif + #ifdef WITH_NTFS_3G + [BLOB_IN_NTFS_VOLUME] = read_ntfs_attribute_prefix, + #endif + #ifdef _WIN32 + [BLOB_IN_WINDOWS_FILE] = read_windows_file_prefix, + #endif + }; + wimlib_assert(blob->blob_location < ARRAY_LEN(handlers) + && handlers[blob->blob_location] != NULL); + wimlib_assert(size <= blob->size); + return handlers[blob->blob_location](blob, size, cb, recover_data); +} + +struct blob_chunk_ctx { + const struct blob_descriptor *blob; + const struct read_blob_callbacks *cbs; + u64 offset; +}; + +static int +consume_blob_chunk(const void *chunk, size_t size, void *_ctx) +{ + struct blob_chunk_ctx *ctx = _ctx; + int ret; + + ret = call_continue_blob(ctx->blob, ctx->offset, chunk, size, ctx->cbs); + ctx->offset += size; + return ret; +} + +/* Read the full data of the specified blob, passing the data into the specified + * callbacks (all of which are optional). */ +int +read_blob_with_cbs(struct blob_descriptor *blob, + const struct read_blob_callbacks *cbs, bool recover_data) +{ + int ret; + struct blob_chunk_ctx ctx = { + .blob = blob, + .offset = 0, + .cbs = cbs, + }; + struct consume_chunk_callback cb = { + .func = consume_blob_chunk, + .ctx = &ctx, + }; + + ret = call_begin_blob(blob, cbs); + if (unlikely(ret)) + return ret; + + ret = read_blob_prefix(blob, blob->size, &cb, recover_data); + + return call_end_blob(blob, ret, cbs); +} + +/* Read the full uncompressed data of the specified blob into the specified + * buffer, which must have space for at least blob->size bytes. The SHA-1 + * message digest is *not* checked. */ +int +read_blob_into_buf(const struct blob_descriptor *blob, void *buf) +{ + struct consume_chunk_callback cb = { + .func = bufferer_cb, + .ctx = &buf, + }; + return read_blob_prefix(blob, blob->size, &cb, false); +} + +/* Retrieve the full uncompressed data of the specified blob. A buffer large + * enough hold the data is allocated and returned in @buf_ret. The SHA-1 + * message digest is *not* checked. */ +int +read_blob_into_alloc_buf(const struct blob_descriptor *blob, void **buf_ret) +{ + int ret; + void *buf; + + if (unlikely((size_t)blob->size != blob->size)) { + ERROR("Can't read %"PRIu64" byte blob into memory", blob->size); + return WIMLIB_ERR_NOMEM; + } + + buf = MALLOC(blob->size); + if (unlikely(!buf)) + return WIMLIB_ERR_NOMEM; + + ret = read_blob_into_buf(blob, buf); + if (unlikely(ret)) { + FREE(buf); + return ret; + } + + *buf_ret = buf; + return 0; +} + +/* Retrieve the full uncompressed data of a WIM resource specified as a raw + * `wim_reshdr' and the corresponding WIM file. A buffer large enough hold the + * data is allocated and returned in @buf_ret. */ +int +wim_reshdr_to_data(const struct wim_reshdr *reshdr, WIMStruct *wim, + void **buf_ret) +{ + struct wim_resource_descriptor rdesc; + struct blob_descriptor blob; + + wim_reshdr_to_desc_and_blob(reshdr, wim, &rdesc, &blob); + + return read_blob_into_alloc_buf(&blob, buf_ret); +} + +/* Calculate the SHA-1 message digest of the uncompressed data of the specified + * WIM resource. */ +int +wim_reshdr_to_hash(const struct wim_reshdr *reshdr, WIMStruct *wim, + u8 hash[SHA1_HASH_SIZE]) +{ + struct wim_resource_descriptor rdesc; + struct blob_descriptor blob; + int ret; + + wim_reshdr_to_desc_and_blob(reshdr, wim, &rdesc, &blob); + blob.unhashed = 1; + + ret = sha1_blob(&blob); + if (unlikely(ret)) + return ret; + + copy_hash(hash, blob.hash); + return 0; +} + +struct blobifier_context { + struct read_blob_callbacks cbs; + struct blob_descriptor *cur_blob; + struct blob_descriptor *next_blob; + u64 cur_blob_offset; + struct blob_descriptor *final_blob; + size_t list_head_offset; +}; + +static struct blob_descriptor * +next_blob(struct blob_descriptor *blob, size_t list_head_offset) +{ + struct list_head *cur; + + cur = (struct list_head*)((u8*)blob + list_head_offset); + + return (struct blob_descriptor*)((u8*)cur->next - list_head_offset); +} + +/* + * A consume_chunk implementation that translates raw resource data into blobs, + * calling the begin_blob, continue_blob, and end_blob callbacks as appropriate. + */ +static int +blobifier_cb(const void *chunk, size_t size, void *_ctx) +{ + struct blobifier_context *ctx = _ctx; + int ret; + + wimlib_assert(ctx->cur_blob != NULL); + wimlib_assert(size <= ctx->cur_blob->size - ctx->cur_blob_offset); + + if (ctx->cur_blob_offset == 0) { + /* Starting a new blob. */ + ret = call_begin_blob(ctx->cur_blob, &ctx->cbs); + if (ret) + return ret; + } + + ret = call_continue_blob(ctx->cur_blob, ctx->cur_blob_offset, + chunk, size, &ctx->cbs); + ctx->cur_blob_offset += size; + if (ret) + return ret; + + if (ctx->cur_blob_offset == ctx->cur_blob->size) { + /* Finished reading all the data for a blob. */ + + ctx->cur_blob_offset = 0; + + ret = call_end_blob(ctx->cur_blob, 0, &ctx->cbs); + if (ret) + return ret; + + /* Advance to next blob. */ + ctx->cur_blob = ctx->next_blob; + if (ctx->cur_blob != NULL) { + if (ctx->cur_blob != ctx->final_blob) + ctx->next_blob = next_blob(ctx->cur_blob, + ctx->list_head_offset); + else + ctx->next_blob = NULL; + } + } + return 0; +} + +struct hasher_context { + struct sha1_ctx sha_ctx; + int flags; + struct read_blob_callbacks cbs; +}; + +/* Callback for starting to read a blob while calculating its SHA-1 message + * digest. */ +static int +hasher_begin_blob(struct blob_descriptor *blob, void *_ctx) +{ + struct hasher_context *ctx = _ctx; + + sha1_init(&ctx->sha_ctx); + blob->corrupted = 0; + + return call_begin_blob(blob, &ctx->cbs); +} + +/* + * A continue_blob() implementation that continues calculating the SHA-1 message + * digest of the blob being read, then optionally passes the data on to another + * continue_blob() implementation. This allows checking the SHA-1 message + * digest of a blob being extracted, for example. + */ +static int +hasher_continue_blob(const struct blob_descriptor *blob, u64 offset, + const void *chunk, size_t size, void *_ctx) +{ + struct hasher_context *ctx = _ctx; + + sha1_update(&ctx->sha_ctx, chunk, size); + + return call_continue_blob(blob, offset, chunk, size, &ctx->cbs); +} + +static int +report_sha1_mismatch(struct blob_descriptor *blob, + const u8 actual_hash[SHA1_HASH_SIZE], bool recover_data) +{ + tchar expected_hashstr[SHA1_HASH_STRING_LEN]; + tchar actual_hashstr[SHA1_HASH_STRING_LEN]; + + wimlib_assert(blob->blob_location != BLOB_NONEXISTENT); + wimlib_assert(blob->blob_location != BLOB_IN_ATTACHED_BUFFER); + + sprint_hash(blob->hash, expected_hashstr); + sprint_hash(actual_hash, actual_hashstr); + + blob->corrupted = 1; + + if (blob_is_in_file(blob)) { + ERROR("A file was concurrently modified!\n" + " Path: \"%"TS"\"\n" + " Expected SHA-1: %"TS"\n" + " Actual SHA-1: %"TS"\n", + blob_file_path(blob), expected_hashstr, actual_hashstr); + return WIMLIB_ERR_CONCURRENT_MODIFICATION_DETECTED; + } else if (blob->blob_location == BLOB_IN_WIM) { + const struct wim_resource_descriptor *rdesc = blob->rdesc; + + (recover_data ? wimlib_warning : wimlib_error)( + T("A WIM resource is corrupted!\n" + " WIM file: \"%"TS"\"\n" + " Blob uncompressed size: %"PRIu64"\n" + " Resource offset in WIM: %"PRIu64"\n" + " Resource uncompressed size: %"PRIu64"\n" + " Resource size in WIM: %"PRIu64"\n" + " Resource flags: 0x%x%"TS"\n" + " Resource compression type: %"TS"\n" + " Resource compression chunk size: %"PRIu32"\n" + " Expected SHA-1: %"TS"\n" + " Actual SHA-1: %"TS"\n"), + rdesc->wim->filename, + blob->size, + rdesc->offset_in_wim, + rdesc->uncompressed_size, + rdesc->size_in_wim, + (unsigned int)rdesc->flags, + (rdesc->is_pipable ? T(", pipable") : T("")), + wimlib_get_compression_type_string( + rdesc->compression_type), + rdesc->chunk_size, + expected_hashstr, actual_hashstr); + if (recover_data) + return 0; + return WIMLIB_ERR_INVALID_RESOURCE_HASH; + } else { + ERROR("File data was concurrently modified!\n" + " Location ID: %d\n" + " Expected SHA-1: %"TS"\n" + " Actual SHA-1: %"TS"\n", + (int)blob->blob_location, + expected_hashstr, actual_hashstr); + return WIMLIB_ERR_CONCURRENT_MODIFICATION_DETECTED; + } +} + +/* Callback for finishing reading a blob while calculating its SHA-1 message + * digest. */ +static int +hasher_end_blob(struct blob_descriptor *blob, int status, void *_ctx) +{ + struct hasher_context *ctx = _ctx; + u8 hash[SHA1_HASH_SIZE]; + int ret; + + if (unlikely(status)) { + /* Error occurred; the full blob may not have been read. */ + ret = status; + goto out_next_cb; + } + + /* Retrieve the final SHA-1 message digest. */ + sha1_final(&ctx->sha_ctx, hash); + + /* Set the SHA-1 message digest of the blob, or compare the calculated + * value with stored value. */ + if (blob->unhashed) { + if (ctx->flags & COMPUTE_MISSING_BLOB_HASHES) + copy_hash(blob->hash, hash); + } else if ((ctx->flags & VERIFY_BLOB_HASHES) && + unlikely(!hashes_equal(hash, blob->hash))) + { + ret = report_sha1_mismatch(blob, hash, + ctx->flags & RECOVER_DATA); + goto out_next_cb; + } + ret = 0; +out_next_cb: + return call_end_blob(blob, ret, &ctx->cbs); +} + +/* Read the full data of the specified blob, passing the data into the specified + * callbacks (all of which are optional) and either checking or computing the + * SHA-1 message digest of the blob. */ +int +read_blob_with_sha1(struct blob_descriptor *blob, + const struct read_blob_callbacks *cbs, bool recover_data) +{ + struct hasher_context hasher_ctx = { + .flags = VERIFY_BLOB_HASHES | COMPUTE_MISSING_BLOB_HASHES | + (recover_data ? RECOVER_DATA : 0), + .cbs = *cbs, + }; + struct read_blob_callbacks hasher_cbs = { + .begin_blob = hasher_begin_blob, + .continue_blob = hasher_continue_blob, + .end_blob = hasher_end_blob, + .ctx = &hasher_ctx, + }; + return read_blob_with_cbs(blob, &hasher_cbs, recover_data); +} + +static int +read_blobs_in_solid_resource(struct blob_descriptor *first_blob, + struct blob_descriptor *last_blob, + size_t blob_count, + size_t list_head_offset, + const struct read_blob_callbacks *sink_cbs, + bool recover_data) +{ + struct data_range *ranges; + bool ranges_malloced; + struct blob_descriptor *cur_blob; + size_t i; + int ret; + u64 ranges_alloc_size; + + /* Setup data ranges array (one range per blob to read); this way + * read_compressed_wim_resource() does not need to be aware of blobs. + */ + + ranges_alloc_size = (u64)blob_count * sizeof(ranges[0]); + + if (unlikely((size_t)ranges_alloc_size != ranges_alloc_size)) + goto oom; + + if (ranges_alloc_size <= STACK_MAX) { + ranges = alloca(ranges_alloc_size); + ranges_malloced = false; + } else { + ranges = MALLOC(ranges_alloc_size); + if (unlikely(!ranges)) + goto oom; + ranges_malloced = true; + } + + for (i = 0, cur_blob = first_blob; + i < blob_count; + i++, cur_blob = next_blob(cur_blob, list_head_offset)) + { + ranges[i].offset = cur_blob->offset_in_res; + ranges[i].size = cur_blob->size; + } + + struct blobifier_context blobifier_ctx = { + .cbs = *sink_cbs, + .cur_blob = first_blob, + .next_blob = next_blob(first_blob, list_head_offset), + .cur_blob_offset = 0, + .final_blob = last_blob, + .list_head_offset = list_head_offset, + }; + struct consume_chunk_callback cb = { + .func = blobifier_cb, + .ctx = &blobifier_ctx, + }; + + ret = read_compressed_wim_resource(first_blob->rdesc, ranges, + blob_count, &cb, recover_data); + + if (ranges_malloced) + FREE(ranges); + + if (unlikely(ret && blobifier_ctx.cur_blob_offset != 0)) { + ret = call_end_blob(blobifier_ctx.cur_blob, ret, + &blobifier_ctx.cbs); + } + return ret; + +oom: + ERROR("Too many blobs in one resource!"); + return WIMLIB_ERR_NOMEM; +} + +/* + * Read a list of blobs, each of which may be in any supported location (e.g. + * in a WIM or in an external file). This function optimizes the case where + * multiple blobs are combined into a single solid compressed WIM resource by + * reading the blobs in sequential order, only decompressing the solid resource + * one time. + * + * @blob_list + * List of blobs to read. + * @list_head_offset + * Offset of the `struct list_head' within each `struct blob_descriptor' + * that makes up the @blob_list. + * @cbs + * Callback functions to accept the blob data. + * @flags + * Bitwise OR of zero or more of the following flags: + * + * VERIFY_BLOB_HASHES: + * For all blobs being read that have already had SHA-1 message + * digests computed, calculate the SHA-1 message digest of the read + * data and compare it with the previously computed value. If they + * do not match, return WIMLIB_ERR_INVALID_RESOURCE_HASH (unless + * RECOVER_DATA is also set, in which case just issue a warning). + * + * COMPUTE_MISSING_BLOB_HASHES + * For all blobs being read that have not yet had their SHA-1 + * message digests computed, calculate and save their SHA-1 message + * digests. + * + * BLOB_LIST_ALREADY_SORTED + * @blob_list is already sorted in sequential order for reading. + * + * RECOVER_DATA + * Don't consider corrupted blob data to be an error. + * + * The callback functions are allowed to delete the current blob from the list + * if necessary. + * + * Returns 0 on success; a nonzero error code on failure. Failure can occur due + * to an error reading the data or due to an error status being returned by any + * of the callback functions. + */ +int +read_blob_list(struct list_head *blob_list, size_t list_head_offset, + const struct read_blob_callbacks *cbs, int flags) +{ + int ret; + struct list_head *cur, *next; + struct blob_descriptor *blob; + struct hasher_context *hasher_ctx; + struct read_blob_callbacks *sink_cbs; + + if (!(flags & BLOB_LIST_ALREADY_SORTED)) { + ret = sort_blob_list_by_sequential_order(blob_list, + list_head_offset); + if (ret) + return ret; + } + + if (flags & (VERIFY_BLOB_HASHES | COMPUTE_MISSING_BLOB_HASHES)) { + hasher_ctx = alloca(sizeof(*hasher_ctx)); + *hasher_ctx = (struct hasher_context) { + .flags = flags, + .cbs = *cbs, + }; + sink_cbs = alloca(sizeof(*sink_cbs)); + *sink_cbs = (struct read_blob_callbacks) { + .begin_blob = hasher_begin_blob, + .continue_blob = hasher_continue_blob, + .end_blob = hasher_end_blob, + .ctx = hasher_ctx, + }; + } else { + sink_cbs = (struct read_blob_callbacks *)cbs; + } + + for (cur = blob_list->next, next = cur->next; + cur != blob_list; + cur = next, next = cur->next) + { + blob = (struct blob_descriptor*)((u8*)cur - list_head_offset); + + if (blob->blob_location == BLOB_IN_WIM && + blob->size != blob->rdesc->uncompressed_size) + { + struct blob_descriptor *blob_next, *blob_last; + struct list_head *next2; + size_t blob_count; + + /* The next blob is a proper sub-sequence of a WIM + * resource. See if there are other blobs in the same + * resource that need to be read. Since + * sort_blob_list_by_sequential_order() sorted the blobs + * by offset in the WIM, this can be determined by + * simply scanning forward in the list. */ + + blob_last = blob; + blob_count = 1; + for (next2 = next; + next2 != blob_list + && (blob_next = (struct blob_descriptor*) + ((u8*)next2 - list_head_offset), + blob_next->blob_location == BLOB_IN_WIM + && blob_next->rdesc == blob->rdesc); + next2 = next2->next) + { + blob_last = blob_next; + blob_count++; + } + if (blob_count > 1) { + /* Reading multiple blobs combined into a single + * WIM resource. They are in the blob list, + * sorted by offset; @blob specifies the first + * blob in the resource that needs to be read + * and @blob_last specifies the last blob in the + * resource that needs to be read. */ + next = next2; + ret = read_blobs_in_solid_resource(blob, blob_last, + blob_count, + list_head_offset, + sink_cbs, + flags & RECOVER_DATA); + if (ret) + return ret; + continue; + } + } + + ret = read_blob_with_cbs(blob, sink_cbs, flags & RECOVER_DATA); + if (unlikely(ret && ret != BEGIN_BLOB_STATUS_SKIP_BLOB)) + return ret; + } + return 0; +} + +static int +extract_chunk_to_fd(const void *chunk, size_t size, void *_fd) +{ + struct filedes *fd = _fd; + int ret = full_write(fd, chunk, size); + if (unlikely(ret)) + ERROR_WITH_ERRNO("Error writing to file descriptor"); + return ret; +} + +static int +extract_blob_chunk_to_fd(const struct blob_descriptor *blob, u64 offset, + const void *chunk, size_t size, void *_fd) +{ + return extract_chunk_to_fd(chunk, size, _fd); +} + +/* Extract the first @size bytes of the specified blob to the specified file + * descriptor. This does *not* check the SHA-1 message digest. */ +int +extract_blob_prefix_to_fd(struct blob_descriptor *blob, u64 size, + struct filedes *fd) +{ + struct consume_chunk_callback cb = { + .func = extract_chunk_to_fd, + .ctx = fd, + }; + return read_blob_prefix(blob, size, &cb, false); +} + +/* Extract the full uncompressed contents of the specified blob to the specified + * file descriptor. This checks the SHA-1 message digest. */ +int +extract_blob_to_fd(struct blob_descriptor *blob, struct filedes *fd, + bool recover_data) +{ + struct read_blob_callbacks cbs = { + .continue_blob = extract_blob_chunk_to_fd, + .ctx = fd, + }; + return read_blob_with_sha1(blob, &cbs, recover_data); +} + +/* Calculate the SHA-1 message digest of a blob and store it in @blob->hash. */ +int +sha1_blob(struct blob_descriptor *blob) +{ + static const struct read_blob_callbacks cbs = { + }; + return read_blob_with_sha1(blob, &cbs, false); +} + +/* + * Convert a short WIM resource header to a stand-alone WIM resource descriptor. + * + * Note: for solid resources some fields still need to be overridden. + */ +void +wim_reshdr_to_desc(const struct wim_reshdr *reshdr, WIMStruct *wim, + struct wim_resource_descriptor *rdesc) +{ + rdesc->wim = wim; + rdesc->offset_in_wim = reshdr->offset_in_wim; + rdesc->size_in_wim = reshdr->size_in_wim; + rdesc->uncompressed_size = reshdr->uncompressed_size; + INIT_LIST_HEAD(&rdesc->blob_list); + rdesc->flags = reshdr->flags; + rdesc->is_pipable = wim_is_pipable(wim); + if (rdesc->flags & WIM_RESHDR_FLAG_COMPRESSED) { + rdesc->compression_type = wim->compression_type; + rdesc->chunk_size = wim->chunk_size; + } else { + rdesc->compression_type = WIMLIB_COMPRESSION_TYPE_NONE; + rdesc->chunk_size = 0; + } +} + +/* + * Convert the short WIM resource header @reshdr to a stand-alone WIM resource + * descriptor @rdesc, then set @blob to consist of that entire resource. This + * should only be used for non-solid resources! + */ +void +wim_reshdr_to_desc_and_blob(const struct wim_reshdr *reshdr, WIMStruct *wim, + struct wim_resource_descriptor *rdesc, + struct blob_descriptor *blob) +{ + wim_reshdr_to_desc(reshdr, wim, rdesc); + blob->size = rdesc->uncompressed_size; + blob_set_is_located_in_wim_resource(blob, rdesc, 0); +} + +/* Import a WIM resource header from the on-disk format. */ +void +get_wim_reshdr(const struct wim_reshdr_disk *disk_reshdr, + struct wim_reshdr *reshdr) +{ + reshdr->offset_in_wim = le64_to_cpu(disk_reshdr->offset_in_wim); + reshdr->size_in_wim = (((u64)disk_reshdr->size_in_wim[0] << 0) | + ((u64)disk_reshdr->size_in_wim[1] << 8) | + ((u64)disk_reshdr->size_in_wim[2] << 16) | + ((u64)disk_reshdr->size_in_wim[3] << 24) | + ((u64)disk_reshdr->size_in_wim[4] << 32) | + ((u64)disk_reshdr->size_in_wim[5] << 40) | + ((u64)disk_reshdr->size_in_wim[6] << 48)); + reshdr->uncompressed_size = le64_to_cpu(disk_reshdr->uncompressed_size); + reshdr->flags = disk_reshdr->flags; +} + +/* Export a WIM resource header to the on-disk format. */ +void +put_wim_reshdr(const struct wim_reshdr *reshdr, + struct wim_reshdr_disk *disk_reshdr) +{ + disk_reshdr->size_in_wim[0] = reshdr->size_in_wim >> 0; + disk_reshdr->size_in_wim[1] = reshdr->size_in_wim >> 8; + disk_reshdr->size_in_wim[2] = reshdr->size_in_wim >> 16; + disk_reshdr->size_in_wim[3] = reshdr->size_in_wim >> 24; + disk_reshdr->size_in_wim[4] = reshdr->size_in_wim >> 32; + disk_reshdr->size_in_wim[5] = reshdr->size_in_wim >> 40; + disk_reshdr->size_in_wim[6] = reshdr->size_in_wim >> 48; + disk_reshdr->flags = reshdr->flags; + disk_reshdr->offset_in_wim = cpu_to_le64(reshdr->offset_in_wim); + disk_reshdr->uncompressed_size = cpu_to_le64(reshdr->uncompressed_size); +} diff --git a/src/wimlib/scan.c b/src/wimlib/scan.c new file mode 100644 index 00000000..483428fc --- /dev/null +++ b/src/wimlib/scan.c @@ -0,0 +1,439 @@ +/* + * scan.c - Helper routines for directory tree scans + */ + +/* + * Copyright (C) 2013-2017 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <string.h> + +#include "wimlib/blob_table.h" +#include "wimlib/dentry.h" +#include "wimlib/error.h" +#include "wimlib/paths.h" +#include "wimlib/pattern.h" +#include "wimlib/progress.h" +#include "wimlib/scan.h" +#include "wimlib/textfile.h" + +/* + * Tally a file (or directory) that has been scanned for a capture operation, + * and possibly call the progress function provided by the library user. + * + * @params + * Current path, flags, optional progress function, and progress data for + * the scan operation. + * @status + * Status of the scanned file. + * @inode + * If @status is WIMLIB_SCAN_DENTRY_OK, this is a pointer to the WIM inode + * that has been created for the scanned file. The first time the file is + * seen, inode->i_nlink will be 1. On subsequent visits of the same inode + * via additional hard links, inode->i_nlink will be greater than 1. + */ +int +do_scan_progress(struct scan_params *params, int status, + const struct wim_inode *inode) +{ + int ret; + tchar *cookie; + + switch (status) { + case WIMLIB_SCAN_DENTRY_OK: + if (!(params->add_flags & WIMLIB_ADD_FLAG_VERBOSE)) + return 0; + break; + case WIMLIB_SCAN_DENTRY_UNSUPPORTED: + case WIMLIB_SCAN_DENTRY_EXCLUDED: + case WIMLIB_SCAN_DENTRY_FIXED_SYMLINK: + case WIMLIB_SCAN_DENTRY_NOT_FIXED_SYMLINK: + if (!(params->add_flags & WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE)) + return 0; + break; + } + params->progress.scan.cur_path = params->cur_path; + params->progress.scan.status = status; + if (status == WIMLIB_SCAN_DENTRY_OK) { + + /* The first time the inode is seen, tally all its streams. */ + if (inode->i_nlink == 1) { + for (unsigned i = 0; i < inode->i_num_streams; i++) { + const struct blob_descriptor *blob = + stream_blob_resolved(&inode->i_streams[i]); + if (blob) + params->progress.scan.num_bytes_scanned += blob->size; + } + } + + /* Tally the file itself, counting every hard link. It's + * debatable whether every link should be counted, but counting + * every link makes the statistics consistent with the ones + * placed in the FILECOUNT and DIRCOUNT elements of the WIM + * file's XML document. It also avoids possible user confusion + * if the number of files reported were to be lower than that + * displayed by some other software such as file browsers. */ + if (inode_is_directory(inode)) + params->progress.scan.num_dirs_scanned++; + else + params->progress.scan.num_nondirs_scanned++; + } + + /* Call the user-provided progress function. */ + + cookie = progress_get_win32_path(params->progress.scan.cur_path); + ret = call_progress(params->progfunc, WIMLIB_PROGRESS_MSG_SCAN_DENTRY, + &params->progress, params->progctx); + progress_put_win32_path(cookie); + return ret; +} + +/* + * Given a null-terminated pathname pattern @pat that has been read from line + * @line_no of the file @path, validate and canonicalize the pattern. + * + * On success, returns 0. + * On failure, returns WIMLIB_ERR_INVALID_CAPTURE_CONFIG. + * In either case, @pat may have been modified in-place (and possibly + * shortened). + */ +int +mangle_pat(tchar *pat, const tchar *path, unsigned long line_no) +{ + if (!is_any_path_separator(pat[0]) && + pat[0] != T('\0') && pat[1] == T(':')) + { + /* Pattern begins with drive letter. */ + + if (!is_any_path_separator(pat[2])) { + /* Something like c:file, which is actually a path + * relative to the current working directory on the c: + * drive. We require paths with drive letters to be + * absolute. */ + ERROR("%"TS":%lu: Invalid pattern \"%"TS"\":\n" + " Patterns including drive letters must be absolute!\n" + " Maybe try \"%"TC":%"TC"%"TS"\"?\n", + path, line_no, pat, + pat[0], OS_PREFERRED_PATH_SEPARATOR, &pat[2]); + return WIMLIB_ERR_INVALID_CAPTURE_CONFIG; + } + + WARNING("%"TS":%lu: Pattern \"%"TS"\" starts with a drive " + "letter, which is being removed.", + path, line_no, pat); + + /* Strip the drive letter. */ + tmemmove(pat, pat + 2, tstrlen(pat + 2) + 1); + } + + /* Collapse consecutive path separators, and translate both / and \ into + * / (UNIX) or \ (Windows). + * + * Note: we expect that this function produces patterns that can be used + * for both filesystem paths and WIM paths, so the desired path + * separators must be the same. */ + STATIC_ASSERT(OS_PREFERRED_PATH_SEPARATOR == WIM_PATH_SEPARATOR); + do_canonicalize_path(pat, pat); + + /* Relative patterns can only match file names, so they must be + * single-component only. */ + if (pat[0] != OS_PREFERRED_PATH_SEPARATOR && + tstrchr(pat, OS_PREFERRED_PATH_SEPARATOR)) + { + ERROR("%"TS":%lu: Invalid pattern \"%"TS"\":\n" + " Relative patterns can only include one path component!\n" + " Maybe try \"%"TC"%"TS"\"?", + path, line_no, pat, OS_PREFERRED_PATH_SEPARATOR, pat); + return WIMLIB_ERR_INVALID_CAPTURE_CONFIG; + } + + return 0; +} + +/* + * Read, parse, and validate a capture configuration file from either an on-disk + * file or an in-memory buffer. + * + * To read from a file, specify @config_file, and use NULL for @buf. + * To read from a buffer, specify @buf and @bufsize. + * + * @config must be initialized to all 0's. + * + * On success, 0 will be returned, and the resulting capture configuration will + * be stored in @config. + * + * On failure, a positive error code will be returned, and the contents of + * @config will be invalidated. + */ +int +read_capture_config(const tchar *config_file, const void *buf, + size_t bufsize, struct capture_config *config) +{ + int ret; + + /* [PrepopulateList] is used for apply, not capture. But since we do + * understand it, recognize it, thereby avoiding the unrecognized + * section warning, but discard the resulting strings. + * + * We currently ignore [CompressionExclusionList] and + * [CompressionFolderList]. This is a known issue that doesn't seem to + * have any real consequences, so don't issue warnings about not + * recognizing those sections. */ + STRING_LIST(prepopulate_pats); + STRING_LIST(compression_exclusion_pats); + STRING_LIST(compression_folder_pats); + + struct text_file_section sections[] = { + {T("ExclusionList"), + &config->exclusion_pats}, + {T("ExclusionException"), + &config->exclusion_exception_pats}, + {T("PrepopulateList"), + &prepopulate_pats}, + {T("CompressionExclusionList"), + &compression_exclusion_pats}, + {T("CompressionFolderList"), + &compression_folder_pats}, + }; + void *mem; + + ret = load_text_file(config_file, buf, bufsize, &mem, + sections, ARRAY_LEN(sections), + LOAD_TEXT_FILE_REMOVE_QUOTES, mangle_pat); + if (ret) { + ERROR("Failed to load capture configuration file \"%"TS"\"", + config_file); + switch (ret) { + case WIMLIB_ERR_INVALID_UTF8_STRING: + case WIMLIB_ERR_INVALID_UTF16_STRING: + ERROR("Note: the capture configuration file must be " + "valid UTF-8 or UTF-16LE"); + ret = WIMLIB_ERR_INVALID_CAPTURE_CONFIG; + break; + case WIMLIB_ERR_OPEN: + case WIMLIB_ERR_STAT: + case WIMLIB_ERR_NOMEM: + case WIMLIB_ERR_READ: + ret = WIMLIB_ERR_UNABLE_TO_READ_CAPTURE_CONFIG; + break; + } + return ret; + } + + FREE(prepopulate_pats.strings); + FREE(compression_exclusion_pats.strings); + FREE(compression_folder_pats.strings); + + config->buf = mem; + return 0; +} + +void +destroy_capture_config(struct capture_config *config) +{ + FREE(config->exclusion_pats.strings); + FREE(config->exclusion_exception_pats.strings); + FREE(config->buf); +} + +/* + * Determine whether @path matches any of the patterns in @list. + * Path separators in @path must be WIM_PATH_SEPARATOR. + */ +bool +match_pattern_list(const tchar *path, const struct string_list *list, + int match_flags) +{ + for (size_t i = 0; i < list->num_strings; i++) + if (match_path(path, list->strings[i], match_flags)) + return true; + return false; +} + +/* + * Determine if a file should be excluded from capture. + * + * This function tests exclusions from both possible sources of exclusions: + * + * (1) The capture configuration file + * (2) The user-provided progress function + * + * params->root_path_nchars must have been set beforehand. Example for UNIX: if + * the capture root directory is "foobar/subdir", then all paths will be + * provided starting with "foobar/subdir", so params->root_path_nchars must have + * been set to strlen("foobar/subdir") so that the appropriate path suffix can + * be matched against the patterns in the exclusion list. + * + * Returns: + * < 0 if excluded + * = 0 if not excluded and no error + * > 0 (wimlib error code) if error + */ +int +try_exclude(const struct scan_params *params) +{ + int ret; + + if (params->config) { + const tchar *path = params->cur_path + params->root_path_nchars; + if (match_pattern_list(path, &params->config->exclusion_pats, + MATCH_RECURSIVELY) && + !match_pattern_list(path, &params->config->exclusion_exception_pats, + MATCH_RECURSIVELY | MATCH_ANCESTORS)) + return -1; + } + + if (unlikely(params->add_flags & WIMLIB_ADD_FLAG_TEST_FILE_EXCLUSION)) { + + union wimlib_progress_info info; + tchar *cookie; + + info.test_file_exclusion.path = params->cur_path; + info.test_file_exclusion.will_exclude = false; + + cookie = progress_get_win32_path(info.test_file_exclusion.path); + + ret = call_progress(params->progfunc, WIMLIB_PROGRESS_MSG_TEST_FILE_EXCLUSION, + &info, params->progctx); + + progress_put_win32_path(cookie); + + if (ret) + return ret; + if (info.test_file_exclusion.will_exclude) + return -1; + } + + return 0; +} + +/* + * Determine whether a directory entry of the specified name should be ignored. + * This is a lower level function which runs prior to try_exclude(). It handles + * the standard '.' and '..' entries, which show up in directory listings but + * should not be archived. It also checks for odd filenames that usually should + * not exist but could cause problems if archiving them were to be attempted. + */ +bool +should_ignore_filename(const tchar *name, const int name_nchars) +{ + if (name_nchars <= 0) { + WARNING("Ignoring empty filename"); + return true; + } + + if (name[0] == T('.') && + (name_nchars == 1 || (name_nchars == 2 && name[1] == T('.')))) + return true; + + for (int i = 0; i < name_nchars; i++) { + if (name[i] == T('\0')) { + WARNING("Ignoring filename containing embedded null character"); + return true; + } + if (name[i] == OS_PREFERRED_PATH_SEPARATOR) { + WARNING("Ignoring filename containing embedded path separator"); + return true; + } + } + + return false; +} + +/* Attach a newly scanned directory tree to its parent directory, with duplicate + * handling. */ +void +attach_scanned_tree(struct wim_dentry *parent, struct wim_dentry *child, + struct blob_table *blob_table) +{ + struct wim_dentry *duplicate; + + if (child && (duplicate = dentry_add_child(parent, child))) { + WARNING("Duplicate file path: \"%"TS"\". Only capturing " + "the first version.", dentry_full_path(duplicate)); + free_dentry_tree(child, blob_table); + } +} + +/* Set the path at which the directory tree scan is beginning. */ +int +pathbuf_init(struct scan_params *params, const tchar *root_path) +{ + size_t nchars = tstrlen(root_path); + size_t alloc_nchars = nchars + 1 + 1024; + + params->cur_path = MALLOC(alloc_nchars * sizeof(tchar)); + if (!params->cur_path) + return WIMLIB_ERR_NOMEM; + tmemcpy(params->cur_path, root_path, nchars + 1); + params->cur_path_nchars = nchars; + params->cur_path_alloc_nchars = alloc_nchars; + params->root_path_nchars = nchars; + return 0; +} + +/* + * Append a filename to the current path. + * + * If successful, returns a pointer to the filename component and sets + * *orig_path_nchars_ret to the old path length, which can be restored later + * using pathbuf_truncate(). Otherwise returns NULL (out of memory). + */ +const tchar * +pathbuf_append_name(struct scan_params *params, const tchar *name, + size_t name_nchars, size_t *orig_path_nchars_ret) +{ + size_t path_nchars = params->cur_path_nchars; + size_t required_nchars = path_nchars + 1 + name_nchars + 1; + tchar *buf = params->cur_path; + + if (unlikely(required_nchars > params->cur_path_alloc_nchars)) { + required_nchars += 1024; + buf = REALLOC(buf, required_nchars * sizeof(tchar)); + if (!buf) + return NULL; + params->cur_path = buf; + params->cur_path_alloc_nchars = required_nchars; + } + *orig_path_nchars_ret = path_nchars; + + /* + * Add the slash, but not if it will be a duplicate (which can happen if + * the path to the capture root directory ends in a slash), because + * on Windows duplicate slashes sometimes don't work as expected. + */ + if (path_nchars && buf[path_nchars - 1] != OS_PREFERRED_PATH_SEPARATOR) + buf[path_nchars++] = OS_PREFERRED_PATH_SEPARATOR; + + tmemcpy(&buf[path_nchars], name, name_nchars); + path_nchars += name_nchars; + buf[path_nchars] = T('\0'); + params->cur_path_nchars = path_nchars; + return &buf[path_nchars - name_nchars]; +} + +/* Truncate the current path to the specified number of characters. */ +void +pathbuf_truncate(struct scan_params *params, size_t nchars) +{ + wimlib_assert(nchars <= params->cur_path_nchars); + params->cur_path[nchars] = T('\0'); + params->cur_path_nchars = nchars; +} diff --git a/src/wimlib/security.c b/src/wimlib/security.c new file mode 100644 index 00000000..617abfbd --- /dev/null +++ b/src/wimlib/security.c @@ -0,0 +1,392 @@ +/* + * security.c + * + * Read and write the per-WIM-image table of security descriptors. + */ + +/* + * Copyright 2012-2023 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/assert.h" +#include "wimlib/avl_tree.h" +#include "wimlib/endianness.h" +#include "wimlib/error.h" +#include "wimlib/security.h" +#include "wimlib/sha1.h" +#include "wimlib/util.h" + +struct wim_security_data_disk { + le32 total_length; + le32 num_entries; + le64 sizes[]; +} __attribute__((packed)); + +struct wim_security_data * +new_wim_security_data(void) +{ + return CALLOC(1, sizeof(struct wim_security_data)); +} + +/* + * Reads the security data from the metadata resource of a WIM image. + * + * @buf + * Buffer containing an uncompressed WIM metadata resource. + * @buf_len + * Length of the uncompressed metadata resource, in bytes. + * @sd_ret + * On success, a pointer to the resulting security data structure will be + * returned here. + * + * Note: There is no `offset' argument because the security data is located at + * the beginning of the metadata resource. + * + * Return values: + * WIMLIB_ERR_SUCCESS (0) + * WIMLIB_ERR_INVALID_METADATA_RESOURCE + * WIMLIB_ERR_NOMEM + */ +int +read_wim_security_data(const u8 *buf, size_t buf_len, + struct wim_security_data **sd_ret) +{ + struct wim_security_data *sd; + int ret; + u64 total_len; + u64 sizes_size; + u64 size_no_descriptors; + const struct wim_security_data_disk *sd_disk; + const u8 *p; + + if (buf_len < 8) + return WIMLIB_ERR_INVALID_METADATA_RESOURCE; + + sd = new_wim_security_data(); + if (!sd) + goto out_of_memory; + + sd_disk = (const struct wim_security_data_disk *)buf; + sd->total_length = ALIGN(le32_to_cpu(sd_disk->total_length), 8); + sd->num_entries = le32_to_cpu(sd_disk->num_entries); + + /* Length field of 0 is a special case that really means length + * of 8. */ + if (sd->total_length == 0) + sd->total_length = 8; + + /* The security_id field of each dentry is a signed 32-bit integer, so + * the possible indices into the security descriptors table are 0 + * through 0x7fffffff. Which means 0x80000000 security descriptors + * maximum. Not like you should ever have anywhere close to that many + * security descriptors! */ + if (sd->num_entries > 0x80000000) + goto out_invalid_sd; + + /* Verify the listed total length of the security data is big enough to + * include the sizes array, verify that the file data is big enough to + * include it as well, then allocate the array of sizes. + * + * Note: The total length of the security data must fit in a 32-bit + * integer, even though each security descriptor size is a 64-bit + * integer. This is stupid, and we need to be careful not to actually + * let the security descriptor sizes be over 0xffffffff. */ + if (sd->total_length > buf_len) + goto out_invalid_sd; + + sizes_size = (u64)sd->num_entries * sizeof(u64); + size_no_descriptors = 8 + sizes_size; + if (size_no_descriptors > sd->total_length) + goto out_invalid_sd; + + total_len = size_no_descriptors; + + /* Return immediately if no security descriptors. */ + if (sd->num_entries == 0) + goto out_descriptors_ready; + + /* Allocate a new buffer for the sizes array */ + sd->sizes = MALLOC(sizes_size); + if (!sd->sizes) + goto out_of_memory; + + /* Copy the sizes array into the new buffer */ + for (u32 i = 0; i < sd->num_entries; i++) { + sd->sizes[i] = le64_to_cpu(sd_disk->sizes[i]); + if (sd->sizes[i] > 0xffffffff) + goto out_invalid_sd; + } + + p = (const u8*)sd_disk + size_no_descriptors; + + /* Allocate the array of pointers to the security descriptors, then read + * them into separate buffers. */ + sd->descriptors = CALLOC(sd->num_entries, sizeof(sd->descriptors[0])); + if (!sd->descriptors) + goto out_of_memory; + + for (u32 i = 0; i < sd->num_entries; i++) { + if (sd->sizes[i] == 0) + continue; + total_len += sd->sizes[i]; + if (total_len > (u64)sd->total_length) + goto out_invalid_sd; + sd->descriptors[i] = memdup(p, sd->sizes[i]); + if (!sd->descriptors[i]) + goto out_of_memory; + p += sd->sizes[i]; + } +out_descriptors_ready: + if (ALIGN(total_len, 8) != sd->total_length) { + WARNING("Stored WIM security data total length was " + "%"PRIu32" bytes, but calculated %"PRIu32" bytes", + sd->total_length, (u32)total_len); + } + *sd_ret = sd; + ret = 0; + goto out; +out_invalid_sd: + ERROR("WIM security data is invalid!"); + ret = WIMLIB_ERR_INVALID_METADATA_RESOURCE; + goto out_free_sd; +out_of_memory: + ERROR("Out of memory while reading WIM security data!"); + ret = WIMLIB_ERR_NOMEM; +out_free_sd: + free_wim_security_data(sd); +out: + return ret; +} + +/* + * Writes the security data for a WIM image to an in-memory buffer. + */ +u8 * +write_wim_security_data(const struct wim_security_data * restrict sd, + u8 * restrict p) +{ + u8 *orig_p = p; + struct wim_security_data_disk *sd_disk = (struct wim_security_data_disk*)p; + u32 num_entries = sd->num_entries; + + sd_disk->total_length = cpu_to_le32(sd->total_length); + sd_disk->num_entries = cpu_to_le32(num_entries); + + for (u32 i = 0; i < num_entries; i++) + sd_disk->sizes[i] = cpu_to_le64(sd->sizes[i]); + + p = (u8*)&sd_disk->sizes[num_entries]; + + for (u32 i = 0; i < num_entries; i++) + p = mempcpy(p, sd->descriptors[i], sd->sizes[i]); + + while ((uintptr_t)p & 7) + *p++ = 0; + + wimlib_assert(p - orig_p == sd->total_length); + return p; +} + +void +free_wim_security_data(struct wim_security_data *sd) +{ + if (sd) { + u8 **descriptors = sd->descriptors; + u32 num_entries = sd->num_entries; + if (descriptors) + while (num_entries--) + FREE(*descriptors++); + FREE(sd->sizes); + FREE(sd->descriptors); + FREE(sd); + } +} + +struct sd_node { + s32 security_id; + u8 hash[SHA1_HASH_SIZE]; + struct avl_tree_node index_node; +}; + +#define SD_NODE(avl_node) \ + avl_tree_entry(avl_node, struct sd_node, index_node) + +static void +free_sd_tree(struct avl_tree_node *node) +{ + if (node) { + free_sd_tree(node->left); + free_sd_tree(node->right); + FREE(SD_NODE(node)); + } +} + +void +rollback_new_security_descriptors(struct wim_sd_set *sd_set) +{ + struct wim_security_data *sd = sd_set->sd; + u32 i; + + for (i = sd_set->orig_num_entries; i < sd->num_entries; i++) + FREE(sd->descriptors[i]); + sd->num_entries = sd_set->orig_num_entries; +} + +/* Frees a security descriptor index set. */ +void +destroy_sd_set(struct wim_sd_set *sd_set) +{ + free_sd_tree(sd_set->root); +} + +static int +_avl_cmp_nodes_by_hash(const struct avl_tree_node *n1, + const struct avl_tree_node *n2) +{ + return hashes_cmp(SD_NODE(n1)->hash, SD_NODE(n2)->hash); +} + +/* Inserts a new node into the security descriptor index tree. Returns true + * if successful (not a duplicate). */ +static bool +insert_sd_node(struct wim_sd_set *set, struct sd_node *new) +{ + return NULL == avl_tree_insert(&set->root, &new->index_node, + _avl_cmp_nodes_by_hash); +} + +/* Returns the index of the security descriptor having a SHA1 message digest of + * @hash. If not found, return -1. */ +static s32 +lookup_sd(struct wim_sd_set *set, const u8 hash[SHA1_HASH_SIZE]) +{ + struct avl_tree_node *res; + struct sd_node dummy; + + copy_hash(dummy.hash, hash); + res = avl_tree_lookup_node(set->root, &dummy.index_node, + _avl_cmp_nodes_by_hash); + if (!res) + return -1; + return SD_NODE(res)->security_id; +} + +/* + * Adds a security descriptor to the indexed security descriptor set as well as + * the corresponding `struct wim_security_data', and returns the new security + * ID; or, if there is an existing security descriptor that is the same, return + * the security ID for it. If a new security descriptor cannot be allocated, + * return -1. + */ +s32 +sd_set_add_sd(struct wim_sd_set *sd_set, const char *descriptor, size_t size) +{ + u8 hash[SHA1_HASH_SIZE]; + s32 security_id; + struct sd_node *new; + u8 **descriptors; + u64 *sizes; + u8 *descr_copy; + struct wim_security_data *sd; + bool bret; + + sha1(descriptor, size, hash); + + security_id = lookup_sd(sd_set, hash); + if (security_id >= 0) /* Identical descriptor already exists */ + goto out; + + /* Need to add a new security descriptor */ + security_id = -1; + + new = MALLOC(sizeof(*new)); + if (!new) + goto out; + + descr_copy = memdup(descriptor, size); + if (!descr_copy) + goto out_free_node; + + sd = sd_set->sd; + new->security_id = sd->num_entries; + copy_hash(new->hash, hash); + + /* There typically are only a few dozen security descriptors in a + * directory tree, so expanding the array of security descriptors by + * only 1 extra space each time should not be a problem. */ + descriptors = REALLOC(sd->descriptors, + (sd->num_entries + 1) * sizeof(sd->descriptors[0])); + if (!descriptors) + goto out_free_descr; + sd->descriptors = descriptors; + sizes = REALLOC(sd->sizes, + (sd->num_entries + 1) * sizeof(sd->sizes[0])); + if (!sizes) + goto out_free_descr; + sd->sizes = sizes; + sd->descriptors[sd->num_entries] = descr_copy; + sd->sizes[sd->num_entries] = size; + sd->num_entries++; + bret = insert_sd_node(sd_set, new); + wimlib_assert(bret); + security_id = new->security_id; + goto out; +out_free_descr: + FREE(descr_copy); +out_free_node: + FREE(new); +out: + return security_id; +} + +/* Initialize a `struct sd_set' mapping from SHA1 message digests of security + * descriptors to indices into the security descriptors table of the WIM image + * (security IDs). */ +int +init_sd_set(struct wim_sd_set *sd_set, struct wim_security_data *sd) +{ + int ret; + + sd_set->sd = sd; + sd_set->root = NULL; + + /* Remember the original number of security descriptors so that newly + * added ones can be rolled back if needed. */ + sd_set->orig_num_entries = sd->num_entries; + for (u32 i = 0; i < sd->num_entries; i++) { + struct sd_node *new; + + new = MALLOC(sizeof(struct sd_node)); + if (!new) { + ret = WIMLIB_ERR_NOMEM; + goto out_destroy_sd_set; + } + sha1(sd->descriptors[i], sd->sizes[i], new->hash); + new->security_id = i; + if (!insert_sd_node(sd_set, new)) + FREE(new); /* Ignore duplicate security descriptor */ + } + ret = 0; + goto out; +out_destroy_sd_set: + destroy_sd_set(sd_set); +out: + return ret; +} diff --git a/src/wimlib/sha1.c b/src/wimlib/sha1.c new file mode 100644 index 00000000..fbbfdc18 --- /dev/null +++ b/src/wimlib/sha1.c @@ -0,0 +1,642 @@ +/* + * sha1.c - implementation of the Secure Hash Algorithm version 1 (FIPS 180-1) + * + * Copyright 2022-2023 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/cpu_features.h" +#include "wimlib/endianness.h" +#include "wimlib/sha1.h" +#include "wimlib/unaligned.h" + +/*----------------------------------------------------------------------------* + * Shared helpers * + *----------------------------------------------------------------------------*/ + +static inline u32 +rol32(u32 v, int bits) +{ + return (v << bits) | (v >> (32 - bits)); +} + +/* Expands to the round constant for the given round */ +#define SHA1_K(i) \ + (((i) < 20) ? 0x5A827999 : \ + ((i) < 40) ? 0x6ED9EBA1 : \ + ((i) < 60) ? 0x8F1BBCDC : \ + 0xCA62C1D6) + +/* Expands to the computation on b, c, and d for the given round */ +#define SHA1_F(i, b, c, d) \ + (((i) < 20) ? /* Choice */ (b & (c ^ d)) ^ d : \ + ((i) < 40) ? /* Parity */ b ^ c ^ d : \ + ((i) < 60) ? /* Majority */ (c & d) ^ (b & (c ^ d)) : \ + /* Parity */ b ^ c ^ d) + +/* + * Expands to a memory barrier for the given array, preventing values of the + * array from being cached in registers past the barrier. Use this to prevent + * the compiler from making counter-productive optimizations when there aren't + * enough registers available to hold the full array. + */ +#define FORCE_NOT_CACHED(array) asm volatile("" : "+m" (array)) + +/* + * Expands to FORCE_NOT_CACHED() if the architecture has 16 or fewer general + * purpose registers, otherwise does nothing. + */ +#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) +# define FORCE_NOT_CACHED_IF_FEW_REGS(array) FORCE_NOT_CACHED(array) +#else +# define FORCE_NOT_CACHED_IF_FEW_REGS(array) (void)(array) +#endif + +/*----------------------------------------------------------------------------* + * Generic implementation * + *----------------------------------------------------------------------------*/ + +/* + * This is SHA-1 in portable C code. It computes the message schedule + * just-in-time, in a rolling window of length 16. + */ + +#define SHA1_GENERIC_ROUND(i, a, b, c, d, e) \ + FORCE_NOT_CACHED_IF_FEW_REGS(w); \ + if ((i) < 16) \ + w[i] = get_unaligned_be32(data + ((i) * 4)); \ + else \ + w[(i) % 16] = rol32(w[((i) - 16) % 16] ^ \ + w[((i) - 14) % 16] ^ \ + w[((i) - 8) % 16] ^ \ + w[((i) - 3) % 16], 1); \ + e += w[(i) % 16] + rol32(a, 5) + SHA1_F((i), b, c, d) + SHA1_K(i); \ + b = rol32(b, 30); + /* implicit: the new (a, b, c, d, e) is the old (e, a, b, c, d) */ + +#define SHA1_GENERIC_5ROUNDS(i) \ + SHA1_GENERIC_ROUND((i) + 0, a, b, c, d, e); \ + SHA1_GENERIC_ROUND((i) + 1, e, a, b, c, d); \ + SHA1_GENERIC_ROUND((i) + 2, d, e, a, b, c); \ + SHA1_GENERIC_ROUND((i) + 3, c, d, e, a, b); \ + SHA1_GENERIC_ROUND((i) + 4, b, c, d, e, a); + +#define SHA1_GENERIC_20ROUNDS(i) \ + SHA1_GENERIC_5ROUNDS((i) + 0); \ + SHA1_GENERIC_5ROUNDS((i) + 5); \ + SHA1_GENERIC_5ROUNDS((i) + 10); \ + SHA1_GENERIC_5ROUNDS((i) + 15); + +static void +sha1_blocks_generic(u32 h[5], const void *data, size_t num_blocks) +{ + do { + u32 a = h[0]; + u32 b = h[1]; + u32 c = h[2]; + u32 d = h[3]; + u32 e = h[4]; + u32 w[16]; + + SHA1_GENERIC_20ROUNDS(0); + SHA1_GENERIC_20ROUNDS(20); + SHA1_GENERIC_20ROUNDS(40); + SHA1_GENERIC_20ROUNDS(60); + + h[0] += a; + h[1] += b; + h[2] += c; + h[3] += d; + h[4] += e; + data += SHA1_BLOCK_SIZE; + } while (--num_blocks); +} + +/*----------------------------------------------------------------------------* + * x86 SSSE3 (and AVX+BMI2) implementation * + *----------------------------------------------------------------------------*/ + +/* + * This is SHA-1 using the x86 SSSE3 instructions. A copy of it is also + * compiled with AVX and BMI2 code generation enabled for improved performance. + * + * Unfortunately this isn't actually much faster than the generic + * implementation, since only the message schedule can be vectorized, not the + * SHA itself. The vectorized computation of the message schedule is + * interleaved with the scalar computation of the SHA itself. + * + * Specifically, 16 rounds ahead of time, the words of the message schedule are + * calculated, the round constants are added to them, and they are stored in a + * temporary array that the scalar code reads from later. This is done 4 words + * at a time, but split into 4 steps, so that one step is executed during each + * round. Rounds 16-31 use the usual formula 'w[i] = rol32(w[i-16] ^ w[i-14] ^ + * w[i-8] ^ w[i-3], 1)', while rounds 32-79 use the equivalent formula 'w[i] = + * rol32(w[i-32] ^ w[i-28] ^ w[i-16] ^ w[i-6], 2)' for improved vectorization. + * + * During rounds 80-95, the first 16 message schedule words for the next block + * are prepared. + */ +#if defined(__i386__) || defined(__x86_64__) +#include <immintrin.h> + +#define SHA1_SSSE3_PRECALC(i, w0, w1, w2, w3, w4, w5, w6, w7) \ + if ((i) % 20 == 0) \ + k = _mm_set1_epi32(SHA1_K((i) % 80)); \ + if ((i) < 32) { \ + /* + * Vectorized computation of w[i] = rol32(w[i-16] ^ w[i-14] ^ + * w[i-8] ^ w[i-3], 1) for i...i+3, split into 4 steps. + * w[i-16..i+3] are in (w0, w1, w2, w3, w4). + */ \ + if ((i) % 4 == 0) { \ + w4 = _mm_alignr_epi8(w1, w0, 8) ^ w2; \ + t0 = _mm_srli_si128(w3, 4); \ + } else if ((i) % 4 == 1) { \ + t0 ^= w4 ^ w0; \ + t1 = _mm_slli_si128(t0, 12); \ + } else if ((i) % 4 == 2) { \ + t2 = _mm_slli_epi32(t1, 2); \ + w4 = _mm_slli_epi32(t0, 1); \ + t0 = _mm_srli_epi32(t0, 31); \ + t2 ^= _mm_srli_epi32(t1, 30); \ + } else { \ + w4 ^= t0 ^ t2; \ + t0 = _mm_add_epi32(w4, k); \ + _mm_store_si128((__m128i *)&tmp[((i) - 3) % 16], t0); \ + } \ + } else if ((i) < 80) { \ + /* + * Vectorized computation of w[i] = rol32(w[i-32] ^ w[i-28] ^ + * w[i-16] ^ w[i-6], 2) for i...i+3, split into 4 steps. + * w[i-32..i+3] are in (w4, w5, w6, w7, w0, w1, w2, w3, w4); + * note the reuse of w4. + */ \ + if ((i) % 4 == 0) \ + w4 ^= _mm_alignr_epi8(w3, w2, 8); \ + else if ((i) % 4 == 1) \ + w4 ^= w5 ^ w0; \ + else if ((i) % 4 == 2) \ + w4 = _mm_slli_epi32(w4, 2) ^ \ + _mm_srli_epi32(w4, 30); \ + else \ + _mm_store_si128((__m128i *)&tmp[((i) - 3) % 16],\ + _mm_add_epi32(w4, k)); \ + } else if ((i) < 96) { \ + /* Precomputation of w[0..15] for next block */ \ + if ((i) == 80 && --num_blocks != 0) \ + data += SHA1_BLOCK_SIZE; \ + if ((i) % 4 == 0) \ + w0 = _mm_loadu_si128(data + (((i) - 80) * 4)); \ + else if ((i) % 4 == 1) \ + w0 = _mm_shuffle_epi8(w0, bswap32_mask); \ + else if ((i) % 4 == 2) \ + t0 = _mm_add_epi32(w0, k); \ + else \ + _mm_store_si128((__m128i *)&tmp[(i) - 83], t0); \ + } + +#define SHA1_SSSE3_2ROUNDS(i, a, b, c, d, e, w0, w1, w2, w3, w4, w5, w6, w7) \ + FORCE_NOT_CACHED(tmp); \ + e += tmp[(i) % 16] + rol32(a, 5) + SHA1_F((i), b, c, d); \ + b = rol32(b, 30); \ + SHA1_SSSE3_PRECALC((i) + 16, w0, w1, w2, w3, w4, w5, w6, w7); \ + FORCE_NOT_CACHED(tmp); \ + d += tmp[((i) + 1) % 16] + rol32(e, 5) + SHA1_F((i) + 1, a, b, c); \ + SHA1_SSSE3_PRECALC((i) + 17, w0, w1, w2, w3, w4, w5, w6, w7); \ + a = rol32(a, 30); + /* implicit: the new (a, b, c, d, e) is the old (d, e, a, b, c) */ + +#define SHA1_SSSE3_4ROUNDS(i, a, b, c, d, e, w0, w1, w2, w3, w4, w5, w6, w7) \ + SHA1_SSSE3_2ROUNDS((i) + 0, a, b, c, d, e, w0, w1, w2, w3, w4, w5, w6, w7); \ + SHA1_SSSE3_2ROUNDS((i) + 2, d, e, a, b, c, w0, w1, w2, w3, w4, w5, w6, w7); \ + /* + * implicit: the new (w0-w7) is the old (w1-w7,w0), + * and the new (a, b, c, d, e) is the old (b, c, d, e, a) + */ + +#define SHA1_SSSE3_20ROUNDS(i, w0, w1, w2, w3, w4, w5, w6, w7) \ + SHA1_SSSE3_4ROUNDS((i) + 0, a, b, c, d, e, w0, w1, w2, w3, w4, w5, w6, w7); \ + SHA1_SSSE3_4ROUNDS((i) + 4, b, c, d, e, a, w1, w2, w3, w4, w5, w6, w7, w0); \ + SHA1_SSSE3_4ROUNDS((i) + 8, c, d, e, a, b, w2, w3, w4, w5, w6, w7, w0, w1); \ + SHA1_SSSE3_4ROUNDS((i) + 12, d, e, a, b, c, w3, w4, w5, w6, w7, w0, w1, w2); \ + SHA1_SSSE3_4ROUNDS((i) + 16, e, a, b, c, d, w4, w5, w6, w7, w0, w1, w2, w3); + /* implicit: the new (w0-w7) is the old (w5-w7,w0-w4) */ + +#define SHA1_SSSE3_BODY \ + const __m128i bswap32_mask = \ + _mm_setr_epi8( 3, 2, 1, 0, 7, 6, 5, 4, \ + 11, 10, 9, 8, 15, 14, 13, 12); \ + __m128i w0, w1, w2, w3, w4, w5, w6, w7; \ + __m128i k = _mm_set1_epi32(SHA1_K(0)); \ + u32 tmp[16] __attribute__((aligned(16))); \ + \ + w0 = _mm_shuffle_epi8(_mm_loadu_si128(data + 0), bswap32_mask); \ + w1 = _mm_shuffle_epi8(_mm_loadu_si128(data + 16), bswap32_mask); \ + w2 = _mm_shuffle_epi8(_mm_loadu_si128(data + 32), bswap32_mask); \ + w3 = _mm_shuffle_epi8(_mm_loadu_si128(data + 48), bswap32_mask); \ + _mm_store_si128((__m128i *)&tmp[0], _mm_add_epi32(w0, k)); \ + _mm_store_si128((__m128i *)&tmp[4], _mm_add_epi32(w1, k)); \ + _mm_store_si128((__m128i *)&tmp[8], _mm_add_epi32(w2, k)); \ + _mm_store_si128((__m128i *)&tmp[12], _mm_add_epi32(w3, k)); \ + \ + do { \ + u32 a = h[0]; \ + u32 b = h[1]; \ + u32 c = h[2]; \ + u32 d = h[3]; \ + u32 e = h[4]; \ + __m128i t0, t1, t2; \ + \ + SHA1_SSSE3_20ROUNDS(0, w0, w1, w2, w3, w4, w5, w6, w7); \ + SHA1_SSSE3_20ROUNDS(20, w5, w6, w7, w0, w1, w2, w3, w4); \ + SHA1_SSSE3_20ROUNDS(40, w2, w3, w4, w5, w6, w7, w0, w1); \ + SHA1_SSSE3_20ROUNDS(60, w7, w0, w1, w2, w3, w4, w5, w6); \ + \ + h[0] += a; \ + h[1] += b; \ + h[2] += c; \ + h[3] += d; \ + h[4] += e; \ + \ + /* 'data' and 'num_blocks' were updated at start of round 64. */ \ + } while (num_blocks); + +#define HAVE_SHA1_BLOCKS_X86_SSSE3 +static void __attribute__((target("ssse3"))) +sha1_blocks_x86_ssse3(u32 h[5], const void *data, size_t num_blocks) +{ + SHA1_SSSE3_BODY; +} + +#define HAVE_SHA1_BLOCKS_X86_AVX_BMI2 +static void __attribute__((target("avx,bmi2"))) +sha1_blocks_x86_avx_bmi2(u32 h[5], const void *data, size_t num_blocks) +{ + SHA1_SSSE3_BODY; +} +#endif /* x86 SSSE3 (and AVX+BMI2) implementation */ + +/*----------------------------------------------------------------------------* + * x86 SHA Extensions implementation * + *----------------------------------------------------------------------------*/ + +/* + * This is SHA-1 using the x86 SHA extensions. + * + * The SHA1RNDS4 instruction does most of the work. It takes in a 128-bit + * vector containing 'a', 'b', 'c', and 'd' (high-order to low-order), a 128-bit + * vector containing the next 4 words of the message schedule with 'e' added to + * the high-order word, and an immediate that identifies the current 20-round + * section. It does 4 rounds and updates 'a', 'b', 'c', and 'd' accordingly. + * + * Each SHA1RNDS4 is paired with SHA1NEXTE. It takes in the abcd vector, + * calculates the value of 'e' after 4 rounds, and adds it to the high-order + * word of a vector that contains the next 4 words of the message schedule. + * + * Each 4 words of the message schedule for rounds 16-79 is calculated as + * rol32(w[i-16] ^ w[i-14] ^ w[i-8] ^ w[i-3], 1) in three steps using the + * SHA1MSG1, PXOR, and SHA1MSG2 instructions. This happens in a rolling window, + * so during the j'th set of 4 rounds we do the SHA1MSG2 step for j+1'th set of + * message schedule words, PXOR for j+2'th set, and SHA1MSG1 for the j+3'th set. + */ +#if defined(__i386__) || defined(__x86_64__) +#include <immintrin.h> + +#define SHA1_NI_4ROUNDS(i, w0, w1, w2, w3, we0, we1) \ + if ((i) < 16) \ + w0 = _mm_shuffle_epi8( \ + _mm_loadu_si128(data + ((i) * 4)), bswap_mask); \ + if ((i) == 0) \ + we0 = _mm_add_epi32(h_e, w0); \ + else \ + we0 = _mm_sha1nexte_epu32(/* old abcd */ we0, w0); \ + we1 = abcd; \ + if ((i) >= 12 && (i) < 76) \ + w1 = _mm_sha1msg2_epu32(w1, w0); \ + abcd = _mm_sha1rnds4_epu32(abcd, we0, (i) / 20); \ + if ((i) >= 8 && (i) < 72) \ + w2 ^= w0; \ + if ((i) >= 4 && (i) < 68) \ + w3 = _mm_sha1msg1_epu32(w3, w0); \ + /* + * implicit: the new (w0, w1, w2, w3) is the old (w1, w2, w3, w0), + * and the new (we0, we1) is the old (we1, we0) + */ + +#define SHA1_NI_16ROUNDS(i) \ + SHA1_NI_4ROUNDS((i) + 0, w0, w1, w2, w3, we0, we1); \ + SHA1_NI_4ROUNDS((i) + 4, w1, w2, w3, w0, we1, we0); \ + SHA1_NI_4ROUNDS((i) + 8, w2, w3, w0, w1, we0, we1); \ + SHA1_NI_4ROUNDS((i) + 12, w3, w0, w1, w2, we1, we0); + +#define HAVE_SHA1_BLOCKS_X86_SHA +static void __attribute__((target("sha,sse4.1"))) +sha1_blocks_x86_sha(u32 h[5], const void *data, size_t num_blocks) +{ + const __m128i bswap_mask = + _mm_setr_epi8(15, 14, 13, 12, 11, 10, 9, 8, + 7, 6, 5, 4, 3, 2, 1, 0); + __m128i h_abcd = _mm_shuffle_epi32( + _mm_loadu_si128((__m128i *)h), 0x1B); + __m128i h_e = _mm_setr_epi32(0, 0, 0, h[4]); + + do { + __m128i abcd = h_abcd; + __m128i w0, w1, w2, w3, we0, we1; + + SHA1_NI_16ROUNDS(0); + SHA1_NI_16ROUNDS(16); + SHA1_NI_16ROUNDS(32); + SHA1_NI_16ROUNDS(48); + SHA1_NI_16ROUNDS(64); + + h_abcd = _mm_add_epi32(h_abcd, abcd); + h_e = _mm_sha1nexte_epu32(we0, h_e); + data += SHA1_BLOCK_SIZE; + } while (--num_blocks); + + _mm_storeu_si128((__m128i *)h, _mm_shuffle_epi32(h_abcd, 0x1B)); + h[4] = _mm_extract_epi32(h_e, 3); +} +#endif /* x86 SHA Extensions implementation */ + +/*----------------------------------------------------------------------------* + * ARMv8 Crypto Extensions implementation * + *----------------------------------------------------------------------------*/ + +/* + * This is SHA-1 using the ARMv8 Crypto Extensions. + * + * This does 4 rounds at a time, and it works very similarily to the x86 SHA + * Extensions implementation. The differences are fairly minor: + * + * - x86 has SHA1RNDS4 that takes an immediate that identifies the set of 20 + * rounds, and it handles adding the round constants. ARM has SHA1C for + * rounds 0-19, SHA1P for rounds 20-39 and 60-79, and SHA1M for rounds 40-59. + * These don't add the round constants, so that must be done separately. + * + * - ARM needs only two instructions, instead of x86's three, to prepare each + * set of 4 message schedule words: SHA1SU0 which does w[i-16] ^ w[i-14] ^ + * w[i-8], and SHA1SU1 which XOR's in w[i-3] and rotates left by 1. + */ +#if defined(__aarch64__) && \ + (defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 5)) + +/* + * clang's arm_neon.h used to have a bug where it only defined the SHA-1 + * intrinsics when CRYPTO (clang 12 and earlier) or SHA2 (clang 13 and 14) is + * enabled in the main target. This prevents them from being used in target + * attribute functions. Work around this by defining the macros ourselves. + */ +#if defined(__clang__) && __clang_major__ <= 15 +# ifndef __ARM_FEATURE_CRYPTO +# define __ARM_FEATURE_CRYPTO 1 +# define DEFINED_ARM_FEATURE_CRYPTO +# endif +# ifndef __ARM_FEATURE_SHA2 +# define __ARM_FEATURE_SHA2 1 +# define DEFINED_ARM_FEATURE_SHA2 +# endif +#endif +#include <arm_neon.h> +#ifdef DEFINED_ARM_FEATURE_CRYPTO +# undef __ARM_FEATURE_CRYPTO +#endif +#ifdef DEFINED_ARM_FEATURE_SHA2 +# undef __ARM_FEATURE_SHA2 +#endif + +/* Expands to a vector containing 4 copies of the given round's constant */ +#define SHA1_CE_K(i) \ + ((i) < 20 ? k0 : \ + (i) < 40 ? k1 : \ + (i) < 60 ? k2 : \ + k3) + +/* Expands to the appropriate instruction for the given round */ +#define SHA1_CE_OP(i, abcd, e, w) \ + ((i) < 20 ? vsha1cq_u32((abcd), (e), (w)) : \ + (i) < 40 ? vsha1pq_u32((abcd), (e), (w)) : \ + (i) < 60 ? vsha1mq_u32((abcd), (e), (w)) : \ + vsha1pq_u32((abcd), (e), (w))) + +#define SHA1_CE_4ROUNDS(i, w0, w1, w2, w3, e0, e1) \ + tmp = w0 + SHA1_CE_K(i); \ + e1 = vsha1h_u32(vgetq_lane_u32(abcd, 0)); \ + abcd = SHA1_CE_OP((i), abcd, e0, tmp); \ + if ((i) >= 12 && (i) < 76) \ + w1 = vsha1su1q_u32(w1, w0); \ + if ((i) >= 8 && (i) < 72) \ + w2 = vsha1su0q_u32(w2, w3, w0); + /* + * implicit: the new (w0, w1, w2, w3) is the old (w1, w2, w3, w0), + * and the new (e0, e1) is the old (e1, e0) + */ + +#define SHA1_CE_16ROUNDS(i) \ + SHA1_CE_4ROUNDS((i) + 0, w0, w1, w2, w3, e0, e1); \ + SHA1_CE_4ROUNDS((i) + 4, w1, w2, w3, w0, e1, e0); \ + SHA1_CE_4ROUNDS((i) + 8, w2, w3, w0, w1, e0, e1); \ + SHA1_CE_4ROUNDS((i) + 12, w3, w0, w1, w2, e1, e0); + +#define HAVE_SHA1_BLOCKS_ARM_CE +static void +#ifdef __clang__ + /* + * clang has the SHA-1 instructions under "sha2". "crypto" used to work + * too, but only in clang 15 and earlier. So, use "sha2" here. + */ + __attribute__((target("sha2"))) +#else + /* gcc wants "+crypto". "+sha2" doesn't work. */ + __attribute__((target("+crypto"))) +#endif +sha1_blocks_arm_ce(u32 h[5], const void *data, size_t num_blocks) +{ + uint32x4_t h_abcd = vld1q_u32(h); + uint32x4_t k0 = vdupq_n_u32(SHA1_K(0)); + uint32x4_t k1 = vdupq_n_u32(SHA1_K(20)); + uint32x4_t k2 = vdupq_n_u32(SHA1_K(40)); + uint32x4_t k3 = vdupq_n_u32(SHA1_K(60)); + + do { + uint32x4_t abcd = h_abcd; + u32 e0 = h[4], e1; + uint32x4_t tmp, w0, w1, w2, w3; + + w0 = vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(data + 0))); + w1 = vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(data + 16))); + w2 = vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(data + 32))); + w3 = vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(data + 48))); + + SHA1_CE_16ROUNDS(0); + SHA1_CE_16ROUNDS(16); + SHA1_CE_16ROUNDS(32); + SHA1_CE_16ROUNDS(48); + SHA1_CE_16ROUNDS(64); + + h_abcd += abcd; + h[4] += e0; + data += SHA1_BLOCK_SIZE; + } while (--num_blocks); + + vst1q_u32(h, h_abcd); +} +#endif /* ARMv8 Crypto Extensions implementation */ + +/*----------------------------------------------------------------------------* + * Everything else * + *----------------------------------------------------------------------------*/ + +static void +sha1_blocks(u32 h[5], const void *data, size_t num_blocks) +{ +#ifdef HAVE_SHA1_BLOCKS_X86_SHA + if ((cpu_features & (X86_CPU_FEATURE_SHA | X86_CPU_FEATURE_SSE4_1)) == + (X86_CPU_FEATURE_SHA | X86_CPU_FEATURE_SSE4_1)) + return sha1_blocks_x86_sha(h, data, num_blocks); +#endif +#ifdef HAVE_SHA1_BLOCKS_X86_AVX_BMI2 + if ((cpu_features & (X86_CPU_FEATURE_AVX | X86_CPU_FEATURE_BMI2)) == + (X86_CPU_FEATURE_AVX | X86_CPU_FEATURE_BMI2)) + return sha1_blocks_x86_avx_bmi2(h, data, num_blocks); +#endif +#ifdef HAVE_SHA1_BLOCKS_X86_SSSE3 + if (cpu_features & X86_CPU_FEATURE_SSSE3) + return sha1_blocks_x86_ssse3(h, data, num_blocks); +#endif +#ifdef HAVE_SHA1_BLOCKS_ARM_CE + if (cpu_features & ARM_CPU_FEATURE_SHA1) + return sha1_blocks_arm_ce(h, data, num_blocks); +#endif + return sha1_blocks_generic(h, data, num_blocks); +} + +/* + * Initialize the given SHA-1 context. + * + * After sha1_init(), call sha1_update() zero or more times to provide the data + * to be hashed. Then call sha1_final() to get the resulting message digest. + */ +void +sha1_init(struct sha1_ctx *ctx) +{ + ctx->bytecount = 0; + + ctx->h[0] = 0x67452301; + ctx->h[1] = 0xEFCDAB89; + ctx->h[2] = 0x98BADCFE; + ctx->h[3] = 0x10325476; + ctx->h[4] = 0xC3D2E1F0; +} + +/* Update the SHA-1 context with @len bytes of data. */ +void +sha1_update(struct sha1_ctx *ctx, const void *data, size_t len) +{ + unsigned buffered = ctx->bytecount % SHA1_BLOCK_SIZE; + size_t blocks; + + ctx->bytecount += len; + + if (buffered) { + unsigned remaining = SHA1_BLOCK_SIZE - buffered; + + if (len < remaining) { + memcpy(&ctx->buffer[buffered], data, len); + return; + } + memcpy(&ctx->buffer[buffered], data, remaining); + sha1_blocks(ctx->h, ctx->buffer, 1); + data += remaining; + len -= remaining; + } + + blocks = len / SHA1_BLOCK_SIZE; + if (blocks) { + sha1_blocks(ctx->h, data, blocks); + data += blocks * SHA1_BLOCK_SIZE; + len -= blocks * SHA1_BLOCK_SIZE; + } + + if (len) + memcpy(ctx->buffer, data, len); +} + +/* Finalize the SHA-1 operation and return the resulting message digest. */ +void +sha1_final(struct sha1_ctx *ctx, u8 hash[SHA1_HASH_SIZE]) +{ + unsigned buffered = ctx->bytecount % SHA1_BLOCK_SIZE; + const be64 bitcount = cpu_to_be64(ctx->bytecount * 8); + + ctx->buffer[buffered++] = 0x80; + if (buffered > SHA1_BLOCK_SIZE - 8) { + memset(&ctx->buffer[buffered], 0, SHA1_BLOCK_SIZE - buffered); + sha1_blocks(ctx->h, ctx->buffer, 1); + buffered = 0; + } + memset(&ctx->buffer[buffered], 0, SHA1_BLOCK_SIZE - 8 - buffered); + memcpy(&ctx->buffer[SHA1_BLOCK_SIZE - 8], &bitcount, 8); + sha1_blocks(ctx->h, ctx->buffer, 1); + + put_unaligned_be32(ctx->h[0], &hash[0]); + put_unaligned_be32(ctx->h[1], &hash[4]); + put_unaligned_be32(ctx->h[2], &hash[8]); + put_unaligned_be32(ctx->h[3], &hash[12]); + put_unaligned_be32(ctx->h[4], &hash[16]); +} + +/* Calculate the SHA-1 message digest of the given data. */ +void +sha1(const void *data, size_t len, u8 hash[SHA1_HASH_SIZE]) +{ + struct sha1_ctx ctx; + + sha1_init(&ctx); + sha1_update(&ctx, data, len); + sha1_final(&ctx, hash); +} + +/* "Null" SHA-1 message digest containing all 0's */ +const u8 zero_hash[SHA1_HASH_SIZE]; + +/* Build a hexadecimal string representation of a SHA-1 message digest. */ +void +sprint_hash(const u8 hash[SHA1_HASH_SIZE], tchar strbuf[SHA1_HASH_STRING_LEN]) +{ + int i; + u8 high, low; + + for (i = 0; i < SHA1_HASH_SIZE; i++) { + high = hash[i] >> 4; + low = hash[i] & 0xF; + strbuf[i * 2 + 0] = (high < 10 ? high + '0' : high - 10 + 'a'); + strbuf[i * 2 + 1] = (low < 10 ? low + '0' : low - 10 + 'a'); + } + strbuf[i * 2] = 0; +} diff --git a/src/wimlib/solid.c b/src/wimlib/solid.c new file mode 100644 index 00000000..a6aef418 --- /dev/null +++ b/src/wimlib/solid.c @@ -0,0 +1,242 @@ +/* + * solid.c + * + * Heuristic sorting of blobs to optimize solid compression. + */ + +/* + * Copyright (C) 2015 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/blob_table.h" +#include "wimlib/dentry.h" +#include "wimlib/encoding.h" +#include "wimlib/endianness.h" +#include "wimlib/metadata.h" +#include "wimlib/paths.h" +#include "wimlib/solid.h" +#include "wimlib/unaligned.h" + +static const utf16lechar * +get_extension(const utf16lechar *name, size_t nbytes) +{ + const utf16lechar *p = name + (nbytes / sizeof(utf16lechar)); + for (;;) { + if (p == name) + return NULL; + if (*(p - 1) == cpu_to_le16('/') || *(p - 1) == cpu_to_le16('\\')) + return NULL; + if (*(p - 1) == cpu_to_le16('.')) + return p; + p--; + } +} + +/* + * Sort order for solid compression: + * + * 1. Blobs without sort names + * - sorted by sequential order + * 2. Blobs with sort names: + * a. Blobs whose sort name does not have an extension + * - sorted by sort name + * b. Blobs whose sort name has an extension + * - sorted primarily by extension (case insensitive), + * secondarily by sort name (case insensitive) + */ +static int +cmp_blobs_by_solid_sort_name(const void *p1, const void *p2) +{ + const struct blob_descriptor *blob1, *blob2; + + blob1 = *(const struct blob_descriptor **)p1; + blob2 = *(const struct blob_descriptor **)p2; + + if (blob1->solid_sort_name) { + if (!blob2->solid_sort_name) + return 1; + const utf16lechar *extension1 = get_extension(blob1->solid_sort_name, + blob1->solid_sort_name_nbytes); + const utf16lechar *extension2 = get_extension(blob2->solid_sort_name, + blob2->solid_sort_name_nbytes); + if (extension1) { + if (!extension2) + return 1; + int res = cmp_utf16le_strings_z(extension1, + extension2, + true); /* case insensitive */ + if (res) + return res; + } else { + if (extension2) + return -1; + } + int res = cmp_utf16le_strings(blob1->solid_sort_name, + blob1->solid_sort_name_nbytes / sizeof(utf16lechar), + blob2->solid_sort_name, + blob2->solid_sort_name_nbytes / sizeof(utf16lechar), + true); /* case insensitive */ + if (res) + return res; + } else { + if (blob2->solid_sort_name) + return -1; + } + return cmp_blobs_by_sequential_order(p1, p2); +} + +static void +blob_set_solid_sort_name_from_inode(struct blob_descriptor *blob, + const struct wim_inode *inode) +{ + const struct wim_dentry *dentry; + const utf16lechar *best_name = NULL; + size_t best_name_nbytes = SIZE_MAX; + + if (blob->solid_sort_name) /* Sort name already set? */ + return; + + /* If this file has multiple names, choose the shortest one. */ + inode_for_each_dentry(dentry, inode) { + if (dentry->d_name_nbytes < best_name_nbytes) { + best_name = dentry->d_name; + best_name_nbytes = dentry->d_name_nbytes; + } + } + blob->solid_sort_name = utf16le_dupz(best_name, best_name_nbytes); + blob->solid_sort_name_nbytes = best_name_nbytes; +} + +struct temp_blob_table { + struct hlist_head *table; + size_t capacity; +}; + +static int +dentry_fill_in_solid_sort_names(struct wim_dentry *dentry, void *_blob_table) +{ + const struct temp_blob_table *blob_table = _blob_table; + const struct wim_inode *inode = dentry->d_inode; + const u8 *hash; + struct hlist_head *head; + struct blob_descriptor *blob; + + hash = inode_get_hash_of_unnamed_data_stream(inode); + if (!hash) /* unhashed? */ + return 0; + head = &blob_table->table[load_size_t_unaligned(hash) % + blob_table->capacity]; + hlist_for_each_entry(blob, head, hash_list_2) { + if (hashes_equal(hash, blob->hash)) { + blob_set_solid_sort_name_from_inode(blob, inode); + break; + } + } + return 0; +} + +static int +image_fill_in_solid_sort_names(WIMStruct *wim) +{ + return for_dentry_in_tree(wim_get_current_root_dentry(wim), + dentry_fill_in_solid_sort_names, + wim->private); +} + +int +sort_blob_list_for_solid_compression(struct list_head *blob_list) +{ + size_t num_blobs = 0; + struct temp_blob_table blob_table; + WIMStruct *wims[128]; + int num_wims = 0; + struct blob_descriptor *blob; + int ret; + + /* Count the number of blobs to be written. */ + list_for_each_entry(blob, blob_list, write_blobs_list) + num_blobs++; + + /* Allocate a temporary hash table for mapping blob hash => blob */ + blob_table.capacity = num_blobs; + blob_table.table = CALLOC(blob_table.capacity, + sizeof(blob_table.table[0])); + if (!blob_table.table) + return WIMLIB_ERR_NOMEM; + + /* + * For each blob to be written: + * - Reset the sort name + * - If it's in non-solid WIM resource, then save the WIMStruct. + * - If it's in a file on disk, then set its sort name from that. + */ + list_for_each_entry(blob, blob_list, write_blobs_list) { + blob->solid_sort_name = NULL; + blob->solid_sort_name_nbytes = 0; + switch (blob->blob_location) { + case BLOB_IN_WIM: + if (blob->size != blob->rdesc->uncompressed_size) + continue; + for (int i = 0; i < num_wims; i++) + if (blob->rdesc->wim == wims[i]) + goto found_wim; + if (num_wims >= ARRAY_LEN(wims)) + continue; + wims[num_wims++] = blob->rdesc->wim; + found_wim: + hlist_add_head(&blob->hash_list_2, + &blob_table.table[load_size_t_unaligned(blob->hash) % + blob_table.capacity]); + break; + case BLOB_IN_FILE_ON_DISK: + #ifdef _WIN32 + case BLOB_IN_WINDOWS_FILE: + #endif + blob_set_solid_sort_name_from_inode(blob, blob->file_inode); + break; + default: + break; + } + } + + /* For each WIMStruct that was found, search for dentry references to + * each blob and fill in the sort name this way. This is useful e.g. + * when exporting a solid WIM file from a non-solid WIM file. */ + for (int i = 0; i < num_wims; i++) { + if (!wim_has_metadata(wims[i])) + continue; + wims[i]->private = &blob_table; + ret = for_image(wims[i], WIMLIB_ALL_IMAGES, + image_fill_in_solid_sort_names); + if (ret) + goto out; + deselect_current_wim_image(wims[i]); + } + + ret = sort_blob_list(blob_list, + offsetof(struct blob_descriptor, write_blobs_list), + cmp_blobs_by_solid_sort_name); + +out: + list_for_each_entry(blob, blob_list, write_blobs_list) + FREE(blob->solid_sort_name); + FREE(blob_table.table); + return ret; +} diff --git a/src/wimlib/split.c b/src/wimlib/split.c new file mode 100644 index 00000000..8205c71c --- /dev/null +++ b/src/wimlib/split.c @@ -0,0 +1,257 @@ +/* + * split.c + * + * Split a WIM file into parts. + */ + +/* + * Copyright (C) 2012, 2013 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib.h" +#include "wimlib/alloca.h" +#include "wimlib/blob_table.h" +#include "wimlib/error.h" +#include "wimlib/list.h" +#include "wimlib/metadata.h" +#include "wimlib/paths.h" +#include "wimlib/progress.h" +#include "wimlib/resource.h" +#include "wimlib/wim.h" +#include "wimlib/write.h" + +struct swm_part_info { + struct list_head blob_list; + u64 size; +}; + +static void +copy_part_info(struct swm_part_info *dst, struct swm_part_info *src) +{ + list_replace(&src->blob_list, &dst->blob_list); + dst->size = src->size; +} + +struct swm_info { + struct swm_part_info *parts; + unsigned num_parts; + unsigned num_alloc_parts; + u64 total_bytes; + u64 max_part_size; +}; + +static int +write_split_wim(WIMStruct *orig_wim, const tchar *swm_name, + struct swm_info *swm_info, int write_flags) +{ + size_t swm_name_len; + tchar *swm_name_buf; + const tchar *dot; + tchar *swm_suffix; + size_t swm_base_name_len; + + union wimlib_progress_info progress; + unsigned part_number; + int ret; + u8 guid[GUID_SIZE]; + + swm_name_len = tstrlen(swm_name); + swm_name_buf = alloca((swm_name_len + 20) * sizeof(tchar)); + tstrcpy(swm_name_buf, swm_name); + dot = tstrrchr(path_basename(swm_name_buf), T('.')); + if (dot) { + swm_base_name_len = dot - swm_name_buf; + swm_suffix = alloca((tstrlen(dot) + 1) * sizeof(tchar)); + tstrcpy(swm_suffix, dot); + } else { + swm_base_name_len = swm_name_len; + swm_suffix = alloca(1 * sizeof(tchar)); + swm_suffix[0] = T('\0'); + } + + progress.split.completed_bytes = 0; + progress.split.total_bytes = 0; + for (part_number = 1; part_number <= swm_info->num_parts; part_number++) + progress.split.total_bytes += swm_info->parts[part_number - 1].size; + progress.split.total_parts = swm_info->num_parts; + + generate_guid(guid); + + for (part_number = 1; part_number <= swm_info->num_parts; part_number++) { + int part_write_flags; + + if (part_number != 1) { + tsprintf(swm_name_buf + swm_base_name_len, + T("%u%"TS), part_number, swm_suffix); + } + + progress.split.cur_part_number = part_number; + progress.split.part_name = swm_name_buf; + + ret = call_progress(orig_wim->progfunc, + WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART, + &progress, + orig_wim->progctx); + if (ret) + return ret; + + part_write_flags = write_flags; + part_write_flags |= WIMLIB_WRITE_FLAG_USE_EXISTING_TOTALBYTES; + if (part_number != 1) + part_write_flags |= WIMLIB_WRITE_FLAG_NO_METADATA; + + ret = write_wim_part(orig_wim, + progress.split.part_name, + WIMLIB_ALL_IMAGES, + part_write_flags, + 1, + part_number, + swm_info->num_parts, + &swm_info->parts[part_number - 1].blob_list, + guid); + if (ret) + return ret; + + progress.split.completed_bytes += swm_info->parts[part_number - 1].size; + + ret = call_progress(orig_wim->progfunc, + WIMLIB_PROGRESS_MSG_SPLIT_END_PART, + &progress, + orig_wim->progctx); + if (ret) + return ret; + } + return 0; +} + +static int +start_new_swm_part(struct swm_info *swm_info) +{ + if (swm_info->num_parts == swm_info->num_alloc_parts) { + struct swm_part_info *parts; + size_t num_alloc_parts = swm_info->num_alloc_parts; + + num_alloc_parts += 8; + parts = MALLOC(num_alloc_parts * sizeof(parts[0])); + if (!parts) + return WIMLIB_ERR_NOMEM; + + for (unsigned i = 0; i < swm_info->num_parts; i++) + copy_part_info(&parts[i], &swm_info->parts[i]); + + FREE(swm_info->parts); + swm_info->parts = parts; + swm_info->num_alloc_parts = num_alloc_parts; + } + swm_info->num_parts++; + INIT_LIST_HEAD(&swm_info->parts[swm_info->num_parts - 1].blob_list); + swm_info->parts[swm_info->num_parts - 1].size = 0; + return 0; +} + +static int +add_blob_to_swm(struct blob_descriptor *blob, void *_swm_info) +{ + struct swm_info *swm_info = _swm_info; + u64 blob_stored_size; + int ret; + + if (blob->blob_location == BLOB_IN_WIM) + blob_stored_size = blob->rdesc->size_in_wim; + else + blob_stored_size = blob->size; + + /* Start the next part if adding this blob exceeds the maximum part + * size, UNLESS the blob is metadata or if no blobs at all have been + * added to the current part. */ + if ((swm_info->parts[swm_info->num_parts - 1].size + + blob_stored_size >= swm_info->max_part_size) + && !(blob->is_metadata || + swm_info->parts[swm_info->num_parts - 1].size == 0)) + { + ret = start_new_swm_part(swm_info); + if (ret) + return ret; + } + swm_info->parts[swm_info->num_parts - 1].size += blob_stored_size; + if (!blob->is_metadata) { + list_add_tail(&blob->write_blobs_list, + &swm_info->parts[swm_info->num_parts - 1].blob_list); + } + swm_info->total_bytes += blob_stored_size; + return 0; +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_split(WIMStruct *wim, const tchar *swm_name, + u64 part_size, int write_flags) +{ + struct swm_info swm_info; + unsigned i; + int ret; + + if (swm_name == NULL || swm_name[0] == T('\0') || part_size == 0) + return WIMLIB_ERR_INVALID_PARAM; + + if (write_flags & ~WIMLIB_WRITE_MASK_PUBLIC) + return WIMLIB_ERR_INVALID_PARAM; + + if (!wim_has_metadata(wim)) + return WIMLIB_ERR_METADATA_NOT_FOUND; + + if (wim_has_solid_resources(wim)) { + ERROR("Splitting of WIM containing solid resources is not supported.\n" + " Export it in non-solid format first."); + return WIMLIB_ERR_UNSUPPORTED; + } + + for (i = 0; i < wim->hdr.image_count; i++) { + if (!is_image_unchanged_from_wim(wim->image_metadata[i], wim)) { + ERROR("Only an unmodified, on-disk WIM file can be split."); + return WIMLIB_ERR_UNSUPPORTED; + } + } + + memset(&swm_info, 0, sizeof(swm_info)); + swm_info.max_part_size = part_size; + + ret = start_new_swm_part(&swm_info); + if (ret) + goto out_free_swm_info; + + for (i = 0; i < wim->hdr.image_count; i++) { + ret = add_blob_to_swm(wim->image_metadata[i]->metadata_blob, + &swm_info); + if (ret) + goto out_free_swm_info; + } + + ret = for_blob_in_table_sorted_by_sequential_order(wim->blob_table, + add_blob_to_swm, + &swm_info); + if (ret) + goto out_free_swm_info; + + ret = write_split_wim(wim, swm_name, &swm_info, write_flags); +out_free_swm_info: + FREE(swm_info.parts); + return ret; +} diff --git a/src/wimlib/tagged_items.c b/src/wimlib/tagged_items.c new file mode 100644 index 00000000..dee06517 --- /dev/null +++ b/src/wimlib/tagged_items.c @@ -0,0 +1,230 @@ +/* + * tagged_items.c + * + * Support for tagged metadata items that can be appended to WIM directory + * entries. + */ + +/* + * Copyright (C) 2014-2016 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/assert.h" +#include "wimlib/endianness.h" +#include "wimlib/inode.h" +#include "wimlib/tagged_items.h" +#include "wimlib/unix_data.h" + +/* + * Header that begins each tagged metadata item associated with a file in a WIM + * metadata resource + */ +struct tagged_item_header { + + /* identifies the type of metadata item (see TAG_* constants) */ + le32 tag; + + /* size of this item's data in bytes, excluding this header */ + le32 length; + + /* followed by the item's data */ + u8 data[0]; + + /* then zero-padded to an 8-byte boundary */ +} __attribute__((aligned(8))); + +/* + * Retrieve from @inode the first metadata item that is tagged with @tag and + * contains at least @min_len bytes of data. If found, return a pointer to the + * item's data and write its actual length to @actual_len_ret if not NULL. If + * not found, return NULL. + */ +void * +inode_get_tagged_item(const struct wim_inode *inode, u32 tag, u32 min_len, + u32 *actual_len_ret) +{ + struct tagged_item_header *hdr; + size_t len_remaining; + + STATIC_ASSERT(sizeof(*hdr) == 8); + + if (!inode->i_extra) + return NULL; + + hdr = (struct tagged_item_header *)inode->i_extra->data; + len_remaining = inode->i_extra->size; + + /* Iterate through the tagged items. */ + while (len_remaining >= sizeof(*hdr) + min_len) { + u32 len = le32_to_cpu(hdr->length); + u32 full_len = sizeof(*hdr) + ALIGN(len, 8); + + /* Length overflow (corrupted item list)? */ + if (unlikely(full_len < len || full_len > len_remaining)) + return NULL; + + /* Matches the item we wanted? */ + if (le32_to_cpu(hdr->tag) == tag && len >= min_len) { + if (actual_len_ret) + *actual_len_ret = len; + return hdr->data; + } + + len_remaining -= full_len; + hdr = (struct tagged_item_header *)((u8 *)hdr + full_len); + } + return NULL; +} + +/* + * Add a tagged item to the specified inode and return a pointer to its + * uninitialized data, which the caller must initialize. No check is made for + * whether the inode already has item(s) with the specified tag. + */ +static void * +inode_add_tagged_item(struct wim_inode *inode, u32 tag, u32 len) +{ + struct wim_inode_extra *extra; + struct tagged_item_header *hdr; + size_t oldsize = (inode->i_extra ? inode->i_extra->size : 0); + size_t newsize = oldsize + sizeof(*hdr) + ALIGN(len, 8); + + wimlib_assert(oldsize % 8 == 0); + + extra = REALLOC(inode->i_extra, sizeof(*extra) + newsize); + if (!extra) + return NULL; + inode->i_extra = extra; + extra->size = newsize; + hdr = (struct tagged_item_header *)&extra->data[oldsize]; + hdr->tag = cpu_to_le32(tag); + hdr->length = cpu_to_le32(len); + memset(hdr->data + len, 0, -len & 7); /* pad to next 8-byte boundary */ + return hdr->data; +} + +/* + * Add a tagged item containing the specified data to the specified inode, first + * removing any existing items with the same tag. Returns %true if successful, + * %false if failed (out of memory). + */ +bool +inode_set_tagged_item(struct wim_inode *inode, u32 tag, + const void *data, u32 len) +{ + u8 *p; + u32 old_len; + + /* Remove any existing items with the same tag */ + while ((p = inode_get_tagged_item(inode, tag, 0, &old_len)) != NULL) { + p -= sizeof(struct tagged_item_header); + old_len += sizeof(struct tagged_item_header); + old_len = ALIGN(old_len, 8); + memmove(p, p + old_len, (inode->i_extra->data + + inode->i_extra->size) - (p + old_len)); + inode->i_extra->size -= old_len; + } + + /* Add the new item */ + p = inode_add_tagged_item(inode, tag, len); + if (!p) + return false; + memcpy(p, data, len); + return true; +} + +struct wimlib_unix_data_disk { + le32 uid; + le32 gid; + le32 mode; + le32 rdev; +}; + +static inline struct wimlib_unix_data_disk * +inode_get_unix_data_disk(const struct wim_inode *inode) +{ + return inode_get_tagged_item(inode, TAG_WIMLIB_UNIX_DATA, + sizeof(struct wimlib_unix_data_disk), + NULL); +} + +/* Return %true iff the specified inode has standard UNIX metadata. */ +bool +inode_has_unix_data(const struct wim_inode *inode) +{ + return inode_get_unix_data_disk(inode) != NULL; +} + +/* + * Get an inode's standard UNIX metadata. + * + * If the inode has standard UNIX metadata, returns %true and fills @unix_data. + * Otherwise returns %false. + */ +bool +inode_get_unix_data(const struct wim_inode *inode, + struct wimlib_unix_data *unix_data) +{ + const struct wimlib_unix_data_disk *p; + + p = inode_get_unix_data_disk(inode); + if (!p) + return false; + + unix_data->uid = le32_to_cpu(p->uid); + unix_data->gid = le32_to_cpu(p->gid); + unix_data->mode = le32_to_cpu(p->mode); + unix_data->rdev = le32_to_cpu(p->rdev); + return true; +} + +/* + * Set an inode's standard UNIX metadata. + * + * Callers must specify all members in @unix_data. If the inode does not yet + * have standard UNIX metadata, it is given these values. Otherwise, only the + * values that also have the corresponding flags in @which set are changed. + * + * Returns %true if successful, %false if failed (out of memory). + */ +bool +inode_set_unix_data(struct wim_inode *inode, struct wimlib_unix_data *unix_data, + int which) +{ + struct wimlib_unix_data_disk *p; + + p = inode_get_unix_data_disk(inode); + if (!p) { + p = inode_add_tagged_item(inode, TAG_WIMLIB_UNIX_DATA, + sizeof(*p)); + if (!p) + return false; + which = UNIX_DATA_ALL; + } + if (which & UNIX_DATA_UID) + p->uid = cpu_to_le32(unix_data->uid); + if (which & UNIX_DATA_GID) + p->gid = cpu_to_le32(unix_data->gid); + if (which & UNIX_DATA_MODE) + p->mode = cpu_to_le32(unix_data->mode); + if (which & UNIX_DATA_RDEV) + p->rdev = cpu_to_le32(unix_data->rdev); + return true; +} diff --git a/src/wimlib/textfile.c b/src/wimlib/textfile.c new file mode 100644 index 00000000..d41464cd --- /dev/null +++ b/src/wimlib/textfile.c @@ -0,0 +1,404 @@ +/* + * textfile.c + */ + +/* + * Copyright (C) 2014 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <ctype.h> +#include <errno.h> +#include <fcntl.h> +#include <string.h> +#include <sys/stat.h> +#include <unistd.h> + +#include "wimlib/encoding.h" +#include "wimlib/error.h" +#include "wimlib/file_io.h" +#include "wimlib/textfile.h" +#include "wimlib/util.h" + +static int +stdin_get_contents(void **buf_ret, size_t *bufsize_ret) +{ + char *buf = NULL; + size_t filled = 0; + size_t capacity = 0; + + do { + size_t new_capacity = (capacity * 2) + 256; + char *new_buf; + + if (new_capacity <= capacity || + !(new_buf = REALLOC(buf, new_capacity))) { + ERROR("Too much data sent on stdin!"); + FREE(buf); + return WIMLIB_ERR_INVALID_PARAM; + } + buf = new_buf; + capacity = new_capacity; + filled += fread(&buf[filled], 1, capacity - filled, stdin); + } while (filled == capacity); + + if (!feof(stdin)) { + ERROR_WITH_ERRNO("Error reading stdin"); + FREE(buf); + return WIMLIB_ERR_READ; + } + *buf_ret = buf; + *bufsize_ret = filled; + return 0; +} + +static int +read_file_contents(const tchar *path, void **buf_ret, size_t *bufsize_ret) +{ + int raw_fd; + struct filedes fd; + struct stat st; + void *buf; + int ret; + int errno_save; + + raw_fd = topen(path, O_RDONLY | O_BINARY); + if (raw_fd < 0) { + ERROR_WITH_ERRNO("Can't open \"%"TS"\"", path); + return WIMLIB_ERR_OPEN; + } + if (fstat(raw_fd, &st)) { + ERROR_WITH_ERRNO("Can't stat \"%"TS"\"", path); + close(raw_fd); + return WIMLIB_ERR_STAT; + } + if ((size_t)st.st_size != st.st_size || + (buf = MALLOC(st.st_size)) == NULL) + { + close(raw_fd); + ERROR("Not enough memory to read \"%"TS"\"", path); + return WIMLIB_ERR_NOMEM; + } + + filedes_init(&fd, raw_fd); + ret = full_read(&fd, buf, st.st_size); + errno_save = errno; + filedes_close(&fd); + errno = errno_save; + if (ret) { + ERROR_WITH_ERRNO("Error reading \"%"TS"\"", path); + FREE(buf); + return ret; + } + + *buf_ret = buf; + *bufsize_ret = st.st_size; + return 0; +} + +static int +translate_text_buffer(const u8 *buf_raw, size_t bufsize_raw, + tchar **tstr_ret, size_t *tstr_nchars_ret) +{ + size_t offset_raw; + bool utf8; + tchar *buf_tstr; + size_t bufsize_tstr; + int ret; + + /* Guess the encoding: UTF-8 or UTF-16LE. (Something weirder and you're + * out of luck, sorry...) */ + if (bufsize_raw >= 2 && + buf_raw[0] == 0xFF && + buf_raw[1] == 0xFE) + { + utf8 = false; + offset_raw = 2; + } + else if (bufsize_raw >= 2 && + buf_raw[0] <= 0x7F && + buf_raw[1] == 0x00) + { + utf8 = false; + offset_raw = 0; + } + else if (bufsize_raw >= 3 && + buf_raw[0] == 0xEF && + buf_raw[1] == 0xBB && + buf_raw[2] == 0xBF) + { + utf8 = true; + offset_raw = 3; + } + else + { + utf8 = true; + offset_raw = 0; + } + + if (utf8) { + ret = utf8_to_tstr((const char *)(buf_raw + offset_raw), + bufsize_raw - offset_raw, + &buf_tstr, &bufsize_tstr); + } else { + ret = utf16le_to_tstr((const utf16lechar *)(buf_raw + offset_raw), + bufsize_raw - offset_raw, + &buf_tstr, &bufsize_tstr); + } + if (ret) + return ret; + + *tstr_ret = buf_tstr; + *tstr_nchars_ret = bufsize_tstr / sizeof(tchar); + return 0; +} + +static int +string_list_append(struct string_list *list, tchar *str) +{ + size_t num_alloc_strings = list->num_alloc_strings; + + if (list->num_strings == num_alloc_strings) { + tchar **new_strings; + + num_alloc_strings = max(num_alloc_strings * 3 / 2, + num_alloc_strings + 4); + new_strings = REALLOC(list->strings, + sizeof(list->strings[0]) * num_alloc_strings); + if (!new_strings) + return WIMLIB_ERR_NOMEM; + list->strings = new_strings; + list->num_alloc_strings = num_alloc_strings; + } + list->strings[list->num_strings++] = str; + return 0; +} + +#define NOT_IN_SECTION -1 +#define IN_UNKNOWN_SECTION -2 + +static int +parse_text_file(const tchar *path, tchar *buf, size_t buflen, + const struct text_file_section *pos_sections, + int num_pos_sections, int flags, line_mangle_t mangle_line) +{ + int current_section = NOT_IN_SECTION; + bool have_named_sections = false; + tchar *p; + tchar *nl; + unsigned long line_no = 1; + + for (int i = 0; i < num_pos_sections; i++) { + if (*pos_sections[i].name) + have_named_sections = true; + else + current_section = i; + } + + for (p = buf; p != buf + buflen; p = nl + 1, line_no++) { + tchar *line_begin, *line_end; + size_t line_len; + int ret; + + nl = tmemchr(p, T('\n'), buf + buflen - p); + if (!nl) + break; + + line_begin = p; + line_end = nl; + + /* Ignore leading whitespace. */ + while (line_begin < nl && istspace(*line_begin)) + line_begin++; + + /* Ignore trailing whitespace. */ + while (line_end > line_begin && istspace(*(line_end - 1))) + line_end--; + + line_len = line_end - line_begin; + + /* Ignore comments and empty lines. */ + if (line_len == 0 || *line_begin == T(';') || *line_begin == T('#')) + continue; + + line_begin[line_len] = T('\0'); + + /* Check for beginning of new section. */ + if (line_begin[0] == T('[') && + line_begin[line_len - 1] == T(']') && + have_named_sections) + { + line_begin[line_len - 1] = T('\0'); + current_section = IN_UNKNOWN_SECTION; + for (int i = 0; i < num_pos_sections; i++) { + if (!tstrcmp(line_begin + 1, + pos_sections[i].name)) + { + current_section = i; + break; + } + } + line_begin[line_len - 1] = T(']'); + if (current_section < 0) { + if (!(flags & LOAD_TEXT_FILE_NO_WARNINGS)) { + WARNING("%"TS":%lu: Unrecognized section \"%"TS"\"", + path, line_no, line_begin); + } + } + continue; + } + + if (current_section < 0) { + if (current_section == NOT_IN_SECTION) { + if (!(flags & LOAD_TEXT_FILE_NO_WARNINGS)) { + WARNING("%"TS":%lu: Not in a bracketed section!", + path, line_no); + } + } + continue; + } + + if (flags & LOAD_TEXT_FILE_REMOVE_QUOTES) { + if (line_begin[0] == T('"') || line_begin[0] == T('\'')) { + tchar quote = line_begin[0]; + if (line_len >= 2 && + line_begin[line_len - 1] == quote) + { + line_begin++; + line_len -= 2; + line_begin[line_len] = T('\0'); + } + } + } + + if (mangle_line) { + ret = (*mangle_line)(line_begin, path, line_no); + if (ret) + return ret; + } + + ret = string_list_append(pos_sections[current_section].strings, + line_begin); + if (ret) + return ret; + } + return 0; +} + +/** + * load_text_file - + * + * Read and parse lines from a text file given as an on-disk file, standard + * input, or a buffer. The file may contain sections, like in an INI file. + * + * @path + * If @buf is NULL, then either the path to the file on-disk to read, or + * NULL to read from standard input. Else, a dummy name for the buffer. + * @buf + * If NULL, the data will be read from the @path file. Otherwise the data + * will be read from this buffer. + * @bufsize + * Length of buffer in bytes; ignored if @buf is NULL. + * @mem_ret + * On success, a pointer to a buffer backing the parsed lines is stored + * here. This must be freed after the parsed lines are done being used. + * @pos_sections + * Specifications of allowed sections in the file. Each such specification + * consists of the name of the section (e.g. [ExclusionList], like in the + * INI file format), along with a pointer to the list of lines parsed for + * that section. Use an empty name to indicate the destination of lines + * not in any section. Each list must be initialized to empty. + * @num_pos_sections + * Number of entries in the @pos_sections array. + * @flags + * Flags: LOAD_TEXT_FILE_* flags. + * @mangle_line + * Optional callback to validate and/or modify each line being read. + * + * Returns 0 on success; nonzero on failure. + * + * Unknown sections are ignored, but a warning is printed for each, unless + * LOAD_TEXT_FILE_NO_WARNINGS is specified. + */ +int +load_text_file(const tchar *path, const void *buf, size_t bufsize, + void **mem_ret, + const struct text_file_section *pos_sections, + int num_pos_sections, + int flags, line_mangle_t mangle_line) +{ + int ret; + bool is_filemode = (buf == NULL); + bool is_stdin = (is_filemode && path == NULL); + tchar *tstr; + size_t tstr_nchars; + + if (is_stdin && !(flags & LOAD_TEXT_FILE_ALLOW_STDIN)) + return WIMLIB_ERR_INVALID_PARAM; + + if (is_filemode) { + if (is_stdin) + ret = stdin_get_contents((void **)&buf, &bufsize); + else + ret = read_file_contents(path, (void **)&buf, &bufsize); + if (ret) + return ret; + } + + ret = translate_text_buffer(buf, bufsize, &tstr, &tstr_nchars); + if (is_filemode) + FREE((void *)buf); + if (ret) + return ret; + + tstr[tstr_nchars++] = T('\n'); + + ret = parse_text_file(is_stdin ? T("<stdin>") : path, + tstr, tstr_nchars, pos_sections, + num_pos_sections, flags, mangle_line); + if (ret) { + for (int i = 0; i < num_pos_sections; i++) + FREE(pos_sections[i].strings->strings); + FREE(tstr); + return ret; + } + + *mem_ret = tstr; + return 0; +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_load_text_file(const tchar *path, + tchar **tstr_ret, size_t *tstr_nchars_ret) +{ + void *buf; + size_t bufsize; + int ret; + + if (path == NULL || (path[0] == '-' && path[1] == '\0')) + ret = stdin_get_contents(&buf, &bufsize); + else + ret = read_file_contents(path, &buf, &bufsize); + if (ret) + return ret; + ret = translate_text_buffer(buf, bufsize, tstr_ret, tstr_nchars_ret); + FREE(buf); + return ret; +} diff --git a/src/wimlib/threads.c b/src/wimlib/threads.c new file mode 100644 index 00000000..1b1028a0 --- /dev/null +++ b/src/wimlib/threads.c @@ -0,0 +1,244 @@ +/* + * threads.c - Thread, mutex, and condition variable support. Wraps around + * pthreads or Windows native threads. + */ + +/* + * Copyright 2016-2023 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef _WIN32 +# include "wimlib/win32_common.h" +#else +# include <errno.h> +# include <pthread.h> +#endif + +#include "wimlib/assert.h" +#include "wimlib/error.h" +#include "wimlib/threads.h" +#include "wimlib/util.h" + +#ifdef _WIN32 + +static WINAPI DWORD +win32_thrproc(LPVOID lpParameter) +{ + struct thread *t = (struct thread *)lpParameter; + + (*t->thrproc)(t->arg); + return 0; +} + +bool thread_create(struct thread *t, void *(*thrproc)(void *), void *arg) +{ + HANDLE h; + + t->thrproc = thrproc; + t->arg = arg; + h = CreateThread(NULL, 0, win32_thrproc, (LPVOID)t, 0, NULL); + if (h == NULL) { + win32_error(GetLastError(), L"Failed to create thread"); + return false; + } + t->win32_thread = (void *)h; + return true; +} + +void thread_join(struct thread *t) +{ + DWORD res = WaitForSingleObject((HANDLE)t->win32_thread, INFINITE); + + wimlib_assert(res == WAIT_OBJECT_0); +} + +bool mutex_init(struct mutex *m) +{ + CRITICAL_SECTION *crit = MALLOC(sizeof(*crit)); + + if (!crit) + return false; + InitializeCriticalSection(crit); + m->win32_crit = crit; + return true; +} + +void mutex_destroy(struct mutex *m) +{ + DeleteCriticalSection(m->win32_crit); + FREE(m->win32_crit); + m->win32_crit = NULL; +} + +void mutex_lock(struct mutex *m) +{ + CRITICAL_SECTION *crit = m->win32_crit; + + if (unlikely(!crit)) { + CRITICAL_SECTION *old; + + crit = MALLOC(sizeof(*crit)); + wimlib_assert(crit != NULL); + InitializeCriticalSection(crit); + old = InterlockedCompareExchangePointer(&m->win32_crit, crit, + NULL); + if (old) { + DeleteCriticalSection(crit); + FREE(crit); + crit = old; + } + } + EnterCriticalSection(crit); +} + +void mutex_unlock(struct mutex *m) +{ + LeaveCriticalSection(m->win32_crit); +} + +bool condvar_init(struct condvar *c) +{ + CONDITION_VARIABLE *cond = MALLOC(sizeof(*cond)); + + if (!cond) + return false; + InitializeConditionVariable(cond); + c->win32_cond = cond; + return true; +} + +void condvar_destroy(struct condvar *c) +{ + FREE(c->win32_cond); + c->win32_cond = NULL; +} + +void condvar_wait(struct condvar *c, struct mutex *m) +{ + BOOL ok = SleepConditionVariableCS(c->win32_cond, m->win32_crit, + INFINITE); + wimlib_assert(ok); +} + +void condvar_signal(struct condvar *c) +{ + WakeConditionVariable(c->win32_cond); +} + +void condvar_broadcast(struct condvar *c) +{ + WakeAllConditionVariable(c->win32_cond); +} + +#else /* _WIN32 */ + +bool thread_create(struct thread *t, void *(*thrproc)(void *), void *arg) +{ + int err = pthread_create(&t->pthread, NULL, thrproc, arg); + + if (err) { + errno = err; + ERROR_WITH_ERRNO("Failed to create thread"); + return false; + } + return true; +} + +void thread_join(struct thread *t) +{ + int err = pthread_join(t->pthread, NULL); + + wimlib_assert(err == 0); +} + +bool mutex_init(struct mutex *m) +{ + int err = pthread_mutex_init(&m->pthread_mutex, NULL); + + if (err) { + errno = err; + ERROR_WITH_ERRNO("Failed to initialize mutex"); + return false; + } + return true; +} + +void mutex_destroy(struct mutex *m) +{ + int err = pthread_mutex_destroy(&m->pthread_mutex); + + wimlib_assert(err == 0); +} + +void mutex_lock(struct mutex *m) +{ + int err = pthread_mutex_lock(&m->pthread_mutex); + + wimlib_assert(err == 0); +} + +void mutex_unlock(struct mutex *m) +{ + int err = pthread_mutex_unlock(&m->pthread_mutex); + + wimlib_assert(err == 0); +} + +bool condvar_init(struct condvar *c) +{ + int err = pthread_cond_init(&c->pthread_cond, NULL); + + if (err) { + errno = err; + ERROR_WITH_ERRNO("Failed to initialize condition variable"); + return false; + } + return true; +} + +void condvar_destroy(struct condvar *c) +{ + int err = pthread_cond_destroy(&c->pthread_cond); + + wimlib_assert(err == 0); +} + +void condvar_wait(struct condvar *c, struct mutex *m) +{ + int err = pthread_cond_wait(&c->pthread_cond, &m->pthread_mutex); + + wimlib_assert(err == 0); +} + +void condvar_signal(struct condvar *c) +{ + int err = pthread_cond_signal(&c->pthread_cond); + + wimlib_assert(err == 0); +} + +void condvar_broadcast(struct condvar *c) +{ + int err = pthread_cond_broadcast(&c->pthread_cond); + + wimlib_assert(err == 0); +} + +#endif /* !_WIN32 */ diff --git a/src/wimlib/timestamp.c b/src/wimlib/timestamp.c new file mode 100644 index 00000000..70b2e5f3 --- /dev/null +++ b/src/wimlib/timestamp.c @@ -0,0 +1,143 @@ +/* + * timestamp.c + * + * Conversion between Windows NT timestamps and UNIX timestamps. + */ + +/* + * Copyright (C) 2012-2017 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib.h" /* for struct wimlib_timespec */ +#include "wimlib/timestamp.h" + +/* + * Timestamps in WIM files are Windows NT timestamps, or FILETIMEs: 64-bit + * values storing the number of 100-nanosecond ticks since January 1, 1601. + * + * Note: UNIX timestamps are signed; Windows timestamps are not. Negative UNIX + * timestamps represent times before 1970-01-01. When such a timestamp is + * converted to a Windows timestamp, we can preserve the correct date provided + * that it is not also before 1601-01-01. + */ + +#define NANOSECONDS_PER_TICK 100 +#define TICKS_PER_SECOND (1000000000 / NANOSECONDS_PER_TICK) +#define TICKS_PER_MICROSECOND (TICKS_PER_SECOND / 1000000) + +/* + * EPOCH_DISTANCE is the number of seconds separating the Windows NT and UNIX + * epochs. This is equal to ((1970-1601)*365+89)*24*60*60. 89 is the number + * of leap years between 1970 and 1601. + */ +#define EPOCH_DISTANCE 11644473600 + +/* Windows NT timestamps to UNIX timestamps */ + +time_t +wim_timestamp_to_time_t(u64 timestamp) +{ + return (timestamp / TICKS_PER_SECOND) - EPOCH_DISTANCE; +} + +void +wim_timestamp_to_wimlib_timespec(u64 timestamp, struct wimlib_timespec *wts, + s32 *high_part_ret) +{ + s64 sec = (timestamp / TICKS_PER_SECOND) - EPOCH_DISTANCE; + + wts->tv_sec = sec; + wts->tv_nsec = (timestamp % TICKS_PER_SECOND) * NANOSECONDS_PER_TICK; + + if (sizeof(wts->tv_sec) == 4) + *high_part_ret = sec >> 32; +} + +#ifdef _WIN32 +static void __attribute__((unused)) +check_sizeof_time_t(void) +{ + /* Windows builds should always be using 64-bit time_t now. */ + STATIC_ASSERT(sizeof(time_t) == 8); +} +#else +struct timeval +wim_timestamp_to_timeval(u64 timestamp) +{ + return (struct timeval) { + .tv_sec = wim_timestamp_to_time_t(timestamp), + .tv_usec = (timestamp % TICKS_PER_SECOND) / TICKS_PER_MICROSECOND, + }; +} + +struct timespec +wim_timestamp_to_timespec(u64 timestamp) +{ + return (struct timespec) { + .tv_sec = wim_timestamp_to_time_t(timestamp), + .tv_nsec = (timestamp % TICKS_PER_SECOND) * NANOSECONDS_PER_TICK, + }; +} +#endif /* !_WIN32 */ + +/* UNIX timestamps to Windows NT timestamps */ + +u64 +time_t_to_wim_timestamp(time_t t) +{ + return ((u64)t + EPOCH_DISTANCE) * TICKS_PER_SECOND; +} + +#ifndef _WIN32 +u64 +timeval_to_wim_timestamp(const struct timeval *tv) +{ + return time_t_to_wim_timestamp(tv->tv_sec) + + (u32)tv->tv_usec * TICKS_PER_MICROSECOND; +} + +u64 +timespec_to_wim_timestamp(const struct timespec *ts) +{ + return time_t_to_wim_timestamp(ts->tv_sec) + + (u32)ts->tv_nsec / NANOSECONDS_PER_TICK; +} + +/* Retrieve the current time as a WIM timestamp. */ +u64 +now_as_wim_timestamp(void) +{ + struct timeval tv; + + gettimeofday(&tv, NULL); + return timeval_to_wim_timestamp(&tv); +} +#endif /* !_WIN32 */ + +/* Translate a WIM timestamp into a human-readable string. */ +void +wim_timestamp_to_str(u64 timestamp, tchar *buf, size_t len) +{ + struct tm tm; + time_t t = wim_timestamp_to_time_t(timestamp); + + gmtime_r(&t, &tm); + tstrftime(buf, len, T("%a %b %d %H:%M:%S %Y UTC"), &tm); +} diff --git a/src/wimlib/update_image.c b/src/wimlib/update_image.c new file mode 100644 index 00000000..c4a2d571 --- /dev/null +++ b/src/wimlib/update_image.c @@ -0,0 +1,1523 @@ +/* + * update_image.c - see description below + */ + +/* + * Copyright (C) 2013, 2014 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +/* + * This file contains the implementation of wimlib_update_image(), which is one + * of the two ways by which library users can make changes to a WIM image. (The + * other way is by mounting an image read-write.) wimlib_update_image() is also + * used in the implementation of wimlib_add_image(), since "create a WIM image + * from this directory tree" is equivalent to "create an empty WIM image, then + * update it to add this directory tree as the root". + * + * wimlib_update_image() processes a list of commands passed to it. Currently, + * the following types of commands are supported: + * + * - Add a directory tree from an external source (filesystem or NTFS volume). + * This can be used to add new files or to replace existing files. + * - Delete a file or directory tree. + * - Rename a file or directory tree. + * + * Not supported are creating links to existing files or changing metadata of + * existing files. + * + * wimlib_update_image() is atomic. If it cannot complete successfully, then + * all changes are rolled back and the WIMStruct is left unchanged. Rollback is + * implemented by breaking the commands into primitive operations such as "link + * this dentry tree here" which can be undone by doing the opposite operations + * in reverse order. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <errno.h> +#include <string.h> +#include <sys/stat.h> + +#include "wimlib/alloca.h" +#include "wimlib/assert.h" +#include "wimlib/blob_table.h" +#include "wimlib/dentry.h" +#include "wimlib/encoding.h" +#include "wimlib/endianness.h" +#include "wimlib/error.h" +#include "wimlib/metadata.h" +#include "wimlib/paths.h" +#include "wimlib/progress.h" +#include "wimlib/scan.h" +#include "wimlib/test_support.h" +#include "wimlib/xml_windows.h" + +/* Saved specification of a "primitive" update operation that was performed. */ +struct update_primitive { + enum { + /* Unlinked a dentry from its parent directory. */ + UNLINK_DENTRY, + + /* Linked a dentry into its parent directory. */ + LINK_DENTRY, + + /* Changed the file name of a dentry. */ + CHANGE_FILE_NAME, + + /* Changed the short name of a dentry. */ + CHANGE_SHORT_NAME, + } type; + + union { + /* For UNLINK_DENTRY and LINK_DENTRY operations */ + struct { + /* Dentry that was linked or unlinked. */ + struct wim_dentry *subject; + + /* For link operations, the directory into which + * @subject was linked, or NULL if @subject was set as + * the root of the image. + * + * For unlink operations, the directory from which + * @subject was unlinked, or NULL if @subject was unset + * as the root of the image. */ + struct wim_dentry *parent; + } link; + + /* For CHANGE_FILE_NAME and CHANGE_SHORT_NAME operations */ + struct { + /* Dentry that had its name changed. */ + struct wim_dentry *subject; + + /* The old name. */ + utf16lechar *old_name; + } name; + }; +}; + +/* Chronological list of primitive operations that were executed for a single + * logical update command, such as 'add', 'delete', or 'rename'. */ +struct update_primitive_list { + struct update_primitive *entries; + struct update_primitive inline_entries[4]; + size_t num_entries; + size_t num_alloc_entries; +}; + +/* Journal for managing the executing of zero or more logical update commands, + * such as 'add', 'delete', or 'rename'. This allows either committing or + * rolling back the commands. */ +struct update_command_journal { + /* Number of update commands this journal contains. */ + size_t num_cmds; + + /* Index of currently executing update command. */ + size_t cur_cmd; + + /* Location of the WIM image's root pointer. */ + struct wim_dentry **root_p; + + /* Pointer to the blob table of the WIM (may needed for rollback) */ + struct blob_table *blob_table; + + /* List of dentries that are currently unlinked from the WIM image. + * These must be freed when no longer needed for commit or rollback. */ + struct list_head orphans; + + /* Per-command logs. */ + struct update_primitive_list cmd_prims[]; +}; + +static void +init_update_primitive_list(struct update_primitive_list *l) +{ + l->entries = l->inline_entries; + l->num_entries = 0; + l->num_alloc_entries = ARRAY_LEN(l->inline_entries); +} + +/* Allocates a new journal for managing the execution of up to @num_cmds update + * commands. */ +static struct update_command_journal * +new_update_command_journal(size_t num_cmds, struct wim_dentry **root_p, + struct blob_table *blob_table) +{ + struct update_command_journal *j; + + j = MALLOC(sizeof(*j) + num_cmds * sizeof(j->cmd_prims[0])); + if (j) { + j->num_cmds = num_cmds; + j->cur_cmd = 0; + j->root_p = root_p; + j->blob_table = blob_table; + INIT_LIST_HEAD(&j->orphans); + for (size_t i = 0; i < num_cmds; i++) + init_update_primitive_list(&j->cmd_prims[i]); + } + return j; +} + +/* Don't call this directly; use commit_update() or rollback_update() instead. + */ +static void +free_update_command_journal(struct update_command_journal *j) +{ + struct wim_dentry *orphan; + + /* Free orphaned dentry trees */ + while (!list_empty(&j->orphans)) { + orphan = list_first_entry(&j->orphans, + struct wim_dentry, d_tmp_list); + list_del(&orphan->d_tmp_list); + free_dentry_tree(orphan, j->blob_table); + } + + for (size_t i = 0; i < j->num_cmds; i++) + if (j->cmd_prims[i].entries != j->cmd_prims[i].inline_entries) + FREE(j->cmd_prims[i].entries); + FREE(j); +} + +/* Add the entry @prim to the update command journal @j. */ +static int +record_update_primitive(struct update_command_journal *j, + struct update_primitive prim) +{ + struct update_primitive_list *l; + + l = &j->cmd_prims[j->cur_cmd]; + + if (l->num_entries == l->num_alloc_entries) { + struct update_primitive *new_entries; + size_t new_num_alloc_entries; + size_t new_size; + + new_num_alloc_entries = l->num_alloc_entries * 2; + new_size = new_num_alloc_entries * sizeof(new_entries[0]); + if (l->entries == l->inline_entries) { + new_entries = MALLOC(new_size); + if (!new_entries) + return WIMLIB_ERR_NOMEM; + memcpy(new_entries, l->inline_entries, + sizeof(l->inline_entries)); + } else { + new_entries = REALLOC(l->entries, new_size); + if (!new_entries) + return WIMLIB_ERR_NOMEM; + } + l->entries = new_entries; + l->num_alloc_entries = new_num_alloc_entries; + } + l->entries[l->num_entries++] = prim; + return 0; +} + +static void +do_unlink(struct wim_dentry *subject, struct wim_dentry *parent, + struct wim_dentry **root_p) +{ + if (parent) { + /* Unlink @subject from its @parent. */ + wimlib_assert(subject->d_parent == parent); + unlink_dentry(subject); + } else { + /* Unset @subject as the root of the image. */ + *root_p = NULL; + } + subject->d_parent = subject; +} + +static void +do_link(struct wim_dentry *subject, struct wim_dentry *parent, + struct wim_dentry **root_p) +{ + if (parent) { + /* Link @subject to its @parent */ + struct wim_dentry *existing; + + existing = dentry_add_child(parent, subject); + wimlib_assert(!existing); + } else { + /* Set @subject as root of the image */ + *root_p = subject; + } +} + +/* Undo a link operation. */ +static void +rollback_link(struct wim_dentry *subject, struct wim_dentry *parent, + struct wim_dentry **root_p, struct list_head *orphans) +{ + /* Unlink is the opposite of link */ + do_unlink(subject, parent, root_p); + + /* @subject is now unlinked. Add it to orphans. */ + list_add(&subject->d_tmp_list, orphans); + subject->d_is_orphan = 1; +} + +/* Undo an unlink operation. */ +static void +rollback_unlink(struct wim_dentry *subject, struct wim_dentry *parent, + struct wim_dentry **root_p) +{ + /* Link is the opposite of unlink */ + do_link(subject, parent, root_p); + + /* @subject is no longer unlinked. Delete it from orphans. */ + list_del(&subject->d_tmp_list); + subject->d_is_orphan = 0; +} + +/* Rollback a name change operation. */ +static void +rollback_name_change(utf16lechar *old_name, + utf16lechar **name_ptr, u16 *name_nbytes_ptr) +{ + /* Free the new name, then replace it with the old name. */ + FREE(*name_ptr); + if (old_name) { + *name_ptr = old_name; + *name_nbytes_ptr = utf16le_len_bytes(old_name); + } else { + *name_ptr = NULL; + *name_nbytes_ptr = 0; + } +} + +/* Rollback a primitive update operation. */ +static void +rollback_update_primitive(const struct update_primitive *prim, + struct wim_dentry **root_p, + struct list_head *orphans) +{ + switch (prim->type) { + case LINK_DENTRY: + rollback_link(prim->link.subject, prim->link.parent, root_p, + orphans); + break; + case UNLINK_DENTRY: + rollback_unlink(prim->link.subject, prim->link.parent, root_p); + break; + case CHANGE_FILE_NAME: + rollback_name_change(prim->name.old_name, + &prim->name.subject->d_name, + &prim->name.subject->d_name_nbytes); + break; + case CHANGE_SHORT_NAME: + rollback_name_change(prim->name.old_name, + &prim->name.subject->d_short_name, + &prim->name.subject->d_short_name_nbytes); + break; + } +} + +/* Rollback a logical update command */ +static void +rollback_update_command(const struct update_primitive_list *l, + struct wim_dentry **root_p, + struct list_head *orphans) +{ + size_t i = l->num_entries; + + /* Rollback each primitive operation, in reverse order. */ + while (i--) + rollback_update_primitive(&l->entries[i], root_p, orphans); +} + +/****************************************************************************/ + +/* Link @subject into the directory @parent; or, if @parent is NULL, set + * @subject as the root of the WIM image. + * + * This is the journaled version, so it can be rolled back. */ +static int +journaled_link(struct update_command_journal *j, + struct wim_dentry *subject, struct wim_dentry *parent) +{ + struct update_primitive prim; + int ret; + + prim.type = LINK_DENTRY; + prim.link.subject = subject; + prim.link.parent = parent; + + ret = record_update_primitive(j, prim); + if (ret) + return ret; + + do_link(subject, parent, j->root_p); + + if (subject->d_is_orphan) { + list_del(&subject->d_tmp_list); + subject->d_is_orphan = 0; + } + return 0; +} + +/* Unlink @subject from the WIM image. + * + * This is the journaled version, so it can be rolled back. */ +static int +journaled_unlink(struct update_command_journal *j, struct wim_dentry *subject) +{ + struct wim_dentry *parent; + struct update_primitive prim; + int ret; + + if (dentry_is_root(subject)) + parent = NULL; + else + parent = subject->d_parent; + + prim.type = UNLINK_DENTRY; + prim.link.subject = subject; + prim.link.parent = parent; + + ret = record_update_primitive(j, prim); + if (ret) + return ret; + + do_unlink(subject, parent, j->root_p); + + list_add(&subject->d_tmp_list, &j->orphans); + subject->d_is_orphan = 1; + return 0; +} + +/* Change the name of @dentry to @new_name_tstr. + * + * This is the journaled version, so it can be rolled back. */ +static int +journaled_change_name(struct update_command_journal *j, + struct wim_dentry *dentry, const tchar *new_name_tstr) +{ + int ret; + utf16lechar *new_name; + size_t new_name_nbytes; + struct update_primitive prim; + + /* Set the long name. */ + ret = tstr_to_utf16le(new_name_tstr, + tstrlen(new_name_tstr) * sizeof(tchar), + &new_name, &new_name_nbytes); + if (ret) + return ret; + + prim.type = CHANGE_FILE_NAME; + prim.name.subject = dentry; + prim.name.old_name = dentry->d_name; + ret = record_update_primitive(j, prim); + if (ret) { + FREE(new_name); + return ret; + } + + dentry->d_name = new_name; + dentry->d_name_nbytes = new_name_nbytes; + + /* Clear the short name. */ + prim.type = CHANGE_SHORT_NAME; + prim.name.subject = dentry; + prim.name.old_name = dentry->d_short_name; + ret = record_update_primitive(j, prim); + if (ret) + return ret; + + dentry->d_short_name = NULL; + dentry->d_short_name_nbytes = 0; + return 0; +} + +static void +next_command(struct update_command_journal *j) +{ + j->cur_cmd++; +} + +static void +commit_update(struct update_command_journal *j) +{ + for (size_t i = 0; i < j->num_cmds; i++) + { + for (size_t k = 0; k < j->cmd_prims[i].num_entries; k++) + { + if (j->cmd_prims[i].entries[k].type == CHANGE_FILE_NAME || + j->cmd_prims[i].entries[k].type == CHANGE_SHORT_NAME) + { + FREE(j->cmd_prims[i].entries[k].name.old_name); + } + } + } + free_update_command_journal(j); +} + +static void +rollback_update(struct update_command_journal *j) +{ + /* Rollback each logical update command, in reverse order. */ + size_t i = j->cur_cmd; + if (i < j->num_cmds) + i++; + while (i--) + rollback_update_command(&j->cmd_prims[i], j->root_p, &j->orphans); + free_update_command_journal(j); +} + +static int +handle_conflict(struct wim_dentry *branch, struct wim_dentry *existing, + struct update_command_journal *j, + int add_flags, + wimlib_progress_func_t progfunc, void *progctx) +{ + bool branch_is_dir = dentry_is_directory(branch); + bool existing_is_dir = dentry_is_directory(existing); + + if (branch_is_dir != existing_is_dir) { + if (existing_is_dir) { + ERROR("\"%"TS"\" is a directory!\n" + " Specify the path at which " + "to place the file inside this directory.", + dentry_full_path(existing)); + return WIMLIB_ERR_IS_DIRECTORY; + } else { + ERROR("Can't place directory at \"%"TS"\" because " + "a nondirectory file already exists there!", + dentry_full_path(existing)); + return WIMLIB_ERR_NOTDIR; + } + } + + if (branch_is_dir) { + /* Directory overlay */ + while (dentry_has_children(branch)) { + struct wim_dentry *new_child; + struct wim_dentry *existing_child; + int ret; + + new_child = dentry_any_child(branch); + + existing_child = + get_dentry_child_with_utf16le_name(existing, + new_child->d_name, + new_child->d_name_nbytes, + WIMLIB_CASE_PLATFORM_DEFAULT); + unlink_dentry(new_child); + if (existing_child) { + ret = handle_conflict(new_child, existing_child, + j, add_flags, + progfunc, progctx); + } else { + ret = journaled_link(j, new_child, existing); + } + if (ret) { + dentry_add_child(branch, new_child); + return ret; + } + } + free_dentry_tree(branch, j->blob_table); + return 0; + } else if (add_flags & WIMLIB_ADD_FLAG_NO_REPLACE) { + /* Can't replace nondirectory file */ + ERROR("Refusing to overwrite nondirectory file \"%"TS"\"", + dentry_full_path(existing)); + return WIMLIB_ERR_INVALID_OVERLAY; + } else { + /* Replace nondirectory file */ + struct wim_dentry *parent; + int ret; + + parent = existing->d_parent; + + ret = calculate_dentry_full_path(existing); + if (ret) + return ret; + + if (add_flags & WIMLIB_ADD_FLAG_VERBOSE) { + union wimlib_progress_info info; + + info.replace.path_in_wim = existing->d_full_path; + ret = call_progress(progfunc, + WIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM, + &info, progctx); + if (ret) + return ret; + } + + ret = journaled_unlink(j, existing); + if (ret) + return ret; + + return journaled_link(j, branch, parent); + } +} + +static int +do_attach_branch(struct wim_dentry *branch, const utf16lechar *target, + struct update_command_journal *j, + int add_flags, wimlib_progress_func_t progfunc, void *progctx) +{ + struct wim_dentry *parent; + struct wim_dentry *existing; + const utf16lechar empty_name[1] = {0}; + const utf16lechar *cur_component_name; + size_t cur_component_nbytes; + const utf16lechar *next_component_name; + int ret; + + /* Attempt to create root directory before proceeding to the "real" + * first component */ + parent = NULL; + existing = *j->root_p; + cur_component_name = empty_name; + cur_component_nbytes = 0; + + /* Skip leading slashes */ + next_component_name = target; + while (*next_component_name == cpu_to_le16(WIM_PATH_SEPARATOR)) + next_component_name++; + + while (*next_component_name) { /* While not the last component ... */ + const utf16lechar *end; + + if (existing) { + /* Descend into existing directory */ + if (!dentry_is_directory(existing)) { + ERROR("\"%"TS"\" in the WIM image " + "is not a directory!", + dentry_full_path(existing)); + return WIMLIB_ERR_NOTDIR; + } + } else { + /* A parent directory of the target didn't exist. Make + * the way by creating a filler directory. */ + struct wim_dentry *filler; + + ret = new_filler_directory(&filler); + if (ret) + return ret; + ret = dentry_set_name_utf16le(filler, + cur_component_name, + cur_component_nbytes); + if (ret) { + free_dentry(filler); + return ret; + } + ret = journaled_link(j, filler, parent); + if (ret) { + free_dentry(filler); + return ret; + } + existing = filler; + } + + /* Advance to next component */ + + cur_component_name = next_component_name; + end = cur_component_name + 1; + while (*end && *end != cpu_to_le16(WIM_PATH_SEPARATOR)) + end++; + + next_component_name = end; + if (*end) { + /* There will still be more components after this. */ + do { + } while (*++next_component_name == cpu_to_le16(WIM_PATH_SEPARATOR)); + wimlib_assert(*next_component_name); /* No trailing slashes */ + } else { + /* This will be the last component */ + next_component_name = end; + } + parent = existing; + cur_component_nbytes = (end - cur_component_name) * sizeof(utf16lechar); + existing = get_dentry_child_with_utf16le_name( + parent, + cur_component_name, + cur_component_nbytes, + WIMLIB_CASE_PLATFORM_DEFAULT); + } + + /* Last component */ + if (existing) { + return handle_conflict(branch, existing, j, add_flags, + progfunc, progctx); + } else { + return journaled_link(j, branch, parent); + } +} + +/* + * Place the directory entry tree @branch at the path @target_tstr in the WIM + * image. + * + * @target_tstr cannot contain trailing slashes, and all path separators must be + * WIM_PATH_SEPARATOR. + * + * On success, @branch is committed to the journal @j. + * Otherwise @branch is freed. + * + * The relevant @add_flags are WIMLIB_ADD_FLAG_NO_REPLACE and + * WIMLIB_ADD_FLAG_VERBOSE. + */ +static int +attach_branch(struct wim_dentry *branch, const tchar *target_tstr, + struct update_command_journal *j, int add_flags, + wimlib_progress_func_t progfunc, void *progctx) +{ + int ret; + const utf16lechar *target; + + ret = 0; + if (unlikely(!branch)) + goto out; + + ret = tstr_get_utf16le(target_tstr, &target); + if (ret) + goto out_free_branch; + + STATIC_ASSERT(WIM_PATH_SEPARATOR == OS_PREFERRED_PATH_SEPARATOR); + ret = dentry_set_name(branch, path_basename(target_tstr)); + if (ret) + goto out_free_target; + + ret = do_attach_branch(branch, target, j, add_flags, progfunc, progctx); + if (ret) + goto out_free_target; + /* branch was successfully committed to the journal */ + branch = NULL; +out_free_target: + tstr_put_utf16le(target); +out_free_branch: + free_dentry_tree(branch, j->blob_table); +out: + return ret; +} + +static const char wincfg[] = +"[ExclusionList]\n" +"/$ntfs.log\n" +"/hiberfil.sys\n" +"/pagefile.sys\n" +"/swapfile.sys\n" +"/System Volume Information\n" +"/RECYCLER\n" +"/$RECYCLE.BIN\n" +"/$Recycle.Bin\n" +"/Windows/CSC\n"; + +static const tchar *wimboot_cfgfile = + WIMLIB_WIM_PATH_SEPARATOR_STRING T("Windows") + WIMLIB_WIM_PATH_SEPARATOR_STRING T("System32") + WIMLIB_WIM_PATH_SEPARATOR_STRING T("WimBootCompress.ini"); + +static int +get_capture_config(const tchar *config_file, struct capture_config *config, + int add_flags, const tchar *fs_source_path) +{ + int ret; + tchar *tmp_config_file = NULL; + + memset(config, 0, sizeof(*config)); + + /* For WIMBoot capture, check for default capture configuration file + * unless one was explicitly specified. */ + if (!config_file && (add_flags & WIMLIB_ADD_FLAG_WIMBOOT)) { + + /* XXX: Handle loading file correctly when in NTFS volume. */ + + size_t len = tstrlen(fs_source_path) + + tstrlen(wimboot_cfgfile); + struct stat st; + + tmp_config_file = MALLOC((len + 1) * sizeof(tchar)); + if (!tmp_config_file) + return WIMLIB_ERR_NOMEM; + + tsprintf(tmp_config_file, T("%"TS"%"TS), + fs_source_path, wimboot_cfgfile); + if (!tstat(tmp_config_file, &st)) { + config_file = tmp_config_file; + add_flags &= ~WIMLIB_ADD_FLAG_WINCONFIG; + } else { + WARNING("\"%"TS"\" does not exist.\n" + " Using default capture configuration!", + tmp_config_file); + } + } + + if (add_flags & WIMLIB_ADD_FLAG_WINCONFIG) { + /* Use Windows default. */ + if (config_file) + return WIMLIB_ERR_INVALID_PARAM; + ret = read_capture_config(T("wincfg"), wincfg, + sizeof(wincfg) - 1, config); + } else if (config_file) { + /* Use the specified configuration file. */ + ret = read_capture_config(config_file, NULL, 0, config); + } else { + /* ... Or don't use any configuration file at all. No files + * will be excluded from capture, all files will be compressed, + * etc. */ + ret = 0; + } + FREE(tmp_config_file); + return ret; +} + +static int +execute_add_command(struct update_command_journal *j, + WIMStruct *wim, + const struct wimlib_update_command *add_cmd, + struct wim_inode_table *inode_table, + struct wim_sd_set *sd_set, + struct list_head *unhashed_blobs) +{ + int ret; + int add_flags; + tchar *fs_source_path; + tchar *wim_target_path; + const tchar *config_file; + struct scan_params params; + struct capture_config config; + scan_tree_t scan_tree = platform_default_scan_tree; + struct wim_dentry *branch; + + add_flags = add_cmd->add.add_flags; + fs_source_path = add_cmd->add.fs_source_path; + wim_target_path = add_cmd->add.wim_target_path; + config_file = add_cmd->add.config_file; + + memset(&params, 0, sizeof(params)); + +#ifdef WITH_NTFS_3G + if (add_flags & WIMLIB_ADD_FLAG_NTFS) + scan_tree = ntfs_3g_build_dentry_tree; +#endif + +#ifdef ENABLE_TEST_SUPPORT + if (add_flags & WIMLIB_ADD_FLAG_GENERATE_TEST_DATA) + scan_tree = generate_dentry_tree; +#endif + + ret = get_capture_config(config_file, &config, + add_flags, fs_source_path); + if (ret) + goto out; + + params.blob_table = wim->blob_table; + params.unhashed_blobs = unhashed_blobs; + params.inode_table = inode_table; + params.sd_set = sd_set; + params.config = &config; + params.add_flags = add_flags; + + params.progfunc = wim->progfunc; + params.progctx = wim->progctx; + params.progress.scan.source = fs_source_path; + params.progress.scan.wim_target_path = wim_target_path; + ret = call_progress(params.progfunc, WIMLIB_PROGRESS_MSG_SCAN_BEGIN, + &params.progress, params.progctx); + if (ret) + goto out_destroy_config; + + if (WIMLIB_IS_WIM_ROOT_PATH(wim_target_path)) + params.add_flags |= WIMLIB_ADD_FLAG_ROOT; + ret = (*scan_tree)(&branch, fs_source_path, &params); + if (ret) + goto out_destroy_config; + + ret = call_progress(params.progfunc, WIMLIB_PROGRESS_MSG_SCAN_END, + &params.progress, params.progctx); + if (ret) { + free_dentry_tree(branch, wim->blob_table); + goto out_destroy_config; + } + + if (WIMLIB_IS_WIM_ROOT_PATH(wim_target_path) && + branch && !dentry_is_directory(branch)) + { + ERROR("\"%"TS"\" is not a directory!", fs_source_path); + ret = WIMLIB_ERR_NOTDIR; + free_dentry_tree(branch, wim->blob_table); + goto out_destroy_config; + } + + ret = attach_branch(branch, wim_target_path, j, + add_flags, params.progfunc, params.progctx); + if (ret) + goto out_destroy_config; + + if (config_file && (add_flags & WIMLIB_ADD_FLAG_WIMBOOT) && + WIMLIB_IS_WIM_ROOT_PATH(wim_target_path)) + { + params.add_flags = 0; + params.progfunc = NULL; + params.config = NULL; + + /* If a capture configuration file was explicitly specified when + * capturing an image in WIMBoot mode, save it as + * /Windows/System32/WimBootCompress.ini in the WIM image. */ + ret = platform_default_scan_tree(&branch, config_file, &params); + if (ret) + goto out_destroy_config; + + ret = attach_branch(branch, wimboot_cfgfile, j, 0, NULL, NULL); + if (ret) + goto out_destroy_config; + } + + if (WIMLIB_IS_WIM_ROOT_PATH(wim_target_path)) { + ret = set_windows_specific_info(wim); + if (ret) + goto out_destroy_config; + } + + ret = 0; +out_destroy_config: + destroy_capture_config(&config); +out: + FREE(params.cur_path); + return ret; +} + +static int +execute_delete_command(struct update_command_journal *j, + WIMStruct *wim, + const struct wimlib_update_command *delete_cmd) +{ + int flags; + const tchar *wim_path; + struct wim_dentry *tree; + + flags = delete_cmd->delete_.delete_flags; + wim_path = delete_cmd->delete_.wim_path; + + tree = get_dentry(wim, wim_path, WIMLIB_CASE_PLATFORM_DEFAULT); + if (!tree) { + /* Path to delete does not exist in the WIM. */ + if (flags & WIMLIB_DELETE_FLAG_FORCE) { + return 0; + } else { + ERROR("Path \"%"TS"\" does not exist in WIM image %d", + wim_path, wim->current_image); + return WIMLIB_ERR_PATH_DOES_NOT_EXIST; + } + } + + if (dentry_is_directory(tree) && !(flags & WIMLIB_DELETE_FLAG_RECURSIVE)) { + ERROR("Path \"%"TS"\" in WIM image %d is a directory " + "but a recursive delete was not requested", + wim_path, wim->current_image); + return WIMLIB_ERR_IS_DIRECTORY; + } + + return journaled_unlink(j, tree); +} + +static int +free_dentry_full_path(struct wim_dentry *dentry, void *_ignore) +{ + FREE(dentry->d_full_path); + dentry->d_full_path = NULL; + return 0; +} + +/* Is @d1 a (possibly nonproper) ancestor of @d2? */ +static bool +is_ancestor(const struct wim_dentry *d1, const struct wim_dentry *d2) +{ + for (;;) { + if (d2 == d1) + return true; + if (dentry_is_root(d2)) + return false; + d2 = d2->d_parent; + } +} + +/* Rename a file or directory in the WIM. + * + * This returns a -errno value. + * + * The journal @j is optional. + */ +int +rename_wim_path(WIMStruct *wim, const tchar *from, const tchar *to, + CASE_SENSITIVITY_TYPE case_type, bool noreplace, + struct update_command_journal *j) +{ + struct wim_dentry *src; + struct wim_dentry *dst; + struct wim_dentry *parent_of_dst; + int ret; + + /* This rename() implementation currently only supports actual files + * (not alternate data streams) */ + + src = get_dentry(wim, from, case_type); + if (!src) + return -errno; + + dst = get_dentry(wim, to, case_type); + + if (dst) { + /* Destination file exists */ + + if (noreplace) + return -EEXIST; + + if (src == dst) /* Same file */ + return 0; + + if (!dentry_is_directory(src)) { + /* Cannot rename non-directory to directory. */ + if (dentry_is_directory(dst)) + return -EISDIR; + } else { + /* Cannot rename directory to a non-directory or a non-empty + * directory */ + if (!dentry_is_directory(dst)) + return -ENOTDIR; + if (dentry_has_children(dst)) + return -ENOTEMPTY; + } + parent_of_dst = dst->d_parent; + } else { + /* Destination does not exist */ + parent_of_dst = get_parent_dentry(wim, to, case_type); + if (!parent_of_dst) + return -errno; + + if (!dentry_is_directory(parent_of_dst)) + return -ENOTDIR; + } + + /* @src can't be an ancestor of @dst. Otherwise we're unlinking @src + * from the tree and creating a loop... */ + if (is_ancestor(src, parent_of_dst)) + return -EBUSY; + + if (j) { + if (dst) + if (journaled_unlink(j, dst)) + return -ENOMEM; + if (journaled_unlink(j, src)) + return -ENOMEM; + if (journaled_change_name(j, src, path_basename(to))) + return -ENOMEM; + if (journaled_link(j, src, parent_of_dst)) + return -ENOMEM; + } else { + ret = dentry_set_name(src, path_basename(to)); + if (ret) + return -ENOMEM; + if (dst) { + unlink_dentry(dst); + free_dentry_tree(dst, wim->blob_table); + } + unlink_dentry(src); + dentry_add_child(parent_of_dst, src); + } + if (src->d_full_path) + for_dentry_in_tree(src, free_dentry_full_path, NULL); + return 0; +} + + +static int +execute_rename_command(struct update_command_journal *j, + WIMStruct *wim, + const struct wimlib_update_command *rename_cmd) +{ + int ret; + + ret = rename_wim_path(wim, rename_cmd->rename.wim_source_path, + rename_cmd->rename.wim_target_path, + WIMLIB_CASE_PLATFORM_DEFAULT, false, j); + if (ret) { + ret = -ret; + errno = ret; + ERROR_WITH_ERRNO("Can't rename \"%"TS"\" to \"%"TS"\"", + rename_cmd->rename.wim_source_path, + rename_cmd->rename.wim_target_path); + switch (ret) { + case ENOMEM: + ret = WIMLIB_ERR_NOMEM; + break; + case ENOTDIR: + ret = WIMLIB_ERR_NOTDIR; + break; + case ENOTEMPTY: + case EBUSY: + /* XXX: EBUSY is returned when the rename would create a + * loop. It maybe should have its own error code. */ + ret = WIMLIB_ERR_NOTEMPTY; + break; + case EISDIR: + ret = WIMLIB_ERR_IS_DIRECTORY; + break; + case ENOENT: + default: + ret = WIMLIB_ERR_PATH_DOES_NOT_EXIST; + break; + } + } + return ret; +} + +static bool +have_command_type(const struct wimlib_update_command *cmds, size_t num_cmds, + enum wimlib_update_op op) +{ + for (size_t i = 0; i < num_cmds; i++) + if (cmds[i].op == op) + return true; + return false; +} + +static int +execute_update_commands(WIMStruct *wim, + const struct wimlib_update_command *cmds, + size_t num_cmds, + int update_flags) +{ + struct wim_inode_table *inode_table; + struct wim_sd_set *sd_set; + struct list_head unhashed_blobs; + struct update_command_journal *j; + union wimlib_progress_info info; + int ret; + + if (have_command_type(cmds, num_cmds, WIMLIB_UPDATE_OP_ADD)) { + /* If we have at least one "add" command, create the inode and + * security descriptor tables to index new inodes and new + * security descriptors, respectively. */ + inode_table = alloca(sizeof(struct wim_inode_table)); + sd_set = alloca(sizeof(struct wim_sd_set)); + + ret = init_inode_table(inode_table, 64); + if (ret) + goto out; + + ret = init_sd_set(sd_set, wim_get_current_security_data(wim)); + if (ret) + goto out_destroy_inode_table; + + INIT_LIST_HEAD(&unhashed_blobs); + } else { + inode_table = NULL; + sd_set = NULL; + } + + /* Start an in-memory journal to allow rollback if something goes wrong + */ + j = new_update_command_journal(num_cmds, + &wim_get_current_image_metadata(wim)->root_dentry, + wim->blob_table); + if (!j) { + ret = WIMLIB_ERR_NOMEM; + goto out_destroy_sd_set; + } + + info.update.completed_commands = 0; + info.update.total_commands = num_cmds; + ret = 0; + for (size_t i = 0; i < num_cmds; i++) { + info.update.command = &cmds[i]; + if (update_flags & WIMLIB_UPDATE_FLAG_SEND_PROGRESS) { + ret = call_progress(wim->progfunc, + WIMLIB_PROGRESS_MSG_UPDATE_BEGIN_COMMAND, + &info, wim->progctx); + if (ret) + goto rollback; + } + + switch (cmds[i].op) { + case WIMLIB_UPDATE_OP_ADD: + ret = execute_add_command(j, wim, &cmds[i], inode_table, + sd_set, &unhashed_blobs); + break; + case WIMLIB_UPDATE_OP_DELETE: + ret = execute_delete_command(j, wim, &cmds[i]); + break; + case WIMLIB_UPDATE_OP_RENAME: + ret = execute_rename_command(j, wim, &cmds[i]); + break; + } + if (unlikely(ret)) + goto rollback; + info.update.completed_commands++; + if (update_flags & WIMLIB_UPDATE_FLAG_SEND_PROGRESS) { + ret = call_progress(wim->progfunc, + WIMLIB_PROGRESS_MSG_UPDATE_END_COMMAND, + &info, wim->progctx); + if (ret) + goto rollback; + } + next_command(j); + } + + commit_update(j); + if (inode_table) { + struct wim_image_metadata *imd; + + imd = wim_get_current_image_metadata(wim); + + list_splice_tail(&unhashed_blobs, &imd->unhashed_blobs); + inode_table_prepare_inode_list(inode_table, &imd->inode_list); + } + goto out_destroy_sd_set; + +rollback: + if (sd_set) + rollback_new_security_descriptors(sd_set); + rollback_update(j); +out_destroy_sd_set: + if (sd_set) + destroy_sd_set(sd_set); +out_destroy_inode_table: + if (inode_table) + destroy_inode_table(inode_table); +out: + return ret; +} + + +static int +check_add_command(struct wimlib_update_command *cmd, + const struct wim_header *hdr) +{ + int add_flags = cmd->add.add_flags; + + if (add_flags & ~(WIMLIB_ADD_FLAG_NTFS | + WIMLIB_ADD_FLAG_DEREFERENCE | + WIMLIB_ADD_FLAG_VERBOSE | + /* BOOT doesn't make sense for wimlib_update_image(). */ + /*WIMLIB_ADD_FLAG_BOOT |*/ + WIMLIB_ADD_FLAG_UNIX_DATA | + WIMLIB_ADD_FLAG_NO_ACLS | + WIMLIB_ADD_FLAG_STRICT_ACLS | + WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE | + WIMLIB_ADD_FLAG_RPFIX | + WIMLIB_ADD_FLAG_NORPFIX | + WIMLIB_ADD_FLAG_NO_UNSUPPORTED_EXCLUDE | + WIMLIB_ADD_FLAG_WINCONFIG | + WIMLIB_ADD_FLAG_WIMBOOT | + WIMLIB_ADD_FLAG_NO_REPLACE | + WIMLIB_ADD_FLAG_TEST_FILE_EXCLUSION | + WIMLIB_ADD_FLAG_SNAPSHOT | + #ifdef ENABLE_TEST_SUPPORT + WIMLIB_ADD_FLAG_GENERATE_TEST_DATA | + #endif + WIMLIB_ADD_FLAG_FILE_PATHS_UNNEEDED)) + return WIMLIB_ERR_INVALID_PARAM; + + bool is_entire_image = WIMLIB_IS_WIM_ROOT_PATH(cmd->add.wim_target_path); + +#ifndef WITH_NTFS_3G + if (add_flags & WIMLIB_ADD_FLAG_NTFS) { + ERROR("NTFS-3G capture mode is unsupported because wimlib " + "was compiled --without-ntfs-3g"); + return WIMLIB_ERR_UNSUPPORTED; + } +#endif + +#ifdef _WIN32 + /* Check for flags not supported on Windows. */ + if (add_flags & WIMLIB_ADD_FLAG_UNIX_DATA) { + ERROR("Capturing UNIX-specific data is not supported on Windows"); + return WIMLIB_ERR_UNSUPPORTED; + } + if (add_flags & WIMLIB_ADD_FLAG_DEREFERENCE) { + ERROR("Dereferencing symbolic links is not supported on Windows"); + return WIMLIB_ERR_UNSUPPORTED; + } +#else + /* Check for flags only supported on Windows. */ + + /* Currently, SNAPSHOT means Windows VSS. In the future, it perhaps + * could be implemented for other types of snapshots, such as btrfs. */ + if (add_flags & WIMLIB_ADD_FLAG_SNAPSHOT) { + ERROR("Snapshot mode is only supported on Windows, where it uses VSS."); + return WIMLIB_ERR_UNSUPPORTED; + } +#endif + + /* VERBOSE implies EXCLUDE_VERBOSE */ + if (add_flags & WIMLIB_ADD_FLAG_VERBOSE) + add_flags |= WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE; + + /* Check for contradictory reparse point fixup flags */ + if ((add_flags & (WIMLIB_ADD_FLAG_RPFIX | + WIMLIB_ADD_FLAG_NORPFIX)) == + (WIMLIB_ADD_FLAG_RPFIX | + WIMLIB_ADD_FLAG_NORPFIX)) + { + ERROR("Cannot specify RPFIX and NORPFIX flags " + "at the same time!"); + return WIMLIB_ERR_INVALID_PARAM; + } + + /* Set default behavior on reparse point fixups if requested */ + if ((add_flags & (WIMLIB_ADD_FLAG_RPFIX | + WIMLIB_ADD_FLAG_NORPFIX)) == 0) + { + /* Do reparse-point fixups by default if we are capturing an + * entire image and either the header flag is set from previous + * images, or if this is the first image being added. */ + if (is_entire_image && + ((hdr->flags & WIM_HDR_FLAG_RP_FIX) || hdr->image_count == 1)) + add_flags |= WIMLIB_ADD_FLAG_RPFIX; + } + + if (!is_entire_image) { + if (add_flags & WIMLIB_ADD_FLAG_RPFIX) { + ERROR("Cannot do reparse point fixups when " + "not capturing a full image!"); + return WIMLIB_ERR_INVALID_PARAM; + } + } + /* We may have modified the add flags. */ + cmd->add.add_flags = add_flags; + return 0; +} + +static int +check_delete_command(const struct wimlib_update_command *cmd) +{ + if (cmd->delete_.delete_flags & ~(WIMLIB_DELETE_FLAG_FORCE | + WIMLIB_DELETE_FLAG_RECURSIVE)) + return WIMLIB_ERR_INVALID_PARAM; + return 0; +} + +static int +check_rename_command(const struct wimlib_update_command *cmd) +{ + if (cmd->rename.rename_flags != 0) + return WIMLIB_ERR_INVALID_PARAM; + return 0; +} + +static int +check_update_command(struct wimlib_update_command *cmd, + const struct wim_header *hdr) +{ + switch (cmd->op) { + case WIMLIB_UPDATE_OP_ADD: + return check_add_command(cmd, hdr); + case WIMLIB_UPDATE_OP_DELETE: + return check_delete_command(cmd); + case WIMLIB_UPDATE_OP_RENAME: + return check_rename_command(cmd); + } + return 0; +} + +static int +check_update_commands(struct wimlib_update_command *cmds, size_t num_cmds, + const struct wim_header *hdr) +{ + int ret = 0; + for (size_t i = 0; i < num_cmds; i++) { + ret = check_update_command(&cmds[i], hdr); + if (ret) + break; + } + return ret; +} + + +static void +free_update_commands(struct wimlib_update_command *cmds, size_t num_cmds) +{ + if (cmds) { + for (size_t i = 0; i < num_cmds; i++) { + switch (cmds[i].op) { + case WIMLIB_UPDATE_OP_ADD: + FREE(cmds[i].add.wim_target_path); + break; + case WIMLIB_UPDATE_OP_DELETE: + FREE(cmds[i].delete_.wim_path); + break; + case WIMLIB_UPDATE_OP_RENAME: + FREE(cmds[i].rename.wim_source_path); + FREE(cmds[i].rename.wim_target_path); + break; + } + } + FREE(cmds); + } +} + +static int +copy_update_commands(const struct wimlib_update_command *cmds, + size_t num_cmds, + struct wimlib_update_command **cmds_copy_ret) +{ + int ret; + struct wimlib_update_command *cmds_copy; + + cmds_copy = CALLOC(num_cmds, sizeof(cmds[0])); + if (!cmds_copy) + goto oom; + + for (size_t i = 0; i < num_cmds; i++) { + cmds_copy[i].op = cmds[i].op; + switch (cmds[i].op) { + case WIMLIB_UPDATE_OP_ADD: + cmds_copy[i].add.fs_source_path = cmds[i].add.fs_source_path; + cmds_copy[i].add.wim_target_path = + canonicalize_wim_path(cmds[i].add.wim_target_path); + if (!cmds_copy[i].add.wim_target_path) + goto oom; + cmds_copy[i].add.config_file = cmds[i].add.config_file; + cmds_copy[i].add.add_flags = cmds[i].add.add_flags; + break; + case WIMLIB_UPDATE_OP_DELETE: + cmds_copy[i].delete_.wim_path = + canonicalize_wim_path(cmds[i].delete_.wim_path); + if (!cmds_copy[i].delete_.wim_path) + goto oom; + cmds_copy[i].delete_.delete_flags = cmds[i].delete_.delete_flags; + break; + case WIMLIB_UPDATE_OP_RENAME: + cmds_copy[i].rename.wim_source_path = + canonicalize_wim_path(cmds[i].rename.wim_source_path); + cmds_copy[i].rename.wim_target_path = + canonicalize_wim_path(cmds[i].rename.wim_target_path); + if (!cmds_copy[i].rename.wim_source_path || + !cmds_copy[i].rename.wim_target_path) + goto oom; + break; + default: + ERROR("Unknown update operation %u", cmds[i].op); + ret = WIMLIB_ERR_INVALID_PARAM; + goto err; + } + } + *cmds_copy_ret = cmds_copy; + ret = 0; +out: + return ret; +oom: + ret = WIMLIB_ERR_NOMEM; +err: + free_update_commands(cmds_copy, num_cmds); + goto out; +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_update_image(WIMStruct *wim, + int image, + const struct wimlib_update_command *cmds, + size_t num_cmds, + int update_flags) +{ + int ret; + struct wim_image_metadata *imd; + struct wimlib_update_command *cmds_copy; + + if (update_flags & ~WIMLIB_UPDATE_FLAG_SEND_PROGRESS) + return WIMLIB_ERR_INVALID_PARAM; + + /* Load the metadata for the image to modify (if not loaded already) */ + ret = select_wim_image(wim, image); + if (ret) + return ret; + + imd = wim->image_metadata[image - 1]; + + /* Don't allow updating an image currently being shared by multiple + * WIMStructs (as a result of an export) */ + if (imd->refcnt > 1) + return WIMLIB_ERR_IMAGE_HAS_MULTIPLE_REFERENCES; + + /* Make a copy of the update commands, in the process doing certain + * canonicalizations on paths (e.g. translating backslashes to forward + * slashes). This is done to avoid modifying the caller's copy of the + * commands. */ + ret = copy_update_commands(cmds, num_cmds, &cmds_copy); + if (ret) + return ret; + + /* Perform additional checks on the update commands before we execute + * them. */ + ret = check_update_commands(cmds_copy, num_cmds, &wim->hdr); + if (ret) + goto out_free_cmds_copy; + + /* Actually execute the update commands. */ + ret = execute_update_commands(wim, cmds_copy, num_cmds, update_flags); + if (ret) + goto out_free_cmds_copy; + + mark_image_dirty(imd); + + for (size_t i = 0; i < num_cmds; i++) + if (cmds_copy[i].op == WIMLIB_UPDATE_OP_ADD && + cmds_copy[i].add.add_flags & WIMLIB_ADD_FLAG_RPFIX) + wim->hdr.flags |= WIM_HDR_FLAG_RP_FIX; +out_free_cmds_copy: + free_update_commands(cmds_copy, num_cmds); + return ret; +} + +WIMLIBAPI int +wimlib_delete_path(WIMStruct *wim, int image, + const tchar *path, int delete_flags) +{ + struct wimlib_update_command cmd; + + cmd.op = WIMLIB_UPDATE_OP_DELETE; + cmd.delete_.wim_path = (tchar *)path; + cmd.delete_.delete_flags = delete_flags; + + return wimlib_update_image(wim, image, &cmd, 1, 0); +} + +WIMLIBAPI int +wimlib_rename_path(WIMStruct *wim, int image, + const tchar *source_path, const tchar *dest_path) +{ + struct wimlib_update_command cmd; + + cmd.op = WIMLIB_UPDATE_OP_RENAME; + cmd.rename.wim_source_path = (tchar *)source_path; + cmd.rename.wim_target_path = (tchar *)dest_path; + cmd.rename.rename_flags = 0; + + return wimlib_update_image(wim, image, &cmd, 1, 0); +} + +WIMLIBAPI int +wimlib_add_tree(WIMStruct *wim, int image, + const tchar *fs_source_path, const tchar *wim_target_path, + int add_flags) +{ + struct wimlib_update_command cmd; + + cmd.op = WIMLIB_UPDATE_OP_ADD; + cmd.add.fs_source_path = (tchar *)fs_source_path; + cmd.add.wim_target_path = (tchar *)wim_target_path; + cmd.add.add_flags = add_flags; + cmd.add.config_file = NULL; + + return wimlib_update_image(wim, image, &cmd, 1, 0); +} diff --git a/src/wimlib/util.c b/src/wimlib/util.c new file mode 100644 index 00000000..52af147d --- /dev/null +++ b/src/wimlib/util.c @@ -0,0 +1,310 @@ +/* + * util.c - utility functions + */ + +/* + * Copyright 2012-2023 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <errno.h> +#include <fcntl.h> +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#ifdef HAVE_SYS_SYSCTL_H +# include <sys/types.h> +# include <sys/sysctl.h> +#endif +#ifdef HAVE_SYS_SYSCALL_H +# include <sys/syscall.h> +#endif +#include <unistd.h> + +#include "wimlib.h" +#include "wimlib/assert.h" +#include "wimlib/error.h" +#include "wimlib/timestamp.h" +#include "wimlib/util.h" + +/******************* + * Memory allocation + *******************/ + +static void *(*wimlib_malloc_func) (size_t) = malloc; +static void (*wimlib_free_func) (void *) = free; +static void *(*wimlib_realloc_func)(void *, size_t) = realloc; + +void * +wimlib_malloc(size_t size) +{ + void *ptr; + +retry: + ptr = (*wimlib_malloc_func)(size); + if (unlikely(!ptr)) { + if (size == 0) { + size = 1; + goto retry; + } + } + return ptr; +} + +void +wimlib_free_memory(void *ptr) +{ + (*wimlib_free_func)(ptr); +} + +void * +wimlib_realloc(void *ptr, size_t size) +{ + if (size == 0) + size = 1; + return (*wimlib_realloc_func)(ptr, size); +} + +void * +wimlib_calloc(size_t nmemb, size_t size) +{ + size_t total_size = nmemb * size; + void *p; + + if (size != 0 && nmemb > SIZE_MAX / size) { + errno = ENOMEM; + return NULL; + } + + p = MALLOC(total_size); + if (p) + p = memset(p, 0, total_size); + return p; +} + +char * +wimlib_strdup(const char *str) +{ + return memdup(str, strlen(str) + 1); +} + +#ifdef _WIN32 +wchar_t * +wimlib_wcsdup(const wchar_t *str) +{ + return memdup(str, (wcslen(str) + 1) * sizeof(wchar_t)); +} +#endif + +void * +wimlib_aligned_malloc(size_t size, size_t alignment) +{ + wimlib_assert(is_power_of_2(alignment)); + + void *ptr = MALLOC(sizeof(void *) + alignment - 1 + size); + if (ptr) { + void *orig_ptr = ptr; + ptr = (void *)ALIGN((uintptr_t)ptr + sizeof(void *), alignment); + ((void **)ptr)[-1] = orig_ptr; + } + return ptr; +} + +void +wimlib_aligned_free(void *ptr) +{ + if (ptr) + FREE(((void **)ptr)[-1]); +} + +void * +memdup(const void *mem, size_t size) +{ + void *ptr = MALLOC(size); + if (ptr) + ptr = memcpy(ptr, mem, size); + return ptr; +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_set_memory_allocator(void *(*malloc_func)(size_t), + void (*free_func)(void *), + void *(*realloc_func)(void *, size_t)) +{ + wimlib_malloc_func = malloc_func ? malloc_func : malloc; + wimlib_free_func = free_func ? free_func : free; + wimlib_realloc_func = realloc_func ? realloc_func : realloc; + return 0; +} + +/******************* + * String utilities + *******************/ + +#ifndef HAVE_MEMPCPY +void *mempcpy(void *dst, const void *src, size_t n) +{ + return memcpy(dst, src, n) + n; +} +#endif + +/************************** + * Random number generation + **************************/ + +#ifndef _WIN32 +/* + * Generate @n cryptographically secure random bytes (thread-safe) + * + * This is the UNIX version. It uses the Linux getrandom() system call if + * available; otherwise, it falls back to reading from /dev/urandom. + */ +void +get_random_bytes(void *p, size_t n) +{ + if (n == 0) + return; +#ifdef __NR_getrandom + static bool getrandom_unavailable; + + if (getrandom_unavailable) + goto try_dev_urandom; + do { + int res = syscall(__NR_getrandom, p, n, 0); + if (unlikely(res < 0)) { + if (errno == ENOSYS) { + getrandom_unavailable = true; + goto try_dev_urandom; + } + if (errno == EINTR) + continue; + ERROR_WITH_ERRNO("getrandom() failed"); + wimlib_assert(0); + res = 0; + } + p += res; + n -= res; + } while (n != 0); + return; + +try_dev_urandom: + ; +#endif /* __NR_getrandom */ + int fd = open("/dev/urandom", O_RDONLY); + if (fd < 0) { + ERROR_WITH_ERRNO("Unable to open /dev/urandom"); + wimlib_assert(0); + } + do { + int res = read(fd, p, min(n, INT_MAX)); + if (unlikely(res < 0)) { + if (errno == EINTR) + continue; + ERROR_WITH_ERRNO("Error reading from /dev/urandom"); + wimlib_assert(0); + res = 0; + } + p += res; + n -= res; + } while (n != 0); + close(fd); +} +#endif /* !_WIN32 */ + +/* + * Generate @n cryptographically secure random alphanumeric characters + * (thread-safe) + * + * This is implemented on top of get_random_bytes(). For efficiency the calls + * to get_random_bytes() are batched. + */ +void +get_random_alnum_chars(tchar *p, size_t n) +{ + u32 r[64]; + int r_idx = 0; + int r_end = 0; + + for (; n != 0; p++, n--) { + tchar x; + + if (r_idx >= r_end) { + r_idx = 0; + r_end = min(n, ARRAY_LEN(r)); + get_random_bytes(r, r_end * sizeof(r[0])); + } + + STATIC_ASSERT(sizeof(r[0]) == sizeof(u32)); + while (unlikely(r[r_idx] >= UINT32_MAX - (UINT32_MAX % 62))) + get_random_bytes(&r[r_idx], sizeof(r[0])); + + x = r[r_idx++] % 62; + + if (x < 26) + *p = 'a' + x; + else if (x < 52) + *p = 'A' + x - 26; + else + *p = '0' + x - 52; + } +} + +/************************ + * System information + ************************/ + +#ifndef _WIN32 +unsigned +get_available_cpus(void) +{ + long n = sysconf(_SC_NPROCESSORS_ONLN); + if (n < 1 || n >= UINT_MAX) { + WARNING("Failed to determine number of processors; assuming 1."); + return 1; + } + return n; +} +#endif /* !_WIN32 */ + +#ifndef _WIN32 +u64 +get_available_memory(void) +{ +#if defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES) + long page_size = sysconf(_SC_PAGESIZE); + long num_pages = sysconf(_SC_PHYS_PAGES); + if (page_size <= 0 || num_pages <= 0) + goto default_size; + return ((u64)page_size * (u64)num_pages); +#else + int mib[2] = {CTL_HW, HW_MEMSIZE}; + u64 memsize; + size_t len = sizeof(memsize); + if (sysctl(mib, ARRAY_LEN(mib), &memsize, &len, NULL, 0) < 0 || len != 8) + goto default_size; + return memsize; +#endif + +default_size: + WARNING("Failed to determine available memory; assuming 1 GiB"); + return (u64)1 << 30; +} +#endif /* !_WIN32 */ diff --git a/src/wimlib/wim.c b/src/wimlib/wim.c new file mode 100644 index 00000000..3a2a216a --- /dev/null +++ b/src/wimlib/wim.c @@ -0,0 +1,1028 @@ +/* + * wim.c - High-level code dealing with WIMStructs and images. + */ + +/* + * Copyright 2012-2023 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <errno.h> +#include <fcntl.h> +#include <stdlib.h> +#include <sys/stat.h> +#include <unistd.h> + +#include "wimlib.h" +#include "wimlib/assert.h" +#include "wimlib/blob_table.h" +#include "wimlib/cpu_features.h" +#include "wimlib/dentry.h" +#include "wimlib/encoding.h" +#include "wimlib/file_io.h" +#include "wimlib/integrity.h" +#include "wimlib/metadata.h" +#include "wimlib/security.h" +#include "wimlib/threads.h" +#include "wimlib/wim.h" +#include "wimlib/xml.h" +#include "wimlib/win32.h" + +/* Information about the available compression types for the WIM format. */ +static const struct { + const tchar *name; + u32 min_chunk_size; + u32 max_chunk_size; + u32 default_nonsolid_chunk_size; + u32 default_solid_chunk_size; +} wim_ctype_info[] = { + [WIMLIB_COMPRESSION_TYPE_NONE] = { + .name = T("None"), + .min_chunk_size = 0, + .max_chunk_size = 0, + .default_nonsolid_chunk_size = 0, + .default_solid_chunk_size = 0, + }, + [WIMLIB_COMPRESSION_TYPE_XPRESS] = { + .name = T("XPRESS"), + .min_chunk_size = 4096, + .max_chunk_size = 65536, + .default_nonsolid_chunk_size = 32768, + .default_solid_chunk_size = 32768, + }, + [WIMLIB_COMPRESSION_TYPE_LZX] = { + .name = T("LZX"), + .min_chunk_size = 32768, + .max_chunk_size = 2097152, + .default_nonsolid_chunk_size = 32768, + .default_solid_chunk_size = 32768, + }, + [WIMLIB_COMPRESSION_TYPE_LZMS] = { + .name = T("LZMS"), + .min_chunk_size = 32768, + .max_chunk_size = 1073741824, + .default_nonsolid_chunk_size = 131072, + .default_solid_chunk_size = 67108864, + }, +}; + +/* Is the specified compression type valid? */ +static bool +wim_compression_type_valid(enum wimlib_compression_type ctype) +{ + return (unsigned)ctype < ARRAY_LEN(wim_ctype_info) && + wim_ctype_info[(unsigned)ctype].name != NULL; +} + +/* Is the specified chunk size valid for the compression type? */ +static bool +wim_chunk_size_valid(u32 chunk_size, enum wimlib_compression_type ctype) +{ + if (!(chunk_size == 0 || is_power_of_2(chunk_size))) + return false; + + return chunk_size >= wim_ctype_info[(unsigned)ctype].min_chunk_size && + chunk_size <= wim_ctype_info[(unsigned)ctype].max_chunk_size; +} + +/* Return the default chunk size to use for the specified compression type in + * non-solid resources. */ +static u32 +wim_default_nonsolid_chunk_size(enum wimlib_compression_type ctype) +{ + return wim_ctype_info[(unsigned)ctype].default_nonsolid_chunk_size; +} + +/* Return the default chunk size to use for the specified compression type in + * solid resources. */ +static u32 +wim_default_solid_chunk_size(enum wimlib_compression_type ctype) +{ + return wim_ctype_info[(unsigned)ctype].default_solid_chunk_size; +} + +/* Return the default compression type to use in solid resources. */ +static enum wimlib_compression_type +wim_default_solid_compression_type(void) +{ + return WIMLIB_COMPRESSION_TYPE_LZMS; +} + +static int +is_blob_in_solid_resource(struct blob_descriptor *blob, void *_ignore) +{ + return blob->blob_location == BLOB_IN_WIM && + (blob->rdesc->flags & WIM_RESHDR_FLAG_SOLID); +} + +bool +wim_has_solid_resources(const WIMStruct *wim) +{ + return for_blob_in_table(wim->blob_table, is_blob_in_solid_resource, NULL); +} + +static WIMStruct * +new_wim_struct(void) +{ + WIMStruct *wim = CALLOC(1, sizeof(WIMStruct)); + if (!wim) + return NULL; + + wim->refcnt = 1; + filedes_invalidate(&wim->in_fd); + filedes_invalidate(&wim->out_fd); + wim->out_solid_compression_type = wim_default_solid_compression_type(); + wim->out_solid_chunk_size = wim_default_solid_chunk_size( + wim->out_solid_compression_type); + return wim; +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_create_new_wim(enum wimlib_compression_type ctype, WIMStruct **wim_ret) +{ + int ret; + WIMStruct *wim; + + ret = wimlib_global_init(0); + if (ret) + return ret; + + if (!wim_ret) + return WIMLIB_ERR_INVALID_PARAM; + + if (!wim_compression_type_valid(ctype)) + return WIMLIB_ERR_INVALID_COMPRESSION_TYPE; + + wim = new_wim_struct(); + if (!wim) + return WIMLIB_ERR_NOMEM; + + /* Fill in wim->hdr with default values */ + wim->hdr.magic = WIM_MAGIC; + wim->hdr.wim_version = WIM_VERSION_DEFAULT; + wim->hdr.part_number = 1; + wim->hdr.total_parts = 1; + wim->compression_type = WIMLIB_COMPRESSION_TYPE_NONE; + + /* Set the output compression type */ + wim->out_compression_type = ctype; + wim->out_chunk_size = wim_default_nonsolid_chunk_size(ctype); + + /* Allocate an empty XML info and blob table */ + wim->xml_info = xml_new_info_struct(); + wim->blob_table = new_blob_table(64); + if (!wim->xml_info || !wim->blob_table) { + wimlib_free(wim); + return WIMLIB_ERR_NOMEM; + } + + *wim_ret = wim; + return 0; +} + +static void +unload_image_metadata(struct wim_image_metadata *imd) +{ + free_dentry_tree(imd->root_dentry, NULL); + imd->root_dentry = NULL; + free_wim_security_data(imd->security_data); + imd->security_data = NULL; + INIT_HLIST_HEAD(&imd->inode_list); +} + +/* Release a reference to the specified image metadata. This assumes that no + * WIMStruct has the image selected. */ +void +put_image_metadata(struct wim_image_metadata *imd) +{ + struct blob_descriptor *blob, *tmp; + + if (!imd) + return; + wimlib_assert(imd->refcnt > 0); + if (--imd->refcnt != 0) + return; + wimlib_assert(imd->selected_refcnt == 0); + unload_image_metadata(imd); + list_for_each_entry_safe(blob, tmp, &imd->unhashed_blobs, unhashed_list) + free_blob_descriptor(blob); + free_blob_descriptor(imd->metadata_blob); + FREE(imd); +} + +/* Appends the specified image metadata structure to the array of image metadata + * for a WIM, and increments the image count. */ +int +append_image_metadata(WIMStruct *wim, struct wim_image_metadata *imd) +{ + struct wim_image_metadata **imd_array; + + if (!wim_has_metadata(wim)) + return WIMLIB_ERR_METADATA_NOT_FOUND; + + if (wim->hdr.image_count >= MAX_IMAGES) + return WIMLIB_ERR_IMAGE_COUNT; + + imd_array = REALLOC(wim->image_metadata, + sizeof(wim->image_metadata[0]) * (wim->hdr.image_count + 1)); + + if (!imd_array) + return WIMLIB_ERR_NOMEM; + wim->image_metadata = imd_array; + imd_array[wim->hdr.image_count++] = imd; + return 0; +} + +static struct wim_image_metadata * +new_image_metadata(struct blob_descriptor *metadata_blob, + struct wim_security_data *security_data) +{ + struct wim_image_metadata *imd; + + imd = CALLOC(1, sizeof(*imd)); + if (!imd) + return NULL; + + metadata_blob->is_metadata = 1; + imd->refcnt = 1; + imd->selected_refcnt = 0; + imd->root_dentry = NULL; + imd->security_data = security_data; + imd->metadata_blob = metadata_blob; + INIT_HLIST_HEAD(&imd->inode_list); + INIT_LIST_HEAD(&imd->unhashed_blobs); + imd->stats_outdated = false; + return imd; +} + +/* Create an image metadata structure for a new empty image. */ +struct wim_image_metadata * +new_empty_image_metadata(void) +{ + struct blob_descriptor *metadata_blob; + struct wim_security_data *security_data; + struct wim_image_metadata *imd; + + metadata_blob = new_blob_descriptor(); + security_data = new_wim_security_data(); + if (metadata_blob && security_data) { + metadata_blob->refcnt = 1; + imd = new_image_metadata(metadata_blob, security_data); + if (imd) + return imd; + } + free_blob_descriptor(metadata_blob); + FREE(security_data); + return NULL; +} + +/* Create an image metadata structure that refers to the specified metadata + * resource and is initially not loaded. */ +struct wim_image_metadata * +new_unloaded_image_metadata(struct blob_descriptor *metadata_blob) +{ + wimlib_assert(metadata_blob->blob_location == BLOB_IN_WIM); + return new_image_metadata(metadata_blob, NULL); +} + +/* + * Load the metadata for the specified WIM image into memory and set it + * as the WIMStruct's currently selected image. + * + * @wim + * The WIMStruct for the WIM. + * @image + * The 1-based index of the image in the WIM to select. + * + * On success, 0 will be returned, wim->current_image will be set to + * @image, and wim_get_current_image_metadata() can be used to retrieve + * metadata information for the image. + * + * On failure, WIMLIB_ERR_INVALID_IMAGE, WIMLIB_ERR_METADATA_NOT_FOUND, + * or another error code will be returned. + */ +int +select_wim_image(WIMStruct *wim, int image) +{ + struct wim_image_metadata *imd; + int ret; + + if (image == WIMLIB_NO_IMAGE) + return WIMLIB_ERR_INVALID_IMAGE; + + if (image == wim->current_image) + return 0; + + if (image < 1 || image > wim->hdr.image_count) + return WIMLIB_ERR_INVALID_IMAGE; + + if (!wim_has_metadata(wim)) + return WIMLIB_ERR_METADATA_NOT_FOUND; + + deselect_current_wim_image(wim); + + imd = wim->image_metadata[image - 1]; + if (!is_image_loaded(imd)) { + ret = read_metadata_resource(imd); + if (ret) + return ret; + } + wim->current_image = image; + imd->selected_refcnt++; + return 0; +} + +/* + * Deselect the WIMStruct's currently selected image, if any. To reduce memory + * usage, possibly unload the newly deselected image's metadata from memory. + */ +void +deselect_current_wim_image(WIMStruct *wim) +{ + struct wim_image_metadata *imd; + + if (wim->current_image == WIMLIB_NO_IMAGE) + return; + imd = wim_get_current_image_metadata(wim); + wimlib_assert(imd->selected_refcnt > 0); + imd->selected_refcnt--; + wim->current_image = WIMLIB_NO_IMAGE; + + if (can_unload_image(imd)) { + wimlib_assert(list_empty(&imd->unhashed_blobs)); + unload_image_metadata(imd); + } +} + +/* + * Calls a function on images in the WIM. If @image is WIMLIB_ALL_IMAGES, + * @visitor is called on the WIM once for each image, with each image selected + * as the current image in turn. If @image is a certain image, @visitor is + * called on the WIM only once, with that image selected. + */ +int +for_image(WIMStruct *wim, int image, int (*visitor)(WIMStruct *)) +{ + int ret; + int start; + int end; + int i; + + if (image == WIMLIB_ALL_IMAGES) { + start = 1; + end = wim->hdr.image_count; + } else if (image >= 1 && image <= wim->hdr.image_count) { + start = image; + end = image; + } else { + return WIMLIB_ERR_INVALID_IMAGE; + } + for (i = start; i <= end; i++) { + ret = select_wim_image(wim, i); + if (ret != 0) + return ret; + ret = visitor(wim); + if (ret != 0) + return ret; + } + return 0; +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_resolve_image(WIMStruct *wim, const tchar *image_name_or_num) +{ + tchar *p; + long image; + int i; + + if (!image_name_or_num || !*image_name_or_num) + return WIMLIB_NO_IMAGE; + + if (!tstrcasecmp(image_name_or_num, T("all")) + || !tstrcasecmp(image_name_or_num, T("*"))) + return WIMLIB_ALL_IMAGES; + image = tstrtol(image_name_or_num, &p, 10); + if (p != image_name_or_num && *p == T('\0') && image > 0) { + if (image > wim->hdr.image_count) + return WIMLIB_NO_IMAGE; + return image; + } else { + for (i = 1; i <= wim->hdr.image_count; i++) { + if (!tstrcmp(image_name_or_num, + wimlib_get_image_name(wim, i))) + return i; + } + return WIMLIB_NO_IMAGE; + } +} + +/* API function documented in wimlib.h */ +WIMLIBAPI void +wimlib_print_available_images(const WIMStruct *wim, int image) +{ + int first; + int last; + int i; + int n; + if (image == WIMLIB_ALL_IMAGES) { + n = tprintf(T("Available Images:\n")); + first = 1; + last = wim->hdr.image_count; + } else if (image >= 1 && image <= wim->hdr.image_count) { + n = tprintf(T("Information for Image %d\n"), image); + first = image; + last = image; + } else { + tprintf(T("wimlib_print_available_images(): Invalid image %d"), + image); + return; + } + for (i = 0; i < n - 1; i++) + tputchar(T('-')); + tputchar(T('\n')); + for (i = first; i <= last; i++) + xml_print_image_info(wim->xml_info, i); +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_get_wim_info(WIMStruct *wim, struct wimlib_wim_info *info) +{ + memset(info, 0, sizeof(struct wimlib_wim_info)); + copy_guid(info->guid, wim->hdr.guid); + info->image_count = wim->hdr.image_count; + info->boot_index = wim->hdr.boot_idx; + info->wim_version = wim->hdr.wim_version; + info->chunk_size = wim->chunk_size; + info->part_number = wim->hdr.part_number; + info->total_parts = wim->hdr.total_parts; + info->compression_type = wim->compression_type; + info->total_bytes = xml_get_total_bytes(wim->xml_info); + info->has_integrity_table = wim_has_integrity_table(wim); + info->opened_from_file = (wim->filename != NULL); + info->is_readonly = (wim->hdr.flags & WIM_HDR_FLAG_READONLY) || + (wim->hdr.total_parts != 1) || + (wim->filename && taccess(wim->filename, W_OK)); + info->has_rpfix = (wim->hdr.flags & WIM_HDR_FLAG_RP_FIX) != 0; + info->is_marked_readonly = (wim->hdr.flags & WIM_HDR_FLAG_READONLY) != 0; + info->write_in_progress = (wim->hdr.flags & WIM_HDR_FLAG_WRITE_IN_PROGRESS) != 0; + info->metadata_only = (wim->hdr.flags & WIM_HDR_FLAG_METADATA_ONLY) != 0; + info->resource_only = (wim->hdr.flags & WIM_HDR_FLAG_RESOURCE_ONLY) != 0; + info->spanned = (wim->hdr.flags & WIM_HDR_FLAG_SPANNED) != 0; + info->pipable = wim_is_pipable(wim); + return 0; +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_set_wim_info(WIMStruct *wim, const struct wimlib_wim_info *info, int which) +{ + if (which & ~(WIMLIB_CHANGE_READONLY_FLAG | + WIMLIB_CHANGE_GUID | + WIMLIB_CHANGE_BOOT_INDEX | + WIMLIB_CHANGE_RPFIX_FLAG)) + return WIMLIB_ERR_INVALID_PARAM; + + if ((which & WIMLIB_CHANGE_BOOT_INDEX) && + info->boot_index > wim->hdr.image_count) + return WIMLIB_ERR_INVALID_IMAGE; + + if (which & WIMLIB_CHANGE_READONLY_FLAG) { + if (info->is_marked_readonly) + wim->hdr.flags |= WIM_HDR_FLAG_READONLY; + else + wim->hdr.flags &= ~WIM_HDR_FLAG_READONLY; + } + + if (which & WIMLIB_CHANGE_GUID) + copy_guid(wim->hdr.guid, info->guid); + + if (which & WIMLIB_CHANGE_BOOT_INDEX) + wim->hdr.boot_idx = info->boot_index; + + if (which & WIMLIB_CHANGE_RPFIX_FLAG) { + if (info->has_rpfix) + wim->hdr.flags |= WIM_HDR_FLAG_RP_FIX; + else + wim->hdr.flags &= ~WIM_HDR_FLAG_RP_FIX; + } + return 0; +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_set_output_compression_type(WIMStruct *wim, + enum wimlib_compression_type ctype) +{ + if (!wim_compression_type_valid(ctype)) + return WIMLIB_ERR_INVALID_COMPRESSION_TYPE; + + wim->out_compression_type = ctype; + + /* Reset the chunk size if it's no longer valid. */ + if (!wim_chunk_size_valid(wim->out_chunk_size, ctype)) + wim->out_chunk_size = wim_default_nonsolid_chunk_size(ctype); + return 0; +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_set_output_pack_compression_type(WIMStruct *wim, + enum wimlib_compression_type ctype) +{ + if (!wim_compression_type_valid(ctype)) + return WIMLIB_ERR_INVALID_COMPRESSION_TYPE; + + /* Solid resources can't be uncompressed. */ + if (ctype == WIMLIB_COMPRESSION_TYPE_NONE) + return WIMLIB_ERR_INVALID_COMPRESSION_TYPE; + + wim->out_solid_compression_type = ctype; + + /* Reset the chunk size if it's no longer valid. */ + if (!wim_chunk_size_valid(wim->out_solid_chunk_size, ctype)) + wim->out_solid_chunk_size = wim_default_solid_chunk_size(ctype); + return 0; +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_set_output_chunk_size(WIMStruct *wim, u32 chunk_size) +{ + if (chunk_size == 0) { + wim->out_chunk_size = + wim_default_nonsolid_chunk_size(wim->out_compression_type); + return 0; + } + + if (!wim_chunk_size_valid(chunk_size, wim->out_compression_type)) + return WIMLIB_ERR_INVALID_CHUNK_SIZE; + + wim->out_chunk_size = chunk_size; + return 0; +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_set_output_pack_chunk_size(WIMStruct *wim, u32 chunk_size) +{ + if (chunk_size == 0) { + wim->out_solid_chunk_size = + wim_default_solid_chunk_size(wim->out_solid_compression_type); + return 0; + } + + if (!wim_chunk_size_valid(chunk_size, wim->out_solid_compression_type)) + return WIMLIB_ERR_INVALID_CHUNK_SIZE; + + wim->out_solid_chunk_size = chunk_size; + return 0; +} + +/* API function documented in wimlib.h */ +WIMLIBAPI const tchar * +wimlib_get_compression_type_string(enum wimlib_compression_type ctype) +{ + if (!wim_compression_type_valid(ctype)) + return T("Invalid"); + + return wim_ctype_info[(unsigned)ctype].name; +} + +WIMLIBAPI void +wimlib_register_progress_function(WIMStruct *wim, + wimlib_progress_func_t progfunc, + void *progctx) +{ + wim->progfunc = progfunc; + wim->progctx = progctx; +} + +static int +open_wim_file(const tchar *filename, struct filedes *fd_ret) +{ + int raw_fd; + + raw_fd = topen(filename, O_RDONLY | O_BINARY); + if (raw_fd < 0) { + ERROR_WITH_ERRNO("Can't open \"%"TS"\" read-only", filename); + return WIMLIB_ERR_OPEN; + } + filedes_init(fd_ret, raw_fd); + return 0; +} + +/* + * Begins the reading of a WIM file; opens the file and reads its header and + * blob table, and optionally checks the integrity. + */ +static int +begin_read(WIMStruct *wim, const void *wim_filename_or_fd, int open_flags) +{ + int ret; + const tchar *wimfile; + + if (open_flags & WIMLIB_OPEN_FLAG_FROM_PIPE) { + wimfile = NULL; + filedes_init(&wim->in_fd, *(const int*)wim_filename_or_fd); + wim->in_fd.is_pipe = 1; + } else { + struct stat stbuf; + + wimfile = wim_filename_or_fd; + ret = open_wim_file(wimfile, &wim->in_fd); + if (ret) + return ret; + + /* The file size is needed for enforcing some limits later. */ + if (fstat(wim->in_fd.fd, &stbuf) == 0) + wim->file_size = stbuf.st_size; + + /* The absolute path to the WIM is requested so that + * wimlib_overwrite() still works even if the process changes + * its working directory. This actually happens if a WIM is + * mounted read-write, since the FUSE thread changes directory + * to "/", and it needs to be able to find the WIM file again. + * + * This will break if the full path to the WIM changes in the + * intervening time... + * + * Warning: in Windows native builds, realpath() calls the + * replacement function in win32_replacements.c. + */ + wim->filename = realpath(wimfile, NULL); + if (!wim->filename) { + ERROR_WITH_ERRNO("Failed to get full path to file " + "\"%"TS"\"", wimfile); + if (errno == ENOMEM) + return WIMLIB_ERR_NOMEM; + else + return WIMLIB_ERR_NO_FILENAME; + } + } + + ret = read_wim_header(wim, &wim->hdr); + if (ret) + return ret; + + if (wim->hdr.flags & WIM_HDR_FLAG_WRITE_IN_PROGRESS) { + WARNING("The WIM_HDR_FLAG_WRITE_IN_PROGRESS flag is set in the header of\n" + " \"%"TS"\". It may be being changed by another process,\n" + " or a process may have crashed while writing the WIM.", + wimfile); + } + + if (open_flags & WIMLIB_OPEN_FLAG_WRITE_ACCESS) { + ret = can_modify_wim(wim); + if (ret) + return ret; + } + + if ((open_flags & WIMLIB_OPEN_FLAG_ERROR_IF_SPLIT) && + (wim->hdr.total_parts != 1)) + return WIMLIB_ERR_IS_SPLIT_WIM; + + /* If the boot index is invalid, print a warning and set it to 0 */ + if (wim->hdr.boot_idx > wim->hdr.image_count) { + WARNING("Ignoring invalid boot index."); + wim->hdr.boot_idx = 0; + } + + /* Check and cache the compression type */ + if (wim->hdr.flags & WIM_HDR_FLAG_COMPRESSION) { + if (wim->hdr.flags & WIM_HDR_FLAG_COMPRESS_LZX) { + wim->compression_type = WIMLIB_COMPRESSION_TYPE_LZX; + } else if (wim->hdr.flags & (WIM_HDR_FLAG_COMPRESS_XPRESS | + WIM_HDR_FLAG_COMPRESS_XPRESS_2)) { + wim->compression_type = WIMLIB_COMPRESSION_TYPE_XPRESS; + } else if (wim->hdr.flags & WIM_HDR_FLAG_COMPRESS_LZMS) { + wim->compression_type = WIMLIB_COMPRESSION_TYPE_LZMS; + } else { + return WIMLIB_ERR_INVALID_COMPRESSION_TYPE; + } + } else { + wim->compression_type = WIMLIB_COMPRESSION_TYPE_NONE; + } + wim->out_compression_type = wim->compression_type; + + /* Check and cache the chunk size. */ + wim->chunk_size = wim->hdr.chunk_size; + wim->out_chunk_size = wim->chunk_size; + if (!wim_chunk_size_valid(wim->chunk_size, wim->compression_type)) { + ERROR("Invalid chunk size (%"PRIu32" bytes) " + "for compression type %"TS"!", wim->chunk_size, + wimlib_get_compression_type_string(wim->compression_type)); + return WIMLIB_ERR_INVALID_CHUNK_SIZE; + } + + if (open_flags & WIMLIB_OPEN_FLAG_CHECK_INTEGRITY) { + ret = check_wim_integrity(wim); + if (ret == WIM_INTEGRITY_NONEXISTENT) { + WARNING("\"%"TS"\" does not contain integrity " + "information. Skipping integrity check.", + wimfile); + } else if (ret == WIM_INTEGRITY_NOT_OK) { + return WIMLIB_ERR_INTEGRITY; + } else if (ret != WIM_INTEGRITY_OK) { + return ret; + } + } + + if (wim->hdr.image_count != 0 && wim->hdr.part_number == 1) { + wim->image_metadata = CALLOC(wim->hdr.image_count, + sizeof(wim->image_metadata[0])); + if (!wim->image_metadata) + return WIMLIB_ERR_NOMEM; + } + + if (open_flags & WIMLIB_OPEN_FLAG_FROM_PIPE) { + wim->blob_table = new_blob_table(64); + if (!wim->blob_table) + return WIMLIB_ERR_NOMEM; + } else { + if (wim->hdr.blob_table_reshdr.uncompressed_size == 0 && + wim->hdr.xml_data_reshdr.uncompressed_size == 0) + return WIMLIB_ERR_WIM_IS_INCOMPLETE; + + ret = read_wim_xml_data(wim); + if (ret) + return ret; + + if (xml_get_image_count(wim->xml_info) != wim->hdr.image_count) { + ERROR("The WIM's header is inconsistent with its XML data.\n" + " Please submit a bug report if you believe this " + "WIM file should be considered valid."); + return WIMLIB_ERR_IMAGE_COUNT; + } + + ret = read_blob_table(wim); + if (ret) + return ret; + } + return 0; +} + +int +open_wim_as_WIMStruct(const void *wim_filename_or_fd, int open_flags, + WIMStruct **wim_ret, + wimlib_progress_func_t progfunc, void *progctx) +{ + WIMStruct *wim; + int ret; + + ret = wimlib_global_init(0); + if (ret) + return ret; + + wim = new_wim_struct(); + if (!wim) + return WIMLIB_ERR_NOMEM; + + wim->progfunc = progfunc; + wim->progctx = progctx; + + ret = begin_read(wim, wim_filename_or_fd, open_flags); + if (ret) { + wimlib_free(wim); + return ret; + } + + *wim_ret = wim; + return 0; +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_open_wim_with_progress(const tchar *wimfile, int open_flags, + WIMStruct **wim_ret, + wimlib_progress_func_t progfunc, void *progctx) +{ + if (open_flags & ~(WIMLIB_OPEN_FLAG_CHECK_INTEGRITY | + WIMLIB_OPEN_FLAG_ERROR_IF_SPLIT | + WIMLIB_OPEN_FLAG_WRITE_ACCESS)) + return WIMLIB_ERR_INVALID_PARAM; + + if (!wimfile || !*wimfile || !wim_ret) + return WIMLIB_ERR_INVALID_PARAM; + + return open_wim_as_WIMStruct(wimfile, open_flags, wim_ret, + progfunc, progctx); +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_open_wim(const tchar *wimfile, int open_flags, WIMStruct **wim_ret) +{ + return wimlib_open_wim_with_progress(wimfile, open_flags, wim_ret, + NULL, NULL); +} + +/* Checksum all blobs that are unhashed (other than the metadata blobs), merging + * them into the blob table as needed. This is a no-op unless files have been + * added to an image in the same WIMStruct. */ +int +wim_checksum_unhashed_blobs(WIMStruct *wim) +{ + int ret; + + if (!wim_has_metadata(wim)) + return 0; + for (int i = 0; i < wim->hdr.image_count; i++) { + struct blob_descriptor *blob, *tmp; + struct wim_image_metadata *imd = wim->image_metadata[i]; + image_for_each_unhashed_blob_safe(blob, tmp, imd) { + struct blob_descriptor *new_blob; + ret = hash_unhashed_blob(blob, wim->blob_table, &new_blob); + if (ret) + return ret; + if (new_blob != blob) + free_blob_descriptor(blob); + } + } + return 0; +} + +/* + * can_modify_wim - Check if a given WIM is writeable. This is only the case if + * it meets the following three conditions: + * + * 1. Write access is allowed to the underlying file (if any) at the filesystem level. + * 2. The WIM is not part of a spanned set. + * 3. The WIM_HDR_FLAG_READONLY flag is not set in the WIM header. + * + * Return value is 0 if writable; WIMLIB_ERR_WIM_IS_READONLY otherwise. + */ +int +can_modify_wim(WIMStruct *wim) +{ + if (wim->filename) { + if (taccess(wim->filename, W_OK)) { + ERROR_WITH_ERRNO("Can't modify \"%"TS"\"", wim->filename); + return WIMLIB_ERR_WIM_IS_READONLY; + } + } + if (wim->hdr.total_parts != 1) { + ERROR("Cannot modify \"%"TS"\": is part of a split WIM", + wim->filename); + return WIMLIB_ERR_WIM_IS_READONLY; + } + if (wim->hdr.flags & WIM_HDR_FLAG_READONLY) { + ERROR("Cannot modify \"%"TS"\": is marked read-only", + wim->filename); + return WIMLIB_ERR_WIM_IS_READONLY; + } + return 0; +} + +/* Release a reference to a WIMStruct. If the reference count reaches 0, the + * WIMStruct is freed. */ +void +wim_decrement_refcnt(WIMStruct *wim) +{ + wimlib_assert(wim->refcnt > 0); + if (--wim->refcnt != 0) + return; + if (filedes_valid(&wim->in_fd)) + filedes_close(&wim->in_fd); + if (filedes_valid(&wim->out_fd)) + filedes_close(&wim->out_fd); + wimlib_free_decompressor(wim->decompressor); + xml_free_info_struct(wim->xml_info); + FREE(wim->filename); + FREE(wim); +} + +/* API function documented in wimlib.h */ +WIMLIBAPI void +wimlib_free(WIMStruct *wim) +{ + if (!wim) + return; + + /* The blob table and image metadata are freed immediately, but other + * members of the WIMStruct such as the input file descriptor are + * retained until no more exported resources reference the WIMStruct. */ + + free_blob_table(wim->blob_table); + wim->blob_table = NULL; + if (wim->image_metadata != NULL) { + deselect_current_wim_image(wim); + for (int i = 0; i < wim->hdr.image_count; i++) + put_image_metadata(wim->image_metadata[i]); + FREE(wim->image_metadata); + wim->image_metadata = NULL; + } + + wim_decrement_refcnt(wim); +} + +/* API function documented in wimlib.h */ +WIMLIBAPI u32 +wimlib_get_version(void) +{ + return (WIMLIB_MAJOR_VERSION << 20) | + (WIMLIB_MINOR_VERSION << 10) | + WIMLIB_PATCH_VERSION; +} + +WIMLIBAPI const tchar * +wimlib_get_version_string(void) +{ + return T(PACKAGE_VERSION); +} + +static bool lib_initialized = false; +static struct mutex lib_initialization_mutex = MUTEX_INITIALIZER; + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_global_init(int init_flags) +{ + int ret = 0; + + if (lib_initialized) + goto out; + + mutex_lock(&lib_initialization_mutex); + + if (lib_initialized) + goto out_unlock; + + if (!wimlib_error_file) + wimlib_error_file = stderr; + + ret = WIMLIB_ERR_INVALID_PARAM; + if (init_flags & ~(WIMLIB_INIT_FLAG_ASSUME_UTF8 | + WIMLIB_INIT_FLAG_DONT_ACQUIRE_PRIVILEGES | + WIMLIB_INIT_FLAG_STRICT_CAPTURE_PRIVILEGES | + WIMLIB_INIT_FLAG_STRICT_APPLY_PRIVILEGES | + WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE | + WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE)) + goto out_unlock; + + ret = WIMLIB_ERR_INVALID_PARAM; + if ((init_flags & (WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE | + WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE)) + == (WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE | + WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE)) + goto out_unlock; + + init_cpu_features(); +#ifdef _WIN32 + ret = win32_global_init(init_flags); + if (ret) + goto out_unlock; +#endif + init_upcase(); + if (init_flags & WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE) + default_ignore_case = false; + else if (init_flags & WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE) + default_ignore_case = true; + lib_initialized = true; + ret = 0; +out_unlock: + mutex_unlock(&lib_initialization_mutex); +out: + return ret; +} + +/* API function documented in wimlib.h */ +WIMLIBAPI void +wimlib_global_cleanup(void) +{ + if (!lib_initialized) + return; + + mutex_lock(&lib_initialization_mutex); + + if (!lib_initialized) + goto out_unlock; + +#ifdef _WIN32 + win32_global_cleanup(); +#endif + + wimlib_set_error_file(NULL); + lib_initialized = false; + +out_unlock: + mutex_unlock(&lib_initialization_mutex); +} diff --git a/src/wimlib/wimboot.c b/src/wimlib/wimboot.c new file mode 100644 index 00000000..115a5699 --- /dev/null +++ b/src/wimlib/wimboot.c @@ -0,0 +1,1123 @@ +/* + * wimboot.c + * + * Support for creating WIMBoot pointer files. + * + * For general information about WIMBoot, see + * https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-8.1-and-8/dn594399(v=win.10) + * + * Note that WIMBoot pointer files are actually implemented on top of the + * Windows Overlay Filesystem filter (WOF). See wof.h for more info. + */ + +/* + * Copyright (C) 2014-2021 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef _WIN32 + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/win32_common.h" + +#include "wimlib/assert.h" +#include "wimlib/blob_table.h" +#include "wimlib/inode.h" +#include "wimlib/error.h" +#include "wimlib/util.h" +#include "wimlib/wimboot.h" +#include "wimlib/win32.h" +#include "wimlib/wof.h" + +static HANDLE +open_file(const wchar_t *device_name, DWORD desiredAccess) +{ + return CreateFile(device_name, desiredAccess, + FILE_SHARE_VALID_FLAGS, NULL, OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, NULL); +} + +static BOOL +query_device(HANDLE h, DWORD code, void *out, DWORD out_size) +{ + DWORD bytes_returned; + return DeviceIoControl(h, code, NULL, 0, out, out_size, + &bytes_returned, NULL); +} + +/* + * Gets partition and drive information for the specified path. + * + * @path + * Absolute path which must begin with a drive letter. For example, if the + * path is D:\install.wim, this function will query information about the + * D: volume. + * @part_info_ret + * Partition info is returned here. + * @drive_info_ret + * Drive info is returned here. The contained partition info will not be + * valid. + * + * Returns 0 on success, or a positive error code on failure. + */ +static int +query_partition_and_disk_info(const wchar_t *path, + PARTITION_INFORMATION_EX *part_info, + DRIVE_LAYOUT_INFORMATION_EX *drive_info_ret) +{ + wchar_t vol_name[] = L"\\\\.\\X:"; + wchar_t disk_name[] = L"\\\\?\\PhysicalDriveXXXXXXXXXX"; + HANDLE h = INVALID_HANDLE_VALUE; + VOLUME_DISK_EXTENTS *extents = NULL; + size_t extents_size; + DRIVE_LAYOUT_INFORMATION_EX *drive_info = NULL; + size_t drive_info_size; + int ret; + + wimlib_assert(path[0] != L'\0' && path[1] == L':'); + + *(wcschr(vol_name, L'X')) = path[0]; + + h = open_file(vol_name, GENERIC_READ); + if (h == INVALID_HANDLE_VALUE) { + win32_error(GetLastError(), L"\"%ls\": Can't open volume device", + vol_name); + ret = WIMLIB_ERR_OPEN; + goto out; + } + + if (!query_device(h, IOCTL_DISK_GET_PARTITION_INFO_EX, + part_info, sizeof(PARTITION_INFORMATION_EX))) + { + win32_error(GetLastError(), + L"\"%ls\": Can't get partition info", vol_name); + ret = WIMLIB_ERR_READ; + goto out; + } + + extents_size = sizeof(VOLUME_DISK_EXTENTS); + for (;;) { + extents_size += 4 * sizeof(DISK_EXTENT); + extents = MALLOC(extents_size); + if (!extents) { + ret = WIMLIB_ERR_NOMEM; + goto out; + } + + if (query_device(h, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, + extents, extents_size)) + break; + if (GetLastError() != ERROR_MORE_DATA) { + win32_error(GetLastError(), + L"\"%ls\": Can't get volume extent info", + vol_name); + ret = WIMLIB_ERR_READ; + goto out; + } + FREE(extents); + } + + CloseHandle(h); + h = INVALID_HANDLE_VALUE; + + if (extents->NumberOfDiskExtents != 1) { + ERROR("\"%ls\": This volume has %"PRIu32" disk extents, " + "but this code is untested for more than 1", + vol_name, (u32)extents->NumberOfDiskExtents); + ret = WIMLIB_ERR_UNSUPPORTED; + goto out; + } + + wsprintf(wcschr(disk_name, L'X'), L"%"PRIu32, + extents->Extents[0].DiskNumber); + + h = open_file(disk_name, GENERIC_READ); + if (h == INVALID_HANDLE_VALUE) { + win32_error(GetLastError(), + L"\"%ls\": Can't open disk device", disk_name); + ret = WIMLIB_ERR_OPEN; + goto out; + } + + drive_info_size = sizeof(DRIVE_LAYOUT_INFORMATION_EX); + for (;;) { + drive_info_size += 4 * sizeof(PARTITION_INFORMATION_EX); + drive_info = MALLOC(drive_info_size); + if (!drive_info) { + ret = WIMLIB_ERR_NOMEM; + goto out; + } + + if (query_device(h, IOCTL_DISK_GET_DRIVE_LAYOUT_EX, + drive_info, drive_info_size)) + break; + if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) { + win32_error(GetLastError(), + L"\"%ls\": Can't get disk info", disk_name); + ret = WIMLIB_ERR_READ; + goto out; + } + FREE(drive_info); + } + + *drive_info_ret = *drive_info; /* doesn't include partitions */ + CloseHandle(h); + h = INVALID_HANDLE_VALUE; + + if (drive_info->PartitionStyle != part_info->PartitionStyle) { + ERROR("\"%ls\", \"%ls\": Inconsistent partition table type!", + vol_name, disk_name); + ret = WIMLIB_ERR_UNSUPPORTED; + goto out; + } + + if (part_info->PartitionStyle == PARTITION_STYLE_GPT) { + STATIC_ASSERT(sizeof(part_info->Gpt.PartitionId) == + sizeof(drive_info->Gpt.DiskId)); + if (!memcmp(&part_info->Gpt.PartitionId, + &drive_info->Gpt.DiskId, + sizeof(drive_info->Gpt.DiskId))) + { + ERROR("\"%ls\", \"%ls\": Partition GUID is the " + "same as the disk GUID???", vol_name, disk_name); + ret = WIMLIB_ERR_UNSUPPORTED; + goto out; + } + } + + if (part_info->PartitionStyle != PARTITION_STYLE_MBR && + part_info->PartitionStyle != PARTITION_STYLE_GPT) + { + ERROR("\"%ls\": Unknown partition style 0x%08"PRIx32, + vol_name, (u32)part_info->PartitionStyle); + ret = WIMLIB_ERR_UNSUPPORTED; + goto out; + } + + ret = 0; +out: + FREE(extents); + FREE(drive_info); + if (h != INVALID_HANDLE_VALUE) + CloseHandle(h); + return ret; +} + +/* + * Calculate the size of WimOverlay.dat with one entry added. + * + * @old_hdr + * Previous WimOverlay.dat contents, or NULL if file did not exist. + * @new_entry_2_size + * Size of entry_2 being added. + * @size_ret + * Size will be returned here. + * + * Returns 0 on success, or WIMLIB_ERR_UNSUPPORTED if size overflows 32 bits. + */ +static int +calculate_wimoverlay_dat_size(const struct WimOverlay_dat_header *old_hdr, + u32 new_entry_2_size, u32 *size_ret) +{ + u64 size_64; + u32 size; + + size_64 = sizeof(struct WimOverlay_dat_header); + if (old_hdr) { + for (u32 i = 0; i < old_hdr->num_entries; i++) { + size_64 += sizeof(struct WimOverlay_dat_entry_1); + size_64 += old_hdr->entry_1s[i].entry_2_length; + } + } + size_64 += sizeof(struct WimOverlay_dat_entry_1); + size_64 += new_entry_2_size; + + size = size_64; + if (size_64 != size) + return WIMLIB_ERR_UNSUPPORTED; + + *size_ret = size; + return 0; +} + +/* + * Writes @size bytes of @contents to the named file @path. + * + * Returns 0 on success; WIMLIB_ERR_OPEN or WIMLIB_ERR_WRITE on failure. + */ +static int +write_wimoverlay_dat(const wchar_t *path, const void *contents, u32 size) +{ + HANDLE h; + DWORD bytes_written; + + h = CreateFile(path, GENERIC_WRITE, 0, NULL, + CREATE_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL); + if (h == INVALID_HANDLE_VALUE) { + win32_error(GetLastError(), + L"\"%ls\": Can't open file for writing", path); + return WIMLIB_ERR_OPEN; + } + + SetLastError(0); + if (!WriteFile(h, contents, size, &bytes_written, NULL) || + bytes_written != size) + { + win32_error(GetLastError(), + L"\"%ls\": Can't write file", path); + CloseHandle(h); + return WIMLIB_ERR_WRITE; + } + + if (!CloseHandle(h)) { + win32_error(GetLastError(), + L"\"%ls\": Can't close handle", path); + return WIMLIB_ERR_WRITE; + } + + return 0; +} + +/* + * Generates the contents of WimOverlay.dat in memory, with one entry added. + * + * @buf + * Buffer large enough to hold the new contents. + * @old_hdr + * Old contents of WimOverlay.dat, or NULL if it did not exist. + * @wim_path + * Absolute path to the WIM file. It must begin with a drive letter; for + * example, D:\install.wim. + * @wim_guid + * GUID of the WIM, from the WIM header. + * @image + * Number of the image in the WIM to specify in the new entry. + * @new_data_source_id + * Data source ID to use for the new entry. + * @part_info + * Partition information for the WIM file. + * @disk_info + * Disk information for the WIM file. + * @new_entry_2_size + * Size, in bytes, of the new location information structure ('struct + * WimOverlay_dat_entry_2'). + * + * Returns a pointer one past the last byte of @buf filled in. + */ +static u8 * +fill_in_wimoverlay_dat(u8 *buf, + const struct WimOverlay_dat_header *old_hdr, + const wchar_t *wim_path, + const u8 wim_guid[GUID_SIZE], + int image, + u64 new_data_source_id, + const PARTITION_INFORMATION_EX *part_info, + const DRIVE_LAYOUT_INFORMATION_EX *disk_info, + u32 new_entry_2_size) +{ + struct WimOverlay_dat_header *new_hdr; + struct WimOverlay_dat_entry_1 *new_entry_1; + struct WimOverlay_dat_entry_2 *new_entry_2; + u32 entry_2_offset; + u8 *p = buf; + + new_hdr = (struct WimOverlay_dat_header *)p; + + /* Fill in new header */ + new_hdr->magic = WIMOVERLAY_DAT_MAGIC; + new_hdr->wim_provider_version = WIM_PROVIDER_CURRENT_VERSION; + new_hdr->unknown_0x08 = 0x00000028; + new_hdr->num_entries = (old_hdr ? old_hdr->num_entries : 0) + 1; + new_hdr->next_data_source_id = (old_hdr ? old_hdr->next_data_source_id : 0) + 1; + + p += sizeof(struct WimOverlay_dat_header); + + /* Copy WIM-specific information for old entries */ + entry_2_offset = sizeof(struct WimOverlay_dat_header) + + (new_hdr->num_entries * sizeof(struct WimOverlay_dat_entry_1)); + if (old_hdr) { + for (u32 i = 0; i < old_hdr->num_entries; i++) { + new_entry_1 = (struct WimOverlay_dat_entry_1 *)p; + + p = mempcpy(p, &old_hdr->entry_1s[i], + sizeof(struct WimOverlay_dat_entry_1)); + + new_entry_1->entry_2_offset = entry_2_offset; + entry_2_offset += new_entry_1->entry_2_length; + } + } + + /* Generate WIM-specific information for new entry */ + new_entry_1 = (struct WimOverlay_dat_entry_1 *)p; + + new_entry_1->data_source_id = new_data_source_id; + new_entry_1->entry_2_offset = entry_2_offset; + new_entry_1->entry_2_length = new_entry_2_size; + new_entry_1->wim_type = WIM_BOOT_NOT_OS_WIM; + new_entry_1->wim_index = image; + STATIC_ASSERT(sizeof(new_entry_1->guid) == GUID_SIZE); + copy_guid(new_entry_1->guid, wim_guid); + + p += sizeof(struct WimOverlay_dat_entry_1); + + /* Copy WIM location information for old entries */ + if (old_hdr) { + for (u32 i = 0; i < old_hdr->num_entries; i++) { + wimlib_assert(new_hdr->entry_1s[i].entry_2_offset == p - buf); + wimlib_assert(old_hdr->entry_1s[i].entry_2_length == + new_hdr->entry_1s[i].entry_2_length); + p = mempcpy(p, + ((const u8 *)old_hdr + old_hdr->entry_1s[i].entry_2_offset), + old_hdr->entry_1s[i].entry_2_length); + } + } + + /* Generate WIM location information for new entry */ + new_entry_2 = (struct WimOverlay_dat_entry_2 *)p; + + new_entry_2->unknown_0x00 = 0x00000000; + new_entry_2->unknown_0x04 = 0x00000000; + new_entry_2->entry_2_length = new_entry_2_size; + new_entry_2->unknown_0x0C = 0x00000000; + new_entry_2->unknown_0x10 = 0x00000005; + new_entry_2->unknown_0x14 = 0x00000001; + new_entry_2->inner_struct_size = new_entry_2_size - 0x14; + new_entry_2->unknown_0x1C = 0x00000005; + new_entry_2->unknown_0x20 = 0x00000006; + new_entry_2->unknown_0x24 = 0x00000000; + new_entry_2->unknown_0x28 = 0x00000048; + new_entry_2->unknown_0x2C = 0x00000000; + new_entry_2->unknown_0x40 = 0x00000000; + + if (part_info->PartitionStyle == PARTITION_STYLE_MBR) { + new_entry_2->partition.mbr.part_start_offset = part_info->StartingOffset.QuadPart; + new_entry_2->partition.mbr.padding = 0; + new_entry_2->partition_table_type = WIMOVERLAY_PARTITION_TYPE_MBR; + new_entry_2->disk.mbr.disk_id = disk_info->Mbr.Signature; + new_entry_2->disk.mbr.padding[0] = 0x00000000; + new_entry_2->disk.mbr.padding[1] = 0x00000000; + new_entry_2->disk.mbr.padding[2] = 0x00000000; + } else { + STATIC_ASSERT(sizeof(new_entry_2->partition.gpt.part_unique_guid) == + sizeof(part_info->Gpt.PartitionId)); + memcpy(new_entry_2->partition.gpt.part_unique_guid, + &part_info->Gpt.PartitionId, + sizeof(part_info->Gpt.PartitionId)); + new_entry_2->partition_table_type = WIMOVERLAY_PARTITION_TYPE_GPT; + + STATIC_ASSERT(sizeof(new_entry_2->disk.gpt.disk_guid) == + sizeof(disk_info->Gpt.DiskId)); + memcpy(new_entry_2->disk.gpt.disk_guid, + &disk_info->Gpt.DiskId, + sizeof(disk_info->Gpt.DiskId)); + + STATIC_ASSERT(sizeof(new_entry_2->disk.gpt.disk_guid) == + sizeof(new_entry_2->partition.gpt.part_unique_guid)); + } + new_entry_2->unknown_0x58[0] = 0x00000000; + new_entry_2->unknown_0x58[1] = 0x00000000; + new_entry_2->unknown_0x58[2] = 0x00000000; + new_entry_2->unknown_0x58[3] = 0x00000000; + + wimlib_assert(wim_path[2] == L'\\'); + return mempcpy(new_entry_2->wim_file_name, + wim_path + 2, + new_entry_2_size - sizeof(struct WimOverlay_dat_entry_2)); +} + +/* + * Prepares the new contents of WimOverlay.dat in memory, with one entry added. + * + * @old_hdr + * Old contents of WimOverlay.dat, or NULL if it did not exist. + * @wim_path + * Absolute path to the WIM file. It must begin with a drive letter; for + * example, D:\install.wim. + * @wim_guid + * GUID of the WIM, from the WIM header. + * @image + * Number of the image in the WIM to specify in the new entry. + * @new_contents_ret + * Location into which to return the new contents as a malloc()ed buffer on + * success. + * @new_contents_size_ret + * Location into which to return the size, in bytes, of the new contents on + * success. + * @new_data_source_id_ret + * Location into which to return the data source ID of the new entry on + * success. + * + * Returns 0 on success, or a positive error code on failure. + */ +static int +prepare_wimoverlay_dat(const struct WimOverlay_dat_header *old_hdr, + const wchar_t *wim_path, + const u8 wim_guid[GUID_SIZE], + int image, + void **new_contents_ret, + u32 *new_contents_size_ret, + u64 *new_data_source_id_ret) +{ + int ret; + PARTITION_INFORMATION_EX part_info; + DRIVE_LAYOUT_INFORMATION_EX disk_info; + u64 new_data_source_id; + u32 new_entry_2_size; + u32 new_contents_size; + u8 *buf; + u8 *end; + + ret = query_partition_and_disk_info(wim_path, &part_info, &disk_info); + if (ret) + return ret; + + new_data_source_id = old_hdr ? old_hdr->next_data_source_id : 0; + + new_entry_2_size = sizeof(struct WimOverlay_dat_entry_2) + + ((wcslen(wim_path) - 2 + 1) * sizeof(wchar_t)); + ret = calculate_wimoverlay_dat_size(old_hdr, new_entry_2_size, + &new_contents_size); + if (ret) + return ret; + + buf = MALLOC(new_contents_size); + if (!buf) + return WIMLIB_ERR_NOMEM; + + end = fill_in_wimoverlay_dat(buf, old_hdr, wim_path, wim_guid, image, + new_data_source_id, + &part_info, &disk_info, new_entry_2_size); + + wimlib_assert(end - buf == new_contents_size); + + *new_contents_ret = buf; + *new_contents_size_ret = new_contents_size; + *new_data_source_id_ret = new_data_source_id; + return 0; +} + +static bool +valid_wim_filename(const struct WimOverlay_dat_entry_2 *entry, size_t name_len) +{ + size_t i; + + if (name_len % sizeof(wchar_t)) + return false; + name_len /= sizeof(wchar_t); + if (name_len < 2) + return false; + for (i = 0; i < name_len && entry->wim_file_name[i] != 0; i++) + ; + return i == name_len - 1; +} + +/* + * Reads and validates a WimOverlay.dat file. + * + * @path + * Path to the WimOverlay.dat file, such as + * C:\System Volume Information\WimOverlay.dat + * @contents_ret + * Location into which to return the contents as a malloc()ed buffer on + * success. This can be cast to 'struct WimOverlay_dat_header', and its + * contents are guaranteed to be valid. Alternatively, if the file does + * not exist, NULL will be returned here. + * + * Returns 0 on success, or a positive error code on failure. + */ +static int +read_wimoverlay_dat(const wchar_t *path, void **contents_ret) +{ + HANDLE h; + BY_HANDLE_FILE_INFORMATION info; + int ret; + void *contents; + const struct WimOverlay_dat_header *hdr; + DWORD bytes_read; + bool already_retried = false; + +retry: + h = open_file(path, GENERIC_READ); + if (h == INVALID_HANDLE_VALUE) { + DWORD err = GetLastError(); + if (err == ERROR_FILE_NOT_FOUND) { + *contents_ret = NULL; + return 0; + } + if (err == ERROR_PATH_NOT_FOUND && + func_RtlCreateSystemVolumeInformationFolder) + { + wchar_t volume_root_path[] = L"\\??\\X:\\"; + + *(wcschr(volume_root_path, L'X')) = path[0]; + + UNICODE_STRING str = { + .Length = sizeof(volume_root_path) - sizeof(wchar_t), + .MaximumLength = sizeof(volume_root_path), + .Buffer = volume_root_path, + }; + NTSTATUS status; + DWORD err2; + + status = (*func_RtlCreateSystemVolumeInformationFolder)(&str); + + err2 = RtlNtStatusToDosError(status); + if (err2 == ERROR_SUCCESS) { + if (!already_retried) { + already_retried = true; + goto retry; + } + } else { + err = err2; + } + } + win32_error(err, L"\"%ls\": Can't open for reading", path); + return WIMLIB_ERR_OPEN; + } + if (!GetFileInformationByHandle(h, &info)) { + win32_error(GetLastError(), L"\"%ls\": Can't query metadata", path); + CloseHandle(h); + return WIMLIB_ERR_STAT; + } + + contents = NULL; + if (!info.nFileSizeHigh) + contents = MALLOC(info.nFileSizeLow); + if (!contents) { + ERROR("\"%ls\": File is too large to fit into memory", path); + CloseHandle(h); + return WIMLIB_ERR_NOMEM; + } + + SetLastError(0); + if (!ReadFile(h, contents, info.nFileSizeLow, &bytes_read, NULL) || + bytes_read != info.nFileSizeLow) + { + win32_error(GetLastError(), L"\"%ls\": Can't read data", path); + CloseHandle(h); + ret = WIMLIB_ERR_READ; + goto out_free_contents; + } + + CloseHandle(h); + + if (info.nFileSizeLow < sizeof(struct WimOverlay_dat_header)) { + ERROR("\"%ls\": File is unexpectedly small (only %"PRIu32" bytes)", + path, (u32)info.nFileSizeLow); + ret = WIMLIB_ERR_UNSUPPORTED; + goto out_free_contents; + } + + hdr = (const struct WimOverlay_dat_header *)contents; + + if (hdr->magic != WIMOVERLAY_DAT_MAGIC || + hdr->wim_provider_version != WIM_PROVIDER_CURRENT_VERSION || + hdr->unknown_0x08 != 0x00000028) + { + ERROR("\"%ls\": Header contains unexpected data:", path); + if (wimlib_print_errors) { + print_byte_field((const u8 *)hdr, + sizeof(struct WimOverlay_dat_header), + wimlib_error_file); + fputc('\n', wimlib_error_file); + } + ret = WIMLIB_ERR_UNSUPPORTED; + goto out_free_contents; + } + + if ((u64)hdr->num_entries * sizeof(struct WimOverlay_dat_entry_1) > + info.nFileSizeLow - sizeof(struct WimOverlay_dat_header)) + { + ERROR("\"%ls\": File is unexpectedly small " + "(only %"PRIu32" bytes, but has %"PRIu32" entries)", + path, (u32)info.nFileSizeLow, hdr->num_entries); + ret = WIMLIB_ERR_UNSUPPORTED; + goto out_free_contents; + } + + for (u32 i = 0; i < hdr->num_entries; i++) { + const struct WimOverlay_dat_entry_1 *entry_1; + const struct WimOverlay_dat_entry_2 *entry_2; + u32 wim_file_name_length; + + entry_1 = &hdr->entry_1s[i]; + + if (entry_1->data_source_id >= hdr->next_data_source_id) { + ERROR("\"%ls\": value of next_data_source_id " + "(0x%016"PRIx64") is unexpected, since entry " + "%"PRIu32" has data source ID 0x%016"PRIx64, + path, hdr->next_data_source_id, + i, entry_1->data_source_id); + ret = WIMLIB_ERR_UNSUPPORTED; + goto out_free_contents; + } + + if (((u64)entry_1->entry_2_offset + + (u64)entry_1->entry_2_length) > + info.nFileSizeLow) + { + ERROR("\"%ls\": entry %"PRIu32" (2) " + "(data source ID 0x%016"PRIx64") " + "overflows file", + path, i, entry_1->data_source_id); + ret = WIMLIB_ERR_UNSUPPORTED; + goto out_free_contents; + } + if (entry_1->entry_2_length < sizeof(struct WimOverlay_dat_entry_2)) { + ERROR("\"%ls\": entry %"PRIu32" (2) " + "(data source ID 0x%016"PRIx64") " + "is too short", + path, i, entry_1->data_source_id); + ret = WIMLIB_ERR_UNSUPPORTED; + goto out_free_contents; + } + + if (entry_1->entry_2_offset % 2 != 0) { + ERROR("\"%ls\": entry %"PRIu32" (2) " + "(data source ID 0x%016"PRIx64") " + "is misaligned", + path, i, entry_1->data_source_id); + ret = WIMLIB_ERR_UNSUPPORTED; + goto out_free_contents; + } + + entry_2 = (const struct WimOverlay_dat_entry_2 *) + ((const u8 *)hdr + entry_1->entry_2_offset); + + wim_file_name_length = entry_1->entry_2_length - + sizeof(struct WimOverlay_dat_entry_2); + if (!valid_wim_filename(entry_2, wim_file_name_length)) { + ERROR("\"%ls\": entry %"PRIu32" (2) " + "(data source ID 0x%016"PRIx64") " + "has invalid WIM file name", + path, i, entry_1->data_source_id); + if (wimlib_print_errors) { + print_byte_field((const u8 *)entry_2->wim_file_name, + wim_file_name_length, + wimlib_error_file); + fputc('\n', wimlib_error_file); + } + ret = WIMLIB_ERR_UNSUPPORTED; + goto out_free_contents; + } + + if (entry_2->unknown_0x00 != 0x00000000 || + entry_2->unknown_0x04 != 0x00000000 || + entry_2->unknown_0x0C != 0x00000000 || + entry_2->entry_2_length != entry_1->entry_2_length || + entry_2->unknown_0x10 != 0x00000005 || + entry_2->unknown_0x14 != 0x00000001 || + entry_2->inner_struct_size != entry_1->entry_2_length - 0x14 || + entry_2->unknown_0x1C != 0x00000005 || + entry_2->unknown_0x20 != 0x00000006 || + entry_2->unknown_0x24 != 0x00000000 || + entry_2->unknown_0x28 != 0x00000048 || + entry_2->unknown_0x2C != 0x00000000 || + entry_2->unknown_0x40 != 0x00000000 || + (entry_2->partition_table_type != WIMOVERLAY_PARTITION_TYPE_GPT && + entry_2->partition_table_type != WIMOVERLAY_PARTITION_TYPE_MBR) || + (entry_2->partition_table_type == WIMOVERLAY_PARTITION_TYPE_MBR && + entry_2->partition.mbr.padding != 0) || + (entry_2->partition_table_type == WIMOVERLAY_PARTITION_TYPE_GPT && + entry_2->partition.mbr.padding == 0) || + entry_2->unknown_0x58[0] != 0x00000000 || + entry_2->unknown_0x58[1] != 0x00000000 || + entry_2->unknown_0x58[2] != 0x00000000 || + entry_2->unknown_0x58[3] != 0x00000000) + { + ERROR("\"%ls\": entry %"PRIu32" (2) " + "(data source ID 0x%016"PRIx64") " + "contains unexpected data!", + path, i, entry_1->data_source_id); + if (wimlib_print_errors) { + print_byte_field((const u8 *)entry_2, + entry_1->entry_2_length, + wimlib_error_file); + fputc('\n', wimlib_error_file); + } + ret = WIMLIB_ERR_UNSUPPORTED; + goto out_free_contents; + } + } + + *contents_ret = contents; + return 0; + +out_free_contents: + FREE(contents); + return ret; +} + +/* + * Update WimOverlay.dat manually in order to add a WIM data source to the + * target volume. + * + * THIS CODE IS EXPERIMENTAL AS I HAD TO REVERSE ENGINEER THE FILE FORMAT! + * + * @path + * Target drive. Must be a letter followed by a colon (e.g. D:). + * @wim_path + * Absolute path to the WIM file. It must begin with a drive letter; for + * example, D:\install.wim. + * @wim_guid + * GUID of the WIM, from the WIM header. + * @image + * Number of the image in the WIM to specify in the new entry. + * @data_source_id_ret + * On success, the allocated data source ID is returned here. + */ +static int +update_wimoverlay_manually(const wchar_t *drive, const wchar_t *wim_path, + const u8 wim_guid[GUID_SIZE], + int image, u64 *data_source_id_ret) +{ + wchar_t path_main[] = L"A:\\System Volume Information\\WimOverlay.dat"; + wchar_t path_backup[] = L"A:\\System Volume Information\\WimOverlay.backup"; + wchar_t path_wimlib_backup[] = L"A:\\System Volume Information\\WimOverlay.wimlib_backup"; + wchar_t path_new[] = L"A:\\System Volume Information\\WimOverlay.wimlib_new"; + void *old_contents = NULL; + void *new_contents = NULL; + u32 new_contents_size = 0; + u64 new_data_source_id = -1; + int ret; + + wimlib_assert(drive[0] != L'\0' && + drive[1] == L':' && + drive[2] == L'\0'); + + path_main[0] = drive[0]; + path_backup[0] = drive[0]; + path_wimlib_backup[0] = drive[0]; + path_new[0] = drive[0]; + + ret = read_wimoverlay_dat(path_main, &old_contents); + if (ret) + goto out; + + ret = prepare_wimoverlay_dat(old_contents, wim_path, wim_guid, image, + &new_contents, &new_contents_size, + &new_data_source_id); + FREE(old_contents); + if (ret) + goto out; + + /* Write WimOverlay.wimlib_new */ + ret = write_wimoverlay_dat(path_new, + new_contents, new_contents_size); + if (ret) + goto out_free_new_contents; + + /* Write WimOverlay.backup */ + ret = write_wimoverlay_dat(path_backup, + new_contents, new_contents_size); + if (ret) + goto out_free_new_contents; + + if (old_contents) { + /* Rename WimOverlay.dat => WimOverlay.wimlib_backup */ + ret = win32_rename_replacement(path_main, path_wimlib_backup); + if (ret) { + ERROR_WITH_ERRNO("Can't rename \"%ls\" => \"%ls\"", + path_main, path_wimlib_backup); + ret = WIMLIB_ERR_RENAME; + goto out_free_new_contents; + } + } + + /* Rename WimOverlay.wimlib_new => WimOverlay.dat */ + ret = win32_rename_replacement(path_new, path_main); + if (ret) { + ERROR_WITH_ERRNO("Can't rename \"%ls\" => \"%ls\"", + path_new, path_main); + ret = WIMLIB_ERR_RENAME; + } +out_free_new_contents: + FREE(new_contents); +out: + if (ret == WIMLIB_ERR_UNSUPPORTED) { + ERROR("Please report to developer ("PACKAGE_BUGREPORT").\n" + " If possible send the file \"%ls\".\n\n", path_main); + } + if (ret == 0) + *data_source_id_ret = new_data_source_id; + return ret; +} + +/* + * Allocate a WOF data source ID for a WIM file. + * + * @wim_path + * Absolute path to the WIM file. This must include a drive letter and use + * backslash path separators. + * @wim_guid + * GUID of the WIM, from the WIM header. + * @image + * Number of the image in the WIM being applied. + * @target + * Path to the target directory. + * @data_source_id_ret + * On success, an identifier for the backing WIM file will be returned + * here. + * + * Returns 0 on success, or a positive error code on failure. + */ +int +wimboot_alloc_data_source_id(const wchar_t *wim_path, + const u8 wim_guid[GUID_SIZE], + int image, const wchar_t *target, + u64 *data_source_id_ret, bool *wof_running_ret) +{ + tchar drive_path[7]; + size_t wim_path_nchars; + size_t wim_file_name_length; + void *in; + size_t insize; + WOF_EXTERNAL_INFO *wof_info; + WIM_PROVIDER_ADD_OVERLAY_INPUT *wim_info; + wchar_t *WimFileName; + HANDLE h; + u64 data_source_id; + DWORD bytes_returned; + int ret; + const wchar_t *prefix = L"\\??\\"; + const size_t prefix_nchars = 4; + bool tried_to_attach_wof = false; + + ret = win32_get_drive_path(target, drive_path); + if (ret) + return ret; + + wimlib_assert(!wcschr(wim_path, L'/')); + wimlib_assert(wim_path[0] != L'\0' && wim_path[1] == L':'); + + wim_path_nchars = wcslen(wim_path); + wim_file_name_length = sizeof(wchar_t) * + (wim_path_nchars + prefix_nchars); + + insize = sizeof(*wof_info) + sizeof(*wim_info) + wim_file_name_length; + in = CALLOC(1, insize); + if (!in) { + ret = WIMLIB_ERR_NOMEM; + goto out; + } + + wof_info = (WOF_EXTERNAL_INFO *)in; + wof_info->Version = WOF_CURRENT_VERSION; + wof_info->Provider = WOF_PROVIDER_WIM; + + wim_info = (WIM_PROVIDER_ADD_OVERLAY_INPUT *)(wof_info + 1); + wim_info->WimType = WIM_BOOT_NOT_OS_WIM; + wim_info->WimIndex = image; + wim_info->WimFileNameOffset = sizeof(*wim_info); + wim_info->WimFileNameLength = wim_file_name_length; + WimFileName = (wchar_t *)(wim_info + 1); + wmemcpy(WimFileName, prefix, prefix_nchars); + wmemcpy(&WimFileName[prefix_nchars], wim_path, wim_path_nchars); + +retry_ioctl: + h = open_file(drive_path, GENERIC_WRITE); + + if (h == INVALID_HANDLE_VALUE) { + win32_error(GetLastError(), + L"Failed to open \"%ls\"", drive_path + 4); + ret = WIMLIB_ERR_OPEN; + goto out_free_in; + } + + if (!DeviceIoControl(h, FSCTL_ADD_OVERLAY, + in, insize, + &data_source_id, sizeof(data_source_id), + &bytes_returned, NULL)) + { + DWORD err = GetLastError(); + if (err == ERROR_INVALID_FUNCTION) { + if (!tried_to_attach_wof) { + CloseHandle(h); + h = INVALID_HANDLE_VALUE; + tried_to_attach_wof = true; + if (win32_try_to_attach_wof(drive_path + 4)) + goto retry_ioctl; + } + ret = WIMLIB_ERR_UNSUPPORTED; + goto out_close_handle; + } else { + win32_error(err, L"Failed to add overlay source \"%ls\" " + "to volume \"%ls\"", wim_path, drive_path + 4); + ret = WIMLIB_ERR_WIMBOOT; + goto out_close_handle; + } + } + + if (bytes_returned != sizeof(data_source_id)) { + ret = WIMLIB_ERR_WIMBOOT; + ERROR("Unexpected result size when adding " + "overlay source \"%ls\" to volume \"%ls\"", + wim_path, drive_path + 4); + goto out_close_handle; + } + + *wof_running_ret = true; + *data_source_id_ret = data_source_id; + ret = 0; + +out_close_handle: + CloseHandle(h); +out_free_in: + FREE(in); +out: + if (ret == WIMLIB_ERR_UNSUPPORTED) { + WARNING("WOF driver is not available; updating WimOverlay.dat directly."); + ret = update_wimoverlay_manually(drive_path + 4, wim_path, + wim_guid, image, + data_source_id_ret); + *wof_running_ret = false; + } + return ret; +} + + +/* + * Set WIMBoot information on the specified file. + * + * This turns it into a reparse point that redirects accesses to it, to the + * corresponding resource in the WIM archive. + * + * @h + * Open handle to the file, with GENERIC_WRITE access. + * @blob + * The blob for the unnamed data stream of the file. + * @data_source_id + * Allocated identifier for the WIM data source on the destination volume. + * @blob_table_hash + * SHA-1 message digest of the WIM's blob table. + * @wof_running + * %true if the WOF driver appears to be available and working; %false if + * not. + * + * Returns %true on success, or %false on failure with GetLastError() set. + */ +bool +wimboot_set_pointer(HANDLE h, + const struct blob_descriptor *blob, + u64 data_source_id, + const u8 blob_table_hash[SHA1_HASH_SIZE], + bool wof_running) +{ + DWORD bytes_returned; + + if (wof_running) { + /* The WOF driver is running. We can create the reparse point + * using FSCTL_SET_EXTERNAL_BACKING. */ + unsigned int max_retries = 4; + struct { + WOF_EXTERNAL_INFO wof_info; + WIM_PROVIDER_EXTERNAL_INFO wim_info; + } in; + + retry: + memset(&in, 0, sizeof(in)); + + in.wof_info.Version = WOF_CURRENT_VERSION; + in.wof_info.Provider = WOF_PROVIDER_WIM; + + in.wim_info.Version = WIM_PROVIDER_CURRENT_VERSION; + in.wim_info.Flags = 0; + in.wim_info.DataSourceId.QuadPart = data_source_id; + copy_hash(in.wim_info.ResourceHash, blob->hash); + + /* blob_table_hash is not necessary */ + + if (!DeviceIoControl(h, FSCTL_SET_EXTERNAL_BACKING, + &in, sizeof(in), NULL, 0, + &bytes_returned, NULL)) + { + /* Try to track down sporadic errors */ + if (wimlib_print_errors) { + WARNING("FSCTL_SET_EXTERNAL_BACKING failed (err=%u); data was %zu bytes:", + (u32)GetLastError(), sizeof(in)); + print_byte_field((const u8 *)&in, sizeof(in), wimlib_error_file); + putc('\n', wimlib_error_file); + } + if (--max_retries) { + WARNING("Retrying after 100ms..."); + Sleep(100); + goto retry; + } + WARNING("Too many retries; returning failure"); + return false; + } + } else { + + /* The WOF driver is running. We need to create the reparse + * point manually. */ + + struct { + struct { + le32 rptag; + le16 rpdatalen; + le16 rpreserved; + } hdr; + WOF_EXTERNAL_INFO wof_info; + struct wim_provider_rpdata wim_info; + } in; + + STATIC_ASSERT(sizeof(in) == 8 + + sizeof(WOF_EXTERNAL_INFO) + + sizeof(struct wim_provider_rpdata)); + + in.hdr.rptag = WIM_IO_REPARSE_TAG_WOF; + in.hdr.rpdatalen = sizeof(in) - sizeof(in.hdr); + in.hdr.rpreserved = 0; + + in.wof_info.Version = WOF_CURRENT_VERSION; + in.wof_info.Provider = WOF_PROVIDER_WIM; + + in.wim_info.version = 2; + in.wim_info.flags = 0; + in.wim_info.data_source_id = data_source_id; + copy_hash(in.wim_info.unnamed_data_stream_hash, blob->hash); + copy_hash(in.wim_info.blob_table_hash, blob_table_hash); + in.wim_info.unnamed_data_stream_size = blob->size; + in.wim_info.unnamed_data_stream_size_in_wim = blob->rdesc->size_in_wim; + in.wim_info.unnamed_data_stream_offset_in_wim = blob->rdesc->offset_in_wim; + + if (!DeviceIoControl(h, FSCTL_SET_REPARSE_POINT, + &in, sizeof(in), NULL, 0, &bytes_returned, NULL)) + return false; + + /* We also need to create an unnamed data stream of the correct + * size. Otherwise the file shows up as zero length. It can be + * a sparse stream containing all zeroes; its contents + * are unimportant. */ + if (!DeviceIoControl(h, FSCTL_SET_SPARSE, NULL, 0, NULL, 0, + &bytes_returned, NULL)) + return false; + + if (!SetFilePointerEx(h, + (LARGE_INTEGER){ .QuadPart = blob->size}, + NULL, FILE_BEGIN)) + return false; + + if (!SetEndOfFile(h)) + return false; + } + + return true; +} + +#endif /* _WIN32 */ diff --git a/src/wimlib/wimlib.h b/src/wimlib/wimlib.h new file mode 100644 index 00000000..84f1e2ec --- /dev/null +++ b/src/wimlib/wimlib.h @@ -0,0 +1,4912 @@ +/** + * @file wimlib.h + * @brief External header for wimlib. + * + * This file contains comments for generating documentation with Doxygen. The + * built HTML documentation can be viewed at https://wimlib.net/apidoc. Make + * sure to see the <a href="modules.html">Modules page</a> to make more sense of + * the declarations in this header. + */ + +/** + * @mainpage + * + * This is the documentation for the library interface of wimlib 1.14.4, a C + * library for creating, modifying, extracting, and mounting files in the + * Windows Imaging (WIM) format. This documentation is intended for developers + * only. If you have installed wimlib and want to know how to use the @b + * wimlib-imagex program, please see the manual pages and also the <a + * href="https://wimlib.net/git/?p=wimlib;a=blob;f=README.md">README file</a>. + * + * @section sec_installing Installing + * + * @subsection UNIX + * + * Download the source code from https://wimlib.net. Install the library by + * running <c>configure && make && sudo make install</c>. See the README for + * information about configuration options. To use wimlib in your program after + * installing it, include wimlib.h and link your program with <c>-lwim</c>. + * + * @subsection Windows + * + * Download the Windows binary distribution with the appropriate architecture + * from https://wimlib.net. Link your program with libwim-15.dll. If needed by + * your programming language or development environment, the import library + * libwim.lib and C/C++ header wimlib.h can be found in the directory "devel" in + * the ZIP file. + * + * If you need to access the DLL from non-C/C++ programming languages, note that + * the calling convention is "cdecl". + * + * If you want to build wimlib from source on Windows, see README.WINDOWS. This + * is only needed if you are making modifications to wimlib. + * + * @section sec_examples Examples + * + * Several examples are located in the "examples" directory of the source + * distribution. Also see @ref sec_basic_wim_handling_concepts below. + * + * There is also the <a + * href="https://wimlib.net/git/?p=wimlib;a=blob;f=programs/imagex.c"> + * source code of <b>wimlib-imagex</b></a>, which is complicated but uses most + * capabilities of wimlib. + * + * @section backward_compatibility Backward Compatibility + * + * New releases of wimlib are intended to be backward compatible with old + * releases, except when the libtool "age" is reset. This most recently + * occurred for the v1.7.0 (libwim15) release (June 2014). Since the library is + * becoming increasingly stable, the goal is to maintain the current API/ABI for + * as long as possible unless there is a strong reason not to. + * + * As with any other library, applications should not rely on internal + * implementation details that may be subject to change. + * + * @section sec_basic_wim_handling_concepts Basic WIM handling concepts + * + * wimlib wraps up a WIM file in an opaque ::WIMStruct structure. There are + * two ways to create such a structure: + * + * 1. wimlib_open_wim() opens an on-disk WIM file and creates a ::WIMStruct for + * it. + * 2. wimlib_create_new_wim() creates a new ::WIMStruct that initially contains + * no images and does not yet have a backing on-disk file. + * + * A ::WIMStruct contains zero or more independent directory trees called @a + * images. Images may be extracted, added, deleted, exported, and updated using + * various API functions. (See @ref G_extracting_wims and @ref G_modifying_wims + * for more details.) + * + * Changes made to a WIM represented by a ::WIMStruct have no persistent effect + * until the WIM is actually written to an on-disk file. This can be done using + * wimlib_write(), but if the WIM was originally opened using wimlib_open_wim(), + * then wimlib_overwrite() can be used instead. (See @ref + * G_writing_and_overwriting_wims for more details.) + * + * wimlib's API is designed to let you combine functions to accomplish tasks in + * a flexible way. Here are some example sequences of function calls: + * + * Apply an image from a WIM file, similar to the command-line program + * <b>wimapply</b>: + * + * 1. wimlib_open_wim() + * 2. wimlib_extract_image() + * + * Capture an image into a new WIM file, similar to <b>wimcapture</b>: + * + * 1. wimlib_create_new_wim() + * 2. wimlib_add_image() + * 3. wimlib_write() + * + * Append an image to an existing WIM file, similar to <b>wimappend</b>: + * + * 1. wimlib_open_wim() + * 2. wimlib_add_image() + * 3. wimlib_overwrite() + * + * Delete an image from an existing WIM file, similar to <b>wimdelete</b>: + * + * 1. wimlib_open_wim() + * 2. wimlib_delete_image() + * 3. wimlib_overwrite() + * + * Export an image from one WIM file to another, similar to <b>wimexport</b>: + * + * 1. wimlib_open_wim() (on source) + * 2. wimlib_open_wim() (on destination) + * 3. wimlib_export_image() + * 4. wimlib_overwrite() (on destination) + * + * The API also lets you do things the command-line tools don't directly allow. + * For example, you could make multiple changes to a WIM before efficiently + * committing the changes with just one call to wimlib_overwrite(). Perhaps you + * want to both delete an image and add a new one; or perhaps you want to + * customize an image with wimlib_update_image() after adding it. All these use + * cases are supported by the API. + * + * @section sec_cleaning_up Cleaning up + * + * After you are done with any ::WIMStruct, you can call wimlib_free() to free + * all resources associated with it. Also, when you are completely done with + * using wimlib in your program, you can call wimlib_global_cleanup() to free + * any other resources allocated by the library. + * + * @section sec_error_handling Error Handling + * + * Most functions in wimlib return 0 on success and a positive + * ::wimlib_error_code value on failure. Use wimlib_get_error_string() to get a + * string that describes an error code. wimlib also can print error messages to + * standard error or a custom file when an error occurs, and these may be more + * informative than the error code; to enable this, call + * wimlib_set_print_errors(). Please note that this is for convenience only, + * and some errors can occur without a message being printed. Currently, error + * messages and strings (as well as all documentation, for that matter) are only + * available in English. + * + * @section sec_encodings Character encoding + * + * To support Windows as well as UNIX-like systems, wimlib's API typically takes + * and returns strings of ::wimlib_tchar which have a platform-dependent type + * and encoding. + * + * On Windows, each ::wimlib_tchar is a 2-byte <tt>wchar_t</tt>. The encoding + * is meant to be UTF-16LE. However, unpaired surrogates are permitted because + * neither Windows nor the NTFS filesystem forbids them in filenames. + * + * On UNIX-like systems, each ::wimlib_tchar is a 1 byte <tt>char</tt>. The + * encoding is meant to be UTF-8. However, for compatibility with Windows-style + * filenames that are not valid UTF-16LE, surrogate codepoints are permitted. + * Other multibyte encodings (e.g. ISO-8859-1) or garbage sequences of bytes are + * not permitted. + * + * @section sec_advanced Additional information and features + * + * + * @subsection subsec_mounting_wim_images Mounting WIM images + * + * See @ref G_mounting_wim_images. + * + * @subsection subsec_progress_functions Progress Messages + * + * See @ref G_progress. + * + * @subsection subsec_non_standalone_wims Non-standalone WIMs + * + * See @ref G_nonstandalone_wims. + * + * @subsection subsec_pipable_wims Pipable WIMs + * + * wimlib supports a special "pipable" WIM format which unfortunately is @b not + * compatible with Microsoft's software. To create a pipable WIM, call + * wimlib_write(), wimlib_write_to_fd(), or wimlib_overwrite() with + * ::WIMLIB_WRITE_FLAG_PIPABLE specified. Pipable WIMs are pipable in both + * directions, so wimlib_write_to_fd() can be used to write a pipable WIM to a + * pipe, and wimlib_extract_image_from_pipe() can be used to apply an image from + * a pipable WIM. wimlib can also transparently open and operate on pipable WIM + * s using a seekable file descriptor using the regular function calls (e.g. + * wimlib_open_wim(), wimlib_extract_image()). + * + * See the documentation for the <b>--pipable</b> flag of <b>wimcapture</b> for + * more information about pipable WIMs. + * + * @subsection subsec_thread_safety Thread Safety + * + * A ::WIMStruct is not thread-safe and cannot be accessed by multiple threads + * concurrently, even for "read-only" operations such as extraction. However, + * users are free to use <i>different</i> ::WIMStruct's from different threads + * concurrently. It is even allowed for multiple ::WIMStruct's to be backed by + * the same on-disk WIM file, although "overwrites" should never be done in such + * a scenario. + * + * In addition, several functions change global state and should only be called + * when a single thread is active in the library. These functions are: + * + * - wimlib_global_init() + * - wimlib_global_cleanup() + * - wimlib_set_memory_allocator() + * - wimlib_set_print_errors() + * - wimlib_set_error_file() + * - wimlib_set_error_file_by_name() + * + * @subsection subsec_limitations Limitations + * + * This section documents some technical limitations of wimlib not already + * described in the documentation for @b wimlib-imagex. + * + * - The old WIM format from Vista pre-releases is not supported. + * - wimlib does not provide a clone of the @b PEImg tool, or the @b DISM + * functionality other than that already present in @b ImageX, that allows you + * to make certain Windows-specific modifications to a Windows PE image, such + * as adding a driver or Windows component. Such a tool could be implemented + * on top of wimlib. + * + * @subsection more_info More information + * + * You are advised to read the README as well as the documentation for + * <b>wimlib-imagex</b>, since not all relevant information is repeated here in + * the API documentation. + */ + +/** @defgroup G_general General + * + * @brief Declarations and structures shared across the library. + */ + +/** @defgroup G_creating_and_opening_wims Creating and Opening WIMs + * + * @brief Open an existing WIM file as a ::WIMStruct, or create a new + * ::WIMStruct which can be used to create a new WIM file. + */ + +/** @defgroup G_wim_information Retrieving WIM information and directory listings + * + * @brief Retrieve information about a WIM or WIM image. + */ + +/** @defgroup G_modifying_wims Modifying WIMs + * + * @brief Make changes to a ::WIMStruct, in preparation of persisting the + * ::WIMStruct to an on-disk file. + * + * @section sec_adding_images Capturing and adding WIM images + * + * As described in @ref sec_basic_wim_handling_concepts, capturing a new WIM or + * appending an image to an existing WIM is a multi-step process, but at its + * core is wimlib_add_image() or an equivalent function. Normally, + * wimlib_add_image() takes an on-disk directory tree and logically adds it to a + * ::WIMStruct as a new image. However, when supported by the build of the + * library, there is also a special NTFS volume capture mode (entered when + * ::WIMLIB_ADD_FLAG_NTFS is specified) that allows adding the image directly + * from an unmounted NTFS volume. + * + * Another function, wimlib_add_image_multisource() is also provided. It + * generalizes wimlib_add_image() to allow combining multiple files or directory + * trees into a single WIM image in a configurable way. + * + * For maximum customization of WIM image creation, it is also possible to add a + * completely empty WIM image with wimlib_add_empty_image(), then update it with + * wimlib_update_image(). (This is in fact what wimlib_add_image() and + * wimlib_add_image_multisource() do internally.) + * + * Note that some details of how image addition/capture works are documented + * more fully in the documentation for <b>wimcapture</b>. + * + * @section sec_deleting_images Deleting WIM images + * + * wimlib_delete_image() can delete an image from a ::WIMStruct. But as usual, + * wimlib_write() or wimlib_overwrite() must be called to cause the changes to + * be made persistent in an on-disk WIM file. + * + * @section sec_exporting_images Exporting WIM images + * + * wimlib_export_image() can copy, or "export", an image from one WIM to + * another. + * + * @section sec_other_modifications Other modifications + * + * wimlib_update_image() can add, delete, and rename files in a WIM image. + * + * wimlib_set_image_property() can change other image metadata. + * + * wimlib_set_wim_info() can change information about the WIM file itself, such + * as the boot index. + */ + +/** @defgroup G_extracting_wims Extracting WIMs + * + * @brief Extract files, directories, and images from a WIM. + * + * wimlib_extract_image() extracts, or "applies", an image from a WIM, + * represented by a ::WIMStruct. This normally extracts the image to a + * directory, but when supported by the build of the library there is also a + * special NTFS volume extraction mode (entered when ::WIMLIB_EXTRACT_FLAG_NTFS + * is specified) that allows extracting a WIM image directly to an unmounted + * NTFS volume. Various other flags allow further customization of image + * extraction. + * + * wimlib_extract_paths() and wimlib_extract_pathlist() allow extracting a list + * of (possibly wildcard) paths from a WIM image. + * + * wimlib_extract_image_from_pipe() extracts an image from a pipable WIM sent + * over a pipe; see @ref subsec_pipable_wims. + * + * Some details of how WIM extraction works are described more fully in the + * documentation for <b>wimapply</b> and <b>wimextract</b>. + */ + +/** @defgroup G_mounting_wim_images Mounting WIM images + * + * @brief Mount and unmount WIM images. + * + * On Linux, wimlib supports mounting images from WIM files either read-only or + * read-write. To mount an image, call wimlib_mount_image(). To unmount an + * image, call wimlib_unmount_image(). Mounting can be done without root + * privileges because it is implemented using FUSE (Filesystem in Userspace). + * + * If wimlib is compiled using the <c>--without-fuse</c> flag, these functions + * will be available but will fail with ::WIMLIB_ERR_UNSUPPORTED. + * + * Note: if mounting is unsupported, wimlib still provides another way to modify + * a WIM image (wimlib_update_image()). + */ + +/** + * @defgroup G_progress Progress Messages + * + * @brief Track the progress of long WIM operations. + * + * Library users can provide a progress function which will be called + * periodically during operations such as extracting a WIM image or writing a + * WIM image. A ::WIMStruct can have a progress function of type + * ::wimlib_progress_func_t associated with it by calling + * wimlib_register_progress_function() or by opening the ::WIMStruct using + * wimlib_open_wim_with_progress(). Once this is done, the progress function + * will be called automatically during many operations, such as + * wimlib_extract_image() and wimlib_write(). + * + * Some functions that do not operate directly on a user-provided ::WIMStruct, + * such as wimlib_join(), also take the progress function directly using an + * extended version of the function, such as wimlib_join_with_progress(). + * + * Since wimlib v1.7.0, progress functions are no longer just unidirectional. + * You can now return ::WIMLIB_PROGRESS_STATUS_ABORT to cause the current + * operation to be aborted. wimlib v1.7.0 also added the third argument to + * ::wimlib_progress_func_t, which is a user-supplied context. + */ + +/** @defgroup G_writing_and_overwriting_wims Writing and Overwriting WIMs + * + * @brief Create or update an on-disk WIM file. + * + * wimlib_write() creates a new on-disk WIM file, whereas wimlib_overwrite() + * updates an existing WIM file. See @ref sec_basic_wim_handling_concepts for + * more information about the API design. + */ + +/** @defgroup G_nonstandalone_wims Creating and handling non-standalone WIMs + * + * @brief Create and handle non-standalone WIMs, such as split and delta WIMs. + * + * A ::WIMStruct backed by an on-disk file normally represents a fully + * standalone WIM archive. However, WIM archives can also be arranged in + * non-standalone ways, such as a set of on-disk files that together form a + * single "split WIM" or "delta WIM". Such arrangements are fully supported by + * wimlib. However, as a result, in such cases a ::WIMStruct created from one + * of these on-disk files initially only partially represents the full WIM and + * needs to, in effect, be logically combined with other ::WIMStruct's before + * performing certain operations, such as extracting files with + * wimlib_extract_image() or wimlib_extract_paths(). This is done by calling + * wimlib_reference_resource_files() or wimlib_reference_resources(). Note: if + * you fail to do so, you may see the error code + * ::WIMLIB_ERR_RESOURCE_NOT_FOUND; this just indicates that data is not + * available because the appropriate WIM files have not yet been referenced. + * + * wimlib_write() can create delta WIMs as well as standalone WIMs, but a + * specialized function (wimlib_split()) is needed to create a split WIM. + */ + +#ifndef _WIMLIB_H +#define _WIMLIB_H + +#include <stdio.h> +#include <stddef.h> +#ifndef __cplusplus +# if defined(_MSC_VER) && _MSC_VER < 1800 /* VS pre-2013? */ + typedef unsigned char bool; +# else +# include <stdbool.h> +# endif +#endif +#include <stdint.h> +#include <time.h> + +#ifdef BUILDING_WIMLIB + /* + * On i386, gcc assumes that the stack is 16-byte aligned at function entry. + * However, some compilers (e.g. MSVC) and programming languages (e.g. Delphi) + * only guarantee 4-byte alignment when calling functions. This is mainly an + * issue on Windows, but it can occur on Linux too. Work around this ABI + * incompatibility by realigning the stack pointer when entering the library. + * This prevents crashes in SSE/AVX code. + */ +# if defined(__GNUC__) && defined(__i386__) +# define WIMLIB_ALIGN_STACK __attribute__((force_align_arg_pointer)) +# else +# define WIMLIB_ALIGN_STACK +# endif +# ifdef _WIN32 +# define WIMLIBAPI __declspec(dllexport) WIMLIB_ALIGN_STACK +# else +# define WIMLIBAPI __attribute__((visibility("default"))) WIMLIB_ALIGN_STACK +# endif +#else +# define WIMLIBAPI +#endif + +/** @addtogroup G_general + * @{ */ + +/** Major version of the library (for example, the 1 in 1.2.5). */ +#define WIMLIB_MAJOR_VERSION 1 + +/** Minor version of the library (for example, the 2 in 1.2.5). */ +#define WIMLIB_MINOR_VERSION 14 + +/** Patch version of the library (for example, the 5 in 1.2.5). */ +#define WIMLIB_PATCH_VERSION 4 + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * To represent file timestamps, wimlib's API originally used the POSIX 'struct + * timespec'. This was a mistake because when building wimlib for 32-bit + * Windows with MinGW we ended up originally using 32-bit time_t which isn't + * year 2038-safe, and therefore we had to later add fields like + * 'creation_time_high' to hold the high 32 bits of each timestamp. Moreover, + * old Visual Studio versions did not define struct timespec, while newer ones + * define it but with 64-bit tv_sec. So to at least avoid a missing or + * incompatible 'struct timespec' definition, define the correct struct + * ourselves when this header is included on Windows. + */ +#ifdef _WIN32 +struct wimlib_timespec { + /* Seconds since start of UNIX epoch (January 1, 1970) */ +#ifdef _WIN64 + int64_t tv_sec; +#else + int32_t tv_sec; +#endif + /* Nanoseconds (0-999999999) */ + int32_t tv_nsec; +}; +#else +# define wimlib_timespec timespec /* standard definition */ +#endif + +/** + * Opaque structure that represents a WIM, possibly backed by an on-disk file. + * See @ref sec_basic_wim_handling_concepts for more information. + */ +#ifndef WIMLIB_WIMSTRUCT_DECLARED +typedef struct WIMStruct WIMStruct; +#define WIMLIB_WIMSTRUCT_DECLARED +#endif + +#ifdef _WIN32 +typedef wchar_t wimlib_tchar; +#else +/** See @ref sec_encodings */ +typedef char wimlib_tchar; +#endif + +#ifdef _WIN32 +/** Path separator for WIM paths passed back to progress callbacks. + * This is forward slash on UNIX and backslash on Windows. */ +# define WIMLIB_WIM_PATH_SEPARATOR '\\' +# define WIMLIB_WIM_PATH_SEPARATOR_STRING L"\\" +#else +/** Path separator for WIM paths passed back to progress callbacks. + * This is forward slash on UNIX and backslash on Windows. */ +# define WIMLIB_WIM_PATH_SEPARATOR '/' +# define WIMLIB_WIM_PATH_SEPARATOR_STRING "/" +#endif + +/** A string containing a single path separator; use this to specify the root + * directory of a WIM image. */ +#define WIMLIB_WIM_ROOT_PATH WIMLIB_WIM_PATH_SEPARATOR_STRING + +/** Use this to test if the specified path refers to the root directory of the + * WIM image. */ +#define WIMLIB_IS_WIM_ROOT_PATH(path) \ + ((path)[0] == WIMLIB_WIM_PATH_SEPARATOR && \ + (path)[1] == 0) + +/** Length of a Globally Unique Identifier (GUID), in bytes. */ +#define WIMLIB_GUID_LEN 16 + +/** + * Specifies a compression type. + * + * A WIM file has a default compression type, indicated by its file header. + * Normally, each resource in the WIM file is compressed with this compression + * type. However, resources may be stored as uncompressed; for example, wimlib + * may do so if a resource does not compress to less than its original size. In + * addition, a WIM with the new version number of 3584, or "ESD file", might + * contain solid resources with different compression types. + */ +enum wimlib_compression_type { + /** + * No compression. + * + * This is a valid argument to wimlib_create_new_wim() and + * wimlib_set_output_compression_type(), but not to the functions in the + * compression API such as wimlib_create_compressor(). + */ + WIMLIB_COMPRESSION_TYPE_NONE = 0, + + /** + * The XPRESS compression format. This format combines Lempel-Ziv + * factorization with Huffman encoding. Compression and decompression + * are both fast. This format supports chunk sizes that are powers of 2 + * between <c>2^12</c> and <c>2^16</c>, inclusively. + * + * wimlib's XPRESS compressor will, with the default settings, usually + * produce a better compression ratio, and work more quickly, than the + * implementation in Microsoft's WIMGAPI (as of Windows 8.1). + * Non-default compression levels are also supported. For example, + * level 80 will enable two-pass optimal parsing, which is significantly + * slower but usually improves compression by several percent over the + * default level of 50. + * + * If using wimlib_create_compressor() to create an XPRESS compressor + * directly, the @p max_block_size parameter may be any positive value + * up to and including <c>2^16</c>. + */ + WIMLIB_COMPRESSION_TYPE_XPRESS = 1, + + /** + * The LZX compression format. This format combines Lempel-Ziv + * factorization with Huffman encoding, but with more features and + * complexity than XPRESS. Compression is slow to somewhat fast, + * depending on the settings. Decompression is fast but slower than + * XPRESS. This format supports chunk sizes that are powers of 2 + * between <c>2^15</c> and <c>2^21</c>, inclusively. Note: chunk sizes + * other than <c>2^15</c> are not compatible with the Microsoft + * implementation. + * + * wimlib's LZX compressor will, with the default settings, usually + * produce a better compression ratio, and work more quickly, than the + * implementation in Microsoft's WIMGAPI (as of Windows 8.1). + * Non-default compression levels are also supported. For example, + * level 20 will provide fast compression, almost as fast as XPRESS. + * + * If using wimlib_create_compressor() to create an LZX compressor + * directly, the @p max_block_size parameter may be any positive value + * up to and including <c>2^21</c>. + */ + WIMLIB_COMPRESSION_TYPE_LZX = 2, + + /** + * The LZMS compression format. This format combines Lempel-Ziv + * factorization with adaptive Huffman encoding and range coding. + * Compression and decompression are both fairly slow. This format + * supports chunk sizes that are powers of 2 between <c>2^15</c> and + * <c>2^30</c>, inclusively. This format is best used for large chunk + * sizes. Note: LZMS compression is only compatible with wimlib v1.6.0 + * and later, WIMGAPI Windows 8 and later, and DISM Windows 8.1 and + * later. Also, chunk sizes larger than <c>2^26</c> are not compatible + * with the Microsoft implementation. + * + * wimlib's LZMS compressor will, with the default settings, usually + * produce a better compression ratio, and work more quickly, than the + * implementation in Microsoft's WIMGAPI (as of Windows 8.1). There is + * limited support for non-default compression levels, but compression + * will be noticeably faster if you choose a level < 35. + * + * If using wimlib_create_compressor() to create an LZMS compressor + * directly, the @p max_block_size parameter may be any positive value + * up to and including <c>2^30</c>. + */ + WIMLIB_COMPRESSION_TYPE_LZMS = 3, +}; + +/** @} */ +/** @addtogroup G_progress + * @{ */ + +/** Possible values of the first parameter to the user-supplied + * ::wimlib_progress_func_t progress function */ +enum wimlib_progress_msg { + + /** A WIM image is about to be extracted. @p info will point to + * ::wimlib_progress_info.extract. This message is received once per + * image for calls to wimlib_extract_image() and + * wimlib_extract_image_from_pipe(). */ + WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN = 0, + + /** One or more file or directory trees within a WIM image is about to + * be extracted. @p info will point to ::wimlib_progress_info.extract. + * This message is received only once per wimlib_extract_paths() and + * wimlib_extract_pathlist(), since wimlib combines all paths into a + * single extraction operation for optimization purposes. */ + WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN = 1, + + /** This message may be sent periodically (not for every file) while + * files and directories are being created, prior to file data + * extraction. @p info will point to ::wimlib_progress_info.extract. + * In particular, the @p current_file_count and @p end_file_count + * members may be used to track the progress of this phase of + * extraction. */ + WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE = 3, + + /** File data is currently being extracted. @p info will point to + * ::wimlib_progress_info.extract. This is the main message to track + * the progress of an extraction operation. */ + WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS = 4, + + /** Starting to read a new part of a split pipable WIM over the pipe. + * @p info will point to ::wimlib_progress_info.extract. */ + WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN = 5, + + /** This message may be sent periodically (not necessarily for every + * file) while file and directory metadata is being extracted, following + * file data extraction. @p info will point to + * ::wimlib_progress_info.extract. The @p current_file_count and @p + * end_file_count members may be used to track the progress of this + * phase of extraction. */ + WIMLIB_PROGRESS_MSG_EXTRACT_METADATA = 6, + + /** The image has been successfully extracted. @p info will point to + * ::wimlib_progress_info.extract. This is paired with + * ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN. */ + WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_END = 7, + + /** The files or directory trees have been successfully extracted. @p + * info will point to ::wimlib_progress_info.extract. This is paired + * with ::WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN. */ + WIMLIB_PROGRESS_MSG_EXTRACT_TREE_END = 8, + + /** The directory or NTFS volume is about to be scanned for metadata. + * @p info will point to ::wimlib_progress_info.scan. This message is + * received once per call to wimlib_add_image(), or once per capture + * source passed to wimlib_add_image_multisource(), or once per add + * command passed to wimlib_update_image(). */ + WIMLIB_PROGRESS_MSG_SCAN_BEGIN = 9, + + /** A directory or file has been scanned. @p info will point to + * ::wimlib_progress_info.scan, and its @p cur_path member will be + * valid. This message is only sent if ::WIMLIB_ADD_FLAG_VERBOSE has + * been specified. */ + WIMLIB_PROGRESS_MSG_SCAN_DENTRY = 10, + + /** The directory or NTFS volume has been successfully scanned. @p info + * will point to ::wimlib_progress_info.scan. This is paired with a + * previous ::WIMLIB_PROGRESS_MSG_SCAN_BEGIN message, possibly with many + * intervening ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY messages. */ + WIMLIB_PROGRESS_MSG_SCAN_END = 11, + + /** File data is currently being written to the WIM. @p info will point + * to ::wimlib_progress_info.write_streams. This message may be + * received many times while the WIM file is being written or appended + * to with wimlib_write(), wimlib_overwrite(), or wimlib_write_to_fd(). + * Since wimlib v1.13.4 it will also be received when a split WIM part + * is being written by wimlib_split(). */ + WIMLIB_PROGRESS_MSG_WRITE_STREAMS = 12, + + /** Per-image metadata is about to be written to the WIM file. @p info + * will not be valid. */ + WIMLIB_PROGRESS_MSG_WRITE_METADATA_BEGIN = 13, + + /** The per-image metadata has been written to the WIM file. @p info + * will not be valid. This message is paired with a preceding + * ::WIMLIB_PROGRESS_MSG_WRITE_METADATA_BEGIN message. */ + WIMLIB_PROGRESS_MSG_WRITE_METADATA_END = 14, + + /** wimlib_overwrite() has successfully renamed the temporary file to + * the original WIM file, thereby committing the changes to the WIM + * file. @p info will point to ::wimlib_progress_info.rename. Note: + * this message is not received if wimlib_overwrite() chose to append to + * the WIM file in-place. */ + WIMLIB_PROGRESS_MSG_RENAME = 15, + + /** The contents of the WIM file are being checked against the integrity + * table. @p info will point to ::wimlib_progress_info.integrity. This + * message is only received (and may be received many times) when + * wimlib_open_wim_with_progress() is called with the + * ::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY flag. */ + WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY = 16, + + /** An integrity table is being calculated for the WIM being written. + * @p info will point to ::wimlib_progress_info.integrity. This message + * is only received (and may be received many times) when a WIM file is + * being written with the flag ::WIMLIB_WRITE_FLAG_CHECK_INTEGRITY. */ + WIMLIB_PROGRESS_MSG_CALC_INTEGRITY = 17, + + /** A wimlib_split() operation is in progress, and a new split part is + * about to be started. @p info will point to + * ::wimlib_progress_info.split. */ + WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART = 19, + + /** A wimlib_split() operation is in progress, and a split part has been + * finished. @p info will point to ::wimlib_progress_info.split. */ + WIMLIB_PROGRESS_MSG_SPLIT_END_PART = 20, + + /** A WIM update command is about to be executed. @p info will point to + * ::wimlib_progress_info.update. This message is received once per + * update command when wimlib_update_image() is called with the flag + * ::WIMLIB_UPDATE_FLAG_SEND_PROGRESS. */ + WIMLIB_PROGRESS_MSG_UPDATE_BEGIN_COMMAND = 21, + + /** A WIM update command has been executed. @p info will point to + * ::wimlib_progress_info.update. This message is received once per + * update command when wimlib_update_image() is called with the flag + * ::WIMLIB_UPDATE_FLAG_SEND_PROGRESS. */ + WIMLIB_PROGRESS_MSG_UPDATE_END_COMMAND = 22, + + /** A file in the image is being replaced as a result of a + * ::wimlib_add_command without ::WIMLIB_ADD_FLAG_NO_REPLACE specified. + * @p info will point to ::wimlib_progress_info.replace. This is only + * received when ::WIMLIB_ADD_FLAG_VERBOSE is also specified in the add + * command. */ + WIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM = 23, + + /** An image is being extracted with ::WIMLIB_EXTRACT_FLAG_WIMBOOT, and + * a file is being extracted normally (not as a "WIMBoot pointer file") + * due to it matching a pattern in the <c>[PrepopulateList]</c> section + * of the configuration file + * <c>/Windows/System32/WimBootCompress.ini</c> in the WIM image. @p + * info will point to ::wimlib_progress_info.wimboot_exclude. */ + WIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE = 24, + + /** Starting to unmount an image. @p info will point to + * ::wimlib_progress_info.unmount. */ + WIMLIB_PROGRESS_MSG_UNMOUNT_BEGIN = 25, + + /** wimlib has used a file's data for the last time (including all data + * streams, if it has multiple). @p info will point to + * ::wimlib_progress_info.done_with_file. This message is only received + * if ::WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES was provided. */ + WIMLIB_PROGRESS_MSG_DONE_WITH_FILE = 26, + + /** wimlib_verify_wim() is starting to verify the metadata for an image. + * @p info will point to ::wimlib_progress_info.verify_image. */ + WIMLIB_PROGRESS_MSG_BEGIN_VERIFY_IMAGE = 27, + + /** wimlib_verify_wim() has finished verifying the metadata for an + * image. @p info will point to ::wimlib_progress_info.verify_image. + */ + WIMLIB_PROGRESS_MSG_END_VERIFY_IMAGE = 28, + + /** wimlib_verify_wim() is verifying file data integrity. @p info will + * point to ::wimlib_progress_info.verify_streams. */ + WIMLIB_PROGRESS_MSG_VERIFY_STREAMS = 29, + + /** + * The progress function is being asked whether a file should be + * excluded from capture or not. @p info will point to + * ::wimlib_progress_info.test_file_exclusion. This is a bidirectional + * message that allows the progress function to set a flag if the file + * should be excluded. + * + * This message is only received if the flag + * ::WIMLIB_ADD_FLAG_TEST_FILE_EXCLUSION is used. This method for file + * exclusions is independent of the "capture configuration file" + * mechanism. + */ + WIMLIB_PROGRESS_MSG_TEST_FILE_EXCLUSION = 30, + + /** + * An error has occurred and the progress function is being asked + * whether to ignore the error or not. @p info will point to + * ::wimlib_progress_info.handle_error. This is a bidirectional + * message. + * + * This message provides a limited capability for applications to + * recover from "unexpected" errors (i.e. those with no in-library + * handling policy) arising from the underlying operating system. + * Normally, any such error will cause the library to abort the current + * operation. By implementing a handler for this message, the + * application can instead choose to ignore a given error. + * + * Currently, only the following types of errors will result in this + * progress message being sent: + * + * - Directory tree scan errors, e.g. from wimlib_add_image() + * - Most extraction errors; currently restricted to the Windows + * build of the library only. + */ + WIMLIB_PROGRESS_MSG_HANDLE_ERROR = 31, +}; + +/** Valid return values from user-provided progress functions + * (::wimlib_progress_func_t). + * + * (Note: if an invalid value is returned, ::WIMLIB_ERR_UNKNOWN_PROGRESS_STATUS + * will be issued.) + */ +enum wimlib_progress_status { + + /** The operation should be continued. This is the normal return value. + */ + WIMLIB_PROGRESS_STATUS_CONTINUE = 0, + + /** The operation should be aborted. This will cause the current + * operation to fail with ::WIMLIB_ERR_ABORTED_BY_PROGRESS. */ + WIMLIB_PROGRESS_STATUS_ABORT = 1, +}; + +/** + * A pointer to this union is passed to the user-supplied + * ::wimlib_progress_func_t progress function. One (or none) of the structures + * contained in this union will be applicable for the operation + * (::wimlib_progress_msg) indicated in the first argument to the progress + * function. */ +union wimlib_progress_info { + + /** Valid on the message ::WIMLIB_PROGRESS_MSG_WRITE_STREAMS. This is + * the primary message for tracking the progress of writing a WIM file. + */ + struct wimlib_progress_info_write_streams { + + /** An upper bound on the number of bytes of file data that will + * be written. This number is the uncompressed size; the actual + * size may be lower due to compression. In addition, this + * number may decrease over time as duplicated file data is + * discovered. */ + uint64_t total_bytes; + + /** An upper bound on the number of distinct file data "blobs" + * that will be written. This will often be similar to the + * "number of files", but for several reasons (hard links, named + * data streams, empty files, etc.) it can be different. In + * addition, this number may decrease over time as duplicated + * file data is discovered. */ + uint64_t total_streams; + + /** The number of bytes of file data that have been written so + * far. This starts at 0 and ends at @p total_bytes. This + * number is the uncompressed size; the actual size may be lower + * due to compression. See @p completed_compressed_bytes for + * the compressed size. */ + uint64_t completed_bytes; + + /** The number of distinct file data "blobs" that have been + * written so far. This starts at 0 and ends at @p + * total_streams. */ + uint64_t completed_streams; + + /** The number of threads being used for data compression; or, + * if no compression is being performed, this will be 1. */ + uint32_t num_threads; + + /** The compression type being used, as one of the + * ::wimlib_compression_type constants. */ + int32_t compression_type; + + /** The number of on-disk WIM files from which file data is + * being exported into the output WIM file. This can be 0, 1, + * or more than 1, depending on the situation. */ + uint32_t total_parts; + + /** This is currently broken and will always be 0. */ + uint32_t completed_parts; + + /** Since wimlib v1.13.4: Like @p completed_bytes, but counts + * the compressed size. */ + uint64_t completed_compressed_bytes; + } write_streams; + + /** Valid on messages ::WIMLIB_PROGRESS_MSG_SCAN_BEGIN, + * ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY, and + * ::WIMLIB_PROGRESS_MSG_SCAN_END. */ + struct wimlib_progress_info_scan { + + /** Top-level directory being scanned; or, when capturing an NTFS + * volume with ::WIMLIB_ADD_FLAG_NTFS, this is instead the path + * to the file or block device that contains the NTFS volume + * being scanned. */ + const wimlib_tchar *source; + + /** Path to the file (or directory) that has been scanned, valid + * on ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY. When capturing an NTFS + * volume with ::WIMLIB_ADD_FLAG_NTFS, this path will be + * relative to the root of the NTFS volume. */ + const wimlib_tchar *cur_path; + + /** Dentry scan status, valid on + * ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY. */ + enum { + /** File looks okay and will be captured. */ + WIMLIB_SCAN_DENTRY_OK = 0, + + /** File is being excluded from capture due to the + * capture configuration. */ + WIMLIB_SCAN_DENTRY_EXCLUDED = 1, + + /** File is being excluded from capture due to being of + * an unsupported type. */ + WIMLIB_SCAN_DENTRY_UNSUPPORTED = 2, + + /** The file is an absolute symbolic link or junction + * that points into the capture directory, and + * reparse-point fixups are enabled, so its target is + * being adjusted. (Reparse point fixups can be + * disabled with the flag ::WIMLIB_ADD_FLAG_NORPFIX.) + */ + WIMLIB_SCAN_DENTRY_FIXED_SYMLINK = 3, + + /** Reparse-point fixups are enabled, but the file is an + * absolute symbolic link or junction that does + * <b>not</b> point into the capture directory, so its + * target is <b>not</b> being adjusted. */ + WIMLIB_SCAN_DENTRY_NOT_FIXED_SYMLINK = 4, + } status; + + union { + /** Target path in the image. Only valid on messages + * ::WIMLIB_PROGRESS_MSG_SCAN_BEGIN and + * ::WIMLIB_PROGRESS_MSG_SCAN_END. */ + const wimlib_tchar *wim_target_path; + + /** For ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY and a status + * of @p WIMLIB_SCAN_DENTRY_FIXED_SYMLINK or @p + * WIMLIB_SCAN_DENTRY_NOT_FIXED_SYMLINK, this is the + * target of the absolute symbolic link or junction. */ + const wimlib_tchar *symlink_target; + }; + + /** The number of directories scanned so far, not counting + * excluded/unsupported files. */ + uint64_t num_dirs_scanned; + + /** The number of non-directories scanned so far, not counting + * excluded/unsupported files. */ + uint64_t num_nondirs_scanned; + + /** The number of bytes of file data detected so far, not + * counting excluded/unsupported files. */ + uint64_t num_bytes_scanned; + } scan; + + /** Valid on messages + * ::WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN, + * ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN, + * ::WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN, + * ::WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE, + * ::WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS, + * ::WIMLIB_PROGRESS_MSG_EXTRACT_METADATA, + * ::WIMLIB_PROGRESS_MSG_EXTRACT_TREE_END, and + * ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_END. + * + * Note: most of the time of an extraction operation will be spent + * extracting file data, and the application will receive + * ::WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS during this time. Using @p + * completed_bytes and @p total_bytes, the application can calculate a + * percentage complete. However, there is no way for applications to + * know which file is currently being extracted. This is by design + * because the best way to complete the extraction operation is not + * necessarily file-by-file. + */ + struct wimlib_progress_info_extract { + + /** The 1-based index of the image from which files are being + * extracted. */ + uint32_t image; + + /** Extraction flags being used. */ + uint32_t extract_flags; + + /** If the ::WIMStruct from which the extraction being performed + * has a backing file, then this is an absolute path to that + * backing file. Otherwise, this is @c NULL. */ + const wimlib_tchar *wimfile_name; + + /** Name of the image from which files are being extracted, or + * the empty string if the image is unnamed. */ + const wimlib_tchar *image_name; + + /** Path to the directory or NTFS volume to which the files are + * being extracted. */ + const wimlib_tchar *target; + + /** Reserved. */ + const wimlib_tchar *reserved; + + /** The number of bytes of file data that will be extracted. */ + uint64_t total_bytes; + + /** The number of bytes of file data that have been extracted so + * far. This starts at 0 and ends at @p total_bytes. */ + uint64_t completed_bytes; + + /** The number of file streams that will be extracted. This + * will often be similar to the "number of files", but for + * several reasons (hard links, named data streams, empty files, + * etc.) it can be different. */ + uint64_t total_streams; + + /** The number of file streams that have been extracted so far. + * This starts at 0 and ends at @p total_streams. */ + uint64_t completed_streams; + + /** Currently only used for + * ::WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN. */ + uint32_t part_number; + + /** Currently only used for + * ::WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN. */ + uint32_t total_parts; + + /** Currently only used for + * ::WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN. */ + uint8_t guid[WIMLIB_GUID_LEN]; + + /** For ::WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE and + * ::WIMLIB_PROGRESS_MSG_EXTRACT_METADATA messages, this is the + * number of files that have been processed so far. Once the + * corresponding phase of extraction is complete, this value + * will be equal to @c end_file_count. */ + uint64_t current_file_count; + + /** For ::WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE and + * ::WIMLIB_PROGRESS_MSG_EXTRACT_METADATA messages, this is + * total number of files that will be processed. + * + * This number is provided for informational purposes only, e.g. + * for a progress bar. This number will not necessarily be + * equal to the number of files actually being extracted. This + * is because extraction backends are free to implement an + * extraction algorithm that might be more efficient than + * processing every file in the "extract file structure" and + * "extract file metadata" phases. For example, the current + * implementation of the UNIX extraction backend will create + * files on-demand during the "extract file data" phase. + * Therefore, when using that particular extraction backend, @p + * end_file_count will only include directories and empty files. + */ + uint64_t end_file_count; + } extract; + + /** Valid on messages ::WIMLIB_PROGRESS_MSG_RENAME. */ + struct wimlib_progress_info_rename { + /** Name of the temporary file that the WIM was written to. */ + const wimlib_tchar *from; + + /** Name of the original WIM file to which the temporary file is + * being renamed. */ + const wimlib_tchar *to; + } rename; + + /** Valid on messages ::WIMLIB_PROGRESS_MSG_UPDATE_BEGIN_COMMAND and + * ::WIMLIB_PROGRESS_MSG_UPDATE_END_COMMAND. */ + struct wimlib_progress_info_update { + /** Pointer to the update command that will be executed or has + * just been executed. */ + const struct wimlib_update_command *command; + + /** Number of update commands that have been completed so far. + */ + size_t completed_commands; + + /** Number of update commands that are being executed as part of + * this call to wimlib_update_image(). */ + size_t total_commands; + } update; + + /** Valid on messages ::WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY and + * ::WIMLIB_PROGRESS_MSG_CALC_INTEGRITY. */ + struct wimlib_progress_info_integrity { + + /** The number of bytes in the WIM file that are covered by + * integrity checks. */ + uint64_t total_bytes; + + /** The number of bytes that have been checksummed so far. This + * starts at 0 and ends at @p total_bytes. */ + uint64_t completed_bytes; + + /** The number of individually checksummed "chunks" the + * integrity-checked region is divided into. */ + uint32_t total_chunks; + + /** The number of chunks that have been checksummed so far. + * This starts at 0 and ends at @p total_chunks. */ + uint32_t completed_chunks; + + /** The size of each individually checksummed "chunk" in the + * integrity-checked region. */ + uint32_t chunk_size; + + /** For ::WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY messages, this is + * the path to the WIM file being checked. */ + const wimlib_tchar *filename; + } integrity; + + /** Valid on messages ::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART and + * ::WIMLIB_PROGRESS_MSG_SPLIT_END_PART. */ + struct wimlib_progress_info_split { + /** Total size of the original WIM's file and metadata resources + * (compressed). */ + uint64_t total_bytes; + + /** Number of bytes of file and metadata resources that have + * been copied out of the original WIM so far. Will be 0 + * initially, and equal to @p total_bytes at the end. */ + uint64_t completed_bytes; + + /** Number of the split WIM part that is about to be started + * (::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART) or has just been + * finished (::WIMLIB_PROGRESS_MSG_SPLIT_END_PART). */ + unsigned cur_part_number; + + /** Total number of split WIM parts that are being written. */ + unsigned total_parts; + + /** Name of the split WIM part that is about to be started + * (::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART) or has just been + * finished (::WIMLIB_PROGRESS_MSG_SPLIT_END_PART). Since + * wimlib v1.7.0, the library user may change this when + * receiving ::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART in order to + * cause the next split WIM part to be written to a different + * location. */ + wimlib_tchar *part_name; + } split; + + /** Valid on messages ::WIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM */ + struct wimlib_progress_info_replace { + /** Path to the file in the image that is being replaced */ + const wimlib_tchar *path_in_wim; + } replace; + + /** Valid on messages ::WIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE */ + struct wimlib_progress_info_wimboot_exclude { + /** Path to the file in the image */ + const wimlib_tchar *path_in_wim; + + /** Path to which the file is being extracted */ + const wimlib_tchar *extraction_path; + } wimboot_exclude; + + /** Valid on messages ::WIMLIB_PROGRESS_MSG_UNMOUNT_BEGIN. */ + struct wimlib_progress_info_unmount { + /** Path to directory being unmounted */ + const wimlib_tchar *mountpoint; + + /** Path to WIM file being unmounted */ + const wimlib_tchar *mounted_wim; + + /** 1-based index of image being unmounted. */ + uint32_t mounted_image; + + /** Flags that were passed to wimlib_mount_image() when the + * mountpoint was set up. */ + uint32_t mount_flags; + + /** Flags passed to wimlib_unmount_image(). */ + uint32_t unmount_flags; + } unmount; + + /** Valid on messages ::WIMLIB_PROGRESS_MSG_DONE_WITH_FILE. */ + struct wimlib_progress_info_done_with_file { + /** + * Path to the file whose data has been written to the WIM file, + * or is currently being asynchronously compressed in memory, + * and therefore is no longer needed by wimlib. + * + * WARNING: The file data will not actually be accessible in the + * WIM file until the WIM file has been completely written. + * Ordinarily you should <b>not</b> treat this message as a + * green light to go ahead and delete the specified file, since + * that would result in data loss if the WIM file cannot be + * successfully created for any reason. + * + * If a file has multiple names (hard links), + * ::WIMLIB_PROGRESS_MSG_DONE_WITH_FILE will only be received + * for one name. Also, this message will not be received for + * empty files or reparse points (or symbolic links), unless + * they have nonempty named data streams. + */ + const wimlib_tchar *path_to_file; + } done_with_file; + + /** Valid on messages ::WIMLIB_PROGRESS_MSG_BEGIN_VERIFY_IMAGE and + * ::WIMLIB_PROGRESS_MSG_END_VERIFY_IMAGE. */ + struct wimlib_progress_info_verify_image { + const wimlib_tchar *wimfile; + uint32_t total_images; + uint32_t current_image; + } verify_image; + + /** Valid on messages ::WIMLIB_PROGRESS_MSG_VERIFY_STREAMS. */ + struct wimlib_progress_info_verify_streams { + const wimlib_tchar *wimfile; + uint64_t total_streams; + uint64_t total_bytes; + uint64_t completed_streams; + uint64_t completed_bytes; + } verify_streams; + + /** Valid on messages ::WIMLIB_PROGRESS_MSG_TEST_FILE_EXCLUSION. */ + struct wimlib_progress_info_test_file_exclusion { + + /** + * Path to the file for which exclusion is being tested. + * + * UNIX capture mode: The path will be a standard relative or + * absolute UNIX filesystem path. + * + * NTFS-3G capture mode: The path will be given relative to the + * root of the NTFS volume, with a leading slash. + * + * Windows capture mode: The path will be a Win32 namespace + * path to the file. + */ + const wimlib_tchar *path; + + /** + * Indicates whether the file or directory will be excluded from + * capture or not. This will be <c>false</c> by default. The + * progress function can set this to <c>true</c> if it decides + * that the file needs to be excluded. + */ + bool will_exclude; + } test_file_exclusion; + + /** Valid on messages ::WIMLIB_PROGRESS_MSG_HANDLE_ERROR. */ + struct wimlib_progress_info_handle_error { + + /** Path to the file for which the error occurred, or NULL if + * not relevant. */ + const wimlib_tchar *path; + + /** The wimlib error code associated with the error. */ + int error_code; + + /** + * Indicates whether the error will be ignored or not. This + * will be <c>false</c> by default; the progress function may + * set it to <c>true</c>. + */ + bool will_ignore; + } handle_error; +}; + +/** + * A user-supplied function that will be called periodically during certain WIM + * operations. + * + * The first argument will be the type of operation that is being performed or + * is about to be started or has been completed. + * + * The second argument will be a pointer to one of a number of structures + * depending on the first argument. It may be @c NULL for some message types. + * Note that although this argument is not @c const, users should not modify it + * except in explicitly documented cases. + * + * The third argument will be a user-supplied value that was provided when + * registering or specifying the progress function. + * + * This function must return one of the ::wimlib_progress_status values. By + * default, you should return ::WIMLIB_PROGRESS_STATUS_CONTINUE (0). + */ +typedef enum wimlib_progress_status + (*wimlib_progress_func_t)(enum wimlib_progress_msg msg_type, + union wimlib_progress_info *info, + void *progctx); + +/** @} */ +/** @addtogroup G_modifying_wims + * @{ */ + +/** An array of these structures is passed to wimlib_add_image_multisource() to + * specify the sources from which to create a WIM image. */ +struct wimlib_capture_source { + /** Absolute or relative path to a file or directory on the external + * filesystem to be included in the image. */ + wimlib_tchar *fs_source_path; + + /** Destination path in the image. To specify the root directory of the + * image, use ::WIMLIB_WIM_ROOT_PATH. */ + wimlib_tchar *wim_target_path; + + /** Reserved; set to 0. */ + long reserved; +}; + +/** Set or unset the "readonly" WIM header flag (<c>WIM_HDR_FLAG_READONLY</c> in + * Microsoft's documentation), based on the ::wimlib_wim_info.is_marked_readonly + * member of the @p info parameter. This is distinct from basic file + * permissions; this flag can be set on a WIM file that is physically writable. + * + * wimlib disallows modifying on-disk WIM files with the readonly flag set. + * However, wimlib_overwrite() with ::WIMLIB_WRITE_FLAG_IGNORE_READONLY_FLAG + * will override this --- and in fact, this is necessary to set the readonly + * flag persistently on an existing WIM file. + */ +#define WIMLIB_CHANGE_READONLY_FLAG 0x00000001 + +/** Set the GUID (globally unique identifier) of the WIM file to the value + * specified in ::wimlib_wim_info.guid of the @p info parameter. */ +#define WIMLIB_CHANGE_GUID 0x00000002 + +/** Change the bootable image of the WIM to the value specified in + * ::wimlib_wim_info.boot_index of the @p info parameter. */ +#define WIMLIB_CHANGE_BOOT_INDEX 0x00000004 + +/** Change the <c>WIM_HDR_FLAG_RP_FIX</c> flag of the WIM file to the value + * specified in ::wimlib_wim_info.has_rpfix of the @p info parameter. This flag + * generally indicates whether an image in the WIM has been captured with + * reparse-point fixups enabled. wimlib also treats this flag as specifying + * whether to do reparse-point fixups by default when capturing or applying WIM + * images. */ +#define WIMLIB_CHANGE_RPFIX_FLAG 0x00000008 + +/** @} */ + +/** @addtogroup G_wim_information */ + +/** @{ */ + +/** + * General information about a WIM file. + * + * This info can also be requested for a ::WIMStruct that does not have a + * backing file. In this case, fields that only make sense given a backing file + * are set to default values. + */ +struct wimlib_wim_info { + + /** The globally unique identifier for this WIM. (Note: all parts of a + * split WIM normally have identical GUIDs.) */ + uint8_t guid[WIMLIB_GUID_LEN]; + + /** The number of images in this WIM file. */ + uint32_t image_count; + + /** The 1-based index of the bootable image in this WIM file, or 0 if no + * image is bootable. */ + uint32_t boot_index; + + /** The version of the WIM file format used in this WIM file. */ + uint32_t wim_version; + + /** The default compression chunk size of resources in this WIM file. + */ + uint32_t chunk_size; + + /** For split WIMs, the 1-based index of this part within the split WIM; + * otherwise 1. */ + uint16_t part_number; + + /** For split WIMs, the total number of parts in the split WIM; + * otherwise 1. */ + uint16_t total_parts; + + /** The default compression type of resources in this WIM file, as one + * of the ::wimlib_compression_type constants. */ + int32_t compression_type; + + /** The size of this WIM file in bytes, excluding the XML data and + * integrity table. */ + uint64_t total_bytes; + + /** 1 iff this WIM file has an integrity table. */ + uint32_t has_integrity_table : 1; + + /** 1 iff this info struct is for a ::WIMStruct that has a backing file. + */ + uint32_t opened_from_file : 1; + + /** 1 iff this WIM file is considered readonly for any reason (e.g. the + * "readonly" header flag is set, or this is part of a split WIM, or + * filesystem permissions deny writing) */ + uint32_t is_readonly : 1; + + /** 1 iff the "reparse point fix" flag is set in this WIM's header */ + uint32_t has_rpfix : 1; + + /** 1 iff the "readonly" flag is set in this WIM's header */ + uint32_t is_marked_readonly : 1; + + /** 1 iff the "spanned" flag is set in this WIM's header */ + uint32_t spanned : 1; + + /** 1 iff the "write in progress" flag is set in this WIM's header */ + uint32_t write_in_progress : 1; + + /** 1 iff the "metadata only" flag is set in this WIM's header */ + uint32_t metadata_only : 1; + + /** 1 iff the "resource only" flag is set in this WIM's header */ + uint32_t resource_only : 1; + + /** 1 iff this WIM file is pipable (see ::WIMLIB_WRITE_FLAG_PIPABLE). */ + uint32_t pipable : 1; + uint32_t reserved_flags : 22; + uint32_t reserved[9]; +}; + +/** + * Information about a "blob", which is a fixed length sequence of binary data. + * Each nonempty stream of each file in a WIM image is associated with a blob. + * Blobs are deduplicated within a WIM file. + * + * TODO: this struct needs to be renamed, and perhaps made into a union since + * there are several cases. I'll try to list them below: + * + * 1. The blob is "missing", meaning that it is referenced by hash but not + * actually present in the WIM file. In this case we only know the + * sha1_hash. This case can only occur with wimlib_iterate_dir_tree(), never + * wimlib_iterate_lookup_table(). + * + * 2. Otherwise we know the uncompressed_size, the reference_count, and the + * is_metadata flag. In addition: + * + * A. If the blob is located in a non-solid WIM resource, then we also know + * the sha1_hash, compressed_size, and offset. + * + * B. If the blob is located in a solid WIM resource, then we also know the + * sha1_hash, offset, raw_resource_offset_in_wim, + * raw_resource_compressed_size, and raw_resource_uncompressed_size. But + * the "offset" is actually the offset in the uncompressed solid resource + * rather than the offset from the beginning of the WIM file. + * + * C. If the blob is *not* located in any type of WIM resource, for example + * if it's in a external file that was scanned by wimlib_add_image(), then + * we usually won't know any more information. The sha1_hash might be + * known, and prior to wimlib v1.13.6 it always was; however, in wimlib + * v1.13.6 and later, the sha1_hash might not be known in this case. + * + * Unknown or irrelevant fields are left zeroed. + */ +struct wimlib_resource_entry { + + /** If this blob is not missing, then this is the uncompressed size of + * this blob in bytes. */ + uint64_t uncompressed_size; + + /** If this blob is located in a non-solid WIM resource, then this is + * the compressed size of that resource. */ + uint64_t compressed_size; + + /** If this blob is located in a non-solid WIM resource, then this is + * the offset of that resource within the WIM file containing it. If + * this blob is located in a solid WIM resource, then this is the offset + * of this blob within that solid resource when uncompressed. */ + uint64_t offset; + + /** If this blob is located in a WIM resource, then this is the SHA-1 + * message digest of the blob's uncompressed contents. */ + uint8_t sha1_hash[20]; + + /** If this blob is located in a WIM resource, then this is the part + * number of the WIM file containing it. */ + uint32_t part_number; + + /** If this blob is not missing, then this is the number of times this + * blob is referenced over all images in the WIM. This number is not + * guaranteed to be correct. */ + uint32_t reference_count; + + /** 1 iff this blob is located in a non-solid compressed WIM resource. + */ + uint32_t is_compressed : 1; + + /** 1 iff this blob contains the metadata for an image. */ + uint32_t is_metadata : 1; + + uint32_t is_free : 1; + uint32_t is_spanned : 1; + + /** 1 iff a blob with this hash was not found in the blob lookup table + * of the ::WIMStruct. This normally implies a missing call to + * wimlib_reference_resource_files() or wimlib_reference_resources(). */ + uint32_t is_missing : 1; + + /** 1 iff this blob is located in a solid resource. */ + uint32_t packed : 1; + + uint32_t reserved_flags : 26; + + /** If this blob is located in a solid WIM resource, then this is the + * offset of that solid resource within the WIM file containing it. */ + uint64_t raw_resource_offset_in_wim; + + /** If this blob is located in a solid WIM resource, then this is the + * compressed size of that solid resource. */ + uint64_t raw_resource_compressed_size; + + /** If this blob is located in a solid WIM resource, then this is the + * uncompressed size of that solid resource. */ + uint64_t raw_resource_uncompressed_size; + + uint64_t reserved[1]; +}; + +/** + * Information about a stream of a particular file in the WIM. + * + * Normally, only WIM images captured from NTFS filesystems will have multiple + * streams per file. In practice, this is a rarely used feature of the + * filesystem. + * + * TODO: the library now explicitly tracks stream types, which allows it to have + * multiple unnamed streams (e.g. both a reparse point stream and unnamed data + * stream). However, this isn't yet exposed by wimlib_iterate_dir_tree(). + */ +struct wimlib_stream_entry { + + /** Name of the stream, or NULL if the stream is unnamed. */ + const wimlib_tchar *stream_name; + + /** Info about this stream's data, such as its hash and size if known.*/ + struct wimlib_resource_entry resource; + + uint64_t reserved[4]; +}; + +/** + * Since wimlib v1.9.1: an object ID, which is an extra piece of metadata that + * may be associated with a file on NTFS filesystems. See: + * https://msdn.microsoft.com/en-us/library/windows/desktop/aa363997(v=vs.85).aspx + */ +struct wimlib_object_id { + uint8_t object_id[WIMLIB_GUID_LEN]; + uint8_t birth_volume_id[WIMLIB_GUID_LEN]; + uint8_t birth_object_id[WIMLIB_GUID_LEN]; + uint8_t domain_id[WIMLIB_GUID_LEN]; +}; + +/** Structure passed to the wimlib_iterate_dir_tree() callback function. + * Roughly, the information about a "file" in the WIM image --- but really a + * directory entry ("dentry") because hard links are allowed. The + * hard_link_group_id field can be used to distinguish actual file inodes. */ +struct wimlib_dir_entry { + /** Name of the file, or NULL if this file is unnamed. Only the root + * directory of an image will be unnamed. */ + const wimlib_tchar *filename; + + /** 8.3 name (or "DOS name", or "short name") of this file; or NULL if + * this file has no such name. */ + const wimlib_tchar *dos_name; + + /** Full path to this file within the image. Path separators will be + * ::WIMLIB_WIM_PATH_SEPARATOR. */ + const wimlib_tchar *full_path; + + /** Depth of this directory entry, where 0 is the root, 1 is the root's + * children, ..., etc. */ + size_t depth; + + /** Pointer to the security descriptor for this file, in Windows + * SECURITY_DESCRIPTOR_RELATIVE format, or NULL if this file has no + * security descriptor. */ + const char *security_descriptor; + + /** Size of the above security descriptor, in bytes. */ + size_t security_descriptor_size; + +#define WIMLIB_FILE_ATTRIBUTE_READONLY 0x00000001 +#define WIMLIB_FILE_ATTRIBUTE_HIDDEN 0x00000002 +#define WIMLIB_FILE_ATTRIBUTE_SYSTEM 0x00000004 +#define WIMLIB_FILE_ATTRIBUTE_DIRECTORY 0x00000010 +#define WIMLIB_FILE_ATTRIBUTE_ARCHIVE 0x00000020 +#define WIMLIB_FILE_ATTRIBUTE_DEVICE 0x00000040 +#define WIMLIB_FILE_ATTRIBUTE_NORMAL 0x00000080 +#define WIMLIB_FILE_ATTRIBUTE_TEMPORARY 0x00000100 +#define WIMLIB_FILE_ATTRIBUTE_SPARSE_FILE 0x00000200 +#define WIMLIB_FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 +#define WIMLIB_FILE_ATTRIBUTE_COMPRESSED 0x00000800 +#define WIMLIB_FILE_ATTRIBUTE_OFFLINE 0x00001000 +#define WIMLIB_FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000 +#define WIMLIB_FILE_ATTRIBUTE_ENCRYPTED 0x00004000 +#define WIMLIB_FILE_ATTRIBUTE_VIRTUAL 0x00010000 + /** File attributes, such as whether the file is a directory or not. + * These are the "standard" Windows FILE_ATTRIBUTE_* values, although in + * wimlib.h they are defined as WIMLIB_FILE_ATTRIBUTE_* for convenience + * on other platforms. */ + uint32_t attributes; + +#define WIMLIB_REPARSE_TAG_RESERVED_ZERO 0x00000000 +#define WIMLIB_REPARSE_TAG_RESERVED_ONE 0x00000001 +#define WIMLIB_REPARSE_TAG_MOUNT_POINT 0xA0000003 +#define WIMLIB_REPARSE_TAG_HSM 0xC0000004 +#define WIMLIB_REPARSE_TAG_HSM2 0x80000006 +#define WIMLIB_REPARSE_TAG_DRIVER_EXTENDER 0x80000005 +#define WIMLIB_REPARSE_TAG_SIS 0x80000007 +#define WIMLIB_REPARSE_TAG_DFS 0x8000000A +#define WIMLIB_REPARSE_TAG_DFSR 0x80000012 +#define WIMLIB_REPARSE_TAG_FILTER_MANAGER 0x8000000B +#define WIMLIB_REPARSE_TAG_WOF 0x80000017 +#define WIMLIB_REPARSE_TAG_SYMLINK 0xA000000C + /** If the file is a reparse point (FILE_ATTRIBUTE_REPARSE_POINT set in + * the attributes), this will give the reparse tag. This tells you + * whether the reparse point is a symbolic link, junction point, or some + * other, more unusual kind of reparse point. */ + uint32_t reparse_tag; + + /** Number of links to this file's inode (hard links). + * + * Currently, this will always be 1 for directories. However, it can be + * greater than 1 for nondirectory files. */ + uint32_t num_links; + + /** Number of named data streams this file has. Normally 0. */ + uint32_t num_named_streams; + + /** A unique identifier for this file's inode. However, as a special + * case, if the inode only has a single link (@p num_links == 1), this + * value may be 0. + * + * Note: if a WIM image is captured from a filesystem, this value is not + * guaranteed to be the same as the original number of the inode on the + * filesystem. */ + uint64_t hard_link_group_id; + + /** Time this file was created. */ + struct wimlib_timespec creation_time; + + /** Time this file was last written to. */ + struct wimlib_timespec last_write_time; + + /** Time this file was last accessed. */ + struct wimlib_timespec last_access_time; + + /** The UNIX user ID of this file. This is a wimlib extension. + * + * This field is only valid if @p unix_mode != 0. */ + uint32_t unix_uid; + + /** The UNIX group ID of this file. This is a wimlib extension. + * + * This field is only valid if @p unix_mode != 0. */ + uint32_t unix_gid; + + /** The UNIX mode of this file. This is a wimlib extension. + * + * If this field is 0, then @p unix_uid, @p unix_gid, @p unix_mode, and + * @p unix_rdev are all unknown (fields are not present in the WIM + * image). */ + uint32_t unix_mode; + + /** The UNIX device ID (major and minor number) of this file. This is a + * wimlib extension. + * + * This field is only valid if @p unix_mode != 0. */ + uint32_t unix_rdev; + + /* The object ID of this file, if any. Only valid if + * object_id.object_id is not all zeroes. */ + struct wimlib_object_id object_id; + + /** High 32 bits of the seconds portion of the creation timestamp, + * filled in if @p wimlib_timespec.tv_sec is only 32-bit. */ + int32_t creation_time_high; + + /** High 32 bits of the seconds portion of the last write timestamp, + * filled in if @p wimlib_timespec.tv_sec is only 32-bit. */ + int32_t last_write_time_high; + + /** High 32 bits of the seconds portion of the last access timestamp, + * filled in if @p wimlib_timespec.tv_sec is only 32-bit. */ + int32_t last_access_time_high; + + int32_t reserved2; + + uint64_t reserved[4]; + + /** + * Variable-length array of streams that make up this file. + * + * The first entry will always exist and will correspond to the unnamed + * data stream (default file contents), so it will have <c>stream_name + * == NULL</c>. Alternatively, for reparse point files, the first entry + * will correspond to the reparse data stream. Alternatively, for + * encrypted files, the first entry will correspond to the encrypted + * data. + * + * Then, following the first entry, there be @p num_named_streams + * additional entries that specify the named data streams, if any, each + * of which will have <c>stream_name != NULL</c>. + */ + struct wimlib_stream_entry streams[]; +}; + +/** + * Type of a callback function to wimlib_iterate_dir_tree(). Must return 0 on + * success. + */ +typedef int (*wimlib_iterate_dir_tree_callback_t)(const struct wimlib_dir_entry *dentry, + void *user_ctx); + +/** + * Type of a callback function to wimlib_iterate_lookup_table(). Must return 0 + * on success. + */ +typedef int (*wimlib_iterate_lookup_table_callback_t)(const struct wimlib_resource_entry *resource, + void *user_ctx); + +/** For wimlib_iterate_dir_tree(): Iterate recursively on children rather than + * just on the specified path. */ +#define WIMLIB_ITERATE_DIR_TREE_FLAG_RECURSIVE 0x00000001 + +/** For wimlib_iterate_dir_tree(): Don't iterate on the file or directory + * itself; only its children (in the case of a non-empty directory) */ +#define WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN 0x00000002 + +/** Return ::WIMLIB_ERR_RESOURCE_NOT_FOUND if any file data blobs needed to fill + * in the ::wimlib_resource_entry's for the iteration cannot be found in the + * blob lookup table of the ::WIMStruct. The default behavior without this flag + * is to fill in the @ref wimlib_resource_entry::sha1_hash "sha1_hash" and set + * the @ref wimlib_resource_entry::is_missing "is_missing" flag. */ +#define WIMLIB_ITERATE_DIR_TREE_FLAG_RESOURCES_NEEDED 0x00000004 + + +/** @} */ +/** @addtogroup G_modifying_wims + * @{ */ + +/** UNIX-like systems only: Directly capture an NTFS volume rather than a + * generic directory. This requires that wimlib was compiled with support for + * libntfs-3g. + * + * This flag cannot be combined with ::WIMLIB_ADD_FLAG_DEREFERENCE or + * ::WIMLIB_ADD_FLAG_UNIX_DATA. + * + * Do not use this flag on Windows, where wimlib already supports all + * Windows-native filesystems, including NTFS, through the Windows APIs. */ +#define WIMLIB_ADD_FLAG_NTFS 0x00000001 + +/** Follow symbolic links when scanning the directory tree. Currently only + * supported on UNIX-like systems. */ +#define WIMLIB_ADD_FLAG_DEREFERENCE 0x00000002 + +/** Call the progress function with the message + * ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY when each directory or file has been + * scanned. */ +#define WIMLIB_ADD_FLAG_VERBOSE 0x00000004 + +/** Mark the image being added as the bootable image of the WIM. This flag is + * valid only for wimlib_add_image() and wimlib_add_image_multisource(). + * + * Note that you can also change the bootable image of a WIM using + * wimlib_set_wim_info(). + * + * Note: ::WIMLIB_ADD_FLAG_BOOT does something different from, and independent + * from, ::WIMLIB_ADD_FLAG_WIMBOOT. */ +#define WIMLIB_ADD_FLAG_BOOT 0x00000008 + +/** UNIX-like systems only: Store the UNIX owner, group, mode, and device ID + * (major and minor number) of each file. In addition, capture special files + * such as device nodes and FIFOs. Since wimlib v1.11.0, on Linux also capture + * extended attributes. See the documentation for the <b>--unix-data</b> option + * to <b>wimcapture</b> for more information. */ +#define WIMLIB_ADD_FLAG_UNIX_DATA 0x00000010 + +/** Do not capture security descriptors. Only has an effect in NTFS-3G capture + * mode, or in Windows native builds. */ +#define WIMLIB_ADD_FLAG_NO_ACLS 0x00000020 + +/** Fail immediately if the full security descriptor of any file or directory + * cannot be accessed. Only has an effect in Windows native builds. The + * default behavior without this flag is to first try omitting the SACL from the + * security descriptor, then to try omitting the security descriptor entirely. + */ +#define WIMLIB_ADD_FLAG_STRICT_ACLS 0x00000040 + +/** Call the progress function with the message + * ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY when a directory or file is excluded from + * capture. This is a subset of the messages provided by + * ::WIMLIB_ADD_FLAG_VERBOSE. */ +#define WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE 0x00000080 + +/** Reparse-point fixups: Modify absolute symbolic links (and junctions, in the + * case of Windows) that point inside the directory being captured to instead be + * absolute relative to the directory being captured. + * + * Without this flag, the default is to do reparse-point fixups if + * <c>WIM_HDR_FLAG_RP_FIX</c> is set in the WIM header or if this is the first + * image being added. */ +#define WIMLIB_ADD_FLAG_RPFIX 0x00000100 + +/** Don't do reparse point fixups. See ::WIMLIB_ADD_FLAG_RPFIX. */ +#define WIMLIB_ADD_FLAG_NORPFIX 0x00000200 + +/** Do not automatically exclude unsupported files or directories from capture, + * such as encrypted files in NTFS-3G capture mode, or device files and FIFOs on + * UNIX-like systems when not also using ::WIMLIB_ADD_FLAG_UNIX_DATA. Instead, + * fail with ::WIMLIB_ERR_UNSUPPORTED_FILE when such a file is encountered. */ +#define WIMLIB_ADD_FLAG_NO_UNSUPPORTED_EXCLUDE 0x00000400 + +/** + * Automatically select a capture configuration appropriate for capturing + * filesystems containing Windows operating systems. For example, + * <c>/pagefile.sys</c> and <c>"/System Volume Information"</c> will be + * excluded. + * + * When this flag is specified, the corresponding @p config parameter (for + * wimlib_add_image()) or member (for wimlib_update_image()) must be @c NULL. + * Otherwise, ::WIMLIB_ERR_INVALID_PARAM will be returned. + * + * Note that the default behavior--- that is, when neither + * ::WIMLIB_ADD_FLAG_WINCONFIG nor ::WIMLIB_ADD_FLAG_WIMBOOT is specified and @p + * config is @c NULL--- is to use no capture configuration, meaning that no + * files are excluded from capture. + */ +#define WIMLIB_ADD_FLAG_WINCONFIG 0x00000800 + +/** + * Capture image as "WIMBoot compatible". In addition, if no capture + * configuration file is explicitly specified use the capture configuration file + * <c>$SOURCE/Windows/System32/WimBootCompress.ini</c> if it exists, where + * <c>$SOURCE</c> is the directory being captured; or, if a capture + * configuration file is explicitly specified, use it and also place it at + * <c>/Windows/System32/WimBootCompress.ini</c> in the WIM image. + * + * This flag does not, by itself, change the compression type or chunk size. + * Before writing the WIM file, you may wish to set the compression format to + * be the same as that used by WIMGAPI and DISM: + * + * \code + * wimlib_set_output_compression_type(wim, WIMLIB_COMPRESSION_TYPE_XPRESS); + * wimlib_set_output_chunk_size(wim, 4096); + * \endcode + * + * However, "WIMBoot" also works with other XPRESS chunk sizes as well as LZX + * with 32768 byte chunks. + * + * Note: ::WIMLIB_ADD_FLAG_WIMBOOT does something different from, and + * independent from, ::WIMLIB_ADD_FLAG_BOOT. + * + * Since wimlib v1.8.3, ::WIMLIB_ADD_FLAG_WIMBOOT also causes offline WIM-backed + * files to be added as the "real" files rather than as their reparse points, + * provided that their data is already present in the WIM. This feature can be + * useful when updating a backing WIM file in an "offline" state. + */ +#define WIMLIB_ADD_FLAG_WIMBOOT 0x00001000 + +/** + * If the add command involves adding a non-directory file to a location at + * which there already exists a nondirectory file in the image, issue + * ::WIMLIB_ERR_INVALID_OVERLAY instead of replacing the file. This was the + * default behavior before wimlib v1.7.0. + */ +#define WIMLIB_ADD_FLAG_NO_REPLACE 0x00002000 + +/** + * Send ::WIMLIB_PROGRESS_MSG_TEST_FILE_EXCLUSION messages to the progress + * function. + * + * Note: This method for file exclusions is independent from the capture + * configuration file mechanism. + */ +#define WIMLIB_ADD_FLAG_TEST_FILE_EXCLUSION 0x00004000 + +/** + * Since wimlib v1.9.0: create a temporary filesystem snapshot of the source + * directory and add the files from it. Currently, this option is only + * supported on Windows, where it uses the Volume Shadow Copy Service (VSS). + * Using this option, you can create a consistent backup of the system volume of + * a running Windows system without running into problems with locked files. + * For the VSS snapshot to be successfully created, your application must be run + * as an Administrator, and it cannot be run in WoW64 mode (i.e. if Windows is + * 64-bit, then your application must be 64-bit as well). + */ +#define WIMLIB_ADD_FLAG_SNAPSHOT 0x00008000 + +/** + * Since wimlib v1.9.0: permit the library to discard file paths after the + * initial scan. If the application won't use + * ::WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES while writing the WIM + * archive, this flag can be used to allow the library to enable optimizations + * such as opening files by inode number rather than by path. Currently this + * only makes a difference on Windows. + */ +#define WIMLIB_ADD_FLAG_FILE_PATHS_UNNEEDED 0x00010000 + +/** @} */ +/** @addtogroup G_modifying_wims + * @{ */ + +/** Do not issue an error if the path to delete does not exist. */ +#define WIMLIB_DELETE_FLAG_FORCE 0x00000001 + +/** Delete the file or directory tree recursively; if not specified, an error is + * issued if the path to delete is a directory. */ +#define WIMLIB_DELETE_FLAG_RECURSIVE 0x00000002 + +/** @} */ +/** @addtogroup G_modifying_wims + * @{ */ + +/** + * If a single image is being exported, mark it bootable in the destination WIM. + * Alternatively, if ::WIMLIB_ALL_IMAGES is specified as the image to export, + * the image in the source WIM (if any) that is marked as bootable is also + * marked as bootable in the destination WIM. + */ +#define WIMLIB_EXPORT_FLAG_BOOT 0x00000001 + +/** Give the exported image(s) no names. Avoids problems with image name + * collisions. + */ +#define WIMLIB_EXPORT_FLAG_NO_NAMES 0x00000002 + +/** Give the exported image(s) no descriptions. */ +#define WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS 0x00000004 + +/** This advises the library that the program is finished with the source + * WIMStruct and will not attempt to access it after the call to + * wimlib_export_image(), with the exception of the call to wimlib_free(). */ +#define WIMLIB_EXPORT_FLAG_GIFT 0x00000008 + +/** + * Mark each exported image as WIMBoot-compatible. + * + * Note: by itself, this does change the destination WIM's compression type, nor + * does it add the file @c \\Windows\\System32\\WimBootCompress.ini in the WIM + * image. Before writing the destination WIM, it's recommended to do something + * like: + * + * \code + * wimlib_set_output_compression_type(wim, WIMLIB_COMPRESSION_TYPE_XPRESS); + * wimlib_set_output_chunk_size(wim, 4096); + * wimlib_add_tree(wim, image, L"myconfig.ini", + * L"\\Windows\\System32\\WimBootCompress.ini", 0); + * \endcode + */ +#define WIMLIB_EXPORT_FLAG_WIMBOOT 0x00000010 + +/** @} */ +/** @addtogroup G_extracting_wims + * @{ */ + +/** Extract the image directly to an NTFS volume rather than a generic directory. + * This mode is only available if wimlib was compiled with libntfs-3g support; + * if not, ::WIMLIB_ERR_UNSUPPORTED will be returned. In this mode, the + * extraction target will be interpreted as the path to an NTFS volume image (as + * a regular file or block device) rather than a directory. It will be opened + * using libntfs-3g, and the image will be extracted to the NTFS filesystem's + * root directory. Note: this flag cannot be used when wimlib_extract_image() + * is called with ::WIMLIB_ALL_IMAGES as the @p image, nor can it be used with + * wimlib_extract_paths() when passed multiple paths. */ +#define WIMLIB_EXTRACT_FLAG_NTFS 0x00000001 + +/** Since wimlib v1.13.4: Don't consider corrupted files to be an error. Just + * extract them in whatever form we can. */ +#define WIMLIB_EXTRACT_FLAG_RECOVER_DATA 0x00000002 + +/** UNIX-like systems only: Extract UNIX-specific metadata captured with + * ::WIMLIB_ADD_FLAG_UNIX_DATA. */ +#define WIMLIB_EXTRACT_FLAG_UNIX_DATA 0x00000020 + +/** Do not extract security descriptors. This flag cannot be combined with + * ::WIMLIB_EXTRACT_FLAG_STRICT_ACLS. */ +#define WIMLIB_EXTRACT_FLAG_NO_ACLS 0x00000040 + +/** + * Fail immediately if the full security descriptor of any file or directory + * cannot be set exactly as specified in the WIM image. On Windows, the default + * behavior without this flag when wimlib does not have permission to set the + * correct security descriptor is to fall back to setting the security + * descriptor with the SACL omitted, then with the DACL omitted, then with the + * owner omitted, then not at all. This flag cannot be combined with + * ::WIMLIB_EXTRACT_FLAG_NO_ACLS. + */ +#define WIMLIB_EXTRACT_FLAG_STRICT_ACLS 0x00000080 + +/** + * This is the extraction equivalent to ::WIMLIB_ADD_FLAG_RPFIX. This forces + * reparse-point fixups on, so absolute symbolic links or junction points will + * be fixed to be absolute relative to the actual extraction root. Reparse- + * point fixups are done by default for wimlib_extract_image() and + * wimlib_extract_image_from_pipe() if <c>WIM_HDR_FLAG_RP_FIX</c> is set in the + * WIM header. This flag cannot be combined with ::WIMLIB_EXTRACT_FLAG_NORPFIX. + */ +#define WIMLIB_EXTRACT_FLAG_RPFIX 0x00000100 + +/** Force reparse-point fixups on extraction off, regardless of the state of the + * WIM_HDR_FLAG_RP_FIX flag in the WIM header. This flag cannot be combined + * with ::WIMLIB_EXTRACT_FLAG_RPFIX. */ +#define WIMLIB_EXTRACT_FLAG_NORPFIX 0x00000200 + +/** For wimlib_extract_paths() and wimlib_extract_pathlist() only: Extract the + * paths, each of which must name a regular file, to standard output. */ +#define WIMLIB_EXTRACT_FLAG_TO_STDOUT 0x00000400 + +/** + * Instead of ignoring files and directories with names that cannot be + * represented on the current platform (note: Windows has more restrictions on + * filenames than POSIX-compliant systems), try to replace characters or append + * junk to the names so that they can be extracted in some form. + * + * Note: this flag is unlikely to have any effect when extracting a WIM image + * that was captured on Windows. + */ +#define WIMLIB_EXTRACT_FLAG_REPLACE_INVALID_FILENAMES 0x00000800 + +/** + * On Windows, when there exist two or more files with the same case insensitive + * name but different case sensitive names, try to extract them all by appending + * junk to the end of them, rather than arbitrarily extracting only one. + * + * Note: this flag is unlikely to have any effect when extracting a WIM image + * that was captured on Windows. + */ +#define WIMLIB_EXTRACT_FLAG_ALL_CASE_CONFLICTS 0x00001000 + +/** Do not ignore failure to set timestamps on extracted files. This flag + * currently only has an effect when extracting to a directory on UNIX-like + * systems. */ +#define WIMLIB_EXTRACT_FLAG_STRICT_TIMESTAMPS 0x00002000 + +/** Do not ignore failure to set short names on extracted files. This flag + * currently only has an effect on Windows. */ +#define WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES 0x00004000 + +/** Do not ignore failure to extract symbolic links and junctions due to + * permissions problems. This flag currently only has an effect on Windows. By + * default, such failures are ignored since the default configuration of Windows + * only allows the Administrator to create symbolic links. */ +#define WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS 0x00008000 + +/** + * For wimlib_extract_paths() and wimlib_extract_pathlist() only: Treat the + * paths to extract as wildcard patterns ("globs") which may contain the + * wildcard characters @c ? and @c *. The @c ? character matches any + * non-path-separator character, whereas the @c * character matches zero or more + * non-path-separator characters. Consequently, each glob may match zero or + * more actual paths in the WIM image. + * + * By default, if a glob does not match any files, a warning but not an error + * will be issued. This is the case even if the glob did not actually contain + * wildcard characters. Use ::WIMLIB_EXTRACT_FLAG_STRICT_GLOB to get an error + * instead. + */ +#define WIMLIB_EXTRACT_FLAG_GLOB_PATHS 0x00040000 + +/** In combination with ::WIMLIB_EXTRACT_FLAG_GLOB_PATHS, causes an error + * (::WIMLIB_ERR_PATH_DOES_NOT_EXIST) rather than a warning to be issued when + * one of the provided globs did not match a file. */ +#define WIMLIB_EXTRACT_FLAG_STRICT_GLOB 0x00080000 + +/** + * Do not extract Windows file attributes such as readonly, hidden, etc. + * + * This flag has an effect on Windows as well as in the NTFS-3G extraction mode. + */ +#define WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES 0x00100000 + +/** + * For wimlib_extract_paths() and wimlib_extract_pathlist() only: Do not + * preserve the directory structure of the archive when extracting --- that is, + * place each extracted file or directory tree directly in the target directory. + * The target directory will still be created if it does not already exist. + */ +#define WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE 0x00200000 + +/** + * Windows only: Extract files as "pointers" back to the WIM archive. + * + * The effects of this option are fairly complex. See the documentation for the + * <b>--wimboot</b> option of <b>wimapply</b> for more information. + */ +#define WIMLIB_EXTRACT_FLAG_WIMBOOT 0x00400000 + +/** + * Since wimlib v1.8.2 and Windows-only: compress the extracted files using + * System Compression, when possible. This only works on either Windows 10 or + * later, or on an older Windows to which Microsoft's wofadk.sys driver has been + * added. Several different compression formats may be used with System + * Compression; this particular flag selects the XPRESS compression format with + * 4096 byte chunks. + */ +#define WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K 0x01000000 + +/** Like ::WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K, but use XPRESS compression with + * 8192 byte chunks. */ +#define WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K 0x02000000 + +/** Like ::WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K, but use XPRESS compression with + * 16384 byte chunks. */ +#define WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K 0x04000000 + +/** Like ::WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K, but use LZX compression with + * 32768 byte chunks. */ +#define WIMLIB_EXTRACT_FLAG_COMPACT_LZX 0x08000000 + +/** @} */ +/** @addtogroup G_mounting_wim_images + * @{ */ + +/** Mount the WIM image read-write rather than the default of read-only. */ +#define WIMLIB_MOUNT_FLAG_READWRITE 0x00000001 + +/** Enable FUSE debugging by passing the @c -d option to @c fuse_main(). */ +#define WIMLIB_MOUNT_FLAG_DEBUG 0x00000002 + +/** Do not allow accessing named data streams in the mounted WIM image. */ +#define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_NONE 0x00000004 + +/** Access named data streams in the mounted WIM image through extended file + * attributes named "user.X", where X is the name of a data stream. This is the + * default mode. */ +#define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_XATTR 0x00000008 + +/** Access named data streams in the mounted WIM image by specifying the file + * name, a colon, then the name of the data stream. */ +#define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_WINDOWS 0x00000010 + +/** Support UNIX owners, groups, modes, and special files. */ +#define WIMLIB_MOUNT_FLAG_UNIX_DATA 0x00000020 + +/** Allow other users to see the mounted filesystem. This passes the @c + * allow_other option to fuse_main(). */ +#define WIMLIB_MOUNT_FLAG_ALLOW_OTHER 0x00000040 + +/** @} */ +/** @addtogroup G_creating_and_opening_wims + * @{ */ + +/** Verify the WIM contents against the WIM's integrity table, if present. The + * integrity table stores checksums for the raw data of the WIM file, divided + * into fixed size chunks. Verification will compute checksums and compare them + * with the stored values. If there are any mismatches, then + * ::WIMLIB_ERR_INTEGRITY will be issued. If the WIM file does not contain an + * integrity table, then this flag has no effect. */ +#define WIMLIB_OPEN_FLAG_CHECK_INTEGRITY 0x00000001 + +/** Issue an error (::WIMLIB_ERR_IS_SPLIT_WIM) if the WIM is part of a split + * WIM. Software can provide this flag for convenience if it explicitly does + * not want to support split WIMs. */ +#define WIMLIB_OPEN_FLAG_ERROR_IF_SPLIT 0x00000002 + +/** Check if the WIM is writable and issue an error + * (::WIMLIB_ERR_WIM_IS_READONLY) if it is not. A WIM is considered writable + * only if it is writable at the filesystem level, does not have the + * <c>WIM_HDR_FLAG_READONLY</c> flag set in its header, and is not part of a + * spanned set. It is not required to provide this flag before attempting to + * make changes to the WIM, but with this flag you get an error immediately + * rather than potentially much later, when wimlib_overwrite() is finally + * called. */ +#define WIMLIB_OPEN_FLAG_WRITE_ACCESS 0x00000004 + +/** @} */ +/** @addtogroup G_mounting_wim_images + * @{ */ + +/** Provide ::WIMLIB_WRITE_FLAG_CHECK_INTEGRITY when committing the WIM image. + * Ignored if ::WIMLIB_UNMOUNT_FLAG_COMMIT not also specified. */ +#define WIMLIB_UNMOUNT_FLAG_CHECK_INTEGRITY 0x00000001 + +/** Commit changes to the read-write mounted WIM image. + * If this flag is not specified, changes will be discarded. */ +#define WIMLIB_UNMOUNT_FLAG_COMMIT 0x00000002 + +/** Provide ::WIMLIB_WRITE_FLAG_REBUILD when committing the WIM image. + * Ignored if ::WIMLIB_UNMOUNT_FLAG_COMMIT not also specified. */ +#define WIMLIB_UNMOUNT_FLAG_REBUILD 0x00000004 + +/** Provide ::WIMLIB_WRITE_FLAG_RECOMPRESS when committing the WIM image. + * Ignored if ::WIMLIB_UNMOUNT_FLAG_COMMIT not also specified. */ +#define WIMLIB_UNMOUNT_FLAG_RECOMPRESS 0x00000008 + +/** + * In combination with ::WIMLIB_UNMOUNT_FLAG_COMMIT for a read-write mounted WIM + * image, forces all file descriptors to the open WIM image to be closed before + * committing it. + * + * Without ::WIMLIB_UNMOUNT_FLAG_COMMIT or with a read-only mounted WIM image, + * this flag has no effect. + */ +#define WIMLIB_UNMOUNT_FLAG_FORCE 0x00000010 + +/** In combination with ::WIMLIB_UNMOUNT_FLAG_COMMIT for a read-write mounted + * WIM image, causes the modified image to be committed to the WIM file as a + * new, unnamed image appended to the archive. The original image in the WIM + * file will be unmodified. */ +#define WIMLIB_UNMOUNT_FLAG_NEW_IMAGE 0x00000020 + +/** @} */ +/** @addtogroup G_modifying_wims + * @{ */ + +/** Send ::WIMLIB_PROGRESS_MSG_UPDATE_BEGIN_COMMAND and + * ::WIMLIB_PROGRESS_MSG_UPDATE_END_COMMAND messages. */ +#define WIMLIB_UPDATE_FLAG_SEND_PROGRESS 0x00000001 + +/** @} */ +/** @addtogroup G_writing_and_overwriting_wims + * @{ */ + +/** + * Include an integrity table in the resulting WIM file. + * + * For ::WIMStruct's created with wimlib_open_wim(), the default behavior is to + * include an integrity table if and only if one was present before. For + * ::WIMStruct's created with wimlib_create_new_wim(), the default behavior is + * to not include an integrity table. + */ +#define WIMLIB_WRITE_FLAG_CHECK_INTEGRITY 0x00000001 + +/** + * Do not include an integrity table in the resulting WIM file. This is the + * default behavior, unless the ::WIMStruct was created by opening a WIM with an + * integrity table. + */ +#define WIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY 0x00000002 + +/** + * Write the WIM as "pipable". After writing a WIM with this flag specified, + * images from it can be applied directly from a pipe using + * wimlib_extract_image_from_pipe(). See the documentation for the + * <b>--pipable</b> option of <b>wimcapture</b> for more information. Beware: + * WIMs written with this flag will not be compatible with Microsoft's software. + * + * For ::WIMStruct's created with wimlib_open_wim(), the default behavior is to + * write the WIM as pipable if and only if it was pipable before. For + * ::WIMStruct's created with wimlib_create_new_wim(), the default behavior is + * to write the WIM as non-pipable. + */ +#define WIMLIB_WRITE_FLAG_PIPABLE 0x00000004 + +/** + * Do not write the WIM as "pipable". This is the default behavior, unless the + * ::WIMStruct was created by opening a pipable WIM. + */ +#define WIMLIB_WRITE_FLAG_NOT_PIPABLE 0x00000008 + +/** + * When writing data to the WIM file, recompress it, even if the data is already + * available in the desired compressed form (for example, in a WIM file from + * which an image has been exported using wimlib_export_image()). + * + * ::WIMLIB_WRITE_FLAG_RECOMPRESS can be used to recompress with a higher + * compression ratio for the same compression type and chunk size. Simply using + * the default compression settings may suffice for this, especially if the WIM + * file was created using another program/library that may not use as + * sophisticated compression algorithms. Or, + * wimlib_set_default_compression_level() can be called beforehand to set an + * even higher compression level than the default. + * + * If the WIM contains solid resources, then ::WIMLIB_WRITE_FLAG_RECOMPRESS can + * be used in combination with ::WIMLIB_WRITE_FLAG_SOLID to prevent any solid + * resources from being re-used. Otherwise, solid resources are re-used + * somewhat more liberally than normal compressed resources. + * + * ::WIMLIB_WRITE_FLAG_RECOMPRESS does <b>not</b> cause recompression of data + * that would not otherwise be written. For example, a call to + * wimlib_overwrite() with ::WIMLIB_WRITE_FLAG_RECOMPRESS will not, by itself, + * cause already-existing data in the WIM file to be recompressed. To force the + * WIM file to be fully rebuilt and recompressed, combine + * ::WIMLIB_WRITE_FLAG_RECOMPRESS with ::WIMLIB_WRITE_FLAG_REBUILD. + */ +#define WIMLIB_WRITE_FLAG_RECOMPRESS 0x00000010 + +/** + * Immediately before closing the WIM file, sync its data to disk. + * + * This flag forces the function to wait until the data is safely on disk before + * returning success. Otherwise, modern operating systems tend to cache data + * for some time (in some cases, 30+ seconds) before actually writing it to + * disk, even after reporting to the application that the writes have succeeded. + * + * wimlib_overwrite() will set this flag automatically if it decides to + * overwrite the WIM file via a temporary file instead of in-place. This is + * necessary on POSIX systems; it will, for example, avoid problems with delayed + * allocation on ext4. + */ +#define WIMLIB_WRITE_FLAG_FSYNC 0x00000020 + +/** + * For wimlib_overwrite(): rebuild the entire WIM file, even if it otherwise + * could be updated in-place by appending to it. Any data that existed in the + * original WIM file but is not actually needed by any of the remaining images + * will not be included. This can free up space left over after previous + * in-place modifications to the WIM file. + * + * This flag can be combined with ::WIMLIB_WRITE_FLAG_RECOMPRESS to force all + * data to be recompressed. Otherwise, compressed data is re-used if possible. + * + * wimlib_write() ignores this flag. + */ +#define WIMLIB_WRITE_FLAG_REBUILD 0x00000040 + +/** + * For wimlib_overwrite(): override the default behavior after one or more calls + * to wimlib_delete_image(), which is to rebuild the entire WIM file. With this + * flag, only minimal changes to correctly remove the image from the WIM file + * will be taken. This can be much faster, but it will result in the WIM file + * getting larger rather than smaller. + * + * wimlib_write() ignores this flag. + */ +#define WIMLIB_WRITE_FLAG_SOFT_DELETE 0x00000080 + +/** + * For wimlib_overwrite(), allow overwriting the WIM file even if the readonly + * flag (<c>WIM_HDR_FLAG_READONLY</c>) is set in the WIM header. This can be + * used following a call to wimlib_set_wim_info() with the + * ::WIMLIB_CHANGE_READONLY_FLAG flag to actually set the readonly flag on the + * on-disk WIM file. + * + * wimlib_write() ignores this flag. + */ +#define WIMLIB_WRITE_FLAG_IGNORE_READONLY_FLAG 0x00000100 + +/** + * Do not include file data already present in other WIMs. This flag can be + * used to write a "delta" WIM after the WIM files on which the delta is to be + * based were referenced with wimlib_reference_resource_files() or + * wimlib_reference_resources(). + */ +#define WIMLIB_WRITE_FLAG_SKIP_EXTERNAL_WIMS 0x00000200 + +/** Deprecated; this flag should not be used outside of the library itself. */ +#define WIMLIB_WRITE_FLAG_STREAMS_OK 0x00000400 + +/** + * For wimlib_write(), retain the WIM's GUID instead of generating a new one. + * + * wimlib_overwrite() sets this by default, since the WIM remains, logically, + * the same file. + */ +#define WIMLIB_WRITE_FLAG_RETAIN_GUID 0x00000800 + +/** + * Concatenate files and compress them together, rather than compress each file + * independently. This is also known as creating a "solid archive". This tends + * to produce a better compression ratio at the cost of much slower random + * access. + * + * WIM files created with this flag are only compatible with wimlib v1.6.0 or + * later, WIMGAPI Windows 8 or later, and DISM Windows 8.1 or later. WIM files + * created with this flag use a different version number in their header (3584 + * instead of 68864) and are also called "ESD files". + * + * Note that providing this flag does not affect the "append by default" + * behavior of wimlib_overwrite(). In other words, wimlib_overwrite() with just + * ::WIMLIB_WRITE_FLAG_SOLID can be used to append solid-compressed data to a + * WIM file that originally did not contain any solid-compressed data. But if + * you instead want to rebuild and recompress an entire WIM file in solid mode, + * then also provide ::WIMLIB_WRITE_FLAG_REBUILD and + * ::WIMLIB_WRITE_FLAG_RECOMPRESS. + * + * Currently, new solid resources will, by default, be written using LZMS + * compression with 64 MiB (67108864 byte) chunks. Use + * wimlib_set_output_pack_compression_type() and/or + * wimlib_set_output_pack_chunk_size() to change this. This is independent of + * the WIM's main compression type and chunk size; you can have a WIM that + * nominally uses LZX compression and 32768 byte chunks but actually contains + * LZMS-compressed solid resources, for example. However, if including solid + * resources, I suggest that you set the WIM's main compression type to LZMS as + * well, either by creating the WIM with + * ::wimlib_create_new_wim(::WIMLIB_COMPRESSION_TYPE_LZMS, ...) or by calling + * ::wimlib_set_output_compression_type(..., ::WIMLIB_COMPRESSION_TYPE_LZMS). + * + * This flag will be set by default when writing or overwriting a WIM file that + * either already contains solid resources, or has had solid resources exported + * into it and the WIM's main compression type is LZMS. + */ +#define WIMLIB_WRITE_FLAG_SOLID 0x00001000 + +/** + * Send ::WIMLIB_PROGRESS_MSG_DONE_WITH_FILE messages while writing the WIM + * file. This is only needed in the unusual case that the library user needs to + * know exactly when wimlib has read each file for the last time. + */ +#define WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES 0x00002000 + +/** + * Do not consider content similarity when arranging file data for solid + * compression. Providing this flag will typically worsen the compression + * ratio, so only provide this flag if you know what you are doing. + */ +#define WIMLIB_WRITE_FLAG_NO_SOLID_SORT 0x00004000 + +/** + * Since wimlib v1.8.3 and for wimlib_overwrite() only: <b>unsafely</b> compact + * the WIM file in-place, without appending. Existing resources are shifted + * down to fill holes and new resources are appended as needed. The WIM file is + * truncated to its final size, which may shrink the on-disk file. <b>This + * operation cannot be safely interrupted. If the operation is interrupted, + * then the WIM file will be corrupted, and it may be impossible (or at least + * very difficult) to recover any data from it. Users of this flag are expected + * to know what they are doing and assume responsibility for any data corruption + * that may result.</b> + * + * If the WIM file cannot be compacted in-place because of its structure, its + * layout, or other requested write parameters, then wimlib_overwrite() fails + * with ::WIMLIB_ERR_COMPACTION_NOT_POSSIBLE, and the caller may wish to retry + * the operation without this flag. + */ +#define WIMLIB_WRITE_FLAG_UNSAFE_COMPACT 0x00008000 + +/** @} */ +/** @addtogroup G_general + * @{ */ + +/** Deprecated; no longer has any effect. */ +#define WIMLIB_INIT_FLAG_ASSUME_UTF8 0x00000001 + +/** Windows-only: do not attempt to acquire additional privileges (currently + * SeBackupPrivilege, SeRestorePrivilege, SeSecurityPrivilege, + * SeTakeOwnershipPrivilege, and SeManageVolumePrivilege) when initializing the + * library. This flag is intended for the case where the calling program + * manages these privileges itself. Note: by default, no error is issued if + * privileges cannot be acquired, although related errors may be reported later, + * depending on if the operations performed actually require additional + * privileges or not. */ +#define WIMLIB_INIT_FLAG_DONT_ACQUIRE_PRIVILEGES 0x00000002 + +/** Windows only: If ::WIMLIB_INIT_FLAG_DONT_ACQUIRE_PRIVILEGES not specified, + * return ::WIMLIB_ERR_INSUFFICIENT_PRIVILEGES if privileges that may be needed + * to read all possible data and metadata for a capture operation could not be + * acquired. Can be combined with ::WIMLIB_INIT_FLAG_STRICT_APPLY_PRIVILEGES. + */ +#define WIMLIB_INIT_FLAG_STRICT_CAPTURE_PRIVILEGES 0x00000004 + +/** Windows only: If ::WIMLIB_INIT_FLAG_DONT_ACQUIRE_PRIVILEGES not specified, + * return ::WIMLIB_ERR_INSUFFICIENT_PRIVILEGES if privileges that may be needed + * to restore all possible data and metadata for an apply operation could not be + * acquired. Can be combined with ::WIMLIB_INIT_FLAG_STRICT_CAPTURE_PRIVILEGES. + */ +#define WIMLIB_INIT_FLAG_STRICT_APPLY_PRIVILEGES 0x00000008 + +/** Default to interpreting WIM paths case sensitively (default on UNIX-like + * systems). */ +#define WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE 0x00000010 + +/** Default to interpreting WIM paths case insensitively (default on Windows). + * This does not apply to mounted images. */ +#define WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE 0x00000020 + +/** @} */ +/** @addtogroup G_nonstandalone_wims + * @{ */ + +/** For wimlib_reference_resource_files(), enable shell-style filename globbing. + * Ignored by wimlib_reference_resources(). */ +#define WIMLIB_REF_FLAG_GLOB_ENABLE 0x00000001 + +/** For wimlib_reference_resource_files(), issue an error + * (::WIMLIB_ERR_GLOB_HAD_NO_MATCHES) if a glob did not match any files. The + * default behavior without this flag is to issue no error at that point, but + * then attempt to open the glob as a literal path, which of course will fail + * anyway if no file exists at that path. No effect if + * ::WIMLIB_REF_FLAG_GLOB_ENABLE is not also specified. Ignored by + * wimlib_reference_resources(). */ +#define WIMLIB_REF_FLAG_GLOB_ERR_ON_NOMATCH 0x00000002 + +/** @} */ +/** @addtogroup G_modifying_wims + * @{ */ + +/** The specific type of update to perform. */ +enum wimlib_update_op { + /** Add a new file or directory tree to the image. */ + WIMLIB_UPDATE_OP_ADD = 0, + + /** Delete a file or directory tree from the image. */ + WIMLIB_UPDATE_OP_DELETE = 1, + + /** Rename a file or directory tree in the image. */ + WIMLIB_UPDATE_OP_RENAME = 2, +}; + +/** Data for a ::WIMLIB_UPDATE_OP_ADD operation. */ +struct wimlib_add_command { + /** Filesystem path to the file or directory tree to add. */ + wimlib_tchar *fs_source_path; + + /** Destination path in the image. To specify the root directory of the + * image, use ::WIMLIB_WIM_ROOT_PATH. */ + wimlib_tchar *wim_target_path; + + /** Path to capture configuration file to use, or @c NULL if not + * specified. */ + wimlib_tchar *config_file; + + /** Bitwise OR of WIMLIB_ADD_FLAG_* flags. */ + int add_flags; +}; + +/** Data for a ::WIMLIB_UPDATE_OP_DELETE operation. */ +struct wimlib_delete_command { + + /** The path to the file or directory within the image to delete. */ + wimlib_tchar *wim_path; + + /** Bitwise OR of WIMLIB_DELETE_FLAG_* flags. */ + int delete_flags; +}; + +/** Data for a ::WIMLIB_UPDATE_OP_RENAME operation. */ +struct wimlib_rename_command { + + /** The path to the source file or directory within the image. */ + wimlib_tchar *wim_source_path; + + /** The path to the destination file or directory within the image. */ + wimlib_tchar *wim_target_path; + + /** Reserved; set to 0. */ + int rename_flags; +}; + +/** Specification of an update to perform on a WIM image. */ +struct wimlib_update_command { + + enum wimlib_update_op op; + + union { + struct wimlib_add_command add; + struct wimlib_delete_command delete_; /* Underscore is for C++ + compatibility. */ + struct wimlib_rename_command rename; + }; +}; + +/** @} */ +/** @addtogroup G_general + * @{ */ + +/** + * Possible values of the error code returned by many functions in wimlib. + * + * See the documentation for each wimlib function to see specifically what error + * codes can be returned by a given function, and what they mean. + */ +enum wimlib_error_code { + WIMLIB_ERR_SUCCESS = 0, + WIMLIB_ERR_ALREADY_LOCKED = 1, + WIMLIB_ERR_DECOMPRESSION = 2, + WIMLIB_ERR_FUSE = 6, + WIMLIB_ERR_GLOB_HAD_NO_MATCHES = 8, + WIMLIB_ERR_IMAGE_COUNT = 10, + WIMLIB_ERR_IMAGE_NAME_COLLISION = 11, + WIMLIB_ERR_INSUFFICIENT_PRIVILEGES = 12, + WIMLIB_ERR_INTEGRITY = 13, + WIMLIB_ERR_INVALID_CAPTURE_CONFIG = 14, + WIMLIB_ERR_INVALID_CHUNK_SIZE = 15, + WIMLIB_ERR_INVALID_COMPRESSION_TYPE = 16, + WIMLIB_ERR_INVALID_HEADER = 17, + WIMLIB_ERR_INVALID_IMAGE = 18, + WIMLIB_ERR_INVALID_INTEGRITY_TABLE = 19, + WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY = 20, + WIMLIB_ERR_INVALID_METADATA_RESOURCE = 21, + WIMLIB_ERR_INVALID_OVERLAY = 23, + WIMLIB_ERR_INVALID_PARAM = 24, + WIMLIB_ERR_INVALID_PART_NUMBER = 25, + WIMLIB_ERR_INVALID_PIPABLE_WIM = 26, + WIMLIB_ERR_INVALID_REPARSE_DATA = 27, + WIMLIB_ERR_INVALID_RESOURCE_HASH = 28, + WIMLIB_ERR_INVALID_UTF16_STRING = 30, + WIMLIB_ERR_INVALID_UTF8_STRING = 31, + WIMLIB_ERR_IS_DIRECTORY = 32, + WIMLIB_ERR_IS_SPLIT_WIM = 33, + WIMLIB_ERR_LINK = 35, + WIMLIB_ERR_METADATA_NOT_FOUND = 36, + WIMLIB_ERR_MKDIR = 37, + WIMLIB_ERR_MQUEUE = 38, + WIMLIB_ERR_NOMEM = 39, + WIMLIB_ERR_NOTDIR = 40, + WIMLIB_ERR_NOTEMPTY = 41, + WIMLIB_ERR_NOT_A_REGULAR_FILE = 42, + WIMLIB_ERR_NOT_A_WIM_FILE = 43, + WIMLIB_ERR_NOT_PIPABLE = 44, + WIMLIB_ERR_NO_FILENAME = 45, + WIMLIB_ERR_NTFS_3G = 46, + WIMLIB_ERR_OPEN = 47, + WIMLIB_ERR_OPENDIR = 48, + WIMLIB_ERR_PATH_DOES_NOT_EXIST = 49, + WIMLIB_ERR_READ = 50, + WIMLIB_ERR_READLINK = 51, + WIMLIB_ERR_RENAME = 52, + WIMLIB_ERR_REPARSE_POINT_FIXUP_FAILED = 54, + WIMLIB_ERR_RESOURCE_NOT_FOUND = 55, + WIMLIB_ERR_RESOURCE_ORDER = 56, + WIMLIB_ERR_SET_ATTRIBUTES = 57, + WIMLIB_ERR_SET_REPARSE_DATA = 58, + WIMLIB_ERR_SET_SECURITY = 59, + WIMLIB_ERR_SET_SHORT_NAME = 60, + WIMLIB_ERR_SET_TIMESTAMPS = 61, + WIMLIB_ERR_SPLIT_INVALID = 62, + WIMLIB_ERR_STAT = 63, + WIMLIB_ERR_UNEXPECTED_END_OF_FILE = 65, + WIMLIB_ERR_UNICODE_STRING_NOT_REPRESENTABLE = 66, + WIMLIB_ERR_UNKNOWN_VERSION = 67, + WIMLIB_ERR_UNSUPPORTED = 68, + WIMLIB_ERR_UNSUPPORTED_FILE = 69, + WIMLIB_ERR_WIM_IS_READONLY = 71, + WIMLIB_ERR_WRITE = 72, + WIMLIB_ERR_XML = 73, + WIMLIB_ERR_WIM_IS_ENCRYPTED = 74, + WIMLIB_ERR_WIMBOOT = 75, + WIMLIB_ERR_ABORTED_BY_PROGRESS = 76, + WIMLIB_ERR_UNKNOWN_PROGRESS_STATUS = 77, + WIMLIB_ERR_MKNOD = 78, + WIMLIB_ERR_MOUNTED_IMAGE_IS_BUSY = 79, + WIMLIB_ERR_NOT_A_MOUNTPOINT = 80, + WIMLIB_ERR_NOT_PERMITTED_TO_UNMOUNT = 81, + WIMLIB_ERR_FVE_LOCKED_VOLUME = 82, + WIMLIB_ERR_UNABLE_TO_READ_CAPTURE_CONFIG = 83, + WIMLIB_ERR_WIM_IS_INCOMPLETE = 84, + WIMLIB_ERR_COMPACTION_NOT_POSSIBLE = 85, + WIMLIB_ERR_IMAGE_HAS_MULTIPLE_REFERENCES = 86, + WIMLIB_ERR_DUPLICATE_EXPORTED_IMAGE = 87, + WIMLIB_ERR_CONCURRENT_MODIFICATION_DETECTED = 88, + WIMLIB_ERR_SNAPSHOT_FAILURE = 89, + WIMLIB_ERR_INVALID_XATTR = 90, + WIMLIB_ERR_SET_XATTR = 91, +}; + + +/** Used to indicate no image or an invalid image. */ +#define WIMLIB_NO_IMAGE 0 + +/** Used to specify all images in the WIM. */ +#define WIMLIB_ALL_IMAGES (-1) + +/** @} */ + +/** + * @ingroup G_modifying_wims + * + * Append an empty image to a ::WIMStruct. + * + * The new image will initially contain no files or directories, although if + * written without further modifications, then a root directory will be created + * automatically for it. + * + * After calling this function, you can use wimlib_update_image() to add files + * to the new image. This gives you more control over making the new image + * compared to calling wimlib_add_image() or wimlib_add_image_multisource(). + * + * @param wim + * Pointer to the ::WIMStruct to which to add the image. + * @param name + * Name to give the new image. If @c NULL or empty, the new image is given + * no name. If nonempty, it must specify a name that does not already + * exist in @p wim. + * @param new_idx_ret + * If non-<c>NULL</c>, the index of the newly added image is returned in + * this location. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_IMAGE_NAME_COLLISION + * The WIM already contains an image with the requested name. + */ +WIMLIBAPI int +wimlib_add_empty_image(WIMStruct *wim, + const wimlib_tchar *name, + int *new_idx_ret); + +/** + * @ingroup G_modifying_wims + * + * Add an image to a ::WIMStruct from an on-disk directory tree or NTFS volume. + * + * The directory tree or NTFS volume is scanned immediately to load the dentry + * tree into memory, and file metadata is read. However, actual file data may + * not be read until the ::WIMStruct is persisted to disk using wimlib_write() + * or wimlib_overwrite(). + * + * See the documentation for the @b wimlib-imagex program for more information + * about the "normal" capture mode versus the NTFS capture mode (entered by + * providing the flag ::WIMLIB_ADD_FLAG_NTFS). + * + * Note that no changes are committed to disk until wimlib_write() or + * wimlib_overwrite() is called. + * + * @param wim + * Pointer to the ::WIMStruct to which to add the image. + * @param source + * A path to a directory or unmounted NTFS volume that will be captured as + * a WIM image. + * @param name + * Name to give the new image. If @c NULL or empty, the new image is given + * no name. If nonempty, it must specify a name that does not already + * exist in @p wim. + * @param config_file + * Path to capture configuration file, or @c NULL. This file may specify, + * among other things, which files to exclude from capture. See the + * documentation for <b>wimcapture</b> (<b>--config</b> option) for details + * of the file format. If @c NULL, the default capture configuration will + * be used. Ordinarily, the default capture configuration will result in + * no files being excluded from capture purely based on name; however, the + * ::WIMLIB_ADD_FLAG_WINCONFIG and ::WIMLIB_ADD_FLAG_WIMBOOT flags modify + * the default. + * @param add_flags + * Bitwise OR of flags prefixed with WIMLIB_ADD_FLAG. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * This function is implemented by calling wimlib_add_empty_image(), then + * calling wimlib_update_image() with a single "add" command, so any error code + * returned by wimlib_add_empty_image() may be returned, as well as any error + * codes returned by wimlib_update_image() other than ones documented as only + * being returned specifically by an update involving delete or rename commands. + * + * If a progress function is registered with @p wim, then it will receive the + * messages ::WIMLIB_PROGRESS_MSG_SCAN_BEGIN and ::WIMLIB_PROGRESS_MSG_SCAN_END. + * In addition, if ::WIMLIB_ADD_FLAG_VERBOSE is specified in @p add_flags, it + * will receive ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY. + */ +WIMLIBAPI int +wimlib_add_image(WIMStruct *wim, + const wimlib_tchar *source, + const wimlib_tchar *name, + const wimlib_tchar *config_file, + int add_flags); + +/** + * @ingroup G_modifying_wims + * + * This function is equivalent to wimlib_add_image() except it allows for + * multiple sources to be combined into a single WIM image. This is done by + * specifying the @p sources and @p num_sources parameters instead of the @p + * source parameter of wimlib_add_image(). The rest of the parameters are the + * same as wimlib_add_image(). See the documentation for <b>wimcapture</b> for + * full details on how this mode works. + */ +WIMLIBAPI int +wimlib_add_image_multisource(WIMStruct *wim, + const struct wimlib_capture_source *sources, + size_t num_sources, + const wimlib_tchar *name, + const wimlib_tchar *config_file, + int add_flags); + +/** + * @ingroup G_modifying_wims + * + * Add the file or directory tree at @p fs_source_path on the filesystem to the + * location @p wim_target_path within the specified @p image of the @p wim. + * + * This just builds an appropriate ::wimlib_add_command and passes it to + * wimlib_update_image(). + */ +WIMLIBAPI int +wimlib_add_tree(WIMStruct *wim, int image, + const wimlib_tchar *fs_source_path, + const wimlib_tchar *wim_target_path, int add_flags); + +/** + * @ingroup G_creating_and_opening_wims + * + * Create a ::WIMStruct which initially contains no images and is not backed by + * an on-disk file. + * + * @param ctype + * The "output compression type" to assign to the ::WIMStruct. This is the + * compression type that will be used if the ::WIMStruct is later persisted + * to an on-disk file using wimlib_write(). + * <br/> + * This choice is not necessarily final. If desired, it can still be + * changed at any time before wimlib_write() is called, using + * wimlib_set_output_compression_type(). In addition, if you wish to use a + * non-default compression chunk size, then you will need to call + * wimlib_set_output_chunk_size(). + * @param wim_ret + * On success, a pointer to the new ::WIMStruct is written to the memory + * location pointed to by this parameter. This ::WIMStruct must be freed + * using wimlib_free() when finished with it. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_INVALID_COMPRESSION_TYPE + * @p ctype was not a supported compression type. + * @retval ::WIMLIB_ERR_NOMEM + * Insufficient memory to allocate a new ::WIMStruct. + */ +WIMLIBAPI int +wimlib_create_new_wim(enum wimlib_compression_type ctype, WIMStruct **wim_ret); + +/** + * @ingroup G_modifying_wims + * + * Delete an image, or all images, from a ::WIMStruct. + * + * Note that no changes are committed to disk until wimlib_write() or + * wimlib_overwrite() is called. + * + * @param wim + * Pointer to the ::WIMStruct from which to delete the image. + * @param image + * The 1-based index of the image to delete, or ::WIMLIB_ALL_IMAGES to + * delete all images. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_INVALID_IMAGE + * @p image does not exist in the WIM. + * + * This function can additionally return ::WIMLIB_ERR_DECOMPRESSION, + * ::WIMLIB_ERR_INVALID_METADATA_RESOURCE, ::WIMLIB_ERR_METADATA_NOT_FOUND, + * ::WIMLIB_ERR_READ, or ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE, all of which + * indicate failure (for different reasons) to read the metadata resource for an + * image that needed to be deleted. + * + * If this function fails when @p image was ::WIMLIB_ALL_IMAGES, then it's + * possible that some but not all of the images were deleted. + */ +WIMLIBAPI int +wimlib_delete_image(WIMStruct *wim, int image); + +/** + * @ingroup G_modifying_wims + * + * Delete the @p path from the specified @p image of the @p wim. + * + * This just builds an appropriate ::wimlib_delete_command and passes it to + * wimlib_update_image(). + */ +WIMLIBAPI int +wimlib_delete_path(WIMStruct *wim, int image, + const wimlib_tchar *path, int delete_flags); + +/** + * @ingroup G_modifying_wims + * + * Export an image, or all images, from a ::WIMStruct into another ::WIMStruct. + * + * Specifically, if the destination ::WIMStruct contains <tt>n</tt> images, then + * the source image(s) will be appended, in order, starting at destination index + * <tt>n + 1</tt>. By default, all image metadata will be exported verbatim, + * but certain changes can be made by passing appropriate parameters. + * + * wimlib_export_image() is only an in-memory operation; no changes are + * committed to disk until wimlib_write() or wimlib_overwrite() is called. + * + * A limitation of the current implementation of wimlib_export_image() is that + * the directory tree of a source or destination image cannot be updated + * following an export until one of the two images has been freed from memory. + * + * @param src_wim + * The WIM from which to export the images, specified as a pointer to the + * ::WIMStruct for a standalone WIM file, a delta WIM file, or part 1 of a + * split WIM. In the case of a WIM file that is not standalone, this + * ::WIMStruct must have had any needed external resources previously + * referenced using wimlib_reference_resources() or + * wimlib_reference_resource_files(). + * @param src_image + * The 1-based index of the image from @p src_wim to export, or + * ::WIMLIB_ALL_IMAGES. + * @param dest_wim + * The ::WIMStruct to which to export the images. + * @param dest_name + * For single-image exports, the name to give the exported image in @p + * dest_wim. If left @c NULL, the name from @p src_wim is used. For + * ::WIMLIB_ALL_IMAGES exports, this parameter must be left @c NULL; in + * that case, the names are all taken from @p src_wim. This parameter is + * overridden by ::WIMLIB_EXPORT_FLAG_NO_NAMES. + * @param dest_description + * For single-image exports, the description to give the exported image in + * the new WIM file. If left @c NULL, the description from @p src_wim is + * used. For ::WIMLIB_ALL_IMAGES exports, this parameter must be left @c + * NULL; in that case, the description are all taken from @p src_wim. This + * parameter is overridden by ::WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS. + * @param export_flags + * Bitwise OR of flags prefixed with WIMLIB_EXPORT_FLAG. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_DUPLICATE_EXPORTED_IMAGE + * One or more of the source images had already been exported into the + * destination WIM. + * @retval ::WIMLIB_ERR_IMAGE_NAME_COLLISION + * One or more of the names being given to an exported image was already in + * use in the destination WIM. + * @retval ::WIMLIB_ERR_INVALID_IMAGE + * @p src_image does not exist in @p src_wim. + * @retval ::WIMLIB_ERR_METADATA_NOT_FOUND + * At least one of @p src_wim and @p dest_wim does not contain image + * metadata; for example, one of them represents a non-first part of a + * split WIM. + * @retval ::WIMLIB_ERR_RESOURCE_NOT_FOUND + * A file data blob that needed to be exported could not be found in the + * blob lookup table of @p src_wim. See @ref G_nonstandalone_wims. + * + * This function can additionally return ::WIMLIB_ERR_DECOMPRESSION, + * ::WIMLIB_ERR_INVALID_METADATA_RESOURCE, ::WIMLIB_ERR_METADATA_NOT_FOUND, + * ::WIMLIB_ERR_READ, or ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE, all of which + * indicate failure (for different reasons) to read the metadata resource for an + * image in @p src_wim that needed to be exported. + */ +WIMLIBAPI int +wimlib_export_image(WIMStruct *src_wim, int src_image, + WIMStruct *dest_wim, + const wimlib_tchar *dest_name, + const wimlib_tchar *dest_description, + int export_flags); + +/** + * @ingroup G_extracting_wims + * + * Extract an image, or all images, from a ::WIMStruct. + * + * The exact behavior of how wimlib extracts files from a WIM image is + * controllable by the @p extract_flags parameter, but there also are + * differences depending on the platform (UNIX-like vs Windows). See the + * documentation for <b>wimapply</b> for more information, including about the + * NTFS-3G extraction mode. + * + * @param wim + * The WIM from which to extract the image(s), specified as a pointer to the + * ::WIMStruct for a standalone WIM file, a delta WIM file, or part 1 of a + * split WIM. In the case of a WIM file that is not standalone, this + * ::WIMStruct must have had any needed external resources previously + * referenced using wimlib_reference_resources() or + * wimlib_reference_resource_files(). + * @param image + * The 1-based index of the image to extract, or ::WIMLIB_ALL_IMAGES to + * extract all images. Note: ::WIMLIB_ALL_IMAGES is unsupported in NTFS-3G + * extraction mode. + * @param target + * A null-terminated string which names the location to which the image(s) + * will be extracted. By default, this is interpreted as a path to a + * directory. Alternatively, if ::WIMLIB_EXTRACT_FLAG_NTFS is specified in + * @p extract_flags, then this is interpreted as a path to an unmounted + * NTFS volume. + * @param extract_flags + * Bitwise OR of flags prefixed with WIMLIB_EXTRACT_FLAG. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_DECOMPRESSION + * The WIM file contains invalid compressed data. + * @retval ::WIMLIB_ERR_INVALID_IMAGE + * @p image does not exist in @p wim. + * @retval ::WIMLIB_ERR_INVALID_METADATA_RESOURCE + * The metadata for an image to extract was invalid. + * @retval ::WIMLIB_ERR_INVALID_PARAM + * The extraction flags were invalid; more details may be found in the + * documentation for the specific extraction flags that were specified. Or + * @p target was @c NULL or an empty string, or @p wim was @c NULL. + * @retval ::WIMLIB_ERR_INVALID_RESOURCE_HASH + * The data of a file that needed to be extracted was corrupt. + * @retval ::WIMLIB_ERR_LINK + * Failed to create a symbolic link or a hard link. + * @retval ::WIMLIB_ERR_METADATA_NOT_FOUND + * @p wim does not contain image metadata; for example, it represents a + * non-first part of a split WIM. + * @retval ::WIMLIB_ERR_MKDIR + * Failed create a directory. + * @retval ::WIMLIB_ERR_NTFS_3G + * libntfs-3g reported that a problem occurred while writing to the NTFS + * volume. + * @retval ::WIMLIB_ERR_OPEN + * Could not create a file, or failed to open an already-extracted file. + * @retval ::WIMLIB_ERR_READ + * Failed to read data from the WIM. + * @retval ::WIMLIB_ERR_READLINK + * Failed to determine the target of a symbolic link in the WIM. + * @retval ::WIMLIB_ERR_REPARSE_POINT_FIXUP_FAILED + * Failed to fix the target of an absolute symbolic link (e.g. if the + * target would have exceeded the maximum allowed length). (Only if + * reparse data was supported by the extraction mode and + * ::WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS was specified in @p + * extract_flags.) + * @retval ::WIMLIB_ERR_RESOURCE_NOT_FOUND + * A file data blob that needed to be extracted could not be found in the + * blob lookup table of @p wim. See @ref G_nonstandalone_wims. + * @retval ::WIMLIB_ERR_SET_ATTRIBUTES + * Failed to set attributes on a file. + * @retval ::WIMLIB_ERR_SET_REPARSE_DATA + * Failed to set reparse data on a file (only if reparse data was supported + * by the extraction mode). + * @retval ::WIMLIB_ERR_SET_SECURITY + * Failed to set security descriptor on a file. + * @retval ::WIMLIB_ERR_SET_SHORT_NAME + * Failed to set the short name of a file. + * @retval ::WIMLIB_ERR_SET_TIMESTAMPS + * Failed to set timestamps on a file. + * @retval ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE + * Unexpected end-of-file occurred when reading data from the WIM. + * @retval ::WIMLIB_ERR_UNSUPPORTED + * A requested extraction flag, or the data or metadata that must be + * extracted to support it, is unsupported in the build and configuration + * of wimlib, or on the current platform or extraction mode or target + * volume. Flags affected by this include ::WIMLIB_EXTRACT_FLAG_NTFS, + * ::WIMLIB_EXTRACT_FLAG_UNIX_DATA, ::WIMLIB_EXTRACT_FLAG_STRICT_ACLS, + * ::WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES, + * ::WIMLIB_EXTRACT_FLAG_STRICT_TIMESTAMPS, and + * ::WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS. For example, if + * ::WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES is specified in @p + * extract_flags, ::WIMLIB_ERR_UNSUPPORTED will be returned if the WIM + * image contains one or more files with short names, but extracting short + * names is not supported --- on Windows, this occurs if the target volume + * does not support short names, while on non-Windows, this occurs if + * ::WIMLIB_EXTRACT_FLAG_NTFS was not specified in @p extract_flags. + * @retval ::WIMLIB_ERR_WIMBOOT + * ::WIMLIB_EXTRACT_FLAG_WIMBOOT was specified in @p extract_flags, but + * there was a problem creating WIMBoot pointer files or registering a + * source WIM file with the Windows Overlay Filesystem (WOF) driver. + * @retval ::WIMLIB_ERR_WRITE + * Failed to write data to a file being extracted. + * + * If a progress function is registered with @p wim, then as each image is + * extracted it will receive ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN, then + * zero or more ::WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE messages, then zero + * or more ::WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS messages, then zero or more + * ::WIMLIB_PROGRESS_MSG_EXTRACT_METADATA messages, then + * ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_END. + */ +WIMLIBAPI int +wimlib_extract_image(WIMStruct *wim, int image, + const wimlib_tchar *target, int extract_flags); + +/** + * @ingroup G_extracting_wims + * + * Extract one image from a pipe on which a pipable WIM is being sent. + * + * See the documentation for ::WIMLIB_WRITE_FLAG_PIPABLE, and @ref + * subsec_pipable_wims, for more information about pipable WIMs. + * + * This function operates in a special way to read the WIM fully sequentially. + * As a result, there is no ::WIMStruct is made visible to library users, and + * you cannot call wimlib_open_wim() on the pipe. (You can, however, use + * wimlib_open_wim() to transparently open a pipable WIM if it's available as a + * seekable file, not a pipe.) + * + * @param pipe_fd + * File descriptor, which may be a pipe, opened for reading and positioned + * at the start of the pipable WIM. + * @param image_num_or_name + * String that specifies the 1-based index or name of the image to extract. + * It is translated to an image index using the same rules that + * wimlib_resolve_image() uses. However, unlike wimlib_extract_image(), + * only a single image (not all images) can be specified. Alternatively, + * specify @p NULL here to use the first image in the WIM if it contains + * exactly one image but otherwise return ::WIMLIB_ERR_INVALID_IMAGE. + * @param target + * Same as the corresponding parameter to wimlib_extract_image(). + * @param extract_flags + * Same as the corresponding parameter to wimlib_extract_image(). + * + * @return 0 on success; a ::wimlib_error_code value on failure. The possible + * error codes include those returned by wimlib_extract_image() and + * wimlib_open_wim() as well as the following: + * + * @retval ::WIMLIB_ERR_INVALID_PIPABLE_WIM + * Data read from the pipable WIM was invalid. + * @retval ::WIMLIB_ERR_NOT_PIPABLE + * The WIM being piped over @p pipe_fd is a normal WIM, not a pipable WIM. + */ +WIMLIBAPI int +wimlib_extract_image_from_pipe(int pipe_fd, + const wimlib_tchar *image_num_or_name, + const wimlib_tchar *target, int extract_flags); + +/** + * @ingroup G_extracting_wims + * + * Same as wimlib_extract_image_from_pipe(), but allows specifying a progress + * function. The progress function will be used while extracting the image and + * will receive the normal extraction progress messages, such as + * ::WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS, in addition to + * ::WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN. + */ +WIMLIBAPI int +wimlib_extract_image_from_pipe_with_progress(int pipe_fd, + const wimlib_tchar *image_num_or_name, + const wimlib_tchar *target, + int extract_flags, + wimlib_progress_func_t progfunc, + void *progctx); + +/** + * @ingroup G_extracting_wims + * + * Similar to wimlib_extract_paths(), but the paths to extract from the WIM + * image are specified in the ASCII, UTF-8, or UTF-16LE text file named by @p + * path_list_file which itself contains the list of paths to use, one per line. + * Leading and trailing whitespace is ignored. Empty lines and lines beginning + * with the ';' or '#' characters are ignored. No quotes are needed, as paths + * are otherwise delimited by the newline character. However, quotes will be + * stripped if present. + * + * If @p path_list_file is @c NULL, then the pathlist file is read from standard + * input. + * + * The error codes are the same as those returned by wimlib_extract_paths(), + * except that wimlib_extract_pathlist() returns an appropriate error code if it + * cannot read the path list file (e.g. ::WIMLIB_ERR_OPEN, ::WIMLIB_ERR_STAT, + * ::WIMLIB_ERR_READ). + */ +WIMLIBAPI int +wimlib_extract_pathlist(WIMStruct *wim, int image, + const wimlib_tchar *target, + const wimlib_tchar *path_list_file, + int extract_flags); + +/** + * @ingroup G_extracting_wims + * + * Extract zero or more paths (files or directory trees) from the specified WIM + * image. + * + * By default, each path will be extracted to a corresponding subdirectory of + * the target based on its location in the image. For example, if one of the + * paths to extract is <c>/Windows/explorer.exe</c> and the target is + * <c>outdir</c>, the file will be extracted to + * <c>outdir/Windows/explorer.exe</c>. This behavior can be changed by + * providing the flag ::WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE, which + * will cause each file or directory tree to be placed directly in the target + * directory --- so the same example would extract <c>/Windows/explorer.exe</c> + * to <c>outdir/explorer.exe</c>. + * + * With globbing turned off (the default), paths are always checked for + * existence strictly; that is, if any path to extract does not exist in the + * image, then nothing is extracted and the function fails with + * ::WIMLIB_ERR_PATH_DOES_NOT_EXIST. But with globbing turned on + * (::WIMLIB_EXTRACT_FLAG_GLOB_PATHS specified), globs are by default permitted + * to match no files, and there is a flag (::WIMLIB_EXTRACT_FLAG_STRICT_GLOB) to + * enable the strict behavior if desired. + * + * Symbolic links are not dereferenced when paths in the image are interpreted. + * + * @param wim + * WIM from which to extract the paths, specified as a pointer to the + * ::WIMStruct for a standalone WIM file, a delta WIM file, or part 1 of a + * split WIM. In the case of a WIM file that is not standalone, this + * ::WIMStruct must have had any needed external resources previously + * referenced using wimlib_reference_resources() or + * wimlib_reference_resource_files(). + * @param image + * The 1-based index of the WIM image from which to extract the paths. + * @param paths + * Array of paths to extract. Each element must be the absolute path to a + * file or directory within the image. Path separators may be either + * forwards or backwards slashes, and leading path separators are optional. + * The paths will be interpreted either case-sensitively (UNIX default) or + * case-insensitively (Windows default); however, the case sensitivity can + * be configured explicitly at library initialization time by passing an + * appropriate flag to wimlib_global_init(). + * <br/> + * By default, "globbing" is disabled, so the characters @c * and @c ? are + * interpreted literally. This can be changed by specifying + * ::WIMLIB_EXTRACT_FLAG_GLOB_PATHS in @p extract_flags. + * @param num_paths + * Number of paths specified in @p paths. + * @param target + * Directory to which to extract the paths. + * @param extract_flags + * Bitwise OR of flags prefixed with WIMLIB_EXTRACT_FLAG. + * + * @return 0 on success; a ::wimlib_error_code value on failure. Most of the + * error codes are the same as those returned by wimlib_extract_image(). Below, + * some of the error codes returned in situations specific to path-mode + * extraction are documented: + * + * @retval ::WIMLIB_ERR_NOT_A_REGULAR_FILE + * ::WIMLIB_EXTRACT_FLAG_TO_STDOUT was specified in @p extract_flags, but + * one of the paths to extract did not name a regular file. + * @retval ::WIMLIB_ERR_PATH_DOES_NOT_EXIST + * One of the paths to extract does not exist in the image; see discussion + * above about strict vs. non-strict behavior. + * + * If a progress function is registered with @p wim, then it will receive + * ::WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS. + */ +WIMLIBAPI int +wimlib_extract_paths(WIMStruct *wim, + int image, + const wimlib_tchar *target, + const wimlib_tchar * const *paths, + size_t num_paths, + int extract_flags); + +/** + * @ingroup G_wim_information + * + * Similar to wimlib_get_xml_data(), but the XML document will be written to the + * specified standard C <c>FILE*</c> instead of retrieved in an in-memory + * buffer. + * + * @return 0 on success; a ::wimlib_error_code value on failure. This may + * return any error code which can be returned by wimlib_get_xml_data() as well + * as the following error codes: + * + * @retval ::WIMLIB_ERR_WRITE + * Failed to write the data to the requested file. + */ +WIMLIBAPI int +wimlib_extract_xml_data(WIMStruct *wim, FILE *fp); + +/** + * @ingroup G_general + * + * Release a reference to a ::WIMStruct. If the ::WIMStruct is still referenced + * by other ::WIMStruct's (e.g. following calls to wimlib_export_image() or + * wimlib_reference_resources()), then the library will free it later, when the + * last reference is released; otherwise it is freed immediately and any + * associated file descriptors are closed. + * + * @param wim + * Pointer to the ::WIMStruct to release. If @c NULL, no action is taken. + */ +WIMLIBAPI void +wimlib_free(WIMStruct *wim); + +/** + * @ingroup G_general + * + * Convert a ::wimlib_compression_type value into a string. + * + * @param ctype + * The compression type value to convert. + * + * @return + * A statically allocated string naming the compression type, such as + * "None", "LZX", or "XPRESS". If the value was unrecognized, then + * the resulting string will be "Invalid". + */ +WIMLIBAPI const wimlib_tchar * +wimlib_get_compression_type_string(enum wimlib_compression_type ctype); + +/** + * @ingroup G_general + * + * Convert a wimlib error code into a string describing it. + * + * @param code + * An error code returned by one of wimlib's functions. + * + * @return + * Pointer to a statically allocated string describing the error code. If + * the value was unrecognized, then the resulting string will be "Unknown + * error". + */ +WIMLIBAPI const wimlib_tchar * +wimlib_get_error_string(enum wimlib_error_code code); + +/** + * @ingroup G_wim_information + * + * Get the description of the specified image. Equivalent to + * <tt>wimlib_get_image_property(wim, image, "DESCRIPTION")</tt>. + */ +WIMLIBAPI const wimlib_tchar * +wimlib_get_image_description(const WIMStruct *wim, int image); + +/** + * @ingroup G_wim_information + * + * Get the name of the specified image. Equivalent to + * <tt>wimlib_get_image_property(wim, image, "NAME")</tt>, except that + * wimlib_get_image_name() will return an empty string if the image is unnamed + * whereas wimlib_get_image_property() may return @c NULL in that case. + */ +WIMLIBAPI const wimlib_tchar * +wimlib_get_image_name(const WIMStruct *wim, int image); + +/** + * @ingroup G_wim_information + * + * Since wimlib v1.8.3: get a per-image property from the WIM's XML document. + * This is an alternative to wimlib_get_image_name() and + * wimlib_get_image_description() which allows getting any simple string + * property. + * + * @param wim + * Pointer to the ::WIMStruct for the WIM. + * @param image + * The 1-based index of the image for which to get the property. + * @param property_name + * The name of the image property, for example "NAME", "DESCRIPTION", or + * "TOTALBYTES". The name can contain forward slashes to indicate a nested + * XML element; for example, "WINDOWS/VERSION/BUILD" indicates the BUILD + * element nested within the VERSION element nested within the WINDOWS + * element. Since wimlib v1.9.0, a bracketed number can be used to + * indicate one of several identically-named elements; for example, + * "WINDOWS/LANGUAGES/LANGUAGE[2]" indicates the second "LANGUAGE" element + * nested within the "WINDOWS/LANGUAGES" element. Note that element names + * are case sensitive. + * + * @return + * The property's value as a ::wimlib_tchar string, or @c NULL if there is + * no such property. The string may not remain valid after later library + * calls, so the caller should duplicate it if needed. + */ +WIMLIBAPI const wimlib_tchar * +wimlib_get_image_property(const WIMStruct *wim, int image, + const wimlib_tchar *property_name); + +/** + * @ingroup G_general + * + * Return the version of wimlib as a 32-bit number whose top 12 bits contain the + * major version, the next 10 bits contain the minor version, and the low 10 + * bits contain the patch version. + * + * In other words, the returned value is equal to <c>((WIMLIB_MAJOR_VERSION << + * 20) | (WIMLIB_MINOR_VERSION << 10) | WIMLIB_PATCH_VERSION)</c> for the + * corresponding header file. + */ +WIMLIBAPI uint32_t +wimlib_get_version(void); + +/** + * @ingroup G_general + * + * Since wimlib v1.13.0: like wimlib_get_version(), but returns the full + * PACKAGE_VERSION string that was set at build time. (This allows a beta + * release to be distinguished from an official release.) + */ +WIMLIBAPI const wimlib_tchar * +wimlib_get_version_string(void); + +/** + * @ingroup G_wim_information + * + * Get basic information about a WIM file. + * + * @param wim + * Pointer to the ::WIMStruct to query. This need not represent a + * standalone WIM (e.g. it could represent part of a split WIM). + * @param info + * A ::wimlib_wim_info structure that will be filled in with information + * about the WIM file. + * + * @return 0 + */ +WIMLIBAPI int +wimlib_get_wim_info(WIMStruct *wim, struct wimlib_wim_info *info); + +/** + * @ingroup G_wim_information + * + * Read a WIM file's XML document into an in-memory buffer. + * + * The XML document contains metadata about the WIM file and the images stored + * in it. + * + * @param wim + * Pointer to the ::WIMStruct to query. This need not represent a + * standalone WIM (e.g. it could represent part of a split WIM). + * @param buf_ret + * On success, a pointer to an allocated buffer containing the raw UTF16-LE + * XML document is written to this location. + * @param bufsize_ret + * The size of the XML document in bytes is written to this location. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_NO_FILENAME + * @p wim is not backed by a file and therefore does not have an XML + * document. + * @retval ::WIMLIB_ERR_READ + * Failed to read the XML document from the WIM file. + * @retval ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE + * Failed to read the XML document from the WIM file. + */ +WIMLIBAPI int +wimlib_get_xml_data(WIMStruct *wim, void **buf_ret, size_t *bufsize_ret); + +/** + * @ingroup G_general + * + * Initialization function for wimlib. Call before using any other wimlib + * function (except possibly wimlib_set_print_errors()). If not done manually, + * this function will be called automatically with a flags argument of 0. This + * function does nothing if called again after it has already successfully run. + * + * @param init_flags + * Bitwise OR of flags prefixed with WIMLIB_INIT_FLAG. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_INSUFFICIENT_PRIVILEGES + * ::WIMLIB_INIT_FLAG_STRICT_APPLY_PRIVILEGES and/or + * ::WIMLIB_INIT_FLAG_STRICT_CAPTURE_PRIVILEGES were specified in @p + * init_flags, but the corresponding privileges could not be acquired. + */ +WIMLIBAPI int +wimlib_global_init(int init_flags); + +/** + * @ingroup G_general + * + * Cleanup function for wimlib. You are not required to call this function, but + * it will release any global resources allocated by the library. + */ +WIMLIBAPI void +wimlib_global_cleanup(void); + +/** + * @ingroup G_wim_information + * + * Determine if an image name is already used by some image in the WIM. + * + * @param wim + * Pointer to the ::WIMStruct to query. This need not represent a + * standalone WIM (e.g. it could represent part of a split WIM). + * @param name + * The name to check. + * + * @return + * @c true if there is already an image in @p wim named @p name; @c false + * if there is no image named @p name in @p wim. If @p name is @c NULL or + * the empty string, then @c false is returned. + */ +WIMLIBAPI bool +wimlib_image_name_in_use(const WIMStruct *wim, const wimlib_tchar *name); + +/** + * @ingroup G_wim_information + * + * Iterate through a file or directory tree in a WIM image. By specifying + * appropriate flags and a callback function, you can get the attributes of a + * file in the image, get a directory listing, or even get a listing of the + * entire image. + * + * @param wim + * The ::WIMStruct containing the image(s) over which to iterate. This + * ::WIMStruct must contain image metadata, so it cannot be the non-first + * part of a split WIM (for example). + * @param image + * The 1-based index of the image that contains the files or directories to + * iterate over, or ::WIMLIB_ALL_IMAGES to iterate over all images. + * @param path + * Path in the image at which to do the iteration. + * @param flags + * Bitwise OR of flags prefixed with WIMLIB_ITERATE_DIR_TREE_FLAG. + * @param cb + * A callback function that will receive each directory entry. + * @param user_ctx + * An extra parameter that will always be passed to the callback function + * @p cb. + * + * @return Normally, returns 0 if all calls to @p cb returned 0; otherwise the + * first nonzero value that was returned from @p cb. However, additional + * ::wimlib_error_code values may be returned, including the following: + * + * @retval ::WIMLIB_ERR_INVALID_IMAGE + * @p image does not exist in @p wim. + * @retval ::WIMLIB_ERR_PATH_DOES_NOT_EXIST + * @p path does not exist in the image. + * @retval ::WIMLIB_ERR_RESOURCE_NOT_FOUND + * ::WIMLIB_ITERATE_DIR_TREE_FLAG_RESOURCES_NEEDED was specified, but the + * data for some files could not be found in the blob lookup table of @p + * wim. + * + * This function can additionally return ::WIMLIB_ERR_DECOMPRESSION, + * ::WIMLIB_ERR_INVALID_METADATA_RESOURCE, ::WIMLIB_ERR_METADATA_NOT_FOUND, + * ::WIMLIB_ERR_READ, or ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE, all of which + * indicate failure (for different reasons) to read the metadata resource for an + * image over which iteration needed to be done. + */ +WIMLIBAPI int +wimlib_iterate_dir_tree(WIMStruct *wim, int image, const wimlib_tchar *path, + int flags, + wimlib_iterate_dir_tree_callback_t cb, void *user_ctx); + +/** + * @ingroup G_wim_information + * + * Iterate through the blob lookup table of a ::WIMStruct. This can be used to + * directly get a listing of the unique "blobs" contained in a WIM file, which + * are deduplicated over all images. + * + * Specifically, each listed blob may be from any of the following sources: + * + * - Metadata blobs, if the ::WIMStruct contains image metadata + * - File blobs from the on-disk WIM file (if any) backing the ::WIMStruct + * - File blobs from files that have been added to the in-memory ::WIMStruct, + * e.g. by using wimlib_add_image() + * - File blobs from external WIMs referenced by + * wimlib_reference_resource_files() or wimlib_reference_resources() + * + * @param wim + * Pointer to the ::WIMStruct for which to get the blob listing. + * @param flags + * Reserved; set to 0. + * @param cb + * A callback function that will receive each blob. + * @param user_ctx + * An extra parameter that will always be passed to the callback function + * @p cb. + * + * @return 0 if all calls to @p cb returned 0; otherwise the first nonzero value + * that was returned from @p cb. + */ +WIMLIBAPI int +wimlib_iterate_lookup_table(WIMStruct *wim, int flags, + wimlib_iterate_lookup_table_callback_t cb, + void *user_ctx); + +/** + * @ingroup G_nonstandalone_wims + * + * Join a split WIM into a stand-alone (one-part) WIM. + * + * @param swms + * An array of strings that gives the filenames of all parts of the split + * WIM. No specific order is required, but all parts must be included with + * no duplicates. + * @param num_swms + * Number of filenames in @p swms. + * @param swm_open_flags + * Open flags for the split WIM parts (e.g. + * ::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY). + * @param wim_write_flags + * Bitwise OR of relevant flags prefixed with WIMLIB_WRITE_FLAG, which will + * be used to write the joined WIM. + * @param output_path + * The path to write the joined WIM file to. + * + * @return 0 on success; a ::wimlib_error_code value on failure. This function + * may return most error codes that can be returned by wimlib_open_wim() and + * wimlib_write(), as well as the following error codes: + * + * @retval ::WIMLIB_ERR_SPLIT_INVALID + * The split WIMs do not form a valid WIM because they do not include all + * the parts of the original WIM, there are duplicate parts, or not all the + * parts have the same GUID and compression type. + * + * Note: wimlib is generalized enough that this function is not actually needed + * to join a split WIM; instead, you could open the first part of the split WIM, + * then reference the other parts with wimlib_reference_resource_files(), then + * write the joined WIM using wimlib_write(). However, wimlib_join() provides + * an easy-to-use wrapper around this that has some advantages (e.g. extra + * sanity checks). + */ +WIMLIBAPI int +wimlib_join(const wimlib_tchar * const *swms, + unsigned num_swms, + const wimlib_tchar *output_path, + int swm_open_flags, + int wim_write_flags); + +/** + * @ingroup G_nonstandalone_wims + * + * Same as wimlib_join(), but allows specifying a progress function. The + * progress function will receive the write progress messages, such as + * ::WIMLIB_PROGRESS_MSG_WRITE_STREAMS, while writing the joined WIM. In + * addition, if ::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY is specified in @p + * swm_open_flags, the progress function will receive a series of + * ::WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY messages when each of the split WIM + * parts is opened. + */ +WIMLIBAPI int +wimlib_join_with_progress(const wimlib_tchar * const *swms, + unsigned num_swms, + const wimlib_tchar *output_path, + int swm_open_flags, + int wim_write_flags, + wimlib_progress_func_t progfunc, + void *progctx); + +/** + * @ingroup G_general + * + * Load a UTF-8 or UTF-16LE encoded text file into memory. + * + * @param path + * The path to the file, or NULL or "-" to use standard input. + * @param tstr_ret + * On success, a buffer containing the file's text as a "wimlib_tchar" + * string is returned here. The buffer must be freed using free(). + * @param tstr_nchars_ret + * On success, the length of the text in "wimlib_tchar"s is returned here. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + */ +WIMLIBAPI int +wimlib_load_text_file(const wimlib_tchar *path, + wimlib_tchar **tstr_ret, size_t *tstr_nchars_ret); + +/** + * @ingroup G_mounting_wim_images + * + * Mount an image from a WIM file on a directory read-only or read-write. + * + * @param wim + * Pointer to the ::WIMStruct containing the image to be mounted. This + * ::WIMStruct must have a backing file. + * @param image + * The 1-based index of the image to mount. This image cannot have been + * previously modified in memory. + * @param dir + * The path to an existing empty directory on which to mount the image. + * @param mount_flags + * Bitwise OR of flags prefixed with WIMLIB_MOUNT_FLAG. Use + * ::WIMLIB_MOUNT_FLAG_READWRITE to request a read-write mount instead of a + * read-only mount. + * @param staging_dir + * If non-NULL, the name of a directory in which a temporary directory for + * storing modified or added files will be created. Ignored if + * ::WIMLIB_MOUNT_FLAG_READWRITE is not specified in @p mount_flags. If + * left @c NULL, the staging directory is created in the same directory as + * the backing WIM file. The staging directory is automatically deleted + * when the image is unmounted. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_ALREADY_LOCKED + * Another process is currently modifying the WIM file. + * @retval ::WIMLIB_ERR_FUSE + * A non-zero status code was returned by @c fuse_main(). + * @retval ::WIMLIB_ERR_IMAGE_HAS_MULTIPLE_REFERENCES + * There are currently multiple references to the image as a result of a + * call to wimlib_export_image(). Free one before attempting the + * read-write mount. + * @retval ::WIMLIB_ERR_INVALID_IMAGE + * @p image does not exist in @p wim. + * @retval ::WIMLIB_ERR_INVALID_PARAM + * @p wim was @c NULL; or @p dir was NULL or an empty string; or an + * unrecognized flag was specified in @p mount_flags; or the image has + * already been modified in memory (e.g. by wimlib_update_image()). + * @retval ::WIMLIB_ERR_MKDIR + * ::WIMLIB_MOUNT_FLAG_READWRITE was specified in @p mount_flags, but the + * staging directory could not be created. + * @retval ::WIMLIB_ERR_WIM_IS_READONLY + * ::WIMLIB_MOUNT_FLAG_READWRITE was specified in @p mount_flags, but the + * WIM file is considered read-only because of any of the reasons mentioned + * in the documentation for the ::WIMLIB_OPEN_FLAG_WRITE_ACCESS flag. + * @retval ::WIMLIB_ERR_UNSUPPORTED + * Mounting is not supported in this build of the library. + * + * This function can additionally return ::WIMLIB_ERR_DECOMPRESSION, + * ::WIMLIB_ERR_INVALID_METADATA_RESOURCE, ::WIMLIB_ERR_METADATA_NOT_FOUND, + * ::WIMLIB_ERR_READ, or ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE, all of which + * indicate failure (for different reasons) to read the metadata resource for + * the image to mount. + * + * The ability to mount WIM images is implemented using FUSE (Filesystem in + * UserSpacE). Depending on how FUSE is set up on your system, this function + * may work as normal users in addition to the root user. + * + * Mounting WIM images is not supported if wimlib was configured + * <c>--without-fuse</c>. This includes Windows builds of wimlib; + * ::WIMLIB_ERR_UNSUPPORTED will be returned in such cases. + * + * Calling this function daemonizes the process, unless + * ::WIMLIB_MOUNT_FLAG_DEBUG was specified or an early error occurs. + * + * It is safe to mount multiple images from the same WIM file read-only at the + * same time, but only if different ::WIMStruct's are used. It is @b not safe + * to mount multiple images from the same WIM file read-write at the same time. + * + * To unmount the image, call wimlib_unmount_image(). This may be done in a + * different process. + */ +WIMLIBAPI int +wimlib_mount_image(WIMStruct *wim, + int image, + const wimlib_tchar *dir, + int mount_flags, + const wimlib_tchar *staging_dir); + +/** + * @ingroup G_creating_and_opening_wims + * + * Open a WIM file and create a ::WIMStruct for it. + * + * @param wim_file + * The path to the WIM file to open. + * @param open_flags + * Bitwise OR of flags prefixed with WIMLIB_OPEN_FLAG. + * @param wim_ret + * On success, a pointer to a new ::WIMStruct backed by the specified + * on-disk WIM file is written to the memory location pointed to by this + * parameter. This ::WIMStruct must be freed using wimlib_free() when + * finished with it. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_IMAGE_COUNT + * The number of metadata resources found in the WIM did not match the + * image count specified in the WIM header, or the number of &lt;IMAGE&gt; + * elements in the XML data of the WIM did not match the image count + * specified in the WIM header. + * @retval ::WIMLIB_ERR_INTEGRITY + * ::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY was specified in @p open_flags, and + * the WIM file failed the integrity check. + * @retval ::WIMLIB_ERR_INVALID_CHUNK_SIZE + * The library did not recognize the compression chunk size of the WIM as + * valid for its compression type. + * @retval ::WIMLIB_ERR_INVALID_COMPRESSION_TYPE + * The library did not recognize the compression type of the WIM. + * @retval ::WIMLIB_ERR_INVALID_HEADER + * The header of the WIM was otherwise invalid. + * @retval ::WIMLIB_ERR_INVALID_INTEGRITY_TABLE + * ::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY was specified in @p open_flags and + * the WIM contained an integrity table, but the integrity table was + * invalid. + * @retval ::WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY + * The lookup table of the WIM was invalid. + * @retval ::WIMLIB_ERR_INVALID_PARAM + * @p wim_ret was @c NULL; or, @p wim_file was not a nonempty string. + * @retval ::WIMLIB_ERR_IS_SPLIT_WIM + * The WIM was a split WIM and ::WIMLIB_OPEN_FLAG_ERROR_IF_SPLIT was + * specified in @p open_flags. + * @retval ::WIMLIB_ERR_NOT_A_WIM_FILE + * The file did not begin with the magic characters that identify a WIM + * file. + * @retval ::WIMLIB_ERR_OPEN + * Failed to open the WIM file for reading. Some possible reasons: the WIM + * file does not exist, or the calling process does not have permission to + * open it. + * @retval ::WIMLIB_ERR_READ + * Failed to read data from the WIM file. + * @retval ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE + * Unexpected end-of-file while reading data from the WIM file. + * @retval ::WIMLIB_ERR_UNKNOWN_VERSION + * The WIM version number was not recognized. (May be a pre-Vista WIM.) + * @retval ::WIMLIB_ERR_WIM_IS_ENCRYPTED + * The WIM cannot be opened because it contains encrypted segments. (It + * may be a Windows 8 "ESD" file.) + * @retval ::WIMLIB_ERR_WIM_IS_INCOMPLETE + * The WIM file is not complete (e.g. the program which wrote it was + * terminated before it finished) + * @retval ::WIMLIB_ERR_WIM_IS_READONLY + * ::WIMLIB_OPEN_FLAG_WRITE_ACCESS was specified but the WIM file was + * considered read-only because of any of the reasons mentioned in the + * documentation for the ::WIMLIB_OPEN_FLAG_WRITE_ACCESS flag. + * @retval ::WIMLIB_ERR_XML + * The XML data of the WIM was invalid. + */ +WIMLIBAPI int +wimlib_open_wim(const wimlib_tchar *wim_file, + int open_flags, + WIMStruct **wim_ret); + +/** + * @ingroup G_creating_and_opening_wims + * + * Same as wimlib_open_wim(), but allows specifying a progress function and + * progress context. If successful, the progress function will be registered in + * the newly open ::WIMStruct, as if by an automatic call to + * wimlib_register_progress_function(). In addition, if + * ::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY is specified in @p open_flags, then the + * progress function will receive ::WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY + * messages while checking the WIM file's integrity. + */ +WIMLIBAPI int +wimlib_open_wim_with_progress(const wimlib_tchar *wim_file, + int open_flags, + WIMStruct **wim_ret, + wimlib_progress_func_t progfunc, + void *progctx); + +/** + * @ingroup G_writing_and_overwriting_wims + * + * Commit a ::WIMStruct to disk, updating its backing file. + * + * There are several alternative ways in which changes may be committed: + * + * 1. Full rebuild: write the updated WIM to a temporary file, then rename the + * temporary file to the original. + * 2. Appending: append updates to the new original WIM file, then overwrite + * its header such that those changes become visible to new readers. + * 3. Compaction: normally should not be used; see + * ::WIMLIB_WRITE_FLAG_UNSAFE_COMPACT for details. + * + * Append mode is often much faster than a full rebuild, but it wastes some + * amount of space due to leaving "holes" in the WIM file. Because of the + * greater efficiency, wimlib_overwrite() normally defaults to append mode. + * However, ::WIMLIB_WRITE_FLAG_REBUILD can be used to explicitly request a full + * rebuild. In addition, if wimlib_delete_image() has been used on the + * ::WIMStruct, then the default mode switches to rebuild mode, and + * ::WIMLIB_WRITE_FLAG_SOFT_DELETE can be used to explicitly request append + * mode. + * + * If this function completes successfully, then no more functions can be called + * on the ::WIMStruct other than wimlib_free(). If you need to continue using + * the WIM file, you must use wimlib_open_wim() to open a new ::WIMStruct for + * it. + * + * @param wim + * Pointer to a ::WIMStruct to commit to its backing file. + * @param write_flags + * Bitwise OR of relevant flags prefixed with WIMLIB_WRITE_FLAG. + * @param num_threads + * The number of threads to use for compressing data, or 0 to have the + * library automatically choose an appropriate number. + * + * @return 0 on success; a ::wimlib_error_code value on failure. This function + * may return most error codes returned by wimlib_write() as well as the + * following error codes: + * + * @retval ::WIMLIB_ERR_ALREADY_LOCKED + * Another process is currently modifying the WIM file. + * @retval ::WIMLIB_ERR_NO_FILENAME + * @p wim is not backed by an on-disk file. In other words, it is a + * ::WIMStruct created by wimlib_create_new_wim() rather than + * wimlib_open_wim(). + * @retval ::WIMLIB_ERR_RENAME + * The temporary file to which the WIM was written could not be renamed to + * the original file. + * @retval ::WIMLIB_ERR_WIM_IS_READONLY + * The WIM file is considered read-only because of any of the reasons + * mentioned in the documentation for the ::WIMLIB_OPEN_FLAG_WRITE_ACCESS + * flag. + * + * If a progress function is registered with @p wim, then it will receive the + * messages ::WIMLIB_PROGRESS_MSG_WRITE_STREAMS, + * ::WIMLIB_PROGRESS_MSG_WRITE_METADATA_BEGIN, and + * ::WIMLIB_PROGRESS_MSG_WRITE_METADATA_END. + */ +WIMLIBAPI int +wimlib_overwrite(WIMStruct *wim, int write_flags, unsigned num_threads); + +/** + * @ingroup G_wim_information + * + * (Deprecated) Print information about one image, or all images, contained in a + * WIM. + * + * @param wim + * Pointer to the ::WIMStruct to query. This need not represent a + * standalone WIM (e.g. it could represent part of a split WIM). + * @param image + * The 1-based index of the image for which to print information, or + * ::WIMLIB_ALL_IMAGES to print information about all images. + * + * @return This function has no return value. No error checking is done when + * printing the information. If @p image is invalid, an error message is + * printed. + * + * This function is deprecated; use wimlib_get_xml_data() or + * wimlib_get_image_property() to query image information instead. + */ +WIMLIBAPI void +wimlib_print_available_images(const WIMStruct *wim, int image); + +/** + * @ingroup G_wim_information + * + * Print the header of the WIM file (intended for debugging only). + */ +WIMLIBAPI void +wimlib_print_header(const WIMStruct *wim); + +/** + * @ingroup G_nonstandalone_wims + * + * Reference file data from other WIM files or split WIM parts. This function + * can be used on WIMs that are not standalone, such as split or "delta" WIMs, + * to load additional file data before calling a function such as + * wimlib_extract_image() that requires the file data to be present. + * + * @param wim + * The ::WIMStruct for a WIM that contains metadata resources, but is not + * necessarily "standalone". In the case of split WIMs, this should be the + * first part, since only the first part contains the metadata resources. + * In the case of delta WIMs, this should be the delta WIM rather than the + * WIM on which it is based. + * @param resource_wimfiles_or_globs + * Array of paths to WIM files and/or split WIM parts to reference. + * Alternatively, when ::WIMLIB_REF_FLAG_GLOB_ENABLE is specified in @p + * ref_flags, these are treated as globs rather than literal paths. That + * is, using this function you can specify zero or more globs, each of + * which expands to one or more literal paths. + * @param count + * Number of entries in @p resource_wimfiles_or_globs. + * @param ref_flags + * Bitwise OR of ::WIMLIB_REF_FLAG_GLOB_ENABLE and/or + * ::WIMLIB_REF_FLAG_GLOB_ERR_ON_NOMATCH. + * @param open_flags + * Additional open flags, such as ::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY, to + * pass to internal calls to wimlib_open_wim() on the reference files. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_GLOB_HAD_NO_MATCHES + * One of the specified globs did not match any paths (only with both + * ::WIMLIB_REF_FLAG_GLOB_ENABLE and ::WIMLIB_REF_FLAG_GLOB_ERR_ON_NOMATCH + * specified in @p ref_flags). + * @retval ::WIMLIB_ERR_READ + * I/O or permissions error while processing a file glob. + * + * This function can additionally return most values that can be returned by + * wimlib_open_wim(). + */ +WIMLIBAPI int +wimlib_reference_resource_files(WIMStruct *wim, + const wimlib_tchar * const *resource_wimfiles_or_globs, + unsigned count, + int ref_flags, + int open_flags); + +/** + * @ingroup G_nonstandalone_wims + * + * Similar to wimlib_reference_resource_files(), but operates at a lower level + * where the caller must open the ::WIMStruct for each referenced file itself. + * + * @param wim + * The ::WIMStruct for a WIM that contains metadata resources, but is not + * necessarily "standalone". In the case of split WIMs, this should be the + * first part, since only the first part contains the metadata resources. + * @param resource_wims + * Array of pointers to the ::WIMStruct's for additional resource WIMs or + * split WIM parts to reference. + * @param num_resource_wims + * Number of entries in @p resource_wims. + * @param ref_flags + * Reserved; must be 0. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + */ +WIMLIBAPI int +wimlib_reference_resources(WIMStruct *wim, WIMStruct **resource_wims, + unsigned num_resource_wims, int ref_flags); + +/** + * @ingroup G_modifying_wims + * + * Declare that a newly added image is mostly the same as a prior image, but + * captured at a later point in time, possibly with some modifications in the + * intervening time. This is designed to be used in incremental backups of the + * same filesystem or directory tree. + * + * This function compares the metadata of the directory tree of the newly added + * image against that of the old image. Any files that are present in both the + * newly added image and the old image and have timestamps that indicate they + * haven't been modified are deemed not to have been modified and have their + * checksums copied from the old image. Because of this and because WIM uses + * single-instance streams, such files need not be read from the filesystem when + * the WIM is being written or overwritten. Note that these unchanged files + * will still be "archived" and will be logically present in the new image; the + * optimization is that they don't need to actually be read from the filesystem + * because the WIM already contains them. + * + * This function is provided to optimize incremental backups. The resulting WIM + * file will still be the same regardless of whether this function is called. + * (This is, however, assuming that timestamps have not been manipulated or + * unmaintained as to trick this function into thinking a file has not been + * modified when really it has. To partly guard against such cases, other + * metadata such as file sizes will be checked as well.) + * + * This function must be called after adding the new image (e.g. with + * wimlib_add_image()), but before writing the updated WIM file (e.g. with + * wimlib_overwrite()). + * + * @param wim + * Pointer to the ::WIMStruct containing the newly added image. + * @param new_image + * The 1-based index in @p wim of the newly added image. + * @param template_wim + * Pointer to the ::WIMStruct containing the template image. This can be, + * but does not have to be, the same ::WIMStruct as @p wim. + * @param template_image + * The 1-based index in @p template_wim of the template image. + * @param flags + * Reserved; must be 0. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_INVALID_IMAGE + * @p new_image does not exist in @p wim or @p template_image does not + * exist in @p template_wim. + * @retval ::WIMLIB_ERR_METADATA_NOT_FOUND + * At least one of @p wim and @p template_wim does not contain image + * metadata; for example, one of them represents a non-first part of a + * split WIM. + * @retval ::WIMLIB_ERR_INVALID_PARAM + * Identical values were provided for the template and new image; or @p + * new_image specified an image that had not been modified since opening + * the WIM. + * + * This function can additionally return ::WIMLIB_ERR_DECOMPRESSION, + * ::WIMLIB_ERR_INVALID_METADATA_RESOURCE, ::WIMLIB_ERR_METADATA_NOT_FOUND, + * ::WIMLIB_ERR_READ, or ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE, all of which + * indicate failure (for different reasons) to read the metadata resource for + * the template image. + */ +WIMLIBAPI int +wimlib_reference_template_image(WIMStruct *wim, int new_image, + WIMStruct *template_wim, int template_image, + int flags); + +/** + * @ingroup G_general + * + * Register a progress function with a ::WIMStruct. + * + * @param wim + * The ::WIMStruct for which to register the progress function. + * @param progfunc + * Pointer to the progress function to register. If the WIM already has a + * progress function registered, it will be replaced with this one. If @p + * NULL, the current progress function (if any) will be unregistered. + * @param progctx + * The value which will be passed as the third argument to calls to @p + * progfunc. + */ +WIMLIBAPI void +wimlib_register_progress_function(WIMStruct *wim, + wimlib_progress_func_t progfunc, + void *progctx); + +/** + * @ingroup G_modifying_wims + * + * Rename the @p source_path to the @p dest_path in the specified @p image of + * the @p wim. + * + * This just builds an appropriate ::wimlib_rename_command and passes it to + * wimlib_update_image(). + */ +WIMLIBAPI int +wimlib_rename_path(WIMStruct *wim, int image, + const wimlib_tchar *source_path, const wimlib_tchar *dest_path); + +/** + * @ingroup G_wim_information + * + * Translate a string specifying the name or number of an image in the WIM into + * the number of the image. The images are numbered starting at 1. + * + * @param wim + * Pointer to the ::WIMStruct for a WIM. + * @param image_name_or_num + * A string specifying the name or number of an image in the WIM. If it + * parses to a positive integer, this integer is taken to specify the + * number of the image, indexed starting at 1. Otherwise, it is taken to + * be the name of an image, as given in the XML data for the WIM file. It + * also may be the keyword "all" or the string "*", both of which will + * resolve to ::WIMLIB_ALL_IMAGES. + * <br/> <br/> + * There is no way to search for an image actually named "all", "*", or an + * integer number, or an image that has no name. However, you can use + * wimlib_get_image_name() to get the name of any image. + * + * @return + * If the string resolved to a single existing image, the number of that + * image, indexed starting at 1, is returned. If the keyword "all" or "*" + * was specified, ::WIMLIB_ALL_IMAGES is returned. Otherwise, + * ::WIMLIB_NO_IMAGE is returned. If @p image_name_or_num was @c NULL or + * the empty string, ::WIMLIB_NO_IMAGE is returned, even if one or more + * images in @p wim has no name. (Since a WIM may have multiple unnamed + * images, an unnamed image must be specified by index to eliminate the + * ambiguity.) + */ +WIMLIBAPI int +wimlib_resolve_image(WIMStruct *wim, + const wimlib_tchar *image_name_or_num); + +/** + * @ingroup G_general + * + * Set the file to which the library will print error and warning messages. + * + * This version of the function takes a C library <c>FILE*</c> opened for + * writing (or appending). Use wimlib_set_error_file_by_name() to specify the + * file by name instead. + * + * This also enables error messages, as if by a call to + * wimlib_set_print_errors(true). + * + * @return 0 + */ +WIMLIBAPI int +wimlib_set_error_file(FILE *fp); + +/** + * @ingroup G_general + * + * Set the path to the file to which the library will print error and warning + * messages. The library will open this file for appending. + * + * This also enables error messages, as if by a call to + * wimlib_set_print_errors(true). + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_OPEN + * The file named by @p path could not be opened for appending. + */ +WIMLIBAPI int +wimlib_set_error_file_by_name(const wimlib_tchar *path); + +/** + * @ingroup G_modifying_wims + * + * Change the description of a WIM image. Equivalent to + * <tt>wimlib_set_image_property(wim, image, "DESCRIPTION", description)</tt>. + * + * Note that "description" is misspelled in the name of this function. + */ +WIMLIBAPI int +wimlib_set_image_descripton(WIMStruct *wim, int image, + const wimlib_tchar *description); + +/** + * @ingroup G_modifying_wims + * + * Change what is stored in the \<FLAGS\> element in the WIM XML document + * (usually something like "Core" or "Ultimate"). Equivalent to + * <tt>wimlib_set_image_property(wim, image, "FLAGS", flags)</tt>. + */ +WIMLIBAPI int +wimlib_set_image_flags(WIMStruct *wim, int image, const wimlib_tchar *flags); + +/** + * @ingroup G_modifying_wims + * + * Change the name of a WIM image. Equivalent to + * <tt>wimlib_set_image_property(wim, image, "NAME", name)</tt>. + */ +WIMLIBAPI int +wimlib_set_image_name(WIMStruct *wim, int image, const wimlib_tchar *name); + +/** + * @ingroup G_modifying_wims + * + * Since wimlib v1.8.3: add, modify, or remove a per-image property from the + * WIM's XML document. This is an alternative to wimlib_set_image_name(), + * wimlib_set_image_descripton(), and wimlib_set_image_flags() which allows + * manipulating any simple string property. + * + * @param wim + * Pointer to the ::WIMStruct for the WIM. + * @param image + * The 1-based index of the image for which to set the property. + * @param property_name + * The name of the image property in the same format documented for + * wimlib_get_image_property(). + * <br/> + * Note: if creating a new element using a bracketed index such as + * "WINDOWS/LANGUAGES/LANGUAGE[2]", the highest index that can be specified + * is one greater than the number of existing elements with that same name, + * excluding the index. That means that if you are adding a list of new + * elements, they must be added sequentially from the first index (1) to + * the last index (n). + * @param property_value + * If not NULL and not empty, the property is set to this value. + * Otherwise, the property is removed from the XML document. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_IMAGE_NAME_COLLISION + * The user requested to set the image name (the <tt>NAME</tt> property), + * but another image in the WIM already had the requested name. + * @retval ::WIMLIB_ERR_INVALID_IMAGE + * @p image does not exist in @p wim. + * @retval ::WIMLIB_ERR_INVALID_PARAM + * @p property_name has an unsupported format, or @p property_name included + * a bracketed index that was too high. + */ +WIMLIBAPI int +wimlib_set_image_property(WIMStruct *wim, int image, + const wimlib_tchar *property_name, + const wimlib_tchar *property_value); + +/** + * @ingroup G_general + * + * Set the functions that wimlib uses to allocate and free memory. + * + * These settings are global and not per-WIM. + * + * The default is to use the default @c malloc(), @c free(), and @c realloc() + * from the standard C library. + * + * Note: some external functions, such as those in @c libntfs-3g, may use the + * standard memory allocation functions regardless of this setting. + * + * @param malloc_func + * A function equivalent to @c malloc() that wimlib will use to allocate + * memory. If @c NULL, the allocator function is set back to the default + * @c malloc() from the C library. + * @param free_func + * A function equivalent to @c free() that wimlib will use to free memory. + * If @c NULL, the free function is set back to the default @c free() from + * the C library. + * @param realloc_func + * A function equivalent to @c realloc() that wimlib will use to reallocate + * memory. If @c NULL, the free function is set back to the default @c + * realloc() from the C library. + * + * @return 0 + */ +WIMLIBAPI int +wimlib_set_memory_allocator(void *(*malloc_func)(size_t), + void (*free_func)(void *), + void *(*realloc_func)(void *, size_t)); + +/** + * @ingroup G_writing_and_overwriting_wims + * + * Set a ::WIMStruct's output compression chunk size. This is the compression + * chunk size that will be used for writing non-solid resources in subsequent + * calls to wimlib_write() or wimlib_overwrite(). A larger compression chunk + * size often results in a better compression ratio, but compression may be + * slower and the speed of random access to data may be reduced. In addition, + * some chunk sizes are not compatible with Microsoft software. + * + * @param wim + * The ::WIMStruct for which to set the output chunk size. + * @param chunk_size + * The chunk size (in bytes) to set. The valid chunk sizes are dependent + * on the compression type. See the documentation for each + * ::wimlib_compression_type constant for more information. As a special + * case, if @p chunk_size is specified as 0, then the chunk size will be + * reset to the default for the currently selected output compression type. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_INVALID_CHUNK_SIZE + * @p chunk_size was not 0 or a supported chunk size for the currently + * selected output compression type. + */ +WIMLIBAPI int +wimlib_set_output_chunk_size(WIMStruct *wim, uint32_t chunk_size); + +/** + * @ingroup G_writing_and_overwriting_wims + * + * Similar to wimlib_set_output_chunk_size(), but set the chunk size for writing + * solid resources. + */ +WIMLIBAPI int +wimlib_set_output_pack_chunk_size(WIMStruct *wim, uint32_t chunk_size); + +/** + * @ingroup G_writing_and_overwriting_wims + * + * Set a ::WIMStruct's output compression type. This is the compression type + * that will be used for writing non-solid resources in subsequent calls to + * wimlib_write() or wimlib_overwrite(). + * + * @param wim + * The ::WIMStruct for which to set the output compression type. + * @param ctype + * The compression type to set. If this compression type is incompatible + * with the current output chunk size, then the output chunk size will be + * reset to the default for the new compression type. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_INVALID_COMPRESSION_TYPE + * @p ctype did not specify a valid compression type. + */ +WIMLIBAPI int +wimlib_set_output_compression_type(WIMStruct *wim, + enum wimlib_compression_type ctype); + +/** + * @ingroup G_writing_and_overwriting_wims + * + * Similar to wimlib_set_output_compression_type(), but set the compression type + * for writing solid resources. This cannot be ::WIMLIB_COMPRESSION_TYPE_NONE. + */ +WIMLIBAPI int +wimlib_set_output_pack_compression_type(WIMStruct *wim, + enum wimlib_compression_type ctype); + +/** + * @ingroup G_general + * + * Set whether wimlib can print error and warning messages to the error file, + * which defaults to standard error. Error and warning messages may provide + * information that cannot be determined only from returned error codes. + * + * By default, error messages are not printed. + * + * This setting applies globally (it is not per-WIM). + * + * This can be called before wimlib_global_init(). + * + * @param show_messages + * @c true if messages are to be printed; @c false if messages are not to + * be printed. + * + * @return 0 + */ +WIMLIBAPI int +wimlib_set_print_errors(bool show_messages); + +/** + * @ingroup G_modifying_wims + * + * Set basic information about a WIM. + * + * @param wim + * Pointer to the ::WIMStruct for a WIM. + * @param info + * Pointer to a ::wimlib_wim_info structure that contains the information + * to set. Only the information explicitly specified in the @p which flags + * need be valid. + * @param which + * Flags that specify which information to set. This is a bitwise OR of + * ::WIMLIB_CHANGE_READONLY_FLAG, ::WIMLIB_CHANGE_GUID, + * ::WIMLIB_CHANGE_BOOT_INDEX, and/or ::WIMLIB_CHANGE_RPFIX_FLAG. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_IMAGE_COUNT + * ::WIMLIB_CHANGE_BOOT_INDEX was specified, but + * ::wimlib_wim_info.boot_index did not specify 0 or a valid 1-based image + * index in the WIM. + */ +WIMLIBAPI int +wimlib_set_wim_info(WIMStruct *wim, const struct wimlib_wim_info *info, + int which); + +/** + * @ingroup G_nonstandalone_wims + * + * Split a WIM into multiple parts. + * + * @param wim + * The ::WIMStruct for the WIM to split. + * @param swm_name + * Name of the split WIM (SWM) file to create. This will be the name of + * the first part. The other parts will, by default, have the same name + * with 2, 3, 4, ..., etc. appended before the suffix. However, the exact + * names can be customized using the progress function. + * @param part_size + * The maximum size per part, in bytes. Unfortunately, it is not + * guaranteed that this will really be the maximum size per part, because + * some file resources in the WIM may be larger than this size, and the WIM + * file format provides no way to split up file resources among multiple + * WIMs. + * @param write_flags + * Bitwise OR of relevant flags prefixed with @c WIMLIB_WRITE_FLAG. These + * flags will be used to write each split WIM part. Specify 0 here to get + * the default behavior. + * + * @return 0 on success; a ::wimlib_error_code value on failure. This function + * may return most error codes that can be returned by wimlib_write() as well as + * the following error codes: + * + * @retval ::WIMLIB_ERR_INVALID_PARAM + * @p swm_name was not a nonempty string, or @p part_size was 0. + * @retval ::WIMLIB_ERR_UNSUPPORTED + * The WIM contains solid resources. Splitting a WIM containing solid + * resources is not supported. + * + * If a progress function is registered with @p wim, then for each split WIM + * part that is written it will receive the messages + * ::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART and + * ::WIMLIB_PROGRESS_MSG_SPLIT_END_PART. Since wimlib v1.13.4 it will also + * receive ::WIMLIB_PROGRESS_MSG_WRITE_STREAMS messages while writing each part; + * these messages will report the progress of the current part only. + */ +WIMLIBAPI int +wimlib_split(WIMStruct *wim, + const wimlib_tchar *swm_name, + uint64_t part_size, + int write_flags); + +/** + * @ingroup G_general + * + * Perform verification checks on a WIM file. + * + * This function is intended for safety checking and/or debugging. If used on a + * well-formed WIM file, it should always succeed. + * + * @param wim + * The ::WIMStruct for the WIM file to verify. Note: for an extra layer of + * verification, it is a good idea to have used + * ::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY when you opened the file. + * <br/> + * If verifying a split WIM, specify the first part of the split WIM here, + * and reference the other parts using wimlib_reference_resource_files() + * before calling this function. + * @param verify_flags + * Reserved; must be 0. + * + * @return 0 if the WIM file was successfully verified; a ::wimlib_error_code + * value if it failed verification or another error occurred. + * + * @retval ::WIMLIB_ERR_DECOMPRESSION + * The WIM file contains invalid compressed data. + * @retval ::WIMLIB_ERR_INVALID_METADATA_RESOURCE + * The metadata resource for an image is invalid. + * @retval ::WIMLIB_ERR_INVALID_RESOURCE_HASH + * File data stored in the WIM file is corrupt. + * @retval ::WIMLIB_ERR_RESOURCE_NOT_FOUND + * The data for a file in an image could not be found. See @ref + * G_nonstandalone_wims. + * + * If a progress function is registered with @p wim, then it will receive the + * following progress messages: ::WIMLIB_PROGRESS_MSG_BEGIN_VERIFY_IMAGE, + * ::WIMLIB_PROGRESS_MSG_END_VERIFY_IMAGE, and + * ::WIMLIB_PROGRESS_MSG_VERIFY_STREAMS. + */ +WIMLIBAPI int +wimlib_verify_wim(WIMStruct *wim, int verify_flags); + +/** + * @ingroup G_mounting_wim_images + * + * Unmount a WIM image that was mounted using wimlib_mount_image(). + * + * When unmounting a read-write mounted image, the default behavior is to + * discard changes to the image. Use ::WIMLIB_UNMOUNT_FLAG_COMMIT to cause the + * image to be committed. + * + * @param dir + * The directory on which the WIM image is mounted. + * @param unmount_flags + * Bitwise OR of flags prefixed with @p WIMLIB_UNMOUNT_FLAG. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_NOT_A_MOUNTPOINT + * There is no WIM image mounted on the specified directory. + * @retval ::WIMLIB_ERR_MOUNTED_IMAGE_IS_BUSY + * The read-write mounted image cannot be committed because there are file + * descriptors open to it, and ::WIMLIB_UNMOUNT_FLAG_FORCE was not + * specified. + * @retval ::WIMLIB_ERR_MQUEUE + * Could not create a POSIX message queue. + * @retval ::WIMLIB_ERR_NOT_PERMITTED_TO_UNMOUNT + * The image was mounted by a different user. + * @retval ::WIMLIB_ERR_UNSUPPORTED + * Mounting is not supported in this build of the library. + * + * Note: you can also unmount the image by using the @c umount() system call, or + * by using the @c umount or @c fusermount programs. However, you need to call + * this function if you want changes to be committed. + */ +WIMLIBAPI int +wimlib_unmount_image(const wimlib_tchar *dir, int unmount_flags); + +/** + * @ingroup G_mounting_wim_images + * + * Same as wimlib_unmount_image(), but allows specifying a progress function. + * The progress function will receive a ::WIMLIB_PROGRESS_MSG_UNMOUNT_BEGIN + * message. In addition, if changes are committed from a read-write mount, the + * progress function will receive ::WIMLIB_PROGRESS_MSG_WRITE_STREAMS messages. + */ +WIMLIBAPI int +wimlib_unmount_image_with_progress(const wimlib_tchar *dir, + int unmount_flags, + wimlib_progress_func_t progfunc, + void *progctx); + +/** + * @ingroup G_modifying_wims + * + * Update a WIM image by adding, deleting, and/or renaming files or directories. + * + * @param wim + * Pointer to the ::WIMStruct containing the image to update. + * @param image + * The 1-based index of the image to update. + * @param cmds + * An array of ::wimlib_update_command's that specify the update operations + * to perform. + * @param num_cmds + * Number of commands in @p cmds. + * @param update_flags + * ::WIMLIB_UPDATE_FLAG_SEND_PROGRESS or 0. + * + * @return 0 on success; a ::wimlib_error_code value on failure. On failure, + * all update commands will be rolled back, and no visible changes will have + * been made to @p wim. + * + * @retval ::WIMLIB_ERR_FVE_LOCKED_VOLUME + * Windows-only: One of the "add" commands attempted to add files from an + * encrypted BitLocker volume that hasn't yet been unlocked. + * @retval ::WIMLIB_ERR_IMAGE_HAS_MULTIPLE_REFERENCES + * There are currently multiple references to the image as a result of a + * call to wimlib_export_image(). Free one before attempting the update. + * @retval ::WIMLIB_ERR_INVALID_CAPTURE_CONFIG + * The contents of a capture configuration file were invalid. + * @retval ::WIMLIB_ERR_INVALID_IMAGE + * @p image did not exist in @p wim. + * @retval ::WIMLIB_ERR_INVALID_OVERLAY + * An add command with ::WIMLIB_ADD_FLAG_NO_REPLACE specified attempted to + * replace an existing nondirectory file. + * @retval ::WIMLIB_ERR_INVALID_PARAM + * An unknown operation type was provided in the update commands; or + * unknown or incompatible flags were provided in a flags parameter; or + * there was another problem with the provided parameters. + * @retval ::WIMLIB_ERR_INVALID_REPARSE_DATA + * While executing an add command, a reparse point had invalid data. + * @retval ::WIMLIB_ERR_IS_DIRECTORY + * An add command attempted to replace a directory with a non-directory; or + * a delete command without ::WIMLIB_DELETE_FLAG_RECURSIVE attempted to + * delete a directory; or a rename command attempted to rename a directory + * to a non-directory. + * @retval ::WIMLIB_ERR_NOTDIR + * An add command attempted to replace a non-directory with a directory; or + * an add command attempted to set the root of the image to a + * non-directory; or a rename command attempted to rename a directory to a + * non-directory; or a component of an image path that was used as a + * directory was not, in fact, a directory. + * @retval ::WIMLIB_ERR_NOTEMPTY + * A rename command attempted to rename a directory to a non-empty + * directory; or a rename command would have created a loop. + * @retval ::WIMLIB_ERR_NTFS_3G + * While executing an add command with ::WIMLIB_ADD_FLAG_NTFS specified, an + * error occurred while reading data from the NTFS volume using libntfs-3g. + * @retval ::WIMLIB_ERR_OPEN + * Failed to open a file to be captured while executing an add command. + * @retval ::WIMLIB_ERR_OPENDIR + * Failed to open a directory to be captured while executing an add + * command. + * @retval ::WIMLIB_ERR_PATH_DOES_NOT_EXIST + * A delete command without ::WIMLIB_DELETE_FLAG_FORCE specified was for a + * WIM path that did not exist; or a rename command attempted to rename a + * file that does not exist. + * @retval ::WIMLIB_ERR_READ + * While executing an add command, failed to read data from a file or + * directory to be captured. + * @retval ::WIMLIB_ERR_READLINK + * While executing an add command, failed to read the target of a symbolic + * link, junction, or other reparse point. + * @retval ::WIMLIB_ERR_STAT + * While executing an add command, failed to read metadata for a file or + * directory. + * @retval ::WIMLIB_ERR_UNABLE_TO_READ_CAPTURE_CONFIG + * A capture configuration file could not be read. + * @retval ::WIMLIB_ERR_UNSUPPORTED + * A command had flags provided that are not supported on this platform or + * in this build of the library. + * @retval ::WIMLIB_ERR_UNSUPPORTED_FILE + * An add command with ::WIMLIB_ADD_FLAG_NO_UNSUPPORTED_EXCLUDE specified + * discovered a file that was not of a supported type. + * + * This function can additionally return ::WIMLIB_ERR_DECOMPRESSION, + * ::WIMLIB_ERR_INVALID_METADATA_RESOURCE, ::WIMLIB_ERR_METADATA_NOT_FOUND, + * ::WIMLIB_ERR_READ, or ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE, all of which + * indicate failure (for different reasons) to read the metadata resource for an + * image that needed to be updated. + */ +WIMLIBAPI int +wimlib_update_image(WIMStruct *wim, + int image, + const struct wimlib_update_command *cmds, + size_t num_cmds, + int update_flags); + +/** + * @ingroup G_writing_and_overwriting_wims + * + * Persist a ::WIMStruct to a new on-disk WIM file. + * + * This brings in file data from any external locations, such as directory trees + * or NTFS volumes scanned with wimlib_add_image(), or other WIM files via + * wimlib_export_image(), and incorporates it into a new on-disk WIM file. + * + * By default, the new WIM file is written as stand-alone. Using the + * ::WIMLIB_WRITE_FLAG_SKIP_EXTERNAL_WIMS flag, a "delta" WIM can be written + * instead. However, this function cannot directly write a "split" WIM; use + * wimlib_split() for that. + * + * @param wim + * Pointer to the ::WIMStruct being persisted. + * @param path + * The path to the on-disk file to write. + * @param image + * Normally, specify ::WIMLIB_ALL_IMAGES here. This indicates that all + * images are to be included in the new on-disk WIM file. If for some + * reason you only want to include a single image, specify the 1-based + * index of that image instead. + * @param write_flags + * Bitwise OR of flags prefixed with @c WIMLIB_WRITE_FLAG. + * @param num_threads + * The number of threads to use for compressing data, or 0 to have the + * library automatically choose an appropriate number. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_CONCURRENT_MODIFICATION_DETECTED + * A file that had previously been scanned for inclusion in the WIM was + * concurrently modified. + * @retval ::WIMLIB_ERR_INVALID_IMAGE + * @p image did not exist in @p wim. + * @retval ::WIMLIB_ERR_INVALID_RESOURCE_HASH + * A file, stored in another WIM, which needed to be written was corrupt. + * @retval ::WIMLIB_ERR_INVALID_PARAM + * @p path was not a nonempty string, or invalid flags were passed. + * @retval ::WIMLIB_ERR_OPEN + * Failed to open the output WIM file for writing, or failed to open a file + * whose data needed to be included in the WIM. + * @retval ::WIMLIB_ERR_READ + * Failed to read data that needed to be included in the WIM. + * @retval ::WIMLIB_ERR_RESOURCE_NOT_FOUND + * A file data blob that needed to be written could not be found in the + * blob lookup table of @p wim. See @ref G_nonstandalone_wims. + * @retval ::WIMLIB_ERR_WRITE + * An error occurred when trying to write data to the new WIM file. + * + * This function can additionally return ::WIMLIB_ERR_DECOMPRESSION, + * ::WIMLIB_ERR_INVALID_METADATA_RESOURCE, ::WIMLIB_ERR_METADATA_NOT_FOUND, + * ::WIMLIB_ERR_READ, or ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE, all of which + * indicate failure (for different reasons) to read the data from a WIM file. + * + * If a progress function is registered with @p wim, then it will receive the + * messages ::WIMLIB_PROGRESS_MSG_WRITE_STREAMS, + * ::WIMLIB_PROGRESS_MSG_WRITE_METADATA_BEGIN, and + * ::WIMLIB_PROGRESS_MSG_WRITE_METADATA_END. + */ +WIMLIBAPI int +wimlib_write(WIMStruct *wim, + const wimlib_tchar *path, + int image, + int write_flags, + unsigned num_threads); + +/** + * @ingroup G_writing_and_overwriting_wims + * + * Same as wimlib_write(), but write the WIM directly to a file descriptor, + * which need not be seekable if the write is done in a special pipable WIM + * format by providing ::WIMLIB_WRITE_FLAG_PIPABLE in @p write_flags. This can, + * for example, allow capturing a WIM image and streaming it over the network. + * See @ref subsec_pipable_wims for more information about pipable WIMs. + * + * The file descriptor @p fd will @b not be closed when the write is complete; + * the calling code is responsible for this. + * + * @return 0 on success; a ::wimlib_error_code value on failure. The possible + * error codes include those that can be returned by wimlib_write() as well as + * the following: + * + * @retval ::WIMLIB_ERR_INVALID_PARAM + * @p fd was not seekable, but ::WIMLIB_WRITE_FLAG_PIPABLE was not + * specified in @p write_flags. + */ +WIMLIBAPI int +wimlib_write_to_fd(WIMStruct *wim, + int fd, + int image, + int write_flags, + unsigned num_threads); + +/** + * @defgroup G_compression Compression and decompression functions + * + * @brief Functions for XPRESS, LZX, and LZMS compression and decompression. + * + * These functions are already used by wimlib internally when appropriate for + * reading and writing WIM archives. But they are exported and documented so + * that they can be used in other applications or libraries for general-purpose + * lossless data compression. They are implemented in highly optimized C code, + * using state-of-the-art compression techniques. The main limitation is the + * lack of sliding window support; this has, however, allowed the algorithms to + * be optimized for block-based compression. + * + * @{ + */ + +/** Opaque compressor handle. */ +struct wimlib_compressor; + +/** Opaque decompressor handle. */ +struct wimlib_decompressor; + +/** + * Set the default compression level for the specified compression type. This + * is the compression level that wimlib_create_compressor() assumes if it is + * called with @p compression_level specified as 0. + * + * wimlib's WIM writing code (e.g. wimlib_write()) will pass 0 to + * wimlib_create_compressor() internally. Therefore, calling this function will + * affect the compression level of any data later written to WIM files using the + * specified compression type. + * + * The initial state, before this function is called, is that all compression + * types have a default compression level of 50. + * + * @param ctype + * Compression type for which to set the default compression level, as one + * of the ::wimlib_compression_type constants. Or, if this is the special + * value -1, the default compression levels for all compression types will + * be set. + * @param compression_level + * The default compression level to set. If 0, the "default default" level + * of 50 is restored. Otherwise, a higher value indicates higher + * compression, whereas a lower value indicates lower compression. See + * wimlib_create_compressor() for more information. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_INVALID_COMPRESSION_TYPE + * @p ctype was neither a supported compression type nor -1. + */ +WIMLIBAPI int +wimlib_set_default_compression_level(int ctype, unsigned int compression_level); + +/** + * Return the approximate number of bytes needed to allocate a compressor with + * wimlib_create_compressor() for the specified compression type, maximum block + * size, and compression level. @p compression_level may be 0, in which case + * the current default compression level for @p ctype is used. Returns 0 if the + * compression type is invalid, or the @p max_block_size for that compression + * type is invalid. + */ +WIMLIBAPI uint64_t +wimlib_get_compressor_needed_memory(enum wimlib_compression_type ctype, + size_t max_block_size, + unsigned int compression_level); + +#define WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE 0x80000000 + +/** + * Allocate a compressor for the specified compression type using the specified + * parameters. This function is part of wimlib's compression API; it is not + * necessary to call this to process a WIM file. + * + * @param ctype + * Compression type for which to create the compressor, as one of the + * ::wimlib_compression_type constants. + * @param max_block_size + * The maximum compression block size to support. This specifies the + * maximum allowed value for the @p uncompressed_size parameter of + * wimlib_compress() when called using this compressor. + * <br/> + * Usually, the amount of memory used by the compressor will scale in + * proportion to the @p max_block_size parameter. + * wimlib_get_compressor_needed_memory() can be used to query the specific + * amount of memory that will be required. + * <br/> + * This parameter must be at least 1 and must be less than or equal to a + * compression-type-specific limit. + * <br/> + * In general, the same value of @p max_block_size must be passed to + * wimlib_create_decompressor() when the data is later decompressed. + * However, some compression types have looser requirements regarding this. + * @param compression_level + * The compression level to use. If 0, the default compression level (50, + * or another value as set through wimlib_set_default_compression_level()) + * is used. Otherwise, a higher value indicates higher compression. The + * values are scaled so that 10 is low compression, 50 is medium + * compression, and 100 is high compression. This is not a percentage; + * values above 100 are also valid. + * <br/> + * Using a higher-than-default compression level can result in a better + * compression ratio, but can significantly reduce performance. Similarly, + * using a lower-than-default compression level can result in better + * performance, but can significantly worsen the compression ratio. The + * exact results will depend heavily on the compression type and what + * algorithms are implemented for it. If you are considering using a + * non-default compression level, you should run benchmarks to see if it is + * worthwhile for your application. + * <br/> + * The compression level does not affect the format of the compressed data. + * Therefore, it is a compressor-only parameter and does not need to be + * passed to the decompressor. + * <br/> + * Since wimlib v1.8.0, this parameter can be OR-ed with the flag + * ::WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE. This creates the compressor in a + * mode where it is allowed to modify the input buffer. Specifically, in + * this mode, if compression succeeds, the input buffer may have been + * modified, whereas if compression does not succeed the input buffer still + * may have been written to but will have been restored exactly to its + * original state. This mode is designed to save some memory when using + * large buffer sizes. + * @param compressor_ret + * A location into which to return the pointer to the allocated compressor. + * The allocated compressor can be used for any number of calls to + * wimlib_compress() before being freed with wimlib_free_compressor(). + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_INVALID_COMPRESSION_TYPE + * @p ctype was not a supported compression type. + * @retval ::WIMLIB_ERR_INVALID_PARAM + * @p max_block_size was invalid for the compression type, or @p + * compressor_ret was @c NULL. + * @retval ::WIMLIB_ERR_NOMEM + * Insufficient memory to allocate the compressor. + */ +WIMLIBAPI int +wimlib_create_compressor(enum wimlib_compression_type ctype, + size_t max_block_size, + unsigned int compression_level, + struct wimlib_compressor **compressor_ret); + +/** + * Compress a buffer of data. + * + * @param uncompressed_data + * Buffer containing the data to compress. + * @param uncompressed_size + * Size, in bytes, of the data to compress. This cannot be greater than + * the @p max_block_size with which wimlib_create_compressor() was called. + * (If it is, the data will not be compressed and 0 will be returned.) + * @param compressed_data + * Buffer into which to write the compressed data. + * @param compressed_size_avail + * Number of bytes available in @p compressed_data. + * @param compressor + * A compressor previously allocated with wimlib_create_compressor(). + * + * @return + * The size of the compressed data, in bytes, or 0 if the data could not be + * compressed to @p compressed_size_avail or fewer bytes. + */ +WIMLIBAPI size_t +wimlib_compress(const void *uncompressed_data, size_t uncompressed_size, + void *compressed_data, size_t compressed_size_avail, + struct wimlib_compressor *compressor); + +/** + * Free a compressor previously allocated with wimlib_create_compressor(). + * + * @param compressor + * The compressor to free. If @c NULL, no action is taken. + */ +WIMLIBAPI void +wimlib_free_compressor(struct wimlib_compressor *compressor); + +/** + * Allocate a decompressor for the specified compression type. This function is + * part of wimlib's compression API; it is not necessary to call this to process + * a WIM file. + * + * @param ctype + * Compression type for which to create the decompressor, as one of the + * ::wimlib_compression_type constants. + * @param max_block_size + * The maximum compression block size to support. This specifies the + * maximum allowed value for the @p uncompressed_size parameter of + * wimlib_decompress(). + * <br/> + * In general, this parameter must be the same as the @p max_block_size + * that was passed to wimlib_create_compressor() when the data was + * compressed. However, some compression types have looser requirements + * regarding this. + * @param decompressor_ret + * A location into which to return the pointer to the allocated + * decompressor. The allocated decompressor can be used for any number of + * calls to wimlib_decompress() before being freed with + * wimlib_free_decompressor(). + * + * @return 0 on success; a ::wimlib_error_code value on failure. + * + * @retval ::WIMLIB_ERR_INVALID_COMPRESSION_TYPE + * @p ctype was not a supported compression type. + * @retval ::WIMLIB_ERR_INVALID_PARAM + * @p max_block_size was invalid for the compression type, or @p + * decompressor_ret was @c NULL. + * @retval ::WIMLIB_ERR_NOMEM + * Insufficient memory to allocate the decompressor. + */ +WIMLIBAPI int +wimlib_create_decompressor(enum wimlib_compression_type ctype, + size_t max_block_size, + struct wimlib_decompressor **decompressor_ret); + +/** + * Decompress a buffer of data. + * + * @param compressed_data + * Buffer containing the data to decompress. + * @param compressed_size + * Size, in bytes, of the data to decompress. + * @param uncompressed_data + * Buffer into which to write the uncompressed data. + * @param uncompressed_size + * Size, in bytes, of the data when uncompressed. This cannot exceed the + * @p max_block_size with which wimlib_create_decompressor() was called. + * (If it does, the data will not be decompressed and a nonzero value will + * be returned.) + * @param decompressor + * A decompressor previously allocated with wimlib_create_decompressor(). + * + * @return 0 on success; nonzero on failure. + * + * No specific error codes are defined; any nonzero value indicates that the + * decompression failed. This can only occur if the data is truly invalid; + * there will never be transient errors like "out of memory", for example. + * + * This function requires that the exact uncompressed size of the data be passed + * as the @p uncompressed_size parameter. If this is not done correctly, + * decompression may fail or the data may be decompressed incorrectly. + */ +WIMLIBAPI int +wimlib_decompress(const void *compressed_data, size_t compressed_size, + void *uncompressed_data, size_t uncompressed_size, + struct wimlib_decompressor *decompressor); + +/** + * Free a decompressor previously allocated with wimlib_create_decompressor(). + * + * @param decompressor + * The decompressor to free. If @c NULL, no action is taken. + */ +WIMLIBAPI void +wimlib_free_decompressor(struct wimlib_decompressor *decompressor); + + +/** + * @} + */ + + +#ifdef __cplusplus +} +#endif + +#endif /* _WIMLIB_H */ diff --git a/src/wimlib/wimlib/alloca.h b/src/wimlib/wimlib/alloca.h new file mode 100644 index 00000000..a3097c6f --- /dev/null +++ b/src/wimlib/wimlib/alloca.h @@ -0,0 +1,10 @@ +#ifndef _WIMLIB_ALLOCA_H +#define _WIMLIB_ALLOCA_H + +#ifdef HAVE_ALLOCA_H +# include <alloca.h> +#else +# include <stdlib.h> +#endif + +#endif /* _WIMLIB_ALLOCA_H */ diff --git a/src/wimlib/wimlib/apply.h b/src/wimlib/wimlib/apply.h new file mode 100644 index 00000000..d801ab0c --- /dev/null +++ b/src/wimlib/wimlib/apply.h @@ -0,0 +1,281 @@ +#ifndef _WIMLIB_APPLY_H +#define _WIMLIB_APPLY_H + +#include "wimlib/compiler.h" +#include "wimlib/file_io.h" +#include "wimlib/list.h" +#include "wimlib/progress.h" +#include "wimlib/types.h" +#include "wimlib.h" + +/* These can be treated as counts (for required_features) or booleans (for + * supported_features). */ +struct wim_features { + unsigned long readonly_files; + unsigned long hidden_files; + unsigned long system_files; + unsigned long archive_files; + unsigned long compressed_files; + unsigned long encrypted_files; + unsigned long encrypted_directories; + unsigned long not_context_indexed_files; + unsigned long sparse_files; + unsigned long named_data_streams; + unsigned long hard_links; + unsigned long reparse_points; + unsigned long symlink_reparse_points; + unsigned long other_reparse_points; + unsigned long security_descriptors; + unsigned long short_names; + unsigned long unix_data; + unsigned long object_ids; + unsigned long timestamps; + unsigned long case_sensitive_filenames; + unsigned long xattrs; +}; + +struct blob_descriptor; +struct read_blob_callbacks; +struct apply_operations; +struct wim_dentry; + +struct apply_ctx { + /* The WIMStruct from which files are being extracted from the currently + * selected image. */ + WIMStruct *wim; + + /* The target of the extraction, usually the path to a directory. */ + const tchar *target; + + /* Length of @target in tchars. */ + size_t target_nchars; + + /* Extraction flags (WIMLIB_EXTRACT_FLAG_*) */ + int extract_flags; + + /* User-provided progress function, or NULL if not specified. */ + wimlib_progress_func_t progfunc; + void *progctx; + + /* Progress data buffer, with progress.extract initialized. */ + union wimlib_progress_info progress; + + /* Features required to extract the files (with counts) */ + struct wim_features required_features; + + /* Features supported by the extraction mode (with booleans) */ + struct wim_features supported_features; + + /* The members below should not be used outside of extract.c */ + const struct apply_operations *apply_ops; + u64 next_progress; + unsigned long invalid_sequence; + unsigned long num_blobs_remaining; + struct list_head blob_list; + const struct read_blob_callbacks *saved_cbs; + struct filedes tmpfile_fd; + tchar *tmpfile_name; + unsigned int count_until_file_progress; +}; + +/* Maximum number of UNIX file descriptors, NTFS attributes, or Windows file + * handles that can be opened simultaneously to extract a blob to multiple + * destinations. */ +#ifndef __APPLE__ +#define MAX_OPEN_FILES 512 +#else /* !__APPLE__ */ +/* With macOS, reduce to 128 because the default value for ulimit -n is 256 */ +#define MAX_OPEN_FILES 128 +#endif /* __APPLE__ */ + +static inline int +extract_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg) +{ + return call_progress(ctx->progfunc, msg, &ctx->progress, ctx->progctx); +} + +int +do_file_extract_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg); + +#define COUNT_PER_FILE_PROGRESS 256 + +static inline int +maybe_do_file_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg) +{ + ctx->progress.extract.current_file_count++; + if (unlikely(!--ctx->count_until_file_progress)) + return do_file_extract_progress(ctx, msg); + return 0; +} + +int +start_file_structure_phase(struct apply_ctx *ctx, u64 end_file_count); + +int +start_file_metadata_phase(struct apply_ctx *ctx, u64 end_file_count); + +/* Report that a file was created, prior to blob extraction. */ +static inline int +report_file_created(struct apply_ctx *ctx) +{ + return maybe_do_file_progress(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE); +} + +/* Report that file metadata was applied, after blob extraction. */ +static inline int +report_file_metadata_applied(struct apply_ctx *ctx) +{ + return maybe_do_file_progress(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_METADATA); +} + +int +end_file_structure_phase(struct apply_ctx *ctx); + +int +end_file_metadata_phase(struct apply_ctx *ctx); + +static inline int +report_apply_error(struct apply_ctx *ctx, int error_code, const tchar *path) +{ + return report_error(ctx->progfunc, ctx->progctx, error_code, path); +} + +bool +detect_sparse_region(const void *data, size_t size, size_t *len_ret); + +static inline bool +maybe_detect_sparse_region(const void *data, size_t size, size_t *len_ret, + bool enabled) +{ + if (!enabled) { + /* Force non-sparse without checking */ + *len_ret = size; + return false; + } + return detect_sparse_region(data, size, len_ret); +} + +#define inode_first_extraction_dentry(inode) \ + ((inode)->i_first_extraction_alias) + +#define inode_for_each_extraction_alias(dentry, inode) \ + for (dentry = inode_first_extraction_dentry(inode); \ + dentry != NULL; \ + dentry = dentry->d_next_extraction_alias) + +int +extract_blob_list(struct apply_ctx *ctx, const struct read_blob_callbacks *cbs); + +/* + * Represents an extraction backend. + */ +struct apply_operations { + + /* Name of the extraction backend. */ + const char *name; + + /* + * Query the features supported by the extraction backend. + * + * @target + * The target string that was provided by the user. (Often a + * directory, but extraction backends are free to interpret this + * differently.) + * + * @supported_features + * A structure, each of whose members represents a feature that may + * be supported by the extraction backend. For each feature that + * the extraction backend supports, this routine must set the + * corresponding member to a nonzero value. + * + * Return 0 if successful; otherwise a positive wimlib error code. + */ + int (*get_supported_features)(const tchar *target, + struct wim_features *supported_features); + + /* + * Main extraction routine. + * + * The extraction backend is provided a list of dentries that have been + * prepared for extraction. It is free to extract them in any way that + * it chooses. Ideally, it should choose a method that maximizes + * performance. + * + * The target string will be provided in ctx->common.target. This might + * be a directory, although extraction backends are free to interpret it + * as they wish. TODO: in some cases, the common extraction code also + * interprets the target string. This should be completely isolated to + * extraction backends. + * + * The extraction flags will be provided in ctx->common.extract_flags. + * Extraction backends should examine them and implement the behaviors + * for as many flags as possible. Some flags are already handled by the + * common extraction code. TODO: this needs to be better formalized. + * + * @dentry_list, the list of dentries, will be ordered such that the + * ancestor of any dentry always precedes any descendents. Unless + * @single_tree_only is set, it's possible that the dentries consist of + * multiple disconnected trees. + * + * 'd_extraction_name' and 'd_extraction_name_nchars' of each dentry + * will be set to indicate the actual name with which the dentry should + * be extracted. This may or may not be the same as 'd_name'. TODO: + * really, the extraction backends should be responsible for generating + * 'd_extraction_name'. + * + * Each dentry will refer to a valid inode in 'd_inode'. Each inode + * will contain a list of dentries of that inode being extracted; this + * list may be shorter than the inode's full dentry list. + * + * The blobs required to be extracted will already be prepared in + * 'apply_ctx'. The extraction backend should call extract_blob_list() + * to extract them. + * + * The will_extract_dentry() utility function, given an arbitrary dentry + * in the WIM image (which may not be in the extraction list), can be + * used to determine if that dentry is in the extraction list. + * + * Return 0 if successful; otherwise a positive wimlib error code. + */ + int (*extract)(struct list_head *dentry_list, struct apply_ctx *ctx); + + /* + * Query whether the unnamed data stream of the specified file will be + * extracted as "externally backed" from the WIM archive itself. If so, + * then the extraction backend is assumed to handle this separately, and + * the common extraction code will not register a usage of the unnamed + * data stream's blob. + * + * This routine is optional. + * + * Return: + * < 0 if the file will *not* be externally backed. + * = 0 if the file will be externally backed. + * > 0 (wimlib error code) if another error occurred. + */ + int (*will_back_from_wim)(struct wim_dentry *dentry, struct apply_ctx *ctx); + + /* + * Size of the backend-specific extraction context. It must contain + * 'struct apply_ctx' as its first member. + */ + size_t context_size; + + /* + * Set this if the extraction backend only supports extracting dentries + * that form a single tree, not multiple trees. + */ + bool single_tree_only; +}; + +#ifdef _WIN32 + extern const struct apply_operations win32_apply_ops; +#else + extern const struct apply_operations unix_apply_ops; +#endif + +#ifdef WITH_NTFS_3G + extern const struct apply_operations ntfs_3g_apply_ops; +#endif + +#endif /* _WIMLIB_APPLY_H */ diff --git a/src/wimlib/wimlib/assert.h b/src/wimlib/wimlib/assert.h new file mode 100644 index 00000000..5c8fe650 --- /dev/null +++ b/src/wimlib/wimlib/assert.h @@ -0,0 +1,7 @@ +#ifndef _WIMLIB_ASSERT_H +#define _WIMLIB_ASSERT_H + +#include <assert.h> +#define wimlib_assert(expr) assert(expr) + +#endif /* _WIMLIB_ASSERT_H */ diff --git a/src/wimlib/wimlib/avl_tree.h b/src/wimlib/wimlib/avl_tree.h new file mode 100644 index 00000000..5ae11ebb --- /dev/null +++ b/src/wimlib/wimlib/avl_tree.h @@ -0,0 +1,344 @@ +/* + * avl_tree.h - intrusive, nonrecursive AVL tree data structure (self-balancing + * binary search tree), header file + * + * Copyright 2022 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _AVL_TREE_H_ +#define _AVL_TREE_H_ + +#include "wimlib/types.h" +#define AVL_INLINE forceinline + +/* Node in an AVL tree. Embed this in some other data structure. */ +struct avl_tree_node { + + /* Pointer to left child or NULL */ + struct avl_tree_node *left; + + /* Pointer to right child or NULL */ + struct avl_tree_node *right; + + /* Pointer to parent combined with the balance factor. This saves 4 or + * 8 bytes of memory depending on the CPU architecture. + * + * Low 2 bits: One greater than the balance factor of this subtree, + * which is equal to height(right) - height(left). The mapping is: + * + * 00 => -1 + * 01 => 0 + * 10 => +1 + * 11 => undefined + * + * The rest of the bits are the pointer to the parent node. It must be + * 4-byte aligned, and it will be NULL if this is the root node and + * therefore has no parent. */ + uintptr_t parent_balance; +}; + +/* Cast an AVL tree node to the containing data structure. */ +#define avl_tree_entry(entry, type, member) \ + ((type*) ((char *)(entry) - offsetof(type, member))) + +/* Returns a pointer to the parent of the specified AVL tree node, or NULL if it + * is already the root of the tree. */ +static AVL_INLINE struct avl_tree_node * +avl_get_parent(const struct avl_tree_node *node) +{ + return (struct avl_tree_node *)(node->parent_balance & ~3); +} + +/* (Internal use only) */ +void +avl_tree_rebalance_after_insert(struct avl_tree_node **root_ptr, + struct avl_tree_node *inserted); + +/* + * Looks up an item in the specified AVL tree. + * + * @root + * Pointer to the root of the AVL tree. (This can be NULL --- that just + * means the tree is empty.) + * + * @cmp_ctx + * First argument to pass to the comparison callback. This generally + * should be a pointer to an object equal to the one being searched for. + * + * @cmp + * Comparison callback. Must return < 0, 0, or > 0 if the first argument + * is less than, equal to, or greater than the second argument, + * respectively. The first argument will be @cmp_ctx and the second + * argument will be a pointer to the AVL tree node of an item in the tree. + * + * Returns a pointer to the AVL tree node of the resulting item, or NULL if the + * item was not found. + * + * Example: + * + * struct int_wrapper { + * int data; + * struct avl_tree_node index_node; + * }; + * + * static int _avl_cmp_int_to_node(const void *intptr, + * const struct avl_tree_node *nodeptr) + * { + * int n1 = *(const int *)intptr; + * int n2 = avl_tree_entry(nodeptr, struct int_wrapper, index_node)->data; + * if (n1 < n2) + * return -1; + * else if (n1 > n2) + * return 1; + * else + * return 0; + * } + * + * bool contains_int(struct avl_tree_node *root, int n) + * { + * struct avl_tree_node *result; + * + * result = avl_tree_lookup(root, &n, _avl_cmp_int_to_node); + * return result ? true : false; + * } + */ +static AVL_INLINE struct avl_tree_node * +avl_tree_lookup(const struct avl_tree_node *root, + const void *cmp_ctx, + int (*cmp)(const void *, const struct avl_tree_node *)) +{ + const struct avl_tree_node *cur = root; + + while (cur) { + int res = (*cmp)(cmp_ctx, cur); + if (res < 0) + cur = cur->left; + else if (res > 0) + cur = cur->right; + else + break; + } + return (struct avl_tree_node*)cur; +} + +/* Same as avl_tree_lookup(), but uses a more specific type for the comparison + * function. Specifically, with this function the item being searched for is + * expected to be in the same format as those already in the tree, with an + * embedded 'struct avl_tree_node'. */ +static AVL_INLINE struct avl_tree_node * +avl_tree_lookup_node(const struct avl_tree_node *root, + const struct avl_tree_node *node, + int (*cmp)(const struct avl_tree_node *, + const struct avl_tree_node *)) +{ + const struct avl_tree_node *cur = root; + + while (cur) { + int res = (*cmp)(node, cur); + if (res < 0) + cur = cur->left; + else if (res > 0) + cur = cur->right; + else + break; + } + return (struct avl_tree_node*)cur; +} + +/* + * Inserts an item into the specified AVL tree. + * + * @root_ptr + * Location of the AVL tree's root pointer. Indirection is needed because + * the root node may change as a result of rotations caused by the + * insertion. Initialize *root_ptr to NULL for an empty tree. + * + * @item + * Pointer to the `struct avl_tree_node' embedded in the item to insert. + * No members in it need be pre-initialized, although members in the + * containing structure should be pre-initialized so that @cmp can use them + * in comparisons. + * + * @cmp + * Comparison callback. Must return < 0, 0, or > 0 if the first argument + * is less than, equal to, or greater than the second argument, + * respectively. The first argument will be @item and the second + * argument will be a pointer to an AVL tree node embedded in some + * previously-inserted item to which @item is being compared. + * + * If no item in the tree is comparatively equal (via @cmp) to @item, inserts + * @item and returns NULL. Otherwise does nothing and returns a pointer to the + * AVL tree node embedded in the previously-inserted item which compared equal + * to @item. + * + * Example: + * + * struct int_wrapper { + * int data; + * struct avl_tree_node index_node; + * }; + * + * #define GET_DATA(i) avl_tree_entry((i), struct int_wrapper, index_node)->data + * + * static int _avl_cmp_ints(const struct avl_tree_node *node1, + * const struct avl_tree_node *node2) + * { + * int n1 = GET_DATA(node1); + * int n2 = GET_DATA(node2); + * if (n1 < n2) + * return -1; + * else if (n1 > n2) + * return 1; + * else + * return 0; + * } + * + * bool insert_int(struct avl_tree_node **root_ptr, int data) + * { + * struct int_wrapper *i = malloc(sizeof(struct int_wrapper)); + * i->data = data; + * if (avl_tree_insert(root_ptr, &i->index_node, _avl_cmp_ints)) { + * // Duplicate. + * free(i); + * return false; + * } + * return true; + * } + */ +static AVL_INLINE struct avl_tree_node * +avl_tree_insert(struct avl_tree_node **root_ptr, + struct avl_tree_node *item, + int (*cmp)(const struct avl_tree_node *, + const struct avl_tree_node *)) +{ + struct avl_tree_node **cur_ptr = root_ptr, *cur = NULL; + int res; + + while (*cur_ptr) { + cur = *cur_ptr; + res = (*cmp)(item, cur); + if (res < 0) + cur_ptr = &cur->left; + else if (res > 0) + cur_ptr = &cur->right; + else + return cur; + } + *cur_ptr = item; + item->parent_balance = (uintptr_t)cur | 1; + avl_tree_rebalance_after_insert(root_ptr, item); + return NULL; +} + +/* Removes an item from the specified AVL tree. + * See implementation for details. */ +void +avl_tree_remove(struct avl_tree_node **root_ptr, struct avl_tree_node *node); + +/* Nonrecursive AVL tree traversal functions */ + +struct avl_tree_node * +avl_tree_first_in_order(const struct avl_tree_node *root); + +struct avl_tree_node * +avl_tree_last_in_order(const struct avl_tree_node *root); + +struct avl_tree_node * +avl_tree_next_in_order(const struct avl_tree_node *node); + +struct avl_tree_node * +avl_tree_prev_in_order(const struct avl_tree_node *node); + +struct avl_tree_node * +avl_tree_first_in_postorder(const struct avl_tree_node *root); + +struct avl_tree_node * +avl_tree_next_in_postorder(const struct avl_tree_node *prev, + const struct avl_tree_node *prev_parent); + +/* + * Iterate through the nodes in an AVL tree in sorted order. + * You may not modify the tree during the iteration. + * + * @child_struct + * Variable that will receive a pointer to each struct inserted into the + * tree. + * @root + * Root of the AVL tree. + * @struct_name + * Type of *child_struct. + * @struct_member + * Member of @struct_name type that is the AVL tree node. + * + * Example: + * + * struct int_wrapper { + * int data; + * struct avl_tree_node index_node; + * }; + * + * void print_ints(struct avl_tree_node *root) + * { + * struct int_wrapper *i; + * + * avl_tree_for_each_in_order(i, root, struct int_wrapper, index_node) + * printf("%d\n", i->data); + * } + */ +#define avl_tree_for_each_in_order(child_struct, root, \ + struct_name, struct_member) \ + for (struct avl_tree_node *_cur = \ + avl_tree_first_in_order(root); \ + _cur && ((child_struct) = \ + avl_tree_entry(_cur, struct_name, \ + struct_member), 1); \ + _cur = avl_tree_next_in_order(_cur)) + +/* + * Like avl_tree_for_each_in_order(), but uses the reverse order. + */ +#define avl_tree_for_each_in_reverse_order(child_struct, root, \ + struct_name, struct_member) \ + for (struct avl_tree_node *_cur = \ + avl_tree_last_in_order(root); \ + _cur && ((child_struct) = \ + avl_tree_entry(_cur, struct_name, \ + struct_member), 1); \ + _cur = avl_tree_prev_in_order(_cur)) + +/* + * Like avl_tree_for_each_in_order(), but iterates through the nodes in + * postorder, so the current node may be deleted or freed. + */ +#define avl_tree_for_each_in_postorder(child_struct, root, \ + struct_name, struct_member) \ + for (struct avl_tree_node *_cur = \ + avl_tree_first_in_postorder(root), *_parent; \ + _cur && ((child_struct) = \ + avl_tree_entry(_cur, struct_name, \ + struct_member), 1) \ + && (_parent = avl_get_parent(_cur), 1); \ + _cur = avl_tree_next_in_postorder(_cur, _parent)) + +#endif /* _AVL_TREE_H_ */ diff --git a/src/wimlib/wimlib/bitops.h b/src/wimlib/wimlib/bitops.h new file mode 100644 index 00000000..e5c4872e --- /dev/null +++ b/src/wimlib/wimlib/bitops.h @@ -0,0 +1,106 @@ +/* + * bitops.h - inline functions for bit manipulation + * + * Copyright 2022 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _WIMLIB_BITOPS_H +#define _WIMLIB_BITOPS_H + +#include "wimlib/compiler.h" +#include "wimlib/types.h" + +/* + * Bit Scan Reverse (BSR) - find the 0-based index (relative to the least + * significant bit) of the *most* significant 1 bit in the input value. The + * input value must be nonzero! + */ + +static forceinline unsigned +bsr32(u32 v) +{ + return 31 - __builtin_clz(v); +} + +static forceinline unsigned +bsr64(u64 v) +{ + return 63 - __builtin_clzll(v); +} + +static forceinline unsigned +bsrw(machine_word_t v) +{ + STATIC_ASSERT(WORDBITS == 32 || WORDBITS == 64); + if (WORDBITS == 32) + return bsr32(v); + else + return bsr64(v); +} + +/* + * Bit Scan Forward (BSF) - find the 0-based index (relative to the least + * significant bit) of the *least* significant 1 bit in the input value. The + * input value must be nonzero! + */ + +static forceinline unsigned +bsf32(u32 v) +{ + return __builtin_ctz(v); +} + +static forceinline unsigned +bsf64(u64 v) +{ + return __builtin_ctzll(v); +} + +static forceinline unsigned +bsfw(machine_word_t v) +{ + STATIC_ASSERT(WORDBITS == 32 || WORDBITS == 64); + if (WORDBITS == 32) + return bsf32(v); + else + return bsf64(v); +} + +/* Return the log base 2 of 'n', rounded up to the nearest integer. */ +static forceinline unsigned +ilog2_ceil(size_t n) +{ + if (n <= 1) + return 0; + return 1 + bsrw(n - 1); +} + +/* Round 'n' up to the nearest power of 2 */ +static forceinline size_t +roundup_pow_of_2(size_t n) +{ + return (size_t)1 << ilog2_ceil(n); +} + +#endif /* _WIMLIB_BITOPS_H */ diff --git a/src/wimlib/wimlib/blob_table.h b/src/wimlib/wimlib/blob_table.h new file mode 100644 index 00000000..2c9aab15 --- /dev/null +++ b/src/wimlib/wimlib/blob_table.h @@ -0,0 +1,437 @@ +#ifndef _WIMLIB_BLOB_TABLE_H +#define _WIMLIB_BLOB_TABLE_H + +#include "wimlib/list.h" +#include "wimlib/resource.h" +#include "wimlib/sha1.h" +#include "wimlib/types.h" + +/* An enumerated type that identifies where a blob's data is located. */ +enum blob_location { + + /* The blob's data does not exist. This is a temporary state only. */ + BLOB_NONEXISTENT = 0, + + /* The blob's data is available in the WIM resource identified by the + * `struct wim_resource_descriptor' pointed to by @rdesc. + * @offset_in_res identifies the offset at which this particular blob + * begins in the uncompressed data of the resource. */ + BLOB_IN_WIM, + + /* The blob's data is available as the contents of the file named by + * @file_on_disk. */ + BLOB_IN_FILE_ON_DISK, + + /* The blob's data is available as the contents of the in-memory buffer + * pointed to by @attached_buffer. */ + BLOB_IN_ATTACHED_BUFFER, + +#ifdef WITH_FUSE + /* The blob's data is available as the contents of the file with name + * @staging_file_name relative to the open directory file descriptor + * @staging_dir_fd. */ + BLOB_IN_STAGING_FILE, +#endif + +#ifdef WITH_NTFS_3G + /* The blob's data is available as the contents of an NTFS attribute + * accessible through libntfs-3g. @ntfs_loc points to a structure which + * identifies the attribute. */ + BLOB_IN_NTFS_VOLUME, +#endif + +#ifdef _WIN32 + /* Windows only: the blob's data is available in the file (or named data + * stream) specified by @windows_file. The data might be only properly + * accessible through the Windows API. */ + BLOB_IN_WINDOWS_FILE, +#endif +}; + +/* A "blob extraction target" is a stream, and the inode to which that stream + * belongs, to which a blob needs to be extracted as part of an extraction + * operation. Since blobs are single-instanced, a blob may have multiple + * extraction targets. */ +struct blob_extraction_target { + struct wim_inode *inode; + struct wim_inode_stream *stream; +}; + +/* + * Descriptor for a "blob", which is a known length sequence of binary data. + * + * Within a WIM file, blobs are single instanced and are identified by SHA-1 + * message digest. + */ +struct blob_descriptor { + + /* List node for a hash bucket of the blob table */ + struct hlist_node hash_list; + + /* + * Uncompressed size of this blob. + * + * In most cases we are now enforcing that this is nonzero; i.e. an + * empty stream will have "no blob" rather than "an empty blob". The + * exceptions are: + * + * - blob descriptors with 'blob_location == BLOB_NONEXISTENT', + * e.g. placeholder entries for new metadata resources or for + * blobs required for pipable WIM extraction. In these cases the + * size is not meaningful information anyway. + * - blob descriptors with 'blob_location == BLOB_IN_STAGING_FILE' + * can vary their size over time, including to 0. + */ + u64 size; + + union { + /* + * For unhashed == 0: 'hash' is the SHA-1 message digest of the + * blob's data. 'hash_short' allows accessing just a prefix of + * the SHA-1 message digest, which is useful for getting a "hash + * code" for hash table lookup/insertion. + */ + u8 hash[SHA1_HASH_SIZE]; + size_t hash_short; + + /* For unhashed == 1: these variables make it possible to find + * the stream that references this blob. There can be at most + * one such reference, since duplicate blobs can only be joined + * after they have been hashed. */ + struct { + struct wim_inode *back_inode; + u32 back_stream_id; + }; + }; + + /* Number of times this blob is referenced by file streams in WIM + * images. See blob_decrement_refcnt() for information about the + * limitations of this field. */ + u32 refcnt; + + /* + * When a WIM file is written, this is set to the number of references + * (from file streams) to this blob in the output WIM file. + * + * During extraction, this is set to the number of targets to which this + * blob is being extracted. + * + * During image export, this is set to the number of references of this + * blob that originated from the source WIM. + * + * When mounting a WIM image read-write, this is set to the number of + * extra references to this blob preemptively taken to allow later + * saving the modified image as a new image and leaving the original + * image alone. + */ + u32 out_refcnt; + +#ifdef WITH_FUSE + /* Number of open file descriptors to this blob during a FUSE mount of + * a WIM image. */ + u16 num_opened_fds; +#endif + + /* One of the `enum blob_location' values documented above. */ + u16 blob_location : 4; + + /* 1 iff this blob contains "metadata" as opposed to data. */ + u16 is_metadata : 1; + + /* 1 iff the SHA-1 message digest of this blob is unknown. */ + u16 unhashed : 1; + + /* 1 iff this blob has failed its checksum. */ + u16 corrupted : 1; + + /* Temporary fields used when writing blobs; set as documented for + * prepare_blob_list_for_write(). */ + u16 unique_size : 1; + u16 will_be_in_output_wim : 1; + + u16 may_send_done_with_file : 1; + + /* Only used by wimlib_export_image() */ + u16 was_exported : 1; + + /* Specification of where this blob's data is located. Which member of + * this union is valid is determined by the @blob_location field. */ + union { + /* BLOB_IN_WIM */ + struct { + struct wim_resource_descriptor *rdesc; + u64 offset_in_res; + + /* Links together blobs that share the same underlying + * WIM resource. The head is rdesc->blob_list. */ + struct list_head rdesc_node; + }; + + struct { + + union { + + /* BLOB_IN_FILE_ON_DISK + * BLOB_IN_WINDOWS_FILE */ + struct { + union { + tchar *file_on_disk; + struct windows_file *windows_file; + }; + struct wim_inode *file_inode; + }; + + /* BLOB_IN_ATTACHED_BUFFER */ + void *attached_buffer; + + #ifdef WITH_FUSE + /* BLOB_IN_STAGING_FILE */ + struct { + char *staging_file_name; + int staging_dir_fd; + }; + #endif + + #ifdef WITH_NTFS_3G + /* BLOB_IN_NTFS_VOLUME */ + struct ntfs_location *ntfs_loc; + #endif + }; + + /* List link for per-WIM-image list of unhashed blobs */ + struct list_head unhashed_list; + }; + }; + + /* Temporary fields */ + union { + /* Fields used temporarily during WIM file writing. */ + struct { + union { + /* List node used for blob size table. */ + struct hlist_node hash_list_2; + + /* Metadata for the underlying solid resource in + * the WIM being written (only valid if + * WIM_RESHDR_FLAG_SOLID set in + * out_reshdr.flags). */ + struct { + u64 out_res_offset_in_wim; + u64 out_res_size_in_wim; + u64 out_res_uncompressed_size; + }; + }; + + /* Links blobs being written to the WIM. */ + struct list_head write_blobs_list; + + union { + /* Metadata for this blob in the WIM being + * written. */ + struct wim_reshdr out_reshdr; + + struct { + /* Name under which this blob is being + * sorted; used only when sorting blobs + * for solid compression. */ + utf16lechar *solid_sort_name; + size_t solid_sort_name_nbytes; + }; + }; + }; + + /* Used temporarily during extraction. This is an array of + * references to the streams being extracted that use this blob. + * out_refcnt tracks the number of slots filled. */ + union { + struct blob_extraction_target inline_blob_extraction_targets[3]; + struct { + struct blob_extraction_target *blob_extraction_targets; + u32 alloc_blob_extraction_targets; + }; + }; + }; + + /* Temporary list fields. */ + union { + /* Links blobs for writing blob table. */ + struct list_head blob_table_list; + + /* Links blobs being extracted. */ + struct list_head extraction_list; + + /* Links blobs being exported. */ + struct list_head export_blob_list; + }; +}; + +struct blob_table * +new_blob_table(size_t capacity); + +void +free_blob_table(struct blob_table *table); + +int +read_blob_table(WIMStruct *wim); + +int +write_blob_table_from_blob_list(struct list_head *blob_list, + struct filedes *out_fd, + u16 part_number, + struct wim_reshdr *out_reshdr, + int write_resource_flags); + +struct blob_descriptor * +new_blob_descriptor(void); + +struct blob_descriptor * +clone_blob_descriptor(const struct blob_descriptor *blob); + +void +blob_decrement_refcnt(struct blob_descriptor *blob, struct blob_table *table); + +void +blob_subtract_refcnt(struct blob_descriptor *blob, struct blob_table *table, + u32 count); + +#ifdef WITH_FUSE +void +blob_decrement_num_opened_fds(struct blob_descriptor *blob); +#endif + +void +blob_release_location(struct blob_descriptor *blob); + +void +free_blob_descriptor(struct blob_descriptor *blob); + +void +blob_table_insert(struct blob_table *table, struct blob_descriptor *blob); + +void +blob_table_unlink(struct blob_table *table, struct blob_descriptor *blob); + +struct blob_descriptor * +lookup_blob(const struct blob_table *table, const u8 *hash); + +int +for_blob_in_table(struct blob_table *table, + int (*visitor)(struct blob_descriptor *, void *), void *arg); + +int +for_blob_in_table_sorted_by_sequential_order(struct blob_table *table, + int (*visitor)(struct blob_descriptor *, void *), + void *arg); + +struct wimlib_resource_entry; + +void +blob_to_wimlib_resource_entry(const struct blob_descriptor *blob, + struct wimlib_resource_entry *wentry); + +int +sort_blob_list(struct list_head *blob_list, size_t list_head_offset, + int (*compar)(const void *, const void*)); + +int +sort_blob_list_by_sequential_order(struct list_head *blob_list, + size_t list_head_offset); + +int +cmp_blobs_by_sequential_order(const void *p1, const void *p2); + +static inline const struct blob_extraction_target * +blob_extraction_targets(const struct blob_descriptor *blob) +{ + if (blob->out_refcnt <= ARRAY_LEN(blob->inline_blob_extraction_targets)) + return blob->inline_blob_extraction_targets; + else + return blob->blob_extraction_targets; +} + +/* + * Declare that the specified blob is located in the specified WIM resource at + * the specified offset. The caller is expected to set blob->size if required. + */ +static inline void +blob_set_is_located_in_wim_resource(struct blob_descriptor *blob, + struct wim_resource_descriptor *rdesc, + u64 offset_in_res) +{ + blob->blob_location = BLOB_IN_WIM; + blob->rdesc = rdesc; + list_add_tail(&blob->rdesc_node, &rdesc->blob_list); + blob->offset_in_res = offset_in_res; +} + +static inline void +blob_unset_is_located_in_wim_resource(struct blob_descriptor *blob) +{ + list_del(&blob->rdesc_node); + blob->blob_location = BLOB_NONEXISTENT; +} + +static inline void +blob_set_is_located_in_attached_buffer(struct blob_descriptor *blob, + void *buffer, size_t size) +{ + blob->blob_location = BLOB_IN_ATTACHED_BUFFER; + blob->attached_buffer = buffer; + blob->size = size; +} + +static inline bool +blob_is_in_file(const struct blob_descriptor *blob) +{ + return blob->blob_location == BLOB_IN_FILE_ON_DISK +#ifdef _WIN32 + || blob->blob_location == BLOB_IN_WINDOWS_FILE +#endif + ; +} + +#ifdef _WIN32 +const wchar_t * +get_windows_file_path(const struct windows_file *file); +#endif + +static inline const tchar * +blob_file_path(const struct blob_descriptor *blob) +{ +#ifdef _WIN32 + if (blob->blob_location == BLOB_IN_WINDOWS_FILE) + return get_windows_file_path(blob->windows_file); +#endif + return blob->file_on_disk; +} + +struct blob_descriptor * +new_blob_from_data_buffer(const void *buffer, size_t size, + struct blob_table *blob_table); + +struct blob_descriptor * +after_blob_hashed(struct blob_descriptor *blob, + struct blob_descriptor **back_ptr, + struct blob_table *blob_table, struct wim_inode *inode); + +int +hash_unhashed_blob(struct blob_descriptor *blob, struct blob_table *blob_table, + struct blob_descriptor **blob_ret); + +struct blob_descriptor ** +retrieve_pointer_to_unhashed_blob(struct blob_descriptor *blob); + +static inline void +prepare_unhashed_blob(struct blob_descriptor *blob, + struct wim_inode *back_inode, u32 stream_id, + struct list_head *unhashed_blobs) +{ + if (!blob) + return; + blob->unhashed = 1; + blob->back_inode = back_inode; + blob->back_stream_id = stream_id; + list_add_tail(&blob->unhashed_list, unhashed_blobs); +} + +#endif /* _WIMLIB_BLOB_TABLE_H */ diff --git a/src/wimlib/wimlib/bt_matchfinder.h b/src/wimlib/wimlib/bt_matchfinder.h new file mode 100644 index 00000000..14e9c5ca --- /dev/null +++ b/src/wimlib/wimlib/bt_matchfinder.h @@ -0,0 +1,378 @@ +/* + * bt_matchfinder.h - Lempel-Ziv matchfinding with a hash table of binary trees + * + * Copyright 2022 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * ---------------------------------------------------------------------------- + * + * This is a Binary Trees (bt) based matchfinder. + * + * The main data structure is a hash table where each hash bucket contains a + * binary tree of sequences whose first 4 bytes share the same hash code. Each + * sequence is identified by its starting position in the input buffer. Each + * binary tree is always sorted such that each left child represents a sequence + * lexicographically lesser than its parent and each right child represents a + * sequence lexicographically greater than its parent. + * + * The algorithm processes the input buffer sequentially. At each byte + * position, the hash code of the first 4 bytes of the sequence beginning at + * that position (the sequence being matched against) is computed. This + * identifies the hash bucket to use for that position. Then, a new binary tree + * node is created to represent the current sequence. Then, in a single tree + * traversal, the hash bucket's binary tree is searched for matches and is + * re-rooted at the new node. + * + * Compared to the simpler algorithm that uses linked lists instead of binary + * trees (see hc_matchfinder.h), the binary tree version gains more information + * at each node visitation. Ideally, the binary tree version will examine only + * 'log(n)' nodes to find the same matches that the linked list version will + * find by examining 'n' nodes. In addition, the binary tree version can + * examine fewer bytes at each node by taking advantage of the common prefixes + * that result from the sort order, whereas the linked list version may have to + * examine up to the full length of the match at each node. + * + * However, it is not always best to use the binary tree version. It requires + * nearly twice as much memory as the linked list version, and it takes time to + * keep the binary trees sorted, even at positions where the compressor does not + * need matches. Generally, when doing fast compression on small buffers, + * binary trees are the wrong approach. They are best suited for thorough + * compression and/or large buffers. + * + * ---------------------------------------------------------------------------- + */ + + +#include <string.h> + +#include "wimlib/matchfinder_common.h" + +#define BT_MATCHFINDER_HASH3_ORDER 15 +#define BT_MATCHFINDER_HASH3_WAYS 2 +#define BT_MATCHFINDER_HASH4_ORDER 16 + +/* TEMPLATED functions and structures have MF_SUFFIX appended to their name. */ +#undef TEMPLATED +#define TEMPLATED(name) CONCAT(name, MF_SUFFIX) + +#ifndef _WIMLIB_BT_MATCHFINDER_H +#define _WIMLIB_BT_MATCHFINDER_H + +/* Non-templated definitions */ + +/* Representation of a match found by the bt_matchfinder */ +struct lz_match { + + /* The number of bytes matched. */ + u32 length; + + /* The offset back from the current position that was matched. */ + u32 offset; +}; + +#endif /* _WIMLIB_BT_MATCHFINDER_H */ + +struct TEMPLATED(bt_matchfinder) { + + /* The hash table for finding length 2 matches, if enabled */ +#ifdef BT_MATCHFINDER_HASH2_ORDER + mf_pos_t hash2_tab[1UL << BT_MATCHFINDER_HASH2_ORDER]; +#endif + + /* The hash table for finding length 3 matches */ + mf_pos_t hash3_tab[1UL << BT_MATCHFINDER_HASH3_ORDER][BT_MATCHFINDER_HASH3_WAYS]; + + /* The hash table which contains the roots of the binary trees for + * finding length 4+ matches */ + mf_pos_t hash4_tab[1UL << BT_MATCHFINDER_HASH4_ORDER]; + + /* The child node references for the binary trees. The left and right + * children of the node for the sequence with position 'pos' are + * 'child_tab[pos * 2]' and 'child_tab[pos * 2 + 1]', respectively. */ + mf_pos_t child_tab[]; +}; + +/* Return the number of bytes that must be allocated for a 'bt_matchfinder' that + * can work with buffers up to the specified size. */ +static forceinline size_t +TEMPLATED(bt_matchfinder_size)(size_t max_bufsize) +{ + return sizeof(struct TEMPLATED(bt_matchfinder)) + + (2 * max_bufsize * sizeof(mf_pos_t)); +} + +/* Prepare the matchfinder for a new input buffer. */ +static forceinline void +TEMPLATED(bt_matchfinder_init)(struct TEMPLATED(bt_matchfinder) *mf) +{ + memset(mf, 0, sizeof(*mf)); +} + +static forceinline mf_pos_t * +TEMPLATED(bt_left_child)(struct TEMPLATED(bt_matchfinder) *mf, u32 node) +{ + return &mf->child_tab[(node << 1) + 0]; +} + +static forceinline mf_pos_t * +TEMPLATED(bt_right_child)(struct TEMPLATED(bt_matchfinder) *mf, u32 node) +{ + return &mf->child_tab[(node << 1) + 1]; +} + +/* The minimum permissible value of 'max_len' for bt_matchfinder_get_matches() + * and bt_matchfinder_skip_byte(). There must be sufficiently many bytes + * remaining to load a 32-bit integer from the *next* position. */ +#define BT_MATCHFINDER_REQUIRED_NBYTES 5 + +/* Advance the binary tree matchfinder by one byte, optionally recording + * matches. @record_matches should be a compile-time constant. */ +static forceinline struct lz_match * +TEMPLATED(bt_matchfinder_advance_one_byte)(struct TEMPLATED(bt_matchfinder) * const mf, + const u8 * const in_begin, + const ptrdiff_t cur_pos, + const u32 max_len, + const u32 nice_len, + const u32 max_search_depth, + u32 * const next_hashes, + u32 * const best_len_ret, + struct lz_match *lz_matchptr, + const bool record_matches) +{ + const u8 *in_next = in_begin + cur_pos; + u32 depth_remaining = max_search_depth; + u32 next_hashseq; + u32 hash3; + u32 hash4; +#ifdef BT_MATCHFINDER_HASH2_ORDER + u16 seq2; + u32 hash2; +#endif + STATIC_ASSERT(BT_MATCHFINDER_HASH3_WAYS >= 1 && + BT_MATCHFINDER_HASH3_WAYS <= 2); + u32 cur_node; +#if BT_MATCHFINDER_HASH3_WAYS >= 2 + u32 cur_node_2; +#endif + const u8 *matchptr; + mf_pos_t *pending_lt_ptr, *pending_gt_ptr; + u32 best_lt_len, best_gt_len; + u32 len; + u32 best_len = 3; + + next_hashseq = get_unaligned_le32(in_next + 1); + + hash3 = next_hashes[0]; + hash4 = next_hashes[1]; + + next_hashes[0] = lz_hash(next_hashseq & 0xFFFFFF, BT_MATCHFINDER_HASH3_ORDER); + next_hashes[1] = lz_hash(next_hashseq, BT_MATCHFINDER_HASH4_ORDER); + prefetchw(&mf->hash3_tab[next_hashes[0]]); + prefetchw(&mf->hash4_tab[next_hashes[1]]); + +#ifdef BT_MATCHFINDER_HASH2_ORDER + seq2 = load_u16_unaligned(in_next); + hash2 = lz_hash(seq2, BT_MATCHFINDER_HASH2_ORDER); + cur_node = mf->hash2_tab[hash2]; + mf->hash2_tab[hash2] = cur_pos; + if (record_matches && + seq2 == load_u16_unaligned(&in_begin[cur_node]) && + likely(in_next != in_begin)) + { + lz_matchptr->length = 2; + lz_matchptr->offset = in_next - &in_begin[cur_node]; + lz_matchptr++; + } +#endif + + cur_node = mf->hash3_tab[hash3][0]; + mf->hash3_tab[hash3][0] = cur_pos; +#if BT_MATCHFINDER_HASH3_WAYS >= 2 + cur_node_2 = mf->hash3_tab[hash3][1]; + mf->hash3_tab[hash3][1] = cur_node; +#endif + if (record_matches && likely(in_next != in_begin)) { + u32 seq3 = load_u24_unaligned(in_next); + if (seq3 == load_u24_unaligned(&in_begin[cur_node])) { + lz_matchptr->length = 3; + lz_matchptr->offset = in_next - &in_begin[cur_node]; + lz_matchptr++; + } + #if BT_MATCHFINDER_HASH3_WAYS >= 2 + else if (seq3 == load_u24_unaligned(&in_begin[cur_node_2])) { + lz_matchptr->length = 3; + lz_matchptr->offset = in_next - &in_begin[cur_node_2]; + lz_matchptr++; + } + #endif + } + + cur_node = mf->hash4_tab[hash4]; + mf->hash4_tab[hash4] = cur_pos; + + pending_lt_ptr = TEMPLATED(bt_left_child)(mf, cur_pos); + pending_gt_ptr = TEMPLATED(bt_right_child)(mf, cur_pos); + + if (!cur_node) { + *pending_lt_ptr = 0; + *pending_gt_ptr = 0; + *best_len_ret = best_len; + return lz_matchptr; + } + + best_lt_len = 0; + best_gt_len = 0; + len = 0; + + for (;;) { + matchptr = &in_begin[cur_node]; + + if (matchptr[len] == in_next[len]) { + len = lz_extend(in_next, matchptr, len + 1, max_len); + if (!record_matches || len > best_len) { + if (record_matches) { + best_len = len; + lz_matchptr->length = len; + lz_matchptr->offset = in_next - matchptr; + lz_matchptr++; + } + if (len >= nice_len) { + *pending_lt_ptr = *TEMPLATED(bt_left_child)(mf, cur_node); + *pending_gt_ptr = *TEMPLATED(bt_right_child)(mf, cur_node); + *best_len_ret = best_len; + return lz_matchptr; + } + } + } + + if (matchptr[len] < in_next[len]) { + *pending_lt_ptr = cur_node; + pending_lt_ptr = TEMPLATED(bt_right_child)(mf, cur_node); + cur_node = *pending_lt_ptr; + best_lt_len = len; + if (best_gt_len < len) + len = best_gt_len; + } else { + *pending_gt_ptr = cur_node; + pending_gt_ptr = TEMPLATED(bt_left_child)(mf, cur_node); + cur_node = *pending_gt_ptr; + best_gt_len = len; + if (best_lt_len < len) + len = best_lt_len; + } + + if (!cur_node || !--depth_remaining) { + *pending_lt_ptr = 0; + *pending_gt_ptr = 0; + *best_len_ret = best_len; + return lz_matchptr; + } + } +} + +/* + * Retrieve a list of matches with the current position. + * + * @mf + * The matchfinder structure. + * @in_begin + * Pointer to the beginning of the input buffer. + * @cur_pos + * The current position in the input buffer relative to @in_begin (the + * position of the sequence being matched against). + * @max_len + * The maximum permissible match length at this position. Must be >= + * BT_MATCHFINDER_REQUIRED_NBYTES. + * @nice_len + * Stop searching if a match of at least this length is found. + * Must be <= @max_len. + * @max_search_depth + * Limit on the number of potential matches to consider. Must be >= 1. + * @next_hashes + * The precomputed hash codes for the sequence beginning at @in_next. + * These will be used and then updated with the precomputed hashcodes for + * the sequence beginning at @in_next + 1. + * @best_len_ret + * If a match of length >= 4 was found, then the length of the longest such + * match is written here; otherwise 3 is written here. (Note: this is + * redundant with the 'struct lz_match' array, but this is easier for the + * compiler to optimize when inlined and the caller immediately does a + * check against 'best_len'.) + * @lz_matchptr + * An array in which this function will record the matches. The recorded + * matches will be sorted by strictly increasing length and (non-strictly) + * increasing offset. The maximum number of matches that may be found is + * 'nice_len - 1', or one less if length 2 matches are disabled. + * + * The return value is a pointer to the next available slot in the @lz_matchptr + * array. (If no matches were found, this will be the same as @lz_matchptr.) + */ +static forceinline struct lz_match * +TEMPLATED(bt_matchfinder_get_matches)(struct TEMPLATED(bt_matchfinder) *mf, + const u8 *in_begin, + ptrdiff_t cur_pos, + u32 max_len, + u32 nice_len, + u32 max_search_depth, + u32 next_hashes[2], + u32 *best_len_ret, + struct lz_match *lz_matchptr) +{ + return TEMPLATED(bt_matchfinder_advance_one_byte)(mf, + in_begin, + cur_pos, + max_len, + nice_len, + max_search_depth, + next_hashes, + best_len_ret, + lz_matchptr, + true); +} + +/* + * Advance the matchfinder, but don't record any matches. + * + * This is very similar to bt_matchfinder_get_matches() because both functions + * must do hashing and tree re-rooting. + */ +static forceinline void +TEMPLATED(bt_matchfinder_skip_byte)(struct TEMPLATED(bt_matchfinder) *mf, + const u8 *in_begin, + ptrdiff_t cur_pos, + u32 nice_len, + u32 max_search_depth, + u32 next_hashes[2]) +{ + u32 best_len; + TEMPLATED(bt_matchfinder_advance_one_byte)(mf, + in_begin, + cur_pos, + nice_len, + nice_len, + max_search_depth, + next_hashes, + &best_len, + NULL, + false); +} diff --git a/src/wimlib/wimlib/case.h b/src/wimlib/wimlib/case.h new file mode 100644 index 00000000..73bef791 --- /dev/null +++ b/src/wimlib/wimlib/case.h @@ -0,0 +1,32 @@ +#ifndef _WIMLIB_CASE_H +#define _WIMLIB_CASE_H + +#include <stdbool.h> + +/* Note: the NTFS-3G headers define CASE_SENSITIVE, hence the WIMLIB prefix. */ +typedef enum { + /* Use either case-sensitive or case-insensitive search, depending on + * the variable @default_ignore_case. */ + WIMLIB_CASE_PLATFORM_DEFAULT = 0, + + /* Use case-sensitive search. */ + WIMLIB_CASE_SENSITIVE = 1, + + /* Use case-insensitive search. */ + WIMLIB_CASE_INSENSITIVE = 2, +} CASE_SENSITIVITY_TYPE; + +extern bool default_ignore_case; + +static inline bool +will_ignore_case(CASE_SENSITIVITY_TYPE case_type) +{ + if (case_type == WIMLIB_CASE_SENSITIVE) + return false; + if (case_type == WIMLIB_CASE_INSENSITIVE) + return true; + + return default_ignore_case; +} + +#endif /* _WIMLIB_CASE_H */ diff --git a/src/wimlib/wimlib/chunk_compressor.h b/src/wimlib/wimlib/chunk_compressor.h new file mode 100644 index 00000000..237ece50 --- /dev/null +++ b/src/wimlib/wimlib/chunk_compressor.h @@ -0,0 +1,75 @@ +/* + * chunk_compressor.h + * + * Interface for serial/parallel chunk compression. + */ + +#ifndef _WIMLIB_CHUNK_COMPRESSOR_H +#define _WIMLIB_CHUNK_COMPRESSOR_H + +#include "wimlib/types.h" + +/* Interface for chunk compression. Users can submit chunks of data to be + * compressed, then retrieve them later in order. This interface can be + * implemented either in serial (having the calling thread compress the chunks + * itself) or in parallel (having other threads asynchronously compress the + * chunks). */ +struct chunk_compressor { + /* Variables set by the chunk compressor when it is created. */ + int out_ctype; + u32 out_chunk_size; + unsigned num_threads; + + /* Free the chunk compressor. */ + void (*destroy)(struct chunk_compressor *); + + /* Try to borrow a buffer into which the uncompressed data for the next + * chunk should be prepared. + * + * Only one buffer can be borrowed at a time. + * + * Returns a pointer to the buffer, or NULL if no buffer is available. + * If no buffer is available, you must call ->get_compression_result() + * to retrieve a compressed chunk before trying again. */ + void *(*get_chunk_buffer)(struct chunk_compressor *); + + /* Signals to the chunk compressor that the buffer which was loaned out + * from ->get_chunk_buffer() has finished being filled and contains the + * specified number of bytes of uncompressed data. */ + void (*signal_chunk_filled)(struct chunk_compressor *, u32); + + /* Get the next chunk of compressed data. + * + * The compressed data, along with its size and the size of the original + * uncompressed chunk, are returned in the locations pointed to by + * arguments 2-4. The compressed data is in storage internal to the + * chunk compressor, and it cannot be accessed beyond any subsequent + * calls to the chunk compressor. + * + * Chunks will be returned in the same order in which they were + * submitted for compression. + * + * The resulting compressed length may be up to the uncompressed length. + * In the case where they are equal, the returned data is actually the + * uncompressed data, not the compressed data. + * + * The return value is %true if a chunk of compressed data was + * successfully retrieved, or %false if there are no chunks currently + * being compressed. */ + bool (*get_compression_result)(struct chunk_compressor *, + const void **, u32 *, u32 *); +}; + + +/* Functions that return implementations of the chunk_compressor interface. */ + +int +new_parallel_chunk_compressor(int out_ctype, u32 out_chunk_size, + unsigned num_threads, u64 max_memory, + struct chunk_compressor **compressor_ret); + +int +new_serial_chunk_compressor(int out_ctype, u32 out_chunk_size, + struct chunk_compressor **compressor_ret); + +#endif /* _WIMLIB_CHUNK_COMPRESSOR_H */ diff --git a/src/wimlib/wimlib/compiler.h b/src/wimlib/wimlib/compiler.h new file mode 100644 index 00000000..77cd27f8 --- /dev/null +++ b/src/wimlib/wimlib/compiler.h @@ -0,0 +1,162 @@ +/* + * compiler.h + * + * Compiler-specific definitions. Currently, only GCC and clang are supported. + * + * Copyright 2022 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _WIMLIB_COMPILER_H +#define _WIMLIB_COMPILER_H + +/* Is the compiler GCC of the specified version or later? This always returns + * false for clang, since clang is "frozen" at GNUC 4.2. The __has_* + * feature-test macros should be used to detect clang functionality instead. */ +#define GCC_PREREQ(major, minor) \ + (!defined(__clang__) && !defined(__INTEL_COMPILER) && \ + (__GNUC__ > major || \ + (__GNUC__ == major && __GNUC_MINOR__ >= minor))) + +/* Feature-test macros defined by recent versions of clang. */ +#ifndef __has_attribute +# define __has_attribute(attribute) 0 +#endif +#ifndef __has_feature +# define __has_feature(feature) 0 +#endif +#ifndef __has_builtin +# define __has_builtin(builtin) 0 +#endif + +/* Declare that the annotated function should always be inlined. This might be + * desirable in highly tuned code, e.g. compression codecs. */ +#define forceinline inline __attribute__((always_inline)) + +/* Declare that the annotated function should *not* be inlined. */ +#define noinline __attribute__((noinline)) + +/* Functionally the same as 'noinline', but documents that the reason for not + * inlining is to prevent the annotated function from being inlined into a + * recursive function, thereby increasing its stack usage. */ +#define noinline_for_stack noinline + +/* Hint that the expression is usually true. */ +#define likely(expr) __builtin_expect(!!(expr), 1) + +/* Hint that the expression is usually false. */ +#define unlikely(expr) __builtin_expect(!!(expr), 0) + +/* Prefetch into L1 cache for read. */ +#define prefetchr(addr) __builtin_prefetch((addr), 0) + +/* Prefetch into L1 cache for write. */ +#define prefetchw(addr) __builtin_prefetch((addr), 1) + +/* Hint that the annotated function takes a printf()-like format string and + * arguments. This is currently disabled on Windows because MinGW does not + * support this attribute on functions taking wide-character strings. */ +#ifdef _WIN32 +# define _format_attribute(type, format_str, format_start) +#else +# define _format_attribute(type, format_str, format_start) \ + __attribute__((format(type, format_str, format_start))) +#endif + +/* Endianness definitions. Either CPU_IS_BIG_ENDIAN() or CPU_IS_LITTLE_ENDIAN() + * evaluates to 1. The other evaluates to 0. Note that newer gcc supports + * __BYTE_ORDER__ for easily determining the endianness; older gcc doesn't. In + * the latter case we fall back to a configure-time check. */ +#ifdef __BYTE_ORDER__ +# define CPU_IS_BIG_ENDIAN() (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) +#elif defined(HAVE_CONFIG_H) +# include "config.h" +# ifdef WORDS_BIGENDIAN +# define CPU_IS_BIG_ENDIAN() 1 +# else +# define CPU_IS_BIG_ENDIAN() 0 +# endif +#endif +#define CPU_IS_LITTLE_ENDIAN() (!CPU_IS_BIG_ENDIAN()) + +/* UNALIGNED_ACCESS_IS_FAST should be defined to 1 if unaligned memory accesses + * can be performed efficiently on the target platform. */ +#if defined(__x86_64__) || defined(__i386__) || \ + defined(__ARM_FEATURE_UNALIGNED) || defined(__powerpc64__) +# define UNALIGNED_ACCESS_IS_FAST 1 +#else +# define UNALIGNED_ACCESS_IS_FAST 0 +#endif + +/* Get the minimum of two variables, without multiple evaluation. */ +#undef min +#define min(a, b) ({ typeof(a) _a = (a); typeof(b) _b = (b); \ + (_a < _b) ? _a : _b; }) +#undef MIN +#define MIN(a, b) min((a), (b)) + +/* Get the maximum of two variables, without multiple evaluation. */ +#undef max +#define max(a, b) ({ typeof(a) _a = (a); typeof(b) _b = (b); \ + (_a > _b) ? _a : _b; }) +#undef MAX +#define MAX(a, b) max((a), (b)) + +/* Get the maximum of three variables, without multiple evaluation. */ +#undef max3 +#define max3(a, b, c) max(max((a), (b)), (c)) + +/* Swap the values of two variables, without multiple evaluation. */ +#ifndef swap +# define swap(a, b) ({ typeof(a) _a = (a); (a) = (b); (b) = _a; }) +#endif +#define SWAP(a, b) swap((a), (b)) + +/* Optional definitions for checking with 'sparse'. */ +#ifdef __CHECKER__ +# define _bitwise_attr __attribute__((bitwise)) +# define _force_attr __attribute__((force)) +#else +# define _bitwise_attr +# define _force_attr +#endif + +/* STATIC_ASSERT() - verify the truth of an expression at compilation time. */ +#ifdef __CHECKER__ +# define STATIC_ASSERT(expr) +#elif __STDC_VERSION__ >= 201112L +# define STATIC_ASSERT(expr) _Static_assert((expr), "") +#else +# define STATIC_ASSERT(expr) ((void)sizeof(char[1 - 2 * !(expr)])) +#endif + +/* STATIC_ASSERT_ZERO() - verify the truth of an expression at compilation time + * and also produce a result of value '0' to be used in constant expressions */ +#define STATIC_ASSERT_ZERO(expr) ((int)sizeof(char[-!(expr)])) + +#define CONCAT_IMPL(s1, s2) s1##s2 + +/* CONCAT() - concatenate two tokens at preprocessing time. */ +#define CONCAT(s1, s2) CONCAT_IMPL(s1, s2) + +#endif /* _WIMLIB_COMPILER_H */ diff --git a/src/wimlib/wimlib/compress_common.h b/src/wimlib/wimlib/compress_common.h new file mode 100644 index 00000000..f2ed4109 --- /dev/null +++ b/src/wimlib/wimlib/compress_common.h @@ -0,0 +1,19 @@ +/* + * compress_common.h + * + * Header for compression code shared by multiple compression formats. + */ + +#ifndef _WIMLIB_COMPRESS_COMMON_H +#define _WIMLIB_COMPRESS_COMMON_H + +#include "wimlib/types.h" + +#define MAX_NUM_SYMS 799 /* LZMS_MAX_NUM_SYMS */ +#define MAX_CODEWORD_LEN 16 + +void +make_canonical_huffman_code(unsigned num_syms, unsigned max_codeword_len, + const u32 freqs[], u8 lens[], u32 codewords[]); + +#endif /* _WIMLIB_COMPRESS_COMMON_H */ diff --git a/src/wimlib/wimlib/compressor_ops.h b/src/wimlib/wimlib/compressor_ops.h new file mode 100644 index 00000000..bef5cf6d --- /dev/null +++ b/src/wimlib/wimlib/compressor_ops.h @@ -0,0 +1,36 @@ +/* + * compressor_ops.h + * + * Interface implemented by compressors for specific formats. + */ + +#ifndef _WIMLIB_COMPRESSOR_OPS_H +#define _WIMLIB_COMPRESSOR_OPS_H + +#include "wimlib/types.h" + +struct compressor_ops { + + u64 (*get_needed_memory)(size_t max_block_size, + unsigned int compression_level, + bool destructive); + + int (*create_compressor)(size_t max_block_size, + unsigned int compression_level, + bool destructive, + void **private_ret); + + size_t (*compress)(const void *uncompressed_data, + size_t uncompressed_size, + void *compressed_data, + size_t compressed_size_avail, + void *private); + + void (*free_compressor)(void *private); +}; + +extern const struct compressor_ops lzx_compressor_ops; +extern const struct compressor_ops xpress_compressor_ops; +extern const struct compressor_ops lzms_compressor_ops; + +#endif /* _WIMLIB_COMPRESSOR_OPS_H */ diff --git a/src/wimlib/wimlib/cpu_features.h b/src/wimlib/wimlib/cpu_features.h new file mode 100644 index 00000000..ee6ef485 --- /dev/null +++ b/src/wimlib/wimlib/cpu_features.h @@ -0,0 +1,37 @@ +#ifndef _WIMLIB_CPU_FEATURES_H +#define _WIMLIB_CPU_FEATURES_H + +#include "wimlib/types.h" + +#define X86_CPU_FEATURE_SSSE3 0x00000001 +#define X86_CPU_FEATURE_SSE4_1 0x00000002 +#define X86_CPU_FEATURE_SSE4_2 0x00000004 +#define X86_CPU_FEATURE_AVX 0x00000008 +#define X86_CPU_FEATURE_BMI2 0x00000010 +#define X86_CPU_FEATURE_SHA 0x00000020 + +#define ARM_CPU_FEATURE_SHA1 0x00000001 + +#if (defined(__i386__) || defined(__x86_64__)) || \ + (defined(__aarch64__) && defined(__linux__)) || \ + (defined(__aarch64__) && defined(__APPLE__)) || \ + (defined(__aarch64__) && defined(_WIN32)) + +#define CPU_FEATURES_ENABLED 1 +extern u32 cpu_features; + +void init_cpu_features(void); + +#else + +#define CPU_FEATURES_ENABLED 0 +#define cpu_features 0 + +static inline void +init_cpu_features(void) +{ +} + +#endif + +#endif /* _WIMLIB_CPU_FEATURES_H */ diff --git a/src/wimlib/wimlib/decompress_common.h b/src/wimlib/wimlib/decompress_common.h new file mode 100644 index 00000000..46fce94f --- /dev/null +++ b/src/wimlib/wimlib/decompress_common.h @@ -0,0 +1,553 @@ +/* + * decompress_common.h + * + * Header for decompression code shared by multiple compression formats. + * + * Copyright 2022 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _WIMLIB_DECOMPRESS_COMMON_H +#define _WIMLIB_DECOMPRESS_COMMON_H + +#include <string.h> + +#include "wimlib/compiler.h" +#include "wimlib/types.h" +#include "wimlib/unaligned.h" + +/******************************************************************************/ +/* Input bitstream for XPRESS and LZX */ +/*----------------------------------------------------------------------------*/ + +/* Structure that encapsulates a block of in-memory data being interpreted as a + * stream of bits, optionally with interwoven literal bytes. Bits are assumed + * to be stored in little endian 16-bit coding units, with the bits ordered high + * to low. */ +struct input_bitstream { + + /* Bits that have been read from the input buffer. The bits are + * left-justified; the next bit is always bit 31. */ + u32 bitbuf; + + /* Number of bits currently held in @bitbuf. */ + u32 bitsleft; + + /* Pointer to the next byte to be retrieved from the input buffer. */ + const u8 *next; + + /* Pointer past the end of the input buffer. */ + const u8 *end; +}; + +/* Initialize a bitstream to read from the specified input buffer. */ +static forceinline void +init_input_bitstream(struct input_bitstream *is, const void *buffer, u32 size) +{ + is->bitbuf = 0; + is->bitsleft = 0; + is->next = buffer; + is->end = is->next + size; +} + +/* Note: for performance reasons, the following methods don't return error codes + * to the caller if the input buffer is overrun. Instead, they just assume that + * all overrun data is zeroes. This has no effect on well-formed compressed + * data. The only disadvantage is that bad compressed data may go undetected, + * but even this is irrelevant if higher level code checksums the uncompressed + * data anyway. */ + +/* Ensure the bit buffer variable for the bitstream contains at least @num_bits + * bits. Following this, bitstream_peek_bits() and/or bitstream_remove_bits() + * may be called on the bitstream to peek or remove up to @num_bits bits. */ +static forceinline void +bitstream_ensure_bits(struct input_bitstream *is, const unsigned num_bits) +{ + /* This currently works for at most 17 bits. */ + + if (is->bitsleft >= num_bits) + return; + + if (unlikely(is->end - is->next < 2)) + goto overflow; + + is->bitbuf |= (u32)get_unaligned_le16(is->next) << (16 - is->bitsleft); + is->next += 2; + is->bitsleft += 16; + + if (unlikely(num_bits == 17 && is->bitsleft == 16)) { + if (unlikely(is->end - is->next < 2)) + goto overflow; + + is->bitbuf |= (u32)get_unaligned_le16(is->next); + is->next += 2; + is->bitsleft = 32; + } + + return; + +overflow: + is->bitsleft = 32; +} + +/* Return the next @num_bits bits from the bitstream, without removing them. + * There must be at least @num_bits remaining in the buffer variable, from a + * previous call to bitstream_ensure_bits(). */ +static forceinline u32 +bitstream_peek_bits(const struct input_bitstream *is, const unsigned num_bits) +{ + return (is->bitbuf >> 1) >> (sizeof(is->bitbuf) * 8 - num_bits - 1); +} + +/* Remove @num_bits from the bitstream. There must be at least @num_bits + * remaining in the buffer variable, from a previous call to + * bitstream_ensure_bits(). */ +static forceinline void +bitstream_remove_bits(struct input_bitstream *is, unsigned num_bits) +{ + is->bitbuf <<= num_bits; + is->bitsleft -= num_bits; +} + +/* Remove and return @num_bits bits from the bitstream. There must be at least + * @num_bits remaining in the buffer variable, from a previous call to + * bitstream_ensure_bits(). */ +static forceinline u32 +bitstream_pop_bits(struct input_bitstream *is, unsigned num_bits) +{ + u32 bits = bitstream_peek_bits(is, num_bits); + bitstream_remove_bits(is, num_bits); + return bits; +} + +/* Read and return the next @num_bits bits from the bitstream. */ +static forceinline u32 +bitstream_read_bits(struct input_bitstream *is, unsigned num_bits) +{ + bitstream_ensure_bits(is, num_bits); + return bitstream_pop_bits(is, num_bits); +} + +/* Read and return the next literal byte embedded in the bitstream. */ +static forceinline u8 +bitstream_read_byte(struct input_bitstream *is) +{ + if (unlikely(is->end == is->next)) + return 0; + return *is->next++; +} + +/* Read and return the next 16-bit integer embedded in the bitstream. */ +static forceinline u16 +bitstream_read_u16(struct input_bitstream *is) +{ + u16 v; + + if (unlikely(is->end - is->next < 2)) + return 0; + v = get_unaligned_le16(is->next); + is->next += 2; + return v; +} + +/* Read and return the next 32-bit integer embedded in the bitstream. */ +static forceinline u32 +bitstream_read_u32(struct input_bitstream *is) +{ + u32 v; + + if (unlikely(is->end - is->next < 4)) + return 0; + v = get_unaligned_le32(is->next); + is->next += 4; + return v; +} + +/* Read into @dst_buffer an array of literal bytes embedded in the bitstream. + * Return 0 if there were enough bytes remaining in the input, otherwise -1. */ +static forceinline int +bitstream_read_bytes(struct input_bitstream *is, void *dst_buffer, size_t count) +{ + if (unlikely(is->end - is->next < count)) + return -1; + memcpy(dst_buffer, is->next, count); + is->next += count; + return 0; +} + +/* Align the input bitstream on a coding-unit boundary. */ +static forceinline void +bitstream_align(struct input_bitstream *is) +{ + is->bitsleft = 0; + is->bitbuf = 0; +} + +/******************************************************************************/ +/* Huffman decoding */ +/*----------------------------------------------------------------------------*/ + +/* + * Required alignment for the Huffman decode tables. We require this alignment + * so that we can fill the entries with vector or word instructions and not have + * to deal with misaligned buffers. + */ +#define DECODE_TABLE_ALIGNMENT 16 + +/* + * Each decode table entry is 16 bits divided into two fields: 'symbol' (high 12 + * bits) and 'length' (low 4 bits). The precise meaning of these fields depends + * on the type of entry: + * + * Root table entries which are *not* subtable pointers: + * symbol: symbol to decode + * length: codeword length in bits + * + * Root table entries which are subtable pointers: + * symbol: index of start of subtable + * length: number of bits with which the subtable is indexed + * + * Subtable entries: + * symbol: symbol to decode + * length: codeword length in bits, minus the number of bits with which the + * root table is indexed + */ +#define DECODE_TABLE_SYMBOL_SHIFT 4 +#define DECODE_TABLE_MAX_SYMBOL ((1 << (16 - DECODE_TABLE_SYMBOL_SHIFT)) - 1) +#define DECODE_TABLE_MAX_LENGTH ((1 << DECODE_TABLE_SYMBOL_SHIFT) - 1) +#define DECODE_TABLE_LENGTH_MASK DECODE_TABLE_MAX_LENGTH +#define MAKE_DECODE_TABLE_ENTRY(symbol, length) \ + (((symbol) << DECODE_TABLE_SYMBOL_SHIFT) | (length)) + +/* + * Read and return the next Huffman-encoded symbol from the given bitstream + * using the given decode table. + * + * If the input data is exhausted, then the Huffman symbol will be decoded as if + * the missing bits were all zeroes. + * + * XXX: This is mostly duplicated in lzms_decode_huffman_symbol() in + * lzms_decompress.c; keep them in sync! + */ +static forceinline unsigned +read_huffsym(struct input_bitstream *is, const u16 decode_table[], + unsigned table_bits, unsigned max_codeword_len) +{ + unsigned entry; + unsigned symbol; + unsigned length; + + /* Preload the bitbuffer with 'max_codeword_len' bits so that we're + * guaranteed to be able to fully decode a codeword. */ + bitstream_ensure_bits(is, max_codeword_len); + + /* Index the root table by the next 'table_bits' bits of input. */ + entry = decode_table[bitstream_peek_bits(is, table_bits)]; + + /* Extract the "symbol" and "length" from the entry. */ + symbol = entry >> DECODE_TABLE_SYMBOL_SHIFT; + length = entry & DECODE_TABLE_LENGTH_MASK; + + /* If the root table is indexed by the full 'max_codeword_len' bits, + * then there cannot be any subtables, and this will be known at compile + * time. Otherwise, we must check whether the decoded symbol is really + * a subtable pointer. If so, we must discard the bits with which the + * root table was indexed, then index the subtable by the next 'length' + * bits of input to get the real entry. */ + if (max_codeword_len > table_bits && + entry >= (1U << (table_bits + DECODE_TABLE_SYMBOL_SHIFT))) + { + /* Subtable required */ + bitstream_remove_bits(is, table_bits); + entry = decode_table[symbol + bitstream_peek_bits(is, length)]; + symbol = entry >> DECODE_TABLE_SYMBOL_SHIFT; + length = entry & DECODE_TABLE_LENGTH_MASK; + } + + /* Discard the bits (or the remaining bits, if a subtable was required) + * of the codeword. */ + bitstream_remove_bits(is, length); + + /* Return the decoded symbol. */ + return symbol; +} + +/* + * The DECODE_TABLE_ENOUGH() macro evaluates to the maximum number of decode + * table entries, including all subtable entries, that may be required for + * decoding a given Huffman code. This depends on three parameters: + * + * num_syms: the maximum number of symbols in the code + * table_bits: the number of bits with which the root table will be indexed + * max_codeword_len: the maximum allowed codeword length in the code + * + * Given these parameters, the utility program 'enough' from zlib, when passed + * the three arguments 'num_syms', 'table_bits', and 'max_codeword_len', will + * compute the maximum number of entries required. This has already been done + * for the combinations we need and incorporated into the macro below so that + * the mapping can be done at compilation time. If an unknown combination is + * used, then a compilation error will result. To fix this, use 'enough' to + * find the missing value and add it below. If that still doesn't fix the + * compilation error, then most likely a constraint would be violated by the + * requested parameters, so they cannot be used, at least without other changes + * to the decode table --- see DECODE_TABLE_SIZE(). + */ +#define DECODE_TABLE_ENOUGH(num_syms, table_bits, max_codeword_len) ( \ + ((num_syms) == 8 && (table_bits) == 7 && (max_codeword_len) == 15) ? 128 : \ + ((num_syms) == 8 && (table_bits) == 5 && (max_codeword_len) == 7) ? 36 : \ + ((num_syms) == 8 && (table_bits) == 6 && (max_codeword_len) == 7) ? 66 : \ + ((num_syms) == 8 && (table_bits) == 7 && (max_codeword_len) == 7) ? 128 : \ + ((num_syms) == 20 && (table_bits) == 5 && (max_codeword_len) == 15) ? 1062 : \ + ((num_syms) == 20 && (table_bits) == 6 && (max_codeword_len) == 15) ? 582 : \ + ((num_syms) == 20 && (table_bits) == 7 && (max_codeword_len) == 15) ? 390 : \ + ((num_syms) == 54 && (table_bits) == 9 && (max_codeword_len) == 15) ? 618 : \ + ((num_syms) == 54 && (table_bits) == 10 && (max_codeword_len) == 15) ? 1098 : \ + ((num_syms) == 249 && (table_bits) == 9 && (max_codeword_len) == 16) ? 878 : \ + ((num_syms) == 249 && (table_bits) == 10 && (max_codeword_len) == 16) ? 1326 : \ + ((num_syms) == 249 && (table_bits) == 11 && (max_codeword_len) == 16) ? 2318 : \ + ((num_syms) == 256 && (table_bits) == 9 && (max_codeword_len) == 15) ? 822 : \ + ((num_syms) == 256 && (table_bits) == 10 && (max_codeword_len) == 15) ? 1302 : \ + ((num_syms) == 256 && (table_bits) == 11 && (max_codeword_len) == 15) ? 2310 : \ + ((num_syms) == 512 && (table_bits) == 10 && (max_codeword_len) == 15) ? 1558 : \ + ((num_syms) == 512 && (table_bits) == 11 && (max_codeword_len) == 15) ? 2566 : \ + ((num_syms) == 512 && (table_bits) == 12 && (max_codeword_len) == 15) ? 4606 : \ + ((num_syms) == 656 && (table_bits) == 10 && (max_codeword_len) == 16) ? 1734 : \ + ((num_syms) == 656 && (table_bits) == 11 && (max_codeword_len) == 16) ? 2726 : \ + ((num_syms) == 656 && (table_bits) == 12 && (max_codeword_len) == 16) ? 4758 : \ + ((num_syms) == 799 && (table_bits) == 9 && (max_codeword_len) == 15) ? 1366 : \ + ((num_syms) == 799 && (table_bits) == 10 && (max_codeword_len) == 15) ? 1846 : \ + ((num_syms) == 799 && (table_bits) == 11 && (max_codeword_len) == 15) ? 2854 : \ + -1) + +/* Wrapper around DECODE_TABLE_ENOUGH() that does additional compile-time + * validation. */ +#define DECODE_TABLE_SIZE(num_syms, table_bits, max_codeword_len) ( \ + \ + /* All values must be positive. */ \ + STATIC_ASSERT_ZERO((num_syms) > 0) + \ + STATIC_ASSERT_ZERO((table_bits) > 0) + \ + STATIC_ASSERT_ZERO((max_codeword_len) > 0) + \ + \ + /* There cannot be more symbols than possible codewords. */ \ + STATIC_ASSERT_ZERO((num_syms) <= 1U << (max_codeword_len)) + \ + \ + /* There is no reason for the root table to be indexed with + * more bits than the maximum codeword length. */ \ + STATIC_ASSERT_ZERO((table_bits) <= (max_codeword_len)) + \ + \ + /* The maximum symbol value must fit in the 'symbol' field. */ \ + STATIC_ASSERT_ZERO((num_syms) - 1 <= DECODE_TABLE_MAX_SYMBOL) + \ + \ + /* The maximum codeword length in the root table must fit in + * the 'length' field. */ \ + STATIC_ASSERT_ZERO((table_bits) <= DECODE_TABLE_MAX_LENGTH) + \ + \ + /* The maximum codeword length in a subtable must fit in the + * 'length' field. */ \ + STATIC_ASSERT_ZERO((max_codeword_len) - (table_bits) <= \ + DECODE_TABLE_MAX_LENGTH) + \ + \ + /* The minimum subtable index must be greater than the maximum + * symbol value. If this were not the case, then there would + * be no way to tell whether a given root table entry is a + * "subtable pointer" or not. (An alternate solution would be + * to reserve a flag bit specifically for this purpose.) */ \ + STATIC_ASSERT_ZERO((1U << table_bits) > (num_syms) - 1) + \ + \ + /* The needed 'enough' value must have been defined. */ \ + STATIC_ASSERT_ZERO(DECODE_TABLE_ENOUGH( \ + (num_syms), (table_bits), \ + (max_codeword_len)) > 0) + \ + \ + /* The maximum subtable index must fit in the 'symbol' field. */\ + STATIC_ASSERT_ZERO(DECODE_TABLE_ENOUGH( \ + (num_syms), (table_bits), \ + (max_codeword_len)) - 1 <= \ + DECODE_TABLE_MAX_SYMBOL) + \ + \ + /* Finally, make the macro evaluate to the needed maximum + * number of decode table entries. */ \ + DECODE_TABLE_ENOUGH((num_syms), (table_bits), \ + (max_codeword_len)) \ +) + +/* + * Declare the decode table for a Huffman code, given several compile-time + * constants that describe the code. See DECODE_TABLE_ENOUGH() for details. + * + * Decode tables must be aligned to a DECODE_TABLE_ALIGNMENT-byte boundary. + * This implies that if a decode table is nested inside a dynamically allocated + * structure, then the outer structure must be allocated on a + * DECODE_TABLE_ALIGNMENT-byte aligned boundary as well. + */ +#define DECODE_TABLE(name, num_syms, table_bits, max_codeword_len) \ + u16 name[DECODE_TABLE_SIZE((num_syms), (table_bits), \ + (max_codeword_len))] \ + __attribute__((aligned(DECODE_TABLE_ALIGNMENT))) + +/* + * Declare the temporary "working_space" array needed for building the decode + * table for a Huffman code. + */ +#define DECODE_TABLE_WORKING_SPACE(name, num_syms, max_codeword_len) \ + u16 name[2 * ((max_codeword_len) + 1) + (num_syms)]; + +int +make_huffman_decode_table(u16 decode_table[], unsigned num_syms, + unsigned table_bits, const u8 lens[], + unsigned max_codeword_len, u16 working_space[]); + +/******************************************************************************/ +/* LZ match copying */ +/*----------------------------------------------------------------------------*/ + +static forceinline void +copy_word_unaligned(const void *src, void *dst) +{ + store_word_unaligned(load_word_unaligned(src), dst); +} + +static forceinline machine_word_t +repeat_u16(u16 b) +{ + machine_word_t v = b; + + STATIC_ASSERT(WORDBITS == 32 || WORDBITS == 64); + v |= v << 16; + v |= v << ((WORDBITS == 64) ? 32 : 0); + return v; +} + +static forceinline machine_word_t +repeat_byte(u8 b) +{ + return repeat_u16(((u16)b << 8) | b); +} + +/* + * Copy an LZ77 match of 'length' bytes from the match source at 'out_next - + * offset' to the match destination at 'out_next'. The source and destination + * may overlap. + * + * This handles validating the length and offset. It is validated that the + * beginning of the match source is '>= out_begin' and that end of the match + * destination is '<= out_end'. The return value is 0 if the match was valid + * (and was copied), otherwise -1. + * + * 'min_length' is a hint which specifies the minimum possible match length. + * This should be a compile-time constant. + */ +static forceinline int +lz_copy(u32 length, u32 offset, u8 *out_begin, u8 *out_next, u8 *out_end, + u32 min_length) +{ + const u8 *src; + u8 *end; + + /* Validate the offset. */ + if (unlikely(offset > out_next - out_begin)) + return -1; + + /* + * Fast path: copy a match which is no longer than a few words, is not + * overlapped such that copying a word at a time would produce incorrect + * results, and is not too close to the end of the buffer. Note that + * this might copy more than the length of the match, but that's okay in + * this scenario. + */ + src = out_next - offset; + if (UNALIGNED_ACCESS_IS_FAST && length <= 3 * WORDBYTES && + offset >= WORDBYTES && out_end - out_next >= 3 * WORDBYTES) + { + copy_word_unaligned(src + WORDBYTES*0, out_next + WORDBYTES*0); + copy_word_unaligned(src + WORDBYTES*1, out_next + WORDBYTES*1); + copy_word_unaligned(src + WORDBYTES*2, out_next + WORDBYTES*2); + return 0; + } + + /* Validate the length. This isn't needed in the fast path above, due + * to the additional conditions tested, but we do need it here. */ + if (unlikely(length > out_end - out_next)) + return -1; + end = out_next + length; + + /* + * Try to copy one word at a time. On i386 and x86_64 this is faster + * than copying one byte at a time, unless the data is near-random and + * all the matches have very short lengths. Note that since this + * requires unaligned memory accesses, it won't necessarily be faster on + * every architecture. + * + * Also note that we might copy more than the length of the match. For + * example, if a word is 8 bytes and the match is of length 5, then + * we'll simply copy 8 bytes. This is okay as long as we don't write + * beyond the end of the output buffer, hence the check for (out_end - + * end >= WORDBYTES - 1). + */ + if (UNALIGNED_ACCESS_IS_FAST && likely(out_end - end >= WORDBYTES - 1)) + { + if (offset >= WORDBYTES) { + /* The source and destination words don't overlap. */ + do { + copy_word_unaligned(src, out_next); + src += WORDBYTES; + out_next += WORDBYTES; + } while (out_next < end); + return 0; + } else if (offset == 1) { + /* Offset 1 matches are equivalent to run-length + * encoding of the previous byte. This case is common + * if the data contains many repeated bytes. */ + machine_word_t v = repeat_byte(*(out_next - 1)); + do { + store_word_unaligned(v, out_next); + src += WORDBYTES; + out_next += WORDBYTES; + } while (out_next < end); + return 0; + } + /* + * We don't bother with special cases for other 'offset < + * WORDBYTES', which are usually rarer than 'offset == 1'. + * Extra checks will just slow things down. Actually, it's + * possible to handle all the 'offset < WORDBYTES' cases using + * the same code, but it still becomes more complicated doesn't + * seem any faster overall; it definitely slows down the more + * common 'offset == 1' case. + */ + } + + /* Fall back to a bytewise copy. */ + if (min_length >= 2) + *out_next++ = *src++; + if (min_length >= 3) + *out_next++ = *src++; + if (min_length >= 4) + *out_next++ = *src++; + do { + *out_next++ = *src++; + } while (out_next != end); + return 0; +} + +#endif /* _WIMLIB_DECOMPRESS_COMMON_H */ diff --git a/src/wimlib/wimlib/decompressor_ops.h b/src/wimlib/wimlib/decompressor_ops.h new file mode 100644 index 00000000..44148b32 --- /dev/null +++ b/src/wimlib/wimlib/decompressor_ops.h @@ -0,0 +1,29 @@ +/* + * decompressor_ops.h + * + * Interface implemented by decompressors for specific formats. + */ + +#ifndef _WIMLIB_DECOMPRESSOR_OPS_H +#define _WIMLIB_DECOMPRESSOR_OPS_H + +#include <stddef.h> + +struct decompressor_ops { + + int (*create_decompressor)(size_t max_block_size, void **private_ret); + + int (*decompress)(const void *compressed_data, + size_t compressed_size, + void *uncompressed_data, + size_t uncompressed_size, + void *private); + + void (*free_decompressor)(void *private); +}; + +extern const struct decompressor_ops lzx_decompressor_ops; +extern const struct decompressor_ops xpress_decompressor_ops; +extern const struct decompressor_ops lzms_decompressor_ops; + +#endif /* _WIMLIB_DECOMPRESSOR_OPS_H */ diff --git a/src/wimlib/wimlib/dentry.h b/src/wimlib/wimlib/dentry.h new file mode 100644 index 00000000..d7dc138e --- /dev/null +++ b/src/wimlib/wimlib/dentry.h @@ -0,0 +1,280 @@ +#ifndef _WIMLIB_DENTRY_H +#define _WIMLIB_DENTRY_H + +#include "wimlib/avl_tree.h" +#include "wimlib/case.h" +#include "wimlib/compiler.h" +#include "wimlib/inode.h" +#include "wimlib/list.h" +#include "wimlib/types.h" + +struct wim_inode; +struct blob_table; + +/* Base size of a WIM dentry in the on-disk format, up to and including the file + * name length. This does not include the variable-length file name, short + * name, extra stream entries, and padding to 8-byte boundaries. */ +#define WIM_DENTRY_DISK_SIZE 102 + +/* + * In-memory structure for a WIM directory entry (dentry). There is a directory + * tree for each image in the WIM. + * + * Note that this is a directory entry and not an inode. Since NTFS allows hard + * links, it's possible for an NTFS inode to correspond to multiple WIM + * dentries. The hard link group ID field of the on-disk WIM dentry tells us + * the number of the NTFS inode that the dentry corresponds to (and this gets + * placed in d_inode->i_ino). + * + * Unfortunately, WIM files do not have an analogue to an inode; instead certain + * information, such as file attributes, the security descriptor, and streams is + * replicated in each hard-linked dentry, even though this information really is + * associated with an inode. In-memory, we fix up this flaw by allocating a + * `struct wim_inode' for each dentry that contains some of this duplicated + * information, then combining the inodes for each hard link group together. + * (See dentry_tree_fix_inodes().) + */ +struct wim_dentry { + /* Pointer to the inode for this dentry. This will contain some + * information that was factored out of the on-disk WIM dentry as common + * to all dentries in a hard link group. */ + struct wim_inode *d_inode; + + /* Node for the parent's balanced binary search tree of child dentries + * keyed by filename (root i_children). */ + struct avl_tree_node d_index_node; + + /* The parent of this directory entry. (The root is its own parent.) */ + struct wim_dentry *d_parent; + + /* Linked list node that places this dentry in the list of aliases for + * its inode (d_inode) */ + struct hlist_node d_alias_node; + + /* Pointer to the UTF-16LE filename (malloc()ed buffer), or NULL if this + * dentry has no filename. */ + utf16lechar *d_name; + + /* Pointer to the UTF-16LE short filename (malloc()ed buffer), or NULL + * if this dentry has no short name. */ + utf16lechar *d_short_name; + + /* Length of 'd_name' in bytes, excluding the terminating null */ + u16 d_name_nbytes; + + /* Length of 'd_short_name' in bytes, excluding the terminating null */ + u16 d_short_name_nbytes; + + /* (Extraction only) Length of 'd_extraction_name' in _characters_, + * excluding the terminating null */ + u16 d_extraction_name_nchars; + + /* When capturing from an NTFS volume using NTFS-3G, this flag is set on + * dentries that were created from a filename in the WIN32 or WIN32+DOS + * namespaces rather than the POSIX namespace. Otherwise this will + * always be 0. */ + u16 d_is_win32_name : 1; + + /* Temporary flag; always reset to 0 when done using. */ + u16 d_tmp_flag : 1; + + /* Used by wimlib_update_image() */ + u16 d_is_orphan : 1; + + union { + /* The subdir offset is only used while reading and writing this + * dentry. See the corresponding field in `struct + * wim_dentry_on_disk' for explanation. */ + u64 d_subdir_offset; + + /* Temporary list field */ + struct list_head d_tmp_list; + }; + + /* Full path to this dentry in the WIM, in platform-dependent tchars + * that can be printed without conversion. By default this field will + * be NULL and will only be calculated on-demand by the + * calculate_dentry_full_path() or dentry_full_path() functions. */ + tchar *d_full_path; + + /* (Extraction only) Actual name to extract this dentry as. This may be + * either in 'tchars' or in 'utf16lechars', depending on what encoding + * the extraction backend needs. This may alias 'd_name'. If it + * doesn't, it is an allocated buffer which must be freed. */ + void *d_extraction_name; + + /* (Extraction only) Linked list node that connects all dentries being + * extracted as part of the current extraction operation. */ + struct list_head d_extraction_list_node; + + /* (Extraction only) Pointer to the next alias of this dentry's inode + * that needs to be extracted as part of the current extraction + * operation, or NULL if this is the last alias. */ + struct wim_dentry *d_next_extraction_alias; + +#ifdef ENABLE_TEST_SUPPORT + struct wim_dentry *d_corresponding; +#endif +}; + +static inline bool +will_extract_dentry(const struct wim_dentry *dentry) +{ + return dentry->d_extraction_list_node.next != NULL; +} + +size_t +dentry_out_total_length(const struct wim_dentry *dentry); + +int +for_dentry_in_tree(struct wim_dentry *root, + int (*visitor)(struct wim_dentry *, void *), void *args); + +/* Iterate through each @child dentry of the @dir directory inode in + * collation order. */ +#define for_inode_child(child, dir) \ + avl_tree_for_each_in_order((child), (dir)->i_children, \ + struct wim_dentry, d_index_node) + +/* Iterate through each @child dentry of the @parent dentry in + * collation order. */ +#define for_dentry_child(child, parent) \ + for_inode_child((child), (parent)->d_inode) + +/* Iterate through each @child dentry of the @dir directory inode in + * postorder (safe for freeing the child dentries). */ +#define for_inode_child_postorder(child, dir) \ + avl_tree_for_each_in_postorder((child), (dir)->i_children, \ + struct wim_dentry, d_index_node) + +/* Iterate through each @child dentry of the @parent dentry in + * postorder (safe for freeing the child dentries). */ +#define for_dentry_child_postorder(child, parent) \ + for_inode_child_postorder((child), (parent)->d_inode) + +/* Get any child dentry of the @dir directory inode. Requires + * inode_has_children(@dir) == true. */ +#define inode_any_child(dir) \ + avl_tree_entry((dir)->i_children, struct wim_dentry, d_index_node) + +/* Get any child dentry of the @parent dentry. Requires + * dentry_has_children(@parent) == true. */ +#define dentry_any_child(parent) \ + inode_any_child((parent)->d_inode) + +struct wim_dentry * +dentry_get_first_ci_match(struct wim_dentry *dentry); + +struct wim_dentry * +dentry_get_next_ci_match(struct wim_dentry *dentry, + struct wim_dentry *ci_match); + +/* Iterate through all other dentries which have the same case insensitive name + * as the one given. */ +#define dentry_for_each_ci_match(ci_match, dentry) \ + for ((ci_match) = dentry_get_first_ci_match((dentry)); \ + (ci_match); \ + (ci_match) = dentry_get_next_ci_match((dentry), (ci_match))) + +void +calculate_subdir_offsets(struct wim_dentry *root, u64 *subdir_offset_p); + +int +dentry_set_name(struct wim_dentry *dentry, const tchar *name); + +int +dentry_set_name_utf16le(struct wim_dentry *dentry, const utf16lechar *name, + size_t name_nbytes); + +struct wim_dentry * +get_dentry(WIMStruct *wim, const tchar *path, CASE_SENSITIVITY_TYPE case_type); + +struct wim_dentry * +get_dentry_child_with_name(const struct wim_dentry *dentry, const tchar *name, + CASE_SENSITIVITY_TYPE case_type); + +struct wim_dentry * +get_dentry_child_with_utf16le_name(const struct wim_dentry *dentry, + const utf16lechar *name, + size_t name_nbytes, + CASE_SENSITIVITY_TYPE case_type); + +struct wim_dentry * +get_parent_dentry(WIMStruct *wim, const tchar *path, + CASE_SENSITIVITY_TYPE case_type); + +int +calculate_dentry_full_path(struct wim_dentry *dentry); + +tchar * +dentry_full_path(struct wim_dentry *dentry); + +int +new_dentry_with_new_inode(const tchar *name, bool set_timestamps, + struct wim_dentry **dentry_ret); + +int +new_dentry_with_existing_inode(const tchar *name, struct wim_inode *inode, + struct wim_dentry **dentry_ret); + +int +new_filler_directory(struct wim_dentry **dentry_ret); + +void +free_dentry(struct wim_dentry *dentry); + +void +free_dentry_tree(struct wim_dentry *root, struct blob_table *blob_table); + +void +unlink_dentry(struct wim_dentry *dentry); + +struct wim_dentry * +dentry_add_child(struct wim_dentry *parent, struct wim_dentry *child); + +struct update_command_journal; + +int +rename_wim_path(WIMStruct *wim, const tchar *from, const tchar *to, + CASE_SENSITIVITY_TYPE case_type, bool noreplace, + struct update_command_journal *j); + + +int +read_dentry_tree(const u8 *buf, size_t buf_len, + u64 root_offset, struct wim_dentry **root_ret); + +u8 * +write_dentry_tree(struct wim_dentry *root, u8 *p); + +static inline bool +dentry_is_root(const struct wim_dentry *dentry) +{ + return dentry->d_parent == dentry; +} + +static inline bool +dentry_is_directory(const struct wim_dentry *dentry) +{ + return inode_is_directory(dentry->d_inode); +} + +static inline bool +dentry_has_children(const struct wim_dentry *dentry) +{ + return inode_has_children(dentry->d_inode); +} + +static inline bool +dentry_has_long_name(const struct wim_dentry *dentry) +{ + return dentry->d_name_nbytes != 0; +} + +static inline bool +dentry_has_short_name(const struct wim_dentry *dentry) +{ + return dentry->d_short_name_nbytes != 0; +} + +#endif /* _WIMLIB_DENTRY_H */ diff --git a/src/wimlib/wimlib/divsufsort.h b/src/wimlib/wimlib/divsufsort.h new file mode 100644 index 00000000..c82bda18 --- /dev/null +++ b/src/wimlib/wimlib/divsufsort.h @@ -0,0 +1,11 @@ +#ifndef _WIMLIB_DIVSUFSORT_H +#define _WIMLIB_DIVSUFSORT_H + +#include "wimlib/types.h" + +void +divsufsort(const u8 *T, u32 *SA, u32 n, u32 *tmp); + +#define DIVSUFSORT_TMP_LEN (256 + (256 * 256)) + +#endif /* _WIMLIB_DIVSUFSORT_H */ diff --git a/src/wimlib/wimlib/encoding.h b/src/wimlib/wimlib/encoding.h new file mode 100644 index 00000000..da83b9d3 --- /dev/null +++ b/src/wimlib/wimlib/encoding.h @@ -0,0 +1,148 @@ +#ifndef _WIMLIB_ENCODING_H +#define _WIMLIB_ENCODING_H + +#include <string.h> + +#include "wimlib/error.h" +#include "wimlib/util.h" +#include "wimlib/types.h" + +/* String conversion functions */ + +int +utf8_to_utf16le(const char *in, size_t in_nbytes, + utf16lechar **out_ret, size_t *out_nbytes_ret); + +int +utf16le_to_utf8(const utf16lechar *in, size_t in_nbytes, + char **out_ret, size_t *out_nbytes_ret); + +/* Identity conversion: duplicate a 'tchar' string. */ +static inline int +tstr_to_tstr(const tchar *in, size_t in_nbytes, + tchar **out_ret, size_t *out_nbytes_ret) +{ + tchar *out = MALLOC(in_nbytes + sizeof(tchar)); + if (unlikely(!out)) + return WIMLIB_ERR_NOMEM; + memcpy(out, in, in_nbytes); + out[in_nbytes / sizeof(tchar)] = 0; + *out_ret = out; + if (out_nbytes_ret) + *out_nbytes_ret = in_nbytes; + return 0; +} + +#if TCHAR_IS_UTF16LE + +/* tstr(UTF-16LE) <=> UTF-16LE */ +# define tstr_to_utf16le tstr_to_tstr +# define utf16le_to_tstr tstr_to_tstr + +/* tstr(UTF-16LE) <=> UTF-8 */ +# define tstr_to_utf8 utf16le_to_utf8 +# define utf8_to_tstr utf8_to_utf16le + +#else + +/* tstr(UTF-8) <=> UTF-16LE */ +# define tstr_to_utf16le utf8_to_utf16le +# define utf16le_to_tstr utf16le_to_utf8 + +/* tstr(UTF-8) <=> UTF-8 */ +# define tstr_to_utf8 tstr_to_tstr +# define utf8_to_tstr tstr_to_tstr + +#endif + +/* Convert a tchar string to UTF-16LE, but if both encodings are UTF-16LE, then + * simply re-use the string. Release with tstr_put_utf16le() when done. */ +static inline int +tstr_get_utf16le_and_len(const tchar *in, + const utf16lechar **out_ret, size_t *out_nbytes_ret) +{ + size_t in_nbytes = tstrlen(in) * sizeof(tchar); +#if TCHAR_IS_UTF16LE + *out_ret = in; + if (out_nbytes_ret) + *out_nbytes_ret = in_nbytes; + return 0; +#else + return tstr_to_utf16le(in, in_nbytes, + (utf16lechar **)out_ret, out_nbytes_ret); +#endif +} + +static inline int +tstr_get_utf16le(const tchar *in, const utf16lechar **out_ret) +{ + return tstr_get_utf16le_and_len(in, out_ret, NULL); +} + +/* Release a string acquired with tstr_get_utf16le() or + * tstr_get_utf16le_and_len(). */ +static inline void +tstr_put_utf16le(const utf16lechar *s) +{ +#if !TCHAR_IS_UTF16LE + FREE((void *)s); +#endif +} + +/* Convert a UTF-16LE string to a tchar string, but if both encodings are + * UTF-16LE, then simply re-use the string. Release with utf16le_put_tstr() + * when done. */ +static inline int +utf16le_get_tstr(const utf16lechar *in, size_t in_nbytes, + const tchar **out_ret, size_t *out_nbytes_ret) +{ +#if TCHAR_IS_UTF16LE + *out_ret = in; + if (out_nbytes_ret) + *out_nbytes_ret = in_nbytes; + return 0; +#else + return utf16le_to_tstr(in, in_nbytes, + (tchar **)out_ret, out_nbytes_ret); +#endif +} + +/* Release a string acquired with utf16le_get_tstr(). */ +static inline void +utf16le_put_tstr(const tchar *s) +{ +#if !TCHAR_IS_UTF16LE + FREE((void *)s); +#endif +} + + +/* UTF-16LE utilities */ + +extern u16 upcase[65536]; + +void +init_upcase(void); + +int +cmp_utf16le_strings(const utf16lechar *s1, size_t n1, + const utf16lechar *s2, size_t n2, + bool ignore_case); + +int +cmp_utf16le_strings_z(const utf16lechar *s1, const utf16lechar *s2, + bool ignore_case); + +utf16lechar * +utf16le_dupz(const void *s, size_t size); + +utf16lechar * +utf16le_dup(const utf16lechar *s); + +size_t +utf16le_len_bytes(const utf16lechar *s); + +size_t +utf16le_len_chars(const utf16lechar *s); + +#endif /* _WIMLIB_ENCODING_H */ diff --git a/src/wimlib/wimlib/endianness.h b/src/wimlib/wimlib/endianness.h new file mode 100644 index 00000000..d72d50a9 --- /dev/null +++ b/src/wimlib/wimlib/endianness.h @@ -0,0 +1,125 @@ +/* + * endianness.h - macros and inline functions for endianness conversion + * + * Copyright 2022 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _WIMLIB_ENDIANNESS_H +#define _WIMLIB_ENDIANNESS_H + +#include "wimlib/compiler.h" +#include "wimlib/types.h" + +#ifdef HAVE_SYS_ENDIAN_H + /* Needed on NetBSD to stop system bswap macros from messing things up */ +# include <sys/endian.h> +# undef bswap16 +# undef bswap32 +# undef bswap64 +#endif + +/* Watch out for conflict with ntfs-3g/endians.h ... */ +#ifndef _NTFS_ENDIANS_H + +#define bswap16_const(n) \ + ((((u16)(n) & 0x00FF) << 8) | \ + (((u16)(n) & 0xFF00) >> 8)) + +#define bswap32_const(n) \ + ((((u32)(n) & 0x000000FF) << 24) | \ + (((u32)(n) & 0x0000FF00) << 8) | \ + (((u32)(n) & 0x00FF0000) >> 8) | \ + (((u32)(n) & 0xFF000000) >> 24)) + +#define bswap64_const(n) \ + ((((u64)(n) & 0x00000000000000FF) << 56) | \ + (((u64)(n) & 0x000000000000FF00) << 40) | \ + (((u64)(n) & 0x0000000000FF0000) << 24) | \ + (((u64)(n) & 0x00000000FF000000) << 8) | \ + (((u64)(n) & 0x000000FF00000000) >> 8) | \ + (((u64)(n) & 0x0000FF0000000000) >> 24) | \ + (((u64)(n) & 0x00FF000000000000) >> 40) | \ + (((u64)(n) & 0xFF00000000000000) >> 56)) + +static forceinline u16 do_bswap16(u16 n) +{ +#if GCC_PREREQ(4, 8) || __has_builtin(__builtin_bswap16) + return __builtin_bswap16(n); +#else + return bswap16_const(n); +#endif +} + +static forceinline u32 do_bswap32(u32 n) +{ +#if GCC_PREREQ(4, 3) || __has_builtin(__builtin_bswap32) + return __builtin_bswap32(n); +#else + return bswap32_const(n); +#endif +} + +static forceinline u64 do_bswap64(u64 n) +{ +#if GCC_PREREQ(4, 3) || __has_builtin(__builtin_bswap64) + return __builtin_bswap64(n); +#else + return bswap64_const(n); +#endif +} + +#define bswap16(n) (__builtin_constant_p(n) ? bswap16_const(n) : do_bswap16(n)) +#define bswap32(n) (__builtin_constant_p(n) ? bswap32_const(n) : do_bswap32(n)) +#define bswap64(n) (__builtin_constant_p(n) ? bswap64_const(n) : do_bswap64(n)) + +#if CPU_IS_BIG_ENDIAN() +# define cpu_to_le16(n) ((_force_attr le16)bswap16(n)) +# define cpu_to_le32(n) ((_force_attr le32)bswap32(n)) +# define cpu_to_le64(n) ((_force_attr le64)bswap64(n)) +# define le16_to_cpu(n) bswap16((_force_attr u16)(le16)(n)) +# define le32_to_cpu(n) bswap32((_force_attr u32)(le32)(n)) +# define le64_to_cpu(n) bswap64((_force_attr u64)(le64)(n)) +# define cpu_to_be16(n) ((_force_attr be16)(u16)(n)) +# define cpu_to_be32(n) ((_force_attr be32)(u32)(n)) +# define cpu_to_be64(n) ((_force_attr be64)(u64)(n)) +# define be16_to_cpu(n) ((_force_attr u16)(be16)(n)) +# define be32_to_cpu(n) ((_force_attr u32)(be32)(n)) +# define be64_to_cpu(n) ((_force_attr u64)(be64)(n)) +#else +# define cpu_to_le16(n) ((_force_attr le16)(u16)(n)) +# define cpu_to_le32(n) ((_force_attr le32)(u32)(n)) +# define cpu_to_le64(n) ((_force_attr le64)(u64)(n)) +# define le16_to_cpu(n) ((_force_attr u16)(le16)(n)) +# define le32_to_cpu(n) ((_force_attr u32)(le32)(n)) +# define le64_to_cpu(n) ((_force_attr u64)(le64)(n)) +# define cpu_to_be16(n) ((_force_attr be16)bswap16(n)) +# define cpu_to_be32(n) ((_force_attr be32)bswap32(n)) +# define cpu_to_be64(n) ((_force_attr be64)bswap64(n)) +# define be16_to_cpu(n) bswap16((_force_attr u16)(be16)(n)) +# define be32_to_cpu(n) bswap32((_force_attr u32)(be32)(n)) +# define be64_to_cpu(n) bswap64((_force_attr u64)(be64)(n)) +#endif + +#endif /* _NTFS_ENDIANS_H */ +#endif /* _WIMLIB_ENDIANNESS_H */ diff --git a/src/wimlib/wimlib/error.h b/src/wimlib/wimlib/error.h new file mode 100644 index 00000000..062acacf --- /dev/null +++ b/src/wimlib/wimlib/error.h @@ -0,0 +1,33 @@ +#ifndef _WIMLIB_ERROR_H +#define _WIMLIB_ERROR_H + +#include <stdio.h> + +#include "wimlib.h" /* Get error code definitions */ +#include "wimlib/compiler.h" +#include "wimlib/types.h" + +void _format_attribute(printf, 1, 2) __attribute__((cold)) +wimlib_error(const tchar *format, ...); + +void _format_attribute(printf, 1, 2) __attribute__((cold)) +wimlib_error_with_errno(const tchar *format, ...); + +void _format_attribute(printf, 1, 2) __attribute__((cold)) +wimlib_warning(const tchar *format, ...); + +void _format_attribute(printf, 1, 2) __attribute__((cold)) +wimlib_warning_with_errno(const tchar *format, ...); + +#define ERROR(format, ...) wimlib_error(T(format), ## __VA_ARGS__) +#define ERROR_WITH_ERRNO(format, ...) wimlib_error_with_errno(T(format), ## __VA_ARGS__) +#define WARNING(format, ...) wimlib_warning(T(format), ## __VA_ARGS__) +#define WARNING_WITH_ERRNO(format, ...) wimlib_warning_with_errno(T(format), ## __VA_ARGS__) + +extern bool wimlib_print_errors; +extern FILE *wimlib_error_file; + +void +print_byte_field(const u8 *field, size_t len, FILE *out); + +#endif /* _WIMLIB_ERROR_H */ diff --git a/src/wimlib/wimlib/file_io.h b/src/wimlib/wimlib/file_io.h new file mode 100644 index 00000000..8dbdb120 --- /dev/null +++ b/src/wimlib/wimlib/file_io.h @@ -0,0 +1,59 @@ +#ifndef _WIMLIB_FILE_IO_H +#define _WIMLIB_FILE_IO_H + +#include <stdbool.h> +#include <stddef.h> +#include <sys/types.h> + +/* Wrapper around a file descriptor that keeps track of offset (including in + * pipes, which don't support lseek()) and a cached flag that tells whether the + * file descriptor is a pipe or not. */ +struct filedes { + int fd; + unsigned int is_pipe : 1; + off_t offset; +}; + +int +full_read(struct filedes *fd, void *buf, size_t n); + +int +full_pread(struct filedes *fd, void *buf, size_t nbyte, off_t offset); + +int +full_write(struct filedes *fd, const void *buf, size_t n); + +int +full_pwrite(struct filedes *fd, const void *buf, size_t count, off_t offset); + +#ifndef _WIN32 +# define O_BINARY 0 +#endif + +off_t +filedes_seek(struct filedes *fd, off_t offset); + +bool +filedes_is_seekable(struct filedes *fd); + +static inline void filedes_init(struct filedes *fd, int raw_fd) +{ + fd->fd = raw_fd; + fd->offset = 0; + fd->is_pipe = 0; +} + +static inline void filedes_invalidate(struct filedes *fd) +{ + fd->fd = -1; +} + +#define filedes_close(f) close((f)->fd) + +static inline bool +filedes_valid(const struct filedes *fd) +{ + return fd->fd != -1; +} + +#endif /* _WIMLIB_FILE_IO_H */ diff --git a/src/wimlib/wimlib/glob.h b/src/wimlib/wimlib/glob.h new file mode 100644 index 00000000..d5ab3999 --- /dev/null +++ b/src/wimlib/wimlib/glob.h @@ -0,0 +1,34 @@ +#ifndef _WIMLIB_GLOB_H +#define _WIMLIB_GLOB_H + +#ifndef _WIN32 +# include <glob.h> +#else +#include <stddef.h> +#include <wchar.h> + +typedef struct { + size_t gl_pathc; + wchar_t **gl_pathv; + size_t gl_offs; +} glob_t; + +/* WARNING: this is a reduced functionality replacement */ +int +win32_wglob(const wchar_t *pattern, int flags, + int (*errfunc)(const wchar_t *epath, int eerrno), + glob_t *pglob); + +void globfree(glob_t *pglob); + +#define GLOB_ERR 0x1 /* Return on read errors. */ +#define GLOB_NOSORT 0x2 /* Don't sort the names. */ + +/* Error returns from `glob'. */ +#define GLOB_NOSPACE 1 /* Ran out of memory. */ +#define GLOB_ABORTED 2 /* Read error. */ +#define GLOB_NOMATCH 3 /* No matches found. */ + +#endif /* _WIN32 */ + +#endif /* _WIMLIB_GLOB_H */ diff --git a/src/wimlib/wimlib/guid.h b/src/wimlib/wimlib/guid.h new file mode 100644 index 00000000..8c5e3064 --- /dev/null +++ b/src/wimlib/wimlib/guid.h @@ -0,0 +1,40 @@ +/* + * guid.h + * + * Utility functions for handling 16-byte globally unique identifiers (GUIDs). + */ + +#ifndef _WIMLIB_GUID_H +#define _WIMLIB_GUID_H + +#include <string.h> + +#include "wimlib/util.h" + +#define GUID_SIZE 16 + +static inline void +copy_guid(u8 dest[GUID_SIZE], const u8 src[GUID_SIZE]) +{ + memcpy(dest, src, GUID_SIZE); +} + +static inline int +cmp_guids(const u8 guid1[GUID_SIZE], const u8 guid2[GUID_SIZE]) +{ + return memcmp(guid1, guid2, GUID_SIZE); +} + +static inline bool +guids_equal(const u8 guid1[GUID_SIZE], const u8 guid2[GUID_SIZE]) +{ + return !cmp_guids(guid1, guid2); +} + +static inline void +generate_guid(u8 guid[GUID_SIZE]) +{ + return get_random_bytes(guid, GUID_SIZE); +} + +#endif /* _WIMLIB_GUID_H */ diff --git a/src/wimlib/wimlib/hc_matchfinder.h b/src/wimlib/wimlib/hc_matchfinder.h new file mode 100644 index 00000000..a96aa651 --- /dev/null +++ b/src/wimlib/wimlib/hc_matchfinder.h @@ -0,0 +1,391 @@ +/* + * hc_matchfinder.h - Lempel-Ziv matchfinding with a hash table of linked lists + * + * Copyright 2022 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * --------------------------------------------------------------------------- + * + * Algorithm + * + * This is a Hash Chains (hc) based matchfinder. + * + * The main data structure is a hash table where each hash bucket contains a + * linked list (or "chain") of sequences whose first 4 bytes share the same hash + * code. Each sequence is identified by its starting position in the input + * buffer. + * + * The algorithm processes the input buffer sequentially. At each byte + * position, the hash code of the first 4 bytes of the sequence beginning at + * that position (the sequence being matched against) is computed. This + * identifies the hash bucket to use for that position. Then, this hash + * bucket's linked list is searched for matches. Then, a new linked list node + * is created to represent the current sequence and is prepended to the list. + * + * This algorithm has several useful properties: + * + * - It only finds true Lempel-Ziv matches; i.e., those where the matching + * sequence occurs prior to the sequence being matched against. + * + * - The sequences in each linked list are always sorted by decreasing starting + * position. Therefore, the closest (smallest offset) matches are found + * first, which in many compression formats tend to be the cheapest to encode. + * + * - Although fast running time is not guaranteed due to the possibility of the + * lists getting very long, the worst degenerate behavior can be easily + * prevented by capping the number of nodes searched at each position. + * + * - If the compressor decides not to search for matches at a certain position, + * then that position can be quickly inserted without searching the list. + * + * - The algorithm is adaptable to sliding windows: just store the positions + * relative to a "base" value that is updated from time to time, and stop + * searching each list when the sequences get too far away. + * + * --------------------------------------------------------------------------- + * + * Notes on usage + * + * Before including this header, you must define 'mf_pos_t' to an integer type + * that can represent all possible positions. This can be a 16-bit or 32-bit + * unsigned integer. When possible, the former should be used due to the + * reduced cache pressure. This header can be included multiple times in a + * single .c file with different 'mf_pos_t' definitions; however, you must + * define a different MF_SUFFIX each time to generate different names for the + * matchfinder structure and functions. + * + * The number of bytes that must be allocated for a given 'struct + * hc_matchfinder' must be gotten by calling hc_matchfinder_size(). + * + * ---------------------------------------------------------------------------- + * + * Optimizations + * + * The main hash table and chains handle length 4+ matches. Length 3 matches + * are handled by a separate hash table with no chains. This works well for + * typical "greedy" or "lazy"-style compressors, where length 3 matches are + * often only helpful if they have small offsets. Instead of searching a full + * chain for length 3+ matches, the algorithm just checks for one close length 3 + * match, then focuses on finding length 4+ matches. + * + * The longest_match() and skip_bytes() functions are inlined into the + * compressors that use them. This isn't just about saving the overhead of a + * function call. These functions are intended to be called from the inner + * loops of compressors, where giving the compiler more control over register + * allocation is very helpful. There is also significant benefit to be gained + * from allowing the CPU to predict branches independently at each call site. + * For example, "lazy"-style compressors can be written with two calls to + * longest_match(), each of which starts with a different 'best_len' and + * therefore has significantly different performance characteristics. + * + * Although any hash function can be used, a multiplicative hash is fast and + * works well. + * + * On some processors, it is significantly faster to extend matches by whole + * words (32 or 64 bits) instead of by individual bytes. For this to be the + * case, the processor must implement unaligned memory accesses efficiently and + * must have either a fast "find first set bit" instruction or a fast "find last + * set bit" instruction, depending on the processor's endianness. + * + * The code uses one loop for finding the first match and one loop for finding a + * longer match. Each of these loops is tuned for its respective task and in + * combination are faster than a single generalized loop that handles both + * tasks. + * + * The code also uses a tight inner loop that only compares the last and first + * bytes of a potential match. It is only when these bytes match that a full + * match extension is attempted. + * + * ---------------------------------------------------------------------------- + */ + +#include <string.h> + +#include "wimlib/matchfinder_common.h" + +#define HC_MATCHFINDER_HASH3_ORDER 15 +#define HC_MATCHFINDER_HASH4_ORDER 16 + +/* TEMPLATED functions and structures have MF_SUFFIX appended to their name. */ +#undef TEMPLATED +#define TEMPLATED(name) CONCAT(name, MF_SUFFIX) + +struct TEMPLATED(hc_matchfinder) { + + /* The hash table for finding length 3 matches */ + mf_pos_t hash3_tab[1UL << HC_MATCHFINDER_HASH3_ORDER]; + + /* The hash table which contains the first nodes of the linked lists for + * finding length 4+ matches */ + mf_pos_t hash4_tab[1UL << HC_MATCHFINDER_HASH4_ORDER]; + + /* The "next node" references for the linked lists. The "next node" of + * the node for the sequence with position 'pos' is 'next_tab[pos]'. */ + mf_pos_t next_tab[]; +}; + +/* Return the number of bytes that must be allocated for a 'hc_matchfinder' that + * can work with buffers up to the specified size. */ +static forceinline size_t +TEMPLATED(hc_matchfinder_size)(size_t max_bufsize) +{ + return sizeof(struct TEMPLATED(hc_matchfinder)) + + (max_bufsize * sizeof(mf_pos_t)); +} + +/* Prepare the matchfinder for a new input buffer. */ +static forceinline void +TEMPLATED(hc_matchfinder_init)(struct TEMPLATED(hc_matchfinder) *mf) +{ + memset(mf, 0, sizeof(*mf)); +} + +/* + * Find the longest match longer than 'best_len' bytes. + * + * @mf + * The matchfinder structure. + * @in_begin + * Pointer to the beginning of the input buffer. + * @in_next + * Pointer to the next position in the input buffer, i.e. the sequence + * being matched against. + * @best_len + * Require a match longer than this length. + * @max_len + * The maximum permissible match length at this position. + * @nice_len + * Stop searching if a match of at least this length is found. + * Must be <= @max_len. + * @max_search_depth + * Limit on the number of potential matches to consider. Must be >= 1. + * @next_hashes + * The precomputed hash codes for the sequence beginning at @in_next. + * These will be used and then updated with the precomputed hashcodes for + * the sequence beginning at @in_next + 1. + * @offset_ret + * If a match is found, its offset is returned in this location. + * + * Return the length of the match found, or 'best_len' if no match longer than + * 'best_len' was found. + */ +static forceinline u32 +TEMPLATED(hc_matchfinder_longest_match)(struct TEMPLATED(hc_matchfinder) * const mf, + const u8 * const in_begin, + const u8 * const in_next, + u32 best_len, + const u32 max_len, + const u32 nice_len, + const u32 max_search_depth, + u32 * const next_hashes, + u32 * const offset_ret) +{ + u32 depth_remaining = max_search_depth; + const u8 *best_matchptr = in_next; + mf_pos_t cur_node3, cur_node4; + u32 hash3, hash4; + u32 next_hashseq; + u32 seq4; + const u8 *matchptr; + u32 len; + u32 cur_pos = in_next - in_begin; + + if (unlikely(max_len < 5)) /* can we read 4 bytes from 'in_next + 1'? */ + goto out; + + /* Get the precomputed hash codes. */ + hash3 = next_hashes[0]; + hash4 = next_hashes[1]; + + /* From the hash buckets, get the first node of each linked list. */ + cur_node3 = mf->hash3_tab[hash3]; + cur_node4 = mf->hash4_tab[hash4]; + + /* Update for length 3 matches. This replaces the singleton node in the + * 'hash3' bucket with the node for the current sequence. */ + mf->hash3_tab[hash3] = cur_pos; + + /* Update for length 4 matches. This prepends the node for the current + * sequence to the linked list in the 'hash4' bucket. */ + mf->hash4_tab[hash4] = cur_pos; + mf->next_tab[cur_pos] = cur_node4; + + /* Compute the next hash codes. */ + next_hashseq = get_unaligned_le32(in_next + 1); + next_hashes[0] = lz_hash(next_hashseq & 0xFFFFFF, HC_MATCHFINDER_HASH3_ORDER); + next_hashes[1] = lz_hash(next_hashseq, HC_MATCHFINDER_HASH4_ORDER); + prefetchw(&mf->hash3_tab[next_hashes[0]]); + prefetchw(&mf->hash4_tab[next_hashes[1]]); + + if (best_len < 4) { /* No match of length >= 4 found yet? */ + + /* Check for a length 3 match if needed. */ + + if (!cur_node3) + goto out; + + seq4 = load_u32_unaligned(in_next); + + if (best_len < 3) { + matchptr = &in_begin[cur_node3]; + if (load_u24_unaligned(matchptr) == loaded_u32_to_u24(seq4)) { + best_len = 3; + best_matchptr = matchptr; + } + } + + /* Check for a length 4 match. */ + + if (!cur_node4) + goto out; + + for (;;) { + /* No length 4 match found yet. Check the first 4 bytes. */ + matchptr = &in_begin[cur_node4]; + + if (load_u32_unaligned(matchptr) == seq4) + break; + + /* The first 4 bytes did not match. Keep trying. */ + cur_node4 = mf->next_tab[cur_node4]; + if (!cur_node4 || !--depth_remaining) + goto out; + } + + /* Found a match of length >= 4. Extend it to its full length. */ + best_matchptr = matchptr; + best_len = lz_extend(in_next, best_matchptr, 4, max_len); + if (best_len >= nice_len) + goto out; + cur_node4 = mf->next_tab[cur_node4]; + if (!cur_node4 || !--depth_remaining) + goto out; + } else { + if (!cur_node4 || best_len >= nice_len) + goto out; + } + + /* Check for matches of length >= 5. */ + + for (;;) { + for (;;) { + matchptr = &in_begin[cur_node4]; + + /* Already found a length 4 match. Try for a longer + * match; start by checking either the last 4 bytes and + * the first 4 bytes, or the last byte. (The last byte, + * the one which would extend the match length by 1, is + * the most important.) */ + #if UNALIGNED_ACCESS_IS_FAST + if ((load_u32_unaligned(matchptr + best_len - 3) == + load_u32_unaligned(in_next + best_len - 3)) && + (load_u32_unaligned(matchptr) == + load_u32_unaligned(in_next))) + #else + if (matchptr[best_len] == in_next[best_len]) + #endif + break; + + /* Continue to the next node in the list. */ + cur_node4 = mf->next_tab[cur_node4]; + if (!cur_node4 || !--depth_remaining) + goto out; + } + + #if UNALIGNED_ACCESS_IS_FAST + len = 4; + #else + len = 0; + #endif + len = lz_extend(in_next, matchptr, len, max_len); + if (len > best_len) { + /* This is the new longest match. */ + best_len = len; + best_matchptr = matchptr; + if (best_len >= nice_len) + goto out; + } + + /* Continue to the next node in the list. */ + cur_node4 = mf->next_tab[cur_node4]; + if (!cur_node4 || !--depth_remaining) + goto out; + } +out: + *offset_ret = in_next - best_matchptr; + return best_len; +} + +/* + * Advance the matchfinder, but don't search for matches. + * + * @mf + * The matchfinder structure. + * @in_begin + * Pointer to the beginning of the input buffer. + * @in_next + * Pointer to the next position in the input buffer. + * @in_end + * Pointer to the end of the input buffer. + * @count + * The number of bytes to advance. Must be > 0. + * @next_hashes + * The precomputed hash codes for the sequence beginning at @in_next. + * These will be used and then updated with the precomputed hashcodes for + * the sequence beginning at @in_next + @count. + */ +static forceinline void +TEMPLATED(hc_matchfinder_skip_bytes)(struct TEMPLATED(hc_matchfinder) * const mf, + const u8 * const in_begin, + const u8 *in_next, + const u8 * const in_end, + const u32 count, + u32 * const next_hashes) +{ + u32 cur_pos; + u32 hash3, hash4; + u32 next_hashseq; + u32 remaining = count; + + if (unlikely(count + 5 > in_end - in_next)) + return; + + cur_pos = in_next - in_begin; + hash3 = next_hashes[0]; + hash4 = next_hashes[1]; + do { + mf->hash3_tab[hash3] = cur_pos; + mf->next_tab[cur_pos] = mf->hash4_tab[hash4]; + mf->hash4_tab[hash4] = cur_pos; + + next_hashseq = get_unaligned_le32(++in_next); + hash3 = lz_hash(next_hashseq & 0xFFFFFF, HC_MATCHFINDER_HASH3_ORDER); + hash4 = lz_hash(next_hashseq, HC_MATCHFINDER_HASH4_ORDER); + cur_pos++; + } while (--remaining); + + prefetchw(&mf->hash3_tab[hash3]); + prefetchw(&mf->hash4_tab[hash4]); + next_hashes[0] = hash3; + next_hashes[1] = hash4; +} diff --git a/src/wimlib/wimlib/header.h b/src/wimlib/wimlib/header.h new file mode 100644 index 00000000..49ccf0b2 --- /dev/null +++ b/src/wimlib/wimlib/header.h @@ -0,0 +1,199 @@ +#ifndef _WIMLIB_HEADER_H +#define _WIMLIB_HEADER_H + +#include <limits.h> + +#include "wimlib/guid.h" +#include "wimlib/resource.h" +#include "wimlib/types.h" + +/* Length of the WIM header on disk. wimlib currently requires that the header + * be exactly this size. */ +#define WIM_HEADER_DISK_SIZE 208 + +/* Default WIM version number. Blobs are always compressed independently. */ +#define WIM_VERSION_DEFAULT 0x10d00 + +/* Version number used for WIMs that allow multiple blobs combined into one + * resource ("solid resources", marked by WIM_RESHDR_FLAG_SOLID) and also a new + * compression format (LZMS). This version is new as of Windows 8 WIMGAPI. + * Although it is used by Windows 8 web downloader, it is not yet documented by + * Microsoft. */ +#define WIM_VERSION_SOLID 0xe00 + +/* Note: there is another WIM version from Vista pre-releases, but it is not + * supported by wimlib. */ + +/* WIM magic characters, translated to a single 64-bit number. */ +#define WIM_MAGIC \ + (((u64)'M' << 0) | \ + ((u64)'S' << 8) | \ + ((u64)'W' << 16) | \ + ((u64)'I' << 24) | \ + ((u64)'M' << 32) | \ + ((u64)'\0' << 40) | \ + ((u64)'\0' << 48) | \ + ((u64)'\0' << 54)) + +/* wimlib pipable WIM magic characters, translated to a single 64-bit number. + * */ +#define PWM_MAGIC \ + (((u64)'W' << 0) | \ + ((u64)'L' << 8) | \ + ((u64)'P' << 16) | \ + ((u64)'W' << 24) | \ + ((u64)'M' << 32) | \ + ((u64)'\0' << 40) | \ + ((u64)'\0' << 48) | \ + ((u64)'\0' << 54)) + +/* On-disk format of the WIM header. */ +struct wim_header_disk { + + /* +0x00: Magic characters WIM_MAGIC or PWM_MAGIC. */ + le64 magic; + + /* +0x08: Size of the WIM header, in bytes; WIM_HEADER_DISK_SIZE + * expected (currently the only supported value). */ + le32 hdr_size; + + /* +0x0c: Version of the WIM file. Recognized values are the + * WIM_VERSION_* constants from above. */ + le32 wim_version; + + /* +0x10: Flags for the WIM file (WIM_HDR_FLAG_*). */ + le32 wim_flags; + + /* +0x14: Uncompressed chunk size for non-solid compressed resources in + * the WIM or 0 if the WIM is uncompressed. */ + le32 chunk_size; + + /* +0x18: Globally unique identifier for the WIM file. Basically a + * bunch of random bytes. */ + u8 guid[GUID_SIZE]; + + /* +0x28: Number of this WIM part in the split WIM file, indexed from 1, + * or 1 if the WIM is not split. */ + le16 part_number; + + /* +0x2a: Total number of parts of the split WIM file, or 1 if the WIM + * is not split. */ + le16 total_parts; + + /* +0x2c: Number of images in the WIM. WIMGAPI requires that this be at + * least 1. wimlib allows 0. */ + le32 image_count; + + /* +0x30: Location and size of the WIM's blob table. */ + struct wim_reshdr_disk blob_table_reshdr; + + /* +0x48: Location and size of the WIM's XML data. */ + struct wim_reshdr_disk xml_data_reshdr; + + /* +0x60: Location and size of metadata resource for the bootable image + * of the WIM, or all zeroes if no image is bootable. */ + struct wim_reshdr_disk boot_metadata_reshdr; + + /* +0x78: 1-based index of the bootable image of the WIM, or 0 if no + * image is bootable. */ + le32 boot_idx; + + /* +0x7c: Location and size of the WIM's integrity table, or all zeroes + * if the WIM has no integrity table. + * + * Note the integrity_table_reshdr here is 4-byte aligned even though it + * would ordinarily be 8-byte aligned--- hence, the + * __attribute__((packed)) on this structure is essential. */ + struct wim_reshdr_disk integrity_table_reshdr; + + /* +0x94: Unused bytes. */ + u8 unused[60]; + + /* +0xd0 (208) */ +} __attribute__((packed)); + +/* + * Arbitrarily limit the maximum number of images to 65535, to prevent huge + * memory allocations when processing fuzzed files. This can be increased if + * ever needed (up to INT_MAX - 1). + */ +#define MAX_IMAGES 65535 + +/* In-memory representation of a WIM header. See `struct wim_header_disk' for + * field descriptions. */ +struct wim_header { + u64 magic; + u32 wim_version; + u32 flags; + u32 chunk_size; + u8 guid[GUID_SIZE]; + u16 part_number; + u16 total_parts; + u32 image_count; + struct wim_reshdr blob_table_reshdr; + struct wim_reshdr xml_data_reshdr; + struct wim_reshdr boot_metadata_reshdr; + u32 boot_idx; + struct wim_reshdr integrity_table_reshdr; +}; + +/* WIM header flags ('wim_flags' field of 'struct wim_header_disk'): */ + +/* Reserved flag. */ +#define WIM_HDR_FLAG_RESERVED 0x00000001 + +/* The WIM may contain compressed resources --- specifically, resources with + * WIM_RESHDR_FLAG_COMPRESSED set in their headers. Exactly one of the more + * specific WIM_HDR_FLAG_COMPRESSION_* flags must be set to specify the + * compression format used. */ +#define WIM_HDR_FLAG_COMPRESSION 0x00000002 + +/* The WIM is read-only, so modifications should not be allowed even if the WIM + * is writable at the filesystem level. */ +#define WIM_HDR_FLAG_READONLY 0x00000004 + +/* The WIM is part of a split WIM. */ +#define WIM_HDR_FLAG_SPANNED 0x00000008 + +/* All blobs included in the WIM's blob table are non-metadata (do not have + * WIM_RESHDR_FLAG_METADATA set). wimlib ignores this flag and clears it on new + * WIM files it writes. */ +#define WIM_HDR_FLAG_RESOURCE_ONLY 0x00000010 + +/* All blobs included in the WIM's blob table are metadata (have + * WIM_RESHDR_FLAG_METADATA set). wimlib ignores this flag and clears it on new + * WIM files it writes. */ +#define WIM_HDR_FLAG_METADATA_ONLY 0x00000020 + +/* The WIM is currently being written or appended to. */ +#define WIM_HDR_FLAG_WRITE_IN_PROGRESS 0x00000040 + +/* Reparse point fixup flag. See docs for the --rpfix and --norpfix options to + * 'wimlib-imagex capture', or the WIMLIB_ADD_FLAG_{RPFIX,NORPFIX} flags in + * wimlib.h. Note that WIM_HDR_FLAG_RP_FIX is a header flag and just sets the + * default behavior for the WIM; it can still be programatically overridden on a + * per-image basis. But there is no flag in the file format to set the default + * behavior for a specific image. */ +#define WIM_HDR_FLAG_RP_FIX 0x00000080 + +/* Unused, reserved flag for another compression type. */ +#define WIM_HDR_FLAG_COMPRESS_RESERVED 0x00010000 + +/* Resources in the WIM with WIM_RESHDR_FLAG_COMPRESSED set in their headers are + * compressed with XPRESS compression. */ +#define WIM_HDR_FLAG_COMPRESS_XPRESS 0x00020000 + +/* Resources in the WIM with WIM_RESHDR_FLAG_COMPRESSED set in their headers are + * compressed with LZX compression. */ +#define WIM_HDR_FLAG_COMPRESS_LZX 0x00040000 + +/* Resources in the WIM with WIM_RESHDR_FLAG_COMPRESSED set in their headers are + * compressed with LZMS compression. Note: this flag is only valid if the WIM + * version is WIM_VERSION_SOLID. Also, this flag is only supported in wimlib + * v1.6.0 and later and WIMGAPI Windows 8 and later. */ +#define WIM_HDR_FLAG_COMPRESS_LZMS 0x00080000 + +/* XPRESS, with small chunk size??? */ +#define WIM_HDR_FLAG_COMPRESS_XPRESS_2 0x00200000 + +#endif /* _WIMLIB_HEADER_H */ diff --git a/src/wimlib/wimlib/inode.h b/src/wimlib/wimlib/inode.h new file mode 100644 index 00000000..bdf2ad18 --- /dev/null +++ b/src/wimlib/wimlib/inode.h @@ -0,0 +1,433 @@ +#ifndef _WIMLIB_INODE_H +#define _WIMLIB_INODE_H + +#include "wimlib/assert.h" +#include "wimlib/list.h" +#include "wimlib/sha1.h" +#include "wimlib/types.h" + +struct avl_tree_node; +struct blob_descriptor; +struct blob_table; +struct wim_dentry; +struct wim_inode_extra; +struct wim_security_data; +struct wimfs_fd; + +/* Valid values for the 'stream_type' field of a 'struct wim_inode_stream' */ +enum wim_inode_stream_type { + + /* Data stream, may be unnamed (usual case) or named */ + STREAM_TYPE_DATA, + + /* Reparse point stream. This is the same as the data of the on-disk + * reparse point attribute, except that the first 8 bytes of the on-disk + * attribute are omitted. The omitted bytes contain the reparse tag + * (which is instead stored in the on-disk WIM dentry), the reparse data + * size (which is redundant with the stream size), and a reserved field + * that is always zero. */ + STREAM_TYPE_REPARSE_POINT, + + /* Encrypted data in the "EFSRPC raw data format" specified by [MS-EFSR] + * section 2.2.3. This contains metadata for the Encrypting File System + * as well as the encrypted data of all the file's data streams. */ + STREAM_TYPE_EFSRPC_RAW_DATA, + + /* Stream type could not be determined */ + STREAM_TYPE_UNKNOWN, +}; + +extern const utf16lechar NO_STREAM_NAME[1]; + +/* + * 'struct wim_inode_stream' describes a "stream", which associates a blob of + * data with an inode. Each stream has a type and optionally a name. + * + * The most frequently seen kind of stream is the "unnamed data stream" + * (stream_type == STREAM_TYPE_DATA && stream_name == NO_STREAM_NAME), which is + * the "default file contents". Many inodes just have an unnamed data stream + * and no other streams. However, files on NTFS filesystems may have + * additional, "named" data streams, and this is supported by the WIM format. + * + * A "reparse point" is an inode with reparse data set. The reparse data is + * stored in a stream of type STREAM_TYPE_REPARSE_POINT. There should be only + * one such stream, and it should be unnamed. However, it is possible for an + * inode to have both a reparse point stream and an unnamed data stream, and + * even named data streams as well. + */ +struct wim_inode_stream { + + /* The name of the stream or NO_STREAM_NAME. */ + utf16lechar *stream_name; + + /* + * If 'stream_resolved' = 0, then 'stream_hash' is the SHA-1 message + * digest of the uncompressed data of this stream, or all zeroes if this + * stream is empty. + * + * If 'stream_resolved' = 1, then 'stream_blob' is a pointer directly to + * a descriptor for this stream's blob, or NULL if this stream is empty. + */ + union { + u8 _stream_hash[SHA1_HASH_SIZE]; + struct blob_descriptor *_stream_blob; + }; + + /* 'stream_resolved' determines whether 'stream_hash' or 'stream_blob' + * is valid as described above. */ + u32 stream_resolved : 1; + + /* A unique identifier for this stream within the context of its inode. + * This stays constant even if the streams array is reallocated. */ + u32 stream_id : 28; + + /* The type of this stream as one of the STREAM_TYPE_* values */ + u32 stream_type : 3; +}; + +/* + * WIM inode - a "file" in an image which may be accessible via multiple paths + * + * Note: in WIM files there is no true on-disk analogue of an inode; there are + * only directory entries, and some fields are duplicated among all links to a + * file. However, wimlib uses inode structures internally to simplify handling + * of hard links. + */ +struct wim_inode { + + /* + * The collection of streams for this inode. 'i_streams' points to + * either 'i_embedded_streams' or an allocated array. + */ + struct wim_inode_stream *i_streams; + struct wim_inode_stream i_embedded_streams[1]; + unsigned i_num_streams; + + /* Windows file attribute flags (FILE_ATTRIBUTE_*). */ + u32 i_attributes; + + /* Root of a balanced binary search tree storing the child directory + * entries of this inode, if any, indexed by filename. If this inode is + * not a directory or if it has no children then this will be an empty + * tree (NULL). */ + struct avl_tree_node *i_children; + + /* List of dentries that are aliases for this inode. There will be + * i_nlink dentries in this list. */ + struct hlist_head i_alias_list; + + /* Field to place this inode into a list. While reading a WIM image or + * adding files to a WIM image this is owned by the inode table; + * otherwise this links the inodes for the WIM image. */ + struct hlist_node i_hlist_node; + + /* Number of dentries that are aliases for this inode. */ + u32 i_nlink : 30; + + /* Flag used by some code to mark this inode as visited. It will be 0 + * by default, and it always must be cleared after use. */ + u32 i_visited : 1; + + /* Cached value */ + u32 i_can_externally_back : 1; + + /* If not NULL, a pointer to the extra data that was read from the + * dentry. This should be a series of tagged items, each of which + * represents a bit of extra metadata, such as the file's object ID. + * See tagged_items.c for more information. */ + struct wim_inode_extra *i_extra; + + /* Creation time, last access time, and last write time for this inode, + * in 100-nanosecond intervals since 12:00 a.m UTC January 1, 1601. + * They should correspond to the times gotten by calling GetFileTime() + * on Windows. */ + u64 i_creation_time; + u64 i_last_access_time; + u64 i_last_write_time; + + /* Corresponds to 'security_id' in `struct wim_dentry_on_disk': The + * index of this inode's security descriptor in the WIM image's table of + * security descriptors, or -1 if this inode does not have a security + * descriptor. */ + s32 i_security_id; + + /* Unknown field that we only read into memory so we can re-write it + * unchanged. Probably it's actually just padding... */ + u32 i_unknown_0x54; + + /* The following fields correspond to 'reparse_tag', 'rp_reserved', and + * 'rp_flags' in `struct wim_dentry_on_disk'. They are only meaningful + * for reparse point files. */ + u32 i_reparse_tag; + u16 i_rp_reserved; + u16 i_rp_flags; + + /* Inode number; corresponds to hard_link_group_id in the `struct + * wim_dentry_on_disk'. */ + u64 i_ino; + + union { + /* Device number, used only during image capture, so we can + * identify hard linked files by the combination of inode number + * and device number (rather than just inode number, which could + * be ambiguous if the captured tree spans a mountpoint). Set + * to 0 otherwise. */ + u64 i_devno; + + /* Fields used only during extraction */ + struct { + /* A singly linked list of aliases of this inode that + * are being extracted in the current extraction + * operation. This list may be shorter than the inode's + * full alias list. This list will be constructed + * regardless of whether the extraction backend supports + * hard links or not. */ + struct wim_dentry *i_first_extraction_alias; + + #ifdef WITH_NTFS_3G + /* In NTFS-3G extraction mode, this is set to the Master + * File Table (MFT) number of the NTFS file that was + * created for this inode. */ + u64 i_mft_no; + #endif + }; + + /* Used during WIM writing with + * WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES: the number + * of streams this inode has that have not yet been fully read. + * */ + u32 i_num_remaining_streams; + +#ifdef WITH_FUSE + struct { + /* Used only during image mount: Table of file + * descriptors that have been opened to this inode. + * This table is freed when the last file descriptor is + * closed. */ + struct wimfs_fd **i_fds; + + /* Lower bound on the index of the next available entry + * in 'i_fds'. */ + u16 i_next_fd; + }; +#endif + }; + +#ifdef WITH_FUSE + u16 i_num_opened_fds; + u16 i_num_allocated_fds; +#endif + + /* Next stream ID to be assigned */ + u32 i_next_stream_id; + +#ifdef ENABLE_TEST_SUPPORT + struct wim_inode *i_corresponding; +#endif +}; + +/* Optional extra data for a WIM inode */ +struct wim_inode_extra { + size_t size; /* Size of the extra data in bytes */ + u8 data[] __attribute__((aligned(8))); /* The extra data */ +}; + +/* + * The available reparse tags are documented at + * https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/c8e77b37-3909-4fe6-a4ea-2b9d423b1ee4 + * Here we only define the ones of interest to us. + */ +#define WIM_IO_REPARSE_TAG_MOUNT_POINT 0xA0000003 +#define WIM_IO_REPARSE_TAG_SYMLINK 0xA000000C +#define WIM_IO_REPARSE_TAG_DEDUP 0x80000013 +#define WIM_IO_REPARSE_TAG_WOF 0x80000017 + +/* Flags for the rp_flags field. Currently the only known flag is NOT_FIXED, + * which indicates that the target of the absolute symbolic link or junction was + * not changed when it was stored. */ +#define WIM_RP_FLAG_NOT_FIXED 0x0001 + +/* Windows file attribute flags */ +#define FILE_ATTRIBUTE_READONLY 0x00000001 +#define FILE_ATTRIBUTE_HIDDEN 0x00000002 +#define FILE_ATTRIBUTE_SYSTEM 0x00000004 +#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 +#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 +#define FILE_ATTRIBUTE_DEVICE 0x00000040 +#define FILE_ATTRIBUTE_NORMAL 0x00000080 +#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 +#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200 +#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 +#define FILE_ATTRIBUTE_COMPRESSED 0x00000800 +#define FILE_ATTRIBUTE_OFFLINE 0x00001000 +#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000 +#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000 +#define FILE_ATTRIBUTE_VIRTUAL 0x00010000 + +struct wim_inode * +new_inode(struct wim_dentry *dentry, bool set_timestamps); + +/* Iterate through each alias of the specified inode. */ +#define inode_for_each_dentry(dentry, inode) \ + hlist_for_each_entry((dentry), &(inode)->i_alias_list, d_alias_node) + +/* Return an alias of the specified inode. */ +#define inode_any_dentry(inode) \ + hlist_entry(inode->i_alias_list.first, struct wim_dentry, d_alias_node) + +/* Return the full path of an alias of the specified inode, or NULL if a full + * path could not be determined. */ +#define inode_any_full_path(inode) \ + dentry_full_path(inode_any_dentry(inode)) + +void +d_associate(struct wim_dentry *dentry, struct wim_inode *inode); + +void +d_disassociate(struct wim_dentry *dentry); + +#ifdef WITH_FUSE +void +inode_dec_num_opened_fds(struct wim_inode *inode); +#endif + +/* Is the inode a directory? + * This doesn't count directories with reparse data. + * wimlib only allows inodes of this type to have children. + */ +static inline bool +inode_is_directory(const struct wim_inode *inode) +{ + return (inode->i_attributes & (FILE_ATTRIBUTE_DIRECTORY | + FILE_ATTRIBUTE_REPARSE_POINT)) + == FILE_ATTRIBUTE_DIRECTORY; +} + +/* Is the inode a symbolic link? + * This returns true iff the inode is a reparse point that is either a "real" + * symbolic link or a junction point. */ +static inline bool +inode_is_symlink(const struct wim_inode *inode) +{ + return (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) + && (inode->i_reparse_tag == WIM_IO_REPARSE_TAG_SYMLINK || + inode->i_reparse_tag == WIM_IO_REPARSE_TAG_MOUNT_POINT); +} + +/* Does the inode have children? Currently (based on read_dentry_tree() as well + * as the various build-dentry-tree implementations), this can only return true + * for inodes for which inode_is_directory() returns true. */ +static inline bool +inode_has_children(const struct wim_inode *inode) +{ + return inode->i_children != NULL; +} + +/* Does the inode have a security descriptor? */ +static inline bool +inode_has_security_descriptor(const struct wim_inode *inode) +{ + return inode->i_security_id >= 0; +} + +struct wim_inode_stream * +inode_get_stream(const struct wim_inode *inode, int stream_type, + const utf16lechar *stream_name); + +struct wim_inode_stream * +inode_get_unnamed_stream(const struct wim_inode *inode, int stream_type); + +static inline struct wim_inode_stream * +inode_get_unnamed_data_stream(const struct wim_inode *inode) +{ + return inode_get_unnamed_stream(inode, STREAM_TYPE_DATA); +} + +struct wim_inode_stream * +inode_add_stream(struct wim_inode *inode, int stream_type, + const utf16lechar *stream_name, struct blob_descriptor *blob); + +void +inode_replace_stream_blob(struct wim_inode *inode, + struct wim_inode_stream *strm, + struct blob_descriptor *new_blob, + struct blob_table *blob_table); + +bool +inode_replace_stream_data(struct wim_inode *inode, + struct wim_inode_stream *strm, + const void *data, size_t size, + struct blob_table *blob_table); + +bool +inode_add_stream_with_data(struct wim_inode *inode, + int stream_type, const utf16lechar *stream_name, + const void *data, size_t size, + struct blob_table *blob_table); + +void +inode_remove_stream(struct wim_inode *inode, struct wim_inode_stream *strm, + struct blob_table *blob_table); + +static inline struct blob_descriptor * +stream_blob_resolved(const struct wim_inode_stream *strm) +{ + wimlib_assert(strm->stream_resolved); + return strm->_stream_blob; +} + +static inline bool +stream_is_named(const struct wim_inode_stream *strm) +{ + return strm->stream_name != NO_STREAM_NAME; +} + +static inline bool +stream_is_unnamed_data_stream(const struct wim_inode_stream *strm) +{ + return strm->stream_type == STREAM_TYPE_DATA && !stream_is_named(strm); +} + +static inline bool +stream_is_named_data_stream(const struct wim_inode_stream *strm) +{ + return strm->stream_type == STREAM_TYPE_DATA && stream_is_named(strm); +} + +bool +inode_has_named_data_stream(const struct wim_inode *inode); + +int +inode_resolve_streams(struct wim_inode *inode, struct blob_table *table, + bool force); + +int +blob_not_found_error(const struct wim_inode *inode, const u8 *hash); + +struct blob_descriptor * +stream_blob(const struct wim_inode_stream *strm, const struct blob_table *table); + +struct blob_descriptor * +inode_get_blob_for_unnamed_data_stream(const struct wim_inode *inode, + const struct blob_table *blob_table); + +struct blob_descriptor * +inode_get_blob_for_unnamed_data_stream_resolved(const struct wim_inode *inode); + +const u8 * +stream_hash(const struct wim_inode_stream *strm); + +const u8 * +inode_get_hash_of_unnamed_data_stream(const struct wim_inode *inode); + +void +inode_ref_blobs(struct wim_inode *inode); + +void +inode_unref_blobs(struct wim_inode *inode, struct blob_table *blob_table); + +/* inode_fixup.c */ +int +dentry_tree_fix_inodes(struct wim_dentry *root, struct hlist_head *inode_list); + +#endif /* _WIMLIB_INODE_H */ diff --git a/src/wimlib/wimlib/inode_table.h b/src/wimlib/wimlib/inode_table.h new file mode 100644 index 00000000..781a8706 --- /dev/null +++ b/src/wimlib/wimlib/inode_table.h @@ -0,0 +1,49 @@ +#ifndef _WIMLIB_INODE_TABLE_H +#define _WIMLIB_INODE_TABLE_H + +#include "wimlib/list.h" +#include "wimlib/types.h" +#include "wimlib/util.h" + +struct wim_dentry; + +/* Hash table to find inodes for hard link detection, given an inode number (in + * the case of reading a WIM image), or both an inode number and a device number + * (in the case of adding files to a WIM image). Also contains an extra list to + * hold inodes for which no additional hard link detection is desired. In both + * cases the inodes are linked by i_hlist_node. */ +struct wim_inode_table { + struct hlist_head *array; + size_t filled; + size_t capacity; + struct hlist_head extra_inodes; +}; + + +/* Compute the index of the hash bucket to use for the given inode number and + * device number. */ +static inline size_t +hash_inode(const struct wim_inode_table *table, u64 ino, u64 devno) +{ + return (hash_u64(ino) + devno) & (table->capacity - 1); +} + +int +init_inode_table(struct wim_inode_table *table, size_t capacity); + +int +inode_table_new_dentry(struct wim_inode_table *table, const tchar *name, + u64 ino, u64 devno, bool noshare, + struct wim_dentry **dentry_ret); + +void +enlarge_inode_table(struct wim_inode_table *table); + +void +inode_table_prepare_inode_list(struct wim_inode_table *table, + struct hlist_head *head); + +void +destroy_inode_table(struct wim_inode_table *table); + +#endif /* _WIMLIB_INODE_TABLE_H */ diff --git a/src/wimlib/wimlib/integrity.h b/src/wimlib/wimlib/integrity.h new file mode 100644 index 00000000..755cddda --- /dev/null +++ b/src/wimlib/wimlib/integrity.h @@ -0,0 +1,29 @@ +#ifndef _WIMLIB_INTEGRITY_H +#define _WIMLIB_INTEGRITY_H + +#include <sys/types.h> + +#include "wimlib/types.h" + +#define WIM_INTEGRITY_OK 0 +#define WIM_INTEGRITY_NOT_OK -1 +#define WIM_INTEGRITY_NONEXISTENT -2 + +struct integrity_table; + +int +read_integrity_table(WIMStruct *wim, u64 num_checked_bytes, + struct integrity_table **table_ret); + +#define free_integrity_table(table) FREE(table) + +int +write_integrity_table(WIMStruct *wim, + off_t new_blob_table_end, + off_t old_blob_table_end, + struct integrity_table *old_table); + +int +check_wim_integrity(WIMStruct *wim); + +#endif /* _WIMLIB_INTEGRITY_H */ diff --git a/src/wimlib/wimlib/lcpit_matchfinder.h b/src/wimlib/wimlib/lcpit_matchfinder.h new file mode 100644 index 00000000..1cfa444f --- /dev/null +++ b/src/wimlib/wimlib/lcpit_matchfinder.h @@ -0,0 +1,75 @@ +/* + * lcpit_matchfinder.h + * + * A match-finder for Lempel-Ziv compression based on bottom-up construction and + * traversal of the Longest Common Prefix (LCP) interval tree. + * + * Copyright 2022 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _LCPIT_MATCHFINDER_H +#define _LCPIT_MATCHFINDER_H + +#include "wimlib/types.h" + +struct lcpit_matchfinder { + bool huge_mode; + u32 cur_pos; + u32 *pos_data; + union { + u32 *intervals; + u64 *intervals64; + }; + u32 min_match_len; + u32 nice_match_len; + u32 next[2]; + u32 orig_nice_match_len; +}; + +struct lz_match { + u32 length; + u32 offset; +}; + +u64 +lcpit_matchfinder_get_needed_memory(size_t max_bufsize); + +bool +lcpit_matchfinder_init(struct lcpit_matchfinder *mf, size_t max_bufsize, + u32 min_match_len, u32 nice_match_len); + +void +lcpit_matchfinder_load_buffer(struct lcpit_matchfinder *mf, const u8 *T, u32 n); + +u32 +lcpit_matchfinder_get_matches(struct lcpit_matchfinder *mf, + struct lz_match *matches); + +void +lcpit_matchfinder_skip_bytes(struct lcpit_matchfinder *mf, u32 count); + +void +lcpit_matchfinder_destroy(struct lcpit_matchfinder *mf); + +#endif /* _LCPIT_MATCHFINDER_H */ diff --git a/src/wimlib/wimlib/list.h b/src/wimlib/wimlib/list.h new file mode 100644 index 00000000..d556a56c --- /dev/null +++ b/src/wimlib/wimlib/list.h @@ -0,0 +1,355 @@ + +/* + * This file is based on include/linux/list.h in the Linux kernel source code. + */ + +#ifndef _WIMLIB_LIST_H +#define _WIMLIB_LIST_H + +#include <stdbool.h> +#include <stddef.h> + +/* Simple doubly linked list implementation. */ + +struct list_head { + struct list_head *next; + struct list_head *prev; +}; + + +#define LIST_HEAD_INIT(name) { &(name), &(name) } + +#undef LIST_HEAD /* BSD sys/queue.h defines this... */ +#define LIST_HEAD(name) struct list_head name = LIST_HEAD_INIT(name) + +static inline void +INIT_LIST_HEAD(struct list_head *list) +{ + list->next = list; + list->prev = list; +} + +/* + * Insert a new entry between two known consecutive entries. + * + * This is only for internal list manipulation where we know + * the prev/next entries already! + */ +static inline void +__list_add(struct list_head *new, struct list_head *prev, struct list_head *next) +{ + next->prev = new; + new->next = next; + new->prev = prev; + prev->next = new; +} + +/** + * list_add - add a new entry + * @new: new entry to be added + * @head: list head to add it after + * + * Insert a new entry after the specified head. + * This is good for implementing stacks. + */ +static inline void +list_add(struct list_head *new, struct list_head *head) +{ + __list_add(new, head, head->next); +} + +/** + * list_add_tail - add a new entry + * @new: new entry to be added + * @head: list head to add it before + * + * Insert a new entry before the specified head. + * This is useful for implementing queues. + */ +static inline void +list_add_tail(struct list_head *new, struct list_head *head) +{ + __list_add(new, head->prev, head); +} + +/** + * list_replace - replace old entry by new one + * @old : the element to be replaced + * @new : the new element to insert + * + * If @old was empty, it will be overwritten. + */ +static inline void +list_replace(struct list_head *old, struct list_head *new) +{ + new->next = old->next; + new->next->prev = new; + new->prev = old->prev; + new->prev->next = new; +} + +/** + * list_del - deletes entry from list. + * @entry: the element to delete from the list. + * Note: list_empty() on entry does not return true after this, the entry is + * in an undefined state. + */ +static inline void +list_del(struct list_head *entry) +{ + struct list_head *prev = entry->prev; + struct list_head *next = entry->next; + + prev->next = next; + next->prev = prev; +} + +/** + * list_empty - tests whether a list is empty + * @head: the list to test. + */ +static inline bool +list_empty(const struct list_head *head) +{ + return head->next == head; +} + +static inline void +__list_splice(const struct list_head *list, + struct list_head *prev, struct list_head *next) +{ + struct list_head *first = list->next; + struct list_head *last = list->prev; + + first->prev = prev; + prev->next = first; + + last->next = next; + next->prev = last; +} + +/** + * list_splice - join two lists, this is designed for stacks + * @list: the new list to add. + * @head: the place to add it in the first list. + */ +static inline void +list_splice(const struct list_head *list, struct list_head *head) +{ + if (!list_empty(list)) + __list_splice(list, head, head->next); +} + +/** + * list_move - delete from one list and add as another's head + * @list: the entry to move + * @head: the head that will precede our entry + */ +static inline void +list_move(struct list_head *list, struct list_head *head) +{ + list_del(list); + list_add(list, head); +} + +/** + * list_move_tail - delete from one list and add as another's tail + * @list: the entry to move + * @head: the head that will follow our entry + */ +static inline void +list_move_tail(struct list_head *list, struct list_head *head) +{ + list_del(list); + list_add_tail(list, head); +} + +/** + * list_splice_tail - join two lists, each list being a queue + * @list: the new list to add. + * @head: the place to add it in the first list. + */ +static inline void +list_splice_tail(struct list_head *list, struct list_head *head) +{ + if (!list_empty(list)) + __list_splice(list, head->prev, head); +} + +/** + * list_entry - get the struct for this entry + * @ptr: the &struct list_head pointer. + * @type: the type of the struct this is embedded in. + * @member: the name of the list_struct within the struct. + */ +#define list_entry(ptr, type, member) \ + container_of(ptr, type, member) + +/** + * list_first_entry - get the first element from a list + * @ptr: the list head to take the element from. + * @type: the type of the struct this is embedded in. + * @member: the name of the list_struct within the struct. + * + * Note, that list is expected to be not empty. + */ +#define list_first_entry(ptr, type, member) \ + list_entry((ptr)->next, type, member) + +/** + * list_last_entry - get the last element from a list + * @ptr: the list head to take the element from. + * @type: the type of the struct this is embedded in. + * @member: the name of the list_struct within the struct. + * + * Note, that list is expected to be not empty. + */ +#define list_last_entry(ptr, type, member) \ + list_entry((ptr)->prev, type, member) + +/** + * list_next_entry - get the next element in list + * @pos: the type * to cursor + * @member: the name of the list_struct within the struct. + */ +#define list_next_entry(pos, member) \ + list_entry((pos)->member.next, typeof(*(pos)), member) + +/** + * list_prev_entry - get the prev element in list + * @pos: the type * to cursor + * @member: the name of the list_struct within the struct. + */ +#define list_prev_entry(pos, member) \ + list_entry((pos)->member.prev, typeof(*(pos)), member) + + +/** + * list_for_each - iterate over a list + * @pos: the &struct list_head to use as a loop cursor. + * @head: the head for your list. + */ +#define list_for_each(pos, head) \ + for (pos = (head)->next; pos != (head); pos = pos->next) + +/** + * list_for_each_entry - iterate over list of given type + * @pos: the type * to use as a loop cursor. + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + */ +#define list_for_each_entry(pos, head, member) \ + for (pos = list_first_entry(head, typeof(*pos), member); \ + &pos->member != (head); \ + pos = list_next_entry(pos, member)) + +/** + * list_for_each_entry_reverse - iterate backwards over list of given type. + * @pos: the type * to use as a loop cursor. + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + */ +#define list_for_each_entry_reverse(pos, head, member) \ + for (pos = list_last_entry(head, typeof(*pos), member); \ + &pos->member != (head); \ + pos = list_prev_entry(pos, member)) + +/** + * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry + * @pos: the type * to use as a loop cursor. + * @n: another type * to use as temporary storage + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + */ +#define list_for_each_entry_safe(pos, n, head, member) \ + for (pos = list_entry((head)->next, typeof(*pos), member), \ + n = list_entry(pos->member.next, typeof(*pos), member); \ + &pos->member != (head); \ + pos = n, n = list_entry(n->member.next, typeof(*n), member)) + +/* + * Double linked lists with a single pointer list head. + * Mostly useful for hash tables where the two pointer list head is + * too wasteful. + * You lose the ability to access the tail in O(1). + */ + +struct hlist_head { + struct hlist_node *first; +}; + +struct hlist_node { + struct hlist_node *next; + struct hlist_node **pprev; +}; + +static inline void +INIT_HLIST_HEAD(struct hlist_head *h) +{ + h->first = NULL; +} + +static inline bool +hlist_unhashed(const struct hlist_node *h) +{ + return !h->pprev; +} + +static inline bool +hlist_empty(const struct hlist_head *h) +{ + return !h->first; +} + +static inline void +hlist_del(struct hlist_node *n) +{ + struct hlist_node *next = n->next; + struct hlist_node **pprev = n->pprev; + *pprev = next; + if (next) + next->pprev = pprev; +} + +static inline void +hlist_add_head(struct hlist_node *n, struct hlist_head *h) +{ + struct hlist_node *first = h->first; + n->next = first; + if (first) + first->pprev = &n->next; + h->first = n; + n->pprev = &h->first; +} + +#define hlist_entry(ptr, type, member) container_of(ptr,type,member) + +#define hlist_entry_safe(ptr, type, member) \ + ({ typeof(ptr) ____ptr = (ptr); \ + ____ptr ? hlist_entry(____ptr, type, member) : NULL; \ + }) + +/** + * hlist_for_each_entry - iterate over list of given type + * @pos: the type * to use as a loop cursor. + * @head: the head for your list. + * @member: the name of the hlist_node within the struct. + */ +#define hlist_for_each_entry(pos, head, member) \ + for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\ + pos; \ + pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) + +/** + * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry + * @pos: the type * to use as a loop cursor. + * @n: another &struct hlist_node to use as temporary storage + * @head: the head for your list. + * @member: the name of the hlist_node within the struct. + */ +#define hlist_for_each_entry_safe(pos, n, head, member) \ + for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);\ + pos && ({ n = pos->member.next; 1; }); \ + pos = hlist_entry_safe(n, typeof(*pos), member)) + +#endif /* _WIMLIB_LIST_H */ diff --git a/src/wimlib/wimlib/lzms_common.h b/src/wimlib/wimlib/lzms_common.h new file mode 100644 index 00000000..b2d59d8a --- /dev/null +++ b/src/wimlib/wimlib/lzms_common.h @@ -0,0 +1,143 @@ +/* + * lzms_common.h + * + * Declarations shared between LZMS compression and decompression. + */ + +#ifndef _LZMS_COMMON_H +#define _LZMS_COMMON_H + +#include "wimlib/compiler.h" +#include "wimlib/lzms_constants.h" +#include "wimlib/types.h" + +/* Offset slot tables */ +extern const u32 lzms_offset_slot_base[LZMS_MAX_NUM_OFFSET_SYMS + 1]; +extern const u8 lzms_extra_offset_bits[LZMS_MAX_NUM_OFFSET_SYMS]; + +/* Length slot tables */ +extern const u32 lzms_length_slot_base[LZMS_NUM_LENGTH_SYMS + 1]; +extern const u8 lzms_extra_length_bits[LZMS_NUM_LENGTH_SYMS]; + +unsigned +lzms_get_slot(u32 value, const u32 slot_base_tab[], unsigned num_slots); + +/* Return the offset slot for the specified offset */ +static forceinline unsigned +lzms_get_offset_slot(u32 offset) +{ + return lzms_get_slot(offset, lzms_offset_slot_base, LZMS_MAX_NUM_OFFSET_SYMS); +} + +/* Return the length slot for the specified length */ +static forceinline unsigned +lzms_get_length_slot(u32 length) +{ + return lzms_get_slot(length, lzms_length_slot_base, LZMS_NUM_LENGTH_SYMS); +} + +unsigned +lzms_get_num_offset_slots(size_t uncompressed_size); + + +/* Probability entry for use by the range coder when in a specific state */ +struct lzms_probability_entry { + + /* The number of zeroes in the most recent LZMS_PROBABILITY_DENOMINATOR + * bits that have been decoded or encoded using this probability entry. + * The probability of the next bit being 0 is this value over + * LZMS_PROBABILITY_DENOMINATOR, except for the cases where this would + * imply 0% or 100% probability. */ + u32 num_recent_zero_bits; + + /* The most recent LZMS_PROBABILITY_DENOMINATOR bits that have been + * coded using this probability entry. The bits are ordered such that + * low order is newest and high order is oldest. */ + u64 recent_bits; +}; + +struct lzms_probabilites { + struct lzms_probability_entry main[LZMS_NUM_MAIN_PROBS]; + struct lzms_probability_entry match[LZMS_NUM_MATCH_PROBS]; + struct lzms_probability_entry lz[LZMS_NUM_LZ_PROBS]; + struct lzms_probability_entry delta[LZMS_NUM_DELTA_PROBS]; + struct lzms_probability_entry lz_rep[LZMS_NUM_LZ_REP_DECISIONS] + [LZMS_NUM_LZ_REP_PROBS]; + struct lzms_probability_entry delta_rep[LZMS_NUM_DELTA_REP_DECISIONS] + [LZMS_NUM_DELTA_REP_PROBS]; +}; + +void +lzms_init_probabilities(struct lzms_probabilites *probs); + +/* Given a decoded or encoded bit, update the probability entry. */ +static forceinline void +lzms_update_probability_entry(struct lzms_probability_entry *entry, int bit) +{ + STATIC_ASSERT(LZMS_PROBABILITY_DENOMINATOR == sizeof(entry->recent_bits) * 8); + +#ifdef __x86_64__ + if (__builtin_constant_p(bit)) { + /* Optimized implementation for x86_64 using carry flag */ + if (bit) { + __asm__("shlq %[recent_bits] \n" + "adcl $0xffffffff, %[num_recent_zero_bits] \n" + "orq $0x1, %[recent_bits] \n" + : [recent_bits] "+r" (entry->recent_bits), + [num_recent_zero_bits] "+mr" (entry->num_recent_zero_bits) + : + : "cc"); + } else { + __asm__("shlq %[recent_bits] \n" + "adcl $0x0, %[num_recent_zero_bits] \n" + : [recent_bits] "+m" (entry->recent_bits), + [num_recent_zero_bits] "+mr" (entry->num_recent_zero_bits) + : + : "cc"); + } + } else +#endif + { + s32 delta_zero_bits = (s32)(entry->recent_bits >> + (LZMS_PROBABILITY_DENOMINATOR - 1)) - bit; + + entry->num_recent_zero_bits += delta_zero_bits; + entry->recent_bits = (entry->recent_bits << 1) | bit; + } +} + +/* Given a probability entry, return the chance out of + * LZMS_PROBABILITY_DENOMINATOR that the next decoded bit will be a 0. */ +static forceinline u32 +lzms_get_probability(const struct lzms_probability_entry *prob_entry) +{ + u32 prob = prob_entry->num_recent_zero_bits; + + /* 0% and 100% probabilities aren't allowed. */ + + /* + * if (prob == 0) + * prob++; + */ + prob += (u32)(prob - 1) >> 31; + + /* + * if (prob == LZMS_PROBABILITY_DENOMINATOR) + * prob--; + */ + prob -= (prob >> LZMS_PROBABILITY_BITS); + + return prob; +} + +void +lzms_init_symbol_frequencies(u32 freqs[], unsigned num_syms); + +void +lzms_dilute_symbol_frequencies(u32 freqs[], unsigned num_syms); + +/* Pre/post-processing */ +void +lzms_x86_filter(u8 data[], s32 size, s32 last_target_usages[], bool undo); + +#endif /* _LZMS_COMMON_H */ diff --git a/src/wimlib/wimlib/lzms_constants.h b/src/wimlib/wimlib/lzms_constants.h new file mode 100644 index 00000000..500be242 --- /dev/null +++ b/src/wimlib/wimlib/lzms_constants.h @@ -0,0 +1,83 @@ +/* + * lzms_constants.h + * + * Constants for the LZMS compression format. + */ + +#ifndef _LZMS_CONSTANTS_H +#define _LZMS_CONSTANTS_H + +/* Limits on match lengths and offsets (in bytes) */ +#define LZMS_MIN_MATCH_LENGTH 1 +#define LZMS_MAX_MATCH_LENGTH 1073809578 +#define LZMS_MIN_MATCH_OFFSET 1 +#define LZMS_MAX_MATCH_OFFSET 1180427428 + +/* The value to which buffer sizes should be limited. Microsoft's + * implementation seems to use 67108864 (2^26) bytes. However, since the format + * itself supports higher match lengths and offsets, we'll use 2^30 bytes. */ +#define LZMS_MAX_BUFFER_SIZE 1073741824 + +/* The length of each LRU queue for match sources: + * + * 1. offsets of LZ matches + * 2. (power, raw offset) pairs of delta matches */ +#define LZMS_NUM_LZ_REPS 3 +#define LZMS_NUM_DELTA_REPS 3 + +/* The numbers of binary decision classes needed for encoding queue indices */ +#define LZMS_NUM_LZ_REP_DECISIONS (LZMS_NUM_LZ_REPS - 1) +#define LZMS_NUM_DELTA_REP_DECISIONS (LZMS_NUM_DELTA_REPS - 1) + +/* These are the numbers of probability entries for each binary decision class. + * The logarithm base 2 of each of these values is the number of recently + * encoded bits that are remembered for each decision class and are used to + * select the appropriate probability entry when decoding/encoding the next + * binary decision (bit). */ +#define LZMS_NUM_MAIN_PROBS 16 +#define LZMS_NUM_MATCH_PROBS 32 +#define LZMS_NUM_LZ_PROBS 64 +#define LZMS_NUM_LZ_REP_PROBS 64 +#define LZMS_NUM_DELTA_PROBS 64 +#define LZMS_NUM_DELTA_REP_PROBS 64 + +/* These values define the precision for probabilities in LZMS, which are always + * given as a numerator; the denominator is implied. */ +#define LZMS_PROBABILITY_BITS 6 +#define LZMS_PROBABILITY_DENOMINATOR (1 << LZMS_PROBABILITY_BITS) + +/* These values define the initial state of each probability entry. */ +#define LZMS_INITIAL_PROBABILITY 48 +#define LZMS_INITIAL_RECENT_BITS 0x0000000055555555 + +/* The number of symbols in each Huffman-coded alphabet */ +#define LZMS_NUM_LITERAL_SYMS 256 +#define LZMS_NUM_LENGTH_SYMS 54 +#define LZMS_NUM_DELTA_POWER_SYMS 8 +#define LZMS_MAX_NUM_OFFSET_SYMS 799 +#define LZMS_MAX_NUM_SYMS 799 + +/* The rebuild frequencies, in symbols, for each Huffman code */ +#define LZMS_LITERAL_CODE_REBUILD_FREQ 1024 +#define LZMS_LZ_OFFSET_CODE_REBUILD_FREQ 1024 +#define LZMS_LENGTH_CODE_REBUILD_FREQ 512 +#define LZMS_DELTA_OFFSET_CODE_REBUILD_FREQ 1024 +#define LZMS_DELTA_POWER_CODE_REBUILD_FREQ 512 + +/* The maximum length, in bits, of any Huffman codeword. This is guaranteed by + * the way frequencies are updated. */ +#define LZMS_MAX_CODEWORD_LENGTH 15 + +/* The maximum number of verbatim bits, in addition to the Huffman-encoded + * length slot symbol, that may be required to encode a match length */ +#define LZMS_MAX_EXTRA_LENGTH_BITS 30 + +/* The maximum number of verbatim bits, in addition to the Huffman-encoded + * offset slot symbol, that may be required to encode a match offset */ +#define LZMS_MAX_EXTRA_OFFSET_BITS 30 + +/* Parameters for x86 machine code pre/post-processing */ +#define LZMS_X86_ID_WINDOW_SIZE 65535 +#define LZMS_X86_MAX_TRANSLATION_OFFSET 1023 + +#endif /* _LZMS_CONSTANTS_H */ diff --git a/src/wimlib/wimlib/lzx_common.h b/src/wimlib/wimlib/lzx_common.h new file mode 100644 index 00000000..80d53813 --- /dev/null +++ b/src/wimlib/wimlib/lzx_common.h @@ -0,0 +1,29 @@ +/* + * lzx_common.h + * + * Declarations shared between LZX compression and decompression. + */ + +#ifndef _LZX_COMMON_H +#define _LZX_COMMON_H + +#include "wimlib/lzx_constants.h" +#include "wimlib/types.h" + +extern const s32 lzx_offset_slot_base[LZX_MAX_OFFSET_SLOTS + 1]; + +extern const u8 lzx_extra_offset_bits[LZX_MAX_OFFSET_SLOTS]; + +unsigned +lzx_get_window_order(size_t max_bufsize); + +unsigned +lzx_get_num_main_syms(unsigned window_order); + +void +lzx_preprocess(u8 *data, u32 size); + +void +lzx_postprocess(u8 *data, u32 size); + +#endif /* _LZX_COMMON_H */ diff --git a/src/wimlib/wimlib/lzx_constants.h b/src/wimlib/wimlib/lzx_constants.h new file mode 100644 index 00000000..1f802d81 --- /dev/null +++ b/src/wimlib/wimlib/lzx_constants.h @@ -0,0 +1,106 @@ +/* + * lzx_constants.h + * + * Constants for the LZX compression format. + */ + +#ifndef _LZX_CONSTANTS_H +#define _LZX_CONSTANTS_H + +/* Number of literal byte values. */ +#define LZX_NUM_CHARS 256 + +/* The smallest and largest allowed match lengths. */ +#define LZX_MIN_MATCH_LEN 2 +#define LZX_MAX_MATCH_LEN 257 + +/* Number of distinct match lengths that can be represented. */ +#define LZX_NUM_LENS (LZX_MAX_MATCH_LEN - LZX_MIN_MATCH_LEN + 1) + +/* Number of match lengths for which no length symbol is required. */ +#define LZX_NUM_PRIMARY_LENS 7 +#define LZX_NUM_LEN_HEADERS (LZX_NUM_PRIMARY_LENS + 1) + +/* The first length which requires a length symbol. */ +#define LZX_MIN_SECONDARY_LEN (LZX_MIN_MATCH_LEN + LZX_NUM_PRIMARY_LENS) + +/* Valid values of the 3-bit block type field. */ +#define LZX_BLOCKTYPE_VERBATIM 1 +#define LZX_BLOCKTYPE_ALIGNED 2 +#define LZX_BLOCKTYPE_UNCOMPRESSED 3 + +/* 'LZX_MIN_WINDOW_SIZE' and 'LZX_MAX_WINDOW_SIZE' are the minimum and maximum + * sizes of the sliding window. */ +#define LZX_MIN_WINDOW_ORDER 15 +#define LZX_MAX_WINDOW_ORDER 21 +#define LZX_MIN_WINDOW_SIZE (1UL << LZX_MIN_WINDOW_ORDER) /* 32768 */ +#define LZX_MAX_WINDOW_SIZE (1UL << LZX_MAX_WINDOW_ORDER) /* 2097152 */ + +/* Maximum number of offset slots. (The actual number of offset slots depends + * on the window size.) */ +#define LZX_MAX_OFFSET_SLOTS 50 + +/* Maximum number of symbols in the main code. (The actual number of symbols in + * the main code depends on the window size.) */ +#define LZX_MAINCODE_MAX_NUM_SYMBOLS \ + (LZX_NUM_CHARS + (LZX_MAX_OFFSET_SLOTS * LZX_NUM_LEN_HEADERS)) + +/* Number of symbols in the length code. */ +#define LZX_LENCODE_NUM_SYMBOLS (LZX_NUM_LENS - LZX_NUM_PRIMARY_LENS) + +/* Number of symbols in the pre-code. */ +#define LZX_PRECODE_NUM_SYMBOLS 20 + +/* Number of bits in which each pre-code codeword length is represented. */ +#define LZX_PRECODE_ELEMENT_SIZE 4 + +/* Number of low-order bits of each match offset that are entropy-encoded in + * aligned offset blocks. */ +#define LZX_NUM_ALIGNED_OFFSET_BITS 3 + +/* Number of symbols in the aligned offset code. */ +#define LZX_ALIGNEDCODE_NUM_SYMBOLS (1 << LZX_NUM_ALIGNED_OFFSET_BITS) + +/* Mask for the match offset bits that are entropy-encoded in aligned offset + * blocks. */ +#define LZX_ALIGNED_OFFSET_BITMASK ((1 << LZX_NUM_ALIGNED_OFFSET_BITS) - 1) + +/* Number of bits in which each aligned offset codeword length is represented. */ +#define LZX_ALIGNEDCODE_ELEMENT_SIZE 3 + +/* The first offset slot which requires an aligned offset symbol in aligned + * offset blocks. */ +#define LZX_MIN_ALIGNED_OFFSET_SLOT 8 + +/* The offset slot base for LZX_MIN_ALIGNED_OFFSET_SLOT. */ +#define LZX_MIN_ALIGNED_OFFSET 14 + +/* The maximum number of extra offset bits in verbatim blocks. (One would need + * to subtract LZX_NUM_ALIGNED_OFFSET_BITS to get the number of extra offset + * bits in *aligned* blocks.) */ +#define LZX_MAX_NUM_EXTRA_BITS 17 + +/* Maximum lengths (in bits) for length-limited Huffman code construction. */ +#define LZX_MAX_MAIN_CODEWORD_LEN 16 +#define LZX_MAX_LEN_CODEWORD_LEN 16 +#define LZX_MAX_PRE_CODEWORD_LEN ((1 << LZX_PRECODE_ELEMENT_SIZE) - 1) +#define LZX_MAX_ALIGNED_CODEWORD_LEN ((1 << LZX_ALIGNEDCODE_ELEMENT_SIZE) - 1) + +/* For LZX-compressed blocks in WIM resources, this value is always used as the + * filesize parameter for the call instruction (0xe8 byte) preprocessing, even + * though the blocks themselves are not this size, and the size of the actual + * file resource in the WIM file is very likely to be something entirely + * different as well. */ +#define LZX_WIM_MAGIC_FILESIZE 12000000 + +/* Assumed LZX block size when the encoded block size begins with a 0 bit. + * This is probably WIM-specific. */ +#define LZX_DEFAULT_BLOCK_SIZE 32768 + +/* Number of offsets in the recent (or "repeat") offsets queue. */ +#define LZX_NUM_RECENT_OFFSETS 3 + +/* An offset of n bytes is actually encoded as (n + LZX_OFFSET_ADJUSTMENT). */ +#define LZX_OFFSET_ADJUSTMENT (LZX_NUM_RECENT_OFFSETS - 1) + +#endif /* _LZX_CONSTANTS_H */ diff --git a/src/wimlib/wimlib/matchfinder_common.h b/src/wimlib/wimlib/matchfinder_common.h new file mode 100644 index 00000000..bbb61f64 --- /dev/null +++ b/src/wimlib/wimlib/matchfinder_common.h @@ -0,0 +1,130 @@ +/* + * matchfinder_common.h - common code for Lempel-Ziv matchfinding + * + * Copyright 2022 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _WIMLIB_MATCHFINDER_COMMON_H +#define _WIMLIB_MATCHFINDER_COMMON_H + +#include "wimlib/bitops.h" +#include "wimlib/unaligned.h" + +/* + * Given a 32-bit value that was loaded with the platform's native endianness, + * return a 32-bit value whose high-order 8 bits are 0 and whose low-order 24 + * bits contain the first 3 bytes, arranged in octets in a platform-dependent + * order, at the memory location from which the input 32-bit value was loaded. + */ +static forceinline u32 +loaded_u32_to_u24(u32 v) +{ + if (CPU_IS_LITTLE_ENDIAN()) + return v & 0xFFFFFF; + else + return v >> 8; +} + +/* + * Load the next 3 bytes from @p into the 24 low-order bits of a 32-bit value. + * The order in which the 3 bytes will be arranged as octets in the 24 bits is + * platform-dependent. At least 4 bytes (not 3) must be available at @p. + */ +static forceinline u32 +load_u24_unaligned(const u8 *p) +{ +#if UNALIGNED_ACCESS_IS_FAST + return loaded_u32_to_u24(load_u32_unaligned(p)); +#else + if (CPU_IS_LITTLE_ENDIAN()) + return ((u32)p[0] << 0) | ((u32)p[1] << 8) | ((u32)p[2] << 16); + else + return ((u32)p[2] << 0) | ((u32)p[1] << 8) | ((u32)p[0] << 16); +#endif +} + +/* + * The hash function: given a sequence prefix held in the low-order bits of a + * 32-bit value, multiply by a carefully-chosen large constant. Discard any + * bits of the product that don't fit in a 32-bit value, but take the + * next-highest @num_bits bits of the product as the hash value, as those have + * the most randomness. + */ +static forceinline u32 +lz_hash(u32 seq, unsigned num_bits) +{ + return (u32)(seq * 0x1E35A7BD) >> (32 - num_bits); +} + +/* + * Return the number of bytes at @matchptr that match the bytes at @strptr, up + * to a maximum of @max_len. Initially, @start_len bytes are matched. + */ +static forceinline unsigned +lz_extend(const u8 * const strptr, const u8 * const matchptr, + const unsigned start_len, const unsigned max_len) +{ + unsigned len = start_len; + machine_word_t v_word; + + if (UNALIGNED_ACCESS_IS_FAST) { + + if (likely(max_len - len >= 4 * WORDBYTES)) { + + #define COMPARE_WORD_STEP \ + v_word = load_word_unaligned(&matchptr[len]) ^ \ + load_word_unaligned(&strptr[len]); \ + if (v_word != 0) \ + goto word_differs; \ + len += WORDBYTES; \ + + COMPARE_WORD_STEP + COMPARE_WORD_STEP + COMPARE_WORD_STEP + COMPARE_WORD_STEP + #undef COMPARE_WORD_STEP + } + + while (len + WORDBYTES <= max_len) { + v_word = load_word_unaligned(&matchptr[len]) ^ + load_word_unaligned(&strptr[len]); + if (v_word != 0) + goto word_differs; + len += WORDBYTES; + } + } + + while (len < max_len && matchptr[len] == strptr[len]) + len++; + return len; + +word_differs: + if (CPU_IS_LITTLE_ENDIAN()) + len += (bsfw(v_word) >> 3); + else + len += (WORDBITS - 1 - bsrw(v_word)) >> 3; + return len; +} + +#endif /* _WIMLIB_MATCHFINDER_COMMON_H */ diff --git a/src/wimlib/wimlib/metadata.h b/src/wimlib/wimlib/metadata.h new file mode 100644 index 00000000..a3d28048 --- /dev/null +++ b/src/wimlib/wimlib/metadata.h @@ -0,0 +1,165 @@ +#ifndef _WIMLIB_METADATA_H +#define _WIMLIB_METADATA_H + +#include "wimlib/blob_table.h" +#include "wimlib/list.h" +#include "wimlib/types.h" +#include "wimlib/wim.h" + +/* + * This structure holds the directory tree that comprises a WIM image, along + * with other information maintained at the image level. It is populated either + * by reading and parsing a metadata resource or by scanning new files. + * + * An image that hasn't been modified from its on-disk copy is considered + * "clean" and is loaded from its metadata resource on demand by + * select_wim_image(). Such an image may be unloaded later to save memory when + * a different image is selected. An image that has been modified or has been + * created from scratch, on the other hand, is considered "dirty" and is never + * automatically unloaded. + * + * To implement exports, it's allowed that multiple WIMStructs reference the + * same wim_image_metadata. + */ +struct wim_image_metadata { + + /* Number of WIMStructs that reference this image. This will always be + * >= 1. It may be > 1 if this image has been exported. */ + u32 refcnt; + + /* Number of WIMStructs that have this image selected as their + * current_image. This will always be <= 'refcnt' and may be 0. */ + u32 selected_refcnt; + + /* Pointer to the root dentry of this image, or NULL if this image is + * completely empty or is not currently loaded. */ + struct wim_dentry *root_dentry; + + /* Pointer to the security data of this image, or NULL if this image is + * not currently loaded. */ + struct wim_security_data *security_data; + + /* Pointer to the blob descriptor for this image's metadata resource. + * If this image metadata is sourced from a WIM file (as opposed to + * being created from scratch) and hasn't been modified from the version + * in that WIM file, then this blob descriptor's data corresponds to the + * WIM backing source. Otherwise, this blob descriptor is a dummy entry + * with blob_location==BLOB_NONEXISTENT. */ + struct blob_descriptor *metadata_blob; + + /* Linked list of 'struct wim_inode's for this image, or an empty list + * if this image is completely empty or is not currently loaded. */ + struct hlist_head inode_list; + + /* Linked list of 'struct blob_descriptor's for blobs that are + * referenced by this image's dentry tree, but have not had their SHA-1 + * message digests calculated yet and therefore have not been inserted + * into the WIMStruct's blob table. This list is appended to when files + * are scanned for inclusion in this WIM image. */ + struct list_head unhashed_blobs; + + /* Are the filecount/bytecount stats (in the XML info) out of date for + * this image? */ + bool stats_outdated; +}; + +/* Retrieve the metadata of the image in @wim currently selected with + * select_wim_image(). */ +static inline struct wim_image_metadata * +wim_get_current_image_metadata(WIMStruct *wim) +{ + return wim->image_metadata[wim->current_image - 1]; +} + +/* Retrieve the root dentry of the image in @wim currently selected with + * select_wim_image(). */ +static inline struct wim_dentry * +wim_get_current_root_dentry(WIMStruct *wim) +{ + return wim_get_current_image_metadata(wim)->root_dentry; +} + +/* Retrieve the security data of the image in @wim currently selected with + * select_wim_image(). */ +static inline struct wim_security_data * +wim_get_current_security_data(WIMStruct *wim) +{ + return wim_get_current_image_metadata(wim)->security_data; +} + +/* Return true iff the specified image has been changed since being read from + * its backing file or has been created from scratch. */ +static inline bool +is_image_dirty(const struct wim_image_metadata *imd) +{ + /* The only possible values here are BLOB_NONEXISTENT and BLOB_IN_WIM */ + return imd->metadata_blob->blob_location == BLOB_NONEXISTENT; +} + +/* Return true iff the specified image is unchanged since being read from the + * specified backing WIM file. */ +static inline bool +is_image_unchanged_from_wim(const struct wim_image_metadata *imd, + const WIMStruct *wim) +{ + return !is_image_dirty(imd) && imd->metadata_blob->rdesc->wim == wim; +} + +/* Mark the metadata for the specified WIM image "dirty" following changes to + * the image's directory tree. This records that the metadata no longer matches + * the version in the WIM file (if any) and that its stats are out of date. */ +static inline void +mark_image_dirty(struct wim_image_metadata *imd) +{ + blob_release_location(imd->metadata_blob); + imd->stats_outdated = true; +} + +/* Return true iff the specified image is currently loaded into memory. */ +static inline bool +is_image_loaded(const struct wim_image_metadata *imd) +{ + /* Check security_data rather than root_dentry, since root_dentry will + * be NULL for a completely empty image whereas security_data will still + * be non-NULL in that case. */ + return imd->security_data != NULL; +} + +/* Return true iff it is okay to unload the specified image. The image can be + * unloaded if no WIMStructs have it selected and it is not dirty. */ +static inline bool +can_unload_image(const struct wim_image_metadata *imd) +{ + return imd->selected_refcnt == 0 && !is_image_dirty(imd); +} + +/* Iterate over each inode in a WIM image */ +#define image_for_each_inode(inode, imd) \ + hlist_for_each_entry(inode, &(imd)->inode_list, i_hlist_node) + +/* Iterate over each inode in a WIM image (safe against inode removal) */ +#define image_for_each_inode_safe(inode, tmp, imd) \ + hlist_for_each_entry_safe(inode, tmp, &(imd)->inode_list, i_hlist_node) + +/* Iterate over each blob in a WIM image that has not yet been hashed */ +#define image_for_each_unhashed_blob(blob, imd) \ + list_for_each_entry(blob, &(imd)->unhashed_blobs, unhashed_list) + +/* Iterate over each blob in a WIM image that has not yet been hashed (safe + * against blob removal) */ +#define image_for_each_unhashed_blob_safe(blob, tmp, imd) \ + list_for_each_entry_safe(blob, tmp, &(imd)->unhashed_blobs, unhashed_list) + +void +put_image_metadata(struct wim_image_metadata *imd); + +int +append_image_metadata(WIMStruct *wim, struct wim_image_metadata *imd); + +struct wim_image_metadata * +new_empty_image_metadata(void); + +struct wim_image_metadata * +new_unloaded_image_metadata(struct blob_descriptor *metadata_blob); + +#endif /* _WIMLIB_METADATA_H */ diff --git a/src/wimlib/wimlib/ntfs_3g.h b/src/wimlib/wimlib/ntfs_3g.h new file mode 100644 index 00000000..03fc04b6 --- /dev/null +++ b/src/wimlib/wimlib/ntfs_3g.h @@ -0,0 +1,29 @@ +#ifndef _WIMLIB_NTFS_3G_H +#define _WIMLIB_NTFS_3G_H + +#ifdef WITH_NTFS_3G + +#include "wimlib/types.h" + +struct blob_descriptor; +struct consume_chunk_callback; +struct ntfs_location; + +int +read_ntfs_attribute_prefix(const struct blob_descriptor *blob, u64 size, + const struct consume_chunk_callback *cb, + bool recover_data); + +struct ntfs_location * +clone_ntfs_location(const struct ntfs_location *loc); + +void +free_ntfs_location(struct ntfs_location *loc); + +int +cmp_ntfs_locations(const struct ntfs_location *loc1, + const struct ntfs_location *loc2); + +#endif /* WITH_NTFS_3G */ + +#endif /* _WIMLIB_NTFS_3G_H */ diff --git a/src/wimlib/wimlib/object_id.h b/src/wimlib/wimlib/object_id.h new file mode 100644 index 00000000..baf416cb --- /dev/null +++ b/src/wimlib/wimlib/object_id.h @@ -0,0 +1,29 @@ +#ifndef _WIMLIB_OBJECT_ID_H +#define _WIMLIB_OBJECT_ID_H + +#include "wimlib/tagged_items.h" + +/* Unconfirmed: are all 64 bytes of the object ID always present? Since NTFS-3G + * permits shorter object IDs, we'll do the same for now. */ +#define OBJECT_ID_MIN_LENGTH 16 + +static inline const void * +inode_get_object_id(const struct wim_inode *inode, u32 *len_ret) +{ + return inode_get_tagged_item(inode, TAG_OBJECT_ID, OBJECT_ID_MIN_LENGTH, + len_ret); +} + +static inline bool +inode_has_object_id(const struct wim_inode *inode) +{ + return inode_get_object_id(inode, NULL) != NULL; +} + +static inline bool +inode_set_object_id(struct wim_inode *inode, const void *object_id, u32 len) +{ + return inode_set_tagged_item(inode, TAG_OBJECT_ID, object_id, len); +} + +#endif /* _WIMLIB_OBJECT_ID_H */ diff --git a/src/wimlib/wimlib/pathlist.h b/src/wimlib/wimlib/pathlist.h new file mode 100644 index 00000000..b49dbd28 --- /dev/null +++ b/src/wimlib/wimlib/pathlist.h @@ -0,0 +1,11 @@ +#ifndef _WIMLIB_PATHLIST_H +#define _WIMLIB_PATHLIST_H + +#include "wimlib/types.h" + +int +read_path_list_file(const tchar *listfile, + tchar ***paths_ret, size_t *num_paths_ret, + void **mem_ret); + +#endif /* _WIMLIB_PATHLIST_H */ diff --git a/src/wimlib/wimlib/paths.h b/src/wimlib/wimlib/paths.h new file mode 100644 index 00000000..4faf9703 --- /dev/null +++ b/src/wimlib/wimlib/paths.h @@ -0,0 +1,45 @@ +#ifndef _WIMLIB_PATHS_H +#define _WIMLIB_PATHS_H + +#include "wimlib/compiler.h" +#include "wimlib/types.h" + +const tchar * +path_basename(const tchar *path); + +const tchar * +path_basename_with_len(const tchar *path, size_t len); + +const tchar * +path_stream_name(const tchar *path); + +void +do_canonicalize_path(const tchar *in, tchar *out); + +tchar * +canonicalize_wim_path(const tchar *wim_path); + +/* is_any_path_separator() - characters treated as path separators in WIM path + * specifications and capture configuration files (the former will be translated + * to WIM_PATH_SEPARATOR; the latter will be translated to + * OS_PREFERRED_PATH_SEPARATOR) + * + * OS_PREFERRED_PATH_SEPARATOR - preferred (or only) path separator on the + * operating system. Used when constructing filesystem paths to extract or + * archive. + * + * WIM_PATH_SEPARATOR - character treated as path separator for WIM paths. + * Currently needs to be '/' on UNIX for the WIM mounting code to work properly. + */ + +#ifdef _WIN32 +# define OS_PREFERRED_PATH_SEPARATOR L'\\' +# define is_any_path_separator(c) ((c) == L'/' || (c) == L'\\') +#else +# define OS_PREFERRED_PATH_SEPARATOR '/' +# define is_any_path_separator(c) ((c) == '/' || (c) == '\\') +#endif + +#define WIM_PATH_SEPARATOR WIMLIB_WIM_PATH_SEPARATOR + +#endif /* _WIMLIB_PATHS_H */ diff --git a/src/wimlib/wimlib/pattern.h b/src/wimlib/wimlib/pattern.h new file mode 100644 index 00000000..3f3add77 --- /dev/null +++ b/src/wimlib/wimlib/pattern.h @@ -0,0 +1,30 @@ +#ifndef _WIMLIB_PATTERN_H +#define _WIMLIB_PATTERN_H + +#include "wimlib/types.h" + +struct wim_dentry; + +/* Flags for match_path() and match_pattern_list() */ + +/* + * If set, subdirectories (and sub-files) are also matched. + * For example, the pattern "/dir" would match the path "/dir/file". + */ +#define MATCH_RECURSIVELY 0x01 + +/* + * If set, ancestor directories are also matched. + * For example, the pattern "/dir/file" would match the path "/dir". + */ +#define MATCH_ANCESTORS 0x02 + +bool +match_path(const tchar *path, const tchar *pattern, int match_flags); + +int +expand_path_pattern(struct wim_dentry *root, const tchar *pattern, + int (*consume_dentry)(struct wim_dentry *, void *), + void *ctx); + +#endif /* _WIMLIB_PATTERN_H */ diff --git a/src/wimlib/wimlib/progress.h b/src/wimlib/wimlib/progress.h new file mode 100644 index 00000000..e3627eec --- /dev/null +++ b/src/wimlib/wimlib/progress.h @@ -0,0 +1,106 @@ +#ifndef _WIMLIB_PROGRESS_H +#define _WIMLIB_PROGRESS_H + +#include "wimlib.h" +#include "wimlib/paths.h" +#include "wimlib/types.h" + +/* If specified, call the user-provided progress function and check its result. + */ +static inline int +call_progress(wimlib_progress_func_t progfunc, + enum wimlib_progress_msg msg, + union wimlib_progress_info *info, + void *progctx) +{ + if (progfunc) { + enum wimlib_progress_status status; + + status = (*progfunc)(msg, info, progctx); + + switch (status) { + case WIMLIB_PROGRESS_STATUS_CONTINUE: + return 0; + case WIMLIB_PROGRESS_STATUS_ABORT: + return WIMLIB_ERR_ABORTED_BY_PROGRESS; + default: + return WIMLIB_ERR_UNKNOWN_PROGRESS_STATUS; + } + } + return 0; +} + +int +report_error(wimlib_progress_func_t progfunc, + void *progctx, int error_code, const tchar *path); + +/* Rate-limiting of byte-count based progress messages: update *next_progress_p + * to the value that completed_bytes needs to reach before the next progress + * message will be sent. */ +static inline void +set_next_progress(u64 completed_bytes, u64 total_bytes, u64 *next_progress_p) +{ + if (*next_progress_p < total_bytes) { + /* + * Send the next message as soon as: + * - another 1/100 of the total has been processed; + * - OR another 1 GiB has been processed; + * - OR all bytes have been processed. + */ + *next_progress_p = min(min(completed_bytes + total_bytes / 100, + completed_bytes + (1UL << 30)), + total_bytes); + } else { + /* Last message has been sent. */ + *next_progress_p = ~0; + } +} + +/* Windows: temporarily remove the stream name from the path */ +static inline tchar * +progress_get_streamless_path(const tchar *path) +{ + tchar *cookie = NULL; +#ifdef _WIN32 + cookie = (wchar_t *)path_stream_name(path); + if (cookie) + *--cookie = L'\0'; /* Overwrite the colon */ +#endif + return cookie; +} + +/* Windows: temporarily replace \??\ with \\?\ (to make an NT namespace path + * into a Win32 namespace path) */ +static inline tchar * +progress_get_win32_path(const tchar *path) +{ +#ifdef _WIN32 + if (!wcsncmp(path, L"\\??\\", 4)) { + ((wchar_t *)path)[1] = L'\\'; + return (wchar_t *)&path[1]; + } +#endif + return NULL; +} + +/* Windows: restore the NT namespace path */ +static inline void +progress_put_win32_path(tchar *cookie) +{ +#ifdef _WIN32 + if (cookie) + *cookie = L'?'; +#endif +} + +/* Windows: restore the stream name part of the path */ +static inline void +progress_put_streamless_path(tchar *cookie) +{ +#ifdef _WIN32 + if (cookie) + *cookie = L':'; +#endif +} + +#endif /* _WIMLIB_PROGRESS_H */ diff --git a/src/wimlib/wimlib/registry.h b/src/wimlib/wimlib/registry.h new file mode 100644 index 00000000..27fcd1ab --- /dev/null +++ b/src/wimlib/wimlib/registry.h @@ -0,0 +1,40 @@ +#ifndef _WIMLIB_REGISTRY_H +#define _WIMLIB_REGISTRY_H + +#include "wimlib/types.h" + +struct regf; + +enum hive_status { + HIVE_OK, + HIVE_CORRUPT, + HIVE_UNSUPPORTED, + HIVE_KEY_NOT_FOUND, + HIVE_VALUE_NOT_FOUND, + HIVE_VALUE_IS_WRONG_TYPE, + HIVE_OUT_OF_MEMORY, + HIVE_ITERATION_STOPPED, +}; + +enum hive_status +hive_validate(const void *hive_mem, size_t hive_size); + +enum hive_status +hive_get_string(const struct regf *regf, const tchar *key_name, + const tchar *value_name, tchar **value_ret); + +enum hive_status +hive_get_number(const struct regf *regf, const tchar *key_name, + const tchar *value_name, s64 *value_ret); + +enum hive_status +hive_list_subkeys(const struct regf *regf, const tchar *key_name, + tchar ***subkeys_ret); + +void +hive_free_subkeys_list(tchar **subkeys); + +const char * +hive_status_to_string(enum hive_status status); + +#endif /* _WIMLIB_REGISTRY_H */ diff --git a/src/wimlib/wimlib/reparse.h b/src/wimlib/wimlib/reparse.h new file mode 100644 index 00000000..972780df --- /dev/null +++ b/src/wimlib/wimlib/reparse.h @@ -0,0 +1,112 @@ +#ifndef _WIMLIB_REPARSE_H +#define _WIMLIB_REPARSE_H + +#include "wimlib/inode.h" /* for reparse tag definitions */ +#include "wimlib/types.h" + +struct blob_descriptor; +struct blob_table; + +/* Windows enforces this limit on the size of a reparse point buffer. */ +#define REPARSE_POINT_MAX_SIZE 16384 + +/* + * On-disk format of a reparse point buffer. See: + * https://msdn.microsoft.com/en-us/library/dd541671.aspx + * + * Note: we are not using __attribute__((packed)) for this structure, so only + * cast to this if properly aligned! + */ +struct reparse_buffer_disk { + le32 rptag; + le16 rpdatalen; + le16 rpreserved; + union { + u8 rpdata[REPARSE_POINT_MAX_SIZE - 8]; + + struct { + le16 substitute_name_offset; + le16 substitute_name_nbytes; + le16 print_name_offset; + le16 print_name_nbytes; + + union { + struct { + u8 data[REPARSE_POINT_MAX_SIZE - 16]; + } junction; + + struct { + le32 flags; + #define SYMBOLIC_LINK_RELATIVE 0x00000001 + u8 data[REPARSE_POINT_MAX_SIZE - 20]; + } symlink; + }; + } link; + }; +}; + +#define REPARSE_DATA_OFFSET ((unsigned)offsetof(struct reparse_buffer_disk, rpdata)) + +#define REPARSE_DATA_MAX_SIZE (REPARSE_POINT_MAX_SIZE - REPARSE_DATA_OFFSET) + +static void __attribute__((unused)) +check_reparse_buffer_disk(void) +{ + STATIC_ASSERT(offsetof(struct reparse_buffer_disk, rpdata) == 8); + STATIC_ASSERT(offsetof(struct reparse_buffer_disk, link.junction.data) == 16); + STATIC_ASSERT(offsetof(struct reparse_buffer_disk, link.symlink.data) == 20); + STATIC_ASSERT(sizeof(struct reparse_buffer_disk) == REPARSE_POINT_MAX_SIZE); +} + +/* Wrapper around a symbolic link or junction reparse point + * (WIM_IO_REPARSE_TAG_SYMLINK or WIM_IO_REPARSE_TAG_MOUNT_POINT) */ +struct link_reparse_point { + + u32 rptag; + u16 rpreserved; + + /* Flags, valid for symbolic links only */ + u32 symlink_flags; + + /* Pointers to the substitute name and print name of the link, + * potentially not null terminated */ + utf16lechar *substitute_name; + utf16lechar *print_name; + + /* Lengths of the substitute and print names in bytes, not including + * their null terminators if present */ + size_t substitute_name_nbytes; + size_t print_name_nbytes; +}; + +static inline bool +link_is_relative_symlink(const struct link_reparse_point *link) +{ + return link->rptag == WIM_IO_REPARSE_TAG_SYMLINK && + (link->symlink_flags & SYMBOLIC_LINK_RELATIVE); +} + +void +complete_reparse_point(struct reparse_buffer_disk *rpbuf, + const struct wim_inode *inode, u16 blob_size); + +int +parse_link_reparse_point(const struct reparse_buffer_disk *rpbuf, u16 rpbuflen, + struct link_reparse_point *link); + +int +make_link_reparse_point(const struct link_reparse_point *link, + struct reparse_buffer_disk *rpbuf, u16 *rpbuflen_ret); + +#ifndef _WIN32 +int +wim_inode_readlink(const struct wim_inode *inode, char *buf, size_t bufsize, + const struct blob_descriptor *blob, + const char *altroot, size_t altroot_len); + +int +wim_inode_set_symlink(struct wim_inode *inode, const char *target, + struct blob_table *blob_table); +#endif + +#endif /* _WIMLIB_REPARSE_H */ diff --git a/src/wimlib/wimlib/resource.h b/src/wimlib/wimlib/resource.h new file mode 100644 index 00000000..8924b807 --- /dev/null +++ b/src/wimlib/wimlib/resource.h @@ -0,0 +1,332 @@ +#ifndef _WIMLIB_RESOURCE_H +#define _WIMLIB_RESOURCE_H + +#include "wimlib/list.h" +#include "wimlib/sha1.h" +#include "wimlib/types.h" + +struct blob_descriptor; +struct filedes; +struct wim_image_metadata; + +/* + * Description of a "resource" in a WIM file. A "resource" is a standalone, + * possibly compressed region of data. Normally, there is a one-to-one + * correspondence between "blobs" (each of which may be the contents of a file, + * for example) and resources. However, a resource with the + * WIM_RESHDR_FLAG_SOLID flag set is a "solid" resource that contains multiple + * blobs compressed together. + */ +struct wim_resource_descriptor { + /* The WIM containing this resource. @wim->in_fd is expected to be a + * file descriptor to the underlying WIM file, opened for reading. */ + WIMStruct *wim; + + /* The offset, in bytes, from the start of WIM file at which this + * resource starts. */ + u64 offset_in_wim; + + /* The size of this resource in the WIM file. For compressed resources + * this is the compressed size, including overhead such as the chunk + * table. */ + u64 size_in_wim; + + /* The number of bytes of uncompressed data this resource decompresses + * to. */ + u64 uncompressed_size; + + /* The list of blobs this resource contains. */ + struct list_head blob_list; + + /* Flags for this resource (WIM_RESHDR_FLAG_*). */ + u32 flags : 8; + + /* [wimlib extension] This flag will be set if the WIM is pipable. In + * such cases, the resource will be in a slightly different format if it + * is compressed. */ + u32 is_pipable : 1; + + /* Temporary flag. */ + u32 raw_copy_ok : 1; + + /* Compression type of this resource. */ + u32 compression_type : 22; + + /* Compression chunk size of this resource. Irrelevant if the resource + * is uncompressed. */ + u32 chunk_size; +}; + +/* On-disk version of a WIM resource header. */ +struct wim_reshdr_disk { + /* Size of the resource as it appears in the WIM file (possibly + * compressed). */ + u8 size_in_wim[7]; + + /* Zero or more of the WIM_RESHDR_FLAG_* flags. These indicate, for + * example, whether the resource is compressed or not. */ + u8 flags; + + /* Offset of the resource from the start of the WIM file, in bytes. */ + le64 offset_in_wim; + + /* Uncompressed size of the resource, in bytes. */ + le64 uncompressed_size; +} __attribute__((packed)); + +/* In-memory version of a WIM resource header (`struct wim_reshdr_disk'). */ +struct wim_reshdr { + u64 size_in_wim : 56; + u64 flags : 8; + u64 offset_in_wim; + u64 uncompressed_size; +}; + +/* Flags for the `flags' field of WIM resource headers (`struct wim_reshdr'). + */ + +/* Unknown meaning; currently ignored by wimlib. */ +#define WIM_RESHDR_FLAG_FREE 0x01 + +/* The resource is a metadata resource for a WIM image, or is the blob table or + * XML data for the WIM. */ +#define WIM_RESHDR_FLAG_METADATA 0x02 + +/* The resource is a non-solid resource compressed using the WIM's default + * compression type. */ +#define WIM_RESHDR_FLAG_COMPRESSED 0x04 + +/* Unknown meaning; currently ignored by wimlib. */ +#define WIM_RESHDR_FLAG_SPANNED 0x08 + +/* The resource is a solid compressed resource which may contain multiple blobs. + * This flag is only allowed if the WIM version number is WIM_VERSION_SOLID. */ +#define WIM_RESHDR_FLAG_SOLID 0x10 + +/* Magic number in the 'uncompressed_size' field of the resource header that + * identifies the main entry for a solid resource. */ +#define SOLID_RESOURCE_MAGIC_NUMBER 0x100000000ULL + +static inline void +copy_reshdr(struct wim_reshdr *dest, const struct wim_reshdr *src) +{ + memcpy(dest, src, sizeof(struct wim_reshdr)); +} + +static inline void +zero_reshdr(struct wim_reshdr *reshdr) +{ + memset(reshdr, 0, sizeof(struct wim_reshdr)); +} + +void +wim_reshdr_to_desc(const struct wim_reshdr *reshdr, WIMStruct *wim, + struct wim_resource_descriptor *rdesc); + +void +wim_reshdr_to_desc_and_blob(const struct wim_reshdr *reshdr, WIMStruct *wim, + struct wim_resource_descriptor *rdesc, + struct blob_descriptor *blob); + +void +get_wim_reshdr(const struct wim_reshdr_disk *disk_reshdr, + struct wim_reshdr *reshdr); + +void +put_wim_reshdr(const struct wim_reshdr *reshdr, + struct wim_reshdr_disk *disk_reshdr); + +/* Alternate chunk table format for resources with WIM_RESHDR_FLAG_SOLID set. + */ +struct alt_chunk_table_header_disk { + /* Uncompressed size of the resource in bytes. */ + le64 res_usize; + + /* Number of bytes each compressed chunk decompresses into, except + * possibly the last which decompresses into the remainder. This + * overrides the chunk size specified by the WIM header. */ + le32 chunk_size; + + /* Compression format used for compressed chunks: + * 0 = None + * 1 = XPRESS + * 2 = LZX + * 3 = LZMS + * + * This overrides the compression type specified by the WIM header. */ + le32 compression_format; + + /* This header is directly followed by a table of compressed sizes of + * the chunks (4 bytes per entry). */ +} __attribute__((packed)); + +static inline unsigned int +get_chunk_entry_size(u64 res_size, bool is_alt) +{ + if (res_size <= UINT32_MAX || is_alt) + return 4; + else + return 8; +} + +/* Functions to read blobs */ + +int +read_partial_wim_blob_into_buf(const struct blob_descriptor *blob, + u64 offset, size_t size, void *buf); + +int +read_blob_into_buf(const struct blob_descriptor *blob, void *buf); + +int +read_blob_into_alloc_buf(const struct blob_descriptor *blob, void **buf_ret); + +int +wim_reshdr_to_data(const struct wim_reshdr *reshdr, WIMStruct *wim, + void **buf_ret); + +int +wim_reshdr_to_hash(const struct wim_reshdr *reshdr, WIMStruct *wim, + u8 hash[SHA1_HASH_SIZE]); + +int +skip_wim_resource(const struct wim_resource_descriptor *rdesc); + +/* + * Callback function for reading chunks. Called whenever the next chunk of + * uncompressed data is available, passing 'ctx' as the last argument. 'size' is + * guaranteed to be nonzero. Must return 0 on success, or a positive wimlib + * error code on failure. + */ +struct consume_chunk_callback { + int (*func)(const void *chunk, size_t size, void *ctx); + void *ctx; +}; + +/* Pass a chunk of data to the specified consume_chunk callback */ +static inline int +consume_chunk(const struct consume_chunk_callback *cb, + const void *chunk, size_t size) +{ + return (*cb->func)(chunk, size, cb->ctx); +} + +/* Callback functions for reading blobs */ +struct read_blob_callbacks { + + /* Called when starting to read a blob. Must return 0 on success, or a + * positive wimlib error code on failure, or in the case of + * read_blob_list(), the special value BEGIN_BLOB_STATUS_SKIP_BLOB which + * indicates that the data for this blob should not be read. */ + int (*begin_blob)(struct blob_descriptor *blob, void *ctx); +#define BEGIN_BLOB_STATUS_SKIP_BLOB (-1) + + /* Called when the next chunk of uncompressed data is available. 'size' + * is guaranteed to be nonzero. Must return 0 on success, or a positive + * wimlib error code on failure. */ + int (*continue_blob)(const struct blob_descriptor *blob, u64 offset, + const void *chunk, size_t size, void *ctx); + + /* Called when a blob has been successfully read (status=0), or when + * begin_blob() was successfully called but an error occurred before the + * blob was fully read (status != 0; in this case the implementation + * should do cleanup and then pass on the status). Must return 0 on + * success, or a positive wimlib error code on failure. */ + int (*end_blob)(struct blob_descriptor *blob, int status, void *ctx); + + /* Parameter passed to each of the callback functions. */ + void *ctx; +}; + +/* Call cbs->begin_blob() if present. */ +static inline int +call_begin_blob(struct blob_descriptor *blob, + const struct read_blob_callbacks *cbs) +{ + if (!cbs->begin_blob) + return 0; + return (*cbs->begin_blob)(blob, cbs->ctx); +} + +/* Call cbs->continue_blob() if present. */ +static inline int +call_continue_blob(const struct blob_descriptor *blob, u64 offset, + const void *chunk, size_t size, + const struct read_blob_callbacks *cbs) +{ + if (!cbs->continue_blob) + return 0; + return (*cbs->continue_blob)(blob, offset, chunk, size, cbs->ctx); +} + +/* Call cbs->end_blob() if present. */ +static inline int +call_end_blob(struct blob_descriptor *blob, int status, + const struct read_blob_callbacks *cbs) +{ + if (!cbs->end_blob) + return status; + return (*cbs->end_blob)(blob, status, cbs->ctx); +} + +/* Flags for read_blob_list() */ +#define VERIFY_BLOB_HASHES 0x1 +#define COMPUTE_MISSING_BLOB_HASHES 0x2 +#define BLOB_LIST_ALREADY_SORTED 0x4 +#define RECOVER_DATA 0x8 + +int +read_blob_list(struct list_head *blob_list, size_t list_head_offset, + const struct read_blob_callbacks *cbs, int flags); + +int +read_blob_with_cbs(struct blob_descriptor *blob, + const struct read_blob_callbacks *cbs, bool recover_data); + +int +read_blob_with_sha1(struct blob_descriptor *blob, + const struct read_blob_callbacks *cbs, bool recover_data); + +int +extract_blob_prefix_to_fd(struct blob_descriptor *blob, u64 size, + struct filedes *fd); + +int +extract_blob_to_fd(struct blob_descriptor *blob, struct filedes *fd, + bool recover_data); + +/* Miscellaneous blob functions. */ + +int +sha1_blob(struct blob_descriptor *blob); + +/* Functions to read/write metadata resources. */ + +int +read_metadata_resource(struct wim_image_metadata *imd); + +int +write_metadata_resource(WIMStruct *wim, int image, int write_resource_flags); + +/* Definitions specific to pipable WIM resources. */ + +/* Arbitrary number to begin each blob in the pipable WIM, used for sanity + * checking. */ +#define PWM_BLOB_MAGIC 0x2b9b9ba2443db9d8ULL + +/* Header that precedes each blob in a pipable WIM. */ +struct pwm_blob_hdr { + le64 magic; /* +0 */ + le64 uncompressed_size; /* +8 */ + u8 hash[SHA1_HASH_SIZE]; /* +16 */ + le32 flags; /* +36 */ + /* +40 */ +} __attribute__((packed)); + +/* Header that precedes each chunk of a compressed resource in a pipable WIM. + */ +struct pwm_chunk_hdr { + le32 compressed_size; +} __attribute__((packed)); + +#endif /* _WIMLIB_RESOURCE_H */ diff --git a/src/wimlib/wimlib/scan.h b/src/wimlib/wimlib/scan.h new file mode 100644 index 00000000..cfd7835e --- /dev/null +++ b/src/wimlib/wimlib/scan.h @@ -0,0 +1,154 @@ +#ifndef _WIMLIB_SCAN_H +#define _WIMLIB_SCAN_H + +#include "wimlib.h" +#include "wimlib/inode_table.h" +#include "wimlib/list.h" +#include "wimlib/progress.h" +#include "wimlib/security.h" +#include "wimlib/textfile.h" +#include "wimlib/util.h" + +struct blob_table; +struct wim_dentry; +struct wim_inode; + +struct capture_config { + + /* List of path patterns to exclude */ + struct string_list exclusion_pats; + + /* List of path patterns to include, overriding exclusion_pats */ + struct string_list exclusion_exception_pats; + + void *buf; +}; + +/* Scan parameters: common parameters to implementations of building an + * in-memory dentry tree from an external directory structure. */ +struct scan_params { + + /* The blob table within which any new blobs discovered during the scan + * will be deduplicated. */ + struct blob_table *blob_table; + + /* List of new blobs that have been discovered without their SHA-1 + * message digests having been calculated (as a shortcut). */ + struct list_head *unhashed_blobs; + + /* Map from (inode number, device number) pair to inode for new inodes + * that have been discovered so far. */ + struct wim_inode_table *inode_table; + + /* The set of unique security descriptors to which each newly + * discovered, unique security descriptor will be added. */ + struct wim_sd_set *sd_set; + + /* The capture configuration in effect, or NULL if none. */ + struct capture_config *config; + + /* Flags that affect the scan operation (WIMLIB_ADD_FLAG_*) */ + int add_flags; + + /* If non-NULL, the user-supplied progress function. */ + wimlib_progress_func_t progfunc; + void *progctx; + + /* Progress data. */ + union wimlib_progress_info progress; + + /* Path to the file or directory currently being scanned */ + tchar *cur_path; + size_t cur_path_nchars; + size_t cur_path_alloc_nchars; + + /* Length of the prefix of 'cur_path' which names the root of the + * directory tree currently being scanned */ + size_t root_path_nchars; + + /* Can be used by the scan implementation. */ + u64 capture_root_ino; + u64 capture_root_dev; +}; + +/* scan.c */ + +int +do_scan_progress(struct scan_params *params, int status, + const struct wim_inode *inode); + +int +mangle_pat(tchar *pat, const tchar *path, unsigned long line_no); + +int +read_capture_config(const tchar *config_file, const void *buf, + size_t bufsize, struct capture_config *config); + +void +destroy_capture_config(struct capture_config *config); + +bool +match_pattern_list(const tchar *path, const struct string_list *list, + int match_flags); + +int +try_exclude(const struct scan_params *params); + +typedef int (*scan_tree_t)(struct wim_dentry **, const tchar *, + struct scan_params *); + +#ifdef WITH_NTFS_3G +/* ntfs-3g_capture.c */ +int +ntfs_3g_build_dentry_tree(struct wim_dentry **root_ret, + const tchar *device, struct scan_params *params); +#endif + +#ifdef _WIN32 +/* win32_capture.c */ +int +win32_build_dentry_tree(struct wim_dentry **root_ret, + const tchar *root_disk_path, + struct scan_params *params); +#define platform_default_scan_tree win32_build_dentry_tree +#else +/* unix_capture.c */ +int +unix_build_dentry_tree(struct wim_dentry **root_ret, + const tchar *root_disk_path, struct scan_params *params); +#define platform_default_scan_tree unix_build_dentry_tree +#endif + +#ifdef ENABLE_TEST_SUPPORT +int +generate_dentry_tree(struct wim_dentry **root_ret, + const tchar *root_disk_path, struct scan_params *params); +#endif + +#define WIMLIB_ADD_FLAG_ROOT 0x80000000 + +static inline int +report_scan_error(struct scan_params *params, int error_code) +{ + return report_error(params->progfunc, params->progctx, error_code, + params->cur_path); +} + +bool +should_ignore_filename(const tchar *name, int name_nchars); + +void +attach_scanned_tree(struct wim_dentry *parent, struct wim_dentry *child, + struct blob_table *blob_table); + +int +pathbuf_init(struct scan_params *params, const tchar *root_path); + +const tchar * +pathbuf_append_name(struct scan_params *params, const tchar *name, + size_t name_nchars, size_t *orig_path_nchars_ret); + +void +pathbuf_truncate(struct scan_params *params, size_t nchars); + +#endif /* _WIMLIB_SCAN_H */ diff --git a/src/wimlib/wimlib/security.h b/src/wimlib/wimlib/security.h new file mode 100644 index 00000000..3e817750 --- /dev/null +++ b/src/wimlib/wimlib/security.h @@ -0,0 +1,68 @@ +#ifndef _WIMLIB_SECURITY_H +#define _WIMLIB_SECURITY_H + +#include "wimlib/types.h" + +struct wim_security_data; +struct avl_tree_node; + +/* Map from SHA1 message digests of security descriptors to security IDs, which + * are themselves indices into the table of security descriptors in the 'struct + * wim_security_data'. */ +struct wim_sd_set { + struct wim_security_data *sd; + struct avl_tree_node *root; + s32 orig_num_entries; +}; + +/* Table of security descriptors for a WIM image. */ +struct wim_security_data { + /* The total length of the security data, in bytes. If there are no + * security descriptors, this field, when read from the on-disk metadata + * resource, may be either 8 (which is correct) or 0 (which is + * interpreted as 8). */ + u32 total_length; + + /* The number of security descriptors in the array @descriptors. */ + u32 num_entries; + + /* Array of sizes of the descriptors, in bytes, in the array + * @descriptors. */ + u64 *sizes; + + /* Array of pointers to the security descriptors in the + * SECURITY_DESCRIPTOR_RELATIVE format. */ + u8 **descriptors; +}; + +void +rollback_new_security_descriptors(struct wim_sd_set *sd_set); + +void +destroy_sd_set(struct wim_sd_set *sd_set); + +s32 +sd_set_add_sd(struct wim_sd_set *sd_set, const char descriptor[], + size_t size); + +int +init_sd_set(struct wim_sd_set *sd_set, struct wim_security_data *sd); + +struct wim_security_data * +new_wim_security_data(void); + +int +read_wim_security_data(const u8 *buf, size_t buf_len, + struct wim_security_data **sd_ret); + +u8 * +write_wim_security_data(const struct wim_security_data * restrict sd, + u8 * restrict p); + +void +print_wim_security_data(const struct wim_security_data *sd); + +void +free_wim_security_data(struct wim_security_data *sd); + +#endif /* _WIMLIB_SECURITY_H */ diff --git a/src/wimlib/wimlib/security_descriptor.h b/src/wimlib/wimlib/security_descriptor.h new file mode 100644 index 00000000..f5c5a34c --- /dev/null +++ b/src/wimlib/wimlib/security_descriptor.h @@ -0,0 +1,146 @@ +/* + * security_descriptor.h - declarations for Windows security descriptor format + * + * Copyright 2022 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _WIMLIB_SECURITY_DESCRIPTOR_H +#define _WIMLIB_SECURITY_DESCRIPTOR_H + +#include "wimlib/compiler.h" +#include "wimlib/types.h" + +/* Note: the data types in this header are prefixed with wimlib_ to avoid + * conflicts with the same types being defined in the libntfs-3g headers. */ + +/* Windows NT security descriptor, in self-relative format */ +typedef struct { + /* Security descriptor revision; should be 1 */ + u8 revision; + + /* Padding */ + u8 sbz1; + + /* Bitwise OR of flags defined below, such as SE_DACL_PRESENT */ + le16 control; + + /* Offset of owenr SID structure in the security descriptor */ + le32 owner_offset; + + /* Offset of group SID structure in the security descriptor */ + le32 group_offset; + + /* Offset of System Access Control List (SACL) in security descriptor, + * or 0 if no SACL is present */ + le32 sacl_offset; + + /* Offset of Discretionary Access Control List (DACL) in security + * descriptor, or 0 if no DACL is present */ + le32 dacl_offset; +} __attribute__((packed)) wimlib_SECURITY_DESCRIPTOR_RELATIVE; + +#define wimlib_SE_OWNER_DEFAULTED 0x0001 +#define wimlib_SE_GROUP_DEFAULTED 0x0002 +#define wimlib_SE_DACL_PRESENT 0x0004 +#define wimlib_SE_DACL_DEFAULTED 0x0008 +#define wimlib_SE_SACL_PRESENT 0x0010 +#define wimlib_SE_SACL_DEFAULTED 0x0020 +#define wimlib_SE_DACL_AUTO_INHERIT_REQ 0x0100 +#define wimlib_SE_SACL_AUTO_INHERIT_REQ 0x0200 +#define wimlib_SE_DACL_AUTO_INHERITED 0x0400 +#define wimlib_SE_SACL_AUTO_INHERITED 0x0800 +#define wimlib_SE_DACL_PROTECTED 0x1000 +#define wimlib_SE_SACL_PROTECTED 0x2000 +#define wimlib_SE_RM_CONTROL_VALID 0x4000 +#define wimlib_SE_SELF_RELATIVE 0x8000 + +/* Windows NT security identifier (user or group) */ +typedef struct { + + u8 revision; + u8 sub_authority_count; + + /* Identifies the authority that issued the SID */ + u8 identifier_authority[6]; + + le32 sub_authority[]; +} __attribute__((packed)) wimlib_SID; + +/* Header of a Windows NT access control list */ +typedef struct { + /* ACL_REVISION or ACL_REVISION_DS */ + u8 revision; + + /* padding */ + u8 sbz1; + + /* Total size of the ACL, including all access control entries */ + le16 acl_size; + + /* Number of access control entry structures that follow the ACL + * structure */ + le16 ace_count; + + /* padding */ + le16 sbz2; +} __attribute__((packed)) wimlib_ACL; + +#define wimlib_ACCESS_ALLOWED_ACE_TYPE 0 +#define wimlib_ACCESS_DENIED_ACE_TYPE 1 +#define wimlib_SYSTEM_AUDIT_ACE_TYPE 2 + +/* Header of a Windows NT access control entry */ +typedef struct { + /* Type of ACE */ + u8 type; + + /* Bitwise OR of inherit ACE flags */ + u8 flags; + + /* Size of the access control entry, including this header */ + le16 size; +} __attribute__((packed)) wimlib_ACE_HEADER; + +/* Windows NT access control entry to grant rights to a user or group */ +typedef struct { + wimlib_ACE_HEADER hdr; + le32 mask; + wimlib_SID sid; +} __attribute__((packed)) wimlib_ACCESS_ALLOWED_ACE; + +/* Windows NT access control entry to deny rights to a user or group */ +typedef struct { + wimlib_ACE_HEADER hdr; + le32 mask; + wimlib_SID sid; +} __attribute__((packed)) wimlib_ACCESS_DENIED_ACE; + +/* Windows NT access control entry to audit access to the object */ +typedef struct { + wimlib_ACE_HEADER hdr; + le32 mask; + wimlib_SID sid; +} __attribute__((packed)) wimlib_SYSTEM_AUDIT_ACE; + +#endif /* _WIMLIB_SECURITY_DESCRIPTOR_H */ diff --git a/src/wimlib/wimlib/sha1.h b/src/wimlib/wimlib/sha1.h new file mode 100644 index 00000000..91f84d91 --- /dev/null +++ b/src/wimlib/wimlib/sha1.h @@ -0,0 +1,87 @@ +/* + * sha1.h + * + * Copyright 2022-2023 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _WIMLIB_SHA1_H +#define _WIMLIB_SHA1_H + +#include <string.h> + +#include "wimlib/types.h" +#include "wimlib/util.h" + +#define SHA1_HASH_SIZE 20 +#define SHA1_BLOCK_SIZE 64 + +struct sha1_ctx { + u64 bytecount; + u32 h[5]; + u8 buffer[SHA1_BLOCK_SIZE]; +}; + +void +sha1_init(struct sha1_ctx *ctx); + +void +sha1_update(struct sha1_ctx *ctx, const void *data, size_t len); + +void +sha1_final(struct sha1_ctx *ctx, u8 hash[SHA1_HASH_SIZE]); + +void +sha1(const void *data, size_t len, u8 hash[SHA1_HASH_SIZE]); + +extern const u8 zero_hash[SHA1_HASH_SIZE]; + +#define SHA1_HASH_STRING_LEN (2 * SHA1_HASH_SIZE + 1) +void +sprint_hash(const u8 hash[SHA1_HASH_SIZE], tchar strbuf[SHA1_HASH_STRING_LEN]); + +static inline void +copy_hash(u8 dest[SHA1_HASH_SIZE], const u8 src[SHA1_HASH_SIZE]) +{ + memcpy(dest, src, SHA1_HASH_SIZE); +} + +static inline int +hashes_cmp(const u8 h1[SHA1_HASH_SIZE], const u8 h2[SHA1_HASH_SIZE]) +{ + return memcmp(h1, h2, SHA1_HASH_SIZE); +} + +static inline bool +hashes_equal(const u8 h1[SHA1_HASH_SIZE], const u8 h2[SHA1_HASH_SIZE]) +{ + return !hashes_cmp(h1, h2); +} + +static inline bool +is_zero_hash(const u8 *hash) +{ + return hash == zero_hash || hashes_equal(hash, zero_hash); +} + +#endif /* _WIMLIB_SHA1_H */ diff --git a/src/wimlib/wimlib/solid.h b/src/wimlib/wimlib/solid.h new file mode 100644 index 00000000..051e445f --- /dev/null +++ b/src/wimlib/wimlib/solid.h @@ -0,0 +1,9 @@ +#ifndef _WIMLIB_SOLID_H +#define _WIMLIB_SOLID_H + +struct list_head; + +int +sort_blob_list_for_solid_compression(struct list_head *blob_list); + +#endif /* _WIMLIB_SOLID_H */ diff --git a/src/wimlib/wimlib/tagged_items.h b/src/wimlib/wimlib/tagged_items.h new file mode 100644 index 00000000..815fa187 --- /dev/null +++ b/src/wimlib/wimlib/tagged_items.h @@ -0,0 +1,31 @@ +#ifndef _WIMLIB_TAGGED_ITEMS_H +#define _WIMLIB_TAGGED_ITEMS_H + +#include "wimlib/types.h" + +struct wim_inode; + +/* Windows-style object ID */ +#define TAG_OBJECT_ID 0x00000001 + +/* Extended attributes */ +#define TAG_XATTRS 0x00000002 + +/* [wimlib extension] Standard UNIX metadata: uid, gid, mode, and rdev */ +#define TAG_WIMLIB_UNIX_DATA 0x337DD873 + +/* + * [wimlib extension] Linux-style extended attributes + * (deprecated in favor of TAG_XATTRS) + */ +#define TAG_WIMLIB_LINUX_XATTRS 0x337DD874 + +void * +inode_get_tagged_item(const struct wim_inode *inode, u32 tag, u32 min_len, + u32 *actual_len_ret); + +bool +inode_set_tagged_item(struct wim_inode *inode, u32 tag, + const void *data, u32 len); + +#endif /* _WIMLIB_TAGGED_ITEMS_H */ diff --git a/src/wimlib/wimlib/test_support.h b/src/wimlib/wimlib/test_support.h new file mode 100644 index 00000000..8104921d --- /dev/null +++ b/src/wimlib/wimlib/test_support.h @@ -0,0 +1,38 @@ +#ifndef _WIMLIB_TEST_SUPPORT_H +#define _WIMLIB_TEST_SUPPORT_H + +#ifdef ENABLE_TEST_SUPPORT + +#include "wimlib.h" +#include "wimlib/types.h" + +#define WIMLIB_ERR_IMAGES_ARE_DIFFERENT 200 + +#define WIMLIB_ADD_FLAG_GENERATE_TEST_DATA 0x08000000 + +#define WIMLIB_CMP_FLAG_UNIX_MODE 0x00000001 +#define WIMLIB_CMP_FLAG_NTFS_3G_MODE 0x00000002 +#define WIMLIB_CMP_FLAG_WINDOWS_MODE 0x00000004 +#define WIMLIB_CMP_FLAG_EXT4 0x00000008 + +WIMLIBAPI void +wimlib_seed_random(u64 seed); + +WIMLIBAPI int +wimlib_compare_images(WIMStruct *wim1, int image1, + WIMStruct *wim2, int image2, int cmp_flags); + +WIMLIBAPI int +wimlib_parse_and_write_xml_doc(const tchar *in, tchar **out_ret); + +WIMLIBAPI int +wimlib_utf8_to_utf16le(const char *in, size_t in_nbytes, + utf16lechar **out_ret, size_t *out_nbytes_ret); + +WIMLIBAPI int +wimlib_utf16le_to_utf8(const utf16lechar *in, size_t in_nbytes, + char **out_ret, size_t *out_nbytes_ret); + +#endif /* ENABLE_TEST_SUPPORT */ + +#endif /* _WIMLIB_TEST_SUPPORT_H */ diff --git a/src/wimlib/wimlib/textfile.h b/src/wimlib/wimlib/textfile.h new file mode 100644 index 00000000..df606561 --- /dev/null +++ b/src/wimlib/wimlib/textfile.h @@ -0,0 +1,37 @@ +#ifndef _WIMLIB_TEXTFILE_H_ +#define _WIMLIB_TEXTFILE_H_ + +#include "wimlib/types.h" + +struct string_list { + tchar **strings; + size_t num_strings; + size_t num_alloc_strings; +}; + +#define STRING_LIST_INITIALIZER \ + { .strings = NULL, .num_strings = 0, .num_alloc_strings = 0, } + +#define STRING_LIST(_strings) \ + struct string_list _strings = STRING_LIST_INITIALIZER + +typedef int (*line_mangle_t)(tchar *line, const tchar *filename, + unsigned long line_no); + +struct text_file_section { + const tchar *name; + struct string_list *strings; +}; + +#define LOAD_TEXT_FILE_REMOVE_QUOTES 0x00000001 +#define LOAD_TEXT_FILE_NO_WARNINGS 0x00000002 +#define LOAD_TEXT_FILE_ALLOW_STDIN 0x00000004 + +int +load_text_file(const tchar *path, const void *buf, size_t bufsize, + void **mem_ret, + const struct text_file_section *pos_sections, + int num_pos_sections, + int flags, line_mangle_t mangle_line); + +#endif /* _WIMLIB_TEXTFILE_H_ */ diff --git a/src/wimlib/wimlib/threads.h b/src/wimlib/wimlib/threads.h new file mode 100644 index 00000000..2e624a49 --- /dev/null +++ b/src/wimlib/wimlib/threads.h @@ -0,0 +1,44 @@ +#ifndef _WIMLIB_THREADS_H +#define _WIMLIB_THREADS_H + +#include <stdbool.h> + +#ifdef _WIN32 + +struct thread { + void *win32_thread; + void *(*thrproc)(void *); + void *arg; +}; + +struct mutex { void *win32_crit; }; +#define MUTEX_INITIALIZER { NULL } + +struct condvar { void *win32_cond; }; + +#else /* _WIN32 */ + +#include <pthread.h> + +struct thread { pthread_t pthread; }; + +struct mutex { pthread_mutex_t pthread_mutex; }; +#define MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER } + +struct condvar { pthread_cond_t pthread_cond; }; + +#endif /* !_WIN32 */ + +bool thread_create(struct thread *t, void *(*thrproc)(void *), void *arg); +void thread_join(struct thread *t); +bool mutex_init(struct mutex *m); +void mutex_destroy(struct mutex *m); +void mutex_lock(struct mutex *m); +void mutex_unlock(struct mutex *m); +bool condvar_init(struct condvar *c); +void condvar_destroy(struct condvar *c); +void condvar_wait(struct condvar *c, struct mutex *m); +void condvar_signal(struct condvar *c); +void condvar_broadcast(struct condvar *c); + +#endif /* _WIMLIB_THREADS_H */ diff --git a/src/wimlib/wimlib/timestamp.h b/src/wimlib/wimlib/timestamp.h new file mode 100644 index 00000000..e30e0621 --- /dev/null +++ b/src/wimlib/wimlib/timestamp.h @@ -0,0 +1,45 @@ +/* + * timestamp.h + * + * Conversion between Windows NT timestamps and UNIX timestamps. + */ + +#ifndef _WIMLIB_TIMESTAMP_H +#define _WIMLIB_TIMESTAMP_H + +#include <sys/time.h> +#include <time.h> + +#include "wimlib/types.h" + +struct wimlib_timespec; + +time_t +wim_timestamp_to_time_t(u64 timestamp); + +void +wim_timestamp_to_wimlib_timespec(u64 timestamp, struct wimlib_timespec *wts, + s32 *high_part_ret); + +struct timeval +wim_timestamp_to_timeval(u64 timestamp); + +struct timespec +wim_timestamp_to_timespec(u64 timestamp); + +u64 +time_t_to_wim_timestamp(time_t t); + +u64 +timeval_to_wim_timestamp(const struct timeval *tv); + +u64 +timespec_to_wim_timestamp(const struct timespec *ts); + +u64 +now_as_wim_timestamp(void); + +void +wim_timestamp_to_str(u64 timestamp, tchar *buf, size_t len); + +#endif /* _WIMLIB_TIMESTAMP_H */ diff --git a/src/wimlib/wimlib/types.h b/src/wimlib/wimlib/types.h new file mode 100644 index 00000000..4c85311e --- /dev/null +++ b/src/wimlib/wimlib/types.h @@ -0,0 +1,53 @@ +#ifndef _WIMLIB_TYPES_H +#define _WIMLIB_TYPES_H + +#include <inttypes.h> +#include <stdbool.h> +#include <stddef.h> + +#include "wimlib_tchar.h" +#include "wimlib/compiler.h" + +#ifndef _NTFS_TYPES_H +/* Unsigned integer types of exact size in bits */ +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; +typedef uint64_t u64; + +/* Signed integer types of exact size in bits */ +typedef int8_t s8; +typedef int16_t s16; +typedef int32_t s32; +typedef int64_t s64; + +/* Unsigned little endian types of exact size */ +typedef uint16_t _bitwise_attr le16; +typedef uint32_t _bitwise_attr le32; +typedef uint64_t _bitwise_attr le64; + +/* Unsigned big endian types of exact size */ +typedef uint16_t _bitwise_attr be16; +typedef uint32_t _bitwise_attr be32; +typedef uint64_t _bitwise_attr be64; +#endif + +/* A pointer to 'utf16lechar' indicates a UTF-16LE encoded string */ +typedef le16 utf16lechar; + +#ifndef WIMLIB_WIMSTRUCT_DECLARED +typedef struct WIMStruct WIMStruct; +# define WIMLIB_WIMSTRUCT_DECLARED +#endif + +/* + * Type of a machine word. 'unsigned long' would be logical, but that is only + * 32 bits on x86_64 Windows. The same applies to 'uint_fast32_t'. So the best + * we can do without a bunch of #ifdefs appears to be 'size_t'. + */ +typedef size_t machine_word_t; + +#define WORDBYTES sizeof(machine_word_t) +#define WORDBITS (8 * WORDBYTES) + +#endif /* _WIMLIB_TYPES_H */ diff --git a/src/wimlib/wimlib/unaligned.h b/src/wimlib/wimlib/unaligned.h new file mode 100644 index 00000000..5c6aa33b --- /dev/null +++ b/src/wimlib/wimlib/unaligned.h @@ -0,0 +1,133 @@ +/* + * unaligned.h - inline functions for unaligned memory accesses + * + * Copyright 2022 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _WIMLIB_UNALIGNED_H +#define _WIMLIB_UNALIGNED_H + +#include <string.h> + +#include "wimlib/compiler.h" +#include "wimlib/endianness.h" +#include "wimlib/types.h" + +#define DEFINE_UNALIGNED_TYPE(type) \ +static forceinline type \ +load_##type##_unaligned(const void *p) \ +{ \ + type v; \ + memcpy(&v, p, sizeof(v)); \ + return v; \ +} \ + \ +static forceinline void \ +store_##type##_unaligned(type v, void *p) \ +{ \ + memcpy(p, &v, sizeof(v)); \ +} + +DEFINE_UNALIGNED_TYPE(u16); +DEFINE_UNALIGNED_TYPE(u32); +DEFINE_UNALIGNED_TYPE(u64); +DEFINE_UNALIGNED_TYPE(le16); +DEFINE_UNALIGNED_TYPE(le32); +DEFINE_UNALIGNED_TYPE(le64); +DEFINE_UNALIGNED_TYPE(be16); +DEFINE_UNALIGNED_TYPE(be32); +DEFINE_UNALIGNED_TYPE(be64); +DEFINE_UNALIGNED_TYPE(size_t); +DEFINE_UNALIGNED_TYPE(machine_word_t); + +#define load_word_unaligned load_machine_word_t_unaligned +#define store_word_unaligned store_machine_word_t_unaligned + +static forceinline u16 +get_unaligned_le16(const u8 *p) +{ + if (UNALIGNED_ACCESS_IS_FAST) + return le16_to_cpu(load_le16_unaligned(p)); + else + return ((u16)p[1] << 8) | p[0]; +} + +static forceinline u32 +get_unaligned_le32(const u8 *p) +{ + if (UNALIGNED_ACCESS_IS_FAST) + return le32_to_cpu(load_le32_unaligned(p)); + else + return ((u32)p[3] << 24) | ((u32)p[2] << 16) | + ((u32)p[1] << 8) | p[0]; +} + +static forceinline u32 +get_unaligned_be32(const u8 *p) +{ + if (UNALIGNED_ACCESS_IS_FAST) + return be32_to_cpu(load_be32_unaligned(p)); + else + return ((u32)p[0] << 24) | ((u32)p[1] << 16) | + ((u32)p[2] << 8) | p[3]; +} + +static forceinline void +put_unaligned_le16(u16 v, u8 *p) +{ + if (UNALIGNED_ACCESS_IS_FAST) { + store_le16_unaligned(cpu_to_le16(v), p); + } else { + p[0] = (u8)(v >> 0); + p[1] = (u8)(v >> 8); + } +} + +static forceinline void +put_unaligned_le32(u32 v, u8 *p) +{ + if (UNALIGNED_ACCESS_IS_FAST) { + store_le32_unaligned(cpu_to_le32(v), p); + } else { + p[0] = (u8)(v >> 0); + p[1] = (u8)(v >> 8); + p[2] = (u8)(v >> 16); + p[3] = (u8)(v >> 24); + } +} + +static forceinline void +put_unaligned_be32(u32 v, u8 *p) +{ + if (UNALIGNED_ACCESS_IS_FAST) { + store_be32_unaligned(cpu_to_be32(v), p); + } else { + p[0] = (u8)(v >> 24); + p[1] = (u8)(v >> 16); + p[2] = (u8)(v >> 8); + p[3] = (u8)(v >> 0); + } +} + +#endif /* _WIMLIB_UNALIGNED_H */ diff --git a/src/wimlib/wimlib/unix_data.h b/src/wimlib/wimlib/unix_data.h new file mode 100644 index 00000000..11aa67b3 --- /dev/null +++ b/src/wimlib/wimlib/unix_data.h @@ -0,0 +1,33 @@ +#ifndef _WIMLIB_UNIX_DATA_H +#define _WIMLIB_UNIX_DATA_H + +#include "wimlib/types.h" + +struct wimlib_unix_data { + u32 uid; + u32 gid; + u32 mode; + u32 rdev; +}; + +struct wim_inode; + +bool +inode_has_unix_data(const struct wim_inode *inode); + +bool +inode_get_unix_data(const struct wim_inode *inode, + struct wimlib_unix_data *unix_data); + +#define UNIX_DATA_UID 0x1 +#define UNIX_DATA_GID 0x2 +#define UNIX_DATA_MODE 0x4 +#define UNIX_DATA_RDEV 0x8 + +#define UNIX_DATA_ALL 0xF + +bool +inode_set_unix_data(struct wim_inode *inode, + struct wimlib_unix_data *unix_data, int which); + +#endif /* _WIMLIB_UNIX_DATA_H */ diff --git a/src/wimlib/wimlib/util.h b/src/wimlib/wimlib/util.h new file mode 100644 index 00000000..6c9ee061 --- /dev/null +++ b/src/wimlib/wimlib/util.h @@ -0,0 +1,149 @@ +/* + * util.h - utility functions and macros + */ +#ifndef _WIMLIB_UTIL_H +#define _WIMLIB_UTIL_H + +#include "wimlib/compiler.h" +#include "wimlib/types.h" + +/**************** + * General macros + *****************/ + +/* Cast a pointer to a struct member to a pointer to the containing struct. */ +#define container_of(ptr, type, member) \ + ((type *)((char *)(ptr) - offsetof(type, member))) + +/* Calculate 'n / d', but round up instead of down. */ +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) + +/* Calculate 'n % d', but return 'd' if the result would be 0. */ +#define MODULO_NONZERO(n, d) (((n) % (d)) ? ((n) % (d)) : (d)) + +/* Get the number of elements of an array type. */ +#define ARRAY_LEN(array) (sizeof(array) / sizeof((array)[0])) + +/* Round 'v' up to the next 'alignment'-byte aligned boundary. 'alignment' must + * be a power of 2. */ +#undef ALIGN /* NetBSD <sys/param.h> defines this already */ +#define ALIGN(v, alignment) (((v) + ((alignment) - 1)) & ~((alignment) - 1)) + +/* Maximum number of bytes that can be allocated on the stack. + * + * Note: this isn't a hard bound on the stack space used, since this is just for + * individual arrays. The full call stack could use more than this. */ +#define STACK_MAX 32768 + +/* Default size of file I/O buffer. Currently assumed to be <= STACK_MAX. */ +#define BUFFER_SIZE 32768 + +/******************* + * Memory allocation + *******************/ + +void * +wimlib_malloc(size_t size); + +void +wimlib_free_memory(void *p); + +void * +wimlib_realloc(void *ptr, size_t size); + +void * +wimlib_calloc(size_t nmemb, size_t size); + +char * +wimlib_strdup(const char *str); + +#ifdef _WIN32 +wchar_t * +wimlib_wcsdup(const wchar_t *str); +#endif + +void * +wimlib_aligned_malloc(size_t size, size_t alignment); + +void +wimlib_aligned_free(void *ptr); + +void * +memdup(const void *mem, size_t size); + +#define MALLOC wimlib_malloc +#define FREE wimlib_free_memory +#define REALLOC wimlib_realloc +#define CALLOC wimlib_calloc +#define STRDUP wimlib_strdup +#define WCSDUP wimlib_wcsdup +#define ALIGNED_MALLOC wimlib_aligned_malloc +#define ALIGNED_FREE wimlib_aligned_free + +/******************* + * String utilities + *******************/ + +#ifndef HAVE_MEMPCPY +void * +mempcpy(void *dst, const void *src, size_t n); +#endif + +/************************** + * Random number generation + **************************/ + +void +get_random_bytes(void *p, size_t n); + +void +get_random_alnum_chars(tchar *p, size_t n); + +/************************ + * Hashing and comparison + ************************/ + +static inline bool +is_power_of_2(unsigned long n) +{ + return (n != 0 && (n & (n - 1)) == 0); + +} + +static inline u64 +hash_u64(u64 n) +{ + return n * 0x9e37fffffffc0001ULL; +} + +static inline int +cmp_u32(u32 n1, u32 n2) +{ + if (n1 < n2) + return -1; + if (n1 > n2) + return 1; + return 0; +} + +static inline int +cmp_u64(u64 n1, u64 n2) +{ + if (n1 < n2) + return -1; + if (n1 > n2) + return 1; + return 0; +} + +/************************ + * System information + ************************/ + +unsigned +get_available_cpus(void); + +u64 +get_available_memory(void); + +#endif /* _WIMLIB_UTIL_H */ diff --git a/src/wimlib/wimlib/wim.h b/src/wimlib/wimlib/wim.h new file mode 100644 index 00000000..666f4b02 --- /dev/null +++ b/src/wimlib/wimlib/wim.h @@ -0,0 +1,234 @@ +/* + * wim.h - WIMStruct definition and helper functions + */ + +#ifndef _WIMLIB_WIM_H +#define _WIMLIB_WIM_H + +#include "wimlib.h" +#include "wimlib/file_io.h" +#include "wimlib/header.h" +#include "wimlib/list.h" + +struct wim_image_metadata; +struct wim_xml_info; +struct blob_table; + +/* + * WIMStruct - represents a WIM, or a part of a non-standalone WIM + * + * Note 1: there are three ways in which a WIMStruct can be created: + * + * 1. open an on-disk WIM file + * 2. start to extract a pipable WIM from a file descriptor + * 3. create a new WIMStruct directly + * + * For (1) and (2), the WIMStruct has a backing file; for (3) it does not. For + * (1), the backing file is a real "on-disk" file from the filesystem, whereas + * for (2) the backing file is a file descriptor which may be a pipe. + * + * Note 2: although this is the top-level data structure in wimlib, there do + * exist cases in which a WIMStruct is not standalone: + * - blobs have been referenced from another WIMStruct + * - an image has been imported into this WIMStruct from another + * (as this references the metadata rather than copies it) + * + * Note 3: It is unsafe for multiple threads to operate on the same WIMStruct at + * the same time. This extends to references to other WIMStructs as noted + * above. But besides this, it is safe to operate on *different* WIMStructs in + * different threads concurrently. + */ +struct WIMStruct { + + /* Information from the header of the WIM file. + * + * This is also maintained for a WIMStruct not backed by a file, but in + * that case the 'reshdr' fields are left zeroed. */ + struct wim_header hdr; + + /* If the library is currently writing this WIMStruct out to a file, + * then this is the header being created for that file. */ + struct wim_header out_hdr; + + /* Array of image metadata, one for each image in the WIM (array length + * hdr.image_count). Or, this will be NULL if this WIM does not contain + * metadata, which implies that this WIMStruct either represents part of + * a non-standalone WIM, or represents a standalone WIM that, oddly + * enough, actually contains 0 images. */ + struct wim_image_metadata **image_metadata; + + /* Information from the XML data of the WIM file. This information is + * also maintained for a WIMStruct not backed by a file. */ + struct wim_xml_info *xml_info; + + /* The blob table for this WIMStruct. If this WIMStruct has a backing + * file, then this table will index the blobs contained in that file. + * In addition, this table may index blobs that were added by updates or + * referenced from other WIMStructs. */ + struct blob_table *blob_table; + + /* The number of references to this WIMStruct. This is equal to the + * number of resource descriptors that reference this WIMStruct, plus 1 + * if wimlib_free() still needs to be called. */ + ssize_t refcnt; + + /* + * The 1-based index of the currently selected image in this WIMStruct, + * or WIMLIB_NO_IMAGE if no image is currently selected. + * + * The metadata for the current image is image_metadata[current_image - + * 1]. Since we load image metadata lazily, only the metadata for the + * current image is guaranteed to actually be present in memory. + */ + int current_image; + + /* The absolute path to the on-disk file backing this WIMStruct, or NULL + * if this WIMStruct is not backed by an on-disk file. */ + tchar *filename; + + /* If this WIMStruct has a backing file, then this is a file descriptor + * open to that file with read access. Otherwise, this field is invalid + * (!filedes_valid(&in_fd)). */ + struct filedes in_fd; + + /* If the library is currently writing this WIMStruct out to a file, + * then this is a file descriptor open to that file with write access. + * Otherwise, this field is invalid (!filedes_valid(&out_fd)). */ + struct filedes out_fd; + + /* The size of the backing file, or 0 if unknown */ + u64 file_size; + + /* + * This is the cached decompressor for this WIM file, or NULL if no + * decompressor is cached yet. Normally, all the compressed data in a + * WIM file has the same compression type and chunk size, so the same + * decompressor can be used for all data --- and that decompressor will + * be cached here. However, if we do encounter any data with a + * different compression type or chunk size (this is possible in solid + * resources), then this cached decompressor will be replaced with a new + * one. + */ + struct wimlib_decompressor *decompressor; + u8 decompressor_ctype; + u32 decompressor_max_block_size; + + /* Temporary field; use sparingly */ + void *private; + + /* 1 if any images have been deleted from this WIMStruct, otherwise 0 */ + u8 image_deletion_occurred : 1; + + /* 1 if the WIM file has been locked for appending, otherwise 0 */ + u8 locked_for_append : 1; + + /* 1 if the WIM file is currently being compacted by wimlib_overwrite() + * with WIMLIB_WRITE_FLAG_UNSAFE_COMPACT */ + u8 being_compacted : 1; + + /* If this WIM is backed by a file, then this is the compression type + * for non-solid resources in that file. */ + u8 compression_type; + + /* Overridden compression type for wimlib_overwrite() or wimlib_write(). + * Can be changed by wimlib_set_output_compression_type(); otherwise is + * the same as compression_type. */ + u8 out_compression_type; + + /* Compression type for writing solid resources; can be set with + * wimlib_set_output_pack_compression_type(). */ + u8 out_solid_compression_type; + + /* If this WIM is backed by a file, then this is the compression chunk + * size for non-solid resources in that file. */ + u32 chunk_size; + + /* Overridden chunk size for wimlib_overwrite() or wimlib_write(). Can + * be changed by wimlib_set_output_chunk_size(); otherwise is the same + * as chunk_size. */ + u32 out_chunk_size; + + /* Chunk size for writing solid resources; can be set with + * wimlib_set_output_pack_chunk_size(). */ + u32 out_solid_chunk_size; + + /* Currently registered progress function for this WIMStruct, or NULL if + * no progress function is currently registered for this WIMStruct. */ + wimlib_progress_func_t progfunc; + void *progctx; +}; + +/* + * Return true if and only if the WIM contains image metadata (actual directory + * trees, not just a collection of blobs and their checksums). + * + * See the description of the 'image_metadata' field. Note that we return true + * when the image count is 0 because it could be a WIM with 0 images. It's only + * when the WIM does not contain the metadata described by its image count that + * we return false. + */ +static inline bool wim_has_metadata(const WIMStruct *wim) +{ + return (wim->image_metadata != NULL || wim->hdr.image_count == 0); +} + +/* Return true if and only if the WIM has an integrity table. + * + * If the WIM is not backed by a file, then this always returns false. */ +static inline bool wim_has_integrity_table(const WIMStruct *wim) +{ + return (wim->hdr.integrity_table_reshdr.offset_in_wim != 0); +} + +/* Return true if and only if the WIM is in pipable format. + * + * If the WIM is not backed by a file, then this always returns false. */ +static inline bool wim_is_pipable(const WIMStruct *wim) +{ + return (wim->hdr.magic == PWM_MAGIC); +} + +void +wim_decrement_refcnt(WIMStruct *wim); + +bool +wim_has_solid_resources(const WIMStruct *wim); + +int +read_wim_header(WIMStruct *wim, struct wim_header *hdr); + +int +write_wim_header(const struct wim_header *hdr, struct filedes *out_fd, + off_t offset); + +int +write_wim_header_flags(u32 hdr_flags, struct filedes *out_fd); + +int +select_wim_image(WIMStruct *wim, int image); + +void +deselect_current_wim_image(WIMStruct *wim); + +int +for_image(WIMStruct *wim, int image, int (*visitor)(WIMStruct *)); + +int +wim_checksum_unhashed_blobs(WIMStruct *wim); + +int +delete_wim_image(WIMStruct *wim, int image); + +/* Internal open flags (pass to open_wim_as_WIMStruct(), not wimlib_open_wim()) + */ +#define WIMLIB_OPEN_FLAG_FROM_PIPE 0x80000000 + +int +open_wim_as_WIMStruct(const void *wim_filename_or_fd, int open_flags, + WIMStruct **wim_ret, + wimlib_progress_func_t progfunc, void *progctx); + +int +can_modify_wim(WIMStruct *wim); + +#endif /* _WIMLIB_WIM_H */ diff --git a/src/wimlib/wimlib/wimboot.h b/src/wimlib/wimlib/wimboot.h new file mode 100644 index 00000000..97071290 --- /dev/null +++ b/src/wimlib/wimlib/wimboot.h @@ -0,0 +1,25 @@ +#ifndef _WIMBOOT_H_ +#define _WIMBOOT_H_ + +#include "wimlib/header.h" +#include "wimlib/sha1.h" +#include "wimlib/types.h" +#include "wimlib/win32_common.h" + +struct blob_descriptor; + +int +wimboot_alloc_data_source_id(const wchar_t *wim_path, + const u8 guid[GUID_SIZE], int image, + const wchar_t *target, u64 *data_source_id_ret, + bool *wof_running_ret); + +bool +wimboot_set_pointer(HANDLE h, + const struct blob_descriptor *blob, + u64 data_source_id, + const u8 blob_table_hash[SHA1_HASH_SIZE], + bool wof_running); + + +#endif /* _WIMBOOT_H_ */ diff --git a/src/wimlib/wimlib/win32.h b/src/wimlib/wimlib/win32.h new file mode 100644 index 00000000..ed54e6f5 --- /dev/null +++ b/src/wimlib/wimlib/win32.h @@ -0,0 +1,69 @@ +/* + * win32.h - Windows-specific declarations needed by non-Windows-specific files. + */ + +#ifndef _WIMLIB_WIN32_H +#define _WIMLIB_WIN32_H + +#ifdef _WIN32 + +#include "wimlib/types.h" + +struct blob_descriptor; +struct consume_chunk_callback; +struct windows_file; + +struct windows_file * +clone_windows_file(const struct windows_file *file); + +void +free_windows_file(struct windows_file *file); + +int +cmp_windows_files(const struct windows_file *file1, + const struct windows_file *file2); + +int +read_windows_file_prefix(const struct blob_descriptor *blob, u64 size, + const struct consume_chunk_callback *cb, + bool recover_data); + +int +win32_global_init(int init_flags); + +void +win32_global_cleanup(void); + +int +fsync(int fd); + +tchar * +realpath(const tchar *path, tchar *resolved_path); + +int +win32_rename_replacement(const tchar *oldpath, const tchar *newpath); + +int +win32_truncate_replacement(const tchar *path, off_t size); + +int +win32_strerror_r_replacement(int errnum, tchar *buf, size_t buflen); + +FILE * +win32_open_logfile(const wchar_t *path); + +ssize_t +win32_read(int fd, void *buf, size_t count); + +ssize_t +win32_write(int fd, const void *buf, size_t count); + +ssize_t +win32_pread(int fd, void *buf, size_t count, off_t offset); + +ssize_t +win32_pwrite(int fd, const void *buf, size_t count, off_t offset); + +#endif /* _WIN32 */ + +#endif /* _WIMLIB_WIN32_H */ diff --git a/src/wimlib/wimlib/win32_common.h b/src/wimlib/wimlib/win32_common.h new file mode 100644 index 00000000..46faf6ac --- /dev/null +++ b/src/wimlib/wimlib/win32_common.h @@ -0,0 +1,164 @@ +/* + * win32_common.h - common header for Windows-specific files. This always + * should be included first. + */ + +#ifndef _WIMLIB_WIN32_COMMON_H +#define _WIMLIB_WIN32_COMMON_H + +#include <ntstatus.h> +#include <windows.h> +#include <winternl.h> + +#ifdef ERROR +# undef ERROR +#endif +#include "wimlib/win32.h" + +/* ntdll definitions */ + +#define FILE_OPENED 0x00000001 + +typedef struct _RTLP_CURDIR_REF { + LONG RefCount; + HANDLE Handle; +} RTLP_CURDIR_REF, *PRTLP_CURDIR_REF; + +typedef struct _RTL_RELATIVE_NAME_U { + UNICODE_STRING RelativeName; + HANDLE ContainingDirectory; + PRTLP_CURDIR_REF CurDirRef; +} RTL_RELATIVE_NAME_U, *PRTL_RELATIVE_NAME_U; + +#ifndef FSCTL_SET_PERSISTENT_VOLUME_STATE +#define FSCTL_SET_PERSISTENT_VOLUME_STATE \ + CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 142, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define PERSISTENT_VOLUME_STATE_SHORT_NAME_CREATION_DISABLED 0x00000001 + +typedef struct _FILE_FS_PERSISTENT_VOLUME_INFORMATION { + ULONG VolumeFlags; + ULONG FlagMask; + ULONG Version; + ULONG Reserved; +} FILE_FS_PERSISTENT_VOLUME_INFORMATION, *PFILE_FS_PERSISTENT_VOLUME_INFORMATION; +#endif /* FSCTL_SET_PERSISTENT_VOLUME_STATE */ + +/* ntdll functions */ + +NTSTATUS +NTAPI +NtReadFile(IN HANDLE FileHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID Buffer, + IN ULONG Length, + IN PLARGE_INTEGER ByteOffset OPTIONAL, + IN PULONG Key OPTIONAL); + +NTSTATUS +NTAPI +NtWriteFile(IN HANDLE FileHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN PVOID Buffer, + IN ULONG Length, + IN PLARGE_INTEGER ByteOffset OPTIONAL, + IN PULONG Key OPTIONAL); + +NTSTATUS +NTAPI +NtQueryDirectoryFile(IN HANDLE FileHandle, + IN HANDLE EventHandle OPTIONAL, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID FileInformation, + IN ULONG Length, + IN FILE_INFORMATION_CLASS FileInformationClass, + IN BOOLEAN ReturnSingleEntry, + IN PUNICODE_STRING FileName OPTIONAL, + IN BOOLEAN RestartScan); + +NTSTATUS +NTAPI +NtQuerySecurityObject(IN HANDLE Handle, + IN SECURITY_INFORMATION SecurityInformation, + OUT PSECURITY_DESCRIPTOR SecurityDescriptor, + IN ULONG Length, + OUT PULONG ResultLength); + +NTSTATUS +NTAPI +NtSetSecurityObject(IN HANDLE Handle, + IN SECURITY_INFORMATION SecurityInformation, + IN PSECURITY_DESCRIPTOR SecurityDescriptor); + +NTSTATUS +NTAPI +NtOpenSymbolicLinkObject(PHANDLE LinkHandle, + ACCESS_MASK DesiredAccess, + POBJECT_ATTRIBUTES ObjectAttributes); + +NTSTATUS +NTAPI +NtQueryEaFile(IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID Buffer, + IN ULONG Length, + IN BOOLEAN ReturnSingleEntry, + IN PVOID EaList OPTIONAL, + IN ULONG EaListLength, + IN PULONG EaIndex OPTIONAL, + IN BOOLEAN RestartScan); + +NTSTATUS +NTAPI +NtSetEaFile(IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID Buffer, + IN ULONG Length); + +/* Dynamically loaded ntdll functions */ + +extern NTSTATUS (WINAPI *func_RtlDosPathNameToNtPathName_U_WithStatus) + (IN PCWSTR DosName, + OUT PUNICODE_STRING NtName, + OUT PCWSTR *PartName, + OUT PRTL_RELATIVE_NAME_U RelativeName); + +extern NTSTATUS (WINAPI *func_RtlCreateSystemVolumeInformationFolder) + (PCUNICODE_STRING VolumeRootPath); + +/* Other utility functions */ + +int +win32_path_to_nt_path(const wchar_t *win32_path, UNICODE_STRING *nt_path); + +int +win32_get_drive_path(const wchar_t *file_path, wchar_t drive_path[7]); + +bool +win32_try_to_attach_wof(const wchar_t *drive); + +void __attribute__((cold)) +win32_warning(DWORD err, const wchar_t *format, ...); + +void __attribute__((cold)) +win32_error(DWORD err, const wchar_t *format, ...); + +void __attribute__((cold)) +winnt_warning(NTSTATUS status, const wchar_t *format, ...); + +void __attribute__((cold)) +winnt_error(NTSTATUS status, const wchar_t *format, ...); + +NTSTATUS +winnt_fsctl(HANDLE h, u32 code, const void *in, u32 in_size, + void *out, u32 out_size_avail, u32 *actual_out_size_ret); + +#endif /* _WIMLIB_WIN32_COMMON_H */ diff --git a/src/wimlib/wimlib/win32_vss.h b/src/wimlib/wimlib/win32_vss.h new file mode 100644 index 00000000..54244064 --- /dev/null +++ b/src/wimlib/wimlib/win32_vss.h @@ -0,0 +1,45 @@ +/* + * win32_vss.h - Declarations for managing VSS snapshots. This header should + * only be included by Windows-specific files. + */ + +#ifndef _WIMLIB_WIN32_VSS_H +#define _WIMLIB_WIN32_VSS_H + +#include "wimlib/win32_common.h" + +/* A reference counter for a VSS snapshot. This is embedded in another data + * structure only visible to win32_vss.c. */ +struct vss_snapshot { + size_t refcnt; +}; + +void +vss_delete_snapshot(struct vss_snapshot *snapshot); + +/* Acquire a reference to the specified VSS snapshot. */ +static inline struct vss_snapshot * +vss_get_snapshot(struct vss_snapshot *snapshot) +{ + if (snapshot) + snapshot->refcnt++; + return snapshot; +} + +/* Release a reference to the specified VSS snapshot. When the last reference + * is released, the snapshot is deleted. */ +static inline void +vss_put_snapshot(struct vss_snapshot *snapshot) +{ + if (snapshot && --snapshot->refcnt == 0) + vss_delete_snapshot(snapshot); +} + +int +vss_create_snapshot(const wchar_t *source, UNICODE_STRING *vss_path_ret, + struct vss_snapshot **snapshot_ret); + +void +vss_global_cleanup(void); + +#endif /* _WIMLIB_WIN32_VSS_H */ diff --git a/src/wimlib/wimlib/wof.h b/src/wimlib/wimlib/wof.h new file mode 100644 index 00000000..6f5017be --- /dev/null +++ b/src/wimlib/wimlib/wof.h @@ -0,0 +1,430 @@ +/* + * wof.h + * + * Definitions for the Windows Overlay Filesystem filter (WOF) ioctls, as well + * some definitions for associated undocumented data structures. + * + * Copyright 2022 Eric Biggers + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _WOF_H_ +#define _WOF_H_ + +#include "wimlib/compiler.h" +#include "wimlib/types.h" + +#ifdef _WIN32 + +/* + * The Windows Overlay Filesystem filter (WOF, a.k.a. wof.sys) is a filesystem + * filter driver, available in Windows 8.1 and later, which allows files to be + * "externally backed", meaning that their data is stored in another location, + * possibly in compressed form. + * + * WOF implements a plug-in mechanism by which a specific "provider" is + * responsible for actually externally backing a given file. The currently + * known providers are: + * + * - The WIM provider: allows a file to be externally backed by a + * compressed resource in a WIM archive + * - The file provider: allows a file to be "externally backed" by a named + * data stream stored with the file itself, where that named data stream + * has the format of a compressed WIM resource + * + * For both of these providers, externally backed files are effectively + * read-only. If you try to write to such a file, Windows automatically + * decompresses it and turns it into a regular, non-externally-backed file. + * + * WOF provides various ioctls that control its operation. For example, + * FSCTL_SET_EXTERNAL_BACKING sets up a file as externally backed. + * + * WOF external backings are implemented using reparse points. One consequence + * of this is that WOF external backings can only be set on files that do not + * already have a reparse point set. Another consequence of this is that it is + * possible to create a WOF external backing by manually creating the reparse + * point, although this requires dealing with undocumented data structures and + * it only works when the WOF driver is not currently attached to the volume. + * + * Note that only the unnamed data stream portion of a file can be externally + * backed. Other NTFS streams and metadata are not externally backed. + */ + + +/*----------------------------------------------------------------------------* + * WOF ioctl definitions * + *----------------------------------------------------------------------------*/ + +#ifndef WOF_CURRENT_VERSION +/* Identifies a file backing provider and the overlay service version it supports. + * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/ns-ntifs-_wof_external_info */ +typedef struct _WOF_EXTERNAL_INFO { +#define WOF_CURRENT_VERSION 1 + DWORD Version; + DWORD Provider; +} WOF_EXTERNAL_INFO, *PWOF_EXTERNAL_INFO; +#endif /* WOF_CURRENT_VERSION */ + +/* WIM provider ("WIMBoot") */ +#ifndef WOF_PROVIDER_WIM +#define WOF_PROVIDER_WIM 1 +/* + * The identifier and status information for the Windows Image File (WIM) + * external backing provider. + * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/ns-ntifs-_wim_provider_external_info + */ +typedef struct _WIM_PROVIDER_EXTERNAL_INFO { +#define WIM_PROVIDER_CURRENT_VERSION 1 + ULONG Version; + ULONG Flags; + LARGE_INTEGER DataSourceId; +#define WIM_PROVIDER_HASH_SIZE 20 + UCHAR ResourceHash[WIM_PROVIDER_HASH_SIZE]; +} WIM_PROVIDER_EXTERNAL_INFO, *PWIM_PROVIDER_EXTERNAL_INFO; +#endif /* WOF_PROVIDER_WIM */ + +/* File provider ("system compression") */ +#ifndef WOF_PROVIDER_FILE +#define WOF_PROVIDER_FILE 2 +/* Defines metadata specific to files provided by WOF_PROVIDER_FILE. + * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/ns-ntifs-_file_provider_external_info_v1 */ +typedef struct _FILE_PROVIDER_EXTERNAL_INFO_V1 { +#define FILE_PROVIDER_CURRENT_VERSION 1 + DWORD Version; +#define FILE_PROVIDER_COMPRESSION_XPRESS4K 0 +#define FILE_PROVIDER_COMPRESSION_LZX 1 +#define FILE_PROVIDER_COMPRESSION_XPRESS8K 2 +#define FILE_PROVIDER_COMPRESSION_XPRESS16K 3 + DWORD Algorithm; + DWORD Flags; +} FILE_PROVIDER_EXTERNAL_INFO_V1, *PFILE_PROVIDER_EXTERNAL_INFO_V1; +#endif /* WOF_PROVIDER_FILE */ + +/* Sets the backing source for a file. + * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-set-external-backing */ +#ifndef FSCTL_SET_EXTERNAL_BACKING +#define FSCTL_SET_EXTERNAL_BACKING \ + CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 195, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) +#endif + +/* Gets the backing information for a file from an external backing provider. + * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-get-external-backing */ +#ifndef FSCTL_GET_EXTERNAL_BACKING +#define FSCTL_GET_EXTERNAL_BACKING \ + CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 196, METHOD_BUFFERED, FILE_ANY_ACCESS) +#endif + +#ifndef STATUS_OBJECT_NOT_EXTERNALLY_BACKED +#define STATUS_OBJECT_NOT_EXTERNALLY_BACKED 0xC000046D +#endif + +/* Removes the association of a file with an external backing provider. + * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-delete-external-backing */ +#ifndef FSCTL_DELETE_EXTERNAL_BACKING +#define FSCTL_DELETE_EXTERNAL_BACKING \ + CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 197, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) +#endif + +/* Begins or continues an enumeration of files on a volume that have a backing source. + * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-enum-external-backing */ +#ifndef FSCTL_ENUM_EXTERNAL_BACKING +#define FSCTL_ENUM_EXTERNAL_BACKING \ + CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 198, METHOD_BUFFERED, FILE_ANY_ACCESS) +#endif + +/* Enumerates all the data sources from a backing provider for a specified volume. + * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-enum-overlay */ +#ifndef FSCTL_ENUM_OVERLAY +#define FSCTL_ENUM_OVERLAY \ + CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 199, METHOD_NEITHER, FILE_ANY_ACCESS) +#endif +typedef struct _WIM_PROVIDER_OVERLAY_ENTRY { + ULONG NextEntryOffset; + LARGE_INTEGER DataSourceId; + GUID WimGuid; + ULONG WimFileNameOffset; + ULONG WimType; + ULONG WimIndex; + ULONG Flags; +} WIM_PROVIDER_OVERLAY_ENTRY, *PWIM_PROVIDER_OVERLAY_ENTRY; + +/* Add a new external backing source to a volume's namespace. + * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-add-overlay */ +#ifndef FSCTL_ADD_OVERLAY +#define FSCTL_ADD_OVERLAY \ + CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 204, METHOD_BUFFERED, FILE_WRITE_DATA) +#endif +typedef struct _WIM_PROVIDER_ADD_OVERLAY_INPUT { +#define WIM_BOOT_NOT_OS_WIM 0 +#define WIM_BOOT_OS_WIM 1 + ULONG WimType; + ULONG WimIndex; + ULONG WimFileNameOffset; + ULONG WimFileNameLength; +} WIM_PROVIDER_ADD_OVERLAY_INPUT, *PWIM_PROVIDER_ADD_OVERLAY_INPUT; + +/* Removes a backing source from a volume. + * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-remove-overlay */ +#ifndef FSCTL_REMOVE_OVERLAY +#define FSCTL_REMOVE_OVERLAY \ + CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 205, METHOD_BUFFERED, FILE_WRITE_DATA) +#endif +typedef struct _WIM_PROVIDER_REMOVE_OVERLAY_INPUT { + LARGE_INTEGER DataSourceId; +} WIM_PROVIDER_REMOVE_OVERLAY_INPUT, *PWIM_PROVIDER_REMOVE_OVERLAY_INPUT; + +/* Updates a new data source identifier for a backing source attached to a volume. + * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-update-overlay */ +#ifndef FSCTL_UPDATE_OVERLAY +#define FSCTL_UPDATE_OVERLAY \ + CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 206, METHOD_BUFFERED, FILE_WRITE_DATA) +#endif +typedef struct _WIM_PROVIDER_UPDATE_OVERLAY_INPUT { + LARGE_INTEGER DataSourceId; + ULONG WimFileNameOffset; + ULONG WimFileNameLength; +} WIM_PROVIDER_UPDATE_OVERLAY_INPUT, *PWIM_PROVIDER_UPDATE_OVERLAY_INPUT; + +/*----------------------------------------------------------------------------* + * WOF reparse point and WimOverlay.dat structs (undocumented) * + *----------------------------------------------------------------------------*/ + +/* + * Format of the WIM provider reparse data. This is the data which follows the + * portion of the reparse point common to WOF. (The common portion consists of + * a reparse point header where the reparse tag is 0x80000017, then a + * WOF_EXTERNAL_INFO struct which specifies the provider.) + * + * Note that Microsoft does not document any of the reparse point formats for + * WOF, although they document the structures which must be passed into the + * ioctls, which are often similar. + */ +struct wim_provider_rpdata { + /* Set to 2. Uncertain meaning. */ + le32 version; + + /* 0 when WIM provider active, otherwise + * WIM_PROVIDER_EXTERNAL_FLAG_NOT_ACTIVE or + * WIM_PROVIDER_EXTERNAL_FLAG_SUSPENDED. */ + le32 flags; + + /* Integer ID that identifies the WIM. */ + le64 data_source_id; + + /* SHA-1 message digest of the file's unnamed data stream. */ + u8 unnamed_data_stream_hash[20]; + + /* SHA-1 message digest of the WIM's blob table as stored on disk. */ + u8 blob_table_hash[20]; + + /* Uncompressed size of the file's unnamed data stream, in bytes. */ + le64 unnamed_data_stream_size; + + /* Size of the file's unnamed data stream as stored in the WIM file. + * If this is the same as unnamed_data_stream_size, then the stream is + * uncompressed. If this is the *not* the same as + * unnamed_data_stream_size, then the stream is compressed. */ + le64 unnamed_data_stream_size_in_wim; + + /* Byte offset of the file's unnamed data stream in the WIM. */ + le64 unnamed_data_stream_offset_in_wim; +} __attribute__((packed)); + +/* WIM-specific information about a WIM data source */ +struct WimOverlay_dat_entry_1 { + + /* Identifier for the WIM data source, (normally allocated by + * FSCTL_ADD_OVERLAY). Every 'WimOverlay_dat_entry_1' should have a + * different value for this. */ + le64 data_source_id; + + /* Byte offset, from the beginning of the file, of the corresponding + * 'struct WimOverlay_dat_entry_2' for this WIM data source. */ + le32 entry_2_offset; + + /* Size, in bytes, of the corresponding 'struct WimOverlay_dat_entry_2 + * for this WIM data source, including wim_file_name and its null + * terminator. */ + le32 entry_2_length; + + /* Type of the WIM file: WIM_BOOT_OS_WIM or WIM_BOOT_NOT_OS_WIM. */ + le32 wim_type; + + /* Index of the image in the WIM to use??? (This doesn't really make + * sense, since WIM files combine file data "blobs" for all images into + * a single table. Set to 1 if unsure...) */ + le32 wim_index; + + /* GUID of the WIM file (copied from the WIM header, offset +0x18). */ + u8 guid[16]; +} __attribute__((packed)); + +/* + * Format of file: "\System Volume Information\WimOverlay.dat" + * + * Not documented by Microsoft. + * + * The file consists of a 'struct WimOverlay_dat_header' followed by one or more + * 'struct WimOverlay_dat_entry_1', followed by the same number of 'struct + * WimOverlay_dat_entry_2'. Note that 'struct WimOverlay_dat_entry_1' is of + * fixed length, whereas 'struct WimOverlay_dat_entry_2' is of variable length. + */ +struct WimOverlay_dat_header { + /* Set to WIMOVERLAY_DAT_MAGIC */ + le32 magic; +#define WIMOVERLAY_DAT_MAGIC 0x66436F57 + + /* Set to 1 (WIM_PROVIDER_CURRENT_VERSION) */ + le32 wim_provider_version; + + /* Set to 0x00000028 */ + le32 unknown_0x08; + + /* Set to number of WIMs registered (listed in the file) */ + le32 num_entries; + + /* The next available data source ID. This is tracked so that data + * source IDs are never reused, even if a WIM is unregistered. */ + le64 next_data_source_id; + + struct WimOverlay_dat_entry_1 entry_1s[]; +} __attribute__((packed)); + +/* Location information about a WIM data source */ +struct WimOverlay_dat_entry_2 { + /* Set to 0 */ + le32 unknown_0x00; + + /* Set to 0 */ + le32 unknown_0x04; + + /* Size, in bytes, of this 'struct WimOverlay_dat_entry_2', including + * wim_file_name and its null terminator. */ + le32 entry_2_length; + + /* Set to 0 */ + le32 unknown_0x0C; + + /* Set to 5 */ + le32 unknown_0x10; + + struct { + /* Set to 1 */ + le32 unknown_0x14; + + /* Size of this inner structure, in bytes. */ + le32 inner_struct_size; + + /* Set to 5 */ + le32 unknown_0x1C; + + /* Set to 6 */ + le32 unknown_0x20; + + /* Set to 0 */ + le32 unknown_0x24; + + /* Set to 0x48 */ + le32 unknown_0x28; + + /* Set to 0 */ + le32 unknown_0x2C; + + /************************* + * Partition information + ************************/ + + /* Partition identifier */ + union { + /* (For MBR-formatted disks) */ + struct { + /* Offset, in bytes, of the MBR partition, from + * the beginning of the disk. */ + le64 part_start_offset; + + /* Set to 0 */ + le64 padding; + } mbr; + + /* (For GPT-formatted disks) */ + struct { + /* Unique GUID of the GPT partition */ + u8 part_unique_guid[16]; + } gpt; + } partition; + + /* Set to 0 */ + le32 unknown_0x40; + + /*********************** + * Disk information + **********************/ + + /* 1 for MBR, 0 for GPT */ + le32 partition_table_type; + #define WIMOVERLAY_PARTITION_TYPE_MBR 1 + #define WIMOVERLAY_PARTITION_TYPE_GPT 0 + + /* Disk identifier */ + union { + /* (For MBR-formatted disks) */ + struct { + /* 4-byte ID of the MBR disk */ + le32 disk_id; + + /* Set to 0 */ + le32 padding[3]; + } mbr; + + /* (For GPT-formatted disks) */ + struct { + /* GUID of the GPT disk */ + u8 disk_guid[16]; + } gpt; + } disk; + + /* Set to 0. (This is the right size for some sort of optional + * GUID...) */ + le32 unknown_0x58[4]; + + /************************** + * Location in filesystem + *************************/ + + /* Null-terminated path to WIM file. Begins with \ but does + * *not* include drive letter! */ + utf16lechar wim_file_name[]; + } __attribute__((packed)); +} __attribute__((packed)); + +static void __attribute__((unused)) +wof_check_structs(void) +{ + STATIC_ASSERT(sizeof(struct WimOverlay_dat_header) == 24); + STATIC_ASSERT(sizeof(struct WimOverlay_dat_entry_1) == 40); + STATIC_ASSERT(sizeof(struct WimOverlay_dat_entry_2) == 104); +} + +#endif /* _WIN32 */ + +#endif /* _WOF_H_ */ diff --git a/src/wimlib/wimlib/write.h b/src/wimlib/wimlib/write.h new file mode 100644 index 00000000..605b10de --- /dev/null +++ b/src/wimlib/wimlib/write.h @@ -0,0 +1,76 @@ +#ifndef _WIMLIB_WRITE_H +#define _WIMLIB_WRITE_H + +#include "wimlib.h" +#include "wimlib/types.h" + +/* Internal use only */ +#define WIMLIB_WRITE_FLAG_FILE_DESCRIPTOR 0x80000000 +#define WIMLIB_WRITE_FLAG_APPEND 0x40000000 +#define WIMLIB_WRITE_FLAG_NO_NEW_BLOBS 0x20000000 +#define WIMLIB_WRITE_FLAG_USE_EXISTING_TOTALBYTES 0x10000000 +#define WIMLIB_WRITE_FLAG_NO_METADATA 0x08000000 + +/* Keep in sync with wimlib.h */ +#define WIMLIB_WRITE_MASK_PUBLIC ( \ + WIMLIB_WRITE_FLAG_CHECK_INTEGRITY | \ + WIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY | \ + WIMLIB_WRITE_FLAG_PIPABLE | \ + WIMLIB_WRITE_FLAG_NOT_PIPABLE | \ + WIMLIB_WRITE_FLAG_RECOMPRESS | \ + WIMLIB_WRITE_FLAG_FSYNC | \ + WIMLIB_WRITE_FLAG_REBUILD | \ + WIMLIB_WRITE_FLAG_SOFT_DELETE | \ + WIMLIB_WRITE_FLAG_IGNORE_READONLY_FLAG | \ + WIMLIB_WRITE_FLAG_SKIP_EXTERNAL_WIMS | \ + WIMLIB_WRITE_FLAG_STREAMS_OK | \ + WIMLIB_WRITE_FLAG_RETAIN_GUID | \ + WIMLIB_WRITE_FLAG_SOLID | \ + WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES | \ + WIMLIB_WRITE_FLAG_NO_SOLID_SORT | \ + WIMLIB_WRITE_FLAG_UNSAFE_COMPACT) + +#if defined(HAVE_SYS_FILE_H) && defined(HAVE_FLOCK) +int +lock_wim_for_append(WIMStruct *wim); +void +unlock_wim_for_append(WIMStruct *wim); +#else +static inline int +lock_wim_for_append(WIMStruct *wim) +{ + return 0; +} +static inline void +unlock_wim_for_append(WIMStruct *wim) +{ +} +#endif + +struct filedes; +struct list_head; +struct wim_reshdr; + +int +write_wim_part(WIMStruct *wim, + const void *path_or_fd, + int image, + int write_flags, + unsigned num_threads, + unsigned part_number, + unsigned total_parts, + struct list_head *blob_list_override, + const u8 *guid); + +int +write_wim_resource_from_buffer(const void *buf, + size_t buf_size, + bool is_metadata, + struct filedes *out_fd, + int out_ctype, + u32 out_chunk_size, + struct wim_reshdr *out_reshdr, + u8 *hash_ret, + int write_resource_flags); + +#endif /* _WIMLIB_WRITE_H */ diff --git a/src/wimlib/wimlib/xattr.h b/src/wimlib/wimlib/xattr.h new file mode 100644 index 00000000..074fed9d --- /dev/null +++ b/src/wimlib/wimlib/xattr.h @@ -0,0 +1,200 @@ +#ifndef _WIMLIB_XATTR_H +#define _WIMLIB_XATTR_H + +#include <string.h> + +#include "wimlib/endianness.h" +#include "wimlib/tagged_items.h" +#include "wimlib/util.h" + +#undef HAVE_LINUX_XATTR_SUPPORT +#if defined(HAVE_SYS_XATTR_H) && \ + defined(HAVE_LLISTXATTR) && defined(HAVE_LGETXATTR) && \ + defined(HAVE_FSETXATTR) && defined(HAVE_LSETXATTR) +# define HAVE_LINUX_XATTR_SUPPORT 1 +#endif + +#define WIM_XATTR_NAME_MAX 255 +#define WIM_XATTR_SIZE_MAX 65535 + +/* + * On-disk format of each extended attribute (xattr, or EA) entry in a metadata + * item tagged with TAG_XATTRS. This is the preferred xattr format, since it is + * also used by WIMGAPI and DISM starting in Windows 10 version 1607. + */ +struct wim_xattr_entry { + + /* length of xattr value in bytes */ + le16 value_len; + + /* length of xattr name in bytes, excluding the null terminator */ + u8 name_len; + + /* flags: 0 or 0x80 (FILE_NEED_EA) */ + u8 flags; + + /* followed by the xattr name *with* a null terminator */ + char name[0]; + + /* followed by the xattr value */ + /* u8 value[0]; */ + + /* no padding at end! */ +} __attribute__((packed)); + +static inline size_t +xattr_entry_size(const struct wim_xattr_entry *entry) +{ + STATIC_ASSERT(sizeof(*entry) == 4); + + return sizeof(*entry) + entry->name_len + 1 + + le16_to_cpu(entry->value_len); +} + +/* minimum is a 1-byte name (plus null terminator) and an empty value */ +#define XATTR_ENTRY_MIN_SIZE (sizeof(struct wim_xattr_entry) + 2) + +static inline struct wim_xattr_entry * +xattr_entry_next(const struct wim_xattr_entry *entry) +{ + return (void *)entry + xattr_entry_size(entry); +} + +static inline bool +valid_xattr_entry(const struct wim_xattr_entry *entry, size_t avail) +{ + if (avail < sizeof(*entry)) + return false; + + return entry->name_len > 0 && entry->name_len <= WIM_XATTR_NAME_MAX && + le16_to_cpu(entry->value_len) <= WIM_XATTR_SIZE_MAX && + avail >= xattr_entry_size(entry) && + memchr(entry->name, '\0', entry->name_len) == NULL && + entry->name[entry->name_len] == '\0'; +} + +/* + * On-disk format of each extended attribute entry in a metadata item tagged + * with TAG_WIMLIB_LINUX_XATTRS. This is a deprecated format which wimlib + * v1.11-v1.12 used to store extended attributes on Linux (predating the Windows + * xattr support in both WIMGAPI and wimlib). Now we use TAG_XATTRS for both + * Windows and Linux xattrs. + */ +struct wimlib_xattr_entry_old { + + /* length of xattr name in bytes, excluding a null terminator */ + le16 name_len; + + /* reserved, must be 0 */ + le16 reserved; + + /* length of xattr value in bytes */ + le32 value_len; + + /* followed by the xattr name *without* a null terminator */ + char name[0]; + + /* followed by the xattr value */ + /* u8 value[0]; */ + + /* then zero-padded to a 4-byte boundary */ +} __attribute__((aligned(4))); + +static inline size_t +old_xattr_entry_size(const struct wimlib_xattr_entry_old *entry) +{ + STATIC_ASSERT(sizeof(*entry) == 8); + + return ALIGN(sizeof(*entry) + le16_to_cpu(entry->name_len) + + le32_to_cpu(entry->value_len), 4); +} + +/* minimum is a 1-byte name and an empty value */ +#define OLD_XATTR_ENTRY_MIN_SIZE \ + (ALIGN(sizeof(struct wimlib_xattr_entry_old) + 1, 4)) + +static inline struct wimlib_xattr_entry_old * +old_xattr_entry_next(const struct wimlib_xattr_entry_old *entry) +{ + return (void *)entry + old_xattr_entry_size(entry); +} + +static inline bool +old_valid_xattr_entry(const struct wimlib_xattr_entry_old *entry, size_t avail) +{ + u16 name_len; + + if (avail < sizeof(*entry)) + return false; + + name_len = le16_to_cpu(entry->name_len); + return name_len > 0 && name_len <= WIM_XATTR_NAME_MAX && + le32_to_cpu(entry->value_len) <= WIM_XATTR_SIZE_MAX && + avail >= old_xattr_entry_size(entry) && + memchr(entry->name, '\0', name_len) == NULL; +} + +/* Is the xattr of the specified name security-related on Linux? */ +static inline bool +is_linux_security_xattr(const char *name) +{ +#define XATTR_SECURITY_PREFIX "security." +#define XATTR_SYSTEM_PREFIX "system." +#define XATTR_POSIX_ACL_ACCESS "posix_acl_access" +#define XATTR_NAME_POSIX_ACL_ACCESS XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_ACCESS +#define XATTR_POSIX_ACL_DEFAULT "posix_acl_default" +#define XATTR_NAME_POSIX_ACL_DEFAULT XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_DEFAULT + + return !strncmp(name, XATTR_SECURITY_PREFIX, + sizeof(XATTR_SECURITY_PREFIX) - 1) || + !strcmp(name, XATTR_NAME_POSIX_ACL_ACCESS) || + !strcmp(name, XATTR_NAME_POSIX_ACL_DEFAULT); +} + +static inline const void * +inode_get_xattrs(const struct wim_inode *inode, u32 *len_ret) +{ + return inode_get_tagged_item(inode, TAG_XATTRS, + XATTR_ENTRY_MIN_SIZE, len_ret); +} + +static inline const void * +inode_get_xattrs_old(const struct wim_inode *inode, u32 *len_ret) +{ + return inode_get_tagged_item(inode, TAG_WIMLIB_LINUX_XATTRS, + OLD_XATTR_ENTRY_MIN_SIZE, len_ret); +} + +static inline const void * +inode_get_linux_xattrs(const struct wim_inode *inode, u32 *len_ret, + bool *is_old_format_ret) +{ + const void *entries; + + entries = inode_get_xattrs(inode, len_ret); + if (entries) { + *is_old_format_ret = false; + return entries; + } + entries = inode_get_xattrs_old(inode, len_ret); + if (entries) { + *is_old_format_ret = true; + return entries; + } + return NULL; +} + +static inline bool +inode_has_xattrs(const struct wim_inode *inode) +{ + return inode_get_xattrs(inode, NULL) != NULL || + inode_get_xattrs_old(inode, NULL) != NULL; +} + +static inline bool +inode_set_xattrs(struct wim_inode *inode, const void *entries, u32 len) +{ + return inode_set_tagged_item(inode, TAG_XATTRS, entries, len); +} + +#endif /* _WIMLIB_XATTR_H */ diff --git a/src/wimlib/wimlib/xml.h b/src/wimlib/wimlib/xml.h new file mode 100644 index 00000000..c11138c9 --- /dev/null +++ b/src/wimlib/wimlib/xml.h @@ -0,0 +1,74 @@ +#ifndef _WIMLIB_XML_H +#define _WIMLIB_XML_H + +#include "wimlib/types.h" + +/*****************************************************************************/ + +struct wim_xml_info; + +struct wim_xml_info * +xml_new_info_struct(void); + +void +xml_free_info_struct(struct wim_xml_info *info); + +/*****************************************************************************/ + +int +xml_get_image_count(const struct wim_xml_info *info); + +u64 +xml_get_total_bytes(const struct wim_xml_info *info); + +u64 +xml_get_image_total_bytes(const struct wim_xml_info *info, int image); + +u64 +xml_get_image_hard_link_bytes(const struct wim_xml_info *info, int image); + +bool +xml_get_wimboot(const struct wim_xml_info *info, int image); + +u64 +xml_get_windows_build_number(const struct wim_xml_info *info, int image); + +int +xml_set_wimboot(struct wim_xml_info *info, int image); + +/*****************************************************************************/ + +int +xml_update_image_info(WIMStruct *wim, int image); + +int +xml_add_image(struct wim_xml_info *info, const tchar *name); + +int +xml_export_image(const struct wim_xml_info *src_info, int src_image, + struct wim_xml_info *dest_info, const tchar *dest_image_name, + const tchar *dest_image_description, bool wimboot); + +void +xml_delete_image(struct wim_xml_info *info, int image); + + +void +xml_print_image_info(struct wim_xml_info *info, int image); + +/*****************************************************************************/ + +struct wim_reshdr; + +#define WIM_TOTALBYTES_USE_EXISTING ((u64)(-1)) +#define WIM_TOTALBYTES_OMIT ((u64)(-2)) + +int +read_wim_xml_data(WIMStruct *wim); + +int +write_wim_xml_data(WIMStruct *wim, int image, + u64 total_bytes, struct wim_reshdr *out_reshdr, + int write_resource_flags); + +#endif /* _WIMLIB_XML_H */ diff --git a/src/wimlib/wimlib/xml_windows.h b/src/wimlib/wimlib/xml_windows.h new file mode 100644 index 00000000..203e79d0 --- /dev/null +++ b/src/wimlib/wimlib/xml_windows.h @@ -0,0 +1,9 @@ +#ifndef _WIMLIB_XML_WINDOWS_H +#define _WIMLIB_XML_WINDOWS_H + +#include "wimlib/types.h" + +int +set_windows_specific_info(WIMStruct *wim); + +#endif /* _WIMLIB_XML_WINDOWS_H */ diff --git a/src/wimlib/wimlib/xmlproc.h b/src/wimlib/wimlib/xmlproc.h new file mode 100644 index 00000000..c202d629 --- /dev/null +++ b/src/wimlib/wimlib/xmlproc.h @@ -0,0 +1,91 @@ +#ifndef _WIMLIB_XMLPROC_H +#define _WIMLIB_XMLPROC_H + +#include "wimlib/list.h" +#include "wimlib/types.h" + +/*****************************************************************************/ + +enum xml_node_type { + XML_ELEMENT_NODE, + XML_TEXT_NODE, + XML_ATTRIBUTE_NODE, +}; + +struct xml_node { + enum xml_node_type type; /* type of node */ + tchar *name; /* name of ELEMENT or ATTRIBUTE */ + tchar *value; /* value of TEXT or ATTRIBUTE */ + struct xml_node *parent; /* parent, or NULL if none */ + struct list_head children; /* children; only used for ELEMENT */ + struct list_head sibling_link; +}; + +/* Iterate through the children of an xml_node. Does nothing if passed NULL. */ +#define xml_node_for_each_child(parent, child) \ + if (parent) list_for_each_entry(child, &(parent)->children, sibling_link) + +static inline bool +xml_node_is_element(const struct xml_node *node, const tchar *name) +{ + return node->type == XML_ELEMENT_NODE && !tstrcmp(node->name, name); +} + +struct xml_node * +xml_new_element(struct xml_node *parent, const tchar *name); + +struct xml_node * +xml_new_element_with_text(struct xml_node *parent, const tchar *name, + const tchar *text); + +void +xml_add_child(struct xml_node *parent, struct xml_node *child); + +void +xml_unlink_node(struct xml_node *node); + +void +xml_free_node(struct xml_node *node); + +const tchar * +xml_element_get_text(const struct xml_node *element); + +int +xml_element_set_text(struct xml_node *element, const tchar *text); + +struct xml_node * +xml_get_attrib(const struct xml_node *element, const tchar *name); + +int +xml_set_attrib(struct xml_node *element, const tchar *name, const tchar *value); + +void +xml_replace_child(struct xml_node *parent, struct xml_node *replacement); + +struct xml_node * +xml_clone_tree(struct xml_node *orig); + +bool +xml_legal_path(const tchar *name); + +bool +xml_legal_value(const tchar *value); + +/*****************************************************************************/ + +int +xml_parse_document(const tchar *raw_doc, struct xml_node **doc_ret); + +/*****************************************************************************/ + +struct xml_out_buf { + tchar *buf; + size_t count; + size_t capacity; + bool oom; +}; + +int +xml_write_document(struct xml_node *doc, struct xml_out_buf *buf); + +#endif /* _WIMLIB_XMLPROC_H */ diff --git a/src/wimlib/wimlib/xpress_constants.h b/src/wimlib/wimlib/xpress_constants.h new file mode 100644 index 00000000..9a8ba2c2 --- /dev/null +++ b/src/wimlib/wimlib/xpress_constants.h @@ -0,0 +1,22 @@ +/* + * xpress_constants.h + * + * Constants for the XPRESS compression format. + */ + +#ifndef _XPRESS_CONSTANTS_H +#define _XPRESS_CONSTANTS_H + +#define XPRESS_NUM_CHARS 256 +#define XPRESS_NUM_SYMBOLS 512 +#define XPRESS_MAX_CODEWORD_LEN 15 + +#define XPRESS_END_OF_DATA 256 + +#define XPRESS_MIN_OFFSET 1 +#define XPRESS_MAX_OFFSET 65535 + +#define XPRESS_MIN_MATCH_LEN 3 +#define XPRESS_MAX_MATCH_LEN 65538 + +#endif /* _XPRESS_CONSTANTS_H */ diff --git a/src/wimlib/wimlib_tchar.h b/src/wimlib/wimlib_tchar.h new file mode 100644 index 00000000..781f370c --- /dev/null +++ b/src/wimlib/wimlib_tchar.h @@ -0,0 +1,134 @@ +#ifndef _WIMLIB_TCHAR_H +#define _WIMLIB_TCHAR_H + +/* Functions to act on "tchar" strings, which have a platform-dependent encoding + * and character size. */ + +#ifdef _WIN32 +#include <wchar.h> +/* + * For Windows builds, the "tchar" type will be 2 bytes and will be equivalent + * to "wchar_t" and "utf16lechar". All indicate one coding unit of a string + * encoded in UTF-16LE with the additional possibility of unpaired surrogates. + */ +typedef wchar_t tchar; +# define TCHAR_IS_UTF16LE 1 +# define _T(text) L##text +# define T(text) _T(text) /* Make a string literal into a wide string */ +# define TS "ls" /* Format a string of "tchar" */ +# define TC "lc" /* Format a "tchar" */ + +/* For Windows builds, the following definitions replace the "tchar" functions + * with the "wide-character" functions. */ +# define tmemchr wmemchr +# define tmemcpy wmemcpy +# define tmemmove wmemmove +# define tmempcpy wmempcpy +# define tstrcat wcscat +# define tstrcpy wcscpy +# define tprintf wprintf +# define tsprintf swprintf +# define tfprintf fwprintf +# define tvfprintf vfwprintf +# define tscanf swscanf +# define istalpha(c) iswalpha((wchar_t)(c)) +# define istspace(c) iswspace((wchar_t)(c)) +# define totlower(c) towlower((wchar_t)(c)) +# define tstrcmp wcscmp +# define tstrncmp wcsncmp +# define tstrchr wcschr +# define tstrpbrk wcspbrk +# define tstrrchr wcsrchr +# define tstrstr wcsstr +# define tstrlen wcslen +# define tmemcmp wmemcmp +# define tstrcasecmp _wcsicmp +# define tstrftime wcsftime +# define tputchar putwchar +# define tputc putwc +# define tputs _putws +# define tfputs fputws +# define tfopen _wfopen +# define topen _wopen +# define tstat _wstati64 +# define tstrtol wcstol +# define tstrtod wcstod +# define tstrtoul wcstoul +# define tstrtoull wcstoull +# define tunlink _wunlink +# define tstrerror _wcserror +# define taccess _waccess +# define tstrdup wcsdup +# define tgetenv _wgetenv +/* The following "tchar" functions do not have exact wide-character equivalents + * on Windows so require parameter rearrangement or redirection to a replacement + * function defined ourselves. */ +# define TSTRDUP WCSDUP +# define tmkdir(path, mode) _wmkdir(path) +# define tstrerror_r(errnum, buf, bufsize) \ + _wcserror_s((buf), (bufsize), (errnum)) +# define trename win32_rename_replacement +# define tglob win32_wglob +#else /* _WIN32 */ +/* + * For non-Windows builds, the "tchar" type will be one byte and will specify a + * string encoded in UTF-8 with the additional possibility of surrogate + * codepoints. + */ +typedef char tchar; +# define TCHAR_IS_UTF16LE 0 +# define T(text) text /* In this case, strings of "tchar" are simply strings of + char */ +# define TS "s" /* Similarly, a string of "tchar" is printed just as a + normal string. */ +# define TC "c" /* Print a single character */ +/* For non-Windows builds, replace the "tchar" functions with the regular old + * string functions. */ +# define tmemchr memchr +# define tmemcpy memcpy +# define tmemmove memmove +# define tmempcpy mempcpy +# define tstrcat strcat +# define tstrcpy strcpy +# define tprintf printf +# define tsprintf sprintf +# define tfprintf fprintf +# define tvfprintf vfprintf +# define tscanf sscanf +# define istalpha(c) isalpha((unsigned char)(c)) +# define istspace(c) isspace((unsigned char)(c)) +# define totlower(c) tolower((unsigned char)(c)) +# define tstrcmp strcmp +# define tstrncmp strncmp +# define tstrchr strchr +# define tstrpbrk strpbrk +# define tstrrchr strrchr +# define tstrstr strstr +# define tstrlen strlen +# define tmemcmp memcmp +# define tstrcasecmp strcasecmp +# define tstrftime strftime +# define tputchar putchar +# define tputc putc +# define tputs puts +# define tfputs fputs +# define tfopen fopen +# define topen open +# define tstat stat +# define tunlink unlink +# define tstrerror strerror +# define tstrtol strtol +# define tstrtod strtod +# define tstrtoul strtoul +# define tstrtoull strtoull +# define tmkdir mkdir +# define tstrdup strdup +# define tgetenv getenv +# define TSTRDUP STRDUP +# define tstrerror_r strerror_r +# define trename rename +# define taccess access +# define tglob glob +#endif /* !_WIN32 */ + +#endif /* _WIMLIB_TCHAR_H */ diff --git a/src/wimlib/win32_apply.c b/src/wimlib/win32_apply.c new file mode 100644 index 00000000..e493ecfe --- /dev/null +++ b/src/wimlib/win32_apply.c @@ -0,0 +1,3362 @@ +/* + * win32_apply.c - Windows-specific code for applying files from a WIM image. + */ + +/* + * Copyright 2013-2023 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef _WIN32 + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/win32_common.h" + +#include "wimlib/apply.h" +#include "wimlib/assert.h" +#include "wimlib/blob_table.h" +#include "wimlib/dentry.h" +#include "wimlib/encoding.h" +#include "wimlib/error.h" +#include "wimlib/metadata.h" +#include "wimlib/object_id.h" +#include "wimlib/paths.h" +#include "wimlib/pattern.h" +#include "wimlib/reparse.h" +#include "wimlib/scan.h" /* for mangle_pat() and match_pattern_list() */ +#include "wimlib/textfile.h" +#include "wimlib/wimboot.h" +#include "wimlib/wof.h" +#include "wimlib/xattr.h" +#include "wimlib/xml.h" + +struct win32_apply_ctx { + + /* Extract flags, the pointer to the WIMStruct, etc. */ + struct apply_ctx common; + + /* WIMBoot information, only filled in if WIMLIB_EXTRACT_FLAG_WIMBOOT + * was provided */ + struct { + /* This array contains the WIM files registered with WOF on the + * target volume for this extraction operation. All WIMStructs + * in this array are distinct and have ->filename != NULL. */ + struct wimboot_wim { + WIMStruct *wim; + u64 data_source_id; + u8 blob_table_hash[SHA1_HASH_SIZE]; + } *wims; + size_t num_wims; + bool wof_running; + bool have_wrong_version_wims; + bool have_uncompressed_wims; + bool have_unsupported_compressed_resources; + bool have_huge_resources; + } wimboot; + + /* External backing information */ + struct string_list *prepopulate_pats; + void *mem_prepopulate_pats; + bool tried_to_load_prepopulate_list; + + /* Open handle to the target directory */ + HANDLE h_target; + + /* NT namespace path to the target directory (buffer allocated) */ + UNICODE_STRING target_ntpath; + + /* Temporary buffer for building paths (buffer allocated) */ + UNICODE_STRING pathbuf; + + /* Object attributes to reuse for opening files in the target directory. + * (attr.ObjectName == &pathbuf) and (attr.RootDirectory == h_target). + */ + OBJECT_ATTRIBUTES attr; + + /* Temporary I/O status block for system calls */ + IO_STATUS_BLOCK iosb; + + /* Allocated buffer for creating "printable" paths from our + * target-relative NT paths */ + wchar_t *print_buffer; + + /* Allocated buffer for reading blob data when it cannot be extracted + * directly */ + u8 *data_buffer; + + /* Pointer to the next byte in @data_buffer to fill */ + u8 *data_buffer_ptr; + + /* Size allocated in @data_buffer */ + size_t data_buffer_size; + + /* Current offset in the raw encrypted file being written */ + size_t encrypted_offset; + + /* Current size of the raw encrypted file being written */ + size_t encrypted_size; + + /* Temporary buffer for reparse data */ + struct reparse_buffer_disk rpbuf; + + /* Temporary buffer for reparse data of "fixed" absolute symbolic links + * and junctions */ + struct reparse_buffer_disk rpfixbuf; + + /* Array of open handles to filesystem streams currently being written + */ + HANDLE open_handles[MAX_OPEN_FILES]; + + /* Number of handles in @open_handles currently open (filled in from the + * beginning of the array) */ + unsigned num_open_handles; + + /* For each currently open stream, whether we're writing to it in + * "sparse" mode or not. */ + bool is_sparse_stream[MAX_OPEN_FILES]; + + /* Whether is_sparse_stream[] is true for any currently open stream */ + bool any_sparse_streams; + + /* List of dentries, joined by @d_tmp_list, that need to have reparse + * data extracted as soon as the whole blob has been read into + * @data_buffer. */ + struct list_head reparse_dentries; + + /* List of dentries, joined by @d_tmp_list, that need to have raw + * encrypted data extracted as soon as the whole blob has been read into + * @data_buffer. */ + struct list_head encrypted_dentries; + + /* Number of files for which we didn't have permission to set the full + * security descriptor. */ + unsigned long partial_security_descriptors; + + /* Number of files for which we didn't have permission to set any part + * of the security descriptor. */ + unsigned long no_security_descriptors; + + /* Number of files for which we couldn't set the short name. */ + unsigned long num_set_short_name_failures; + + /* Number of files for which we couldn't remove the short name. */ + unsigned long num_remove_short_name_failures; + + /* Number of files on which we couldn't set System Compression. */ + unsigned long num_system_compression_failures; + + /* The number of files which, for compatibility with the Windows + * bootloader, were not compressed using the requested system + * compression format. This includes matches with the hardcoded pattern + * list only; it does not include matches with patterns in + * [PrepopulateList]. */ + unsigned long num_system_compression_exclusions; + + /* Number of files for which we couldn't set the object ID. */ + unsigned long num_object_id_failures; + + /* Number of files for which we couldn't set extended attributes. */ + unsigned long num_xattr_failures; + + /* The Windows build number of the image being applied, or 0 if unknown. + */ + u64 windows_build_number; + + /* Have we tried to enable short name support on the target volume yet? + */ + bool tried_to_enable_short_names; +}; + +/* Get the drive letter from a Windows path, or return the null character if the + * path is relative. */ +static wchar_t +get_drive_letter(const wchar_t *path) +{ + /* Skip \\?\ prefix */ + if (!wcsncmp(path, L"\\\\?\\", 4)) + path += 4; + + /* Return drive letter if valid */ + if (((path[0] >= L'a' && path[0] <= L'z') || + (path[0] >= L'A' && path[0] <= L'Z')) && path[1] == L':') + return path[0]; + + return L'\0'; +} + +static void +get_vol_flags(const wchar_t *target, DWORD *vol_flags_ret, + bool *short_names_supported_ret) +{ + wchar_t filesystem_name[MAX_PATH + 1]; + wchar_t drive[4]; + wchar_t *volume = NULL; + + *vol_flags_ret = 0; + *short_names_supported_ret = false; + + drive[0] = get_drive_letter(target); + if (drive[0]) { + drive[1] = L':'; + drive[2] = L'\\'; + drive[3] = L'\0'; + volume = drive; + } + + if (!GetVolumeInformation(volume, NULL, 0, NULL, NULL, + vol_flags_ret, filesystem_name, + ARRAY_LEN(filesystem_name))) + { + win32_warning(GetLastError(), + L"Failed to get volume information for \"%ls\"", + target); + return; + } + + if (wcsstr(filesystem_name, L"NTFS")) { + /* + * FILE_SUPPORTS_HARD_LINKS and + * FILE_SUPPORTS_EXTENDED_ATTRIBUTES are only supported on + * Windows 7 and later. Force them on anyway if the filesystem + * is NTFS. + */ + *vol_flags_ret |= FILE_SUPPORTS_HARD_LINKS; + *vol_flags_ret |= FILE_SUPPORTS_EXTENDED_ATTRIBUTES; + + /* There's no volume flag for short names, but according to the + * MS documentation they are only user-settable on NTFS. */ + *short_names_supported_ret = true; + } +} + +static const wchar_t * +current_path(struct win32_apply_ctx *ctx); + +static void +build_extraction_path(const struct wim_dentry *dentry, + struct win32_apply_ctx *ctx); + +static int +report_dentry_apply_error(const struct wim_dentry *dentry, + struct win32_apply_ctx *ctx, int ret) +{ + build_extraction_path(dentry, ctx); + return report_apply_error(&ctx->common, ret, current_path(ctx)); +} + +static inline int +check_apply_error(const struct wim_dentry *dentry, + struct win32_apply_ctx *ctx, int ret) +{ + if (unlikely(ret)) + ret = report_dentry_apply_error(dentry, ctx, ret); + return ret; +} + +static int +win32_get_supported_features(const wchar_t *target, + struct wim_features *supported_features) +{ + DWORD vol_flags; + bool short_names_supported; + + /* Query the features of the target volume. */ + + get_vol_flags(target, &vol_flags, &short_names_supported); + + supported_features->readonly_files = 1; + supported_features->hidden_files = 1; + supported_features->system_files = 1; + supported_features->archive_files = 1; + + if (vol_flags & FILE_FILE_COMPRESSION) + supported_features->compressed_files = 1; + + if (vol_flags & FILE_SUPPORTS_ENCRYPTION) { + supported_features->encrypted_files = 1; + supported_features->encrypted_directories = 1; + } + + supported_features->not_context_indexed_files = 1; + + if (vol_flags & FILE_SUPPORTS_SPARSE_FILES) + supported_features->sparse_files = 1; + + if (vol_flags & FILE_NAMED_STREAMS) + supported_features->named_data_streams = 1; + + if (vol_flags & FILE_SUPPORTS_HARD_LINKS) + supported_features->hard_links = 1; + + if (vol_flags & FILE_SUPPORTS_REPARSE_POINTS) + supported_features->reparse_points = 1; + + if (vol_flags & FILE_PERSISTENT_ACLS) + supported_features->security_descriptors = 1; + + if (short_names_supported) + supported_features->short_names = 1; + + if (vol_flags & FILE_SUPPORTS_OBJECT_IDS) + supported_features->object_ids = 1; + + supported_features->timestamps = 1; + + if (vol_flags & FILE_CASE_SENSITIVE_SEARCH) { + /* + * The filesystem supports case-sensitive filenames. But does + * the operating system as well? This normally requires the + * registry setting ObCaseInsensitive=0. We can test it + * indirectly by attempting to open the "\SystemRoot" symbolic + * link using a name with the wrong case. If we get + * STATUS_OBJECT_NAME_NOT_FOUND instead of STATUS_ACCESS_DENIED, + * then case-sensitive names must be enabled. + */ + UNICODE_STRING path; + OBJECT_ATTRIBUTES attr; + HANDLE h; + NTSTATUS status; + + RtlInitUnicodeString(&path, L"\\systemroot"); + InitializeObjectAttributes(&attr, &path, 0, NULL, NULL); + + status = NtOpenSymbolicLinkObject(&h, 0, &attr); + if (status == STATUS_OBJECT_NAME_NOT_FOUND) + supported_features->case_sensitive_filenames = 1; + } + + if (vol_flags & FILE_SUPPORTS_EXTENDED_ATTRIBUTES) + supported_features->xattrs = 1; + + return 0; +} + +#define COMPACT_FLAGS (WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K | \ + WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K | \ + WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K | \ + WIMLIB_EXTRACT_FLAG_COMPACT_LZX) + + + +/* + * If not done already, load the patterns from the [PrepopulateList] section of + * WimBootCompress.ini in the WIM image being extracted. + * + * Note: WimBootCompress.ini applies to both types of "external backing": + * + * - WIM backing ("WIMBoot" - Windows 8.1 and later) + * - File backing ("System Compression" - Windows 10 and later) + */ +static int +load_prepopulate_pats(struct win32_apply_ctx *ctx) +{ + const wchar_t *path = L"\\Windows\\System32\\WimBootCompress.ini"; + struct wim_dentry *dentry; + const struct blob_descriptor *blob; + int ret; + void *buf; + struct string_list *strings; + void *mem; + struct text_file_section sec; + + if (ctx->tried_to_load_prepopulate_list) + return 0; + + ctx->tried_to_load_prepopulate_list = true; + + dentry = get_dentry(ctx->common.wim, path, WIMLIB_CASE_INSENSITIVE); + if (!dentry || + (dentry->d_inode->i_attributes & (FILE_ATTRIBUTE_DIRECTORY | + FILE_ATTRIBUTE_REPARSE_POINT | + FILE_ATTRIBUTE_ENCRYPTED)) || + !(blob = inode_get_blob_for_unnamed_data_stream(dentry->d_inode, + ctx->common.wim->blob_table))) + { + WARNING("%ls does not exist in the WIM image.\n" + " The default configuration will be used instead; it assumes that all\n" + " files are valid for external backing regardless of path, equivalent\n" + " to an empty [PrepopulateList] section.", path); + return WIMLIB_ERR_PATH_DOES_NOT_EXIST; + } + + ret = read_blob_into_alloc_buf(blob, &buf); + if (ret) + return ret; + + strings = CALLOC(1, sizeof(struct string_list)); + if (!strings) { + FREE(buf); + return WIMLIB_ERR_NOMEM; + } + + sec.name = T("PrepopulateList"); + sec.strings = strings; + + ret = load_text_file(path, buf, blob->size, &mem, &sec, 1, + LOAD_TEXT_FILE_REMOVE_QUOTES | + LOAD_TEXT_FILE_NO_WARNINGS, + mangle_pat); + STATIC_ASSERT(OS_PREFERRED_PATH_SEPARATOR == WIM_PATH_SEPARATOR); + FREE(buf); + if (ret) { + FREE(strings); + return ret; + } + ctx->prepopulate_pats = strings; + ctx->mem_prepopulate_pats = mem; + return 0; +} + +/* Returns %true if the specified absolute path to a file in the WIM image can + * be subject to external backing when extracted. Otherwise returns %false. */ +static bool +can_externally_back_path(const wchar_t *path, const struct win32_apply_ctx *ctx) +{ + /* Does the path match a pattern given in the [PrepopulateList] section + * of WimBootCompress.ini? */ + if (ctx->prepopulate_pats && match_pattern_list(path, ctx->prepopulate_pats, + MATCH_RECURSIVELY)) + return false; + + /* Since we attempt to modify the SYSTEM registry after it's extracted + * (see end_wimboot_extraction()), it can't be extracted as externally + * backed. This extends to associated files such as SYSTEM.LOG that + * also must be writable in order to write to the registry. Normally, + * SYSTEM is in [PrepopulateList], and the SYSTEM.* files match patterns + * in [ExclusionList] and therefore are not captured in the WIM at all. + * However, a WIM that wasn't specifically captured in "WIMBoot mode" + * may contain SYSTEM.* files. So to make things "just work", hard-code + * the pattern. */ + if (match_path(path, L"\\Windows\\System32\\config\\SYSTEM*", 0)) + return false; + + return true; +} + +/* Can the specified WIM resource be used as the source of an external backing + * for the wof.sys WIM provider? */ +static bool +is_resource_valid_for_external_backing(const struct wim_resource_descriptor *rdesc, + struct win32_apply_ctx *ctx) +{ + /* Must be the original WIM file format. This check excludes pipable + * resources and solid resources. It also excludes other resources + * contained in such files even if they would be otherwise compatible. + */ + if (rdesc->wim->hdr.magic != WIM_MAGIC || + rdesc->wim->hdr.wim_version != WIM_VERSION_DEFAULT) + { + ctx->wimboot.have_wrong_version_wims = true; + return false; + } + + /* + * Whitelist of compression types and chunk sizes supported by + * Microsoft's WOF driver. + * + * Notes: + * - Uncompressed WIMs result in BSOD. However, this only applies to + * the WIM file itself, not to uncompressed resources in a WIM file + * that is otherwise compressed. + * - XPRESS 64K sometimes appears to work, but sometimes it causes + * reads to fail with STATUS_UNSUCCESSFUL. + */ + switch (rdesc->compression_type) { + case WIMLIB_COMPRESSION_TYPE_NONE: + if (rdesc->wim->compression_type == WIMLIB_COMPRESSION_TYPE_NONE) { + ctx->wimboot.have_uncompressed_wims = true; + return false; + } + break; + case WIMLIB_COMPRESSION_TYPE_XPRESS: + switch (rdesc->chunk_size) { + case 4096: + case 8192: + case 16384: + case 32768: + break; + default: + ctx->wimboot.have_unsupported_compressed_resources = true; + return false; + } + break; + case WIMLIB_COMPRESSION_TYPE_LZX: + switch (rdesc->chunk_size) { + case 32768: + break; + default: + ctx->wimboot.have_unsupported_compressed_resources = true; + return false; + } + break; + default: + ctx->wimboot.have_unsupported_compressed_resources = true; + return false; + } + + /* Microsoft's WoF driver errors out if it tries to satisfy a read with + * ending offset >= 4 GiB from an externally backed file. */ + if (rdesc->uncompressed_size > 4200000000) { + ctx->wimboot.have_huge_resources = true; + return false; + } + + return true; +} + +#define EXTERNAL_BACKING_NOT_ENABLED -1 +#define EXTERNAL_BACKING_NOT_POSSIBLE -2 +#define EXTERNAL_BACKING_EXCLUDED -3 + +/* + * Determines whether the specified file will be externally backed. Returns a + * negative status code if no, 0 if yes, or a positive wimlib error code on + * error. If the file is excluded from external backing based on its path, then + * *excluded_dentry_ret is set to the dentry for the path that matched the + * exclusion rule. + * + * Note that this logic applies to both types of "external backing": + * + * - WIM backing ("WIMBoot" - Windows 8.1 and later) + * - File backing ("System Compression" - Windows 10 and later) + * + * However, in the case of WIM backing we also need to validate that the WIM + * resource that would be the source of the backing is supported by the wof.sys + * WIM provider. + */ +static int +will_externally_back_inode(struct wim_inode *inode, struct win32_apply_ctx *ctx, + const struct wim_dentry **excluded_dentry_ret, + bool wimboot_mode) +{ + struct wim_dentry *dentry; + struct blob_descriptor *blob; + int ret; + + if (load_prepopulate_pats(ctx) == WIMLIB_ERR_NOMEM) + return WIMLIB_ERR_NOMEM; + + if (inode->i_can_externally_back) + return 0; + + /* This may do redundant checks because the cached value + * i_can_externally_back is 2-state (as opposed to 3-state: + * unknown/no/yes). But most files can be externally backed, so this + * way is fine. */ + + if (inode->i_attributes & (FILE_ATTRIBUTE_DIRECTORY | + FILE_ATTRIBUTE_REPARSE_POINT | + FILE_ATTRIBUTE_ENCRYPTED)) + return EXTERNAL_BACKING_NOT_POSSIBLE; + + blob = inode_get_blob_for_unnamed_data_stream_resolved(inode); + + if (!blob) + return EXTERNAL_BACKING_NOT_POSSIBLE; + + if (wimboot_mode && + (blob->blob_location != BLOB_IN_WIM || + !is_resource_valid_for_external_backing(blob->rdesc, ctx))) + return EXTERNAL_BACKING_NOT_POSSIBLE; + + /* + * We need to check the patterns in [PrepopulateList] against every name + * of the inode, in case any of them match. + */ + + inode_for_each_extraction_alias(dentry, inode) { + + ret = calculate_dentry_full_path(dentry); + if (ret) + return ret; + + if (!can_externally_back_path(dentry->d_full_path, ctx)) { + if (excluded_dentry_ret) + *excluded_dentry_ret = dentry; + return EXTERNAL_BACKING_EXCLUDED; + } + } + + inode->i_can_externally_back = 1; + return 0; +} + +/* + * Determines if the unnamed data stream of a file will be created as a WIM + * external backing (a "WIMBoot pointer file"), as opposed to a standard + * extraction. + */ +static int +win32_will_back_from_wim(struct wim_dentry *dentry, struct apply_ctx *_ctx) +{ + struct win32_apply_ctx *ctx = (struct win32_apply_ctx *)_ctx; + + if (!(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_WIMBOOT)) + return EXTERNAL_BACKING_NOT_ENABLED; + + return will_externally_back_inode(dentry->d_inode, ctx, NULL, true); +} + +/* Find the WOF registration information for the specified WIM file. */ +static struct wimboot_wim * +find_wimboot_wim(WIMStruct *wim_to_find, struct win32_apply_ctx *ctx) +{ + for (size_t i = 0; i < ctx->wimboot.num_wims; i++) + if (wim_to_find == ctx->wimboot.wims[i].wim) + return &ctx->wimboot.wims[i]; + + wimlib_assert(0); + return NULL; +} + +static int +set_backed_from_wim(HANDLE h, struct wim_inode *inode, struct win32_apply_ctx *ctx) +{ + int ret; + const struct wim_dentry *excluded_dentry; + const struct blob_descriptor *blob; + const struct wimboot_wim *wimboot_wim; + + ret = will_externally_back_inode(inode, ctx, &excluded_dentry, true); + if (ret > 0) /* Error. */ + return ret; + + if (ret < 0 && ret != EXTERNAL_BACKING_EXCLUDED) + return 0; /* Not externally backing, other than due to exclusion. */ + + if (unlikely(ret == EXTERNAL_BACKING_EXCLUDED)) { + /* Not externally backing due to exclusion. */ + union wimlib_progress_info info; + + build_extraction_path(excluded_dentry, ctx); + + info.wimboot_exclude.path_in_wim = excluded_dentry->d_full_path; + info.wimboot_exclude.extraction_path = current_path(ctx); + + return call_progress(ctx->common.progfunc, + WIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE, + &info, ctx->common.progctx); + } + + /* Externally backing. */ + + blob = inode_get_blob_for_unnamed_data_stream_resolved(inode); + wimboot_wim = find_wimboot_wim(blob->rdesc->wim, ctx); + + if (unlikely(!wimboot_set_pointer(h, + blob, + wimboot_wim->data_source_id, + wimboot_wim->blob_table_hash, + ctx->wimboot.wof_running))) + { + const DWORD err = GetLastError(); + + build_extraction_path(inode_first_extraction_dentry(inode), ctx); + win32_error(err, L"\"%ls\": Couldn't set WIMBoot pointer data", + current_path(ctx)); + return WIMLIB_ERR_WIMBOOT; + } + return 0; +} + +/* Calculates the SHA-1 message digest of the WIM's blob table. */ +static int +hash_blob_table(WIMStruct *wim, u8 hash[SHA1_HASH_SIZE]) +{ + return wim_reshdr_to_hash(&wim->hdr.blob_table_reshdr, wim, hash); +} + +static int +register_wim_with_wof(WIMStruct *wim, struct win32_apply_ctx *ctx) +{ + struct wimboot_wim *p; + int ret; + + /* Check if already registered */ + for (size_t i = 0; i < ctx->wimboot.num_wims; i++) + if (wim == ctx->wimboot.wims[i].wim) + return 0; + + /* Not yet registered */ + + p = REALLOC(ctx->wimboot.wims, + (ctx->wimboot.num_wims + 1) * sizeof(ctx->wimboot.wims[0])); + if (!p) + return WIMLIB_ERR_NOMEM; + ctx->wimboot.wims = p; + + ctx->wimboot.wims[ctx->wimboot.num_wims].wim = wim; + + ret = hash_blob_table(wim, ctx->wimboot.wims[ctx->wimboot.num_wims].blob_table_hash); + if (ret) + return ret; + + ret = wimboot_alloc_data_source_id(wim->filename, + wim->hdr.guid, + ctx->common.wim->current_image, + ctx->common.target, + &ctx->wimboot.wims[ctx->wimboot.num_wims].data_source_id, + &ctx->wimboot.wof_running); + if (ret) + return ret; + + ctx->wimboot.num_wims++; + return 0; +} + +/* Prepare for doing a "WIMBoot" extraction by registering each source WIM file + * with WOF on the target volume. */ +static int +start_wimboot_extraction(struct list_head *dentry_list, struct win32_apply_ctx *ctx) +{ + int ret; + struct wim_dentry *dentry; + + if (!xml_get_wimboot(ctx->common.wim->xml_info, + ctx->common.wim->current_image)) + WARNING("The WIM image is not marked as WIMBoot compatible. This usually\n" + " means it is not intended to be used to back a Windows operating\n" + " system. Proceeding anyway."); + + list_for_each_entry(dentry, dentry_list, d_extraction_list_node) { + struct blob_descriptor *blob; + + ret = win32_will_back_from_wim(dentry, &ctx->common); + if (ret > 0) /* Error */ + return ret; + if (ret < 0) /* Won't externally back */ + continue; + + blob = inode_get_blob_for_unnamed_data_stream_resolved(dentry->d_inode); + ret = register_wim_with_wof(blob->rdesc->wim, ctx); + if (ret) + return ret; + } + + if (ctx->wimboot.have_wrong_version_wims) { + WARNING("At least one of the source WIM files uses a version of the WIM\n" +" file format that not supported by Microsoft's wof.sys driver.\n" +" Files whose data is contained in one of these WIM files will be\n" +" extracted as full files rather than externally backed."); + } + + if (ctx->wimboot.have_uncompressed_wims) { + WARNING("At least one of the source WIM files is uncompressed. Files whose\n" +" data is contained in an uncompressed WIM file will be extracted as\n" +" full files rather than externally backed, since uncompressed WIM\n" +" files are not supported by Microsoft's wof.sys driver."); + } + + if (ctx->wimboot.have_unsupported_compressed_resources) { + WARNING("At least one of the source WIM files uses a compression format that\n" +" is not supported by Microsoft's wof.sys driver. Files whose data is\n" +" contained in a compressed resource in one of these WIM files will be\n" +" extracted as full files rather than externally backed. (The\n" +" compression formats supported by wof.sys are: XPRESS 4K, XPRESS 8K,\n" +" XPRESS 16K, XPRESS 32K, and LZX 32K.)"); + } + + if (ctx->wimboot.have_huge_resources) { + WARNING("Some files exceeded 4.2 GB in size. Such files will be extracted\n" +" as full files rather than externally backed, since very large files\n" +" are not supported by Microsoft's wof.sys driver."); + } + + return 0; +} + +static void +build_win32_extraction_path(const struct wim_dentry *dentry, + struct win32_apply_ctx *ctx); + +/* Sets WimBoot=1 in the extracted SYSTEM registry hive. + * + * WIMGAPI does this, and it's possible that it's important. + * But I don't know exactly what this value means to Windows. */ +static int +end_wimboot_extraction(struct win32_apply_ctx *ctx) +{ + struct wim_dentry *dentry; + wchar_t subkeyname[32]; + LONG res; + LONG res2; + HKEY key; + DWORD value; + + dentry = get_dentry(ctx->common.wim, L"\\Windows\\System32\\config\\SYSTEM", + WIMLIB_CASE_INSENSITIVE); + + if (!dentry || !will_extract_dentry(dentry)) + goto out; + + if (!will_extract_dentry(wim_get_current_root_dentry(ctx->common.wim))) + goto out; + + /* Not bothering to use the native routines (e.g. NtLoadKey()) for this. + * If this doesn't work, you probably also have many other problems. */ + + build_win32_extraction_path(dentry, ctx); + + get_random_alnum_chars(subkeyname, 20); + subkeyname[20] = L'\0'; + + res = RegLoadKey(HKEY_LOCAL_MACHINE, subkeyname, ctx->pathbuf.Buffer); + if (res) + goto out_check_res; + + wcscpy(&subkeyname[20], L"\\Setup"); + + res = RegCreateKeyEx(HKEY_LOCAL_MACHINE, subkeyname, 0, NULL, + REG_OPTION_BACKUP_RESTORE, 0, NULL, &key, NULL); + if (res) + goto out_unload_key; + + value = 1; + + res = RegSetValueEx(key, L"WimBoot", 0, REG_DWORD, + (const BYTE *)&value, sizeof(DWORD)); + if (res) + goto out_close_key; + + res = RegFlushKey(key); + +out_close_key: + res2 = RegCloseKey(key); + if (!res) + res = res2; +out_unload_key: + subkeyname[20] = L'\0'; + RegUnLoadKey(HKEY_LOCAL_MACHINE, subkeyname); +out_check_res: + if (res) { + /* Warning only. */ + win32_warning(res, L"Failed to set \\Setup: dword \"WimBoot\"=1 " + "value in registry hive \"%ls\"", + ctx->pathbuf.Buffer); + } +out: + return 0; +} + +/* Returns the number of wide characters needed to represent the path to the + * specified @dentry, relative to the target directory, when extracted. + * + * Does not include null terminator (not needed for NtCreateFile). */ +static size_t +dentry_extraction_path_length(const struct wim_dentry *dentry) +{ + size_t len = 0; + const struct wim_dentry *d; + + d = dentry; + do { + len += d->d_extraction_name_nchars + 1; + d = d->d_parent; + } while (!dentry_is_root(d) && will_extract_dentry(d)); + + return --len; /* No leading slash */ +} + +/* Returns the length of the longest string that might need to be appended to + * the path to an alias of an inode to open or create a named data stream. + * + * If the inode has no named data streams, this will be 0. Otherwise, this will + * be 1 plus the length of the longest-named data stream, since the data stream + * name must be separated from the path by the ':' character. */ +static size_t +inode_longest_named_data_stream_spec(const struct wim_inode *inode) +{ + size_t max = 0; + for (unsigned i = 0; i < inode->i_num_streams; i++) { + const struct wim_inode_stream *strm = &inode->i_streams[i]; + if (!stream_is_named_data_stream(strm)) + continue; + size_t len = utf16le_len_chars(strm->stream_name); + if (len > max) + max = len; + } + if (max) + max += 1; + return max; +} + +/* Find the length, in wide characters, of the longest path needed for + * extraction of any file in @dentry_list relative to the target directory. + * + * Accounts for named data streams, but does not include null terminator (not + * needed for NtCreateFile). */ +static size_t +compute_path_max(struct list_head *dentry_list) +{ + size_t max = 0; + const struct wim_dentry *dentry; + + list_for_each_entry(dentry, dentry_list, d_extraction_list_node) { + size_t len; + + len = dentry_extraction_path_length(dentry); + + /* Account for named data streams */ + len += inode_longest_named_data_stream_spec(dentry->d_inode); + + if (len > max) + max = len; + } + + return max; +} + +/* Build the path at which to extract the @dentry, relative to the target + * directory. + * + * The path is saved in ctx->pathbuf. */ +static void +build_extraction_path(const struct wim_dentry *dentry, + struct win32_apply_ctx *ctx) +{ + size_t len; + wchar_t *p; + const struct wim_dentry *d; + + len = dentry_extraction_path_length(dentry); + + ctx->pathbuf.Length = len * sizeof(wchar_t); + p = ctx->pathbuf.Buffer + len; + for (d = dentry; + !dentry_is_root(d->d_parent) && will_extract_dentry(d->d_parent); + d = d->d_parent) + { + p -= d->d_extraction_name_nchars; + if (d->d_extraction_name_nchars) + wmemcpy(p, d->d_extraction_name, + d->d_extraction_name_nchars); + *--p = '\\'; + } + /* No leading slash */ + p -= d->d_extraction_name_nchars; + wmemcpy(p, d->d_extraction_name, d->d_extraction_name_nchars); +} + +/* Build the path at which to extract the @dentry, relative to the target + * directory, adding the suffix for a named data stream. + * + * The path is saved in ctx->pathbuf. */ +static void +build_extraction_path_with_ads(const struct wim_dentry *dentry, + struct win32_apply_ctx *ctx, + const wchar_t *stream_name, + size_t stream_name_nchars) +{ + wchar_t *p; + + build_extraction_path(dentry, ctx); + + /* Add :NAME for named data stream */ + p = ctx->pathbuf.Buffer + (ctx->pathbuf.Length / sizeof(wchar_t)); + *p++ = L':'; + wmemcpy(p, stream_name, stream_name_nchars); + ctx->pathbuf.Length += (1 + stream_name_nchars) * sizeof(wchar_t); +} + +/* Build the Win32 namespace path to the specified @dentry when extracted. + * + * The path is saved in ctx->pathbuf and will be null terminated. + * + * XXX: We could get rid of this if it wasn't needed for the file encryption + * APIs, and the registry manipulation in WIMBoot mode. */ +static void +build_win32_extraction_path(const struct wim_dentry *dentry, + struct win32_apply_ctx *ctx) +{ + build_extraction_path(dentry, ctx); + + /* Prepend target_ntpath to our relative path, then change \??\ into \\?\ */ + + memmove(ctx->pathbuf.Buffer + + (ctx->target_ntpath.Length / sizeof(wchar_t)) + 1, + ctx->pathbuf.Buffer, ctx->pathbuf.Length); + memcpy(ctx->pathbuf.Buffer, ctx->target_ntpath.Buffer, + ctx->target_ntpath.Length); + ctx->pathbuf.Buffer[ctx->target_ntpath.Length / sizeof(wchar_t)] = L'\\'; + ctx->pathbuf.Length += ctx->target_ntpath.Length + sizeof(wchar_t); + ctx->pathbuf.Buffer[ctx->pathbuf.Length / sizeof(wchar_t)] = L'\0'; + + wimlib_assert(ctx->pathbuf.Length >= 4 * sizeof(wchar_t) && + !wmemcmp(ctx->pathbuf.Buffer, L"\\??\\", 4)); + + ctx->pathbuf.Buffer[1] = L'\\'; + +} + +/* Returns a "printable" representation of the last relative NT path that was + * constructed with build_extraction_path() or build_extraction_path_with_ads(). + * + * This will be overwritten by the next call to this function. */ +static const wchar_t * +current_path(struct win32_apply_ctx *ctx) +{ + wchar_t *p = ctx->print_buffer; + + p = wmempcpy(p, ctx->common.target, ctx->common.target_nchars); + *p++ = L'\\'; + p = wmempcpy(p, ctx->pathbuf.Buffer, ctx->pathbuf.Length / sizeof(wchar_t)); + *p = L'\0'; + return ctx->print_buffer; +} + +/* Open handle to the target directory if it is not already open. If the target + * directory does not exist, this creates it. */ +static int +open_target_directory(struct win32_apply_ctx *ctx) +{ + NTSTATUS status; + + if (ctx->h_target) + return 0; + + ctx->attr.Length = sizeof(ctx->attr); + ctx->attr.RootDirectory = NULL; + ctx->attr.ObjectName = &ctx->target_ntpath; + + /* Don't use FILE_OPEN_REPARSE_POINT here; we want the extraction to + * happen at the directory "pointed to" by the reparse point. */ + status = NtCreateFile(&ctx->h_target, + FILE_TRAVERSE, + &ctx->attr, + &ctx->iosb, + NULL, + 0, + FILE_SHARE_VALID_FLAGS, + FILE_OPEN_IF, + FILE_DIRECTORY_FILE | FILE_OPEN_FOR_BACKUP_INTENT, + NULL, + 0); + if (!NT_SUCCESS(status)) { + winnt_error(status, L"Can't open or create directory \"%ls\"", + ctx->common.target); + return WIMLIB_ERR_OPENDIR; + } + ctx->attr.RootDirectory = ctx->h_target; + ctx->attr.ObjectName = &ctx->pathbuf; + return 0; +} + +static void +close_target_directory(struct win32_apply_ctx *ctx) +{ + if (ctx->h_target) { + NtClose(ctx->h_target); + ctx->h_target = NULL; + ctx->attr.RootDirectory = NULL; + } +} + +/* + * Ensures the target directory exists and opens a handle to it, in preparation + * of using paths relative to it. + */ +static int +prepare_target(struct list_head *dentry_list, struct win32_apply_ctx *ctx) +{ + int ret; + size_t path_max; + + ret = win32_path_to_nt_path(ctx->common.target, &ctx->target_ntpath); + if (ret) + return ret; + + ret = open_target_directory(ctx); + if (ret) + return ret; + + path_max = compute_path_max(dentry_list); + /* Add some extra for building Win32 paths for the file encryption APIs, + * and ensure we have at least enough to potentially use an 8.3 name for + * the last component. */ + path_max += max(2 + (ctx->target_ntpath.Length / sizeof(wchar_t)), + 8 + 1 + 3); + + ctx->pathbuf.MaximumLength = path_max * sizeof(wchar_t); + if (ctx->pathbuf.MaximumLength != path_max * sizeof(wchar_t)) { + /* Paths are too long for a UNICODE_STRING! */ + ERROR("Some paths are too long to extract (> 32768 characters)!"); + return WIMLIB_ERR_UNSUPPORTED; + } + + ctx->pathbuf.Buffer = MALLOC(ctx->pathbuf.MaximumLength); + if (!ctx->pathbuf.Buffer) + return WIMLIB_ERR_NOMEM; + + ctx->print_buffer = MALLOC((ctx->common.target_nchars + 1 + path_max + 1) * + sizeof(wchar_t)); + if (!ctx->print_buffer) + return WIMLIB_ERR_NOMEM; + + return 0; +} + +/* When creating an inode that will have a short (DOS) name, we create it using + * the long name associated with the short name. This ensures that the short + * name gets associated with the correct long name. */ +static struct wim_dentry * +first_extraction_alias(const struct wim_inode *inode) +{ + struct wim_dentry *dentry; + + inode_for_each_extraction_alias(dentry, inode) + if (dentry_has_short_name(dentry)) + return dentry; + return inode_first_extraction_dentry(inode); +} + +/* + * Set or clear FILE_ATTRIBUTE_COMPRESSED if the inherited value is different + * from the desired value. + * + * Note that you can NOT override the inherited value of + * FILE_ATTRIBUTE_COMPRESSED directly with NtCreateFile(). + */ +static int +adjust_compression_attribute(HANDLE h, const struct wim_dentry *dentry, + struct win32_apply_ctx *ctx) +{ + const bool compressed = (dentry->d_inode->i_attributes & + FILE_ATTRIBUTE_COMPRESSED); + FILE_BASIC_INFORMATION info; + USHORT compression_state; + NTSTATUS status; + + if (ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES) + return 0; + + if (!ctx->common.supported_features.compressed_files) + return 0; + + + /* Get current attributes */ + status = NtQueryInformationFile(h, &ctx->iosb, &info, sizeof(info), + FileBasicInformation); + if (NT_SUCCESS(status) && + compressed == !!(info.FileAttributes & FILE_ATTRIBUTE_COMPRESSED)) + { + /* Nothing needs to be done. */ + return 0; + } + + /* Set the new compression state */ + + if (compressed) + compression_state = COMPRESSION_FORMAT_DEFAULT; + else + compression_state = COMPRESSION_FORMAT_NONE; + + status = winnt_fsctl(h, FSCTL_SET_COMPRESSION, + &compression_state, sizeof(USHORT), NULL, 0, NULL); + if (NT_SUCCESS(status)) + return 0; + + winnt_error(status, L"Can't %s compression attribute on \"%ls\"", + (compressed ? "set" : "clear"), current_path(ctx)); + return WIMLIB_ERR_SET_ATTRIBUTES; +} + +static bool +need_sparse_flag(const struct wim_inode *inode, + const struct win32_apply_ctx *ctx) +{ + return (inode->i_attributes & FILE_ATTRIBUTE_SPARSE_FILE) && + ctx->common.supported_features.sparse_files; +} + +static int +set_sparse_flag(HANDLE h, struct win32_apply_ctx *ctx) +{ + NTSTATUS status; + + status = winnt_fsctl(h, FSCTL_SET_SPARSE, NULL, 0, NULL, 0, NULL); + if (NT_SUCCESS(status)) + return 0; + + winnt_error(status, L"Can't set sparse flag on \"%ls\"", + current_path(ctx)); + return WIMLIB_ERR_SET_ATTRIBUTES; +} + +/* Try to enable short name support on the target volume. If successful, return + * true. If unsuccessful, issue a warning and return false. */ +static bool +try_to_enable_short_names(const wchar_t *volume) +{ + HANDLE h; + FILE_FS_PERSISTENT_VOLUME_INFORMATION info; + BOOL bret; + DWORD bytesReturned; + + h = CreateFile(volume, GENERIC_WRITE, + FILE_SHARE_VALID_FLAGS, NULL, OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, NULL); + if (h == INVALID_HANDLE_VALUE) + goto fail; + + info.VolumeFlags = 0; + info.FlagMask = PERSISTENT_VOLUME_STATE_SHORT_NAME_CREATION_DISABLED; + info.Version = 1; + info.Reserved = 0; + + bret = DeviceIoControl(h, FSCTL_SET_PERSISTENT_VOLUME_STATE, + &info, sizeof(info), NULL, 0, + &bytesReturned, NULL); + + CloseHandle(h); + + if (!bret) + goto fail; + return true; + +fail: + win32_warning(GetLastError(), + L"Failed to enable short name support on %ls", + volume + 4); + return false; +} + +static NTSTATUS +remove_conflicting_short_name(const struct wim_dentry *dentry, struct win32_apply_ctx *ctx) +{ + wchar_t *name; + wchar_t *end; + NTSTATUS status; + HANDLE h; + size_t bufsize = offsetof(FILE_NAME_INFORMATION, FileName) + + (13 * sizeof(wchar_t)); + u8 buf[bufsize] __attribute__((aligned(8))); + bool retried = false; + FILE_NAME_INFORMATION *info = (FILE_NAME_INFORMATION *)buf; + + memset(buf, 0, bufsize); + + /* Build the path with the short name. */ + name = &ctx->pathbuf.Buffer[ctx->pathbuf.Length / sizeof(wchar_t)]; + while (name != ctx->pathbuf.Buffer && *(name - 1) != L'\\') + name--; + end = mempcpy(name, dentry->d_short_name, dentry->d_short_name_nbytes); + ctx->pathbuf.Length = ((u8 *)end - (u8 *)ctx->pathbuf.Buffer); + + /* Open the conflicting file (by short name). */ + status = NtOpenFile(&h, GENERIC_WRITE | DELETE, + &ctx->attr, &ctx->iosb, + FILE_SHARE_VALID_FLAGS, + FILE_OPEN_REPARSE_POINT | FILE_OPEN_FOR_BACKUP_INTENT); + if (!NT_SUCCESS(status)) { + winnt_warning(status, L"Can't open \"%ls\"", current_path(ctx)); + goto out; + } + +#if 0 + WARNING("Overriding conflicting short name; path=\"%ls\"", + current_path(ctx)); +#endif + + /* Try to remove the short name on the conflicting file. */ + +retry: + status = NtSetInformationFile(h, &ctx->iosb, info, bufsize, + FileShortNameInformation); + + if (status == STATUS_INVALID_PARAMETER && !retried) { + /* Microsoft forgot to make it possible to remove short names + * until Windows 7. Oops. Use a random short name instead. */ + get_random_alnum_chars(info->FileName, 8); + wcscpy(&info->FileName[8], L".WLB"); + info->FileNameLength = 12 * sizeof(wchar_t); + retried = true; + goto retry; + } + NtClose(h); +out: + build_extraction_path(dentry, ctx); + return status; +} + +/* Set the short name on the open file @h which has been created at the location + * indicated by @dentry. + * + * Note that this may add, change, or remove the short name. + * + * @h must be opened with DELETE access. + * + * Returns 0 or WIMLIB_ERR_SET_SHORT_NAME. The latter only happens in + * STRICT_SHORT_NAMES mode. + */ +static int +set_short_name(HANDLE h, const struct wim_dentry *dentry, + struct win32_apply_ctx *ctx) +{ + + if (!ctx->common.supported_features.short_names) + return 0; + + /* + * Note: The size of the FILE_NAME_INFORMATION buffer must be such that + * FileName contains at least 2 wide characters (4 bytes). Otherwise, + * NtSetInformationFile() will return STATUS_INFO_LENGTH_MISMATCH. This + * is despite the fact that FileNameLength can validly be 0 or 2 bytes, + * with the former case being removing the existing short name if + * present, rather than setting one. + * + * The null terminator is seemingly optional, but to be safe we include + * space for it and zero all unused space. + */ + + size_t bufsize = offsetof(FILE_NAME_INFORMATION, FileName) + + max(dentry->d_short_name_nbytes, sizeof(wchar_t)) + + sizeof(wchar_t); + u8 buf[bufsize] __attribute__((aligned(8))); + FILE_NAME_INFORMATION *info = (FILE_NAME_INFORMATION *)buf; + NTSTATUS status; + bool tried_to_remove_existing = false; + + memset(buf, 0, bufsize); + + info->FileNameLength = dentry->d_short_name_nbytes; + memcpy(info->FileName, dentry->d_short_name, dentry->d_short_name_nbytes); + +retry: + status = NtSetInformationFile(h, &ctx->iosb, info, bufsize, + FileShortNameInformation); + if (NT_SUCCESS(status)) + return 0; + + if (status == STATUS_SHORT_NAMES_NOT_ENABLED_ON_VOLUME) { + if (dentry->d_short_name_nbytes == 0) + return 0; + if (!ctx->tried_to_enable_short_names) { + wchar_t volume[7]; + int ret; + + ctx->tried_to_enable_short_names = true; + + ret = win32_get_drive_path(ctx->common.target, + volume); + if (ret) + return ret; + if (try_to_enable_short_names(volume)) + goto retry; + } + } + + /* + * Short names can conflict in several cases: + * + * - a file being extracted has a short name conflicting with an + * existing file + * + * - a file being extracted has a short name conflicting with another + * file being extracted (possible, but shouldn't happen) + * + * - a file being extracted has a short name that conflicts with the + * automatically generated short name of a file we previously + * extracted, but failed to set the short name for. Sounds unlikely, + * but this actually does happen fairly often on versions of Windows + * prior to Windows 7 because they do not support removing short names + * from files. + */ + if (unlikely(status == STATUS_OBJECT_NAME_COLLISION) && + dentry->d_short_name_nbytes && !tried_to_remove_existing) + { + tried_to_remove_existing = true; + status = remove_conflicting_short_name(dentry, ctx); + if (NT_SUCCESS(status)) + goto retry; + } + + /* By default, failure to set short names is not an error (since short + * names aren't too important anymore...). */ + if (!(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES)) { + if (dentry->d_short_name_nbytes) + ctx->num_set_short_name_failures++; + else + ctx->num_remove_short_name_failures++; + return 0; + } + + winnt_error(status, L"Can't set short name on \"%ls\"", current_path(ctx)); + return WIMLIB_ERR_SET_SHORT_NAME; +} + +/* + * A wrapper around NtCreateFile() to make it slightly more usable... + * This uses the path currently constructed in ctx->pathbuf. + * + * Also, we always specify SYNCHRONIZE access, FILE_OPEN_FOR_BACKUP_INTENT, and + * FILE_OPEN_REPARSE_POINT. + */ +static NTSTATUS +do_create_file(PHANDLE FileHandle, + ACCESS_MASK DesiredAccess, + PLARGE_INTEGER AllocationSize, + ULONG FileAttributes, + ULONG CreateDisposition, + ULONG CreateOptions, + struct win32_apply_ctx *ctx) +{ + return NtCreateFile(FileHandle, + DesiredAccess | SYNCHRONIZE, + &ctx->attr, + &ctx->iosb, + AllocationSize, + FileAttributes, + FILE_SHARE_VALID_FLAGS, + CreateDisposition, + CreateOptions | + FILE_OPEN_FOR_BACKUP_INTENT | + FILE_OPEN_REPARSE_POINT, + NULL, + 0); +} + +/* Like do_create_file(), but builds the extraction path of the @dentry first. + */ +static NTSTATUS +create_file(PHANDLE FileHandle, + ACCESS_MASK DesiredAccess, + PLARGE_INTEGER AllocationSize, + ULONG FileAttributes, + ULONG CreateDisposition, + ULONG CreateOptions, + const struct wim_dentry *dentry, + struct win32_apply_ctx *ctx) +{ + build_extraction_path(dentry, ctx); + return do_create_file(FileHandle, + DesiredAccess, + AllocationSize, + FileAttributes, + CreateDisposition, + CreateOptions, + ctx); +} + +static int +delete_file_or_stream(struct win32_apply_ctx *ctx) +{ + NTSTATUS status; + HANDLE h; + ULONG perms = DELETE; + ULONG flags = FILE_NON_DIRECTORY_FILE | FILE_DELETE_ON_CLOSE; + + /* First try opening the file with FILE_DELETE_ON_CLOSE. In most cases, + * all we have to do is that plus close the file handle. */ +retry: + status = do_create_file(&h, perms, NULL, 0, FILE_OPEN, flags, ctx); + + if (unlikely(status == STATUS_CANNOT_DELETE)) { + /* This error occurs for files with FILE_ATTRIBUTE_READONLY set. + * Try an alternate approach: first open the file without + * FILE_DELETE_ON_CLOSE, then reset the file attributes, then + * set the "delete" disposition on the handle. */ + if (flags & FILE_DELETE_ON_CLOSE) { + flags &= ~FILE_DELETE_ON_CLOSE; + perms |= FILE_WRITE_ATTRIBUTES; + goto retry; + } + } + + if (unlikely(!NT_SUCCESS(status))) { + winnt_error(status, L"Can't open \"%ls\" for deletion " + "(perms=%x, flags=%x)", + current_path(ctx), (u32)perms, (u32)flags); + return WIMLIB_ERR_OPEN; + } + + if (unlikely(!(flags & FILE_DELETE_ON_CLOSE))) { + + FILE_BASIC_INFORMATION basic_info = + { .FileAttributes = FILE_ATTRIBUTE_NORMAL }; + status = NtSetInformationFile(h, &ctx->iosb, &basic_info, + sizeof(basic_info), + FileBasicInformation); + + if (!NT_SUCCESS(status)) { + winnt_error(status, L"Can't reset attributes of \"%ls\" " + "to prepare for deletion", current_path(ctx)); + NtClose(h); + return WIMLIB_ERR_SET_ATTRIBUTES; + } + + FILE_DISPOSITION_INFORMATION disp_info = + { .DoDeleteFile = TRUE }; + status = NtSetInformationFile(h, &ctx->iosb, &disp_info, + sizeof(disp_info), + FileDispositionInformation); + if (!NT_SUCCESS(status)) { + winnt_error(status, L"Can't set delete-on-close " + "disposition on \"%ls\"", current_path(ctx)); + NtClose(h); + return WIMLIB_ERR_SET_ATTRIBUTES; + } + } + + status = NtClose(h); + if (unlikely(!NT_SUCCESS(status))) { + winnt_error(status, L"Error closing \"%ls\" after setting " + "delete-on-close disposition", current_path(ctx)); + return WIMLIB_ERR_OPEN; + } + + return 0; +} + +/* + * Create a nondirectory file or named data stream at the current path, + * superseding any that already exists at that path. If successful, return an + * open handle to the file or named data stream with the requested permissions. + */ +static int +supersede_file_or_stream(struct win32_apply_ctx *ctx, DWORD perms, + HANDLE *h_ret) +{ + NTSTATUS status; + bool retried = false; + + /* FILE_ATTRIBUTE_SYSTEM is needed to ensure that + * FILE_ATTRIBUTE_ENCRYPTED doesn't get set before we want it to be. */ +retry: + status = do_create_file(h_ret, + perms, + NULL, + FILE_ATTRIBUTE_SYSTEM, + FILE_CREATE, + FILE_NON_DIRECTORY_FILE, + ctx); + if (likely(NT_SUCCESS(status))) + return 0; + + /* STATUS_OBJECT_NAME_COLLISION means that the file or stream already + * exists. Delete the existing file or stream, then try again. + * + * Note: we don't use FILE_OVERWRITE_IF or FILE_SUPERSEDE because of + * problems with certain file attributes, especially + * FILE_ATTRIBUTE_ENCRYPTED. FILE_SUPERSEDE is also broken in the + * Windows PE ramdisk. */ + if (status == STATUS_OBJECT_NAME_COLLISION && !retried) { + int ret = delete_file_or_stream(ctx); + if (ret) + return ret; + retried = true; + goto retry; + } + winnt_error(status, L"Can't create \"%ls\"", current_path(ctx)); + return WIMLIB_ERR_OPEN; +} + +/* Set the reparse point @rpbuf of length @rpbuflen on the extracted file + * corresponding to the WIM dentry @dentry. */ +static int +do_set_reparse_point(const struct wim_dentry *dentry, + const struct reparse_buffer_disk *rpbuf, u16 rpbuflen, + struct win32_apply_ctx *ctx) +{ + NTSTATUS status; + HANDLE h; + + status = create_file(&h, GENERIC_WRITE, NULL, + 0, FILE_OPEN, 0, dentry, ctx); + if (!NT_SUCCESS(status)) + goto fail; + + status = winnt_fsctl(h, FSCTL_SET_REPARSE_POINT, + rpbuf, rpbuflen, NULL, 0, NULL); + NtClose(h); + + if (NT_SUCCESS(status)) + return 0; + + /* On Windows, by default only the Administrator can create symbolic + * links for some reason. By default we just issue a warning if this + * appears to be the problem. Use WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS + * to get a hard error. */ + if (!(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS) + && (status == STATUS_PRIVILEGE_NOT_HELD || + status == STATUS_ACCESS_DENIED) + && (dentry->d_inode->i_reparse_tag == WIM_IO_REPARSE_TAG_SYMLINK || + dentry->d_inode->i_reparse_tag == WIM_IO_REPARSE_TAG_MOUNT_POINT)) + { + WARNING("Can't create symbolic link \"%ls\"! \n" + " (Need Administrator rights, or at least " + "the\n" + " SeCreateSymbolicLink privilege.)", + current_path(ctx)); + return 0; + } + +fail: + winnt_error(status, L"Can't set reparse data on \"%ls\"", + current_path(ctx)); + return WIMLIB_ERR_SET_REPARSE_DATA; +} + +/* + * Create empty named data streams and potentially a reparse point for the + * specified file, if any. + * + * Since these won't have blob descriptors, they won't show up in the call to + * extract_blob_list(). Hence the need for the special case. + */ +static int +create_empty_streams(const struct wim_dentry *dentry, + struct win32_apply_ctx *ctx) +{ + const struct wim_inode *inode = dentry->d_inode; + int ret; + + for (unsigned i = 0; i < inode->i_num_streams; i++) { + const struct wim_inode_stream *strm = &inode->i_streams[i]; + + if (stream_blob_resolved(strm) != NULL) + continue; + + if (strm->stream_type == STREAM_TYPE_REPARSE_POINT && + ctx->common.supported_features.reparse_points) + { + u8 buf[REPARSE_DATA_OFFSET] __attribute__((aligned(8))); + struct reparse_buffer_disk *rpbuf = + (struct reparse_buffer_disk *)buf; + complete_reparse_point(rpbuf, inode, 0); + ret = do_set_reparse_point(dentry, rpbuf, + REPARSE_DATA_OFFSET, ctx); + if (ret) + return ret; + } else if (stream_is_named_data_stream(strm) && + ctx->common.supported_features.named_data_streams) + { + HANDLE h; + + build_extraction_path_with_ads(dentry, ctx, + strm->stream_name, + utf16le_len_chars(strm->stream_name)); + /* + * Note: do not request any permissions on the handle. + * Otherwise, we may encounter a Windows bug where the + * parent directory DACL denies read access to the new + * named data stream, even when using backup semantics! + */ + ret = supersede_file_or_stream(ctx, 0, &h); + + build_extraction_path(dentry, ctx); + + if (ret) + return ret; + NtClose(h); + } + } + + return 0; +} + +/* + * Creates the directory named by @dentry, or uses an existing directory at that + * location. If necessary, sets the short name and/or fixes compression and + * encryption attributes. + * + * Returns 0, WIMLIB_ERR_MKDIR, or WIMLIB_ERR_SET_SHORT_NAME. + */ +static int +create_directory(const struct wim_dentry *dentry, struct win32_apply_ctx *ctx) +{ + DWORD perms; + NTSTATUS status; + HANDLE h; + int ret; + + /* DELETE is needed for set_short_name(); GENERIC_READ and GENERIC_WRITE + * are needed for adjust_compression_attribute(). */ + perms = GENERIC_READ | GENERIC_WRITE; + if (!dentry_is_root(dentry)) + perms |= DELETE; + + /* FILE_ATTRIBUTE_SYSTEM is needed to ensure that + * FILE_ATTRIBUTE_ENCRYPTED doesn't get set before we want it to be. */ + status = create_file(&h, perms, NULL, FILE_ATTRIBUTE_SYSTEM, + FILE_OPEN_IF, FILE_DIRECTORY_FILE, dentry, ctx); + if (unlikely(!NT_SUCCESS(status))) { + const wchar_t *path = current_path(ctx); + winnt_error(status, L"Can't create directory \"%ls\"", path); + + /* Check for known issue with WindowsApps directory. */ + if (status == STATUS_ACCESS_DENIED && + (wcsstr(path, L"\\WindowsApps\\") || + wcsstr(path, L"\\InfusedApps\\"))) { + ERROR( +"You seem to be trying to extract files to the WindowsApps directory.\n" +" Windows 8.1 and later use new file permissions in this directory that\n" +" cannot be overridden, even by backup/restore programs. To extract your\n" +" files anyway, you need to choose a different target directory, delete\n" +" the WindowsApps directory entirely, reformat the volume, do the\n" +" extraction from a non-broken operating system such as Windows 7 or\n" +" Linux, or wait for Microsoft to fix the design flaw in their operating\n" +" system. This is *not* a bug in wimlib. See this thread for more\n" +" information: https://wimlib.net/forums/viewtopic.php?f=1&t=261"); + } + return WIMLIB_ERR_MKDIR; + } + + if (ctx->iosb.Information == FILE_OPENED) { + /* If we opened an existing directory, try to clear its file + * attributes. As far as I know, this only actually makes a + * difference in the case where a FILE_ATTRIBUTE_READONLY + * directory has a named data stream which needs to be + * extracted. You cannot create a named data stream of such a + * directory, even though this contradicts Microsoft's + * documentation for FILE_ATTRIBUTE_READONLY which states it is + * not honored for directories! */ + if (!(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES)) { + FILE_BASIC_INFORMATION basic_info = + { .FileAttributes = FILE_ATTRIBUTE_NORMAL }; + NtSetInformationFile(h, &ctx->iosb, &basic_info, + sizeof(basic_info), + FileBasicInformation); + } + } + + if (!dentry_is_root(dentry)) { + ret = set_short_name(h, dentry, ctx); + if (ret) + goto out; + } + + ret = adjust_compression_attribute(h, dentry, ctx); +out: + NtClose(h); + return ret; +} + +/* + * Create all the directories being extracted, other than the target directory + * itself. + * + * Note: we don't honor directory hard links. However, we don't allow them to + * exist in WIM images anyway (see inode_fixup.c). + */ +static int +create_directories(struct list_head *dentry_list, + struct win32_apply_ctx *ctx) +{ + const struct wim_dentry *dentry; + int ret; + + list_for_each_entry(dentry, dentry_list, d_extraction_list_node) { + + if (!(dentry->d_inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY)) + continue; + + /* Note: Here we include files with + * FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_REPARSE_POINT, but we + * wait until later to actually set the reparse data. */ + + ret = create_directory(dentry, ctx); + + if (!ret) + ret = create_empty_streams(dentry, ctx); + + ret = check_apply_error(dentry, ctx, ret); + if (ret) + return ret; + + ret = report_file_created(&ctx->common); + if (ret) + return ret; + } + return 0; +} + +/* + * Creates the nondirectory file named by @dentry. + * + * On success, returns an open handle to the file in @h_ret, with GENERIC_READ, + * GENERIC_WRITE, and DELETE access. Also, the path to the file will be saved + * in ctx->pathbuf. On failure, returns an error code. + */ +static int +create_nondirectory_inode(HANDLE *h_ret, const struct wim_dentry *dentry, + struct win32_apply_ctx *ctx) +{ + int ret; + HANDLE h; + + build_extraction_path(dentry, ctx); + + ret = supersede_file_or_stream(ctx, + GENERIC_READ | GENERIC_WRITE | DELETE, + &h); + if (ret) + goto out; + + ret = adjust_compression_attribute(h, dentry, ctx); + if (ret) + goto out_close; + + if (need_sparse_flag(dentry->d_inode, ctx)) { + ret = set_sparse_flag(h, ctx); + if (ret) + goto out_close; + } + + ret = create_empty_streams(dentry, ctx); + if (ret) + goto out_close; + + *h_ret = h; + return 0; + +out_close: + NtClose(h); +out: + return ret; +} + +/* Creates a hard link at the location named by @dentry to the file represented + * by the open handle @h. Or, if the target volume does not support hard links, + * create a separate file instead. */ +static int +create_link(HANDLE h, const struct wim_dentry *dentry, + struct win32_apply_ctx *ctx) +{ + if (ctx->common.supported_features.hard_links) { + + build_extraction_path(dentry, ctx); + + size_t bufsize = offsetof(FILE_LINK_INFORMATION, FileName) + + ctx->pathbuf.Length + sizeof(wchar_t); + u8 buf[bufsize] __attribute__((aligned(8))); + FILE_LINK_INFORMATION *info = (FILE_LINK_INFORMATION *)buf; + NTSTATUS status; + + info->ReplaceIfExists = TRUE; + info->RootDirectory = ctx->attr.RootDirectory; + info->FileNameLength = ctx->pathbuf.Length; + memcpy(info->FileName, ctx->pathbuf.Buffer, ctx->pathbuf.Length); + info->FileName[info->FileNameLength / 2] = L'\0'; + /* + * Note: the null terminator isn't actually necessary, but if + * you don't add the extra character, you get + * STATUS_INFO_LENGTH_MISMATCH when FileNameLength is 2. + */ + + /* + * When fuzzing with wlfuzz.exe, creating a hard link sometimes + * fails with STATUS_ACCESS_DENIED. However, it eventually + * succeeds when re-attempted... + */ + int i = 0; + do { + status = NtSetInformationFile(h, &ctx->iosb, info, + bufsize, + FileLinkInformation); + if (NT_SUCCESS(status)) + return 0; + } while (++i < 32); + winnt_error(status, L"Failed to create link \"%ls\"", + current_path(ctx)); + return WIMLIB_ERR_LINK; + } else { + HANDLE h2; + int ret; + + ret = create_nondirectory_inode(&h2, dentry, ctx); + if (ret) + return ret; + + NtClose(h2); + return 0; + } +} + +/* Given an inode (represented by the open handle @h) for which one link has + * been created (named by @first_dentry), create the other links. + * + * Or, if the target volume does not support hard links, create separate files. + * + * Note: This uses ctx->pathbuf and does not reset it. + */ +static int +create_links(HANDLE h, const struct wim_dentry *first_dentry, + struct win32_apply_ctx *ctx) +{ + const struct wim_inode *inode = first_dentry->d_inode; + const struct wim_dentry *dentry; + int ret; + + inode_for_each_extraction_alias(dentry, inode) { + if (dentry != first_dentry) { + ret = create_link(h, dentry, ctx); + if (ret) + return ret; + } + } + return 0; +} + +/* Create a nondirectory file, including all links. */ +static int +create_nondirectory(struct wim_inode *inode, struct win32_apply_ctx *ctx) +{ + struct wim_dentry *first_dentry; + HANDLE h; + int ret; + + first_dentry = first_extraction_alias(inode); + + /* Create first link. */ + ret = create_nondirectory_inode(&h, first_dentry, ctx); + if (ret) + return ret; + + /* Set short name. */ + ret = set_short_name(h, first_dentry, ctx); + + /* Create additional links, OR if hard links are not supported just + * create more files. */ + if (!ret) + ret = create_links(h, first_dentry, ctx); + + /* "WIMBoot" extraction: set external backing by the WIM file if needed. */ + if (!ret && unlikely(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_WIMBOOT)) + ret = set_backed_from_wim(h, inode, ctx); + + NtClose(h); + return ret; +} + +/* Create all the nondirectory files being extracted, including all aliases + * (hard links). */ +static int +create_nondirectories(struct list_head *dentry_list, struct win32_apply_ctx *ctx) +{ + struct wim_dentry *dentry; + struct wim_inode *inode; + int ret; + + list_for_each_entry(dentry, dentry_list, d_extraction_list_node) { + inode = dentry->d_inode; + if (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY) + continue; + /* Call create_nondirectory() only once per inode */ + if (dentry == inode_first_extraction_dentry(inode)) { + ret = create_nondirectory(inode, ctx); + ret = check_apply_error(dentry, ctx, ret); + if (ret) + return ret; + } + ret = report_file_created(&ctx->common); + if (ret) + return ret; + } + return 0; +} + +static void +close_handles(struct win32_apply_ctx *ctx) +{ + for (unsigned i = 0; i < ctx->num_open_handles; i++) + NtClose(ctx->open_handles[i]); +} + +/* Prepare to read the next blob, which has size @blob_size, into an in-memory + * buffer. */ +static bool +prepare_data_buffer(struct win32_apply_ctx *ctx, u64 blob_size) +{ + if (blob_size > ctx->data_buffer_size) { + /* Larger buffer needed. */ + void *new_buffer; + if ((size_t)blob_size != blob_size) + return false; + new_buffer = REALLOC(ctx->data_buffer, blob_size); + if (!new_buffer) + return false; + ctx->data_buffer = new_buffer; + ctx->data_buffer_size = blob_size; + } + /* On the first call this changes data_buffer_ptr from NULL, which tells + * extract_chunk() that the data buffer needs to be filled while reading + * the stream data. */ + ctx->data_buffer_ptr = ctx->data_buffer; + return true; +} + +static int +begin_extract_blob_instance(const struct blob_descriptor *blob, + struct wim_dentry *dentry, + const struct wim_inode_stream *strm, + struct win32_apply_ctx *ctx) +{ + HANDLE h; + NTSTATUS status; + + if (unlikely(strm->stream_type == STREAM_TYPE_REPARSE_POINT)) { + /* We can't write the reparse point stream directly; we must set + * it with FSCTL_SET_REPARSE_POINT, which requires that all the + * data be available. So, stage the data in a buffer. */ + if (!prepare_data_buffer(ctx, blob->size)) + return WIMLIB_ERR_NOMEM; + list_add_tail(&dentry->d_tmp_list, &ctx->reparse_dentries); + return 0; + } + + if (unlikely(strm->stream_type == STREAM_TYPE_EFSRPC_RAW_DATA)) { + /* We can't write encrypted files directly; we must use + * WriteEncryptedFileRaw(), which requires providing the data + * through a callback function. This can't easily be combined + * with our own callback-based approach. + * + * The current workaround is to simply read the blob into memory + * and write the encrypted file from that. + * + * TODO: This isn't sufficient for extremely large encrypted + * files. Perhaps we should create an extra thread to write + * such files... */ + if (!prepare_data_buffer(ctx, blob->size)) + return WIMLIB_ERR_NOMEM; + list_add_tail(&dentry->d_tmp_list, &ctx->encrypted_dentries); + return 0; + } + + /* It's a data stream (may be unnamed or named). */ + wimlib_assert(strm->stream_type == STREAM_TYPE_DATA); + + if (ctx->num_open_handles == MAX_OPEN_FILES) { + /* XXX: Fix this. But because of the checks in + * extract_blob_list(), this can now only happen on a filesystem + * that does not support hard links. */ + ERROR("Can't extract data: too many open files!"); + return WIMLIB_ERR_UNSUPPORTED; + } + + + if (unlikely(stream_is_named(strm))) { + build_extraction_path_with_ads(dentry, ctx, + strm->stream_name, + utf16le_len_chars(strm->stream_name)); + } else { + build_extraction_path(dentry, ctx); + } + + + /* Open a new handle */ + status = do_create_file(&h, + FILE_WRITE_DATA | SYNCHRONIZE, + NULL, 0, FILE_OPEN_IF, + FILE_SEQUENTIAL_ONLY | + FILE_SYNCHRONOUS_IO_NONALERT, + ctx); + if (!NT_SUCCESS(status)) { + winnt_error(status, L"Can't open \"%ls\" for writing", + current_path(ctx)); + return WIMLIB_ERR_OPEN; + } + + ctx->is_sparse_stream[ctx->num_open_handles] = false; + if (need_sparse_flag(dentry->d_inode, ctx)) { + /* If the stream is unnamed, then the sparse flag was already + * set when the file was created. But if the stream is named, + * then we need to set the sparse flag here. */ + if (unlikely(stream_is_named(strm))) { + int ret = set_sparse_flag(h, ctx); + if (ret) { + NtClose(h); + return ret; + } + } + ctx->is_sparse_stream[ctx->num_open_handles] = true; + ctx->any_sparse_streams = true; + } else { + /* Allocate space for the data. */ + FILE_ALLOCATION_INFORMATION info = + { .AllocationSize = { .QuadPart = blob->size }}; + NtSetInformationFile(h, &ctx->iosb, &info, sizeof(info), + FileAllocationInformation); + } + ctx->open_handles[ctx->num_open_handles++] = h; + return 0; +} + +/* Given a Windows NT namespace path, such as \??\e:\Windows\System32, return a + * pointer to the suffix of the path that begins with the device directly, such + * as e:\Windows\System32. */ +static const wchar_t * +skip_nt_toplevel_component(const wchar_t *path, size_t path_nchars) +{ + static const wchar_t * const dirs[] = { + L"\\??\\", + L"\\DosDevices\\", + L"\\Device\\", + }; + const wchar_t * const end = path + path_nchars; + + for (size_t i = 0; i < ARRAY_LEN(dirs); i++) { + size_t len = wcslen(dirs[i]); + if (len <= (end - path) && !wmemcmp(path, dirs[i], len)) { + path += len; + while (path != end && *path == L'\\') + path++; + return path; + } + } + return path; +} + +/* + * Given a Windows NT namespace path, such as \??\e:\Windows\System32, return a + * pointer to the suffix of the path that is device-relative but possibly with + * leading slashes, such as \Windows\System32. + * + * The path has an explicit length and is not necessarily null terminated. + */ +static const wchar_t * +get_device_relative_path(const wchar_t *path, size_t path_nchars) +{ + const wchar_t * const orig_path = path; + const wchar_t * const end = path + path_nchars; + + path = skip_nt_toplevel_component(path, path_nchars); + if (path == orig_path) + return orig_path; + + while (path != end && *path != L'\\') + path++; + + return path; +} + +/* + * Given a reparse point buffer for an inode for which the absolute link target + * was relativized when it was archived, de-relative the link target to be + * consistent with the actual extraction location. + */ +static void +try_rpfix(struct reparse_buffer_disk *rpbuf, u16 *rpbuflen_p, + struct win32_apply_ctx *ctx) +{ + struct link_reparse_point link; + size_t orig_subst_name_nchars; + const wchar_t *relpath; + size_t relpath_nchars; + size_t target_ntpath_nchars; + size_t fixed_subst_name_nchars; + const wchar_t *fixed_print_name; + size_t fixed_print_name_nchars; + + /* Do nothing if the reparse data is invalid. */ + if (parse_link_reparse_point(rpbuf, *rpbuflen_p, &link)) + return; + + /* Do nothing if the reparse point is a relative symbolic link. */ + if (link_is_relative_symlink(&link)) + return; + + /* Build the new substitute name from the NT namespace path to the + * target directory, then a path separator, then the "device relative" + * part of the old substitute name. */ + + orig_subst_name_nchars = link.substitute_name_nbytes / sizeof(wchar_t); + + relpath = get_device_relative_path(link.substitute_name, + orig_subst_name_nchars); + relpath_nchars = orig_subst_name_nchars - + (relpath - link.substitute_name); + + target_ntpath_nchars = ctx->target_ntpath.Length / sizeof(wchar_t); + + /* If the target directory is a filesystem root, such as \??\C:\, then + * it already will have a trailing slash. Don't include this slash if + * we are already adding slashes via 'relpath'. This prevents an extra + * slash from being generated each time the link is extracted. And + * unlike on UNIX, the number of slashes in paths on Windows can be + * significant; Windows won't understand the link target if it contains + * too many slashes. */ + if (target_ntpath_nchars > 0 && relpath_nchars > 0 && + ctx->target_ntpath.Buffer[target_ntpath_nchars - 1] == L'\\') + target_ntpath_nchars--; + + /* Also remove extra slashes from the beginning of 'relpath'. Normally + * this isn't needed, but this is here to make the extra slash(es) added + * by wimlib pre-v1.9.1 get removed automatically. */ + while (relpath_nchars >= 2 && + relpath[0] == L'\\' && relpath[1] == L'\\') { + relpath++; + relpath_nchars--; + } + + fixed_subst_name_nchars = target_ntpath_nchars + relpath_nchars; + + wchar_t fixed_subst_name[fixed_subst_name_nchars]; + + wmemcpy(fixed_subst_name, ctx->target_ntpath.Buffer, target_ntpath_nchars); + wmemcpy(&fixed_subst_name[target_ntpath_nchars], relpath, relpath_nchars); + /* Doesn't need to be null-terminated. */ + + /* Print name should be Win32, but not all NT names can even be + * translated to Win32 names. But we can at least delete the top-level + * directory, such as \??\, and this will have the expected result in + * the usual case. */ + fixed_print_name = skip_nt_toplevel_component(fixed_subst_name, + fixed_subst_name_nchars); + fixed_print_name_nchars = fixed_subst_name_nchars - (fixed_print_name - + fixed_subst_name); + + link.substitute_name = fixed_subst_name; + link.substitute_name_nbytes = fixed_subst_name_nchars * sizeof(wchar_t); + link.print_name = (wchar_t *)fixed_print_name; + link.print_name_nbytes = fixed_print_name_nchars * sizeof(wchar_t); + make_link_reparse_point(&link, rpbuf, rpbuflen_p); +} + +/* Sets the reparse point on the specified file. This handles "fixing" the + * targets of absolute symbolic links and junctions if WIMLIB_EXTRACT_FLAG_RPFIX + * was specified. */ +static int +set_reparse_point(const struct wim_dentry *dentry, + const struct reparse_buffer_disk *rpbuf, u16 rpbuflen, + struct win32_apply_ctx *ctx) +{ + if ((ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_RPFIX) + && !(dentry->d_inode->i_rp_flags & WIM_RP_FLAG_NOT_FIXED)) + { + memcpy(&ctx->rpfixbuf, rpbuf, rpbuflen); + try_rpfix(&ctx->rpfixbuf, &rpbuflen, ctx); + rpbuf = &ctx->rpfixbuf; + } + return do_set_reparse_point(dentry, rpbuf, rpbuflen, ctx); + +} + +/* Import the next block of raw encrypted data */ +static DWORD WINAPI +import_encrypted_data(PBYTE pbData, PVOID pvCallbackContext, PULONG Length) +{ + struct win32_apply_ctx *ctx = pvCallbackContext; + ULONG copy_len; + + copy_len = min(ctx->encrypted_size - ctx->encrypted_offset, *Length); + memcpy(pbData, &ctx->data_buffer[ctx->encrypted_offset], copy_len); + ctx->encrypted_offset += copy_len; + *Length = copy_len; + return ERROR_SUCCESS; +} + +/* + * Write the raw encrypted data to the already-created file (or directory) + * corresponding to @dentry. + * + * The raw encrypted data is provided in ctx->data_buffer, and its size is + * ctx->encrypted_size. + * + * This function may close the target directory, in which case the caller needs + * to re-open it if needed. + */ +static int +extract_encrypted_file(const struct wim_dentry *dentry, + struct win32_apply_ctx *ctx) +{ + void *rawctx; + DWORD err; + ULONG flags; + bool retried; + + /* Temporarily build a Win32 path for OpenEncryptedFileRaw() */ + build_win32_extraction_path(dentry, ctx); + + flags = CREATE_FOR_IMPORT | OVERWRITE_HIDDEN; + if (dentry->d_inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY) + flags |= CREATE_FOR_DIR; + + retried = false; +retry: + err = OpenEncryptedFileRaw(ctx->pathbuf.Buffer, flags, &rawctx); + if (err == ERROR_SHARING_VIOLATION && !retried) { + /* This can be caused by the handle we have open to the target + * directory. Try closing it temporarily. */ + close_target_directory(ctx); + retried = true; + goto retry; + } + + /* Restore the NT namespace path */ + build_extraction_path(dentry, ctx); + + if (err != ERROR_SUCCESS) { + win32_error(err, L"Can't open \"%ls\" for encrypted import", + current_path(ctx)); + return WIMLIB_ERR_OPEN; + } + + ctx->encrypted_offset = 0; + + err = WriteEncryptedFileRaw(import_encrypted_data, ctx, rawctx); + + CloseEncryptedFileRaw(rawctx); + + if (err != ERROR_SUCCESS) { + win32_error(err, L"Can't import encrypted file \"%ls\"", + current_path(ctx)); + return WIMLIB_ERR_WRITE; + } + + return 0; +} + +/* Called when starting to read a blob for extraction */ +static int +win32_begin_extract_blob(struct blob_descriptor *blob, void *_ctx) +{ + struct win32_apply_ctx *ctx = _ctx; + const struct blob_extraction_target *targets = blob_extraction_targets(blob); + int ret; + + ctx->num_open_handles = 0; + ctx->data_buffer_ptr = NULL; + ctx->any_sparse_streams = false; + INIT_LIST_HEAD(&ctx->reparse_dentries); + INIT_LIST_HEAD(&ctx->encrypted_dentries); + + for (u32 i = 0; i < blob->out_refcnt; i++) { + const struct wim_inode *inode = targets[i].inode; + const struct wim_inode_stream *strm = targets[i].stream; + struct wim_dentry *dentry; + + /* A copy of the blob needs to be extracted to @inode. */ + + if (ctx->common.supported_features.hard_links) { + dentry = inode_first_extraction_dentry(inode); + ret = begin_extract_blob_instance(blob, dentry, strm, ctx); + ret = check_apply_error(dentry, ctx, ret); + if (ret) + goto fail; + } else { + /* Hard links not supported. Extract the blob + * separately to each alias of the inode. */ + inode_for_each_extraction_alias(dentry, inode) { + ret = begin_extract_blob_instance(blob, dentry, strm, ctx); + ret = check_apply_error(dentry, ctx, ret); + if (ret) + goto fail; + } + } + } + + return 0; + +fail: + close_handles(ctx); + return ret; +} + +static int +pwrite_to_handle(HANDLE h, const void *data, size_t size, u64 offset) +{ + const void * const end = data + size; + const void *p; + IO_STATUS_BLOCK iosb; + NTSTATUS status; + + for (p = data; p != end; p += iosb.Information, + offset += iosb.Information) + { + LARGE_INTEGER offs = { .QuadPart = offset }; + + status = NtWriteFile(h, NULL, NULL, NULL, &iosb, + (void *)p, min(INT32_MAX, end - p), + &offs, NULL); + if (!NT_SUCCESS(status)) { + winnt_error(status, + L"Error writing data to target volume"); + return WIMLIB_ERR_WRITE; + } + } + return 0; +} + +/* Called when the next chunk of a blob has been read for extraction */ +static int +win32_extract_chunk(const struct blob_descriptor *blob, u64 offset, + const void *chunk, size_t size, void *_ctx) +{ + struct win32_apply_ctx *ctx = _ctx; + const void * const end = chunk + size; + const void *p; + bool zeroes; + size_t len; + unsigned i; + int ret; + + /* + * For sparse streams, only write nonzero regions. This lets the + * filesystem use holes to represent zero regions. + */ + for (p = chunk; p != end; p += len, offset += len) { + zeroes = maybe_detect_sparse_region(p, end - p, &len, + ctx->any_sparse_streams); + for (i = 0; i < ctx->num_open_handles; i++) { + if (!zeroes || !ctx->is_sparse_stream[i]) { + ret = pwrite_to_handle(ctx->open_handles[i], + p, len, offset); + if (ret) + return ret; + } + } + } + + /* Copy the data chunk into the buffer (if needed) */ + if (ctx->data_buffer_ptr) + ctx->data_buffer_ptr = mempcpy(ctx->data_buffer_ptr, + chunk, size); + return 0; +} + +static int +get_system_compression_format(int extract_flags) +{ + if (extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K) + return FILE_PROVIDER_COMPRESSION_XPRESS4K; + + if (extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K) + return FILE_PROVIDER_COMPRESSION_XPRESS8K; + + if (extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K) + return FILE_PROVIDER_COMPRESSION_XPRESS16K; + + return FILE_PROVIDER_COMPRESSION_LZX; +} + + +static const wchar_t * +get_system_compression_format_string(int format) +{ + switch (format) { + case FILE_PROVIDER_COMPRESSION_XPRESS4K: + return L"XPRESS4K"; + case FILE_PROVIDER_COMPRESSION_XPRESS8K: + return L"XPRESS8K"; + case FILE_PROVIDER_COMPRESSION_XPRESS16K: + return L"XPRESS16K"; + default: + return L"LZX"; + } +} + +static NTSTATUS +set_system_compression(HANDLE h, int format) +{ + NTSTATUS status; + struct { + WOF_EXTERNAL_INFO wof_info; + FILE_PROVIDER_EXTERNAL_INFO_V1 file_info; + } in = { + .wof_info = { + .Version = WOF_CURRENT_VERSION, + .Provider = WOF_PROVIDER_FILE, + }, + .file_info = { + .Version = FILE_PROVIDER_CURRENT_VERSION, + .Algorithm = format, + }, + }; + + /* We intentionally use NtFsControlFile() rather than DeviceIoControl() + * here because the "compressing this object would not save space" + * status code does not map to a valid Win32 error code on older + * versions of Windows (before Windows 10?). This can be a problem if + * the WOFADK driver is being used rather than the regular WOF, since + * WOFADK can be used on older versions of Windows. */ + status = winnt_fsctl(h, FSCTL_SET_EXTERNAL_BACKING, + &in, sizeof(in), NULL, 0, NULL); + + if (status == 0xC000046F) /* "Compressing this object would not save space." */ + return STATUS_SUCCESS; + + return status; +} + +/* Hard-coded list of files which the Windows bootloader may need to access + * before the WOF driver has been loaded. */ +static const wchar_t * const bootloader_pattern_strings[] = { + L"*winload.*", + L"*winresume.*", + L"\\Windows\\AppPatch\\drvmain.sdb", + L"\\Windows\\Boot\\DVD\\*", + L"\\Windows\\Boot\\EFI\\*", + L"\\Windows\\bootstat.dat", + L"\\Windows\\Fonts\\vgaoem.fon", + L"\\Windows\\Fonts\\vgasys.fon", + L"\\Windows\\INF\\errata.inf", + L"\\Windows\\System32\\config\\*", + L"\\Windows\\System32\\ntkrnlpa.exe", + L"\\Windows\\System32\\ntoskrnl.exe", + L"\\Windows\\System32\\bootvid.dll", + L"\\Windows\\System32\\ci.dll", + L"\\Windows\\System32\\hal*.dll", + L"\\Windows\\System32\\mcupdate_AuthenticAMD.dll", + L"\\Windows\\System32\\mcupdate_GenuineIntel.dll", + L"\\Windows\\System32\\pshed.dll", + L"\\Windows\\System32\\apisetschema.dll", + L"\\Windows\\System32\\api-ms-win*.dll", + L"\\Windows\\System32\\ext-ms-win*.dll", + L"\\Windows\\System32\\KernelBase.dll", + L"\\Windows\\System32\\drivers\\*.sys", + L"\\Windows\\System32\\*.nls", + L"\\Windows\\System32\\kbd*.dll", + L"\\Windows\\System32\\kd*.dll", + L"\\Windows\\System32\\clfs.sys", + L"\\Windows\\System32\\CodeIntegrity\\driver.stl", +}; + +static const struct string_list bootloader_patterns = { + .strings = (wchar_t **)bootloader_pattern_strings, + .num_strings = ARRAY_LEN(bootloader_pattern_strings), +}; + +/* Returns true if the specified system compression format is supported by the + * bootloader of the image being applied. */ +static bool +bootloader_supports_compression_format(struct win32_apply_ctx *ctx, int format) +{ + /* Windows 10 and later support XPRESS4K */ + if (format == FILE_PROVIDER_COMPRESSION_XPRESS4K) + return ctx->windows_build_number >= 10240; + + /* + * Windows 10 version 1903 and later support the other formats; + * see https://wimlib.net/forums/viewtopic.php?f=1&t=444 + */ + return ctx->windows_build_number >= 18362; +} + +static NTSTATUS +set_system_compression_on_inode(struct wim_inode *inode, int format, + struct win32_apply_ctx *ctx) +{ + bool retried = false; + NTSTATUS status; + HANDLE h; + + /* If it may be needed for compatibility with the Windows bootloader, + * force this file to XPRESS4K or uncompressed format. */ + if (!bootloader_supports_compression_format(ctx, format)) { + /* We need to check the patterns against every name of the + * inode, in case any of them match. */ + struct wim_dentry *dentry; + inode_for_each_extraction_alias(dentry, inode) { + bool incompatible; + bool warned; + + if (calculate_dentry_full_path(dentry)) { + ERROR("Unable to compute file path!"); + return STATUS_NO_MEMORY; + } + + incompatible = match_pattern_list(dentry->d_full_path, + &bootloader_patterns, + MATCH_RECURSIVELY); + FREE(dentry->d_full_path); + dentry->d_full_path = NULL; + + if (!incompatible) + continue; + + warned = (ctx->num_system_compression_exclusions++ > 0); + + if (bootloader_supports_compression_format(ctx, + FILE_PROVIDER_COMPRESSION_XPRESS4K)) + { + /* Force to XPRESS4K */ + if (!warned) { + WARNING("For compatibility with the " + "Windows bootloader, some " + "files are being\n" + " compacted " + "using the XPRESS4K format " + "instead of the %"TS" format\n" + " you requested.", + get_system_compression_format_string(format)); + } + format = FILE_PROVIDER_COMPRESSION_XPRESS4K; + break; + } else { + /* Force to uncompressed */ + if (!warned) { + WARNING("For compatibility with the " + "Windows bootloader, some " + "files will not\n" + " be compressed with" + " system compression " + "(\"compacted\")."); + } + return STATUS_SUCCESS; + } + + } + } + + /* Open the extracted file. */ + status = create_file(&h, GENERIC_READ | GENERIC_WRITE, NULL, + 0, FILE_OPEN, 0, + inode_first_extraction_dentry(inode), ctx); + + if (!NT_SUCCESS(status)) + return status; +retry: + /* Compress the file. If the attempt fails with "invalid device + * request", then attach wof.sys (or wofadk.sys) and retry. */ + status = set_system_compression(h, format); + if (unlikely(status == STATUS_INVALID_DEVICE_REQUEST && !retried)) { + wchar_t drive_path[7]; + if (!win32_get_drive_path(ctx->common.target, drive_path) && + win32_try_to_attach_wof(drive_path + 4)) { + retried = true; + goto retry; + } + } + + NtClose(h); + return status; +} + +/* + * This function is called when doing a "compact-mode" extraction and we just + * finished extracting a blob to one or more locations. For each location that + * was the unnamed data stream of a file, this function compresses the + * corresponding file using System Compression, if allowed. + * + * Note: we're doing the compression immediately after extracting the data + * rather than during a separate compression pass. This way should be faster + * since the operating system should still have the file's data cached. + * + * Note: we're having the operating system do the compression, which is not + * ideal because wimlib could create the compressed data faster and more + * efficiently (the compressed data format is identical to a WIM resource). But + * we seemingly don't have a choice because WOF prevents applications from + * creating its reparse points. + */ +static void +handle_system_compression(struct blob_descriptor *blob, struct win32_apply_ctx *ctx) +{ + const struct blob_extraction_target *targets = blob_extraction_targets(blob); + + const int format = get_system_compression_format(ctx->common.extract_flags); + + for (u32 i = 0; i < blob->out_refcnt; i++) { + struct wim_inode *inode = targets[i].inode; + struct wim_inode_stream *strm = targets[i].stream; + NTSTATUS status; + + if (!stream_is_unnamed_data_stream(strm)) + continue; + + if (will_externally_back_inode(inode, ctx, NULL, false) != 0) + continue; + + status = set_system_compression_on_inode(inode, format, ctx); + if (likely(NT_SUCCESS(status))) + continue; + + if (status == STATUS_INVALID_DEVICE_REQUEST) { + WARNING( + "The request to compress the extracted files using System Compression\n" +" will not be honored because the operating system or target volume\n" +" does not support it. System Compression is only supported on\n" +" Windows 10 and later, and only on NTFS volumes."); + ctx->common.extract_flags &= ~COMPACT_FLAGS; + return; + } + + ctx->num_system_compression_failures++; + if (ctx->num_system_compression_failures < 10) { + winnt_warning(status, L"\"%ls\": Failed to compress " + "extracted file using System Compression", + current_path(ctx)); + } else if (ctx->num_system_compression_failures == 10) { + WARNING("Suppressing further warnings about " + "System Compression failures."); + } + } +} + +/* Called when a blob has been fully read for extraction */ +static int +win32_end_extract_blob(struct blob_descriptor *blob, int status, void *_ctx) +{ + struct win32_apply_ctx *ctx = _ctx; + int ret; + const struct wim_dentry *dentry; + + /* Extend sparse streams to their final size. */ + if (ctx->any_sparse_streams && !status) { + for (unsigned i = 0; i < ctx->num_open_handles; i++) { + FILE_END_OF_FILE_INFORMATION info = + { .EndOfFile = { .QuadPart = blob->size } }; + NTSTATUS ntstatus; + + if (!ctx->is_sparse_stream[i]) + continue; + + ntstatus = NtSetInformationFile(ctx->open_handles[i], + &ctx->iosb, + &info, sizeof(info), + FileEndOfFileInformation); + if (!NT_SUCCESS(ntstatus)) { + winnt_error(ntstatus, L"Error writing data to " + "target volume (while extending)"); + status = WIMLIB_ERR_WRITE; + break; + } + } + } + + close_handles(ctx); + + if (status) + return status; + + if (unlikely(ctx->common.extract_flags & COMPACT_FLAGS)) + handle_system_compression(blob, ctx); + + if (likely(!ctx->data_buffer_ptr)) + return 0; + + if (!list_empty(&ctx->reparse_dentries)) { + if (blob->size > REPARSE_DATA_MAX_SIZE) { + dentry = list_first_entry(&ctx->reparse_dentries, + struct wim_dentry, d_tmp_list); + build_extraction_path(dentry, ctx); + ERROR("Reparse data of \"%ls\" has size " + "%"PRIu64" bytes (exceeds %u bytes)", + current_path(ctx), blob->size, + REPARSE_DATA_MAX_SIZE); + ret = WIMLIB_ERR_INVALID_REPARSE_DATA; + return check_apply_error(dentry, ctx, ret); + } + /* Reparse data */ + memcpy(ctx->rpbuf.rpdata, ctx->data_buffer, blob->size); + + list_for_each_entry(dentry, &ctx->reparse_dentries, d_tmp_list) { + + /* Reparse point header */ + complete_reparse_point(&ctx->rpbuf, dentry->d_inode, + blob->size); + + ret = set_reparse_point(dentry, &ctx->rpbuf, + REPARSE_DATA_OFFSET + blob->size, + ctx); + ret = check_apply_error(dentry, ctx, ret); + if (ret) + return ret; + } + } + + if (!list_empty(&ctx->encrypted_dentries)) { + ctx->encrypted_size = blob->size; + list_for_each_entry(dentry, &ctx->encrypted_dentries, d_tmp_list) { + ret = extract_encrypted_file(dentry, ctx); + ret = check_apply_error(dentry, ctx, ret); + if (ret) + return ret; + /* Re-open the target directory if needed. */ + ret = open_target_directory(ctx); + if (ret) + return ret; + } + } + + return 0; +} + +/* Attributes that can't be set directly */ +#define SPECIAL_ATTRIBUTES \ + (FILE_ATTRIBUTE_REPARSE_POINT | \ + FILE_ATTRIBUTE_DIRECTORY | \ + FILE_ATTRIBUTE_ENCRYPTED | \ + FILE_ATTRIBUTE_SPARSE_FILE | \ + FILE_ATTRIBUTE_COMPRESSED) + +static void +set_object_id(HANDLE h, const struct wim_inode *inode, + struct win32_apply_ctx *ctx) +{ + const void *object_id; + u32 len; + NTSTATUS status; + + if (!ctx->common.supported_features.object_ids) + return; + + object_id = inode_get_object_id(inode, &len); + if (likely(object_id == NULL)) /* No object ID? */ + return; + + status = winnt_fsctl(h, FSCTL_SET_OBJECT_ID, + object_id, len, NULL, 0, NULL); + if (NT_SUCCESS(status)) + return; + + /* Object IDs must be unique within the filesystem. A duplicate might + * occur if an image containing object IDs is applied twice to the same + * filesystem. Arguably, the user should be warned in this case; but + * the reality seems to be that nothing important cares about object IDs + * except the Distributed Link Tracking Service... so for now these + * failures are just ignored. */ + if (status == STATUS_DUPLICATE_NAME || + status == STATUS_OBJECT_NAME_COLLISION) + return; + + ctx->num_object_id_failures++; + if (ctx->num_object_id_failures < 10) { + winnt_warning(status, L"Can't set object ID on \"%ls\"", + current_path(ctx)); + } else if (ctx->num_object_id_failures == 10) { + WARNING("Suppressing further warnings about failure to set " + "object IDs."); + } +} + +static int +set_xattrs(HANDLE h, const struct wim_inode *inode, struct win32_apply_ctx *ctx) +{ + const void *entries, *entries_end; + u32 len; + const struct wim_xattr_entry *entry; + size_t bufsize = 0; + u8 _buf[1024] __attribute__((aligned(4))); + u8 *buf = _buf; + FILE_FULL_EA_INFORMATION *ea, *ea_prev; + NTSTATUS status; + int ret; + + if (!ctx->common.supported_features.xattrs) + return 0; + + entries = inode_get_xattrs(inode, &len); + if (likely(entries == NULL || len == 0)) /* No extended attributes? */ + return 0; + entries_end = entries + len; + + entry = entries; + for (entry = entries; (void *)entry < entries_end; + entry = xattr_entry_next(entry)) { + if (!valid_xattr_entry(entry, entries_end - (void *)entry)) { + ERROR("\"%"TS"\": extended attribute is corrupt or unsupported", + inode_any_full_path(inode)); + return WIMLIB_ERR_INVALID_XATTR; + } + + bufsize += ALIGN(offsetof(FILE_FULL_EA_INFORMATION, EaName) + + entry->name_len + 1 + + le16_to_cpu(entry->value_len), 4); + } + + if (unlikely(bufsize != (u32)bufsize)) { + ERROR("\"%"TS"\": too many extended attributes to extract!", + inode_any_full_path(inode)); + return WIMLIB_ERR_INVALID_XATTR; + } + + if (unlikely(bufsize > sizeof(_buf))) { + buf = MALLOC(bufsize); + if (!buf) + return WIMLIB_ERR_NOMEM; + } + + ea_prev = NULL; + ea = (FILE_FULL_EA_INFORMATION *)buf; + for (entry = entries; (void *)entry < entries_end; + entry = xattr_entry_next(entry)) { + u8 *p; + + if (ea_prev) + ea_prev->NextEntryOffset = (u8 *)ea - (u8 *)ea_prev; + ea->Flags = entry->flags; + ea->EaNameLength = entry->name_len; + ea->EaValueLength = le16_to_cpu(entry->value_len); + p = mempcpy(ea->EaName, entry->name, + ea->EaNameLength + 1 + ea->EaValueLength); + while ((uintptr_t)p & 3) + *p++ = 0; + ea_prev = ea; + ea = (FILE_FULL_EA_INFORMATION *)p; + } + ea_prev->NextEntryOffset = 0; + wimlib_assert((u8 *)ea - buf == bufsize); + + status = NtSetEaFile(h, &ctx->iosb, buf, bufsize); + if (unlikely(!NT_SUCCESS(status))) { + if (status == STATUS_EAS_NOT_SUPPORTED) { + /* This happens with Samba. */ + WARNING("Filesystem advertised extended attribute (EA) support, but it doesn't\n" + " work. EAs will not be extracted."); + ctx->common.supported_features.xattrs = 0; + } else if (status == STATUS_INVALID_EA_NAME) { + ctx->num_xattr_failures++; + if (ctx->num_xattr_failures < 5) { + winnt_warning(status, + L"Can't set extended attributes on \"%ls\"", + current_path(ctx)); + } else if (ctx->num_xattr_failures == 5) { + WARNING("Suppressing further warnings about " + "failure to set extended attributes."); + } + } else { + winnt_error(status, L"Can't set extended attributes on \"%ls\"", + current_path(ctx)); + ret = WIMLIB_ERR_SET_XATTR; + goto out; + } + } + ret = 0; +out: + if (buf != _buf) + FREE(buf); + return ret; +} + +/* Set the security descriptor @desc, of @desc_size bytes, on the file with open + * handle @h. */ +static NTSTATUS +set_security_descriptor(HANDLE h, const void *_desc, + size_t desc_size, struct win32_apply_ctx *ctx) +{ + SECURITY_INFORMATION info; + NTSTATUS status; + SECURITY_DESCRIPTOR_RELATIVE *desc; + + /* + * Ideally, we would just pass in the security descriptor buffer as-is. + * But it turns out that Windows can mess up the security descriptor + * even when using the low-level NtSetSecurityObject() function: + * + * - Windows will clear SE_DACL_AUTO_INHERITED if it is set in the + * passed buffer. To actually get Windows to set + * SE_DACL_AUTO_INHERITED, the application must set the non-persistent + * flag SE_DACL_AUTO_INHERIT_REQ. As usual, Microsoft didn't bother + * to properly document either of these flags. It's unclear how + * important SE_DACL_AUTO_INHERITED actually is, but to be safe we use + * the SE_DACL_AUTO_INHERIT_REQ workaround to set it if needed. + * + * - The above also applies to the equivalent SACL flags, + * SE_SACL_AUTO_INHERITED and SE_SACL_AUTO_INHERIT_REQ. + * + * - If the application says that it's setting + * DACL_SECURITY_INFORMATION, then Windows sets SE_DACL_PRESENT in the + * resulting security descriptor, even if the security descriptor the + * application provided did not have a DACL. This seems to be + * unavoidable, since omitting DACL_SECURITY_INFORMATION would cause a + * default DACL to remain. Fortunately, this behavior seems harmless, + * since the resulting DACL will still be "null" --- but it will be + * "the other representation of null". + * + * - The above also applies to SACL_SECURITY_INFORMATION and + * SE_SACL_PRESENT. Again, it's seemingly unavoidable but "harmless" + * that Windows changes the representation of a "null SACL". + */ + if (likely(desc_size <= STACK_MAX)) { + desc = alloca(desc_size); + } else { + desc = MALLOC(desc_size); + if (!desc) + return STATUS_NO_MEMORY; + } + + memcpy(desc, _desc, desc_size); + + if (likely(desc_size >= 4)) { + + if (desc->Control & SE_DACL_AUTO_INHERITED) + desc->Control |= SE_DACL_AUTO_INHERIT_REQ; + + if (desc->Control & SE_SACL_AUTO_INHERITED) + desc->Control |= SE_SACL_AUTO_INHERIT_REQ; + } + + /* + * More API insanity. We want to set the entire security descriptor + * as-is. But all available APIs require specifying the specific parts + * of the security descriptor being set. Especially annoying is that + * mandatory integrity labels are part of the SACL, but they aren't set + * with SACL_SECURITY_INFORMATION. Instead, applications must also + * specify LABEL_SECURITY_INFORMATION (Windows Vista, Windows 7) or + * BACKUP_SECURITY_INFORMATION (Windows 8). But at least older versions + * of Windows don't error out if you provide these newer flags... + * + * Also, if the process isn't running as Administrator, then it probably + * doesn't have SE_RESTORE_PRIVILEGE. In this case, it will always get + * the STATUS_PRIVILEGE_NOT_HELD error by trying to set the SACL, even + * if the security descriptor it provided did not have a SACL. By + * default, in this case we try to recover and set as much of the + * security descriptor as possible --- potentially excluding the DACL, and + * even the owner, as well as the SACL. + */ + + info = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | + DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION | + LABEL_SECURITY_INFORMATION | BACKUP_SECURITY_INFORMATION; + + + /* + * It's also worth noting that SetFileSecurity() is unusable because it + * doesn't request "backup semantics" when it opens the file internally. + * NtSetSecurityObject() seems to be the best function to use in backup + * applications. (SetSecurityInfo() should also work, but it's harder + * to use and must call NtSetSecurityObject() internally anyway. + * BackupWrite() is theoretically usable as well, but it's inflexible + * and poorly documented.) + */ + +retry: + status = NtSetSecurityObject(h, info, desc); + if (NT_SUCCESS(status)) + goto out_maybe_free_desc; + + /* Failed to set the requested parts of the security descriptor. If the + * error was permissions-related, try to set fewer parts of the security + * descriptor, unless WIMLIB_EXTRACT_FLAG_STRICT_ACLS is enabled. */ + if ((status == STATUS_PRIVILEGE_NOT_HELD || + status == STATUS_ACCESS_DENIED) && + !(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_ACLS)) + { + if (info & SACL_SECURITY_INFORMATION) { + info &= ~(SACL_SECURITY_INFORMATION | + LABEL_SECURITY_INFORMATION | + BACKUP_SECURITY_INFORMATION); + ctx->partial_security_descriptors++; + goto retry; + } + if (info & DACL_SECURITY_INFORMATION) { + info &= ~DACL_SECURITY_INFORMATION; + goto retry; + } + if (info & OWNER_SECURITY_INFORMATION) { + info &= ~OWNER_SECURITY_INFORMATION; + goto retry; + } + /* Nothing left except GROUP, and if we removed it we + * wouldn't have anything at all. */ + } + + /* No part of the security descriptor could be set, or + * WIMLIB_EXTRACT_FLAG_STRICT_ACLS is enabled and the full security + * descriptor could not be set. */ + if (!(info & SACL_SECURITY_INFORMATION)) + ctx->partial_security_descriptors--; + ctx->no_security_descriptors++; + +out_maybe_free_desc: + if (unlikely(desc_size > STACK_MAX)) + FREE(desc); + return status; +} + +/* Set metadata on the open file @h from the WIM inode @inode. */ +static int +do_apply_metadata_to_file(HANDLE h, const struct wim_inode *inode, + struct win32_apply_ctx *ctx) +{ + FILE_BASIC_INFORMATION info; + NTSTATUS status; + int ret; + + /* Set the file's object ID if present and object IDs are supported by + * the filesystem. */ + set_object_id(h, inode, ctx); + + /* Set the file's extended attributes (EAs) if present and EAs are + * supported by the filesystem. */ + ret = set_xattrs(h, inode, ctx); + if (ret) + return ret; + + /* Set the file's security descriptor if present and we're not in + * NO_ACLS mode */ + if (inode_has_security_descriptor(inode) && + !(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_NO_ACLS)) + { + const struct wim_security_data *sd; + const void *desc; + size_t desc_size; + + sd = wim_get_current_security_data(ctx->common.wim); + desc = sd->descriptors[inode->i_security_id]; + desc_size = sd->sizes[inode->i_security_id]; + + status = set_security_descriptor(h, desc, desc_size, ctx); + if (!NT_SUCCESS(status) && + (ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_ACLS)) + { + winnt_error(status, + L"Can't set security descriptor on \"%ls\"", + current_path(ctx)); + return WIMLIB_ERR_SET_SECURITY; + } + } + + /* Set attributes and timestamps */ + info.CreationTime.QuadPart = inode->i_creation_time; + info.LastAccessTime.QuadPart = inode->i_last_access_time; + info.LastWriteTime.QuadPart = inode->i_last_write_time; + info.ChangeTime.QuadPart = 0; + if (ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES) { + info.FileAttributes = FILE_ATTRIBUTE_NORMAL; + } else { + info.FileAttributes = inode->i_attributes & ~SPECIAL_ATTRIBUTES; + if (info.FileAttributes == 0) + info.FileAttributes = FILE_ATTRIBUTE_NORMAL; + } + + status = NtSetInformationFile(h, &ctx->iosb, &info, sizeof(info), + FileBasicInformation); + /* On FAT volumes we get STATUS_INVALID_PARAMETER if we try to set + * attributes on the root directory. (Apparently because FAT doesn't + * actually have a place to store those attributes!) */ + if (!NT_SUCCESS(status) + && !(status == STATUS_INVALID_PARAMETER && + dentry_is_root(inode_first_extraction_dentry(inode)))) + { + winnt_error(status, L"Can't set basic metadata on \"%ls\"", + current_path(ctx)); + return WIMLIB_ERR_SET_ATTRIBUTES; + } + + return 0; +} + +static int +apply_metadata_to_file(const struct wim_dentry *dentry, + struct win32_apply_ctx *ctx) +{ + const struct wim_inode *inode = dentry->d_inode; + DWORD perms; + HANDLE h; + NTSTATUS status; + int ret; + + perms = FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | WRITE_DAC | + WRITE_OWNER | ACCESS_SYSTEM_SECURITY; + + build_extraction_path(dentry, ctx); + + /* Open a handle with as many relevant permissions as possible. */ + while (!NT_SUCCESS(status = do_create_file(&h, perms, NULL, + 0, FILE_OPEN, 0, ctx))) + { + if (status == STATUS_PRIVILEGE_NOT_HELD || + status == STATUS_ACCESS_DENIED) + { + if (perms & ACCESS_SYSTEM_SECURITY) { + perms &= ~ACCESS_SYSTEM_SECURITY; + continue; + } + if (perms & WRITE_DAC) { + perms &= ~WRITE_DAC; + continue; + } + if (perms & WRITE_OWNER) { + perms &= ~WRITE_OWNER; + continue; + } + } + winnt_error(status, L"Can't open \"%ls\" to set metadata", + current_path(ctx)); + return WIMLIB_ERR_OPEN; + } + + ret = do_apply_metadata_to_file(h, inode, ctx); + + NtClose(h); + + return ret; +} + +static int +apply_metadata(struct list_head *dentry_list, struct win32_apply_ctx *ctx) +{ + const struct wim_dentry *dentry; + int ret; + + /* We go in reverse so that metadata is set on all a directory's + * children before the directory itself. This avoids any potential + * problems with attributes, timestamps, or security descriptors. */ + list_for_each_entry_reverse(dentry, dentry_list, d_extraction_list_node) + { + ret = apply_metadata_to_file(dentry, ctx); + ret = check_apply_error(dentry, ctx, ret); + if (ret) + return ret; + ret = report_file_metadata_applied(&ctx->common); + if (ret) + return ret; + } + return 0; +} + +/* Issue warnings about problems during the extraction for which warnings were + * not already issued (due to the high number of potential warnings if we issued + * them per-file). */ +static void +do_warnings(const struct win32_apply_ctx *ctx) +{ + if (ctx->partial_security_descriptors == 0 + && ctx->no_security_descriptors == 0 + && ctx->num_set_short_name_failures == 0 + #if 0 + && ctx->num_remove_short_name_failures == 0 + #endif + ) + return; + + WARNING("Extraction to \"%ls\" complete, but with one or more warnings:", + ctx->common.target); + if (ctx->num_set_short_name_failures) { + WARNING("- Could not set short names on %lu files or directories", + ctx->num_set_short_name_failures); + } +#if 0 + if (ctx->num_remove_short_name_failures) { + WARNING("- Could not remove short names on %lu files or directories" + " (This is expected on Vista and earlier)", + ctx->num_remove_short_name_failures); + } +#endif + if (ctx->partial_security_descriptors) { + WARNING("- Could only partially set the security descriptor\n" + " on %lu files or directories.", + ctx->partial_security_descriptors); + } + if (ctx->no_security_descriptors) { + WARNING("- Could not set security descriptor at all\n" + " on %lu files or directories.", + ctx->no_security_descriptors); + } + if (ctx->partial_security_descriptors || ctx->no_security_descriptors) { + WARNING("To fully restore all security descriptors, run the program\n" + " with Administrator rights."); + } +} + +static u64 +count_dentries(const struct list_head *dentry_list) +{ + const struct list_head *cur; + u64 count = 0; + + list_for_each(cur, dentry_list) + count++; + + return count; +} + +/* Extract files from a WIM image to a directory on Windows */ +static int +win32_extract(struct list_head *dentry_list, struct apply_ctx *_ctx) +{ + int ret; + struct win32_apply_ctx *ctx = (struct win32_apply_ctx *)_ctx; + u64 dentry_count; + + ret = prepare_target(dentry_list, ctx); + if (ret) + goto out; + + if (unlikely(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_WIMBOOT)) { + ret = start_wimboot_extraction(dentry_list, ctx); + if (ret) + goto out; + } + + ctx->windows_build_number = xml_get_windows_build_number(ctx->common.wim->xml_info, + ctx->common.wim->current_image); + + dentry_count = count_dentries(dentry_list); + + ret = start_file_structure_phase(&ctx->common, dentry_count); + if (ret) + goto out; + + ret = create_directories(dentry_list, ctx); + if (ret) + goto out; + + ret = create_nondirectories(dentry_list, ctx); + if (ret) + goto out; + + ret = end_file_structure_phase(&ctx->common); + if (ret) + goto out; + + struct read_blob_callbacks cbs = { + .begin_blob = win32_begin_extract_blob, + .continue_blob = win32_extract_chunk, + .end_blob = win32_end_extract_blob, + .ctx = ctx, + }; + ret = extract_blob_list(&ctx->common, &cbs); + if (ret) + goto out; + + ret = start_file_metadata_phase(&ctx->common, dentry_count); + if (ret) + goto out; + + ret = apply_metadata(dentry_list, ctx); + if (ret) + goto out; + + ret = end_file_metadata_phase(&ctx->common); + if (ret) + goto out; + + if (unlikely(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_WIMBOOT)) { + ret = end_wimboot_extraction(ctx); + if (ret) + goto out; + } + + do_warnings(ctx); +out: + close_target_directory(ctx); + if (ctx->target_ntpath.Buffer) + HeapFree(GetProcessHeap(), 0, ctx->target_ntpath.Buffer); + FREE(ctx->pathbuf.Buffer); + FREE(ctx->print_buffer); + FREE(ctx->wimboot.wims); + if (ctx->prepopulate_pats) { + FREE(ctx->prepopulate_pats->strings); + FREE(ctx->prepopulate_pats); + } + FREE(ctx->mem_prepopulate_pats); + FREE(ctx->data_buffer); + return ret; +} + +const struct apply_operations win32_apply_ops = { + .name = "Windows", + .get_supported_features = win32_get_supported_features, + .extract = win32_extract, + .will_back_from_wim = win32_will_back_from_wim, + .context_size = sizeof(struct win32_apply_ctx), +}; + +#endif /* _WIN32 */ diff --git a/src/wimlib/win32_capture.c b/src/wimlib/win32_capture.c new file mode 100644 index 00000000..958147e6 --- /dev/null +++ b/src/wimlib/win32_capture.c @@ -0,0 +1,3050 @@ +/* + * win32_capture.c - Windows-specific code for capturing files into a WIM image. + * + * This now uses the native Windows NT API a lot and not just Win32. + */ + +/* + * Copyright (C) 2013-2021 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef _WIN32 + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/win32_common.h" + +#include "wimlib/assert.h" +#include "wimlib/blob_table.h" +#include "wimlib/dentry.h" +#include "wimlib/encoding.h" +#include "wimlib/endianness.h" +#include "wimlib/error.h" +#include "wimlib/object_id.h" +#include "wimlib/paths.h" +#include "wimlib/reparse.h" +#include "wimlib/scan.h" +#include "wimlib/win32_vss.h" +#include "wimlib/wof.h" +#include "wimlib/xattr.h" + +struct winnt_scan_ctx { + struct scan_params *params; + bool is_ntfs; + u32 vol_flags; + unsigned long num_get_sd_access_denied; + unsigned long num_get_sacl_priv_notheld; + + /* True if WOF is definitely not attached to the volume being scanned; + * false if it may be */ + bool wof_not_attached; + + /* A reference to the VSS snapshot being used, or NULL if none */ + struct vss_snapshot *snapshot; +}; + +static inline const wchar_t * +printable_path(const struct winnt_scan_ctx *ctx) +{ + /* Skip over \\?\ or \??\ */ + return ctx->params->cur_path + 4; +} + +/* Description of where data is located on a Windows filesystem */ +struct windows_file { + + /* Is the data the raw encrypted data of an EFS-encrypted file? */ + u64 is_encrypted : 1; + + /* Is this file "open by file ID" rather than the regular "open by + * path"? "Open by file ID" uses resources more efficiently. */ + u64 is_file_id : 1; + + /* The file's LCN (logical cluster number) for sorting, or 0 if unknown. + */ + u64 sort_key : 62; + + /* Length of the path in bytes, excluding the null terminator if + * present. */ + size_t path_nbytes; + + /* A reference to the VSS snapshot containing the file, or NULL if none. + */ + struct vss_snapshot *snapshot; + + /* The path to the file. If 'is_encrypted=0' this is an NT namespace + * path; if 'is_encrypted=1' this is a Win32 namespace path. If + * 'is_file_id=0', then the path is null-terminated. If 'is_file_id=1' + * (only allowed with 'is_encrypted=0') the path ends with a binary file + * ID and may not be null-terminated. */ + wchar_t path[0]; +}; + +/* Allocate a structure to describe the location of a data stream by path. */ +static struct windows_file * +alloc_windows_file(const wchar_t *path, size_t path_nchars, + const wchar_t *stream_name, size_t stream_name_nchars, + struct vss_snapshot *snapshot, bool is_encrypted) +{ + size_t full_path_nbytes; + struct windows_file *file; + wchar_t *p; + + full_path_nbytes = path_nchars * sizeof(wchar_t); + if (stream_name_nchars) + full_path_nbytes += (1 + stream_name_nchars) * sizeof(wchar_t); + + file = MALLOC(sizeof(struct windows_file) + full_path_nbytes + + sizeof(wchar_t)); + if (!file) + return NULL; + + file->is_encrypted = is_encrypted; + file->is_file_id = 0; + file->sort_key = 0; + file->path_nbytes = full_path_nbytes; + file->snapshot = vss_get_snapshot(snapshot); + p = wmempcpy(file->path, path, path_nchars); + if (stream_name_nchars) { + /* Named data stream */ + *p++ = L':'; + p = wmempcpy(p, stream_name, stream_name_nchars); + } + *p = L'\0'; + return file; +} + +/* Allocate a structure to describe the location of a file by ID. */ +static struct windows_file * +alloc_windows_file_for_file_id(u64 file_id, const wchar_t *root_path, + size_t root_path_nchars, + struct vss_snapshot *snapshot) +{ + size_t full_path_nbytes; + struct windows_file *file; + wchar_t *p; + + full_path_nbytes = (root_path_nchars * sizeof(wchar_t)) + + sizeof(file_id); + file = MALLOC(sizeof(struct windows_file) + full_path_nbytes + + sizeof(wchar_t)); + if (!file) + return NULL; + + file->is_encrypted = 0; + file->is_file_id = 1; + file->sort_key = 0; + file->path_nbytes = full_path_nbytes; + file->snapshot = vss_get_snapshot(snapshot); + p = wmempcpy(file->path, root_path, root_path_nchars); + p = mempcpy(p, &file_id, sizeof(file_id)); + *p = L'\0'; + return file; +} + +/* Add a stream, located on a Windows filesystem, to the specified WIM inode. */ +static int +add_stream(struct wim_inode *inode, struct windows_file *windows_file, + u64 stream_size, int stream_type, const utf16lechar *stream_name, + struct list_head *unhashed_blobs) +{ + struct blob_descriptor *blob = NULL; + struct wim_inode_stream *strm; + int ret; + + if (!windows_file) + goto err_nomem; + + /* If the stream is nonempty, create a blob descriptor for it. */ + if (stream_size) { + blob = new_blob_descriptor(); + if (!blob) + goto err_nomem; + blob->windows_file = windows_file; + blob->blob_location = BLOB_IN_WINDOWS_FILE; + blob->file_inode = inode; + blob->size = stream_size; + windows_file = NULL; + } + + strm = inode_add_stream(inode, stream_type, stream_name, blob); + if (!strm) + goto err_nomem; + + prepare_unhashed_blob(blob, inode, strm->stream_id, unhashed_blobs); + ret = 0; +out: + if (windows_file) + free_windows_file(windows_file); + return ret; + +err_nomem: + free_blob_descriptor(blob); + ret = WIMLIB_ERR_NOMEM; + goto out; +} + +struct windows_file * +clone_windows_file(const struct windows_file *file) +{ + struct windows_file *new; + + new = memdup(file, sizeof(*file) + file->path_nbytes + sizeof(wchar_t)); + if (new) + vss_get_snapshot(new->snapshot); + return new; +} + +void +free_windows_file(struct windows_file *file) +{ + vss_put_snapshot(file->snapshot); + FREE(file); +} + +int +cmp_windows_files(const struct windows_file *file1, + const struct windows_file *file2) +{ + /* Compare by starting LCN (logical cluster number) */ + int v = cmp_u64(file1->sort_key, file2->sort_key); + if (v) + return v; + + /* Fall back to comparing files by path (arbitrary heuristic). */ + v = memcmp(file1->path, file2->path, + min(file1->path_nbytes, file2->path_nbytes)); + if (v) + return v; + + return cmp_u32(file1->path_nbytes, file2->path_nbytes); +} + +const wchar_t * +get_windows_file_path(const struct windows_file *file) +{ + return file->path; +} + +/* + * Open the file named by the NT namespace path @path of length @path_nchars + * characters. If @cur_dir is not NULL then the path is given relative to + * @cur_dir; otherwise the path is absolute. @perms is the access mask of + * permissions to request on the handle. SYNCHRONIZE permision is always added. + */ +static NTSTATUS +winnt_openat(HANDLE cur_dir, const wchar_t *path, size_t path_nchars, + ACCESS_MASK perms, HANDLE *h_ret) +{ + UNICODE_STRING name = { + .Length = path_nchars * sizeof(wchar_t), + .MaximumLength = path_nchars * sizeof(wchar_t), + .Buffer = (wchar_t *)path, + }; + OBJECT_ATTRIBUTES attr = { + .Length = sizeof(attr), + .RootDirectory = cur_dir, + .ObjectName = &name, + }; + IO_STATUS_BLOCK iosb; + NTSTATUS status; + ULONG options = FILE_OPEN_REPARSE_POINT | FILE_OPEN_FOR_BACKUP_INTENT; + + perms |= SYNCHRONIZE; + if (perms & (FILE_READ_DATA | FILE_LIST_DIRECTORY)) { + options |= FILE_SYNCHRONOUS_IO_NONALERT; + options |= FILE_SEQUENTIAL_ONLY; + } +retry: + status = NtOpenFile(h_ret, perms, &attr, &iosb, + FILE_SHARE_VALID_FLAGS, options); + if (!NT_SUCCESS(status)) { + /* Try requesting fewer permissions */ + if (status == STATUS_ACCESS_DENIED || + status == STATUS_PRIVILEGE_NOT_HELD) { + if (perms & ACCESS_SYSTEM_SECURITY) { + perms &= ~ACCESS_SYSTEM_SECURITY; + goto retry; + } + if (perms & READ_CONTROL) { + perms &= ~READ_CONTROL; + goto retry; + } + } + } + return status; +} + +static NTSTATUS +winnt_open(const wchar_t *path, size_t path_nchars, ACCESS_MASK perms, + HANDLE *h_ret) +{ + return winnt_openat(NULL, path, path_nchars, perms, h_ret); +} + +static const wchar_t * +windows_file_to_string(const struct windows_file *file, u8 *buf, size_t bufsize) +{ + if (file->is_file_id) { + u64 file_id; + memcpy(&file_id, + (u8 *)file->path + file->path_nbytes - sizeof(file_id), + sizeof(file_id)); + swprintf((wchar_t *)buf, L"NTFS inode 0x%016"PRIx64, file_id); + } else if (file->path_nbytes + 3 * sizeof(wchar_t) <= bufsize) { + swprintf((wchar_t *)buf, L"\"%ls\"", file->path); + } else { + return L"(name too long)"; + } + return (wchar_t *)buf; +} + +static int +read_winnt_stream_prefix(const struct windows_file *file, + u64 size, const struct consume_chunk_callback *cb) +{ + IO_STATUS_BLOCK iosb; + UNICODE_STRING name = { + .Buffer = (wchar_t *)file->path, + .Length = file->path_nbytes, + .MaximumLength = file->path_nbytes, + }; + OBJECT_ATTRIBUTES attr = { + .Length = sizeof(attr), + .ObjectName = &name, + }; + HANDLE h; + NTSTATUS status; + u8 buf[BUFFER_SIZE] __attribute__((aligned(8))); + u64 bytes_remaining; + int ret; + + status = NtOpenFile(&h, FILE_READ_DATA | SYNCHRONIZE, + &attr, &iosb, + FILE_SHARE_VALID_FLAGS, + FILE_OPEN_REPARSE_POINT | + FILE_OPEN_FOR_BACKUP_INTENT | + FILE_SYNCHRONOUS_IO_NONALERT | + FILE_SEQUENTIAL_ONLY | + (file->is_file_id ? FILE_OPEN_BY_FILE_ID : 0)); + if (unlikely(!NT_SUCCESS(status))) { + if (status == STATUS_SHARING_VIOLATION) { + ERROR("Can't open %ls for reading:\n" + " File is in use by another process! " + "Consider using snapshot (VSS) mode.", + windows_file_to_string(file, buf, sizeof(buf))); + } else { + winnt_error(status, L"Can't open %ls for reading", + windows_file_to_string(file, buf, sizeof(buf))); + } + return WIMLIB_ERR_OPEN; + } + + ret = 0; + bytes_remaining = size; + while (bytes_remaining) { + IO_STATUS_BLOCK iosb; + ULONG count; + ULONG bytes_read; + const unsigned max_tries = 5; + unsigned tries_remaining = max_tries; + + count = min(sizeof(buf), bytes_remaining); + + retry_read: + status = NtReadFile(h, NULL, NULL, NULL, + &iosb, buf, count, NULL, NULL); + if (unlikely(!NT_SUCCESS(status))) { + if (status == STATUS_END_OF_FILE) { + ERROR("%ls: File was concurrently truncated", + windows_file_to_string(file, buf, sizeof(buf))); + ret = WIMLIB_ERR_CONCURRENT_MODIFICATION_DETECTED; + } else { + winnt_warning(status, L"Error reading data from %ls", + windows_file_to_string(file, buf, sizeof(buf))); + + /* Currently these retries are purely a guess; + * there is no reproducible problem that they solve. */ + if (--tries_remaining) { + int delay = 100; + if (status == STATUS_INSUFFICIENT_RESOURCES || + status == STATUS_NO_MEMORY) { + delay *= 25; + } + WARNING("Retrying after %dms...", delay); + Sleep(delay); + goto retry_read; + } + ERROR("Too many retries; returning failure"); + ret = WIMLIB_ERR_READ; + } + break; + } else if (unlikely(tries_remaining != max_tries)) { + WARNING("A read request had to be retried multiple times " + "before it succeeded!"); + } + + bytes_read = iosb.Information; + + bytes_remaining -= bytes_read; + ret = consume_chunk(cb, buf, bytes_read); + if (ret) + break; + } + NtClose(h); + return ret; +} + +struct win32_encrypted_read_ctx { + const struct consume_chunk_callback *cb; + int wimlib_err_code; + u64 bytes_remaining; +}; + +static DWORD WINAPI +win32_encrypted_export_cb(unsigned char *data, void *_ctx, unsigned long len) +{ + struct win32_encrypted_read_ctx *ctx = _ctx; + int ret; + size_t bytes_to_consume = min(len, ctx->bytes_remaining); + + if (bytes_to_consume == 0) + return ERROR_SUCCESS; + + ret = consume_chunk(ctx->cb, data, bytes_to_consume); + if (ret) { + ctx->wimlib_err_code = ret; + /* It doesn't matter what error code is returned here, as long + * as it isn't ERROR_SUCCESS. */ + return ERROR_READ_FAULT; + } + ctx->bytes_remaining -= bytes_to_consume; + return ERROR_SUCCESS; +} + +static int +read_win32_encrypted_file_prefix(const wchar_t *path, bool is_dir, u64 size, + const struct consume_chunk_callback *cb) +{ + struct win32_encrypted_read_ctx export_ctx; + DWORD err; + void *file_ctx; + int ret; + DWORD flags = 0; + + if (is_dir) + flags |= CREATE_FOR_DIR; + + export_ctx.cb = cb; + export_ctx.wimlib_err_code = 0; + export_ctx.bytes_remaining = size; + + err = OpenEncryptedFileRaw(path, flags, &file_ctx); + if (err != ERROR_SUCCESS) { + win32_error(err, + L"Failed to open encrypted file \"%ls\" for raw read", + path); + return WIMLIB_ERR_OPEN; + } + err = ReadEncryptedFileRaw(win32_encrypted_export_cb, + &export_ctx, file_ctx); + if (err != ERROR_SUCCESS) { + ret = export_ctx.wimlib_err_code; + if (ret == 0) { + win32_error(err, + L"Failed to read encrypted file \"%ls\"", + path); + ret = WIMLIB_ERR_READ; + } + } else if (export_ctx.bytes_remaining != 0) { + ERROR("Only could read %"PRIu64" of %"PRIu64" bytes from " + "encrypted file \"%ls\"", + size - export_ctx.bytes_remaining, size, + path); + ret = WIMLIB_ERR_READ; + } else { + ret = 0; + } + CloseEncryptedFileRaw(file_ctx); + return ret; +} + +/* Read the first @size bytes from the file, or named data stream of a file, + * described by @blob. */ +int +read_windows_file_prefix(const struct blob_descriptor *blob, u64 size, + const struct consume_chunk_callback *cb, + bool recover_data) +{ + const struct windows_file *file = blob->windows_file; + + if (unlikely(file->is_encrypted)) { + bool is_dir = (blob->file_inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY); + return read_win32_encrypted_file_prefix(file->path, is_dir, size, cb); + } + + return read_winnt_stream_prefix(file, size, cb); +} + +/* + * Load the short name of a file into a WIM dentry. + */ +static noinline_for_stack NTSTATUS +winnt_get_short_name(HANDLE h, struct wim_dentry *dentry) +{ + /* It's not any harder to just make the NtQueryInformationFile() system + * call ourselves, and it saves a dumb call to FindFirstFile() which of + * course has to create its own handle. */ + NTSTATUS status; + IO_STATUS_BLOCK iosb; + u8 buf[128] __attribute__((aligned(8))); + const FILE_NAME_INFORMATION *info; + + status = NtQueryInformationFile(h, &iosb, buf, sizeof(buf), + FileAlternateNameInformation); + info = (const FILE_NAME_INFORMATION *)buf; + if (NT_SUCCESS(status) && info->FileNameLength != 0) { + dentry->d_short_name = utf16le_dupz(info->FileName, + info->FileNameLength); + if (!dentry->d_short_name) + return STATUS_NO_MEMORY; + dentry->d_short_name_nbytes = info->FileNameLength; + } + return status; +} + +/* + * Load the security descriptor of a file into the corresponding inode and the + * WIM image's security descriptor set. + */ +static noinline_for_stack int +winnt_load_security_descriptor(HANDLE h, struct wim_inode *inode, + struct winnt_scan_ctx *ctx) +{ + SECURITY_INFORMATION requestedInformation; + u8 _buf[4096] __attribute__((aligned(8))); + u8 *buf; + ULONG bufsize; + ULONG len_needed; + NTSTATUS status; + + /* + * LABEL_SECURITY_INFORMATION is needed on Windows Vista and 7 because + * Microsoft decided to add mandatory integrity labels to the SACL but + * not have them returned by SACL_SECURITY_INFORMATION. + * + * BACKUP_SECURITY_INFORMATION is needed on Windows 8 because Microsoft + * decided to add even more stuff to the SACL and still not have it + * returned by SACL_SECURITY_INFORMATION; but they did remember that + * backup applications exist and simply want to read the stupid thing + * once and for all, so they added a flag to read the entire security + * descriptor. + * + * Older versions of Windows tolerate these new flags being passed in. + */ + requestedInformation = OWNER_SECURITY_INFORMATION | + GROUP_SECURITY_INFORMATION | + DACL_SECURITY_INFORMATION | + SACL_SECURITY_INFORMATION | + LABEL_SECURITY_INFORMATION | + BACKUP_SECURITY_INFORMATION; + + buf = _buf; + bufsize = sizeof(_buf); + + /* + * We need the file's security descriptor in + * SECURITY_DESCRIPTOR_RELATIVE format, and we currently have a handle + * opened with as many relevant permissions as possible. At this point, + * on Windows there are a number of options for reading a file's + * security descriptor: + * + * GetFileSecurity(): This takes in a path and returns the + * SECURITY_DESCRIPTOR_RELATIVE. Problem: this uses an internal handle, + * not ours, and the handle created internally doesn't specify + * FILE_FLAG_BACKUP_SEMANTICS. Therefore there can be access denied + * errors on some files and directories, even when running as the + * Administrator. + * + * GetSecurityInfo(): This takes in a handle and returns the security + * descriptor split into a bunch of different parts. This should work, + * but it's dumb because we have to put the security descriptor back + * together again. + * + * BackupRead(): This can read the security descriptor, but this is a + * difficult-to-use API, probably only works as the Administrator, and + * the format of the returned data is not well documented. + * + * NtQuerySecurityObject(): This is exactly what we need, as it takes + * in a handle and returns the security descriptor in + * SECURITY_DESCRIPTOR_RELATIVE format. Only problem is that it's a + * ntdll function and therefore not officially part of the Win32 API. + * Oh well. + */ + while (!NT_SUCCESS(status = NtQuerySecurityObject(h, + requestedInformation, + (PSECURITY_DESCRIPTOR)buf, + bufsize, + &len_needed))) + { + switch (status) { + case STATUS_BUFFER_TOO_SMALL: + wimlib_assert(buf == _buf); + buf = MALLOC(len_needed); + if (!buf) { + status = STATUS_NO_MEMORY; + goto out; + } + bufsize = len_needed; + break; + case STATUS_PRIVILEGE_NOT_HELD: + case STATUS_ACCESS_DENIED: + if (ctx->params->add_flags & WIMLIB_ADD_FLAG_STRICT_ACLS) { + default: + /* Permission denied in STRICT_ACLS mode, or + * unknown error. */ + goto out; + } + if (requestedInformation & SACL_SECURITY_INFORMATION) { + /* Try again without the SACL. */ + ctx->num_get_sacl_priv_notheld++; + requestedInformation &= ~(SACL_SECURITY_INFORMATION | + LABEL_SECURITY_INFORMATION | + BACKUP_SECURITY_INFORMATION); + break; + } + /* Fake success (useful when capturing as + * non-Administrator). */ + ctx->num_get_sd_access_denied++; + status = STATUS_SUCCESS; + goto out; + } + } + + /* We can get a length of 0 with Samba. Assume that means "no security + * descriptor". */ + if (len_needed == 0) + goto out; + + /* Add the security descriptor to the WIM image, and save its ID in + * the file's inode. */ + inode->i_security_id = sd_set_add_sd(ctx->params->sd_set, buf, len_needed); + if (unlikely(inode->i_security_id < 0)) + status = STATUS_NO_MEMORY; +out: + if (unlikely(buf != _buf)) + FREE(buf); + if (!NT_SUCCESS(status)) { + winnt_error(status, L"\"%ls\": Can't read security descriptor", + printable_path(ctx)); + return WIMLIB_ERR_STAT; + } + return 0; +} + +/* Load a file's object ID into the corresponding WIM inode. */ +static noinline_for_stack int +winnt_load_object_id(HANDLE h, struct wim_inode *inode, + struct winnt_scan_ctx *ctx) +{ + FILE_OBJECTID_BUFFER buffer; + NTSTATUS status; + u32 len; + + if (!(ctx->vol_flags & FILE_SUPPORTS_OBJECT_IDS)) + return 0; + + status = winnt_fsctl(h, FSCTL_GET_OBJECT_ID, NULL, 0, + &buffer, sizeof(buffer), &len); + + if (status == STATUS_OBJECTID_NOT_FOUND) /* No object ID */ + return 0; + + if (status == STATUS_INVALID_DEVICE_REQUEST || + status == STATUS_NOT_SUPPORTED /* Samba volume, WinXP */) { + /* The filesystem claimed to support object IDs, but we can't + * actually read them. This happens with Samba. */ + ctx->vol_flags &= ~FILE_SUPPORTS_OBJECT_IDS; + return 0; + } + + if (!NT_SUCCESS(status)) { + winnt_error(status, L"\"%ls\": Can't read object ID", + printable_path(ctx)); + return WIMLIB_ERR_STAT; + } + + if (len == 0) /* No object ID (for directories) */ + return 0; + + if (!inode_set_object_id(inode, &buffer, len)) + return WIMLIB_ERR_NOMEM; + + return 0; +} + +/* Load a file's extended attributes into the corresponding WIM inode. */ +static noinline_for_stack int +winnt_load_xattrs(HANDLE h, struct wim_inode *inode, + struct winnt_scan_ctx *ctx, u32 ea_size) +{ + IO_STATUS_BLOCK iosb; + NTSTATUS status; + u8 _buf[1024] __attribute__((aligned(4))); + u8 *buf = _buf; + const FILE_FULL_EA_INFORMATION *ea; + struct wim_xattr_entry *entry; + int ret; + + + /* + * EaSize from FILE_EA_INFORMATION is apparently supposed to give the + * size of the buffer required for NtQueryEaFile(), but it doesn't + * actually work correctly; it can be off by about 4 bytes per xattr. + * + * So just start out by doubling the advertised size, and also handle + * STATUS_BUFFER_OVERFLOW just in case. + */ +retry: + if (unlikely(ea_size * 2 < ea_size)) + ea_size = UINT32_MAX; + else + ea_size *= 2; + if (unlikely(ea_size > sizeof(_buf))) { + buf = MALLOC(ea_size); + if (!buf) { + if (ea_size >= (1 << 20)) { + WARNING("\"%ls\": EaSize was extremely large (%u)", + printable_path(ctx), ea_size); + } + return WIMLIB_ERR_NOMEM; + } + } + + status = NtQueryEaFile(h, &iosb, buf, ea_size, + FALSE, NULL, 0, NULL, TRUE); + + if (unlikely(!NT_SUCCESS(status))) { + if (status == STATUS_BUFFER_OVERFLOW) { + if (buf != _buf) { + FREE(buf); + buf = NULL; + } + goto retry; + } + if (status == STATUS_NO_EAS_ON_FILE) { + /* + * FILE_EA_INFORMATION.EaSize was nonzero so this + * shouldn't happen, but just in case... + */ + ret = 0; + goto out; + } + winnt_error(status, L"\"%ls\": Can't read extended attributes", + printable_path(ctx)); + ret = WIMLIB_ERR_STAT; + goto out; + } + + ea = (const FILE_FULL_EA_INFORMATION *)buf; + entry = (struct wim_xattr_entry *)buf; + for (;;) { + /* + * wim_xattr_entry is not larger than FILE_FULL_EA_INFORMATION, + * so we can reuse the same buffer by overwriting the + * FILE_FULL_EA_INFORMATION with the wim_xattr_entry in-place. + */ + FILE_FULL_EA_INFORMATION _ea; + + STATIC_ASSERT(offsetof(struct wim_xattr_entry, name) <= + offsetof(FILE_FULL_EA_INFORMATION, EaName)); + wimlib_assert((u8 *)entry <= (const u8 *)ea); + + memcpy(&_ea, ea, sizeof(_ea)); + + entry->value_len = cpu_to_le16(_ea.EaValueLength); + entry->name_len = _ea.EaNameLength; + entry->flags = _ea.Flags; + memmove(entry->name, ea->EaName, _ea.EaNameLength); + entry->name[_ea.EaNameLength] = '\0'; + memmove(&entry->name[_ea.EaNameLength + 1], + &ea->EaName[_ea.EaNameLength + 1], _ea.EaValueLength); + entry = (struct wim_xattr_entry *) + &entry->name[_ea.EaNameLength + 1 + _ea.EaValueLength]; + if (_ea.NextEntryOffset == 0) + break; + ea = (const FILE_FULL_EA_INFORMATION *) + ((const u8 *)ea + _ea.NextEntryOffset); + } + wimlib_assert((u8 *)entry - buf <= ea_size); + + ret = WIMLIB_ERR_NOMEM; + if (!inode_set_xattrs(inode, buf, (u8 *)entry - buf)) + goto out; + ret = 0; +out: + if (unlikely(buf != _buf)) + FREE(buf); + return ret; +} + +static int +winnt_build_dentry_tree(struct wim_dentry **root_ret, + HANDLE cur_dir, + const wchar_t *relative_path, + size_t relative_path_nchars, + const wchar_t *filename, + struct winnt_scan_ctx *ctx, + bool recursive); + +static int +winnt_recurse_directory(HANDLE h, + struct wim_dentry *parent, + struct winnt_scan_ctx *ctx) +{ + void *buf; + const size_t bufsize = 8192; + IO_STATUS_BLOCK iosb; + NTSTATUS status; + int ret; + + buf = MALLOC(bufsize); + if (!buf) + return WIMLIB_ERR_NOMEM; + + /* Using NtQueryDirectoryFile() we can re-use the same open handle, + * which we opened with FILE_FLAG_BACKUP_SEMANTICS. */ + + while (NT_SUCCESS(status = NtQueryDirectoryFile(h, NULL, NULL, NULL, + &iosb, buf, bufsize, + FileNamesInformation, + FALSE, NULL, FALSE))) + { + const FILE_NAMES_INFORMATION *info = buf; + for (;;) { + if (!should_ignore_filename(info->FileName, + info->FileNameLength / 2)) + { + struct wim_dentry *child; + size_t orig_path_nchars; + const wchar_t *filename; + + ret = WIMLIB_ERR_NOMEM; + filename = pathbuf_append_name(ctx->params, + info->FileName, + info->FileNameLength / 2, + &orig_path_nchars); + if (!filename) + goto out_free_buf; + + ret = winnt_build_dentry_tree( + &child, + h, + filename, + info->FileNameLength / 2, + filename, + ctx, + true); + + pathbuf_truncate(ctx->params, orig_path_nchars); + + if (ret) + goto out_free_buf; + attach_scanned_tree(parent, child, + ctx->params->blob_table); + } + if (info->NextEntryOffset == 0) + break; + info = (const FILE_NAMES_INFORMATION *) + ((const u8 *)info + info->NextEntryOffset); + } + } + + if (unlikely(status != STATUS_NO_MORE_FILES)) { + winnt_error(status, L"\"%ls\": Can't read directory", + printable_path(ctx)); + ret = WIMLIB_ERR_READ; + } +out_free_buf: + FREE(buf); + return ret; +} + +/* Reparse point fixup status code */ +#define RP_FIXED (-1) + +static bool +file_has_ino_and_dev(HANDLE h, u64 ino, u64 dev) +{ + NTSTATUS status; + IO_STATUS_BLOCK iosb; + FILE_INTERNAL_INFORMATION int_info; + FILE_FS_VOLUME_INFORMATION vol_info; + + status = NtQueryInformationFile(h, &iosb, &int_info, sizeof(int_info), + FileInternalInformation); + if (!NT_SUCCESS(status)) + return false; + + if (int_info.IndexNumber.QuadPart != ino) + return false; + + status = NtQueryVolumeInformationFile(h, &iosb, + &vol_info, sizeof(vol_info), + FileFsVolumeInformation); + if (!(NT_SUCCESS(status) || status == STATUS_BUFFER_OVERFLOW)) + return false; + + if (iosb.Information < + offsetof(FILE_FS_VOLUME_INFORMATION, VolumeSerialNumber) + + sizeof(vol_info.VolumeSerialNumber)) + return false; + + return (vol_info.VolumeSerialNumber == dev); +} + +/* + * This is the Windows equivalent of unix_relativize_link_target(); see there + * for general details. This version works with an "absolute" Windows link + * target, specified from the root of the Windows kernel object namespace. Note + * that we have to open directories with a trailing slash when present because + * \??\E: opens the E: device itself and not the filesystem root directory. + */ +static const wchar_t * +winnt_relativize_link_target(const wchar_t *target, size_t target_nbytes, + u64 ino, u64 dev) +{ + UNICODE_STRING name; + OBJECT_ATTRIBUTES attr; + IO_STATUS_BLOCK iosb; + NTSTATUS status; + const wchar_t *target_end; + const wchar_t *p; + + target_end = target + (target_nbytes / sizeof(wchar_t)); + + /* Empty path??? */ + if (target_end == target) + return target; + + /* No leading slash??? */ + if (target[0] != L'\\') + return target; + + /* UNC path??? */ + if ((target_end - target) >= 2 && + target[0] == L'\\' && target[1] == L'\\') + return target; + + attr.Length = sizeof(attr); + attr.RootDirectory = NULL; + attr.ObjectName = &name; + attr.Attributes = 0; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + name.Buffer = (wchar_t *)target; + name.Length = 0; + p = target; + do { + HANDLE h; + const wchar_t *orig_p = p; + + /* Skip non-backslashes */ + while (p != target_end && *p != L'\\') + p++; + + /* Skip backslashes */ + while (p != target_end && *p == L'\\') + p++; + + /* Append path component */ + name.Length += (p - orig_p) * sizeof(wchar_t); + name.MaximumLength = name.Length; + + /* Try opening the file */ + status = NtOpenFile(&h, + FILE_READ_ATTRIBUTES | FILE_TRAVERSE, + &attr, + &iosb, + FILE_SHARE_VALID_FLAGS, + FILE_OPEN_FOR_BACKUP_INTENT); + + if (NT_SUCCESS(status)) { + /* Reset root directory */ + if (attr.RootDirectory) + NtClose(attr.RootDirectory); + attr.RootDirectory = h; + name.Buffer = (wchar_t *)p; + name.Length = 0; + + if (file_has_ino_and_dev(h, ino, dev)) + goto out_close_root_dir; + } + } while (p != target_end); + + p = target; + +out_close_root_dir: + if (attr.RootDirectory) + NtClose(attr.RootDirectory); + while (p > target && *(p - 1) == L'\\') + p--; + return p; +} + +static int +winnt_rpfix_progress(struct scan_params *params, + const struct link_reparse_point *link, int scan_status) +{ + size_t print_name_nchars = link->print_name_nbytes / sizeof(wchar_t); + wchar_t print_name0[print_name_nchars + 1]; + + wmemcpy(print_name0, link->print_name, print_name_nchars); + print_name0[print_name_nchars] = L'\0'; + + params->progress.scan.symlink_target = print_name0; + return do_scan_progress(params, scan_status, NULL); +} + +static int +winnt_try_rpfix(struct reparse_buffer_disk *rpbuf, u16 *rpbuflen_p, + struct scan_params *params) +{ + struct link_reparse_point link; + const wchar_t *rel_target; + int ret; + + if (parse_link_reparse_point(rpbuf, *rpbuflen_p, &link)) { + /* Couldn't understand the reparse data; don't do the fixup. */ + return 0; + } + + /* + * Don't do reparse point fixups on relative symbolic links. + * + * On Windows, a relative symbolic link is supposed to be identifiable + * by having reparse tag WIM_IO_REPARSE_TAG_SYMLINK and flags + * SYMBOLIC_LINK_RELATIVE. We will use this information, although this + * may not always do what the user expects, since drive-relative + * symbolic links such as "\Users\Public" have SYMBOLIC_LINK_RELATIVE + * set, in addition to truly relative symbolic links such as "Users" or + * "Users\Public". However, WIMGAPI (as of Windows 8.1) has this same + * behavior. + * + * Otherwise, as far as I can tell, the targets of symbolic links that + * are NOT relative, as well as junctions (note: a mountpoint is the + * sames thing as a junction), must be NT namespace paths, for example: + * + * - \??\e:\Users\Public + * - \DosDevices\e:\Users\Public + * - \Device\HardDiskVolume4\Users\Public + * - \??\Volume{c47cb07c-946e-4155-b8f7-052e9cec7628}\Users\Public + * - \DosDevices\Volume{c47cb07c-946e-4155-b8f7-052e9cec7628}\Users\Public + */ + if (link_is_relative_symlink(&link)) + return 0; + + rel_target = winnt_relativize_link_target(link.substitute_name, + link.substitute_name_nbytes, + params->capture_root_ino, + params->capture_root_dev); + + if (rel_target == link.substitute_name) { + /* Target points outside of the tree being captured or had an + * unrecognized path format. Don't adjust it. */ + return winnt_rpfix_progress(params, &link, + WIMLIB_SCAN_DENTRY_NOT_FIXED_SYMLINK); + } + + /* We have an absolute target pointing within the directory being + * captured. @rel_target is the suffix of the link target that is the + * part relative to the directory being captured. + * + * We will cut off the prefix before this part (which is the path to the + * directory being captured) and add a dummy prefix. Since the process + * will need to be reversed when applying the image, it doesn't matter + * what exactly the prefix is, as long as it looks like an absolute + * path. */ + + static const wchar_t prefix[6] = L"\\??\\X:"; + static const size_t num_unprintable_chars = 4; + + size_t rel_target_nbytes = + link.substitute_name_nbytes - ((const u8 *)rel_target - + (const u8 *)link.substitute_name); + + wchar_t tmp[(sizeof(prefix) + rel_target_nbytes) / sizeof(wchar_t)]; + + memcpy(tmp, prefix, sizeof(prefix)); + memcpy(tmp + ARRAY_LEN(prefix), rel_target, rel_target_nbytes); + + link.substitute_name = tmp; + link.substitute_name_nbytes = sizeof(tmp); + + link.print_name = link.substitute_name + num_unprintable_chars; + link.print_name_nbytes = link.substitute_name_nbytes - + (num_unprintable_chars * sizeof(wchar_t)); + + if (make_link_reparse_point(&link, rpbuf, rpbuflen_p)) + return 0; + + ret = winnt_rpfix_progress(params, &link, + WIMLIB_SCAN_DENTRY_FIXED_SYMLINK); + if (ret) + return ret; + return RP_FIXED; +} + +/* Load the reparse data of a file into the corresponding WIM inode. If the + * reparse point is a symbolic link or junction with an absolute target and + * RPFIX mode is enabled, then also rewrite its target to be relative to the + * capture root. */ +static noinline_for_stack int +winnt_load_reparse_data(HANDLE h, struct wim_inode *inode, + struct winnt_scan_ctx *ctx) +{ + struct reparse_buffer_disk rpbuf; + NTSTATUS status; + u32 len; + u16 rpbuflen; + int ret; + + if (inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED) { + /* See comment above assign_stream_types_encrypted() */ + WARNING("Ignoring reparse data of encrypted file \"%ls\"", + printable_path(ctx)); + return 0; + } + + status = winnt_fsctl(h, FSCTL_GET_REPARSE_POINT, + NULL, 0, &rpbuf, sizeof(rpbuf), &len); + if (!NT_SUCCESS(status)) { + winnt_error(status, L"\"%ls\": Can't get reparse point", + printable_path(ctx)); + return WIMLIB_ERR_READLINK; + } + + rpbuflen = len; + + if (unlikely(rpbuflen < REPARSE_DATA_OFFSET)) { + ERROR("\"%ls\": reparse point buffer is too short", + printable_path(ctx)); + return WIMLIB_ERR_INVALID_REPARSE_DATA; + } + + if (le32_to_cpu(rpbuf.rptag) == WIM_IO_REPARSE_TAG_DEDUP) { + /* + * Windows treats Data Deduplication reparse points specially. + * Reads from the unnamed data stream actually return the + * redirected file contents, even with FILE_OPEN_REPARSE_POINT. + * Deduplicated files also cannot be properly restored without + * also restoring the "System Volume Information" directory, + * which wimlib excludes by default. Therefore, the logical + * behavior for us seems to be to ignore the reparse point and + * treat the file as a normal file. + */ + inode->i_attributes &= ~FILE_ATTRIBUTE_REPARSE_POINT; + return 0; + } + + if (ctx->params->add_flags & WIMLIB_ADD_FLAG_RPFIX) { + ret = winnt_try_rpfix(&rpbuf, &rpbuflen, ctx->params); + if (ret == RP_FIXED) + inode->i_rp_flags &= ~WIM_RP_FLAG_NOT_FIXED; + else if (ret) + return ret; + } + + inode->i_reparse_tag = le32_to_cpu(rpbuf.rptag); + inode->i_rp_reserved = le16_to_cpu(rpbuf.rpreserved); + + if (!inode_add_stream_with_data(inode, + STREAM_TYPE_REPARSE_POINT, + NO_STREAM_NAME, + rpbuf.rpdata, + rpbuflen - REPARSE_DATA_OFFSET, + ctx->params->blob_table)) + return WIMLIB_ERR_NOMEM; + + return 0; +} + +static DWORD WINAPI +win32_tally_encrypted_size_cb(unsigned char *_data, void *_size_ret, + unsigned long len) +{ + *(u64*)_size_ret += len; + return ERROR_SUCCESS; +} + +static int +win32_get_encrypted_file_size(const wchar_t *path, bool is_dir, u64 *size_ret) +{ + DWORD err; + void *file_ctx; + int ret; + DWORD flags = 0; + + if (is_dir) + flags |= CREATE_FOR_DIR; + + err = OpenEncryptedFileRaw(path, flags, &file_ctx); + if (err != ERROR_SUCCESS) { + win32_error(err, + L"Failed to open encrypted file \"%ls\" for raw read", + path); + return WIMLIB_ERR_OPEN; + } + *size_ret = 0; + err = ReadEncryptedFileRaw(win32_tally_encrypted_size_cb, + size_ret, file_ctx); + if (err != ERROR_SUCCESS) { + win32_error(err, + L"Failed to read raw encrypted data from \"%ls\"", + path); + ret = WIMLIB_ERR_READ; + } else { + ret = 0; + } + CloseEncryptedFileRaw(file_ctx); + return ret; +} + +static int +winnt_scan_efsrpc_raw_data(struct wim_inode *inode, + struct winnt_scan_ctx *ctx) +{ + wchar_t *path = ctx->params->cur_path; + size_t path_nchars = ctx->params->cur_path_nchars; + const bool is_dir = (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY); + struct windows_file *windows_file; + u64 size; + int ret; + + /* OpenEncryptedFileRaw() expects a Win32 name. */ + wimlib_assert(!wmemcmp(path, L"\\??\\", 4)); + path[1] = L'\\'; + + ret = win32_get_encrypted_file_size(path, is_dir, &size); + if (ret) + goto out; + + /* Empty EFSRPC data does not make sense */ + wimlib_assert(size != 0); + + windows_file = alloc_windows_file(path, path_nchars, NULL, 0, + ctx->snapshot, true); + ret = add_stream(inode, windows_file, size, STREAM_TYPE_EFSRPC_RAW_DATA, + NO_STREAM_NAME, ctx->params->unhashed_blobs); +out: + path[1] = L'?'; + return ret; +} + +static bool +get_data_stream_name(const wchar_t *raw_stream_name, size_t raw_stream_name_nchars, + const wchar_t **stream_name_ret, size_t *stream_name_nchars_ret) +{ + const wchar_t *sep, *type, *end; + + /* The stream name should be returned as :NAME:TYPE */ + if (raw_stream_name_nchars < 1) + return false; + if (raw_stream_name[0] != L':') + return false; + + raw_stream_name++; + raw_stream_name_nchars--; + + end = raw_stream_name + raw_stream_name_nchars; + + sep = wmemchr(raw_stream_name, L':', raw_stream_name_nchars); + if (!sep) + return false; + + type = sep + 1; + if (end - type != 5) + return false; + + if (wmemcmp(type, L"$DATA", 5)) + return false; + + *stream_name_ret = raw_stream_name; + *stream_name_nchars_ret = sep - raw_stream_name; + return true; +} + +static int +winnt_scan_data_stream(wchar_t *raw_stream_name, size_t raw_stream_name_nchars, + u64 stream_size, struct wim_inode *inode, + struct winnt_scan_ctx *ctx) +{ + wchar_t *stream_name; + size_t stream_name_nchars; + struct windows_file *windows_file; + + /* Given the raw stream name (which is something like + * :streamname:$DATA), extract just the stream name part (streamname). + * Ignore any non-$DATA streams. */ + if (!get_data_stream_name(raw_stream_name, raw_stream_name_nchars, + (const wchar_t **)&stream_name, + &stream_name_nchars)) + return 0; + + stream_name[stream_name_nchars] = L'\0'; + + windows_file = alloc_windows_file(ctx->params->cur_path, + ctx->params->cur_path_nchars, + stream_name, stream_name_nchars, + ctx->snapshot, false); + return add_stream(inode, windows_file, stream_size, STREAM_TYPE_DATA, + stream_name, ctx->params->unhashed_blobs); +} + +/* + * Load information about the data streams of an open file into a WIM inode. + * + * We use the NtQueryInformationFile() system call instead of FindFirstStream() + * and FindNextStream(), since FindFirstStream() opens its own handle to the + * file or directory and apparently does so without specifying + * FILE_FLAG_BACKUP_SEMANTICS. This causing access denied errors on certain + * files, even when running as the Administrator. + */ +static noinline_for_stack int +winnt_scan_data_streams(HANDLE h, struct wim_inode *inode, u64 file_size, + struct winnt_scan_ctx *ctx) +{ + int ret; + u8 _buf[4096] __attribute__((aligned(8))); + u8 *buf; + size_t bufsize; + IO_STATUS_BLOCK iosb; + NTSTATUS status; + FILE_STREAM_INFORMATION *info; + + buf = _buf; + bufsize = sizeof(_buf); + + if (!(ctx->vol_flags & FILE_NAMED_STREAMS)) + goto unnamed_only; + + /* Get a buffer containing the stream information. */ + while (!NT_SUCCESS(status = NtQueryInformationFile(h, + &iosb, + buf, + bufsize, + FileStreamInformation))) + { + + switch (status) { + case STATUS_BUFFER_OVERFLOW: + { + u8 *newbuf; + + bufsize *= 2; + if (buf == _buf) + newbuf = MALLOC(bufsize); + else + newbuf = REALLOC(buf, bufsize); + if (!newbuf) { + ret = WIMLIB_ERR_NOMEM; + goto out_free_buf; + } + buf = newbuf; + } + break; + case STATUS_NOT_IMPLEMENTED: + case STATUS_NOT_SUPPORTED: + case STATUS_INVALID_INFO_CLASS: + goto unnamed_only; + default: + winnt_error(status, + L"\"%ls\": Failed to query stream information", + printable_path(ctx)); + ret = WIMLIB_ERR_READ; + goto out_free_buf; + } + } + + if (iosb.Information == 0) { + /* No stream information. */ + ret = 0; + goto out_free_buf; + } + + /* Parse one or more stream information structures. */ + info = (FILE_STREAM_INFORMATION *)buf; + for (;;) { + /* Load the stream information. */ + ret = winnt_scan_data_stream(info->StreamName, + info->StreamNameLength / 2, + info->StreamSize.QuadPart, + inode, ctx); + if (ret) + goto out_free_buf; + + if (info->NextEntryOffset == 0) { + /* No more stream information. */ + break; + } + /* Advance to next stream information. */ + info = (FILE_STREAM_INFORMATION *) + ((u8 *)info + info->NextEntryOffset); + } + ret = 0; + goto out_free_buf; + +unnamed_only: + /* The volume does not support named streams. Only capture the unnamed + * data stream. */ + if (inode->i_attributes & (FILE_ATTRIBUTE_DIRECTORY | + FILE_ATTRIBUTE_REPARSE_POINT)) + { + ret = 0; + goto out_free_buf; + } + + { + wchar_t stream_name[] = L"::$DATA"; + ret = winnt_scan_data_stream(stream_name, 7, file_size, + inode, ctx); + } +out_free_buf: + /* Free buffer if allocated on heap. */ + if (unlikely(buf != _buf)) + FREE(buf); + return ret; +} + +static u64 +extract_starting_lcn(const RETRIEVAL_POINTERS_BUFFER *extents) +{ + if (extents->ExtentCount < 1) + return 0; + + return extents->Extents[0].Lcn.QuadPart; +} + +static noinline_for_stack u64 +get_sort_key(HANDLE h) +{ + STARTING_VCN_INPUT_BUFFER in = { .StartingVcn.QuadPart = 0 }; + RETRIEVAL_POINTERS_BUFFER out; + + if (!NT_SUCCESS(winnt_fsctl(h, FSCTL_GET_RETRIEVAL_POINTERS, + &in, sizeof(in), &out, sizeof(out), NULL))) + return 0; + + return extract_starting_lcn(&out); +} + +static void +set_sort_key(struct wim_inode *inode, u64 sort_key) +{ + for (unsigned i = 0; i < inode->i_num_streams; i++) { + struct wim_inode_stream *strm = &inode->i_streams[i]; + struct blob_descriptor *blob = stream_blob_resolved(strm); + if (blob && blob->blob_location == BLOB_IN_WINDOWS_FILE) + blob->windows_file->sort_key = sort_key; + } +} + +static inline bool +should_try_to_use_wimboot_hash(const struct wim_inode *inode, + const struct winnt_scan_ctx *ctx) +{ + /* Directories and encrypted files aren't valid for external backing. */ + if (inode->i_attributes & (FILE_ATTRIBUTE_DIRECTORY | + FILE_ATTRIBUTE_ENCRYPTED)) + return false; + + /* If the file is a reparse point, then try the hash fixup if it's a WOF + * reparse point and we're in WIMBOOT mode. Otherwise, try the hash + * fixup if WOF may be attached. */ + if (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) + return (inode->i_reparse_tag == WIM_IO_REPARSE_TAG_WOF) && + (ctx->params->add_flags & WIMLIB_ADD_FLAG_WIMBOOT); + return !ctx->wof_not_attached; +} + +/* + * This function implements an optimization for capturing files from a + * filesystem with a backing WIM(s). If a file is WIM-backed, then we can + * retrieve the SHA-1 message digest of its original contents from its reparse + * point. This may eliminate the need to read the file's data and/or allow the + * file's data to be immediately deduplicated with existing data in the WIM. + * + * If WOF is attached, then this function is merely an optimization, but + * potentially a very effective one. If WOF is detached, then this function + * really causes WIM-backed files to be, effectively, automatically + * "dereferenced" when possible; the unnamed data stream is updated to reference + * the original contents and the reparse point is removed. + * + * This function returns 0 if the fixup succeeded or was intentionally not + * executed. Otherwise it returns an error code. + */ +static noinline_for_stack int +try_to_use_wimboot_hash(HANDLE h, struct wim_inode *inode, + struct winnt_scan_ctx *ctx) +{ + struct blob_table *blob_table = ctx->params->blob_table; + struct wim_inode_stream *reparse_strm = NULL; + struct wim_inode_stream *strm; + struct blob_descriptor *blob; + u8 hash[SHA1_HASH_SIZE]; + int ret; + + if (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) { + struct reparse_buffer_disk rpbuf; + struct { + WOF_EXTERNAL_INFO wof_info; + struct wim_provider_rpdata wim_info; + } *rpdata = (void *)rpbuf.rpdata; + struct blob_descriptor *reparse_blob; + + /* The file has a WOF reparse point, so WOF must be detached. + * We can read the reparse point directly. */ + ctx->wof_not_attached = true; + reparse_strm = inode_get_unnamed_stream(inode, STREAM_TYPE_REPARSE_POINT); + reparse_blob = stream_blob_resolved(reparse_strm); + + if (!reparse_blob || reparse_blob->size < sizeof(*rpdata)) + return 0; /* Not a WIM-backed file */ + + ret = read_blob_into_buf(reparse_blob, rpdata); + if (ret) + return ret; + + if (rpdata->wof_info.Version != WOF_CURRENT_VERSION || + rpdata->wof_info.Provider != WOF_PROVIDER_WIM || + rpdata->wim_info.version != 2) + return 0; /* Not a WIM-backed file */ + + /* Okay, this is a WIM backed file. Get its SHA-1 hash. */ + copy_hash(hash, rpdata->wim_info.unnamed_data_stream_hash); + } else { + struct { + WOF_EXTERNAL_INFO wof_info; + WIM_PROVIDER_EXTERNAL_INFO wim_info; + } out; + NTSTATUS status; + + /* WOF may be attached. Try reading this file's external + * backing info. */ + status = winnt_fsctl(h, FSCTL_GET_EXTERNAL_BACKING, + NULL, 0, &out, sizeof(out), NULL); + + /* Is WOF not attached? */ + if (status == STATUS_INVALID_DEVICE_REQUEST || + status == STATUS_NOT_SUPPORTED) { + ctx->wof_not_attached = true; + return 0; + } + + /* Is this file not externally backed? */ + if (status == STATUS_OBJECT_NOT_EXTERNALLY_BACKED) + return 0; + + /* Does this file have an unknown type of external backing that + * needed a larger information buffer? */ + if (status == STATUS_BUFFER_TOO_SMALL) + return 0; + + /* Was there some other failure? */ + if (status != STATUS_SUCCESS) { + winnt_error(status, + L"\"%ls\": FSCTL_GET_EXTERNAL_BACKING failed", + printable_path(ctx)); + return WIMLIB_ERR_STAT; + } + + /* Is this file backed by a WIM? */ + if (out.wof_info.Version != WOF_CURRENT_VERSION || + out.wof_info.Provider != WOF_PROVIDER_WIM || + out.wim_info.Version != WIM_PROVIDER_CURRENT_VERSION) + return 0; + + /* Okay, this is a WIM backed file. Get its SHA-1 hash. */ + copy_hash(hash, out.wim_info.ResourceHash); + } + + /* If the file's unnamed data stream is nonempty, then fill in its hash + * and deduplicate it if possible. + * + * With WOF detached, we require that the blob *must* de-duplicable for + * any action can be taken, since without WOF we can't fall back to + * getting the "dereferenced" data by reading the stream (the real + * stream is sparse and contains all zeroes). */ + strm = inode_get_unnamed_data_stream(inode); + if (strm && (blob = stream_blob_resolved(strm))) { + struct blob_descriptor **back_ptr; + + if (reparse_strm && !lookup_blob(blob_table, hash)) + return 0; + back_ptr = retrieve_pointer_to_unhashed_blob(blob); + copy_hash(blob->hash, hash); + if (after_blob_hashed(blob, back_ptr, blob_table, + inode) != blob) + free_blob_descriptor(blob); + } + + /* Remove the reparse point, if present. */ + if (reparse_strm) { + inode_remove_stream(inode, reparse_strm, blob_table); + inode->i_attributes &= ~(FILE_ATTRIBUTE_REPARSE_POINT | + FILE_ATTRIBUTE_SPARSE_FILE); + if (inode->i_attributes == 0) + inode->i_attributes = FILE_ATTRIBUTE_NORMAL; + } + + return 0; +} + +struct file_info { + u32 attributes; + u32 num_links; + u64 creation_time; + u64 last_write_time; + u64 last_access_time; + u64 ino; + u64 end_of_file; + u32 ea_size; +}; + +static noinline_for_stack NTSTATUS +get_file_info(HANDLE h, struct file_info *info) +{ + IO_STATUS_BLOCK iosb; + NTSTATUS status; + FILE_ALL_INFORMATION all_info; + + status = NtQueryInformationFile(h, &iosb, &all_info, sizeof(all_info), + FileAllInformation); + + if (unlikely(!NT_SUCCESS(status) && status != STATUS_BUFFER_OVERFLOW)) + return status; + + info->attributes = all_info.BasicInformation.FileAttributes; + info->num_links = all_info.StandardInformation.NumberOfLinks; + info->creation_time = all_info.BasicInformation.CreationTime.QuadPart; + info->last_write_time = all_info.BasicInformation.LastWriteTime.QuadPart; + info->last_access_time = all_info.BasicInformation.LastAccessTime.QuadPart; + info->ino = all_info.InternalInformation.IndexNumber.QuadPart; + info->end_of_file = all_info.StandardInformation.EndOfFile.QuadPart; + info->ea_size = all_info.EaInformation.EaSize; + return STATUS_SUCCESS; +} + +static void +get_volume_information(HANDLE h, struct winnt_scan_ctx *ctx) +{ + u8 _attr_info[sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 128] + __attribute__((aligned(8))); + FILE_FS_ATTRIBUTE_INFORMATION *attr_info = (void *)_attr_info; + FILE_FS_VOLUME_INFORMATION vol_info; + struct file_info file_info; + IO_STATUS_BLOCK iosb; + NTSTATUS status; + + /* Get volume flags */ + status = NtQueryVolumeInformationFile(h, &iosb, attr_info, + sizeof(_attr_info), + FileFsAttributeInformation); + if (NT_SUCCESS(status)) { + ctx->vol_flags = attr_info->FileSystemAttributes; + ctx->is_ntfs = (attr_info->FileSystemNameLength == 4 * sizeof(wchar_t)) && + !wmemcmp(attr_info->FileSystemName, L"NTFS", 4); + } else { + winnt_warning(status, L"\"%ls\": Can't get volume attributes", + printable_path(ctx)); + } + + /* Get volume ID. */ + status = NtQueryVolumeInformationFile(h, &iosb, &vol_info, + sizeof(vol_info), + FileFsVolumeInformation); + if ((NT_SUCCESS(status) || status == STATUS_BUFFER_OVERFLOW) && + (iosb.Information >= offsetof(FILE_FS_VOLUME_INFORMATION, + VolumeSerialNumber) + + sizeof(vol_info.VolumeSerialNumber))) + { + ctx->params->capture_root_dev = vol_info.VolumeSerialNumber; + } else { + winnt_warning(status, L"\"%ls\": Can't get volume ID", + printable_path(ctx)); + } + + /* Get inode number. */ + status = get_file_info(h, &file_info); + if (NT_SUCCESS(status)) { + ctx->params->capture_root_ino = file_info.ino; + } else { + winnt_warning(status, L"\"%ls\": Can't get file information", + printable_path(ctx)); + } +} + +static int +winnt_build_dentry_tree(struct wim_dentry **root_ret, + HANDLE cur_dir, + const wchar_t *relative_path, + size_t relative_path_nchars, + const wchar_t *filename, + struct winnt_scan_ctx *ctx, + bool recursive) +{ + struct wim_dentry *root = NULL; + struct wim_inode *inode = NULL; + HANDLE h = NULL; + int ret; + NTSTATUS status; + struct file_info file_info; + u64 sort_key; + + ret = try_exclude(ctx->params); + if (unlikely(ret < 0)) /* Excluded? */ + goto out_progress; + if (unlikely(ret > 0)) /* Error? */ + goto out; + + /* Open the file with permission to read metadata. Although we will + * later need a handle with FILE_LIST_DIRECTORY permission (or, + * equivalently, FILE_READ_DATA; they're the same numeric value) if the + * file is a directory, it can significantly slow things down to request + * this permission on all nondirectories. Perhaps it causes Windows to + * start prefetching the file contents... */ + status = winnt_openat(cur_dir, relative_path, relative_path_nchars, + FILE_READ_ATTRIBUTES | FILE_READ_EA | + READ_CONTROL | ACCESS_SYSTEM_SECURITY, + &h); + if (unlikely(!NT_SUCCESS(status))) { + if (status == STATUS_DELETE_PENDING) { + WARNING("\"%ls\": Deletion pending; skipping file", + printable_path(ctx)); + ret = 0; + goto out; + } + if (status == STATUS_SHARING_VIOLATION) { + ERROR("Can't open \"%ls\":\n" + " File is in use by another process! " + "Consider using snapshot (VSS) mode.", + printable_path(ctx)); + ret = WIMLIB_ERR_OPEN; + goto out; + } + winnt_error(status, L"\"%ls\": Can't open file", + printable_path(ctx)); + if (status == STATUS_FVE_LOCKED_VOLUME) + ret = WIMLIB_ERR_FVE_LOCKED_VOLUME; + else + ret = WIMLIB_ERR_OPEN; + goto out; + } + + /* Get information about the file. */ + status = get_file_info(h, &file_info); + if (!NT_SUCCESS(status)) { + winnt_error(status, L"\"%ls\": Can't get file information", + printable_path(ctx)); + ret = WIMLIB_ERR_STAT; + goto out; + } + + /* Create a WIM dentry with an associated inode, which may be shared. + * + * However, we need to explicitly check for directories and files with + * only 1 link and refuse to hard link them. This is because Windows + * has a bug where it can return duplicate File IDs for files and + * directories on the FAT filesystem. + * + * Since we don't follow mount points on Windows, we don't need to query + * the volume ID per-file. Just once, for the root, is enough. But we + * can't simply pass 0, because then there could be inode collisions + * among multiple calls to win32_build_dentry_tree() that are scanning + * files on different volumes. */ + ret = inode_table_new_dentry(ctx->params->inode_table, + filename, + file_info.ino, + ctx->params->capture_root_dev, + (file_info.num_links <= 1), + &root); + if (ret) + goto out; + + /* Get the short (DOS) name of the file. */ + status = winnt_get_short_name(h, root); + + /* If we can't read the short filename for any reason other than + * out-of-memory, just ignore the error and assume the file has no short + * name. This shouldn't be an issue, since the short names are + * essentially obsolete anyway. */ + if (unlikely(status == STATUS_NO_MEMORY)) { + ret = WIMLIB_ERR_NOMEM; + goto out; + } + + inode = root->d_inode; + + if (inode->i_nlink > 1) { + /* Shared inode (hard link); skip reading per-inode information. + */ + goto out_progress; + } + + inode->i_attributes = file_info.attributes; + inode->i_creation_time = file_info.creation_time; + inode->i_last_write_time = file_info.last_write_time; + inode->i_last_access_time = file_info.last_access_time; + + /* Get the file's security descriptor, unless we are capturing in + * NO_ACLS mode or the volume does not support security descriptors. */ + if (!(ctx->params->add_flags & WIMLIB_ADD_FLAG_NO_ACLS) + && (ctx->vol_flags & FILE_PERSISTENT_ACLS)) + { + ret = winnt_load_security_descriptor(h, inode, ctx); + if (ret) + goto out; + } + + /* Get the file's object ID. */ + ret = winnt_load_object_id(h, inode, ctx); + if (ret) + goto out; + + /* Get the file's extended attributes. */ + if (unlikely(file_info.ea_size != 0)) { + ret = winnt_load_xattrs(h, inode, ctx, file_info.ea_size); + if (ret) + goto out; + } + + /* If this is a reparse point, load the reparse data. */ + if (unlikely(inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT)) { + ret = winnt_load_reparse_data(h, inode, ctx); + if (ret) + goto out; + } + + sort_key = get_sort_key(h); + + if (unlikely(inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED)) { + /* Load information about the raw encrypted data. This is + * needed for any directory or non-directory that has + * FILE_ATTRIBUTE_ENCRYPTED set. + * + * Note: since OpenEncryptedFileRaw() fails with + * ERROR_SHARING_VIOLATION if there are any open handles to the + * file, we have to close the file and re-open it later if + * needed. */ + NtClose(h); + h = NULL; + ret = winnt_scan_efsrpc_raw_data(inode, ctx); + if (ret) + goto out; + } else { + /* + * Load information about data streams (unnamed and named). + * + * Skip this step for encrypted files, since the data from + * ReadEncryptedFileRaw() already contains all data streams (and + * they do in fact all get restored by WriteEncryptedFileRaw().) + * + * Note: WIMGAPI (as of Windows 8.1) gets wrong and stores both + * the EFSRPC data and the named data stream(s)...! + */ + ret = winnt_scan_data_streams(h, + inode, + file_info.end_of_file, + ctx); + if (ret) + goto out; + } + + if (unlikely(should_try_to_use_wimboot_hash(inode, ctx))) { + ret = try_to_use_wimboot_hash(h, inode, ctx); + if (ret) + goto out; + } + + set_sort_key(inode, sort_key); + + if (inode_is_directory(inode) && recursive) { + + /* Directory: recurse to children. */ + + /* Re-open the directory with FILE_LIST_DIRECTORY access. */ + if (h) { + NtClose(h); + h = NULL; + } + status = winnt_openat(cur_dir, relative_path, + relative_path_nchars, FILE_LIST_DIRECTORY, + &h); + if (!NT_SUCCESS(status)) { + winnt_error(status, L"\"%ls\": Can't open directory", + printable_path(ctx)); + ret = WIMLIB_ERR_OPEN; + goto out; + } + ret = winnt_recurse_directory(h, root, ctx); + if (ret) + goto out; + } + +out_progress: + ret = 0; + if (recursive) { /* if !recursive, caller handles progress */ + if (likely(root)) + ret = do_scan_progress(ctx->params, + WIMLIB_SCAN_DENTRY_OK, inode); + else + ret = do_scan_progress(ctx->params, + WIMLIB_SCAN_DENTRY_EXCLUDED, + NULL); + } +out: + if (likely(h)) + NtClose(h); + if (unlikely(ret)) { + free_dentry_tree(root, ctx->params->blob_table); + root = NULL; + ret = report_scan_error(ctx->params, ret); + } + *root_ret = root; + return ret; +} + +static void +winnt_do_scan_warnings(const wchar_t *path, const struct winnt_scan_ctx *ctx) +{ + if (likely(ctx->num_get_sacl_priv_notheld == 0 && + ctx->num_get_sd_access_denied == 0)) + return; + + WARNING("Scan of \"%ls\" complete, but with one or more warnings:", path); + if (ctx->num_get_sacl_priv_notheld != 0) { + WARNING("- Could not capture SACL (System Access Control List)\n" + " on %lu files or directories.", + ctx->num_get_sacl_priv_notheld); + } + if (ctx->num_get_sd_access_denied != 0) { + WARNING("- Could not capture security descriptor at all\n" + " on %lu files or directories.", + ctx->num_get_sd_access_denied); + } + WARNING("To fully capture all security descriptors, run the program\n" + " with Administrator rights."); +} + +/*----------------------------------------------------------------------------* + * Fast MFT scan implementation * + *----------------------------------------------------------------------------*/ + +#define ENABLE_FAST_MFT_SCAN 1 + +#ifdef ENABLE_FAST_MFT_SCAN + +typedef struct { + u64 StartingCluster; + u64 ClusterCount; +} CLUSTER_RANGE; + +typedef struct { + u64 StartingFileReferenceNumber; + u64 EndingFileReferenceNumber; +} FILE_REFERENCE_RANGE; + +/* The FSCTL_QUERY_FILE_LAYOUT ioctl. This ioctl can be used on Windows 8 and + * later to scan the MFT of an NTFS volume. */ +#define FSCTL_QUERY_FILE_LAYOUT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 157, METHOD_NEITHER, FILE_ANY_ACCESS) + +/* The input to FSCTL_QUERY_FILE_LAYOUT */ +typedef struct { + u32 NumberOfPairs; +#define QUERY_FILE_LAYOUT_RESTART 0x00000001 +#define QUERY_FILE_LAYOUT_INCLUDE_NAMES 0x00000002 +#define QUERY_FILE_LAYOUT_INCLUDE_STREAMS 0x00000004 +#define QUERY_FILE_LAYOUT_INCLUDE_EXTENTS 0x00000008 +#define QUERY_FILE_LAYOUT_INCLUDE_EXTRA_INFO 0x00000010 +#define QUERY_FILE_LAYOUT_INCLUDE_STREAMS_WITH_NO_CLUSTERS_ALLOCATED 0x00000020 + u32 Flags; +#define QUERY_FILE_LAYOUT_FILTER_TYPE_NONE 0 +#define QUERY_FILE_LAYOUT_FILTER_TYPE_CLUSTERS 1 +#define QUERY_FILE_LAYOUT_FILTER_TYPE_FILEID 2 +#define QUERY_FILE_LAYOUT_NUM_FILTER_TYPES 3 + u32 FilterType; + u32 Reserved; + union { + CLUSTER_RANGE ClusterRanges[1]; + FILE_REFERENCE_RANGE FileReferenceRanges[1]; + } Filter; +} QUERY_FILE_LAYOUT_INPUT; + +/* The header of the buffer returned by FSCTL_QUERY_FILE_LAYOUT */ +typedef struct { + u32 FileEntryCount; + u32 FirstFileOffset; +#define QUERY_FILE_LAYOUT_SINGLE_INSTANCED 0x00000001 + u32 Flags; + u32 Reserved; +} QUERY_FILE_LAYOUT_OUTPUT; + +/* Inode information returned by FSCTL_QUERY_FILE_LAYOUT */ +typedef struct { + u32 Version; + u32 NextFileOffset; + u32 Flags; + u32 FileAttributes; + u64 FileReferenceNumber; + u32 FirstNameOffset; + u32 FirstStreamOffset; + u32 ExtraInfoOffset; + u32 Reserved; +} FILE_LAYOUT_ENTRY; + +/* Extra inode information returned by FSCTL_QUERY_FILE_LAYOUT */ +typedef struct { + struct { + u64 CreationTime; + u64 LastAccessTime; + u64 LastWriteTime; + u64 ChangeTime; + u32 FileAttributes; + } BasicInformation; + u32 OwnerId; + u32 SecurityId; + s64 Usn; +} FILE_LAYOUT_INFO_ENTRY; + +/* Filename (or dentry) information returned by FSCTL_QUERY_FILE_LAYOUT */ +typedef struct { + u32 NextNameOffset; +#define FILE_LAYOUT_NAME_ENTRY_PRIMARY 0x00000001 +#define FILE_LAYOUT_NAME_ENTRY_DOS 0x00000002 + u32 Flags; + u64 ParentFileReferenceNumber; + u32 FileNameLength; + u32 Reserved; + wchar_t FileName[1]; +} FILE_LAYOUT_NAME_ENTRY; + +/* Stream information returned by FSCTL_QUERY_FILE_LAYOUT */ +typedef struct { + u32 Version; + u32 NextStreamOffset; +#define STREAM_LAYOUT_ENTRY_IMMOVABLE 0x00000001 +#define STREAM_LAYOUT_ENTRY_PINNED 0x00000002 +#define STREAM_LAYOUT_ENTRY_RESIDENT 0x00000004 +#define STREAM_LAYOUT_ENTRY_NO_CLUSTERS_ALLOCATED 0x00000008 + u32 Flags; + u32 ExtentInformationOffset; + u64 AllocationSize; + u64 EndOfFile; + u64 Reserved; + u32 AttributeFlags; + u32 StreamIdentifierLength; + wchar_t StreamIdentifier[1]; +} STREAM_LAYOUT_ENTRY; + + +typedef struct { +#define STREAM_EXTENT_ENTRY_AS_RETRIEVAL_POINTERS 0x00000001 +#define STREAM_EXTENT_ENTRY_ALL_EXTENTS 0x00000002 + u32 Flags; + union { + RETRIEVAL_POINTERS_BUFFER RetrievalPointers; + } ExtentInformation; +} STREAM_EXTENT_ENTRY; + +/* Extract the MFT number part of the full inode number */ +#define NTFS_MFT_NO(ref) ((ref) & (((u64)1 << 48) - 1)) + +/* Is the file the root directory of the NTFS volume? The root directory always + * occupies MFT record 5. */ +#define NTFS_IS_ROOT_FILE(ino) (NTFS_MFT_NO(ino) == 5) + +/* Is the file a special NTFS file, other than the root directory? The special + * files are the first 16 records in the MFT. */ +#define NTFS_IS_SPECIAL_FILE(ino) \ + (NTFS_MFT_NO(ino) <= 15 && !NTFS_IS_ROOT_FILE(ino)) + +#define NTFS_SPECIAL_STREAM_OBJECT_ID 0x00000001 +#define NTFS_SPECIAL_STREAM_EA 0x00000002 +#define NTFS_SPECIAL_STREAM_EA_INFORMATION 0x00000004 + +/* Intermediate inode structure. This is used to temporarily save information + * from FSCTL_QUERY_FILE_LAYOUT before creating the full 'struct wim_inode'. */ +struct ntfs_inode { + struct avl_tree_node index_node; + u64 ino; + u64 creation_time; + u64 last_access_time; + u64 last_write_time; + u64 starting_lcn; + u32 attributes; + u32 security_id; + u32 num_aliases; + u32 num_streams; + u32 special_streams; + u32 first_stream_offset; + struct ntfs_dentry *first_child; + wchar_t short_name[13]; +}; + +/* Intermediate dentry structure. This is used to temporarily save information + * from FSCTL_QUERY_FILE_LAYOUT before creating the full 'struct wim_dentry'. */ +struct ntfs_dentry { + u32 offset_from_inode : 31; + u32 is_primary : 1; + union { + /* Note: build_children_lists() replaces 'parent_ino' with + * 'next_child'. */ + u64 parent_ino; + struct ntfs_dentry *next_child; + }; + wchar_t name[0]; +}; + +/* Intermediate stream structure. This is used to temporarily save information + * from FSCTL_QUERY_FILE_LAYOUT before creating the full 'struct + * wim_inode_stream'. */ +struct ntfs_stream { + u64 size; + wchar_t name[0]; +}; + +/* Map of all known NTFS inodes, keyed by inode number */ +struct ntfs_inode_map { + struct avl_tree_node *root; +}; + +#define NTFS_INODE(node) \ + avl_tree_entry((node), struct ntfs_inode, index_node) + +#define SKIP_ALIGNED(p, size) ((void *)(p) + ALIGN((size), 8)) + +/* Get a pointer to the first dentry of the inode. */ +#define FIRST_DENTRY(ni) SKIP_ALIGNED((ni), sizeof(struct ntfs_inode)) + +/* Get a pointer to the first stream of the inode. */ +#define FIRST_STREAM(ni) ((const void *)ni + ni->first_stream_offset) + +/* Advance to the next dentry of the inode. */ +#define NEXT_DENTRY(nd) SKIP_ALIGNED((nd), sizeof(struct ntfs_dentry) + \ + (wcslen((nd)->name) + 1) * sizeof(wchar_t)) + +/* Advance to the next stream of the inode. */ +#define NEXT_STREAM(ns) SKIP_ALIGNED((ns), sizeof(struct ntfs_stream) + \ + (wcslen((ns)->name) + 1) * sizeof(wchar_t)) + +static int +_avl_cmp_ntfs_inodes(const struct avl_tree_node *node1, + const struct avl_tree_node *node2) +{ + return cmp_u64(NTFS_INODE(node1)->ino, NTFS_INODE(node2)->ino); +} + +/* Adds an NTFS inode to the map. */ +static void +ntfs_inode_map_add_inode(struct ntfs_inode_map *map, struct ntfs_inode *ni) +{ + if (avl_tree_insert(&map->root, &ni->index_node, _avl_cmp_ntfs_inodes)) { + WARNING("Inode 0x%016"PRIx64" is a duplicate!", ni->ino); + FREE(ni); + } +} + +/* Find an ntfs_inode in the map by inode number. Returns NULL if not found. */ +static struct ntfs_inode * +ntfs_inode_map_lookup(struct ntfs_inode_map *map, u64 ino) +{ + struct ntfs_inode tmp; + struct avl_tree_node *res; + + tmp.ino = ino; + res = avl_tree_lookup_node(map->root, &tmp.index_node, _avl_cmp_ntfs_inodes); + if (!res) + return NULL; + return NTFS_INODE(res); +} + +/* Remove an ntfs_inode from the map and free it. */ +static void +ntfs_inode_map_remove(struct ntfs_inode_map *map, struct ntfs_inode *ni) +{ + avl_tree_remove(&map->root, &ni->index_node); + FREE(ni); +} + +/* Free all ntfs_inodes in the map. */ +static void +ntfs_inode_map_destroy(struct ntfs_inode_map *map) +{ + struct ntfs_inode *ni; + + avl_tree_for_each_in_postorder(ni, map->root, struct ntfs_inode, index_node) + FREE(ni); +} + +static bool +file_has_streams(const FILE_LAYOUT_ENTRY *file) +{ + return (file->FirstStreamOffset != 0) && + !(file->FileAttributes & FILE_ATTRIBUTE_ENCRYPTED); +} + +static bool +is_valid_name_entry(const FILE_LAYOUT_NAME_ENTRY *name) +{ + return name->FileNameLength > 0 && + name->FileNameLength % 2 == 0 && + !wmemchr(name->FileName, L'\0', name->FileNameLength / 2) && + (!(name->Flags & FILE_LAYOUT_NAME_ENTRY_DOS) || + name->FileNameLength <= 24); +} + +/* Validate the FILE_LAYOUT_NAME_ENTRYs of the specified file and compute the + * total length in bytes of the ntfs_dentry structures needed to hold the name + * information. */ +static int +validate_names_and_compute_total_length(const FILE_LAYOUT_ENTRY *file, + size_t *total_length_ret) +{ + const FILE_LAYOUT_NAME_ENTRY *name = + (const void *)file + file->FirstNameOffset; + size_t total = 0; + size_t num_long_names = 0; + + for (;;) { + if (unlikely(!is_valid_name_entry(name))) { + ERROR("Invalid FILE_LAYOUT_NAME_ENTRY! " + "FileReferenceNumber=0x%016"PRIx64", " + "FileNameLength=%"PRIu32", " + "FileName=%.*ls, Flags=0x%08"PRIx32, + file->FileReferenceNumber, + name->FileNameLength, + (int)(name->FileNameLength / 2), + name->FileName, name->Flags); + return WIMLIB_ERR_UNSUPPORTED; + } + if (name->Flags != FILE_LAYOUT_NAME_ENTRY_DOS) { + num_long_names++; + total += ALIGN(sizeof(struct ntfs_dentry) + + name->FileNameLength + sizeof(wchar_t), + 8); + } + if (name->NextNameOffset == 0) + break; + name = (const void *)name + name->NextNameOffset; + } + + if (unlikely(num_long_names == 0)) { + ERROR("Inode 0x%016"PRIx64" has no long names!", + file->FileReferenceNumber); + return WIMLIB_ERR_UNSUPPORTED; + } + + *total_length_ret = total; + return 0; +} + +static bool +is_valid_stream_entry(const STREAM_LAYOUT_ENTRY *stream) +{ + return stream->StreamIdentifierLength % 2 == 0 && + !wmemchr(stream->StreamIdentifier , L'\0', + stream->StreamIdentifierLength / 2); +} + +/* assumes that 'id' is a wide string literal */ +#define stream_has_identifier(stream, id) \ + ((stream)->StreamIdentifierLength == sizeof(id) - 2 && \ + !memcmp((stream)->StreamIdentifier, id, sizeof(id) - 2)) +/* + * If the specified STREAM_LAYOUT_ENTRY represents a DATA stream as opposed to + * some other type of NTFS stream such as a STANDARD_INFORMATION stream, return + * true and set *stream_name_ret and *stream_name_nchars_ret to specify just the + * stream name. For example, ":foo:$DATA" would become "foo" with length 3 + * characters. Otherwise return false. + */ +static bool +use_stream(const FILE_LAYOUT_ENTRY *file, const STREAM_LAYOUT_ENTRY *stream, + const wchar_t **stream_name_ret, size_t *stream_name_nchars_ret) +{ + const wchar_t *stream_name; + size_t stream_name_nchars; + + if (stream->StreamIdentifierLength == 0) { + /* The unnamed data stream may be given as an empty string + * rather than as "::$DATA". Handle it both ways. */ + stream_name = L""; + stream_name_nchars = 0; + } else if (!get_data_stream_name(stream->StreamIdentifier, + stream->StreamIdentifierLength / 2, + &stream_name, &stream_name_nchars)) + return false; + + /* Skip the unnamed data stream for directories. */ + if (stream_name_nchars == 0 && + (file->FileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + return false; + + *stream_name_ret = stream_name; + *stream_name_nchars_ret = stream_name_nchars; + return true; +} + +/* Validate the STREAM_LAYOUT_ENTRYs of the specified file and compute the total + * length in bytes of the ntfs_stream structures needed to hold the stream + * information. In addition, set *special_streams_ret to a bitmask of special + * stream types that were found. */ +static int +validate_streams_and_compute_total_length(const FILE_LAYOUT_ENTRY *file, + size_t *total_length_ret, + u32 *special_streams_ret) +{ + const STREAM_LAYOUT_ENTRY *stream = + (const void *)file + file->FirstStreamOffset; + size_t total = 0; + u32 special_streams = 0; + + for (;;) { + const wchar_t *name; + size_t name_nchars; + + if (unlikely(!is_valid_stream_entry(stream))) { + WARNING("Invalid STREAM_LAYOUT_ENTRY! " + "FileReferenceNumber=0x%016"PRIx64", " + "StreamIdentifierLength=%"PRIu32", " + "StreamIdentifier=%.*ls", + file->FileReferenceNumber, + stream->StreamIdentifierLength, + (int)(stream->StreamIdentifierLength / 2), + stream->StreamIdentifier); + return WIMLIB_ERR_UNSUPPORTED; + } + + if (use_stream(file, stream, &name, &name_nchars)) { + total += ALIGN(sizeof(struct ntfs_stream) + + (name_nchars + 1) * sizeof(wchar_t), 8); + } else if (stream_has_identifier(stream, L"::$OBJECT_ID")) { + special_streams |= NTFS_SPECIAL_STREAM_OBJECT_ID; + } else if (stream_has_identifier(stream, L"::$EA")) { + special_streams |= NTFS_SPECIAL_STREAM_EA; + } else if (stream_has_identifier(stream, L"::$EA_INFORMATION")) { + special_streams |= NTFS_SPECIAL_STREAM_EA_INFORMATION; + } + if (stream->NextStreamOffset == 0) + break; + stream = (const void *)stream + stream->NextStreamOffset; + } + + *total_length_ret = total; + *special_streams_ret = special_streams; + return 0; +} + +static void * +load_name_information(const FILE_LAYOUT_ENTRY *file, struct ntfs_inode *ni, + void *p) +{ + const FILE_LAYOUT_NAME_ENTRY *name = + (const void *)file + file->FirstNameOffset; + for (;;) { + struct ntfs_dentry *nd = p; + /* Note that a name may be just a short (DOS) name, just a long + * name, or both a short name and a long name. If there is a + * short name, one name should also be marked as "primary" to + * indicate which long name the short name is associated with. + * Also, there should be at most one short name per inode. */ + if (name->Flags & FILE_LAYOUT_NAME_ENTRY_DOS) { + memcpy(ni->short_name, + name->FileName, name->FileNameLength); + ni->short_name[name->FileNameLength / 2] = L'\0'; + } + if (name->Flags != FILE_LAYOUT_NAME_ENTRY_DOS) { + ni->num_aliases++; + nd->offset_from_inode = (u8 *)nd - (u8 *)ni; + nd->is_primary = ((name->Flags & + FILE_LAYOUT_NAME_ENTRY_PRIMARY) != 0); + nd->parent_ino = name->ParentFileReferenceNumber; + memcpy(nd->name, name->FileName, name->FileNameLength); + nd->name[name->FileNameLength / 2] = L'\0'; + p += ALIGN(sizeof(struct ntfs_dentry) + + name->FileNameLength + sizeof(wchar_t), 8); + } + if (name->NextNameOffset == 0) + break; + name = (const void *)name + name->NextNameOffset; + } + return p; +} + +static u64 +load_starting_lcn(const STREAM_LAYOUT_ENTRY *stream) +{ + const STREAM_EXTENT_ENTRY *entry; + + if (stream->ExtentInformationOffset == 0) + return 0; + + entry = (const void *)stream + stream->ExtentInformationOffset; + + if (!(entry->Flags & STREAM_EXTENT_ENTRY_AS_RETRIEVAL_POINTERS)) + return 0; + + return extract_starting_lcn(&entry->ExtentInformation.RetrievalPointers); +} + +static void * +load_stream_information(const FILE_LAYOUT_ENTRY *file, struct ntfs_inode *ni, + void *p) +{ + const STREAM_LAYOUT_ENTRY *stream = + (const void *)file + file->FirstStreamOffset; + const u32 first_stream_offset = (const u8 *)p - (const u8 *)ni; + for (;;) { + struct ntfs_stream *ns = p; + const wchar_t *name; + size_t name_nchars; + + if (use_stream(file, stream, &name, &name_nchars)) { + ni->first_stream_offset = first_stream_offset; + ni->num_streams++; + if (name_nchars == 0) + ni->starting_lcn = load_starting_lcn(stream); + ns->size = stream->EndOfFile; + wmemcpy(ns->name, name, name_nchars); + ns->name[name_nchars] = L'\0'; + p += ALIGN(sizeof(struct ntfs_stream) + + (name_nchars + 1) * sizeof(wchar_t), 8); + } + if (stream->NextStreamOffset == 0) + break; + stream = (const void *)stream + stream->NextStreamOffset; + } + return p; +} + +/* Process the information for a file given by FSCTL_QUERY_FILE_LAYOUT. */ +static int +load_one_file(const FILE_LAYOUT_ENTRY *file, struct ntfs_inode_map *inode_map) +{ + const FILE_LAYOUT_INFO_ENTRY *info = + (const void *)file + file->ExtraInfoOffset; + size_t inode_size; + struct ntfs_inode *ni; + size_t n; + int ret; + void *p; + u32 special_streams = 0; + + inode_size = ALIGN(sizeof(struct ntfs_inode), 8); + + /* The root file should have no names, and all other files should have + * at least one name. But just in case, we ignore the names of the root + * file, and we ignore any non-root file with no names. */ + if (!NTFS_IS_ROOT_FILE(file->FileReferenceNumber)) { + if (file->FirstNameOffset == 0) + return 0; + ret = validate_names_and_compute_total_length(file, &n); + if (ret) + return ret; + inode_size += n; + } + + if (file_has_streams(file)) { + ret = validate_streams_and_compute_total_length(file, &n, + &special_streams); + if (ret) + return ret; + inode_size += n; + } + + /* To save memory, we allocate the ntfs_dentry's and ntfs_stream's in + * the same memory block as their ntfs_inode. */ + ni = CALLOC(1, inode_size); + if (!ni) + return WIMLIB_ERR_NOMEM; + + ni->ino = file->FileReferenceNumber; + ni->attributes = info->BasicInformation.FileAttributes; + ni->creation_time = info->BasicInformation.CreationTime; + ni->last_write_time = info->BasicInformation.LastWriteTime; + ni->last_access_time = info->BasicInformation.LastAccessTime; + ni->security_id = info->SecurityId; + ni->special_streams = special_streams; + + p = FIRST_DENTRY(ni); + + if (!NTFS_IS_ROOT_FILE(file->FileReferenceNumber)) + p = load_name_information(file, ni, p); + + if (file_has_streams(file)) + p = load_stream_information(file, ni, p); + + wimlib_assert((u8 *)p - (u8 *)ni == inode_size); + + ntfs_inode_map_add_inode(inode_map, ni); + return 0; +} + +/* + * Quickly find all files on an NTFS volume by using FSCTL_QUERY_FILE_LAYOUT to + * scan the MFT. The NTFS volume is specified by the NT namespace path @path. + * For each file, allocate an 'ntfs_inode' structure for each file and add it to + * 'inode_map' keyed by inode number. Include NTFS special files such as + * $Bitmap (they will be removed later). + */ +static int +load_files_from_mft(const wchar_t *path, struct ntfs_inode_map *inode_map) +{ + HANDLE h = NULL; + QUERY_FILE_LAYOUT_INPUT in = (QUERY_FILE_LAYOUT_INPUT) { + .NumberOfPairs = 0, + .Flags = QUERY_FILE_LAYOUT_RESTART | + QUERY_FILE_LAYOUT_INCLUDE_NAMES | + QUERY_FILE_LAYOUT_INCLUDE_STREAMS | + QUERY_FILE_LAYOUT_INCLUDE_EXTENTS | + QUERY_FILE_LAYOUT_INCLUDE_EXTRA_INFO | + QUERY_FILE_LAYOUT_INCLUDE_STREAMS_WITH_NO_CLUSTERS_ALLOCATED, + .FilterType = QUERY_FILE_LAYOUT_FILTER_TYPE_NONE, + }; + size_t outsize = 32768; + QUERY_FILE_LAYOUT_OUTPUT *out = NULL; + int ret; + NTSTATUS status; + + status = winnt_open(path, wcslen(path), + FILE_READ_DATA | FILE_READ_ATTRIBUTES, &h); + if (!NT_SUCCESS(status)) { + ret = -1; /* Silently try standard recursive scan instead */ + goto out; + } + + for (;;) { + /* Allocate a buffer for the output of the ioctl. */ + out = MALLOC(outsize); + if (!out) { + ret = WIMLIB_ERR_NOMEM; + goto out; + } + + /* Execute FSCTL_QUERY_FILE_LAYOUT until it fails. */ + while (NT_SUCCESS(status = winnt_fsctl(h, + FSCTL_QUERY_FILE_LAYOUT, + &in, sizeof(in), + out, outsize, NULL))) + { + const FILE_LAYOUT_ENTRY *file = + (const void *)out + out->FirstFileOffset; + for (;;) { + ret = load_one_file(file, inode_map); + if (ret) + goto out; + if (file->NextFileOffset == 0) + break; + file = (const void *)file + file->NextFileOffset; + } + in.Flags &= ~QUERY_FILE_LAYOUT_RESTART; + } + + /* Enlarge the buffer if needed. */ + if (status != STATUS_BUFFER_TOO_SMALL) + break; + FREE(out); + outsize *= 2; + } + + /* Normally, FSCTL_QUERY_FILE_LAYOUT fails with STATUS_END_OF_FILE after + * all files have been enumerated. */ + if (status != STATUS_END_OF_FILE) { + if (status == STATUS_INVALID_DEVICE_REQUEST /* old OS */ || + status == STATUS_NOT_SUPPORTED /* Samba volume, WinXP */ || + status == STATUS_INVALID_PARAMETER /* not root directory */ ) + { + /* Silently try standard recursive scan instead */ + ret = -1; + } else { + winnt_error(status, + L"Error enumerating files on volume \"%ls\"", + path); + /* Try standard recursive scan instead */ + ret = WIMLIB_ERR_UNSUPPORTED; + } + goto out; + } + ret = 0; +out: + FREE(out); + NtClose(h); + return ret; +} + +/* Build the list of child dentries for each inode in @map. This is done by + * iterating through each name of each inode and adding it to its parent's + * children list. Note that every name should have a parent, i.e. should belong + * to some directory. The root directory does not have any names. */ +static int +build_children_lists(struct ntfs_inode_map *map, struct ntfs_inode **root_ret) +{ + struct ntfs_inode *ni; + + avl_tree_for_each_in_order(ni, map->root, struct ntfs_inode, index_node) + { + struct ntfs_dentry *nd; + u32 n; + + if (NTFS_IS_ROOT_FILE(ni->ino)) { + *root_ret = ni; + continue; + } + + n = ni->num_aliases; + nd = FIRST_DENTRY(ni); + for (;;) { + struct ntfs_inode *parent; + + parent = ntfs_inode_map_lookup(map, nd->parent_ino); + if (unlikely(!parent)) { + ERROR("Parent inode 0x%016"PRIx64" of" + "directory entry \"%ls\" (inode " + "0x%016"PRIx64") was missing from the " + "MFT listing!", + nd->parent_ino, nd->name, ni->ino); + return WIMLIB_ERR_UNSUPPORTED; + } + nd->next_child = parent->first_child; + parent->first_child = nd; + if (!--n) + break; + nd = NEXT_DENTRY(nd); + } + } + return 0; +} + +struct security_map_node { + struct avl_tree_node index_node; + u32 disk_security_id; + u32 wim_security_id; +}; + +/* Map from disk security IDs to WIM security IDs */ +struct security_map { + struct avl_tree_node *root; +}; + +#define SECURITY_MAP_NODE(node) \ + avl_tree_entry((node), struct security_map_node, index_node) + +static int +_avl_cmp_security_map_nodes(const struct avl_tree_node *node1, + const struct avl_tree_node *node2) +{ + return cmp_u32(SECURITY_MAP_NODE(node1)->disk_security_id, + SECURITY_MAP_NODE(node2)->disk_security_id); +} + +static s32 +security_map_lookup(struct security_map *map, u32 disk_security_id) +{ + struct security_map_node tmp; + const struct avl_tree_node *res; + + if (disk_security_id == 0) /* No on-disk security ID; uncacheable */ + return -1; + + tmp.disk_security_id = disk_security_id; + res = avl_tree_lookup_node(map->root, &tmp.index_node, + _avl_cmp_security_map_nodes); + if (!res) + return -1; + return SECURITY_MAP_NODE(res)->wim_security_id; +} + +static int +security_map_insert(struct security_map *map, u32 disk_security_id, + u32 wim_security_id) +{ + struct security_map_node *node; + + if (disk_security_id == 0) /* No on-disk security ID; uncacheable */ + return 0; + + node = MALLOC(sizeof(*node)); + if (!node) + return WIMLIB_ERR_NOMEM; + + node->disk_security_id = disk_security_id; + node->wim_security_id = wim_security_id; + avl_tree_insert(&map->root, &node->index_node, + _avl_cmp_security_map_nodes); + return 0; +} + +static void +security_map_destroy(struct security_map *map) +{ + struct security_map_node *node; + + avl_tree_for_each_in_postorder(node, map->root, + struct security_map_node, index_node) + FREE(node); +} + +/* + * Turn our temporary NTFS structures into the final WIM structures: + * + * ntfs_inode => wim_inode + * ntfs_dentry => wim_dentry + * ntfs_stream => wim_inode_stream + * + * This also handles things such as exclusions and issuing progress messages. + * It's similar to winnt_build_dentry_tree(), but this is much faster because + * almost all information we need is already loaded in memory in the ntfs_* + * structures. However, in some cases we still fall back to + * winnt_build_dentry_tree() and/or opening the file. + */ +static int +generate_wim_structures_recursive(struct wim_dentry **root_ret, + const wchar_t *filename, bool is_primary_name, + struct ntfs_inode *ni, + struct winnt_scan_ctx *ctx, + struct ntfs_inode_map *inode_map, + struct security_map *security_map) +{ + int ret = 0; + struct wim_dentry *root = NULL; + struct wim_inode *inode = NULL; + const struct ntfs_stream *ns; + + /* Completely ignore NTFS special files. */ + if (NTFS_IS_SPECIAL_FILE(ni->ino)) + goto out; + + /* Fall back to the standard scan for unhandled cases. Reparse points, + * in particular, can't be properly handled here because a commonly used + * filter driver (WOF) hides reparse points from regular filesystem APIs + * but not from FSCTL_QUERY_FILE_LAYOUT. */ + if (ni->attributes & (FILE_ATTRIBUTE_REPARSE_POINT | + FILE_ATTRIBUTE_ENCRYPTED) || + ni->special_streams != 0) + { + ret = winnt_build_dentry_tree(&root, NULL, + ctx->params->cur_path, + ctx->params->cur_path_nchars, + filename, ctx, false); + if (ret) /* Error? */ + goto out; + if (!root) /* Excluded? */ + goto out_progress; + inode = root->d_inode; + goto process_children; + } + + /* Test for exclusion based on path. */ + ret = try_exclude(ctx->params); + if (unlikely(ret < 0)) /* Excluded? */ + goto out_progress; + if (unlikely(ret > 0)) /* Error? */ + goto out; + + /* Create the WIM dentry and possibly a new WIM inode */ + ret = inode_table_new_dentry(ctx->params->inode_table, filename, + ni->ino, ctx->params->capture_root_dev, + false, &root); + if (ret) + goto out; + + inode = root->d_inode; + + /* Set the short name if needed. */ + if (is_primary_name && *ni->short_name) { + size_t nbytes = wcslen(ni->short_name) * sizeof(wchar_t); + root->d_short_name = memdup(ni->short_name, + nbytes + sizeof(wchar_t)); + if (!root->d_short_name) { + ret = WIMLIB_ERR_NOMEM; + goto out; + } + root->d_short_name_nbytes = nbytes; + } + + if (inode->i_nlink > 1) { /* Already seen this inode? */ + ret = 0; + goto out_progress; + } + + /* The file attributes and timestamps were cached from the MFT. */ + inode->i_attributes = ni->attributes; + inode->i_creation_time = ni->creation_time; + inode->i_last_write_time = ni->last_write_time; + inode->i_last_access_time = ni->last_access_time; + + /* Set the security descriptor if needed. */ + if (!(ctx->params->add_flags & WIMLIB_ADD_FLAG_NO_ACLS)) { + /* Look up the WIM security ID that corresponds to the on-disk + * security ID. */ + s32 wim_security_id = + security_map_lookup(security_map, ni->security_id); + if (likely(wim_security_id >= 0)) { + /* The mapping for this security ID is already cached.*/ + inode->i_security_id = wim_security_id; + } else { + HANDLE h; + NTSTATUS status; + + /* Create a mapping for this security ID and insert it + * into the security map. */ + + status = winnt_open(ctx->params->cur_path, + ctx->params->cur_path_nchars, + READ_CONTROL | + ACCESS_SYSTEM_SECURITY, &h); + if (!NT_SUCCESS(status)) { + winnt_error(status, L"Can't open \"%ls\" to " + "read security descriptor", + printable_path(ctx)); + ret = WIMLIB_ERR_OPEN; + goto out; + } + ret = winnt_load_security_descriptor(h, inode, ctx); + NtClose(h); + if (ret) + goto out; + + ret = security_map_insert(security_map, ni->security_id, + inode->i_security_id); + if (ret) + goto out; + } + } + + /* Add data streams based on the cached information from the MFT. */ + ns = FIRST_STREAM(ni); + for (u32 i = 0; i < ni->num_streams; i++) { + struct windows_file *windows_file; + + /* Reference the stream by path if it's a named data stream, or + * if the volume doesn't support "open by file ID", or if the + * application hasn't explicitly opted in to "open by file ID". + * Otherwise, only save the inode number (file ID). */ + if (*ns->name || + !(ctx->vol_flags & FILE_SUPPORTS_OPEN_BY_FILE_ID) || + !(ctx->params->add_flags & WIMLIB_ADD_FLAG_FILE_PATHS_UNNEEDED)) + { + windows_file = alloc_windows_file(ctx->params->cur_path, + ctx->params->cur_path_nchars, + ns->name, + wcslen(ns->name), + ctx->snapshot, + false); + } else { + windows_file = alloc_windows_file_for_file_id(ni->ino, + ctx->params->cur_path, + ctx->params->root_path_nchars, + ctx->snapshot); + } + + ret = add_stream(inode, windows_file, ns->size, + STREAM_TYPE_DATA, ns->name, + ctx->params->unhashed_blobs); + if (ret) + goto out; + ns = NEXT_STREAM(ns); + } + + set_sort_key(inode, ni->starting_lcn); + + /* If processing a directory, then recurse to its children. In this + * version there is no need to go to disk, as we already have the list + * of children cached from the MFT. */ +process_children: + if (inode_is_directory(inode)) { + const struct ntfs_dentry *nd = ni->first_child; + + while (nd != NULL) { + size_t orig_path_nchars; + struct wim_dentry *child; + const struct ntfs_dentry *next = nd->next_child; + + ret = WIMLIB_ERR_NOMEM; + if (!pathbuf_append_name(ctx->params, nd->name, + wcslen(nd->name), + &orig_path_nchars)) + goto out; + + ret = generate_wim_structures_recursive( + &child, + nd->name, + nd->is_primary, + (void *)nd - nd->offset_from_inode, + ctx, + inode_map, + security_map); + + pathbuf_truncate(ctx->params, orig_path_nchars); + + if (ret) + goto out; + + attach_scanned_tree(root, child, ctx->params->blob_table); + nd = next; + } + } + +out_progress: + if (likely(root)) + ret = do_scan_progress(ctx->params, WIMLIB_SCAN_DENTRY_OK, inode); + else + ret = do_scan_progress(ctx->params, WIMLIB_SCAN_DENTRY_EXCLUDED, NULL); +out: + if (--ni->num_aliases == 0) { + /* Memory usage optimization: when we don't need the ntfs_inode + * (and its names and streams) anymore, free it. */ + ntfs_inode_map_remove(inode_map, ni); + } + if (unlikely(ret)) { + free_dentry_tree(root, ctx->params->blob_table); + root = NULL; + } + *root_ret = root; + return ret; +} + +static int +winnt_build_dentry_tree_fast(struct wim_dentry **root_ret, + struct winnt_scan_ctx *ctx) +{ + struct ntfs_inode_map inode_map = { .root = NULL }; + struct security_map security_map = { .root = NULL }; + struct ntfs_inode *root = NULL; + wchar_t *path = ctx->params->cur_path; + size_t path_nchars = ctx->params->cur_path_nchars; + bool adjust_path; + int ret; + + adjust_path = (path[path_nchars - 1] == L'\\'); + if (adjust_path) + path[path_nchars - 1] = L'\0'; + + ret = load_files_from_mft(path, &inode_map); + + if (adjust_path) + path[path_nchars - 1] = L'\\'; + + if (ret) + goto out; + + ret = build_children_lists(&inode_map, &root); + if (ret) + goto out; + + if (!root) { + ERROR("The MFT listing for volume \"%ls\" did not include a " + "root directory!", path); + ret = WIMLIB_ERR_UNSUPPORTED; + goto out; + } + + root->num_aliases = 1; + + ret = generate_wim_structures_recursive(root_ret, L"", false, root, ctx, + &inode_map, &security_map); +out: + ntfs_inode_map_destroy(&inode_map); + security_map_destroy(&security_map); + return ret; +} + +#endif /* ENABLE_FAST_MFT_SCAN */ + +/*----------------------------------------------------------------------------* + * Entry point for directory tree scans on Windows * + *----------------------------------------------------------------------------*/ + +int +win32_build_dentry_tree(struct wim_dentry **root_ret, + const wchar_t *root_disk_path, + struct scan_params *params) +{ + struct winnt_scan_ctx ctx = { .params = params }; + UNICODE_STRING ntpath; + HANDLE h = NULL; + NTSTATUS status; + int ret; + + if (params->add_flags & WIMLIB_ADD_FLAG_SNAPSHOT) + ret = vss_create_snapshot(root_disk_path, &ntpath, &ctx.snapshot); + else + ret = win32_path_to_nt_path(root_disk_path, &ntpath); + + if (ret) + goto out; + + if (ntpath.Length < 4 * sizeof(wchar_t) || + wmemcmp(ntpath.Buffer, L"\\??\\", 4)) + { + ERROR("\"%ls\": unrecognized path format", root_disk_path); + ret = WIMLIB_ERR_INVALID_PARAM; + } else { + ret = pathbuf_init(params, ntpath.Buffer); + } + HeapFree(GetProcessHeap(), 0, ntpath.Buffer); + if (ret) + goto out; + + status = winnt_open(params->cur_path, params->cur_path_nchars, + FILE_READ_ATTRIBUTES, &h); + if (!NT_SUCCESS(status)) { + winnt_error(status, L"Can't open \"%ls\"", root_disk_path); + if (status == STATUS_FVE_LOCKED_VOLUME) + ret = WIMLIB_ERR_FVE_LOCKED_VOLUME; + else + ret = WIMLIB_ERR_OPEN; + goto out; + } + + get_volume_information(h, &ctx); + + NtClose(h); + +#ifdef ENABLE_FAST_MFT_SCAN + if (ctx.is_ntfs && !_wgetenv(L"WIMLIB_DISABLE_QUERY_FILE_LAYOUT")) { + ret = winnt_build_dentry_tree_fast(root_ret, &ctx); + if (ret >= 0 && ret != WIMLIB_ERR_UNSUPPORTED) + goto out; + if (ret >= 0) { + WARNING("A problem occurred during the fast MFT scan.\n" + " Falling back to the standard " + "recursive directory tree scan."); + } + } +#endif + ret = winnt_build_dentry_tree(root_ret, NULL, params->cur_path, + params->cur_path_nchars, L"", &ctx, true); +out: + vss_put_snapshot(ctx.snapshot); + if (ret == 0) + winnt_do_scan_warnings(root_disk_path, &ctx); + return ret; +} + +#endif /* _WIN32 */ diff --git a/src/wimlib/win32_common.c b/src/wimlib/win32_common.c new file mode 100644 index 00000000..408650b0 --- /dev/null +++ b/src/wimlib/win32_common.c @@ -0,0 +1,410 @@ +/* + * win32_common.c - Windows code common to applying and capturing images. + */ + +/* + * Copyright (C) 2013-2016 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef _WIN32 + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/win32_common.h" + +#include "wimlib/assert.h" +#include "wimlib/error.h" +#include "wimlib/util.h" +#include "wimlib/win32_vss.h" + +static bool +win32_modify_privilege(const wchar_t *privilege, bool enable) +{ + HANDLE hToken; + LUID luid; + TOKEN_PRIVILEGES newState; + bool ret = FALSE; + + if (!OpenProcessToken(GetCurrentProcess(), + TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, + &hToken)) + goto out; + + if (!LookupPrivilegeValue(NULL, privilege, &luid)) + goto out_close_handle; + + newState.PrivilegeCount = 1; + newState.Privileges[0].Luid = luid; + newState.Privileges[0].Attributes = (enable ? SE_PRIVILEGE_ENABLED : 0); + SetLastError(ERROR_SUCCESS); + ret = AdjustTokenPrivileges(hToken, FALSE, &newState, 0, NULL, NULL); + if (ret && GetLastError() == ERROR_NOT_ALL_ASSIGNED) + ret = FALSE; +out_close_handle: + CloseHandle(hToken); +out: + return ret; +} + +static bool +win32_modify_capture_privileges(bool enable) +{ + bool ok = true; + ok &= win32_modify_privilege(SE_BACKUP_NAME, enable); + ok &= win32_modify_privilege(SE_SECURITY_NAME, enable); + return ok; +} + +static bool +win32_modify_apply_privileges(bool enable) +{ + bool ok = true; + ok &= win32_modify_privilege(SE_RESTORE_NAME, enable); + ok &= win32_modify_privilege(SE_SECURITY_NAME, enable); + ok &= win32_modify_privilege(SE_TAKE_OWNERSHIP_NAME, enable); + ok &= win32_modify_privilege(SE_MANAGE_VOLUME_NAME, enable); + return ok; +} + +static void +win32_release_capture_and_apply_privileges(void) +{ + win32_modify_capture_privileges(false); + win32_modify_apply_privileges(false); +} + +/* Pointers to dynamically loaded functions */ + +NTSTATUS (WINAPI *func_RtlDosPathNameToNtPathName_U_WithStatus) + (IN PCWSTR DosName, + OUT PUNICODE_STRING NtName, + OUT PCWSTR *PartName, + OUT PRTL_RELATIVE_NAME_U RelativeName); + +NTSTATUS (WINAPI *func_RtlCreateSystemVolumeInformationFolder) + (PCUNICODE_STRING VolumeRootPath); + +static bool acquired_privileges = false; + +static HMODULE ntdll_handle = NULL; + +static int +init_ntdll(void) +{ + ntdll_handle = LoadLibrary(L"ntdll.dll"); + + if (!ntdll_handle) { + ERROR("Unable to load ntdll.dll"); + return WIMLIB_ERR_UNSUPPORTED; + } + + func_RtlDosPathNameToNtPathName_U_WithStatus = + (void *)GetProcAddress(ntdll_handle, + "RtlDosPathNameToNtPathName_U_WithStatus"); + + func_RtlCreateSystemVolumeInformationFolder = + (void *)GetProcAddress(ntdll_handle, + "RtlCreateSystemVolumeInformationFolder"); + return 0; +} + +/* One-time initialization for Windows capture/apply code. */ +int +win32_global_init(int init_flags) +{ + int ret; + + /* Try to acquire useful privileges. */ + if (!(init_flags & WIMLIB_INIT_FLAG_DONT_ACQUIRE_PRIVILEGES)) { + ret = WIMLIB_ERR_INSUFFICIENT_PRIVILEGES; + if (!win32_modify_capture_privileges(true)) + if (init_flags & WIMLIB_INIT_FLAG_STRICT_CAPTURE_PRIVILEGES) + goto out_drop_privs; + if (!win32_modify_apply_privileges(true)) + if (init_flags & WIMLIB_INIT_FLAG_STRICT_APPLY_PRIVILEGES) + goto out_drop_privs; + acquired_privileges = true; + } + + ret = init_ntdll(); + if (ret) + goto out_drop_privs; + + return 0; + +out_drop_privs: + win32_release_capture_and_apply_privileges(); + return ret; +} + +void +win32_global_cleanup(void) +{ + vss_global_cleanup(); + + if (acquired_privileges) + win32_release_capture_and_apply_privileges(); + + FreeLibrary(ntdll_handle); + ntdll_handle = NULL; +} + +/* + * Translates a Win32-namespace path into an NT-namespace path. + * + * On success, returns 0. The NT-namespace path will be stored in the + * UNICODE_STRING structure pointed to by nt_path. nt_path->Buffer will be set + * to a new buffer that must later be freed with HeapFree(). (Really + * RtlHeapFree(), but HeapFree() seems to be the same thing.) + * + * On failure, returns WIMLIB_ERR_NOMEM or WIMLIB_ERR_INVALID_PARAM. + */ +int +win32_path_to_nt_path(const wchar_t *win32_path, UNICODE_STRING *nt_path) +{ + NTSTATUS status; + + if (func_RtlDosPathNameToNtPathName_U_WithStatus) { + status = (*func_RtlDosPathNameToNtPathName_U_WithStatus)(win32_path, + nt_path, + NULL, NULL); + } else { + if (RtlDosPathNameToNtPathName_U(win32_path, nt_path, NULL, NULL)) + status = STATUS_SUCCESS; + else + status = STATUS_NO_MEMORY; + } + + if (likely(NT_SUCCESS(status))) + return 0; + + if (status == STATUS_NO_MEMORY) + return WIMLIB_ERR_NOMEM; + + winnt_error(status, L"\"%ls\": invalid path name", win32_path); + return WIMLIB_ERR_INVALID_PARAM; +} + +int +win32_get_drive_path(const wchar_t *file_path, wchar_t drive_path[7]) +{ + tchar *file_abspath; + + file_abspath = realpath(file_path, NULL); + if (!file_abspath) + return WIMLIB_ERR_NOMEM; + + if (file_abspath[0] == L'\0' || file_abspath[1] != L':') { + ERROR("\"%ls\": Path format not recognized", file_abspath); + FREE(file_abspath); + return WIMLIB_ERR_UNSUPPORTED; + } + + wsprintf(drive_path, L"\\\\.\\%lc:", file_abspath[0]); + FREE(file_abspath); + return 0; +} + +/* Try to attach an instance of the Windows Overlay Filesystem filter driver to + * the specified drive (such as C:) */ +bool +win32_try_to_attach_wof(const wchar_t *drive) +{ + HMODULE fltlib; + bool retval = false; + + /* Use FilterAttach() from Fltlib.dll. */ + + fltlib = LoadLibrary(L"Fltlib.dll"); + + if (!fltlib) { + WARNING("Failed to load Fltlib.dll"); + return retval; + } + + HRESULT (WINAPI *func_FilterAttach)(LPCWSTR lpFilterName, + LPCWSTR lpVolumeName, + LPCWSTR lpInstanceName, + DWORD dwCreatedInstanceNameLength, + LPWSTR lpCreatedInstanceName); + + func_FilterAttach = (void *)GetProcAddress(fltlib, "FilterAttach"); + + if (func_FilterAttach) { + HRESULT res; + + res = (*func_FilterAttach)(L"wof", drive, NULL, 0, NULL); + + if (res != S_OK) + res = (*func_FilterAttach)(L"wofadk", drive, NULL, 0, NULL); + + if (res == S_OK) + retval = true; + } else { + WARNING("FilterAttach() does not exist in Fltlib.dll"); + } + + FreeLibrary(fltlib); + + return retval; +} + + +static void +windows_msg(u32 code, const wchar_t *format, va_list va, + bool is_ntstatus, bool is_error) +{ + wchar_t _buf[STACK_MAX / 8]; + wchar_t *buf = _buf; + size_t buflen = ARRAY_LEN(_buf); + size_t ret; + size_t n; + va_list va2; + +retry: + va_copy(va2, va); + n = vsnwprintf(buf, buflen, format, va2); + va_end(va2); + + if (n >= buflen) + goto realloc; + + n += snwprintf(&buf[n], buflen - n, + (is_ntstatus ? + L" (status=%08"PRIx32"): " : + L" (err=%"PRIu32"): "), + code); + + if (n >= buflen) + goto realloc; + + ret = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS | + (is_ntstatus ? FORMAT_MESSAGE_FROM_HMODULE : 0), + (is_ntstatus ? ntdll_handle : NULL), + code, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + &buf[n], + buflen - n, + NULL); + n += ret; + + if (n >= buflen || (ret == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER)) + goto realloc; + + if (buf[n - 1] == L'\n') + buf[--n] = L'\0'; + if (buf[n - 1] == L'\r') + buf[--n] = L'\0'; + if (buf[n - 1] == L'.') + buf[--n] = L'\0'; + + if (is_error) + ERROR("%ls", buf); + else + WARNING("%ls", buf); + if (buf != _buf) + FREE(buf); + return; + +realloc: + if (buf != _buf) + FREE(buf); + buflen *= 2; + buf = MALLOC(buflen * sizeof(buf[0])); + if (buf) + goto retry; + ERROR("Ran out of memory while building error message!!!"); +} + +void +win32_warning(DWORD err, const wchar_t *format, ...) +{ + va_list va; + + va_start(va, format); + windows_msg(err, format, va, false, false); + va_end(va); +} + +void +win32_error(DWORD err, const wchar_t *format, ...) +{ + va_list va; + + va_start(va, format); + windows_msg(err, format, va, false, true); + va_end(va); +} + +void +winnt_warning(NTSTATUS status, const wchar_t *format, ...) +{ + va_list va; + + va_start(va, format); + windows_msg(status, format, va, true, false); + va_end(va); +} + +void +winnt_error(NTSTATUS status, const wchar_t *format, ...) +{ + va_list va; + + va_start(va, format); + windows_msg(status, format, va, true, true); + va_end(va); +} + +/* + * Synchronously execute a filesystem control method. This is a wrapper around + * NtFsControlFile() that handles STATUS_PENDING. Note that SYNCHRONIZE + * permission is, in general, required on the handle. + */ +NTSTATUS +winnt_fsctl(HANDLE h, u32 code, const void *in, u32 in_size, + void *out, u32 out_size_avail, u32 *actual_out_size_ret) +{ + IO_STATUS_BLOCK iosb; + NTSTATUS status; + + status = NtFsControlFile(h, NULL, NULL, NULL, &iosb, code, + (void *)in, in_size, out, out_size_avail); + if (status == STATUS_PENDING) { + /* Beware: this case is often encountered with remote + * filesystems, but rarely with local filesystems. */ + + status = NtWaitForSingleObject(h, FALSE, NULL); + if (NT_SUCCESS(status)) { + status = iosb.Status; + } else { + /* We shouldn't be issuing ioctls on a handle to which + * we don't have SYNCHRONIZE access. Otherwise we have + * no way to wait for them to complete. */ + wimlib_assert(status != STATUS_ACCESS_DENIED); + } + } + + if (NT_SUCCESS(status) && actual_out_size_ret != NULL) + *actual_out_size_ret = (u32)iosb.Information; + + return status; +} + +#endif /* _WIN32 */ diff --git a/src/wimlib/win32_replacements.c b/src/wimlib/win32_replacements.c new file mode 100644 index 00000000..5df6c78e --- /dev/null +++ b/src/wimlib/win32_replacements.c @@ -0,0 +1,773 @@ +/* + * win32_replacements.c - Replacements for various functions not available on + * Windows, such as fsync(). + */ + +/* + * Copyright (C) 2013-2016 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef _WIN32 + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <errno.h> +#include <io.h> /* for _get_osfhandle() */ +#include <fcntl.h> + +#include "wimlib/win32_common.h" + +#include "wimlib/assert.h" +#include "wimlib/glob.h" +#include "wimlib/error.h" +#include "wimlib/timestamp.h" +#include "wimlib/util.h" + +static int +win32_error_to_errno(DWORD err_code) +{ + /* This mapping is that used in Cygwin. + * Some of these choices are arbitrary. */ + switch (err_code) { + case ERROR_ACCESS_DENIED: + return EACCES; + case ERROR_ACTIVE_CONNECTIONS: + return EAGAIN; + case ERROR_ALREADY_EXISTS: + return EEXIST; + case ERROR_BAD_DEVICE: + return ENODEV; + case ERROR_BAD_EXE_FORMAT: + return ENOEXEC; + case ERROR_BAD_NETPATH: + return ENOENT; + case ERROR_BAD_NET_NAME: + return ENOENT; + case ERROR_BAD_NET_RESP: + return ENOSYS; + case ERROR_BAD_PATHNAME: + return ENOENT; + case ERROR_BAD_PIPE: + return EINVAL; + case ERROR_BAD_UNIT: + return ENODEV; + case ERROR_BAD_USERNAME: + return EINVAL; + case ERROR_BEGINNING_OF_MEDIA: + return EIO; + case ERROR_BROKEN_PIPE: + return EPIPE; + case ERROR_BUSY: + return EBUSY; + case ERROR_BUS_RESET: + return EIO; + case ERROR_CALL_NOT_IMPLEMENTED: + return ENOSYS; + case ERROR_CANNOT_MAKE: + return EPERM; + case ERROR_CHILD_NOT_COMPLETE: + return EBUSY; + case ERROR_COMMITMENT_LIMIT: + return EAGAIN; + case ERROR_CRC: + return EIO; + case ERROR_DEVICE_DOOR_OPEN: + return EIO; + case ERROR_DEVICE_IN_USE: + return EAGAIN; + case ERROR_DEVICE_REQUIRES_CLEANING: + return EIO; + case ERROR_DIRECTORY: + return ENOTDIR; + case ERROR_DIR_NOT_EMPTY: + return ENOTEMPTY; + case ERROR_DISK_CORRUPT: + return EIO; + case ERROR_DISK_FULL: + return ENOSPC; +#ifdef ENOTUNIQ + case ERROR_DUP_NAME: + return ENOTUNIQ; +#endif + case ERROR_EAS_DIDNT_FIT: + return ENOSPC; +#ifdef ENOTSUP + case ERROR_EAS_NOT_SUPPORTED: + return ENOTSUP; +#endif + case ERROR_EA_LIST_INCONSISTENT: + return EINVAL; + case ERROR_EA_TABLE_FULL: + return ENOSPC; + case ERROR_END_OF_MEDIA: + return ENOSPC; + case ERROR_EOM_OVERFLOW: + return EIO; + case ERROR_EXE_MACHINE_TYPE_MISMATCH: + return ENOEXEC; + case ERROR_EXE_MARKED_INVALID: + return ENOEXEC; + case ERROR_FILEMARK_DETECTED: + return EIO; + case ERROR_FILENAME_EXCED_RANGE: + return ENAMETOOLONG; + case ERROR_FILE_CORRUPT: + return EEXIST; + case ERROR_FILE_EXISTS: + return EEXIST; + case ERROR_FILE_INVALID: + return ENXIO; + case ERROR_FILE_NOT_FOUND: + return ENOENT; + case ERROR_HANDLE_DISK_FULL: + return ENOSPC; +#ifdef ENODATA + case ERROR_HANDLE_EOF: + return ENODATA; +#endif + case ERROR_INVALID_ADDRESS: + return EINVAL; + case ERROR_INVALID_AT_INTERRUPT_TIME: + return EINTR; + case ERROR_INVALID_BLOCK_LENGTH: + return EIO; + case ERROR_INVALID_DATA: + return EINVAL; + case ERROR_INVALID_DRIVE: + return ENODEV; + case ERROR_INVALID_EA_NAME: + return EINVAL; + case ERROR_INVALID_EXE_SIGNATURE: + return ENOEXEC; +#ifdef EBADRQC + case ERROR_INVALID_FUNCTION: + return EBADRQC; +#endif + case ERROR_INVALID_HANDLE: + return EBADF; + case ERROR_INVALID_NAME: + return ENOENT; + case ERROR_INVALID_PARAMETER: + return EINVAL; + case ERROR_INVALID_SIGNAL_NUMBER: + return EINVAL; + case ERROR_IOPL_NOT_ENABLED: + return ENOEXEC; + case ERROR_IO_DEVICE: + return EIO; + case ERROR_IO_INCOMPLETE: + return EAGAIN; + case ERROR_IO_PENDING: + return EAGAIN; + case ERROR_LOCK_VIOLATION: + return EBUSY; + case ERROR_MAX_THRDS_REACHED: + return EAGAIN; + case ERROR_META_EXPANSION_TOO_LONG: + return EINVAL; + case ERROR_MOD_NOT_FOUND: + return ENOENT; +#ifdef EMSGSIZE + case ERROR_MORE_DATA: + return EMSGSIZE; +#endif + case ERROR_NEGATIVE_SEEK: + return EINVAL; + case ERROR_NETNAME_DELETED: + return ENOENT; + case ERROR_NOACCESS: + return EFAULT; + case ERROR_NONE_MAPPED: + return EINVAL; + case ERROR_NONPAGED_SYSTEM_RESOURCES: + return EAGAIN; +#ifdef ENOLINK + case ERROR_NOT_CONNECTED: + return ENOLINK; +#endif + case ERROR_NOT_ENOUGH_MEMORY: + return ENOMEM; + case ERROR_NOT_OWNER: + return EPERM; +#ifdef ENOMEDIUM + case ERROR_NOT_READY: + return ENOMEDIUM; +#endif + case ERROR_NOT_SAME_DEVICE: + return EXDEV; + case ERROR_NOT_SUPPORTED: + return ENOSYS; + case ERROR_NO_DATA: + return EPIPE; + case ERROR_NO_DATA_DETECTED: + return EIO; +#ifdef ENOMEDIUM + case ERROR_NO_MEDIA_IN_DRIVE: + return ENOMEDIUM; +#endif +#ifdef ENMFILE + case ERROR_NO_MORE_FILES: + return ENMFILE; +#endif +#ifdef ENMFILE + case ERROR_NO_MORE_ITEMS: + return ENMFILE; +#endif + case ERROR_NO_MORE_SEARCH_HANDLES: + return ENFILE; + case ERROR_NO_PROC_SLOTS: + return EAGAIN; + case ERROR_NO_SIGNAL_SENT: + return EIO; + case ERROR_NO_SYSTEM_RESOURCES: + return EFBIG; + case ERROR_NO_TOKEN: + return EINVAL; + case ERROR_OPEN_FAILED: + return EIO; + case ERROR_OPEN_FILES: + return EAGAIN; + case ERROR_OUTOFMEMORY: + return ENOMEM; + case ERROR_PAGED_SYSTEM_RESOURCES: + return EAGAIN; + case ERROR_PAGEFILE_QUOTA: + return EAGAIN; + case ERROR_PATH_NOT_FOUND: + return ENOENT; + case ERROR_PIPE_BUSY: + return EBUSY; + case ERROR_PIPE_CONNECTED: + return EBUSY; +#ifdef ECOMM + case ERROR_PIPE_LISTENING: + return ECOMM; + case ERROR_PIPE_NOT_CONNECTED: + return ECOMM; +#endif + case ERROR_POSSIBLE_DEADLOCK: + return EDEADLOCK; + case ERROR_PRIVILEGE_NOT_HELD: + return EPERM; + case ERROR_PROCESS_ABORTED: + return EFAULT; + case ERROR_PROC_NOT_FOUND: + return ESRCH; +#ifdef ENONET + case ERROR_REM_NOT_LIST: + return ENONET; +#endif + case ERROR_SECTOR_NOT_FOUND: + return EINVAL; + case ERROR_SEEK: + return EINVAL; + case ERROR_SETMARK_DETECTED: + return EIO; + case ERROR_SHARING_BUFFER_EXCEEDED: + return ENOLCK; + case ERROR_SHARING_VIOLATION: + return EBUSY; + case ERROR_SIGNAL_PENDING: + return EBUSY; + case ERROR_SIGNAL_REFUSED: + return EIO; +#ifdef ELIBBAD + case ERROR_SXS_CANT_GEN_ACTCTX: + return ELIBBAD; +#endif + case ERROR_THREAD_1_INACTIVE: + return EINVAL; + case ERROR_TOO_MANY_LINKS: + return EMLINK; + case ERROR_TOO_MANY_OPEN_FILES: + return EMFILE; + case ERROR_WAIT_NO_CHILDREN: + return ECHILD; + case ERROR_WORKING_SET_QUOTA: + return EAGAIN; + case ERROR_WRITE_PROTECT: + return EROFS; + default: + return -1; + } +} + +static void +set_errno_from_win32_error(DWORD err) +{ + errno = win32_error_to_errno(err); +} + +static void +set_errno_from_GetLastError(void) +{ + set_errno_from_win32_error(GetLastError()); +} + +/* Replacement for POSIX fsync() */ +int +fsync(int fd) +{ + HANDLE h; + + h = (HANDLE)_get_osfhandle(fd); + if (h == INVALID_HANDLE_VALUE) + goto err; + if (!FlushFileBuffers(h)) + goto err_set_errno; + return 0; +err_set_errno: + set_errno_from_GetLastError(); +err: + return -1; +} + +/* Use the Win32 API to get the number of processors. */ +unsigned +get_available_cpus(void) +{ + SYSTEM_INFO sysinfo; + GetSystemInfo(&sysinfo); + return sysinfo.dwNumberOfProcessors; +} + +/* Use the Win32 API to get the amount of available memory. */ +u64 +get_available_memory(void) +{ + MEMORYSTATUSEX status = { + .dwLength = sizeof(status), + }; + GlobalMemoryStatusEx(&status); + return (u64)min(status.ullTotalPhys, status.ullTotalVirtual) * 85 / 100; +} + +/* Replacement for POSIX-2008 realpath(). Warning: partial functionality only + * (resolved_path must be NULL). Also I highly doubt that GetFullPathName + * really does the right thing under all circumstances. */ +wchar_t * +realpath(const wchar_t *path, wchar_t *resolved_path) +{ + DWORD ret; + DWORD err; + wimlib_assert(resolved_path == NULL); + + ret = GetFullPathNameW(path, 0, NULL, NULL); + if (!ret) { + err = GetLastError(); + goto fail_win32; + } + + resolved_path = MALLOC(ret * sizeof(wchar_t)); + if (!resolved_path) + goto out; + ret = GetFullPathNameW(path, ret, resolved_path, NULL); + if (!ret) { + err = GetLastError(); + FREE(resolved_path); + resolved_path = NULL; + goto fail_win32; + } + goto out; +fail_win32: + set_errno_from_win32_error(err); +out: + return resolved_path; +} + +/* A quick hack to get reasonable rename() semantics on Windows, in particular + * deleting the destination file instead of failing with ERROR_FILE_EXISTS and + * working around any processes that may have the destination file open. + * + * Note: This is intended to be called when overwriting a regular file with an + * updated copy and is *not* a fully POSIX compliant rename(). For that you may + * wish to take a look at Cygwin's implementation, but be prepared... + * + * Return 0 on success, -1 on regular error, or 1 if the destination file was + * deleted but the source could not be renamed and therefore should not be + * deleted. + */ +int +win32_rename_replacement(const wchar_t *srcpath, const wchar_t *dstpath) +{ + wchar_t *tmpname; + + /* Normally, MoveFileExW() with the MOVEFILE_REPLACE_EXISTING flag does + * what we want. */ + + if (MoveFileExW(srcpath, dstpath, MOVEFILE_REPLACE_EXISTING)) + return 0; + + /* MoveFileExW() failed. One way this can happen is if any process has + * the destination file open, in which case ERROR_ACCESS_DENIED is + * produced. This can commonly happen if there is a backup or antivirus + * program monitoring or scanning the files. This behavior is very + * different from the behavior of POSIX rename(), which simply unlinks + * the destination file and allows other processes to keep it open! */ + + if (GetLastError() != ERROR_ACCESS_DENIED) + goto err_set_errno; + + /* We can work around the above-mentioned problem by renaming the + * destination file to yet another temporary file, then "deleting" it, + * which on Windows will in fact not actually delete it immediately but + * rather mark it for deletion when the last handle to it is closed. */ + { + static const wchar_t orig_suffix[5] = L".orig"; + const size_t num_rand_chars = 9; + wchar_t *p; + + size_t dstlen = wcslen(dstpath); + + tmpname = alloca(sizeof(wchar_t) * + (dstlen + ARRAY_LEN(orig_suffix) + num_rand_chars + 1)); + p = tmpname; + p = wmempcpy(p, dstpath, dstlen); + p = wmempcpy(p, orig_suffix, ARRAY_LEN(orig_suffix)); + get_random_alnum_chars(p, num_rand_chars); + p += num_rand_chars; + *p = L'\0'; + } + + if (!MoveFile(dstpath, tmpname)) + goto err_set_errno; + + if (!DeleteFile(tmpname)) { + set_errno_from_GetLastError(); + WARNING_WITH_ERRNO("Failed to delete original file " + "(moved to \"%ls\")", tmpname); + } + + if (!MoveFile(srcpath, dstpath)) { + set_errno_from_GetLastError(); + WARNING_WITH_ERRNO("Atomic semantics not respected in " + "failed rename() (new file is at \"%ls\")", + srcpath); + return 1; + } + + return 0; + +err_set_errno: + set_errno_from_GetLastError(); + return -1; +} + +#define MAX_IO_AMOUNT 1048576 + +static int +do_pread_or_pwrite(int fd, void *buf, size_t count, off_t offset, + bool is_pwrite) +{ + HANDLE h; + LARGE_INTEGER orig_offset; + DWORD result = 0xFFFFFFFF; + LARGE_INTEGER relative_offset; + OVERLAPPED overlapped; + BOOL bret; + DWORD err = 0; + + h = (HANDLE)_get_osfhandle(fd); + if (h == INVALID_HANDLE_VALUE) + goto error; + + if (GetFileType(h) == FILE_TYPE_PIPE) { + errno = ESPIPE; + goto error; + } + + /* Get original position */ + relative_offset.QuadPart = 0; + if (!SetFilePointerEx(h, relative_offset, &orig_offset, FILE_CURRENT)) { + err = GetLastError(); + win32_error(err, L"Failed to get original file position"); + goto error; + } + + memset(&overlapped, 0, sizeof(overlapped)); + overlapped.Offset = offset; + overlapped.OffsetHigh = offset >> 32; + + /* Do the read or write at the specified offset */ + count = min(count, MAX_IO_AMOUNT); + SetLastError(0); + if (is_pwrite) + bret = WriteFile(h, buf, count, &result, &overlapped); + else + bret = ReadFile(h, buf, count, &result, &overlapped); + if (!bret) { + err = GetLastError(); + win32_error(err, L"Failed to %s %zu bytes at offset %"PRIu64, + (is_pwrite ? "write" : "read"), count, offset); + goto error; + } + + wimlib_assert(result <= count); + + /* Restore the original position */ + if (!SetFilePointerEx(h, orig_offset, NULL, FILE_BEGIN)) { + err = GetLastError(); + win32_error(err, L"Failed to restore file position to %"PRIu64, + offset); + goto error; + } + + return result; + +error: + if (err) + set_errno_from_win32_error(err); + return -1; +} + +/* Dumb Windows implementation of pread(). It temporarily changes the file + * offset, so it is not safe to use with readers/writers on the same file + * descriptor. */ +ssize_t +win32_pread(int fd, void *buf, size_t count, off_t offset) +{ + return do_pread_or_pwrite(fd, buf, count, offset, false); +} + +/* Dumb Windows implementation of pwrite(). It temporarily changes the file + * offset, so it is not safe to use with readers/writers on the same file + * descriptor. */ +ssize_t +win32_pwrite(int fd, const void *buf, size_t count, off_t offset) +{ + return do_pread_or_pwrite(fd, (void*)buf, count, offset, true); +} + +/* Replacement for read() which doesn't hide the Win32 error code */ +ssize_t +win32_read(int fd, void *buf, size_t count) +{ + HANDLE h = (HANDLE)_get_osfhandle(fd); + DWORD result = 0xFFFFFFFF; + + if (h == INVALID_HANDLE_VALUE) + return -1; + + count = min(count, MAX_IO_AMOUNT); + SetLastError(0); + if (!ReadFile(h, buf, count, &result, NULL)) { + DWORD err = GetLastError(); + win32_error(err, + L"Error reading %zu bytes from fd %d", count, fd); + set_errno_from_win32_error(err); + return -1; + } + + wimlib_assert(result <= count); + return result; +} + +/* Replacement for write() which doesn't hide the Win32 error code */ +ssize_t +win32_write(int fd, const void *buf, size_t count) +{ + HANDLE h = (HANDLE)_get_osfhandle(fd); + DWORD result = 0xFFFFFFFF; + + if (h == INVALID_HANDLE_VALUE) + return -1; + + count = min(count, MAX_IO_AMOUNT); + SetLastError(0); + if (!WriteFile(h, buf, count, &result, NULL)) { + DWORD err = GetLastError(); + win32_error(err, + L"Error writing %zu bytes to fd %d", count, fd); + set_errno_from_win32_error(err); + return -1; + } + + wimlib_assert(result <= count); + return result; +} + +/* Replacement for glob() in Windows native builds that operates on wide + * characters. */ +int +win32_wglob(const wchar_t *pattern, int flags, + int (*errfunc)(const wchar_t *epath, int eerrno), + glob_t *pglob) +{ + WIN32_FIND_DATAW dat; + DWORD err; + HANDLE hFind; + int ret; + size_t nspaces; + int errno_save; + + const wchar_t *backslash, *end_slash; + size_t prefix_len; + + backslash = wcsrchr(pattern, L'\\'); + end_slash = wcsrchr(pattern, L'/'); + + if (backslash > end_slash) + end_slash = backslash; + + if (end_slash) + prefix_len = end_slash - pattern + 1; + else + prefix_len = 0; + + /* This function does not support all functionality of the POSIX glob(), + * so make sure the parameters are consistent with supported + * functionality. */ + wimlib_assert(errfunc == NULL); + wimlib_assert((flags & GLOB_ERR) == GLOB_ERR); + wimlib_assert((flags & ~(GLOB_NOSORT | GLOB_ERR)) == 0); + + hFind = FindFirstFileW(pattern, &dat); + if (hFind == INVALID_HANDLE_VALUE) { + err = GetLastError(); + if (err == ERROR_FILE_NOT_FOUND) { + errno = 0; + return GLOB_NOMATCH; + } else { + set_errno_from_win32_error(err); + return GLOB_ABORTED; + } + } + pglob->gl_pathc = 0; + pglob->gl_pathv = NULL; + nspaces = 0; + do { + wchar_t *path; + if (pglob->gl_pathc == nspaces) { + size_t new_nspaces; + wchar_t **pathv; + + new_nspaces = nspaces * 2 + 1; + pathv = REALLOC(pglob->gl_pathv, + new_nspaces * sizeof(pglob->gl_pathv[0])); + if (!pathv) + goto oom; + pglob->gl_pathv = pathv; + nspaces = new_nspaces; + } + size_t filename_len = wcslen(dat.cFileName); + size_t len_needed = prefix_len + filename_len; + + path = MALLOC((len_needed + 1) * sizeof(wchar_t)); + if (!path) + goto oom; + + wmemcpy(path, pattern, prefix_len); + wmemcpy(path + prefix_len, dat.cFileName, filename_len + 1); + pglob->gl_pathv[pglob->gl_pathc++] = path; + } while (FindNextFileW(hFind, &dat)); + err = GetLastError(); + FindClose(hFind); + if (err != ERROR_NO_MORE_FILES) { + set_errno_from_win32_error(err); + ret = GLOB_ABORTED; + goto fail_globfree; + } + return 0; + +oom: + FindClose(hFind); + errno = ENOMEM; + ret = GLOB_NOSPACE; +fail_globfree: + errno_save = errno; + globfree(pglob); + errno = errno_save; + return ret; +} + +void +globfree(glob_t *pglob) +{ + size_t i; + for (i = 0; i < pglob->gl_pathc; i++) + FREE(pglob->gl_pathv[i]); + FREE(pglob->gl_pathv); +} + +/* Replacement for fopen(path, "a") that doesn't prevent other processes from + * reading the file */ +FILE * +win32_open_logfile(const wchar_t *path) +{ + HANDLE h; + int fd; + FILE *fp; + + h = CreateFile(path, FILE_APPEND_DATA, FILE_SHARE_VALID_FLAGS, + NULL, OPEN_ALWAYS, 0, NULL); + if (h == INVALID_HANDLE_VALUE) + return NULL; + + fd = _open_osfhandle((intptr_t)h, O_APPEND); + if (fd < 0) { + CloseHandle(h); + return NULL; + } + + fp = fdopen(fd, "a"); + if (!fp) { + close(fd); + return NULL; + } + + return fp; +} + +#define RtlGenRandom SystemFunction036 +BOOLEAN WINAPI RtlGenRandom(PVOID RandomBuffer, ULONG RandomBufferLength); + +/* + * Generate @n cryptographically secure random bytes (thread-safe) + * + * This is the Windows version. It uses RtlGenRandom() (actually called + * SystemFunction036) from advapi32.dll. + */ +void +get_random_bytes(void *p, size_t n) +{ + while (n != 0) { + u32 count = min(n, UINT32_MAX); + + if (!RtlGenRandom(p, count)) { + win32_error(GetLastError(), + L"RtlGenRandom() failed (count=%u)", count); + wimlib_assert(0); + count = 0; + } + p += count; + n -= count; + } +} + +/* Retrieve the current time as a WIM timestamp. */ +u64 +now_as_wim_timestamp(void) +{ + FILETIME ft; + + GetSystemTimeAsFileTime(&ft); + + return ((u64)ft.dwHighDateTime << 32) | ft.dwLowDateTime; +} + +#endif /* _WIN32 */ diff --git a/src/wimlib/win32_vss.c b/src/wimlib/win32_vss.c new file mode 100644 index 00000000..6f5a28ea --- /dev/null +++ b/src/wimlib/win32_vss.c @@ -0,0 +1,528 @@ +/* + * win32_vss.c - Windows-specific code for creating VSS (Volume Shadow Copy + * Service) snapshots. + */ + +/* + * Copyright (C) 2015-2023 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef _WIN32 + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/win32_common.h" + +#include <cguid.h> + +#include "wimlib/error.h" +#include "wimlib/threads.h" +#include "wimlib/util.h" +#include "wimlib/win32_vss.h" + +/*----------------------------------------------------------------------------* + * VSS API declarations * + *----------------------------------------------------------------------------*/ + +typedef GUID VSS_ID; +typedef LONGLONG VSS_TIMESTAMP; +typedef WCHAR *VSS_PWSZ; + +typedef enum { + VSS_BT_UNDEFINED = 0, + VSS_BT_FULL = 1, + VSS_BT_INCREMENTAL = 2, + VSS_BT_DIFFERENTIAL = 3, + VSS_BT_LOG = 4, + VSS_BT_COPY = 5, + VSS_BT_OTHER = 6, +} VSS_BACKUP_TYPE; + +typedef enum { + VSS_SS_UNKNOWN = 0x00, + VSS_SS_PREPARING = 0x01, + VSS_SS_PROCESSING_PREPARE = 0x02, + VSS_SS_PREPARED = 0x03, + VSS_SS_PROCESSING_PRECOMMIT = 0x04, + VSS_SS_PRECOMMITTED = 0x05, + VSS_SS_PROCESSING_COMMIT = 0x06, + VSS_SS_COMMITTED = 0x07, + VSS_SS_PROCESSING_POSTCOMMIT = 0x08, + VSS_SS_PROCESSING_PREFINALCOMMIT = 0x09, + VSS_SS_PREFINALCOMMITTED = 0x0a, + VSS_SS_PROCESSING_POSTFINALCOMMIT = 0x0b, + VSS_SS_CREATED = 0x0c, + VSS_SS_ABORTED = 0x0d, + VSS_SS_DELETED = 0x0e, + VSS_SS_POSTCOMMITTED = 0x0f, + VSS_SS_COUNT = 0x10, +} VSS_SNAPSHOT_STATE; + +typedef enum { + VSS_VOLSNAP_ATTR_PERSISTENT = 0x00000001, + VSS_VOLSNAP_ATTR_NO_AUTORECOVERY = 0x00000002, + VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE = 0x00000004, + VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE = 0x00000008, + VSS_VOLSNAP_ATTR_NO_WRITERS = 0x00000010, + VSS_VOLSNAP_ATTR_TRANSPORTABLE = 0x00000020, + VSS_VOLSNAP_ATTR_NOT_SURFACED = 0x00000040, + VSS_VOLSNAP_ATTR_NOT_TRANSACTED = 0x00000080, + VSS_VOLSNAP_ATTR_HARDWARE_ASSISTED = 0x00010000, + VSS_VOLSNAP_ATTR_DIFFERENTIAL = 0x00020000, + VSS_VOLSNAP_ATTR_PLEX = 0x00040000, + VSS_VOLSNAP_ATTR_IMPORTED = 0x00080000, + VSS_VOLSNAP_ATTR_EXPOSED_LOCALLY = 0x00100000, + VSS_VOLSNAP_ATTR_EXPOSED_REMOTELY = 0x00200000, + VSS_VOLSNAP_ATTR_AUTORECOVER = 0x00400000, + VSS_VOLSNAP_ATTR_ROLLBACK_RECOVERY = 0x00800000, + VSS_VOLSNAP_ATTR_DELAYED_POSTSNAPSHOT = 0x01000000, + VSS_VOLSNAP_ATTR_TXF_RECOVERY = 0x02000000, +} VSS_VOLUME_SNAPSHOT_ATTRIBUTES; + +typedef enum { + VSS_CTX_BACKUP = 0, + VSS_CTX_FILE_SHARE_BACKUP = VSS_VOLSNAP_ATTR_NO_WRITERS, + VSS_CTX_NAS_ROLLBACK = ( ( VSS_VOLSNAP_ATTR_PERSISTENT | VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE ) | VSS_VOLSNAP_ATTR_NO_WRITERS ), + VSS_CTX_APP_ROLLBACK = ( VSS_VOLSNAP_ATTR_PERSISTENT | VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE ), + VSS_CTX_CLIENT_ACCESSIBLE = ( ( ( VSS_VOLSNAP_ATTR_PERSISTENT | VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE ) | VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE ) | VSS_VOLSNAP_ATTR_NO_WRITERS ), + VSS_CTX_CLIENT_ACCESSIBLE_WRITERS = ( ( VSS_VOLSNAP_ATTR_PERSISTENT | VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE ) | VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE ), + VSS_CTX_ALL = 0xffffffff, +} VSS_SNAPSHOT_CONTEXT; + +typedef struct { + VSS_ID m_SnapshotId; + VSS_ID m_SnapshotSetId; + LONG m_lSnapshotsCount; + VSS_PWSZ m_pwszSnapshotDeviceObject; + VSS_PWSZ m_pwszOriginalVolumeName; + VSS_PWSZ m_pwszOriginatingMachine; + VSS_PWSZ m_pwszServiceMachine; + VSS_PWSZ m_pwszExposedName; + VSS_PWSZ m_pwszExposedPath; + VSS_ID m_ProviderId; + LONG m_lSnapshotAttributes; + VSS_TIMESTAMP m_tsCreationTimestamp; + VSS_SNAPSHOT_STATE m_eStatus; +} VSS_SNAPSHOT_PROP; + +typedef struct IVssAsyncVTable IVssAsyncVTable; + +typedef struct { + IVssAsyncVTable *vtable; +} IVssAsync; + +struct IVssAsyncVTable { + void *QueryInterface; + void *AddRef; + ULONG (WINAPI *Release)(IVssAsync *this); + void *Cancel; + HRESULT (WINAPI *Wait)(IVssAsync *this, DWORD dwMilliseconds); + void *QueryStatus; +}; + +typedef struct IVssBackupComponentsVTable IVssBackupComponentsVTable; + +typedef struct { + IVssBackupComponentsVTable *vtable; +} IVssBackupComponents; + +struct IVssBackupComponentsVTable { + void *QueryInterface; + void *AddRef; + ULONG (WINAPI *Release)(IVssBackupComponents *this); + void *GetWriterComponentsCount; + void *GetWriterComponents; + HRESULT (WINAPI *InitializeForBackup)(IVssBackupComponents *this, + BSTR bstrXML); + HRESULT (WINAPI *SetBackupState)(IVssBackupComponents *this, + BOOLEAN bSelectComponents, + BOOLEAN bBackupBootableSystemState, + VSS_BACKUP_TYPE backupType, + BOOLEAN bPartialFileSupport); + void *InitializeForRestore; + void *SetRestoreState; + HRESULT (WINAPI *GatherWriterMetadata)(IVssBackupComponents *this, + IVssAsync **ppAsync); + void *GetWriterMetadataCount; + void *GetWriterMetadata; + void *FreeWriterMetadata; + void *AddComponent; + HRESULT (WINAPI *PrepareForBackup)(IVssBackupComponents *this, + IVssAsync **ppAsync); + void *AbortBackup; + void *GatherWriterStatus; + void *GetWriterStatusCount; + void *FreeWriterStatus; + void *GetWriterStatus; + void *SetBackupSucceeded; + void *SetBackupOptions; + void *SetSelectedForRestore; + void *SetRestoreOptions; + void *SetAdditionalRestores; + void *SetPreviousBackupStamp; + void *SaveAsXML; + void *BackupComplete; + void *AddAlternativeLocationMapping; + void *AddRestoreSubcomponent; + void *SetFileRestoreStatus; + void *AddNewTarget; + void *SetRangesFilePath; + void *PreRestore; + void *PostRestore; + HRESULT (WINAPI *SetContext)(IVssBackupComponents *this, + LONG lContext); + HRESULT (WINAPI *StartSnapshotSet)(IVssBackupComponents *this, + VSS_ID *pSnapshotSetId); + HRESULT (WINAPI *AddToSnapshotSet)(IVssBackupComponents *this, + VSS_PWSZ pwszVolumeName, + VSS_ID ProviderId, + VSS_ID *pidSnapshot); + HRESULT (WINAPI *DoSnapshotSet)(IVssBackupComponents *this, + IVssAsync **ppAsync); + void *DeleteSnapshots; + void *ImportSnapshots; + void *BreakSnapshotSet; + HRESULT (WINAPI *GetSnapshotProperties)(IVssBackupComponents *this, + VSS_ID SnapshotId, + VSS_SNAPSHOT_PROP *pprop); + void *Query; + void *IsVolumeSupported; + void *DisableWriterClasses; + void *EnableWriterClasses; + void *DisableWriterInstances; + void *ExposeSnapshot; + void *RevertToSnapshot; + void *QueryRevertStatus; +}; + +/*----------------------------------------------------------------------------* + * VSS API initialization * + *----------------------------------------------------------------------------*/ + +static bool vss_initialized; +static struct mutex vss_initialization_mutex = MUTEX_INITIALIZER; + +/* vssapi.dll */ +static HANDLE hVssapi; +static HRESULT (WINAPI *func_CreateVssBackupComponentsInternal)(IVssBackupComponents **ppBackup); +static void (WINAPI *func_VssFreeSnapshotPropertiesInternal)(VSS_SNAPSHOT_PROP *pProp); + +/* ole32.dll */ +static HANDLE hOle32; +static void (WINAPI *func_CoInitialize)(LPVOID *pvReserved); +static void (WINAPI *func_CoUninitialize)(void); + +static bool +vss_global_init_impl(void) +{ + hVssapi = LoadLibrary(L"vssapi.dll"); + if (!hVssapi) { + ERROR("vssapi.dll not found"); + goto err; + } + + func_CreateVssBackupComponentsInternal = + (void *)GetProcAddress(hVssapi, "CreateVssBackupComponentsInternal"); + if (!func_CreateVssBackupComponentsInternal) { + ERROR("CreateVssBackupComponentsInternal() not found in vssapi.dll"); + goto err_vssapi; + } + + func_VssFreeSnapshotPropertiesInternal = + (void *)GetProcAddress(hVssapi, "VssFreeSnapshotPropertiesInternal"); + if (!func_VssFreeSnapshotPropertiesInternal) { + ERROR("VssFreeSnapshotPropertiesInternal() not found in vssapi.dll"); + goto err_vssapi; + } + + hOle32 = LoadLibrary(L"ole32.dll"); + if (!hOle32) { + ERROR("ole32.dll not found"); + goto err_vssapi; + } + + func_CoInitialize = (void *)GetProcAddress(hOle32, "CoInitialize"); + if (!func_CoInitialize) { + ERROR("CoInitialize() not found in ole32.dll"); + goto err_ole32; + } + + func_CoUninitialize = (void *)GetProcAddress(hOle32, "CoUninitialize"); + if (!func_CoUninitialize) { + ERROR("CoUninitialize() not found in ole32.dll"); + goto err_ole32; + } + + (*func_CoInitialize)(NULL); + return true; + +err_ole32: + FreeLibrary(hOle32); +err_vssapi: + FreeLibrary(hVssapi); +err: + return false; +} + +static bool +vss_global_init(void) +{ + if (vss_initialized) + return true; + + mutex_lock(&vss_initialization_mutex); + if (!vss_initialized) + vss_initialized = vss_global_init_impl(); + mutex_unlock(&vss_initialization_mutex); + + if (vss_initialized) + return true; + ERROR("The Volume Shadow Copy Service (VSS) API could not be " + "initialized."); + return false; +} + +void +vss_global_cleanup(void) +{ + if (!vss_initialized) + return; + + mutex_lock(&vss_initialization_mutex); + if (vss_initialized) { + (*func_CoUninitialize)(); + FreeLibrary(hOle32); + FreeLibrary(hVssapi); + vss_initialized = false; + } + mutex_unlock(&vss_initialization_mutex); +} + +/*----------------------------------------------------------------------------* + * VSS implementation * + *----------------------------------------------------------------------------*/ + +struct vss_snapshot_internal { + struct vss_snapshot base; + IVssBackupComponents *vss; + VSS_SNAPSHOT_PROP props; +}; + +/* Delete the specified VSS snapshot. */ +void +vss_delete_snapshot(struct vss_snapshot *snapshot) +{ + struct vss_snapshot_internal *internal; + + internal = container_of(snapshot, struct vss_snapshot_internal, base); + + if (internal->props.m_pwszSnapshotDeviceObject) + (*func_VssFreeSnapshotPropertiesInternal)(&internal->props); + if (internal->vss) + internal->vss->vtable->Release(internal->vss); + FREE(internal); +} + +static HRESULT +wait_and_release(IVssAsync *async) +{ + HRESULT res = async->vtable->Wait(async, INFINITE); + + async->vtable->Release(async); + return res; +} + +static bool +request_vss_snapshot(IVssBackupComponents *vss, wchar_t *volume, + VSS_ID *snapshot_id) +{ + HRESULT res; + IVssAsync *async; + + res = vss->vtable->InitializeForBackup(vss, NULL); + if (FAILED(res)) { + ERROR("IVssBackupComponents.InitializeForBackup() error: %x", + (u32)res); + return false; + } + + res = vss->vtable->SetBackupState(vss, FALSE, TRUE, VSS_BT_COPY, FALSE); + if (FAILED(res)) { + ERROR("IVssBackupComponents.SetBackupState() error: %x", + (u32)res); + return false; + } + + res = vss->vtable->StartSnapshotSet(vss, snapshot_id); + if (FAILED(res)) { + ERROR("IVssBackupComponents.StartSnapshotSet() error: %x", + (u32)res); + return false; + } + + res = vss->vtable->AddToSnapshotSet(vss, volume, (GUID){}, snapshot_id); + if (FAILED(res)) { + ERROR("IVssBackupComponents.AddToSnapshotSet() error: %x", + (u32)res); + return false; + } + + res = vss->vtable->PrepareForBackup(vss, &async); + if (FAILED(res)) { + ERROR("IVssBackupComponents.PrepareForBackup() error: %x", + (u32)res); + return false; + } + res = wait_and_release(async); + if (FAILED(res)) { + ERROR("IVssAsync.Wait() error while preparing for backup: %x", + (u32)res); + return false; + } + + res = vss->vtable->DoSnapshotSet(vss, &async); + if (FAILED(res)) { + ERROR("IVssBackupComponents.DoSnapshotSet() error: %x", + (u32)res); + return false; + } + res = wait_and_release(async); + if (FAILED(res)) { + ERROR("IVssAsync.Wait() error while doing snapshot set: %x", + (u32)res); + return false; + } + + return true; +} + +static bool +is_wow64(void) +{ + BOOL wow64 = FALSE; + if (sizeof(size_t) == 4) + IsWow64Process(GetCurrentProcess(), &wow64); + return wow64; +} + +/* + * Create a VSS snapshot of the specified @volume. Return the NT namespace path + * to the snapshot root directory in @vss_path_ret and a handle to the snapshot + * in @snapshot_ret. + */ +int +vss_create_snapshot(const wchar_t *source, UNICODE_STRING *vss_path_ret, + struct vss_snapshot **snapshot_ret) +{ + wchar_t *source_abspath; + wchar_t volume[4]; + VSS_ID snapshot_id; + struct vss_snapshot_internal *snapshot = NULL; + IVssBackupComponents *vss; + HRESULT res; + int ret; + + source_abspath = realpath(source, NULL); + if (!source_abspath) { + ret = WIMLIB_ERR_NOMEM; + goto err; + } + + if (source_abspath[0] == L'\0' || source_abspath[1] != L':' || + source_abspath[2] != L'\\') { + ERROR("\"%ls\" (full path \"%ls\"): Path format not recognized", + source, source_abspath); + ret = WIMLIB_ERR_UNSUPPORTED; + goto err; + } + + wsprintf(volume, L"%lc:\\", source_abspath[0]); + + snapshot = CALLOC(1, sizeof(*snapshot)); + if (!snapshot) { + ret = WIMLIB_ERR_NOMEM; + goto err; + } + + if (!vss_global_init()) + goto vss_err; + + res = (*func_CreateVssBackupComponentsInternal)(&vss); + if (FAILED(res)) { + ERROR("CreateVssBackupComponents error: %x", (u32)res); + goto vss_err; + } + + snapshot->vss = vss; + + if (!request_vss_snapshot(vss, volume, &snapshot_id)) + goto vss_err; + + res = vss->vtable->GetSnapshotProperties(vss, snapshot_id, &snapshot->props); + if (FAILED(res)) { + ERROR("IVssBackupComponents.GetSnapshotProperties() error: %x", + (u32)res); + goto vss_err; + } + + if (wcsncmp(snapshot->props.m_pwszSnapshotDeviceObject, L"\\\\?\\", 4)) { + ERROR("Unexpected volume shadow device path: %ls", + snapshot->props.m_pwszSnapshotDeviceObject); + goto vss_err; + } + + vss_path_ret->MaximumLength = sizeof(wchar_t) * + (wcslen(snapshot->props.m_pwszSnapshotDeviceObject) + + 1 + wcslen(&source_abspath[3]) + 1); + vss_path_ret->Length = vss_path_ret->MaximumLength - sizeof(wchar_t); + vss_path_ret->Buffer = HeapAlloc(GetProcessHeap(), 0, + vss_path_ret->MaximumLength); + if (!vss_path_ret->Buffer) { + ret = WIMLIB_ERR_NOMEM; + goto err; + } + + wsprintf(vss_path_ret->Buffer, L"\\??\\%ls\\%ls", + &snapshot->props.m_pwszSnapshotDeviceObject[4], + &source_abspath[3]); + *snapshot_ret = &snapshot->base; + snapshot->base.refcnt = 1; + ret = 0; + goto out; + +vss_err: + ret = WIMLIB_ERR_SNAPSHOT_FAILURE; + if (is_wow64()) { + ERROR("64-bit Windows doesn't allow 32-bit applications to " + "create VSS snapshots.\n" + " Run the 64-bit version of this application " + "instead."); + } else { + ERROR("A problem occurred while creating a VSS snapshot of " + "\"%ls\".\n" + " Aborting the operation.", volume); + } +err: + if (snapshot) + vss_delete_snapshot(&snapshot->base); +out: + FREE(source_abspath); + return ret; +} + +#endif /* _WIN32 */ diff --git a/src/wimlib/write.c b/src/wimlib/write.c new file mode 100644 index 00000000..4bf1b2be --- /dev/null +++ b/src/wimlib/write.c @@ -0,0 +1,3367 @@ +/* + * write.c + * + * Support for writing WIM files; write a WIM file, overwrite a WIM file, write + * compressed file resources, etc. + */ + +/* + * Copyright (C) 2012-2016 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#if defined(HAVE_SYS_FILE_H) && defined(HAVE_FLOCK) +/* On BSD, this should be included before "wimlib/list.h" so that "wimlib/list.h" can + * override the LIST_HEAD macro. */ +# include <sys/file.h> +#endif + +#include <errno.h> +#include <fcntl.h> +#include <stdlib.h> +#include <unistd.h> + +#include "wimlib/alloca.h" +#include "wimlib/assert.h" +#include "wimlib/blob_table.h" +#include "wimlib/chunk_compressor.h" +#include "wimlib/endianness.h" +#include "wimlib/error.h" +#include "wimlib/file_io.h" +#include "wimlib/header.h" +#include "wimlib/inode.h" +#include "wimlib/integrity.h" +#include "wimlib/metadata.h" +#include "wimlib/paths.h" +#include "wimlib/progress.h" +#include "wimlib/resource.h" +#include "wimlib/solid.h" +#include "wimlib/win32.h" /* win32_rename_replacement() */ +#include "wimlib/write.h" +#include "wimlib/xml.h" + + +/* wimlib internal flags used when writing resources. */ +#define WRITE_RESOURCE_FLAG_RECOMPRESS 0x00000001 +#define WRITE_RESOURCE_FLAG_PIPABLE 0x00000002 +#define WRITE_RESOURCE_FLAG_SOLID 0x00000004 +#define WRITE_RESOURCE_FLAG_SEND_DONE_WITH_FILE 0x00000008 +#define WRITE_RESOURCE_FLAG_SOLID_SORT 0x00000010 + +static int +write_flags_to_resource_flags(int write_flags) +{ + int write_resource_flags = 0; + + if (write_flags & WIMLIB_WRITE_FLAG_RECOMPRESS) + write_resource_flags |= WRITE_RESOURCE_FLAG_RECOMPRESS; + + if (write_flags & WIMLIB_WRITE_FLAG_PIPABLE) + write_resource_flags |= WRITE_RESOURCE_FLAG_PIPABLE; + + if (write_flags & WIMLIB_WRITE_FLAG_SOLID) + write_resource_flags |= WRITE_RESOURCE_FLAG_SOLID; + + if (write_flags & WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES) + write_resource_flags |= WRITE_RESOURCE_FLAG_SEND_DONE_WITH_FILE; + + if ((write_flags & (WIMLIB_WRITE_FLAG_SOLID | + WIMLIB_WRITE_FLAG_NO_SOLID_SORT)) == + WIMLIB_WRITE_FLAG_SOLID) + write_resource_flags |= WRITE_RESOURCE_FLAG_SOLID_SORT; + + return write_resource_flags; +} + +struct filter_context { + int write_flags; + WIMStruct *wim; +}; + +/* + * Determine whether the specified blob should be filtered out from the write. + * + * Return values: + * + * < 0 : The blob should be hard-filtered; that is, not included in the output + * WIM file at all. + * 0 : The blob should not be filtered out. + * > 0 : The blob should be soft-filtered; that is, it already exists in the + * WIM file and may not need to be written again. + */ +static int +blob_filtered(const struct blob_descriptor *blob, + const struct filter_context *ctx) +{ + int write_flags; + WIMStruct *wim; + + if (ctx == NULL) + return 0; + + write_flags = ctx->write_flags; + wim = ctx->wim; + + if (write_flags & WIMLIB_WRITE_FLAG_APPEND && + blob->blob_location == BLOB_IN_WIM && + blob->rdesc->wim == wim) + return 1; + + if (write_flags & WIMLIB_WRITE_FLAG_SKIP_EXTERNAL_WIMS && + blob->blob_location == BLOB_IN_WIM && + blob->rdesc->wim != wim) + return -1; + + return 0; +} + +static bool +blob_hard_filtered(const struct blob_descriptor *blob, + struct filter_context *ctx) +{ + return blob_filtered(blob, ctx) < 0; +} + +static inline bool +may_soft_filter_blobs(const struct filter_context *ctx) +{ + return ctx && (ctx->write_flags & WIMLIB_WRITE_FLAG_APPEND); +} + +static inline bool +may_hard_filter_blobs(const struct filter_context *ctx) +{ + return ctx && (ctx->write_flags & WIMLIB_WRITE_FLAG_SKIP_EXTERNAL_WIMS); +} + +static inline bool +may_filter_blobs(const struct filter_context *ctx) +{ + return (may_soft_filter_blobs(ctx) || may_hard_filter_blobs(ctx)); +} + +/* Return true if the specified blob is located in a WIM resource which can be + * reused in the output WIM file, without being recompressed. */ +static bool +can_raw_copy(const struct blob_descriptor *blob, int write_resource_flags, + int out_ctype, u32 out_chunk_size) +{ + const struct wim_resource_descriptor *rdesc; + + /* Recompress everything if requested. */ + if (write_resource_flags & WRITE_RESOURCE_FLAG_RECOMPRESS) + return false; + + /* A blob not located in a WIM resource cannot be reused. */ + if (blob->blob_location != BLOB_IN_WIM) + return false; + + rdesc = blob->rdesc; + + /* In the case of an in-place compaction, always reuse resources located + * in the WIM being compacted. */ + if (rdesc->wim->being_compacted) + return true; + + /* Otherwise, only reuse compressed resources. */ + if (out_ctype == WIMLIB_COMPRESSION_TYPE_NONE || + !(rdesc->flags & (WIM_RESHDR_FLAG_COMPRESSED | + WIM_RESHDR_FLAG_SOLID))) + return false; + + /* When writing a pipable WIM, we can only reuse pipable resources; and + * when writing a non-pipable WIM, we can only reuse non-pipable + * resources. */ + if (rdesc->is_pipable != + !!(write_resource_flags & WRITE_RESOURCE_FLAG_PIPABLE)) + return false; + + /* When writing a solid WIM, we can only reuse solid resources; and when + * writing a non-solid WIM, we can only reuse non-solid resources. */ + if (!!(rdesc->flags & WIM_RESHDR_FLAG_SOLID) != + !!(write_resource_flags & WRITE_RESOURCE_FLAG_SOLID)) + return false; + + /* Note: it is theoretically possible to copy chunks of compressed data + * between non-solid, solid, and pipable resources. However, we don't + * currently implement this optimization because it would be complex and + * would usually go unused. */ + + if (rdesc->flags & WIM_RESHDR_FLAG_COMPRESSED) { + /* To re-use a non-solid resource, it must use the desired + * compression type and chunk size. */ + return (rdesc->compression_type == out_ctype && + rdesc->chunk_size == out_chunk_size); + } else { + /* Solid resource: Such resources may contain multiple blobs, + * and in general only a subset of them need to be written. As + * a heuristic, re-use the raw data if more than two-thirds the + * uncompressed size is being written. */ + + /* Note: solid resources contain a header that specifies the + * compression type and chunk size; therefore we don't need to + * check if they are compatible with @out_ctype and + * @out_chunk_size. */ + + /* Did we already decide to reuse the resource? */ + if (rdesc->raw_copy_ok) + return true; + + struct blob_descriptor *res_blob; + u64 write_size = 0; + + list_for_each_entry(res_blob, &rdesc->blob_list, rdesc_node) + if (res_blob->will_be_in_output_wim) + write_size += res_blob->size; + + return (write_size > rdesc->uncompressed_size * 2 / 3); + } +} + +static u32 +reshdr_flags_for_blob(const struct blob_descriptor *blob) +{ + u32 reshdr_flags = 0; + if (blob->is_metadata) + reshdr_flags |= WIM_RESHDR_FLAG_METADATA; + return reshdr_flags; +} + +static void +blob_set_out_reshdr_for_reuse(struct blob_descriptor *blob) +{ + const struct wim_resource_descriptor *rdesc; + + wimlib_assert(blob->blob_location == BLOB_IN_WIM); + rdesc = blob->rdesc; + + if (rdesc->flags & WIM_RESHDR_FLAG_SOLID) { + blob->out_reshdr.offset_in_wim = blob->offset_in_res; + blob->out_reshdr.uncompressed_size = 0; + blob->out_reshdr.size_in_wim = blob->size; + + blob->out_res_offset_in_wim = rdesc->offset_in_wim; + blob->out_res_size_in_wim = rdesc->size_in_wim; + blob->out_res_uncompressed_size = rdesc->uncompressed_size; + } else { + blob->out_reshdr.offset_in_wim = rdesc->offset_in_wim; + blob->out_reshdr.uncompressed_size = rdesc->uncompressed_size; + blob->out_reshdr.size_in_wim = rdesc->size_in_wim; + } + blob->out_reshdr.flags = rdesc->flags; +} + + +/* Write the header for a blob in a pipable WIM. */ +static int +write_pwm_blob_header(const struct blob_descriptor *blob, + struct filedes *out_fd, bool compressed) +{ + struct pwm_blob_hdr blob_hdr; + u32 reshdr_flags; + int ret; + + wimlib_assert(!blob->unhashed); + + blob_hdr.magic = cpu_to_le64(PWM_BLOB_MAGIC); + blob_hdr.uncompressed_size = cpu_to_le64(blob->size); + copy_hash(blob_hdr.hash, blob->hash); + reshdr_flags = reshdr_flags_for_blob(blob); + if (compressed) + reshdr_flags |= WIM_RESHDR_FLAG_COMPRESSED; + blob_hdr.flags = cpu_to_le32(reshdr_flags); + ret = full_write(out_fd, &blob_hdr, sizeof(blob_hdr)); + if (ret) + ERROR_WITH_ERRNO("Error writing blob header to WIM file"); + return ret; +} + +struct write_blobs_progress_data { + wimlib_progress_func_t progfunc; + void *progctx; + union wimlib_progress_info progress; + u64 next_progress; +}; + +static int +do_write_blobs_progress(struct write_blobs_progress_data *progress_data, + u64 complete_size, u64 complete_compressed_size, + u32 complete_count, bool discarded) +{ + union wimlib_progress_info *progress = &progress_data->progress; + int ret; + + if (discarded) { + progress->write_streams.total_bytes -= complete_size; + progress->write_streams.total_streams -= complete_count; + if (progress_data->next_progress != ~(u64)0 && + progress_data->next_progress > progress->write_streams.total_bytes) + { + progress_data->next_progress = progress->write_streams.total_bytes; + } + } else { + progress->write_streams.completed_bytes += complete_size; + progress->write_streams.completed_compressed_bytes += + complete_compressed_size; + progress->write_streams.completed_streams += complete_count; + } + + if (progress->write_streams.completed_bytes >= progress_data->next_progress) { + + ret = call_progress(progress_data->progfunc, + WIMLIB_PROGRESS_MSG_WRITE_STREAMS, + progress, + progress_data->progctx); + if (ret) + return ret; + + set_next_progress(progress->write_streams.completed_bytes, + progress->write_streams.total_bytes, + &progress_data->next_progress); + } + return 0; +} + +struct write_blobs_ctx { + /* File descriptor to which the blobs are being written. */ + struct filedes *out_fd; + + /* Blob table for the WIMStruct on whose behalf the blobs are being + * written. */ + struct blob_table *blob_table; + + /* Compression format to use. */ + int out_ctype; + + /* Maximum uncompressed chunk size in compressed resources to use. */ + u32 out_chunk_size; + + /* Flags that affect how the blobs will be written. */ + int write_resource_flags; + + /* Data used for issuing WRITE_STREAMS progress. */ + struct write_blobs_progress_data progress_data; + + struct filter_context *filter_ctx; + + /* Pointer to the chunk_compressor implementation being used for + * compressing chunks of data, or NULL if chunks are being written + * uncompressed. */ + struct chunk_compressor *compressor; + + /* A buffer of size @out_chunk_size that has been loaned out from the + * chunk compressor and is currently being filled with the uncompressed + * data of the next chunk. */ + u8 *cur_chunk_buf; + + /* Number of bytes in @cur_chunk_buf that are currently filled. */ + size_t cur_chunk_buf_filled; + + /* List of blobs that currently have chunks being compressed. */ + struct list_head blobs_being_compressed; + + /* List of blobs in the solid resource. Blobs are moved here after + * @blobs_being_compressed only when writing a solid resource. */ + struct list_head blobs_in_solid_resource; + + /* Current uncompressed offset in the blob being written. */ + u64 cur_write_blob_offset; + + /* Uncompressed size of resource currently being written. */ + u64 cur_write_res_size; + + /* Array that is filled in with compressed chunk sizes as a resource is + * being written. */ + u64 *chunk_csizes; + + /* Index of next entry in @chunk_csizes to fill in. */ + size_t chunk_index; + + /* Number of entries in @chunk_csizes currently allocated. */ + size_t num_alloc_chunks; + + /* Offset in the output file of the start of the chunks of the resource + * currently being written. */ + u64 chunks_start_offset; +}; + +/* Reserve space for the chunk table and prepare to accumulate the chunk table + * in memory. */ +static int +begin_chunk_table(struct write_blobs_ctx *ctx, u64 res_expected_size) +{ + u64 expected_num_chunks; + u64 expected_num_chunk_entries; + size_t reserve_size; + int ret; + + /* Calculate the number of chunks and chunk entries that should be + * needed for the resource. These normally will be the final values, + * but in SOLID mode some of the blobs we're planning to write into the + * resource may be duplicates, and therefore discarded, potentially + * decreasing the number of chunk entries needed. */ + expected_num_chunks = DIV_ROUND_UP(res_expected_size, ctx->out_chunk_size); + expected_num_chunk_entries = expected_num_chunks; + if (!(ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID)) + expected_num_chunk_entries--; + + /* Make sure the chunk_csizes array is long enough to store the + * compressed size of each chunk. */ + if (expected_num_chunks > ctx->num_alloc_chunks) { + u64 new_length = expected_num_chunks + 50; + + if ((size_t)new_length != new_length) { + ERROR("Resource size too large (%"PRIu64" bytes!", + res_expected_size); + return WIMLIB_ERR_NOMEM; + } + + FREE(ctx->chunk_csizes); + ctx->chunk_csizes = MALLOC(new_length * sizeof(ctx->chunk_csizes[0])); + if (ctx->chunk_csizes == NULL) { + ctx->num_alloc_chunks = 0; + return WIMLIB_ERR_NOMEM; + } + ctx->num_alloc_chunks = new_length; + } + + ctx->chunk_index = 0; + + if (!(ctx->write_resource_flags & WRITE_RESOURCE_FLAG_PIPABLE)) { + /* Reserve space for the chunk table in the output file. In the + * case of solid resources this reserves the upper bound for the + * needed space, not necessarily the exact space which will + * prove to be needed. At this point, we just use @chunk_csizes + * for a buffer of 0's because the actual compressed chunk sizes + * are unknown. */ + reserve_size = expected_num_chunk_entries * + get_chunk_entry_size(res_expected_size, + 0 != (ctx->write_resource_flags & + WRITE_RESOURCE_FLAG_SOLID)); + if (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) + reserve_size += sizeof(struct alt_chunk_table_header_disk); + memset(ctx->chunk_csizes, 0, reserve_size); + ret = full_write(ctx->out_fd, ctx->chunk_csizes, reserve_size); + if (ret) { + ERROR_WITH_ERRNO("Error reserving space for chunk " + "table in WIM file"); + return ret; + } + } + return 0; +} + +static int +begin_write_resource(struct write_blobs_ctx *ctx, u64 res_expected_size) +{ + int ret; + + wimlib_assert(res_expected_size != 0); + + if (ctx->compressor != NULL) { + ret = begin_chunk_table(ctx, res_expected_size); + if (ret) + return ret; + } + + /* Output file descriptor is now positioned at the offset at which to + * write the first chunk of the resource. */ + ctx->chunks_start_offset = ctx->out_fd->offset; + ctx->cur_write_blob_offset = 0; + ctx->cur_write_res_size = res_expected_size; + return 0; +} + +static int +end_chunk_table(struct write_blobs_ctx *ctx, u64 res_actual_size, + u64 *res_start_offset_ret, u64 *res_store_size_ret) +{ + size_t actual_num_chunks; + size_t actual_num_chunk_entries; + size_t chunk_entry_size; + int ret; + + actual_num_chunks = ctx->chunk_index; + actual_num_chunk_entries = actual_num_chunks; + if (!(ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID)) + actual_num_chunk_entries--; + + chunk_entry_size = get_chunk_entry_size(res_actual_size, + 0 != (ctx->write_resource_flags & + WRITE_RESOURCE_FLAG_SOLID)); + + typedef le64 __attribute__((may_alias)) aliased_le64_t; + typedef le32 __attribute__((may_alias)) aliased_le32_t; + + if (chunk_entry_size == 4) { + aliased_le32_t *entries = (aliased_le32_t*)ctx->chunk_csizes; + + if (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) { + for (size_t i = 0; i < actual_num_chunk_entries; i++) + entries[i] = cpu_to_le32(ctx->chunk_csizes[i]); + } else { + u32 offset = ctx->chunk_csizes[0]; + for (size_t i = 0; i < actual_num_chunk_entries; i++) { + u32 next_size = ctx->chunk_csizes[i + 1]; + entries[i] = cpu_to_le32(offset); + offset += next_size; + } + } + } else { + aliased_le64_t *entries = (aliased_le64_t*)ctx->chunk_csizes; + + if (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) { + for (size_t i = 0; i < actual_num_chunk_entries; i++) + entries[i] = cpu_to_le64(ctx->chunk_csizes[i]); + } else { + u64 offset = ctx->chunk_csizes[0]; + for (size_t i = 0; i < actual_num_chunk_entries; i++) { + u64 next_size = ctx->chunk_csizes[i + 1]; + entries[i] = cpu_to_le64(offset); + offset += next_size; + } + } + } + + size_t chunk_table_size = actual_num_chunk_entries * chunk_entry_size; + u64 res_start_offset; + u64 res_end_offset; + + if (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_PIPABLE) { + ret = full_write(ctx->out_fd, ctx->chunk_csizes, chunk_table_size); + if (ret) + goto write_error; + res_end_offset = ctx->out_fd->offset; + res_start_offset = ctx->chunks_start_offset; + } else { + res_end_offset = ctx->out_fd->offset; + + u64 chunk_table_offset; + + chunk_table_offset = ctx->chunks_start_offset - chunk_table_size; + + if (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) { + struct alt_chunk_table_header_disk hdr; + + hdr.res_usize = cpu_to_le64(res_actual_size); + hdr.chunk_size = cpu_to_le32(ctx->out_chunk_size); + hdr.compression_format = cpu_to_le32(ctx->out_ctype); + + STATIC_ASSERT(WIMLIB_COMPRESSION_TYPE_XPRESS == 1); + STATIC_ASSERT(WIMLIB_COMPRESSION_TYPE_LZX == 2); + STATIC_ASSERT(WIMLIB_COMPRESSION_TYPE_LZMS == 3); + + ret = full_pwrite(ctx->out_fd, &hdr, sizeof(hdr), + chunk_table_offset - sizeof(hdr)); + if (ret) + goto write_error; + res_start_offset = chunk_table_offset - sizeof(hdr); + } else { + res_start_offset = chunk_table_offset; + } + + ret = full_pwrite(ctx->out_fd, ctx->chunk_csizes, + chunk_table_size, chunk_table_offset); + if (ret) + goto write_error; + } + + *res_start_offset_ret = res_start_offset; + *res_store_size_ret = res_end_offset - res_start_offset; + + return 0; + +write_error: + ERROR_WITH_ERRNO("Error writing chunk table to WIM file"); + return ret; +} + +/* Finish writing a WIM resource by writing or updating the chunk table (if not + * writing the data uncompressed) and loading its metadata into @out_reshdr. */ +static int +end_write_resource(struct write_blobs_ctx *ctx, struct wim_reshdr *out_reshdr) +{ + int ret; + u64 res_size_in_wim; + u64 res_uncompressed_size; + u64 res_offset_in_wim; + + wimlib_assert(ctx->cur_write_blob_offset == ctx->cur_write_res_size || + (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID)); + res_uncompressed_size = ctx->cur_write_res_size; + + if (ctx->compressor) { + ret = end_chunk_table(ctx, res_uncompressed_size, + &res_offset_in_wim, &res_size_in_wim); + if (ret) + return ret; + } else { + res_offset_in_wim = ctx->chunks_start_offset; + res_size_in_wim = ctx->out_fd->offset - res_offset_in_wim; + } + out_reshdr->uncompressed_size = res_uncompressed_size; + out_reshdr->size_in_wim = res_size_in_wim; + out_reshdr->offset_in_wim = res_offset_in_wim; + return 0; +} + +/* Call when no more data from the file at @path is needed. */ +static int +done_with_file(const tchar *path, wimlib_progress_func_t progfunc, void *progctx) +{ + union wimlib_progress_info info; + + info.done_with_file.path_to_file = path; + + return call_progress(progfunc, WIMLIB_PROGRESS_MSG_DONE_WITH_FILE, + &info, progctx); +} + +static int +do_done_with_blob(struct blob_descriptor *blob, + wimlib_progress_func_t progfunc, void *progctx) +{ + int ret; + struct wim_inode *inode; + const tchar *path; + tchar *cookie1; + tchar *cookie2; + + if (!blob->may_send_done_with_file) + return 0; + + inode = blob->file_inode; + + wimlib_assert(inode != NULL); + wimlib_assert(inode->i_num_remaining_streams > 0); + if (--inode->i_num_remaining_streams > 0) + return 0; + + path = blob_file_path(blob); + + cookie1 = progress_get_streamless_path(path); + cookie2 = progress_get_win32_path(path); + + ret = done_with_file(path, progfunc, progctx); + + progress_put_win32_path(cookie2); + progress_put_streamless_path(cookie1); + + return ret; +} + +/* Handle WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES mode. */ +static inline int +done_with_blob(struct blob_descriptor *blob, struct write_blobs_ctx *ctx) +{ + if (likely(!(ctx->write_resource_flags & + WRITE_RESOURCE_FLAG_SEND_DONE_WITH_FILE))) + return 0; + return do_done_with_blob(blob, ctx->progress_data.progfunc, + ctx->progress_data.progctx); +} + +/* Begin processing a blob for writing. */ +static int +write_blob_begin_read(struct blob_descriptor *blob, void *_ctx) +{ + struct write_blobs_ctx *ctx = _ctx; + int ret; + + wimlib_assert(blob->size > 0); + + /* As an optimization, we allow some blobs to be "unhashed", meaning + * their SHA-1 message digests are unknown. This is the case with blobs + * that are added by scanning a directory tree with wimlib_add_image(), + * for example. Since WIM uses single-instance blobs, we don't know + * whether such each such blob really need to written until it is + * actually checksummed, unless it has a unique size. In such cases we + * read and checksum the blob in this function, thereby advancing ahead + * of read_blob_list(), which will still provide the data again to + * write_blob_process_chunk(). This is okay because an unhashed blob + * cannot be in a WIM resource, which might be costly to decompress. */ + if (ctx->blob_table != NULL && blob->unhashed && !blob->unique_size) { + + struct blob_descriptor *new_blob; + + ret = hash_unhashed_blob(blob, ctx->blob_table, &new_blob); + if (ret) + return ret; + if (new_blob != blob) { + /* Duplicate blob detected. */ + + if (new_blob->will_be_in_output_wim || + blob_filtered(new_blob, ctx->filter_ctx)) + { + /* The duplicate blob is already being included + * in the output WIM, or it would be filtered + * out if it had been. Skip writing this blob + * (and reading it again) entirely, passing its + * output reference count to the duplicate blob + * in the former case. */ + ret = do_write_blobs_progress(&ctx->progress_data, + blob->size, + blob->size, + 1, true); + list_del(&blob->write_blobs_list); + list_del(&blob->blob_table_list); + if (new_blob->will_be_in_output_wim) + new_blob->out_refcnt += blob->out_refcnt; + if (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) + ctx->cur_write_res_size -= blob->size; + if (!ret) + ret = done_with_blob(blob, ctx); + free_blob_descriptor(blob); + if (ret) + return ret; + return BEGIN_BLOB_STATUS_SKIP_BLOB; + } else { + /* The duplicate blob can validly be written, + * but was not marked as such. Discard the + * current blob descriptor and use the + * duplicate, but actually freeing the current + * blob descriptor must wait until + * read_blob_list() has finished reading its + * data. */ + list_replace(&blob->write_blobs_list, + &new_blob->write_blobs_list); + list_replace(&blob->blob_table_list, + &new_blob->blob_table_list); + blob->will_be_in_output_wim = 0; + new_blob->out_refcnt = blob->out_refcnt; + new_blob->will_be_in_output_wim = 1; + new_blob->may_send_done_with_file = 0; + blob = new_blob; + } + } + } + list_move_tail(&blob->write_blobs_list, &ctx->blobs_being_compressed); + return 0; +} + +/* Rewrite a blob that was just written compressed (as a non-solid WIM resource) + * as uncompressed instead. */ +static int +write_blob_uncompressed(struct blob_descriptor *blob, struct filedes *out_fd) +{ + int ret; + u64 begin_offset = blob->out_reshdr.offset_in_wim; + u64 end_offset = out_fd->offset; + + if (filedes_seek(out_fd, begin_offset) == -1) + return 0; + + ret = extract_blob_to_fd(blob, out_fd, false); + if (ret) { + /* Error reading the uncompressed data. */ + if (out_fd->offset == begin_offset && + filedes_seek(out_fd, end_offset) != -1) + { + /* Nothing was actually written yet, and we successfully + * seeked to the end of the compressed resource, so + * don't issue a hard error; just keep the compressed + * resource instead. */ + WARNING("Recovered compressed resource of " + "size %"PRIu64", continuing on.", blob->size); + return 0; + } + return ret; + } + + wimlib_assert(out_fd->offset - begin_offset == blob->size); + + /* We could ftruncate() the file to 'out_fd->offset' here, but there + * isn't much point. Usually we will only be truncating by a few bytes + * and will just overwrite the data immediately. */ + + blob->out_reshdr.size_in_wim = blob->size; + blob->out_reshdr.flags &= ~(WIM_RESHDR_FLAG_COMPRESSED | + WIM_RESHDR_FLAG_SOLID); + return 0; +} + +/* Returns true if the specified blob, which was written as a non-solid + * resource, should be truncated from the WIM file and re-written uncompressed. + * blob->out_reshdr must be filled in from the initial write of the blob. */ +static bool +should_rewrite_blob_uncompressed(const struct write_blobs_ctx *ctx, + const struct blob_descriptor *blob) +{ + /* If the compressed data is smaller than the uncompressed data, prefer + * the compressed data. */ + if (blob->out_reshdr.size_in_wim < blob->out_reshdr.uncompressed_size) + return false; + + /* If we're not actually writing compressed data, then there's no need + * for re-writing. */ + if (!ctx->compressor) + return false; + + /* If writing a pipable WIM, everything we write to the output is final + * (it might actually be a pipe!). */ + if (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_PIPABLE) + return false; + + /* If the blob that would need to be re-read is located in a solid + * resource in another WIM file, then re-reading it would be costly. So + * don't do it. + * + * Exception: if the compressed size happens to be *exactly* the same as + * the uncompressed size, then the blob *must* be written uncompressed + * in order to remain compatible with the Windows Overlay Filesystem + * filter driver (WOF). + * + * TODO: we are currently assuming that the optimization for + * single-chunk resources in maybe_rewrite_blob_uncompressed() prevents + * this case from being triggered too often. To fully prevent excessive + * decompressions in degenerate cases, we really should obtain the + * uncompressed data by decompressing the compressed data we wrote to + * the output file. + */ + if (blob->blob_location == BLOB_IN_WIM && + blob->size != blob->rdesc->uncompressed_size && + blob->size != blob->out_reshdr.size_in_wim) + return false; + + return true; +} + +static int +maybe_rewrite_blob_uncompressed(struct write_blobs_ctx *ctx, + struct blob_descriptor *blob) +{ + if (!should_rewrite_blob_uncompressed(ctx, blob)) + return 0; + + /* Regular (non-solid) WIM resources with exactly one chunk and + * compressed size equal to uncompressed size are exactly the same as + * the corresponding compressed data --- since there must be 0 entries + * in the chunk table and the only chunk must be stored uncompressed. + * In this case, there's no need to rewrite anything. */ + if (ctx->chunk_index == 1 && + blob->out_reshdr.size_in_wim == blob->out_reshdr.uncompressed_size) + { + blob->out_reshdr.flags &= ~WIM_RESHDR_FLAG_COMPRESSED; + return 0; + } + + return write_blob_uncompressed(blob, ctx->out_fd); +} + +/* Write the next chunk of (typically compressed) data to the output WIM, + * handling the writing of the chunk table. */ +static int +write_chunk(struct write_blobs_ctx *ctx, const void *cchunk, + size_t csize, size_t usize) +{ + int ret; + struct blob_descriptor *blob; + u32 completed_blob_count = 0; + + blob = list_entry(ctx->blobs_being_compressed.next, + struct blob_descriptor, write_blobs_list); + + if (ctx->cur_write_blob_offset == 0 && + !(ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID)) + { + /* Starting to write a new blob in non-solid mode. */ + + if (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_PIPABLE) { + ret = write_pwm_blob_header(blob, ctx->out_fd, + ctx->compressor != NULL); + if (ret) + return ret; + } + + ret = begin_write_resource(ctx, blob->size); + if (ret) + return ret; + } + + if (ctx->compressor != NULL) { + /* Record the compresed chunk size. */ + wimlib_assert(ctx->chunk_index < ctx->num_alloc_chunks); + ctx->chunk_csizes[ctx->chunk_index++] = csize; + + /* If writing a pipable WIM, before the chunk data write a chunk + * header that provides the compressed chunk size. */ + if (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_PIPABLE) { + struct pwm_chunk_hdr chunk_hdr = { + .compressed_size = cpu_to_le32(csize), + }; + ret = full_write(ctx->out_fd, &chunk_hdr, + sizeof(chunk_hdr)); + if (ret) + goto write_error; + } + } + + /* Write the chunk data. */ + ret = full_write(ctx->out_fd, cchunk, csize); + if (ret) + goto write_error; + + ctx->cur_write_blob_offset += usize; + + if (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) { + /* Wrote chunk in solid mode. It may have finished multiple + * blobs. */ + struct blob_descriptor *next_blob; + + while (blob && ctx->cur_write_blob_offset >= blob->size) { + + ctx->cur_write_blob_offset -= blob->size; + + if (ctx->cur_write_blob_offset) + next_blob = list_entry(blob->write_blobs_list.next, + struct blob_descriptor, + write_blobs_list); + else + next_blob = NULL; + + ret = done_with_blob(blob, ctx); + if (ret) + return ret; + list_move_tail(&blob->write_blobs_list, &ctx->blobs_in_solid_resource); + completed_blob_count++; + + blob = next_blob; + } + } else { + /* Wrote chunk in non-solid mode. It may have finished a + * blob. */ + if (ctx->cur_write_blob_offset == blob->size) { + + wimlib_assert(ctx->cur_write_blob_offset == + ctx->cur_write_res_size); + + ret = end_write_resource(ctx, &blob->out_reshdr); + if (ret) + return ret; + + blob->out_reshdr.flags = reshdr_flags_for_blob(blob); + if (ctx->compressor != NULL) + blob->out_reshdr.flags |= WIM_RESHDR_FLAG_COMPRESSED; + + ret = maybe_rewrite_blob_uncompressed(ctx, blob); + if (ret) + return ret; + + wimlib_assert(blob->out_reshdr.uncompressed_size == blob->size); + + ctx->cur_write_blob_offset = 0; + + ret = done_with_blob(blob, ctx); + if (ret) + return ret; + list_del(&blob->write_blobs_list); + completed_blob_count++; + } + } + + return do_write_blobs_progress(&ctx->progress_data, usize, csize, + completed_blob_count, false); + +write_error: + ERROR_WITH_ERRNO("Error writing chunk data to WIM file"); + return ret; +} + +static int +prepare_chunk_buffer(struct write_blobs_ctx *ctx) +{ + /* While we are unable to get a new chunk buffer due to too many chunks + * already outstanding, retrieve and write the next compressed chunk. */ + while (!(ctx->cur_chunk_buf = + ctx->compressor->get_chunk_buffer(ctx->compressor))) + { + const void *cchunk; + u32 csize; + u32 usize; + bool bret; + int ret; + + bret = ctx->compressor->get_compression_result(ctx->compressor, + &cchunk, + &csize, + &usize); + wimlib_assert(bret); + + ret = write_chunk(ctx, cchunk, csize, usize); + if (ret) + return ret; + } + return 0; +} + +/* Process the next chunk of data to be written to a WIM resource. */ +static int +write_blob_process_chunk(const struct blob_descriptor *blob, u64 offset, + const void *chunk, size_t size, void *_ctx) +{ + struct write_blobs_ctx *ctx = _ctx; + int ret; + const u8 *chunkptr, *chunkend; + + wimlib_assert(size != 0); + + if (ctx->compressor == NULL) { + /* Write chunk uncompressed. */ + ret = write_chunk(ctx, chunk, size, size); + if (ret) + return ret; + return 0; + } + + /* Submit the chunk for compression, but take into account that the + * @size the chunk was provided in may not correspond to the + * @out_chunk_size being used for compression. */ + chunkptr = chunk; + chunkend = chunkptr + size; + do { + size_t needed_chunk_size; + size_t bytes_consumed; + + if (!ctx->cur_chunk_buf) { + ret = prepare_chunk_buffer(ctx); + if (ret) + return ret; + } + + if (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) { + needed_chunk_size = ctx->out_chunk_size; + } else { + needed_chunk_size = min(ctx->out_chunk_size, + ctx->cur_chunk_buf_filled + + (blob->size - offset)); + } + + bytes_consumed = min(chunkend - chunkptr, + needed_chunk_size - ctx->cur_chunk_buf_filled); + + memcpy(&ctx->cur_chunk_buf[ctx->cur_chunk_buf_filled], + chunkptr, bytes_consumed); + + chunkptr += bytes_consumed; + offset += bytes_consumed; + ctx->cur_chunk_buf_filled += bytes_consumed; + + if (ctx->cur_chunk_buf_filled == needed_chunk_size) { + ctx->compressor->signal_chunk_filled(ctx->compressor, + ctx->cur_chunk_buf_filled); + ctx->cur_chunk_buf = NULL; + ctx->cur_chunk_buf_filled = 0; + } + } while (chunkptr != chunkend); + return 0; +} + +/* Finish processing a blob for writing. It may not have been completely + * written yet, as the chunk_compressor implementation may still have chunks + * buffered or being compressed. */ +static int +write_blob_end_read(struct blob_descriptor *blob, int status, void *_ctx) +{ + struct write_blobs_ctx *ctx = _ctx; + + if (!blob->will_be_in_output_wim) { + /* The blob was a duplicate. Now that its data has finished + * being read, it is being discarded in favor of the duplicate + * entry. It therefore is no longer needed, and we can fire the + * DONE_WITH_FILE callback because the file will not be read + * again. + * + * Note: we can't yet fire DONE_WITH_FILE for non-duplicate + * blobs, since it needs to be possible to re-read the file if + * it does not compress to less than its original size. */ + if (!status) + status = done_with_blob(blob, ctx); + free_blob_descriptor(blob); + } else if (!status && blob->unhashed && ctx->blob_table != NULL) { + /* The blob was not a duplicate and was previously unhashed. + * Since we passed COMPUTE_MISSING_BLOB_HASHES to + * read_blob_list(), blob->hash is now computed and valid. So + * turn this blob into a "hashed" blob. */ + list_del(&blob->unhashed_list); + blob_table_insert(ctx->blob_table, blob); + blob->unhashed = 0; + } + return status; +} + +/* + * Compute statistics about a list of blobs that will be written. + * + * Assumes the blobs are sorted such that all blobs located in each distinct WIM + * (specified by WIMStruct) are together. + * + * For compactions, also verify that there are no overlapping resources. This + * really should be checked earlier, but for now it's easiest to check here. + */ +static int +compute_blob_list_stats(struct list_head *blob_list, + struct write_blobs_ctx *ctx) +{ + struct blob_descriptor *blob; + u64 total_bytes = 0; + u64 num_blobs = 0; + u64 total_parts = 0; + WIMStruct *prev_wim_part = NULL; + const struct wim_resource_descriptor *prev_rdesc = NULL; + + list_for_each_entry(blob, blob_list, write_blobs_list) { + num_blobs++; + total_bytes += blob->size; + if (blob->blob_location == BLOB_IN_WIM) { + const struct wim_resource_descriptor *rdesc = blob->rdesc; + WIMStruct *wim = rdesc->wim; + + if (prev_wim_part != wim) { + prev_wim_part = wim; + total_parts++; + } + if (unlikely(wim->being_compacted) && rdesc != prev_rdesc) { + if (prev_rdesc != NULL && + rdesc->offset_in_wim < + prev_rdesc->offset_in_wim + + prev_rdesc->size_in_wim) + { + WARNING("WIM file contains overlapping " + "resources! Compaction is not " + "possible."); + return WIMLIB_ERR_RESOURCE_ORDER; + } + prev_rdesc = rdesc; + } + } + } + ctx->progress_data.progress.write_streams.total_bytes = total_bytes; + ctx->progress_data.progress.write_streams.total_streams = num_blobs; + ctx->progress_data.progress.write_streams.completed_bytes = 0; + ctx->progress_data.progress.write_streams.completed_streams = 0; + ctx->progress_data.progress.write_streams.compression_type = ctx->out_ctype; + ctx->progress_data.progress.write_streams.total_parts = total_parts; + ctx->progress_data.progress.write_streams.completed_parts = 0; + ctx->progress_data.next_progress = 0; + return 0; +} + +/* Find blobs in @blob_list that can be copied to the output WIM in raw form + * rather than compressed. Delete these blobs from @blob_list and move them to + * @raw_copy_blobs. Return the total uncompressed size of the blobs that need + * to be compressed. */ +static u64 +find_raw_copy_blobs(struct list_head *blob_list, int write_resource_flags, + int out_ctype, u32 out_chunk_size, + struct list_head *raw_copy_blobs) +{ + struct blob_descriptor *blob, *tmp; + u64 num_nonraw_bytes = 0; + + INIT_LIST_HEAD(raw_copy_blobs); + + /* Initialize temporary raw_copy_ok flag. */ + list_for_each_entry(blob, blob_list, write_blobs_list) + if (blob->blob_location == BLOB_IN_WIM) + blob->rdesc->raw_copy_ok = 0; + + list_for_each_entry_safe(blob, tmp, blob_list, write_blobs_list) { + if (can_raw_copy(blob, write_resource_flags, + out_ctype, out_chunk_size)) + { + blob->rdesc->raw_copy_ok = 1; + list_move_tail(&blob->write_blobs_list, raw_copy_blobs); + } else { + num_nonraw_bytes += blob->size; + } + } + + return num_nonraw_bytes; +} + +/* Copy a raw compressed resource located in another WIM file to the WIM file + * being written. */ +static int +write_raw_copy_resource(struct wim_resource_descriptor *in_rdesc, + struct filedes *out_fd) +{ + u64 cur_read_offset; + u64 end_read_offset; + u8 buf[BUFFER_SIZE]; + size_t bytes_to_read; + int ret; + struct filedes *in_fd; + struct blob_descriptor *blob; + u64 out_offset_in_wim; + + /* Copy the raw data. */ + cur_read_offset = in_rdesc->offset_in_wim; + end_read_offset = cur_read_offset + in_rdesc->size_in_wim; + + out_offset_in_wim = out_fd->offset; + + if (in_rdesc->is_pipable) { + if (cur_read_offset < sizeof(struct pwm_blob_hdr)) + return WIMLIB_ERR_INVALID_PIPABLE_WIM; + cur_read_offset -= sizeof(struct pwm_blob_hdr); + out_offset_in_wim += sizeof(struct pwm_blob_hdr); + } + in_fd = &in_rdesc->wim->in_fd; + wimlib_assert(cur_read_offset != end_read_offset); + + if (likely(!in_rdesc->wim->being_compacted) || + in_rdesc->offset_in_wim > out_fd->offset) { + do { + bytes_to_read = min(sizeof(buf), + end_read_offset - cur_read_offset); + + ret = full_pread(in_fd, buf, bytes_to_read, + cur_read_offset); + if (ret) { + ERROR_WITH_ERRNO("Error reading raw data " + "from WIM file"); + return ret; + } + + ret = full_write(out_fd, buf, bytes_to_read); + if (ret) { + ERROR_WITH_ERRNO("Error writing raw data " + "to WIM file"); + return ret; + } + + cur_read_offset += bytes_to_read; + + } while (cur_read_offset != end_read_offset); + } else { + /* Optimization: the WIM file is being compacted and the + * resource being written is already in the desired location. + * Skip over the data instead of re-writing it. */ + + /* Due the earlier check for overlapping resources, it should + * never be the case that we already overwrote the resource. */ + wimlib_assert(!(in_rdesc->offset_in_wim < out_fd->offset)); + + if (-1 == filedes_seek(out_fd, out_fd->offset + in_rdesc->size_in_wim)) + return WIMLIB_ERR_WRITE; + } + + list_for_each_entry(blob, &in_rdesc->blob_list, rdesc_node) { + if (blob->will_be_in_output_wim) { + blob_set_out_reshdr_for_reuse(blob); + if (in_rdesc->flags & WIM_RESHDR_FLAG_SOLID) + blob->out_res_offset_in_wim = out_offset_in_wim; + else + blob->out_reshdr.offset_in_wim = out_offset_in_wim; + + } + } + return 0; +} + +/* Copy a list of raw compressed resources located in other WIM file(s) to the + * WIM file being written. */ +static int +write_raw_copy_resources(struct list_head *raw_copy_blobs, + struct filedes *out_fd, + struct write_blobs_progress_data *progress_data) +{ + struct blob_descriptor *blob; + int ret; + + list_for_each_entry(blob, raw_copy_blobs, write_blobs_list) + blob->rdesc->raw_copy_ok = 1; + + list_for_each_entry(blob, raw_copy_blobs, write_blobs_list) { + u64 compressed_size = 0; + + if (blob->rdesc->raw_copy_ok) { + /* Write each solid resource only one time. */ + ret = write_raw_copy_resource(blob->rdesc, out_fd); + if (ret) + return ret; + blob->rdesc->raw_copy_ok = 0; + compressed_size = blob->rdesc->size_in_wim; + } + ret = do_write_blobs_progress(progress_data, blob->size, + compressed_size, 1, false); + if (ret) + return ret; + } + return 0; +} + +/* Wait for and write all chunks pending in the compressor. */ +static int +finish_remaining_chunks(struct write_blobs_ctx *ctx) +{ + const void *cdata; + u32 csize; + u32 usize; + int ret; + + if (ctx->compressor == NULL) + return 0; + + if (ctx->cur_chunk_buf_filled != 0) { + ctx->compressor->signal_chunk_filled(ctx->compressor, + ctx->cur_chunk_buf_filled); + } + + while (ctx->compressor->get_compression_result(ctx->compressor, &cdata, + &csize, &usize)) + { + ret = write_chunk(ctx, cdata, csize, usize); + if (ret) + return ret; + } + return 0; +} + +static void +validate_blob_list(struct list_head *blob_list) +{ + struct blob_descriptor *blob; + + list_for_each_entry(blob, blob_list, write_blobs_list) { + wimlib_assert(blob->will_be_in_output_wim); + wimlib_assert(blob->size != 0); + } +} + +static void +init_done_with_file_info(struct list_head *blob_list) +{ + struct blob_descriptor *blob; + + list_for_each_entry(blob, blob_list, write_blobs_list) { + if (blob_is_in_file(blob)) { + blob->file_inode->i_num_remaining_streams = 0; + blob->may_send_done_with_file = 1; + } else { + blob->may_send_done_with_file = 0; + } + } + + list_for_each_entry(blob, blob_list, write_blobs_list) + if (blob->may_send_done_with_file) + blob->file_inode->i_num_remaining_streams++; +} + +/* + * Write a list of blobs to the output WIM file. + * + * @blob_list + * The list of blobs to write, specified by a list of 'struct blob_descriptor' linked + * by the 'write_blobs_list' member. + * + * @out_fd + * The file descriptor, opened for writing, to which to write the blobs. + * + * @write_resource_flags + * Flags to modify how the blobs are written: + * + * WRITE_RESOURCE_FLAG_RECOMPRESS: + * Force compression of all resources, even if they could otherwise + * be re-used by copying the raw data, due to being located in a WIM + * file with compatible compression parameters. + * + * WRITE_RESOURCE_FLAG_PIPABLE: + * Write the resources in the wimlib-specific pipable format, and + * furthermore do so in such a way that no seeking backwards in + * @out_fd will be performed (so it may be a pipe). + * + * WRITE_RESOURCE_FLAG_SOLID: + * Combine all the blobs into a single resource rather than writing + * them in separate resources. This flag is only valid if the WIM + * version number has been, or will be, set to WIM_VERSION_SOLID. + * This flag may not be combined with WRITE_RESOURCE_FLAG_PIPABLE. + * + * @out_ctype + * Compression format to use in the output resources, specified as one of + * the WIMLIB_COMPRESSION_TYPE_* constants. WIMLIB_COMPRESSION_TYPE_NONE + * is allowed. + * + * @out_chunk_size + * Compression chunk size to use in the output resources. It must be a + * valid chunk size for the specified compression format @out_ctype, unless + * @out_ctype is WIMLIB_COMPRESSION_TYPE_NONE, in which case this parameter + * is ignored. + * + * @num_threads + * Number of threads to use to compress data. If 0, a default number of + * threads will be chosen. The number of threads still may be decreased + * from the specified value if insufficient memory is detected. + * + * @blob_table + * If on-the-fly deduplication of unhashed blobs is desired, this parameter + * must be pointer to the blob table for the WIMStruct on whose behalf the + * blobs are being written. Otherwise, this parameter can be NULL. + * + * @filter_ctx + * If on-the-fly deduplication of unhashed blobs is desired, this parameter + * can be a pointer to a context for blob filtering used to detect whether + * the duplicate blob has been hard-filtered or not. If no blobs are + * hard-filtered or no blobs are unhashed, this parameter can be NULL. + * + * This function will write the blobs in @blob_list to resources in + * consecutive positions in the output WIM file, or to a single solid resource + * if WRITE_RESOURCE_FLAG_SOLID was specified in @write_resource_flags. In both + * cases, the @out_reshdr of the `struct blob_descriptor' for each blob written will be + * updated to specify its location, size, and flags in the output WIM. In the + * solid resource case, WIM_RESHDR_FLAG_SOLID will be set in the @flags field of + * each @out_reshdr, and furthermore @out_res_offset_in_wim and + * @out_res_size_in_wim of each @out_reshdr will be set to the offset and size, + * respectively, in the output WIM of the solid resource containing the + * corresponding blob. + * + * Each of the blobs to write may be in any location supported by the + * resource-handling code (specifically, read_blob_list()), such as the contents + * of external file that has been logically added to the output WIM, or a blob + * in another WIM file that has been imported, or even a blob in the "same" WIM + * file of which a modified copy is being written. In the case that a blob is + * already in a WIM file and uses compatible compression parameters, by default + * this function will re-use the raw data instead of decompressing it, then + * recompressing it; however, with WRITE_RESOURCE_FLAG_RECOMPRESS + * specified in @write_resource_flags, this is not done. + * + * As a further requirement, this function requires that the + * @will_be_in_output_wim member be set to 1 on all blobs in @blob_list as well + * as any other blobs not in @blob_list that will be in the output WIM file, but + * set to 0 on any other blobs in the output WIM's blob table or sharing a solid + * resource with a blob in @blob_list. Still furthermore, if on-the-fly + * deduplication of blobs is possible, then all blobs in @blob_list must also be + * linked by @blob_table_list along with any other blobs that have + * @will_be_in_output_wim set. + * + * This function handles on-the-fly deduplication of blobs for which SHA-1 + * message digests have not yet been calculated. Such blobs may or may not need + * to be written. If @blob_table is non-NULL, then each blob in @blob_list that + * has @unhashed set but not @unique_size set is checksummed immediately before + * it would otherwise be read for writing in order to determine if it is + * identical to another blob already being written or one that would be filtered + * out of the output WIM using blob_filtered() with the context @filter_ctx. + * Each such duplicate blob will be removed from @blob_list, its reference count + * transferred to the pre-existing duplicate blob, its memory freed, and will + * not be written. Alternatively, if a blob in @blob_list is a duplicate with + * any blob in @blob_table that has not been marked for writing or would not be + * hard-filtered, it is freed and the pre-existing duplicate is written instead, + * taking ownership of the reference count and slot in the @blob_table_list. + * + * Returns 0 if every blob was either written successfully or did not need to be + * written; otherwise returns a non-zero error code. + */ +static int +write_blob_list(struct list_head *blob_list, + struct filedes *out_fd, + int write_resource_flags, + int out_ctype, + u32 out_chunk_size, + unsigned num_threads, + struct blob_table *blob_table, + struct filter_context *filter_ctx, + wimlib_progress_func_t progfunc, + void *progctx) +{ + int ret; + struct write_blobs_ctx ctx; + struct list_head raw_copy_blobs; + u64 num_nonraw_bytes; + + wimlib_assert((write_resource_flags & + (WRITE_RESOURCE_FLAG_SOLID | + WRITE_RESOURCE_FLAG_PIPABLE)) != + (WRITE_RESOURCE_FLAG_SOLID | + WRITE_RESOURCE_FLAG_PIPABLE)); + + validate_blob_list(blob_list); + + if (list_empty(blob_list)) + return 0; + + /* If needed, set auxiliary information so that we can detect when the + * library has finished using each external file. */ + if (unlikely(write_resource_flags & WRITE_RESOURCE_FLAG_SEND_DONE_WITH_FILE)) + init_done_with_file_info(blob_list); + + memset(&ctx, 0, sizeof(ctx)); + + ctx.out_fd = out_fd; + ctx.blob_table = blob_table; + ctx.out_ctype = out_ctype; + ctx.out_chunk_size = out_chunk_size; + ctx.write_resource_flags = write_resource_flags; + ctx.filter_ctx = filter_ctx; + + /* + * We normally sort the blobs to write by a "sequential" order that is + * optimized for reading. But when using solid compression, we instead + * sort the blobs by file extension and file name (when applicable; and + * we don't do this for blobs from solid resources) so that similar + * files are grouped together, which improves the compression ratio. + * This is somewhat of a hack since a blob does not necessarily + * correspond one-to-one with a filename, nor is there any guarantee + * that two files with similar names or extensions are actually similar + * in content. A potential TODO is to sort the blobs based on some + * measure of similarity of their actual contents. + */ + + ret = sort_blob_list_by_sequential_order(blob_list, + offsetof(struct blob_descriptor, + write_blobs_list)); + if (ret) + return ret; + + ret = compute_blob_list_stats(blob_list, &ctx); + if (ret) + return ret; + + if (write_resource_flags & WRITE_RESOURCE_FLAG_SOLID_SORT) { + ret = sort_blob_list_for_solid_compression(blob_list); + if (unlikely(ret)) + WARNING("Failed to sort blobs for solid compression. Continuing anyways."); + } + + ctx.progress_data.progfunc = progfunc; + ctx.progress_data.progctx = progctx; + + num_nonraw_bytes = find_raw_copy_blobs(blob_list, write_resource_flags, + out_ctype, out_chunk_size, + &raw_copy_blobs); + + /* Unless no data needs to be compressed, allocate a chunk_compressor to + * do compression. There are serial and parallel implementations of the + * chunk_compressor interface. We default to parallel using the + * specified number of threads, unless the upper bound on the number + * bytes needing to be compressed is less than a heuristic value. */ + if (num_nonraw_bytes != 0 && out_ctype != WIMLIB_COMPRESSION_TYPE_NONE) { + if (num_nonraw_bytes > max(2000000, out_chunk_size)) { + ret = new_parallel_chunk_compressor(out_ctype, + out_chunk_size, + num_threads, 0, + &ctx.compressor); + if (ret > 0) { + WARNING("Couldn't create parallel chunk compressor: %"TS".\n" + " Falling back to single-threaded compression.", + wimlib_get_error_string(ret)); + } + } + + if (ctx.compressor == NULL) { + ret = new_serial_chunk_compressor(out_ctype, out_chunk_size, + &ctx.compressor); + if (ret) + goto out_destroy_context; + } + } + + if (ctx.compressor) + ctx.progress_data.progress.write_streams.num_threads = ctx.compressor->num_threads; + else + ctx.progress_data.progress.write_streams.num_threads = 1; + + ret = call_progress(ctx.progress_data.progfunc, + WIMLIB_PROGRESS_MSG_WRITE_STREAMS, + &ctx.progress_data.progress, + ctx.progress_data.progctx); + if (ret) + goto out_destroy_context; + + /* Copy any compressed resources for which the raw data can be reused + * without decompression. */ + ret = write_raw_copy_resources(&raw_copy_blobs, ctx.out_fd, + &ctx.progress_data); + + if (ret || num_nonraw_bytes == 0) + goto out_destroy_context; + + INIT_LIST_HEAD(&ctx.blobs_being_compressed); + + if (write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) { + + INIT_LIST_HEAD(&ctx.blobs_in_solid_resource); + + ret = begin_write_resource(&ctx, num_nonraw_bytes); + if (ret) + goto out_destroy_context; + } + + /* Read the list of blobs needing to be compressed, using the specified + * callbacks to execute processing of the data. */ + + struct read_blob_callbacks cbs = { + .begin_blob = write_blob_begin_read, + .continue_blob = write_blob_process_chunk, + .end_blob = write_blob_end_read, + .ctx = &ctx, + }; + + ret = read_blob_list(blob_list, + offsetof(struct blob_descriptor, write_blobs_list), + &cbs, + BLOB_LIST_ALREADY_SORTED | + VERIFY_BLOB_HASHES | + COMPUTE_MISSING_BLOB_HASHES); + + if (ret) + goto out_destroy_context; + + ret = finish_remaining_chunks(&ctx); + if (ret) + goto out_destroy_context; + + if (write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) { + struct wim_reshdr reshdr; + struct blob_descriptor *blob; + u64 offset_in_res; + + ret = end_write_resource(&ctx, &reshdr); + if (ret) + goto out_destroy_context; + + offset_in_res = 0; + list_for_each_entry(blob, &ctx.blobs_in_solid_resource, write_blobs_list) { + blob->out_reshdr.size_in_wim = blob->size; + blob->out_reshdr.flags = reshdr_flags_for_blob(blob) | + WIM_RESHDR_FLAG_SOLID; + blob->out_reshdr.uncompressed_size = 0; + blob->out_reshdr.offset_in_wim = offset_in_res; + blob->out_res_offset_in_wim = reshdr.offset_in_wim; + blob->out_res_size_in_wim = reshdr.size_in_wim; + blob->out_res_uncompressed_size = reshdr.uncompressed_size; + offset_in_res += blob->size; + } + wimlib_assert(offset_in_res == reshdr.uncompressed_size); + } + +out_destroy_context: + FREE(ctx.chunk_csizes); + if (ctx.compressor) + ctx.compressor->destroy(ctx.compressor); + return ret; +} + + +static int +write_file_data_blobs(WIMStruct *wim, + struct list_head *blob_list, + int write_flags, + unsigned num_threads, + struct filter_context *filter_ctx) +{ + int out_ctype; + u32 out_chunk_size; + int write_resource_flags; + + write_resource_flags = write_flags_to_resource_flags(write_flags); + + if (write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) { + out_chunk_size = wim->out_solid_chunk_size; + out_ctype = wim->out_solid_compression_type; + } else { + out_chunk_size = wim->out_chunk_size; + out_ctype = wim->out_compression_type; + } + + return write_blob_list(blob_list, + &wim->out_fd, + write_resource_flags, + out_ctype, + out_chunk_size, + num_threads, + wim->blob_table, + filter_ctx, + wim->progfunc, + wim->progctx); +} + +/* Write the contents of the specified blob as a WIM resource. */ +static int +write_wim_resource(struct blob_descriptor *blob, + struct filedes *out_fd, + int out_ctype, + u32 out_chunk_size, + int write_resource_flags) +{ + LIST_HEAD(blob_list); + list_add(&blob->write_blobs_list, &blob_list); + blob->will_be_in_output_wim = 1; + return write_blob_list(&blob_list, + out_fd, + write_resource_flags & ~WRITE_RESOURCE_FLAG_SOLID, + out_ctype, + out_chunk_size, + 1, + NULL, + NULL, + NULL, + NULL); +} + +/* Write the contents of the specified buffer as a WIM resource. */ +int +write_wim_resource_from_buffer(const void *buf, + size_t buf_size, + bool is_metadata, + struct filedes *out_fd, + int out_ctype, + u32 out_chunk_size, + struct wim_reshdr *out_reshdr, + u8 *hash_ret, + int write_resource_flags) +{ + int ret; + struct blob_descriptor blob; + + if (unlikely(buf_size == 0)) { + zero_reshdr(out_reshdr); + if (hash_ret) + copy_hash(hash_ret, zero_hash); + return 0; + } + + blob_set_is_located_in_attached_buffer(&blob, (void *)buf, buf_size); + sha1(buf, buf_size, blob.hash); + blob.unhashed = 0; + blob.is_metadata = is_metadata; + + ret = write_wim_resource(&blob, out_fd, out_ctype, out_chunk_size, + write_resource_flags); + if (ret) + return ret; + + copy_reshdr(out_reshdr, &blob.out_reshdr); + + if (hash_ret) + copy_hash(hash_ret, blob.hash); + return 0; +} + +struct blob_size_table { + struct hlist_head *array; + size_t num_entries; + size_t capacity; +}; + +static int +init_blob_size_table(struct blob_size_table *tab, size_t capacity) +{ + tab->array = CALLOC(capacity, sizeof(tab->array[0])); + if (tab->array == NULL) + return WIMLIB_ERR_NOMEM; + tab->num_entries = 0; + tab->capacity = capacity; + return 0; +} + +static void +destroy_blob_size_table(struct blob_size_table *tab) +{ + FREE(tab->array); +} + +static int +blob_size_table_insert(struct blob_descriptor *blob, void *_tab) +{ + struct blob_size_table *tab = _tab; + size_t pos; + struct blob_descriptor *same_size_blob; + + pos = hash_u64(blob->size) % tab->capacity; + blob->unique_size = 1; + hlist_for_each_entry(same_size_blob, &tab->array[pos], hash_list_2) { + if (same_size_blob->size == blob->size) { + blob->unique_size = 0; + same_size_blob->unique_size = 0; + break; + } + } + + hlist_add_head(&blob->hash_list_2, &tab->array[pos]); + tab->num_entries++; + return 0; +} + +struct find_blobs_ctx { + WIMStruct *wim; + int write_flags; + struct list_head blob_list; + struct blob_size_table blob_size_tab; +}; + +static void +reference_blob_for_write(struct blob_descriptor *blob, + struct list_head *blob_list, u32 nref) +{ + if (!blob->will_be_in_output_wim) { + blob->out_refcnt = 0; + list_add_tail(&blob->write_blobs_list, blob_list); + blob->will_be_in_output_wim = 1; + } + blob->out_refcnt += nref; +} + +static int +fully_reference_blob_for_write(struct blob_descriptor *blob, void *_blob_list) +{ + struct list_head *blob_list = _blob_list; + blob->will_be_in_output_wim = 0; + reference_blob_for_write(blob, blob_list, blob->refcnt); + return 0; +} + +static int +inode_find_blobs_to_reference(const struct wim_inode *inode, + const struct blob_table *table, + struct list_head *blob_list) +{ + wimlib_assert(inode->i_nlink > 0); + + for (unsigned i = 0; i < inode->i_num_streams; i++) { + struct blob_descriptor *blob; + const u8 *hash; + + blob = stream_blob(&inode->i_streams[i], table); + if (blob) { + reference_blob_for_write(blob, blob_list, inode->i_nlink); + } else { + hash = stream_hash(&inode->i_streams[i]); + if (!is_zero_hash(hash)) + return blob_not_found_error(inode, hash); + } + } + return 0; +} + +static int +do_blob_set_not_in_output_wim(struct blob_descriptor *blob, void *_ignore) +{ + blob->will_be_in_output_wim = 0; + return 0; +} + +static int +image_find_blobs_to_reference(WIMStruct *wim) +{ + struct wim_image_metadata *imd; + struct wim_inode *inode; + struct blob_descriptor *blob; + struct list_head *blob_list; + int ret; + + imd = wim_get_current_image_metadata(wim); + + image_for_each_unhashed_blob(blob, imd) + blob->will_be_in_output_wim = 0; + + blob_list = wim->private; + image_for_each_inode(inode, imd) { + ret = inode_find_blobs_to_reference(inode, + wim->blob_table, + blob_list); + if (ret) + return ret; + } + return 0; +} + +static int +prepare_unfiltered_list_of_blobs_in_output_wim(WIMStruct *wim, + int image, + int blobs_ok, + struct list_head *blob_list_ret) +{ + int ret; + + INIT_LIST_HEAD(blob_list_ret); + + if (blobs_ok && (image == WIMLIB_ALL_IMAGES || + (image == 1 && wim->hdr.image_count == 1))) + { + /* Fast case: Assume that all blobs are being written and that + * the reference counts are correct. */ + struct blob_descriptor *blob; + struct wim_image_metadata *imd; + unsigned i; + + for_blob_in_table(wim->blob_table, + fully_reference_blob_for_write, + blob_list_ret); + + for (i = 0; i < wim->hdr.image_count; i++) { + imd = wim->image_metadata[i]; + image_for_each_unhashed_blob(blob, imd) + fully_reference_blob_for_write(blob, blob_list_ret); + } + } else { + /* Slow case: Walk through the images being written and + * determine the blobs referenced. */ + for_blob_in_table(wim->blob_table, + do_blob_set_not_in_output_wim, NULL); + wim->private = blob_list_ret; + ret = for_image(wim, image, image_find_blobs_to_reference); + if (ret) + return ret; + } + + return 0; +} + +struct insert_other_if_hard_filtered_ctx { + struct blob_size_table *tab; + struct filter_context *filter_ctx; +}; + +static int +insert_other_if_hard_filtered(struct blob_descriptor *blob, void *_ctx) +{ + struct insert_other_if_hard_filtered_ctx *ctx = _ctx; + + if (!blob->will_be_in_output_wim && + blob_hard_filtered(blob, ctx->filter_ctx)) + blob_size_table_insert(blob, ctx->tab); + return 0; +} + +static int +determine_blob_size_uniquity(struct list_head *blob_list, + struct blob_table *lt, + struct filter_context *filter_ctx) +{ + int ret; + struct blob_size_table tab; + struct blob_descriptor *blob; + + ret = init_blob_size_table(&tab, 9001); + if (ret) + return ret; + + if (may_hard_filter_blobs(filter_ctx)) { + struct insert_other_if_hard_filtered_ctx ctx = { + .tab = &tab, + .filter_ctx = filter_ctx, + }; + for_blob_in_table(lt, insert_other_if_hard_filtered, &ctx); + } + + list_for_each_entry(blob, blob_list, write_blobs_list) + blob_size_table_insert(blob, &tab); + + destroy_blob_size_table(&tab); + return 0; +} + +static void +filter_blob_list_for_write(struct list_head *blob_list, + struct filter_context *filter_ctx) +{ + struct blob_descriptor *blob, *tmp; + + list_for_each_entry_safe(blob, tmp, blob_list, write_blobs_list) { + int status = blob_filtered(blob, filter_ctx); + + if (status == 0) { + /* Not filtered. */ + continue; + } else { + if (status > 0) { + /* Soft filtered. */ + } else { + /* Hard filtered. */ + blob->will_be_in_output_wim = 0; + list_del(&blob->blob_table_list); + } + list_del(&blob->write_blobs_list); + } + } +} + +/* + * prepare_blob_list_for_write() - + * + * Prepare the list of blobs to write for writing a WIM containing the specified + * image(s) with the specified write flags. + * + * @wim + * The WIMStruct on whose behalf the write is occurring. + * + * @image + * Image(s) from the WIM to write; may be WIMLIB_ALL_IMAGES. + * + * @write_flags + * WIMLIB_WRITE_FLAG_* flags for the write operation: + * + * STREAMS_OK: For writes of all images, assume that all blobs in the blob + * table of @wim and the per-image lists of unhashed blobs should be taken + * as-is, and image metadata should not be searched for references. This + * does not exclude filtering with APPEND and SKIP_EXTERNAL_WIMS, below. + * + * APPEND: Blobs already present in @wim shall not be returned in + * @blob_list_ret. + * + * SKIP_EXTERNAL_WIMS: Blobs already present in a WIM file, but not @wim, + * shall be returned in neither @blob_list_ret nor @blob_table_list_ret. + * + * @blob_list_ret + * List of blobs, linked by write_blobs_list, that need to be written will + * be returned here. + * + * Note that this function assumes that unhashed blobs will be written; it + * does not take into account that they may become duplicates when actually + * hashed. + * + * @blob_table_list_ret + * List of blobs, linked by blob_table_list, that need to be included in + * the WIM's blob table will be returned here. This will be a superset of + * the blobs in @blob_list_ret. + * + * This list will be a proper superset of @blob_list_ret if and only if + * WIMLIB_WRITE_FLAG_APPEND was specified in @write_flags and some of the + * blobs that would otherwise need to be written were already located in + * the WIM file. + * + * All blobs in this list will have @out_refcnt set to the number of + * references to the blob in the output WIM. If + * WIMLIB_WRITE_FLAG_STREAMS_OK was specified in @write_flags, @out_refcnt + * may be as low as 0. + * + * @filter_ctx_ret + * A context for queries of blob filter status with blob_filtered() is + * returned in this location. + * + * In addition, @will_be_in_output_wim will be set to 1 in all blobs inserted + * into @blob_table_list_ret and to 0 in all blobs in the blob table of @wim not + * inserted into @blob_table_list_ret. + * + * Still furthermore, @unique_size will be set to 1 on all blobs in + * @blob_list_ret that have unique size among all blobs in @blob_list_ret and + * among all blobs in the blob table of @wim that are ineligible for being + * written due to filtering. + * + * Returns 0 on success; nonzero on read error, memory allocation error, or + * otherwise. + */ +static int +prepare_blob_list_for_write(WIMStruct *wim, int image, + int write_flags, + struct list_head *blob_list_ret, + struct list_head *blob_table_list_ret, + struct filter_context *filter_ctx_ret) +{ + int ret; + struct blob_descriptor *blob; + + filter_ctx_ret->write_flags = write_flags; + filter_ctx_ret->wim = wim; + + ret = prepare_unfiltered_list_of_blobs_in_output_wim( + wim, + image, + write_flags & WIMLIB_WRITE_FLAG_STREAMS_OK, + blob_list_ret); + if (ret) + return ret; + + INIT_LIST_HEAD(blob_table_list_ret); + list_for_each_entry(blob, blob_list_ret, write_blobs_list) + list_add_tail(&blob->blob_table_list, blob_table_list_ret); + + ret = determine_blob_size_uniquity(blob_list_ret, wim->blob_table, + filter_ctx_ret); + if (ret) + return ret; + + if (may_filter_blobs(filter_ctx_ret)) + filter_blob_list_for_write(blob_list_ret, filter_ctx_ret); + + return 0; +} + +static int +write_file_data(WIMStruct *wim, int image, int write_flags, + unsigned num_threads, + struct list_head *blob_list_override, + struct list_head *blob_table_list_ret) +{ + int ret; + struct list_head _blob_list; + struct list_head *blob_list; + struct blob_descriptor *blob; + struct filter_context _filter_ctx; + struct filter_context *filter_ctx; + + if (blob_list_override == NULL) { + /* Normal case: prepare blob list from image(s) being written. + */ + blob_list = &_blob_list; + filter_ctx = &_filter_ctx; + ret = prepare_blob_list_for_write(wim, image, write_flags, + blob_list, + blob_table_list_ret, + filter_ctx); + if (ret) + return ret; + } else { + /* Currently only as a result of wimlib_split() being called: + * use blob list already explicitly provided. Use existing + * reference counts. */ + blob_list = blob_list_override; + filter_ctx = NULL; + INIT_LIST_HEAD(blob_table_list_ret); + list_for_each_entry(blob, blob_list, write_blobs_list) { + blob->out_refcnt = blob->refcnt; + blob->will_be_in_output_wim = 1; + blob->unique_size = 0; + list_add_tail(&blob->blob_table_list, blob_table_list_ret); + } + } + + return write_file_data_blobs(wim, + blob_list, + write_flags, + num_threads, + filter_ctx); +} + +static int +write_metadata_resources(WIMStruct *wim, int image, int write_flags) +{ + int ret; + int start_image; + int end_image; + int write_resource_flags; + + if (write_flags & WIMLIB_WRITE_FLAG_NO_METADATA) + return 0; + + write_resource_flags = write_flags_to_resource_flags(write_flags); + + write_resource_flags &= ~WRITE_RESOURCE_FLAG_SOLID; + + ret = call_progress(wim->progfunc, + WIMLIB_PROGRESS_MSG_WRITE_METADATA_BEGIN, + NULL, wim->progctx); + if (ret) + return ret; + + if (image == WIMLIB_ALL_IMAGES) { + start_image = 1; + end_image = wim->hdr.image_count; + } else { + start_image = image; + end_image = image; + } + + for (int i = start_image; i <= end_image; i++) { + struct wim_image_metadata *imd; + + imd = wim->image_metadata[i - 1]; + if (is_image_dirty(imd)) { + /* The image was modified from the original, or was + * newly added, so we have to build and write a new + * metadata resource. */ + ret = write_metadata_resource(wim, i, + write_resource_flags); + } else if (is_image_unchanged_from_wim(imd, wim) && + (write_flags & (WIMLIB_WRITE_FLAG_UNSAFE_COMPACT | + WIMLIB_WRITE_FLAG_APPEND))) + { + /* The metadata resource is already in the WIM file. + * For appends, we don't need to write it at all. For + * compactions, we re-write existing metadata resources + * along with the existing file resources, not here. */ + if (write_flags & WIMLIB_WRITE_FLAG_APPEND) + blob_set_out_reshdr_for_reuse(imd->metadata_blob); + ret = 0; + } else { + /* The metadata resource is in a WIM file other than the + * one being written to. We need to rewrite it, + * possibly compressed differently; but rebuilding the + * metadata itself isn't necessary. */ + ret = write_wim_resource(imd->metadata_blob, + &wim->out_fd, + wim->out_compression_type, + wim->out_chunk_size, + write_resource_flags); + } + if (ret) + return ret; + } + + return call_progress(wim->progfunc, + WIMLIB_PROGRESS_MSG_WRITE_METADATA_END, + NULL, wim->progctx); +} + +static int +open_wim_writable(WIMStruct *wim, const tchar *path, int open_flags) +{ + int raw_fd = topen(path, open_flags | O_BINARY, 0644); + if (raw_fd < 0) { + ERROR_WITH_ERRNO("Failed to open \"%"TS"\" for writing", path); + return WIMLIB_ERR_OPEN; + } + filedes_init(&wim->out_fd, raw_fd); + return 0; +} + +static int +close_wim_writable(WIMStruct *wim, int write_flags) +{ + int ret = 0; + + if (!(write_flags & WIMLIB_WRITE_FLAG_FILE_DESCRIPTOR)) + if (filedes_valid(&wim->out_fd)) + if (filedes_close(&wim->out_fd)) + ret = WIMLIB_ERR_WRITE; + filedes_invalidate(&wim->out_fd); + return ret; +} + +static int +cmp_blobs_by_out_rdesc(const void *p1, const void *p2) +{ + const struct blob_descriptor *blob1, *blob2; + + blob1 = *(const struct blob_descriptor**)p1; + blob2 = *(const struct blob_descriptor**)p2; + + if (blob1->out_reshdr.flags & WIM_RESHDR_FLAG_SOLID) { + if (blob2->out_reshdr.flags & WIM_RESHDR_FLAG_SOLID) { + if (blob1->out_res_offset_in_wim != blob2->out_res_offset_in_wim) + return cmp_u64(blob1->out_res_offset_in_wim, + blob2->out_res_offset_in_wim); + } else { + return 1; + } + } else { + if (blob2->out_reshdr.flags & WIM_RESHDR_FLAG_SOLID) + return -1; + } + return cmp_u64(blob1->out_reshdr.offset_in_wim, + blob2->out_reshdr.offset_in_wim); +} + +static int +write_blob_table(WIMStruct *wim, int image, int write_flags, + struct list_head *blob_table_list) +{ + int ret; + + /* Set output resource metadata for blobs already present in WIM. */ + if (write_flags & WIMLIB_WRITE_FLAG_APPEND) { + struct blob_descriptor *blob; + list_for_each_entry(blob, blob_table_list, blob_table_list) { + if (blob->blob_location == BLOB_IN_WIM && + blob->rdesc->wim == wim) + { + blob_set_out_reshdr_for_reuse(blob); + } + } + } + + ret = sort_blob_list(blob_table_list, + offsetof(struct blob_descriptor, blob_table_list), + cmp_blobs_by_out_rdesc); + if (ret) + return ret; + + /* Add entries for metadata resources. */ + if (!(write_flags & WIMLIB_WRITE_FLAG_NO_METADATA)) { + int start_image; + int end_image; + + if (image == WIMLIB_ALL_IMAGES) { + start_image = 1; + end_image = wim->hdr.image_count; + } else { + start_image = image; + end_image = image; + } + + /* Push metadata blob table entries onto the front of the list + * in reverse order, so that they're written in order. + */ + for (int i = end_image; i >= start_image; i--) { + struct blob_descriptor *metadata_blob; + + metadata_blob = wim->image_metadata[i - 1]->metadata_blob; + wimlib_assert(metadata_blob->out_reshdr.flags & WIM_RESHDR_FLAG_METADATA); + metadata_blob->out_refcnt = 1; + list_add(&metadata_blob->blob_table_list, blob_table_list); + } + } + + return write_blob_table_from_blob_list(blob_table_list, + &wim->out_fd, + wim->out_hdr.part_number, + &wim->out_hdr.blob_table_reshdr, + write_flags_to_resource_flags(write_flags)); +} + +/* + * Finish writing a WIM file: write the blob table, xml data, and integrity + * table, then overwrite the WIM header. + * + * The output file descriptor is closed on success, except when writing to a + * user-specified file descriptor (WIMLIB_WRITE_FLAG_FILE_DESCRIPTOR set). + */ +static int +finish_write(WIMStruct *wim, int image, int write_flags, + struct list_head *blob_table_list) +{ + int write_resource_flags; + off_t old_blob_table_end = 0; + struct integrity_table *old_integrity_table = NULL; + off_t new_blob_table_end; + u64 xml_totalbytes; + int ret; + + write_resource_flags = write_flags_to_resource_flags(write_flags); + + /* In the WIM header, there is room for the resource entry for a + * metadata resource labeled as the "boot metadata". This entry should + * be zeroed out if there is no bootable image (boot_idx 0). Otherwise, + * it should be a copy of the resource entry for the image that is + * marked as bootable. */ + if (wim->out_hdr.boot_idx == 0) { + zero_reshdr(&wim->out_hdr.boot_metadata_reshdr); + } else { + copy_reshdr(&wim->out_hdr.boot_metadata_reshdr, + &wim->image_metadata[ + wim->out_hdr.boot_idx - 1]->metadata_blob->out_reshdr); + } + + /* If appending to a WIM file containing an integrity table, we'd like + * to re-use the information in the old integrity table instead of + * recalculating it. But we might overwrite the old integrity table + * when we expand the XML data. Read it into memory just in case. */ + if ((write_flags & (WIMLIB_WRITE_FLAG_APPEND | + WIMLIB_WRITE_FLAG_CHECK_INTEGRITY)) == + (WIMLIB_WRITE_FLAG_APPEND | + WIMLIB_WRITE_FLAG_CHECK_INTEGRITY) + && wim_has_integrity_table(wim)) + { + old_blob_table_end = wim->hdr.blob_table_reshdr.offset_in_wim + + wim->hdr.blob_table_reshdr.size_in_wim; + (void)read_integrity_table(wim, + old_blob_table_end - WIM_HEADER_DISK_SIZE, + &old_integrity_table); + /* If we couldn't read the old integrity table, we can still + * re-calculate the full integrity table ourselves. Hence the + * ignoring of the return value. */ + } + + /* Write blob table if needed. */ + if (!(write_flags & WIMLIB_WRITE_FLAG_NO_NEW_BLOBS)) { + ret = write_blob_table(wim, image, write_flags, + blob_table_list); + if (ret) + goto out; + } + + /* Write XML data. */ + xml_totalbytes = wim->out_fd.offset; + if (write_flags & WIMLIB_WRITE_FLAG_USE_EXISTING_TOTALBYTES) + xml_totalbytes = WIM_TOTALBYTES_USE_EXISTING; + ret = write_wim_xml_data(wim, image, xml_totalbytes, + &wim->out_hdr.xml_data_reshdr, + write_resource_flags); + if (ret) + goto out; + + /* Write integrity table if needed. */ + if ((write_flags & WIMLIB_WRITE_FLAG_CHECK_INTEGRITY) && + wim->out_hdr.blob_table_reshdr.offset_in_wim != 0) + { + if (write_flags & WIMLIB_WRITE_FLAG_NO_NEW_BLOBS) { + /* The XML data we wrote may have overwritten part of + * the old integrity table, so while calculating the new + * integrity table we should temporarily update the WIM + * header to remove the integrity table reference. */ + struct wim_header checkpoint_hdr; + memcpy(&checkpoint_hdr, &wim->out_hdr, sizeof(struct wim_header)); + zero_reshdr(&checkpoint_hdr.integrity_table_reshdr); + checkpoint_hdr.flags |= WIM_HDR_FLAG_WRITE_IN_PROGRESS; + ret = write_wim_header(&checkpoint_hdr, &wim->out_fd, 0); + if (ret) + goto out; + } + + new_blob_table_end = wim->out_hdr.blob_table_reshdr.offset_in_wim + + wim->out_hdr.blob_table_reshdr.size_in_wim; + + ret = write_integrity_table(wim, + new_blob_table_end, + old_blob_table_end, + old_integrity_table); + if (ret) + goto out; + } else { + /* No integrity table. */ + zero_reshdr(&wim->out_hdr.integrity_table_reshdr); + } + + /* Now that all information in the WIM header has been determined, the + * preliminary header written earlier can be overwritten, the header of + * the existing WIM file can be overwritten, or the final header can be + * written to the end of the pipable WIM. */ + wim->out_hdr.flags &= ~WIM_HDR_FLAG_WRITE_IN_PROGRESS; + if (write_flags & WIMLIB_WRITE_FLAG_PIPABLE) + ret = write_wim_header(&wim->out_hdr, &wim->out_fd, wim->out_fd.offset); + else + ret = write_wim_header(&wim->out_hdr, &wim->out_fd, 0); + if (ret) + goto out; + + ret = WIMLIB_ERR_WRITE; + if (unlikely(write_flags & WIMLIB_WRITE_FLAG_UNSAFE_COMPACT)) { + /* Truncate any data the compaction freed up. */ + if (ftruncate(wim->out_fd.fd, wim->out_fd.offset) && + errno != EINVAL) /* allow compaction on untruncatable files, + e.g. block devices */ + { + ERROR_WITH_ERRNO("Failed to truncate the output WIM file"); + goto out; + } + } + + /* Possibly sync file data to disk before closing. On POSIX systems, it + * is necessary to do this before using rename() to overwrite an + * existing file with a new file. Otherwise, data loss would occur if + * the system is abruptly terminated when the metadata for the rename + * operation has been written to disk, but the new file data has not. + */ + ret = WIMLIB_ERR_WRITE; + if (write_flags & WIMLIB_WRITE_FLAG_FSYNC) { + if (fsync(wim->out_fd.fd)) { + ERROR_WITH_ERRNO("Error syncing data to WIM file"); + goto out; + } + } + + ret = WIMLIB_ERR_WRITE; + if (close_wim_writable(wim, write_flags)) { + ERROR_WITH_ERRNO("Failed to close the output WIM file"); + goto out; + } + + ret = 0; +out: + free_integrity_table(old_integrity_table); + return ret; +} + +#if defined(HAVE_SYS_FILE_H) && defined(HAVE_FLOCK) + +/* Set advisory lock on WIM file (if not already done so) */ +int +lock_wim_for_append(WIMStruct *wim) +{ + if (wim->locked_for_append) + return 0; + if (!flock(wim->in_fd.fd, LOCK_EX | LOCK_NB)) { + wim->locked_for_append = 1; + return 0; + } + if (errno != EWOULDBLOCK) + return 0; + return WIMLIB_ERR_ALREADY_LOCKED; +} + +/* Remove advisory lock on WIM file (if present) */ +void +unlock_wim_for_append(WIMStruct *wim) +{ + if (wim->locked_for_append) { + flock(wim->in_fd.fd, LOCK_UN); + wim->locked_for_append = 0; + } +} +#endif + +/* + * write_pipable_wim(): + * + * Perform the intermediate stages of creating a "pipable" WIM (i.e. a WIM + * capable of being applied from a pipe). + * + * Pipable WIMs are a wimlib-specific modification of the WIM format such that + * images can be applied from them sequentially when the file data is sent over + * a pipe. In addition, a pipable WIM can be written sequentially to a pipe. + * The modifications made to the WIM format for pipable WIMs are: + * + * - Magic characters in header are "WLPWM\0\0\0" (wimlib pipable WIM) instead + * of "MSWIM\0\0\0". This lets wimlib know that the WIM is pipable and also + * stops other software from trying to read the file as a normal WIM. + * + * - The header at the beginning of the file does not contain all the normal + * information; in particular it will have all 0's for the blob table and XML + * data resource entries. This is because this information cannot be + * determined until the blob table and XML data have been written. + * Consequently, wimlib will write the full header at the very end of the + * file. The header at the end, however, is only used when reading the WIM + * from a seekable file (not a pipe). + * + * - An extra copy of the XML data is placed directly after the header. This + * allows image names and sizes to be determined at an appropriate time when + * reading the WIM from a pipe. This copy of the XML data is ignored if the + * WIM is read from a seekable file (not a pipe). + * + * - Solid resources are not allowed. Each blob is always stored in its own + * resource. + * + * - The format of resources, or blobs, has been modified to allow them to be + * used before the "blob table" has been read. Each blob is prefixed with a + * `struct pwm_blob_hdr' that is basically an abbreviated form of `struct + * blob_descriptor_disk' that only contains the SHA-1 message digest, + * uncompressed blob size, and flags that indicate whether the blob is + * compressed. The data of uncompressed blobs then follows literally, while + * the data of compressed blobs follows in a modified format. Compressed + * blobs do not begin with a chunk table, since the chunk table cannot be + * written until all chunks have been compressed. Instead, each compressed + * chunk is prefixed by a `struct pwm_chunk_hdr' that gives its size. + * Furthermore, the chunk table is written at the end of the resource instead + * of the start. Note: chunk offsets are given in the chunk table as if the + * `struct pwm_chunk_hdr's were not present; also, the chunk table is only + * used if the WIM is being read from a seekable file (not a pipe). + * + * - Metadata blobs always come before non-metadata blobs. (This does not by + * itself constitute an incompatibility with normal WIMs, since this is valid + * in normal WIMs.) + * + * - At least up to the end of the blobs, all components must be packed as + * tightly as possible; there cannot be any "holes" in the WIM. (This does + * not by itself consititute an incompatibility with normal WIMs, since this + * is valid in normal WIMs.) + * + * Note: the blob table, XML data, and header at the end are not used when + * applying from a pipe. They exist to support functionality such as image + * application and export when the WIM is *not* read from a pipe. + * + * Layout of pipable WIM: + * + * ---------+----------+--------------------+----------------+--------------+-----------+--------+ + * | Header | XML data | Metadata resources | File resources | Blob table | XML data | Header | + * ---------+----------+--------------------+----------------+--------------+-----------+--------+ + * + * Layout of normal WIM: + * + * +--------+-----------------------------+-------------------------+ + * | Header | File and metadata resources | Blob table | XML data | + * +--------+-----------------------------+-------------------------+ + * + * An optional integrity table can follow the final XML data in both normal and + * pipable WIMs. However, due to implementation details, wimlib currently can + * only include an integrity table in a pipable WIM when writing it to a + * seekable file (not a pipe). + * + * Do note that since pipable WIMs are not supported by Microsoft's software, + * wimlib does not create them unless explicitly requested (with + * WIMLIB_WRITE_FLAG_PIPABLE) and as stated above they use different magic + * characters to identify the file. + */ +static int +write_pipable_wim(WIMStruct *wim, int image, int write_flags, + unsigned num_threads, + struct list_head *blob_list_override, + struct list_head *blob_table_list_ret) +{ + int ret; + struct wim_reshdr xml_reshdr; + + WARNING("Creating a pipable WIM, which will " + "be incompatible\n" + " with Microsoft's software (WIMGAPI/ImageX/DISM)."); + + /* At this point, the header at the beginning of the file has already + * been written. */ + + /* + * For efficiency, wimlib normally delays calculating each newly added + * stream's hash until while that stream being written, or just before + * it is written. However, when writing a pipable WIM (potentially to a + * pipe), we first have to write the metadata resources, which contain + * all the hashes. Moreover each blob is prefixed with its hash (struct + * pwm_blob_hdr). Thus, we have to calculate all the hashes before + * writing anything. + */ + ret = wim_checksum_unhashed_blobs(wim); + if (ret) + return ret; + + /* Write extra copy of the XML data. */ + ret = write_wim_xml_data(wim, image, WIM_TOTALBYTES_OMIT, + &xml_reshdr, WRITE_RESOURCE_FLAG_PIPABLE); + if (ret) + return ret; + + /* Write metadata resources for the image(s) being included in the + * output WIM. */ + ret = write_metadata_resources(wim, image, write_flags); + if (ret) + return ret; + + /* Write file data needed for the image(s) being included in the output + * WIM, or file data needed for the split WIM part. */ + return write_file_data(wim, image, write_flags, + num_threads, blob_list_override, + blob_table_list_ret); + + /* The blob table, XML data, and header at end are handled by + * finish_write(). */ +} + +static bool +should_default_to_solid_compression(WIMStruct *wim, int write_flags) +{ + return wim->out_hdr.wim_version == WIM_VERSION_SOLID && + !(write_flags & (WIMLIB_WRITE_FLAG_SOLID | + WIMLIB_WRITE_FLAG_PIPABLE)) && + wim_has_solid_resources(wim); +} + +/* Update the images' filecount/bytecount stats (in the XML info) to take into + * account any recent modifications. */ +static int +update_image_stats(WIMStruct *wim) +{ + if (!wim_has_metadata(wim)) + return 0; + for (int i = 0; i < wim->hdr.image_count; i++) { + struct wim_image_metadata *imd = wim->image_metadata[i]; + if (imd->stats_outdated) { + int ret = xml_update_image_info(wim, i + 1); + if (ret) + return ret; + imd->stats_outdated = false; + } + } + return 0; +} + +/* Write a standalone WIM or split WIM (SWM) part to a new file or to a file + * descriptor. */ +int +write_wim_part(WIMStruct *wim, + const void *path_or_fd, + int image, + int write_flags, + unsigned num_threads, + unsigned part_number, + unsigned total_parts, + struct list_head *blob_list_override, + const u8 *guid) +{ + int ret; + struct list_head blob_table_list; + + /* Internally, this is always called with a valid part number and total + * parts. */ + wimlib_assert(total_parts >= 1); + wimlib_assert(part_number >= 1 && part_number <= total_parts); + + /* A valid image (or all images) must be specified. */ + if (image != WIMLIB_ALL_IMAGES && + (image < 1 || image > wim->hdr.image_count)) + return WIMLIB_ERR_INVALID_IMAGE; + + /* If we need to write metadata resources, make sure the ::WIMStruct has + * the needed information attached (e.g. is not a resource-only WIM, + * such as a non-first part of a split WIM). */ + if (!wim_has_metadata(wim) && + !(write_flags & WIMLIB_WRITE_FLAG_NO_METADATA)) + return WIMLIB_ERR_METADATA_NOT_FOUND; + + /* Check for contradictory flags. */ + if ((write_flags & (WIMLIB_WRITE_FLAG_CHECK_INTEGRITY | + WIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY)) + == (WIMLIB_WRITE_FLAG_CHECK_INTEGRITY | + WIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY)) + return WIMLIB_ERR_INVALID_PARAM; + + if ((write_flags & (WIMLIB_WRITE_FLAG_PIPABLE | + WIMLIB_WRITE_FLAG_NOT_PIPABLE)) + == (WIMLIB_WRITE_FLAG_PIPABLE | + WIMLIB_WRITE_FLAG_NOT_PIPABLE)) + return WIMLIB_ERR_INVALID_PARAM; + + /* Only wimlib_overwrite() accepts UNSAFE_COMPACT. */ + if (write_flags & WIMLIB_WRITE_FLAG_UNSAFE_COMPACT) + return WIMLIB_ERR_INVALID_PARAM; + + /* Include an integrity table by default if no preference was given and + * the WIM already had an integrity table. */ + if (!(write_flags & (WIMLIB_WRITE_FLAG_CHECK_INTEGRITY | + WIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY))) { + if (wim_has_integrity_table(wim)) + write_flags |= WIMLIB_WRITE_FLAG_CHECK_INTEGRITY; + } + + /* Write a pipable WIM by default if no preference was given and the WIM + * was already pipable. */ + if (!(write_flags & (WIMLIB_WRITE_FLAG_PIPABLE | + WIMLIB_WRITE_FLAG_NOT_PIPABLE))) { + if (wim_is_pipable(wim)) + write_flags |= WIMLIB_WRITE_FLAG_PIPABLE; + } + + if ((write_flags & (WIMLIB_WRITE_FLAG_PIPABLE | + WIMLIB_WRITE_FLAG_SOLID)) + == (WIMLIB_WRITE_FLAG_PIPABLE | + WIMLIB_WRITE_FLAG_SOLID)) + { + ERROR("Solid compression is unsupported in pipable WIMs"); + return WIMLIB_ERR_INVALID_PARAM; + } + + /* Start initializing the new file header. */ + memset(&wim->out_hdr, 0, sizeof(wim->out_hdr)); + + /* Set the magic number. */ + if (write_flags & WIMLIB_WRITE_FLAG_PIPABLE) + wim->out_hdr.magic = PWM_MAGIC; + else + wim->out_hdr.magic = WIM_MAGIC; + + /* Set the version number. */ + if ((write_flags & WIMLIB_WRITE_FLAG_SOLID) || + wim->out_compression_type == WIMLIB_COMPRESSION_TYPE_LZMS) + wim->out_hdr.wim_version = WIM_VERSION_SOLID; + else + wim->out_hdr.wim_version = WIM_VERSION_DEFAULT; + + /* Default to solid compression if it is valid in the chosen WIM file + * format and the WIMStruct references any solid resources. This is + * useful when exporting an image from a solid WIM. */ + if (should_default_to_solid_compression(wim, write_flags)) + write_flags |= WIMLIB_WRITE_FLAG_SOLID; + + /* Set the header flags. */ + wim->out_hdr.flags = (wim->hdr.flags & (WIM_HDR_FLAG_RP_FIX | + WIM_HDR_FLAG_READONLY)); + if (total_parts != 1) + wim->out_hdr.flags |= WIM_HDR_FLAG_SPANNED; + if (wim->out_compression_type != WIMLIB_COMPRESSION_TYPE_NONE) { + wim->out_hdr.flags |= WIM_HDR_FLAG_COMPRESSION; + switch (wim->out_compression_type) { + case WIMLIB_COMPRESSION_TYPE_XPRESS: + wim->out_hdr.flags |= WIM_HDR_FLAG_COMPRESS_XPRESS; + break; + case WIMLIB_COMPRESSION_TYPE_LZX: + wim->out_hdr.flags |= WIM_HDR_FLAG_COMPRESS_LZX; + break; + case WIMLIB_COMPRESSION_TYPE_LZMS: + wim->out_hdr.flags |= WIM_HDR_FLAG_COMPRESS_LZMS; + break; + } + } + + /* Set the chunk size. */ + wim->out_hdr.chunk_size = wim->out_chunk_size; + + /* Set the GUID. */ + if (write_flags & WIMLIB_WRITE_FLAG_RETAIN_GUID) + guid = wim->hdr.guid; + if (guid) + copy_guid(wim->out_hdr.guid, guid); + else + generate_guid(wim->out_hdr.guid); + + /* Set the part number and total parts. */ + wim->out_hdr.part_number = part_number; + wim->out_hdr.total_parts = total_parts; + + /* Set the image count. */ + if (image == WIMLIB_ALL_IMAGES) + wim->out_hdr.image_count = wim->hdr.image_count; + else + wim->out_hdr.image_count = 1; + + /* Set the boot index. */ + wim->out_hdr.boot_idx = 0; + if (total_parts == 1) { + if (image == WIMLIB_ALL_IMAGES) + wim->out_hdr.boot_idx = wim->hdr.boot_idx; + else if (image == wim->hdr.boot_idx) + wim->out_hdr.boot_idx = 1; + } + + /* Update image stats if needed. */ + ret = update_image_stats(wim); + if (ret) + return ret; + + /* Set up the output file descriptor. */ + if (write_flags & WIMLIB_WRITE_FLAG_FILE_DESCRIPTOR) { + /* File descriptor was explicitly provided. */ + filedes_init(&wim->out_fd, *(const int *)path_or_fd); + if (!filedes_is_seekable(&wim->out_fd)) { + /* The file descriptor is a pipe. */ + ret = WIMLIB_ERR_INVALID_PARAM; + if (!(write_flags & WIMLIB_WRITE_FLAG_PIPABLE)) + goto out_cleanup; + if (write_flags & WIMLIB_WRITE_FLAG_CHECK_INTEGRITY) { + ERROR("Can't include integrity check when " + "writing pipable WIM to pipe!"); + goto out_cleanup; + } + } + } else { + /* Filename of WIM to write was provided; open file descriptor + * to it. */ + ret = open_wim_writable(wim, (const tchar*)path_or_fd, + O_TRUNC | O_CREAT | O_RDWR); + if (ret) + goto out_cleanup; + } + + /* Write initial header. This is merely a "dummy" header since it + * doesn't have resource entries filled in yet, so it will be + * overwritten later (unless writing a pipable WIM). */ + if (!(write_flags & WIMLIB_WRITE_FLAG_PIPABLE)) + wim->out_hdr.flags |= WIM_HDR_FLAG_WRITE_IN_PROGRESS; + ret = write_wim_header(&wim->out_hdr, &wim->out_fd, wim->out_fd.offset); + wim->out_hdr.flags &= ~WIM_HDR_FLAG_WRITE_IN_PROGRESS; + if (ret) + goto out_cleanup; + + /* Write file data and metadata resources. */ + if (!(write_flags & WIMLIB_WRITE_FLAG_PIPABLE)) { + /* Default case: create a normal (non-pipable) WIM. */ + ret = write_file_data(wim, image, write_flags, + num_threads, + blob_list_override, + &blob_table_list); + if (ret) + goto out_cleanup; + + ret = write_metadata_resources(wim, image, write_flags); + if (ret) + goto out_cleanup; + } else { + /* Non-default case: create pipable WIM. */ + ret = write_pipable_wim(wim, image, write_flags, num_threads, + blob_list_override, + &blob_table_list); + if (ret) + goto out_cleanup; + } + + /* Write blob table, XML data, and (optional) integrity table. */ + ret = finish_write(wim, image, write_flags, &blob_table_list); +out_cleanup: + (void)close_wim_writable(wim, write_flags); + return ret; +} + +/* Write a standalone WIM to a file or file descriptor. */ +static int +write_standalone_wim(WIMStruct *wim, const void *path_or_fd, + int image, int write_flags, unsigned num_threads) +{ + return write_wim_part(wim, path_or_fd, image, write_flags, + num_threads, 1, 1, NULL, NULL); +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_write(WIMStruct *wim, const tchar *path, + int image, int write_flags, unsigned num_threads) +{ + if (write_flags & ~WIMLIB_WRITE_MASK_PUBLIC) + return WIMLIB_ERR_INVALID_PARAM; + + if (path == NULL || path[0] == T('\0')) + return WIMLIB_ERR_INVALID_PARAM; + + return write_standalone_wim(wim, path, image, write_flags, num_threads); +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_write_to_fd(WIMStruct *wim, int fd, + int image, int write_flags, unsigned num_threads) +{ + if (write_flags & ~WIMLIB_WRITE_MASK_PUBLIC) + return WIMLIB_ERR_INVALID_PARAM; + + if (fd < 0) + return WIMLIB_ERR_INVALID_PARAM; + + write_flags |= WIMLIB_WRITE_FLAG_FILE_DESCRIPTOR; + + return write_standalone_wim(wim, &fd, image, write_flags, num_threads); +} + +/* Have there been any changes to images in the specified WIM, including updates + * as well as deletions and additions of entire images, but excluding changes to + * the XML document? */ +static bool +any_images_changed(WIMStruct *wim) +{ + if (wim->image_deletion_occurred) + return true; + for (int i = 0; i < wim->hdr.image_count; i++) + if (!is_image_unchanged_from_wim(wim->image_metadata[i], wim)) + return true; + return false; +} + +static int +check_resource_offset(struct blob_descriptor *blob, void *_wim) +{ + const WIMStruct *wim = _wim; + off_t end_offset = *(const off_t*)wim->private; + + if (blob->blob_location == BLOB_IN_WIM && + blob->rdesc->wim == wim && + blob->rdesc->offset_in_wim + blob->rdesc->size_in_wim > end_offset) + return WIMLIB_ERR_RESOURCE_ORDER; + return 0; +} + +/* Make sure no file or metadata resources are located after the XML data (or + * integrity table if present)--- otherwise we can't safely append to the WIM + * file and we return WIMLIB_ERR_RESOURCE_ORDER. */ +static int +check_resource_offsets(WIMStruct *wim, off_t end_offset) +{ + int ret; + unsigned i; + + wim->private = &end_offset; + ret = for_blob_in_table(wim->blob_table, check_resource_offset, wim); + if (ret) + return ret; + + for (i = 0; i < wim->hdr.image_count; i++) { + ret = check_resource_offset(wim->image_metadata[i]->metadata_blob, wim); + if (ret) + return ret; + } + return 0; +} + +static int +free_blob_if_invalidated(struct blob_descriptor *blob, void *_wim) +{ + const WIMStruct *wim = _wim; + + if (!blob->will_be_in_output_wim && + blob->blob_location == BLOB_IN_WIM && blob->rdesc->wim == wim) + { + blob_table_unlink(wim->blob_table, blob); + free_blob_descriptor(blob); + } + return 0; +} + +/* + * Overwrite a WIM, possibly appending new resources to it. + * + * A WIM looks like (or is supposed to look like) the following: + * + * Header (212 bytes) + * Resources for metadata and files (variable size) + * Blob table (variable size) + * XML data (variable size) + * Integrity table (optional) (variable size) + * + * If we are not adding any new files or metadata, then the blob table is + * unchanged--- so we only need to overwrite the XML data, integrity table, and + * header. This operation is potentially unsafe if the program is abruptly + * terminated while the XML data or integrity table are being overwritten, but + * before the new header has been written. To partially alleviate this problem, + * we write a temporary header after the XML data has been written. This may + * prevent the WIM from becoming corrupted if the program is terminated while + * the integrity table is being calculated (but no guarantees, due to write + * re-ordering...). + * + * If we are adding new blobs, including new file data as well as any metadata + * for any new images, then the blob table needs to be changed, and those blobs + * need to be written. In this case, we try to perform a safe update of the WIM + * file by writing the blobs *after* the end of the previous WIM, then writing + * the new blob table, XML data, and (optionally) integrity table following the + * new blobs. This will produce a layout like the following: + * + * Header (212 bytes) + * (OLD) Resources for metadata and files (variable size) + * (OLD) Blob table (variable size) + * (OLD) XML data (variable size) + * (OLD) Integrity table (optional) (variable size) + * (NEW) Resources for metadata and files (variable size) + * (NEW) Blob table (variable size) + * (NEW) XML data (variable size) + * (NEW) Integrity table (optional) (variable size) + * + * At all points, the WIM is valid as nothing points to the new data yet. Then, + * the header is overwritten to point to the new blob table, XML data, and + * integrity table, to produce the following layout: + * + * Header (212 bytes) + * Resources for metadata and files (variable size) + * Nothing (variable size) + * Resources for metadata and files (variable size) + * Blob table (variable size) + * XML data (variable size) + * Integrity table (optional) (variable size) + * + * This function allows an image to be appended to a large WIM very quickly, and + * is crash-safe except in the case of write re-ordering, but the disadvantage + * is that a small hole is left in the WIM where the old blob table, xml data, + * and integrity table were. (These usually only take up a small amount of + * space compared to the blobs, however.) + * + * Finally, this function also supports "compaction" overwrites as an + * alternative to the normal "append" overwrites described above. In a + * compaction, data is written starting immediately from the end of the header. + * All existing resources are written first, in order by file offset. New + * resources are written afterwards, and at the end any extra data is truncated + * from the file. The advantage of this approach is that is that the WIM file + * ends up fully optimized, without any holes remaining. The main disadavantage + * is that this operation is fundamentally unsafe and cannot be interrupted + * without data corruption. Consequently, compactions are only ever done when + * explicitly requested by the library user with the flag + * WIMLIB_WRITE_FLAG_UNSAFE_COMPACT. (Another disadvantage is that a compaction + * can be much slower than an append.) + */ +static int +overwrite_wim_inplace(WIMStruct *wim, int write_flags, unsigned num_threads) +{ + int ret; + off_t old_wim_end; + struct list_head blob_list; + struct list_head blob_table_list; + struct filter_context filter_ctx; + + /* Include an integrity table by default if no preference was given and + * the WIM already had an integrity table. */ + if (!(write_flags & (WIMLIB_WRITE_FLAG_CHECK_INTEGRITY | + WIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY))) + if (wim_has_integrity_table(wim)) + write_flags |= WIMLIB_WRITE_FLAG_CHECK_INTEGRITY; + + /* Start preparing the updated file header. */ + memcpy(&wim->out_hdr, &wim->hdr, sizeof(wim->out_hdr)); + + /* If using solid compression, the version number must be set to + * WIM_VERSION_SOLID. */ + if (write_flags & WIMLIB_WRITE_FLAG_SOLID) + wim->out_hdr.wim_version = WIM_VERSION_SOLID; + + /* Default to solid compression if it is valid in the chosen WIM file + * format and the WIMStruct references any solid resources. This is + * useful when updating a solid WIM. */ + if (should_default_to_solid_compression(wim, write_flags)) + write_flags |= WIMLIB_WRITE_FLAG_SOLID; + + if (unlikely(write_flags & WIMLIB_WRITE_FLAG_UNSAFE_COMPACT)) { + + /* In-place compaction */ + + WARNING("The WIM file \"%"TS"\" is being compacted in place.\n" + " Do *not* interrupt the operation, or else " + "the WIM file will be\n" + " corrupted!", wim->filename); + wim->being_compacted = 1; + old_wim_end = WIM_HEADER_DISK_SIZE; + + ret = prepare_blob_list_for_write(wim, WIMLIB_ALL_IMAGES, + write_flags, &blob_list, + &blob_table_list, &filter_ctx); + if (ret) + goto out; + + /* Prevent new files from being deduplicated with existing blobs + * in the WIM that we haven't decided to write. Such blobs will + * be overwritten during the compaction. */ + for_blob_in_table(wim->blob_table, free_blob_if_invalidated, wim); + + if (wim_has_metadata(wim)) { + /* Add existing metadata resources to be compacted along + * with the file resources. */ + for (int i = 0; i < wim->hdr.image_count; i++) { + struct wim_image_metadata *imd = wim->image_metadata[i]; + if (is_image_unchanged_from_wim(imd, wim)) { + fully_reference_blob_for_write(imd->metadata_blob, + &blob_list); + } + } + } + } else { + u64 old_blob_table_end, old_xml_begin, old_xml_end; + + /* Set additional flags for append. */ + write_flags |= WIMLIB_WRITE_FLAG_APPEND | + WIMLIB_WRITE_FLAG_STREAMS_OK; + + /* Make sure there is no data after the XML data, except + * possibily an integrity table. If this were the case, then + * this data would be overwritten. */ + old_xml_begin = wim->hdr.xml_data_reshdr.offset_in_wim; + old_xml_end = old_xml_begin + wim->hdr.xml_data_reshdr.size_in_wim; + if (wim->hdr.blob_table_reshdr.offset_in_wim == 0) + old_blob_table_end = WIM_HEADER_DISK_SIZE; + else + old_blob_table_end = wim->hdr.blob_table_reshdr.offset_in_wim + + wim->hdr.blob_table_reshdr.size_in_wim; + if (wim_has_integrity_table(wim) && + wim->hdr.integrity_table_reshdr.offset_in_wim < old_xml_end) { + WARNING("Didn't expect the integrity table to be " + "before the XML data"); + ret = WIMLIB_ERR_RESOURCE_ORDER; + goto out; + } + + if (old_blob_table_end > old_xml_begin) { + WARNING("Didn't expect the blob table to be after " + "the XML data"); + ret = WIMLIB_ERR_RESOURCE_ORDER; + goto out; + } + /* Set @old_wim_end, which indicates the point beyond which we + * don't allow any file and metadata resources to appear without + * returning WIMLIB_ERR_RESOURCE_ORDER (due to the fact that we + * would otherwise overwrite these resources). */ + if (!any_images_changed(wim)) { + /* If no images have been modified, added, or deleted, + * then a new blob table does not need to be written. + * We shall write the new XML data and optional + * integrity table immediately after the blob table. + * Note that this may overwrite an existing integrity + * table. */ + old_wim_end = old_blob_table_end; + write_flags |= WIMLIB_WRITE_FLAG_NO_NEW_BLOBS; + } else if (wim_has_integrity_table(wim)) { + /* Old WIM has an integrity table; begin writing new + * blobs after it. */ + old_wim_end = wim->hdr.integrity_table_reshdr.offset_in_wim + + wim->hdr.integrity_table_reshdr.size_in_wim; + } else { + /* No existing integrity table; begin writing new blobs + * after the old XML data. */ + old_wim_end = old_xml_end; + } + + ret = check_resource_offsets(wim, old_wim_end); + if (ret) + goto out; + + ret = prepare_blob_list_for_write(wim, WIMLIB_ALL_IMAGES, + write_flags, &blob_list, + &blob_table_list, &filter_ctx); + if (ret) + goto out; + + if (write_flags & WIMLIB_WRITE_FLAG_NO_NEW_BLOBS) + wimlib_assert(list_empty(&blob_list)); + } + + /* Update image stats if needed. */ + ret = update_image_stats(wim); + if (ret) + goto out; + + ret = open_wim_writable(wim, wim->filename, O_RDWR); + if (ret) + goto out; + + ret = lock_wim_for_append(wim); + if (ret) + goto out_close_wim; + + /* Set WIM_HDR_FLAG_WRITE_IN_PROGRESS flag in header. */ + wim->hdr.flags |= WIM_HDR_FLAG_WRITE_IN_PROGRESS; + ret = write_wim_header_flags(wim->hdr.flags, &wim->out_fd); + wim->hdr.flags &= ~WIM_HDR_FLAG_WRITE_IN_PROGRESS; + if (ret) { + ERROR_WITH_ERRNO("Error updating WIM header flags"); + goto out_unlock_wim; + } + + if (filedes_seek(&wim->out_fd, old_wim_end) == -1) { + ERROR_WITH_ERRNO("Can't seek to end of WIM"); + ret = WIMLIB_ERR_WRITE; + goto out_restore_hdr; + } + + ret = write_file_data_blobs(wim, &blob_list, write_flags, + num_threads, &filter_ctx); + if (ret) + goto out_truncate; + + ret = write_metadata_resources(wim, WIMLIB_ALL_IMAGES, write_flags); + if (ret) + goto out_truncate; + + ret = finish_write(wim, WIMLIB_ALL_IMAGES, write_flags, + &blob_table_list); + if (ret) + goto out_truncate; + + unlock_wim_for_append(wim); + return 0; + +out_truncate: + if (!(write_flags & (WIMLIB_WRITE_FLAG_NO_NEW_BLOBS | + WIMLIB_WRITE_FLAG_UNSAFE_COMPACT))) { + WARNING("Truncating \"%"TS"\" to its original size " + "(%"PRIu64" bytes)", wim->filename, old_wim_end); + if (ftruncate(wim->out_fd.fd, old_wim_end)) + WARNING_WITH_ERRNO("Failed to truncate WIM file!"); + } +out_restore_hdr: + (void)write_wim_header_flags(wim->hdr.flags, &wim->out_fd); +out_unlock_wim: + unlock_wim_for_append(wim); +out_close_wim: + (void)close_wim_writable(wim, write_flags); +out: + wim->being_compacted = 0; + return ret; +} + +static int +overwrite_wim_via_tmpfile(WIMStruct *wim, int write_flags, unsigned num_threads) +{ + size_t wim_name_len; + int ret; + + /* Write the WIM to a temporary file in the same directory as the + * original WIM. */ + wim_name_len = tstrlen(wim->filename); + tchar tmpfile[wim_name_len + 10]; + tmemcpy(tmpfile, wim->filename, wim_name_len); + get_random_alnum_chars(tmpfile + wim_name_len, 9); + tmpfile[wim_name_len + 9] = T('\0'); + + ret = wimlib_write(wim, tmpfile, WIMLIB_ALL_IMAGES, + write_flags | + WIMLIB_WRITE_FLAG_FSYNC | + WIMLIB_WRITE_FLAG_RETAIN_GUID, + num_threads); + if (ret) { + tunlink(tmpfile); + return ret; + } + + if (filedes_valid(&wim->in_fd)) { + filedes_close(&wim->in_fd); + filedes_invalidate(&wim->in_fd); + } + + /* Rename the new WIM file to the original WIM file. Note: on Windows + * this actually calls win32_rename_replacement(), not _wrename(), so + * that removing the existing destination file can be handled. */ + ret = trename(tmpfile, wim->filename); + if (ret) { + ERROR_WITH_ERRNO("Failed to rename `%"TS"' to `%"TS"'", + tmpfile, wim->filename); + #ifdef _WIN32 + if (ret < 0) + #endif + { + tunlink(tmpfile); + } + return WIMLIB_ERR_RENAME; + } + + union wimlib_progress_info progress; + progress.rename.from = tmpfile; + progress.rename.to = wim->filename; + return call_progress(wim->progfunc, WIMLIB_PROGRESS_MSG_RENAME, + &progress, wim->progctx); +} + +/* Determine if the specified WIM file may be updated in-place rather than by + * writing and replacing it with an entirely new file. */ +static bool +can_overwrite_wim_inplace(const WIMStruct *wim, int write_flags) +{ + /* REBUILD flag forces full rebuild. */ + if (write_flags & WIMLIB_WRITE_FLAG_REBUILD) + return false; + + /* Image deletions cause full rebuild by default. */ + if (wim->image_deletion_occurred && + !(write_flags & WIMLIB_WRITE_FLAG_SOFT_DELETE)) + return false; + + /* Pipable WIMs cannot be updated in place, nor can a non-pipable WIM be + * turned into a pipable WIM in-place. */ + if (wim_is_pipable(wim) || (write_flags & WIMLIB_WRITE_FLAG_PIPABLE)) + return false; + + /* The default compression type and compression chunk size selected for + * the output WIM must be the same as those currently used for the WIM. + */ + if (wim->compression_type != wim->out_compression_type) + return false; + if (wim->chunk_size != wim->out_chunk_size) + return false; + + return true; +} + +/* API function documented in wimlib.h */ +WIMLIBAPI int +wimlib_overwrite(WIMStruct *wim, int write_flags, unsigned num_threads) +{ + int ret; + u32 orig_hdr_flags; + + if (write_flags & ~WIMLIB_WRITE_MASK_PUBLIC) + return WIMLIB_ERR_INVALID_PARAM; + + if (!wim->filename) + return WIMLIB_ERR_NO_FILENAME; + + if (unlikely(write_flags & WIMLIB_WRITE_FLAG_UNSAFE_COMPACT)) { + /* + * In UNSAFE_COMPACT mode: + * - RECOMPRESS is forbidden + * - REBUILD is ignored + * - SOFT_DELETE and NO_SOLID_SORT are implied + */ + if (write_flags & WIMLIB_WRITE_FLAG_RECOMPRESS) + return WIMLIB_ERR_COMPACTION_NOT_POSSIBLE; + write_flags &= ~WIMLIB_WRITE_FLAG_REBUILD; + write_flags |= WIMLIB_WRITE_FLAG_SOFT_DELETE; + write_flags |= WIMLIB_WRITE_FLAG_NO_SOLID_SORT; + } + + orig_hdr_flags = wim->hdr.flags; + if (write_flags & WIMLIB_WRITE_FLAG_IGNORE_READONLY_FLAG) + wim->hdr.flags &= ~WIM_HDR_FLAG_READONLY; + ret = can_modify_wim(wim); + wim->hdr.flags = orig_hdr_flags; + if (ret) + return ret; + + if (can_overwrite_wim_inplace(wim, write_flags)) { + ret = overwrite_wim_inplace(wim, write_flags, num_threads); + if (ret != WIMLIB_ERR_RESOURCE_ORDER) + return ret; + WARNING("Falling back to re-building entire WIM"); + } + if (write_flags & WIMLIB_WRITE_FLAG_UNSAFE_COMPACT) + return WIMLIB_ERR_COMPACTION_NOT_POSSIBLE; + return overwrite_wim_via_tmpfile(wim, write_flags, num_threads); +} diff --git a/src/wimlib/xml.c b/src/wimlib/xml.c new file mode 100644 index 00000000..d4400ee6 --- /dev/null +++ b/src/wimlib/xml.c @@ -0,0 +1,1236 @@ +/* + * xml.c - deals with the XML information in WIM files + */ + +/* + * Copyright 2012-2023 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <stdlib.h> +#include <string.h> + +#include "wimlib/blob_table.h" +#include "wimlib/dentry.h" +#include "wimlib/encoding.h" +#include "wimlib/error.h" +#include "wimlib/file_io.h" +#include "wimlib/metadata.h" +#include "wimlib/resource.h" +#include "wimlib/timestamp.h" +#include "wimlib/xml.h" +#include "wimlib/xmlproc.h" +#include "wimlib/write.h" + +/* + * A wrapper around a WIM file's XML document. The XML document contains + * metadata about each image in the WIM file as well as metadata about the WIM + * file itself. + */ +struct wim_xml_info { + + /* The XML document in tree form */ + struct xml_node *root; + + /* A malloc()ed array containing a pointer to the IMAGE element for each + * WIM image. The image with 1-based index 'i' is at index 'i - 1' in + * this array. Note: these pointers are cached values, since they could + * also be found by searching the document. */ + struct xml_node **images; + + /* The number of WIM images (the length of 'images') */ + int image_count; +}; + +static u64 +parse_number(const tchar *str, int base) +{ + tchar *end; + unsigned long long v; + + if (!str) + return 0; + v = tstrtoull(str, &end, base); + if (end == str || *end || v >= UINT64_MAX) + return 0; + return v; +} + +/* + * Retrieve an unsigned integer from the contents of the specified element, + * decoding it using the specified base. If the element has no contents or does + * not contain a valid number, returns 0. + */ +static u64 +xml_element_get_number(const struct xml_node *element, int base) +{ + return parse_number(xml_element_get_text(element), base); +} + +/* + * Retrieve the timestamp from a time element. This element should have child + * elements HIGHPART and LOWPART; these elements will be used to construct a + * Windows-style timestamp. + */ +static u64 +xml_element_get_timestamp(const struct xml_node *element) +{ + u64 timestamp = 0; + const struct xml_node *child; + + xml_node_for_each_child(element, child) { + if (xml_node_is_element(child, T("HIGHPART"))) + timestamp |= xml_element_get_number(child, 16) << 32; + else if (xml_node_is_element(child, T("LOWPART"))) + timestamp |= xml_element_get_number(child, 16); + } + return timestamp; +} + +/* Create a new timestamp element and optionally link it into a tree. */ +static struct xml_node * +xml_new_element_with_timestamp(struct xml_node *parent, const tchar *name, + u64 timestamp) +{ + struct xml_node *element; + tchar buf[32]; + + element = xml_new_element(NULL, name); + if (!element) + goto err; + + tsprintf(buf, T("0x%08"PRIX32), (u32)(timestamp >> 32)); + if (!xml_new_element_with_text(element, T("HIGHPART"), buf)) + goto err; + + tsprintf(buf, T("0x%08"PRIX32), (u32)timestamp); + if (!xml_new_element_with_text(element, T("LOWPART"), buf)) + goto err; + + if (parent) + xml_add_child(parent, element); + return element; + +err: + xml_free_node(element); + return NULL; +} + +/* Create a new number element and optionally link it into a tree. */ +static struct xml_node * +xml_new_element_with_u64(struct xml_node *parent, const tchar *name, u64 value) +{ + tchar buf[32]; + + tsprintf(buf, T("%"PRIu64), value); + return xml_new_element_with_text(parent, name, buf); +} + +static bool +parse_index(tchar **pp, u32 *index_ret) +{ + tchar *p = *pp; + u32 index = 0; + + *p++ = '\0'; /* overwrite '[' */ + while (*p >= '0' && *p <= '9') { + u32 n = (index * 10) + (*p++ - '0'); + if (n < index) + return false; + index = n; + } + if (index == 0) + return false; + if (*p != ']') + return false; + p++; + if (*p != '/' && *p != '\0') + return false; + + *pp = p; + *index_ret = index; + return true; +} + +static int +do_xml_path_walk(struct xml_node *element, const tchar *path, bool create, + struct xml_node **result_ret) +{ + size_t n = tstrlen(path) + 1; + tchar buf[n]; + tchar *p; + tchar c; + + *result_ret = NULL; + + if (!element) + return 0; + + /* Copy the path to a temporary buffer. */ + tmemcpy(buf, path, n); + p = buf; + + if (*p == '/') + goto bad_syntax; + c = *p; + + while (c != '\0') { + const tchar *name; + struct xml_node *child; + u32 index = 1; + + /* We have another path component. */ + + /* Parse the element name. */ + name = p; + while (*p != '/' && *p != '\0' && *p != '[') + p++; + if (p == name) /* empty name? */ + goto bad_syntax; + + /* Handle a bracketed index, if one was specified. */ + if (*p == '[' && !parse_index(&p, &index)) + goto bad_syntax; + + c = *p; + *p = '\0'; + + /* Look for a matching child. */ + xml_node_for_each_child(element, child) + if (xml_node_is_element(child, name) && !--index) + goto next_step; + + /* No child matched the path. If create=false, the lookup + * failed. If create=true, create the needed element. */ + if (!create) + return 0; + + /* We can't create an element at index 'n' if indices 1...n-1 + * didn't already exist. */ + if (index != 1) + return WIMLIB_ERR_INVALID_PARAM; + + child = xml_new_element(element, name); + if (!child) + return WIMLIB_ERR_NOMEM; + next_step: + /* Continue to the next path component, if there is one. */ + element = child; + p++; + } + + *result_ret = element; + return 0; + +bad_syntax: + ERROR("The XML path \"%"TS"\" has invalid syntax.", path); + return WIMLIB_ERR_INVALID_PARAM; +} + +/* Retrieve the XML element, if any, at the specified 'path'. This supports a + * simple filesystem-like syntax. If the element was found, returns a pointer + * to it; otherwise returns NULL. */ +static struct xml_node * +xml_get_element_by_path(struct xml_node *root, const tchar *path) +{ + struct xml_node *element; + + do_xml_path_walk(root, path, false, &element); + return element; +} + +/* + * Similar to xml_get_element_by_path(), but creates the element and any + * requisite ancestor elements as needed. If successful, 0 is returned and + * *element_ret is set to a pointer to the resulting element. If unsuccessful, + * an error code is returned and *element_ret is set to NULL. + */ +static int +xml_ensure_element_by_path(struct xml_node *root, const tchar *path, + struct xml_node **element_ret) +{ + return do_xml_path_walk(root, path, true, element_ret); +} + +static u64 +xml_get_number_by_path(struct xml_node *root, const tchar *path) +{ + return xml_element_get_number(xml_get_element_by_path(root, path), 10); +} + +static u64 +xml_get_timestamp_by_path(struct xml_node *root, const tchar *path) +{ + return xml_element_get_timestamp(xml_get_element_by_path(root, path)); +} + +static const tchar * +xml_get_text_by_path(struct xml_node *root, const tchar *path) +{ + return xml_element_get_text(xml_get_element_by_path(root, path)); +} + +/* + * Create/replace (if text is not NULL and not empty) or remove (if text is NULL + * or empty) an element containing text. + */ +static int +xml_set_text_by_path(struct xml_node *root, const tchar *path, + const tchar *text) +{ + int ret; + struct xml_node *element; + + if (text && *text) { + /* Create or replace */ + ret = xml_ensure_element_by_path(root, path, &element); + if (ret) + return ret; + return xml_element_set_text(element, text); + } else { + /* Remove */ + xml_free_node(xml_get_element_by_path(root, path)); + return 0; + } +} + +/* Unlink and return the node which represents the INDEX attribute of the + * specified IMAGE element. */ +static struct xml_node * +unlink_index_attribute(struct xml_node *image_node) +{ + struct xml_node *attr = xml_get_attrib(image_node, T("INDEX")); + + xml_unlink_node(attr); + return attr; +} + +/* Compute the total uncompressed size of the streams of the specified inode. */ +static u64 +inode_sum_stream_sizes(const struct wim_inode *inode, + const struct blob_table *blob_table) +{ + u64 total_size = 0; + + for (unsigned i = 0; i < inode->i_num_streams; i++) { + const struct blob_descriptor *blob; + + blob = stream_blob(&inode->i_streams[i], blob_table); + if (blob) + total_size += blob->size; + } + return total_size; +} + +static int +append_image_node(struct wim_xml_info *info, struct xml_node *image_node) +{ + tchar buf[32]; + struct xml_node **images; + int ret; + + /* Limit exceeded? */ + if (unlikely(info->image_count >= MAX_IMAGES)) + return WIMLIB_ERR_IMAGE_COUNT; + + /* Set the INDEX attribute. */ + tsprintf(buf, T("%d"), info->image_count + 1); + ret = xml_set_attrib(image_node, T("INDEX"), buf); + if (ret) + return ret; + + /* Append the IMAGE element to the 'images' array. */ + images = REALLOC(info->images, + (info->image_count + 1) * sizeof(info->images[0])); + if (unlikely(!images)) + return WIMLIB_ERR_NOMEM; + info->images = images; + images[info->image_count++] = image_node; + + /* Add the IMAGE element to the document. */ + xml_add_child(info->root, image_node); + return 0; +} + +/*----------------------------------------------------------------------------* + * Functions for internal library use * + *----------------------------------------------------------------------------*/ + +/* Allocate an empty 'struct wim_xml_info', containing no images. */ +struct wim_xml_info * +xml_new_info_struct(void) +{ + struct wim_xml_info *info = CALLOC(1, sizeof(*info)); + + if (!info) + return NULL; + + info->root = xml_new_element(NULL, T("WIM")); + if (!info->root) { + FREE(info); + return NULL; + } + return info; +} + +/* Free a 'struct wim_xml_info'. */ +void +xml_free_info_struct(struct wim_xml_info *info) +{ + if (info) { + xml_free_node(info->root); + FREE(info->images); + FREE(info); + } +} + +/* Retrieve the number of images for which there exist IMAGE elements in the XML + * document. */ +int +xml_get_image_count(const struct wim_xml_info *info) +{ + return info->image_count; +} + +/* Retrieve the TOTALBYTES value for the WIM file, or 0 if this value is + * unavailable. */ +u64 +xml_get_total_bytes(const struct wim_xml_info *info) +{ + return xml_get_number_by_path(info->root, T("TOTALBYTES")); +} + +/* Retrieve the TOTALBYTES value for the specified image, or 0 if this value is + * unavailable. */ +u64 +xml_get_image_total_bytes(const struct wim_xml_info *info, int image) +{ + return xml_get_number_by_path(info->images[image - 1], T("TOTALBYTES")); +} + +/* Retrieve the HARDLINKBYTES value for the specified image, or 0 if this value + * is unavailable. */ +u64 +xml_get_image_hard_link_bytes(const struct wim_xml_info *info, int image) +{ + return xml_get_number_by_path(info->images[image - 1], + T("HARDLINKBYTES")); +} + +/* Retrieve the WIMBOOT value for the specified image, or false if this value is + * unavailable. */ +bool +xml_get_wimboot(const struct wim_xml_info *info, int image) +{ + return xml_get_number_by_path(info->images[image - 1], T("WIMBOOT")); +} + +/* Retrieve the Windows build number for the specified image, or 0 if this + * information is not available. */ +u64 +xml_get_windows_build_number(const struct wim_xml_info *info, int image) +{ + return xml_get_number_by_path(info->images[image - 1], + T("WINDOWS/VERSION/BUILD")); +} + +/* Set the WIMBOOT value for the specified image. */ +int +xml_set_wimboot(struct wim_xml_info *info, int image) +{ + return xml_set_text_by_path(info->images[image - 1], + T("WIMBOOT"), T("1")); +} + +/* + * Update the DIRCOUNT, FILECOUNT, TOTALBYTES, HARDLINKBYTES, and + * LASTMODIFICATIONTIME elements for the specified WIM image. + * + * Note: since these stats are likely to be used for display purposes only, we + * no longer attempt to duplicate WIMGAPI's weird bugs when calculating them. + */ +int +xml_update_image_info(WIMStruct *wim, int image) +{ + const struct wim_image_metadata *imd = wim->image_metadata[image - 1]; + struct xml_node *image_node = wim->xml_info->images[image - 1]; + const struct wim_inode *inode; + u64 dir_count = 0; + u64 file_count = 0; + u64 total_bytes = 0; + u64 hard_link_bytes = 0; + u64 size; + struct xml_node *dircount_node; + struct xml_node *filecount_node; + struct xml_node *totalbytes_node; + struct xml_node *hardlinkbytes_node; + struct xml_node *lastmodificationtime_node; + + image_for_each_inode(inode, imd) { + if (inode_is_directory(inode)) + dir_count += inode->i_nlink; + else + file_count += inode->i_nlink; + size = inode_sum_stream_sizes(inode, wim->blob_table); + total_bytes += size * inode->i_nlink; + hard_link_bytes += size * (inode->i_nlink - 1); + } + + dircount_node = xml_new_element_with_u64(NULL, T("DIRCOUNT"), + dir_count); + filecount_node = xml_new_element_with_u64(NULL, T("FILECOUNT"), + file_count); + totalbytes_node = xml_new_element_with_u64(NULL, T("TOTALBYTES"), + total_bytes); + hardlinkbytes_node = xml_new_element_with_u64(NULL, T("HARDLINKBYTES"), + hard_link_bytes); + lastmodificationtime_node = xml_new_element_with_timestamp(NULL, + T("LASTMODIFICATIONTIME"), now_as_wim_timestamp()); + + if (unlikely(!dircount_node || !filecount_node || !totalbytes_node || + !hardlinkbytes_node || !lastmodificationtime_node)) { + xml_free_node(dircount_node); + xml_free_node(filecount_node); + xml_free_node(totalbytes_node); + xml_free_node(hardlinkbytes_node); + xml_free_node(lastmodificationtime_node); + return WIMLIB_ERR_NOMEM; + } + + xml_replace_child(image_node, dircount_node); + xml_replace_child(image_node, filecount_node); + xml_replace_child(image_node, totalbytes_node); + xml_replace_child(image_node, hardlinkbytes_node); + xml_replace_child(image_node, lastmodificationtime_node); + return 0; +} + +/* Add an image to the XML information. */ +int +xml_add_image(struct wim_xml_info *info, const tchar *name) +{ + const u64 now = now_as_wim_timestamp(); + struct xml_node *image_node; + int ret; + + if (name && !xml_legal_value(name)) { + ERROR("Name of new image contains illegal characters"); + return WIMLIB_ERR_INVALID_PARAM; + } + + ret = WIMLIB_ERR_NOMEM; + image_node = xml_new_element(NULL, T("IMAGE")); + if (!image_node) + goto err; + if (name && *name && + !xml_new_element_with_text(image_node, T("NAME"), name)) + goto err; + if (!xml_new_element_with_u64(image_node, T("DIRCOUNT"), 0)) + goto err; + if (!xml_new_element_with_u64(image_node, T("FILECOUNT"), 0)) + goto err; + if (!xml_new_element_with_u64(image_node, T("TOTALBYTES"), 0)) + goto err; + if (!xml_new_element_with_u64(image_node, T("HARDLINKBYTES"), 0)) + goto err; + if (!xml_new_element_with_timestamp(image_node, T("CREATIONTIME"), now)) + goto err; + if (!xml_new_element_with_timestamp(image_node, + T("LASTMODIFICATIONTIME"), now)) + goto err; + ret = append_image_node(info, image_node); + if (ret) + goto err; + return 0; + +err: + xml_free_node(image_node); + return ret; +} + +/* + * Make a copy of the XML information for the image with index @src_image in the + * @src_info XML document and append it to the @dest_info XML document. + * + * In the process, change the image's name and description to the values + * specified by @dest_image_name and @dest_image_description. Either or both + * may be NULL, which indicates that the corresponding element will not be + * included in the destination image. + */ +int +xml_export_image(const struct wim_xml_info *src_info, int src_image, + struct wim_xml_info *dest_info, const tchar *dest_image_name, + const tchar *dest_image_description, bool wimboot) +{ + struct xml_node *dest_node; + int ret; + + if (dest_image_name && !xml_legal_value(dest_image_name)) { + ERROR("Destination image name contains illegal characters"); + return WIMLIB_ERR_INVALID_PARAM; + } + if (dest_image_description && + !xml_legal_value(dest_image_description)) { + ERROR("Destination image description contains illegal characters"); + return WIMLIB_ERR_INVALID_PARAM; + } + + ret = WIMLIB_ERR_NOMEM; + dest_node = xml_clone_tree(src_info->images[src_image - 1]); + if (!dest_node) + goto err; + + ret = xml_set_text_by_path(dest_node, T("NAME"), dest_image_name); + if (ret) + goto err; + + ret = xml_set_text_by_path(dest_node, T("DESCRIPTION"), + dest_image_description); + if (ret) + goto err; + + if (wimboot) { + ret = xml_set_text_by_path(dest_node, T("WIMBOOT"), T("1")); + if (ret) + goto err; + } + + ret = append_image_node(dest_info, dest_node); + if (ret) + goto err; + return 0; + +err: + xml_free_node(dest_node); + return ret; +} + +/* Remove the specified image from the XML document. */ +void +xml_delete_image(struct wim_xml_info *info, int image) +{ + struct xml_node *next_image; + struct xml_node *index_attr, *next_index_attr; + + /* Free the IMAGE element for the deleted image. Then, shift all + * higher-indexed IMAGE elements down by 1, in the process re-assigning + * their INDEX attributes. */ + + next_image = info->images[image - 1]; + next_index_attr = unlink_index_attribute(next_image); + xml_free_node(next_image); + + while (image < info->image_count) { + index_attr = next_index_attr; + next_image = info->images[image]; + next_index_attr = unlink_index_attribute(next_image); + xml_add_child(next_image, index_attr); + info->images[image - 1] = next_image; + image++; + } + + xml_free_node(next_index_attr); + info->image_count--; +} + +/* Architecture constants are from w64 mingw winnt.h */ +#define PROCESSOR_ARCHITECTURE_INTEL 0 +#define PROCESSOR_ARCHITECTURE_MIPS 1 +#define PROCESSOR_ARCHITECTURE_ALPHA 2 +#define PROCESSOR_ARCHITECTURE_PPC 3 +#define PROCESSOR_ARCHITECTURE_SHX 4 +#define PROCESSOR_ARCHITECTURE_ARM 5 +#define PROCESSOR_ARCHITECTURE_IA64 6 +#define PROCESSOR_ARCHITECTURE_ALPHA64 7 +#define PROCESSOR_ARCHITECTURE_MSIL 8 +#define PROCESSOR_ARCHITECTURE_AMD64 9 +#define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 10 +#define PROCESSOR_ARCHITECTURE_ARM64 12 + +static const tchar * +describe_arch(u64 arch) +{ + static const tchar * const descriptions[] = { + [PROCESSOR_ARCHITECTURE_INTEL] = T("x86"), + [PROCESSOR_ARCHITECTURE_MIPS] = T("MIPS"), + [PROCESSOR_ARCHITECTURE_ARM] = T("ARM"), + [PROCESSOR_ARCHITECTURE_IA64] = T("ia64"), + [PROCESSOR_ARCHITECTURE_AMD64] = T("x86_64"), + [PROCESSOR_ARCHITECTURE_ARM64] = T("ARM64"), + }; + + if (arch < ARRAY_LEN(descriptions) && descriptions[arch] != NULL) + return descriptions[arch]; + + return T("unknown"); +} + +/* Print information from the WINDOWS element, if present. */ +static void +print_windows_info(struct xml_node *image_node) +{ + struct xml_node *windows_node; + struct xml_node *langs_node; + struct xml_node *version_node; + const tchar *text; + + windows_node = xml_get_element_by_path(image_node, T("WINDOWS")); + if (!windows_node) + return; + + tprintf(T("Architecture: %"TS"\n"), + describe_arch(xml_get_number_by_path(windows_node, T("ARCH")))); + + text = xml_get_text_by_path(windows_node, T("PRODUCTNAME")); + if (text) + tprintf(T("Product Name: %"TS"\n"), text); + + text = xml_get_text_by_path(windows_node, T("EDITIONID")); + if (text) + tprintf(T("Edition ID: %"TS"\n"), text); + + text = xml_get_text_by_path(windows_node, T("INSTALLATIONTYPE")); + if (text) + tprintf(T("Installation Type: %"TS"\n"), text); + + text = xml_get_text_by_path(windows_node, T("HAL")); + if (text) + tprintf(T("HAL: %"TS"\n"), text); + + text = xml_get_text_by_path(windows_node, T("PRODUCTTYPE")); + if (text) + tprintf(T("Product Type: %"TS"\n"), text); + + text = xml_get_text_by_path(windows_node, T("PRODUCTSUITE")); + if (text) + tprintf(T("Product Suite: %"TS"\n"), text); + + langs_node = xml_get_element_by_path(windows_node, T("LANGUAGES")); + if (langs_node) { + struct xml_node *lang_node; + + tprintf(T("Languages: ")); + xml_node_for_each_child(langs_node, lang_node) { + if (!xml_node_is_element(lang_node, T("LANGUAGE"))) + continue; + text = xml_element_get_text(lang_node); + if (!text) + continue; + tprintf(T("%"TS" "), text); + } + tputchar(T('\n')); + + text = xml_get_text_by_path(langs_node, T("DEFAULT")); + if (text) + tprintf(T("Default Language: %"TS"\n"), text); + } + + text = xml_get_text_by_path(windows_node, T("SYSTEMROOT")); + if (text) + tprintf(T("System Root: %"TS"\n"), text); + + version_node = xml_get_element_by_path(windows_node, T("VERSION")); + if (version_node) { + tprintf(T("Major Version: %"PRIu64"\n"), + xml_get_number_by_path(version_node, T("MAJOR"))); + tprintf(T("Minor Version: %"PRIu64"\n"), + xml_get_number_by_path(version_node, T("MINOR"))); + tprintf(T("Build: %"PRIu64"\n"), + xml_get_number_by_path(version_node, T("BUILD"))); + tprintf(T("Service Pack Build: %"PRIu64"\n"), + xml_get_number_by_path(version_node, T("SPBUILD"))); + tprintf(T("Service Pack Level: %"PRIu64"\n"), + xml_get_number_by_path(version_node, T("SPLEVEL"))); + } +} + +/* Prints information about the specified image. */ +void +xml_print_image_info(struct wim_xml_info *info, int image) +{ + struct xml_node * const image_node = info->images[image - 1]; + const tchar *text; + tchar timebuf[64]; + + tprintf(T("Index: %d\n"), image); + + /* Always print the Name and Description, even if the corresponding XML + * elements are not present. */ + text = xml_get_text_by_path(image_node, T("NAME")); + tprintf(T("Name: %"TS"\n"), text ? text : T("")); + text = xml_get_text_by_path(image_node, T("DESCRIPTION")); + tprintf(T("Description: %"TS"\n"), text ? text : T("")); + + text = xml_get_text_by_path(image_node, T("DISPLAYNAME")); + if (text) + tprintf(T("Display Name: %"TS"\n"), text); + + text = xml_get_text_by_path(image_node, T("DISPLAYDESCRIPTION")); + if (text) + tprintf(T("Display Description: %"TS"\n"), text); + + tprintf(T("Directory Count: %"PRIu64"\n"), + xml_get_number_by_path(image_node, T("DIRCOUNT"))); + + tprintf(T("File Count: %"PRIu64"\n"), + xml_get_number_by_path(image_node, T("FILECOUNT"))); + + tprintf(T("Total Bytes: %"PRIu64"\n"), + xml_get_number_by_path(image_node, T("TOTALBYTES"))); + + tprintf(T("Hard Link Bytes: %"PRIu64"\n"), + xml_get_number_by_path(image_node, T("HARDLINKBYTES"))); + + wim_timestamp_to_str(xml_get_timestamp_by_path(image_node, + T("CREATIONTIME")), + timebuf, ARRAY_LEN(timebuf)); + tprintf(T("Creation Time: %"TS"\n"), timebuf); + + wim_timestamp_to_str(xml_get_timestamp_by_path(image_node, + T("LASTMODIFICATIONTIME")), + timebuf, ARRAY_LEN(timebuf)); + tprintf(T("Last Modification Time: %"TS"\n"), timebuf); + + print_windows_info(image_node); + + text = xml_get_text_by_path(image_node, T("FLAGS")); + if (text) + tprintf(T("Flags: %"TS"\n"), text); + + tprintf(T("WIMBoot compatible: %"TS"\n"), + xml_get_number_by_path(image_node, T("WIMBOOT")) ? + T("yes") : T("no")); + + tputchar('\n'); +} + +/*----------------------------------------------------------------------------* + * Reading and writing the XML data * + *----------------------------------------------------------------------------*/ + +static int +image_element_get_index(struct xml_node *element) +{ + struct xml_node *attrib = xml_get_attrib(element, T("INDEX")); + + if (!attrib) + return 0; + return min(INT_MAX, parse_number(attrib->value, 10)); +} + +/* Prepare the 'images' array from the XML document tree. */ +static int +setup_images(struct wim_xml_info *info, struct xml_node *root) +{ + struct xml_node *child; + int index; + int max_index = 0; + int ret; + + xml_node_for_each_child(root, child) { + if (!xml_node_is_element(child, T("IMAGE"))) + continue; + index = image_element_get_index(child); + if (unlikely(index < 1 || info->image_count >= MAX_IMAGES)) + goto err_indices; + max_index = max(max_index, index); + info->image_count++; + } + if (unlikely(max_index != info->image_count)) + goto err_indices; + ret = WIMLIB_ERR_NOMEM; + info->images = CALLOC(info->image_count, sizeof(info->images[0])); + if (unlikely(!info->images)) + goto err; + xml_node_for_each_child(root, child) { + if (!xml_node_is_element(child, T("IMAGE"))) + continue; + index = image_element_get_index(child); + if (unlikely(info->images[index - 1])) + goto err_indices; + info->images[index - 1] = child; + } + return 0; + +err_indices: + ERROR("The WIM file's XML document does not contain exactly one IMAGE " + "element per image!"); + ret = WIMLIB_ERR_XML; +err: + FREE(info->images); + return ret; +} + +static int +parse_wim_xml_document(const utf16lechar *raw_doc, size_t raw_doc_size, + struct xml_node **root_ret) +{ + tchar *doc; + int ret; + + ret = utf16le_to_tstr(raw_doc, raw_doc_size, &doc, NULL); + if (ret) + return ret; + ret = xml_parse_document(doc, root_ret); + FREE(doc); + return ret; +} + +/* Reads the XML data from a WIM file. */ +int +read_wim_xml_data(WIMStruct *wim) +{ + struct wim_xml_info *info; + void *raw_doc; + size_t raw_doc_size; + struct xml_node *root; + int ret; + + /* Allocate the 'struct wim_xml_info'. */ + ret = WIMLIB_ERR_NOMEM; + info = CALLOC(1, sizeof(*info)); + if (!info) + goto err; + + /* Read the raw UTF-16LE XML document. */ + ret = wimlib_get_xml_data(wim, &raw_doc, &raw_doc_size); + if (ret) + goto err; + + /* Parse the document, creating the document tree. */ + ret = parse_wim_xml_document(raw_doc, raw_doc_size, &info->root); + FREE(raw_doc); + raw_doc = NULL; + if (ret) { + if (ret != WIMLIB_ERR_NOMEM) + ret = WIMLIB_ERR_XML; + ERROR("Unable to parse the WIM file's XML document!"); + goto err; + } + root = info->root; + + /* Verify the root element. */ + if (!xml_node_is_element(root, T("WIM"))) { + ERROR("The WIM file's XML document has an unexpected format!"); + ret = WIMLIB_ERR_XML; + goto err; + } + + /* Verify the WIM file is not encrypted. */ + if (xml_get_element_by_path(root, T("ESD/ENCRYPTED"))) { + ret = WIMLIB_ERR_WIM_IS_ENCRYPTED; + goto err; + } + + /* Validate the image elements and set up the images[] array. */ + ret = setup_images(info, root); + if (ret) + goto err; + + /* Success! */ + wim->xml_info = info; + return 0; + +err: + xml_free_info_struct(info); + return ret; +} + +/* Swap the INDEX attributes of two IMAGE elements. */ +static void +swap_index_attributes(struct xml_node *image_element_1, + struct xml_node *image_element_2) +{ + struct xml_node *attr_1, *attr_2; + + if (image_element_1 != image_element_2) { + attr_1 = unlink_index_attribute(image_element_1); + attr_2 = unlink_index_attribute(image_element_2); + xml_add_child(image_element_1, attr_2); + xml_add_child(image_element_2, attr_1); + } +} + +static int +prepare_document_for_write(struct wim_xml_info *info, int image, u64 total_bytes, + struct xml_node **orig_totalbytes_element_ret) +{ + struct xml_node *totalbytes_element = NULL; + + /* Allocate the new TOTALBYTES element if needed. */ + if (total_bytes != WIM_TOTALBYTES_USE_EXISTING && + total_bytes != WIM_TOTALBYTES_OMIT) { + totalbytes_element = xml_new_element_with_u64( + NULL, T("TOTALBYTES"), total_bytes); + if (!totalbytes_element) + return WIMLIB_ERR_NOMEM; + } + + /* Adjust the IMAGE elements if needed. */ + if (image != WIMLIB_ALL_IMAGES) { + /* We're writing a single image only. Temporarily unlink all + * other IMAGE elements from the document. */ + for (int i = 0; i < info->image_count; i++) + if (i + 1 != image) + xml_unlink_node(info->images[i]); + + /* Temporarily set the INDEX attribute of the needed IMAGE + * element to 1. */ + swap_index_attributes(info->images[0], info->images[image - 1]); + } + + /* Adjust (add, change, or remove) the TOTALBYTES element if needed. */ + *orig_totalbytes_element_ret = NULL; + if (total_bytes != WIM_TOTALBYTES_USE_EXISTING) { + /* Unlink the previous TOTALBYTES element, if any. */ + *orig_totalbytes_element_ret = xml_get_element_by_path( + info->root, T("TOTALBYTES")); + if (*orig_totalbytes_element_ret) + xml_unlink_node(*orig_totalbytes_element_ret); + + /* Link in the new TOTALBYTES element, if any. */ + if (totalbytes_element) + xml_add_child(info->root, totalbytes_element); + } + return 0; +} + +static void +restore_document_after_write(struct wim_xml_info *info, int image, + struct xml_node *orig_totalbytes_element) +{ + /* Restore the IMAGE elements if needed. */ + if (image != WIMLIB_ALL_IMAGES) { + /* We wrote a single image only. Re-link all other IMAGE + * elements to the document. */ + for (int i = 0; i < info->image_count; i++) + if (i + 1 != image) + xml_add_child(info->root, info->images[i]); + + /* Restore the original INDEX attributes. */ + swap_index_attributes(info->images[0], info->images[image - 1]); + } + + /* Restore the original TOTALBYTES element if needed. */ + if (orig_totalbytes_element) + xml_replace_child(info->root, orig_totalbytes_element); +} + +/* + * Writes the XML data to a WIM file. + * + * 'image' specifies the image(s) to include in the XML data. Normally it is + * WIMLIB_ALL_IMAGES, but it can also be a 1-based image index. + * + * 'total_bytes' is the number to use in the top-level TOTALBYTES element, or + * WIM_TOTALBYTES_USE_EXISTING to use the existing value from the XML document + * (if any), or WIM_TOTALBYTES_OMIT to omit the TOTALBYTES element entirely. + */ +int +write_wim_xml_data(WIMStruct *wim, int image, u64 total_bytes, + struct wim_reshdr *out_reshdr, int write_resource_flags) +{ + struct wim_xml_info *info = wim->xml_info; + int ret; + struct xml_node *orig_totalbytes_element; + struct xml_out_buf buf = {}; + const utf16lechar *raw_doc; + size_t raw_doc_size; + + /* Make any needed temporary changes to the document. */ + ret = prepare_document_for_write(info, image, total_bytes, + &orig_totalbytes_element); + if (ret) + goto out; + + ret = xml_write_document(info->root, &buf); + if (ret) + goto out_restore_document; + + ret = tstr_get_utf16le_and_len(buf.buf, &raw_doc, &raw_doc_size); + if (ret) + goto out_restore_document; + + /* Write the XML data uncompressed. Although wimlib can handle + * compressed XML data, some other WIM software cannot. */ + ret = write_wim_resource_from_buffer(raw_doc, raw_doc_size, + true, + &wim->out_fd, + WIMLIB_COMPRESSION_TYPE_NONE, + 0, + out_reshdr, + NULL, + write_resource_flags); + tstr_put_utf16le(raw_doc); +out_restore_document: + /* Revert any temporary changes we made to the document. */ + restore_document_after_write(info, image, orig_totalbytes_element); + FREE(buf.buf); +out: + return ret; +} + +/*----------------------------------------------------------------------------* + * Library API functions * + *----------------------------------------------------------------------------*/ + +WIMLIBAPI int +wimlib_get_xml_data(WIMStruct *wim, void **buf_ret, size_t *bufsize_ret) +{ + const struct wim_reshdr *xml_reshdr; + + if (wim->filename == NULL && filedes_is_seekable(&wim->in_fd)) + return WIMLIB_ERR_NO_FILENAME; + + if (buf_ret == NULL || bufsize_ret == NULL) + return WIMLIB_ERR_INVALID_PARAM; + + xml_reshdr = &wim->hdr.xml_data_reshdr; + + *bufsize_ret = xml_reshdr->uncompressed_size; + return wim_reshdr_to_data(xml_reshdr, wim, buf_ret); +} + +WIMLIBAPI int +wimlib_extract_xml_data(WIMStruct *wim, FILE *fp) +{ + int ret; + void *buf; + size_t bufsize; + + ret = wimlib_get_xml_data(wim, &buf, &bufsize); + if (ret) + return ret; + + if (fwrite(buf, 1, bufsize, fp) != bufsize) { + ERROR_WITH_ERRNO("Failed to extract XML data"); + ret = WIMLIB_ERR_WRITE; + } + FREE(buf); + return ret; +} + +static bool +image_name_in_use(const WIMStruct *wim, const tchar *name, int excluded_image) +{ + const struct wim_xml_info *info = wim->xml_info; + const tchar *existing_name; + + /* Any number of images can have "no name". */ + if (!name || !*name) + return false; + + /* Check for images that have the specified name. */ + for (int i = 0; i < info->image_count; i++) { + if (i + 1 == excluded_image) + continue; + existing_name = xml_get_text_by_path(info->images[i], + T("NAME")); + if (existing_name && !tstrcmp(existing_name, name)) + return true; + } + return false; +} + +WIMLIBAPI bool +wimlib_image_name_in_use(const WIMStruct *wim, const tchar *name) +{ + return image_name_in_use(wim, name, WIMLIB_NO_IMAGE); +} + +WIMLIBAPI const tchar * +wimlib_get_image_name(const WIMStruct *wim, int image) +{ + const struct wim_xml_info *info = wim->xml_info; + const tchar *name; + + if (image < 1 || image > info->image_count) + return NULL; + name = wimlib_get_image_property(wim, image, T("NAME")); + return name ? name : T(""); +} + +WIMLIBAPI const tchar * +wimlib_get_image_description(const WIMStruct *wim, int image) +{ + return wimlib_get_image_property(wim, image, T("DESCRIPTION")); +} + +WIMLIBAPI const tchar * +wimlib_get_image_property(const WIMStruct *wim, int image, + const tchar *property_name) +{ + const struct wim_xml_info *info = wim->xml_info; + + if (!property_name || !*property_name) + return NULL; + if (image < 1 || image > info->image_count) + return NULL; + return xml_get_text_by_path(info->images[image - 1], property_name); +} + +WIMLIBAPI int +wimlib_set_image_name(WIMStruct *wim, int image, const tchar *name) +{ + return wimlib_set_image_property(wim, image, T("NAME"), name); +} + +WIMLIBAPI int +wimlib_set_image_descripton(WIMStruct *wim, int image, const tchar *description) +{ + return wimlib_set_image_property(wim, image, T("DESCRIPTION"), + description); +} + +WIMLIBAPI int +wimlib_set_image_flags(WIMStruct *wim, int image, const tchar *flags) +{ + return wimlib_set_image_property(wim, image, T("FLAGS"), flags); +} + +WIMLIBAPI int +wimlib_set_image_property(WIMStruct *wim, int image, const tchar *property_name, + const tchar *property_value) +{ + struct wim_xml_info *info = wim->xml_info; + + if (!property_name || !*property_name) + return WIMLIB_ERR_INVALID_PARAM; + + if (!xml_legal_path(property_name)) { + ERROR("Property name '%"TS"' is illegal in XML", property_name); + return WIMLIB_ERR_INVALID_PARAM; + } + + if (property_value && !xml_legal_value(property_value)) { + WARNING("Value of property '%"TS"' contains illegal characters", + property_name); + return WIMLIB_ERR_INVALID_PARAM; + } + + if (image < 1 || image > info->image_count) + return WIMLIB_ERR_INVALID_IMAGE; + + if (!tstrcmp(property_name, T("NAME")) && + image_name_in_use(wim, property_value, image)) + return WIMLIB_ERR_IMAGE_NAME_COLLISION; + + return xml_set_text_by_path(info->images[image - 1], property_name, + property_value); +} diff --git a/src/wimlib/xml_windows.c b/src/wimlib/xml_windows.c new file mode 100644 index 00000000..305d2efa --- /dev/null +++ b/src/wimlib/xml_windows.c @@ -0,0 +1,855 @@ +/* + * xml_windows.c + * + * Set Windows-specific metadata in a WIM file's XML document based on the image + * contents. + */ + +/* + * Copyright 2016-2023 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <stdlib.h> + +#include "wimlib.h" +#include "wimlib/blob_table.h" +#include "wimlib/dentry.h" +#include "wimlib/encoding.h" +#include "wimlib/endianness.h" +#include "wimlib/error.h" +#include "wimlib/metadata.h" +#include "wimlib/registry.h" +#include "wimlib/wim.h" +#include "wimlib/xml_windows.h" + +/* Context for a call to set_windows_specific_info() */ +struct windows_info_ctx { + WIMStruct *wim; + int image; + bool oom_encountered; + bool debug_enabled; +}; + +/* For debugging purposes, the environmental variable WIMLIB_DEBUG_XML_INFO can + * be set to enable messages about certain things not being as expected in the + * registry or other files used as information sources. */ + +#define XML_WARN(format, ...) \ + if (ctx->debug_enabled) \ + WARNING(format, ##__VA_ARGS__) + +/* Set a property in the XML document, with error checking. */ +static void +set_string_property(struct windows_info_ctx *ctx, + const tchar *name, const tchar *value) +{ + int ret = wimlib_set_image_property(ctx->wim, ctx->image, name, value); + if (likely(!ret)) + return; + + ctx->oom_encountered |= (ret == WIMLIB_ERR_NOMEM); + WARNING("Failed to set image property \"%"TS"\" to value " + "\"%"TS"\": %"TS, name, value, wimlib_get_error_string(ret)); +} + +/* Set a property in the XML document, with error checking. */ +static void +set_number_property(struct windows_info_ctx *ctx, const tchar *name, s64 value) +{ + tchar buffer[32]; + tsprintf(buffer, T("%"PRIi64""), value); + set_string_property(ctx, name, buffer); +} + +/* Check the result of a registry hive operation. If unsuccessful, possibly + * print debugging information. Return true iff successful. */ +static bool +check_hive_status(struct windows_info_ctx *ctx, enum hive_status status, + const tchar *key, const tchar *value) +{ + if (likely(status == HIVE_OK)) + return true; + + ctx->oom_encountered |= (status == HIVE_OUT_OF_MEMORY); + XML_WARN("%s; key=%"TS" value=%"TS, hive_status_to_string(status), + (key ? key : T("(null)")), (value ? value : T("(null)"))); + return false; +} + +static bool +is_registry_valid(struct windows_info_ctx *ctx, const void *hive_mem, + size_t hive_size) +{ + enum hive_status status; + + status = hive_validate(hive_mem, hive_size); + return check_hive_status(ctx, status, NULL, NULL); +} + +static bool +get_string_from_registry(struct windows_info_ctx *ctx, const struct regf *regf, + const tchar *key_name, const tchar *value_name, + tchar **value_ret) +{ + enum hive_status status; + + status = hive_get_string(regf, key_name, value_name, value_ret); + return check_hive_status(ctx, status, key_name, value_name); +} + +static bool +get_number_from_registry(struct windows_info_ctx *ctx, const struct regf *regf, + const tchar *key_name, const tchar *value_name, + s64 *value_ret) +{ + enum hive_status status; + + status = hive_get_number(regf, key_name, value_name, value_ret); + return check_hive_status(ctx, status, key_name, value_name); +} + +static bool +list_subkeys_in_registry(struct windows_info_ctx *ctx, const struct regf *regf, + const tchar *key_name, tchar ***subkeys_ret) +{ + enum hive_status status; + + status = hive_list_subkeys(regf, key_name, subkeys_ret); + return check_hive_status(ctx, status, key_name, NULL); +} + +/* Copy a string value from a registry hive to the XML document. */ +static void +copy_registry_string(struct windows_info_ctx *ctx, const struct regf *regf, + const tchar *key_name, const tchar *value_name, + const tchar *property_name) +{ + tchar *string; + + if (get_string_from_registry(ctx, regf, key_name, value_name, &string)) { + set_string_property(ctx, property_name, string); + FREE(string); + } +} + +/* A table that map Windows language IDs, sorted numerically, to their language + * names. It was generated by tools/generate_language_id_map.c. */ +static const struct { + u16 id; + u16 name_start_offset; +} language_id_map[453] = { + {0x0000, 0}, {0x0001, 6}, {0x0002, 12}, {0x0003, 18}, + {0x0004, 24}, {0x0005, 30}, {0x0006, 36}, {0x0007, 42}, + {0x0008, 48}, {0x0009, 54}, {0x000a, 60}, {0x000b, 66}, + {0x000c, 72}, {0x000d, 78}, {0x000e, 84}, {0x000f, 90}, + {0x0010, 96}, {0x0011, 102}, {0x0012, 108}, {0x0013, 114}, + {0x0014, 120}, {0x0015, 126}, {0x0016, 132}, {0x0017, 138}, + {0x0018, 144}, {0x0019, 150}, {0x001a, 156}, {0x001b, 162}, + {0x001c, 168}, {0x001d, 174}, {0x001e, 180}, {0x001f, 186}, + {0x0020, 192}, {0x0021, 198}, {0x0022, 204}, {0x0023, 210}, + {0x0024, 216}, {0x0025, 222}, {0x0026, 228}, {0x0027, 234}, + {0x0028, 240}, {0x0029, 251}, {0x002a, 257}, {0x002b, 263}, + {0x002c, 269}, {0x002d, 280}, {0x002e, 286}, {0x002f, 293}, + {0x0030, 299}, {0x0031, 305}, {0x0032, 311}, {0x0033, 317}, + {0x0034, 323}, {0x0035, 329}, {0x0036, 335}, {0x0037, 341}, + {0x0038, 347}, {0x0039, 353}, {0x003a, 359}, {0x003b, 365}, + {0x003c, 371}, {0x003d, 377}, {0x003e, 384}, {0x003f, 390}, + {0x0040, 396}, {0x0041, 402}, {0x0042, 408}, {0x0043, 414}, + {0x0044, 425}, {0x0045, 431}, {0x0046, 437}, {0x0047, 443}, + {0x0048, 449}, {0x0049, 455}, {0x004a, 461}, {0x004b, 467}, + {0x004c, 473}, {0x004d, 479}, {0x004e, 485}, {0x004f, 491}, + {0x0050, 497}, {0x0051, 503}, {0x0052, 509}, {0x0053, 515}, + {0x0054, 521}, {0x0055, 527}, {0x0056, 533}, {0x0057, 539}, + {0x0058, 546}, {0x0059, 553}, {0x005a, 564}, {0x005b, 571}, + {0x005c, 577}, {0x005d, 589}, {0x005e, 600}, {0x005f, 606}, + {0x0060, 618}, {0x0061, 629}, {0x0062, 635}, {0x0063, 641}, + {0x0064, 647}, {0x0065, 654}, {0x0066, 660}, {0x0067, 667}, + {0x0068, 678}, {0x0069, 689}, {0x006a, 696}, {0x006b, 702}, + {0x006c, 709}, {0x006d, 716}, {0x006e, 722}, {0x006f, 728}, + {0x0070, 734}, {0x0071, 740}, {0x0072, 751}, {0x0073, 757}, + {0x0074, 763}, {0x0075, 769}, {0x0076, 776}, {0x0077, 783}, + {0x0078, 789}, {0x0079, 795}, {0x007a, 803}, {0x007c, 810}, + {0x007e, 817}, {0x007f, 823}, {0x0080, 824}, {0x0081, 830}, + {0x0082, 836}, {0x0083, 842}, {0x0084, 848}, {0x0085, 855}, + {0x0086, 862}, {0x0087, 874}, {0x0088, 880}, {0x008c, 886}, + {0x0091, 893}, {0x0092, 899}, {0x0400, 910}, {0x0401, 916}, + {0x0402, 922}, {0x0403, 928}, {0x0404, 934}, {0x0405, 940}, + {0x0406, 946}, {0x0407, 952}, {0x0408, 958}, {0x0409, 964}, + {0x040a, 970}, {0x040b, 983}, {0x040c, 989}, {0x040d, 995}, + {0x040e, 1001}, {0x040f, 1007}, {0x0410, 1013}, {0x0411, 1019}, + {0x0412, 1025}, {0x0413, 1031}, {0x0414, 1037}, {0x0415, 1043}, + {0x0416, 1049}, {0x0417, 1055}, {0x0418, 1061}, {0x0419, 1067}, + {0x041a, 1073}, {0x041b, 1079}, {0x041c, 1085}, {0x041d, 1091}, + {0x041e, 1097}, {0x041f, 1103}, {0x0420, 1109}, {0x0421, 1115}, + {0x0422, 1121}, {0x0423, 1127}, {0x0424, 1133}, {0x0425, 1139}, + {0x0426, 1145}, {0x0427, 1151}, {0x0428, 1157}, {0x0429, 1168}, + {0x042a, 1174}, {0x042b, 1180}, {0x042c, 1186}, {0x042d, 1197}, + {0x042e, 1203}, {0x042f, 1210}, {0x0430, 1216}, {0x0431, 1222}, + {0x0432, 1228}, {0x0433, 1234}, {0x0434, 1240}, {0x0435, 1246}, + {0x0436, 1252}, {0x0437, 1258}, {0x0438, 1264}, {0x0439, 1270}, + {0x043a, 1276}, {0x043b, 1282}, {0x043d, 1288}, {0x043e, 1295}, + {0x043f, 1301}, {0x0440, 1307}, {0x0441, 1313}, {0x0442, 1319}, + {0x0443, 1325}, {0x0444, 1336}, {0x0445, 1342}, {0x0446, 1348}, + {0x0447, 1354}, {0x0448, 1360}, {0x0449, 1366}, {0x044a, 1372}, + {0x044b, 1378}, {0x044c, 1384}, {0x044d, 1390}, {0x044e, 1396}, + {0x044f, 1402}, {0x0450, 1408}, {0x0451, 1414}, {0x0452, 1420}, + {0x0453, 1426}, {0x0454, 1432}, {0x0455, 1438}, {0x0456, 1444}, + {0x0457, 1450}, {0x0458, 1457}, {0x0459, 1464}, {0x045a, 1475}, + {0x045b, 1482}, {0x045c, 1488}, {0x045d, 1500}, {0x045e, 1511}, + {0x045f, 1517}, {0x0460, 1529}, {0x0461, 1540}, {0x0462, 1546}, + {0x0463, 1552}, {0x0464, 1558}, {0x0465, 1565}, {0x0466, 1571}, + {0x0467, 1578}, {0x0468, 1589}, {0x0469, 1600}, {0x046a, 1607}, + {0x046b, 1613}, {0x046c, 1620}, {0x046d, 1627}, {0x046e, 1633}, + {0x046f, 1639}, {0x0470, 1645}, {0x0471, 1651}, {0x0472, 1662}, + {0x0473, 1668}, {0x0474, 1674}, {0x0475, 1680}, {0x0476, 1687}, + {0x0477, 1694}, {0x0478, 1700}, {0x0479, 1706}, {0x047a, 1714}, + {0x047c, 1721}, {0x047e, 1728}, {0x0480, 1734}, {0x0481, 1740}, + {0x0482, 1746}, {0x0483, 1752}, {0x0484, 1758}, {0x0485, 1765}, + {0x0486, 1772}, {0x0487, 1784}, {0x0488, 1790}, {0x048c, 1796}, + {0x0491, 1803}, {0x0492, 1809}, {0x0501, 1820}, {0x05fe, 1829}, + {0x0800, 1839}, {0x0801, 1845}, {0x0803, 1851}, {0x0804, 1866}, + {0x0807, 1872}, {0x0809, 1878}, {0x080a, 1884}, {0x080c, 1890}, + {0x0810, 1896}, {0x0813, 1902}, {0x0814, 1908}, {0x0816, 1914}, + {0x0818, 1920}, {0x0819, 1926}, {0x081a, 1932}, {0x081d, 1943}, + {0x0820, 1949}, {0x082c, 1955}, {0x082e, 1966}, {0x0832, 1973}, + {0x083b, 1979}, {0x083c, 1985}, {0x083e, 1991}, {0x0843, 1997}, + {0x0845, 2008}, {0x0846, 2014}, {0x0849, 2025}, {0x0850, 2031}, + {0x0859, 2042}, {0x085d, 2053}, {0x085f, 2064}, {0x0860, 2076}, + {0x0861, 2087}, {0x0867, 2093}, {0x086b, 2104}, {0x0873, 2111}, + {0x0901, 2117}, {0x09ff, 2131}, {0x0c00, 2141}, {0x0c01, 2147}, + {0x0c04, 2153}, {0x0c07, 2159}, {0x0c09, 2165}, {0x0c0a, 2171}, + {0x0c0c, 2177}, {0x0c1a, 2183}, {0x0c3b, 2194}, {0x0c50, 2200}, + {0x0c51, 2211}, {0x0c6b, 2217}, {0x1000, 2224}, {0x1001, 2235}, + {0x1004, 2241}, {0x1007, 2247}, {0x1009, 2253}, {0x100a, 2259}, + {0x100c, 2265}, {0x101a, 2271}, {0x103b, 2277}, {0x105f, 2284}, + {0x1401, 2296}, {0x1404, 2302}, {0x1407, 2308}, {0x1409, 2314}, + {0x140a, 2320}, {0x140c, 2326}, {0x141a, 2332}, {0x143b, 2343}, + {0x1801, 2350}, {0x1809, 2356}, {0x180a, 2362}, {0x180c, 2368}, + {0x181a, 2374}, {0x183b, 2385}, {0x1c01, 2392}, {0x1c09, 2398}, + {0x1c0a, 2404}, {0x1c0c, 2410}, {0x1c1a, 2417}, {0x1c3b, 2428}, + {0x2000, 2435}, {0x2001, 2441}, {0x2009, 2447}, {0x200a, 2453}, + {0x200c, 2459}, {0x201a, 2465}, {0x203b, 2476}, {0x2400, 2483}, + {0x2401, 2489}, {0x2409, 2495}, {0x240a, 2502}, {0x240c, 2508}, + {0x241a, 2514}, {0x243b, 2525}, {0x2800, 2532}, {0x2801, 2538}, + {0x2809, 2544}, {0x280a, 2550}, {0x280c, 2556}, {0x281a, 2562}, + {0x2c00, 2573}, {0x2c01, 2579}, {0x2c09, 2585}, {0x2c0a, 2591}, + {0x2c0c, 2597}, {0x2c1a, 2603}, {0x3000, 2614}, {0x3001, 2620}, + {0x3009, 2626}, {0x300a, 2632}, {0x300c, 2638}, {0x301a, 2644}, + {0x3400, 2655}, {0x3401, 2661}, {0x3409, 2667}, {0x340a, 2673}, + {0x340c, 2679}, {0x3800, 2685}, {0x3801, 2691}, {0x3809, 2697}, + {0x380a, 2703}, {0x380c, 2709}, {0x3c00, 2715}, {0x3c01, 2721}, + {0x3c09, 2727}, {0x3c0a, 2733}, {0x3c0c, 2739}, {0x4000, 2745}, + {0x4001, 2751}, {0x4009, 2757}, {0x400a, 2763}, {0x4400, 2769}, + {0x4409, 2775}, {0x440a, 2781}, {0x4800, 2787}, {0x4809, 2793}, + {0x480a, 2799}, {0x4c00, 2805}, {0x4c09, 2811}, {0x4c0a, 2817}, + {0x500a, 2823}, {0x540a, 2829}, {0x580a, 2835}, {0x5c0a, 2842}, + {0x641a, 2848}, {0x681a, 2859}, {0x6c1a, 2870}, {0x701a, 2881}, + {0x703b, 2892}, {0x742c, 2899}, {0x743b, 2910}, {0x7804, 2917}, + {0x7814, 2923}, {0x781a, 2929}, {0x782c, 2940}, {0x783b, 2951}, + {0x7843, 2958}, {0x7850, 2969}, {0x785d, 2975}, {0x785f, 2986}, + {0x7c04, 2998}, {0x7c14, 3004}, {0x7c1a, 3010}, {0x7c28, 3021}, + {0x7c2e, 3032}, {0x7c3b, 3039}, {0x7c43, 3046}, {0x7c46, 3057}, + {0x7c50, 3068}, {0x7c59, 3079}, {0x7c5c, 3090}, {0x7c5d, 3102}, + {0x7c5f, 3113}, {0x7c67, 3125}, {0x7c68, 3136}, {0x7c86, 3147}, + {0x7c92, 3159}, +}; + +/* All the language names; generated by tools/generate_language_id_map.c. + * For compactness, this is a 'char' string rather than a 'tchar' string. */ +static const char language_names[3170] = + "en-US\0ar-SA\0bg-BG\0ca-ES\0zh-CN\0cs-CZ\0da-DK\0de-DE\0el-GR\0en-US\0" + "es-ES\0fi-FI\0fr-FR\0he-IL\0hu-HU\0is-IS\0it-IT\0ja-JP\0ko-KR\0nl-NL\0" + "nb-NO\0pl-PL\0pt-BR\0rm-CH\0ro-RO\0ru-RU\0hr-HR\0sk-SK\0sq-AL\0sv-SE\0" + "th-TH\0tr-TR\0ur-PK\0id-ID\0uk-UA\0be-BY\0sl-SI\0et-EE\0lv-LV\0lt-LT\0" + "tg-Cyrl-TJ\0fa-IR\0vi-VN\0hy-AM\0az-Latn-AZ\0eu-ES\0hsb-DE\0mk-MK\0" + "st-ZA\0ts-ZA\0tn-ZA\0ve-ZA\0xh-ZA\0zu-ZA\0af-ZA\0ka-GE\0fo-FO\0hi-IN\0" + "mt-MT\0se-NO\0ga-IE\0yi-001\0ms-MY\0kk-KZ\0ky-KG\0sw-KE\0tk-TM\0" + "uz-Latn-UZ\0tt-RU\0bn-BD\0pa-IN\0gu-IN\0or-IN\0ta-IN\0te-IN\0kn-IN\0" + "ml-IN\0as-IN\0mr-IN\0sa-IN\0mn-MN\0bo-CN\0cy-GB\0km-KH\0lo-LA\0my-MM\0" + "gl-ES\0kok-IN\0mni-IN\0sd-Arab-PK\0syr-SY\0si-LK\0chr-Cher-US\0" + "iu-Latn-CA\0am-ET\0tzm-Latn-DZ\0ks-Arab-IN\0ne-NP\0fy-NL\0ps-AF\0" + "fil-PH\0dv-MV\0bin-NG\0ff-Latn-SN\0ha-Latn-NG\0ibb-NG\0yo-NG\0quz-BO\0" + "nso-ZA\0ba-RU\0lb-LU\0kl-GL\0ig-NG\0kr-Latn-NG\0om-ET\0ti-ER\0gn-PY\0" + "haw-US\0la-001\0so-SO\0ii-CN\0pap-029\0arn-CL\0moh-CA\0br-FR\0\0" + "ug-CN\0mi-NZ\0oc-FR\0co-FR\0gs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oc-FR\0co-FR\0gsw-FR\0" + "sah-RU\0quc-Latn-GT\0rw-RW\0wo-SN\0prs-AF\0gd-GB\0ku-Arab-IQ\0" + "qps-ploc\0qps-ploca\0en-US\0ar-IQ\0ca-ES-valencia\0zh-CN\0de-CH\0" + "en-GB\0es-MX\0fr-BE\0it-CH\0nl-BE\0nn-NO\0pt-PT\0ro-MD\0ru-MD\0" + "sr-Latn-CS\0sv-FI\0ur-IN\0az-Cyrl-AZ\0dsb-DE\0tn-BW\0se-SE\0ga-IE\0" + "ms-BN\0uz-Cyrl-UZ\0bn-BD\0pa-Arab-PK\0ta-LK\0mn-Mong-CN\0sd-Arab-PK\0" + "iu-Latn-CA\0tzm-Latn-DZ\0ks-Deva-IN\0ne-IN\0ff-Latn-SN\0quz-EC\0" + "ti-ER\0qps-Latn-x-sh\0qps-plocm\0en-US\0ar-EG\0zh-HK\0de-AT\0en-AU\0" + "es-ES\0fr-CA\0sr-Cyrl-CS\0se-FI\0mn-Mong-MN\0dz-BT\0quz-PE\0" + "ks-Arab-IN\0ar-LY\0zh-SG\0de-LU\0en-CA\0es-GT\0fr-CH\0hr-BA\0smj-NO\0" + "tzm-Tfng-MA\0ar-DZ\0zh-MO\0de-LI\0en-NZ\0es-CR\0fr-LU\0bs-Latn-BA\0" + "smj-SE\0ar-MA\0en-IE\0es-PA\0fr-MC\0sr-Latn-BA\0sma-NO\0ar-TN\0en-ZA\0" + "es-DO\0fr-029\0sr-Cyrl-BA\0sma-SE\0en-US\0ar-OM\0en-JM\0es-VE\0fr-RE\0" + "bs-Cyrl-BA\0sms-FI\0en-US\0ar-YE\0en-029\0es-CO\0fr-CD\0sr-Latn-RS\0" + "smn-FI\0en-US\0ar-SY\0en-BZ\0es-PE\0fr-SN\0sr-Cyrl-RS\0en-US\0ar-JO\0" + "en-TT\0es-AR\0fr-CM\0sr-Latn-ME\0en-US\0ar-LB\0en-ZW\0es-EC\0fr-CI\0" + "sr-Cyrl-ME\0en-US\0ar-KW\0en-PH\0es-CL\0fr-ML\0en-US\0ar-AE\0en-ID\0" + "es-UY\0fr-MA\0en-US\0ar-BH\0en-HK\0es-PY\0fr-HT\0en-US\0ar-QA\0en-IN\0" + "es-BO\0en-US\0en-MY\0es-SV\0en-US\0en-SG\0es-HN\0en-US\0en-AE\0es-NI\0" + "es-PR\0es-US\0es-419\0es-CU\0bs-Cyrl-BA\0bs-Latn-BA\0sr-Cyrl-RS\0" + "sr-Latn-RS\0smn-FI\0az-Cyrl-AZ\0sms-FI\0zh-CN\0nn-NO\0bs-Latn-BA\0" + "az-Latn-AZ\0sma-SE\0uz-Cyrl-UZ\0mn-MN\0iu-Cans-CA\0tzm-Tfng-MA\0" + "zh-HK\0nb-NO\0sr-Latn-RS\0tg-Cyrl-TJ\0dsb-DE\0smj-SE\0uz-Latn-UZ\0" + "pa-Arab-PK\0mn-Mong-CN\0sd-Arab-PK\0chr-Cher-US\0iu-Latn-CA\0" + "tzm-Latn-DZ\0ff-Latn-SN\0ha-Latn-NG\0quc-Latn-GT\0ku-Arab-IQ\0"; + +/* Translate a Windows language ID to its name. Returns NULL if the ID is not + * recognized. */ +static const char * +language_id_to_name(u16 id) +{ + int l = 0; + int r = ARRAY_LEN(language_id_map) - 1; + do { + int m = (l + r) / 2; + if (id < language_id_map[m].id) + r = m - 1; + else if (id > language_id_map[m].id) + l = m + 1; + else + return &language_names[language_id_map[m].name_start_offset]; + } while (l <= r); + return NULL; +} + +/* PE binary processor architecture codes (common ones only) */ +#define IMAGE_FILE_MACHINE_I386 0x014C +#define IMAGE_FILE_MACHINE_ARM 0x01C0 +#define IMAGE_FILE_MACHINE_ARMV7 0x01C4 +#define IMAGE_FILE_MACHINE_THUMB 0x01C2 +#define IMAGE_FILE_MACHINE_IA64 0x0200 +#define IMAGE_FILE_MACHINE_AMD64 0x8664 +#define IMAGE_FILE_MACHINE_ARM64 0xAA64 + +/* Windows API processor architecture codes (common ones only) */ +#define PROCESSOR_ARCHITECTURE_INTEL 0 +#define PROCESSOR_ARCHITECTURE_ARM 5 +#define PROCESSOR_ARCHITECTURE_IA64 6 +#define PROCESSOR_ARCHITECTURE_AMD64 9 +#define PROCESSOR_ARCHITECTURE_ARM64 12 + +/* Translate a processor architecture code as given in a PE binary to the code + * used by the Windows API. Returns -1 if the code is not recognized. */ +static int +pe_arch_to_windows_arch(unsigned pe_arch) +{ + switch (pe_arch) { + case IMAGE_FILE_MACHINE_I386: + return PROCESSOR_ARCHITECTURE_INTEL; + case IMAGE_FILE_MACHINE_ARM: + case IMAGE_FILE_MACHINE_ARMV7: + case IMAGE_FILE_MACHINE_THUMB: + return PROCESSOR_ARCHITECTURE_ARM; + case IMAGE_FILE_MACHINE_IA64: + return PROCESSOR_ARCHITECTURE_IA64; + case IMAGE_FILE_MACHINE_AMD64: + return PROCESSOR_ARCHITECTURE_AMD64; + case IMAGE_FILE_MACHINE_ARM64: + return PROCESSOR_ARCHITECTURE_ARM64; + } + return -1; +} + +/* Gather information from kernel32.dll. */ +static void +set_info_from_kernel32(struct windows_info_ctx *ctx, + const void *contents, size_t size) +{ + u32 e_lfanew; + const u8 *pe_hdr; + unsigned pe_arch; + int arch; + + /* Read the processor architecture from the executable header. */ + + if (size < 0x40) + goto invalid; + + e_lfanew = le32_to_cpu(*(le32 *)((u8 *)contents + 0x3C)); + if (e_lfanew > size || size - e_lfanew < 6 || (e_lfanew & 3)) + goto invalid; + + pe_hdr = (u8 *)contents + e_lfanew; + if (*(le32 *)pe_hdr != cpu_to_le32(0x00004550)) /* "PE\0\0" */ + goto invalid; + + pe_arch = le16_to_cpu(*(le16 *)(pe_hdr + 4)); + arch = pe_arch_to_windows_arch(pe_arch); + if (arch >= 0) { + /* Save the processor architecture in the XML document. */ + set_number_property(ctx, T("WINDOWS/ARCH"), arch); + } else { + XML_WARN("Architecture value %x from kernel32.dll " + "header not recognized", pe_arch); + } + return; + +invalid: + XML_WARN("kernel32.dll is not a valid PE binary."); +} + +/* Gather information from the SOFTWARE registry hive. */ +static void +set_info_from_software_hive(struct windows_info_ctx *ctx, + const struct regf *regf) +{ + const tchar *version_key = T("Microsoft\\Windows NT\\CurrentVersion"); + s64 major_version = -1; + s64 minor_version = -1; + tchar *version_string; + tchar *build_string; + + /* Image flags */ + copy_registry_string(ctx, regf, version_key, T("EditionID"), + T("FLAGS")); + + /* Image display name */ + copy_registry_string(ctx, regf, version_key, T("ProductName"), + T("DISPLAYNAME")); + + /* Image display description */ + copy_registry_string(ctx, regf, version_key, T("ProductName"), + T("DISPLAYDESCRIPTION")); + + /* Edition ID */ + copy_registry_string(ctx, regf, version_key, T("EditionID"), + T("WINDOWS/EDITIONID")); + + /* Installation type */ + copy_registry_string(ctx, regf, version_key, T("InstallationType"), + T("WINDOWS/INSTALLATIONTYPE")); + + /* Product name */ + copy_registry_string(ctx, regf, version_key, T("ProductName"), + T("WINDOWS/PRODUCTNAME")); + + /* Major and minor version number */ + + /* Note: in Windows 10, CurrentVersion was apparently fixed at 6.3. + * Instead, the new values CurrentMajorVersionNumber and + * CurrentMinorVersionNumber should be used. */ + + get_number_from_registry(ctx, regf, version_key, + T("CurrentMajorVersionNumber"), &major_version); + + get_number_from_registry(ctx, regf, version_key, + T("CurrentMinorVersionNumber"), &minor_version); + + if (major_version < 0 || minor_version < 0) { + if (get_string_from_registry(ctx, regf, version_key, + T("CurrentVersion"), + &version_string)) + { + if (2 != tscanf(version_string, T("%"PRIi64".%"PRIi64), + &major_version, &minor_version)) + { + XML_WARN("Unrecognized CurrentVersion: %"TS, + version_string); + } + FREE(version_string); + } + } + + if (major_version >= 0) { + set_number_property(ctx, T("WINDOWS/VERSION/MAJOR"), + major_version); + if (minor_version >= 0) { + set_number_property(ctx, T("WINDOWS/VERSION/MINOR"), + minor_version); + } + } + + /* Build number */ + + /* Note: "CurrentBuild" is marked as obsolete in Windows XP registries + * (example value: "1.511.1 () (Obsolete data - do not use)"), and + * "CurrentBuildNumber" contains the correct value. But oddly enough, + * it is "CurrentBuild" that contains the correct value on *later* + * versions of Windows. */ + if (get_string_from_registry(ctx, regf, version_key, T("CurrentBuild"), + &build_string)) + { + if (tstrchr(build_string, T('.'))) { + FREE(build_string); + build_string = NULL; + get_string_from_registry(ctx, regf, version_key, + T("CurrentBuildNumber"), + &build_string); + } + if (build_string) { + set_string_property(ctx, T("WINDOWS/VERSION/BUILD"), + build_string); + FREE(build_string); + } + } +} + +/* Gather the default language from the SYSTEM registry hive. */ +static void +set_default_language(struct windows_info_ctx *ctx, const struct regf *regf) +{ + tchar *string; + unsigned language_id; + + if (!get_string_from_registry(ctx, regf, + T("ControlSet001\\Control\\Nls\\Language"), + T("InstallLanguage"), &string)) + return; + + if (1 == tscanf(string, T("%x"), &language_id)) { + const char *language_name = language_id_to_name(language_id); + if (language_name) { + size_t len = strlen(language_name); + tchar tstr[len + 1]; + for (size_t i = 0; i <= len; i++) + tstr[i] = language_name[i]; + set_string_property(ctx, T("WINDOWS/LANGUAGES/DEFAULT"), + tstr); + FREE(string); + return; + } + } + XML_WARN("Unrecognized InstallLanguage: %"TS, string); + FREE(string); +} + +/* Gather information from the SYSTEM registry hive. */ +static void +set_info_from_system_hive(struct windows_info_ctx *ctx, const struct regf *regf) +{ + const tchar *windows_key = T("ControlSet001\\Control\\Windows"); + const tchar *uilanguages_key = T("ControlSet001\\Control\\MUI\\UILanguages"); + const tchar *productoptions_key = T("ControlSet001\\Control\\ProductOptions"); + s64 spbuild; + s64 splevel; + tchar **subkeys; + + /* Service pack build */ + if (get_number_from_registry(ctx, regf, windows_key, + T("CSDBuildNumber"), &spbuild)) + set_number_property(ctx, T("WINDOWS/VERSION/SPBUILD"), spbuild); + + /* Service pack level */ + if (get_number_from_registry(ctx, regf, windows_key, + T("CSDVersion"), &splevel)) + set_number_property(ctx, T("WINDOWS/VERSION/SPLEVEL"), splevel >> 8); + + /* Product type */ + copy_registry_string(ctx, regf, productoptions_key, T("ProductType"), + T("WINDOWS/PRODUCTTYPE")); + + /* Product suite */ + copy_registry_string(ctx, regf, productoptions_key, T("ProductSuite"), + T("WINDOWS/PRODUCTSUITE")); + + /* Hardware abstraction layer */ + copy_registry_string(ctx, regf, + T("ControlSet001\\Control\\Class\\{4D36E966-E325-11CE-BFC1-08002BE10318}\\0000"), + T("MatchingDeviceId"), + T("WINDOWS/HAL")); + + /* Languages */ + if (list_subkeys_in_registry(ctx, regf, uilanguages_key, &subkeys)) { + tchar property_name[64]; + for (tchar **p = subkeys; *p; p++) { + tsprintf(property_name, + T("WINDOWS/LANGUAGES/LANGUAGE[%zu]"), p - subkeys + 1); + set_string_property(ctx, property_name, *p); + } + hive_free_subkeys_list(subkeys); + } + + /* Default language */ + set_default_language(ctx, regf); +} + +/* Load the contents of a file in the currently selected WIM image into memory. + */ +static void * +load_file_contents(struct windows_info_ctx *ctx, + const struct wim_dentry *dentry, const char *filename, + size_t *size_ret) +{ + const struct blob_descriptor *blob; + void *contents; + int ret; + + if (!dentry) { + XML_WARN("%s does not exist", filename); + return NULL; + } + + blob = inode_get_blob_for_unnamed_data_stream(dentry->d_inode, + ctx->wim->blob_table); + if (!blob) { + XML_WARN("%s has no contents", filename); + return NULL; + } + + ret = read_blob_into_alloc_buf(blob, &contents); + if (ret) { + XML_WARN("Error loading %s (size=%"PRIu64"): %"TS, + filename, blob->size, wimlib_get_error_string(ret)); + ctx->oom_encountered |= (ret == WIMLIB_ERR_NOMEM && + blob->size < 100000000); + return NULL; + } + + *size_ret = blob->size; + return contents; +} + +/* Load and validate a registry hive file. */ +static void * +load_hive(struct windows_info_ctx *ctx, const struct wim_dentry *dentry, + const char *filename) +{ + void *hive_mem; + size_t hive_size; + + hive_mem = load_file_contents(ctx, dentry, filename, &hive_size); + if (hive_mem && !is_registry_valid(ctx, hive_mem, hive_size)) { + XML_WARN("%s is not a valid registry hive!", filename); + FREE(hive_mem); + hive_mem = NULL; + } + return hive_mem; +} + +/* Set the WINDOWS/SYSTEMROOT property to the name of the directory specified by + * 'systemroot'. */ +static void +set_systemroot_property(struct windows_info_ctx *ctx, + const struct wim_dentry *systemroot) +{ + utf16lechar *uname; + const tchar *name; + size_t name_nbytes; + int ret; + + /* to uppercase ... */ + uname = utf16le_dupz(systemroot->d_name, systemroot->d_name_nbytes); + if (!uname) { + ctx->oom_encountered = true; + goto out; + } + for (size_t i = 0; i < systemroot->d_name_nbytes / 2; i++) + uname[i] = cpu_to_le16(upcase[le16_to_cpu(uname[i])]); + + /* to tstring ... */ + ret = utf16le_get_tstr(uname, systemroot->d_name_nbytes, + &name, &name_nbytes); + if (ret) { + ctx->oom_encountered |= (ret == WIMLIB_ERR_NOMEM); + XML_WARN("Failed to get systemroot name: %"TS, + wimlib_get_error_string(ret)); + goto out; + } + set_string_property(ctx, T("WINDOWS/SYSTEMROOT"), name); + utf16le_put_tstr(name); +out: + FREE(uname); +} + +static int +do_set_windows_specific_info(WIMStruct *wim, + const struct wim_dentry *systemroot, + const struct wim_dentry *kernel32, + const struct wim_dentry *software, + const struct wim_dentry *system) +{ + void *contents; + size_t size; + struct windows_info_ctx _ctx = { + .wim = wim, + .image = wim->current_image, + .oom_encountered = false, + .debug_enabled = (tgetenv(T("WIMLIB_DEBUG_XML_INFO")) != NULL), + }, *ctx = &_ctx; + + set_systemroot_property(ctx, systemroot); + + if ((contents = load_file_contents(ctx, kernel32, "kernel32.dll", &size))) { + set_info_from_kernel32(ctx, contents, size); + FREE(contents); + } + + if ((contents = load_hive(ctx, software, "SOFTWARE"))) { + set_info_from_software_hive(ctx, contents); + FREE(contents); + } + + if ((contents = load_hive(ctx, system, "SYSTEM"))) { + set_info_from_system_hive(ctx, contents); + FREE(contents); + } + + if (ctx->oom_encountered) { + ERROR("Ran out of memory while setting Windows-specific " + "metadata in the WIM file's XML document."); + return WIMLIB_ERR_NOMEM; + } + + return 0; +} + +/* Windows */ +static const utf16lechar windows_name[] = { + cpu_to_le16('W'), cpu_to_le16('i'), cpu_to_le16('n'), + cpu_to_le16('d'), cpu_to_le16('o'), cpu_to_le16('w'), + cpu_to_le16('s'), +}; + +/* System32 */ +static const utf16lechar system32_name[] = { + cpu_to_le16('S'), cpu_to_le16('y'), cpu_to_le16('s'), + cpu_to_le16('t'), cpu_to_le16('e'), cpu_to_le16('m'), + cpu_to_le16('3'), cpu_to_le16('2'), +}; + +/* kernel32.dll */ +static const utf16lechar kernel32_name[] = { + cpu_to_le16('k'), cpu_to_le16('e'), cpu_to_le16('r'), + cpu_to_le16('n'), cpu_to_le16('e'), cpu_to_le16('l'), + cpu_to_le16('3'), cpu_to_le16('2'), cpu_to_le16('.'), + cpu_to_le16('d'), cpu_to_le16('l'), cpu_to_le16('l'), +}; + +/* config */ +static const utf16lechar config_name[] = { + cpu_to_le16('c'), cpu_to_le16('o'), cpu_to_le16('n'), + cpu_to_le16('f'), cpu_to_le16('i'), cpu_to_le16('g'), +}; + +/* SOFTWARE */ +static const utf16lechar software_name[] = { + cpu_to_le16('S'), cpu_to_le16('O'), cpu_to_le16('F'), + cpu_to_le16('T'), cpu_to_le16('W'), cpu_to_le16('A'), + cpu_to_le16('R'), cpu_to_le16('E'), +}; + +/* SYSTEM */ +static const utf16lechar system_name[] = { + cpu_to_le16('S'), cpu_to_le16('Y'), cpu_to_le16('S'), + cpu_to_le16('T'), cpu_to_le16('E'), cpu_to_le16('M'), +}; + +#define GET_CHILD(parent, child_name) \ + get_dentry_child_with_utf16le_name(parent, \ + child_name, \ + sizeof(child_name), \ + WIMLIB_CASE_INSENSITIVE) + +static bool +is_default_systemroot(const struct wim_dentry *potential_systemroot) +{ + return !cmp_utf16le_strings(potential_systemroot->d_name, + potential_systemroot->d_name_nbytes / 2, + windows_name, + ARRAY_LEN(windows_name), + true); +} + +/* + * Set Windows-specific XML information for the currently selected WIM image. + * + * This process is heavily based on heuristics and hard-coded logic related to + * where Windows stores certain types of information. Therefore, it simply + * tries to set as much information as possible. If there's a problem, it skips + * the affected information and proceeds to the next part. It only returns an + * error code if there was a severe problem such as out-of-memory. + */ +int +set_windows_specific_info(WIMStruct *wim) +{ + const struct wim_dentry *root, *potential_systemroot, + *best_systemroot = NULL, + *best_kernel32 = NULL, + *best_software = NULL, + *best_system = NULL; + int best_score = 0; + + root = wim_get_current_root_dentry(wim); + if (!root) + return 0; + + /* Find the system root. This is usually the toplevel directory + * "Windows", but it might be a different toplevel directory. Choose + * the directory that contains the greatest number of the files we want: + * System32/kernel32.dll, System32/config/SOFTWARE, and + * System32/config/SYSTEM. Compare all names case insensitively. */ + for_dentry_child(potential_systemroot, root) { + const struct wim_dentry *system32, *kernel32, *config, + *software = NULL, *system = NULL; + int score; + + if (!dentry_is_directory(potential_systemroot)) + continue; + system32 = GET_CHILD(potential_systemroot, system32_name); + if (!system32) + continue; + kernel32 = GET_CHILD(system32, kernel32_name); + config = GET_CHILD(system32, config_name); + if (config) { + software = GET_CHILD(config, software_name); + system = GET_CHILD(config, system_name); + } + + score = !!kernel32 + !!software + !!system; + if (score >= best_score) { + /* If there's a tie, prefer the "Windows" directory. */ + if (score > best_score || + is_default_systemroot(potential_systemroot)) + { + best_score = score; + best_systemroot = potential_systemroot; + best_kernel32 = kernel32; + best_software = software; + best_system = system; + } + } + } + + if (likely(best_score == 0)) + return 0; /* No Windows system root found. */ + + /* Found the Windows system root. */ + return do_set_windows_specific_info(wim, best_systemroot, best_kernel32, + best_software, best_system); +} diff --git a/src/wimlib/xmlproc.c b/src/wimlib/xmlproc.c new file mode 100644 index 00000000..8ce193e9 --- /dev/null +++ b/src/wimlib/xmlproc.c @@ -0,0 +1,773 @@ +/* + * xmlproc.c + * + * A simple XML 1.0 processor. This handles all XML features that are used in + * WIM files, plus a bit more for futureproofing. It omits problematic + * features, such as expansion of entities other than simple escape sequences. + */ + +/* + * Copyright 2023 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <string.h> + +#include "wimlib/error.h" +#include "wimlib/test_support.h" +#include "wimlib/util.h" +#include "wimlib/xmlproc.h" + +/*----------------------------------------------------------------------------* + * XML node utility functions * + *----------------------------------------------------------------------------*/ + +static tchar * +tstrdupz(const tchar *str, size_t len) +{ + tchar *new_str = CALLOC(len + 1, sizeof(str[0])); + + if (new_str) + tmemcpy(new_str, str, len); + return new_str; +} + +static struct xml_node * +xml_new_node(struct xml_node *parent, enum xml_node_type type, + const tchar *name, size_t name_len, + const tchar *value, size_t value_len) +{ + struct xml_node *node = CALLOC(1, sizeof(*node)); + + if (!node) + return NULL; + node->type = type; + INIT_LIST_HEAD(&node->children); + if (name) { + node->name = tstrdupz(name, name_len); + if (!node->name) + goto oom; + } + if (value) { + node->value = tstrdupz(value, value_len); + if (!node->value) + goto oom; + } + if (parent) + xml_add_child(parent, node); + return node; + +oom: + xml_free_node(node); + return NULL; +} + +/* + * Create a new ELEMENT node, and if @parent is non-NULL add the new node under + * @parent which should be another ELEMENT. + */ +struct xml_node * +xml_new_element(struct xml_node *parent, const tchar *name) +{ + return xml_new_node(parent, XML_ELEMENT_NODE, name, tstrlen(name), + NULL, 0); +} + +/* + * Create a new ELEMENT node with an attached TEXT node, and if @parent is + * non-NULL add the new ELEMENT under @parent which should be another ELEMENT. + */ +struct xml_node * +xml_new_element_with_text(struct xml_node *parent, const tchar *name, + const tchar *text) +{ + struct xml_node *element = xml_new_element(parent, name); + + if (element && xml_element_set_text(element, text) != 0) { + xml_free_node(element); + return NULL; + } + return element; +} + +/* Append @child to the children list of @parent. */ +void +xml_add_child(struct xml_node *parent, struct xml_node *child) +{ + xml_unlink_node(child); /* Shouldn't be needed, but be safe. */ + child->parent = parent; + list_add_tail(&child->sibling_link, &parent->children); +} + +/* Unlink @node from its parent, if it has one. */ +void +xml_unlink_node(struct xml_node *node) +{ + if (node->parent) { + list_del(&node->sibling_link); + node->parent = NULL; + } +} + +static void +xml_free_children(struct xml_node *parent) +{ + struct xml_node *child, *tmp; + + list_for_each_entry_safe(child, tmp, &parent->children, sibling_link) + xml_free_node(child); +} + +/* Recursively free @node, first unlinking it if needed. @node may be NULL. */ +void +xml_free_node(struct xml_node *node) +{ + if (node) { + xml_unlink_node(node); + xml_free_children(node); + FREE(node->name); + FREE(node->value); + FREE(node); + } +} + +/* + * Return the text from the first TEXT child node of @element, or NULL if no + * such node exists. @element may be NULL. + */ +const tchar * +xml_element_get_text(const struct xml_node *element) +{ + const struct xml_node *child; + + xml_node_for_each_child(element, child) + if (child->type == XML_TEXT_NODE) + return child->value; + return NULL; +} + +/* + * Set the contents of the given @element to the given @text, replacing the + * entire existing contents if any. + */ +int +xml_element_set_text(struct xml_node *element, const tchar *text) +{ + struct xml_node *text_node = xml_new_node(NULL, XML_TEXT_NODE, NULL, 0, + text, tstrlen(text)); + if (!text_node) + return WIMLIB_ERR_NOMEM; + xml_free_children(element); + xml_add_child(element, text_node); + return 0; +} + +static int +xml_element_append_text(struct xml_node *element, + const tchar *text, size_t text_len) +{ + struct xml_node *last_child; + + if (!list_empty(&element->children) && + (last_child = + list_last_entry(&element->children, struct xml_node, + sibling_link))->type == XML_TEXT_NODE) { + /* + * The new TEXT would directly follow another TEXT, so simplify + * the tree by just appending to the existing TEXT. (This case + * can theoretically be reached via the use of CDATA...) + */ + size_t old_len = tstrlen(last_child->value); + tchar *new_value = CALLOC(old_len + text_len + 1, + sizeof(new_value[0])); + if (!new_value) + return WIMLIB_ERR_NOMEM; + tmemcpy(new_value, last_child->value, old_len); + tmemcpy(&new_value[old_len], text, text_len); + FREE(last_child->value); + last_child->value = new_value; + return 0; + } + if (!xml_new_node(element, XML_TEXT_NODE, NULL, 0, text, text_len)) + return WIMLIB_ERR_NOMEM; + return 0; +} + +/* Find the attribute with the given @name on @element. */ +struct xml_node * +xml_get_attrib(const struct xml_node *element, const tchar *name) +{ + struct xml_node *child; + + xml_node_for_each_child(element, child) { + if (child->type == XML_ATTRIBUTE_NODE && + !tstrcmp(child->name, name)) + return child; + } + return NULL; +} + +/* Set the attribute @name=@value on the given @element. */ +int +xml_set_attrib(struct xml_node *element, const tchar *name, const tchar *value) +{ + struct xml_node *attrib = xml_new_node(NULL, XML_ATTRIBUTE_NODE, + name, tstrlen(name), + value, tstrlen(value)); + if (!attrib) + return WIMLIB_ERR_NOMEM; + xml_replace_child(element, attrib); + return 0; +} + +/* + * Add the ELEMENT or ATTRIBUTE node @replacement under the ELEMENT @parent, + * replacing any node with the same type and name that already exists. + */ +void +xml_replace_child(struct xml_node *parent, struct xml_node *replacement) +{ + struct xml_node *child; + + xml_unlink_node(replacement); /* Shouldn't be needed, but be safe. */ + + xml_node_for_each_child(parent, child) { + if (child->type == replacement->type && + !tstrcmp(child->name, replacement->name)) { + list_replace(&child->sibling_link, + &replacement->sibling_link); + replacement->parent = parent; + child->parent = NULL; + xml_free_node(child); + return; + } + } + xml_add_child(parent, replacement); +} + +struct xml_node * +xml_clone_tree(struct xml_node *orig) +{ + struct xml_node *clone, *orig_child, *clone_child; + + clone = xml_new_node(NULL, orig->type, + orig->name, orig->name ? tstrlen(orig->name) : 0, + orig->value, orig->value ? tstrlen(orig->value) : 0); + if (!clone) + return NULL; + xml_node_for_each_child(orig, orig_child) { + clone_child = xml_clone_tree(orig_child); + if (!clone_child) + goto oom; + xml_add_child(clone, clone_child); + } + return clone; + +oom: + xml_free_node(clone); + return NULL; +} + +/*----------------------------------------------------------------------------* + * XML string validation * + *----------------------------------------------------------------------------*/ + +/* + * Functions that check for legal names and values in XML 1.0. These are + * currently slightly over-lenient, as they allow everything non-ASCII. These + * are also not currently used by the XML parser to reject non-well-formed + * documents, but rather just by the user of the XML processor (xml.c) in order + * to avoid introducing illegal names and values into the document. + */ + +static inline bool +is_whitespace(tchar c) +{ + return c == ' ' || c == '\n' || c == '\r' || c == '\t'; +} + +static inline bool +is_name_start_char(tchar c) +{ + return (c & 0x7f) != c /* overly lenient for now */ || + (c >= 'A' && c <= 'Z') || + (c >= 'a' && c <= 'z') || + c == ':' || c == '_'; +} + +static inline bool +is_name_char(tchar c) +{ + return is_name_start_char(c) || + (c >= '0' && c <= '9') || c == '-' || c == '.'; +} + +/* Allow characters used in element "paths"; see do_xml_path_walk() */ +static inline bool +is_path_char(tchar c) +{ + return c == '/' || c == '[' || c == ']'; +} + +bool +xml_legal_path(const tchar *p) +{ + if (!is_name_start_char(*p) && !is_path_char(*p)) + return false; + for (p = p + 1; *p; p++) { + if (!is_name_char(*p) && !is_path_char(*p)) + return false; + } + return true; +} + +bool +xml_legal_value(const tchar *p) +{ + for (; *p; p++) { + /* Careful: tchar can be signed. */ + if (*p > 0 && *p < 0x20 && !is_whitespace(*p)) + return false; + } + return true; +} + +#if TCHAR_IS_UTF16LE +#define BYTE_ORDER_MARK (tchar[]){ 0xfeff, 0 } +#else +#define BYTE_ORDER_MARK "\xEF\xBB\xBF" +#endif + +/*----------------------------------------------------------------------------* + * XML parsing * + *----------------------------------------------------------------------------*/ + +#define CHECK(cond) if (!(cond)) goto bad + +static inline void +skip_whitespace(const tchar **pp) +{ + const tchar *p = *pp; + + while (is_whitespace(*p)) + p++; + *pp = p; +} + +static inline bool +skip_string(const tchar **pp, const tchar *str) +{ + const tchar *p = *pp; + size_t len = tstrlen(str); + + if (tstrncmp(p, str, len)) + return false; + *pp = p + len; + return true; +} + +static inline bool +find_and_skip(const tchar **pp, const tchar *str) +{ + const tchar *p = *pp; + + p = tstrstr(p, str); + if (!p) + return false; + *pp = p + tstrlen(str); + return true; +} + +static bool +skip_misc(const tchar **pp) +{ + const tchar *p = *pp, *prev_p; + + do { + prev_p = p; + skip_whitespace(&p); + /* Discard XML declaration and top-level PIs for now. */ + if (skip_string(&p, T("<?")) && !find_and_skip(&p, T("?>"))) + return false; + /* Discard DOCTYPE declaration for now. */ + if (skip_string(&p, T("<!DOCTYPE")) && !find_and_skip(&p, T(">"))) + return false; + /* Discard top-level comments for now. */ + if (skip_string(&p, T("<!--")) && !find_and_skip(&p, T("-->"))) + return false; + } while (p != prev_p); + *pp = p; + return true; +} + +static inline const tchar * +get_escape_seq(tchar c) +{ + switch (c) { + case '<': + return T("&lt;"); + case '>': + return T("&gt;"); + case '&': + return T("&amp;"); + case '\'': + return T("&apos;"); + case '"': + return T("&quot;"); + } + return NULL; +} + +/* Note: 'str' must be NUL-terminated, but only 'len' chars are used. */ +static int +unescape_string(const tchar *str, size_t len, tchar **unescaped_ret) +{ + const tchar *in_p = str; + tchar *unescaped, *out_p; + + unescaped = CALLOC(len + 1, sizeof(str[0])); + if (!unescaped) + return WIMLIB_ERR_NOMEM; + out_p = unescaped; + while (in_p < &str[len]) { + if (*in_p != '&') + *out_p++ = *in_p++; + else if (skip_string(&in_p, T("&lt;"))) + *out_p++ = '<'; + else if (skip_string(&in_p, T("&gt;"))) + *out_p++ = '>'; + else if (skip_string(&in_p, T("&amp;"))) + *out_p++ = '&'; + else if (skip_string(&in_p, T("&apos;"))) + *out_p++ = '\''; + else if (skip_string(&in_p, T("&quot;"))) + *out_p++ = '"'; + else + goto bad; + } + if (in_p > &str[len]) + goto bad; + *unescaped_ret = unescaped; + return 0; + +bad: + ERROR("Error unescaping string '%.*"TS"'", (int)len, str); + FREE(unescaped); + return WIMLIB_ERR_XML; +} + +static int +parse_element(const tchar **pp, struct xml_node *parent, int depth, + struct xml_node **node_ret); + +static int +parse_contents(const tchar **pp, struct xml_node *element, int depth) +{ + const tchar *p = *pp; + int ret; + + for (;;) { + const tchar *raw_text = p; + tchar *text; + + for (; *p != '<'; p++) { + if (*p == '\0') + return WIMLIB_ERR_XML; + } + if (p > raw_text) { + ret = unescape_string(raw_text, p - raw_text, &text); + if (ret) + return ret; + ret = xml_element_append_text(element, text, + tstrlen(text)); + FREE(text); + if (ret) + return ret; + } + if (p[1] == '/') { + break; /* Reached the end tag of @element */ + } else if (p[1] == '?') { + /* Discard processing instructions for now. */ + p += 2; + if (!find_and_skip(&p, T("?>"))) + return WIMLIB_ERR_XML; + continue; + } else if (p[1] == '!') { + if (skip_string(&p, T("<![CDATA["))) { + raw_text = p; + if (!find_and_skip(&p, T("]]>"))) + return WIMLIB_ERR_XML; + ret = xml_element_append_text(element, raw_text, + p - 3 - raw_text); + if (ret) + return ret; + continue; + } else if (skip_string(&p, T("<!--"))) { + /* Discard comments for now. */ + if (!find_and_skip(&p, T("-->"))) + return WIMLIB_ERR_XML; + continue; + } + return WIMLIB_ERR_XML; + } + ret = parse_element(&p, element, depth + 1, NULL); + if (ret) + return ret; + } + *pp = p; + return 0; +} + +static int +parse_element(const tchar **pp, struct xml_node *parent, int depth, + struct xml_node **element_ret) +{ + const tchar *p = *pp; + struct xml_node *element = NULL; + const tchar *name_start; + size_t name_len; + int ret; + + /* Parse the start tag. */ + CHECK(depth < 50); + CHECK(*p == '<'); + p++; + name_start = p; + while (!is_whitespace(*p) && *p != '>' && *p != '/' && *p != '\0') + p++; + name_len = p - name_start; + CHECK(name_len > 0); + element = xml_new_node(parent, XML_ELEMENT_NODE, name_start, name_len, + NULL, 0); + if (!element) { + ret = WIMLIB_ERR_NOMEM; + goto error; + } + /* Parse the attributes list within the start tag. */ + while (is_whitespace(*p)) { + const tchar *attr_name_start, *attr_value_start; + size_t attr_name_len, attr_value_len; + tchar *attr_value; + tchar quote; + + skip_whitespace(&p); + if (*p == '/' || *p == '>') + break; + attr_name_start = p; + while (*p != '=' && !is_whitespace(*p) && *p != '\0') + p++; + attr_name_len = p - attr_name_start; + skip_whitespace(&p); + CHECK(attr_name_len > 0 && *p == '='); + p++; + skip_whitespace(&p); + quote = *p; + CHECK(quote == '\'' || quote == '"'); + attr_value_start = ++p; + while (*p != quote && *p != '\0') + p++; + CHECK(*p == quote); + attr_value_len = p - attr_value_start; + p++; + ret = unescape_string(attr_value_start, attr_value_len, + &attr_value); + if (ret) + goto error; + ret = xml_new_node(element, XML_ATTRIBUTE_NODE, + attr_name_start, attr_name_len, + attr_value, tstrlen(attr_value)) + ? 0 : WIMLIB_ERR_NOMEM; + FREE(attr_value); + if (ret) + goto error; + } + if (*p == '/') { + /* Closing an empty element tag */ + p++; + } else { + /* Closing the start tag */ + CHECK(*p == '>'); + p++; + /* Parse the contents, then the end tag. */ + ret = parse_contents(&p, element, depth); + if (ret) + goto error; + CHECK(*p == '<'); + p++; + CHECK(*p == '/'); + p++; + CHECK(!tstrncmp(p, name_start, name_len)); + p += name_len; + skip_whitespace(&p); + } + CHECK(*p == '>'); + p++; + *pp = p; + if (element_ret) + *element_ret = element; + return 0; + +error: + xml_free_node(element); + return ret; + +bad: + ret = WIMLIB_ERR_XML; + goto error; +} + +/* + * Deserialize an XML document and return its root node in @doc_ret. The + * document must be given as a NUL-terminated string of 'tchar', i.e. UTF-16LE + * in Windows builds and UTF-8 everywhere else. + */ +int +xml_parse_document(const tchar *p, struct xml_node **doc_ret) +{ + int ret; + struct xml_node *doc; + + skip_string(&p, BYTE_ORDER_MARK); + if (!skip_misc(&p)) + return WIMLIB_ERR_XML; + ret = parse_element(&p, NULL, 0, &doc); + if (ret) + return ret; + if (!skip_misc(&p) || *p) { + xml_free_node(doc); + return WIMLIB_ERR_XML; + } + *doc_ret = doc; + return 0; +} + +/*----------------------------------------------------------------------------* + * XML writing * + *----------------------------------------------------------------------------*/ + +static void +xml_write(struct xml_out_buf *buf, const tchar *str, size_t len) +{ + if (buf->count + len + 1 > buf->capacity) { + size_t new_capacity = max3(buf->count + len + 1, + buf->capacity * 2, 4096); + tchar *new_buf = REALLOC(buf->buf, + new_capacity * sizeof(str[0])); + if (!new_buf) { + buf->oom = true; + return; + } + buf->buf = new_buf; + buf->capacity = new_capacity; + } + tmemcpy(&buf->buf[buf->count], str, len); + buf->count += len; +} + +static void +xml_puts(struct xml_out_buf *buf, const tchar *str) +{ + xml_write(buf, str, tstrlen(str)); +} + +static void +xml_escape_and_puts(struct xml_out_buf *buf, const tchar *str) +{ + const tchar *p = str, *saved, *seq = NULL; + + for (;; p++) { + for (saved = p; *p && (seq = get_escape_seq(*p)) == NULL; p++) + ; + xml_write(buf, saved, p - saved); + if (!*p) + return; + xml_puts(buf, seq); + } +} + +static void +xml_write_element(struct xml_node *element, struct xml_out_buf *buf) +{ + struct xml_node *child; + + /* Write the start tag. */ + xml_puts(buf, T("<")); + xml_puts(buf, element->name); + xml_node_for_each_child(element, child) { + if (child->type == XML_ATTRIBUTE_NODE) { + xml_puts(buf, T(" ")); + xml_puts(buf, child->name); + xml_puts(buf, T("=\"")); + xml_escape_and_puts(buf, child->value); + xml_puts(buf, T("\"")); + } + } + xml_puts(buf, T(">")); + + /* Write the contents. */ + xml_node_for_each_child(element, child) { + if (child->type == XML_TEXT_NODE) + xml_escape_and_puts(buf, child->value); + else if (child->type == XML_ELEMENT_NODE) + xml_write_element(child, buf); + } + + /* Write the end tag. */ + xml_puts(buf, T("</")); + xml_puts(buf, element->name); + xml_puts(buf, T(">")); +} + +/* + * Serialize the document @doc into @buf as a NUL-terminated string of 'tchar', + * i.e. UTF-16LE in Windows builds and UTF-8 everywhere else. A byte order mark + * (BOM) is included, as this is needed for compatibility with WIMGAPI. + */ +int +xml_write_document(struct xml_node *doc, struct xml_out_buf *buf) +{ + xml_puts(buf, BYTE_ORDER_MARK); + xml_write_element(doc, buf); + if (buf->oom) + return WIMLIB_ERR_NOMEM; + buf->buf[buf->count] = '\0'; + return 0; +} + +/*----------------------------------------------------------------------------* + * Test support * + *----------------------------------------------------------------------------*/ + +#ifdef ENABLE_TEST_SUPPORT +WIMLIBAPI int +wimlib_parse_and_write_xml_doc(const tchar *in, tchar **out_ret) +{ + struct xml_node *doc; + struct xml_out_buf buf = {}; + int ret; + + ret = xml_parse_document(in, &doc); + if (ret) + return ret; + ret = xml_write_document(doc, &buf); + xml_free_node(doc); + *out_ret = buf.buf; + return ret; +} +#endif /* ENABLE_TEST_SUPPORT */ diff --git a/src/wimlib/xpress_compress.c b/src/wimlib/xpress_compress.c new file mode 100644 index 00000000..e192c870 --- /dev/null +++ b/src/wimlib/xpress_compress.c @@ -0,0 +1,1183 @@ +/* + * xpress_compress.c + * + * A compressor for the XPRESS compression format (Huffman variant). + */ + +/* + * Copyright (C) 2012, 2013, 2014 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +/* + * The maximum buffer size, in bytes, that can be compressed. An XPRESS + * compressor instance must be created with a 'max_bufsize' less than or equal + * to this value. + */ +#define XPRESS_MAX_BUFSIZE 65536 + +/* + * Define to 1 to enable the near-optimal parsing algorithm at high compression + * levels. The near-optimal parsing algorithm produces a compression ratio + * significantly better than the greedy and lazy algorithms. However, it is + * much slower. + */ +#define SUPPORT_NEAR_OPTIMAL_PARSING 1 + +/* + * The lowest compression level at which near-optimal parsing is enabled. + */ +#define MIN_LEVEL_FOR_NEAR_OPTIMAL 60 + +/* + * Matchfinder definitions. For XPRESS, only a 16-bit matchfinder is needed. + */ +#define mf_pos_t u16 +#define MF_SUFFIX + +/* + * Note: although XPRESS can potentially use a sliding window, it isn't well + * suited for large buffers of data because there is no way to reset the Huffman + * code. Therefore, we only allow buffers in which there is no restriction on + * match offsets (no sliding window). This simplifies the code and allows some + * optimizations. + */ + +#include "wimlib/bitops.h" +#include "wimlib/compress_common.h" +#include "wimlib/compressor_ops.h" +#include "wimlib/endianness.h" +#include "wimlib/error.h" +#include "wimlib/hc_matchfinder.h" +#include "wimlib/unaligned.h" +#include "wimlib/util.h" +#include "wimlib/xpress_constants.h" + +#if SUPPORT_NEAR_OPTIMAL_PARSING + +/* + * CACHE_RESERVE_PER_POS is the number of lz_match structures to reserve in the + * match cache for each byte position. This value should be high enough so that + * virtually the time, all matches found in the input buffer can fit in the + * match cache. However, fallback behavior on cache overflow is still required. + */ +#define CACHE_RESERVE_PER_POS 8 + +/* + * We use a binary-tree based matchfinder for optimal parsing because it can + * find more matches in the same number of steps compared to hash-chain based + * matchfinders. In addition, since we need to find matches at almost every + * position, there isn't much penalty for keeping the sequences sorted in the + * binary trees. + */ +#include "wimlib/bt_matchfinder.h" + +struct xpress_optimum_node; + +#endif /* SUPPORT_NEAR_OPTIMAL_PARSING */ + +struct xpress_item; + +/* The main XPRESS compressor structure */ +struct xpress_compressor { + + /* Pointer to the compress() implementation chosen at allocation time */ + size_t (*impl)(struct xpress_compressor *, + const void *, size_t, void *, size_t); + + /* Symbol frequency counters for the Huffman code */ + u32 freqs[XPRESS_NUM_SYMBOLS]; + + /* The Huffman codewords and their lengths */ + u32 codewords[XPRESS_NUM_SYMBOLS]; + u8 lens[XPRESS_NUM_SYMBOLS]; + + /* The "nice" match length: if a match of this length is found, then + * choose it immediately without further consideration. */ + unsigned nice_match_length; + + /* The maximum search depth: consider at most this many potential + * matches at each position. */ + unsigned max_search_depth; + + union { + /* Data for greedy or lazy parsing */ + struct { + struct xpress_item *chosen_items; + struct hc_matchfinder hc_mf; + /* hc_mf must be last! */ + }; + + #if SUPPORT_NEAR_OPTIMAL_PARSING + /* Data for near-optimal parsing */ + struct { + struct xpress_optimum_node *optimum_nodes; + struct lz_match *match_cache; + struct lz_match *cache_overflow_mark; + unsigned num_optim_passes; + u32 costs[XPRESS_NUM_SYMBOLS]; + struct bt_matchfinder bt_mf; + /* bt_mf must be last! */ + }; + #endif + }; +}; + +#if SUPPORT_NEAR_OPTIMAL_PARSING + +/* + * This structure represents a byte position in the input buffer and a node in + * the graph of possible match/literal choices. + * + * Logically, each incoming edge to this node is labeled with a literal or a + * match that can be taken to reach this position from an earlier position; and + * each outgoing edge from this node is labeled with a literal or a match that + * can be taken to advance from this position to a later position. + * + * But these "edges" are actually stored elsewhere (in 'match_cache'). Here we + * associate with each node just two pieces of information: + * + * 'cost_to_end' is the minimum cost to reach the end of the buffer from + * this position. + * + * 'item' represents the literal or match that must be chosen from here to + * reach the end of the buffer with the minimum cost. Equivalently, this + * can be interpreted as the label of the outgoing edge on the minimum cost + * path to the "end of buffer" node from this node. + */ +struct xpress_optimum_node { + + u32 cost_to_end; + + /* + * Notes on the match/literal representation used here: + * + * The low bits of 'item' are the length: 1 if the item is a + * literal, or the match length if the item is a match. + * + * The high bits of 'item' are the actual literal byte if the item + * is a literal, or the match offset if the item is a match. + */ +#define OPTIMUM_OFFSET_SHIFT 16 +#define OPTIMUM_LEN_MASK (((u32)1 << OPTIMUM_OFFSET_SHIFT) - 1) + u32 item; +}; + +#endif /* SUPPORT_NEAR_OPTIMAL_PARSING */ + +/* An intermediate representation of an XPRESS match or literal */ +struct xpress_item { + /* + * Bits 0 - 8: Symbol + * Bits 9 - 24: Length - XPRESS_MIN_MATCH_LEN + * Bits 25 - 28: Number of extra offset bits + * Bits 29+ : Extra offset bits + * + * Unfortunately, gcc generates worse code if we use real bitfields here. + */ + u64 data; +}; + +/* + * Structure to keep track of the current state of sending compressed data to + * the output buffer. + * + * The XPRESS bitstream is encoded as a sequence of little endian 16-bit coding + * units interwoven with literal bytes. + */ +struct xpress_output_bitstream { + + /* Bits that haven't yet been written to the output buffer. */ + u32 bitbuf; + + /* Number of bits currently held in @bitbuf. */ + u32 bitcount; + + /* Pointer to the start of the output buffer. */ + u8 *start; + + /* Pointer to the location in the output buffer at which to write the + * next 16 bits. */ + u8 *next_bits; + + /* Pointer to the location in the output buffer at which to write the + * next 16 bits, after @next_bits. */ + u8 *next_bits2; + + /* Pointer to the location in the output buffer at which to write the + * next literal byte. */ + u8 *next_byte; + + /* Pointer to the end of the output buffer. */ + u8 *end; +}; + +/* Reset the symbol frequencies for the XPRESS Huffman code. */ +static void +xpress_reset_symbol_frequencies(struct xpress_compressor *c) +{ + memset(c->freqs, 0, sizeof(c->freqs)); +} + +/* + * Make the Huffman code for XPRESS. + * + * Input: c->freqs + * Output: c->lens and c->codewords + */ +static void +xpress_make_huffman_code(struct xpress_compressor *c) +{ + make_canonical_huffman_code(XPRESS_NUM_SYMBOLS, XPRESS_MAX_CODEWORD_LEN, + c->freqs, c->lens, c->codewords); +} + +/* + * Initialize the output bitstream. + * + * @os + * The output bitstream structure to initialize. + * @buffer + * The output buffer. + * @size + * Size of @buffer, in bytes. Must be at least 4. + */ +static void +xpress_init_output(struct xpress_output_bitstream *os, void *buffer, size_t size) +{ + os->bitbuf = 0; + os->bitcount = 0; + os->start = buffer; + os->next_bits = os->start; + os->next_bits2 = os->start + 2; + os->next_byte = os->start + 4; + os->end = os->start + size; +} + +/* + * Write some bits to the output bitstream. + * + * The bits are given by the low-order @num_bits bits of @bits. Higher-order + * bits in @bits cannot be set. At most 16 bits can be written at once. + * + * If the output buffer space is exhausted, then the bits will be ignored, and + * xpress_flush_output() will return 0 when it gets called. + */ +static forceinline void +xpress_write_bits(struct xpress_output_bitstream *os, + const u32 bits, const unsigned num_bits) +{ + /* This code is optimized for XPRESS, which never needs to write more + * than 16 bits at once. */ + + os->bitcount += num_bits; + os->bitbuf = (os->bitbuf << num_bits) | bits; + + if (os->bitcount > 16) { + os->bitcount -= 16; + if (os->end - os->next_byte >= 2) { + put_unaligned_le16(os->bitbuf >> os->bitcount, os->next_bits); + os->next_bits = os->next_bits2; + os->next_bits2 = os->next_byte; + os->next_byte += 2; + } + } +} + +/* + * Interweave a literal byte into the output bitstream. + */ +static forceinline void +xpress_write_byte(struct xpress_output_bitstream *os, u8 byte) +{ + if (os->next_byte < os->end) + *os->next_byte++ = byte; +} + +/* + * Interweave two literal bytes into the output bitstream. + */ +static forceinline void +xpress_write_u16(struct xpress_output_bitstream *os, u16 v) +{ + if (os->end - os->next_byte >= 2) { + put_unaligned_le16(v, os->next_byte); + os->next_byte += 2; + } +} + +/* + * Flush the last coding unit to the output buffer if needed. Return the total + * number of bytes written to the output buffer, or 0 if an overflow occurred. + */ +static size_t +xpress_flush_output(struct xpress_output_bitstream *os) +{ + if (os->end - os->next_byte < 2) + return 0; + + put_unaligned_le16(os->bitbuf << (16 - os->bitcount), os->next_bits); + put_unaligned_le16(0, os->next_bits2); + + return os->next_byte - os->start; +} + +static forceinline void +xpress_write_extra_length_bytes(struct xpress_output_bitstream *os, + unsigned adjusted_len) +{ + /* If length >= 18, output one extra length byte. + * If length >= 273, output three (total) extra length bytes. */ + if (adjusted_len >= 0xF) { + u8 byte1 = min(adjusted_len - 0xF, 0xFF); + xpress_write_byte(os, byte1); + if (byte1 == 0xFF) + xpress_write_u16(os, adjusted_len); + } +} + +/* Output a match or literal. */ +static forceinline void +xpress_write_item(struct xpress_item item, struct xpress_output_bitstream *os, + const u32 codewords[], const u8 lens[]) +{ + u64 data = item.data; + unsigned symbol = data & 0x1FF; + + xpress_write_bits(os, codewords[symbol], lens[symbol]); + + if (symbol >= XPRESS_NUM_CHARS) { + /* Match, not a literal */ + xpress_write_extra_length_bytes(os, (data >> 9) & 0xFFFF); + xpress_write_bits(os, data >> 29, (data >> 25) & 0xF); + } +} + +/* Output a sequence of XPRESS matches and literals. */ +static void +xpress_write_items(struct xpress_output_bitstream *os, + const struct xpress_item items[], size_t num_items, + const u32 codewords[], const u8 lens[]) +{ + for (size_t i = 0; i < num_items; i++) + xpress_write_item(items[i], os, codewords, lens); +} + +#if SUPPORT_NEAR_OPTIMAL_PARSING + +/* + * Follow the minimum cost path in the graph of possible match/literal choices + * and write out the matches/literals using the specified Huffman code. + * + * Note: this is slightly duplicated with xpress_write_items(). However, we + * don't want to waste time translating between intermediate match/literal + * representations. + */ +static void +xpress_write_item_list(struct xpress_output_bitstream *os, + struct xpress_optimum_node *optimum_nodes, + size_t count, const u32 codewords[], const u8 lens[]) +{ + struct xpress_optimum_node *cur_node = optimum_nodes; + struct xpress_optimum_node *end_node = optimum_nodes + count; + do { + unsigned length = cur_node->item & OPTIMUM_LEN_MASK; + unsigned offset = cur_node->item >> OPTIMUM_OFFSET_SHIFT; + + if (length == 1) { + /* Literal */ + unsigned literal = offset; + + xpress_write_bits(os, codewords[literal], lens[literal]); + } else { + /* Match */ + unsigned adjusted_len; + unsigned log2_offset; + unsigned len_hdr; + unsigned sym; + + adjusted_len = length - XPRESS_MIN_MATCH_LEN; + log2_offset = bsr32(offset); + len_hdr = min(0xF, adjusted_len); + sym = XPRESS_NUM_CHARS + ((log2_offset << 4) | len_hdr); + + xpress_write_bits(os, codewords[sym], lens[sym]); + xpress_write_extra_length_bytes(os, adjusted_len); + xpress_write_bits(os, offset - (1U << log2_offset), + log2_offset); + } + cur_node += length; + } while (cur_node != end_node); +} +#endif /* SUPPORT_NEAR_OPTIMAL_PARSING */ + +/* + * Output the XPRESS-compressed data, given the sequence of match/literal + * "items" that was chosen to represent the input data. + * + * If @near_optimal is %false, then the items are taken from the array + * c->chosen_items[0...count]. + * + * If @near_optimal is %true, then the items are taken from the minimum cost + * path stored in c->optimum_nodes[0...count]. + */ +static size_t +xpress_write(struct xpress_compressor *c, void *out, size_t out_nbytes_avail, + size_t count, bool near_optimal) +{ + u8 *cptr; + struct xpress_output_bitstream os; + size_t out_size; + + /* Account for the end-of-data symbol and make the Huffman code. */ + c->freqs[XPRESS_END_OF_DATA]++; + xpress_make_huffman_code(c); + + /* Output the Huffman code as a series of 512 4-bit lengths. */ + cptr = out; + for (unsigned i = 0; i < XPRESS_NUM_SYMBOLS; i += 2) + *cptr++ = (c->lens[i + 1] << 4) | c->lens[i]; + + xpress_init_output(&os, cptr, out_nbytes_avail - XPRESS_NUM_SYMBOLS / 2); + + /* Output the Huffman-encoded items. */ +#if SUPPORT_NEAR_OPTIMAL_PARSING + if (near_optimal) { + xpress_write_item_list(&os, c->optimum_nodes, count, + c->codewords, c->lens); + + } else +#endif + { + xpress_write_items(&os, c->chosen_items, count, + c->codewords, c->lens); + } + + /* Write the end-of-data symbol (needed for MS compatibility) */ + xpress_write_bits(&os, c->codewords[XPRESS_END_OF_DATA], + c->lens[XPRESS_END_OF_DATA]); + + /* Flush any pending data. Then return the compressed size if the + * compressed data fit in the output buffer, or 0 if it did not. */ + out_size = xpress_flush_output(&os); + if (out_size == 0) + return 0; + + return out_size + XPRESS_NUM_SYMBOLS / 2; +} + +/* Tally the Huffman symbol for a literal and return the intermediate + * representation of that literal. */ +static forceinline struct xpress_item +xpress_record_literal(struct xpress_compressor *c, unsigned literal) +{ + c->freqs[literal]++; + + return (struct xpress_item) { + .data = literal, + }; +} + +/* Tally the Huffman symbol for a match and return the intermediate + * representation of that match. */ +static forceinline struct xpress_item +xpress_record_match(struct xpress_compressor *c, unsigned length, unsigned offset) +{ + unsigned adjusted_len = length - XPRESS_MIN_MATCH_LEN; + unsigned len_hdr = min(adjusted_len, 0xF); + unsigned log2_offset = bsr32(offset); + unsigned sym = XPRESS_NUM_CHARS + ((log2_offset << 4) | len_hdr); + + c->freqs[sym]++; + + return (struct xpress_item) { + .data = (u64)sym | + ((u64)adjusted_len << 9) | + ((u64)log2_offset << 25) | + ((u64)(offset ^ (1U << log2_offset)) << 29), + }; +} + +/* + * This is the "greedy" XPRESS compressor. It always chooses the longest match. + * (Exception: as a heuristic, we pass up length 3 matches that have large + * offsets.) + */ +static size_t +xpress_compress_greedy(struct xpress_compressor * restrict c, + const void * restrict in, size_t in_nbytes, + void * restrict out, size_t out_nbytes_avail) +{ + const u8 * const in_begin = in; + const u8 * in_next = in_begin; + const u8 * const in_end = in_begin + in_nbytes; + struct xpress_item *next_chosen_item = c->chosen_items; + unsigned len_3_too_far; + u32 next_hashes[2] = {}; + + if (in_nbytes <= 8192) + len_3_too_far = 2048; + else + len_3_too_far = 4096; + + hc_matchfinder_init(&c->hc_mf); + + do { + unsigned length; + unsigned offset; + + length = hc_matchfinder_longest_match(&c->hc_mf, + in_begin, + in_next, + XPRESS_MIN_MATCH_LEN - 1, + in_end - in_next, + min(in_end - in_next, c->nice_match_length), + c->max_search_depth, + next_hashes, + &offset); + if (length >= XPRESS_MIN_MATCH_LEN && + !(length == XPRESS_MIN_MATCH_LEN && offset >= len_3_too_far)) + { + /* Match found */ + *next_chosen_item++ = + xpress_record_match(c, length, offset); + in_next += 1; + hc_matchfinder_skip_bytes(&c->hc_mf, + in_begin, + in_next, + in_end, + length - 1, + next_hashes); + in_next += length - 1; + } else { + /* No match found */ + *next_chosen_item++ = + xpress_record_literal(c, *in_next); + in_next += 1; + } + } while (in_next != in_end); + + return xpress_write(c, out, out_nbytes_avail, + next_chosen_item - c->chosen_items, false); +} + +/* + * This is the "lazy" XPRESS compressor. Before choosing a match, it checks to + * see if there's a longer match at the next position. If yes, it outputs a + * literal and continues to the next position. If no, it outputs the match. + */ +static size_t +xpress_compress_lazy(struct xpress_compressor * restrict c, + const void * restrict in, size_t in_nbytes, + void * restrict out, size_t out_nbytes_avail) +{ + const u8 * const in_begin = in; + const u8 * in_next = in_begin; + const u8 * const in_end = in_begin + in_nbytes; + struct xpress_item *next_chosen_item = c->chosen_items; + unsigned len_3_too_far; + u32 next_hashes[2] = {}; + + if (in_nbytes <= 8192) + len_3_too_far = 2048; + else + len_3_too_far = 4096; + + hc_matchfinder_init(&c->hc_mf); + + do { + unsigned cur_len; + unsigned cur_offset; + unsigned next_len; + unsigned next_offset; + + /* Find the longest match at the current position. */ + cur_len = hc_matchfinder_longest_match(&c->hc_mf, + in_begin, + in_next, + XPRESS_MIN_MATCH_LEN - 1, + in_end - in_next, + min(in_end - in_next, c->nice_match_length), + c->max_search_depth, + next_hashes, + &cur_offset); + in_next += 1; + + if (cur_len < XPRESS_MIN_MATCH_LEN || + (cur_len == XPRESS_MIN_MATCH_LEN && + cur_offset >= len_3_too_far)) + { + /* No match found. Choose a literal. */ + *next_chosen_item++ = + xpress_record_literal(c, *(in_next - 1)); + continue; + } + + have_cur_match: + /* We have a match at the current position. */ + + /* If the current match is very long, choose it immediately. */ + if (cur_len >= c->nice_match_length) { + + *next_chosen_item++ = + xpress_record_match(c, cur_len, cur_offset); + + hc_matchfinder_skip_bytes(&c->hc_mf, + in_begin, + in_next, + in_end, + cur_len - 1, + next_hashes); + in_next += cur_len - 1; + continue; + } + + /* + * Try to find a match at the next position. + * + * Note: since we already have a match at the *current* + * position, we use only half the 'max_search_depth' when + * checking the *next* position. This is a useful trade-off + * because it's more worthwhile to use a greater search depth on + * the initial match than on the next match (since a lot of the + * time, that next match won't even be used). + * + * Note: it's possible to structure the code such that there's + * only one call to longest_match(), which handles both the + * "find the initial match" and "try to find a longer match" + * cases. However, it is faster to have two call sites, with + * longest_match() inlined at each. + */ + next_len = hc_matchfinder_longest_match(&c->hc_mf, + in_begin, + in_next, + cur_len, + in_end - in_next, + min(in_end - in_next, c->nice_match_length), + c->max_search_depth / 2, + next_hashes, + &next_offset); + in_next += 1; + + if (next_len > cur_len) { + /* Found a longer match at the next position, so output + * a literal. */ + *next_chosen_item++ = + xpress_record_literal(c, *(in_next - 2)); + cur_len = next_len; + cur_offset = next_offset; + goto have_cur_match; + } else { + /* Didn't find a longer match at the next position, so + * output the current match. */ + *next_chosen_item++ = + xpress_record_match(c, cur_len, cur_offset); + hc_matchfinder_skip_bytes(&c->hc_mf, + in_begin, + in_next, + in_end, + cur_len - 2, + next_hashes); + in_next += cur_len - 2; + continue; + } + } while (in_next != in_end); + + return xpress_write(c, out, out_nbytes_avail, + next_chosen_item - c->chosen_items, false); +} + +#if SUPPORT_NEAR_OPTIMAL_PARSING + +/* + * Set Huffman symbol costs for the first optimization pass. + * + * It works well to assume that each Huffman symbol is equally probable. This + * results in each symbol being assigned a cost of -log2(1.0/num_syms) where + * 'num_syms' is the number of symbols in the alphabet. + */ +static void +xpress_set_default_costs(struct xpress_compressor *c) +{ + for (unsigned i = 0; i < XPRESS_NUM_SYMBOLS; i++) + c->costs[i] = 9; +} + +/* Update the cost model based on the codeword lengths @c->lens. */ +static void +xpress_update_costs(struct xpress_compressor *c) +{ + for (unsigned i = 0; i < XPRESS_NUM_SYMBOLS; i++) + c->costs[i] = c->lens[i] ? c->lens[i] : XPRESS_MAX_CODEWORD_LEN; +} + +/* + * Follow the minimum cost path in the graph of possible match/literal choices + * and compute the frequencies of the Huffman symbols that are needed to output + * those matches and literals. + */ +static void +xpress_tally_item_list(struct xpress_compressor *c, + struct xpress_optimum_node *end_node) +{ + struct xpress_optimum_node *cur_node = c->optimum_nodes; + + do { + unsigned length = cur_node->item & OPTIMUM_LEN_MASK; + unsigned offset = cur_node->item >> OPTIMUM_OFFSET_SHIFT; + + if (length == 1) { + /* Literal */ + unsigned literal = offset; + + c->freqs[literal]++; + } else { + /* Match */ + unsigned adjusted_len; + unsigned log2_offset; + unsigned len_hdr; + unsigned sym; + + adjusted_len = length - XPRESS_MIN_MATCH_LEN; + log2_offset = bsr32(offset); + len_hdr = min(0xF, adjusted_len); + sym = XPRESS_NUM_CHARS + ((log2_offset << 4) | len_hdr); + + c->freqs[sym]++; + } + cur_node += length; + } while (cur_node != end_node); +} + +/* + * Find a new minimum cost path through the graph of possible match/literal + * choices. We find the minimum cost path from 'c->optimum_nodes[0]', which + * represents the node at the beginning of the input buffer, to + * 'c->optimum_nodes[in_nbytes]', which represents the node at the end of the + * input buffer. Edge costs are evaluated using the cost model 'c->costs'. + * + * The algorithm works backward, starting at 'c->optimum_nodes[in_nbytes]' and + * proceeding backwards one position at a time. At each position, the minimum + * cost to reach 'c->optimum_nodes[in_nbytes]' from that position is computed + * and the match/literal choice is saved. + */ +static void +xpress_find_min_cost_path(struct xpress_compressor *c, size_t in_nbytes, + struct lz_match *end_cache_ptr) +{ + struct xpress_optimum_node *cur_node = c->optimum_nodes + in_nbytes; + struct lz_match *cache_ptr = end_cache_ptr; + + cur_node->cost_to_end = 0; + do { + unsigned literal; + u32 best_item; + u32 best_cost_to_end; + unsigned num_matches; + struct lz_match *match; + unsigned len; + + cur_node--; + cache_ptr--; + + literal = cache_ptr->offset; + + /* Consider coding a literal. */ + best_item = ((u32)literal << OPTIMUM_OFFSET_SHIFT) | 1; + best_cost_to_end = c->costs[literal] + + (cur_node + 1)->cost_to_end; + + num_matches = cache_ptr->length; + + if (num_matches == 0) { + /* No matches; the only choice is the literal. */ + cur_node->cost_to_end = best_cost_to_end; + cur_node->item = best_item; + continue; + } + + /* + * Consider each match length from the minimum + * (XPRESS_MIN_MATCH_LEN) to the length of the longest match + * found at this position. For each length, consider only the + * smallest offset for which that length is available. Although + * this is not guaranteed to be optimal due to the possibility + * of a larger offset costing less than a smaller offset to + * code, this is a very useful heuristic. + */ + match = cache_ptr - num_matches; + len = XPRESS_MIN_MATCH_LEN; + if (cache_ptr[-1].length < 0xF + XPRESS_MIN_MATCH_LEN) { + /* All lengths are small. Optimize accordingly. */ + do { + unsigned offset; + unsigned log2_offset; + u32 offset_cost; + + offset = match->offset; + log2_offset = bsr32(offset); + offset_cost = log2_offset; + do { + unsigned len_hdr; + unsigned sym; + u32 cost_to_end; + + len_hdr = len - XPRESS_MIN_MATCH_LEN; + sym = XPRESS_NUM_CHARS + + ((log2_offset << 4) | len_hdr); + cost_to_end = + offset_cost + c->costs[sym] + + (cur_node + len)->cost_to_end; + if (cost_to_end < best_cost_to_end) { + best_cost_to_end = cost_to_end; + best_item = + ((u32)offset << + OPTIMUM_OFFSET_SHIFT) | len; + } + } while (++len <= match->length); + } while (++match != cache_ptr); + } else { + /* Some lengths are big. */ + do { + unsigned offset; + unsigned log2_offset; + u32 offset_cost; + + offset = match->offset; + log2_offset = bsr32(offset); + offset_cost = log2_offset; + do { + unsigned adjusted_len; + unsigned len_hdr; + unsigned sym; + u32 cost_to_end; + + adjusted_len = len - XPRESS_MIN_MATCH_LEN; + len_hdr = min(adjusted_len, 0xF); + sym = XPRESS_NUM_CHARS + + ((log2_offset << 4) | len_hdr); + cost_to_end = + offset_cost + c->costs[sym] + + (cur_node + len)->cost_to_end; + if (adjusted_len >= 0xF) { + cost_to_end += 8; + if (adjusted_len - 0xF >= 0xFF) + cost_to_end += 16; + } + if (cost_to_end < best_cost_to_end) { + best_cost_to_end = cost_to_end; + best_item = + ((u32)offset << + OPTIMUM_OFFSET_SHIFT) | len; + } + } while (++len <= match->length); + } while (++match != cache_ptr); + } + cache_ptr -= num_matches; + cur_node->cost_to_end = best_cost_to_end; + cur_node->item = best_item; + } while (cur_node != c->optimum_nodes); +} + +/* + * This routine finds matches at each position in the buffer in[0...in_nbytes]. + * The matches are cached in the array c->match_cache, and the return value is a + * pointer past the last slot in this array that was filled. + */ +static struct lz_match * +xpress_find_matches(struct xpress_compressor * restrict c, + const void * restrict in, size_t in_nbytes) +{ + const u8 * const in_begin = in; + const u8 *in_next = in_begin; + struct lz_match *cache_ptr = c->match_cache; + u32 next_hashes[2] = {}; + u32 max_len = in_nbytes; + u32 nice_len = min(max_len, c->nice_match_length); + + bt_matchfinder_init(&c->bt_mf); + + for (;;) { + struct lz_match *matches; + u32 best_len; + + /* If we've found so many matches that the cache might overflow + * if we keep finding more, then stop finding matches. This + * case is very unlikely. */ + if (unlikely(cache_ptr >= c->cache_overflow_mark || + max_len < BT_MATCHFINDER_REQUIRED_NBYTES)) + break; + + matches = cache_ptr; + + /* Find matches with the current position using the binary tree + * matchfinder and save them in the next available slots in + * the match cache. */ + cache_ptr = + bt_matchfinder_get_matches(&c->bt_mf, + in_begin, + in_next - in_begin, + max_len, + nice_len, + c->max_search_depth, + next_hashes, + &best_len, + cache_ptr); + cache_ptr->length = cache_ptr - matches; + cache_ptr->offset = *in_next++; + cache_ptr++; + max_len--; + nice_len = min(nice_len, max_len); + + /* + * If there was a very long match found, then don't cache any + * matches for the bytes covered by that match. This avoids + * degenerate behavior when compressing highly redundant data, + * where the number of matches can be very large. + * + * This heuristic doesn't actually hurt the compression ratio + * very much. If there's a long match, then the data must be + * highly compressible, so it doesn't matter as much what we do. + */ + if (best_len >= nice_len) { + if (unlikely(best_len + + BT_MATCHFINDER_REQUIRED_NBYTES >= max_len)) + break; + --best_len; + do { + bt_matchfinder_skip_byte(&c->bt_mf, + in_begin, + in_next - in_begin, + nice_len, + c->max_search_depth, + next_hashes); + cache_ptr->length = 0; + cache_ptr->offset = *in_next++; + cache_ptr++; + max_len--; + nice_len = min(nice_len, max_len); + } while (--best_len); + } + } + + while (max_len--) { + cache_ptr->length = 0; + cache_ptr->offset = *in_next++; + cache_ptr++; + } + + return cache_ptr; +} + +/* + * This is the "near-optimal" XPRESS compressor. It computes a compressed + * representation of the input buffer by executing a minimum cost path search + * over the graph of possible match/literal choices, assuming a certain cost for + * each Huffman symbol. The result is usually close to optimal, but it is *not* + * guaranteed to be optimal because of (a) heuristic restrictions in which + * matches are considered, and (b) symbol costs are unknown until those symbols + * have already been chosen --- so iterative optimization must be used, and the + * algorithm might converge on a local optimum rather than a global optimum. + */ +static size_t +xpress_compress_near_optimal(struct xpress_compressor * restrict c, + const void * restrict in, size_t in_nbytes, + void * restrict out, size_t out_nbytes_avail) +{ + struct lz_match *end_cache_ptr; + unsigned num_passes_remaining = c->num_optim_passes; + + /* Run the input buffer through the matchfinder and save the results. */ + end_cache_ptr = xpress_find_matches(c, in, in_nbytes); + + /* The first optimization pass uses a default cost model. Each + * additional optimization pass uses a cost model derived from the + * Huffman code computed in the previous pass. */ + xpress_set_default_costs(c); + do { + xpress_find_min_cost_path(c, in_nbytes, end_cache_ptr); + xpress_tally_item_list(c, c->optimum_nodes + in_nbytes); + if (num_passes_remaining > 1) { + c->freqs[XPRESS_END_OF_DATA]++; + xpress_make_huffman_code(c); + xpress_update_costs(c); + xpress_reset_symbol_frequencies(c); + } + } while (--num_passes_remaining); + + return xpress_write(c, out, out_nbytes_avail, in_nbytes, true); +} + +#endif /* SUPPORT_NEAR_OPTIMAL_PARSING */ + +static size_t +xpress_get_compressor_size(size_t max_bufsize, unsigned compression_level) +{ +#if SUPPORT_NEAR_OPTIMAL_PARSING + if (compression_level >= MIN_LEVEL_FOR_NEAR_OPTIMAL) + return offsetof(struct xpress_compressor, bt_mf) + + bt_matchfinder_size(max_bufsize); +#endif + + return offsetof(struct xpress_compressor, hc_mf) + + hc_matchfinder_size(max_bufsize); +} + +static u64 +xpress_get_needed_memory(size_t max_bufsize, unsigned compression_level, + bool destructive) +{ + u64 size = 0; + + if (max_bufsize > XPRESS_MAX_BUFSIZE) + return 0; + + size += xpress_get_compressor_size(max_bufsize, compression_level); + + if (compression_level < MIN_LEVEL_FOR_NEAR_OPTIMAL || + !SUPPORT_NEAR_OPTIMAL_PARSING) { + /* chosen_items */ + size += max_bufsize * sizeof(struct xpress_item); + } +#if SUPPORT_NEAR_OPTIMAL_PARSING + else { + /* optimum_nodes */ + size += (max_bufsize + 1) * sizeof(struct xpress_optimum_node); + /* match_cache */ + size += ((max_bufsize * CACHE_RESERVE_PER_POS) + + XPRESS_MAX_MATCH_LEN + max_bufsize) * + sizeof(struct lz_match); + } +#endif + return size; +} + +static int +xpress_create_compressor(size_t max_bufsize, unsigned compression_level, + bool destructive, void **c_ret) +{ + struct xpress_compressor *c; + + if (max_bufsize > XPRESS_MAX_BUFSIZE) + return WIMLIB_ERR_INVALID_PARAM; + + c = MALLOC(xpress_get_compressor_size(max_bufsize, compression_level)); + if (!c) + goto oom0; + + if (compression_level < MIN_LEVEL_FOR_NEAR_OPTIMAL || + !SUPPORT_NEAR_OPTIMAL_PARSING) + { + + c->chosen_items = MALLOC(max_bufsize * sizeof(struct xpress_item)); + if (!c->chosen_items) + goto oom1; + + if (compression_level < 30) { + c->impl = xpress_compress_greedy; + c->max_search_depth = (compression_level * 30) / 16; + c->nice_match_length = (compression_level * 60) / 16; + } else { + c->impl = xpress_compress_lazy; + c->max_search_depth = (compression_level * 30) / 32; + c->nice_match_length = (compression_level * 60) / 32; + + /* xpress_compress_lazy() needs max_search_depth >= 2 + * because it halves the max_search_depth when + * attempting a lazy match, and max_search_depth cannot + * be 0. */ + if (c->max_search_depth < 2) + c->max_search_depth = 2; + } + } +#if SUPPORT_NEAR_OPTIMAL_PARSING + else { + + c->optimum_nodes = MALLOC((max_bufsize + 1) * + sizeof(struct xpress_optimum_node)); + c->match_cache = MALLOC(((max_bufsize * CACHE_RESERVE_PER_POS) + + XPRESS_MAX_MATCH_LEN + max_bufsize) * + sizeof(struct lz_match)); + if (!c->optimum_nodes || !c->match_cache) { + FREE(c->optimum_nodes); + FREE(c->match_cache); + goto oom1; + } + c->cache_overflow_mark = + &c->match_cache[max_bufsize * CACHE_RESERVE_PER_POS]; + + c->impl = xpress_compress_near_optimal; + c->max_search_depth = (compression_level * 28) / 100; + c->nice_match_length = (compression_level * 56) / 100; + c->num_optim_passes = compression_level / 40; + } +#endif /* SUPPORT_NEAR_OPTIMAL_PARSING */ + + /* max_search_depth == 0 is invalid. */ + if (c->max_search_depth < 1) + c->max_search_depth = 1; + + *c_ret = c; + return 0; + +oom1: + FREE(c); +oom0: + return WIMLIB_ERR_NOMEM; +} + +static size_t +xpress_compress(const void *restrict in, size_t in_nbytes, + void *restrict out, size_t out_nbytes_avail, void *restrict _c) +{ + struct xpress_compressor *c = _c; + + /* Don't bother trying to compress very small inputs. */ + if (in_nbytes < 25) + return 0; + + if (out_nbytes_avail <= XPRESS_NUM_SYMBOLS / 2 + 4) + return 0; + + xpress_reset_symbol_frequencies(c); + + return (*c->impl)(c, in, in_nbytes, out, out_nbytes_avail); +} + +static void +xpress_free_compressor(void *_c) +{ + struct xpress_compressor *c = _c; + +#if SUPPORT_NEAR_OPTIMAL_PARSING + if (c->impl == xpress_compress_near_optimal) { + FREE(c->optimum_nodes); + FREE(c->match_cache); + } else +#endif + FREE(c->chosen_items); + FREE(c); +} + +const struct compressor_ops xpress_compressor_ops = { + .get_needed_memory = xpress_get_needed_memory, + .create_compressor = xpress_create_compressor, + .compress = xpress_compress, + .free_compressor = xpress_free_compressor, +}; diff --git a/src/wimlib/xpress_decompress.c b/src/wimlib/xpress_decompress.c new file mode 100644 index 00000000..035bcfd0 --- /dev/null +++ b/src/wimlib/xpress_decompress.c @@ -0,0 +1,186 @@ +/* + * xpress_decompress.c + * + * A decompressor for the XPRESS compression format (Huffman variant). + */ + +/* + * + * Copyright (C) 2012-2016 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see https://www.gnu.org/licenses/. + */ + + +/* + * The XPRESS compression format is an LZ77 and Huffman-code based algorithm. + * That means it is fairly similar to LZX compression, but XPRESS is simpler, so + * it is a little faster to compress and decompress. + * + * The XPRESS compression format is mostly documented in a file called "[MS-XCA] + * Xpress Compression Algorithm". In the MSDN library, it can currently be + * found under Open Specifications => Protocols => Windows Protocols => Windows + * Server Protocols => [MS-XCA] Xpress Compression Algorithm". The format in + * WIMs is specifically the algorithm labeled as the "LZ77+Huffman Algorithm" + * (there apparently are some other versions of XPRESS as well). + * + * If you are already familiar with the LZ77 algorithm and Huffman coding, the + * XPRESS format is fairly simple. The compressed data begins with 256 bytes + * that contain 512 4-bit integers that are the lengths of the symbols in the + * Huffman code used for match/literal headers. In contrast with more + * complicated formats such as DEFLATE and LZX, this is the only Huffman code + * that is used for the entirety of the XPRESS compressed data, and the codeword + * lengths are not encoded with a pretree. + * + * The rest of the compressed data is Huffman-encoded symbols. Values 0 through + * 255 represent the corresponding literal bytes. Values 256 through 511 + * represent matches and may require extra bits or bytes to be read to get the + * match offset and match length. + * + * The trickiest part is probably the way in which literal bytes for match + * lengths are interleaved in the bitstream. + * + * Also, a caveat--- according to Microsoft's documentation for XPRESS, + * + * "Some implementation of the decompression algorithm expect an extra + * symbol to mark the end of the data. Specifically, some implementations + * fail during decompression if the Huffman symbol 256 is not found after + * the actual data." + * + * This is the case with Microsoft's implementation in WIMGAPI, for example. So + * although our implementation doesn't currently check for this extra symbol, + * compressors would be wise to add it. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/decompressor_ops.h" +#include "wimlib/decompress_common.h" +#include "wimlib/error.h" +#include "wimlib/util.h" +#include "wimlib/xpress_constants.h" + +/* This value is chosen for fast decompression. */ +#define XPRESS_TABLEBITS 11 + +struct xpress_decompressor { + union { + DECODE_TABLE(decode_table, XPRESS_NUM_SYMBOLS, + XPRESS_TABLEBITS, XPRESS_MAX_CODEWORD_LEN); + u8 lens[XPRESS_NUM_SYMBOLS]; + }; + DECODE_TABLE_WORKING_SPACE(working_space, XPRESS_NUM_SYMBOLS, + XPRESS_MAX_CODEWORD_LEN); +} __attribute__((aligned(DECODE_TABLE_ALIGNMENT))); + +static int +xpress_decompress(const void *restrict compressed_data, size_t compressed_size, + void *restrict uncompressed_data, size_t uncompressed_size, + void *restrict _d) +{ + struct xpress_decompressor *d = _d; + const u8 * const in_begin = compressed_data; + u8 * const out_begin = uncompressed_data; + u8 *out_next = out_begin; + u8 * const out_end = out_begin + uncompressed_size; + struct input_bitstream is; + + /* Read the Huffman codeword lengths. */ + if (compressed_size < XPRESS_NUM_SYMBOLS / 2) + return -1; + for (int i = 0; i < XPRESS_NUM_SYMBOLS / 2; i++) { + d->lens[2 * i + 0] = in_begin[i] & 0xf; + d->lens[2 * i + 1] = in_begin[i] >> 4; + } + + /* Build a decoding table for the Huffman code. */ + if (make_huffman_decode_table(d->decode_table, XPRESS_NUM_SYMBOLS, + XPRESS_TABLEBITS, d->lens, + XPRESS_MAX_CODEWORD_LEN, + d->working_space)) + return -1; + + /* Decode the matches and literals. */ + + init_input_bitstream(&is, in_begin + XPRESS_NUM_SYMBOLS / 2, + compressed_size - XPRESS_NUM_SYMBOLS / 2); + + while (out_next != out_end) { + unsigned sym; + unsigned log2_offset; + u32 length; + u32 offset; + + sym = read_huffsym(&is, d->decode_table, + XPRESS_TABLEBITS, XPRESS_MAX_CODEWORD_LEN); + if (sym < XPRESS_NUM_CHARS) { + /* Literal */ + *out_next++ = sym; + } else { + /* Match */ + length = sym & 0xf; + log2_offset = (sym >> 4) & 0xf; + + bitstream_ensure_bits(&is, 16); + + offset = ((u32)1 << log2_offset) | + bitstream_pop_bits(&is, log2_offset); + + if (length == 0xf) { + length += bitstream_read_byte(&is); + if (length == 0xf + 0xff) + length = bitstream_read_u16(&is); + } + length += XPRESS_MIN_MATCH_LEN; + + if (unlikely(lz_copy(length, offset, + out_begin, out_next, out_end, + XPRESS_MIN_MATCH_LEN))) + return -1; + + out_next += length; + } + } + return 0; +} + +static int +xpress_create_decompressor(size_t max_block_size, void **d_ret) +{ + struct xpress_decompressor *d; + + if (max_block_size > XPRESS_MAX_OFFSET + 1) + return WIMLIB_ERR_INVALID_PARAM; + + d = ALIGNED_MALLOC(sizeof(*d), DECODE_TABLE_ALIGNMENT); + if (!d) + return WIMLIB_ERR_NOMEM; + + *d_ret = d; + return 0; +} + +static void +xpress_free_decompressor(void *_d) +{ + ALIGNED_FREE(_d); +} + +const struct decompressor_ops xpress_decompressor_ops = { + .create_decompressor = xpress_create_decompressor, + .decompress = xpress_decompress, + .free_decompressor = xpress_free_decompressor, +}; From 9f7d623e2e6e30608a5809242c187cd3bd46c011 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 21 Apr 2025 20:47:03 +0100 Subject: [PATCH 045/192] [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...) --- .vs/rufus.vcxproj | 68 +- .vs/rufus.vcxproj.filters | 3 + .vs/wimlib.vcxproj | 416 ++++++++++++ .vs/wimlib.vcxproj.filters | 422 ++++++++++++ configure | 3 + configure.ac | 1 + rufus.sln | 27 +- src/Makefile.am | 8 +- src/Makefile.in | 12 +- src/libcdio/config.h | 2 +- src/license.h | 4 + src/msvc-missing/unistd.h | 35 +- src/rufus.c | 12 +- src/rufus.h | 1 + src/rufus.rc | 10 +- src/stdio.c | 28 + src/wimlib/Makefile.am | 11 + src/wimlib/Makefile.in | 886 ++++++++++++++++++++++++++ src/wimlib/blob_table.c | 8 +- src/wimlib/compress_parallel.c | 3 +- src/wimlib/cpu_features.c | 27 +- src/wimlib/decompress_common.c | 6 +- src/wimlib/dentry.c | 6 +- src/wimlib/encoding.c | 6 + src/wimlib/extract.c | 49 +- src/wimlib/file_io.c | 11 +- src/wimlib/header.c | 32 +- src/wimlib/integrity.c | 2 + src/wimlib/lcpit_matchfinder.c | 30 +- src/wimlib/lzms_common.c | 4 +- src/wimlib/lzms_compress.c | 8 +- src/wimlib/lzms_decompress.c | 8 +- src/wimlib/lzx_compress.c | 41 +- src/wimlib/lzx_decompress.c | 3 +- src/wimlib/registry.c | 2 + src/wimlib/resource.c | 3 +- src/wimlib/security.c | 2 + src/wimlib/sha1.c | 100 +-- src/wimlib/tagged_items.c | 3 +- src/wimlib/threads.c | 2 +- src/wimlib/timestamp.c | 6 +- src/wimlib/update_image.c | 2 +- src/wimlib/util.c | 7 +- src/wimlib/wim.c | 8 +- src/wimlib/wimlib/compiler.h | 136 +++- src/wimlib/wimlib/cpu_features.h | 2 + src/wimlib/wimlib/decompress_common.h | 5 +- src/wimlib/wimlib/endianness.h | 11 + src/wimlib/wimlib/error.h | 11 + src/wimlib/wimlib/file_io.h | 6 + src/wimlib/wimlib/guid.h | 2 +- src/wimlib/wimlib/header.h | 2 + src/wimlib/wimlib/inode.h | 2 +- src/wimlib/wimlib/list.h | 12 +- src/wimlib/wimlib/progress.h | 2 +- src/wimlib/wimlib/resource.h | 6 + src/wimlib/wimlib/timestamp.h | 2 + src/wimlib/wimlib/util.h | 2 +- src/wimlib/wimlib/win32.h | 1 + src/wimlib/wimlib/win32_common.h | 263 ++++++++ src/wimlib/wimlib/wof.h | 5 + src/wimlib/wimlib/xattr.h | 9 +- src/wimlib/wimlib_tchar.h | 24 +- src/wimlib/win32_apply.c | 64 +- src/wimlib/win32_capture.c | 81 ++- src/wimlib/win32_common.c | 32 +- src/wimlib/win32_replacements.c | 6 +- src/wimlib/win32_vss.c | 7 +- src/wimlib/write.c | 12 +- src/wimlib/xml.c | 7 +- src/wimlib/xml_windows.c | 8 +- src/wimlib/xmlproc.c | 4 + src/wimlib/xpress_compress.c | 10 +- src/wimlib/xpress_decompress.c | 3 +- 74 files changed, 2748 insertions(+), 317 deletions(-) create mode 100644 .vs/wimlib.vcxproj create mode 100644 .vs/wimlib.vcxproj.filters create mode 100644 src/wimlib/Makefile.am create mode 100644 src/wimlib/Makefile.in diff --git a/.vs/rufus.vcxproj b/.vs/rufus.vcxproj index f1047b25..be8d8216 100644 --- a/.vs/rufus.vcxproj +++ b/.vs/rufus.vcxproj @@ -121,19 +121,19 @@ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <BuildLog /> <ClCompile> - <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>_RUFUS;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> - <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\src\wimlib;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ExceptionHandling>Async</ExceptionHandling> <DisableSpecificWarnings>4091;5255;28251;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings> <Optimization>Disabled</Optimization> - <AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> + <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> </ClCompile> <Link> - <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> @@ -152,18 +152,18 @@ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> <BuildLog /> <ClCompile> - <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>_RUFUS;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> - <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\src\wimlib;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ExceptionHandling>Async</ExceptionHandling> <DisableSpecificWarnings>4091;5255;28251;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings> - <AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> + <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> </ClCompile> <Link> - <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> @@ -184,18 +184,18 @@ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> <BuildLog /> <ClCompile> - <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>_RUFUS;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> - <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\src\wimlib;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ExceptionHandling>Async</ExceptionHandling> <DisableSpecificWarnings>4091;5255;28251;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings> - <AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> + <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> </ClCompile> <Link> - <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> @@ -219,8 +219,8 @@ <TargetEnvironment>X64</TargetEnvironment> </Midl> <ClCompile> - <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\src\wimlib;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_RUFUS;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> @@ -229,10 +229,10 @@ <ExceptionHandling>Async</ExceptionHandling> <DisableSpecificWarnings>4091;5255;28251;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings> <Optimization>Disabled</Optimization> - <AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> + <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> </ClCompile> <Link> - <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> @@ -251,20 +251,20 @@ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <BuildLog /> <ClCompile> - <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>_RUFUS;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> - <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\src\wimlib;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ExceptionHandling>Async</ExceptionHandling> <DisableSpecificWarnings>4091;5255;28251;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings> <UndefinePreprocessorDefinitions>NDEBUG</UndefinePreprocessorDefinitions> - <AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> + <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> <StringPooling>true</StringPooling> </ClCompile> <Link> - <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> <GenerateDebugInformation>false</GenerateDebugInformation> <SubSystem>Windows</SubSystem> @@ -283,20 +283,20 @@ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> <BuildLog /> <ClCompile> - <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>_RUFUS;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> - <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\src\wimlib;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ExceptionHandling>Async</ExceptionHandling> <DisableSpecificWarnings>4091;5255;28251;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings> <UndefinePreprocessorDefinitions>NDEBUG</UndefinePreprocessorDefinitions> - <AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> + <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> <StringPooling>true</StringPooling> </ClCompile> <Link> - <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> <GenerateDebugInformation>false</GenerateDebugInformation> <SubSystem>Windows</SubSystem> @@ -317,20 +317,20 @@ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> <BuildLog /> <ClCompile> - <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>_RUFUS;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> - <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\src\wimlib;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ExceptionHandling>Async</ExceptionHandling> <DisableSpecificWarnings>4091;5255;28251;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings> <UndefinePreprocessorDefinitions>NDEBUG</UndefinePreprocessorDefinitions> - <AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> + <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> <StringPooling>true</StringPooling> </ClCompile> <Link> - <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> <GenerateDebugInformation>false</GenerateDebugInformation> <SubSystem>Windows</SubSystem> @@ -354,20 +354,20 @@ <TargetEnvironment>X64</TargetEnvironment> </Midl> <ClCompile> - <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>_RUFUS;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> - <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;..\src\wimlib;..\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <CompileAs>CompileAsC</CompileAs> <MultiProcessorCompilation>true</MultiProcessorCompilation> <ExceptionHandling>Async</ExceptionHandling> <DisableSpecificWarnings>4091;5255;28251;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings> <UndefinePreprocessorDefinitions>NDEBUG</UndefinePreprocessorDefinitions> - <AdditionalOptions>/utf-8 $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> + <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> <StringPooling>true</StringPooling> </ClCompile> <Link> - <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> <GenerateDebugInformation>false</GenerateDebugInformation> <SubSystem>Windows</SubSystem> @@ -413,6 +413,7 @@ <ClCompile Include="..\src\xml.c" /> </ItemGroup> <ItemGroup> + <ClInclude Include="..\res\dbx\dbx_info.h" /> <ClInclude Include="..\res\grub2\grub2_version.h" /> <ClInclude Include="..\res\grub\grub_version.h" /> <ClInclude Include="..\src\badblocks.h" /> @@ -491,6 +492,9 @@ <ProjectReference Include="ext2fs.vcxproj"> <Project>{b01f5886-2b39-4b66-b65c-6427135b6a02}</Project> </ProjectReference> + <ProjectReference Include="wimlib.vcxproj"> + <Project>{633cfc82-e01b-4777-bde4-dc0739804332}</Project> + </ProjectReference> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> diff --git a/.vs/rufus.vcxproj.filters b/.vs/rufus.vcxproj.filters index 7a980a63..9204e412 100644 --- a/.vs/rufus.vcxproj.filters +++ b/.vs/rufus.vcxproj.filters @@ -197,6 +197,9 @@ <ClInclude Include="..\src\efi.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="..\res\dbx\dbx_info.h"> + <Filter>Header Files</Filter> + </ClInclude> <ClInclude Include="..\src\msvc-missing\unistd.h"> <Filter>Header Files</Filter> </ClInclude> diff --git a/.vs/wimlib.vcxproj b/.vs/wimlib.vcxproj new file mode 100644 index 00000000..5d1b92fe --- /dev/null +++ b/.vs/wimlib.vcxproj @@ -0,0 +1,416 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|ARM"> + <Configuration>Debug</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|ARM64"> + <Configuration>Debug</Configuration> + <Platform>ARM64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|ARM"> + <Configuration>Release</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|ARM64"> + <Configuration>Release</Configuration> + <Platform>ARM64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\src\wimlib\avl_tree.c" /> + <ClCompile Include="..\src\wimlib\blob_table.c" /> + <ClCompile Include="..\src\wimlib\compress.c" /> + <ClCompile Include="..\src\wimlib\compress_common.c" /> + <ClCompile Include="..\src\wimlib\compress_parallel.c" /> + <ClCompile Include="..\src\wimlib\compress_serial.c" /> + <ClCompile Include="..\src\wimlib\cpu_features.c" /> + <ClCompile Include="..\src\wimlib\decompress.c" /> + <ClCompile Include="..\src\wimlib\decompress_common.c" /> + <ClCompile Include="..\src\wimlib\dentry.c" /> + <ClCompile Include="..\src\wimlib\divsufsort.c" /> + <ClCompile Include="..\src\wimlib\encoding.c" /> + <ClCompile Include="..\src\wimlib\error.c" /> + <ClCompile Include="..\src\wimlib\export_image.c" /> + <ClCompile Include="..\src\wimlib\extract.c" /> + <ClCompile Include="..\src\wimlib\file_io.c" /> + <ClCompile Include="..\src\wimlib\header.c" /> + <ClCompile Include="..\src\wimlib\inode.c" /> + <ClCompile Include="..\src\wimlib\inode_fixup.c" /> + <ClCompile Include="..\src\wimlib\inode_table.c" /> + <ClCompile Include="..\src\wimlib\integrity.c" /> + <ClCompile Include="..\src\wimlib\iterate_dir.c" /> + <ClCompile Include="..\src\wimlib\lcpit_matchfinder.c" /> + <ClCompile Include="..\src\wimlib\lzms_common.c" /> + <ClCompile Include="..\src\wimlib\lzms_compress.c" /> + <ClCompile Include="..\src\wimlib\lzms_decompress.c" /> + <ClCompile Include="..\src\wimlib\lzx_common.c" /> + <ClCompile Include="..\src\wimlib\lzx_compress.c" /> + <ClCompile Include="..\src\wimlib\lzx_decompress.c" /> + <ClCompile Include="..\src\wimlib\metadata_resource.c" /> + <ClCompile Include="..\src\wimlib\pathlist.c" /> + <ClCompile Include="..\src\wimlib\paths.c" /> + <ClCompile Include="..\src\wimlib\pattern.c" /> + <ClCompile Include="..\src\wimlib\progress.c" /> + <ClCompile Include="..\src\wimlib\registry.c" /> + <ClCompile Include="..\src\wimlib\reparse.c" /> + <ClCompile Include="..\src\wimlib\resource.c" /> + <ClCompile Include="..\src\wimlib\scan.c" /> + <ClCompile Include="..\src\wimlib\security.c" /> + <ClCompile Include="..\src\wimlib\sha1.c" /> + <ClCompile Include="..\src\wimlib\solid.c" /> + <ClCompile Include="..\src\wimlib\split.c" /> + <ClCompile Include="..\src\wimlib\tagged_items.c" /> + <ClCompile Include="..\src\wimlib\textfile.c" /> + <ClCompile Include="..\src\wimlib\threads.c" /> + <ClCompile Include="..\src\wimlib\timestamp.c" /> + <ClCompile Include="..\src\wimlib\update_image.c" /> + <ClCompile Include="..\src\wimlib\util.c" /> + <ClCompile Include="..\src\wimlib\wim.c" /> + <ClCompile Include="..\src\wimlib\wimboot.c" /> + <ClCompile Include="..\src\wimlib\win32_apply.c" /> + <ClCompile Include="..\src\wimlib\win32_capture.c" /> + <ClCompile Include="..\src\wimlib\win32_common.c" /> + <ClCompile Include="..\src\wimlib\win32_replacements.c" /> + <ClCompile Include="..\src\wimlib\win32_vss.c" /> + <ClCompile Include="..\src\wimlib\write.c" /> + <ClCompile Include="..\src\wimlib\xml.c" /> + <ClCompile Include="..\src\wimlib\xmlproc.c" /> + <ClCompile Include="..\src\wimlib\xml_windows.c" /> + <ClCompile Include="..\src\wimlib\xpress_compress.c" /> + <ClCompile Include="..\src\wimlib\xpress_decompress.c" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\src\wimlib\config.h" /> + <ClInclude Include="..\src\wimlib\wimlib.h" /> + <ClInclude Include="..\src\wimlib\wimlib\alloca.h" /> + <ClInclude Include="..\src\wimlib\wimlib\apply.h" /> + <ClInclude Include="..\src\wimlib\wimlib\assert.h" /> + <ClInclude Include="..\src\wimlib\wimlib\avl_tree.h" /> + <ClInclude Include="..\src\wimlib\wimlib\bitops.h" /> + <ClInclude Include="..\src\wimlib\wimlib\blob_table.h" /> + <ClInclude Include="..\src\wimlib\wimlib\bt_matchfinder.h" /> + <ClInclude Include="..\src\wimlib\wimlib\case.h" /> + <ClInclude Include="..\src\wimlib\wimlib\chunk_compressor.h" /> + <ClInclude Include="..\src\wimlib\wimlib\compiler.h" /> + <ClInclude Include="..\src\wimlib\wimlib\compressor_ops.h" /> + <ClInclude Include="..\src\wimlib\wimlib\compress_common.h" /> + <ClInclude Include="..\src\wimlib\wimlib\cpu_features.h" /> + <ClInclude Include="..\src\wimlib\wimlib\decompressor_ops.h" /> + <ClInclude Include="..\src\wimlib\wimlib\decompress_common.h" /> + <ClInclude Include="..\src\wimlib\wimlib\dentry.h" /> + <ClInclude Include="..\src\wimlib\wimlib\divsufsort.h" /> + <ClInclude Include="..\src\wimlib\wimlib\encoding.h" /> + <ClInclude Include="..\src\wimlib\wimlib\endianness.h" /> + <ClInclude Include="..\src\wimlib\wimlib\error.h" /> + <ClInclude Include="..\src\wimlib\wimlib\file_io.h" /> + <ClInclude Include="..\src\wimlib\wimlib\glob.h" /> + <ClInclude Include="..\src\wimlib\wimlib\guid.h" /> + <ClInclude Include="..\src\wimlib\wimlib\hc_matchfinder.h" /> + <ClInclude Include="..\src\wimlib\wimlib\header.h" /> + <ClInclude Include="..\src\wimlib\wimlib\inode.h" /> + <ClInclude Include="..\src\wimlib\wimlib\inode_table.h" /> + <ClInclude Include="..\src\wimlib\wimlib\integrity.h" /> + <ClInclude Include="..\src\wimlib\wimlib\lcpit_matchfinder.h" /> + <ClInclude Include="..\src\wimlib\wimlib\list.h" /> + <ClInclude Include="..\src\wimlib\wimlib\lzms_common.h" /> + <ClInclude Include="..\src\wimlib\wimlib\lzms_constants.h" /> + <ClInclude Include="..\src\wimlib\wimlib\lzx_common.h" /> + <ClInclude Include="..\src\wimlib\wimlib\lzx_constants.h" /> + <ClInclude Include="..\src\wimlib\wimlib\matchfinder_common.h" /> + <ClInclude Include="..\src\wimlib\wimlib\metadata.h" /> + <ClInclude Include="..\src\wimlib\wimlib\ntfs_3g.h" /> + <ClInclude Include="..\src\wimlib\wimlib\object_id.h" /> + <ClInclude Include="..\src\wimlib\wimlib\pathlist.h" /> + <ClInclude Include="..\src\wimlib\wimlib\paths.h" /> + <ClInclude Include="..\src\wimlib\wimlib\pattern.h" /> + <ClInclude Include="..\src\wimlib\wimlib\progress.h" /> + <ClInclude Include="..\src\wimlib\wimlib\registry.h" /> + <ClInclude Include="..\src\wimlib\wimlib\reparse.h" /> + <ClInclude Include="..\src\wimlib\wimlib\resource.h" /> + <ClInclude Include="..\src\wimlib\wimlib\scan.h" /> + <ClInclude Include="..\src\wimlib\wimlib\security.h" /> + <ClInclude Include="..\src\wimlib\wimlib\security_descriptor.h" /> + <ClInclude Include="..\src\wimlib\wimlib\sha1.h" /> + <ClInclude Include="..\src\wimlib\wimlib\solid.h" /> + <ClInclude Include="..\src\wimlib\wimlib\tagged_items.h" /> + <ClInclude Include="..\src\wimlib\wimlib\test_support.h" /> + <ClInclude Include="..\src\wimlib\wimlib\textfile.h" /> + <ClInclude Include="..\src\wimlib\wimlib\threads.h" /> + <ClInclude Include="..\src\wimlib\wimlib\timestamp.h" /> + <ClInclude Include="..\src\wimlib\wimlib\types.h" /> + <ClInclude Include="..\src\wimlib\wimlib\unaligned.h" /> + <ClInclude Include="..\src\wimlib\wimlib\unix_data.h" /> + <ClInclude Include="..\src\wimlib\wimlib\util.h" /> + <ClInclude Include="..\src\wimlib\wimlib\wim.h" /> + <ClInclude Include="..\src\wimlib\wimlib\wimboot.h" /> + <ClInclude Include="..\src\wimlib\wimlib\win32.h" /> + <ClInclude Include="..\src\wimlib\wimlib\win32_common.h" /> + <ClInclude Include="..\src\wimlib\wimlib\win32_vss.h" /> + <ClInclude Include="..\src\wimlib\wimlib\wof.h" /> + <ClInclude Include="..\src\wimlib\wimlib\write.h" /> + <ClInclude Include="..\src\wimlib\wimlib\xattr.h" /> + <ClInclude Include="..\src\wimlib\wimlib\xml.h" /> + <ClInclude Include="..\src\wimlib\wimlib\xmlproc.h" /> + <ClInclude Include="..\src\wimlib\wimlib\xml_windows.h" /> + <ClInclude Include="..\src\wimlib\wimlib\xpress_constants.h" /> + <ClInclude Include="..\src\wimlib\wimlib_tchar.h" /> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{633CFC82-E01B-4777-BDE4-DC0739804332}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>wimlib</RootNamespace> + <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v143</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v143</PlatformToolset> + <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v143</PlatformToolset> + <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v143</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v143</PlatformToolset> + <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v143</PlatformToolset> + <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v143</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v143</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">$(SolutionDir)arm\$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">$(SolutionDir)arm\$(Configuration)\$(ProjectName)\</IntDir> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">$(SolutionDir)arm\$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">$(SolutionDir)arm\$(Configuration)\$(ProjectName)\</IntDir> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(SolutionDir)arm64\$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(SolutionDir)arm64\$(Configuration)\$(ProjectName)\</IntDir> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(SolutionDir)arm64\$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(SolutionDir)arm64\$(Configuration)\$(ProjectName)\</IntDir> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)x86\$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)x86\$(Configuration)\$(ProjectName)\</IntDir> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)x86\$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)x86\$(Configuration)\$(ProjectName)\</IntDir> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)x64\$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)x64\$(Configuration)\$(ProjectName)\</IntDir> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)x64\$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)x64\$(Configuration)\$(ProjectName)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">false</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings> + <CompileAs>CompileAsC</CompileAs> + <AdditionalOptions>/std:clatest</AdditionalOptions> + <PreprocessorDefinitions>_RUFUS;HAVE_CONFIG_H;UNICODE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;__SSE2__;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + <Lib> + <TargetMachine>MachineX86</TargetMachine> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <AdditionalOptions>/std:clatest</AdditionalOptions> + <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings> + <PreprocessorDefinitions>_RUFUS;HAVE_CONFIG_H;UNICODE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + <Lib /> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <AdditionalOptions>/std:clatest</AdditionalOptions> + <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings> + <PreprocessorDefinitions>_RUFUS;HAVE_CONFIG_H;UNICODE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + <Lib /> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings> + <CompileAs>CompileAsC</CompileAs> + <AdditionalOptions>/std:clatest</AdditionalOptions> + <StringPooling>true</StringPooling> + <PreprocessorDefinitions>_RUFUS;HAVE_CONFIG_H;UNICODE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;__SSE2__;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Lib> + <TargetMachine>MachineX86</TargetMachine> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <AdditionalOptions>/std:clatest</AdditionalOptions> + <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings> + <StringPooling>true</StringPooling> + <PreprocessorDefinitions>_RUFUS;HAVE_CONFIG_H;UNICODE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Lib /> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <AdditionalOptions>/std:clatest</AdditionalOptions> + <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings> + <StringPooling>true</StringPooling> + <PreprocessorDefinitions>_RUFUS;HAVE_CONFIG_H;UNICODE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Lib /> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings> + <CompileAs>CompileAsC</CompileAs> + <AdditionalOptions>/std:clatest</AdditionalOptions> + <PreprocessorDefinitions>_RUFUS;HAVE_CONFIG_H;UNICODE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;__SSE2__;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + <Lib> + <TargetMachine>MachineX64</TargetMachine> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings> + <CompileAs>CompileAsC</CompileAs> + <AdditionalOptions>/std:clatest</AdditionalOptions> + <StringPooling>true</StringPooling> + <PreprocessorDefinitions>_RUFUS;HAVE_CONFIG_H;UNICODE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;__SSE2__;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <Lib> + <TargetMachine>MachineX64</TargetMachine> + </Lib> + </ItemDefinitionGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file diff --git a/.vs/wimlib.vcxproj.filters b/.vs/wimlib.vcxproj.filters new file mode 100644 index 00000000..4092e21a --- /dev/null +++ b/.vs/wimlib.vcxproj.filters @@ -0,0 +1,422 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\src\wimlib\wim.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\extract.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\xml.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\xmlproc.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\util.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\error.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\win32_replacements.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\win32_common.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\blob_table.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\encoding.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\cpu_features.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\threads.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\win32_apply.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\win32_vss.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\header.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\metadata_resource.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\resource.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\security.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\decompress.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\decompress_common.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\sha1.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\xpress_decompress.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\write.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\file_io.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\progress.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\integrity.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\dentry.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\export_image.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\inode.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\iterate_dir.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\avl_tree.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\win32_capture.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\timestamp.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\pathlist.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\paths.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\scan.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\lzms_common.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\lzms_decompress.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\lzx_common.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\lzx_decompress.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\solid.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\reparse.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\compress_parallel.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\compress_serial.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\compress.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\xpress_compress.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\lzms_compress.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\lzx_compress.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\compress_common.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\pattern.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\lcpit_matchfinder.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\textfile.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\divsufsort.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\inode_table.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\inode_fixup.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\tagged_items.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\wimboot.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\update_image.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\xml_windows.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\registry.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\wimlib\split.c"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\src\wimlib\config.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\assert.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\blob_table.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\cpu_features.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\dentry.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\encoding.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\file_io.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\integrity.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\metadata.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\security.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\threads.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\wim.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\win32.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\xml.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\list.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\resource.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\sha1.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\types.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\util.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib_tchar.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\compiler.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\avl_tree.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\case.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\inode.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\error.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\guid.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\header.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\apply.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\progress.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\endianness.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\object_id.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\pathlist.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\paths.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\pattern.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\reparse.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\tagged_items.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\unix_data.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\xattr.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\timestamp.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\write.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\xmlproc.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\test_support.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\glob.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\win32_common.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\win32_vss.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\bitops.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\ntfs_3g.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\scan.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\unaligned.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\inode_table.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\textfile.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\wimboot.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\wof.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\alloca.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\decompress_common.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\decompressor_ops.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\xpress_constants.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\chunk_compressor.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\solid.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\lzms_common.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\lzms_constants.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\lzx_common.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\lzx_constants.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\compress_common.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\compressor_ops.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\hc_matchfinder.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\matchfinder_common.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\bt_matchfinder.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\lcpit_matchfinder.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\divsufsort.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\xml_windows.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\registry.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\src\wimlib\wimlib\security_descriptor.h"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> +</Project> \ No newline at end of file diff --git a/configure b/configure index ea8a7e1a..1399f3a4 100755 --- a/configure +++ b/configure @@ -4758,6 +4758,8 @@ ac_config_files="$ac_config_files src/syslinux/libinstaller/Makefile" ac_config_files="$ac_config_files src/syslinux/win/Makefile" +ac_config_files="$ac_config_files src/wimlib/Makefile" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -5491,6 +5493,7 @@ do "src/syslinux/libfat/Makefile") CONFIG_FILES="$CONFIG_FILES src/syslinux/libfat/Makefile" ;; "src/syslinux/libinstaller/Makefile") CONFIG_FILES="$CONFIG_FILES src/syslinux/libinstaller/Makefile" ;; "src/syslinux/win/Makefile") CONFIG_FILES="$CONFIG_FILES src/syslinux/win/Makefile" ;; + "src/wimlib/Makefile") CONFIG_FILES="$CONFIG_FILES src/wimlib/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/configure.ac b/configure.ac index abf747b5..2980290a 100644 --- a/configure.ac +++ b/configure.ac @@ -84,4 +84,5 @@ AC_CONFIG_FILES([src/ms-sys/Makefile]) AC_CONFIG_FILES([src/syslinux/libfat/Makefile]) AC_CONFIG_FILES([src/syslinux/libinstaller/Makefile]) AC_CONFIG_FILES([src/syslinux/win/Makefile]) +AC_CONFIG_FILES([src/wimlib/Makefile]) AC_OUTPUT diff --git a/rufus.sln b/rufus.sln index dddbacce..26a77148 100644 --- a/rufus.sln +++ b/rufus.sln @@ -1,8 +1,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29215.179 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34330.188 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rufus", ".vs\rufus.vcxproj", "{731858A7-0303-4988-877B-9C0DD6471864}" + ProjectSection(ProjectDependencies) = postProject + {633CFC82-E01B-4777-BDE4-DC0739804332} = {633CFC82-E01B-4777-BDE4-DC0739804332} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ms-sys", ".vs\ms-sys.vcxproj", "{2B1D078D-8EB4-4398-9CA4-23457265A7F6}" EndProject @@ -24,8 +27,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bled", ".vs\bled.vcxproj", EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ext2fs", ".vs\ext2fs.vcxproj", "{B01F5886-2B39-4B66-B65C-6427135B6A02}" EndProject - - +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wimlib", ".vs\wimlib.vcxproj", "{633CFC82-E01B-4777-BDE4-DC0739804332}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|arm = Debug|arm @@ -214,6 +217,22 @@ Global {B01F5886-2B39-4B66-B65C-6427135B6A02}.Release|x64.Build.0 = Release|x64 {B01F5886-2B39-4B66-B65C-6427135B6A02}.Release|x86.ActiveCfg = Release|Win32 {B01F5886-2B39-4B66-B65C-6427135B6A02}.Release|x86.Build.0 = Release|Win32 + {633CFC82-E01B-4777-BDE4-DC0739804332}.Debug|arm.ActiveCfg = Debug|ARM + {633CFC82-E01B-4777-BDE4-DC0739804332}.Debug|arm.Build.0 = Debug|ARM + {633CFC82-E01B-4777-BDE4-DC0739804332}.Debug|arm64.ActiveCfg = Debug|ARM64 + {633CFC82-E01B-4777-BDE4-DC0739804332}.Debug|arm64.Build.0 = Debug|ARM64 + {633CFC82-E01B-4777-BDE4-DC0739804332}.Debug|x64.ActiveCfg = Debug|x64 + {633CFC82-E01B-4777-BDE4-DC0739804332}.Debug|x64.Build.0 = Debug|x64 + {633CFC82-E01B-4777-BDE4-DC0739804332}.Debug|x86.ActiveCfg = Debug|Win32 + {633CFC82-E01B-4777-BDE4-DC0739804332}.Debug|x86.Build.0 = Debug|Win32 + {633CFC82-E01B-4777-BDE4-DC0739804332}.Release|arm.ActiveCfg = Release|ARM + {633CFC82-E01B-4777-BDE4-DC0739804332}.Release|arm.Build.0 = Release|ARM + {633CFC82-E01B-4777-BDE4-DC0739804332}.Release|arm64.ActiveCfg = Release|ARM64 + {633CFC82-E01B-4777-BDE4-DC0739804332}.Release|arm64.Build.0 = Release|ARM64 + {633CFC82-E01B-4777-BDE4-DC0739804332}.Release|x64.ActiveCfg = Release|x64 + {633CFC82-E01B-4777-BDE4-DC0739804332}.Release|x64.Build.0 = Release|x64 + {633CFC82-E01B-4777-BDE4-DC0739804332}.Release|x86.ActiveCfg = Release|Win32 + {633CFC82-E01B-4777-BDE4-DC0739804332}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Makefile.am b/src/Makefile.am index ab03cd2b..d7650f13 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ -SUBDIRS = ../.mingw bled ext2fs ms-sys syslinux/libfat syslinux/libinstaller syslinux/win libcdio/iso9660 libcdio/udf libcdio/driver ../res/loc +SUBDIRS = ../.mingw bled ext2fs ms-sys syslinux/libfat syslinux/libinstaller syslinux/win libcdio/iso9660 libcdio/udf libcdio/driver wimlib ../res/loc # As far as I can tell, the following libraries are *not* vulnerable to side-loading, so we link using their regular version: -NONVULNERABLE_LIBS = -lsetupapi -lole32 -lgdi32 -lshlwapi -lcrypt32 -lcomctl32 -luuid +NONVULNERABLE_LIBS = -lsetupapi -lole32 -lgdi32 -lshlwapi -lcrypt32 -lcomctl32 -luuid -lntdll # The following libraries are vulnerable (or have an unknown vulnerability status), so we link using our delay-loaded replacement: # See https://github.com/pbatard/rufus/issues/2272 # Oh, and don't bother trying to delay load cfgmgr32.dll, even with the DECLSPEC_IMPORT __attribute__((visibility("hidden"))) @@ -19,8 +19,8 @@ AM_V_WINDRES = $(AM_V_WINDRES_$(V)) rufus_SOURCES = badblocks.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c xml.c -rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/../res $(AM_CFLAGS) \ +rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/wimlib -I$(srcdir)/../res $(AM_CFLAGS) \ -DEXT2_FLAT_INCLUDES=0 -DSOLUTION=rufus rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows -L $(srcdir)/../.mingw rufus_LDADD = rufus_rc.o bled/libbled.a ext2fs/libext2fs.a ms-sys/libmssys.a syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a syslinux/win/libwin.a \ - libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a $(NONVULNERABLE_LIBS) $(VULNERABLE_LIBS) + libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a wimlib/libwim.a $(NONVULNERABLE_LIBS) $(VULNERABLE_LIBS) diff --git a/src/Makefile.in b/src/Makefile.in index 5f27da84..df67b5d4 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -106,8 +106,8 @@ rufus_DEPENDENCIES = rufus_rc.o bled/libbled.a ext2fs/libext2fs.a \ ms-sys/libmssys.a syslinux/libfat/libfat.a \ syslinux/libinstaller/libinstaller.a syslinux/win/libwin.a \ libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a \ - libcdio/driver/libdriver.a $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + libcdio/driver/libdriver.a wimlib/libwim.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) rufus_LINK = $(CCLD) $(rufus_CFLAGS) $(CFLAGS) $(rufus_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) @@ -273,9 +273,9 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = ../.mingw bled ext2fs ms-sys syslinux/libfat syslinux/libinstaller syslinux/win libcdio/iso9660 libcdio/udf libcdio/driver ../res/loc +SUBDIRS = ../.mingw bled ext2fs ms-sys syslinux/libfat syslinux/libinstaller syslinux/win libcdio/iso9660 libcdio/udf libcdio/driver wimlib ../res/loc # As far as I can tell, the following libraries are *not* vulnerable to side-loading, so we link using their regular version: -NONVULNERABLE_LIBS = -lsetupapi -lole32 -lgdi32 -lshlwapi -lcrypt32 -lcomctl32 -luuid +NONVULNERABLE_LIBS = -lsetupapi -lole32 -lgdi32 -lshlwapi -lcrypt32 -lcomctl32 -luuid -lntdll # The following libraries are vulnerable (or have an unknown vulnerability status), so we link using our delay-loaded replacement: # See https://github.com/pbatard/rufus/issues/2272 # Oh, and don't bother trying to delay load cfgmgr32.dll, even with the DECLSPEC_IMPORT __attribute__((visibility("hidden"))) @@ -288,12 +288,12 @@ AM_V_WINDRES = $(AM_V_WINDRES_$(V)) rufus_SOURCES = badblocks.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c xml.c -rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/../res $(AM_CFLAGS) \ +rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/wimlib -I$(srcdir)/../res $(AM_CFLAGS) \ -DEXT2_FLAT_INCLUDES=0 -DSOLUTION=rufus rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows -L $(srcdir)/../.mingw rufus_LDADD = rufus_rc.o bled/libbled.a ext2fs/libext2fs.a ms-sys/libmssys.a syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a syslinux/win/libwin.a \ - libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a $(NONVULNERABLE_LIBS) $(VULNERABLE_LIBS) + libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a wimlib/libwim.a $(NONVULNERABLE_LIBS) $(VULNERABLE_LIBS) all: all-recursive diff --git a/src/libcdio/config.h b/src/libcdio/config.h index a782044f..1831706b 100644 --- a/src/libcdio/config.h +++ b/src/libcdio/config.h @@ -46,7 +46,7 @@ #endif /* Define to 1 if you have the `ftruncate' function. */ -/* #undef HAVE_FTRUNCATE */ +#define HAVE_FTRUNCATE 1 /* Define if you have the iconv() function and it works. */ /* #undef HAVE_ICONV */ diff --git a/src/license.h b/src/license.h index a14d7131..89aaac3a 100644 --- a/src/license.h +++ b/src/license.h @@ -56,6 +56,10 @@ const char* additional_copyrights = "https://www.gnu.org/software/libcdio\\line\n" "GNU General Public License (GPL) v3 or later\\line\n" "\\line\n" +"WIM image manipulation support from wimlib by Carl Thijssen and Eric Biggers:\\line\n" +"https://wimlib.net\\line\n" +"GNU General Public License (GPL) v3 or later\\line\n" +"\\line\n" "Syslinux support from Syslinux by H. Peter Anvin et al.:\\line\n" "https://syslinux.org/\\line\n" "GNU General Public License (GPL) v2 or later\\line\n" diff --git a/src/msvc-missing/unistd.h b/src/msvc-missing/unistd.h index 0bc675a7..98cb70a4 100644 --- a/src/msvc-missing/unistd.h +++ b/src/msvc-missing/unistd.h @@ -24,11 +24,10 @@ typedef unsigned short mode_t; #ifndef _SSIZE_T_DEFINED #define _SSIZE_T_DEFINED #undef ssize_t -#ifdef _WIN64 -typedef __int64 ssize_t; -#else -typedef int ssize_t; -#endif /* _WIN64 */ +/* From https://awesomekling.github.io/How-SerenityOS-declares-ssize_t/ */ +#define unsigned signed +typedef size_t ssize_t; +#undef unsigned #endif /* _SSIZE_T_DEFINED */ /* ext2fs needs this, which we picked from libcdio-driver/filemode.h */ @@ -39,4 +38,30 @@ typedef int ssize_t; # define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) #endif +/* access() mode flags */ +#ifndef R_OK +#define R_OK 4 #endif +#ifndef W_OK +#define W_OK 2 +#endif +#ifndef F_OK +#define F_OK 0 +#endif +#endif + +/* Standard file descriptors. */ +#ifndef STDIN_FILENO +#define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +#define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +#define STDERR_FILENO 2 +#endif + +/* For wimlib */ +#define ftruncate _chsize_s +#define snwprintf(dst, count, ...) _snwprintf_s(dst, count, _TRUNCATE, __VA_ARGS__) +#define vsnwprintf _vsnwprintf diff --git a/src/rufus.c b/src/rufus.c index 4aafec0f..20fc7392 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -3825,10 +3825,20 @@ relaunch: } #if defined(_DEBUG) || defined(TEST) || defined(ALPHA) extern int TestHashes(void); +#include "wimlib.h" // Ctrl-T => Alternate Test mode that doesn't require a full rebuild if ((ctrl_without_focus || ((GetKeyState(VK_CONTROL) & 0x8000) && (msg.message == WM_KEYDOWN))) && (msg.wParam == 'T')) { - TestHashes(); + int r; + WIMStruct* wim; + r = wimlib_open_wim(L"C:\\tmp\\boot.wim", WIMLIB_OPEN_FLAG_CHECK_INTEGRITY, &wim); + if (r == 0) { + wimlib_print_header(wim); + wimlib_free(wim); + } else { + uprintf("Failed to open WIM: %d", r); + } +// TestHashes(); continue; } #endif diff --git a/src/rufus.h b/src/rufus.h index c76a9de4..f05b8c6c 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -200,6 +200,7 @@ static __inline void static_repchr(char* p, char s, char r) { extern void uprintf(const char *format, ...); extern void uprintfs(const char *str); +extern void wuprintf(const wchar_t* format, ...); #define vuprintf(...) do { if (verbose) uprintf(__VA_ARGS__); } while(0) #define vvuprintf(...) do { if (verbose > 1) uprintf(__VA_ARGS__); } while(0) #define suprintf(...) do { if (!bSilent) uprintf(__VA_ARGS__); } while(0) diff --git a/src/rufus.rc b/src/rufus.rc index 1e8e01a0..995eb662 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.8.2235" +CAPTION "Rufus 4.8.2236" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2235,0 - PRODUCTVERSION 4,8,2235,0 + FILEVERSION 4,8,2236,0 + PRODUCTVERSION 4,8,2236,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2235" + VALUE "FileVersion", "4.8.2236" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2235" + VALUE "ProductVersion", "4.8.2236" END END BLOCK "VarFileInfo" diff --git a/src/stdio.c b/src/stdio.c index 8346ed32..0db0423f 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -99,6 +99,34 @@ void uprintf(const char *format, ...) free(wbuf); } +void wuprintf(const wchar_t* format, ...) +{ + static wchar_t wbuf[4096]; + wchar_t* p = wbuf; + va_list args; + int n; + + va_start(args, format); + n = _vsnwprintf_s(p, ARRAYSIZE(wbuf) - 3, _TRUNCATE, format, args); + va_end(args); + + p += (n < 0) ? ARRAYSIZE(wbuf) - 3 : n; + + if (n >= 1 && p[-1] == L'\n') { + p[-1] = L'\r'; + *p++ = L'\n'; + *p = L'\0'; + } + + // coverity[dont_call] + OutputDebugStringW(wbuf); + if ((hLog != NULL) && (hLog != INVALID_HANDLE_VALUE)) { + Edit_SetSel(hLog, MAX_LOG_SIZE, MAX_LOG_SIZE); + Edit_ReplaceSel(hLog, wbuf); + Edit_Scroll(hLog, Edit_GetLineCount(hLog), 0); + } +} + void uprintfs(const char* str) { wchar_t* wstr; diff --git a/src/wimlib/Makefile.am b/src/wimlib/Makefile.am new file mode 100644 index 00000000..e9271d81 --- /dev/null +++ b/src/wimlib/Makefile.am @@ -0,0 +1,11 @@ +noinst_LIBRARIES = libwim.a +libwim_a_SOURCES = avl_tree.c blob_table.c compress.c compress_common.c compress_parallel.c \ + compress_serial.c cpu_features.c decompress.c decompress_common.c dentry.c divsufsort.c \ + encoding.c error.c export_image.c extract.c file_io.c header.c inode.c inode_fixup.c \ + inode_table.c integrity.c iterate_dir.c lcpit_matchfinder.c lzms_common.c lzms_compress.c \ + lzms_decompress.c lzx_common.c lzx_compress.c lzx_decompress.c metadata_resource.c \ + pathlist.c paths.c pattern.c progress.c registry.c reparse.c resource.c scan.c security.c \ + sha1.c solid.c split.c tagged_items.c textfile.c threads.c timestamp.c update_image.c \ + util.c wim.c wimboot.c win32_apply.c win32_capture.c win32_common.c win32_replacements.c \ + win32_vss.c write.c xml.c xmlproc.c xml_windows.c xpress_compress.c xpress_decompress.c +libwim_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -DHAVE_CONFIG_H -D_RUFUS -D__SSE2__ -D_POSIX -D_POSIX_THREAD_SAFE_FUNCTIONS -DUNICODE -D_UNICODE -D__MINGW_USE_VC2005_COMPAT -Wno-undef -Wno-strict-aliasing -Wno-shadow -Wno-incompatible-pointer-types -Wno-sequence-point diff --git a/src/wimlib/Makefile.in b/src/wimlib/Makefile.in new file mode 100644 index 00000000..919757b1 --- /dev/null +++ b/src/wimlib/Makefile.in @@ -0,0 +1,886 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = src/wimlib +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libwim_a_AR = $(AR) $(ARFLAGS) +libwim_a_LIBADD = +am_libwim_a_OBJECTS = libwim_a-avl_tree.$(OBJEXT) \ + libwim_a-blob_table.$(OBJEXT) libwim_a-compress.$(OBJEXT) \ + libwim_a-compress_common.$(OBJEXT) \ + libwim_a-compress_parallel.$(OBJEXT) \ + libwim_a-compress_serial.$(OBJEXT) \ + libwim_a-cpu_features.$(OBJEXT) libwim_a-decompress.$(OBJEXT) \ + libwim_a-decompress_common.$(OBJEXT) libwim_a-dentry.$(OBJEXT) \ + libwim_a-divsufsort.$(OBJEXT) libwim_a-encoding.$(OBJEXT) \ + libwim_a-error.$(OBJEXT) libwim_a-export_image.$(OBJEXT) \ + libwim_a-extract.$(OBJEXT) libwim_a-file_io.$(OBJEXT) \ + libwim_a-header.$(OBJEXT) libwim_a-inode.$(OBJEXT) \ + libwim_a-inode_fixup.$(OBJEXT) libwim_a-inode_table.$(OBJEXT) \ + libwim_a-integrity.$(OBJEXT) libwim_a-iterate_dir.$(OBJEXT) \ + libwim_a-lcpit_matchfinder.$(OBJEXT) \ + libwim_a-lzms_common.$(OBJEXT) \ + libwim_a-lzms_compress.$(OBJEXT) \ + libwim_a-lzms_decompress.$(OBJEXT) \ + libwim_a-lzx_common.$(OBJEXT) libwim_a-lzx_compress.$(OBJEXT) \ + libwim_a-lzx_decompress.$(OBJEXT) \ + libwim_a-metadata_resource.$(OBJEXT) \ + libwim_a-pathlist.$(OBJEXT) libwim_a-paths.$(OBJEXT) \ + libwim_a-pattern.$(OBJEXT) libwim_a-progress.$(OBJEXT) \ + libwim_a-registry.$(OBJEXT) libwim_a-reparse.$(OBJEXT) \ + libwim_a-resource.$(OBJEXT) libwim_a-scan.$(OBJEXT) \ + libwim_a-security.$(OBJEXT) libwim_a-sha1.$(OBJEXT) \ + libwim_a-solid.$(OBJEXT) libwim_a-split.$(OBJEXT) \ + libwim_a-tagged_items.$(OBJEXT) libwim_a-textfile.$(OBJEXT) \ + libwim_a-threads.$(OBJEXT) libwim_a-timestamp.$(OBJEXT) \ + libwim_a-update_image.$(OBJEXT) libwim_a-util.$(OBJEXT) \ + libwim_a-wim.$(OBJEXT) libwim_a-wimboot.$(OBJEXT) \ + libwim_a-win32_apply.$(OBJEXT) \ + libwim_a-win32_capture.$(OBJEXT) \ + libwim_a-win32_common.$(OBJEXT) \ + libwim_a-win32_replacements.$(OBJEXT) \ + libwim_a-win32_vss.$(OBJEXT) libwim_a-write.$(OBJEXT) \ + libwim_a-xml.$(OBJEXT) libwim_a-xmlproc.$(OBJEXT) \ + libwim_a-xml_windows.$(OBJEXT) \ + libwim_a-xpress_compress.$(OBJEXT) \ + libwim_a-xpress_decompress.$(OBJEXT) +libwim_a_OBJECTS = $(am_libwim_a_OBJECTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = +am__depfiles_maybe = +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libwim_a_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_CFLAGS = @AM_CFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AM_LDFLAGS = @AM_LDFLAGS@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DLLTOOL = @DLLTOOL@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +RM = @RM@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SUFFIX = @SUFFIX@ +VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ +WINDRES = @WINDRES@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__leading_dot = @am__leading_dot@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LIBRARIES = libwim.a +libwim_a_SOURCES = avl_tree.c blob_table.c compress.c compress_common.c compress_parallel.c \ + compress_serial.c cpu_features.c decompress.c decompress_common.c dentry.c divsufsort.c \ + encoding.c error.c export_image.c extract.c file_io.c header.c inode.c inode_fixup.c \ + inode_table.c integrity.c iterate_dir.c lcpit_matchfinder.c lzms_common.c lzms_compress.c \ + lzms_decompress.c lzx_common.c lzx_compress.c lzx_decompress.c metadata_resource.c \ + pathlist.c paths.c pattern.c progress.c registry.c reparse.c resource.c scan.c security.c \ + sha1.c solid.c split.c tagged_items.c textfile.c threads.c timestamp.c update_image.c \ + util.c wim.c wimboot.c win32_apply.c win32_capture.c win32_common.c win32_replacements.c \ + win32_vss.c write.c xml.c xmlproc.c xml_windows.c xpress_compress.c xpress_decompress.c + +libwim_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -DHAVE_CONFIG_H -D_RUFUS -D__SSE2__ -D_POSIX -D_POSIX_THREAD_SAFE_FUNCTIONS -DUNICODE -D_UNICODE -D__MINGW_USE_VC2005_COMPAT -Wno-undef -Wno-strict-aliasing -Wno-shadow -Wno-incompatible-pointer-types -Wno-sequence-point +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps src/wimlib/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign --ignore-deps src/wimlib/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +libwim.a: $(libwim_a_OBJECTS) $(libwim_a_DEPENDENCIES) $(EXTRA_libwim_a_DEPENDENCIES) + $(AM_V_at)-rm -f libwim.a + $(AM_V_AR)$(libwim_a_AR) libwim.a $(libwim_a_OBJECTS) $(libwim_a_LIBADD) + $(AM_V_at)$(RANLIB) libwim.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +.c.o: + $(AM_V_CC)$(COMPILE) -c -o $@ $< + +.c.obj: + $(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +libwim_a-avl_tree.o: avl_tree.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-avl_tree.o `test -f 'avl_tree.c' || echo '$(srcdir)/'`avl_tree.c + +libwim_a-avl_tree.obj: avl_tree.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-avl_tree.obj `if test -f 'avl_tree.c'; then $(CYGPATH_W) 'avl_tree.c'; else $(CYGPATH_W) '$(srcdir)/avl_tree.c'; fi` + +libwim_a-blob_table.o: blob_table.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-blob_table.o `test -f 'blob_table.c' || echo '$(srcdir)/'`blob_table.c + +libwim_a-blob_table.obj: blob_table.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-blob_table.obj `if test -f 'blob_table.c'; then $(CYGPATH_W) 'blob_table.c'; else $(CYGPATH_W) '$(srcdir)/blob_table.c'; fi` + +libwim_a-compress.o: compress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-compress.o `test -f 'compress.c' || echo '$(srcdir)/'`compress.c + +libwim_a-compress.obj: compress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-compress.obj `if test -f 'compress.c'; then $(CYGPATH_W) 'compress.c'; else $(CYGPATH_W) '$(srcdir)/compress.c'; fi` + +libwim_a-compress_common.o: compress_common.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-compress_common.o `test -f 'compress_common.c' || echo '$(srcdir)/'`compress_common.c + +libwim_a-compress_common.obj: compress_common.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-compress_common.obj `if test -f 'compress_common.c'; then $(CYGPATH_W) 'compress_common.c'; else $(CYGPATH_W) '$(srcdir)/compress_common.c'; fi` + +libwim_a-compress_parallel.o: compress_parallel.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-compress_parallel.o `test -f 'compress_parallel.c' || echo '$(srcdir)/'`compress_parallel.c + +libwim_a-compress_parallel.obj: compress_parallel.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-compress_parallel.obj `if test -f 'compress_parallel.c'; then $(CYGPATH_W) 'compress_parallel.c'; else $(CYGPATH_W) '$(srcdir)/compress_parallel.c'; fi` + +libwim_a-compress_serial.o: compress_serial.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-compress_serial.o `test -f 'compress_serial.c' || echo '$(srcdir)/'`compress_serial.c + +libwim_a-compress_serial.obj: compress_serial.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-compress_serial.obj `if test -f 'compress_serial.c'; then $(CYGPATH_W) 'compress_serial.c'; else $(CYGPATH_W) '$(srcdir)/compress_serial.c'; fi` + +libwim_a-cpu_features.o: cpu_features.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-cpu_features.o `test -f 'cpu_features.c' || echo '$(srcdir)/'`cpu_features.c + +libwim_a-cpu_features.obj: cpu_features.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-cpu_features.obj `if test -f 'cpu_features.c'; then $(CYGPATH_W) 'cpu_features.c'; else $(CYGPATH_W) '$(srcdir)/cpu_features.c'; fi` + +libwim_a-decompress.o: decompress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-decompress.o `test -f 'decompress.c' || echo '$(srcdir)/'`decompress.c + +libwim_a-decompress.obj: decompress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-decompress.obj `if test -f 'decompress.c'; then $(CYGPATH_W) 'decompress.c'; else $(CYGPATH_W) '$(srcdir)/decompress.c'; fi` + +libwim_a-decompress_common.o: decompress_common.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-decompress_common.o `test -f 'decompress_common.c' || echo '$(srcdir)/'`decompress_common.c + +libwim_a-decompress_common.obj: decompress_common.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-decompress_common.obj `if test -f 'decompress_common.c'; then $(CYGPATH_W) 'decompress_common.c'; else $(CYGPATH_W) '$(srcdir)/decompress_common.c'; fi` + +libwim_a-dentry.o: dentry.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-dentry.o `test -f 'dentry.c' || echo '$(srcdir)/'`dentry.c + +libwim_a-dentry.obj: dentry.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-dentry.obj `if test -f 'dentry.c'; then $(CYGPATH_W) 'dentry.c'; else $(CYGPATH_W) '$(srcdir)/dentry.c'; fi` + +libwim_a-divsufsort.o: divsufsort.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-divsufsort.o `test -f 'divsufsort.c' || echo '$(srcdir)/'`divsufsort.c + +libwim_a-divsufsort.obj: divsufsort.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-divsufsort.obj `if test -f 'divsufsort.c'; then $(CYGPATH_W) 'divsufsort.c'; else $(CYGPATH_W) '$(srcdir)/divsufsort.c'; fi` + +libwim_a-encoding.o: encoding.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-encoding.o `test -f 'encoding.c' || echo '$(srcdir)/'`encoding.c + +libwim_a-encoding.obj: encoding.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-encoding.obj `if test -f 'encoding.c'; then $(CYGPATH_W) 'encoding.c'; else $(CYGPATH_W) '$(srcdir)/encoding.c'; fi` + +libwim_a-error.o: error.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-error.o `test -f 'error.c' || echo '$(srcdir)/'`error.c + +libwim_a-error.obj: error.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-error.obj `if test -f 'error.c'; then $(CYGPATH_W) 'error.c'; else $(CYGPATH_W) '$(srcdir)/error.c'; fi` + +libwim_a-export_image.o: export_image.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-export_image.o `test -f 'export_image.c' || echo '$(srcdir)/'`export_image.c + +libwim_a-export_image.obj: export_image.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-export_image.obj `if test -f 'export_image.c'; then $(CYGPATH_W) 'export_image.c'; else $(CYGPATH_W) '$(srcdir)/export_image.c'; fi` + +libwim_a-extract.o: extract.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-extract.o `test -f 'extract.c' || echo '$(srcdir)/'`extract.c + +libwim_a-extract.obj: extract.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-extract.obj `if test -f 'extract.c'; then $(CYGPATH_W) 'extract.c'; else $(CYGPATH_W) '$(srcdir)/extract.c'; fi` + +libwim_a-file_io.o: file_io.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-file_io.o `test -f 'file_io.c' || echo '$(srcdir)/'`file_io.c + +libwim_a-file_io.obj: file_io.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-file_io.obj `if test -f 'file_io.c'; then $(CYGPATH_W) 'file_io.c'; else $(CYGPATH_W) '$(srcdir)/file_io.c'; fi` + +libwim_a-header.o: header.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-header.o `test -f 'header.c' || echo '$(srcdir)/'`header.c + +libwim_a-header.obj: header.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-header.obj `if test -f 'header.c'; then $(CYGPATH_W) 'header.c'; else $(CYGPATH_W) '$(srcdir)/header.c'; fi` + +libwim_a-inode.o: inode.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-inode.o `test -f 'inode.c' || echo '$(srcdir)/'`inode.c + +libwim_a-inode.obj: inode.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-inode.obj `if test -f 'inode.c'; then $(CYGPATH_W) 'inode.c'; else $(CYGPATH_W) '$(srcdir)/inode.c'; fi` + +libwim_a-inode_fixup.o: inode_fixup.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-inode_fixup.o `test -f 'inode_fixup.c' || echo '$(srcdir)/'`inode_fixup.c + +libwim_a-inode_fixup.obj: inode_fixup.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-inode_fixup.obj `if test -f 'inode_fixup.c'; then $(CYGPATH_W) 'inode_fixup.c'; else $(CYGPATH_W) '$(srcdir)/inode_fixup.c'; fi` + +libwim_a-inode_table.o: inode_table.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-inode_table.o `test -f 'inode_table.c' || echo '$(srcdir)/'`inode_table.c + +libwim_a-inode_table.obj: inode_table.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-inode_table.obj `if test -f 'inode_table.c'; then $(CYGPATH_W) 'inode_table.c'; else $(CYGPATH_W) '$(srcdir)/inode_table.c'; fi` + +libwim_a-integrity.o: integrity.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-integrity.o `test -f 'integrity.c' || echo '$(srcdir)/'`integrity.c + +libwim_a-integrity.obj: integrity.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-integrity.obj `if test -f 'integrity.c'; then $(CYGPATH_W) 'integrity.c'; else $(CYGPATH_W) '$(srcdir)/integrity.c'; fi` + +libwim_a-iterate_dir.o: iterate_dir.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-iterate_dir.o `test -f 'iterate_dir.c' || echo '$(srcdir)/'`iterate_dir.c + +libwim_a-iterate_dir.obj: iterate_dir.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-iterate_dir.obj `if test -f 'iterate_dir.c'; then $(CYGPATH_W) 'iterate_dir.c'; else $(CYGPATH_W) '$(srcdir)/iterate_dir.c'; fi` + +libwim_a-lcpit_matchfinder.o: lcpit_matchfinder.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lcpit_matchfinder.o `test -f 'lcpit_matchfinder.c' || echo '$(srcdir)/'`lcpit_matchfinder.c + +libwim_a-lcpit_matchfinder.obj: lcpit_matchfinder.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lcpit_matchfinder.obj `if test -f 'lcpit_matchfinder.c'; then $(CYGPATH_W) 'lcpit_matchfinder.c'; else $(CYGPATH_W) '$(srcdir)/lcpit_matchfinder.c'; fi` + +libwim_a-lzms_common.o: lzms_common.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzms_common.o `test -f 'lzms_common.c' || echo '$(srcdir)/'`lzms_common.c + +libwim_a-lzms_common.obj: lzms_common.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzms_common.obj `if test -f 'lzms_common.c'; then $(CYGPATH_W) 'lzms_common.c'; else $(CYGPATH_W) '$(srcdir)/lzms_common.c'; fi` + +libwim_a-lzms_compress.o: lzms_compress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzms_compress.o `test -f 'lzms_compress.c' || echo '$(srcdir)/'`lzms_compress.c + +libwim_a-lzms_compress.obj: lzms_compress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzms_compress.obj `if test -f 'lzms_compress.c'; then $(CYGPATH_W) 'lzms_compress.c'; else $(CYGPATH_W) '$(srcdir)/lzms_compress.c'; fi` + +libwim_a-lzms_decompress.o: lzms_decompress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzms_decompress.o `test -f 'lzms_decompress.c' || echo '$(srcdir)/'`lzms_decompress.c + +libwim_a-lzms_decompress.obj: lzms_decompress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzms_decompress.obj `if test -f 'lzms_decompress.c'; then $(CYGPATH_W) 'lzms_decompress.c'; else $(CYGPATH_W) '$(srcdir)/lzms_decompress.c'; fi` + +libwim_a-lzx_common.o: lzx_common.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzx_common.o `test -f 'lzx_common.c' || echo '$(srcdir)/'`lzx_common.c + +libwim_a-lzx_common.obj: lzx_common.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzx_common.obj `if test -f 'lzx_common.c'; then $(CYGPATH_W) 'lzx_common.c'; else $(CYGPATH_W) '$(srcdir)/lzx_common.c'; fi` + +libwim_a-lzx_compress.o: lzx_compress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzx_compress.o `test -f 'lzx_compress.c' || echo '$(srcdir)/'`lzx_compress.c + +libwim_a-lzx_compress.obj: lzx_compress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzx_compress.obj `if test -f 'lzx_compress.c'; then $(CYGPATH_W) 'lzx_compress.c'; else $(CYGPATH_W) '$(srcdir)/lzx_compress.c'; fi` + +libwim_a-lzx_decompress.o: lzx_decompress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzx_decompress.o `test -f 'lzx_decompress.c' || echo '$(srcdir)/'`lzx_decompress.c + +libwim_a-lzx_decompress.obj: lzx_decompress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzx_decompress.obj `if test -f 'lzx_decompress.c'; then $(CYGPATH_W) 'lzx_decompress.c'; else $(CYGPATH_W) '$(srcdir)/lzx_decompress.c'; fi` + +libwim_a-metadata_resource.o: metadata_resource.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-metadata_resource.o `test -f 'metadata_resource.c' || echo '$(srcdir)/'`metadata_resource.c + +libwim_a-metadata_resource.obj: metadata_resource.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-metadata_resource.obj `if test -f 'metadata_resource.c'; then $(CYGPATH_W) 'metadata_resource.c'; else $(CYGPATH_W) '$(srcdir)/metadata_resource.c'; fi` + +libwim_a-pathlist.o: pathlist.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-pathlist.o `test -f 'pathlist.c' || echo '$(srcdir)/'`pathlist.c + +libwim_a-pathlist.obj: pathlist.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-pathlist.obj `if test -f 'pathlist.c'; then $(CYGPATH_W) 'pathlist.c'; else $(CYGPATH_W) '$(srcdir)/pathlist.c'; fi` + +libwim_a-paths.o: paths.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-paths.o `test -f 'paths.c' || echo '$(srcdir)/'`paths.c + +libwim_a-paths.obj: paths.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-paths.obj `if test -f 'paths.c'; then $(CYGPATH_W) 'paths.c'; else $(CYGPATH_W) '$(srcdir)/paths.c'; fi` + +libwim_a-pattern.o: pattern.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-pattern.o `test -f 'pattern.c' || echo '$(srcdir)/'`pattern.c + +libwim_a-pattern.obj: pattern.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-pattern.obj `if test -f 'pattern.c'; then $(CYGPATH_W) 'pattern.c'; else $(CYGPATH_W) '$(srcdir)/pattern.c'; fi` + +libwim_a-progress.o: progress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-progress.o `test -f 'progress.c' || echo '$(srcdir)/'`progress.c + +libwim_a-progress.obj: progress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-progress.obj `if test -f 'progress.c'; then $(CYGPATH_W) 'progress.c'; else $(CYGPATH_W) '$(srcdir)/progress.c'; fi` + +libwim_a-registry.o: registry.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-registry.o `test -f 'registry.c' || echo '$(srcdir)/'`registry.c + +libwim_a-registry.obj: registry.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-registry.obj `if test -f 'registry.c'; then $(CYGPATH_W) 'registry.c'; else $(CYGPATH_W) '$(srcdir)/registry.c'; fi` + +libwim_a-reparse.o: reparse.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-reparse.o `test -f 'reparse.c' || echo '$(srcdir)/'`reparse.c + +libwim_a-reparse.obj: reparse.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-reparse.obj `if test -f 'reparse.c'; then $(CYGPATH_W) 'reparse.c'; else $(CYGPATH_W) '$(srcdir)/reparse.c'; fi` + +libwim_a-resource.o: resource.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-resource.o `test -f 'resource.c' || echo '$(srcdir)/'`resource.c + +libwim_a-resource.obj: resource.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-resource.obj `if test -f 'resource.c'; then $(CYGPATH_W) 'resource.c'; else $(CYGPATH_W) '$(srcdir)/resource.c'; fi` + +libwim_a-scan.o: scan.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-scan.o `test -f 'scan.c' || echo '$(srcdir)/'`scan.c + +libwim_a-scan.obj: scan.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-scan.obj `if test -f 'scan.c'; then $(CYGPATH_W) 'scan.c'; else $(CYGPATH_W) '$(srcdir)/scan.c'; fi` + +libwim_a-security.o: security.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-security.o `test -f 'security.c' || echo '$(srcdir)/'`security.c + +libwim_a-security.obj: security.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-security.obj `if test -f 'security.c'; then $(CYGPATH_W) 'security.c'; else $(CYGPATH_W) '$(srcdir)/security.c'; fi` + +libwim_a-sha1.o: sha1.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-sha1.o `test -f 'sha1.c' || echo '$(srcdir)/'`sha1.c + +libwim_a-sha1.obj: sha1.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-sha1.obj `if test -f 'sha1.c'; then $(CYGPATH_W) 'sha1.c'; else $(CYGPATH_W) '$(srcdir)/sha1.c'; fi` + +libwim_a-solid.o: solid.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-solid.o `test -f 'solid.c' || echo '$(srcdir)/'`solid.c + +libwim_a-solid.obj: solid.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-solid.obj `if test -f 'solid.c'; then $(CYGPATH_W) 'solid.c'; else $(CYGPATH_W) '$(srcdir)/solid.c'; fi` + +libwim_a-split.o: split.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-split.o `test -f 'split.c' || echo '$(srcdir)/'`split.c + +libwim_a-split.obj: split.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-split.obj `if test -f 'split.c'; then $(CYGPATH_W) 'split.c'; else $(CYGPATH_W) '$(srcdir)/split.c'; fi` + +libwim_a-tagged_items.o: tagged_items.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-tagged_items.o `test -f 'tagged_items.c' || echo '$(srcdir)/'`tagged_items.c + +libwim_a-tagged_items.obj: tagged_items.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-tagged_items.obj `if test -f 'tagged_items.c'; then $(CYGPATH_W) 'tagged_items.c'; else $(CYGPATH_W) '$(srcdir)/tagged_items.c'; fi` + +libwim_a-textfile.o: textfile.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-textfile.o `test -f 'textfile.c' || echo '$(srcdir)/'`textfile.c + +libwim_a-textfile.obj: textfile.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-textfile.obj `if test -f 'textfile.c'; then $(CYGPATH_W) 'textfile.c'; else $(CYGPATH_W) '$(srcdir)/textfile.c'; fi` + +libwim_a-threads.o: threads.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-threads.o `test -f 'threads.c' || echo '$(srcdir)/'`threads.c + +libwim_a-threads.obj: threads.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-threads.obj `if test -f 'threads.c'; then $(CYGPATH_W) 'threads.c'; else $(CYGPATH_W) '$(srcdir)/threads.c'; fi` + +libwim_a-timestamp.o: timestamp.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-timestamp.o `test -f 'timestamp.c' || echo '$(srcdir)/'`timestamp.c + +libwim_a-timestamp.obj: timestamp.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-timestamp.obj `if test -f 'timestamp.c'; then $(CYGPATH_W) 'timestamp.c'; else $(CYGPATH_W) '$(srcdir)/timestamp.c'; fi` + +libwim_a-update_image.o: update_image.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-update_image.o `test -f 'update_image.c' || echo '$(srcdir)/'`update_image.c + +libwim_a-update_image.obj: update_image.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-update_image.obj `if test -f 'update_image.c'; then $(CYGPATH_W) 'update_image.c'; else $(CYGPATH_W) '$(srcdir)/update_image.c'; fi` + +libwim_a-util.o: util.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c + +libwim_a-util.obj: util.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` + +libwim_a-wim.o: wim.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-wim.o `test -f 'wim.c' || echo '$(srcdir)/'`wim.c + +libwim_a-wim.obj: wim.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-wim.obj `if test -f 'wim.c'; then $(CYGPATH_W) 'wim.c'; else $(CYGPATH_W) '$(srcdir)/wim.c'; fi` + +libwim_a-wimboot.o: wimboot.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-wimboot.o `test -f 'wimboot.c' || echo '$(srcdir)/'`wimboot.c + +libwim_a-wimboot.obj: wimboot.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-wimboot.obj `if test -f 'wimboot.c'; then $(CYGPATH_W) 'wimboot.c'; else $(CYGPATH_W) '$(srcdir)/wimboot.c'; fi` + +libwim_a-win32_apply.o: win32_apply.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_apply.o `test -f 'win32_apply.c' || echo '$(srcdir)/'`win32_apply.c + +libwim_a-win32_apply.obj: win32_apply.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_apply.obj `if test -f 'win32_apply.c'; then $(CYGPATH_W) 'win32_apply.c'; else $(CYGPATH_W) '$(srcdir)/win32_apply.c'; fi` + +libwim_a-win32_capture.o: win32_capture.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_capture.o `test -f 'win32_capture.c' || echo '$(srcdir)/'`win32_capture.c + +libwim_a-win32_capture.obj: win32_capture.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_capture.obj `if test -f 'win32_capture.c'; then $(CYGPATH_W) 'win32_capture.c'; else $(CYGPATH_W) '$(srcdir)/win32_capture.c'; fi` + +libwim_a-win32_common.o: win32_common.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_common.o `test -f 'win32_common.c' || echo '$(srcdir)/'`win32_common.c + +libwim_a-win32_common.obj: win32_common.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_common.obj `if test -f 'win32_common.c'; then $(CYGPATH_W) 'win32_common.c'; else $(CYGPATH_W) '$(srcdir)/win32_common.c'; fi` + +libwim_a-win32_replacements.o: win32_replacements.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_replacements.o `test -f 'win32_replacements.c' || echo '$(srcdir)/'`win32_replacements.c + +libwim_a-win32_replacements.obj: win32_replacements.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_replacements.obj `if test -f 'win32_replacements.c'; then $(CYGPATH_W) 'win32_replacements.c'; else $(CYGPATH_W) '$(srcdir)/win32_replacements.c'; fi` + +libwim_a-win32_vss.o: win32_vss.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_vss.o `test -f 'win32_vss.c' || echo '$(srcdir)/'`win32_vss.c + +libwim_a-win32_vss.obj: win32_vss.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_vss.obj `if test -f 'win32_vss.c'; then $(CYGPATH_W) 'win32_vss.c'; else $(CYGPATH_W) '$(srcdir)/win32_vss.c'; fi` + +libwim_a-write.o: write.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-write.o `test -f 'write.c' || echo '$(srcdir)/'`write.c + +libwim_a-write.obj: write.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-write.obj `if test -f 'write.c'; then $(CYGPATH_W) 'write.c'; else $(CYGPATH_W) '$(srcdir)/write.c'; fi` + +libwim_a-xml.o: xml.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xml.o `test -f 'xml.c' || echo '$(srcdir)/'`xml.c + +libwim_a-xml.obj: xml.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xml.obj `if test -f 'xml.c'; then $(CYGPATH_W) 'xml.c'; else $(CYGPATH_W) '$(srcdir)/xml.c'; fi` + +libwim_a-xmlproc.o: xmlproc.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xmlproc.o `test -f 'xmlproc.c' || echo '$(srcdir)/'`xmlproc.c + +libwim_a-xmlproc.obj: xmlproc.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xmlproc.obj `if test -f 'xmlproc.c'; then $(CYGPATH_W) 'xmlproc.c'; else $(CYGPATH_W) '$(srcdir)/xmlproc.c'; fi` + +libwim_a-xml_windows.o: xml_windows.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xml_windows.o `test -f 'xml_windows.c' || echo '$(srcdir)/'`xml_windows.c + +libwim_a-xml_windows.obj: xml_windows.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xml_windows.obj `if test -f 'xml_windows.c'; then $(CYGPATH_W) 'xml_windows.c'; else $(CYGPATH_W) '$(srcdir)/xml_windows.c'; fi` + +libwim_a-xpress_compress.o: xpress_compress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xpress_compress.o `test -f 'xpress_compress.c' || echo '$(srcdir)/'`xpress_compress.c + +libwim_a-xpress_compress.obj: xpress_compress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xpress_compress.obj `if test -f 'xpress_compress.c'; then $(CYGPATH_W) 'xpress_compress.c'; else $(CYGPATH_W) '$(srcdir)/xpress_compress.c'; fi` + +libwim_a-xpress_decompress.o: xpress_decompress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xpress_decompress.o `test -f 'xpress_decompress.c' || echo '$(srcdir)/'`xpress_decompress.c + +libwim_a-xpress_decompress.obj: xpress_decompress.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xpress_decompress.obj `if test -f 'xpress_decompress.c'; then $(CYGPATH_W) 'xpress_decompress.c'; else $(CYGPATH_W) '$(srcdir)/xpress_decompress.c'; fi` + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +check-am: all-am +check: check-am +all-am: Makefile $(LIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-tags dvi dvi-am \ + html html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/wimlib/blob_table.c b/src/wimlib/blob_table.c index 38615503..89fb6419 100644 --- a/src/wimlib/blob_table.c +++ b/src/wimlib/blob_table.c @@ -180,8 +180,8 @@ blob_release_location(struct blob_descriptor *blob) (void*)&blob->staging_file_name); #endif case BLOB_IN_ATTACHED_BUFFER: - STATIC_ASSERT((void*)&blob->file_on_disk == - (void*)&blob->attached_buffer); + STATIC_ASSERT(offsetof(struct blob_descriptor, file_on_disk) == + offsetof(struct blob_descriptor, attached_buffer)); FREE(blob->file_on_disk); break; #ifdef _WIN32 @@ -570,6 +570,7 @@ for_blob_in_table_sorted_by_sequential_order(struct blob_table *table, * Note: if the WIM file contains solid resource(s), then this structure is * sometimes overloaded to describe a "resource" rather than a "blob". See the * code for details. */ +PRAGMA_BEGIN_PACKED struct blob_descriptor_disk { /* Size, offset, and flags of the blob. */ @@ -586,6 +587,7 @@ struct blob_descriptor_disk { * zeroes if this blob is of zero length. */ u8 hash[SHA1_HASH_SIZE]; } __attribute__((packed)); +PRAGMA_END_PACKED /* Given a nonempty run of consecutive blob descriptors with the SOLID flag set, * count how many specify resources (as opposed to blobs within those @@ -1178,7 +1180,7 @@ write_blob_table_from_blob_list(struct list_head *blob_list, logical_offset = 0; list_for_each_entry(blob, blob_list, blob_table_list) { if (blob->out_reshdr.flags & WIM_RESHDR_FLAG_SOLID) { - struct wim_reshdr tmp_reshdr; + struct wim_reshdr tmp_reshdr = { 0 }; /* Eww. When WIMGAPI sees multiple solid resources, it * expects the offsets to be adjusted as if there were diff --git a/src/wimlib/compress_parallel.c b/src/wimlib/compress_parallel.c index e8fb7bf1..7d5184f7 100644 --- a/src/wimlib/compress_parallel.c +++ b/src/wimlib/compress_parallel.c @@ -499,6 +499,7 @@ new_parallel_chunk_compressor(int out_ctype, u32 out_chunk_size, return 0; err: - parallel_chunk_compressor_destroy(&ctx->base); + if (ctx) + parallel_chunk_compressor_destroy(&ctx->base); return ret; } diff --git a/src/wimlib/cpu_features.c b/src/wimlib/cpu_features.c index 08520c9c..d0669f4d 100644 --- a/src/wimlib/cpu_features.c +++ b/src/wimlib/cpu_features.c @@ -38,7 +38,7 @@ #include <stdlib.h> #include <string.h> -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) /* * With old GCC versions we have to manually save and restore the x86_32 PIC @@ -50,6 +50,24 @@ # define EBX_CONSTRAINT "=b" #endif +#if defined(_MSC_VER) +#include <intrin.h> + +#define read_xcr _xgetbv + +static inline void +cpuid(u32 leaf, u32 subleaf, u32* a, u32* b, u32* c, u32* d) +{ + int regs[4]; + __cpuidex(regs, leaf, subleaf); + *a = (uint32_t)regs[0]; + *b = (uint32_t)regs[1]; + *c = (uint32_t)regs[2]; + *d = (uint32_t)regs[3]; +} + +#else + /* Execute the CPUID instruction. */ static inline void cpuid(u32 leaf, u32 subleaf, u32 *a, u32 *b, u32 *c, u32 *d) @@ -79,6 +97,7 @@ read_xcr(u32 index) return ((u64)d << 32) | a; } +#endif static u32 get_cpu_features(void) @@ -225,7 +244,7 @@ get_cpu_features(void) return features; } -#elif defined(__aarch64__) && defined(_WIN32) +#elif (defined(__aarch64__) || (defined(_M_ARM64)) && defined(_WIN32)) #include <windows.h> @@ -248,7 +267,7 @@ static const struct { const char *name; u32 feature; } feature_table[] = { -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) {"ssse3", X86_CPU_FEATURE_SSSE3}, {"sse4.1", X86_CPU_FEATURE_SSE4_1}, {"sse4.2", X86_CPU_FEATURE_SSE4_2}, @@ -256,7 +275,7 @@ static const struct { {"bmi2", X86_CPU_FEATURE_BMI2}, {"sha", X86_CPU_FEATURE_SHA}, {"sha1", X86_CPU_FEATURE_SHA}, -#elif defined(__aarch64__) +#elif defined(__aarch64__) || defined(_M_ARM64) {"sha1", ARM_CPU_FEATURE_SHA1}, #else # error "CPU_FEATURES_ENABLED was set but no features are defined!" diff --git a/src/wimlib/decompress_common.c b/src/wimlib/decompress_common.c index abdf4df4..4c6c8d98 100644 --- a/src/wimlib/decompress_common.c +++ b/src/wimlib/decompress_common.c @@ -218,7 +218,7 @@ make_huffman_decode_table(u16 decode_table[], unsigned num_syms, unsigned n = stores_per_loop; do { *(__m128i *)entry_ptr = v; - entry_ptr += sizeof(v); + entry_ptr = _PTR(entry_ptr + sizeof(v)); } while (--n); } } @@ -246,7 +246,7 @@ make_huffman_decode_table(u16 decode_table[], unsigned num_syms, unsigned n = stores_per_loop; do { *(aliased_word_t *)entry_ptr = v; - entry_ptr += sizeof(v); + entry_ptr = _PTR(entry_ptr + sizeof(v)); } while (--n); } } @@ -263,7 +263,7 @@ make_huffman_decode_table(u16 decode_table[], unsigned num_syms, unsigned n = stores_per_loop; do { *(u16 *)entry_ptr = v; - entry_ptr += sizeof(v); + entry_ptr = _PTR(entry_ptr + sizeof(v)); } while (--n); } } diff --git a/src/wimlib/dentry.c b/src/wimlib/dentry.c index f20d7dff..2666fa72 100644 --- a/src/wimlib/dentry.c +++ b/src/wimlib/dentry.c @@ -71,6 +71,7 @@ /* On-disk format of a WIM dentry (directory entry), located in the metadata * resource for a WIM image. */ +PRAGMA_BEGIN_PACKED struct wim_dentry_on_disk { /* Length of this directory entry in bytes, not including any extra @@ -221,6 +222,7 @@ struct wim_extra_stream_entry_on_disk { * @name_nbytes != 0; i.e., if this stream is named. */ utf16lechar name[]; } __attribute__((packed)); +PRAGMA_END_PACKED static void do_dentry_set_name(struct wim_dentry *dentry, utf16lechar *name, @@ -488,7 +490,7 @@ calculate_dentry_full_path(struct wim_dentry *dentry) d = d->d_parent; /* assumes d == d->d_parent for root */ } while (!dentry_is_root(d)); - utf16lechar ubuf[ulen]; + utf16lechar* ubuf = alloca(ulen * sizeof(utf16lechar)); utf16lechar *p = &ubuf[ulen]; d = dentry; @@ -846,7 +848,7 @@ get_parent_dentry(WIMStruct *wim, const tchar *path, CASE_SENSITIVITY_TYPE case_type) { size_t path_len = tstrlen(path); - tchar buf[path_len + 1]; + tchar* buf = alloca((path_len + 1) * sizeof(tchar)); tmemcpy(buf, path, path_len + 1); to_parent_name(buf, path_len); diff --git a/src/wimlib/encoding.c b/src/wimlib/encoding.c index 41917c9d..fc1ec175 100644 --- a/src/wimlib/encoding.c +++ b/src/wimlib/encoding.c @@ -56,9 +56,15 @@ #define INVALID_CODEPOINT 0xFFFFFFFF #define VALIDATE(expr) if (validate && unlikely(!(expr))) goto invalid +#ifndef IS_SURROGATE #define IS_SURROGATE(c) ((c) >= 0xD800 && (c) < 0xE000) +#endif +#ifndef IS_HIGH_SURROGATE #define IS_HIGH_SURROGATE(c) ((c) >= 0xD800 && (c) < 0xDC00) +#endif +#ifndef IS_LOW_SURROGATE #define IS_LOW_SURROGATE(c) ((c) >= 0xDC00 && (c) < 0xE000) +#endif #define IS_UTF8_TAIL(c) (((c) & 0xC0) == 0x80) /* diff --git a/src/wimlib/extract.c b/src/wimlib/extract.c index 24b53cbe..ecb558c4 100644 --- a/src/wimlib/extract.c +++ b/src/wimlib/extract.c @@ -145,12 +145,13 @@ end_file_metadata_phase(struct apply_ctx *ctx) /* Are all bytes in the specified buffer zero? */ static bool -is_all_zeroes(const u8 *p, const size_t size) +is_all_zeroes(const u8 *buf, const size_t size) { - const u8 * const end = p + size; + uintptr_t p = (uintptr_t)buf; + const uintptr_t end = p + size; - for (; (uintptr_t)p % WORDBYTES && p != end; p++) - if (*p) + for (; p % WORDBYTES && p != end; p++) + if (*((const u8 *)p)) return false; for (; end - p >= WORDBYTES; p += WORDBYTES) @@ -158,7 +159,7 @@ is_all_zeroes(const u8 *p, const size_t size) return false; for (; p != end; p++) - if (*p) + if (*((const u8*)p)) return false; return true; @@ -187,14 +188,14 @@ is_all_zeroes(const u8 *p, const size_t size) bool detect_sparse_region(const void *data, size_t size, size_t *len_ret) { - const void *p = data; - const void * const end = data + size; + uintptr_t p = (uintptr_t)data; + const uintptr_t end = p + size; size_t len = 0; bool zeroes = false; while (p != end) { size_t n = min(end - p, SPARSE_UNIT); - bool z = is_all_zeroes(p, n); + bool z = is_all_zeroes((const u8 *)p, n); if (len != 0 && z != zeroes) break; @@ -818,20 +819,13 @@ file_name_valid(utf16lechar *name, size_t num_chars, bool fix) if (num_chars == 0) return true; for (i = 0; i < num_chars; i++) { - switch (le16_to_cpu(name[i])) { - #ifdef _WIN32 - case '\x01'...'\x1F': - case '\\': - case ':': - case '*': - case '?': - case '"': - case '<': - case '>': - case '|': - #endif - case '/': - case '\0': + u16 c = le16_to_cpu(name[i]); + if (c == '/' || c == '\0' +#ifdef _WIN32 + || (c >= '\x01' && c <= '\x1F') || c == ':' || c == '?' + || c == '"' || c == '<' || c == '>' || c == '|' +#endif + ) { if (fix) name[i] = replacement_char; else @@ -911,7 +905,7 @@ dentry_calculate_extraction_name(struct wim_dentry *dentry, out_replace: { - utf16lechar utf16_name_copy[dentry->d_name_nbytes / 2]; + utf16lechar* utf16_name_copy = alloca(dentry->d_name_nbytes); memcpy(utf16_name_copy, dentry->d_name, dentry->d_name_nbytes); file_name_valid(utf16_name_copy, dentry->d_name_nbytes / 2, true); @@ -928,10 +922,11 @@ out_replace: tchar_nchars /= sizeof(tchar); size_t fixed_name_num_chars = tchar_nchars; - tchar fixed_name[tchar_nchars + 50]; + tchar* fixed_name = alloca((tchar_nchars + 50) * sizeof(tchar)); tmemcpy(fixed_name, tchar_name, tchar_nchars); - fixed_name_num_chars += tsprintf(fixed_name + tchar_nchars, + fixed_name_num_chars += tsnprintf(fixed_name + tchar_nchars, + tchar_nchars + 50, T(" (invalid filename #%lu)"), ++ctx->invalid_sequence); @@ -1895,7 +1890,7 @@ static int extract_all_images(WIMStruct *wim, const tchar *target, int extract_flags) { size_t output_path_len = tstrlen(target); - tchar buf[output_path_len + 1 + 128 + 1]; + tchar* buf = alloca((output_path_len + 1 + 128 + 1) * sizeof(tchar)); int ret; int image; const tchar *image_name; @@ -1917,7 +1912,7 @@ extract_all_images(WIMStruct *wim, const tchar *target, int extract_flags) } else { /* Image name is empty or contains forbidden characters. * Use image number instead. */ - tsprintf(buf + output_path_len + 1, T("%d"), image); + tsnprintf(buf + output_path_len + 1, output_path_len + 1 + 128 + 1, T("%d"), image); } ret = extract_single_image(wim, image, buf, extract_flags); if (ret) diff --git a/src/wimlib/file_io.c b/src/wimlib/file_io.c index 4cd71ec4..5de562ca 100644 --- a/src/wimlib/file_io.c +++ b/src/wimlib/file_io.c @@ -61,7 +61,7 @@ full_read(struct filedes *fd, void *buf, size_t count) continue; return WIMLIB_ERR_READ; } - buf += ret; + buf = _PTR(buf + ret); count -= ret; fd->offset += ret; } @@ -86,9 +86,10 @@ pipe_read(struct filedes *fd, void *buf, size_t count, off_t offset) /* Manually seek to the requested position. */ while (fd->offset != offset) { size_t bytes_to_read = min(offset - fd->offset, BUFFER_SIZE); - u8 dummy[bytes_to_read]; + u8* dummy = MALLOC(bytes_to_read); ret = full_read(fd, dummy, bytes_to_read); + FREE(dummy); if (ret) return ret; } @@ -131,7 +132,7 @@ full_pread(struct filedes *fd, void *buf, size_t count, off_t offset) } return WIMLIB_ERR_READ; } - buf += ret; + buf = _PTR(buf + ret); count -= ret; offset += ret; } @@ -159,7 +160,7 @@ full_write(struct filedes *fd, const void *buf, size_t count) continue; return WIMLIB_ERR_WRITE; } - buf += ret; + buf = _PTR(buf + ret); count -= ret; fd->offset += ret; } @@ -185,7 +186,7 @@ full_pwrite(struct filedes *fd, const void *buf, size_t count, off_t offset) continue; return WIMLIB_ERR_WRITE; } - buf += ret; + buf = _PTR(buf + ret); count -= ret; offset += ret; } diff --git a/src/wimlib/header.c b/src/wimlib/header.c index 1a476900..10826836 100644 --- a/src/wimlib/header.c +++ b/src/wimlib/header.c @@ -62,7 +62,7 @@ int read_wim_header(WIMStruct *wim, struct wim_header *hdr) { - struct wim_header_disk disk_hdr __attribute__((aligned(8))); + PRAGMA_ALIGN(struct wim_header_disk disk_hdr, 8); struct filedes *in_fd = &wim->in_fd; const tchar *filename = wim->filename; int ret; @@ -170,7 +170,7 @@ int write_wim_header(const struct wim_header *hdr, struct filedes *out_fd, off_t offset) { - struct wim_header_disk disk_hdr __attribute__((aligned(8))); + PRAGMA_ALIGN(struct wim_header_disk disk_hdr, 8); int ret; disk_hdr.magic = cpu_to_le64(hdr->magic); @@ -210,21 +210,21 @@ write_wim_header_flags(u32 hdr_flags, struct filedes *out_fd) static const struct { u32 flag; - const char *name; + const tchar *name; } hdr_flags[] = { - {WIM_HDR_FLAG_RESERVED, "RESERVED"}, - {WIM_HDR_FLAG_COMPRESSION, "COMPRESSION"}, - {WIM_HDR_FLAG_READONLY, "READONLY"}, - {WIM_HDR_FLAG_SPANNED, "SPANNED"}, - {WIM_HDR_FLAG_RESOURCE_ONLY, "RESOURCE_ONLY"}, - {WIM_HDR_FLAG_METADATA_ONLY, "METADATA_ONLY"}, - {WIM_HDR_FLAG_WRITE_IN_PROGRESS,"WRITE_IN_PROGRESS"}, - {WIM_HDR_FLAG_RP_FIX, "RP_FIX"}, - {WIM_HDR_FLAG_COMPRESS_RESERVED,"COMPRESS_RESERVED"}, - {WIM_HDR_FLAG_COMPRESS_LZX, "COMPRESS_LZX"}, - {WIM_HDR_FLAG_COMPRESS_XPRESS, "COMPRESS_XPRESS"}, - {WIM_HDR_FLAG_COMPRESS_LZMS, "COMPRESS_LZMS"}, - {WIM_HDR_FLAG_COMPRESS_XPRESS_2,"COMPRESS_XPRESS_2"}, + {WIM_HDR_FLAG_RESERVED, T("RESERVED")}, + {WIM_HDR_FLAG_COMPRESSION, T("COMPRESSION")}, + {WIM_HDR_FLAG_READONLY, T("READONLY")}, + {WIM_HDR_FLAG_SPANNED, T("SPANNED")}, + {WIM_HDR_FLAG_RESOURCE_ONLY, T("RESOURCE_ONLY")}, + {WIM_HDR_FLAG_METADATA_ONLY, T("METADATA_ONLY")}, + {WIM_HDR_FLAG_WRITE_IN_PROGRESS,T("WRITE_IN_PROGRESS")}, + {WIM_HDR_FLAG_RP_FIX, T("RP_FIX")}, + {WIM_HDR_FLAG_COMPRESS_RESERVED,T("COMPRESS_RESERVED")}, + {WIM_HDR_FLAG_COMPRESS_LZX, T("COMPRESS_LZX")}, + {WIM_HDR_FLAG_COMPRESS_XPRESS, T("COMPRESS_XPRESS")}, + {WIM_HDR_FLAG_COMPRESS_LZMS, T("COMPRESS_LZMS")}, + {WIM_HDR_FLAG_COMPRESS_XPRESS_2,T("COMPRESS_XPRESS_2")}, }; /* API function documented in wimlib.h */ diff --git a/src/wimlib/integrity.c b/src/wimlib/integrity.c index 47d3244b..1f022123 100644 --- a/src/wimlib/integrity.c +++ b/src/wimlib/integrity.c @@ -47,12 +47,14 @@ #define INTEGRITY_MIN_CHUNK_SIZE 4096 #define INTEGRITY_MAX_CHUNK_SIZE 134217728 +PRAGMA_BEGIN_PACKED struct integrity_table { u32 size; u32 num_entries; u32 chunk_size; u8 sha1sums[][20]; } __attribute__((packed)); +PRAGMA_END_PACKED static int calculate_chunk_sha1(struct filedes *in_fd, size_t this_chunk_size, diff --git a/src/wimlib/lcpit_matchfinder.c b/src/wimlib/lcpit_matchfinder.c index a1a1c02a..33dfb701 100644 --- a/src/wimlib/lcpit_matchfinder.c +++ b/src/wimlib/lcpit_matchfinder.c @@ -88,8 +88,8 @@ * Annual Symposium on Combinatorial Pattern Matching pp. 181-192. */ static void -build_LCP(u32 SA_and_LCP[restrict], const u32 ISA[restrict], - const u8 T[restrict], const u32 n, +build_LCP(u32* restrict SA_and_LCP, const u32* restrict ISA, + const u8* restrict T, const u32 n, const u32 min_lcp, const u32 max_lcp) { u32 h = 0; @@ -170,7 +170,7 @@ build_LCP(u32 SA_and_LCP[restrict], const u32 ISA[restrict], * Volume 1, Issue 4, pp. 605-623. */ static void -build_LCPIT(u32 intervals[restrict], u32 pos_data[restrict], const u32 n) +build_LCPIT(u32* restrict intervals, u32* restrict pos_data, const u32 n) { u32 * const SA_and_LCP = intervals; u32 next_interval_idx; @@ -293,10 +293,10 @@ build_LCPIT(u32 intervals[restrict], u32 pos_data[restrict], const u32 n) */ static forceinline u32 lcpit_advance_one_byte(const u32 cur_pos, - u32 pos_data[restrict], - u32 intervals[restrict], - u32 next[restrict], - struct lz_match matches[restrict], + u32* restrict pos_data, + u32* restrict intervals, + u32* restrict next, + struct lz_match* restrict matches, const bool record_matches) { u32 ref; @@ -389,8 +389,8 @@ expand_SA(void *p, u32 n) /* Like build_LCP(), but for buffers larger than MAX_NORMAL_BUFSIZE. */ static void -build_LCP_huge(u64 SA_and_LCP64[restrict], const u32 ISA[restrict], - const u8 T[restrict], const u32 n, +build_LCP_huge(u64* restrict SA_and_LCP64, const u32* restrict ISA, + const u8* restrict T, const u32 n, const u32 min_lcp, const u32 max_lcp) { u32 h = 0; @@ -426,7 +426,7 @@ build_LCP_huge(u64 SA_and_LCP64[restrict], const u32 ISA[restrict], * 16n. (The non-huge version is 8n.) */ static void -build_LCPIT_huge(u64 intervals64[restrict], u32 pos_data[restrict], const u32 n) +build_LCPIT_huge(u64* restrict intervals64, u32* restrict pos_data, const u32 n) { u64 * const SA_and_LCP64 = intervals64; u32 next_interval_idx; @@ -495,10 +495,10 @@ build_LCPIT_huge(u64 intervals64[restrict], u32 pos_data[restrict], const u32 n) * MAX_NORMAL_BUFSIZE. */ static forceinline u32 lcpit_advance_one_byte_huge(const u32 cur_pos, - u32 pos_data[restrict], - u64 intervals64[restrict], - u32 prefetch_next[restrict], - struct lz_match matches[restrict], + u32* restrict pos_data, + u64* restrict intervals64, + u32* restrict prefetch_next, + struct lz_match* restrict matches, const bool record_matches) { u32 interval_idx; @@ -645,7 +645,7 @@ build_SA(u32 SA[], const u8 T[], u32 n, u32 *tmp) * the inverse suffix array is a mapping from suffix position to suffix rank. */ static void -build_ISA(u32 ISA[restrict], const u32 SA[restrict], u32 n) +build_ISA(u32* restrict ISA, const u32* restrict SA, u32 n) { for (u32 r = 0; r < n; r++) ISA[SA[r]] = r; diff --git a/src/wimlib/lzms_common.c b/src/wimlib/lzms_common.c index 50176847..80304878 100644 --- a/src/wimlib/lzms_common.c +++ b/src/wimlib/lzms_common.c @@ -551,8 +551,8 @@ have_opcode: * @last_target_usages must be a temporary array of length >= 65536. */ void -lzms_x86_filter(u8 data[restrict], s32 size, - s32 last_target_usages[restrict], bool undo) +lzms_x86_filter(u8* restrict data, s32 size, + s32* restrict last_target_usages, bool undo) { /* * Note: this filter runs unconditionally and uses a custom algorithm to diff --git a/src/wimlib/lzms_compress.c b/src/wimlib/lzms_compress.c index e55a32b8..72e18f74 100644 --- a/src/wimlib/lzms_compress.c +++ b/src/wimlib/lzms_compress.c @@ -177,6 +177,7 @@ check_that_powers_fit_in_bitfield(void) /* A stripped-down version of the adaptive state in LZMS which excludes the * probability entries and Huffman codes */ +PRAGMA_BEGIN_ALIGN(64) struct lzms_adaptive_state { /* Recent offsets for LZ matches */ @@ -198,7 +199,7 @@ struct lzms_adaptive_state { u8 lz_rep_states[LZMS_NUM_LZ_REP_DECISIONS]; u8 delta_state; u8 delta_rep_states[LZMS_NUM_DELTA_REP_DECISIONS]; -} __attribute__((aligned(64))); +} PRAGMA_END_ALIGN(64); /* * This structure represents a byte position in the preprocessed input data and @@ -209,6 +210,7 @@ struct lzms_adaptive_state { * each outgoing edge from this node is labeled with a literal or a match that * can be taken to advance from this position to a later position. */ +PRAGMA_BEGIN_ALIGN(64) struct lzms_optimum_node { /* @@ -251,7 +253,7 @@ struct lzms_optimum_node { * maintained per-position and are only updated occasionally. */ struct lzms_adaptive_state state; -} __attribute__((aligned(64))); +} PRAGMA_END_ALIGN(64); /* The main compressor structure */ struct lzms_compressor { @@ -921,7 +923,7 @@ lzms_encode_nonempty_item_list(struct lzms_compressor *c, cur_node -= item.length; cur_node->item = item; item = orig_node->extra_items[i]; - } while (++i != orig_node->num_extra_items); + } while (++i != orig_node->num_extra_items && i < 2); } cur_node -= item.length; saved_item = cur_node->item; diff --git a/src/wimlib/lzms_decompress.c b/src/wimlib/lzms_decompress.c index c9b5c983..c998481b 100644 --- a/src/wimlib/lzms_decompress.c +++ b/src/wimlib/lzms_decompress.c @@ -588,7 +588,7 @@ lzms_init_huffman_codes(struct lzms_decompressor *d, unsigned num_offset_slots) LZMS_DELTA_POWER_TABLEBITS); } -static noinline void +static _noinline void lzms_rebuild_huffman_code(struct lzms_huffman_rebuild_info *rebuild_info) { lzms_build_huffman_code(rebuild_info); @@ -721,7 +721,7 @@ lzms_decompress(const void * const restrict in, const size_t in_nbytes, { struct lzms_decompressor *d = _d; u8 *out_next = out; - u8 * const out_end = out + out_nbytes; + u8 * const out_end = _PTR(out + out_nbytes); struct lzms_range_decoder rd; struct lzms_input_bitstream is; @@ -742,8 +742,8 @@ lzms_decompress(const void * const restrict in, const size_t in_nbytes, u32 match_state = 0; u32 lz_state = 0; u32 delta_state = 0; - u32 lz_rep_states[LZMS_NUM_LZ_REP_DECISIONS] = {}; - u32 delta_rep_states[LZMS_NUM_DELTA_REP_DECISIONS] = {}; + u32 lz_rep_states[LZMS_NUM_LZ_REP_DECISIONS] = { 0 }; + u32 delta_rep_states[LZMS_NUM_DELTA_REP_DECISIONS] = { 0 }; /* * Requirements on the compressed data: diff --git a/src/wimlib/lzx_compress.c b/src/wimlib/lzx_compress.c index 02498bf5..69039b09 100644 --- a/src/wimlib/lzx_compress.c +++ b/src/wimlib/lzx_compress.c @@ -260,6 +260,7 @@ struct lzx_block_split_stats { * since items cannot be written until all items for the block have been chosen * and the block's Huffman codes have been computed. */ +PRAGMA_BEGIN_ALIGN(8) struct lzx_sequence { /* @@ -287,7 +288,7 @@ struct lzx_sequence { u32 adjusted_offset_and_mainsym; #define SEQ_MAINSYM_BITS 10 #define SEQ_MAINSYM_MASK (((u32)1 << SEQ_MAINSYM_BITS) - 1) -} __attribute__((aligned(8))); +} PRAGMA_END_ALIGN(8); /* * This structure represents a byte position in the input buffer and a node in @@ -298,6 +299,7 @@ struct lzx_sequence { * each outgoing edge from this node is labeled with a literal or a match that * can be taken to advance from this position to a later position. */ +PRAGMA_BEGIN_ALIGN(8) struct lzx_optimum_node { /* The cost, in bits, of the lowest-cost path that has been found to @@ -333,7 +335,7 @@ struct lzx_optimum_node { # define OPTIMUM_GAP_MATCH 0x80000000 #endif -} __attribute__((aligned(8))); +} PRAGMA_END_ALIGN(8); /* The cost model for near-optimal parsing */ struct lzx_costs { @@ -511,9 +513,11 @@ static forceinline unsigned lzx_get_offset_slot(struct lzx_compressor *c, u32 adjusted_offset, bool is_16_bit) { +#ifndef _MSC_VER if (__builtin_constant_p(adjusted_offset) && adjusted_offset < LZX_NUM_RECENT_OFFSETS) return adjusted_offset; +#endif if (is_16_bit || adjusted_offset < ARRAY_LEN(c->offset_slot_tab_1)) return c->offset_slot_tab_1[adjusted_offset]; return c->offset_slot_tab_2[adjusted_offset >> 14]; @@ -719,10 +723,10 @@ lzx_reset_symbol_frequencies(struct lzx_compressor *c) } static unsigned -lzx_compute_precode_items(const u8 lens[restrict], - const u8 prev_lens[restrict], - u32 precode_freqs[restrict], - unsigned precode_items[restrict]) +lzx_compute_precode_items(const u8* restrict lens, + const u8* restrict prev_lens, + u32* restrict precode_freqs, + unsigned* restrict precode_items) { unsigned *itemptr; unsigned run_start; @@ -842,14 +846,14 @@ lzx_compute_precode_items(const u8 lens[restrict], */ static void lzx_write_compressed_code(struct lzx_output_bitstream *os, - const u8 lens[restrict], - const u8 prev_lens[restrict], + const u8* restrict lens, + const u8* restrict prev_lens, unsigned num_lens) { u32 precode_freqs[LZX_PRECODE_NUM_SYMBOLS]; - u8 precode_lens[LZX_PRECODE_NUM_SYMBOLS]; - u32 precode_codewords[LZX_PRECODE_NUM_SYMBOLS]; - unsigned precode_items[num_lens]; + u8 precode_lens[LZX_PRECODE_NUM_SYMBOLS] = { 0 }; + u32 precode_codewords[LZX_PRECODE_NUM_SYMBOLS] = { 0 }; + unsigned* precode_items = alloca(num_lens * sizeof(unsigned)); unsigned num_precode_items; unsigned precode_item; unsigned precode_sym; @@ -1007,6 +1011,8 @@ lzx_write_sequences(struct lzx_output_bitstream *os, int block_type, main_symbol = seq->adjusted_offset_and_mainsym & SEQ_MAINSYM_MASK; offset_slot = (main_symbol - LZX_NUM_CHARS) / LZX_NUM_LEN_HEADERS; + if (offset_slot >= LZX_MAX_OFFSET_SLOTS) + return; num_extra_bits = lzx_extra_offset_bits[offset_slot]; extra_bits = adjusted_offset - (lzx_offset_slot_base[offset_slot] + LZX_OFFSET_ADJUSTMENT); @@ -1021,7 +1027,8 @@ lzx_write_sequences(struct lzx_output_bitstream *os, int block_type, STATIC_ASSERT(WORDBITS < 64 || CAN_BUFFER(MAX_MATCH_BITS)); /* Output the main symbol for the match. */ - + if (main_symbol >= LZX_MAINCODE_MAX_NUM_SYMBOLS) + return; lzx_add_bits(os, codes->codewords.main[main_symbol], codes->lens.main[main_symbol]); if (!CAN_BUFFER(MAX_MATCH_BITS)) @@ -1029,7 +1036,8 @@ lzx_write_sequences(struct lzx_output_bitstream *os, int block_type, /* If needed, output the length symbol for the match. */ - if (matchlen >= LZX_MIN_SECONDARY_LEN) { + if (matchlen >= LZX_MIN_SECONDARY_LEN && + matchlen < LZX_MIN_SECONDARY_LEN + LZX_LENCODE_NUM_SYMBOLS) { lzx_add_bits(os, codes->codewords.len[matchlen - LZX_MIN_SECONDARY_LEN], codes->lens.len[matchlen - @@ -1313,9 +1321,10 @@ lzx_should_end_block(struct lzx_block_split_stats *stats) * This is represented as a 64-bit integer for efficiency. There are three * offsets of 21 bits each. Bit 64 is garbage. */ +PRAGMA_BEGIN_ALIGN(8) struct lzx_lru_queue { u64 R; -} __attribute__((aligned(8))); +} PRAGMA_END_ALIGN(8); #define LZX_QUEUE_OFFSET_SHIFT 21 #define LZX_QUEUE_OFFSET_MASK (((u64)1 << LZX_QUEUE_OFFSET_SHIFT) - 1) @@ -1563,7 +1572,7 @@ lzx_find_min_cost_path(struct lzx_compressor * const restrict c, * been optimized by taking advantage of 'struct lzx_lru_queue' and * 'struct lzx_optimum_node' both being 8 bytes in size and alignment. */ - struct lzx_lru_queue queues[512]; + struct lzx_lru_queue queues[512] = { 0 }; STATIC_ASSERT(ARRAY_LEN(queues) >= LZX_MAX_MATCH_LEN + 1); STATIC_ASSERT(sizeof(c->optimum_nodes[0]) == sizeof(queues[0])); #define QUEUE(node) \ @@ -1572,7 +1581,7 @@ lzx_find_min_cost_path(struct lzx_compressor * const restrict c, /*(queues[(uintptr_t)(node) / sizeof(*(node)) % ARRAY_LEN(queues)])*/ #if CONSIDER_GAP_MATCHES - u32 matches_before_gap[ARRAY_LEN(queues)]; + u32 matches_before_gap[ARRAY_LEN(queues)] = { 0 }; #define MATCH_BEFORE_GAP(node) \ (matches_before_gap[(uintptr_t)(node) / sizeof(*(node)) % \ ARRAY_LEN(matches_before_gap)]) diff --git a/src/wimlib/lzx_decompress.c b/src/wimlib/lzx_decompress.c index ba923fdd..e1b255d8 100644 --- a/src/wimlib/lzx_decompress.c +++ b/src/wimlib/lzx_decompress.c @@ -70,6 +70,7 @@ #define LZX_READ_LENS_MAX_OVERRUN 50 +PRAGMA_BEGIN_ALIGN(DECODE_TABLE_ALIGNMENT) struct lzx_decompressor { DECODE_TABLE(maincode_decode_table, LZX_MAINCODE_MAX_NUM_SYMBOLS, @@ -115,7 +116,7 @@ struct lzx_decompressor { * bits of aligned offset blocks */ u8 extra_offset_bits_minus_aligned[LZX_MAX_OFFSET_SLOTS]; -} __attribute__((aligned(DECODE_TABLE_ALIGNMENT))); +} PRAGMA_END_ALIGN(DECODE_TABLE_ALIGNMENT); /* Read a Huffman-encoded symbol using the precode. */ static forceinline unsigned diff --git a/src/wimlib/registry.c b/src/wimlib/registry.c index 5672e707..5954f4c1 100644 --- a/src/wimlib/registry.c +++ b/src/wimlib/registry.c @@ -114,6 +114,7 @@ struct vk { le16 name_size; le32 data_size; le32 data_offset; +#ifndef _WIN32 #define REG_NONE cpu_to_le32(0) #define REG_SZ cpu_to_le32(1) #define REG_EXPAND_SZ cpu_to_le32(2) @@ -128,6 +129,7 @@ struct vk { #define REG_RESOURCE_REQUIREMENTS_LIST cpu_to_le32(10) #define REG_QWORD cpu_to_le32(11) #define REG_QWORD_LITTLE_ENDIAN cpu_to_le32(11) +#endif le32 data_type; #define VK_COMPRESSED_NAME cpu_to_le16(0x0001) le16 flags; diff --git a/src/wimlib/resource.c b/src/wimlib/resource.c index a2aee42d..b624a803 100644 --- a/src/wimlib/resource.c +++ b/src/wimlib/resource.c @@ -1383,8 +1383,7 @@ extract_blob_to_fd(struct blob_descriptor *blob, struct filedes *fd, int sha1_blob(struct blob_descriptor *blob) { - static const struct read_blob_callbacks cbs = { - }; + static const struct read_blob_callbacks cbs = { 0 }; return read_blob_with_sha1(blob, &cbs, false); } diff --git a/src/wimlib/security.c b/src/wimlib/security.c index 617abfbd..67f1b7f0 100644 --- a/src/wimlib/security.c +++ b/src/wimlib/security.c @@ -33,11 +33,13 @@ #include "wimlib/sha1.h" #include "wimlib/util.h" +PRAGMA_BEGIN_PACKED struct wim_security_data_disk { le32 total_length; le32 num_entries; le64 sizes[]; } __attribute__((packed)); +PRAGMA_END_PACKED struct wim_security_data * new_wim_security_data(void) diff --git a/src/wimlib/sha1.c b/src/wimlib/sha1.c index fbbfdc18..14b68239 100644 --- a/src/wimlib/sha1.c +++ b/src/wimlib/sha1.c @@ -64,13 +64,19 @@ rol32(u32 v, int bits) * the compiler from making counter-productive optimizations when there aren't * enough registers available to hold the full array. */ +#ifdef _MSC_VER +#include <intrin.h> +#pragma intrinsic(_ReadWriteBarrier) +#define FORCE_NOT_CACHED(array) _ReadWriteBarrier() +#else #define FORCE_NOT_CACHED(array) asm volatile("" : "+m" (array)) +#endif /* * Expands to FORCE_NOT_CACHED() if the architecture has 16 or fewer general * purpose registers, otherwise does nothing. */ -#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) +#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) || defined(__arm__) # define FORCE_NOT_CACHED_IF_FEW_REGS(array) FORCE_NOT_CACHED(array) #else # define FORCE_NOT_CACHED_IF_FEW_REGS(array) (void)(array) @@ -112,7 +118,7 @@ rol32(u32 v, int bits) SHA1_GENERIC_5ROUNDS((i) + 15); static void -sha1_blocks_generic(u32 h[5], const void *data, size_t num_blocks) +sha1_blocks_generic(u32 h[5], const u8 *data, size_t num_blocks) { do { u32 a = h[0]; @@ -160,7 +166,7 @@ sha1_blocks_generic(u32 h[5], const void *data, size_t num_blocks) * During rounds 80-95, the first 16 message schedule words for the next block * are prepared. */ -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) #include <immintrin.h> #define SHA1_SSSE3_PRECALC(i, w0, w1, w2, w3, w4, w5, w6, w7) \ @@ -173,18 +179,18 @@ sha1_blocks_generic(u32 h[5], const void *data, size_t num_blocks) * w[i-16..i+3] are in (w0, w1, w2, w3, w4). */ \ if ((i) % 4 == 0) { \ - w4 = _mm_alignr_epi8(w1, w0, 8) ^ w2; \ + w4 = _mm_xor_si128(_mm_alignr_epi8(w1, w0, 8), w2); \ t0 = _mm_srli_si128(w3, 4); \ } else if ((i) % 4 == 1) { \ - t0 ^= w4 ^ w0; \ + t0 = _mm_xor_si128(t0, _mm_xor_si128(w4, w0)); \ t1 = _mm_slli_si128(t0, 12); \ } else if ((i) % 4 == 2) { \ t2 = _mm_slli_epi32(t1, 2); \ w4 = _mm_slli_epi32(t0, 1); \ t0 = _mm_srli_epi32(t0, 31); \ - t2 ^= _mm_srli_epi32(t1, 30); \ + t2 = _mm_xor_si128(t2, _mm_srli_epi32(t1, 30)); \ } else { \ - w4 ^= t0 ^ t2; \ + w4 = _mm_xor_si128(w4, _mm_xor_si128(t0, t2)); \ t0 = _mm_add_epi32(w4, k); \ _mm_store_si128((__m128i *)&tmp[((i) - 3) % 16], t0); \ } \ @@ -196,21 +202,21 @@ sha1_blocks_generic(u32 h[5], const void *data, size_t num_blocks) * note the reuse of w4. */ \ if ((i) % 4 == 0) \ - w4 ^= _mm_alignr_epi8(w3, w2, 8); \ + w4 = _mm_xor_si128(w4, _mm_alignr_epi8(w3, w2, 8)); \ else if ((i) % 4 == 1) \ - w4 ^= w5 ^ w0; \ + w4 = _mm_xor_si128(w4, _mm_xor_si128(w5, w0)); \ else if ((i) % 4 == 2) \ - w4 = _mm_slli_epi32(w4, 2) ^ \ - _mm_srli_epi32(w4, 30); \ + w4 = _mm_xor_si128(_mm_slli_epi32(w4, 2), \ + _mm_srli_epi32(w4, 30)); \ else \ _mm_store_si128((__m128i *)&tmp[((i) - 3) % 16],\ _mm_add_epi32(w4, k)); \ } else if ((i) < 96) { \ /* Precomputation of w[0..15] for next block */ \ if ((i) == 80 && --num_blocks != 0) \ - data += SHA1_BLOCK_SIZE; \ + data = _PTR(data + SHA1_BLOCK_SIZE); \ if ((i) % 4 == 0) \ - w0 = _mm_loadu_si128(data + (((i) - 80) * 4)); \ + w0 = _mm_loadu_si128(_PTR(data + (((i) - 80) * 4))); \ else if ((i) % 4 == 1) \ w0 = _mm_shuffle_epi8(w0, bswap32_mask); \ else if ((i) % 4 == 2) \ @@ -252,12 +258,12 @@ sha1_blocks_generic(u32 h[5], const void *data, size_t num_blocks) 11, 10, 9, 8, 15, 14, 13, 12); \ __m128i w0, w1, w2, w3, w4, w5, w6, w7; \ __m128i k = _mm_set1_epi32(SHA1_K(0)); \ - u32 tmp[16] __attribute__((aligned(16))); \ + PRAGMA_ALIGN(u32 tmp[16], 16); \ \ - w0 = _mm_shuffle_epi8(_mm_loadu_si128(data + 0), bswap32_mask); \ - w1 = _mm_shuffle_epi8(_mm_loadu_si128(data + 16), bswap32_mask); \ - w2 = _mm_shuffle_epi8(_mm_loadu_si128(data + 32), bswap32_mask); \ - w3 = _mm_shuffle_epi8(_mm_loadu_si128(data + 48), bswap32_mask); \ + w0 = _mm_shuffle_epi8(_mm_loadu_si128(_PTR(data + 0)), bswap32_mask); \ + w1 = _mm_shuffle_epi8(_mm_loadu_si128(_PTR(data + 16)), bswap32_mask); \ + w2 = _mm_shuffle_epi8(_mm_loadu_si128(_PTR(data + 32)), bswap32_mask); \ + w3 = _mm_shuffle_epi8(_mm_loadu_si128(_PTR(data + 48)), bswap32_mask); \ _mm_store_si128((__m128i *)&tmp[0], _mm_add_epi32(w0, k)); \ _mm_store_si128((__m128i *)&tmp[4], _mm_add_epi32(w1, k)); \ _mm_store_si128((__m128i *)&tmp[8], _mm_add_epi32(w2, k)); \ @@ -323,13 +329,13 @@ sha1_blocks_x86_avx_bmi2(u32 h[5], const void *data, size_t num_blocks) * so during the j'th set of 4 rounds we do the SHA1MSG2 step for j+1'th set of * message schedule words, PXOR for j+2'th set, and SHA1MSG1 for the j+3'th set. */ -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) #include <immintrin.h> #define SHA1_NI_4ROUNDS(i, w0, w1, w2, w3, we0, we1) \ if ((i) < 16) \ w0 = _mm_shuffle_epi8( \ - _mm_loadu_si128(data + ((i) * 4)), bswap_mask); \ + _mm_loadu_si128(_PTR(data + ((i) * 4))), bswap_mask); \ if ((i) == 0) \ we0 = _mm_add_epi32(h_e, w0); \ else \ @@ -339,7 +345,7 @@ sha1_blocks_x86_avx_bmi2(u32 h[5], const void *data, size_t num_blocks) w1 = _mm_sha1msg2_epu32(w1, w0); \ abcd = _mm_sha1rnds4_epu32(abcd, we0, (i) / 20); \ if ((i) >= 8 && (i) < 72) \ - w2 ^= w0; \ + w2 = _mm_xor_si128(w2, w0); \ if ((i) >= 4 && (i) < 68) \ w3 = _mm_sha1msg1_epu32(w3, w0); \ /* @@ -355,7 +361,7 @@ sha1_blocks_x86_avx_bmi2(u32 h[5], const void *data, size_t num_blocks) #define HAVE_SHA1_BLOCKS_X86_SHA static void __attribute__((target("sha,sse4.1"))) -sha1_blocks_x86_sha(u32 h[5], const void *data, size_t num_blocks) +sha1_blocks_x86_sha(u32 h[5], const u8 *data, size_t num_blocks) { const __m128i bswap_mask = _mm_setr_epi8(15, 14, 13, 12, 11, 10, 9, 8, @@ -403,8 +409,8 @@ sha1_blocks_x86_sha(u32 h[5], const void *data, size_t num_blocks) * set of 4 message schedule words: SHA1SU0 which does w[i-16] ^ w[i-14] ^ * w[i-8], and SHA1SU1 which XOR's in w[i-3] and rotates left by 1. */ -#if defined(__aarch64__) && \ - (defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 5)) +#if (defined(__aarch64__) || defined(_M_ARM64)) && \ + (defined(__clang__) || defined(_MSC_VER) || (defined(__GNUC__) && __GNUC__ >= 5)) /* * clang's arm_neon.h used to have a bug where it only defined the SHA-1 @@ -445,7 +451,7 @@ sha1_blocks_x86_sha(u32 h[5], const void *data, size_t num_blocks) vsha1pq_u32((abcd), (e), (w))) #define SHA1_CE_4ROUNDS(i, w0, w1, w2, w3, e0, e1) \ - tmp = w0 + SHA1_CE_K(i); \ + tmp = vaddq_u32(w0, SHA1_CE_K(i)); \ e1 = vsha1h_u32(vgetq_lane_u32(abcd, 0)); \ abcd = SHA1_CE_OP((i), abcd, e0, tmp); \ if ((i) >= 12 && (i) < 76) \ @@ -471,7 +477,7 @@ static void * too, but only in clang 15 and earlier. So, use "sha2" here. */ __attribute__((target("sha2"))) -#else +#elif defined (__GNUC__) /* gcc wants "+crypto". "+sha2" doesn't work. */ __attribute__((target("+crypto"))) #endif @@ -488,10 +494,10 @@ sha1_blocks_arm_ce(u32 h[5], const void *data, size_t num_blocks) u32 e0 = h[4], e1; uint32x4_t tmp, w0, w1, w2, w3; - w0 = vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(data + 0))); - w1 = vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(data + 16))); - w2 = vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(data + 32))); - w3 = vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(data + 48))); + w0 = vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(_PTR(data + 0)))); + w1 = vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(_PTR(data + 16)))); + w2 = vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(_PTR(data + 32)))); + w3 = vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(_PTR(data + 48)))); SHA1_CE_16ROUNDS(0); SHA1_CE_16ROUNDS(16); @@ -499,9 +505,9 @@ sha1_blocks_arm_ce(u32 h[5], const void *data, size_t num_blocks) SHA1_CE_16ROUNDS(48); SHA1_CE_16ROUNDS(64); - h_abcd += abcd; + h_abcd = vaddq_u32(h_abcd, abcd); h[4] += e0; - data += SHA1_BLOCK_SIZE; + data = _PTR(data + SHA1_BLOCK_SIZE); } while (--num_blocks); vst1q_u32(h, h_abcd); @@ -517,23 +523,31 @@ sha1_blocks(u32 h[5], const void *data, size_t num_blocks) { #ifdef HAVE_SHA1_BLOCKS_X86_SHA if ((cpu_features & (X86_CPU_FEATURE_SHA | X86_CPU_FEATURE_SSE4_1)) == - (X86_CPU_FEATURE_SHA | X86_CPU_FEATURE_SSE4_1)) - return sha1_blocks_x86_sha(h, data, num_blocks); + (X86_CPU_FEATURE_SHA | X86_CPU_FEATURE_SSE4_1)) { + sha1_blocks_x86_sha(h, data, num_blocks); + return; + } #endif #ifdef HAVE_SHA1_BLOCKS_X86_AVX_BMI2 if ((cpu_features & (X86_CPU_FEATURE_AVX | X86_CPU_FEATURE_BMI2)) == - (X86_CPU_FEATURE_AVX | X86_CPU_FEATURE_BMI2)) - return sha1_blocks_x86_avx_bmi2(h, data, num_blocks); + (X86_CPU_FEATURE_AVX | X86_CPU_FEATURE_BMI2)) { + sha1_blocks_x86_avx_bmi2(h, data, num_blocks); + return; + } #endif #ifdef HAVE_SHA1_BLOCKS_X86_SSSE3 - if (cpu_features & X86_CPU_FEATURE_SSSE3) - return sha1_blocks_x86_ssse3(h, data, num_blocks); + if (cpu_features & X86_CPU_FEATURE_SSSE3) { + sha1_blocks_x86_ssse3(h, data, num_blocks); + return; + } #endif #ifdef HAVE_SHA1_BLOCKS_ARM_CE - if (cpu_features & ARM_CPU_FEATURE_SHA1) - return sha1_blocks_arm_ce(h, data, num_blocks); + if (cpu_features & ARM_CPU_FEATURE_SHA1) { + sha1_blocks_arm_ce(h, data, num_blocks); + return; + } #endif - return sha1_blocks_generic(h, data, num_blocks); + sha1_blocks_generic(h, data, num_blocks); } /* @@ -572,14 +586,14 @@ sha1_update(struct sha1_ctx *ctx, const void *data, size_t len) } memcpy(&ctx->buffer[buffered], data, remaining); sha1_blocks(ctx->h, ctx->buffer, 1); - data += remaining; + data = _PTR(data + remaining); len -= remaining; } blocks = len / SHA1_BLOCK_SIZE; if (blocks) { sha1_blocks(ctx->h, data, blocks); - data += blocks * SHA1_BLOCK_SIZE; + data = _PTR(data + blocks * SHA1_BLOCK_SIZE); len -= blocks * SHA1_BLOCK_SIZE; } diff --git a/src/wimlib/tagged_items.c b/src/wimlib/tagged_items.c index dee06517..4dc56feb 100644 --- a/src/wimlib/tagged_items.c +++ b/src/wimlib/tagged_items.c @@ -36,6 +36,7 @@ * Header that begins each tagged metadata item associated with a file in a WIM * metadata resource */ +PRAGMA_BEGIN_ALIGN(8) struct tagged_item_header { /* identifies the type of metadata item (see TAG_* constants) */ @@ -48,7 +49,7 @@ struct tagged_item_header { u8 data[0]; /* then zero-padded to an 8-byte boundary */ -} __attribute__((aligned(8))); +} PRAGMA_END_ALIGN(8); /* * Retrieve from @inode the first metadata item that is tagged with @tag and diff --git a/src/wimlib/threads.c b/src/wimlib/threads.c index 1b1028a0..c95ea762 100644 --- a/src/wimlib/threads.c +++ b/src/wimlib/threads.c @@ -38,7 +38,7 @@ #ifdef _WIN32 -static WINAPI DWORD +static DWORD WINAPI win32_thrproc(LPVOID lpParameter) { struct thread *t = (struct thread *)lpParameter; diff --git a/src/wimlib/timestamp.c b/src/wimlib/timestamp.c index 70b2e5f3..76deb65e 100644 --- a/src/wimlib/timestamp.c +++ b/src/wimlib/timestamp.c @@ -135,9 +135,13 @@ now_as_wim_timestamp(void) void wim_timestamp_to_str(u64 timestamp, tchar *buf, size_t len) { - struct tm tm; + struct tm tm = { 0 }; time_t t = wim_timestamp_to_time_t(timestamp); +#ifdef _WIN32 + gmtime_s(&tm, &t); +#else gmtime_r(&t, &tm); +#endif tstrftime(buf, len, T("%a %b %d %H:%M:%S %Y UTC"), &tm); } diff --git a/src/wimlib/update_image.c b/src/wimlib/update_image.c index c4a2d571..45c50d8f 100644 --- a/src/wimlib/update_image.c +++ b/src/wimlib/update_image.c @@ -742,7 +742,7 @@ get_capture_config(const tchar *config_file, struct capture_config *config, size_t len = tstrlen(fs_source_path) + tstrlen(wimboot_cfgfile); - struct stat st; + struct _stat64 st; tmp_config_file = MALLOC((len + 1) * sizeof(tchar)); if (!tmp_config_file) diff --git a/src/wimlib/util.c b/src/wimlib/util.c index 52af147d..ef1c38c7 100644 --- a/src/wimlib/util.c +++ b/src/wimlib/util.c @@ -36,7 +36,9 @@ #ifdef HAVE_SYS_SYSCALL_H # include <sys/syscall.h> #endif -#include <unistd.h> +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif #include "wimlib.h" #include "wimlib/assert.h" @@ -162,7 +164,8 @@ wimlib_set_memory_allocator(void *(*malloc_func)(size_t), #ifndef HAVE_MEMPCPY void *mempcpy(void *dst, const void *src, size_t n) { - return memcpy(dst, src, n) + n; + void* ret = memcpy(dst, src, n); + return ret != NULL ? _PTR(ret + n) : NULL; } #endif diff --git a/src/wimlib/wim.c b/src/wimlib/wim.c index 3a2a216a..afecba9a 100644 --- a/src/wimlib/wim.c +++ b/src/wimlib/wim.c @@ -441,13 +441,13 @@ wimlib_print_available_images(const WIMStruct *wim, int image) int first; int last; int i; - int n; + int n = 80; if (image == WIMLIB_ALL_IMAGES) { - n = tprintf(T("Available Images:\n")); + tprintf(T("Available Images:\n")); first = 1; last = wim->hdr.image_count; } else if (image >= 1 && image <= wim->hdr.image_count) { - n = tprintf(T("Information for Image %d\n"), image); + tprintf(T("Information for Image %d\n"), image); first = image; last = image; } else { @@ -961,6 +961,7 @@ wimlib_global_init(int init_flags) if (lib_initialized) goto out; + mutex_init(&lib_initialization_mutex); mutex_lock(&lib_initialization_mutex); if (lib_initialized) @@ -1025,4 +1026,5 @@ wimlib_global_cleanup(void) out_unlock: mutex_unlock(&lib_initialization_mutex); + mutex_destroy(&lib_initialization_mutex); } diff --git a/src/wimlib/wimlib/compiler.h b/src/wimlib/wimlib/compiler.h index 77cd27f8..6ad165ad 100644 --- a/src/wimlib/wimlib/compiler.h +++ b/src/wimlib/wimlib/compiler.h @@ -27,6 +27,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#include <stdlib.h> + #ifndef _WIMLIB_COMPILER_H #define _WIMLIB_COMPILER_H @@ -49,17 +51,52 @@ # define __has_builtin(builtin) 0 #endif +#ifdef _MSC_VER +#if !__has_attribute(attribute) +#define __attribute__(x) +#endif + /* Declare that the annotated function should always be inlined. This might be * desirable in highly tuned code, e.g. compression codecs. */ -#define forceinline inline __attribute__((always_inline)) +#define forceinline __inline /* Declare that the annotated function should *not* be inlined. */ -#define noinline __attribute__((noinline)) +#define _noinline __declspec(noinline) /* Functionally the same as 'noinline', but documents that the reason for not * inlining is to prevent the annotated function from being inlined into a * recursive function, thereby increasing its stack usage. */ -#define noinline_for_stack noinline +#define noinline_for_stack _noinline + +/* Hint that the expression is usually true. */ +#define likely(expr) (expr) + +/* Hint that the expression is usually false. */ +#define unlikely(expr) (expr) + +#if defined(_M_IX86) || defined(_M_X64) +/* Prefetch into L1 cache for read. */ +#define prefetchr _m_prefetch + +/* Prefetch into L1 cache for write. */ +#define prefetchw _m_prefetchw +#else +#define prefetchr(x) +#define prefetchw(x) +#endif + +#else +/* Declare that the annotated function should always be inlined. This might be + * desirable in highly tuned code, e.g. compression codecs. */ +#define forceinline inline __attribute__((always_inline)) + + /* Declare that the annotated function should *not* be inlined. */ +#define _noinline __attribute__((noinline)) + +/* Functionally the same as 'noinline', but documents that the reason for not + * inlining is to prevent the annotated function from being inlined into a + * recursive function, thereby increasing its stack usage. */ +#define noinline_for_stack _noinline /* Hint that the expression is usually true. */ #define likely(expr) __builtin_expect(!!(expr), 1) @@ -72,6 +109,7 @@ /* Prefetch into L1 cache for write. */ #define prefetchw(addr) __builtin_prefetch((addr), 1) +#endif /* Hint that the annotated function takes a printf()-like format string and * arguments. This is currently disabled on Windows because MinGW does not @@ -101,24 +139,29 @@ /* UNALIGNED_ACCESS_IS_FAST should be defined to 1 if unaligned memory accesses * can be performed efficiently on the target platform. */ -#if defined(__x86_64__) || defined(__i386__) || \ +#if defined(__x86_64__) || defined(__i386__) || defined(_M_IX86) || defined(_M_X64) || \ defined(__ARM_FEATURE_UNALIGNED) || defined(__powerpc64__) # define UNALIGNED_ACCESS_IS_FAST 1 #else # define UNALIGNED_ACCESS_IS_FAST 0 #endif + /* Get the minimum of two variables, without multiple evaluation. */ +#ifndef _MSC_VER #undef min #define min(a, b) ({ typeof(a) _a = (a); typeof(b) _b = (b); \ (_a < _b) ? _a : _b; }) +#endif #undef MIN #define MIN(a, b) min((a), (b)) /* Get the maximum of two variables, without multiple evaluation. */ +#ifndef _MSC_VER #undef max #define max(a, b) ({ typeof(a) _a = (a); typeof(b) _b = (b); \ (_a > _b) ? _a : _b; }) +#endif #undef MAX #define MAX(a, b) max((a), (b)) @@ -128,7 +171,7 @@ /* Swap the values of two variables, without multiple evaluation. */ #ifndef swap -# define swap(a, b) ({ typeof(a) _a = (a); (a) = (b); (b) = _a; }) +# define swap(a, b) do { typeof(a) _a = (a); (a) = (b); (b) = _a; } while(0) #endif #define SWAP(a, b) swap((a), (b)) @@ -152,11 +195,92 @@ /* STATIC_ASSERT_ZERO() - verify the truth of an expression at compilation time * and also produce a result of value '0' to be used in constant expressions */ -#define STATIC_ASSERT_ZERO(expr) ((int)sizeof(char[-!(expr)])) +#define STATIC_ASSERT_ZERO(expr) (0 * sizeof(char[1 - 2 * !(expr)])) #define CONCAT_IMPL(s1, s2) s1##s2 /* CONCAT() - concatenate two tokens at preprocessing time. */ #define CONCAT(s1, s2) CONCAT_IMPL(s1, s2) +#ifdef _MSC_VER +#define PRAGMA_BEGIN_PACKED __pragma(pack(push, 1)) +#define PRAGMA_END_PACKED __pragma(pack(pop)) +#else +#define PRAGMA_BEGIN_PACKED +#define PRAGMA_END_PACKED +#endif + +#ifdef _MSC_VER +#define PRAGMA_ALIGN(x, a) __declspec(align(a)) x +#define PRAGMA_BEGIN_ALIGN(a) __declspec(align(a)) +#define PRAGMA_END_ALIGN(a) +#else +#define PRAGMA_ALIGN(x, a) x __attribute__((aligned(a))) +#define PRAGMA_BEGIN_ALIGN(a) +#define PRAGMA_END_ALIGN(a) __attribute__((aligned(a))) +#endif + +#ifdef _MSC_VER +#define _PTR(x) (void*)((uintptr_t)x) +#else +#define _PTR(x) x +#endif + +#ifdef _MSC_VER +#include <intrin.h> +#include <stdint.h> +uint32_t __inline __builtin_ctz(uint32_t value) +{ + unsigned long trailing_zero = 0; + if (_BitScanForward(&trailing_zero, value)) + return trailing_zero; + return 32; +} +uint32_t __inline __builtin_clz(uint32_t value) +{ + unsigned long leading_zero = 0; + if (_BitScanReverse(&leading_zero, value)) + return 31 - leading_zero; + return 32; +} +#if defined(_M_X64) || defined(_M_ARM64) +uint32_t __inline __builtin_clzll(uint64_t value) +{ + unsigned long leading_zero = 0; + if (_BitScanReverse64(&leading_zero, value)) + return 63 - leading_zero; + return 64; +} +uint32_t __inline __builtin_ctzll(uint64_t value) +{ + unsigned long trailing_zero = 0; + if (_BitScanForward64(&trailing_zero, value)) + return trailing_zero; + return 64; +} +#else +uint32_t __inline __builtin_clzll(uint64_t value) +{ + if (value == 0) + return 64; + uint32_t msh = (uint32_t)(value >> 32); + uint32_t lsh = (uint32_t)(value & 0xFFFFFFFF); + if (msh != 0) + return __builtin_clz(msh); + return 32 + __builtin_clz(lsh); +} +uint32_t __inline __builtin_ctzll(uint64_t value) +{ + if (value == 0) + return 64; + uint32_t msh = (uint32_t)(value >> 32); + uint32_t lsh = (uint32_t)(value & 0xFFFFFFFF); + if (msh != 0) + return __builtin_ctz(msh); + return 32 + __builtin_ctz(lsh); +} +#endif +#define __builtin_clzl __builtin_clzll +#endif + #endif /* _WIMLIB_COMPILER_H */ diff --git a/src/wimlib/wimlib/cpu_features.h b/src/wimlib/wimlib/cpu_features.h index ee6ef485..c57fc84e 100644 --- a/src/wimlib/wimlib/cpu_features.h +++ b/src/wimlib/wimlib/cpu_features.h @@ -13,6 +13,8 @@ #define ARM_CPU_FEATURE_SHA1 0x00000001 #if (defined(__i386__) || defined(__x86_64__)) || \ + (defined (_M_IX86) || defined (_M_X64) || defined(_M_ARM64)) || \ + (defined(__aarch64__) && defined(__linux__)) || \ (defined(__aarch64__) && defined(__linux__)) || \ (defined(__aarch64__) && defined(__APPLE__)) || \ (defined(__aarch64__) && defined(_WIN32)) diff --git a/src/wimlib/wimlib/decompress_common.h b/src/wimlib/wimlib/decompress_common.h index 46fce94f..08367a53 100644 --- a/src/wimlib/wimlib/decompress_common.h +++ b/src/wimlib/wimlib/decompress_common.h @@ -401,16 +401,17 @@ read_huffsym(struct input_bitstream *is, const u16 decode_table[], * DECODE_TABLE_ALIGNMENT-byte aligned boundary as well. */ #define DECODE_TABLE(name, num_syms, table_bits, max_codeword_len) \ + PRAGMA_BEGIN_ALIGN(DECODE_TABLE_ALIGNMENT) \ u16 name[DECODE_TABLE_SIZE((num_syms), (table_bits), \ (max_codeword_len))] \ - __attribute__((aligned(DECODE_TABLE_ALIGNMENT))) + PRAGMA_END_ALIGN(DECODE_TABLE_ALIGNMENT) /* * Declare the temporary "working_space" array needed for building the decode * table for a Huffman code. */ #define DECODE_TABLE_WORKING_SPACE(name, num_syms, max_codeword_len) \ - u16 name[2 * ((max_codeword_len) + 1) + (num_syms)]; + u16 name[2 * ((max_codeword_len) + 1) + (num_syms)] int make_huffman_decode_table(u16 decode_table[], unsigned num_syms, diff --git a/src/wimlib/wimlib/endianness.h b/src/wimlib/wimlib/endianness.h index d72d50a9..5957186a 100644 --- a/src/wimlib/wimlib/endianness.h +++ b/src/wimlib/wimlib/endianness.h @@ -42,6 +42,15 @@ /* Watch out for conflict with ntfs-3g/endians.h ... */ #ifndef _NTFS_ENDIANS_H +#ifdef _MSC_VER + +#include <intrin.h> +#define bswap16 _byteswap_ushort +#define bswap32 _byteswap_ulong +#define bswap64 _byteswap_uint64 + +#else + #define bswap16_const(n) \ ((((u16)(n) & 0x00FF) << 8) | \ (((u16)(n) & 0xFF00) >> 8)) @@ -93,6 +102,8 @@ static forceinline u64 do_bswap64(u64 n) #define bswap32(n) (__builtin_constant_p(n) ? bswap32_const(n) : do_bswap32(n)) #define bswap64(n) (__builtin_constant_p(n) ? bswap64_const(n) : do_bswap64(n)) +#endif /* _MSC_VER */ + #if CPU_IS_BIG_ENDIAN() # define cpu_to_le16(n) ((_force_attr le16)bswap16(n)) # define cpu_to_le32(n) ((_force_attr le32)bswap32(n)) diff --git a/src/wimlib/wimlib/error.h b/src/wimlib/wimlib/error.h index 062acacf..88e11297 100644 --- a/src/wimlib/wimlib/error.h +++ b/src/wimlib/wimlib/error.h @@ -19,10 +19,21 @@ wimlib_warning(const tchar *format, ...); void _format_attribute(printf, 1, 2) __attribute__((cold)) wimlib_warning_with_errno(const tchar *format, ...); +#ifdef _RUFUS +#include "rufus.h" +#ifdef ERROR +#undef ERROR +#endif +#define ERROR(format, ...) wuprintf(T(format)T("\n"), ## __VA_ARGS__) +#define ERROR_WITH_ERRNO ERROR +#define WARNING(format, ...) wuprintf(T(format)T("\n"), ## __VA_ARGS__) +#define WARNING_WITH_ERRNO WARNING +#else #define ERROR(format, ...) wimlib_error(T(format), ## __VA_ARGS__) #define ERROR_WITH_ERRNO(format, ...) wimlib_error_with_errno(T(format), ## __VA_ARGS__) #define WARNING(format, ...) wimlib_warning(T(format), ## __VA_ARGS__) #define WARNING_WITH_ERRNO(format, ...) wimlib_warning_with_errno(T(format), ## __VA_ARGS__) +#endif extern bool wimlib_print_errors; extern FILE *wimlib_error_file; diff --git a/src/wimlib/wimlib/file_io.h b/src/wimlib/wimlib/file_io.h index 8dbdb120..cd4ee041 100644 --- a/src/wimlib/wimlib/file_io.h +++ b/src/wimlib/wimlib/file_io.h @@ -4,6 +4,7 @@ #include <stdbool.h> #include <stddef.h> #include <sys/types.h> +#include <unistd.h> /* Wrapper around a file descriptor that keeps track of offset (including in * pipes, which don't support lseek()) and a cached flag that tells whether the @@ -48,7 +49,12 @@ static inline void filedes_invalidate(struct filedes *fd) fd->fd = -1; } +#ifdef _MSC_VER +#include <io.h> +#define filedes_close(f) _close((f)->fd) +#else #define filedes_close(f) close((f)->fd) +#endif static inline bool filedes_valid(const struct filedes *fd) diff --git a/src/wimlib/wimlib/guid.h b/src/wimlib/wimlib/guid.h index 8c5e3064..b4d5b9d4 100644 --- a/src/wimlib/wimlib/guid.h +++ b/src/wimlib/wimlib/guid.h @@ -34,7 +34,7 @@ guids_equal(const u8 guid1[GUID_SIZE], const u8 guid2[GUID_SIZE]) static inline void generate_guid(u8 guid[GUID_SIZE]) { - return get_random_bytes(guid, GUID_SIZE); + get_random_bytes(guid, GUID_SIZE); } #endif /* _WIMLIB_GUID_H */ diff --git a/src/wimlib/wimlib/header.h b/src/wimlib/wimlib/header.h index 49ccf0b2..5cb5c772 100644 --- a/src/wimlib/wimlib/header.h +++ b/src/wimlib/wimlib/header.h @@ -48,6 +48,7 @@ ((u64)'\0' << 54)) /* On-disk format of the WIM header. */ +PRAGMA_BEGIN_PACKED struct wim_header_disk { /* +0x00: Magic characters WIM_MAGIC or PWM_MAGIC. */ @@ -111,6 +112,7 @@ struct wim_header_disk { /* +0xd0 (208) */ } __attribute__((packed)); +PRAGMA_END_PACKED /* * Arbitrarily limit the maximum number of images to 65535, to prevent huge diff --git a/src/wimlib/wimlib/inode.h b/src/wimlib/wimlib/inode.h index bdf2ad18..c23a37df 100644 --- a/src/wimlib/wimlib/inode.h +++ b/src/wimlib/wimlib/inode.h @@ -229,7 +229,7 @@ struct wim_inode { /* Optional extra data for a WIM inode */ struct wim_inode_extra { size_t size; /* Size of the extra data in bytes */ - u8 data[] __attribute__((aligned(8))); /* The extra data */ + PRAGMA_ALIGN(u8 data[], 8); /* The extra data */ }; /* diff --git a/src/wimlib/wimlib/list.h b/src/wimlib/wimlib/list.h index d556a56c..4ddc4bfb 100644 --- a/src/wimlib/wimlib/list.h +++ b/src/wimlib/wimlib/list.h @@ -182,8 +182,13 @@ list_splice_tail(struct list_head *list, struct list_head *head) * @type: the type of the struct this is embedded in. * @member: the name of the list_struct within the struct. */ +#ifdef _MSC_VER +#define list_entry(ptr, type, member) \ + ((type *)((uintptr_t)(ptr) - (uintptr_t)offsetof(type, member))) +#else #define list_entry(ptr, type, member) \ container_of(ptr, type, member) +#endif /** * list_first_entry - get the first element from a list @@ -324,10 +329,15 @@ hlist_add_head(struct hlist_node *n, struct hlist_head *h) #define hlist_entry(ptr, type, member) container_of(ptr,type,member) +#ifdef _MSC_VER +#define hlist_entry_safe(ptr, type, member) \ + ( (ptr) ? hlist_entry(ptr, type, member) : NULL ) +#else #define hlist_entry_safe(ptr, type, member) \ ({ typeof(ptr) ____ptr = (ptr); \ ____ptr ? hlist_entry(____ptr, type, member) : NULL; \ }) +#endif /** * hlist_for_each_entry - iterate over list of given type @@ -349,7 +359,7 @@ hlist_add_head(struct hlist_node *n, struct hlist_head *h) */ #define hlist_for_each_entry_safe(pos, n, head, member) \ for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);\ - pos && ({ n = pos->member.next; 1; }); \ + pos && ((n = pos->member.next) - n + 1); \ pos = hlist_entry_safe(n, typeof(*pos), member)) #endif /* _WIMLIB_LIST_H */ diff --git a/src/wimlib/wimlib/progress.h b/src/wimlib/wimlib/progress.h index e3627eec..e73b3fd1 100644 --- a/src/wimlib/wimlib/progress.h +++ b/src/wimlib/wimlib/progress.h @@ -75,7 +75,7 @@ static inline tchar * progress_get_win32_path(const tchar *path) { #ifdef _WIN32 - if (!wcsncmp(path, L"\\??\\", 4)) { + if (path != NULL && !wcsncmp(path, L"\\??\\", 4)) { ((wchar_t *)path)[1] = L'\\'; return (wchar_t *)&path[1]; } diff --git a/src/wimlib/wimlib/resource.h b/src/wimlib/wimlib/resource.h index 8924b807..025bd58d 100644 --- a/src/wimlib/wimlib/resource.h +++ b/src/wimlib/wimlib/resource.h @@ -58,6 +58,7 @@ struct wim_resource_descriptor { }; /* On-disk version of a WIM resource header. */ +PRAGMA_BEGIN_PACKED struct wim_reshdr_disk { /* Size of the resource as it appears in the WIM file (possibly * compressed). */ @@ -73,6 +74,7 @@ struct wim_reshdr_disk { /* Uncompressed size of the resource, in bytes. */ le64 uncompressed_size; } __attribute__((packed)); +PRAGMA_END_PACKED /* In-memory version of a WIM resource header (`struct wim_reshdr_disk'). */ struct wim_reshdr { @@ -138,6 +140,7 @@ put_wim_reshdr(const struct wim_reshdr *reshdr, /* Alternate chunk table format for resources with WIM_RESHDR_FLAG_SOLID set. */ +PRAGMA_BEGIN_PACKED struct alt_chunk_table_header_disk { /* Uncompressed size of the resource in bytes. */ le64 res_usize; @@ -159,6 +162,7 @@ struct alt_chunk_table_header_disk { /* This header is directly followed by a table of compressed sizes of * the chunks (4 bytes per entry). */ } __attribute__((packed)); +PRAGMA_END_PACKED static inline unsigned int get_chunk_entry_size(u64 res_size, bool is_alt) @@ -315,6 +319,7 @@ write_metadata_resource(WIMStruct *wim, int image, int write_resource_flags); #define PWM_BLOB_MAGIC 0x2b9b9ba2443db9d8ULL /* Header that precedes each blob in a pipable WIM. */ +PRAGMA_BEGIN_PACKED struct pwm_blob_hdr { le64 magic; /* +0 */ le64 uncompressed_size; /* +8 */ @@ -328,5 +333,6 @@ struct pwm_blob_hdr { struct pwm_chunk_hdr { le32 compressed_size; } __attribute__((packed)); +PRAGMA_END_PACKED #endif /* _WIMLIB_RESOURCE_H */ diff --git a/src/wimlib/wimlib/timestamp.h b/src/wimlib/wimlib/timestamp.h index e30e0621..bdc99973 100644 --- a/src/wimlib/wimlib/timestamp.h +++ b/src/wimlib/wimlib/timestamp.h @@ -7,7 +7,9 @@ #ifndef _WIMLIB_TIMESTAMP_H #define _WIMLIB_TIMESTAMP_H +#ifdef HAVE_SYS_TIMES_H #include <sys/time.h> +#endif #include <time.h> #include "wimlib/types.h" diff --git a/src/wimlib/wimlib/util.h b/src/wimlib/wimlib/util.h index 6c9ee061..bfb955bd 100644 --- a/src/wimlib/wimlib/util.h +++ b/src/wimlib/wimlib/util.h @@ -87,6 +87,7 @@ memdup(const void *mem, size_t size); #ifndef HAVE_MEMPCPY void * mempcpy(void *dst, const void *src, size_t n); +#define wmempcpy(d, s, n) mempcpy(d, s, (n) * sizeof(wchar_t)) #endif /************************** @@ -107,7 +108,6 @@ static inline bool is_power_of_2(unsigned long n) { return (n != 0 && (n & (n - 1)) == 0); - } static inline u64 diff --git a/src/wimlib/wimlib/win32.h b/src/wimlib/wimlib/win32.h index ed54e6f5..d71220fd 100644 --- a/src/wimlib/wimlib/win32.h +++ b/src/wimlib/wimlib/win32.h @@ -7,6 +7,7 @@ #ifdef _WIN32 +#include <unistd.h> #include "wimlib/types.h" struct blob_descriptor; diff --git a/src/wimlib/wimlib/win32_common.h b/src/wimlib/wimlib/win32_common.h index 46faf6ac..d48206d8 100644 --- a/src/wimlib/wimlib/win32_common.h +++ b/src/wimlib/wimlib/win32_common.h @@ -6,9 +6,11 @@ #ifndef _WIMLIB_WIN32_COMMON_H #define _WIMLIB_WIN32_COMMON_H +#define UMDF_USING_NTSTATUS #include <ntstatus.h> #include <windows.h> #include <winternl.h> +#include <unistd.h> #ifdef ERROR # undef ERROR @@ -17,8 +19,232 @@ /* ntdll definitions */ +#ifdef _MSC_VER #define FILE_OPENED 0x00000001 +#ifndef FILE_SHARE_VALID_FLAGS +#define FILE_SHARE_VALID_FLAGS 0x00000007 +#endif + +typedef struct _FILE_NAME_INFORMATION { + ULONG FileNameLength; + WCHAR FileName[1]; +} FILE_NAME_INFORMATION; + +typedef struct _FILE_BASIC_INFORMATION { + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + ULONG FileAttributes; +} FILE_BASIC_INFORMATION; + +typedef struct _FILE_DISPOSITION_INFORMATION { + BOOLEAN DoDeleteFile; +} FILE_DISPOSITION_INFORMATION; + +typedef struct _FILE_LINK_INFORMATION { + union { + BOOLEAN ReplaceIfExists; + ULONG Flags; + } DUMMYUNIONNAME; + HANDLE RootDirectory; + ULONG FileNameLength; + WCHAR FileName[1]; +} FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION; + +typedef struct _FILE_ALLOCATION_INFORMATION { + LARGE_INTEGER AllocationSize; +} FILE_ALLOCATION_INFORMATION; + +typedef struct _FILE_END_OF_FILE_INFORMATION { + LARGE_INTEGER EndOfFile; +} FILE_END_OF_FILE_INFORMATION; + +typedef struct _FILE_FULL_EA_INFORMATION { + ULONG NextEntryOffset; + UCHAR Flags; + UCHAR EaNameLength; + USHORT EaValueLength; + CHAR EaName[1]; +} FILE_FULL_EA_INFORMATION; + +typedef struct _FILE_INTERNAL_INFORMATION { + LARGE_INTEGER IndexNumber; +} FILE_INTERNAL_INFORMATION; + +typedef struct _FILE_NAMES_INFORMATION { + ULONG NextEntryOffset; + ULONG FileIndex; + ULONG FileNameLength; + WCHAR FileName[1]; +} FILE_NAMES_INFORMATION; + +typedef struct _FILE_FS_VOLUME_INFORMATION { + LARGE_INTEGER VolumeCreationTime; + ULONG VolumeSerialNumber; + ULONG VolumeLabelLength; + BOOLEAN SupportsObjects; + WCHAR VolumeLabel[1]; +} FILE_FS_VOLUME_INFORMATION; + +typedef struct _FILE_STANDARD_INFORMATION { + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG NumberOfLinks; + BOOLEAN DeletePending; + BOOLEAN Directory; +} FILE_STANDARD_INFORMATION; + +typedef struct _FILE_EA_INFORMATION { + ULONG EaSize; +} FILE_EA_INFORMATION; + +typedef struct _FILE_ACCESS_INFORMATION { + ACCESS_MASK AccessFlags; +} FILE_ACCESS_INFORMATION; + +typedef struct _FILE_POSITION_INFORMATION { + LARGE_INTEGER CurrentByteOffset; +} FILE_POSITION_INFORMATION; + +typedef struct _FILE_MODE_INFORMATION { + ULONG Mode; +} FILE_MODE_INFORMATION; + +typedef struct _FILE_ALIGNMENT_INFORMATION { + ULONG AlignmentRequirement; +} FILE_ALIGNMENT_INFORMATION; + +typedef struct _FILE_STREAM_INFORMATION { + ULONG NextEntryOffset; + ULONG StreamNameLength; + LARGE_INTEGER StreamSize; + LARGE_INTEGER StreamAllocationSize; + WCHAR StreamName[1]; +} FILE_STREAM_INFORMATION; + +typedef struct _FILE_ALL_INFORMATION { + FILE_BASIC_INFORMATION BasicInformation; + FILE_STANDARD_INFORMATION StandardInformation; + FILE_INTERNAL_INFORMATION InternalInformation; + FILE_EA_INFORMATION EaInformation; + FILE_ACCESS_INFORMATION AccessInformation; + FILE_POSITION_INFORMATION PositionInformation; + FILE_MODE_INFORMATION ModeInformation; + FILE_ALIGNMENT_INFORMATION AlignmentInformation; + FILE_NAME_INFORMATION NameInformation; +} FILE_ALL_INFORMATION; + +typedef struct _FILE_FS_ATTRIBUTE_INFORMATION { + ULONG FileSystemAttributes; + ULONG MaximumComponentNameLength; + ULONG FileSystemNameLength; + WCHAR FileSystemName[1]; +} FILE_FS_ATTRIBUTE_INFORMATION; + +typedef enum { + FileDirectoryInformationAlt = 1, + FileFullDirectoryInformation = 2, + FileBothDirectoryInformation = 3, + FileBasicInformation = 4, + FileStandardInformation = 5, + FileInternalInformation = 6, + FileEaInformation = 7, + FileAccessInformation = 8, + FileNameInformation = 9, + FileRenameInformation = 10, + FileLinkInformation = 11, + FileNamesInformation = 12, + FileDispositionInformation = 13, + FilePositionInformation = 14, + FileFullEaInformation = 15, + FileModeInformation = 16, + FileAlignmentInformation = 17, + FileAllInformation = 18, + FileAllocationInformation = 19, + FileEndOfFileInformation = 20, + FileAlternateNameInformation = 21, + FileStreamInformation = 22, + FilePipeInformation = 23, + FilePipeLocalInformation = 24, + FilePipeRemoteInformation = 25, + FileMailslotQueryInformation = 26, + FileMailslotSetInformation = 27, + FileCompressionInformation = 28, + FileObjectIdInformation = 29, + FileCompletionInformation = 30, + FileMoveClusterInformation = 31, + FileQuotaInformation = 32, + FileReparsePointInformation = 33, + FileNetworkOpenInformation = 34, + FileAttributeTagInformation = 35, + FileTrackingInformation = 36, + FileIdBothDirectoryInformation = 37, + FileIdFullDirectoryInformation = 38, + FileValidDataLengthInformation = 39, + FileShortNameInformation = 40, + FileIoCompletionNotificationInformation = 41, + FileIoStatusBlockRangeInformation = 42, + FileIoPriorityHintInformation = 43, + FileSfioReserveInformation = 44, + FileSfioVolumeInformation = 45, + FileHardLinkInformation = 46, + FileProcessIdsUsingFileInformation = 47, + FileNormalizedNameInformation = 48, + FileNetworkPhysicalNameInformation = 49, + FileIdGlobalTxDirectoryInformation = 50, + FileIsRemoteDeviceInformation = 51, + FileUnusedInformation = 52, + FileNumaNodeInformation = 53, + FileStandardLinkInformation = 54, + FileRemoteProtocolInformation = 55, + FileRenameInformationBypassAccessCheck = 56, + FileLinkInformationBypassAccessCheck = 57, + FileVolumeNameInformation = 58, + FileIdInformation = 59, + FileIdExtdDirectoryInformation = 60, + FileReplaceCompletionInformation = 61, + FileHardLinkFullIdInformation = 62, + FileIdExtdBothDirectoryInformation = 63, + FileDispositionInformationEx = 64, + FileRenameInformationEx = 65, + FileRenameInformationExBypassAccessCheck = 66, + FileDesiredStorageClassInformation = 67, + FileStatInformation = 68, + FileMemoryPartitionInformation = 69, + FileStatLxInformation = 70, + FileCaseSensitiveInformation = 71, + FileLinkInformationEx = 72, + FileLinkInformationExBypassAccessCheck = 73, + FileStorageReserveIdInformation = 74, + FileCaseSensitiveInformationForceAccessCheck = 75, + FileKnownFolderInformation = 76, + FileStatBasicInformation = 77, + FileId64ExtdDirectoryInformation = 78, + FileId64ExtdBothDirectoryInformation = 79, + FileIdAllExtdDirectoryInformation = 80, + FileIdAllExtdBothDirectoryInformation = 81, + FileStreamReservationInformation, + FileMupProviderInfo, + FileMaximumInformation +} FILE_INFORMATION_CLASS_ALT; + +typedef enum _FSINFOCLASS { + FileFsVolumeInformation = 1, + FileFsLabelInformation, + FileFsSizeInformation, + FileFsDeviceInformation, + FileFsAttributeInformation, + FileFsControlInformation, + FileFsFullSizeInformation, + FileFsObjectIdInformation, + FileFsDriverPathInformation, + FileFsVolumeFlagsInformation, + FileFsMaximumInformation +} FS_INFORMATION_CLASS; +#endif + typedef struct _RTLP_CURDIR_REF { LONG RefCount; HANDLE Handle; @@ -84,6 +310,22 @@ NtQueryDirectoryFile(IN HANDLE FileHandle, IN PUNICODE_STRING FileName OPTIONAL, IN BOOLEAN RestartScan); +NTSTATUS +NTAPI +NtQueryInformationFile(IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID FileInformation, + IN ULONG Length, + IN FILE_INFORMATION_CLASS FileInformationClass); + +NTSTATUS +NTAPI +NtQueryVolumeInformationFile(IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID FsInformation, + IN ULONG Length, + IN FS_INFORMATION_CLASS FsInformationClass); + NTSTATUS NTAPI NtQuerySecurityObject(IN HANDLE Handle, @@ -98,6 +340,14 @@ NtSetSecurityObject(IN HANDLE Handle, IN SECURITY_INFORMATION SecurityInformation, IN PSECURITY_DESCRIPTOR SecurityDescriptor); +NTSTATUS +NTAPI +NtSetInformationFile(IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN PVOID FileInformation, + IN ULONG Length, + IN FILE_INFORMATION_CLASS FileInformationClass); + NTSTATUS NTAPI NtOpenSymbolicLinkObject(PHANDLE LinkHandle, @@ -123,6 +373,19 @@ NtSetEaFile(IN HANDLE FileHandle, OUT PVOID Buffer, IN ULONG Length); +NTSTATUS +NTAPI +NtFsControlFile(IN HANDLE FileHandle, + IN HANDLE Event, + IN PIO_APC_ROUTINE ApcRoutine, + IN PVOID ApcContext, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN ULONG FsControlCode, + IN PVOID InputBuffer, + IN ULONG InputBufferLength, + OUT PVOID OutputBuffer, + IN ULONG OutputBufferLength); + /* Dynamically loaded ntdll functions */ extern NTSTATUS (WINAPI *func_RtlDosPathNameToNtPathName_U_WithStatus) diff --git a/src/wimlib/wimlib/wof.h b/src/wimlib/wimlib/wof.h index 6f5017be..f67898eb 100644 --- a/src/wimlib/wimlib/wof.h +++ b/src/wimlib/wimlib/wof.h @@ -36,6 +36,7 @@ #ifdef _WIN32 +#ifndef _MSC_VER /* * The Windows Overlay Filesystem filter (WOF, a.k.a. wof.sys) is a filesystem * filter driver, available in Windows 8.1 and later, which allows files to be @@ -205,6 +206,8 @@ typedef struct _WIM_PROVIDER_UPDATE_OVERLAY_INPUT { ULONG WimFileNameLength; } WIM_PROVIDER_UPDATE_OVERLAY_INPUT, *PWIM_PROVIDER_UPDATE_OVERLAY_INPUT; +#endif + /*----------------------------------------------------------------------------* * WOF reparse point and WimOverlay.dat structs (undocumented) * *----------------------------------------------------------------------------*/ @@ -219,6 +222,7 @@ typedef struct _WIM_PROVIDER_UPDATE_OVERLAY_INPUT { * WOF, although they document the structures which must be passed into the * ioctls, which are often similar. */ +PRAGMA_BEGIN_PACKED struct wim_provider_rpdata { /* Set to 2. Uncertain meaning. */ le32 version; @@ -416,6 +420,7 @@ struct WimOverlay_dat_entry_2 { utf16lechar wim_file_name[]; } __attribute__((packed)); } __attribute__((packed)); +PRAGMA_END_PACKED static void __attribute__((unused)) wof_check_structs(void) diff --git a/src/wimlib/wimlib/xattr.h b/src/wimlib/wimlib/xattr.h index 074fed9d..7456e3d5 100644 --- a/src/wimlib/wimlib/xattr.h +++ b/src/wimlib/wimlib/xattr.h @@ -22,6 +22,7 @@ * item tagged with TAG_XATTRS. This is the preferred xattr format, since it is * also used by WIMGAPI and DISM starting in Windows 10 version 1607. */ +PRAGMA_BEGIN_PACKED struct wim_xattr_entry { /* length of xattr value in bytes */ @@ -41,6 +42,7 @@ struct wim_xattr_entry { /* no padding at end! */ } __attribute__((packed)); +PRAGMA_END_PACKED static inline size_t xattr_entry_size(const struct wim_xattr_entry *entry) @@ -57,7 +59,7 @@ xattr_entry_size(const struct wim_xattr_entry *entry) static inline struct wim_xattr_entry * xattr_entry_next(const struct wim_xattr_entry *entry) { - return (void *)entry + xattr_entry_size(entry); + return (void *)_PTR(entry + xattr_entry_size(entry)); } static inline bool @@ -80,6 +82,7 @@ valid_xattr_entry(const struct wim_xattr_entry *entry, size_t avail) * xattr support in both WIMGAPI and wimlib). Now we use TAG_XATTRS for both * Windows and Linux xattrs. */ +PRAGMA_BEGIN_ALIGN(4) struct wimlib_xattr_entry_old { /* length of xattr name in bytes, excluding a null terminator */ @@ -98,7 +101,7 @@ struct wimlib_xattr_entry_old { /* u8 value[0]; */ /* then zero-padded to a 4-byte boundary */ -} __attribute__((aligned(4))); +} PRAGMA_END_ALIGN(4); static inline size_t old_xattr_entry_size(const struct wimlib_xattr_entry_old *entry) @@ -116,7 +119,7 @@ old_xattr_entry_size(const struct wimlib_xattr_entry_old *entry) static inline struct wimlib_xattr_entry_old * old_xattr_entry_next(const struct wimlib_xattr_entry_old *entry) { - return (void *)entry + old_xattr_entry_size(entry); + return (void *)_PTR(entry + old_xattr_entry_size(entry)); } static inline bool diff --git a/src/wimlib/wimlib_tchar.h b/src/wimlib/wimlib_tchar.h index 781f370c..9b63ad3f 100644 --- a/src/wimlib/wimlib_tchar.h +++ b/src/wimlib/wimlib_tchar.h @@ -4,7 +4,7 @@ /* Functions to act on "tchar" strings, which have a platform-dependent encoding * and character size. */ -#ifdef _WIN32 +#if defined(_WIN32) #include <wchar.h> /* * For Windows builds, the "tchar" type will be 2 bytes and will be equivalent @@ -26,9 +26,22 @@ typedef wchar_t tchar; # define tmempcpy wmempcpy # define tstrcat wcscat # define tstrcpy wcscpy +#ifdef _RUFUS +# define tprintf wuprintf +#else # define tprintf wprintf +#endif +#ifdef _WIN32 +# define tsprintf _swprintf +#else # define tsprintf swprintf +#endif +# define tsnprintf snwprintf +#ifdef _RUFUS +# define tfprintf(f, ...) ((f == stdout || f == stderr) ? wuprintf(__VA_ARGS__) : fwprintf(f, __VA_ARGS__)) +#else # define tfprintf fwprintf +#endif # define tvfprintf vfwprintf # define tscanf swscanf # define istalpha(c) iswalpha((wchar_t)(c)) @@ -42,12 +55,19 @@ typedef wchar_t tchar; # define tstrstr wcsstr # define tstrlen wcslen # define tmemcmp wmemcmp -# define tstrcasecmp _wcsicmp +# define tstrcasecmp _wcsicmp # define tstrftime wcsftime +#ifdef _RUFUS +# define tputchar(c) wuprintf(L"%c", c) +# define tputc(c, f) ((f == stdout || f == stderr) ? wuprintf(L"%c", c) : _putw(c, f)) +# define tputs(s) wuprintf(L"%s\n", s) +# define tfputs(s, f) ((f == stdout || f == stderr) ? wuprintf(s) : fputws(s, f)) +#else # define tputchar putwchar # define tputc putwc # define tputs _putws # define tfputs fputws +#endif # define tfopen _wfopen # define topen _wopen # define tstat _wstati64 diff --git a/src/wimlib/win32_apply.c b/src/wimlib/win32_apply.c index e493ecfe..050aee6c 100644 --- a/src/wimlib/win32_apply.c +++ b/src/wimlib/win32_apply.c @@ -1137,7 +1137,7 @@ adjust_compression_attribute(HANDLE h, const struct wim_dentry *dentry, { const bool compressed = (dentry->d_inode->i_attributes & FILE_ATTRIBUTE_COMPRESSED); - FILE_BASIC_INFORMATION info; + FILE_BASIC_INFORMATION info = { 0 }; USHORT compression_state; NTSTATUS status; @@ -1244,7 +1244,7 @@ remove_conflicting_short_name(const struct wim_dentry *dentry, struct win32_appl HANDLE h; size_t bufsize = offsetof(FILE_NAME_INFORMATION, FileName) + (13 * sizeof(wchar_t)); - u8 buf[bufsize] __attribute__((aligned(8))); + u8* buf = wimlib_aligned_malloc(bufsize, 8); bool retried = false; FILE_NAME_INFORMATION *info = (FILE_NAME_INFORMATION *)buf; @@ -1289,6 +1289,7 @@ retry: } NtClose(h); out: + wimlib_aligned_free(buf); build_extraction_path(dentry, ctx); return status; } @@ -1326,7 +1327,7 @@ set_short_name(HANDLE h, const struct wim_dentry *dentry, size_t bufsize = offsetof(FILE_NAME_INFORMATION, FileName) + max(dentry->d_short_name_nbytes, sizeof(wchar_t)) + sizeof(wchar_t); - u8 buf[bufsize] __attribute__((aligned(8))); + u8* buf = wimlib_aligned_malloc(bufsize, 8); FILE_NAME_INFORMATION *info = (FILE_NAME_INFORMATION *)buf; NTSTATUS status; bool tried_to_remove_existing = false; @@ -1339,8 +1340,10 @@ set_short_name(HANDLE h, const struct wim_dentry *dentry, retry: status = NtSetInformationFile(h, &ctx->iosb, info, bufsize, FileShortNameInformation); - if (NT_SUCCESS(status)) + if (NT_SUCCESS(status)) { + wimlib_aligned_free(buf); return 0; + } if (status == STATUS_SHORT_NAMES_NOT_ENABLED_ON_VOLUME) { if (dentry->d_short_name_nbytes == 0) @@ -1353,8 +1356,10 @@ retry: ret = win32_get_drive_path(ctx->common.target, volume); - if (ret) + if (ret) { + wimlib_aligned_free(buf); return ret; + } if (try_to_enable_short_names(volume)) goto retry; } @@ -1392,10 +1397,12 @@ retry: ctx->num_set_short_name_failures++; else ctx->num_remove_short_name_failures++; + wimlib_aligned_free(buf); return 0; } winnt_error(status, L"Can't set short name on \"%ls\"", current_path(ctx)); + wimlib_aligned_free(buf); return WIMLIB_ERR_SET_SHORT_NAME; } @@ -1634,7 +1641,7 @@ create_empty_streams(const struct wim_dentry *dentry, if (strm->stream_type == STREAM_TYPE_REPARSE_POINT && ctx->common.supported_features.reparse_points) { - u8 buf[REPARSE_DATA_OFFSET] __attribute__((aligned(8))); + PRAGMA_ALIGN(u8 buf[REPARSE_DATA_OFFSET], 8); struct reparse_buffer_disk *rpbuf = (struct reparse_buffer_disk *)buf; complete_reparse_point(rpbuf, inode, 0); @@ -1843,7 +1850,7 @@ create_link(HANDLE h, const struct wim_dentry *dentry, size_t bufsize = offsetof(FILE_LINK_INFORMATION, FileName) + ctx->pathbuf.Length + sizeof(wchar_t); - u8 buf[bufsize] __attribute__((aligned(8))); + u8* buf = wimlib_aligned_malloc(bufsize, 8); FILE_LINK_INFORMATION *info = (FILE_LINK_INFORMATION *)buf; NTSTATUS status; @@ -1868,11 +1875,14 @@ create_link(HANDLE h, const struct wim_dentry *dentry, status = NtSetInformationFile(h, &ctx->iosb, info, bufsize, FileLinkInformation); - if (NT_SUCCESS(status)) + if (NT_SUCCESS(status)) { + wimlib_aligned_free(buf); return 0; + } } while (++i < 32); winnt_error(status, L"Failed to create link \"%ls\"", current_path(ctx)); + wimlib_aligned_free(buf); return WIMLIB_ERR_LINK; } else { HANDLE h2; @@ -2205,7 +2215,7 @@ try_rpfix(struct reparse_buffer_disk *rpbuf, u16 *rpbuflen_p, fixed_subst_name_nchars = target_ntpath_nchars + relpath_nchars; - wchar_t fixed_subst_name[fixed_subst_name_nchars]; + wchar_t* fixed_subst_name = MALLOC(fixed_subst_name_nchars * sizeof(wchar_t)); wmemcpy(fixed_subst_name, ctx->target_ntpath.Buffer, target_ntpath_nchars); wmemcpy(&fixed_subst_name[target_ntpath_nchars], relpath, relpath_nchars); @@ -2225,6 +2235,7 @@ try_rpfix(struct reparse_buffer_disk *rpbuf, u16 *rpbuflen_p, link.print_name = (wchar_t *)fixed_print_name; link.print_name_nbytes = fixed_print_name_nchars * sizeof(wchar_t); make_link_reparse_point(&link, rpbuf, rpbuflen_p); + FREE(fixed_subst_name); } /* Sets the reparse point on the specified file. This handles "fixing" the @@ -2370,12 +2381,12 @@ fail: static int pwrite_to_handle(HANDLE h, const void *data, size_t size, u64 offset) { - const void * const end = data + size; - const void *p; + const uintptr_t end = (uintptr_t)data + size; + uintptr_t p; IO_STATUS_BLOCK iosb; NTSTATUS status; - for (p = data; p != end; p += iosb.Information, + for (p = (uintptr_t)data; p != end; p += iosb.Information, offset += iosb.Information) { LARGE_INTEGER offs = { .QuadPart = offset }; @@ -2398,8 +2409,8 @@ win32_extract_chunk(const struct blob_descriptor *blob, u64 offset, const void *chunk, size_t size, void *_ctx) { struct win32_apply_ctx *ctx = _ctx; - const void * const end = chunk + size; - const void *p; + const uintptr_t end = (uintptr_t)chunk + size; + uintptr_t p; bool zeroes; size_t len; unsigned i; @@ -2409,13 +2420,13 @@ win32_extract_chunk(const struct blob_descriptor *blob, u64 offset, * For sparse streams, only write nonzero regions. This lets the * filesystem use holes to represent zero regions. */ - for (p = chunk; p != end; p += len, offset += len) { - zeroes = maybe_detect_sparse_region(p, end - p, &len, + for (p = (uintptr_t)chunk; p != end; p += len, offset += len) { + zeroes = maybe_detect_sparse_region((const void*)p, end - p, &len, ctx->any_sparse_streams); for (i = 0; i < ctx->num_open_handles; i++) { if (!zeroes || !ctx->is_sparse_stream[i]) { ret = pwrite_to_handle(ctx->open_handles[i], - p, len, offset); + (void*)p, len, offset); if (ret) return ret; } @@ -2837,11 +2848,11 @@ set_object_id(HANDLE h, const struct wim_inode *inode, static int set_xattrs(HANDLE h, const struct wim_inode *inode, struct win32_apply_ctx *ctx) { - const void *entries, *entries_end; + uintptr_t entries, entries_end; u32 len; const struct wim_xattr_entry *entry; size_t bufsize = 0; - u8 _buf[1024] __attribute__((aligned(4))); + PRAGMA_ALIGN(u8 _buf[1024], 4); u8 *buf = _buf; FILE_FULL_EA_INFORMATION *ea, *ea_prev; NTSTATUS status; @@ -2850,15 +2861,14 @@ set_xattrs(HANDLE h, const struct wim_inode *inode, struct win32_apply_ctx *ctx) if (!ctx->common.supported_features.xattrs) return 0; - entries = inode_get_xattrs(inode, &len); - if (likely(entries == NULL || len == 0)) /* No extended attributes? */ + entries = (uintptr_t)inode_get_xattrs(inode, &len); + if (likely(entries == 0 || len == 0)) /* No extended attributes? */ return 0; entries_end = entries + len; - entry = entries; - for (entry = entries; (void *)entry < entries_end; + for (entry = (const struct wim_xattr_entry*)entries; (uintptr_t)entry < entries_end; entry = xattr_entry_next(entry)) { - if (!valid_xattr_entry(entry, entries_end - (void *)entry)) { + if (!valid_xattr_entry(entry, (size_t)(entries_end - (uintptr_t)entry))) { ERROR("\"%"TS"\": extended attribute is corrupt or unsupported", inode_any_full_path(inode)); return WIMLIB_ERR_INVALID_XATTR; @@ -2883,7 +2893,7 @@ set_xattrs(HANDLE h, const struct wim_inode *inode, struct win32_apply_ctx *ctx) ea_prev = NULL; ea = (FILE_FULL_EA_INFORMATION *)buf; - for (entry = entries; (void *)entry < entries_end; + for (entry = (const struct wim_xattr_entry*)entries; (uintptr_t)entry < entries_end; entry = xattr_entry_next(entry)) { u8 *p; @@ -2899,6 +2909,10 @@ set_xattrs(HANDLE h, const struct wim_inode *inode, struct win32_apply_ctx *ctx) ea_prev = ea; ea = (FILE_FULL_EA_INFORMATION *)p; } + if (ea_prev == NULL) { + ret = WIMLIB_ERR_INVALID_PARAM; + goto out; + } ea_prev->NextEntryOffset = 0; wimlib_assert((u8 *)ea - buf == bufsize); diff --git a/src/wimlib/win32_capture.c b/src/wimlib/win32_capture.c index 958147e6..895fcf7f 100644 --- a/src/wimlib/win32_capture.c +++ b/src/wimlib/win32_capture.c @@ -305,9 +305,9 @@ windows_file_to_string(const struct windows_file *file, u8 *buf, size_t bufsize) memcpy(&file_id, (u8 *)file->path + file->path_nbytes - sizeof(file_id), sizeof(file_id)); - swprintf((wchar_t *)buf, L"NTFS inode 0x%016"PRIx64, file_id); + swprintf((wchar_t *)buf, bufsize, L"NTFS inode 0x%016"PRIx64, file_id); } else if (file->path_nbytes + 3 * sizeof(wchar_t) <= bufsize) { - swprintf((wchar_t *)buf, L"\"%ls\"", file->path); + swprintf((wchar_t *)buf, bufsize, L"\"%ls\"", file->path); } else { return L"(name too long)"; } @@ -330,7 +330,7 @@ read_winnt_stream_prefix(const struct windows_file *file, }; HANDLE h; NTSTATUS status; - u8 buf[BUFFER_SIZE] __attribute__((aligned(8))); + PRAGMA_ALIGN(u8 buf[BUFFER_SIZE], 8); u64 bytes_remaining; int ret; @@ -512,7 +512,7 @@ winnt_get_short_name(HANDLE h, struct wim_dentry *dentry) * course has to create its own handle. */ NTSTATUS status; IO_STATUS_BLOCK iosb; - u8 buf[128] __attribute__((aligned(8))); + PRAGMA_ALIGN(u8 buf[128], 8); const FILE_NAME_INFORMATION *info; status = NtQueryInformationFile(h, &iosb, buf, sizeof(buf), @@ -537,7 +537,7 @@ winnt_load_security_descriptor(HANDLE h, struct wim_inode *inode, struct winnt_scan_ctx *ctx) { SECURITY_INFORMATION requestedInformation; - u8 _buf[4096] __attribute__((aligned(8))); + PRAGMA_ALIGN(u8 _buf[4096], 8); u8 *buf; ULONG bufsize; ULONG len_needed; @@ -705,7 +705,7 @@ winnt_load_xattrs(HANDLE h, struct wim_inode *inode, { IO_STATUS_BLOCK iosb; NTSTATUS status; - u8 _buf[1024] __attribute__((aligned(4))); + PRAGMA_ALIGN(u8 _buf[1024], 4); u8 *buf = _buf; const FILE_FULL_EA_INFORMATION *ea; struct wim_xattr_entry *entry; @@ -821,7 +821,7 @@ winnt_recurse_directory(HANDLE h, const size_t bufsize = 8192; IO_STATUS_BLOCK iosb; NTSTATUS status; - int ret; + int ret = WIMLIB_ERR_SUCCESS; buf = MALLOC(bufsize); if (!buf) @@ -894,7 +894,7 @@ file_has_ino_and_dev(HANDLE h, u64 ino, u64 dev) NTSTATUS status; IO_STATUS_BLOCK iosb; FILE_INTERNAL_INFORMATION int_info; - FILE_FS_VOLUME_INFORMATION vol_info; + FILE_FS_VOLUME_INFORMATION vol_info = { 0 }; status = NtQueryInformationFile(h, &iosb, &int_info, sizeof(int_info), FileInternalInformation); @@ -1013,7 +1013,7 @@ winnt_rpfix_progress(struct scan_params *params, const struct link_reparse_point *link, int scan_status) { size_t print_name_nchars = link->print_name_nbytes / sizeof(wchar_t); - wchar_t print_name0[print_name_nchars + 1]; + wchar_t* print_name0 = alloca((print_name_nchars + 1) * sizeof(wchar_t)); wmemcpy(print_name0, link->print_name, print_name_nchars); print_name0[print_name_nchars] = L'\0'; @@ -1082,14 +1082,16 @@ winnt_try_rpfix(struct reparse_buffer_disk *rpbuf, u16 *rpbuflen_p, * what exactly the prefix is, as long as it looks like an absolute * path. */ - static const wchar_t prefix[6] = L"\\??\\X:"; + static const wchar_t prefix[] = L"\\??\\X:"; static const size_t num_unprintable_chars = 4; size_t rel_target_nbytes = link.substitute_name_nbytes - ((const u8 *)rel_target - (const u8 *)link.substitute_name); - wchar_t tmp[(sizeof(prefix) + rel_target_nbytes) / sizeof(wchar_t)]; + wchar_t* tmp = alloca(sizeof(prefix) + rel_target_nbytes); + if (!tmp) + return 0; memcpy(tmp, prefix, sizeof(prefix)); memcpy(tmp + ARRAY_LEN(prefix), rel_target, rel_target_nbytes); @@ -1331,7 +1333,7 @@ winnt_scan_data_streams(HANDLE h, struct wim_inode *inode, u64 file_size, struct winnt_scan_ctx *ctx) { int ret; - u8 _buf[4096] __attribute__((aligned(8))); + PRAGMA_ALIGN(u8 _buf[4096], 8); u8 *buf; size_t bufsize; IO_STATUS_BLOCK iosb; @@ -1654,12 +1656,11 @@ get_file_info(HANDLE h, struct file_info *info) static void get_volume_information(HANDLE h, struct winnt_scan_ctx *ctx) { - u8 _attr_info[sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 128] - __attribute__((aligned(8))); + PRAGMA_ALIGN(u8 _attr_info[sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 128], 8); FILE_FS_ATTRIBUTE_INFORMATION *attr_info = (void *)_attr_info; FILE_FS_VOLUME_INFORMATION vol_info; struct file_info file_info; - IO_STATUS_BLOCK iosb; + IO_STATUS_BLOCK iosb = { 0 }; NTSTATUS status; /* Get volume flags */ @@ -1960,6 +1961,7 @@ winnt_do_scan_warnings(const wchar_t *path, const struct winnt_scan_ctx *ctx) #ifdef ENABLE_FAST_MFT_SCAN +#ifndef _MSC_VER typedef struct { u64 StartingCluster; u64 ClusterCount; @@ -2071,6 +2073,7 @@ typedef struct { RETRIEVAL_POINTERS_BUFFER RetrievalPointers; } ExtentInformation; } STREAM_EXTENT_ENTRY; +#endif /* Extract the MFT number part of the full inode number */ #define NTFS_MFT_NO(ref) ((ref) & (((u64)1 << 48) - 1)) @@ -2137,13 +2140,13 @@ struct ntfs_inode_map { #define NTFS_INODE(node) \ avl_tree_entry((node), struct ntfs_inode, index_node) -#define SKIP_ALIGNED(p, size) ((void *)(p) + ALIGN((size), 8)) +#define SKIP_ALIGNED(p, size) (_PTR((p) + ALIGN((size), 8))) /* Get a pointer to the first dentry of the inode. */ #define FIRST_DENTRY(ni) SKIP_ALIGNED((ni), sizeof(struct ntfs_inode)) /* Get a pointer to the first stream of the inode. */ -#define FIRST_STREAM(ni) ((const void *)ni + ni->first_stream_offset) +#define FIRST_STREAM(ni) (_PTR(ni + ni->first_stream_offset)) /* Advance to the next dentry of the inode. */ #define NEXT_DENTRY(nd) SKIP_ALIGNED((nd), sizeof(struct ntfs_dentry) + \ @@ -2227,7 +2230,7 @@ validate_names_and_compute_total_length(const FILE_LAYOUT_ENTRY *file, size_t *total_length_ret) { const FILE_LAYOUT_NAME_ENTRY *name = - (const void *)file + file->FirstNameOffset; + _PTR(file + file->FirstNameOffset); size_t total = 0; size_t num_long_names = 0; @@ -2251,7 +2254,7 @@ validate_names_and_compute_total_length(const FILE_LAYOUT_ENTRY *file, } if (name->NextNameOffset == 0) break; - name = (const void *)name + name->NextNameOffset; + name = _PTR(name + name->NextNameOffset); } if (unlikely(num_long_names == 0)) { @@ -2320,7 +2323,7 @@ validate_streams_and_compute_total_length(const FILE_LAYOUT_ENTRY *file, u32 *special_streams_ret) { const STREAM_LAYOUT_ENTRY *stream = - (const void *)file + file->FirstStreamOffset; + _PTR(file + file->FirstStreamOffset); size_t total = 0; u32 special_streams = 0; @@ -2352,7 +2355,7 @@ validate_streams_and_compute_total_length(const FILE_LAYOUT_ENTRY *file, } if (stream->NextStreamOffset == 0) break; - stream = (const void *)stream + stream->NextStreamOffset; + stream = _PTR(stream + stream->NextStreamOffset); } *total_length_ret = total; @@ -2365,7 +2368,7 @@ load_name_information(const FILE_LAYOUT_ENTRY *file, struct ntfs_inode *ni, void *p) { const FILE_LAYOUT_NAME_ENTRY *name = - (const void *)file + file->FirstNameOffset; + _PTR(file + file->FirstNameOffset); for (;;) { struct ntfs_dentry *nd = p; /* Note that a name may be just a short (DOS) name, just a long @@ -2386,12 +2389,12 @@ load_name_information(const FILE_LAYOUT_ENTRY *file, struct ntfs_inode *ni, nd->parent_ino = name->ParentFileReferenceNumber; memcpy(nd->name, name->FileName, name->FileNameLength); nd->name[name->FileNameLength / 2] = L'\0'; - p += ALIGN(sizeof(struct ntfs_dentry) + - name->FileNameLength + sizeof(wchar_t), 8); + p = _PTR(p + ALIGN(sizeof(struct ntfs_dentry) + + name->FileNameLength + sizeof(wchar_t), 8)); } if (name->NextNameOffset == 0) break; - name = (const void *)name + name->NextNameOffset; + name = _PTR(name + name->NextNameOffset); } return p; } @@ -2404,7 +2407,7 @@ load_starting_lcn(const STREAM_LAYOUT_ENTRY *stream) if (stream->ExtentInformationOffset == 0) return 0; - entry = (const void *)stream + stream->ExtentInformationOffset; + entry = _PTR(stream + stream->ExtentInformationOffset); if (!(entry->Flags & STREAM_EXTENT_ENTRY_AS_RETRIEVAL_POINTERS)) return 0; @@ -2417,7 +2420,7 @@ load_stream_information(const FILE_LAYOUT_ENTRY *file, struct ntfs_inode *ni, void *p) { const STREAM_LAYOUT_ENTRY *stream = - (const void *)file + file->FirstStreamOffset; + _PTR(file + file->FirstStreamOffset); const u32 first_stream_offset = (const u8 *)p - (const u8 *)ni; for (;;) { struct ntfs_stream *ns = p; @@ -2429,15 +2432,19 @@ load_stream_information(const FILE_LAYOUT_ENTRY *file, struct ntfs_inode *ni, ni->num_streams++; if (name_nchars == 0) ni->starting_lcn = load_starting_lcn(stream); +#ifdef _MSC_VER + ns->size = stream->EndOfFile.QuadPart; +#else ns->size = stream->EndOfFile; +#endif wmemcpy(ns->name, name, name_nchars); ns->name[name_nchars] = L'\0'; - p += ALIGN(sizeof(struct ntfs_stream) + - (name_nchars + 1) * sizeof(wchar_t), 8); + p = _PTR(p + ALIGN(sizeof(struct ntfs_stream) + + (name_nchars + 1) * sizeof(wchar_t), 8)); } if (stream->NextStreamOffset == 0) break; - stream = (const void *)stream + stream->NextStreamOffset; + stream = _PTR(stream + stream->NextStreamOffset); } return p; } @@ -2447,7 +2454,7 @@ static int load_one_file(const FILE_LAYOUT_ENTRY *file, struct ntfs_inode_map *inode_map) { const FILE_LAYOUT_INFO_ENTRY *info = - (const void *)file + file->ExtraInfoOffset; + _PTR(file + file->ExtraInfoOffset); size_t inode_size; struct ntfs_inode *ni; size_t n; @@ -2485,9 +2492,15 @@ load_one_file(const FILE_LAYOUT_ENTRY *file, struct ntfs_inode_map *inode_map) ni->ino = file->FileReferenceNumber; ni->attributes = info->BasicInformation.FileAttributes; +#ifdef _MSC_VER + ni->creation_time = info->BasicInformation.CreationTime.QuadPart; + ni->last_write_time = info->BasicInformation.LastWriteTime.QuadPart; + ni->last_access_time = info->BasicInformation.LastAccessTime.QuadPart; +#else ni->creation_time = info->BasicInformation.CreationTime; ni->last_write_time = info->BasicInformation.LastWriteTime; ni->last_access_time = info->BasicInformation.LastAccessTime; +#endif ni->security_id = info->SecurityId; ni->special_streams = special_streams; @@ -2553,14 +2566,14 @@ load_files_from_mft(const wchar_t *path, struct ntfs_inode_map *inode_map) out, outsize, NULL))) { const FILE_LAYOUT_ENTRY *file = - (const void *)out + out->FirstFileOffset; + _PTR(out + out->FirstFileOffset); for (;;) { ret = load_one_file(file, inode_map); if (ret) goto out; if (file->NextFileOffset == 0) break; - file = (const void *)file + file->NextFileOffset; + file = _PTR(file + file->NextFileOffset); } in.Flags &= ~QUERY_FILE_LAYOUT_RESTART; } @@ -2895,7 +2908,7 @@ process_children: &child, nd->name, nd->is_primary, - (void *)nd - nd->offset_from_inode, + _PTR(nd - nd->offset_from_inode), ctx, inode_map, security_map); diff --git a/src/wimlib/win32_common.c b/src/wimlib/win32_common.c index 408650b0..826058e1 100644 --- a/src/wimlib/win32_common.c +++ b/src/wimlib/win32_common.c @@ -37,7 +37,7 @@ win32_modify_privilege(const wchar_t *privilege, bool enable) { HANDLE hToken; LUID luid; - TOKEN_PRIVILEGES newState; + TOKEN_PRIVILEGES newState = { 0 }; bool ret = FALSE; if (!OpenProcessToken(GetCurrentProcess(), @@ -94,10 +94,16 @@ NTSTATUS (WINAPI *func_RtlDosPathNameToNtPathName_U_WithStatus) (IN PCWSTR DosName, OUT PUNICODE_STRING NtName, OUT PCWSTR *PartName, - OUT PRTL_RELATIVE_NAME_U RelativeName); + OUT PRTL_RELATIVE_NAME_U RelativeName) = NULL; + +BOOLEAN (WINAPI *func_RtlDosPathNameToNtPathName_U) + (IN PCWSTR DosName, + OUT PUNICODE_STRING NtName, + OUT PCWSTR* PartName, + OUT PRTL_RELATIVE_NAME_U RelativeName) = NULL; NTSTATUS (WINAPI *func_RtlCreateSystemVolumeInformationFolder) - (PCUNICODE_STRING VolumeRootPath); + (PCUNICODE_STRING VolumeRootPath) = NULL; static bool acquired_privileges = false; @@ -117,9 +123,14 @@ init_ntdll(void) (void *)GetProcAddress(ntdll_handle, "RtlDosPathNameToNtPathName_U_WithStatus"); + func_RtlDosPathNameToNtPathName_U = + (void*)GetProcAddress(ntdll_handle, + "RtlDosPathNameToNtPathName_U"); + func_RtlCreateSystemVolumeInformationFolder = (void *)GetProcAddress(ntdll_handle, "RtlCreateSystemVolumeInformationFolder"); + return 0; } @@ -183,11 +194,14 @@ win32_path_to_nt_path(const wchar_t *win32_path, UNICODE_STRING *nt_path) status = (*func_RtlDosPathNameToNtPathName_U_WithStatus)(win32_path, nt_path, NULL, NULL); - } else { - if (RtlDosPathNameToNtPathName_U(win32_path, nt_path, NULL, NULL)) + } else if (func_RtlDosPathNameToNtPathName_U) { + if ((*func_RtlDosPathNameToNtPathName_U)(win32_path, nt_path, NULL, NULL)) status = STATUS_SUCCESS; else status = STATUS_NO_MEMORY; + } else { + winnt_error(STATUS_UNSUCCESSFUL, L"RtlDosPathNameToNtPathName_U functions not found"); + return WIMLIB_ERR_RESOURCE_NOT_FOUND; } if (likely(NT_SUCCESS(status))) @@ -269,7 +283,7 @@ static void windows_msg(u32 code, const wchar_t *format, va_list va, bool is_ntstatus, bool is_error) { - wchar_t _buf[STACK_MAX / 8]; + wchar_t _buf[STACK_MAX / 8] = { 0 }; wchar_t *buf = _buf; size_t buflen = ARRAY_LEN(_buf); size_t ret; @@ -378,14 +392,14 @@ winnt_error(NTSTATUS status, const wchar_t *format, ...) * permission is, in general, required on the handle. */ NTSTATUS -winnt_fsctl(HANDLE h, u32 code, const void *in, u32 in_size, - void *out, u32 out_size_avail, u32 *actual_out_size_ret) +winnt_fsctl(HANDLE h, u32 code, const void* in, u32 in_size, + void* out, u32 out_size_avail, u32* actual_out_size_ret) { IO_STATUS_BLOCK iosb; NTSTATUS status; status = NtFsControlFile(h, NULL, NULL, NULL, &iosb, code, - (void *)in, in_size, out, out_size_avail); + (void*)in, in_size, out, out_size_avail); if (status == STATUS_PENDING) { /* Beware: this case is often encountered with remote * filesystems, but rarely with local filesystems. */ diff --git a/src/wimlib/win32_replacements.c b/src/wimlib/win32_replacements.c index 5df6c78e..24e31734 100644 --- a/src/wimlib/win32_replacements.c +++ b/src/wimlib/win32_replacements.c @@ -428,7 +428,7 @@ win32_rename_replacement(const wchar_t *srcpath, const wchar_t *dstpath) * which on Windows will in fact not actually delete it immediately but * rather mark it for deletion when the last handle to it is closed. */ { - static const wchar_t orig_suffix[5] = L".orig"; + static const wchar_t orig_suffix[] = L".orig"; const size_t num_rand_chars = 9; wchar_t *p; @@ -477,7 +477,7 @@ do_pread_or_pwrite(int fd, void *buf, size_t count, off_t offset, HANDLE h; LARGE_INTEGER orig_offset; DWORD result = 0xFFFFFFFF; - LARGE_INTEGER relative_offset; + LARGE_INTEGER relative_offset = { 0 }; OVERLAPPED overlapped; BOOL bret; DWORD err = 0; @@ -754,7 +754,7 @@ get_random_bytes(void *p, size_t n) wimlib_assert(0); count = 0; } - p += count; + p = _PTR(p + count); n -= count; } } diff --git a/src/wimlib/win32_vss.c b/src/wimlib/win32_vss.c index 6f5a28ea..8ab69a3b 100644 --- a/src/wimlib/win32_vss.c +++ b/src/wimlib/win32_vss.c @@ -375,7 +375,7 @@ request_vss_snapshot(IVssBackupComponents *vss, wchar_t *volume, return false; } - res = vss->vtable->AddToSnapshotSet(vss, volume, (GUID){}, snapshot_id); + res = vss->vtable->AddToSnapshotSet(vss, volume, (GUID){ 0 }, snapshot_id); if (FAILED(res)) { ERROR("IVssBackupComponents.AddToSnapshotSet() error: %x", (u32)res); @@ -496,8 +496,9 @@ vss_create_snapshot(const wchar_t *source, UNICODE_STRING *vss_path_ret, ret = WIMLIB_ERR_NOMEM; goto err; } - - wsprintf(vss_path_ret->Buffer, L"\\??\\%ls\\%ls", + swprintf(vss_path_ret->Buffer, + vss_path_ret->MaximumLength / sizeof(wchar_t), + L"\\??\\%ls\\%ls", &snapshot->props.m_pwszSnapshotDeviceObject[4], &source_abspath[3]); *snapshot_ret = &snapshot->base; diff --git a/src/wimlib/write.c b/src/wimlib/write.c index 4bf1b2be..1917f579 100644 --- a/src/wimlib/write.c +++ b/src/wimlib/write.c @@ -1020,6 +1020,9 @@ write_blob_process_chunk(const struct blob_descriptor *blob, u64 offset, const u8 *chunkptr, *chunkend; wimlib_assert(size != 0); + wimlib_assert(ctx); + if (!ctx) + return WIMLIB_ERR_INVALID_PARAM; if (ctx->compressor == NULL) { /* Write chunk uncompressed. */ @@ -1042,6 +1045,8 @@ write_blob_process_chunk(const struct blob_descriptor *blob, u64 offset, ret = prepare_chunk_buffer(ctx); if (ret) return ret; + if (!ctx->cur_chunk_buf) + return WIMLIB_ERR_INTEGRITY; } if (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) { @@ -1132,6 +1137,9 @@ compute_blob_list_stats(struct list_head *blob_list, const struct wim_resource_descriptor *rdesc = blob->rdesc; WIMStruct *wim = rdesc->wim; + wimlib_assert(wim); + if (!wim) + return WIMLIB_ERR_INVALID_PARAM; if (prev_wim_part != wim) { prev_wim_part = wim; total_parts++; @@ -3247,7 +3255,9 @@ overwrite_wim_via_tmpfile(WIMStruct *wim, int write_flags, unsigned num_threads) /* Write the WIM to a temporary file in the same directory as the * original WIM. */ wim_name_len = tstrlen(wim->filename); - tchar tmpfile[wim_name_len + 10]; + tchar* tmpfile = alloca((wim_name_len + 10) * sizeof(tchar)); + if (!tmpfile) + return WIMLIB_ERR_NOMEM; tmemcpy(tmpfile, wim->filename, wim_name_len); get_random_alnum_chars(tmpfile + wim_name_len, 9); tmpfile[wim_name_len + 9] = T('\0'); diff --git a/src/wimlib/xml.c b/src/wimlib/xml.c index d4400ee6..7f3331c2 100644 --- a/src/wimlib/xml.c +++ b/src/wimlib/xml.c @@ -173,7 +173,12 @@ do_xml_path_walk(struct xml_node *element, const tchar *path, bool create, struct xml_node **result_ret) { size_t n = tstrlen(path) + 1; +#ifdef _RUFUS + wimlib_assert(n < MAX_PATH); + tchar buf[MAX_PATH]; +#else tchar buf[n]; +#endif tchar *p; tchar c; @@ -1049,7 +1054,7 @@ write_wim_xml_data(WIMStruct *wim, int image, u64 total_bytes, struct wim_xml_info *info = wim->xml_info; int ret; struct xml_node *orig_totalbytes_element; - struct xml_out_buf buf = {}; + struct xml_out_buf buf = { 0 }; const utf16lechar *raw_doc; size_t raw_doc_size; diff --git a/src/wimlib/xml_windows.c b/src/wimlib/xml_windows.c index 305d2efa..21acccf6 100644 --- a/src/wimlib/xml_windows.c +++ b/src/wimlib/xml_windows.c @@ -348,10 +348,11 @@ language_id_to_name(u16 id) return NULL; } +#ifndef _WIN32 /* PE binary processor architecture codes (common ones only) */ #define IMAGE_FILE_MACHINE_I386 0x014C #define IMAGE_FILE_MACHINE_ARM 0x01C0 -#define IMAGE_FILE_MACHINE_ARMV7 0x01C4 +#define IMAGE_FILE_MACHINE_ARMNT 0x01C4 #define IMAGE_FILE_MACHINE_THUMB 0x01C2 #define IMAGE_FILE_MACHINE_IA64 0x0200 #define IMAGE_FILE_MACHINE_AMD64 0x8664 @@ -363,6 +364,7 @@ language_id_to_name(u16 id) #define PROCESSOR_ARCHITECTURE_IA64 6 #define PROCESSOR_ARCHITECTURE_AMD64 9 #define PROCESSOR_ARCHITECTURE_ARM64 12 +#endif /* Translate a processor architecture code as given in a PE binary to the code * used by the Windows API. Returns -1 if the code is not recognized. */ @@ -373,7 +375,7 @@ pe_arch_to_windows_arch(unsigned pe_arch) case IMAGE_FILE_MACHINE_I386: return PROCESSOR_ARCHITECTURE_INTEL; case IMAGE_FILE_MACHINE_ARM: - case IMAGE_FILE_MACHINE_ARMV7: + case IMAGE_FILE_MACHINE_ARMNT: case IMAGE_FILE_MACHINE_THUMB: return PROCESSOR_ARCHITECTURE_ARM; case IMAGE_FILE_MACHINE_IA64: @@ -536,7 +538,7 @@ set_default_language(struct windows_info_ctx *ctx, const struct regf *regf) const char *language_name = language_id_to_name(language_id); if (language_name) { size_t len = strlen(language_name); - tchar tstr[len + 1]; + tchar *tstr = alloca((len + 1) * sizeof(tchar)); for (size_t i = 0; i <= len; i++) tstr[i] = language_name[i]; set_string_property(ctx, T("WINDOWS/LANGUAGES/DEFAULT"), diff --git a/src/wimlib/xmlproc.c b/src/wimlib/xmlproc.c index 8ce193e9..86e29e4f 100644 --- a/src/wimlib/xmlproc.c +++ b/src/wimlib/xmlproc.c @@ -29,6 +29,7 @@ #include <string.h> +#include "wimlib/assert.h" #include "wimlib/error.h" #include "wimlib/test_support.h" #include "wimlib/util.h" @@ -705,6 +706,9 @@ static void xml_write_element(struct xml_node *element, struct xml_out_buf *buf) { struct xml_node *child; + wimlib_assert(element != NULL); + if (element == NULL) + return; /* Write the start tag. */ xml_puts(buf, T("<")); diff --git a/src/wimlib/xpress_compress.c b/src/wimlib/xpress_compress.c index e192c870..dd85a921 100644 --- a/src/wimlib/xpress_compress.c +++ b/src/wimlib/xpress_compress.c @@ -98,8 +98,8 @@ struct xpress_item; struct xpress_compressor { /* Pointer to the compress() implementation chosen at allocation time */ - size_t (*impl)(struct xpress_compressor *, - const void *, size_t, void *, size_t); + size_t (*impl)(struct xpress_compressor * restrict, + const void * restrict, size_t, void *, size_t); /* Symbol frequency counters for the Huffman code */ u32 freqs[XPRESS_NUM_SYMBOLS]; @@ -529,7 +529,7 @@ xpress_compress_greedy(struct xpress_compressor * restrict c, const u8 * const in_end = in_begin + in_nbytes; struct xpress_item *next_chosen_item = c->chosen_items; unsigned len_3_too_far; - u32 next_hashes[2] = {}; + u32 next_hashes[2] = { 0 }; if (in_nbytes <= 8192) len_3_too_far = 2048; @@ -592,7 +592,7 @@ xpress_compress_lazy(struct xpress_compressor * restrict c, const u8 * const in_end = in_begin + in_nbytes; struct xpress_item *next_chosen_item = c->chosen_items; unsigned len_3_too_far; - u32 next_hashes[2] = {}; + u32 next_hashes[2] = { 0 }; if (in_nbytes <= 8192) len_3_too_far = 2048; @@ -907,7 +907,7 @@ xpress_find_matches(struct xpress_compressor * restrict c, const u8 * const in_begin = in; const u8 *in_next = in_begin; struct lz_match *cache_ptr = c->match_cache; - u32 next_hashes[2] = {}; + u32 next_hashes[2] = { 0 }; u32 max_len = in_nbytes; u32 nice_len = min(max_len, c->nice_match_length); diff --git a/src/wimlib/xpress_decompress.c b/src/wimlib/xpress_decompress.c index 035bcfd0..f62fb8df 100644 --- a/src/wimlib/xpress_decompress.c +++ b/src/wimlib/xpress_decompress.c @@ -76,6 +76,7 @@ /* This value is chosen for fast decompression. */ #define XPRESS_TABLEBITS 11 +PRAGMA_BEGIN_ALIGN(DECODE_TABLE_ALIGNMENT) struct xpress_decompressor { union { DECODE_TABLE(decode_table, XPRESS_NUM_SYMBOLS, @@ -84,7 +85,7 @@ struct xpress_decompressor { }; DECODE_TABLE_WORKING_SPACE(working_space, XPRESS_NUM_SYMBOLS, XPRESS_MAX_CODEWORD_LEN); -} __attribute__((aligned(DECODE_TABLE_ALIGNMENT))); +} PRAGMA_END_ALIGN(DECODE_TABLE_ALIGNMENT); static int xpress_decompress(const void *restrict compressed_data, size_t compressed_size, From c288f2fe57f7c4b54742c4ee597b2d34796e523d Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 25 Apr 2025 13:44:48 +0100 Subject: [PATCH 046/192] [iso] add udf_setpos() support in libcdio * This is needed for wimlib libcdio integration. * Also fix a signed/unsigned warning in iso.c. --- src/iso.c | 2 +- src/libcdio/cdio/udf.h | 2 ++ src/libcdio/udf/udf_fs.c | 14 ++++++++++++++ src/rufus.rc | 10 +++++----- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/iso.c b/src/iso.c index 9f42c3ab..f0f8c552 100644 --- a/src/iso.c +++ b/src/iso.c @@ -1496,7 +1496,7 @@ int64_t ExtractISOFile(const char* iso, const char* iso_file, const char* dest_f uprintf("Error reading UDF file %s", iso_file); goto out; } - buf_size = (DWORD)MIN(file_length, read_size); + buf_size = (DWORD)MIN(file_length, (int64_t)read_size); if (!WriteFileWithRetry(file_handle, buf, buf_size, &wr_size, WRITE_RETRIES)) { uprintf(" Error writing file %s: %s", dest_file, WindowsErrorString()); goto out; diff --git a/src/libcdio/cdio/udf.h b/src/libcdio/cdio/udf.h index 21cdec4e..2f8d374a 100644 --- a/src/libcdio/cdio/udf.h +++ b/src/libcdio/cdio/udf.h @@ -190,6 +190,8 @@ extern "C" { bool udf_get_lba(const udf_file_entry_t *p_udf_fe, /*out*/ uint32_t *start, /*out*/ uint32_t *end); + bool udf_setpos(udf_dirent_t* p_udf_dirent, off_t offset); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/src/libcdio/udf/udf_fs.c b/src/libcdio/udf/udf_fs.c index c692bfb9..3009dad3 100644 --- a/src/libcdio/udf/udf_fs.c +++ b/src/libcdio/udf/udf_fs.c @@ -770,3 +770,17 @@ udf_dirent_free(udf_dirent_t *p_udf_dirent) } return true; } + +/*! + Seek to a specific offset in a UDF file. Must be a multiple of UDF_BLOCKSIZE. +*/ +bool +udf_setpos(udf_dirent_t* p_udf_dirent, off_t offset) +{ + if (!p_udf_dirent) + return false; + if (offset % UDF_BLOCKSIZE || offset > uint64_from_le(p_udf_dirent->fe.info_len)) + return false; + p_udf_dirent->p_udf->i_position = offset; + return true; +} diff --git a/src/rufus.rc b/src/rufus.rc index 995eb662..53993946 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.8.2236" +CAPTION "Rufus 4.8.2237" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2236,0 - PRODUCTVERSION 4,8,2236,0 + FILEVERSION 4,8,2237,0 + PRODUCTVERSION 4,8,2237,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2236" + VALUE "FileVersion", "4.8.2237" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2236" + VALUE "ProductVersion", "4.8.2237" END END BLOCK "VarFileInfo" From 96996ae1ee1d5f07874fa2c3b2ed83b87b062eb1 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 25 Apr 2025 18:11:46 +0100 Subject: [PATCH 047/192] [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". --- .vs/wimlib.vcxproj | 16 ++-- src/rufus.c | 21 ++++- src/rufus.rc | 10 +-- src/wimlib/Makefile.am | 2 +- src/wimlib/Makefile.in | 2 +- src/wimlib/file_io.c | 151 ++++++++++++++++++++++++++++++++++++ src/wimlib/wim.c | 103 +++++++++++++++++++++++- src/wimlib/wimlib/file_io.h | 32 ++++++-- 8 files changed, 312 insertions(+), 25 deletions(-) diff --git a/.vs/wimlib.vcxproj b/.vs/wimlib.vcxproj index 5d1b92fe..d82bbb86 100644 --- a/.vs/wimlib.vcxproj +++ b/.vs/wimlib.vcxproj @@ -264,7 +264,7 @@ <ClCompile> <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;..\src\libcdio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings> @@ -286,7 +286,7 @@ </PrecompiledHeader> <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;..\src\libcdio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <AdditionalOptions>/std:clatest</AdditionalOptions> @@ -305,7 +305,7 @@ </PrecompiledHeader> <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;..\src\libcdio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <AdditionalOptions>/std:clatest</AdditionalOptions> @@ -321,7 +321,7 @@ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> <WarningLevel>Level3</WarningLevel> - <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;..\src\libcdio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings> @@ -341,7 +341,7 @@ </PrecompiledHeader> <Optimization>MaxSpeed</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> - <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;..\src\libcdio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <AdditionalOptions>/std:clatest</AdditionalOptions> @@ -358,7 +358,7 @@ </PrecompiledHeader> <Optimization>MaxSpeed</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> - <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;..\src\libcdio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <AdditionalOptions>/std:clatest</AdditionalOptions> @@ -372,7 +372,7 @@ <ClCompile> <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;..\src\libcdio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings> @@ -391,7 +391,7 @@ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile> <WarningLevel>Level3</WarningLevel> - <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\src;..\src\wimlib;..\src\msvc-missing;..\src\libcdio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings> diff --git a/src/rufus.c b/src/rufus.c index 20fc7392..4bb0388d 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -3831,9 +3831,28 @@ extern int TestHashes(void); && (msg.wParam == 'T')) { int r; WIMStruct* wim; - r = wimlib_open_wim(L"C:\\tmp\\boot.wim", WIMLIB_OPEN_FLAG_CHECK_INTEGRITY, &wim); + r = wimlib_open_wim(L"D:\\Incoming\\Win11_24H2_EnglishInternational_x64.iso|sources/boot.wim", WIMLIB_OPEN_FLAG_CHECK_INTEGRITY, &wim); +// r = wimlib_open_wim(L"C:\\tmp\\test.iso|sources/boot.wim", WIMLIB_OPEN_FLAG_CHECK_INTEGRITY, &wim); +// r = wimlib_open_wim(L"C:\\tmp\\boot.wim", WIMLIB_OPEN_FLAG_CHECK_INTEGRITY, &wim); if (r == 0) { + int image; + wchar_t* xml; + size_t xml_size; wimlib_print_header(wim); + if (wimlib_get_xml_data(wim, (void**) & xml, &xml_size) == 0) { + xml[(xml_size / sizeof(wchar_t)) - 1] = L'\0'; + wuprintf(L"%s", xml); + free(xml); + } + image = wimlib_resolve_image(wim, L"1"); + uprintf("image = %d", image); + const wchar_t* fn = L"Windows/win.ini"; + r = wimlib_extract_paths(wim, image, L"C:\\tmp\\wim", &fn, 1, WIMLIB_EXTRACT_FLAG_NORPFIX | + WIMLIB_EXTRACT_FLAG_GLOB_PATHS | WIMLIB_EXTRACT_FLAG_STRICT_GLOB | WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE); + if (r == 0) + uprintf("Successfully extracted '%S'", fn); + else + uprintf("Failed to extract '%S': %d", fn, r); wimlib_free(wim); } else { uprintf("Failed to open WIM: %d", r); diff --git a/src/rufus.rc b/src/rufus.rc index 53993946..0acbacf0 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.8.2237" +CAPTION "Rufus 4.8.2238" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2237,0 - PRODUCTVERSION 4,8,2237,0 + FILEVERSION 4,8,2238,0 + PRODUCTVERSION 4,8,2238,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2237" + VALUE "FileVersion", "4.8.2238" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2237" + VALUE "ProductVersion", "4.8.2238" END END BLOCK "VarFileInfo" diff --git a/src/wimlib/Makefile.am b/src/wimlib/Makefile.am index e9271d81..6fc7fdb6 100644 --- a/src/wimlib/Makefile.am +++ b/src/wimlib/Makefile.am @@ -8,4 +8,4 @@ libwim_a_SOURCES = avl_tree.c blob_table.c compress.c compress_common.c compress sha1.c solid.c split.c tagged_items.c textfile.c threads.c timestamp.c update_image.c \ util.c wim.c wimboot.c win32_apply.c win32_capture.c win32_common.c win32_replacements.c \ win32_vss.c write.c xml.c xmlproc.c xml_windows.c xpress_compress.c xpress_decompress.c -libwim_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -DHAVE_CONFIG_H -D_RUFUS -D__SSE2__ -D_POSIX -D_POSIX_THREAD_SAFE_FUNCTIONS -DUNICODE -D_UNICODE -D__MINGW_USE_VC2005_COMPAT -Wno-undef -Wno-strict-aliasing -Wno-shadow -Wno-incompatible-pointer-types -Wno-sequence-point +libwim_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -I$(srcdir)/../libcdio -DHAVE_CONFIG_H -D_RUFUS -D__SSE2__ -D_POSIX -D_POSIX_THREAD_SAFE_FUNCTIONS -DUNICODE -D_UNICODE -D__MINGW_USE_VC2005_COMPAT -Wno-undef -Wno-strict-aliasing -Wno-shadow -Wno-incompatible-pointer-types -Wno-sequence-point diff --git a/src/wimlib/Makefile.in b/src/wimlib/Makefile.in index 919757b1..5ec31881 100644 --- a/src/wimlib/Makefile.in +++ b/src/wimlib/Makefile.in @@ -291,7 +291,7 @@ libwim_a_SOURCES = avl_tree.c blob_table.c compress.c compress_common.c compress util.c wim.c wimboot.c win32_apply.c win32_capture.c win32_common.c win32_replacements.c \ win32_vss.c write.c xml.c xmlproc.c xml_windows.c xpress_compress.c xpress_decompress.c -libwim_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -DHAVE_CONFIG_H -D_RUFUS -D__SSE2__ -D_POSIX -D_POSIX_THREAD_SAFE_FUNCTIONS -DUNICODE -D_UNICODE -D__MINGW_USE_VC2005_COMPAT -Wno-undef -Wno-strict-aliasing -Wno-shadow -Wno-incompatible-pointer-types -Wno-sequence-point +libwim_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -I$(srcdir)/../libcdio -DHAVE_CONFIG_H -D_RUFUS -D__SSE2__ -D_POSIX -D_POSIX_THREAD_SAFE_FUNCTIONS -DUNICODE -D_UNICODE -D__MINGW_USE_VC2005_COMPAT -Wno-undef -Wno-strict-aliasing -Wno-shadow -Wno-incompatible-pointer-types -Wno-sequence-point all: all-am .SUFFIXES: diff --git a/src/wimlib/file_io.c b/src/wimlib/file_io.c index 5de562ca..fa8872eb 100644 --- a/src/wimlib/file_io.c +++ b/src/wimlib/file_io.c @@ -4,6 +4,7 @@ /* * Copyright (C) 2013 Eric Biggers + * Copyright (C) 2025 Pete Batard <pete@akeo.ie> * * This file is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free @@ -38,6 +39,130 @@ # define pwrite win32_pwrite #endif +#ifdef WITH_LIBCDIO +static int +udf_pread(struct filedes* fd, void* buf, size_t count, off_t offset) +{ + ssize_t ret; + size_t partial_size; + uint64_t file_length; + char _buf[UDF_BLOCKSIZE]; + + if (count == 0) + return 0; + + if (!udf_setpos(fd->p_udf_file, (offset / UDF_BLOCKSIZE) * UDF_BLOCKSIZE)) { + errno = ERANGE; + return WIMLIB_ERR_READ; + } + fd->offset = (offset / UDF_BLOCKSIZE) * UDF_BLOCKSIZE; + + file_length = udf_get_file_length(fd->p_udf_file); + if (offset + count > file_length) + count = file_length - offset; + + if (offset % UDF_BLOCKSIZE) { + partial_size = min(UDF_BLOCKSIZE - offset % UDF_BLOCKSIZE, count); + ret = udf_read_block(fd->p_udf_file, _buf, 1); + if (unlikely(ret <= 0)) { + errno = EINVAL; + return WIMLIB_ERR_READ; + } + memcpy(buf, &_buf[offset % UDF_BLOCKSIZE], partial_size); + buf = _PTR(buf + partial_size); + fd->offset += partial_size; + count -= partial_size; + } + + while (count >= UDF_BLOCKSIZE) { + ret = udf_read_block(fd->p_udf_file, buf, count / UDF_BLOCKSIZE); + if (unlikely(ret <= 0)) { + errno = EINVAL; + return WIMLIB_ERR_READ; + } + buf = _PTR(buf + ret); + fd->offset += ret; + count -= ret; + } + + partial_size = count % UDF_BLOCKSIZE; + if (partial_size) { + ret = udf_read_block(fd->p_udf_file, _buf, 1); + if (unlikely(ret <= 0)) { + errno = EINVAL; + return WIMLIB_ERR_READ; + } + memcpy(buf, _buf, partial_size); + buf = _PTR(buf + partial_size); + fd->offset += partial_size; + } + + return 0; +} + +static int +iso_pread(struct filedes* fd, void* buf, size_t count, off_t offset) +{ + ssize_t ret; + size_t partial_size; + char _buf[ISO_BLOCKSIZE]; + lsn_t lsn_offset = fd->p_iso_file->lsn + offset / ISO_BLOCKSIZE; + + if (count == 0) + return 0; + + if (offset >= fd->p_iso_file->total_size) { + errno = ERANGE; + return WIMLIB_ERR_READ; + } + + if (offset + count > fd->p_iso_file->total_size) + count = fd->p_iso_file->total_size - offset; + + if (offset % ISO_BLOCKSIZE) { + partial_size = min(ISO_BLOCKSIZE - offset % ISO_BLOCKSIZE, count); + ret = iso9660_iso_seek_read(fd->p_iso, _buf, lsn_offset, 1); + if (unlikely(ret <= 0)) { + errno = EINVAL; + return WIMLIB_ERR_READ; + } + lsn_offset += 1; + memcpy(buf, &_buf[offset % ISO_BLOCKSIZE], partial_size); + buf = _PTR(buf + partial_size); + fd->offset += partial_size; + count -= partial_size; + } + + while (count >= ISO_BLOCKSIZE) { + ret = iso9660_iso_seek_read(fd->p_iso, _buf, + lsn_offset % ISO_BLOCKSIZE, 1); + ret = iso9660_iso_seek_read(fd->p_iso, buf, lsn_offset, count / ISO_BLOCKSIZE); + if (unlikely(ret <= 0)) { + errno = EINVAL; + return WIMLIB_ERR_READ; + } + lsn_offset += ret / ISO_BLOCKSIZE; + buf = _PTR(buf + ret); + fd->offset += ret; + count -= ret; + } + + partial_size = count % ISO_BLOCKSIZE; + if (partial_size) { + ret = iso9660_iso_seek_read(fd->p_iso, _buf, lsn_offset, 1); + if (unlikely(ret <= 0)) { + errno = EINVAL; + return WIMLIB_ERR_READ; + } + memcpy(buf, _buf, partial_size); + buf = _PTR(buf + partial_size); + fd->offset += partial_size; + } + + return 0; +} +#endif + /* * Wrapper around read() that checks for errors and keeps retrying until all * requested bytes have been read or until end-of file has occurred. @@ -50,6 +175,13 @@ int full_read(struct filedes *fd, void *buf, size_t count) { +#ifdef WITH_LIBCDIO + if (fd->is_udf) + return udf_pread(fd, buf, count, 0); + else if (fd->is_iso) + return iso_pread(fd, buf, count, 0); +#endif + while (count) { ssize_t ret = read(fd->fd, buf, count); if (unlikely(ret <= 0)) { @@ -117,6 +249,13 @@ full_pread(struct filedes *fd, void *buf, size_t count, off_t offset) if (fd->is_pipe) goto is_pipe; +#ifdef WITH_LIBCDIO + if (fd->is_udf) + return udf_pread(fd, buf, count, offset); + else if (fd->is_iso) + return iso_pread(fd, buf, count, offset); +#endif + while (count) { ssize_t ret = pread(fd->fd, buf, count, offset); if (unlikely(ret <= 0)) { @@ -195,6 +334,13 @@ full_pwrite(struct filedes *fd, const void *buf, size_t count, off_t offset) off_t filedes_seek(struct filedes *fd, off_t offset) { +#ifdef WITH_LIBCDIO + /* No arbitrary seek for ISO files */ + if (fd->is_udf || fd->is_iso) { + errno = ENFILE; + return -1; + } +#endif if (fd->is_pipe) { errno = ESPIPE; return -1; @@ -209,5 +355,10 @@ off_t filedes_seek(struct filedes *fd, off_t offset) bool filedes_is_seekable(struct filedes *fd) { +#ifdef WITH_LIBCDIO + /* No arbitrary seek for ISO files */ + if (fd->is_udf || fd->is_iso) + return false; +#endif return !fd->is_pipe && lseek(fd->fd, 0, SEEK_CUR) != -1; } diff --git a/src/wimlib/wim.c b/src/wimlib/wim.c index afecba9a..f1a5fa5c 100644 --- a/src/wimlib/wim.c +++ b/src/wimlib/wim.c @@ -4,6 +4,7 @@ /* * Copyright 2012-2023 Eric Biggers + * Copyright 2025 Pete Batard <pete@akeo.ie> * * This file is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free @@ -616,11 +617,77 @@ wimlib_register_progress_function(WIMStruct *wim, wim->progctx = progctx; } +#ifdef WITH_LIBCDIO +static int +open_iso_wim_file(const tchar* filename, struct filedes* fd_ret) +{ + int ret = 0; + size_t n; + char *iso_filename, *iso_path = NULL; + udf_dirent_t *p_udf_root; + + /* If the wim path contains a pipe separator, look it up inside an ISO */ + if (tstr_to_utf8(filename, (tstrlen(filename) + 1) * sizeof(tchar), &iso_path, &n)) + return WIMLIB_ERR_NOMEM; + iso_filename = strchr(iso_path, '|'); + if (iso_filename == NULL) { + ret = WIMLIB_ERR_NO_FILENAME; + goto out; + } + + *iso_filename++ = '\0'; + filedes_init(fd_ret, 0); + + /* Try to open as UDF image */ + fd_ret->p_udf = udf_open(iso_path); + if (!fd_ret->p_udf) + goto try_iso; + p_udf_root = udf_get_root(fd_ret->p_udf, true, 0); + if (!p_udf_root) { + ret = WIMLIB_ERR_OPEN; + goto out; + } + fd_ret->p_udf_file = udf_fopen(p_udf_root, iso_filename); + udf_dirent_free(p_udf_root); + if (!fd_ret->p_udf_file) { + ret = WIMLIB_ERR_OPEN; + goto out; + } + fd_ret->is_udf = 1; + goto out; + +try_iso: + /* Try to open as ISO9660 image */ + fd_ret->p_iso = iso9660_open_ext(iso_path, ISO_EXTENSION_ALL); + if (!fd_ret->p_iso) { + ret = WIMLIB_ERR_OPEN; + goto out; + } + fd_ret->p_iso_file = iso9660_ifs_stat_translate(fd_ret->p_iso, iso_filename); + if (!fd_ret->p_iso_file) { + ret = WIMLIB_ERR_OPEN; + goto out; + } + fd_ret->is_iso = 1; + +out: + FREE(iso_path); + /* Because we use an union, make sure fd is cleared on error */ + if (ret) + fd_ret->fd = 0; + return ret; +} +#endif + static int open_wim_file(const tchar *filename, struct filedes *fd_ret) { int raw_fd; +#ifdef WITH_LIBCDIO + if (open_iso_wim_file(filename, fd_ret) == 0) + return 0; +#endif raw_fd = topen(filename, O_RDONLY | O_BINARY); if (raw_fd < 0) { ERROR_WITH_ERRNO("Can't open \"%"TS"\" read-only", filename); @@ -653,6 +720,16 @@ begin_read(WIMStruct *wim, const void *wim_filename_or_fd, int open_flags) return ret; /* The file size is needed for enforcing some limits later. */ +#ifdef WITH_LIBCDIO + if ((wim->in_fd.is_udf | wim->in_fd.is_iso) && + (open_flags & WIMLIB_OPEN_FLAG_WRITE_ACCESS)) + return WIMLIB_ERR_WIM_IS_READONLY; + if (wim->in_fd.is_udf) + wim->file_size = udf_get_file_length(wim->in_fd.p_udf_file); + else if (wim->in_fd.is_iso) + wim->file_size = wim->in_fd.p_iso_file->total_size; + else +#endif if (fstat(wim->in_fd.fd, &stbuf) == 0) wim->file_size = stbuf.st_size; @@ -668,6 +745,12 @@ begin_read(WIMStruct *wim, const void *wim_filename_or_fd, int open_flags) * Warning: in Windows native builds, realpath() calls the * replacement function in win32_replacements.c. */ +#ifdef WITH_LIBCDIO + /* No overwriting for libcdio, so simply duplicate */ + if (tstrchr(wimfile, T('|'))) + wim->filename = tstrdup(wimfile); + else +#endif wim->filename = realpath(wimfile, NULL); if (!wim->filename) { ERROR_WITH_ERRNO("Failed to get full path to file " @@ -900,10 +983,22 @@ wim_decrement_refcnt(WIMStruct *wim) wimlib_assert(wim->refcnt > 0); if (--wim->refcnt != 0) return; - if (filedes_valid(&wim->in_fd)) - filedes_close(&wim->in_fd); - if (filedes_valid(&wim->out_fd)) - filedes_close(&wim->out_fd); +#ifdef WITH_LIBCDIO + if (wim->in_fd.is_udf) { + udf_dirent_free(wim->in_fd.p_udf_file); + udf_close(wim->in_fd.p_udf); + } else if (wim->in_fd.is_iso) { + iso9660_stat_free(wim->in_fd.p_iso_file); + iso9660_close(wim->in_fd.p_iso); + } else { +#endif + if (filedes_valid(&wim->in_fd)) + filedes_close(&wim->in_fd); + if (filedes_valid(&wim->out_fd)) + filedes_close(&wim->out_fd); +#ifdef WITH_LIBCDIO + } +#endif wimlib_free_decompressor(wim->decompressor); xml_free_info_struct(wim->xml_info); FREE(wim->filename); diff --git a/src/wimlib/wimlib/file_io.h b/src/wimlib/wimlib/file_io.h index cd4ee041..f7deef8c 100644 --- a/src/wimlib/wimlib/file_io.h +++ b/src/wimlib/wimlib/file_io.h @@ -6,12 +6,35 @@ #include <sys/types.h> #include <unistd.h> +#ifdef WITH_LIBCDIO +# define DO_NOT_WANT_COMPATIBILITY +# undef PRAGMA_BEGIN_PACKED +# undef PRAGMA_END_PACKED +# include <cdio/udf.h> +# include <cdio/iso9660.h> +#endif + /* Wrapper around a file descriptor that keeps track of offset (including in - * pipes, which don't support lseek()) and a cached flag that tells whether the - * file descriptor is a pipe or not. */ + * pipes, which don't support lseek()), allows the handling of files that are + * contained within ISO images, and a cached flag that tells whether the file + * descriptor is a pipe or not. */ struct filedes { - int fd; + union { + int fd; +#ifdef WITH_LIBCDIO + iso9660_t* p_iso; + udf_t* p_udf; +#endif + }; unsigned int is_pipe : 1; +#ifdef WITH_LIBCDIO + unsigned int is_iso : 1; + unsigned int is_udf : 1; + union { + udf_dirent_t* p_udf_file; + iso9660_stat_t* p_iso_file; + }; +#endif off_t offset; }; @@ -39,9 +62,8 @@ filedes_is_seekable(struct filedes *fd); static inline void filedes_init(struct filedes *fd, int raw_fd) { + memset(fd, 0, sizeof(*fd)); fd->fd = raw_fd; - fd->offset = 0; - fd->is_pipe = 0; } static inline void filedes_invalidate(struct filedes *fd) From 5d35a0f1faa7b63a42f11dac84298c87afac4383 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Sat, 3 May 2025 21:32:10 +0100 Subject: [PATCH 048/192] [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. --- src/drive.h | 3 ++- src/ext2fs/fallocate.c | 1 + src/format.c | 24 +++++++----------------- src/format_ext.c | 16 ++++------------ src/format_fat32.c | 20 +++++++++++++------- src/license.h | 2 +- src/rufus.h | 3 +++ src/rufus.rc | 10 +++++----- src/stdio.c | 15 ++++++++++++++- src/wimlib/wimlib/progress.h | 8 ++++---- 10 files changed, 54 insertions(+), 48 deletions(-) diff --git a/src/drive.h b/src/drive.h index bee39f39..39a431e1 100644 --- a/src/drive.h +++ b/src/drive.h @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Drive access function calls - * Copyright © 2011-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2011-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -52,6 +52,7 @@ #define FP_LARGE_FAT32 0x00010000 #define FP_NO_BOOT 0x00020000 #define FP_CREATE_PERSISTENCE_CONF 0x00040000 +#define FP_NO_PROGRESS 0x00080000 #define FILE_FLOPPY_DISKETTE 0x00000004 diff --git a/src/ext2fs/fallocate.c b/src/ext2fs/fallocate.c index 0c05597c..153053a2 100644 --- a/src/ext2fs/fallocate.c +++ b/src/ext2fs/fallocate.c @@ -838,6 +838,7 @@ errcode_t ext2fs_fallocate(ext2_filsys fs, int flags, ext2_ino_t ino, } /* XXX: Allocate a bunch of blocks the slow way */ + ext2fs_print_progress(0, 0); for (blk = start; blk < start + len; blk++) { /* For Rufus usage */ err = ext2fs_print_progress(blk, start + len); diff --git a/src/format.c b/src/format.c index fe5b2b69..b21158f5 100644 --- a/src/format.c +++ b/src/format.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Formatting function calls - * Copyright © 2011-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2011-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1084,16 +1084,8 @@ BOOL WritePBR(HANDLE hLogicalVolume) static void update_progress(const uint64_t processed_bytes) { - // NB: We don't really care about resetting this value to UINT64_MAX for a new pass. - static uint64_t last_value = UINT64_MAX; - uint64_t cur_value; - UpdateProgressWithInfo(OP_FORMAT, MSG_261, processed_bytes, img_report.image_size); - cur_value = (processed_bytes * min(80, img_report.image_size)) / img_report.image_size; - if (cur_value != last_value) { - last_value = cur_value; - uprintfs("+"); - } + uprint_progress(processed_bytes, img_report.image_size); } // Some compressed images use streams that aren't multiple of the sector @@ -1165,7 +1157,6 @@ static BOOL WriteDrive(HANDLE hPhysicalDrive, BOOL bZeroDrive) HANDLE hSourceImage = INVALID_HANDLE_VALUE; DWORD i, read_size[NUM_BUFFERS] = { 0 }, write_size, comp_size, buf_size; uint64_t wb, target_size = bZeroDrive ? SelectedDrive.DiskSize : MIN((uint64_t)SelectedDrive.DiskSize, img_report.image_size); - uint64_t cur_value, last_value = 0; int64_t bled_ret; uint8_t* buffer = NULL; uint32_t zero_data, *cmp_buffer = NULL; @@ -1211,11 +1202,10 @@ static BOOL WriteDrive(HANDLE hPhysicalDrive, BOOL bZeroDrive) } read_size[0] = buf_size; + uprint_progress(0, 0); for (wb = 0, write_size = 0; wb < target_size; wb += write_size) { UpdateProgressWithInfo(OP_FORMAT, fast_zeroing ? MSG_306 : MSG_286, wb, target_size); - cur_value = (wb * 80) / target_size; - for (; cur_value > last_value && last_value < 80; last_value++) - uprintfs("+"); + uprint_progress(wb, target_size); // Don't overflow our projected size (mostly for VHDs) if (wb + read_size[0] > target_size) read_size[0] = (DWORD)(target_size - wb); @@ -1308,6 +1298,7 @@ static BOOL WriteDrive(HANDLE hPhysicalDrive, BOOL bZeroDrive) if_not_assert((uintptr_t)sec_buf% SelectedDrive.SectorSize == 0) goto out; sec_buf_pos = 0; + update_progress(0); bled_init(256 * KB, uprintf, NULL, sector_write, update_progress, NULL, &ErrorStatus); bled_ret = bled_uncompress_with_handles(hSourceImage, hPhysicalDrive, img_report.compression_type); bled_exit(); @@ -1362,12 +1353,11 @@ static BOOL WriteDrive(HANDLE hPhysicalDrive, BOOL bZeroDrive) ReadFileAsync(hSourceImage, &buffer[read_bufnum * buf_size], (DWORD)MIN(buf_size, target_size)); read_size[proc_bufnum] = 1; // To avoid early loop exit + uprint_progress(0, 0); for (wb = 0; read_size[proc_bufnum] != 0; wb += read_size[proc_bufnum]) { // 0. Update the progress UpdateProgressWithInfo(OP_FORMAT, MSG_261, wb, target_size); - cur_value = (wb * 80) / target_size; - for ( ; cur_value > last_value && last_value < 80; last_value++) - uprintfs("+"); + uprint_progress(wb, target_size); if (wb >= target_size) break; diff --git a/src/format_ext.c b/src/format_ext.c index 7209b817..53800e93 100644 --- a/src/format_ext.c +++ b/src/format_ext.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * extfs formatting - * Copyright © 2019-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2019-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -42,7 +42,6 @@ extern const char* FileSystemLabel[FS_MAX]; extern io_manager nt_io_manager; extern DWORD ext2_last_winerror(DWORD default_error); static float ext2_percent_start = 0.0f, ext2_percent_share = 0.5f; -const float ext2_max_marker = 80.0f; typedef struct { uint64_t max_size; @@ -187,15 +186,8 @@ const char* error_message(errcode_t error_code) errcode_t ext2fs_print_progress(int64_t cur_value, int64_t max_value) { - static int64_t last_value = -1; - if (max_value == 0) - return 0; UpdateProgressWithInfo(OP_FORMAT, MSG_217, (uint64_t)((ext2_percent_start * max_value) + (ext2_percent_share * cur_value)), max_value); - cur_value = (int64_t)(((float)cur_value / (float)max_value) * min(ext2_max_marker, (float)max_value)); - if (cur_value != last_value) { - last_value = cur_value; - uprintfs("+"); - } + uprint_progress((uint64_t)cur_value, (uint64_t)max_value); return IS_ERROR(ErrorStatus) ? EXT2_ET_CANCEL_REQUESTED : 0; } @@ -387,7 +379,7 @@ BOOL FormatExtFs(DWORD DriveIndex, uint64_t PartitionOffset, DWORD BlockSize, LP ext2_percent_start = 0.0f; ext2_percent_share = (FSName[3] == '2') ? 1.0f : 0.5f; uprintf("Creating %d inode sets: [1 marker = %0.1f set(s)]", ext2fs->group_desc_count, - max((float)ext2fs->group_desc_count / ext2_max_marker, 1.0f)); + max((float)ext2fs->group_desc_count / MAX_MARKER, 1.0f)); for (i = 0; i < (int)ext2fs->group_desc_count; i++) { if (ext2fs_print_progress((int64_t)i, (int64_t)ext2fs->group_desc_count)) goto out; @@ -443,7 +435,7 @@ BOOL FormatExtFs(DWORD DriveIndex, uint64_t PartitionOffset, DWORD BlockSize, LP journal_size = ext2fs_default_journal_size(ext2fs_blocks_count(ext2fs->super)); journal_size /= 2; // That journal init is really killing us! uprintf("Creating %d journal blocks: [1 marker = %0.1f block(s)]", journal_size, - max((float)journal_size / ext2_max_marker, 1.0f)); + max((float)journal_size / MAX_MARKER, 1.0f)); // Even with EXT2_MKJOURNAL_LAZYINIT, this call is absolutely dreadful in terms of speed... r = ext2fs_add_journal_inode(ext2fs, journal_size, EXT2_MKJOURNAL_NO_MNT_CHECK | ((Flags & FP_QUICK) ? EXT2_MKJOURNAL_LAZYINIT : 0)); uprintfs("\r\n"); diff --git a/src/format_fat32.c b/src/format_fat32.c index 57cdfb77..fa75f16e 100644 --- a/src/format_fat32.c +++ b/src/format_fat32.c @@ -2,7 +2,7 @@ * Rufus: The Reliable USB Formatting Utility * Large FAT32 formatting * Copyright © 2007-2009 Tom Thornhill/Ridgecrop - * Copyright © 2011-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2011-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -192,8 +192,10 @@ BOOL FormatLargeFAT32(DWORD DriveIndex, uint64_t PartitionOffset, DWORD ClusterS ErrorStatus = RUFUS_ERROR(ERROR_INVALID_PARAMETER); goto out; } - PrintInfoDebug(0, MSG_222, "Large FAT32"); - UpdateProgressWithInfoInit(NULL, TRUE); + if (!(Flags & FP_NO_PROGRESS)) { + PrintInfoDebug(0, MSG_222, "Large FAT32"); + UpdateProgressWithInfoInit(NULL, TRUE); + } VolumeId = GetVolumeID(); // Open the drive and lock it @@ -423,7 +425,8 @@ BOOL FormatLargeFAT32(DWORD DriveIndex, uint64_t PartitionOffset, DWORD ClusterS } for (i = 0; i < (SystemAreaSize + BurstSize - 1); i += BurstSize) { - UpdateProgressWithInfo(OP_FORMAT, MSG_217, (uint64_t)i, (uint64_t)SystemAreaSize + BurstSize); + if (!(Flags & FP_NO_PROGRESS)) + UpdateProgressWithInfo(OP_FORMAT, MSG_217, (uint64_t)i, (uint64_t)SystemAreaSize + BurstSize); CHECK_FOR_USER_CANCEL; if (write_sectors(hLogicalVolume, BytesPerSect, i, BurstSize, pZeroSect) != (BytesPerSect * BurstSize)) { die("Error clearing reserved sectors", ERROR_WRITE_FAULT); @@ -447,7 +450,8 @@ BOOL FormatLargeFAT32(DWORD DriveIndex, uint64_t PartitionOffset, DWORD ClusterS if (!(Flags & FP_NO_BOOT)) { // Must do it here, as have issues when trying to write the PBR after a remount - PrintInfoDebug(0, MSG_229); + if (!(Flags & FP_NO_PROGRESS)) + PrintInfoDebug(0, MSG_229); if (!WritePBR(hLogicalVolume)) { // Non fatal error, but the drive probably won't boot uprintf("Could not write partition boot record - drive may not boot..."); @@ -455,8 +459,10 @@ BOOL FormatLargeFAT32(DWORD DriveIndex, uint64_t PartitionOffset, DWORD ClusterS } // Set the FAT32 volume label - PrintInfo(0, MSG_221, lmprintf(MSG_307)); - uprintf("Setting label..."); + if (!(Flags & FP_NO_PROGRESS)) { + PrintInfo(0, MSG_221, lmprintf(MSG_307)); + uprintf("Setting label..."); + } // Handle must be closed for SetVolumeLabel to work safe_closehandle(hLogicalVolume); VolumeName = write_as_esp ? diff --git a/src/license.h b/src/license.h index 89aaac3a..0ec2ebf1 100644 --- a/src/license.h +++ b/src/license.h @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Licensing Data - * Copyright © 2011-2023 Pete Batard <pete@akeo.ie> + * Copyright © 2011-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/rufus.h b/src/rufus.h index f05b8c6c..f5e1e821 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -91,6 +91,7 @@ #define MAX_SECTORS_TO_CLEAR 128 // nb sectors to zap when clearing the MBR/GPT (must be >34) #define MAX_USERNAME_LENGTH 128 // Maximum size we'll accept for a WUE specified username #define MAX_WININST 4 // Max number of install[.wim|.esd] we can handle on an image +#define MAX_MARKER 80.0f // Max number of '+' signs we display for progress #define MBR_UEFI_MARKER 0x49464555 // 'U', 'E', 'F', 'I', as a 32 bit little endian longword #define MORE_INFO_URL 0xFFFF #define PROJECTED_SIZE_RATIO 110 // Percentage by which we inflate projected_size to prevent persistence overflow @@ -201,6 +202,7 @@ static __inline void static_repchr(char* p, char s, char r) { extern void uprintf(const char *format, ...); extern void uprintfs(const char *str); extern void wuprintf(const wchar_t* format, ...); +extern void uprint_progress(uint64_t cur_value, uint64_t max_value); #define vuprintf(...) do { if (verbose) uprintf(__VA_ARGS__); } while(0) #define vvuprintf(...) do { if (verbose > 1) uprintf(__VA_ARGS__); } while(0) #define suprintf(...) do { if (!bSilent) uprintf(__VA_ARGS__); } while(0) @@ -757,6 +759,7 @@ extern void PrintStatusInfo(BOOL info, BOOL debug, unsigned int duration, int ms extern void UpdateProgress(int op, float percent); extern void _UpdateProgressWithInfo(int op, int msg, uint64_t processed, uint64_t total, BOOL force); #define UpdateProgressWithInfo(op, msg, processed, total) _UpdateProgressWithInfo(op, msg, processed, total, FALSE) +#define UpdateProgressWithInfoUpTo(upto, op, msg, processed, total) _UpdateProgressWithInfo(op, msg, (processed) * (upto), (total) * 100, FALSE) #define UpdateProgressWithInfoForce(op, msg, processed, total) _UpdateProgressWithInfo(op, msg, processed, total, TRUE) #define UpdateProgressWithInfoInit(hProgressDialog, bNoAltMode) UpdateProgressWithInfo(OP_INIT, (int)bNoAltMode, (uint64_t)(uintptr_t)hProgressDialog, 0); extern const char* StrError(DWORD error_code, BOOL use_default_locale); diff --git a/src/rufus.rc b/src/rufus.rc index 0acbacf0..0fa39b46 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.8.2238" +CAPTION "Rufus 4.8.2239" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2238,0 - PRODUCTVERSION 4,8,2238,0 + FILEVERSION 4,8,2239,0 + PRODUCTVERSION 4,8,2239,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2238" + VALUE "FileVersion", "4.8.2239" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2238" + VALUE "ProductVersion", "4.8.2239" END END BLOCK "VarFileInfo" diff --git a/src/stdio.c b/src/stdio.c index 0db0423f..e42c63f2 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Standard User I/O Routines (logging, status, error, etc.) - * Copyright © 2011-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2011-2025 Pete Batard <pete@akeo.ie> * Copyright © 2020 Mattiwatti <mattiwatti@gmail.com> * * This program is free software: you can redistribute it and/or modify @@ -141,6 +141,19 @@ void uprintfs(const char* str) free(wstr); } +void uprint_progress(uint64_t cur_value, uint64_t max_value) +{ + static uint64_t last_value = 0; + if (cur_value == 0) { + last_value = 0; + return; + } + assert(max_value != 0); + cur_value = (uint64_t)(((float)cur_value / (float)max_value) * min(MAX_MARKER, (float)max_value)); + for (; cur_value > last_value && last_value < 80; last_value++) + uprintfs("+"); +} + uint32_t read_file(const char* path, uint8_t** buf) { FILE* fd = fopenU(path, "rb"); diff --git a/src/wimlib/wimlib/progress.h b/src/wimlib/wimlib/progress.h index e73b3fd1..9941eef9 100644 --- a/src/wimlib/wimlib/progress.h +++ b/src/wimlib/wimlib/progress.h @@ -43,12 +43,12 @@ set_next_progress(u64 completed_bytes, u64 total_bytes, u64 *next_progress_p) if (*next_progress_p < total_bytes) { /* * Send the next message as soon as: - * - another 1/100 of the total has been processed; - * - OR another 1 GiB has been processed; + * - another 1/1000 of the total has been processed; + * - OR another 256 MiB has been processed; * - OR all bytes have been processed. */ - *next_progress_p = min(min(completed_bytes + total_bytes / 100, - completed_bytes + (1UL << 30)), + *next_progress_p = min(min(completed_bytes + total_bytes / 1000, + completed_bytes + (1UL << 28)), total_bytes); } else { /* Last message has been sent. */ From 2470c56c7ea9b9bfc68b57ebf2ae0cd01026fe40 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 5 May 2025 00:01:54 +0100 Subject: [PATCH 049/192] [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... --- src/Makefile.am | 2 +- src/Makefile.in | 2 +- src/format.c | 3 +- src/msapi_utf8.h | 11 + src/msvc-missing/unistd.h | 9 +- src/rufus.c | 43 +-- src/rufus.rc | 10 +- src/vhd.c | 773 +++++--------------------------------- src/vhd.h | 47 +-- src/wimlib/wimlib.h | 73 ++++ src/wue.c | 286 +++++++------- 11 files changed, 330 insertions(+), 929 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index d7650f13..65a5cf14 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,7 +20,7 @@ AM_V_WINDRES = $(AM_V_WINDRES_$(V)) rufus_SOURCES = badblocks.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c xml.c rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/wimlib -I$(srcdir)/../res $(AM_CFLAGS) \ - -DEXT2_FLAT_INCLUDES=0 -DSOLUTION=rufus + -DEXT2_FLAT_INCLUDES=0 -D_RUFUS -DSOLUTION=rufus rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows -L $(srcdir)/../.mingw rufus_LDADD = rufus_rc.o bled/libbled.a ext2fs/libext2fs.a ms-sys/libmssys.a syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a syslinux/win/libwin.a \ libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a wimlib/libwim.a $(NONVULNERABLE_LIBS) $(VULNERABLE_LIBS) diff --git a/src/Makefile.in b/src/Makefile.in index df67b5d4..f219568c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -289,7 +289,7 @@ rufus_SOURCES = badblocks.c dev.c dos.c dos_locale.c drive.c format.c format_ext localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c xml.c rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/wimlib -I$(srcdir)/../res $(AM_CFLAGS) \ - -DEXT2_FLAT_INCLUDES=0 -DSOLUTION=rufus + -DEXT2_FLAT_INCLUDES=0 -D_RUFUS -DSOLUTION=rufus rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows -L $(srcdir)/../.mingw rufus_LDADD = rufus_rc.o bled/libbled.a ext2fs/libext2fs.a ms-sys/libmssys.a syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a syslinux/win/libwin.a \ diff --git a/src/format.c b/src/format.c index b21158f5..a11a4a43 100644 --- a/src/format.c +++ b/src/format.c @@ -73,7 +73,6 @@ static unsigned int sec_buf_pos = 0; extern const int nb_steps[FS_MAX]; extern const char* md5sum_name[2]; extern uint32_t dur_mins, dur_secs; -extern uint32_t wim_nb_files, wim_proc_files, wim_extra_files; extern BOOL force_large_fat32, enable_ntfs_compression, lock_drive, zero_drive, fast_zeroing, enable_file_indexing; extern BOOL write_as_image, use_vds, write_as_esp, is_vds_available, has_ffu_support, use_rufus_mbr; extern char* archive_path; @@ -1960,7 +1959,7 @@ DWORD WINAPI FormatThread(void* param) ErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_PATCH)); } else { efi_dst[sizeof(efi_dst) - sizeof("\\bootx64.efi")] = '\\'; - if (!WimExtractFile(img_report.wininst_path[0], 1, "Windows\\Boot\\EFI\\bootmgfw.efi", efi_dst, FALSE)) { + if (!WimExtractFile(img_report.wininst_path[0], 1, "Windows\\Boot\\EFI\\bootmgfw.efi", efi_dst)) { uprintf("Failed to setup Win7 EFI boot"); ErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_PATCH)); } diff --git a/src/msapi_utf8.h b/src/msapi_utf8.h index 3daef720..e241026b 100644 --- a/src/msapi_utf8.h +++ b/src/msapi_utf8.h @@ -750,6 +750,17 @@ static __inline DWORD GetTempFileNameU(char* lpPathName, char* lpPrefixString, U return ret; } +static __inline DWORD GetTempDirNameU(char* lpPathName, char* lpPrefixString, UINT uUnique, char* lpTempDirName) +{ + DWORD ret = GetTempFileNameU(lpPathName, lpPrefixString, uUnique, lpTempDirName); + if (ret != 0) { + DeleteFileU(lpTempDirName); + if (!CreateDirectoryU(lpTempDirName, NULL)) + ret = 0; + } + return ret; +} + static __inline DWORD GetModuleFileNameU(HMODULE hModule, char* lpFilename, DWORD nSize) { DWORD ret = 0, err = ERROR_INVALID_DATA; diff --git a/src/msvc-missing/unistd.h b/src/msvc-missing/unistd.h index 98cb70a4..fccdd550 100644 --- a/src/msvc-missing/unistd.h +++ b/src/msvc-missing/unistd.h @@ -24,10 +24,11 @@ typedef unsigned short mode_t; #ifndef _SSIZE_T_DEFINED #define _SSIZE_T_DEFINED #undef ssize_t -/* From https://awesomekling.github.io/How-SerenityOS-declares-ssize_t/ */ -#define unsigned signed -typedef size_t ssize_t; -#undef unsigned +#ifdef _WIN64 +typedef __int64 ssize_t; +#else +typedef int ssize_t; +#endif /* _WIN64 */ #endif /* _SSIZE_T_DEFINED */ /* ext2fs needs this, which we picked from libcdio-driver/filemode.h */ diff --git a/src/rufus.c b/src/rufus.c index 4bb0388d..d316d991 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -90,7 +90,7 @@ static char szTimer[12] = "00:00:00"; static unsigned int timer; static char uppercase_select[2][64], uppercase_start[64], uppercase_close[64], uppercase_cancel[64]; -extern HANDLE update_check_thread, wim_thread; +extern HANDLE update_check_thread; extern HIMAGELIST hUpImageList, hDownImageList; extern BOOL enable_iso, enable_joliet, enable_rockridge, enable_extra_hashes, is_bootloader_revoked; extern BOOL validate_md5sum, cpu_has_sha1_accel, cpu_has_sha256_accel; @@ -1303,7 +1303,7 @@ DWORD WINAPI ImageScanThread(LPVOID param) // coverity[swapped_arguments] if (GetTempFileNameU(temp_dir, APPLICATION_NAME, 0, tmp_path) != 0) { // Only look at index 1 for now. If people complain, we may look for more. - if (WimExtractFile(image_path, 1, "Windows\\Boot\\EFI\\bootmgr.efi", tmp_path, TRUE)) { + if (WimExtractFile(image_path, 1, "Windows\\Boot\\EFI\\bootmgr.efi", tmp_path)) { arch = FindArch(tmp_path); if (arch != 0) { uprintf(" Image contains a%s %s EFI boot manager", @@ -1548,12 +1548,6 @@ static DWORD WINAPI BootCheckThread(LPVOID param) MessageBoxExU(hMainDialog, lmprintf(MSG_091), lmprintf(MSG_090), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); goto out; } - if (HAS_WIN7_EFI(img_report) && (!WimExtractCheck(FALSE))) { - // Your platform cannot extract files from WIM archives => download 7-zip? - if (MessageBoxExU(hMainDialog, lmprintf(MSG_102), lmprintf(MSG_101), MB_YESNO | MB_ICONERROR | MB_IS_RTL, selected_langid) == IDYES) - ShellExecuteA(hMainDialog, "open", SEVENZIP_URL, NULL, NULL, SW_SHOWNORMAL); - goto out; - } } else if ( ((fs_type == FS_NTFS) && !HAS_WINDOWS(img_report) && !HAS_GRUB(img_report) && (!HAS_SYSLINUX(img_report) || (SL_MAJOR(img_report.sl_version) <= 5))) || ((IS_FAT(fs_type)) && (!HAS_SYSLINUX(img_report)) && (!allow_dual_uefi_bios) && !IS_EFI_BOOTABLE(img_report) && @@ -3825,39 +3819,10 @@ relaunch: } #if defined(_DEBUG) || defined(TEST) || defined(ALPHA) extern int TestHashes(void); -#include "wimlib.h" // Ctrl-T => Alternate Test mode that doesn't require a full rebuild if ((ctrl_without_focus || ((GetKeyState(VK_CONTROL) & 0x8000) && (msg.message == WM_KEYDOWN))) && (msg.wParam == 'T')) { - int r; - WIMStruct* wim; - r = wimlib_open_wim(L"D:\\Incoming\\Win11_24H2_EnglishInternational_x64.iso|sources/boot.wim", WIMLIB_OPEN_FLAG_CHECK_INTEGRITY, &wim); -// r = wimlib_open_wim(L"C:\\tmp\\test.iso|sources/boot.wim", WIMLIB_OPEN_FLAG_CHECK_INTEGRITY, &wim); -// r = wimlib_open_wim(L"C:\\tmp\\boot.wim", WIMLIB_OPEN_FLAG_CHECK_INTEGRITY, &wim); - if (r == 0) { - int image; - wchar_t* xml; - size_t xml_size; - wimlib_print_header(wim); - if (wimlib_get_xml_data(wim, (void**) & xml, &xml_size) == 0) { - xml[(xml_size / sizeof(wchar_t)) - 1] = L'\0'; - wuprintf(L"%s", xml); - free(xml); - } - image = wimlib_resolve_image(wim, L"1"); - uprintf("image = %d", image); - const wchar_t* fn = L"Windows/win.ini"; - r = wimlib_extract_paths(wim, image, L"C:\\tmp\\wim", &fn, 1, WIMLIB_EXTRACT_FLAG_NORPFIX | - WIMLIB_EXTRACT_FLAG_GLOB_PATHS | WIMLIB_EXTRACT_FLAG_STRICT_GLOB | WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE); - if (r == 0) - uprintf("Successfully extracted '%S'", fn); - else - uprintf("Failed to extract '%S': %d", fn, r); - wimlib_free(wim); - } else { - uprintf("Failed to open WIM: %d", r); - } -// TestHashes(); + TestHashes(); continue; } #endif @@ -3886,8 +3851,6 @@ extern int TestHashes(void); WriteSetting32(SETTING_DEFAULT_THREAD_PRIORITY, default_thread_priority - THREAD_PRIORITY_ABOVE_NORMAL); if (format_thread != NULL) SetThreadPriority(format_thread, default_thread_priority); - if (wim_thread != NULL) - SetThreadPriority(wim_thread, default_thread_priority); } PrintStatus(STATUS_MSG_TIMEOUT, MSG_318, default_thread_priority); continue; diff --git a/src/rufus.rc b/src/rufus.rc index 0fa39b46..4a540eaf 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.8.2239" +CAPTION "Rufus 4.8.2240" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2239,0 - PRODUCTVERSION 4,8,2239,0 + FILEVERSION 4,8,2240,0 + PRODUCTVERSION 4,8,2240,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2239" + VALUE "FileVersion", "4.8.2240" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2239" + VALUE "ProductVersion", "4.8.2240" END END BLOCK "VarFileInfo" diff --git a/src/vhd.c b/src/vhd.c index fe73e0ba..1d5c4462 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Virtual Disk Handling functions - * Copyright © 2013-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2013-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,56 +41,19 @@ #include "msapi_utf8.h" #include "drive.h" +#include "wimlib.h" #include "registry.h" #include "bled/bled.h" -// WIM API Prototypes -PF_TYPE_DECL(WINAPI, HANDLE, WIMCreateFile, (PWSTR, DWORD, DWORD, DWORD, DWORD, PDWORD)); -PF_TYPE_DECL(WINAPI, BOOL, WIMSetTemporaryPath, (HANDLE, PWSTR)); -PF_TYPE_DECL(WINAPI, HANDLE, WIMLoadImage, (HANDLE, DWORD)); -PF_TYPE_DECL(WINAPI, BOOL, WIMMountImage, (PCWSTR, PCWSTR, DWORD, PCWSTR)); -PF_TYPE_DECL(WINAPI, BOOL, WIMUnmountImage, (PCWSTR, PCWSTR, DWORD, BOOL)); -PF_TYPE_DECL(WINAPI, BOOL, WIMApplyImage, (HANDLE, PCWSTR, DWORD)); -PF_TYPE_DECL(WINAPI, BOOL, WIMExtractImagePath, (HANDLE, PWSTR, PWSTR, DWORD)); -PF_TYPE_DECL(WINAPI, BOOL, WIMGetImageInformation, (HANDLE, PVOID, PDWORD)); -PF_TYPE_DECL(WINAPI, BOOL, WIMCloseHandle, (HANDLE)); -PF_TYPE_DECL(WINAPI, DWORD, WIMRegisterMessageCallback, (HANDLE, FARPROC, PVOID)); -PF_TYPE_DECL(WINAPI, DWORD, WIMUnregisterMessageCallback, (HANDLE, FARPROC)); - -typedef struct { - int index; - BOOL commit; - const char* image; - const char* dst; -} mount_params_t; - -uint32_t wim_nb_files, wim_proc_files, wim_extra_files; -HANDLE wim_thread = NULL; -extern int default_thread_priority; extern char* save_image_type; extern BOOL ignore_boot_marker, has_ffu_support; extern RUFUS_DRIVE rufus_drive[MAX_DRIVES]; extern HANDLE format_thread; -static uint8_t wim_flags = 0; -static uint32_t progress_report_mask; -static uint64_t progress_offset = 0, progress_total = 100; -static wchar_t wmount_path[MAX_PATH] = { 0 }, wmount_track[MAX_PATH] = { 0 }; -static char sevenzip_path[MAX_PATH], physical_path[128] = ""; +static char physical_path[128] = ""; static int progress_op = OP_FILE_COPY, progress_msg = MSG_267; -static BOOL count_files; static HANDLE mounted_handle = INVALID_HANDLE_VALUE; -static BOOL Get7ZipPath(void) -{ - if ( (GetRegistryKeyStr(REGKEY_HKCU, "Software\\7-Zip\\Path", sevenzip_path, sizeof(sevenzip_path))) - || (GetRegistryKeyStr(REGKEY_HKLM, "Software\\7-Zip\\Path", sevenzip_path, sizeof(sevenzip_path))) ) { - static_strcat(sevenzip_path, "\\7z.exe"); - return (_accessU(sevenzip_path, 0) != -1); - } - return FALSE; -} - typedef struct { const char* ext; uint8_t type; @@ -232,681 +195,115 @@ out: } // WIM operations progress callback -DWORD WINAPI WimProgressCallback(DWORD dwMsgId, WPARAM wParam, LPARAM lParam, PVOID pvIgnored) +static enum wimlib_progress_status WimProgressFunc(enum wimlib_progress_msg msg_type, + union wimlib_progress_info* info, void* progctx) { - PBOOL pbCancel = NULL; - PWIN32_FIND_DATA pFileData; - const char* level = NULL; - uint64_t size; + static BOOL init[3] = { 0 }; - switch (dwMsgId) { - case WIM_MSG_PROGRESS: - // The default WIM progress is useless for apply (freezes at 95%, which is usually when - // only half the files have been processed), so we only use it for mounting/unmounting. - if (!(progress_report_mask & WIM_REPORT_PROGRESS)) - break; - UpdateProgressWithInfo(progress_op, progress_msg, progress_offset + wParam, progress_total); + if IS_ERROR(ErrorStatus) + return WIMLIB_PROGRESS_STATUS_ABORT; + + switch (msg_type) { + case WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN: + memset(init, 0, sizeof(init)); + uprintf("Applying image %d (\"%S\") from '%S' to '%S'", + info->extract.image, info->extract.image_name, + info->extract.wimfile_name, info->extract.target); break; - case WIM_MSG_PROCESS: - if (!(progress_report_mask & WIM_REPORT_PROCESS)) - break; - // The amount of files processed is overwhelming (16k+ for a typical image), - // and trying to display it *WILL* slow us down, so we don't. -#if 0 - uprintf("%S", (PWSTR)wParam); - PrintStatus(0, MSG_000, str); // MSG_000 is "%s" -#endif - if (count_files) { - wim_nb_files++; - } else { - // At the end of an actual apply, the WIM API re-lists a bunch of directories it already processed, - // so, even as we try to compensate, we might end up with more entries than counted - ignore those. - if (wim_proc_files < wim_nb_files) - wim_proc_files++; - else - wim_extra_files++; - UpdateProgressWithInfo(progress_op, progress_msg, wim_proc_files, wim_nb_files); - } - // Halt on error - if (IS_ERROR(ErrorStatus)) { - pbCancel = (PBOOL)lParam; - *pbCancel = TRUE; - break; + case WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE: + if (!init[0]) { + uprintf("Creating file structure..."); + init[0] = TRUE; + uprint_progress(0, 0); } + UpdateProgressWithInfoUpTo(98, progress_op, progress_msg, info->extract.current_file_count, info->extract.end_file_count * 6); + uprint_progress(info->extract.current_file_count, info->extract.end_file_count); break; - case WIM_MSG_FILEINFO: - if (!(progress_report_mask & WIM_REPORT_FILEINFO)) - break; - pFileData = (PWIN32_FIND_DATA)lParam; - if (pFileData->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - uprintf("Creating: %S", (PWSTR)wParam); - } else { - size = (((uint64_t)pFileData->nFileSizeHigh) << 32) + pFileData->nFileSizeLow; - uprintf("Extracting: %S (%s)", (PWSTR)wParam, SizeToHumanReadable(size, FALSE, FALSE)); + case WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS: + if (!init[1]) { + uprintf("\nExtracting file data..."); + init[1] = TRUE; + uprint_progress(0, 0); } + UpdateProgressWithInfoUpTo(98, progress_op, progress_msg, info->extract.total_bytes + (4 * info->extract.completed_bytes), info->extract.total_bytes * 6); + uprint_progress(info->extract.completed_bytes, info->extract.total_bytes); break; - case WIM_MSG_RETRY: - level = "retry"; - // fall through - case WIM_MSG_INFO: - if (level == NULL) level = "info"; - // fall through - case WIM_MSG_WARNING: - if (level == NULL) level = "warning"; - // fall through - case WIM_MSG_ERROR: - if (level == NULL) level = "error"; - SetLastError((DWORD)lParam); - uprintf("WIM processing %s: %S [%s]\n", level, (PWSTR)wParam, WindowsErrorString()); + case WIMLIB_PROGRESS_MSG_EXTRACT_METADATA: + if (!init[2]) { + uprintf("\nApplying metadata to files..."); + init[2] = TRUE; + uprint_progress(0, 0); + } + UpdateProgressWithInfoUpTo(98, progress_op, progress_msg, info->extract.current_file_count + (5 * info->extract.end_file_count), info->extract.end_file_count * 6); + uprint_progress(info->extract.current_file_count, info->extract.end_file_count); + if (info->extract.current_file_count >= info->extract.end_file_count) + uprintf("\n"); + break; + default: break; } - return IS_ERROR(ErrorStatus) ? WIM_MSG_ABORT_IMAGE : WIM_MSG_SUCCESS; + return WIMLIB_PROGRESS_STATUS_CONTINUE; } -// Find out if we have any way to extract/apply WIM files on this platform -// Returns a bitfield of the methods we can use (1 = Extract using wimgapi, 2 = Extract using 7-Zip, 4 = Apply using wimgapi) -uint8_t WimExtractCheck(BOOL bSilent) +// Extract a file from a WIM image. Returns the allocated path of the extracted file or NULL on error. +BOOL WimExtractFile(const char* image, int index, const char* src, const char* dst) { - PF_INIT(WIMCreateFile, Wimgapi); - PF_INIT(WIMSetTemporaryPath, Wimgapi); - PF_INIT(WIMLoadImage, Wimgapi); - PF_INIT(WIMApplyImage, Wimgapi); - PF_INIT(WIMExtractImagePath, Wimgapi); - PF_INIT(WIMGetImageInformation, Wimgapi); - PF_INIT(WIMRegisterMessageCallback, Wimgapi); - PF_INIT(WIMUnregisterMessageCallback, Wimgapi); - PF_INIT(WIMCloseHandle, Wimgapi); - - if (pfWIMCreateFile && pfWIMSetTemporaryPath && pfWIMLoadImage && pfWIMExtractImagePath && pfWIMCloseHandle) - wim_flags |= WIM_HAS_API_EXTRACT; - if (Get7ZipPath()) - wim_flags |= WIM_HAS_7Z_EXTRACT; - if ((wim_flags & WIM_HAS_API_EXTRACT) && pfWIMApplyImage && pfWIMRegisterMessageCallback && pfWIMUnregisterMessageCallback) - wim_flags |= WIM_HAS_API_APPLY; - - suprintf("WIM extraction method(s) supported: %s%s%s", (wim_flags & WIM_HAS_7Z_EXTRACT)?"7-Zip": - ((wim_flags & WIM_HAS_API_EXTRACT)?"":"NONE"), - (WIM_HAS_EXTRACT(wim_flags) == (WIM_HAS_API_EXTRACT|WIM_HAS_7Z_EXTRACT))?", ": - "", (wim_flags & WIM_HAS_API_EXTRACT)?"wimgapi.dll":""); - suprintf("WIM apply method supported: %s", (wim_flags & WIM_HAS_API_APPLY)?"wimgapi.dll":"NONE"); - return wim_flags; -} - -// -// Looks like Microsoft's idea of "mount" for WIM images involves the creation -// of a as many virtual junctions as there exist directories on the image... -// So, yeah, this is both very slow and wasteful of space. -// -// NB: You can see mounted WIMs, along with their mountpoint, by checking: -// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WIMMount\Mounted Images -// You can also mount/unmount images from an elevated prompt with something like: -// dism /mount-image [/readonly] /imagefile:F:\sources\boot.wim /index:2 /mountdir:C:\test\offline -// dism /unmount-image /discard /mountdir:C:\test\offline -// -static DWORD WINAPI WimMountImageThread(LPVOID param) -{ - BOOL r = FALSE; - wconvert(temp_dir); - mount_params_t* mp = (mount_params_t*)param; - wchar_t* wimage = utf8_to_wchar(mp->image); - - PF_INIT_OR_OUT(WIMRegisterMessageCallback, Wimgapi); - PF_INIT_OR_OUT(WIMMountImage, Wimgapi); - PF_INIT_OR_OUT(WIMUnmountImage, Wimgapi); - PF_INIT_OR_OUT(WIMUnregisterMessageCallback, Wimgapi); - - if (wmount_path[0] != 0) { - uprintf("WimMountImage: An image is already mounted. Trying to unmount it..."); - if (pfWIMUnmountImage(wmount_path, wimage, mp->index, FALSE)) - uprintf("WimMountImage: Successfully unmounted existing image.."); - else - goto out; - } - if (GetTempFileNameW(wtemp_dir, L"Ruf", 0, wmount_path) == 0) { - uprintf("WimMountImage: Can not generate mount directory: %s", WindowsErrorString()); - goto out; - } - DeleteFileW(wmount_path); - if (!CreateDirectoryW(wmount_path, 0)) { - uprintf("WimMountImage: Can not create mount directory '%S': %s", wmount_path, WindowsErrorString()); - goto out; - } - if (GetTempFileNameW(wtemp_dir, L"Ruf", 0, wmount_track) == 0) { - uprintf("WimMountImage: Can not generate tracking directory: %s", WindowsErrorString()); - goto out; - } - DeleteFileW(wmount_track); - if (!CreateDirectoryW(wmount_track, 0)) { - uprintf("WimMountImage: Can not create tracking directory '%S': %s", wmount_track, WindowsErrorString()); - goto out; - } - - progress_report_mask = WIM_REPORT_PROGRESS; - progress_op = OP_PATCH; - progress_msg = MSG_325; - progress_offset = 1; - progress_total = PATCH_PROGRESS_TOTAL; - if (pfWIMRegisterMessageCallback(NULL, (FARPROC)WimProgressCallback, NULL) == INVALID_CALLBACK_VALUE) { - uprintf("WimMountImage: Could not set progress callback: %s", WindowsErrorString()); - goto out; - } - - r = pfWIMMountImage(wmount_path, wimage, mp->index, wmount_track); - pfWIMUnregisterMessageCallback(NULL, (FARPROC)WimProgressCallback); - if (!r) { - uprintf("Could not mount '%S [%d]' on '%S': %s", wimage, mp->index, wmount_path, WindowsErrorString()); - goto out; - } - uprintf("Mounted '%S [%d]' on '%S'", wimage, mp->index, wmount_path); - -out: - if (!r) { - if (wmount_track[0] != 0) { - RemoveDirectoryW(wmount_track); - wmount_track[0] = 0; - } - if (wmount_path[0] != 0) { - RemoveDirectoryW(wmount_path); - wmount_path[0] = 0; - } - } - wfree(temp_dir); - safe_free(wimage); - ExitThread((DWORD)r); -} - -// Returns the temporary mount path on success, NULL on error. -// Returned path must be freed by the caller. -char* WimMountImage(const char* image, int index) -{ - char* mount_path = NULL; - DWORD dw = 0; - mount_params_t mp = { 0 }; - mp.image = image; - mp.index = index; - - // Try to unmount an existing stale image, if there is any - mount_path = WimGetExistingMountPoint(image, index); - if (mount_path != NULL) { - uprintf("WARNING: Found stale '%s [%d]' image mounted on '%s' - Attempting to unmount it...", - image, index, mount_path); - utf8_to_wchar_no_alloc(mount_path, wmount_path, ARRAYSIZE(wmount_path)); - wmount_track[0] = 0; - WimUnmountImage(image, index, FALSE); - } - - wim_thread = CreateThread(NULL, 0, WimMountImageThread, &mp, 0, NULL); - if (wim_thread == NULL) { - uprintf("Unable to start mount-image thread"); - return NULL; - } - SetThreadPriority(wim_thread, default_thread_priority); - WaitForSingleObject(wim_thread, INFINITE); - if (!GetExitCodeThread(wim_thread, &dw)) - dw = 0; - wim_thread = NULL; - return (dw) ? wchar_to_utf8(wmount_path) : NULL; -} - -static DWORD WINAPI WimUnmountImageThread(LPVOID param) -{ - BOOL r = FALSE; - mount_params_t* mp = (mount_params_t*)param; - wchar_t* wimage = utf8_to_wchar(mp->image); - - PF_INIT_OR_OUT(WIMRegisterMessageCallback, Wimgapi); - PF_INIT_OR_OUT(WIMUnmountImage, Wimgapi); - PF_INIT_OR_OUT(WIMUnregisterMessageCallback, Wimgapi); - - if (wmount_path[0] == 0) { - uprintf("WimUnmountImage: No image is mounted"); - goto out; - } - - progress_report_mask = WIM_REPORT_PROGRESS; - progress_op = OP_PATCH; - progress_msg = MSG_325; - progress_offset = 105; - progress_total = PATCH_PROGRESS_TOTAL; - if (pfWIMRegisterMessageCallback(NULL, (FARPROC)WimProgressCallback, NULL) == INVALID_CALLBACK_VALUE) { - uprintf("WimUnmountImage: Could not set progress callback: %s", WindowsErrorString()); - goto out; - } - - r = pfWIMUnmountImage(wmount_path, wimage, mp->index, mp->commit); - pfWIMUnregisterMessageCallback(NULL, (FARPROC)WimProgressCallback); - if (!r) { - uprintf("Could not unmount '%S': %s", wmount_path, WindowsErrorString()); - goto out; - } - uprintf("Unmounted '%S [%d]'", wmount_path, mp->index); - if (wmount_track[0] != 0 && !RemoveDirectoryW(wmount_track)) - uprintf("Could not delete '%S' : %s", wmount_track, WindowsErrorString()); - wmount_track[0] = 0; - if (wmount_path[0] != 0 && !RemoveDirectoryW(wmount_path)) - uprintf("Could not delete '%S' : %s", wmount_path, WindowsErrorString()); - wmount_path[0] = 0; -out: - safe_free(wimage); - ExitThread((DWORD)r); -} - -BOOL WimUnmountImage(const char* image, int index, BOOL commit) -{ - DWORD dw = 0; - mount_params_t mp = { 0 }; - mp.image = image; - mp.index = index; - mp.commit = commit; - - wim_thread = CreateThread(NULL, 0, WimUnmountImageThread, &mp, 0, NULL); - if (wim_thread == NULL) { - uprintf("Unable to start unmount-image thread"); - return FALSE; - } - SetThreadPriority(wim_thread, default_thread_priority); - WaitForSingleObject(wim_thread, INFINITE); - if (!GetExitCodeThread(wim_thread, &dw)) - dw = 0; - wim_thread = NULL; - return dw; -} - -// Get the existing mount point (if any) for the image + index passed as parameters. -// Needed because Windows refuses to mount two images with the same path/index even -// if the previous has become stale or deleted. This situation may occur if the user -// force-closed Rufus when 'boot.wim' was mounted, thus leaving them unable to mount -// 'boot.wim' for subsequent sessions unless they invoke dism /Unmount-Wim manually. -// This basically parses HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WIMMount\Mounted Images -// to see if an instance exists with the image/index passed as parameter and returns -// the mount point of this image if found, or NULL otherwise. -char* WimGetExistingMountPoint(const char* image, int index) -{ - static char path[MAX_PATH]; - char class[MAX_PATH] = "", guid[40], key_name[MAX_PATH]; - HKEY hKey; - DWORD dw = 0, i, k, nb_subkeys = 0, class_size; - DWORD cbMaxSubKey, cchMaxClass, cValues, cchMaxValue; - DWORD cbMaxValueData, cbSecurityDescriptor; - FILETIME ftLastWriteTime; - - if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\WIMMount\\Mounted Images", - 0, KEY_READ, &hKey) != ERROR_SUCCESS) - return NULL; - - class_size = sizeof(class); - RegQueryInfoKeyA(hKey, class, &class_size, NULL, &nb_subkeys, - &cbMaxSubKey, &cchMaxClass, &cValues, &cchMaxValue, - &cbMaxValueData, &cbSecurityDescriptor, &ftLastWriteTime); - - for (k = 0; k < nb_subkeys; k++) { - dw = sizeof(guid); - if (RegEnumKeyExA(hKey, k, guid, &dw, NULL, NULL, NULL, - &ftLastWriteTime) == ERROR_SUCCESS) { - static_sprintf(key_name, "SOFTWARE\\Microsoft\\WIMMount\\Mounted Images\\%s\\WIM Path", guid); - if (GetRegistryKeyStr(HKEY_LOCAL_MACHINE, key_name, path, sizeof(path)) && - (stricmp(path, image) != 0)) - continue; - static_sprintf(key_name, "SOFTWARE\\Microsoft\\WIMMount\\Mounted Images\\%s\\Image Index", guid); - if (GetRegistryKey32(HKEY_LOCAL_MACHINE, key_name, &i) && (i != (DWORD)index)) - continue; - path[0] = 0; - static_sprintf(key_name, "SOFTWARE\\Microsoft\\WIMMount\\Mounted Images\\%s\\Mount Path", guid); - if (GetRegistryKeyStr(HKEY_LOCAL_MACHINE, key_name, path, sizeof(path))) - break; - } - } - if (k >= nb_subkeys) - path[0] = 0; - - RegCloseKey(hKey); - - return (path[0] == 0) ? NULL: path; -} - -// Extract a file from a WIM image using wimgapi.dll -// NB: if you want progress from a WIM callback, you must run the WIM API call in its own thread -// (which we don't do here) as it won't work otherwise. Thanks go to Erwan for figuring this out! -BOOL WimExtractFile_API(const char* image, int index, const char* src, const char* dst, BOOL bSilent) -{ - static char* index_name = "[1].xml"; - BOOL r = FALSE; - DWORD dw = 0; - HANDLE hWim = NULL; - HANDLE hImage = NULL; - HANDLE hFile = NULL; - wchar_t wtemp[MAX_PATH] = { 0 }; - wchar_t* wimage = utf8_to_wchar(image); - wchar_t* wsrc = utf8_to_wchar(src); - wchar_t* wdst = utf8_to_wchar(dst); - wchar_t* wim_info; - - PF_INIT_OR_OUT(WIMCreateFile, Wimgapi); - PF_INIT_OR_OUT(WIMSetTemporaryPath, Wimgapi); - PF_INIT_OR_OUT(WIMLoadImage, Wimgapi); - PF_INIT_OR_OUT(WIMExtractImagePath, Wimgapi); - PF_INIT_OR_OUT(WIMCloseHandle, Wimgapi); - - suprintf("Opening: %s:[%d] (API)", image, index); - if (GetTempPathW(ARRAYSIZE(wtemp), wtemp) == 0) { - uprintf(" Could not fetch temp path: %s", WindowsErrorString()); - goto out; - } - - // Thanks to dism++ for figuring out that you can use UNDOCUMENTED FLAG 0x20000000 - // to open newer install.wim/install.esd images, without running into obnoxious error: - // [0x0000000B] An attempt was made to load a program with an incorrect format. - // No thanks to Microsoft for NOT DOCUMENTING THEIR UTTER BULLSHIT with the WIM API! - hWim = pfWIMCreateFile(wimage, WIM_GENERIC_READ, WIM_OPEN_EXISTING, - (img_report.wininst_version >= SPECIAL_WIM_VERSION) ? WIM_UNDOCUMENTED_BULLSHIT : 0, 0, NULL); - if (hWim == NULL) { - uprintf(" Could not access image: %s", WindowsErrorString()); - goto out; - } - - if (!pfWIMSetTemporaryPath(hWim, wtemp)) { - uprintf(" Could not set temp path: %s", WindowsErrorString()); - goto out; - } - - suprintf("Extracting: %s (From %s)", dst, src); - if (safe_strcmp(src, index_name) == 0) { - if (!pfWIMGetImageInformation(hWim, &wim_info, &dw) || (dw == 0)) { - uprintf(" Could not access WIM info: %s", WindowsErrorString()); - goto out; - } - hFile = CreateFileW(wdst, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, - NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if ((hFile == INVALID_HANDLE_VALUE) || (!WriteFile(hFile, wim_info, dw, &dw, NULL))) { - suprintf(" Could not extract file: %s", WindowsErrorString()); - goto out; - } - } else { - hImage = pfWIMLoadImage(hWim, (DWORD)index); - if (hImage == NULL) { - uprintf(" Could not set index: %s", WindowsErrorString()); - goto out; - } - if (!pfWIMExtractImagePath(hImage, wsrc, wdst, 0)) { - suprintf(" Could not extract file: %s", WindowsErrorString()); - goto out; - } - } - r = TRUE; - -out: - if ((hImage != NULL) || (hWim != NULL)) { - suprintf("Closing: %s", image); - if (hImage != NULL) pfWIMCloseHandle(hImage); - if (hWim != NULL) pfWIMCloseHandle(hWim); - } - safe_closehandle(hFile); - safe_free(wimage); - safe_free(wsrc); - safe_free(wdst); - return r; -} - -// Extract a file from a WIM image using 7-Zip -BOOL WimExtractFile_7z(const char* image, int index, const char* src, const char* dst, BOOL bSilent) -{ - int n; - size_t i; - char cmdline[MAX_PATH]; - char tmpdst[MAX_PATH]; - char index_prefix[] = "#\\"; - - suprintf("Opening: %s:[%d] (7-Zip)", image, index); + int r = 1; + WIMStruct* wim; + char tmp[MAX_PATH] = "", *p; if ((image == NULL) || (src == NULL) || (dst == NULL)) - return FALSE; + goto out; - // If you shove more than 9 images in a WIM, don't come complaining - // that this breaks! - index_prefix[0] = '0' + index; + assert(strrchr(src, '\\') != NULL); + assert(strrchr(dst, '\\') != NULL); + if (strrchr(src, '\\') == NULL || strrchr(dst, '\\') == NULL) + goto out; + p = strrchr(dst, '\\'); + *p = '\0'; - suprintf("Extracting: %s (From %s)", dst, src); - - // 7z has a quirk where the image index MUST be specified if a - // WIM has multiple indexes, but it MUST be removed if there is - // only one image. Because of this (and because 7z will not - // return an error code if it can't extract the file), we need - // to issue 2 passes. See github issue #680. - for (n = 0; n < 2; n++) { - static_strcpy(tmpdst, dst); - for (i = strlen(tmpdst) - 1; (i > 0) && (tmpdst[i] != '\\') && (tmpdst[i] != '/'); i--); - tmpdst[i] = 0; - - static_sprintf(cmdline, "\"%s\" -y e \"%s\" %s%s", sevenzip_path, - image, (n == 0) ? index_prefix : "", src); - if (RunCommand(cmdline, tmpdst, FALSE) != 0) { - uprintf(" Could not launch 7z.exe: %s", WindowsErrorString()); - return FALSE; + wimlib_global_init(0); + wimlib_set_print_errors(true); + r = wimlib_open_wimU(image, 0, &wim); + if (r == 0) { + r = wimlib_extract_pathsU(wim, index, dst, &src, 1, WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE); + wimlib_free(wim); + static_strcpy(tmp, dst); + static_strcat(tmp, strrchr(src, '\\')); + *p = '\\'; + if (!MoveFileExU(tmp, dst, MOVEFILE_REPLACE_EXISTING)) { + uprintf(" Could not rename %s to %s: %s", tmp, dst, WindowsErrorString()); + r = 1; } - - for (i = safe_strlen(src); (i > 0) && (src[i] != '\\') && (src[i] != '/'); i--); - if (i == 0) - static_strcat(tmpdst, "\\"); - static_strcat(tmpdst, &src[i]); - if (_access(tmpdst, 0) == 0) - // File was extracted => move on - break; - } - - if (n >= 2) { - suprintf(" 7z.exe did not extract %s", tmpdst); - return FALSE; - } - - // coverity[toctou] - if (!MoveFileExU(tmpdst, dst, MOVEFILE_REPLACE_EXISTING)) { - uprintf(" Could not rename %s to %s: %s", tmpdst, dst, WindowsErrorString()); - return FALSE; - } - - return TRUE; -} - -// Extract a file from a WIM image -BOOL WimExtractFile(const char* image, int index, const char* src, const char* dst, BOOL bSilent) -{ - if ((wim_flags == 0) && (!WIM_HAS_EXTRACT(WimExtractCheck(TRUE)))) - return FALSE; - if ((image == NULL) || (src == NULL) || (dst == NULL)) - return FALSE; - - // Prefer 7-Zip as, unsurprisingly, it's faster than the Microsoft way, - // but allow fallback if 7-Zip doesn't succeed - return ( ((wim_flags & WIM_HAS_7Z_EXTRACT) && WimExtractFile_7z(image, index, src, dst, bSilent)) - || ((wim_flags & WIM_HAS_API_EXTRACT) && WimExtractFile_API(image, index, src, dst, bSilent)) ); -} - -/// <summary> -/// Find if a specific index belongs to a WIM image. -/// </summary> -/// <param name="image">The path to the WIM file.</param> -/// <param name="index">The (non-zero) value of the index to check.</param> -/// <returns>TRUE if the index was found in the image, FALSE otherwise.</returns> -BOOL WimIsValidIndex(const char* image, int index) -{ - int i = 1, cur_index; - BOOL r = FALSE; - DWORD dw = 0; - HANDLE hWim = NULL; - HANDLE hFile = NULL; - char xml_file[MAX_PATH] = { 0 }; - char* str; - wchar_t* wimage = utf8_to_wchar(image); - wchar_t* wim_info; - - PF_INIT_OR_OUT(WIMCreateFile, Wimgapi); - PF_INIT_OR_OUT(WIMGetImageInformation, Wimgapi); - PF_INIT_OR_OUT(WIMCloseHandle, Wimgapi); - - // Zero indexes are invalid - if (index == 0) - goto out; - - hWim = pfWIMCreateFile(wimage, WIM_GENERIC_READ, WIM_OPEN_EXISTING, - (img_report.wininst_version >= SPECIAL_WIM_VERSION) ? WIM_UNDOCUMENTED_BULLSHIT : 0, 0, NULL); - if (hWim == NULL) { - uprintf(" Could not access image: %s", WindowsErrorString()); - goto out; - } - - if (!pfWIMGetImageInformation(hWim, &wim_info, &dw) || (dw == 0)) { - uprintf(" Could not access WIM info: %s", WindowsErrorString()); - goto out; - } - - if ((GetTempFileNameU(temp_dir, APPLICATION_NAME, 0, xml_file) == 0) || (xml_file[0] == 0)) - static_strcpy(xml_file, ".\\RufVXml.tmp"); - DeleteFileU(xml_file); - hFile = CreateFileU(xml_file, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, - NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if ((hFile == INVALID_HANDLE_VALUE) || (!WriteFile(hFile, wim_info, dw, &dw, NULL))) - goto out; - - while ((str = get_token_data_file_indexed("IMAGE INDEX", xml_file, i)) != NULL) { - cur_index = atoi(str); - safe_free(str); - if (cur_index == index) { - r = TRUE; - break; - } - i++; } + wimlib_global_cleanup(); out: - if (hWim != NULL) - pfWIMCloseHandle(hWim); - safe_closehandle(hFile); - if (xml_file[0] != 0) - DeleteFileU(xml_file); - safe_free(wimage); - return r; -} - -// Apply a WIM image using wimgapi.dll -// https://docs.microsoft.com/en-us/previous-versions/msdn10/dd851944(v=msdn.10) -// To get progress, we must run this call within its own thread -static DWORD WINAPI WimApplyImageThread(LPVOID param) -{ - BOOL r = FALSE; - HANDLE hWim = NULL; - HANDLE hImage = NULL; - wchar_t wtemp[MAX_PATH] = { 0 }; - mount_params_t* mp = (mount_params_t*)param; - wchar_t* wimage = utf8_to_wchar(mp->image); - wchar_t* wdst = utf8_to_wchar(mp->dst); - - PF_INIT_OR_OUT(WIMRegisterMessageCallback, Wimgapi); - PF_INIT_OR_OUT(WIMCreateFile, Wimgapi); - PF_INIT_OR_OUT(WIMSetTemporaryPath, Wimgapi); - PF_INIT_OR_OUT(WIMLoadImage, Wimgapi); - PF_INIT_OR_OUT(WIMApplyImage, Wimgapi); - PF_INIT_OR_OUT(WIMCloseHandle, Wimgapi); - PF_INIT_OR_OUT(WIMUnregisterMessageCallback, Wimgapi); - - uprintf("Opening: %s:[%d]", mp->image, mp->index); - - progress_report_mask = WIM_REPORT_PROCESS | WIM_REPORT_FILEINFO; - progress_op = OP_FILE_COPY; - progress_msg = MSG_267; - progress_offset = 0; - progress_total = 100; - if (pfWIMRegisterMessageCallback(NULL, (FARPROC)WimProgressCallback, NULL) == INVALID_CALLBACK_VALUE) { - uprintf(" Could not set progress callback: %s", WindowsErrorString()); - goto out; - } - - if (GetTempPathW(ARRAYSIZE(wtemp), wtemp) == 0) { - uprintf(" Could not fetch temp path: %s", WindowsErrorString()); - goto out; - } - - hWim = pfWIMCreateFile(wimage, WIM_GENERIC_READ, WIM_OPEN_EXISTING, - (img_report.wininst_version >= SPECIAL_WIM_VERSION) ? WIM_UNDOCUMENTED_BULLSHIT : 0, 0, NULL); - if (hWim == NULL) { - uprintf(" Could not access image: %s", WindowsErrorString()); - goto out; - } - - if (!pfWIMSetTemporaryPath(hWim, wtemp)) { - uprintf(" Could not set temp path: %s", WindowsErrorString()); - goto out; - } - - hImage = pfWIMLoadImage(hWim, (DWORD)mp->index); - if (hImage == NULL) { - uprintf(" Could not set index: %s", WindowsErrorString()); - goto out; - } - - uprintf("Applying Windows image..."); - UpdateProgressWithInfoInit(NULL, TRUE); - // Run a first pass using WIM_FLAG_NO_APPLY to count the files - wim_nb_files = 0; - wim_proc_files = 0; - wim_extra_files = 0; - count_files = TRUE; - if (!pfWIMApplyImage(hImage, wdst, WIM_FLAG_NO_APPLY)) { - uprintf(" Could not count the files to apply: %s", WindowsErrorString()); - goto out; - } - // The latest Windows 10 ISOs have a ~17.5% discrepancy between the number of - // files and directories actually applied vs. the ones counted when not applying. - // Therefore, we add a 'safe' 20% to our counted files to compensate for yet - // another dismal Microsoft progress reporting API... - wim_nb_files += wim_nb_files / 5; - count_files = FALSE; - // Actual apply - if (!pfWIMApplyImage(hImage, wdst, WIM_FLAG_FILEINFO)) { - uprintf(" Could not apply image: %s", WindowsErrorString()); - goto out; - } - // Ensure that we'll pick if need to readjust our 20% above from user reports - if (wim_extra_files > 0) - uprintf("Notice: An extra %d files and directories were applied, from the %d expected", - wim_extra_files, wim_nb_files); - // Re-use extra files as the final progress step - wim_extra_files = (wim_nb_files - wim_proc_files) / 3; - UpdateProgressWithInfo(OP_FILE_COPY, MSG_267, wim_proc_files + wim_extra_files, wim_nb_files); - r = TRUE; - -out: - if ((hImage != NULL) || (hWim != NULL)) { - uprintf("Closing: %s", mp->image); - if (hImage != NULL) pfWIMCloseHandle(hImage); - if (hWim != NULL) pfWIMCloseHandle(hWim); - } - if (pfWIMUnregisterMessageCallback != NULL) - pfWIMUnregisterMessageCallback(NULL, (FARPROC)WimProgressCallback); - safe_free(wimage); - safe_free(wdst); - ExitThread((DWORD)r); + return (r == 0); } BOOL WimApplyImage(const char* image, int index, const char* dst) { - DWORD dw = 0; - mount_params_t mp = { 0 }; - mp.image = image; - mp.index = index; - mp.dst = dst; + int r = 1; + WIMStruct* wim; - wim_thread = CreateThread(NULL, 0, WimApplyImageThread, &mp, 0, NULL); - if (wim_thread == NULL) { - uprintf("Unable to start apply-image thread"); - return FALSE; + wimlib_global_init(0); + wimlib_set_print_errors(true); + + uprintf("Opening: %s:[%d]", image, index); + r = wimlib_open_wimU(image, 0, &wim); + if (r == 0) { + progress_op = OP_FILE_COPY; + progress_msg = MSG_267; + wimlib_register_progress_function(wim, WimProgressFunc, NULL); + r = wimlib_extract_imageU(wim, index, dst, 0); + wimlib_free(wim); + } else { + uprintf("Failed to open '%s': Wimlib error %d", image, r); } - SetThreadPriority(wim_thread, default_thread_priority); - WaitForSingleObject(wim_thread, INFINITE); - if (!GetExitCodeThread(wim_thread, &dw)) - dw = 0; - wim_thread = NULL; - return dw; + wimlib_global_cleanup(); + return (r == 0); } // Mount an ISO or a VHD/VHDX image and provide its size diff --git a/src/vhd.h b/src/vhd.h index 07e2c74e..4bf274d0 100644 --- a/src/vhd.h +++ b/src/vhd.h @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Virtual Disk Handling definitions and prototypes - * Copyright © 2022-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2022-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,34 +29,16 @@ #pragma once +// Someone's going to have to explain to me why trying to define ANY static inline function +// calls in wimlib.h in DEBUG produces "C2143: syntax error: missing ';' before '{'" with +// MSVC, UNLESS we add the following 2 include statements here (in no particular order). +// WHAT. THE. ACTUAL. FUCK?!?!?! +#if defined(_MSC_VER) && defined(_DEBUG) +#include "msapi_utf8.h" +#include "wimlib.h" +#endif + #define WIM_MAGIC 0x0000004D4957534DULL // "MSWIM\0\0\0" -#define WIM_HAS_API_EXTRACT 1 -#define WIM_HAS_7Z_EXTRACT 2 -#define WIM_HAS_API_APPLY 4 -#define WIM_HAS_EXTRACT(r) (r & (WIM_HAS_API_EXTRACT|WIM_HAS_7Z_EXTRACT)) - -#define SECONDS_SINCE_JAN_1ST_2000 946684800 - -#define INVALID_CALLBACK_VALUE 0xFFFFFFFF - -#define WIM_FLAG_RESERVED 0x00000001 -#define WIM_FLAG_VERIFY 0x00000002 -#define WIM_FLAG_INDEX 0x00000004 -#define WIM_FLAG_NO_APPLY 0x00000008 -#define WIM_FLAG_NO_DIRACL 0x00000010 -#define WIM_FLAG_NO_FILEACL 0x00000020 -#define WIM_FLAG_SHARE_WRITE 0x00000040 -#define WIM_FLAG_FILEINFO 0x00000080 -#define WIM_FLAG_NO_RP_FIX 0x00000100 - -// Bitmask for the kind of progress we want to report in the WIM progress callback -#define WIM_REPORT_PROGRESS 0x00000001 -#define WIM_REPORT_PROCESS 0x00000002 -#define WIM_REPORT_FILEINFO 0x00000004 - -#define WIM_GENERIC_READ GENERIC_READ -#define WIM_OPEN_EXISTING OPEN_EXISTING -#define WIM_UNDOCUMENTED_BULLSHIT 0x20000000 #define MBR_SIZE 512 // Might need to review this once we see bootable 4k systems @@ -127,15 +109,8 @@ enum WIMMessage { WIM_MSG_ABORT_IMAGE = -1 }; -extern uint8_t WimExtractCheck(BOOL bSilent); -extern BOOL WimExtractFile(const char* wim_image, int index, const char* src, const char* dst, BOOL bSilent); -extern BOOL WimExtractFile_API(const char* image, int index, const char* src, const char* dst, BOOL bSilent); -extern BOOL WimExtractFile_7z(const char* image, int index, const char* src, const char* dst, BOOL bSilent); +extern BOOL WimExtractFile(const char* wim_image, int index, const char* src, const char* dst); extern BOOL WimApplyImage(const char* image, int index, const char* dst); -extern char* WimMountImage(const char* image, int index); -extern BOOL WimUnmountImage(const char* image, int index, BOOL commit); -extern char* WimGetExistingMountPoint(const char* image, int index); -extern BOOL WimIsValidIndex(const char* image, int index); extern int8_t IsBootableImage(const char* path); extern char* VhdMountImageAndGetSize(const char* path, uint64_t* disksize); #define VhdMountImage(path) VhdMountImageAndGetSize(path, NULL) diff --git a/src/wimlib/wimlib.h b/src/wimlib/wimlib.h index 84f1e2ec..7b2b6992 100644 --- a/src/wimlib/wimlib.h +++ b/src/wimlib/wimlib.h @@ -400,6 +400,10 @@ #include <stdint.h> #include <time.h> +#ifdef _RUFUS +#include "msapi_utf8.h" +#endif + #ifdef BUILDING_WIMLIB /* * On i386, gcc assumes that the stack is 16-byte aligned at function entry. @@ -2755,6 +2759,22 @@ wimlib_add_tree(WIMStruct *wim, int image, const wimlib_tchar *fs_source_path, const wimlib_tchar *wim_target_path, int add_flags); +#ifdef _RUFUS +static __inline int +wimlib_add_treeU(WIMStruct *wim, int image, + const char *fs_source_path, + const char *wim_target_path, int add_flags) +{ + int r; + wconvert(fs_source_path); + wconvert(wim_target_path); + r = wimlib_add_tree(wim, image, wfs_source_path, wwim_target_path, add_flags); + wfree(fs_source_path); + wfree(wim_target_path); + return r; +} +#endif + /** * @ingroup G_creating_and_opening_wims * @@ -3020,6 +3040,19 @@ WIMLIBAPI int wimlib_extract_image(WIMStruct *wim, int image, const wimlib_tchar *target, int extract_flags); +#ifdef _RUFUS +static __inline int +wimlib_extract_imageU(WIMStruct *wim, int image, + const char *target, int extract_flags) +{ + int r; + wconvert(target); + r = wimlib_extract_image(wim, image, wtarget, extract_flags); + wfree(target); + return r; +} +#endif + /** * @ingroup G_extracting_wims * @@ -3182,6 +3215,33 @@ wimlib_extract_paths(WIMStruct *wim, size_t num_paths, int extract_flags); +#ifdef _RUFUS +static __inline int +wimlib_extract_pathsU(WIMStruct* wim, + int image, + const char* target, + const char* const* paths, + size_t num_paths, + int extract_flags) +{ + int r = WIMLIB_ERR_NOMEM; + wconvert(target); + wimlib_tchar** wpaths = calloc(num_paths, sizeof(wimlib_tchar*)); + if (!wpaths) + goto out; + for (size_t i = 0; i < num_paths; i++) + wpaths[i] = utf8_to_wchar(paths[i]); + r = wimlib_extract_paths(wim, image, wtarget, (const wimlib_tchar* const*)wpaths, num_paths, extract_flags); + +out: + for (size_t i = 0; wpaths && i < num_paths; i++) + free(wpaths[i]); + free(wpaths); + wfree(target); + return r; +} +#endif + /** * @ingroup G_wim_information * @@ -3739,6 +3799,19 @@ wimlib_open_wim(const wimlib_tchar *wim_file, int open_flags, WIMStruct **wim_ret); +#ifdef _RUFUS +static __inline int +wimlib_open_wimU(const char* wim_file, + int open_flags, + WIMStruct** wim_ret) +{ + wconvert(wim_file); + int r = wimlib_open_wim(wwim_file, open_flags, wim_ret); + wfree(wim_file); + return r; +} +#endif + /** * @ingroup G_creating_and_opening_wims * diff --git a/src/wue.c b/src/wue.c index c2815abf..7ab0fb5f 100644 --- a/src/wue.c +++ b/src/wue.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Windows User Experience - * Copyright © 2022-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2022-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ #include "xml.h" #include "drive.h" #include "format.h" +#include "wimlib.h" #include "missing.h" #include "resource.h" #include "registry.h" @@ -48,7 +49,6 @@ int unattend_xml_mask = UNATTEND_DEFAULT_SELECTION_MASK; char *unattend_xml_path = NULL, unattend_username[MAX_USERNAME_LENGTH]; BOOL is_bootloader_revoked = FALSE; -extern uint32_t wim_nb_files, wim_proc_files, wim_extra_files; extern BOOL validate_md5sum; extern uint64_t md5sum_totalbytes; extern StrArray modified_files; @@ -422,7 +422,7 @@ out: /// <param name="xml">The index XML data.</param> /// <param name="xml_len">The length of the index XML data.</param> /// <param name="index">The index of the occurrence to look for.</param> -static void PopulateWindowsVersionFromXml(const char* xml, size_t xml_len, int index) +static void PopulateWindowsVersionFromXml(const wchar_t* xml, size_t xml_len, int index) { char* val; ezxml_t pxml = ezxml_parse_str((char*)xml, xml_len); @@ -469,57 +469,42 @@ static void PopulateWindowsVersionFromXml(const char* xml, size_t xml_len, int i /// <summary> /// Populate the img_report Window version from an install[.wim|.esd]. -/// ISO if needed. Requires Windows 8 or later. /// </summary> /// <param name="">(none)</param> /// <returns>TRUE on success, FALSE if we couldn't populate the version.</returns> BOOL PopulateWindowsVersion(void) { - char *mounted_iso, mounted_image_path[128]; - char xml_file[MAX_PATH] = "", *xml; + int r; + char wim_path[MAX_PATH] = ""; + wchar_t* xml = NULL; size_t xml_len; + WIMStruct* wim; memset(&img_report.win_version, 0, sizeof(img_report.win_version)); - if ((WindowsVersion.Version < WINDOWS_8) || ((WimExtractCheck(TRUE) & 4) == 0)) - return FALSE; - - // If we're not using a straight install.wim, we need to mount the ISO to access it + static_strcpy(wim_path, image_path); if (!img_report.is_windows_img) { - mounted_iso = VhdMountImage(image_path); - if (mounted_iso == NULL) { - uprintf("Could not mount Windows ISO for build number detection"); - return FALSE; - } - static_sprintf(mounted_image_path, "%s%s", mounted_iso, &img_report.wininst_path[0][2]); + static_strcat(wim_path, "|"); + static_strcat(wim_path, &img_report.wininst_path[0][3]); } - // Now take a look at the XML file in install.wim to list our versions - if ((GetTempFileNameU(temp_dir, APPLICATION_NAME, 0, xml_file) == 0) || (xml_file[0] == 0)) { - // Last ditch effort to get a tmp file - just extract it to the current directory - static_strcpy(xml_file, ".\\RufVXml.tmp"); - } - // GetTempFileName() may leave a file behind - DeleteFileU(xml_file); - - // Must use the Windows WIM API as 7z messes up the XML - if (!WimExtractFile_API(img_report.is_windows_img ? image_path : mounted_image_path, - 0, "[1].xml", xml_file, TRUE)) { - uprintf("Could not acquire WIM index"); + r = wimlib_open_wimU(wim_path, 0, &wim); + if (r != 0) { + uprintf("Could not open WIM: Error %d", r); goto out; } - xml_len = read_file(xml_file, (uint8_t**)&xml); - if (xml_len == 0) { - uprintf("Could not read WIM index XML"); + r = wimlib_get_xml_data(wim, (void**)&xml, &xml_len); + if (r != 0) { + uprintf("Could not read WIM XML index: Error %d", r); goto out; } + PopulateWindowsVersionFromXml(xml, xml_len, 1); out: - DeleteFileU(xml_file); - if (!img_report.is_windows_img) - VhdUnmountImage(); + free(xml); + wimlib_free(wim); return ((img_report.win_version.major != 0) && (img_report.win_version.build != 0)); } @@ -557,22 +542,20 @@ BOOL CopySKUSiPolicy(const char* drive_name) /// <returns>-2 on user cancel, -1 on other error, >=0 on success.</returns> int SetWinToGoIndex(void) { - int i; - char* mounted_iso, mounted_image_path[128]; + int i, r; + WIMStruct* wim = NULL; char* install_names[MAX_WININST]; - char xml_file[MAX_PATH] = "", *xml = NULL; + wchar_t wim_path[MAX_PATH] = L"", *xml = NULL; size_t xml_len; - StrArray version_name, version_index; + StrArray version_name = { 0 }, version_index = { 0 }; BOOL bNonStandard = FALSE; ezxml_t index = NULL, image = NULL; // Sanity checks wintogo_index = -1; wininst_index = 0; - if ((WindowsVersion.Version < WINDOWS_8) || ((WimExtractCheck(FALSE) & 4) == 0) || - (ComboBox_GetCurItemData(hFileSystem) != FS_NTFS)) { + if (ComboBox_GetCurItemData(hFileSystem) != FS_NTFS) return -1; - } // If we have multiple windows install images, ask the user the one to use if (img_report.wininst_index > 1) { @@ -585,34 +568,21 @@ int SetWinToGoIndex(void) wininst_index = 0; } - // If we're not using a straight install.wim, we need to mount the ISO to access it + utf8_to_wchar_no_alloc(image_path, wim_path, ARRAYSIZE(wim_path)); if (!img_report.is_windows_img) { - mounted_iso = VhdMountImage(image_path); - if (mounted_iso == NULL) { - uprintf("Could not mount ISO for Windows To Go selection"); - return -1; - } - static_sprintf(mounted_image_path, "%s%s", mounted_iso, &img_report.wininst_path[wininst_index][2]); + wcscat(wim_path, L"|"); + utf8_to_wchar_no_alloc(&img_report.wininst_path[wininst_index][2], + &wim_path[wcslen(wim_path)], (int)ARRAYSIZE(wim_path) - wcslen(wim_path)); } - // Now take a look at the XML file in install.wim to list our versions - if ((GetTempFileNameU(temp_dir, APPLICATION_NAME, 0, xml_file) == 0) || (xml_file[0] == 0)) { - // Last ditch effort to get a tmp file - just extract it to the current directory - static_strcpy(xml_file, ".\\RufVXml.tmp"); - } - // GetTempFileName() may leave a file behind - DeleteFileU(xml_file); - - // Must use the Windows WIM API as 7z messes up the XML - if (!WimExtractFile_API(img_report.is_windows_img ? image_path : mounted_image_path, - 0, "[1].xml", xml_file, FALSE)) { - uprintf("Could not acquire WIM index"); + r = wimlib_open_wim(wim_path, 0, &wim); + if (r != 0) { + uprintf("Could not open WIM: %d", r); goto out; } - - xml_len = read_file(xml_file, (uint8_t**)&xml); - if (xml_len == 0) { - uprintf("Could not read WIM XML"); + r = wimlib_get_xml_data(wim, (void**)&xml, &xml_len); + if (r != 0) { + uprintf("Could not read WIM XML index: %d", r); goto out; } @@ -671,15 +641,13 @@ int SetWinToGoIndex(void) Notification(MSG_INFO, NULL, &more_info, lmprintf(MSG_128, "Windows To Go"), lmprintf(MSG_133)); } } - StrArrayDestroy(&version_name); - StrArrayDestroy(&version_index); out: - ezxml_free(index); + StrArrayDestroy(&version_name); + StrArrayDestroy(&version_index); free(xml); - DeleteFileU(xml_file); - if (!img_report.is_windows_img) - VhdUnmountImage(); + ezxml_free(index); + wimlib_free(wim); return wintogo_index; } @@ -695,7 +663,7 @@ out: /// <returns>TRUE on success, FALSE on error.</returns> BOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp) { - char *mounted_iso, *ms_efi = NULL, mounted_image_path[128], cmd[MAX_PATH]; + char *ms_efi = NULL, wim_path[MAX_PATH], cmd[MAX_PATH]; ULONG cluster_size; uprintf("Windows To Go mode selected"); @@ -705,28 +673,19 @@ BOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp) return FALSE; } + static_strcpy(wim_path, image_path); if (!img_report.is_windows_img) { - mounted_iso = VhdMountImage(image_path); - if (mounted_iso == NULL) { - uprintf("Could not mount ISO for Windows To Go installation"); - ErrorStatus = RUFUS_ERROR(APPERR(ERROR_ISO_EXTRACT)); - return FALSE; - } - static_sprintf(mounted_image_path, "%s%s", mounted_iso, &img_report.wininst_path[wininst_index][2]); - uprintf("Mounted ISO as '%s'", mounted_iso); + static_strcat(wim_path, "|"); + static_strcat(wim_path, &img_report.wininst_path[wininst_index][3]); } // Now we use the WIM API to apply that image - if (!WimApplyImage(img_report.is_windows_img ? image_path : mounted_image_path, wintogo_index, drive_name)) { + if (!WimApplyImage(wim_path, wintogo_index, drive_name)) { uprintf("Failed to apply Windows To Go image"); if (!IS_ERROR(ErrorStatus)) ErrorStatus = RUFUS_ERROR(APPERR(ERROR_ISO_EXTRACT)); - if (!img_report.is_windows_img) - VhdUnmountImage(); return FALSE; } - if (!img_report.is_windows_img) - VhdUnmountImage(); if (use_esp) { uprintf("Setting up EFI System Partition"); @@ -745,7 +704,7 @@ BOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp) // completely neuter it) and IVdsDiskPartitionMF::FormatPartitionEx(), which is what you are supposed to // use for ESPs, explicitly states: "This method cannot be used to format removable media." if (!FormatPartition(DriveIndex, SelectedDrive.Partition[partition_index[PI_ESP]].Offset, cluster_size, FS_FAT32, "", - FP_QUICK | FP_FORCE | FP_LARGE_FAT32 | FP_NO_BOOT)) { + FP_QUICK | FP_FORCE | FP_LARGE_FAT32 | FP_NO_BOOT | FP_NO_PROGRESS)) { uprintf("Could not format EFI System Partition"); return FALSE; } @@ -778,7 +737,7 @@ BOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp) CopySKUSiPolicy((use_esp) ? ms_efi : drive_name); - UpdateProgressWithInfo(OP_FILE_COPY, MSG_267, wim_proc_files + 2 * wim_extra_files, wim_nb_files); + UpdateProgressWithInfo(OP_FILE_COPY, MSG_267, 99, 100); // Setting internal drives offline for Windows To Go is crucial if, for instance, you are using ReFS // on Windows 10 (therefore ReFS v3.4) and don't want a Windows 11 To Go boot to automatically @@ -800,7 +759,7 @@ BOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp) uprintf(cmd); RunCommand(cmd, sysnative_dir, usb_debug); - UpdateProgressWithInfo(OP_FILE_COPY, MSG_267, wim_nb_files, wim_nb_files); + UpdateProgressWithInfo(OP_FILE_COPY, MSG_267, 100, 100); if (use_esp) { Sleep(200); @@ -819,22 +778,25 @@ BOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp) BOOL ApplyWindowsCustomization(char drive_letter, int flags) // NB: Work with a copy of unattend_xml_flags as a paremeter since we will modify it. { - BOOL r = FALSE, is_hive_mounted = FALSE; - int i, wim_index = 2; + BOOL r = FALSE, is_hive_mounted = FALSE, update_boot_wim = FALSE; + int i, wim_index = 2, wuc_index = 0; const char* offline_hive_name = "RUFUS_OFFLINE_HIVE"; char boot_wim_path[] = "?:\\sources\\boot.wim", key_path[64]; + char tmp_dir[2][MAX_PATH] = { "", "" }; char appraiserres_dll_src[] = "?:\\sources\\appraiserres.dll"; char appraiserres_dll_dst[] = "?:\\sources\\appraiserres.bak"; char setup_exe[] = "?:\\setup.exe"; char setup_dll[] = "?:\\setup.dll"; char md5sum_path[] = "?:\\md5sum.txt"; - char *mount_path = NULL, path[MAX_PATH]; + char path[MAX_PATH]; uint8_t* buf = NULL; uint16_t setup_arch; HKEY hKey = NULL, hSubKey = NULL; LSTATUS status; DWORD dwDisp, dwVal = 1, dwSize; FILE* fd_md5sum; + WIMStruct* wim; + struct wimlib_update_command wuc[2] = { 0 }; assert(unattend_xml_path != NULL); uprintf("Applying Windows customization:"); @@ -912,30 +874,43 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) } UpdateProgressWithInfoForce(OP_PATCH, MSG_325, 0, PATCH_PROGRESS_TOTAL); - // We only need to mount boot.wim if we have windowsPE data to deal with. If - // not, we can just copy our unattend.xml in \sources\$OEM$\$$\Panther\. - // We also need to mount it if we use the 'Windows UEFI CA 2023' signed bootloaders. + // We only need to alter boot.wim if we have windowsPE data to deal with. + // If not, we can just copy our unattend.xml in \sources\$OEM$\$$\Panther\. + // We also need to do so if we use the 'Windows UEFI CA 2023' signed bootloaders. if (flags & UNATTEND_WINPE_SETUP_MASK || flags & UNATTEND_USE_MS2023_BOOTLOADERS) { if (validate_md5sum) md5sum_totalbytes -= _filesizeU(boot_wim_path); - uprintf("Mounting '%s[%d]'...", boot_wim_path, wim_index); // Some "unofficial" ISOs have a modified boot.wim that doesn't have Windows Setup at index 2... - if (!WimIsValidIndex(boot_wim_path, wim_index)) { + // TODO: we could try to look for "Microsoft Windows Setup" in the XML DESCRIPTION to locate the index + wimlib_global_init(0); + wimlib_set_print_errors(true); + update_boot_wim = (wimlib_open_wimU(boot_wim_path, WIMLIB_OPEN_FLAG_WRITE_ACCESS, &wim) == 0); + if (!update_boot_wim) { + uprintf("Could not open '%s'", boot_wim_path); + goto out; + } + // Setup image should be index 2 + if (wimlib_resolve_image(wim, L"2") != 2) { uprintf("WARNING: This image appears to be an UNOFFICIAL Windows ISO!"); uprintf("Rufus recommends that you only use OFFICIAL retail Microsoft Windows images, such as"); uprintf("the ones that can be downloaded through the download facility of this application."); wim_index = 1; } - mount_path = WimMountImage(boot_wim_path, wim_index); - if (mount_path == NULL) - goto out; } if (flags & UNATTEND_SECUREBOOT_TPM_MINRAM) { + char tmp_path[MAX_PATH]; + const char* reg_path = "Windows\\System32\\config\\SYSTEM"; + if (GetTempDirNameU(temp_dir, APPLICATION_NAME, 0, tmp_dir[0]) == 0) { + uprintf("WARNING: Could not create temp dir for registry changes"); + goto copy_unattend; + } + static_sprintf(tmp_path, "%s\\SYSTEM", tmp_dir[0]); // Try to create the registry keys directly, and fallback to using unattend // if that fails (which the Windows Store version is expected to do). - static_sprintf(path, "%s\\Windows\\System32\\config\\SYSTEM", mount_path); - if (!MountRegistryHive(HKEY_LOCAL_MACHINE, offline_hive_name, path)) { + if (wimlib_extract_pathsU(wim, wim_index, tmp_dir[0], &reg_path, 1, + WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE) != 0 || + !MountRegistryHive(HKEY_LOCAL_MACHINE, offline_hive_name, tmp_path)) { uprintf("Falling back to creating the registry keys through unattend.xml"); goto copy_unattend; } @@ -968,6 +943,11 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) } uprintf("Created 'HKLM\\SYSTEM\\Setup\\LabConfig\\%s' registry key", bypass_name[i]); } + wuc[wuc_index].op = WIMLIB_UPDATE_OP_ADD; + wuc[wuc_index].add.fs_source_path = utf8_to_wchar(tmp_path); + wuc[wuc_index].add.wim_target_path = L"Windows\\System32\\config\\SYSTEM"; + wuc_index++; + // We were successfull in creating the keys so disable the windowsPE section from unattend.xml // We do this by replacing '<settings pass="windowsPE">' with '<settings pass="disabled">' // (provided that the registry key creation was the only item for this pass) @@ -989,14 +969,13 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) // If we have a windowsPE section, copy the answer files to the root of boot.wim as // Autounattend.xml. This also results in that file being automatically copied over // to %WINDIR%\Panther\unattend.xml for later passes processing. - if_not_assert(mount_path != NULL) + if_not_assert(update_boot_wim) goto out; - static_sprintf(path, "%s\\Autounattend.xml", mount_path); - if (!CopyFileU(unattend_xml_path, path, TRUE)) { - uprintf("Could not create boot.wim 'Autounattend.xml': %s", WindowsErrorString()); - goto out; - } - uprintf("Added 'Autounattend.xml' to '%s'", boot_wim_path); + wuc[wuc_index].op = WIMLIB_UPDATE_OP_ADD; + wuc[wuc_index].add.fs_source_path = utf8_to_wchar(unattend_xml_path); + wuc[wuc_index].add.wim_target_path = L"Autounattend.xml"; + uprintf("Added '%S' to '%s'", wuc[wuc_index].add.wim_target_path, boot_wim_path); + wuc_index++; } else { // If there is no windowsPE section in our unattend, then copying it as Autounattend.xml on // the root of boot.wim will not work as Windows Setup does *NOT* carry Autounattend.xml into @@ -1021,57 +1000,50 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) } if (flags & UNATTEND_USE_MS2023_BOOTLOADERS) { - if_not_assert(mount_path != NULL) + StrArray files; + char tmp_dir2[MAX_PATH], *rep; + const char* efi_ex_path = "Windows\\Boot\\EFI_EX"; + if_not_assert(update_boot_wim) goto out; - static_sprintf(path, "%s\\Windows\\Boot\\EFI_EX\\bootmgfw_EX.efi", mount_path); - if (!PathFileExistsU(path)) { - uprintf("Could not find 2023 signed UEFI bootloader - Ignoring option"); + if (GetTempDirNameU(temp_dir, APPLICATION_NAME, 0, tmp_dir[1]) == 0) { + uprintf("WARNING: Could not create temp dir for 2023 signed UEFI bootloaders"); + goto out; + } + if (wimlib_extract_pathsU(wim, wim_index, tmp_dir[1], &efi_ex_path, 1, + WIMLIB_EXTRACT_FLAG_NO_ACLS | WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE) != 0) { + uprintf("Could not find 2023 signed UEFI bootloaders - Ignoring option"); } else { - char path2[MAX_PATH], *rep; - StrArray files, dirs; + static_strcat(tmp_dir[1], "\\EFI"); + static_sprintf(tmp_dir2, "%s_EX", tmp_dir[1]); + MoveFileU(tmp_dir2, tmp_dir[1]); + StrArrayCreate(&files, 64); + ListDirectoryContent(&files, tmp_dir[1], LIST_DIR_TYPE_FILE | LIST_DIR_TYPE_RECURSIVE); + for (i = 0; i < (int)files.Index; i++) { + rep = remove_substr(files.String[i], "_EX"); + assert(rep != NULL); + if (!MoveFileU(files.String[i], rep)) + uprintf("WARNING: Could not rename '%s': %s", files.String[i], WindowsErrorString()); + safe_free(rep); + } + StrArrayDestroy(&files); // Replace /EFI/Boot/boot###.efi for (i = 1; i < ARRAYSIZE(efi_archname); i++) { - static_sprintf(path2, "%c:\\efi\\boot\\boot%s.efi", drive_letter, efi_archname[i]); - if (!PathFileExistsA(path2)) + static_sprintf(tmp_dir2, "%c:\\efi\\boot\\boot%s.efi", drive_letter, efi_archname[i]); + if (!PathFileExistsA(tmp_dir2)) continue; - if (!CopyFileU(path, path2, FALSE)) + static_sprintf(path, "%s\\bootmgfw.efi", tmp_dir[1]); + if (!CopyFileU(path, tmp_dir2, FALSE)) uprintf("WARNING: Could not replace 'boot%s.efi': %s", efi_archname[i], WindowsErrorString()); break; } // Replace /bootmgr.efi - static_sprintf(path, "%s\\Windows\\Boot\\EFI_EX\\bootmgr_EX.efi", mount_path); - static_sprintf(path2, "%c:\\bootmgr.efi", drive_letter); - if (!CopyFileU(path, path2, FALSE)) + static_sprintf(path, "%s\\bootmgr.efi", tmp_dir[1]); + if (!CopyFileU(path, tmp_dir2, FALSE)) uprintf("WARNING: Could not replace 'bootmgr.efi': %s", WindowsErrorString()); - // Microsoft "secures" the Windows\Boot\ dir through their SUPER OBNOXIOUS AND - // WORTHLESS use of DACLs + read-only flags, so we first need to re-take control - // of all directories under there recursively. - StrArrayCreate(&dirs, 64); - StrArrayCreate(&files, 64); - static_sprintf(path, "%s\\Windows\\Boot\\", mount_path); - StrArrayAdd(&dirs, path, TRUE); - static_sprintf(path, "%s\\Windows\\Boot\\EFI_EX\\", mount_path); - StrArrayAdd(&dirs, path, TRUE); - ListDirectoryContent(&dirs, path, LIST_DIR_TYPE_DIRECTORY | LIST_DIR_TYPE_RECURSIVE); - for (i = 0; i < (int)dirs.Index; i++) { - rep = remove_substr(dirs.String[i], "_EX"); - assert(rep != NULL); - TakeOwnership(rep); - safe_free(rep); - } - // Now that we should be able to write to the destination directories, copy the content. - ListDirectoryContent(&files, path, LIST_DIR_TYPE_FILE | LIST_DIR_TYPE_RECURSIVE); - for (i = 0; i < (int)files.Index; i++) { - rep = remove_substr(files.String[i], "_EX"); - assert(rep != NULL); - TakeOwnership(rep); - if (!CopyFileU(files.String[i], rep, FALSE) && rep != NULL) - uprintf("WARNING: Could not replace '%s': %s", &rep[strlen(mount_path) + 1], WindowsErrorString()); - safe_free(rep); - } - StrArrayDestroy(&dirs); - StrArrayDestroy(&files); - uprintf("Replaced EFI bootloader files with 'Windows UEFI CA 2023' signed versions"); + if (wimlib_add_treeU(wim, wim_index, tmp_dir[1], "Windows\\Boot\\EFI", 0)) + uprintf("WARNING: Could not replace EFI bootloader files with 'Windows UEFI CA 2023' versions"); + else + uprintf("Replaced EFI bootloader files with 'Windows UEFI CA 2023' signed versions"); } } @@ -1086,15 +1058,25 @@ out: UnmountRegistryHive(HKEY_LOCAL_MACHINE, offline_hive_name); UpdateProgressWithInfoForce(OP_PATCH, MSG_325, 104, PATCH_PROGRESS_TOTAL); } - if (mount_path) { - uprintf("Unmounting '%s[%d]'...", boot_wim_path, wim_index); - WimUnmountImage(boot_wim_path, wim_index, TRUE); + if (update_boot_wim) { + uprintf("Updating '%s[%d]'...", boot_wim_path, wim_index); + if (wimlib_update_image(wim, wim_index, wuc, wuc_index, 0) != 0 || + wimlib_overwrite(wim, WIMLIB_WRITE_FLAG_RECOMPRESS, 0) != 0) { + uprintf("Error: Failed to update %s", boot_wim_path); + r = FALSE; + } + for (i = 0; i < ARRAYSIZE(tmp_dir); i++) + if (tmp_dir[i][0]) + SHDeleteDirectoryExU(NULL, tmp_dir[i], FOF_NO_UI); + for (i = 0; i < wuc_index; i++) + free(wuc[i].add.fs_source_path); + wimlib_free(wim); + wimlib_global_cleanup(); if (validate_md5sum) { md5sum_totalbytes += _filesizeU(boot_wim_path); StrArrayAdd(&modified_files, boot_wim_path, TRUE); } UpdateProgressWithInfo(OP_PATCH, MSG_325, PATCH_PROGRESS_TOTAL, PATCH_PROGRESS_TOTAL); } - free(mount_path); return r; } From ea01cd41c0a2e58c1b3341f045f873caaed188bc Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 6 May 2025 01:31:10 +0100 Subject: [PATCH 050/192] [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. --- src/iso.c | 254 +++++++++++++++++++------------------------- src/rufus.c | 9 +- src/rufus.h | 3 +- src/rufus.rc | 10 +- src/stdfn.c | 14 ++- src/stdio.c | 12 ++- src/vhd.c | 70 ++++++++++++ src/vhd.h | 2 + src/wimlib/wimlib.h | 14 +++ 9 files changed, 228 insertions(+), 160 deletions(-) diff --git a/src/iso.c b/src/iso.c index f0f8c552..af4c9938 100644 --- a/src/iso.c +++ b/src/iso.c @@ -44,6 +44,7 @@ #include "rufus.h" #include "ui.h" +#include "vhd.h" #include "drive.h" #include "libfat.h" #include "missing.h" @@ -69,8 +70,6 @@ _Static_assert(256 * KB >= ISO_BLOCKSIZE, "Can't set PROGRESS_THRESHOLD"); CdIo_t* cdio_open (const char* psz_source, driver_id_t driver_id) {return NULL;} void cdio_destroy (CdIo_t* p_cdio) {} -uint32_t GetInstallWimVersion(const char* iso); - typedef struct { BOOLEAN is_cfg; BOOLEAN is_conf; @@ -81,7 +80,10 @@ typedef struct { } EXTRACT_PROPS; RUFUS_IMG_REPORT img_report; +FILE* fd_md5sum = NULL; int64_t iso_blocking_status = -1; +uint64_t total_blocks, extra_blocks, nb_blocks, last_nb_blocks; + extern uint64_t md5sum_totalbytes; extern BOOL preserve_timestamps, enable_ntfs_compression, validate_md5sum; extern HANDLE format_thread; @@ -124,9 +126,7 @@ const char* old_c32_name[NB_OLD_C32] = OLD_C32_NAMES; static const int64_t old_c32_threshold[NB_OLD_C32] = OLD_C32_THRESHOLD; static uint8_t joliet_level = 0; static uint32_t md5sum_size = 0; -static uint64_t total_blocks, extra_blocks, nb_blocks, last_nb_blocks; static BOOL scan_only = FALSE; -static FILE* fd_md5sum = NULL; static StrArray config_path, isolinux_path; static char symlinked_syslinux[MAX_PATH], *md5sum_data = NULL, *md5sum_pos = NULL; @@ -161,6 +161,83 @@ static void log_handler (cdio_log_level_t level, const char *message) uprintf("libcdio: %s", message); } +// Returns TRUE if a path appears in md5sum.txt +static BOOL is_in_md5sum(char* path) +{ + BOOL found = FALSE; + char c[3], * p, * pos = md5sum_pos, * nul_pos; + + // If we are creating the md5sum file from scratch, every file is in it. + if (fd_md5sum != NULL) + return TRUE; + + // If we don't have an existing file at this stage, then no file is in it. + if (md5sum_size == 0 || md5sum_data == NULL) + return FALSE; + + // We should have a "X:/xyz" path + assert(path[1] == ':' && path[2] == '/'); + + // Modify the path to have " ./xyz" + c[0] = path[0]; + c[1] = path[1]; + path[0] = ' '; + path[1] = '.'; + + // Search for the string in the remainder of the md5sum.txt + // NB: md5sum_data is always NUL terminated. + p = strstr(pos, path); + // Cater for the case where we matched a partial string and look for the full one + while (p != NULL && p[strlen(path)] != '\n' && p[strlen(path)] != '\r' && p[strlen(path)] != '\0') { + pos = p + strlen(path); + p = strstr(pos, path); + } + found = (p != NULL); + // If not found in remainder and we have a remainder, loop to search from beginning + if (!found && pos != md5sum_data) { + nul_pos = pos; + c[2] = *nul_pos; + *nul_pos = 0; + p = strstr(md5sum_data, path); + while (p != NULL && p[strlen(path)] != '\n' && p[strlen(path)] != '\r' && p[strlen(path)] != '\0') { + pos = p + strlen(path); + p = strstr(pos, path); + } + *nul_pos = c[2]; + found = (p != NULL); + } + + path[0] = c[0]; + path[1] = c[1]; + if (found) + md5sum_pos = p + strlen(path); + return found; +} + +static void _print_extracted_file(char* psz_fullpath, uint64_t file_length, BOOL split) +{ + size_t nul_pos; + + if (psz_fullpath == NULL) + return; + // Replace slashes with backslashes and append the size to the path for UI display + to_windows_path(psz_fullpath); + nul_pos = strlen(psz_fullpath); + safe_sprintf(&psz_fullpath[nul_pos], 24, " (%s)", SizeToHumanReadable(file_length, TRUE, FALSE)); + uprintf(split ? "Splitting: %s" : "Extracting: %s", psz_fullpath); + safe_sprintf(&psz_fullpath[nul_pos], 24, " (%s)", SizeToHumanReadable(file_length, FALSE, FALSE)); + PrintStatus(0, MSG_000, psz_fullpath); // MSG_000 is "%s" + // Remove the appended size for extraction + psz_fullpath[nul_pos] = 0; + // ISO9660 cannot handle backslashes + to_unix_path(psz_fullpath); + // Update md5sum_totalbytes as needed + if (is_in_md5sum(psz_fullpath)) + md5sum_totalbytes += file_length; +} +#define print_extracted_file(p, l) _print_extracted_file(p, l, FALSE) +#define print_split_file(p, l) _print_extracted_file(p, l, TRUE) + /* * Scan and set ISO properties * Returns true if the the current file does not need to be processed further @@ -169,7 +246,7 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const const char* psz_fullpath, EXTRACT_PROPS *props) { size_t i, j, k, len; - char bootloader_name[32]; + char bootloader_name[32], path[MAX_PATH]; // Check for an isolinux/syslinux config file anywhere memset(props, 0, sizeof(EXTRACT_PROPS)); @@ -216,6 +293,26 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const uprintf("Skipping '%s' file from ISO image", psz_basename); return TRUE; } + + // Split a >4GB install.wim if the target filesystem is FAT + if (file_length >= 4 * GB && psz_dirname != NULL && IS_FAT(fs_type) && img_report.has_4GB_file == 0x81) { + if (safe_stricmp(&psz_dirname[max(0, ((int)safe_strlen(psz_dirname)) - + ((int)strlen(sources_str)))], sources_str) == 0) { + for (i = 0; i < ARRAYSIZE(wininst_name) - 1; i++) { + if (safe_stricmp(psz_basename, wininst_name[i]) == 0 && file_length >= 4 * GB) { + print_split_file((char*)psz_fullpath, file_length); + char* dst = safe_strdup(psz_fullpath); + dst[strlen(dst) - 3] = 's'; + dst[strlen(dst) - 2] = 'w'; + dst[strlen(dst) - 1] = 'm'; + static_sprintf(path, "%s|%s/%s", image_path, psz_dirname, psz_basename); + WimSplitFile(path, dst); + free(dst); + return TRUE; + } + } + } + } } else { // Scan-time checks // Check for GRUB artifacts for (i = 0; i < ARRAYSIZE(grub_dirname); i++) { @@ -327,6 +424,8 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const static_sprintf(img_report.wininst_path[img_report.wininst_index], "?:%s", psz_fullpath); img_report.wininst_index++; + if (file_length >= 4 * GB) + img_report.has_4GB_file |= 0x80; } } } @@ -357,7 +456,7 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const img_report.has_old_c32[i] = TRUE; } if (file_length >= 4 * GB) - img_report.has_4GB_file = TRUE; + img_report.has_4GB_file++; // Compute projected size needed (NB: ISO_BLOCKSIZE = UDF_BLOCKSIZE) if (file_length != 0) total_blocks += (file_length + (ISO_BLOCKSIZE - 1)) / ISO_BLOCKSIZE; @@ -498,81 +597,6 @@ static void fix_config(const char* psz_fullpath, const char* psz_path, const cha free(src); } -// Returns TRUE if a path appears in md5sum.txt -static BOOL is_in_md5sum(char* path) -{ - BOOL found = FALSE; - char c[3], *p, *pos = md5sum_pos, *nul_pos; - - // If we are creating the md5sum file from scratch, every file is in it. - if (fd_md5sum != NULL) - return TRUE; - - // If we don't have an existing file at this stage, then no file is in it. - if (md5sum_size == 0 || md5sum_data == NULL) - return FALSE; - - // We should have a "X:/xyz" path - assert(path[1] == ':' && path[2] == '/'); - - // Modify the path to have " ./xyz" - c[0] = path[0]; - c[1] = path[1]; - path[0] = ' '; - path[1] = '.'; - - // Search for the string in the remainder of the md5sum.txt - // NB: md5sum_data is always NUL terminated. - p = strstr(pos, path); - // Cater for the case where we matched a partial string and look for the full one - while (p != NULL && p[strlen(path)] != '\n' && p[strlen(path)] != '\r' && p[strlen(path)] != '\0') { - pos = p + strlen(path); - p = strstr(pos, path); - } - found = (p != NULL); - // If not found in remainder and we have a remainder, loop to search from beginning - if (!found && pos != md5sum_data) { - nul_pos = pos; - c[2] = *nul_pos; - *nul_pos = 0; - p = strstr(md5sum_data, path); - while (p != NULL && p[strlen(path)] != '\n' && p[strlen(path)] != '\r' && p[strlen(path)] != '\0') { - pos = p + strlen(path); - p = strstr(pos, path); - } - *nul_pos = c[2]; - found = (p != NULL); - } - - path[0] = c[0]; - path[1] = c[1]; - if (found) - md5sum_pos = p + strlen(path); - return found; -} - -static void print_extracted_file(char* psz_fullpath, uint64_t file_length) -{ - size_t nul_pos; - - if (psz_fullpath == NULL) - return; - // Replace slashes with backslashes and append the size to the path for UI display - to_windows_path(psz_fullpath); - nul_pos = strlen(psz_fullpath); - safe_sprintf(&psz_fullpath[nul_pos], 24, " (%s)", SizeToHumanReadable(file_length, TRUE, FALSE)); - uprintf("Extracting: %s", psz_fullpath); - safe_sprintf(&psz_fullpath[nul_pos], 24, " (%s)", SizeToHumanReadable(file_length, FALSE, FALSE)); - PrintStatus(0, MSG_000, psz_fullpath); // MSG_000 is "%s" - // Remove the appended size for extraction - psz_fullpath[nul_pos] = 0; - // ISO9660 cannot handle backslashes - to_unix_path(psz_fullpath); - // Update md5sum_totalbytes as needed - if (is_in_md5sum(psz_fullpath)) - md5sum_totalbytes += file_length; -} - // Convert from time_t to FILETIME // Uses 3 static entries so that we can convert 3 concurrent values at the same time static LPFILETIME __inline to_filetime(time_t t) @@ -1319,7 +1343,8 @@ out: safe_free(tmp); } if (HAS_WININST(img_report)) { - img_report.wininst_version = GetInstallWimVersion(src_iso); + static_sprintf(path, "%s|%s", image_path, &img_report.wininst_path[0][2]); + img_report.wininst_version = GetWimVersion(path); } if (img_report.has_grub2) { char grub_path[128]; @@ -1644,71 +1669,6 @@ out: return ret; } -uint32_t GetInstallWimVersion(const char* iso) -{ - char *wim_path = NULL, buf[UDF_BLOCKSIZE] = { 0 }; - uint32_t* wim_header = (uint32_t*)buf, r = 0xffffffff; - iso9660_t* p_iso = NULL; - udf_t* p_udf = NULL; - udf_dirent_t *p_udf_root = NULL, *p_udf_file = NULL; - iso9660_stat_t *p_statbuf = NULL; - - wim_path = safe_strdup(&img_report.wininst_path[0][2]); - if (wim_path == NULL) - goto out; - // UDF indiscriminately accepts slash or backslash delimiters, - // but ISO-9660 requires slash - to_unix_path(wim_path); - - // First try to open as UDF - fallback to ISO if it failed - p_udf = udf_open(iso); - if (p_udf == NULL) - goto try_iso; - - p_udf_root = udf_get_root(p_udf, true, 0); - if (p_udf_root == NULL) { - uprintf("Could not locate UDF root directory"); - goto out; - } - p_udf_file = udf_fopen(p_udf_root, wim_path); - if (!p_udf_file) { - uprintf("Could not locate file %s in ISO image", wim_path); - goto out; - } - if (udf_read_block(p_udf_file, buf, 1) != UDF_BLOCKSIZE) { - uprintf("Error reading UDF file %s", wim_path); - goto out; - } - r = wim_header[3]; - goto out; - -try_iso: - p_iso = iso9660_open_ext(iso, ISO_EXTENSION_MASK); - if (p_iso == NULL) { - uprintf("Could not open image '%s'", iso); - goto out; - } - p_statbuf = iso9660_ifs_stat_translate(p_iso, wim_path); - if (p_statbuf == NULL) { - uprintf("Could not get ISO-9660 file information for file %s", wim_path); - goto out; - } - if (iso9660_iso_seek_read(p_iso, buf, p_statbuf->lsn, 1) != ISO_BLOCKSIZE) { - uprintf("Error reading ISO-9660 file %s at LSN %d", wim_path, p_statbuf->lsn); - goto out; - } - r = wim_header[3]; - -out: - iso9660_stat_free(p_statbuf); - udf_dirent_free(p_udf_root); - udf_dirent_free(p_udf_file); - iso9660_close(p_iso); - udf_close(p_udf); - safe_free(wim_path); - return bswap_uint32(r); -} - #define ISO_NB_BLOCKS 16 typedef struct { iso9660_t* p_iso; diff --git a/src/rufus.c b/src/rufus.c index d316d991..8d22a9c4 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -188,8 +188,8 @@ static void SetAllowedFileSystems(void) break; case BT_IMAGE: allowed_filesystem[FS_NTFS] = TRUE; - // Don't allow anything besides NTFS if the image has a >4GB file or explicitly requires NTFS - if ((image_path != NULL) && (img_report.has_4GB_file || img_report.needs_ntfs)) + // Don't allow anything besides NTFS if the image is not compatible + if ((image_path != NULL) && !IS_FAT32_COMPAT(img_report)) break; if (!HAS_WINDOWS(img_report) || (target_type != TT_BIOS) || allow_dual_uefi_bios) { if (!HAS_WINTOGO(img_report) || (ComboBox_GetCurItemData(hImageOption) != IMOP_WIN_TO_GO)) { @@ -1561,7 +1561,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) MessageBoxExU(hMainDialog, lmprintf(MSG_189), lmprintf(MSG_099), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); goto out; } - if ((IS_FAT(fs_type)) && (img_report.has_4GB_file)) { + if (IS_FAT(fs_type) && !IS_FAT32_COMPAT(img_report)) { // This ISO image contains a file larger than 4GB file (FAT32) MessageBoxExU(hMainDialog, lmprintf(MSG_100), lmprintf(MSG_099), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); goto out; @@ -3841,7 +3841,7 @@ extern int TestHashes(void); if (no_focus) continue; - // Alt +/- => Increase or decrease thread priority for format/file-copy/wim-apply operations + // Alt +/- => Increase or decrease thread priority for format/file-copy operations if ((msg.message == WM_SYSKEYDOWN) && ((msg.wParam == VK_OEM_PLUS) || (msg.wParam == VK_OEM_MINUS) || (msg.wParam == VK_ADD) || (msg.wParam == VK_SUBTRACT))) { int delta = ((msg.wParam == VK_OEM_PLUS) || (msg.wParam == VK_ADD)) ? +1 : -1; @@ -3912,6 +3912,7 @@ extern int TestHashes(void); WriteSettingBool(SETTING_ENABLE_WIN_DUAL_EFI_BIOS, allow_dual_uefi_bios); PrintStatusTimeout(lmprintf(MSG_266), allow_dual_uefi_bios); SetPartitionSchemeAndTargetSystem(FALSE); + SetFileSystemAndClusterSize(NULL); continue; } // Alt-F => Toggle detection of USB HDDs diff --git a/src/rufus.h b/src/rufus.h index f5e1e821..174e2a64 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -369,6 +369,7 @@ enum EFI_BOOT_TYPE { #define HAS_WIN7_EFI(r) ((r.has_efi == 1) && HAS_WININST(r)) #define IS_WINDOWS_1X(r) (r.has_bootmgr_efi && (r.win_version.major >= 10)) #define IS_WINDOWS_11(r) (r.has_bootmgr_efi && (r.win_version.major >= 11)) +#define IS_FAT32_COMPAT(r) ((r.has_4GB_file == 0 || (r.has_4GB_file == 0x81 && allow_dual_uefi_bios)) && !r.needs_ntfs) #define HAS_EFI_IMG(r) (r.efi_img_path[0] != 0) #define IS_DD_BOOTABLE(r) (r.is_bootable_img > 0) #define IS_DD_ONLY(r) ((r.is_bootable_img > 0) && (!r.is_iso || r.disable_iso)) @@ -437,7 +438,7 @@ typedef struct { uint8_t has_md5sum; uint8_t wininst_index; uint8_t has_symlinks; - BOOLEAN has_4GB_file; + uint8_t has_4GB_file; BOOLEAN has_long_filename; BOOLEAN has_deep_directories; BOOLEAN has_bootmgr; diff --git a/src/rufus.rc b/src/rufus.rc index 4a540eaf..d81117d8 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.8.2240" +CAPTION "Rufus 4.8.2241" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2240,0 - PRODUCTVERSION 4,8,2240,0 + FILEVERSION 4,8,2241,0 + PRODUCTVERSION 4,8,2241,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2240" + VALUE "FileVersion", "4.8.2241" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2240" + VALUE "ProductVersion", "4.8.2241" END END BLOCK "VarFileInfo" diff --git a/src/stdfn.c b/src/stdfn.c index c299967b..0798fa21 100644 --- a/src/stdfn.c +++ b/src/stdfn.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Standard Windows function calls - * Copyright © 2013-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2013-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -885,7 +885,17 @@ next_progress_line: }; } else { // TODO: Detect user cancellation here? - WaitForSingleObject(pi.hProcess, INFINITE); + switch (WaitForSingleObject(pi.hProcess, 1800000)) { + case WAIT_TIMEOUT: + uprintf("Command did not terminate within timeout duration"); + break; + case WAIT_OBJECT_0: + uprintf("Command was terminated by user"); + break; + default: + uprintf("Error while waiting for command to be terminated: %s", WindowsErrorString()); + break; + } } if (!GetExitCodeProcess(pi.hProcess, &ret)) diff --git a/src/stdio.c b/src/stdio.c index e42c63f2..5fa01f12 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -579,7 +579,17 @@ HANDLE CreateFileWithTimeout(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwS if (hThread != NULL) { if (WaitForSingleObject(hThread, dwTimeOut) == WAIT_TIMEOUT) { CancelSynchronousIo(hThread); - WaitForSingleObject(hThread, 30000); + switch (WaitForSingleObject(hThread, 30000)) { + case WAIT_TIMEOUT: + uprintf("File was not created within timeout duration"); + break; + case WAIT_OBJECT_0: + uprintf("File creation aborted by user"); + break; + default: + uprintf("Error while waiting for file to ne created: %s", WindowsErrorString()); + break; + } params.dwError = WAIT_TIMEOUT; } CloseHandle(hThread); diff --git a/src/vhd.c b/src/vhd.c index 1d5c4462..ef39afd7 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -49,10 +49,13 @@ extern char* save_image_type; extern BOOL ignore_boot_marker, has_ffu_support; extern RUFUS_DRIVE rufus_drive[MAX_DRIVES]; extern HANDLE format_thread; +extern FILE* fd_md5sum; +extern uint64_t total_blocks, extra_blocks, nb_blocks, last_nb_blocks; static char physical_path[128] = ""; static int progress_op = OP_FILE_COPY, progress_msg = MSG_267; static HANDLE mounted_handle = INVALID_HANDLE_VALUE; +static struct wimlib_progress_info_split last_split_progress; typedef struct { const char* ext; @@ -239,6 +242,29 @@ static enum wimlib_progress_status WimProgressFunc(enum wimlib_progress_msg msg_ if (info->extract.current_file_count >= info->extract.end_file_count) uprintf("\n"); break; + case WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART: + last_split_progress = info->split; + uprintf("● %S", info->split.part_name); + break; + case WIMLIB_PROGRESS_MSG_SPLIT_END_PART: + if (fd_md5sum != NULL) { + // Don't bother computing the hash at write time - just do it post creation + uint8_t sum[MD5_HASHSIZE]; + char* filename = wchar_to_utf8(info->split.part_name); + if (filename != NULL) { + HashFile(HASH_MD5, filename, sum); + for (int j = 0; j < MD5_HASHSIZE; j++) + fprintf(fd_md5sum, "%02x", sum[j]); + fprintf(fd_md5sum, " ./%s\n", &filename[3]); + free(filename); + } + } + break; + case WIMLIB_PROGRESS_MSG_WRITE_STREAMS: + uint64_t completed_bytes = last_split_progress.completed_bytes + info->write_streams.completed_compressed_bytes; + nb_blocks = last_nb_blocks + completed_bytes / 2048; + UpdateProgressWithInfo(OP_FILE_COPY, MSG_231, nb_blocks, total_blocks + extra_blocks); + break; default: break; } @@ -246,6 +272,27 @@ static enum wimlib_progress_status WimProgressFunc(enum wimlib_progress_msg msg_ return WIMLIB_PROGRESS_STATUS_CONTINUE; } +// Return the WIM version of an image +uint32_t GetWimVersion(const char* image) +{ + int r; + WIMStruct* wim; + struct wimlib_wim_info info; + + if (image == NULL) + return 0; + + r = wimlib_open_wimU(image, 0, &wim); + if (r == 0) { + r = wimlib_get_wim_info(wim, &info); + wimlib_free(wim); + if (r == 0) + return info.wim_version; + } + uprintf("WARNING: Could not get WIM version: Error %d", r); + return 0; +} + // Extract a file from a WIM image. Returns the allocated path of the extracted file or NULL on error. BOOL WimExtractFile(const char* image, int index, const char* src, const char* dst) { @@ -283,6 +330,29 @@ out: return (r == 0); } +// Split an install.wim for FAT32 limits +BOOL WimSplitFile(const char* src, const char* dst) +{ + int r = 1; + WIMStruct* wim; + + if ((src == NULL) || (dst == NULL)) + goto out; + + wimlib_global_init(0); + wimlib_set_print_errors(true); + r = wimlib_open_wimU(src, 0, &wim); + if (r == 0) { + wimlib_register_progress_function(wim, WimProgressFunc, NULL); + r = wimlib_splitU(wim, dst, 4094ULL * MB, WIMLIB_WRITE_FLAG_FSYNC); + wimlib_free(wim); + } + wimlib_global_cleanup(); + +out: + return (r == 0); +} + BOOL WimApplyImage(const char* image, int index, const char* dst) { int r = 1; diff --git a/src/vhd.h b/src/vhd.h index 4bf274d0..fccf4ca7 100644 --- a/src/vhd.h +++ b/src/vhd.h @@ -109,8 +109,10 @@ enum WIMMessage { WIM_MSG_ABORT_IMAGE = -1 }; +extern uint32_t GetWimVersion(const char* image); extern BOOL WimExtractFile(const char* wim_image, int index, const char* src, const char* dst); extern BOOL WimApplyImage(const char* image, int index, const char* dst); +extern BOOL WimSplitFile(const char* src, const char* dst); extern int8_t IsBootableImage(const char* path); extern char* VhdMountImageAndGetSize(const char* path, uint64_t* disksize); #define VhdMountImage(path) VhdMountImageAndGetSize(path, NULL) diff --git a/src/wimlib/wimlib.h b/src/wimlib/wimlib.h index 7b2b6992..18cf7ef4 100644 --- a/src/wimlib/wimlib.h +++ b/src/wimlib/wimlib.h @@ -4434,6 +4434,20 @@ wimlib_split(WIMStruct *wim, uint64_t part_size, int write_flags); +#ifdef _RUFUS +static __inline int +wimlib_splitU(WIMStruct *wim, + const char *swm_name, + uint64_t part_size, + int write_flags) +{ + wconvert(swm_name); + int r = wimlib_split(wim, wswm_name, part_size, write_flags); + wfree(swm_name); + return r; +} +#endif + /** * @ingroup G_general * From 965759f58a754f0535cec4f795cfd383ecbfc945 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 6 May 2025 18:43:35 +0100 Subject: [PATCH 051/192] [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. --- src/rufus.c | 8 +++++ src/rufus.rc | 10 +++---- src/wimlib/dentry.c | 8 +++-- src/wimlib/extract.c | 1 + src/wimlib/integrity.c | 2 ++ src/wimlib/lcpit_matchfinder.c | 1 + src/wimlib/lzms_compress.c | 2 ++ src/wimlib/lzx_compress.c | 1 + src/wimlib/sha1.c | 4 ++- src/wimlib/wim.c | 28 +++++++++--------- src/wimlib/wimboot.c | 1 + src/wimlib/wimlib/compiler.h | 13 ++++---- src/wimlib/win32_capture.c | 4 +-- src/wimlib/win32_vss.c | 54 +++++++++++++++++++++------------- src/wimlib/xmlproc.c | 3 +- src/xml.c | 8 ++--- 16 files changed, 91 insertions(+), 57 deletions(-) diff --git a/src/rufus.c b/src/rufus.c index 8d22a9c4..ea0a87fe 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -22,6 +22,14 @@ #include <crtdbg.h> #endif +// Temporary workaround for MinGW32 delay-loading +// See https://github.com/pbatard/rufus/pull/2513 as well as +// https://sourceware.org/bugzilla/show_bug.cgi?id=14339 +#if defined(__MINGW32__) +#undef DECLSPEC_IMPORT +#define DECLSPEC_IMPORT __attribute__((visibility("hidden"))) +#endif + #include <windows.h> #include <windowsx.h> #include <stdlib.h> diff --git a/src/rufus.rc b/src/rufus.rc index d81117d8..50716e2f 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.8.2241" +CAPTION "Rufus 4.8.2242" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2241,0 - PRODUCTVERSION 4,8,2241,0 + FILEVERSION 4,8,2242,0 + PRODUCTVERSION 4,8,2242,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2241" + VALUE "FileVersion", "4.8.2242" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2241" + VALUE "ProductVersion", "4.8.2242" END END BLOCK "VarFileInfo" diff --git a/src/wimlib/dentry.c b/src/wimlib/dentry.c index 2666fa72..e7dac23e 100644 --- a/src/wimlib/dentry.c +++ b/src/wimlib/dentry.c @@ -490,7 +490,10 @@ calculate_dentry_full_path(struct wim_dentry *dentry) d = d->d_parent; /* assumes d == d->d_parent for root */ } while (!dentry_is_root(d)); - utf16lechar* ubuf = alloca(ulen * sizeof(utf16lechar)); + // +1 to keep Coverity happy + utf16lechar *ubuf = alloca((ulen + 1) * sizeof(utf16lechar)); + if (!ubuf) + return WIMLIB_ERR_NOMEM; utf16lechar *p = &ubuf[ulen]; d = dentry; @@ -518,7 +521,8 @@ calculate_dentry_full_path(struct wim_dentry *dentry) tchar * dentry_full_path(struct wim_dentry *dentry) { - calculate_dentry_full_path(dentry); + if (calculate_dentry_full_path(dentry)) + return NULL; return dentry->d_full_path; } diff --git a/src/wimlib/extract.c b/src/wimlib/extract.c index ecb558c4..5c18da5b 100644 --- a/src/wimlib/extract.c +++ b/src/wimlib/extract.c @@ -390,6 +390,7 @@ create_temporary_file(struct filedes *fd_ret, tchar **name_ret) #ifdef _WIN32 retry: + // coverity[secure_temp] name = _wtempnam(NULL, L"wimlib"); if (!name) { ERROR_WITH_ERRNO("Failed to create temporary filename"); diff --git a/src/wimlib/integrity.c b/src/wimlib/integrity.c index 1f022123..320e51e6 100644 --- a/src/wimlib/integrity.c +++ b/src/wimlib/integrity.c @@ -76,6 +76,8 @@ calculate_chunk_sha1(struct filedes *in_fd, size_t this_chunk_size, "integrity checksums"); return ret; } + // I have no idea what Coverity is hallucinating with here... + // coverity[overrun-call] sha1_update(&ctx, buf, bytes_to_read); bytes_remaining -= bytes_to_read; offset += bytes_to_read; diff --git a/src/wimlib/lcpit_matchfinder.c b/src/wimlib/lcpit_matchfinder.c index 33dfb701..fce6073a 100644 --- a/src/wimlib/lcpit_matchfinder.c +++ b/src/wimlib/lcpit_matchfinder.c @@ -587,6 +587,7 @@ bool lcpit_matchfinder_init(struct lcpit_matchfinder *mf, size_t max_bufsize, u32 min_match_len, u32 nice_match_len) { + // coverity[dead_error_condition] if (lcpit_matchfinder_get_needed_memory(max_bufsize) > SIZE_MAX) return false; if (max_bufsize > MAX_HUGE_BUFSIZE - PREFETCH_SAFETY) diff --git a/src/wimlib/lzms_compress.c b/src/wimlib/lzms_compress.c index 72e18f74..74e6d298 100644 --- a/src/wimlib/lzms_compress.c +++ b/src/wimlib/lzms_compress.c @@ -1971,8 +1971,10 @@ begin: if (next_item_idx < 0) break; if (next_item_idx == 0) + // coverity[assigned_value] item_to_take = cur_node->item; else + // coverity[assigned_value] item_to_take = cur_node->extra_items[next_item_idx - 1]; --next_item_idx; } diff --git a/src/wimlib/lzx_compress.c b/src/wimlib/lzx_compress.c index 69039b09..89dfade0 100644 --- a/src/wimlib/lzx_compress.c +++ b/src/wimlib/lzx_compress.c @@ -1452,6 +1452,7 @@ lzx_walk_item_list(struct lzx_compressor *c, u32 block_size, bool is_16_bit, /* Tally/record a match. */ matchlen = item & OPTIMUM_LEN_MASK; adjusted_offset = item >> OPTIMUM_OFFSET_SHIFT; + // coverity[overrun-call] mainsym = lzx_tally_main_and_lensyms(c, matchlen, adjusted_offset, is_16_bit); diff --git a/src/wimlib/sha1.c b/src/wimlib/sha1.c index 14b68239..1a9486b0 100644 --- a/src/wimlib/sha1.c +++ b/src/wimlib/sha1.c @@ -610,7 +610,9 @@ sha1_final(struct sha1_ctx *ctx, u8 hash[SHA1_HASH_SIZE]) ctx->buffer[buffered++] = 0x80; if (buffered > SHA1_BLOCK_SIZE - 8) { - memset(&ctx->buffer[buffered], 0, SHA1_BLOCK_SIZE - buffered); + // Keep Coverity happy + if (buffered != SHA1_BLOCK_SIZE) + memset(&ctx->buffer[buffered], 0, SHA1_BLOCK_SIZE - buffered); sha1_blocks(ctx->h, ctx->buffer, 1); buffered = 0; } diff --git a/src/wimlib/wim.c b/src/wimlib/wim.c index f1a5fa5c..287d3056 100644 --- a/src/wimlib/wim.c +++ b/src/wimlib/wim.c @@ -1044,8 +1044,8 @@ wimlib_get_version_string(void) return T(PACKAGE_VERSION); } +static volatile uint16_t lib_initialization_mutex = 0; static bool lib_initialized = false; -static struct mutex lib_initialization_mutex = MUTEX_INITIALIZER; /* API function documented in wimlib.h */ WIMLIBAPI int @@ -1053,11 +1053,13 @@ wimlib_global_init(int init_flags) { int ret = 0; - if (lib_initialized) - goto out; - - mutex_init(&lib_initialization_mutex); - mutex_lock(&lib_initialization_mutex); + // Non problematic init/cleanup mutex (Windows only) to keep static + // analysers happy. Only one thread at a time can run the code between + // initial InterlockedIncrement and ending InterlockedDecrement. + while (InterlockedIncrement16(&lib_initialization_mutex) >= 2) { + InterlockedDecrement16(&lib_initialization_mutex); + Sleep(100); + } if (lib_initialized) goto out_unlock; @@ -1095,8 +1097,7 @@ wimlib_global_init(int init_flags) lib_initialized = true; ret = 0; out_unlock: - mutex_unlock(&lib_initialization_mutex); -out: + InterlockedDecrement16(&lib_initialization_mutex); return ret; } @@ -1104,10 +1105,10 @@ out: WIMLIBAPI void wimlib_global_cleanup(void) { - if (!lib_initialized) - return; - - mutex_lock(&lib_initialization_mutex); + while (InterlockedIncrement16(&lib_initialization_mutex) >= 2) { + InterlockedDecrement16(&lib_initialization_mutex); + Sleep(100); + } if (!lib_initialized) goto out_unlock; @@ -1120,6 +1121,5 @@ wimlib_global_cleanup(void) lib_initialized = false; out_unlock: - mutex_unlock(&lib_initialization_mutex); - mutex_destroy(&lib_initialization_mutex); + InterlockedDecrement16(&lib_initialization_mutex); } diff --git a/src/wimlib/wimboot.c b/src/wimlib/wimboot.c index 115a5699..71580397 100644 --- a/src/wimlib/wimboot.c +++ b/src/wimlib/wimboot.c @@ -809,6 +809,7 @@ update_wimoverlay_manually(const wchar_t *drive, const wchar_t *wim_path, if (ret) goto out; + // coverity[tainted_data] ret = prepare_wimoverlay_dat(old_contents, wim_path, wim_guid, image, &new_contents, &new_contents_size, &new_data_source_id); diff --git a/src/wimlib/wimlib/compiler.h b/src/wimlib/wimlib/compiler.h index 6ad165ad..5a74fbf3 100644 --- a/src/wimlib/wimlib/compiler.h +++ b/src/wimlib/wimlib/compiler.h @@ -234,14 +234,15 @@ uint32_t __inline __builtin_ctz(uint32_t value) unsigned long trailing_zero = 0; if (_BitScanForward(&trailing_zero, value)) return trailing_zero; - return 32; + // Undefined behaviour => return 0 to appease static analyzers + return 0; } uint32_t __inline __builtin_clz(uint32_t value) { unsigned long leading_zero = 0; if (_BitScanReverse(&leading_zero, value)) return 31 - leading_zero; - return 32; + return 0; } #if defined(_M_X64) || defined(_M_ARM64) uint32_t __inline __builtin_clzll(uint64_t value) @@ -249,20 +250,20 @@ uint32_t __inline __builtin_clzll(uint64_t value) unsigned long leading_zero = 0; if (_BitScanReverse64(&leading_zero, value)) return 63 - leading_zero; - return 64; + return 0; } uint32_t __inline __builtin_ctzll(uint64_t value) { unsigned long trailing_zero = 0; if (_BitScanForward64(&trailing_zero, value)) return trailing_zero; - return 64; + return 0; } #else uint32_t __inline __builtin_clzll(uint64_t value) { if (value == 0) - return 64; + return 0; uint32_t msh = (uint32_t)(value >> 32); uint32_t lsh = (uint32_t)(value & 0xFFFFFFFF); if (msh != 0) @@ -272,7 +273,7 @@ uint32_t __inline __builtin_clzll(uint64_t value) uint32_t __inline __builtin_ctzll(uint64_t value) { if (value == 0) - return 64; + return 0; uint32_t msh = (uint32_t)(value >> 32); uint32_t lsh = (uint32_t)(value & 0xFFFFFFFF); if (msh != 0) diff --git a/src/wimlib/win32_capture.c b/src/wimlib/win32_capture.c index 895fcf7f..0a37e684 100644 --- a/src/wimlib/win32_capture.c +++ b/src/wimlib/win32_capture.c @@ -2800,10 +2800,8 @@ generate_wim_structures_recursive(struct wim_dentry **root_ret, root->d_short_name_nbytes = nbytes; } - if (inode->i_nlink > 1) { /* Already seen this inode? */ - ret = 0; + if (inode->i_nlink > 1) /* Already seen this inode? */ goto out_progress; - } /* The file attributes and timestamps were cached from the MFT. */ inode->i_attributes = ni->attributes; diff --git a/src/wimlib/win32_vss.c b/src/wimlib/win32_vss.c index 8ab69a3b..9ee346a5 100644 --- a/src/wimlib/win32_vss.c +++ b/src/wimlib/win32_vss.c @@ -215,7 +215,7 @@ struct IVssBackupComponentsVTable { *----------------------------------------------------------------------------*/ static bool vss_initialized; -static struct mutex vss_initialization_mutex = MUTEX_INITIALIZER; +static volatile uint16_t vss_initialization_mutex = 0; /* vssapi.dll */ static HANDLE hVssapi; @@ -282,35 +282,47 @@ err: static bool vss_global_init(void) { - if (vss_initialized) - return true; + bool ret = true; - mutex_lock(&vss_initialization_mutex); - if (!vss_initialized) - vss_initialized = vss_global_init_impl(); - mutex_unlock(&vss_initialization_mutex); + while (InterlockedIncrement16(&vss_initialization_mutex) >= 2) { + InterlockedDecrement16(&vss_initialization_mutex); + Sleep(100); + } if (vss_initialized) - return true; - ERROR("The Volume Shadow Copy Service (VSS) API could not be " - "initialized."); - return false; + goto out_unlock; + + vss_initialized = vss_global_init_impl(); + + if (!vss_initialized) { + ERROR("The Volume Shadow Copy Service (VSS) API could not be " + "initialized."); + ret = false; + } + +out_unlock: + InterlockedDecrement16(&vss_initialization_mutex); + return ret; } void vss_global_cleanup(void) { - if (!vss_initialized) - return; - - mutex_lock(&vss_initialization_mutex); - if (vss_initialized) { - (*func_CoUninitialize)(); - FreeLibrary(hOle32); - FreeLibrary(hVssapi); - vss_initialized = false; + while (InterlockedIncrement16(&vss_initialization_mutex) >= 2) { + InterlockedDecrement16(&vss_initialization_mutex); + Sleep(100); } - mutex_unlock(&vss_initialization_mutex); + + if (!vss_initialized) + goto out_unlock; + + (*func_CoUninitialize)(); + FreeLibrary(hOle32); + FreeLibrary(hVssapi); + vss_initialized = false; + +out_unlock: + InterlockedDecrement16(&vss_initialization_mutex); } /*----------------------------------------------------------------------------* diff --git a/src/wimlib/xmlproc.c b/src/wimlib/xmlproc.c index 86e29e4f..121eb418 100644 --- a/src/wimlib/xmlproc.c +++ b/src/wimlib/xmlproc.c @@ -644,7 +644,8 @@ xml_parse_document(const tchar *p, struct xml_node **doc_ret) int ret; struct xml_node *doc; - skip_string(&p, BYTE_ORDER_MARK); + // Keep static analysers happy since we don't care about returned value. + (void)skip_string(&p, BYTE_ORDER_MARK); if (!skip_misc(&p)) return WIMLIB_ERR_XML; ret = parse_element(&p, NULL, 0, &doc); diff --git a/src/xml.c b/src/xml.c index b344bb73..f26a99db 100644 --- a/src/xml.c +++ b/src/xml.c @@ -237,7 +237,7 @@ char *ezxml_decode(char *s, char **ent, char t) if (ent[b++]) { // found a match if ((c = (long)strlen(ent[b])) - 1 > (e = strchr(s, ';')) - s) { - l = (d = (long)(s - r)) + c + (long)strlen(e); // new length + l = (d = (long)(s - r)) + c + (long)(e ? strlen(e) : 0); // new length r = (r == m) ? strcpy(malloc(l), r) : _realloc(r, l); e = strchr((s = r + d), ';'); // fix up pointers } @@ -683,8 +683,7 @@ ezxml_t ezxml_parse_fd(int fd) size_t l; void *m; - if (fd < 0) return NULL; - fstat(fd, &st); + if (fd < 0 || fstat(fd, &st)) return NULL; #ifndef EZXML_NOMMAP l = (st.st_size + sysconf(_SC_PAGESIZE) - 1) & ~(sysconf(_SC_PAGESIZE) -1); @@ -698,6 +697,7 @@ ezxml_t ezxml_parse_fd(int fd) else { // mmap failed, read file into memory #endif // EZXML_NOMMAP l = (long)_read(fd, m = malloc((size_t)st.st_size), (unsigned int)st.st_size); + if (l < 0) { free(m); return NULL; }; root = (ezxml_root_t)ezxml_parse_str(m, l); if (!root) { free(m); return NULL; }; root->len = -1; // so we know to free s in ezxml_free() @@ -719,7 +719,7 @@ ezxml_t ezxml_parse_file(const char *file) // Encodes ampersand sequences appending the results to *dst, reallocating *dst // if length excedes max. a is non-zero for attribute encoding. Returns *dst -char *ezxml_ampencode(const char *s, size_t len, char **dst, size_t *dlen, +char *ezxml_ampencode(const char *s, ssize_t len, char **dst, size_t *dlen, size_t *max, short a) { const char *e; From 13c6becf42cc0e43b347e7535876621088ae87fe Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 7 May 2025 13:35:48 +0100 Subject: [PATCH 052/192] [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. --- src/rufus.c | 2 +- src/rufus.rc | 10 +++++----- src/vhd.c | 2 ++ src/wimlib/xpress_compress.c | 7 +++++++ src/xml.c | 5 +++-- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/rufus.c b/src/rufus.c index ea0a87fe..e5f0df56 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1451,7 +1451,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) if (boot_type == BT_IMAGE) { if_not_assert(image_path != NULL) goto out; - if ((size_check) && (MAX(img_report.image_size, img_report.projected_size) > (uint64_t)SelectedDrive.DiskSize)) { + if ((size_check) && (img_report.projected_size > (uint64_t)SelectedDrive.DiskSize)) { // This ISO image is too big for the selected target MessageBoxExU(hMainDialog, lmprintf(MSG_089), lmprintf(MSG_088), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); goto out; diff --git a/src/rufus.rc b/src/rufus.rc index 50716e2f..d4f1775a 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.8.2242" +CAPTION "Rufus 4.8.2243" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2242,0 - PRODUCTVERSION 4,8,2242,0 + FILEVERSION 4,8,2243,0 + PRODUCTVERSION 4,8,2243,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2242" + VALUE "FileVersion", "4.8.2243" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2242" + VALUE "ProductVersion", "4.8.2243" END END BLOCK "VarFileInfo" diff --git a/src/vhd.c b/src/vhd.c index ef39afd7..40db6880 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -186,6 +186,8 @@ int8_t IsBootableImage(const char* path) goto out; } img_report.image_size = (uint64_t)liImageSize.QuadPart; + if (img_report.projected_size == 0) + img_report.projected_size = img_report.image_size; size = sizeof(wim_magic); IGNORE_RETVAL(SetFilePointerEx(handle, ptr, NULL, FILE_BEGIN)); img_report.is_windows_img = ReadFile(handle, &wim_magic, size, &size, NULL) && (wim_magic == WIM_MAGIC); diff --git a/src/wimlib/xpress_compress.c b/src/wimlib/xpress_compress.c index dd85a921..b6111276 100644 --- a/src/wimlib/xpress_compress.c +++ b/src/wimlib/xpress_compress.c @@ -59,6 +59,7 @@ * optimizations. */ +#include "wimlib/assert.h" #include "wimlib/bitops.h" #include "wimlib/compress_common.h" #include "wimlib/compressor_ops.h" @@ -504,6 +505,8 @@ xpress_record_match(struct xpress_compressor *c, unsigned length, unsigned offse unsigned log2_offset = bsr32(offset); unsigned sym = XPRESS_NUM_CHARS + ((log2_offset << 4) | len_hdr); + wimlib_assert(sym < XPRESS_NUM_SYMBOLS); + // coverity[overrun-local] c->freqs[sym]++; return (struct xpress_item) { @@ -759,6 +762,8 @@ xpress_tally_item_list(struct xpress_compressor *c, len_hdr = min(0xF, adjusted_len); sym = XPRESS_NUM_CHARS + ((log2_offset << 4) | len_hdr); + wimlib_assert(sym < XPRESS_NUM_SYMBOLS); + // coverity[overrun-local] c->freqs[sym]++; } cur_node += length; @@ -872,6 +877,8 @@ xpress_find_min_cost_path(struct xpress_compressor *c, size_t in_nbytes, len_hdr = min(adjusted_len, 0xF); sym = XPRESS_NUM_CHARS + ((log2_offset << 4) | len_hdr); + wimlib_assert(sym < XPRESS_NUM_SYMBOLS); + // coverity[overrun-local] cost_to_end = offset_cost + c->costs[sym] + (cur_node + len)->cost_to_end; diff --git a/src/xml.c b/src/xml.c index f26a99db..91c0c54c 100644 --- a/src/xml.c +++ b/src/xml.c @@ -240,6 +240,7 @@ char *ezxml_decode(char *s, char **ent, char t) l = (d = (long)(s - r)) + c + (long)(e ? strlen(e) : 0); // new length r = (r == m) ? strcpy(malloc(l), r) : _realloc(r, l); e = strchr((s = r + d), ';'); // fix up pointers + if (!e) return r; } memmove(s + c, e + 1, strlen(e)); // shift rest of string @@ -680,7 +681,7 @@ ezxml_t ezxml_parse_fd(int fd) { ezxml_root_t root; struct stat st; - size_t l; + ssize_t l; void *m; if (fd < 0 || fstat(fd, &st)) return NULL; @@ -696,7 +697,7 @@ ezxml_t ezxml_parse_fd(int fd) } else { // mmap failed, read file into memory #endif // EZXML_NOMMAP - l = (long)_read(fd, m = malloc((size_t)st.st_size), (unsigned int)st.st_size); + l = (ssize_t)_read(fd, m = malloc((size_t)st.st_size), (unsigned int)st.st_size); if (l < 0) { free(m); return NULL; }; root = (ezxml_root_t)ezxml_parse_str(m, l); if (!root) { free(m); return NULL; }; From 4adfa4f37e3879b215f54f52231851caeff42912 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 13 May 2025 20:26:46 +0100 Subject: [PATCH 053/192] [misc] more MinGW DLL side loading "improvements" - Side load SetupAPI.dll, as this is the DLL that was causing the CfgMgr32.dll local load. This reverts part of 622e60659cb0c7c3e69f5255c0e99127eed0ada6 since we no longer have to hook into CfgMgr32.dll directly. - Also set the redefinition of DECLSPEC_IMPORT, which we need for MinGW32 x86, in the global AM_CFLAGS of configure.ac, so that we no longer have to worry about forgetting to do it in a source and experience crashes on 32-bit as a result (See 965759f58a754f0535cec4f795cfd383ecbfc945). - Also delay-load crypt32.dll while we're at it. - Also add provision for enabling /DEPENDENTLOADFLAG:0x800 on MinGW, by leaving a properly crafted entry in the .rdata section that can then be used with the loadcfg.py Python script. - Sadly, per https://github.com/pbatard/rufus/issues/2701#issuecomment-2874788564 and subsequent comment, having DependentLoadFlags set to LOAD_LIBRARY_SEARCH_SYSTEM32 is still not enough to take care of side loading issues, as, ever since the introduction of wimlib support, we are seeing CRYPTBASE.DLL being side-loaded in MinGW, and, even with crypt32.dll being delay-loaded there is literally *nothing* we can do about it! - The end result of all the above is that we will have no choice but ditch MinGW for release executables as it's just impossible to properly take care of side-loading vulnerabilities with MinGW (and Microsoft are REALLY not helping with this whole mess either, when they don't even use LOAD_LIBRARY_SEARCH_SYSTEM32 for Windows' system DLLs). - In preparation for this, we add UPX compression to the x86_64 and x86_32 MSVC executables. - Finally, we also fix one last Coverity warning in xml.c and remove duplicates in .vcxproj for ARM64. --- .github/workflows/vs2022.yml | 9 ++++++ .mingw/Makefile.am | 3 +- .mingw/Makefile.in | 3 +- .mingw/crypt32.def | 14 ++++++++ .mingw/setupapi.def | 20 ++++++++++++ .vs/rufus.vcxproj | 8 ++--- configure | 6 ++-- configure.ac | 6 ++-- loadcfg.py | 63 ++++++++++++++++++++++++++++++++++++ src/Makefile.am | 6 ++-- src/Makefile.in | 6 ++-- src/dev.c | 59 +++++++++------------------------ src/net.c | 6 ---- src/rufus.c | 35 +++++++++++++++----- src/rufus.h | 15 ++++----- src/rufus.rc | 10 +++--- src/vhd.h | 6 ---- src/xml.c | 2 +- 18 files changed, 179 insertions(+), 98 deletions(-) create mode 100644 .mingw/crypt32.def create mode 100644 .mingw/setupapi.def create mode 100644 loadcfg.py diff --git a/.github/workflows/vs2022.yml b/.github/workflows/vs2022.yml index 963477fe..aefd1f61 100644 --- a/.github/workflows/vs2022.yml +++ b/.github/workflows/vs2022.yml @@ -50,6 +50,11 @@ jobs: with: msbuild-architecture: x64 + - name: Install UPX + uses: crazy-max/ghaction-upx@v3 + with: + install-only: true + - name: Set ALPHA id: set_alpha shell: bash @@ -76,6 +81,10 @@ jobs: move .\${{ matrix.TARGET_PLATFORM }}\Release\rufus.exe .\rufus_${{ matrix.TARGET_PLATFORM }}.exe move .\${{ matrix.TARGET_PLATFORM }}\Release\rufus.pdb .\rufus_${{ matrix.TARGET_PLATFORM }}.pdb + - name: Compress executables + if: ${{ matrix.TARGET_PLATFORM != 'arm64' }} + run: upx --lzma --best .\rufus_${{ matrix.TARGET_PLATFORM }}.exe + - name: Display SHA-256 run: sha256sum ./rufus_${{ matrix.TARGET_PLATFORM }}.exe diff --git a/.mingw/Makefile.am b/.mingw/Makefile.am index e8d55d27..a2170674 100644 --- a/.mingw/Makefile.am +++ b/.mingw/Makefile.am @@ -20,8 +20,7 @@ TARGET := $(word 1,$(subst -, ,$(TUPLE))) DEF_SUFFIX := $(if $(TARGET:x86_64=),.def,.def64) .PHONY: all -# Ideally, we would also have cfgmgr32-delaylib here, but it doesn't actually delay load... :( -all: dwmapi-delaylib.lib version-delaylib.lib virtdisk-delaylib.lib wininet-delaylib.lib wintrust-delaylib.lib +all: crypt32-delaylib.lib dwmapi-delaylib.lib setupapi-delaylib.lib version-delaylib.lib virtdisk-delaylib.lib wininet-delaylib.lib wintrust-delaylib.lib %.def64: %.def $(AM_V_SED) "s/@.*//" $< >$@ diff --git a/.mingw/Makefile.in b/.mingw/Makefile.in index 8174663d..dd62b1df 100644 --- a/.mingw/Makefile.in +++ b/.mingw/Makefile.in @@ -368,8 +368,7 @@ uninstall-am: .PHONY: all -# Ideally, we would also have cfgmgr32-delaylib here, but it doesn't actually delay load... :( -all: dwmapi-delaylib.lib version-delaylib.lib virtdisk-delaylib.lib wininet-delaylib.lib wintrust-delaylib.lib +all: crypt32-delaylib.lib dwmapi-delaylib.lib setupapi-delaylib.lib version-delaylib.lib virtdisk-delaylib.lib wininet-delaylib.lib wintrust-delaylib.lib %.def64: %.def $(AM_V_SED) "s/@.*//" $< >$@ diff --git a/.mingw/crypt32.def b/.mingw/crypt32.def new file mode 100644 index 00000000..6d070db3 --- /dev/null +++ b/.mingw/crypt32.def @@ -0,0 +1,14 @@ +EXPORTS + CertFindCertificateInStore@24 + CertGetCertificateChain@32 + CertGetNameStringA@24 + CertCloseStore@8 + CertFreeCertificateContext@4 + CryptQueryObject@44 + CryptDecodeObjectEx@32 + CryptHashCertificate@28 + CryptMsgGetParam@20 + CryptMsgClose@4 + CryptMsgGetParam@20 + CryptMsgOpenToDecode@24 + CryptMsgUpdate@16 diff --git a/.mingw/setupapi.def b/.mingw/setupapi.def new file mode 100644 index 00000000..5707e1cc --- /dev/null +++ b/.mingw/setupapi.def @@ -0,0 +1,20 @@ +EXPORTS + CM_Locate_DevNodeA@12 + CM_Get_DevNode_Registry_PropertyA@24 + CM_Get_DevNode_Status@16 + CM_Get_Child@12 + CM_Get_Parent@12 + CM_Get_Sibling@12 + CM_Get_Device_IDA@16 + CM_Get_Device_ID_ListA@16 + CM_Get_Device_ID_List_SizeA@12 + SetupDiGetDeviceInstanceIdA@20 + SetupDiGetDeviceRegistryPropertyA@28 + SetupDiGetDeviceRegistryPropertyW@28 + SetupDiChangeState@8 + SetupDiGetClassDevsA@16 + SetupDiSetClassInstallParamsW@16 + SetupDiEnumDeviceInfo@12 + SetupDiEnumDeviceInterfaces@20 + SetupDiDestroyDeviceInfoList@4 + SetupDiGetDeviceInterfaceDetailA@24 diff --git a/.vs/rufus.vcxproj b/.vs/rufus.vcxproj index be8d8216..b558e0ea 100644 --- a/.vs/rufus.vcxproj +++ b/.vs/rufus.vcxproj @@ -168,7 +168,7 @@ <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\arm</AdditionalLibraryDirectories> - <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> </Link> <ResourceCompile> @@ -200,7 +200,7 @@ <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.16299.0\um\arm64</AdditionalLibraryDirectories> - <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> </Link> <ResourceCompile> @@ -302,7 +302,7 @@ <SubSystem>Windows</SubSystem> <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\arm</AdditionalLibraryDirectories> <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> - <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> </Link> <ResourceCompile> <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> @@ -336,7 +336,7 @@ <SubSystem>Windows</SubSystem> <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.16299.0\um\arm64</AdditionalLibraryDirectories> <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> - <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;ole32.dll;advapi32.dll;gdi32.dll;shell32.dll;comdlg32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> </Link> <ResourceCompile> <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> diff --git a/configure b/configure index 1399f3a4..ce4d9bb1 100755 --- a/configure +++ b/configure @@ -4702,7 +4702,7 @@ fi printf "%s\n" "enabling Large File Support (ISO support)" >&6; } AM_CFLAGS="$AM_CFLAGS -D_FILE_OFFSET_BITS=64 -D_OFF_T_ -D_off_t=off64_t -Doff_t=off64_t -Doff32_t=long" -# check for -Wno-pointer-sign compiler support (GCC >= 4) +# Check for -Wno-pointer-sign compiler support (GCC >= 4) saved_CFLAGS="${CFLAGS}" CFLAGS="$CFLAGS -Wno-pointer-sign" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4725,7 +4725,9 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="${saved_CFLAGS}" -AM_CFLAGS="$AM_CFLAGS -DUNICODE -D_UNICODE -UNDEBUG -DCOBJMACROS -D__USE_MINGW_ANSI_STDIO=0 -std=gnu11 -Wshadow -Wall -Wformat-security -Wundef -Wunused -Wstrict-prototypes -Wno-restrict -Wno-array-bounds -Werror-implicit-function-declaration -Wbidi-chars=none $nopointersign_cflags" +# NB: The DECLSPEC_IMPORT redefinition below is a temporary(?) workaround for MinGW32 delay-loading +# See https://github.com/pbatard/rufus/pull/2513 as well as https://sourceware.org/bugzilla/show_bug.cgi?id=14339 +AM_CFLAGS="$AM_CFLAGS -DUNICODE -D_UNICODE -UNDEBUG -DCOBJMACROS -D__USE_MINGW_ANSI_STDIO=0 -UDECLSPEC_IMPORT -DDECLSPEC_IMPORT=__attribute__\(\(visibility\(\\\"hidden\\\"\)\)\) -std=gnu11 -Wshadow -Wall -Wformat-security -Wundef -Wunused -Wstrict-prototypes -Wno-restrict -Wno-array-bounds -Werror-implicit-function-declaration -Wbidi-chars=none $nopointersign_cflags" diff --git a/configure.ac b/configure.ac index 2980290a..7225f028 100644 --- a/configure.ac +++ b/configure.ac @@ -57,14 +57,16 @@ fi AC_MSG_RESULT([enabling Large File Support (ISO support)]) AM_CFLAGS="$AM_CFLAGS -D_FILE_OFFSET_BITS=64 -D_OFF_T_ -D_off_t=off64_t -Doff_t=off64_t -Doff32_t=long" -# check for -Wno-pointer-sign compiler support (GCC >= 4) +# Check for -Wno-pointer-sign compiler support (GCC >= 4) saved_CFLAGS="${CFLAGS}" CFLAGS="$CFLAGS -Wno-pointer-sign" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [nopointersign_cflags="-Wno-pointer-sign"], [nopointersign_cflags=""]) CFLAGS="${saved_CFLAGS}" -AM_CFLAGS="$AM_CFLAGS -DUNICODE -D_UNICODE -UNDEBUG -DCOBJMACROS -D__USE_MINGW_ANSI_STDIO=0 -std=gnu11 -Wshadow -Wall -Wformat-security -Wundef -Wunused -Wstrict-prototypes -Wno-restrict -Wno-array-bounds -Werror-implicit-function-declaration -Wbidi-chars=none $nopointersign_cflags" +# NB: The DECLSPEC_IMPORT redefinition below is a temporary(?) workaround for MinGW32 delay-loading +# See https://github.com/pbatard/rufus/pull/2513 as well as https://sourceware.org/bugzilla/show_bug.cgi?id=14339 +AM_CFLAGS="$AM_CFLAGS -DUNICODE -D_UNICODE -UNDEBUG -DCOBJMACROS -D__USE_MINGW_ANSI_STDIO=0 -UDECLSPEC_IMPORT -DDECLSPEC_IMPORT=__attribute__\(\(visibility\(\\\"hidden\\\"\)\)\) -std=gnu11 -Wshadow -Wall -Wformat-security -Wundef -Wunused -Wstrict-prototypes -Wno-restrict -Wno-array-bounds -Werror-implicit-function-declaration -Wbidi-chars=none $nopointersign_cflags" AC_SUBST([VISIBILITY_CFLAGS]) AC_SUBST([AM_CFLAGS]) diff --git a/loadcfg.py b/loadcfg.py new file mode 100644 index 00000000..4476c150 --- /dev/null +++ b/loadcfg.py @@ -0,0 +1,63 @@ +#!/bin/env python3 + +# PE Load Configuration section enabler for MinGW/gcc executables. +# The PE executable should have a IMAGE_LOAD_CONFIG_DIRECTORY## section +# in .rdata with a 16-byte IMAGE_DIRECTORY_ENTRY_MARKER marker. + +import os +import sys +import pefile + +IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG = 10 +IMAGE_DIRECTORY_ENTRY_MARKER = b"_RUFUS_LOAD_CFG" + +if len(sys.argv) < 2: + raise RuntimeError("No executable path supplied") + +# Create a temp file as our source +pe_dst = sys.argv[1] +pe_src = sys.argv[1] + ".tmp" +os.replace(pe_dst, pe_src) + +# Open and parse PE +pe = pefile.PE(pe_src) + +# Find .rdata section +rdata_section = next( + (s for s in pe.sections if s.Name.rstrip(b'\x00') == b'.rdata'), + None +) +if not rdata_section: + raise RuntimeError(".rdata section not found") + +# Read the section's raw data to search for the target string +raw_data = rdata_section.get_data() + +# Look for the target data in the raw section data +offset = raw_data.find(IMAGE_DIRECTORY_ENTRY_MARKER) +if offset == -1: + raise RuntimeError("Load Config marker not found") + +# Move past our 16 bytes marker +offset += 0x10 +# Calculate the RVA and size of the Load Config section +load_config_rva = rdata_section.VirtualAddress + offset +print(f"RVA of Load Config: 0x{load_config_rva:X}") +load_config_size = pe.get_dword_at_rva(load_config_rva) +if (load_config_size < 0x20): + raise RuntimeError("Size of Load Config section is too small") +print(f"Size of Load Config: 0x{load_config_size:X}") + +# Update Load Config directory entry +pe.OPTIONAL_HEADER.DATA_DIRECTORY[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].VirtualAddress = load_config_rva +pe.OPTIONAL_HEADER.DATA_DIRECTORY[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].Size = load_config_size + +# Update the checksum +pe.OPTIONAL_HEADER.CheckSum = pe.generate_checksum() + +# Write the updated PE file and remove temp +pe.write(pe_dst) +os.remove(pe_src) + +# Can be validated with `DUMPBIN /LOADCONFIG <.exe>` or `objdump -x <.exe> | grep "Load Configuration"` +print(f"Successfully enabled Load Config section in '{pe_dst}'") diff --git a/src/Makefile.am b/src/Makefile.am index 65a5cf14..fbcef997 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,11 +1,9 @@ SUBDIRS = ../.mingw bled ext2fs ms-sys syslinux/libfat syslinux/libinstaller syslinux/win libcdio/iso9660 libcdio/udf libcdio/driver wimlib ../res/loc # As far as I can tell, the following libraries are *not* vulnerable to side-loading, so we link using their regular version: -NONVULNERABLE_LIBS = -lsetupapi -lole32 -lgdi32 -lshlwapi -lcrypt32 -lcomctl32 -luuid -lntdll +NONVULNERABLE_LIBS = -lole32 -lgdi32 -lshlwapi -lcomctl32 -luuid -lntdll # The following libraries are vulnerable (or have an unknown vulnerability status), so we link using our delay-loaded replacement: # See https://github.com/pbatard/rufus/issues/2272 -# Oh, and don't bother trying to delay load cfgmgr32.dll, even with the DECLSPEC_IMPORT __attribute__((visibility("hidden"))) -# override. It just DOESN'T BLOODY WORK and you will waste HOURS on a wild goose chase!!! -VULNERABLE_LIBS = -ldwmapi-delaylib -lversion-delaylib -lvirtdisk-delaylib -lwininet-delaylib -lwintrust-delaylib +VULNERABLE_LIBS = -lcrypt32-delaylib -ldwmapi-delaylib -lsetupapi-delaylib -lversion-delaylib -lvirtdisk-delaylib -lwininet-delaylib -lwintrust-delaylib noinst_PROGRAMS = rufus diff --git a/src/Makefile.in b/src/Makefile.in index f219568c..5deb0e19 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -275,12 +275,10 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = ../.mingw bled ext2fs ms-sys syslinux/libfat syslinux/libinstaller syslinux/win libcdio/iso9660 libcdio/udf libcdio/driver wimlib ../res/loc # As far as I can tell, the following libraries are *not* vulnerable to side-loading, so we link using their regular version: -NONVULNERABLE_LIBS = -lsetupapi -lole32 -lgdi32 -lshlwapi -lcrypt32 -lcomctl32 -luuid -lntdll +NONVULNERABLE_LIBS = -lole32 -lgdi32 -lshlwapi -lcomctl32 -luuid -lntdll # The following libraries are vulnerable (or have an unknown vulnerability status), so we link using our delay-loaded replacement: # See https://github.com/pbatard/rufus/issues/2272 -# Oh, and don't bother trying to delay load cfgmgr32.dll, even with the DECLSPEC_IMPORT __attribute__((visibility("hidden"))) -# override. It just DOESN'T BLOODY WORK and you will waste HOURS on a wild goose chase!!! -VULNERABLE_LIBS = -ldwmapi-delaylib -lversion-delaylib -lvirtdisk-delaylib -lwininet-delaylib -lwintrust-delaylib +VULNERABLE_LIBS = -lcrypt32-delaylib -ldwmapi-delaylib -lsetupapi-delaylib -lversion-delaylib -lvirtdisk-delaylib -lwininet-delaylib -lwintrust-delaylib AM_V_WINDRES_0 = @echo " RC $@";$(WINDRES) AM_V_WINDRES_1 = $(WINDRES) AM_V_WINDRES_ = $(AM_V_WINDRES_$(AM_DEFAULT_VERBOSITY)) diff --git a/src/dev.c b/src/dev.c index cbecdda2..7734f1b6 100644 --- a/src/dev.c +++ b/src/dev.c @@ -49,21 +49,6 @@ extern RUFUS_DRIVE rufus_drive[MAX_DRIVES]; extern BOOL enable_HDDs, enable_VHDs, use_fake_units, enable_vmdk, usb_debug; extern BOOL list_non_usb_removable_drives, its_a_me_mario; -/* - * CfgMgr32.dll interface. - * Note that, unlike what is the case with other DLLs, delay-loading of cfgmgr32 - * does *not* work with MinGW, so we have to go through direct hooking yet again... - */ -PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Get_Device_IDA, (DEVINST, CHAR*, ULONG, ULONG)); -PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Get_Device_ID_List_SizeA, (PULONG, PCSTR, ULONG)); -PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Get_Device_ID_ListA, (PCSTR, PCHAR, ULONG, ULONG)); -PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Locate_DevNodeA, (PDEVINST, DEVINSTID_A, ULONG)); -PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Get_Child, (PDEVINST, DEVINST, ULONG)); -PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Get_Parent, (PDEVINST, DEVINST, ULONG)); -PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Get_Sibling, (PDEVINST, DEVINST, ULONG)); -PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Get_DevNode_Status, (PULONG, PULONG, DEVINST, ULONG)); -PF_TYPE_DECL(WINAPI, CONFIGRET, CM_Get_DevNode_Registry_PropertyA, (DEVINST, ULONG, PULONG, PVOID, PULONG, ULONG)); - /* * Get the VID, PID and current device speed */ @@ -80,10 +65,7 @@ static BOOL GetUSBProperties(char* parent_path, char* device_id, usb_device_prop if ((parent_path == NULL) || (device_id == NULL) || (props == NULL)) goto out; - PF_INIT_OR_OUT(CM_Locate_DevNodeA, CfgMgr32); - PF_INIT_OR_OUT(CM_Get_DevNode_Registry_PropertyA, CfgMgr32); - - cr = pfCM_Locate_DevNodeA(&device_inst, device_id, 0); + cr = CM_Locate_DevNodeA(&device_inst, device_id, 0); if (cr != CR_SUCCESS) { uprintf("Could not get device instance handle for '%s': CR error %d", device_id, cr); goto out; @@ -91,7 +73,7 @@ static BOOL GetUSBProperties(char* parent_path, char* device_id, usb_device_prop props->port = 0; size = sizeof(props->port); - cr = pfCM_Get_DevNode_Registry_PropertyA(device_inst, CM_DRP_ADDRESS, NULL, (PVOID)&props->port, &size, 0); + cr = CM_Get_DevNode_Registry_PropertyA(device_inst, CM_DRP_ADDRESS, NULL, (PVOID)&props->port, &size, 0); if (cr != CR_SUCCESS) { uprintf("Could not get port for '%s': CR error %d", device_id, cr); goto out; @@ -214,8 +196,6 @@ int CycleDevice(int index) if ((index < 0) || (safe_strlen(rufus_drive[index].id) < 8)) return ERROR_INVALID_PARAMETER; - PF_INIT_OR_OUT(CM_Get_DevNode_Status, CfgMgr32); - // Need DIGCF_ALLCLASSES else disabled devices won't be listed. dev_info = SetupDiGetClassDevsA(&GUID_DEVINTERFACE_DISK, NULL, NULL, DIGCF_PRESENT | DIGCF_ALLCLASSES); if (dev_info == INVALID_HANDLE_VALUE) { @@ -238,7 +218,7 @@ int CycleDevice(int index) found = TRUE; // Detect if the device is already disabled - if (pfCM_Get_DevNode_Status(&dev_status, &problem_code, dev_info_data.DevInst, 0) == CR_SUCCESS) + if (CM_Get_DevNode_Status(&dev_status, &problem_code, dev_info_data.DevInst, 0) == CR_SUCCESS) disabled = (dev_status & DN_HAS_PROBLEM) && (problem_code == CM_PROB_DISABLED); // Disable the device @@ -287,7 +267,7 @@ int CycleDevice(int index) // successful, but leave the device in an actual disabled state... So we can end up // with zombie devices, that are effectively disabled, but that Windows still sees // as enabled... So we need to detect this. - if (pfCM_Get_DevNode_Status(&dev_status, &problem_code, dev_info_data.DevInst, 0) == CR_SUCCESS) { + if (CM_Get_DevNode_Status(&dev_status, &problem_code, dev_info_data.DevInst, 0) == CR_SUCCESS) { disabled = (dev_status & DN_HAS_PROBLEM) && (problem_code == CM_PROB_DISABLED); if (disabled) ret = ERROR_DEVICE_REINITIALIZATION_NEEDED; @@ -298,7 +278,6 @@ int CycleDevice(int index) SetupDiDestroyDeviceInfoList(dev_info); if (!found) uprintf("Could not find a device to cycle!"); -out: return ret; } @@ -518,14 +497,6 @@ BOOL GetDevices(DWORD devnum) uint64_t drive_size = 0; usb_device_props props; - PF_INIT_OR_OUT(CM_Get_Child, CfgMgr32); - PF_INIT_OR_OUT(CM_Get_Parent, CfgMgr32); - PF_INIT_OR_OUT(CM_Get_Sibling, CfgMgr32); - PF_INIT_OR_OUT(CM_Get_Device_IDA, CfgMgr32); - PF_INIT_OR_OUT(CM_Get_Device_ID_ListA, CfgMgr32); - PF_INIT_OR_OUT(CM_Get_Device_ID_List_SizeA, CfgMgr32); - PF_INIT_OR_OUT(CM_Locate_DevNodeA, CfgMgr32); - IGNORE_RETVAL(ComboBox_ResetContent(hDeviceList)); ClearDrives(); StrArrayCreate(&dev_if_path, 128); @@ -555,19 +526,19 @@ BOOL GetDevices(DWORD devnum) if (SetupDiGetDeviceInterfaceDetailA(dev_info, &devint_data, devint_detail_data, size, &size, NULL)) { // Find the Device IDs for all the children of this hub - if (pfCM_Get_Child(&device_inst, dev_info_data.DevInst, 0) == CR_SUCCESS) { + if (CM_Get_Child(&device_inst, dev_info_data.DevInst, 0) == CR_SUCCESS) { device_id[0] = 0; s = StrArrayAdd(&dev_if_path, devint_detail_data->DevicePath, TRUE); uuprintf(" Hub[%d] = '%s'", s, devint_detail_data->DevicePath); - if ((s>= 0) && (pfCM_Get_Device_IDA(device_inst, device_id, MAX_PATH, 0) == CR_SUCCESS)) { + if ((s>= 0) && (CM_Get_Device_IDA(device_inst, device_id, MAX_PATH, 0) == CR_SUCCESS)) { ToUpper(device_id); if ((k = htab_hash(device_id, &htab_devid)) != 0) { htab_devid.table[k].data = (void*)(uintptr_t)s; } uuprintf(" Found ID[%03d]: %s", k, device_id); - while (pfCM_Get_Sibling(&device_inst, device_inst, 0) == CR_SUCCESS) { + while (CM_Get_Sibling(&device_inst, device_inst, 0) == CR_SUCCESS) { device_id[0] = 0; - if (pfCM_Get_Device_IDA(device_inst, device_id, MAX_PATH, 0) == CR_SUCCESS) { + if (CM_Get_Device_IDA(device_inst, device_id, MAX_PATH, 0) == CR_SUCCESS) { ToUpper(device_id); if ((k = htab_hash(device_id, &htab_devid)) != 0) { htab_devid.table[k].data = (void*)(uintptr_t)s; @@ -595,7 +566,7 @@ BOOL GetDevices(DWORD devnum) // Also compute the uasp_start index if (strcmp(usbstor_name[s], "UASPSTOR") == 0) uasp_start = s; - if (pfCM_Get_Device_ID_List_SizeA(&list_size[s], usbstor_name[s], ulFlags) != CR_SUCCESS) + if (CM_Get_Device_ID_List_SizeA(&list_size[s], usbstor_name[s], ulFlags) != CR_SUCCESS) list_size[s] = 0; if (list_size[s] != 0) full_list_size += list_size[s]-1; // remove extra NUL terminator @@ -630,7 +601,7 @@ BOOL GetDevices(DWORD devnum) for (s = 0, i = 0; s < ARRAYSIZE(usbstor_name); s++) { list_start[s] = i; if (list_size[s] > 1) { - if (pfCM_Get_Device_ID_ListA(usbstor_name[s], &devid_list[i], list_size[s], ulFlags) != CR_SUCCESS) + if (CM_Get_Device_ID_ListA(usbstor_name[s], &devid_list[i], list_size[s], ulFlags) != CR_SUCCESS) continue; if (usb_debug) { uprintf("Processing IDs belonging to '%s':", usbstor_name[s]); @@ -737,17 +708,17 @@ BOOL GetDevices(DWORD devnum) // a lookup table, but there shouldn't be that many USB storage devices connected... // NB: Each of these Device IDs should have a child, from which we get the Device Instance match. for (device_id = devid_list; *device_id != 0; device_id += strlen(device_id) + 1) { - if (pfCM_Locate_DevNodeA(&parent_inst, device_id, 0) != CR_SUCCESS) { + if (CM_Locate_DevNodeA(&parent_inst, device_id, 0) != CR_SUCCESS) { uuprintf("Could not locate device node for '%s'", device_id); continue; } - if (pfCM_Get_Child(&device_inst, parent_inst, 0) != CR_SUCCESS) { + if (CM_Get_Child(&device_inst, parent_inst, 0) != CR_SUCCESS) { uuprintf("Could not get children of '%s'", device_id); continue; } if (device_inst != dev_info_data.DevInst) { // Try the siblings - while (pfCM_Get_Sibling(&device_inst, device_inst, 0) == CR_SUCCESS) { + while (CM_Get_Sibling(&device_inst, device_inst, 0) == CR_SUCCESS) { if (device_inst == dev_info_data.DevInst) { uuprintf("NOTE: Matched instance from sibling for '%s'", device_id); break; @@ -788,8 +759,8 @@ BOOL GetDevices(DWORD devnum) // for UASP devices in ASUS "Turbo Mode" or "Apple Mobile Device USB Driver" for iPods) // so try to see if we can match the grandparent. if ( ((uintptr_t)htab_devid.table[j].data == 0) - && (pfCM_Get_Parent(&grandparent_inst, parent_inst, 0) == CR_SUCCESS) - && (pfCM_Get_Device_IDA(grandparent_inst, str, MAX_PATH, 0) == CR_SUCCESS) ) { + && (CM_Get_Parent(&grandparent_inst, parent_inst, 0) == CR_SUCCESS) + && (CM_Get_Device_IDA(grandparent_inst, str, MAX_PATH, 0) == CR_SUCCESS) ) { device_id = str; method_str = "[GP]"; ToUpper(device_id); diff --git a/src/net.c b/src/net.c index 76aadcda..a47f076e 100644 --- a/src/net.c +++ b/src/net.c @@ -24,12 +24,6 @@ #endif #include <windows.h> -// Temporary workaround for MinGW32 delay-loading -// See https://github.com/pbatard/rufus/pull/2513 -#if defined(__MINGW32__) -#undef DECLSPEC_IMPORT -#define DECLSPEC_IMPORT __attribute__((visibility("hidden"))) -#endif #include <wininet.h> #include <netlistmgr.h> #include <stdio.h> diff --git a/src/rufus.c b/src/rufus.c index e5f0df56..5b0b7761 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -22,14 +22,6 @@ #include <crtdbg.h> #endif -// Temporary workaround for MinGW32 delay-loading -// See https://github.com/pbatard/rufus/pull/2513 as well as -// https://sourceware.org/bugzilla/show_bug.cgi?id=14339 -#if defined(__MINGW32__) -#undef DECLSPEC_IMPORT -#define DECLSPEC_IMPORT __attribute__((visibility("hidden"))) -#endif - #include <windows.h> #include <windowsx.h> #include <stdlib.h> @@ -4219,3 +4211,30 @@ out: return 0; } + +/* + * The following adds a Load Configuration section in .rdata for MinGW, that can then be referenced + * by a PE post processing script to emulate the /DEPENDENTLOADFLAG:0x800 behaviour of MSVC. + * See https://github.com/pbatard/rufus/blob/master/loadcfg.py for such a script. + * Note however that, per https://github.com/pbatard/rufus/issues/2701#issuecomment-2874788564 + * /DEPENDENTLOADFLAG is far from being the ultimate solution to stop DLL side-loading vulnerabilities... + */ +#if defined(__MINGW32__) +// MinGW produces a warning since we don't use this section in the code => silence it. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-const-variable" +// Add a 16-byte marker for scripts to easily locate this section. +static const char _load_config_marker[16] __attribute__((aligned(16))) __attribute__((section(".rdata"))) = "_RUFUS_LOAD_CFG"; +#if defined(_M_AMD64) +static const IMAGE_LOAD_CONFIG_DIRECTORY64 _load_config __attribute__((aligned(16))) __attribute__((section(".rdata"))) = { + .Size = sizeof(IMAGE_LOAD_CONFIG_DIRECTORY64), + .DependentLoadFlags = LOAD_LIBRARY_SEARCH_SYSTEM32 +}; +#else +static const IMAGE_LOAD_CONFIG_DIRECTORY32 _load_config __attribute__((aligned(16))) __attribute__((section(".rdata"))) = { + .Size = sizeof(IMAGE_LOAD_CONFIG_DIRECTORY32), + .DependentLoadFlags = LOAD_LIBRARY_SEARCH_SYSTEM32 +}; +#endif +#pragma GCC diagnostic pop +#endif diff --git a/src/rufus.h b/src/rufus.h index 174e2a64..ad884e23 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -58,14 +58,13 @@ #endif #define COMPANY_NAME "Akeo Consulting" #define STR_NO_LABEL "NO_LABEL" -// Yes, there exist characters between these seemingly empty quotes! -#define LEFT_TO_RIGHT_MARK "‎" -#define RIGHT_TO_LEFT_MARK "‏" -#define LEFT_TO_RIGHT_EMBEDDING "‪" -#define RIGHT_TO_LEFT_EMBEDDING "‫" -#define POP_DIRECTIONAL_FORMATTING "‬" -#define LEFT_TO_RIGHT_OVERRIDE "‭" -#define RIGHT_TO_LEFT_OVERRIDE "‮" +#define LEFT_TO_RIGHT_MARK "\u200e" +#define RIGHT_TO_LEFT_MARK "\u200f" +#define LEFT_TO_RIGHT_EMBEDDING "\u202a" +#define RIGHT_TO_LEFT_EMBEDDING "\u202b" +#define POP_DIRECTIONAL_FORMATTING "\u202c" +#define LEFT_TO_RIGHT_OVERRIDE "\u202d" +#define RIGHT_TO_LEFT_OVERRIDE "\u202e" #define DRIVE_ACCESS_TIMEOUT 15000 // How long we should retry drive access (in ms) #define DRIVE_ACCESS_RETRIES 150 // How many times we should retry #define DRIVE_INDEX_MIN 0x00000080 diff --git a/src/rufus.rc b/src/rufus.rc index d4f1775a..0c24d45b 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.8.2243" +CAPTION "Rufus 4.8.2244" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2243,0 - PRODUCTVERSION 4,8,2243,0 + FILEVERSION 4,8,2244,0 + PRODUCTVERSION 4,8,2244,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2243" + VALUE "FileVersion", "4.8.2244" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2243" + VALUE "ProductVersion", "4.8.2244" END END BLOCK "VarFileInfo" diff --git a/src/vhd.h b/src/vhd.h index fccf4ca7..a0ce4182 100644 --- a/src/vhd.h +++ b/src/vhd.h @@ -19,12 +19,6 @@ #include <stdint.h> #include <windows.h> -// Temporary workaround for MinGW32 delay-loading -// See https://github.com/pbatard/rufus/pull/2513 -#if defined(__MINGW32__) -#undef DECLSPEC_IMPORT -#define DECLSPEC_IMPORT __attribute__((visibility("hidden"))) -#endif #include <virtdisk.h> #pragma once diff --git a/src/xml.c b/src/xml.c index 91c0c54c..4791788b 100644 --- a/src/xml.c +++ b/src/xml.c @@ -240,8 +240,8 @@ char *ezxml_decode(char *s, char **ent, char t) l = (d = (long)(s - r)) + c + (long)(e ? strlen(e) : 0); // new length r = (r == m) ? strcpy(malloc(l), r) : _realloc(r, l); e = strchr((s = r + d), ';'); // fix up pointers - if (!e) return r; } + if (!e) return r; memmove(s + c, e + 1, strlen(e)); // shift rest of string strncpy_s(s, c, ent[b], _TRUNCATE); // copy in replacement text From 01d18d99de02709dced64d148503e066296f14d8 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 14 May 2025 10:43:45 +0100 Subject: [PATCH 054/192] [misc] remove manual hooks into ntdll * Since we are now liking with ntdll directly, we can remove all the hooks we applied and just use regular calls. We also rename process.h to ntdll.h as a result. --- .vs/rufus.vcxproj | 2 +- .vs/rufus.vcxproj.filters | 2 +- src/drive.c | 10 +-- src/drive.h | 16 ----- src/ext2fs/nt_io.c | 63 +++++-------------- src/{process.h => ntdll.h} | 123 ++++++++++++++++++++++++++++++++++++- src/process.c | 99 +++++++---------------------- src/rufus.rc | 10 +-- src/stdio.c | 9 +-- 9 files changed, 174 insertions(+), 160 deletions(-) rename src/{process.h => ntdll.h} (75%) diff --git a/.vs/rufus.vcxproj b/.vs/rufus.vcxproj index b558e0ea..0fa60276 100644 --- a/.vs/rufus.vcxproj +++ b/.vs/rufus.vcxproj @@ -426,7 +426,7 @@ <ClInclude Include="..\src\mbr_types.h" /> <ClInclude Include="..\src\missing.h" /> <ClInclude Include="..\src\msvc-missing\unistd.h" /> - <ClInclude Include="..\src\process.h" /> + <ClInclude Include="..\src\ntdll.h" /> <ClInclude Include="..\src\re.h" /> <ClInclude Include="..\src\settings.h" /> <ClInclude Include="..\src\libcdio\cdio\cdio.h" /> diff --git a/.vs/rufus.vcxproj.filters b/.vs/rufus.vcxproj.filters index 9204e412..f757813b 100644 --- a/.vs/rufus.vcxproj.filters +++ b/.vs/rufus.vcxproj.filters @@ -161,7 +161,7 @@ <ClInclude Include="..\src\db.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\src\process.h"> + <ClInclude Include="..\src\ntdll.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\src\ui.h"> diff --git a/src/drive.c b/src/drive.c index 6be48e3a..ab4a6d57 100644 --- a/src/drive.c +++ b/src/drive.c @@ -33,6 +33,7 @@ #endif #include "rufus.h" +#include "ntdll.h" #include "missing.h" #include "resource.h" #include "settings.h" @@ -66,8 +67,6 @@ const IID IID_IVdsVolume = { 0x88306BB2, 0xE71F, 0x478C, { 0x86, 0xA2, 0x79, 0xD const IID IID_IVdsVolumeMF3 = { 0x6788FAF9, 0x214E, 0x4B85, { 0xBA, 0x59, 0x26, 0x69, 0x53, 0x61, 0x6E, 0x09 } }; #endif -PF_TYPE_DECL(NTAPI, NTSTATUS, NtQueryVolumeInformationFile, (HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FS_INFORMATION_CLASS)); - /* * Globals */ @@ -1097,15 +1096,13 @@ static BOOL _GetDriveLettersAndType(DWORD DriveIndex, char* drive_letters, UINT* HANDLE hDrive = INVALID_HANDLE_VALUE, hPhysical = INVALID_HANDLE_VALUE; UINT _drive_type; IO_STATUS_BLOCK io_status_block; - FILE_FS_DEVICE_INFORMATION file_fs_device_info; + FILE_FS_DEVICE_INFORMATION file_fs_device_info = { 0 }; BYTE geometry[256] = { 0 }; PDISK_GEOMETRY_EX DiskGeometry = (PDISK_GEOMETRY_EX)(void*)geometry; int i = 0, drives_found = 0, drive_number; char *drive, drives[26*4 + 1]; /* "D:\", "E:\", etc., plus one NUL */ char logical_drive[] = "\\\\.\\#:"; - PF_INIT(NtQueryVolumeInformationFile, Ntdll); - if (drive_letters != NULL) drive_letters[0] = 0; if (drive_type != NULL) @@ -1156,8 +1153,7 @@ static BOOL _GetDriveLettersAndType(DWORD DriveIndex, char* drive_letters, UINT* } // Eliminate floppy drives - if ((pfNtQueryVolumeInformationFile != NULL) && - (pfNtQueryVolumeInformationFile(hDrive, &io_status_block, &file_fs_device_info, + if ((NtQueryVolumeInformationFile(hDrive, &io_status_block, &file_fs_device_info, sizeof(file_fs_device_info), FileFsDeviceInformation) == NO_ERROR) && (file_fs_device_info.Characteristics & FILE_FLOPPY_DISKETTE) ) { continue; diff --git a/src/drive.h b/src/drive.h index 39a431e1..177f070f 100644 --- a/src/drive.h +++ b/src/drive.h @@ -61,22 +61,6 @@ #define VDS_SET_ERROR(hr) do { if (hr != S_OK) { SetLastError((DWORD)hr); ErrorStatus = RUFUS_ERROR(ERROR_GEN_FAILURE); } } while(0) -#if !defined(__MINGW32__) -typedef enum _FSINFOCLASS { - FileFsVolumeInformation = 1, - FileFsLabelInformation, - FileFsSizeInformation, - FileFsDeviceInformation, - FileFsAttributeInformation, - FileFsControlInformation, - FileFsFullSizeInformation, - FileFsObjectIdInformation, - FileFsDriverPathInformation, - FileFsVolumeFlagsInformation, - FileFsMaximumInformation -} FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS; -#endif - /* We need a redef of these MS structure */ typedef struct { DWORD DeviceType; diff --git a/src/ext2fs/nt_io.c b/src/ext2fs/nt_io.c index c74f3cfa..f36dc3b2 100644 --- a/src/ext2fs/nt_io.c +++ b/src/ext2fs/nt_io.c @@ -28,21 +28,12 @@ #include "config.h" #include "ext2fs.h" #include "rufus.h" +#include "ntdll.h" #include "msapi_utf8.h" extern char* NtStatusError(NTSTATUS Status); static DWORD LastWinError = 0; -PF_TYPE_DECL(NTAPI, ULONG, RtlNtStatusToDosError, (NTSTATUS)); -PF_TYPE_DECL(NTAPI, NTSTATUS, NtClose, (HANDLE)); -PF_TYPE_DECL(NTAPI, NTSTATUS, NtOpenFile, (PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PIO_STATUS_BLOCK, ULONG, ULONG)); -PF_TYPE_DECL(NTAPI, NTSTATUS, NtFlushBuffersFile, (HANDLE, PIO_STATUS_BLOCK)); -PF_TYPE_DECL(NTAPI, NTSTATUS, NtReadFile, (HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID, PIO_STATUS_BLOCK, PVOID, ULONG, PLARGE_INTEGER, PULONG)); -PF_TYPE_DECL(NTAPI, NTSTATUS, NtWriteFile, (HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID, PIO_STATUS_BLOCK, PVOID, ULONG, PLARGE_INTEGER, PULONG)); -PF_TYPE_DECL(NTAPI, NTSTATUS, NtDeviceIoControlFile, (HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID, PIO_STATUS_BLOCK, ULONG, PVOID, ULONG, PVOID, ULONG)); -PF_TYPE_DECL(NTAPI, NTSTATUS, NtFsControlFile, (HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID, PIO_STATUS_BLOCK, ULONG, PVOID, ULONG, PVOID, ULONG)); -PF_TYPE_DECL(NTAPI, NTSTATUS, NtDelayExecution, (BOOLEAN, PLARGE_INTEGER)); - #define ARGUMENT_PRESENT(ArgumentPointer) ((CHAR *)((ULONG_PTR)(ArgumentPointer)) != (CHAR *)(NULL)) #define STATUS_SUCCESS ((NTSTATUS)0x00000000L) @@ -173,8 +164,7 @@ static unsigned _MapDosError(IN ULONG WinError) // Map NT status to dos error. static __inline unsigned _MapNtStatus(IN NTSTATUS Status) { - PF_INIT(RtlNtStatusToDosError, Ntdll); - return (pfRtlNtStatusToDosError == NULL) ? EFAULT: _MapDosError(pfRtlNtStatusToDosError(Status)); + return _MapDosError(RtlNtStatusToDosError(Status)); } // Return the last Windows Error @@ -193,8 +183,6 @@ static NTSTATUS _OpenNtName(IN PCSTR Name, IN BOOLEAN Readonly, OUT PHANDLE Hand NTSTATUS Status = EFAULT; OBJECT_ATTRIBUTES ObjectAttributes; IO_STATUS_BLOCK IoStatusBlock; - PF_INIT(NtDelayExecution, Ntdll); - PF_INIT_OR_OUT(NtOpenFile, Ntdll); // Make Unicode name from input string utf8_to_wchar_no_alloc(Name, Buffer, ARRAYSIZE(Buffer)); @@ -209,16 +197,16 @@ static NTSTATUS _OpenNtName(IN PCSTR Name, IN BOOLEAN Readonly, OUT PHANDLE Hand if (ARGUMENT_PRESENT(OpenedReadonly)) *OpenedReadonly = Readonly; - Status = pfNtOpenFile(Handle, SYNCHRONIZE | FILE_READ_DATA | (Readonly ? 0 : FILE_WRITE_DATA), + Status = NtOpenFile(Handle, SYNCHRONIZE | FILE_READ_DATA | (Readonly ? 0 : FILE_WRITE_DATA), &ObjectAttributes, &IoStatusBlock, FILE_SHARE_WRITE | FILE_SHARE_READ, FILE_SYNCHRONOUS_IO_NONALERT); if (!NT_SUCCESS(Status)) { // Maybe was just mounted? wait 0.5 sec and retry. LARGE_INTEGER Interval; Interval.QuadPart = -5000000; // 0.5 sec. from now - pfNtDelayExecution(FALSE, &Interval); + NtDelayExecution(FALSE, &Interval); - Status = pfNtOpenFile(Handle, SYNCHRONIZE | FILE_READ_DATA | (Readonly ? 0 : FILE_WRITE_DATA), + Status = NtOpenFile(Handle, SYNCHRONIZE | FILE_READ_DATA | (Readonly ? 0 : FILE_WRITE_DATA), &ObjectAttributes, &IoStatusBlock, FILE_SHARE_WRITE | FILE_SHARE_READ, FILE_SYNCHRONOUS_IO_NONALERT); @@ -227,13 +215,12 @@ static NTSTATUS _OpenNtName(IN PCSTR Name, IN BOOLEAN Readonly, OUT PHANDLE Hand if (ARGUMENT_PRESENT(OpenedReadonly)) *OpenedReadonly = TRUE; - Status = pfNtOpenFile(Handle, SYNCHRONIZE | FILE_READ_DATA, &ObjectAttributes, + Status = NtOpenFile(Handle, SYNCHRONIZE | FILE_READ_DATA, &ObjectAttributes, &IoStatusBlock, FILE_SHARE_WRITE | FILE_SHARE_READ, FILE_SYNCHRONOUS_IO_NONALERT); } } -out: return Status; } @@ -247,45 +234,38 @@ static NTSTATUS _OpenDriveLetter(IN CHAR Letter, IN BOOLEAN ReadOnly, OUT PHANDL static __inline NTSTATUS _FlushDrive(IN HANDLE Handle) { IO_STATUS_BLOCK IoStatusBlock; - PF_INIT(NtFlushBuffersFile, NtDll); - return (pfNtFlushBuffersFile == NULL) ? STATUS_DLL_NOT_FOUND : pfNtFlushBuffersFile(Handle, &IoStatusBlock); + return NtFlushBuffersFile(Handle, &IoStatusBlock); } static __inline NTSTATUS _LockDrive(IN HANDLE Handle) { IO_STATUS_BLOCK IoStatusBlock; - PF_INIT(NtFsControlFile, NtDll); - return (pfNtFsControlFile == NULL) ? STATUS_DLL_NOT_FOUND : pfNtFsControlFile(Handle, 0, 0, 0, &IoStatusBlock, FSCTL_LOCK_VOLUME, 0, 0, 0, 0); + return NtFsControlFile(Handle, 0, 0, 0, &IoStatusBlock, FSCTL_LOCK_VOLUME, 0, 0, 0, 0); } static __inline NTSTATUS _UnlockDrive(IN HANDLE Handle) { IO_STATUS_BLOCK IoStatusBlock; - PF_INIT(NtFsControlFile, NtDll); - return (pfNtFsControlFile == NULL) ? STATUS_DLL_NOT_FOUND : pfNtFsControlFile(Handle, 0, 0, 0, &IoStatusBlock, FSCTL_UNLOCK_VOLUME, 0, 0, 0, 0); + return NtFsControlFile(Handle, 0, 0, 0, &IoStatusBlock, FSCTL_UNLOCK_VOLUME, 0, 0, 0, 0); } static __inline NTSTATUS _DismountDrive(IN HANDLE Handle) { IO_STATUS_BLOCK IoStatusBlock; - PF_INIT(NtFsControlFile, NtDll); - return (pfNtFsControlFile == NULL) ? STATUS_DLL_NOT_FOUND : pfNtFsControlFile(Handle, 0, 0, 0, &IoStatusBlock, FSCTL_DISMOUNT_VOLUME, 0, 0, 0, 0); + return NtFsControlFile(Handle, 0, 0, 0, &IoStatusBlock, FSCTL_DISMOUNT_VOLUME, 0, 0, 0, 0); } static __inline BOOLEAN _IsMounted(IN HANDLE Handle) { IO_STATUS_BLOCK IoStatusBlock; - PF_INIT(NtFsControlFile, NtDll); - return (pfNtFsControlFile == NULL) ? FALSE : - (BOOLEAN)(pfNtFsControlFile(Handle, 0, 0, 0, &IoStatusBlock, FSCTL_IS_VOLUME_MOUNTED, 0, 0, 0, 0) == STATUS_SUCCESS); + return (BOOLEAN)(NtFsControlFile(Handle, 0, 0, 0, &IoStatusBlock, FSCTL_IS_VOLUME_MOUNTED, 0, 0, 0, 0) == STATUS_SUCCESS); } static __inline NTSTATUS _CloseDisk(IN HANDLE Handle) { - PF_INIT(NtClose, Ntdll); - return (pfNtClose == NULL) ? STATUS_DLL_NOT_FOUND : pfNtClose(Handle); + return NtClose(Handle); } static PCSTR _NormalizeDeviceName(IN PCSTR Device, IN PSTR NormalizedDeviceNameBuffer, OUT __u64 *Offset, OUT __u64 *Size) @@ -320,12 +300,9 @@ static VOID _GetDeviceSize(IN HANDLE h, OUT unsigned __int64 *FsSize) LARGE_INTEGER li; *FsSize = 0; - PF_INIT(NtDeviceIoControlFile, NtDll); - if (pfNtDeviceIoControlFile == NULL) - return; RtlZeroMemory(&pi, sizeof(pi)); - Status = pfNtDeviceIoControlFile(h, NULL, NULL, NULL, &IoStatusBlock, + Status = NtDeviceIoControlFile(h, NULL, NULL, NULL, &IoStatusBlock, IOCTL_DISK_GET_PARTITION_INFO_EX, &pi, sizeof(pi), &pi, sizeof(pi)); if (NT_SUCCESS(Status)) { @@ -334,7 +311,7 @@ static VOID _GetDeviceSize(IN HANDLE h, OUT unsigned __int64 *FsSize) // No partitions: Try a drive geometry request RtlZeroMemory(&gi, sizeof(gi)); - Status = pfNtDeviceIoControlFile(h, NULL, NULL, NULL, &IoStatusBlock, + Status = NtDeviceIoControlFile(h, NULL, NULL, NULL, &IoStatusBlock, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, &gi, sizeof(gi), &gi, sizeof(gi)); @@ -389,8 +366,6 @@ static BOOLEAN _BlockIo(IN HANDLE Handle, IN LARGE_INTEGER Offset, IN ULONG Byte { IO_STATUS_BLOCK IoStatusBlock; NTSTATUS Status = STATUS_DLL_NOT_FOUND; - PF_INIT_OR_OUT(NtReadFile, NtDll); - PF_INIT_OR_OUT(NtWriteFile, NtDll); // Should be aligned assert((Bytes % 512) == 0); @@ -399,14 +374,13 @@ static BOOLEAN _BlockIo(IN HANDLE Handle, IN LARGE_INTEGER Offset, IN ULONG Byte LastWinError = 0; // Perform io if(Read) { - Status = pfNtReadFile(Handle, NULL, NULL, NULL, + Status = NtReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock, Buffer, Bytes, &Offset, NULL); } else { - Status = pfNtWriteFile(Handle, NULL, NULL, NULL, + Status = NtWriteFile(Handle, NULL, NULL, NULL, &IoStatusBlock, Buffer, Bytes, &Offset, NULL); } -out: if (!NT_SUCCESS(Status)) { if (ARGUMENT_PRESENT(Errno)) *Errno = _MapNtStatus(Status); @@ -431,10 +405,7 @@ static BOOLEAN _RawRead(IN HANDLE Handle, IN LARGE_INTEGER Offset, IN ULONG Byte static BOOLEAN _SetPartType(IN HANDLE Handle, IN UCHAR Type) { IO_STATUS_BLOCK IoStatusBlock; - PF_INIT(NtDeviceIoControlFile, NtDll); - if (pfNtDeviceIoControlFile == NULL) - return FALSE; - return NT_SUCCESS(pfNtDeviceIoControlFile(Handle, NULL, NULL, NULL, &IoStatusBlock, + return NT_SUCCESS(NtDeviceIoControlFile(Handle, NULL, NULL, NULL, &IoStatusBlock, IOCTL_DISK_SET_PARTITION_INFO, &Type, sizeof(Type), NULL, 0)); } diff --git a/src/process.h b/src/ntdll.h similarity index 75% rename from src/process.h rename to src/ntdll.h index 3c367ca5..309e4b27 100644 --- a/src/process.h +++ b/src/ntdll.h @@ -1,10 +1,10 @@ /* * Rufus: The Reliable USB Formatting Utility - * Process search functionality + * ntdll definitions & process search functionality * * Modified from System Informer (a.k.a. Process Hacker): * https://github.com/winsiderss/systeminformer - * Copyright © 2017-2023 Pete Batard <pete@akeo.ie> + * Copyright © 2017-2025 Pete Batard <pete@akeo.ie> * Copyright © 2017 dmex * Copyright © 2009-2016 wj32 * @@ -318,3 +318,122 @@ typedef struct { ProcessEntry Process[MAX_BLOCKING_PROCESSES]; // Fixed size process list uint32_t nPass; // Incremental counter of how many passes we ran } BlockingProcess; + +#if !defined(__MINGW32__) +typedef enum _FSINFOCLASS { + FileFsVolumeInformation = 1, + FileFsLabelInformation, + FileFsSizeInformation, + FileFsDeviceInformation, + FileFsAttributeInformation, + FileFsControlInformation, + FileFsFullSizeInformation, + FileFsObjectIdInformation, + FileFsDriverPathInformation, + FileFsVolumeFlagsInformation, + FileFsMaximumInformation +} FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS; +#endif + +NTSYSAPI PVOID NTAPI RtlCreateHeap( + IN ULONG Flags, + IN PVOID HeapBase OPTIONAL, + IN SIZE_T ReserveSize OPTIONAL, + IN SIZE_T CommitSize OPTIONAL, + IN PVOID Lock OPTIONAL, + IN PRTL_HEAP_PARAMETERS Parameters OPTIONAL); + +NTSYSAPI PVOID NTAPI RtlAllocateHeap( + IN HANDLE HeapHandle, + IN ULONG Flags OPTIONAL, + IN SIZE_T Size); + +NTSYSAPI BOOLEAN NTAPI RtlFreeHeap( + IN PVOID HeapHandle, + IN ULONG Flags OPTIONAL, + IN PVOID BaseAddress); + +NTSYSAPI PVOID NTAPI RtlDestroyHeap( + IN PVOID HeapHandle); + +NTSYSAPI NTSTATUS NTAPI NtOpenProcess( + OUT PHANDLE ProcessHandle, + IN ACCESS_MASK AccessMask, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN CLIENT_ID* ClientId); + +NTSYSCALLAPI NTSTATUS NTAPI NtOpenProcessToken( + IN HANDLE ProcessHandle, + IN ACCESS_MASK DesiredAccess, + OUT PHANDLE TokenHandle); + +NTSYSAPI NTSTATUS NTAPI NtAdjustPrivilegesToken( + IN HANDLE TokenHandle, + IN BOOLEAN DisableAllPrivileges, + IN PTOKEN_PRIVILEGES TokenPrivileges, + IN ULONG PreviousPrivilegesLength, + OUT PTOKEN_PRIVILEGES PreviousPrivileges OPTIONAL, + OUT PULONG RequiredLength OPTIONAL); + +NTSYSAPI NTSTATUS NTAPI NtDuplicateObject( + IN HANDLE SourceProcessHandle, + IN PHANDLE SourceHandle, + IN HANDLE TargetProcessHandle, + OUT PHANDLE TargetHandle, + IN ACCESS_MASK DesiredAccess OPTIONAL, + IN BOOLEAN InheritHandle, + IN ULONG Options); + +NTSYSCALLAPI NTSTATUS NTAPI NtQueryInformationFile( + IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID FileInformation, + IN ULONG Length, + IN FILE_INFORMATION_CLASS FileInformationClass); + +NTSYSAPI NTSTATUS NTAPI NtQueryVolumeInformationFile( + IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID FsInformation, + IN ULONG Length, + IN FS_INFORMATION_CLASS FsInformationClass); + +NTSYSAPI NTSTATUS NTAPI NtReadFile(IN HANDLE FileHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID Buffer, + IN ULONG Length, + IN PLARGE_INTEGER ByteOffset OPTIONAL, + IN PULONG Key OPTIONAL); + +NTSYSAPI NTSTATUS NTAPI NtWriteFile(IN HANDLE FileHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN PVOID Buffer, + IN ULONG Length, + IN PLARGE_INTEGER ByteOffset OPTIONAL, + IN PULONG Key OPTIONAL); + +NTSYSAPI NTSTATUS NTAPI NtFlushBuffersFile( + IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock); + +NTSYSAPI NTSTATUS NTAPI NtFsControlFile( + IN HANDLE FileHandle, + IN HANDLE Event, + IN PIO_APC_ROUTINE ApcRoutine, + IN PVOID ApcContext, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN ULONG FsControlCode, + IN PVOID InputBuffer, + IN ULONG InputBufferLength, + OUT PVOID OutputBuffer, + IN ULONG OutputBufferLength); + +NTSYSAPI NTSTATUS NTAPI NtDelayExecution( + IN BOOLEAN Alertable, + IN PLARGE_INTEGER DelayInterval); diff --git a/src/process.c b/src/process.c index 5505912e..6d3b8338 100644 --- a/src/process.c +++ b/src/process.c @@ -32,26 +32,12 @@ #include "rufus.h" #include "drive.h" -#include "process.h" +#include "ntdll.h" #include "missing.h" #include "msapi_utf8.h" -PF_TYPE_DECL(NTAPI, PVOID, RtlCreateHeap, (ULONG, PVOID, SIZE_T, SIZE_T, PVOID, PRTL_HEAP_PARAMETERS)); -PF_TYPE_DECL(NTAPI, PVOID, RtlDestroyHeap, (PVOID)); -PF_TYPE_DECL(NTAPI, PVOID, RtlAllocateHeap, (PVOID, ULONG, SIZE_T)); -PF_TYPE_DECL(NTAPI, BOOLEAN, RtlFreeHeap, (PVOID, ULONG, PVOID)); - -PF_TYPE_DECL(NTAPI, NTSTATUS, NtQuerySystemInformation, (SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG)); -PF_TYPE_DECL(NTAPI, NTSTATUS, NtQueryInformationFile, (HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FILE_INFORMATION_CLASS)); -PF_TYPE_DECL(NTAPI, NTSTATUS, NtQueryInformationProcess, (HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG)); PF_TYPE_DECL(NTAPI, NTSTATUS, NtWow64QueryInformationProcess64, (HANDLE, ULONG, PVOID, ULONG, PULONG)); PF_TYPE_DECL(NTAPI, NTSTATUS, NtWow64ReadVirtualMemory64, (HANDLE, ULONGLONG, PVOID, ULONG64, PULONG64)); -PF_TYPE_DECL(NTAPI, NTSTATUS, NtQueryObject, (HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG)); -PF_TYPE_DECL(NTAPI, NTSTATUS, NtDuplicateObject, (HANDLE, HANDLE, HANDLE, PHANDLE, ACCESS_MASK, ULONG, ULONG)); -PF_TYPE_DECL(NTAPI, NTSTATUS, NtOpenProcess, (PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, CLIENT_ID*)); -PF_TYPE_DECL(NTAPI, NTSTATUS, NtOpenProcessToken, (HANDLE, ACCESS_MASK, PHANDLE)); -PF_TYPE_DECL(NTAPI, NTSTATUS, NtAdjustPrivilegesToken, (HANDLE, BOOLEAN, PTOKEN_PRIVILEGES, ULONG, PTOKEN_PRIVILEGES, PULONG)); -PF_TYPE_DECL(NTAPI, NTSTATUS, NtClose, (HANDLE)); static PVOID PhHeapHandle = NULL; static HANDLE hSearchProcessThread = NULL; @@ -118,13 +104,10 @@ static NTSTATUS PhCreateHeap(VOID) if (PhHeapHandle != NULL) return STATUS_ALREADY_COMPLETE; - PF_INIT_OR_SET_STATUS(RtlCreateHeap, Ntdll); - - if (NT_SUCCESS(status)) { - PhHeapHandle = pfRtlCreateHeap(HEAP_NO_SERIALIZE | HEAP_GROWABLE, NULL, 2 * MB, 1 * MB, NULL, NULL); - if (PhHeapHandle == NULL) - status = STATUS_UNSUCCESSFUL; - } + + PhHeapHandle = RtlCreateHeap(HEAP_NO_SERIALIZE | HEAP_GROWABLE, NULL, 2 * MB, 1 * MB, NULL, NULL); + if (PhHeapHandle == NULL) + status = STATUS_UNSUCCESSFUL; return status; } @@ -136,14 +119,10 @@ static NTSTATUS PhDestroyHeap(VOID) if (PhHeapHandle == NULL) return STATUS_ALREADY_COMPLETE; - PF_INIT_OR_SET_STATUS(RtlDestroyHeap, Ntdll); - - if (NT_SUCCESS(status)) { - if (pfRtlDestroyHeap(PhHeapHandle) == NULL) { - PhHeapHandle = NULL; - } else { - status = STATUS_UNSUCCESSFUL; - } + if (RtlDestroyHeap(PhHeapHandle) == NULL) { + PhHeapHandle = NULL; + } else { + status = STATUS_UNSUCCESSFUL; } return status; @@ -161,11 +140,7 @@ static PVOID PhAllocate(SIZE_T Size) if (PhHeapHandle == NULL) return NULL; - PF_INIT(RtlAllocateHeap, Ntdll); - if (pfRtlAllocateHeap == NULL) - return NULL; - - return pfRtlAllocateHeap(PhHeapHandle, 0, Size); + return RtlAllocateHeap(PhHeapHandle, 0, Size); } /** @@ -178,9 +153,7 @@ static VOID PhFree(PVOID Memory) if (PhHeapHandle == NULL) return; - PF_INIT(RtlFreeHeap, Ntdll); - if (pfRtlFreeHeap != NULL) - pfRtlFreeHeap(PhHeapHandle, 0, Memory); + RtlFreeHeap(PhHeapHandle, 0, Memory); } /** @@ -198,16 +171,12 @@ NTSTATUS PhEnumHandlesEx(PSYSTEM_HANDLE_INFORMATION_EX *Handles) PVOID buffer; ULONG bufferSize; - PF_INIT_OR_SET_STATUS(NtQuerySystemInformation, Ntdll); - if (!NT_SUCCESS(status)) - return status; - bufferSize = initialBufferSize; buffer = PhAllocate(bufferSize); if (buffer == NULL) return STATUS_NO_MEMORY; - while ((status = pfNtQuerySystemInformation(SystemExtendedHandleInformation, + while ((status = NtQuerySystemInformation(SystemExtendedHandleInformation, buffer, bufferSize, NULL)) == STATUS_INFO_LENGTH_MISMATCH) { PhFree(buffer); bufferSize *= 2; @@ -253,15 +222,11 @@ NTSTATUS PhOpenProcess(PHANDLE ProcessHandle, ACCESS_MASK DesiredAccess, HANDLE return 0; } - PF_INIT_OR_SET_STATUS(NtOpenProcess, Ntdll); - if (!NT_SUCCESS(status)) - return status; - clientId.UniqueProcess = ProcessId; clientId.UniqueThread = NULL; InitializeObjectAttributes(&objectAttributes, NULL, 0, NULL, NULL); - status = pfNtOpenProcess(ProcessHandle, DesiredAccess, &objectAttributes, &clientId); + status = NtOpenProcess(ProcessHandle, DesiredAccess, &objectAttributes, &clientId); return status; } @@ -283,16 +248,12 @@ NTSTATUS PhQueryProcessesUsingVolumeOrFile(HANDLE VolumeOrFileHandle, ULONG bufferSize; IO_STATUS_BLOCK isb; - PF_INIT_OR_SET_STATUS(NtQueryInformationFile, NtDll); - if (!NT_SUCCESS(status)) - return status; - bufferSize = initialBufferSize; buffer = PhAllocate(bufferSize); if (buffer == NULL) return STATUS_INSUFFICIENT_RESOURCES; - while ((status = pfNtQueryInformationFile(VolumeOrFileHandle, &isb, buffer, bufferSize, + while ((status = NtQueryInformationFile(VolumeOrFileHandle, &isb, buffer, bufferSize, FileProcessIdsUsingFileInformation)) == STATUS_INFO_LENGTH_MISMATCH) { PhFree(buffer); bufferSize *= 2; @@ -390,9 +351,7 @@ static PWSTR GetProcessCommandLine(HANDLE hProcess) PBYTE* params; UNICODE_STRING* ucmdline; - PF_INIT_OR_OUT(NtQueryInformationProcess, NtDll); - - status = pfNtQueryInformationProcess(hProcess, 0, &pbi, sizeof(pbi), NULL); + status = NtQueryInformationProcess(hProcess, 0, &pbi, sizeof(pbi), NULL); if (!NT_SUCCESS(status)) goto out; @@ -454,10 +413,6 @@ static DWORD WINAPI SearchProcessThread(LPVOID param) char cmdline[MAX_PATH] = { 0 }, tmp[64]; int cur_pid, j, nHandles = 0; - PF_INIT_OR_OUT(NtQueryObject, Ntdll); - PF_INIT_OR_OUT(NtDuplicateObject, NtDll); - PF_INIT_OR_OUT(NtClose, NtDll); - // Initialize the blocking process struct memset(&blocking_process, 0, sizeof(blocking_process)); hLock = CreateMutexA(NULL, TRUE, NULL); @@ -558,7 +513,7 @@ static DWORD WINAPI SearchProcessThread(LPVOID param) if ((dupHandle != NULL) && (processHandle != NtCurrentProcess())) { TRY_AND_HANDLE( EXCEPTION_ACCESS_VIOLATION, - { pfNtClose(dupHandle); }, + { NtClose(dupHandle); }, { continue; } ); dupHandle = NULL; @@ -605,7 +560,7 @@ static DWORD WINAPI SearchProcessThread(LPVOID param) // Close the previous handle if (processHandle != NULL) { if (processHandle != NtCurrentProcess()) - pfNtClose(processHandle); + NtClose(processHandle); processHandle = NULL; } } @@ -646,7 +601,7 @@ static DWORD WINAPI SearchProcessThread(LPVOID param) // Now duplicate this handle onto our own process, so that we can access its properties if (processHandle == NtCurrentProcess()) continue; - status = pfNtDuplicateObject(processHandle, (HANDLE)handleInfo->HandleValue, + status = NtDuplicateObject(processHandle, (HANDLE)handleInfo->HandleValue, NtCurrentProcess(), &dupHandle, 0, 0, 0); if (!NT_SUCCESS(status)) continue; @@ -659,7 +614,7 @@ static DWORD WINAPI SearchProcessThread(LPVOID param) do { ULONG returnSize; // TODO: We might potentially still need a timeout on ObjectName queries, as PH does... - status = pfNtQueryObject(dupHandle, ObjectNameInformation, buffer, bufferSize, &returnSize); + status = NtQueryObject(dupHandle, ObjectNameInformation, buffer, bufferSize, &returnSize); if (status == STATUS_BUFFER_OVERFLOW || status == STATUS_INFO_LENGTH_MISMATCH || status == STATUS_BUFFER_TOO_SMALL) { bufferSize = returnSize; @@ -893,15 +848,12 @@ static BOOL IsProcessRunning(uint64_t pid) BOOL ret = FALSE; NTSTATUS status; - PF_INIT_OR_OUT(NtClose, NtDll); - status = PhOpenProcess(&hProcess, PROCESS_QUERY_LIMITED_INFORMATION, (HANDLE)(uintptr_t)pid); if (!NT_SUCCESS(status) || (hProcess == NULL)) return FALSE; if (GetExitCodeProcess(hProcess, &dwExitCode)) ret = (dwExitCode == STILL_ACTIVE); - pfNtClose(hProcess); -out: + NtClose(hProcess); return ret; } @@ -1039,11 +991,7 @@ BOOL EnablePrivileges(void) NTSTATUS status = STATUS_NOT_IMPLEMENTED; HANDLE tokenHandle; - PF_INIT_OR_OUT(NtClose, NtDll); - PF_INIT_OR_OUT(NtOpenProcessToken, NtDll); - PF_INIT_OR_OUT(NtAdjustPrivilegesToken, NtDll); - - status = pfNtOpenProcessToken(NtCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &tokenHandle); + status = NtOpenProcessToken(NtCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &tokenHandle); if (NT_SUCCESS(status)) { CHAR privilegesBuffer[FIELD_OFFSET(TOKEN_PRIVILEGES, Privileges) + @@ -1060,12 +1008,11 @@ BOOL EnablePrivileges(void) privileges->Privileges[0].Luid.LowPart = requestedPrivileges[i]; } - status = pfNtAdjustPrivilegesToken(tokenHandle, FALSE, privileges, 0, NULL, NULL); + status = NtAdjustPrivilegesToken(tokenHandle, FALSE, privileges, 0, NULL, NULL); - pfNtClose(tokenHandle); + NtClose(tokenHandle); } -out: if (!NT_SUCCESS(status)) ubprintf("NOTE: Could not set process privileges: %s", NtStatusError(status)); return NT_SUCCESS(status); diff --git a/src/rufus.rc b/src/rufus.rc index 0c24d45b..5b15515a 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.8.2244" +CAPTION "Rufus 4.8.2245" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2244,0 - PRODUCTVERSION 4,8,2244,0 + FILEVERSION 4,8,2245,0 + PRODUCTVERSION 4,8,2245,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2244" + VALUE "FileVersion", "4.8.2245" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2244" + VALUE "ProductVersion", "4.8.2245" END END BLOCK "VarFileInfo" diff --git a/src/stdio.c b/src/stdio.c index 5fa01f12..e4270114 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -35,6 +35,7 @@ #include <math.h> #include "rufus.h" +#include "ntdll.h" #include "missing.h" #include "settings.h" #include "resource.h" @@ -697,9 +698,7 @@ DWORD WaitForSingleObjectWithMessages(HANDLE hHandle, DWORD dwMilliseconds) #define NtCurrentPeb() (NtCurrentTeb()->ProcessEnvironmentBlock) #define RtlGetProcessHeap() (NtCurrentPeb()->Reserved4[1]) // NtCurrentPeb()->ProcessHeap, mangled due to deficiencies in winternl.h -PF_TYPE_DECL(NTAPI, NTSTATUS, NtCreateFile, (PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PIO_STATUS_BLOCK, PLARGE_INTEGER, ULONG, ULONG, ULONG, ULONG, PVOID, ULONG)); PF_TYPE_DECL(NTAPI, BOOLEAN, RtlDosPathNameToNtPathNameW, (PCWSTR, PUNICODE_STRING, PWSTR*, PVOID)); -PF_TYPE_DECL(NTAPI, BOOLEAN, RtlFreeHeap, (PVOID, ULONG, PVOID)); PF_TYPE_DECL(NTAPI, VOID, RtlSetLastWin32ErrorAndNtStatusFromNtStatus, (NTSTATUS)); HANDLE CreatePreallocatedFile(const char* lpFileName, DWORD dwDesiredAccess, @@ -714,9 +713,7 @@ HANDLE CreatePreallocatedFile(const char* lpFileName, DWORD dwDesiredAccess, LARGE_INTEGER allocationSize; NTSTATUS status = STATUS_SUCCESS; - PF_INIT_OR_SET_STATUS(NtCreateFile, Ntdll); PF_INIT_OR_SET_STATUS(RtlDosPathNameToNtPathNameW, Ntdll); - PF_INIT_OR_SET_STATUS(RtlFreeHeap, Ntdll); PF_INIT_OR_SET_STATUS(RtlSetLastWin32ErrorAndNtStatusFromNtStatus, Ntdll); if (!NT_SUCCESS(status)) { @@ -813,10 +810,10 @@ HANDLE CreatePreallocatedFile(const char* lpFileName, DWORD dwDesiredAccess, allocationSize.QuadPart = fileSize; // Call NtCreateFile - status = pfNtCreateFile(&fileHandle, dwDesiredAccess, &objectAttributes, &ioStatusBlock, + status = NtCreateFile(&fileHandle, dwDesiredAccess, &objectAttributes, &ioStatusBlock, &allocationSize, fileAttributes, dwShareMode, dwCreationDisposition, flags, NULL, 0); - pfRtlFreeHeap(RtlGetProcessHeap(), 0, ntPath.Buffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, ntPath.Buffer); wfree(lpFileName); pfRtlSetLastWin32ErrorAndNtStatusFromNtStatus(status); From 87efc7642afffcb40f9c1cc21b114dd4a470518d Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 14 May 2025 16:03:32 +0100 Subject: [PATCH 055/192] [iso] update libcdio to latest --- src/libcdio/cdio/ecma_167.h | 56 +++--- src/libcdio/cdio/iso9660.h | 3 +- src/libcdio/cdio/types.h | 11 +- src/libcdio/cdio/udf.h | 7 + src/libcdio/cdio/version.h | 6 +- src/libcdio/driver/_cdio_stdio.c | 7 + src/libcdio/driver/utf8.c | 90 ++++++--- src/libcdio/iso9660/iso9660.c | 2 +- src/libcdio/iso9660/iso9660_fs.c | 323 +++++++++++++++++-------------- src/libcdio/iso9660/rock.c | 2 +- src/libcdio/udf/udf_file.c | 48 ++--- src/libcdio/udf/udf_fs.c | 42 ++-- src/rufus.rc | 10 +- 13 files changed, 355 insertions(+), 252 deletions(-) diff --git a/src/libcdio/cdio/ecma_167.h b/src/libcdio/cdio/ecma_167.h index 81a12209..275224d8 100644 --- a/src/libcdio/cdio/ecma_167.h +++ b/src/libcdio/cdio/ecma_167.h @@ -1,5 +1,5 @@ -/* - Copyright (c) 2005, 2006, 2008, 2012 Rocky Bernstein <rocky@cpan.org> +/* + Copyright (c) 2005, 2006, 2008, 2012, 2024 Rocky Bernstein <rocky@gnu.org> Copyright (c) 2001-2002 Ben Fennema <bfennema@falcon.csc.calpoly.edu> This program is free software: you can redistribute it and/or modify @@ -59,7 +59,7 @@ distinct values of an enum. */ typedef enum { - VSD_STD_ID_SIZE = 5, /** Volume Structure Descriptor (ECMA 167r3 + VSD_STD_ID_SIZE = 5, /** Volume Structure Descriptor (ECMA 167r3 2/9.1) */ UDF_REGID_ID_SIZE = 23, /**< See identifier (ECMA 167r3 1/7.4) */ UDF_VOLID_SIZE = 32, @@ -105,7 +105,7 @@ typedef enum { CHARSPEC_TYPE_CS8 = 0x08, /**< Section 1/7.2.10 */ } udf_charspec_enum_t; - + typedef uint8_t udf_Uint8_t; /*! Section 1/7/1.1 */ typedef uint16_t udf_Uint16_t; /*! Section 1/7.1.3 */ typedef uint32_t udf_Uint32_t; /*! Section 1/7.1.5 */ @@ -142,12 +142,12 @@ struct udf_timestamp_s typedef struct udf_timestamp_s udf_timestamp_t; -/** Type and Time Zone (ECMA 167r3 1/7.3.1) +/** Type and Time Zone (ECMA 167r3 1/7.3.1) Imagine the below enum values as \#define'd values rather than distinct values of an enum. */ -typedef enum { +typedef enum { TIMESTAMP_TYPE_CUT = 0x0000, TIMESTAMP_TYPE_LOCAL = 0x1000, TIMESTAMP_TYPE_AGREEMENT = 0x2000, @@ -213,7 +213,7 @@ extern const char VSD_STD_ID_TEA01[sizeof("TEA01")-1]; #define VSD_STD_ID_BOOT2 "BOOT2" /**< ECMA-167 2/9.4 */ #define VSD_STD_ID_CD001 "CD001" /**< ECMA-119 */ #define VSD_STD_ID_CDW02 "CDW02" /**< ECMA-168 */ -#define VSD_STD_ID_NSR02 "NSR02" /**< ECMA-167, 3/9.1 +#define VSD_STD_ID_NSR02 "NSR02" /**< ECMA-167, 3/9.1 NOTE: ECMA-167, 2nd edition */ #define VSD_STD_ID_NSR03 "NSR03" /**< ECMA-167 3/9.1 */ #define VSD_STD_ID_TEA01 "TEA01" /**< ECMA-168 2/9.3 */ @@ -469,7 +469,7 @@ struct generic_partition_map1 struct generic_partition_map2 { udf_Uint8_t partition_map_type; - udf_Uint8_t partition_map_length; + udf_Uint8_t partition_map_length; udf_Uint8_t partition_id[62]; } GNUC_PACKED; @@ -478,7 +478,7 @@ struct unalloc_space_desc_s { udf_tag_t tag; udf_Uint32_t vol_desc_seq_num; - udf_Uint32_t i_alloc_descs; + udf_Uint32_t u_alloc_descs; udf_extent_ad_t allocDescs[0]; } GNUC_PACKED; @@ -605,7 +605,7 @@ struct udf_fileid_desc_s typedef struct udf_fileid_desc_s udf_fileid_desc_t; -/** File Characteristics (ECMA 167r3 4/14.4.3) +/** File Characteristics (ECMA 167r3 4/14.4.3) Imagine the below enumeration values are \#defines to be used in a bitmask rather than distinct values of an enum. @@ -623,7 +623,7 @@ struct allocExtDesc { udf_tag_t tag; udf_Uint32_t previous_alloc_ext_loc; - udf_Uint32_t i_alloc_descs; + udf_Uint32_t u_alloc_descs; } GNUC_PACKED; /** ICB Tag (ECMA 167r3 4/14.6) */ @@ -647,7 +647,7 @@ typedef struct udf_icbtag_s udf_icbtag_t; /** Strategy Type (ECMA 167r3 4/14.6.2) which helpfully points largely to 4/A.x */ -#define ICBTAG_STRATEGY_TYPE_UNDEF 0x0000 +#define ICBTAG_STRATEGY_TYPE_UNDEF 0x0000 #define ICBTAG_STRATEGY_TYPE_1 0x0001 /**< 4/A.2 Direct entries Uint16 */ #define ICBTAG_STRATEGY_TYPE_2 0x0002 /**< 4/A.3 List of ICB direct entries */ #define ICBTAG_STRATEGY_TYPE_3 0x0003 /**< 4/A.4 */ @@ -656,7 +656,7 @@ typedef struct udf_icbtag_s udf_icbtag_t; This is what's most often used. */ -/** File Type (ECMA 167r3 4/14.6.6) +/** File Type (ECMA 167r3 4/14.6.6) Imagine the below enum values as \#define'd values rather than distinct values of an enum. @@ -711,7 +711,7 @@ typedef enum { ICBTAG_FLAG_MULTIVERSIONS = 0x1000, ICBTAG_FLAG_STREAM = 0x2000 } icbtag_flag_enum_t; - + /** Indirect Entry (ECMA 167r3 4/14.7) */ struct indirect_entry_s { @@ -730,30 +730,30 @@ struct terminal_entry_s /** File Entry (ECMA 167r3 4/14.9) */ struct udf_file_entry_s { - udf_tag_t tag; + udf_tag_t tag; udf_icbtag_t icb_tag; /**< 4/14.9.2 */ udf_Uint32_t uid; /**< 4/14.9.3 */ udf_Uint32_t gid; /**< 4/14.9.4 */ udf_Uint32_t permissions; /**< 4/14.9.5 */ udf_Uint16_t link_count; /**< 4/14.9.6 */ - udf_Uint8_t rec_format; /**< 4/14.9.7 */ + udf_Uint8_t rec_format; /**< 4/14.9.7 */ udf_Uint8_t rec_disp_attr; /**< 4/14.9.8 */ udf_Uint32_t rec_len; /**< 4/14.9.9 */ udf_Uint64_t info_len; /**< 4/14.9.10 */ udf_Uint64_t logblks_recorded; /**< 4/14.9.11 */ - udf_timestamp_t access_time; /**< 4/14.9.12 - last access to - any stream of file prior to + udf_timestamp_t access_time; /**< 4/14.9.12 - last access to + any stream of file prior to recording file entry */ - udf_timestamp_t modification_time; /**< 4/14.9.13 - last access to - modification to any stream of + udf_timestamp_t modification_time; /**< 4/14.9.13 - last access to + modification to any stream of file */ udf_timestamp_t attribute_time; udf_Uint32_t checkpoint; udf_long_ad_t ext_attr_ICB; udf_regid_t imp_id; udf_Uint64_t unique_ID; - udf_Uint32_t i_extended_attr; - udf_Uint32_t i_alloc_descs; + udf_Uint32_t u_extended_attr; + udf_Uint32_t u_alloc_descs; /* The following union allows file entry reuse without worrying about overflows, by ensuring the struct is always the maximum possible size allowed by the specs: one UDF block. */ @@ -969,7 +969,7 @@ struct partitionIntegrityEntry /** Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) */ /** Logical Volume Header Descriptor (ECMA 167r3 4/14.15) */ -struct logical_vol_header_desc_s +struct logical_vol_header_desc_s { udf_Uint64_t uniqueID; udf_Uint8_t reserved[24]; @@ -1001,14 +1001,14 @@ struct extended_file_entry udf_Uint64_t info_len; /**< 4/14.17.10 & 4/14.9.10 */ udf_Uint64_t object_size; /**< 4/14.17.11 */ udf_Uint64_t logblks_recorded; /**< 4/14.17.12 & 4/14.9.11 */ - udf_timestamp_t access_time; /**< 4/14.17.13 & 4/14.9.12 - last + udf_timestamp_t access_time; /**< 4/14.17.13 & 4/14.9.12 - last access to any stream of file */ udf_timestamp_t modification_time; /**< 4/14.17.14 & 4/14.9.13 - last - modification to any stream of + modification to any stream of file*/ udf_timestamp_t create_time; /**< 4/14.17.15 */ - udf_timestamp_t attribute_time; /**< 4/14.17.16 & 4/14.9.14 - - most recent create or modify + udf_timestamp_t attribute_time; /**< 4/14.17.16 & 4/14.9.14 - + most recent create or modify time */ udf_Uint32_t checkpoint; udf_Uint32_t reserved; /**< #00 bytes */ @@ -1038,5 +1038,5 @@ extern icbtag_file_type_enum_t debug_icbtag_file_type_enum; extern icbtag_flag_enum_t debug_flag_enum; extern ecma_167_enum1_t debug_ecma_167_enum1; extern ecma_167_timezone_enum_t debug_ecma_167_timezone_enum; - + #endif /* CDIO_ECMA_167_H */ diff --git a/src/libcdio/cdio/iso9660.h b/src/libcdio/cdio/iso9660.h index 46115470..a9d9ea54 100644 --- a/src/libcdio/cdio/iso9660.h +++ b/src/libcdio/cdio/iso9660.h @@ -940,12 +940,13 @@ iso9660_dir_calc_record_size (unsigned int namelen, unsigned int su_len); lsn and return information about it. @param p_cdio the CD object to read from + @param i_lsn an lsn to find @return stat_t of entry if we found lsn, or NULL otherwise. Caller must free return value using iso9660_stat_free(). */ -#define iso9660_fs_find_lsn iso9660_find_fs_lsn iso9660_stat_t *iso9660_fs_find_lsn(CdIo_t *p_cdio, lsn_t i_lsn); +iso9660_stat_t *iso9660_find_fs_lsn(CdIo_t *p_cdio, lsn_t i_lsn); /*! diff --git a/src/libcdio/cdio/types.h b/src/libcdio/cdio/types.h index dc0f90cf..40f07229 100644 --- a/src/libcdio/cdio/types.h +++ b/src/libcdio/cdio/types.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2008, 2012, 2017 2019 + Copyright (C) 2002-2008, 2012, 2017, 2019, 2024 Rocky Bernstein <rocky@gnu.org> Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org> @@ -31,6 +31,8 @@ extern "C" { # include <stdbool.h> #endif /* __cplusplus */ +#include <stddef.h> + /* If <sys/types.h> is not available on your platform please contact the libcdio mailing list so that we can fix it! */ #if !defined(ARE_THERE_STILL_ENVS_WITHOUT_SYS_TYPES) @@ -130,6 +132,9 @@ typedef uint8_t ubyte; #define GNUC_CONST #define GNUC_UNUSED #define GNUC_PACKED +#ifdef _MSC_VER +#define __PRETTY_FUNCTION__ __FUNCSIG__ +#endif #endif /* !__GNUC__ */ #if defined(__MINGW32__) || (defined( __clang_major__) && __clang_major__ > 9) @@ -159,10 +164,6 @@ typedef uint8_t ubyte; #else # define GNUC_LIKELY(x) (x) # define GNUC_UNLIKELY(x) (x) -#endif - -#ifndef NULL -# define NULL ((void*) 0) #endif /** Provide a notice for deprecated elements. Before gcc 4.5 'deprecated' diff --git a/src/libcdio/cdio/udf.h b/src/libcdio/cdio/udf.h index 2f8d374a..a5c6278f 100644 --- a/src/libcdio/cdio/udf.h +++ b/src/libcdio/cdio/udf.h @@ -190,6 +190,13 @@ extern "C" { bool udf_get_lba(const udf_file_entry_t *p_udf_fe, /*out*/ uint32_t *start, /*out*/ uint32_t *end); + /** + * Seek to a specific offset in a UDF file. + * The offset *must* be a multiple of UDF_BLOCKSIZE. + * Returns true if the position was successfully changed, or false on + * any error condition (such as offset out of range or not aligned to + * UDF_BLOCKSIZE). + */ bool udf_setpos(udf_dirent_t* p_udf_dirent, off_t offset); #ifdef __cplusplus diff --git a/src/libcdio/cdio/version.h b/src/libcdio/cdio/version.h index fd72ae05..ab25158d 100644 --- a/src/libcdio/cdio/version.h +++ b/src/libcdio/cdio/version.h @@ -1,19 +1,19 @@ /** \file version.h * * \brief A file containing the libcdio package version - * number (20000) and OS build name. + * number (20201) and OS build name. */ /*! CDIO_VERSION is a C-Preprocessor macro of a string that shows what version is used. cdio_version_string has the same value, but it is a constant variable that can be accessed at run time. */ -#define CDIO_VERSION "2.1.0 (Rufus)" +#define CDIO_VERSION "2.2.1 (Rufus)" extern const char *cdio_version_string; /**< = CDIO_VERSION */ /*! LIBCDIO_VERSION_NUM is a C-Preprocessor macro that can be used for testing in the C preprocessor. libcdio_version_num has the same value, but it is a constant variable that can be accessed at run time. */ -#define LIBCDIO_VERSION_NUM 20000 +#define LIBCDIO_VERSION_NUM 20201 extern const unsigned int libcdio_version_num; /**< = LIBCDIO_VERSION_NUM */ diff --git a/src/libcdio/driver/_cdio_stdio.c b/src/libcdio/driver/_cdio_stdio.c index 1d46b156..710e86b6 100644 --- a/src/libcdio/driver/_cdio_stdio.c +++ b/src/libcdio/driver/_cdio_stdio.c @@ -210,6 +210,13 @@ _stdio_read(void *user_data, void *buf, size_t count) _UserData *const ud = user_data; long read_count; + // Define a safe buffer size for _stdio_read + const size_t MAX_ALLOWED_COUNT = 0x100000; + if (count > MAX_ALLOWED_COUNT) { + cdio_error("Requested count exceeds maximum allowed value.\n"); + return 0; + } + read_count = fread(buf, 1, count, ud->fd); if (read_count != count) diff --git a/src/libcdio/driver/utf8.c b/src/libcdio/driver/utf8.c index d9a9a573..81dca397 100644 --- a/src/libcdio/driver/utf8.c +++ b/src/libcdio/driver/utf8.c @@ -288,7 +288,7 @@ bool cdio_charset_from_utf8(cdio_utf8_t * src, char ** dst, wchar_t* le_dst; size_t i, len; - if (src == NULL || dst == NULL || dst_len == NULL || dst_charset == NULL || strcmp(dst_charset, "UTF-8") != 0) + if (src == NULL || dst == NULL || dst_len == NULL || dst_charset == NULL || strcmp(dst_charset, "UCS-2BE") != 0) return false; /* Eliminate empty strings */ @@ -314,37 +314,79 @@ bool cdio_charset_from_utf8(cdio_utf8_t * src, char ** dst, bool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst, const char *src_charset) { - wchar_t* le_src; - int i; + int codepage = 0; + wchar_t* wstr = NULL; + int i, size = 0; - if (src == NULL || dst == NULL || src_charset == NULL || strcmp(src_charset, "UCS-2BE") != 0) + if (src == NULL || dst == NULL || src_charset == NULL) return false; - /* Compute UCS-2 src length */ - if (src_len == (size_t)-1) { - for (src_len = 0; ((uint16_t*)src)[src_len] !=0; src_len++); - } else { - src_len >>=1; + /* Convert big endian to little endian */ + if (strcmp(src_charset, "UCS-2BE") == 0) { + /* Compute UCS-2 src length */ + if (src_len == (size_t)-1) { + for (src_len = 0; ((uint16_t*)src)[src_len] !=0; src_len++); + } else { + src_len >>=1; + } + + /* Eliminate empty strings */ + if ((src_len < 1) || ((src[0] == 0) && (src[1] == 0))) { + *dst = NULL; + return false; + } + + /* Perform byte reversal */ + wstr = (wchar_t*)calloc(src_len+1, sizeof(wchar_t)); + cdio_assert(wstr != NULL); + for (i=0; i<src_len; i++) { + ((char*)wstr)[2*i] = src[2*i+1]; + ((char*)wstr)[2*i+1] = src[2*i]; + } + wstr[src_len] = 0; } - /* Eliminate empty strings */ - if ((src_len < 1) || ((src[0] == 0) && (src[1] == 0))) { - *dst = NULL; - return false; + /* Convert multi-byte to wide string */ + if (strcmp(src_charset, "ASCII") == 0 || strcmp(src_charset, "ISO-8859-1") == 0) { + codepage = 28591; + } else if (strcmp(src_charset, "SHIFT_JIS") == 0) { + codepage = 932; } - /* Perform byte reversal */ - le_src = (wchar_t*)malloc(2*src_len+2); - cdio_assert(le_src != NULL); - for (i=0; i<src_len; i++) { - ((char*)le_src)[2*i] = src[2*i+1]; - ((char*)le_src)[2*i+1] = src[2*i]; - } - le_src[src_len] = 0; - *dst = cdio_wchar_to_utf8(le_src); - free(le_src); + if (codepage != 0) { + /* Compute src length */ + if (src_len == (size_t)-1) { + for (src_len = 0; src[src_len] != 0; src_len++); + } - return (*dst != NULL); + /* Eliminate empty strings */ + if ((src_len < 1) || (src[0] == 0)) { + *dst = NULL; + return false; + } + + /* Find out the size we need to allocate for our converted string */ + size = MultiByteToWideChar(codepage, 0, src, -1, NULL, 0); + if (size <= 1) /* An empty string would be size 1 */ + return false; + + if ((wstr = (wchar_t*)calloc(size, sizeof(wchar_t))) == NULL) + return false; + + if (MultiByteToWideChar(CP_UTF8, 0, src, -1, wstr, size) != size) { + free(wstr); + return false; + } + } + + /* Convert wide string to UTF-8 */ + if (wstr != NULL) { + *dst = cdio_wchar_to_utf8(wstr); + free(wstr); + return (*dst != NULL); + } + + return false; } #else # error "The iconv library is needed to build drivers, but it is not detected" diff --git a/src/libcdio/iso9660/iso9660.c b/src/libcdio/iso9660/iso9660.c index 501d28c9..66be8555 100644 --- a/src/libcdio/iso9660/iso9660.c +++ b/src/libcdio/iso9660/iso9660.c @@ -381,7 +381,7 @@ iso9660_set_ltime_with_timezone(const struct tm *p_tm, if (!p_tm) return; -#if defined(__GNUC__) +#if defined(__GNUC__) && !defined(__DARWIN_C_ANSI) #pragma GCC diagnostic ignored "-Wformat-truncation" #endif snprintf(_pvd_date, 17, diff --git a/src/libcdio/iso9660/iso9660_fs.c b/src/libcdio/iso9660/iso9660_fs.c index 513d8489..41d4e54b 100644 --- a/src/libcdio/iso9660/iso9660_fs.c +++ b/src/libcdio/iso9660/iso9660_fs.c @@ -252,7 +252,7 @@ iso9660_open_ext (const char *psz_path, contained in a file format that libiso9660 doesn't know natively (or knows imperfectly.) - Some tolerence allowed for positioning the ISO 9660 image. We scan + Some tolerance allowed for positioning the ISO 9660 image. We scan for STANDARD_ID and use that to set the eventual offset to adjust by (as long as that is <= i_fuzz). @@ -267,7 +267,7 @@ iso9660_open_fuzzy (const char *psz_path, uint16_t i_fuzz /*, mode*/) } /*! - Open an ISO 9660 image for reading with some tolerence for positioning + Open an ISO 9660 image for reading with some tolerance for positioning of the ISO9660 image. We scan for ISO_STANDARD_ID and use that to set the eventual offset to adjust by (as long as that is <= i_fuzz). @@ -341,7 +341,7 @@ get_member_id(iso9660_t *p_iso, cdio_utf8_t **p_psz_member_id, } #ifdef HAVE_JOLIET if (p_iso->u_joliet_level) { - /* Translate USC-2 string from Secondary Volume Descriptor */ + /* Translate UCS-2 string from Secondary Volume Descriptor */ if (cdio_charset_to_utf8(svd_member, max_size, p_psz_member_id, "UCS-2BE")) { /* NB: *p_psz_member_id is never NULL on success. */ @@ -437,7 +437,7 @@ bool iso9660_ifs_get_publisher_id(iso9660_t *p_iso, } /*! - Return a string containing the PVD's publisher id with trailing + Return a string containing the PVD's system id with trailing blanks removed. */ bool iso9660_ifs_get_system_id(iso9660_t *p_iso, @@ -450,7 +450,7 @@ bool iso9660_ifs_get_system_id(iso9660_t *p_iso, } /*! - Return a string containing the PVD's publisher id with trailing + Return a string containing the PVD's volume id with trailing blanks removed. */ bool iso9660_ifs_get_volume_id(iso9660_t *p_iso, @@ -463,7 +463,7 @@ bool iso9660_ifs_get_volume_id(iso9660_t *p_iso, } /*! - Return a string containing the PVD's publisher id with trailing + Return a string containing the PVD's volumeset id with trailing blanks removed. */ bool iso9660_ifs_get_volumeset_id(iso9660_t *p_iso, @@ -522,7 +522,7 @@ iso9660_ifs_read_superblock (iso9660_t *p_iso, p_iso->u_joliet_level = 0; - /* There may be multiple Secondary Volume Descriptors (eg. El Torito + Joliet) */ + /* There may be multiple Secondary Volume Descriptors (e.g. El Torito + Joliet) */ for (i=1; (0 != iso9660_iso_seek_read (p_iso, &p_svd, ISO_PVD_SECTOR+i, 1)); i++) { if (ISO_VD_END == from_711(p_svd.type) ) /* Last SVD */ break; @@ -991,7 +991,7 @@ _iso9660_dir_to_statbuf (iso9660_dir_t *p_iso9660_dir, if (i_rr_fname > 0) { if (i_rr_fname > i_fname) { - /* realloc gives valgrind errors */ + /* realloc gives Valgrind errors */ iso9660_stat_t *p_stat_new = calloc(1, sizeof(iso9660_stat_t)+i_rr_fname+2); if (!p_stat_new) { @@ -1124,7 +1124,7 @@ _fs_stat_root (CdIo_t *p_cdio) if (!p_env->u_joliet_level) iso_extension_mask &= ~ISO_EXTENSION_JOLIET; - /* FIXME try also with Joliet.*/ + /* FIXME: try also with Joliet.*/ if ( !iso9660_fs_read_superblock (p_cdio, iso_extension_mask) ) { cdio_warn("Could not read ISO-9660 Superblock."); return NULL; @@ -1439,7 +1439,7 @@ typedef iso9660_stat_t * (stat_traverse_t) Get file status for psz_path into stat. NULL is returned on error. pathname version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names - are lowercased. + are downcased. */ static iso9660_stat_t * fs_stat_translate (void *p_image, stat_root_t stat_root, @@ -1467,7 +1467,7 @@ fs_stat_translate (void *p_image, stat_root_t stat_root, /*! Return file status for path name psz_path. NULL is returned on error. pathname version numbers in the ISO 9660 name are dropped, i.e. ;1 - is removed and if level 1 ISO-9660 names are lowercased. + is removed and if level 1 ISO-9660 names are downcased. @param p_cdio the CD object to read from @@ -1492,7 +1492,7 @@ iso9660_fs_stat_translate (CdIo_t *p_cdio, const char psz_path[]) @return file status for path name psz_path. NULL is returned on error. pathname version numbers in the ISO 9660 name are dropped, - i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased. + i.e. ;1 is removed and if level 1 ISO-9660 names are downcased. The caller must free the returned result using iso9660_stat_free(). */ iso9660_stat_t * @@ -1581,6 +1581,12 @@ iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[]) iso9660_stat_t *p_iso9660_stat = NULL; iso9660_stat_t *p_stat; + unsigned offset = 0; + uint8_t *_dirbuf = NULL; + uint32_t blocks; + CdioISO9660DirList_t *retval; + bool skip_following_extents = false; + if (!p_cdio) return NULL; if (!psz_path) return NULL; @@ -1594,64 +1600,76 @@ iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[]) return NULL; } - { - unsigned offset = 0; - uint8_t *_dirbuf = NULL; - uint32_t blocks = CDIO_EXTENT_BLOCKS(p_stat->total_size); - CdioISO9660DirList_t *retval = _cdio_list_new (); - bool skip_following_extents = false; + /* Check for overflow on 32-bit systems. + uint32_t has a limited maximum value, and if p_stat->total_size (the total + size of the directory) is very large, the calculation might exceed this limit. + */ + if (p_stat->total_size > SIZE_MAX / ISO_BLOCKSIZE) { + cdio_warn("Total size is too large"); + iso9660_stat_free(p_stat); + return NULL; + } - _dirbuf = calloc(1, blocks * ISO_BLOCKSIZE); - if (!_dirbuf) - { + blocks = CDIO_EXTENT_BLOCKS(p_stat->total_size); + retval = _cdio_list_new (); + + /* Check for potential integer overflow when calculating total blocks */ + if (blocks > (SIZE_MAX / ISO_BLOCKSIZE)) { + cdio_warn("Total size is too large"); + iso9660_stat_free(p_stat); + return NULL; + } + + _dirbuf = calloc(1, blocks * ISO_BLOCKSIZE); + if (!_dirbuf) + { cdio_warn("Couldn't calloc(1, %d)", blocks * ISO_BLOCKSIZE); iso9660_stat_free(p_stat); iso9660_dirlist_free(retval); return NULL; - } - - if (cdio_read_data_sectors (p_cdio, _dirbuf, p_stat->lsn, - ISO_BLOCKSIZE, blocks)) { - iso9660_stat_free(p_stat); - iso9660_dirlist_free(retval); - return NULL; } - while (offset < (blocks * ISO_BLOCKSIZE)) - { - p_iso9660_dir = (void *) &_dirbuf[offset]; + if (cdio_read_data_sectors (p_cdio, _dirbuf, p_stat->lsn, + ISO_BLOCKSIZE, blocks)) { + iso9660_stat_free(p_stat); + iso9660_dirlist_free(retval); + return NULL; + } - if (iso9660_check_dir_block_end(p_iso9660_dir, &offset)) - continue; + while (offset < (blocks * ISO_BLOCKSIZE)) + { + p_iso9660_dir = (void *) &_dirbuf[offset]; - if (skip_following_extents) { - /* Do not register remaining extents of ill file */ - p_iso9660_stat = NULL; - } else { - p_iso9660_stat = _iso9660_dir_to_statbuf(p_iso9660_dir, - p_iso9660_stat, p_cdio, - dunno, p_env->u_joliet_level); - if (NULL == p_iso9660_stat) - skip_following_extents = true; /* Start ill file mode */ - } - if ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0) - skip_following_extents = false; /* Ill or not: The file ends now */ + if (iso9660_check_dir_block_end(p_iso9660_dir, &offset)) + continue; - if ((p_iso9660_stat) && - ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0)) { - _cdio_list_append (retval, p_iso9660_stat); - p_iso9660_stat = NULL; - } + if (skip_following_extents) { + /* Do not register remaining extents of ill file */ + p_iso9660_stat = NULL; + } else { + p_iso9660_stat = _iso9660_dir_to_statbuf(p_iso9660_dir, + p_iso9660_stat, p_cdio, + dunno, p_env->u_joliet_level); + if (NULL == p_iso9660_stat) + skip_following_extents = true; /* Start ill file mode */ + } + if ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0) + skip_following_extents = false; /* Ill or not: The file ends now */ - offset += iso9660_get_dir_len(p_iso9660_dir); + if ((p_iso9660_stat) && + ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0)) { + _cdio_list_append (retval, p_iso9660_stat); + p_iso9660_stat = NULL; } - cdio_assert (offset == (blocks * ISO_BLOCKSIZE)); + offset += iso9660_get_dir_len(p_iso9660_dir); + } - free(_dirbuf); - iso9660_stat_free(p_stat); - return retval; - } + cdio_assert (offset == (blocks * ISO_BLOCKSIZE)); + + free(_dirbuf); + iso9660_stat_free(p_stat); + return retval; } /*! @@ -1666,6 +1684,14 @@ iso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[]) iso9660_stat_t *p_iso9660_stat = NULL; iso9660_stat_t *p_stat; + long int ret; + unsigned offset = 0; + uint8_t *_dirbuf = NULL; + uint32_t blocks; + CdioList_t *retval; + size_t dirbuf_len; + bool skip_following_extents = false; + if (!p_iso) return NULL; if (!psz_path) return NULL; @@ -1673,7 +1699,7 @@ iso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[]) if (p_iso->boot_img[0].lsn != 0) { const char* path = (psz_path[0] == '/') ? &psz_path[1] : psz_path; if (_cdio_strnicmp(path, "[BOOT]", 6) == 0 && (path[6] == '\0' || path[6] == '/')) { - CdioList_t* retval = _cdio_list_new(); + retval = _cdio_list_new(); for (i = 0; i < MAX_BOOT_IMAGES && p_iso->boot_img[i].lsn != 0; i++) { p_iso9660_stat = calloc(1, sizeof(iso9660_stat_t) + 18); if (!p_iso9660_stat) { @@ -1701,97 +1727,102 @@ iso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[]) return NULL; } - { - long int ret; - unsigned offset = 0; - uint8_t *_dirbuf = NULL; - uint32_t blocks = CDIO_EXTENT_BLOCKS(p_stat->total_size); - CdioList_t *retval = _cdio_list_new (); - const size_t dirbuf_len = blocks * ISO_BLOCKSIZE; - bool skip_following_extents = false; + /* Check for overflow on 32-bit systems. + uint32_t has a limited maximum value, and if p_stat->total_size (the total + size of the directory) is very large, the calculation might exceed this limit. + */ - /* Add the virtual El-Torito "[BOOT]" directory to root */ - if (p_iso->boot_img[0].lsn != 0) { - if (psz_path[0] == '\0' || (psz_path[0] == '/' && psz_path[1] == '\0')) { - p_iso9660_stat = calloc(1, sizeof(iso9660_stat_t) + 7); - if (p_iso9660_stat) { - strcpy(p_iso9660_stat->filename, "[BOOT]"); - p_iso9660_stat->type = _STAT_DIR; - p_iso9660_stat->lsn = ISO_PVD_SECTOR + 1; - iso9660_get_ltime(&p_iso->pvd.creation_date, &p_iso9660_stat->tm); - _cdio_list_append(retval, p_iso9660_stat); - p_iso9660_stat = NULL; - } - } - } - - if (!dirbuf_len) - { - cdio_warn("Invalid directory buffer sector size %u", blocks); - iso9660_stat_free(p_stat); - _cdio_list_free (retval, true, NULL); - return NULL; - } - - _dirbuf = calloc(1, dirbuf_len); - if (!_dirbuf) - { - cdio_warn("Couldn't calloc(1, %lu)", (unsigned long)dirbuf_len); - iso9660_stat_free(p_stat); - _cdio_list_free (retval, true, NULL); - return NULL; - } - - ret = iso9660_iso_seek_read (p_iso, _dirbuf, p_stat->lsn, blocks); - if (ret != dirbuf_len) { - _cdio_list_free (retval, true, NULL); - iso9660_stat_free(p_stat); - free (_dirbuf); - return NULL; - } - - while (offset < (dirbuf_len)) - { - p_iso9660_dir = (void *) &_dirbuf[offset]; - - if (iso9660_check_dir_block_end(p_iso9660_dir, &offset)) - continue; - - if (skip_following_extents) { - /* Do not register remaining extents of ill file */ - p_iso9660_stat = NULL; - } else { - p_iso9660_stat = _iso9660_dir_to_statbuf(p_iso9660_dir, - p_iso9660_stat, - p_iso, - p_iso->b_xa, - p_iso->u_joliet_level); - if (NULL == p_iso9660_stat) - skip_following_extents = true; /* Start ill file mode */ - else if (p_iso9660_stat->rr.u_su_fields & ISO_ROCK_SUF_RE) - continue; /* Ignore RE entries */ - } - if ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0) - skip_following_extents = false; /* Ill or not: The file ends now */ - if ((p_iso9660_stat) && - ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0)) { - _cdio_list_append(retval, p_iso9660_stat); - p_iso9660_stat = NULL; - } - - offset += iso9660_get_dir_len(p_iso9660_dir); - } - - free (_dirbuf); + if (p_stat->total_size > SIZE_MAX / ISO_BLOCKSIZE) { + cdio_warn("Total size is too large"); iso9660_stat_free(p_stat); + return NULL; + } - if (offset != dirbuf_len) { - _cdio_list_free (retval, true, (CdioDataFree_t) iso9660_stat_free); + blocks = CDIO_EXTENT_BLOCKS(p_stat->total_size); + dirbuf_len = blocks * ISO_BLOCKSIZE; + retval = _cdio_list_new (); + + /* Add the virtual El-Torito "[BOOT]" directory to root */ + if (p_iso->boot_img[0].lsn != 0) { + if (psz_path[0] == '\0' || (psz_path[0] == '/' && psz_path[1] == '\0')) { + p_iso9660_stat = calloc(1, sizeof(iso9660_stat_t) + 7); + if (p_iso9660_stat) { + strcpy(p_iso9660_stat->filename, "[BOOT]"); + p_iso9660_stat->type = _STAT_DIR; + p_iso9660_stat->lsn = ISO_PVD_SECTOR + 1; + iso9660_get_ltime(&p_iso->pvd.creation_date, &p_iso9660_stat->tm); + _cdio_list_append(retval, p_iso9660_stat); + p_iso9660_stat = NULL; + } + } + } + + if (!dirbuf_len) + { + cdio_warn("Invalid directory buffer sector size %u", blocks); + iso9660_stat_free(p_stat); + _cdio_list_free (retval, true, NULL); return NULL; } - return retval; + _dirbuf = calloc(1, dirbuf_len); + if (!_dirbuf) + { + cdio_warn("Couldn't calloc(1, %lu)", (unsigned long)dirbuf_len); + iso9660_stat_free(p_stat); + _cdio_list_free (retval, true, NULL); + return NULL; + } + + ret = iso9660_iso_seek_read (p_iso, _dirbuf, p_stat->lsn, blocks); + if (ret != dirbuf_len) { + _cdio_list_free (retval, true, NULL); + iso9660_stat_free(p_stat); + free (_dirbuf); + return NULL; } + + while (offset < (dirbuf_len)) + { + p_iso9660_dir = (void *) &_dirbuf[offset]; + + if (iso9660_check_dir_block_end(p_iso9660_dir, &offset)) + continue; + + if (skip_following_extents) { + /* Do not register remaining extents of ill file */ + p_iso9660_stat = NULL; + } else { + p_iso9660_stat = _iso9660_dir_to_statbuf(p_iso9660_dir, + p_iso9660_stat, + p_iso, + p_iso->b_xa, + p_iso->u_joliet_level); + if (NULL == p_iso9660_stat) + skip_following_extents = true; /* Start ill file mode */ + else if (p_iso9660_stat->rr.u_su_fields & ISO_ROCK_SUF_RE) + continue; /* Ignore RE entries */ + } + if ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0) + skip_following_extents = false; /* Ill or not: The file ends now */ + if ((p_iso9660_stat) && + ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0)) { + _cdio_list_append(retval, p_iso9660_stat); + p_iso9660_stat = NULL; + } + + offset += iso9660_get_dir_len(p_iso9660_dir); + } + + free (_dirbuf); + iso9660_stat_free(p_stat); + + if (offset != dirbuf_len) { + _cdio_list_free (retval, true, (CdioDataFree_t) iso9660_stat_free); + return NULL; + } + + return retval; } typedef CdioISO9660FileList_t * (iso9660_readdir_t) @@ -1902,6 +1933,12 @@ iso9660_fs_find_lsn(CdIo_t *p_cdio, lsn_t i_lsn) free(psz_full_filename); return p_statbuf; } +iso9660_stat_t * +#if defined(__GNUC__) && !defined(__DARWIN_C_ANSI) +iso9660_find_fs_lsn(CdIo_t *p_cdio, lsn_t i_lsn) __attribute__ ((alias ("iso9660_fs_find_lsn"))); +#else +iso9660_find_fs_lsn(CdIo_t *p_cdio, lsn_t i_lsn); +#endif /*! Given a directory pointer, find the filesystem entry that contains @@ -2056,7 +2093,7 @@ iso9660_dirlist_free(CdioISO9660DirList_t *p_filelist) { /*! - Return true if ISO 9660 image has extended attrributes (XA). + Return true if ISO 9660 image has extended attributes (XA). */ bool iso9660_ifs_is_xa (const iso9660_t * p_iso) @@ -2143,7 +2180,7 @@ iso_have_rr_traverse (iso9660_t *p_iso, const iso9660_stat_t *_root, @param p_iso the ISO-9660 file image to get data from - @param u_file_limit the maximimum number of (non-rock-ridge) files + @param u_file_limit the maximum number of (non-rock-ridge) files to consider before giving up and returning "dunno". "dunno" can also be returned if there was some error encountered diff --git a/src/libcdio/iso9660/rock.c b/src/libcdio/iso9660/rock.c index fd03be24..565a2f57 100644 --- a/src/libcdio/iso9660/rock.c +++ b/src/libcdio/iso9660/rock.c @@ -68,7 +68,7 @@ realloc_symlink(/*in/out*/ iso9660_stat_t *p_stat, uint8_t i_grow) p_stat->rr.i_symlink_max = i_max; return (NULL != p_stat->rr.psz_symlink); } else { - unsigned int i_needed = p_stat->rr.i_symlink + i_grow ; + unsigned int i_needed = p_stat->rr.i_symlink + i_grow * 2; // Allocate enough space for growth and additional buffer if ( i_needed <= p_stat->rr.i_symlink_max) return true; else { diff --git a/src/libcdio/udf/udf_file.c b/src/libcdio/udf/udf_file.c index d969dcf0..219fd97e 100644 --- a/src/libcdio/udf/udf_file.c +++ b/src/libcdio/udf/udf_file.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2005, 2006, 2008, 2010, 2012 Rocky Bernstein <rocky@gnu.org> + Copyright (C) 2005, 2006, 2008, 2010, 2012, 2024 Rocky Bernstein <rocky@gnu.org> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -48,7 +48,7 @@ udf_get_filename(const udf_dirent_t *p_udf_dirent) /* Copy an UDF File Entry into a Directory Entry structure. */ bool -udf_get_file_entry(const udf_dirent_t *p_udf_dirent, +udf_get_file_entry(const udf_dirent_t *p_udf_dirent, /*out*/ udf_file_entry_t *p_udf_fe) { if (!p_udf_dirent) return false; @@ -59,10 +59,10 @@ udf_get_file_entry(const udf_dirent_t *p_udf_dirent, /*! Return the file id descriptor of the given file. */ -bool udf_get_fileid_descriptor(const udf_dirent_t *p_udf_dirent, +bool udf_get_fileid_descriptor(const udf_dirent_t *p_udf_dirent, /*out*/ udf_fileid_desc_t *p_udf_fid) { - + if (!p_udf_dirent) return false; if (!p_udf_dirent->fid) { /* FIXME do something about trying to get the descriptor. */ @@ -76,7 +76,7 @@ bool udf_get_fileid_descriptor(const udf_dirent_t *p_udf_dirent, /*! Return the number of hard links of the file. Return 0 if error. */ -uint16_t udf_get_link_count(const udf_dirent_t *p_udf_dirent) +uint16_t udf_get_link_count(const udf_dirent_t *p_udf_dirent) { if (p_udf_dirent) { return uint16_from_le(p_udf_dirent->fe.link_count); @@ -87,7 +87,7 @@ uint16_t udf_get_link_count(const udf_dirent_t *p_udf_dirent) /*! Return the file length the file. Return 2147483647L if error. */ -uint64_t udf_get_file_length(const udf_dirent_t *p_udf_dirent) +uint64_t udf_get_file_length(const udf_dirent_t *p_udf_dirent) { if (p_udf_dirent) { return uint64_from_le(p_udf_dirent->fe.info_len); @@ -109,11 +109,11 @@ udf_is_dir(const udf_dirent_t *p_udf_dirent) * block. */ static lba_t -offset_to_lba(const udf_dirent_t *p_udf_dirent, off_t i_offset, +offset_to_lba(const udf_dirent_t *p_udf_dirent, off_t i_offset, /*out*/ lba_t *pi_lba, /*out*/ uint32_t *pi_max_size) { udf_t *p_udf = p_udf_dirent->p_udf; - const udf_file_entry_t *p_udf_fe = (udf_file_entry_t *) + const udf_file_entry_t *p_udf_fe = (udf_file_entry_t *) &p_udf_dirent->fe; const udf_icbtag_t *p_icb_tag = &p_udf_fe->icb_tag; const uint16_t strat_type= uint16_from_le(p_icb_tag->strat_type); @@ -134,9 +134,9 @@ offset_to_lba(const udf_dirent_t *p_udf_dirent, off_t i_offset, uint64_t lsector; int ad_offset, ad_num = 0; uint16_t addr_ilk = uint16_from_le(p_icb_tag->flags&ICBTAG_FLAG_AD_MASK); - + switch (addr_ilk) { - case ICBTAG_FLAG_AD_SHORT: + case ICBTAG_FLAG_AD_SHORT: { udf_short_ad_t *p_icb; /* @@ -147,23 +147,23 @@ offset_to_lba(const udf_dirent_t *p_udf_dirent, off_t i_offset, do { i_offset -= icblen; ad_offset = sizeof(udf_short_ad_t) * ad_num; - if (ad_offset > uint32_from_le(p_udf_fe->i_alloc_descs)) { + if (ad_offset > uint32_from_le(p_udf_fe->u_alloc_descs)) { cdio_warn("File offset out of bounds"); return CDIO_INVALID_LBA; } - p_icb = (udf_short_ad_t *) - GETICB( uint32_from_le(p_udf_fe->i_extended_attr) + p_icb = (udf_short_ad_t *) + GETICB( uint32_from_le(p_udf_fe->u_extended_attr) + ad_offset ); icblen = p_icb->len; ad_num++; } while(i_offset >= icblen); - + lsector = (i_offset / UDF_BLOCKSIZE) + p_icb->pos; - + *pi_max_size = p_icb->len; } break; - case ICBTAG_FLAG_AD_LONG: + case ICBTAG_FLAG_AD_LONG: { /* * The allocation descriptor field is filled with long_ad's @@ -174,20 +174,20 @@ offset_to_lba(const udf_dirent_t *p_udf_dirent, off_t i_offset, do { i_offset -= icblen; ad_offset = sizeof(udf_long_ad_t) * ad_num; - if (ad_offset > uint32_from_le(p_udf_fe->i_alloc_descs)) { + if (ad_offset > uint32_from_le(p_udf_fe->u_alloc_descs)) { cdio_warn("File offset out of bounds"); return CDIO_INVALID_LBA; } - p_icb = (udf_long_ad_t *) - GETICB( uint32_from_le(p_udf_fe->i_extended_attr) + p_icb = (udf_long_ad_t *) + GETICB( uint32_from_le(p_udf_fe->u_extended_attr) + ad_offset ); icblen = p_icb->len; ad_num++; } while(i_offset >= icblen); - + lsector = (i_offset / UDF_BLOCKSIZE) + uint32_from_le(((udf_long_ad_t *)(p_icb))->loc.lba); - + *pi_max_size = p_icb->len; } break; @@ -232,7 +232,7 @@ offset_to_lba(const udf_dirent_t *p_udf_dirent, off_t i_offset, It is the caller's responsibility to ensure that count is less than the number of blocks recorded via p_udf_dirent. - If there is an error, cast the result to driver_return_code_t for + If there is an error, cast the result to driver_return_code_t for the specific error code. */ ssize_t @@ -243,14 +243,14 @@ udf_read_block(const udf_dirent_t *p_udf_dirent, void * buf, size_t count) driver_return_code_t ret; uint32_t i_max_size=0; udf_t *p_udf = p_udf_dirent->p_udf; - lba_t i_lba = offset_to_lba(p_udf_dirent, p_udf->i_position, &i_lba, + lba_t i_lba = offset_to_lba(p_udf_dirent, p_udf->i_position, &i_lba, &i_max_size); if (i_lba != CDIO_INVALID_LBA) { uint32_t i_max_blocks = CEILING(i_max_size, UDF_BLOCKSIZE); if ( i_max_blocks < count ) { cdio_warn("read count %u is larger than %u extent size.", (unsigned int)count, i_max_blocks); - cdio_warn("read count truncated to %u", (unsigned int)count); + cdio_warn("read count truncated to %u", i_max_blocks); count = i_max_blocks; } ret = udf_read_sectors(p_udf, buf, i_lba, count); diff --git a/src/libcdio/udf/udf_fs.c b/src/libcdio/udf/udf_fs.c index 3009dad3..d74db3eb 100644 --- a/src/libcdio/udf/udf_fs.c +++ b/src/libcdio/udf/udf_fs.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2005-2006, 2008, 2011, 2013-2014, 2017 + Copyright (C) 2005-2006, 2008, 2011, 2013-2014, 2017, 2024 Rocky Bernstein <rocky@gnu.org> This program is free software: you can redistribute it and/or modify @@ -161,15 +161,19 @@ bool udf_get_lba(const udf_file_entry_t *p_udf_fe, /*out*/ uint32_t *start, /*out*/ uint32_t *end) { - if (! p_udf_fe->i_alloc_descs) + if (! p_udf_fe->u_alloc_descs) return false; + // check the validity of the u_extended_attr member + if (p_udf_fe->u_extended_attr > UINT32_MAX - sizeof(udf_short_ad_t)) + return false; + switch (p_udf_fe->icb_tag.flags & ICBTAG_FLAG_AD_MASK) { case ICBTAG_FLAG_AD_SHORT: { /* The allocation descriptor field is filled with short_ad's. */ udf_short_ad_t *p_ad = (udf_short_ad_t *) - (p_udf_fe->u.ext_attr + uint32_from_le(p_udf_fe->i_extended_attr)); + (p_udf_fe->u.ext_attr + uint32_from_le(p_udf_fe->u_extended_attr)); *start = uint32_from_le(p_ad->pos); *end = *start + @@ -181,7 +185,7 @@ udf_get_lba(const udf_file_entry_t *p_udf_fe, { /* The allocation descriptor field is filled with long_ad's */ udf_long_ad_t *p_ad = (udf_long_ad_t *) - (p_udf_fe->u.ext_attr + uint32_from_le(p_udf_fe->i_extended_attr)); + (p_udf_fe->u.ext_attr + uint32_from_le(p_udf_fe->u_extended_attr)); *start = uint32_from_le(p_ad->loc.lba); /* ignore partition number */ *end = *start + @@ -192,7 +196,7 @@ udf_get_lba(const udf_file_entry_t *p_udf_fe, case ICBTAG_FLAG_AD_EXTENDED: { udf_ext_ad_t *p_ad = (udf_ext_ad_t *) - (p_udf_fe->u.ext_attr + uint32_from_le(p_udf_fe->i_extended_attr)); + (p_udf_fe->u.ext_attr + uint32_from_le(p_udf_fe->u_extended_attr)); *start = uint32_from_le(p_ad->ext_loc.lba); /* ignore partition number */ *end = *start + @@ -279,7 +283,7 @@ udf_fopen(udf_dirent_t *p_udf_root, const char *psz_name) The returned string is allocated and must be freed by the caller */ static char* -unicode16_decode(const uint8_t *data, int i_len) +unicode16_decode(const uint8_t *data, unsigned int u_len) { int i; char* r = NULL; @@ -287,14 +291,14 @@ unicode16_decode(const uint8_t *data, int i_len) switch (data[0]) { case 8: - r = (char*)calloc(i_len, 1); + r = (char*)calloc(u_len, 1); if (r == NULL) return r; - for (i=0; i<i_len-1; i++) + for (i=0; i<u_len-1; i++) r[i] = data[i+1]; return r; case 16: - cdio_charset_to_utf8((char*)&data[1], i_len-1, &r, "UCS-2BE"); + cdio_charset_to_utf8((char*)&data[1], u_len-1, &r, "UCS-2BE"); return r; default: /* Empty string, as some existing sections can't take a NULL pointer */ @@ -475,7 +479,7 @@ udf_get_volume_id(udf_t *p_udf, /*out*/ char *psz_volid, unsigned int i_volid) volid_len = strlen(r)+1; /* +1 for NUL terminator */ if (psz_volid != NULL) { - strncpy(psz_volid, r, MIN(volid_len, i_volid)); + strncpy(psz_volid, r, i_volid); psz_volid[i_volid-1] = 0; /* strncpy does not always terminate the dest */ } free(r); @@ -541,7 +545,7 @@ udf_get_logical_volume_id(udf_t *p_udf, /*out*/ char *psz_logvolid, unsigned int logvolid_len = strlen(r)+1; /* +1 for NUL terminator */ if (psz_logvolid != NULL) { - strncpy(psz_logvolid, r, MIN(logvolid_len, i_logvolid)); + strncpy(psz_logvolid, r, i_logvolid); psz_logvolid[i_logvolid-1] = 0; /* strncpy does not always terminate the dest */ } free(r); @@ -738,7 +742,7 @@ udf_readdir(udf_dirent_t *p_udf_dirent) (p_udf_dirent->fid->file_characteristics & UDF_FILE_PARENT) != 0; { - const unsigned int i_len = p_udf_dirent->fid->i_file_id; + const unsigned int u_len = p_udf_dirent->fid->i_file_id; if (DRIVER_OP_SUCCESS != udf_read_sectors(p_udf, &p_udf_dirent->fe, p_udf->i_part_start + uint32_from_le(p_udf_dirent->fid->icb.loc.lba), 1)) { @@ -748,7 +752,7 @@ udf_readdir(udf_dirent_t *p_udf_dirent) free_and_null(p_udf_dirent->psz_name); p = (uint8_t*)p_udf_dirent->fid->u.imp_use.data + p_udf_dirent->fid->u.i_imp_use; - p_udf_dirent->psz_name = unicode16_decode(p, i_len); + p_udf_dirent->psz_name = unicode16_decode(p, u_len); } return p_udf_dirent; } @@ -771,15 +775,19 @@ udf_dirent_free(udf_dirent_t *p_udf_dirent) return true; } -/*! - Seek to a specific offset in a UDF file. Must be a multiple of UDF_BLOCKSIZE. -*/ +/** + * Seek to a specific offset in a UDF file. + * The offset *must* be a multiple of UDF_BLOCKSIZE. + * Returns true if the position was successfully changed, or false on + * any error condition (such as offset out of range or not aligned to + * UDF_BLOCKSIZE). + */ bool udf_setpos(udf_dirent_t* p_udf_dirent, off_t offset) { if (!p_udf_dirent) return false; - if (offset % UDF_BLOCKSIZE || offset > uint64_from_le(p_udf_dirent->fe.info_len)) + if (offset % UDF_BLOCKSIZE || offset < 0 || offset > uint64_from_le(p_udf_dirent->fe.info_len)) return false; p_udf_dirent->p_udf->i_position = offset; return true; diff --git a/src/rufus.rc b/src/rufus.rc index 5b15515a..2569e285 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.8.2245" +CAPTION "Rufus 4.8.2246" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2245,0 - PRODUCTVERSION 4,8,2245,0 + FILEVERSION 4,8,2246,0 + PRODUCTVERSION 4,8,2246,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2245" + VALUE "FileVersion", "4.8.2246" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2245" + VALUE "ProductVersion", "4.8.2246" END END BLOCK "VarFileInfo" From bb8f231c072919db3a29fcc82bf23e367a270844 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 19 May 2025 13:28:23 +0100 Subject: [PATCH 056/192] [misc] fix Coverity warnings for Syslinux and libcdio * Also increase libcdio's ISO9660 read buffer sanity check to 1 GB. --- src/libcdio/driver/_cdio_stdio.c | 4 ++-- src/libcdio/driver/track.c | 1 + src/libcdio/driver/utf8.c | 26 +++++++++++++++----------- src/libcdio/iso9660/iso9660.c | 6 +++--- src/libcdio/iso9660/iso9660_fs.c | 1 + src/rufus.rc | 10 +++++----- src/syslinux/libfat/dumpdir.c | 2 +- src/syslinux/libinstaller/fs.c | 5 +++++ src/syslinux/libinstaller/syslxmod.c | 1 + 9 files changed, 34 insertions(+), 22 deletions(-) diff --git a/src/libcdio/driver/_cdio_stdio.c b/src/libcdio/driver/_cdio_stdio.c index 710e86b6..07f411f6 100644 --- a/src/libcdio/driver/_cdio_stdio.c +++ b/src/libcdio/driver/_cdio_stdio.c @@ -210,8 +210,8 @@ _stdio_read(void *user_data, void *buf, size_t count) _UserData *const ud = user_data; long read_count; - // Define a safe buffer size for _stdio_read - const size_t MAX_ALLOWED_COUNT = 0x100000; + // Define a max buffer size of 1 GB for _stdio_read + const size_t MAX_ALLOWED_COUNT = 0x40000000; if (count > MAX_ALLOWED_COUNT) { cdio_error("Requested count exceeds maximum allowed value.\n"); return 0; diff --git a/src/libcdio/driver/track.c b/src/libcdio/driver/track.c index a5906921..20f60a39 100644 --- a/src/libcdio/driver/track.c +++ b/src/libcdio/driver/track.c @@ -178,6 +178,7 @@ cdio_get_track(const CdIo_t *p_cdio, lsn_t lsn) { track_t i_low_track = cdio_get_first_track_num(p_cdio); + // coverity[overflow_const] track_t i_high_track = cdio_get_last_track_num(p_cdio)+1; track_t i_lead_track = i_high_track; diff --git a/src/libcdio/driver/utf8.c b/src/libcdio/driver/utf8.c index 81dca397..469a5bb5 100644 --- a/src/libcdio/driver/utf8.c +++ b/src/libcdio/driver/utf8.c @@ -321,8 +321,19 @@ bool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst, if (src == NULL || dst == NULL || src_charset == NULL) return false; - /* Convert big endian to little endian */ if (strcmp(src_charset, "UCS-2BE") == 0) { + codepage = -1; + } else if (strcmp(src_charset, "ASCII") == 0 || strcmp(src_charset, "ISO-8859-1") == 0) { + codepage = 28591; + } else if (strcmp(src_charset, "SHIFT_JIS") == 0) { + codepage = 932; + } else { + cdio_warn("Conversion from %s to UTF-8 is not implemented", src_charset); + return false; + } + + switch (codepage) { + case -1: /* Convert big endian to little endian */ /* Compute UCS-2 src length */ if (src_len == (size_t)-1) { for (src_len = 0; ((uint16_t*)src)[src_len] !=0; src_len++); @@ -344,16 +355,8 @@ bool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst, ((char*)wstr)[2*i+1] = src[2*i]; } wstr[src_len] = 0; - } - - /* Convert multi-byte to wide string */ - if (strcmp(src_charset, "ASCII") == 0 || strcmp(src_charset, "ISO-8859-1") == 0) { - codepage = 28591; - } else if (strcmp(src_charset, "SHIFT_JIS") == 0) { - codepage = 932; - } - - if (codepage != 0) { + break; + default: /* Convert multi-byte to wide string */ /* Compute src length */ if (src_len == (size_t)-1) { for (src_len = 0; src[src_len] != 0; src_len++); @@ -377,6 +380,7 @@ bool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst, free(wstr); return false; } + break; } /* Convert wide string to UTF-8 */ diff --git a/src/libcdio/iso9660/iso9660.c b/src/libcdio/iso9660/iso9660.c index 66be8555..4d6561b4 100644 --- a/src/libcdio/iso9660/iso9660.c +++ b/src/libcdio/iso9660/iso9660.c @@ -258,9 +258,9 @@ iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime, errno = 0; \ tmp = strtol(num, \ (char **)NULL, 10); \ - if ( tmp < INT_MIN || tmp > INT_MAX || \ - ((unsigned long)tmp + ADD_CONSTANT) > INT_MAX || \ - (tmp + ADD_CONSTANT) < INT_MIN ) \ + if ( tmp == LONG_MIN || tmp == LONG_MAX || \ + ((unsigned long)tmp + ADD_CONSTANT) == LONG_MAX || \ + (tmp + ADD_CONSTANT) == LONG_MIN ) \ return false; \ p_tm->TM_FIELD = tmp + ADD_CONSTANT; \ } diff --git a/src/libcdio/iso9660/iso9660_fs.c b/src/libcdio/iso9660/iso9660_fs.c index 41d4e54b..c6015044 100644 --- a/src/libcdio/iso9660/iso9660_fs.c +++ b/src/libcdio/iso9660/iso9660_fs.c @@ -1614,6 +1614,7 @@ iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[]) retval = _cdio_list_new (); /* Check for potential integer overflow when calculating total blocks */ + // coverity[dead_error_condition] if (blocks > (SIZE_MAX / ISO_BLOCKSIZE)) { cdio_warn("Total size is too large"); iso9660_stat_free(p_stat); diff --git a/src/rufus.rc b/src/rufus.rc index 2569e285..24d66fbc 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.8.2246" +CAPTION "Rufus 4.8.2247" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2246,0 - PRODUCTVERSION 4,8,2246,0 + FILEVERSION 4,8,2247,0 + PRODUCTVERSION 4,8,2247,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2246" + VALUE "FileVersion", "4.8.2247" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2246" + VALUE "ProductVersion", "4.8.2247" END END BLOCK "VarFileInfo" diff --git a/src/syslinux/libfat/dumpdir.c b/src/syslinux/libfat/dumpdir.c index 3493340a..4299c4b7 100644 --- a/src/syslinux/libfat/dumpdir.c +++ b/src/syslinux/libfat/dumpdir.c @@ -108,7 +108,7 @@ int libfat_dumpdir(struct libfat_filesystem *fs, libfat_dirpos_t *dp, di->name[ARRAYSIZE(di->name) - 1] = 0; if (di->name[0] == 0) { - for (i = 0, j = 0; i < 12; i++) { + for (i = 0, j = 0; i < 11; i++) { if ((i >= 8) && (dep->name[i] == ' ')) break; if (i == 8) diff --git a/src/syslinux/libinstaller/fs.c b/src/syslinux/libinstaller/fs.c index 19d69d3e..d1bf1378 100644 --- a/src/syslinux/libinstaller/fs.c +++ b/src/syslinux/libinstaller/fs.c @@ -38,14 +38,19 @@ void syslinux_make_bootsect(void *bs, int fs_type) const struct fat_boot_sector *sbs = (const struct fat_boot_sector *)boot_sector; + // The overruns are intended + // coverity[overrun-buffer-arg] memcpy(&bootsect->FAT_bsHead, &sbs->FAT_bsHead, FAT_bsHeadLen); + // coverity[overrun-buffer-arg] memcpy(&bootsect->FAT_bsCode, &sbs->FAT_bsCode, FAT_bsCodeLen); } else if (fs_type == NTFS) { struct ntfs_boot_sector *bootsect = bs; const struct ntfs_boot_sector *sbs = (const struct ntfs_boot_sector *)boot_sector; + // coverity[overrun-buffer-arg] memcpy(&bootsect->NTFS_bsHead, &sbs->NTFS_bsHead, NTFS_bsHeadLen); + // coverity[overrun-buffer-arg] memcpy(&bootsect->NTFS_bsCode, &sbs->NTFS_bsCode, NTFS_bsCodeLen); } } diff --git a/src/syslinux/libinstaller/syslxmod.c b/src/syslinux/libinstaller/syslxmod.c index 19e1fa82..e1293bdd 100644 --- a/src/syslinux/libinstaller/syslxmod.c +++ b/src/syslinux/libinstaller/syslxmod.c @@ -168,6 +168,7 @@ int syslinux_patch(const sector_t *sectp, int nsectors, #endif /* -1 for the pointer in the boot sector, -2 for the two ADVs */ + // coverity[tainted_data] generate_extents(ex, nptrs, sectp, nsect-1-2); /* ADV pointers */ From be5642ef335379904bedf8b876ff6c291500f267 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 19 May 2025 17:24:48 +0100 Subject: [PATCH 057/192] [iso] add more DD-only exceptions for openSUSE and Nobara * The openSUSE maintainers don't care about their users, so we have to care in their stead. * As for Nobara images, that use the Red Hat GRUB bootloaders with no support for NTFS and that include files larger than 4 GB, we now attempt to detect the filesystems supported by EFI GRUB, in order to decide how we can proceed with the writing of such images. We take this opportunity to improve our reporting on the GRUB bootloaders we detect. * Plus the usual Coverity dance. --- src/iso.c | 113 +++++++++++++++++++++---------- src/libcdio/iso9660/iso9660.c | 1 + src/libcdio/iso9660/iso9660_fs.c | 13 ++-- src/libcdio/iso9660/rock.c | 1 + src/libcdio/udf/udf_fs.c | 1 + src/rufus.c | 28 +++++++- src/rufus.h | 6 +- src/rufus.rc | 10 +-- src/stdfn.c | 8 ++- src/syslinux/libinstaller/fs.c | 4 ++ src/syslinux/win/ntfssect.c | 2 +- 11 files changed, 136 insertions(+), 51 deletions(-) diff --git a/src/iso.c b/src/iso.c index af4c9938..5b051865 100644 --- a/src/iso.c +++ b/src/iso.c @@ -127,7 +127,7 @@ static const int64_t old_c32_threshold[NB_OLD_C32] = OLD_C32_THRESHOLD; static uint8_t joliet_level = 0; static uint32_t md5sum_size = 0; static BOOL scan_only = FALSE; -static StrArray config_path, isolinux_path; +static StrArray config_path, isolinux_path, grub_filesystems; static char symlinked_syslinux[MAX_PATH], *md5sum_data = NULL, *md5sum_pos = NULL; // Ensure filenames do not contain invalid FAT32 or NTFS characters @@ -1035,7 +1035,7 @@ out: return r; } -void GetGrubVersion(char* buf, size_t buf_size) +void GetGrubVersion(char* buf, size_t buf_size, const char* source) { // In typical "I'll make my own Open Source... with blackjack and hookers!" fashion, // IBM/Red-Hat/Fedora took it upon themselves to "fix" the double space typo from the @@ -1047,6 +1047,7 @@ void GetGrubVersion(char* buf, size_t buf_size) const char* grub_version_str[] = { "GRUB version %s", "GRUB version %s" }; const char* grub_debug_is_enabled_str = "grub_debug_is_enabled"; const size_t max_string_size = 32; // The strings above *MUST* be no longer than this value + char grub_version[192] = { 0 }; size_t i, j; BOOL has_grub_debug_is_enabled = FALSE; @@ -1055,14 +1056,19 @@ void GetGrubVersion(char* buf, size_t buf_size) for (i = 0; i < buf_size - max_string_size; i++) { for (j = 0; j < ARRAYSIZE(grub_version_str); j++) { if (memcmp(&buf[i], grub_version_str[j], strlen(grub_version_str[j]) + 1) == 0) - static_strcpy(img_report.grub2_version, &buf[i + strlen(grub_version_str[j]) + 1]); + static_strcpy(grub_version, &buf[i + strlen(grub_version_str[j]) + 1]); } if (memcmp(&buf[i], grub_debug_is_enabled_str, strlen(grub_debug_is_enabled_str)) == 0) has_grub_debug_is_enabled = TRUE; } } - uprintf(" Reported Grub version: %s", img_report.grub2_version); + uprintf(" Detected GRUB version: %s (from '%s')", grub_version, source); + + if (img_report.grub2_version[0] != 0) + return; + + static_strcpy(img_report.grub2_version, grub_version); // <Shakes fist angrily> "KASPERSKYYYYYY!!!..." (https://github.com/pbatard/rufus/issues/467) // But seriously, these guys should know better than "security" through obscurity... @@ -1104,7 +1110,7 @@ void GetGrubVersion(char* buf, size_t buf_size) // Make sure we append '-nonstandard' and '-gdie' before the sanitized label. BOOL append_label = (safe_strcmp(img_report.grub2_version, "2.06") == 0); // Must be in the same order as we have on the server - if (img_report.has_grub2 > 1) + if ((img_report.has_grub2 & 0x7f) > 1) safe_strcat(img_report.grub2_version, sizeof(img_report.grub2_version), "-nonstandard"); if (has_grub_debug_is_enabled) safe_strcat(img_report.grub2_version, sizeof(img_report.grub2_version), "-gdie"); @@ -1116,13 +1122,30 @@ void GetGrubVersion(char* buf, size_t buf_size) } } +void GetGrubFs(char* buf, size_t buf_size) +{ + const char* grub_fshelp_str = "fshelp"; + const size_t max_string_size = 32; + size_t i; + + if (buf_size > max_string_size) { + for (i = 0; i < buf_size - max_string_size; i++) { + if (memcmp(&buf[i], grub_fshelp_str, strlen(grub_fshelp_str) + 1) == 0) { + if (buf[i + strlen(grub_fshelp_str) + 1] != 0 && strlen(&buf[i + strlen(grub_fshelp_str) + 1]) < 12) { + StrArrayAddUnique(&grub_filesystems, &buf[i + strlen(grub_fshelp_str) + 1], TRUE); + } + } + } + } +} + BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan) { const char* basedir[] = { "i386", "amd64", "minint" }; - const char* tmp_sif = ".\\txtsetup.sif~"; int k, r = 1; - char *tmp, *buf = NULL, *ext, *spacing = " "; + char *tmp, *ext, *spacing = " "; char path[MAX_PATH], path2[16]; + uint8_t* buf = NULL; uint16_t sl_version; size_t i, j, size, sl_index = 0; FILE* fd; @@ -1150,6 +1173,7 @@ BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan) // String array of all isolinux/syslinux locations StrArrayCreate(&config_path, 8); StrArrayCreate(&isolinux_path, 8); + StrArrayCreate(&grub_filesystems, 8); PrintInfo(0, MSG_202); } else { uprintf("Extracting files..."); @@ -1237,7 +1261,9 @@ try_iso: out: iso_blocking_status = -1; if (scan_only) { + const char* fs_name[] = { "fat", "exfat", "ntfs" }; struct __stat64 stat; + char fses[256] = { 0 }; // Find if there is a mismatch between the ISO size, as reported by the PVD, and the actual file size if ((iso9660_ifs_read_pvd(p_iso, &pvd)) && (_stat64U(src_iso, &stat) == 0)) img_report.mismatch_size = (int64_t)(iso9660_get_pvd_space_size(&pvd)) * ISO_BLOCKSIZE - stat.st_size; @@ -1277,10 +1303,8 @@ out: uprintf(" Will use '%s' for Syslinux", img_report.cfg_path); // Extract all of the isolinux.bin files we found to identify their versions for (i = 0; i < isolinux_path.Index; i++) { - char isolinux_tmp[MAX_PATH]; - static_sprintf(isolinux_tmp, "%sisolinux.tmp", temp_dir); - size = (size_t)ExtractISOFile(src_iso, isolinux_path.String[i], isolinux_tmp, FILE_ATTRIBUTE_NORMAL); - if ((size == 0) || (read_file(isolinux_tmp, (uint8_t**)&buf) != size)) { + size = (size_t)ReadISOFileToBuffer(src_iso, isolinux_path.String[i], &buf); + if (size == 0) { uprintf(" Could not access %s", isolinux_path.String[i]); } else { sl_version = GetSyslinuxVersion(buf, size, &ext); @@ -1289,7 +1313,7 @@ out: img_report.sl_version = sl_version; sl_index = i; } else if ((img_report.sl_version != sl_version) || (safe_strcmp(img_report.sl_version_ext, ext) != 0)) { - uprintf(" Found conflicting isolinux versions:\r\n '%s' (%d.%02d%s) vs '%s' (%d.%02d%s)", + uprintf(" Found conflicting Isolinux versions:\r\n '%s' (%d.%02d%s) vs '%s' (%d.%02d%s)", isolinux_path.String[sl_index], SL_MAJOR(img_report.sl_version), SL_MINOR(img_report.sl_version), img_report.sl_version_ext, isolinux_path.String[i], SL_MAJOR(sl_version), SL_MINOR(sl_version), ext); // Workaround for Antergos and other ISOs, that have multiple Syslinux versions. @@ -1303,7 +1327,6 @@ out: } safe_free(buf); } - DeleteFileU(isolinux_tmp); } if (img_report.sl_version != 0) { static_sprintf(img_report.sl_version_str, "%d.%02d", @@ -1330,17 +1353,17 @@ out: // during scan, to see if /minint was provided for OsLoadOptions, as it decides // whether we should use 0x80 or 0x81 as the disk ID in the MBR static_sprintf(path, "/%s/txtsetup.sif", - basedir[((img_report.winpe&WINPE_I386) == WINPE_I386)?0:((img_report.winpe&WINPE_AMD64) == WINPE_AMD64?1:2)]); - ExtractISOFile(src_iso, path, tmp_sif, FILE_ATTRIBUTE_NORMAL); - tmp = get_token_data_file("OsLoadOptions", tmp_sif); + basedir[((img_report.winpe & WINPE_I386) == WINPE_I386) ? 0 : ((img_report.winpe & WINPE_AMD64) == WINPE_AMD64 ? 1 : 2)]); + size = (size_t)ReadISOFileToBuffer(src_iso, path, &buf); + tmp = get_token_data_buffer("OsLoadOptions", 1, buf, size); if (tmp != NULL) { for (i = 0; i < strlen(tmp); i++) tmp[i] = (char)tolower(tmp[i]); uprintf(" Checking txtsetup.sif:\r\n OsLoadOptions = %s", tmp); img_report.uses_minint = (strstr(tmp, "/minint") != NULL); + safe_free(tmp); } - DeleteFileU(tmp_sif); - safe_free(tmp); + safe_free(buf); } if (HAS_WININST(img_report)) { static_sprintf(path, "%s|%s", image_path, &img_report.wininst_path[0][2]); @@ -1348,26 +1371,48 @@ out: } if (img_report.has_grub2) { char grub_path[128]; - static_sprintf(grub_path, "%s/normal.mod", &grub_dirname[img_report.has_grub2 - 1][1]); + static_sprintf(grub_path, "/%s/normal.mod", &grub_dirname[img_report.has_grub2 - 1][1]); // In case we have a GRUB2 based iso, we extract boot/grub/i386-pc/normal.mod to parse its version img_report.grub2_version[0] = 0; - // coverity[swapped_arguments] - if (GetTempFileNameU(temp_dir, APPLICATION_NAME, 0, path) != 0) { - size = (size_t)ExtractISOFile(src_iso, grub_path, path, FILE_ATTRIBUTE_NORMAL); - if ((size == 0) || (read_file(path, (uint8_t**)&buf) != size)) - uprintf(" Could not read Grub version from '%s'", grub_path); - else - GetGrubVersion(buf, size); - safe_free(buf); - DeleteFileU(path); - } + size = (size_t)ReadISOFileToBuffer(src_iso, grub_path, &buf); + if (size == 0) + uprintf(" Could not read Grub version from '%s'", grub_path); + else + GetGrubVersion(buf, size, grub_path); + safe_free(buf); if (img_report.grub2_version[0] == 0) { uprintf(" Could not detect Grub version"); - img_report.has_grub2 = 0; + img_report.has_grub2 &= 0x80; } } + for (j = 0; j < ARRAYSIZE(img_report.efi_boot_entry); j++) { + if (img_report.efi_boot_entry[j].type == EBT_GRUB) { + + size = (size_t)ReadISOFileToBuffer(src_iso, img_report.efi_boot_entry[j].path, &buf); + if (size == 0) { + uprintf(" Could not read Grub version from '%s'", img_report.efi_boot_entry[j].path); + } else { + img_report.has_grub2 |= 0x80; + GetGrubVersion(buf, size, img_report.efi_boot_entry[j].path); + GetGrubFs(buf, size); + } + safe_free(buf); + } + } + for (i = 0; i < (int)grub_filesystems.Index; i++) { + if (i != 0) + static_strcat(fses, ", "); + static_strcat(fses, grub_filesystems.String[i]); + for (j = 0; j < ARRAYSIZE(fs_name); j++) + if (stricmp(grub_filesystems.String[i], fs_name[j]) == 0) + img_report.has_grub2_fs |= (1 << j); + } + if (*fses) + uprintf(" Supported GRUB filesystems: %s", fses); + StrArrayDestroy(&config_path); StrArrayDestroy(&isolinux_path); + StrArrayDestroy(&grub_filesystems); SendMessage(hMainDialog, UM_PROGRESS_EXIT, 0, 0); } else { // Solus and other ISOs only provide EFI boot files in a FAT efi.img @@ -1494,7 +1539,7 @@ int64_t ExtractISOFile(const char* iso, const char* iso_file, const char* dest_f file_handle = CreateFileU(dest_file, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, attributes, NULL); if (file_handle == INVALID_HANDLE_VALUE) { - uprintf(" Could not create file %s: %s", dest_file, WindowsErrorString()); + uprintf("Could not create file %s: %s", dest_file, WindowsErrorString()); goto out; } @@ -1523,7 +1568,7 @@ int64_t ExtractISOFile(const char* iso, const char* iso_file, const char* dest_f } buf_size = (DWORD)MIN(file_length, (int64_t)read_size); if (!WriteFileWithRetry(file_handle, buf, buf_size, &wr_size, WRITE_RETRIES)) { - uprintf(" Error writing file %s: %s", dest_file, WindowsErrorString()); + uprintf("Error writing file %s: %s", dest_file, WindowsErrorString()); goto out; } file_length -= buf_size; @@ -1551,12 +1596,12 @@ try_iso: memset(buf, 0, ISO_BLOCKSIZE); lsn = p_statbuf->lsn + (lsn_t)i; if (iso9660_iso_seek_read(p_iso, buf, lsn, 1) != ISO_BLOCKSIZE) { - uprintf(" Error reading ISO9660 file %s at LSN %lu", iso_file, (long unsigned int)lsn); + uprintf("Error reading ISO9660 file %s at LSN %lu", iso_file, (long unsigned int)lsn); goto out; } buf_size = (DWORD)MIN(file_length, ISO_BLOCKSIZE); if (!WriteFileWithRetry(file_handle, buf, buf_size, &wr_size, WRITE_RETRIES)) { - uprintf(" Error writing file %s: %s", dest_file, WindowsErrorString()); + uprintf("Error writing file %s: %s", dest_file, WindowsErrorString()); goto out; } file_length -= buf_size; diff --git a/src/libcdio/iso9660/iso9660.c b/src/libcdio/iso9660/iso9660.c index 4d6561b4..629bb740 100644 --- a/src/libcdio/iso9660/iso9660.c +++ b/src/libcdio/iso9660/iso9660.c @@ -753,6 +753,7 @@ iso9660_dir_add_entry_su(void *dir, unsigned int ofs_last_rec = 0; offset = 0; + // coverity[tainted_data] while (offset < dsize) { if (!dir8[offset]) diff --git a/src/libcdio/iso9660/iso9660_fs.c b/src/libcdio/iso9660/iso9660_fs.c index c6015044..c5eff035 100644 --- a/src/libcdio/iso9660/iso9660_fs.c +++ b/src/libcdio/iso9660/iso9660_fs.c @@ -1272,11 +1272,9 @@ _fs_stat_traverse (const CdIo_t *p_cdio, const iso9660_stat_t *_root, return ret_stat; } +skip_to_next_record: iso9660_stat_free(p_iso9660_stat); p_iso9660_stat = NULL; - -skip_to_next_record:; - offset += iso9660_get_dir_len(p_iso9660_dir); } @@ -1387,6 +1385,7 @@ _fs_iso_stat_traverse (iso9660_t *p_iso, const iso9660_stat_t *_root, cdio_assert (offset == (blocks * ISO_BLOCKSIZE)); /* not found */ + iso9660_stat_free(p_stat); free (_dirbuf); return NULL; } @@ -1583,7 +1582,7 @@ iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[]) unsigned offset = 0; uint8_t *_dirbuf = NULL; - uint32_t blocks; + uint64_t blocks; CdioISO9660DirList_t *retval; bool skip_following_extents = false; @@ -1614,7 +1613,6 @@ iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[]) retval = _cdio_list_new (); /* Check for potential integer overflow when calculating total blocks */ - // coverity[dead_error_condition] if (blocks > (SIZE_MAX / ISO_BLOCKSIZE)) { cdio_warn("Total size is too large"); iso9660_stat_free(p_stat); @@ -1624,7 +1622,7 @@ iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[]) _dirbuf = calloc(1, blocks * ISO_BLOCKSIZE); if (!_dirbuf) { - cdio_warn("Couldn't calloc(1, %d)", blocks * ISO_BLOCKSIZE); + cdio_warn("Couldn't calloc(1, %lld)", blocks * ISO_BLOCKSIZE); iso9660_stat_free(p_stat); iso9660_dirlist_free(retval); return NULL; @@ -1670,6 +1668,7 @@ iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[]) free(_dirbuf); iso9660_stat_free(p_stat); + iso9660_stat_free(p_iso9660_stat); return retval; } @@ -1714,7 +1713,6 @@ iso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[]) p_iso9660_stat->total_size = p_iso->boot_img[i].num_sectors * VIRTUAL_SECTORSIZE; iso9660_get_ltime(&p_iso->pvd.creation_date, &p_iso9660_stat->tm); _cdio_list_append(retval, p_iso9660_stat); - p_iso9660_stat = NULL; } return retval; } @@ -1823,6 +1821,7 @@ iso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[]) return NULL; } + iso9660_stat_free(p_iso9660_stat); return retval; } diff --git a/src/libcdio/iso9660/rock.c b/src/libcdio/iso9660/rock.c index 565a2f57..b72e53aa 100644 --- a/src/libcdio/iso9660/rock.c +++ b/src/libcdio/iso9660/rock.c @@ -188,6 +188,7 @@ repeat: int sig; int rootflag; + // coverity[tainted_data] while (len > 1){ /* There may be one byte for padding somewhere */ rr = (iso_extension_record_t *) chr; sig = *chr+(*(chr+1) << 8); diff --git a/src/libcdio/udf/udf_fs.c b/src/libcdio/udf/udf_fs.c index d74db3eb..02d5009b 100644 --- a/src/libcdio/udf/udf_fs.c +++ b/src/libcdio/udf/udf_fs.c @@ -752,6 +752,7 @@ udf_readdir(udf_dirent_t *p_udf_dirent) free_and_null(p_udf_dirent->psz_name); p = (uint8_t*)p_udf_dirent->fid->u.imp_use.data + p_udf_dirent->fid->u.i_imp_use; + // coverity[tainted_data] p_udf_dirent->psz_name = unicode16_decode(p, u_len); } return p_udf_dirent; diff --git a/src/rufus.c b/src/rufus.c index 5b0b7761..aa9fa163 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -187,7 +187,8 @@ static void SetAllowedFileSystems(void) allowed_filesystem[FS_FAT32] = TRUE; break; case BT_IMAGE: - allowed_filesystem[FS_NTFS] = TRUE; + if ((image_path == NULL) || !HAS_NTFSLESS_GRUB(img_report)) + allowed_filesystem[FS_NTFS] = TRUE; // Don't allow anything besides NTFS if the image is not compatible if ((image_path != NULL) && !IS_FAT32_COMPAT(img_report)) break; @@ -1104,7 +1105,7 @@ static void DisplayISOProps(void) PRINT_ISO_PROP(img_report.has_deep_directories, " Has a Rock Ridge deep directory"); PRINT_ISO_PROP(HAS_SYSLINUX(img_report), " Uses: Syslinux/Isolinux v%s", img_report.sl_version_str); if (HAS_SYSLINUX(img_report) && (SL_MAJOR(img_report.sl_version) < 5)) { - for (i = 0; i<NB_OLD_C32; i++) { + for (i = 0; i < NB_OLD_C32; i++) { PRINT_ISO_PROP(img_report.has_old_c32[i], " With an old %s", old_c32_name[i]); } } @@ -1258,6 +1259,15 @@ DWORD WINAPI ImageScanThread(LPVOID param) "^Rocky-[8-9].*", // Rocky Linux 8.x and 9.x "^MIRACLE-LINUX-[8-9].*", // MIRACLE LINUX 8.x and 9.x }; + // As expected, SUSE maintainers DO NOT care about making the lives of SUSE users easier + // by applying simple changes. On the other hand, boy are they caring about making their + // *own* lives easier, and angrily dismissing anything that dares challenges that... + // See: https://bugzilla.suse.com/show_bug.cgi?id=1243236. + const char* suse_derivative[] = { + "Install-SUSE", + "Install-LEAP", + "openSUSE-Tumbleweed" + }; int i, len; uint8_t arch; char tmp_path[MAX_PATH], tmp_str[64]; @@ -1347,6 +1357,20 @@ DWORD WINAPI ImageScanThread(LPVOID param) } } + for (i = 0; i < ARRAYSIZE(suse_derivative); i++) { + if (strncmp(img_report.label, suse_derivative[i], strlen(suse_derivative[i])) == 0) { + img_report.disable_iso = TRUE; + break; + } + } + + // If we have EFI GRUB, detect whether we have FAT, exFAT or NTFS support (with exFAT + // or NTFS support being mandatory if we have a file that is larger than 4 GB) + if (img_report.has_grub2 & 0x80) { + if (!(img_report.has_grub2_fs & 0x7) || (img_report.has_4GB_file && !(img_report.has_grub2_fs & 0x6))) + img_report.disable_iso = TRUE; + } + // If we have an ISOHybrid, but without an ISO method we support, disable ISO support altogether if (IS_DD_BOOTABLE(img_report) && (img_report.disable_iso || (!IS_BIOS_BOOTABLE(img_report) && !IS_EFI_BOOTABLE(img_report)))) { diff --git a/src/rufus.h b/src/rufus.h index ad884e23..9ed9432f 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -366,9 +366,11 @@ enum EFI_BOOT_TYPE { #define HAS_WINPE(r) (((r.winpe & WINPE_I386) == WINPE_I386)||((r.winpe & WINPE_AMD64) == WINPE_AMD64)||((r.winpe & WINPE_MININT) == WINPE_MININT)) #define HAS_WINDOWS(r) (HAS_BOOTMGR(r) || (r.uses_minint) || HAS_WINPE(r)) #define HAS_WIN7_EFI(r) ((r.has_efi == 1) && HAS_WININST(r)) +#define HAS_FATLESS_GRUB(r) ((r.has_grub2 & 0x80) && !(r.has_grub2_fs & 0x1)) +#define HAS_NTFSLESS_GRUB(r)((r.has_grub2 & 0x80) && !(r.has_grub2_fs & 0x4)) #define IS_WINDOWS_1X(r) (r.has_bootmgr_efi && (r.win_version.major >= 10)) #define IS_WINDOWS_11(r) (r.has_bootmgr_efi && (r.win_version.major >= 11)) -#define IS_FAT32_COMPAT(r) ((r.has_4GB_file == 0 || (r.has_4GB_file == 0x81 && allow_dual_uefi_bios)) && !r.needs_ntfs) +#define IS_FAT32_COMPAT(r) (((r.has_4GB_file == 0 && !HAS_FATLESS_GRUB(r)) || (r.has_4GB_file == 0x81 && allow_dual_uefi_bios)) && !r.needs_ntfs) #define HAS_EFI_IMG(r) (r.efi_img_path[0] != 0) #define IS_DD_BOOTABLE(r) (r.is_bootable_img > 0) #define IS_DD_ONLY(r) ((r.is_bootable_img > 0) && (!r.is_iso || r.disable_iso)) @@ -448,6 +450,7 @@ typedef struct { BOOLEAN has_efi_syslinux; BOOLEAN has_grub4dos; uint8_t has_grub2; + uint8_t has_grub2_fs; BOOLEAN has_compatresources_dll; BOOLEAN has_panther_unattend; BOOLEAN has_kolibrios; @@ -709,6 +712,7 @@ typedef struct { #define STRARRAY_EMPTY { NULL, 0, 0 }; extern void StrArrayCreate(StrArray* arr, uint32_t initial_size); extern int32_t StrArrayAdd(StrArray* arr, const char* str, BOOL); +extern int32_t StrArrayAddUnique(StrArray* arr, const char* str, BOOL); extern int32_t StrArrayFind(StrArray* arr, const char* str); extern void StrArrayClear(StrArray* arr); extern void StrArrayDestroy(StrArray* arr); diff --git a/src/rufus.rc b/src/rufus.rc index 24d66fbc..7279b19a 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.8.2247" +CAPTION "Rufus 4.8.2248" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2247,0 - PRODUCTVERSION 4,8,2247,0 + FILEVERSION 4,8,2248,0 + PRODUCTVERSION 4,8,2248,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2247" + VALUE "FileVersion", "4.8.2248" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2247" + VALUE "ProductVersion", "4.8.2248" END END BLOCK "VarFileInfo" diff --git a/src/stdfn.c b/src/stdfn.c index 0798fa21..f42b5440 100644 --- a/src/stdfn.c +++ b/src/stdfn.c @@ -575,13 +575,19 @@ int32_t StrArrayFind(StrArray* arr, const char* str) uint32_t i; if ((str == NULL) || (arr == NULL) || (arr->String == NULL)) return -1; - for (i = 0; i<arr->Index; i++) { + for (i = 0; i < arr->Index; i++) { if (strcmp(arr->String[i], str) == 0) return (int32_t)i; } return -1; } +int32_t StrArrayAddUnique(StrArray* arr, const char* str, BOOL duplicate) +{ + int32_t i = StrArrayFind(arr, str); + return (i < 0) ? StrArrayAdd(arr, str, duplicate) : i; +} + void StrArrayClear(StrArray* arr) { uint32_t i; diff --git a/src/syslinux/libinstaller/fs.c b/src/syslinux/libinstaller/fs.c index d1bf1378..94608475 100644 --- a/src/syslinux/libinstaller/fs.c +++ b/src/syslinux/libinstaller/fs.c @@ -40,8 +40,10 @@ void syslinux_make_bootsect(void *bs, int fs_type) // The overruns are intended // coverity[overrun-buffer-arg] + // coverity[buffer_size] memcpy(&bootsect->FAT_bsHead, &sbs->FAT_bsHead, FAT_bsHeadLen); // coverity[overrun-buffer-arg] + // coverity[buffer_size] memcpy(&bootsect->FAT_bsCode, &sbs->FAT_bsCode, FAT_bsCodeLen); } else if (fs_type == NTFS) { struct ntfs_boot_sector *bootsect = bs; @@ -49,8 +51,10 @@ void syslinux_make_bootsect(void *bs, int fs_type) (const struct ntfs_boot_sector *)boot_sector; // coverity[overrun-buffer-arg] + // coverity[buffer_size] memcpy(&bootsect->NTFS_bsHead, &sbs->NTFS_bsHead, NTFS_bsHeadLen); // coverity[overrun-buffer-arg] + // coverity[buffer_size] memcpy(&bootsect->NTFS_bsCode, &sbs->NTFS_bsCode, NTFS_bsCodeLen); } } diff --git a/src/syslinux/win/ntfssect.c b/src/syslinux/win/ntfssect.c index 5c076499..2d079a13 100644 --- a/src/syslinux/win/ntfssect.c +++ b/src/syslinux/win/ntfssect.c @@ -60,7 +60,7 @@ DWORD M_NTFSSECT_API NtfsSectGetFileVcnExtent( return ERROR_INVALID_PARAMETER; input.StartingVcn = *Vcn; - DeviceIoControl( + (void)DeviceIoControl( File, FSCTL_GET_RETRIEVAL_POINTERS, &input, From 207a3309791ba42e2cdc90ff513cddffdd802b3c Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 23 May 2025 14:50:06 +0100 Subject: [PATCH 058/192] [core] fix a crash due to overzealous MSVC optimizations * Visual 2022 version 17.14.2 changes the way it performs optimizations with /O2 which results in innocuous C statements, such as invoking strtoul() twice on the same line, and using the pointer returned by the first call in the second, crashing the application with a read access violation (when built as RELEASE). * To alleviate that, we break down the Syslinux strtoul() invocation, as well as harden our Syslinux version processing while we're at it. * Hopefully this is the only line of code where the new mode of MSVC optimisation creates a problem with... * Closes #2740. --- src/rufus.rc | 10 +++++----- src/syslinux.c | 14 +++++++++++--- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/rufus.rc b/src/rufus.rc index 7279b19a..9d1c5ea1 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.8.2248" +CAPTION "Rufus 4.8.2249" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2248,0 - PRODUCTVERSION 4,8,2248,0 + FILEVERSION 4,8,2249,0 + PRODUCTVERSION 4,8,2249,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2248" + VALUE "FileVersion", "4.8.2249" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2248" + VALUE "ProductVersion", "4.8.2249" END END BLOCK "VarFileInfo" diff --git a/src/syslinux.c b/src/syslinux.c index ea728c8a..8203586c 100644 --- a/src/syslinux.c +++ b/src/syslinux.c @@ -400,8 +400,9 @@ out: uint16_t GetSyslinuxVersion(char* buf, size_t buf_size, char** ext) { size_t i, j, k; - char *p; - uint16_t version; + char *p = NULL; + unsigned long version_ul[2]; + uint16_t version = 0; const char LINUX[] = { 'L', 'I', 'N', 'U', 'X', ' ' }; static char* nullstr = ""; char unauthorized[] = {'<', '>', ':', '|', '*', '?', '\\', '/'}; @@ -418,10 +419,17 @@ uint16_t GetSyslinuxVersion(char* buf, size_t buf_size, char** ext) || ((buf[i - 3] == 'S') && (buf[i - 2] == 'Y') && (buf[i - 1] == 'S')) )) continue; i += sizeof(LINUX); - version = (((uint8_t)strtoul(&buf[i], &p, 10)) << 8) + (uint8_t)strtoul(&p[1], &p, 10); + version_ul[0] = strtoul(&buf[i], &p, 10); // Our buffer is either from our internal legit syslinux (i.e. with a NUL terminated // version string) or from a buffer that has been NUL-terminated through read_file(), // so the string we work with in p is always NUL terminated at this stage. + assert(version_ul[0] < 256); + if (version_ul[0] < 256) { + version_ul[1] = strtoul(&p[1], &p, 10); + assert(version_ul[1] < 256); + if (version_ul[1] < 256) + version = (uint16_t)((version_ul[0] << 8) + version_ul[1]); + } if (version == 0) continue; // Ensure that our extra version string starts with a slash From 688f011f317492225ded10b51edc19b39d62fbd4 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 26 May 2025 20:50:33 +0100 Subject: [PATCH 059/192] [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 --- ChangeLog.txt | 12 +++++ src/db.h | 16 +++---- src/drive.c | 24 +++++----- src/format.c | 4 +- src/hash.c | 102 +++++++++++++++++++++++++++++-------------- src/iso.c | 48 +++++++++++++++++++- src/missing.h | 8 +++- src/parser.c | 81 +++++++++++++++++++++++++++++----- src/rufus.c | 119 ++++++++++++++++++++++++-------------------------- src/rufus.h | 21 ++++++--- src/rufus.rc | 10 ++--- src/stdlg.c | 26 +++++++++-- 12 files changed, 325 insertions(+), 146 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 9cad6c6e..d9ab4e03 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,15 @@ +o Version 4.8 (2025.06.??) + Switch to wimlib for all WIM image processing: + - Greatly speeds up image analysis when opening Windows ISOs + - Can speed up Windows To Go drive creation (But won't do miracles if you have a crap drive) + - Might help with Parallels limitations on Mac (But Rufus on Parallels is still UNSUPPORTED) + - Enables the splitting of >4GB files with Alt-E (But still WAY SLOWER than using UEFI:NTFS) + Switch to using Visual Studio binaries everywhere, due to MinGW DLL delay-loading limitations + Add more exceptions for Linux ISOs that restrict themselves to DD mode (Nobara, openSUSE, ...) + Improve reporting of UEFI bootloaders in the log, with info on the Secure Boot status + Fix an issue with size limitations when writing an uncompressed VHD back to the same drive + Fix a crash when opening the log with the 32-bit MinGW compiled version + o Version 4.7 (2025.04.09) Add a mechanism to detect and download updated DBXs from the official UEFI repository Add ztsd compression support for disk images diff --git a/src/db.h b/src/db.h index b3db434c..1b5a872b 100644 --- a/src/db.h +++ b/src/db.h @@ -127,24 +127,22 @@ static uint8_t sha256db[] = { * Contains the SHA-1 thumbprints of the issuer certificate of the official * Secure Boot signing authority (i.e. Microsoft). */ -static uint8_t certauth[] = { +static const char db_sb_active_txt[] = // 'Microsoft Windows Production PCA 2011' - 0x58, 0x0a, 0x6f, 0x4c, 0xc4, 0xe4, 0xb6, 0x69, 0xb9, 0xeb, 0xdc, 0x1b, 0x2b, 0x3e, 0x08, 0x7b, 0x80, 0xd0, 0x67, 0x8d, + "580a6f4cc4e4b669b9ebdc1b2b3e087b80d0678d\n" // 'Microsoft Corporation UEFI CA 2011' - 0x46, 0xde, 0xf6, 0x3b, 0x5c, 0xe6, 0x1c, 0xf8, 0xba, 0x0d, 0xe2, 0xe6, 0x63, 0x9c, 0x10, 0x19, 0xd0, 0xed, 0x14, 0xf3, + "46def63b5ce61cf8ba0de2e6639c1019d0ed14f3\n" // 'Windows UEFI CA 2023' - 0x45, 0xa0, 0xfa, 0x32, 0x60, 0x47, 0x73, 0xc8, 0x24, 0x33, 0xc3, 0xb7, 0xd5, 0x9e, 0x74, 0x66, 0xb3, 0xac, 0x0c, 0x67, + "45a0fa32604773c82433c3b7d59e7466b3ac0c67\n" // 'Microsoft UEFI CA 2023' - 0xb5, 0xee, 0xb4, 0xa6, 0x70, 0x60, 0x48, 0x07, 0x3f, 0x0e, 0xd2, 0x96, 0xe7, 0xf5, 0x80, 0xa7, 0x90, 0xb5, 0x9e, 0xaa, -}; + "b5eeb4a6706048073f0ed296e7f580a790b59eaa"; /* * Contains the SHA-1 thumbprints of certificates that are being revoked by DBX. * This only includes the 'Microsoft Windows Production PCA 2011' for now. */ -static uint8_t certdbx[] = { - 0x58, 0x0a, 0x6f, 0x4c, 0xc4, 0xe4, 0xb6, 0x69, 0xb9, 0xeb, 0xdc, 0x1b, 0x2b, 0x3e, 0x08, 0x7b, 0x80, 0xd0, 0x67, 0x8d, -}; +static const char db_sb_revoked_txt[] = + "580a6f4cc4e4b669b9ebdc1b2b3e087b80d0678d"; /* * Extended SBATLevel.txt that merges Linux SBAT with Microsoft's SVN diff --git a/src/drive.c b/src/drive.c index ab4a6d57..402aa53b 100644 --- a/src/drive.c +++ b/src/drive.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Drive access function calls - * Copyright © 2011-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2011-2025 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -2299,7 +2299,7 @@ BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL m // CHS sizes that IBM imparted upon us. Long story short, we now align to a // cylinder size that is itself aligned to the cluster size. // If this actually breaks old systems, please send your complaints to IBM. - SelectedDrive.Partition[pi].Offset = HI_ALIGN_X_TO_Y(bytes_per_track, ClusterSize); + SelectedDrive.Partition[pi].Offset = CEILING_ALIGN(bytes_per_track, ClusterSize); // GRUB2 no longer fits in the usual 31½ KB that the above computation provides // so just unconditionally double that size and get on with it. SelectedDrive.Partition[pi].Offset *= 2; @@ -2316,9 +2316,9 @@ BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL m SelectedDrive.Partition[pi].Size = esp_size; SelectedDrive.Partition[pi + 1].Offset = SelectedDrive.Partition[pi].Offset + SelectedDrive.Partition[pi].Size; // Align next partition to track and cluster - SelectedDrive.Partition[pi + 1].Offset = HI_ALIGN_X_TO_Y(SelectedDrive.Partition[pi + 1].Offset, bytes_per_track); + SelectedDrive.Partition[pi + 1].Offset = CEILING_ALIGN(SelectedDrive.Partition[pi + 1].Offset, bytes_per_track); if (ClusterSize % SelectedDrive.SectorSize == 0) - SelectedDrive.Partition[pi + 1].Offset = LO_ALIGN_X_TO_Y(SelectedDrive.Partition[pi + 1].Offset, ClusterSize); + SelectedDrive.Partition[pi + 1].Offset = FLOOR_ALIGN(SelectedDrive.Partition[pi + 1].Offset, ClusterSize); assert(SelectedDrive.Partition[pi + 1].Offset >= SelectedDrive.Partition[pi].Offset + SelectedDrive.Partition[pi].Size); pi++; // Clear the extra partition we processed @@ -2331,9 +2331,9 @@ BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL m wcscpy(SelectedDrive.Partition[pi].Name, L"Microsoft Reserved Partition"); SelectedDrive.Partition[pi].Size = 128 * MB; SelectedDrive.Partition[pi + 1].Offset = SelectedDrive.Partition[pi].Offset + SelectedDrive.Partition[pi].Size; - SelectedDrive.Partition[pi + 1].Offset = HI_ALIGN_X_TO_Y(SelectedDrive.Partition[pi + 1].Offset, bytes_per_track); + SelectedDrive.Partition[pi + 1].Offset = CEILING_ALIGN(SelectedDrive.Partition[pi + 1].Offset, bytes_per_track); if (ClusterSize % SelectedDrive.SectorSize == 0) - SelectedDrive.Partition[pi + 1].Offset = LO_ALIGN_X_TO_Y(SelectedDrive.Partition[pi + 1].Offset, ClusterSize); + SelectedDrive.Partition[pi + 1].Offset = FLOOR_ALIGN(SelectedDrive.Partition[pi + 1].Offset, ClusterSize); assert(SelectedDrive.Partition[pi + 1].Offset >= SelectedDrive.Partition[pi].Offset + SelectedDrive.Partition[pi].Size); pi++; extra_partitions &= ~(XP_MSR); @@ -2352,16 +2352,16 @@ BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL m assert(persistence_size != 0); partition_index[PI_CASPER] = pi; wcscpy(SelectedDrive.Partition[pi].Name, L"Linux Persistence"); - SelectedDrive.Partition[pi++].Size = HI_ALIGN_X_TO_Y(persistence_size, bytes_per_track); + SelectedDrive.Partition[pi++].Size = CEILING_ALIGN(persistence_size, bytes_per_track); } if (extra_partitions & XP_ESP) { partition_index[PI_ESP] = pi; wcscpy(SelectedDrive.Partition[pi].Name, L"EFI System Partition"); - SelectedDrive.Partition[pi++].Size = HI_ALIGN_X_TO_Y(esp_size, bytes_per_track); + SelectedDrive.Partition[pi++].Size = CEILING_ALIGN(esp_size, bytes_per_track); } else if (extra_partitions & XP_UEFI_NTFS) { partition_index[PI_UEFI_NTFS] = pi; wcscpy(SelectedDrive.Partition[pi].Name, L"UEFI:NTFS"); - SelectedDrive.Partition[pi++].Size = HI_ALIGN_X_TO_Y(uefi_ntfs_size, bytes_per_track); + SelectedDrive.Partition[pi++].Size = CEILING_ALIGN(uefi_ntfs_size, bytes_per_track); } else if (extra_partitions & XP_COMPAT) { wcscpy(SelectedDrive.Partition[pi].Name, L"BIOS Compatibility"); SelectedDrive.Partition[pi++].Size = bytes_per_track; // One track for the extra partition @@ -2377,13 +2377,13 @@ BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL m last_offset -= 33ULL * SelectedDrive.SectorSize; for (i = pi - 1; i > mi; i--) { assert(SelectedDrive.Partition[i].Size < last_offset); - SelectedDrive.Partition[i].Offset = LO_ALIGN_X_TO_Y(last_offset - SelectedDrive.Partition[i].Size, bytes_per_track); + SelectedDrive.Partition[i].Offset = FLOOR_ALIGN(last_offset - SelectedDrive.Partition[i].Size, bytes_per_track); last_offset = SelectedDrive.Partition[i].Offset; } // With the above, Compute the main partition size (which we align to a track) assert(last_offset > SelectedDrive.Partition[mi].Offset); - SelectedDrive.Partition[mi].Size = LO_ALIGN_X_TO_Y(last_offset - SelectedDrive.Partition[mi].Offset, bytes_per_track); + SelectedDrive.Partition[mi].Size = FLOOR_ALIGN(last_offset - SelectedDrive.Partition[mi].Offset, bytes_per_track); // Try to make sure that the main partition size is a multiple of the cluster size // This can be especially important when trying to capture an NTFS partition as FFU, as, when // the NTFS partition is aligned to cluster size, the FFU capture parses the NTFS allocated @@ -2391,7 +2391,7 @@ BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL m // a full sector by sector scan of the NTFS partition and records any non-zero garbage, which // may include garbage leftover data from a previous reformat... if (ClusterSize % SelectedDrive.SectorSize == 0) - SelectedDrive.Partition[mi].Size = LO_ALIGN_X_TO_Y(SelectedDrive.Partition[mi].Size, ClusterSize); + SelectedDrive.Partition[mi].Size = FLOOR_ALIGN(SelectedDrive.Partition[mi].Size, ClusterSize); if (SelectedDrive.Partition[mi].Size <= 0) { uprintf("Error: Invalid %S size", SelectedDrive.Partition[mi].Name); return FALSE; diff --git a/src/format.c b/src/format.c index a11a4a43..4fac3f2f 100644 --- a/src/format.c +++ b/src/format.c @@ -1372,9 +1372,9 @@ static BOOL WriteDrive(HANDLE hPhysicalDrive, BOOL bZeroDrive) // 2. WriteFile fails unless the size is a multiple of sector size if (read_size[read_bufnum] % SelectedDrive.SectorSize != 0) { - if_not_assert(HI_ALIGN_X_TO_Y(read_size[read_bufnum], SelectedDrive.SectorSize) <= buf_size) + if_not_assert(CEILING_ALIGN(read_size[read_bufnum], SelectedDrive.SectorSize) <= buf_size) goto out; - read_size[read_bufnum] = HI_ALIGN_X_TO_Y(read_size[read_bufnum], SelectedDrive.SectorSize); + read_size[read_bufnum] = CEILING_ALIGN(read_size[read_bufnum], SelectedDrive.SectorSize); } // 3. Switch to the next reading buffer diff --git a/src/hash.c b/src/hash.c index 663b58d2..4e611a11 100644 --- a/src/hash.c +++ b/src/hash.c @@ -114,7 +114,7 @@ StrArray modified_files = { 0 }; extern int default_thread_priority; extern const char* efi_archname[ARCH_MAX]; -extern char* sbat_level_txt; +extern char *sbat_level_txt, *sb_active_txt, *sb_revoked_txt; extern BOOL expert_mode, usb_debug; /* @@ -2162,6 +2162,12 @@ static BOOL IsRevokedBySbat(uint8_t* buf, uint32_t len) uint32_t i, j, sbat_len; sbat_entry_t entry; + // Fall back to embedded sbat_level.txt if we couldn't access remote + if (sbat_entries == NULL) { + sbat_level_txt = safe_strdup(db_sbat_level_txt); + sbat_entries = GetSbatEntries(sbat_level_txt); + } + assert(sbat_entries != NULL); if (sbat_entries == NULL) return FALSE; @@ -2220,7 +2226,7 @@ static BOOL IsRevokedByDbx(uint8_t* hash, uint8_t* buf, uint32_t len) dbx_size = read_file(path, &dbx_data); needs_free = (dbx_data != NULL); if (needs_free) - duprintf("Using local %s for revocation check", path); + duprintf(" Using local %s for revocation check", path); } if (dbx_size == 0) { dbx_data = (BYTE*)GetResource(hMainInstance, MAKEINTRESOURCEA(IDR_DBX + i), @@ -2239,7 +2245,7 @@ static BOOL IsRevokedByDbx(uint8_t* hash, uint8_t* buf, uint32_t len) goto out; // Expect SHA-256 hashes if (!CompareGUID(&efi_sig_list->SignatureType, &EFI_CERT_SHA256_GUID)) { - uprintf("WARNING: %s is not using SHA-256 hashes - Cannot check for UEFI revocation!", dbx_name); + uprintf(" Warning: %s is not using SHA-256 hashes - Cannot check for UEFI revocation!", dbx_name); goto out; } fluff_size += efi_sig_list->SignatureHeaderSize; @@ -2301,7 +2307,7 @@ static BOOL IsRevokedBySvn(uint8_t* buf, uint32_t len) return TRUE; } } else { - uprintf("WARNING: Unexpected Secure Version Number size"); + uprintf(" Warning: Unexpected Secure Version Number size"); } } } @@ -2310,13 +2316,24 @@ static BOOL IsRevokedBySvn(uint8_t* buf, uint32_t len) static BOOL IsRevokedByCert(cert_info_t* info) { - int i; + uint32_t i; - for (i = 0; i < ARRAYSIZE(certdbx); i += SHA1_HASHSIZE) { - if (!expert_mode) - continue; - if (memcmp(info->thumbprint, &certdbx[i], SHA1_HASHSIZE) == 0) { - uprintf("Found '%s' revoked certificate", info->name); + // TODO: Enable this for non expert mode after enforcement of PCA2011 cert revocation + if (!expert_mode) + return FALSE; + + // Fall back to embedded Secure Boot thumbprints if we couldn't access remote + if (sb_revoked_certs == NULL) { + sb_revoked_txt = safe_strdup(db_sb_revoked_txt); + sb_revoked_certs = GetThumbprintEntries(sb_revoked_txt); + } + assert(sb_revoked_certs != NULL && sb_revoked_certs->count != 0); + if (sb_revoked_certs == NULL) + return FALSE; + + for (i = 0; i < sb_revoked_certs->count; i++) { + if (memcmp(info->thumbprint, sb_revoked_certs->list[i], SHA1_HASHSIZE) == 0) { + uuprintf(" Found '%s' revoked certificate", info->name); return TRUE; } } @@ -2325,7 +2342,7 @@ static BOOL IsRevokedByCert(cert_info_t* info) BOOL IsSignedBySecureBootAuthority(uint8_t* buf, uint32_t len) { - int i; + uint32_t i; uint8_t* cert; cert_info_t info; @@ -2337,8 +2354,19 @@ BOOL IsSignedBySecureBootAuthority(uint8_t* buf, uint32_t len) // Secure Boot Authority is always an issuer if (GetIssuerCertificateInfo(cert, &info) != 2) return FALSE; - for (i = 0; i < ARRAYSIZE(certauth); i += SHA1_HASHSIZE) { - if (memcmp(info.thumbprint, &certauth[i], SHA1_HASHSIZE) == 0) + + // Fall back to embedded Secure Boot thumbprints if we couldn't access remote + if (sb_active_certs == NULL) { + sb_active_txt = safe_strdup(db_sb_active_txt); + sb_active_certs = GetThumbprintEntries(sb_active_txt); + } + // If we still manage to get an empty list at this stage, I sure wanna know about it! + assert(sb_active_certs != NULL && sb_active_certs->count != 0); + if (sb_active_certs == NULL || sb_active_certs->count == 0) + return FALSE; + + for (i = 0; i < sb_active_certs->count; i++) { + if (memcmp(info.thumbprint, sb_active_certs->list[i], SHA1_HASHSIZE) == 0) return TRUE; } return FALSE; @@ -2352,13 +2380,7 @@ int IsBootloaderRevoked(uint8_t* buf, uint32_t len) IMAGE_NT_HEADERS32* pe_header; uint8_t* cert; cert_info_t info; - int r; - - // Fall back to embedded sbat_level.txt if we couldn't access remote - if (sbat_entries == NULL) { - sbat_level_txt = safe_strdup(db_sbat_level_txt); - sbat_entries = GetSbatEntries(sbat_level_txt); - } + int r, revoked = 0; if (buf == NULL || len < 0x100 || dos_header->e_magic != IMAGE_DOS_SIGNATURE) return -2; @@ -2370,29 +2392,45 @@ int IsBootloaderRevoked(uint8_t* buf, uint32_t len) cert = GetPeSignatureData(buf); r = GetIssuerCertificateInfo(cert, &info); if (r == 0) - uuprintf(" (Unsigned Bootloader)"); + uprintf(" (Unsigned Bootloader)"); else if (r > 0) - uuprintf(" Signed by: %s", info.name); + uprintf(" Signed by '%s'", info.name); if (!PE256Buffer(buf, len, hash)) return -1; // Check for UEFI DBX revocation if (IsRevokedByDbx(hash, buf, len)) - return 1; + revoked = 1; // Check for Microsoft SSP revocation - for (i = 0; i < pe256ssp_size * SHA256_HASHSIZE; i += SHA256_HASHSIZE) + for (i = 0; revoked == 0 && i < pe256ssp_size * SHA256_HASHSIZE; i += SHA256_HASHSIZE) if (memcmp(hash, &pe256ssp[i], SHA256_HASHSIZE) == 0) - return 2; + revoked = 2; // Check for Linux SBAT revocation - if (IsRevokedBySbat(buf, len)) - return 3; + if (revoked == 0 && IsRevokedBySbat(buf, len)) + revoked = 3; // Check for Microsoft SVN revocation - if (IsRevokedBySvn(buf, len)) - return 4; + if (revoked == 0 && IsRevokedBySvn(buf, len)) + revoked = 4; // Check for UEFI DBX certificate revocation - if (IsRevokedByCert(&info)) - return 5; - return 0; + if (revoked == 0 && IsRevokedByCert(&info)) + revoked = 5; + + // If signed and not revoked, print the various Secure Boot "gotchas" + if (r > 0 && revoked == 0) { + if (strcmp(info.name, "Microsoft Windows Production PCA 2011") == 0) { + uprintf(" Note: This bootloader may fail Secure Boot validation on systems that"); + uprintf(" have been updated to use the 'Windows UEFI CA 2023' certificate."); + } else if (strcmp(info.name, "Windows UEFI CA 2023") == 0) { + uprintf(" Note: This bootloader will fail Secure Boot validation on systems that"); + uprintf(" have not been updated to use the latest Secure Boot certificates"); + } else if (strcmp(info.name, "Microsoft Corporation UEFI CA 2011") == 0 || + strcmp(info.name, "Microsoft UEFI CA 2023") == 0) { + uprintf(" Note: This bootloader may fail Secure Boot validation on *some* systems,"); + uprintf(" unless you enable \"Microsoft 3rd-party UEFI CA\" in your 'BIOS'."); + } + } + + return revoked; } /* diff --git a/src/iso.c b/src/iso.c index 5b051865..a1996f5d 100644 --- a/src/iso.c +++ b/src/iso.c @@ -1055,8 +1055,12 @@ void GetGrubVersion(char* buf, size_t buf_size, const char* source) if (buf_size > max_string_size) { for (i = 0; i < buf_size - max_string_size; i++) { for (j = 0; j < ARRAYSIZE(grub_version_str); j++) { - if (memcmp(&buf[i], grub_version_str[j], strlen(grub_version_str[j]) + 1) == 0) + if (memcmp(&buf[i], grub_version_str[j], strlen(grub_version_str[j])) == 0) { + // For CentOS, who decided to add a '\n' after "GRUB version %s" + if (buf[i + strlen(grub_version_str[j]) + 1] == '\0') + i++; static_strcpy(grub_version, &buf[i + strlen(grub_version_str[j]) + 1]); + } } if (memcmp(&buf[i], grub_debug_is_enabled_str, strlen(grub_debug_is_enabled_str)) == 0) has_grub_debug_is_enabled = TRUE; @@ -1139,6 +1143,37 @@ void GetGrubFs(char* buf, size_t buf_size) } } +void GetEfiBootInfo(char* buf, size_t buf_size, const char* source) +{ + // Data to help us identify the EFI bootloader type + const struct { + const char* label; + const char* search_string; + } boot_info[] = { + { "Shim", "UEFI SHIM\n$Version: "}, + // NB: There's also an ID=systemd-boot\nVERSION="x.y.z" footer + // in the Arch systemd-boot EFI binary, but I'm not sure if we + // can count on this metadata footer to always be present... + { "systemd-boot", "#### LoaderInfo: systemd-boot " }, + }; + const size_t max_string_size = 64; + size_t i, j, k; + + if (buf_size > max_string_size) { + for (i = 0; i < buf_size - max_string_size; i++) { + for (j = 0; j < ARRAYSIZE(boot_info); j++) { + if (memcmp(&buf[i], boot_info[j].search_string, strlen(boot_info[j].search_string)) == 0) { + i += strlen(boot_info[j].search_string); + for (k = 0; k < 32 && i + k < buf_size - 1 && !isspace(buf[i + k]); k++); + buf[i + k] = '\0'; + uprintf(" Detected %s version: %s (from '%s')", boot_info[j].label, &buf[i], source); + return; + } + } + } + } +} + BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan) { const char* basedir[] = { "i386", "amd64", "minint" }; @@ -1386,8 +1421,9 @@ out: } } for (j = 0; j < ARRAYSIZE(img_report.efi_boot_entry); j++) { + if (!img_report.efi_boot_entry[j].path[0]) + continue; if (img_report.efi_boot_entry[j].type == EBT_GRUB) { - size = (size_t)ReadISOFileToBuffer(src_iso, img_report.efi_boot_entry[j].path, &buf); if (size == 0) { uprintf(" Could not read Grub version from '%s'", img_report.efi_boot_entry[j].path); @@ -1397,6 +1433,14 @@ out: GetGrubFs(buf, size); } safe_free(buf); + } else if (img_report.efi_boot_entry[j].type == EBT_MAIN) { + size = (size_t)ReadISOFileToBuffer(src_iso, img_report.efi_boot_entry[j].path, &buf); + if (size == 0) { + uprintf(" Could not parse '%s'", img_report.efi_boot_entry[j].path); + } else { + GetEfiBootInfo(buf, size, img_report.efi_boot_entry[j].path); + } + safe_free(buf); } } for (i = 0; i < (int)grub_filesystems.Index; i++) { diff --git a/src/missing.h b/src/missing.h index a62203d3..62ce5c6e 100644 --- a/src/missing.h +++ b/src/missing.h @@ -30,10 +30,14 @@ #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #endif -#define LO_ALIGN_X_TO_Y(x, y) (((x) / (y)) * (y)) -#define HI_ALIGN_X_TO_Y(x, y) ((((x) + (y) - 1) / (y)) * (y)) +#define MAP_BIT(bit) do { map[_log2(bit)] = b; b <<= 1; } while(0) + +#define FLOOR_ALIGN(x, y) (((x) / (y)) * (y)) +#define CEILING_ALIGN(x, y) ((((x) + (y) - 1) / (y)) * (y)) #define IS_HEXASCII(c) (((c) >= '0' && (c) <= '9') || ((c) >= 'A' && (c) <= 'F') || ((c) >= 'a' && (c) <= 'f')) +#define FROM_HEXASCII(c) (((c) >= '0' && (c) <= '9') ? (c) - '0' : (((c) >= 'A' && (c) <= 'Z') ? (c) - 'A' + 10 : \ + (((c) >= 'a' && (c) <= 'z') ? (c) - 'a' + 10 : 0 ))) /* * Prefetch 64 bytes at address m, for read-only operation diff --git a/src/parser.c b/src/parser.c index 2f53b1d0..274a9705 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1582,20 +1582,18 @@ sbat_entry_t* GetSbatEntries(char* sbatlevel) BOOL eol, eof; char* version_str; uint32_t i, num_entries; - sbat_entry_t* _sbat_entries; + sbat_entry_t* sbat_list; if (sbatlevel == NULL) return NULL; - num_entries = 0; + num_entries = 1; for (i = 0; sbatlevel[i] != '\0'; i++) if (sbatlevel[i] == '\n') num_entries++; - if (num_entries == 0) - return NULL; - _sbat_entries = calloc(num_entries + 2, sizeof(sbat_entry_t)); - if (_sbat_entries == NULL) + sbat_list = calloc(num_entries + 1, sizeof(sbat_entry_t)); + if (sbat_list == NULL) return NULL; num_entries = 0; @@ -1611,7 +1609,7 @@ sbat_entry_t* GetSbatEntries(char* sbatlevel) i++; continue; } - _sbat_entries[num_entries].product = &sbatlevel[i]; + sbat_list[num_entries].product = &sbatlevel[i]; for (; sbatlevel[i] != ',' && sbatlevel[i] != '\0' && sbatlevel[i] != '\n'; i++); if (sbatlevel[i] == '\0' || sbatlevel[i] == '\n') break; @@ -1625,16 +1623,77 @@ sbat_entry_t* GetSbatEntries(char* sbatlevel) i++; // Allow the provision of an hex version if (version_str[0] == '0' && version_str[1] == 'x') - _sbat_entries[num_entries].version = strtoul(version_str, NULL, 16); + sbat_list[num_entries].version = strtoul(version_str, NULL, 16); else - _sbat_entries[num_entries].version = strtoul(version_str, NULL, 10); + sbat_list[num_entries].version = strtoul(version_str, NULL, 10); if (!eol) for (; sbatlevel[i] != '\0' && sbatlevel[i] != '\n'; i++); - if (_sbat_entries[num_entries].version != 0) + if (sbat_list[num_entries].version != 0) num_entries++; } + if (num_entries == 0) { + free(sbat_list); + return NULL; + } - return _sbat_entries; + return sbat_list; +} + +/* + * Parse a list of SHA-1 certificate hexascii thumbprints. + * List must be freed by the caller. + */ + +thumbprint_list_t* GetThumbprintEntries(char* thumbprints_txt) +{ + uint32_t i, j, num_entries; + thumbprint_list_t* thumbprints; + + if (thumbprints_txt == NULL) + return NULL; + + num_entries = 1; + for (i = 0; thumbprints_txt[i] != '\0'; i++) + if (thumbprints_txt[i] == '\n') + num_entries++; + + thumbprints = malloc(sizeof(thumbprint_list_t) + num_entries * SHA1_HASHSIZE); + if (thumbprints == NULL) + return NULL; + thumbprints->count = 0; + + for (i = 0; thumbprints_txt[i] != '\0'; ) { + // Eliminate blank lines + if (thumbprints_txt[i] == '\n') { + i++; + continue; + } + // Eliminate lines that don't start by an hexadecimal digit + if (!IS_HEXASCII(thumbprints_txt[i])) { + while (thumbprints_txt[i] != '\n' && thumbprints_txt[i] != '\0') + i++; + continue; + } + for (j = 0; thumbprints_txt[i] != '\n' && thumbprints_txt[i] != '\0'; i++, j++) { + if (!IS_HEXASCII(thumbprints_txt[i])) + break; + if ((j / 2) >= SHA1_HASHSIZE) + break; + thumbprints->list[thumbprints->count][j / 2] = thumbprints->list[thumbprints->count][j / 2] << 4; + thumbprints->list[thumbprints->count][j / 2] |= FROM_HEXASCII(thumbprints_txt[i]); + if (j == 2 * SHA1_HASHSIZE - 1) + thumbprints->count++; + } + while (thumbprints_txt[i] != '\n' && thumbprints_txt[i] != '\0') + i++; + } + + if (thumbprints->count == 0) { + free(thumbprints); + return NULL; + } + + return thumbprints; } /* diff --git a/src/rufus.c b/src/rufus.c index aa9fa163..5f557573 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -143,13 +143,14 @@ char embedded_sl_version_ext[2][32]; char ClusterSizeLabel[MAX_CLUSTER_SIZES][64]; char msgbox[1024], msgbox_title[32], *ini_file = NULL, *image_path = NULL, *short_image_path; char *archive_path = NULL, image_option_txt[128], *fido_url = NULL, *save_image_type = NULL; -char* sbat_level_txt = NULL; +char *sbat_level_txt = NULL, *sb_active_txt = NULL, *sb_revoked_txt = NULL; StrArray BlockingProcessList, ImageList; // Number of steps for each FS for FCC_STRUCTURE_PROGRESS const int nb_steps[FS_MAX] = { 5, 5, 12, 1, 10, 1, 1, 1, 1 }; const char* flash_type[BADLOCKS_PATTERN_TYPES] = { "SLC", "MLC", "TLC" }; RUFUS_DRIVE rufus_drive[MAX_DRIVES] = { 0 }; sbat_entry_t* sbat_entries = NULL; +thumbprint_list_t *sb_active_certs = NULL, *sb_revoked_certs = NULL; // TODO: Remember to update copyright year in stdlg's AboutCallback() WM_INITDIALOG, // localization_data.sh and the .rc when the year changes! @@ -1243,6 +1244,42 @@ out: return ret; } +void GetBootladerInfo(void) +{ + static const char* revocation_type[] = { "UEFI DBX", "Windows SSP", "Linux SBAT", "Windows SVN", "Cert DBX" }; + int r; + BOOL sb_signed; + uint32_t i, len; + uint8_t* buf = NULL; + + // Check UEFI bootloaders for revocation + if (!IS_EFI_BOOTABLE(img_report)) + return; + + assert(ARRAYSIZE(img_report.efi_boot_entry) > 0); + PrintStatus(0, MSG_351); + uprintf("UEFI bootloaders analysis:"); + for (i = 0; i < ARRAYSIZE(img_report.efi_boot_entry) && img_report.efi_boot_entry[i].path[0] != 0; i++) { + len = ReadISOFileToBuffer(image_path, img_report.efi_boot_entry[i].path, &buf); + if (len == 0) { + uprintf(" Warning: Failed to extract '%s' to check for UEFI Secure Boot info", img_report.efi_boot_entry[i].path); + continue; + } + sb_signed = IsSignedBySecureBootAuthority(buf, len); + if (sb_signed) + img_report.has_secureboot_bootloader |= 1; + uprintf(" • %s%s", img_report.efi_boot_entry[i].path, sb_signed ? "*" : ""); + r = IsBootloaderRevoked(buf, len); + if (r > 0) { + assert(r <= ARRAYSIZE(revocation_type)); + assert(r <= 7); + uprintf(" WARNING: '%s' has been revoked by %s", img_report.efi_boot_entry[i].path, revocation_type[r - 1]); + img_report.has_secureboot_bootloader |= 1 << r; + } + safe_free(buf); + } +} + // The scanning process can be blocking for message processing => use a thread DWORD WINAPI ImageScanThread(LPVOID param) { @@ -1348,6 +1385,7 @@ DWORD WINAPI ImageScanThread(LPVOID param) } if (img_report.is_iso) { + GetBootladerInfo(); DisplayISOProps(); for (i = 0; i < ARRAYSIZE(redhat8_derivative); i++) { @@ -1431,15 +1469,12 @@ out: ExitThread(0); } -#define MAP_BIT(bit) do { map[_log2(bit)] = b; b <<= 1; } while(0) - // Likewise, boot check will block message processing => use a thread static DWORD WINAPI BootCheckThread(LPVOID param) { - int i, r, rr, username_index = -1; + int i, r, username_index = -1; FILE *fd; uint32_t len; - uint8_t* buf = NULL; WPARAM ret = BOOTCHECK_CANCEL; BOOL in_files_dir = FALSE, esp_already_asked = FALSE; BOOL is_windows_to_go = ((image_options & IMOP_WINTOGO) && (ComboBox_GetCurItemData(hImageOption) == IMOP_WIN_TO_GO)); @@ -1638,64 +1673,20 @@ static DWORD WINAPI BootCheckThread(LPVOID param) } } - // Check UEFI bootloaders for revocation - if (IS_EFI_BOOTABLE(img_report)) { - BOOL has_secureboot_signed_bootloader = FALSE; - assert(ARRAYSIZE(img_report.efi_boot_entry) > 0); - PrintStatus(0, MSG_351); - uuprintf("UEFI Secure Boot revocation checks:"); - // Make sure we have at least one regular EFI bootloader that is formally signed - // for Secure Boot, since it doesn't make sense to report revocation otherwise. - for (i = 0; !has_secureboot_signed_bootloader && i < ARRAYSIZE(img_report.efi_boot_entry) && - img_report.efi_boot_entry[i].path[0] != 0; i++) { - if (img_report.efi_boot_entry[i].type == EBT_MAIN) { - len = ReadISOFileToBuffer(image_path, img_report.efi_boot_entry[i].path, &buf); - if (len == 0) { - uprintf("Warning: Failed to extract '%s' to check for UEFI revocation", img_report.efi_boot_entry[i].path); - continue; - } - if (IsSignedBySecureBootAuthority(buf, len)) - has_secureboot_signed_bootloader = TRUE; - free(buf); - } - } - if (!has_secureboot_signed_bootloader) { - uuprintf(" No Secure Boot signed bootloader found -- skipping"); - } else { - rr = 0; - for (i = 0; i < ARRAYSIZE(img_report.efi_boot_entry) && img_report.efi_boot_entry[i].path[0] != 0; i++) { - static const char* revocation_type[] = { "UEFI DBX", "Windows SSP", "Linux SBAT", "Windows SVN", "Cert DBX" }; - len = ReadISOFileToBuffer(image_path, img_report.efi_boot_entry[i].path, &buf); - if (len == 0) { - uprintf("Warning: Failed to extract '%s' to check for UEFI revocation", img_report.efi_boot_entry[i].path); - continue; - } - uuprintf("• %s", img_report.efi_boot_entry[i].path); - r = IsBootloaderRevoked(buf, len); - safe_free(buf); - if (r > 0) { - assert(r <= ARRAYSIZE(revocation_type)); - if (rr == 0) - rr = r; - uprintf("Warning: '%s' has been revoked by %s", img_report.efi_boot_entry[i].path, revocation_type[r - 1]); - is_bootloader_revoked = TRUE; - } - } - if (rr > 0) { - switch (rr) { - case 2: - msg = lmprintf(MSG_341, "Error code: 0xc0000428"); - break; - default: - msg = lmprintf(MSG_340); - break; - } - r = MessageBoxExU(hMainDialog, lmprintf(MSG_339, msg), lmprintf(MSG_338), - MB_OKCANCEL | MB_ICONWARNING | MB_IS_RTL, selected_langid); - if (r == IDCANCEL) - goto out; - } + // Display an alert if any of the UEFI bootloaders have been revoked + if (img_report.has_secureboot_bootloader & 0xfe) { + switch (img_report.has_secureboot_bootloader & 0xfe) { + case 4: + msg = lmprintf(MSG_341, "Error code: 0xc0000428"); + break; + default: + msg = lmprintf(MSG_340); + break; } + r = MessageBoxExU(hMainDialog, lmprintf(MSG_339, msg), lmprintf(MSG_338), + MB_OKCANCEL | MB_ICONWARNING | MB_IS_RTL, selected_langid); + if (r == IDCANCEL) + goto out; } if ((img_report.projected_size < MAX_ISO_TO_ESP_SIZE) && HAS_REGULAR_EFI(img_report) && @@ -4211,6 +4202,10 @@ out: safe_free(pe256ssp); safe_free(sbat_entries); safe_free(sbat_level_txt); + safe_free(sb_active_certs); + safe_free(sb_active_txt); + safe_free(sb_revoked_certs); + safe_free(sb_revoked_txt); if (argv != NULL) { for (i = 0; i < argc; i++) safe_free(argv[i]); diff --git a/src/rufus.h b/src/rufus.h index 9ed9432f..1a703f7f 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -436,6 +436,7 @@ typedef struct { BOOLEAN rh8_derivative; uint16_t winpe; uint16_t has_efi; + uint8_t has_secureboot_bootloader; uint8_t has_md5sum; uint8_t wininst_index; uint8_t has_symlinks; @@ -519,12 +520,6 @@ typedef struct { uint32_t* address; // 32-bit will do, as we're not dealing with >4GB DLLs... } dll_resolver_t; -/* SBAT entry */ -typedef struct { - char* product; - uint32_t version; -} sbat_entry_t; - /* Alignment macro */ #if defined(__GNUC__) #define ALIGNED(m) __attribute__ ((__aligned__(m))) @@ -576,6 +571,18 @@ extern hash_init_t* hash_init[HASH_MAX]; extern hash_write_t* hash_write[HASH_MAX]; extern hash_final_t* hash_final[HASH_MAX]; +/* SBAT entry */ +typedef struct { + char* product; + uint32_t version; +} sbat_entry_t; + +/* Certificate thumbprint list */ +typedef struct { + uint32_t count; + uint8_t list[0][SHA1_HASHSIZE]; +} thumbprint_list_t; + #ifndef __VA_GROUP__ #define __VA_GROUP__(...) __VA_ARGS__ #endif @@ -741,6 +748,7 @@ extern const int nb_steps[FS_MAX]; extern float fScale; extern windows_version_t WindowsVersion; extern sbat_entry_t* sbat_entries; +extern thumbprint_list_t *sb_active_certs, *sb_revoked_certs; extern int dialog_showing, force_update, fs_type, boot_type, partition_type, target_type; extern unsigned long syslinux_ldlinux_len[2]; extern char ubuffer[UBUFFER_SIZE], embedded_sl_version_str[2][12]; @@ -886,6 +894,7 @@ extern HANDLE CreatePreallocatedFile(const char* lpFileName, DWORD dwDesiredAcce DWORD dwFlagsAndAttributes, LONGLONG fileSize); extern uint32_t ResolveDllAddress(dll_resolver_t* resolver); extern sbat_entry_t* GetSbatEntries(char* sbatlevel); +extern thumbprint_list_t* GetThumbprintEntries(char* thumbprints_txt); extern uint16_t GetPeArch(uint8_t* buf); extern uint8_t* GetPeSection(uint8_t* buf, const char* name, uint32_t* len); extern uint8_t* GetPeSignatureData(uint8_t* buf); diff --git a/src/rufus.rc b/src/rufus.rc index 9d1c5ea1..0352fb91 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.8.2249" +CAPTION "Rufus 4.8.2250" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2249,0 - PRODUCTVERSION 4,8,2249,0 + FILEVERSION 4,8,2250,0 + PRODUCTVERSION 4,8,2250,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2249" + VALUE "FileVersion", "4.8.2250" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2249" + VALUE "ProductVersion", "4.8.2250" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index 0b0c422b..ad2605a5 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -46,7 +46,7 @@ /* Globals */ extern BOOL is_x86_64, appstore_version; -extern char unattend_username[MAX_USERNAME_LENGTH], *sbat_level_txt; +extern char unattend_username[MAX_USERNAME_LENGTH], *sbat_level_txt, *sb_active_txt, *sb_revoked_txt; extern HICON hSmallIcon, hBigIcon; static HICON hMessageIcon = (HICON)INVALID_HANDLE_VALUE; static char* szMessageText = NULL; @@ -1404,18 +1404,38 @@ static DWORD WINAPI CheckForFidoThread(LPVOID param) safe_free(fido_url); safe_free(sbat_entries); safe_free(sbat_level_txt); + safe_free(sb_active_txt); + safe_free(sb_revoked_txt); // Get the latest sbat_level.txt data while we're poking the network for Fido. len = DownloadToFileOrBuffer(RUFUS_URL "/sbat_level.txt", NULL, (BYTE**)&sbat_level_txt, NULL, FALSE); - if (len != 0 && len < 512) { + if (len != 0 && len < 1 * KB) { sbat_entries = GetSbatEntries(sbat_level_txt); - if (sbat_entries != 0) { + if (sbat_entries != NULL) { for (i = 0; sbat_entries[i].product != NULL; i++); if (i > 0) uprintf("Found %d additional UEFI revocation filters from remote SBAT", i); } } + // Get the active Secure Boot certificate thumbprints + len = DownloadToFileOrBuffer(RUFUS_URL "/sb_active.txt", NULL, (BYTE**)&sb_active_txt, NULL, FALSE); + if (len != 0 && len < 1 * KB) { + sb_active_certs = GetThumbprintEntries(sb_active_txt); + if (sb_active_certs != NULL) { + uprintf("Found %d active Secure Boot certificate entries from remote", sb_active_certs->count); + } + } + + // Get the revoked Secure Boot certificate thumbprints + len = DownloadToFileOrBuffer(RUFUS_URL "/sb_revoked.txt", NULL, (BYTE**)&sb_revoked_txt, NULL, FALSE); + if (len != 0 && len < 1 * KB) { + sb_revoked_certs = GetThumbprintEntries(sb_revoked_txt); + if (sb_revoked_certs != NULL) { + uprintf("Found %d revoked Secure Boot certificate entries from remote", sb_revoked_certs->count); + } + } + // Get the Fido URL from parsing a 'Fido.ver' on our server. This enables the use of different // Fido versions from different versions of Rufus, if needed, as opposed to always downloading // the latest release from GitHub, which may contain incompatible changes... From fe9b137902e914ef8e7d644b46dba4240b6c5d66 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 9 Jun 2025 17:30:18 +0100 Subject: [PATCH 060/192] [wue] forward wrapper parameters to original setup.exe * Also fix MinGW builds from outside of root directory * Closes #2751 * Closes #2752 --- .mingw/Makefile.am | 2 +- .mingw/Makefile.in | 2 +- res/setup/setup.c | 2 +- src/Makefile.am | 2 +- src/Makefile.in | 2 +- src/rufus.rc | 10 +++++----- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.mingw/Makefile.am b/.mingw/Makefile.am index a2170674..baa32192 100644 --- a/.mingw/Makefile.am +++ b/.mingw/Makefile.am @@ -29,4 +29,4 @@ all: crypt32-delaylib.lib dwmapi-delaylib.lib setupapi-delaylib.lib version-dela $(AM_V_DLLTOOL) --input-def $< --output-delaylib $@ --dllname $(basename $<).dll clean: - $(RM) -rf *.lib + $(RM) -f $(CURDIR)/*.lib diff --git a/.mingw/Makefile.in b/.mingw/Makefile.in index dd62b1df..31147c29 100644 --- a/.mingw/Makefile.in +++ b/.mingw/Makefile.in @@ -377,7 +377,7 @@ all: crypt32-delaylib.lib dwmapi-delaylib.lib setupapi-delaylib.lib version-dela $(AM_V_DLLTOOL) --input-def $< --output-delaylib $@ --dllname $(basename $<).dll clean: - $(RM) -rf *.lib + $(RM) -f $(CURDIR)/*.lib # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/res/setup/setup.c b/res/setup/setup.c index 641bfb66..a58ef474 100644 --- a/res/setup/setup.c +++ b/res/setup/setup.c @@ -118,7 +118,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine si.cb = sizeof(si); si.dwFlags = STARTF_USESHOWWINDOW; si.wShowWindow = SW_SHOWNORMAL; - CreateProcessA("setup.dll", NULL, NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi); + CreateProcessA("setup.dll", lpCmdLine, NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); diff --git a/src/Makefile.am b/src/Makefile.am index fbcef997..c62aa5ce 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,6 +19,6 @@ rufus_SOURCES = badblocks.c dev.c dos.c dos_locale.c drive.c format.c format_ext localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c xml.c rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/wimlib -I$(srcdir)/../res $(AM_CFLAGS) \ -DEXT2_FLAT_INCLUDES=0 -D_RUFUS -DSOLUTION=rufus -rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows -L $(srcdir)/../.mingw +rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows -L../.mingw rufus_LDADD = rufus_rc.o bled/libbled.a ext2fs/libext2fs.a ms-sys/libmssys.a syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a syslinux/win/libwin.a \ libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a wimlib/libwim.a $(NONVULNERABLE_LIBS) $(VULNERABLE_LIBS) diff --git a/src/Makefile.in b/src/Makefile.in index 5deb0e19..1e5f0285 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -289,7 +289,7 @@ rufus_SOURCES = badblocks.c dev.c dos.c dos_locale.c drive.c format.c format_ext rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/wimlib -I$(srcdir)/../res $(AM_CFLAGS) \ -DEXT2_FLAT_INCLUDES=0 -D_RUFUS -DSOLUTION=rufus -rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows -L $(srcdir)/../.mingw +rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows -L../.mingw rufus_LDADD = rufus_rc.o bled/libbled.a ext2fs/libext2fs.a ms-sys/libmssys.a syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a syslinux/win/libwin.a \ libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a wimlib/libwim.a $(NONVULNERABLE_LIBS) $(VULNERABLE_LIBS) diff --git a/src/rufus.rc b/src/rufus.rc index 0352fb91..6f5e6ebd 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.8.2250" +CAPTION "Rufus 4.8.2251" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2250,0 - PRODUCTVERSION 4,8,2250,0 + FILEVERSION 4,8,2251,0 + PRODUCTVERSION 4,8,2251,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2250" + VALUE "FileVersion", "4.8.2251" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2250" + VALUE "ProductVersion", "4.8.2251" END END BLOCK "VarFileInfo" From dab438d814b959f7548971f62d4eacf013bf46b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=A0im=C3=A1nek?= <josef.simanek@gmail.com> Date: Thu, 29 May 2025 19:44:03 +0200 Subject: [PATCH 061/192] [loc] fix typo in Czech translation * Closes #2746. --- res/loc/po/cs-CZ.po | 2 +- res/loc/rufus.loc | 2 +- src/rufus.rc | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/res/loc/po/cs-CZ.po b/res/loc/po/cs-CZ.po index 1bdb367f..4a2dcac8 100644 --- a/res/loc/po/cs-CZ.po +++ b/res/loc/po/cs-CZ.po @@ -1557,7 +1557,7 @@ msgid "" "Please select the mode that you want to use to write this image:" msgstr "" "Obráz, který jste si vybrali, je obraz 'ISO Hybrid'. To znamená, že může být zapsán buď v %s (kopírování souborů) v režimu %s (obraz disku) režim.\n" -"Rufus doporučuje použití %s režim, pokud je plný přístu k jednotce pro zápis.\n" +"Rufus doporučuje použití %s režim, pokud je plný přístup k jednotce pro zápis.\n" "Pokud narazíte na problémy při startu, můžete zkusit zapsat tento obraz znovu %s režim.\n" "\n" "Vyberte režim, který chcete použít k zapsání tohoto obrázu:" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index cce57c26..1bf7746a 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -3078,7 +3078,7 @@ t MSG_271 "Výpočet kontrolních součtů obrazů: %s" t MSG_272 "Vypočet MD5, SHA1 a SHA256 kontrolního součty pro vybraný obraz" t MSG_273 "Změna jazyka aplikace" t MSG_274 "%s obraz detekován" -t MSG_275 "Obráz, který jste si vybrali, je obraz 'ISO Hybrid'. To znamená, že může být zapsán buď v %s (kopírování souborů) v režimu %s (obraz disku) režim.\nRufus doporučuje použití %s režim, pokud je plný přístu k jednotce pro zápis.\nPokud narazíte na problémy při startu, můžete zkusit zapsat tento obraz znovu %s režim.\n\nVyberte režim, který chcete použít k zapsání tohoto obrázu:" +t MSG_275 "Obráz, který jste si vybrali, je obraz 'ISO Hybrid'. To znamená, že může být zapsán buď v %s (kopírování souborů) v režimu %s (obraz disku) režim.\nRufus doporučuje použití %s režim, pokud je plný přístup k jednotce pro zápis.\nPokud narazíte na problémy při startu, můžete zkusit zapsat tento obraz znovu %s režim.\n\nVyberte režim, který chcete použít k zapsání tohoto obrázu:" t MSG_276 "Režim zápisu %s (Doporučená)" t MSG_277 "Režim zápisu %s" t MSG_278 "Kontrola konfliktních procesů..." diff --git a/src/rufus.rc b/src/rufus.rc index 6f5e6ebd..3ca23732 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.8.2251" +CAPTION "Rufus 4.8.2252" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2251,0 - PRODUCTVERSION 4,8,2251,0 + FILEVERSION 4,8,2252,0 + PRODUCTVERSION 4,8,2252,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2251" + VALUE "FileVersion", "4.8.2252" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2251" + VALUE "ProductVersion", "4.8.2252" END END BLOCK "VarFileInfo" From d06b7296591f249e9094c8dfc3ed206ebf0b5b95 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 11 Jun 2025 12:05:28 +0100 Subject: [PATCH 062/192] Rufus 4.8 (Build 2253) * Also update x64 DBX to latest (since Microsoft has to update the DBX the very same day we pushed a new release) --- ChangeLog.txt | 3 ++- res/appstore/listing/listing.csv | 23 +++++++++++------------ res/dbx/amd64_DBXUpdate.bin | Bin 23333 -> 24005 bytes res/dbx/dbx_info.h | 2 +- res/setup/readme.txt | 10 +++++----- res/setup/setup_arm64.exe | Bin 144688 -> 149808 bytes res/setup/setup_x64.exe | Bin 152880 -> 150320 bytes src/rufus.rc | 10 +++++----- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index d9ab4e03..6c66045e 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,4 +1,4 @@ -o Version 4.8 (2025.06.??) +o Version 4.8 (2025.06.11) Switch to wimlib for all WIM image processing: - Greatly speeds up image analysis when opening Windows ISOs - Can speed up Windows To Go drive creation (But won't do miracles if you have a crap drive) @@ -9,6 +9,7 @@ o Version 4.8 (2025.06.??) Improve reporting of UEFI bootloaders in the log, with info on the Secure Boot status Fix an issue with size limitations when writing an uncompressed VHD back to the same drive Fix a crash when opening the log with the 32-bit MinGW compiled version + Fix commandline parameters not being forwared to original Windows setup.exe o Version 4.7 (2025.04.09) Add a mechanism to detect and download updated DBXs from the official UEFI repository diff --git a/res/appstore/listing/listing.csv b/res/appstore/listing/listing.csv index 69d76122..61d6f5eb 100644 --- a/res/appstore/listing/listing.csv +++ b/res/appstore/listing/listing.csv @@ -114,18 +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","• Add a mechanism to detect and download updated DBXs from the official UEFI repository -• Add ztsd compression support for disk images -• Add a new exclusion feature in the settings, to ignore disks with a specific GPT GUID -• Improve detection for compressed VHD images that are too large to fit the target drive -• Fix commandline hogger not being deleted when running Rufus from a different directory -• Fix FAT filenames from embedded images being potentially truncated on image extraction -• Fix a side-loading vulnerability [CVE-2025-26624] with cfgmgr32.dll (with thanks to @EmperialX) -• Fix UI memory leaks (courtesy of @ozone10) -• Fall back to user/system default locale when getting error description (courtesy of @Wack0) -• Don't run the commandline hogger on POSIX shells -• Drop ARM 32-bit builds (Note that ARM 64-bit builds are *NOT* affected by this) -• Update FreeDOS and Grub4DOS to latest",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"ReleaseNotes","3","Text","• Switch to wimlib for all WIM image processing: + - Greatly speeds up image analysis when opening Windows ISOs + - Can speed up Windows To Go drive creation (But won't do miracles if you have a crap drive) + - Might help with Parallels limitations on Mac (But Rufus on Parallels is still UNSUPPORTED) + - Enables the splitting of >4GB files with Alt-E (But still WAY SLOWER than using UEFI:NTFS) +• Switch to using Visual Studio binaries everywhere, due to MinGW DLL delay-loading limitations +• Add more exceptions for Linux ISOs that restrict themselves to DD mode (Nobara, openSUSE, ...) +• Improve reporting of UEFI bootloaders in the log, with info on the Secure Boot status +• Fix an issue with size limitations when writing an uncompressed VHD back to the same drive +• Fix a crash when opening the log with the 32-bit MinGW compiled version +• Fix commandline parameters not being forwared to original Windows setup.exe",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "Title","4","Text","Rufus",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "ShortTitle","5","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "SortTitle","6","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, diff --git a/res/dbx/amd64_DBXUpdate.bin b/res/dbx/amd64_DBXUpdate.bin index 481f5a39a916b57d873518289b462926b171d89e..811e27eb39e1e7e0f56637bfe7b01e8acdb71165 100644 GIT binary patch delta 969 zcmZ3wjq&Ji#toc2^=tB!Y@}W?URn8J_6o+=MKhN6$q4z$DX)2XT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delta 291 zcmV+;0o?w@y8)%P0k8=Se>EarlvU`^(Pw5n<=g`{x~-KR)Ph_Qh2_wbfoVqbP7b?` zC*HCpJyocn4a;+fYCQ-3p8I)2re+|GfP+@B+VwBnXuk$nuhdl?*okC<^qLK0<s$GG zNVgrRDh-nU0|#-Pwnm0kJDDJ81+r=j@5x|HYzu=S)IX@Oa(P&1f5!|`ETTF9pcfXX zKn-h~cHIVDA!+P-vKm7)JX;~$cRD|1I;l2T>4Ln+G=^e31(|)aO>CCHr1EFn8IJms zgpVeK8hPx?*d|(;)2FN`D05<?riZqbQN^d~^(9Fv8QPl=q=<H;7sH=!SWyjWOc~#e pUp=d*?=II4rMSG06#3vL7R13!P?A8bsX_TRlS3#RPO}>g3Qj_*hKT?G diff --git a/res/dbx/dbx_info.h b/res/dbx/dbx_info.h index 6a032b0e..34d4a201 100644 --- a/res/dbx/dbx_info.h +++ b/res/dbx/dbx_info.h @@ -8,7 +8,7 @@ struct { uint64_t timestamp; } dbx_info[] = { { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/x86/DBXUpdate.bin", 1740428422 }, - { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/amd64/DBXUpdate.bin", 1740428422 }, + { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/amd64/DBXUpdate.bin", 1749602743 }, { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/arm/DBXUpdate.bin", 1740428422 }, { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/arm64/DBXUpdate.bin", 1740428422 }, { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/ia64/DBXUpdate.bin", 0 }, diff --git a/res/setup/readme.txt b/res/setup/readme.txt index 005b521f..88c1eab2 100644 --- a/res/setup/readme.txt +++ b/res/setup/readme.txt @@ -33,11 +33,11 @@ and can be validated to not have been tampered through SHA-256 validation (Since produce SHA-256 hashes during the build process per: https://github.com/pbatard/rufus/blob/master/.github/workflows/setup.yml). -Per the https://github.com/pbatard/rufus/actions/runs/11195726475 GitHub Actions +Per the https://github.com/pbatard/rufus/actions/runs/15539519674 GitHub Actions workflow run, the SHA-256 for the executables (before signature was applied) were: -* 4e99f49b456781c92d2010a626706557df69334c6fc71ac129625f41fa311dd8 *./setup_x64.exe -* a0d7dea2228415eb5afe34419a31eeda90f9b51338f47bc8a5ef591054277f4b *./setup_arm64.exe +* bea9a68e73b53820ea9c3fcdda70b1615f7453ad483dd3aa06e0385fd28f004e *./setup_x64.exe +* f024aed61b1f215a3b684bbb2fd176893fc61f92243708a0d9334671df1cdb61 *./setup_arm64.exe You will also find the VirusTotal reports for the current signed executable at: -* https://www.virustotal.com/gui/file/a74dbfc0e2a5b2e3fd4ad3f9fdaea0060c5d29a16151b9a570a9bd653db966a7/detection -* https://www.virustotal.com/gui/file/629fdda27e200ec98703a7606ca4e2d0e44c578341779e4d5c447d45fc860c69/detection +* https://www.virustotal.com/gui/file/41037f63f20f5984e5ca1dab12c033d795966e80bd8b76a39c1dc42a3dc33594/detection +* https://www.virustotal.com/gui/file/cc9cb4f4080db352d9a82ef926fc290d62a8d67a45a5557f46fa924a7b9bdbe3/detection diff --git a/res/setup/setup_arm64.exe b/res/setup/setup_arm64.exe index c7a918aaa8554b8b4099939548fa9a588b13095c..c8cbfc92b801988a53a1d540c68258a3cf4b0e2b 100644 GIT binary patch delta 63827 zcmbTf3w%`7wfMi!Ode+v5|Yg1K_E;L1SSFG6(CVD6Yvp0R6>0BN|4%4i1r!*6<;%8 zYX@R2!$xi4_7b3vWU4k+P}3Iy+xri4Z2>K<eOv=*4W?QspcxeN|E_apVx;=}-`}6l zXE^8V=h|zpz1G@mt-aInuGz8Cwc(PdS{E2e5x+lJdEw7$AH3%Ek%^!A+k=H4@NNF~ zK;bIu`G>-lJn!81hr&Co=Yhhzt>?kQo2~rc7e2uA!E1g$vXtl7yZ=)7koBA}Ql1Z9 zGu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/rufus.rc index 3ca23732..006d9117 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.8.2252" +CAPTION "Rufus 4.8.2253" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2252,0 - PRODUCTVERSION 4,8,2252,0 + FILEVERSION 4,8,2253,0 + PRODUCTVERSION 4,8,2253,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2252" + VALUE "FileVersion", "4.8.2253" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.8.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2252" + VALUE "ProductVersion", "4.8.2253" END END BLOCK "VarFileInfo" From e128727521799cdda4249420991fdeb011dccc9a Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 13 Jun 2025 16:37:46 +0100 Subject: [PATCH 063/192] [wue] fix WUE dialog not being presented on WIMs with a single image * As opposed to what we used with the old parser, ezxml's indexes now start at 0 rather than 1. * Closes #2754. * Also set rufus-next to 4.9. --- ChangeLog.txt | 2 +- configure | 20 ++++++++++---------- configure.ac | 2 +- src/rufus.rc | 12 ++++++------ src/wue.c | 4 ++-- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 6c66045e..e78a9604 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -9,7 +9,7 @@ o Version 4.8 (2025.06.11) Improve reporting of UEFI bootloaders in the log, with info on the Secure Boot status Fix an issue with size limitations when writing an uncompressed VHD back to the same drive Fix a crash when opening the log with the 32-bit MinGW compiled version - Fix commandline parameters not being forwared to original Windows setup.exe + Fix commandline parameters not being forwarded to original Windows setup.exe o Version 4.7 (2025.04.09) Add a mechanism to detect and download updated DBXs from the official UEFI repository diff --git a/configure b/configure index ce4d9bb1..8acbcbc8 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for rufus 4.8. +# Generated by GNU Autoconf 2.71 for rufus 4.9. # # Report bugs to <https://github.com/pbatard/rufus/issues>. # @@ -611,8 +611,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rufus' PACKAGE_TARNAME='rufus' -PACKAGE_VERSION='4.8' -PACKAGE_STRING='rufus 4.8' +PACKAGE_VERSION='4.9' +PACKAGE_STRING='rufus 4.9' PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues' PACKAGE_URL='https://rufus.ie' @@ -1269,7 +1269,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rufus 4.8 to adapt to many kinds of systems. +\`configure' configures rufus 4.9 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1336,7 +1336,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rufus 4.8:";; + short | recursive ) echo "Configuration of rufus 4.9:";; esac cat <<\_ACEOF @@ -1428,7 +1428,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rufus configure 4.8 +rufus configure 4.9 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1504,7 +1504,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rufus $as_me 4.8, which was +It was created by rufus $as_me 4.9, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2767,7 +2767,7 @@ fi # Define the identity of the package. PACKAGE='rufus' - VERSION='4.8' + VERSION='4.9' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -5313,7 +5313,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rufus $as_me 4.8, which was +This file was extended by rufus $as_me 4.9, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5369,7 +5369,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -rufus config.status 4.8 +rufus config.status 4.9 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 7225f028..fb7f973a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([rufus], [4.8], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) +AC_INIT([rufus], [4.9], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies]) AC_CONFIG_SRCDIR([src/rufus.c]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/src/rufus.rc b/src/rufus.rc index 006d9117..e81d7d9a 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.8.2253" +CAPTION "Rufus 4.9.2254" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,8,2253,0 - PRODUCTVERSION 4,8,2253,0 + FILEVERSION 4,9,2254,0 + PRODUCTVERSION 4,9,2254,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.8.2253" + VALUE "FileVersion", "4.9.2254" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" - VALUE "OriginalFilename", "rufus-4.8.exe" + VALUE "OriginalFilename", "rufus-4.9.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.8.2253" + VALUE "ProductVersion", "4.9.2254" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index 7ab0fb5f..5363b455 100644 --- a/src/wue.c +++ b/src/wue.c @@ -500,7 +500,7 @@ BOOL PopulateWindowsVersion(void) goto out; } - PopulateWindowsVersionFromXml(xml, xml_len, 1); + PopulateWindowsVersionFromXml(xml, xml_len, 0); out: free(xml); @@ -621,7 +621,7 @@ int SetWinToGoIndex(void) wintogo_index = atoi(version_index.String[i - 1]); if (i > 0) { // re-populate the version data from the selected XML index - PopulateWindowsVersionFromXml(xml, xml_len, i); + PopulateWindowsVersionFromXml(xml, xml_len, i - 1); // If we couldn't obtain the major and build, we have a problem if (img_report.win_version.major == 0 || img_report.win_version.build == 0) uprintf("Warning: Could not obtain version information from XML index (Nonstandard Windows image?)"); From 3791b96fcd0992d2eb0b6a7dc228bcfe6a302e71 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Sun, 15 Jun 2025 21:17:32 +0100 Subject: [PATCH 064/192] [net] fix downloads no longer working after the recent GitHub server update * GitHub appears to have updated their HTTP servers to enable gzip compression when requested. * Unfortunately, the default from Rufus was to attempt to use compression where possible (ironically in an effort to save GitHub some bandwidth), which doesn't seem to sit too well with Windows' HttpQueryInfoA(HTTP_QUERY_CONTENT_LENGTH) API, as it errors out on trying to produce the content-length *DESPITE* the field being reported by GitHub in the HTTP header. * As a result, we switch all HTTP downloads *not* to try to use compression by forcing "Accept-Encoding: identity". * Unfortunately, besides affecting the download of resources such as GRUB/Syslinux ones, it also affects the ability to look for updates, which means that NONE of the version of Rufus prior to 4.9 (outside of the Windows Store ones) will be able to find that there exists a newer version to update to... :( * Closes #2756. --- src/net.c | 27 +++++++++++++-------------- src/rufus.rc | 10 +++++----- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/net.c b/src/net.c index a47f076e..68f92252 100644 --- a/src/net.c +++ b/src/net.c @@ -59,7 +59,6 @@ extern BOOL is_x86_64; extern USHORT NativeMachine; static DWORD error_code, fido_len = 0; static BOOL force_update_check = FALSE; -static const char* request_headers[2] = { "Accept-Encoding: none", "Accept-Encoding: gzip, deflate" }; extern const char* efi_archname[ARCH_MAX]; #if defined(__MINGW32__) @@ -175,7 +174,7 @@ uint64_t DownloadToFileOrBufferEx(const char* url, const char* file, const char* const char* short_name; unsigned char buf[DOWNLOAD_BUFFER_SIZE]; char hostname[64], urlpath[128], strsize[32]; - BOOL r = FALSE, use_github_api; + BOOL r = FALSE; DWORD dwSize, dwWritten, dwDownloaded; HANDLE hFile = INVALID_HANDLE_VALUE; HINTERNET hSession = NULL, hConnection = NULL, hRequest = NULL; @@ -227,18 +226,16 @@ uint64_t DownloadToFileOrBufferEx(const char* url, const char* file, const char* goto out; } - // If we are querying the GitHub API, we need to enable raw content and - // set 'Accept-Encoding' to 'none' to get the data length. - use_github_api = (strstr(url, "api.github.com") != NULL); - if (use_github_api && !HttpAddRequestHeadersA(hRequest, "Accept: application/vnd.github.v3.raw", - (DWORD)-1, HTTP_ADDREQ_FLAG_ADD)) { + // If we are querying the GitHub API, we need to enable raw content + if (strstr(url, "api.github.com") != NULL && !HttpAddRequestHeadersA(hRequest, + "Accept: application/vnd.github.v3.raw", (DWORD)-1, HTTP_ADDREQ_FLAG_ADD)) { uprintf("Unable to enable raw content from GitHub API: %s", WindowsErrorString()); goto out; } - if (!HttpSendRequestA(hRequest, request_headers[use_github_api ? 0 : 1], -1L, NULL, 0)) { - uprintf("Unable to send request: %s", WindowsErrorString()); - goto out; - } + // Must use "Accept-Encoding: identity" to get the file size + // This is needed for GitHub as the Microsoft HTTP APIs can't seem to read content-length for + // compressed content from GitHub, and using "identity" disables compression. + HttpSendRequestA(hRequest, "Accept-Encoding: identity", -1L, NULL, 0); // Get the file size dwSize = sizeof(DownloadStatus); @@ -643,10 +640,12 @@ static DWORD WINAPI CheckForUpdatesThread(LPVOID param) INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS | INTERNET_FLAG_NO_COOKIES | INTERNET_FLAG_NO_UI | INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_HYPERLINK | ((UrlParts.nScheme == INTERNET_SCHEME_HTTPS) ? INTERNET_FLAG_SECURE : 0), (DWORD_PTR)NULL); - if ((hRequest == NULL) || (!HttpSendRequestA(hRequest, request_headers[1], -1L, NULL, 0))) { + if (hRequest == NULL) { uprintf("Unable to send request: %s", WindowsErrorString()); goto out; } + // Must use "Accept-Encoding: identity" to get the file size + HttpSendRequestA(hRequest, "Accept-Encoding: identity", -1L, NULL, 0); // Ensure that we get a text file dwSize = sizeof(dwStatus); @@ -1010,8 +1009,8 @@ BOOL IsDownloadable(const char* url) if (hRequest == NULL) goto out; - if (!HttpSendRequestA(hRequest, request_headers[1], -1L, NULL, 0)) - goto out; + // Must use "Accept-Encoding: identity" to get the file size + HttpSendRequestA(hRequest, "Accept-Encoding: identity", -1L, NULL, 0); // Get the file size dwSize = sizeof(DownloadStatus); diff --git a/src/rufus.rc b/src/rufus.rc index e81d7d9a..43d445cf 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.9.2254" +CAPTION "Rufus 4.9.2255" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,9,2254,0 - PRODUCTVERSION 4,9,2254,0 + FILEVERSION 4,9,2255,0 + PRODUCTVERSION 4,9,2255,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.9.2254" + VALUE "FileVersion", "4.9.2255" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.9.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.9.2254" + VALUE "ProductVersion", "4.9.2255" END END BLOCK "VarFileInfo" From 9a32dba290d3b4eacda54bbccb38fa5b2b9ccdba Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Sun, 15 Jun 2025 21:22:13 +0100 Subject: [PATCH 065/192] Rufus 4.9 (Build 2256) * This is a bugfix release, that addresses critical issue #2756 as well as minor issue #2754. --- ChangeLog.txt | 4 ++++ res/appstore/listing/listing.csv | 13 ++----------- src/rufus.rc | 10 +++++----- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index e78a9604..6455b607 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +o Version 4.9 (2021.06.15) [BUGFIX RELEASE] + Fix downloads from https://rufus.ie no longer working due to recent GitHub server changes + Fix unofficial Windows ISOs, with single index WIMs, not presenting the WUE dialog + o Version 4.8 (2025.06.11) Switch to wimlib for all WIM image processing: - Greatly speeds up image analysis when opening Windows ISOs diff --git a/res/appstore/listing/listing.csv b/res/appstore/listing/listing.csv index 61d6f5eb..50605e97 100644 --- a/res/appstore/listing/listing.csv +++ b/res/appstore/listing/listing.csv @@ -114,17 +114,8 @@ • 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","• Switch to wimlib for all WIM image processing: - - Greatly speeds up image analysis when opening Windows ISOs - - Can speed up Windows To Go drive creation (But won't do miracles if you have a crap drive) - - Might help with Parallels limitations on Mac (But Rufus on Parallels is still UNSUPPORTED) - - Enables the splitting of >4GB files with Alt-E (But still WAY SLOWER than using UEFI:NTFS) -• Switch to using Visual Studio binaries everywhere, due to MinGW DLL delay-loading limitations -• Add more exceptions for Linux ISOs that restrict themselves to DD mode (Nobara, openSUSE, ...) -• Improve reporting of UEFI bootloaders in the log, with info on the Secure Boot status -• Fix an issue with size limitations when writing an uncompressed VHD back to the same drive -• Fix a crash when opening the log with the 32-bit MinGW compiled version -• Fix commandline parameters not being forwared to original Windows setup.exe",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"ReleaseNotes","3","Text","• Fix downloads from https://rufus.ie no longer working due to recent GitHub server changes +• Fix unofficial Windows ISOs, with single index WIMs, not presenting the WUE dialog",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "Title","4","Text","Rufus",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "ShortTitle","5","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "SortTitle","6","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, diff --git a/src/rufus.rc b/src/rufus.rc index 43d445cf..faa0919b 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.9.2255" +CAPTION "Rufus 4.9.2256" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,9,2255,0 - PRODUCTVERSION 4,9,2255,0 + FILEVERSION 4,9,2256,0 + PRODUCTVERSION 4,9,2256,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.9.2255" + VALUE "FileVersion", "4.9.2256" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.9.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.9.2255" + VALUE "ProductVersion", "4.9.2256" END END BLOCK "VarFileInfo" From e9f451dfe0eabde0cd850c5dbfbb10a00f2326a2 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 16 Jun 2025 13:50:02 +0100 Subject: [PATCH 066/192] [dbx] prettify JSON output for parsing since GitHub/curl may return monoblock JSON data * Also set rufus-next to 4.10. --- configure | 20 ++++++++++---------- configure.ac | 2 +- res/dbx/dbx_update.sh | 2 +- src/rufus.rc | 12 ++++++------ 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/configure b/configure index 8acbcbc8..1990a7d8 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for rufus 4.9. +# Generated by GNU Autoconf 2.71 for rufus 4.10. # # Report bugs to <https://github.com/pbatard/rufus/issues>. # @@ -611,8 +611,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rufus' PACKAGE_TARNAME='rufus' -PACKAGE_VERSION='4.9' -PACKAGE_STRING='rufus 4.9' +PACKAGE_VERSION='4.10' +PACKAGE_STRING='rufus 4.10' PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues' PACKAGE_URL='https://rufus.ie' @@ -1269,7 +1269,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rufus 4.9 to adapt to many kinds of systems. +\`configure' configures rufus 4.10 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1336,7 +1336,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rufus 4.9:";; + short | recursive ) echo "Configuration of rufus 4.10:";; esac cat <<\_ACEOF @@ -1428,7 +1428,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rufus configure 4.9 +rufus configure 4.10 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1504,7 +1504,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rufus $as_me 4.9, which was +It was created by rufus $as_me 4.10, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2767,7 +2767,7 @@ fi # Define the identity of the package. PACKAGE='rufus' - VERSION='4.9' + VERSION='4.10' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -5313,7 +5313,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rufus $as_me 4.9, which was +This file was extended by rufus $as_me 4.10, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5369,7 +5369,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -rufus config.status 4.9 +rufus config.status 4.10 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index fb7f973a..284d8cb8 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([rufus], [4.9], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) +AC_INIT([rufus], [4.10], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies]) AC_CONFIG_SRCDIR([src/rufus.c]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/res/dbx/dbx_update.sh b/res/dbx/dbx_update.sh index fa472d2c..8c19f703 100755 --- a/res/dbx/dbx_update.sh +++ b/res/dbx/dbx_update.sh @@ -9,7 +9,7 @@ get_commit_date() { if [[ "${url}" =~ ^"${github_url}" ]]; then parts=($(awk -F'contents/' '{ for(i=1;i<=NF;i++) print $i }' <<< ${url})) date_url="${parts[0]}commits?path=${parts[1]//\//%2F}&page=1&per_page=1" - epoch="$(curl -s -L ${date_url} | grep -m1 \"date\": | sed -e 's/^.*\"date\":.*\"\(.*\)\".*/\1/' | date -f - +%s)" + epoch="$(curl -s -L ${date_url} | python -m json.tool | grep -m1 \"date\": | sed -e 's/^.*\"date\":.*\"\(.*\)\".*/\1/' | date -f - +%s)" fi echo ${epoch:-0} } diff --git a/src/rufus.rc b/src/rufus.rc index faa0919b..d5a1b031 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.9.2256" +CAPTION "Rufus 4.10.2257" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,9,2256,0 - PRODUCTVERSION 4,9,2256,0 + FILEVERSION 4,10,2257,0 + PRODUCTVERSION 4,10,2257,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.9.2256" + VALUE "FileVersion", "4.10.2257" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" - VALUE "OriginalFilename", "rufus-4.9.exe" + VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.9.2256" + VALUE "ProductVersion", "4.10.2257" END END BLOCK "VarFileInfo" From 170440e51c8f3c251920c7a2fdf4164b5753574d Mon Sep 17 00:00:00 2001 From: ozone10 <positronix10@gmail.com> Date: Mon, 24 Mar 2025 16:09:01 +0000 Subject: [PATCH 067/192] [ui] add dark mode support * Also fix erroneous use of EndDialog() instead of DestroyWindow() in rufus.c, which resulted in WM_DESTROY/WM_NCDESTROY messages not being generated. * Closes #2713. * Closes #2510. * Closes #1453. --- .mingw/Makefile.am | 2 +- .mingw/Makefile.in | 2 +- .mingw/dwmapi.def | 2 + .mingw/uxtheme.def | 15 + .vs/rufus.vcxproj | 34 +- .vs/rufus.vcxproj.filters | 6 + src/Makefile.am | 4 +- src/Makefile.in | 21 +- src/darkmode.c | 1183 +++++++++++++++++++++++++++++++++++++ src/darkmode.h | 148 +++++ src/hash.c | 3 + src/rufus.c | 15 +- src/rufus.h | 6 + src/rufus.rc | 12 +- src/stdlg.c | 58 +- src/ui.c | 31 +- src/ui.h | 26 +- 17 files changed, 1507 insertions(+), 61 deletions(-) create mode 100644 .mingw/uxtheme.def create mode 100644 src/darkmode.c create mode 100644 src/darkmode.h diff --git a/.mingw/Makefile.am b/.mingw/Makefile.am index baa32192..73c428a1 100644 --- a/.mingw/Makefile.am +++ b/.mingw/Makefile.am @@ -20,7 +20,7 @@ TARGET := $(word 1,$(subst -, ,$(TUPLE))) DEF_SUFFIX := $(if $(TARGET:x86_64=),.def,.def64) .PHONY: all -all: crypt32-delaylib.lib dwmapi-delaylib.lib setupapi-delaylib.lib version-delaylib.lib virtdisk-delaylib.lib wininet-delaylib.lib wintrust-delaylib.lib +all: crypt32-delaylib.lib dwmapi-delaylib.lib setupapi-delaylib.lib uxtheme-delaylib.lib version-delaylib.lib virtdisk-delaylib.lib wininet-delaylib.lib wintrust-delaylib.lib %.def64: %.def $(AM_V_SED) "s/@.*//" $< >$@ diff --git a/.mingw/Makefile.in b/.mingw/Makefile.in index 31147c29..74878a2c 100644 --- a/.mingw/Makefile.in +++ b/.mingw/Makefile.in @@ -368,7 +368,7 @@ uninstall-am: .PHONY: all -all: crypt32-delaylib.lib dwmapi-delaylib.lib setupapi-delaylib.lib version-delaylib.lib virtdisk-delaylib.lib wininet-delaylib.lib wintrust-delaylib.lib +all: crypt32-delaylib.lib dwmapi-delaylib.lib setupapi-delaylib.lib uxtheme-delaylib.lib version-delaylib.lib virtdisk-delaylib.lib wininet-delaylib.lib wintrust-delaylib.lib %.def64: %.def $(AM_V_SED) "s/@.*//" $< >$@ diff --git a/.mingw/dwmapi.def b/.mingw/dwmapi.def index 240e17c7..d8c21c97 100644 --- a/.mingw/dwmapi.def +++ b/.mingw/dwmapi.def @@ -1,2 +1,4 @@ EXPORTS + DwmGetColorizationColor@8 DwmGetWindowAttribute@16 + DwmSetWindowAttribute@16 diff --git a/.mingw/uxtheme.def b/.mingw/uxtheme.def new file mode 100644 index 00000000..05aa982c --- /dev/null +++ b/.mingw/uxtheme.def @@ -0,0 +1,15 @@ +EXPORTS + BeginBufferedAnimation@32 + BufferedPaintRenderAnimation@8 + BufferedPaintStopAllAnimations@4 + CloseThemeData@4 + DrawThemeBackground@24 + DrawThemeParentBackground@12 + DrawThemeTextEx@36 + EndBufferedAnimation@8 + GetThemeBackgroundContentRect@24 + GetThemeFont@24 + GetThemePartSize@28 + GetThemeTransitionDuration@24 + OpenThemeData@8 + SetWindowTheme@12 diff --git a/.vs/rufus.vcxproj b/.vs/rufus.vcxproj index 0fa60276..e705de77 100644 --- a/.vs/rufus.vcxproj +++ b/.vs/rufus.vcxproj @@ -133,12 +133,12 @@ <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> </ClCompile> <Link> - <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;uxtheme.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <TargetMachine>MachineX86</TargetMachine> - <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;uxtheme.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> </Link> <ResourceCompile> @@ -163,12 +163,12 @@ <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> </ClCompile> <Link> - <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;uxtheme.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\arm</AdditionalLibraryDirectories> - <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;uxtheme.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> </Link> <ResourceCompile> @@ -195,12 +195,12 @@ <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> </ClCompile> <Link> - <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;uxtheme.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.16299.0\um\arm64</AdditionalLibraryDirectories> - <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;uxtheme.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> </Link> <ResourceCompile> @@ -232,12 +232,12 @@ <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions> </ClCompile> <Link> - <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;uxtheme.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <TargetMachine>MachineX64</TargetMachine> - <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;uxtheme.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> </Link> <ResourceCompile> @@ -264,13 +264,13 @@ <StringPooling>true</StringPooling> </ClCompile> <Link> - <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;uxtheme.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> <GenerateDebugInformation>false</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <TargetMachine>MachineX86</TargetMachine> <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> - <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;uxtheme.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> </Link> <ResourceCompile> <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> @@ -296,13 +296,13 @@ <StringPooling>true</StringPooling> </ClCompile> <Link> - <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;uxtheme.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> <GenerateDebugInformation>false</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\arm</AdditionalLibraryDirectories> <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> - <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;uxtheme.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> </Link> <ResourceCompile> <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> @@ -330,13 +330,13 @@ <StringPooling>true</StringPooling> </ClCompile> <Link> - <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;ole32.lib;advapi32.lib;gdi32.lib;shell32.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;uxtheme.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> <GenerateDebugInformation>false</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <AdditionalLibraryDirectories>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.16299.0\um\arm64</AdditionalLibraryDirectories> <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> - <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;uxtheme.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> </Link> <ResourceCompile> <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> @@ -367,13 +367,13 @@ <StringPooling>true</StringPooling> </ClCompile> <Link> - <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;uxtheme.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> <GenerateDebugInformation>false</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <TargetMachine>MachineX64</TargetMachine> <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions> - <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;uxtheme.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs> </Link> <ResourceCompile> <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> @@ -385,6 +385,7 @@ </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\src\badblocks.c" /> + <ClCompile Include="..\src\darkmode.c" /> <ClCompile Include="..\src\dos_locale.c" /> <ClCompile Include="..\src\drive.c" /> <ClCompile Include="..\src\format.c" /> @@ -418,6 +419,7 @@ <ClInclude Include="..\res\grub\grub_version.h" /> <ClInclude Include="..\src\badblocks.h" /> <ClInclude Include="..\src\bled\bled.h" /> + <ClInclude Include="..\src\darkmode.h" /> <ClInclude Include="..\src\drive.h" /> <ClInclude Include="..\src\efi.h" /> <ClInclude Include="..\src\format.h" /> diff --git a/.vs/rufus.vcxproj.filters b/.vs/rufus.vcxproj.filters index f757813b..3bdc3c22 100644 --- a/.vs/rufus.vcxproj.filters +++ b/.vs/rufus.vcxproj.filters @@ -96,6 +96,9 @@ <ClCompile Include="..\src\xml.c"> <Filter>Source Files</Filter> </ClCompile> + <ClCompile Include="..\src\darkmode.c"> + <Filter>Source Files</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\src\rufus.h"> @@ -206,6 +209,9 @@ <ClInclude Include="..\src\xml.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="..\src\darkmode.h"> + <Filter>Header Files</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <None Include="..\res\rufus.ico"> diff --git a/src/Makefile.am b/src/Makefile.am index c62aa5ce..6e772151 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,7 +3,7 @@ SUBDIRS = ../.mingw bled ext2fs ms-sys syslinux/libfat syslinux/libinstaller sys NONVULNERABLE_LIBS = -lole32 -lgdi32 -lshlwapi -lcomctl32 -luuid -lntdll # The following libraries are vulnerable (or have an unknown vulnerability status), so we link using our delay-loaded replacement: # See https://github.com/pbatard/rufus/issues/2272 -VULNERABLE_LIBS = -lcrypt32-delaylib -ldwmapi-delaylib -lsetupapi-delaylib -lversion-delaylib -lvirtdisk-delaylib -lwininet-delaylib -lwintrust-delaylib +VULNERABLE_LIBS = -lcrypt32-delaylib -ldwmapi-delaylib -lsetupapi-delaylib -luxtheme-delaylib -lversion-delaylib -lvirtdisk-delaylib -lwininet-delaylib -lwintrust-delaylib noinst_PROGRAMS = rufus @@ -15,7 +15,7 @@ AM_V_WINDRES = $(AM_V_WINDRES_$(V)) %_rc.o: %.rc ../res/loc/embedded.loc $(AM_V_WINDRES) $(AM_RCFLAGS) -i $< -o $@ -rufus_SOURCES = badblocks.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ +rufus_SOURCES = badblocks.c darkmode.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c xml.c rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/wimlib -I$(srcdir)/../res $(AM_CFLAGS) \ -DEXT2_FLAT_INCLUDES=0 -D_RUFUS -DSOLUTION=rufus diff --git a/src/Makefile.in b/src/Makefile.in index 1e5f0285..b48d7e21 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -87,11 +87,12 @@ mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) -am_rufus_OBJECTS = rufus-badblocks.$(OBJEXT) rufus-dev.$(OBJEXT) \ - rufus-dos.$(OBJEXT) rufus-dos_locale.$(OBJEXT) \ - rufus-drive.$(OBJEXT) rufus-format.$(OBJEXT) \ - rufus-format_ext.$(OBJEXT) rufus-format_fat32.$(OBJEXT) \ - rufus-hash.$(OBJEXT) rufus-icon.$(OBJEXT) rufus-iso.$(OBJEXT) \ +am_rufus_OBJECTS = rufus-badblocks.$(OBJEXT) rufus-darkmode.$(OBJEXT) \ + rufus-dev.$(OBJEXT) rufus-dos.$(OBJEXT) \ + rufus-dos_locale.$(OBJEXT) rufus-drive.$(OBJEXT) \ + rufus-format.$(OBJEXT) rufus-format_ext.$(OBJEXT) \ + rufus-format_fat32.$(OBJEXT) rufus-hash.$(OBJEXT) \ + rufus-icon.$(OBJEXT) rufus-iso.$(OBJEXT) \ rufus-localization.$(OBJEXT) rufus-net.$(OBJEXT) \ rufus-parser.$(OBJEXT) rufus-pki.$(OBJEXT) \ rufus-process.$(OBJEXT) rufus-re.$(OBJEXT) \ @@ -278,12 +279,12 @@ SUBDIRS = ../.mingw bled ext2fs ms-sys syslinux/libfat syslinux/libinstaller sys NONVULNERABLE_LIBS = -lole32 -lgdi32 -lshlwapi -lcomctl32 -luuid -lntdll # The following libraries are vulnerable (or have an unknown vulnerability status), so we link using our delay-loaded replacement: # See https://github.com/pbatard/rufus/issues/2272 -VULNERABLE_LIBS = -lcrypt32-delaylib -ldwmapi-delaylib -lsetupapi-delaylib -lversion-delaylib -lvirtdisk-delaylib -lwininet-delaylib -lwintrust-delaylib +VULNERABLE_LIBS = -lcrypt32-delaylib -ldwmapi-delaylib -lsetupapi-delaylib -luxtheme-delaylib -lversion-delaylib -lvirtdisk-delaylib -lwininet-delaylib -lwintrust-delaylib AM_V_WINDRES_0 = @echo " RC $@";$(WINDRES) AM_V_WINDRES_1 = $(WINDRES) AM_V_WINDRES_ = $(AM_V_WINDRES_$(AM_DEFAULT_VERBOSITY)) AM_V_WINDRES = $(AM_V_WINDRES_$(V)) -rufus_SOURCES = badblocks.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ +rufus_SOURCES = badblocks.c darkmode.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c xml.c rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/wimlib -I$(srcdir)/../res $(AM_CFLAGS) \ @@ -353,6 +354,12 @@ rufus-badblocks.o: badblocks.c rufus-badblocks.obj: badblocks.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-badblocks.obj `if test -f 'badblocks.c'; then $(CYGPATH_W) 'badblocks.c'; else $(CYGPATH_W) '$(srcdir)/badblocks.c'; fi` +rufus-darkmode.o: darkmode.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-darkmode.o `test -f 'darkmode.c' || echo '$(srcdir)/'`darkmode.c + +rufus-darkmode.obj: darkmode.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-darkmode.obj `if test -f 'darkmode.c'; then $(CYGPATH_W) 'darkmode.c'; else $(CYGPATH_W) '$(srcdir)/darkmode.c'; fi` + rufus-dev.o: dev.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-dev.o `test -f 'dev.c' || echo '$(srcdir)/'`dev.c diff --git a/src/darkmode.c b/src/darkmode.c new file mode 100644 index 00000000..d0f9d803 --- /dev/null +++ b/src/darkmode.c @@ -0,0 +1,1183 @@ +/* + * Rufus: The Reliable USB Formatting Utility + * Dark mode UI implementation + * Copyright © 2025 ozone10 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */ +#ifdef _CRTDBG_MAP_ALLOC +#include <stdlib.h> +#include <crtdbg.h> +#endif + +#include <dwmapi.h> +#include <richedit.h> +#include <uxtheme.h> +#include <versionhelpers.h> +#include <vssym32.h> +#include <math.h> + +#include "rufus.h" +#include "ui.h" +#include "darkmode.h" + +PF_TYPE_DECL(WINAPI, BOOL, AllowDarkModeForWindow, (HWND, BOOL)); +PF_TYPE_DECL(WINAPI, PreferredAppMode, SetPreferredAppMode, (PreferredAppMode)); +PF_TYPE_DECL(WINAPI, VOID, FlushMenuThemes, (VOID)); +PF_TYPE_DECL(WINAPI, BOOL, SetWindowCompositionAttribute, (HWND, WINDOWCOMPOSITIONATTRIBDATA*)); + +BOOL is_darkmode_enabled = FALSE; + +static COLORREF color_accent = TOOLBAR_ICON_COLOR; + +static inline BOOL IsAtLeastWin10Build(DWORD buildNumber) +{ + OSVERSIONINFOEXW osvi = { 0 }; + + if (!IsWindows10OrGreater()) + return FALSE; + + osvi.dwOSVersionInfoSize = sizeof(osvi); + osvi.dwBuildNumber = buildNumber; + + return VerifyVersionInfoW(&osvi, VER_BUILDNUMBER, VerSetConditionMask(0, VER_BUILDNUMBER, VER_GREATER_EQUAL)); +} + +static inline BOOL IsAtLeastWin10(void) +{ + return IsAtLeastWin10Build(WIN10_22H2); +} + +static inline BOOL IsAtLeastWin11(void) +{ + return IsAtLeastWin10Build(WIN11_21H2); +} + +static inline BOOL IsHighContrast(void) +{ + HIGHCONTRASTW highContrast = { 0 }; + + highContrast.cbSize = sizeof(HIGHCONTRASTW); + if (SystemParametersInfoW(SPI_GETHIGHCONTRAST, sizeof(HIGHCONTRASTW), &highContrast, FALSE)) + return (highContrast.dwFlags & HCF_HIGHCONTRASTON) == HCF_HIGHCONTRASTON; + return FALSE; +} + +BOOL GetDarkModeFromRegistry(void) +{ + DWORD data = 0, size = sizeof(data); + + is_darkmode_enabled = FALSE; + if (RegGetValueW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", + L"AppsUseLightTheme", RRF_RT_REG_DWORD, NULL, &data, &size) == ERROR_SUCCESS) + // Dark mode is 0, light mode is 1 + is_darkmode_enabled = (data == 0); + return is_darkmode_enabled; +} + +void InitDarkMode(HWND hWnd) +{ + if (!IsAtLeastWin10() || IsHighContrast()) + goto out; + + PF_INIT_ID_OR_OUT(AllowDarkModeForWindow, UxTheme, 133); + PF_INIT_ID_OR_OUT(SetPreferredAppMode, UxTheme, 135); + PF_INIT_ID_OR_OUT(FlushMenuThemes, UxTheme, 136); + + pfAllowDarkModeForWindow(hWnd, is_darkmode_enabled); + pfSetPreferredAppMode(is_darkmode_enabled ? AppModeForceDark : AppModeForceLight); + pfFlushMenuThemes(); + return; + +out: + is_darkmode_enabled = FALSE; +} + +void SetDarkTitleBar(HWND hWnd) +{ + if (IsAtLeastWin11()) { + DwmSetWindowAttribute(hWnd, DWMWA_USE_IMMERSIVE_DARK_MODE, &is_darkmode_enabled, sizeof(is_darkmode_enabled)); + return; + } + if (IsAtLeastWin10()) { + PF_INIT_OR_OUT(SetWindowCompositionAttribute, user32); + WINDOWCOMPOSITIONATTRIBDATA data = { WCA_USEDARKMODECOLORS, &is_darkmode_enabled, sizeof(is_darkmode_enabled) }; + pfSetWindowCompositionAttribute(hWnd, &data); + return; + } + +out: + is_darkmode_enabled = FALSE; +} + +void SetDarkTheme(HWND hWnd) +{ + SetWindowTheme(hWnd, is_darkmode_enabled ? L"DarkMode_Explorer" : NULL, NULL); +} + +/* + * Accent color functions + */ +// Adapted from https://stackoverflow.com/a/56678483 +static double LinearValue(double color_channel) +{ + color_channel /= 255.0; + if (color_channel <= 0.04045) + return color_channel / 12.92; + return pow((color_channel + 0.055) / 1.055, 2.4); +} + +static double CalculatePerceivedLightness(COLORREF clr) +{ + double r, g, b, luminance, lightness; + + r = LinearValue((double)GetRValue(clr)); + g = LinearValue((double)GetGValue(clr)); + b = LinearValue((double)GetBValue(clr)); + luminance = (0.2126 * r) + (0.7152 * g) + (0.0722 * b); + lightness = (luminance <= 216.0 / 24389.0) ? + (luminance * 24389.0 / 27.0) : + ((pow(luminance, 1.0 / 3.0) * 116.0) - 16.0); + return lightness; +} + +BOOL InitAccentColor(void) +{ + const double lightnessTreshold = 50.0 - 4.0; + BOOL opaque = TRUE; + + if (SUCCEEDED(DwmGetColorizationColor(&color_accent, &opaque))) { + color_accent = RGB(GetBValue(color_accent), GetGValue(color_accent), GetRValue(color_accent)); + // Check if accent color is too dark + if (CalculatePerceivedLightness(color_accent) < lightnessTreshold) { + color_accent = DARKMODE_TOOLBAR_ICON_COLOR; + return FALSE; + } + return TRUE; + } + color_accent = TOOLBAR_ICON_COLOR; + return FALSE; +} + +// Rufus uses monocolour icons, so changing colour is easy +BOOL ChangeIconColor(HICON* hIcon, COLORREF new_color) +{ + HDC hdcScreen = NULL, hdcBitmap = NULL; + HBITMAP hbm = NULL; + BITMAP bmp = { 0 }; + ICONINFO ii; + HICON hIconNew = NULL; + RGBQUAD* pixels = NULL; + + if (!*hIcon || !is_darkmode_enabled) + return FALSE; + + if (new_color == 0) + new_color = color_accent; + + hdcBitmap = CreateCompatibleDC(NULL); + hdcScreen = GetDC(NULL); + if (hdcScreen) { + if (hdcBitmap) { + if (GetIconInfo(*hIcon, &ii) && GetObject(ii.hbmColor, sizeof(BITMAP), &bmp)) { + BITMAPINFO bmi = { 0 }; + bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmi.bmiHeader.biWidth = bmp.bmWidth; + bmi.bmiHeader.biHeight = -bmp.bmHeight; + bmi.bmiHeader.biPlanes = 1; + bmi.bmiHeader.biBitCount = 32; + bmi.bmiHeader.biCompression = BI_RGB; + + pixels = (RGBQUAD*)malloc((size_t)bmp.bmWidth * bmp.bmHeight * sizeof(RGBQUAD)); + if (pixels && GetDIBits(hdcBitmap, ii.hbmColor, 0, bmp.bmHeight, pixels, &bmi, DIB_RGB_COLORS)) { + for (int i = 0; i < bmp.bmWidth * bmp.bmHeight; i++) { + if (pixels[i].rgbReserved != 0) { + pixels[i].rgbRed = GetRValue(new_color); + pixels[i].rgbGreen = GetGValue(new_color); + pixels[i].rgbBlue = GetBValue(new_color); + } + } + + hbm = CreateCompatibleBitmap(hdcScreen, bmp.bmWidth, bmp.bmHeight); + if (hbm != NULL) { + SetDIBits(hdcBitmap, hbm, 0, bmp.bmHeight, pixels, &bmi, DIB_RGB_COLORS); + if (ii.hbmColor != NULL) + DeleteObject(ii.hbmColor); + ii.hbmColor = hbm; + hIconNew = CreateIconIndirect(&ii); + } else { + safe_free(pixels); + DeleteObject(ii.hbmColor); + DeleteObject(ii.hbmMask); + DeleteDC(hdcBitmap); + ReleaseDC(NULL, hdcScreen); + return FALSE; + } + } + + safe_free(pixels); + safe_delete_object(hbm); + DeleteObject(ii.hbmColor); + DeleteObject(ii.hbmMask); + } + } + ReleaseDC(NULL, hdcScreen); + } + + if (hdcBitmap != NULL) + DeleteDC(hdcBitmap); + + if (hIconNew == NULL) + return FALSE; + DestroyIcon(*hIcon); + *hIcon = hIconNew; + + return TRUE; +} + +/* + * Dark mode custom colors + */ +static ThemeResources theme_resources = { + NULL, NULL, NULL, NULL, NULL, NULL +}; + +static HBRUSH GetDlgBackgroundBrush(void) +{ + if (theme_resources.hbrBackground == NULL) + theme_resources.hbrBackground = CreateSolidBrush(DARKMODE_NORMAL_DIALOG_BACKGROUND_COLOR); + return theme_resources.hbrBackground; +} + +static HBRUSH GetCtrlBackgroundBrush(void) +{ + if (theme_resources.hbrBackgroundControl == NULL) + theme_resources.hbrBackgroundControl = CreateSolidBrush(DARKMODE_NORMAL_CONTROL_BACKGROUND_COLOR); + return theme_resources.hbrBackgroundControl; +} + +static HBRUSH GetHotBackgroundBrush(void) +{ + if (theme_resources.hbrBackgroundHot == NULL) + theme_resources.hbrBackgroundHot = CreateSolidBrush(DARKMODE_HOT_CONTROL_BACKGROUND_COLOR); + return theme_resources.hbrBackgroundHot; +} + +static HBRUSH GetEdgeBrush(void) +{ + if (theme_resources.hbrEdge == NULL) + theme_resources.hbrEdge = CreateSolidBrush(DARKMODE_NORMAL_CONTROL_EDGE_COLOR); + return theme_resources.hbrEdge; +} + +static HPEN GetEdgePen(void) +{ + if (theme_resources.hpnEdge == NULL) + theme_resources.hpnEdge = CreatePen(PS_SOLID, 1, DARKMODE_NORMAL_CONTROL_EDGE_COLOR); + return theme_resources.hpnEdge; +} +static HPEN GetHotEdgePen(void) +{ + if (theme_resources.hpnEdgeHot == NULL) + theme_resources.hpnEdgeHot = CreatePen(PS_SOLID, 1, DARKMODE_HOT_CONTROL_EDGE_COLOR); + return theme_resources.hpnEdgeHot; +} + +void DestroyDarkModeGDIObjects(void) +{ + safe_delete_object(theme_resources.hbrBackground); + safe_delete_object(theme_resources.hbrBackgroundControl); + safe_delete_object(theme_resources.hbrBackgroundHot); + safe_delete_object(theme_resources.hbrEdge); + safe_delete_object(theme_resources.hpnEdge); + safe_delete_object(theme_resources.hpnEdgeHot); +} + +/* + * Paint round rect helpers + */ +static void PaintRoundRect(HDC hdc, const RECT rect, HPEN hpen, HBRUSH hBrush, int width, int height) +{ + HBRUSH holdBrush = (HBRUSH)SelectObject(hdc, hBrush); + HPEN holdPen = (HPEN)SelectObject(hdc, hpen); + + RoundRect(hdc, rect.left, rect.top, rect.right, rect.bottom, width, height); + SelectObject(hdc, holdBrush); + SelectObject(hdc, holdPen); +} + +static void PaintRoundFrameRect(HDC hdc, const RECT rect, HPEN hpen, int width, int height) +{ + PaintRoundRect(hdc, rect, hpen, GetStockObject(NULL_BRUSH), width, height); +} + +/* + * Button section, checkbox, radio, and groupbox style buttons + */ +static void RenderButton(HWND hWnd, HDC hdc, HTHEME hTheme, int iPartID, int iStateID) +{ + HFONT hFont = NULL, hOldFont; + BOOL created_font = FALSE; + LOGFONT lf; + RECT rcClient = { 0 }, rcText = { 0 }, rcBackground, rcFocus; + WCHAR buffer[MAX_PATH] = { '\0' }; + SIZE szBox = { 0 }; + LONG_PTR nStyle = GetWindowLongPtr(hWnd, GWL_STYLE); + DWORD flags, ui_state; + DTTOPTS dtto = { 0 }; + + const BOOL isMultiline = (nStyle & BS_MULTILINE) == BS_MULTILINE; + const BOOL isTop = (nStyle & BS_TOP) == BS_TOP; + const BOOL isBottom = (nStyle & BS_BOTTOM) == BS_BOTTOM; + const BOOL isCenter = (nStyle & BS_CENTER) == BS_CENTER; + const BOOL isRight = (nStyle & BS_RIGHT) == BS_RIGHT; + const BOOL isVCenter = (nStyle & BS_VCENTER) == BS_VCENTER; + + if (SUCCEEDED(GetThemeFont(hTheme, hdc, iPartID, iStateID, TMT_FONT, &lf))) { + hFont = CreateFontIndirect(&lf); + created_font = TRUE; + } + if (!hFont) + hFont = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0); + hOldFont = (HFONT)SelectObject(hdc, hFont); + + flags = DT_LEFT | (isMultiline ? DT_WORDBREAK : DT_SINGLELINE); + if (isCenter) + flags |= DT_CENTER; + else if (isRight) + flags |= DT_RIGHT; + if (isVCenter || (!isMultiline && !isBottom && !isTop)) + flags |= DT_VCENTER; + else if (isBottom) + flags |= DT_BOTTOM; + + ui_state = (DWORD)SendMessage(hWnd, WM_QUERYUISTATE, 0, 0); + if ((ui_state & UISF_HIDEACCEL) == UISF_HIDEACCEL) + flags |= DT_HIDEPREFIX; + + GetClientRect(hWnd, &rcClient); + GetWindowText(hWnd, buffer, _countof(buffer)); + GetThemePartSize(hTheme, hdc, iPartID, iStateID, NULL, TS_DRAW, &szBox); + GetThemeBackgroundContentRect(hTheme, hdc, iPartID, iStateID, &rcClient, &rcText); + rcBackground = rcClient; + if (!isMultiline) + rcBackground.top += (rcText.bottom - rcText.top - szBox.cy) / 2; + rcBackground.bottom = rcBackground.top + szBox.cy; + rcBackground.right = rcBackground.left + szBox.cx; + rcText.left = rcBackground.right + 3; + + DrawThemeParentBackground(hWnd, hdc, &rcClient); + DrawThemeBackground(hTheme, hdc, iPartID, iStateID, &rcBackground, NULL); + + dtto.dwSize = sizeof(DTTOPTS); + dtto.dwFlags = DTT_TEXTCOLOR; + dtto.crText = !IsWindowEnabled(hWnd) ? DARKMODE_DISABLED_TEXT_COLOR : DARKMODE_NORMAL_TEXT_COLOR; + + DrawThemeTextEx(hTheme, hdc, iPartID, iStateID, buffer, -1, flags, &rcText, &dtto); + + if (((SendMessage(hWnd, BM_GETSTATE, 0, 0) & BST_FOCUS) == BST_FOCUS) && ((ui_state & UISF_HIDEFOCUS) != UISF_HIDEFOCUS)) { + dtto.dwFlags |= DTT_CALCRECT; + DrawThemeTextEx(hTheme, hdc, iPartID, iStateID, buffer, -1, flags | DT_CALCRECT, &rcText, &dtto); + rcFocus = rcText; + rcFocus.bottom++; + rcFocus.left--; + rcFocus.right++; + DrawFocusRect(hdc, &rcFocus); + } + + SelectObject(hdc, hOldFont); + if (created_font) + DeleteObject(hFont); +} + +static void PaintButton(HWND hWnd, HDC hdc, ButtonData* pButtonData) +{ + const DWORD state = (DWORD)SendMessage(hWnd, BM_GETSTATE, 0, 0); + int part_id = BP_CHECKBOX, state_id = RBS_UNCHECKEDNORMAL; + BP_ANIMATIONPARAMS anim_params = { 0 }; + HANIMATIONBUFFER anim_buffer; + RECT rcClient = { 0 }; + HDC hdcFrom = NULL, hdcTo = NULL; + + switch (GetWindowLongPtr(hWnd, GWL_STYLE) & BS_TYPEMASK) { + case BS_CHECKBOX: + case BS_AUTOCHECKBOX: + case BS_3STATE: + case BS_AUTO3STATE: + part_id = BP_CHECKBOX; + break; + case BS_RADIOBUTTON: + case BS_AUTORADIOBUTTON: + part_id = BP_RADIOBUTTON; + break; + default: + break; + } + + // States of BP_CHECKBOX and BP_RADIOBUTTON are the same + if (!IsWindowEnabled(hWnd)) + state_id = RBS_UNCHECKEDDISABLED; + else if (state & BST_PUSHED) + state_id = RBS_UNCHECKEDPRESSED; + else if (state & BST_HOT) + state_id = RBS_UNCHECKEDHOT; + if (state & BST_CHECKED) + state_id += 4; + if (BufferedPaintRenderAnimation(hWnd, hdc)) + return; + + anim_params.cbSize = sizeof(BP_ANIMATIONPARAMS); + anim_params.style = BPAS_LINEAR; + if (state_id != pButtonData->iStateID) + GetThemeTransitionDuration(pButtonData->hTheme, part_id, pButtonData->iStateID, state_id, TMT_TRANSITIONDURATIONS, &anim_params.dwDuration); + + GetClientRect(hWnd, &rcClient); + anim_buffer = BeginBufferedAnimation(hWnd, hdc, &rcClient, BPBF_COMPATIBLEBITMAP, NULL, &anim_params, &hdcFrom, &hdcTo); + if (anim_buffer != NULL) { + if (hdcFrom != NULL) + RenderButton(hWnd, hdcFrom, pButtonData->hTheme, part_id, pButtonData->iStateID); + if (hdcTo != NULL) + RenderButton(hWnd, hdcTo, pButtonData->hTheme, part_id, state_id); + pButtonData->iStateID = state_id; + EndBufferedAnimation(anim_buffer, TRUE); + } else { + RenderButton(hWnd, hdc, pButtonData->hTheme, part_id, state_id); + pButtonData->iStateID = state_id; + } +} + +static LRESULT CALLBACK ButtonSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, + UINT_PTR uIdSubclass, DWORD_PTR dwRefData) +{ + ButtonData* data = (ButtonData*)dwRefData; + + switch (uMsg) { + case WM_NCDESTROY: + RemoveWindowSubclass(hWnd, ButtonSubclass, uIdSubclass); + if (data->hTheme != NULL) + CloseThemeData(data->hTheme); + free(data); + break; + + case WM_ERASEBKGND: + if (data->hTheme == NULL) + data->hTheme = OpenThemeData(hWnd, VSCLASS_BUTTON); + if (data->hTheme != NULL) + return TRUE; + break; + + case WM_PRINTCLIENT: + case WM_PAINT: + PAINTSTRUCT ps = { 0 }; + HDC hdc = (HDC)wParam; + if (data->hTheme == NULL) { + data->hTheme = OpenThemeData(hWnd, VSCLASS_BUTTON); + if (data->hTheme == NULL) + break; + } + if (hdc == NULL) + hdc = BeginPaint(hWnd, &ps); + PaintButton(hWnd, hdc, data); + if (ps.hdc != NULL) + EndPaint(hWnd, &ps); + return 0; + + case WM_THEMECHANGED: + if (data->hTheme != NULL) + CloseThemeData(data->hTheme); + break; + + case WM_SIZE: + case WM_DESTROY: + BufferedPaintStopAllAnimations(hWnd); + break; + + case WM_ENABLE: + // Skip the button's normal WindowProc so it won't redraw out of WM_PAINT + LRESULT lr = DefWindowProc(hWnd, uMsg, wParam, lParam); + InvalidateRect(hWnd, NULL, FALSE); + return lr; + + case WM_UPDATEUISTATE: + if (HIWORD(wParam) & (UISF_HIDEACCEL | UISF_HIDEFOCUS)) + InvalidateRect(hWnd, NULL, FALSE); + break; + } + return DefSubclassProc(hWnd, uMsg, wParam, lParam); +} + +static void SubclassButtonControl(HWND hWnd) +{ + void* data = NULL; + + if (GetWindowSubclass(hWnd, ButtonSubclass, (UINT_PTR)ButtonSubclassID, NULL)) + return; + + data = calloc(1, sizeof(ButtonData)); + SetWindowSubclass(hWnd, ButtonSubclass, (UINT_PTR)ButtonSubclassID, (DWORD_PTR)data); +} + +static void PaintGroupbox(HWND hWnd, HDC hdc, ButtonData buttonData) +{ + const int iStateID = IsWindowEnabled(hWnd) ? GBS_NORMAL : GBS_DISABLED; + const BOOL centered = (GetWindowLongPtr(hWnd, GWL_STYLE) & BS_CENTER) == BS_CENTER; + BOOL font_created = FALSE; + HFONT hFont = NULL, hOldFont; + LOGFONT lf; + WCHAR buffer[MAX_PATH] = { '\0' }; + SIZE szText = { 0 }; + RECT rcClient = { 0 }, rcText, rcBackground, rcContent; + + if (SUCCEEDED(GetThemeFont(buttonData.hTheme, hdc, BP_GROUPBOX, iStateID, TMT_FONT, &lf))) { + hFont = CreateFontIndirect(&lf); + font_created = TRUE; + } + if (hFont == NULL) { + hFont = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0); + font_created = FALSE; + } + hOldFont = (HFONT)SelectObject(hdc, hFont); + GetWindowText(hWnd, buffer, _countof(buffer)); + GetClientRect(hWnd, &rcClient); + rcClient.bottom -= 1; + rcText = rcClient; rcBackground = rcClient; + + if (buffer[0]) { + GetTextExtentPoint32(hdc, buffer, (int)wcslen(buffer), &szText); + rcBackground.top += szText.cy / 2; + rcText.left += centered ? ((rcClient.right - rcClient.left - szText.cx) / 2) : 7; + rcText.bottom = rcText.top + szText.cy; + rcText.right = rcText.left + szText.cx + 4; + ExcludeClipRect(hdc, rcText.left, rcText.top, rcText.right, rcText.bottom); + } else { + GetTextExtentPoint32(hdc, L"M", 1, &szText); + rcBackground.top += szText.cy / 2; + } + rcContent = rcBackground; + + GetThemeBackgroundContentRect(buttonData.hTheme, hdc, BP_GROUPBOX, iStateID, &rcBackground, &rcContent); + ExcludeClipRect(hdc, rcContent.left, rcContent.top, rcContent.right, rcContent.bottom); + PaintRoundFrameRect(hdc, rcBackground, GetEdgePen(), 0, 0); + SelectClipRgn(hdc, NULL); + + if (buffer[0]) { + DTTOPTS dtto = { 0 }; + DWORD flags = centered ? DT_CENTER : DT_LEFT; + InflateRect(&rcText, -2, 0); + dtto.dwSize = sizeof(DTTOPTS); + dtto.dwFlags = DTT_TEXTCOLOR; + dtto.crText = IsWindowEnabled(hWnd) ? DARKMODE_NORMAL_TEXT_COLOR : DARKMODE_DISABLED_TEXT_COLOR; + if (SendMessage(hWnd, WM_QUERYUISTATE, 0, 0) != (LRESULT)NULL) + flags |= DT_HIDEPREFIX; + DrawThemeTextEx(buttonData.hTheme, hdc, BP_GROUPBOX, iStateID, buffer, -1, flags | DT_SINGLELINE, &rcText, &dtto); + } + + SelectObject(hdc, hOldFont); + if (font_created) + DeleteObject(hFont); +} + +static LRESULT CALLBACK GroupboxSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, + UINT_PTR uIdSubclass, DWORD_PTR dwRefData) +{ + ButtonData* data = (ButtonData*)dwRefData; + + switch (uMsg) { + case WM_NCDESTROY: + RemoveWindowSubclass(hWnd, ButtonSubclass, uIdSubclass); + if (data->hTheme != NULL) + CloseThemeData(data->hTheme); + free(data); + break; + + case WM_ERASEBKGND: + if (data->hTheme == NULL) + data->hTheme = OpenThemeData(hWnd, VSCLASS_BUTTON); + if (data->hTheme != NULL) + return TRUE; + break; + + case WM_PRINTCLIENT: + case WM_PAINT: + PAINTSTRUCT ps = { 0 }; + HDC hdc = (HDC)wParam; + if (data->hTheme == NULL) { + data->hTheme = OpenThemeData(hWnd, VSCLASS_BUTTON); + if (data->hTheme == NULL) + break; + } + if (hdc == NULL) + hdc = BeginPaint(hWnd, &ps); + PaintGroupbox(hWnd, hdc, *data); + if (ps.hdc != NULL) + EndPaint(hWnd, &ps); + return 0; + + case WM_THEMECHANGED: + if (data->hTheme != NULL) + CloseThemeData(data->hTheme); + break; + + case WM_ENABLE: + RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE); + break; + } + return DefSubclassProc(hWnd, uMsg, wParam, lParam); +} + +static void SubclassGroupboxControl(HWND hWnd) +{ + void* data = NULL; + + if (GetWindowSubclass(hWnd, GroupboxSubclass, (UINT_PTR)GroupboxSubclassID, NULL)) + return; + + data = calloc(1, sizeof(ButtonData)); + SetWindowSubclass(hWnd, GroupboxSubclass, (UINT_PTR)GroupboxSubclassID, (DWORD_PTR)data); +} + +/* + * Toolbar section + */ +static LRESULT DarkToolBarNotifyCustomDraw(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + LPNMTBCUSTOMDRAW lpnmtbcd = (LPNMTBCUSTOMDRAW)lParam; + static int roundness = 0; + + switch (lpnmtbcd->nmcd.dwDrawStage) { + case CDDS_PREPAINT: + if (IsAtLeastWin11()) + roundness = 5; + FillRect(lpnmtbcd->nmcd.hdc, &lpnmtbcd->nmcd.rc, GetDlgBackgroundBrush()); + return CDRF_NOTIFYITEMDRAW; + + case CDDS_ITEMPREPAINT: + LRESULT lr = TBCDRF_USECDCOLORS; + lpnmtbcd->hbrMonoDither = GetDlgBackgroundBrush(); + lpnmtbcd->hbrLines = GetEdgeBrush(); + lpnmtbcd->hpenLines = GetEdgePen(); + lpnmtbcd->clrText = DARKMODE_NORMAL_TEXT_COLOR; + lpnmtbcd->clrTextHighlight = DARKMODE_NORMAL_TEXT_COLOR; + lpnmtbcd->clrBtnFace = DARKMODE_NORMAL_DIALOG_BACKGROUND_COLOR; + lpnmtbcd->clrBtnHighlight = DARKMODE_NORMAL_CONTROL_BACKGROUND_COLOR; + lpnmtbcd->clrHighlightHotTrack = DARKMODE_HOT_CONTROL_BACKGROUND_COLOR; + lpnmtbcd->nStringBkMode = TRANSPARENT; + lpnmtbcd->nHLStringBkMode = TRANSPARENT; + if ((lpnmtbcd->nmcd.uItemState & CDIS_HOT) == CDIS_HOT) { + PaintRoundRect(lpnmtbcd->nmcd.hdc, lpnmtbcd->nmcd.rc, GetHotEdgePen(), GetHotBackgroundBrush(), roundness, roundness); + lpnmtbcd->nmcd.uItemState &= ~(CDIS_CHECKED | CDIS_HOT); + } else if ((lpnmtbcd->nmcd.uItemState & CDIS_CHECKED) == CDIS_CHECKED) { + PaintRoundRect(lpnmtbcd->nmcd.hdc, lpnmtbcd->nmcd.rc, GetEdgePen(), GetCtrlBackgroundBrush(), roundness, roundness); + lpnmtbcd->nmcd.uItemState &= ~CDIS_CHECKED; + } + if ((lpnmtbcd->nmcd.uItemState & CDIS_SELECTED) == CDIS_SELECTED) + lr |= TBCDRF_NOBACKGROUND; + return lr; + + default: + break; + } + return DefSubclassProc(hWnd, uMsg, wParam, lParam); +} + +static LRESULT DarkTrackBarNotifyCustomDraw(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + LPNMCUSTOMDRAW lpnmcd = (LPNMCUSTOMDRAW)lParam; + + switch (lpnmcd->dwDrawStage) { + case CDDS_PREPAINT: + return CDRF_NOTIFYITEMDRAW; + + case CDDS_ITEMPREPAINT: + switch (lpnmcd->dwItemSpec) { + case TBCD_THUMB: + if ((lpnmcd->uItemState & CDIS_SELECTED) == CDIS_SELECTED) { + FillRect(lpnmcd->hdc, &lpnmcd->rc, GetCtrlBackgroundBrush()); + return CDRF_SKIPDEFAULT; + } + break; + + case TBCD_CHANNEL: + if (!IsWindowEnabled(lpnmcd->hdr.hwndFrom)) { + FillRect(lpnmcd->hdc, &lpnmcd->rc, GetDlgBackgroundBrush()); + PaintRoundFrameRect(lpnmcd->hdc, lpnmcd->rc, GetEdgePen(), 0, 0); + } else { + FillRect(lpnmcd->hdc, &lpnmcd->rc, GetCtrlBackgroundBrush()); + } + return CDRF_SKIPDEFAULT; + + default: + break; + } + break; + + default: + break; + } + return DefSubclassProc(hWnd, uMsg, wParam, lParam); +} + +static LRESULT CALLBACK WindowNotifySubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, + UINT_PTR uIdSubclass, DWORD_PTR dwRefData) +{ + (void)dwRefData; + + switch (uMsg) { + case WM_NCDESTROY: + RemoveWindowSubclass(hWnd, WindowNotifySubclass, uIdSubclass); + break; + + case WM_NOTIFY: + LPNMHDR lpnmhdr = (LPNMHDR)lParam; + WCHAR str[32] = { 0 }; + GetClassName(lpnmhdr->hwndFrom, str, ARRAYSIZE(str)); + + switch (lpnmhdr->code) { + case NM_CUSTOMDRAW: + if (_wcsicmp(str, TOOLBARCLASSNAME) == 0) + return DarkToolBarNotifyCustomDraw(hWnd, uMsg, wParam, lParam); + if (_wcsicmp(str, TRACKBAR_CLASS) == 0) + return DarkTrackBarNotifyCustomDraw(hWnd, uMsg, wParam, lParam); + break; + } + break; + } + return DefSubclassProc(hWnd, uMsg, wParam, lParam); +} + +void SubclassNotifyCustomDraw(HWND hWnd) +{ + if (!GetWindowSubclass(hWnd, WindowNotifySubclass, (UINT_PTR)WindowNotifySubclassID, NULL)) + SetWindowSubclass(hWnd, WindowNotifySubclass, (UINT_PTR)WindowNotifySubclassID, 0); +} + +/* + * Status bar section + */ +static void PaintStatusBar(HWND hWnd, HDC hdc, StatusBarData statusBarData) +{ + const int last_div = (int)SendMessage(hWnd, SB_GETPARTS, 0, 0) - 1; + Borders borders = { 0 }; + RECT rcClient = { 0 }, rcPart = { 0 }, rcIntersect = { 0 }; + HPEN hOldPen = (HPEN)SelectObject(hdc, GetEdgePen()); + HFONT hOldFont = (HFONT)SelectObject(hdc, statusBarData.hFont); + LRESULT r1, r2; + LPWSTR buffer; + DWORD text_len; + UINT id; + + SendMessage(hWnd, SB_GETBORDERS, 0, (LPARAM)&borders); + SetBkMode(hdc, TRANSPARENT); + SetTextColor(hdc, DARKMODE_NORMAL_TEXT_COLOR); + GetClientRect(hWnd, &rcClient); + FillRect(hdc, &rcClient, GetDlgBackgroundBrush()); + + for (int i = 0; i <= last_div; i++) { + SendMessage(hWnd, SB_GETRECT, i, (LPARAM)&rcPart); + if (!IntersectRect(&rcIntersect, &rcPart, &rcClient)) + continue; + if (i < last_div) { + POINT edges[] = { + { rcPart.right - borders.between, rcPart.top + 1 }, + { rcPart.right - borders.between, rcPart.bottom - 3 } + }; + Polyline(hdc, edges, _countof(edges)); + } + + rcPart.left += borders.between; + rcPart.right -= borders.vertical; + + r1 = SendMessage(hWnd, SB_GETTEXTLENGTH, i, 0); + text_len = LOWORD(r1); + buffer = (LPWSTR)calloc((size_t)text_len + 1, sizeof(WCHAR)); + r2 = SendMessage(hWnd, SB_GETTEXT, i, (LPARAM)buffer); + if (text_len == 0 && (HIWORD(r1) & SBT_OWNERDRAW)) { + id = GetDlgCtrlID(hWnd); + DRAWITEMSTRUCT dis = { 0, 0, (UINT)i, ODA_DRAWENTIRE, id, hWnd, hdc, rcPart, (ULONG_PTR)r2 }; + SendMessage(GetParent(hWnd), WM_DRAWITEM, id, (LPARAM)&dis); + } else if (buffer != NULL) { + DrawText(hdc, buffer, (int)text_len, &rcPart, DT_SINGLELINE | DT_VCENTER | DT_LEFT); + } + free(buffer); + } + + POINT horizontal_edge[] = { { rcClient.left, rcClient.top }, { rcClient.right, rcClient.top } }; + Polyline(hdc, horizontal_edge, _countof(horizontal_edge)); + + SelectObject(hdc, hOldFont); + SelectObject(hdc, hOldPen); +} + +static LRESULT CALLBACK StatusBarSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, + UINT_PTR uIdSubclass, DWORD_PTR dwRefData) +{ + StatusBarData* data = (StatusBarData*)dwRefData; + + switch (uMsg) { + case WM_NCDESTROY: + RemoveWindowSubclass(hWnd, StatusBarSubclass, uIdSubclass); + if (data->hFont != NULL) { + DeleteObject(data->hFont); + data->hFont = NULL; + } + free(data); + break; + + case WM_ERASEBKGND: + return TRUE; + + case WM_PAINT: + PAINTSTRUCT ps; + HDC hdc = BeginPaint(hWnd, &ps); + PaintStatusBar(hWnd, hdc, *data); + EndPaint(hWnd, &ps); + return 0; + + case WM_THEMECHANGED: + NONCLIENTMETRICS ncm = { 0 }; + ncm.cbSize = sizeof(NONCLIENTMETRICS); + if (data->hFont != NULL) { + DeleteObject(data->hFont); + data->hFont = NULL; + } + if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0)) + data->hFont = CreateFontIndirect(&ncm.lfStatusFont); + return 0; + } + return DefSubclassProc(hWnd, uMsg, wParam, lParam); +} + +void SubclassStatusBar(HWND hWnd) +{ + StatusBarData* data = NULL; + NONCLIENTMETRICS ncm = { 0 }; + ncm.cbSize = sizeof(NONCLIENTMETRICS); + + if (!is_darkmode_enabled || GetWindowSubclass(hWnd, StatusBarSubclass, (UINT_PTR)StatusBarSubclassID, NULL)) + return; + + data = (StatusBarData*)malloc(sizeof(StatusBarData)); + if (data == NULL) + return; + if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0)) + data->hFont = CreateFontIndirect(&ncm.lfStatusFont); + SetWindowSubclass(hWnd, StatusBarSubclass, (UINT_PTR)StatusBarSubclassID, (DWORD_PTR)data); +} + +/* + * Progress bar section + */ +static void GetProgressBarRects(HWND hWnd, RECT* rcEmpty, RECT* rcFilled) +{ + const int pos = (int)SendMessage(hWnd, PBM_GETPOS, 0, 0); + PBRANGE range = { 0, 0 }; + SendMessage(hWnd, PBM_GETRANGE, TRUE, (LPARAM)&range); + const int min = range.iLow; + const int cur_pos = pos - min; + + if (cur_pos != 0) { + int totalWidth = rcEmpty->right - rcEmpty->left; + rcFilled->left = rcEmpty->left; + rcFilled->top = rcEmpty->top; + rcFilled->bottom = rcEmpty->bottom; + rcFilled->right = rcEmpty->left + (int)((double)(cur_pos) / (range.iHigh - min) * totalWidth); + rcEmpty->left = rcFilled->right; // To avoid painting under filled part + } +} + +static void PaintProgressBar(HWND hWnd, HDC hdc, ProgressBarData progressBarData) +{ + RECT rcClient = { 0 }, rcFill = { 0 }; + + GetClientRect(hWnd, &rcClient); + PaintRoundFrameRect(hdc, rcClient, GetEdgePen(), 0, 0); + InflateRect(&rcClient, -1, -1); + rcClient.left = 1; + GetProgressBarRects(hWnd, &rcClient, &rcFill); + DrawThemeBackground(progressBarData.hTheme, hdc, PP_FILL, progressBarData.iStateID, &rcFill, NULL); + FillRect(hdc, &rcClient, GetCtrlBackgroundBrush()); +} + +static LRESULT CALLBACK ProgressBarSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, + UINT_PTR uIdSubclass, DWORD_PTR dwRefData) +{ + ProgressBarData* data = (ProgressBarData*)dwRefData; + + switch (uMsg) { + case WM_NCDESTROY: + RemoveWindowSubclass(hWnd, ProgressBarSubclass, uIdSubclass); + if (data->hTheme != NULL) + CloseThemeData(data->hTheme); + free(data); + break; + + case WM_ERASEBKGND: + if (data->hTheme == NULL) + data->hTheme = OpenThemeData(hWnd, VSCLASS_PROGRESS); + if (data->hTheme != NULL) + return TRUE; + break; + + case WM_PAINT: + PAINTSTRUCT ps; + HDC hdc; + if (data->hTheme == NULL) { + data->hTheme = OpenThemeData(hWnd, VSCLASS_PROGRESS); + if (data->hTheme == NULL) + break; + } + hdc = BeginPaint(hWnd, &ps); + PaintProgressBar(hWnd, hdc, *data); + EndPaint(hWnd, &ps); + return 0; + + case WM_THEMECHANGED: + if (data->hTheme != NULL) + CloseThemeData(data->hTheme); + break; + + case PBM_SETSTATE: + switch (wParam) { + case PBST_NORMAL: + data->iStateID = PBFS_NORMAL; // Green + break; + case PBST_ERROR: + data->iStateID = PBFS_ERROR; // Red + break; + case PBST_PAUSED: + data->iStateID = PBFS_PAUSED; // Yellow + break; + } + break; + } + return DefSubclassProc(hWnd, uMsg, wParam, lParam); +} + +void SubclassProgressBarControl(HWND hWnd) +{ + void* data = NULL; + + if (!is_darkmode_enabled || GetWindowSubclass(hWnd, ProgressBarSubclass, (UINT_PTR)ProgressBarSubclassID, NULL)) + return; + + data = calloc(1, sizeof(ProgressBarData)); + SetWindowSubclass(hWnd, ProgressBarSubclass, (UINT_PTR)ProgressBarSubclassID, (DWORD_PTR)data); +} + +/* + * Static text section + */ +static LRESULT CALLBACK StaticTextSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, + UINT_PTR uIdSubclass, DWORD_PTR dwRefData) +{ + StaticTextData* data = (StaticTextData*)dwRefData; + + switch (uMsg) { + case WM_NCDESTROY: + RemoveWindowSubclass(hWnd, StaticTextSubclass, uIdSubclass); + free(data); + break; + + case WM_ENABLE: + RECT rcClient = { 0 }; + const LONG_PTR style = GetWindowLongPtr(hWnd, GWL_STYLE); + data->disabled = (wParam == FALSE); + if (data->disabled) + SetWindowLongPtr(hWnd, GWL_STYLE, style & ~WS_DISABLED); + GetClientRect(hWnd, &rcClient); + MapWindowPoints(hWnd, GetParent(hWnd), (LPPOINT)&rcClient, 2); + RedrawWindow(GetParent(hWnd), &rcClient, NULL, RDW_INVALIDATE | RDW_UPDATENOW); + if (data->disabled) + SetWindowLongPtr(hWnd, GWL_STYLE, style | WS_DISABLED); + return 0; + } + return DefSubclassProc(hWnd, uMsg, wParam, lParam); +} + +static void SubclassStaticText(HWND hWnd) +{ + void* data = NULL; + + if (GetWindowSubclass(hWnd, StaticTextSubclass, (UINT_PTR)StaticTextSubclassID, NULL)) + return; + + data = calloc(1, sizeof(StaticTextData)); + SetWindowSubclass(hWnd, StaticTextSubclass, (UINT_PTR)StaticTextSubclassID, (DWORD_PTR)data); +} + +/* + * Ctl color messages section + */ +static LRESULT OnCtlColorDlg(HDC hdc) +{ + SetTextColor(hdc, DARKMODE_NORMAL_TEXT_COLOR); + SetBkColor(hdc, DARKMODE_NORMAL_DIALOG_BACKGROUND_COLOR); + return (LRESULT)GetDlgBackgroundBrush(); +} + +static LRESULT OnCtlColorStatic(WPARAM wParam, LPARAM lParam) +{ + HDC hdc = (HDC)wParam; + HWND hWnd = (HWND)lParam; + WCHAR str[32] = { 0 }; + + GetClassName(hWnd, str, ARRAYSIZE(str)); + if (_wcsicmp(str, WC_STATIC) == 0) { + if ((GetWindowLongPtr(hWnd, GWL_STYLE) & SS_NOTIFY) == SS_NOTIFY) { + DWORD_PTR dwRefData = 0; + COLORREF cText = color_accent; + if (GetWindowSubclass(hWnd, StaticTextSubclass, (UINT_PTR)StaticTextSubclassID, &dwRefData)) { + if (((StaticTextData*)dwRefData)->disabled) + cText = DARKMODE_DISABLED_TEXT_COLOR; + } + SetTextColor(hdc, cText); + SetBkColor(hdc, DARKMODE_NORMAL_DIALOG_BACKGROUND_COLOR); + return (LRESULT)GetDlgBackgroundBrush(); + } + } + // Read-only WC_EDIT + return OnCtlColorDlg(hdc); +} + +static LRESULT OnCtlColorCtrl(HDC hdc) +{ + SetTextColor(hdc, DARKMODE_NORMAL_TEXT_COLOR); + SetBkColor(hdc, DARKMODE_NORMAL_CONTROL_BACKGROUND_COLOR); + return (LRESULT)GetCtrlBackgroundBrush(); +} + +static INT_PTR OnCtlColorListbox(WPARAM wParam, LPARAM lParam) +{ + HDC hdc = (HDC)wParam; + HWND hWnd = (HWND)lParam; + const LONG_PTR nStyle = GetWindowLongPtr(hWnd, GWL_STYLE); + BOOL isComboBox = (nStyle & LBS_COMBOBOX) == LBS_COMBOBOX; + + if ((!isComboBox || !is_darkmode_enabled) && IsWindowEnabled(hWnd)) + return (INT_PTR)OnCtlColorCtrl(hdc); + + return (INT_PTR)OnCtlColorDlg(hdc); +} + +static LRESULT CALLBACK WindowCtlColorSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, + UINT_PTR uIdSubclass, DWORD_PTR dwRefData) +{ + (void)dwRefData; + + switch (uMsg) { + case WM_NCDESTROY: + RemoveWindowSubclass(hWnd, WindowCtlColorSubclass, uIdSubclass); + break; + case WM_CTLCOLOREDIT: + return OnCtlColorCtrl((HDC)wParam); + case WM_CTLCOLORLISTBOX: + return OnCtlColorListbox(wParam, lParam); + case WM_CTLCOLORDLG: + return OnCtlColorDlg((HDC)wParam); + case WM_CTLCOLORSTATIC: + return OnCtlColorStatic(wParam, lParam); + case WM_PRINTCLIENT: + return TRUE; + } + return DefSubclassProc(hWnd, uMsg, wParam, lParam); +} + +void SubclassCtlColor(HWND hWnd) +{ + if (!GetWindowSubclass(hWnd, WindowCtlColorSubclass, (UINT_PTR)WindowCtlColorSubclassID, NULL)) + SetWindowSubclass(hWnd, WindowCtlColorSubclass, (UINT_PTR)WindowCtlColorSubclassID, 0); +} + +/* + * Dark mode for child controls + */ +static BOOL CALLBACK DarkModeForChildCallback(HWND hWnd, LPARAM lParam) +{ + (void)lParam; + WCHAR str[32] = { 0 }; + GetClassName(hWnd, str, ARRAYSIZE(str)); + + if (_wcsicmp(str, WC_STATIC) == 0) { + if ((GetWindowLongPtr(hWnd, GWL_STYLE) & SS_NOTIFY) == SS_NOTIFY) + SubclassStaticText(hWnd); + } else if (_wcsicmp(str, WC_BUTTON) == 0) { + switch (GetWindowLongPtr(hWnd, GWL_STYLE) & BS_TYPEMASK) { + case BS_CHECKBOX: + case BS_AUTOCHECKBOX: + case BS_3STATE: + case BS_AUTO3STATE: + case BS_RADIOBUTTON: + case BS_AUTORADIOBUTTON: + if (IsAtLeastWin11()) + SetDarkTheme(hWnd); + SubclassButtonControl(hWnd); + break; + + case BS_GROUPBOX: + SubclassGroupboxControl(hWnd); + break; + + case BS_PUSHBUTTON: + case BS_DEFPUSHBUTTON: + case BS_SPLITBUTTON: + case BS_DEFSPLITBUTTON: + SetDarkTheme(hWnd); + break; + + default: + break; + } + } else if (_wcsicmp(str, WC_COMBOBOX) == 0) { + SetWindowTheme(hWnd, L"DarkMode_CFD", NULL); + } else if (_wcsicmp(str, TOOLBARCLASSNAME) == 0) { + HWND hTips = (HWND)SendMessage(hWnd, TB_GETTOOLTIPS, 0, 0); + if (hTips != NULL) { + SetDarkTheme(hTips); + } + } else if (_wcsicmp(str, WC_EDIT) == 0) { + const LONG_PTR style = GetWindowLongPtr(hWnd, GWL_STYLE); + const LONG_PTR ex_style = GetWindowLongPtr(hWnd, GWL_EXSTYLE); + if (((style & WS_VSCROLL) == WS_VSCROLL) || ((style & WS_HSCROLL) == WS_HSCROLL)) { + SetWindowLongPtr(hWnd, GWL_STYLE, style | WS_BORDER); + SetWindowLongPtr(hWnd, GWL_EXSTYLE, ex_style & ~WS_EX_CLIENTEDGE); + SetDarkTheme(hWnd); + } else { + SetWindowTheme(hWnd, L"DarkMode_CFD", NULL); + } + } else if (_wcsicmp(str, RICHEDIT_CLASS) == 0) { + const LONG_PTR style = GetWindowLongPtr(hWnd, GWL_STYLE); + const LONG_PTR ex_style = GetWindowLongPtr(hWnd, GWL_EXSTYLE); + const BOOL has_static_edge = (ex_style & WS_EX_STATICEDGE) == WS_EX_STATICEDGE; + CHARFORMATW cf = { 0 }; + cf.cbSize = sizeof(CHARFORMATW); + cf.dwMask = CFM_COLOR; + cf.crTextColor = DARKMODE_NORMAL_TEXT_COLOR; + SendMessage(hWnd, EM_SETBKGNDCOLOR, 0, (LPARAM)(has_static_edge ? + DARKMODE_NORMAL_CONTROL_BACKGROUND_COLOR : DARKMODE_NORMAL_DIALOG_BACKGROUND_COLOR)); + SendMessage(hWnd, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf); + SetWindowLongPtr(hWnd, GWL_STYLE, style | WS_BORDER); + SetWindowLongPtr(hWnd, GWL_EXSTYLE, ex_style & ~WS_EX_STATICEDGE); + SetWindowTheme(hWnd, NULL, L"DarkMode_Explorer::ScrollBar"); + } + + return TRUE; +} + +void SetDarkModeForChild(HWND hParent) +{ + if (is_darkmode_enabled) + EnumChildWindows(hParent, DarkModeForChildCallback, (LPARAM)NULL); +} diff --git a/src/darkmode.h b/src/darkmode.h new file mode 100644 index 00000000..479b3666 --- /dev/null +++ b/src/darkmode.h @@ -0,0 +1,148 @@ +/* + * Rufus: The Reliable USB Formatting Utility + * Dark mode UI implementation + * Copyright © 2025 ozone10 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#pragma once + +#include <windows.h> +#include <uxtheme.h> + +extern BOOL is_darkmode_enabled; + +typedef enum _WindowsBuild { + WIN10_22H2 = 19045, + WIN11_21H2 = 22000, +} WindowsBuild; + +typedef enum _SubclassID { + ButtonSubclassID = 42, + GroupboxSubclassID, + WindowNotifySubclassID, + StatusBarSubclassID, + ProgressBarSubclassID, + StaticTextSubclassID, + WindowCtlColorSubclassID +} SubclassID; + +typedef enum _PreferredAppMode { + AppModeDefault, + AppModeAllowDark, + AppModeForceDark, + AppModeForceLight, +} PreferredAppMode; + +typedef enum _WINDOWCOMPOSITIONATTRIB { + WCA_UNDEFINED = 0, + WCA_NCRENDERING_ENABLED = 1, + WCA_NCRENDERING_POLICY = 2, + WCA_TRANSITIONS_FORCEDISABLED = 3, + WCA_ALLOW_NCPAINT = 4, + WCA_CAPTION_BUTTON_BOUNDS = 5, + WCA_NONCLIENT_RTL_LAYOUT = 6, + WCA_FORCE_ICONIC_REPRESENTATION = 7, + WCA_EXTENDED_FRAME_BOUNDS = 8, + WCA_HAS_ICONIC_BITMAP = 9, + WCA_THEME_ATTRIBUTES = 10, + WCA_NCRENDERING_EXILED = 11, + WCA_NCADORNMENTINFO = 12, + WCA_EXCLUDED_FROM_LIVEPREVIEW = 13, + WCA_VIDEO_OVERLAY_ACTIVE = 14, + WCA_FORCE_ACTIVEWINDOW_APPEARANCE = 15, + WCA_DISALLOW_PEEK = 16, + WCA_CLOAK = 17, + WCA_CLOAKED = 18, + WCA_ACCENT_POLICY = 19, + WCA_FREEZE_REPRESENTATION = 20, + WCA_EVER_UNCLOAKED = 21, + WCA_VISUAL_OWNER = 22, + WCA_HOLOGRAPHIC = 23, + WCA_EXCLUDED_FROM_DDA = 24, + WCA_PASSIVEUPDATEMODE = 25, + WCA_USEDARKMODECOLORS = 26, + WCA_LAST = 27 +} WINDOWCOMPOSITIONATTRIB; + +typedef struct _WINDOWCOMPOSITIONATTRIBDATA { + WINDOWCOMPOSITIONATTRIB Attrib; + PVOID pvData; + SIZE_T cbData; +} WINDOWCOMPOSITIONATTRIBDATA; + +typedef struct { + HBRUSH hbrBackground; + HBRUSH hbrBackgroundControl; + HBRUSH hbrBackgroundHot; + HBRUSH hbrEdge; + HPEN hpnEdge; + HPEN hpnEdgeHot; +} ThemeResources; + +typedef struct { + HTHEME hTheme; + int iStateID; +} ButtonData; + +typedef struct { + HFONT hFont; +} StatusBarData; + +typedef struct { + HTHEME hTheme; + int iStateID; +} ProgressBarData; + +typedef struct { + BOOL disabled; +} StaticTextData; + +typedef struct { + int horizontal; + int vertical; + int between; +} Borders; + +BOOL GetDarkModeFromRegistry(void); +void InitDarkMode(HWND hWnd); +void SetDarkTitleBar(HWND hWnd); +void SetDarkTheme(HWND hWnd); +BOOL InitAccentColor(void); +BOOL ChangeIconColor(HICON* hIcon, COLORREF newColor); +void DestroyDarkModeGDIObjects(void); +void SubclassCtlColor(HWND hWnd); +void SubclassNotifyCustomDraw(HWND hWnd); +void SubclassStatusBar(HWND hWnd); +void SubclassProgressBarControl(HWND hWnd); +void SetDarkModeForChild(HWND hParent); + +static __inline void SetDarkModeForDlg(HWND hWnd) +{ + if (is_darkmode_enabled) { + SetDarkTitleBar(hWnd); + SubclassCtlColor(hWnd); + } +} + +static __inline void InitAndSetDarkModeForMainDlg(HWND hWnd) +{ + if (GetDarkModeFromRegistry()) { + InitDarkMode(hWnd); + InitAccentColor(); + SetDarkModeForDlg(hWnd); + SubclassNotifyCustomDraw(hWnd); + } +} diff --git a/src/hash.c b/src/hash.c index 4e611a11..1ae3470d 100644 --- a/src/hash.c +++ b/src/hash.c @@ -74,6 +74,7 @@ #include "rufus.h" #include "winio.h" #include "missing.h" +#include "darkmode.h" #include "resource.h" #include "msapi_utf8.h" #include "localization.h" @@ -1894,6 +1895,7 @@ INT_PTR CALLBACK HashCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa switch (message) { case WM_INITDIALOG: + SetDarkModeForDlg(hDlg); apply_localization(IDD_HASH, hDlg); if (hFont == NULL) { hDC = GetDC(hDlg); @@ -1941,6 +1943,7 @@ INT_PTR CALLBACK HashCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa for (i = (int)strlen(image_path); (i > 0) && (image_path[i] != '\\'); i--); SetWindowTextU(hDlg, &image_path[i + 1]); } + SetDarkModeForChild(hDlg); // Set focus on the OK button SendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, IDOK), TRUE); CenterDialog(hDlg, NULL); diff --git a/src/rufus.c b/src/rufus.c index 5f557573..01849b3a 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -52,6 +52,7 @@ #include "wue.h" #include "drive.h" #include "settings.h" +#include "darkmode.h" #include "bled/bled.h" #include "cdio/logging.h" #include "../res/grub/grub_version.h" @@ -957,6 +958,7 @@ BOOL CALLBACK LogCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) EXT_DECL(log_ext, "rufus.log", __VA_GROUP__("*.log"), __VA_GROUP__("Rufus log")); switch (message) { case WM_INITDIALOG: + SetDarkModeForDlg(hDlg); apply_localization(IDD_LOG, hDlg); hLog = GetDlgItem(hDlg, IDC_LOG_EDIT); @@ -984,6 +986,7 @@ BOOL CALLBACK LogCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) style = GetWindowLongPtr(hLog, GWL_STYLE); style &= ~(ES_RIGHT); SetWindowLongPtr(hLog, GWL_STYLE, style); + SetDarkModeForChild(hDlg); break; case WM_NCDESTROY: safe_delete_object(hf); @@ -2323,7 +2326,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA DestroyAllTooltips(); DestroyWindow(hLogDialog); GetWindowRect(hDlg, &relaunch_rc); - EndDialog(hDlg, 0); + DestroyWindow(hDlg); break; case IDC_ABOUT: CreateAboutBox(); @@ -2760,6 +2763,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA break; case WM_INITDIALOG: + InitAndSetDarkModeForMainDlg(hDlg); // Make sure fScale is set before the first call to apply localization, so that move/resize scale appropriately hDC = GetDC(hDlg); fScale = GetDeviceCaps(hDC, LOGPIXELSX) / 96.0f; @@ -2806,6 +2810,9 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA MessageBoxA(NULL, "This is a Test version of " APPLICATION_NAME " - It is meant to be used for " "testing ONLY and should NOT be distributed as a release.", "TEST VERSION", MSG_INFO); #endif + SetDarkModeForChild(hDlg); + SubclassStatusBar(hStatus); + SetHyperLinkFont(GetDlgItem(hDlg, IDS_CSM_HELP_TXT), (HDC)wParam, &hHyperlinkFont, FALSE); // Let's not take any risk: Ask Windows to redraw the whole dialog before we exit init RedrawWindow(hMainDialog, NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW); InvalidateRect(hMainDialog, NULL, TRUE); @@ -2824,12 +2831,12 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA SetBkMode(pDI->hDC, TRANSPARENT); switch (pDI->itemID) { case SB_SECTION_LEFT: - SetTextColor(pDI->hDC, GetSysColor(COLOR_BTNTEXT)); + SetTextColor(pDI->hDC, is_darkmode_enabled ? DARKMODE_NORMAL_TEXT_COLOR : GetSysColor(COLOR_BTNTEXT)); DrawTextExU(pDI->hDC, szStatusMessage, -1, &pDI->rcItem, DT_LEFT | DT_END_ELLIPSIS | DT_PATH_ELLIPSIS, NULL); return (INT_PTR)TRUE; case SB_SECTION_RIGHT: - SetTextColor(pDI->hDC, GetSysColor(COLOR_3DSHADOW)); + SetTextColor(pDI->hDC, is_darkmode_enabled ? DARKMODE_DISABLED_TEXT_COLOR : GetSysColor(COLOR_3DSHADOW)); DrawTextExA(pDI->hDC, szTimer, -1, &pDI->rcItem, DT_LEFT, NULL); return (INT_PTR)TRUE; } @@ -2846,7 +2853,6 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA if ((HWND)lParam != GetDlgItem(hDlg, IDS_CSM_HELP_TXT)) return FALSE; SetBkMode((HDC)wParam, TRANSPARENT); - CreateStaticFont((HDC)wParam, &hHyperlinkFont, FALSE); SelectObject((HDC)wParam, hHyperlinkFont); SetTextColor((HDC)wParam, TOOLBAR_ICON_COLOR); return (INT_PTR)GetSysColorBrush(COLOR_BTNFACE); @@ -4189,6 +4195,7 @@ out: uprintf("Could not delete '%s': %s", loc_file, WindowsErrorString()); } DestroyAllTooltips(); + DestroyDarkModeGDIObjects(); ClrAlertPromptHook(); exit_localization(); safe_free(image_path); diff --git a/src/rufus.h b/src/rufus.h index 1a703f7f..49cbb165 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -786,6 +786,7 @@ extern void ResizeMoveCtrl(HWND hDlg, HWND hCtrl, int dx, int dy, int dw, int dh extern void ResizeButtonHeight(HWND hDlg, int id); extern void CreateStatusBar(HFONT* hFont); extern void CreateStaticFont(HDC hDC, HFONT* hFont, BOOL underlined); +extern void SetHyperLinkFont(HWND hWnd, HDC hDC, HFONT* hFont, BOOL underlined); extern void SetTitleBarIcon(HWND hDlg); extern BOOL CreateTaskbarList(void); extern BOOL SetTaskbarProgressState(TASKBAR_PROGRESS_FLAGS tbpFlags); @@ -955,9 +956,14 @@ out: #define PF_TYPE_DECL(api, ret, proc, args) PF_TYPE(api, ret, proc, args); PF_DECL(proc) #define PF_INIT(proc, name) if (pf##proc == NULL) pf##proc = \ (proc##_t) GetProcAddress(GetLibraryHandle(#name), #proc) +#define PF_INIT_ID(proc, name, id) if (pf##proc == NULL) pf##proc = \ + (proc##_t) GetProcAddress(GetLibraryHandle(#name), MAKEINTRESOURCEA(id)) #define PF_INIT_OR_OUT(proc, name) do {PF_INIT(proc, name); \ if (pf##proc == NULL) {uprintf("Unable to locate %s() in '%s.dll': %s", \ #proc, #name, WindowsErrorString()); goto out;} } while(0) +#define PF_INIT_ID_OR_OUT(proc, name, id) do {PF_INIT_ID(proc, name, id); \ + if (pf##proc == NULL) {uprintf("Unable to locate %s() in %s.dll: %s\n", \ + #proc, #name, WindowsErrorString()); goto out;} } while(0) #define PF_INIT_OR_SET_STATUS(proc, name) do {PF_INIT(proc, name); \ if ((pf##proc == NULL) && (NT_SUCCESS(status))) status = STATUS_PROCEDURE_NOT_FOUND; } while(0) #if defined(_MSC_VER) diff --git a/src/rufus.rc b/src/rufus.rc index d5a1b031..85742494 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.10.2257" +CAPTION "Rufus 4.10.2258" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -211,7 +211,7 @@ CAPTION "Update policy and settings" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN ICON IDI_ICON,IDC_ABOUT_ICON,11,8,20,20 - CONTROL "",IDC_POLICY,"RichEdit20W",WS_VSCROLL | WS_TABSTOP | 0x804,46,8,235,132,WS_EX_STATICEDGE + CONTROL "",IDC_POLICY,"RichEdit20W",WS_VSCROLL | WS_TABSTOP | 0x804,45,8,236,132,WS_EX_STATICEDGE GROUPBOX "Settings",IDS_UPDATE_SETTINGS_GRP,45,145,165,46 LTEXT "Check for updates",IDS_UPDATE_FREQUENCY_TXT,51,158,80,10 COMBOBOX IDC_UPDATE_FREQUENCY,133,158,66,12,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2257,0 - PRODUCTVERSION 4,10,2257,0 + FILEVERSION 4,10,2258,0 + PRODUCTVERSION 4,10,2258,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2257" + VALUE "FileVersion", "4.10.2258" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2257" + VALUE "ProductVersion", "4.10.2258" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index ad2605a5..1928c1d8 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -43,6 +43,7 @@ #include "registry.h" #include "settings.h" #include "license.h" +#include "darkmode.h" /* Globals */ extern BOOL is_x86_64, appstore_version; @@ -329,6 +330,7 @@ INT_PTR CALLBACK LicenseCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM HWND hLicense; switch (message) { case WM_INITDIALOG: + SetDarkModeForDlg(hDlg); hLicense = GetDlgItem(hDlg, IDC_LICENSE_TEXT); apply_localization(IDD_LICENSE, hDlg); CenterDialog(hDlg, NULL); @@ -341,6 +343,7 @@ INT_PTR CALLBACK LicenseCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM style &= ~(ES_RIGHT); SetWindowLongPtr(hLicense, GWL_STYLE, style); SetDlgItemTextA(hDlg, IDC_LICENSE_TEXT, gplv3); + SetDarkModeForChild(hDlg); break; case WM_COMMAND: switch (LOWORD(wParam)) { @@ -373,6 +376,7 @@ INT_PTR CALLBACK AboutCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP switch (message) { case WM_INITDIALOG: + SetDarkModeForDlg(hDlg); resized_already = FALSE; // Execute dialog localization apply_localization(IDD_ABOUTBOX, hDlg); @@ -407,6 +411,7 @@ INT_PTR CALLBACK AboutCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP // Need to send an explicit SetSel to avoid being positioned at the end of richedit control when tabstop is used SendMessage(hEdit[1], EM_SETSEL, 0, 0); SendMessage(hEdit[0], EM_REQUESTRESIZE, 0, 0); + SetDarkModeForChild(hDlg); break; case WM_NOTIFY: switch (((LPNMHDR)lParam)->code) { @@ -479,6 +484,7 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP switch (message) { case WM_INITDIALOG: + SetDarkModeForDlg(hDlg); // Get the system message box font. See http://stackoverflow.com/a/6057761 ncm.cbSize = sizeof(ncm); // If we're compiling with the Vista SDK or later, the NONCLIENTMETRICS struct @@ -561,6 +567,7 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDYES), 0, dh -cbh, 0, 0, 1.0f); ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDNO), 0, dh -cbh, 0, 0, 1.0f); } + SetDarkModeForChild(hDlg); return (INT_PTR)TRUE; case WM_CTLCOLORSTATIC: // Change the background colour for static text and icon @@ -690,6 +697,7 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM switch (message) { case WM_INITDIALOG: + SetDarkModeForDlg(hDlg); // Don't overflow our max radio button if (nDialogItems > (IDC_SELECTION_CHOICEMAX - IDC_SELECTION_CHOICE1 + 1)) { uprintf("Warning: Too many options requested for Selection (%d vs %d)", @@ -796,6 +804,7 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM // Set the default selection for (i = 0, m = 1; i < nDialogItems; i++, m <<= 1) Button_SetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), (m & selection_dialog_mask) ? BST_CHECKED : BST_UNCHECKED); + SetDarkModeForChild(hDlg); return (INT_PTR)TRUE; case WM_CTLCOLORSTATIC: // Change the background colour for static text and icon @@ -883,6 +892,7 @@ INT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa switch (message) { case WM_INITDIALOG: + SetDarkModeForDlg(hDlg); // Don't overflow our max radio button if (nDialogItems > (IDC_LIST_ITEMMAX - IDC_LIST_ITEM1 + 1)) { uprintf("Warning: Too many items requested for List (%d vs %d)", @@ -942,6 +952,7 @@ INT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa ResizeButtonHeight(hDlg, IDOK); ResizeButtonHeight(hDlg, IDCANCEL); return (INT_PTR)TRUE; + SetDarkModeForChild(hDlg); case WM_CTLCOLORSTATIC: // Change the background colour for static text and icon SetBkMode((HDC)wParam, TRANSPARENT); @@ -1063,6 +1074,7 @@ BOOL CreateTooltip(HWND hControl, const char* message, int duration) if (ttlist[i].hTip == NULL) { return FALSE; } + SetDarkTheme(ttlist[i].hTip); ttlist[i].hCtrl = hControl; // Subclass the tooltip to handle multiline @@ -1291,6 +1303,7 @@ INT_PTR CALLBACK UpdateCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM l switch (message) { case WM_INITDIALOG: + SetDarkModeForDlg(hDlg); resized_already = FALSE; hUpdatesDlg = hDlg; apply_localization(IDD_UPDATE_POLICY, hDlg); @@ -1338,6 +1351,7 @@ INT_PTR CALLBACK UpdateCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM l SendMessage(hPolicy, EM_SETEVENTMASK, 0, ENM_LINK|ENM_REQUESTRESIZE); SendMessageA(hPolicy, EM_SETBKGNDCOLOR, 0, (LPARAM)GetSysColor(COLOR_BTNFACE)); SendMessage(hPolicy, EM_REQUESTRESIZE, 0, 0); + SetDarkModeForChild(hDlg); break; case WM_NOTIFY: if ((((LPNMHDR)lParam)->code == EN_REQUESTRESIZE) && (!resized_already)) { @@ -1561,6 +1575,37 @@ void CreateStaticFont(HDC hDC, HFONT* hFont, BOOL underlined) *hFont = CreateFontIndirect(&lf); } +void SetHyperLinkFont(HWND hWnd, HDC hDC, HFONT* hFont, BOOL underlined) +{ + static BOOL use_static_font = FALSE; + LOGFONT lf = { 0 }; + HFONT hFontTmp = NULL; + + if (*hFont == NULL) { + hFontTmp = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0); + if (hFontTmp != NULL) { + GetObject(hFontTmp, sizeof(LOGFONT), &lf); + use_static_font = FALSE; + } else { + NONCLIENTMETRICS ncm = { 0 }; + ncm.cbSize = sizeof(NONCLIENTMETRICS); + if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0)) { + lf = ncm.lfStatusFont; + use_static_font = FALSE; + } else { + CreateStaticFont(hDC, hFont, underlined); + use_static_font = TRUE; + } + } + if (!use_static_font) { + lf.lfUnderline = underlined; + *hFont = CreateFontIndirect(&lf); + } + } + if (!use_static_font) + SendMessage(hWnd, WM_SETFONT, (WPARAM)*hFont, TRUE); +} + /* * Work around the limitations of edit control, to display a hand cursor for hyperlinks * NB: The LTEXT control must have SS_NOTIFY attribute for this to work @@ -1587,7 +1632,7 @@ INT_PTR CALLBACK NewVersionCallback(HWND hDlg, UINT message, WPARAM wParam, LPAR char cmdline[] = APPLICATION_NAME " -w 150"; static char* filepath = NULL; static int download_status = 0; - static HFONT hyperlink_font = NULL; + static HFONT hHyperlinkFont = NULL; static HANDLE hThread = NULL; HWND hNotes; LONG err; @@ -1598,6 +1643,7 @@ INT_PTR CALLBACK NewVersionCallback(HWND hDlg, UINT message, WPARAM wParam, LPAR switch (message) { case WM_INITDIALOG: + SetDarkModeForDlg(hDlg); apply_localization(IDD_NEW_VERSION, hDlg); download_status = 0; SetTitleBarIcon(hDlg); @@ -1618,18 +1664,20 @@ INT_PTR CALLBACK NewVersionCallback(HWND hDlg, UINT message, WPARAM wParam, LPAR if (update.download_url == NULL) EnableWindow(GetDlgItem(hDlg, IDC_DOWNLOAD), FALSE); ResizeButtonHeight(hDlg, IDCANCEL); + SetDarkModeForChild(hDlg); + SubclassProgressBarControl(GetDlgItem(hDlg, IDC_PROGRESS)); + SetHyperLinkFont(GetDlgItem(hDlg, IDC_WEBSITE), (HDC)wParam, &hHyperlinkFont, TRUE); break; case WM_CTLCOLORSTATIC: if ((HWND)lParam != GetDlgItem(hDlg, IDC_WEBSITE)) return FALSE; // Change the font for the hyperlink SetBkMode((HDC)wParam, TRANSPARENT); - CreateStaticFont((HDC)wParam, &hyperlink_font, TRUE); - SelectObject((HDC)wParam, hyperlink_font); - SetTextColor((HDC)wParam, RGB(0,0,125)); // DARK_BLUE + SelectObject((HDC)wParam, hHyperlinkFont); + SetTextColor((HDC)wParam, GetSysColor(COLOR_HOTLIGHT)); return (INT_PTR)GetSysColorBrush(COLOR_BTNFACE); case WM_NCDESTROY: - safe_delete_object(hyperlink_font); + safe_delete_object(hHyperlinkFont); break; case WM_COMMAND: switch (LOWORD(wParam)) { diff --git a/src/ui.c b/src/ui.c index 27eac88d..f403695f 100644 --- a/src/ui.c +++ b/src/ui.c @@ -36,6 +36,7 @@ #include "drive.h" #include "missing.h" #include "resource.h" +#include "darkmode.h" #include "msapi_utf8.h" #include "localization.h" @@ -857,6 +858,7 @@ void CreateSmallButtons(HWND hDlg) hSaveImageList = ImageList_Create(i16, i16, ILC_COLOR32 | ILC_HIGHQUALITYSCALE | ILC_MIRROR, 1, 0); buffer = GetResource(hMainInstance, MAKEINTRESOURCEA(IDI_SAVE_16 + icon_offset), _RT_RCDATA, "save icon", &bufsize, FALSE); hIconSave = CreateIconFromResourceEx(buffer, bufsize, TRUE, 0x30000, 0, 0, 0); + ChangeIconColor(&hIconSave, 0); ImageList_AddIcon(hSaveImageList, hIconSave); DestroyIcon(hIconSave); SendMessage(hSaveToolbar, TB_SETIMAGELIST, (WPARAM)0, (LPARAM)hSaveImageList); @@ -874,6 +876,7 @@ void CreateSmallButtons(HWND hDlg) hHashImageList = ImageList_Create(i16, i16, ILC_COLOR32 | ILC_HIGHQUALITYSCALE | ILC_MIRROR, 1, 0); buffer = GetResource(hMainInstance, MAKEINTRESOURCEA(IDI_HASH_16 + icon_offset), _RT_RCDATA, "hash icon", &bufsize, FALSE); hIconHash = CreateIconFromResourceEx(buffer, bufsize, TRUE, 0x30000, 0, 0, 0); + ChangeIconColor(&hIconHash, 0); ImageList_AddIcon(hHashImageList, hIconHash); DestroyIcon(hIconHash); SendMessage(hHashToolbar, TB_SETIMAGELIST, (WPARAM)0, (LPARAM)hHashImageList); @@ -898,6 +901,7 @@ static INT_PTR CALLBACK ProgressCallback(HWND hCtrl, UINT message, WPARAM wParam SIZE size; LONG full_right; wchar_t winfo[128]; + COLORREF background_color, text_color, inverted_text_color, border_color; static BOOL marquee_mode = FALSE; static uint32_t pos = 0, min = 0, max = 0xFFFF; static COLORREF color = PROGRESS_BAR_NORMAL_COLOR; @@ -960,6 +964,10 @@ static INT_PTR CALLBACK ProgressCallback(HWND hCtrl, UINT message, WPARAM wParam case WM_PAINT: hDC = BeginPaint(hCtrl, &ps); + background_color = is_darkmode_enabled ? DARKMODE_NORMAL_CONTROL_BACKGROUND_COLOR : PROGRESS_BAR_BACKGROUND_COLOR; + text_color = is_darkmode_enabled ? PROGRESS_BAR_INVERTED_TEXT_COLOR : PROGRESS_BAR_NORMAL_TEXT_COLOR; + inverted_text_color = is_darkmode_enabled ? PROGRESS_BAR_NORMAL_TEXT_COLOR : PROGRESS_BAR_INVERTED_TEXT_COLOR; + border_color = is_darkmode_enabled ? DARKMODE_NORMAL_CONTROL_EDGE_COLOR : PROGRESS_BAR_BOX_COLOR; GetClientRect(hCtrl, &rc); rc2 = rc; InflateRect(&rc, -1, -1); @@ -978,7 +986,7 @@ static INT_PTR CALLBACK ProgressCallback(HWND hCtrl, UINT message, WPARAM wParam // Optional first segment if (pos + ((max - min) / 5) > max) { rc.right = MulDiv(pos + ((max - min) / 5) - max, rc.right, max - min); - SetTextColor(hDC, PROGRESS_BAR_INVERTED_TEXT_COLOR); + SetTextColor(hDC, inverted_text_color); SetBkColor(hDC, color); ExtTextOut(hDC, (full_right - size.cx) / 2, (rc.bottom - size.cy) / 2, ETO_CLIPPED | ETO_OPAQUE | ETO_NUMERICSLOCAL, &rc, winfo, (int)wcslen(winfo), NULL); @@ -988,8 +996,8 @@ static INT_PTR CALLBACK ProgressCallback(HWND hCtrl, UINT message, WPARAM wParam // Optional second segment if (pos > min) { rc.right = MulDiv(pos - min, rc.right, max - min); - SetTextColor(hDC, PROGRESS_BAR_NORMAL_TEXT_COLOR); - SetBkColor(hDC, PROGRESS_BAR_BACKGROUND_COLOR); + SetTextColor(hDC, text_color); + SetBkColor(hDC, background_color); ExtTextOut(hDC, (full_right - size.cx) / 2, (rc.bottom - size.cy) / 2, ETO_CLIPPED | ETO_OPAQUE | ETO_NUMERICSLOCAL, &rc, winfo, (int)wcslen(winfo), NULL); rc.left = rc.right; @@ -997,14 +1005,14 @@ static INT_PTR CALLBACK ProgressCallback(HWND hCtrl, UINT message, WPARAM wParam } // Second to last segment rc.right = MulDiv(pos - min + ((max - min) / 5), rc.right, max - min); - SetTextColor(hDC, PROGRESS_BAR_INVERTED_TEXT_COLOR); + SetTextColor(hDC, inverted_text_color); SetBkColor(hDC, color); ExtTextOut(hDC, (full_right - size.cx) / 2, (rc.bottom - size.cy) / 2, ETO_CLIPPED | ETO_OPAQUE | ETO_NUMERICSLOCAL, &rc, winfo, (int)wcslen(winfo), NULL); } else { // First segment rc.right = (pos > min) ? MulDiv(pos - min, rc.right, max - min) : rc.left; - SetTextColor(hDC, PROGRESS_BAR_INVERTED_TEXT_COLOR); + SetTextColor(hDC, inverted_text_color); SetBkColor(hDC, color); ExtTextOut(hDC, (full_right - size.cx) / 2, (rc.bottom - size.cy) / 2, ETO_CLIPPED | ETO_OPAQUE | ETO_NUMERICSLOCAL, &rc, winfo, (int)wcslen(winfo), NULL); @@ -1012,12 +1020,12 @@ static INT_PTR CALLBACK ProgressCallback(HWND hCtrl, UINT message, WPARAM wParam // Last segment rc.left = rc.right; rc.right = full_right; - SetTextColor(hDC, PROGRESS_BAR_NORMAL_TEXT_COLOR); - SetBkColor(hDC, PROGRESS_BAR_BACKGROUND_COLOR); + SetTextColor(hDC, text_color); + SetBkColor(hDC, background_color); ExtTextOut(hDC, (full_right - size.cx) / 2, (rc.bottom - size.cy) / 2, ETO_CLIPPED | ETO_OPAQUE | ETO_NUMERICSLOCAL, &rc, winfo, (int)wcslen(winfo), NULL); // Bounding rectangle - SetDCPenColor(hDC, PROGRESS_BAR_BOX_COLOR); + SetDCPenColor(hDC, border_color); Rectangle(hDC, rc2.left, rc2.top, rc2.right, rc2.bottom); if (hOldFont != NULL) SelectObject(hDC, hOldFont); @@ -1061,8 +1069,8 @@ void CreateAdditionalControls(HWND hDlg) // Fetch the up and down expand icons for the advanced options toolbar hDll = GetLibraryHandle("ComDlg32"); - hIconDown = (HICON)LoadImage(hDll, MAKEINTRESOURCE(577), IMAGE_ICON, s16, s16, LR_DEFAULTCOLOR | LR_SHARED); - hIconUp = (HICON)LoadImage(hDll, MAKEINTRESOURCE(578), IMAGE_ICON, s16, s16, LR_DEFAULTCOLOR | LR_SHARED); + hIconDown = (HICON)LoadImage(hDll, MAKEINTRESOURCE(is_darkmode_enabled ? 579 : 577), IMAGE_ICON, s16, s16, LR_DEFAULTCOLOR | LR_SHARED); + hIconUp = (HICON)LoadImage(hDll, MAKEINTRESOURCE(is_darkmode_enabled ? 580 : 578), IMAGE_ICON, s16, s16, LR_DEFAULTCOLOR | LR_SHARED); // Fallback to using Shell32 if we can't locate the icons we want in ComDlg32 (Windows 8) hDll = GetLibraryHandle("Shell32"); if (hIconUp == NULL) @@ -1122,6 +1130,7 @@ void CreateAdditionalControls(HWND hDlg) buffer = GetResource(hMainInstance, MAKEINTRESOURCEA(multitoolbar_icons[i] + icon_offset), _RT_RCDATA, "toolbar icon", &bufsize, FALSE); hIcon = CreateIconFromResourceEx(buffer, bufsize, TRUE, 0x30000, 0, 0, 0); + ChangeIconColor(&hIcon, 0); // Mirror the "world" icon on RTL since we can't use an ImageList mirroring flag for that... if (right_to_left_mode && (i == 0)) hIcon = CreateMirroredIcon(hIcon); @@ -1596,7 +1605,7 @@ void SetBootTypeDropdownWidth(void) void OnPaint(HDC hdc) { int i; - COLORREF cp = GetSysColor(COLOR_WINDOWTEXT); + COLORREF cp = is_darkmode_enabled ? DARKMODE_NORMAL_CONTROL_EDGE_COLOR : GetSysColor(COLOR_WINDOWTEXT); HPEN hp = CreatePen(0, (fScale < 1.5f) ? 2 : 3, cp); HPEN hop = (HPEN)SelectObject(hdc, hp); for (i = 0; i < ARRAYSIZE(section_vpos); i++) { diff --git a/src/ui.h b/src/ui.h index 446bbbe3..c9aa9f78 100644 --- a/src/ui.h +++ b/src/ui.h @@ -25,16 +25,26 @@ #pragma once // Progress bar colors -#define PROGRESS_BAR_NORMAL_TEXT_COLOR RGB(0x00, 0x00, 0x00) -#define PROGRESS_BAR_INVERTED_TEXT_COLOR RGB(0xFF, 0xFF, 0xFF) -#define PROGRESS_BAR_BACKGROUND_COLOR RGB(0xE6, 0xE6, 0xE6) -#define PROGRESS_BAR_BOX_COLOR RGB(0xBC, 0xBC, 0xBC) -#define PROGRESS_BAR_NORMAL_COLOR RGB(0x06, 0xB0, 0x25) -#define PROGRESS_BAR_PAUSED_COLOR RGB(0xDA, 0xCB, 0x26) -#define PROGRESS_BAR_ERROR_COLOR RGB(0xDA, 0x26, 0x26) +#define PROGRESS_BAR_NORMAL_TEXT_COLOR RGB(0x00, 0x00, 0x00) +#define PROGRESS_BAR_INVERTED_TEXT_COLOR RGB(0xFF, 0xFF, 0xFF) +#define PROGRESS_BAR_BACKGROUND_COLOR RGB(0xE6, 0xE6, 0xE6) +#define PROGRESS_BAR_BOX_COLOR RGB(0xBC, 0xBC, 0xBC) +#define PROGRESS_BAR_NORMAL_COLOR RGB(0x06, 0xB0, 0x25) +#define PROGRESS_BAR_PAUSED_COLOR RGB(0xDA, 0xCB, 0x26) +#define PROGRESS_BAR_ERROR_COLOR RGB(0xDA, 0x26, 0x26) // Toolbar icons main color -#define TOOLBAR_ICON_COLOR RGB(0x29, 0x80, 0xB9) +#define TOOLBAR_ICON_COLOR RGB(0x29, 0x80, 0xB9) + +// Dark Mode Colors +#define DARKMODE_TOOLBAR_ICON_COLOR RGB(0xFF, 0xD7, 0x00) +#define DARKMODE_NORMAL_TEXT_COLOR RGB(0xE0, 0xE0, 0xE0) +#define DARKMODE_DISABLED_TEXT_COLOR RGB(0xE0, 0xE0, 0xE0) +#define DARKMODE_NORMAL_DIALOG_BACKGROUND_COLOR RGB(0x20, 0x20, 0x20) +#define DARKMODE_NORMAL_CONTROL_BACKGROUND_COLOR RGB(0x38, 0x38, 0x38) +#define DARKMODE_HOT_CONTROL_BACKGROUND_COLOR RGB(0x45, 0x45, 0x45) +#define DARKMODE_NORMAL_CONTROL_EDGE_COLOR RGB(0x64, 0x64, 0x64) +#define DARKMODE_HOT_CONTROL_EDGE_COLOR RGB(0x9B, 0x9B, 0x9B) // Toolbar default style #define TOOLBAR_STYLE ( WS_CHILD | WS_TABSTOP | WS_VISIBLE | \ From 94a2c7c2fbcc66da6d2e4c490e34a0c20279b365 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 18 Jun 2025 14:08:17 +0100 Subject: [PATCH 068/192] [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. --- src/darkmode.c | 8 +++++++- src/libcdio/iso9660/iso9660.c | 7 +++---- src/libcdio/iso9660/iso9660_fs.c | 8 ++------ src/license.h | 3 +++ src/parser.c | 2 +- src/rufus.c | 2 ++ src/rufus.rc | 10 +++++----- src/stdlg.c | 2 +- 8 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/darkmode.c b/src/darkmode.c index d0f9d803..40fd786c 100644 --- a/src/darkmode.c +++ b/src/darkmode.c @@ -386,10 +386,12 @@ static void RenderButton(HWND hWnd, HDC hdc, HTHEME hTheme, int iPartID, int iSt dtto.dwFlags = DTT_TEXTCOLOR; dtto.crText = !IsWindowEnabled(hWnd) ? DARKMODE_DISABLED_TEXT_COLOR : DARKMODE_NORMAL_TEXT_COLOR; + // coverity[negative_returns] DrawThemeTextEx(hTheme, hdc, iPartID, iStateID, buffer, -1, flags, &rcText, &dtto); if (((SendMessage(hWnd, BM_GETSTATE, 0, 0) & BST_FOCUS) == BST_FOCUS) && ((ui_state & UISF_HIDEFOCUS) != UISF_HIDEFOCUS)) { dtto.dwFlags |= DTT_CALCRECT; + // coverity[negative_returns] DrawThemeTextEx(hTheme, hdc, iPartID, iStateID, buffer, -1, flags | DT_CALCRECT, &rcText, &dtto); rcFocus = rcText; rcFocus.bottom++; @@ -582,6 +584,7 @@ static void PaintGroupbox(HWND hWnd, HDC hdc, ButtonData buttonData) dtto.crText = IsWindowEnabled(hWnd) ? DARKMODE_NORMAL_TEXT_COLOR : DARKMODE_DISABLED_TEXT_COLOR; if (SendMessage(hWnd, WM_QUERYUISTATE, 0, 0) != (LRESULT)NULL) flags |= DT_HIDEPREFIX; + // coverity[negative_returns] DrawThemeTextEx(buttonData.hTheme, hdc, BP_GROUPBOX, iStateID, buffer, -1, flags | DT_SINGLELINE, &rcText, &dtto); } @@ -893,7 +896,10 @@ static void GetProgressBarRects(HWND hWnd, RECT* rcEmpty, RECT* rcFilled) rcFilled->left = rcEmpty->left; rcFilled->top = rcEmpty->top; rcFilled->bottom = rcEmpty->bottom; - rcFilled->right = rcEmpty->left + (int)((double)(cur_pos) / (range.iHigh - min) * totalWidth); + if (range.iHigh - min != 0) + rcFilled->right = rcEmpty->left + (int)((double)(cur_pos) / (range.iHigh - min) * totalWidth); + else + rcFilled->right = rcEmpty->right; rcEmpty->left = rcFilled->right; // To avoid painting under filled part } } diff --git a/src/libcdio/iso9660/iso9660.c b/src/libcdio/iso9660/iso9660.c index 629bb740..65927f2b 100644 --- a/src/libcdio/iso9660/iso9660.c +++ b/src/libcdio/iso9660/iso9660.c @@ -256,11 +256,10 @@ iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime, memcpy(num, p_ldate->LT_FIELD, sizeof(p_ldate->LT_FIELD)); \ num[sizeof(p_ldate->LT_FIELD)] = '\0'; \ errno = 0; \ - tmp = strtol(num, \ - (char **)NULL, 10); \ + tmp = strtol(num, (char **)NULL, 10); \ if ( tmp == LONG_MIN || tmp == LONG_MAX || \ - ((unsigned long)tmp + ADD_CONSTANT) == LONG_MAX || \ - (tmp + ADD_CONSTANT) == LONG_MIN ) \ + (uint64_t)tmp + ADD_CONSTANT >= (uint64_t)LONG_MAX || \ + (uint64_t)tmp + ADD_CONSTANT <= (uint64_t)LONG_MIN ) \ return false; \ p_tm->TM_FIELD = tmp + ADD_CONSTANT; \ } diff --git a/src/libcdio/iso9660/iso9660_fs.c b/src/libcdio/iso9660/iso9660_fs.c index c5eff035..58d6c6fc 100644 --- a/src/libcdio/iso9660/iso9660_fs.c +++ b/src/libcdio/iso9660/iso9660_fs.c @@ -1815,14 +1815,10 @@ iso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[]) free (_dirbuf); iso9660_stat_free(p_stat); - - if (offset != dirbuf_len) { + if (offset != dirbuf_len) _cdio_list_free (retval, true, (CdioDataFree_t) iso9660_stat_free); - return NULL; - } - iso9660_stat_free(p_iso9660_stat); - return retval; + return (offset == dirbuf_len) ? retval : NULL; } typedef CdioISO9660FileList_t * (iso9660_readdir_t) diff --git a/src/license.h b/src/license.h index 0ec2ebf1..b0407daa 100644 --- a/src/license.h +++ b/src/license.h @@ -155,6 +155,9 @@ const char* additional_copyrights = "https://tortoisesvn.net/, https://tortoisegit.org/\\line\n" "GNU General Public License (GPL) v2 or later\\line\n" "\\line\n" +"Dark Mode support by ozone10\\line\n" +"https://github.com/ozone10\\line\n" +"\\line\n" "Regular Expression handling from tiny-regex-c by kokke:\\line\n" "https://github.com/kokke/tiny-regex-c\\line\n" "Public Domain\\line\n" diff --git a/src/parser.c b/src/parser.c index 274a9705..afb6985d 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1657,7 +1657,7 @@ thumbprint_list_t* GetThumbprintEntries(char* thumbprints_txt) if (thumbprints_txt[i] == '\n') num_entries++; - thumbprints = malloc(sizeof(thumbprint_list_t) + num_entries * SHA1_HASHSIZE); + thumbprints = calloc(sizeof(thumbprint_list_t) + num_entries * SHA1_HASHSIZE, 1); if (thumbprints == NULL) return NULL; thumbprints->count = 0; diff --git a/src/rufus.c b/src/rufus.c index 01849b3a..bf458b3f 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -2514,6 +2514,8 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA case IDC_FILE_SYSTEM: if ((HIWORD(wParam) != CBN_SELCHANGE) && (HIWORD(wParam) != CBN_SELCHANGE_INTERNAL)) break; + if (!IsWindowEnabled(hFileSystem)) + break; set_selected_fs = (HIWORD(wParam) == CBN_SELCHANGE); fs_type = (int)ComboBox_GetCurItemData(hFileSystem); SetClusterSizes(fs_type); diff --git a/src/rufus.rc b/src/rufus.rc index 85742494..74f4915f 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.10.2258" +CAPTION "Rufus 4.10.2259" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2258,0 - PRODUCTVERSION 4,10,2258,0 + FILEVERSION 4,10,2259,0 + PRODUCTVERSION 4,10,2259,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2258" + VALUE "FileVersion", "4.10.2259" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2258" + VALUE "ProductVersion", "4.10.2259" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index 1928c1d8..14d65114 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -951,8 +951,8 @@ INT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDCANCEL), 0, dh, 0, 0, 1.0f); ResizeButtonHeight(hDlg, IDOK); ResizeButtonHeight(hDlg, IDCANCEL); - return (INT_PTR)TRUE; SetDarkModeForChild(hDlg); + return (INT_PTR)TRUE; case WM_CTLCOLORSTATIC: // Change the background colour for static text and icon SetBkMode((HDC)wParam, TRANSPARENT); From 446e71f56db0ed0a9ed98d6b042a6f7d6ed21713 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 25 Jun 2025 10:54:10 +0100 Subject: [PATCH 069/192] [dbx] fix UTC epoch being interpreted as local time for DBX timestamp comparison * Per MS documentation, _mktime64() *ALTERS* the time being passed to first add/substract the timezone offset before converting to an epoch. * This resulted in our evaluated epoch from the DBX GitHub commit being a few hours more recent than the epoch we store for our embedded files (which is UTC) for timezones that are behind of UTC, since their epoch have an offset added to convert localtime to UTC. * Fix this by using _mkgmtime64() that does not suffer an unwanted time manipulation. * For safety, also use -u for epoch format conversion in our script just in case. * Closes #2762. * Also comment the "unsupported check; not verifying file integrity" warning for XZ decompression, improve XZ ARM64 support and add an exception for some Samsung UFDs. --- res/dbx/dbx_update.sh | 2 +- src/bled/decompress_unxz.c | 5 +---- src/bled/xz_config.h | 9 ++++++++- src/dev.c | 6 +++--- src/hdd_vs_ufd.h | 1 + src/net.c | 2 +- src/rufus.rc | 10 +++++----- 7 files changed, 20 insertions(+), 15 deletions(-) diff --git a/res/dbx/dbx_update.sh b/res/dbx/dbx_update.sh index 8c19f703..315dcf4e 100755 --- a/res/dbx/dbx_update.sh +++ b/res/dbx/dbx_update.sh @@ -9,7 +9,7 @@ get_commit_date() { if [[ "${url}" =~ ^"${github_url}" ]]; then parts=($(awk -F'contents/' '{ for(i=1;i<=NF;i++) print $i }' <<< ${url})) date_url="${parts[0]}commits?path=${parts[1]//\//%2F}&page=1&per_page=1" - epoch="$(curl -s -L ${date_url} | python -m json.tool | grep -m1 \"date\": | sed -e 's/^.*\"date\":.*\"\(.*\)\".*/\1/' | date -f - +%s)" + epoch="$(curl -s -L ${date_url} | python -m json.tool | grep -m1 \"date\": | sed -e 's/^.*\"date\":.*\"\(.*\)\".*/\1/' | date -u -f - +%s)" fi echo ${epoch:-0} } diff --git a/src/bled/decompress_unxz.c b/src/bled/decompress_unxz.c index 5178263d..731a77e4 100644 --- a/src/bled/decompress_unxz.c +++ b/src/bled/decompress_unxz.c @@ -11,9 +11,6 @@ #include "bb_archive.h" #define XZ_EXTERN static -// We get XZ_OPTIONS_ERROR in xz_dec_stream if this is not defined -#define XZ_DEC_ANY_CHECK - #define XZ_BUFSIZE BB_BUFSIZE #include "xz_dec_bcj.c" @@ -89,7 +86,7 @@ IF_DESKTOP(long long) int FAST_FUNC unpack_xz_stream(transformer_state_t *xstate #ifdef XZ_DEC_ANY_CHECK if (ret == XZ_UNSUPPORTED_CHECK) { - bb_error_msg("unsupported check; not verifying file integrity"); +// bb_error_msg("unsupported check; not verifying file integrity"); continue; } #endif diff --git a/src/bled/xz_config.h b/src/bled/xz_config.h index 05d90af9..a79fa679 100644 --- a/src/bled/xz_config.h +++ b/src/bled/xz_config.h @@ -10,11 +10,18 @@ #ifndef XZ_CONFIG_H #define XZ_CONFIG_H +// We get XZ_OPTIONS_ERROR in xz_dec_stream if this is not defined +#define XZ_DEC_ANY_CHECK + /* Uncomment as needed to enable BCJ filter decoders. */ +#if defined(_M_AMD64) || defined(__x86_64__) || defined(_M_IX86) || defined(__i386__) #define XZ_DEC_X86 +#endif /* #define XZ_DEC_POWERPC */ /* #define XZ_DEC_IA64 */ -/* #define XZ_DEC_ARM */ +#if defined (_M_ARM) || defined(__arm__) || defined (_M_ARM64) || defined(__aarch64__) +#define XZ_DEC_ARM +#endif /* #define XZ_DEC_ARMTHUMB */ /* #define XZ_DEC_SPARC */ diff --git a/src/dev.c b/src/dev.c index 7734f1b6..1ce88325 100644 --- a/src/dev.c +++ b/src/dev.c @@ -419,8 +419,8 @@ BOOL GetOpticalMedia(IMG_SAVE* img_save) //#define FORCED_DEVICE #ifdef FORCED_DEVICE #define FORCED_VID 0x04E8 -#define FORCED_PID 0x61ED -#define FORCED_NAME "Samsung uSD Card Reader USB Device" +#define FORCED_PID 0x6300 +#define FORCED_NAME "Samsung Type-C USB Device" #endif void ClearDrives(void) @@ -929,7 +929,7 @@ BOOL GetDevices(DWORD devnum) ((score = IsHDD(drive_index, (uint16_t)props.vid, (uint16_t)props.pid, buffer)) > 0)) { uprintf("Device eliminated because it was detected as a Hard Drive (score %d > 0)", score); if (!list_non_usb_removable_drives) - uprintf("If this device is not a Hard Drive, please e-mail the author of this application"); + uprintf("If this device is not a Hard Drive or SSD, please e-mail the author of this application"); uprintf("NOTE: You can enable the listing of Hard Drives under 'advanced drive properties'"); safe_free(devint_detail_data); break; diff --git a/src/hdd_vs_ufd.h b/src/hdd_vs_ufd.h index e239cb9d..33941f76 100644 --- a/src/hdd_vs_ufd.h +++ b/src/hdd_vs_ufd.h @@ -250,6 +250,7 @@ static vidpid_score_t vidpid_score[] = { { 0x04e8, 0x0101, -20 }, // Connect3D Flash Drive { 0x04e8, 0x1a23, -20 }, // 2 GB UFD { 0x04e8, 0x5120, -20 }, // 4 GB UFD + { 0x04e8, 0x6300, -20 }, // 256 GB UFD (MUF-256DA/APC) { 0x04e8, 0x6818, -20 }, // 8 GB UFD { 0x04e8, 0x6845, -20 }, // 16 GB UFD { 0x04e8, 0x685E, -20 }, // 16 GB UFD diff --git a/src/net.c b/src/net.c index 68f92252..b995cd05 100644 --- a/src/net.c +++ b/src/net.c @@ -493,7 +493,7 @@ static void CheckForDBXUpdates(int verbose) continue; t.tm_year -= 1900; t.tm_mon -= 1; - timestamp = _mktime64(&t); + timestamp = _mkgmtime64(&t); vuprintf("DBX update timestamp is %" PRId64, timestamp); static_sprintf(reg_name, "DBXTimestamp_%s", efi_archname[i + 1]); // Check if we have an external DBX that is newer than embedded/last downloaded diff --git a/src/rufus.rc b/src/rufus.rc index 74f4915f..84a87a43 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.10.2259" +CAPTION "Rufus 4.10.2260" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2259,0 - PRODUCTVERSION 4,10,2259,0 + FILEVERSION 4,10,2260,0 + PRODUCTVERSION 4,10,2260,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2259" + VALUE "FileVersion", "4.10.2260" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2259" + VALUE "ProductVersion", "4.10.2260" END END BLOCK "VarFileInfo" From 8cf88ffe7ac19dbfe602daacc952642e72a07d3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n=20Quang?= <smileosnet@gmail.com> Date: Thu, 26 Jun 2025 12:21:16 +0100 Subject: [PATCH 070/192] [loc] update Vietnamese translation --- res/loc/po/vi-VN.po | 182 ++++++++++++++++++++++++++------------------ res/loc/rufus.loc | 120 +++++++++++++++-------------- src/rufus.rc | 10 +-- 3 files changed, 173 insertions(+), 139 deletions(-) diff --git a/res/loc/po/vi-VN.po b/res/loc/po/vi-VN.po index a6d8fdbb..7fbf34d2 100644 --- a/res/loc/po/vi-VN.po +++ b/res/loc/po/vi-VN.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: 4.5\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-04-26 02:45+0900\n" -"PO-Revision-Date: 2024-04-26 03:13+0900\n" +"POT-Creation-Date: 2025-06-21 21:57+0700\n" +"PO-Revision-Date: 2025-06-21 22:47+0700\n" "Last-Translator: \n" "Language-Team: \n" "Language: vi_VN\n" @@ -13,19 +13,19 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Vietnamese (Tiếng Việt)\n" "X-Rufus-LCID: 0x042A\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.6\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" -msgstr "Thuộc tính ổ đĩa" +msgstr "Thuộc tính thiết bị lưu" #. • IDD_DIALOG → IDS_DEVICE_TXT msgid "Device" -msgstr "Thiết bị" +msgstr "Thiết bị lưu" #. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT msgid "Boot selection" -msgstr "Phương thức khởi động" +msgstr "Tùy chọn khởi động" #. • IDD_DIALOG → IDC_SELECT msgid "Select" @@ -37,28 +37,28 @@ msgstr "Tùy chọn tệp tin" #. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT msgid "Partition scheme" -msgstr "Định dạng phân vùng" +msgstr "Sơ đồ phân vùng" #. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT msgid "Target system" -msgstr "Hệ thống áp dụng" +msgstr "Hệ thống khởi động" #. • IDD_DIALOG → IDC_LIST_USB_HDD msgid "List USB Hard Drives" -msgstr "Danh sách ổ cứng USB" +msgstr "Liệt kê danh sách ổ USB" #. • IDD_DIALOG → IDC_OLD_BIOS_FIXES #. #. It is acceptable to drop the parenthesis () if you are running out of space #. as there is a tooltip (MSG_169) providing these details. msgid "Add fixes for old BIOSes (extra partition, align, etc.)" -msgstr "Thêm khắc phục cho BIOS cũ (phân vùng, sắp xếp...khác)" +msgstr "Thêm các bản sửa lỗi cho BIOS cũ (phân vùng phụ, căn lề phân vùng, v.v...)" #. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION #. #. It is acceptable to drop the "runtime" if you are running out of space msgid "Enable runtime UEFI media validation" -msgstr "Bật xác thực phương tiện UEFI tại thời điểm chạy" +msgstr "Bật xác minh thiết bị UEFI trong thời gian chạy" #. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT msgid "Format Options" @@ -70,11 +70,11 @@ msgstr "Hệ thống tập tin" #. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT msgid "Cluster size" -msgstr "Kích thước liên cung" +msgstr "Kích thước cụm" #. • IDD_DIALOG → IDS_LABEL_TXT msgid "Volume label" -msgstr "Nhãn ổ đĩa" +msgstr "Nhãn thiết bị lưu" #. • IDD_DIALOG → IDC_QUICK_FORMAT msgid "Quick format" @@ -82,11 +82,11 @@ msgstr "Định dạng nhanh" #. • IDD_DIALOG → IDC_BAD_BLOCKS msgid "Check device for bad blocks" -msgstr "Kiểm tra khối hỏng trong thiết bị" +msgstr "Kiểm tra lỗi khối trên thiết bị lưu trữ" #. • IDD_DIALOG → IDC_EXTENDED_LABEL msgid "Create extended label and icon files" -msgstr "Tạo tên mở rộng và tập tin biểu tượng" +msgstr "Tạo nhãn mở rộng và tệp tin biểu tượng" #. • IDD_DIALOG → IDS_STATUS_TXT msgid "Status" @@ -115,7 +115,7 @@ msgstr "Giấy phép" #. • IDD_ABOUTBOX → IDOK msgid "OK" -msgstr "OK" +msgstr "" #. • IDD_LICENSE → IDD_LICENSE msgid "Rufus License" @@ -161,7 +161,7 @@ msgstr "Kiểm tra cập nhật" #. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT msgid "Include beta versions" -msgstr "Gồm bản thử nghiệm" +msgstr "Bao gồm bản thử nghiệm" #. • IDD_UPDATE_POLICY → IDC_CHECK_NOW msgid "Check Now" @@ -173,7 +173,7 @@ msgstr "Kiểm tra cập nhật - Rufus" #. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT msgid "A newer version is available. Please download the latest version!" -msgstr "Đã có phiên bản mới. Vui lòng tải phiên bản mới nhất!" +msgstr "Đã có phiên bản mới hơn. Vui lòng tải phiên bản mới nhất!" #. • IDD_NEW_VERSION → IDC_WEBSITE msgid "Click here to go to the website" @@ -191,7 +191,7 @@ msgstr "Tải xuống" #. • MSG_001 msgid "Other instance detected" -msgstr "Phát hiện tiến trình chạy đồng thời" +msgstr "Đã phát hiện tiến trình chạy đồng thời" #. • MSG_002 msgid "" @@ -199,14 +199,14 @@ msgid "" "Please close the first application before running another one." msgstr "" "Ứng dụng Rufus khác đang chạy.\n" -"Vui lòng đóng ứng dụng đầu tiên trước khi chạy tiếp." +"Vui lòng đóng ứng dụng đầu tiên trước khi chạy một ứng dụng mới." #. • MSG_003 msgid "" "WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\n" "To continue with this operation, click OK. To quit click CANCEL." msgstr "" -"CẢNH BÁO: TẤT CẢ DỮ LIỆU TRÊN THIẾT BỊ '%s' SẼ BỊ HUỶ.\n" +"CẢNH BÁO: TẤT CẢ DỮ LIỆU TRÊN THIẾT BỊ '%s' SẼ BỊ XOÁ.\n" "Để tiếp tục tiến trình này, nhấn OK. Để thoát nhấn HUỶ." #. • MSG_004 @@ -215,7 +215,7 @@ msgstr "Chính sách cập nhật Rufus" #. • MSG_005 msgid "Do you want to allow Rufus to check for application updates online?" -msgstr "Bạn có muốn cho phép Rufus kiểm tra cập nhật ứng dụng trực tuyến?" +msgstr "Bạn có muốn cho phép Rufus kiểm tra các bản cập nhật ứng dụng trực tuyến?" #. • MSG_007 msgid "Cancel" @@ -280,45 +280,45 @@ msgstr "Phiên bản mới nhất: %d.%d (Bản dựng %d)" #. • MSG_020 #. • MSG_026 msgid "bytes" -msgstr "bytes" +msgstr "" #. • MSG_021 #. #. *Short* version of the kilobyte size suffix msgid "KB" -msgstr "KB" +msgstr "" #. • MSG_022 #. #. *Short* version of the megabyte size suffix msgid "MB" -msgstr "MB" +msgstr "" #. • MSG_023 #. #. *Short* version of the gigabyte size suffix msgid "GB" -msgstr "GB" +msgstr "" #. • MSG_024 #. #. *Short* version of the terabyte size suffix msgid "TB" -msgstr "TB" +msgstr "" #. • MSG_025 #. #. *Short* version of the pentabyte size suffix msgid "PB" -msgstr "PB" +msgstr "" #. • MSG_027 msgid "kilobytes" -msgstr "kilobytes" +msgstr "" #. • MSG_028 msgid "megabytes" -msgstr "megabytes" +msgstr "" #. • MSG_029 msgid "Default" @@ -346,14 +346,14 @@ msgstr "BIOS hoặc UEFI" #. #. Number of bad block check passes (singular for 1 pass) msgid "%d pass" -msgstr "Qua %d lần" +msgstr "Đạt %d lần" #. • MSG_035 #. #. Number of bad block check passes (plural for 2 or more passes). #. See MSG_087 for the message that %s gets replaced with. msgid "%d passes %s" -msgstr "Qua %d lần %s" +msgstr "Đã đạt %d lần %s" #. • MSG_036 msgid "ISO Image" @@ -373,7 +373,7 @@ msgstr "Khởi chạy" #. • MSG_041 msgid "Operation cancelled by the user" -msgstr "Tiến trình bị huỷ bởi người dùng" +msgstr "Tiến trình đã bị huỷ bởi người dùng" #. • MSG_042 msgid "Error" @@ -403,11 +403,11 @@ msgstr "Đa phân vùng" #. • MSG_048 msgid "Rufus - Flushing buffers" -msgstr "Rufus - Xoá bộ đệm" +msgstr "Rufus - Đang xả bộ đệm" #. • MSG_049 msgid "Rufus - Cancellation" -msgstr "Rufus - Huỷ" +msgstr "Rufus - Hủy bỏ" #. • MSG_050 msgid "Success." @@ -423,15 +423,15 @@ msgstr "Không thể dùng hệ thống tập tin đã chọn cho thiết bị n #. • MSG_053 msgid "Access to the device is denied." -msgstr "Thiết bị từ chối truy cập." +msgstr "Truy cập tới thiết bị đã bị từ chối." #. • MSG_054 msgid "Media is write protected." -msgstr "Thiết bị được bảo vệ ghi." +msgstr "Thiết bị đang được bảo vệ ghi." #. • MSG_055 msgid "The device is in use by another process. Please close any other process that may be accessing the device." -msgstr "Thiết bị đang được dùng bởi tiến trình khác. Vui lòng đóng mọi tiến trình có thể truy cập thiết bị." +msgstr "Thiết bị đang được dùng bởi tiến trình khác. Vui lòng đóng mọi tiến trình có thể đang truy cập thiết bị." #. • MSG_056 msgid "Quick format is not available for this device." @@ -439,23 +439,23 @@ msgstr "Định dạng nhanh không khả dụng với thiết bị này." #. • MSG_057 msgid "The volume label is invalid." -msgstr "Tên ổ đĩa không hợp lệ." +msgstr "Nhãn ổ đĩa không hợp lệ." #. • MSG_058 msgid "The device handle is invalid." -msgstr "Xử lý thiết bị không hợp lệ." +msgstr "Tham chiếu thiết bị không hợp lệ." #. • MSG_059 msgid "The selected cluster size is not valid for this device." -msgstr "Kích cỡ liên cung đã chọn không thích hợp với thiết bị này." +msgstr "Kích thước cụm đã chọn không hợp lệ với thiết bị này." #. • MSG_060 msgid "The volume size is invalid." -msgstr "Kích cỡ ổ đĩa không hợp lệ." +msgstr "Kích cỡ thiết bị không hợp lệ." #. • MSG_061 msgid "Please insert a removable media in drive." -msgstr "Vui lòng kết nối ổ gắn ngoài vào." +msgstr "Vui lòng cắm thiết bị lưu trữ di động vào ổ." #. • MSG_062 msgid "An unsupported command was received." @@ -483,11 +483,11 @@ msgstr "Không thể mở thiết bị. Có thể nó đang được tiến trì #. • MSG_068 msgid "Could not partition drive." -msgstr "Không thể phân vùng ổ đĩa." +msgstr "Không thể phân vùng thiết bị." #. • MSG_069 msgid "Could not copy files to target drive." -msgstr "Không thể chép tập tin vào đĩa." +msgstr "Không thể sao chép tệp vào thiết bị đích." #. • MSG_070 msgid "Cancelled by user." @@ -521,11 +521,11 @@ msgstr "Không thể vá/cài đặt tập tin cho việc khởi động." #. • MSG_077 msgid "Unable to assign a drive letter." -msgstr "Không thể định ký tự ổ đĩa." +msgstr "Không thể gán ký tự ổ đĩa." #. • MSG_078 msgid "Can't mount GUID volume." -msgstr "Không thể gắn kết ổ GUID." +msgstr "Không thể gắn kết phân vùng GUID." #. • MSG_079 msgid "The device is not ready." @@ -539,11 +539,11 @@ msgid "" "\n" "We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device..." msgstr "" -"Rufus đã phát hiện Windows vẫn đang làm sạch bộ đệm bên trong thiết bị USB.\n" +"Rufus đã phát hiện Windows vẫn đang xả bộ đệm bên trong thiết bị USB.\n" "\n" -"Tuỳ thuộc vào tốc độ của thiết bị USB, hoạt động này có thể mất một thời gian dài để hoàn tất, đặc biệt với những tập tin lớn.\n" +"Tuỳ thuộc vào tốc độ thiết bị USB của bạn, hoạt động này có thể mất một thời gian dài để hoàn tất, đặc biệt với những tập tin lớn.\n" "\n" -"Chúng tôi khuyên bạn nên để Windows kết thúc để phòng hỏng dữ liệu. Nhưng nếu bạn cảm thấy quá lâu, hãy cứ tháo thiết bị ra..." +"Chúng tôi khuyên rằng bạn nên để Windows kết thúc để phòng hỏng dữ liệu. Nhưng nếu bạn cảm thấy quá lâu, hãy cứ tháo thiết bị ra..." #. • MSG_081 msgid "Unsupported image" @@ -551,7 +551,7 @@ msgstr "Tệp tin không được hỗ trợ" #. • MSG_082 msgid "This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus..." -msgstr "Tệp này không có khả năng khởi động hoặc sử dụng một phương thức khởi động hoặc nén không được Rufus hỗ trợ..." +msgstr "Tệp này không có khả năng khởi động hoặc sử dụng một tuỳ chọn khởi động hoặc nén không được Rufus hỗ trợ..." #. • MSG_083 msgid "Replace %s?" @@ -585,7 +585,7 @@ msgstr "Đang tải xuống %s" #. • MSG_086 msgid "No image selected" -msgstr "Chưa chọn tệp tin" +msgstr "Chưa tệp tin nào được chọn" #. • MSG_087 #. @@ -604,7 +604,7 @@ msgstr "Tệp tin quá lớn" #. • MSG_089 msgid "The image is too big for the selected target." -msgstr "Tệp tin quá lớn cho đĩa đã chọn." +msgstr "Tệp tin quá lớn cho thiết bị đích đã chọn." #. • MSG_090 msgid "Unsupported ISO" @@ -612,7 +612,7 @@ msgstr "ISO không được hỗ trợ" #. • MSG_091 msgid "When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS." -msgstr "Khi dùng loại hệ thống là UEFI, chỉ có tệp ISO có thể khởi động với EFI được hỗ trợ. Vui lòng chọn tệp phù hợp hoặc chọn loại hệ thống là BIOS." +msgstr "Khi sử dụng kiểu hệ thống khởi động UEFI, chỉ hỗ trợ các tệp ISO có khả năng khởi động bằng EFI. Vui lòng chọn một tệp ISO có hỗ trợ EFI hoặc chuyển kiểu hệ thống khởi động sang BIOS." #. • MSG_092 msgid "Unsupported filesystem" @@ -638,7 +638,7 @@ msgstr "Tệp tin DD" #. • MSG_096 msgid "The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO." -msgstr "Không thể dùng loại ISO này với hệ thống tập tin đã chọn. Vui lòng chọn một hệ thống tập tin hoặc ISO khác." +msgstr "Không thể dùng loại ISO này với hệ thống tập tin đã chọn. Vui lòng chọn một hệ thống tập tin hoặc chọn tệp ISO khác." #. • MSG_097 msgid "'%s' can only be applied if the file system is NTFS." @@ -652,11 +652,11 @@ msgid "" "\n" "Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public..." msgstr "" -"QUAN TRỌNG: Bạn đang cố cài đặt 'Windows To Go', nhưng ổ đĩa không có thuộc tính 'CỐ ĐỊNH'. Vì vậy, Windows có thể sẽ đóng băng tại điểm khởi động, do Microsoft không thiết kế nó để chạy với ổ đĩa có thuộc tính 'CÓ THỂ THÁO ĐƯỢC'. \n" +"QUAN TRỌNG: Bạn đang cố cài đặt Windows To Go, nhưng ổ đĩa đích của bạn không có thuộc tính “CỐ ĐỊNH” (FIXED). Do đó, Windows có thể bị treo khi khởi động, vì Microsoft không thiết kế Windows To Go để hoạt động với ổ đĩa có thuộc tính “THÁO RỜI” (REMOVABLE).\n" "\n" -"Bạn vẫn muốn tiến hành?\n" +"Bạn có chắc chắn muốn tiếp tục không?\n" "\n" -"Ghi chú: Thuộc tính 'CỐ ĐỊNH/CÓ THỂ THÁO ĐƯỢC' là một thuộc tính phần cứng chỉ có thể thay đổi bằng các công cụ tuỳ chỉnh từ nhà sản xuất ổ đĩa. Tuy nhiên những công cụ này HẦU NHƯ KHÔNG BAO GIỜ được cung cấp công khai..." +"Lưu ý: Thuộc tính “CỐ ĐỊNH/THÁO RỜI” là một đặc điểm phần cứng và chỉ có thể thay đổi bằng công cụ đặc biệt từ nhà sản xuất ổ đĩa. Tuy nhiên, những công cụ này HẦU NHƯ KHÔNG bao giờ được cung cấp cho người dùng phổ thông..." #. • MSG_099 msgid "Filesystem limitation" @@ -697,7 +697,7 @@ msgid "" "Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically." msgstr "" "%s hoặc mới hơn yêu cầu tập tin '%s' được cài đặt.\n" -"Vì tập tin này lớn hơn 100 KB, và luôn có trong ảnh ISO %s, nó không được kèm theo trong Rufus.\n" +"Vì tập tin này lớn hơn 100 KB, và luôn có trong các tệp ISO %s, nó không được kèm theo trong Rufus.\n" "\n" "Rufus có thể tải xuống tập tin còn thiếu cho bạn:\n" "- Chọn 'Có' để kết nối với Internet và tải tập tin\n" @@ -737,12 +737,12 @@ msgid "" "MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\n" "Please change the Cluster size or use FreeDOS." msgstr "" -"MS-DOS không thể khởi động từ ổ đĩa dùng kích thước liên cung 64 kilobytes.\n" -"Vui lòng thay đổi kích thước liên cung hoặc dùng FreeDOS." +"MS-DOS không thể khởi động từ ổ đĩa có kích thước cụm là 64 kilobyte.\n" +"Vui lòng thay đổi kích thước cụm hoặc sử dụng FreeDOS thay thế." #. • MSG_111 msgid "Incompatible Cluster size" -msgstr "Kích thước liên cung không tương thích" +msgstr "Kích thước cụm không tương thích" #. • MSG_112 #. @@ -809,7 +809,7 @@ msgstr "Cài đặt Windows tiêu chuẩn" #. http://en.wikipedia.org/wiki/Windows_To_Go in your language. #. Otherwise, you may add a parenthesis eg. "Windows To Go (<hint at what it does>)" msgid "Windows To Go" -msgstr "Windows To Go" +msgstr "" #. • MSG_119 msgid "advanced drive properties" @@ -884,7 +884,7 @@ msgstr "" #. • MSG_132 msgid "Another program or process is accessing this drive. Do you want to format it anyway?" -msgstr "Có một chương trình hoặc tiến trình nào đó đang truy cập ổ. Bạn vẫn muốn định dạng ổ đĩa?" +msgstr "Có một chương trình hoặc tiến trình khác đang truy cập ổ. Bạn vẫn muốn định dạng ổ đĩa?" #. • MSG_133 msgid "" @@ -1014,11 +1014,11 @@ msgstr "" #. • MSG_160 msgid "Toggle advanced options" -msgstr "Bật/tắt tuỳ chọn nâng cao" +msgstr "Bật/tắt các tuỳ chọn nâng cao" #. • MSG_161 msgid "Check the device for bad blocks using a test pattern" -msgstr "Kiểm tra khối hỏng bằng mẫu thử" +msgstr "Kiểm tra thiết bị tìm khối lỗi bằng mẫu kiểm tra" #. • MSG_162 msgid "Uncheck this box to use the \"slow\" format method" @@ -1054,7 +1054,7 @@ msgstr "" #. • MSG_170 msgid "Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!" -msgstr "Kích hoạt liệt kê ổ cứng USB trong máy. DÙNG CẨN TRỌNG!!!" +msgstr "Bật hiển thị các ổ cứng gắn ngoài qua USB. TỰ CHỊU RỦI RO KHI SỬ DỤNG!!!" #. • MSG_171 msgid "" @@ -1085,7 +1085,7 @@ msgstr "Phiên bản %d.%d (Bản dựng %d)" #. • MSG_176 msgid "English translation: Pete Batard <mailto:pete@akeo.ie>" -msgstr "Bản dịch tiếng Việt:\\line• thanhtai2009 <mailto:thanhtai2009@outlook.com>\\line• caobach <mailto:caobach@gmail.com>\\line• VNSpringRice <mailto:admin@quangminh.name.vn>" +msgstr "Bản dịch Tiếng Việt:\\line• thanhtai2009 <mailto:thanhtai2009@outlook.com>\\line• caobach <mailto:caobach@gmail.com>\\line• Nguyễn Quang Minh (MinhNQ101) <mailto:admin@quangminh.name.vn>" #. • MSG_177 msgid "Report bugs or request enhancements at:" @@ -1580,7 +1580,7 @@ msgstr "Không có khả năng khởi động" #. • MSG_280 msgid "Disk or ISO image" -msgstr "Đĩa hoặc tệp tin" +msgstr "Đĩa hoặc tệp tin ISO" #. • MSG_281 msgid "%s (Please select)" @@ -1588,7 +1588,7 @@ msgstr "%s (Vui lòng chọn)" #. • MSG_282 msgid "Exclusive USB drive locking" -msgstr "Khoá ổ USB đặc biệt" +msgstr "Chặn truy cập ổ USB từ chương trình khác" #. • MSG_283 msgid "Invalid signature" @@ -1618,7 +1618,7 @@ msgstr "Phát hiện ổ đĩa tháo được không phải USB" #. • MSG_288 msgid "Missing elevated privileges" -msgstr "Thiếu đặc quyền" +msgstr "Thiếu quyền quản trị" #. • MSG_289 msgid "This application can only run with elevated privileges" @@ -1805,7 +1805,7 @@ msgstr "Đang áp dụng các cài đặt người dùng..." #. • MSG_327 msgid "Windows User Experience" -msgstr "Trải nghiệm người dùng Windows" +msgstr "" #. • MSG_328 msgid "Customize Windows installation?" @@ -1829,7 +1829,7 @@ msgstr "Ngăn cản Windows To Go truy cập ổ đĩa trong" #. • MSG_333 msgid "Create a local account with username:" -msgstr "Tạo tài khoản nội bộ với tên:" +msgstr "Tạo tài khoản nội bộ với tên người dùng:" #. • MSG_334 msgid "Set regional options to the same values as this user's" @@ -1841,7 +1841,7 @@ msgstr "Vô hiệu tự động mã hoá thiết bị BitLocker" #. • MSG_336 msgid "Persistent log" -msgstr "Nhật ký" +msgstr "Nhật ký lưu vĩnh viễn" #. • MSG_337 msgid "" @@ -1899,7 +1899,7 @@ msgid "" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation" msgstr "" -"Một vài dữ lieu phải được tải xuống từ Microsoft để sử dụng tính năng này:\n" +"Một vài dữ liệu phải được tải xuống từ Microsoft để sử dụng tính năng này:\n" "- Chọn 'Có' để kết nối tới Internet và tải xuống nó\n" "- Chọn 'Không' để huỷ tiến trình" @@ -1919,11 +1919,41 @@ msgstr "Đang giải nén tệp lưu trữ: %s" msgid "Use Rufus MBR" msgstr "Sử dụng Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows UEFI CA 2023' signed bootloaders [EXPERIMENTAL]" +msgstr "Sử dụng bootloader đã được ký bởi chứng chỉ “Windows UEFI CA 2023” (TÍNH NĂNG THỬ NGHIỆM)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Đang kiểm tra trạng thái thu hồi của bootloader UEFI..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Đang kiểm tra cập nhật cơ sở dữ liệu chặn (DBX) của UEFI…" + +#. • MSG_353 +msgid "DBX update available" +msgstr "Đã phát hiện bản cập nhật DBX của UEFI" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus đã phát hiện phiên bản cập nhật của các tệp DBX, được dùng để kiểm tra thu hồi Secure Boot trong UEFI. Bạn có muốn tải bản cập nhật này không?\n" +"- Chọn “Có” để kết nối Internet và tải nội dung này.\n" +"- Chọn “Không” để hủy thao tác.\n" +"\n" +"Lưu ý: Các tệp sẽ được tải về thư mục của ứng dụng và sẽ tự động được sử dụng lại nếu đã có sẵn." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application msgid "Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc." -msgstr "Rufus là một tiện ích giúp định dạng và tạo khả năng khởi động cho USB, chẳng hạn như thẻ USB/đĩa di động, thẻ nhớ, vv." +msgstr "Rufus là một tiện ích giúp định dạng và tạo khả năng khởi động cho các thiết bị USB, ví dụ như thẻ USB/đĩa di động, thẻ nhớ, v.v..." #. • MSG_901 msgid "Official site: %s" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 1bf7746a..49add14b 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -15711,23 +15711,23 @@ t IDD_ABOUTBOX "Thông tin về Rufus" t IDC_ABOUT_LICENSE "Giấy phép" g IDD_DIALOG -t IDS_DRIVE_PROPERTIES_TXT "Thuộc tính ổ đĩa" -t IDS_DEVICE_TXT "Thiết bị" -t IDS_BOOT_SELECTION_TXT "Phương thức khởi động" +t IDS_DRIVE_PROPERTIES_TXT "Thuộc tính thiết bị lưu" +t IDS_DEVICE_TXT "Thiết bị lưu" +t IDS_BOOT_SELECTION_TXT "Tùy chọn khởi động" t IDC_SELECT "Chọn" t IDS_IMAGE_OPTION_TXT "Tùy chọn tệp tin" -t IDS_PARTITION_TYPE_TXT "Định dạng phân vùng" -t IDS_TARGET_SYSTEM_TXT "Hệ thống áp dụng" -t IDC_LIST_USB_HDD "Danh sách ổ cứng USB" -t IDC_OLD_BIOS_FIXES "Thêm khắc phục cho BIOS cũ (phân vùng, sắp xếp...khác)" -t IDC_UEFI_MEDIA_VALIDATION "Bật xác thực phương tiện UEFI tại thời điểm chạy" +t IDS_PARTITION_TYPE_TXT "Sơ đồ phân vùng" +t IDS_TARGET_SYSTEM_TXT "Hệ thống khởi động" +t IDC_LIST_USB_HDD "Liệt kê danh sách ổ USB" +t IDC_OLD_BIOS_FIXES "Thêm các bản sửa lỗi cho BIOS cũ (phân vùng phụ, căn lề phân vùng, v.v...)" +t IDC_UEFI_MEDIA_VALIDATION "Bật xác minh thiết bị UEFI trong thời gian chạy" t IDS_FORMAT_OPTIONS_TXT "Tùy chọn định dạng" t IDS_FILE_SYSTEM_TXT "Hệ thống tập tin" -t IDS_CLUSTER_SIZE_TXT "Kích thước liên cung" -t IDS_LABEL_TXT "Nhãn ổ đĩa" +t IDS_CLUSTER_SIZE_TXT "Kích thước cụm" +t IDS_LABEL_TXT "Nhãn thiết bị lưu" t IDC_QUICK_FORMAT "Định dạng nhanh" -t IDC_BAD_BLOCKS "Kiểm tra khối hỏng trong thiết bị" -t IDC_EXTENDED_LABEL "Tạo tên mở rộng và tập tin biểu tượng" +t IDC_BAD_BLOCKS "Kiểm tra lỗi khối trên thiết bị lưu trữ" +t IDC_EXTENDED_LABEL "Tạo nhãn mở rộng và tệp tin biểu tượng" t IDS_STATUS_TXT "Trạng thái" t IDCANCEL "Đóng" t IDC_START "Bắt đầu" @@ -15745,7 +15745,7 @@ t IDC_LOG_SAVE "Lưu" g IDD_NEW_VERSION t IDCANCEL "Đóng" t IDD_NEW_VERSION "Kiểm tra cập nhật - Rufus" -t IDS_NEW_VERSION_AVAIL_TXT "Đã có phiên bản mới. Vui lòng tải phiên bản mới nhất!" +t IDS_NEW_VERSION_AVAIL_TXT "Đã có phiên bản mới hơn. Vui lòng tải phiên bản mới nhất!" t IDC_WEBSITE "Nhấn vào đây để truy cập website" t IDS_NEW_VERSION_NOTES_GRP "Ghi chú phát hành" t IDS_NEW_VERSION_DOWNLOAD_GRP "Tải xuống" @@ -15761,14 +15761,14 @@ t IDCANCEL "Đóng" t IDD_UPDATE_POLICY "Cập nhật chính sách và thiết lập" t IDS_UPDATE_SETTINGS_GRP "Thiết lập" t IDS_UPDATE_FREQUENCY_TXT "Kiểm tra cập nhật" -t IDS_INCLUDE_BETAS_TXT "Gồm bản thử nghiệm" +t IDS_INCLUDE_BETAS_TXT "Bao gồm bản thử nghiệm" t IDC_CHECK_NOW "Kiểm tra ngay" -t MSG_001 "Phát hiện tiến trình chạy đồng thời" -t MSG_002 "Ứng dụng Rufus khác đang chạy.\nVui lòng đóng ứng dụng đầu tiên trước khi chạy tiếp." -t MSG_003 "CẢNH BÁO: TẤT CẢ DỮ LIỆU TRÊN THIẾT BỊ '%s' SẼ BỊ HUỶ.\nĐể tiếp tục tiến trình này, nhấn OK. Để thoát nhấn HUỶ." +t MSG_001 "Đã phát hiện tiến trình chạy đồng thời" +t MSG_002 "Ứng dụng Rufus khác đang chạy.\nVui lòng đóng ứng dụng đầu tiên trước khi chạy một ứng dụng mới." +t MSG_003 "CẢNH BÁO: TẤT CẢ DỮ LIỆU TRÊN THIẾT BỊ '%s' SẼ BỊ XOÁ.\nĐể tiếp tục tiến trình này, nhấn OK. Để thoát nhấn HUỶ." t MSG_004 "Chính sách cập nhật Rufus" -t MSG_005 "Bạn có muốn cho phép Rufus kiểm tra cập nhật ứng dụng trực tuyến?" +t MSG_005 "Bạn có muốn cho phép Rufus kiểm tra các bản cập nhật ứng dụng trực tuyến?" t MSG_006 "Đóng" t MSG_007 "Huỷ" t MSG_008 "Có" @@ -15788,42 +15788,42 @@ t MSG_030 "%s (Mặc định)" t MSG_031 "BIOS (hoặc UEFI-CSM)" t MSG_032 "UEFI (không CSM)" t MSG_033 "BIOS hoặc UEFI" -t MSG_034 "Qua %d lần" -t MSG_035 "Qua %d lần %s" +t MSG_034 "Đạt %d lần" +t MSG_035 "Đã đạt %d lần %s" t MSG_036 "Tệp ISO" t MSG_037 "Ứng dụng" t MSG_038 "Huỷ bỏ" t MSG_039 "Khởi chạy" t MSG_040 "Tải xuống" -t MSG_041 "Tiến trình bị huỷ bởi người dùng" +t MSG_041 "Tiến trình đã bị huỷ bởi người dùng" t MSG_042 "Lỗi" t MSG_043 "Lỗi: %s" t MSG_044 "Tải xuống tập tin" t MSG_045 "Thiết bị lưu trữ USB (Cơ bản)" t MSG_046 "%s (Đĩa %d) [%s]" t MSG_047 "Đa phân vùng" -t MSG_048 "Rufus - Xoá bộ đệm" -t MSG_049 "Rufus - Huỷ" +t MSG_048 "Rufus - Đang xả bộ đệm" +t MSG_049 "Rufus - Hủy bỏ" t MSG_050 "Thành công." t MSG_051 "Lỗi không xác định khi đang định dạng." t MSG_052 "Không thể dùng hệ thống tập tin đã chọn cho thiết bị này." -t MSG_053 "Thiết bị từ chối truy cập." -t MSG_054 "Thiết bị được bảo vệ ghi." -t MSG_055 "Thiết bị đang được dùng bởi tiến trình khác. Vui lòng đóng mọi tiến trình có thể truy cập thiết bị." +t MSG_053 "Truy cập tới thiết bị đã bị từ chối." +t MSG_054 "Thiết bị đang được bảo vệ ghi." +t MSG_055 "Thiết bị đang được dùng bởi tiến trình khác. Vui lòng đóng mọi tiến trình có thể đang truy cập thiết bị." t MSG_056 "Định dạng nhanh không khả dụng với thiết bị này." -t MSG_057 "Tên ổ đĩa không hợp lệ." -t MSG_058 "Xử lý thiết bị không hợp lệ." -t MSG_059 "Kích cỡ liên cung đã chọn không thích hợp với thiết bị này." -t MSG_060 "Kích cỡ ổ đĩa không hợp lệ." -t MSG_061 "Vui lòng kết nối ổ gắn ngoài vào." +t MSG_057 "Nhãn ổ đĩa không hợp lệ." +t MSG_058 "Tham chiếu thiết bị không hợp lệ." +t MSG_059 "Kích thước cụm đã chọn không hợp lệ với thiết bị này." +t MSG_060 "Kích cỡ thiết bị không hợp lệ." +t MSG_061 "Vui lòng cắm thiết bị lưu trữ di động vào ổ." t MSG_062 "Đã nhận một lệnh không được hỗ trợ." t MSG_063 "Lỗi sắp xếp bộ nhớ." t MSG_064 "Lỗi đọc." t MSG_065 "Lỗi ghi." t MSG_066 "Cài đặt thất bại" t MSG_067 "Không thể mở thiết bị. Có thể nó đang được tiến trình khác sử dụng. Vui lòng cắm lại thiết bị và thử lại." -t MSG_068 "Không thể phân vùng ổ đĩa." -t MSG_069 "Không thể chép tập tin vào đĩa." +t MSG_068 "Không thể phân vùng thiết bị." +t MSG_069 "Không thể sao chép tệp vào thiết bị đích." t MSG_070 "Đã huỷ bởi người dùng." t MSG_071 "Không thể bắt đầu luồng." t MSG_072 "Kiểm tra khối hỏng chưa hoàn tất." @@ -15831,41 +15831,41 @@ t MSG_073 "Quét tệp ISO thất bại." t MSG_074 "Trích xuất tệp ISO thất bại." t MSG_075 "Không thể tái gắn ổ đĩa." t MSG_076 "Không thể vá/cài đặt tập tin cho việc khởi động." -t MSG_077 "Không thể định ký tự ổ đĩa." -t MSG_078 "Không thể gắn kết ổ GUID." +t MSG_077 "Không thể gán ký tự ổ đĩa." +t MSG_078 "Không thể gắn kết phân vùng GUID." t MSG_079 "Thiết bị chưa sẵn sàng." -t MSG_080 "Rufus đã phát hiện Windows vẫn đang làm sạch bộ đệm bên trong thiết bị USB.\n\nTuỳ thuộc vào tốc độ của thiết bị USB, hoạt động này có thể mất một thời gian dài để hoàn tất, đặc biệt với những tập tin lớn.\n\nChúng tôi khuyên bạn nên để Windows kết thúc để phòng hỏng dữ liệu. Nhưng nếu bạn cảm thấy quá lâu, hãy cứ tháo thiết bị ra..." +t MSG_080 "Rufus đã phát hiện Windows vẫn đang xả bộ đệm bên trong thiết bị USB.\n\nTuỳ thuộc vào tốc độ thiết bị USB của bạn, hoạt động này có thể mất một thời gian dài để hoàn tất, đặc biệt với những tập tin lớn.\n\nChúng tôi khuyên rằng bạn nên để Windows kết thúc để phòng hỏng dữ liệu. Nhưng nếu bạn cảm thấy quá lâu, hãy cứ tháo thiết bị ra..." t MSG_081 "Tệp tin không được hỗ trợ" -t MSG_082 "Tệp này không có khả năng khởi động hoặc sử dụng một phương thức khởi động hoặc nén không được Rufus hỗ trợ..." +t MSG_082 "Tệp này không có khả năng khởi động hoặc sử dụng một tuỳ chọn khởi động hoặc nén không được Rufus hỗ trợ..." t MSG_083 "Thay thế %s?" t MSG_084 "Tệp ISO này có vẻ là phiên bản lỗi thời của '%s'.\nCác menu khởi động có thể không hiện chính xác vì điều này.\n\nMột phiên bản mới có thể được tải xuống bởi Rufus để khắc phục vấn đề này:\n- Chọn 'Có' để kết nối với Internet và tải tập tin xuống\n- Chọn 'Không' để không thay đổi tập tin ISO đang có\nNếu bạn không biết phải làm gì, bạn nên chọn 'Có'.\n\nGhi chú: Tập tin mới sẽ được tải xuống vào thư mục hiện tại và một khi '%s' tồn tại trong đó, nó sẽ được tự động tái sử dụng." t MSG_085 "Đang tải xuống %s" -t MSG_086 "Chưa chọn tệp tin" +t MSG_086 "Chưa tệp tin nào được chọn" t MSG_087 "cho %s NAND" t MSG_088 "Tệp tin quá lớn" -t MSG_089 "Tệp tin quá lớn cho đĩa đã chọn." +t MSG_089 "Tệp tin quá lớn cho thiết bị đích đã chọn." t MSG_090 "ISO không được hỗ trợ" -t MSG_091 "Khi dùng loại hệ thống là UEFI, chỉ có tệp ISO có thể khởi động với EFI được hỗ trợ. Vui lòng chọn tệp phù hợp hoặc chọn loại hệ thống là BIOS." +t MSG_091 "Khi sử dụng kiểu hệ thống khởi động UEFI, chỉ hỗ trợ các tệp ISO có khả năng khởi động bằng EFI. Vui lòng chọn một tệp ISO có hỗ trợ EFI hoặc chuyển kiểu hệ thống khởi động sang BIOS." t MSG_092 "Hệ thống tập tin không được hỗ trợ" t MSG_093 "QUAN TRỌNG: Ổ ĐĨA NÀY CHỨA NHIỀU PHÂN VÙNG!!\n\nCó thể bao gồm phân vùng/ổ đĩa không có trong danh sách hoặc không hiển thị trong Windows. Nếu bạn tiến hành, bạn sẽ phải chịu trách nhiệm về mọi tổn thất dữ liệu trên những phân vùng này." t MSG_094 "Đã phát hiện nhiều phân vùng" t MSG_095 "Tệp tin DD" -t MSG_096 "Không thể dùng loại ISO này với hệ thống tập tin đã chọn. Vui lòng chọn một hệ thống tập tin hoặc ISO khác." +t MSG_096 "Không thể dùng loại ISO này với hệ thống tập tin đã chọn. Vui lòng chọn một hệ thống tập tin hoặc chọn tệp ISO khác." t MSG_097 "Chỉ có thể áp dụng '%s' nếu hệ thống tập tin là NTFS." -t MSG_098 "QUAN TRỌNG: Bạn đang cố cài đặt 'Windows To Go', nhưng ổ đĩa không có thuộc tính 'CỐ ĐỊNH'. Vì vậy, Windows có thể sẽ đóng băng tại điểm khởi động, do Microsoft không thiết kế nó để chạy với ổ đĩa có thuộc tính 'CÓ THỂ THÁO ĐƯỢC'. \n\nBạn vẫn muốn tiến hành?\n\nGhi chú: Thuộc tính 'CỐ ĐỊNH/CÓ THỂ THÁO ĐƯỢC' là một thuộc tính phần cứng chỉ có thể thay đổi bằng các công cụ tuỳ chỉnh từ nhà sản xuất ổ đĩa. Tuy nhiên những công cụ này HẦU NHƯ KHÔNG BAO GIỜ được cung cấp công khai..." +t MSG_098 "QUAN TRỌNG: Bạn đang cố cài đặt Windows To Go, nhưng ổ đĩa đích của bạn không có thuộc tính “CỐ ĐỊNH” (FIXED). Do đó, Windows có thể bị treo khi khởi động, vì Microsoft không thiết kế Windows To Go để hoạt động với ổ đĩa có thuộc tính “THÁO RỜI” (REMOVABLE).\n\nBạn có chắc chắn muốn tiếp tục không?\n\nLưu ý: Thuộc tính “CỐ ĐỊNH/THÁO RỜI” là một đặc điểm phần cứng và chỉ có thể thay đổi bằng công cụ đặc biệt từ nhà sản xuất ổ đĩa. Tuy nhiên, những công cụ này HẦU NHƯ KHÔNG bao giờ được cung cấp cho người dùng phổ thông..." t MSG_099 "Giới hạn tập tin hệ thống" t MSG_100 "Tệp ISO này có chứa một tập tin lớn hơn 4 GB, lớn hơn kích thước tập tin tối đa được hệ thống FAT hoặc FAT32 cho phép." t MSG_101 "Thiếu hỗ trợ WIM" t MSG_102 "Nền tảng của bạn không thể giải nén tệp từ lưu trữ WIM. Việc giải nén WIM là cần thiết để tạo đĩa USB khởi động Windows 7 và Windows Vista có hỗ trợ EFI. Bạn có thể khắc phục điều này bằng cách cài phiên bản mới nhất của 7-Zip.\nBạn muốn truy cập trang tải xuống của 7-Zip?" t MSG_103 "Tải xuống %s?" -t MSG_104 "%s hoặc mới hơn yêu cầu tập tin '%s' được cài đặt.\nVì tập tin này lớn hơn 100 KB, và luôn có trong ảnh ISO %s, nó không được kèm theo trong Rufus.\n\nRufus có thể tải xuống tập tin còn thiếu cho bạn:\n- Chọn 'Có' để kết nối với Internet và tải tập tin\n- Chọn 'Không' nếu bạn muốn tự chép tập tin này trên đĩa lúc khác\n\nGhi chú: tập tin sẽ được tải xuống thư mục hiện tại và khi '%s' tồn tại ở đó, nó sẽ tự động được tái sử dụng." +t MSG_104 "%s hoặc mới hơn yêu cầu tập tin '%s' được cài đặt.\nVì tập tin này lớn hơn 100 KB, và luôn có trong các tệp ISO %s, nó không được kèm theo trong Rufus.\n\nRufus có thể tải xuống tập tin còn thiếu cho bạn:\n- Chọn 'Có' để kết nối với Internet và tải tập tin\n- Chọn 'Không' nếu bạn muốn tự chép tập tin này trên đĩa lúc khác\n\nGhi chú: tập tin sẽ được tải xuống thư mục hiện tại và khi '%s' tồn tại ở đó, nó sẽ tự động được tái sử dụng." t MSG_105 "Huỷ bỏ có thể làm thiết bị rơi vào trạng thái KHÔNG THỂ SỬ DỤNG.\nNếu bạn chắc chắn muốn huỷ, chọn CÓ. Nếu không, hãy chọn KHÔNG." t MSG_106 "Vui lòng chọn thư mục" t MSG_107 "Tất cả tập tin" t MSG_108 "Nhật ký Rufus" t MSG_109 "0x%02X (Đĩa %d)" -t MSG_110 "MS-DOS không thể khởi động từ ổ đĩa dùng kích thước liên cung 64 kilobytes.\nVui lòng thay đổi kích thước liên cung hoặc dùng FreeDOS." -t MSG_111 "Kích thước liên cung không tương thích" +t MSG_110 "MS-DOS không thể khởi động từ ổ đĩa có kích thước cụm là 64 kilobyte.\nVui lòng thay đổi kích thước cụm hoặc sử dụng FreeDOS thay thế." +t MSG_111 "Kích thước cụm không tương thích" t MSG_112 "Định dạng ổ UDF lớn có thể mất nhiều thời gian. Với tốc độ của USB 2.0, thời gian định dạng dự kiến là %d:%02d, trong lúc này thanh tiến trình sẽ không thay đổi. Vui lòng kiên nhẫn!" t MSG_113 "Ổ UDF lớn" t MSG_114 "Tệp này dùng Syslinux %s%s nhưng ứng dụng này chỉ bao gồm tập tin cài đặt cho Syslinux %s%s.\n\nPhiên bản mới của Syslinux không tương thích với các phiên bản khác, và Rufus không thể kèm theo tất cả chúng, bạn phải tải xuống thêm hai tập tin từ Internet ('ldlinux.sys' và 'ldlinux.bss'):\n- Chọn 'Có' để kết nối tới Internet và tải xuống những tập tin này\n- Chọn 'Không' để huỷ hoạt động\n\nChú ý: Các tập tin sẽ được tải xuống vào thư mục ứng dụng hiện tại và sẽ được tự tái sử dụng nếu có." @@ -15885,7 +15885,7 @@ t MSG_128 "Chú ý quan trọng về %s" t MSG_129 "Bạn vừa mới tạo ổ đĩa sử dung UEFI:NTFS bootloader. Hãy nhớ rằng để khởi động được đĩa này BẠN PHẢI VÔ HIỆU SECURE BOOT.\nĐể hiểu tại sao nó quan trọng, xem trong phần 'Thông tin thêm' phía dưới." t MSG_130 "Chọn file ảnh Windows" t MSG_131 "File ISO này chứa nhiều tệp ảnh Windows.\nHãy chọn tệp ảnh bạn muốn sử dung cho việc cài đặt này:" -t MSG_132 "Có một chương trình hoặc tiến trình nào đó đang truy cập ổ. Bạn vẫn muốn định dạng ổ đĩa?" +t MSG_132 "Có một chương trình hoặc tiến trình khác đang truy cập ổ. Bạn vẫn muốn định dạng ổ đĩa?" t MSG_133 "Rufus nhận thấy bạn đang cố gắng tạo ổ đĩa Windows To Go dựa vào ISO phiên bản 1809.\n\nBởi vì một *LỖI CỦA MICROSOFT*, ổ đĩa này sẽ bị lỗi trong quá trình khởi động Windows (Màn hình xanh chết chóc), trừ khi bạn thay thế thủ công file 'WppRecorder.sys' của phiên bản 1803.\n\nCũng xin lưu ý rằng Rufus không thể tự động sửa lỗi này vì file 'WppRecorder.sys' thuộc bản quyền của Microsoft, vì vậy chúng tôi không thể nhúng file này vào chương trình..." t MSG_134 "Bởi vì MBR được chọn để định dạng phân vùng, Rufus chỉ có thể tạo phân vùng tới 2 TB cho ổ đĩa này, việc này sẽ bỏ phí %s không được sử dung.\n\nBạn có muốn tiếp tục?" t MSG_135 "Phiên bản" @@ -15912,8 +15912,8 @@ t MSG_156 "Mẫu thử: 0x%02X, 0x%02X, 0x%02X, 0x%02X" t MSG_157 "Đặt loại hệ thống tập tin" t MSG_158 "Kích thước tối thiểu của khối dữ liệu sẽ chiếm dụng trong hệ thống tập tin" t MSG_159 "Dùng trường này để đặt tên đĩa.\nCác ký tự quốc tế được chấp nhận." -t MSG_160 "Bật/tắt tuỳ chọn nâng cao" -t MSG_161 "Kiểm tra khối hỏng bằng mẫu thử" +t MSG_160 "Bật/tắt các tuỳ chọn nâng cao" +t MSG_161 "Kiểm tra thiết bị tìm khối lỗi bằng mẫu kiểm tra" t MSG_162 "Bỏ chọn mục này để dùng cách định dạng \"chậm\"" t MSG_163 "Cách thức để tạo phân vùng" t MSG_164 "Cách thức để tạo ổ đĩa có thể khởi động" @@ -15921,13 +15921,13 @@ t MSG_165 "Nhấn để chọn hoặc tải file ảnh..." t MSG_166 "Chọn mục này để cho phép hiện tên ổ đĩa toàn hệ thống và đặt biểu tượng thiết bị (khởi tạo autorun.inf)" t MSG_167 "Cài đặt bộ khởi động UEFI, cùng với việc tiến trình xác thực MD5Sum của phương tiện" t MSG_169 "Tạo một phân vùng ẩn khác và thử sắp xếp ranh giới phân vùng.\nĐiều này có thể cải thiện khả năng phát hiện khởi động cho BIOS cũ." -t MSG_170 "Kích hoạt liệt kê ổ cứng USB trong máy. DÙNG CẨN TRỌNG!!!" +t MSG_170 "Bật hiển thị các ổ cứng gắn ngoài qua USB. TỰ CHỊU RỦI RO KHI SỬ DỤNG!!!" t MSG_171 "Bắt đầu hoạt động định dạng.\nViệc này sẽ TIÊU HUỶ mọi dữ liệu trên đĩa đã chọn!" t MSG_172 "Chữ kí tải xuống không hợp lệ" t MSG_173 "Nhấn để chọn..." t MSG_174 "Rufus - Tiện ích Định dạng USB Đáng tin cậy" t MSG_175 "Phiên bản %d.%d (Bản dựng %d)" -t MSG_176 "Bản dịch tiếng Việt:\\line• thanhtai2009 <mailto:thanhtai2009@outlook.com>\\line• caobach <mailto:caobach@gmail.com>\\line• VNSpringRice <mailto:admin@quangminh.name.vn>" +t MSG_176 "Bản dịch Tiếng Việt:\\line• thanhtai2009 <mailto:thanhtai2009@outlook.com>\\line• caobach <mailto:caobach@gmail.com>\\line• Nguyễn Quang Minh (MinhNQ101) <mailto:admin@quangminh.name.vn>" t MSG_177 "Báo lỗi hoặc yêu cầu cải tiến tại:" t MSG_178 "Các bản quyền bổ sung:" t MSG_179 "Chính sách cập nhật:" @@ -16030,15 +16030,15 @@ t MSG_276 "Ghi với chế độ %s (Khuyến cáo)" t MSG_277 "Ghi với chế độ %s" t MSG_278 "Đang kiểm tra các tiến trình xung đột..." t MSG_279 "Không có khả năng khởi động" -t MSG_280 "Đĩa hoặc tệp tin" +t MSG_280 "Đĩa hoặc tệp tin ISO" t MSG_281 "%s (Vui lòng chọn)" -t MSG_282 "Khoá ổ USB đặc biệt" +t MSG_282 "Chặn truy cập ổ USB từ chương trình khác" t MSG_283 "Chữ ký không hợp lệ" t MSG_284 "Tập tin thực thi đã tải xuống thiếu chữ ký số." t MSG_285 "Tập tin thực thi đã tải xuống được ký bởi '%s'.\nĐây không phải chữ ký số chúng tôi công nhận và có thể xác định là một dạng hoạt động nguy hiểm...\nBạn chắc muốn chạy tập tin này?" t MSG_286 "Đang ghi đè giá trị 0 lên ổ: %s" t MSG_287 "Phát hiện ổ đĩa tháo được không phải USB" -t MSG_288 "Thiếu đặc quyền" +t MSG_288 "Thiếu quyền quản trị" t MSG_289 "Ứng dụng này chỉ có thể chạy với đặc quyền quản trị" t MSG_290 "Lập chỉ mục tập tin" t MSG_291 "Chọn phiên bản" @@ -16075,16 +16075,15 @@ t MSG_321 "Hình ảnh bạn đã chọn là một ISOHybrid, nhưng những ng t MSG_322 "Không thể mở hoặc đọc '%s'" t MSG_325 "Đang áp dụng tuỳ biến Windows: %s" t MSG_326 "Đang áp dụng các cài đặt người dùng..." -t MSG_327 "Trải nghiệm người dùng Windows" t MSG_328 "Tuỳ biến cài đặt Windows?" t MSG_329 "Loại bỏ yêu cầu 4GB+ RAM, Secure Boot và TPM 2.0" t MSG_330 "Loại bỏ yêu cầu tài khoản Microsoft trực tuyến" t MSG_331 "Loại bỏ thu thập thông tin (Bỏ qua các câu hỏi riêng tư)" t MSG_332 "Ngăn cản Windows To Go truy cập ổ đĩa trong" -t MSG_333 "Tạo tài khoản nội bộ với tên:" +t MSG_333 "Tạo tài khoản nội bộ với tên người dùng:" t MSG_334 "Đặt các cài đặt địa phương cùng giá trị với người dùng hiện tại" t MSG_335 "Vô hiệu tự động mã hoá thiết bị BitLocker" -t MSG_336 "Nhật ký" +t MSG_336 "Nhật ký lưu vĩnh viễn" t MSG_337 "Một tệp tin bổ sung ('diskcopy.dll') phải được tải về từ Microsoft để cài đặt MS-DOS:\n- Chọn 'Có' để kết nối tới Internet và tải nó xuống\n- Chọn 'Không' để huỷ tiến trình\n\nGhi chú: Tệp tin sẽ được tải xuống tại đường dẫn của phần mềm và sẽ được tự động tái sử dụng nếu có sẵn." t MSG_338 "Đã phát hiện bộ khởi động UEFI bị thu hồi" t MSG_339 "Rufus đã phát hiện ra rằng tệp ISO bạn đã chọn có chứa một bộ khởi động UEFI đã bị thu hồi và nó sẽ tạo ra %s, khi Secure Boot được kích hoạt trên một hệ thống UEFI được cập nhật đầy đủ và mới nhất.\n\n- Nếu bạn sở hữu tệp ISO này từ một nguồn không đáng tin cậy, bạn nên cân nhắc khả năng có thể chứa mã độc UEFI và tránh khởi động từ nó.\n- Nếu bạn sở hữu từ một nguồn uy tín, bạn nên thử tìm một bản mới hơn, theo đó cảnh báo này sẽ không hiện ra." @@ -16093,12 +16092,17 @@ t MSG_341 "một Màn hình Khôi phục Windows (BSOD) với '%s'" t MSG_342 "Tệp VHDX đã nén" t MSG_343 "Tệp VHD chưa nén" t MSG_344 "Ghi Đầy đủ Tệp Cập nhật" -t MSG_345 "Một vài dữ lieu phải được tải xuống từ Microsoft để sử dụng tính năng này:\n- Chọn 'Có' để kết nối tới Internet và tải xuống nó\n- Chọn 'Không' để huỷ tiến trình" +t MSG_345 "Một vài dữ liệu phải được tải xuống từ Microsoft để sử dụng tính năng này:\n- Chọn 'Có' để kết nối tới Internet và tải xuống nó\n- Chọn 'Không' để huỷ tiến trình" t MSG_346 "Giới hạn Windows vào S-Mode (KHÔNG TƯƠNG THÍCH với việc bỏ qua tài khoản trực tuyến)" t MSG_347 "Chế độ Chuyên nghiệp" t MSG_348 "Đang giải nén tệp lưu trữ: %s" t MSG_349 "Sử dụng Rufus MBR" -t MSG_900 "Rufus là một tiện ích giúp định dạng và tạo khả năng khởi động cho USB, chẳng hạn như thẻ USB/đĩa di động, thẻ nhớ, vv." +t MSG_350 "Sử dụng bootloader đã được ký bởi chứng chỉ “Windows UEFI CA 2023” (TÍNH NĂNG THỬ NGHIỆM)" +t MSG_351 "Đang kiểm tra trạng thái thu hồi của bootloader UEFI..." +t MSG_352 "Đang kiểm tra cập nhật cơ sở dữ liệu chặn (DBX) của UEFI…" +t MSG_353 "Đã phát hiện bản cập nhật DBX của UEFI" +t MSG_354 "Rufus đã phát hiện phiên bản cập nhật của các tệp DBX, được dùng để kiểm tra thu hồi Secure Boot trong UEFI. Bạn có muốn tải bản cập nhật này không?\n- Chọn “Có” để kết nối Internet và tải nội dung này.\n- Chọn “Không” để hủy thao tác.\n\nLưu ý: Các tệp sẽ được tải về thư mục của ứng dụng và sẽ tự động được sử dụng lại nếu đã có sẵn." +t MSG_900 "Rufus là một tiện ích giúp định dạng và tạo khả năng khởi động cho các thiết bị USB, ví dụ như thẻ USB/đĩa di động, thẻ nhớ, v.v..." t MSG_901 "Trang web chính thức: %s" t MSG_902 "Mã nguồn: %s" t MSG_903 "Nhật ký thay đổi: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 84a87a43..382af4eb 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.10.2260" +CAPTION "Rufus 4.10.2261" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2260,0 - PRODUCTVERSION 4,10,2260,0 + FILEVERSION 4,10,2261,0 + PRODUCTVERSION 4,10,2261,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2260" + VALUE "FileVersion", "4.10.2261" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2260" + VALUE "ProductVersion", "4.10.2261" END END BLOCK "VarFileInfo" From a8901f5e584c11e84f71c90bf2518d585f8952ce Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 27 Jun 2025 15:28:29 +0100 Subject: [PATCH 071/192] [core] switch to jserv/cregex for the regexp parser * We need group support for group matches and tiny-regex-c doesn't support them. --- .vs/rufus.vcxproj | 6 +- .vs/rufus.vcxproj.filters | 18 +- src/Makefile.am | 4 +- src/Makefile.in | 27 +- src/cregex.h | 140 ++++++++++ src/cregex_compile.c | 322 +++++++++++++++++++++++ src/cregex_parse.c | 286 ++++++++++++++++++++ src/cregex_vm.c | 211 +++++++++++++++ src/format.c | 2 +- src/license.h | 6 +- src/re.c | 532 -------------------------------------- src/re.h | 65 ----- src/rufus.c | 22 +- src/rufus.h | 4 +- src/rufus.rc | 10 +- src/stdfn.c | 53 ++-- src/vhd.c | 4 +- 17 files changed, 1055 insertions(+), 657 deletions(-) create mode 100644 src/cregex.h create mode 100644 src/cregex_compile.c create mode 100644 src/cregex_parse.c create mode 100644 src/cregex_vm.c delete mode 100644 src/re.c delete mode 100644 src/re.h diff --git a/.vs/rufus.vcxproj b/.vs/rufus.vcxproj index e705de77..843705b4 100644 --- a/.vs/rufus.vcxproj +++ b/.vs/rufus.vcxproj @@ -385,6 +385,9 @@ </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\src\badblocks.c" /> + <ClCompile Include="..\src\cregex_compile.c" /> + <ClCompile Include="..\src\cregex_parse.c" /> + <ClCompile Include="..\src\cregex_vm.c" /> <ClCompile Include="..\src\darkmode.c" /> <ClCompile Include="..\src\dos_locale.c" /> <ClCompile Include="..\src\drive.c" /> @@ -399,7 +402,6 @@ <ClCompile Include="..\src\parser.c" /> <ClCompile Include="..\src\pki.c" /> <ClCompile Include="..\src\process.c" /> - <ClCompile Include="..\src\re.c" /> <ClCompile Include="..\src\rufus.c" /> <ClCompile Include="..\src\hash.c" /> <ClCompile Include="..\src\smart.c" /> @@ -419,6 +421,7 @@ <ClInclude Include="..\res\grub\grub_version.h" /> <ClInclude Include="..\src\badblocks.h" /> <ClInclude Include="..\src\bled\bled.h" /> + <ClInclude Include="..\src\cregex.h" /> <ClInclude Include="..\src\darkmode.h" /> <ClInclude Include="..\src\drive.h" /> <ClInclude Include="..\src\efi.h" /> @@ -429,7 +432,6 @@ <ClInclude Include="..\src\missing.h" /> <ClInclude Include="..\src\msvc-missing\unistd.h" /> <ClInclude Include="..\src\ntdll.h" /> - <ClInclude Include="..\src\re.h" /> <ClInclude Include="..\src\settings.h" /> <ClInclude Include="..\src\libcdio\cdio\cdio.h" /> <ClInclude Include="..\src\libcdio\cdio\iso9660.h" /> diff --git a/.vs/rufus.vcxproj.filters b/.vs/rufus.vcxproj.filters index 3bdc3c22..c535ebd8 100644 --- a/.vs/rufus.vcxproj.filters +++ b/.vs/rufus.vcxproj.filters @@ -87,9 +87,6 @@ <ClCompile Include="..\src\format_fat32.c"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="..\src\re.c"> - <Filter>Source Files</Filter> - </ClCompile> <ClCompile Include="..\src\wue.c"> <Filter>Source Files</Filter> </ClCompile> @@ -99,6 +96,15 @@ <ClCompile Include="..\src\darkmode.c"> <Filter>Source Files</Filter> </ClCompile> + <ClCompile Include="..\src\cregex_compile.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\cregex_parse.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\src\cregex_vm.c"> + <Filter>Source Files</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\src\rufus.h"> @@ -182,9 +188,6 @@ <ClInclude Include="..\src\winio.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\src\re.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="..\res\grub\grub_version.h"> <Filter>Header Files</Filter> </ClInclude> @@ -212,6 +215,9 @@ <ClInclude Include="..\src\darkmode.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="..\src\cregex.h"> + <Filter>Header Files</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <None Include="..\res\rufus.ico"> diff --git a/src/Makefile.am b/src/Makefile.am index 6e772151..e88ea327 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,8 +15,8 @@ AM_V_WINDRES = $(AM_V_WINDRES_$(V)) %_rc.o: %.rc ../res/loc/embedded.loc $(AM_V_WINDRES) $(AM_RCFLAGS) -i $< -o $@ -rufus_SOURCES = badblocks.c darkmode.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ - localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c xml.c +rufus_SOURCES = badblocks.c darkmode.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c localization.c \ + net.c parser.c pki.c process.c cregex_compile.c cregex_parse.c cregex_vm.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c xml.c rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/wimlib -I$(srcdir)/../res $(AM_CFLAGS) \ -DEXT2_FLAT_INCLUDES=0 -D_RUFUS -DSOLUTION=rufus rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows -L../.mingw diff --git a/src/Makefile.in b/src/Makefile.in index b48d7e21..317b9d3a 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -95,7 +95,8 @@ am_rufus_OBJECTS = rufus-badblocks.$(OBJEXT) rufus-darkmode.$(OBJEXT) \ rufus-icon.$(OBJEXT) rufus-iso.$(OBJEXT) \ rufus-localization.$(OBJEXT) rufus-net.$(OBJEXT) \ rufus-parser.$(OBJEXT) rufus-pki.$(OBJEXT) \ - rufus-process.$(OBJEXT) rufus-re.$(OBJEXT) \ + rufus-process.$(OBJEXT) rufus-cregex_compile.$(OBJEXT) \ + rufus-cregex_parse.$(OBJEXT) rufus-cregex_vm.$(OBJEXT) \ rufus-rufus.$(OBJEXT) rufus-smart.$(OBJEXT) \ rufus-stdfn.$(OBJEXT) rufus-stdio.$(OBJEXT) \ rufus-stdlg.$(OBJEXT) rufus-syslinux.$(OBJEXT) \ @@ -284,8 +285,8 @@ AM_V_WINDRES_0 = @echo " RC $@";$(WINDRES) AM_V_WINDRES_1 = $(WINDRES) AM_V_WINDRES_ = $(AM_V_WINDRES_$(AM_DEFAULT_VERBOSITY)) AM_V_WINDRES = $(AM_V_WINDRES_$(V)) -rufus_SOURCES = badblocks.c darkmode.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c \ - localization.c net.c parser.c pki.c process.c re.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c xml.c +rufus_SOURCES = badblocks.c darkmode.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c localization.c \ + net.c parser.c pki.c process.c cregex_compile.c cregex_parse.c cregex_vm.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c xml.c rufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/wimlib -I$(srcdir)/../res $(AM_CFLAGS) \ -DEXT2_FLAT_INCLUDES=0 -D_RUFUS -DSOLUTION=rufus @@ -450,11 +451,23 @@ rufus-process.o: process.c rufus-process.obj: process.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-process.obj `if test -f 'process.c'; then $(CYGPATH_W) 'process.c'; else $(CYGPATH_W) '$(srcdir)/process.c'; fi` -rufus-re.o: re.c - $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-re.o `test -f 're.c' || echo '$(srcdir)/'`re.c +rufus-cregex_compile.o: cregex_compile.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-cregex_compile.o `test -f 'cregex_compile.c' || echo '$(srcdir)/'`cregex_compile.c -rufus-re.obj: re.c - $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-re.obj `if test -f 're.c'; then $(CYGPATH_W) 're.c'; else $(CYGPATH_W) '$(srcdir)/re.c'; fi` +rufus-cregex_compile.obj: cregex_compile.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-cregex_compile.obj `if test -f 'cregex_compile.c'; then $(CYGPATH_W) 'cregex_compile.c'; else $(CYGPATH_W) '$(srcdir)/cregex_compile.c'; fi` + +rufus-cregex_parse.o: cregex_parse.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-cregex_parse.o `test -f 'cregex_parse.c' || echo '$(srcdir)/'`cregex_parse.c + +rufus-cregex_parse.obj: cregex_parse.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-cregex_parse.obj `if test -f 'cregex_parse.c'; then $(CYGPATH_W) 'cregex_parse.c'; else $(CYGPATH_W) '$(srcdir)/cregex_parse.c'; fi` + +rufus-cregex_vm.o: cregex_vm.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-cregex_vm.o `test -f 'cregex_vm.c' || echo '$(srcdir)/'`cregex_vm.c + +rufus-cregex_vm.obj: cregex_vm.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-cregex_vm.obj `if test -f 'cregex_vm.c'; then $(CYGPATH_W) 'cregex_vm.c'; else $(CYGPATH_W) '$(srcdir)/cregex_vm.c'; fi` rufus-rufus.o: rufus.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-rufus.o `test -f 'rufus.c' || echo '$(srcdir)/'`rufus.c diff --git a/src/cregex.h b/src/cregex.h new file mode 100644 index 00000000..e6367812 --- /dev/null +++ b/src/cregex.h @@ -0,0 +1,140 @@ +#ifndef CREGEX_H +#define CREGEX_H + +#define REGEX_VM_MAX_MATCHES 64 + +typedef enum { + REGEX_NODE_TYPE_EPSILON = 0, + /* Characters */ + REGEX_NODE_TYPE_CHARACTER, + REGEX_NODE_TYPE_ANY_CHARACTER, + REGEX_NODE_TYPE_CHARACTER_CLASS, + REGEX_NODE_TYPE_CHARACTER_CLASS_NEGATED, + /* Composites */ + REGEX_NODE_TYPE_CONCATENATION, + REGEX_NODE_TYPE_ALTERNATION, + /* Quantifiers */ + REGEX_NODE_TYPE_QUANTIFIER, + /* Anchors */ + REGEX_NODE_TYPE_ANCHOR_BEGIN, + REGEX_NODE_TYPE_ANCHOR_END, + /* Captures */ + REGEX_NODE_TYPE_CAPTURE +} cregex_node_type; + +typedef struct cregex_node { + cregex_node_type type; + union { + /* REGEX_NODE_TYPE_CHARACTER */ + struct { + int ch; + }; + /* REGEX_NODE_TYPE_CHARACTER_CLASS, + * REGEX_NODE_TYPE_CHARACTER_CLASS_NEGATED + */ + struct { + const char *from, *to; + }; + /* REGEX_NODE_TYPE_QUANTIFIER */ + struct { + int nmin, nmax, greedy; + struct cregex_node *quantified; + }; + /* REGEX_NODE_TYPE_CONCATENATION, + * REGEX_NODE_TYPE_ALTERNATION + */ + struct { + struct cregex_node *left, *right; + }; + /* REGEX_NODE_TYPE_CAPTURE */ + struct { + struct cregex_node *captured; + }; + }; +} cregex_node_t; + +typedef enum { + REGEX_PROGRAM_OPCODE_MATCH = 0, + /* Characters */ + REGEX_PROGRAM_OPCODE_CHARACTER, + REGEX_PROGRAM_OPCODE_ANY_CHARACTER, + REGEX_PROGRAM_OPCODE_CHARACTER_CLASS, + REGEX_PROGRAM_OPCODE_CHARACTER_CLASS_NEGATED, + /* Control-flow */ + REGEX_PROGRAM_OPCODE_SPLIT, + REGEX_PROGRAM_OPCODE_JUMP, + /* Assertions */ + REGEX_PROGRAM_OPCODE_ASSERT_BEGIN, + REGEX_PROGRAM_OPCODE_ASSERT_END, + /* Saving */ + REGEX_PROGRAM_OPCODE_SAVE +} cregex_program_opcode_t; + +#include <limits.h> + +typedef char cregex_char_class[(UCHAR_MAX + CHAR_BIT - 1) / CHAR_BIT]; + +static inline int cregex_char_class_contains(const cregex_char_class klass, + int ch) +{ + return klass[ch / CHAR_BIT] & (1 << ch % CHAR_BIT); +} + +static inline int cregex_char_class_add(cregex_char_class klass, int ch) +{ + klass[ch / CHAR_BIT] |= 1 << (ch % CHAR_BIT); + return ch; +} + +typedef struct cregex_program_instr { + cregex_program_opcode_t opcode; + union { + /* REGEX_PROGRAM_OPCODE_CHARACTER */ + struct { + int ch; + }; + /* REGEX_PROGRAM_OPCODE_CHARACTER_CLASS, + * REGEX_PROGRAM_OPCODE_CHARACTER_CLASS_NEGATED + */ + struct { + cregex_char_class klass; + }; + /* REGEX_PROGRAM_OPCODE_SPLIT */ + struct { + struct cregex_program_instr *first, *second; + }; + /* REGEX_PROGRAM_OPCODE_JUMP */ + struct { + struct cregex_program_instr *target; + }; + /* REGEX_PROGRAM_OPCODE_SAVE */ + struct { + int save; + }; + }; +} cregex_program_instr_t; + +typedef struct { + int ninstructions; + cregex_program_instr_t instructions[]; +} cregex_program_t; + +/* Run program on string */ +int cregex_program_run(const cregex_program_t *program, + const char *string, + const char **matches, + int nmatches); + +/* Compile a parsed pattern */ +cregex_program_t *cregex_compile_node(const cregex_node_t *root); + +/* Free a compiled program */ +void cregex_compile_free(cregex_program_t *program); + +/* Parse a pattern */ +cregex_node_t *cregex_parse(const char *pattern); + +/* Free a parsed pattern */ +void cregex_parse_free(cregex_node_t *root); + +#endif diff --git a/src/cregex_compile.c b/src/cregex_compile.c new file mode 100644 index 00000000..f2b30480 --- /dev/null +++ b/src/cregex_compile.c @@ -0,0 +1,322 @@ +#include <stdbool.h> +#include <stdlib.h> + +#include "cregex.h" + +typedef struct { + cregex_program_instr_t *pc; + int ncaptures; +} regex_compile_context; + +static int count_instructions(const cregex_node_t *node) +{ + switch (node->type) { + case REGEX_NODE_TYPE_EPSILON: + return 0; + + /* Characters */ + case REGEX_NODE_TYPE_CHARACTER: + case REGEX_NODE_TYPE_ANY_CHARACTER: + case REGEX_NODE_TYPE_CHARACTER_CLASS: + case REGEX_NODE_TYPE_CHARACTER_CLASS_NEGATED: + return 1; + + /* Composites */ + case REGEX_NODE_TYPE_CONCATENATION: + return count_instructions(node->left) + count_instructions(node->right); + case REGEX_NODE_TYPE_ALTERNATION: + return 2 + count_instructions(node->left) + + count_instructions(node->right); + + /* Quantifiers */ + case REGEX_NODE_TYPE_QUANTIFIER: { + int num = count_instructions(node->quantified); + if (node->nmax >= node->nmin) + return node->nmin * num + (node->nmax - node->nmin) * (num + 1); + return 1 + (node->nmin ? node->nmin * num : num + 1); + } + + /* Anchors */ + case REGEX_NODE_TYPE_ANCHOR_BEGIN: + case REGEX_NODE_TYPE_ANCHOR_END: + return 1; + + /* Captures */ + case REGEX_NODE_TYPE_CAPTURE: + return 2 + count_instructions(node->captured); + } + + /* should not reach here */ + return 0; +} + +static bool node_is_anchored(const cregex_node_t *node) +{ + switch (node->type) { + case REGEX_NODE_TYPE_EPSILON: + return false; + + /* Characters */ + case REGEX_NODE_TYPE_CHARACTER: + case REGEX_NODE_TYPE_ANY_CHARACTER: + case REGEX_NODE_TYPE_CHARACTER_CLASS: + case REGEX_NODE_TYPE_CHARACTER_CLASS_NEGATED: + return false; + + /* Composites */ + case REGEX_NODE_TYPE_CONCATENATION: + return node_is_anchored(node->left); + case REGEX_NODE_TYPE_ALTERNATION: + return node_is_anchored(node->left) && node_is_anchored(node->right); + + /* Quantifiers */ + case REGEX_NODE_TYPE_QUANTIFIER: + return node_is_anchored(node->quantified); + + /* Anchors */ + case REGEX_NODE_TYPE_ANCHOR_BEGIN: + return true; + case REGEX_NODE_TYPE_ANCHOR_END: + return false; + + /* Captures */ + case REGEX_NODE_TYPE_CAPTURE: + return node_is_anchored(node->captured); + } + + /* should not reach here */ + return false; +} + +static inline cregex_program_instr_t *emit( + regex_compile_context *context, + const cregex_program_instr_t *instruction) +{ + *context->pc = *instruction; + return context->pc++; +} + +static cregex_program_instr_t *compile_char_class( + const cregex_node_t *node, + cregex_program_instr_t *instruction) +{ + const char *sp = node->from; + + for (;;) { + int ch = *sp++; + switch (ch) { + case ']': + if (sp - 1 == node->from) + goto CHARACTER; + return instruction; + case '\\': + ch = *sp++; + /* fall-through */ + default: + CHARACTER: + if (*sp == '-' && sp[1] != ']') { + for (; ch <= sp[1]; ++ch) + cregex_char_class_add(instruction->klass, ch); + sp += 2; + } else { + cregex_char_class_add(instruction->klass, ch); + } + break; + } + } +} + +static cregex_program_instr_t *compile_context(regex_compile_context *context, + const cregex_node_t *node) +{ + cregex_program_instr_t *bottom = context->pc, *split, *jump; + int ncaptures = context->ncaptures, capture; + + switch (node->type) { + case REGEX_NODE_TYPE_EPSILON: + break; + + /* Characters */ + case REGEX_NODE_TYPE_CHARACTER: + emit(context, + &(cregex_program_instr_t){.opcode = REGEX_PROGRAM_OPCODE_CHARACTER, + .ch = node->ch}); + break; + case REGEX_NODE_TYPE_ANY_CHARACTER: + emit(context, &(cregex_program_instr_t){ + .opcode = REGEX_PROGRAM_OPCODE_ANY_CHARACTER}); + break; + case REGEX_NODE_TYPE_CHARACTER_CLASS: + compile_char_class( + node, + emit(context, &(cregex_program_instr_t){ + .opcode = REGEX_PROGRAM_OPCODE_CHARACTER_CLASS})); + break; + case REGEX_NODE_TYPE_CHARACTER_CLASS_NEGATED: + compile_char_class( + node, + emit(context, + &(cregex_program_instr_t){ + .opcode = REGEX_PROGRAM_OPCODE_CHARACTER_CLASS_NEGATED})); + break; + + /* Composites */ + case REGEX_NODE_TYPE_CONCATENATION: + compile_context(context, node->left); + compile_context(context, node->right); + break; + case REGEX_NODE_TYPE_ALTERNATION: + split = emit(context, &(cregex_program_instr_t){ + .opcode = REGEX_PROGRAM_OPCODE_SPLIT}); + split->first = compile_context(context, node->left); + jump = emit(context, &(cregex_program_instr_t){ + .opcode = REGEX_PROGRAM_OPCODE_JUMP}); + split->second = compile_context(context, node->right); + jump->target = context->pc; + break; + + /* Quantifiers */ + case REGEX_NODE_TYPE_QUANTIFIER: { + cregex_program_instr_t *last = NULL; + for (int i = 0; i < node->nmin; ++i) { + context->ncaptures = ncaptures; + last = compile_context(context, node->quantified); + } + if (node->nmax > node->nmin) { + for (int i = 0; i < node->nmax - node->nmin; ++i) { + context->ncaptures = ncaptures; + split = + emit(context, &(cregex_program_instr_t){ + .opcode = REGEX_PROGRAM_OPCODE_SPLIT}); + split->first = compile_context(context, node->quantified); + split->second = context->pc; + if (!node->greedy) { + cregex_program_instr_t *swap = split->first; + split->first = split->second; + split->second = swap; + } + } + } else if (node->nmax == -1) { + split = emit(context, &(cregex_program_instr_t){ + .opcode = REGEX_PROGRAM_OPCODE_SPLIT}); + if (node->nmin == 0) { + split->first = compile_context(context, node->quantified); + jump = emit(context, &(cregex_program_instr_t){ + .opcode = REGEX_PROGRAM_OPCODE_JUMP}); + split->second = context->pc; + jump->target = split; + } else { + split->first = last; + split->second = context->pc; + } + if (!node->greedy) { + cregex_program_instr_t *swap = split->first; + split->first = split->second; + split->second = swap; + } + } + break; + } + + /* Anchors */ + case REGEX_NODE_TYPE_ANCHOR_BEGIN: + emit(context, &(cregex_program_instr_t){ + .opcode = REGEX_PROGRAM_OPCODE_ASSERT_BEGIN}); + break; + case REGEX_NODE_TYPE_ANCHOR_END: + emit(context, &(cregex_program_instr_t){ + .opcode = REGEX_PROGRAM_OPCODE_ASSERT_END}); + break; + + /* Captures */ + case REGEX_NODE_TYPE_CAPTURE: + capture = context->ncaptures++ * 2; + emit(context, + &(cregex_program_instr_t){.opcode = REGEX_PROGRAM_OPCODE_SAVE, + .save = capture}); + compile_context(context, node->captured); + emit(context, + &(cregex_program_instr_t){.opcode = REGEX_PROGRAM_OPCODE_SAVE, + .save = capture + 1}); + break; + } + + return bottom; +} + +/* Compile a parsed pattern (using a previously allocated program with at least + * estimate_instructions(root) instructions). + */ +static cregex_program_t *compile_node_with_program(const cregex_node_t *root, + cregex_program_t *program) +{ + /* Silence a MinGW warning about dangling pointers */ + static cregex_node_t* _root; + /* add capture node for entire match */ + root = &(cregex_node_t){.type = REGEX_NODE_TYPE_CAPTURE, + .captured = (cregex_node_t *) root}; + + /* add .*? unless pattern starts with ^ */ + if (!node_is_anchored(root)) { + _root = &(cregex_node_t){ + .type = REGEX_NODE_TYPE_CONCATENATION, + .left = + &(cregex_node_t){ + .type = REGEX_NODE_TYPE_QUANTIFIER, + .nmin = 0, + .nmax = -1, + .greedy = 0, + .quantified = &( + cregex_node_t){.type = REGEX_NODE_TYPE_ANY_CHARACTER}}, + .right = (cregex_node_t *) root}; + root = _root; + } + + /* compile */ + regex_compile_context *context = + &(regex_compile_context){.pc = program->instructions, .ncaptures = 0}; + compile_context(context, root); + + /* emit final match instruction */ + emit(context, + &(cregex_program_instr_t){.opcode = REGEX_PROGRAM_OPCODE_MATCH}); + + /* set total number of instructions */ + program->ninstructions = (int)(context->pc - program->instructions); + + return program; +} + +/* Upper bound of number of instructions required to compile parsed pattern. */ +static int estimate_instructions(const cregex_node_t *root) +{ + return count_instructions(root) + /* .*? is added unless pattern starts with ^, + * save instructions are added for beginning and end of match, + * a final match instruction is added to the end of the program + */ + + !node_is_anchored(root) * 3 + 2 + 1; +} + +cregex_program_t *cregex_compile_node(const cregex_node_t *root) +{ + size_t size = sizeof(cregex_program_t) + + sizeof(cregex_program_instr_t) * estimate_instructions(root); + cregex_program_t *program; + + if (!(program = malloc(size))) + return NULL; + + if (!compile_node_with_program(root, program)) { + free(program); + return NULL; + } + + return program; +} + +/* Free a compiled program */ +void cregex_compile_free(cregex_program_t *program) +{ + free(program); +} diff --git a/src/cregex_parse.c b/src/cregex_parse.c new file mode 100644 index 00000000..b2a5b7ae --- /dev/null +++ b/src/cregex_parse.c @@ -0,0 +1,286 @@ +#include <assert.h> +#include <stdlib.h> +#include <string.h> + +#include "cregex.h" + +typedef struct { + const char *sp; + cregex_node_t *stack, *output; +} regex_parse_context; + +/* Shunting-yard algorithm + * See https://en.wikipedia.org/wiki/Shunting-yard_algorithm + */ + +static inline cregex_node_t *push(regex_parse_context *context, + const cregex_node_t *node) +{ + assert(context->stack <= context->output); + *context->stack = *node; + return context->stack++; +} + +static inline cregex_node_t *drop(regex_parse_context *context) +{ + return --context->stack; +} + +static inline cregex_node_t *consume(regex_parse_context *context) +{ + *--context->output = *--context->stack; + return context->output; +} + +static inline cregex_node_t *concatenate(regex_parse_context *context, + const cregex_node_t *bottom) +{ + if (context->stack == bottom) + push(context, &(cregex_node_t){.type = REGEX_NODE_TYPE_EPSILON}); + else { + while (context->stack - 1 > bottom) { + cregex_node_t *right = consume(context); + cregex_node_t *left = consume(context); + push(context, + &(cregex_node_t){.type = REGEX_NODE_TYPE_CONCATENATION, + .left = left, + .right = right}); + } + } + return context->stack - 1; +} + +static cregex_node_t *parse_char_class(regex_parse_context *context) +{ + cregex_node_type type = + (*context->sp == '^') + ? (++context->sp, REGEX_NODE_TYPE_CHARACTER_CLASS_NEGATED) + : REGEX_NODE_TYPE_CHARACTER_CLASS; + const char *from = context->sp; + + for (;;) { + int ch = *context->sp++; + switch (ch) { + case '\0': + /* premature end of character class */ + return NULL; + case ']': + if (context->sp - 1 == from) + goto CHARACTER; + return push(context, + &(cregex_node_t){ + .type = type, .from = from, .to = context->sp - 1}); + case '\\': + ch = *context->sp++; + /* fall-through */ + default: + CHARACTER: + if (*context->sp == '-' && context->sp[1] != ']') { + if (context->sp[1] < ch) + /* empty range in character class */ + return NULL; + context->sp += 2; + } + break; + } + } +} + +static cregex_node_t *parse_interval(regex_parse_context *context) +{ + const char *from = context->sp; + int nmin, nmax; + + for (nmin = 0; *context->sp >= '0' && *context->sp <= '9'; ++context->sp) + nmin = (nmin * 10) + (*context->sp - '0'); + + if (*context->sp == ',') { + ++context->sp; + if (*from != ',' && *context->sp == '}') + nmax = -1; + else { + for (nmax = 0; *context->sp >= '0' && *context->sp <= '9'; + ++context->sp) + nmax = (nmax * 10) + (*context->sp - '0'); + if (*(context->sp - 1) == ',' || *context->sp != '}' || + nmax < nmin) { + context->sp = from; + return NULL; + } + } + } else if (*from != '}' && *context->sp == '}') { + nmax = nmin; + } else { + context->sp = from; + return NULL; + } + + ++context->sp; + return push(context, + &(cregex_node_t){ + .type = REGEX_NODE_TYPE_QUANTIFIER, + .nmin = nmin, + .nmax = nmax, + .greedy = (*context->sp == '?') ? (++context->sp, 0) : 1, + .quantified = consume(context)}); +} + +static cregex_node_t *parse_context(regex_parse_context *context, int depth) +{ + cregex_node_t *bottom = context->stack; + + for (;;) { + int ch = *context->sp++; + switch (ch) { + /* Characters */ + case '\\': + ch = *context->sp++; + /* fall-through */ + default: + CHARACTER: + push(context, + &(cregex_node_t){.type = REGEX_NODE_TYPE_CHARACTER, .ch = ch}); + break; + case '.': + push(context, + &(cregex_node_t){.type = REGEX_NODE_TYPE_ANY_CHARACTER}); + break; + case '[': + if (!parse_char_class(context)) + return NULL; + break; + + /* Composites */ + case '|': { + cregex_node_t *left = concatenate(context, bottom), *right; + if (!(right = parse_context(context, depth))) + return NULL; + if (left->type == REGEX_NODE_TYPE_EPSILON && + right->type == left->type) { + drop(context); + } else if (left->type == REGEX_NODE_TYPE_EPSILON) { + right = consume(context); + drop(context); + push(context, + &(cregex_node_t){.type = REGEX_NODE_TYPE_QUANTIFIER, + .nmin = 0, + .nmax = 1, + .greedy = 1, + .quantified = right}); + } else if (right->type == REGEX_NODE_TYPE_EPSILON) { + drop(context); + left = consume(context); + push(context, + &(cregex_node_t){.type = REGEX_NODE_TYPE_QUANTIFIER, + .nmin = 0, + .nmax = 1, + .greedy = 1, + .quantified = left}); + } else { + right = consume(context); + left = consume(context); + push(context, + &(cregex_node_t){.type = REGEX_NODE_TYPE_ALTERNATION, + .left = left, + .right = right}); + } + return bottom; + } + +#define QUANTIFIER(ch, min, max) \ + case ch: \ + if (context->stack == bottom) \ + goto CHARACTER; \ + push(context, \ + &(cregex_node_t){ \ + .type = REGEX_NODE_TYPE_QUANTIFIER, \ + .nmin = min, \ + .nmax = max, \ + .greedy = (*context->sp == '?') ? (++context->sp, 0) : 1, \ + .quantified = consume(context)}); \ + break + + /* clang-format off */ + /* Quantifiers */ + QUANTIFIER('?', 0, 1); + QUANTIFIER('*', 0, -1); + QUANTIFIER('+', 1, -1); + /* clang-format on */ +#undef QUANTIFIER + + case '{': + if ((context->stack == bottom) || !parse_interval(context)) + goto CHARACTER; + break; + + /* Anchors */ + case '^': + push(context, + &(cregex_node_t){.type = REGEX_NODE_TYPE_ANCHOR_BEGIN}); + break; + case '$': + push(context, &(cregex_node_t){.type = REGEX_NODE_TYPE_ANCHOR_END}); + break; + + /* Captures */ + case '(': + if (!parse_context(context, depth + 1)) + return NULL; + push(context, &(cregex_node_t){.type = REGEX_NODE_TYPE_CAPTURE, + .captured = consume(context)}); + break; + case ')': + if (depth > 0) + return concatenate(context, bottom); + /* unmatched close parenthesis */ + return NULL; + + /* End of string */ + case '\0': + if (depth == 0) + return concatenate(context, bottom); + /* unmatched open parenthesis */ + return NULL; + } + } +} + +static inline int estimate_nodes(const char *pattern) +{ + return (int)strlen(pattern) * 2; +} + +/* Parse a pattern (using a previously allocated buffer of at least + * estimate_nodes(pattern) nodes). + */ +static cregex_node_t *parse_with_nodes(const char *pattern, + cregex_node_t *nodes) +{ + regex_parse_context *context = + &(regex_parse_context){.sp = pattern, + .stack = nodes, + .output = nodes + estimate_nodes(pattern)}; + return parse_context(context, 0); +} + +cregex_node_t *cregex_parse(const char *pattern) +{ + size_t size = sizeof(cregex_node_t) * estimate_nodes(pattern); + cregex_node_t* nodes; + + nodes = malloc(size); + if (!nodes) + return NULL; + + if (!parse_with_nodes(pattern, nodes)) { + free(nodes); + return NULL; + } + + return nodes; +} + +void cregex_parse_free(cregex_node_t *root) +{ + free(root); +} diff --git a/src/cregex_vm.c b/src/cregex_vm.c new file mode 100644 index 00000000..79220172 --- /dev/null +++ b/src/cregex_vm.c @@ -0,0 +1,211 @@ +#include <stdlib.h> +#include <string.h> + +#include "cregex.h" + +/* The VM executes one or more threads, each running a regular expression + * program, which is just a list of regular expression instructions. Each + * thread maintains two registers while it runs: a program counter (PC) and + * a string pointer (SP). + */ +typedef struct { + int visited; + const cregex_program_instr_t *pc; + const char *matches[REGEX_VM_MAX_MATCHES]; +} vm_thread; + +/* Run program on string */ +static int vm_run(const cregex_program_t *program, + const char *string, + const char **matches, + int nmatches); + +/* Run program on string (using a previously allocated buffer of at least + * vm_estimate_threads(program) threads) + */ +static int vm_run_with_threads(const cregex_program_t *program, + const char *string, + const char **matches, + int nmatches, + vm_thread *threads); + +typedef struct { + int nthreads; + vm_thread *threads; +} vm_thread_list; + +static void vm_add_thread(vm_thread_list *list, + const cregex_program_t *program, + const cregex_program_instr_t *pc, + const char *string, + const char *sp, + const char **matches, + int nmatches) +{ + if (list->threads[pc - program->instructions].visited == sp - string + 1) + return; + list->threads[pc - program->instructions].visited = (int)(sp - string + 1); + + switch (pc->opcode) { + case REGEX_PROGRAM_OPCODE_MATCH: + /* fall-through */ + + /* Characters */ + case REGEX_PROGRAM_OPCODE_CHARACTER: + case REGEX_PROGRAM_OPCODE_ANY_CHARACTER: + case REGEX_PROGRAM_OPCODE_CHARACTER_CLASS: + case REGEX_PROGRAM_OPCODE_CHARACTER_CLASS_NEGATED: + list->threads[list->nthreads].pc = pc; + memcpy((void*)list->threads[list->nthreads].matches, matches, + sizeof(matches[0]) * ((nmatches <= REGEX_VM_MAX_MATCHES) + ? nmatches + : REGEX_VM_MAX_MATCHES)); + ++list->nthreads; + break; + + /* Control-flow */ + case REGEX_PROGRAM_OPCODE_SPLIT: + vm_add_thread(list, program, pc->first, string, sp, matches, nmatches); + vm_add_thread(list, program, pc->second, string, sp, matches, nmatches); + break; + case REGEX_PROGRAM_OPCODE_JUMP: + vm_add_thread(list, program, pc->target, string, sp, matches, nmatches); + break; + + /* Assertions */ + case REGEX_PROGRAM_OPCODE_ASSERT_BEGIN: + if (sp == string) + vm_add_thread(list, program, pc + 1, string, sp, matches, nmatches); + break; + case REGEX_PROGRAM_OPCODE_ASSERT_END: + if (!*sp) + vm_add_thread(list, program, pc + 1, string, sp, matches, nmatches); + break; + + /* Saving */ + case REGEX_PROGRAM_OPCODE_SAVE: + if (pc->save < nmatches && pc->save < REGEX_VM_MAX_MATCHES) { + const char *saved = matches[pc->save]; + matches[pc->save] = sp; + vm_add_thread(list, program, pc + 1, string, sp, matches, nmatches); + matches[pc->save] = saved; + } else { + vm_add_thread(list, program, pc + 1, string, sp, matches, nmatches); + } + break; + } +} + +/* Upper bound of number of threads required to run program */ +static int vm_estimate_threads(const cregex_program_t *program) +{ + return program->ninstructions * 2; +} + +static int vm_run(const cregex_program_t *program, + const char *string, + const char **matches, + int nmatches) +{ + size_t size = sizeof(vm_thread) * vm_estimate_threads(program); + vm_thread *threads; + int matched; + + if (!(threads = malloc(size))) + return -1; + + matched = vm_run_with_threads(program, string, matches, nmatches, threads); + free(threads); + return matched; +} + +static int vm_run_with_threads(const cregex_program_t *program, + const char *string, + const char **matches, + int nmatches, + vm_thread *threads) +{ + vm_thread_list *current = + &(vm_thread_list){.nthreads = 0, .threads = threads}; + vm_thread_list *next = &(vm_thread_list){ + .nthreads = 0, .threads = threads + program->ninstructions}; + int matched = 0; + + memset(matches, 0, sizeof(char*) * nmatches); + memset(threads, 0, sizeof(vm_thread) * program->ninstructions * 2); + + vm_add_thread(current, program, program->instructions, string, string, + matches, nmatches); + + for (const char *sp = string;; ++sp) { + for (int i = 0; i < current->nthreads; ++i) { + vm_thread *thread = current->threads + i; + switch (thread->pc->opcode) { + case REGEX_PROGRAM_OPCODE_MATCH: + matched = 1; + current->nthreads = 0; + memcpy(matches, thread->matches, + sizeof(matches[0]) * ((nmatches <= REGEX_VM_MAX_MATCHES) + ? nmatches + : REGEX_VM_MAX_MATCHES)); + continue; + + /* Characters */ + case REGEX_PROGRAM_OPCODE_CHARACTER: + if (*sp == thread->pc->ch) + break; + continue; + case REGEX_PROGRAM_OPCODE_ANY_CHARACTER: + if (*sp) + break; + continue; + case REGEX_PROGRAM_OPCODE_CHARACTER_CLASS: + if (cregex_char_class_contains(thread->pc->klass, *sp)) + break; + continue; + case REGEX_PROGRAM_OPCODE_CHARACTER_CLASS_NEGATED: + if (!cregex_char_class_contains(thread->pc->klass, *sp)) + break; + continue; + + /* Control-flow */ + case REGEX_PROGRAM_OPCODE_SPLIT: + case REGEX_PROGRAM_OPCODE_JUMP: + /* fall-through */ + + /* Assertions */ + case REGEX_PROGRAM_OPCODE_ASSERT_BEGIN: + case REGEX_PROGRAM_OPCODE_ASSERT_END: + /* fall-through */ + + /* Saving */ + case REGEX_PROGRAM_OPCODE_SAVE: + /* handled in vm_add_thread() */ + abort(); + } + + vm_add_thread(next, program, thread->pc + 1, string, sp + 1, + thread->matches, nmatches); + } + + /* swap current and next thread list */ + vm_thread_list *swap = current; + current = next; + next = swap; + next->nthreads = 0; + + /* done if no more threads are running or end of string reached */ + if (current->nthreads == 0 || !*sp) + break; + } + + return matched; +} + +int cregex_program_run(const cregex_program_t *program, + const char *string, + const char **matches, + int nmatches) +{ + return vm_run(program, string, matches, nmatches); +} diff --git a/src/format.c b/src/format.c index 4fac3f2f..981ee3ab 100644 --- a/src/format.c +++ b/src/format.c @@ -1675,7 +1675,7 @@ DWORD WINAPI FormatThread(void* param) static_sprintf(cmd, "dism /Apply-Ffu /ApplyDrive:%s /ImageFile:\"%s\"", physical, image_path); safe_free(physical); uprintf("Running command: '%s", cmd); - cr = RunCommandWithProgress(cmd, sysnative_dir, TRUE, MSG_261); + cr = RunCommandWithProgress(cmd, sysnative_dir, TRUE, MSG_261, ".*\r\\[[= ]+([0-9\\.]+%)[= ]+\\].*"); if (cr != 0 && !IS_ERROR(ErrorStatus)) { SetLastError(cr); uprintf("Failed to apply FFU image: %s", WindowsErrorString()); diff --git a/src/license.h b/src/license.h index b0407daa..4ddeae4c 100644 --- a/src/license.h +++ b/src/license.h @@ -158,9 +158,9 @@ const char* additional_copyrights = "Dark Mode support by ozone10\\line\n" "https://github.com/ozone10\\line\n" "\\line\n" -"Regular Expression handling from tiny-regex-c by kokke:\\line\n" -"https://github.com/kokke/tiny-regex-c\\line\n" -"Public Domain\\line\n" +"Regular Expression parser from tiny-regex-c by Jim Huang (jserv):\\line\n" +"https://github.com/jserv/cregex\\line\n" +"BSD 2-Clause\\line\n" "\\line\n" "All other references can be found in the source.\\line\n}"; diff --git a/src/re.c b/src/re.c deleted file mode 100644 index 027fea7c..00000000 --- a/src/re.c +++ /dev/null @@ -1,532 +0,0 @@ -/* - * - * Mini regex-module inspired by Rob Pike's regex code described in: - * - * http://www.cs.princeton.edu/courses/archive/spr09/cos333/beautiful.html - * - * - * - * Supports: - * --------- - * '.' Dot, matches any character - * '^' Start anchor, matches beginning of string - * '$' End anchor, matches end of string - * '*' Asterisk, match zero or more (greedy) - * '+' Plus, match one or more (greedy) - * '?' Question, match zero or one (non-greedy) - * '[abc]' Character class, match if one of {'a', 'b', 'c'} - * '[^abc]' Inverted class, match if NOT one of {'a', 'b', 'c'} -- NOTE: feature is currently broken! - * '[a-zA-Z]' Character ranges, the character set of the ranges { a-z | A-Z } - * '\s' Whitespace, \t \f \r \n \v and spaces - * '\S' Non-whitespace - * '\w' Alphanumeric, [a-zA-Z0-9_] - * '\W' Non-alphanumeric - * '\d' Digits, [0-9] - * '\D' Non-digits - * - * - */ - - - -#include "re.h" -#include <stdio.h> -#include <ctype.h> - -/* Definitions: */ - -#define MAX_REGEXP_OBJECTS 30 /* Max number of regex symbols in expression. */ -#define MAX_CHAR_CLASS_LEN 40 /* Max length of character-class buffer in. */ - -/* ALPHA may be defined for Rufus ALPHA releases => undefine it */ -#ifdef ALPHA -#undef ALPHA -#endif - -enum { UNUSED, DOT, BEGIN, END, QUESTIONMARK, STAR, PLUS, CHAR, CHAR_CLASS, INV_CHAR_CLASS, DIGIT, NOT_DIGIT, ALPHA, NOT_ALPHA, WHITESPACE, NOT_WHITESPACE, /* BRANCH */ }; - -typedef struct regex_t -{ - unsigned char type; /* CHAR, STAR, etc. */ - union - { - unsigned char ch; /* the character itself */ - unsigned char* ccl; /* OR a pointer to characters in class */ - } u; -} regex_t; - - - -/* Private function declarations: */ -static int matchpattern(regex_t* pattern, const char* text, int* matchlength); -static int matchcharclass(char c, const char* str); -static int matchstar(regex_t p, regex_t* pattern, const char* text, int* matchlength); -static int matchplus(regex_t p, regex_t* pattern, const char* text, int* matchlength); -static int matchone(regex_t p, char c); -static int matchdigit(char c); -static int matchalpha(char c); -static int matchwhitespace(char c); -static int matchmetachar(char c, const char* str); -static int matchrange(char c, const char* str); -static int matchdot(char c); -static int ismetachar(char c); - - - -/* Public functions: */ -int re_match(const char* pattern, const char* text, int* matchlength) -{ - return re_matchp(re_compile(pattern), text, matchlength); -} - -int re_matchp(re_t pattern, const char* text, int* matchlength) -{ - *matchlength = 0; - if (pattern != 0) - { - if (pattern[0].type == BEGIN) - { - return ((matchpattern(&pattern[1], text, matchlength)) ? 0 : -1); - } - else - { - int idx = -1; - - do - { - idx += 1; - - if (matchpattern(pattern, text, matchlength)) - { - if (text[0] == '\0') - return -1; - - return idx; - } - } - while (*text++ != '\0'); - } - } - return -1; -} - -re_t re_compile(const char* pattern) -{ - /* The sizes of the two static arrays below substantiates the static RAM usage of this module. - MAX_REGEXP_OBJECTS is the max number of symbols in the expression. - MAX_CHAR_CLASS_LEN determines the size of buffer for chars in all char-classes in the expression. */ - static regex_t re_compiled[MAX_REGEXP_OBJECTS]; - static unsigned char ccl_buf[MAX_CHAR_CLASS_LEN]; - int ccl_bufidx = 1; - - char c; /* current char in pattern */ - int i = 0; /* index into pattern */ - int j = 0; /* index into re_compiled */ - - while (pattern[i] != '\0' && (j+1 < MAX_REGEXP_OBJECTS)) - { - c = pattern[i]; - - switch (c) - { - /* Meta-characters: */ - case '^': { re_compiled[j].type = BEGIN; } break; - case '$': { re_compiled[j].type = END; } break; - case '.': { re_compiled[j].type = DOT; } break; - case '*': { re_compiled[j].type = STAR; } break; - case '+': { re_compiled[j].type = PLUS; } break; - case '?': { re_compiled[j].type = QUESTIONMARK; } break; -/* case '|': { re_compiled[j].type = BRANCH; } break; <-- not working properly */ - - /* Escaped character-classes (\s \w ...): */ - case '\\': - { - if (pattern[i+1] != '\0') - { - /* Skip the escape-char '\\' */ - i += 1; - /* ... and check the next */ - switch (pattern[i]) - { - /* Meta-character: */ - case 'd': { re_compiled[j].type = DIGIT; } break; - case 'D': { re_compiled[j].type = NOT_DIGIT; } break; - case 'w': { re_compiled[j].type = ALPHA; } break; - case 'W': { re_compiled[j].type = NOT_ALPHA; } break; - case 's': { re_compiled[j].type = WHITESPACE; } break; - case 'S': { re_compiled[j].type = NOT_WHITESPACE; } break; - - /* Escaped character, e.g. '.' or '$' */ - default: - { - re_compiled[j].type = CHAR; - re_compiled[j].u.ch = pattern[i]; - } break; - } - } - /* '\\' as last char in pattern -> invalid regular expression. */ -/* - else - { - re_compiled[j].type = CHAR; - re_compiled[j].ch = pattern[i]; - } -*/ - } break; - - /* Character class: */ - case '[': - { - /* Remember where the char-buffer starts. */ - int buf_begin = ccl_bufidx; - - /* Look-ahead to determine if negated */ - if (pattern[i+1] == '^') - { - re_compiled[j].type = INV_CHAR_CLASS; - i += 1; /* Increment i to avoid including '^' in the char-buffer */ - if (pattern[i+1] == 0) /* incomplete pattern, missing non-zero char after '^' */ - { - return 0; - } - } - else - { - re_compiled[j].type = CHAR_CLASS; - } - - /* Copy characters inside [..] to buffer */ - while ( (pattern[++i] != ']') - && (pattern[i] != '\0')) /* Missing ] */ - { - if (pattern[i] == '\\') - { - if (ccl_bufidx >= MAX_CHAR_CLASS_LEN - 1) - { - //fputs("exceeded internal buffer!\n", stderr); - return 0; - } - if (pattern[i+1] == 0) /* incomplete pattern, missing non-zero char after '\\' */ - { - return 0; - } - ccl_buf[ccl_bufidx++] = pattern[i++]; - } - else if (ccl_bufidx >= MAX_CHAR_CLASS_LEN) - { - //fputs("exceeded internal buffer!\n", stderr); - return 0; - } - ccl_buf[ccl_bufidx++] = pattern[i]; - } - if (ccl_bufidx >= MAX_CHAR_CLASS_LEN) - { - /* Catches cases such as [00000000000000000000000000000000000000][ */ - //fputs("exceeded internal buffer!\n", stderr); - return 0; - } - /* Null-terminate string end */ - ccl_buf[ccl_bufidx++] = 0; - re_compiled[j].u.ccl = &ccl_buf[buf_begin]; - } break; - - /* Other characters: */ - default: - { - re_compiled[j].type = CHAR; - re_compiled[j].u.ch = c; - } break; - } - /* no buffer-out-of-bounds access on invalid patterns - see https://github.com/kokke/tiny-regex-c/commit/1a279e04014b70b0695fba559a7c05d55e6ee90b */ - if (pattern[i] == 0) - { - return 0; - } - - i += 1; - j += 1; - } - /* 'UNUSED' is a sentinel used to indicate end-of-pattern */ - re_compiled[j].type = UNUSED; - - return (re_t) re_compiled; -} - -void re_print(regex_t* pattern) -{ - const char* types[] = { "UNUSED", "DOT", "BEGIN", "END", "QUESTIONMARK", "STAR", "PLUS", "CHAR", "CHAR_CLASS", "INV_CHAR_CLASS", "DIGIT", "NOT_DIGIT", "ALPHA", "NOT_ALPHA", "WHITESPACE", "NOT_WHITESPACE", "BRANCH" }; - - int i; - int j; - char c; - for (i = 0; i < MAX_REGEXP_OBJECTS; ++i) - { - if (pattern[i].type == UNUSED) - { - break; - } - - printf("type: %s", types[pattern[i].type]); - if (pattern[i].type == CHAR_CLASS || pattern[i].type == INV_CHAR_CLASS) - { - printf(" ["); - for (j = 0; j < MAX_CHAR_CLASS_LEN; ++j) - { - c = pattern[i].u.ccl[j]; - if ((c == '\0') || (c == ']')) - { - break; - } - printf("%c", c); - } - printf("]"); - } - else if (pattern[i].type == CHAR) - { - printf(" '%c'", pattern[i].u.ch); - } - printf("\n"); - } -} - - - -/* Private functions: */ -static int matchdigit(char c) -{ - return isdigit(c); -} -static int matchalpha(char c) -{ - return isalpha(c); -} -static int matchwhitespace(char c) -{ - return isspace(c); -} -static int matchalphanum(char c) -{ - return ((c == '_') || matchalpha(c) || matchdigit(c)); -} -static int matchrange(char c, const char* str) -{ - return ( (c != '-') - && (str[0] != '\0') - && (str[0] != '-') - && (str[1] == '-') - && (str[2] != '\0') - && ( (c >= str[0]) - && (c <= str[2]))); -} -static int matchdot(char c) -{ -#if defined(RE_DOT_MATCHES_NEWLINE) && (RE_DOT_MATCHES_NEWLINE == 1) - (void)c; - return 1; -#else - return c != '\n' && c != '\r'; -#endif -} -static int ismetachar(char c) -{ - return ((c == 's') || (c == 'S') || (c == 'w') || (c == 'W') || (c == 'd') || (c == 'D')); -} - -static int matchmetachar(char c, const char* str) -{ - switch (str[0]) - { - case 'd': return matchdigit(c); - case 'D': return !matchdigit(c); - case 'w': return matchalphanum(c); - case 'W': return !matchalphanum(c); - case 's': return matchwhitespace(c); - case 'S': return !matchwhitespace(c); - default: return (c == str[0]); - } -} - -static int matchcharclass(char c, const char* str) -{ - do - { - if (matchrange(c, str)) - { - return 1; - } - else if (str[0] == '\\') - { - /* Escape-char: increment str-ptr and match on next char */ - str += 1; - if (matchmetachar(c, str)) - { - return 1; - } - else if ((c == str[0]) && !ismetachar(c)) - { - return 1; - } - } - else if (c == str[0]) - { - if (c == '-') - { - return ((str[-1] == '\0') || (str[1] == '\0')); - } - else - { - return 1; - } - } - } - while (*str++ != '\0'); - - return 0; -} - -static int matchone(regex_t p, char c) -{ - switch (p.type) - { - case DOT: return matchdot(c); - case CHAR_CLASS: return matchcharclass(c, (const char*)p.u.ccl); - case INV_CHAR_CLASS: return !matchcharclass(c, (const char*)p.u.ccl); - case DIGIT: return matchdigit(c); - case NOT_DIGIT: return !matchdigit(c); - case ALPHA: return matchalphanum(c); - case NOT_ALPHA: return !matchalphanum(c); - case WHITESPACE: return matchwhitespace(c); - case NOT_WHITESPACE: return !matchwhitespace(c); - default: return (p.u.ch == c); - } -} - -static int matchstar(regex_t p, regex_t* pattern, const char* text, int* matchlength) -{ - int prelen = *matchlength; - const char* prepoint = text; - while ((text[0] != '\0') && matchone(p, *text)) - { - text++; - (*matchlength)++; - } - while (text >= prepoint) - { - if (matchpattern(pattern, text--, matchlength)) - return 1; - (*matchlength)--; - } - - *matchlength = prelen; - return 0; -} - -static int matchplus(regex_t p, regex_t* pattern, const char* text, int* matchlength) -{ - const char* prepoint = text; - while ((text[0] != '\0') && matchone(p, *text)) - { - text++; - (*matchlength)++; - } - while (text > prepoint) - { - if (matchpattern(pattern, text--, matchlength)) - return 1; - (*matchlength)--; - } - - return 0; -} - -static int matchquestion(regex_t p, regex_t* pattern, const char* text, int* matchlength) -{ - if (p.type == UNUSED) - return 1; - if (matchpattern(pattern, text, matchlength)) - return 1; - if (*text && matchone(p, *text++)) - { - if (matchpattern(pattern, text, matchlength)) - { - (*matchlength)++; - return 1; - } - } - return 0; -} - - -#if 0 - -/* Recursive matching */ -static int matchpattern(regex_t* pattern, const char* text, int *matchlength) -{ - int pre = *matchlength; - if ((pattern[0].type == UNUSED) || (pattern[1].type == QUESTIONMARK)) - { - return matchquestion(pattern[1], &pattern[2], text, matchlength); - } - else if (pattern[1].type == STAR) - { - return matchstar(pattern[0], &pattern[2], text, matchlength); - } - else if (pattern[1].type == PLUS) - { - return matchplus(pattern[0], &pattern[2], text, matchlength); - } - else if ((pattern[0].type == END) && pattern[1].type == UNUSED) - { - return text[0] == '\0'; - } - else if ((text[0] != '\0') && matchone(pattern[0], text[0])) - { - (*matchlength)++; - return matchpattern(&pattern[1], text+1); - } - else - { - *matchlength = pre; - return 0; - } -} - -#else - -/* Iterative matching */ -static int matchpattern(regex_t* pattern, const char* text, int* matchlength) -{ - int pre = *matchlength; - do - { - if ((pattern[0].type == UNUSED) || (pattern[1].type == QUESTIONMARK)) - { - return matchquestion(pattern[0], &pattern[2], text, matchlength); - } - else if (pattern[1].type == STAR) - { - return matchstar(pattern[0], &pattern[2], text, matchlength); - } - else if (pattern[1].type == PLUS) - { - return matchplus(pattern[0], &pattern[2], text, matchlength); - } - else if ((pattern[0].type == END) && pattern[1].type == UNUSED) - { - return (text[0] == '\0'); - } -/* Branching is not working properly - else if (pattern[1].type == BRANCH) - { - return (matchpattern(pattern, text) || matchpattern(&pattern[2], text)); - } -*/ - (*matchlength)++; - } - while ((text[0] != '\0') && matchone(*pattern++, *text++)); - - *matchlength = pre; - return 0; -} - -#endif diff --git a/src/re.h b/src/re.h deleted file mode 100644 index 69facc68..00000000 --- a/src/re.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * Mini regex-module inspired by Rob Pike's regex code described in: - * - * http://www.cs.princeton.edu/courses/archive/spr09/cos333/beautiful.html - * - * - * - * Supports: - * --------- - * '.' Dot, matches any character - * '^' Start anchor, matches beginning of string - * '$' End anchor, matches end of string - * '*' Asterisk, match zero or more (greedy) - * '+' Plus, match one or more (greedy) - * '?' Question, match zero or one (non-greedy) - * '[abc]' Character class, match if one of {'a', 'b', 'c'} - * '[^abc]' Inverted class, match if NOT one of {'a', 'b', 'c'} -- NOTE: feature is currently broken! - * '[a-zA-Z]' Character ranges, the character set of the ranges { a-z | A-Z } - * '\s' Whitespace, \t \f \r \n \v and spaces - * '\S' Non-whitespace - * '\w' Alphanumeric, [a-zA-Z0-9_] - * '\W' Non-alphanumeric - * '\d' Digits, [0-9] - * '\D' Non-digits - * - * - */ - -#ifndef _TINY_REGEX_C -#define _TINY_REGEX_C - - -#ifndef RE_DOT_MATCHES_NEWLINE -/* Define to 0 if you DON'T want '.' to match '\r' + '\n' */ -#define RE_DOT_MATCHES_NEWLINE 1 -#endif - -#ifdef __cplusplus -extern "C"{ -#endif - - - -/* Typedef'd pointer to get abstract datatype. */ -typedef struct regex_t* re_t; - - -/* Compile regex string pattern to a regex_t-array. */ -re_t re_compile(const char* pattern); - - -/* Find matches of the compiled pattern inside text. */ -int re_matchp(re_t pattern, const char* text, int* matchlength); - - -/* Find matches of the txt pattern inside text (will compile automatically first). */ -int re_match(const char* pattern, const char* text, int* matchlength); - - -#ifdef __cplusplus -} -#endif - -#endif /* ifndef _TINY_REGEX_C */ diff --git a/src/rufus.c b/src/rufus.c index bf458b3f..c7b54c97 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -47,10 +47,10 @@ #include "localization.h" #include "ui.h" -#include "re.h" #include "vhd.h" #include "wue.h" #include "drive.h" +#include "cregex.h" #include "settings.h" #include "darkmode.h" #include "bled/bled.h" @@ -1308,9 +1308,12 @@ DWORD WINAPI ImageScanThread(LPVOID param) "Install-LEAP", "openSUSE-Tumbleweed" }; - int i, len; + int i; uint8_t arch; char tmp_path[MAX_PATH], tmp_str[64]; + const char* matches[REGEX_VM_MAX_MATCHES]; + cregex_node_t* node = NULL; + cregex_program_t* program = NULL; // We may mount an ISO during the lookup of the Windows version, which // produces DBT_DEVNODES_CHANGED messages that lead to unwanted device @@ -1391,11 +1394,20 @@ DWORD WINAPI ImageScanThread(LPVOID param) GetBootladerInfo(); DisplayISOProps(); - for (i = 0; i < ARRAYSIZE(redhat8_derivative); i++) { - if (re_match(redhat8_derivative[i], img_report.label, &len) >= 0) { - img_report.rh8_derivative = TRUE; + for (i = 0; i < ARRAYSIZE(redhat8_derivative) && !img_report.rh8_derivative; i++) { + node = cregex_parse(redhat8_derivative[i]); + if (node != NULL) { + program = cregex_compile_node(node); + cregex_parse_free(node); + } + if (node == NULL || program == NULL) { + uprintf("Internal error: Failed to parse '%s'", redhat8_derivative[i]); break; } + if (cregex_program_run(program, img_report.label, matches, ARRAYSIZE(matches)) > 0) + img_report.rh8_derivative = TRUE; + cregex_compile_free(program); + program = NULL; } for (i = 0; i < ARRAYSIZE(suse_derivative); i++) { diff --git a/src/rufus.h b/src/rufus.h index 49cbb165..6956ac7b 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -816,8 +816,8 @@ extern char* FileDialog(BOOL save, char* path, const ext_t* ext, UINT* selected_ extern BOOL FileIO(enum file_io_type io_type, char* path, char** buffer, DWORD* size); extern uint8_t* GetResource(HMODULE module, char* name, char* type, const char* desc, DWORD* len, BOOL duplicate); extern DWORD GetResourceSize(HMODULE module, char* name, char* type, const char* desc); -extern DWORD RunCommandWithProgress(const char* cmdline, const char* dir, BOOL log, int msg); -#define RunCommand(cmd, dir, log) RunCommandWithProgress(cmd, dir, log, 0) +extern DWORD RunCommandWithProgress(const char* cmdline, const char* dir, BOOL log, int msg, const char* pattern); +#define RunCommand(cmd, dir, log) RunCommandWithProgress(cmd, dir, log, 0, NULL) extern BOOL CompareGUID(const GUID *guid1, const GUID *guid2); extern BOOL MountRegistryHive(const HKEY key, const char* pszHiveName, const char* pszHivePath); extern BOOL UnmountRegistryHive(const HKEY key, const char* pszHiveName); diff --git a/src/rufus.rc b/src/rufus.rc index 382af4eb..3ee90132 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.10.2261" +CAPTION "Rufus 4.10.2262" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2261,0 - PRODUCTVERSION 4,10,2261,0 + FILEVERSION 4,10,2262,0 + PRODUCTVERSION 4,10,2262,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2261" + VALUE "FileVersion", "4.10.2262" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2261" + VALUE "ProductVersion", "4.10.2262" END END BLOCK "VarFileInfo" diff --git a/src/stdfn.c b/src/stdfn.c index f42b5440..d1f77612 100644 --- a/src/stdfn.c +++ b/src/stdfn.c @@ -28,8 +28,8 @@ #include <accctrl.h> #include <aclapi.h> -#include "re.h" #include "rufus.h" +#include "cregex.h" #include "missing.h" #include "resource.h" #include "msapi_utf8.h" @@ -796,21 +796,20 @@ DWORD GetResourceSize(HMODULE module, char* name, char* type, const char* desc) // Run a console command, with optional redirection of stdout and stderr to our log // as well as optional progress reporting if msg is not 0. -DWORD RunCommandWithProgress(const char* cmd, const char* dir, BOOL log, int msg) +DWORD RunCommandWithProgress(const char* cmd, const char* dir, BOOL log, int msg, const char* pattern) { - DWORD i, ret, dwRead, dwAvail, dwPipeSize = 4096; + DWORD ret, dwRead, dwAvail, dwPipeSize = 4096; STARTUPINFOA si = { 0 }; PROCESS_INFORMATION pi = { 0 }; SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE }; HANDLE hOutputRead = INVALID_HANDLE_VALUE, hOutputWrite = INVALID_HANDLE_VALUE; - int match_length; static char* output; - // For detecting typical dism.exe commandline progress report of type: - // "\r[==== 8.0% ]\r\n" - re_t pattern = re_compile("\\s*\\[[= ]+[\\d\\.]+%[= ]+\\]\\s*"); + cregex_node_t* node = NULL; + cregex_program_t* program = NULL; + char* matches[REGEX_VM_MAX_MATCHES]; si.cb = sizeof(si); - if (log) { + if (msg != 0 || log) { // NB: The size of a pipe is a suggestion, NOT an absolute guarantee // This means that you may get a pipe of 4K even if you requested 1K if (!CreatePipe(&hOutputRead, &hOutputWrite, &sa, dwPipeSize)) { @@ -831,8 +830,18 @@ DWORD RunCommandWithProgress(const char* cmd, const char* dir, BOOL log, int msg goto out; } - if (log || msg != 0) { - if (msg != 0) + if (msg != 0) { + node = cregex_parse(pattern); + if (node != NULL) { + program = cregex_compile_node(node); + cregex_parse_free(node); + } + if (node == NULL || program == NULL) + uprintf("Internal error: Failed to parse '%s'", pattern); + } + + if (program != NULL || log) { + if (program != NULL) UpdateProgressWithInfoInit(NULL, FALSE); while (1) { // Check for user cancel @@ -859,24 +868,15 @@ DWORD RunCommandWithProgress(const char* cmd, const char* dir, BOOL log, int msg output = malloc(dwAvail + 1); if ((output != NULL) && (ReadFile(hOutputRead, output, dwAvail, &dwRead, NULL)) && (dwRead != 0)) { output[dwAvail] = 0; - // Process a commandline progress bar into a percentage - if ((msg != 0) && (re_matchp(pattern, output, &match_length) != -1)) { + // Process a commandline progress into a percentage + if (program != NULL && cregex_program_run(program, output, (const char**)matches, ARRAYSIZE(matches)) > 0 && + matches[2] != NULL && matches[3] != NULL) { + // matches[2] is for the first group + // matches[3] is for the end of the first group + matches[3][0] = '\0'; float f = 0.0f; - i = 0; -next_progress_line: - for (; (i < dwAvail) && (output[i] < '0' || output[i] > '9'); i++); - IGNORE_RETVAL(sscanf(&output[i], "%f*", &f)); + IGNORE_RETVAL(sscanf(matches[2], "%f", &f)); UpdateProgressWithInfo(OP_FORMAT, msg, (uint64_t)(f * 100.0f), 100 * 100ULL); - // Go to next line - while ((++i < dwAvail) && (output[i] != '\n') && (output[i] != '\r')); - while ((++i < dwAvail) && ((output[i] == '\n') || (output[i] == '\r'))); - // Print additional lines, if any - if (i < dwAvail) { - // Might have two consecutive progress lines in our buffer - if (re_matchp(pattern, &output[i], &match_length) != -1) - goto next_progress_line; - uprintf("%s", &output[i]); - } } else if (log) { // output may contain a '%' so don't feed it as a naked format string uprintf("%s", output); @@ -889,6 +889,7 @@ next_progress_line: break; Sleep(100); }; + cregex_compile_free(program); } else { // TODO: Detect user cancellation here? switch (WaitForSingleObject(pi.hProcess, 1800000)) { diff --git a/src/vhd.c b/src/vhd.c index 40db6880..eaca6e78 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -563,7 +563,9 @@ static DWORD WINAPI FfuSaveImageThread(void* param) "/Name:\"%s\" /Description:\"Created by %s (%s)\"", img_save->DevicePath, img_save->ImagePath, label, APPLICATION_NAME, RUFUS_URL); uprintf("Running command: '%s", cmd); - r = RunCommandWithProgress(cmd, sysnative_dir, TRUE, MSG_261); + // For detecting typical dism.exe commandline progress report of type: + // "\r[==== 8.0% ]" + r = RunCommandWithProgress(cmd, sysnative_dir, TRUE, MSG_261, ".*\r\\[[= ]+([0-9\\.]+%)[= ]+\\].*"); if (r != 0 && !IS_ERROR(ErrorStatus)) { SetLastError(r); uprintf("Failed to capture FFU image: %s", WindowsErrorString()); From a2dd380e9388c0f0158a634fd6960d7be6017c88 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 30 Jun 2025 11:54:36 +0100 Subject: [PATCH 072/192] [iso] add save selected drive to ISO feature * Requires the download of oscdimg.exe, courtesy of Microsoft's symbol servers. * UDF only, since this is mostly intended for Windows and even with Joliet, Microsoft's implementation of ISO-9660 is crippled (fails to use multi-extent for >4GB files, which results in BROKEN ISO images) and too limited. * Note that this is different from our other save to ISO feature (Alt-O), that dumped the first optical media found on the system to an ISO. * Also fix a Coverity warning as well as a possible crash in PopulateWindowsVersion() when opening an invalid image (such as the ISO-9660 ones created by oscdimg). --- res/loc/ChangeLog.txt | 3 ++ res/loc/rufus.loc | 70 ++++++++++++++-------------- loadcfg.py => res/scripts/loadcfg.py | 0 src/format.c | 4 +- src/iso.c | 36 ++++++++++++-- src/rufus.c | 9 ++-- src/rufus.h | 9 ++++ src/rufus.rc | 10 ++-- src/stdfn.c | 2 +- src/vhd.c | 59 ++++++++++++++++------- src/vhd.h | 5 +- src/wue.c | 2 +- 12 files changed, 139 insertions(+), 70 deletions(-) rename loadcfg.py => res/scripts/loadcfg.py (100%) diff --git a/res/loc/ChangeLog.txt b/res/loc/ChangeLog.txt index f1cf6749..14be321a 100644 --- a/res/loc/ChangeLog.txt +++ b/res/loc/ChangeLog.txt @@ -6,11 +6,14 @@ https://github.com/pbatard/rufus/wiki/Localization#Editing_an_existing_translati Or simply download https://files.akeo.ie/pollock/pollock-1.5.exe and follow its directions. o v4.? (????.??.??) ** NOT FINAL!!! PLEASE DO NOT SEND UNSOLICITED TRANSLATIONS! ** + - *UPDATED* MSG_337 "An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:" -> "An additional file ('%s') must be downloaded from Microsoft to use this feature:" + // NB: I used Google translate to update existing messages, so please check for accuracy! - *NEW* MSG_350 "Use 'Windows UEFI CA 2023' signed bootloaders [EXPERIMENTAL]" - *NEW* MSG_351 "Checking for UEFI bootloader revocation..." - *NEW* MSG_352 "Checking for UEFI DBX updates..." - *NEW* MSG_353 "DBX update available" - *NEW* MSG_354 "Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks..." + - *NEW* MSG_355 "ISO Image" o v4.5 (2024.05.22) - *UPDATED* IDC_RUFUS_MBR -> IDC_UEFI_MEDIA_VALIDATION "Enable runtime UEFI media validation" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 49add14b..d897482b 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -589,7 +589,7 @@ t MSG_333 "Create a local account with username:" t MSG_334 "Set regional options to the same values as this user's" t MSG_335 "Disable BitLocker automatic device encryption" t MSG_336 "Persistent log" -t MSG_337 "An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +t MSG_337 "An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." @@ -617,6 +617,7 @@ t MSG_354 "Rufus has found an updated version of the DBX files used to perform U "- Select 'Yes' to connect to the Internet and download this content\n" "- Select 'No' to cancel the operation\n\n" "Note: The files will be downloaded in the application's directory and will be reused automatically if present." +t MSG_355 "ISO Image" # The following messages are for the Windows Store listing only and are not used by the application t MSG_900 "Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc." t MSG_901 "Official site: %s" @@ -1040,7 +1041,7 @@ t MSG_333 "قم بإنشاء حساب محلي باسم المستخدم:" t MSG_334 "قم بتعيين الخيارات الإقليمية لتطابق خيارات المستخدم الحالي" t MSG_335 "تعطيل التشفير التلقائي BitLocker للجهاز" t MSG_336 "سجل متواصل" -t MSG_337 "يجب تنزيل ملف إضافي ('diskcopy.dll') من Microsoft لتثبيت MS-DOS:\n- حدد \"نعم\" للاتصال بالإنترنت وتنزيله\n- اختر \"لا\" لإلغاء العملية\n\nملاحظة: سيتم تنزيل الملف في مجلد التطبيق وسيتم إعادة استخدامه تلقائيًا إذا كان موجودًا." +t MSG_337 "يجب تنزيل ملف إضافي ('%s') من Microsoft لاستخدام هذه الميزة:\n- حدد \"نعم\" للاتصال بالإنترنت وتنزيله\n- اختر \"لا\" لإلغاء العملية\n\nملاحظة: سيتم تنزيل الملف في مجلد التطبيق وسيتم إعادة استخدامه تلقائيًا إذا كان موجودًا." t MSG_338 "تم اكتشاف أداة تحميل التشغيل UEFI التي تم إبطالها سابقا" t MSG_339 "اكتشف Rufus أن ملف ISO الذي حددته يحتوي على أداة تحميل التشغيل UEFI التي تم إبطالها سابقا والتي ستنتج %s، عند تمكين Secure Boot محدث بالكامل على نظام UEFI .\n\n- إذا حصلت على صورة ISO هذه من مصدر غير حسن السمعة، فيجب أن تفكر في احتمالية احتوائها على برامج UEFI ضارة وتجنب التشغيل منها.\n- إذا حصلت على صورة ISO هذه من مصدر موثوق به، فعليك محاولة العثور على إصدار أكثر حداثة، والذي لن ينتج عنه هذا التحذير." t MSG_340 "شاشة \"الانتهاكات الأمنية\"" @@ -1877,7 +1878,7 @@ t MSG_333 "创建一个使用此用户名的本地账号:" t MSG_334 "使用当前用户的区域设置" t MSG_335 "禁用 BitLocker 自动设备加密" t MSG_336 "持久化日志" -t MSG_337 "必须从微软下载额外的文件(\"diskcopy.dll\"),以安装 MS-DOS:\n- 选择 '是' 连接网络并下载这些文件\n- 选择 '否' 取消此项操作\n\n注意:文件将会被下载到当前应用程序目录,如果存在则会自动选用。" +t MSG_337 "必须从 Microsoft 下载附加文件(“%s”)才能使用此功能:\n- 选择 '是' 连接网络并下载这些文件\n- 选择 '否' 取消此项操作\n\n注意:文件将会被下载到当前应用程序目录,如果存在则会自动选用。" t MSG_338 "检测到被吊销的 UEFI 引导加载器" t MSG_339 "Rufus 检测到您选择的 ISO 包含一个已被吊销的 UEFI 引导加载器,当在最新的 UEFI 系统上启用安全启动时,将产生%s。\n\n- 如果您从非可信来源获取此 ISO 镜像,则应考虑其中可能包含 UEFI 恶意软件,应当避免启动此镜像。\n- 如果是从可信来源获取的,则应尝试查找不会产生此警告的最新版本。" t MSG_340 "一个“安全违规”界面" @@ -2299,7 +2300,7 @@ t MSG_333 "使用此使用者名建立一個本機帳戶:" t MSG_334 "使用目前用戶的區域設定" t MSG_335 "關閉 BitLocker 自動設備加密" t MSG_336 "持久化日誌" -t MSG_337 "必須從微軟下載額外的 'diskcopy.dll' 檔案,才能安裝 MS-DOS:\n- 選 '是' 將連線到網路並進行下載\n- 選 '否' 將取消操作\n\n註: 該檔案將被下載到 Rufus 所在的資料夾中,如果已存在將會自動使用。" +t MSG_337 "必須從 Microsoft 下載附加檔案(“%s”)才能使用此功能:\n- 選 '是' 將連線到網路並進行下載\n- 選 '否' 將取消操作\n\n註: 該檔案將被下載到 Rufus 所在的資料夾中,如果已存在將會自動使用。" t MSG_338 "偵測到被撤銷的 UEFI 開機引導程式" t MSG_339 "Rufus 偵測到選取的 ISO 包含一個被撤銷的 UEFI 開機引導程式,當你在完全更新的 UEFI 系統上啟用安全開機時,將產生 %s。\n\n- 如果你從無法信任的來源取得這個 ISO 映像,應該考慮到它可能包含 UEFI 惡意程式,並避免以此進行開機。\n- 如果你從可以信任的來源取得,應該嘗試找到一個更新的版本,才不會出現這個警告。" t MSG_340 "一個 \"安全違規\" 畫面" @@ -2721,7 +2722,7 @@ t MSG_333 "Stvorite lokalni račun s korisničkim imenom:" t MSG_334 "Postavljanje regionalnih mogućnosti na iste vrijednosti kao i vrijednosti ovog korisnika" t MSG_335 "Onemogući BitLocker automatsko šifriranje uređaja" t MSG_336 "Stalni zapisnik" -t MSG_337 "Dodatnu datoteku ('diskcopy.dll') potrebno je preuzeti s Microsofta da biste instalirali MS-DOS:\n- Odaberite 'Da' za spajanje na Internet i preuzimanje\n- Odaberite 'Ne' za poništavanje operacije\n\nNapomena: Datoteka će se preuzeti u imenik aplikacije i automatski će se ponovno koristiti ako postoji." +t MSG_337 "Za korištenje ove značajke potrebno je preuzeti dodatnu datoteku ('%s') s Microsofta:\n- Odaberite 'Da' za spajanje na Internet i preuzimanje\n- Odaberite 'Ne' za poništavanje operacije\n\nNapomena: Datoteka će se preuzeti u imenik aplikacije i automatski će se ponovno koristiti ako postoji." t MSG_338 "Otkriven opozvani UEFI pokretački program" t MSG_339 "Rufus je otkrio da ISO koji ste odabrali sadrži UEFI bootloader koji je opozvan i koji će proizvesti %s, kada je Secure Boot omogućen na potpuno ažuriranom UEFI sustavu.\n\n- Ako ste nabavili ovu ISO sliku iz izvora koji nije renomiran, trebali biste razmotriti mogućnost da ona sadrži zlonamjerni softver UEFI i izbjegavati pokretanje ga.\n- Ako ste ga dobili od pouzdanog izvora, trebali biste pokušati locirati noviju verziju koja neće proizvesti ovo upozorenje." t MSG_340 "zaslon \"Sigurnosna povreda\"" @@ -3137,7 +3138,7 @@ t MSG_333 "Vytvořte místní účet s uživatelským jménem:" t MSG_334 "Nastavení regionálních voleb na stejné hodnoty jako u tohoto uživatele" t MSG_335 "Zakázání automatického šifrování zařízení nástrojem BitLocker" t MSG_336 "Trvalý protokol" -t MSG_337 "Pro instalaci systému MS-DOS je nutné stáhnout další soubor ('diskcopy.dll') od společnosti Microsoft:\n- Vyberte 'Ano' pro připojení k internetu a stažení\n- Výběrem možnosti \"Ne\" operaci zrušíte\n\nPoznámka: Soubor bude stažen do adresáře aplikace a bude automaticky znovu použit, pokud je přítomen." +t MSG_337 "Pro použití této funkce je nutné stáhnout další soubor ('%s') od společnosti Microsoft::\n- Vyberte 'Ano' pro připojení k internetu a stažení\n- Výběrem možnosti \"Ne\" operaci zrušíte\n\nPoznámka: Soubor bude stažen do adresáře aplikace a bude automaticky znovu použit, pokud je přítomen." t MSG_338 "Byl zjištěn odvolaný zavaděč UEFI" t MSG_339 "Rufus zjistil, že vámi vybraný ISO obsahuje zavaděč UEFI, který byl odvolán a který vytvoří %s, když je v plně aktuálním systému UEFI povoleno Secure Boot.\n\n- Pokud jste tento obraz ISO získali z nerenomovaného zdroje, měli byste zvážit možnost, že by mohl obsahovat malware UEFI a vyhnout se bootování z něj.\n- Pokud jste jej získali z důvěryhodného zdroje, měli byste se pokusit najít aktuálnější verzi, která toto varování nevyvolá." t MSG_340 "obrazovka \"Porušení zabezpečení\"" @@ -3545,7 +3546,7 @@ t MSG_333 "Opret en local burger med brugernavn:" t MSG_334 "Sæt regionale muligheder til de samme værdier some denne brugers" t MSG_335 "Deaktiver Bitlockers automatiske apparat kryptering" t MSG_336 "Vedvarende log" -t MSG_337 "En ekstra fil ('diskcopy.dll') skal hentes fra Microsoft for at installere MS-DOS:\n- Vælg 'Ja' for at tilslutte til internettet og hente den\n- Vælg 'Nej' for at afbryde operationen\n\nNote: Filen vil blive hentet i programmets mappe og vil blive genbrugt automatisk hvis tilstede." +t MSG_337 "En yderligere fil ('%s') skal downloades fra Microsoft for at bruge denne funktion:\n- Vælg 'Ja' for at tilslutte til internettet og hente den\n- Vælg 'Nej' for at afbryde operationen\n\nNote: Filen vil blive hentet i programmets mappe og vil blive genbrugt automatisk hvis tilstede." t MSG_338 "Tilbagekaldt UEFI Bootloader opdaget" t MSG_339 "Rufus har opdaget at ISO filen du har valgt indeholder en UEFI bootloader der er blevet tilbagekaldt og vil producere %s, når Secure Boot er slået til på et fuldt opdateret UEFI system.\n\n- Hvis du har hentet dette ISO billed fra en upålidelig kilde, bør du overveje muligheden for at den muligvis indeholder UEFI malware og undgå at boote fra den.\n- Hvis du har hentet den fra en pålidelig kilde, bør du kigge efter en nyere version, som ikke vil producere denne advarsel." t MSG_340 "en \"Sikkerhedsbrud\" skærm" @@ -3963,7 +3964,7 @@ t MSG_332 "Voorkomen dat Windows To Go toegang heeft tot interne schijven" t MSG_333 "Lokale account met gebruikersnaam aanmaken:" t MSG_334 "Regionale opties op dezelfde waarden als deze gebruiker instellen" t MSG_335 "Automatische Bitlocker-apparaatversleuteling uitschakelen" -t MSG_337 "Er moet een extra bestand ('diskcopy.dll') worden gedownload van Microsoft om MS-DOS te installeren:\n- Selecteer 'Ja' om verbinding te maken met internet en het bestand te downloaden\n- Selecteer 'Nee' om de bewerking te annuleren\n\nOpmerking: het bestand wordt gedownload in de map van de toepassing en wordt automatisch opnieuw gebruikt als het aanwezig is." +t MSG_337 "Om deze functie te kunnen gebruiken, moet u een extra bestand ('%s') downloaden van Microsoft:\n- Selecteer 'Ja' om verbinding te maken met internet en het bestand te downloaden\n- Selecteer 'Nee' om de bewerking te annuleren\n\nOpmerking: het bestand wordt gedownload in de map van de toepassing en wordt automatisch opnieuw gebruikt als het aanwezig is." t MSG_338 "Ingetrokken UEFI-bootloader gedetecteerd" t MSG_339 "Rufus heeft gedetecteerd dat de ISO die u hebt geselecteerd een UEFI-bootloader bevat die is ingetrokken en %s zal produceren wanneer Secure Boot is ingeschakeld op een volledig bijgewerkt UEFI-systeem.\n\n- Als u deze ISO-image hebt verkregen van een niet-vertrouwde bron, houdt u best rekening met de mogelijkheid dat het UEFI-malware bevat en vermijdt u om ervan op te starten.\n- Als u het van een betrouwbare bron hebt verkregen, moet u proberen een meer up-to-date versie te vinden die deze waarschuwing niet produceert." t MSG_340 "een \"Security Violation\"-scherm" @@ -4384,7 +4385,7 @@ t MSG_333 "Luo paikallinen käyttäjätili käyttäjänimellä:" t MSG_334 "Aseta alueelliset vaihtoehdot samoihin asetuksiin kuin nykyisellä käyttäjällä" t MSG_335 "Poista käytöstä automaattinen laitteen BitLocker-salaus" t MSG_336 "Pysyvä lokitiedosto" -t MSG_337 "Uusi tiedosto ('diskcopy.dll') on ladattava Microsoftilta MS-DOSin asennusta varten:\n- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi sen\n- Valitse 'Ei' peruuttaaksesi toiminnon\n\nHuomio: Tiedosto ladataan sovelluksen kansioon ja sitä uudelleenkäytetään automaattisesti, jos se on jo olemassa." +t MSG_337 "Tämän ominaisuuden käyttämiseksi Microsoftilta on ladattava lisätiedosto ('%s'):\n- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi sen\n- Valitse 'Ei' peruuttaaksesi toiminnon\n\nHuomio: Tiedosto ladataan sovelluksen kansioon ja sitä uudelleenkäytetään automaattisesti, jos se on jo olemassa." t MSG_338 "Mitätöity UEFI-käynnistyslataaja havaittu" t MSG_339 "Rufus havaitsi, että käyttämäsi ISO-levykuva sisältää UEFI-käynnistyslataajan, joka on mitätöity ja tulee aiheuttamaan %s Secure Bootin ollessa päällä ajantasaisessa UEFI-kokoonpanossa.\n\n- Jos olet hankkinut tämän ISO-levykuvan ei-luotettavasta lähteestä, huomioi UEFI-haittaohjelmien mahdollisuus ja vältä siltä käynnistämistä.\n- Jos olet hankkinut sen luotettavasta lähteestä, sinun tulisi yrittää etsiä uudempi versio, joka ei aiheuta tätä varoitusta." t MSG_340 "\"Turvallisuusrikkomus\"-näkymän" @@ -4802,7 +4803,7 @@ t MSG_333 "Créer un compte local sous le nom de :" t MSG_334 "Définir les options régionales avec les mêmes valeurs que celles de cet utilisateur" t MSG_335 "Désactiver le cryptage automatique BitLocker" t MSG_336 "Log persistent" -t MSG_337 "Un fichier supplémentaire ('diskcopy.dll') doit être téléchargé depuis Microsoft pour installer MS-DOS :\n- Sélectionnez 'Oui' pour vous connecter à Internet et le télécharger\n- Sélectionnez 'Non' pour annuler l’opération\n\nNote : Ce fichier sera téléchargé dans le répertoire de l'application et réutilisé automatiquement s'il est présent." +t MSG_337 "Un fichier supplémentaire ('%s') doit être téléchargé depuis Microsoft pour utiliser cette fonctionalité :\n- Sélectionnez 'Oui' pour vous connecter à Internet et le télécharger\n- Sélectionnez 'Non' pour annuler l’opération\n\nNote : Ce fichier sera téléchargé dans le répertoire de l'application et réutilisé automatiquement s'il est présent." t MSG_338 "Bootloader UEFI révoqué détecté" t MSG_339 "Rufus a détecté que l’ISO que vous avez sélectionnée contient un bootloader UEFI révoqué, qui devrait produire %s sur un système UEFI à jour, lorsque 'Secure Boot' est activé.\n\n- Si vous avez obtenu cette image ISO à partir d’une source douteuse, vous devriez envisager la possibilité qu’elle puisse contenir un logiciel malveillant, et éviter de démarrer à partir de celle-ci.\n- Si vous l’avez obtenu à partir d’une source fiable, vous devriez essayer de trouver une version plus récente, où cette notification ne se produit pas." t MSG_340 "un écran « Violation de sécurité »" @@ -4820,6 +4821,7 @@ t MSG_351 "Vérification de la revocation des bootloaders UEFI..." t MSG_352 "Vérification des mises à jour de DBX UEFI..." t MSG_353 "Mise à jour DBX disponible" t MSG_354 "Rufus a trouvé une mise à jour des fichiers DBX utilisés pour effectuer la validation des revocations Secure Boot sous UEFI. Voulez-vous télécharger cette mise à jour ?\n- Sélectionnez 'Oui' pour vous connecter à Internet et le télécharger ce contenu\n- Sélectionnez 'Non' pour annuler l’opération\n\nNote : Ces fichiers seront téléchargés dans le répertoire de l'application et réutilisés automatiquement si ils sont présent." +t MSG_355 "Image ISO" t MSG_900 "Rufus est un utilitaire permettant de formater et de créer des média USB amorçables, tels que clés USB, mémoire flash, etc." t MSG_901 "Site officiel : %s" t MSG_902 "Code source: %s" @@ -5214,7 +5216,7 @@ t MSG_333 "Ein lokales Benutzerkonto erstellen:" t MSG_334 "Regionale Optionen auf die gleichen Werte wie die dieses Benutzers setzen" t MSG_335 "Deaktivieren der automatischen BitLocker-Laufwerksverschlüsselung" t MSG_336 "Dauerhaftes Protokoll" -t MSG_337 "Eine zusätzliche Datei ('diskcopy.dll') muss von Microsoft heruntergeladen werden um MS-DOS zu installieren:\n- 'Ja' um eine Verbindung mit dem Internet herzustellen und die Datei herunterzuladen\n- 'Nein' um den Vorgang abzubrechen\n\nHinweis: Die Datei wird ins Programmverzeichnis heruntergeladen und bei Bedarf wiederverwendet." +t MSG_337 "Eine zusätzliche Datei ('%s') muss von Microsoft heruntergeladen werden um diese Funktion zu nutzen:\n- 'Ja' um eine Verbindung mit dem Internet herzustellen und die Datei herunterzuladen\n- 'Nein' um den Vorgang abzubrechen\n\nHinweis: Die Datei wird ins Programmverzeichnis heruntergeladen und bei Bedarf wiederverwendet." t MSG_338 "Zurückgezogenes UEFI Startprogramm erkannt" t MSG_339 "Rufus hat erkannt, dass das gewählte ISO-Image ein UEFI-Startprogramm enthält, dass zurückgezogen wurde und das führt zu %s, wenn das UEFI-System aktuell ist und Secure Boot aktiv ist.\n\n- Wenn Sie das ISO-Image aus einer unzuverlässigen Quelle haben, sollten Sie in Betracht ziehen, dass es UEFI-Schadcode enthält und es deshalb nicht verwenden.\n- Wenn Sie es aus einer vertrauenswürdigen Quelle haben, sollten Sie versuchen eine aktuellere Version zu bekommen, die dieses problem nicht hat." t MSG_340 "ein Bildschirm \"Sicherheitsverletzung\"" @@ -5630,7 +5632,7 @@ t MSG_333 "Δημιουργήστε έναν τοπικό λογαριασμό t MSG_334 "Ορίστε τις τοπικές επιλογές στις ίδιες τιμές με αυτές του χρήστη" t MSG_335 "Απενεργοποιήστε την αυτόματη κρυπτογράφηση συσκευής BitLocker" t MSG_336 "Διατήρηση log" -t MSG_337 "Πρέπει να γίνει λήψη ενός πρόσθετου αρχείου ('diskcopy.dll') από τη Microsoft για να εγκαταστήσετε το MS-DOS:\n- Επιλέξτε 'Ναι' για να συνδεθείτε στο Internet και να το κατεβάσετε\n- Επιλέξτε 'Όχι' για να ακυρώσετε τη λειτουργία\n\nΣημείωση: Το αρχείο θα ληφθεί στον κατάλογο της εφαρμογής και θα επαναχρησιμοποιηθεί αυτόματα εάν υπάρχει." +t MSG_337 "Πρέπει να κάνετε λήψη ενός επιπλέον αρχείου ('%s') από τη Microsoft για να χρησιμοποιήσετε αυτήν τη λειτουργία:\n- Επιλέξτε 'Ναι' για να συνδεθείτε στο Internet και να το κατεβάσετε\n- Επιλέξτε 'Όχι' για να ακυρώσετε τη λειτουργία\n\nΣημείωση: Το αρχείο θα ληφθεί στον κατάλογο της εφαρμογής και θα επαναχρησιμοποιηθεί αυτόματα εάν υπάρχει." t MSG_338 "Εντοπίστηκε ανακληθέν bootloader UEFI" t MSG_339 "Ο Rufus εντόπισε ότι το ISO που επιλέξατε περιέχει έναν bootloader UEFI που έχει ανακληθεί και θα παράγει %s, όταν η Ασφαλής Εκκίνηση είναι ενεργοποιημένη σε ένα πλήρως ενημερωμένο σύστημα UEFI.\n\n- Εάν λάβατε αυτήν την εικόνα ISO από μη αξιόπιστη πηγή, θα πρέπει να εξετάσετε το ενδεχόμενο να περιέχει κακόβουλο λογισμικό UEFI και να αποφύγετε την εκκίνηση από αυτό.\n- Εάν το λάβατε από αξιόπιστη πηγή, θα πρέπει να προσπαθήσετε να εντοπίσετε μια πιο ενημερωμένη έκδοση, η οποία δεν θα παράγει αυτήν την προειδοποίηση." t MSG_340 "μια οθόνη \"Παραβίαση ασφαλείας\"" @@ -6061,7 +6063,7 @@ t MSG_333 "יצירת חשבון מקומי עם שם המשתמש:" t MSG_334 "הגדרת אפשרויות האזור לאותם ערכים כמו של משתמש זה" t MSG_335 "השבתת הצפנת מכשיר אוטומטית של BitLocker" t MSG_336 "יומן קבוע" -t MSG_337 "יש להוריד קובץ נוסף ('diskcopy.dll') מ־Microsoft על מנת להתקין MS-DOS:\n- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד אותו\n- יש לבחור 'לא' כדי לבטל את הפעולה\n\nהערה: הקובץ יירד לספרייה בה ממוקם היישום וכל עוד הקובץ יהיה שם, Rufus ישתמש בו באופן אוטומטי במידת הצורך." +t MSG_337 "יש להוריד קובץ נוסף ('%s') ממיקרוסופט כדי להשתמש בתכונה זו:\n- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד אותו\n- יש לבחור 'לא' כדי לבטל את הפעולה\n\nהערה: הקובץ יירד לספרייה בה ממוקם היישום וכל עוד הקובץ יהיה שם, Rufus ישתמש בו באופן אוטומטי במידת הצורך." t MSG_338 "אותר מנהל אתחול UEFI שנאסר לשימוש" t MSG_339 "Rufus איתר שקובץ ה־ISO שבחרת מכיל מנהל אתחול UEFI שנאסר לשימוש ושיציג %s, כאשר Secure Boot מופעל על מערכת UEFI מעודכנת לחלוטין.\n\n- אם השגת את קובץ תמונת ISO זה ממקור מפוקפק, כדאי לשקול את האפשרות שייתכן שהוא מכיל נוזקת UEFI, ולהימנע מלאתחל ממנו.\n- אם השגת אותה ממקור מהימן, כדאי לנסות לאתר גרסה יותר עדכנית, שלא תציג אזהרה זו." t MSG_340 "מסך \"הפרת אבטחה\"" @@ -6483,7 +6485,7 @@ t MSG_333 "Helyi fiók létrehozása ezzel a felhasználónévvel:" t MSG_334 "A jelenlegi felhasználó területi beállításainak használata" t MSG_335 "BitLocker automatikus eszköz titkosítás letiltása" t MSG_336 "Tartós naplózás" -t MSG_337 "Az MS-DOS telepítéséhez egy további fájlt ('diskcopy.dll') kell letölteni a Microsofttól:\n- Válaszd az 'Igen' gombot az internethez történő kapcsolódáshoz, és a fájl letöltéséhez\n- Válaszd a 'Nem' gombot a művelet megszakításához\n\nMegjegyzés: A fájl a program mappájába lesz letöltve, és automatikusan újra lesz használva, ha létezik." +t MSG_337 "A funkció használatához egy további fájlt ('%s') kell letölteni a Microsofttól:\n- Válaszd az 'Igen' gombot az internethez történő kapcsolódáshoz, és a fájl letöltéséhez\n- Válaszd a 'Nem' gombot a művelet megszakításához\n\nMegjegyzés: A fájl a program mappájába lesz letöltve, és automatikusan újra lesz használva, ha létezik." t MSG_338 "Visszavont UEFI rendszerbetöltő detektálva" t MSG_339 "A Rufus észlelte, hogy a kiválasztott ISO egy olyan UEFI rendszerbetöltőt tartalmaz, amelyet visszavontak, és ha a Secure Boot engedélyezve van egy teljesen naprakész UEFI rendszeren, akkor ehhez vezet: %s.\n\n- Ha ezt az ISO képet nem megbízható forrásból szerezted be, akkor számolnod kell azzal a lehetőséggel, hogy UEFI kártevőt tartalmazhat, és elkerülendő az erről történő rendszerindítás.\n- Ha megbízható forrásból szerezted be, akkor próbálj meg egy naprakészebb verziót találni, amelyre ez a figyelmeztetés nem jelenik meg." t MSG_340 "\"Security Violation\" képernyő" @@ -7295,7 +7297,7 @@ t MSG_333 "Crea account locale con nome utente:" t MSG_334 "Imposta opzioni regionali agli stessi valori di questo utente" t MSG_335 "Disabilita la crittografia automatica dei dispositivi BitLocker" t MSG_336 "Log persistente" -t MSG_337 "Per installare MS-DOS è necessario scaricare da Microsoft un file aggiuntivo (\"diskcopy.dll\"):\n- Seleziona 'Sì' per connettersi ad internet e scaricarlo\n- Seleziona 'No' per annullare l'operazione\n\nNota: il file verrà scaricato nella cartella dell'applicazione e se presente verrà riutilizzato automaticamente." +t MSG_337 "Per utilizzare questa funzionalità è necessario scaricare un file aggiuntivo ('%s') da Microsoft:\n- Seleziona 'Sì' per connettersi ad internet e scaricarlo\n- Seleziona 'No' per annullare l'operazione\n\nNota: il file verrà scaricato nella cartella dell'applicazione e se presente verrà riutilizzato automaticamente." t MSG_338 "Rilevato bootloader UEFI revocato" t MSG_339 "Rufus ha rilevato che l'ISO selezionata contiene un bootloader UEFI che è stato revocato e che quando Secure Boot è abilitato su un sistema UEFI completamente aggiornato produrrà %s. \n\n- Se hai ottenuto questa immagine ISO da una sorgente non affidabile, dovresti considerare la possibilità che possa contenere malware UEFI ed evitare di eseguire l'avvio da esso.\n- Se l'hai ottenuto da una sorgente attendibile, dovresti provare a cercare una versione più aggiornata, che non genererà questo avviso." t MSG_340 "una schermata \"Violazione sicurezza\"" @@ -7716,7 +7718,7 @@ t MSG_333 "ローカルアカウントを次の名前で作成:" t MSG_334 "地域設定をこのユーザーと同じものに設定" t MSG_335 "BitLocker 自動デバイス暗号化を無効化します。" t MSG_336 "永続ログ" -t MSG_337 "MS-DOSをインストールするにはMicrosoftから追加のファイル(diskcopy.dll)をダウンロードする必要があります。\n- はいを選択すると、インターネットに接続しダウンロードします。\n- いいえを選択すると、キャンセルします\n\n注意:ファイルはアプリケーションのディレクトリへダウンロードされ、今後自動的に再利用されます。" +t MSG_337 "この機能を使用するには、Microsoft から追加のファイル ('%s') をダウンロードする必要があります:\n- はいを選択すると、インターネットに接続しダウンロードします。\n- いいえを選択すると、キャンセルします\n\n注意:ファイルはアプリケーションのディレクトリへダウンロードされ、今後自動的に再利用されます。" t MSG_338 "無効なUEFIブートローダーが検出されました。" t MSG_339 "Rufusは選択されたISOイメージが無効なUEFIブートローダーを含み、最新のUEFIでセキュアブートが有効である場合%sを引き起こすことを検出しました。\n\n- このファイルが信頼できないソースから入手されたものであれば、マルウェア混入の可能性があるため起動しないことをお勧めします。\n- このファイルが信頼できるソースから取得したものであれば、警告が発生しない新しいバージョンを探すことをお勧めします。" t MSG_340 "セキュリティ侵害表示" @@ -8138,7 +8140,7 @@ t MSG_333 "사용자 이름으로 로컬 계정 만들기:" t MSG_334 "이 사용자의 값과 동일한 값을 사용하여 국가별 옵션 설정" t MSG_335 "BitLocker 자동 장치 암호화 사용 안 함" t MSG_336 "영구 로그" -t MSG_337 "MS-DOS를 설치하려면 Microsoft에서 추가 파일 ('diskcopy.dll')을 다운로드해야 합니다:\n- 인터넷에 연결하여 다운로드하려면 '예'를 선택합니다\n- 작업을 취소하려면 '아니오'를 선택합니다\n\n참고: 해당 파일은 응용 프로그램의 디렉터리에 다운로드되며 존재하는 경우 자동으로 재사용됩니다." +t MSG_337 "이 기능을 사용하려면 Microsoft에서 추가 파일('%s')을 다운로드해야 합니다:\n- 인터넷에 연결하여 다운로드하려면 '예'를 선택합니다\n- 작업을 취소하려면 '아니오'를 선택합니다\n\n참고: 해당 파일은 응용 프로그램의 디렉터리에 다운로드되며 존재하는 경우 자동으로 재사용됩니다." t MSG_338 "취소된 UEFI 부트로더가 탐지됨" t MSG_339 "Rufus는 사용자가 선택한 ISO에 취소된 UEFI 부트로더가 포함되어 있으며, 이는 완전히 최신 UEFI 시스템에서 보안 부팅이 활성화된 경우에 %s을(를) 생성한다는 것을 감지했습니다.\n\n- 평판이 좋지 않은 소스에서 이 ISO 이미지를 가져온 경우 UEFI 멀웨어가 포함되어 있을 가능성을 고려하고 부팅을 피해야 합니다.\n- 신뢰할 수 있는 소스에서 가져온 경우에는 보다 최신 버전을 찾아야 합니다. 그러면 이 경고가 발생하지 않습니다.." t MSG_340 "\"보안 위반\" 화면" @@ -8560,7 +8562,7 @@ t MSG_333 "Izveidot lokālo kontu ar lietotājvārdu:" t MSG_334 "Izvēlēties reģionālos uzstādījumus kā šim lietotājam" t MSG_335 "Atslēgt automātisko šifrēšanu ar BitLocker" t MSG_336 "Pastāvīgs žurnāls" -t MSG_337 "Lai instalēt MS-DOS no Microsoft vietnes nepieciešams lejuplādēt papildus failu («diskcopy.dll»):\n- Izvēlieties «Jā», lai pieslēgties pie Interneta un failu lejuplādēt.\n- Izvēlieties «Nē», lai atcelt darbību.\n\nPiezīme. Fails tiks lejuplādēts programmas mapē, ja tas jau eksistē, tiks izmantots atkārtoti." +t MSG_337 "Lai izmantotu šo funkciju, no Microsoft ir jālejupielādē papildu fails («%s»):\n- Izvēlieties «Jā», lai pieslēgties pie Interneta un failu lejuplādēt.\n- Izvēlieties «Nē», lai atcelt darbību.\n\nPiezīme. Fails tiks lejuplādēts programmas mapē, ja tas jau eksistē, tiks izmantots atkārtoti." t MSG_338 "Pamanīts atceltais UEFI ielādes ieraksts" t MSG_339 "Rufus konstatēja Jūsu izvēlētais ISO-fails satur atceltu UEFI ielādes ierakstu, kurš izdos %s, ja būs ieslēgta drošā ielāde pilnīgi jauninātajā UEFI sistēmā.\n\n- Ja šis ISO fails ir iegūts no nedrošiem avotiem, vajag ņemt vērā, ka tas var saturēt UEFI ļaunatūru un censties no tā nestartēt.\n- Ja fails iegūts no droša avota, būtu jāatrod jaunāka versija, kurai nerādīs šādu brīdinājumu." t MSG_340 "a \"Drošības pārkāpuma\" ekrāns" @@ -9788,7 +9790,7 @@ t MSG_333 "Lag en lokal brukerkonto med brukernavnet:" t MSG_334 "Sett regionale innstillinger til det samme som den aktive brukerkontoen" t MSG_335 "Deaktiver BitLocker kryptering av enheten" t MSG_336 "Behold log" -t MSG_337 "En ekstra fil ('diskcopy.dll') må lastes ned fra Microsoft for å installere MS-DOS:\n- Velg \"Ja\" for å koble til Internett og laste den ned\n- Velg 'Nei' for å avbryte operasjonen\n\nMerk: Filen vil bli lastet ned i programmets katalog og vil automatisk bli gjenbrukt hvis den er tilstede." +t MSG_337 "En ekstra fil ('%s') må lastes ned fra Microsoft for å bruke denne funksjonen:\n- Velg 'Ja' for å koble til Internett og laste den ned\n- Velg 'Nei' for å avbryte operasjonen\n\nMerk: Filen vil bli lastet ned i programmets katalog og vil automatisk bli gjenbrukt hvis den er tilstede." t MSG_338 "Opphevet UEFI bootloader oppdaget" t MSG_339 "Rufus oppdaget at ISO-en du har valgt inneholder en UEFI-oppstartslaster som har blitt tilbakekalt og som vil produsere %s, når sikker oppstart er aktivert på et fullstendig oppdatert UEFI-system.\n\n- Hvis du har fått dette ISO-bildet fra en ikke-anerkjent kilde, bør du vurdere muligheten for at det kan inneholde UEFI-malware og unngå å starte opp fra det.\n- Hvis du har fått det fra en pålitelig kilde, bør du prøve å finne en mer oppdatert versjon, som ikke vil gi denne advarselen." t MSG_340 "en \"Sikkerhetsbrudd\"-skjerm" @@ -10219,7 +10221,7 @@ t MSG_333 "یک حساب کاربری محلی با نام کاربری ایجا t MSG_334 "گزینه های منطقه ای را روی همان مقادیر این کاربر تنظیم کنید" t MSG_335 "رمزگذاری خودکار دستگاه BitLocker را غیرفعال کنید" t MSG_336 "لیست مداوم" -t MSG_337 "فایل دیگری ('diskcopy.dll:) نیاز است دانلود شود از مایکروسافت برای نصب MS-DOS:\n- انتخاب :'بله' برای وصل شدن به اینترنت و دانلود آن\n- انتخاب 'نه' برای کنسل کردن این کار\n\nنکته: فایل در مکان نرم افزار دانلود میشود و دوباره استفاده میشود درصورت انجام مجدد این کار." +t MSG_337 "برای استفاده از این ویژگی، باید یک فایل اضافی ('%s') از مایکروسافت دانلود شود:\n- انتخاب :'بله' برای وصل شدن به اینترنت و دانلود آن\n- انتخاب 'نه' برای کنسل کردن این کار\n\nنکته: فایل در مکان نرم افزار دانلود میشود و دوباره استفاده میشود درصورت انجام مجدد این کار." t MSG_338 "بوت لودر UEFI کنسل شده شناسایی شد" t MSG_339 "Rufus متوجه شده که فایل ISO که انتخاب کردید دارای UEFI بوت لودری است که لفو شده و باعث %s, درصورتی که بوت امن فعال شده بر روی سیستم کاملا اپدیت شده UEFI\v\v- اگه شما این فایل ISO رو از یک جای غیر قابل اعتماد دریافت کردید ممکن است این فایل دارای ویروس UEFI باشد و نباید آنرا بوت کرد \n\v- اگه شما شما از جای مورد اغفماد دریافت کردیدش, میتونید تلاش کنید برای پیدا کردن نسخه جدیدتر, با اینکار دیگر این هشتار را دریافت نمیکنید." t MSG_340 "یک صفحه \"مشکلی امنیتی\"" @@ -10636,7 +10638,7 @@ t MSG_333 "Stwórz konto lokalne o nazwie użytkownika:" t MSG_334 "Ustaw taką samą lokalizację i wartości jak obecny użytkownik" t MSG_335 "Dezaktywuj automatyczne szyfrowanie BitLocker" t MSG_336 "Stały dziennik (log)" -t MSG_337 "Dodatkowy plik (\"diskcopy.dll\") musi zostać pobrany od Microsoft, żeby zainstalować MS-DOS:\n- Wybierz opcję \"Tak\", aby pobrać pliku z internetu\n- Wybierz opcję \"Nie\", aby anulować operację\n\nUwaga: Plik zostanie pobrany do folderu aplikacji i będzie użyty ponownie, gdy będzie dostępny." +t MSG_337 "Aby móc korzystać z tej funkcji, należy pobrać dodatkowy plik (\"%s\") z witryny firmy Microsoft:\n- Wybierz opcję \"Tak\", aby pobrać pliku z internetu\n- Wybierz opcję \"Nie\", aby anulować operację\n\nUwaga: Plik zostanie pobrany do folderu aplikacji i będzie użyty ponownie, gdy będzie dostępny." t MSG_338 "Wykryto unieważniony bootloader UEFI" t MSG_339 "Rufus wykrył, że wybrany plik ISO zawiera bootloader UEFI, który został unieważniony, i który wygeneruje %s. gdy włączony zostanie \"Secure Boot\" w pełni zaktualizowanym systemie UEFI.\n\n- Jeśli uzyskałeś ten obraz ISO z niezaufanego źródła, powinieneś rozważyć możliwość, że może on zawierać złośliwe oprogramowanie dla UEFI i unikać jego uruchamiania.\n- Jeśli uzyskałeś go z zaufanego źródła, powinieneś spróbować znaleźć nowszą wersję, która nie wygeneruje tego ostrzeżenia." t MSG_340 "ekran \"Naruszenie Bezpieczeństwa\"" @@ -11052,7 +11054,7 @@ t MSG_333 "Criar uma conta local com nome de usuário:" t MSG_334 "Definir as opções regionais com os mesmos valores deste usuário" t MSG_335 "Desativar a encriptação automática BitLocker" t MSG_336 "Registo persistente" -t MSG_337 "Um arquivo adicional ('diskcopy.dll') precisa ser baixado da Microsoft para instalar o MS-DOS:\n- Selecione 'Sim' para se conectar à Internet e baixá-lo\n- Selecione 'Não' para cancelar a operação\n\nNota: O arquivo será baixado no diretório da aplicação e será reutilizado automaticamente caso presente." +t MSG_337 "Um arquivo adicional ('%s') precisa ser baixado da Microsoft para usar este recurso:\n- Selecione 'Sim' para se conectar à Internet e baixá-lo\n- Selecione 'Não' para cancelar a operação\n\nNota: O arquivo será baixado no diretório da aplicação e será reutilizado automaticamente caso presente." t MSG_338 "Detectado carregador de inicialização UEFI revogado" t MSG_339 "Rufus detectou que o ISO selecionado contém um carregador de inicialização UEFI que foi revogado e produzirá %s quando Secure Boot estiver habilitado em um sistema UEFI atualizado.\n\n- Se você obteve essa imagem ISO de uma fonte não confiável, você deve considerar a possibilidade da mesma conter malware UEFI e evitar inicializar através dela.\n- Se você a obteve de uma fonte confiável, você deve tentar achar uma versão mais recente, que não produza este aviso." t MSG_340 "uma tela \"Security Violation\"" @@ -11469,7 +11471,7 @@ t MSG_333 "Criar uma conta local com o nome de utilizador:" t MSG_334 "Definir as opções regionais com os mesmos valores deste utilizador" t MSG_335 "Desativar a encriptação automática BitLocker" t MSG_336 "Registo permanente (log)" -t MSG_337 "Um ficheiro adicional ('diskcopy.dll') deve ser transferido da Microsoft para instalar o MS-DOS:\n- Selecione 'Sim' para se ligar à Internet e descarregá-lo\n- Selecione 'Não' para cancelar a operação\n\nNota: O ficheiro será transferido para a pasta da aplicação e será reutilizado automaticamente se estiver presente." +t MSG_337 "Um ficheiro adicional ('%s') deve ser transferido da Microsoft para utilizar esta funcionalidade:\n- Selecione 'Sim' para se ligar à Internet e descarregá-lo\n- Selecione 'Não' para cancelar a operação\n\nNota: O ficheiro será transferido para a pasta da aplicação e será reutilizado automaticamente se estiver presente." t MSG_338 "Detetado carregador de arranque UEFI revogado" t MSG_339 "O Rufus detetou que a ISO que selecionou contém um carregador de arranque UEFI que foi revogado e que produzirá %s, quando o Arranque Seguro está ativado num sistema UEFI totalmente atualizado.\n\n- Se obteve esta imagem ISO de uma fonte não segura, deve considerar a possibilidade de que a mesma possa conter malware UEFI e evitar arrancar a partir dela.\n- Se a obteve de uma fonte segura, deve tentar localizar uma versão mais atualizada, que não produza este aviso." t MSG_340 "um ecrã de \"Violação de Segurança\"" @@ -11889,7 +11891,7 @@ t MSG_333 "Crează un cont local cu nume de utilizator:" t MSG_334 "Serează opțiunile regionale să aibă aceleași valori ca acestui utilizator" t MSG_335 "Blochează BitLocker de la encriptarea automată a dispozitivului" t MSG_336 "Logare persistentă" -t MSG_337 "Un fișier adițional ('diskcopy.dll') trebuie să fie descărcat de la Microsoft pentru a instala MS-DOS:\n- Selectează 'Da' ca să te conectezi la Internet și să le descarci\n- Selectează 'Nu' pentru a anula operațiunea\n\nNotiță: Acest fișier va fi descărcat in aceeași locație cu aplicația și va fi reutilizat automat dacă este prezent." +t MSG_337 "Un fișier adițional ('%s') trebuie să fie descărcat de la Microsoft pentru a utiliza această funcție:\n- Selectează 'Da' ca să te conectezi la Internet și să le descarci\n- Selectează 'Nu' pentru a anula operațiunea\n\nNotiță: Acest fișier va fi descărcat in aceeași locație cu aplicația și va fi reutilizat automat dacă este prezent." t MSG_338 "Bootloader UEFI nepermis detectat" t MSG_339 "Rufus a detectat că fișierul ISO care lai selectat conține un bootloader UEFI care nu este permis si ar produce %s, cand Secure Boot este activat pe un system UEFI actualizat.\n\n- Dacă ai făcut rost de aceasta imagine ISO de la o sursă de neîncredere, este recomandat să consideri posibilitatea că ar putea conține malware UEFI ce nu ar permite pornirea de la aceasta.\n- Dacă ai făcut rost de aceasta de la o sursă de încredere, ar putea fi necesară căutarea unei versiuni mai noi, care nu ar produce acest avertisment." t MSG_340 "un ecran de \"Încălcare de Securitate\"" @@ -12317,7 +12319,7 @@ t MSG_333 "Создать локальную учётную запись с им t MSG_334 "Установить те же региональные параметры, что и для этого пользователя" t MSG_335 "Отключить автоматическое шифрование устройств BitLocker" t MSG_336 "Постоянный журнал" -t MSG_337 "Для установки MS-DOS необходимо загрузить дополнительный файл (diskcopy.dll) с сайта Microsoft:\n 'Да' - загрузить его из Интернета\n 'Нет' - отменить операцию\n\n* Файл загрузится в папку приложения, если там есть одноимённый файл, он будет автоматически перезаписан." +t MSG_337 "Для использования этой функции необходимо загрузить дополнительный файл ('%s') с сайта Microsoft:\n 'Да' - загрузить его из Интернета\n 'Нет' - отменить операцию\n\n* Файл загрузится в папку приложения, если там есть одноимённый файл, он будет автоматически перезаписан." t MSG_338 "Обнаружен отозванный загрузчик UEFI" t MSG_339 "Выбранный образ ISO содержит отозванный загрузчик UEFI, который выдаёт %s, когда безопасная загрузка включена в полностью обновленной системе UEFI.\n\n- Если вы получили этот образ ISO из ненадёжного источника, учтите, что он может содержать вредоносное ПО UEFI, и не загружайтесь с него.\n- Если вы получили его из надёжного источника, попробуйте найти более новую версию, которая не будет выдавать это предупреждение." t MSG_340 "экран нарушения безопасности" @@ -12738,7 +12740,7 @@ t MSG_333 "Kreiraj lokalni nalog sa imenom:" t MSG_334 "Stavi regionalnu opciju na istu vrednost kao i ovaj korisnik" t MSG_335 "Onemogući BitLocker automatsku enkripciju uređaja" t MSG_336 "Trajna evidencija" -t MSG_337 "Додатна датотека ('diskcopy.dll') мора да се преузме са Microsoft-a да би се инсталирао MS-DOS:\n- Изаберите „Да“ да бисте се повезали на Интернет и преузели га\n- Изаберите „Не“ да бисте отказали операцију\n\nНапомена: Датотека ће бити преузета у директоријум апликације и аутоматски ће се поново користити ако постоји." +t MSG_337 "Додатна датотека („%s“) мора да се преузме са Microsoft-а да бисте користили ову функцију:\n- Изаберите „Да“ да бисте се повезали на Интернет и преузели га\n- Изаберите „Не“ да бисте отказали операцију\n\nНапомена: Датотека ће бити преузета у директоријум апликације и аутоматски ће се поново користити ако постоји." t MSG_338 "Откривен је опозвани UEFI покретач" t MSG_339 "Руфус је открио да ISO који сте изабрали садржи UEFI покретач који је опозван и који ће произвести %s када је безбедно покретање омогућено на потпуно ажурираном UEFI систему.\n\n- Ако сте ову ISO слику добили од неугледног извора, требало би да размотрите могућност да садржи UEIFI малвер и избегавајте покретање са њега.\n- Ако сте га добили од поузданог извора, покушајте да пронађете новију верзију, која неће произвести ово упозорење." t MSG_340 "екран „Нарушавање безбедности“" @@ -13157,7 +13159,7 @@ t MSG_333 "Vytvorte si lokálny účet s používateľským menom:" t MSG_334 "Nastaviť miestne možnosti na rovnaké hodnoty, ako možnosti tohto používateľa" t MSG_335 "Vypnutie automatického šifrovania zariadenia BitLocker" t MSG_336 "Trvalý záznam činností" -t MSG_337 "Pre inštaláciu systému MS-DOS je potrebné prevziať od spoločnosti Microsoft ďalší súbor („diskcopy.dll\"):\n- Výberom možnosti „Áno\" ho stiahnete z internetu\n- Výberom možnosti „Nie\" zrušíte operáciu\n\nPoznámka: Súbor sa stiahne do adresára aplikácie a automaticky sa znova použije, ak je k dispozícii." +t MSG_337 "Na použitie tejto funkcie je potrebné prevziať od spoločnosti Microsoft ďalší súbor („%s“):\n- Výberom možnosti „Áno\" ho stiahnete z internetu\n- Výberom možnosti „Nie\" zrušíte operáciu\n\nPoznámka: Súbor sa stiahne do adresára aplikácie a automaticky sa znova použije, ak je k dispozícii." t MSG_338 "Bol zistený zrušený zavádzač UEFI" t MSG_339 "Program Rufus zistil, že ISO, ktoré ste vybrali, obsahuje zavádzač UEFI, ktorý bol zrušený a ktorý bude produkovať %s, keď je povolené zabezpečené spustenie na plne aktuálnom systéme UEFI.\n\n- Ak ste tento obraz ISO získali z neseriózneho zdroja, mali by ste zvážiť možnosť, že by mohol obsahovať malvér UEFI a vyhnúť sa bootovaniu z neho.\n- Ak ste ho získali z dôveryhodného zdroja, mali by ste sa pokúsiť nájsť aktuálnejšiu verziu, ktorá toto upozornenie nespustí." t MSG_340 "obrazovka „Narušenie bezpečnosti\"" @@ -13579,7 +13581,7 @@ t MSG_333 "Ustvarite lokalni račun z uporabniškim imenom:" t MSG_334 "Nastavite regionalne možnosti na enake vrednosti, kot jih ima ta uporabnik" t MSG_335 "Onemogoči samodejno šifriranje naprave BitLocker" t MSG_336 "Trajni dnevnik" -t MSG_337 "Za namestitev MS-DOS je treba od Microsofta prenesti dodatno datoteko ('diskcopy.dll'):\n- Izberite 'Da', da se povežete z internetom in jo prenesete\n- Izberite 'Ne', da prekličete operacijo\n\nOpomba: datoteka bo prenesena v imenik aplikacije in samodejno ponovno uporabljena, če je prisotna." +t MSG_337 "Za uporabo te funkcije je treba od Microsofta prenesti dodatno datoteko ('%s'):\n- Izberite 'Da', da se povežete z internetom in jo prenesete\n- Izberite 'Ne', da prekličete operacijo\n\nOpomba: datoteka bo prenesena v imenik aplikacije in samodejno ponovno uporabljena, če je prisotna." t MSG_338 "Zaznan preklican zagonski nalagalnik UEFI" t MSG_339 "Rufus je zaznal, da ISO, ki ste ga izbrali, vsebuje zagonski nalagalnik UEFI, ki je bil preklican in bo ustvaril %s, ko je varen zagon omogočen v popolnoma posodobljenem sistemu UEFI.\n\n- Če ste to ISO sliko pridobili iz neuglednega vira, razmislite o možnosti, da morda vsebuje zlonamerno programsko opremo UEFI, in se izogibajte zagonu iz nje.\n- Če ste jo pridobili iz zaupanja vrednega vira, poskusite poiskati posodobljenejšo različico, ki tega ne bo povzročila tega opozorila." t MSG_340 "zaslon \"Kršitev varnosti\"." @@ -13992,7 +13994,7 @@ t MSG_333 "Crear una cuenta local con nombre de usuario:" t MSG_334 "Establezca las opciones regionales en los mismos valores que las de este usuario" t MSG_335 "Deshabilitar el cifrado automático de dispositivos BitLocker" t MSG_336 "Registro persistente" -t MSG_337 "Se debe descargar un archivo adicional ('diskcopy.dll') de Microsoft para instalar MS-DOS:\n- Seleccione 'Sí' para conectarse a Internet y descargarlo\n- Seleccione 'No' para cancelar la operación.\n\nNota: El archivo se descargará en el directorio de la aplicación y se reutilizará automáticamente si está presente." +t MSG_337 "Se debe descargar un archivo adicional ('%s') de Microsoft para usar esta función:\n- Seleccione 'Sí' para conectarse a Internet y descargarlo\n- Seleccione 'No' para cancelar la operación.\n\nNota: El archivo se descargará en el directorio de la aplicación y se reutilizará automáticamente si está presente." t MSG_338 "Se detectó un gestor de arranque UEFI revocado" t MSG_339 "Rufus detectó que el ISO que seleccionó contiene un gestor de arranque UEFI que ha sido revocado y que producirá %s, cuando el arranque seguro esté habilitado en un sistema UEFI completamente actualizado.\n\n- Si obtuvo esta imagen ISO de una fuente no confiable, debe considerar la posibilidad de que contenga malware UEFI y evitar arrancar desde allí.\n- Si lo obtuvo de una fuente confiable, debe intentar localizar una versión más actualizada, que no producirá esta advertencia." t MSG_340 "una pantalla de \"violación de seguridad\"" @@ -14405,7 +14407,7 @@ t MSG_333 "Skapa ett lokalt konto med användarnamn:" t MSG_334 "Ställ in regionala alternativ till samma värden som denna användares" t MSG_335 "Inaktivera BitLockers automatiska enhetskryptering" t MSG_336 "Bestående logg" -t MSG_337 "En fil (diskcopy.dll) måste laddas ner från Microsoft för att installera MS-DOS:\n- Välj \"Ja\" för att ansluta till Internet och ladda ner den\n- Välj \"Nej\" för att avbryta operationen\n\nObs: Filen kommer att laddas ner i programmets katalog och kommer att återanvändas automatiskt om den finns." +t MSG_337 "En fil (%s) måste laddas ner från Microsoft för att använda den här funktionen:\n- Välj \"Ja\" för att ansluta till Internet och ladda ner den\n- Välj \"Nej\" för att avbryta operationen\n\nObs: Filen kommer att laddas ner i programmets katalog och kommer att återanvändas automatiskt om den finns." t MSG_338 "Återkallad UEFI-starthanterare upptäcktes" t MSG_339 "Rufus upptäckte att den ISO-filen du har valt innehåller en UEFI-starthanterare som har återkallats och som kommer att producera %s, när \"Secure Boot\" är aktiverat på ett helt uppdaterat UEFI-system.\n\n- Om du skaffade den här ISO-avbilden från en icke ansedd källa bör du överväga möjligheten att den kan innehålla UEFI-skadlig programvara och undvika att starta från den.\n- Om du har fått det från en pålitlig källa bör du försöka hitta en mer uppdaterad version som inte ger den här varningen." t MSG_340 "en \"Säkerhetsöverträdelseskärm\"" @@ -14823,7 +14825,7 @@ t MSG_333 "สร้างบัญชีผู้ใช้ด้วยชื่ t MSG_334 "ตั้งค่าภูมิภาคให้ตรงกับค่าที่ใช้บนคอมพิวเตอร์เครื่องนี้" t MSG_335 "ยกเลิกการใช้ BitLocker เข้ารหัสอุปกรณ์อัตโนมัติ" t MSG_336 "Log แบบถาวร" -t MSG_337 "มีความจำเป็นต้องดาวน์โหลดไฟล์ ('diskcopy.dll') จาก Microsoft เพื่อติดตั้ง MS-DOS:\n- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n- เลือก 'No' เพื่อยกเลิก\n\nหมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และเมื่อไฟล์ '%s มีแล้ว ไฟล์จะถูกเลือกใช้โดยอัตโนมัติ" +t MSG_337 "มีความจำเป็นต้องดาวน์โหลดไฟล์ ('%s') จาก Microsoft เพื่อใช้ฟีเจอร์นี้:\n- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n- เลือก 'No' เพื่อยกเลิก\n\nหมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และเมื่อไฟล์ '%s มีแล้ว ไฟล์จะถูกเลือกใช้โดยอัตโนมัติ" t MSG_338 "ตรวจพบ UEFI bootloader ที่ถูกเพิกถอน" t MSG_339 "Rufus ตรวจพบว่าไฟล์ ISO ที่คุณเลือกมี UEFI bootloader ที่ถูกเพิกถอน ซึ่งตุณอาจจะเจอกับ%s เมื่อ SecureBoot เปิดใช้งานบนระบบ UEFI ที่ทันสมัย\n\n- ถ้าคุณได้ไฟล์ ISO นี้มาจากแหล่งที่ไม่น่าเชื่อถือ คุณควรตระหนักถึงความเป็นไปได้ที่ไฟล์ดังกล่าวอาจมี UEFI malware และหลีกเลี่ยงการบูตจากอิมเมจดังกล่าว\n- ถ้าคุณได้ไฟล์ ISO นี้มาจากแหล่งที่เชื่อถือได้ คุณควรพยายามค้นหาเวอร์ชันที่ทันสมัยกว่านี้ ซึ่งจะไม่ทำให้เกิดคำเตือนนี้" t MSG_340 "หน้าจอ \"Security Violation\"" @@ -15241,7 +15243,7 @@ t MSG_333 "Kullanıcı adı ile yerel bir hesap oluşturun:" t MSG_334 "Bölgesel seçenekleri bu kullanıcınınkiyle aynı değerlere ayarlayın" t MSG_335 "BitLocker otomatik cihaz şifrelemesini devre dışı bırakın" t MSG_336 "Kalıcı günlük" -t MSG_337 "MS-DOS'u yüklemek için Microsoft'tan ek bir dosyanın ('diskcopy.dll') indirilmesi gerekir:\n- İnternete bağlanıp indirmek için 'Evet'i seçin\n- İşlemden vazgeçmek için 'Hayır'ı seçin\n\nNot: Dosya uygulamanın dizinine indirilecek ve varsa otomatik olarak yeniden kullanılacaktır." +t MSG_337 "Bu özelliği kullanmak için Microsoft'tan ek bir dosyanın ('%s') indirilmesi gerekir:\n- İnternete bağlanıp indirmek için 'Evet'i seçin\n- İşlemden vazgeçmek için 'Hayır'ı seçin\n\nNot: Dosya uygulamanın dizinine indirilecek ve varsa otomatik olarak yeniden kullanılacaktır." t MSG_338 "İptal edilen UEFI önyükleyici algılandı" t MSG_339 "Rufus, seçtiğiniz ISO'nun iptal edilmiş bir UEFI önyükleyici içerdiğini ve tamamen güncel bir UEFI sisteminde Güvenli Önyükleme etkinleştirildiğinde %s oluşturacağını algıladı.\n\n- Bu ISO görüntüsünü saygın olmayan bir kaynaktan aldıysanız, bunun UEFI kötü amaçlı yazılım içerme olasılığını göz önünde bulundurmalı ve bu görüntüden önyükleme yapmaktan kaçınmalısınız.\n- Eğer güvenilir bir kaynaktan aldıysanız bu uyarıyı vermeyecek daha güncel bir versiyon bulmaya çalışmalısınız." t MSG_340 "\"Güvenlik İhlali\" ekranı" @@ -15668,7 +15670,7 @@ t MSG_333 "Створити локальний обліковий запис з t MSG_334 "Встановити регіональні параметри на такі самі, як у поточного користувача" t MSG_335 "Вимкнути автоматичне шифрування пристрою BitLocker" t MSG_336 "Постійний журнал" -t MSG_337 "Необхідно завантажити додатковий файл ('diskcopy.dll') з сайту Microsoft для встановлення MS-DOS:\n- Виберіть 'Так' для з'єднання з інтернетом та його завантаження\n- Виберіть 'Ні' для скасування операції\n\nПримітка: файл буде завантажено в каталог додатку та повторно використано за наявності." +t MSG_337 "Щоб скористатися цією функцією, необхідно завантажити додатковий файл ('%s') з веб-сайту Microsoft:\n- Виберіть 'Так' для з'єднання з інтернетом та його завантаження\n- Виберіть 'Ні' для скасування операції\n\nПримітка: файл буде завантажено в каталог додатку та повторно використано за наявності." t MSG_338 "Виявлено відкликаний завантажувач UEFI" t MSG_339 "Rufus виявив, що вибраний ISO містить відкликаний завантажувач UEFI, що буде створювати %s, коли в оновленій системі UEFI буде ввімкнено безпечне завантаження.\n\n- Якщо ви отримали цей образ з неперевіреного джерела, Вам слід розглянути можливість того, що він може містити зловмисне ПЗ і уникнути завантаження з нього.\n- Якщо ви отримали цей образ з довіреного джерела, Вам слід спробувати знайти більш актуальну версію, що не буде провокувати це попередження." t MSG_340 "вікно \"Security Violation\"" @@ -16084,7 +16086,7 @@ t MSG_333 "Tạo tài khoản nội bộ với tên người dùng:" t MSG_334 "Đặt các cài đặt địa phương cùng giá trị với người dùng hiện tại" t MSG_335 "Vô hiệu tự động mã hoá thiết bị BitLocker" t MSG_336 "Nhật ký lưu vĩnh viễn" -t MSG_337 "Một tệp tin bổ sung ('diskcopy.dll') phải được tải về từ Microsoft để cài đặt MS-DOS:\n- Chọn 'Có' để kết nối tới Internet và tải nó xuống\n- Chọn 'Không' để huỷ tiến trình\n\nGhi chú: Tệp tin sẽ được tải xuống tại đường dẫn của phần mềm và sẽ được tự động tái sử dụng nếu có sẵn." +t MSG_337 "Một tệp tin bổ sung ('%s') từ Microsoft để sử dụng tính năng này:\n- Chọn 'Có' để kết nối tới Internet và tải nó xuống\n- Chọn 'Không' để huỷ tiến trình\n\nGhi chú: Tệp tin sẽ được tải xuống tại đường dẫn của phần mềm và sẽ được tự động tái sử dụng nếu có sẵn." t MSG_338 "Đã phát hiện bộ khởi động UEFI bị thu hồi" t MSG_339 "Rufus đã phát hiện ra rằng tệp ISO bạn đã chọn có chứa một bộ khởi động UEFI đã bị thu hồi và nó sẽ tạo ra %s, khi Secure Boot được kích hoạt trên một hệ thống UEFI được cập nhật đầy đủ và mới nhất.\n\n- Nếu bạn sở hữu tệp ISO này từ một nguồn không đáng tin cậy, bạn nên cân nhắc khả năng có thể chứa mã độc UEFI và tránh khởi động từ nó.\n- Nếu bạn sở hữu từ một nguồn uy tín, bạn nên thử tìm một bản mới hơn, theo đó cảnh báo này sẽ không hiện ra." t MSG_340 "một màn hình \"Vi phạm Bảo mật\"" diff --git a/loadcfg.py b/res/scripts/loadcfg.py similarity index 100% rename from loadcfg.py rename to res/scripts/loadcfg.py diff --git a/src/format.c b/src/format.c index 981ee3ab..6f526da4 100644 --- a/src/format.c +++ b/src/format.c @@ -1674,8 +1674,8 @@ DWORD WINAPI FormatThread(void* param) physical = GetPhysicalName(SelectedDrive.DeviceNumber); static_sprintf(cmd, "dism /Apply-Ffu /ApplyDrive:%s /ImageFile:\"%s\"", physical, image_path); safe_free(physical); - uprintf("Running command: '%s", cmd); - cr = RunCommandWithProgress(cmd, sysnative_dir, TRUE, MSG_261, ".*\r\\[[= ]+([0-9\\.]+%)[= ]+\\].*"); + uprintf("Running command: '%s'", cmd); + cr = RunCommandWithProgress(cmd, sysnative_dir, TRUE, MSG_261, ".*\r\\[[= ]+([0-9\\.]+)%[= ]+\\].*"); if (cr != 0 && !IS_ERROR(ErrorStatus)) { SetLastError(cr); uprintf("Failed to apply FFU image: %s", WindowsErrorString()); diff --git a/src/iso.c b/src/iso.c index a1996f5d..152eddc9 100644 --- a/src/iso.c +++ b/src/iso.c @@ -2006,7 +2006,7 @@ out: } // TODO: If we can't get save to ISO from virtdisk, we might as well drop this -static DWORD WINAPI IsoSaveImageThread(void* param) +static DWORD WINAPI OpticalDiscSaveImageThread(void* param) { BOOL s; DWORD rSize, wSize; @@ -2112,7 +2112,7 @@ out: ExitThread(0); } -void IsoSaveImage(void) +void OpticalDiscSaveImage(void) { static IMG_SAVE img_save = { 0 }; char filename[33] = "disc_image.iso"; @@ -2143,7 +2143,7 @@ void IsoSaveImage(void) // Disable all controls except cancel EnableControls(FALSE, FALSE); InitProgress(TRUE); - format_thread = CreateThread(NULL, 0, IsoSaveImageThread, &img_save, 0, NULL); + format_thread = CreateThread(NULL, 0, OpticalDiscSaveImageThread, &img_save, 0, NULL); if (format_thread != NULL) { uprintf("\r\nSave to ISO operation started"); PrintInfo(0, -1); @@ -2155,3 +2155,33 @@ void IsoSaveImage(void) PostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)FALSE, 0); } } + +// Create an ISO image from the currently selected drive, using oscdimg.exe +DWORD WINAPI IsoSaveImageThread(void* param) +{ + DWORD r; + IMG_SAVE* img_save = (IMG_SAVE*)param; + char cmd[2 * MAX_PATH], letters[27], * label; + + if (!GetDriveLabel(SelectedDrive.DeviceNumber, letters, &label, TRUE) || letters[0] == '\0') + ExitThread(ERROR_NOT_FOUND); + // Save to UDF only, as Microsoft's implementation of ISO-9660 doesn't support multiextent + // and produces BROKEN images if you try to add files larger than 4 GB. + // Plus ISO-9660/Joliet limits labels to 16 characters and has issues with long paths. + static_sprintf(cmd, "%s\\%s\\oscdimg.exe -g -h -k -l\"%s\" -m -u2 -udfver102 %c:\\ %s", + app_data_dir, FILES_DIR, label, letters[0], img_save->ImagePath); + uprintf("Running command: '%s'", cmd); + // For detecting typical oscdimg commandline progress report of type: "\r15.5% complete" + r = RunCommandWithProgress(cmd, sysnative_dir, FALSE, MSG_261, ".*\r([0-9\\.]+)% complete.*"); + if (r != 0 && !IS_ERROR(ErrorStatus)) { + SetLastError(r); + uprintf("Failed to write ISO image: %s", WindowsErrorString()); + ErrorStatus = RUFUS_ERROR(SCODE_CODE(r)); + } + PostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)TRUE, 0); + if (!IS_ERROR(ErrorStatus)) + uprintf("Saved '%s'", img_save->ImagePath); + safe_free(img_save->DevicePath); + safe_free(img_save->ImagePath); + ExitThread(r); +} diff --git a/src/rufus.c b/src/rufus.c index c7b54c97..70f7c1fc 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1926,9 +1926,8 @@ static DWORD WINAPI BootCheckThread(LPVOID param) if (_accessU(tmp, 0) != -1) { uprintf("Will reuse '%s' for MS-DOS installation", tmp); } else { - r = MessageBoxExU(hMainDialog, lmprintf(MSG_337), lmprintf(MSG_115), - MB_YESNO | MB_ICONWARNING | MB_IS_RTL, selected_langid); - if (r != IDYES) + if (MessageBoxExU(hMainDialog, lmprintf(MSG_337, "diskcopy.dll"), lmprintf(MSG_115), + MB_YESNO | MB_ICONWARNING | MB_IS_RTL, selected_langid) != IDYES) goto out; IGNORE_RETVAL(_chdirU(app_data_dir)); IGNORE_RETVAL(_mkdir(FILES_DIR)); @@ -2679,7 +2678,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA } break; case IDC_SAVE: - VhdSaveImage(); + SaveImage(); break; case IDM_SELECT: case IDM_DOWNLOAD: @@ -4029,7 +4028,7 @@ extern int TestHashes(void); } // Alt-O => Save from Optical drive to ISO if ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'O')) { - IsoSaveImage(); + OpticalDiscSaveImage(); continue; } // Alt-P => Toggle GPT ESP to and from Basic Data type (Windows 10 or later) diff --git a/src/rufus.h b/src/rufus.h index 6956ac7b..18a6bbf0 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -135,6 +135,15 @@ #define DISKCOPY_SIZE 0x16ee00 #define DISKCOPY_IMAGE_OFFSET 0x66d8 #define DISKCOPY_IMAGE_SIZE 0x168000 +#if defined(_M_AMD64) +#define OSCDIMG_URL "https://msdl.microsoft.com/download/symbols/oscdimg.exe/688CABB065000/oscdimg.exe" +#elif defined(_M_IX86) +#define OSCDIMG_URL "https://msdl.microsoft.com/download/symbols/oscdimg.exe/704FD1B760000/oscdimg.exe" +#elif defined(_M_ARM64) +#define OSCDIMG_URL "https://msdl.microsoft.com/download/symbols/oscdimg.exe/02633D8D66000/oscdimg.exe" +#elif defined(_M_ARM) +#define OSCDIMG_URL "https://msdl.microsoft.com/download/symbols/oscdimg.exe/9CD825745F000/oscdimg.exe" +#endif #define SYMBOL_SERVER_USER_AGENT "Microsoft-Symbol-Server/10.0.22621.755" #define DEFAULT_ESP_MOUNT_POINT "S:\\" #define IS_POWER_OF_2(x) ((x != 0) && (((x) & ((x) - 1)) == 0)) diff --git a/src/rufus.rc b/src/rufus.rc index 3ee90132..16c2c60c 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.10.2262" +CAPTION "Rufus 4.10.2263" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2262,0 - PRODUCTVERSION 4,10,2262,0 + FILEVERSION 4,10,2263,0 + PRODUCTVERSION 4,10,2263,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2262" + VALUE "FileVersion", "4.10.2263" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2262" + VALUE "ProductVersion", "4.10.2263" END END BLOCK "VarFileInfo" diff --git a/src/stdfn.c b/src/stdfn.c index d1f77612..71b765f9 100644 --- a/src/stdfn.c +++ b/src/stdfn.c @@ -889,7 +889,6 @@ DWORD RunCommandWithProgress(const char* cmd, const char* dir, BOOL log, int msg break; Sleep(100); }; - cregex_compile_free(program); } else { // TODO: Detect user cancellation here? switch (WaitForSingleObject(pi.hProcess, 1800000)) { @@ -911,6 +910,7 @@ DWORD RunCommandWithProgress(const char* cmd, const char* dir, BOOL log, int msg CloseHandle(pi.hThread); out: + cregex_compile_free(program); safe_closehandle(hOutputWrite); safe_closehandle(hOutputRead); return ret; diff --git a/src/vhd.c b/src/vhd.c index eaca6e78..0b83154d 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -562,33 +562,33 @@ static DWORD WINAPI FfuSaveImageThread(void* param) static_sprintf(cmd, "dism /Capture-Ffu /CaptureDrive:%s /ImageFile:\"%s\" " "/Name:\"%s\" /Description:\"Created by %s (%s)\"", img_save->DevicePath, img_save->ImagePath, label, APPLICATION_NAME, RUFUS_URL); - uprintf("Running command: '%s", cmd); + uprintf("Running command: '%s'", cmd); // For detecting typical dism.exe commandline progress report of type: // "\r[==== 8.0% ]" - r = RunCommandWithProgress(cmd, sysnative_dir, TRUE, MSG_261, ".*\r\\[[= ]+([0-9\\.]+%)[= ]+\\].*"); + r = RunCommandWithProgress(cmd, sysnative_dir, TRUE, MSG_261, ".*\r\\[[= ]+([0-9\\.]+)%[= ]+\\].*"); if (r != 0 && !IS_ERROR(ErrorStatus)) { SetLastError(r); uprintf("Failed to capture FFU image: %s", WindowsErrorString()); ErrorStatus = RUFUS_ERROR(SCODE_CODE(r)); } - safe_free(img_save->DevicePath); - safe_free(img_save->ImagePath); PostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)TRUE, 0); if (!IS_ERROR(ErrorStatus)) uprintf("Saved '%s'", img_save->ImagePath); + safe_free(img_save->DevicePath); + safe_free(img_save->ImagePath); ExitThread(r); } -void VhdSaveImage(void) +void SaveImage(void) { UINT i; static IMG_SAVE img_save; - char filename[128]; - char path[MAX_PATH]; + char filename[128], letters[27], path[MAX_PATH]; int DriveIndex = ComboBox_GetCurSel(hDeviceList); - enum { image_type_vhd = 1, image_type_vhdx = 2, image_type_ffu = 3 }; - static EXT_DECL(img_ext, filename, __VA_GROUP__("*.vhd", "*.vhdx", "*.ffu"), - __VA_GROUP__(lmprintf(MSG_343), lmprintf(MSG_342), lmprintf(MSG_344))); + enum { image_type_vhd = 1, image_type_vhdx = 2, image_type_ffu = 3, image_type_iso = 4 }; + // Add a non-printable zero-width space to UDF *.iso extension to differentiate it from ISO-9660 + static EXT_DECL(img_ext, filename, __VA_GROUP__("*.vhd", "*.vhdx", "*.ffu", "*.iso"), + __VA_GROUP__(lmprintf(MSG_343), lmprintf(MSG_342), lmprintf(MSG_344), lmprintf(MSG_355))); ULARGE_INTEGER free_space; memset(&img_save, 0, sizeof(IMG_SAVE)); @@ -598,21 +598,31 @@ void VhdSaveImage(void) static_sprintf(filename, "%s", rufus_drive[DriveIndex].label); img_save.DeviceNum = (DWORD)ComboBox_GetItemData(hDeviceList, DriveIndex); img_save.DevicePath = GetPhysicalName(img_save.DeviceNum); + img_ext.count = 2; // FFU support requires GPT - img_ext.count = (!has_ffu_support || SelectedDrive.PartitionStyle != PARTITION_STYLE_GPT) ? 2 : 3; - for (i = 1; i <= (UINT)img_ext.count && (safe_strcmp(save_image_type , &_img_ext_x[i - 1][2]) != 0); i++); + if (has_ffu_support && SelectedDrive.PartitionStyle == PARTITION_STYLE_GPT) { + img_ext.count += 1; + } else { + // Move the ISO extension one place down + img_ext.extension[2] = img_ext.extension[3]; + img_ext.description[2] = img_ext.description[3]; + } + // ISO support requires a mounted file system + if (GetDriveLetters(SelectedDrive.DeviceNumber, letters) && letters[0] != '\0') + img_ext.count += 1; + for (i = 1; i <= (UINT)img_ext.count && (safe_strcmp(save_image_type, &img_ext.extension[i - 1][2]) != '\0'); i++); if (i > (UINT)img_ext.count) i = image_type_vhdx; img_save.ImagePath = FileDialog(TRUE, NULL, &img_ext, &i); if (img_save.ImagePath == NULL) goto out; // Start from the end of our extension array, since '.vhd' would match for '.vhdx' otherwise - for (i = (UINT)img_ext.count; (i > 0) && (strstr(img_save.ImagePath, &_img_ext_x[i - 1][1]) == NULL); i--); + for (i = (UINT)img_ext.count; (i > 0) && (strstr(img_save.ImagePath, &img_ext.extension[i - 1][1]) == NULL); i--); if (i == 0) { uprintf("Warning: Can not determine image type from extension - Saving to uncompressed VHD."); i = image_type_vhd; } else { - save_image_type = (char*)&_img_ext_x[i - 1][2]; + save_image_type = (char*)&img_ext.extension[i - 1][2]; WriteSettingStr(SETTING_PREFERRED_SAVE_IMAGE_TYPE, save_image_type); } switch (i) { @@ -622,6 +632,20 @@ void VhdSaveImage(void) case image_type_ffu: img_save.Type = VIRTUAL_STORAGE_TYPE_DEVICE_FFU; break; + case image_type_iso: + // ISO requires oscdimg.exe. If not already present, attempt to download it. + static_sprintf(path, "%s\\%s\\oscdimg.exe", app_data_dir, FILES_DIR); + if (!PathFileExistsU(path)) { + if (MessageBoxExU(hMainDialog, lmprintf(MSG_337, "oscdimg.exe"), lmprintf(MSG_115), + MB_YESNO | MB_ICONWARNING | MB_IS_RTL, selected_langid) != IDYES) + goto out; + IGNORE_RETVAL(_chdirU(app_data_dir)); + IGNORE_RETVAL(_mkdir(FILES_DIR)); + if (DownloadToFileOrBufferEx(OSCDIMG_URL, path, SYMBOL_SERVER_USER_AGENT, NULL, hMainDialog, FALSE) < 64 * KB) + goto out; + } + img_save.Type = VIRTUAL_STORAGE_TYPE_DEVICE_ISO; + break; default: img_save.Type = VIRTUAL_STORAGE_TYPE_DEVICE_VHDX; break; @@ -648,13 +672,14 @@ void VhdSaveImage(void) ErrorStatus = 0; InitProgress(TRUE); format_thread = CreateThread(NULL, 0, img_save.Type == VIRTUAL_STORAGE_TYPE_DEVICE_FFU ? - FfuSaveImageThread : VhdSaveImageThread, &img_save, 0, NULL); + FfuSaveImageThread : (img_save.Type == VIRTUAL_STORAGE_TYPE_DEVICE_ISO ? IsoSaveImageThread : VhdSaveImageThread), + &img_save, 0, NULL); if (format_thread != NULL) { - uprintf("\r\nSave to VHD operation started"); + uprintf("\r\nSave to image operation started"); PrintInfo(0, -1); SendMessage(hMainDialog, UM_TIMER_START, 0, 0); } else { - uprintf("Unable to start VHD save thread"); + uprintf("Unable to start image save thread"); ErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_START_THREAD)); PostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)FALSE, 0); } diff --git a/src/vhd.h b/src/vhd.h index a0ce4182..2b673289 100644 --- a/src/vhd.h +++ b/src/vhd.h @@ -111,5 +111,6 @@ extern int8_t IsBootableImage(const char* path); extern char* VhdMountImageAndGetSize(const char* path, uint64_t* disksize); #define VhdMountImage(path) VhdMountImageAndGetSize(path, NULL) extern void VhdUnmountImage(void); -extern void VhdSaveImage(void); -extern void IsoSaveImage(void); +extern void SaveImage(void); +extern void OpticalDiscSaveImage(void); +extern DWORD WINAPI IsoSaveImageThread(void* param); diff --git a/src/wue.c b/src/wue.c index 5363b455..2d75e10b 100644 --- a/src/wue.c +++ b/src/wue.c @@ -478,7 +478,7 @@ BOOL PopulateWindowsVersion(void) char wim_path[MAX_PATH] = ""; wchar_t* xml = NULL; size_t xml_len; - WIMStruct* wim; + WIMStruct* wim = NULL; memset(&img_report.win_version, 0, sizeof(img_report.win_version)); From e571996525bc6ea5ad43b829df1c10fff6c89395 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 1 Jul 2025 13:53:20 +0100 Subject: [PATCH 073/192] [misc] sign the GitHub ALPHA builds using self-signed credentials * Obviously, this does not use the same Authenticode credentials we use for actual releases (which we wouldn't be able to export anyway, as it resides on a hardware token), but it should help officialize our GitHub builds, as well as remove an extra prompt. * Also move the revoked UEFI bootloader check before the DD vs ISO check, so that people choosing DD mode still get alerted about the revoked bootloaders. * Also don't refresh the device list after saving to image, and fix a Coverity warning. --- .github/workflows/mingw.yml | 17 ++++++++++++ .github/workflows/vs2022.yml | 19 ++++++++++++- src/pki.c | 14 ++++++++-- src/process.c | 11 ++++---- src/rufus.c | 53 ++++++++++++++++++++++-------------- src/rufus.h | 2 +- src/rufus.rc | 10 +++---- src/vhd.c | 5 ++-- src/vhd.h | 2 +- 9 files changed, 96 insertions(+), 37 deletions(-) diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml index b62435b5..0086dc04 100644 --- a/.github/workflows/mingw.yml +++ b/.github/workflows/mingw.yml @@ -85,6 +85,23 @@ jobs: strip ./${{ matrix.exe }} upx --lzma --best ./${{ matrix.exe }} + - name: Prepare to sign ALPHA + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + shell: bash + # NB: The Base64 encoded variable should not have line breaks or this will fail! + run: echo ${{ secrets.RUFUS_GITHUB_OFFICIAL_BUILD }} | base64 -di > ./sign.pfx + + - name: Add signtool to path + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: KamaranL/add-signtool-action@v1 + + - name: Sign ALPHA + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + shell: cmd + run: | + signtool sign /v /f sign.pfx /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 rufus_${{ matrix.TARGET_PLATFORM }}.exe + del sign.pfx + - name: Display SHA-256 run: sha256sum ./${{ matrix.exe }} diff --git a/.github/workflows/vs2022.yml b/.github/workflows/vs2022.yml index aefd1f61..6721ebc7 100644 --- a/.github/workflows/vs2022.yml +++ b/.github/workflows/vs2022.yml @@ -83,7 +83,24 @@ jobs: - name: Compress executables if: ${{ matrix.TARGET_PLATFORM != 'arm64' }} - run: upx --lzma --best .\rufus_${{ matrix.TARGET_PLATFORM }}.exe + run: upx --lzma --best rufus_${{ matrix.TARGET_PLATFORM }}.exe + + - name: Prepare to sign ALPHA + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + shell: bash + # NB: The Base64 encoded variable should not have line breaks or this will fail! + run: echo ${{ secrets.RUFUS_GITHUB_OFFICIAL_BUILD }} | base64 -di > ./sign.pfx + + - name: Add signtool to path + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + uses: KamaranL/add-signtool-action@v1 + + - name: Sign ALPHA + if: ${{ !startsWith(github.ref, 'refs/tags/') }} + shell: cmd + run: | + signtool sign /v /f sign.pfx /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 rufus_${{ matrix.TARGET_PLATFORM }}.exe + del sign.pfx - name: Display SHA-256 run: sha256sum ./rufus_${{ matrix.TARGET_PLATFORM }}.exe diff --git a/src/pki.c b/src/pki.c index fe923c15..033f58cb 100644 --- a/src/pki.c +++ b/src/pki.c @@ -261,7 +261,7 @@ const char* WinPKIErrorString(void) } // Mostly from https://support.microsoft.com/en-us/kb/323809 -char* GetSignatureName(const char* path, const char* country_code, BOOL bSilent) +char* GetSignatureName(const char* path, const char* country_code, uint8_t* thumbprint, BOOL bSilent) { static char szSubjectName[128]; char szCountry[3] = "__"; @@ -340,6 +340,16 @@ char* GetSignatureName(const char* path, const char* country_code, BOOL bSilent) goto out; } + // Get the thumbprint if requested + if (thumbprint != NULL) { + dwSize = SHA1_HASHSIZE; + if (!CryptHashCertificate(0, CALG_SHA1, 0, pCertContext->pbCertEncoded, + pCertContext->cbCertEncoded, thumbprint, &dwSize)) { + uprintf("PKI: Failed to compute the thumbprint: %s", WinPKIErrorString()); + goto out; + } + } + // If a country code is provided, validate that the certificate we have is for the same country if (country_code != NULL) { dwSize = CertGetNameStringA(pCertContext, CERT_NAME_ATTR_TYPE, 0, szOID_COUNTRY_NAME, @@ -728,7 +738,7 @@ LONG ValidateSignature(HWND hDlg, const char* path) // Check the signature name. Make it specific enough (i.e. don't simply check for "Akeo") // so that, besides hacking our server, it'll place an extra hurdle on any malicious entity // into also fooling a C.A. to issue a certificate that passes our test. - signature_name = GetSignatureName(path, cert_country, (hDlg == INVALID_HANDLE_VALUE)); + signature_name = GetSignatureName(path, cert_country, NULL, (hDlg == INVALID_HANDLE_VALUE)); if (signature_name == NULL) { uprintf("PKI: Could not get signature name"); if (hDlg != INVALID_HANDLE_VALUE) diff --git a/src/process.c b/src/process.c index 6d3b8338..3373bb82 100644 --- a/src/process.c +++ b/src/process.c @@ -807,11 +807,12 @@ BOOL SetProcessSearch(DWORD DeviceNum) wHandleName[nHandles++] = utf8_to_wchar(DevPath); free(PhysicalPath); // Logical drive(s) handle name(s) - GetDriveLetters(DeviceNum, drive_letter); - for (i = 0; nHandles < MAX_NUM_HANDLES && drive_letter[i]; i++) { - drive_name[0] = drive_letter[i]; - if (QueryDosDeviceA(drive_name, DevPath, sizeof(DevPath)) != 0) - wHandleName[nHandles++] = utf8_to_wchar(DevPath); + if (GetDriveLetters(DeviceNum, drive_letter)) { + for (i = 0; nHandles < MAX_NUM_HANDLES && drive_letter[i]; i++) { + drive_name[0] = drive_letter[i]; + if (QueryDosDeviceA(drive_name, DevPath, sizeof(DevPath)) != 0) + wHandleName[nHandles++] = utf8_to_wchar(DevPath); + } } if (WaitForSingleObject(blocking_process.hLock, SEARCH_PROCESS_LOCK_TIMEOUT) != WAIT_OBJECT_0) { uprintf("Could not obtain process search lock"); diff --git a/src/rufus.c b/src/rufus.c index 70f7c1fc..8db03938 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -130,7 +130,7 @@ BOOL enable_HDDs = FALSE, enable_VHDs = TRUE, enable_ntfs_compression = FALSE, n BOOL advanced_mode_device, advanced_mode_format, allow_dual_uefi_bios, detect_fakes, enable_vmdk, force_large_fat32; BOOL usb_debug, use_fake_units, preserve_timestamps = FALSE, fast_zeroing = FALSE, app_changed_size = FALSE; BOOL zero_drive = FALSE, list_non_usb_removable_drives = FALSE, enable_file_indexing, large_drive = FALSE; -BOOL write_as_image = FALSE, write_as_esp = FALSE, use_vds = FALSE, ignore_boot_marker = FALSE; +BOOL write_as_image = FALSE, write_as_esp = FALSE, use_vds = FALSE, ignore_boot_marker = FALSE, save_image = FALSE; BOOL appstore_version = FALSE, is_vds_available = TRUE, persistent_log = FALSE, has_ffu_support = FALSE; BOOL expert_mode = FALSE, use_rufus_mbr = TRUE; float fScale = 1.0f; @@ -1522,6 +1522,23 @@ static DWORD WINAPI BootCheckThread(LPVOID param) MessageBoxExU(hMainDialog, lmprintf(MSG_089), lmprintf(MSG_088), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); goto out; } + + // Display an alert if any of the UEFI bootloaders have been revoked + if (img_report.has_secureboot_bootloader & 0xfe) { + switch (img_report.has_secureboot_bootloader & 0xfe) { + case 4: + msg = lmprintf(MSG_341, "Error code: 0xc0000428"); + break; + default: + msg = lmprintf(MSG_340); + break; + } + r = MessageBoxExU(hMainDialog, lmprintf(MSG_339, msg), lmprintf(MSG_338), + MB_OKCANCEL | MB_ICONWARNING | MB_IS_RTL, selected_langid); + if (r == IDCANCEL) + goto out; + } + if (IS_DD_BOOTABLE(img_report)) { if (!img_report.is_iso) { // Pure DD images are fine at this stage @@ -1688,22 +1705,6 @@ static DWORD WINAPI BootCheckThread(LPVOID param) } } - // Display an alert if any of the UEFI bootloaders have been revoked - if (img_report.has_secureboot_bootloader & 0xfe) { - switch (img_report.has_secureboot_bootloader & 0xfe) { - case 4: - msg = lmprintf(MSG_341, "Error code: 0xc0000428"); - break; - default: - msg = lmprintf(MSG_340); - break; - } - r = MessageBoxExU(hMainDialog, lmprintf(MSG_339, msg), lmprintf(MSG_338), - MB_OKCANCEL | MB_ICONWARNING | MB_IS_RTL, selected_langid); - if (r == IDCANCEL) - goto out; - } - if ((img_report.projected_size < MAX_ISO_TO_ESP_SIZE) && HAS_REGULAR_EFI(img_report) && (partition_type == PARTITION_STYLE_GPT) && IS_FAT(fs_type) && !esp_already_asked) { // The ISO is small enough to be written as an ESP and we are using GPT @@ -2678,7 +2679,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA } break; case IDC_SAVE: - SaveImage(); + save_image = SaveImage(); break; case IDM_SELECT: case IDM_DOWNLOAD: @@ -3026,6 +3027,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA goto aborted_start; // All subsequent aborts below translate to a user cancellation wParam = BOOTCHECK_CANCEL; + save_image = FALSE; if ((partition_type == PARTITION_STYLE_MBR) && (SelectedDrive.DiskSize > 2 * TB)) { if (MessageBoxExU(hMainDialog, lmprintf(MSG_134, SizeToHumanReadable(SelectedDrive.DiskSize - 2 * TB, FALSE, FALSE)), @@ -3120,10 +3122,11 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA SendMessage(FindWindowA(MAKEINTRESOURCEA(32770), lmprintf(MSG_049)), WM_COMMAND, IDYES, 0); EnableWindow(GetDlgItem(hMainDialog, IDCANCEL), TRUE); EnableControls(TRUE, FALSE); - if (wParam) { + if (wParam && !save_image) { uprintf("\r\n"); GetDevices(DeviceNum); } + save_image = FALSE; if (!IS_ERROR(ErrorStatus)) { SendMessage(hProgress, PBM_SETPOS, MAX_PROGRESS, 0); SetTaskbarProgressState(TASKBAR_NOPROGRESS); @@ -3580,9 +3583,19 @@ skip_args_processing: // Look for a .ini file in the current app directory static_sprintf(ini_path, "%srufus.ini", app_dir); fd = fopenU(ini_path, ini_flags); // Will create the file if portable mode is requested +#if !defined(ALPHA) // Using the string directly in safe_strcmp() would call GetSignatureName() twice - tmp = GetSignatureName(NULL, NULL, FALSE); + tmp = GetSignatureName(NULL, NULL, NULL, FALSE); vc |= (safe_strcmp(tmp, cert_name[0]) == 0); +#else + // So as not to multiply user prompts, as well as officialize our own GitHub builds, + // we sign ALPHAs using disposable (non Authenticode) self-signed credentials. + static const uint8_t github_thumbprint[SHA1_HASHSIZE] = + { 0xc9, 0x00, 0x1c, 0x67, 0x25, 0x16, 0x83, 0x2b, 0x1a, 0x61, 0xf4, 0x5f, 0x1a, 0x26, 0xd5, 0x76, 0xda, 0xab, 0x06, 0xdf }; + uint8_t thumbprint[SHA1_HASHSIZE] = { 0 }; + tmp = GetSignatureName(NULL, NULL, thumbprint, FALSE); + vc |= (safe_strcmp(tmp, "Rufus - GitHub Official Build") == 0) && (memcmp(thumbprint, github_thumbprint, SHA1_HASHSIZE) == 0); +#endif if (fd != NULL) { ini_file = ini_path; // In portable mode, use the app directory for all local storage diff --git a/src/rufus.h b/src/rufus.h index 18a6bbf0..8d5c9cc9 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -860,7 +860,7 @@ extern void parse_update(char* buf, size_t len); extern void* get_data_from_asn1(const uint8_t* buf, size_t buf_len, const char* oid_str, uint8_t asn1_type, size_t* data_len); extern int sanitize_label(char* label); extern int IsHDD(DWORD DriveIndex, uint16_t vid, uint16_t pid, const char* strid); -extern char* GetSignatureName(const char* path, const char* country_code, BOOL bSilent); +extern char* GetSignatureName(const char* path, const char* country_code, uint8_t* thumbprint, BOOL bSilent); extern int GetIssuerCertificateInfo(uint8_t* cert, cert_info_t* info); extern uint64_t GetSignatureTimeStamp(const char* path); extern LONG ValidateSignature(HWND hDlg, const char* path); diff --git a/src/rufus.rc b/src/rufus.rc index 16c2c60c..daa07ade 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.10.2263" +CAPTION "Rufus 4.10.2264" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2263,0 - PRODUCTVERSION 4,10,2263,0 + FILEVERSION 4,10,2264,0 + PRODUCTVERSION 4,10,2264,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2263" + VALUE "FileVersion", "4.10.2264" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2263" + VALUE "ProductVersion", "4.10.2264" END END BLOCK "VarFileInfo" diff --git a/src/vhd.c b/src/vhd.c index 0b83154d..b2c013e8 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -579,7 +579,7 @@ static DWORD WINAPI FfuSaveImageThread(void* param) ExitThread(r); } -void SaveImage(void) +BOOL SaveImage(void) { UINT i; static IMG_SAVE img_save; @@ -593,7 +593,7 @@ void SaveImage(void) memset(&img_save, 0, sizeof(IMG_SAVE)); if ((DriveIndex < 0) || (format_thread != NULL)) - return; + return FALSE; static_sprintf(filename, "%s", rufus_drive[DriveIndex].label); img_save.DeviceNum = (DWORD)ComboBox_GetItemData(hDeviceList, DriveIndex); @@ -689,4 +689,5 @@ out: safe_free(img_save.DevicePath); safe_free(img_save.ImagePath); } + return (format_thread != NULL); } diff --git a/src/vhd.h b/src/vhd.h index 2b673289..660a8b1a 100644 --- a/src/vhd.h +++ b/src/vhd.h @@ -111,6 +111,6 @@ extern int8_t IsBootableImage(const char* path); extern char* VhdMountImageAndGetSize(const char* path, uint64_t* disksize); #define VhdMountImage(path) VhdMountImageAndGetSize(path, NULL) extern void VhdUnmountImage(void); -extern void SaveImage(void); +extern BOOL SaveImage(void); extern void OpticalDiscSaveImage(void); extern DWORD WINAPI IsoSaveImageThread(void* param); From c6a85b09ae431b3d516009dad26d5de1950cb6da Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 3 Jul 2025 22:27:42 +0200 Subject: [PATCH 074/192] [ui] fix wrong colour for disabled text in dark mode * Closes #2764. * Also fix signature not being properly applied to MinGW GitHub Actions ALPHA builds. --- .github/workflows/mingw.yml | 2 +- src/rufus.rc | 10 +++++----- src/ui.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml index 0086dc04..9ea8fcf8 100644 --- a/.github/workflows/mingw.yml +++ b/.github/workflows/mingw.yml @@ -99,7 +99,7 @@ jobs: if: ${{ !startsWith(github.ref, 'refs/tags/') }} shell: cmd run: | - signtool sign /v /f sign.pfx /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 rufus_${{ matrix.TARGET_PLATFORM }}.exe + signtool sign /v /f sign.pfx /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 ${{ matrix.exe }} del sign.pfx - name: Display SHA-256 diff --git a/src/rufus.rc b/src/rufus.rc index daa07ade..bc24a87f 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.10.2264" +CAPTION "Rufus 4.10.2265" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2264,0 - PRODUCTVERSION 4,10,2264,0 + FILEVERSION 4,10,2265,0 + PRODUCTVERSION 4,10,2265,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2264" + VALUE "FileVersion", "4.10.2265" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2264" + VALUE "ProductVersion", "4.10.2265" END END BLOCK "VarFileInfo" diff --git a/src/ui.h b/src/ui.h index c9aa9f78..193bffda 100644 --- a/src/ui.h +++ b/src/ui.h @@ -39,7 +39,7 @@ // Dark Mode Colors #define DARKMODE_TOOLBAR_ICON_COLOR RGB(0xFF, 0xD7, 0x00) #define DARKMODE_NORMAL_TEXT_COLOR RGB(0xE0, 0xE0, 0xE0) -#define DARKMODE_DISABLED_TEXT_COLOR RGB(0xE0, 0xE0, 0xE0) +#define DARKMODE_DISABLED_TEXT_COLOR RGB(0x80, 0x80, 0x80) #define DARKMODE_NORMAL_DIALOG_BACKGROUND_COLOR RGB(0x20, 0x20, 0x20) #define DARKMODE_NORMAL_CONTROL_BACKGROUND_COLOR RGB(0x38, 0x38, 0x38) #define DARKMODE_HOT_CONTROL_BACKGROUND_COLOR RGB(0x45, 0x45, 0x45) From 3bbdd6624eb1fa52c6a488f970667619aa1f5925 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 10 Jul 2025 10:52:17 +0100 Subject: [PATCH 075/192] [wue] cd to wrapper directory before looking for setup.dll * Closes #2757. --- res/setup/setup.c | 7 +++++++ src/rufus.rc | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/res/setup/setup.c b/res/setup/setup.c index a58ef474..c81d29c0 100644 --- a/res/setup/setup.c +++ b/res/setup/setup.c @@ -98,6 +98,13 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine STARTUPINFOA si = { 0 }; PROCESS_INFORMATION pi = { 0 }; SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE }; + WCHAR *wc, wPath[MAX_PATH] = { 0 }; + + // If invoked from a different directory, cd to where this executable resides + if (GetModuleFileName(NULL, wPath, ARRAYSIZE(wPath)) != 0 && (wc = wcsrchr(wPath, L'\\')) != NULL) { + *wc = L'\0'; + SetCurrentDirectory(wPath); + } // Make sure we have 'setup.dll' in the same directory dwAttrib = GetFileAttributesA("setup.dll"); diff --git a/src/rufus.rc b/src/rufus.rc index bc24a87f..e547cc6d 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.10.2265" +CAPTION "Rufus 4.10.2266" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2265,0 - PRODUCTVERSION 4,10,2265,0 + FILEVERSION 4,10,2266,0 + PRODUCTVERSION 4,10,2266,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2265" + VALUE "FileVersion", "4.10.2266" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2265" + VALUE "ProductVersion", "4.10.2266" END END BLOCK "VarFileInfo" From 1a4175891b78dc46e0023e389288dbd0ccd8df8c Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 16 Jul 2025 14:06:33 +0100 Subject: [PATCH 076/192] [iso] fix a situation where no file system might be proposed in ISO mode * The Nutanix phoenix.x86_64-fnd_5.6.1_patch-aos_6.8.1_ga.iso contains a GRUB bootloader that somehow stripped the 'fshelp' source string from the fat module, and therefore prevents Rufus from detecting that FAT32 support is available. * As a result, since NTFS is also not supported, no file system able to be selected by the user for ISO mode, and the media creation process fails with "Could Not Partition Drive". * Fix this by only disabling FAT32 in ISO mode if NTFS is available, and producing a warning in the log if we have to forcefully enable FAT32 even if we didn't detect FAT32 compatibility. * Closes #2769. * Also add the setup wrapper binaries produced from previous commit and harmonise the casing of WARNING messages. --- res/setup/readme.txt | 10 +++++----- res/setup/setup_arm64.exe | Bin 149808 -> 150376 bytes res/setup/setup_x64.exe | Bin 150320 -> 150888 bytes src/dev.c | 2 +- src/drive.c | 10 +++++----- src/format.c | 16 ++++++++-------- src/iso.c | 4 ++-- src/ms-sys/file.c | 2 +- src/msapi_utf8.h | 5 ++--- src/net.c | 2 +- src/process.c | 2 +- src/rufus.c | 17 +++++++++++------ src/rufus.rc | 10 +++++----- src/stdfn.c | 2 +- src/stdio.c | 4 ++-- src/stdlg.c | 10 +++++----- src/syslinux.c | 4 ++-- src/vhd.c | 2 +- src/wue.c | 8 ++++---- 19 files changed, 57 insertions(+), 53 deletions(-) diff --git a/res/setup/readme.txt b/res/setup/readme.txt index 88c1eab2..5faef42d 100644 --- a/res/setup/readme.txt +++ b/res/setup/readme.txt @@ -33,11 +33,11 @@ and can be validated to not have been tampered through SHA-256 validation (Since produce SHA-256 hashes during the build process per: https://github.com/pbatard/rufus/blob/master/.github/workflows/setup.yml). -Per the https://github.com/pbatard/rufus/actions/runs/15539519674 GitHub Actions +Per the https://github.com/pbatard/rufus/actions/runs/16191913388 GitHub Actions workflow run, the SHA-256 for the executables (before signature was applied) were: -* bea9a68e73b53820ea9c3fcdda70b1615f7453ad483dd3aa06e0385fd28f004e *./setup_x64.exe -* f024aed61b1f215a3b684bbb2fd176893fc61f92243708a0d9334671df1cdb61 *./setup_arm64.exe +* f8e1c7c5f1297be7a76d73567d4d82f61bb20c2e5c86d2a2f8d2e5961751d658 *./setup_x64.exe +* e6ff77b859231cc58c872c7b14ce9def73244641e487bbb074d3a759bdfcbc8d *./setup_arm64.exe You will also find the VirusTotal reports for the current signed executable at: -* https://www.virustotal.com/gui/file/41037f63f20f5984e5ca1dab12c033d795966e80bd8b76a39c1dc42a3dc33594/detection -* https://www.virustotal.com/gui/file/cc9cb4f4080db352d9a82ef926fc290d62a8d67a45a5557f46fa924a7b9bdbe3/detection +* https://www.virustotal.com/gui/file/11df838dc69378187e1e1aaf32d34384157642d07096c6e49c1d0e7375634544/detection +* https://www.virustotal.com/gui/file/14bd07f559513890a0f6565df3927392b4fe6b8e6fc3f5e832e9d69c8b7bb7eb/detection diff --git a/res/setup/setup_arm64.exe b/res/setup/setup_arm64.exe index c8cbfc92b801988a53a1d540c68258a3cf4b0e2b..213a81662001b3694634b5677e0a8f1098dea59e 100644 GIT binary patch delta 39869 zcmeFad0bW18b7?&Ie_~xd6*BNa6r@pPB??69>4)-R7xsSNU4J(PK8#UgJu`STO5~q z%(?|=_X1^?asr#M>|V6Gp*B$W-U7A4Y@k7dGI_si?`Io%d*Anu_w#xG`kl{b`|R(t zp7pHxS<f0a*6uX5?J<?PoL_u+F=+qM?dkgS;poRQ5`jM){b)vwO1EV^3z{%tTgD-k zKAQ2IN*~MEs)m<l901*av^4!1Xwrnu8I>wspDyYCqrFv{G@(T0&n;N&kZCdPm&CFr zF}9?p2Rr-cRSsgZb{5b441oh#2RO-GWjBaKKEzP4Tin4%@x#K+Ln1A{2#GN;#~{#L z1IzSbtZ+4F+3vXL@Z>_y>{?VcJ~MMxXmH0x1rJ`AU$hRqvY+se8Bd3ZGQ^C!`k;h} zu?h4Vo^C%oWA?#I^48^n=ZM5VWsvg+-6&QXq5{>7)Dr6vvB%J#?-Z}%-(BK!{2P8K z&^VY!Uox;=jE#Q}(Qf>jpvpYgE~fYl4Oz)ps0?T|#wF?eQlCMK780L$^<|8W;@8eM zwipdH4aP+uAkT-5*A_K8nc*@rn9Z-58_T-7Mz$D@YWVEyUFMn4!I>-g-L9?(J#jsa z4}HcPkcEgI<3gVOgW!96>@>_};+G!%Lgupi79RUSQ`g_mn(vsF`U|8FP4v3R{Xf6n z<@xo26IC)hVuX?vc&@9<)3wFxObN=TaIsVA!vn-oCCN}YN}LA>5<aHMe7%@y>cxY_ zQqzF2Fnj0I-^Zr3^ssj_KH&q3SYwLfrQ%J~4DKz0eKWX8+~(Vdhl!28lV?m+(=eZ@ zVyxDbHrhQj&3^C->cm#juwevq&23q%xD9Epvp<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%hew$nQYzPDl2cebo&ipqDN3?@v#lGnT83qqIsM#1>$t?P^=HH+4-#vC#>EqR zd%XHM<8a@W5kiyyz_)L0T(CQWzm>uh<GchCn(BEtEH>j0PC1y}SYlF=YvJ+|X*RSi zFpsU}OHmyybUP))SuC7b++jSCE5f*;rQF%NW-vi<-ZQFq-Kwnc8bZ%Dm9iwC+Q1E7 zjkl|hX}?9<#juZ)+|=T|2fb&xW&O``4wte)5HT5#D5sWkCsQJx5wx458doqy(5_YA tg@o&z7iDcShtDS~`86WmuorfzYavVDt>A*bb8IvPNGsIA=u=1f`WG8+W?%pS diff --git a/res/setup/setup_x64.exe b/res/setup/setup_x64.exe index fad67aa1db9c9ec40aaaec488e2b43d2dfa31135..e3cca98a5bc5739606568db791350f726db6c517 100644 GIT binary patch delta 46359 zcmZsE3tUvy_WwBpBLjki$_Vn1QAZu$C_W%SXB6~|4vP7r)Wk@mG$myeOC59|!Q&*h zdsunPURQhEvMfa_1u;RzL`}s^qsOg7*bVJoMa|~_-RG=9>;F5S&z`-%Yp?x0d#}Cr z+WWxH=Yy4(g3D7y!{)TH?vFbEx#Zf?@>IWD_xp2cD}mSj{%qP!)n{pc!hif0OY^Dz zvuQu8{&Q)U)cDP5SKwb;x;eERzWdgewCk$BB$fNumIkT5`_?lm{oY4%^LSZ;_6#Lo z5VA4^;i0F3gtxp)^8CaWp@-03*I|Hg7L*yHN>*53ad5zr|LE8((b3gn1ktP$@&>}s z(Fr;21fg+}DCBSM9@AypLQ$}3snn!Giy-XOZSEf3X;8uZ!UE9B&)_E<?ktPebsJH! z6+tiwufTl`ch_SR1lyp8<`v8X%@%{7a^xHezmP4~MR!muvJ)hpTQPfH*GGJo?br3` z`~2M%KvJH~()o*)<f6W)EU&a+fFH#=1pM+$;7IWcmJ~Q3cIUT(P*Pc7@U-fhUO==Y zf2l;AfbUIBU`2su-J)dndSJ%T;Tqp-rE`6f?6gQeQ-4q-`K&|!(r3DUiRWT`wpy;1 z<jj02u}+!By6VU1h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num_drives >= MAX_DRIVES) - uprintf("Warning: Found more than %d drives - ignoring remaining ones...", MAX_DRIVES); + uprintf("WARNING: Found more than %d drives - ignoring remaining ones...", MAX_DRIVES); safe_free(devint_detail_data); break; } diff --git a/src/drive.c b/src/drive.c index 402aa53b..2022bd65 100644 --- a/src/drive.c +++ b/src/drive.c @@ -166,7 +166,7 @@ static HANDLE GetHandle(char* Path, BOOL bLockDrive, BOOL bWriteAccess, BOOL bWr uprintf("Waiting for access on %s...", Path); } else if (!bWriteShare && (i > DRIVE_ACCESS_RETRIES/3)) { // If we can't seem to get a hold of the drive for some time, try to enable FILE_SHARE_WRITE... - uprintf("Warning: Could not obtain exclusive rights. Retrying with write sharing enabled..."); + uprintf("WARNING: Could not obtain exclusive rights. Retrying with write sharing enabled..."); bWriteShare = TRUE; // Try to report the process that is locking the drive access_mask = GetProcessSearch(SEARCH_PROCESS_TIMEOUT, 0x07, FALSE); @@ -362,7 +362,7 @@ char* GetLogicalName(DWORD DriveIndex, uint64_t PartitionOffset, BOOL bKeepTrail // NB: We need to re-add DRIVE_INDEX_MIN for this call since CheckDriveIndex() subtracted it ret = AltGetLogicalName(DriveIndex + DRIVE_INDEX_MIN, PartitionOffset, bKeepTrailingBackslash, bSilent); if ((ret != NULL) && (strchr(ret, ' ') != NULL)) - uprintf("Warning: Using physical device to access partition data"); + uprintf("WARNING: Using physical device to access partition data"); } out: @@ -1148,7 +1148,7 @@ static BOOL _GetDriveLettersAndType(DWORD DriveIndex, char* drive_letters, UINT* NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL, 3000); if (hDrive == INVALID_HANDLE_VALUE) { if (GetLastError() == WAIT_TIMEOUT) - uprintf("Warning: Time-out while trying to query drive %c", toupper(drive[0])); + uprintf("WARNING: Time-out while trying to query drive %c", toupper(drive[0])); continue; } @@ -1883,7 +1883,7 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys SelectedDrive.SectorSize = DiskGeometry->Geometry.BytesPerSector; SelectedDrive.FirstDataSector = MAXDWORD; if (SelectedDrive.SectorSize < 512) { - suprintf("Warning: Drive 0x%02x reports a sector size of %d - Correcting to 512 bytes.", + suprintf("WARNING: Drive 0x%02x reports a sector size of %d - Correcting to 512 bytes.", DriveIndex, SelectedDrive.SectorSize); SelectedDrive.SectorSize = 512; } @@ -2126,7 +2126,7 @@ BOOL MountVolume(char* drive_name, char *volume_name) } uprintf("Retrying after dismount..."); if (!DeleteVolumeMountPointA(drive_name)) - uprintf("Warning: Could not delete volume mountpoint '%s': %s", drive_name, WindowsErrorString()); + uprintf("WARNING: Could not delete volume mountpoint '%s': %s", drive_name, WindowsErrorString()); if (SetVolumeMountPointA(drive_name, volume_name)) return TRUE; if ((GetLastError() == ERROR_DIR_NOT_EMPTY) && diff --git a/src/format.c b/src/format.c index 6f526da4..77d896aa 100644 --- a/src/format.c +++ b/src/format.c @@ -745,7 +745,7 @@ static BOOL ClearMBRGPT(HANDLE hPhysicalDrive, LONGLONG DiskSize, DWORD SectorSi } liFilePointer.QuadPart = 0ULL; if (!SetFilePointerEx(hPhysicalDrive, liFilePointer, &liFilePointer, FILE_BEGIN) || (liFilePointer.QuadPart != 0ULL)) - uprintf("Warning: Could not reset disk position"); + uprintf("WARNING: Could not reset disk position"); if (!WriteFileWithRetry(hPhysicalDrive, pZeroBuf, (DWORD)(SectorSize * num_sectors_to_clear), NULL, WRITE_RETRIES)) goto out; CHECK_FOR_USER_CANCEL; @@ -807,7 +807,7 @@ static BOOL WriteMBR(HANDLE hPhysicalDrive) if (buffer[0x1c2] == 0x0e) { uprintf("Partition is already FAT16 LBA..."); } else if ((buffer[0x1c2] != 0x04) && (buffer[0x1c2] != 0x06)) { - uprintf("Warning: converting a non FAT16 partition to FAT16 LBA: FS type=0x%02x", buffer[0x1c2]); + uprintf("WARNING: converting a non FAT16 partition to FAT16 LBA: FS type=0x%02x", buffer[0x1c2]); } buffer[0x1c2] = 0x0e; break; @@ -815,7 +815,7 @@ static BOOL WriteMBR(HANDLE hPhysicalDrive) if (buffer[0x1c2] == 0x0c) { uprintf("Partition is already FAT32 LBA..."); } else if (buffer[0x1c2] != 0x0b) { - uprintf("Warning: converting a non FAT32 partition to FAT32 LBA: FS type=0x%02x", buffer[0x1c2]); + uprintf("WARNING: converting a non FAT32 partition to FAT32 LBA: FS type=0x%02x", buffer[0x1c2]); } buffer[0x1c2] = 0x0c; break; @@ -1170,7 +1170,7 @@ static BOOL WriteDrive(HANDLE hPhysicalDrive, BOOL bZeroDrive) // We poked the MBR and other stuff, so we need to rewind li.QuadPart = 0; if (!SetFilePointerEx(hPhysicalDrive, li, NULL, FILE_BEGIN)) - uprintf("Warning: Unable to rewind image position - wrong data might be copied!"); + uprintf("WARNING: Unable to rewind image position - wrong data might be copied!"); UpdateProgressWithInfoInit(NULL, FALSE); if (bZeroDrive) { @@ -1532,7 +1532,7 @@ DWORD WINAPI FormatThread(void* param) safe_unlockclose(hPhysicalDrive); PrintInfo(0, MSG_239, lmprintf(MSG_307)); if (!is_vds_available || !DeletePartition(DriveIndex, 0, TRUE)) { - uprintf("Warning: Could not delete partition(s): %s", is_vds_available ? WindowsErrorString() : "VDS is not available"); + uprintf("WARNING: Could not delete partition(s): %s", is_vds_available ? WindowsErrorString() : "VDS is not available"); SetLastError(ErrorStatus); ErrorStatus = 0; // If we couldn't delete partitions, Windows give us trouble unless we @@ -1845,7 +1845,7 @@ DWORD WINAPI FormatThread(void* param) // the name we proposed, and we require an exact label, to patch config files. if ((fs_type < FS_EXT2) && !GetVolumeInformationU(drive_name, img_report.usb_label, ARRAYSIZE(img_report.usb_label), NULL, NULL, NULL, NULL, 0)) { - uprintf("Warning: Failed to refresh label: %s", WindowsErrorString()); + uprintf("WARNING: Failed to refresh label: %s", WindowsErrorString()); } else if (IS_EXT(fs_type)) { const char* ext_label = GetExtFsLabel(DriveIndex, 0); if (ext_label != NULL) @@ -1944,7 +1944,7 @@ DWORD WINAPI FormatThread(void* param) uprintf("Installing: %s (KolibriOS loader)", kolibri_dst); if (ExtractISOFile(image_path, "HD_Load/USB_Boot/MTLD_F32", kolibri_dst, FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM) == 0) { - uprintf("Warning: loader installation failed - KolibriOS will not boot!"); + uprintf("WARNING: Loader installation failed - KolibriOS will not boot!"); } } // EFI mode selected, with no 'boot###.efi' but Windows 7 x64's 'bootmgr.efi' (bit #0) @@ -2004,7 +2004,7 @@ DWORD WINAPI FormatThread(void* param) UpdateProgress(OP_EXTRACT_ZIP, 0.0f); drive_name[2] = 0; if (archive_path != NULL && fs_type < FS_EXT2 && !ExtractZip(archive_path, drive_name) && !IS_ERROR(ErrorStatus)) - uprintf("Warning: Could not copy additional files"); + uprintf("WARNING: Could not copy additional files"); } out: diff --git a/src/iso.c b/src/iso.c index 152eddc9..57635325 100644 --- a/src/iso.c +++ b/src/iso.c @@ -2031,7 +2031,7 @@ static DWORD WINAPI OpticalDiscSaveImageThread(void* param) // In case someone poked the disc before us li.QuadPart = 0; if (!SetFilePointerEx(hPhysicalDrive, li, NULL, FILE_BEGIN)) - uprintf("Warning: Unable to rewind device position - wrong data might be copied!"); + uprintf("WARNING: Unable to rewind device position - wrong data might be copied!"); hDestImage = CreateFileU(img_save->ImagePath, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hDestImage == INVALID_HANDLE_VALUE) { @@ -2058,7 +2058,7 @@ static DWORD WINAPI OpticalDiscSaveImageThread(void* param) // Optical drives do not appear to increment the sectors to read automatically li.QuadPart = wb; if (!SetFilePointerEx(hPhysicalDrive, li, NULL, FILE_BEGIN)) - uprintf("Warning: Unable to set device position - wrong data might be copied!"); + uprintf("WARNING: Unable to set device position - wrong data might be copied!"); s = ReadFile(hPhysicalDrive, buffer, (DWORD)MIN(img_save->BufSize, img_save->DeviceSize - wb), &rSize, NULL); if (!s) { diff --git a/src/ms-sys/file.c b/src/ms-sys/file.c index 8e26b219..90687e18 100644 --- a/src/ms-sys/file.c +++ b/src/ms-sys/file.c @@ -59,7 +59,7 @@ int64_t write_sectors(HANDLE hDrive, uint64_t SectorSize, { /* Some large drives return 0, even though all the data was written - See github #787 */ if (large_drive && Size == 0) { - uprintf("Warning: Possible short write\n"); + uprintf("WARNING: Possible short write\n"); return 0; } uprintf("write_sectors: Write error\n"); diff --git a/src/msapi_utf8.h b/src/msapi_utf8.h index e241026b..0c927c91 100644 --- a/src/msapi_utf8.h +++ b/src/msapi_utf8.h @@ -644,9 +644,8 @@ static __inline BOOL GetTextExtentPointU(HDC hdc, const char* lpString, LPSIZE l return ret; } -// A UTF-8 alternative to MS GetCurrentDirectory() since the latter is useless for -// apps installed from the App Store... -static __inline DWORD GetCurrentDirectoryU(DWORD nBufferLength, char* lpBuffer) +// Gets the directory where the executable resises, through GetModuleFileName() +static __inline DWORD GetAppDirectoryU(DWORD nBufferLength, char* lpBuffer) { DWORD i, ret = 0, err = ERROR_INVALID_DATA; // coverity[returned_null] diff --git a/src/net.c b/src/net.c index b995cd05..710b96f8 100644 --- a/src/net.c +++ b/src/net.c @@ -514,7 +514,7 @@ static void CheckForDBXUpdates(int verbose) WriteSetting64(reg_name, timestamp); uprintf("Saved %s as 'dbx_%s.bin'", dbx_info[i].url, efi_archname[i + 1]); } else - uprintf("Warning: Failed to download %s", dbx_info[i].url); + uprintf("WARNING: Failed to download %s", dbx_info[i].url); } } diff --git a/src/process.c b/src/process.c index 3373bb82..7d4730fb 100644 --- a/src/process.c +++ b/src/process.c @@ -697,7 +697,7 @@ static DWORD WINAPI SearchProcessThread(LPVOID param) out: if (!bInitSuccess) - uprintf("Warning: Could not start process handle enumerator!"); + uprintf("WARNING: Could not start process handle enumerator!"); if (wHandleName != NULL) { for (j = 0; j < nHandles; j++) diff --git a/src/rufus.c b/src/rufus.c index 8db03938..53f372ab 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -192,8 +192,13 @@ static void SetAllowedFileSystems(void) if ((image_path == NULL) || !HAS_NTFSLESS_GRUB(img_report)) allowed_filesystem[FS_NTFS] = TRUE; // Don't allow anything besides NTFS if the image is not compatible - if ((image_path != NULL) && !IS_FAT32_COMPAT(img_report)) - break; + if ((image_path != NULL) && !IS_FAT32_COMPAT(img_report)) { + // Only disable FAT32 if we have NTFS enabled + if (allowed_filesystem[FS_NTFS]) + break; + // Else, print a warning + uprintf("WARNING: FAT32 has been forcefully enabled, but this image may not work with FAT32."); + } if (!HAS_WINDOWS(img_report) || (target_type != TT_BIOS) || allow_dual_uefi_bios) { if (!HAS_WINTOGO(img_report) || (ComboBox_GetCurItemData(hImageOption) != IMOP_WIN_TO_GO)) { allowed_filesystem[FS_FAT16] = TRUE; @@ -2112,7 +2117,7 @@ static void InitDialog(HWND hDlg) len = 0; buf = (char*)GetResource(hMainInstance, resource[i], _RT_RCDATA, "ldlinux_sys", &len, TRUE); if (buf == NULL) { - uprintf("Warning: could not read embedded Syslinux v%d version", i + 4); + uprintf("WARNING: could not read embedded Syslinux v%d version", i + 4); } else { embedded_sl_version[i] = GetSyslinuxVersion(buf, len, &ext); static_sprintf(embedded_sl_version_str[i], "%d.%02d", SL_MAJOR(embedded_sl_version[i]), SL_MINOR(embedded_sl_version[i])); @@ -3351,7 +3356,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine is_x86_64 = (strcmp(APPLICATION_ARCH, "x64") == 0); // Retrieve various app & system directories. - if (GetCurrentDirectoryU(sizeof(app_dir), app_dir) == 0) { + if (GetAppDirectoryU(sizeof(app_dir), app_dir) == 0) { uprintf("Could not get application directory: %s", WindowsErrorString()); static_strcpy(app_dir, ".\\"); } else { @@ -3362,7 +3367,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine static_strcat(app_dir, "\\"); } - // In the wonderful world of Microsoft Windows, GetCurrentDirectory() returns the + // In the wonderful world of Microsoft Windows, GetCurrentDirectory() may return the // directory where the application resides, instead of the real current directory // so we need another method to resolve the *ACTUAL* current directory. static_strcpy(cur_dir, ".\\"); @@ -3821,7 +3826,7 @@ relaunch: // Set the hook to automatically close Windows' "You need to format the disk in drive..." prompt SetAlertPromptMessages(); if (!SetAlertPromptHook()) - uprintf("Warning: Could not set alert prompt hook"); + uprintf("WARNING: Could not set alert prompt hook"); ShowWindow(hDlg, SW_SHOWNORMAL); UpdateWindow(hDlg); diff --git a/src/rufus.rc b/src/rufus.rc index e547cc6d..abf418b8 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.10.2266" +CAPTION "Rufus 4.10.2267" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2266,0 - PRODUCTVERSION 4,10,2266,0 + FILEVERSION 4,10,2267,0 + PRODUCTVERSION 4,10,2267,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2266" + VALUE "FileVersion", "4.10.2267" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2266" + VALUE "ProductVersion", "4.10.2267" END END BLOCK "VarFileInfo" diff --git a/src/stdfn.c b/src/stdfn.c index 71b765f9..c4cb874b 100644 --- a/src/stdfn.c +++ b/src/stdfn.c @@ -83,7 +83,7 @@ BOOL htab_create(uint32_t nel, htab_table* htab) return FALSE; } if_not_assert(htab->table == NULL) { - uprintf("Warning: htab_create() was called with a non empty table"); + uprintf("WARNING: htab_create() was called with a non empty table"); return FALSE; } diff --git a/src/stdio.c b/src/stdio.c index e4270114..cf856bc9 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -618,7 +618,7 @@ BOOL WriteFileWithRetry(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWr // Need to get the current file pointer in case we need to retry readFilePointer = SetFilePointerEx(hFile, liZero, &liFilePointer, FILE_CURRENT); if (!readFilePointer) - uprintf("Warning: Could not read file pointer %s", WindowsErrorString()); + uprintf("WARNING: Could not read file pointer %s", WindowsErrorString()); if (nNumRetries == 0) nNumRetries = 1; @@ -634,7 +634,7 @@ BOOL WriteFileWithRetry(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWr return TRUE; // Some large drives return 0, even though all the data was written - See github #787 */ if (large_drive && (*lpNumberOfBytesWritten == 0)) { - uprintf("Warning: Possible short write"); + uprintf("WARNING: Possible short write"); return TRUE; } uprintf("Wrote %d bytes but requested %d", *lpNumberOfBytesWritten, nNumberOfBytesToWrite); diff --git a/src/stdlg.c b/src/stdlg.c index 14d65114..4715f270 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -700,7 +700,7 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM SetDarkModeForDlg(hDlg); // Don't overflow our max radio button if (nDialogItems > (IDC_SELECTION_CHOICEMAX - IDC_SELECTION_CHOICE1 + 1)) { - uprintf("Warning: Too many options requested for Selection (%d vs %d)", + uprintf("WARNING: Too many options requested for Selection (%d vs %d)", nDialogItems, IDC_SELECTION_CHOICEMAX - IDC_SELECTION_CHOICE1); nDialogItems = IDC_SELECTION_CHOICEMAX - IDC_SELECTION_CHOICE1; } @@ -895,7 +895,7 @@ INT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa SetDarkModeForDlg(hDlg); // Don't overflow our max radio button if (nDialogItems > (IDC_LIST_ITEMMAX - IDC_LIST_ITEM1 + 1)) { - uprintf("Warning: Too many items requested for List (%d vs %d)", + uprintf("WARNING: Too many items requested for List (%d vs %d)", nDialogItems, IDC_LIST_ITEMMAX - IDC_LIST_ITEM1); nDialogItems = IDC_LIST_ITEMMAX - IDC_LIST_ITEM1; } @@ -1034,7 +1034,7 @@ INT_PTR CALLBACK TooltipCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM #ifdef _DEBUG // comctl32 causes issues if the tooltips are not being manipulated from the same thread as their parent controls if (GetCurrentThreadId() != MainThreadId) - uprintf("Warning: Tooltip callback is being called from wrong thread"); + uprintf("WARNING: Tooltip callback is being called from wrong thread"); #endif return CallWindowProc(ttlist[i].original_proc, hDlg, message, wParam, lParam); } @@ -2023,11 +2023,11 @@ void SetAlertPromptMessages(void) // 4126 = "Format disk" (button) if (LoadStringU(hMui, 4125, title_str[0], sizeof(title_str[0])) <= 0) { static_strcpy(title_str[0], "Microsoft Windows"); - uprintf("Warning: Could not locate localized format prompt title string in '%s': %s", mui_path, WindowsErrorString()); + uprintf("WARNING: Could not locate localized format prompt title string in '%s': %s", mui_path, WindowsErrorString()); } if (LoadStringU(hMui, 4126, button_str, sizeof(button_str)) <= 0) { static_strcpy(button_str, "Format disk"); - uprintf("Warning: Could not locate localized format prompt button string in '%s': %s", mui_path, WindowsErrorString()); + uprintf("WARNING: Could not locate localized format prompt button string in '%s': %s", mui_path, WindowsErrorString()); } FreeLibrary(hMui); } diff --git a/src/syslinux.c b/src/syslinux.c index 8203586c..b5b3f550 100644 --- a/src/syslinux.c +++ b/src/syslinux.c @@ -294,8 +294,8 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int file_system) if (i > 0) img_report.cfg_path[i] = '/'; if (w < 0) { - uprintf("Could not patch Syslinux files."); - uprintf("WARNING: This could be caused by your firewall having modified downloaded content, such as 'ldlinux.sys'..."); + uprintf("WARNING: Could not patch Syslinux files."); + uprintf("This could be caused by your firewall having modified downloaded content, such as 'ldlinux.sys'..."); goto out; } diff --git a/src/vhd.c b/src/vhd.c index b2c013e8..76b7d8b9 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -619,7 +619,7 @@ BOOL SaveImage(void) // Start from the end of our extension array, since '.vhd' would match for '.vhdx' otherwise for (i = (UINT)img_ext.count; (i > 0) && (strstr(img_save.ImagePath, &img_ext.extension[i - 1][1]) == NULL); i--); if (i == 0) { - uprintf("Warning: Can not determine image type from extension - Saving to uncompressed VHD."); + uprintf("WARNING: Can not determine image type from extension - Saving to uncompressed VHD."); i = image_type_vhd; } else { save_image_type = (char*)&img_ext.extension[i - 1][2]; diff --git a/src/wue.c b/src/wue.c index 2d75e10b..8fe4ba7f 100644 --- a/src/wue.c +++ b/src/wue.c @@ -601,14 +601,14 @@ int SetWinToGoIndex(void) // If we are parsing such an ISO, try to fall back to using DESCRIPTION. if (StrArrayAdd(&version_name, ezxml_child_val(image, "DISPLAYNAME"), TRUE) < 0) { if (StrArrayAdd(&version_name, ezxml_child_val(image, "DESCRIPTION"), TRUE) < 0) { - uprintf("Warning: Could not find a description for image index %d", i + 1); + uprintf("WARNING: Could not find a description for image index %d", i + 1); StrArrayAdd(&version_name, "Unknown Windows Version", TRUE); } bNonStandard = TRUE; } } if (bNonStandard) - uprintf("Warning: Nonstandard Windows image (missing <DISPLAYNAME> entries)"); + uprintf("WARNING: Nonstandard Windows image (missing <DISPLAYNAME> entries)"); if (i > 1) // NB: _log2 returns -2 if SelectionDialog() returns negative (user cancelled) @@ -624,7 +624,7 @@ int SetWinToGoIndex(void) PopulateWindowsVersionFromXml(xml, xml_len, i - 1); // If we couldn't obtain the major and build, we have a problem if (img_report.win_version.major == 0 || img_report.win_version.build == 0) - uprintf("Warning: Could not obtain version information from XML index (Nonstandard Windows image?)"); + uprintf("WARNING: Could not obtain version information from XML index (Nonstandard Windows image?)"); uprintf("Will use '%s' (Build: %d, Index %s) for Windows To Go", version_name.String[i - 1], img_report.win_version.build, version_index.String[i - 1]); // Need Windows 10 Creator Update or later for boot on REMOVABLE to work @@ -953,7 +953,7 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) // (provided that the registry key creation was the only item for this pass) if ((flags & UNATTEND_WINPE_SETUP_MASK) == UNATTEND_SECUREBOOT_TPM_MINRAM) { if (replace_in_token_data(unattend_xml_path, "<settings", "windowsPE", "disabled", FALSE) == NULL) - uprintf("Warning: Could not disable 'windowsPE' pass from unattend.xml"); + uprintf("WARNING: Could not disable 'windowsPE' pass from unattend.xml"); // Remove the flags, since we accomplished the registry creation outside of unattend. flags &= ~UNATTEND_SECUREBOOT_TPM_MINRAM; } else { From c93793092ad112bb6128b7f417981915ad642531 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 25 Jul 2025 14:56:22 +0100 Subject: [PATCH 077/192] [internal] rename the if_not_assert() macro to a more explicit if_assert_fails() * Also add a new if_assert_succeeds() macro. --- src/badblocks.c | 2 +- src/dev.c | 12 ++++++------ src/drive.c | 6 +++--- src/format.c | 30 +++++++++++++++--------------- src/process.c | 4 ++-- src/registry.h | 10 +++++----- src/rufus.c | 4 ++-- src/rufus.h | 3 ++- src/rufus.rc | 10 +++++----- src/stdfn.c | 8 ++++---- src/stdio.c | 2 +- src/stdlg.c | 2 +- src/ui.c | 2 +- src/vhd.c | 2 +- src/wue.c | 4 ++-- 15 files changed, 51 insertions(+), 50 deletions(-) diff --git a/src/badblocks.c b/src/badblocks.c index 7a2a3d18..b6847d0e 100644 --- a/src/badblocks.c +++ b/src/badblocks.c @@ -549,7 +549,7 @@ static unsigned int test_rw(HANDLE hDrive, blk64_t last_block, size_t block_size if (memcmp(read_buffer + i * block_size, buffer + i * block_size, block_size)) { - if_not_assert(currently_testing * block_size < 1 * PB) + if_assert_fails(currently_testing * block_size < 1 * PB) goto out; // coverity[overflow_const] bb_count += bb_output(currently_testing+i-got, CORRUPTION_ERROR); diff --git a/src/dev.c b/src/dev.c index c9093a3e..27a8967f 100644 --- a/src/dev.c +++ b/src/dev.c @@ -137,7 +137,7 @@ BOOL CyclePort(int index) DWORD size; USB_CYCLE_PORT_PARAMS cycle_port; - if_not_assert(index < MAX_DRIVES) + if_assert_fails(index < MAX_DRIVES) return -1; // Wait at least 10 secs between resets if (GetTickCount64() < LastReset + 10000ULL) { @@ -191,7 +191,7 @@ int CycleDevice(int index) SP_DEVINFO_DATA dev_info_data; SP_PROPCHANGE_PARAMS propchange_params; - if_not_assert(index < MAX_DRIVES) + if_assert_fails(index < MAX_DRIVES) return ERROR_INVALID_DRIVE; if ((index < 0) || (safe_strlen(rufus_drive[index].id) < 8)) return ERROR_INVALID_PARAMETER; @@ -585,9 +585,9 @@ BOOL GetDevices(DWORD devnum) // Better safe than sorry. And yeah, we could have used arrays of // arrays to avoid this, but it's more readable this way. - if_not_assert((uasp_start > 0) && (uasp_start < ARRAYSIZE(usbstor_name))) + if_assert_fails((uasp_start > 0) && (uasp_start < ARRAYSIZE(usbstor_name))) goto out; - if_not_assert((card_start > 0) && (card_start < ARRAYSIZE(genstor_name))) + if_assert_fails((card_start > 0) && (card_start < ARRAYSIZE(genstor_name))) goto out; devid_list = NULL; @@ -675,7 +675,7 @@ BOOL GetDevices(DWORD devnum) } // Also test for "_SD&" instead of "_SD_" and so on to allow for devices like // "SCSI\DiskRicoh_Storage_SD&REV_3.0" to be detected. - if_not_assert(strlen(scsi_card_name_copy) > 1) + if_assert_fails(strlen(scsi_card_name_copy) > 1) continue; scsi_card_name_copy[strlen(scsi_card_name_copy) - 1] = '&'; if (safe_strstr(buffer, scsi_card_name_copy) != NULL) { @@ -1007,7 +1007,7 @@ BOOL GetDevices(DWORD devnum) rufus_drive[num_drives].display_name = safe_strdup(display_name); rufus_drive[num_drives].label = safe_strdup(label); rufus_drive[num_drives].size = drive_size; - if_not_assert(rufus_drive[num_drives].size != 0) + if_assert_fails(rufus_drive[num_drives].size != 0) break; if (hub_path != NULL) { rufus_drive[num_drives].hub = safe_strdup(hub_path); diff --git a/src/drive.c b/src/drive.c index 2022bd65..8ddab21e 100644 --- a/src/drive.c +++ b/src/drive.c @@ -279,11 +279,11 @@ char* GetLogicalName(DWORD DriveIndex, uint64_t PartitionOffset, BOOL bKeepTrail // Sanity checks len = safe_strlen(volume_name); - if_not_assert(len > 4) + if_assert_fails(len > 4) continue; - if_not_assert(safe_strnicmp(volume_name, volume_start, 4) == 0) + if_assert_fails(safe_strnicmp(volume_name, volume_start, 4) == 0) continue; - if_not_assert(volume_name[len - 1] == '\\') + if_assert_fails(volume_name[len - 1] == '\\') continue; drive_type = GetDriveTypeA(volume_name); diff --git a/src/format.c b/src/format.c index 77d896aa..7cfa915f 100644 --- a/src/format.c +++ b/src/format.c @@ -116,7 +116,7 @@ static BOOLEAN __stdcall FormatExCallback(FILE_SYSTEM_CALLBACK_COMMAND Command, if (IS_ERROR(ErrorStatus)) return FALSE; - if_not_assert((actual_fs_type >= 0) && (actual_fs_type < FS_MAX)) + if_assert_fails((actual_fs_type >= 0) && (actual_fs_type < FS_MAX)) return FALSE; switch(Command) { @@ -1098,9 +1098,9 @@ static int sector_write(int fd, const void* _buf, unsigned int count) if (sec_size == 0) sec_size = 512; - if_not_assert(sec_size <= 64 * KB) + if_assert_fails(sec_size <= 64 * KB) return -1; - if_not_assert(count <= 1 * GB) + if_assert_fails(count <= 1 * GB) return -1; // If we are on a sector boundary and count is multiple of the @@ -1110,7 +1110,7 @@ static int sector_write(int fd, const void* _buf, unsigned int count) // If we have an existing partial sector, fill and write it if (sec_buf_pos > 0) { - if_not_assert(sec_size >= sec_buf_pos) + if_assert_fails(sec_size >= sec_buf_pos) return -1; fill_size = min(sec_size - sec_buf_pos, count); memcpy(&sec_buf[sec_buf_pos], buf, fill_size); @@ -1133,13 +1133,13 @@ static int sector_write(int fd, const void* _buf, unsigned int count) // Detect overflows // coverity[overflow] int v = fill_size + written; - if_not_assert(v >= fill_size) + if_assert_fails(v >= fill_size) return -1; else return v; } sec_buf_pos = count - fill_size - written; - if_not_assert(sec_buf_pos < sec_size) + if_assert_fails(sec_buf_pos < sec_size) return -1; // Keep leftover bytes, if any, in the sector buffer @@ -1183,7 +1183,7 @@ static BOOL WriteDrive(HANDLE hPhysicalDrive, BOOL bZeroDrive) uprintf("Could not allocate disk zeroing buffer"); goto out; } - if_not_assert((uintptr_t)buffer % SelectedDrive.SectorSize == 0) + if_assert_fails((uintptr_t)buffer % SelectedDrive.SectorSize == 0) goto out; // Clear buffer @@ -1196,7 +1196,7 @@ static BOOL WriteDrive(HANDLE hPhysicalDrive, BOOL bZeroDrive) uprintf("Could not allocate disk comparison buffer"); goto out; } - if_not_assert((uintptr_t)cmp_buffer % SelectedDrive.SectorSize == 0) + if_assert_fails((uintptr_t)cmp_buffer % SelectedDrive.SectorSize == 0) goto out; } @@ -1294,7 +1294,7 @@ static BOOL WriteDrive(HANDLE hPhysicalDrive, BOOL bZeroDrive) uprintf("Could not allocate disk write buffer"); goto out; } - if_not_assert((uintptr_t)sec_buf% SelectedDrive.SectorSize == 0) + if_assert_fails((uintptr_t)sec_buf% SelectedDrive.SectorSize == 0) goto out; sec_buf_pos = 0; update_progress(0); @@ -1318,7 +1318,7 @@ static BOOL WriteDrive(HANDLE hPhysicalDrive, BOOL bZeroDrive) goto out; } } else { - if_not_assert(img_report.compression_type != IMG_COMPRESSION_FFU) + if_assert_fails(img_report.compression_type != IMG_COMPRESSION_FFU) goto out; // VHD/VHDX require mounting the image first if (img_report.compression_type == IMG_COMPRESSION_VHD || @@ -1345,7 +1345,7 @@ static BOOL WriteDrive(HANDLE hPhysicalDrive, BOOL bZeroDrive) uprintf("Could not allocate disk write buffer"); goto out; } - if_not_assert((uintptr_t)buffer% SelectedDrive.SectorSize == 0) + if_assert_fails((uintptr_t)buffer% SelectedDrive.SectorSize == 0) goto out; // Start the initial read @@ -1372,7 +1372,7 @@ static BOOL WriteDrive(HANDLE hPhysicalDrive, BOOL bZeroDrive) // 2. WriteFile fails unless the size is a multiple of sector size if (read_size[read_bufnum] % SelectedDrive.SectorSize != 0) { - if_not_assert(CEILING_ALIGN(read_size[read_bufnum], SelectedDrive.SectorSize) <= buf_size) + if_assert_fails(CEILING_ALIGN(read_size[read_bufnum], SelectedDrive.SectorSize) <= buf_size) goto out; read_size[read_bufnum] = CEILING_ALIGN(read_size[read_bufnum], SelectedDrive.SectorSize); } @@ -1668,7 +1668,7 @@ DWORD WINAPI FormatThread(void* param) if (img_report.compression_type == IMG_COMPRESSION_FFU) { char cmd[MAX_PATH + 128], *physical = NULL; // Should have been filtered out beforehand - if_not_assert(has_ffu_support) + if_assert_fails(has_ffu_support) goto out; safe_unlockclose(hPhysicalDrive); physical = GetPhysicalName(SelectedDrive.DeviceNumber); @@ -1857,7 +1857,7 @@ DWORD WINAPI FormatThread(void* param) // All good } else if (target_type == TT_UEFI) { // For once, no need to do anything - just check our sanity - if_not_assert((boot_type == BT_IMAGE) && IS_EFI_BOOTABLE(img_report) && (fs_type <= FS_NTFS)) { + if_assert_fails((boot_type == BT_IMAGE) && IS_EFI_BOOTABLE(img_report) && (fs_type <= FS_NTFS)) { ErrorStatus = RUFUS_ERROR(ERROR_INSTALL_FAILURE); goto out; } @@ -1932,7 +1932,7 @@ DWORD WINAPI FormatThread(void* param) ErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_PATCH)); } } else { - if_not_assert(!img_report.is_windows_img) + if_assert_fails(!img_report.is_windows_img) goto out; if (!ExtractISO(image_path, drive_name, FALSE)) { if (!IS_ERROR(ErrorStatus)) diff --git a/src/process.c b/src/process.c index 7d4730fb..71d2bdf8 100644 --- a/src/process.c +++ b/src/process.c @@ -449,7 +449,7 @@ static DWORD WINAPI SearchProcessThread(LPVOID param) // Work on our own copy of the handle names so we don't have to hold the // mutex for string comparison. Update only if the version has changed. if (blocking_process.nVersion[0] != blocking_process.nVersion[1]) { - if_not_assert(blocking_process.wHandleName != NULL && blocking_process.nHandles != 0) { + if_assert_fails(blocking_process.wHandleName != NULL && blocking_process.nHandles != 0) { ReleaseMutex(hLock); goto out; } @@ -883,7 +883,7 @@ BYTE GetProcessSearch(uint32_t timeout, uint8_t access_mask, BOOL bIgnoreStalePr return 0; } - if_not_assert(blocking_process.hLock != NULL) + if_assert_fails(blocking_process.hLock != NULL) return 0; retry: diff --git a/src/registry.h b/src/registry.h index e05f00ad..ba8dd9ea 100644 --- a/src/registry.h +++ b/src/registry.h @@ -37,9 +37,9 @@ static __inline BOOL DeleteRegistryKey(HKEY key_root, const char* key_name) HKEY hSoftware = NULL; LONG s; - if_not_assert(key_root == REGKEY_HKCU) + if_assert_fails(key_root == REGKEY_HKCU) return FALSE; - if_not_assert(key_name != NULL) + if_assert_fails(key_name != NULL) return FALSE; if (RegOpenKeyExA(key_root, "SOFTWARE", 0, KEY_READ|KEY_CREATE_SUB_KEY, &hSoftware) != ERROR_SUCCESS) @@ -133,12 +133,12 @@ static __inline BOOL _SetRegistryKey(HKEY key_root, const char* key_name, DWORD HKEY hRoot = NULL, hApp = NULL; DWORD dwDisp, dwType = reg_type; - if_not_assert(key_name != NULL) + if_assert_fails(key_name != NULL) return FALSE; - if_not_assert(key_root == REGKEY_HKCU) + if_assert_fails(key_root == REGKEY_HKCU) return FALSE; // Validate that we are always dealing with a short key - if_not_assert(strchr(key_name, '\\') == NULL) + if_assert_fails(strchr(key_name, '\\') == NULL) return FALSE; if (RegOpenKeyExA(key_root, NULL, 0, KEY_READ|KEY_CREATE_SUB_KEY, &hRoot) != ERROR_SUCCESS) { diff --git a/src/rufus.c b/src/rufus.c index 53f372ab..0a391474 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1154,7 +1154,7 @@ static void DisplayISOProps(void) // Insert the image name into the Boot selection dropdown and (re)populate the Image option dropdown static void UpdateImage(BOOL update_image_option_only) { - if_not_assert(image_index != 0) + if_assert_fails(image_index != 0) return; if (!update_image_option_only) { @@ -1520,7 +1520,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) } if (boot_type == BT_IMAGE) { - if_not_assert(image_path != NULL) + if_assert_fails(image_path != NULL) goto out; if ((size_check) && (img_report.projected_size > (uint64_t)SelectedDrive.DiskSize)) { // This ISO image is too big for the selected target diff --git a/src/rufus.h b/src/rufus.h index 8d5c9cc9..db8a0c3d 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -205,7 +205,8 @@ static __inline void static_repchr(char* p, char s, char r) { } #define to_unix_path(str) static_repchr(str, '\\', '/') #define to_windows_path(str) static_repchr(str, '/', '\\') -#define if_not_assert(cond) assert(cond); if (!(cond)) +#define if_assert_fails(cond) assert(cond); if (!(cond)) +#define if_assert_succeeds(cond) assert(cond); if ((cond)) extern void uprintf(const char *format, ...); extern void uprintfs(const char *str); diff --git a/src/rufus.rc b/src/rufus.rc index abf418b8..e5d4c04f 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.10.2267" +CAPTION "Rufus 4.10.2268" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2267,0 - PRODUCTVERSION 4,10,2267,0 + FILEVERSION 4,10,2268,0 + PRODUCTVERSION 4,10,2268,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2267" + VALUE "FileVersion", "4.10.2268" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2267" + VALUE "ProductVersion", "4.10.2268" END END BLOCK "VarFileInfo" diff --git a/src/stdfn.c b/src/stdfn.c index c4cb874b..81f89743 100644 --- a/src/stdfn.c +++ b/src/stdfn.c @@ -82,7 +82,7 @@ BOOL htab_create(uint32_t nel, htab_table* htab) if (htab == NULL) { return FALSE; } - if_not_assert(htab->table == NULL) { + if_assert_fails(htab->table == NULL) { uprintf("WARNING: htab_create() was called with a non empty table"); return FALSE; } @@ -198,7 +198,7 @@ uint32_t htab_hash(char* str, htab_table* htab) // Not found => New entry // If the table is full return an error - if_not_assert(htab->filled < htab->size) { + if_assert_fails(htab->filled < htab->size) { uprintf("Hash table is full (%d entries)", htab->size); return 0; } @@ -1216,7 +1216,7 @@ BOOL MountRegistryHive(const HKEY key, const char* pszHiveName, const char* pszH LSTATUS status; HANDLE token = INVALID_HANDLE_VALUE; - if_not_assert((key == HKEY_LOCAL_MACHINE) || (key == HKEY_USERS)) + if_assert_fails((key == HKEY_LOCAL_MACHINE) || (key == HKEY_USERS)) return FALSE; if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &token)) { @@ -1248,7 +1248,7 @@ BOOL UnmountRegistryHive(const HKEY key, const char* pszHiveName) { LSTATUS status; - if_not_assert((key == HKEY_LOCAL_MACHINE) || (key == HKEY_USERS)) + if_assert_fails((key == HKEY_LOCAL_MACHINE) || (key == HKEY_USERS)) return FALSE; status = RegUnLoadKeyA(key, pszHiveName); diff --git a/src/stdio.c b/src/stdio.c index cf856bc9..308c018e 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -924,7 +924,7 @@ uint32_t ResolveDllAddress(dll_resolver_t* resolver) // NB: SymLoadModuleEx() does not load a PDB unless the file has an explicit '.pdb' extension base_address = pfSymLoadModuleEx(hRufus, NULL, path, NULL, DEFAULT_BASE_ADDRESS, 0, NULL, 0); - if_not_assert(base_address == DEFAULT_BASE_ADDRESS) + if_assert_fails(base_address == DEFAULT_BASE_ADDRESS) goto out; // On Windows 11 ARM64 the following call will return *TWO* different addresses for the same // call, because most Windows DLL's are ARM64X, which means that they are an unholy union of diff --git a/src/stdlg.c b/src/stdlg.c index 4715f270..d47d7062 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -604,7 +604,7 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP return (INT_PTR)TRUE; case IDC_MORE_INFO: if (notification_more_info != NULL) { - if_not_assert(notification_more_info->callback != NULL) + if_assert_fails(notification_more_info->callback != NULL) return (INT_PTR)FALSE; if (notification_more_info->id == MORE_INFO_URL) { ShellExecuteA(hDlg, "open", notification_more_info->url, NULL, NULL, SW_SHOWNORMAL); diff --git a/src/ui.c b/src/ui.c index f403695f..ec2e5c7b 100644 --- a/src/ui.c +++ b/src/ui.c @@ -579,7 +579,7 @@ void SetSectionHeaders(HWND hDlg, HFONT* hFont) memset(wtmp, 0, sizeof(wtmp)); GetWindowTextW(hCtrl, wtmp, ARRAYSIZE(wtmp) - 4); wlen = wcslen(wtmp); - if_not_assert(wlen < ARRAYSIZE(wtmp) - 2) + if_assert_fails(wlen < ARRAYSIZE(wtmp) - 2) break; wtmp[wlen++] = L' '; wtmp[wlen++] = L' '; diff --git a/src/vhd.c b/src/vhd.c index 76b7d8b9..c3d39110 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -478,7 +478,7 @@ static DWORD WINAPI VhdSaveImageThread(void* param) OVERLAPPED overlapped = { 0 }; DWORD r = ERROR_NOT_FOUND, flags; - if_not_assert(img_save->Type == VIRTUAL_STORAGE_TYPE_DEVICE_VHD || + if_assert_fails(img_save->Type == VIRTUAL_STORAGE_TYPE_DEVICE_VHD || img_save->Type == VIRTUAL_STORAGE_TYPE_DEVICE_VHDX) return ERROR_INVALID_PARAMETER; diff --git a/src/wue.c b/src/wue.c index 8fe4ba7f..1ee0e2ec 100644 --- a/src/wue.c +++ b/src/wue.c @@ -969,7 +969,7 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) // If we have a windowsPE section, copy the answer files to the root of boot.wim as // Autounattend.xml. This also results in that file being automatically copied over // to %WINDIR%\Panther\unattend.xml for later passes processing. - if_not_assert(update_boot_wim) + if_assert_fails(update_boot_wim) goto out; wuc[wuc_index].op = WIMLIB_UPDATE_OP_ADD; wuc[wuc_index].add.fs_source_path = utf8_to_wchar(unattend_xml_path); @@ -1003,7 +1003,7 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) StrArray files; char tmp_dir2[MAX_PATH], *rep; const char* efi_ex_path = "Windows\\Boot\\EFI_EX"; - if_not_assert(update_boot_wim) + if_assert_fails(update_boot_wim) goto out; if (GetTempDirNameU(temp_dir, APPLICATION_NAME, 0, tmp_dir[1]) == 0) { uprintf("WARNING: Could not create temp dir for 2023 signed UEFI bootloaders"); From e43d6bbc8ac4e6f059caf0d23a9a389bc9f124d7 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 25 Jul 2025 17:52:42 +0100 Subject: [PATCH 078/192] [core] fix crash when trying to open a Windows ISO with a very long path * The current wimlib code makes repeated attempts to close stdin (0) on cleanup when a WIM cannot be opened, which doesn't sit too well with MSFT's _close() as it invokes an invalid parameter exception handler that can make the application crash... * This may happen when we try to open the WIM from an ISO that has been truncated because it resides on a path that is longer than MAX_PATH on account that wimlib repeatedly attempts to close the phantom stdin fd's it sees assigned to its internal (and unused) WIMStruct after it errors out on trying to open the image. * So we declare stdin as invalid for use with Visual Studio compiled apps. * For good measure we also increase the size of the string arrays we used for WIM paths to 1024 UTF-8 characters, and add explicit asserts in case we have to truncate these paths (since we are quite curious about real-life scenarios where people need paths longer than 1024). * Closes #2777. * Also improve the safe_strcp() and safe_sprintf() macros and fix some unwarranted "Command was terminated by user" messages introduced in commit ea01cd41c0a2e58c1b3341f045f873caaed188bc. --- src/iso.c | 14 +++++++++----- src/msapi_utf8.h | 4 ++++ src/rufus.h | 4 ++-- src/rufus.rc | 10 +++++----- src/stdfn.c | 4 ++-- src/wimlib/wimlib/file_io.h | 8 ++++++++ src/wue.c | 12 +++++++++--- 7 files changed, 39 insertions(+), 17 deletions(-) diff --git a/src/iso.c b/src/iso.c index 57635325..02419a5f 100644 --- a/src/iso.c +++ b/src/iso.c @@ -246,7 +246,7 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const const char* psz_fullpath, EXTRACT_PROPS *props) { size_t i, j, k, len; - char bootloader_name[32], path[MAX_PATH]; + char bootloader_name[32]; // Check for an isolinux/syslinux config file anywhere memset(props, 0, sizeof(EXTRACT_PROPS)); @@ -298,6 +298,7 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const if (file_length >= 4 * GB && psz_dirname != NULL && IS_FAT(fs_type) && img_report.has_4GB_file == 0x81) { if (safe_stricmp(&psz_dirname[max(0, ((int)safe_strlen(psz_dirname)) - ((int)strlen(sources_str)))], sources_str) == 0) { + char wim_path[4 * MAX_PATH]; for (i = 0; i < ARRAYSIZE(wininst_name) - 1; i++) { if (safe_stricmp(psz_basename, wininst_name[i]) == 0 && file_length >= 4 * GB) { print_split_file((char*)psz_fullpath, file_length); @@ -305,8 +306,9 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const dst[strlen(dst) - 3] = 's'; dst[strlen(dst) - 2] = 'w'; dst[strlen(dst) - 1] = 'm'; - static_sprintf(path, "%s|%s/%s", image_path, psz_dirname, psz_basename); - WimSplitFile(path, dst); + assert(safe_strlen(image_path) + safe_strlen(psz_dirname) + safe_strlen(psz_basename) + 2 < ARRAYSIZE(wim_path)); + static_sprintf(wim_path, "%s|%s/%s", image_path, psz_dirname, psz_basename); + WimSplitFile(wim_path, dst); free(dst); return TRUE; } @@ -1401,8 +1403,10 @@ out: safe_free(buf); } if (HAS_WININST(img_report)) { - static_sprintf(path, "%s|%s", image_path, &img_report.wininst_path[0][2]); - img_report.wininst_version = GetWimVersion(path); + char wim_path[4 * MAX_PATH]; + assert(safe_strlen(image_path) + safe_strlen(&img_report.wininst_path[0][2]) + 2 < ARRAYSIZE(wim_path)); + static_sprintf(wim_path, "%s|%s", image_path, &img_report.wininst_path[0][2]); + img_report.wininst_version = GetWimVersion(wim_path); } if (img_report.has_grub2) { char grub_path[128]; diff --git a/src/msapi_utf8.h b/src/msapi_utf8.h index 0c927c91..5349362e 100644 --- a/src/msapi_utf8.h +++ b/src/msapi_utf8.h @@ -56,8 +56,12 @@ extern "C" { #define wchar_to_utf8_no_alloc(wsrc, dest, dest_size) \ WideCharToMultiByte(CP_UTF8, 0, wsrc, -1, dest, (int)(dest_size), NULL, NULL) +#define wchar_to_utf8_get_size(wsrc) \ + WideCharToMultiByte(CP_UTF8, 0, wsrc, -1, NULL, 0, NULL, NULL) #define utf8_to_wchar_no_alloc(src, wdest, wdest_size) \ MultiByteToWideChar(CP_UTF8, 0, src, -1, wdest, (int)(wdest_size)) +#define utf8_to_wchar_get_size(src) \ + MultiByteToWideChar(CP_UTF8, 0, src, -1, NULL, 0) #define Edit_ReplaceSelU(hCtrl, str) ((void)SendMessageLU(hCtrl, EM_REPLACESEL, (WPARAM)FALSE, str)) #define ComboBox_AddStringU(hCtrl, str) ((int)(DWORD)SendMessageLU(hCtrl, CB_ADDSTRING, (WPARAM)FALSE, str)) #define ComboBox_InsertStringU(hCtrl, index, str) ((int)(DWORD)SendMessageLU(hCtrl, CB_INSERTSTRING, (WPARAM)index, str)) diff --git a/src/rufus.h b/src/rufus.h index db8a0c3d..033349b7 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -168,7 +168,7 @@ #define safe_mm_free(p) do { _mm_free((void*)p); p = NULL; } while(0) static __inline void safe_strcp(char* dst, const size_t dst_max, const char* src, const size_t count) { memmove(dst, src, min(count, dst_max)); - dst[min(count, dst_max) - 1] = 0; + if (dst != NULL) dst[min(count, dst_max) - 1] = 0; } #define safe_strcpy(dst, dst_max, src) safe_strcp(dst, dst_max, src, safe_strlen(src) + 1) #define static_strcpy(dst, src) safe_strcpy(dst, sizeof(dst), src) @@ -188,7 +188,7 @@ static __inline void safe_strcp(char* dst, const size_t dst_max, const char* src HIMAGELIST _hImageList = (HIMAGELIST)SendMessage(hToolbar, TB_GETIMAGELIST, (WPARAM)0, (LPARAM)0); \ safe_destroy_imagelist(_hImageList); } } while(0) #define safe_sprintf(dst, count, ...) do { size_t _count = count; char* _dst = dst; _snprintf_s(_dst, _count, _TRUNCATE, __VA_ARGS__); \ - _dst[(_count) - 1] = 0; } while(0) + if (_dst != NULL) _dst[(_count) - 1] = 0; } while(0) #define static_sprintf(dst, ...) safe_sprintf(dst, sizeof(dst), __VA_ARGS__) #define safe_atoi(str) ((((char*)(str))==NULL) ? 0 : atoi(str)) #define safe_strlen(str) ((((char*)(str))==NULL) ? 0 : strlen(str)) diff --git a/src/rufus.rc b/src/rufus.rc index e5d4c04f..22d0cb3d 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.10.2268" +CAPTION "Rufus 4.10.2269" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2268,0 - PRODUCTVERSION 4,10,2268,0 + FILEVERSION 4,10,2269,0 + PRODUCTVERSION 4,10,2269,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2268" + VALUE "FileVersion", "4.10.2269" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2268" + VALUE "ProductVersion", "4.10.2269" END END BLOCK "VarFileInfo" diff --git a/src/stdfn.c b/src/stdfn.c index 81f89743..cc4f9abc 100644 --- a/src/stdfn.c +++ b/src/stdfn.c @@ -890,13 +890,13 @@ DWORD RunCommandWithProgress(const char* cmd, const char* dir, BOOL log, int msg Sleep(100); }; } else { - // TODO: Detect user cancellation here? switch (WaitForSingleObject(pi.hProcess, 1800000)) { case WAIT_TIMEOUT: uprintf("Command did not terminate within timeout duration"); break; case WAIT_OBJECT_0: - uprintf("Command was terminated by user"); + if (IS_ERROR(ErrorStatus) && (SCODE_CODE(ErrorStatus) == ERROR_CANCELLED)) + uprintf("Command was terminated by user"); break; default: uprintf("Error while waiting for command to be terminated: %s", WindowsErrorString()); diff --git a/src/wimlib/wimlib/file_io.h b/src/wimlib/wimlib/file_io.h index f7deef8c..22d3d8ce 100644 --- a/src/wimlib/wimlib/file_io.h +++ b/src/wimlib/wimlib/file_io.h @@ -81,7 +81,15 @@ static inline void filedes_invalidate(struct filedes *fd) static inline bool filedes_valid(const struct filedes *fd) { +#ifdef _MSC_VER + // The current wimlib code makes repeated attempts to close stdin (0) when a + // WIM cannot be opened, which doesn't sit too well with MSFT's _close() as + // it invokes the exception handler and can make the application crash... + // So we declare stdin as invalid for use with Visual Studio compiled apps. + return (fd->fd != -1 && fd->fd != 0); +#else return fd->fd != -1; +#endif } #endif /* _WIMLIB_FILE_IO_H */ diff --git a/src/wue.c b/src/wue.c index 1ee0e2ec..08ca6eb5 100644 --- a/src/wue.c +++ b/src/wue.c @@ -475,15 +475,17 @@ static void PopulateWindowsVersionFromXml(const wchar_t* xml, size_t xml_len, in BOOL PopulateWindowsVersion(void) { int r; - char wim_path[MAX_PATH] = ""; + char wim_path[4 * MAX_PATH] = ""; wchar_t* xml = NULL; size_t xml_len; WIMStruct* wim = NULL; memset(&img_report.win_version, 0, sizeof(img_report.win_version)); + assert(safe_strlen(image_path) + 1 < ARRAYSIZE(wim_path)); static_strcpy(wim_path, image_path); if (!img_report.is_windows_img) { + assert(safe_strlen(image_path) + safe_strlen(&img_report.wininst_path[0][3]) + 1 < ARRAYSIZE(wim_path)); static_strcat(wim_path, "|"); static_strcat(wim_path, &img_report.wininst_path[0][3]); } @@ -545,7 +547,7 @@ int SetWinToGoIndex(void) int i, r; WIMStruct* wim = NULL; char* install_names[MAX_WININST]; - wchar_t wim_path[MAX_PATH] = L"", *xml = NULL; + wchar_t wim_path[4 * MAX_PATH] = L"", *xml = NULL; size_t xml_len; StrArray version_name = { 0 }, version_index = { 0 }; BOOL bNonStandard = FALSE; @@ -568,9 +570,11 @@ int SetWinToGoIndex(void) wininst_index = 0; } + assert(utf8_to_wchar_get_size(image_path) <= ARRAYSIZE(wim_path)); utf8_to_wchar_no_alloc(image_path, wim_path, ARRAYSIZE(wim_path)); if (!img_report.is_windows_img) { wcscat(wim_path, L"|"); + assert(utf8_to_wchar_get_size(image_path) + utf8_to_wchar_get_size(&img_report.wininst_path[wininst_index][2]) <= ARRAYSIZE(wim_path)); utf8_to_wchar_no_alloc(&img_report.wininst_path[wininst_index][2], &wim_path[wcslen(wim_path)], (int)ARRAYSIZE(wim_path) - wcslen(wim_path)); } @@ -663,7 +667,7 @@ out: /// <returns>TRUE on success, FALSE on error.</returns> BOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp) { - char *ms_efi = NULL, wim_path[MAX_PATH], cmd[MAX_PATH]; + char *ms_efi = NULL, wim_path[4 * MAX_PATH], cmd[MAX_PATH]; ULONG cluster_size; uprintf("Windows To Go mode selected"); @@ -673,8 +677,10 @@ BOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp) return FALSE; } + assert(safe_strlen(image_path) < ARRAYSIZE(wim_path)); static_strcpy(wim_path, image_path); if (!img_report.is_windows_img) { + assert(safe_strlen(image_path) + safe_strlen(&img_report.wininst_path[wininst_index][3]) + 1 < ARRAYSIZE(wim_path)); static_strcat(wim_path, "|"); static_strcat(wim_path, &img_report.wininst_path[wininst_index][3]); } From 00f7bd193f3ab316e1dd4c94f9c7bbef2cbb35a9 Mon Sep 17 00:00:00 2001 From: Kazkans <bajonbap@gmail.com> Date: Thu, 24 Jul 2025 23:44:03 +0200 Subject: [PATCH 079/192] [vhd] return an error if there is not enough space on disk to save VHD/VHDX * Closes #2779. --- src/rufus.rc | 10 +++++----- src/vhd.c | 9 ++++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/rufus.rc b/src/rufus.rc index 22d0cb3d..337a7f70 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.10.2269" +CAPTION "Rufus 4.10.2270" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2269,0 - PRODUCTVERSION 4,10,2269,0 + FILEVERSION 4,10,2270,0 + PRODUCTVERSION 4,10,2270,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2269" + VALUE "FileVersion", "4.10.2270" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2269" + VALUE "ProductVersion", "4.10.2270" END END BLOCK "VarFileInfo" diff --git a/src/vhd.c b/src/vhd.c index c3d39110..c7ff6ace 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -476,7 +476,7 @@ static DWORD WINAPI VhdSaveImageThread(void* param) STOPGAP_CREATE_VIRTUAL_DISK_PARAMETERS vparams = { 0 }; VIRTUAL_DISK_PROGRESS vprogress = { 0 }; OVERLAPPED overlapped = { 0 }; - DWORD r = ERROR_NOT_FOUND, flags; + DWORD r = ERROR_NOT_FOUND, flags, bytes_read = 0; if_assert_fails(img_save->Type == VIRTUAL_STORAGE_TYPE_DEVICE_VHD || img_save->Type == VIRTUAL_STORAGE_TYPE_DEVICE_VHDX) @@ -531,6 +531,13 @@ static DWORD WINAPI VhdSaveImageThread(void* param) } } + if (!GetOverlappedResult(handle, &overlapped, &bytes_read, FALSE)) { + if (GetLastError() == ERROR_DISK_FULL) + ErrorStatus = RUFUS_ERROR(ERROR_FILE_TOO_LARGE); + uprintf("Could not save virtual disk: %s", WindowsErrorString()); + goto out; + } + r = 0; UpdateProgressWithInfo(OP_FORMAT, MSG_261, SelectedDrive.DiskSize, SelectedDrive.DiskSize); uprintf("Saved '%s'", img_save->ImagePath); From 8ec08c1f9ed761d83e214aa9c650473b50a8d2c3 Mon Sep 17 00:00:00 2001 From: ozone10 <positronix10@gmail.com> Date: Sun, 27 Jul 2025 10:02:35 +0200 Subject: [PATCH 080/192] [ui ] fix broken dark mode on old Windows 10 builds * Closes #2780. * Closes #2766. --- src/darkmode.c | 26 +++++++++++++++++++------- src/darkmode.h | 5 ++++- src/rufus.rc | 10 +++++----- src/settings.h | 1 + 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/darkmode.c b/src/darkmode.c index 40fd786c..05a840b9 100644 --- a/src/darkmode.c +++ b/src/darkmode.c @@ -32,6 +32,7 @@ #include "rufus.h" #include "ui.h" +#include "settings.h" #include "darkmode.h" PF_TYPE_DECL(WINAPI, BOOL, AllowDarkModeForWindow, (HWND, BOOL)); @@ -58,7 +59,7 @@ static inline BOOL IsAtLeastWin10Build(DWORD buildNumber) static inline BOOL IsAtLeastWin10(void) { - return IsAtLeastWin10Build(WIN10_22H2); + return IsAtLeastWin10Build(WIN10_1809); } static inline BOOL IsAtLeastWin11(void) @@ -80,12 +81,18 @@ BOOL GetDarkModeFromRegistry(void) { DWORD data = 0, size = sizeof(data); - is_darkmode_enabled = FALSE; - if (RegGetValueW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", - L"AppsUseLightTheme", RRF_RT_REG_DWORD, NULL, &data, &size) == ERROR_SUCCESS) + if (!IsAtLeastWin10() || IsHighContrast()) + return FALSE; + + if (ReadSettingBool(SETTING_DISABLE_DARK_MODE)) + return FALSE; + + if (RegGetValueA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", + "AppsUseLightTheme", RRF_RT_REG_DWORD, NULL, &data, &size) == ERROR_SUCCESS) // Dark mode is 0, light mode is 1 - is_darkmode_enabled = (data == 0); - return is_darkmode_enabled; + return (data == 0); + + return FALSE; } void InitDarkMode(HWND hWnd) @@ -112,12 +119,17 @@ void SetDarkTitleBar(HWND hWnd) DwmSetWindowAttribute(hWnd, DWMWA_USE_IMMERSIVE_DARK_MODE, &is_darkmode_enabled, sizeof(is_darkmode_enabled)); return; } - if (IsAtLeastWin10()) { + if (IsAtLeastWin10Build(WIN10_1903)) { PF_INIT_OR_OUT(SetWindowCompositionAttribute, user32); WINDOWCOMPOSITIONATTRIBDATA data = { WCA_USEDARKMODECOLORS, &is_darkmode_enabled, sizeof(is_darkmode_enabled) }; pfSetWindowCompositionAttribute(hWnd, &data); return; } + // only for Windows 10 1809 build 17763 + if (IsAtLeastWin10()) { + SetPropW(hWnd, L"UseImmersiveDarkModeColors", (HANDLE)(intptr_t)is_darkmode_enabled); + return; + } out: is_darkmode_enabled = FALSE; diff --git a/src/darkmode.h b/src/darkmode.h index 479b3666..9b63d317 100644 --- a/src/darkmode.h +++ b/src/darkmode.h @@ -25,6 +25,8 @@ extern BOOL is_darkmode_enabled; typedef enum _WindowsBuild { + WIN10_1809 = 17763, // first build to support dark mode + WIN10_1903 = 18362, WIN10_22H2 = 19045, WIN11_21H2 = 22000, } WindowsBuild; @@ -139,7 +141,8 @@ static __inline void SetDarkModeForDlg(HWND hWnd) static __inline void InitAndSetDarkModeForMainDlg(HWND hWnd) { - if (GetDarkModeFromRegistry()) { + is_darkmode_enabled = GetDarkModeFromRegistry(); + if (is_darkmode_enabled) { InitDarkMode(hWnd); InitAccentColor(); SetDarkModeForDlg(hWnd); diff --git a/src/rufus.rc b/src/rufus.rc index 337a7f70..c62e18bf 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.10.2270" +CAPTION "Rufus 4.10.2271" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2270,0 - PRODUCTVERSION 4,10,2270,0 + FILEVERSION 4,10,2271,0 + PRODUCTVERSION 4,10,2271,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2270" + VALUE "FileVersion", "4.10.2271" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2270" + VALUE "ProductVersion", "4.10.2271" END END BLOCK "VarFileInfo" diff --git a/src/settings.h b/src/settings.h index 734a9584..4e0e8cc6 100644 --- a/src/settings.h +++ b/src/settings.h @@ -33,6 +33,7 @@ extern char* ini_file; #define SETTING_ADVANCED_MODE_FORMAT "ShowAdvancedFormatOptions" #define SETTING_COMM_CHECK "CommCheck64" #define SETTING_DEFAULT_THREAD_PRIORITY "DefaultThreadPriority" +#define SETTING_DISABLE_DARK_MODE "DisableDarkMode" #define SETTING_DISABLE_FAKE_DRIVES_CHECK "DisableFakeDrivesCheck" #define SETTING_DISABLE_LGP "DisableLGP" #define SETTING_DISABLE_RUFUS_MBR "DisableRufusMBR" From 99c04a9f46b09c6881f426144bb1c3f010e678a8 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 3 Sep 2025 11:32:12 +0100 Subject: [PATCH 081/192] [misc] fix various printf issues * Also bump actions/checkout to v5. * Closes #2791. --- .github/workflows/codeql.yml | 2 +- .github/workflows/coverity.yml | 2 +- .github/workflows/mingw.yml | 2 +- .github/workflows/setup.yml | 2 +- .github/workflows/vs2022.yml | 2 +- src/dev.c | 4 ++-- src/drive.c | 6 +++--- src/iso.c | 2 +- src/localization.c | 2 +- src/pki.c | 2 +- src/rufus.rc | 10 +++++----- src/stdfn.c | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index fdb0763e..b199937e 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -41,7 +41,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Initialize CodeQL uses: github/codeql-action/init@v3 diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index da40284e..40aaa621 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 submodules: recursive diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml index 9ea8fcf8..33e84d5f 100644 --- a/.github/workflows/mingw.yml +++ b/.github/workflows/mingw.yml @@ -54,7 +54,7 @@ jobs: upx - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 submodules: recursive diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml index 98c62dc3..a222d685 100644 --- a/.github/workflows/setup.yml +++ b/.github/workflows/setup.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Add MSBuild to PATH uses: microsoft/setup-msbuild@v2 diff --git a/.github/workflows/vs2022.yml b/.github/workflows/vs2022.yml index 6721ebc7..cbbe9e75 100644 --- a/.github/workflows/vs2022.yml +++ b/.github/workflows/vs2022.yml @@ -40,7 +40,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 submodules: recursive diff --git a/src/dev.c b/src/dev.c index 27a8967f..a1a44fc3 100644 --- a/src/dev.c +++ b/src/dev.c @@ -768,7 +768,7 @@ BOOL GetDevices(DWORD devnum) uuprintf(" Matched with (GP) ID[%03d]: %s", j, device_id); } if ((uintptr_t)htab_devid.table[j].data > 0) { - uuprintf(" Matched with Hub[%d]: '%s'", (uintptr_t)htab_devid.table[j].data, + uuprintf(" Matched with Hub[%llu]: '%s'", (uintptr_t)htab_devid.table[j].data, dev_if_path.String[(uintptr_t)htab_devid.table[j].data]); if (GetUSBProperties(dev_if_path.String[(uintptr_t)htab_devid.table[j].data], device_id, &props)) { method_str = ""; @@ -927,7 +927,7 @@ BOOL GetDevices(DWORD devnum) } if ((!enable_HDDs) && (!props.is_VHD) && (!props.is_CARD) && ((score = IsHDD(drive_index, (uint16_t)props.vid, (uint16_t)props.pid, buffer)) > 0)) { - uprintf("Device eliminated because it was detected as a Hard Drive (score %d > 0)", score); + uprintf("Device eliminated because it was detected as a Hard Drive or SSD (score %d > 0)", score); if (!list_non_usb_removable_drives) uprintf("If this device is not a Hard Drive or SSD, please e-mail the author of this application"); uprintf("NOTE: You can enable the listing of Hard Drives under 'advanced drive properties'"); diff --git a/src/drive.c b/src/drive.c index 8ddab21e..26b7018f 100644 --- a/src/drive.c +++ b/src/drive.c @@ -1894,7 +1894,7 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys (SelectedDrive.MediaType == FixedMedia) ? "FIXED" : "Removable", SizeToHumanReadable(SelectedDrive.DiskSize, FALSE, TRUE), SelectedDrive.SectorSize); suprintf("Cylinders: %" PRIi64 ", Tracks per cylinder: %d, Sectors per track: %d", - DiskGeometry->Geometry.Cylinders, DiskGeometry->Geometry.TracksPerCylinder, DiskGeometry->Geometry.SectorsPerTrack); + DiskGeometry->Geometry.Cylinders.QuadPart, DiskGeometry->Geometry.TracksPerCylinder, DiskGeometry->Geometry.SectorsPerTrack); assert(SelectedDrive.SectorSize != 0); r = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_LAYOUT_EX, NULL, 0, layout, sizeof(layout), &size, NULL ); @@ -1997,7 +1997,7 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys suprintf(" ID: %s\r\n Size: %s (%" PRIi64 " bytes)\r\n Start Sector: %" PRIi64 ", Attributes: 0x%016" PRIX64, GuidToString(&DriveLayout->PartitionEntry[i].Gpt.PartitionId, TRUE), SizeToHumanReadable(DriveLayout->PartitionEntry[i].PartitionLength.QuadPart, TRUE, FALSE), - DriveLayout->PartitionEntry[i].PartitionLength, + DriveLayout->PartitionEntry[i].PartitionLength.QuadPart, DriveLayout->PartitionEntry[i].StartingOffset.QuadPart / SelectedDrive.SectorSize, DriveLayout->PartitionEntry[i].Gpt.Attributes); SelectedDrive.FirstDataSector = min(SelectedDrive.FirstDataSector, @@ -2477,7 +2477,7 @@ BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL m // We need to write the UEFI:NTFS partition before we refresh the disk if (extra_partitions & XP_UEFI_NTFS) { LARGE_INTEGER li; - uprintf("Writing UEFI:NTFS data...", SelectedDrive.Partition[partition_index[PI_UEFI_NTFS]].Name); + uprintf("Writing UEFI:NTFS data..."); li.QuadPart = SelectedDrive.Partition[partition_index[PI_UEFI_NTFS]].Offset; if (!SetFilePointerEx(hDrive, li, NULL, FILE_BEGIN)) { uprintf(" Could not set position"); diff --git a/src/iso.c b/src/iso.c index 02419a5f..2e8cbc85 100644 --- a/src/iso.c +++ b/src/iso.c @@ -1552,7 +1552,7 @@ out: if (MoveFileA(path, dst_path)) uprintf("Moved: %s → %s", path, dst_path); else - uprintf("Could not move %s → %s", path, dst_path, WindowsErrorString()); + uprintf("Could not move %s → %s: %s", path, dst_path, WindowsErrorString()); } } if (fd_md5sum != NULL) { diff --git a/src/localization.c b/src/localization.c index e247ecb2..b338dccf 100644 --- a/src/localization.c +++ b/src/localization.c @@ -227,7 +227,7 @@ BOOL dispatch_loc_cmd(loc_cmd* lcmd) lcmd->ctrl_id = MSG_000 + atoi(&(lcmd->txt[0][4])); if (lcmd->ctrl_id == MSG_000) { // Conversion could not be performed - luprintf("failed to convert the numeric value in '%'\n", lcmd->txt[0]); + luprintf("failed to convert the numeric value in '%s'\n", lcmd->txt[0]); goto err; } add_message_command(lcmd); diff --git a/src/pki.c b/src/pki.c index 033f58cb..50900657 100644 --- a/src/pki.c +++ b/src/pki.c @@ -706,7 +706,7 @@ uint64_t GetSignatureTimeStamp(const char* path) uprintf("Note: '%s' has nested timestamp %s", (path==NULL)?mpath:path, TimestampToHumanReadable(nested_timestamp)); if ((timestamp != 0ULL) && (nested_timestamp != 0ULL)) { if (_abs64(nested_timestamp - timestamp) > 100) { - uprintf("PKI: Signature timestamp and nested timestamp differ by more than a minute. " + uprintf("PKI: Signature timestamp (%lld) and nested timestamp (%lld) differ by more than a minute. " "This could indicate something very nasty...", timestamp, nested_timestamp); timestamp = 0ULL; } diff --git a/src/rufus.rc b/src/rufus.rc index c62e18bf..2dc564a3 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.10.2271" +CAPTION "Rufus 4.10.2272" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2271,0 - PRODUCTVERSION 4,10,2271,0 + FILEVERSION 4,10,2272,0 + PRODUCTVERSION 4,10,2272,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2271" + VALUE "FileVersion", "4.10.2272" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2271" + VALUE "ProductVersion", "4.10.2272" END END BLOCK "VarFileInfo" diff --git a/src/stdfn.c b/src/stdfn.c index cc4f9abc..358c4d31 100644 --- a/src/stdfn.c +++ b/src/stdfn.c @@ -1116,7 +1116,7 @@ BOOL SetThreadAffinity(DWORD_PTR* thread_affinity, size_t num_threads) thread_affinity[i] |= affinity & (-1LL * affinity); affinity ^= affinity & (-1LL * affinity); } - uuprintf(" thr_%d:\t%s", i, printbitslz(thread_affinity[i])); + uuprintf(" thr_%lld:\t%s", i, printbitslz(thread_affinity[i])); thread_affinity[num_threads - 1] ^= thread_affinity[i]; } uuprintf(" thr_%d:\t%s", i, printbitslz(thread_affinity[i])); From 7b8ddbe3ecf9ba3f33b1f706bf6750fe2fb87161 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 3 Sep 2025 20:06:04 +0100 Subject: [PATCH 082/192] [ui] improve notification dialog handling * Use MessageBox()'s MB_ constants instead of redefining our own. * Fix the *BROKEN* 200% scaling that Microsoft uses for warnings, that includes a pixel that should have been set to transparent but that instead was set to white. * This'll allow us to switch to using our Dark Mode compatible notifications dialogs in a future commit, instead of relying on the non Dark Mode compatible MessageBox(). --- src/net.c | 4 +- src/rufus.c | 12 ++-- src/rufus.h | 11 +--- src/rufus.rc | 10 ++-- src/stdlg.c | 160 +++++++++++++++++++++++++++++++++++++-------------- src/wue.c | 2 +- 6 files changed, 134 insertions(+), 65 deletions(-) diff --git a/src/net.c b/src/net.c index 710b96f8..f59dcac9 100644 --- a/src/net.c +++ b/src/net.c @@ -931,10 +931,10 @@ static DWORD WINAPI DownloadISOThread(LPVOID param) SendMessage(hMainDialog, UM_PROGRESS_EXIT, 0, 0); if (SCODE_CODE(ErrorStatus) == ERROR_CANCELLED) { uprintf("Download cancelled by user"); - Notification(MSG_INFO, NULL, NULL, lmprintf(MSG_211), lmprintf(MSG_041)); + Notification(MB_ICONINFORMATION | MB_CLOSE, lmprintf(MSG_211), lmprintf(MSG_041)); PrintInfo(0, MSG_211); } else { - Notification(MSG_ERROR, NULL, NULL, lmprintf(MSG_194, GetShortName(url)), lmprintf(MSG_043, WindowsErrorString())); + Notification(MB_ICONERROR | MB_CLOSE, lmprintf(MSG_194, GetShortName(url)), lmprintf(MSG_043, WindowsErrorString())); PrintInfo(0, MSG_212); } } else { diff --git a/src/rufus.c b/src/rufus.c index 0a391474..02a8d683 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -2823,11 +2823,11 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA #if defined(ALPHA) // Add a VERY ANNOYING popup for Alpha releases, so that people don't start redistributing them MessageBoxA(NULL, "This is an Alpha version of " APPLICATION_NAME " - It is meant to be used for " - "testing ONLY and should NOT be distributed as a release.", "ALPHA VERSION", MSG_INFO); + "testing ONLY and should NOT be distributed as a release.", "ALPHA VERSION", MB_ICONINFORMATION); #elif defined(TEST) // Same thing for Test releases MessageBoxA(NULL, "This is a Test version of " APPLICATION_NAME " - It is meant to be used for " - "testing ONLY and should NOT be distributed as a release.", "TEST VERSION", MSG_INFO); + "testing ONLY and should NOT be distributed as a release.", "TEST VERSION", MB_ICONINFORMATION); #endif SetDarkModeForChild(hDlg); SubclassStatusBar(hStatus); @@ -3022,7 +3022,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA break; case UM_NO_UPDATE: - Notification(MSG_INFO, NULL, NULL, lmprintf(MSG_243), lmprintf(MSG_247)); + Notification(MB_ICONINFORMATION | MB_CLOSE, lmprintf(MSG_243), lmprintf(MSG_247)); // Need to manually set focus back to "Check Now" for tabbing to work SendMessage(hUpdatesDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hUpdatesDlg, IDC_CHECK_NOW), TRUE); break; @@ -3061,7 +3061,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA if (GetProcessSearch(SEARCH_PROCESS_TIMEOUT, 0x06, TRUE)) { char title[128]; ComboBox_GetTextU(hDeviceList, title, sizeof(title)); - if (!Notification(MSG_WARNING_QUESTION, NULL, NULL, title, lmprintf(MSG_132))) + if (Notification(MB_ICONWARNING | MB_YESNO, title, lmprintf(MSG_132)) != IDYES) goto aborted_start; } PrintStatus(0, MSG_142); @@ -3142,7 +3142,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA SendMessage(hProgress, PBM_SETSTATE, (WPARAM)PBST_PAUSED, 0); SetTaskbarProgressState(TASKBAR_PAUSED); PrintInfo(0, MSG_211); - Notification(MSG_INFO, NULL, NULL, lmprintf(MSG_211), lmprintf(MSG_041)); + Notification(MB_ICONINFORMATION | MB_CLOSE, lmprintf(MSG_211), lmprintf(MSG_041)); } else { SendMessage(hProgress, PBM_SETSTATE, (WPARAM)PBST_ERROR, 0); SetTaskbarProgressState(TASKBAR_ERROR); @@ -3190,7 +3190,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA CyclePort(index); } } - Notification(MSG_ERROR, NULL, NULL, lmprintf(MSG_042), lmprintf(MSG_043, StrError(ErrorStatus, FALSE))); + Notification(MB_ICONERROR | MB_CLOSE, lmprintf(MSG_042), lmprintf(MSG_043, StrError(ErrorStatus, FALSE))); } } ErrorStatus = 0; diff --git a/src/rufus.h b/src/rufus.h index 033349b7..aa2f7092 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -244,13 +244,7 @@ enum user_message_type { }; /* Custom notifications */ -enum notification_type { - MSG_INFO, - MSG_WARNING, - MSG_ERROR, - MSG_QUESTION, - MSG_WARNING_QUESTION -}; +#define MB_CLOSE 0x0F typedef INT_PTR (CALLBACK *Callback_t)(HWND, UINT, WPARAM, LPARAM); typedef struct { WORD id; @@ -805,7 +799,8 @@ extern INT_PTR CreateAboutBox(void); extern BOOL CreateTooltip(HWND hControl, const char* message, int duration); extern void DestroyTooltip(HWND hWnd); extern void DestroyAllTooltips(void); -extern BOOL Notification(int type, const char* dont_display_setting, const notification_info* more_info, char* title, char* format, ...); +extern INT_PTR NotificationEx(int type, const char* dont_display_setting, const notification_info* more_info, char* title, char* format, ...); +#define Notification(type, ...) NotificationEx(type, NULL, NULL, __VA_ARGS__) extern int CustomSelectionDialog(int style, char* title, char* message, char** choices, int size, int mask, int username_index); #define SelectionDialog(title, message, choices, size) CustomSelectionDialog(BS_AUTORADIOBUTTON, title, message, choices, size, 1, -1) extern void ListDialog(char* title, char* message, char** items, int size); diff --git a/src/rufus.rc b/src/rufus.rc index 2dc564a3..3bcafafe 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.10.2272" +CAPTION "Rufus 4.10.2273" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -407,8 +407,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2272,0 - PRODUCTVERSION 4,10,2272,0 + FILEVERSION 4,10,2273,0 + PRODUCTVERSION 4,10,2273,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +426,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2272" + VALUE "FileVersion", "4.10.2273" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2272" + VALUE "ProductVersion", "4.10.2273" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index d47d7062..b9d31d02 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -56,7 +56,7 @@ static char **szDialogItem; static int nDialogItems; static HWND hUpdatesDlg; static const SETTEXTEX friggin_microsoft_unicode_amateurs = { ST_DEFAULT, CP_UTF8 }; -static BOOL notification_is_question; +static int notification_type; static const notification_info* notification_more_info; static const char* notification_dont_display_setting; static WNDPROC update_original_proc = NULL; @@ -464,6 +464,59 @@ INT_PTR CreateAboutBox(void) return r; } +// The warning icon from the OS is *BROKEN* in dark mode at 200% scaling (one of the +// pixels that should be transparent is set to white), so we fix it. Thanks Microsoft! +HICON FixWarningIcon(HICON hIcon) +{ + void* bits = NULL; + ICONINFO info, new_info; + BITMAP bmp; + BITMAPINFO bmi = { 0 }; + HBITMAP dib, src_obj, dst_obj; + HDC hdc, src_dc, dst_dc; + DWORD* pixels; + + GetIconInfo(hIcon, &info); + GetObject(info.hbmColor, sizeof(bmp), &bmp); + bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmi.bmiHeader.biWidth = bmp.bmWidth; + bmi.bmiHeader.biHeight = -bmp.bmHeight; + bmi.bmiHeader.biPlanes = 1; + bmi.bmiHeader.biBitCount = 32; + bmi.bmiHeader.biCompression = BI_RGB; + + hdc = GetDC(NULL); + dib = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, &bits, NULL, 0); + ReleaseDC(NULL, hdc); + if (dib == NULL) + return hIcon; + src_dc = CreateCompatibleDC(NULL); + dst_dc = CreateCompatibleDC(NULL); + src_obj = SelectObject(src_dc, info.hbmColor); + dst_obj = SelectObject(dst_dc, dib); + + BitBlt(dst_dc, 0, 0, bmp.bmWidth, bmp.bmHeight, src_dc, 0, 0, SRCCOPY); + + SelectObject(src_dc, src_obj); + SelectObject(dst_dc, dst_obj); + DeleteDC(src_dc); + DeleteDC(dst_dc); + pixels = (DWORD*)bits; + // Set the problematic pixel, at (13,2), to transparent + pixels[2 * bmp.bmWidth + 13] = 0x00000000; + + new_info.fIcon = TRUE; + new_info.xHotspot = info.xHotspot; + new_info.yHotspot = info.yHotspot; + new_info.hbmMask = info.hbmMask; + new_info.hbmColor = dib; + + hIcon = CreateIconIndirect(&new_info); + DeleteObject(info.hbmColor); + DeleteObject(info.hbmMask); + return hIcon; +} + /* * We use our own MessageBox for notifications to have greater control (center, no close button, etc) */ @@ -512,21 +565,55 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP background_brush = GetSysColorBrush(COLOR_WINDOW); separator_brush = GetSysColorBrush(COLOR_3DLIGHT); buttonface_brush = GetSysColorBrush(COLOR_BTNFACE); - SetTitleBarIcon(hDlg); + SetTitleBarIcon(hDlg); // ??? This doesn't seem to work here CenterDialog(hDlg, NULL); // Change the default icon - if (Static_SetIcon(GetDlgItem(hDlg, IDC_NOTIFICATION_ICON), hMessageIcon) == 0) { - uprintf("Could not set dialog icon\n"); + switch (notification_type & 0xF0) { + case MB_ICONERROR: + hMessageIcon = LoadIcon(NULL, IDI_ERROR); + break; + case MB_ICONWARNING: + hMessageIcon = LoadIcon(NULL, IDI_WARNING); + // I really have no idea at what scaling factors Microsoft switches icons. + // However, the 200% icon has a jarring white pixel in dark mode, because + // Microsoft forgot to set that pixel to transparent, that we need to fix. + if (fScale > 1.75f && fScale < 2.5f) + hMessageIcon = FixWarningIcon(hMessageIcon); + break; + case MB_ICONQUESTION: + hMessageIcon = LoadIcon(NULL, IDI_QUESTION); + break; + default: + hMessageIcon = LoadIcon(NULL, IDI_INFORMATION); + break; } + if (Static_SetIcon(GetDlgItem(hDlg, IDC_NOTIFICATION_ICON), hMessageIcon) == 0) + uprintf("Could not set the notification dialog icon"); // Set the dialog title - if (szMessageTitle != NULL) { + if (szMessageTitle != NULL) SetWindowTextU(hDlg, szMessageTitle); - } // Enable/disable the buttons and set text - if (!notification_is_question) { - SetWindowTextU(GetDlgItem(hDlg, IDNO), lmprintf(MSG_006)); - } else { + switch (notification_type & 0x0F) { + case MB_OKCANCEL: + SetWindowTextU(GetDlgItem(hDlg, IDYES), "OK"); + SetWindowTextU(GetDlgItem(hDlg, IDNO), lmprintf(MSG_007)); ShowWindow(GetDlgItem(hDlg, IDYES), SW_SHOW); + break; + case MB_YESNO: + SetWindowTextU(GetDlgItem(hDlg, IDYES), lmprintf(MSG_008)); + SetWindowTextU(GetDlgItem(hDlg, IDNO), lmprintf(MSG_009)); + ShowWindow(GetDlgItem(hDlg, IDYES), SW_SHOW); + break; + case MB_OK: + SetWindowTextU(GetDlgItem(hDlg, IDYES), "OK"); + break; + case MB_ABORTRETRYIGNORE: + // TODO: Look at the standard Abort/Retry/Ignore MessageBox and replicate that + assert(FALSE); + break; + default: // One single 'Close' button + SetWindowTextU(GetDlgItem(hDlg, IDNO), lmprintf(MSG_006)); + break; } hCtrl = GetDlgItem(hDlg, IDC_DONT_DISPLAY_AGAIN); if (notification_dont_display_setting != NULL) { @@ -572,12 +659,10 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP case WM_CTLCOLORSTATIC: // Change the background colour for static text and icon SetBkMode((HDC)wParam, TRANSPARENT); - if ((HWND)lParam == GetDlgItem(hDlg, IDC_NOTIFICATION_LINE)) { + if ((HWND)lParam == GetDlgItem(hDlg, IDC_NOTIFICATION_LINE)) return (INT_PTR)separator_brush; - } - if ((HWND)lParam == GetDlgItem(hDlg, IDC_DONT_DISPLAY_AGAIN)) { + if ((HWND)lParam == GetDlgItem(hDlg, IDC_DONT_DISPLAY_AGAIN)) return (INT_PTR)buttonface_brush; - } return (INT_PTR)background_brush; case WM_NCHITTEST: // Check coordinates to prevent resize actions @@ -592,14 +677,23 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP safe_delete_object(hDlgFont); break; case WM_COMMAND: + // TODO: This is brittle... and I don't think we use it anyway + if (LOWORD(wParam) != IDC_MORE_INFO && IsDlgButtonChecked(hDlg, IDC_DONT_DISPLAY_AGAIN) == BST_CHECKED) + WriteSettingBool(SETTING_DISABLE_SECURE_BOOT_NOTICE, TRUE); switch (LOWORD(wParam)) { - case IDOK: - case IDCANCEL: case IDYES: + // Return IDOK for calls that expect it + if ((notification_type & 0x0F) == MB_OKCANCEL || (notification_type & 0x0F) == MB_OK) + wParam = IDOK; + EndDialog(hDlg, LOWORD(wParam)); + return (INT_PTR)TRUE; case IDNO: - if (IsDlgButtonChecked(hDlg, IDC_DONT_DISPLAY_AGAIN) == BST_CHECKED) { - WriteSettingBool(SETTING_DISABLE_SECURE_BOOT_NOTICE, TRUE); - } + // Return IDCANCEL for calls that expect it + if ((notification_type & 0x0F) == MB_OKCANCEL) + wParam = IDCANCEL; + EndDialog(hDlg, LOWORD(wParam)); + return (INT_PTR)TRUE; + case IDRETRY: // TODO: implement this or drop the one call that requests it EndDialog(hDlg, LOWORD(wParam)); return (INT_PTR)TRUE; case IDC_MORE_INFO: @@ -622,9 +716,9 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP /* * Display a custom notification */ -BOOL Notification(int type, const char* dont_display_setting, const notification_info* more_info, char* title, char* format, ...) +INT_PTR NotificationEx(int type, const char* dont_display_setting, const notification_info* more_info, char* title, char* format, ...) { - BOOL ret; + INT_PTR ret; va_list args; dialog_showing++; @@ -639,29 +733,9 @@ BOOL Notification(int type, const char* dont_display_setting, const notification va_end(args); szMessageText[LOC_MESSAGE_SIZE - 1] = 0; notification_more_info = more_info; - notification_is_question = FALSE; + notification_type = type; notification_dont_display_setting = dont_display_setting; - - switch(type) { - case MSG_WARNING_QUESTION: - notification_is_question = TRUE; - // Fall through - case MSG_WARNING: - hMessageIcon = LoadIcon(NULL, IDI_WARNING); - break; - case MSG_ERROR: - hMessageIcon = LoadIcon(NULL, IDI_ERROR); - break; - case MSG_QUESTION: - hMessageIcon = LoadIcon(NULL, IDI_QUESTION); - notification_is_question = TRUE; - break; - case MSG_INFO: - default: - hMessageIcon = LoadIcon(NULL, IDI_INFORMATION); - break; - } - ret = (MyDialogBox(hMainInstance, IDD_NOTIFICATION, hMainDialog, NotificationCallback) == IDYES); + ret = MyDialogBox(hMainInstance, IDD_NOTIFICATION, hMainDialog, NotificationCallback); safe_free(szMessageText); safe_free(szMessageTitle); dialog_showing--; @@ -1533,7 +1607,7 @@ BOOL SetUpdateCheck(void) #endif more_info.id = IDD_UPDATE_POLICY; more_info.callback = UpdateCallback; - enable_updates = Notification(MSG_QUESTION, NULL, &more_info, lmprintf(MSG_004), lmprintf(MSG_005)); + enable_updates = (NotificationEx(MB_ICONQUESTION | MB_YESNO, NULL, &more_info, lmprintf(MSG_004), lmprintf(MSG_005)) == IDYES); #if !defined(_DEBUG) } #endif diff --git a/src/wue.c b/src/wue.c index 08ca6eb5..4d0666ba 100644 --- a/src/wue.c +++ b/src/wue.c @@ -642,7 +642,7 @@ int SetWinToGoIndex(void) notification_info more_info; more_info.id = MORE_INFO_URL; more_info.url = WPPRECORDER_MORE_INFO_URL; - Notification(MSG_INFO, NULL, &more_info, lmprintf(MSG_128, "Windows To Go"), lmprintf(MSG_133)); + NotificationEx(MB_ICONINFORMATION | MB_CLOSE, NULL, &more_info, lmprintf(MSG_128, "Windows To Go"), lmprintf(MSG_133)); } } From 10fc6727daf7cabdd9d4e128b3996dba9432c5dd Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 5 Sep 2025 20:06:07 +0100 Subject: [PATCH 083/192] [ui] Use our own Dark Mode compatible Notification() instead of MessageBox() * Also fix return values for Notification() and add MB_ABORTRETRYIGNORE support. * Also fix one last Coverity warning with size_t and printf. --- src/format.c | 3 +- src/net.c | 6 +-- src/pki.c | 13 +++---- src/rufus.c | 102 ++++++++++++++++++++++++--------------------------- src/rufus.h | 4 +- src/rufus.rc | 11 +++--- src/stdfn.c | 4 +- src/stdio.c | 3 +- src/stdlg.c | 57 ++++++++++++++++++++++------ src/vhd.c | 3 +- src/wue.c | 3 +- 11 files changed, 114 insertions(+), 95 deletions(-) diff --git a/src/format.c b/src/format.c index 7cfa915f..447e22ab 100644 --- a/src/format.c +++ b/src/format.c @@ -1639,8 +1639,7 @@ DWORD WINAPI FormatThread(void* param) fprintf(log_fd, APPLICATION_NAME " bad blocks check ended on: %04d.%02d.%02d %02d:%02d:%02d", lt.wYear, lt.wMonth, lt.wDay, lt.wHour, lt.wMinute, lt.wSecond); fclose(log_fd); - r = MessageBoxExU(hMainDialog, lmprintf(MSG_012, bb_msg, logfile), - lmprintf(MSG_010), MB_ABORTRETRYIGNORE | MB_ICONWARNING | MB_IS_RTL, selected_langid); + r = Notification(MB_ABORTRETRYIGNORE | MB_ICONWARNING, lmprintf(MSG_010), lmprintf(MSG_012, bb_msg, logfile)); } else { // We didn't get any errors => delete the log file fclose(log_fd); diff --git a/src/net.c b/src/net.c index f59dcac9..a0fbc6ec 100644 --- a/src/net.c +++ b/src/net.c @@ -397,8 +397,7 @@ out: if ((bPromptOnError) && (DownloadStatus != 200)) { PrintInfo(0, MSG_242); SetLastError(error_code); - MessageBoxExU(hMainDialog, IS_ERROR(ErrorStatus) ? StrError(ErrorStatus, FALSE) : WindowsErrorString(), - lmprintf(MSG_044), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_044), IS_ERROR(ErrorStatus) ? StrError(ErrorStatus, FALSE) : WindowsErrorString()); } safe_closehandle(hFile); free(url_sig); @@ -500,8 +499,7 @@ static void CheckForDBXUpdates(int verbose) if (timestamp <= MAX(dbx_info[i].timestamp, (uint64_t)ReadSetting64(reg_name))) continue; if (!already_prompted) { - r = MessageBoxExU(hMainDialog, lmprintf(MSG_354), lmprintf(MSG_353), - MB_YESNO | MB_ICONWARNING | MB_IS_RTL, selected_langid); + r = Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_353), lmprintf(MSG_354)); already_prompted = TRUE; if (r != IDYES) break; diff --git a/src/pki.c b/src/pki.c index 50900657..a570aa34 100644 --- a/src/pki.c +++ b/src/pki.c @@ -742,7 +742,7 @@ LONG ValidateSignature(HWND hDlg, const char* path) if (signature_name == NULL) { uprintf("PKI: Could not get signature name"); if (hDlg != INVALID_HANDLE_VALUE) - MessageBoxExU(hDlg, lmprintf(MSG_284), lmprintf(MSG_283), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_283), lmprintf(MSG_284)); return TRUST_E_NOSIGNATURE; } for (i = 0; i < ARRAYSIZE(cert_name); i++) { @@ -751,9 +751,8 @@ LONG ValidateSignature(HWND hDlg, const char* path) } if (i >= ARRAYSIZE(cert_name)) { uprintf("PKI: Signature '%s' is unexpected...", signature_name); - if ((hDlg == INVALID_HANDLE_VALUE) || (MessageBoxExU(hDlg, - lmprintf(MSG_285, signature_name), lmprintf(MSG_283), - MB_YESNO | MB_ICONWARNING | MB_IS_RTL, selected_langid) != IDYES)) + if ((hDlg == INVALID_HANDLE_VALUE) || (Notification(MB_YESNO | MB_ICONWARNING, + lmprintf(MSG_283), lmprintf(MSG_285, signature_name)) != IDYES)) return TRUST_E_EXPLICIT_DISTRUST; } @@ -802,18 +801,18 @@ LONG ValidateSignature(HWND hDlg, const char* path) } } if ((r != ERROR_SUCCESS) && (force_update < 2)) - MessageBoxExU(hDlg, lmprintf(MSG_300), lmprintf(MSG_299), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_299), lmprintf(MSG_300)); break; case TRUST_E_NOSIGNATURE: // Should already have been reported, but since we have a custom message for it... uprintf("PKI: File does not appear to be signed: %s", WinPKIErrorString()); if (hDlg != INVALID_HANDLE_VALUE) - MessageBoxExU(hDlg, lmprintf(MSG_284), lmprintf(MSG_283), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_283), lmprintf(MSG_284)); break; default: uprintf("PKI: Failed to validate signature: %s", WinPKIErrorString()); if (hDlg != INVALID_HANDLE_VALUE) - MessageBoxExU(hDlg, lmprintf(MSG_240), lmprintf(MSG_283), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_283), lmprintf(MSG_240)); break; } diff --git a/src/rufus.c b/src/rufus.c index 02a8d683..12353465 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1072,8 +1072,7 @@ static void CALLBACK BlockingTimer(HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWORD // A write or close operation hasn't made any progress since our last check user_notified = TRUE; uprintf("Blocking I/O operation detected\n"); - MessageBoxExU(hMainDialog, lmprintf(MSG_080), lmprintf(MSG_048), - MB_OK|MB_ICONINFORMATION|MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONINFORMATION, lmprintf(MSG_048), lmprintf(MSG_080)); } else { last_iso_blocking_status = iso_blocking_status; } @@ -1101,8 +1100,8 @@ static void DisplayISOProps(void) if (img_report.mismatch_size > 0) { uprintf(" ERROR: Detected that file on disk has been truncated by %s!", SizeToHumanReadable(img_report.mismatch_size, FALSE, FALSE)); - MessageBoxExU(hMainDialog, lmprintf(MSG_298, SizeToHumanReadable(img_report.mismatch_size, FALSE, FALSE)), - lmprintf(MSG_297), MB_ICONWARNING | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONWARNING, lmprintf(MSG_297), + lmprintf(MSG_298, SizeToHumanReadable(img_report.mismatch_size, FALSE, FALSE))); } else if (img_report.mismatch_size < 0) { // Not an error (ISOHybrid?), but we report it just in case uprintf(" Note: File on disk is larger than reported ISO size by %s...", @@ -1341,9 +1340,9 @@ DWORD WINAPI ImageScanThread(LPVOID param) (!img_report.is_iso && (img_report.is_bootable_img <= 0) && !img_report.is_windows_img)) { // Failed to scan image if (img_report.is_bootable_img < 0) - MessageBoxExU(hMainDialog, lmprintf(MSG_322, image_path), lmprintf(MSG_042), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_042), lmprintf(MSG_322, image_path)); else - MessageBoxExU(hMainDialog, lmprintf(MSG_082), lmprintf(MSG_081), MB_OK | MB_ICONINFORMATION | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONINFORMATION, lmprintf(MSG_081), lmprintf(MSG_082)); // Make sure to relinquish image_path before we call UpdateImage // otherwise the boot selection dropdown won't be properly reset. safe_free(image_path); @@ -1432,8 +1431,7 @@ DWORD WINAPI ImageScanThread(LPVOID param) // If we have an ISOHybrid, but without an ISO method we support, disable ISO support altogether if (IS_DD_BOOTABLE(img_report) && (img_report.disable_iso || (!IS_BIOS_BOOTABLE(img_report) && !IS_EFI_BOOTABLE(img_report)))) { - MessageBoxExU(hMainDialog, lmprintf(MSG_321), lmprintf(MSG_274, "ISOHybrid"), - MB_OK | MB_ICONINFORMATION | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONINFORMATION, lmprintf(MSG_274, "ISOHybrid"), lmprintf(MSG_321)); uprintf("Note: DD image mode enforced since this ISOHybrid is not ISO mode compatible."); img_report.is_iso = FALSE; } @@ -1443,7 +1441,7 @@ DWORD WINAPI ImageScanThread(LPVOID param) // No boot method that we support PrintInfo(0, MSG_081); safe_free(image_path); - MessageBoxExU(hMainDialog, lmprintf(MSG_082), lmprintf(MSG_081), MB_OK | MB_ICONINFORMATION | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONINFORMATION, lmprintf(MSG_081), lmprintf(MSG_082)); PrintStatus(0, MSG_086); EnableControls(TRUE, FALSE); } else { @@ -1524,7 +1522,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) goto out; if ((size_check) && (img_report.projected_size > (uint64_t)SelectedDrive.DiskSize)) { // This ISO image is too big for the selected target - MessageBoxExU(hMainDialog, lmprintf(MSG_089), lmprintf(MSG_088), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_088), lmprintf(MSG_089)); goto out; } @@ -1538,8 +1536,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) msg = lmprintf(MSG_340); break; } - r = MessageBoxExU(hMainDialog, lmprintf(MSG_339, msg), lmprintf(MSG_338), - MB_OKCANCEL | MB_ICONWARNING | MB_IS_RTL, selected_langid); + r = Notification(MB_OKCANCEL | MB_ICONWARNING, lmprintf(MSG_338), lmprintf(MSG_339, msg)); if (r == IDCANCEL) goto out; } @@ -1581,21 +1578,21 @@ static DWORD WINAPI BootCheckThread(LPVOID param) if (is_windows_to_go) { if (fs_type != FS_NTFS) { // Windows To Go only works for NTFS - MessageBoxExU(hMainDialog, lmprintf(MSG_097, "Windows To Go"), lmprintf(MSG_092), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_092), lmprintf(MSG_097, "Windows To Go")); goto out; } if (SelectedDrive.MediaType != FixedMedia) { if ((target_type == TT_UEFI) && (partition_type == PARTITION_STYLE_GPT) && (WindowsVersion.BuildNumber < 15000)) { // Up to Windows 10 Creators Update (1703), we were screwed, since we need access to 2 partitions at the same time. // Thankfully, the newer Windows allow mounting multiple partitions on the same REMOVABLE drive. - MessageBoxExU(hMainDialog, lmprintf(MSG_198), lmprintf(MSG_190), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_190), lmprintf(MSG_198)); goto out; } } // If multiple versions are available, asks the user to select one before we commit to format the drive switch(SetWinToGoIndex()) { case -1: - MessageBoxExU(hMainDialog, lmprintf(MSG_073), lmprintf(MSG_291), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_291), lmprintf(MSG_073)); // fall through case -2: goto out; @@ -1641,7 +1638,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) } else if (target_type == TT_UEFI) { if (!IS_EFI_BOOTABLE(img_report)) { // Unsupported ISO - MessageBoxExU(hMainDialog, lmprintf(MSG_091), lmprintf(MSG_090), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_090), lmprintf(MSG_091)); goto out; } } else if ( ((fs_type == FS_NTFS) && !HAS_WINDOWS(img_report) && !HAS_GRUB(img_report) && @@ -1650,16 +1647,16 @@ static DWORD WINAPI BootCheckThread(LPVOID param) (!HAS_REACTOS(img_report)) && !HAS_KOLIBRIOS(img_report) && (!HAS_GRUB(img_report))) || ((IS_FAT(fs_type)) && (HAS_WINDOWS(img_report) || HAS_WININST(img_report)) && (!allow_dual_uefi_bios)) ) { // Incompatible FS and ISO - MessageBoxExU(hMainDialog, lmprintf(MSG_096), lmprintf(MSG_092), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_092), lmprintf(MSG_096)); goto out; } else if ((fs_type == FS_FAT16) && HAS_KOLIBRIOS(img_report)) { // KolibriOS doesn't support FAT16 - MessageBoxExU(hMainDialog, lmprintf(MSG_189), lmprintf(MSG_099), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_099), lmprintf(MSG_189)); goto out; } if (IS_FAT(fs_type) && !IS_FAT32_COMPAT(img_report)) { // This ISO image contains a file larger than 4GB file (FAT32) - MessageBoxExU(hMainDialog, lmprintf(MSG_100), lmprintf(MSG_099), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_099), lmprintf(MSG_100)); goto out; } if ((WindowsVersion.Version >= WINDOWS_8) && IS_WINDOWS_1X(img_report) && (!is_windows_to_go)) { @@ -1752,8 +1749,8 @@ static DWORD WINAPI BootCheckThread(LPVOID param) } fclose(fd); } else { - r = MessageBoxExU(hMainDialog, lmprintf(MSG_116, img_report.grub2_version, GRUB2_PACKAGE_VERSION), - lmprintf(MSG_115), MB_YESNOCANCEL | MB_ICONWARNING | MB_IS_RTL, selected_langid); + r = Notification(MB_YESNOCANCEL | MB_ICONWARNING, lmprintf(MSG_115), + lmprintf(MSG_116, img_report.grub2_version, GRUB2_PACKAGE_VERSION)); if (r == IDCANCEL) goto out; else if (r == IDYES) { @@ -1809,8 +1806,8 @@ static DWORD WINAPI BootCheckThread(LPVOID param) use_own_c32[i] = TRUE; } else { PrintInfo(0, MSG_204, old_c32_name[i]); - if (MessageBoxExU(hMainDialog, lmprintf(MSG_084, old_c32_name[i], old_c32_name[i]), - lmprintf(MSG_083, old_c32_name[i]), MB_YESNO | MB_ICONWARNING | MB_IS_RTL, selected_langid) == IDYES) { + if (Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_083, old_c32_name[i]), + lmprintf(MSG_084, old_c32_name[i], old_c32_name[i])) == IDYES) { static_sprintf(tmp, "%s-%s", syslinux, embedded_sl_version_str[0]); IGNORE_RETVAL(_mkdir(tmp)); static_sprintf(tmp, "%s/%s-%s/%s", FILES_URL, syslinux, embedded_sl_version_str[0], old_c32_name[i]); @@ -1848,9 +1845,9 @@ static DWORD WINAPI BootCheckThread(LPVOID param) ldlinux, ldlinux_ext[0], ldlinux, ldlinux_ext[1], app_data_dir, FILES_DIR, syslinux, img_report.sl_version_str, img_report.sl_version_ext); } else { - r = MessageBoxExU(hMainDialog, lmprintf(MSG_114, img_report.sl_version_str, img_report.sl_version_ext, - embedded_sl_version_str[1], embedded_sl_version_ext[1]), - lmprintf(MSG_115), MB_YESNO | MB_ICONWARNING | MB_IS_RTL, selected_langid); + r = Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_115), + lmprintf(MSG_114, img_report.sl_version_str, img_report.sl_version_ext, + embedded_sl_version_str[1], embedded_sl_version_ext[1])); if (r != IDYES) goto out; for (i = 0; i < 2; i++) { @@ -1908,8 +1905,8 @@ static DWORD WINAPI BootCheckThread(LPVOID param) static_sprintf(tmp, "%s.%s", ldlinux, ldlinux_ext[2]); PrintInfo(0, MSG_206, tmp); // MSG_104: "Syslinux v5.0 or later requires a '%s' file to be installed" - r = MessageBoxExU(hMainDialog, lmprintf(MSG_104, "Syslinux v5.0", tmp, "Syslinux v5+", tmp), - lmprintf(MSG_103, tmp), MB_YESNOCANCEL | MB_ICONWARNING | MB_IS_RTL, selected_langid); + r = Notification(MB_YESNOCANCEL | MB_ICONWARNING, lmprintf(MSG_103, tmp), + lmprintf(MSG_104, "Syslinux v5.0", tmp, "Syslinux v5+", tmp)); if (r == IDCANCEL) goto out; if (r == IDYES) { @@ -1925,15 +1922,14 @@ static DWORD WINAPI BootCheckThread(LPVOID param) } else if (boot_type == BT_MSDOS) { if ((size_check) && (ComboBox_GetCurItemData(hClusterSize) >= 65536)) { // MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size - MessageBoxExU(hMainDialog, lmprintf(MSG_110), lmprintf(MSG_111), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_111), lmprintf(MSG_110)); goto out; } static_sprintf(tmp, "%s\\%s\\diskcopy.dll", app_data_dir, FILES_DIR); if (_accessU(tmp, 0) != -1) { uprintf("Will reuse '%s' for MS-DOS installation", tmp); } else { - if (MessageBoxExU(hMainDialog, lmprintf(MSG_337, "diskcopy.dll"), lmprintf(MSG_115), - MB_YESNO | MB_ICONWARNING | MB_IS_RTL, selected_langid) != IDYES) + if (Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_115), lmprintf(MSG_337, "diskcopy.dll")) != IDYES) goto out; IGNORE_RETVAL(_chdirU(app_data_dir)); IGNORE_RETVAL(_mkdir(FILES_DIR)); @@ -1956,8 +1952,8 @@ static DWORD WINAPI BootCheckThread(LPVOID param) } else { static_sprintf(tmp, "grldr"); PrintInfo(0, MSG_206, tmp); - r = MessageBoxExU(hMainDialog, lmprintf(MSG_104, "Grub4DOS 0.4", tmp, "Grub4DOS", tmp), - lmprintf(MSG_103, tmp), MB_YESNOCANCEL | MB_ICONWARNING | MB_IS_RTL, selected_langid); + r = Notification(MB_YESNOCANCEL | MB_ICONWARNING, lmprintf(MSG_103, tmp), + lmprintf(MSG_104, "Grub4DOS 0.4", tmp, "Grub4DOS", tmp)); if (r == IDCANCEL) goto out; if (r == IDYES) { @@ -1976,7 +1972,7 @@ uefi_target: if (boot_type == BT_UEFI_NTFS) { fs_type = (int)ComboBox_GetCurItemData(hFileSystem); if (fs_type != FS_NTFS && fs_type != FS_EXFAT) { - MessageBoxExU(hMainDialog, lmprintf(MSG_097, "UEFI:NTFS"), lmprintf(MSG_092), MB_OK|MB_ICONERROR|MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_092), lmprintf(MSG_097, "UEFI:NTFS")); goto out; } } @@ -2288,8 +2284,8 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA case IDCANCEL: EnableWindow(GetDlgItem(hDlg, IDCANCEL), FALSE); if (format_thread != NULL) { - if ((no_confirmation_on_cancel) || (MessageBoxExU(hMainDialog, lmprintf(MSG_105), lmprintf(MSG_049), - MB_YESNO|MB_ICONWARNING|MB_IS_RTL, selected_langid) == IDYES)) { + if ((no_confirmation_on_cancel) || (Notification(MB_YESNO | MB_ICONWARNING, + lmprintf(MSG_049), lmprintf(MSG_105)) == IDYES)) { // Operation may have completed in the meantime if (format_thread != NULL) { ErrorStatus = RUFUS_ERROR(ERROR_CANCELLED); @@ -3035,8 +3031,8 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA save_image = FALSE; if ((partition_type == PARTITION_STYLE_MBR) && (SelectedDrive.DiskSize > 2 * TB)) { - if (MessageBoxExU(hMainDialog, lmprintf(MSG_134, SizeToHumanReadable(SelectedDrive.DiskSize - 2 * TB, FALSE, FALSE)), - lmprintf(MSG_128, "MBR"), MB_YESNO | MB_ICONWARNING | MB_IS_RTL, selected_langid) != IDYES) + if (Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_128, "MBR"), + lmprintf(MSG_134, SizeToHumanReadable(SelectedDrive.DiskSize - 2 * TB, FALSE, FALSE))) != IDYES) goto aborted_start; } @@ -3046,8 +3042,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA if (dur_secs > UDF_FORMAT_WARN) { dur_mins = dur_secs / 60; dur_secs -= dur_mins * 60; - MessageBoxExU(hMainDialog, lmprintf(MSG_112, dur_mins, dur_secs), lmprintf(MSG_113), - MB_OK | MB_ICONASTERISK | MB_IS_RTL, selected_langid); + Notification(MB_OK | MB_ICONINFORMATION, lmprintf(MSG_113), lmprintf(MSG_112, dur_mins, dur_secs)); } else { dur_secs = 0; dur_mins = 0; @@ -3067,15 +3062,12 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA PrintStatus(0, MSG_142); GetWindowTextU(hDeviceList, tmp, ARRAYSIZE(tmp)); - if (MessageBoxExU(hMainDialog, lmprintf(MSG_003, tmp), - APPLICATION_NAME, MB_OKCANCEL | MB_ICONWARNING | MB_IS_RTL, selected_langid) == IDCANCEL) + if (Notification(MB_OKCANCEL | MB_ICONWARNING, APPLICATION_NAME, lmprintf(MSG_003, tmp)) != IDOK) goto aborted_start; - if ((SelectedDrive.nPartitions > 1) && (MessageBoxExU(hMainDialog, lmprintf(MSG_093), - lmprintf(MSG_094), MB_OKCANCEL | MB_ICONWARNING | MB_IS_RTL, selected_langid) == IDCANCEL)) + if ((SelectedDrive.nPartitions > 1) && (Notification(MB_OKCANCEL | MB_ICONWARNING, lmprintf(MSG_094), lmprintf(MSG_093)) != IDOK)) goto aborted_start; if ((!zero_drive) && (boot_type != BT_NON_BOOTABLE) && (SelectedDrive.SectorSize != 512) && - (MessageBoxExU(hMainDialog, lmprintf(MSG_196, SelectedDrive.SectorSize), - lmprintf(MSG_197), MB_OKCANCEL | MB_ICONWARNING | MB_IS_RTL, selected_langid) == IDCANCEL)) + (Notification(MB_OKCANCEL | MB_ICONWARNING, lmprintf(MSG_197), lmprintf(MSG_196, SelectedDrive.SectorSize)) != IDOK)) goto aborted_start; nDeviceIndex = ComboBox_GetCurSel(hDeviceList); @@ -3667,7 +3659,7 @@ skip_args_processing: // If we don't have a working temp API, forget it uprintf("FATAL: Unable to create temp loc file: %s", WindowsErrorString()); MessageBoxA(NULL, "Unable to create temporary localization file. This application will now exit.", - "Fatal error", MB_ICONSTOP | MB_SYSTEMMODAL); + "Fatal error", MB_ICONERROR | MB_SYSTEMMODAL); goto out; } @@ -3677,7 +3669,7 @@ skip_args_processing: uprintf("FATAL: Unable to extract loc file '%s': %s", loc_file, WindowsErrorString()); safe_closehandle(hFile); MessageBoxA(NULL, "Unable to extract localization file. This application will now exit.", - "Fatal error", MB_ICONSTOP | MB_SYSTEMMODAL); + "Fatal error", MB_ICONERROR | MB_SYSTEMMODAL); goto out; } uprintf("localization: extracted data to '%s'", loc_file); @@ -3692,7 +3684,7 @@ skip_args_processing: || ((selected_locale = ((locale_name == NULL)?get_locale_from_lcid(lcid, TRUE):get_locale_from_name(locale_name, TRUE))) == NULL) ) { uprintf("FATAL: Could not access locale!"); MessageBoxA(NULL, "The locale data is missing or invalid. This application will now exit.", - "Fatal error", MB_ICONSTOP|MB_SYSTEMMODAL); + "Fatal error", MB_ICONERROR | MB_SYSTEMMODAL); goto out; } selected_langid = get_language_id(selected_locale); @@ -3710,11 +3702,10 @@ skip_args_processing: get_loc_data_file(loc_file, selected_locale); right_to_left_mode = ((selected_locale->ctrl_id) & LOC_RIGHT_TO_LEFT); // Set MB_SYSTEMMODAL to prevent Far Manager from stealing focus... - MessageBoxExU(NULL, - lmprintf(MSG_294, + MessageBoxExU(NULL, lmprintf(MSG_294, (WindowsVersion.Version == WINDOWS_7) ? 3 : 2, (WindowsVersion.Version == WINDOWS_7) ? 22 : 18), - lmprintf(MSG_293), MB_ICONSTOP | MB_IS_RTL | MB_SYSTEMMODAL, selected_langid); + lmprintf(MSG_293), MB_ICONERROR | MB_IS_RTL | MB_SYSTEMMODAL, selected_langid); goto out; } @@ -3725,7 +3716,7 @@ skip_args_processing: // Load the translation before we print the error get_loc_data_file(loc_file, selected_locale); right_to_left_mode = ((selected_locale->ctrl_id) & LOC_RIGHT_TO_LEFT); - MessageBoxExU(NULL, lmprintf(MSG_289), lmprintf(MSG_288), MB_ICONSTOP | MB_IS_RTL | MB_SYSTEMMODAL, selected_langid); + MessageBoxExU(NULL, lmprintf(MSG_289), lmprintf(MSG_288), MB_ICONERROR | MB_IS_RTL | MB_SYSTEMMODAL, selected_langid); goto out; } @@ -3744,7 +3735,8 @@ skip_args_processing: get_loc_data_file(loc_file, selected_locale); right_to_left_mode = ((selected_locale->ctrl_id) & LOC_RIGHT_TO_LEFT); // Set MB_SYSTEMMODAL to prevent Far Manager from stealing focus... - MessageBoxExU(NULL, lmprintf(MSG_002), lmprintf(MSG_001), MB_ICONSTOP|MB_IS_RTL|MB_SYSTEMMODAL, selected_langid); + MessageBoxExU(NULL, lmprintf(MSG_002), lmprintf(MSG_001), + MB_ICONERROR | MB_IS_RTL | MB_SYSTEMMODAL, selected_langid); goto out; } @@ -3811,7 +3803,7 @@ relaunch: hDlg = MyCreateDialog(hInstance, IDD_DIALOG, NULL, MainCallback); if (hDlg == NULL) { MessageBoxExU(NULL, "Could not create Window", "DialogBox failure", - MB_ICONSTOP|MB_IS_RTL|MB_SYSTEMMODAL, selected_langid); + MB_OK | MB_ICONERROR | MB_IS_RTL | MB_SYSTEMMODAL, selected_langid); goto out; } if ((relaunch_rc.left > -65536) && (relaunch_rc.top > -65536)) diff --git a/src/rufus.h b/src/rufus.h index aa2f7092..73c662ad 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -799,8 +799,8 @@ extern INT_PTR CreateAboutBox(void); extern BOOL CreateTooltip(HWND hControl, const char* message, int duration); extern void DestroyTooltip(HWND hWnd); extern void DestroyAllTooltips(void); -extern INT_PTR NotificationEx(int type, const char* dont_display_setting, const notification_info* more_info, char* title, char* format, ...); -#define Notification(type, ...) NotificationEx(type, NULL, NULL, __VA_ARGS__) +extern int NotificationEx(int type, const char* dont_display_setting, const notification_info* more_info, const char* title, const char* format, ...); +#define Notification(type, title, ...) NotificationEx(type, NULL, NULL, title, __VA_ARGS__) extern int CustomSelectionDialog(int style, char* title, char* message, char** choices, int size, int mask, int username_index); #define SelectionDialog(title, message, choices, size) CustomSelectionDialog(BS_AUTORADIOBUTTON, title, message, choices, size, 1, -1) extern void ListDialog(char* title, char* message, char** items, int size); diff --git a/src/rufus.rc b/src/rufus.rc index 3bcafafe..08ca0728 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.10.2273" +CAPTION "Rufus 4.10.2274" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -145,6 +145,7 @@ BEGIN PUSHBUTTON "Yes",IDYES,148,53,50,14,NOT WS_VISIBLE CONTROL "Do not show this message again",IDC_DONT_DISPLAY_AGAIN, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,39,248,10,WS_EX_TRANSPARENT + PUSHBUTTON "Abort",IDABORT,91,53,50,14,NOT WS_VISIBLE END IDD_SELECTION DIALOGEX 0, 0, 312, 71 @@ -407,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2273,0 - PRODUCTVERSION 4,10,2273,0 + FILEVERSION 4,10,2274,0 + PRODUCTVERSION 4,10,2274,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -426,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2273" + VALUE "FileVersion", "4.10.2274" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2273" + VALUE "ProductVersion", "4.10.2274" END END BLOCK "VarFileInfo" diff --git a/src/stdfn.c b/src/stdfn.c index 358c4d31..d5595cc4 100644 --- a/src/stdfn.c +++ b/src/stdfn.c @@ -1116,10 +1116,10 @@ BOOL SetThreadAffinity(DWORD_PTR* thread_affinity, size_t num_threads) thread_affinity[i] |= affinity & (-1LL * affinity); affinity ^= affinity & (-1LL * affinity); } - uuprintf(" thr_%lld:\t%s", i, printbitslz(thread_affinity[i])); + uuprintf(" thr_%z:\t%s", i, printbitslz(thread_affinity[i])); thread_affinity[num_threads - 1] ^= thread_affinity[i]; } - uuprintf(" thr_%d:\t%s", i, printbitslz(thread_affinity[i])); + uuprintf(" thr_%z:\t%s", i, printbitslz(thread_affinity[i])); return TRUE; } diff --git a/src/stdio.c b/src/stdio.c index 308c018e..c184d0a6 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -908,8 +908,7 @@ uint32_t ResolveDllAddress(dll_resolver_t* resolver) } // Download the PDB from Microsoft's symbol servers - if (MessageBoxExU(hMainDialog, lmprintf(MSG_345), lmprintf(MSG_115), - MB_YESNO | MB_ICONWARNING | MB_IS_RTL, selected_langid) != IDYES) + if (Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_115), lmprintf(MSG_345)) != IDYES) goto out; static_sprintf(path, "%s\\%s", temp_dir, info->PdbName); static_sprintf(url, "http://msdl.microsoft.com/download/symbols/%s/%s%x/%s", diff --git a/src/stdlg.c b/src/stdlg.c index b9d31d02..38b5fa7b 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -557,6 +557,7 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP SendMessage(GetDlgItem(hDlg, IDNO), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0)); if (bh != 0) { ResizeButtonHeight(hDlg, IDC_MORE_INFO); + ResizeButtonHeight(hDlg, IDABORT); ResizeButtonHeight(hDlg, IDYES); ResizeButtonHeight(hDlg, IDNO); } @@ -565,9 +566,8 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP background_brush = GetSysColorBrush(COLOR_WINDOW); separator_brush = GetSysColorBrush(COLOR_3DLIGHT); buttonface_brush = GetSysColorBrush(COLOR_BTNFACE); - SetTitleBarIcon(hDlg); // ??? This doesn't seem to work here CenterDialog(hDlg, NULL); - // Change the default icon + // Change the default message icon switch (notification_type & 0xF0) { case MB_ICONERROR: hMessageIcon = LoadIcon(NULL, IDI_ERROR); @@ -605,11 +605,28 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP ShowWindow(GetDlgItem(hDlg, IDYES), SW_SHOW); break; case MB_OK: - SetWindowTextU(GetDlgItem(hDlg, IDYES), "OK"); + SetWindowTextU(GetDlgItem(hDlg, IDNO), "OK"); break; case MB_ABORTRETRYIGNORE: - // TODO: Look at the standard Abort/Retry/Ignore MessageBox and replicate that - assert(FALSE); + HMODULE hMui; + char mui_path[MAX_PATH], button_str[3][64]; + // Load the localized button text from user32.dll.mui. 802 = Abort, 803 = Retry, 804 = Ignore + static_sprintf(mui_path, "%s\\%s\\user32.dll.mui", sysnative_dir, ToLocaleName(GetUserDefaultUILanguage())); + hMui = LoadLibraryU(mui_path); + if (hMui != NULL) { + if (LoadStringU(hMui, 802, button_str[0], sizeof(button_str[0])) > 0) + static_strcpy(button_str[0], "&Abort"); + if (LoadStringU(hMui, 803, button_str[1], sizeof(button_str[1])) <= 0) + static_strcpy(button_str[0], "&Retry"); + if (LoadStringU(hMui, 804, button_str[2], sizeof(button_str[2])) <= 0) + static_strcpy(button_str[0], "&Ignore"); + FreeLibrary(hMui); + } + SetWindowTextU(GetDlgItem(hDlg, IDABORT), button_str[0]); + SetWindowTextU(GetDlgItem(hDlg, IDYES), button_str[1]); + SetWindowTextU(GetDlgItem(hDlg, IDNO), button_str[2]); + ShowWindow(GetDlgItem(hDlg, IDABORT), SW_SHOW); + ShowWindow(GetDlgItem(hDlg, IDYES), SW_SHOW); break; default: // One single 'Close' button SetWindowTextU(GetDlgItem(hDlg, IDNO), lmprintf(MSG_006)); @@ -651,6 +668,7 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_SELECTION_LINE), 0, dh, 0, 0, 1.0f); ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_DONT_DISPLAY_AGAIN), 0, dh, 0, 0, 1.0f); ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_MORE_INFO), 0, dh - cbh, 0, 0, 1.0f); + ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDABORT), 0, dh - cbh, 0, 0, 1.0f); ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDYES), 0, dh -cbh, 0, 0, 1.0f); ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDNO), 0, dh -cbh, 0, 0, 1.0f); } @@ -682,18 +700,33 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP WriteSettingBool(SETTING_DISABLE_SECURE_BOOT_NOTICE, TRUE); switch (LOWORD(wParam)) { case IDYES: - // Return IDOK for calls that expect it - if ((notification_type & 0x0F) == MB_OKCANCEL || (notification_type & 0x0F) == MB_OK) + // Return IDOK/IDRETRY for calls that expect it + switch (notification_type & 0x0F) { + case MB_OKCANCEL: wParam = IDOK; + break; + case MB_ABORTRETRYIGNORE: + wParam = IDRETRY; + break; + } EndDialog(hDlg, LOWORD(wParam)); return (INT_PTR)TRUE; case IDNO: - // Return IDCANCEL for calls that expect it - if ((notification_type & 0x0F) == MB_OKCANCEL) + // Return IDCANCEL/IDOK/IDIGNORE for calls that expect it + switch (notification_type & 0x0F) { + case MB_OKCANCEL: wParam = IDCANCEL; + break; + case MB_OK: + wParam = IDOK; + break; + case MB_ABORTRETRYIGNORE: + wParam = IDIGNORE; + break; + } EndDialog(hDlg, LOWORD(wParam)); return (INT_PTR)TRUE; - case IDRETRY: // TODO: implement this or drop the one call that requests it + case IDABORT: EndDialog(hDlg, LOWORD(wParam)); return (INT_PTR)TRUE; case IDC_MORE_INFO: @@ -716,7 +749,7 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP /* * Display a custom notification */ -INT_PTR NotificationEx(int type, const char* dont_display_setting, const notification_info* more_info, char* title, char* format, ...) +int NotificationEx(int type, const char* dont_display_setting, const notification_info* more_info, const char* title, const char* format, ...) { INT_PTR ret; va_list args; @@ -739,7 +772,7 @@ INT_PTR NotificationEx(int type, const char* dont_display_setting, const notific safe_free(szMessageText); safe_free(szMessageTitle); dialog_showing--; - return ret; + return (int)ret; } // We only ever display one selection dialog, so set some params as globals diff --git a/src/vhd.c b/src/vhd.c index c7ff6ace..1ecbba0c 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -643,8 +643,7 @@ BOOL SaveImage(void) // ISO requires oscdimg.exe. If not already present, attempt to download it. static_sprintf(path, "%s\\%s\\oscdimg.exe", app_data_dir, FILES_DIR); if (!PathFileExistsU(path)) { - if (MessageBoxExU(hMainDialog, lmprintf(MSG_337, "oscdimg.exe"), lmprintf(MSG_115), - MB_YESNO | MB_ICONWARNING | MB_IS_RTL, selected_langid) != IDYES) + if (Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_115), lmprintf(MSG_337, "oscdimg.exe")) != IDYES) goto out; IGNORE_RETVAL(_chdirU(app_data_dir)); IGNORE_RETVAL(_mkdir(FILES_DIR)); diff --git a/src/wue.c b/src/wue.c index 4d0666ba..9f395455 100644 --- a/src/wue.c +++ b/src/wue.c @@ -633,8 +633,7 @@ int SetWinToGoIndex(void) version_name.String[i - 1], img_report.win_version.build, version_index.String[i - 1]); // Need Windows 10 Creator Update or later for boot on REMOVABLE to work if ((img_report.win_version.build < 15000) && (SelectedDrive.MediaType != FixedMedia)) { - if (MessageBoxExU(hMainDialog, lmprintf(MSG_098), lmprintf(MSG_190), - MB_YESNO | MB_ICONWARNING | MB_IS_RTL, selected_langid) != IDYES) + if (Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_190), lmprintf(MSG_098)) != IDYES) wintogo_index = -2; } // Display a notice about WppRecorder.sys for 1809 ISOs From 3ec2ac3aab323e0b9d2620b218a437eec76d4d5b Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 8 Sep 2025 13:45:10 +0100 Subject: [PATCH 084/192] [vhd] fix no error being reported back when there's an issue with saving to VHD * Closes #2799. * Also fix some more Coverity warnings. --- src/rufus.rc | 10 +++++----- src/stdfn.c | 4 ++-- src/stdlg.c | 11 ++++------- src/vhd.c | 5 +++-- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/rufus.rc b/src/rufus.rc index 08ca0728..c57139af 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.10.2274" +CAPTION "Rufus 4.10.2275" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2274,0 - PRODUCTVERSION 4,10,2274,0 + FILEVERSION 4,10,2275,0 + PRODUCTVERSION 4,10,2275,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2274" + VALUE "FileVersion", "4.10.2275" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2274" + VALUE "ProductVersion", "4.10.2275" END END BLOCK "VarFileInfo" diff --git a/src/stdfn.c b/src/stdfn.c index d5595cc4..f0ce8647 100644 --- a/src/stdfn.c +++ b/src/stdfn.c @@ -1116,10 +1116,10 @@ BOOL SetThreadAffinity(DWORD_PTR* thread_affinity, size_t num_threads) thread_affinity[i] |= affinity & (-1LL * affinity); affinity ^= affinity & (-1LL * affinity); } - uuprintf(" thr_%z:\t%s", i, printbitslz(thread_affinity[i])); + uuprintf(" thr_%llu:\t%s", i, printbitslz(thread_affinity[i])); thread_affinity[num_threads - 1] ^= thread_affinity[i]; } - uuprintf(" thr_%z:\t%s", i, printbitslz(thread_affinity[i])); + uuprintf(" thr_%llu:\t%s", i, printbitslz(thread_affinity[i])); return TRUE; } diff --git a/src/stdlg.c b/src/stdlg.c index 38b5fa7b..153c6a1f 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -609,17 +609,14 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP break; case MB_ABORTRETRYIGNORE: HMODULE hMui; - char mui_path[MAX_PATH], button_str[3][64]; + char mui_path[MAX_PATH], button_str[3][64] = { "&Abort", "&Retry", "&Ignore" }; // Load the localized button text from user32.dll.mui. 802 = Abort, 803 = Retry, 804 = Ignore static_sprintf(mui_path, "%s\\%s\\user32.dll.mui", sysnative_dir, ToLocaleName(GetUserDefaultUILanguage())); hMui = LoadLibraryU(mui_path); if (hMui != NULL) { - if (LoadStringU(hMui, 802, button_str[0], sizeof(button_str[0])) > 0) - static_strcpy(button_str[0], "&Abort"); - if (LoadStringU(hMui, 803, button_str[1], sizeof(button_str[1])) <= 0) - static_strcpy(button_str[0], "&Retry"); - if (LoadStringU(hMui, 804, button_str[2], sizeof(button_str[2])) <= 0) - static_strcpy(button_str[0], "&Ignore"); + LoadStringU(hMui, 802, button_str[0], sizeof(button_str[0])); + LoadStringU(hMui, 803, button_str[1], sizeof(button_str[1])); + LoadStringU(hMui, 804, button_str[2], sizeof(button_str[2])); FreeLibrary(hMui); } SetWindowTextU(GetDlgItem(hDlg, IDABORT), button_str[0]); diff --git a/src/vhd.c b/src/vhd.c index 1ecbba0c..0b782480 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -532,8 +532,7 @@ static DWORD WINAPI VhdSaveImageThread(void* param) } if (!GetOverlappedResult(handle, &overlapped, &bytes_read, FALSE)) { - if (GetLastError() == ERROR_DISK_FULL) - ErrorStatus = RUFUS_ERROR(ERROR_FILE_TOO_LARGE); + r = GetLastError(); uprintf("Could not save virtual disk: %s", WindowsErrorString()); goto out; } @@ -550,6 +549,8 @@ out: safe_free(img_save->DevicePath); safe_free(img_save->ImagePath); PostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)TRUE, 0); + if (r != 0 && !IS_ERROR(ErrorStatus)) + ErrorStatus = RUFUS_ERROR(SCODE_CODE(r)); ExitThread(r); } From 1740def70926eb0ff1892caa67274af9fb369f10 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 10 Sep 2025 11:55:29 +0100 Subject: [PATCH 085/192] [wue] finally add a working WUE option for creating Windows CA 2023 compatible installation media * Requires Windows 11 25H2 or later. --- res/loc/rufus.loc | 2 +- src/rufus.c | 8 ++-- src/rufus.h | 2 +- src/rufus.rc | 10 ++--- src/wue.c | 111 ++++++++++++++++++++++++++-------------------- 5 files changed, 74 insertions(+), 59 deletions(-) diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index d897482b..734d9cdb 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -609,7 +609,7 @@ t MSG_346 "Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)" t MSG_347 "Expert Mode" t MSG_348 "Extracting archive files: %s" t MSG_349 "Use Rufus MBR" -t MSG_350 "Use 'Windows UEFI CA 2023' signed bootloaders [EXPERIMENTAL]" +t MSG_350 "Use 'Windows CA 2023' signed bootloaders [requires KB5025885 or Mosby]" t MSG_351 "Checking for UEFI bootloader revocation..." t MSG_352 "Checking for UEFI DBX updates..." t MSG_353 "DBX update available" diff --git a/src/rufus.c b/src/rufus.c index 12353465..f0d2cff8 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1685,11 +1685,11 @@ static DWORD WINAPI BootCheckThread(LPVOID param) MAP_BIT(UNATTEND_NO_DATA_COLLECTION); StrArrayAdd(&options, lmprintf(MSG_335), TRUE); MAP_BIT(UNATTEND_DISABLE_BITLOCKER); + if (img_report.win_version.build >= 26200) { + StrArrayAdd(&options, lmprintf(MSG_350), TRUE); + MAP_BIT(UNATTEND_USE_MS2023_BOOTLOADERS); + } if (expert_mode) { - if (!appstore_version && img_report.win_version.build >= 26100) { - StrArrayAdd(&options, lmprintf(MSG_350), TRUE); - MAP_BIT(UNATTEND_USE_MS2023_BOOTLOADERS); - } StrArrayAdd(&options, lmprintf(MSG_346), TRUE); MAP_BIT(UNATTEND_FORCE_S_MODE); } diff --git a/src/rufus.h b/src/rufus.h index 73c662ad..a5122221 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -682,7 +682,7 @@ typedef struct { #define UNATTEND_FORCE_S_MODE 0x00100 #define UNATTEND_USE_MS2023_BOOTLOADERS 0x00200 #define UNATTEND_FULL_MASK 0x003FF -#define UNATTEND_DEFAULT_MASK 0x000FF +#define UNATTEND_DEFAULT_MASK 0x002FF // Mask of values that are persisted #define UNATTEND_WINDOWS_TO_GO 0x10000 // Special flag for Windows To Go #define UNATTEND_WINPE_SETUP_MASK (UNATTEND_SECUREBOOT_TPM_MINRAM) diff --git a/src/rufus.rc b/src/rufus.rc index c57139af..8f6f77de 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.10.2275" +CAPTION "Rufus 4.10.2276" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2275,0 - PRODUCTVERSION 4,10,2275,0 + FILEVERSION 4,10,2276,0 + PRODUCTVERSION 4,10,2276,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2275" + VALUE "FileVersion", "4.10.2276" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2275" + VALUE "ProductVersion", "4.10.2276" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index 9f395455..4d29fe31 100644 --- a/src/wue.c +++ b/src/wue.c @@ -192,6 +192,8 @@ char* CreateUnattendXml(int arch, int flags) fprintf(fd, " </LocalAccounts>\n"); fprintf(fd, " </UserAccounts>\n"); // Since we set a blank password, we'll ask the user to change it at next logon. + // NB: In case you wanna try, please be aware that Microsoft doesn't let you have multiple + // <FirstLogonCommands> sections in unattend.xml. Don't ask me how I know... :( fprintf(fd, " <FirstLogonCommands>\n"); fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n"); fprintf(fd, " <Order>%d</Order>\n", order++); @@ -206,17 +208,6 @@ char* CreateUnattendXml(int arch, int flags) fprintf(fd, " </FirstLogonCommands>\n"); } } - if (flags & UNATTEND_USE_MS2023_BOOTLOADERS) { - uprintf("• Use 'Windows UEFI CA 2023' signed bootloaders"); - // TODO: Validate that we can have multiple <FirstLogonCommands> sections - fprintf(fd, " <FirstLogonCommands>\n"); - fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n"); - fprintf(fd, " <Order>%d</Order>\n", order++); - // TODO: Validate the actual value on a machine where updates have been applied - fprintf(fd, " <CommandLine>reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Secureboot /v AvailableUpdates /t REG_DWORD /d 0x3c0 /f\n"); - fprintf(fd, " </SynchronousCommand>\n"); - fprintf(fd, " </FirstLogonCommands>\n"); - } } fprintf(fd, " </component>\n"); } @@ -784,23 +775,28 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) // NB: Work with a copy of unattend_xml_flags as a paremeter since we will modify it. { BOOL r = FALSE, is_hive_mounted = FALSE, update_boot_wim = FALSE; - int i, wim_index = 2, wuc_index = 0; + int i, wim_index = 2, wuc_index = 0, num_replaced = 0; const char* offline_hive_name = "RUFUS_OFFLINE_HIVE"; + const char* reg_path = "Windows\\System32\\config\\SYSTEM"; + const char* efi_ex_path = "Windows\\Boot\\EFI_EX"; + const char* fonts_ex_path = "Windows\\Boot\\Fonts_EX"; char boot_wim_path[] = "?:\\sources\\boot.wim", key_path[64]; - char tmp_dir[2][MAX_PATH] = { "", "" }; + char tmp_path[2][MAX_PATH] = { "", "" }; char appraiserres_dll_src[] = "?:\\sources\\appraiserres.dll"; char appraiserres_dll_dst[] = "?:\\sources\\appraiserres.bak"; char setup_exe[] = "?:\\setup.exe"; char setup_dll[] = "?:\\setup.dll"; char md5sum_path[] = "?:\\md5sum.txt"; - char path[MAX_PATH]; + char path[MAX_PATH], *rep, *tmp_dir_end; uint8_t* buf = NULL; uint16_t setup_arch; + size_t len; HKEY hKey = NULL, hSubKey = NULL; LSTATUS status; DWORD dwDisp, dwVal = 1, dwSize; FILE* fd_md5sum; WIMStruct* wim; + StrArray files; struct wimlib_update_command wuc[2] = { 0 }; assert(unattend_xml_path != NULL); @@ -904,18 +900,16 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) } if (flags & UNATTEND_SECUREBOOT_TPM_MINRAM) { - char tmp_path[MAX_PATH]; - const char* reg_path = "Windows\\System32\\config\\SYSTEM"; - if (GetTempDirNameU(temp_dir, APPLICATION_NAME, 0, tmp_dir[0]) == 0) { + if (GetTempDirNameU(temp_dir, APPLICATION_NAME, 0, tmp_path[0]) == 0) { uprintf("WARNING: Could not create temp dir for registry changes"); goto copy_unattend; } - static_sprintf(tmp_path, "%s\\SYSTEM", tmp_dir[0]); + static_sprintf(tmp_path[1], "%s\\SYSTEM", tmp_path[0]); // Try to create the registry keys directly, and fallback to using unattend // if that fails (which the Windows Store version is expected to do). - if (wimlib_extract_pathsU(wim, wim_index, tmp_dir[0], &reg_path, 1, + if (wimlib_extract_pathsU(wim, wim_index, tmp_path[0], &reg_path, 1, WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE) != 0 || - !MountRegistryHive(HKEY_LOCAL_MACHINE, offline_hive_name, tmp_path)) { + !MountRegistryHive(HKEY_LOCAL_MACHINE, offline_hive_name, tmp_path[1])) { uprintf("Falling back to creating the registry keys through unattend.xml"); goto copy_unattend; } @@ -949,7 +943,8 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) uprintf("Created 'HKLM\\SYSTEM\\Setup\\LabConfig\\%s' registry key", bypass_name[i]); } wuc[wuc_index].op = WIMLIB_UPDATE_OP_ADD; - wuc[wuc_index].add.fs_source_path = utf8_to_wchar(tmp_path); + wuc[wuc_index].add.fs_source_path = utf8_to_wchar(tmp_path[1]); + tmp_path[1][0] = '\0'; wuc[wuc_index].add.wim_target_path = L"Windows\\System32\\config\\SYSTEM"; wuc_index++; @@ -1005,50 +1000,70 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) } if (flags & UNATTEND_USE_MS2023_BOOTLOADERS) { - StrArray files; - char tmp_dir2[MAX_PATH], *rep; - const char* efi_ex_path = "Windows\\Boot\\EFI_EX"; if_assert_fails(update_boot_wim) goto out; - if (GetTempDirNameU(temp_dir, APPLICATION_NAME, 0, tmp_dir[1]) == 0) { + if (GetTempDirNameU(temp_dir, APPLICATION_NAME, 0, tmp_path[1]) == 0) { uprintf("WARNING: Could not create temp dir for 2023 signed UEFI bootloaders"); goto out; } - if (wimlib_extract_pathsU(wim, wim_index, tmp_dir[1], &efi_ex_path, 1, - WIMLIB_EXTRACT_FLAG_NO_ACLS | WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE) != 0) { - uprintf("Could not find 2023 signed UEFI bootloaders - Ignoring option"); + // If we have a '_EX' in the tmp name, we will have an issue + if_assert_fails(strstr(tmp_path[1], "_EX") == NULL) + goto out; + // Extract the EFI_EX and Fonts_EX files + if (wimlib_extract_pathsU(wim, wim_index, tmp_path[1], &efi_ex_path, 1, + WIMLIB_EXTRACT_FLAG_NO_ACLS | WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE) != 0 || + wimlib_extract_pathsU(wim, wim_index, tmp_path[1], &fonts_ex_path, 1, + WIMLIB_EXTRACT_FLAG_NO_ACLS | WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE) != 0) { + uprintf("Could not extract 2023 signed UEFI bootloaders - Ignoring option"); } else { - static_strcat(tmp_dir[1], "\\EFI"); - static_sprintf(tmp_dir2, "%s_EX", tmp_dir[1]); - MoveFileU(tmp_dir2, tmp_dir[1]); + len = strlen(tmp_path[1]); + tmp_dir_end = &tmp_path[1][len]; + + // Copy/override the Font files + static_strcat(tmp_path[1], "\\Fonts_EX"); StrArrayCreate(&files, 64); - ListDirectoryContent(&files, tmp_dir[1], LIST_DIR_TYPE_FILE | LIST_DIR_TYPE_RECURSIVE); + ListDirectoryContent(&files, tmp_path[1], LIST_DIR_TYPE_FILE); for (i = 0; i < (int)files.Index; i++) { - rep = remove_substr(files.String[i], "_EX"); - assert(rep != NULL); - if (!MoveFileU(files.String[i], rep)) - uprintf("WARNING: Could not rename '%s': %s", files.String[i], WindowsErrorString()); + static_sprintf(path, "%c:\\efi\\microsoft\\boot%s", drive_letter, &files.String[i][len]); + rep = remove_substr(path, "_EX"); + if (!CopyFileU(files.String[i], rep, FALSE)) + uprintf("WARNING: Could not copy '%s': %s", path, WindowsErrorString()); + else + num_replaced++; safe_free(rep); } StrArrayDestroy(&files); + // Replace /EFI/Boot/boot###.efi for (i = 1; i < ARRAYSIZE(efi_archname); i++) { - static_sprintf(tmp_dir2, "%c:\\efi\\boot\\boot%s.efi", drive_letter, efi_archname[i]); - if (!PathFileExistsA(tmp_dir2)) + *tmp_dir_end = '\0'; + static_strcat(tmp_path[1], "\\EFI_EX\\bootmgfw_EX.efi"); + static_sprintf(path, "%c:\\efi\\boot\\boot%s.efi", drive_letter, efi_archname[i]); + if (!PathFileExistsA(path)) continue; - static_sprintf(path, "%s\\bootmgfw.efi", tmp_dir[1]); - if (!CopyFileU(path, tmp_dir2, FALSE)) + if (!CopyFileU(tmp_path[1], path, FALSE)) uprintf("WARNING: Could not replace 'boot%s.efi': %s", efi_archname[i], WindowsErrorString()); + else + num_replaced++; break; } + // Replace /bootmgr.efi - static_sprintf(path, "%s\\bootmgr.efi", tmp_dir[1]); - if (!CopyFileU(path, tmp_dir2, FALSE)) + *tmp_dir_end = '\0'; + static_strcat(tmp_path[1], "\\EFI_EX\\bootmgr_EX.efi"); + static_sprintf(path, "%c:\\bootmgr.efi", drive_letter); + if (!CopyFileU(tmp_path[1], path, FALSE)) uprintf("WARNING: Could not replace 'bootmgr.efi': %s", WindowsErrorString()); - if (wimlib_add_treeU(wim, wim_index, tmp_dir[1], "Windows\\Boot\\EFI", 0)) - uprintf("WARNING: Could not replace EFI bootloader files with 'Windows UEFI CA 2023' versions"); else - uprintf("Replaced EFI bootloader files with 'Windows UEFI CA 2023' signed versions"); + num_replaced++; + if (num_replaced != 0) { + uprintf("Replaced %d EFI bootloader files with 'Windows UEFI CA 2023' compatible versions.", num_replaced); + uprintf("Note that to boot this media, you must have a system where the 'Windows UEFI CA 2023'"); + uprintf("Secure Boot certificate has been installed."); + uprintf("If needed, this can be accomplished using Mosby [https://github.com/pbatard/Mosby],"); + uprintf("which can be found, ready to use, in the UEFI Shell ISO images downloaded by Rufus."); + } + *tmp_dir_end = '\0'; // Else we won't be able to delete the temp dir } } @@ -1070,9 +1085,9 @@ out: uprintf("Error: Failed to update %s", boot_wim_path); r = FALSE; } - for (i = 0; i < ARRAYSIZE(tmp_dir); i++) - if (tmp_dir[i][0]) - SHDeleteDirectoryExU(NULL, tmp_dir[i], FOF_NO_UI); + for (i = 0; i < ARRAYSIZE(tmp_path); i++) + if (tmp_path[i][0]) + SHDeleteDirectoryExU(NULL, tmp_path[i], FOF_NO_UI); for (i = 0; i < wuc_index; i++) free(wuc[i].add.fs_source_path); wimlib_free(wim); From 3619bad53803e7f5915e0960a6e2300494f65f9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?VenusGirl=E2=9D=A4?= <venusgirl@outlook.com> Date: Tue, 26 Aug 2025 13:59:19 +0900 Subject: [PATCH 086/192] [loc] update Korean translation * Closes #2792. --- res/loc/po/ko-KR.po | 40 ++++++++++++++++++++-------------------- res/loc/rufus.loc | 28 ++++++++++++++-------------- src/rufus.rc | 10 +++++----- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/res/loc/po/ko-KR.po b/res/loc/po/ko-KR.po index c066dbca..98338f30 100644 --- a/res/loc/po/ko-KR.po +++ b/res/loc/po/ko-KR.po @@ -2,10 +2,10 @@ msgid "" msgstr "" "Project-Id-Version: 4.5\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-04-29 04:19+0900\n" -"PO-Revision-Date: 2024-04-29 05:50+0900\n" -"Last-Translator: \n" -"Language-Team: \n" +"POT-Creation-Date: 2025-08-26 05:39+0900\n" +"PO-Revision-Date: 2025-08-26 13:56+0900\n" +"Last-Translator: VenusGirl <venusgirl@outlook.com>\n" +"Language-Team: 비너스걸 <https://venusgirls.tistory.com/>\n" "Language: ko_KR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Korean (한국어)\n" "X-Rufus-LCID: 0x0412\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.7\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -133,7 +133,7 @@ msgstr "예" #. • IDD_NOTIFICATION → IDNO #. • MSG_009 msgid "No" -msgstr "아니오" +msgstr "아니요" #. • IDD_LOG → IDD_LOG msgid "Log" @@ -574,7 +574,7 @@ msgstr "" "\n" "Rufus는 이 문제를 해결하기 위해 최신 버전을 다운로드할 수 있습니다:\n" "- 인터넷에 연결하고 파일을 다운로드하려면 '예'를 선택합니다\n" -"- 기존 ISO 파일을 수정하지 않은 상태로 두려면 '아니오'를 선택합니다\n" +"- 기존 ISO 파일을 수정하지 않은 상태로 두려면 '아니요'를 선택합니다\n" "무엇을 해야 할지 모르면 '예'를 선택해야 합니다.\n" "\n" "참고: 새 파일이 현재 디렉터리에 다운로드되고 '%s'가 있으면 자동으로 재사용됩니다." @@ -701,7 +701,7 @@ msgstr "" "\n" "Rufus가 누락된 파일을 다운로드할 수 있습니다:\n" "- 인터넷에 연결하고 파일을 다운로드하려면 '예'를 선택합니다\n" -"- 나중에 드라이브에 이 파일을 수동으로 복사하려면 '아니오'를 선택합니다\n" +"- 나중에 드라이브에 이 파일을 수동으로 복사하려면 '아니요'를 선택합니다\n" "\n" "참고: 파일이 현재 디렉터리에 다운로드되고 '%s'가 있으면 자동으로 재사용됩니다." @@ -711,7 +711,7 @@ msgid "" "If you are sure you want to cancel, click YES. Otherwise, click NO." msgstr "" "취소하면 장치를 사용할 수 없는 상태가 될 수 있습니다.\n" -"취소하려면 예를 클릭합니다. 그렇지 않으면 아니오를 클릭합니다." +"취소하려면 예를 클릭합니다. 그렇지 않으면 아니요를 클릭합니다." #. • MSG_106 msgid "Please select folder" @@ -748,7 +748,7 @@ msgstr "호환되지 않는 클러스터 크기" #. #. "%d:%02d" is a duration (mins:secs) msgid "Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!" -msgstr "대용량 UDF 볼륨을 포맷하는 데 많은 시간이 걸릴 수 있습니다. USB 2.0 속도에서 예상 포맷 지속 시간은 %d:%02d이며, 이 기간 동안 진행률 표시줄이 고정된 것처럼 보입니다. 기다려주십시오!" +msgstr "대용량 UDF 볼륨을 포맷하는 데 많은 시간이 걸릴 수 있습니다. USB 2.0 속도에서 예상 포맷 지속 시간은 %d:%02d이며, 이 기간 동안 진행률 표시줄이 고정된 것처럼 보입니다. 기다려주세요!" #. • MSG_113 msgid "Large UDF volume" @@ -768,7 +768,7 @@ msgstr "" "\n" "새 버전의 Syslinux는 서로 호환되지 않으므로 Rufus가 모두 포함할 수 없으므로 인터넷에서 두 개의 추가 파일 ('ldlinux.sys' 및 'ldlinux.bss')을 다운로드해야 합니다:\n" "- 인터넷에 연결하고 이러한 파일을 다운로드하려면 '예'를 선택합니다\n" -"- 작업을 취소하려면 '아니오'를 선택합니다\n" +"- 작업을 취소하려면 '아니요'를 선택합니다\n" "\n" "참고: 파일은 현재 응용 프로그램 디렉터리에 다운로드되며 있는 경우 자동으로 재사용됩니다." @@ -794,7 +794,7 @@ msgstr "" "\n" "다른 버전의 Grub은 서로 호환되지 않을 수 있으며, 모두 포함할 수 없기 때문에 Rufus는 이미지에서 일치하는 Grub 설치 파일 ('core.img')의 버전을 찾으려고 시도합니다:\n" "- 인터넷에 연결하고 다운로드하려면 '예'를 선택합니다\n" -"- Rufus의 기본 버전을 사용하려면 '아니오'를 선택합니다\n" +"- Rufus의 기본 버전을 사용하려면 '아니요'를 선택합니다\n" "- 작업을 중단하려면 '취소'를 선택합니다\n" "\n" "참고: 파일은 현재 응용 프로그램 디렉터리에 다운로드되며 있는 경우 자동으로 재사용됩니다. 일치하는 항목을 온라인으로 찾을 수 없는 경우 기본 버전이 사용됩니다." @@ -940,7 +940,7 @@ msgstr "뒤로" #. • MSG_142 msgid "Please wait..." -msgstr "기다려주십시오..." +msgstr "기다려주세요..." #. • MSG_143 msgid "Download using a browser" @@ -1199,7 +1199,7 @@ msgstr "이 플랫폼에서는 이 기능을 사용할 수 없습니다." #. • MSG_201 msgid "Cancelling - Please wait..." -msgstr "취소 중 - 잠시 기다려 주십시오..." +msgstr "취소 중 - 잠시 기다려 주세요..." #. • MSG_202 msgid "Scanning image..." @@ -1354,7 +1354,7 @@ msgstr "Win7 EFI 부팅 설정 (%s)..." #. • MSG_233 msgid "Finalizing, please wait..." -msgstr "마무리 중, 기다려 주십시오..." +msgstr "마무리 중, 기다려 주세요..." #. • MSG_234 #. @@ -1845,15 +1845,15 @@ msgstr "영구 로그" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"MS-DOS를 설치하려면 Microsoft에서 추가 파일 ('diskcopy.dll')을 다운로드해야 합니다:\n" +"이 기능을 사용하려면 Microsoft에서 추가 파일('%s')을 다운로드해야 합니다:\n" "- 인터넷에 연결하여 다운로드하려면 '예'를 선택합니다\n" -"- 작업을 취소하려면 '아니오'를 선택합니다\n" +"- 작업을 취소하려면 '아니요'를 선택합니다\n" "\n" "참고: 해당 파일은 응용 프로그램의 디렉터리에 다운로드되며 존재하는 경우 자동으로 재사용됩니다." @@ -1901,7 +1901,7 @@ msgid "" msgstr "" "이 기능을 사용하려면 Microsoft에서 몇 가지 추가 데이터를 다운로드해야 합니다:\n" "- 인터넷에 연결하여 다운로드하려면 '예'를 선택합니다\n" -"- 작업을 취소하려면 '아니오'를 선택합니다" +"- 작업을 취소하려면 '아니요'를 선택합니다" #. • MSG_346 msgid "Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)" @@ -1946,7 +1946,7 @@ msgid "" "See https://www.gnu.org/licenses/gpl-3.0.en.html for details." msgstr "" "이 응용 프로그램은 GNU Public License (GPL) 버전 3의 조건에 따라 라이선스가 부여됩니다.\n" -"자세한 내용은 https://www.gnu.org/licenses/gpl-3.0.html 을 참조하십시오." +"자세한 내용은 https://www.gnu.org/licenses/gpl-3.0.html 을 참조하세요." #. • MSG_905 #. diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 734d9cdb..798680e0 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -7805,7 +7805,7 @@ t IDC_DOWNLOAD "다운로드" g IDD_NOTIFICATION t IDC_MORE_INFO "추가 정보" t IDYES "예" -t IDNO "아니오" +t IDNO "아니요" g IDD_UPDATE_POLICY t IDCANCEL "닫기" @@ -7823,7 +7823,7 @@ t MSG_005 "Rufus가 온라인으로 응용 프로그램 업데이트를 확인 t MSG_006 "닫기" t MSG_007 "취소" t MSG_008 "예" -t MSG_009 "아니오" +t MSG_009 "아니요" t MSG_010 "불량 블록을 찾았습니다" t MSG_011 "검사 완료: %d개의 불량 블록을 찾았습니다\n %d개 읽기 오류\n %d개 쓰기 오류\n %d개 손상 오류" t MSG_012 "%s\n더 자세한 보고서는 다음에서 확인할 수 있습니다:\n%s" @@ -7893,7 +7893,7 @@ t MSG_080 "Rufus는 Windows가 여전히 내부 버퍼를 USB 장치로 플러 t MSG_081 "지원되지 않는 이미지" t MSG_082 "이 이미지는 부팅할 수 없거나 Rufus에서 지원하지 않는 부팅 또는 압축 방식을 사용합니다..." t MSG_083 "%s를 교체하시겠습니까?" -t MSG_084 "이 ISO 이미지는 '%s'의 오래된 버전을 사용하는 것 같습니다.\n이로 인해 부팅 메뉴가 제대로 표시되지 않을 수 있습니다.\n\nRufus는 이 문제를 해결하기 위해 최신 버전을 다운로드할 수 있습니다:\n- 인터넷에 연결하고 파일을 다운로드하려면 '예'를 선택합니다\n- 기존 ISO 파일을 수정하지 않은 상태로 두려면 '아니오'를 선택합니다\n무엇을 해야 할지 모르면 '예'를 선택해야 합니다.\n\n참고: 새 파일이 현재 디렉터리에 다운로드되고 '%s'가 있으면 자동으로 재사용됩니다." +t MSG_084 "이 ISO 이미지는 '%s'의 오래된 버전을 사용하는 것 같습니다.\n이로 인해 부팅 메뉴가 제대로 표시되지 않을 수 있습니다.\n\nRufus는 이 문제를 해결하기 위해 최신 버전을 다운로드할 수 있습니다:\n- 인터넷에 연결하고 파일을 다운로드하려면 '예'를 선택합니다\n- 기존 ISO 파일을 수정하지 않은 상태로 두려면 '아니요'를 선택합니다\n무엇을 해야 할지 모르면 '예'를 선택해야 합니다.\n\n참고: 새 파일이 현재 디렉터리에 다운로드되고 '%s'가 있으면 자동으로 재사용됩니다." t MSG_085 "%s 다운로드 중" t MSG_086 "선택된 ISO 이미지가 없습니다" t MSG_087 "%s 장치" @@ -7913,19 +7913,19 @@ t MSG_100 "이 ISO 이미지에는 FAT 또는 FAT32 파일 시스템에 허용 t MSG_101 "WIM 지원 누락" t MSG_102 "플랫폼이 WIM 압축파일에서 파일을 추출할 수 없습니다. EFI 부팅 가능한 Windows 7 및 Windows Vista USB 드라이브를 생성하려면 WIM 압축을 풀어야 합니다. 최신 버전의 7-Zip을 설치하여 이 문제를 해결할 수 있습니다.\n7-zip 다운로드 페이지를 방문하시겠습니까?" t MSG_103 "%s(을)를 다운로드하시겠습니까?" -t MSG_104 "%s 이상에서는 '%s' 파일을 설치해야 합니다.\n이 파일은 크기가 100KB 이상이고 항상 %s ISO 이미지에 존재하기 때문에 Rufus에 포함되어 있지 않습니다.\n\nRufus가 누락된 파일을 다운로드할 수 있습니다:\n- 인터넷에 연결하고 파일을 다운로드하려면 '예'를 선택합니다\n- 나중에 드라이브에 이 파일을 수동으로 복사하려면 '아니오'를 선택합니다\n\n참고: 파일이 현재 디렉터리에 다운로드되고 '%s'가 있으면 자동으로 재사용됩니다." -t MSG_105 "취소하면 장치를 사용할 수 없는 상태가 될 수 있습니다.\n취소하려면 예를 클릭합니다. 그렇지 않으면 아니오를 클릭합니다." +t MSG_104 "%s 이상에서는 '%s' 파일을 설치해야 합니다.\n이 파일은 크기가 100KB 이상이고 항상 %s ISO 이미지에 존재하기 때문에 Rufus에 포함되어 있지 않습니다.\n\nRufus가 누락된 파일을 다운로드할 수 있습니다:\n- 인터넷에 연결하고 파일을 다운로드하려면 '예'를 선택합니다\n- 나중에 드라이브에 이 파일을 수동으로 복사하려면 '아니요'를 선택합니다\n\n참고: 파일이 현재 디렉터리에 다운로드되고 '%s'가 있으면 자동으로 재사용됩니다." +t MSG_105 "취소하면 장치를 사용할 수 없는 상태가 될 수 있습니다.\n취소하려면 예를 클릭합니다. 그렇지 않으면 아니요를 클릭합니다." t MSG_106 "폴더를 선택하세요" t MSG_107 "모든 파일" t MSG_108 "Rufus 로그" t MSG_109 "0x%02X (디스크 %d)" t MSG_110 "MS-DOS는 64KB 클러스터 크기를 사용하는 드라이브에서 부팅할 수 없습니다.\n클러스터 크기를 변경하거나 FreeDOS를 사용하세요." t MSG_111 "호환되지 않는 클러스터 크기" -t MSG_112 "대용량 UDF 볼륨을 포맷하는 데 많은 시간이 걸릴 수 있습니다. USB 2.0 속도에서 예상 포맷 지속 시간은 %d:%02d이며, 이 기간 동안 진행률 표시줄이 고정된 것처럼 보입니다. 기다려주십시오!" +t MSG_112 "대용량 UDF 볼륨을 포맷하는 데 많은 시간이 걸릴 수 있습니다. USB 2.0 속도에서 예상 포맷 지속 시간은 %d:%02d이며, 이 기간 동안 진행률 표시줄이 고정된 것처럼 보입니다. 기다려주세요!" t MSG_113 "대용량 UDF 볼륨" -t MSG_114 "이 이미지에서는 Syslinux %s%s를 사용하지만 이 응용 프로그램에는 Syslinux %s%s에 대한 설치 파일만 포함됩니다.\n\n새 버전의 Syslinux는 서로 호환되지 않으므로 Rufus가 모두 포함할 수 없으므로 인터넷에서 두 개의 추가 파일 ('ldlinux.sys' 및 'ldlinux.bss')을 다운로드해야 합니다:\n- 인터넷에 연결하고 이러한 파일을 다운로드하려면 '예'를 선택합니다\n- 작업을 취소하려면 '아니오'를 선택합니다\n\n참고: 파일은 현재 응용 프로그램 디렉터리에 다운로드되며 있는 경우 자동으로 재사용됩니다." +t MSG_114 "이 이미지에서는 Syslinux %s%s를 사용하지만 이 응용 프로그램에는 Syslinux %s%s에 대한 설치 파일만 포함됩니다.\n\n새 버전의 Syslinux는 서로 호환되지 않으므로 Rufus가 모두 포함할 수 없으므로 인터넷에서 두 개의 추가 파일 ('ldlinux.sys' 및 'ldlinux.bss')을 다운로드해야 합니다:\n- 인터넷에 연결하고 이러한 파일을 다운로드하려면 '예'를 선택합니다\n- 작업을 취소하려면 '아니요'를 선택합니다\n\n참고: 파일은 현재 응용 프로그램 디렉터리에 다운로드되며 있는 경우 자동으로 재사용됩니다." t MSG_115 "다운로드가 필요합니다" -t MSG_116 "이 이미지는 Grub %s을(를) 사용하지만 응용 프로그램에는 Grub %s에 대한 설치 파일만 포함합니다.\n\n다른 버전의 Grub은 서로 호환되지 않을 수 있으며, 모두 포함할 수 없기 때문에 Rufus는 이미지에서 일치하는 Grub 설치 파일 ('core.img')의 버전을 찾으려고 시도합니다:\n- 인터넷에 연결하고 다운로드하려면 '예'를 선택합니다\n- Rufus의 기본 버전을 사용하려면 '아니오'를 선택합니다\n- 작업을 중단하려면 '취소'를 선택합니다\n\n참고: 파일은 현재 응용 프로그램 디렉터리에 다운로드되며 있는 경우 자동으로 재사용됩니다. 일치하는 항목을 온라인으로 찾을 수 없는 경우 기본 버전이 사용됩니다." +t MSG_116 "이 이미지는 Grub %s을(를) 사용하지만 응용 프로그램에는 Grub %s에 대한 설치 파일만 포함합니다.\n\n다른 버전의 Grub은 서로 호환되지 않을 수 있으며, 모두 포함할 수 없기 때문에 Rufus는 이미지에서 일치하는 Grub 설치 파일 ('core.img')의 버전을 찾으려고 시도합니다:\n- 인터넷에 연결하고 다운로드하려면 '예'를 선택합니다\n- Rufus의 기본 버전을 사용하려면 '아니요'를 선택합니다\n- 작업을 중단하려면 '취소'를 선택합니다\n\n참고: 파일은 현재 응용 프로그램 디렉터리에 다운로드되며 있는 경우 자동으로 재사용됩니다. 일치하는 항목을 온라인으로 찾을 수 없는 경우 기본 버전이 사용됩니다." t MSG_117 "표준 Windows 설치" t MSG_119 "고급 드라이브 속성" t MSG_120 "고급 포맷 옵션" @@ -7950,7 +7950,7 @@ t MSG_138 "언어" t MSG_139 "아키텍처" t MSG_140 "계속" t MSG_141 "뒤로" -t MSG_142 "기다려주십시오..." +t MSG_142 "기다려주세요..." t MSG_143 "브라우저를 사용하여 다운로드" t MSG_144 "Microsoft가 이를 방지하기 위해 웹사이트를 변경했기 때문에 Windows ISO를 다운로드할 수 없습니다." t MSG_145 "이 스크립트를 실행하려면 PowerShell 3.0 이상이 필요합니다." @@ -8006,7 +8006,7 @@ t MSG_196 "중요: 이 드라이브는 비표준 섹터 크기를 사용합니 t MSG_197 "비표준 섹터 크기가 감지됨" t MSG_198 "'Windows To Go'는 고정 속성이 설정된 GPT 파티션 드라이브에만 설치할 수 있습니다. 현재 드라이브가 고정 드라이브로 감지되지 않았습니다." t MSG_199 "이 플랫폼에서는 이 기능을 사용할 수 없습니다." -t MSG_201 "취소 중 - 잠시 기다려 주십시오..." +t MSG_201 "취소 중 - 잠시 기다려 주세요..." t MSG_202 "이미지 검색 중..." t MSG_203 "이미지를 검색하지 못했습니다" t MSG_204 "오래된 %s이(가) 감지되었습니다" @@ -8038,7 +8038,7 @@ t MSG_229 "파티션 부트 레코드 작성 중..." t MSG_230 "DOS 파일 복사 중..." t MSG_231 "ISO 파일 복사 중: %s" t MSG_232 "Win7 EFI 부팅 설정 (%s)..." -t MSG_233 "마무리 중, 기다려 주십시오..." +t MSG_233 "마무리 중, 기다려 주세요..." t MSG_234 "Syslinux %s 설치 중..." t MSG_235 "불량 블록: %s %d/%d - %0.2f%% (%d/%d/%d 오류)" t MSG_236 "불량 블록: 무작위 패턴으로 테스트" @@ -8140,7 +8140,7 @@ t MSG_333 "사용자 이름으로 로컬 계정 만들기:" t MSG_334 "이 사용자의 값과 동일한 값을 사용하여 국가별 옵션 설정" t MSG_335 "BitLocker 자동 장치 암호화 사용 안 함" t MSG_336 "영구 로그" -t MSG_337 "이 기능을 사용하려면 Microsoft에서 추가 파일('%s')을 다운로드해야 합니다:\n- 인터넷에 연결하여 다운로드하려면 '예'를 선택합니다\n- 작업을 취소하려면 '아니오'를 선택합니다\n\n참고: 해당 파일은 응용 프로그램의 디렉터리에 다운로드되며 존재하는 경우 자동으로 재사용됩니다." +t MSG_337 "이 기능을 사용하려면 Microsoft에서 추가 파일('%s')을 다운로드해야 합니다:\n- 인터넷에 연결하여 다운로드하려면 '예'를 선택합니다\n- 작업을 취소하려면 '아니요'를 선택합니다\n\n참고: 해당 파일은 응용 프로그램의 디렉터리에 다운로드되며 존재하는 경우 자동으로 재사용됩니다." t MSG_338 "취소된 UEFI 부트로더가 탐지됨" t MSG_339 "Rufus는 사용자가 선택한 ISO에 취소된 UEFI 부트로더가 포함되어 있으며, 이는 완전히 최신 UEFI 시스템에서 보안 부팅이 활성화된 경우에 %s을(를) 생성한다는 것을 감지했습니다.\n\n- 평판이 좋지 않은 소스에서 이 ISO 이미지를 가져온 경우 UEFI 멀웨어가 포함되어 있을 가능성을 고려하고 부팅을 피해야 합니다.\n- 신뢰할 수 있는 소스에서 가져온 경우에는 보다 최신 버전을 찾아야 합니다. 그러면 이 경고가 발생하지 않습니다.." t MSG_340 "\"보안 위반\" 화면" @@ -8148,7 +8148,7 @@ t MSG_341 "%s이(가) 있는 Windows 복구 화면 (BSOD)" t MSG_342 "압축된 VHDX 이미지" t MSG_343 "압축되지 않은 VHD 이미지" t MSG_344 "전체 플래시 업데이트 이미지" -t MSG_345 "이 기능을 사용하려면 Microsoft에서 몇 가지 추가 데이터를 다운로드해야 합니다:\n- 인터넷에 연결하여 다운로드하려면 '예'를 선택합니다\n- 작업을 취소하려면 '아니오'를 선택합니다" +t MSG_345 "이 기능을 사용하려면 Microsoft에서 몇 가지 추가 데이터를 다운로드해야 합니다:\n- 인터넷에 연결하여 다운로드하려면 '예'를 선택합니다\n- 작업을 취소하려면 '아니요'를 선택합니다" t MSG_346 "Windows를 S-Mode로 제한 (온라인 계정 우회와 호환되지 않음)" t MSG_347 "전문가 모드" t MSG_348 "압축 파일 추출 중: %s" @@ -8157,7 +8157,7 @@ t MSG_900 "Rufus는 USB 메모리 및 플래시 드라이브를 포맷하고 부 t MSG_901 "공식 사이트: %s" t MSG_902 "소스 코드: %s" t MSG_903 "변경 사항: %s" -t MSG_904 "이 응용 프로그램은 GNU Public License (GPL) 버전 3의 조건에 따라 라이선스가 부여됩니다.\n자세한 내용은 https://www.gnu.org/licenses/gpl-3.0.html 을 참조하십시오." +t MSG_904 "이 응용 프로그램은 GNU Public License (GPL) 버전 3의 조건에 따라 라이선스가 부여됩니다.\n자세한 내용은 https://www.gnu.org/licenses/gpl-3.0.html 을 참조하세요." t MSG_905 "부팅" t MSG_910 "USB, 플래시 카드 및 가상 드라이브를 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3로 포맷" t MSG_911 "FreeDOS 부팅 가능한 USB 드라이브 만들기" diff --git a/src/rufus.rc b/src/rufus.rc index 8f6f77de..2b3f7875 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.10.2276" +CAPTION "Rufus 4.10.2277" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2276,0 - PRODUCTVERSION 4,10,2276,0 + FILEVERSION 4,10,2277,0 + PRODUCTVERSION 4,10,2277,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2276" + VALUE "FileVersion", "4.10.2277" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2276" + VALUE "ProductVersion", "4.10.2277" END END BLOCK "VarFileInfo" From 329e9705e2b3d8220ad88e73aac5e7f5b9c7e4b3 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 10 Sep 2025 13:30:08 +0100 Subject: [PATCH 087/192] [wue] remove an unneeded condition * Also update ChangeLog.txt for BETA. --- ChangeLog.txt | 11 ++++++- src/rufus.rc | 10 +++--- src/wue.c | 84 +++++++++++++++++++++++++-------------------------- 3 files changed, 56 insertions(+), 49 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 6455b607..953b5096 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,4 +1,13 @@ -o Version 4.9 (2021.06.15) [BUGFIX RELEASE] +o Version 4.10 (2025.09.??) + Add Dark Mode support (courtesy of @ozone10) + Add support for creating Windows CA 2023 compatible media (requires a Windows 11 25H2 ISO) + Add support for saving an existing drive to ISO (UDF only) + Improve error reporting when saving to VHD/VHDX (with thanks to @Kazkans) + Fix DBX updates being reported in some timezones, even when there are none + Fix a situation where no file system can be selected in ISO mode + Fix a crash when trying to process Windows ISOs with very long paths + +o Version 4.9 (2025.06.15) [BUGFIX RELEASE] Fix downloads from https://rufus.ie no longer working due to recent GitHub server changes Fix unofficial Windows ISOs, with single index WIMs, not presenting the WUE dialog diff --git a/src/rufus.rc b/src/rufus.rc index 2b3f7875..2e2a3eea 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.10.2277" +CAPTION "Rufus 4.10.2278" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2277,0 - PRODUCTVERSION 4,10,2277,0 + FILEVERSION 4,10,2278,0 + PRODUCTVERSION 4,10,2278,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2277" + VALUE "FileVersion", "4.10.2278" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2277" + VALUE "ProductVersion", "4.10.2278" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index 4d29fe31..716d5f81 100644 --- a/src/wue.c +++ b/src/wue.c @@ -164,49 +164,47 @@ char* CreateUnattendXml(int arch, int flags) free(tzstr); } } - if (flags & UNATTEND_SET_USER || flags & UNATTEND_USE_MS2023_BOOTLOADERS) { - if (flags & UNATTEND_SET_USER) { - for (i = 0; (i < ARRAYSIZE(unallowed_account_names)) && (stricmp(unattend_username, unallowed_account_names[i]) != 0); i++); - if (i < ARRAYSIZE(unallowed_account_names)) { - uprintf("WARNING: '%s' is not allowed as local account name - Option ignored", unattend_username); - } else if (unattend_username[0] != 0) { - uprintf("• Use '%s' for local account name", unattend_username); - // If we create a local account in unattend.xml, then we can get Windows 11 - // 22H2 to skip MSA even if the network is connected during installation. - fprintf(fd, " <UserAccounts>\n"); - fprintf(fd, " <LocalAccounts>\n"); - fprintf(fd, " <LocalAccount wcm:action=\"add\">\n"); - fprintf(fd, " <Name>%s</Name>\n", unattend_username); - fprintf(fd, " <DisplayName>%s</DisplayName>\n", unattend_username); - fprintf(fd, " <Group>Administrators;Power Users</Group>\n"); - // Sets an empty password for the account (which, in Microsoft's convoluted ways, - // needs to be initialized to the Base64 encoded UTF-16 string "Password"). - // The use of an empty password has both the advantage of not having to ask users - // to type in a password in Rufus (which they might be weary of) as well as allowing - // automated logon during setup. - fprintf(fd, " <Password>\n"); - fprintf(fd, " <Value>UABhAHMAcwB3AG8AcgBkAA==</Value>\n"); - fprintf(fd, " <PlainText>false</PlainText>\n"); - fprintf(fd, " </Password>\n"); - fprintf(fd, " </LocalAccount>\n"); - fprintf(fd, " </LocalAccounts>\n"); - fprintf(fd, " </UserAccounts>\n"); - // Since we set a blank password, we'll ask the user to change it at next logon. - // NB: In case you wanna try, please be aware that Microsoft doesn't let you have multiple - // <FirstLogonCommands> sections in unattend.xml. Don't ask me how I know... :( - fprintf(fd, " <FirstLogonCommands>\n"); - fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n"); - fprintf(fd, " <Order>%d</Order>\n", order++); - fprintf(fd, " <CommandLine>net user &quot;%s&quot; /logonpasswordchg:yes</CommandLine>\n", unattend_username); - fprintf(fd, " </SynchronousCommand>\n"); - // Some people report that using the `net user` command above might reset the password expiration to 90 days... - // To alleviate that, blanket set passwords on the target machine to never expire. - fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n"); - fprintf(fd, " <Order>%d</Order>\n", order++); - fprintf(fd, " <CommandLine>net accounts /maxpwage:unlimited</CommandLine>\n"); - fprintf(fd, " </SynchronousCommand>\n"); - fprintf(fd, " </FirstLogonCommands>\n"); - } + if (flags & UNATTEND_SET_USER) { + for (i = 0; (i < ARRAYSIZE(unallowed_account_names)) && (stricmp(unattend_username, unallowed_account_names[i]) != 0); i++); + if (i < ARRAYSIZE(unallowed_account_names)) { + uprintf("WARNING: '%s' is not allowed as local account name - Option ignored", unattend_username); + } else if (unattend_username[0] != 0) { + uprintf("• Use '%s' for local account name", unattend_username); + // If we create a local account in unattend.xml, then we can get Windows 11 + // 22H2 to skip MSA even if the network is connected during installation. + fprintf(fd, " <UserAccounts>\n"); + fprintf(fd, " <LocalAccounts>\n"); + fprintf(fd, " <LocalAccount wcm:action=\"add\">\n"); + fprintf(fd, " <Name>%s</Name>\n", unattend_username); + fprintf(fd, " <DisplayName>%s</DisplayName>\n", unattend_username); + fprintf(fd, " <Group>Administrators;Power Users</Group>\n"); + // Sets an empty password for the account (which, in Microsoft's convoluted ways, + // needs to be initialized to the Base64 encoded UTF-16 string "Password"). + // The use of an empty password has both the advantage of not having to ask users + // to type in a password in Rufus (which they might be weary of) as well as allowing + // automated logon during setup. + fprintf(fd, " <Password>\n"); + fprintf(fd, " <Value>UABhAHMAcwB3AG8AcgBkAA==</Value>\n"); + fprintf(fd, " <PlainText>false</PlainText>\n"); + fprintf(fd, " </Password>\n"); + fprintf(fd, " </LocalAccount>\n"); + fprintf(fd, " </LocalAccounts>\n"); + fprintf(fd, " </UserAccounts>\n"); + // Since we set a blank password, we'll ask the user to change it at next logon. + // NB: In case you wanna try, please be aware that Microsoft doesn't let you have multiple + // <FirstLogonCommands> sections in unattend.xml. Don't ask me how I know... :( + fprintf(fd, " <FirstLogonCommands>\n"); + fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n"); + fprintf(fd, " <Order>%d</Order>\n", order++); + fprintf(fd, " <CommandLine>net user &quot;%s&quot; /logonpasswordchg:yes</CommandLine>\n", unattend_username); + fprintf(fd, " </SynchronousCommand>\n"); + // Some people report that using the `net user` command above might reset the password expiration to 90 days... + // To alleviate that, blanket set passwords on the target machine to never expire. + fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n"); + fprintf(fd, " <Order>%d</Order>\n", order++); + fprintf(fd, " <CommandLine>net accounts /maxpwage:unlimited</CommandLine>\n"); + fprintf(fd, " </SynchronousCommand>\n"); + fprintf(fd, " </FirstLogonCommands>\n"); } } fprintf(fd, " </component>\n"); From 1c201cc01f3b80a5761d13387b6038cf76cb0a2f Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 24 Sep 2025 12:20:48 +0100 Subject: [PATCH 088/192] Rufus 4.10 (Build 2279) * Improve persistence support for Linux Mint. * Closes #2807. * Also fix the Swedish translation. --- ChangeLog.txt | 5 +++-- res/appstore/listing/listing.csv | 14 ++++++++++---- res/loc/po/sv-SE.po | 16 ++++++++-------- res/loc/rufus.loc | 4 ++-- src/iso.c | 15 ++++++++++++--- src/rufus.rc | 10 +++++----- src/wue.c | 3 +-- 7 files changed, 41 insertions(+), 26 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 953b5096..b674062f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,9 +1,10 @@ -o Version 4.10 (2025.09.??) +o Version 4.10 (2025.09.24) Add Dark Mode support (courtesy of @ozone10) Add support for creating Windows CA 2023 compatible media (requires a Windows 11 25H2 ISO) Add support for saving an existing drive to ISO (UDF only) Improve error reporting when saving to VHD/VHDX (with thanks to @Kazkans) - Fix DBX updates being reported in some timezones, even when there are none + Improve persistence support for Linux Mint + Fix UEFI DBX updates being reported in some timezones, even when there are none Fix a situation where no file system can be selected in ISO mode Fix a crash when trying to process Windows ISOs with very long paths diff --git a/res/appstore/listing/listing.csv b/res/appstore/listing/listing.csv index 50605e97..d7bd6264 100644 --- a/res/appstore/listing/listing.csv +++ b/res/appstore/listing/listing.csv @@ -110,12 +110,18 @@ • Sürüm Notları https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus це утиліта, яка допомагає форматувати та створювати завантажувальні флешки, картки пам'яті, тощо. • Офіційний сайт: https://rufus.ie • Сирцевий код: https://github.com/pbatard/rufus -• Список змін: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus là một tiện ích giúp định dạng và tạo khả năng khởi động cho USB, chẳng hạn như thẻ USB/đĩa di động, thẻ nhớ, vv. +• Список змін: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus là một tiện ích giúp định dạng và tạo khả năng khởi động cho các thiết bị USB, ví dụ như thẻ USB/đĩa di động, thẻ nhớ, v.v... • 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","• Fix downloads from https://rufus.ie no longer working due to recent GitHub server changes -• Fix unofficial Windows ISOs, with single index WIMs, not presenting the WUE dialog",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"ReleaseNotes","3","Text","• Add Dark Mode support (courtesy of @ozone10) +• Add support for creating Windows CA 2023 compatible media (requires a Windows 11 25H2 ISO) +• Add support for saving an existing drive to ISO (UDF only) +• Improve error reporting when saving to VHD/VHDX (with thanks to @Kazkans) +• Improve persistence support for Linux Mint +• Fix UEFI DBX updates being reported in some timezones, even when there are none +• Fix a situation where no file system can be selected in ISO mode +• Fix a crash when trying to process Windows ISOs with very long paths",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "Title","4","Text","Rufus",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "ShortTitle","5","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "SortTitle","6","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, @@ -142,7 +148,7 @@ További információ: https://www.gnu.org/licenses/gpl-3.0.html.","Aplikasi ini Lihat https://www.gnu.org/licenses/gpl-3.0.html untuk detail lebih lanjut.","Questa applicazione è rilasciata sotto i termini della GNU Public License (GPL) versione 3. Vedere https://www.gnu.org/licenses/gpl-3.0.html per dettagli.","このアプリケーションはGNU Public License (GPL) version 3でライセンスされています。 詳細は https://www.gnu.org/licenses/gpl-3.0.ja.html をご覧ください。","이 응용 프로그램은 GNU Public License (GPL) 버전 3의 조건에 따라 라이선스가 부여됩니다. -자세한 내용은 https://www.gnu.org/licenses/gpl-3.0.html 을 참조하십시오.","Šai programmai ir licences noteikumi, kā GNU Public License (GPL) version 3. +자세한 내용은 https://www.gnu.org/licenses/gpl-3.0.html 을 참조하세요.","Šai programmai ir licences noteikumi, kā GNU Public License (GPL) version 3. Papildinformācijai skatīt https://www.gnu.org/licenses/gpl-3.0.html.","Ši programa yra licencijuota pagal GNU viešosios licencijos (GPL) 3 versijos sąlygas. Daugiau informacijos rasite https://www.gnu.org/licenses/gpl-3.0.html.","Permohonan ini dilesenkan di bawah syarat-syarat Lesen Awam GNU (GPL) versi 3. Lihat https://www.gnu.org/licenses/gpl-3.0.html untuk butiran.","Dette programmet er lisensiert under GNU Public Licence (GPL) versjon 3. diff --git a/res/loc/po/sv-SE.po b/res/loc/po/sv-SE.po index b21fd5c2..a7d1ef4c 100644 --- a/res/loc/po/sv-SE.po +++ b/res/loc/po/sv-SE.po @@ -2,10 +2,10 @@ msgid "" msgstr "" "Project-Id-Version: 4.5\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-04-26 00:51+0200\n" -"PO-Revision-Date: 2024-04-26 14:23+0100\n" +"POT-Creation-Date: 2025-09-23 20:25+0100\n" +"PO-Revision-Date: 2025-09-23 20:25+0100\n" "Last-Translator: \n" -"Language-Team: Sopor <sopor@users.noreply.github.com>\n" +"Language-Team: \n" "Language: sv_SE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Swedish (Svenska)\n" "X-Rufus-LCID: 0x041d, 0x081d\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.7\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -62,7 +62,7 @@ msgstr "Aktivera runtime UEFI-mediavalidering" #. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT msgid "Format Options" -msgstr "Formateringsinställningar" +msgstr "Formatalternativ" #. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT msgid "File system" @@ -1134,7 +1134,7 @@ msgstr "" #. • MSG_187 msgid "Invalid image for selected boot option" -msgstr "Ogiltig avbild för vald startinställning" +msgstr "Ogiltig avbild för valt startalternativ" #. • MSG_188 msgid "The current image doesn't match the boot option selected. Please use a different image or choose a different boot option." @@ -1846,13 +1846,13 @@ msgstr "Bestående logg" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"En fil (diskcopy.dll) måste laddas ner från Microsoft för att installera MS-DOS:\n" +"En fil (%s) måste laddas ner från Microsoft för att använda den här funktionen:\n" "- Välj \"Ja\" för att ansluta till Internet och ladda ner den\n" "- Välj \"Nej\" för att avbryta operationen\n" "\n" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 798680e0..0cf239e1 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -14047,7 +14047,7 @@ t IDS_TARGET_SYSTEM_TXT "Målsystem" t IDC_LIST_USB_HDD "Lista USB-hårddiskar" t IDC_OLD_BIOS_FIXES "Lägg till korrigeringar för äldre BIOS:ar (extra partition, etc)" t IDC_UEFI_MEDIA_VALIDATION "Aktivera runtime UEFI-mediavalidering" -t IDS_FORMAT_OPTIONS_TXT "Formateringsinställningar" +t IDS_FORMAT_OPTIONS_TXT "Formatalternativ" t IDS_FILE_SYSTEM_TXT "Filsystem" t IDS_CLUSTER_SIZE_TXT "Klusterstorlek" t IDS_LABEL_TXT "Volymetikett" @@ -14260,7 +14260,7 @@ t MSG_183 "Din IP-adress" t MSG_184 "För att kunna skapa användningsstatistik, kommer vi att spara informationen, \\b i högst ett år\\b0 . Vi kommer dock behålla informationen för oss själva." t MSG_185 "Uppdateringsprocess:" t MSG_186 "Rufus installerar inga bakgrundsprogram, därför sker endast uppdateringskontrollen när det körs.\\line\nFör att kontrollera efter uppdateringar krävs naturligtvis internettillgång." -t MSG_187 "Ogiltig avbild för vald startinställning" +t MSG_187 "Ogiltig avbild för valt startalternativ" t MSG_188 "Nuvarande avbild matchar inte det startbara valet. Välj en annan avbild eller ändra de startbara valet." t MSG_189 "Denna ISO-avbild är inte kompatibel med valt filsystem" t MSG_190 "Enheten är inte kompatibel" diff --git a/src/iso.c b/src/iso.c index 2e8cbc85..2349baaf 100644 --- a/src/iso.c +++ b/src/iso.c @@ -494,14 +494,23 @@ static void fix_config(const char* psz_fullpath, const char* psz_path, const cha if ((props->is_grub_cfg) && replace_in_token_data(src, "linux", "maybe-ubiquity", "", TRUE)) uprintf(" Removed 'maybe-ubiquity' kernel option"); + } else if (replace_in_token_data(src, props->is_grub_cfg ? "linux" : "append", + "boot=casper", "boot=casper persistent", TRUE) != NULL) { + // Linux Mint uses "boot=casper". Oh and we want this replacement to happen BEFORE + // the "linux /casper/vmlinuz" one, because Mint (Why is it ALWAYS them?) also use + // "linux /casper/vmlinuz" and "kernel /casper/vmlinuz" in their config, and even + // do so in a SUPER INCONSISTENT manner in their Syslinux' live.cfg, so we want to + // make sure we don't have to do extra work to fix their inconsistency. + uprintf(" Added 'persistent' kernel option"); + modified = TRUE; } else if (replace_in_token_data(src, "linux", "/casper/vmlinuz", "/casper/vmlinuz persistent", TRUE) != NULL) { // Ubuntu 23.04 and 24.04 use GRUB only with the above and don't use "maybe-ubiquity" uprintf(" Added 'persistent' kernel option"); modified = TRUE; - } else if (replace_in_token_data(src, props->is_grub_cfg ? "linux" : "append", - "boot=casper", "boot=casper persistent", TRUE) != NULL) { - // Linux Mint uses boot=casper. + } else if (replace_in_token_data(src, "kernel", "/casper/vmlinuz", + "/casper/vmlinuz persistent", TRUE) != NULL) { + // Some people might use "kernel" in their Syslinux config instead of "linux" uprintf(" Added 'persistent' kernel option"); modified = TRUE; } else if (replace_in_token_data(src, props->is_grub_cfg ? "linux" : "append", diff --git a/src/rufus.rc b/src/rufus.rc index 2e2a3eea..3dbddb07 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.10.2278" +CAPTION "Rufus 4.10.2279" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2278,0 - PRODUCTVERSION 4,10,2278,0 + FILEVERSION 4,10,2279,0 + PRODUCTVERSION 4,10,2279,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2278" + VALUE "FileVersion", "4.10.2279" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.10.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2278" + VALUE "ProductVersion", "4.10.2279" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index 716d5f81..0ede9db8 100644 --- a/src/wue.c +++ b/src/wue.c @@ -875,8 +875,7 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) UpdateProgressWithInfoForce(OP_PATCH, MSG_325, 0, PATCH_PROGRESS_TOTAL); // We only need to alter boot.wim if we have windowsPE data to deal with. // If not, we can just copy our unattend.xml in \sources\$OEM$\$$\Panther\. - // We also need to do so if we use the 'Windows UEFI CA 2023' signed bootloaders. - if (flags & UNATTEND_WINPE_SETUP_MASK || flags & UNATTEND_USE_MS2023_BOOTLOADERS) { + if (flags & UNATTEND_WINPE_SETUP_MASK) { if (validate_md5sum) md5sum_totalbytes -= _filesizeU(boot_wim_path); // Some "unofficial" ISOs have a modified boot.wim that doesn't have Windows Setup at index 2... From 6a1c2b4087b9901c6eb72072e46770e284b98340 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 26 Sep 2025 13:38:59 +0100 Subject: [PATCH 089/192] [wue] fix assert being triggered when using the CA 2023 option on its own... ...or with an option that doesn't require poking into boot.wim. * Closes #2815. * Also report the use of the CA 2023 option in the log. * Also set rufus-next to 4.11. --- configure | 20 ++++++++++---------- configure.ac | 2 +- src/rufus.rc | 12 ++++++------ src/wue.c | 5 ++++- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/configure b/configure index 1990a7d8..67578825 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for rufus 4.10. +# Generated by GNU Autoconf 2.71 for rufus 4.11. # # Report bugs to <https://github.com/pbatard/rufus/issues>. # @@ -611,8 +611,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rufus' PACKAGE_TARNAME='rufus' -PACKAGE_VERSION='4.10' -PACKAGE_STRING='rufus 4.10' +PACKAGE_VERSION='4.11' +PACKAGE_STRING='rufus 4.11' PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues' PACKAGE_URL='https://rufus.ie' @@ -1269,7 +1269,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rufus 4.10 to adapt to many kinds of systems. +\`configure' configures rufus 4.11 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1336,7 +1336,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rufus 4.10:";; + short | recursive ) echo "Configuration of rufus 4.11:";; esac cat <<\_ACEOF @@ -1428,7 +1428,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rufus configure 4.10 +rufus configure 4.11 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1504,7 +1504,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rufus $as_me 4.10, which was +It was created by rufus $as_me 4.11, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2767,7 +2767,7 @@ fi # Define the identity of the package. PACKAGE='rufus' - VERSION='4.10' + VERSION='4.11' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -5313,7 +5313,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rufus $as_me 4.10, which was +This file was extended by rufus $as_me 4.11, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5369,7 +5369,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -rufus config.status 4.10 +rufus config.status 4.11 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 284d8cb8..76c7e9e5 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([rufus], [4.10], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) +AC_INIT([rufus], [4.11], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies]) AC_CONFIG_SRCDIR([src/rufus.c]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/src/rufus.rc b/src/rufus.rc index 3dbddb07..cee48ca6 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.10.2279" +CAPTION "Rufus 4.11.2280" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,10,2279,0 - PRODUCTVERSION 4,10,2279,0 + FILEVERSION 4,11,2280,0 + PRODUCTVERSION 4,11,2280,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.10.2279" + VALUE "FileVersion", "4.11.2280" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" - VALUE "OriginalFilename", "rufus-4.10.exe" + VALUE "OriginalFilename", "rufus-4.11.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.10.2279" + VALUE "ProductVersion", "4.11.2280" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index 0ede9db8..500e6131 100644 --- a/src/wue.c +++ b/src/wue.c @@ -264,6 +264,9 @@ char* CreateUnattendXml(int arch, int flags) fprintf(fd, " </settings>\n"); } + if (flags & UNATTEND_USE_MS2023_BOOTLOADERS) + uprintf("• Use 'Windows CA 2023' signed bootloaders"); + fprintf(fd, "</unattend>\n"); fclose(fd); return path; @@ -875,7 +878,7 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) UpdateProgressWithInfoForce(OP_PATCH, MSG_325, 0, PATCH_PROGRESS_TOTAL); // We only need to alter boot.wim if we have windowsPE data to deal with. // If not, we can just copy our unattend.xml in \sources\$OEM$\$$\Panther\. - if (flags & UNATTEND_WINPE_SETUP_MASK) { + if (flags & UNATTEND_WINPE_SETUP_MASK || flags & UNATTEND_USE_MS2023_BOOTLOADERS) { if (validate_md5sum) md5sum_totalbytes -= _filesizeU(boot_wim_path); // Some "unofficial" ISOs have a modified boot.wim that doesn't have Windows Setup at index 2... From 0de4db13d890cb97d4002151d9a951b42e5b8ee0 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 26 Sep 2025 13:50:12 +0100 Subject: [PATCH 090/192] [ui] fix some GRUB/Syslinux downloads popups only showing a 'Close' button * Because of Dark Mode support, and the fact that Microsoft does not offer system dialogs that support Dark Mode (even the more "modern" Task Dialog is a joke in that respect, with people having to resort to using detours to fix this massive letdown from Microsoft. See https://github.com/SFTRS/DarkTaskDialog), we had to switch to use our own custom dialogs instead of using MessageBox(). * And of course, since we had to recreate the whole smorgasbord of what Microsoft offers in terms of button configuration, it's unsurprising that we forgot to add support for one conf (MB_YESNOCANCEL) that some of the download prompts use. * Closes #2813. --- src/rufus.rc | 10 +++++----- src/stdlg.c | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/rufus.rc b/src/rufus.rc index cee48ca6..96af3568 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.11.2280" +CAPTION "Rufus 4.11.2281" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,11,2280,0 - PRODUCTVERSION 4,11,2280,0 + FILEVERSION 4,11,2281,0 + PRODUCTVERSION 4,11,2281,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.11.2280" + VALUE "FileVersion", "4.11.2281" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.11.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.11.2280" + VALUE "ProductVersion", "4.11.2281" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index 153c6a1f..492396bc 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -604,6 +604,13 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP SetWindowTextU(GetDlgItem(hDlg, IDNO), lmprintf(MSG_009)); ShowWindow(GetDlgItem(hDlg, IDYES), SW_SHOW); break; + case MB_YESNOCANCEL: + SetWindowTextU(GetDlgItem(hDlg, IDABORT), lmprintf(MSG_008)); + SetWindowTextU(GetDlgItem(hDlg, IDYES), lmprintf(MSG_009)); + SetWindowTextU(GetDlgItem(hDlg, IDNO), lmprintf(MSG_007)); + ShowWindow(GetDlgItem(hDlg, IDYES), SW_SHOW); + ShowWindow(GetDlgItem(hDlg, IDABORT), SW_SHOW); + break; case MB_OK: SetWindowTextU(GetDlgItem(hDlg, IDNO), "OK"); break; @@ -705,6 +712,9 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP case MB_ABORTRETRYIGNORE: wParam = IDRETRY; break; + case MB_YESNOCANCEL: + wParam = IDNO; + break; } EndDialog(hDlg, LOWORD(wParam)); return (INT_PTR)TRUE; @@ -720,10 +730,15 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP case MB_ABORTRETRYIGNORE: wParam = IDIGNORE; break; + case MB_YESNOCANCEL: + wParam = IDCANCEL; + break; } EndDialog(hDlg, LOWORD(wParam)); return (INT_PTR)TRUE; case IDABORT: + if ((notification_type & 0x0F) == MB_YESNOCANCEL) + wParam = IDYES; EndDialog(hDlg, LOWORD(wParam)); return (INT_PTR)TRUE; case IDC_MORE_INFO: From bb11c037d7af41cc463eb173363149e4e8f3c82c Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 30 Sep 2025 18:42:25 +0100 Subject: [PATCH 091/192] [ui] add Ctrl-Alt-D cheat mode to toggle between Dark Mode and Light Mode * Closes #2814. --- src/darkmode.c | 7 ++++++- src/rufus.c | 11 ++++++++++- src/rufus.rc | 10 +++++----- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/darkmode.c b/src/darkmode.c index 05a840b9..29779ac4 100644 --- a/src/darkmode.c +++ b/src/darkmode.c @@ -40,7 +40,7 @@ PF_TYPE_DECL(WINAPI, PreferredAppMode, SetPreferredAppMode, (PreferredAppMode)); PF_TYPE_DECL(WINAPI, VOID, FlushMenuThemes, (VOID)); PF_TYPE_DECL(WINAPI, BOOL, SetWindowCompositionAttribute, (HWND, WINDOWCOMPOSITIONATTRIBDATA*)); -BOOL is_darkmode_enabled = FALSE; +BOOL is_darkmode_enabled = FALSE, toggle_dark_mode = FALSE; static COLORREF color_accent = TOOLBAR_ICON_COLOR; @@ -87,6 +87,11 @@ BOOL GetDarkModeFromRegistry(void) if (ReadSettingBool(SETTING_DISABLE_DARK_MODE)) return FALSE; + if (toggle_dark_mode) { + toggle_dark_mode = FALSE; + return !is_darkmode_enabled; + } + if (RegGetValueA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", "AppsUseLightTheme", RRF_RT_REG_DWORD, NULL, &data, &size) == ERROR_SUCCESS) // Dark mode is 0, light mode is 1 diff --git a/src/rufus.c b/src/rufus.c index f0d2cff8..b288c486 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -94,7 +94,7 @@ static char uppercase_select[2][64], uppercase_start[64], uppercase_close[64], u extern HANDLE update_check_thread; extern HIMAGELIST hUpImageList, hDownImageList; extern BOOL enable_iso, enable_joliet, enable_rockridge, enable_extra_hashes, is_bootloader_revoked; -extern BOOL validate_md5sum, cpu_has_sha1_accel, cpu_has_sha256_accel; +extern BOOL validate_md5sum, cpu_has_sha1_accel, cpu_has_sha256_accel, toggle_dark_mode; extern BYTE* fido_script; extern HWND hFidoDlg; extern uint8_t* grub2_buf; @@ -4140,6 +4140,15 @@ extern int TestHashes(void); } // Other hazardous cheat modes require Ctrl + Alt + // Ctrl-Alt-D => Toggle dark mode and restart + if ((msg.message == WM_KEYDOWN) && (msg.wParam == 'D') && + (GetKeyState(VK_CONTROL) & 0x8000) && (GetKeyState(VK_MENU) & 0x8000)) { + toggle_dark_mode = TRUE; + selected_fs = (int)ComboBox_GetCurItemData(hFileSystem); + relaunch = TRUE; + PostMessage(hDlg, WM_COMMAND, IDCANCEL, 0); + continue; + } // Ctrl-Alt-E => Expert Mode if ((msg.message == WM_KEYDOWN) && (msg.wParam == 'E') && (GetKeyState(VK_CONTROL) & 0x8000) && (GetKeyState(VK_MENU) & 0x8000)) { diff --git a/src/rufus.rc b/src/rufus.rc index 96af3568..2a14a55f 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.11.2281" +CAPTION "Rufus 4.11.2282" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,11,2281,0 - PRODUCTVERSION 4,11,2281,0 + FILEVERSION 4,11,2282,0 + PRODUCTVERSION 4,11,2282,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.11.2281" + VALUE "FileVersion", "4.11.2282" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.11.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.11.2281" + VALUE "ProductVersion", "4.11.2282" END END BLOCK "VarFileInfo" From 2a8c066b72ded41a530bed1d7df2330e105569f4 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 1 Oct 2025 11:42:25 +0100 Subject: [PATCH 092/192] [core] fix an application crash when the platform has a missing/failed dynamic disk * With massive thanks to @amoki455 for helping figure that one out! * Closes #2794. * Also make sure we release pDisk on all conditions. --- src/drive.c | 13 +++++++------ src/rufus.rc | 10 +++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/drive.c b/src/drive.c index 26b7018f..24dfc8e8 100644 --- a/src/drive.c +++ b/src/drive.c @@ -668,6 +668,7 @@ static BOOL GetVdsDiskInterface(DWORD DriveIndex, const IID* InterfaceIID, void* // List disks while (IEnumVdsObject_Next(pEnumDisk, 1, &pDiskUnk, &ulFetched) == S_OK) { + BOOL r; VDS_DISK_PROP prop; IVdsDisk* pDisk; @@ -686,13 +687,13 @@ static BOOL GetVdsDiskInterface(DWORD DriveIndex, const IID* InterfaceIID, void* suprintf("Could not query VDS Disk Properties: %s", VdsErrorString(hr)); break; } + hr = S_OK; - // Check if we are on the target disk - // uprintf("GetVdsDiskInterface: Seeking %S found %S", wPhysicalName, prop.pwszName); - hr = (HRESULT)_wcsicmp(wPhysicalName, prop.pwszName); - CoTaskMemFree(prop.pwszName); - if (hr != S_OK) { - hr = S_OK; + // Check if we are on the target disk. Note that prop.pwszName can be NULL on failed disks. + r = (prop.pwszName != NULL) && (_wcsicmp(wPhysicalName, prop.pwszName) == 0); + CoTaskMemFree(prop.pwszName); // NB: Per MS docs, CoTaskMemFree() accepts NULL. + if (!r) { + IVdsDisk_Release(pDisk); continue; } diff --git a/src/rufus.rc b/src/rufus.rc index 2a14a55f..3da72b1b 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.11.2282" +CAPTION "Rufus 4.11.2283" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,11,2282,0 - PRODUCTVERSION 4,11,2282,0 + FILEVERSION 4,11,2283,0 + PRODUCTVERSION 4,11,2283,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.11.2282" + VALUE "FileVersion", "4.11.2283" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.11.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.11.2282" + VALUE "ProductVersion", "4.11.2283" END END BLOCK "VarFileInfo" From 56b4b9f2491957b51aba08e8228468caa8b775f2 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 1 Oct 2025 12:58:40 +0100 Subject: [PATCH 093/192] [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. --- src/db.h | 8 +++--- src/hash.c | 77 ++++++++++++++++++++++++++++------------------------ src/parser.c | 5 +++- src/rufus.rc | 10 +++---- 4 files changed, 55 insertions(+), 45 deletions(-) diff --git a/src/db.h b/src/db.h index 1b5a872b..2be05621 100644 --- a/src/db.h +++ b/src/db.h @@ -150,8 +150,8 @@ static const char db_sb_revoked_txt[] = * Use as fallback when https://rufus.ie/sbat_level.txt cannot be accessed. */ static const char db_sbat_level_txt[] = - "sbat,1,2024010900\n" + "sbat,1,2025051000\n" "shim,4\n" - "grub,3\n" - "grub.debian,4\n" - "BOOTMGRSECURITYVERSIONNUMBER,0x30000"; + "grub,5\n" + "grub.proxmox,2\n" + "BOOTMGRSECURITYVERSIONNUMBER,0x70000"; diff --git a/src/hash.c b/src/hash.c index 1ae3470d..272093cf 100644 --- a/src/hash.c +++ b/src/hash.c @@ -2198,8 +2198,11 @@ static BOOL IsRevokedBySbat(uint8_t* buf, uint32_t len) if (entry.version == 0) continue; for (j = 0; sbat_entries[j].product != NULL; j++) { - if (strcmp(entry.product, sbat_entries[j].product) == 0 && entry.version < sbat_entries[j].version) + if (strcmp(entry.product, sbat_entries[j].product) == 0 && entry.version < sbat_entries[j].version) { + uprintf(" SBAT version for '%s' (%d) is lower than required minimum SBAT version (%d)!", + entry.product, entry.version, sbat_entries[j].version); return TRUE; + } } } @@ -2306,8 +2309,11 @@ static BOOL IsRevokedBySvn(uint8_t* buf, uint32_t len) svn_ver = (uint32_t*)RvaToPhysical(buf, rsrc_rva); if (svn_ver != NULL) { uuprintf(" SVN version: %d.%d", *svn_ver >> 16, *svn_ver & 0xffff); - if (*svn_ver < sbat_entries[i].version) + if (*svn_ver < sbat_entries[i].version) { + uprintf(" SVN version %d.%d is lower than required minimum SVN version %d.%d!", + *svn_ver >> 16, *svn_ver & 0xffff, sbat_entries[i].version >> 16, sbat_entries[i].version & 0xffff); return TRUE; + } } } else { uprintf(" Warning: Unexpected Secure Version Number size"); @@ -2394,42 +2400,43 @@ int IsBootloaderRevoked(uint8_t* buf, uint32_t len) // Get the signer/issuer info cert = GetPeSignatureData(buf); r = GetIssuerCertificateInfo(cert, &info); - if (r == 0) + if (r == 0) { uprintf(" (Unsigned Bootloader)"); - else if (r > 0) + } else if (r > 0) { uprintf(" Signed by '%s'", info.name); + // Only perform revocation checks on signed bootloaders + if (!PE256Buffer(buf, len, hash)) + return -1; + // Check for UEFI DBX revocation + if (IsRevokedByDbx(hash, buf, len)) + revoked = 1; + // Check for Microsoft SSP revocation + for (i = 0; revoked == 0 && i < pe256ssp_size * SHA256_HASHSIZE; i += SHA256_HASHSIZE) + if (memcmp(hash, &pe256ssp[i], SHA256_HASHSIZE) == 0) + revoked = 2; + // Check for Linux SBAT revocation + if (revoked == 0 && IsRevokedBySbat(buf, len)) + revoked = 3; + // Check for Microsoft SVN revocation + if (revoked == 0 && IsRevokedBySvn(buf, len)) + revoked = 4; + // Check for UEFI DBX certificate revocation + if (revoked == 0 && IsRevokedByCert(&info)) + revoked = 5; - if (!PE256Buffer(buf, len, hash)) - return -1; - // Check for UEFI DBX revocation - if (IsRevokedByDbx(hash, buf, len)) - revoked = 1; - // Check for Microsoft SSP revocation - for (i = 0; revoked == 0 && i < pe256ssp_size * SHA256_HASHSIZE; i += SHA256_HASHSIZE) - if (memcmp(hash, &pe256ssp[i], SHA256_HASHSIZE) == 0) - revoked = 2; - // Check for Linux SBAT revocation - if (revoked == 0 && IsRevokedBySbat(buf, len)) - revoked = 3; - // Check for Microsoft SVN revocation - if (revoked == 0 && IsRevokedBySvn(buf, len)) - revoked = 4; - // Check for UEFI DBX certificate revocation - if (revoked == 0 && IsRevokedByCert(&info)) - revoked = 5; - - // If signed and not revoked, print the various Secure Boot "gotchas" - if (r > 0 && revoked == 0) { - if (strcmp(info.name, "Microsoft Windows Production PCA 2011") == 0) { - uprintf(" Note: This bootloader may fail Secure Boot validation on systems that"); - uprintf(" have been updated to use the 'Windows UEFI CA 2023' certificate."); - } else if (strcmp(info.name, "Windows UEFI CA 2023") == 0) { - uprintf(" Note: This bootloader will fail Secure Boot validation on systems that"); - uprintf(" have not been updated to use the latest Secure Boot certificates"); - } else if (strcmp(info.name, "Microsoft Corporation UEFI CA 2011") == 0 || - strcmp(info.name, "Microsoft UEFI CA 2023") == 0) { - uprintf(" Note: This bootloader may fail Secure Boot validation on *some* systems,"); - uprintf(" unless you enable \"Microsoft 3rd-party UEFI CA\" in your 'BIOS'."); + // If signed and not revoked, print the various Secure Boot "gotchas" + if (revoked == 0) { + if (strcmp(info.name, "Microsoft Windows Production PCA 2011") == 0) { + uprintf(" Note: This bootloader may fail Secure Boot validation on systems that"); + uprintf(" have been updated to use the 'Windows UEFI CA 2023' certificate."); + } else if (strcmp(info.name, "Windows UEFI CA 2023") == 0) { + uprintf(" Note: This bootloader will fail Secure Boot validation on systems that"); + uprintf(" have not been updated to use the latest Secure Boot certificates"); + } else if (strcmp(info.name, "Microsoft Corporation UEFI CA 2011") == 0 || + strcmp(info.name, "Microsoft UEFI CA 2023") == 0) { + uprintf(" Note: This bootloader may fail Secure Boot validation on *some* systems,"); + uprintf(" unless you enable \"Microsoft 3rd-party UEFI CA\" in your 'BIOS'."); + } } } diff --git a/src/parser.c b/src/parser.c index afb6985d..62e78209 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1588,9 +1588,12 @@ sbat_entry_t* GetSbatEntries(char* sbatlevel) return NULL; num_entries = 1; - for (i = 0; sbatlevel[i] != '\0'; i++) + for (i = 0; sbatlevel[i] != '\0'; i++) { if (sbatlevel[i] == '\n') num_entries++; + if (sbatlevel[i] == '\r') + sbatlevel[i] = '\n'; + } sbat_list = calloc(num_entries + 1, sizeof(sbat_entry_t)); if (sbat_list == NULL) diff --git a/src/rufus.rc b/src/rufus.rc index 3da72b1b..77dea4e0 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.11.2283" +CAPTION "Rufus 4.11.2284" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,11,2283,0 - PRODUCTVERSION 4,11,2283,0 + FILEVERSION 4,11,2284,0 + PRODUCTVERSION 4,11,2284,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.11.2283" + VALUE "FileVersion", "4.11.2284" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.11.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.11.2283" + VALUE "ProductVersion", "4.11.2284" END END BLOCK "VarFileInfo" From 10694ae42eb9263b7627e00ec56749681a593828 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 2 Oct 2025 17:53:22 +0100 Subject: [PATCH 094/192] 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). --- ChangeLog.txt | 8 ++++++++ res/appstore/listing/listing.csv | 14 ++++++-------- res/loc/po/fr-FR.po | 14 +++++++------- res/loc/rufus.loc | 5 ++--- src/parser.c | 1 - src/pki.c | 3 ++- src/rufus.rc | 10 +++++----- src/vhd.c | 3 +-- 8 files changed, 31 insertions(+), 27 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index b674062f..40a86251 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,11 @@ +o Version 4.11 (2025.10.02) + Add a cheat mode to toggle between Light and Dark mode + Improve WUE option text relating to the CA 2023 option + Update Linux SBAT / Microsoft SVN Secure Boot revocation values to latest + Fix some GRUB/Syslinux download dialogs showing only the 'Close' button + Fix an assert being triggered when using the WUE CA 2023 option on its own + Fix an application crash on systems that have a failed dynamic disk + o Version 4.10 (2025.09.24) Add Dark Mode support (courtesy of @ozone10) Add support for creating Windows CA 2023 compatible media (requires a Windows 11 25H2 ISO) diff --git a/res/appstore/listing/listing.csv b/res/appstore/listing/listing.csv index d7bd6264..048533bb 100644 --- a/res/appstore/listing/listing.csv +++ b/res/appstore/listing/listing.csv @@ -114,14 +114,12 @@ • 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","• Add Dark Mode support (courtesy of @ozone10) -• Add support for creating Windows CA 2023 compatible media (requires a Windows 11 25H2 ISO) -• Add support for saving an existing drive to ISO (UDF only) -• Improve error reporting when saving to VHD/VHDX (with thanks to @Kazkans) -• Improve persistence support for Linux Mint -• Fix UEFI DBX updates being reported in some timezones, even when there are none -• Fix a situation where no file system can be selected in ISO mode -• Fix a crash when trying to process Windows ISOs with very long paths",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"ReleaseNotes","3","Text","• Add a cheat mode to toggle between Light and Dark mode +• Improve WUE option text relating to the CA 2023 option +• Update Linux SBAT / Microsoft SVN Secure Boot revocation values to latest +• Fix some GRUB/Syslinux download dialogs showing only the 'Close' button +• Fix an assert being triggered when using the WUE CA 2023 option on its own +• Fix an application crash on systems that have a failed dynamic disk",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "Title","4","Text","Rufus",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "ShortTitle","5","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "SortTitle","6","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, diff --git a/res/loc/po/fr-FR.po b/res/loc/po/fr-FR.po index bb06d746..f3c2d365 100644 --- a/res/loc/po/fr-FR.po +++ b/res/loc/po/fr-FR.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: 4.5\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2025-04-02 11:34+0100\n" -"PO-Revision-Date: 2025-04-02 11:51+0100\n" +"POT-Creation-Date: 2025-10-01 18:52+0100\n" +"PO-Revision-Date: 2025-10-01 18:53+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr_FR\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: French (Français)\n" "X-Rufus-LCID: 0x040c, 0x080c, 0x0c0c, 0x100c, 0x140c, 0x180c, 0x1c0c, 0x200c, 0x240c, 0x280c, 0x2c0c, 0x300c, 0x340c, 0x380c, 0xe40c\n" -"X-Generator: Poedit 3.6\n" +"X-Generator: Poedit 3.7\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -1840,13 +1840,13 @@ msgstr "Log persistent" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Un fichier supplémentaire ('diskcopy.dll') doit être téléchargé depuis Microsoft pour installer MS-DOS :\n" +"Un fichier supplémentaire ('%s') doit être téléchargé depuis Microsoft pour utiliser cette fonctionalité :\n" "- Sélectionnez 'Oui' pour vous connecter à Internet et le télécharger\n" "- Sélectionnez 'Non' pour annuler l’opération\n" "\n" @@ -1915,8 +1915,8 @@ msgid "Use Rufus MBR" msgstr "Utilisation du MBR Rufus" #. • MSG_350 -msgid "Use 'Windows UEFI CA 2023' signed bootloaders [EXPERIMENTAL]" -msgstr "Utiliser les bootloaders signés par 'Windows UEFI CA 2023' [EXPÉRIMENTAL]" +msgid "Use 'Windows CA 2023' signed bootloaders (requires a compatible target PC)" +msgstr "Utiliser les bootloaders signés par 'Windows CA 2023' (nécessite un PC cible compatible)" #. • MSG_351 msgid "Checking for UEFI bootloader revocation..." diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 0cf239e1..ffd85620 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -609,7 +609,7 @@ t MSG_346 "Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)" t MSG_347 "Expert Mode" t MSG_348 "Extracting archive files: %s" t MSG_349 "Use Rufus MBR" -t MSG_350 "Use 'Windows CA 2023' signed bootloaders [requires KB5025885 or Mosby]" +t MSG_350 "Use 'Windows CA 2023' signed bootloaders (requires a compatible target PC)" t MSG_351 "Checking for UEFI bootloader revocation..." t MSG_352 "Checking for UEFI DBX updates..." t MSG_353 "DBX update available" @@ -4816,12 +4816,11 @@ t MSG_346 "Restreint Windows au mode \"S\" (INCOMPATIBLE avec l'option de désac t MSG_347 "Mode expert" t MSG_348 "Extraction d'archive : %s" t MSG_349 "Utilisation du MBR Rufus" -t MSG_350 "Utiliser les bootloaders signés par 'Windows UEFI CA 2023' [EXPÉRIMENTAL]" +t MSG_350 "Utiliser les bootloaders signés par 'Windows CA 2023' (nécessite un PC cible compatible)" t MSG_351 "Vérification de la revocation des bootloaders UEFI..." t MSG_352 "Vérification des mises à jour de DBX UEFI..." t MSG_353 "Mise à jour DBX disponible" t MSG_354 "Rufus a trouvé une mise à jour des fichiers DBX utilisés pour effectuer la validation des revocations Secure Boot sous UEFI. Voulez-vous télécharger cette mise à jour ?\n- Sélectionnez 'Oui' pour vous connecter à Internet et le télécharger ce contenu\n- Sélectionnez 'Non' pour annuler l’opération\n\nNote : Ces fichiers seront téléchargés dans le répertoire de l'application et réutilisés automatiquement si ils sont présent." -t MSG_355 "Image ISO" t MSG_900 "Rufus est un utilitaire permettant de formater et de créer des média USB amorçables, tels que clés USB, mémoire flash, etc." t MSG_901 "Site officiel : %s" t MSG_902 "Code source: %s" diff --git a/src/parser.c b/src/parser.c index 62e78209..f3d8b41a 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1646,7 +1646,6 @@ sbat_entry_t* GetSbatEntries(char* sbatlevel) * Parse a list of SHA-1 certificate hexascii thumbprints. * List must be freed by the caller. */ - thumbprint_list_t* GetThumbprintEntries(char* thumbprints_txt) { uint32_t i, j, num_entries; diff --git a/src/pki.c b/src/pki.c index a570aa34..7ebef247 100644 --- a/src/pki.c +++ b/src/pki.c @@ -455,7 +455,8 @@ int GetIssuerCertificateInfo(uint8_t* cert, cert_info_t* info) // Build a certificate chain to get the issuer (CA) certificate. memset(&chainPara, 0, sizeof(chainPara)); chainPara.cbSize = sizeof(CERT_CHAIN_PARA); - if (!CertGetCertificateChain(NULL, pCertContext[0], NULL, hStore, &chainPara, 0, NULL, &pChainContext)) { + if (!CertGetCertificateChain(NULL, pCertContext[0], NULL, hStore, &chainPara, + CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL | CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY, NULL, &pChainContext)) { uprintf("PKI: Failed to build certificate chain. Error code: %s", WinPKIErrorString()); goto out; } diff --git a/src/rufus.rc b/src/rufus.rc index 77dea4e0..a84c3459 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.11.2284" +CAPTION "Rufus 4.11.2285" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,11,2284,0 - PRODUCTVERSION 4,11,2284,0 + FILEVERSION 4,11,2285,0 + PRODUCTVERSION 4,11,2285,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.11.2284" + VALUE "FileVersion", "4.11.2285" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.11.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.11.2284" + VALUE "ProductVersion", "4.11.2285" END END BLOCK "VarFileInfo" diff --git a/src/vhd.c b/src/vhd.c index 0b782480..7010fdbb 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -594,9 +594,8 @@ BOOL SaveImage(void) char filename[128], letters[27], path[MAX_PATH]; int DriveIndex = ComboBox_GetCurSel(hDeviceList); enum { image_type_vhd = 1, image_type_vhdx = 2, image_type_ffu = 3, image_type_iso = 4 }; - // Add a non-printable zero-width space to UDF *.iso extension to differentiate it from ISO-9660 static EXT_DECL(img_ext, filename, __VA_GROUP__("*.vhd", "*.vhdx", "*.ffu", "*.iso"), - __VA_GROUP__(lmprintf(MSG_343), lmprintf(MSG_342), lmprintf(MSG_344), lmprintf(MSG_355))); + __VA_GROUP__(lmprintf(MSG_343), lmprintf(MSG_342), lmprintf(MSG_344), lmprintf(MSG_036))); ULARGE_INTEGER free_space; memset(&img_save, 0, sizeof(IMG_SAVE)); From fda1362eb0c0425036f05ed145e568e399c80269 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Sat, 11 Oct 2025 16:54:51 +0100 Subject: [PATCH 095/192] [iso] fix saving to an ISO path that contains spaces * Closes #2829. * Also set rufus-next to 4.12. --- configure | 20 ++++++++++---------- configure.ac | 2 +- src/iso.c | 2 +- src/rufus.rc | 12 ++++++------ 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/configure b/configure index 67578825..5bf5affe 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for rufus 4.11. +# Generated by GNU Autoconf 2.71 for rufus 4.12. # # Report bugs to <https://github.com/pbatard/rufus/issues>. # @@ -611,8 +611,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rufus' PACKAGE_TARNAME='rufus' -PACKAGE_VERSION='4.11' -PACKAGE_STRING='rufus 4.11' +PACKAGE_VERSION='4.12' +PACKAGE_STRING='rufus 4.12' PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues' PACKAGE_URL='https://rufus.ie' @@ -1269,7 +1269,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rufus 4.11 to adapt to many kinds of systems. +\`configure' configures rufus 4.12 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1336,7 +1336,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rufus 4.11:";; + short | recursive ) echo "Configuration of rufus 4.12:";; esac cat <<\_ACEOF @@ -1428,7 +1428,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rufus configure 4.11 +rufus configure 4.12 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1504,7 +1504,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rufus $as_me 4.11, which was +It was created by rufus $as_me 4.12, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2767,7 +2767,7 @@ fi # Define the identity of the package. PACKAGE='rufus' - VERSION='4.11' + VERSION='4.12' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -5313,7 +5313,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rufus $as_me 4.11, which was +This file was extended by rufus $as_me 4.12, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5369,7 +5369,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -rufus config.status 4.11 +rufus config.status 4.12 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 76c7e9e5..0e488ab0 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([rufus], [4.11], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) +AC_INIT([rufus], [4.12], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies]) AC_CONFIG_SRCDIR([src/rufus.c]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/src/iso.c b/src/iso.c index 2349baaf..ec0965fc 100644 --- a/src/iso.c +++ b/src/iso.c @@ -2181,7 +2181,7 @@ DWORD WINAPI IsoSaveImageThread(void* param) // Save to UDF only, as Microsoft's implementation of ISO-9660 doesn't support multiextent // and produces BROKEN images if you try to add files larger than 4 GB. // Plus ISO-9660/Joliet limits labels to 16 characters and has issues with long paths. - static_sprintf(cmd, "%s\\%s\\oscdimg.exe -g -h -k -l\"%s\" -m -u2 -udfver102 %c:\\ %s", + static_sprintf(cmd, "%s\\%s\\oscdimg.exe -g -h -k -l\"%s\" -m -u2 -udfver102 %c:\\ \"%s\"", app_data_dir, FILES_DIR, label, letters[0], img_save->ImagePath); uprintf("Running command: '%s'", cmd); // For detecting typical oscdimg commandline progress report of type: "\r15.5% complete" diff --git a/src/rufus.rc b/src/rufus.rc index a84c3459..ef84246e 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.11.2285" +CAPTION "Rufus 4.12.2286" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,11,2285,0 - PRODUCTVERSION 4,11,2285,0 + FILEVERSION 4,12,2286,0 + PRODUCTVERSION 4,12,2286,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.11.2285" + VALUE "FileVersion", "4.12.2286" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" - VALUE "OriginalFilename", "rufus-4.11.exe" + VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.11.2285" + VALUE "ProductVersion", "4.12.2286" END END BLOCK "VarFileInfo" From 90370405ad205e4b44832d68f65912db56d539df Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 13 Oct 2025 16:48:43 +0100 Subject: [PATCH 096/192] [iso] disable splitting for ESDs * Closes #2823. * Also silence a MinGW warning in stdlg.c. --- src/iso.c | 7 ++++--- src/rufus.h | 2 +- src/rufus.rc | 10 +++++----- src/stdlg.c | 14 +++++++------- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/iso.c b/src/iso.c index ec0965fc..4d355645 100644 --- a/src/iso.c +++ b/src/iso.c @@ -104,6 +104,7 @@ const char* efi_bootname[3] = { "boot", "grub", "mm" }; const char* efi_archname[ARCH_MAX] = { "", "ia32", "x64", "arm", "aa64", "ia64", "riscv64", "loongarch64", "ebc" }; static const char* sources_str = "/sources"; static const char* wininst_name[] = { "install.wim", "install.esd", "install.swm" }; +_STATIC_ASSERT(ARRAYSIZE(wininst_name) < 4); // Must fit as 4 bit position flag // We only support GRUB/BIOS (x86) that uses a standard config dir (/boot/grub/i386-pc/) // If the disc was mastered properly, GRUB/EFI will take care of itself static const char* grub_dirname[] = { "/boot/grub/i386-pc", "/boot/grub2/i386-pc" }; @@ -295,7 +296,7 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const } // Split a >4GB install.wim if the target filesystem is FAT - if (file_length >= 4 * GB && psz_dirname != NULL && IS_FAT(fs_type) && img_report.has_4GB_file == 0x81) { + if (file_length >= 4 * GB && psz_dirname != NULL && IS_FAT(fs_type) && img_report.has_4GB_file == 0x11) { if (safe_stricmp(&psz_dirname[max(0, ((int)safe_strlen(psz_dirname)) - ((int)strlen(sources_str)))], sources_str) == 0) { char wim_path[4 * MAX_PATH]; @@ -427,7 +428,7 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const "?:%s", psz_fullpath); img_report.wininst_index++; if (file_length >= 4 * GB) - img_report.has_4GB_file |= 0x80; + img_report.has_4GB_file |= (0x10 << i); } } } @@ -457,7 +458,7 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const if (props->is_old_c32[i]) img_report.has_old_c32[i] = TRUE; } - if (file_length >= 4 * GB) + if (file_length >= 4 * GB && (img_report.has_4GB_file & 0x0f) != 0x0f) img_report.has_4GB_file++; // Compute projected size needed (NB: ISO_BLOCKSIZE = UDF_BLOCKSIZE) if (file_length != 0) diff --git a/src/rufus.h b/src/rufus.h index a5122221..60f5f2e6 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -374,7 +374,7 @@ enum EFI_BOOT_TYPE { #define HAS_NTFSLESS_GRUB(r)((r.has_grub2 & 0x80) && !(r.has_grub2_fs & 0x4)) #define IS_WINDOWS_1X(r) (r.has_bootmgr_efi && (r.win_version.major >= 10)) #define IS_WINDOWS_11(r) (r.has_bootmgr_efi && (r.win_version.major >= 11)) -#define IS_FAT32_COMPAT(r) (((r.has_4GB_file == 0 && !HAS_FATLESS_GRUB(r)) || (r.has_4GB_file == 0x81 && allow_dual_uefi_bios)) && !r.needs_ntfs) +#define IS_FAT32_COMPAT(r) (((r.has_4GB_file == 0 && !HAS_FATLESS_GRUB(r)) || (r.has_4GB_file == 0x11 && allow_dual_uefi_bios)) && !r.needs_ntfs) #define HAS_EFI_IMG(r) (r.efi_img_path[0] != 0) #define IS_DD_BOOTABLE(r) (r.is_bootable_img > 0) #define IS_DD_ONLY(r) ((r.is_bootable_img > 0) && (!r.is_iso || r.disable_iso)) diff --git a/src/rufus.rc b/src/rufus.rc index ef84246e..e5a2dc2e 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.12.2286" +CAPTION "Rufus 4.12.2287" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2286,0 - PRODUCTVERSION 4,12,2286,0 + FILEVERSION 4,12,2287,0 + PRODUCTVERSION 4,12,2287,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2286" + VALUE "FileVersion", "4.12.2287" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2286" + VALUE "ProductVersion", "4.12.2287" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index 492396bc..b70517ec 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -616,19 +616,19 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP break; case MB_ABORTRETRYIGNORE: HMODULE hMui; - char mui_path[MAX_PATH], button_str[3][64] = { "&Abort", "&Retry", "&Ignore" }; + char mui_path[MAX_PATH], button[3][64] = { "&Abort", "&Retry", "&Ignore" }; // Load the localized button text from user32.dll.mui. 802 = Abort, 803 = Retry, 804 = Ignore static_sprintf(mui_path, "%s\\%s\\user32.dll.mui", sysnative_dir, ToLocaleName(GetUserDefaultUILanguage())); hMui = LoadLibraryU(mui_path); if (hMui != NULL) { - LoadStringU(hMui, 802, button_str[0], sizeof(button_str[0])); - LoadStringU(hMui, 803, button_str[1], sizeof(button_str[1])); - LoadStringU(hMui, 804, button_str[2], sizeof(button_str[2])); + LoadStringU(hMui, 802, button[0], sizeof(button[0])); + LoadStringU(hMui, 803, button[1], sizeof(button[1])); + LoadStringU(hMui, 804, button[2], sizeof(button[2])); FreeLibrary(hMui); } - SetWindowTextU(GetDlgItem(hDlg, IDABORT), button_str[0]); - SetWindowTextU(GetDlgItem(hDlg, IDYES), button_str[1]); - SetWindowTextU(GetDlgItem(hDlg, IDNO), button_str[2]); + SetWindowTextU(GetDlgItem(hDlg, IDABORT), button[0]); + SetWindowTextU(GetDlgItem(hDlg, IDYES), button[1]); + SetWindowTextU(GetDlgItem(hDlg, IDNO), button[2]); ShowWindow(GetDlgItem(hDlg, IDABORT), SW_SHOW); ShowWindow(GetDlgItem(hDlg, IDYES), SW_SHOW); break; From 920a4c5c903730ee9914e926c9f7ba0f974ae017 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 14 Oct 2025 13:22:59 +0100 Subject: [PATCH 097/192] [ui] persist the toggle dark mode setting * Note that if you use this toggle even once, then you will no longer be able to use system settings to toggle Dark Mode, unless you *MANUALLY* delete the registry key. * Closes #2821. * Also update github/codeql-action to v4. * Closes #2833. --- .github/workflows/codeql.yml | 4 ++-- src/darkmode.c | 25 ++++++++++++------------- src/rufus.c | 5 +++-- src/rufus.rc | 10 +++++----- src/settings.h | 2 +- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index b199937e..82375293 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -44,7 +44,7 @@ jobs: uses: actions/checkout@v5 - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: languages: cpp @@ -57,4 +57,4 @@ jobs: run: msbuild ${{env.SOLUTION_FILE_PATH}} /m /p:Configuration=${{ env.BUILD_CONFIGURATION}},Platform=${{ env.TARGET_PLATFORM }} - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4 diff --git a/src/darkmode.c b/src/darkmode.c index 29779ac4..060e4ea6 100644 --- a/src/darkmode.c +++ b/src/darkmode.c @@ -40,7 +40,7 @@ PF_TYPE_DECL(WINAPI, PreferredAppMode, SetPreferredAppMode, (PreferredAppMode)); PF_TYPE_DECL(WINAPI, VOID, FlushMenuThemes, (VOID)); PF_TYPE_DECL(WINAPI, BOOL, SetWindowCompositionAttribute, (HWND, WINDOWCOMPOSITIONATTRIBDATA*)); -BOOL is_darkmode_enabled = FALSE, toggle_dark_mode = FALSE; +BOOL is_darkmode_enabled = FALSE; static COLORREF color_accent = TOOLBAR_ICON_COLOR; @@ -84,20 +84,19 @@ BOOL GetDarkModeFromRegistry(void) if (!IsAtLeastWin10() || IsHighContrast()) return FALSE; - if (ReadSettingBool(SETTING_DISABLE_DARK_MODE)) + // 0 = follow system, 1 = dark mode always, anything else = light mode always + switch (ReadSetting32(SETTING_DARK_MODE)) { + case 0: + if (RegGetValueA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", + "AppsUseLightTheme", RRF_RT_REG_DWORD, NULL, &data, &size) == ERROR_SUCCESS) + // Dark mode is 0, light mode is 1 + return (data == 0); + return FALSE; + case 1: + return TRUE; + default: return FALSE; - - if (toggle_dark_mode) { - toggle_dark_mode = FALSE; - return !is_darkmode_enabled; } - - if (RegGetValueA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", - "AppsUseLightTheme", RRF_RT_REG_DWORD, NULL, &data, &size) == ERROR_SUCCESS) - // Dark mode is 0, light mode is 1 - return (data == 0); - - return FALSE; } void InitDarkMode(HWND hWnd) diff --git a/src/rufus.c b/src/rufus.c index b288c486..cdbcbf7b 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -4140,10 +4140,11 @@ extern int TestHashes(void); } // Other hazardous cheat modes require Ctrl + Alt - // Ctrl-Alt-D => Toggle dark mode and restart + // Ctrl-Alt-D => Toggle dark mode and restart. Note that if you enable this, then + // unless you *MANUALLY* delete the registry key, Rufus always forces the mode. if ((msg.message == WM_KEYDOWN) && (msg.wParam == 'D') && (GetKeyState(VK_CONTROL) & 0x8000) && (GetKeyState(VK_MENU) & 0x8000)) { - toggle_dark_mode = TRUE; + WriteSetting32(SETTING_DARK_MODE, is_darkmode_enabled ? 2 : 1); selected_fs = (int)ComboBox_GetCurItemData(hFileSystem); relaunch = TRUE; PostMessage(hDlg, WM_COMMAND, IDCANCEL, 0); diff --git a/src/rufus.rc b/src/rufus.rc index e5a2dc2e..f89bb155 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.12.2287" +CAPTION "Rufus 4.12.2288" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2287,0 - PRODUCTVERSION 4,12,2287,0 + FILEVERSION 4,12,2288,0 + PRODUCTVERSION 4,12,2288,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2287" + VALUE "FileVersion", "4.12.2288" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2287" + VALUE "ProductVersion", "4.12.2288" END END BLOCK "VarFileInfo" diff --git a/src/settings.h b/src/settings.h index 4e0e8cc6..b6bcf66a 100644 --- a/src/settings.h +++ b/src/settings.h @@ -33,7 +33,7 @@ extern char* ini_file; #define SETTING_ADVANCED_MODE_FORMAT "ShowAdvancedFormatOptions" #define SETTING_COMM_CHECK "CommCheck64" #define SETTING_DEFAULT_THREAD_PRIORITY "DefaultThreadPriority" -#define SETTING_DISABLE_DARK_MODE "DisableDarkMode" +#define SETTING_DARK_MODE "DarkMode" #define SETTING_DISABLE_FAKE_DRIVES_CHECK "DisableFakeDrivesCheck" #define SETTING_DISABLE_LGP "DisableLGP" #define SETTING_DISABLE_RUFUS_MBR "DisableRufusMBR" From 05526d4e6a2051bbbcff02f1c0990ae0ad2f13c5 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 16 Oct 2025 14:03:13 +0100 Subject: [PATCH 098/192] [iso] improve error reporting on ISO extraction issues * Also disable NTFS cluster size that no longer work in recent versions of Windows. --- src/iso.c | 12 ++++++++++-- src/rufus.c | 2 +- src/rufus.rc | 10 +++++----- src/stdio.c | 3 ++- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/iso.c b/src/iso.c index 4d355645..319da8a8 100644 --- a/src/iso.c +++ b/src/iso.c @@ -739,7 +739,9 @@ static int udf_extract_files(udf_t *p_udf, udf_dirent_t *p_udf_dirent, const cha hash_write[HASH_MD5](&ctx, buf, buf_size); ISO_BLOCKING(r = WriteFileWithRetry(file_handle, buf, buf_size, &wr_size, WRITE_RETRIES)); if (!r || (wr_size != buf_size)) { - uprintf(" Error writing file: %s", r ? "Short write detected" : WindowsErrorString()); + if (r) + SetLastError(ERROR_WRITE_FAULT); + uprintf(" Error writing file: %s", WindowsErrorString()); goto out; } file_length -= wr_size; @@ -776,6 +778,8 @@ static int udf_extract_files(udf_t *p_udf, udf_dirent_t *p_udf_dirent, const cha return 0; out: + if (GetLastError() != ERROR_SUCCESS) + ErrorStatus = RUFUS_ERROR(GetLastError()); udf_dirent_free(p_udf_dirent); ISO_BLOCKING(safe_closehandle(file_handle)); safe_free(psz_sanpath); @@ -1004,7 +1008,9 @@ static int iso_extract_files(iso9660_t* p_iso, const char *psz_path) hash_write[HASH_MD5](&ctx, buf, buf_size); ISO_BLOCKING(r = WriteFileWithRetry(file_handle, buf, buf_size, &wr_size, WRITE_RETRIES)); if (!r || wr_size != buf_size) { - uprintf(" Error writing file: %s", r ? "Short write detected" : WindowsErrorString()); + if (r) + SetLastError(ERROR_WRITE_FAULT); + uprintf(" Error writing file: %s", WindowsErrorString()); goto out; } file_length -= wr_size; @@ -1039,6 +1045,8 @@ static int iso_extract_files(iso9660_t* p_iso, const char *psz_path) r = 0; out: + if (r != 0 && GetLastError() != ERROR_SUCCESS) + ErrorStatus = RUFUS_ERROR(GetLastError()); ISO_BLOCKING(safe_closehandle(file_handle)); if (p_entlist != NULL) iso9660_filelist_free(p_entlist); diff --git a/src/rufus.c b/src/rufus.c index cdbcbf7b..1d1ddbe1 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -537,7 +537,7 @@ static BOOL SetFileSystemAndClusterSize(char* fs_name) if (SelectedDrive.DiskSize < 256 * TB) { // NTFS - SelectedDrive.ClusterSize[FS_NTFS].Allowed = 0x0001FE00; + SelectedDrive.ClusterSize[FS_NTFS].Allowed = 0x0001F000; for (i = 16; i <= 256; i <<= 1) { // 7 MB -> 256 TB if (SelectedDrive.DiskSize < i * TB) { SelectedDrive.ClusterSize[FS_NTFS].Default = ((ULONG)i / 4) * KB; diff --git a/src/rufus.rc b/src/rufus.rc index f89bb155..77b95280 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.12.2288" +CAPTION "Rufus 4.12.2289" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2288,0 - PRODUCTVERSION 4,12,2288,0 + FILEVERSION 4,12,2289,0 + PRODUCTVERSION 4,12,2289,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2288" + VALUE "FileVersion", "4.12.2289" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2288" + VALUE "ProductVersion", "4.12.2289" END END BLOCK "VarFileInfo" diff --git a/src/stdio.c b/src/stdio.c index c184d0a6..1fd7ac9a 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -641,13 +641,14 @@ BOOL WriteFileWithRetry(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWr } else { uprintf("Write error %s", WindowsErrorString()); LastWriteError = RUFUS_ERROR(GetLastError()); + if (LastWriteError == RUFUS_ERROR(ERROR_DISK_FULL)) + break; } // If we can't reposition for the next run, just abort if (!readFilePointer) break; if (nTry < nNumRetries) { uprintf("Retrying in %d seconds...", WRITE_TIMEOUT / 1000); - // TODO: Call GetProcessSearch() here? Sleep(WRITE_TIMEOUT); } } From af58b1cecd9bf947af8adcf3c49c9b3cf87a18ac Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 16 Oct 2025 17:52:04 +0100 Subject: [PATCH 099/192] [dbx] update DBXs to latest * Also add 1% to projected size due to user-reported "no space on disk" errors when using Windows 11 25H2 against 8 "GB" UFDs. --- res/dbx/amd64_DBXUpdate.bin | Bin 24005 -> 24053 bytes res/dbx/dbx_info.h | 4 ++-- res/dbx/x86_DBXUpdate.bin | Bin 7781 -> 5477 bytes src/drive.c | 2 +- src/iso.c | 4 +++- src/rufus.rc | 10 +++++----- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/res/dbx/amd64_DBXUpdate.bin b/res/dbx/amd64_DBXUpdate.bin index 811e27eb39e1e7e0f56637bfe7b01e8acdb71165..07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8?P`?kBUNb{lbN=W=f`CDmsE+b*q4BgIa5B z7;FLxwzE|Qg9Z;VX~PVS-F=+N0000005Oy23nG84ZX!Gy=>gQK@SCUs>vEW-jvNwB z9wV&j#~bl-!LN9Kb=4SoaYs<p@}9EP)p$<6)|;<d$>&V;BVz(hWXXtrbCO-IwM_Sm zqP4wo$VK1$o_bDZQX>AkFaGvkVlSIU978_eRPiNUBKDmh=K=bVk{+ajHFmHoekfhU znLmHm&M>u4B!LmA#n2&Q)(ABcm<}zUW1>KGDB!r)=~0h|+g|hASV|;Abg*I=<-5q% zvIXjyU{LRZpW)icew~j<<I0EqGe+ETwD6Bo?FVE!1kE*tO=#(A{N(YA%0|$gDeJ=% z_iuz|V3LC_a&w#cavbQ?+OP2;?#Kg~q@)x3_a+v^!Aww+K&+`j`8Jb7D7>>84XaQv CzQ2P2 diff --git a/res/dbx/dbx_info.h b/res/dbx/dbx_info.h index 34d4a201..eb0c2870 100644 --- a/res/dbx/dbx_info.h +++ b/res/dbx/dbx_info.h @@ -7,8 +7,8 @@ struct { char* url; uint64_t timestamp; } dbx_info[] = { - { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/x86/DBXUpdate.bin", 1740428422 }, - { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/amd64/DBXUpdate.bin", 1749602743 }, + { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/x86/DBXUpdate.bin", 1760555920 }, + { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/amd64/DBXUpdate.bin", 1760555920 }, { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/arm/DBXUpdate.bin", 1740428422 }, { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/arm64/DBXUpdate.bin", 1740428422 }, { "https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/ia64/DBXUpdate.bin", 0 }, diff --git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4TkkMD)UEuM(#p?KQG zBoB6_Ie&ZL*Hrs7tS7&zRk>5r2+L4A?TTyR#PFArIeSuvJFUE#{+{tW_~l1T3tFS+ z90#3e*o4ZYgneJ_+e(op;pmi3X4Rg)(&PhsgY@r|?t0}RyUg8+l|zppLAYt^&mIps z_5qxvVsMeB1vv07^7h==dA`!v*e$_BxccBSxyPDZO>Qo-@<r;~6K??QB}N+H#KXI_ zjS)jMt;f^>TJNwvgp5~byNpsBc>7N>V818Bht<VE27vC(By3c^_BD=Uo)9~%d8dy$ z4Fp+n@SpFS8$(3_fzkxAQ>a{p&ny&EEZ|Ix-HOaUz|c@0lw^B=58%$jeJ0s<Nw#Ov zNKqNQoiigHL@?=@{}LBQ5RUjX!~3rX{{Iu!xnZR{e%?_yq|bVf0zzK!Q9Zs!=x|H~ zL7b@E*Zhzad;scc`lcLfXzc2fL(N`#F{hSTCc|;Ww{6)7RDw~on=jbETN7(i-kO48 zE?4=7yo3(PL@GrPhJnzjpl!gucKC@rIKWgju@5q0g&kK6-7}A=2NN7Jdxor%Oq3tS z$#X&*?7{x->oVhMqW<A;<Q4LZ*VYZgh~?f3mdW?j8bcDogD&-hz4!&4cc%bvC6%ba z*B+vB<{00djA1ir8IJ^|-C1@lt_vKr_otfPVPs?pi^qp;8D(q0Rr8NOjS!18)zM9j wwIh<jUWYObsn&1L*Q=fto>e;TU7^qLaO*R><dydxuB*+yUjKM>DP7|K09fZ&`v3p{ diff --git a/src/drive.c b/src/drive.c index 24dfc8e8..98588d6a 100644 --- a/src/drive.c +++ b/src/drive.c @@ -1893,7 +1893,7 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys suprintf("Disk type: %s, Disk size: %s, Sector size: %d bytes", (SelectedDrive.MediaType == FixedMedia) ? "FIXED" : "Removable", - SizeToHumanReadable(SelectedDrive.DiskSize, FALSE, TRUE), SelectedDrive.SectorSize); + SizeToHumanReadable(SelectedDrive.DiskSize, FALSE, FALSE), SelectedDrive.SectorSize); suprintf("Cylinders: %" PRIi64 ", Tracks per cylinder: %d, Sectors per track: %d", DiskGeometry->Geometry.Cylinders.QuadPart, DiskGeometry->Geometry.TracksPerCylinder, DiskGeometry->Geometry.SectorsPerTrack); assert(SelectedDrive.SectorSize != 0); diff --git a/src/iso.c b/src/iso.c index 319da8a8..11edf0ac 100644 --- a/src/iso.c +++ b/src/iso.c @@ -1326,7 +1326,9 @@ out: for (k = (int)safe_strlen(img_report.label) - 1; ((k > 0) && (isspaceU(img_report.label[k]))); k--) img_report.label[k] = 0; // We use the fact that UDF_BLOCKSIZE and ISO_BLOCKSIZE are the same here - img_report.projected_size = total_blocks * ISO_BLOCKSIZE; + // Also, we add 1% extra requirement, on account that we most likely use a 4k or higher cluster size + // whereas ISO_BLOCKSIZE is 2k, which means we'll need extra spaces if there are many small files. + img_report.projected_size = (uint64_t)((double)total_blocks * ISO_BLOCKSIZE * 1.01f); // We will link the existing isolinux.cfg from a syslinux.cfg we create // If multiple config files exist, choose the one with the shortest path // (so that a '/syslinux.cfg' is preferred over a '/isolinux/isolinux.cfg') diff --git a/src/rufus.rc b/src/rufus.rc index 77b95280..a5388964 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.12.2289" +CAPTION "Rufus 4.12.2290" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2289,0 - PRODUCTVERSION 4,12,2289,0 + FILEVERSION 4,12,2290,0 + PRODUCTVERSION 4,12,2290,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2289" + VALUE "FileVersion", "4.12.2290" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2289" + VALUE "ProductVersion", "4.12.2290" END END BLOCK "VarFileInfo" From 6629ef0941170867777b59388e19989bc38e20c3 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 20 Oct 2025 13:44:33 +0100 Subject: [PATCH 100/192] [wue] fix wimlib not being able to modify boot.wim's larger than 2 GB * Thank the C standard for choosing not to "standardize" the size of long (as one would rightfully expect from a *standard*) and instead going for a "should be at least" super vague definition, that led to lseek() on Windows and UNIX effectively using different offset sizes, and programmers everywhere getting bitten when taking a UNIX codebase and porting it to Windows... * Closes #2837. --- src/rufus.rc | 10 +++++----- src/wimlib/file_io.c | 4 ++-- src/wimlib/header.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/rufus.rc b/src/rufus.rc index a5388964..adb1e931 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.12.2290" +CAPTION "Rufus 4.12.2291" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2290,0 - PRODUCTVERSION 4,12,2290,0 + FILEVERSION 4,12,2291,0 + PRODUCTVERSION 4,12,2291,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2290" + VALUE "FileVersion", "4.12.2291" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2290" + VALUE "ProductVersion", "4.12.2291" END END BLOCK "VarFileInfo" diff --git a/src/wimlib/file_io.c b/src/wimlib/file_io.c index fa8872eb..3d51d028 100644 --- a/src/wimlib/file_io.c +++ b/src/wimlib/file_io.c @@ -346,7 +346,7 @@ off_t filedes_seek(struct filedes *fd, off_t offset) return -1; } if (fd->offset != offset) { - if (lseek(fd->fd, offset, SEEK_SET) == -1) + if (_lseeki64(fd->fd, offset, SEEK_SET) == -1) return -1; fd->offset = offset; } @@ -360,5 +360,5 @@ bool filedes_is_seekable(struct filedes *fd) if (fd->is_udf || fd->is_iso) return false; #endif - return !fd->is_pipe && lseek(fd->fd, 0, SEEK_CUR) != -1; + return !fd->is_pipe && _lseeki64(fd->fd, 0, SEEK_CUR) != -1; } diff --git a/src/wimlib/header.c b/src/wimlib/header.c index 10826836..dd671c46 100644 --- a/src/wimlib/header.c +++ b/src/wimlib/header.c @@ -90,7 +90,7 @@ read_wim_header(WIMStruct *wim, struct wim_header *hdr) * actually reading from a pipe. */ if (!in_fd->is_pipe) { ret = WIMLIB_ERR_READ; - if (-1 == lseek(in_fd->fd, -WIM_HEADER_DISK_SIZE, SEEK_END)) + if (-1 == _lseeki64(in_fd->fd, -WIM_HEADER_DISK_SIZE, SEEK_END)) goto read_error; ret = full_read(in_fd, &disk_hdr, sizeof(disk_hdr)); if (ret) From 9d074f85912e8c702619d3bd1e99bfbefa67895d Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 12 Nov 2025 17:16:05 +0000 Subject: [PATCH 101/192] [core] strengthen the pre-formatting partition cleanup code * This aims at reducing errors with Windows and other apps trying to keep a hook into existing ESPs and other partitions, thereby causing access errors. * This is expected to potentially help with #2776 and similar issues. * Closes #2776. --- src/format.c | 82 +++++++++++++++++++++++++++++++--------------------- src/rufus.h | 2 +- src/rufus.rc | 10 +++---- src/stdio.c | 6 ++-- 4 files changed, 58 insertions(+), 42 deletions(-) diff --git a/src/format.c b/src/format.c index 447e22ab..f5ef4bb0 100644 --- a/src/format.c +++ b/src/format.c @@ -715,47 +715,38 @@ out: return r; } -static BOOL ClearMBRGPT(HANDLE hPhysicalDrive, LONGLONG DiskSize, DWORD SectorSize, BOOL add1MB) +static BOOL ClearMBRGPT(HANDLE hPhysicalDrive, LONGLONG DiskSize, DWORD SectorSize) { BOOL r = FALSE; LARGE_INTEGER liFilePointer; - uint64_t num_sectors_to_clear; - unsigned char* pZeroBuf = NULL; + uint8_t* pZeroBuf = calloc(SectorSize, MAX_SECTORS_TO_CLEAR); - PrintInfoDebug(0, MSG_224); - // http://en.wikipedia.org/wiki/GUID_Partition_Table tells us we should clear 34 sectors at the - // beginning and 33 at the end. We bump these values to MAX_SECTORS_TO_CLEAR each end to help - // with reluctant access to large drive. - - // We try to clear at least 1MB + the VBR when Large FAT32 is selected (add1MB), but - // don't do it otherwise, as it seems unnecessary and may take time for slow drives. - // Also, for various reasons (one of which being that Windows seems to have issues - // with GPT drives that contain a lot of small partitions) we try not not to clear - // sectors further than the lowest partition already residing on the disk. - num_sectors_to_clear = min(SelectedDrive.FirstDataSector, (DWORD)((add1MB ? 2048 : 0) + MAX_SECTORS_TO_CLEAR)); - // Special case for big floppy disks (FirstDataSector = 0) - if (num_sectors_to_clear < 4) - num_sectors_to_clear = (DWORD)((add1MB ? 2048 : 0) + MAX_SECTORS_TO_CLEAR); - - uprintf("Erasing %llu sectors", num_sectors_to_clear); - pZeroBuf = calloc(SectorSize, (size_t)num_sectors_to_clear); if (pZeroBuf == NULL) { ErrorStatus = RUFUS_ERROR(ERROR_NOT_ENOUGH_MEMORY); goto out; } + + // We now unconditionally zero MAX_SECTORS_TO_CLEAR and (MAX_SECTORS_TO_CLEAR / 8) + // at the beginning and end of the drive respectively. This should encompass the + // MBR, GPT, backup GPT and VBR for most devices and (hopefully) get Windows and + // other apps off our back with trying to access zombie partitions... + PrintInfoDebug(0, MSG_224); liFilePointer.QuadPart = 0ULL; if (!SetFilePointerEx(hPhysicalDrive, liFilePointer, &liFilePointer, FILE_BEGIN) || (liFilePointer.QuadPart != 0ULL)) - uprintf("WARNING: Could not reset disk position"); - if (!WriteFileWithRetry(hPhysicalDrive, pZeroBuf, (DWORD)(SectorSize * num_sectors_to_clear), NULL, WRITE_RETRIES)) + uprintf("WARNING: Could not reset disk position: %s", WindowsErrorString()); + if (!WriteFileWithRetry(hPhysicalDrive, pZeroBuf, (DWORD)(SectorSize * MAX_SECTORS_TO_CLEAR), NULL, WRITE_RETRIES)) goto out; + uprintf("Zeroed %s at the top of the drive", SizeToHumanReadable(MAX_SECTORS_TO_CLEAR * SectorSize, FALSE, FALSE)); CHECK_FOR_USER_CANCEL; - liFilePointer.QuadPart = DiskSize - (LONGLONG)SectorSize * MAX_SECTORS_TO_CLEAR; + liFilePointer.QuadPart = DiskSize - (LONGLONG)SectorSize * (MAX_SECTORS_TO_CLEAR / 8); // Windows seems to be an ass about keeping a lock on a backup GPT, // so we try to be lenient about not being able to clear it. - if (SetFilePointerEx(hPhysicalDrive, liFilePointer, &liFilePointer, FILE_BEGIN)) { - IGNORE_RETVAL(WriteFileWithRetry(hPhysicalDrive, pZeroBuf, - SectorSize * MAX_SECTORS_TO_CLEAR, NULL, WRITE_RETRIES)); - } + if (SetFilePointerEx(hPhysicalDrive, liFilePointer, &liFilePointer, FILE_BEGIN) && + WriteFileWithRetry(hPhysicalDrive, pZeroBuf, SectorSize * (MAX_SECTORS_TO_CLEAR / 8), NULL, WRITE_RETRIES)) + uprintf("Zeroed %s at the end of the drive", SizeToHumanReadable((MAX_SECTORS_TO_CLEAR / 8) * SectorSize, FALSE, FALSE)); + else + uprintf("WARNING: Could not to clear the backup GPT area: %s", WindowsErrorString()); + r = TRUE; out: @@ -1451,6 +1442,7 @@ DWORD WINAPI FormatThread(void* param) // Windows 11 and VDS (which I suspect is what fmifs.dll's FormatEx() is now calling behind the scenes) // require us to unlock the physical drive to format the drive, else access denied is returned. BOOL need_logical = FALSE, must_unlock_physical = (use_vds || WindowsVersion.Version >= WINDOWS_11); + BOOL retry_clear = TRUE; DWORD cr, DriveIndex = (DWORD)(uintptr_t)param, ClusterSize, Flags; HANDLE hPhysicalDrive = INVALID_HANDLE_VALUE; HANDLE hLogicalVolume = INVALID_HANDLE_VALUE; @@ -1582,13 +1574,33 @@ DWORD WINAPI FormatThread(void* param) goto out; } - // Zap partition records. This helps prevent access errors. +try_clear: + // Zap partition records. This may help prevent access errors. // Note, Microsoft's way of cleaning partitions (IOCTL_DISK_CREATE_DISK, which is what we apply // in InitializeDisk) is *NOT ENOUGH* to reset a disk and can render it inoperable for partitioning // or formatting under Windows. See https://github.com/pbatard/rufus/issues/759 for details. if ((boot_type != BT_IMAGE) || (img_report.is_iso && !write_as_image)) { - if ((!ClearMBRGPT(hPhysicalDrive, SelectedDrive.DiskSize, SelectedDrive.SectorSize, use_large_fat32)) || + if ((!ClearMBRGPT(hPhysicalDrive, SelectedDrive.DiskSize, SelectedDrive.SectorSize)) || (!InitializeDisk(hPhysicalDrive))) { + // If VDS is available, try cycling the device to see it it helps + if (retry_clear && is_vds_available) { + uprintf("Cycling the device to see if it helps..."); + // Note: This may leave the device disabled on re-plug or reboot + // so only do this for the experimental VDS path for now... + cr = CycleDevice(ComboBox_GetCurSel(hDeviceList)); + if (cr == ERROR_DEVICE_REINITIALIZATION_NEEDED) { + uprintf("Zombie device detected, trying again..."); + Sleep(1000); + cr = CycleDevice(ComboBox_GetCurSel(hDeviceList)); + } + if (cr == 0) + uprintf("Successfully cycled device"); + else + uprintf("Cycling device failed!"); + Sleep(1000); + retry_clear = FALSE; + goto try_clear; + } uprintf("Could not reset partitions"); ErrorStatus = (LastWriteError != 0) ? LastWriteError : RUFUS_ERROR(ERROR_PARTITION_FAILURE); goto out; @@ -1622,7 +1634,7 @@ DWORD WINAPI FormatThread(void* param) uprintf("Bad blocks: Check failed."); if (!IS_ERROR(ErrorStatus)) ErrorStatus = RUFUS_ERROR(APPERR(ERROR_BADBLOCKS_FAILURE)); - ClearMBRGPT(hPhysicalDrive, SelectedDrive.DiskSize, SelectedDrive.SectorSize, FALSE); + ClearMBRGPT(hPhysicalDrive, SelectedDrive.DiskSize, SelectedDrive.SectorSize); fclose(log_fd); DeleteFileU(logfile); goto out; @@ -1653,8 +1665,8 @@ DWORD WINAPI FormatThread(void* param) // Especially after destructive badblocks test, you must zero the MBR/GPT completely // before repartitioning. Else, all kind of bad things happen. - if (!ClearMBRGPT(hPhysicalDrive, SelectedDrive.DiskSize, SelectedDrive.SectorSize, use_large_fat32)) { - uprintf("unable to zero MBR/GPT"); + if (!ClearMBRGPT(hPhysicalDrive, SelectedDrive.DiskSize, SelectedDrive.SectorSize)) { + uprintf("Could not zero MBR/GPT"); if (!IS_ERROR(ErrorStatus)) ErrorStatus = RUFUS_ERROR(ERROR_WRITE_FAULT); goto out; @@ -1712,9 +1724,9 @@ DWORD WINAPI FormatThread(void* param) safe_unlockclose(hPhysicalDrive); if (use_vds) { - uprintf("Refreshing drive layout..."); // Note: This may leave the device disabled on re-plug or reboot // so only do this for the experimental VDS path for now... + uprintf("Cycling device..."); cr = CycleDevice(ComboBox_GetCurSel(hDeviceList)); if (cr == ERROR_DEVICE_REINITIALIZATION_NEEDED) { uprintf("Zombie device detected, trying again..."); @@ -1725,6 +1737,10 @@ DWORD WINAPI FormatThread(void* param) uprintf("Successfully cycled device"); else uprintf("Cycling device failed!"); + } + if (is_vds_available) { + // This one should be safe to issue unconditionally + uprintf("Refreshing drive layout..."); RefreshLayout(DriveIndex); } diff --git a/src/rufus.h b/src/rufus.h index 60f5f2e6..ce966190 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -87,7 +87,7 @@ #define MAX_IGNORE_USB 8 // Maximum number of USB drives we want to ignore #define MAX_ISO_TO_ESP_SIZE (1 * GB) // Maximum size we allow for the ISO → ESP option #define MAX_DEFAULT_LIST_CARD_SIZE (500 * GB) // Size above which we don't list a card without enable HDD or Alt-F -#define MAX_SECTORS_TO_CLEAR 128 // nb sectors to zap when clearing the MBR/GPT (must be >34) +#define MAX_SECTORS_TO_CLEAR (8 * MB / 512) // Sectors to zap when clearing the MBR/GPT (must be >34) #define MAX_USERNAME_LENGTH 128 // Maximum size we'll accept for a WUE specified username #define MAX_WININST 4 // Max number of install[.wim|.esd] we can handle on an image #define MAX_MARKER 80.0f // Max number of '+' signs we display for progress diff --git a/src/rufus.rc b/src/rufus.rc index adb1e931..c70cbf95 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.12.2291" +CAPTION "Rufus 4.12.2292" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2291,0 - PRODUCTVERSION 4,12,2291,0 + FILEVERSION 4,12,2292,0 + PRODUCTVERSION 4,12,2292,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2291" + VALUE "FileVersion", "4.12.2292" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2291" + VALUE "ProductVersion", "4.12.2292" END END BLOCK "VarFileInfo" diff --git a/src/stdio.c b/src/stdio.c index 1fd7ac9a..8726b0d1 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -582,13 +582,13 @@ HANDLE CreateFileWithTimeout(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwS CancelSynchronousIo(hThread); switch (WaitForSingleObject(hThread, 30000)) { case WAIT_TIMEOUT: - uprintf("File was not created within timeout duration"); + uprintf("Could not open file or device within timeout duration"); break; case WAIT_OBJECT_0: - uprintf("File creation aborted by user"); + uprintf("Operation aborted by user"); break; default: - uprintf("Error while waiting for file to ne created: %s", WindowsErrorString()); + uprintf("Error while waiting for file or device to be opened: %s", WindowsErrorString()); break; } params.dwError = WAIT_TIMEOUT; From d755303a10a95bf9221d7e9665bb8b9d0ec1dc01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 12:10:11 +0000 Subject: [PATCH 102/192] [internal] bump actions/upload-artifact from 4 to 5 * Closes #2847. --- .github/workflows/coverity.yml | 2 +- .github/workflows/mingw.yml | 4 ++-- .github/workflows/setup.yml | 4 ++-- .github/workflows/vs2022.yml | 4 ++-- src/rufus.rc | 10 +++++----- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 40aaa621..39ef2fa2 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -53,7 +53,7 @@ jobs: cov-build.exe --dir cov-int msbuild ${{ env.SOLUTION_FILE_PATH }} /m /p:Configuration=${{ env.BUILD_CONFIGURATION }},Platform=${{ env.TARGET_PLATFORM }} - name: Publish Coverity artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: cov-int path: cov-int/ diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml index 33e84d5f..8c3354c8 100644 --- a/.github/workflows/mingw.yml +++ b/.github/workflows/mingw.yml @@ -114,7 +114,7 @@ jobs: - name: Upload artifacts if: ${{ github.event_name == 'push' }} - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: ${{ matrix.sys }} path: ./*.exe @@ -124,7 +124,7 @@ jobs: needs: MinGW-Build steps: - name: Merge Artifacts - uses: actions/upload-artifact/merge@v4 + uses: actions/upload-artifact/merge@v5 if: ${{ github.event_name == 'push' }} with: name: MinGW diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml index a222d685..9f98a7aa 100644 --- a/.github/workflows/setup.yml +++ b/.github/workflows/setup.yml @@ -36,7 +36,7 @@ jobs: run: sha256sum ./setup_${{ matrix.TARGET_PLATFORM }}.exe - name: Upload artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: ${{ matrix.TARGET_PLATFORM }} path: ./*.exe @@ -46,7 +46,7 @@ jobs: needs: VS2022-Build steps: - name: Merge Artifacts - uses: actions/upload-artifact/merge@v4 + uses: actions/upload-artifact/merge@v5 with: name: setup delete-merged: true diff --git a/.github/workflows/vs2022.yml b/.github/workflows/vs2022.yml index cbbe9e75..675f0bab 100644 --- a/.github/workflows/vs2022.yml +++ b/.github/workflows/vs2022.yml @@ -113,7 +113,7 @@ jobs: curl --request POST --url https://www.virustotal.com/api/v3/monitor/items --header 'x-apikey: ${{ secrets.VIRUSTOTAL_API_KEY }}' --form path='/rufus_${{ matrix.TARGET_PLATFORM }}.exe' --form file=@./rufus_${{ matrix.TARGET_PLATFORM }}.exe - name: Upload artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 if: ${{ github.event_name == 'push' }} with: name: ${{ matrix.TARGET_PLATFORM }} @@ -126,7 +126,7 @@ jobs: needs: VS2022-Build steps: - name: Merge Artifacts - uses: actions/upload-artifact/merge@v4 + uses: actions/upload-artifact/merge@v5 if: ${{ github.event_name == 'push' }} with: name: VS2022 diff --git a/src/rufus.rc b/src/rufus.rc index c70cbf95..7199caad 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.12.2292" +CAPTION "Rufus 4.12.2293" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2292,0 - PRODUCTVERSION 4,12,2292,0 + FILEVERSION 4,12,2293,0 + PRODUCTVERSION 4,12,2293,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2292" + VALUE "FileVersion", "4.12.2293" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2292" + VALUE "ProductVersion", "4.12.2293" END END BLOCK "VarFileInfo" From b2fd4260280d746a929bf969cd710506d1d57452 Mon Sep 17 00:00:00 2001 From: Grant <github@firefishy.com> Date: Tue, 11 Nov 2025 16:11:56 +0000 Subject: [PATCH 103/192] [misc] correct the spelling of 'zstd' in ChangeLog.txt * Closes #2860. --- ChangeLog.txt | 2 +- src/rufus.rc | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 40a86251..891736c0 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -35,7 +35,7 @@ o Version 4.8 (2025.06.11) o Version 4.7 (2025.04.09) Add a mechanism to detect and download updated DBXs from the official UEFI repository - Add ztsd compression support for disk images + Add zstd compression support for disk images Add a new exclusion feature in the settings, to ignore disks with a specific GPT GUID Improve detection for compressed VHD images that are too large to fit the target drive Fix commandline hogger not being deleted when running Rufus from a different directory diff --git a/src/rufus.rc b/src/rufus.rc index 7199caad..a82c6c38 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.12.2293" +CAPTION "Rufus 4.12.2294" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2293,0 - PRODUCTVERSION 4,12,2293,0 + FILEVERSION 4,12,2294,0 + PRODUCTVERSION 4,12,2294,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2293" + VALUE "FileVersion", "4.12.2294" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2293" + VALUE "ProductVersion", "4.12.2294" END END BLOCK "VarFileInfo" From 2af24e460ef098ccf14faed67f23b41ecc445146 Mon Sep 17 00:00:00 2001 From: Mr-Update <37781396+Mr-Update@users.noreply.github.com> Date: Fri, 31 Oct 2025 19:55:28 +0000 Subject: [PATCH 104/192] [loc] fix typos and improve German translation * Also remove typos in English .loc comments and MSG_355 that's a duplicate of MSG_036. * Closes #2851. --- res/loc/po/de-DE.po | 70 ++++++++++++++++++++++----------------------- res/loc/rufus.loc | 54 +++++++++++++++++----------------- src/rufus.rc | 10 +++---- 3 files changed, 67 insertions(+), 67 deletions(-) diff --git a/res/loc/po/de-DE.po b/res/loc/po/de-DE.po index 9a6ab983..b8a8e950 100644 --- a/res/loc/po/de-DE.po +++ b/res/loc/po/de-DE.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: 4.5\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-04-26 11:11+0200\n" -"PO-Revision-Date: 2024-04-26 11:48+0200\n" +"POT-Creation-Date: 2025-11-12 17:32+0000\n" +"PO-Revision-Date: 2025-11-12 17:32+0000\n" "Last-Translator: \n" "Language-Team: \n" "Language: de_DE\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: German (Deutsch)\n" "X-Rufus-LCID: 0x0407, 0x0807, 0x0c07, 0x1007, 0x1407\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.8\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -846,7 +846,7 @@ msgstr "Keine Persistenz" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Größe der persistenten Partition des Live-USB-Systems. Eine Größe von 0 deaktiviert die Persistenz." @@ -867,7 +867,7 @@ msgid "" "You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\n" "For details on why this is necessary, see the 'More Information' button below." msgstr "" -"Sie haben gerade ein Medium erstellt, das den UEFI:NTFS-Bootloader verwendet. Bitte denken Sie daran, dass Sie zum Starten dieses Mediums SECURE BOOT DEAKTIVIEREN müssen.\n" +"Sie haben gerade ein Medium erstellt, welches das UEFI:NTFS-Startprogramm verwendet. Bitte denken Sie daran, dass Sie zum Starten dieses Mediums SECURE BOOT DEAKTIVIEREN müssen.\n" "Nach dem Abschluss des Vorgangs sollten Sie SECURE BOOT wieder aktivieren.\n" "Weitere Informationen, warum dies notwendig ist, finden Sie über die Schaltfläche \"Weitere Informationen\"." @@ -1039,11 +1039,11 @@ msgstr "Image-Datei oder Download auswählen..." #. • MSG_166 msgid "Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)" -msgstr "Wählen Sie diese Option, um die Anzeige internationaler Bezeichnungen zu ermöglichen und ein Gerätesymbol zu erzeugen (autorun.inf)" +msgstr "Wählen Sie diese Option, um die Anzeige internationaler Bezeichnungen zu ermöglichen und ein Gerätesymbol zu erzeugen (autorun.inf)." #. • MSG_167 msgid "Install a UEFI bootloader, that will perform MD5Sum file validation of the media" -msgstr "Ein UEFI Startprogramm installieren, das eine MD5Sum Dateiüberprüfung auf dem Datenträger durchführt" +msgstr "Ein UEFI-Startprogramm installieren, das eine MD5Sum-Dateiüberprüfung auf dem Datenträger durchführt" #. • MSG_169 msgid "" @@ -1181,7 +1181,7 @@ msgid "" "Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\n" "Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work." msgstr "" -"WICHTIG: DIESES LAUFWERK HAT EINE NICHT STANDARDISIERTE SEKTORGRÖSSE!\n" +"WICHTIG: DIESES LAUFWERK HAT EINE NICHT STANDARDISIERTE SEKTORGRÖẞE!\n" "\n" "Herkömmliche Laufwerke nutzen eine Sektorgröße von 512 Byte, aber dieses Laufwerk nutzt %d Byte. Höchstwahrscheinlich können Sie von diesem Laufwerk NICHT starten.\n" "Rufus kann versuchen, ein startfähiges Laufwerk zu erstellen, aber es gibt KEINE GARANTIE, dass es funktionieren wird." @@ -1431,7 +1431,7 @@ msgstr "Es wurde keine neue Version von Rufus gefunden" #. • MSG_248 msgid "Application registry keys successfully deleted" -msgstr "Anwendungeinstellungen in der Registrierdatenbank erfolgreich gelöscht" +msgstr "Anwendungseinstellungen in der Registrierdatenbank erfolgreich gelöscht" #. • MSG_249 msgid "Failed to delete application registry keys" @@ -1740,13 +1740,13 @@ msgid "" "\n" "Please select the mode that you want to use to write this image:" msgstr "" -"Das ausgewählte ISO-Image verwendet UEFI und ist klein genug, um auf eine EFI System-Partition (ESP) geschrieben zu werden. Es auf eine ESP- anstelle einer normalen Partition zu schrieben, kann für bestimmte Installationsarten vorteilhaft sein.\n" +"Das ausgewählte ISO-Image verwendet UEFI und ist klein genug, um auf eine EFI-Systempartition (ESP) geschrieben zu werden. Es auf eine ESP anstelle einer normalen Partition zu schreiben, die die gesamte Festplatte belegt, kann für bestimmte Installationsarten vorteilhaft sein.\n" "\n" "Bitte wählen Sie einen Modus aus:" #. • MSG_311 msgid "Use %s (in the main application window) to enable." -msgstr "Verwende %s (Hauptfenster der Anwendung) zum aktivieren." +msgstr "Verwende %s (Hauptfenster der Anwendung) zum Aktivieren." #. • MSG_312 msgid "Extra hashes (SHA512)" @@ -1789,7 +1789,7 @@ msgid "" "The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\n" "As a result, DD image writing mode will be enforced." msgstr "" -"Das ausgewählte Image ist vom Typ ISOHybrid, aber der Ersteller hat es nicht mit dem ISO/Datei Kopier-Modus kompatibel gemacht.\n" +"Das ausgewählte Image ist vom Typ ISOHybrid, aber der Ersteller hat es nicht mit dem ISO/Dateikopiermodus kompatibel gemacht.\n" "Deswegen wird der DD-Schreibmodus verwendet." #. • MSG_322 @@ -1798,7 +1798,7 @@ msgstr "'%' kann nicht geöffnet/gelesen werden" #. • MSG_325 msgid "Applying Windows customization: %s" -msgstr "Windows Anpassungen anwenden: %s" +msgstr "Windows-Anpassungen anwenden: %s" #. • MSG_326 msgid "Applying user options..." @@ -1806,7 +1806,7 @@ msgstr "Benutzereinstellungen anwenden..." #. • MSG_327 msgid "Windows User Experience" -msgstr "Windows Benutzererfahrung" +msgstr "Windows-Benutzererfahrung" #. • MSG_328 msgid "Customize Windows installation?" @@ -1818,7 +1818,7 @@ msgstr "Anforderung für 4GB+ RAM, Secure Boot und TPM 2.0 entfernen" #. • MSG_330 msgid "Remove requirement for an online Microsoft account" -msgstr "Anforderung für Online Microsoft Konto entfernen" +msgstr "Anforderung für Online-Microsoft-Konto entfernen" #. • MSG_331 msgid "Disable data collection (Skip privacy questions)" @@ -1846,21 +1846,21 @@ msgstr "Dauerhaftes Protokoll" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Eine zusätzliche Datei ('diskcopy.dll') muss von Microsoft heruntergeladen werden um MS-DOS zu installieren:\n" -"- 'Ja' um eine Verbindung mit dem Internet herzustellen und die Datei herunterzuladen\n" -"- 'Nein' um den Vorgang abzubrechen\n" +"Eine zusätzliche Datei ('%s') muss von Microsoft heruntergeladen werden, um diese Funktion zu nutzen:\n" +"- Wählen Sie 'Ja', um eine Verbindung mit dem Internet herzustellen und die Datei herunterzuladen\n" +"- Wählen Sie 'Nein', um den Vorgang abzubrechen\n" "\n" "Hinweis: Die Datei wird ins Programmverzeichnis heruntergeladen und bei Bedarf wiederverwendet." #. • MSG_338 msgid "Revoked UEFI bootloader detected" -msgstr "Zurückgezogenes UEFI Startprogramm erkannt" +msgstr "Zurückgezogenes UEFI-Startprogramm erkannt" #. • MSG_339 msgid "" @@ -1869,10 +1869,10 @@ msgid "" "- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\n" "- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning." msgstr "" -"Rufus hat erkannt, dass das gewählte ISO-Image ein UEFI-Startprogramm enthält, dass zurückgezogen wurde und das führt zu %s, wenn das UEFI-System aktuell ist und Secure Boot aktiv ist.\n" +"Rufus hat erkannt, dass das gewählte ISO-Image ein UEFI-Startprogramm enthält, das zurückgezogen wurde. Das führt zu %s, wenn das UEFI-System aktuell ist und Secure Boot aktiv ist.\n" "\n" "- Wenn Sie das ISO-Image aus einer unzuverlässigen Quelle haben, sollten Sie in Betracht ziehen, dass es UEFI-Schadcode enthält und es deshalb nicht verwenden.\n" -"- Wenn Sie es aus einer vertrauenswürdigen Quelle haben, sollten Sie versuchen eine aktuellere Version zu bekommen, die dieses problem nicht hat." +"- Wenn Sie es aus einer vertrauenswürdigen Quelle haben, sollten Sie versuchen, eine aktuellere Version zu bekommen, die dieses Problem nicht hat." #. • MSG_340 msgid "a \"Security Violation\" screen" @@ -1880,19 +1880,19 @@ msgstr "ein Bildschirm \"Sicherheitsverletzung\"" #. • MSG_341 msgid "a Windows Recovery Screen (BSOD) with '%s'" -msgstr "ein Windows Wiederherstellung-Bildschirm (BSOD) mit '%s'" +msgstr "ein Windows-Wiederherstellungsbildschirm (BSOD) mit '%s'" #. • MSG_342 msgid "Compressed VHDX Image" -msgstr "Komprimiertes VHDX Image" +msgstr "Komprimiertes VHDX-Image" #. • MSG_343 msgid "Uncompressed VHD Image" -msgstr "Unkomprimiertes VHD Image" +msgstr "Unkomprimiertes VHD-Image" #. • MSG_344 msgid "Full Flash Update Image" -msgstr "Full Flash Update Image" +msgstr "Vollständiges Flash-Update-Image" #. • MSG_345 msgid "" @@ -1901,8 +1901,8 @@ msgid "" "- Select 'No' to cancel the operation" msgstr "" "Einige weitere Daten müssen von Microsoft heruntergeladen werden, um diese Funktion zu verwenden:\n" -"- 'Ja' um eine Verbindung mit dem Internet herzustellen und diese herunterzuladen\n" -"- 'Nein' um den Vorgang abzubrechen" +"- Wählen Sie 'Ja', um eine Verbindung mit dem Internet herzustellen und diese herunterzuladen\n" +"- Wählen Sie 'Nein', um den Vorgang abzubrechen" #. • MSG_346 msgid "Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)" @@ -1910,11 +1910,11 @@ msgstr "Windows im S-Modus (nicht kompatibel mit Online Konto-Umgehung)" #. • MSG_347 msgid "Expert Mode" -msgstr "Experten-Modus" +msgstr "Expertenmodus" #. • MSG_348 msgid "Extracting archive files: %s" -msgstr "Archiv-Datei extrahieren: %s" +msgstr "Archivdatei extrahieren: %s" #. • MSG_349 msgid "Use Rufus MBR" @@ -1924,7 +1924,7 @@ msgstr "Rufus MBR verwenden" #. #. The following messages are for the Windows Store listing only and are not used by the application msgid "Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc." -msgstr "Rufus ist ein Werkzeug, welches dabei hilft, bootfähige USB-Laufwerke zu erstellen, wie beispielweise USB-Keys, Speichersticks usw." +msgstr "Rufus ist ein Werkzeug, das beim Formatieren und Erstellen bootfähiger USB-Flash-Laufwerke wie USB-Sticks, Speichersticks usw. hilft." #. • MSG_901 msgid "Official site: %s" @@ -1967,7 +1967,7 @@ msgstr "FreeDOS-bootfähige USB-Laufwerke erstellen" #. • MSG_912 msgid "Create bootable drives from bootable ISOs (Windows, Linux, etc.)" -msgstr "Erstellen bootfähiger Laufwerke aus bootfähigen ISOs (Windows, Linux, etc.)" +msgstr "Erstellen bootfähiger Laufwerke aus bootfähigen ISOs (Windows, Linux etc.)" #. • MSG_913 msgid "Create bootable drives from bootable disk images, including compressed ones" @@ -1979,7 +1979,7 @@ msgstr "Erstellen von BIOS- oder UEFI-bootfähigen Laufwerken, einschließlich U #. • MSG_915 msgid "Create 'Windows To Go' drives" -msgstr "Erstellen von \"Windows To Go\"-Laufwerken" +msgstr "Erstellen von 'Windows To Go'-Laufwerken" #. • MSG_916 msgid "Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot" @@ -1995,7 +1995,7 @@ msgstr "VHD/DD-Images des ausgewählten Laufwerks erstellen" #. • MSG_919 msgid "Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image" -msgstr "Berechnung von MD5-, SHA-1-, SHA-256- und SHA-512-Prüfsummen für das ausgewählte Bild" +msgstr "Berechnung von MD5-, SHA-1-, SHA-256- und SHA-512-Prüfsummen für das ausgewählte Image" #. • MSG_920 msgid "Perform bad blocks checks, including detection of \"fake\" flash drives" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index ffd85620..eedab00c 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -140,7 +140,7 @@ t MSG_022 "MB" t MSG_023 "GB" # *Short* version of the terabyte size suffix t MSG_024 "TB" -# *Short* version of the pentabyte size suffix +# *Short* version of the petabyte size suffix t MSG_025 "PB" # We use two different messages with the same translation for convenience t MSG_026 "bytes" @@ -319,7 +319,7 @@ t MSG_123 "Persistent partition size" # It is okay to use "No partition" or "None" or "Deactivated" to indicate that a persistent partition will not be # created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width). t MSG_124 "No persistence" -# Tooltips used for the peristence size slider and edit control +# Tooltips used for the persistence size slider and edit control t MSG_125 "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." t MSG_126 "Set the partition size units." t MSG_127 "Do not show this message again" @@ -617,7 +617,6 @@ t MSG_354 "Rufus has found an updated version of the DBX files used to perform U "- Select 'Yes' to connect to the Internet and download this content\n" "- Select 'No' to cancel the operation\n\n" "Note: The files will be downloaded in the application's directory and will be reused automatically if present." -t MSG_355 "ISO Image" # The following messages are for the Windows Store listing only and are not used by the application t MSG_900 "Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc." t MSG_901 "Official site: %s" @@ -5016,7 +5015,7 @@ t MSG_125 "Größe der persistenten Partition des Live-USB-Systems. Eine Größe t MSG_126 "Einheit der Partitionsgröße festlegen." t MSG_127 "Diese Nachricht nicht mehr anzeigen" t MSG_128 "Wichtiger Hinweis zu %s" -t MSG_129 "Sie haben gerade ein Medium erstellt, das den UEFI:NTFS-Bootloader verwendet. Bitte denken Sie daran, dass Sie zum Starten dieses Mediums SECURE BOOT DEAKTIVIEREN müssen.\nNach dem Abschluss des Vorgangs sollten Sie SECURE BOOT wieder aktivieren.\nWeitere Informationen, warum dies notwendig ist, finden Sie über die Schaltfläche \"Weitere Informationen\"." +t MSG_129 "Sie haben gerade ein Medium erstellt, welches das UEFI:NTFS-Startprogramm verwendet. Bitte denken Sie daran, dass Sie zum Starten dieses Mediums SECURE BOOT DEAKTIVIEREN müssen.\nNach dem Abschluss des Vorgangs sollten Sie SECURE BOOT wieder aktivieren.\nWeitere Informationen, warum dies notwendig ist, finden Sie über die Schaltfläche \"Weitere Informationen\"." t MSG_130 "Windows-Image auswählen" t MSG_131 "Dieses ISO-Image enthält mehrere Windows-Images.\nBitte wählen Sie das Image aus, das Sie für diese Installation verwenden möchten:" t MSG_132 "Ein anderer Prozess bzw. ein anderes Programm verwendet das Laufwerk gerade. Wollen Sie es trotzdem formatieren?" @@ -5049,8 +5048,8 @@ t MSG_162 "Wenn nicht aktiviert, wird die \"langsame\" Formatierung verwendet" t MSG_163 "Methode, mit der das Laufwerk partitioniert wird" t MSG_164 "Methode, um das Laufwerk startfähig zu machen" t MSG_165 "Image-Datei oder Download auswählen..." -t MSG_166 "Wählen Sie diese Option, um die Anzeige internationaler Bezeichnungen zu ermöglichen und ein Gerätesymbol zu erzeugen (autorun.inf)" -t MSG_167 "Ein UEFI Startprogramm installieren, das eine MD5Sum Dateiüberprüfung auf dem Datenträger durchführt" +t MSG_166 "Wählen Sie diese Option, um die Anzeige internationaler Bezeichnungen zu ermöglichen und ein Gerätesymbol zu erzeugen (autorun.inf)." +t MSG_167 "Ein UEFI-Startprogramm installieren, das eine MD5Sum-Dateiüberprüfung auf dem Datenträger durchführt" t MSG_169 "Eine zusätzliche versteckte Partition erzeugen und die Partitionsgrenzen ausrichten.\nDas kann die Starterkennung für ältere BIOSe verbessern." t MSG_170 "Erkennung von externen USB-Festplatten aktivieren. VERWENDUNG AUF EIGENES RISIKO!" t MSG_171 "Formatierung starten.\nAlle Daten auf dem Ziellaufwerk werden GELÖSCHT!" @@ -5077,7 +5076,7 @@ t MSG_192 "Lesen durchgeführt" t MSG_193 "%s heruntergeladen" t MSG_194 "%s konnte nicht heruntergeladen werden" t MSG_195 "Embedded-Version der %s Datei(en) verwenden" -t MSG_196 "WICHTIG: DIESES LAUFWERK HAT EINE NICHT STANDARDISIERTE SEKTORGRÖSSE!\n\nHerkömmliche Laufwerke nutzen eine Sektorgröße von 512 Byte, aber dieses Laufwerk nutzt %d Byte. Höchstwahrscheinlich können Sie von diesem Laufwerk NICHT starten.\nRufus kann versuchen, ein startfähiges Laufwerk zu erstellen, aber es gibt KEINE GARANTIE, dass es funktionieren wird." +t MSG_196 "WICHTIG: DIESES LAUFWERK HAT EINE NICHT STANDARDISIERTE SEKTORGRÖẞE!\n\nHerkömmliche Laufwerke nutzen eine Sektorgröße von 512 Byte, aber dieses Laufwerk nutzt %d Byte. Höchstwahrscheinlich können Sie von diesem Laufwerk NICHT starten.\nRufus kann versuchen, ein startfähiges Laufwerk zu erstellen, aber es gibt KEINE GARANTIE, dass es funktionieren wird." t MSG_197 "Nicht standardisierte Sektorgröße erkannt" t MSG_198 "'Windows To Go' kann nur auf ein GPT-partitioniertes Laufwerk installiert werden, wenn das FIXED-Attribut gesetzt ist. Das aktuelle Laufwerk hat dieses nicht." t MSG_199 "Diese Funktion ist auf dieser Plattform nicht verfügbar." @@ -5128,7 +5127,7 @@ t MSG_244 "Update: Keine Verbindung zum Internet" t MSG_245 "Update: Versionsinformationen können nicht ermittelt werden" t MSG_246 "Eine neue Version von Rufus ist verfügbar!" t MSG_247 "Es wurde keine neue Version von Rufus gefunden" -t MSG_248 "Anwendungeinstellungen in der Registrierdatenbank erfolgreich gelöscht" +t MSG_248 "Anwendungseinstellungen in der Registrierdatenbank erfolgreich gelöscht" t MSG_249 "Fehler beim Löschen der Anwendungseinstellungen in der Registrierdatenbank" t MSG_250 "%s aktiviert" t MSG_251 "%s deaktiviert" @@ -5190,8 +5189,8 @@ t MSG_306 "Laufwerk mit Nullen überschreiben (schnell): %s" t MSG_307 "Der Vorgang nimmt einige Zeit in Anspruch" t MSG_308 "VHD-Erkennung" t MSG_309 "Archivdatei" -t MSG_310 "Das ausgewählte ISO-Image verwendet UEFI und ist klein genug, um auf eine EFI System-Partition (ESP) geschrieben zu werden. Es auf eine ESP- anstelle einer normalen Partition zu schrieben, kann für bestimmte Installationsarten vorteilhaft sein.\n\nBitte wählen Sie einen Modus aus:" -t MSG_311 "Verwende %s (Hauptfenster der Anwendung) zum aktivieren." +t MSG_310 "Das ausgewählte ISO-Image verwendet UEFI und ist klein genug, um auf eine EFI-Systempartition (ESP) geschrieben zu werden. Es auf eine ESP anstelle einer normalen Partition zu schreiben, die die gesamte Festplatte belegt, kann für bestimmte Installationsarten vorteilhaft sein.\n\nBitte wählen Sie einen Modus aus:" +t MSG_311 "Verwende %s (Hauptfenster der Anwendung) zum Aktivieren." t MSG_312 "Zusätzliche Prüfsummen (SHA512)" t MSG_313 "Als VHD speichern" t MSG_314 "Prüfsumme des Images berechnen" @@ -5201,47 +5200,48 @@ t MSG_317 "Disk-ID" t MSG_318 "Standardmäßige Thread-Priorität: %d" t MSG_319 "Boot-Markierung ignorieren" t MSG_320 "Liste der Partitionen aktualisieren (%s)..." -t MSG_321 "Das ausgewählte Image ist vom Typ ISOHybrid, aber der Ersteller hat es nicht mit dem ISO/Datei Kopier-Modus kompatibel gemacht.\nDeswegen wird der DD-Schreibmodus verwendet." +t MSG_321 "Das ausgewählte Image ist vom Typ ISOHybrid, aber der Ersteller hat es nicht mit dem ISO/Dateikopiermodus kompatibel gemacht.\nDeswegen wird der DD-Schreibmodus verwendet." t MSG_322 "'%' kann nicht geöffnet/gelesen werden" -t MSG_325 "Windows Anpassungen anwenden: %s" +t MSG_325 "Windows-Anpassungen anwenden: %s" t MSG_326 "Benutzereinstellungen anwenden..." -t MSG_327 "Windows Benutzererfahrung" +t MSG_327 "Windows-Benutzererfahrung" t MSG_328 "Windows-Installation anpassen?" t MSG_329 "Anforderung für 4GB+ RAM, Secure Boot und TPM 2.0 entfernen" -t MSG_330 "Anforderung für Online Microsoft Konto entfernen" +t MSG_330 "Anforderung für Online-Microsoft-Konto entfernen" t MSG_331 "Datenerfassung deaktivieren (Fragen zum Datenschutz überspringen)" t MSG_332 "Verhindern, dass Windows To Go auf interne Laufwerke zugreifen kann" t MSG_333 "Ein lokales Benutzerkonto erstellen:" t MSG_334 "Regionale Optionen auf die gleichen Werte wie die dieses Benutzers setzen" t MSG_335 "Deaktivieren der automatischen BitLocker-Laufwerksverschlüsselung" t MSG_336 "Dauerhaftes Protokoll" -t MSG_337 "Eine zusätzliche Datei ('%s') muss von Microsoft heruntergeladen werden um diese Funktion zu nutzen:\n- 'Ja' um eine Verbindung mit dem Internet herzustellen und die Datei herunterzuladen\n- 'Nein' um den Vorgang abzubrechen\n\nHinweis: Die Datei wird ins Programmverzeichnis heruntergeladen und bei Bedarf wiederverwendet." -t MSG_338 "Zurückgezogenes UEFI Startprogramm erkannt" -t MSG_339 "Rufus hat erkannt, dass das gewählte ISO-Image ein UEFI-Startprogramm enthält, dass zurückgezogen wurde und das führt zu %s, wenn das UEFI-System aktuell ist und Secure Boot aktiv ist.\n\n- Wenn Sie das ISO-Image aus einer unzuverlässigen Quelle haben, sollten Sie in Betracht ziehen, dass es UEFI-Schadcode enthält und es deshalb nicht verwenden.\n- Wenn Sie es aus einer vertrauenswürdigen Quelle haben, sollten Sie versuchen eine aktuellere Version zu bekommen, die dieses problem nicht hat." +t MSG_337 "Eine zusätzliche Datei ('%s') muss von Microsoft heruntergeladen werden, um diese Funktion zu nutzen:\n- Wählen Sie 'Ja', um eine Verbindung mit dem Internet herzustellen und die Datei herunterzuladen\n- Wählen Sie 'Nein', um den Vorgang abzubrechen\n\nHinweis: Die Datei wird ins Programmverzeichnis heruntergeladen und bei Bedarf wiederverwendet." +t MSG_338 "Zurückgezogenes UEFI-Startprogramm erkannt" +t MSG_339 "Rufus hat erkannt, dass das gewählte ISO-Image ein UEFI-Startprogramm enthält, das zurückgezogen wurde. Das führt zu %s, wenn das UEFI-System aktuell ist und Secure Boot aktiv ist.\n\n- Wenn Sie das ISO-Image aus einer unzuverlässigen Quelle haben, sollten Sie in Betracht ziehen, dass es UEFI-Schadcode enthält und es deshalb nicht verwenden.\n- Wenn Sie es aus einer vertrauenswürdigen Quelle haben, sollten Sie versuchen, eine aktuellere Version zu bekommen, die dieses Problem nicht hat." t MSG_340 "ein Bildschirm \"Sicherheitsverletzung\"" -t MSG_341 "ein Windows Wiederherstellung-Bildschirm (BSOD) mit '%s'" -t MSG_342 "Komprimiertes VHDX Image" -t MSG_343 "Unkomprimiertes VHD Image" -t MSG_345 "Einige weitere Daten müssen von Microsoft heruntergeladen werden, um diese Funktion zu verwenden:\n- 'Ja' um eine Verbindung mit dem Internet herzustellen und diese herunterzuladen\n- 'Nein' um den Vorgang abzubrechen" +t MSG_341 "ein Windows-Wiederherstellungsbildschirm (BSOD) mit '%s'" +t MSG_342 "Komprimiertes VHDX-Image" +t MSG_343 "Unkomprimiertes VHD-Image" +t MSG_344 "Vollständiges Flash-Update-Image" +t MSG_345 "Einige weitere Daten müssen von Microsoft heruntergeladen werden, um diese Funktion zu verwenden:\n- Wählen Sie 'Ja', um eine Verbindung mit dem Internet herzustellen und diese herunterzuladen\n- Wählen Sie 'Nein', um den Vorgang abzubrechen" t MSG_346 "Windows im S-Modus (nicht kompatibel mit Online Konto-Umgehung)" -t MSG_347 "Experten-Modus" -t MSG_348 "Archiv-Datei extrahieren: %s" +t MSG_347 "Expertenmodus" +t MSG_348 "Archivdatei extrahieren: %s" t MSG_349 "Rufus MBR verwenden" -t MSG_900 "Rufus ist ein Werkzeug, welches dabei hilft, bootfähige USB-Laufwerke zu erstellen, wie beispielweise USB-Keys, Speichersticks usw." +t MSG_900 "Rufus ist ein Werkzeug, das beim Formatieren und Erstellen bootfähiger USB-Flash-Laufwerke wie USB-Sticks, Speichersticks usw. hilft." t MSG_901 "Offizielle Website: %s" t MSG_902 "Quellcode: %s" t MSG_903 "Änderungsprotokoll: %s" t MSG_904 "Diese Anwendung ist unter den Bedingungen der GNU Public License (GPL) Version 3 lizenziert.\nSiehe https://www.gnu.org/licenses/gpl-3.0.de.html für Details." t MSG_910 "Formatieren von USB, Flash-Karte und virtuellen Laufwerken in FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" t MSG_911 "FreeDOS-bootfähige USB-Laufwerke erstellen" -t MSG_912 "Erstellen bootfähiger Laufwerke aus bootfähigen ISOs (Windows, Linux, etc.)" +t MSG_912 "Erstellen bootfähiger Laufwerke aus bootfähigen ISOs (Windows, Linux etc.)" t MSG_913 "Erstellen bootfähiger Laufwerke aus bootfähigen Festplatten-Images, einschließlich komprimierter Images" t MSG_914 "Erstellen von BIOS- oder UEFI-bootfähigen Laufwerken, einschließlich UEFI-bootfähigem NTFS" -t MSG_915 "Erstellen von \"Windows To Go\"-Laufwerken" +t MSG_915 "Erstellen von 'Windows To Go'-Laufwerken" t MSG_916 "Erstellen von Windows 11-Installationslaufwerken für PCs ohne TPM oder Secure Boot" t MSG_917 "Persistente Linux-Partitionen erstellen" t MSG_918 "VHD/DD-Images des ausgewählten Laufwerks erstellen" -t MSG_919 "Berechnung von MD5-, SHA-1-, SHA-256- und SHA-512-Prüfsummen für das ausgewählte Bild" +t MSG_919 "Berechnung von MD5-, SHA-1-, SHA-256- und SHA-512-Prüfsummen für das ausgewählte Image" t MSG_920 "Durchführung von Prüfungen auf fehlerhafte Blöcke, einschließlich der Erkennung von \"gefälschten\" Flash-Laufwerken" t MSG_921 "Offizielle Microsoft Windows-ISOs herunterladen" t MSG_922 "UEFI-Shell-ISOs herunterladen" diff --git a/src/rufus.rc b/src/rufus.rc index a82c6c38..6d672ade 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.12.2294" +CAPTION "Rufus 4.12.2295" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2294,0 - PRODUCTVERSION 4,12,2294,0 + FILEVERSION 4,12,2295,0 + PRODUCTVERSION 4,12,2295,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2294" + VALUE "FileVersion", "4.12.2295" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2294" + VALUE "ProductVersion", "4.12.2295" END END BLOCK "VarFileInfo" From c4d6a00c283098d266af2768781cc7d026f6bfe9 Mon Sep 17 00:00:00 2001 From: Valdemar <54585769+Hollicsh@users.noreply.github.com> Date: Mon, 10 Nov 2025 23:17:33 +0000 Subject: [PATCH 105/192] [loc] fix typos in Russian translation * Closes #2859. --- res/loc/po/ru-RU.po | 565 ++++++++++++++------------------------------ res/loc/rufus.loc | 25 +- src/rufus.rc | 10 +- 3 files changed, 192 insertions(+), 408 deletions(-) diff --git a/res/loc/po/ru-RU.po b/res/loc/po/ru-RU.po index d3a3e80c..8861b865 100644 --- a/res/loc/po/ru-RU.po +++ b/res/loc/po/ru-RU.po @@ -1,11 +1,11 @@ msgid "" msgstr "" -"Project-Id-Version: 3.22\n" +"Project-Id-Version: 4.5\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2023-10-19 09:51+0300\n" -"PO-Revision-Date: 2024-04-26 02:06+0300\n" -"Last-Translator: Dmitry Yerokhin <erodim@mail.ru>\n" -"Language-Team: LANGUAGE <LL@li.org>\n" +"POT-Creation-Date: 2025-11-12 17:40+0000\n" +"PO-Revision-Date: 2025-11-12 17:42+0000\n" +"Last-Translator: \n" +"Language-Team: \n" "Language: ru_RU\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Russian (Русский)\n" "X-Rufus-LCID: 0x0419, 0x0819\n" -"X-Generator: Poedit 1.5.7\n" +"X-Generator: Poedit 3.8\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -56,9 +56,7 @@ msgstr "Добавить исправления для старых BIOS" #. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION #. -#. 'MBR': See http://en.wikipedia.org/wiki/Master_boot_record -#. Rufus can install it's own custom MBR (the Rufus MBR), which also allows users to -#. specify a custom disk ID for the BIOS. The tooltip for this control is MSG_167. +#. It is acceptable to drop the "runtime" if you are running out of space msgid "Enable runtime UEFI media validation" msgstr "Проверка носителя UEFI во время выполнения" @@ -310,7 +308,7 @@ msgstr "ТБ" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "ПБ" @@ -421,8 +419,7 @@ msgstr "Неизвестная ошибка при форматировании. #. • MSG_052 msgid "Cannot use the selected file system for this media." -msgstr "" -"Для этого устройства невозможно использовать выбранную файловую систему." +msgstr "Для этого устройства невозможно использовать выбранную файловую систему." #. • MSG_053 msgid "Access to the device is denied." @@ -433,11 +430,8 @@ msgid "Media is write protected." msgstr "Носитель данных защищён от записи." #. • MSG_055 -msgid "" -"The device is in use by another process. Please close any other process that " -"may be accessing the device." -msgstr "" -"Это устройство используется другим процессом. Сначала завершите процесс." +msgid "The device is in use by another process. Please close any other process that may be accessing the device." +msgstr "Это устройство используется другим процессом. Сначала завершите процесс." #. • MSG_056 msgid "Quick format is not available for this device." @@ -484,12 +478,8 @@ msgid "Installation failure" msgstr "Ошибка установки" #. • MSG_067 -msgid "" -"Could not open media. It may be in use by another process. Please re-plug " -"the media and try again." -msgstr "" -"Невозможно открыть носитель информации. Возможно, он используется другим " -"процессом. Извлеките носитель информации и вставьте его вновь." +msgid "Could not open media. It may be in use by another process. Please re-plug the media and try again." +msgstr "Невозможно открыть носитель информации. Возможно, он используется другим процессом. Извлеките носитель информации и вставьте его вновь." #. • MSG_068 msgid "Could not partition drive." @@ -543,35 +533,25 @@ msgstr "Устройство не готово." #. • MSG_080 msgid "" -"Rufus detected that Windows is still flushing its internal buffers onto the " -"USB device.\n" +"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\n" "\n" -"Depending on the speed of your USB device, this operation may take a long " -"time to complete, especially for large files.\n" +"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\n" "\n" -"We recommend that you let Windows finish, to avoid corruption. But if you " -"grow tired of waiting, you can just unplug the device..." +"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device..." msgstr "" -"Rufus обнаружил, что Windows всё ещё очищает внутренний буфер USB-" -"устройства.\n" +"Rufus обнаружил, что Windows всё ещё очищает внутренний буфер USB-устройства.\n" "\n" -"В зависимости от скорости USB-устройства, эта операция может занять много " -"времени, особенно для больших файлов.\n" +"В зависимости от скорости USB-устройства, эта операция может занять много времени, особенно для больших файлов.\n" "\n" -"Чтобы избежать повреждения устройства, дождитесь, пока Windows закончит. Но " -"если вам надоест ждать, можете просто отключить устройство..." +"Чтобы избежать повреждения устройства, дождитесь, пока Windows закончит. Но если Вам надоест ждать, можете просто отключить устройство..." #. • MSG_081 msgid "Unsupported image" msgstr "Неподдерживаемый образ" #. • MSG_082 -msgid "" -"This image is either non-bootable, or it uses a boot or compression method " -"that is not supported by Rufus..." -msgstr "" -"Образ либо незагрузочный, либо использует метод загрузки или сжатия, не " -"поддерживаемый Rufus." +msgid "This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus..." +msgstr "Образ либо незагрузочный, либо использует метод загрузки или сжатия, не поддерживаемый Rufus." #. • MSG_083 msgid "Replace %s?" @@ -587,8 +567,7 @@ msgid "" "- Choose 'No' to leave the existing ISO file unmodified\n" "If you don't know what to do, you should select 'Yes'.\n" "\n" -"Note: The new file will be downloaded in the current directory and once a " -"'%s' exists there, it will be reused automatically." +"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically." msgstr "" "Образ ISO использует устаревшую версию '%s'.\n" "Загрузочные меню могут отображаться неправильно.\n" @@ -598,8 +577,7 @@ msgstr "" "- Выберите 'Нет', чтобы не изменять образ ISO\n" "Если вы не знаете, что делать, то выберите 'Да'.\n" "\n" -"Файл загрузится в текущую папку, а если в ней есть '%s', то он будет " -"автоматически заменён." +"Файл загрузится в текущую папку, а если в ней есть '%s', то он будет автоматически заменён." #. • MSG_085 msgid "Downloading %s" @@ -633,12 +611,8 @@ msgid "Unsupported ISO" msgstr "Неподдерживаемый образ ISO" #. • MSG_091 -msgid "" -"When using UEFI Target Type, only EFI bootable ISO images are supported. " -"Please select an EFI bootable ISO or set the Target Type to BIOS." -msgstr "" -"При использовании целевого типа UEFI поддерживаются только загрузочные " -"образы ISO. Выберите загрузочный образ EFI или измените целевой тип BIOS." +msgid "When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS." +msgstr "При использовании целевого типа UEFI поддерживаются только загрузочные образы ISO. Выберите загрузочный образ EFI или измените целевой тип BIOS." #. • MSG_092 msgid "Unsupported filesystem" @@ -648,15 +622,11 @@ msgstr "Неподдерживаемая файловая система" msgid "" "IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\n" "\n" -"This may include partitions/volumes that aren't listed or even visible from " -"Windows. Should you wish to proceed, you are responsible for any data loss " -"on these partitions." +"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions." msgstr "" "ВАЖНО: НА ЭТОМ ДИСКЕ НЕСКОЛЬКО РАЗДЕЛОВ!!\n" "\n" -"Этот диск может содержать разделы/тома, которые отсутствуют в списке или " -"даже не видны в Windows. В случае продолжения вы несёте ответственность за " -"любую потерю данных на этих разделах." +"Этот диск может содержать разделы/тома, которые отсутствуют в списке или даже не видны в Windows. В случае продолжения Вы несёте ответственность за любую потерю данных на этих разделах." #. • MSG_094 msgid "Multiple partitions detected" @@ -667,12 +637,8 @@ msgid "DD Image" msgstr "DD-образ" #. • MSG_096 -msgid "" -"The file system currently selected can not be used with this type of ISO. " -"Please select a different file system or use a different ISO." -msgstr "" -"Выбранная файловая система не может использоваться с этим типом образа ISO. " -"Выберите другую файловую систему или другой образ ISO." +msgid "The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO." +msgstr "Выбранная файловая система не может использоваться с этим типом образа ISO. Выберите другую файловую систему или другой образ ISO." #. • MSG_097 msgid "'%s' can only be applied if the file system is NTFS." @@ -680,39 +646,25 @@ msgstr "'%s' может использоваться только с файло #. • MSG_098 msgid "" -"IMPORTANT: You are trying to install 'Windows To Go', but your target drive " -"doesn't have the 'FIXED' attribute. Because of this Windows will most likely " -"freeze during boot, as Microsoft hasn't designed it to work with drives that " -"instead have the 'REMOVABLE' attribute.\n" +"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\n" "\n" "Do you still want to proceed?\n" "\n" -"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only " -"be changed using custom tools from the drive manufacturer. However those " -"tools are ALMOST NEVER provided to the public..." +"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public..." msgstr "" -"ВАЖНО: Вы пытаетесь установить Windows To Go, но у целевого диска нет " -"атрибута 'FIXED' (несъёмный). Из-за этого Windows, скорее всего, зависнет " -"при загрузке, так как Windows To Go предназначена для работы только с " -"дисками с атрибутом 'REMOVABLE' (съёмный).\n" +"ВАЖНО: Вы пытаетесь установить Windows To Go, но у целевого диска нет атрибута 'FIXED' (несъёмный). Из-за этого Windows, скорее всего, зависнет при загрузке, так как Windows To Go предназначена для работы только с дисками с атрибутом 'REMOVABLE' (съёмный).\n" "\n" "Всё равно хотите продолжить?\n" "\n" -"* Атрибут 'FIXED/REMOVABLE' - это свойство оборудования. Его можно изменить " -"только с помощью специальных инструментов от производителя, которые ПОЧТИ " -"НИКОГДА не предоставляются общественности..." +"* Атрибут 'FIXED/REMOVABLE' - это свойство оборудования. Его можно изменить только с помощью специальных инструментов от производителя, которые ПОЧТИ НИКОГДА не предоставляются общественности..." #. • MSG_099 msgid "Filesystem limitation" msgstr "Ограничения файловой системы" #. • MSG_100 -msgid "" -"This ISO image contains a file larger than 4 GB, which is more than the " -"maximum size allowed for a FAT or FAT32 file system." -msgstr "" -"Этот образ ISO содержит файл размером более 4 ГБ, что превосходит " -"максимальный размер для файловой системы FAT или FAT32." +msgid "This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system." +msgstr "Этот образ ISO содержит файл размером более 4 ГБ, что превосходит максимальный размер для файловой системы FAT или FAT32." #. • MSG_101 msgid "Missing WIM support" @@ -720,15 +672,10 @@ msgstr "Отсутствует поддержка WIM" #. • MSG_102 msgid "" -"Your platform cannot extract files from WIM archives. WIM extraction is " -"required to create EFI bootable Windows 7 and Windows Vista USB drives. You " -"can fix that by installing a recent version of 7-Zip.\n" +"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\n" "Do you want to visit the 7-zip download page?" msgstr "" -"Ваша система не может извлекать файлы из архивов WIM. Распаковка таких " -"архивов необходима для создания загрузочных USB-накопителей EFI для Windows " -"7 и Windows Vista. Чтобы решить эту проблему, установите новейшую версию 7-" -"Zip.\n" +"Ваша система не может извлекать файлы из архивов WIM. Распаковка таких архивов необходима для создания загрузочных USB-накопителей EFI для Windows 7 и Windows Vista. Чтобы решить эту проблему, установите новейшую версию 7-Zip.\n" "Открыть страницу загрузки 7-Zip?" #. • MSG_103 @@ -741,26 +688,22 @@ msgstr "Загрузить %s?" #. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)" msgid "" "%s or later requires a '%s' file to be installed.\n" -"Because this file is more than 100 KB in size, and always present on %s ISO " -"images, it is not embedded in Rufus.\n" +"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\n" "\n" "Rufus can download the missing file for you:\n" "- Select 'Yes' to connect to the internet and download the file\n" "- Select 'No' if you want to manually copy this file on the drive later\n" "\n" -"Note: The file will be downloaded in the current directory and once a '%s' " -"exists there, it will be reused automatically." +"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically." msgstr "" "%s или новее требует наличия файла '%s'.\n" -"Поскольку размер этого файла больше 100 КБ, и он всегда присутствует в ISO-" -"образах %s, он не встроен в Rufus.\n" +"Поскольку размер этого файла больше 100 КБ, и он всегда присутствует в ISO-образах %s, он не встроен в Rufus.\n" "\n" "Rufus может скачать недостающий файл:\n" "- Выберите 'Да', если хотите скачать этот файл\n" "- Выберите 'Нет', если хотите скачать его вручную позже\n" "\n" -"* Файл будет скачан в текущую папку. Если в ней есть '%s', он будет " -"автоматически перезаписан." +"* Файл будет скачан в текущую папку. Если в ней есть '%s', он будет автоматически перезаписан." #. • MSG_105 msgid "" @@ -768,8 +711,7 @@ msgid "" "If you are sure you want to cancel, click YES. Otherwise, click NO." msgstr "" "При отмене устройство может оказаться в НЕРАБОЧЕМ состоянии.\n" -"Если вы уверены, что хотите отменить операцию, нажмите 'Да'. Иначе - нажмите " -"'Нет'." +"Если Вы уверены, что хотите отменить операцию, нажмите 'Да'. Иначе - нажмите 'Нет'." #. • MSG_106 msgid "Please select folder" @@ -805,15 +747,8 @@ msgstr "Несовместимый размер кластеров" #. • MSG_112 #. #. "%d:%02d" is a duration (mins:secs) -msgid "" -"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, " -"the estimated formatting duration is %d:%02d, during which the progress bar " -"will appear frozen. Please be patient!" -msgstr "" -"Форматирование больших томов UDF может занять много времени. При скоростях " -"USB 2.0 форматирование продлится примерно %d:%02d, в течение этого времени " -"индикатор хода операции будет казаться неработающим. Проявите терпение, " -"пожалуйста!" +msgid "Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!" +msgstr "Форматирование больших томов UDF может занять много времени. При скоростях USB 2.0 форматирование продлится примерно %d:%02d, в течение этого времени индикатор хода операции будет казаться неработающим. Проявите терпение, пожалуйста!" #. • MSG_113 msgid "Large UDF volume" @@ -821,28 +756,21 @@ msgstr "Большой UDF-том" #. • MSG_114 msgid "" -"This image uses Syslinux %s%s but this application only includes the " -"installation files for Syslinux %s%s.\n" +"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\n" "\n" -"As new versions of Syslinux are not compatible with one another, and it " -"wouldn't be possible for Rufus to include them all, two additional files " -"must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\n" +"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\n" "- Select 'Yes' to connect to the Internet and download these files\n" "- Select 'No' to cancel the operation\n" "\n" -"Note: The files will be downloaded in the current application directory and " -"will be reused automatically if present." +"Note: The files will be downloaded in the current application directory and will be reused automatically if present." msgstr "" -"Этот образ использует Syslinux %s%s, но в данном приложении есть только " -"установочные файлы для Syslinux %s%s.\n" +"Этот образ использует Syslinux %s%s, но в данном приложении есть только установочные файлы для Syslinux %s%s.\n" "\n" -"Так как версии Syslinux несовместимы друг с другом, дополнительные файлы " -"(ldlinux.sys and ldlinux.bss) нужно загрузить из Интернета:\n" +"Так как версии Syslinux несовместимы друг с другом, дополнительные файлы (ldlinux.sys and ldlinux.bss) нужно загрузить из Интернета:\n" "- Выберите 'Да', чтобы скачать файлы из Интернета\n" "- Выберите 'Нет', чтобы отменить операцию\n" "\n" -"* Файлы загрузятся в текущую папку приложения, имеющиеся там одноимённые " -"файлы будут перезаписаны." +"* Файлы загрузятся в текущую папку приложения, имеющиеся там одноимённые файлы будут перезаписаны." #. • MSG_115 msgid "Download required" @@ -853,35 +781,23 @@ msgstr "Требуется загрузка из Интернета" #. You should be able to test this message with Super Grub2 Disk ISO: #. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB) msgid "" -"This image uses Grub %s but the application only includes the installation " -"files for Grub %s.\n" +"This image uses Grub %s but the application only includes the installation files for Grub %s.\n" "\n" -"As different versions of Grub may not be compatible with one another, and it " -"is not possible to include them all, Rufus will attempt to locate a version " -"of the Grub installation file ('core.img') that matches the one from your " -"image:\n" +"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\n" "- Select 'Yes' to connect to the Internet and attempt to download it\n" "- Select 'No' to use the default version from Rufus\n" "- Select 'Cancel' to abort the operation\n" "\n" -"Note: The file will be downloaded in the current application directory and " -"will be reused automatically if present. If no match can be found online, " -"then the default version will be used." +"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used." msgstr "" -"Этот образ использует загрузчик GRUB %s, но приложение включает только " -"установочные файлы для GRUB %s.\n" +"Этот образ использует загрузчик GRUB %s, но приложение включает только установочные файлы для GRUB %s.\n" "\n" -"Различные версии GRUB могут быть несовместимы друг с другом. Rufus " -"попытается найти нужную версию установочного файла GRUB (core.img), " -"соответствующую версии загрузчика вашего образа:\n" +"Различные версии GRUB могут быть несовместимы друг с другом. Rufus попытается найти нужную версию установочного файла GRUB (core.img), соответствующую версии загрузчика вашего образа:\n" "- Выберите 'Да', чтобы скачать установочный файл из Интернета\n" "- Выберите 'Нет', чтобы использовать версию по умолчанию из Rufus\n" "- Выберите 'Отмена', чтобы отменить операцию\n" "\n" -"* Файл загрузится в текущую папку приложения, если в ней уже есть " -"одноимённый файл, он будет автоматически перезаписан. Если нужную версию " -"установщика не удастся найти в Интернете, будет использоваться версия по " -"умолчанию." +"* Файл загрузится в текущую папку приложения, если в ней уже есть одноимённый файл, он будет автоматически перезаписан. Если нужную версию установщика не удастся найти в Интернете, будет использоваться версия по умолчанию." #. • MSG_117 msgid "Standard Windows installation" @@ -893,7 +809,7 @@ msgstr "Стандартная установка Windows" #. http://en.wikipedia.org/wiki/Windows_To_Go in your language. #. Otherwise, you may add a parenthesis eg. "Windows To Go (<hint at what it does>)" msgid "Windows To Go" -msgstr "Windows To Go" +msgstr "" #. • MSG_119 msgid "advanced drive properties" @@ -930,13 +846,9 @@ msgstr "Без раздела" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control -msgid "" -"Set the size of the persistent partition for live USB media. Setting the " -"size to 0 disables the persistent partition." -msgstr "" -"Установите размер постоянного раздела для live-носителя USB. 0 - отключить " -"постоянный раздел." +#. Tooltips used for the persistence size slider and edit control +msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." +msgstr "Установите размер постоянного раздела для live-носителя USB. 0 - отключить постоянный раздел." #. • MSG_126 msgid "Set the partition size units." @@ -952,13 +864,10 @@ msgstr "Важное примечание о %s" #. • MSG_129 msgid "" -"You have just created a media that uses the UEFI:NTFS bootloader. Please " -"remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\n" -"For details on why this is necessary, see the 'More Information' button " -"below." +"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\n" +"For details on why this is necessary, see the 'More Information' button below." msgstr "" -"Вы только что создали носитель с загрузчиком UEFI:NTFS. Учтите, что для " -"загрузки этого носителя НУЖНО ОТКЛЮЧИТЬ БЕЗОПАСНУЮ ЗАГРУЗКУ.\n" +"Вы только что создали носитель с загрузчиком UEFI:NTFS. Учтите, что для загрузки этого носителя НУЖНО ОТКЛЮЧИТЬ БЕЗОПАСНУЮ ЗАГРУЗКУ.\n" "Чтобы узнать, почему это необходимо, нажмите кнопку 'Ещё'." #. • MSG_130 @@ -971,51 +880,33 @@ msgid "" "Please select the image you wish to use for this installation:" msgstr "" "Этот файл ISO содержит несколько образов Windows.\n" -"Выберите образ, который вы хотите использовать для этой установки:" +"Выберите образ, который Вы хотите использовать для этой установки:" #. • MSG_132 -msgid "" -"Another program or process is accessing this drive. Do you want to format it " -"anyway?" -msgstr "" -"К этому диску обращается другая программа или процесс. Всё равно настаиваете " -"на форматировании?" +msgid "Another program or process is accessing this drive. Do you want to format it anyway?" +msgstr "К этому диску обращается другая программа или процесс. Всё равно настаиваете на форматировании?" #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media " -"based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" "\n" -"Because of a *MICROSOFT BUG*, this media will crash during Windows boot " -"(Blue Screen Of Death), unless you manually replace the file 'WppRecorder." -"sys' with a 1803 version.\n" +"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" -"Also note that the reason Rufus cannot automatically fix this for you is " -"that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally " -"embed a copy of the file in the application..." +"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Rufus обнаружил, что вы пытаетесь создать носитель Windows To Go на основе " -"ISO 1809.\n" +"Rufus обнаружил, что вы пытаетесь создать носитель Windows To Go на основе ISO 1809.\n" "\n" -"Из-за *ОШИБКИ MICROSOFT* этот носитель будет давать сбой при загрузке " -"Windows (BSOD), если вы вручную не замените файл WppRecorder.sys версией " -"1803.\n" +"Из-за *ОШИБКИ MICROSOFT* этот носитель будет давать сбой при загрузке Windows (BSOD), если вы вручную не замените файл WppRecorder.sys версией 1803.\n" "\n" -"Rufus не может это исправить автоматически, так как WppRecorder.sys - это " -"файл Microsoft, защищённый авторскими правами, поэтому мы не можем легально " -"встраивать в приложение его копию." +"Rufus не может это исправить автоматически, так как WppRecorder.sys - это файл Microsoft, защищённый авторскими правами, поэтому мы не можем легально встраивать в приложение его копию." #. • MSG_134 msgid "" -"Because MBR has been selected for the partition scheme, Rufus can only " -"create a partition up to 2 TB on this media, which will leave %s of disk " -"space unavailable.\n" +"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\n" "\n" "Are you sure you want to continue?" msgstr "" -"Поскольку для схемы разделов выбрана MBR, на этом носителе Rufus может " -"создать только раздел размером до 2 ТБ, а %s дискового пространства " -"останутся недоступными.\n" +"Поскольку для схемы разделов выбрана MBR, на этом носителе Rufus может создать только раздел размером до 2 ТБ, а %s дискового пространства останутся недоступными.\n" "\n" "Вы действительно хотите продолжить?" @@ -1056,12 +947,8 @@ msgid "Download using a browser" msgstr "Скачать в браузере" #. • MSG_144 -msgid "" -"Download of Windows ISOs is unavailable due to Microsoft having altered " -"their website to prevent it." -msgstr "" -"Microsoft временно заблокировала скачивание образов Windows из-за большого " -"количества загрузок." +msgid "Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it." +msgstr "Microsoft временно заблокировала скачивание образов Windows из-за большого количества загрузок." #. • MSG_145 msgid "PowerShell 3.0 or later is required to run this script." @@ -1080,32 +967,18 @@ msgid "Download ISO Image" msgstr "Загрузить образ ISO" #. • MSG_150 -msgid "" -"Type of computer you plan to use this bootable drive with. It is your " -"responsibility to determine whether your target is of BIOS or UEFI type " -"before you start creating the drive, as it may fail to boot otherwise." -msgstr "" -"Тип компьютера, с которым вы планируете использовать этот загрузочный диск. " -"Прежде чем создавать диск, вы должны определить, что используется в вашей " -"системе: BIOS или UEFI, иначе диск может не загрузиться." +msgid "Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise." +msgstr "Тип компьютера, с которым вы планируете использовать этот загрузочный диск. Прежде чем создавать диск, вы должны определить, что используется в вашей системе: BIOS или UEFI, иначе диск может не загрузиться." #. • MSG_151 #. #. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings. -msgid "" -"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also " -"known as 'Legacy Mode') under UEFI, and not in native UEFI mode." -msgstr "" -"'UEFI-CSM' означает, что устройство будет загружаться только в режиме " -"эмуляции BIOS (также называемом 'Legacy Mode') под UEFI, а не в режиме UEFI." +msgid "'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode." +msgstr "'UEFI-CSM' означает, что устройство будет загружаться только в режиме эмуляции BIOS (также называемом 'Legacy Mode') под UEFI, а не в режиме UEFI." #. • MSG_152 -msgid "" -"'non CSM' means that the device will only boot in native UEFI mode, and not " -"in BIOS emulation mode (also known as 'Legacy Mode')." -msgstr "" -"'non-CSM' означает, что устройство будет загружаться только в режиме UEFI, а " -"не в режиме эмуляции BIOS (также известном как 'Legacy Mode')." +msgid "'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode')." +msgstr "'non-CSM' означает, что устройство будет загружаться только в режиме UEFI, а не в режиме эмуляции BIOS (также известном как 'Legacy Mode')." #. • MSG_153 msgid "Test pattern: 0x%02X" @@ -1164,44 +1037,25 @@ msgid "Click to select or download an image..." msgstr "Нажмите, чтобы выбрать или загрузить образ..." #. • MSG_166 -msgid "" -"Check this box to allow the display of international labels and set a device " -"icon (creates an autorun.inf)" +msgid "Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)" msgstr "" -"Разрешить отображение меток с международными символами и задать значок " -"устройства\n" +"Разрешить отображение меток с международными символами и задать значок устройства\n" "(создаётся файл autorun.inf)" #. • MSG_167 -msgid "" -"Install a UEFI bootloader, that will perform MD5Sum file validation of the " -"media" +msgid "Install a UEFI bootloader, that will perform MD5Sum file validation of the media" msgstr "Установить загрузчик UEFI, который проверит файл MD5Sum на носителе" -#. • MSG_168 -msgid "" -"Try to masquerade first bootable USB drive (usually 0x80) as a different " -"disk.\n" -"This should only be necessary if you install Windows XP and have more than " -"one disk." -msgstr "" -"Попробуйте замаскировать первый загрузочный \n" -"USB-диск (обычно 0x80) как другой диск.\n" -"Это необходимо только для установки Windows XP,\n" -"если у вас несколько дисков." - #. • MSG_169 msgid "" "Create an extra hidden partition and try to align partitions boundaries.\n" "This can improve boot detection for older BIOSes." msgstr "" -"Создать дополнительный скрытый раздел и попробовать выровнять границы " -"разделов.\n" +"Создать дополнительный скрытый раздел и попробовать выровнять границы разделов.\n" "Это может улучшить обнаружение загрузчика в старых BIOS." #. • MSG_170 -msgid "" -"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!" +msgid "Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!" msgstr "" "Отображать внешние жёсткие диски USB.\n" "ИСПОЛЬЗУЙТЕ НА СВОЙ СТРАХ И РИСК!" @@ -1250,16 +1104,12 @@ msgid "Update Policy:" msgstr "Политика обновления:" #. • MSG_180 -msgid "" -"If you choose to allow this program to check for application updates, you " -"agree that the following information may be collected on our server(s):" -msgstr "" -"Разрешая проверку обновлений, вы соглашаетесь, что на наших серверах может " -"собираться следующая информация:" +msgid "If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):" +msgstr "Разрешая проверку обновлений, Вы соглашаетесь, что на наших серверах может собираться следующая информация:" #. • MSG_181 msgid "Your operating system's architecture and version" -msgstr "Версия и архитектура вашей операционной системы" +msgstr "Версия и архитектура Вашей операционной системы" #. • MSG_182 msgid "The version of the application you use" @@ -1270,14 +1120,8 @@ msgid "Your IP address" msgstr "Ваш IP-адрес" #. • MSG_184 -msgid "" -"For the purpose of generating private usage statistics, we may keep the " -"information collected, \\b for at most a year\\b0 . However, we will not " -"willingly disclose any of this individual data to third parties." -msgstr "" -"Для получения статистики использования программы мы можем хранить собранную " -"информацию \\b не более года\\b0 . Однако мы не будем добровольно раскрывать " -"какие-либо из этих персональных данных сторонним лицам." +msgid "For the purpose of generating private usage statistics, we may keep the information collected, \\b for at most a year\\b0 . However, we will not willingly disclose any of this individual data to third parties." +msgstr "Для получения статистики использования программы мы можем хранить собранную информацию \\b не более года\\b0 . Однако мы не будем добровольно раскрывать какие-либо из этих персональных данных сторонним лицам." #. • MSG_185 msgid "Update Process:" @@ -1285,13 +1129,10 @@ msgstr "Обновление:" #. • MSG_186 msgid "" -"Rufus does not install or run background services, therefore update checks " -"are performed only when the main application is running.\\line\n" +"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\line\n" "Internet access is of course required when checking for updates." msgstr "" -"Rufus не устанавливает и не запускает фоновые службы, поэтому проверка " -"наличия обновлений выполняется, только когда запущено основное приложение." -"\\line\n" +"Rufus не устанавливает и не запускает фоновые службы, поэтому проверка наличия обновлений выполняется, только когда запущено основное приложение.\\line\n" "Для проверки обновлений требуется доступ к Интернету." #. • MSG_187 @@ -1299,12 +1140,8 @@ msgid "Invalid image for selected boot option" msgstr "Неверный образ для выбранного варианта загрузки" #. • MSG_188 -msgid "" -"The current image doesn't match the boot option selected. Please use a " -"different image or choose a different boot option." -msgstr "" -"Текущий образ не соответствует выбранному варианту загрузки. Выберите другой " -"образ или другой вариант загрузки." +msgid "The current image doesn't match the boot option selected. Please use a different image or choose a different boot option." +msgstr "Текущий образ не соответствует выбранному варианту загрузки. Выберите другой образ или другой вариант загрузки." #. • MSG_189 msgid "This ISO image is not compatible with the selected filesystem" @@ -1344,32 +1181,21 @@ msgstr "Использовать встроенную версию %s файло msgid "" "IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\n" "\n" -"Conventional drives use a 512-byte sector size but this drive uses a %d-byte " -"one. In many cases, this means that you will NOT be able to boot from this " -"drive.\n" -"Rufus can try to create a bootable drive, but there is NO WARRANTY that it " -"will work." +"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\n" +"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work." msgstr "" "ВАЖНО: НА ЭТОМ ДИСКЕ СЕКТОРЫ НЕСТАНДАРТНОГО РАЗМЕРА!\n" "\n" -"Обычные накопители используют секторы размером 512 байт, а на этом диске они " -"%d-байтовые. Во многих случаях это означает, что вы НЕ СМОЖЕТЕ загрузиться с " -"этого диска.\n" -"Rufus попытается создать загрузочный диск, но БЕЗ ГАРАНТИИ, что он будет " -"работать." +"Обычные накопители используют секторы размером 512 байт, а на этом диске они %d-байтовые. Во многих случаях это означает, что Вы НЕ СМОЖЕТЕ загрузиться с этого диска.\n" +"Rufus попытается создать загрузочный диск, но БЕЗ ГАРАНТИИ, что он будет работать." #. • MSG_197 msgid "Nonstandard sector size detected" msgstr "Обнаружен нестандартный размер секторов" #. • MSG_198 -msgid "" -"'Windows To Go' can only be installed on a GPT partitioned drive if it has " -"the FIXED attribute set. The current drive was not detected as FIXED." -msgstr "" -"Windows To Go может быть установлена на диск с разделом GPT только в том " -"случае, если у диска есть атрибут FIXED (несъёмный). У выбранного диск " -"такого атрибута не обнаружено." +msgid "'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED." +msgstr "Windows To Go может быть установлена на диск с разделом GPT только в том случае, если у диска есть атрибут FIXED (несъёмный). У выбранного диска такого атрибута не обнаружено." #. • MSG_199 msgid "This feature is not available on this platform." @@ -1570,15 +1396,11 @@ msgstr "Удаление разделов (%s)..." #. #. This message has to do with the signature validation that Rufus uses when downloading an update. msgid "" -"The signature for the downloaded update can not be validated. This could " -"mean that your system is improperly configured for signature validation or " -"indicate a malicious download.\n" +"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\n" "\n" "The download will be deleted. Please check the log for more details." msgstr "" -"Невозможно проверить подпись загруженного обновления. Это может означать, " -"что ваша система неправильно настроена для проверки подписей, либо что было " -"загружено вредоносное ПО.\n" +"Невозможно проверить подпись загруженного обновления. Это может означать, что Ваша система неправильно настроена для проверки подписей, либо было загружено вредоносное ПО.\n" "\n" "Обновление будет удалено. См. подробности в файле-журнале." @@ -1728,21 +1550,15 @@ msgstr "Обнаружен образ %s" #. #. '%s' will be replaced with your translations for MSG_036 ("ISO Image") and MSG_095 ("DD Image") msgid "" -"The image you have selected is an 'ISOHybrid' image. This means it can be " -"written either in %s (file copy) mode or %s (disk image) mode.\n" -"Rufus recommends using %s mode, so that you always have full access to the " -"drive after writing it.\n" -"However, if you encounter issues during boot, you can try writing this image " -"again in %s mode.\n" +"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\n" +"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\n" +"However, if you encounter issues during boot, you can try writing this image again in %s mode.\n" "\n" "Please select the mode that you want to use to write this image:" msgstr "" -"Выбран образ ISOHybrid. Это означает, что его можно записать либо в %s " -"режиме копирования файлов, либо в %s режиме образа диска.\n" -"Для полного доступа к диску после записи рекомендуется использовать режим " -"%s.\n" -"Если возникают проблемы при загрузке, ещё раз попробуйте записать образ в " -"режиме %s.\n" +"Выбран образ ISOHybrid. Это означает, что его можно записать либо в %s режиме копирования файлов, либо в %s режиме образа диска.\n" +"Для полного доступа к диску после записи рекомендуется использовать режим %s.\n" +"Если возникают проблемы при загрузке, ещё раз попробуйте записать образ в режиме %s.\n" "\n" "Выберите режим записи этого образа:" @@ -1789,8 +1605,7 @@ msgstr "У загруженного файла отсутствует цифро #. • MSG_285 msgid "" "The downloaded executable is signed by '%s'.\n" -"This is not a signature we recognize and could indicate some form of " -"malicious activity...\n" +"This is not a signature we recognize and could indicate some form of malicious activity...\n" "Are you sure you want to run this file?" msgstr "" "Загруженный файл подписан '%s'.\n" @@ -1857,19 +1672,15 @@ msgstr "Обнаружен усечённый образ ISO" #. • MSG_298 msgid "" -"The ISO file you have selected does not match its declared size: %s of data " -"is missing!\n" +"The ISO file you have selected does not match its declared size: %s of data is missing!\n" "\n" -"If you obtained this file from the Internet, you should try to download a " -"new copy and verify that the MD5 or SHA checksums match the official ones.\n" +"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\n" "\n" "Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button." msgstr "" -"Выбранный образ ISO не соответствует заявленному размеру: %s данных " -"отсутствует!\n" +"Выбранный образ ISO не соответствует заявленному размеру: %s данных отсутствует!\n" "\n" -"Если вы скачали этот файл из Интернета, загрузите его снова и проверьте, " -"совпадают ли контрольные суммы MD5 или SHA.\n" +"Если Вы скачали этот файл из Интернета, загрузите его снова и проверьте, совпадают ли контрольные суммы MD5 или SHA.\n" "\n" "Чтобы вычислить MD5 или SHA в Rufus, нажмите кнопку (✓)." @@ -1879,18 +1690,13 @@ msgstr "Ошибка проверки временной метки" #. • MSG_300 msgid "" -"Rufus could not validate that the timestamp of the downloaded update is more " -"recent than the one for the current executable.\n" +"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\n" "\n" -"In order to prevent potential attack scenarios, the update process has been " -"aborted and the download will be deleted. Please check the log for more " -"details." +"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details." msgstr "" -"Rufus не смог подтвердить, что временная метка загруженного обновления более " -"поздняя, ​​чем дата текущего исполняемого файла.\n" +"Rufus не смог подтвердить, что временная метка загруженного обновления более поздняя, ​​чем дата текущего исполняемого файла.\n" "\n" -"Чтобы предотвратить возможную атаку, обновление было прервано, а загруженный " -"файл - удалён. См. подробности в файле-журнале." +"Чтобы предотвратить возможную атаку, обновление было прервано, а загруженный файл - удалён. См. подробности в файле-журнале." #. • MSG_301 msgid "Show application settings" @@ -1909,12 +1715,8 @@ msgid "Create a disk image of the selected device" msgstr "Создать образ диска выбранного устройства" #. • MSG_305 -msgid "" -"Use this option to indicate if you plan to install Windows to a different " -"disk, or if you want to run Windows directly from this drive (Windows To Go)." -msgstr "" -"Используйте эту опцию, если вы хотите установить Windows на другой диск или " -"запускать Windows прямо с этого диска (Windows To Go)." +msgid "Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go)." +msgstr "Используйте эту опцию, если Вы хотите установить Windows на другой диск или запускать Windows прямо с этого диска (Windows To Go)." #. • MSG_306 #. @@ -1937,17 +1739,11 @@ msgstr "Сжатый архив" #. • MSG_310 msgid "" -"The ISO you have selected uses UEFI and is small enough to be written as an " -"EFI System Partition (ESP). Writing to an ESP, instead of writing to a " -"generic data partition occupying the whole disk, can be preferable for some " -"types of installations.\n" +"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\n" "\n" "Please select the mode that you want to use to write this image:" msgstr "" -"Выбранный образ ISO использует UEFI и достаточно мал, чтобы его можно было " -"записать как системный раздел EFI (ESP). Запись в ESP вместо записи в общий " -"раздел данных, занимающий весь диск, может быть предпочтительнее для " -"некоторых типов установок.\n" +"Выбранный образ ISO использует UEFI и достаточно мал, чтобы его можно было записать как системный раздел EFI (ESP). Запись в ESP вместо записи в общий раздел данных, занимающий весь диск, может быть предпочтительнее для некоторых типов установок.\n" "\n" "Выберите режим записи этого образа:" @@ -1993,12 +1789,10 @@ msgstr "Обновление макета разделов (%s)..." #. • MSG_321 msgid "" -"The image you have selected is an ISOHybrid, but its creators have not made " -"it compatible with ISO/File copy mode.\n" +"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\n" "As a result, DD image writing mode will be enforced." msgstr "" -"Выбранный образ - ISOHybrid, но создатели не сделали его совместимым с " -"режимом копирования ISO/файла.\n" +"Выбранный образ - ISOHybrid, но создатели не сделали его совместимым с режимом копирования ISO/файла.\n" "Из-за этого будет применён режим записи образа DD." #. • MSG_322 @@ -2055,21 +1849,17 @@ msgstr "Постоянный журнал" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to " -"install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" -"Note: The file will be downloaded in the application's directory and will be " -"reused automatically if present." +"Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Для установки MS-DOS необходимо загрузить дополнительный файл (diskcopy.dll) " -"с сайта Microsoft:\n" +"Для использования этой функции необходимо загрузить дополнительный файл ('%s') с сайта Microsoft:\n" " 'Да' - загрузить его из Интернета\n" " 'Нет' - отменить операцию\n" "\n" -"* Файл загрузится в папку приложения, если там есть одноимённый файл, он " -"будет автоматически перезаписан." +"* Файл загрузится в папку приложения, если там есть одноимённый файл, он будет автоматически перезаписан." #. • MSG_338 msgid "Revoked UEFI bootloader detected" @@ -2077,23 +1867,15 @@ msgstr "Обнаружен отозванный загрузчик UEFI" #. • MSG_339 msgid "" -"Rufus detected that the ISO you have selected contains a UEFI bootloader " -"that has been revoked and that will produce %s, when Secure Boot is enabled " -"on a fully up to date UEFI system.\n" +"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\n" "\n" -"- If you obtained this ISO image from a non reputable source, you should " -"consider the possibility that it might contain UEFI malware and avoid " -"booting from it.\n" -"- If you obtained it from a trusted source, you should try to locate a more " -"up to date version, that will not produce this warning." +"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\n" +"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning." msgstr "" -"Выбранный образ ISO содержит отозванный загрузчик UEFI, который выдаёт %s, " -"когда безопасная загрузка включена в полностью обновленной системе UEFI.\n" +"Выбранный образ ISO содержит отозванный загрузчик UEFI, который выдаёт %s, когда безопасная загрузка включена в полностью обновленной системе UEFI.\n" "\n" -"- Если вы получили этот образ ISO из ненадёжного источника, учтите, что он " -"может содержать вредоносное ПО UEFI, и не загружайтесь с него.\n" -"- Если вы получили его из надёжного источника, попробуйте найти более новую " -"версию, которая не будет выдавать это предупреждение." +"- Если Вы получили этот образ ISO из ненадёжного источника, учтите, что он может содержать вредоносное ПО UEFI, и не загружайтесь с него.\n" +"- Если Вы получили его из надёжного источника, попробуйте найти более новую версию, которая не будет выдавать это предупреждение." #. • MSG_340 msgid "a \"Security Violation\" screen" @@ -2117,13 +1899,11 @@ msgstr "Образ Full Flash Update (FFU)" #. • MSG_345 msgid "" -"Some additional data must be downloaded from Microsoft to use this " -"functionality:\n" +"Some additional data must be downloaded from Microsoft to use this functionality:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation" msgstr "" -"Для этой функции необходимо загрузить дополнительные данные с сайта " -"Microsoft:\n" +"Для этой функции необходимо загрузить дополнительные данные с сайта Microsoft:\n" " 'Да' - загрузить их из Интернета\n" " 'Нет' - отменить операцию" @@ -2143,15 +1923,36 @@ msgstr "Распаковка архивов: %s" msgid "Use Rufus MBR" msgstr "Использовать MBR Rufus" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (requires a compatible target PC)" +msgstr "" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "" + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "" + +#. • MSG_353 +msgid "DBX update available" +msgstr "" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application -msgid "" -"Rufus is a utility that helps format and create bootable USB flash drives, " -"such as USB keys/pendrives, memory sticks, etc." -msgstr "" -"Rufus - это утилита для форматирования и создания загрузочных флеш-" -"накопителей USB." +msgid "Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc." +msgstr "Rufus - это утилита для форматирования и создания загрузочных флеш-накопителей USB." #. • MSG_901 msgid "Official site: %s" @@ -2170,12 +1971,10 @@ msgstr "Изменения: %s" #. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html) #. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here. msgid "" -"This application is licensed under the terms of the GNU Public License (GPL) " -"version 3.\n" +"This application is licensed under the terms of the GNU Public License (GPL) version 3.\n" "See https://www.gnu.org/licenses/gpl-3.0.en.html for details." msgstr "" -"Это приложение распространяется по лицензии GNU Public License (GPL) версии " -"3.\n" +"Это приложение распространяется по лицензии GNU Public License (GPL) версии 3.\n" "Подробнее см. https://www.gnu.org/licenses/gpl-3.0.ru.html." #. • MSG_905 @@ -2187,12 +1986,8 @@ msgstr "Загрузочный" #. • MSG_910 #. #. This and subsequent messages will be listed in the 'Features' section of the Windows Store page -msgid "" -"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/" -"ext2/ext3" -msgstr "" -"Форматирование USB, флешек и виртуальных дисков в FAT/FAT32/NTFS/UDF/exFAT/" -"ReFS/ext2/ext3" +msgid "Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" +msgstr "Форматирование USB, флешек и виртуальных дисков в FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" #. • MSG_911 msgid "Create FreeDOS bootable USB drives" @@ -2200,32 +1995,23 @@ msgstr "Создание загрузочных USB-дисков FreeDOS" #. • MSG_912 msgid "Create bootable drives from bootable ISOs (Windows, Linux, etc.)" -msgstr "" -"Создание загрузочных дисков из загрузочных образов ISO (Windows, Linux и т." -"д.)" +msgstr "Создание загрузочных дисков из загрузочных образов ISO (Windows, Linux и т.д.)" #. • MSG_913 -msgid "" -"Create bootable drives from bootable disk images, including compressed ones" -msgstr "" -"Создание загрузочных дисков из образов загрузочных дисков, в том числе сжатых" +msgid "Create bootable drives from bootable disk images, including compressed ones" +msgstr "Создание загрузочных дисков из образов загрузочных дисков, в том числе сжатых" #. • MSG_914 msgid "Create BIOS or UEFI bootable drives, including UEFI bootable NTFS" -msgstr "" -"Создание загрузочных дисков BIOS или UEFI, включая загрузочный UEFI NTFS" +msgstr "Создание загрузочных дисков BIOS или UEFI, включая загрузочный UEFI NTFS" #. • MSG_915 msgid "Create 'Windows To Go' drives" msgstr "Создание дисков Windows To Go" #. • MSG_916 -msgid "" -"Create Windows 11 installation drives for PCs that don't have TPM or Secure " -"Boot" -msgstr "" -"Создание установочных дисков Windows 11 для компьютеров без TPM или " -"безопасной загрузки" +msgid "Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot" +msgstr "Создание установочных дисков Windows 11 для компьютеров без TPM или безопасной загрузки" #. • MSG_917 msgid "Create persistent Linux partitions" @@ -2237,8 +2023,7 @@ msgstr "Создание образов VHD/DD выбранного диска" #. • MSG_919 msgid "Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image" -msgstr "" -"Вычисление контрольных сумм MD5, SHA-1, SHA-256 и SHA-512 выбранного образа" +msgstr "Вычисление контрольных сумм MD5, SHA-1, SHA-256 и SHA-512 выбранного образа" #. • MSG_920 msgid "Perform bad blocks checks, including detection of \"fake\" flash drives" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index eedab00c..5e1c69b0 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -12066,7 +12066,7 @@ t MSG_076 "Невозможно исправить/настроить файлы t MSG_077 "Невозможно назначить букву диска." t MSG_078 "Невозможно смонтировать том GUID." t MSG_079 "Устройство не готово." -t MSG_080 "Rufus обнаружил, что Windows всё ещё очищает внутренний буфер USB-устройства.\n\nВ зависимости от скорости USB-устройства, эта операция может занять много времени, особенно для больших файлов.\n\nЧтобы избежать повреждения устройства, дождитесь, пока Windows закончит. Но если вам надоест ждать, можете просто отключить устройство..." +t MSG_080 "Rufus обнаружил, что Windows всё ещё очищает внутренний буфер USB-устройства.\n\nВ зависимости от скорости USB-устройства, эта операция может занять много времени, особенно для больших файлов.\n\nЧтобы избежать повреждения устройства, дождитесь, пока Windows закончит. Но если Вам надоест ждать, можете просто отключить устройство..." t MSG_081 "Неподдерживаемый образ" t MSG_082 "Образ либо незагрузочный, либо использует метод загрузки или сжатия, не поддерживаемый Rufus." t MSG_083 "Заменить %s?" @@ -12079,7 +12079,7 @@ t MSG_089 "Образ слишком большой для выбранного t MSG_090 "Неподдерживаемый образ ISO" t MSG_091 "При использовании целевого типа UEFI поддерживаются только загрузочные образы ISO. Выберите загрузочный образ EFI или измените целевой тип BIOS." t MSG_092 "Неподдерживаемая файловая система" -t MSG_093 "ВАЖНО: НА ЭТОМ ДИСКЕ НЕСКОЛЬКО РАЗДЕЛОВ!!\n\nЭтот диск может содержать разделы/тома, которые отсутствуют в списке или даже не видны в Windows. В случае продолжения вы несёте ответственность за любую потерю данных на этих разделах." +t MSG_093 "ВАЖНО: НА ЭТОМ ДИСКЕ НЕСКОЛЬКО РАЗДЕЛОВ!!\n\nЭтот диск может содержать разделы/тома, которые отсутствуют в списке или даже не видны в Windows. В случае продолжения Вы несёте ответственность за любую потерю данных на этих разделах." t MSG_094 "Обнаружено несколько разделов" t MSG_095 "DD-образ" t MSG_096 "Выбранная файловая система не может использоваться с этим типом образа ISO. Выберите другую файловую систему или другой образ ISO." @@ -12091,7 +12091,7 @@ t MSG_101 "Отсутствует поддержка WIM" t MSG_102 "Ваша система не может извлекать файлы из архивов WIM. Распаковка таких архивов необходима для создания загрузочных USB-накопителей EFI для Windows 7 и Windows Vista. Чтобы решить эту проблему, установите новейшую версию 7-Zip.\nОткрыть страницу загрузки 7-Zip?" t MSG_103 "Загрузить %s?" t MSG_104 "%s или новее требует наличия файла '%s'.\nПоскольку размер этого файла больше 100 КБ, и он всегда присутствует в ISO-образах %s, он не встроен в Rufus.\n\nRufus может скачать недостающий файл:\n- Выберите 'Да', если хотите скачать этот файл\n- Выберите 'Нет', если хотите скачать его вручную позже\n\n* Файл будет скачан в текущую папку. Если в ней есть '%s', он будет автоматически перезаписан." -t MSG_105 "При отмене устройство может оказаться в НЕРАБОЧЕМ состоянии.\nЕсли вы уверены, что хотите отменить операцию, нажмите 'Да'. Иначе - нажмите 'Нет'." +t MSG_105 "При отмене устройство может оказаться в НЕРАБОЧЕМ состоянии.\nЕсли Вы уверены, что хотите отменить операцию, нажмите 'Да'. Иначе - нажмите 'Нет'." t MSG_106 "Выберите папку" t MSG_107 "Все файлы" t MSG_108 "Журнал Rufus" @@ -12116,7 +12116,7 @@ t MSG_127 "Больше это не показывать" t MSG_128 "Важное примечание о %s" t MSG_129 "Вы только что создали носитель с загрузчиком UEFI:NTFS. Учтите, что для загрузки этого носителя НУЖНО ОТКЛЮЧИТЬ БЕЗОПАСНУЮ ЗАГРУЗКУ.\nЧтобы узнать, почему это необходимо, нажмите кнопку 'Ещё'." t MSG_130 "Выбор образа Windows" -t MSG_131 "Этот файл ISO содержит несколько образов Windows.\nВыберите образ, который вы хотите использовать для этой установки:" +t MSG_131 "Этот файл ISO содержит несколько образов Windows.\nВыберите образ, который Вы хотите использовать для этой установки:" t MSG_132 "К этому диску обращается другая программа или процесс. Всё равно настаиваете на форматировании?" t MSG_133 "Rufus обнаружил, что вы пытаетесь создать носитель Windows To Go на основе ISO 1809.\n\nИз-за *ОШИБКИ MICROSOFT* этот носитель будет давать сбой при загрузке Windows (BSOD), если вы вручную не замените файл WppRecorder.sys версией 1803.\n\nRufus не может это исправить автоматически, так как WppRecorder.sys - это файл Microsoft, защищённый авторскими правами, поэтому мы не можем легально встраивать в приложение его копию." t MSG_134 "Поскольку для схемы разделов выбрана MBR, на этом носителе Rufus может создать только раздел размером до 2 ТБ, а %s дискового пространства останутся недоступными.\n\nВы действительно хотите продолжить?" @@ -12152,7 +12152,6 @@ t MSG_164 "Метод, который будет использоваться д t MSG_165 "Нажмите, чтобы выбрать или загрузить образ..." t MSG_166 "Разрешить отображение меток с международными символами и задать значок устройства\n(создаётся файл autorun.inf)" t MSG_167 "Установить загрузчик UEFI, который проверит файл MD5Sum на носителе" -t MSG_168 "Попробуйте замаскировать первый загрузочный \nUSB-диск (обычно 0x80) как другой диск.\nЭто необходимо только для установки Windows XP,\nесли у вас несколько дисков." t MSG_169 "Создать дополнительный скрытый раздел и попробовать выровнять границы разделов.\nЭто может улучшить обнаружение загрузчика в старых BIOS." t MSG_170 "Отображать внешние жёсткие диски USB.\nИСПОЛЬЗУЙТЕ НА СВОЙ СТРАХ И РИСК!" t MSG_171 "Начать форматирование.\nВсе данные на диске будут УНИЧТОЖЕНЫ!" @@ -12164,8 +12163,8 @@ t MSG_176 "Русский перевод: Дмитрий Ерохин <mailto:er t MSG_177 "Сообщить об ошибке или предложить улучшение:" t MSG_178 "Дополнительные авторские права:" t MSG_179 "Политика обновления:" -t MSG_180 "Разрешая проверку обновлений, вы соглашаетесь, что на наших серверах может собираться следующая информация:" -t MSG_181 "Версия и архитектура вашей операционной системы" +t MSG_180 "Разрешая проверку обновлений, Вы соглашаетесь, что на наших серверах может собираться следующая информация:" +t MSG_181 "Версия и архитектура Вашей операционной системы" t MSG_182 "Версия используемого приложения" t MSG_183 "Ваш IP-адрес" t MSG_184 "Для получения статистики использования программы мы можем хранить собранную информацию \\b не более года\\b0 . Однако мы не будем добровольно раскрывать какие-либо из этих персональных данных сторонним лицам." @@ -12180,9 +12179,9 @@ t MSG_192 "Чтение" t MSG_193 "Загружено %s" t MSG_194 "Не удалось загрузить %s" t MSG_195 "Использовать встроенную версию %s файлов" -t MSG_196 "ВАЖНО: НА ЭТОМ ДИСКЕ СЕКТОРЫ НЕСТАНДАРТНОГО РАЗМЕРА!\n\nОбычные накопители используют секторы размером 512 байт, а на этом диске они %d-байтовые. Во многих случаях это означает, что вы НЕ СМОЖЕТЕ загрузиться с этого диска.\nRufus попытается создать загрузочный диск, но БЕЗ ГАРАНТИИ, что он будет работать." +t MSG_196 "ВАЖНО: НА ЭТОМ ДИСКЕ СЕКТОРЫ НЕСТАНДАРТНОГО РАЗМЕРА!\n\nОбычные накопители используют секторы размером 512 байт, а на этом диске они %d-байтовые. Во многих случаях это означает, что Вы НЕ СМОЖЕТЕ загрузиться с этого диска.\nRufus попытается создать загрузочный диск, но БЕЗ ГАРАНТИИ, что он будет работать." t MSG_197 "Обнаружен нестандартный размер секторов" -t MSG_198 "Windows To Go может быть установлена на диск с разделом GPT только в том случае, если у диска есть атрибут FIXED (несъёмный). У выбранного диск такого атрибута не обнаружено." +t MSG_198 "Windows To Go может быть установлена на диск с разделом GPT только в том случае, если у диска есть атрибут FIXED (несъёмный). У выбранного диска такого атрибута не обнаружено." t MSG_199 "Эта функция недоступна на данной платформе." t MSG_201 "Отмена, подождите..." t MSG_202 "Сканирование образа..." @@ -12223,7 +12222,7 @@ t MSG_236 "Плохие блоки: Тестирование со случайн t MSG_237 "Плохие блоки: Тестирование с шаблоном 0x%02X" t MSG_238 "Разметка раздела (%s)..." t MSG_239 "Удаление разделов (%s)..." -t MSG_240 "Невозможно проверить подпись загруженного обновления. Это может означать, что ваша система неправильно настроена для проверки подписей, либо что было загружено вредоносное ПО.\n\nОбновление будет удалено. См. подробности в файле-журнале." +t MSG_240 "Невозможно проверить подпись загруженного обновления. Это может означать, что Ваша система неправильно настроена для проверки подписей, либо было загружено вредоносное ПО.\n\nОбновление будет удалено. См. подробности в файле-журнале." t MSG_241 "Загрузка: %s" t MSG_242 "Не удалось скачать файл." t MSG_243 "Проверка наличия обновлений..." @@ -12281,14 +12280,14 @@ t MSG_294 "Эта версия Windows больше не поддерживае t MSG_295 "ВНИМАНИЕ: Неофициальная версия" t MSG_296 "Эта версия Rufus не была выпущена официальным разработчиком.\n\nВы действительно хотите её запустить?" t MSG_297 "Обнаружен усечённый образ ISO" -t MSG_298 "Выбранный образ ISO не соответствует заявленному размеру: %s данных отсутствует!\n\nЕсли вы скачали этот файл из Интернета, загрузите его снова и проверьте, совпадают ли контрольные суммы MD5 или SHA.\n\nЧтобы вычислить MD5 или SHA в Rufus, нажмите кнопку (✓)." +t MSG_298 "Выбранный образ ISO не соответствует заявленному размеру: %s данных отсутствует!\n\nЕсли Вы скачали этот файл из Интернета, загрузите его снова и проверьте, совпадают ли контрольные суммы MD5 или SHA.\n\nЧтобы вычислить MD5 или SHA в Rufus, нажмите кнопку (✓)." t MSG_299 "Ошибка проверки временной метки" t MSG_300 "Rufus не смог подтвердить, что временная метка загруженного обновления более поздняя, ​​чем дата текущего исполняемого файла.\n\nЧтобы предотвратить возможную атаку, обновление было прервано, а загруженный файл - удалён. См. подробности в файле-журнале." t MSG_301 "Показать настройки приложения" t MSG_302 "Показать информацию о приложении" t MSG_303 "Показать журнал" t MSG_304 "Создать образ диска выбранного устройства" -t MSG_305 "Используйте эту опцию, если вы хотите установить Windows на другой диск или запускать Windows прямо с этого диска (Windows To Go)." +t MSG_305 "Используйте эту опцию, если Вы хотите установить Windows на другой диск или запускать Windows прямо с этого диска (Windows To Go)." t MSG_306 "Быстрое обнуление диска: %s" t MSG_307 "это может занять время" t MSG_308 "Обнаружение VHD" @@ -12320,7 +12319,7 @@ t MSG_335 "Отключить автоматическое шифрование t MSG_336 "Постоянный журнал" t MSG_337 "Для использования этой функции необходимо загрузить дополнительный файл ('%s') с сайта Microsoft:\n 'Да' - загрузить его из Интернета\n 'Нет' - отменить операцию\n\n* Файл загрузится в папку приложения, если там есть одноимённый файл, он будет автоматически перезаписан." t MSG_338 "Обнаружен отозванный загрузчик UEFI" -t MSG_339 "Выбранный образ ISO содержит отозванный загрузчик UEFI, который выдаёт %s, когда безопасная загрузка включена в полностью обновленной системе UEFI.\n\n- Если вы получили этот образ ISO из ненадёжного источника, учтите, что он может содержать вредоносное ПО UEFI, и не загружайтесь с него.\n- Если вы получили его из надёжного источника, попробуйте найти более новую версию, которая не будет выдавать это предупреждение." +t MSG_339 "Выбранный образ ISO содержит отозванный загрузчик UEFI, который выдаёт %s, когда безопасная загрузка включена в полностью обновленной системе UEFI.\n\n- Если Вы получили этот образ ISO из ненадёжного источника, учтите, что он может содержать вредоносное ПО UEFI, и не загружайтесь с него.\n- Если Вы получили его из надёжного источника, попробуйте найти более новую версию, которая не будет выдавать это предупреждение." t MSG_340 "экран нарушения безопасности" t MSG_341 "экран восстановления Windows (BSOD) с '%s'" t MSG_342 "Сжатый образ VHDX" diff --git a/src/rufus.rc b/src/rufus.rc index 6d672ade..ee0a4c89 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.12.2295" +CAPTION "Rufus 4.12.2296" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2295,0 - PRODUCTVERSION 4,12,2295,0 + FILEVERSION 4,12,2296,0 + PRODUCTVERSION 4,12,2296,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2295" + VALUE "FileVersion", "4.12.2296" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2295" + VALUE "ProductVersion", "4.12.2296" END END BLOCK "VarFileInfo" From 6a7fb939d593070d8f815cd511a23106d9f2e309 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 20 Nov 2025 13:07:40 +0000 Subject: [PATCH 106/192] [efi] update UEFI:NTFS to latest * This improves the error message on arch mismatch, since this appears to be a common user mistake. * Also fix a handful of MinGW warnings. --- res/uefi/readme.txt | 4 ++-- res/uefi/uefi-ntfs.img | Bin 1048576 -> 1048576 bytes src/cregex_compile.c | 7 +++++++ src/format.c | 3 +-- src/rufus.rc | 10 +++++----- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/res/uefi/readme.txt b/res/uefi/readme.txt index c3ae32d7..76fb335d 100644 --- a/res/uefi/readme.txt +++ b/res/uefi/readme.txt @@ -13,11 +13,11 @@ o Secure Boot signed NTFS UEFI drivers, derived from ntfs-3g [1]. ARM driver (ntfs_arm.efi) is not Secure Boot signed. o Non Secure Boot signed exFAT UEFI drivers from EfiFs [2]. - These drivers are the exact same as the binaries from EfiFs release 1.9 but, + These drivers are the exact same as the binaries from EfiFs release 1.11 but, because they are licensed under GPLv3, cannot be Secure Boot signed. o Secure Boot signed UEFI:NTFS bootloader binaries [3]. - These drivers are the exact same as the binaries from release 2.3, except for + These drivers are the exact same as the binaries from release 2.6, except for the addition of Microsoft's Secure Boot signature. Note that, per Microsoft's current Secure Boot signing policies, the 32-bit ARM bootloader (bootarm.efi) is not Secure Boot signed. diff --git a/res/uefi/uefi-ntfs.img b/res/uefi/uefi-ntfs.img index 8ed9d212bf44be176a15264d7006484252b598a2..33529741b3619c11ec853d8fb0d772655a153e08 100644 GIT binary patch delta 155427 zcmeFacU)6f_%MF%y$J~rAS{_eSc;%E2*?oS5+Hy$5NWkeaK??|z}1A|K(rEqhT*_b zg{T#`Xe&5sZ5;*da8(1SsAwB-5N3YQNrF;4zVGk-eSZJEpEvy+&pqcn=h^2u&pFAZ z5(zDl&^dh>{TA*>KIYv*L`VobmByix=&dB25$VDs-BcQnM6$1h>{m>BSCRvi<UmCE z@F>k_%0H0`kWfLz)R0PQsFDgrj4&QUqtVD_k<LSknG-9SlU16j$RLSlFr7A-nP@Ou zVlb!JU|yxc0+nVFVlC#eQfSt)MAixkYh^KObtP-9k|kDYWR+wuHZqj*3}w)GNG@U5 z@=WV#Q_UjTcxo)W*4&w}aB0%WPEZTj7ke$J?X?IRo{TxnGieUxdrssq<`TIEuK&k~ zVr1GsdfL*7OD7_PYoz@|3S)Ts4;S_SOh4`hwJg}km;1iw$Hbv==ZRw{(u~AW(ke!7 zyvcy~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93278b 100644 --- a/src/cregex_compile.c +++ b/src/cregex_compile.c @@ -247,6 +247,10 @@ static cregex_program_instr_t *compile_context(regex_compile_context *context, /* Compile a parsed pattern (using a previously allocated program with at least * estimate_instructions(root) instructions). */ +#if defined __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdangling-pointer" +#endif static cregex_program_t *compile_node_with_program(const cregex_node_t *root, cregex_program_t *program) { @@ -286,6 +290,9 @@ static cregex_program_t *compile_node_with_program(const cregex_node_t *root, return program; } +#if defined __GNUC__ +#pragma GCC diagnostic pop +#endif /* Upper bound of number of instructions required to compile parsed pattern. */ static int estimate_instructions(const cregex_node_t *root) diff --git a/src/format.c b/src/format.c index f5ef4bb0..b75dca9d 100644 --- a/src/format.c +++ b/src/format.c @@ -1438,7 +1438,7 @@ out: DWORD WINAPI FormatThread(void* param) { int r; - BOOL ret, use_large_fat32, windows_to_go, actual_lock_drive = lock_drive, write_as_ext = FALSE; + BOOL ret, windows_to_go, actual_lock_drive = lock_drive, write_as_ext = FALSE; // Windows 11 and VDS (which I suspect is what fmifs.dll's FormatEx() is now calling behind the scenes) // require us to unlock the physical drive to format the drive, else access denied is returned. BOOL need_logical = FALSE, must_unlock_physical = (use_vds || WindowsVersion.Version >= WINDOWS_11); @@ -1456,7 +1456,6 @@ DWORD WINAPI FormatThread(void* param) char kolibri_dst[] = "?:\\MTLD_F32"; char grub4dos_dst[] = "?:\\grldr"; - use_large_fat32 = (fs_type == FS_FAT32) && ((SelectedDrive.DiskSize > LARGE_FAT32_SIZE) || (force_large_fat32)); windows_to_go = (image_options & IMOP_WINTOGO) && (boot_type == BT_IMAGE) && HAS_WINTOGO(img_report) && (ComboBox_GetCurItemData(hImageOption) == IMOP_WIN_TO_GO); large_drive = (SelectedDrive.DiskSize > (1*TB)); diff --git a/src/rufus.rc b/src/rufus.rc index ee0a4c89..cd83c15b 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.12.2296" +CAPTION "Rufus 4.12.2297" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2296,0 - PRODUCTVERSION 4,12,2296,0 + FILEVERSION 4,12,2297,0 + PRODUCTVERSION 4,12,2297,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2296" + VALUE "FileVersion", "4.12.2297" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2296" + VALUE "ProductVersion", "4.12.2297" END END BLOCK "VarFileInfo" From a8c745d2a95c590e7607836b3ee5365186840dcf Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 25 Nov 2025 12:18:23 +0000 Subject: [PATCH 107/192] [internal] do not UPX compress the appstore executables * UPX compressing exes makes it impossible to reference the PDB when debugging which means that, ever since we switched to using the MSVC executables for both standalone and appstore in 4adfa4f37e3879b215f54f52231851caeff42912 the appstore dumps we get on crashes have become basically unusable for debug :( * We therefore revert to producing non UPX compressed executable for MSVC by default, so that we can resume investigating appstore crashes on next release. * At the same time, on release builds, we add new UPX compressed executables to the GitHub Actions artifacts. * Also update actions/checkout to v6 and close #2868. --- .github/workflows/codeql.yml | 2 +- .github/workflows/coverity.yml | 2 +- .github/workflows/mingw.yml | 2 +- .github/workflows/setup.yml | 2 +- .github/workflows/vs2022.yml | 23 ++++++++++++++++++----- src/hash.c | 2 +- src/rufus.rc | 10 +++++----- 7 files changed, 28 insertions(+), 15 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 82375293..2d487b41 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -41,7 +41,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Initialize CodeQL uses: github/codeql-action/init@v4 diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 39ef2fa2..1fbdb2e7 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 submodules: recursive diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml index 8c3354c8..1cb4a5f0 100644 --- a/.github/workflows/mingw.yml +++ b/.github/workflows/mingw.yml @@ -54,7 +54,7 @@ jobs: upx - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 submodules: recursive diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml index 9f98a7aa..e3ec73c1 100644 --- a/.github/workflows/setup.yml +++ b/.github/workflows/setup.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Add MSBuild to PATH uses: microsoft/setup-msbuild@v2 diff --git a/.github/workflows/vs2022.yml b/.github/workflows/vs2022.yml index 675f0bab..dbfaf75d 100644 --- a/.github/workflows/vs2022.yml +++ b/.github/workflows/vs2022.yml @@ -40,7 +40,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 submodules: recursive @@ -55,6 +55,15 @@ jobs: with: install-only: true + - name: Set version + id: set_version + shell: bash + run: | + version=$(git describe --tags) + version=${version:1} + version=${version%%-*} + echo "version=$version" >> $GITHUB_OUTPUT + - name: Set ALPHA id: set_alpha shell: bash @@ -81,10 +90,6 @@ jobs: move .\${{ matrix.TARGET_PLATFORM }}\Release\rufus.exe .\rufus_${{ matrix.TARGET_PLATFORM }}.exe move .\${{ matrix.TARGET_PLATFORM }}\Release\rufus.pdb .\rufus_${{ matrix.TARGET_PLATFORM }}.pdb - - name: Compress executables - if: ${{ matrix.TARGET_PLATFORM != 'arm64' }} - run: upx --lzma --best rufus_${{ matrix.TARGET_PLATFORM }}.exe - - name: Prepare to sign ALPHA if: ${{ !startsWith(github.ref, 'refs/tags/') }} shell: bash @@ -102,6 +107,14 @@ jobs: signtool sign /v /f sign.pfx /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 rufus_${{ matrix.TARGET_PLATFORM }}.exe del sign.pfx + - name: Create standalone release executables + if: ${{ startsWith(github.ref, 'refs/tags/') }} + shell: cmd + run: | + copy rufus_${{ matrix.TARGET_PLATFORM }}.exe rufus-${{ steps.set_version.outputs.version }}_${{ matrix.TARGET_PLATFORM }}.exe + if exist rufus-${{ steps.set_version.outputs.version }}_x64.exe ( ren rufus-${{ steps.set_version.outputs.version }}_x64.exe rufus-${{ steps.set_version.outputs.version }}.exe ) + if not ${{ matrix.TARGET_PLATFORM }}==arm64 ( upx --lzma --best rufus-*.exe ) + - name: Display SHA-256 run: sha256sum ./rufus_${{ matrix.TARGET_PLATFORM }}.exe diff --git a/src/hash.c b/src/hash.c index 272093cf..6be9e50c 100644 --- a/src/hash.c +++ b/src/hash.c @@ -2199,7 +2199,7 @@ static BOOL IsRevokedBySbat(uint8_t* buf, uint32_t len) continue; for (j = 0; sbat_entries[j].product != NULL; j++) { if (strcmp(entry.product, sbat_entries[j].product) == 0 && entry.version < sbat_entries[j].version) { - uprintf(" SBAT version for '%s' (%d) is lower than required minimum SBAT version (%d)!", + uprintf(" SBAT version for '%s' (%d) is lower than the current minimum SBAT version (%d)!", entry.product, entry.version, sbat_entries[j].version); return TRUE; } diff --git a/src/rufus.rc b/src/rufus.rc index cd83c15b..070d1ab5 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.12.2297" +CAPTION "Rufus 4.12.2298" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2297,0 - PRODUCTVERSION 4,12,2297,0 + FILEVERSION 4,12,2298,0 + PRODUCTVERSION 4,12,2298,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2297" + VALUE "FileVersion", "4.12.2298" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2297" + VALUE "ProductVersion", "4.12.2298" END END BLOCK "VarFileInfo" From be95fd0e0031d52b95aae975d3e9b1e821513b52 Mon Sep 17 00:00:00 2001 From: Martin Kuschnik <Martin-Kuschnik@live.com> Date: Mon, 8 Dec 2025 19:17:29 +0000 Subject: [PATCH 108/192] [core] improve Microsoft Dev Drive detection * The `IsMsDevDrive` function is refactored to use the `FSCTL_QUERY_PERSISTENT_VOLUME_STATE` control code for detecting Microsoft Dev Drives. This replaces the previous approach of analyzing drive layout which was not always correct. * Closes #2873. --- src/drive.c | 40 +++++++++++++++++----------------------- src/rufus.rc | 10 +++++----- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/src/drive.c b/src/drive.c index 98588d6a..fbce1bc8 100644 --- a/src/drive.c +++ b/src/drive.c @@ -67,6 +67,10 @@ const IID IID_IVdsVolume = { 0x88306BB2, 0xE71F, 0x478C, { 0x86, 0xA2, 0x79, 0xD const IID IID_IVdsVolumeMF3 = { 0x6788FAF9, 0x214E, 0x4B85, { 0xBA, 0x59, 0x26, 0x69, 0x53, 0x61, 0x6E, 0x09 } }; #endif +#ifndef PERSISTENT_VOLUME_STATE_DEV_VOLUME +#define PERSISTENT_VOLUME_STATE_DEV_VOLUME (0x00002000) +#endif + /* * Globals */ @@ -2608,40 +2612,30 @@ const char* GetGPTPartitionType(const GUID* guid) } /* - * Detect Microsoft Dev Drives, which are VHDs consisting of a small MSR followed by a large - * (50 GB or more) ReFS partition. See https://learn.microsoft.com/en-us/windows/dev-drive/. - * NB: Despite the option being proposed, I have *NOT* been able to create MBR-based Dev Drives. + * Detect Microsoft Dev Drives. See https://learn.microsoft.com/en-us/windows/dev-drive/. */ BOOL IsMsDevDrive(DWORD DriveIndex) { - BOOL r, ret = FALSE; + BOOL ret = FALSE; DWORD size = 0; - HANDLE hPhysical = INVALID_HANDLE_VALUE; - BYTE layout[4096] = { 0 }; - PDRIVE_LAYOUT_INFORMATION_EX DriveLayout = (PDRIVE_LAYOUT_INFORMATION_EX)(void*)layout; + HANDLE hLogical = INVALID_HANDLE_VALUE; + FILE_FS_PERSISTENT_VOLUME_INFORMATION data = { 0 }; - hPhysical = GetPhysicalHandle(DriveIndex, FALSE, FALSE, TRUE); - if (hPhysical == INVALID_HANDLE_VALUE) + hLogical = GetLogicalHandle(DriveIndex, 0, FALSE, FALSE, FALSE); + if (hLogical == INVALID_HANDLE_VALUE) goto out; - r = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_LAYOUT_EX, NULL, 0, layout, sizeof(layout), &size, NULL); - if (!r || size <= 0) + data.FlagMask = PERSISTENT_VOLUME_STATE_DEV_VOLUME; + data.Version = 1; + + if (!DeviceIoControl(hLogical, FSCTL_QUERY_PERSISTENT_VOLUME_STATE, &data, sizeof(data), + &data, sizeof(data), &size, NULL)) goto out; - if (DriveLayout->PartitionStyle != PARTITION_STYLE_GPT) - goto out; - if (DriveLayout->PartitionCount != 2) - goto out; - if (!CompareGUID(&DriveLayout->PartitionEntry[0].Gpt.PartitionType, &PARTITION_MICROSOFT_RESERVED)) - goto out; - if (!CompareGUID(&DriveLayout->PartitionEntry[1].Gpt.PartitionType, &PARTITION_MICROSOFT_DATA)) - goto out; - if (DriveLayout->PartitionEntry[1].PartitionLength.QuadPart < 20 * GB) - goto out; - ret = (strcmp(GetFsName(hPhysical, DriveLayout->PartitionEntry[1].StartingOffset), "ReFS") == 0); + ret = data.VolumeFlags & PERSISTENT_VOLUME_STATE_DEV_VOLUME; out: - safe_closehandle(hPhysical); + safe_closehandle(hLogical); return ret; } diff --git a/src/rufus.rc b/src/rufus.rc index 070d1ab5..cc22c81b 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.12.2298" +CAPTION "Rufus 4.12.2299" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2298,0 - PRODUCTVERSION 4,12,2298,0 + FILEVERSION 4,12,2299,0 + PRODUCTVERSION 4,12,2299,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2298" + VALUE "FileVersion", "4.12.2299" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2298" + VALUE "ProductVersion", "4.12.2299" END END BLOCK "VarFileInfo" From fec60510000dd7dfbe3e34e1f0cc845189384244 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Sat, 20 Dec 2025 13:35:01 +0000 Subject: [PATCH 109/192] [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. --- .github/workflows/coverity.yml | 2 +- .github/workflows/mingw.yml | 4 ++-- .github/workflows/setup.yml | 2 +- .github/workflows/vs2022.yml | 4 ++-- src/dev.c | 6 +++--- src/parser.c | 17 +++++++++++++++++ src/rufus.h | 1 + src/rufus.rc | 10 +++++----- src/wue.c | 9 ++++++++- 9 files changed, 40 insertions(+), 15 deletions(-) diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 1fbdb2e7..a34ebb9c 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -53,7 +53,7 @@ jobs: cov-build.exe --dir cov-int msbuild ${{ env.SOLUTION_FILE_PATH }} /m /p:Configuration=${{ env.BUILD_CONFIGURATION }},Platform=${{ env.TARGET_PLATFORM }} - name: Publish Coverity artifacts - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: cov-int path: cov-int/ diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml index 1cb4a5f0..74b788a1 100644 --- a/.github/workflows/mingw.yml +++ b/.github/workflows/mingw.yml @@ -114,7 +114,7 @@ jobs: - name: Upload artifacts if: ${{ github.event_name == 'push' }} - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: ${{ matrix.sys }} path: ./*.exe @@ -124,7 +124,7 @@ jobs: needs: MinGW-Build steps: - name: Merge Artifacts - uses: actions/upload-artifact/merge@v5 + uses: actions/upload-artifact/merge@v6 if: ${{ github.event_name == 'push' }} with: name: MinGW diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml index e3ec73c1..d737d74f 100644 --- a/.github/workflows/setup.yml +++ b/.github/workflows/setup.yml @@ -36,7 +36,7 @@ jobs: run: sha256sum ./setup_${{ matrix.TARGET_PLATFORM }}.exe - name: Upload artifacts - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: ${{ matrix.TARGET_PLATFORM }} path: ./*.exe diff --git a/.github/workflows/vs2022.yml b/.github/workflows/vs2022.yml index dbfaf75d..ac7b41fa 100644 --- a/.github/workflows/vs2022.yml +++ b/.github/workflows/vs2022.yml @@ -126,7 +126,7 @@ jobs: curl --request POST --url https://www.virustotal.com/api/v3/monitor/items --header 'x-apikey: ${{ secrets.VIRUSTOTAL_API_KEY }}' --form path='/rufus_${{ matrix.TARGET_PLATFORM }}.exe' --form file=@./rufus_${{ matrix.TARGET_PLATFORM }}.exe - name: Upload artifacts - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 if: ${{ github.event_name == 'push' }} with: name: ${{ matrix.TARGET_PLATFORM }} @@ -139,7 +139,7 @@ jobs: needs: VS2022-Build steps: - name: Merge Artifacts - uses: actions/upload-artifact/merge@v5 + uses: actions/upload-artifact/merge@v6 if: ${{ github.event_name == 'push' }} with: name: VS2022 diff --git a/src/dev.c b/src/dev.c index a1a44fc3..095ef49e 100644 --- a/src/dev.c +++ b/src/dev.c @@ -418,9 +418,9 @@ BOOL GetOpticalMedia(IMG_SAVE* img_save) /* For debugging user reports of HDDs vs UFDs */ //#define FORCED_DEVICE #ifdef FORCED_DEVICE -#define FORCED_VID 0x04E8 -#define FORCED_PID 0x6300 -#define FORCED_NAME "Samsung Type-C USB Device" +#define FORCED_VID 0x0781 +#define FORCED_PID 0x55A9 +#define FORCED_NAME " USB SanDisk 3.2Gen1 UAS Device" #endif void ClearDrives(void) diff --git a/src/parser.c b/src/parser.c index f3d8b41a..875a63e4 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1304,6 +1304,23 @@ char* replace_char(const char* src, const char c, const char* rep) return res; } +/* + * Replace all characters from string 'str' that are present in the array of chars 'rem' + * to the 'rep' character. + */ +void filter_chars(char* str, const char* rem, const char rep) +{ + char *p, *q; + + if (str == NULL || rem == NULL) + return; + for (p = str; *p != '\0'; p++) { + for (q = (char*)rem; *q != '\0'; q++) + if (*p == *q) + *p = rep; + } +} + /* * Remove all instances of substring 'sub' form string 'src. * The returned string is allocated and must be freed by the caller. diff --git a/src/rufus.h b/src/rufus.h index ce966190..9043cac4 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -851,6 +851,7 @@ extern char* get_token_data_buffer(const char* token, unsigned int n, const char extern char* insert_section_data(const char* filename, const char* section, const char* data, BOOL dos2unix); extern char* replace_in_token_data(const char* filename, const char* token, const char* src, const char* rep, BOOL dos2unix); extern char* replace_char(const char* src, const char c, const char* rep); +extern void filter_chars(char* str, const char* rem, const char rep); extern char* remove_substr(const char* src, const char* sub); extern void parse_update(char* buf, size_t len); extern void* get_data_from_asn1(const uint8_t* buf, size_t buf_len, const char* oid_str, uint8_t asn1_type, size_t* data_len); diff --git a/src/rufus.rc b/src/rufus.rc index cc22c81b..e9773c4c 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.12.2299" +CAPTION "Rufus 4.12.2300" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2299,0 - PRODUCTVERSION 4,12,2299,0 + FILEVERSION 4,12,2300,0 + PRODUCTVERSION 4,12,2300,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2299" + VALUE "FileVersion", "4.12.2300" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2299" + VALUE "ProductVersion", "4.12.2300" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index 500e6131..3e0f382d 100644 --- a/src/wue.c +++ b/src/wue.c @@ -64,7 +64,7 @@ extern const char* efi_archname[ARCH_MAX]; char* CreateUnattendXml(int arch, int flags) { const static char* xml_arch_names[5] = { "x86", "amd64", "arm", "arm64" }; - const static char* unallowed_account_names[] = { "Administrator", "Guest", "KRBTGT", "Local" }; + const static char* unallowed_account_names[] = { "Administrator", "Guest", "KRBTGT", "Local", "NONE" }; static char path[MAX_PATH]; char* tzstr; FILE* fd; @@ -169,7 +169,14 @@ char* CreateUnattendXml(int arch, int flags) if (i < ARRAYSIZE(unallowed_account_names)) { uprintf("WARNING: '%s' is not allowed as local account name - Option ignored", unattend_username); } else if (unattend_username[0] != 0) { + char* org_username = safe_strdup(unattend_username); + // Per https://learn.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-useraccounts-localaccounts-localaccount-name + // Add '.' to the list because some folks also reported an issue with local accounts that have dots... + filter_chars(unattend_username, "/\\[]:|<>+=;,?*%@.", '_'); uprintf("• Use '%s' for local account name", unattend_username); + if (strcmp(org_username, unattend_username) != 0) + uprintf("WARNING: Local account name contained unallowed characters and has been sanitized"); + free(org_username); // If we create a local account in unattend.xml, then we can get Windows 11 // 22H2 to skip MSA even if the network is connected during installation. fprintf(fd, " <UserAccounts>\n"); From 3607f5cec84e6bdef05bbe8081607a8c72bc5a0f Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Sat, 20 Dec 2025 23:19:39 +0000 Subject: [PATCH 110/192] [iso] add a workaround for umbrelOS ISOs * The folks at umbrelOS seem to have mastered their ISO in a way where the /usr/lib/systemd/system/system-systemd/ directory is not declared (or not declared with attribute _STAT_DIR) on the ISO-9660 file system, which results in Rufus producing an error when trying to create the /usr/lib/systemd/system/system-systemd/x2dcryptsetup.slice file. * To fix this, add a workaround to create missing directories if we encounter ERROR_PATH_NOT_FOUND during ISO-9660 extraction. --- src/iso.c | 17 ++++++++++++++++- src/rufus.rc | 10 +++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/iso.c b/src/iso.c index 11edf0ac..cbf85e91 100644 --- a/src/iso.c +++ b/src/iso.c @@ -798,7 +798,7 @@ static int iso_extract_files(iso9660_t* p_iso, const char *psz_path) BOOL is_symlink, is_identical, create_file, free_p_statbuf = FALSE; int length, r = 1; char psz_fullpath[MAX_PATH], *psz_basename = NULL, *psz_sanpath = NULL; - char tmp[128], target_path[256]; + char tmp[128], target_path[256], *last_slash; const char *psz_iso_name = &psz_fullpath[strlen(psz_extract_dir)]; _Static_assert(ISO_BUFFER_SIZE % ISO_BLOCKSIZE == 0, "ISO_BUFFER_SIZE is not a multiple of ISO_BLOCKSIZE"); @@ -974,6 +974,21 @@ static int iso_extract_files(iso9660_t* p_iso, const char *psz_path) if (create_file) { file_handle = CreatePreallocatedFile(psz_sanpath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, file_length); + if (file_handle == INVALID_HANDLE_VALUE && GetLastError() == ERROR_PATH_NOT_FOUND) { + // Some folks (umbrelos) managed to master their ISOs in a manner where some + // directories don't exist (or don't have _STAT_DIR) but still have files, + // in which case our approach, that expects a sane layout with directories + // properly declared before the files they contain, breaks. Therefore: + last_slash = strrchr(psz_sanpath, '/'); + if (last_slash != NULL) { + *last_slash = '\0'; + uprintf("WARNING: Directory '%s/' was improperly mastered on the source image!", &psz_sanpath[2]); + _mkdirExU(psz_sanpath); + *last_slash = '/'; + file_handle = CreatePreallocatedFile(psz_sanpath, GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, file_length); + } + } if (file_handle == INVALID_HANDLE_VALUE) { err = GetLastError(); uprintf(" Unable to create file: %s", WindowsErrorString()); diff --git a/src/rufus.rc b/src/rufus.rc index e9773c4c..9026c60a 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.12.2300" +CAPTION "Rufus 4.12.2301" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2300,0 - PRODUCTVERSION 4,12,2300,0 + FILEVERSION 4,12,2301,0 + PRODUCTVERSION 4,12,2301,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2300" + VALUE "FileVersion", "4.12.2301" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2300" + VALUE "ProductVersion", "4.12.2301" END END BLOCK "VarFileInfo" From 2fa14b0d45fcdfd97dc2acad6025da9460eb4445 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 22 Dec 2025 14:02:06 +0000 Subject: [PATCH 111/192] [iso] fix logic for Nutanix workaround * 1a4175891b78dc46e0023e389288dbd0ccd8df8c added a workaround for the Nutanix GRUB situation, but we forgot an extra file system check. * Closes #2884. --- src/rufus.c | 2 +- src/rufus.rc | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rufus.c b/src/rufus.c index 1d1ddbe1..aec9eccc 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1654,7 +1654,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_099), lmprintf(MSG_189)); goto out; } - if (IS_FAT(fs_type) && !IS_FAT32_COMPAT(img_report)) { + if (IS_FAT(fs_type) && img_report.has_4GB_file != 0 && img_report.has_4GB_file != 0x11){ // This ISO image contains a file larger than 4GB file (FAT32) Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_099), lmprintf(MSG_100)); goto out; diff --git a/src/rufus.rc b/src/rufus.rc index 9026c60a..f0086120 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.12.2301" +CAPTION "Rufus 4.12.2302" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2301,0 - PRODUCTVERSION 4,12,2301,0 + FILEVERSION 4,12,2302,0 + PRODUCTVERSION 4,12,2302,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2301" + VALUE "FileVersion", "4.12.2302" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2301" + VALUE "ProductVersion", "4.12.2302" END END BLOCK "VarFileInfo" From 79b0425c5798426ede6834f87e1c15e4ed67653a Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Sun, 11 Jan 2026 11:45:15 +0000 Subject: [PATCH 112/192] [dev] Increase the Hardware ID buffer size * Some (newer) SSD devices appear to have very long Hardware IDs, with tons of underscore (eg: "SCSI\DiskNVMe______________________________NVME_SSD_512GBS1111H0L") * Because of this, and because Hardware ID is a REG_SZ, where entries can be repeated many times, our static MAX_PATH buffer can be too small, preventing UAS disks from being properly listed. * Fix this by bumping our buffer to 4 KB, as well as reporting errors on Hardware ID fetch in enum debug mode. * Closes #2894. --- src/dev.c | 15 +++++++++++---- src/rufus.rc | 10 +++++----- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/dev.c b/src/dev.c index 095ef49e..17697fd6 100644 --- a/src/dev.c +++ b/src/dev.c @@ -293,7 +293,9 @@ static __inline BOOL IsVHD(const char* buffer) "VMware__VMware_Virtual_S" // Enabled through a cheat mode, as this lists primary disks on VMWare instances }; - for (i = 0; i < (int)(ARRAYSIZE(vhd_name)-(enable_vmdk?0:1)); i++) + if (buffer == NULL || buffer[0] == '\0') + return FALSE; + for (i = 0; i < (int)(ARRAYSIZE(vhd_name) - (enable_vmdk ? 0 : 1)); i++) if (safe_strstr(buffer, vhd_name[i]) != NULL) return TRUE; return FALSE; @@ -492,7 +494,7 @@ BOOL GetDevices(DWORD devnum) LONG maxwidth = 0; int s, u, v, score, drive_number, remove_drive, num_drives = 0; char drive_letters[27], *device_id, *devid_list = NULL, display_msg[128]; - char *p, *label, *display_name, buffer[MAX_PATH], str[MAX_PATH], device_instance_id[MAX_PATH], *method_str, *hub_path; + char *p, *label, *display_name, buffer[4 * KB], str[MAX_PATH], device_instance_id[MAX_PATH], *method_str, *hub_path; uint32_t ignore_vid_pid[MAX_IGNORE_USB]; uint64_t drive_size = 0; usb_device_props props; @@ -663,8 +665,13 @@ BOOL GetDevices(DWORD devnum) // We can't use the friendly name to find if a drive is a VHD, as friendly name string gets translated // according to your locale, so we poke the Hardware ID memset(buffer, 0, sizeof(buffer)); - props.is_VHD = SetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_HARDWAREID, - &data_type, (LPBYTE)buffer, sizeof(buffer), &size) && IsVHD(buffer); + r = SetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_HARDWAREID, + &data_type, (LPBYTE)buffer, sizeof(buffer), &size); + // We should always be able to get a Hardware ID for disk devices, so report an error in debug if we don't + if (!r && usb_debug) + uprintf(" Error: %s", WindowsErrorString()); + props.is_VHD = IsVHD(buffer); + if (!props.is_VHD) // Additional detection for SCSI card readers if ((!props.is_CARD) && (safe_strnicmp(buffer, scsi_disk_prefix, sizeof(scsi_disk_prefix)-1) == 0)) { for (j = 0; j < ARRAYSIZE(scsi_card_name); j++) { diff --git a/src/rufus.rc b/src/rufus.rc index f0086120..13250d96 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.12.2302" +CAPTION "Rufus 4.12.2303" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2302,0 - PRODUCTVERSION 4,12,2302,0 + FILEVERSION 4,12,2303,0 + PRODUCTVERSION 4,12,2303,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2302" + VALUE "FileVersion", "4.12.2303" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2302" + VALUE "ProductVersion", "4.12.2303" END END BLOCK "VarFileInfo" From 2476a92d7068d7265e16d519cbbcf32848edb3b5 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 12 Jan 2026 12:21:11 +0000 Subject: [PATCH 113/192] [dev] try to support non USB compliant devices that use VID 0000 * This is meant to address #2894. * Also update copyright year. --- src/dev.c | 19 ++++++++++++------- src/dev.h | 6 +++--- src/localization_data.sh | 2 +- src/rufus.rc | 12 ++++++------ src/stdlg.c | 2 +- 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/dev.c b/src/dev.c index 17697fd6..6473673e 100644 --- a/src/dev.c +++ b/src/dev.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Device detection and enumeration - * Copyright © 2014-2025 Pete Batard <pete@akeo.ie> + * Copyright © 2014-2026 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -562,7 +562,7 @@ BOOL GetDevices(DWORD devnum) // Build a single list of Device IDs from all the storage enumerators we know of full_list_size = 0; ulFlags = CM_GETIDLIST_FILTER_SERVICE | CM_GETIDLIST_FILTER_PRESENT; - for (s=0; s<ARRAYSIZE(usbstor_name); s++) { + for (s = 0; s < ARRAYSIZE(usbstor_name); s++) { // Get a list of device IDs for all USB storage devices // This will be used to find if a device is UASP // Also compute the uasp_start index @@ -629,6 +629,7 @@ BOOL GetDevices(DWORD devnum) for (i = 0; num_drives < MAX_DRIVES && SetupDiEnumDeviceInfo(dev_info, i, &dev_info_data); i++) { memset(buffer, 0, sizeof(buffer)); memset(&props, 0, sizeof(props)); + props.vid = -1; props.pid = -1; method_str = ""; hub_path = NULL; if (!SetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_ENUMERATOR_NAME, @@ -738,7 +739,7 @@ BOOL GetDevices(DWORD devnum) method_str = ""; // If we're not dealing with the USBSTOR part of our list, then this is an UASP device - props.is_UASP = ((((uintptr_t)device_id)+2) >= ((uintptr_t)devid_list)+list_start[uasp_start]); + props.is_UASP = ((((uintptr_t)device_id) + 2) >= ((uintptr_t)devid_list) + list_start[uasp_start]); // Now get the properties of the device, and its Device ID, which we need to populate the properties ToUpper(device_id); j = htab_hash(device_id, &htab_devid); @@ -746,19 +747,23 @@ BOOL GetDevices(DWORD devnum) // Try to parse the current device_id string for VID:PID // We'll use that if we can't get anything better - for (k = 0, l = 0; (k<strlen(device_id)) && (l<2); k++) { + for (k = 0, l = 0; (k < strlen(device_id)) && (l < 2); k++) { // The ID is in the form USB_VENDOR_BUSID\VID_xxxx&PID_xxxx\... if (device_id[k] == '\\') post_backslash = TRUE; if (!post_backslash) continue; if (device_id[k] == '_') { - props.pid = (uint16_t)strtoul(&device_id[k + 1], NULL, 16); + props.pid = (uint16_t)strtoul(&device_id[k + 1], &p, 16); + if (p != &device_id[k + 5]) { + uuprintf(" WARNING: Could not read PID:VID from string"); + break; + } if (l++ == 0) props.vid = props.pid; } } - if (props.vid != 0) + if (props.vid != -1 && props.pid != -1) method_str = "[ID]"; // If the hash didn't match a populated string in dev_if_path[] (htab_devid.table[j].data > 0), @@ -812,7 +817,7 @@ BOOL GetDevices(DWORD devnum) } uprintf("Found non-USB removable device '%s'", buffer); } else { - if ((props.vid == 0) && (props.pid == 0)) { + if (props.vid == -1 || props.pid == -1) { if (!props.is_USB) { // If we have a non removable SCSI drive and couldn't get a VID:PID, // we are most likely dealing with a system drive => eliminate it! diff --git a/src/dev.h b/src/dev.h index ea610ad5..d0543d13 100644 --- a/src/dev.h +++ b/src/dev.h @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Device detection and enumeration - * Copyright © 2014-2025 Pete Batard <pete@akeo.ie> + * Copyright © 2014-2026 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,8 +30,8 @@ /* List of the properties we are interested in */ typedef struct usb_device_props { - uint32_t vid; - uint32_t pid; + int32_t vid; + int32_t pid; uint32_t speed; uint32_t lower_speed; uint32_t port; diff --git a/src/localization_data.sh b/src/localization_data.sh index ec2615fc..b48e9a1a 100755 --- a/src/localization_data.sh +++ b/src/localization_data.sh @@ -12,7 +12,7 @@ cat > cmd.sed <<\_EOF 1i /*\ * Rufus: The Reliable USB Formatting Utility\ * Localization tables - autogenerated from resource.h\ - * Copyright © 2013-2025 Pete Batard <pete@akeo.ie>\ + * Copyright © 2013-2026 Pete Batard <pete@akeo.ie>\ *\ * This program is free software: you can redistribute it and/or modify\ * it under the terms of the GNU General Public License as published by\ diff --git a/src/rufus.rc b/src/rufus.rc index 13250d96..8d21c6b4 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.12.2303" +CAPTION "Rufus 4.12.2304" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2303,0 - PRODUCTVERSION 4,12,2303,0 + FILEVERSION 4,12,2304,0 + PRODUCTVERSION 4,12,2304,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2303" + VALUE "FileVersion", "4.12.2304" VALUE "InternalName", "Rufus" - VALUE "LegalCopyright", " 2011-2025 Pete Batard (GPL v3)" + VALUE "LegalCopyright", " 2011-2026 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2303" + VALUE "ProductVersion", "4.12.2304" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index b70517ec..57ae3200 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -394,7 +394,7 @@ INT_PTR CALLBACK AboutCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP ResizeButtonHeight(hDlg, IDOK); static_sprintf(about_blurb, about_blurb_format, lmprintf(MSG_174|MSG_RTF), lmprintf(MSG_175|MSG_RTF, rufus_version[0], rufus_version[1], rufus_version[2]), - "Copyright © 2011-2025 Pete Batard", + "Copyright © 2011-2026 Pete Batard", lmprintf(MSG_176|MSG_RTF), lmprintf(MSG_177|MSG_RTF), lmprintf(MSG_178|MSG_RTF)); for (i = 0; i < ARRAYSIZE(hEdit); i++) { hEdit[i] = GetDlgItem(hDlg, edit_id[i]); From 385cb93744cd57c27803c67228faf228b2f0d7f9 Mon Sep 17 00:00:00 2001 From: Fabrice <33175123+FabriceGo@users.noreply.github.com> Date: Fri, 2 Jan 2026 11:24:26 +0100 Subject: [PATCH 114/192] [loc] update French translation * Closes #2887. --- res/loc/po/fr-FR.po | 2 +- res/loc/rufus.loc | 2 +- src/rufus.rc | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/res/loc/po/fr-FR.po b/res/loc/po/fr-FR.po index f3c2d365..37bf9476 100644 --- a/res/loc/po/fr-FR.po +++ b/res/loc/po/fr-FR.po @@ -1832,7 +1832,7 @@ msgstr "Définir les options régionales avec les mêmes valeurs que celles de c #. • MSG_335 msgid "Disable BitLocker automatic device encryption" -msgstr "Désactiver le cryptage automatique BitLocker" +msgstr "Désactiver le chiffrement automatique BitLocker" #. • MSG_336 msgid "Persistent log" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 5e1c69b0..8ebfd18b 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -4800,7 +4800,7 @@ t MSG_331 "Désactiver la collecte de données (Supprime les questions de confid t MSG_332 "Empêcher Windows To Go d'accéder aux disques internes" t MSG_333 "Créer un compte local sous le nom de :" t MSG_334 "Définir les options régionales avec les mêmes valeurs que celles de cet utilisateur" -t MSG_335 "Désactiver le cryptage automatique BitLocker" +t MSG_335 "Désactiver le chiffrement automatique BitLocker" t MSG_336 "Log persistent" t MSG_337 "Un fichier supplémentaire ('%s') doit être téléchargé depuis Microsoft pour utiliser cette fonctionalité :\n- Sélectionnez 'Oui' pour vous connecter à Internet et le télécharger\n- Sélectionnez 'Non' pour annuler l’opération\n\nNote : Ce fichier sera téléchargé dans le répertoire de l'application et réutilisé automatiquement s'il est présent." t MSG_338 "Bootloader UEFI révoqué détecté" diff --git a/src/rufus.rc b/src/rufus.rc index 8d21c6b4..fc6ba323 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.12.2304" +CAPTION "Rufus 4.12.2305" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2304,0 - PRODUCTVERSION 4,12,2304,0 + FILEVERSION 4,12,2305,0 + PRODUCTVERSION 4,12,2305,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2304" + VALUE "FileVersion", "4.12.2305" 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.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2304" + VALUE "ProductVersion", "4.12.2305" END END BLOCK "VarFileInfo" From 46f9c9ec60580fa56ebe3b07e6a62c6ed2277e23 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 14 Jan 2026 23:28:11 +0000 Subject: [PATCH 115/192] [process] improve the process search * Factorise the PROCESS_BASIC_INFORMATION for 32 and 64 bit. * Add a (currently unused) GetPPID() function. * Increase the size of the buffer for reporting processes and their parameters. * Don't report stale/killed processes in our main process conflict report. --- src/ntdll.h | 20 ++++++++++---------- src/process.c | 46 +++++++++++++++++++++++++++++++++++++--------- src/rufus.c | 4 ++-- src/rufus.rc | 10 +++++----- 4 files changed, 54 insertions(+), 26 deletions(-) diff --git a/src/ntdll.h b/src/ntdll.h index 309e4b27..7f74d752 100644 --- a/src/ntdll.h +++ b/src/ntdll.h @@ -4,7 +4,7 @@ * * Modified from System Informer (a.k.a. Process Hacker): * https://github.com/winsiderss/systeminformer - * Copyright © 2017-2025 Pete Batard <pete@akeo.ie> + * Copyright © 2017-2026 Pete Batard <pete@akeo.ie> * Copyright © 2017 dmex * Copyright © 2009-2016 wj32 * @@ -120,15 +120,15 @@ typedef struct _OBJECT_TYPES_INFORMATION ULONG NumberOfTypes; } OBJECT_TYPES_INFORMATION, *POBJECT_TYPES_INFORMATION; -typedef struct _PROCESS_BASIC_INFORMATION_WOW64 +typedef struct _PROCESS_BASIC_INFORMATION_INTERNAL { - PVOID Reserved1[2]; - // MinGW32 screws us with a sizeof(PVOID64) of 4 instead of 8 => Use ULONGLONG instead - ULONGLONG PebBaseAddress; - PVOID Reserved2[4]; - ULONG_PTR UniqueProcessId[2]; - PVOID Reserved3[2]; -} PROCESS_BASIC_INFORMATION_WOW64; + NTSTATUS ExitStatus; + ULONG_PTR PebBaseAddress; + ULONG_PTR AffinityMask; + KPRIORITY BasePriority; + ULONG_PTR UniqueProcessId; + ULONG_PTR InheritedFromUniqueProcessId; +} PROCESS_BASIC_INFORMATION_INTERNAL; typedef struct _UNICODE_STRING_WOW64 { @@ -305,7 +305,7 @@ typedef struct { uint64_t pid; // PID of the process uint8_t access_rights; // rwx access rights uint32_t seen_on_pass; // nPass value of when this process was last detected - char cmdline[MAX_PATH]; // Command line for the process + char cmdline[2 * KB]; // Command line for the process } ProcessEntry; typedef struct { diff --git a/src/process.c b/src/process.c index 71d2bdf8..7a06e7e8 100644 --- a/src/process.c +++ b/src/process.c @@ -4,7 +4,7 @@ * * Modified from System Informer (a.k.a. Process Hacker): * https://github.com/winsiderss/systeminformer - * Copyright © 2017-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2017-2026 Pete Batard <pete@akeo.ie> * Copyright © 2017 dmex * Copyright © 2009-2016 wj32 * @@ -275,6 +275,31 @@ NTSTATUS PhQueryProcessesUsingVolumeOrFile(HANDLE VolumeOrFileHandle, return status; } +/** + * Return the parent PID of a process + * + * \param pid The PID of the process to look up the parent PID. + * + * \return The parent PID or 0 on error. + */ +DWORD GetPPID(DWORD pid) +{ + ULONG_PTR ppid = 0; + HANDLE hProcess = NULL; + PROCESS_BASIC_INFORMATION_INTERNAL pbi = { 0 }; + + hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid); + if (hProcess == NULL) + goto out; + + if (NT_SUCCESS(NtQueryInformationProcess(hProcess, ProcessBasicInformation, &pbi, sizeof(pbi), NULL))) + ppid = pbi.InheritedFromUniqueProcessId; + +out: + safe_closehandle(hProcess); + return (DWORD)ppid; +} + /** * Query the full commandline that was used to create a process. * This can be helpful to differentiate between service instances (svchost.exe). @@ -293,6 +318,7 @@ static PWSTR GetProcessCommandLine(HANDLE hProcess) NTSTATUS status = STATUS_SUCCESS; SYSTEM_INFO si; PBYTE peb = NULL, pp = NULL; + PROCESS_BASIC_INFORMATION_INTERNAL pbi = { 0 }; // Determine if 64 or 32-bit processor GetNativeSystemInfo(&si); @@ -315,14 +341,13 @@ static PWSTR GetProcessCommandLine(HANDLE hProcess) IsWow64Process(GetCurrentProcess(), &wow); if (wow) { // 32-bit process running on a 64-bit OS - PROCESS_BASIC_INFORMATION_WOW64 pbi = { 0 }; ULONGLONG params; UNICODE_STRING_WOW64* ucmdline; PF_INIT_OR_OUT(NtWow64QueryInformationProcess64, NtDll); PF_INIT_OR_OUT(NtWow64ReadVirtualMemory64, NtDll); - status = pfNtWow64QueryInformationProcess64(hProcess, 0, &pbi, sizeof(pbi), NULL); + status = pfNtWow64QueryInformationProcess64(hProcess, ProcessBasicInformation, &pbi, sizeof(pbi), NULL); if (!NT_SUCCESS(status)) goto out; @@ -347,16 +372,15 @@ static PWSTR GetProcessCommandLine(HANDLE hProcess) } } else { // 32-bit process on a 32-bit OS, or 64-bit process on a 64-bit OS - PROCESS_BASIC_INFORMATION pbi = { 0 }; PBYTE* params; UNICODE_STRING* ucmdline; - status = NtQueryInformationProcess(hProcess, 0, &pbi, sizeof(pbi), NULL); + status = NtQueryInformationProcess(hProcess, ProcessBasicInformation, &pbi, sizeof(pbi), NULL); if (!NT_SUCCESS(status)) goto out; // Read PEB - if (!ReadProcessMemory(hProcess, pbi.PebBaseAddress, peb, pp_offset + 8, NULL)) + if (!ReadProcessMemory(hProcess, (LPCVOID)pbi.PebBaseAddress, peb, pp_offset + 8, NULL)) goto out; // Read Process Parameters @@ -367,7 +391,7 @@ static PWSTR GetProcessCommandLine(HANDLE hProcess) ucmdline = (UNICODE_STRING*)(pp + cmd_offset); // In the absolute, someone could craft a process with dodgy attributes to try to cause an overflow // coverity[cast_overflow] - ucmdline->Length = min(ucmdline->Length, (USHORT)512); + ucmdline->Length = min(ucmdline->Length, (USHORT)2 * KB); wcmdline = (PWSTR)calloc(ucmdline->Length + 1, sizeof(WCHAR)); if (!ReadProcessMemory(hProcess, ucmdline->Buffer, wcmdline, ucmdline->Length, NULL)) { safe_free(wcmdline); @@ -410,7 +434,7 @@ static DWORD WINAPI SearchProcessThread(LPVOID param) DWORD size; wchar_t wexe_path[MAX_PATH], *wcmdline; uint64_t start_time; - char cmdline[MAX_PATH] = { 0 }, tmp[64]; + char cmdline[2 * KB] = { 0 }, tmp[64]; int cur_pid, j, nHandles = 0; // Initialize the blocking process struct @@ -872,10 +896,11 @@ static BOOL IsProcessRunning(uint64_t pid) BYTE GetProcessSearch(uint32_t timeout, uint8_t access_mask, BOOL bIgnoreStaleProcesses) { const char* access_rights_str[8] = { "n", "r", "w", "rw", "x", "rx", "wx", "rwx" }; - char tmp[MAX_PATH]; + char tmp[2 * KB]; int i, j; uint32_t elapsed = 0; BYTE returned_mask = 0; +// DWORD pid, rufus_pid = GetCurrentProcessId(); StrArrayClear(&BlockingProcessList); if (hSearchProcessThread == NULL) { @@ -912,6 +937,9 @@ retry: continue; if (bIgnoreStaleProcesses && !IsProcessRunning(blocking_process.Process[i].pid)) continue; +// for (pid = (DWORD)blocking_process.Process[i].pid; pid != 0 && pid != rufus_pid; pid = GetPPID(pid)); +// if (pid == rufus_pid) +// continue; returned_mask |= blocking_process.Process[i].access_rights; static_sprintf(tmp, "● [%llu] %s (%s)", blocking_process.Process[i].pid, blocking_process.Process[i].cmdline, access_rights_str[blocking_process.Process[i].access_rights & 0x7]); diff --git a/src/rufus.c b/src/rufus.c index aec9eccc..4ad35e2d 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1,6 +1,6 @@ /* * Rufus: The Reliable USB Formatting Utility - * Copyright © 2011-2025 Pete Batard <pete@akeo.ie> + * Copyright © 2011-2026 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -3141,7 +3141,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA PrintInfo(0, MSG_212); MessageBeep(MB_ICONERROR); FlashTaskbar(dialog_handle); - GetProcessSearch(0, 0x07, FALSE); + GetProcessSearch(0, 0x07, TRUE); if (BlockingProcessList.Index > 0) { ListDialog(lmprintf(MSG_042), lmprintf(MSG_055), BlockingProcessList.String, BlockingProcessList.Index); } else { diff --git a/src/rufus.rc b/src/rufus.rc index fc6ba323..6e55655b 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.12.2305" +CAPTION "Rufus 4.12.2306" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2305,0 - PRODUCTVERSION 4,12,2305,0 + FILEVERSION 4,12,2306,0 + PRODUCTVERSION 4,12,2306,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2305" + VALUE "FileVersion", "4.12.2306" 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.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2305" + VALUE "ProductVersion", "4.12.2306" END END BLOCK "VarFileInfo" From 1efb25b06bf24c2fe4fbf27197b3eed61e509552 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 14 Jan 2026 23:38:14 +0000 Subject: [PATCH 116/192] [iso] fix Rufus saving images as FFU instead of ISO, when FFU is not supported * Our image type selection forgot to shift the actual type to ISO when FFU is not supported, leading to dism being invoked instead of oscdimg. * Closes #2889. * Also make sure the UDF label is no more than 32 characters. * Also increase the oscdimg.exe commandline size as 256 characters may not be enough with long paths. * Also try to report 'oscdimg.exe` errors in the log instead of silencing them. * Also fix devices with (non-USB-compliant) VID 0000 being ignored by default. --- src/dev.c | 3 ++- src/iso.c | 8 +++++++- src/rufus.rc | 10 +++++----- src/stdfn.c | 7 +++++-- src/vhd.c | 16 ++++++++++------ 5 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/dev.c b/src/dev.c index 6473673e..5d785e8f 100644 --- a/src/dev.c +++ b/src/dev.c @@ -838,7 +838,8 @@ BOOL GetDevices(DWORD devnum) } // Also ignore USB devices that have been specifically flagged by the user for (s = 0; s < ARRAYSIZE(ignore_vid_pid); s++) { - if ((props.vid == (ignore_vid_pid[s] >> 16)) && (props.pid == (ignore_vid_pid[s] & 0xffff))) { + if (ignore_vid_pid[s] != 0 && (props.vid == (ignore_vid_pid[s] >> 16)) && + (props.pid == (ignore_vid_pid[s] & 0xffff))) { uprintf("Ignoring '%s' (%s), per user settings", buffer, str); break; } diff --git a/src/iso.c b/src/iso.c index cbf85e91..5bb1084d 100644 --- a/src/iso.c +++ b/src/iso.c @@ -2200,10 +2200,16 @@ DWORD WINAPI IsoSaveImageThread(void* param) { DWORD r; IMG_SAVE* img_save = (IMG_SAVE*)param; - char cmd[2 * MAX_PATH], letters[27], * label; + char cmd[2 * KB], letters[27], *label; if (!GetDriveLabel(SelectedDrive.DeviceNumber, letters, &label, TRUE) || letters[0] == '\0') ExitThread(ERROR_NOT_FOUND); + + // UDF labels cannot be more than 32 characters (and if we have more than 32 chars we are + // using the static modifiable char buffer from GetDriveLabel(), so we can alter it). + if (strlen(label) > 32) + label[32] = '\0'; + // Save to UDF only, as Microsoft's implementation of ISO-9660 doesn't support multiextent // and produces BROKEN images if you try to add files larger than 4 GB. // Plus ISO-9660/Joliet limits labels to 16 characters and has issues with long paths. diff --git a/src/rufus.rc b/src/rufus.rc index 6e55655b..eceb19d3 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.12.2306" +CAPTION "Rufus 4.12.2307" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2306,0 - PRODUCTVERSION 4,12,2306,0 + FILEVERSION 4,12,2307,0 + PRODUCTVERSION 4,12,2307,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2306" + VALUE "FileVersion", "4.12.2307" 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.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2306" + VALUE "ProductVersion", "4.12.2307" END END BLOCK "VarFileInfo" diff --git a/src/stdfn.c b/src/stdfn.c index f0ce8647..43819d4b 100644 --- a/src/stdfn.c +++ b/src/stdfn.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Standard Windows function calls - * Copyright © 2013-2025 Pete Batard <pete@akeo.ie> + * Copyright © 2013-2026 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -803,7 +803,7 @@ DWORD RunCommandWithProgress(const char* cmd, const char* dir, BOOL log, int msg PROCESS_INFORMATION pi = { 0 }; SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE }; HANDLE hOutputRead = INVALID_HANDLE_VALUE, hOutputWrite = INVALID_HANDLE_VALUE; - static char* output; + static char *output, *p; cregex_node_t* node = NULL; cregex_program_t* program = NULL; char* matches[REGEX_VM_MAX_MATCHES]; @@ -880,6 +880,9 @@ DWORD RunCommandWithProgress(const char* cmd, const char* dir, BOOL log, int msg } else if (log) { // output may contain a '%' so don't feed it as a naked format string uprintf("%s", output); + } else if ((p = strstr(output, "ERROR:")) != NULL) { + // Mostly for oscdimg.exe errors + uprintf("%s", p); } } free(output); diff --git a/src/vhd.c b/src/vhd.c index 7010fdbb..578a7105 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Virtual Disk Handling functions - * Copyright © 2013-2025 Pete Batard <pete@akeo.ie> + * Copyright © 2013-2026 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -564,7 +564,7 @@ static DWORD WINAPI FfuSaveImageThread(void* param) { DWORD r; IMG_SAVE* img_save = (IMG_SAVE*)param; - char cmd[MAX_PATH + 128], letters[27], *label; + char cmd[2 * KB], letters[27], *label; GetDriveLabel(SelectedDrive.DeviceNumber, letters, &label, TRUE); static_sprintf(cmd, "dism /Capture-Ffu /CaptureDrive:%s /ImageFile:\"%s\" " @@ -593,9 +593,10 @@ BOOL SaveImage(void) static IMG_SAVE img_save; char filename[128], letters[27], path[MAX_PATH]; int DriveIndex = ComboBox_GetCurSel(hDeviceList); - enum { image_type_vhd = 1, image_type_vhdx = 2, image_type_ffu = 3, image_type_iso = 4 }; + enum { image_type_none = 0, image_type_vhd, image_type_vhdx, image_type_ffu, image_type_iso }; static EXT_DECL(img_ext, filename, __VA_GROUP__("*.vhd", "*.vhdx", "*.ffu", "*.iso"), __VA_GROUP__(lmprintf(MSG_343), lmprintf(MSG_342), lmprintf(MSG_344), lmprintf(MSG_036))); + int i_to_type[5] = { image_type_none, image_type_vhd, image_type_vhdx, image_type_ffu, image_type_iso }; ULARGE_INTEGER free_space; memset(&img_save, 0, sizeof(IMG_SAVE)); @@ -611,8 +612,10 @@ BOOL SaveImage(void) img_ext.count += 1; } else { // Move the ISO extension one place down - img_ext.extension[2] = img_ext.extension[3]; - img_ext.description[2] = img_ext.description[3]; + img_ext.extension[image_type_ffu - 1] = img_ext.extension[image_type_iso - 1]; + img_ext.description[image_type_ffu - 1] = img_ext.description[image_type_iso - 1]; + i_to_type[image_type_ffu] = image_type_iso; + i_to_type[image_type_iso] = image_type_none; } // ISO support requires a mounted file system if (GetDriveLetters(SelectedDrive.DeviceNumber, letters) && letters[0] != '\0') @@ -632,7 +635,8 @@ BOOL SaveImage(void) save_image_type = (char*)&img_ext.extension[i - 1][2]; WriteSettingStr(SETTING_PREFERRED_SAVE_IMAGE_TYPE, save_image_type); } - switch (i) { + assert(i < ARRAYSIZE(i_to_type)); + switch (i_to_type[i]) { case image_type_vhd: img_save.Type = VIRTUAL_STORAGE_TYPE_DEVICE_VHD; break; From 06c2924296921f14703dc2511f52ac0b502a67a6 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 15 Jan 2026 18:21:05 +0000 Subject: [PATCH 117/192] [dev] filter out the new Bitdefender VHDs * It appears that Bitdefender now mounts a 32 MB VHD on the system where it is installed, so filter it out. * For reference, this is how it is otherwise detected by Rufus: Found VHD device 'Microsoft Virtual Disk' Disk type: FIXED, Disk size: 33 MB, Sector size: 512 bytes Cylinders: 4, Tracks per cylinder: 255, Sectors per track: 63 Partition type: GPT, NB Partitions: 1 Disk GUID: {3A182634-ECAF-4D9C-9CE0-9E61EC7A093A} Max parts: 128, Start Offset: 17408, Usable = 33520128 bytes Partition 1: Type: Microsoft Basic Data Partition Name: 'Bitdefender Partition' Detected File System: NTFS ID: {BA5FBC33-B5DD-4468-B9FB-349269EF43B8} Size: 31.9 MB (33488896 bytes) Start Sector: 64, Attributes: 0x8000000000000001 --- src/dev.c | 7 +++++++ src/rufus.rc | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/dev.c b/src/dev.c index 5d785e8f..f5d5ece6 100644 --- a/src/dev.c +++ b/src/dev.c @@ -473,6 +473,7 @@ BOOL GetDevices(DWORD devnum) }; const char* usb_speed_name[USB_SPEED_MAX] = { "USB", "USB 1.0", "USB 1.1", "USB 2.0", "USB 3.0", "USB 3.1" }; const char* windows_sandbox_vhd_label = "PortableBaseLayer"; + const char* bitdefender_label = "Bitdefender Partition"; // Hash table and String Array used to match a Device ID with the parent hub's Device Interface Path htab_table htab_devid = HTAB_EMPTY; StrArray dev_if_path = STRARRAY_EMPTY; @@ -966,6 +967,12 @@ BOOL GetDevices(DWORD devnum) safe_free(devint_detail_data); break; } + // Bitdefender now uses a special 32 MB VHD + if (props.is_VHD && safe_strcmp(label, bitdefender_label) == 0 && GetDriveSize(drive_index) <= 32 * MB) { + uprintf("Device eliminated because it is a Bitdefender VHD"); + safe_free(devint_detail_data); + break; + } if (props.is_VHD && (!enable_VHDs)) { uprintf("Device eliminated because listing of VHDs is disabled (Alt-G)"); safe_free(devint_detail_data); diff --git a/src/rufus.rc b/src/rufus.rc index eceb19d3..071b50eb 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.12.2307" +CAPTION "Rufus 4.12.2308" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2307,0 - PRODUCTVERSION 4,12,2307,0 + FILEVERSION 4,12,2308,0 + PRODUCTVERSION 4,12,2308,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2307" + VALUE "FileVersion", "4.12.2308" 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.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2307" + VALUE "ProductVersion", "4.12.2308" END END BLOCK "VarFileInfo" From 913fd56fb5bbc3bc57c0e15814cdb59b9b945ad3 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Sat, 17 Jan 2026 15:15:22 +0000 Subject: [PATCH 118/192] [process] don't report read-only access from explorer.exe in potentially conflicting processes --- src/process.c | 6 ++++++ src/rufus.rc | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/process.c b/src/process.c index 7a06e7e8..aa9491ee 100644 --- a/src/process.c +++ b/src/process.c @@ -940,6 +940,12 @@ retry: // for (pid = (DWORD)blocking_process.Process[i].pid; pid != 0 && pid != rufus_pid; pid = GetPPID(pid)); // if (pid == rufus_pid) // continue; + // Ignore read-only access from explorer.exe, as it's usually no big deal + if (blocking_process.Process[i].access_rights == 0x1 && + // NB: We are not bothering with nonstandard system drives here + _stricmp(blocking_process.Process[i].cmdline, "C:\\Windows\\explorer.exe") == 0) { + continue; + } returned_mask |= blocking_process.Process[i].access_rights; static_sprintf(tmp, "● [%llu] %s (%s)", blocking_process.Process[i].pid, blocking_process.Process[i].cmdline, access_rights_str[blocking_process.Process[i].access_rights & 0x7]); diff --git a/src/rufus.rc b/src/rufus.rc index 071b50eb..ecae01cc 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.12.2308" +CAPTION "Rufus 4.12.2309" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2308,0 - PRODUCTVERSION 4,12,2308,0 + FILEVERSION 4,12,2309,0 + PRODUCTVERSION 4,12,2309,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2308" + VALUE "FileVersion", "4.12.2309" 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.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2308" + VALUE "ProductVersion", "4.12.2309" END END BLOCK "VarFileInfo" From 6e5bd4424fe86dd95c99d55dfb19623c9638694e Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Sat, 17 Jan 2026 15:29:37 +0000 Subject: [PATCH 119/192] [hash] add FileMatchesHash() and BufferMatchedHash() calls * Also improve our hex string conversion function and make it public. --- src/hash.c | 44 +++++++++++++++++++++++++++++++------------- src/rufus.h | 4 +++- src/rufus.rc | 10 +++++----- 3 files changed, 39 insertions(+), 19 deletions(-) diff --git a/src/hash.c b/src/hash.c index 6be9e50c..20a354bc 100644 --- a/src/hash.c +++ b/src/hash.c @@ -2159,6 +2159,22 @@ BOOL IsFileInDB(const char* path) return FALSE; } +BOOL FileMatchesHash(const char* path, const char* str) +{ + uint8_t hash[SHA256_HASHSIZE]; + if (!HashFile(HASH_SHA256, path, hash)) + return FALSE; + return (memcmp(hash, StringToHash(str), SHA256_HASHSIZE) == 0); +} + +BOOL BufferMatchesHash(const uint8_t* buf, const size_t len, const char* str) +{ + uint8_t hash[SHA256_HASHSIZE]; + if (!HashBuffer(HASH_SHA256, buf, len, hash)) + return FALSE; + return (memcmp(hash, StringToHash(str), SHA256_HASHSIZE) == 0); +} + static BOOL IsRevokedBySbat(uint8_t* buf, uint32_t len) { char* sbat = NULL, *version_str; @@ -2575,22 +2591,25 @@ void UpdateMD5Sum(const char* dest_dir, const char* md5sum_name) free(md5_data); } -#if defined(_DEBUG) || defined(TEST) || defined(ALPHA) -/* Convert a lowercase hex string to binary. Returned value must be freed */ -uint8_t* to_bin(const char* str) +/* Convert an (unprefixed) hex string to hash binary. Non concurrent. */ +uint8_t* StringToHash(const char* str) { + static uint8_t ret[MAX_HASHSIZE]; size_t i, len = safe_strlen(str); - uint8_t val = 0, *ret = NULL; + uint8_t val = 0; + char c; - if ((len < 2) || (len % 2)) - return NULL; - ret = malloc(len / 2); - if (ret == NULL) + if_assert_fails(len / 2 == MD5_HASHSIZE || len / 2 == SHA1_HASHSIZE || + len / 2 == SHA256_HASHSIZE || len / 2 == SHA512_HASHSIZE) return NULL; + memset(ret, 0, sizeof(ret)); for (i = 0; i < len; i++) { val <<= 4; - val |= ((str[i] - '0') < 0xa) ? (str[i] - '0') : (str[i] - 'a' + 0xa); + c = tolower(str[i]); + if_assert_fails((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f')) + return NULL; + val |= ((c - '0') < 0xa) ? (c - '0') : (c - 'a' + 0xa); if (i % 2) ret[i / 2] = val; } @@ -2598,6 +2617,7 @@ uint8_t* to_bin(const char* str) return ret; } +#if defined(_DEBUG) || defined(TEST) || defined(ALPHA) const char test_msg[] = "Did you ever hear the tragedy of Darth Plagueis The Wise? " "I thought not. It's not a story the Jedi would tell you. It's a Sith legend. " "Darth Plagueis was a Dark Lord of the Sith, so powerful and so wise he could " @@ -2645,7 +2665,7 @@ int TestHashes(void) const uint32_t blocksize[HASH_MAX] = { MD5_BLOCKSIZE, SHA1_BLOCKSIZE, SHA256_BLOCKSIZE, SHA512_BLOCKSIZE }; const char* hash_name[4] = { "MD5 ", "SHA1 ", "SHA256", "SHA512" }; int i, j, errors = 0; - uint8_t hash[MAX_HASHSIZE], *hash_expected; + uint8_t hash[MAX_HASHSIZE]; size_t full_msg_len = strlen(test_msg); char* msg = malloc(full_msg_len + 1); if (msg == NULL) @@ -2668,14 +2688,12 @@ int TestHashes(void) if (i != 0) memcpy(msg, test_msg, copy_msg_len[i]); HashBuffer(j, msg, copy_msg_len[i], hash); - hash_expected = to_bin(test_hash[j][i]); - if (memcmp(hash, hash_expected, hash_count[j]) != 0) { + if (memcmp(hash, StringToHash(test_hash[j][i]), hash_count[j]) != 0) { uprintf("Test %s %d: FAIL", hash_name[j], i); errors++; } else { uprintf("Test %s %d: PASS", hash_name[j], i); } - free(hash_expected); } } diff --git a/src/rufus.h b/src/rufus.h index 9043cac4..598ab047 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -129,7 +129,6 @@ #define FILES_DIR APPLICATION_NAME #define FIDO_VERSION "z1" #define WPPRECORDER_MORE_INFO_URL "https://github.com/pbatard/rufus/wiki/FAQ#bsods-with-windows-to-go-drives-created-from-windows-10-1809-isos" -#define SEVENZIP_URL "https://7-zip.org/" // Generated by following https://randomascii.wordpress.com/2013/03/09/symbols-the-microsoft-way/ #define DISKCOPY_URL "https://msdl.microsoft.com/download/symbols/diskcopy.dll/54505118173000/diskcopy.dll" #define DISKCOPY_SIZE 0x16ee00 @@ -876,6 +875,9 @@ extern BOOL HashFile(const unsigned type, const char* path, uint8_t* sum); extern BOOL PE256Buffer(uint8_t* buf, uint32_t len, uint8_t* hash); extern void UpdateMD5Sum(const char* dest_dir, const char* md5sum_name); extern BOOL HashBuffer(const unsigned type, const uint8_t* buf, const size_t len, uint8_t* sum); +extern uint8_t* StringToHash(const char* str); +extern BOOL FileMatchesHash(const char* path, const char* str); +extern BOOL BufferMatchesHash(const uint8_t* buf, const size_t len, const char* str); extern BOOL IsFileInDB(const char* path); extern BOOL IsSignedBySecureBootAuthority(uint8_t* buf, uint32_t len); extern int IsBootloaderRevoked(uint8_t* buf, uint32_t len); diff --git a/src/rufus.rc b/src/rufus.rc index ecae01cc..9ccb0253 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.12.2309" +CAPTION "Rufus 4.12.2310" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2309,0 - PRODUCTVERSION 4,12,2309,0 + FILEVERSION 4,12,2310,0 + PRODUCTVERSION 4,12,2310,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2309" + VALUE "FileVersion", "4.12.2310" 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.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2309" + VALUE "ProductVersion", "4.12.2310" END END BLOCK "VarFileInfo" From de12649c99d34246470e0fd8e4bffafb01c4f708 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Sat, 17 Jan 2026 16:24:19 +0000 Subject: [PATCH 120/192] [core] add hash validation for diskcopy.dll and oscdimg.exe usage * Whereas their location in AppData should prevent other users from replacing these files, it is still possible for an unprivileged app ran by the same user to alter them after they have been downloaded. * To prevent this (as well as more elaborate TOCTOUs on these specific files) we now open a read-only handle (with *no* file sharing rights), then validate the SHA256 hash (since these files are known at the time of compilation) and only once validated (but without relinquishing the exclusive handle) run or access the content of the file. * Also add an arch suffix to the oscdimg.exe, so that we don't run into a situation where x86 and x64 Rufus may complain about a previously downloaded exe. * Also improve error handling from SaveImage() and fully qualify the dism.exe calls. --- src/dos.c | 15 ++++++++++----- src/format.c | 2 +- src/iso.c | 26 ++++++++++++++++++++++---- src/rufus.c | 12 ++++++++++-- src/rufus.h | 5 +++++ src/rufus.rc | 10 +++++----- src/vhd.c | 26 ++++++++++++++------------ 7 files changed, 67 insertions(+), 29 deletions(-) diff --git a/src/dos.c b/src/dos.c index f4b3f1cc..96624542 100644 --- a/src/dos.c +++ b/src/dos.c @@ -290,21 +290,25 @@ static BOOL ExtractMSDOS(const char* path) { int i, j; BOOL r = FALSE; - uint8_t* diskcopy_buffer = NULL; + DWORD size = DISKCOPY_SIZE; + HANDLE dll_handle = INVALID_HANDLE_VALUE; + uint8_t* diskcopy_buffer = malloc(DISKCOPY_SIZE); char locale_path[MAX_PATH]; char diskcopy_dll_path[MAX_PATH]; char* extractlist[] = { "MSDOS SYS", "COMMAND COM", "IO SYS", "MODE COM", "KEYB COM", "KEYBOARDSYS", "KEYBRD2 SYS", "KEYBRD3 SYS", "KEYBRD4 SYS", "DISPLAY SYS", "EGA CPI", "EGA2 CPI", "EGA3 CPI" }; - if (path == NULL) + if (path == NULL || diskcopy_buffer == NULL) return FALSE; // There should be a diskcopy.dll in the user's AppData directory. - // Since we're working with a known copy of diskcopy.dll, just load it - // in memory and point to the known disk image resource buffer. + // Since we're working with a known copy of diskcopy.dll, just load it in memory + // (after locking and validating it) and point to the known disk image resource buffer. static_sprintf(diskcopy_dll_path, "%s\\%s\\diskcopy.dll", app_data_dir, FILES_DIR); - if (read_file(diskcopy_dll_path, &diskcopy_buffer) != DISKCOPY_SIZE) { + dll_handle = CreateFileU(diskcopy_dll_path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (dll_handle == INVALID_HANDLE_VALUE || !ReadFile(dll_handle, diskcopy_buffer, size, &size, NULL) || + size != DISKCOPY_SIZE || !BufferMatchesHash(diskcopy_buffer, size, DISKCOPY_HASH)) { uprintf("'diskcopy.dll' was either not found or is invalid"); goto out; } @@ -331,6 +335,7 @@ static BOOL ExtractMSDOS(const char* path) r = SetDOSLocale(path, FALSE); out: + safe_closehandle(dll_handle); safe_free(diskcopy_buffer); return r; } diff --git a/src/format.c b/src/format.c index b75dca9d..8bbe644c 100644 --- a/src/format.c +++ b/src/format.c @@ -1682,7 +1682,7 @@ try_clear: goto out; safe_unlockclose(hPhysicalDrive); physical = GetPhysicalName(SelectedDrive.DeviceNumber); - static_sprintf(cmd, "dism /Apply-Ffu /ApplyDrive:%s /ImageFile:\"%s\"", physical, image_path); + static_sprintf(cmd, "%s\\dism.exe /Apply-Ffu /ApplyDrive:%s /ImageFile:\"%s\"", sysnative_dir, physical, image_path); safe_free(physical); uprintf("Running command: '%s'", cmd); cr = RunCommandWithProgress(cmd, sysnative_dir, TRUE, MSG_261, ".*\r\\[[= ]+([0-9\\.]+)%[= ]+\\].*"); diff --git a/src/iso.c b/src/iso.c index 5bb1084d..398083d9 100644 --- a/src/iso.c +++ b/src/iso.c @@ -2198,12 +2198,27 @@ void OpticalDiscSaveImage(void) // Create an ISO image from the currently selected drive, using oscdimg.exe DWORD WINAPI IsoSaveImageThread(void* param) { - DWORD r; + DWORD r = ERROR_NOT_FOUND; + HANDLE exe = INVALID_HANDLE_VALUE; IMG_SAVE* img_save = (IMG_SAVE*)param; char cmd[2 * KB], letters[27], *label; if (!GetDriveLabel(SelectedDrive.DeviceNumber, letters, &label, TRUE) || letters[0] == '\0') - ExitThread(ERROR_NOT_FOUND); + goto out; + + // Get a lock and validate that the oscdimg.exe has not been tampered with + static_sprintf(cmd, "%s\\%s\\oscdimg_%s.exe", app_data_dir, FILES_DIR, APPLICATION_ARCH); + exe = CreateFileU(cmd, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (exe == INVALID_HANDLE_VALUE) { + uprintf("ERROR: Could not lock 'oscdimg.exe'"); + r = GetLastError(); + goto out; + } + if (!FileMatchesHash(cmd, OSCDIMG_HASH)) { + uprintf("ERROR: Existing 'oscdimg.exe' hash does not match expected value!"); + r = ERROR_INVALID_IMAGE_HASH; + goto out; + } // UDF labels cannot be more than 32 characters (and if we have more than 32 chars we are // using the static modifiable char buffer from GetDriveLabel(), so we can alter it). @@ -2213,11 +2228,14 @@ DWORD WINAPI IsoSaveImageThread(void* param) // Save to UDF only, as Microsoft's implementation of ISO-9660 doesn't support multiextent // and produces BROKEN images if you try to add files larger than 4 GB. // Plus ISO-9660/Joliet limits labels to 16 characters and has issues with long paths. - static_sprintf(cmd, "%s\\%s\\oscdimg.exe -g -h -k -l\"%s\" -m -u2 -udfver102 %c:\\ \"%s\"", - app_data_dir, FILES_DIR, label, letters[0], img_save->ImagePath); + static_sprintf(cmd, "\"%s\\%s\\oscdimg_%s.exe\" -g -h -k -l\"%s\" -m -u2 -udfver102 %c:\\ \"%s\"", + app_data_dir, FILES_DIR, APPLICATION_ARCH, label, letters[0], img_save->ImagePath); uprintf("Running command: '%s'", cmd); // For detecting typical oscdimg commandline progress report of type: "\r15.5% complete" r = RunCommandWithProgress(cmd, sysnative_dir, FALSE, MSG_261, ".*\r([0-9\\.]+)% complete.*"); + +out: + safe_closehandle(exe); if (r != 0 && !IS_ERROR(ErrorStatus)) { SetLastError(r); uprintf("Failed to write ISO image: %s", WindowsErrorString()); diff --git a/src/rufus.c b/src/rufus.c index 4ad35e2d..b92bf1d6 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -2658,7 +2658,6 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA MyDialogBox(hMainInstance, IDD_UPDATE_POLICY, hDlg, UpdateCallback); break; case IDC_HASH: - // TODO: Move this as a fn call in hash.c? if ((format_thread == NULL) && (image_path != NULL)) { ErrorStatus = 0; no_confirmation_on_cancel = TRUE; @@ -2680,7 +2679,15 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA } break; case IDC_SAVE: - save_image = SaveImage(); + if (format_thread == NULL && (ComboBox_GetCurSel(hDeviceList) >= 0)) { + save_image = SaveImage(); + if (!save_image) { + uprintf("Unable to start image save thread"); + if (!IS_ERROR(ErrorStatus)) + ErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_START_THREAD)); + PostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)FALSE, 0); + } + } break; case IDM_SELECT: case IDM_DOWNLOAD: @@ -3142,6 +3149,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA MessageBeep(MB_ICONERROR); FlashTaskbar(dialog_handle); GetProcessSearch(0, 0x07, TRUE); + // TODO: Fix/Improve this if (BlockingProcessList.Index > 0) { ListDialog(lmprintf(MSG_042), lmprintf(MSG_055), BlockingProcessList.String, BlockingProcessList.Index); } else { diff --git a/src/rufus.h b/src/rufus.h index 598ab047..1f011224 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -131,17 +131,22 @@ #define WPPRECORDER_MORE_INFO_URL "https://github.com/pbatard/rufus/wiki/FAQ#bsods-with-windows-to-go-drives-created-from-windows-10-1809-isos" // Generated by following https://randomascii.wordpress.com/2013/03/09/symbols-the-microsoft-way/ #define DISKCOPY_URL "https://msdl.microsoft.com/download/symbols/diskcopy.dll/54505118173000/diskcopy.dll" +#define DISKCOPY_HASH "95fc0786f5bc0a6db5c0604b31ac18fbed0502a2c6858e5fb02a647983ae03c7" #define DISKCOPY_SIZE 0x16ee00 #define DISKCOPY_IMAGE_OFFSET 0x66d8 #define DISKCOPY_IMAGE_SIZE 0x168000 #if defined(_M_AMD64) #define OSCDIMG_URL "https://msdl.microsoft.com/download/symbols/oscdimg.exe/688CABB065000/oscdimg.exe" +#define OSCDIMG_HASH "2000160b2c5044691b2f9a0ac308e5207f273d4880a572457af16d05886ba861" #elif defined(_M_IX86) #define OSCDIMG_URL "https://msdl.microsoft.com/download/symbols/oscdimg.exe/704FD1B760000/oscdimg.exe" +#define OSCDIMG_HASH "cbd6872265d44e88897905bdc47f7035d64ad1775ab890ea59db13ec92d867eb" #elif defined(_M_ARM64) #define OSCDIMG_URL "https://msdl.microsoft.com/download/symbols/oscdimg.exe/02633D8D66000/oscdimg.exe" +#define OSCDIMG_HASH "80c059815d82fca009841143a821f79c8ac78dba12bb63dc07842f1a2a552666" #elif defined(_M_ARM) #define OSCDIMG_URL "https://msdl.microsoft.com/download/symbols/oscdimg.exe/9CD825745F000/oscdimg.exe" +#define OSCDIMG_HASH "5ecd9956da589baa65806c884a55f9303ec6c6c559bdeb8afe00c72614a24c7a" #endif #define SYMBOL_SERVER_USER_AGENT "Microsoft-Symbol-Server/10.0.22621.755" #define DEFAULT_ESP_MOUNT_POINT "S:\\" diff --git a/src/rufus.rc b/src/rufus.rc index 9ccb0253..1a65b40d 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.12.2310" +CAPTION "Rufus 4.12.2311" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2310,0 - PRODUCTVERSION 4,12,2310,0 + FILEVERSION 4,12,2311,0 + PRODUCTVERSION 4,12,2311,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2310" + VALUE "FileVersion", "4.12.2311" 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.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2310" + VALUE "ProductVersion", "4.12.2311" END END BLOCK "VarFileInfo" diff --git a/src/vhd.c b/src/vhd.c index 578a7105..d9003b43 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -567,8 +567,8 @@ static DWORD WINAPI FfuSaveImageThread(void* param) char cmd[2 * KB], letters[27], *label; GetDriveLabel(SelectedDrive.DeviceNumber, letters, &label, TRUE); - static_sprintf(cmd, "dism /Capture-Ffu /CaptureDrive:%s /ImageFile:\"%s\" " - "/Name:\"%s\" /Description:\"Created by %s (%s)\"", + static_sprintf(cmd, "%s\\dism.exe /Capture-Ffu /CaptureDrive:%s /ImageFile:\"%s\" " + "/Name:\"%s\" /Description:\"Created by %s (%s)\"", sysnative_dir, img_save->DevicePath, img_save->ImagePath, label, APPLICATION_NAME, RUFUS_URL); uprintf("Running command: '%s'", cmd); // For detecting typical dism.exe commandline progress report of type: @@ -600,7 +600,8 @@ BOOL SaveImage(void) ULARGE_INTEGER free_space; memset(&img_save, 0, sizeof(IMG_SAVE)); - if ((DriveIndex < 0) || (format_thread != NULL)) + // Should have been validated prior to calling SaveImage() + if_assert_fails((DriveIndex >= 0) && (format_thread == NULL)) return FALSE; static_sprintf(filename, "%s", rufus_drive[DriveIndex].label); @@ -624,8 +625,10 @@ BOOL SaveImage(void) if (i > (UINT)img_ext.count) i = image_type_vhdx; img_save.ImagePath = FileDialog(TRUE, NULL, &img_ext, &i); - if (img_save.ImagePath == NULL) + if (img_save.ImagePath == NULL) { + ErrorStatus = RUFUS_ERROR(ERROR_CANCELLED); goto out; + } // Start from the end of our extension array, since '.vhd' would match for '.vhdx' otherwise for (i = (UINT)img_ext.count; (i > 0) && (strstr(img_save.ImagePath, &img_ext.extension[i - 1][1]) == NULL); i--); if (i == 0) { @@ -645,14 +648,18 @@ BOOL SaveImage(void) break; case image_type_iso: // ISO requires oscdimg.exe. If not already present, attempt to download it. - static_sprintf(path, "%s\\%s\\oscdimg.exe", app_data_dir, FILES_DIR); + static_sprintf(path, "%s\\%s\\oscdimg_%s.exe", app_data_dir, FILES_DIR, APPLICATION_ARCH); if (!PathFileExistsU(path)) { - if (Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_115), lmprintf(MSG_337, "oscdimg.exe")) != IDYES) + if (Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_115), lmprintf(MSG_337, "oscdimg.exe")) != IDYES) { + ErrorStatus = RUFUS_ERROR(ERROR_CANCELLED); goto out; + } IGNORE_RETVAL(_chdirU(app_data_dir)); IGNORE_RETVAL(_mkdir(FILES_DIR)); - if (DownloadToFileOrBufferEx(OSCDIMG_URL, path, SYMBOL_SERVER_USER_AGENT, NULL, hMainDialog, FALSE) < 64 * KB) + if (DownloadToFileOrBufferEx(OSCDIMG_URL, path, SYMBOL_SERVER_USER_AGENT, NULL, hMainDialog, FALSE) < 64 * KB) { + ErrorStatus = GetLastError(); goto out; + } } img_save.Type = VIRTUAL_STORAGE_TYPE_DEVICE_ISO; break; @@ -673,7 +680,6 @@ BOOL SaveImage(void) && ((LONGLONG)free_space.QuadPart < (SelectedDrive.DiskSize + 512))) { uprintf("The VHD size is too large for the target drive"); ErrorStatus = RUFUS_ERROR(ERROR_FILE_TOO_LARGE); - PostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)FALSE, 0); goto out; } } @@ -688,10 +694,6 @@ BOOL SaveImage(void) uprintf("\r\nSave to image operation started"); PrintInfo(0, -1); SendMessage(hMainDialog, UM_TIMER_START, 0, 0); - } else { - uprintf("Unable to start image save thread"); - ErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_START_THREAD)); - PostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)FALSE, 0); } } out: From 460cc5768aa45be07941b9e4ebc9bee02d282873 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 22 Jan 2026 18:23:20 +0000 Subject: [PATCH 121/192] [net] fix local privilege escalation via TOCTOU race condition in Fido script handling (CVE-2026-23988) * Because PowerShell forces us to close the script we downloaded prior to execution, it is possible for a malicious background process (running unprivileged, as the same user that launches Rufus) to replace the Fido script after we downloaded and validated it, but before we actually execute the PowerShell command to run it. * See https://github.com/pbatard/rufus/security/advisories/GHSA-hcx5-hrhj-xhq9, which led to CVE-2026-23988. * To mitigate this, we now use a security descriptor, to force the script to be saved with Administrator and System access only so that an unprivileged user process does not have the capability to replace it before execution. * Issue discovered and responsibly disclosed by @independent-arg. * Fix also suggested by @independent-arg. --- src/msapi_utf8.h | 19 ++++++++++++++++++- src/net.c | 34 +++++++++++++++++++++++----------- src/rufus.rc | 10 +++++----- 3 files changed, 46 insertions(+), 17 deletions(-) diff --git a/src/msapi_utf8.h b/src/msapi_utf8.h index 5349362e..e4feb1d7 100644 --- a/src/msapi_utf8.h +++ b/src/msapi_utf8.h @@ -6,7 +6,7 @@ * * See also: https://utf8everywhere.org * - * Copyright © 2010-2025 Pete Batard <pete@akeo.ie> + * Copyright © 2010-2026 Pete Batard <pete@akeo.ie> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -37,6 +37,7 @@ #include <errno.h> #include <fcntl.h> #include <io.h> +#include <sddl.h> #include <sys/types.h> #include <sys/stat.h> #include <psapi.h> @@ -512,6 +513,22 @@ static __inline HANDLE CreateFileU(const char* lpFileName, DWORD dwDesiredAccess return ret; } +// CreateFile() that restricts file access to Admin and System only +static __inline HANDLE CreateFileRestrictedU(const char* lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, + DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes) +{ + // Restrict access to Admin (BA) and System (SY) only + const char* sddl = "D:P(A;;FA;;;BA)(A;;FA;;;SY)(A;;FR;;;WD)"; + SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, FALSE }; + HANDLE h; + + if (!ConvertStringSecurityDescriptorToSecurityDescriptorA(sddl, 1, &sa.lpSecurityDescriptor, NULL)) + return INVALID_HANDLE_VALUE; + h = CreateFileU(lpFileName, dwDesiredAccess, dwShareMode, &sa, dwCreationDisposition, dwFlagsAndAttributes, NULL); + LocalFree(sa.lpSecurityDescriptor); + return h; +} + static __inline BOOL CreateDirectoryU(const char* lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes) { BOOL ret = FALSE; diff --git a/src/net.c b/src/net.c index a0fbc6ec..32cebdf7 100644 --- a/src/net.c +++ b/src/net.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Networking functionality (web file download, check for update, etc.) - * Copyright © 2012-2025 Pete Batard <pete@akeo.ie> + * Copyright © 2012-2026 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -786,7 +786,7 @@ static DWORD WINAPI DownloadISOThread(LPVOID param) uint64_t uncompressed_size; int64_t size = -1; BYTE *compressed = NULL, *sig = NULL; - HANDLE hFile, hPipe; + HANDLE hFile = INVALID_HANDLE_VALUE, hPipe = INVALID_HANDLE_VALUE; DWORD dwExitCode = 99, dwCompressedSize, dwSize, dwAvail, dwPipeSize = 4096; GUID guid; @@ -854,10 +854,18 @@ static DWORD WINAPI DownloadISOThread(LPVOID param) } PrintInfo(0, MSG_148); - assert((fido_script != NULL) && (fido_len != 0)); + if_assert_fails((fido_script != NULL) && (fido_len != 0)) + goto out; + // Why oh why does PowerShell refuse to open read-only files that haven't been closed? + // Because of this limitation, we can't fully prevent TOCTOUs on the file we create, and therefore we: + // - Create the file with a "random" non-guessable name => TOCTOUs require a permanently running script/exe + // - Create the file in the user's AppData temp directory => TOCTOUs can't be enacted by a different user + // - Create the file with Administrator access only => TOCTOUs require elevated privileges (in which case + // the machine is already compromised anyway, so TOCTOU attacks become entirely moot) + // See https://github.com/pbatard/rufus/security/advisories/GHSA-hcx5-hrhj-xhq9 and CVE-2026-23988. static_sprintf(script_path, "%s%s.ps1", temp_dir, GuidToString(&guid, TRUE)); - hFile = CreateFileU(script_path, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY, NULL); + hFile = CreateFileRestrictedU(script_path, GENERIC_WRITE, FILE_SHARE_READ, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY); if (hFile == INVALID_HANDLE_VALUE) { uprintf("Unable to create download script '%s': %s", script_path, WindowsErrorString()); goto out; @@ -866,8 +874,6 @@ static DWORD WINAPI DownloadISOThread(LPVOID param) uprintf("Unable to write download script '%s': %s", script_path, WindowsErrorString()); goto out; } - // Why oh why does PowerShell refuse to open read-only files that haven't been closed? - // Because of this limitation, we can't use LockFileEx() on the file we create... safe_closehandle(hFile); #endif static_sprintf(powershell_path, "%s\\WindowsPowerShell\\v1.0\\powershell.exe", system_dir); @@ -885,13 +891,17 @@ static DWORD WINAPI DownloadISOThread(LPVOID param) goto out; } - static_sprintf(cmdline, "\"%s\" -NonInteractive -Sta -NoProfile –ExecutionPolicy Bypass " + // Ideally, since our script is signed, we'd have '-ExecutionPolicy AllSigned' below. + // Except that, in the myriad of execution policy options they provide, Microsoft chose + // not to add an option that allows signed scripts that validate up to the root of trust, + // but aren't in Trusted Publishers, to be validated: + // https://old.reddit.com/r/PowerShell/comments/kpwi5r/powershell_script_signing_trusted_publisher_prompt/gzi10oc/ + static_sprintf(cmdline, "\"%s\" -NonInteractive -Sta -NoProfile -ExecutionPolicy Bypass " "-File \"%s\" -PipeName %s -LocData \"%s\" -Icon \"%s\" -AppTitle \"%s\" -PlatformArch \"%s\"", powershell_path, script_path, &pipe[9], locale_str, icon_path, lmprintf(MSG_149), GetArchName(NativeMachine)); #ifndef RUFUS_TEST - // For extra security, even after we validated that the LZMA download is properly - // signed, we also validate the Authenticode signature of the local script. + // Because we can't force PowerShell to do it, we validate the signature of the local script. if (ValidateSignature(INVALID_HANDLE_VALUE, script_path) != NO_ERROR) { uprintf("FATAL: Script signature is invalid ✗"); ErrorStatus = RUFUS_ERROR(APPERR(ERROR_BAD_SIGNATURE)); @@ -945,10 +955,12 @@ static DWORD WINAPI DownloadISOThread(LPVOID param) } out: - if (icon_path[0] != 0) + safe_closehandle(hPipe); + safe_closehandle(hFile); + if (icon_path[0] != '\0') DeleteFileU(icon_path); #if !defined(RUFUS_TEST) - if (script_path[0] != 0) { + if (script_path[0] != '\0') { SetFileAttributesU(script_path, FILE_ATTRIBUTE_NORMAL); DeleteFileU(script_path); } diff --git a/src/rufus.rc b/src/rufus.rc index 1a65b40d..4fcd8543 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.12.2311" +CAPTION "Rufus 4.12.2312" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2311,0 - PRODUCTVERSION 4,12,2311,0 + FILEVERSION 4,12,2312,0 + PRODUCTVERSION 4,12,2312,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2311" + VALUE "FileVersion", "4.12.2312" 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.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2311" + VALUE "ProductVersion", "4.12.2312" END END BLOCK "VarFileInfo" From fb9dd17fe609472e201fc21d66fb8cddd6a5c10a Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 22 Jan 2026 18:31:17 +0000 Subject: [PATCH 122/192] Fix a Coverity warning * Also harmonize / improve code readability. --- ChangeLog.txt | 15 +++++++++++++++ src/dos.c | 6 +++--- src/icon.c | 4 ++-- src/rufus.c | 5 +++-- src/rufus.rc | 10 +++++----- 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 891736c0..8457293a 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,18 @@ +o Version 4.12 (2026.01.??) + Filter out the new Bitdefender VHDs + Filter disallowed characters in local account names + Improve Microsoft Dev Drive detection (courtesy of Martin Kuschnik) + Improve the pre-formatting partition cleanup code + Improve error reporting on ISO extraction issues + Improve detection of drives with long hardware IDs (typically SSDs) + Improve conflicting process reporting + Improve support for Nutanix and umbrelOS ISOs + Fix a TOCTOU vulnerability in Fido script execution (CVE-2026-2398, reported by @independent-arg) + Fix replacement vulnerabilities for diskcopy.dll and oscdimg.exe + Fix FFU image creation being erroneously invocated, when trying to save an ISO image + Fix saving of ISO images to paths that contain spaces + Update UEFI:NTFS and UEFI DBXs to latest + o Version 4.11 (2025.10.02) Add a cheat mode to toggle between Light and Dark mode Improve WUE option text relating to the CA 2023 option diff --git a/src/dos.c b/src/dos.c index 96624542..dcbae4fb 100644 --- a/src/dos.c +++ b/src/dos.c @@ -2,7 +2,7 @@ * Rufus: The Reliable USB Formatting Utility * DOS boot file extraction, from the FAT12 floppy image in diskcopy.dll * (MS WinME DOS) or from the embedded FreeDOS resource files - * Copyright © 2011-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2011-2026 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -292,14 +292,14 @@ static BOOL ExtractMSDOS(const char* path) BOOL r = FALSE; DWORD size = DISKCOPY_SIZE; HANDLE dll_handle = INVALID_HANDLE_VALUE; - uint8_t* diskcopy_buffer = malloc(DISKCOPY_SIZE); + uint8_t* diskcopy_buffer; char locale_path[MAX_PATH]; char diskcopy_dll_path[MAX_PATH]; char* extractlist[] = { "MSDOS SYS", "COMMAND COM", "IO SYS", "MODE COM", "KEYB COM", "KEYBOARDSYS", "KEYBRD2 SYS", "KEYBRD3 SYS", "KEYBRD4 SYS", "DISPLAY SYS", "EGA CPI", "EGA2 CPI", "EGA3 CPI" }; - if (path == NULL || diskcopy_buffer == NULL) + if (path == NULL || (diskcopy_buffer = malloc(DISKCOPY_SIZE)) == NULL) return FALSE; // There should be a diskcopy.dll in the user's AppData directory. diff --git a/src/icon.c b/src/icon.c index 7579050c..3aba4824 100644 --- a/src/icon.c +++ b/src/icon.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Extract icon from executable and set autorun.inf - * Copyright © 2012-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2012-2026 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -105,7 +105,7 @@ BOOL ExtractAppIcon(const char* path, BOOL bSilent) if (icondir == NULL || icondir->idCount > 64) goto out; - hFile = CreateFileU(path, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, + hFile = CreateFileU(path, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { uprintf("Unable to create icon '%s': %s.", path, WindowsErrorString()); diff --git a/src/rufus.c b/src/rufus.c index b92bf1d6..543a8ac4 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -3671,7 +3671,7 @@ skip_args_processing: goto out; } - hFile = CreateFileU(loc_file, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, + hFile = CreateFileU(loc_file, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if ((hFile == INVALID_HANDLE_VALUE) || (!WriteFileWithRetry(hFile, loc_data, loc_size, &size, WRITE_RETRIES))) { uprintf("FATAL: Unable to extract loc file '%s': %s", loc_file, WindowsErrorString()); @@ -3689,7 +3689,8 @@ skip_args_processing: } if ( (!get_supported_locales(loc_file)) - || ((selected_locale = ((locale_name == NULL)?get_locale_from_lcid(lcid, TRUE):get_locale_from_name(locale_name, TRUE))) == NULL) ) { + || ((selected_locale = ((locale_name == NULL) ? + get_locale_from_lcid(lcid, TRUE) : get_locale_from_name(locale_name, TRUE))) == NULL) ) { uprintf("FATAL: Could not access locale!"); MessageBoxA(NULL, "The locale data is missing or invalid. This application will now exit.", "Fatal error", MB_ICONERROR | MB_SYSTEMMODAL); diff --git a/src/rufus.rc b/src/rufus.rc index 4fcd8543..2a1b5933 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.12.2312" +CAPTION "Rufus 4.12.2313" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2312,0 - PRODUCTVERSION 4,12,2312,0 + FILEVERSION 4,12,2313,0 + PRODUCTVERSION 4,12,2313,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2312" + VALUE "FileVersion", "4.12.2313" 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.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2312" + VALUE "ProductVersion", "4.12.2313" END END BLOCK "VarFileInfo" From cac828621acd8b6e446f2e256ecd6ae90fc103a3 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 30 Jan 2026 13:08:10 +0000 Subject: [PATCH 123/192] Rufus 4.12 (Build 2314) * Restore credits for Korean translators, that were removed by mistake. --- ChangeLog.txt | 2 +- res/appstore/listing/listing.csv | 29 ++++++++++++++++++----------- res/loc/po/ko-KR.po | 6 +++--- res/loc/rufus.loc | 2 +- src/rufus.rc | 10 +++++----- 5 files changed, 28 insertions(+), 21 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 8457293a..92dfb580 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,4 +1,4 @@ -o Version 4.12 (2026.01.??) +o Version 4.12 (2026.01.30) Filter out the new Bitdefender VHDs Filter disallowed characters in local account names Improve Microsoft Dev Drive detection (courtesy of Martin Kuschnik) diff --git a/res/appstore/listing/listing.csv b/res/appstore/listing/listing.csv index 048533bb..ddf3e08e 100644 --- a/res/appstore/listing/listing.csv +++ b/res/appstore/listing/listing.csv @@ -32,7 +32,7 @@ • Muutosloki: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus est un utilitaire permettant de formater et de créer des média USB amorçables, tels que clés USB, mémoire flash, etc. • Site officiel : https://rufus.ie • Code source: https://github.com/pbatard/rufus -• ChangeLog: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus ist ein Werkzeug, welches dabei hilft, bootfähige USB-Laufwerke zu erstellen, wie beispielweise USB-Keys, Speichersticks usw. +• ChangeLog: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus ist ein Werkzeug, das beim Formatieren und Erstellen bootfähiger USB-Flash-Laufwerke wie USB-Sticks, Speichersticks usw. hilft. • Offizielle Website: https://rufus.ie • Quellcode: https://github.com/pbatard/rufus • Änderungsprotokoll: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Το Rufus είναι ένα βοηθητικό πρόγραμμα που βοηθά στη διαμόρφωση και τη δημιουργία μονάδων flash USB με δυνατότητα εκκίνησης, όπως κλειδιά USB/pendrives,κάρτες μνήμης κ.λπ. @@ -114,19 +114,26 @@ • 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","• Add a cheat mode to toggle between Light and Dark mode -• Improve WUE option text relating to the CA 2023 option -• Update Linux SBAT / Microsoft SVN Secure Boot revocation values to latest -• Fix some GRUB/Syslinux download dialogs showing only the 'Close' button -• Fix an assert being triggered when using the WUE CA 2023 option on its own -• Fix an application crash on systems that have a failed dynamic disk",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"ReleaseNotes","3","Text","• Filter out the new Bitdefender VHDs +• Filter disallowed characters in local account names +• Improve Microsoft Dev Drive detection (courtesy of Martin Kuschnik) +• Improve the pre-formatting partition cleanup code +• Improve error reporting on ISO extraction issues +• Improve detection of drives with long hardware IDs (typically SSDs) +• Improve conflicting process reporting +• Improve support for Nutanix and umbrelOS ISOs +• Fix a TOCTOU vulnerability in Fido script execution (CVE-2026-2398, reported by @independent-arg) +• Fix replacement vulnerabilities for diskcopy.dll and oscdimg.exe +• Fix FFU image creation being erroneously invocated, when trying to save an ISO image +• Fix saving of ISO images to paths that contain spaces +• Update UEFI:NTFS and UEFI DBXs to latest",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "Title","4","Text","Rufus",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "ShortTitle","5","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "SortTitle","6","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "VoiceTitle","7","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "ShortDescription","8","Text","","Rufus - The Reliable USB Formatting Utility","Rufus - أداة فرمتة الـ USB جديرة بالثقة","Rufus - Надеждната USB форматираща програма","Rufus - 可靠的 USB 格式化工具","Rufus - 快速可靠的 USB 格式化工具","Rufus - Pouzdan alat za formatiranje USB-a","Rufus - Spolehlivý program pro formátování USB","Rufus - Det pålidelige USB-formateringsværktøj","Rufus - de betrouwbare USB-formatteertool","Rufus - Luotettava USB-alustusohjelma","Rufus - L'utilitaire de formatage USB fiable","Rufus - Das zuverlässige USB-Formatierungstool","Rufus - Μία αξιόπιστη εφαρμογή διαμόρφωσης USB","Rufus - הכלי לאתחול USB האמין ביותר","Rufus - A megbízható USB-formázó segédprogram","Rufus - Utilitas Pemformatan USB yang Handal","Rufus - Utility affidabile per la formattazione di unità USB","Rufus - 信頼性の高い USB フォーマット ユーティリティ","Rufus - 신뢰할 수 있는 USB 포맷 유틸리티","Rufus - uzticama un vienkārša USB formatēšanas utilīta","Rufus - patikima USB formatavimo priemonė","Rufus - Utiliti pemformatan USB yang dipercayai","Rufus - Det pålitelige USB-formateringsprogrammet","Rufus، ابزاری کاربردی و قابل‌اطمینان برای فرمت کردن درایوهای USB","Rufus - niezawodne narzędzie do formatowania USB","Rufus - O Utilitário de Formatação USB Confiável","Rufus - O utilitário de confiança para formatação USB","Rufus - Instrumentul de încredere pentru formatări USB","Rufus - Надёжная утилита для форматирования USB-дисков","Rufus - Pouzdan Alat Za Formatiranje USB diska","Rufus - Spoľahlivý program pre formátovanie USB","Rufus - zanesljivi pripomoček za USB formatiranje","Rufus, la herramienta de formateo de USBs en la que puedes confiar","Rufus - Det pålitliga verktyget för USB-formatering","Rufus - ยูทิลิตี้การฟอร์แมต USB ที่ไว้ใจได้","Rufus - Güvenilir USB Biçimlendirme Programı","Rufus - надійна утиліта для форматування USB-накопичувачів","Rufus - Tiện ích Định dạng USB Đáng tin cậy" "DevStudio","9","Text","Pete Batard",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -"CopyrightTrademarkInformation","12","Text","© 2011-2025 Pete Batard",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"CopyrightTrademarkInformation","12","Text","© 2011-2026 Pete Batard",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "AdditionalLicenseTerms","13","Text","https://www.gnu.org/licenses/gpl-3.0.html","This application is licensed under the terms of the GNU Public License (GPL) version 3. See https://www.gnu.org/licenses/gpl-3.0.en.html for details.","هذا التطبيق مُرخص بموجب شروط رخصة جنو (GNU) العمومية (GPL) الإصدار 3. راجع https://www.gnu.org/licenses/gpl-3.0.ar.html لمزيد من التفاصيل.","Тази програма е лицензирана според условията на GNU Public License (GPL) версия 3. @@ -262,14 +269,14 @@ Xem tại https://www.gnu.org/licenses/gpl-3.0.html để biết thêm chi tiế "OptionalPromo414x180","613","Relative path (or URL to file in Partner Center)","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "Feature1","700","Text","","Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","تهيئة USB وبطاقة الفلاش ومحركات الأقراص الافتراضية إلى FAT / FAT32 / NTFS / UDF / exFAT / ReFS / ext2 / ext3","Форматиране на USB, карти памет и виртуални устройства с FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","将 U 盘、存储卡或虚拟驱动器格式化为 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 格式","將隨身碟、記憶卡或虛擬光碟機格式化為 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 格式","Formatirajte USB, flash karticu i virtualne pogone na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formátování USB, flash karet a virtuálních jednotek na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formater USB, flash kort og virtuelle drev til FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","USB, flashkaart en virtuele schijven formatteren naar FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Alusta USB-asemia, muistikortteja ja virtuaalisia asemia muotoon FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatez des périphériques USB, des cartes flash et des disques virtuels en FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatieren von USB, Flash-Karte und virtuellen Laufwerken in FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Μορφοποίηση USB, κάρτας flash και εικονικών μονάδων δίσκου σε FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","אתחול USB, כרטיסי זיכרון וכוננים וירטואליים ל־FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","USB, flash memóriakártyák és virtuális meghajtók formázása FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 fájlrendszerre","Format USB, kartu flash dan penyimpanan maya ke FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatta USB, flash card e unità virtuali in FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","USBメモリやSDカード、仮想ドライブをFAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3でフォーマットします。","USB, 플래시 카드 및 가상 드라이브를 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3로 포맷","Formatē USB, atmiņas kartes un virtuālos diskus formātos FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Suformatuokite USB, flash kortelę ir virtualius diskus į FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatkan USB, kad flash dan pemacu maya kepada FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formater USB, minnekort og virtuelle disker til FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","فرمت USB، فلش کارت و درایوهای مجازی به FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Sformatuj nośnik używając: FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatar dispositivos USB, cartões flash e discos virtuais com FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatar dispositivos USB, cartão de memória e drives virtuais em FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatează USB, card flash si drive-uri virtuale la FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Форматирование USB, флешек и виртуальных дисков в FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatiraj USB, flash kartice, i virtualne diskove u FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Naformátujte USB, kartu a virtuálne disky do FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatiranje USB, bliskavice in virtualnih pogonov na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatee USB, tarjetas flash y unidades virtuales a FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatera USB-enheter, flash-kort och virtuella enheter till FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","ฟอร์แมต USB, แฟลชการ์ด หรือไดรฟ์เสมือน ให้อยู่ในรูปแบบของ FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","USB, flash kart ve sanal sürücüleri FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 olarak biçimlendirin","Форматування USB-накопичувачів, флешок, карток пам'яті у FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Định dạng USB, thẻ nhớ hoặc ổ nhớ ảo với FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" "Feature2","701","Text","","Create FreeDOS bootable USB drives","إنشاء محركات أقراص USB قابلة للإقلاع من FreeDOS","Създаване на FreeDOS стартиращ USB устройства","创建 FreeDOS 可启动驱动器","建立 FreeDOS 可開機隨身碟","Stvaranje FreeDOS USB pogona za pokretanje","Vytvoření bootovacích disků USB se systémem FreeDOS","Lav FreeDOS opstartsbare USB drev","FreeDOS opstartbare USB-schijven aanmaken","Luo boottaavia FreeDOS USB-asemia","Créez des disques amorçable FreeDOS","FreeDOS-bootfähige USB-Laufwerke erstellen","Δημιουργήστε μονάδες USB με δυνατότητα εκκίνησης FreeDOS","יצירת כונני USB הניתנים לאתחול של FreeDOS","Bootolható FreeDOS USB meghajtó készítése","Buat perangkat USB FreeDOS yang dapat di boot","Crea unità USB avviabili FreeDOS","FreeDOSの起動可能ドライブを作成します。","FreeDOS 부팅 가능한 USB 드라이브 만들기","Izveido FreeDOS ielādes USB ierīces","Sukurkite FreeDOS įkrovos USB diskus","Buat pemacu USB boleh boot FreeDOS","Lag FreeDos oppstartbar USB stick","درایوهای USB قابل بوت FreeDOS را ایجاد کنید","Stwórz nośnik rozruchowy USB FreeDOS","Criar discos USB inicializáveis FreeDOS","Criar unidades USB inicializáveis FreeDOS","Crează drive USB bootabil FreeDOS","Создание загрузочных USB-дисков FreeDOS","Kreiraj FreeDOS butabilni USB disk","Vytvorte bootovacie usb zariadenia FreeDOS","Ustvarite FreeDOS zagonske USB pogone","Crear unidades USB de arranque FreeDOS","Skapa FreeDOS startbara USB-enheter","สร้าง USB ไดรฟ์บูตสำหรับระบบ FreeDOS","FreeDOS önyüklenebilir USB sürücüleri oluşturun","Створення завантажувальних пристроїв FreeDOS","Tạo USB có thể khởi động với FreeDOS" -"Feature3","702","Text","","Create bootable drives from bootable ISOs (Windows, Linux, etc.)","إنشاء محركات أقراص قابلة للإقلاع من ملفات ISO القابلة للإقلاع (Windows و Linux وما إلى ذلك)","Създаване на стартиращи устройства от ISO образи (Windows, Linux и др.)","从可启动 ISO 文件 (Windows 和 Linux 等) 创建可启动驱动器","從可開機 ISO 檔案 (Windows 和 Linux 等) 建立可開機隨身碟","Stvaranje pogona za pokretanje iz ISO-ova za pokretanje (Windows, Linux itd.)","Vytváření bootovacích jednotek ze zaváděcích ISO (Windows, Linux atd.)","Lav opstartsbarer drev fra opstartsbarer ISOer (Window, Linux, osv.)","Opstartbare schijven aanmaken via opstartbare ISO's (Windows, Linux, enz)","Luo käynnistysasemia boottaavista ISO-kuvista (Windows, Linux jne.)","Créez des disques amorçables à partir d'images ISOs (Windows, Linux, etc.)","Erstellen bootfähiger Laufwerke aus bootfähigen ISOs (Windows, Linux, etc.)","Δημιουργήστε εκκινήσιμες μονάδες από ISO με δυνατότητα εκκίνησης (Windows, Linux, κ.λπ.)","יצירת כוננים הניתנים לאתחול מקובצי ISO הניתנים לאתחול (Windows‏, Linux וכו')","Bootolható meghajtók készítése bootolható ISO képfájlokból (Windows, Linux, stb.)","Buat perangkat yang dapat di boot dari ISO (Windows, Linux, dll.)","Crea unità avviabili da ISO avviabili (Windows, Linux, ecc.)","WindowsやLinuxなどのISOファイルから起動可能ドライブを作成します。","부팅 가능한 ISO (Windows, Linux 등)에서 부팅 가능한 드라이브 만들기","Izveido ielādes ierīces no ISO failiem (Windows, Linux, u.c.)","Sukurkite įkrovos diskus iš įkrovos ISO (Windows, Linux ir kt.)","Buat pemacu boleh boot daripada ISO boleh boot (Windows, Linux, dll.)","Lag oppstartabar enhet/disk fra ISOer (Windows, Linux, etc.)","ایجاد درایوهای قابل بوت از ISOهای قابل بوت (ویندوز، لینوکس و غیره)","Twórz dyski rozruchowe z obrazów ISO (Windows, Linux itp.)","Criar discos inicializáveis a partir de ISOs inicializáveis (Windows, Linux, etc.)","Criar unidades inicializáveis a partir de ISOs inicializáveis (Windows, Linux, etc.)","Crează drive-uri bootabile de la ISO-uri bootabile (Windows, Linux, etc.)","Создание загрузочных дисков из загрузочных образов ISO (Windows, Linux и т.д.)","Kreirajte disk jedinice za pokretanje sistema od ISO-a koji se mogu pokretanja sistema (Windows, Linux itd.)","Vytvorte bootovacie jednotky z ISO súborov (Windows, Linux atď.)","Ustvarite zagonske pogone iz zagonskih ISO-jev (Windows, Linux itd.)","Cree unidades de arranque desde ISO de arranque (Windows, Linux, etc.)","Skapa startbara enheter från startbara ISO-filer (Windows, Linux, etc.)","สร้าง USB ไดรฟ์บูตจากไฟล์ ISO ที่บูตได้ (เช่น ไฟล์ติดตั้ง Windows หรือ Linux เป็นต้น)","Önyüklenebilir ISO'lardan önyüklenebilir sürücüler oluşturun (Windows, Linux, vb.)","Створення завантажувальних пристроїв з завантажувальних образів (Windows, Linux, тощо)","Tạo ổ đĩa có thể khởi động từ các file ISO có thể khởi động (Windows, Linux, v.v...)" +"Feature3","702","Text","","Create bootable drives from bootable ISOs (Windows, Linux, etc.)","إنشاء محركات أقراص قابلة للإقلاع من ملفات ISO القابلة للإقلاع (Windows و Linux وما إلى ذلك)","Създаване на стартиращи устройства от ISO образи (Windows, Linux и др.)","从可启动 ISO 文件 (Windows 和 Linux 等) 创建可启动驱动器","從可開機 ISO 檔案 (Windows 和 Linux 等) 建立可開機隨身碟","Stvaranje pogona za pokretanje iz ISO-ova za pokretanje (Windows, Linux itd.)","Vytváření bootovacích jednotek ze zaváděcích ISO (Windows, Linux atd.)","Lav opstartsbarer drev fra opstartsbarer ISOer (Window, Linux, osv.)","Opstartbare schijven aanmaken via opstartbare ISO's (Windows, Linux, enz)","Luo käynnistysasemia boottaavista ISO-kuvista (Windows, Linux jne.)","Créez des disques amorçables à partir d'images ISOs (Windows, Linux, etc.)","Erstellen bootfähiger Laufwerke aus bootfähigen ISOs (Windows, Linux etc.)","Δημιουργήστε εκκινήσιμες μονάδες από ISO με δυνατότητα εκκίνησης (Windows, Linux, κ.λπ.)","יצירת כוננים הניתנים לאתחול מקובצי ISO הניתנים לאתחול (Windows‏, Linux וכו')","Bootolható meghajtók készítése bootolható ISO képfájlokból (Windows, Linux, stb.)","Buat perangkat yang dapat di boot dari ISO (Windows, Linux, dll.)","Crea unità avviabili da ISO avviabili (Windows, Linux, ecc.)","WindowsやLinuxなどのISOファイルから起動可能ドライブを作成します。","부팅 가능한 ISO (Windows, Linux 등)에서 부팅 가능한 드라이브 만들기","Izveido ielādes ierīces no ISO failiem (Windows, Linux, u.c.)","Sukurkite įkrovos diskus iš įkrovos ISO (Windows, Linux ir kt.)","Buat pemacu boleh boot daripada ISO boleh boot (Windows, Linux, dll.)","Lag oppstartabar enhet/disk fra ISOer (Windows, Linux, etc.)","ایجاد درایوهای قابل بوت از ISOهای قابل بوت (ویندوز، لینوکس و غیره)","Twórz dyski rozruchowe z obrazów ISO (Windows, Linux itp.)","Criar discos inicializáveis a partir de ISOs inicializáveis (Windows, Linux, etc.)","Criar unidades inicializáveis a partir de ISOs inicializáveis (Windows, Linux, etc.)","Crează drive-uri bootabile de la ISO-uri bootabile (Windows, Linux, etc.)","Создание загрузочных дисков из загрузочных образов ISO (Windows, Linux и т.д.)","Kreirajte disk jedinice za pokretanje sistema od ISO-a koji se mogu pokretanja sistema (Windows, Linux itd.)","Vytvorte bootovacie jednotky z ISO súborov (Windows, Linux atď.)","Ustvarite zagonske pogone iz zagonskih ISO-jev (Windows, Linux itd.)","Cree unidades de arranque desde ISO de arranque (Windows, Linux, etc.)","Skapa startbara enheter från startbara ISO-filer (Windows, Linux, etc.)","สร้าง USB ไดรฟ์บูตจากไฟล์ ISO ที่บูตได้ (เช่น ไฟล์ติดตั้ง Windows หรือ Linux เป็นต้น)","Önyüklenebilir ISO'lardan önyüklenebilir sürücüler oluşturun (Windows, Linux, vb.)","Створення завантажувальних пристроїв з завантажувальних образів (Windows, Linux, тощо)","Tạo ổ đĩa có thể khởi động từ các file ISO có thể khởi động (Windows, Linux, v.v...)" "Feature4","703","Text","","Create bootable drives from bootable disk images, including compressed ones","إنشاء محركات أقراص قابلة للإقلاع من صور الأقراص القابلة للإقلاع ، بما في ذلك الأقراص المضغوطة","Създаване на стартиращи устройства от образи, включително компресирани такива","从可启动硬盘镜像 (包括压缩镜像) 创建可启动驱动器","從可開機硬碟映像檔 (包括壓縮映像檔) 建立可開機隨身碟","Stvaranje pogona za pokretanje iz slika diska za pokretanje, uključujući komprimirane","Vytváření zaváděcích jednotek ze zaváděcích obrazů disků, včetně komprimovaných","Lav opstartsbarer drev fra opstartsbarer disk billeder, inklusiv komprimerede billeder","Opstartbare schijven aanmaken van opstartbare schijf-images, inclusief gecomprimeerde images","Luo käynnistysasemia boottaavista levykuvista, pakatut kuvat mukaanlukien","Créez des disques amorçables à partir d'images disque, y compris à partir d'images compressées","Erstellen bootfähiger Laufwerke aus bootfähigen Festplatten-Images, einschließlich komprimierter Images","Δημιουργήστε μονάδες εκκίνησης από εικόνες δίσκου με δυνατότητα εκκίνησης, συμπεριλαμβανομένων συμπιεσμένων","יצירת כוננים הניתנים לאתחול מקובצי תמונת דיסק הניתנים לאתחול, כולל קבצים דחוסים","Bootolható meghajtók készítése bootolható lemez képfájlokból, beleértve a tömörítetteket is","Buat perangkat yang dapat di boot dari Disk Image, termasuk yang Disk Image yang terkompresi","Crea unità avviabili da immagini disco avviabili, incluse quelle compresse","圧縮済みのものを含むディスクイメージから起動可能ドライブを作成します。","압축된 이미지를 포함하여 부팅 가능한 디스크 이미지에서 부팅 가능한 드라이브 만들기","Izveido ielādes ierīces no ielādes disku virtuālajiem attēliem, tai skaitā arī no saspiestajiem","Sukurkite įkrovos diskus iš įkrovos disko vaizdų, įskaitant suspaustus","Buat pemacu boleh boot daripada imej cakera boleh boot, termasuk yang dimampatkan","Lag oppstartbare disker fra images, inkludert komprimerte sådan","درایوهای قابل بوت را از تصاویر دیسک قابل بوت، از جمله موارد فشرده، ایجاد کنید","Twórz dyski rozruchowe z obrazów dysków, włączając skompresowane","Criar discos inicializáveis a partir de imagens de disco inicializáveis, inclusive de imagens compactadas","Criar unidades inicializáveis a partir de imagens de disco inicializáveis, inclusive de imagens compactadas","Crează drive-uri de la imagini de disc bootabile, incluzând cele compresate","Создание загрузочных дисков из образов загрузочных дисков, в том числе сжатых","Kreiranje disk jedinica za pokretanje sistema sa slika diska koji se može pokretanja, uključujući kompresovane","Vytvorte bootovacie jednotky z diskových obrazov, vrátane tých komprimovaných","Ustvarite zagonske pogone iz slik diska, ki jih je mogoče zagnati, vključno s stisnjenimi","Cree unidades de arranque a partir de imágenes de disco de arranque, incluidas las comprimidas","Skapa startbara enheter från startbara diskavbildningar, inklusive komprimerade","สร้างไดรฟ์บูตจากดิสก์อิมเมจที่บูตได้ (รองรับไฟล์ดิสก์อิมเมจที่ถูกบีบอัด)","Sıkıştırılmış olanlar da dahil olmak üzere önyüklenebilir disk yansısından önyüklenebilir sürücüler oluşturun","Створення завантажувальних пристроїв з завантажувальних образів, у тому числі стиснутих","Tạo ổ đĩa có thể khởi động từ các tệp đĩa có thể khởi động, bao gồm cả tệp nén" "Feature5","704","Text","","Create BIOS or UEFI bootable drives, including UEFI bootable NTFS","إنشاء BIOS أو محركات أقراص UEFI قابلة للإقلاع ، بما في ذلك UEFI NTFS القابل للتشغيل","Създаване на BIOS или UEFI стартиращи устройства, включително UEFI стартиращ NTFS","创建 BIOS 或 UEFI 可启动驱动器,包括 UEFI 可启动的 NTFS 驱动器","建立 BIOS 或 UEFI 可開機隨身碟,包括 UEFI 下的可開機 NTFS 隨身碟","Stvaranje BIOS ili UEFI pogona za pokretanje, uključujući UEFI NTFS za pokretanje","Vytvořte zaváděcí jednotky BIOS nebo UEFI, včetně zaváděcích souborů NTFS UEFI","Lav BIOS eller UEFI opstartsbarer drev, inklusiv UEFI opstartsbarer NTFS","BIOS of UEFI opstartbare schijven aanmaken, inclusief UEFI opstartbare NTFS","Luo BIOS- tai UEFI-boottaavia asemia, mukaanlukien UEFI-boottaavat NTFS-asemat","Créez des disques amorçables BIOS ou UEFI, y compris des disques UEFI amorçables utilisant NTFS","Erstellen von BIOS- oder UEFI-bootfähigen Laufwerken, einschließlich UEFI-bootfähigem NTFS","Δημιουργήστε μονάδες δίσκου με δυνατότητα εκκίνησης BIOS ή UEFI, συμπεριλαμβανομένων NTFS με δυνατότητα εκκίνησης UEFI","יצירת כוננים הניתנים לאתחול ממחשבים התומכים ב־BIOS או UEFI, לרבות כוננים הניתנים לאתחול מ־UEFI, המשתמשים במערכת הקבצים NTFS","BIOS-ból vagy UEFI-ből bootolható meghajtók készítése, beleértve az UEFI-ből bootolható NTFS meghajtókat is","Buat perangkat BIOS atau UEFI yang dapat di boot, termasuk perangkat NTFS yang dapat di boot oleh UEFI","Crea unità avviabili BIOS o UEFI, incluso NTFS avviabile UEFI","UEFI:NTFSを含むBIOS及びUEFIで起動可能なドライブを作成します。","UEFI 부팅 가능한 NTFS를 포함하여 BIOS 또는 UEFI 부팅 가능 드라이브 만들기","Izveido BIOS vai UEFI ielādes ierīces, ieskaitot UEFI ielādi no NTFS","Sukurkite BIOS arba UEFI įkrovos diskus, įskaitant UEFI įkrovos NTFS","Buat pemacu boleh boot BIOS atau UEFI, termasuk NTFS boleh boot UEFI","Lag BIOS eller UEFI oppstartbare disker, inkludert UEFI oppstartbar NTFS","درایوهای قابل بوت بایوس یا UEFI از جمله NTFS قابل بوت UEFI ایجاد کنید","Stwórz dysk rozruchowy BIOS lub UEFI, włączając bootowalny dysk UEFI NTFS","Criar discos inicializáveis ​​BIOS ou UEFI, inclusive discos UEFI inicializáveis ​​usando NTFS","Criar discos inicializáveis ​​BIOS ou UEFI, inclusive discos UEFI inicializáveis ​​usando NTFS","Crează discuri bootabile BIOS sau UEFI, incluzând NTFS-uri bootabile de UEFI","Создание загрузочных дисков BIOS или UEFI, включая загрузочный UEFI NTFS","Kreiranje BIOS ili UEFI disk jedinica za pokretanje sistema, uključujući NTFS sa UEFI pokretanjem sistema","Vytvorte bootovacie jednotky systému BIOS alebo UEFI vrátane UEFI bootovateľnej jednotky NTFS","Ustvarite zagonske pogone BIOS ali UEFI, vključno z UEFI bootable NTFS","Cree unidades de arranque BIOS o UEFI, incluido NTFS de arranque UEFI","Skapa BIOS- eller UEFI-startbara enheter, inklusive UEFI-startbar NTFS","สร้างไดรฟ์บูตสำหรับระบบ BIOS หรือ UEFI และ UEFI bootable NTFS","UEFI önyüklenebilir NTFS dahil BIOS ya da UEFI önyüklenebilir sürücüler oluşturun","Створення завантажувальних пристроїв BIOS чи UEFI, включаючи завантажувальний UEFI NTFS","Tạo ổ đĩa có thể khởi động với hệ thống BIOS hoặc UEFI, bao gồm cả NTFS có thể khởi động với UEFI" -"Feature6","705","Text","","Create 'Windows To Go' drives","إنشاء محركات أقراص ""Windows To Go\","Създаване на 'Windows To Go' устройства","创建 'Windows To Go' 驱动器","建立 'Windows To Go' 隨身碟","Stvaranje pogona ""Windows To Go\","Vytvoření jednotek ""Windows To Go","Lav 'Windows To Go' drev","'Windows To Go'-schijven aanmaken","Luo 'Windows To Go' -asemia","Créez des disques 'Windows To Go'","Erstellen von ""Windows To Go""-Laufwerken","Δημιουργήστε μονάδες δίσκου ""Windows To Go\","יצירת כונני Windows To Go","'Windows To Go' meghajtók készítése","Buat perangkat Windows To Go","Crea unità 'Windows To Go'","Windows To Goドライブを作成します。","'Windows To Go' 드라이브 만들기","Izveido 'Windows To Go' ierīces","Sukurkite ""Windows To Go"" diskus","Buat pemacu 'Windows To Go'","Lag 'Windows To Go' disker","درایوهای ""Windows To Go"" را ایجاد کنید","Stwórz dysk 'Windows To Go'","Criar discos 'Windows To Go'","Criar discos 'Windows To Go'","Crează discuri 'Windows To Go'","Создание дисков Windows To Go","Kreiranje disk jedinica ""Windows to Go\","Vytvorte jednotky „Windows To Go\","Ustvarjanje pogonov »Windows To Go'","Cree unidades 'Windows To Go'","Skapa ""Windows To Go""-enheter","สร้างไดรฟ์ของ 'Windows To Go'","'Windows To Go' sürücüleri oluşturun","Створення пристроїв 'Windows To Go'","Tạo ổ đĩa 'Windows To Go'" +"Feature6","705","Text","","Create 'Windows To Go' drives","إنشاء محركات أقراص ""Windows To Go\","Създаване на 'Windows To Go' устройства","创建 'Windows To Go' 驱动器","建立 'Windows To Go' 隨身碟","Stvaranje pogona ""Windows To Go\","Vytvoření jednotek ""Windows To Go","Lav 'Windows To Go' drev","'Windows To Go'-schijven aanmaken","Luo 'Windows To Go' -asemia","Créez des disques 'Windows To Go'","Erstellen von 'Windows To Go'-Laufwerken","Δημιουργήστε μονάδες δίσκου ""Windows To Go\","יצירת כונני Windows To Go","'Windows To Go' meghajtók készítése","Buat perangkat Windows To Go","Crea unità 'Windows To Go'","Windows To Goドライブを作成します。","'Windows To Go' 드라이브 만들기","Izveido 'Windows To Go' ierīces","Sukurkite ""Windows To Go"" diskus","Buat pemacu 'Windows To Go'","Lag 'Windows To Go' disker","درایوهای ""Windows To Go"" را ایجاد کنید","Stwórz dysk 'Windows To Go'","Criar discos 'Windows To Go'","Criar discos 'Windows To Go'","Crează discuri 'Windows To Go'","Создание дисков Windows To Go","Kreiranje disk jedinica ""Windows to Go\","Vytvorte jednotky „Windows To Go\","Ustvarjanje pogonov »Windows To Go'","Cree unidades 'Windows To Go'","Skapa ""Windows To Go""-enheter","สร้างไดรฟ์ของ 'Windows To Go'","'Windows To Go' sürücüleri oluşturun","Створення пристроїв 'Windows To Go'","Tạo ổ đĩa 'Windows To Go'" "Feature7","706","Text","","Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot","قم بإنشاء محركات تثبيت ويندوز 11 لأجهزة الكمبيوتر التي لا تحتوي على TPM أو الإقلاع الآمن (Secure Boot)","Създаване на Windows 11 инсталационно устройство за компютри, които нямат TPM или Secure Boot","为没有 TPM 或安全启动功能的电脑创建 Windows 11 安装驱动器","為沒有 TPM 或安全開機功能的電腦建立 Windows 11 安裝隨身碟","Stvaranje instalacijskih pogona sustava Windows 11 za PC-jeve koji nemaju TPM ili Sigurno pokretanje","Vytvoření instalačních jednotek systému Windows 11 pro počítače bez čipu TPM nebo Secure Boot","Lav Windows 11 installations drev for PCer der ikker har TPM eller Secure Boot","Windows 11 installatieschijven aanmaken voor pc's die geen TPM of Secure Boot hebben","Luo Windows 11 -asennusasemia tietokoneille, jotka eivät tue TPM- tai Secure Boot -ominaisuuksia","Créez des disques d'installation Windows 11 pour des PCs qui ne disposent pas de TPM ou Secure Boot","Erstellen von Windows 11-Installationslaufwerken für PCs ohne TPM oder Secure Boot","Δημιουργήστε μονάδες εγκατάστασης των Windows 11 για υπολογιστές που δεν διαθέτουν TPM ή Ασφαλή Εκκίνηση","יצירת כונני התקנה של Windows 11 עבור מחשבים שאין להם TPM או Secure Boot","Windows 11 telepítési meghajtók készítése olyan PC-k számára, amelyek nem rendelkeznek TPM vagy Secure Boot funkciókkal","Buat perangkat pemasang Windows 11 untuk PC yang tidak mempunyai TPM atau Secure Boot","Crea unità di installazione di Windows 11 per PC che non dispongono di TPM o avvio protetto","TPM及びセキュアブート非対応のPC向けのWindows 11インストールドライブを作成します","TPM 또는 보안 부팅이 없는 PC용 Windows 11 설치 드라이브 만들기","Izveido Windows 11 instalācijas ierīces datoriem, kam nav TPM vai Secure Boot","Sukurkite Windows 11 diegimo diskus kompiuteriams, kuriuose nėra TPM arba saugaus įkrovimo","Buat pemacu pemasangan Windows 11 untuk PC yang tidak mempunyai TPM atau But Selamat","Lag oppstartsmedia for Windows 11 som ikke krever TPM eller Secure Boot","درایوهای نصب ویندوز 11 را برای رایانه هایی که TPM یا Secure Boot ندارند ایجاد کنید","Twórz dyski instalacyjne systemu Windows 11 dla komputerów, które nie posiadają modułu TPM ani Secure Boot","Criar discos de instalação do Windows 11 para PCs que não possuem TPM ou Secure Boot","Criar discos de instalação do Windows 11 para PCs que não possuem TPM ou Arranque Seguro","Crează drive de instalare Windows 11 pe computere care nu au TPM sau Bootare Securizată","Создание установочных дисков Windows 11 для компьютеров без TPM или безопасной загрузки","Kreiranje windows 11 instalacionih disk jedinica za računare koji nemaju TPM ili bezbedno pokretanje sistema","Vytvorte inštalačné jednotky Windows 11 pre počítače, ktoré nemajú modul TPM, ani Secure Boot","Ustvarjanje namestitvenih pogonov za Windows 11 za računalnike, ki nimate TPM ali Varnega zagona","Cree unidades de instalación de Windows 11 para PC que no tienen TPM o Arranque seguro","Skapa installationsenheter till Windows 11 för datorer som inte har TPM eller säker start","สร้างไดรฟ์ติดตั้ง Windows 11 สำหรับคอมพิวเตอร์ที่ไม่มี TPM หรือ Secure Boot","TPM ya da Güvenli Önyüklemeye sahip olmayan bilgisayarlar için Windows 11 kurulum sürücüleri oluşturun","Створення інсталяційних дисків Windows 11 для ПК, які не мають TPM чи Secure Boot","Tạo ổ đĩa cài đặt Windows 11 cho các máy tính không có TPM hoặc Secure Boot" "Feature8","707","Text","","Create persistent Linux partitions","إنشاء Persistent Linux partitions","Създаване на устойчиви Linux дялове","创建持久 Linux 分区","建立持續性 Linux 磁區","Stvaranje trajnih Linux particija","Vytvoření trvalých oddílů systému Linux","Lav vedvarende Linux adskillelser","Persistent Linux partities aanmaken","Luo pysyviä Linux-osioita","Créez des partitions persistentes pour Linux","Persistente Linux-Partitionen erstellen","Δημιουργήστε μόνιμα διαμερίσματα Linux","יצירת מחיצות Linux קבועות","Tartós Linux partíciók készítése","Buat partisi Linux yang tetap/persistent","Crea partizioni persistenti Linux","記録用Linuxパーティションを作成します。","영구 리눅스 파티션 만들기","Izveido pastāvīgas Linux partīcijas","Sukurkite nuolatinius Linux skaidinius","Buat partition Linux berterusan","Lag persistente Linux partisjoner","ایجاد پارتیشن های لینوکس دائمی","Utwórz trwałe partycje Linux","Criar partições persistentes para Linux","Crie partições persistentes para Linux","Crează partiție de Linux persistentă","Создание постоянных разделов Linux","Kreiranje upornih Linux particija","Vytvorte trvalé oblasti systému Linux","Ustvarjanje trajnih Linux particij","Crear particiones persistentes de Linux","Skapa beständiga Linux-partitioner","สร้าง Linux partition แบบ persistent","Kalıcı Linux bölümleri oluşturun","Створення розділу збереження Linux","Tạo phân vùng Linux liên tục" "Feature9","708","Text","","Create VHD/DD images of the selected drive","إنشاء صور VHD / DD لمحرك الأقراص المحدد","Създаване на VHD/DD образи на избраното устройство","为选择的驱动器创建 VHD/DD 镜像","為選取的磁碟機建立 VHD/DD 映像檔","Stvaranje VHD/DD slika odabranog pogona","Vytvoření obrazů VHD/DD z vybrané jednotky","Lav VHD/DD billeder af det valgte drev","VHD/DD-images van de geselecteerde schijf aanmaken","Luo VHD/DD-kuvia valitusta asemasta","Créez des images VHD/DD du périphérique sélectionné","VHD/DD-Images des ausgewählten Laufwerks erstellen","Δημιουργήστε εικόνες VHD/DD της επιλεγμένης μονάδας δίσκου","יצירת קובצי תמונה מסוג VHD/DD של הכונן שנבחר","VHD/DD képfájl készítése a kiválasztott meghajtóról","Buat image VHD/DD dari penyimpanan yang dipilih","Crea immagini VHD/DD dell'unità selezionata","選択されたドライブのVHD/DDイメージを作成します。","선택한 드라이브의 VHD/DD 이미지 만들기","Izveido izvēlētā diska VHD/DD virtuālos attēlus","Sukurkite pasirinkto disko VHD / DD vaizdus","Buat imej VHD/DD bagi pemacu yang dipilih","Lag VHD/DD speilinger av valgt disk","تصاویر VHD/DD از درایو انتخاب شده ایجاد کنید","Stwórz obraz VHD/DD z wybranego dysku","Criar imagens VHD/DD do dispositivo selecionado","Criar imagens VHD/DD do dispositivo selecionado","Crează imagini VHD/DD de pe drive-ul selectat","Создание образов VHD/DD выбранного диска","Kreiranje VHD/DD slika izabrane disk jedinice","Vytvorte obrazy VHD/DD z vybratej jednotky","Ustvarjanje VHD/DD slik izbranega pogona","Cree imágenes VHD/DD de la unidad seleccionada","Skapa VHD/DD-avbilder av den valda enheten","สร้างอิมเมจไฟล์แบบ VHD/DD จากไดรฟ์ที่เลือก","Seçilen sürücünün VHD/DD yansılarını oluşturun","Створення образів VHD/DD з вибраних дисків","Tạo tệp VHD/DD từ ổ đĩa đã chọn" -"Feature10","709","Text","","Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image","حساب المجاميع الإختبارية MD5 و SHA-1 و SHA-256 و SHA-512 للصورة المحددة","Изчисляване на MD5, SHA-1, SHA-256 и SHA-512 чексуми на избраният образ","计算被选择镜像的 MD5、SHA-1、SHA-256 和 SHA-512 校验码","計算被選取映像的 MD5、SHA-1、SHA-256 和 SHA-512 檢查碼","Izračunajte kontrolne zbrojeve odabrane slike MD5, SHA-1, SHA-256 i SHA-512","Výpočet kontrolních součtů MD5, SHA-1, SHA-256 a SHA-512 vybraného obrazu","Beregn MD5, SHA-1, SHA-256 og SHA-512 checksums af det valgte billede","MD5, SHA-1, SHA-256 en SHA-512 controlesommen berekenen van de geselecteerde image","Laske MD5, SHA-1, SHA-256 ja SHA-512 tarkistussummia valitusta levykuvasta","Calculez les sommes de contrôle MD5, SHA-1, SHA-256 et SHA-512 de l'image sélectionnée","Berechnung von MD5-, SHA-1-, SHA-256- und SHA-512-Prüfsummen für das ausgewählte Bild","Υπολογίστε τα αθροίσματα ελέγχου MD5, SHA-1, SHA-256 και SHA-512 της επιλεγμένης εικόνας","חישוב סיכומי ביקורת מסוג MD5,‏ SHA-1,‏ SHA-256 ו־SHA-512 של קובץ התמונה שנבחרה","A kiválasztott képfájl MD5, SHA-1, SHA-256 és SHA-512 ellenőrző összegének kiszámítása","Hitung checksum MD5, SHA-1, SHA-256 dan SHA-512 dari image yang dipilih","Calcola i checksum MD5, SHA-1, SHA-256 e SHA-512 dell'immagine selezionata","選択されたイメージのMD5、SHA-1、SHA-256及びSHA-512チェックサムを計算します。","선택한 이미지의 MD5, SHA-1, SHA-256 및 SHA-512 체크섬 계산","Izskaitļo izvēlētā virtuālā attēla MD5, SHA-1, SHA-256 un SHA-512 kontrolsummas","Apskaičiuokite pasirinkto vaizdo MD5, SHA-1, SHA-256 ir SHA-512 kontrolines sumas","Kira MD5, SHA-1, SHA-256 dan SHA-512 checksum imej yang dipilih","Kalkuler MD5, SHA-1, SHA-256 og SHA-512 sjekksummer fra valgt speiling","MD5، SHA-1، SHA-256 و SHA-512 را برای تصویر انتخابی محاسبه کنید","Oblicz sumy kontrolne MD5, SHA-1, SHA-256 i SHA-512 dla wybranego obrazu","Calcular somas de verificação MD5, SHA-1, SHA-256 e SHA-512 da imagem selecionada","Calcular checksums MD5, SHA-1, SHA-256 e SHA-512 da imagem selecionada","Compută MD5, SHA-1, SHA-256 și SHA-512 suma de control ale imaginilor selectate","Вычисление контрольных сумм MD5, SHA-1, SHA-256 и SHA-512 выбранного образа","Izračunajte MD5, SHA-1, SHA-256 i SHA-512 kontrolne preglede izabrane slike","Vypočítajte kontrolné súčty vybratého obrazu (MD5, SHA-1, SHA-256 a SHA-512)","Račun MD5, SHA-1, SHA-256 in SHA-512 kontrolni vsoti izbrane slike","Calcule las sumas de comprobación MD5, SHA-1, SHA-256 y SHA-512 de la imagen seleccionada","Beräkna kontrollsummor MD5, SHA-1, SHA-256 och SHA-512 för den valda avbilden","คำนวณรหัส MD5, SHA-1, SHA-256, SHA-512 ของไฟล์อิมเมจที่เลือก","Seçilen yansının MD5, SHA-1, SHA-256 ve SHA-512 sağlama toplamlarını hesaplayın","Обчислення контрольних сум MD5, SHA-1, SHA-256 та SHA-512 для вибраних образів","Tính tổng kiểm MD5, SHA-1, SHA-256 và SHA-512 của tệp đã chọn" +"Feature10","709","Text","","Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image","حساب المجاميع الإختبارية MD5 و SHA-1 و SHA-256 و SHA-512 للصورة المحددة","Изчисляване на MD5, SHA-1, SHA-256 и SHA-512 чексуми на избраният образ","计算被选择镜像的 MD5、SHA-1、SHA-256 和 SHA-512 校验码","計算被選取映像的 MD5、SHA-1、SHA-256 和 SHA-512 檢查碼","Izračunajte kontrolne zbrojeve odabrane slike MD5, SHA-1, SHA-256 i SHA-512","Výpočet kontrolních součtů MD5, SHA-1, SHA-256 a SHA-512 vybraného obrazu","Beregn MD5, SHA-1, SHA-256 og SHA-512 checksums af det valgte billede","MD5, SHA-1, SHA-256 en SHA-512 controlesommen berekenen van de geselecteerde image","Laske MD5, SHA-1, SHA-256 ja SHA-512 tarkistussummia valitusta levykuvasta","Calculez les sommes de contrôle MD5, SHA-1, SHA-256 et SHA-512 de l'image sélectionnée","Berechnung von MD5-, SHA-1-, SHA-256- und SHA-512-Prüfsummen für das ausgewählte Image","Υπολογίστε τα αθροίσματα ελέγχου MD5, SHA-1, SHA-256 και SHA-512 της επιλεγμένης εικόνας","חישוב סיכומי ביקורת מסוג MD5,‏ SHA-1,‏ SHA-256 ו־SHA-512 של קובץ התמונה שנבחרה","A kiválasztott képfájl MD5, SHA-1, SHA-256 és SHA-512 ellenőrző összegének kiszámítása","Hitung checksum MD5, SHA-1, SHA-256 dan SHA-512 dari image yang dipilih","Calcola i checksum MD5, SHA-1, SHA-256 e SHA-512 dell'immagine selezionata","選択されたイメージのMD5、SHA-1、SHA-256及びSHA-512チェックサムを計算します。","선택한 이미지의 MD5, SHA-1, SHA-256 및 SHA-512 체크섬 계산","Izskaitļo izvēlētā virtuālā attēla MD5, SHA-1, SHA-256 un SHA-512 kontrolsummas","Apskaičiuokite pasirinkto vaizdo MD5, SHA-1, SHA-256 ir SHA-512 kontrolines sumas","Kira MD5, SHA-1, SHA-256 dan SHA-512 checksum imej yang dipilih","Kalkuler MD5, SHA-1, SHA-256 og SHA-512 sjekksummer fra valgt speiling","MD5، SHA-1، SHA-256 و SHA-512 را برای تصویر انتخابی محاسبه کنید","Oblicz sumy kontrolne MD5, SHA-1, SHA-256 i SHA-512 dla wybranego obrazu","Calcular somas de verificação MD5, SHA-1, SHA-256 e SHA-512 da imagem selecionada","Calcular checksums MD5, SHA-1, SHA-256 e SHA-512 da imagem selecionada","Compută MD5, SHA-1, SHA-256 și SHA-512 suma de control ale imaginilor selectate","Вычисление контрольных сумм MD5, SHA-1, SHA-256 и SHA-512 выбранного образа","Izračunajte MD5, SHA-1, SHA-256 i SHA-512 kontrolne preglede izabrane slike","Vypočítajte kontrolné súčty vybratého obrazu (MD5, SHA-1, SHA-256 a SHA-512)","Račun MD5, SHA-1, SHA-256 in SHA-512 kontrolni vsoti izbrane slike","Calcule las sumas de comprobación MD5, SHA-1, SHA-256 y SHA-512 de la imagen seleccionada","Beräkna kontrollsummor MD5, SHA-1, SHA-256 och SHA-512 för den valda avbilden","คำนวณรหัส MD5, SHA-1, SHA-256, SHA-512 ของไฟล์อิมเมจที่เลือก","Seçilen yansının MD5, SHA-1, SHA-256 ve SHA-512 sağlama toplamlarını hesaplayın","Обчислення контрольних сум MD5, SHA-1, SHA-256 та SHA-512 для вибраних образів","Tính tổng kiểm MD5, SHA-1, SHA-256 và SHA-512 của tệp đã chọn" "Feature11","710","Text","","Perform bad blocks checks, including detection of ""fake"" flash drives","إجراء فحوصات كتل تالفة ، بما في ذلك الكشف عن محركات أقراص فلاش ""زائفة\","Проверяване за лоши блокове, включително засичане на ""фалшиви"" устройства","执行坏块检查,包括对”假“U盘的检测","執行壞軌檢查,包括對”假“USB 快閃磁碟 的偵測","Izvršite provjere loših blokova, uključujući otkrivanje ""lažnih"" flash pogona","Provést kontrolu vadných bloků, včetně detekce ""falešných"" bloků. flash disky","Udøv dårlige blokke tjeks, inklusiv opdagelse af ""falske"" flashdrev","Controles uitvoeren op slechte blokken, inclusief detectie van ""valse"" flashdrives","Suorita viallisten lohkojen tarkistuksia, sisältäen ""valheellisten"" muistitikkujen tunnistamisen","Executez un test de mauvais secteurs avec detection des ""fake drives\","Durchführung von Prüfungen auf fehlerhafte Blöcke, einschließlich der Erkennung von ""gefälschten"" Flash-Laufwerken","Εκτελέστε ελέγχους εσφαλμένων block, συμπεριλαμβανομένου του εντοπισμού ""ψευδών"" μονάδων flash","ביצוע בדיקות אחר בלוקים (אזורים) פגומים, כולל זיהוי של כונני הבזק ""מזוייפים\","Hibás blokkok ellenőrzése, beleértve a ""hamis"" flash meghajtók detektálását","Lakukan cek Blok yang buruk, termasuk deteksi USB Flash Disk ""PALSU\","Esegui controlli dei blocchi danneggiati, incluso il rilevamento di unità flash ""false\","不良ブロックチェック及び容量詐欺ドライブの検知を行います。","""위조"" 플래시 드라이브 감지를 포함하여 불량 블록 검사 수행","Izpilda bojāto bloku pārbaudi ieskaitot ""falsificēto"" nesēju noteikšanu","Atlikite blogų blokų patikrinimus, įskaitant ""netikrų"" flash diskų aptikimą","Melakukan pemeriksaan blok buruk, termasuk pengesanan pemacu kilat ""palsu\","Utfør sjekk for dårlige sektorer, inkludert sjekk for forfalskede flash disker","بررسی بلوک های بد، از جمله تشخیص درایوهای فلش ""جعلی"" را انجام دهید","Sprawdź dysk pod względem spójności danych lub wykryj ""nieoryginalny"" pendrive","Executar verificações de blocos defeituosos, incluindo detecção de unidades flash ""falsificadas\","Executar verificações de blocos inválidos, incluindo a deteção de unidades flash ""falsas\","Verifică blocuri rele, incluzând detectarea de drive-uri flash ""false\","Проверка на плохие блоки, обнаружение ""поддельных"" флешек","Izvršite provere loših blokova, uključujući otkrivanje ""lažnih"" fleš diskova","Vykonajte kontroly zlých blokov vrátane detekcie „falošných"" prenosných diskov","Izvajanje preverjanj slabih blokov, vključno z odkrivanjem »lažnih« bliskavic","Realice comprobaciones de bloques defectuosos, incluida la detección de unidades flash ""falsas\","Utför kontroll av trasiga block, inklusive upptäckt av ""falska"" USB-minnen","ตรวจสอบจุดบกพร่อง รวมไปถึงการทดสอบแฟลชไดรฟ์ว่าเป็น ""ของปลอม"" หรือไม่","""Sahte"" flash sürücülerin tespiti de dahil olmak üzere hatalı blok kontrolleri gerçekleştirin","Перевірка дисків (включаючи фальшиві диски)","Thực hiện kiểm tra điểm lỗi, bao gồm phát hiện ổ đĩa ""giả\" "Feature12","711","Text","","Download official Microsoft Windows retail ISOs","قم بتنزيل ملفات ISO الرسمية الخاصة بـ Microsoft Windows","Изтегляне на официални Microsoft Windows ISO образи","下载微软官方 Windows 镜像","下載微軟官方 Windows 映像檔","Preuzimanje službenih ISO-ova za maloprodaju sustava Microsoft Windows","Stažení oficiálních souborů ISO systému Microsoft Windows","Hent officielle Microsoft Windows detail ISOer","Officiële Microsoft Windows retail ISO's downloaden","Lataa virallisia Microsoft Windowsin jälleenmyyntiversion ISO-levykuvia","Téléchargez des images ISOs commerciales officielles de Microsoft Windows","Offizielle Microsoft Windows-ISOs herunterladen","Κατεβάστε τα επίσημα retail ISO των Microsoft Windows","הורדת קובצי ה־ISO הקמעונאיים הרשמיים של Microsoft Windows","Hivatalos Microsoft Windows kiskereskedelmi ISO képfájlok letöltése","Unduh ISO Microsoft Windows resmi","Scarica le ISO ufficiali di Microsoft Windows","マイクロソフト公式のWindows ISOをダウンロードします。","공식 Microsoft Windows 리테일 ISO 다운로드","Lejupielādē oficiālos Microsoft ISO failus","Atsisiųskite oficialius Microsoft Windows mažmeninės prekybos ISO","Muat turun rasmi ISO runcit Microsoft Windows","Last ned offisielle Windows ISOer","ISO های رسمی ماکروسافت را دریافت کنید","Pobierz oficjalny obraz ISO systemu Microsoft Windows","Baixar ISOs oficiais do Microsoft Windows","Transferir ISOs oficiais do Microsoft Windows Retail","Descarcă un Microsoft Windows ISO oficial de vânzare","Загрузка официальных ISO-образов Windows","Preuzmite zvanične Microsoft Windows maloprodajne ISO-ove","Stiahnite si oficiálne ISO pre Microsoft Windows","Prenos uradnih Microsoft Windows maloprodaja ISOs","Descargue los ISO oficiales de Microsoft Windows","Ladda ner officiella Microsoft Windows ISO-filer","ดาวน์โหลดไฟล์ ISO ของ Microsoft Windows จากเว็บไซต์ทางการของ Microsoft","Resmi Microsoft Windows Retail ISO'larını indirin","Завантаження офіційних образів Microsoft Windows","Tải xuống các tệp Microsoft Windows ISO bán lẻ chính thức" diff --git a/res/loc/po/ko-KR.po b/res/loc/po/ko-KR.po index 98338f30..cdf4cc22 100644 --- a/res/loc/po/ko-KR.po +++ b/res/loc/po/ko-KR.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: 4.5\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" "POT-Creation-Date: 2025-08-26 05:39+0900\n" -"PO-Revision-Date: 2025-08-26 13:56+0900\n" +"PO-Revision-Date: 2026-01-28 21:33+0000\n" "Last-Translator: VenusGirl <venusgirl@outlook.com>\n" "Language-Team: 비너스걸 <https://venusgirls.tistory.com/>\n" "Language: ko_KR\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Korean (한국어)\n" "X-Rufus-LCID: 0x0412\n" -"X-Generator: Poedit 3.7\n" +"X-Generator: Poedit 3.8\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -1085,7 +1085,7 @@ msgstr "버전 %d.%d (빌드 %d)" #. • MSG_176 msgid "English translation: Pete Batard <mailto:pete@akeo.ie>" -msgstr "한국어 번역:\\line• 비너스걸 (VᴇɴᴜsGɪʀʟ♥) <mailto:venusgirl@outlook.com>" +msgstr "한국어 번역:\\line• 세상사는이야기-나두 <mailto:ho82.kr@gmail.com>\\line• Uk-Jin Jang <mailto:doublestat@gmail.com>\\line• 비너스걸 (VᴇɴᴜsGɪʀʟ♥) <mailto:venusgirl@outlook.com>" #. • MSG_177 msgid "Report bugs or request enhancements at:" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 8ebfd18b..1eef1169 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -7981,7 +7981,7 @@ t MSG_172 "유효하지 않은 다운로드 서명" t MSG_173 "선택하려면 클릭..." t MSG_174 "Rufus - 신뢰할 수 있는 USB 포맷 유틸리티" t MSG_175 "버전 %d.%d (빌드 %d)" -t MSG_176 "한국어 번역:\\line• 비너스걸 (VᴇɴᴜsGɪʀʟ♥) <mailto:venusgirl@outlook.com>" +t MSG_176 "한국어 번역:\\line• 세상사는이야기-나두 <mailto:ho82.kr@gmail.com>\\line• Uk-Jin Jang <mailto:doublestat@gmail.com>\\line• 비너스걸 (VᴇɴᴜsGɪʀʟ♥) <mailto:venusgirl@outlook.com>" t MSG_177 "버그 보고 또는 향상된 기능 요청:" t MSG_178 "추가 저작권:" t MSG_179 "업데이트 정책:" diff --git a/src/rufus.rc b/src/rufus.rc index 2a1b5933..46f51346 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.12.2313" +CAPTION "Rufus 4.12.2314" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2313,0 - PRODUCTVERSION 4,12,2313,0 + FILEVERSION 4,12,2314,0 + PRODUCTVERSION 4,12,2314,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2313" + VALUE "FileVersion", "4.12.2314" 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.12.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2313" + VALUE "ProductVersion", "4.12.2314" END END BLOCK "VarFileInfo" From 8b2a5b8514ef1f814ea95e78ca3f162477bf5a2d Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 10 Feb 2026 14:01:07 +0000 Subject: [PATCH 124/192] [grub] update GRUB to 2.14 release * Can GRUB *EVER* produce a release archive that is not *UTTERLY BROKEN*??? https://lists.gnu.org/archive/html/grub-devel/2026-01/msg00043.html * Also set version to rufus-next. --- README.md | 1 + configure | 20 ++++++++++---------- configure.ac | 2 +- res/grub2/core.img | Bin 40072 -> 42742 bytes res/grub2/grub2_version.h | 2 +- res/grub2/readme.txt | 8 +++++--- src/rufus.rc | 12 ++++++------ 7 files changed, 24 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index ff0352d8..0b9191f3 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ easily accessible log, or through the [Windows debug facility](https://docs.micr * [__Official Website__](https://rufus.ie) * [FAQ](https://github.com/pbatard/rufus/wiki/FAQ) +* [Security and safety measures](https://github.com/pbatard/rufus/wiki/Security) Enhancements/Bugs ----------------- diff --git a/configure b/configure index 5bf5affe..06fae879 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for rufus 4.12. +# Generated by GNU Autoconf 2.71 for rufus 4.13. # # Report bugs to <https://github.com/pbatard/rufus/issues>. # @@ -611,8 +611,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rufus' PACKAGE_TARNAME='rufus' -PACKAGE_VERSION='4.12' -PACKAGE_STRING='rufus 4.12' +PACKAGE_VERSION='4.13' +PACKAGE_STRING='rufus 4.13' PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues' PACKAGE_URL='https://rufus.ie' @@ -1269,7 +1269,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rufus 4.12 to adapt to many kinds of systems. +\`configure' configures rufus 4.13 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1336,7 +1336,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rufus 4.12:";; + short | recursive ) echo "Configuration of rufus 4.13:";; esac cat <<\_ACEOF @@ -1428,7 +1428,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rufus configure 4.12 +rufus configure 4.13 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1504,7 +1504,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rufus $as_me 4.12, which was +It was created by rufus $as_me 4.13, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2767,7 +2767,7 @@ fi # Define the identity of the package. PACKAGE='rufus' - VERSION='4.12' + VERSION='4.13' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -5313,7 +5313,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rufus $as_me 4.12, which was +This file was extended by rufus $as_me 4.13, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5369,7 +5369,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -rufus config.status 4.12 +rufus config.status 4.13 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 0e488ab0..2179a531 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([rufus], [4.12], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) +AC_INIT([rufus], [4.13], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies]) AC_CONFIG_SRCDIR([src/rufus.c]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/res/grub2/core.img b/res/grub2/core.img index f8d031b7819c5aed634469bcfae713970896d01f..7690b0f2cc214055428cd7011ea7d691039b63f9 100644 GIT binary patch delta 40457 zcmZ^KV{|3JvhI#;+nLz5ZBA@XJh66c+qP}np4iF6wsYs4`|i)zf4Zux>#MK3Ypq_Z z5!Md+G!0t!0fM6nAcj7}4*>k9ET;ni?y?~Nl`Ru7K&eEXAOV0#4CsGm|A98Je=-8{ zKRFu0G8_Q-I1&5Ta;gsn0Ni{-0pb{<n<)R|`hWHRQxp9_sj&Zl#>PHSR1k<hXX2oR z#1$|)#JO<w!*KaA=DtYvIqtbc6mT@4-XZs@Gi;>#*a$c%K<NBBd{ro1d^da*0t6Wu z5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L1dYrY%4d?r5oxh4iAKXTar4vw!QMClAEM! zSTL42ZQnoMSS-!vV79|qI8i2^kC&rTALOfSe_m)af4;J-tBHs=$0$*14O-rGy7Pn$ zh?SM?-95dkMp!|=Q|Cp<B5`YFf7F-N;P26xIk<yc?8KdRA#Zwk6QzxJbBWV(r8=a9 z8ZPdxURt#8F^3%^K#Pw-sRkE$F**5g@?J<^-#UV)aYAx`Dgl+t1@di>5q?*4eT5&D b7r~*=fEXCBoa>--S+Nme#;j&p!7^A03G6GB diff --git a/res/grub2/grub2_version.h b/res/grub2/grub2_version.h index 72ed03a6..59636000 100644 --- a/res/grub2/grub2_version.h +++ b/res/grub2/grub2_version.h @@ -4,4 +4,4 @@ */ #pragma once -#define GRUB2_PACKAGE_VERSION "2.12" +#define GRUB2_PACKAGE_VERSION "2.14" diff --git a/res/grub2/readme.txt b/res/grub2/readme.txt index eb37a76d..97374273 100644 --- a/res/grub2/readme.txt +++ b/res/grub2/readme.txt @@ -1,8 +1,10 @@ This directory contains the Grub 2.0 boot records that are used by Rufus -* boot.img and core.img were created from a patched (since the offcial GRUB 2.12 release is *BROKEN*): - https://ftp.gnu.org/gnu/grub/grub-2.12.tar.xz - on a Debian 12.5 x64 system using the commands: +* boot.img and core.img were created from https://ftp.gnu.org/gnu/grub/grub-2.14.tar.xz + with https://github.com/gentoo/gentoo/raw/d51cbeb087dbbe979ff29af645f32071cce2834d/sys-boot/grub/files/grub-2.14-revert-image-base.patch + applied (since GRUB are apparently unable to perform BASIC testing of their releases) + on a Debian 13 x64 system using the commands: + patch -p1 < grub-2.14-revert-image-base.patch ./autogen.sh # --enable-boot-time for Manjaro Linux ./configure --disable-nls --enable-boot-time diff --git a/src/rufus.rc b/src/rufus.rc index 46f51346..73531410 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.12.2314" +CAPTION "Rufus 4.13.2315" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,12,2314,0 - PRODUCTVERSION 4,12,2314,0 + FILEVERSION 4,13,2315,0 + PRODUCTVERSION 4,13,2315,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.12.2314" + VALUE "FileVersion", "4.13.2315" 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.12.exe" + VALUE "OriginalFilename", "rufus-4.13.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.12.2314" + VALUE "ProductVersion", "4.13.2315" END END BLOCK "VarFileInfo" From 4cdedc76307eeb5677f9a81eca07fe8edd7b9280 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 17 Feb 2026 20:02:43 +0000 Subject: [PATCH 125/192] Rufus 4.13 (Build 2316) * Update UEFI:NTFS to fix regression where the wrong driver for ARM/ARM64 was selected --- ChangeLog.txt | 4 ++++ res/appstore/listing/listing.csv | 15 ++------------- res/uefi/uefi-ntfs.img | Bin 1048576 -> 1048576 bytes src/rufus.rc | 10 +++++----- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 92dfb580..142da25b 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +o Version 4.13 (2026.02.17) [BUGFIX RELEASE] + Fix UEFI:NTFS not selecting the proper driver for ARM/ARM64 + Update embedded GRUB to v2.14 + o Version 4.12 (2026.01.30) Filter out the new Bitdefender VHDs Filter disallowed characters in local account names diff --git a/res/appstore/listing/listing.csv b/res/appstore/listing/listing.csv index ddf3e08e..c9fedf99 100644 --- a/res/appstore/listing/listing.csv +++ b/res/appstore/listing/listing.csv @@ -114,19 +114,8 @@ • 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","• Filter out the new Bitdefender VHDs -• Filter disallowed characters in local account names -• Improve Microsoft Dev Drive detection (courtesy of Martin Kuschnik) -• Improve the pre-formatting partition cleanup code -• Improve error reporting on ISO extraction issues -• Improve detection of drives with long hardware IDs (typically SSDs) -• Improve conflicting process reporting -• Improve support for Nutanix and umbrelOS ISOs -• Fix a TOCTOU vulnerability in Fido script execution (CVE-2026-2398, reported by @independent-arg) -• Fix replacement vulnerabilities for diskcopy.dll and oscdimg.exe -• Fix FFU image creation being erroneously invocated, when trying to save an ISO image -• Fix saving of ISO images to paths that contain spaces -• Update UEFI:NTFS and UEFI DBXs to latest",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"ReleaseNotes","3","Text","• Fix UEFI:NTFS not selecting the proper driver for ARM/ARM64 +• Update embedded GRUB to v2.14",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "Title","4","Text","Rufus",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "ShortTitle","5","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "SortTitle","6","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, diff --git a/res/uefi/uefi-ntfs.img b/res/uefi/uefi-ntfs.img index 33529741b3619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ME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_ACCEPTFILES -CAPTION "Rufus 4.13.2315" +CAPTION "Rufus 4.13.2316" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,13,2315,0 - PRODUCTVERSION 4,13,2315,0 + FILEVERSION 4,13,2316,0 + PRODUCTVERSION 4,13,2316,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.13.2315" + VALUE "FileVersion", "4.13.2316" 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.13.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.13.2315" + VALUE "ProductVersion", "4.13.2316" END END BLOCK "VarFileInfo" From eb7b6843eee395ea1d286d82297a599c65035ce6 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 3 Mar 2026 16:20:00 +0000 Subject: [PATCH 126/192] [core] improve GPT partition type reporting * Rather than waste our time reimplementing the wheel, use the descriptions from gdisk. * Also update the DB SHA-266 entries to latest. * Also set version to rufus-next and update GitHub Actions to latest (Closes #2929). --- .github/workflows/coverity.yml | 2 +- .github/workflows/mingw.yml | 4 +- .github/workflows/setup.yml | 4 +- .github/workflows/vs2022.yml | 4 +- configure | 20 +- configure.ac | 2 +- src/db.h | 11 +- src/drive.c | 21 +- src/gpt_types.h | 736 +++++++++++++++++++++++---------- src/license.h | 8 +- src/rufus.h | 4 +- src/rufus.rc | 12 +- src/stdio.c | 31 +- 13 files changed, 582 insertions(+), 277 deletions(-) diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index a34ebb9c..ecfa023a 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -53,7 +53,7 @@ jobs: cov-build.exe --dir cov-int msbuild ${{ env.SOLUTION_FILE_PATH }} /m /p:Configuration=${{ env.BUILD_CONFIGURATION }},Platform=${{ env.TARGET_PLATFORM }} - name: Publish Coverity artifacts - uses: actions/upload-artifact@v6 + uses: actions/upload-artifact@v7 with: name: cov-int path: cov-int/ diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml index 74b788a1..8e1df007 100644 --- a/.github/workflows/mingw.yml +++ b/.github/workflows/mingw.yml @@ -114,7 +114,7 @@ jobs: - name: Upload artifacts if: ${{ github.event_name == 'push' }} - uses: actions/upload-artifact@v6 + uses: actions/upload-artifact@v7 with: name: ${{ matrix.sys }} path: ./*.exe @@ -124,7 +124,7 @@ jobs: needs: MinGW-Build steps: - name: Merge Artifacts - uses: actions/upload-artifact/merge@v6 + uses: actions/upload-artifact/merge@v7 if: ${{ github.event_name == 'push' }} with: name: MinGW diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml index d737d74f..83ba9e24 100644 --- a/.github/workflows/setup.yml +++ b/.github/workflows/setup.yml @@ -36,7 +36,7 @@ jobs: run: sha256sum ./setup_${{ matrix.TARGET_PLATFORM }}.exe - name: Upload artifacts - uses: actions/upload-artifact@v6 + uses: actions/upload-artifact@v7 with: name: ${{ matrix.TARGET_PLATFORM }} path: ./*.exe @@ -46,7 +46,7 @@ jobs: needs: VS2022-Build steps: - name: Merge Artifacts - uses: actions/upload-artifact/merge@v5 + uses: actions/upload-artifact/merge@v7 with: name: setup delete-merged: true diff --git a/.github/workflows/vs2022.yml b/.github/workflows/vs2022.yml index ac7b41fa..228a11aa 100644 --- a/.github/workflows/vs2022.yml +++ b/.github/workflows/vs2022.yml @@ -126,7 +126,7 @@ jobs: curl --request POST --url https://www.virustotal.com/api/v3/monitor/items --header 'x-apikey: ${{ secrets.VIRUSTOTAL_API_KEY }}' --form path='/rufus_${{ matrix.TARGET_PLATFORM }}.exe' --form file=@./rufus_${{ matrix.TARGET_PLATFORM }}.exe - name: Upload artifacts - uses: actions/upload-artifact@v6 + uses: actions/upload-artifact@v7 if: ${{ github.event_name == 'push' }} with: name: ${{ matrix.TARGET_PLATFORM }} @@ -139,7 +139,7 @@ jobs: needs: VS2022-Build steps: - name: Merge Artifacts - uses: actions/upload-artifact/merge@v6 + uses: actions/upload-artifact/merge@v7 if: ${{ github.event_name == 'push' }} with: name: VS2022 diff --git a/configure b/configure index 06fae879..8f8dcb92 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for rufus 4.13. +# Generated by GNU Autoconf 2.71 for rufus 4.14. # # Report bugs to <https://github.com/pbatard/rufus/issues>. # @@ -611,8 +611,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rufus' PACKAGE_TARNAME='rufus' -PACKAGE_VERSION='4.13' -PACKAGE_STRING='rufus 4.13' +PACKAGE_VERSION='4.14' +PACKAGE_STRING='rufus 4.14' PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues' PACKAGE_URL='https://rufus.ie' @@ -1269,7 +1269,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rufus 4.13 to adapt to many kinds of systems. +\`configure' configures rufus 4.14 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1336,7 +1336,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rufus 4.13:";; + short | recursive ) echo "Configuration of rufus 4.14:";; esac cat <<\_ACEOF @@ -1428,7 +1428,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rufus configure 4.13 +rufus configure 4.14 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1504,7 +1504,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rufus $as_me 4.13, which was +It was created by rufus $as_me 4.14, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2767,7 +2767,7 @@ fi # Define the identity of the package. PACKAGE='rufus' - VERSION='4.13' + VERSION='4.14' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -5313,7 +5313,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rufus $as_me 4.13, which was +This file was extended by rufus $as_me 4.14, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5369,7 +5369,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -rufus config.status 4.13 +rufus config.status 4.14 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 2179a531..94f0e09b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([rufus], [4.13], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) +AC_INIT([rufus], [4.14], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies]) AC_CONFIG_SRCDIR([src/rufus.c]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/src/db.h b/src/db.h index 2be05621..c3197e9f 100644 --- a/src/db.h +++ b/src/db.h @@ -1,8 +1,8 @@ /* * Rufus: The Reliable USB Formatting Utility * DB of the known SHA256 hash values for Rufus downloadable content (GRUB, Syslinux, etc.) - * as well PE256 hash values for UEFI revoked content (DBX, SkuSiPolicy.p7b) - * Copyright © 2016-2025 Pete Batard <pete@akeo.ie> + * as well other data for UEFI revoked content (SBAT, certs). + * Copyright © 2016-2026 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,6 +31,8 @@ static uint8_t sha256db[] = { 0x11, 0x0c, 0x50, 0x1b, 0xfa, 0x9e, 0x72, 0xa8, 0x8c, 0xdb, 0xb8, 0xba, 0x11, 0xe1, 0xf0, 0x76, 0x1a, 0xec, 0x28, 0xbf, 0x04, 0x44, 0x67, 0xff, 0x38, 0x2c, 0x06, 0x95, 0xd5, 0x1f, 0x8a, 0x83, // grub-2.04-nonstandard/core.img 0x12, 0xbd, 0x22, 0xd2, 0xb3, 0x69, 0x56, 0x0f, 0x89, 0xb8, 0x50, 0x7e, 0x7e, 0x74, 0xeb, 0xc5, 0xea, 0x44, 0x91, 0x48, 0x75, 0xf0, 0xa4, 0xcb, 0x1e, 0xa6, 0xfb, 0x4e, 0xc9, 0x89, 0x58, 0x17, // syslinux-6.03/pre6/ldlinux.sys 0x15, 0x5f, 0x36, 0x7b, 0xb1, 0x30, 0xfe, 0x05, 0x5c, 0x79, 0x9f, 0x88, 0xb3, 0xc0, 0xc1, 0xa0, 0x0a, 0x18, 0x05, 0x78, 0x22, 0x69, 0xcf, 0x7e, 0x54, 0xaa, 0x61, 0xbd, 0xe3, 0x8e, 0x05, 0x92, // syslinux-6.03/pre3/ldlinux.bss + 0x15, 0x90, 0x28, 0x95, 0x48, 0x7c, 0x08, 0x4c, 0x8f, 0x57, 0x46, 0x66, 0xc3, 0x1e, 0x7f, 0xa3, 0x99, 0xd0, 0x5b, 0x83, 0x1f, 0xd6, 0x1c, 0x1e, 0x3c, 0x3e, 0xee, 0x69, 0xd6, 0x57, 0x69, 0x24, // grub-2.12/core.img + 0x19, 0xba, 0x57, 0x32, 0x9b, 0xe7, 0x45, 0xce, 0xae, 0x46, 0x35, 0x4c, 0x5d, 0x41, 0x1b, 0x7d, 0x8e, 0xfe, 0xc6, 0x80, 0x2c, 0xfd, 0x7f, 0x6f, 0xee, 0x98, 0x6d, 0xf4, 0xb7, 0x63, 0xf6, 0xfe, // grub4dos-0.4.6a/grldr 0x1c, 0xb7, 0x8b, 0x98, 0xbc, 0xd6, 0x76, 0x7b, 0x01, 0x44, 0xf5, 0x00, 0xaf, 0x81, 0xef, 0x4f, 0x3c, 0x54, 0xea, 0xaf, 0xe3, 0xc9, 0x4e, 0x1f, 0xd6, 0x24, 0x68, 0x41, 0x4e, 0x98, 0x92, 0x25, // syslinux-6.03/pre20/ldlinux.bss 0x1c, 0xc6, 0x32, 0x21, 0xfd, 0xf4, 0x46, 0xfc, 0xda, 0xc6, 0xc0, 0x56, 0x35, 0x79, 0x54, 0xc1, 0x5b, 0x61, 0x75, 0xca, 0x1b, 0xc2, 0xa4, 0x9f, 0x85, 0x52, 0xec, 0xca, 0x28, 0xac, 0x3e, 0x51, // syslinux-6.02/ldlinux.bss 0x22, 0x96, 0x82, 0xac, 0x61, 0xb8, 0x8b, 0x11, 0x25, 0xfc, 0xd7, 0xe6, 0x9f, 0x4e, 0x7f, 0x46, 0x7f, 0x68, 0xc5, 0x14, 0x9e, 0xb9, 0x37, 0x1a, 0x98, 0xd8, 0xf2, 0x78, 0x41, 0x40, 0xad, 0x88, // syslinux-5.00/ldlinux.sys @@ -88,7 +90,9 @@ static uint8_t sha256db[] = { 0x8e, 0xc8, 0x42, 0x06, 0x94, 0x4c, 0xd4, 0x3d, 0xf6, 0xba, 0x83, 0x63, 0xc0, 0x81, 0xe4, 0xa0, 0x82, 0x9e, 0x71, 0x9a, 0xbf, 0x5a, 0x46, 0x6d, 0x7c, 0x81, 0x0c, 0x2f, 0x5b, 0x6d, 0x13, 0x75, // syslinux-6.03/pre5/ldlinux.sys 0x95, 0x8d, 0x10, 0xbb, 0x87, 0x28, 0xcc, 0x1f, 0xf1, 0x6a, 0x12, 0xee, 0x6a, 0x60, 0x62, 0x40, 0xa6, 0xb7, 0x4d, 0xab, 0xa0, 0x2b, 0x8c, 0xb8, 0xed, 0x2a, 0xe8, 0x1c, 0x2f, 0xb2, 0x5b, 0x97, // syslinux-6.00/ldlinux.bss 0x9a, 0x0b, 0xc4, 0x1b, 0xd7, 0x95, 0xed, 0xb0, 0x83, 0x0f, 0x1c, 0xc4, 0x82, 0x4b, 0xfa, 0x9d, 0xe0, 0x9d, 0x68, 0x63, 0x92, 0x09, 0x4f, 0x5a, 0xe7, 0xfb, 0xac, 0xfb, 0xb0, 0x17, 0x9d, 0xa6, // syslinux-6.03/pre1/ldlinux.bss + 0x9a, 0x2c, 0x94, 0x67, 0x04, 0x01, 0x7f, 0xa8, 0xdc, 0x4e, 0x03, 0xa8, 0xa5, 0x8d, 0x75, 0x4d, 0x2d, 0x16, 0x07, 0xc2, 0xd2, 0xcd, 0x74, 0xf0, 0xe2, 0x92, 0x01, 0x33, 0xf1, 0x19, 0x28, 0x09, // grub-2.14/core.img 0x9b, 0xcc, 0x65, 0x92, 0xa7, 0xba, 0x7e, 0x73, 0x38, 0xf4, 0xbb, 0xba, 0x27, 0xc6, 0x30, 0x16, 0xb9, 0x5e, 0xcb, 0x1e, 0xc6, 0x8c, 0x0b, 0xe9, 0xb6, 0x99, 0xb2, 0xea, 0x69, 0xcb, 0xab, 0xb2, // syslinux-5.00/ldlinux.c32 + 0xa2, 0xa8, 0x76, 0x93, 0x71, 0xeb, 0x57, 0xc5, 0xe7, 0x9b, 0x3c, 0xea, 0x4a, 0x91, 0x12, 0x75, 0xaf, 0x47, 0x43, 0xf1, 0x0f, 0x42, 0x0e, 0xd6, 0xd2, 0x6e, 0x4e, 0xec, 0x5c, 0x86, 0x50, 0x59, // grub4dos-0.4.6a/grldr.mbr 0xa6, 0x82, 0x43, 0xa0, 0xf2, 0xe5, 0x90, 0xb8, 0x14, 0x02, 0xd6, 0xfa, 0x62, 0xd4, 0xfd, 0x30, 0x94, 0x8c, 0x00, 0x3d, 0xa1, 0x2b, 0xfe, 0xeb, 0x69, 0xba, 0x20, 0x34, 0x17, 0x27, 0x09, 0x4c, // syslinux-6.03/pre14/ldlinux.sys 0xa9, 0x4a, 0x99, 0xe6, 0xde, 0x68, 0x81, 0x44, 0x49, 0x2b, 0x38, 0xdb, 0xee, 0x09, 0xde, 0x07, 0x30, 0xe3, 0x2e, 0x1c, 0xfd, 0x0a, 0xb2, 0x54, 0x99, 0x22, 0xff, 0xa8, 0x04, 0x01, 0xad, 0x49, // syslinux-6.03/pre2/ldlinux.bss 0xa9, 0x95, 0x68, 0x57, 0x9c, 0xd2, 0x51, 0xaf, 0xf1, 0x34, 0xfc, 0xaa, 0xa8, 0x09, 0x91, 0x60, 0x5e, 0x8f, 0xb1, 0x19, 0x74, 0x51, 0xf7, 0x51, 0xaa, 0x4d, 0x6c, 0x84, 0xbf, 0x65, 0xf4, 0xe3, // syslinux-6.03/pre15/ldlinux.sys @@ -100,6 +104,7 @@ static uint8_t sha256db[] = { 0xb3, 0xdc, 0x31, 0x79, 0xf6, 0x2b, 0x20, 0x51, 0xc9, 0x43, 0xe5, 0x2e, 0xeb, 0xf2, 0x29, 0x8a, 0xa4, 0x7e, 0x7c, 0x0a, 0x97, 0x78, 0xe8, 0x62, 0x77, 0xa7, 0x48, 0x2a, 0x27, 0x0a, 0x7a, 0x8e, // syslinux-6.01/ldlinux.bss 0xb4, 0x6a, 0xf2, 0x09, 0x19, 0xe9, 0xf2, 0x1f, 0xa1, 0x52, 0x37, 0x5d, 0xda, 0xc4, 0x58, 0x87, 0x08, 0xc1, 0x22, 0xb3, 0x65, 0x7f, 0x09, 0x01, 0x31, 0x4e, 0x83, 0x45, 0x49, 0xa9, 0x6c, 0xe7, // syslinux-4.07/menu.c32 0xbc, 0x3f, 0xb7, 0x6d, 0xbc, 0xd6, 0x32, 0x37, 0xc3, 0x68, 0x8d, 0x3b, 0x55, 0x3c, 0x99, 0x41, 0x0e, 0x8f, 0xb3, 0x9e, 0x52, 0x00, 0x9d, 0xdc, 0xeb, 0xb8, 0x8e, 0xe7, 0xd2, 0x5a, 0xec, 0xa8, // grub-2.03.5/core.img + 0xbf, 0x05, 0x9b, 0x7f, 0x9d, 0xc5, 0x1d, 0x08, 0xb7, 0xa9, 0x36, 0x81, 0xcc, 0xc7, 0x82, 0xdc, 0x46, 0x4e, 0x43, 0xe6, 0x0d, 0xa4, 0xfb, 0xb6, 0xa1, 0xf5, 0x62, 0xea, 0x0e, 0x2d, 0xd3, 0x1a, // grub-2.14~rc1/core.img 0xbf, 0xf9, 0xc5, 0x89, 0x59, 0x70, 0x4d, 0x1e, 0xbe, 0x25, 0xb4, 0x43, 0xc8, 0x92, 0x3a, 0x42, 0xed, 0x89, 0xaf, 0x8b, 0xd2, 0x92, 0xe7, 0xd7, 0xcb, 0xeb, 0xca, 0xcc, 0xc0, 0x7c, 0xc7, 0x19, // syslinux-5.11/ldlinux.sys 0xc3, 0x3b, 0x31, 0x5f, 0xec, 0xe4, 0xad, 0xc4, 0xc3, 0xb2, 0x75, 0x13, 0x22, 0x84, 0x66, 0xe4, 0x44, 0x99, 0xcd, 0xa7, 0xfd, 0x63, 0x97, 0xc5, 0xab, 0xe0, 0xf8, 0xce, 0x4f, 0xe3, 0x45, 0x39, // syslinux-5.10/ldlinux.c32 0xcc, 0x40, 0xba, 0x03, 0x49, 0x78, 0x2c, 0xb4, 0xc9, 0x02, 0x1e, 0x54, 0xdc, 0xc0, 0xa4, 0x54, 0x0c, 0x3a, 0x8b, 0x96, 0x08, 0x8b, 0x3a, 0x56, 0x48, 0x67, 0x19, 0x26, 0xef, 0x44, 0xd2, 0xf0, // syslinux-6.04/ldlinux.bss @@ -108,7 +113,6 @@ static uint8_t sha256db[] = { 0xd2, 0xc6, 0x93, 0x8d, 0xae, 0x5a, 0xd7, 0x16, 0x0e, 0x9e, 0x6c, 0x61, 0xef, 0x46, 0xb7, 0xfd, 0x14, 0x6e, 0x30, 0xc0, 0x3f, 0xdc, 0x8f, 0x5c, 0x6d, 0xbd, 0xeb, 0x86, 0x22, 0xc8, 0xa7, 0xbd, // syslinux-5.00/ldlinux.bss 0xd3, 0x47, 0x2c, 0x02, 0x26, 0x3a, 0xcf, 0x9c, 0xd1, 0xda, 0x5d, 0xb5, 0x1e, 0x26, 0x3c, 0x54, 0x84, 0xba, 0xd1, 0x3e, 0xa6, 0x86, 0x18, 0xc4, 0x03, 0xd9, 0xcb, 0x01, 0xca, 0x07, 0x0a, 0xee, // syslinux-6.04/ldlinux.c32 0xd5, 0x50, 0x39, 0xef, 0xb6, 0x8d, 0x6e, 0xec, 0xde, 0x68, 0x61, 0xc9, 0x0b, 0xa9, 0xb7, 0x99, 0x44, 0xd1, 0xaa, 0x8b, 0xc3, 0xd6, 0x01, 0xfb, 0x80, 0xfd, 0x08, 0x7b, 0xc6, 0x13, 0x63, 0xf8, // syslinux-6.02/ldlinux.sys - 0xd6, 0xa7, 0x0c, 0xe1, 0x90, 0x2b, 0x22, 0x1a, 0xcb, 0xc1, 0xd5, 0xf5, 0x94, 0x24, 0xa8, 0x22, 0x7b, 0x62, 0xfe, 0x6d, 0x85, 0x34, 0x86, 0x0e, 0x2b, 0x6e, 0x75, 0x7e, 0x01, 0x02, 0xc5, 0x6f, // grub4dos-0.4.6a/grldr 0xd9, 0x1c, 0xbd, 0xf9, 0x01, 0x79, 0x5e, 0x98, 0x19, 0x84, 0x9c, 0x75, 0x3e, 0xa5, 0x3a, 0xd8, 0x59, 0xc6, 0xf2, 0x5d, 0x59, 0x17, 0xa6, 0x75, 0x92, 0x58, 0x3f, 0xd6, 0x5e, 0x6d, 0x00, 0xf0, // syslinux-6.03/pre18/ldlinux.bss 0xda, 0xa3, 0x06, 0xa9, 0x97, 0x0e, 0x37, 0x7d, 0xb4, 0x4c, 0xe7, 0xfa, 0xd8, 0xdd, 0x01, 0xe9, 0xe8, 0x53, 0xc6, 0x8b, 0x1e, 0x3d, 0x84, 0xf3, 0x2a, 0xaf, 0x42, 0x24, 0x6f, 0x77, 0xae, 0x3d, // grub-2.02/core.img 0xe7, 0x87, 0x08, 0xc7, 0x2c, 0x49, 0x8e, 0xcc, 0x14, 0x9e, 0x30, 0xf0, 0xa9, 0x85, 0xd3, 0x73, 0xa3, 0x00, 0xad, 0x5c, 0xf7, 0xd2, 0x88, 0xc7, 0x7d, 0xe8, 0x05, 0x5e, 0x25, 0x66, 0x28, 0x1f, // syslinux-6.03/pre18/ldlinux.sys @@ -118,7 +122,6 @@ static uint8_t sha256db[] = { 0xec, 0xfd, 0xbc, 0x3f, 0x4f, 0x2e, 0x4d, 0x99, 0x16, 0x9c, 0xdd, 0xfb, 0x15, 0x2d, 0x92, 0x4d, 0x7d, 0xe6, 0x8a, 0xb6, 0x7f, 0x4d, 0x12, 0x54, 0x40, 0xfa, 0xbc, 0x9f, 0x00, 0x46, 0xd5, 0xbc, // syslinux-6.03/pre5/ldlinux.bss 0xee, 0xed, 0xc0, 0x4c, 0x13, 0x73, 0xb5, 0xc4, 0x04, 0x4d, 0x1f, 0xde, 0x0d, 0x2f, 0xb8, 0xe2, 0x8c, 0x74, 0xb1, 0x02, 0x9c, 0x99, 0xed, 0x67, 0x0a, 0x15, 0x98, 0x3f, 0x18, 0xa0, 0x4d, 0x36, // syslinux-6.02/ldlinux.c32 0xf5, 0x40, 0x26, 0x1c, 0x09, 0x7d, 0xbd, 0x8a, 0x8a, 0x12, 0x9b, 0x68, 0x99, 0x5f, 0x33, 0xab, 0xe7, 0x1c, 0x29, 0x40, 0xf8, 0x87, 0xc6, 0x68, 0x9b, 0xf8, 0xdc, 0x3f, 0x1a, 0xcf, 0x0b, 0x44, // syslinux-6.03/pre17/ldlinux.bss - 0xf5, 0xc6, 0xe8, 0xe2, 0xc1, 0xeb, 0x73, 0x80, 0x28, 0x5f, 0xa9, 0xcb, 0x1c, 0x91, 0x68, 0xe9, 0x2d, 0x5b, 0x3b, 0x55, 0xcd, 0xe0, 0x52, 0xc0, 0x43, 0xba, 0x81, 0xed, 0x17, 0xb9, 0xac, 0xef, // grub4dos-0.4.6a/grldr.mbr 0xfb, 0x0a, 0x23, 0xca, 0x4d, 0x22, 0xfd, 0xd2, 0xad, 0x4e, 0xfa, 0x1b, 0x21, 0x08, 0xb6, 0x60, 0xd2, 0xff, 0xa3, 0xf2, 0xfb, 0xdd, 0x25, 0x32, 0xdc, 0xf1, 0x3f, 0x49, 0x33, 0x28, 0x46, 0x7b, // syslinux-6.03/pre11/ldlinux.bss 0xfb, 0x49, 0xfd, 0x45, 0x8c, 0xaf, 0x47, 0x5a, 0x16, 0x05, 0x5e, 0x4a, 0x75, 0x5a, 0xc3, 0xe3, 0x95, 0x52, 0xf4, 0xe9, 0x6c, 0xa2, 0x0d, 0xea, 0x53, 0xf5, 0xc4, 0x09, 0x2b, 0x68, 0xfd, 0x4f, // syslinux-6.00/ldlinux.sys }; diff --git a/src/drive.c b/src/drive.c index fbce1bc8..798db108 100644 --- a/src/drive.c +++ b/src/drive.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Drive access function calls - * Copyright © 2011-2025 Pete Batard <pete@akeo.ie> + * Copyright © 2011-2026 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1546,7 +1546,7 @@ static BOOL StoreEspInfo(GUID* guid) return WriteSettingStr(key_name[1], GuidToString(guid, TRUE)); } -static GUID* GetEspGuid(uint8_t index) +static GUID GetEspGuid(uint8_t index) { char key_name[16]; @@ -1574,7 +1574,7 @@ BOOL ToggleEsp(DWORD DriveIndex, uint64_t PartitionOffset) HANDLE hPhysical; DWORD dl_size, size, offset; BYTE layout[4096] = { 0 }, buf[512]; - GUID *guid = NULL, *stored_guid = NULL, mbr_guid; + GUID *guid = NULL, stored_guid = { 0 }, mbr_guid; PDRIVE_LAYOUT_INFORMATION_EX DriveLayout = (PDRIVE_LAYOUT_INFORMATION_EX)(void*)layout; typedef struct { const uint8_t mbr_type; @@ -1650,7 +1650,7 @@ BOOL ToggleEsp(DWORD DriveIndex, uint64_t PartitionOffset) // Basic Data -> ESP for (i = 1; i <= MAX_ESP_TOGGLE && esp_index < 0; i++) { stored_guid = GetEspGuid((uint8_t)i); - if (stored_guid != NULL) { + if (!CompareGUID(&stored_guid, &GUID_NULL)) { for (j = 0; j < (int)DriveLayout->PartitionCount && esp_index < 0; j++) { if (DriveLayout->PartitionStyle == PARTITION_STYLE_GPT) { guid = &DriveLayout->PartitionEntry[j].Gpt.PartitionId; @@ -1660,7 +1660,7 @@ BOOL ToggleEsp(DWORD DriveIndex, uint64_t PartitionOffset) *((uint64_t*)&mbr_guid.Data4) = DriveLayout->PartitionEntry[j].StartingOffset.QuadPart; guid = &mbr_guid; } - if (CompareGUID(stored_guid, guid)) { + if (CompareGUID(&stored_guid, guid)) { esp_index = j; delete_data = TRUE; if (DriveLayout->PartitionStyle == PARTITION_STYLE_GPT) @@ -2606,9 +2606,8 @@ const char* GetMBRPartitionType(const uint8_t type) const char* GetGPTPartitionType(const GUID* guid) { - int i; - for (i = 0; (i < ARRAYSIZE(gpt_type)) && !CompareGUID(guid, gpt_type[i].guid); i++); - return (i < ARRAYSIZE(gpt_type)) ? gpt_type[i].name : GuidToString(guid, TRUE); + const char* desc = gpt_type_desc(guid); + return desc != NULL ? desc : GuidToString(guid, TRUE); } /* @@ -2653,7 +2652,7 @@ BOOL IsFilteredDrive(DWORD DriveIndex) HANDLE hPhysical = INVALID_HANDLE_VALUE; BYTE layout[4096] = { 0 }; PDRIVE_LAYOUT_INFORMATION_EX DriveLayout = (PDRIVE_LAYOUT_INFORMATION_EX)(void*)layout; - GUID* DiskGuid; + GUID DiskGuid; hPhysical = GetPhysicalHandle(DriveIndex, FALSE, FALSE, TRUE); if (hPhysical == INVALID_HANDLE_VALUE) @@ -2669,8 +2668,8 @@ BOOL IsFilteredDrive(DWORD DriveIndex) for (i = 1; i <= MAX_IGNORE_USB; i++) { static_sprintf(setting_name, "IgnoreDisk%02d", i); DiskGuid = StringToGuid(ReadSettingStr(setting_name)); - if (CompareGUID(&DriveLayout->Gpt.DiskId, DiskGuid)) { - uprintf("Device eliminated because it matches Disk GUID %s", GuidToString(DiskGuid, TRUE)); + if (CompareGUID(&DriveLayout->Gpt.DiskId, &DiskGuid)) { + uprintf("Device eliminated because it matches Disk GUID %s", GuidToString(&DiskGuid, TRUE)); ret = TRUE; goto out; } diff --git a/src/gpt_types.h b/src/gpt_types.h index 926056cc..128123aa 100644 --- a/src/gpt_types.h +++ b/src/gpt_types.h @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * GPT Partition Types - * Copyright © 2020 Pete Batard <pete@akeo.ie> + * Copyright © 2020-2026 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,226 +24,520 @@ #pragma once -/* - * From https://en.wikipedia.org/wiki/GUID_Partition_Table - */ -DEFINE_GUID(PARTITION_ANDROID_BOOT, 0x49A4D17F, 0x93A3, 0x45C1, 0xA0, 0xDE, 0xF5, 0x0B, 0x2E, 0xBE, 0x25, 0x99); -DEFINE_GUID(PARTITION_ANDROID_BOOTLOADER1, 0x2568845D, 0x2332, 0x4675, 0xBC, 0x39, 0x8F, 0xA5, 0xA4, 0x74, 0x8D, 0x15); -DEFINE_GUID(PARTITION_ANDROID_BOOTLOADER2, 0x114EAFFE, 0x1552, 0x4022, 0xB2, 0x6E, 0x9B, 0x05, 0x36, 0x04, 0xCF, 0x84); -DEFINE_GUID(PARTITION_ANDROID_CACHE, 0xA893EF21, 0xE428, 0x470A, 0x9E, 0x55, 0x06, 0x68, 0xFD, 0x91, 0xA2, 0xD9); -DEFINE_GUID(PARTITION_ANDROID_CONFIG, 0xBD59408B, 0x4514, 0x490D, 0xBF, 0x12, 0x98, 0x78, 0xD9, 0x63, 0xF3, 0x78); -DEFINE_GUID(PARTITION_ANDROID_DATA, 0xDC76DDA9, 0x5AC1, 0x491C, 0xAF, 0x42, 0xA8, 0x25, 0x91, 0x58, 0x0C, 0x0D); -DEFINE_GUID(PARTITION_ANDROID_EXT, 0x193D1EA4, 0xB3CA, 0x11E4, 0xB0, 0x75, 0x10, 0x60, 0x4B, 0x88, 0x9D, 0xCF); -DEFINE_GUID(PARTITION_ANDROID_FACTORY1, 0x8F68CC74, 0xC5E5, 0x48DA, 0xBE, 0x91, 0xA0, 0xC8, 0xC1, 0x5E, 0x9C, 0x80); -DEFINE_GUID(PARTITION_ANDROID_FACTORY2, 0x9FDAA6EF, 0x4B3F, 0x40D2, 0xBA, 0x8D, 0xBF, 0xF1, 0x6B, 0xFB, 0x88, 0x7B); -DEFINE_GUID(PARTITION_ANDROID_FASTBOOT, 0x767941D0, 0x2085, 0x11E3, 0xAD, 0x3B, 0x6C, 0xFD, 0xB9, 0x47, 0x11, 0xE9); -DEFINE_GUID(PARTITION_ANDROID_METADATA1, 0x20AC26BE, 0x20B7, 0x11E3, 0x84, 0xC5, 0x6C, 0xFD, 0xB9, 0x47, 0x11, 0xE9); -DEFINE_GUID(PARTITION_ANDROID_METADATA2, 0x19A710A2, 0xB3CA, 0x11E4, 0xB0, 0x26, 0x10, 0x60, 0x4B, 0x88, 0x9D, 0xCF); -DEFINE_GUID(PARTITION_ANDROID_MISC, 0xEF32A33B, 0xA409, 0x486C, 0x91, 0x41, 0x9F, 0xFB, 0x71, 0x1F, 0x62, 0x66); -DEFINE_GUID(PARTITION_ANDROID_OEM, 0xAC6D7924, 0xEB71, 0x4DF8, 0xB4, 0x8D, 0xE2, 0x67, 0xB2, 0x71, 0x48, 0xFF); -DEFINE_GUID(PARTITION_ANDROID_PERSISTENCE, 0xEBC597D0, 0x2053, 0x4B15, 0x8B, 0x64, 0xE0, 0xAA, 0xC7, 0x5F, 0x4D, 0xB1); -DEFINE_GUID(PARTITION_ANDROID_RECOVERY, 0x4177C722, 0x9E92, 0x4AAB, 0x86, 0x44, 0x43, 0x50, 0x2B, 0xFD, 0x55, 0x06); -DEFINE_GUID(PARTITION_ANDROID_SYSTEM, 0x38F428E6, 0xD326, 0x425D, 0x91, 0x40, 0x6E, 0x0E, 0xA1, 0x33, 0x64, 0x7C); -DEFINE_GUID(PARTITION_ANDROID_VENDOR, 0xC5A0AEEC, 0x13EA, 0x11E5, 0xA1, 0xB1, 0x00, 0x1E, 0x67, 0xCA, 0x0C, 0x3C); -DEFINE_GUID(PARTITION_APPLE_APFS, 0x7C3457EF, 0x0000, 0x11AA, 0xAA, 0x11, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC); -DEFINE_GUID(PARTITION_APPLE_BOOT, 0x426F6F74, 0x0000, 0x11AA, 0xAA, 0x11, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC); -DEFINE_GUID(PARTITION_APPLE_FILEVAULT, 0x53746F72, 0x6167, 0x11AA, 0xAA, 0x11, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC); -DEFINE_GUID(PARTITION_APPLE_HFS, 0x48465300, 0x0000, 0x11AA, 0xAA, 0x11, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC); -DEFINE_GUID(PARTITION_APPLE_LABEL, 0x4C616265, 0x6C00, 0x11AA, 0xAA, 0x11, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC); -DEFINE_GUID(PARTITION_APPLE_OFFLINE_RAID, 0x52414944, 0x5F4F, 0x11AA, 0xAA, 0x11, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC); -DEFINE_GUID(PARTITION_APPLE_RAID, 0x52414944, 0x0000, 0x11AA, 0xAA, 0x11, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC); -DEFINE_GUID(PARTITION_APPLE_RAID_CACHE, 0xBBBA6DF5, 0xF46F, 0x4A89, 0x8F, 0x59, 0x87, 0x65, 0xB2, 0x72, 0x75, 0x03); -DEFINE_GUID(PARTITION_APPLE_RAID_SCRATCH, 0x2E313465, 0x19B9, 0x463F, 0x81, 0x26, 0x8A, 0x79, 0x93, 0x77, 0x38, 0x01); -DEFINE_GUID(PARTITION_APPLE_RAID_STATUS, 0xB6FA30DA, 0x92D2, 0x4A9A, 0x96, 0xF1, 0x87, 0x1E, 0xC6, 0x48, 0x62, 0x00); -DEFINE_GUID(PARTITION_APPLE_RAID_VOLUME, 0xFA709C7E, 0x65B1, 0x4593, 0xBF, 0xD5, 0xE7, 0x1D, 0x61, 0xDE, 0x9B, 0x02); -DEFINE_GUID(PARTITION_APPLE_RECOVERY, 0x5265636F, 0x7665, 0x11AA, 0xAA, 0x11, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC); -DEFINE_GUID(PARTITION_APPLE_UFS, 0x55465300, 0x0000, 0x11AA, 0xAA, 0x11, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC); -// Stolen from Solaris below. Great job here, Apple! Then again, Oracle can and *should* go to hell, so who cares... -DEFINE_GUID(PARTITION_APPLE_ZFS, 0x6A898CC3, 0x1DD2, 0x11B2, 0x99, 0xA6, 0x08, 0x00, 0x20, 0x73, 0x66, 0x31); -DEFINE_GUID(PARTITION_ATARI_DATA, 0x734E5AFE, 0xF61A, 0x11E6, 0xBC, 0x64, 0x92, 0x36, 0x1F, 0x00, 0x26, 0x71); -DEFINE_GUID(PARTITION_BEOS_BFS, 0x42465331, 0x3BA3, 0x10F1, 0x80, 0x2A, 0x48, 0x61, 0x69, 0x6B, 0x75, 0x21); -DEFINE_GUID(PARTITION_CHROMEOS_KERNEL, 0xFE3A2A5D, 0x4F32, 0x41A7, 0xB7, 0x25, 0xAC, 0xCC, 0x32, 0x85, 0xA3, 0x09); -DEFINE_GUID(PARTITION_CHROMEOS_RESERVED, 0x2E0A753D, 0x9E48, 0x43B0, 0x83, 0x37, 0xB1, 0x51, 0x92, 0xCB, 0x1B, 0x5E); -DEFINE_GUID(PARTITION_CHROMEOS_ROOT, 0x3CB8E202, 0x3B7E, 0x47DD, 0x8A, 0x3C, 0x7F, 0xF2, 0xA1, 0x3C, 0xFC, 0xEC); -DEFINE_GUID(PARTITION_COREOS_RAID, 0xBE9067B9, 0xEA49, 0x4F15, 0xB4, 0xF6, 0xF3, 0x6F, 0x8C, 0x9E, 0x18, 0x18); -DEFINE_GUID(PARTITION_COREOS_RESERVED, 0xC95DC21A, 0xDF0E, 0x4340, 0x8D, 0x7B, 0x26, 0xCB, 0xFA, 0x9A, 0x03, 0xE0); -DEFINE_GUID(PARTITION_COREOS_ROOT, 0x3884DD41, 0x8582, 0x4404, 0xB9, 0xA8, 0xE9, 0xB8, 0x4F, 0x2D, 0xF5, 0x0E); -DEFINE_GUID(PARTITION_COREOS_USR, 0x5DFBF5F4, 0x2848, 0x4BAC, 0xAA, 0x5E, 0x0D, 0x9A, 0x20, 0xB7, 0x45, 0xA6); -DEFINE_GUID(PARTITION_FREEBSD_BOOT, 0x83BD6B9D, 0x7F41, 0x11DC, 0xBE, 0x0B, 0x00, 0x15, 0x60, 0xB8, 0x4F, 0x0F); -DEFINE_GUID(PARTITION_FREEBSD_DATA, 0x516E7CB4, 0x6ECF, 0x11D6, 0x8F, 0xF8, 0x00, 0x02, 0x2D, 0x09, 0x71, 0x2B); -DEFINE_GUID(PARTITION_FREEBSD_LVM, 0x516E7CB8, 0x6ECF, 0x11D6, 0x8F, 0xF8, 0x00, 0x02, 0x2D, 0x09, 0x71, 0x2B); -DEFINE_GUID(PARTITION_FREEBSD_SWAP, 0x516E7CB5, 0x6ECF, 0x11D6, 0x8F, 0xF8, 0x00, 0x02, 0x2D, 0x09, 0x71, 0x2B); -DEFINE_GUID(PARTITION_FREEBSD_UFS, 0x516E7CB6, 0x6ECF, 0x11D6, 0x8F, 0xF8, 0x00, 0x02, 0x2D, 0x09, 0x71, 0x2B); -DEFINE_GUID(PARTITION_FREEBSD_ZFS, 0x516E7CBA, 0x6ECF, 0x11D6, 0x8F, 0xF8, 0x00, 0x02, 0x2D, 0x09, 0x71, 0x2B); -DEFINE_GUID(PARTITION_GENERIC_BIOS_BOOT, 0x21686148, 0x6449, 0x6E6F, 0x74, 0x4E, 0x65, 0x65, 0x64, 0x45, 0x46, 0x49); -DEFINE_GUID(PARTITION_GENERIC_XBOOTLDR, 0xBC13C2FF, 0x59E6, 0x4262, 0xA3, 0x52, 0xB2, 0x75, 0xFD, 0x6F, 0x71, 0x72); -DEFINE_GUID(PARTITION_GENERIC_ESP, 0xC12A7328, 0xF81F, 0x11D2, 0xBA, 0x4B, 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B); -DEFINE_GUID(PARTITION_GENERIC_MBR, 0x024DEE41, 0x33E7, 0x11D3, 0x9D, 0x69, 0x00, 0x08, 0xC7, 0x81, 0xF3, 0x9F); -DEFINE_GUID(PARTITION_GENERIC_UNUSED, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); -DEFINE_GUID(PARTITION_HPUX_DATA, 0x75894C1E, 0x3AEB, 0x11D3, 0xB7, 0xC1, 0x7B, 0x03, 0xA0, 0x00, 0x00, 0x00); -DEFINE_GUID(PARTITION_HPUX_SERVICE, 0xE2A1E728, 0x32E3, 0x11D6, 0xA6, 0x82, 0x7B, 0x03, 0xA0, 0x00, 0x00, 0x00); -DEFINE_GUID(PARTITION_IBM_GPFS, 0x37AFFC90, 0xEF7D, 0x4E96, 0x91, 0xC3, 0x2D, 0x7A, 0xE0, 0x55, 0xB1, 0x74); -DEFINE_GUID(PARTITION_INTEL_IFF, 0xD3BFE2DE, 0x3DAF, 0x11DF, 0xBA, 0x40, 0xE3, 0xA5, 0x56, 0xD8, 0x95, 0x93); -DEFINE_GUID(PARTITION_LENOVO_BOOT, 0xBFBFAFE7, 0xA34F, 0x448A, 0x9A, 0x5B, 0x62, 0x13, 0xEB, 0x73, 0x6C, 0x22); -DEFINE_GUID(PARTITION_LINUX_BOOT, 0xBC13C2FF, 0x59E6, 0x4262, 0xA3, 0x52, 0xB2, 0x75, 0xFD, 0x6F, 0x71, 0x72); -DEFINE_GUID(PARTITION_LINUX_DATA, 0x0FC63DAF, 0x8483, 0x4772, 0x8E, 0x79, 0x3D, 0x69, 0xD8, 0x47, 0x7D, 0xE4); -DEFINE_GUID(PARTITION_LINUX_ENCRYPTED, 0x7FFEC5C9, 0x2D00, 0x49B7, 0x89, 0x41, 0x3E, 0xA1, 0x0A, 0x55, 0x86, 0xB7); -DEFINE_GUID(PARTITION_LINUX_HOME, 0x933AC7E1, 0x2EB4, 0x4F13, 0xB8, 0x44, 0x0E, 0x14, 0xE2, 0xAE, 0xF9, 0x15); -DEFINE_GUID(PARTITION_LINUX_LUKS, 0xCA7D7CCB, 0x63ED, 0x4C53, 0x86, 0x1C, 0x17, 0x42, 0x53, 0x60, 0x59, 0xCC); -DEFINE_GUID(PARTITION_LINUX_LVM, 0xE6D6D379, 0xF507, 0x44C2, 0xA2, 0x3C, 0x23, 0x8F, 0x2A, 0x3D, 0xF9, 0x28); -DEFINE_GUID(PARTITION_LINUX_RAID, 0xA19D880F, 0x05FC, 0x4D3B, 0xA0, 0x06, 0x74, 0x3F, 0x0F, 0x84, 0x91, 0x1E); -DEFINE_GUID(PARTITION_LINUX_RESERVED, 0x8DA63339, 0x0007, 0x60C0, 0xC4, 0x36, 0x08, 0x3A, 0xC8, 0x23, 0x09, 0x08); -DEFINE_GUID(PARTITION_LINUX_ROOT_ARM_32, 0x69DAD710, 0x2CE4, 0x4E3C, 0xB1, 0x6C, 0x21, 0xA1, 0xD4, 0x9A, 0xBE, 0xD3); -DEFINE_GUID(PARTITION_LINUX_ROOT_ARM_64, 0xB921B045, 0x1DF0, 0x41C3, 0xAF, 0x44, 0x4C, 0x6F, 0x28, 0x0D, 0x3F, 0xAE); -DEFINE_GUID(PARTITION_LINUX_ROOT_X86_32, 0x44479540, 0xF297, 0x41B2, 0x9A, 0xF7, 0xD1, 0x31, 0xD5, 0xF0, 0x45, 0x8A); -DEFINE_GUID(PARTITION_LINUX_ROOT_X86_64, 0x4F68BCE3, 0xE8CD, 0x4DB1, 0x96, 0xE7, 0xFB, 0xCA, 0xF9, 0x84, 0xB7, 0x09); -DEFINE_GUID(PARTITION_LINUX_SRV, 0x3B8F8425, 0x20E0, 0x4F3B, 0x90, 0x7F, 0x1A, 0x25, 0xA7, 0x6F, 0x98, 0xE8); -DEFINE_GUID(PARTITION_LINUX_SWAP, 0x0657FD6D, 0xA4AB, 0x43C4, 0x84, 0xE5, 0x09, 0x33, 0xC8, 0x4B, 0x4F, 0x4F); -DEFINE_GUID(PARTITION_MICROSOFT_DATA, 0xEBD0A0A2, 0xB9E5, 0x4433, 0x87, 0xC0, 0x68, 0xB6, 0xB7, 0x26, 0x99, 0xC7); -DEFINE_GUID(PARTITION_MICROSOFT_LDM_DATA, 0xAF9B60A0, 0x1431, 0x4F62, 0xBC, 0x68, 0x33, 0x11, 0x71, 0x4A, 0x69, 0xAD); -DEFINE_GUID(PARTITION_MICROSOFT_LDM_META, 0x5808C8AA, 0x7E8F, 0x42E0, 0x85, 0xD2, 0xE1, 0xE9, 0x04, 0x34, 0xCF, 0xB3); -DEFINE_GUID(PARTITION_MICROSOFT_RECOVERY, 0xDE94BBA4, 0x06D1, 0x4D40, 0xA1, 0x6A, 0xBF, 0xD5, 0x01, 0x79, 0xD6, 0xAC); -DEFINE_GUID(PARTITION_MICROSOFT_RESERVED, 0xE3C9E316, 0x0B5C, 0x4DB8, 0x81, 0x7D, 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE); -DEFINE_GUID(PARTITION_MICROSOFT_STORAGE_SPACES, 0xE75CAF8F, 0xF680, 0x4CEE, 0xAF, 0xA3, 0xB0, 0x01, 0xE5, 0x6E, 0xFC, 0x2D); -DEFINE_GUID(PARTITION_NETBSD_CONCAT, 0x2DB519C4, 0xB10F, 0x11DC, 0xB9, 0x9B, 0x00, 0x19, 0xD1, 0x87, 0x96, 0x48); -DEFINE_GUID(PARTITION_NETBSD_ENCRYPTED, 0x2DB519EC, 0xB10F, 0x11DC, 0xB9, 0x9B, 0x00, 0x19, 0xD1, 0x87, 0x96, 0x48); -DEFINE_GUID(PARTITION_NETBSD_FFS, 0x49F48D5A, 0xB10E, 0x11DC, 0xB9, 0x9B, 0x00, 0x19, 0xD1, 0x87, 0x96, 0x48); -DEFINE_GUID(PARTITION_NETBSD_LFS, 0x49F48D82, 0xB10E, 0x11DC, 0xB9, 0x9B, 0x00, 0x19, 0xD1, 0x87, 0x96, 0x48); -DEFINE_GUID(PARTITION_NETBSD_RAID, 0x49F48DAA, 0xB10E, 0x11DC, 0xB9, 0x9B, 0x00, 0x19, 0xD1, 0x87, 0x96, 0x48); -DEFINE_GUID(PARTITION_NETBSD_SWAP, 0x49F48D32, 0xB10E, 0x11DC, 0xB9, 0x9B, 0x00, 0x19, 0xD1, 0x87, 0x96, 0x48); -DEFINE_GUID(PARTITION_OPENBSD_DATA, 0x824CC7A0, 0x36A8, 0x11E3, 0x89, 0x0A, 0x95, 0x25, 0x19, 0xAD, 0x3F, 0x61); -DEFINE_GUID(PARTITION_PLAN9_DATA, 0xC91818F9, 0x8025, 0x47AF, 0x89, 0xD2, 0xF0, 0x30, 0xD7, 0x00, 0x0C, 0x2C); -DEFINE_GUID(PARTITION_PREP_BOOT, 0x9E1A2D38, 0xC612, 0x4316, 0xAA, 0x26, 0x8B, 0x49, 0x52, 0x1E, 0x5A, 0x8B); -DEFINE_GUID(PARTITION_QNX_DATA, 0xCEF5A9AD, 0x73BC, 0x4601, 0x89, 0xF3, 0xCD, 0xEE, 0xEE, 0xE3, 0x21, 0xA1); -DEFINE_GUID(PARTITION_SOLARIS_ALT, 0x6A9283A5, 0x1DD2, 0x11B2, 0x99, 0xA6, 0x08, 0x00, 0x20, 0x73, 0x66, 0x31); -DEFINE_GUID(PARTITION_SOLARIS_BACKUP, 0x6A8B642B, 0x1DD2, 0x11B2, 0x99, 0xA6, 0x08, 0x00, 0x20, 0x73, 0x66, 0x31); -DEFINE_GUID(PARTITION_SOLARIS_BOOT, 0x6A82CB45, 0x1DD2, 0x11B2, 0x99, 0xA6, 0x08, 0x00, 0x20, 0x73, 0x66, 0x31); -DEFINE_GUID(PARTITION_SOLARIS_HOME, 0x6A90BA39, 0x1DD2, 0x11B2, 0x99, 0xA6, 0x08, 0x00, 0x20, 0x73, 0x66, 0x31); -DEFINE_GUID(PARTITION_SOLARIS_RESERVED1, 0x6A945A3B, 0x1DD2, 0x11B2, 0x99, 0xA6, 0x08, 0x00, 0x20, 0x73, 0x66, 0x31); -DEFINE_GUID(PARTITION_SOLARIS_RESERVED2, 0x6A9630D1, 0x1DD2, 0x11B2, 0x99, 0xA6, 0x08, 0x00, 0x20, 0x73, 0x66, 0x31); -DEFINE_GUID(PARTITION_SOLARIS_RESERVED3, 0x6A980767, 0x1DD2, 0x11B2, 0x99, 0xA6, 0x08, 0x00, 0x20, 0x73, 0x66, 0x31); -DEFINE_GUID(PARTITION_SOLARIS_RESERVED4, 0x6A96237F, 0x1DD2, 0x11B2, 0x99, 0xA6, 0x08, 0x00, 0x20, 0x73, 0x66, 0x31); -DEFINE_GUID(PARTITION_SOLARIS_RESERVED5, 0x6A8D2AC7, 0x1DD2, 0x11B2, 0x99, 0xA6, 0x08, 0x00, 0x20, 0x73, 0x66, 0x31); -// You sure you don't need a couple more reserved partition GUIDs here, Solaris? -DEFINE_GUID(PARTITION_SOLARIS_ROOT, 0x6A85CF4D, 0x1DD2, 0x11B2, 0x99, 0xA6, 0x08, 0x00, 0x20, 0x73, 0x66, 0x31); -DEFINE_GUID(PARTITION_SOLARIS_SWAP, 0x6A87C46F, 0x1DD2, 0x11B2, 0x99, 0xA6, 0x08, 0x00, 0x20, 0x73, 0x66, 0x31); -//DEFINE_GUID(PARTITION_SOLARIS_USR, 0x6A898CC3, 0x1DD2, 0x11B2, 0x99, 0xA6, 0x08, 0x00, 0x20, 0x73, 0x66, 0x31); -DEFINE_GUID(PARTITION_SOLARIS_VAR, 0x6A8EF2E9, 0x1DD2, 0x11B2, 0x99, 0xA6, 0x08, 0x00, 0x20, 0x73, 0x66, 0x31); -DEFINE_GUID(PARTITION_SONY_BOOT, 0xF4019732, 0x066E, 0x4E12, 0x82, 0x73, 0x34, 0x6C, 0x56, 0x41, 0x49, 0x4F); -DEFINE_GUID(PARTITION_VERACRYPT_DATA, 0x8C8F8EFF, 0xAC95, 0x4770, 0x81, 0x4A, 0x21, 0x99, 0x4F, 0x2D, 0xBC, 0x8F); -DEFINE_GUID(PARTITION_VMWARE_COREDUMP, 0x9D275380, 0x40AD, 0x11DB, 0xBF, 0x97, 0x00, 0x0C, 0x29, 0x11, 0xD1, 0xB8); -DEFINE_GUID(PARTITION_VMWARE_RESERVED, 0x9198EFFC, 0x31C0, 0x11DB, 0x8F, 0x78, 0x00, 0x0C, 0x29, 0x11, 0xD1, 0xB8); -DEFINE_GUID(PARTITION_VMWARE_VMFS, 0xAA31E02A, 0x400F, 0x11DB, 0x95, 0x90, 0x00, 0x0C, 0x29, 0x11, 0xD1, 0xB8); - typedef struct { - const GUID* guid; - const char* name; -} gpt_type_t; + uint16_t code; + const char* guid_str; + const char* description; +} gpt_type_entry_t; -gpt_type_t gpt_type[] = { - { &PARTITION_ANDROID_BOOT, "Android Boot Partition" }, - { &PARTITION_ANDROID_BOOTLOADER1, "Android Bootloader Partition" }, - { &PARTITION_ANDROID_BOOTLOADER2, "Android Bootloader Partition" }, - { &PARTITION_ANDROID_CACHE, "Android Cache Partition" }, - { &PARTITION_ANDROID_CONFIG, "Android Config Partition" }, - { &PARTITION_ANDROID_DATA, "Android Data Partition" }, - { &PARTITION_ANDROID_EXT, "Android Ext Partition" }, - { &PARTITION_ANDROID_FACTORY1, "Android Factory Partition" }, - { &PARTITION_ANDROID_FACTORY2, "Android Factory Partition" }, - { &PARTITION_ANDROID_FASTBOOT, "Android Fastboot Partition" }, - { &PARTITION_ANDROID_METADATA1, "Android Metadata Partition" }, - { &PARTITION_ANDROID_METADATA2, "Android Metadata Partition" }, - { &PARTITION_ANDROID_MISC, "Android Misc Partition" }, - { &PARTITION_ANDROID_OEM, "Android OEM Partition" }, - { &PARTITION_ANDROID_PERSISTENCE, "Android Persistent Partition" }, - { &PARTITION_ANDROID_RECOVERY, "Android Recovery Partition" }, - { &PARTITION_ANDROID_SYSTEM, "Android System Partition" }, - { &PARTITION_ANDROID_VENDOR, "Android Vendor Partition" }, - { &PARTITION_APPLE_APFS, "Apple APFS Partition" }, - { &PARTITION_APPLE_BOOT, "Apple Boot Partition" }, - { &PARTITION_APPLE_FILEVAULT, "Apple Filevault Partition" }, - { &PARTITION_APPLE_HFS, "Apple HFS+ Partition" }, - { &PARTITION_APPLE_LABEL, "Apple Label Partition" }, - { &PARTITION_APPLE_OFFLINE_RAID, "Apple RAID Partition (Offline)" }, - { &PARTITION_APPLE_RAID, "Apple RAID Partition" }, - { &PARTITION_APPLE_RAID_CACHE, "Apple RAID Cache Partition" }, - { &PARTITION_APPLE_RAID_SCRATCH, "Apple RAID Scratch Partition" }, - { &PARTITION_APPLE_RAID_STATUS, "Apple RAID Status Partition" }, - { &PARTITION_APPLE_RAID_VOLUME, "Apple RAID Volume Partition" }, - { &PARTITION_APPLE_RECOVERY, "Apple Recovery Partition" }, - { &PARTITION_APPLE_UFS, "Apple UFS Partition" }, - { &PARTITION_APPLE_ZFS, "Apple ZFS Partition" }, - { &PARTITION_ATARI_DATA, "Atari Data Partition" }, - { &PARTITION_BEOS_BFS, "BeOS BFS Partition" }, - { &PARTITION_CHROMEOS_KERNEL, "Chrome OS Kernel Partition" }, - { &PARTITION_CHROMEOS_RESERVED, "Chrome OS Reserved Partition" }, - { &PARTITION_CHROMEOS_ROOT, "Chrome OS Root Partition" }, - { &PARTITION_COREOS_RAID, "CoreOS Raid Partition" }, - { &PARTITION_COREOS_RESERVED, "CoreOS Reserved Partition" }, - { &PARTITION_COREOS_ROOT, "CoreOS Root Partition" }, - { &PARTITION_COREOS_USR, "CoreOS Usr Partition" }, - { &PARTITION_FREEBSD_BOOT, "FreeBSD Boot Partition" }, - { &PARTITION_FREEBSD_DATA, "FreeBSD Data Partition" }, - { &PARTITION_FREEBSD_LVM, "FreeBSD LVM Partition" }, - { &PARTITION_FREEBSD_SWAP, "FreeBSD Swap Partition" }, - { &PARTITION_FREEBSD_UFS, "FreeBSD UFS Partition" }, - { &PARTITION_FREEBSD_ZFS, "FreeBSD ZFS Partition" }, - { &PARTITION_GENERIC_BIOS_BOOT, "BIOS Boot Partition" }, - { &PARTITION_GENERIC_XBOOTLDR, "Extended Boot Loader Partition" }, - { &PARTITION_GENERIC_ESP, "EFI System Partition" }, - { &PARTITION_GENERIC_MBR, "MBR Partition" }, - { &PARTITION_GENERIC_UNUSED, "Unused Partition" }, - { &PARTITION_HPUX_DATA, "HP-UX Data Partition" }, - { &PARTITION_HPUX_SERVICE, "HP-UX Service Partition" }, - { &PARTITION_IBM_GPFS, "IBM GPFS Partition" }, - { &PARTITION_INTEL_IFF, "Intel Fast Flash Partition" }, - { &PARTITION_LENOVO_BOOT, "Lenovo Boot Partition" }, - { &PARTITION_LINUX_BOOT, "Linux Boot Partition" }, - { &PARTITION_LINUX_DATA, "Linux Data Partition" }, - { &PARTITION_LINUX_ENCRYPTED, "Linux Encrypted Partition" }, - { &PARTITION_LINUX_HOME, "Linux Home Partition" }, - { &PARTITION_LINUX_LUKS, "Linux LUKS Partition" }, - { &PARTITION_LINUX_LVM, "Linux LVM Partition" }, - { &PARTITION_LINUX_RAID, "Linux RAID Partition" }, - { &PARTITION_LINUX_RESERVED, "Linux Reserved Partition" }, - { &PARTITION_LINUX_ROOT_ARM_32, "Linux Boot Partition (ARM)" }, - { &PARTITION_LINUX_ROOT_ARM_64, "Linux Boot Partition (ARM64)" }, - { &PARTITION_LINUX_ROOT_X86_32, "Linux Boot Partition (x86-32)" }, - { &PARTITION_LINUX_ROOT_X86_64, "Linux Boot Partition (x86-64)" }, - { &PARTITION_LINUX_SRV, "Linux Srv Partition" }, - { &PARTITION_LINUX_SWAP, "Linux Swap Partition" }, - { &PARTITION_MICROSOFT_DATA, "Microsoft Basic Data Partition" }, - { &PARTITION_MICROSOFT_LDM_DATA, "Microsoft LDM Data Partition" }, - { &PARTITION_MICROSOFT_LDM_META, "Microsoft LDM Metadata Partition" }, - { &PARTITION_MICROSOFT_RECOVERY, "Microsoft Recovery Partition" }, - { &PARTITION_MICROSOFT_RESERVED, "Microsoft System Reserved Partition" }, - { &PARTITION_MICROSOFT_STORAGE_SPACES, "Microsoft Storage Spaces Partition" }, - { &PARTITION_NETBSD_CONCAT, "NetBSD Concatenated Partition" }, - { &PARTITION_NETBSD_ENCRYPTED, "NetBSD Encrypted Partition" }, - { &PARTITION_NETBSD_FFS, "NetBSD FFS Partition" }, - { &PARTITION_NETBSD_LFS, "NetBSD LFS Partition" }, - { &PARTITION_NETBSD_RAID, "NetBSD RAID Partition" }, - { &PARTITION_NETBSD_SWAP, "NetBSD Swap Partition" }, - { &PARTITION_OPENBSD_DATA, "OpenBSD Data Partition" }, - { &PARTITION_PLAN9_DATA, "Plan 9 Data Partition" }, - { &PARTITION_PREP_BOOT, "PReP Boot Partition" }, - { &PARTITION_QNX_DATA, "QNX Data Partition" }, - { &PARTITION_SOLARIS_ALT, "Solaris Alternate Sector Partition" }, - { &PARTITION_SOLARIS_BACKUP, "Solaris Backup Partition" }, - { &PARTITION_SOLARIS_BOOT, "Solaris Boot Partition" }, - { &PARTITION_SOLARIS_HOME, "Solaris Home Partition" }, - { &PARTITION_SOLARIS_RESERVED1, "Solaris Reserved Partition" }, - { &PARTITION_SOLARIS_RESERVED2, "Solaris Reserved Partition" }, - { &PARTITION_SOLARIS_RESERVED3, "Solaris Reserved Partition" }, - { &PARTITION_SOLARIS_RESERVED4, "Solaris Reserved Partition" }, - { &PARTITION_SOLARIS_RESERVED5, "Solaris Reserved Partition" }, - { &PARTITION_SOLARIS_ROOT, "Solaris Root Partition" }, - { &PARTITION_SOLARIS_SWAP, "Solaris Swap Partition" }, -// { &PARTITION_SOLARIS_USR, "Solaris Usr Partition" }, - { &PARTITION_SOLARIS_VAR, "Solaris Var Partition" }, - { &PARTITION_SONY_BOOT, "Sony Boot Partition" }, - { &PARTITION_VERACRYPT_DATA, "VeraCrypt Data Partition" }, - { &PARTITION_VMWARE_COREDUMP, "VMware Coredump Partition" }, - { &PARTITION_VMWARE_RESERVED, "VMware Reserved Partition" }, - { &PARTITION_VMWARE_VMFS, "VMware VMFS Partition" }, +#define AddType(code, guid, desc, ...) { code, guid, desc }, + +/* + * Because we value our sanity, we build our GPT entries from code lifted + * verbatim from Debian's gdisk's parttypes.cc and use AddType() as a macro + * to create a static table. + */ +static const gpt_type_entry_t gpt_type_table[] = { + // From https://salsa.debian.org/debian/gdisk/-/blob/master/parttypes.cc + // Semicolons after Addtype() *MUST* be removed. + + // Start with the "unused entry," which should normally appear only + // on empty partition table entries.... + AddType(0x0000, "00000000-0000-0000-0000-000000000000", "Unused entry", 0) + + // DOS/Windows partition types, most of which are hidden from the "L" listing + // (they're available mainly for MBR-to-GPT conversions). + AddType(0x0100, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0) // FAT-12 + AddType(0x0400, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0) // FAT-16 < 32M + AddType(0x0600, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0) // FAT-16 + AddType(0x0700, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 1) // NTFS (or HPFS) + AddType(0x0701, "558D43C5-A1AC-43C0-AAC8-D1472B2923D1", "Microsoft Storage Replica", 1) + AddType(0x0702, "90B6FF38-B98F-4358-A21F-48F35B4A8AD3", "ArcaOS Type 1", 1) + AddType(0x0b00, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0) // FAT-32 + AddType(0x0c00, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0) // FAT-32 LBA + AddType(0x0c01, "E3C9E316-0B5C-4DB8-817D-F92DF00215AE", "Microsoft reserved") + AddType(0x0e00, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0) // FAT-16 LBA + AddType(0x1100, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0) // Hidden FAT-12 + AddType(0x1400, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0) // Hidden FAT-16 < 32M + AddType(0x1600, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0) // Hidden FAT-16 + AddType(0x1700, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0) // Hidden NTFS (or HPFS) + AddType(0x1b00, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0) // Hidden FAT-32 + AddType(0x1c00, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0) // Hidden FAT-32 LBA + AddType(0x1e00, "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "Microsoft basic data", 0) // Hidden FAT-16 LBA + AddType(0x2700, "DE94BBA4-06D1-4D40-A16A-BFD50179D6AC", "Windows RE") + + // Open Network Install Environment (ONIE) specific types. + // See http://www.onie.org/ and + // https://github.com/opencomputeproject/onie/blob/master/patches/gptfdisk/add-onie-partition-types.patch + AddType(0x3000, "7412F7D5-A156-4B13-81DC-867174929325", "ONIE boot") + AddType(0x3001, "D4E6E2CD-4469-46F3-B5CB-1BFF57AFC149", "ONIE config") + + // Plan 9; see http://man.cat-v.org/9front/8/prep + AddType(0x3900, "C91818F9-8025-47AF-89D2-F030D7000C2C", "Plan 9") + + // PowerPC reference platform boot partition + AddType(0x4100, "9E1A2D38-C612-4316-AA26-8B49521E5A8B", "PowerPC PReP boot") + + // Windows LDM ("dynamic disk") types + AddType(0x4200, "AF9B60A0-1431-4F62-BC68-3311714A69AD", "Windows LDM data") // Logical disk manager + AddType(0x4201, "5808C8AA-7E8F-42E0-85D2-E1E90434CFB3", "Windows LDM metadata") // Logical disk manager + AddType(0x4202, "E75CAF8F-F680-4CEE-AFA3-B001E56EFC2D", "Windows Storage Spaces") // A newer LDM-type setup + + // An oddball IBM filesystem.... + AddType(0x7501, "37AFFC90-EF7D-4E96-91C3-2D7AE055B174", "IBM GPFS") // General Parallel File System (GPFS) + + // ChromeOS-specific partition types... + // Values taken from vboot_reference/firmware/lib/cgptlib/include/gpt.h in + // ChromeOS source code, retrieved 12/23/2010. They're also at + // http://www.chromium.org/chromium-os/chromiumos-design-docs/disk-format. + // These have no MBR equivalents, AFAIK, so I'm using 0x7Fxx values, since they're close + // to the Linux values. + AddType(0x7f00, "FE3A2A5D-4F32-41A7-B725-ACCC3285A309", "ChromeOS kernel") + AddType(0x7f01, "3CB8E202-3B7E-47DD-8A3C-7FF2A13CFCEC", "ChromeOS root") + AddType(0x7f02, "2E0A753D-9E48-43B0-8337-B15192CB1B5E", "ChromeOS reserved") + AddType(0x7f03, "CAB6E88E-ABF3-4102-A07A-D4BB9BE3C1D3", "ChromeOS firmware") + AddType(0x7f04, "09845860-705F-4BB5-B16C-8A8A099CAF52", "ChromeOS mini-OS") + AddType(0x7f05, "3F0F8318-F146-4E6B-8222-C28C8F02E0D5", "ChromeOS hibernate") + + // Linux-specific partition types.... + AddType(0x8200, "0657FD6D-A4AB-43C4-84E5-0933C84B4F4F", "Linux swap") // Linux swap (or Solaris on MBR) + AddType(0x8300, "0FC63DAF-8483-4772-8E79-3D69D8477DE4", "Linux filesystem") // Linux native + AddType(0x8301, "8DA63339-0007-60C0-C436-083AC8230908", "Linux reserved") + // See https://www.freedesktop.org/software/systemd/man/systemd-gpt-auto-generator.html + // and https://systemd.io/DISCOVERABLE_PARTITIONS + AddType(0x8302, "933AC7E1-2EB4-4F13-B844-0E14E2AEF915", "Linux /home") // Linux /home (auto-mounted by systemd) + AddType(0x8303, "44479540-F297-41B2-9AF7-D131D5F0458A", "Linux x86 root (/)") // Linux / on x86 (auto-mounted by systemd) + AddType(0x8304, "4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709", "Linux x86-64 root (/)") // Linux / on x86-64 (auto-mounted by systemd) + AddType(0x8305, "B921B045-1DF0-41C3-AF44-4C6F280D3FAE", "Linux ARM64 root (/)") // Linux / on 64-bit ARM (auto-mounted by systemd) + AddType(0x8306, "3B8F8425-20E0-4F3B-907F-1A25A76F98E8", "Linux /srv") // Linux /srv (auto-mounted by systemd) + AddType(0x8307, "69DAD710-2CE4-4E3C-B16C-21A1D49ABED3", "Linux ARM32 root (/)") // Linux / on 32-bit ARM (auto-mounted by systemd) + AddType(0x8308, "7FFEC5C9-2D00-49B7-8941-3EA10A5586B7", "Linux dm-crypt") + AddType(0x8309, "CA7D7CCB-63ED-4C53-861C-1742536059CC", "Linux LUKS") + AddType(0x830A, "993D8D3D-F80E-4225-855A-9DAF8ED7EA97", "Linux IA-64 root (/)") // Linux / on Itanium (auto-mounted by systemd) + AddType(0x830B, "D13C5D3B-B5D1-422A-B29F-9454FDC89D76", "Linux x86 root verity") + AddType(0x830C, "2C7357ED-EBD2-46D9-AEC1-23D437EC2BF5", "Linux x86-64 root verity") + AddType(0x830D, "7386CDF2-203C-47A9-A498-F2ECCE45A2D6", "Linux ARM32 root verity") + AddType(0x830E, "DF3300CE-D69F-4C92-978C-9BFB0F38D820", "Linux ARM64 root verity") + AddType(0x830F, "86ED10D5-B607-45BB-8957-D350F23D0571", "Linux IA-64 root verity") + AddType(0x8310, "4D21B016-B534-45C2-A9FB-5C16E091FD2D", "Linux /var") // Linux /var (auto-mounted by systemd) + AddType(0x8311, "7EC6F557-3BC5-4ACA-B293-16EF5DF639D1", "Linux /var/tmp") // Linux /var/tmp (auto-mounted by systemd) + // https://systemd.io/HOME_DIRECTORY/ + AddType(0x8312, "773F91EF-66D4-49B5-BD83-D683BF40AD16", "Linux user's home") // used by systemd-homed + AddType(0x8313, "75250D76-8CC6-458E-BD66-BD47CC81A812", "Linux x86 /usr ") // Linux /usr on x86 (auto-mounted by systemd) + AddType(0x8314, "8484680C-9521-48C6-9C11-B0720656F69E", "Linux x86-64 /usr") // Linux /usr on x86-64 (auto-mounted by systemd) + AddType(0x8315, "7D0359A3-02B3-4F0A-865C-654403E70625", "Linux ARM32 /usr") // Linux /usr on 32-bit ARM (auto-mounted by systemd) + AddType(0x8316, "B0E01050-EE5F-4390-949A-9101B17104E9", "Linux ARM64 /usr") // Linux /usr on 64-bit ARM (auto-mounted by systemd) + AddType(0x8317, "4301D2A6-4E3B-4B2A-BB94-9E0B2C4225EA", "Linux IA-64 /usr") // Linux /usr on Itanium (auto-mounted by systemd) + AddType(0x8318, "8F461B0D-14EE-4E81-9AA9-049B6FB97ABD", "Linux x86 /usr verity") + AddType(0x8319, "77FF5F63-E7B6-4633-ACF4-1565B864C0E6", "Linux x86-64 /usr verity") + AddType(0x831A, "C215D751-7BCD-4649-BE90-6627490A4C05", "Linux ARM32 /usr verity") + AddType(0x831B, "6E11A4E7-FBCA-4DED-B9E9-E1A512BB664E", "Linux ARM64 /usr verity") + AddType(0x831C, "6A491E03-3BE7-4545-8E38-83320E0EA880", "Linux IA-64 /usr verity") + AddType(0x831D, "6523F8AE-3EB1-4E2A-A05A-18B695AE656F", "Linux Alpha root (/)") + AddType(0x831E, "D27F46ED-2919-4CB8-BD25-9531F3C16534", "Linux ARC root (/)") + AddType(0x831F, "77055800-792C-4F94-B39A-98C91B762BB6", "Linux LoongArch root (/)") + AddType(0x8320, "E9434544-6E2C-47CC-BAE2-12D6DEAFB44C", "Linux MIPS-32 BE root (/)") + AddType(0x8321, "D113AF76-80EF-41B4-BDB6-0CFF4D3D4A25", "Linux MIPS-64 BE root (/)") + AddType(0x8322, "37C58C8A-D913-4156-A25F-48B1B64E07F0", "Linux MIPS-32 LE root (/)") + AddType(0x8323, "700BDA43-7A34-4507-B179-EEB93D7A7CA3", "Linux MIPS-64 LE root (/)") + AddType(0x8324, "1AACDB3B-5444-4138-BD9E-E5C2239B2346", "Linux PA-RISC root (/)") + AddType(0x8325, "1DE3F1EF-FA98-47B5-8DCD-4A860A654D78", "Linux PowerPC-32 root (/)") + AddType(0x8326, "912ADE1D-A839-4913-8964-A10EEE08FBD2", "Linux PowerPC-64 BE root (/)") + AddType(0x8327, "C31C45E6-3F39-412E-80FB-4809C4980599", "Linux PowerPC-64 LE root (/)") + AddType(0x8328, "60D5A7FE-8E7D-435C-B714-3DD8162144E1", "Linux RISC-V-32 root (/)") + AddType(0x8329, "72EC70A6-CF74-40E6-BD49-4BDA08E8F224", "Linux RISC-V-64 root (/)") + AddType(0x832A, "08A7ACEA-624C-4A20-91E8-6E0FA67D23F9", "Linux s390 root (/)") + AddType(0x832B, "5EEAD9A9-FE09-4A1E-A1D7-520D00531306", "Linux s390x root (/)") + AddType(0x832C, "C50CDD70-3862-4CC3-90E1-809A8C93EE2C", "Linux TILE-Gx root (/)") + AddType(0x832D, "E18CF08C-33EC-4C0D-8246-C6C6FB3DA024", "Linux Alpha /usr") + AddType(0x832E, "7978A683-6316-4922-BBEE-38BFF5A2FECC", "Linux ARC /usr") + AddType(0x832F, "E611C702-575C-4CBE-9A46-434FA0BF7E3F", "Linux LoongArch /usr") + AddType(0x8330, "773B2ABC-2A99-4398-8BF5-03BAAC40D02B", "Linux MIPS-32 BE /usr") + AddType(0x8331, "57E13958-7331-4365-8E6E-35EEEE17C61B", "Linux MIPS-64 BE /usr") + AddType(0x8332, "0F4868E9-9952-4706-979F-3ED3A473E947", "Linux MIPS-32 LE /usr") + AddType(0x8333, "C97C1F32-BA06-40B4-9F22-236061B08AA8", "Linux MIPS-64 LE /usr") + AddType(0x8334, "DC4A4480-6917-4262-A4EC-DB9384949F25", "Linux PA-RISC /usr") + AddType(0x8335, "7D14FEC5-CC71-415D-9D6C-06BF0B3C3EAF", "Linux PowerPC-32 /usr") + AddType(0x8336, "2C9739E2-F068-46B3-9FD0-01C5A9AFBCCA", "Linux PowerPC-64 BE /usr") + AddType(0x8337, "15BB03AF-77E7-4D4A-B12B-C0D084F7491C", "Linux PowerPC-64 LE /usr") + AddType(0x8338, "B933FB22-5C3F-4F91-AF90-E2BB0FA50702", "Linux RISC-V-32 /usr") + AddType(0x8339, "BEAEC34B-8442-439B-A40B-984381ED097D", "Linux RISC-V-64 /usr") + AddType(0x833A, "CD0F869B-D0FB-4CA0-B141-9EA87CC78D66", "Linux s390 /usr") + AddType(0x833B, "8A4F5770-50AA-4ED3-874A-99B710DB6FEA", "Linux s390x /usr") + AddType(0x833C, "55497029-C7C1-44CC-AA39-815ED1558630", "Linux TILE-Gx /usr") + AddType(0x833D, "FC56D9E9-E6E5-4C06-BE32-E74407CE09A5", "Linux Alpha root verity") + AddType(0x833E, "24B2D975-0F97-4521-AFA1-CD531E421B8D", "Linux ARC root verity") + AddType(0x833F, "F3393B22-E9AF-4613-A948-9D3BFBD0C535", "Linux LoongArch root verity") + AddType(0x8340, "7A430799-F711-4C7E-8E5B-1D685BD48607", "Linux MIPS-32 BE root verity") + AddType(0x8341, "579536F8-6A33-4055-A95A-DF2D5E2C42A8", "Linux MIPS-64 BE root verity") + AddType(0x8342, "D7D150D2-2A04-4A33-8F12-16651205FF7B", "Linux MIPS-32 LE root verity") + AddType(0x8343, "16B417F8-3E06-4F57-8DD2-9B5232F41AA6", "Linux MIPS-64 LE root verity") + AddType(0x8344, "D212A430-FBC5-49F9-A983-A7FEEF2B8D0E", "Linux PA-RISC root verity") + AddType(0x8345, "906BD944-4589-4AAE-A4E4-DD983917446A", "Linux PowerPC-64 LE root verity") + AddType(0x8346, "9225A9A3-3C19-4D89-B4F6-EEFF88F17631", "Linux PowerPC-64 BE root verity") + AddType(0x8347, "98CFE649-1588-46DC-B2F0-ADD147424925", "Linux PowerPC-32 root verity") + AddType(0x8348, "AE0253BE-1167-4007-AC68-43926C14C5DE", "Linux RISC-V-32 root verity") + AddType(0x8349, "B6ED5582-440B-4209-B8DA-5FF7C419EA3D", "Linux RISC-V-64 root verity") + AddType(0x834A, "7AC63B47-B25C-463B-8DF8-B4A94E6C90E1", "Linux s390 root verity") + AddType(0x834B, "B325BFBE-C7BE-4AB8-8357-139E652D2F6B", "Linux s390x root verity") + AddType(0x834C, "966061EC-28E4-4B2E-B4A5-1F0A825A1D84", "Linux TILE-Gx root verity") + AddType(0x834D, "8CCE0D25-C0D0-4A44-BD87-46331BF1DF67", "Linux Alpha /usr verity") + AddType(0x834E, "FCA0598C-D880-4591-8C16-4EDA05C7347C", "Linux ARC /usr verity") + AddType(0x834F, "F46B2C26-59AE-48F0-9106-C50ED47F673D", "Linux LoongArch /usr verity") + AddType(0x8350, "6E5A1BC8-D223-49B7-BCA8-37A5FCCEB996", "Linux MIPS-32 BE /usr verity") + AddType(0x8351, "81CF9D90-7458-4DF4-8DCF-C8A3A404F09B", "Linux MIPS-64 BE /usr verity") + AddType(0x8352, "46B98D8D-B55C-4E8F-AAB3-37FCA7F80752", "Linux MIPS-32 LE /usr verity") + AddType(0x8353, "3C3D61FE-B5F3-414D-BB71-8739A694A4EF", "Linux MIPS-64 LE /usr verity") + AddType(0x8354, "5843D618-EC37-48D7-9F12-CEA8E08768B2", "Linux PA-RISC /usr verity") + AddType(0x8355, "EE2B9983-21E8-4153-86D9-B6901A54D1CE", "Linux PowerPC-64 LE /usr verity") + AddType(0x8356, "BDB528A5-A259-475F-A87D-DA53FA736A07", "Linux PowerPC-64 BE /usr verity") + AddType(0x8357, "DF765D00-270E-49E5-BC75-F47BB2118B09", "Linux PowerPC-32 /usr verity") + AddType(0x8358, "CB1EE4E3-8CD0-4136-A0A4-AA61A32E8730", "Linux RISC-V-32 /usr verity") + AddType(0x8359, "8F1056BE-9B05-47C4-81D6-BE53128E5B54", "Linux RISC-V-64 /usr verity") + AddType(0x835A, "B663C618-E7BC-4D6D-90AA-11B756BB1797", "Linux s390 /usr verity") + AddType(0x835B, "31741CC4-1A2A-4111-A581-E00B447D2D06", "Linux s390x /usr verity") + AddType(0x835C, "2FB4BF56-07FA-42DA-8132-6B139F2026AE", "Linux TILE-Gx /usr verity") + AddType(0x835D, "D46495B7-A053-414F-80F7-700C99921EF8", "Linux Alpha root verity signature") + AddType(0x835E, "143A70BA-CBD3-4F06-919F-6C05683A78BC", "Linux ARC root verity signature") + AddType(0x835F, "42B0455F-EB11-491D-98D3-56145BA9D037", "Linux ARM32 root verity signature") + AddType(0x8360, "6DB69DE6-29F4-4758-A7A5-962190F00CE3", "Linux ARM64 root verity signature") + AddType(0x8361, "E98B36EE-32BA-4882-9B12-0CE14655F46A", "Linux IA-64 root verity signature") + AddType(0x8362, "5AFB67EB-ECC8-4F85-AE8E-AC1E7C50E7D0", "Linux LoongArch root verity signature") + AddType(0x8363, "BBA210A2-9C5D-45EE-9E87-FF2CCBD002D0", "Linux MIPS-32 BE root verity signature") + AddType(0x8364, "43CE94D4-0F3D-4999-8250-B9DEAFD98E6E", "Linux MIPS-64 BE root verity signature") + AddType(0x8365, "C919CC1F-4456-4EFF-918C-F75E94525CA5", "Linux MIPS-32 LE root verity signature") + AddType(0x8366, "904E58EF-5C65-4A31-9C57-6AF5FC7C5DE7", "Linux MIPS-64 LE root verity signature") + AddType(0x8367, "15DE6170-65D3-431C-916E-B0DCD8393F25", "Linux PA-RISC root verity signature") + AddType(0x8368, "D4A236E7-E873-4C07-BF1D-BF6CF7F1C3C6", "Linux PowerPC-64 LE root verity signature") + AddType(0x8369, "F5E2C20C-45B2-4FFA-BCE9-2A60737E1AAF", "Linux PowerPC-64 BE root verity signature") + AddType(0x836A, "1B31B5AA-ADD9-463A-B2ED-BD467FC857E7", "Linux PowerPC-32 root verity signature") + AddType(0x836B, "3A112A75-8729-4380-B4CF-764D79934448", "Linux RISC-V-32 root verity signature") + AddType(0x836C, "EFE0F087-EA8D-4469-821A-4C2A96A8386A", "Linux RISC-V-64 root verity signature") + AddType(0x836D, "3482388E-4254-435A-A241-766A065F9960", "Linux s390 root verity signature") + AddType(0x836E, "C80187A5-73A3-491A-901A-017C3FA953E9", "Linux s390x root verity signature") + AddType(0x836F, "B3671439-97B0-4A53-90F7-2D5A8F3AD47B", "Linux TILE-Gx root verity signature") + AddType(0x8370, "41092B05-9FC8-4523-994F-2DEF0408B176", "Linux x86-64 root verity signature") + AddType(0x8371, "5996FC05-109C-48DE-808B-23FA0830B676", "Linux x86 root verity signature") + AddType(0x8372, "5C6E1C76-076A-457A-A0FE-F3B4CD21CE6E", "Linux Alpha /usr verity signature") + AddType(0x8373, "94F9A9A1-9971-427A-A400-50CB297F0F35", "Linux ARC /usr verity signature") + AddType(0x8374, "D7FF812F-37D1-4902-A810-D76BA57B975A", "Linux ARM32 /usr verity signature") + AddType(0x8375, "C23CE4FF-44BD-4B00-B2D4-B41B3419E02A", "Linux ARM64 /usr verity signature") + AddType(0x8376, "8DE58BC2-2A43-460D-B14E-A76E4A17B47F", "Linux IA-64 /usr verity signature") + AddType(0x8377, "B024F315-D330-444C-8461-44BBDE524E99", "Linux LoongArch /usr verity signature") + AddType(0x8378, "97AE158D-F216-497B-8057-F7F905770F54", "Linux MIPS-32 BE /usr verity signature") + AddType(0x8379, "05816CE2-DD40-4AC6-A61D-37D32DC1BA7D", "Linux MIPS-64 BE /usr verity signature") + AddType(0x837A, "3E23CA0B-A4BC-4B4E-8087-5AB6A26AA8A9", "Linux MIPS-32 LE /usr verity signature") + AddType(0x837B, "F2C2C7EE-ADCC-4351-B5C6-EE9816B66E16", "Linux MIPS-64 LE /usr verity signature") + AddType(0x837C, "450DD7D1-3224-45EC-9CF2-A43A346D71EE", "Linux PA-RISC /usr verity signature") + AddType(0x837D, "C8BFBD1E-268E-4521-8BBA-BF314C399557", "Linux PowerPC-64 LE /usr verity signature") + AddType(0x837E, "0B888863-D7F8-4D9E-9766-239FCE4D58AF", "Linux PowerPC-64 BE /usr verity signature") + AddType(0x837F, "7007891D-D371-4A80-86A4-5CB875B9302E", "Linux PowerPC-32 /usr verity signature") + AddType(0x8380, "C3836A13-3137-45BA-B583-B16C50FE5EB4", "Linux RISC-V-32 /usr verity signature") + AddType(0x8381, "D2F9000A-7A18-453F-B5CD-4D32F77A7B32", "Linux RISC-V-64 /usr verity signature") + AddType(0x8382, "17440E4F-A8D0-467F-A46E-3912AE6EF2C5", "Linux s390 /usr verity signature") + AddType(0x8383, "3F324816-667B-46AE-86EE-9B0C0C6C11B4", "Linux s390x /usr verity signature") + AddType(0x8384, "4EDE75E2-6CCC-4CC8-B9C7-70334B087510", "Linux TILE-Gx /usr verity signature") + AddType(0x8385, "E7BB33FB-06CF-4E81-8273-E543B413E2E2", "Linux x86-64 /usr verity signature") + AddType(0x8386, "974A71C0-DE41-43C3-BE5D-5C5CCD1AD2C0", "Linux x86 /usr verity signature") + + // Used by Intel Rapid Start technology + AddType(0x8400, "D3BFE2DE-3DAF-11DF-BA40-E3A556D89593", "Intel Rapid Start") + // This is another Intel-associated technology, so I'm keeping it close to the previous one.... + AddType(0x8401, "7C5222BD-8F5D-4087-9C00-BF9843C7B58C", "SPDK block device") + + // Type codes for Container Linux (formerly CoreOS; https://coreos.com) + AddType(0x8500, "5DFBF5F4-2848-4BAC-AA5E-0D9A20B745A6", "Container Linux /usr") + AddType(0x8501, "3884DD41-8582-4404-B9A8-E9B84F2DF50E", "Container Linux resizable rootfs") + AddType(0x8502, "C95DC21A-DF0E-4340-8D7B-26CBFA9A03E0", "Container Linux /OEM customizations") + AddType(0x8503, "BE9067B9-EA49-4F15-B4F6-F36F8C9E1818", "Container Linux root on RAID") + + // Another Linux type code.... + AddType(0x8e00, "E6D6D379-F507-44C2-A23C-238F2A3DF928", "Linux LVM") + + // Android type codes.... + // from Wikipedia, https://gist.github.com/culots/704afd126dec2f45c22d0c9d42cb7fab, + // and my own Android devices' partition tables + AddType(0xa000, "2568845D-2332-4675-BC39-8FA5A4748D15", "Android bootloader") + AddType(0xa001, "114EAFFE-1552-4022-B26E-9B053604CF84", "Android bootloader 2") + AddType(0xa002, "49A4D17F-93A3-45C1-A0DE-F50B2EBE2599", "Android boot 1") + AddType(0xa003, "4177C722-9E92-4AAB-8644-43502BFD5506", "Android recovery 1") + AddType(0xa004, "EF32A33B-A409-486C-9141-9FFB711F6266", "Android misc") + AddType(0xa005, "20AC26BE-20B7-11E3-84C5-6CFDB94711E9", "Android metadata") + AddType(0xa006, "38F428E6-D326-425D-9140-6E0EA133647C", "Android system 1") + AddType(0xa007, "A893EF21-E428-470A-9E55-0668FD91A2D9", "Android cache") + AddType(0xa008, "DC76DDA9-5AC1-491C-AF42-A82591580C0D", "Android data") + AddType(0xa009, "EBC597D0-2053-4B15-8B64-E0AAC75F4DB1", "Android persistent") + AddType(0xa00a, "8F68CC74-C5E5-48DA-BE91-A0C8C15E9C80", "Android factory") + AddType(0xa00b, "767941D0-2085-11E3-AD3B-6CFDB94711E9", "Android fastboot/tertiary") + AddType(0xa00c, "AC6D7924-EB71-4DF8-B48D-E267B27148FF", "Android OEM") + AddType(0xa00d, "C5A0AEEC-13EA-11E5-A1B1-001E67CA0C3C", "Android vendor") + AddType(0xa00e, "BD59408B-4514-490D-BF12-9878D963F378", "Android config") + AddType(0xa00f, "9FDAA6EF-4B3F-40D2-BA8D-BFF16BFB887B", "Android factory (alt)") + AddType(0xa010, "19A710A2-B3CA-11E4-B026-10604B889DCF", "Android meta") + AddType(0xa011, "193D1EA4-B3CA-11E4-B075-10604B889DCF", "Android EXT") + AddType(0xa012, "DEA0BA2C-CBDD-4805-B4F9-F428251C3E98", "Android SBL1") + AddType(0xa013, "8C6B52AD-8A9E-4398-AD09-AE916E53AE2D", "Android SBL2") + AddType(0xa014, "05E044DF-92F1-4325-B69E-374A82E97D6E", "Android SBL3") + AddType(0xa015, "400FFDCD-22E0-47E7-9A23-F16ED9382388", "Android APPSBL") + AddType(0xa016, "A053AA7F-40B8-4B1C-BA08-2F68AC71A4F4", "Android QSEE/tz") + AddType(0xa017, "E1A6A689-0C8D-4CC6-B4E8-55A4320FBD8A", "Android QHEE/hyp") + AddType(0xa018, "098DF793-D712-413D-9D4E-89D711772228", "Android RPM") + AddType(0xa019, "D4E0D938-B7FA-48C1-9D21-BC5ED5C4B203", "Android WDOG debug/sdi") + AddType(0xa01a, "20A0C19C-286A-42FA-9CE7-F64C3226A794", "Android DDR") + AddType(0xa01b, "A19F205F-CCD8-4B6D-8F1E-2D9BC24CFFB1", "Android CDT") + AddType(0xa01c, "66C9B323-F7FC-48B6-BF96-6F32E335A428", "Android RAM dump") + AddType(0xa01d, "303E6AC3-AF15-4C54-9E9B-D9A8FBECF401", "Android SEC") + AddType(0xa01e, "C00EEF24-7709-43D6-9799-DD2B411E7A3C", "Android PMIC") + AddType(0xa01f, "82ACC91F-357C-4A68-9C8F-689E1B1A23A1", "Android misc 1") + AddType(0xa020, "E2802D54-0545-E8A1-A1E8-C7A3E245ACD4", "Android misc 2") + AddType(0xa021, "65ADDCF4-0C5C-4D9A-AC2D-D90B5CBFCD03", "Android device info") + AddType(0xa022, "E6E98DA2-E22A-4D12-AB33-169E7DEAA507", "Android APDP") + AddType(0xa023, "ED9E8101-05FA-46B7-82AA-8D58770D200B", "Android MSADP") + AddType(0xa024, "11406F35-1173-4869-807B-27DF71802812", "Android DPO") + AddType(0xa025, "9D72D4E4-9958-42DA-AC26-BEA7A90B0434", "Android recovery 2") + AddType(0xa026, "6C95E238-E343-4BA8-B489-8681ED22AD0B", "Android persist") + AddType(0xa027, "EBBEADAF-22C9-E33B-8F5D-0E81686A68CB", "Android modem ST1") + AddType(0xa028, "0A288B1F-22C9-E33B-8F5D-0E81686A68CB", "Android modem ST2") + AddType(0xa029, "57B90A16-22C9-E33B-8F5D-0E81686A68CB", "Android FSC") + AddType(0xa02a, "638FF8E2-22C9-E33B-8F5D-0E81686A68CB", "Android FSG 1") + AddType(0xa02b, "2013373E-1AC4-4131-BFD8-B6A7AC638772", "Android FSG 2") + AddType(0xa02c, "2C86E742-745E-4FDD-BFD8-B6A7AC638772", "Android SSD") + AddType(0xa02d, "DE7D4029-0F5B-41C8-AE7E-F6C023A02B33", "Android keystore") + AddType(0xa02e, "323EF595-AF7A-4AFA-8060-97BE72841BB9", "Android encrypt") + AddType(0xa02f, "45864011-CF89-46E6-A445-85262E065604", "Android EKSST") + AddType(0xa030, "8ED8AE95-597F-4C8A-A5BD-A7FF8E4DFAA9", "Android RCT") + AddType(0xa031, "DF24E5ED-8C96-4B86-B00B-79667DC6DE11", "Android spare1") + AddType(0xa032, "7C29D3AD-78B9-452E-9DEB-D098D542F092", "Android spare2") + AddType(0xa033, "379D107E-229E-499D-AD4F-61F5BCF87BD4", "Android spare3") + AddType(0xa034, "0DEA65E5-A676-4CDF-823C-77568B577ED5", "Android spare4") + AddType(0xa035, "4627AE27-CFEF-48A1-88FE-99C3509ADE26", "Android raw resources") + AddType(0xa036, "20117F86-E985-4357-B9EE-374BC1D8487D", "Android boot 2") + AddType(0xa037, "86A7CB80-84E1-408C-99AB-694F1A410FC7", "Android FOTA") + AddType(0xa038, "97D7B011-54DA-4835-B3C4-917AD6E73D74", "Android system 2") + AddType(0xa039, "5594C694-C871-4B5F-90B1-690A6F68E0F7", "Android cache") + AddType(0xa03a, "1B81E7E6-F50D-419B-A739-2AEEF8DA3335", "Android user data") + AddType(0xa03b, "98523EC6-90FE-4C67-B50A-0FC59ED6F56D", "LG (Android) advanced flasher") + AddType(0xa03c, "2644BCC0-F36A-4792-9533-1738BED53EE3", "Android PG1FS") + AddType(0xa03d, "DD7C91E9-38C9-45C5-8A12-4A80F7E14057", "Android PG2FS") + AddType(0xa03e, "7696D5B6-43FD-4664-A228-C563C4A1E8CC", "Android board info") + AddType(0xa03f, "0D802D54-058D-4A20-AD2D-C7A362CEACD4", "Android MFG") + AddType(0xa040, "10A0C19C-516A-5444-5CE3-664C3226A794", "Android limits") + + // Atari TOS partition type + AddType(0xa200, "734E5AFE-F61A-11E6-BC64-92361F002671", "Atari TOS basic data") + + // FreeBSD partition types.... + // Note: Rather than extract FreeBSD disklabel data, convert FreeBSD + // partitions in-place, and let FreeBSD sort out the details.... + AddType(0xa500, "516E7CB4-6ECF-11D6-8FF8-00022D09712B", "FreeBSD disklabel") + AddType(0xa501, "83BD6B9D-7F41-11DC-BE0B-001560B84F0F", "FreeBSD boot") + AddType(0xa502, "516E7CB5-6ECF-11D6-8FF8-00022D09712B", "FreeBSD swap") + AddType(0xa503, "516E7CB6-6ECF-11D6-8FF8-00022D09712B", "FreeBSD UFS") + AddType(0xa504, "516E7CBA-6ECF-11D6-8FF8-00022D09712B", "FreeBSD ZFS") + AddType(0xa505, "516E7CB8-6ECF-11D6-8FF8-00022D09712B", "FreeBSD Vinum/RAID") + AddType(0xa506, "74BA7DD9-A689-11E1-BD04-00E081286ACF", "FreeBSD nandfs") + + // Midnight BSD partition types.... + AddType(0xa580, "85D5E45A-237C-11E1-B4B3-E89A8F7FC3A7", "Midnight BSD data") + AddType(0xa581, "85D5E45E-237C-11E1-B4B3-E89A8F7FC3A7", "Midnight BSD boot") + AddType(0xa582, "85D5E45B-237C-11E1-B4B3-E89A8F7FC3A7", "Midnight BSD swap") + AddType(0xa583, "0394Ef8B-237E-11E1-B4B3-E89A8F7FC3A7", "Midnight BSD UFS") + AddType(0xa584, "85D5E45D-237C-11E1-B4B3-E89A8F7FC3A7", "Midnight BSD ZFS") + AddType(0xa585, "85D5E45C-237C-11E1-B4B3-E89A8F7FC3A7", "Midnight BSD Vinum") + + // OpenBSD partition type.... + AddType(0xa600, "824CC7A0-36A8-11E3-890A-952519AD3F61", "OpenBSD disklabel") + + // A MacOS partition type, separated from others by NetBSD partition types... + AddType(0xa800, "55465300-0000-11AA-AA11-00306543ECAC", "Apple UFS") // Mac OS X + + // NetBSD partition types. Note that the main entry sets it up as a + // FreeBSD disklabel. I'm not 100% certain this is the correct behavior. + AddType(0xa900, "516E7CB4-6ECF-11D6-8FF8-00022D09712B", "FreeBSD disklabel", 0) // NetBSD disklabel + AddType(0xa901, "49F48D32-B10E-11DC-B99B-0019D1879648", "NetBSD swap") + AddType(0xa902, "49F48D5A-B10E-11DC-B99B-0019D1879648", "NetBSD FFS") + AddType(0xa903, "49F48D82-B10E-11DC-B99B-0019D1879648", "NetBSD LFS") + AddType(0xa904, "2DB519C4-B10F-11DC-B99B-0019D1879648", "NetBSD concatenated") + AddType(0xa905, "2DB519EC-B10F-11DC-B99B-0019D1879648", "NetBSD encrypted") + AddType(0xa906, "49F48DAA-B10E-11DC-B99B-0019D1879648", "NetBSD RAID") + + // Mac OS partition types (See also 0xa800, above).... + AddType(0xab00, "426F6F74-0000-11AA-AA11-00306543ECAC", "Recovery HD") + AddType(0xaf00, "48465300-0000-11AA-AA11-00306543ECAC", "Apple HFS/HFS+") + AddType(0xaf01, "52414944-0000-11AA-AA11-00306543ECAC", "Apple RAID") + AddType(0xaf02, "52414944-5F4F-11AA-AA11-00306543ECAC", "Apple RAID offline") + AddType(0xaf03, "4C616265-6C00-11AA-AA11-00306543ECAC", "Apple label") + AddType(0xaf04, "5265636F-7665-11AA-AA11-00306543ECAC", "AppleTV recovery") + AddType(0xaf05, "53746F72-6167-11AA-AA11-00306543ECAC", "Apple Core Storage") + AddType(0xaf06, "B6FA30DA-92D2-4A9A-96F1-871EC6486200", "Apple SoftRAID Status") + AddType(0xaf07, "2E313465-19B9-463F-8126-8A7993773801", "Apple SoftRAID Scratch") + AddType(0xaf08, "FA709C7E-65B1-4593-BFD5-E71D61DE9B02", "Apple SoftRAID Volume") + AddType(0xaf09, "BBBA6DF5-F46F-4A89-8F59-8765B2727503", "Apple SoftRAID Cache") + AddType(0xaf0a, "7C3457EF-0000-11AA-AA11-00306543ECAC", "Apple APFS") + AddType(0xaf0b, "69646961-6700-11AA-AA11-00306543ECAC", "Apple APFS Pre-Boot") + AddType(0xaf0c, "52637672-7900-11AA-AA11-00306543ECAC", "Apple APFS Recovery") + + // U-Boot boot loader; see https://lists.denx.de/pipermail/u-boot/2020-November/432928.html + // and https://source.denx.de/u-boot/u-boot/-/blob/v2021.07/include/part_efi.h#L59-61 + AddType(0xb000, "3DE21764-95BD-54BD-A5C3-4ABE786F38A8", "U-Boot boot loader") + + // QNX Power-Safe (QNX6) + AddType(0xb300, "CEF5A9AD-73BC-4601-89F3-CDEEEEE321A1", "QNX6 Power-Safe") + + // Barebox boot loader; see https://barebox.org/doc/latest/user/state.html?highlight=guid#sd-emmc-and-ata + AddType(0xbb00, "4778ED65-BF42-45FA-9C5B-287A1DC4AAB1", "Barebox boot loader") + + // Acronis Secure Zone + AddType(0xbc00, "0311FC50-01CA-4725-AD77-9ADBB20ACE98", "Acronis Secure Zone") + + // Solaris partition types (one of which is shared with MacOS) + AddType(0xbe00, "6A82CB45-1DD2-11B2-99A6-080020736631", "Solaris boot") + AddType(0xbf00, "6A85CF4D-1DD2-11B2-99A6-080020736631", "Solaris root") + AddType(0xbf01, "6A898CC3-1DD2-11B2-99A6-080020736631", "Solaris /usr & Mac ZFS") // Solaris/MacOS + AddType(0xbf02, "6A87C46F-1DD2-11B2-99A6-080020736631", "Solaris swap") + AddType(0xbf03, "6A8B642B-1DD2-11B2-99A6-080020736631", "Solaris backup") + AddType(0xbf04, "6A8EF2E9-1DD2-11B2-99A6-080020736631", "Solaris /var") + AddType(0xbf05, "6A90BA39-1DD2-11B2-99A6-080020736631", "Solaris /home") + AddType(0xbf06, "6A9283A5-1DD2-11B2-99A6-080020736631", "Solaris alternate sector") + AddType(0xbf07, "6A945A3B-1DD2-11B2-99A6-080020736631", "Solaris Reserved 1") + AddType(0xbf08, "6A9630D1-1DD2-11B2-99A6-080020736631", "Solaris Reserved 2") + AddType(0xbf09, "6A980767-1DD2-11B2-99A6-080020736631", "Solaris Reserved 3") + AddType(0xbf0a, "6A96237F-1DD2-11B2-99A6-080020736631", "Solaris Reserved 4") + AddType(0xbf0b, "6A8D2AC7-1DD2-11B2-99A6-080020736631", "Solaris Reserved 5") + + // I can find no MBR equivalents for these, but they're on the + // Wikipedia page for GPT, so here we go.... + AddType(0xc001, "75894C1E-3AEB-11D3-B7C1-7B03A0000000", "HP-UX data") + AddType(0xc002, "E2A1E728-32E3-11D6-A682-7B03A0000000", "HP-UX service") + + // Open Network Install Environment (ONIE) partitions.... + AddType(0xe100, "7412F7D5-A156-4B13-81DC-867174929325", "ONIE boot") + AddType(0xe101, "D4E6E2CD-4469-46F3-B5CB-1BFF57AFC149", "ONIE config") + + // Veracrypt (https://www.veracrypt.fr/en/Home.html) encrypted partition + AddType(0xe900, "8C8F8EFF-AC95-4770-814A-21994F2DBC8F", "Veracrypt data") + + // See https://systemd.io/BOOT_LOADER_SPECIFICATION/ + AddType(0xea00, "BC13C2FF-59E6-4262-A352-B275FD6F7172", "XBOOTLDR partition") + + // Type code for Haiku; uses BeOS MBR code as hex code base + AddType(0xeb00, "42465331-3BA3-10F1-802A-4861696B7521", "Haiku BFS") + + // Manufacturer-specific ESP-like partitions (in order in which they were added) + AddType(0xed00, "F4019732-066E-4E12-8273-346C5641494F", "Sony system partition") + AddType(0xed01, "BFBFAFE7-A34F-448A-9A5B-6213EB736C22", "Lenovo system partition") + + // EFI system and related partitions + AddType(0xef00, "C12A7328-F81F-11D2-BA4B-00A0C93EC93B", "EFI system partition") // Parted identifies these as having the "boot flag" set + AddType(0xef01, "024DEE41-33E7-11D3-9D69-0008C781F39F", "MBR partition scheme") // Used to nest MBR in GPT + AddType(0xef02, "21686148-6449-6E6F-744E-656564454649", "BIOS boot partition") // Used by GRUB + + // Fuscia OS codes; see https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/system/public/zircon/hw/gpt.h + AddType(0xf100, "FE8A2634-5E2E-46BA-99E3-3A192091A350", "Fuchsia boot loader (slot A/B/R)") + AddType(0xf101, "D9FD4535-106C-4CEC-8D37-DFC020CA87CB", "Fuchsia durable mutable encrypted system data") + AddType(0xf102, "A409E16B-78AA-4ACC-995C-302352621A41", "Fuchsia durable mutable boot loader") + AddType(0xf103, "F95D940E-CABA-4578-9B93-BB6C90F29D3E", "Fuchsia factory ro system data") + AddType(0xf104, "10B8DBAA-D2BF-42A9-98C6-A7C5DB3701E7", "Fuchsia factory ro bootloader data") + AddType(0xf105, "49FD7CB8-DF15-4E73-B9D9-992070127F0F", "Fuchsia Volume Manager") + AddType(0xf106, "421A8BFC-85D9-4D85-ACDA-B64EEC0133E9", "Fuchsia verified boot metadata (slot A/B/R)") + AddType(0xf107, "9B37FFF6-2E58-466A-983A-F7926D0B04E0", "Fuchsia Zircon boot image (slot A/B/R)") + AddType(0xf108, "C12A7328-F81F-11D2-BA4B-00A0C93EC93B", "Fuchsia ESP") + AddType(0xf109, "606B000B-B7C7-4653-A7D5-B737332C899D", "Fuchsia System") + AddType(0xf10a, "08185F0C-892D-428A-A789-DBEEC8F55E6A", "Fuchsia Data") + AddType(0xf10b, "48435546-4953-2041-494E-5354414C4C52", "Fuchsia Install") + AddType(0xf10c, "2967380E-134C-4CBB-B6DA-17E7CE1CA45D", "Fuchsia Blob") + AddType(0xf10d, "41D0E340-57E3-954E-8C1E-17ECAC44CFF5", "Fuchsia FVM") + AddType(0xf10e, "DE30CC86-1F4A-4A31-93C4-66F147D33E05", "Fuchsia Zircon boot image (slot A)") + AddType(0xf10f, "23CC04DF-C278-4CE7-8471-897D1A4BCDF7", "Fuchsia Zircon boot image (slot B)") + AddType(0xf110, "A0E5CF57-2DEF-46BE-A80C-A2067C37CD49", "Fuchsia Zircon boot image (slot R)") + AddType(0xf111, "4E5E989E-4C86-11E8-A15B-480FCF35F8E6", "Fuchsia sys-config") + AddType(0xf112, "5A3A90BE-4C86-11E8-A15B-480FCF35F8E6", "Fuchsia factory-config") + AddType(0xf113, "5ECE94FE-4C86-11E8-A15B-480FCF35F8E6", "Fuchsia bootloader") + AddType(0xf114, "8B94D043-30BE-4871-9DFA-D69556E8C1F3", "Fuchsia guid-test") + AddType(0xf115, "A13B4D9A-EC5F-11E8-97D8-6C3BE52705BF", "Fuchsia verified boot metadata (A)") + AddType(0xf116, "A288ABF2-EC5F-11E8-97D8-6C3BE52705BF", "Fuchsia verified boot metadata (B)") + AddType(0xf117, "6A2460C3-CD11-4E8B-80A8-12CCE268ED0A", "Fuchsia verified boot metadata (R)") + AddType(0xf118, "1D75395D-F2C6-476B-A8B7-45CC1C97B476", "Fuchsia misc") + AddType(0xf119, "900B0FC5-90CD-4D4F-84F9-9F8ED579DB88", "Fuchsia emmc-boot1") + AddType(0xf11a, "B2B2E8D1-7C10-4EBC-A2D0-4614568260AD", "Fuchsia emmc-boot2") + + // Ceph type codes; see https://github.com/ceph/ceph/blob/9bcc42a3e6b08521694b5c0228b2c6ed7b3d312e/src/ceph-disk#L76-L81 + // and Wikipedia + AddType(0xf800, "4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D", "Ceph OSD") // Ceph Object Storage Daemon + AddType(0xf801, "4FBD7E29-9D25-41B8-AFD0-5EC00CEFF05D", "Ceph dm-crypt OSD") // Ceph Object Storage Daemon (encrypted) + AddType(0xf802, "45B0969E-9B03-4F30-B4C6-B4B80CEFF106", "Ceph journal") + AddType(0xf803, "45B0969E-9B03-4F30-B4C6-5EC00CEFF106", "Ceph dm-crypt journal") + AddType(0xf804, "89C57F98-2FE5-4DC0-89C1-F3AD0CEFF2BE", "Ceph disk in creation") + AddType(0xf805, "89C57F98-2FE5-4DC0-89C1-5EC00CEFF2BE", "Ceph dm-crypt disk in creation") + AddType(0xf806, "CAFECAFE-9B03-4F30-B4C6-B4B80CEFF106", "Ceph block") + AddType(0xf807, "30CD0809-C2B2-499C-8879-2D6B78529876", "Ceph block DB") + AddType(0xf808, "5CE17FCE-4087-4169-B7FF-056CC58473F9", "Ceph block write-ahead log") + AddType(0xf809, "FB3AABF9-D25F-47CC-BF5E-721D1816496B", "Ceph lockbox for dm-crypt keys") + AddType(0xf80a, "4FBD7E29-8AE0-4982-BF9D-5A8D867AF560", "Ceph multipath OSD") + AddType(0xf80b, "45B0969E-8AE0-4982-BF9D-5A8D867AF560", "Ceph multipath journal") + AddType(0xf80c, "CAFECAFE-8AE0-4982-BF9D-5A8D867AF560", "Ceph multipath block 1") + AddType(0xf80d, "7F4A666A-16F3-47A2-8445-152EF4D03F6C", "Ceph multipath block 2") + AddType(0xf80e, "EC6D6385-E346-45DC-BE91-DA2A7C8B3261", "Ceph multipath block DB") + AddType(0xf80f, "01B41E1B-002A-453C-9F17-88793989FF8F", "Ceph multipath block write-ahead log") + AddType(0xf810, "CAFECAFE-9B03-4F30-B4C6-5EC00CEFF106", "Ceph dm-crypt block") + AddType(0xf811, "93B0052D-02D9-4D8A-A43B-33A3EE4DFBC3", "Ceph dm-crypt block DB") + AddType(0xf812, "306E8683-4FE2-4330-B7C0-00A917C16966", "Ceph dm-crypt block write-ahead log") + AddType(0xf813, "45B0969E-9B03-4F30-B4C6-35865CEFF106", "Ceph dm-crypt LUKS journal") + AddType(0xf814, "CAFECAFE-9B03-4F30-B4C6-35865CEFF106", "Ceph dm-crypt LUKS block") + AddType(0xf815, "166418DA-C469-4022-ADF4-B30AFD37F176", "Ceph dm-crypt LUKS block DB") + AddType(0xf816, "86A32090-3647-40B9-BBBD-38D8C573AA86", "Ceph dm-crypt LUKS block write-ahead log") + AddType(0xf817, "4FBD7E29-9D25-41B8-AFD0-35865CEFF05D", "Ceph dm-crypt LUKS OSD") + + // VMWare ESX partition types codes + AddType(0xfb00, "AA31E02A-400F-11DB-9590-000C2911D1B8", "VMWare VMFS") + AddType(0xfb01, "9198EFFC-31C0-11DB-8F78-000C2911D1B8", "VMWare reserved") + AddType(0xfc00, "9D275380-40AD-11DB-BF97-000C2911D1B8", "VMWare kcore crash protection") + + // A straggler Linux partition type.... + AddType(0xfd00, "A19D880F-05FC-4D3B-A006-743F0F84911E", "Linux RAID") }; +#undef AddType + +static inline const gpt_type_entry_t* gpt_type_lookup(uint16_t code) +{ + for (int i = 0; i < ARRAYSIZE(gpt_type_table); i++) { + if (gpt_type_table[i].code == code) + return &gpt_type_table[i]; + } + return NULL; +} + +static inline const char* gpt_type_desc(const GUID* guid) +{ + const char* guid_str = GuidToString(guid, TRUE); + if (guid_str == NULL) + return NULL; + for (int i = 0; i < ARRAYSIZE(gpt_type_table); i++) { + if (_strnicmp(&guid_str[1], gpt_type_table[i].guid_str, 36) == 0) + return gpt_type_table[i].description; + } + return NULL; +} + +static inline const char* gpt_type_guid_str(uint16_t code) +{ + const gpt_type_entry_t* e = gpt_type_lookup(code); + return (e != NULL) ? e->guid_str : NULL; +} + +static inline const char* gpt_type_description(uint16_t code) +{ + const gpt_type_entry_t* e = gpt_type_lookup(code); + return (e != NULL) ? e->description : NULL; +} + +static inline GUID gpt_type_guid(uint16_t code) +{ + return StringToGuid(gpt_type_guid_str(code)); +} + +// Also redefine the constant GUIDs we use in the application +DEFINE_GUID(PARTITION_GENERIC_ESP, 0xC12A7328, 0xF81F, 0x11D2, 0xBA, 0x4B, 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B); +DEFINE_GUID(PARTITION_LINUX_DATA, 0x0FC63DAF, 0x8483, 0x4772, 0x8E, 0x79, 0x3D, 0x69, 0xD8, 0x47, 0x7D, 0xE4); +DEFINE_GUID(PARTITION_MICROSOFT_DATA, 0xEBD0A0A2, 0xB9E5, 0x4433, 0x87, 0xC0, 0x68, 0xB6, 0xB7, 0x26, 0x99, 0xC7); +DEFINE_GUID(PARTITION_MICROSOFT_RESERVED, 0xE3C9E316, 0x0B5C, 0x4DB8, 0x81, 0x7D, 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE); diff --git a/src/license.h b/src/license.h index 4ddeae4c..a7781b49 100644 --- a/src/license.h +++ b/src/license.h @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Licensing Data - * Copyright © 2011-2025 Pete Batard <pete@akeo.ie> + * Copyright © 2011-2026 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -110,9 +110,11 @@ const char* additional_copyrights = "https://sourceforge.net/projects/smartmontools\\line\n" "GNU General Public License (GPL) v2 or later\\line\n" "\\line\n" -"FS Type description from GNU fdisk:\\line\n" +"Partition and FS Type identification from GNU fdisk and GPT fdisk:\\line\n" "https://www.gnu.org/software/fdisk\\line\n" -"GNU General Public License (GPL) v3 or later\\line\n" +"https://www.rodsbooks.com/gdisk\\line\n" +"https://salsa.debian.org/debian/gdisk\\line\n" +"GNU General Public License (GPL) v2 or later\\line\n" "\\line\n" "Speed/ETA computation from GNU wget:\\line\n" "https://www.gnu.org/software/wget\\line\n" diff --git a/src/rufus.h b/src/rufus.h index 1f011224..14723810 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -1,6 +1,6 @@ /* * Rufus: The Reliable USB Formatting Utility - * Copyright © 2011-2025 Pete Batard <pete@akeo.ie> + * Copyright © 2011-2026 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -784,7 +784,7 @@ extern void _UpdateProgressWithInfo(int op, int msg, uint64_t processed, uint64_ #define UpdateProgressWithInfoInit(hProgressDialog, bNoAltMode) UpdateProgressWithInfo(OP_INIT, (int)bNoAltMode, (uint64_t)(uintptr_t)hProgressDialog, 0); extern const char* StrError(DWORD error_code, BOOL use_default_locale); extern char* GuidToString(const GUID* guid, BOOL bDecorated); -extern GUID* StringToGuid(const char* str); +extern GUID StringToGuid(const char* str); extern char* SizeToHumanReadable(uint64_t size, BOOL copy_to_log, BOOL fake_units); extern char* TimestampToHumanReadable(uint64_t ts); extern HWND MyCreateDialog(HINSTANCE hInstance, int Dialog_ID, HWND hWndParent, DLGPROC lpDialogFunc); diff --git a/src/rufus.rc b/src/rufus.rc index 6ea3e295..ecc30772 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.13.2316" +CAPTION "Rufus 4.14.2317" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,13,2316,0 - PRODUCTVERSION 4,13,2316,0 + FILEVERSION 4,14,2317,0 + PRODUCTVERSION 4,14,2317,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.13.2316" + VALUE "FileVersion", "4.14.2317" 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.13.exe" + VALUE "OriginalFilename", "rufus-4.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.13.2316" + VALUE "ProductVersion", "4.14.2317" END END BLOCK "VarFileInfo" diff --git a/src/stdio.c b/src/stdio.c index 8726b0d1..042622d3 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Standard User I/O Routines (logging, status, error, etc.) - * Copyright © 2011-2025 Pete Batard <pete@akeo.ie> + * Copyright © 2011-2026 Pete Batard <pete@akeo.ie> * Copyright © 2020 Mattiwatti <mattiwatti@gmail.com> * * This program is free software: you can redistribute it and/or modify @@ -365,18 +365,25 @@ char* GuidToString(const GUID* guid, BOOL bDecorated) return guid_string; } -GUID* StringToGuid(const char* str) +GUID StringToGuid(const char* str) { - static GUID guid; - - if (str == NULL) return NULL; - if (sscanf(str, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", - (uint32_t*)&guid.Data1, (uint32_t*)&guid.Data2, (uint32_t*)&guid.Data3, - (uint32_t*)&guid.Data4[0], (uint32_t*)&guid.Data4[1], (uint32_t*)&guid.Data4[2], - (uint32_t*)&guid.Data4[3], (uint32_t*)&guid.Data4[4], (uint32_t*)&guid.Data4[5], - (uint32_t*)&guid.Data4[6], (uint32_t*)&guid.Data4[7]) != 11) - return NULL; - return &guid; + GUID guid = { 0 }; + uint32_t d1, d2, d3, b0, b1, b2, b3, b4, b5, b6, b7; + if (str != NULL && sscanf(str[0] == '{' ? &str[1] : str, "%8x-%4x-%4x-%2x%2x-%2x%2x%2x%2x%2x%2x", + &d1, &d2, &d3, &b0, &b1, &b2, &b3, &b4, &b5, &b6, &b7) == 11) { + guid.Data1 = d1; + guid.Data2 = (uint16_t)d2; + guid.Data3 = (uint16_t)d3; + guid.Data4[0] = (uint8_t)b0; + guid.Data4[1] = (uint8_t)b1; + guid.Data4[2] = (uint8_t)b2; + guid.Data4[3] = (uint8_t)b3; + guid.Data4[4] = (uint8_t)b4; + guid.Data4[5] = (uint8_t)b5; + guid.Data4[6] = (uint8_t)b6; + guid.Data4[7] = (uint8_t)b7; + } + return guid; } // Find upper power of 2 From 073a100c8e0bfaf496f1374114cc39e15d28918f Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 6 Mar 2026 17:36:44 +0000 Subject: [PATCH 127/192] [wue] add an option to copy SkuSiPolicy.p7b to the ESP on install * This basically accomplishes the steps described in https://support.microsoft.com/kb/5042562 on first logon. * Note that we use the installed system's SkuSiPolicy.p7b rather than the host system's, even if the latter is usually more up to date, because otherwise, the user may run into Error code: 0xc0000428 on first reboot. * Likewise, we do not provide this option for Windows To Go, as it could prevent the existing Windows install from booting, and we'd have to extract SkuSiPolicy.p7b from `install.wim` to do so. * Also remove dead code related to SkuSiPolicy.p7b hash parsing (which Microsoft no longer uses). * Closes #2919 (though it doesn't actually address the issue reported there, which we couldn't replicate). --- res/loc/rufus.loc | 3 +- src/format.c | 1 - src/license.h | 5 -- src/pki.c | 121 +--------------------------------------------- src/rufus.c | 5 +- src/rufus.h | 7 ++- src/rufus.rc | 10 ++-- src/wue.c | 77 ++++++++++++++--------------- 8 files changed, 50 insertions(+), 179 deletions(-) diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 1eef1169..c2ea67a9 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -577,6 +577,7 @@ t MSG_320 "Refreshing partition layout (%s)..." t MSG_321 "The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File " "copy mode.\nAs a result, DD image writing mode will be enforced." t MSG_322 "Unable to open or read '%s'" +t MSG_324 "Apply SkuSiPolicy.p7b on installation (See KB5042562)" t MSG_325 "Applying Windows customization: %s" t MSG_326 "Applying user options..." t MSG_327 "Windows User Experience" @@ -609,7 +610,7 @@ t MSG_346 "Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)" t MSG_347 "Expert Mode" t MSG_348 "Extracting archive files: %s" t MSG_349 "Use Rufus MBR" -t MSG_350 "Use 'Windows CA 2023' signed bootloaders (requires a compatible target PC)" +t MSG_350 "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" t MSG_351 "Checking for UEFI bootloader revocation..." t MSG_352 "Checking for UEFI DBX updates..." t MSG_353 "DBX update available" diff --git a/src/format.c b/src/format.c index 8bbe644c..621a40c1 100644 --- a/src/format.c +++ b/src/format.c @@ -1979,7 +1979,6 @@ try_clear: } } } - CopySKUSiPolicy(drive_name); if ( (target_type == TT_BIOS) && HAS_WINPE(img_report) ) { // Apply WinPE fixup if (!SetupWinPE(drive_name[0])) diff --git a/src/license.h b/src/license.h index a7781b49..f107aaec 100644 --- a/src/license.h +++ b/src/license.h @@ -144,11 +144,6 @@ const char* additional_copyrights = "https://github.com/u-boot/u-boot\\line\n" "GNU General Public License (GPL) v2 or later\\line\n" "\\line\n" -"SkuSiPolicy.p7b parsing derived from:\\line\n" -"https://gist.github.com/mattifestation/92e545bf1ee5b68eeb71d254cec2f78e\\line\n" -"by Matthew Graeber, with contributions by James Forshaw\\line\n" -"BSD 3-Clause\\line\n" -"\\line\n" "About and License dialogs inspired by WinSCP by Martin Prikryl\\line\n" "https://winscp.net/\\line\n" "GNU General Public License (GPL) v3 or later\\line\n" diff --git a/src/pki.c b/src/pki.c index 7ebef247..bc39c703 100644 --- a/src/pki.c +++ b/src/pki.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * PKI functions (code signing, etc.) - * Copyright © 2015-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2015-2026 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -260,7 +260,7 @@ const char* WinPKIErrorString(void) } } -// Mostly from https://support.microsoft.com/en-us/kb/323809 +// Mostly from https://support.microsoft.com/kb/323809 char* GetSignatureName(const char* path, const char* country_code, uint8_t* thumbprint, BOOL bSilent) { static char szSubjectName[128]; @@ -900,120 +900,3 @@ out: CryptReleaseContext(hProv, 0); return r; } - -// The following SkuSiPolicy.p7b parsing code is derived from: -// https://gist.github.com/mattifestation/92e545bf1ee5b68eeb71d254cec2f78e -// by Matthew Graeber, with contributions by James Forshaw. -BOOL ParseSKUSiPolicy(void) -{ - char path[MAX_PATH]; - wchar_t* wpath = NULL; - BOOL r = FALSE; - DWORD i, dwEncoding, dwContentType, dwFormatType; - DWORD dwPolicySize = 0, dwBaseIndex = 0, dwSizeCount; - HCRYPTMSG hMsg = NULL; - CRYPT_DATA_BLOB pkcsData = { 0 }; - DWORD* pdwEkuRules; - BYTE* pbRule; - CIHeader* Header; - CIFileRuleHeader* FileRuleHeader; - CIFileRuleData* FileRuleData; - - pe256ssp_size = 0; - safe_free(pe256ssp); - // Must use sysnative for WOW - static_sprintf(path, "%s\\SecureBootUpdates\\SKUSiPolicy.p7b", sysnative_dir); - wpath = utf8_to_wchar(path); - if (wpath == NULL) - goto out; - - r = CryptQueryObject(CERT_QUERY_OBJECT_FILE, wpath, CERT_QUERY_CONTENT_FLAG_ALL, - CERT_QUERY_FORMAT_FLAG_ALL, 0, &dwEncoding, &dwContentType, &dwFormatType, NULL, - &hMsg, NULL); - if (!r || dwContentType != CERT_QUERY_CONTENT_PKCS7_SIGNED) - goto out; - - r = CryptMsgGetParam(hMsg, CMSG_CONTENT_PARAM, 0, NULL, &pkcsData.cbData); - if (!r || pkcsData.cbData == 0) { - uprintf("ParseSKUSiPolicy: Failed to retreive CMSG_CONTENT_PARAM size: %s", WindowsErrorString()); - goto out; - } - pkcsData.pbData = malloc(pkcsData.cbData); - if (pkcsData.pbData == NULL) - goto out; - r = CryptMsgGetParam(hMsg, CMSG_CONTENT_PARAM, 0, pkcsData.pbData, &pkcsData.cbData); - if (!r) { - uprintf("ParseSKUSiPolicy: Failed to retreive CMSG_CONTENT_PARAM: %s", WindowsErrorString()); - goto out; - } - - // Now process the actual Security Policy content - if (pkcsData.pbData[0] == 4) { - dwPolicySize = pkcsData.pbData[1]; - dwBaseIndex = 2; - if ((dwPolicySize & 0x80) == 0x80) { - dwSizeCount = dwPolicySize & 0x7F; - dwBaseIndex += dwSizeCount; - dwPolicySize = 0; - for (i = 0; i < dwSizeCount; i++) { - dwPolicySize = dwPolicySize << 8; - dwPolicySize = dwPolicySize | pkcsData.pbData[2 + i]; - } - } - } - - // Sanity checks - Header = (CIHeader*)&pkcsData.pbData[dwBaseIndex]; - if (Header->HeaderLength + sizeof(uint32_t) != sizeof(CIHeader)) { - uprintf("ParseSKUSiPolicy: Unexpected Code Integrity Header size (0x%02x)", Header->HeaderLength); - goto out; - } - if (!CompareGUID(&Header->PolicyTypeGUID, &SKU_CODE_INTEGRITY_POLICY)) { - uprintf("ParseSKUSiPolicy: Unexpected Policy Type GUID %s", GuidToString(&Header->PolicyTypeGUID, TRUE)); - goto out; - } - - // Skip the EKU Rules - pdwEkuRules = (DWORD*) &pkcsData.pbData[dwBaseIndex + sizeof(CIHeader)]; - for (i = 0; i < Header->EKURuleEntryCount; i++) - pdwEkuRules = &pdwEkuRules[(*pdwEkuRules + (2 * sizeof(DWORD) - 1)) / sizeof(DWORD)]; - - // Process the Files Rules - pbRule = (BYTE*)pdwEkuRules; - pe256ssp = malloc(Header->FileRuleEntryCount * PE256_HASHSIZE); - if (pe256ssp == NULL) - goto out; - for (i = 0; i < Header->FileRuleEntryCount; i++) { - FileRuleHeader = (CIFileRuleHeader*)pbRule; - pbRule = &pbRule[sizeof(CIFileRuleHeader)]; - if (FileRuleHeader->FileNameLength != 0) { -// uprintf("%S", FileRuleHeader->FileName); - pbRule = &pbRule[((FileRuleHeader->FileNameLength + sizeof(DWORD) - 1) / sizeof(DWORD)) * sizeof(DWORD)]; - } - FileRuleData = (CIFileRuleData*)pbRule; - if (FileRuleData->HashLength > 0x80) { - uprintf("ParseSKUSiPolicy: Unexpected hash length for entry %d (0x%02x)", i, FileRuleData->HashLength); - // We're probably screwed, so bail out - break; - } - // We are only interested in 'DENY' type with PE256 hashes - if (FileRuleHeader->Type == CI_DENY && FileRuleData->HashLength == PE256_HASHSIZE) { - // Microsoft has the bad habit of duplicating entries - only add a hash if it's different from previous entry - if ((pe256ssp_size == 0) || - (memcmp(&pe256ssp[(pe256ssp_size - 1) * PE256_HASHSIZE], FileRuleData->Hash, PE256_HASHSIZE) != 0)) { - memcpy(&pe256ssp[pe256ssp_size * PE256_HASHSIZE], FileRuleData->Hash, PE256_HASHSIZE); - pe256ssp_size++; - } - } - pbRule = &pbRule[sizeof(CIFileRuleData) + ((FileRuleData->HashLength + sizeof(DWORD) - 1) / sizeof(DWORD)) * sizeof(DWORD)]; - } - - r = TRUE; - -out: - if (hMsg != NULL) - CryptMsgClose(hMsg); - free(pkcsData.pbData); - free(wpath); - return r; -} diff --git a/src/rufus.c b/src/rufus.c index 543a8ac4..dd3636af 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -93,7 +93,7 @@ static char uppercase_select[2][64], uppercase_start[64], uppercase_close[64], u extern HANDLE update_check_thread; extern HIMAGELIST hUpImageList, hDownImageList; -extern BOOL enable_iso, enable_joliet, enable_rockridge, enable_extra_hashes, is_bootloader_revoked; +extern BOOL enable_iso, enable_joliet, enable_rockridge, enable_extra_hashes; extern BOOL validate_md5sum, cpu_has_sha1_accel, cpu_has_sha256_accel, toggle_dark_mode; extern BYTE* fido_script; extern HWND hFidoDlg; @@ -1505,7 +1505,6 @@ static DWORD WINAPI BootCheckThread(LPVOID param) char tmp[MAX_PATH], tmp2[MAX_PATH], c; syslinux_ldlinux_len[0] = 0; syslinux_ldlinux_len[1] = 0; - is_bootloader_revoked = FALSE; safe_free(grub2_buf); if (ComboBox_GetCurSel(hDeviceList) == CB_ERR) @@ -1688,6 +1687,8 @@ static DWORD WINAPI BootCheckThread(LPVOID param) if (img_report.win_version.build >= 26200) { StrArrayAdd(&options, lmprintf(MSG_350), TRUE); MAP_BIT(UNATTEND_USE_MS2023_BOOTLOADERS); + StrArrayAdd(&options, lmprintf(MSG_324), TRUE); + MAP_BIT(UNATTEND_APPLY_SKUSIPOLICY); } if (expert_mode) { StrArrayAdd(&options, lmprintf(MSG_346), TRUE); diff --git a/src/rufus.h b/src/rufus.h index 14723810..4c9e71b8 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -685,8 +685,9 @@ typedef struct { #define UNATTEND_DISABLE_BITLOCKER 0x00080 #define UNATTEND_FORCE_S_MODE 0x00100 #define UNATTEND_USE_MS2023_BOOTLOADERS 0x00200 -#define UNATTEND_FULL_MASK 0x003FF -#define UNATTEND_DEFAULT_MASK 0x002FF // Mask of values that are persisted +#define UNATTEND_APPLY_SKUSIPOLICY 0x00400 +#define UNATTEND_FULL_MASK 0x007FF +#define UNATTEND_DEFAULT_MASK 0x006FF // Mask of values that are persisted #define UNATTEND_WINDOWS_TO_GO 0x10000 // Special flag for Windows To Go #define UNATTEND_WINPE_SETUP_MASK (UNATTEND_SECUREBOOT_TPM_MINRAM) @@ -815,7 +816,6 @@ extern BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan); extern BOOL ExtractZip(const char* src_zip, const char* dest_dir); extern int64_t ExtractISOFile(const char* iso, const char* iso_file, const char* dest_file, DWORD attributes); extern uint32_t ReadISOFileToBuffer(const char* iso, const char* iso_file, uint8_t** buf); -extern BOOL CopySKUSiPolicy(const char* drive_name); extern BOOL HasEfiImgBootLoaders(void); extern BOOL DumpFatDir(const char* path, int32_t cluster); extern BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int fs); @@ -866,7 +866,6 @@ extern int GetIssuerCertificateInfo(uint8_t* cert, cert_info_t* info); extern uint64_t GetSignatureTimeStamp(const char* path); extern LONG ValidateSignature(HWND hDlg, const char* path); extern BOOL ValidateOpensslSignature(BYTE* pbBuffer, DWORD dwBufferLen, BYTE* pbSignature, DWORD dwSigLen); -extern BOOL ParseSKUSiPolicy(void); extern BOOL IsFontAvailable(const char* font_name); extern BOOL WriteFileWithRetry(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, DWORD nNumRetries); diff --git a/src/rufus.rc b/src/rufus.rc index ecc30772..3fc39d57 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.14.2317" +CAPTION "Rufus 4.14.2318" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -408,8 +408,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,14,2317,0 - PRODUCTVERSION 4,14,2317,0 + FILEVERSION 4,14,2318,0 + PRODUCTVERSION 4,14,2318,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +427,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.14.2317" + VALUE "FileVersion", "4.14.2318" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2317" + VALUE "ProductVersion", "4.14.2318" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index 3e0f382d..5c10c957 100644 --- a/src/wue.c +++ b/src/wue.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Windows User Experience - * Copyright © 2022-2025 Pete Batard <pete@akeo.ie> + * Copyright © 2022-2026 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -47,7 +47,6 @@ const char* bypass_name[] = { "BypassTPMCheck", "BypassSecureBootCheck", "Bypass int unattend_xml_flags = 0, wintogo_index = -1, wininst_index = 0; int unattend_xml_mask = UNATTEND_DEFAULT_SELECTION_MASK; char *unattend_xml_path = NULL, unattend_username[MAX_USERNAME_LENGTH]; -BOOL is_bootloader_revoked = FALSE; extern BOOL validate_md5sum; extern uint64_t md5sum_totalbytes; @@ -65,7 +64,7 @@ char* CreateUnattendXml(int arch, int flags) { const static char* xml_arch_names[5] = { "x86", "amd64", "arm", "arm64" }; const static char* unallowed_account_names[] = { "Administrator", "Guest", "KRBTGT", "Local", "NONE" }; - static char path[MAX_PATH]; + static char path[MAX_PATH], tmp[MAX_PATH]; char* tzstr; FILE* fd; TIME_ZONE_INFORMATION tz_info; @@ -140,7 +139,8 @@ char* CreateUnattendXml(int arch, int flags) } if (flags & UNATTEND_OOBE_MASK) { - order = 1; + StrArray first_logon_commands = STRARRAY_EMPTY; + StrArrayCreate(&first_logon_commands, 8); fprintf(fd, " <settings pass=\"oobeSystem\">\n"); if (flags & UNATTEND_OOBE_SHELL_SETUP_MASK) { fprintf(fd, " <component name=\"Microsoft-Windows-Shell-Setup\" processorArchitecture=\"%s\" language=\"neutral\" " @@ -200,20 +200,40 @@ char* CreateUnattendXml(int arch, int flags) // Since we set a blank password, we'll ask the user to change it at next logon. // NB: In case you wanna try, please be aware that Microsoft doesn't let you have multiple // <FirstLogonCommands> sections in unattend.xml. Don't ask me how I know... :( - fprintf(fd, " <FirstLogonCommands>\n"); - fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n"); - fprintf(fd, " <Order>%d</Order>\n", order++); - fprintf(fd, " <CommandLine>net user &quot;%s&quot; /logonpasswordchg:yes</CommandLine>\n", unattend_username); - fprintf(fd, " </SynchronousCommand>\n"); - // Some people report that using the `net user` command above might reset the password expiration to 90 days... + static_sprintf(tmp, "net user &quot;%s&quot; /logonpasswordchg:yes", unattend_username); + StrArrayAdd(&first_logon_commands, tmp, TRUE); + // The `net user` command above might reset the password expiration to 90 days... // To alleviate that, blanket set passwords on the target machine to never expire. - fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n"); - fprintf(fd, " <Order>%d</Order>\n", order++); - fprintf(fd, " <CommandLine>net accounts /maxpwage:unlimited</CommandLine>\n"); - fprintf(fd, " </SynchronousCommand>\n"); - fprintf(fd, " </FirstLogonCommands>\n"); + StrArrayAdd(&first_logon_commands, "net accounts /maxpwage:unlimited", TRUE); } } + + // Apply SkuSiPolicy.p7b, if the user requested it and we're not creating a Windows To Go drive. + // See https://support.microsoft.com/kb/5042562. We do it post install, on first logon, because + // we'd have to patch tons of files otherwise. And we *ALWAYS* use the installed system's + // SkuSiPolicy.p7b instead of the host system's, even if the latter might be more recent, on + // account that the bootloaders from the installed system might be trailing behind, and wills + // produce the 0xc0000428 signature validation error on (re)boot if the system hasn't gone + // through a full Windows Update cycle. + if (flags & UNATTEND_APPLY_SKUSIPOLICY) { + StrArrayAdd(&first_logon_commands, "cmd /c mountvol S: /S &amp;&amp; " + "copy %WINDIR%\\system32\\SecureBootUpdates\\SkuSiPolicy.p7b S:\\EFI\\Microsoft\\Boot &amp;&amp; " + "mountvol S: /D", TRUE); + } + + // Now that we have all the commands to run, create the FirstLogonCommands section. + for (order = 1; order <= (int)first_logon_commands.Index; order++) { + if (order == 1) + fprintf(fd, " <FirstLogonCommands>\n"); + fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n"); + fprintf(fd, " <Order>%d</Order>\n", order); + fprintf(fd, " <CommandLine>%s</CommandLine>\n", first_logon_commands.String[order - 1]); + fprintf(fd, " </SynchronousCommand>\n"); + if (order == first_logon_commands.Index) + fprintf(fd, " </FirstLogonCommands>\n"); + } + StrArrayDestroy(&first_logon_commands); + fprintf(fd, " </component>\n"); } if (flags & UNATTEND_OOBE_INTERNATIONAL_MASK) { @@ -510,31 +530,6 @@ out: return ((img_report.win_version.major != 0) && (img_report.win_version.build != 0)); } -// Copy this system's SkuSiPolicy.p7b to the target drive so that UEFI bootloaders -// revoked by Windows through WDAC policy do get flagged as revoked. -BOOL CopySKUSiPolicy(const char* drive_name) -{ - BOOL r = FALSE; - char src[MAX_PATH], dst[MAX_PATH]; - struct __stat64 stat64 = { 0 }; - - // Only copy SkuPolicy if we warned about the bootloader being revoked. - if ((target_type != TT_UEFI) || !IS_WINDOWS_1X(img_report) || - (pe256ssp_size == 0) || !is_bootloader_revoked) - return r; - - static_sprintf(src, "%s\\SecureBootUpdates\\SKUSiPolicy.p7b", system_dir); - static_sprintf(dst, "%s\\EFI\\Microsoft\\Boot\\SKUSiPolicy.p7b", drive_name); - if ((_stat64U(dst, &stat64) != 0) && (_stat64U(src, &stat64) == 0)) { - uprintf("Copying: %s (%s) (from %s)", dst, SizeToHumanReadable(stat64.st_size, FALSE, FALSE), src); - r = CopyFileU(src, dst, TRUE); - if (!r) - uprintf(" Error writing file: %s", WindowsErrorString()); - } - - return r; -} - /// <summary> /// Checks which versions of Windows are available in an install image /// to set our extraction index. Asks the user to select one if needed. @@ -739,8 +734,6 @@ BOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp) ErrorStatus = RUFUS_ERROR(APPERR(ERROR_ISO_EXTRACT)); } - CopySKUSiPolicy((use_esp) ? ms_efi : drive_name); - UpdateProgressWithInfo(OP_FILE_COPY, MSG_267, 99, 100); // Setting internal drives offline for Windows To Go is crucial if, for instance, you are using ReFS From 1d4c62ba0d0a30f6fe218f1b288dac4eccf884e8 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 11 Mar 2026 10:55:04 +0000 Subject: [PATCH 128/192] [wue] add an option to perform a fully unattended/silent install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Note that this will completely repartition and erase the first disk available on the target system ⚠WITHOUT ANY PROMPT⚠. * Also, this is dependent on the local account name and duplicate regional WUE options to be selected. * With a special mention to Claude AI, that said that detecting whether a one or multiple disks were available was impossible to accomplish using only unattend XML commands... which we therefore promptly managed to disprove. Please wake me up when there is any semblance of "intelligence" in the LLMs that are currently destroying our planet... --- res/loc/rufus.loc | 3 +- src/resource.h | 39 +++--- src/rufus.c | 27 ++-- src/rufus.h | 22 +++- src/rufus.rc | 11 +- src/stdfn.c | 185 ++++++++++++++------------- src/stdlg.c | 129 +++++++++++++++---- src/wue.c | 310 ++++++++++++++++++++++++++++++++++++++++------ 8 files changed, 533 insertions(+), 193 deletions(-) diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index c2ea67a9..8c04063f 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -577,7 +577,8 @@ t MSG_320 "Refreshing partition layout (%s)..." t MSG_321 "The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File " "copy mode.\nAs a result, DD image writing mode will be enforced." t MSG_322 "Unable to open or read '%s'" -t MSG_324 "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +t MSG_323 "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +t MSG_324 "⚠SILENTLY⚠ erase disk and install:" t MSG_325 "Applying Windows customization: %s" t MSG_326 "Applying user options..." t MSG_327 "Windows User Experience" diff --git a/src/resource.h b/src/resource.h index 9be19993..5b8b4d9f 100644 --- a/src/resource.h +++ b/src/resource.h @@ -173,25 +173,26 @@ #define IDC_SELECTION_CHOICE15 1092 #define IDC_SELECTION_CHOICEMAX 1093 #define IDC_SELECTION_USERNAME 1094 -#define IDC_LIST_ICON 1095 -#define IDC_LIST_TEXT 1096 -#define IDC_LIST_LINE 1097 -#define IDC_LIST_ITEM1 1098 -#define IDC_LIST_ITEM2 1099 -#define IDC_LIST_ITEM3 1100 -#define IDC_LIST_ITEM4 1101 -#define IDC_LIST_ITEM5 1102 -#define IDC_LIST_ITEM6 1103 -#define IDC_LIST_ITEM7 1104 -#define IDC_LIST_ITEM8 1105 -#define IDC_LIST_ITEM9 1106 -#define IDC_LIST_ITEM10 1107 -#define IDC_LIST_ITEM11 1108 -#define IDC_LIST_ITEM12 1109 -#define IDC_LIST_ITEM13 1110 -#define IDC_LIST_ITEM14 1111 -#define IDC_LIST_ITEM15 1112 -#define IDC_LIST_ITEMMAX 1113 +#define IDC_SELECTION_EDITION 1095 +#define IDC_LIST_ICON 1100 +#define IDC_LIST_TEXT 1101 +#define IDC_LIST_LINE 1102 +#define IDC_LIST_ITEM1 1103 +#define IDC_LIST_ITEM2 1104 +#define IDC_LIST_ITEM3 1105 +#define IDC_LIST_ITEM4 1106 +#define IDC_LIST_ITEM5 1107 +#define IDC_LIST_ITEM6 1108 +#define IDC_LIST_ITEM7 1109 +#define IDC_LIST_ITEM8 1110 +#define IDC_LIST_ITEM9 1111 +#define IDC_LIST_ITEM10 1112 +#define IDC_LIST_ITEM11 1113 +#define IDC_LIST_ITEM12 1114 +#define IDC_LIST_ITEM13 1115 +#define IDC_LIST_ITEM14 1116 +#define IDC_LIST_ITEM15 1117 +#define IDC_LIST_ITEMMAX 1118 #define IDS_DEVICE_TXT 2000 #define IDS_PARTITION_TYPE_TXT 2001 #define IDS_FILE_SYSTEM_TXT 2002 diff --git a/src/rufus.c b/src/rufus.c index dd3636af..790da244 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1490,7 +1490,7 @@ out: // Likewise, boot check will block message processing => use a thread static DWORD WINAPI BootCheckThread(LPVOID param) { - int i, r, username_index = -1; + int i, r; FILE *fd; uint32_t len; WPARAM ret = BOOTCHECK_CANCEL; @@ -1503,6 +1503,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) const char* syslinux = "syslinux"; const char* ldlinux_ext[3] = { "sys", "bss", "c32" }; char tmp[MAX_PATH], tmp2[MAX_PATH], c; + selection_dialog_options_t selection_options = { 0, -1, -1, -1 }; syslinux_ldlinux_len[0] = 0; syslinux_ldlinux_len[1] = 0; safe_free(grub2_buf); @@ -1610,7 +1611,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) MAP_BIT(UNATTEND_NO_ONLINE_ACCOUNT); } StrArrayAdd(&options, lmprintf(MSG_333), TRUE); - username_index = _log2(b); + selection_options.username_index = _log2(b); MAP_BIT(UNATTEND_SET_USER); StrArrayAdd(&options, lmprintf(MSG_334), TRUE); MAP_BIT(UNATTEND_DUPLICATE_LOCALE); @@ -1620,8 +1621,9 @@ static DWORD WINAPI BootCheckThread(LPVOID param) StrArrayAdd(&options, lmprintf(MSG_346), TRUE); MAP_BIT(UNATTEND_FORCE_S_MODE); } + selection_options.mask = remap16(unattend_xml_mask, map, FALSE); i = CustomSelectionDialog(BS_AUTOCHECKBOX, lmprintf(MSG_327), lmprintf(MSG_328), - options.String, options.Index, remap16(unattend_xml_mask, map, FALSE), username_index); + options.String, options.Index, &selection_options); StrArrayDestroy(&options); if (i < 0) goto out; @@ -1676,26 +1678,35 @@ static DWORD WINAPI BootCheckThread(LPVOID param) MAP_BIT(UNATTEND_NO_ONLINE_ACCOUNT); } StrArrayAdd(&options, lmprintf(MSG_333), TRUE); - username_index = _log2(b); + selection_options.username_index = _log2(b); MAP_BIT(UNATTEND_SET_USER); StrArrayAdd(&options, lmprintf(MSG_334), TRUE); + selection_options.regional_index = _log2(b); MAP_BIT(UNATTEND_DUPLICATE_LOCALE); StrArrayAdd(&options, lmprintf(MSG_331), TRUE); MAP_BIT(UNATTEND_NO_DATA_COLLECTION); - StrArrayAdd(&options, lmprintf(MSG_335), TRUE); - MAP_BIT(UNATTEND_DISABLE_BITLOCKER); + if (IS_WINDOWS_11(img_report)) { + StrArrayAdd(&options, lmprintf(MSG_335), TRUE); + MAP_BIT(UNATTEND_DISABLE_BITLOCKER); + } if (img_report.win_version.build >= 26200) { StrArrayAdd(&options, lmprintf(MSG_350), TRUE); MAP_BIT(UNATTEND_USE_MS2023_BOOTLOADERS); - StrArrayAdd(&options, lmprintf(MSG_324), TRUE); + StrArrayAdd(&options, lmprintf(MSG_323), TRUE); MAP_BIT(UNATTEND_APPLY_SKUSIPOLICY); } + if (IS_WINDOWS_11(img_report)) { + StrArrayAdd(&options, lmprintf(MSG_324), TRUE); + selection_options.edition_index = _log2(b); + MAP_BIT(UNATTEND_SILENT_INSTALL); + } if (expert_mode) { StrArrayAdd(&options, lmprintf(MSG_346), TRUE); MAP_BIT(UNATTEND_FORCE_S_MODE); } + selection_options.mask = remap16(unattend_xml_mask, map, FALSE); i = CustomSelectionDialog(BS_AUTOCHECKBOX, lmprintf(MSG_327), lmprintf(MSG_328), - options.String, options.Index, remap16(unattend_xml_mask, map, FALSE), username_index); + options.String, options.Index, &selection_options); StrArrayDestroy(&options); if (i < 0) goto out; diff --git a/src/rufus.h b/src/rufus.h index 4c9e71b8..401769eb 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -507,6 +507,14 @@ typedef struct { char* Label; } IMG_SAVE; +// Options for the custom selection dialog +typedef struct { + int mask; + int username_index; + int edition_index; + int regional_index; +} selection_dialog_options_t; + /* * Structure and macros used for the extensions specification of FileDialog() * You can use: @@ -686,15 +694,17 @@ typedef struct { #define UNATTEND_FORCE_S_MODE 0x00100 #define UNATTEND_USE_MS2023_BOOTLOADERS 0x00200 #define UNATTEND_APPLY_SKUSIPOLICY 0x00400 -#define UNATTEND_FULL_MASK 0x007FF +#define UNATTEND_SILENT_INSTALL 0x00800 +#define UNATTEND_FULL_MASK 0x00FFF #define UNATTEND_DEFAULT_MASK 0x006FF // Mask of values that are persisted #define UNATTEND_WINDOWS_TO_GO 0x10000 // Special flag for Windows To Go -#define UNATTEND_WINPE_SETUP_MASK (UNATTEND_SECUREBOOT_TPM_MINRAM) +#define UNATTEND_WINPE_SETUP_MASK (UNATTEND_SECUREBOOT_TPM_MINRAM | UNATTEND_SILENT_INSTALL) #define UNATTEND_SPECIALIZE_DEPLOYMENT_MASK (UNATTEND_NO_ONLINE_ACCOUNT) #define UNATTEND_OOBE_SHELL_SETUP_MASK (UNATTEND_NO_DATA_COLLECTION | UNATTEND_SET_USER | UNATTEND_DUPLICATE_LOCALE) #define UNATTEND_OOBE_INTERNATIONAL_MASK (UNATTEND_DUPLICATE_LOCALE) -#define UNATTEND_OOBE_MASK (UNATTEND_OOBE_SHELL_SETUP_MASK | UNATTEND_OOBE_INTERNATIONAL_MASK | UNATTEND_DISABLE_BITLOCKER | UNATTEND_USE_MS2023_BOOTLOADERS) +#define UNATTEND_OOBE_MASK (UNATTEND_OOBE_SHELL_SETUP_MASK | UNATTEND_OOBE_INTERNATIONAL_MASK | UNATTEND_DISABLE_BITLOCKER | \ + UNATTEND_USE_MS2023_BOOTLOADERS | UNATTEND_APPLY_SKUSIPOLICY) #define UNATTEND_OFFLINE_SERVICING_MASK (UNATTEND_OFFLINE_INTERNAL_DRIVES | UNATTEND_FORCE_S_MODE) #define UNATTEND_DEFAULT_SELECTION_MASK (UNATTEND_SECUREBOOT_TPM_MINRAM | UNATTEND_NO_ONLINE_ACCOUNT | UNATTEND_OFFLINE_INTERNAL_DRIVES) @@ -769,6 +779,8 @@ extern StrArray modified_files; * Shared prototypes */ extern void GetWindowsVersion(windows_version_t* WindowsVersion); +extern const char* GetEditionName(DWORD ProductType); +extern int GetEditions(StrArray* version_name, StrArray* version_index); extern version_t* GetExecutableVersion(const char* path); extern const char* WindowsErrorString(void); extern void DumpBufferHex(void *buf, size_t size); @@ -806,8 +818,8 @@ extern void DestroyTooltip(HWND hWnd); extern void DestroyAllTooltips(void); extern int NotificationEx(int type, const char* dont_display_setting, const notification_info* more_info, const char* title, const char* format, ...); #define Notification(type, title, ...) NotificationEx(type, NULL, NULL, title, __VA_ARGS__) -extern int CustomSelectionDialog(int style, char* title, char* message, char** choices, int size, int mask, int username_index); -#define SelectionDialog(title, message, choices, size) CustomSelectionDialog(BS_AUTORADIOBUTTON, title, message, choices, size, 1, -1) +extern int CustomSelectionDialog(int style, char* title, char* message, char** choices, int size, selection_dialog_options_t* options); +#define SelectionDialog(title, message, choices, size) CustomSelectionDialog(BS_AUTORADIOBUTTON, title, message, choices, size, NULL) extern void ListDialog(char* title, char* message, char** items, int size); extern SIZE GetTextSize(HWND hCtrl, char* txt); extern BOOL ExtractAppIcon(const char* filename, BOOL bSilent); diff --git a/src/rufus.rc b/src/rufus.rc index 3fc39d57..967272f0 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.14.2318" +CAPTION "Rufus 4.14.2319" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -176,6 +176,7 @@ BEGIN CONTROL "Choice 15",IDC_SELECTION_CHOICE15,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,35,200,269,10,WS_EX_TRANSPARENT CONTROL "Choice 16",IDC_SELECTION_CHOICEMAX,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,35,213,269,10,WS_EX_TRANSPARENT EDITTEXT IDC_SELECTION_USERNAME,197,57,0,9,ES_AUTOHSCROLL | NOT WS_VISIBLE | WS_TABSTOP | WS_BORDER + COMBOBOX IDC_SELECTION_EDITION,197,57,0,9,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP END IDD_LIST DIALOGEX 0, 0, 312, 59 @@ -408,8 +409,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,14,2318,0 - PRODUCTVERSION 4,14,2318,0 + FILEVERSION 4,14,2319,0 + PRODUCTVERSION 4,14,2319,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -427,13 +428,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.14.2318" + VALUE "FileVersion", "4.14.2319" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2318" + VALUE "ProductVersion", "4.14.2319" END END BLOCK "VarFileInfo" diff --git a/src/stdfn.c b/src/stdfn.c index 43819d4b..4014f777 100644 --- a/src/stdfn.c +++ b/src/stdfn.c @@ -216,109 +216,109 @@ uint32_t htab_hash(char* str, htab_table* htab) return idx; } -static const char* GetEdition(DWORD ProductType) +const char* GetEditionName(DWORD ProductType) { - static char unknown_edition_str[64]; + static char unknown_edition_str[64] = ""; // From: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getproductinfo // These values can be found in the winnt.h header. switch (ProductType) { case 0x00000000: return ""; // Undefined - case 0x00000001: return "Ultimate"; - case 0x00000002: return "Home Basic"; - case 0x00000003: return "Home Premium"; - case 0x00000004: return "Enterprise"; - case 0x00000005: return "Home Basic N"; - case 0x00000006: return "Business"; - case 0x00000007: return "Server Standard"; - case 0x00000008: return "Server Datacenter"; - case 0x00000009: return "Smallbusiness Server"; - case 0x0000000A: return "Server Enterprise"; - case 0x0000000B: return "Starter"; - case 0x0000000C: return "Server Datacenter (Core)"; - case 0x0000000D: return "Server Standard (Core)"; - case 0x0000000E: return "Server Enterprise (Core)"; - case 0x00000010: return "Business N"; - case 0x00000011: return "Web Server"; - case 0x00000012: return "HPC Edition"; - case 0x00000013: return "Storage Server (Essentials)"; - case 0x0000001A: return "Home Premium N"; - case 0x0000001B: return "Enterprise N"; - case 0x0000001C: return "Ultimate N"; - case 0x00000022: return "Home Server"; - case 0x00000024: return "Server Standard without Hyper-V"; - case 0x00000025: return "Server Datacenter without Hyper-V"; - case 0x00000026: return "Server Enterprise without Hyper-V"; - case 0x00000027: return "Server Datacenter without Hyper-V (Core)"; - case 0x00000028: return "Server Standard without Hyper-V (Core)"; - case 0x00000029: return "Server Enterprise without Hyper-V (Core)"; - case 0x0000002A: return "Hyper-V Server"; - case 0x0000002F: return "Starter N"; - case 0x00000030: return "Pro"; - case 0x00000031: return "Pro N"; - case 0x00000034: return "Server Solutions Premium"; - case 0x00000035: return "Server Solutions Premium (Core)"; - case 0x00000040: return "Server Hyper Core V"; - case 0x00000042: return "Starter E"; - case 0x00000043: return "Home Basic E"; - case 0x00000044: return "Premium E"; - case 0x00000045: return "Pro E"; - case 0x00000046: return "Enterprise E"; - case 0x00000047: return "Ultimate E"; - case 0x00000048: return "Enterprise (Eval)"; - case 0x0000004F: return "Server Standard (Eval)"; - case 0x00000050: return "Server Datacenter (Eval)"; - case 0x00000054: return "Enterprise N (Eval)"; - case 0x00000057: return "Thin PC"; + case 0x00000001: return " Ultimate"; + case 0x00000002: return " Home Basic"; + case 0x00000003: return " Home Premium"; + case 0x00000004: return " Enterprise"; + case 0x00000005: return " Home Basic N"; + case 0x00000006: return " Business"; + case 0x00000007: return " Server Standard"; + case 0x00000008: return " Server Datacenter"; + case 0x00000009: return " Smallbusiness Server"; + case 0x0000000A: return " Server Enterprise"; + case 0x0000000B: return " Starter"; + case 0x0000000C: return " Server Datacenter (Core)"; + case 0x0000000D: return " Server Standard (Core)"; + case 0x0000000E: return " Server Enterprise (Core)"; + case 0x00000010: return " Business N"; + case 0x00000011: return " Web Server"; + case 0x00000012: return " HPC Edition"; + case 0x00000013: return " Storage Server (Essentials)"; + case 0x0000001A: return " Home Premium N"; + case 0x0000001B: return " Enterprise N"; + case 0x0000001C: return " Ultimate N"; + case 0x00000022: return " Home Server"; + case 0x00000024: return " Server Standard without Hyper-V"; + case 0x00000025: return " Server Datacenter without Hyper-V"; + case 0x00000026: return " Server Enterprise without Hyper-V"; + case 0x00000027: return " Server Datacenter without Hyper-V (Core)"; + case 0x00000028: return " Server Standard without Hyper-V (Core)"; + case 0x00000029: return " Server Enterprise without Hyper-V (Core)"; + case 0x0000002A: return " Hyper-V Server"; + case 0x0000002F: return " Starter N"; + case 0x00000030: return " Pro"; + case 0x00000031: return " Pro N"; + case 0x00000034: return " Server Solutions Premium"; + case 0x00000035: return " Server Solutions Premium (Core)"; + case 0x00000040: return " Server Hyper Core V"; + case 0x00000042: return " Starter E"; + case 0x00000043: return " Home Basic E"; + case 0x00000044: return " Premium E"; + case 0x00000045: return " Pro E"; + case 0x00000046: return " Enterprise E"; + case 0x00000047: return " Ultimate E"; + case 0x00000048: return " Enterprise (Eval)"; + case 0x0000004F: return " Server Standard (Eval)"; + case 0x00000050: return " Server Datacenter (Eval)"; + case 0x00000054: return " Enterprise N (Eval)"; + case 0x00000057: return " Thin PC"; case 0x00000058: case 0x00000059: case 0x0000005A: case 0x0000005B: case 0x0000005C: return "Embedded"; - case 0x00000062: return "Home N"; - case 0x00000063: return "Home China"; - case 0x00000064: return "Home Single Language"; - case 0x00000065: return "Home"; - case 0x00000067: return "Pro with Media Center"; + case 0x00000062: return " Home N"; + case 0x00000063: return " Home China"; + case 0x00000064: return " Home Single Language"; + case 0x00000065: return " Home"; + case 0x00000067: return " Pro with Media Center"; case 0x00000069: case 0x0000006A: case 0x0000006B: case 0x0000006C: return "Embedded"; - case 0x0000006F: return "Home Connected"; - case 0x00000070: return "Pro Student"; - case 0x00000071: return "Home Connected N"; - case 0x00000072: return "Pro Student N"; - case 0x00000073: return "Home Connected Single Language"; - case 0x00000074: return "Home Connected China"; - case 0x00000079: return "Education"; - case 0x0000007A: return "Education N"; - case 0x0000007D: return "Enterprise LTSB"; - case 0x0000007E: return "Enterprise LTSB N"; - case 0x0000007F: return "Pro S"; - case 0x00000080: return "Pro S N"; - case 0x00000081: return "Enterprise LTSB (Eval)"; - case 0x00000082: return "Enterprise LTSB N (Eval)"; - case 0x0000008A: return "Pro Single Language"; - case 0x0000008B: return "Pro China"; - case 0x0000008C: return "Enterprise Subscription"; - case 0x0000008D: return "Enterprise Subscription N"; - case 0x00000091: return "Server Datacenter SA (Core)"; - case 0x00000092: return "Server Standard SA (Core)"; - case 0x00000095: return "Utility VM"; - case 0x000000A1: return "Pro for Workstations"; - case 0x000000A2: return "Pro for Workstations N"; - case 0x000000A4: return "Pro for Education"; - case 0x000000A5: return "Pro for Education N"; - case 0x000000AB: return "Enterprise G"; // I swear Microsoft are just making up editions... - case 0x000000AC: return "Enterprise G N"; - case 0x000000B2: return "Cloud"; - case 0x000000B3: return "Cloud N"; - case 0x000000B6: return "Home OS"; + case 0x0000006F: return " Home Connected"; + case 0x00000070: return " Pro Student"; + case 0x00000071: return " Home Connected N"; + case 0x00000072: return " Pro Student N"; + case 0x00000073: return " Home Connected Single Language"; + case 0x00000074: return " Home Connected China"; + case 0x00000079: return " Education"; + case 0x0000007A: return " Education N"; + case 0x0000007D: return " Enterprise LTSB"; + case 0x0000007E: return " Enterprise LTSB N"; + case 0x0000007F: return " Pro S"; + case 0x00000080: return " Pro S N"; + case 0x00000081: return " Enterprise LTSB (Eval)"; + case 0x00000082: return " Enterprise LTSB N (Eval)"; + case 0x0000008A: return " Pro Single Language"; + case 0x0000008B: return " Pro China"; + case 0x0000008C: return " Enterprise Subscription"; + case 0x0000008D: return " Enterprise Subscription N"; + case 0x00000091: return " Server Datacenter SA (Core)"; + case 0x00000092: return " Server Standard SA (Core)"; + case 0x00000095: return " Utility VM"; + case 0x000000A1: return " Pro for Workstations"; + case 0x000000A2: return " Pro for Workstations N"; + case 0x000000A4: return " Pro for Education"; + case 0x000000A5: return " Pro for Education N"; + case 0x000000AB: return " Enterprise G"; // I swear Microsoft are just making up editions... + case 0x000000AC: return " Enterprise G N"; + case 0x000000B2: return " Cloud"; + case 0x000000B3: return " Cloud N"; + case 0x000000B6: return " Home OS"; case 0x000000B7: case 0x000000CB: return "Cloud E"; - case 0x000000B9: return "IoT OS"; + case 0x000000B9: return " IoT OS"; case 0x000000BA: case 0x000000CA: return "Cloud E N"; - case 0x000000BB: return "IoT Edge OS"; - case 0x000000BC: return "IoT Enterprise"; - case 0x000000BD: return "Lite"; - case 0x000000BF: return "IoT Enterprise S"; + case 0x000000BB: return " IoT Edge OS"; + case 0x000000BC: return " IoT Enterprise"; + case 0x000000BD: return " Lite"; + case 0x000000BF: return " IoT Enterprise S"; case 0x000000C0: case 0x000000C2: case 0x000000C3: case 0x000000C4: case 0x000000C5: case 0x000000C6: return "XBox"; case 0x000000C7: case 0x000000C8: case 0x00000196: case 0x00000197: case 0x00000198: return "Azure Server"; - case 0xABCDABCD: return "(Unlicensed)"; + case 0xABCDABCD: return " (Unlicensed)"; default: - static_sprintf(unknown_edition_str, "(Unknown Edition 0x%02X)", (uint32_t)ProductType); + static_sprintf(unknown_edition_str, " (Unknown Edition 0x%02X)", (uint32_t)ProductType); return unknown_edition_str; } } @@ -475,10 +475,9 @@ void GetWindowsVersion(windows_version_t* windows_version) else if (vi.wServicePackMajor) safe_sprintf(vptr, vlen, "%s SP%u %s", w, vi.wServicePackMajor, arch_name); else - safe_sprintf(vptr, vlen, "%s%s%s %s", - w, (dwProductType != 0) ? " " : "", GetEdition(dwProductType), arch_name); + safe_sprintf(vptr, vlen, "%s%s %s", w, GetEditionName(dwProductType), arch_name); - windows_version->Edition = (int)dwProductType; + windows_version->Edition = dwProductType; // Add the build number (including UBR if available) windows_version->BuildNumber = vi.dwBuildNumber; diff --git a/src/stdlg.c b/src/stdlg.c index 57ae3200..38bd7cb3 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Standard Dialog Routines (Browse for folder, About, etc) - * Copyright © 2011-2025 Pete Batard <pete@akeo.ie> + * Copyright © 2011-2026 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -48,6 +48,7 @@ /* Globals */ extern BOOL is_x86_64, appstore_version; extern char unattend_username[MAX_USERNAME_LENGTH], *sbat_level_txt, *sb_active_txt, *sb_revoked_txt; +extern int unattend_edition_index; extern HICON hSmallIcon, hBigIcon; static HICON hMessageIcon = (HICON)INVALID_HANDLE_VALUE; static char* szMessageText = NULL; @@ -787,8 +788,39 @@ int NotificationEx(int type, const char* dont_display_setting, const notificatio return (int)ret; } +static int GetComboBoxMinWidth(HWND hCtrl, StrArray* array) +{ + HDC hDC = GetDC(hCtrl); + HFONT hFont = (HFONT)SendMessage(hCtrl, WM_GETFONT, 0, 0); + HFONT hOldFont = (HFONT)SelectObject(hDC, hFont); + SIZE size; + uint32_t i; + int max_width = 0, arrow_width, padding; + + if (array == NULL || array->String == NULL) { + ReleaseDC(hCtrl, hDC); + return 0; + } + + for (i = 0; i < array->Index; i++) { + GetTextExtentPoint32A(hDC, array->String[i], (int)strlen(array->String[i]), &size); + if (size.cx > max_width) + max_width = size.cx; + } + SelectObject(hDC, hOldFont); + ReleaseDC(hCtrl, hDC); + + // Add the dropdown arrow button width + some padding + arrow_width = GetSystemMetrics(SM_CXVSCROLL); + padding = GetSystemMetrics(SM_CXEDGE) * 4 + 8; + + return max_width + arrow_width + padding; +} + // We only ever display one selection dialog, so set some params as globals -static int selection_dialog_style, selection_dialog_mask, selection_dialog_username_index; +static int selection_dialog_style; +static selection_dialog_options_t* selection_options = NULL; +static BOOL silent_install_checked = FALSE; /* * Custom dialog for radio button selection dialog @@ -803,19 +835,22 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM static LRESULT disabled[9] = { HTLEFT, HTRIGHT, HTTOP, HTBOTTOM, HTSIZE, HTTOPLEFT, HTTOPRIGHT, HTBOTTOMLEFT, HTBOTTOMRIGHT }; static HBRUSH background_brush, separator_brush; - char username[128] = { 0 }; + static HFONT hDlgFont = NULL; + char username[128] = { 0 }, str[MAX_PATH]; int i, m, dw, dh, r = -1, mw; DWORD size = sizeof(username); LRESULT loc; // To use the system message font NONCLIENTMETRICS ncm; RECT rc, rc2; - static HFONT hDlgFont = NULL; HWND hCtrl; HDC hDC; switch (message) { case WM_INITDIALOG: + StrArray version_name = { 0 }, version_index = { 0 }; + StrArrayCreate(&version_name, 16); + StrArrayCreate(&version_index, 16); SetDarkModeForDlg(hDlg); // Don't overflow our max radio button if (nDialogItems > (IDC_SELECTION_CHOICEMAX - IDC_SELECTION_CHOICE1 + 1)) { @@ -852,23 +887,27 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM mw = rc.right - rc.left - ddw; // ddw seems to work okay as a fudge dw = mw; + r = GetEditions(&version_name, &version_index); + // Change the default icon and set the text Static_SetIcon(GetDlgItem(hDlg, IDC_SELECTION_ICON), LoadIcon(NULL, IDI_QUESTION)); SetWindowTextU(hDlg, szMessageTitle); SetWindowTextU(GetDlgItem(hDlg, IDCANCEL), lmprintf(MSG_007)); SetWindowTextU(GetDlgItem(hDlg, IDC_SELECTION_TEXT), szMessageText); for (i = 0; i < nDialogItems; i++) { - char* str = szDialogItem[i]; + static_strcpy(str, szDialogItem[i]); SetWindowTextU(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), str); ShowWindow(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), SW_SHOW); - // Compute the maximum line's width (with some extra for the username field if needed) - if (i == selection_dialog_username_index) { - str = calloc(strlen(szDialogItem[i]) + strlen(base_username) + 8, 1); - sprintf(str, "%s __%s__", szDialogItem[i], base_username); + // Compute the maximum line's width (with some extra for the username and edition fields) + if (selection_options != NULL && i == selection_options->username_index) { + static_sprintf(str, "%s __%s__", szDialogItem[i], base_username); + mw = max(mw, GetTextSize(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), str).cx); + } else if (selection_options != NULL && i == selection_options->edition_index) { + mw = max(mw, GetTextSize(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), str).cx + + GetComboBoxMinWidth(GetDlgItem(hDlg, IDC_SELECTION_EDITION), &version_name)); + } else { + mw = max(mw, GetTextSize(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), str).cx); } - mw = max(mw, GetTextSize(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), str).cx); - if (i == selection_dialog_username_index) - free(str); } // If our maximum line's width is greater than the default, set a nonzero delta width dw = (mw <= dw) ? 0 : mw - dw; @@ -887,12 +926,12 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), 0, dh, dw, 0, 1.0f); // If required, set up the the username edit box - if (selection_dialog_username_index != -1) { + if (selection_options != NULL && selection_options->username_index != -1) { unattend_username[0] = 0; - hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_dialog_username_index); + hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->username_index); GetClientRect(hCtrl, &rc); ResizeMoveCtrl(hDlg, hCtrl, 0, 0, - (rc.left - rc.right) + GetTextSize(hCtrl, szDialogItem[selection_dialog_username_index]).cx + ddw, 0, 1.0f); + (rc.left - rc.right) + GetTextSize(hCtrl, szDialogItem[selection_options->username_index]).cx + ddw, 0, 1.0f); GetWindowRect(hCtrl, &rc); SetWindowPos(GetDlgItem(hDlg, IDC_SELECTION_USERNAME), hCtrl, rc.left, rc.top, 0, 0, SWP_NOMOVE | SWP_NOSIZE); hCtrl = GetDlgItem(hDlg, IDC_SELECTION_USERNAME); @@ -905,6 +944,25 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM ShowWindow(hCtrl, SW_SHOW); } + // If required, set up the the edition combo box + if (selection_options != NULL && selection_options->edition_index != -1 && version_name.String != NULL && version_name.Index > 0) { + hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->edition_index); + GetClientRect(hCtrl, &rc); + ResizeMoveCtrl(hDlg, hCtrl, 0, 0, + (rc.left - rc.right) + GetTextSize(hCtrl, szDialogItem[selection_options->edition_index]).cx + ddw, 0, 1.0f); + GetWindowRect(hCtrl, &rc); + SetWindowPos(GetDlgItem(hDlg, IDC_SELECTION_EDITION), hCtrl, rc.left, rc.top, 0, 0, SWP_NOMOVE | SWP_NOSIZE); + hCtrl = GetDlgItem(hDlg, IDC_SELECTION_EDITION); + GetWindowRect(hCtrl, &rc2); + ResizeMoveCtrl(hDlg, hCtrl, right_to_left_mode ? rc2.right - rc.left : rc.right - rc2.left, rc.top - rc2.top, + GetComboBoxMinWidth(hCtrl, &version_name), 0, 1.0f); + for (i = 0; i < (int)version_name.Index; i++) + IGNORE_RETVAL(ComboBox_SetItemData(hCtrl, ComboBox_AddStringU(hCtrl, version_name.String[i]), + (LPARAM)atoi(version_index.String[i]))); + IGNORE_RETVAL(ComboBox_SetCurSel(hCtrl, unattend_edition_index)); + ShowWindow(hCtrl, SW_SHOW); + } + if (nDialogItems > 2) { GetWindowRect(GetDlgItem(hDlg, IDC_SELECTION_CHOICE2), &rc); GetWindowRect(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + nDialogItems - 1), &rc2); @@ -922,8 +980,17 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM // Set the default selection for (i = 0, m = 1; i < nDialogItems; i++, m <<= 1) - Button_SetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), (m & selection_dialog_mask) ? BST_CHECKED : BST_UNCHECKED); + Button_SetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), + ((selection_options == NULL && i == 0) || (selection_options != NULL && (m & selection_options->mask))) ? BST_CHECKED : BST_UNCHECKED); + if (selection_options != NULL && selection_options->username_index > 0 && selection_options->edition_index > 0) { + BOOL enable = Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->username_index)); + EnableWindow(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->edition_index), enable); + EnableWindow(GetDlgItem(hDlg, IDC_SELECTION_EDITION), enable); + } + SetDarkModeForChild(hDlg); + StrArrayDestroy(&version_name); + StrArrayDestroy(&version_index); return (INT_PTR)TRUE; case WM_CTLCOLORSTATIC: // Change the background colour for static text and icon @@ -945,12 +1012,29 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM safe_delete_object(hDlgFont); break; case WM_COMMAND: - switch (LOWORD(wParam)) { + WORD command = LOWORD(wParam); + if (command >= IDC_SELECTION_CHOICE1 && command < IDC_SELECTION_CHOICEMAX) { + // Check if the local account name or regional settings checkbox was clicked and enable/disable the silent install option + if (selection_options != NULL && selection_options->username_index > 0 && selection_options->edition_index > 0 && selection_options->regional_index > 0 && + (command - IDC_SELECTION_CHOICE1 == selection_options->username_index || command - IDC_SELECTION_CHOICE1 == selection_options->regional_index)) { + BOOL enable = Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->username_index)) && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->regional_index)); + hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->edition_index); + if (!enable && IsWindowEnabled(hCtrl)) { + silent_install_checked = (Button_GetCheck(hCtrl) == BST_CHECKED); + Button_SetCheck(hCtrl, FALSE); + } else if (enable && !IsWindowEnabled(hCtrl)) { + Button_SetCheck(hCtrl, silent_install_checked); + } + EnableWindow(hCtrl, enable); + EnableWindow(GetDlgItem(hDlg, IDC_SELECTION_EDITION), enable); + } + } else switch (LOWORD(wParam)) { case IDOK: for (r = 0, i = 0, m = 1; i < nDialogItems; i++, m <<= 1) if (Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i)) == BST_CHECKED) r += m; - if (selection_dialog_username_index != -1) { + if (selection_options != NULL && selection_options->username_index != -1) { GetWindowTextU(GetDlgItem(hDlg, IDC_SELECTION_USERNAME), unattend_username, MAX_USERNAME_LENGTH); // Perform string sanitization (NB: GetWindowTextU always terminates the string) for (i = 0; unattend_username[i] != 0; i++) { @@ -958,6 +1042,8 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM unattend_username[i] = '_'; } } + if (selection_options != NULL && selection_options->edition_index != -1) + unattend_edition_index = (int)ComboBox_GetCurItemData(GetDlgItem(hDlg, IDC_SELECTION_EDITION)); // Fall through case IDNO: case IDCANCEL: @@ -972,7 +1058,7 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM /* * Display an item selection dialog */ -int CustomSelectionDialog(int style, char* title, char* message, char** choices, int size, int mask, int username_index) +int CustomSelectionDialog(int style, char* title, char* message, char** choices, int size, selection_dialog_options_t* options) { int ret; @@ -981,10 +1067,9 @@ int CustomSelectionDialog(int style, char* title, char* message, char** choices, szMessageText = message; szDialogItem = choices; nDialogItems = size; + selection_options = options; selection_dialog_style = style; - selection_dialog_mask = mask; - selection_dialog_username_index = username_index; - assert(selection_dialog_style == BS_AUTORADIOBUTTON || selection_dialog_style == BS_AUTOCHECKBOX); + assert(style == BS_AUTORADIOBUTTON || style == BS_AUTOCHECKBOX); ret = (int)MyDialogBox(hMainInstance, IDD_SELECTION, hMainDialog, CustomSelectionCallback); dialog_showing--; diff --git a/src/wue.c b/src/wue.c index 5c10c957..6e8d68c4 100644 --- a/src/wue.c +++ b/src/wue.c @@ -46,13 +46,58 @@ const char* bypass_name[] = { "BypassTPMCheck", "BypassSecureBootCheck", "Bypass int unattend_xml_flags = 0, wintogo_index = -1, wininst_index = 0; int unattend_xml_mask = UNATTEND_DEFAULT_SELECTION_MASK; +int unattend_edition_index = 1; char *unattend_xml_path = NULL, unattend_username[MAX_USERNAME_LENGTH]; +uint32_t removable_section[2] = { 0, 0 }; extern BOOL validate_md5sum; extern uint64_t md5sum_totalbytes; extern StrArray modified_files; extern const char* efi_archname[ARCH_MAX]; +// Get the UI language provided by the ISO's boot.wim +char* GetUILanguage(void) +{ + static char ui_language[8]; + int r; + char wim_path[4 * MAX_PATH] = ""; + wchar_t* xml = NULL; + ezxml_t pxml = NULL; + size_t xml_len; + WIMStruct* wim = NULL; + + assert(safe_strlen(image_path) + 32 < ARRAYSIZE(wim_path)); + static_strcpy(ui_language, "en-US"); + static_strcpy(wim_path, image_path); + static_strcat(wim_path, "|sources/boot.wim"); + + r = wimlib_open_wimU(wim_path, 0, &wim); + if (r != 0) { + uprintf("Could not open WIM: Error %d", r); + goto out; + } + + r = wimlib_get_xml_data(wim, (void**)&xml, &xml_len); + if (r != 0) { + uprintf("Could not read WIM XML index: Error %d", r); + goto out; + } + + pxml = ezxml_parse_str((char*)xml, xml_len); + if (pxml == NULL) + goto out; + + char* lang = ezxml_get_val(pxml, "IMAGE", 1, "WINDOWS", 0, "LANGUAGES", 0, "LANGUAGE", -1); + if (lang != NULL) + static_strcpy(ui_language, lang); + +out: + ezxml_free(pxml); + free(xml); + wimlib_free(wim); + return ui_language; +} + /// <summary> /// Create an installation answer file containing the sections specified by the flags. /// </summary> @@ -70,6 +115,8 @@ char* CreateUnattendXml(int arch, int flags) TIME_ZONE_INFORMATION tz_info; int i, order; unattend_xml_flags = flags; + StrArray commands = STRARRAY_EMPTY; + StrArrayCreate(&commands, 8); if (arch < ARCH_X86_32 || arch > ARCH_ARM_64 || flags == 0) { uprintf("Note: No Windows User Experience options selected"); return NULL; @@ -86,24 +133,104 @@ char* CreateUnattendXml(int arch, int flags) fprintf(fd, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); fprintf(fd, "<unattend xmlns=\"urn:schemas-microsoft-com:unattend\">\n"); - // This part produces the unbecoming display of a command prompt window during initial setup as well - // as alters the layout and options of the initial Windows installer screens, which may scare users. - // So, in format.c, we'll try to insert the registry keys directly and drop this section. However, - // because Microsoft prevents Store apps from editing an offline registry, we do need this fallback. if (flags & UNATTEND_WINPE_SETUP_MASK) { - order = 1; fprintf(fd, " <settings pass=\"windowsPE\">\n"); fprintf(fd, " <component name=\"Microsoft-Windows-Setup\" processorArchitecture=\"%s\" language=\"neutral\" " "xmlns:wcm=\"http://schemas.microsoft.com/WMIConfig/2002/State\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " "publicKeyToken=\"31bf3856ad364e35\" versionScope=\"nonSxS\">\n", xml_arch_names[arch]); // WinPE will complain if we don't provide a product key. *Any* product key. This is soooo idiotic... fprintf(fd, " <UserData>\n"); + fprintf(fd, " <AcceptEula>true</AcceptEula>\n"); fprintf(fd, " <ProductKey>\n"); fprintf(fd, " <Key />\n"); fprintf(fd, " </ProductKey>\n"); fprintf(fd, " </UserData>\n"); + if (flags & UNATTEND_SILENT_INSTALL) { + uprintf("• Silent Install"); + // Automatically partition the disk and set the installation target + fprintf(fd, " <DiskConfiguration>\n"); + fprintf(fd, " <WillShowUI>OnError</WillShowUI>\n"); + if (flags & UNATTEND_DISABLE_BITLOCKER) + fprintf(fd, " <DisableEncryptedDiskProvisioning>true</DisableEncryptedDiskProvisioning>\n"); + // The following ensures that we display the disk selection screen if only the boot media is + // available (i.e. if the system does not see any target for installation). In that case the + // letter assignment below fails and the UI is displayed allowing the user to provide drivers. + // This also prevents the install media from being scratched, when it's the only disk. + // With a special mention to Claude AI, that explicitly said this could not be accomplished... + fprintf(fd, " <Disk wcm:action=\"modify\">\n"); + fprintf(fd, " <DiskID>1</DiskID> \n"); + fprintf(fd, " <ModifyPartitions>\n"); + fprintf(fd, " <ModifyPartition wcm:action=\"modify\">\n"); + fprintf(fd, " <Order>1</Order>\n"); + fprintf(fd, " <PartitionID>1</PartitionID>\n"); + // You REALLY don't want to use 'U' for the drive letter below. Don't ask me how I know!!! + fprintf(fd, " <Letter>D</Letter>\n"); + fprintf(fd, " </ModifyPartition>\n"); + fprintf(fd, " </ModifyPartitions>\n"); + fprintf(fd, " </Disk>\n"); + fprintf(fd, " <Disk wcm:action=\"add\">\n"); + fprintf(fd, " <DiskID>0</DiskID> \n"); + fprintf(fd, " <WillWipeDisk>true</WillWipeDisk> \n"); + fprintf(fd, " <CreatePartitions>\n"); + // NB: Don't bother creating a recovery partition. Windows setup will do it for us. + fprintf(fd, " <CreatePartition wcm:action=\"add\">\n"); + fprintf(fd, " <Order>1</Order>\n"); + fprintf(fd, " <Type>EFI</Type>\n"); + fprintf(fd, " <Size>260</Size>\n"); + fprintf(fd, " </CreatePartition>\n"); + fprintf(fd, " <CreatePartition wcm:action=\"add\">\n"); + fprintf(fd, " <Order>2</Order>\n"); + fprintf(fd, " <Type>MSR</Type>\n"); + fprintf(fd, " <Size>16</Size>\n"); + fprintf(fd, " </CreatePartition>\n"); + fprintf(fd, " <CreatePartition wcm:action=\"add\">\n"); + fprintf(fd, " <Order>3</Order>\n"); + fprintf(fd, " <Type>Primary</Type>\n"); + fprintf(fd, " <Extend>true</Extend>\n"); + fprintf(fd, " </CreatePartition>\n"); + fprintf(fd, " </CreatePartitions>\n"); + fprintf(fd, " <ModifyPartitions>\n"); + fprintf(fd, " <ModifyPartition wcm:action=\"add\">\n"); + fprintf(fd, " <Order>1</Order>\n"); + fprintf(fd, " <PartitionID>1</PartitionID>\n"); + fprintf(fd, " <Label>EFI</Label>\n"); + fprintf(fd, " <Format>FAT32</Format>\n"); + fprintf(fd, " </ModifyPartition>\n"); + fprintf(fd, " <ModifyPartition wcm:action=\"add\">\n"); + fprintf(fd, " <Order>2</Order>\n"); + fprintf(fd, " <PartitionID>3</PartitionID>\n"); + fprintf(fd, " <Label>Windows</Label>\n"); + fprintf(fd, " <Letter>C</Letter>\n"); + fprintf(fd, " <Format>NTFS</Format>\n"); + fprintf(fd, " </ModifyPartition>\n"); + fprintf(fd, " </ModifyPartitions>\n"); + fprintf(fd, " </Disk>\n"); + fprintf(fd, " </DiskConfiguration>\n"); + fprintf(fd, " <ImageInstall>\n"); + fprintf(fd, " <OSImage>\n"); + fprintf(fd, " <WillShowUI>OnError</WillShowUI>\n"); + fprintf(fd, " <InstallFrom>\n"); + fprintf(fd, " <MetaData wcm:action=\"add\">\n"); + fprintf(fd, " <Key>/IMAGE/INDEX</Key>\n"); + fprintf(fd, " <Value>%d</Value>\n", unattend_edition_index); + fprintf(fd, " </MetaData>\n"); + fprintf(fd, " </InstallFrom>\n"); + fprintf(fd, " <InstallTo>\n"); + fprintf(fd, " <DiskID>0</DiskID>\n"); + fprintf(fd, " <PartitionID>3</PartitionID>\n"); + fprintf(fd, " </InstallTo>\n"); + fprintf(fd, " </OSImage>\n"); + fprintf(fd, " </ImageInstall>\n"); + } if (flags & UNATTEND_SECUREBOOT_TPM_MINRAM) { + // This part produces the unbecoming display of a command prompt window during initial setup as well + // as alters the layout and options of the initial Windows installer screens, which may scare users. + // So, in format.c, we'll try to insert the registry keys directly and drop this section. However, + // because Microsoft prevents Store apps from editing an offline registry, we do need this fallback. + // NB: We could probably avoid this by running powershell with -WindowStyle "Hidden" but hey... uprintf("• Bypass SB/TPM/RAM"); + order = 1; + removable_section[0] = (uint32_t)ftell(fd); fprintf(fd, " <RunSynchronous>\n"); for (i = 0; i < ARRAYSIZE(bypass_name); i++) { fprintf(fd, " <RunSynchronousCommand wcm:action=\"add\">\n"); @@ -112,46 +239,60 @@ char* CreateUnattendXml(int arch, int flags) fprintf(fd, " </RunSynchronousCommand>\n"); } fprintf(fd, " </RunSynchronous>\n"); + removable_section[1] = (uint32_t)ftell(fd); } fprintf(fd, " </component>\n"); + if (flags & UNATTEND_SILENT_INSTALL) { + fprintf(fd, " <component name=\"Microsoft-Windows-International-Core-WinPE\" processorArchitecture=\"%s\" language=\"neutral\" " + "xmlns:wcm=\"http://schemas.microsoft.com/WMIConfig/2002/State\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + "publicKeyToken=\"31bf3856ad364e35\" versionScope=\"nonSxS\">\n", xml_arch_names[arch]); + // Set the language from the <LANGUAGE> tag of the boot.wim index + fprintf(fd, " <UILanguage>%s</UILanguage>\n", GetUILanguage()); + fprintf(fd, " </component>\n"); + } fprintf(fd, " </settings>\n"); } if (flags & UNATTEND_SPECIALIZE_DEPLOYMENT_MASK) { - order = 1; fprintf(fd, " <settings pass=\"specialize\">\n"); fprintf(fd, " <component name=\"Microsoft-Windows-Deployment\" processorArchitecture=\"%s\" language=\"neutral\" " "xmlns:wcm=\"http://schemas.microsoft.com/WMIConfig/2002/State\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " "publicKeyToken=\"31bf3856ad364e35\" versionScope=\"nonSxS\">\n", xml_arch_names[arch]); - fprintf(fd, " <RunSynchronous>\n"); // This part was picked from https://github.com/AveYo/MediaCreationTool.bat/blob/main/bypass11/AutoUnattend.xml // NB: This is INCOMPATIBLE with S-Mode below if (flags & UNATTEND_NO_ONLINE_ACCOUNT) { + StrArrayAdd(&commands, "reg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\OOBE\" /v BypassNRO /t REG_DWORD /d 1 /f", TRUE); uprintf("• Bypass online account requirement"); - fprintf(fd, " <RunSynchronousCommand wcm:action=\"add\">\n"); - fprintf(fd, " <Order>%d</Order>\n", order++); - fprintf(fd, " <Path>reg add HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\OOBE /v BypassNRO /t REG_DWORD /d 1 /f</Path>\n"); - fprintf(fd, " </RunSynchronousCommand>\n"); } - fprintf(fd, " </RunSynchronous>\n"); + // Now that we have all the commands to run, create the RunSynchronous section. + for (order = 1; order <= (int)commands.Index; order++) { + if (order == 1) + fprintf(fd, " <RunSynchronous>\n"); + fprintf(fd, " <RunSynchronousCommand wcm:action=\"add\">\n"); + fprintf(fd, " <Order>%d</Order>\n", order); + fprintf(fd, " <Path>%s</Path>\n", commands.String[order - 1]); + fprintf(fd, " </RunSynchronousCommand>\n"); + if (order == commands.Index) + fprintf(fd, " </RunSynchronous>\n"); + } fprintf(fd, " </component>\n"); fprintf(fd, " </settings>\n"); + StrArrayClear(&commands); } if (flags & UNATTEND_OOBE_MASK) { - StrArray first_logon_commands = STRARRAY_EMPTY; - StrArrayCreate(&first_logon_commands, 8); fprintf(fd, " <settings pass=\"oobeSystem\">\n"); if (flags & UNATTEND_OOBE_SHELL_SETUP_MASK) { fprintf(fd, " <component name=\"Microsoft-Windows-Shell-Setup\" processorArchitecture=\"%s\" language=\"neutral\" " "xmlns:wcm=\"http://schemas.microsoft.com/WMIConfig/2002/State\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " "publicKeyToken=\"31bf3856ad364e35\" versionScope=\"nonSxS\">\n", xml_arch_names[arch]); // https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-oobe-protectyourpc - // It is really super insidous of Microsoft to call this option "ProtectYourPC", when it's really only about + // It is really super disingenuous of Microsoft to call this option "ProtectYourPC", when it's really only about // data collection. But of course, if it was called "AllowDataCollection", everyone would turn it off... if (flags & UNATTEND_NO_DATA_COLLECTION) { uprintf("• Disable data collection"); fprintf(fd, " <OOBE>\n"); + fprintf(fd, " <HideEULAPage>true</HideEULAPage>\n"); fprintf(fd, " <ProtectYourPC>3</ProtectYourPC>\n"); fprintf(fd, " </OOBE>\n"); } @@ -200,14 +341,13 @@ char* CreateUnattendXml(int arch, int flags) // Since we set a blank password, we'll ask the user to change it at next logon. // NB: In case you wanna try, please be aware that Microsoft doesn't let you have multiple // <FirstLogonCommands> sections in unattend.xml. Don't ask me how I know... :( - static_sprintf(tmp, "net user &quot;%s&quot; /logonpasswordchg:yes", unattend_username); - StrArrayAdd(&first_logon_commands, tmp, TRUE); + static_sprintf(tmp, "net user \"%s\" /logonpasswordchg:yes", unattend_username); + StrArrayAdd(&commands, tmp, TRUE); // The `net user` command above might reset the password expiration to 90 days... // To alleviate that, blanket set passwords on the target machine to never expire. - StrArrayAdd(&first_logon_commands, "net accounts /maxpwage:unlimited", TRUE); + StrArrayAdd(&commands, "net accounts /maxpwage:unlimited", TRUE); } } - // Apply SkuSiPolicy.p7b, if the user requested it and we're not creating a Windows To Go drive. // See https://support.microsoft.com/kb/5042562. We do it post install, on first logon, because // we'd have to patch tons of files otherwise. And we *ALWAYS* use the installed system's @@ -216,25 +356,25 @@ char* CreateUnattendXml(int arch, int flags) // produce the 0xc0000428 signature validation error on (re)boot if the system hasn't gone // through a full Windows Update cycle. if (flags & UNATTEND_APPLY_SKUSIPOLICY) { - StrArrayAdd(&first_logon_commands, "cmd /c mountvol S: /S &amp;&amp; " + uprintf("• Apply SkuSiPolicy.p7b"); + // TODO: Could we hide this using PowerShell? + StrArrayAdd(&commands, "cmd /c mountvol S: /S &amp;&amp; " "copy %WINDIR%\\system32\\SecureBootUpdates\\SkuSiPolicy.p7b S:\\EFI\\Microsoft\\Boot &amp;&amp; " "mountvol S: /D", TRUE); } - // Now that we have all the commands to run, create the FirstLogonCommands section. - for (order = 1; order <= (int)first_logon_commands.Index; order++) { + for (order = 1; order <= (int)commands.Index; order++) { if (order == 1) fprintf(fd, " <FirstLogonCommands>\n"); fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n"); fprintf(fd, " <Order>%d</Order>\n", order); - fprintf(fd, " <CommandLine>%s</CommandLine>\n", first_logon_commands.String[order - 1]); + fprintf(fd, " <CommandLine>%s</CommandLine>\n", commands.String[order - 1]); fprintf(fd, " </SynchronousCommand>\n"); - if (order == first_logon_commands.Index) + if (order == commands.Index) fprintf(fd, " </FirstLogonCommands>\n"); } - StrArrayDestroy(&first_logon_commands); - fprintf(fd, " </component>\n"); + StrArrayClear(&commands); } if (flags & UNATTEND_OOBE_INTERNATIONAL_MASK) { uprintf("• Use the same regional options as this user's"); @@ -294,6 +434,7 @@ char* CreateUnattendXml(int arch, int flags) if (flags & UNATTEND_USE_MS2023_BOOTLOADERS) uprintf("• Use 'Windows CA 2023' signed bootloaders"); + StrArrayDestroy(&commands); fprintf(fd, "</unattend>\n"); fclose(fd); return path; @@ -530,6 +671,86 @@ out: return ((img_report.win_version.major != 0) && (img_report.win_version.build != 0)); } +int GetEditions(StrArray* version_name, StrArray* version_index) +{ + int i, r, n = -1; + WIMStruct* wim = NULL; + const char* edition_suffix; + char *install_names[MAX_WININST], *edition_name; + wchar_t wim_path[4 * MAX_PATH] = L"", * xml = NULL; + size_t xml_len; + BOOL bNonStandard = FALSE; + ezxml_t index = NULL, image = NULL; + + // If we have multiple windows install images, ask the user the one to use + if (img_report.wininst_index > 1) { + for (i = 0; i < img_report.wininst_index; i++) + install_names[i] = &img_report.wininst_path[i][2]; + wininst_index = _log2(SelectionDialog(lmprintf(MSG_130), lmprintf(MSG_131), install_names, img_report.wininst_index)); + if (wininst_index < 0) + return -2; + if (wininst_index >= MAX_WININST) + wininst_index = 0; + } + + assert(utf8_to_wchar_get_size(image_path) <= ARRAYSIZE(wim_path)); + utf8_to_wchar_no_alloc(image_path, wim_path, ARRAYSIZE(wim_path)); + if (!img_report.is_windows_img) { + wcscat(wim_path, L"|"); + assert(utf8_to_wchar_get_size(image_path) + utf8_to_wchar_get_size(&img_report.wininst_path[wininst_index][2]) <= ARRAYSIZE(wim_path)); + utf8_to_wchar_no_alloc(&img_report.wininst_path[wininst_index][2], + &wim_path[wcslen(wim_path)], (int)ARRAYSIZE(wim_path) - wcslen(wim_path)); + } + + r = wimlib_open_wim(wim_path, 0, &wim); + if (r != 0) { + uprintf("Could not open WIM: %d", r); + goto out; + } + r = wimlib_get_xml_data(wim, (void**)&xml, &xml_len); + if (r != 0) { + uprintf("Could not read WIM XML index: %d", r); + goto out; + } + + index = ezxml_parse_str((char*)xml, xml_len); + if (index == NULL) { + uprintf("Could not parse WIM XML"); + goto out; + } + + edition_suffix = GetEditionName(WindowsVersion.Edition); + unattend_edition_index = 1; + for (n = 0, image = ezxml_child(index, "IMAGE"); + StrArrayAdd(version_index, ezxml_attr(image, "INDEX"), TRUE) >= 0; + image = image->next, n++) { + // Try to match this host's edition with an index from the image + edition_name = ezxml_child_val(image, "NAME"); + if (edition_name != NULL) { + if (strlen(edition_name) > safe_strlen(edition_suffix) && + stricmp(&edition_name[strlen(edition_name) - safe_strlen(edition_suffix)], edition_suffix) == 0) + unattend_edition_index = atoi(ezxml_attr(image, "INDEX")) - 1; + } + // Some people are apparently creating *unofficial* Windows ISOs that don't have DISPLAYNAME elements. + // If we are parsing such an ISO, try to fall back to using DESCRIPTION. + if (StrArrayAdd(version_name, ezxml_child_val(image, "DISPLAYNAME"), TRUE) < 0) { + if (StrArrayAdd(version_name, ezxml_child_val(image, "DESCRIPTION"), TRUE) < 0) { + uprintf("WARNING: Could not find a description for image index %d", n + 1); + StrArrayAdd(version_name, "Unknown Windows Version", TRUE); + } + bNonStandard = TRUE; + } + } + if (bNonStandard) + uprintf("WARNING: Nonstandard Windows image (missing <DISPLAYNAME> entries)"); + +out: + free(xml); + ezxml_free(index); + wimlib_free(wim); + return n; +} + /// <summary> /// Checks which versions of Windows are available in an install image /// to set our extraction index. Asks the user to select one if needed. @@ -773,7 +994,7 @@ BOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp) /// <param name="flags">A bitmap of unattend flags to apply.</param> /// <returns>TRUE on success, FALSE on error.</returns> BOOL ApplyWindowsCustomization(char drive_letter, int flags) -// NB: Work with a copy of unattend_xml_flags as a paremeter since we will modify it. +// NB: Work with a copy of unattend_xml_flags as a parameter since we will modify it. { BOOL r = FALSE, is_hive_mounted = FALSE, update_boot_wim = FALSE; int i, wim_index = 2, wuc_index = 0, num_replaced = 0; @@ -791,12 +1012,12 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) char path[MAX_PATH], *rep, *tmp_dir_end; uint8_t* buf = NULL; uint16_t setup_arch; - size_t len; + uint32_t len; HKEY hKey = NULL, hSubKey = NULL; LSTATUS status; DWORD dwDisp, dwVal = 1, dwSize; FILE* fd_md5sum; - WIMStruct* wim; + WIMStruct* wim = NULL; StrArray files; struct wimlib_update_command wuc[2] = { 0 }; @@ -845,7 +1066,7 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) dwSize = read_file(setup_exe, &buf); if (dwSize != 0) { setup_arch = GetPeArch(buf); - free(buf); + safe_free(buf); if (setup_arch != IMAGE_FILE_MACHINE_AMD64 && setup_arch != IMAGE_FILE_MACHINE_ARM64) { uprintf("WARNING: Unsupported arch 0x%x -- in-place upgrade wrapper will not be added", setup_arch); } else if (!MoveFileExU(setup_exe, setup_dll, 0)) { @@ -870,6 +1091,7 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) } else { uprintf("Could not create '%s' bypass wrapper", setup_exe); } + buf = NULL; } } } @@ -948,19 +1170,27 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) wuc[wuc_index].add.wim_target_path = L"Windows\\System32\\config\\SYSTEM"; wuc_index++; - // We were successfull in creating the keys so disable the windowsPE section from unattend.xml - // We do this by replacing '<settings pass="windowsPE">' with '<settings pass="disabled">' - // (provided that the registry key creation was the only item for this pass) + // We were successfull in creating the keys so remove this part from unattend.xml if ((flags & UNATTEND_WINPE_SETUP_MASK) == UNATTEND_SECUREBOOT_TPM_MINRAM) { + // If this is all we used the WindowsPE pass for, then we just replace + // '<settings pass="WindowsPE">' with '<settings pass="disabled">' if (replace_in_token_data(unattend_xml_path, "<settings", "windowsPE", "disabled", FALSE) == NULL) - uprintf("WARNING: Could not disable 'windowsPE' pass from unattend.xml"); - // Remove the flags, since we accomplished the registry creation outside of unattend. - flags &= ~UNATTEND_SECUREBOOT_TPM_MINRAM; + uprintf("WARNING: Could not disable 'WindowsPE' pass from unattend.xml"); } else { - // TODO: If we add other tasks besides LabConfig reg keys, we'll need to figure out how - // to comment out the <RunSynchronous> entries from windowsPE (and only windowsPE). - assert(FALSE); + // Otherwise, remove the relevant section from our temporary unattend.xml + len = read_file(unattend_xml_path, &buf); + if (len != 0 && removable_section[0] != 0 && removable_section[0] < len && removable_section[1] < len) { + memmove(&buf[removable_section[0]], &buf[removable_section[1]], len - removable_section[1]); + len -= removable_section[1] - removable_section[0]; + if (write_file(unattend_xml_path, buf, len) != len) + uprintf("Failed to remove 'WindowsPE' section from unattend.xml"); + } else { + uprintf("Failed to remove 'WindowsPE' section from unattend.xml"); + } + safe_free(buf); } + // Remove the flags, since we accomplished the registry creation outside of unattend. + flags &= ~UNATTEND_SECUREBOOT_TPM_MINRAM; UpdateProgressWithInfoForce(OP_PATCH, MSG_325, 102, PATCH_PROGRESS_TOTAL); } @@ -1016,7 +1246,7 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) WIMLIB_EXTRACT_FLAG_NO_ACLS | WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE) != 0) { uprintf("Could not extract 2023 signed UEFI bootloaders - Ignoring option"); } else { - len = strlen(tmp_path[1]); + len = (uint32_t)strlen(tmp_path[1]); tmp_dir_end = &tmp_path[1][len]; // Copy/override the Font files From d4d537fc5baf5ae7dd51d7971f1466907e90c9bd Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 11 Mar 2026 15:47:06 +0000 Subject: [PATCH 129/192] [uefi] change the name of the UEFI:NTFS partition to RUFUS_BOOT * This should make it more explicit to Windows users to identify the installation media. * Also update crazy-max/ghaction-upx to latest (Closes #2936). * Also fix a Coverity warning and use improve StrArray handling/init. --- .github/workflows/vs2022.yml | 2 +- res/uefi/readme.txt | 8 +++++--- res/uefi/uefi-ntfs.img | Bin 1048576 -> 1048576 bytes src/dev.c | 2 +- src/drive.c | 2 +- src/rufus.h | 1 - src/rufus.rc | 10 +++++----- src/wue.c | 6 +++--- 8 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/vs2022.yml b/.github/workflows/vs2022.yml index 228a11aa..f19f80d3 100644 --- a/.github/workflows/vs2022.yml +++ b/.github/workflows/vs2022.yml @@ -51,7 +51,7 @@ jobs: msbuild-architecture: x64 - name: Install UPX - uses: crazy-max/ghaction-upx@v3 + uses: crazy-max/ghaction-upx@v4 with: install-only: true diff --git a/res/uefi/readme.txt b/res/uefi/readme.txt index 76fb335d..bf8f3f26 100644 --- a/res/uefi/readme.txt +++ b/res/uefi/readme.txt @@ -25,10 +25,12 @@ o Secure Boot signed UEFI:NTFS bootloader binaries [3]. The above means that, if booting an NTFS partition on an x86_32, x86_64 or ARM64 system, Secure Boot does not need to be disabled. -The FAT partition was created on Debian GNU/Linux using the following commands +The FAT partition was created on Debian GNU/Linux using the following commands: dd if=/dev/zero of=uefi-ntfs.img bs=512 count=2048 - mkfs.vfat -n UEFI_NTFS uefi-ntfs.img -and then mounting the uefi-ntfs.img image and copying the relevant files. + chown 1000:100 uefi-ntfs.img + mkfs.vfat -n RUFUS_BOOT uefi-ntfs.img + mount -t vfat uefi-ntfs.img /mnt/hd -o rw,uid=1000,gid=100 +and then copying the relevant files. [1] https://github.com/pbatard/ntfs-3g [2] https://github.com/pbatard/efifs diff --git a/res/uefi/uefi-ntfs.img b/res/uefi/uefi-ntfs.img index 57deaef7e4ff03874ee4f014797b66e45f7e3f5f..d9ff7dc606ea992c208a9676ec1c763d63eca084 100644 GIT binary patch delta 505 zcmZo@aA;_7n4r!#_1YPUpisBa;CLs0|B#KQr#TG~Tm=pWhEqK0G3hZ7ngI-4-8>bb zK!CyQCQtfgLoOSES#Mwp6Kn%^Gj816$W`w?@dC@FAYL7iBCsJKni*_}o*v8$1&ARq z`N@_+CTtK5lZ%6__$*+0PbHQ_I|EI1Wydg*g^-a^2qUAc*v!F3PTq`QevYydgj*Cf zF)+rM!J!6d*CDp1q-{xzydQMnvLL<AnD!ydPqz$W3SqMZ+cJG}5R(;*eL09Jip>fl zZX660hq8-7Y-@=4W+e7!5ZeZ-K7`3i2*L)&hHdzdumZ*lVN5_rHnO%wF||c8w?(nE lMFH7tZBguPQ5<bioNZBDZBg89Q9Nx?ylqi@%cA&~0RV|RmfrvX delta 505 zcmZo@aA;_7n4r$LfPVp7sH>Z2ykCf0u);>u)0~C~t^x-G1Mlp>n7|ka%>V{K)e2A` zz#t+tJ8-fgmyJNHDpcXA1lxe!j2kyMa@D&}yudOkh*t-s2y6(5W(FIgrw21b0b&SD zezIkd37aTb!{p*1E53TTxrrsw&OlRL*+E7^Q~=!tQptj8B(nTu%P54AQC4g<U?V4Q z1~O|Q%+FC)f^{&9q9z8$7&AE30PQ-&)|9j@iIMk%4%`_aRnD09A<Iv<3}OmlYXF-! zeR2?!6^wm3h$)J#5h89J3>0sIu#1t{n?dYmi1=qDws8oPl~4;<9O!G?@E>6Xj2FU~ zfR1crZHr=Ri(+nzVrh#4vf0|A*xRBw+M+nyqPW_kxZ9$5+M;;dqWG3Y@h<}a%=nIZ diff --git a/src/dev.c b/src/dev.c index f5d5ece6..c8bee183 100644 --- a/src/dev.c +++ b/src/dev.c @@ -476,7 +476,7 @@ BOOL GetDevices(DWORD devnum) const char* bitdefender_label = "Bitdefender Partition"; // Hash table and String Array used to match a Device ID with the parent hub's Device Interface Path htab_table htab_devid = HTAB_EMPTY; - StrArray dev_if_path = STRARRAY_EMPTY; + StrArray dev_if_path = { 0 }; char letter_name[] = " (?:)"; char drive_name[] = "?:\\"; char setting_name[32]; diff --git a/src/drive.c b/src/drive.c index 798db108..8c398ab1 100644 --- a/src/drive.c +++ b/src/drive.c @@ -1944,7 +1944,7 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys if (buf != NULL) { if (SetFilePointerEx(hPhysical, DriveLayout->PartitionEntry[i].StartingOffset, NULL, FILE_BEGIN) && ReadFile(hPhysical, buf, SelectedDrive.SectorSize, &size, NULL)) { - isUefiNtfs = (strncmp(&buf[0x2B], "UEFI_NTFS", 9) == 0); + isUefiNtfs = (strncmp(&buf[0x2B], "UEFI_NTFS", 9) == 0) || (strncmp(&buf[0x2B], "RUFUS_BOOT", 10) == 0); } free(buf); } diff --git a/src/rufus.h b/src/rufus.h index 401769eb..b86c5757 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -735,7 +735,6 @@ typedef struct { uint32_t Index; // Current array size uint32_t Max; // Maximum array size } StrArray; -#define STRARRAY_EMPTY { NULL, 0, 0 }; extern void StrArrayCreate(StrArray* arr, uint32_t initial_size); extern int32_t StrArrayAdd(StrArray* arr, const char* str, BOOL); extern int32_t StrArrayAddUnique(StrArray* arr, const char* str, BOOL); diff --git a/src/rufus.rc b/src/rufus.rc index 967272f0..b867f998 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.14.2319" +CAPTION "Rufus 4.14.2320" 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,14,2319,0 - PRODUCTVERSION 4,14,2319,0 + FILEVERSION 4,14,2320,0 + PRODUCTVERSION 4,14,2320,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.14.2319" + VALUE "FileVersion", "4.14.2320" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2319" + VALUE "ProductVersion", "4.14.2320" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index 6e8d68c4..9d7d6c0b 100644 --- a/src/wue.c +++ b/src/wue.c @@ -115,8 +115,7 @@ char* CreateUnattendXml(int arch, int flags) TIME_ZONE_INFORMATION tz_info; int i, order; unattend_xml_flags = flags; - StrArray commands = STRARRAY_EMPTY; - StrArrayCreate(&commands, 8); + StrArray commands = { 0 }; if (arch < ARCH_X86_32 || arch > ARCH_ARM_64 || flags == 0) { uprintf("Note: No Windows User Experience options selected"); return NULL; @@ -133,6 +132,7 @@ char* CreateUnattendXml(int arch, int flags) fprintf(fd, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); fprintf(fd, "<unattend xmlns=\"urn:schemas-microsoft-com:unattend\">\n"); + StrArrayCreate(&commands, 8); if (flags & UNATTEND_WINPE_SETUP_MASK) { fprintf(fd, " <settings pass=\"windowsPE\">\n"); fprintf(fd, " <component name=\"Microsoft-Windows-Setup\" processorArchitecture=\"%s\" language=\"neutral\" " @@ -1018,7 +1018,6 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) DWORD dwDisp, dwVal = 1, dwSize; FILE* fd_md5sum; WIMStruct* wim = NULL; - StrArray files; struct wimlib_update_command wuc[2] = { 0 }; assert(unattend_xml_path != NULL); @@ -1246,6 +1245,7 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) WIMLIB_EXTRACT_FLAG_NO_ACLS | WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE) != 0) { uprintf("Could not extract 2023 signed UEFI bootloaders - Ignoring option"); } else { + StrArray files; len = (uint32_t)strlen(tmp_path[1]); tmp_dir_end = &tmp_path[1][len]; From 8db609d0ef8eb7d42969a5803922d746007ea61e Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 13 Mar 2026 23:15:27 +0000 Subject: [PATCH 130/192] [wue] add a new 'QoL Enhancements' option * This option disables most of the unwanted crap that Microsoft tries to push onto users by default. * Also make sure the Silent Install option is only enabled if the 'Disable data collection' check box is checked. * Also add a big scary warning for the Silent Install option. --- res/loc/rufus.loc | 7 ++++- src/rufus.c | 19 +++++++------- src/rufus.h | 10 +++++--- src/rufus.rc | 10 ++++---- src/stdlg.c | 13 +++++++--- src/wue.c | 65 ++++++++++++++++++++++++++++++++++++++++++++--- 6 files changed, 99 insertions(+), 25 deletions(-) diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 8c04063f..58ffc1f2 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -578,7 +578,7 @@ t MSG_321 "The image you have selected is an ISOHybrid, but its creators have no "copy mode.\nAs a result, DD image writing mode will be enforced." t MSG_322 "Unable to open or read '%s'" t MSG_323 "Apply SkuSiPolicy.p7b on installation (See KB5042562)" -t MSG_324 "⚠SILENTLY⚠ erase disk and install:" +t MSG_324 "QoL Improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" t MSG_325 "Applying Windows customization: %s" t MSG_326 "Applying user options..." t MSG_327 "Windows User Experience" @@ -619,6 +619,11 @@ t MSG_354 "Rufus has found an updated version of the DBX files used to perform U "- Select 'Yes' to connect to the Internet and download this content\n" "- Select 'No' to cancel the operation\n\n" "Note: The files will be downloaded in the application's directory and will be reused automatically if present." +t MSG_355 "⚠SILENTLY⚠ erase disk and install:" +t MSG_356 "You have selected to use the \"silent\" Windows installation option.\n\n" + "This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the " + "first detected disk on the target system, without asking. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n\nIf this is not what you want, " + "please select 'No' to go back and uncheck the option.\nOtherwise, if you agree that the whole responsibility for any data loss will be entirely with YOU, select 'Yes'." # The following messages are for the Windows Store listing only and are not used by the application t MSG_900 "Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc." t MSG_901 "Official site: %s" diff --git a/src/rufus.c b/src/rufus.c index 790da244..67409f95 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1503,7 +1503,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) const char* syslinux = "syslinux"; const char* ldlinux_ext[3] = { "sys", "bss", "c32" }; char tmp[MAX_PATH], tmp2[MAX_PATH], c; - selection_dialog_options_t selection_options = { 0, -1, -1, -1 }; + selection_dialog_options_t selection_options = { 0, -1, -1, -1, -1 }; syslinux_ldlinux_len[0] = 0; syslinux_ldlinux_len[1] = 0; safe_free(grub2_buf); @@ -1684,21 +1684,22 @@ static DWORD WINAPI BootCheckThread(LPVOID param) selection_options.regional_index = _log2(b); MAP_BIT(UNATTEND_DUPLICATE_LOCALE); StrArrayAdd(&options, lmprintf(MSG_331), TRUE); + selection_options.privacy_index = _log2(b); MAP_BIT(UNATTEND_NO_DATA_COLLECTION); if (IS_WINDOWS_11(img_report)) { StrArrayAdd(&options, lmprintf(MSG_335), TRUE); MAP_BIT(UNATTEND_DISABLE_BITLOCKER); - } - if (img_report.win_version.build >= 26200) { - StrArrayAdd(&options, lmprintf(MSG_350), TRUE); - MAP_BIT(UNATTEND_USE_MS2023_BOOTLOADERS); - StrArrayAdd(&options, lmprintf(MSG_323), TRUE); - MAP_BIT(UNATTEND_APPLY_SKUSIPOLICY); - } - if (IS_WINDOWS_11(img_report)) { StrArrayAdd(&options, lmprintf(MSG_324), TRUE); + MAP_BIT(UNATTEND_QOL_ENHANCEMENTS); + StrArrayAdd(&options, lmprintf(MSG_355), TRUE); selection_options.edition_index = _log2(b); MAP_BIT(UNATTEND_SILENT_INSTALL); + if (img_report.win_version.build >= 26200) { + StrArrayAdd(&options, lmprintf(MSG_350), TRUE); + MAP_BIT(UNATTEND_USE_MS2023_BOOTLOADERS); + StrArrayAdd(&options, lmprintf(MSG_323), TRUE); + MAP_BIT(UNATTEND_APPLY_SKUSIPOLICY); + } } if (expert_mode) { StrArrayAdd(&options, lmprintf(MSG_346), TRUE); diff --git a/src/rufus.h b/src/rufus.h index b86c5757..8a730fbf 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -513,6 +513,7 @@ typedef struct { int username_index; int edition_index; int regional_index; + int privacy_index; } selection_dialog_options_t; /* @@ -695,16 +696,17 @@ typedef struct { #define UNATTEND_USE_MS2023_BOOTLOADERS 0x00200 #define UNATTEND_APPLY_SKUSIPOLICY 0x00400 #define UNATTEND_SILENT_INSTALL 0x00800 -#define UNATTEND_FULL_MASK 0x00FFF -#define UNATTEND_DEFAULT_MASK 0x006FF // Mask of values that are persisted +#define UNATTEND_QOL_ENHANCEMENTS 0x01000 +#define UNATTEND_FULL_MASK 0x01FFF +#define UNATTEND_DEFAULT_MASK 0x016FF // Mask of values that are persisted #define UNATTEND_WINDOWS_TO_GO 0x10000 // Special flag for Windows To Go #define UNATTEND_WINPE_SETUP_MASK (UNATTEND_SECUREBOOT_TPM_MINRAM | UNATTEND_SILENT_INSTALL) -#define UNATTEND_SPECIALIZE_DEPLOYMENT_MASK (UNATTEND_NO_ONLINE_ACCOUNT) +#define UNATTEND_SPECIALIZE_DEPLOYMENT_MASK (UNATTEND_NO_ONLINE_ACCOUNT | UNATTEND_QOL_ENHANCEMENTS) #define UNATTEND_OOBE_SHELL_SETUP_MASK (UNATTEND_NO_DATA_COLLECTION | UNATTEND_SET_USER | UNATTEND_DUPLICATE_LOCALE) #define UNATTEND_OOBE_INTERNATIONAL_MASK (UNATTEND_DUPLICATE_LOCALE) #define UNATTEND_OOBE_MASK (UNATTEND_OOBE_SHELL_SETUP_MASK | UNATTEND_OOBE_INTERNATIONAL_MASK | UNATTEND_DISABLE_BITLOCKER | \ - UNATTEND_USE_MS2023_BOOTLOADERS | UNATTEND_APPLY_SKUSIPOLICY) + UNATTEND_USE_MS2023_BOOTLOADERS | UNATTEND_APPLY_SKUSIPOLICY | UNATTEND_QOL_ENHANCEMENTS) #define UNATTEND_OFFLINE_SERVICING_MASK (UNATTEND_OFFLINE_INTERNAL_DRIVES | UNATTEND_FORCE_S_MODE) #define UNATTEND_DEFAULT_SELECTION_MASK (UNATTEND_SECUREBOOT_TPM_MINRAM | UNATTEND_NO_ONLINE_ACCOUNT | UNATTEND_OFFLINE_INTERNAL_DRIVES) diff --git a/src/rufus.rc b/src/rufus.rc index b867f998..7afe85db 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.14.2320" +CAPTION "Rufus 4.14.2321" 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,14,2320,0 - PRODUCTVERSION 4,14,2320,0 + FILEVERSION 4,14,2321,0 + PRODUCTVERSION 4,14,2321,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.14.2320" + VALUE "FileVersion", "4.14.2321" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2320" + VALUE "ProductVersion", "4.14.2321" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index 38bd7cb3..76fe3193 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -1014,11 +1014,13 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM case WM_COMMAND: WORD command = LOWORD(wParam); if (command >= IDC_SELECTION_CHOICE1 && command < IDC_SELECTION_CHOICEMAX) { - // Check if the local account name or regional settings checkbox was clicked and enable/disable the silent install option + // Check if local account + regional settings + data collection checkboxes are clicked and enable/disable the silent install option if (selection_options != NULL && selection_options->username_index > 0 && selection_options->edition_index > 0 && selection_options->regional_index > 0 && - (command - IDC_SELECTION_CHOICE1 == selection_options->username_index || command - IDC_SELECTION_CHOICE1 == selection_options->regional_index)) { + (command - IDC_SELECTION_CHOICE1 == selection_options->username_index || command - IDC_SELECTION_CHOICE1 == selection_options->regional_index || + command - IDC_SELECTION_CHOICE1 == selection_options->privacy_index)) { BOOL enable = Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->username_index)) && - Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->regional_index)); + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->regional_index)) && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->privacy_index)); hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->edition_index); if (!enable && IsWindowEnabled(hCtrl)) { silent_install_checked = (Button_GetCheck(hCtrl) == BST_CHECKED); @@ -1031,6 +1033,11 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM } } else switch (LOWORD(wParam)) { case IDOK: + // Produce a big scary warning if the silent install option was selected + if (selection_options != NULL && selection_options->edition_index >= 0 && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->edition_index)) && + Notification(MB_YESNO | MB_ICONWARNING, APPLICATION_NAME, lmprintf(MSG_356)) != IDYES) + break; for (r = 0, i = 0, m = 1; i < nDialogItems; i++, m <<= 1) if (Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i)) == BST_CHECKED) r += m; diff --git a/src/wue.c b/src/wue.c index 9d7d6c0b..e9e5f995 100644 --- a/src/wue.c +++ b/src/wue.c @@ -132,7 +132,7 @@ char* CreateUnattendXml(int arch, int flags) fprintf(fd, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); fprintf(fd, "<unattend xmlns=\"urn:schemas-microsoft-com:unattend\">\n"); - StrArrayCreate(&commands, 8); + StrArrayCreate(&commands, 16); if (flags & UNATTEND_WINPE_SETUP_MASK) { fprintf(fd, " <settings pass=\"windowsPE\">\n"); fprintf(fd, " <component name=\"Microsoft-Windows-Setup\" processorArchitecture=\"%s\" language=\"neutral\" " @@ -261,9 +261,23 @@ char* CreateUnattendXml(int arch, int flags) // This part was picked from https://github.com/AveYo/MediaCreationTool.bat/blob/main/bypass11/AutoUnattend.xml // NB: This is INCOMPATIBLE with S-Mode below if (flags & UNATTEND_NO_ONLINE_ACCOUNT) { - StrArrayAdd(&commands, "reg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\OOBE\" /v BypassNRO /t REG_DWORD /d 1 /f", TRUE); + StrArrayAdd(&commands, "reg add \"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\OOBE\" /v BypassNRO /t REG_DWORD /d 1 /f", TRUE); uprintf("• Bypass online account requirement"); } + if (flags & UNATTEND_QOL_ENHANCEMENTS) { + uprintf("• QoL: Disable OneDrive and Outlook by default"); + // Remove OneDrive + StrArrayAdd(&commands, "reg add \"HKLM\\Software\\Policies\\Microsoft\\Windows\\OneDrive\" /v DisableFileSyncNGSC /t REG_DWORD /d 1 /f", TRUE); + StrArrayAdd(&commands, "PowerShell -NonInteractive -WindowStyle Hidden -Command " + "\"Remove-Item -Path $env:SystemRoot\\System32\\OneDriveSetup.exe -Force -Confirm:$false;" + "\"Remove-Item -Path $env:SystemRoot\\SysWOW64\\OneDriveSetup.exe -Force -Confirm:$false;", TRUE); + // Remove Outlook. How the frig is forcing Outlook on users legal when MS got pinned for bundling IE with Windows? + StrArrayAdd(&commands, "PowerShell -NonInteractive -WindowStyle Hidden -Command " + "\"Get-AppxProvisionedPackage -Online | Where-Object {$_.PackageName -like '*OutlookForWindows*'} |" + " Remove-AppxProvisionedPackage -Online\"", TRUE); + StrArrayAdd(&commands, "PowerShell -NonInteractive -WindowStyle Hidden -Command " + "\"Get-AppxPackage -AllUsers *OutlookForWindows* | Remove-AppxPackage -AllUsers\"", TRUE); + } // Now that we have all the commands to run, create the RunSynchronous section. for (order = 1; order <= (int)commands.Index; order++) { if (order == 1) @@ -362,6 +376,51 @@ char* CreateUnattendXml(int arch, int flags) "copy %WINDIR%\\system32\\SecureBootUpdates\\SkuSiPolicy.p7b S:\\EFI\\Microsoft\\Boot &amp;&amp; " "mountvol S: /D", TRUE); } + if (flags & UNATTEND_QOL_ENHANCEMENTS) { + uprintf("• QoL: Disable Fast Startup, Copilot, Recommendations, News and Teams by default"); + // Disable Fast Startup + StrArrayAdd(&commands, "reg add \"HKLM\\System\\CurrentControlSet\\Control\\Session Manager\\Power\" " + "/v HiberbootEnabled /t REG_DWORD /d 0 /f", TRUE); + // Disable Copilot and set search as an icon rather than the default real-estate gobbler + StrArrayAdd(&commands, "reg add \"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" " + "/v ShowCopilotButton /t REG_DWORD /d 0 /f", TRUE); + StrArrayAdd(&commands, "reg add \"HKLM\\Software\\Policies\\Microsoft\\Windows\\WindowsCopilot\" " + "/v TurnOffWindowsCopilot /t REG_DWORD /d 1 /f", TRUE); + StrArrayAdd(&commands, "reg add \"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Search\" " + "/v SearchboxTaskbarMode /t REG_DWORD /d 1 /f", TRUE); + StrArrayAdd(&commands, "reg add \"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Search\" " + "/v SearchboxTaskbarModeCache /t REG_DWORD /d 1 /f", TRUE); + // Disable Windows Phone and similarly pushed unwanted crap + StrArrayAdd(&commands, "reg add \"HKLM\\Software\\Policies\\Microsoft\\Windows\\CloudContent\" " + "/v DisableWindowsConsumerFeatures /t REG_DWORD /d 1 /f", TRUE); + // Disable News + StrArrayAdd(&commands, "reg add \"HKLM\\Software\\Policies\\Microsoft\\Dsh\" " + "/v AllowNewsAndInterests /t REG_DWORD /d 0 /f", TRUE); + StrArrayAdd(&commands, "reg add \"HKLM\\Software\\Policies\\Microsoft\\Windows\\Windows Feeds\" " + "/v EnableFeeds /t REG_DWORD /d 0 /f", TRUE); + // Disable Teams + StrArrayAdd(&commands, "reg add \"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Communications\" " + "/v ConfigureChatAutoInstall /t REG_DWORD /d 0 /f", TRUE); + // Prevent frigging Outlook from being forced into the user's taskbar + StrArrayAdd(&commands, "reg add \"HKLM\\Software\\Policies\\Microsoft\\Windows\\CloudContent\" " + "/v DisableCloudOptimizedContent /t REG_DWORD /d 1 /f", TRUE); + // Skip Edge's first run dialog + StrArrayAdd(&commands, "reg add \"HKLM\\Software\\Policies\\Microsoft\\Edge\" " + "/v HideFirstRunExperience /t REG_DWORD /d 1 /f", TRUE); + uprintf("• QoL: More pins for the Start Menu and enable useful shortcuts"); + // More pins by default on the Start Menu + // https://learn.microsoft.com/en-us/windows/apps/develop/settings/settings-windows-11 + StrArrayAdd(&commands, "reg add \"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" " + "/v Start_Layout /t REG_DWORD /d 1 /f", TRUE); + // Add Documents, Downloads, Network, Personal Folder, File Explorer and Settings as start menu shortcuts + // I wish there was a more transparent way of doing it, but Microsoft made it obscure. Oh, and for some + // reason, feeding the full hex string through 'reg add' doesn't create the key when ran through unattend + // (but doesn't produce an error and works post logon). PowerShell it is then... + StrArrayAdd(&commands, "PowerShell -NonInteractive -WindowStyle Hidden -Command " + "\"Set-ItemProperty -Path 'Registry::HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Start' " + "-Name 'VisiblePlaces' -Value $([convert]::FromBase64String('ztU0LVr6Q0WC8iLm6vd3PC+zZ+PeiVVDv85h83sYqTe8JIo" + "UDNaJQqCAbtm7okiCRIF1/g0IrkKL2jTtl7ZjlEqwvXRK+WhPi9ZDmAcdqLyGCHNSqlFDQp97J3ZYRlnU')) -Type 'Binary'\"", TRUE); + } // Now that we have all the commands to run, create the FirstLogonCommands section. for (order = 1; order <= (int)commands.Index; order++) { if (order == 1) @@ -395,7 +454,7 @@ char* CreateUnattendXml(int arch, int flags) fprintf(fd, " </component>\n"); } if (flags & UNATTEND_DISABLE_BITLOCKER) { - uprintf("• Disable bitlocker"); + uprintf("• Disable BitLocker"); fprintf(fd, " <component name=\"Microsoft-Windows-SecureStartup-FilterDriver\" processorArchitecture=\"%s\" language=\"neutral\" " "xmlns:wcm=\"http://schemas.microsoft.com/WMIConfig/2002/State\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " "publicKeyToken=\"31bf3856ad364e35\" versionScope=\"nonSxS\">\n", xml_arch_names[arch]); From 92a8926c18ba6ab56c01422123cbe886ce9f964f Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Sun, 15 Mar 2026 13:25:36 +0000 Subject: [PATCH 131/192] [misc] clean up and refactor internal dialog handling * Group the static elements in dialog-specific structs. * Use 0 rather than -1 for unset elements. * Also fix initial checkbox value for Silent Install not being properly set. --- src/rufus.c | 92 +++++++++-------- src/rufus.h | 23 ++--- src/rufus.rc | 10 +- src/stdlg.c | 272 +++++++++++++++++++++++++++------------------------ src/wue.c | 33 ++++--- 5 files changed, 230 insertions(+), 200 deletions(-) diff --git a/src/rufus.c b/src/rufus.c index 67409f95..f5699c63 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -96,7 +96,6 @@ extern HIMAGELIST hUpImageList, hDownImageList; extern BOOL enable_iso, enable_joliet, enable_rockridge, enable_extra_hashes; extern BOOL validate_md5sum, cpu_has_sha1_accel, cpu_has_sha256_accel, toggle_dark_mode; extern BYTE* fido_script; -extern HWND hFidoDlg; extern uint8_t* grub2_buf; extern long grub2_len; extern char* szStatusMessage; @@ -122,7 +121,7 @@ WORD selected_langid = MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT); DWORD MainThreadId; USHORT NativeMachine = IMAGE_FILE_MACHINE_UNKNOWN; HWND hDeviceList, hPartitionScheme, hTargetSystem, hFileSystem, hClusterSize, hLabel, hBootType, hNBPasses, hLog = NULL; -HWND hImageOption, hLogDialog = NULL, hProgress = NULL; +HWND hImageOption, hLogDialog = NULL, hProgress = NULL, hFidoDlg = NULL; HANDLE dialog_handle = NULL, format_thread = NULL; BOOL is_x86_64, use_own_c32[NB_OLD_C32] = { FALSE, FALSE }, mbr_selected_by_user = FALSE, lock_drive = TRUE; BOOL op_in_progress = TRUE, right_to_left_mode = FALSE, has_uefi_csm = FALSE, its_a_me_mario = FALSE; @@ -1503,7 +1502,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) const char* syslinux = "syslinux"; const char* ldlinux_ext[3] = { "sys", "bss", "c32" }; char tmp[MAX_PATH], tmp2[MAX_PATH], c; - selection_dialog_options_t selection_options = { 0, -1, -1, -1, -1 }; + selection_dialog_options_t selection = { 0 }; syslinux_ldlinux_len[0] = 0; syslinux_ldlinux_len[1] = 0; safe_free(grub2_buf); @@ -1550,19 +1549,25 @@ static DWORD WINAPI BootCheckThread(LPVOID param) // but only do so if persistence has not been selected. char* iso_image = lmprintf(MSG_036); char* dd_image = lmprintf(MSG_095); + StrArrayCreate(&selection.choices, 4); // If the ISO is small enough to be written as an ESP and we are using GPT add the ISO → ESP option if ((img_report.projected_size < MAX_ISO_TO_ESP_SIZE) && HAS_REGULAR_EFI(img_report) && (partition_type == PARTITION_STYLE_GPT) && IS_FAT(fs_type)) { - char* choices[3] = { lmprintf(MSG_276, iso_image), lmprintf(MSG_277, "ISO → ESP"), lmprintf(MSG_277, dd_image) }; - i = SelectionDialog(lmprintf(MSG_274, "ISOHybrid"), lmprintf(MSG_275, iso_image, dd_image, iso_image, dd_image), choices, 3); + StrArrayAdd(&selection.choices, lmprintf(MSG_276, iso_image), TRUE); + StrArrayAdd(&selection.choices, lmprintf(MSG_277, "ISO → ESP"), TRUE); + StrArrayAdd(&selection.choices, lmprintf(MSG_277, dd_image), TRUE); + i = SelectionDialog(lmprintf(MSG_274, "ISOHybrid"), lmprintf(MSG_275, iso_image, dd_image, iso_image, dd_image), &selection); + StrArrayDestroy(&selection.choices); if (i < 0) // Cancel goto out; write_as_esp = (i & 2); write_as_image = (i & 4); esp_already_asked = TRUE; } else { - char* choices[2] = { lmprintf(MSG_276, iso_image), lmprintf(MSG_277, dd_image) }; - i = SelectionDialog(lmprintf(MSG_274, "ISOHybrid"), lmprintf(MSG_275, iso_image, dd_image, iso_image, dd_image), choices, 2); + StrArrayAdd(&selection.choices, lmprintf(MSG_276, iso_image), TRUE); + StrArrayAdd(&selection.choices, lmprintf(MSG_277, dd_image), TRUE); + i = SelectionDialog(lmprintf(MSG_274, "ISOHybrid"), lmprintf(MSG_275, iso_image, dd_image, iso_image, dd_image), &selection); + StrArrayDestroy(&selection.choices); if (i < 0) // Cancel goto out; write_as_image = (i & 2); @@ -1600,31 +1605,30 @@ static DWORD WINAPI BootCheckThread(LPVOID param) break; } if ((WindowsVersion.Version >= WINDOWS_8) && IS_WINDOWS_1X(img_report)) { - StrArray options; int arch = _log2(img_report.has_efi >> 1); uint16_t map[16] = { 0 }, b = 1; - StrArrayCreate(&options, 8); - StrArrayAdd(&options, lmprintf(MSG_332), TRUE); + StrArrayCreate(&selection.choices, 8); + StrArrayAdd(&selection.choices, lmprintf(MSG_332), TRUE); MAP_BIT(UNATTEND_OFFLINE_INTERNAL_DRIVES); if (img_report.win_version.build >= 22500) { - StrArrayAdd(&options, lmprintf(MSG_330), TRUE); + StrArrayAdd(&selection.choices, lmprintf(MSG_330), TRUE); MAP_BIT(UNATTEND_NO_ONLINE_ACCOUNT); } - StrArrayAdd(&options, lmprintf(MSG_333), TRUE); - selection_options.username_index = _log2(b); + StrArrayAdd(&selection.choices, lmprintf(MSG_333), TRUE); + selection.username_index = _log2(b); MAP_BIT(UNATTEND_SET_USER); - StrArrayAdd(&options, lmprintf(MSG_334), TRUE); + StrArrayAdd(&selection.choices, lmprintf(MSG_334), TRUE); MAP_BIT(UNATTEND_DUPLICATE_LOCALE); - StrArrayAdd(&options, lmprintf(MSG_331), TRUE); + StrArrayAdd(&selection.choices, lmprintf(MSG_331), TRUE); MAP_BIT(UNATTEND_NO_DATA_COLLECTION); if (expert_mode) { - StrArrayAdd(&options, lmprintf(MSG_346), TRUE); + StrArrayAdd(&selection.choices, lmprintf(MSG_346), TRUE); MAP_BIT(UNATTEND_FORCE_S_MODE); } - selection_options.mask = remap16(unattend_xml_mask, map, FALSE); - i = CustomSelectionDialog(BS_AUTOCHECKBOX, lmprintf(MSG_327), lmprintf(MSG_328), - options.String, options.Index, &selection_options); - StrArrayDestroy(&options); + selection.mask = remap16(unattend_xml_mask, map, FALSE); + selection.style = BS_AUTOCHECKBOX; + i = SelectionDialog(lmprintf(MSG_327), lmprintf(MSG_328), &selection); + StrArrayDestroy(&selection.choices); if (i < 0) goto out; // Remap i to the correct bit positions before calling CreateUnattendXml() @@ -1665,50 +1669,49 @@ static DWORD WINAPI BootCheckThread(LPVOID param) uprintf("NOTICE: A '/sources/$OEM$/$$/Panther/unattend.xml' was detected on the ISO."); uprintf("As a result, the 'Windows User Experience dialog' will not be displayed."); } else { - StrArray options; int arch = _log2(img_report.has_efi >> 1); uint16_t map[16] = { 0 }, b = 1; - StrArrayCreate(&options, 10); + StrArrayCreate(&selection.choices, 16); if (IS_WINDOWS_11(img_report)) { - StrArrayAdd(&options, lmprintf(MSG_329), TRUE); + StrArrayAdd(&selection.choices, lmprintf(MSG_329), TRUE); MAP_BIT(UNATTEND_SECUREBOOT_TPM_MINRAM); } if (img_report.win_version.build >= 22500) { - StrArrayAdd(&options, lmprintf(MSG_330), TRUE); + StrArrayAdd(&selection.choices, lmprintf(MSG_330), TRUE); MAP_BIT(UNATTEND_NO_ONLINE_ACCOUNT); } - StrArrayAdd(&options, lmprintf(MSG_333), TRUE); - selection_options.username_index = _log2(b); + StrArrayAdd(&selection.choices, lmprintf(MSG_333), TRUE); + selection.username_index = _log2(b); MAP_BIT(UNATTEND_SET_USER); - StrArrayAdd(&options, lmprintf(MSG_334), TRUE); - selection_options.regional_index = _log2(b); + StrArrayAdd(&selection.choices, lmprintf(MSG_334), TRUE); + selection.regional_index = _log2(b); MAP_BIT(UNATTEND_DUPLICATE_LOCALE); - StrArrayAdd(&options, lmprintf(MSG_331), TRUE); - selection_options.privacy_index = _log2(b); + StrArrayAdd(&selection.choices, lmprintf(MSG_331), TRUE); + selection.privacy_index = _log2(b); MAP_BIT(UNATTEND_NO_DATA_COLLECTION); if (IS_WINDOWS_11(img_report)) { - StrArrayAdd(&options, lmprintf(MSG_335), TRUE); + StrArrayAdd(&selection.choices, lmprintf(MSG_335), TRUE); MAP_BIT(UNATTEND_DISABLE_BITLOCKER); - StrArrayAdd(&options, lmprintf(MSG_324), TRUE); + StrArrayAdd(&selection.choices, lmprintf(MSG_324), TRUE); MAP_BIT(UNATTEND_QOL_ENHANCEMENTS); - StrArrayAdd(&options, lmprintf(MSG_355), TRUE); - selection_options.edition_index = _log2(b); + StrArrayAdd(&selection.choices, lmprintf(MSG_355), TRUE); + selection.edition_index = _log2(b); MAP_BIT(UNATTEND_SILENT_INSTALL); if (img_report.win_version.build >= 26200) { - StrArrayAdd(&options, lmprintf(MSG_350), TRUE); + StrArrayAdd(&selection.choices, lmprintf(MSG_350), TRUE); MAP_BIT(UNATTEND_USE_MS2023_BOOTLOADERS); - StrArrayAdd(&options, lmprintf(MSG_323), TRUE); + StrArrayAdd(&selection.choices, lmprintf(MSG_323), TRUE); MAP_BIT(UNATTEND_APPLY_SKUSIPOLICY); } } if (expert_mode) { - StrArrayAdd(&options, lmprintf(MSG_346), TRUE); + StrArrayAdd(&selection.choices, lmprintf(MSG_346), TRUE); MAP_BIT(UNATTEND_FORCE_S_MODE); } - selection_options.mask = remap16(unattend_xml_mask, map, FALSE); - i = CustomSelectionDialog(BS_AUTOCHECKBOX, lmprintf(MSG_327), lmprintf(MSG_328), - options.String, options.Index, &selection_options); - StrArrayDestroy(&options); + selection.mask = remap16(unattend_xml_mask, map, FALSE); + selection.style = BS_AUTOCHECKBOX; + i = SelectionDialog(lmprintf(MSG_327), lmprintf(MSG_328), &selection); + StrArrayDestroy(&selection.choices); if (i < 0) goto out; i = remap16(i, map, TRUE); @@ -1725,8 +1728,11 @@ static DWORD WINAPI BootCheckThread(LPVOID param) // The ISO is small enough to be written as an ESP and we are using GPT // so ask the users if they want to write it as an ESP. char* iso_image = lmprintf(MSG_036); - char* choices[2] = { lmprintf(MSG_276, iso_image), lmprintf(MSG_277, "ISO → ESP") }; - i = SelectionDialog(lmprintf(MSG_274, "ESP"), lmprintf(MSG_310), choices, 2); + StrArrayCreate(&selection.choices, 2); + StrArrayAdd(&selection.choices, lmprintf(MSG_276, iso_image), TRUE); + StrArrayAdd(&selection.choices, lmprintf(MSG_277, "ISO → ESP"), TRUE); + i = SelectionDialog(lmprintf(MSG_274, "ESP"), lmprintf(MSG_310), &selection); + StrArrayDestroy(&selection.choices); if (i < 0) // Cancel goto out; write_as_esp = (i & 2); diff --git a/src/rufus.h b/src/rufus.h index 8a730fbf..328a3830 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -507,15 +507,6 @@ typedef struct { char* Label; } IMG_SAVE; -// Options for the custom selection dialog -typedef struct { - int mask; - int username_index; - int edition_index; - int regional_index; - int privacy_index; -} selection_dialog_options_t; - /* * Structure and macros used for the extensions specification of FileDialog() * You can use: @@ -745,6 +736,17 @@ extern void StrArrayClear(StrArray* arr); extern void StrArrayDestroy(StrArray* arr); #define IsStrArrayEmpty(arr) (arr.Index == 0) +// Options for the custom selection dialog +typedef struct { + int style; + int mask; + int username_index; + int edition_index; + int regional_index; + int privacy_index; + StrArray choices; +} selection_dialog_options_t; + /* * Globals */ @@ -819,8 +821,7 @@ extern void DestroyTooltip(HWND hWnd); extern void DestroyAllTooltips(void); extern int NotificationEx(int type, const char* dont_display_setting, const notification_info* more_info, const char* title, const char* format, ...); #define Notification(type, title, ...) NotificationEx(type, NULL, NULL, title, __VA_ARGS__) -extern int CustomSelectionDialog(int style, char* title, char* message, char** choices, int size, selection_dialog_options_t* options); -#define SelectionDialog(title, message, choices, size) CustomSelectionDialog(BS_AUTORADIOBUTTON, title, message, choices, size, NULL) +extern int SelectionDialog(char* title, char* message, selection_dialog_options_t* options); extern void ListDialog(char* title, char* message, char** items, int size); extern SIZE GetTextSize(HWND hCtrl, char* txt); extern BOOL ExtractAppIcon(const char* filename, BOOL bSilent); diff --git a/src/rufus.rc b/src/rufus.rc index 7afe85db..76901f73 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.14.2321" +CAPTION "Rufus 4.14.2322" 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,14,2321,0 - PRODUCTVERSION 4,14,2321,0 + FILEVERSION 4,14,2322,0 + PRODUCTVERSION 4,14,2322,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.14.2321" + VALUE "FileVersion", "4.14.2322" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2321" + VALUE "ProductVersion", "4.14.2322" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index 76fe3193..eafe1a35 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -50,21 +50,32 @@ extern BOOL is_x86_64, appstore_version; extern char unattend_username[MAX_USERNAME_LENGTH], *sbat_level_txt, *sb_active_txt, *sb_revoked_txt; extern int unattend_edition_index; extern HICON hSmallIcon, hBigIcon; -static HICON hMessageIcon = (HICON)INVALID_HANDLE_VALUE; -static char* szMessageText = NULL; -static char* szMessageTitle = NULL; -static char **szDialogItem; -static int nDialogItems; -static HWND hUpdatesDlg; -static const SETTEXTEX friggin_microsoft_unicode_amateurs = { ST_DEFAULT, CP_UTF8 }; -static int notification_type; -static const notification_info* notification_more_info; -static const char* notification_dont_display_setting; -static WNDPROC update_original_proc = NULL; -static HWINEVENTHOOK ap_weh = NULL; -static char title_str[2][128], button_str[128]; -HWND hFidoDlg = NULL; +extern HWND hFidoDlg; +static struct { + char* szMessageText; + char* szMessageTitle; + char **szDialogItem; + int nDialogItems; +} list_data = { 0 }; +static struct { + char* szMessageText; + char* szMessageTitle; + selection_dialog_options_t* options; +} selection_data = { 0 }; +static struct { + HICON hMessageIcon; + char* szMessageText; + char* szMessageTitle; + int type; + const notification_info* more_info; + const char* dont_display_setting; +} notification_data = { 0 }; +static struct { + char title_str[2][128]; + char button_str[128]; + HWINEVENTHOOK weh; +} alert_data = { 0 }; static int update_settings_reposition_ids[] = { IDI_ICON, IDC_POLICY, @@ -77,6 +88,8 @@ static int update_settings_reposition_ids[] = { IDC_CHECK_NOW, IDCANCEL, }; +static const SETTEXTEX friggin_microsoft_unicode_amateurs = { ST_DEFAULT, CP_UTF8 }; +static WNDPROC update_original_proc = NULL; /* * https://blogs.msdn.microsoft.com/oldnewthing/20040802-00/?p=38283/ @@ -569,32 +582,32 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP buttonface_brush = GetSysColorBrush(COLOR_BTNFACE); CenterDialog(hDlg, NULL); // Change the default message icon - switch (notification_type & 0xF0) { + switch (notification_data.type & 0xF0) { case MB_ICONERROR: - hMessageIcon = LoadIcon(NULL, IDI_ERROR); + notification_data.hMessageIcon = LoadIcon(NULL, IDI_ERROR); break; case MB_ICONWARNING: - hMessageIcon = LoadIcon(NULL, IDI_WARNING); + notification_data.hMessageIcon = LoadIcon(NULL, IDI_WARNING); // I really have no idea at what scaling factors Microsoft switches icons. // However, the 200% icon has a jarring white pixel in dark mode, because // Microsoft forgot to set that pixel to transparent, that we need to fix. if (fScale > 1.75f && fScale < 2.5f) - hMessageIcon = FixWarningIcon(hMessageIcon); + notification_data.hMessageIcon = FixWarningIcon(notification_data.hMessageIcon); break; case MB_ICONQUESTION: - hMessageIcon = LoadIcon(NULL, IDI_QUESTION); + notification_data.hMessageIcon = LoadIcon(NULL, IDI_QUESTION); break; default: - hMessageIcon = LoadIcon(NULL, IDI_INFORMATION); + notification_data.hMessageIcon = LoadIcon(NULL, IDI_INFORMATION); break; } - if (Static_SetIcon(GetDlgItem(hDlg, IDC_NOTIFICATION_ICON), hMessageIcon) == 0) + if (Static_SetIcon(GetDlgItem(hDlg, IDC_NOTIFICATION_ICON), notification_data.hMessageIcon) == 0) uprintf("Could not set the notification dialog icon"); // Set the dialog title - if (szMessageTitle != NULL) - SetWindowTextU(hDlg, szMessageTitle); + if (notification_data.szMessageTitle != NULL) + SetWindowTextU(hDlg, notification_data.szMessageTitle); // Enable/disable the buttons and set text - switch (notification_type & 0x0F) { + switch (notification_data.type & 0x0F) { case MB_OKCANCEL: SetWindowTextU(GetDlgItem(hDlg, IDYES), "OK"); SetWindowTextU(GetDlgItem(hDlg, IDNO), lmprintf(MSG_007)); @@ -638,7 +651,7 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP break; } hCtrl = GetDlgItem(hDlg, IDC_DONT_DISPLAY_AGAIN); - if (notification_dont_display_setting != NULL) { + if (notification_data.dont_display_setting != NULL) { SetWindowTextU(hCtrl, lmprintf(MSG_127)); } else { // Remove the "Don't display again" checkbox @@ -647,7 +660,7 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2); cbh = rc.bottom - rc.top; } - if ((notification_more_info != NULL) && (notification_more_info->callback != NULL)) { + if ((notification_data.more_info != NULL) && (notification_data.more_info->callback != NULL)) { hCtrl = GetDlgItem(hDlg, IDC_MORE_INFO); // Resize the 'More information' button GetWindowRect(hCtrl, &rc); @@ -657,14 +670,14 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP ShowWindow(hCtrl, SW_SHOW); } // Set the control text and resize the dialog if needed - if (szMessageText != NULL) { + if (notification_data.szMessageText != NULL) { hCtrl = GetDlgItem(hDlg, IDC_NOTIFICATION_TEXT); - SetWindowTextU(hCtrl, szMessageText); + SetWindowTextU(hCtrl, notification_data.szMessageText); hDC = GetDC(hCtrl); SelectFont(hDC, hDlgFont); // Yes, you *MUST* reapply the font to the DC, even after SetWindowText! GetWindowRect(hCtrl, &rc); dh = rc.bottom - rc.top; - DrawTextU(hDC, szMessageText, -1, &rc, DT_CALCRECT | DT_WORDBREAK); + DrawTextU(hDC, notification_data.szMessageText, -1, &rc, DT_CALCRECT | DT_WORDBREAK); dh = max(rc.bottom - rc.top - dh + (int)(8.0f * fScale), 0); safe_release_dc(hCtrl, hDC); ResizeMoveCtrl(hDlg, hCtrl, 0, 0, 0, dh, 1.0f); @@ -706,7 +719,7 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP switch (LOWORD(wParam)) { case IDYES: // Return IDOK/IDRETRY for calls that expect it - switch (notification_type & 0x0F) { + switch (notification_data.type & 0x0F) { case MB_OKCANCEL: wParam = IDOK; break; @@ -721,7 +734,7 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP return (INT_PTR)TRUE; case IDNO: // Return IDCANCEL/IDOK/IDIGNORE for calls that expect it - switch (notification_type & 0x0F) { + switch (notification_data.type & 0x0F) { case MB_OKCANCEL: wParam = IDCANCEL; break; @@ -738,18 +751,18 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP EndDialog(hDlg, LOWORD(wParam)); return (INT_PTR)TRUE; case IDABORT: - if ((notification_type & 0x0F) == MB_YESNOCANCEL) + if ((notification_data.type & 0x0F) == MB_YESNOCANCEL) wParam = IDYES; EndDialog(hDlg, LOWORD(wParam)); return (INT_PTR)TRUE; case IDC_MORE_INFO: - if (notification_more_info != NULL) { - if_assert_fails(notification_more_info->callback != NULL) + if (notification_data.more_info != NULL) { + if_assert_fails(notification_data.more_info->callback != NULL) return (INT_PTR)FALSE; - if (notification_more_info->id == MORE_INFO_URL) { - ShellExecuteA(hDlg, "open", notification_more_info->url, NULL, NULL, SW_SHOWNORMAL); + if (notification_data.more_info->id == MORE_INFO_URL) { + ShellExecuteA(hDlg, "open", notification_data.more_info->url, NULL, NULL, SW_SHOWNORMAL); } else { - MyDialogBox(hMainInstance, notification_more_info->id, hDlg, notification_more_info->callback); + MyDialogBox(hMainInstance, notification_data.more_info->id, hDlg, notification_data.more_info->callback); } } break; @@ -768,22 +781,22 @@ int NotificationEx(int type, const char* dont_display_setting, const notificatio va_list args; dialog_showing++; - szMessageText = (char*)malloc(LOC_MESSAGE_SIZE); - if (szMessageText == NULL) + notification_data.szMessageText = (char*)malloc(LOC_MESSAGE_SIZE); + if (notification_data.szMessageText == NULL) return FALSE; - szMessageTitle = safe_strdup(title); - if (szMessageTitle == NULL) + notification_data.szMessageTitle = safe_strdup(title); + if (notification_data.szMessageTitle == NULL) return FALSE; va_start(args, format); - safe_vsnprintf(szMessageText, LOC_MESSAGE_SIZE - 1, format, args); + safe_vsnprintf(notification_data.szMessageText, LOC_MESSAGE_SIZE - 1, format, args); va_end(args); - szMessageText[LOC_MESSAGE_SIZE - 1] = 0; - notification_more_info = more_info; - notification_type = type; - notification_dont_display_setting = dont_display_setting; + notification_data.szMessageText[LOC_MESSAGE_SIZE - 1] = 0; + notification_data.more_info = more_info; + notification_data.type = type; + notification_data.dont_display_setting = dont_display_setting; ret = MyDialogBox(hMainInstance, IDD_NOTIFICATION, hMainDialog, NotificationCallback); - safe_free(szMessageText); - safe_free(szMessageTitle); + safe_free(notification_data.szMessageText); + safe_free(notification_data.szMessageTitle); dialog_showing--; return (int)ret; } @@ -817,11 +830,6 @@ static int GetComboBoxMinWidth(HWND hCtrl, StrArray* array) return max_width + arrow_width + padding; } -// We only ever display one selection dialog, so set some params as globals -static int selection_dialog_style; -static selection_dialog_options_t* selection_options = NULL; -static BOOL silent_install_checked = FALSE; - /* * Custom dialog for radio button selection dialog */ @@ -836,6 +844,7 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM HTTOPLEFT, HTTOPRIGHT, HTBOTTOMLEFT, HTBOTTOMRIGHT }; static HBRUSH background_brush, separator_brush; static HFONT hDlgFont = NULL; + static BOOL silent_install_checked = FALSE; char username[128] = { 0 }, str[MAX_PATH]; int i, m, dw, dh, r = -1, mw; DWORD size = sizeof(username); @@ -845,6 +854,8 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM RECT rc, rc2; HWND hCtrl; HDC hDC; + assert(selection_data.options != NULL); + int nDialogItems = selection_data.options->choices.Index; switch (message) { case WM_INITDIALOG: @@ -860,7 +871,7 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM } // Switch to checkboxes or some other style if requested for (i = 0; i < nDialogItems; i++) - Button_SetStyle(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), selection_dialog_style, TRUE); + Button_SetStyle(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), selection_data.options->style, TRUE); // Get the system message box font. See http://stackoverflow.com/a/6057761 if (hDlgFont == NULL) { ncm.cbSize = sizeof(ncm); @@ -891,22 +902,23 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM // Change the default icon and set the text Static_SetIcon(GetDlgItem(hDlg, IDC_SELECTION_ICON), LoadIcon(NULL, IDI_QUESTION)); - SetWindowTextU(hDlg, szMessageTitle); + SetWindowTextU(hDlg, selection_data.szMessageTitle); SetWindowTextU(GetDlgItem(hDlg, IDCANCEL), lmprintf(MSG_007)); - SetWindowTextU(GetDlgItem(hDlg, IDC_SELECTION_TEXT), szMessageText); + SetWindowTextU(GetDlgItem(hDlg, IDC_SELECTION_TEXT), selection_data.szMessageText); for (i = 0; i < nDialogItems; i++) { - static_strcpy(str, szDialogItem[i]); - SetWindowTextU(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), str); - ShowWindow(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), SW_SHOW); + hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i); + static_strcpy(str, selection_data.options->choices.String[i]); + SetWindowTextU(hCtrl, str); + ShowWindow(hCtrl, SW_SHOW); // Compute the maximum line's width (with some extra for the username and edition fields) - if (selection_options != NULL && i == selection_options->username_index) { - static_sprintf(str, "%s __%s__", szDialogItem[i], base_username); - mw = max(mw, GetTextSize(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), str).cx); - } else if (selection_options != NULL && i == selection_options->edition_index) { - mw = max(mw, GetTextSize(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), str).cx + + if (i == selection_data.options->username_index) { + static_sprintf(str, "%s __%s__", selection_data.options->choices.String[i], base_username); + mw = max(mw, GetTextSize(hCtrl, str).cx); + } else if (i == selection_data.options->edition_index) { + mw = max(mw, GetTextSize(hCtrl, str).cx + GetComboBoxMinWidth(GetDlgItem(hDlg, IDC_SELECTION_EDITION), &version_name)); } else { - mw = max(mw, GetTextSize(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), str).cx); + mw = max(mw, GetTextSize(hCtrl, str).cx); } } // If our maximum line's width is greater than the default, set a nonzero delta width @@ -918,7 +930,7 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM SelectFont(hDC, hDlgFont); // Yes, you *MUST* reapply the font to the DC, even after SetWindowText! GetWindowRect(hCtrl, &rc); dh = rc.bottom - rc.top; - DrawTextU(hDC, szMessageText, -1, &rc, DT_CALCRECT | DT_WORDBREAK); + DrawTextU(hDC, selection_data.szMessageText, -1, &rc, DT_CALCRECT | DT_WORDBREAK); dh = rc.bottom - rc.top - dh; safe_release_dc(hCtrl, hDC); ResizeMoveCtrl(hDlg, hCtrl, 0, 0, 0, dh, 1.0f); @@ -926,12 +938,12 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), 0, dh, dw, 0, 1.0f); // If required, set up the the username edit box - if (selection_options != NULL && selection_options->username_index != -1) { + if (selection_data.options->username_index > 0) { unattend_username[0] = 0; - hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->username_index); + hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->username_index); GetClientRect(hCtrl, &rc); ResizeMoveCtrl(hDlg, hCtrl, 0, 0, - (rc.left - rc.right) + GetTextSize(hCtrl, szDialogItem[selection_options->username_index]).cx + ddw, 0, 1.0f); + (rc.left - rc.right) + GetTextSize(hCtrl, selection_data.options->choices.String[selection_data.options->username_index]).cx + ddw, 0, 1.0f); GetWindowRect(hCtrl, &rc); SetWindowPos(GetDlgItem(hDlg, IDC_SELECTION_USERNAME), hCtrl, rc.left, rc.top, 0, 0, SWP_NOMOVE | SWP_NOSIZE); hCtrl = GetDlgItem(hDlg, IDC_SELECTION_USERNAME); @@ -945,11 +957,11 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM } // If required, set up the the edition combo box - if (selection_options != NULL && selection_options->edition_index != -1 && version_name.String != NULL && version_name.Index > 0) { - hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->edition_index); + if (selection_data.options->edition_index > 0 && version_name.String != NULL && version_name.Index > 0) { + hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index); GetClientRect(hCtrl, &rc); ResizeMoveCtrl(hDlg, hCtrl, 0, 0, - (rc.left - rc.right) + GetTextSize(hCtrl, szDialogItem[selection_options->edition_index]).cx + ddw, 0, 1.0f); + (rc.left - rc.right) + GetTextSize(hCtrl, selection_data.options->choices.String[selection_data.options->edition_index]).cx + ddw, 0, 1.0f); GetWindowRect(hCtrl, &rc); SetWindowPos(GetDlgItem(hDlg, IDC_SELECTION_EDITION), hCtrl, rc.left, rc.top, 0, 0, SWP_NOMOVE | SWP_NOSIZE); hCtrl = GetDlgItem(hDlg, IDC_SELECTION_EDITION); @@ -981,10 +993,16 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM // Set the default selection for (i = 0, m = 1; i < nDialogItems; i++, m <<= 1) Button_SetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), - ((selection_options == NULL && i == 0) || (selection_options != NULL && (m & selection_options->mask))) ? BST_CHECKED : BST_UNCHECKED); - if (selection_options != NULL && selection_options->username_index > 0 && selection_options->edition_index > 0) { - BOOL enable = Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->username_index)); - EnableWindow(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->edition_index), enable); + (selection_data.options->mask == 0 && i == 0) || + (selection_data.options->mask != 0 && (m & selection_data.options->mask) ? BST_CHECKED : BST_UNCHECKED)); + // Set the default state of the silent install option if available + if (selection_data.options->edition_index > 0 && selection_data.options->username_index > 0 && + selection_data.options->regional_index > 0 && selection_data.options->privacy_index > 0) { + // Should be the same condition as the one in WM_COMMAND + BOOL enable = Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->username_index)) && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->regional_index)) && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->privacy_index)); + EnableWindow(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index), enable); EnableWindow(GetDlgItem(hDlg, IDC_SELECTION_EDITION), enable); } @@ -1015,13 +1033,15 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM WORD command = LOWORD(wParam); if (command >= IDC_SELECTION_CHOICE1 && command < IDC_SELECTION_CHOICEMAX) { // Check if local account + regional settings + data collection checkboxes are clicked and enable/disable the silent install option - if (selection_options != NULL && selection_options->username_index > 0 && selection_options->edition_index > 0 && selection_options->regional_index > 0 && - (command - IDC_SELECTION_CHOICE1 == selection_options->username_index || command - IDC_SELECTION_CHOICE1 == selection_options->regional_index || - command - IDC_SELECTION_CHOICE1 == selection_options->privacy_index)) { - BOOL enable = Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->username_index)) && - Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->regional_index)) && - Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->privacy_index)); - hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->edition_index); + if (selection_data.options->edition_index > 0 && selection_data.options->username_index > 0 && + selection_data.options->edition_index > 0 && selection_data.options->regional_index > 0 && + (command - IDC_SELECTION_CHOICE1 == selection_data.options->username_index || + command - IDC_SELECTION_CHOICE1 == selection_data.options->regional_index || + command - IDC_SELECTION_CHOICE1 == selection_data.options->privacy_index)) { + BOOL enable = Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->username_index)) && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->regional_index)) && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->privacy_index)); + hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index); if (!enable && IsWindowEnabled(hCtrl)) { silent_install_checked = (Button_GetCheck(hCtrl) == BST_CHECKED); Button_SetCheck(hCtrl, FALSE); @@ -1034,14 +1054,14 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM } else switch (LOWORD(wParam)) { case IDOK: // Produce a big scary warning if the silent install option was selected - if (selection_options != NULL && selection_options->edition_index >= 0 && - Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_options->edition_index)) && + if (selection_data.options->edition_index > 0 && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index)) && Notification(MB_YESNO | MB_ICONWARNING, APPLICATION_NAME, lmprintf(MSG_356)) != IDYES) break; for (r = 0, i = 0, m = 1; i < nDialogItems; i++, m <<= 1) if (Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i)) == BST_CHECKED) r += m; - if (selection_options != NULL && selection_options->username_index != -1) { + if (selection_data.options->username_index > 0) { GetWindowTextU(GetDlgItem(hDlg, IDC_SELECTION_USERNAME), unattend_username, MAX_USERNAME_LENGTH); // Perform string sanitization (NB: GetWindowTextU always terminates the string) for (i = 0; unattend_username[i] != 0; i++) { @@ -1049,7 +1069,7 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM unattend_username[i] = '_'; } } - if (selection_options != NULL && selection_options->edition_index != -1) + if (selection_data.options->edition_index > 0) unattend_edition_index = (int)ComboBox_GetCurItemData(GetDlgItem(hDlg, IDC_SELECTION_EDITION)); // Fall through case IDNO: @@ -1065,18 +1085,18 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM /* * Display an item selection dialog */ -int CustomSelectionDialog(int style, char* title, char* message, char** choices, int size, selection_dialog_options_t* options) +int SelectionDialog(char* title, char* message, selection_dialog_options_t* options) { int ret; + assert(options != NULL); dialog_showing++; - szMessageTitle = title; - szMessageText = message; - szDialogItem = choices; - nDialogItems = size; - selection_options = options; - selection_dialog_style = style; - assert(style == BS_AUTORADIOBUTTON || style == BS_AUTOCHECKBOX); + selection_data.szMessageTitle = title; + selection_data.szMessageText = message; + selection_data.options = options; + if (options->style == 0) + options->style = BS_AUTORADIOBUTTON; + assert ((options->style == BS_AUTORADIOBUTTON || options->style == BS_AUTOCHECKBOX)); ret = (int)MyDialogBox(hMainInstance, IDD_SELECTION, hMainDialog, CustomSelectionCallback); dialog_showing--; @@ -1105,10 +1125,10 @@ INT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa case WM_INITDIALOG: SetDarkModeForDlg(hDlg); // Don't overflow our max radio button - if (nDialogItems > (IDC_LIST_ITEMMAX - IDC_LIST_ITEM1 + 1)) { + if (list_data.nDialogItems > (IDC_LIST_ITEMMAX - IDC_LIST_ITEM1 + 1)) { uprintf("WARNING: Too many items requested for List (%d vs %d)", - nDialogItems, IDC_LIST_ITEMMAX - IDC_LIST_ITEM1); - nDialogItems = IDC_LIST_ITEMMAX - IDC_LIST_ITEM1; + list_data.nDialogItems, IDC_LIST_ITEMMAX - IDC_LIST_ITEM1); + list_data.nDialogItems = IDC_LIST_ITEMMAX - IDC_LIST_ITEM1; } // Get the system message box font. See http://stackoverflow.com/a/6057761 if (hDlgFont == NULL) { @@ -1119,7 +1139,7 @@ INT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa // Set the dialog to use the system message box font SendMessage(hDlg, WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0)); SendMessage(GetDlgItem(hDlg, IDC_LIST_TEXT), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0)); - for (i = 0; i < nDialogItems; i++) + for (i = 0; i < list_data.nDialogItems; i++) SendMessage(GetDlgItem(hDlg, IDC_LIST_ITEM1 + i), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0)); SendMessage(GetDlgItem(hDlg, IDYES), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0)); SendMessage(GetDlgItem(hDlg, IDNO), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0)); @@ -1131,11 +1151,11 @@ INT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa CenterDialog(hDlg, NULL); // Change the default icon and set the text Static_SetIcon(GetDlgItem(hDlg, IDC_LIST_ICON), LoadIcon(NULL, IDI_EXCLAMATION)); - SetWindowTextU(hDlg, szMessageTitle); + SetWindowTextU(hDlg, list_data.szMessageTitle); SetWindowTextU(GetDlgItem(hDlg, IDCANCEL), lmprintf(MSG_007)); - SetWindowTextU(GetDlgItem(hDlg, IDC_LIST_TEXT), szMessageText); - for (i = 0; i < nDialogItems; i++) { - SetWindowTextU(GetDlgItem(hDlg, IDC_LIST_ITEM1 + i), szDialogItem[i]); + SetWindowTextU(GetDlgItem(hDlg, IDC_LIST_TEXT), list_data.szMessageText); + for (i = 0; i < list_data.nDialogItems; i++) { + SetWindowTextU(GetDlgItem(hDlg, IDC_LIST_ITEM1 + i), list_data.szDialogItem[i]); ShowWindow(GetDlgItem(hDlg, IDC_LIST_ITEM1 + i), SW_SHOW); } // Move/Resize the controls as needed to fit our text @@ -1144,15 +1164,15 @@ INT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa SelectFont(hDC, hDlgFont); // Yes, you *MUST* reapply the font to the DC, even after SetWindowText! GetWindowRect(hCtrl, &rc); dh = rc.bottom - rc.top; - DrawTextU(hDC, szMessageText, -1, &rc, DT_CALCRECT | DT_WORDBREAK); + DrawTextU(hDC, list_data.szMessageText, -1, &rc, DT_CALCRECT | DT_WORDBREAK); dh = rc.bottom - rc.top - dh; safe_release_dc(hCtrl, hDC); ResizeMoveCtrl(hDlg, hCtrl, 0, 0, 0, dh, 1.0f); - for (i = 0; i < nDialogItems; i++) + for (i = 0; i < list_data.nDialogItems; i++) ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_LIST_ITEM1 + i), 0, dh, 0, 0, 1.0f); - if (nDialogItems > 1) { + if (list_data.nDialogItems > 1) { GetWindowRect(GetDlgItem(hDlg, IDC_LIST_ITEM1), &rc); - GetWindowRect(GetDlgItem(hDlg, IDC_LIST_ITEM1 + nDialogItems - 1), &rc2); + GetWindowRect(GetDlgItem(hDlg, IDC_LIST_ITEM1 + list_data.nDialogItems - 1), &rc2); dh += rc2.top - rc.top; } ResizeMoveCtrl(hDlg, hDlg, 0, 0, 0, dh, 1.0f); @@ -1202,10 +1222,10 @@ INT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa void ListDialog(char* title, char* message, char** items, int size) { dialog_showing++; - szMessageTitle = title; - szMessageText = message; - szDialogItem = items; - nDialogItems = size; + list_data.szMessageTitle = title; + list_data.szMessageText = message; + list_data.szDialogItem = items; + list_data.nDialogItems = size; MyDialogBox(hMainInstance, IDD_LIST, hMainDialog, ListCallback); dialog_showing--; } @@ -1503,6 +1523,7 @@ static void PositionControls(HWND hDlg) */ INT_PTR CALLBACK UpdateCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { + static BOOL resized_already = TRUE; int i, dy; RECT rect; REQRESIZE* rsz; @@ -1510,13 +1531,11 @@ INT_PTR CALLBACK UpdateCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM l static HWND hFrequency, hBeta; int32_t freq; char update_policy_text[4096]; - static BOOL resized_already = TRUE; switch (message) { case WM_INITDIALOG: SetDarkModeForDlg(hDlg); resized_already = FALSE; - hUpdatesDlg = hDlg; apply_localization(IDD_UPDATE_POLICY, hDlg); PositionControls(hDlg); SetTitleBarIcon(hDlg); @@ -1584,7 +1603,6 @@ INT_PTR CALLBACK UpdateCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM l case IDCANCEL: reset_localization(IDD_UPDATE_POLICY); EndDialog(hDlg, LOWORD(wParam)); - hUpdatesDlg = NULL; return (INT_PTR)TRUE; case IDC_CHECK_NOW: CheckForUpdates(TRUE); @@ -2188,7 +2206,7 @@ static BOOL CALLBACK AlertPromptCallback(HWND hWnd, LPARAM lParam) if (GetWindowTextU(hWnd, str, sizeof(str)) == 0) return TRUE; - if (strcmp(str, button_str) == 0) + if (strcmp(str, alert_data.button_str) == 0) *found = TRUE; return TRUE; } @@ -2202,14 +2220,14 @@ static void CALLBACK AlertPromptHook(HWINEVENTHOOK hWinEventHook, DWORD Event, H if (GetWindowLongPtr(hWnd, GWL_STYLE) & WS_POPUPWINDOW) { str[0] = 0; GetWindowTextU(hWnd, str, sizeof(str)); - if (strcmp(str, title_str[0]) == 0) { + if (strcmp(str, alert_data.title_str[0]) == 0) { found = FALSE; EnumChildWindows(hWnd, AlertPromptCallback, (LPARAM)&found); if (found) { SendMessage(hWnd, WM_COMMAND, (WPARAM)IDCANCEL, (LPARAM)0); uprintf("Closed Windows format prompt"); } - } else if ((strcmp(str, title_str[1]) == 0) && (hWnd != hFidoDlg)) { + } else if ((strcmp(str, alert_data.title_str[1]) == 0) && (hWnd != hFidoDlg)) { // A wild Fido dialog appeared! => Keep track of its handle and center it hFidoDlg = hWnd; CenterDialog(hWnd, hMainDialog); @@ -2232,31 +2250,31 @@ void SetAlertPromptMessages(void) // 4097 = "You need to format the disk in drive %c: before you can use it." (dialog text) // 4125 = "Microsoft Windows" (dialog title) // 4126 = "Format disk" (button) - if (LoadStringU(hMui, 4125, title_str[0], sizeof(title_str[0])) <= 0) { - static_strcpy(title_str[0], "Microsoft Windows"); + if (LoadStringU(hMui, 4125, alert_data.title_str[0], sizeof(alert_data.title_str[0])) <= 0) { + static_strcpy(alert_data.title_str[0], "Microsoft Windows"); uprintf("WARNING: Could not locate localized format prompt title string in '%s': %s", mui_path, WindowsErrorString()); } - if (LoadStringU(hMui, 4126, button_str, sizeof(button_str)) <= 0) { - static_strcpy(button_str, "Format disk"); + if (LoadStringU(hMui, 4126, alert_data.button_str, sizeof(alert_data.button_str)) <= 0) { + static_strcpy(alert_data.button_str, "Format disk"); uprintf("WARNING: Could not locate localized format prompt button string in '%s': %s", mui_path, WindowsErrorString()); } FreeLibrary(hMui); } - static_strcpy(title_str[1], lmprintf(MSG_149)); + static_strcpy(alert_data.title_str[1], lmprintf(MSG_149)); } BOOL SetAlertPromptHook(void) { - if (ap_weh != NULL) + if (alert_data.weh != NULL) return TRUE; // No need to set again if active - ap_weh = SetWinEventHook(EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND, NULL, + alert_data.weh = SetWinEventHook(EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND, NULL, AlertPromptHook, 0, 0, WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS); - return (ap_weh != NULL); + return (alert_data.weh != NULL); } void ClrAlertPromptHook(void) { - UnhookWinEvent(ap_weh); - ap_weh = NULL; + UnhookWinEvent(alert_data.weh); + alert_data.weh = NULL; } void FlashTaskbar(HANDLE handle) diff --git a/src/wue.c b/src/wue.c index e9e5f995..51bac8c4 100644 --- a/src/wue.c +++ b/src/wue.c @@ -734,8 +734,9 @@ int GetEditions(StrArray* version_name, StrArray* version_index) { int i, r, n = -1; WIMStruct* wim = NULL; + selection_dialog_options_t selection = { 0 }; const char* edition_suffix; - char *install_names[MAX_WININST], *edition_name; + char *edition_name; wchar_t wim_path[4 * MAX_PATH] = L"", * xml = NULL; size_t xml_len; BOOL bNonStandard = FALSE; @@ -743,9 +744,11 @@ int GetEditions(StrArray* version_name, StrArray* version_index) // If we have multiple windows install images, ask the user the one to use if (img_report.wininst_index > 1) { + StrArrayCreate(&selection.choices, 16); for (i = 0; i < img_report.wininst_index; i++) - install_names[i] = &img_report.wininst_path[i][2]; - wininst_index = _log2(SelectionDialog(lmprintf(MSG_130), lmprintf(MSG_131), install_names, img_report.wininst_index)); + StrArrayAdd(&selection.choices, &img_report.wininst_path[i][2], TRUE); + wininst_index = _log2(SelectionDialog(lmprintf(MSG_130), lmprintf(MSG_131), &selection)); + StrArrayDestroy(&selection.choices); if (wininst_index < 0) return -2; if (wininst_index >= MAX_WININST) @@ -820,12 +823,12 @@ int SetWinToGoIndex(void) { int i, r; WIMStruct* wim = NULL; - char* install_names[MAX_WININST]; wchar_t wim_path[4 * MAX_PATH] = L"", *xml = NULL; size_t xml_len; - StrArray version_name = { 0 }, version_index = { 0 }; + StrArray version_index = { 0 }; BOOL bNonStandard = FALSE; ezxml_t index = NULL, image = NULL; + selection_dialog_options_t selection = { 0 }; // Sanity checks wintogo_index = -1; @@ -835,9 +838,11 @@ int SetWinToGoIndex(void) // If we have multiple windows install images, ask the user the one to use if (img_report.wininst_index > 1) { + StrArrayCreate(&selection.choices, 16); for (i = 0; i < img_report.wininst_index; i++) - install_names[i] = &img_report.wininst_path[i][2]; - wininst_index = _log2(SelectionDialog(lmprintf(MSG_130), lmprintf(MSG_131), install_names, img_report.wininst_index)); + StrArrayAdd(&selection.choices, &img_report.wininst_path[i][2], TRUE); + wininst_index = _log2(SelectionDialog(lmprintf(MSG_130), lmprintf(MSG_131), &selection)); + StrArrayDestroy(&selection.choices); if (wininst_index < 0) return -2; if (wininst_index >= MAX_WININST) @@ -864,7 +869,7 @@ int SetWinToGoIndex(void) goto out; } - StrArrayCreate(&version_name, 16); + StrArrayCreate(&selection.choices, 16); StrArrayCreate(&version_index, 16); index = ezxml_parse_str((char*)xml, xml_len); if (index == NULL) { @@ -877,10 +882,10 @@ int SetWinToGoIndex(void) image = image->next, i++) { // Some people are apparently creating *unofficial* Windows ISOs that don't have DISPLAYNAME elements. // If we are parsing such an ISO, try to fall back to using DESCRIPTION. - if (StrArrayAdd(&version_name, ezxml_child_val(image, "DISPLAYNAME"), TRUE) < 0) { - if (StrArrayAdd(&version_name, ezxml_child_val(image, "DESCRIPTION"), TRUE) < 0) { + if (StrArrayAdd(&selection.choices, ezxml_child_val(image, "DISPLAYNAME"), TRUE) < 0) { + if (StrArrayAdd(&selection.choices, ezxml_child_val(image, "DESCRIPTION"), TRUE) < 0) { uprintf("WARNING: Could not find a description for image index %d", i + 1); - StrArrayAdd(&version_name, "Unknown Windows Version", TRUE); + StrArrayAdd(&selection.choices, "Unknown Windows Version", TRUE); } bNonStandard = TRUE; } @@ -890,7 +895,7 @@ int SetWinToGoIndex(void) if (i > 1) // NB: _log2 returns -2 if SelectionDialog() returns negative (user cancelled) - i = _log2(SelectionDialog(lmprintf(MSG_291), lmprintf(MSG_292), version_name.String, i)) + 1; + i = _log2(SelectionDialog(lmprintf(MSG_291), lmprintf(MSG_292), &selection)) + 1; if (i < 0) wintogo_index = -2; // Cancelled by the user else if (i == 0) @@ -904,7 +909,7 @@ int SetWinToGoIndex(void) if (img_report.win_version.major == 0 || img_report.win_version.build == 0) uprintf("WARNING: Could not obtain version information from XML index (Nonstandard Windows image?)"); uprintf("Will use '%s' (Build: %d, Index %s) for Windows To Go", - version_name.String[i - 1], img_report.win_version.build, version_index.String[i - 1]); + selection.choices.String[i - 1], img_report.win_version.build, version_index.String[i - 1]); // Need Windows 10 Creator Update or later for boot on REMOVABLE to work if ((img_report.win_version.build < 15000) && (SelectedDrive.MediaType != FixedMedia)) { if (Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_190), lmprintf(MSG_098)) != IDYES) @@ -920,7 +925,7 @@ int SetWinToGoIndex(void) } out: - StrArrayDestroy(&version_name); + StrArrayDestroy(&selection.choices); StrArrayDestroy(&version_index); free(xml); ezxml_free(index); From 12749af22569667fb16d4587fa5c0095ed50d909 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 16 Mar 2026 19:28:50 +0000 Subject: [PATCH 132/192] [wue] add tooltips for the WUE dialog options * Also enable QoL enhancement options for Windows To Go. * Also try to select the same edition as the host machine for Windows To Go. --- res/loc/ChangeLog.txt | 55 +++++++++++++++++++++++++++++++++++-------- res/loc/rufus.loc | 15 +++++++++++- src/rufus.c | 26 ++++++++++++++++++++ src/rufus.h | 1 + src/rufus.rc | 10 ++++---- src/stdlg.c | 31 +++++++++++++----------- src/wue.c | 24 ++++++++++++++----- 7 files changed, 126 insertions(+), 36 deletions(-) diff --git a/res/loc/ChangeLog.txt b/res/loc/ChangeLog.txt index 14be321a..702c99c4 100644 --- a/res/loc/ChangeLog.txt +++ b/res/loc/ChangeLog.txt @@ -3,17 +3,52 @@ rufus.loc since its original version. To edit a translation, please make sure to follow: https://github.com/pbatard/rufus/wiki/Localization#Editing_an_existing_translation -Or simply download https://files.akeo.ie/pollock/pollock-1.5.exe and follow its directions. +Or simply download https://files.akeo.ie/pollock/pollock-1.6.exe and follow its directions. -o v4.? (????.??.??) ** NOT FINAL!!! PLEASE DO NOT SEND UNSOLICITED TRANSLATIONS! ** +o v4.14 (2026.??.??) + // NB: I used Google translate to update the following message, so please check for accuracy! - *UPDATED* MSG_337 "An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:" -> "An additional file ('%s') must be downloaded from Microsoft to use this feature:" - // NB: I used Google translate to update existing messages, so please check for accuracy! - - *NEW* MSG_350 "Use 'Windows UEFI CA 2023' signed bootloaders [EXPERIMENTAL]" + // From the WUE dialog with tooltip at MSG_369. Indicates that once installed, Windows will copy a file (SkuSiPolicy.p7b) to the EFI partition. KB5042562 refers to https://support.microsoft.com/kb/5042562. + // NB: WUE refers to the "Windows User Experience" dialog that Rufus displays after you select a Windows 11 ISO and press START. + - *NEW* MSG_323 "Apply SkuSiPolicy.p7b on installation (See KB5042562)" + // From the WUE dialog with tooltip at MSG_370. Please do NOT translate "QoL" or "Copilot, OneDrive, Outlook, Fast Startup". + - *NEW* MSG_324 "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" + // From the WUE dialog with tooltip at MSG_368. 'Windows CA 2023' refers to the new Windows security certificate https://go.microsoft.com/fwlink/?linkid=2239776 which is a binary digital signature certificate used for Secure Boot. + - *NEW* MSG_350 "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" + // The following 4 messages refer to Secure Boot revocation updates, such as the ones provided at https://uefi.org/revocationlistfile. 'DBX' is the main UEFI revocation database and should not be translated. - *NEW* MSG_351 "Checking for UEFI bootloader revocation..." - *NEW* MSG_352 "Checking for UEFI DBX updates..." - *NEW* MSG_353 "DBX update available" - *NEW* MSG_354 "Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks..." - - *NEW* MSG_355 "ISO Image" + // From the WUE dialog with tooltip at MSG_371 and further description at MSG_356. This basically allows a fully unattended Windows installation, that will not prompt the user at all and therefore automatically (and SILENTLY) + // erase all data on the first found disk on the PC on which the media is booted, before partitioning it and installing Windows. Because the media does not prompt before erasing all data on the first disk, it is obvioulsy a + // very DANGEROUS option, hence the ⚠ signs and the extra dialog that shows for it, in MSG_356, to ensure that the user accepts the consequences of selecting it. + - *NEW* MSG_355 "⚠SILENTLY⚠ erase disk and install:" + - *NEW* MSG_356 "You have selected to use the \"silent\" Windows installation option (...)" + // Tooltip for WUE MSG_329 + - *NEW* MSG_360 "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." + // Tooltip for WUE MSG_330 + - *NEW* MSG_361 "For this option to work, network/Internet MUST be disconnected during installation!" + // Tooltip for WUE MSG_331 + - *NEW* MSG_362 "Automatically answer 'no' to the sharing of data questions from Windows setup, instead of prompting the user." + // Tooltip for WUE MSG_332 + - *NEW* MSG_363 "Windows To Go may access existing disks and perform unwanted file system upgrades if this option is not selected." + // Tooltip for WUE MSG_333 + - *NEW* MSG_364 "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." + // Tooltip for WUE MSG_334 + - *NEW* MSG_365 "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." + // Tooltip for WUE MSG_335 + - *NEW* MSG_366 "Don't encrypt the system disk, unless explicitly requested by the user." + // Tooltip for WUE MSG_346 (that requires "Expert Mode" to first be enabled with Ctrl-Alt-E) + - *NEW* MSG_367 "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." + // Tooltip for WUE MSG_350. Mosby refers to https://github.com/pbatard/Mosby. + - *NEW* MSG_368 "Use this option only if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." + // Tooltip for WUE MSG_323 + - *NEW* MSG_369 "Revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." + // Tooltip for WUE MSG_324. Do not translate "Quality of Life", since it must match the QoL abbreviation from MSG_324 and it is meant to be known by the user (and is clarified by the rest of the message anyway) + - *NEW* MSG_370 "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." + // Tooltip for WUE MSG_355 + - *NEW* MSG_371 "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." o v4.5 (2024.05.22) - *UPDATED* IDC_RUFUS_MBR -> IDC_UEFI_MEDIA_VALIDATION "Enable runtime UEFI media validation" @@ -39,14 +74,14 @@ o v3.22 (2023.03.25) - *NEW* MSG_199 "This feature is not available on this platform." // MSG_294 can be tested by launching Rufus from the commandline with option -z61 - *UPDATED* MSG_294 "This version of Windows is no longer supported by Rufus." -> added "\nThe last version of Rufus compatible with this platform is v%d.%d." - - *NEW* MSG_323 "Unable to open or read '%s'" + - *NEW* MSG_322 "Unable to open or read '%s'" // MSG_325 appears on the status bar when creating a customized Windows 10 or Windows 11 media - *NEW* MSG_325 "Applying Windows customization: %s" // The following messages appear after selecting a Windows 11 ISO and pressing START - - *NEW* MSG_326 "Windows User Experience" - - *NEW* MSG_327 "Customize Windows installation?" - - *NEW* MSG_328 "Remove requirement for Secure Boot and TPM 2.0" - - *NEW* MSG_329 "Remove requirement for 4GB+ RAM and 64GB+ disk" + - *NEW* MSG_326 "Applying user options..." + - *NEW* MSG_327 "Windows User Experience" + - *NEW* MSG_328 "Customize Windows installation?" + - *NEW* MSG_329 "Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0" - *NEW* MSG_330 "Remove requirement for an online Microsoft account" - *NEW* MSG_331 "Disable data collection (Skip privacy questions)" - *NEW* MSG_332 "Prevent Windows To Go from accessing internal disks" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 58ffc1f2..42177bdd 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -578,7 +578,7 @@ t MSG_321 "The image you have selected is an ISOHybrid, but its creators have no "copy mode.\nAs a result, DD image writing mode will be enforced." t MSG_322 "Unable to open or read '%s'" t MSG_323 "Apply SkuSiPolicy.p7b on installation (See KB5042562)" -t MSG_324 "QoL Improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +t MSG_324 "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" t MSG_325 "Applying Windows customization: %s" t MSG_326 "Applying user options..." t MSG_327 "Windows User Experience" @@ -624,6 +624,19 @@ t MSG_356 "You have selected to use the \"silent\" Windows installation option.\ "This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the " "first detected disk on the target system, without asking. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n\nIf this is not what you want, " "please select 'No' to go back and uncheck the option.\nOtherwise, if you agree that the whole responsibility for any data loss will be entirely with YOU, select 'Yes'." +t MSG_360 "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +t MSG_361 "For this option to work, network/Internet MUST be disconnected during installation!" +t MSG_362 "Automatically answer 'no' to the sharing of data questions from Windows setup, instead of prompting the user." +t MSG_363 "Windows To Go may access existing disks and perform unwanted file system upgrades if this option is not selected." +t MSG_364 "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +t MSG_365 "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +t MSG_366 "Don't encrypt the system disk, unless explicitly requested by the user." +t MSG_367 "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +t MSG_368 "Use this option only if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +t MSG_369 "Revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +t MSG_370 "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +t MSG_371 "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." + # The following messages are for the Windows Store listing only and are not used by the application t MSG_900 "Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc." t MSG_901 "Official site: %s" diff --git a/src/rufus.c b/src/rufus.c index f5699c63..182341e7 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1608,27 +1608,40 @@ static DWORD WINAPI BootCheckThread(LPVOID param) int arch = _log2(img_report.has_efi >> 1); uint16_t map[16] = { 0 }, b = 1; StrArrayCreate(&selection.choices, 8); + StrArrayCreate(&selection.tooltips, 8); StrArrayAdd(&selection.choices, lmprintf(MSG_332), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_363), TRUE); MAP_BIT(UNATTEND_OFFLINE_INTERNAL_DRIVES); if (img_report.win_version.build >= 22500) { StrArrayAdd(&selection.choices, lmprintf(MSG_330), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_361), TRUE); MAP_BIT(UNATTEND_NO_ONLINE_ACCOUNT); } StrArrayAdd(&selection.choices, lmprintf(MSG_333), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_364), TRUE); selection.username_index = _log2(b); MAP_BIT(UNATTEND_SET_USER); StrArrayAdd(&selection.choices, lmprintf(MSG_334), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_365), TRUE); MAP_BIT(UNATTEND_DUPLICATE_LOCALE); StrArrayAdd(&selection.choices, lmprintf(MSG_331), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_362), TRUE); MAP_BIT(UNATTEND_NO_DATA_COLLECTION); + if (IS_WINDOWS_11(img_report)) { + StrArrayAdd(&selection.choices, lmprintf(MSG_324), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_370), TRUE); + MAP_BIT(UNATTEND_QOL_ENHANCEMENTS); + } if (expert_mode) { StrArrayAdd(&selection.choices, lmprintf(MSG_346), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_367), TRUE); MAP_BIT(UNATTEND_FORCE_S_MODE); } selection.mask = remap16(unattend_xml_mask, map, FALSE); selection.style = BS_AUTOCHECKBOX; i = SelectionDialog(lmprintf(MSG_327), lmprintf(MSG_328), &selection); StrArrayDestroy(&selection.choices); + StrArrayDestroy(&selection.tooltips); if (i < 0) goto out; // Remap i to the correct bit positions before calling CreateUnattendXml() @@ -1672,46 +1685,59 @@ static DWORD WINAPI BootCheckThread(LPVOID param) int arch = _log2(img_report.has_efi >> 1); uint16_t map[16] = { 0 }, b = 1; StrArrayCreate(&selection.choices, 16); + StrArrayCreate(&selection.tooltips, 16); if (IS_WINDOWS_11(img_report)) { StrArrayAdd(&selection.choices, lmprintf(MSG_329), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_360), TRUE); MAP_BIT(UNATTEND_SECUREBOOT_TPM_MINRAM); } if (img_report.win_version.build >= 22500) { StrArrayAdd(&selection.choices, lmprintf(MSG_330), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_361), TRUE); MAP_BIT(UNATTEND_NO_ONLINE_ACCOUNT); } StrArrayAdd(&selection.choices, lmprintf(MSG_333), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_364), TRUE); selection.username_index = _log2(b); MAP_BIT(UNATTEND_SET_USER); StrArrayAdd(&selection.choices, lmprintf(MSG_334), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_365), TRUE); selection.regional_index = _log2(b); MAP_BIT(UNATTEND_DUPLICATE_LOCALE); StrArrayAdd(&selection.choices, lmprintf(MSG_331), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_362), TRUE); selection.privacy_index = _log2(b); MAP_BIT(UNATTEND_NO_DATA_COLLECTION); if (IS_WINDOWS_11(img_report)) { StrArrayAdd(&selection.choices, lmprintf(MSG_335), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_366), TRUE); MAP_BIT(UNATTEND_DISABLE_BITLOCKER); StrArrayAdd(&selection.choices, lmprintf(MSG_324), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_370), TRUE); MAP_BIT(UNATTEND_QOL_ENHANCEMENTS); StrArrayAdd(&selection.choices, lmprintf(MSG_355), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_371), TRUE); selection.edition_index = _log2(b); MAP_BIT(UNATTEND_SILENT_INSTALL); if (img_report.win_version.build >= 26200) { StrArrayAdd(&selection.choices, lmprintf(MSG_350), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_368), TRUE); MAP_BIT(UNATTEND_USE_MS2023_BOOTLOADERS); StrArrayAdd(&selection.choices, lmprintf(MSG_323), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_369), TRUE); MAP_BIT(UNATTEND_APPLY_SKUSIPOLICY); } } if (expert_mode) { StrArrayAdd(&selection.choices, lmprintf(MSG_346), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_367), TRUE); MAP_BIT(UNATTEND_FORCE_S_MODE); } selection.mask = remap16(unattend_xml_mask, map, FALSE); selection.style = BS_AUTOCHECKBOX; i = SelectionDialog(lmprintf(MSG_327), lmprintf(MSG_328), &selection); StrArrayDestroy(&selection.choices); + StrArrayDestroy(&selection.tooltips); if (i < 0) goto out; i = remap16(i, map, TRUE); diff --git a/src/rufus.h b/src/rufus.h index 328a3830..a91b45c9 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -745,6 +745,7 @@ typedef struct { int regional_index; int privacy_index; StrArray choices; + StrArray tooltips; } selection_dialog_options_t; /* diff --git a/src/rufus.rc b/src/rufus.rc index 76901f73..ecf9be7f 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.14.2322" +CAPTION "Rufus 4.14.2323" 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,14,2322,0 - PRODUCTVERSION 4,14,2322,0 + FILEVERSION 4,14,2323,0 + PRODUCTVERSION 4,14,2323,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.14.2322" + VALUE "FileVersion", "4.14.2323" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2322" + VALUE "ProductVersion", "4.14.2323" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index eafe1a35..029612c4 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -833,7 +833,7 @@ static int GetComboBoxMinWidth(HWND hCtrl, StrArray* array) /* * Custom dialog for radio button selection dialog */ -static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { // This "Mooo" is designed to give us enough space for a regular username length static const char* base_username = "MOOOOOOOOOOO"; // 🐮 @@ -859,9 +859,9 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM switch (message) { case WM_INITDIALOG: - StrArray version_name = { 0 }, version_index = { 0 }; - StrArrayCreate(&version_name, 16); - StrArrayCreate(&version_index, 16); + StrArray edition_name = { 0 }, edition_index = { 0 }; + StrArrayCreate(&edition_name, 16); + StrArrayCreate(&edition_index, 16); SetDarkModeForDlg(hDlg); // Don't overflow our max radio button if (nDialogItems > (IDC_SELECTION_CHOICEMAX - IDC_SELECTION_CHOICE1 + 1)) { @@ -898,7 +898,7 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM mw = rc.right - rc.left - ddw; // ddw seems to work okay as a fudge dw = mw; - r = GetEditions(&version_name, &version_index); + r = GetEditions(&edition_name, &edition_index); // Change the default icon and set the text Static_SetIcon(GetDlgItem(hDlg, IDC_SELECTION_ICON), LoadIcon(NULL, IDI_QUESTION)); @@ -916,10 +916,13 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM mw = max(mw, GetTextSize(hCtrl, str).cx); } else if (i == selection_data.options->edition_index) { mw = max(mw, GetTextSize(hCtrl, str).cx + - GetComboBoxMinWidth(GetDlgItem(hDlg, IDC_SELECTION_EDITION), &version_name)); + GetComboBoxMinWidth(GetDlgItem(hDlg, IDC_SELECTION_EDITION), &edition_name)); } else { mw = max(mw, GetTextSize(hCtrl, str).cx); } + // Set tooltips, if any + if (i < (int)selection_data.options->tooltips.Index) + CreateTooltip(hCtrl, selection_data.options->tooltips.String[i], -1); } // If our maximum line's width is greater than the default, set a nonzero delta width dw = (mw <= dw) ? 0 : mw - dw; @@ -957,7 +960,7 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM } // If required, set up the the edition combo box - if (selection_data.options->edition_index > 0 && version_name.String != NULL && version_name.Index > 0) { + if (selection_data.options->edition_index > 0 && edition_name.String != NULL && edition_name.Index > 0) { hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index); GetClientRect(hCtrl, &rc); ResizeMoveCtrl(hDlg, hCtrl, 0, 0, @@ -967,10 +970,10 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM hCtrl = GetDlgItem(hDlg, IDC_SELECTION_EDITION); GetWindowRect(hCtrl, &rc2); ResizeMoveCtrl(hDlg, hCtrl, right_to_left_mode ? rc2.right - rc.left : rc.right - rc2.left, rc.top - rc2.top, - GetComboBoxMinWidth(hCtrl, &version_name), 0, 1.0f); - for (i = 0; i < (int)version_name.Index; i++) - IGNORE_RETVAL(ComboBox_SetItemData(hCtrl, ComboBox_AddStringU(hCtrl, version_name.String[i]), - (LPARAM)atoi(version_index.String[i]))); + GetComboBoxMinWidth(hCtrl, &edition_name), 0, 1.0f); + for (i = 0; i < (int)edition_name.Index; i++) + IGNORE_RETVAL(ComboBox_SetItemData(hCtrl, ComboBox_AddStringU(hCtrl, edition_name.String[i]), + (LPARAM)atoi(edition_index.String[i]))); IGNORE_RETVAL(ComboBox_SetCurSel(hCtrl, unattend_edition_index)); ShowWindow(hCtrl, SW_SHOW); } @@ -1007,8 +1010,8 @@ static INT_PTR CALLBACK CustomSelectionCallback(HWND hDlg, UINT message, WPARAM } SetDarkModeForChild(hDlg); - StrArrayDestroy(&version_name); - StrArrayDestroy(&version_index); + StrArrayDestroy(&edition_name); + StrArrayDestroy(&edition_index); return (INT_PTR)TRUE; case WM_CTLCOLORSTATIC: // Change the background colour for static text and icon @@ -1097,7 +1100,7 @@ int SelectionDialog(char* title, char* message, selection_dialog_options_t* opti if (options->style == 0) options->style = BS_AUTORADIOBUTTON; assert ((options->style == BS_AUTORADIOBUTTON || options->style == BS_AUTOCHECKBOX)); - ret = (int)MyDialogBox(hMainInstance, IDD_SELECTION, hMainDialog, CustomSelectionCallback); + ret = (int)MyDialogBox(hMainInstance, IDD_SELECTION, hMainDialog, SelectionCallback); dialog_showing--; return ret; diff --git a/src/wue.c b/src/wue.c index 51bac8c4..f7b83f0b 100644 --- a/src/wue.c +++ b/src/wue.c @@ -822,10 +822,12 @@ out: int SetWinToGoIndex(void) { int i, r; + const char* edition_suffix; + char* edition_name; WIMStruct* wim = NULL; wchar_t wim_path[4 * MAX_PATH] = L"", *xml = NULL; size_t xml_len; - StrArray version_index = { 0 }; + StrArray edition_index = { 0 }; BOOL bNonStandard = FALSE; ezxml_t index = NULL, image = NULL; selection_dialog_options_t selection = { 0 }; @@ -870,16 +872,25 @@ int SetWinToGoIndex(void) } StrArrayCreate(&selection.choices, 16); - StrArrayCreate(&version_index, 16); + StrArrayCreate(&edition_index, 16); index = ezxml_parse_str((char*)xml, xml_len); if (index == NULL) { uprintf("Could not parse WIM XML"); goto out; } + edition_suffix = GetEditionName(WindowsVersion.Edition); + unattend_edition_index = 1; for (i = 0, image = ezxml_child(index, "IMAGE"); - StrArrayAdd(&version_index, ezxml_attr(image, "INDEX"), TRUE) >= 0; + StrArrayAdd(&edition_index, ezxml_attr(image, "INDEX"), TRUE) >= 0; image = image->next, i++) { + // Try to match this host's edition with an index from the image + edition_name = ezxml_child_val(image, "NAME"); + if (edition_name != NULL) { + if (strlen(edition_name) > safe_strlen(edition_suffix) && + stricmp(&edition_name[strlen(edition_name) - safe_strlen(edition_suffix)], edition_suffix) == 0) + unattend_edition_index = atoi(ezxml_attr(image, "INDEX")) - 1; + } // Some people are apparently creating *unofficial* Windows ISOs that don't have DISPLAYNAME elements. // If we are parsing such an ISO, try to fall back to using DESCRIPTION. if (StrArrayAdd(&selection.choices, ezxml_child_val(image, "DISPLAYNAME"), TRUE) < 0) { @@ -893,6 +904,7 @@ int SetWinToGoIndex(void) if (bNonStandard) uprintf("WARNING: Nonstandard Windows image (missing <DISPLAYNAME> entries)"); + selection.mask = 1 << unattend_edition_index; if (i > 1) // NB: _log2 returns -2 if SelectionDialog() returns negative (user cancelled) i = _log2(SelectionDialog(lmprintf(MSG_291), lmprintf(MSG_292), &selection)) + 1; @@ -901,7 +913,7 @@ int SetWinToGoIndex(void) else if (i == 0) wintogo_index = 1; else - wintogo_index = atoi(version_index.String[i - 1]); + wintogo_index = atoi(edition_index.String[i - 1]); if (i > 0) { // re-populate the version data from the selected XML index PopulateWindowsVersionFromXml(xml, xml_len, i - 1); @@ -909,7 +921,7 @@ int SetWinToGoIndex(void) if (img_report.win_version.major == 0 || img_report.win_version.build == 0) uprintf("WARNING: Could not obtain version information from XML index (Nonstandard Windows image?)"); uprintf("Will use '%s' (Build: %d, Index %s) for Windows To Go", - selection.choices.String[i - 1], img_report.win_version.build, version_index.String[i - 1]); + selection.choices.String[i - 1], img_report.win_version.build, edition_index.String[i - 1]); // Need Windows 10 Creator Update or later for boot on REMOVABLE to work if ((img_report.win_version.build < 15000) && (SelectedDrive.MediaType != FixedMedia)) { if (Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_190), lmprintf(MSG_098)) != IDYES) @@ -926,7 +938,7 @@ int SetWinToGoIndex(void) out: StrArrayDestroy(&selection.choices); - StrArrayDestroy(&version_index); + StrArrayDestroy(&edition_index); free(xml); ezxml_free(index); wimlib_free(wim); From 5f75e06afa020a01102ba46d957457006eba791e Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 17 Mar 2026 23:09:42 +0000 Subject: [PATCH 133/192] [ui] report a more explicit error when the user selects an image located on the target drive * Also update French translation to latest and remove an unused script. --- res/loc/ChangeLog.txt | 17 ++-- res/loc/po/fr-FR.po | 110 +++++++++++++++++++-- res/loc/rufus.loc | 47 ++++++--- res/loc/translation_check.py | 181 ----------------------------------- src/drive.c | 15 +++ src/drive.h | 1 + src/rufus.c | 5 + src/rufus.rc | 10 +- 8 files changed, 171 insertions(+), 215 deletions(-) delete mode 100644 res/loc/translation_check.py diff --git a/res/loc/ChangeLog.txt b/res/loc/ChangeLog.txt index 702c99c4..3c09ba05 100644 --- a/res/loc/ChangeLog.txt +++ b/res/loc/ChangeLog.txt @@ -23,16 +23,21 @@ o v4.14 (2026.??.??) // From the WUE dialog with tooltip at MSG_371 and further description at MSG_356. This basically allows a fully unattended Windows installation, that will not prompt the user at all and therefore automatically (and SILENTLY) // erase all data on the first found disk on the PC on which the media is booted, before partitioning it and installing Windows. Because the media does not prompt before erasing all data on the first disk, it is obvioulsy a // very DANGEROUS option, hence the ⚠ signs and the extra dialog that shows for it, in MSG_356, to ensure that the user accepts the consequences of selecting it. + // In case it matters, the implied tense for the verb is FUTURE and indicates what the media/installer will do once booted. It does not indicate what Rufus itself does. - *NEW* MSG_355 "⚠SILENTLY⚠ erase disk and install:" - *NEW* MSG_356 "You have selected to use the \"silent\" Windows installation option (...)" + // The following two messages can be tested if you select an image (e.g. ISO) that is located on the drive you are trying to create + // If not directly relatable, the "saw the branch you are sitting on" idiom should be translated into a similar popular metaphor (for something that is so illogically bad that it will obviously end in disaster) in your language. + - *NEW* MSG_358 "Unsupported image location" + - *NEW* MSG_359 "You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on (...)" // Tooltip for WUE MSG_329 - *NEW* MSG_360 "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." // Tooltip for WUE MSG_330 - *NEW* MSG_361 "For this option to work, network/Internet MUST be disconnected during installation!" // Tooltip for WUE MSG_331 - - *NEW* MSG_362 "Automatically answer 'no' to the sharing of data questions from Windows setup, instead of prompting the user." - // Tooltip for WUE MSG_332 - - *NEW* MSG_363 "Windows To Go may access existing disks and perform unwanted file system upgrades if this option is not selected." + - *NEW* MSG_362 "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." + // Tooltip for WUE MSG_332. Please avoid translating 'Windows To Go'. + - *NEW* MSG_363 "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." // Tooltip for WUE MSG_333 - *NEW* MSG_364 "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." // Tooltip for WUE MSG_334 @@ -42,9 +47,9 @@ o v4.14 (2026.??.??) // Tooltip for WUE MSG_346 (that requires "Expert Mode" to first be enabled with Ctrl-Alt-E) - *NEW* MSG_367 "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." // Tooltip for WUE MSG_350. Mosby refers to https://github.com/pbatard/Mosby. - - *NEW* MSG_368 "Use this option only if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." + - *NEW* MSG_368 "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." // Tooltip for WUE MSG_323 - - *NEW* MSG_369 "Revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." + - *NEW* MSG_369 "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." // Tooltip for WUE MSG_324. Do not translate "Quality of Life", since it must match the QoL abbreviation from MSG_324 and it is meant to be known by the user (and is clarified by the rest of the message anyway) - *NEW* MSG_370 "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." // Tooltip for WUE MSG_355 @@ -84,7 +89,7 @@ o v3.22 (2023.03.25) - *NEW* MSG_329 "Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0" - *NEW* MSG_330 "Remove requirement for an online Microsoft account" - *NEW* MSG_331 "Disable data collection (Skip privacy questions)" - - *NEW* MSG_332 "Prevent Windows To Go from accessing internal disks" + - *NEW* MSG_332 "Prevent 'Windows To Go' from accessing internal disks" - *NEW* MSG_333 "Create a local account with username:" - *NEW* MSG_334 "Set regional options to the same values as this user's" - *NEW* MSG_335 "Disable BitLocker automatic device encryption" diff --git a/res/loc/po/fr-FR.po b/res/loc/po/fr-FR.po index 37bf9476..6ff717db 100644 --- a/res/loc/po/fr-FR.po +++ b/res/loc/po/fr-FR.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2025-10-01 18:52+0100\n" -"PO-Revision-Date: 2025-10-01 18:53+0100\n" +"POT-Creation-Date: 2026-03-17 22:51+0000\n" +"PO-Revision-Date: 2026-03-17 23:06+0000\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr_FR\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: French (Français)\n" "X-Rufus-LCID: 0x040c, 0x080c, 0x0c0c, 0x100c, 0x140c, 0x180c, 0x1c0c, 0x200c, 0x240c, 0x280c, 0x2c0c, 0x300c, 0x340c, 0x380c, 0xe40c\n" -"X-Generator: Poedit 3.7\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -309,7 +309,7 @@ msgstr "To" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "Po" @@ -844,7 +844,7 @@ msgstr "Désactivée" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Etablit la taille de la partition persistente pour media USB de type \"live\". Une taille de 0 désactive l’utilisation d’une partition persistente." @@ -886,7 +886,7 @@ msgstr "Ce lecteur est utilisé par une autre application ou un autre processus. #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" @@ -1790,6 +1790,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Impossible d'ouvrir ou de lire '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Appliquer SkuSiPolicy.p7b après installation (Consultez KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Améliorations 'QoL' (Ne force pas Copilot, OneDrive, Outlook, Fast Startup, etc.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Application des options de personnalisation de Windows: %s" @@ -1819,8 +1827,8 @@ msgid "Disable data collection (Skip privacy questions)" msgstr "Désactiver la collecte de données (Supprime les questions de confidentialité)" #. • MSG_332 -msgid "Prevent Windows To Go from accessing internal disks" -msgstr "Empêcher Windows To Go d'accéder aux disques internes" +msgid "Prevent 'Windows To Go' from accessing internal disks" +msgstr "Empêcher 'Windows To Go' d'accéder aux disques internes" #. • MSG_333 msgid "Create a local account with username:" @@ -1915,7 +1923,7 @@ msgid "Use Rufus MBR" msgstr "Utilisation du MBR Rufus" #. • MSG_350 -msgid "Use 'Windows CA 2023' signed bootloaders (requires a compatible target PC)" +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" msgstr "Utiliser les bootloaders signés par 'Windows CA 2023' (nécessite un PC cible compatible)" #. • MSG_351 @@ -1944,6 +1952,88 @@ msgstr "" "\n" "Note : Ces fichiers seront téléchargés dans le répertoire de l'application et réutilisés automatiquement si ils sont présent." +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "Effacera le disque ⚠SILENCIEUSEMENT⚠ et installera:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No'to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Vous avez sélectionné l'option d'installation de Windows dite \"silencieuse\".\n" +"\n" +"Il s'agit d'une option avancée, réservée à ceux qui souhaitent créer un média d'installation qui ne posera aucune question à l'utilisateur pendant l'installation de Windows et qui EFFACERA SANS CONDITION le premier disque détecté sur le système cible. Si vous n'y prenez pas garde, l'utilisation de cette option peut résulter en une PERTE DE DONNÉES IRREVERSIBLE !\n" +"\n" +"Si cela n'est pas ce que vous souhaitez veuillez sélectionner 'Non' pour revenir en arrière et désélectionner cette option.\n" +"Sinon, si vous sélectionnez 'Oui', vous indiquez que toute perte de donnée en résultant sera entièrement VOTRE responsabilité." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Placement d'image non supporté" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Vous ne pouvez pas utiliser une image située sur le périphérique cible, puisque ce dernier va être complètement effacé. Cela revient au même qu'essayer de scier la branche sur laquelle vous êtes assis !\n" +"\n" +"Veuillez déplacer l'image sur un autre disque et réessayez." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Vous pouvez laisser cette option activée même si vous avez une puce TPM ou plus de RAM, car l'option contourne simplement les prérequis du programme d'installation et n'empêche absolument pas Windows d'utiliser toutes ces ressources si disponibles." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Pour que cette option fonctionne, vous DEVEZ déconnecter le réseau/Internet pendant l'installation !" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Répond automatiquement 'non' aux questions du programme d'installation de Windows en ce qui concerne l'autorisation du partage de données avec Microsoft, au lieu de demander à l'utilisateur." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Laissez cette option activée à moins que vous acceptiez que 'Windows To Go' puisse accéder aux disques internes pour effectuer des mises à jour, silencieuses et irréversible, des systèmes de fichiers." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Crée un compte local automatiquement, pour le nom spécifié, et avec un mot de passe vide qui devra être changé à la prochaine session." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Réplique les options régionales de ce PC (clavier, fuseau horaire, monnaie), au lieu de demander à l'utilisateur." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Ne chiffre pas le disque système, sauf si l'utilisateur le demande explicitement." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Activez cette option seulement si vous savez ce qu'est S-Mode et comprenez que votre système pourra être restreint au S-Mode même si vous supprimez Windows et le réinstallez complètement." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Activez cette option si le système que vous installez utilise des certificats Secure Boot complètement à jour. Si nécessaire, vous pouvez utiliser 'Mosby' pour mettre votre système à jour." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Activez cette option pour révoquer des bootloaders supplémentaires de Windows, mais avec le risque de ne plus pouvoir démarrer depuis des media Windows standard." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Améliorations \"Quality of Life\" : Désactive la plupart des fonctionnalités que Microsoft essaie de pousser, contre leur gré, aux utilisateurs." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Si vous utilisez cette option, veuillez-vous assurer que tous les disques, sauf celui sur lequel vous voulez installer Windows, est déconnecté du PC cible, et aussi que vous ne laisserez pas le média connecté sur un PC que vous ne voulez pas réinstaller." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 42177bdd..e262b456 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -3,7 +3,7 @@ ######################################################################### # List of all languages included in this file (with version) -# • v4.5 "en-US" "English (English)" +# • v4.14 "en-US" "English (English)" # • v4.5 "ar-SA" "Arabic (العربية)" # • v3.22 "bg-BG" "Bulgarian (Български)" # • v4.5 "zh-CN" "Chinese Simplified (简体中文)" @@ -13,7 +13,7 @@ # • v4.5 "da-DK" "Danish (Dansk)" # • v4.5 "nl-NL" "Dutch (Nederlands)" # • v4.5 "fi-FI" "Finnish (Suomi)" -# • v4.5 "fr-FR" "French (Français)" +# • v4.14 "fr-FR" "French (Français)" # • v4.5 "de-DE" "German (Deutsch)" # • v4.5 "el-GR" "Greek (Ελληνικά)" # • v4.5 "he-IL" "Hebrew (עברית)" @@ -44,7 +44,7 @@ ######################################################################### l "en-US" "English (English)" 0x0409, 0x0809, 0x0c09, 0x1009, 0x1409, 0x1809, 0x1c09, 0x2009, 0x2409, 0x2809, 0x2c09, 0x3009, 0x3409, 0x3809, 0x3c09, 0x4009, 0x4409, 0x4809 -v 4.5 +v 4.14 g IDD_DIALOG t IDS_DRIVE_PROPERTIES_TXT "Drive Properties" @@ -329,7 +329,7 @@ t MSG_129 "You have just created a media that uses the UEFI:NTFS bootloader. Ple t MSG_130 "Windows image selection" t MSG_131 "This ISO contains multiple Windows images.\nPlease select the image you wish to use for this installation:" t MSG_132 "Another program or process is accessing this drive. Do you want to format it anyway?" -t MSG_133 "Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n\n" +t MSG_133 "Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." t MSG_134 "Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\n\n" @@ -586,7 +586,7 @@ t MSG_328 "Customize Windows installation?" t MSG_329 "Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0" t MSG_330 "Remove requirement for an online Microsoft account" t MSG_331 "Disable data collection (Skip privacy questions)" -t MSG_332 "Prevent Windows To Go from accessing internal disks" +t MSG_332 "Prevent 'Windows To Go' from accessing internal disks" t MSG_333 "Create a local account with username:" t MSG_334 "Set regional options to the same values as this user's" t MSG_335 "Disable BitLocker automatic device encryption" @@ -622,18 +622,21 @@ t MSG_354 "Rufus has found an updated version of the DBX files used to perform U t MSG_355 "⚠SILENTLY⚠ erase disk and install:" t MSG_356 "You have selected to use the \"silent\" Windows installation option.\n\n" "This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the " - "first detected disk on the target system, without asking. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n\nIf this is not what you want, " - "please select 'No' to go back and uncheck the option.\nOtherwise, if you agree that the whole responsibility for any data loss will be entirely with YOU, select 'Yes'." + "first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n\nIf this is not what you want, please select 'No'" + "to go back and uncheck the option.\nOtherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +t MSG_358 "Unsupported image location" +t MSG_359 "You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n\n" + "Please move the image to a different location and try again." t MSG_360 "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." t MSG_361 "For this option to work, network/Internet MUST be disconnected during installation!" -t MSG_362 "Automatically answer 'no' to the sharing of data questions from Windows setup, instead of prompting the user." -t MSG_363 "Windows To Go may access existing disks and perform unwanted file system upgrades if this option is not selected." +t MSG_362 "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +t MSG_363 "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." t MSG_364 "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." t MSG_365 "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." t MSG_366 "Don't encrypt the system disk, unless explicitly requested by the user." t MSG_367 "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." -t MSG_368 "Use this option only if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." -t MSG_369 "Revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +t MSG_368 "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +t MSG_369 "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." t MSG_370 "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." t MSG_371 "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." @@ -4439,7 +4442,7 @@ t MSG_922 "Lataa UEFI Shell ISO-levykuvia" ######################################################################### l "fr-FR" "French (Français)" 0x040c, 0x080c, 0x0c0c, 0x100c, 0x140c, 0x180c, 0x1c0c, 0x200c, 0x240c, 0x280c, 0x2c0c, 0x300c, 0x340c, 0x380c, 0xe40c -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -4810,6 +4813,8 @@ t MSG_319 "Ignorer le marqueur de démarrage" t MSG_320 "Rafraîchissement du schéma de partition (%s)..." t MSG_321 "L’image que vous avez sélectionnée est de type ISOHybrid, mais ses créateurs ne l’ont pas rendue compatible avec le mode ISO (i.e. copie de fichier).\nÀ cause de cela, seule l’écriture en mode DD est applicable." t MSG_322 "Impossible d'ouvrir ou de lire '%s'" +t MSG_323 "Appliquer SkuSiPolicy.p7b après installation (Consultez KB5042562)" +t MSG_324 "Améliorations 'QoL' (Ne force pas Copilot, OneDrive, Outlook, Fast Startup, etc.)" t MSG_325 "Application des options de personnalisation de Windows: %s" t MSG_326 "Application des options utilisateur..." t MSG_327 "Expérience de l'utilisateur Windows" @@ -4817,7 +4822,7 @@ t MSG_328 "Personnaliser l'installation de Windows ?" t MSG_329 "Supprimer la nécessité d'avoir 4Go+ de RAM, Secure Boot et TPM 2.0" t MSG_330 "Supprimer la nécessité d'utiliser un compte utilisateur Microsoft en ligne" t MSG_331 "Désactiver la collecte de données (Supprime les questions de confidentialité)" -t MSG_332 "Empêcher Windows To Go d'accéder aux disques internes" +t MSG_332 "Empêcher 'Windows To Go' d'accéder aux disques internes" t MSG_333 "Créer un compte local sous le nom de :" t MSG_334 "Définir les options régionales avec les mêmes valeurs que celles de cet utilisateur" t MSG_335 "Désactiver le chiffrement automatique BitLocker" @@ -4840,6 +4845,22 @@ t MSG_351 "Vérification de la revocation des bootloaders UEFI..." t MSG_352 "Vérification des mises à jour de DBX UEFI..." t MSG_353 "Mise à jour DBX disponible" t MSG_354 "Rufus a trouvé une mise à jour des fichiers DBX utilisés pour effectuer la validation des revocations Secure Boot sous UEFI. Voulez-vous télécharger cette mise à jour ?\n- Sélectionnez 'Oui' pour vous connecter à Internet et le télécharger ce contenu\n- Sélectionnez 'Non' pour annuler l’opération\n\nNote : Ces fichiers seront téléchargés dans le répertoire de l'application et réutilisés automatiquement si ils sont présent." +t MSG_355 "Effacera le disque ⚠SILENCIEUSEMENT⚠ et installera:" +t MSG_356 "Vous avez sélectionné l'option d'installation de Windows dite \"silencieuse\".\n\nIl s'agit d'une option avancée, réservée à ceux qui souhaitent créer un média d'installation qui ne posera aucune question à l'utilisateur pendant l'installation de Windows et qui EFFACERA SANS CONDITION le premier disque détecté sur le système cible. Si vous n'y prenez pas garde, l'utilisation de cette option peut résulter en une PERTE DE DONNÉES IRREVERSIBLE !\n\nSi cela n'est pas ce que vous souhaitez veuillez sélectionner 'Non' pour revenir en arrière et désélectionner cette option.\nSinon, si vous sélectionnez 'Oui', vous indiquez que toute perte de donnée en résultant sera entièrement VOTRE responsabilité." +t MSG_358 "Placement d'image non supporté" +t MSG_359 "Vous ne pouvez pas utiliser une image située sur le périphérique cible, puisque ce dernier va être complètement effacé. Cela revient au même qu'essayer de scier la branche sur laquelle vous êtes assis !\n\nVeuillez déplacer l'image sur un autre disque et réessayez." +t MSG_360 "Vous pouvez laisser cette option activée même si vous avez une puce TPM ou plus de RAM, car l'option contourne simplement les prérequis du programme d'installation et n'empêche absolument pas Windows d'utiliser toutes ces ressources si disponibles." +t MSG_361 "Pour que cette option fonctionne, vous DEVEZ déconnecter le réseau/Internet pendant l'installation !" +t MSG_362 "Répond automatiquement 'non' aux questions du programme d'installation de Windows en ce qui concerne l'autorisation du partage de données avec Microsoft, au lieu de demander à l'utilisateur." +t MSG_363 "Laissez cette option activée à moins que vous acceptiez que 'Windows To Go' puisse accéder aux disques internes pour effectuer des mises à jour, silencieuses et irréversible, des systèmes de fichiers." +t MSG_364 "Crée un compte local automatiquement, pour le nom spécifié, et avec un mot de passe vide qui devra être changé à la prochaine session." +t MSG_365 "Réplique les options régionales de ce PC (clavier, fuseau horaire, monnaie), au lieu de demander à l'utilisateur." +t MSG_366 "Ne chiffre pas le disque système, sauf si l'utilisateur le demande explicitement." +t MSG_367 "Activez cette option seulement si vous savez ce qu'est S-Mode et comprenez que votre système pourra être restreint au S-Mode même si vous supprimez Windows et le réinstallez complètement." +t MSG_368 "Activez cette option si le système que vous installez utilise des certificats Secure Boot complètement à jour. Si nécessaire, vous pouvez utiliser 'Mosby' pour mettre votre système à jour." +t MSG_369 "Activez cette option pour révoquer des bootloaders supplémentaires de Windows, mais avec le risque de ne plus pouvoir démarrer depuis des media Windows standard." +t MSG_370 "Améliorations \"Quality of Life\" : Désactive la plupart des fonctionnalités que Microsoft essaie de pousser, contre leur gré, aux utilisateurs." +t MSG_371 "Si vous utilisez cette option, veuillez-vous assurer que tous les disques, sauf celui sur lequel vous voulez installer Windows, est déconnecté du PC cible, et aussi que vous ne laisserez pas le média connecté sur un PC que vous ne voulez pas réinstaller." t MSG_900 "Rufus est un utilitaire permettant de formater et de créer des média USB amorçables, tels que clés USB, mémoire flash, etc." t MSG_901 "Site officiel : %s" t MSG_902 "Code source: %s" diff --git a/res/loc/translation_check.py b/res/loc/translation_check.py deleted file mode 100644 index a41d4613..00000000 --- a/res/loc/translation_check.py +++ /dev/null @@ -1,181 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding=utf-8 -*- - -# LIMITATIONS -# this script was written as fast as possible so it is broken/minimalistic: -# it assumes the first language in rufus.loc in English -# written for 1.0.23, things may have changes since then -# horrible code below -# in multiline messages checks only first one if is the same as in English (should be enough for now) - -import sys -# regex -import re -# splitting by "quotes" -import shlex -# pretty print for debug -import pprint - -# global variables, I'm no python expert so I'll just dump everything here -languages = [] -unavailable = [] -untranslated = [] -version = "0.0.0" -ignored_messages = ['IDOK', 'MSG_020', 'MSG_021', 'MSG_022', 'MSG_023', 'MSG_024', 'MSG_025', 'MSG_026', 'MSG_027', 'MSG_028', 'MSG_118'] - -class Language: - code = "xx-XX" - name = "None" - version = "0.0.0" - base = "en-US" - groups = {} - #{ "group" => { "MNEMONIC => "transl" }, group2 = (...) } - def __init__(self): - self.groups = {} - - def get_current_group(self): - if len(self.groups) > 0: - return list(self.groups.keys())[len(self.groups)-1] - else: - return "none" - def get_current_message(self): - current_group = self.get_current_group() - if len(self.groups[current_group]) > 0: - return list(self.groups[current_group].keys())[len(self.groups[current_group])-1] - else: - return "none" - - -def print_no_new(data): - print(data, end="") - -def load_languages(): - print_no_new("loading rufus.loc file...\t") - sys.stdout.flush() - #load file - lines = [line.strip() for line in open("rufus.loc", "r", encoding="utf8")] - - # remove comments - #TODO properly remove comments, now it'll break messages with "#" in them, I just assumes there aren't any - #lines = [re.sub(re.compile("#(.*)?" ) ,"" ,line) for line in lines] - # remove empty lines - #lines = filter(None, lines) - - i = -1 - exceptions = [] - for index, line in enumerate(lines): - try: - if line != "" and line[0] != "#": - if line[0] == "l": - #this is language declaration - i += 1 - temp_language = Language() - temp_language.name = shlex.split(line)[2] - temp_language.code = shlex.split(line)[1] - languages.append(temp_language) - # print("current language: "+languages[i].name) - - elif line[0] == "v": - #this is language declaration - version = line.split(" ")[1] - languages[i].version = line.split(" ")[1] - elif line[0] == "b": - languages[i].base = shlex.split(line)[1] - if line != "b \"en-US\"": - print(languages[i].name + " is based on another translation: " + languages[i].base) - elif line[0] == "g": - languages[i].groups[shlex.split(line)[1]] = {} - # print("current group: "+languages[i].get_current_group()) - elif line[0] == "t": - pass - try: - temp_translation = shlex.split(line) #errors - except ValueError as err: - exceptions.append(str(err)+" in line "+ str(index+1)+": "+line) - languages[i].groups[languages[i].get_current_group()][temp_translation[1]] = temp_translation[2] - #print("cur transl: "+languages[i].get_current_message()) - elif line[0] == "\"": - pass - elif line[0] == "a": - pass #only RTL indication as for now - else: - raise Exception("unknown line "+str(index+1)+ ": "+line) - except Exception as error: - exceptions.append("Error: "+ repr(error)) - - - if len(exceptions) > 0: - print("[WARNING]") - print("\n".join(exceptions)) - else: - print("[OK]") - print() - print ("Found " + str(len(languages)) + " languages") - version = languages[0].version - print("Assuming " + version + " is the latest version. Only languages with this version will be checked...") - #comment if you want to check every single language, not only newest versions - languages[:] = [language for language in languages if language.version==version] - print (str(len(languages)) + " languages in " + languages[0].version + " version:") - print ("\n".join(language.name for language in languages)) - print() - -def check_unavailable(): - print_no_new("Checking for possible missing messages...\t") - sys.stdout.flush() - #for groups in english - #every lang - #does group exist - #for strings in groups - #does it exist - for group in languages[0].groups: - for language in languages[1::]: - if group not in language.groups: - unavailable.append("Language " + language.name + " is missing group '" + group + "'") - else: - for string in languages[0].groups[group]: - if string not in language.groups[group] and string not in ignored_messages: - unavailable.append("Language " + language.name + " is missing message '" + string + "'") - # print output - if len(unavailable) > 0: - print("[WARNING]") - print("Possible missing messages:") - print("\n".join(unavailable)) - else: - print("[OK]") - print() - -def check_untranslated(): - print_no_new("Checking for possible untranslated messages...\t") - sys.stdout.flush() - #evyerything but english - #for group - #for string - #transl==english? - for language in languages[1::]: - for group in language.groups: - for string in language.groups[group]: - try: - if language.groups[group][string] == languages[0].groups[group][string] and string not in ignored_messages: - untranslated.append("Language " + language.name + ": message '" + string + "' has the same translation as English") - except KeyError as error: - untranslated.append("Language " + language.name + ": message '" + string + "' doesn't exist in English") - # print output - if len(untranslated) > 0: - print("[WARNING]") - print("Possible untranslated messages:") - print("\n".join(untranslated)) - else: - print("[OK]") - print() - -def main(): - print("Rufus translation helper tool, proof of concept/MVP") - load_languages() - #pp = pprint.PrettyPrinter(indent=4) - #pp.pprint(languages[2].groups) - check_unavailable() - check_untranslated() - -#load main only in ran as stand-alone script -if __name__ == "__main__": - main() diff --git a/src/drive.c b/src/drive.c index 8c398ab1..88ae92cb 100644 --- a/src/drive.c +++ b/src/drive.c @@ -1211,6 +1211,21 @@ UINT GetDriveTypeFromIndex(DWORD DriveIndex) return drive_type; } +BOOL IsSourceImageLocatedOnTargetDrive(DWORD DriveIndex) +{ + size_t i; + char drive_letters[27] = { 0 }; + + if (boot_type != BT_IMAGE || !GetDriveLetters(DriveIndex, drive_letters) || drive_letters[0] == 0) + return FALSE; + + for (i = 0; i < strlen(drive_letters); i++) + if ((PathGetDriveNumberU(image_path) + 'A') == drive_letters[i]) + return TRUE; + + return FALSE; +} + // Removes all drive letters associated with the specific drive, and return // either the first or last letter that was removed, according to bReturnLast. char RemoveDriveLetters(DWORD DriveIndex, BOOL bReturnLast, BOOL bSilent) diff --git a/src/drive.h b/src/drive.h index 177f070f..8dc0f7aa 100644 --- a/src/drive.h +++ b/src/drive.h @@ -383,6 +383,7 @@ BOOL GetDriveLetters(DWORD DriveIndex, char* drive_letters); UINT GetDriveTypeFromIndex(DWORD DriveIndex); char GetUnusedDriveLetter(void); BOOL IsDriveLetterInUse(const char drive_letter); +BOOL IsSourceImageLocatedOnTargetDrive(DWORD DriveIndex); char RemoveDriveLetters(DWORD DriveIndex, BOOL bUseLast, BOOL bSilent); BOOL GetDriveLabel(DWORD DriveIndex, char* letters, char** label, BOOL bSilent); uint64_t GetDriveSize(DWORD DriveIndex); diff --git a/src/rufus.c b/src/rufus.c index 182341e7..c86b4f88 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1519,6 +1519,11 @@ static DWORD WINAPI BootCheckThread(LPVOID param) if (boot_type == BT_IMAGE) { if_assert_fails(image_path != NULL) goto out; + if (IsSourceImageLocatedOnTargetDrive((DWORD)ComboBox_GetItemData(hDeviceList, ComboBox_GetCurSel(hDeviceList)))) { + // You cannot use an image that is located on the target drive + Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_358), lmprintf(MSG_359)); + goto out; + } if ((size_check) && (img_report.projected_size > (uint64_t)SelectedDrive.DiskSize)) { // This ISO image is too big for the selected target Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_088), lmprintf(MSG_089)); diff --git a/src/rufus.rc b/src/rufus.rc index ecf9be7f..9ff0bdc5 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.14.2323" +CAPTION "Rufus 4.14.2324" 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,14,2323,0 - PRODUCTVERSION 4,14,2323,0 + FILEVERSION 4,14,2324,0 + PRODUCTVERSION 4,14,2324,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.14.2323" + VALUE "FileVersion", "4.14.2324" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2323" + VALUE "ProductVersion", "4.14.2324" END END BLOCK "VarFileInfo" From 6d12577cfceba28e6dcbf094dd30776defc5c6f1 Mon Sep 17 00:00:00 2001 From: sehawq <omer57763@gmail.com> Date: Sun, 8 Mar 2026 15:23:57 +0000 Subject: [PATCH 134/192] [ui] address a condition where controls may be enabled when no image is selected * Closes #2935. --- src/rufus.c | 4 +++- src/rufus.rc | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/rufus.c b/src/rufus.c index c86b4f88..4b89b9fb 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1,4 +1,4 @@ -/* +/* * Rufus: The Reliable USB Formatting Utility * Copyright © 2011-2026 Pete Batard <pete@akeo.ie> * @@ -3015,6 +3015,8 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA img_provided = TRUE; // Simulate image selection click SendMessage(hDlg, WM_COMMAND, IDC_SELECT, 0); + } else { + EnableControls(TRUE, FALSE); } } break; diff --git a/src/rufus.rc b/src/rufus.rc index 9ff0bdc5..21bea281 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.14.2324" +CAPTION "Rufus 4.14.2325" 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,14,2324,0 - PRODUCTVERSION 4,14,2324,0 + FILEVERSION 4,14,2325,0 + PRODUCTVERSION 4,14,2325,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.14.2324" + VALUE "FileVersion", "4.14.2325" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2324" + VALUE "ProductVersion", "4.14.2325" END END BLOCK "VarFileInfo" From 8546656ee9d0a57233603af2b0941c6af2b291ab Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 18 Mar 2026 12:11:50 +0000 Subject: [PATCH 135/192] [iso] add an exception for 'we don't care about our end-users' Bazzite * See https://github.com/ublue-os/bazzite/issues/4374. Also, great job following STANDARDS, Fedora! * Also silence a warning in libcdio (triggered by Bazzite not knowing of to master their ISOs). --- src/iso.c | 7 +++++-- src/libcdio/iso9660/iso9660_fs.c | 2 +- src/rufus.rc | 10 +++++----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/iso.c b/src/iso.c index 398083d9..f82401df 100644 --- a/src/iso.c +++ b/src/iso.c @@ -387,8 +387,11 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const (safe_stricmp(&psz_basename[strlen(psz_basename) - 4], ".img") == 0)) static_strcpy(img_report.efi_img_path, psz_fullpath); - // Check for the EFI boot entries - if (safe_stricmp(psz_dirname, efi_dirname) == 0) { + // Check for the EFI boot entries. Note that because of Bazzite maintainers' disregard for end users + // (evidenced in https://github.com/ublue-os/bazzite/issues/4374) and Fedora's disregards for standards + // (evidenced in pushing for '/efi/fedora/' to store bootloaders, instead of sticking to '/efi/boot/') + // we check for anything starting with '/efi/' instead of just '/efi/boot/'). + if (safe_strnicmp(psz_dirname, "/efi/", 5) == 0) { for (k = 0; k < ARRAYSIZE(efi_bootname); k++) { for (i = 0; i < ARRAYSIZE(efi_archname); i++) { static_sprintf(bootloader_name, "%s%s.efi", efi_bootname[k], efi_archname[i]); diff --git a/src/libcdio/iso9660/iso9660_fs.c b/src/libcdio/iso9660/iso9660_fs.c index 58d6c6fc..6ef7c4b5 100644 --- a/src/libcdio/iso9660/iso9660_fs.c +++ b/src/libcdio/iso9660/iso9660_fs.c @@ -564,7 +564,7 @@ iso9660_ifs_read_superblock (iso9660_t *p_iso, (next_lsn - p_iso->boot_img[j].lsn) >= 0x4000) { p_iso->boot_img[j].num_sectors = (next_lsn - p_iso->boot_img[j].lsn) * 4; - cdio_warn("Auto-expanding the size of %d-Boot-NoEmul.img", j); +// cdio_warn("Auto-expanding the size of %d-Boot-NoEmul.img", j); } } } diff --git a/src/rufus.rc b/src/rufus.rc index 21bea281..e2cb19ff 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.14.2325" +CAPTION "Rufus 4.14.2326" 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,14,2325,0 - PRODUCTVERSION 4,14,2325,0 + FILEVERSION 4,14,2326,0 + PRODUCTVERSION 4,14,2326,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.14.2325" + VALUE "FileVersion", "4.14.2326" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2325" + VALUE "ProductVersion", "4.14.2326" END END BLOCK "VarFileInfo" From f6d445a9194d60eabba060f0044d59b0ce114383 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 18 Mar 2026 18:58:24 +0000 Subject: [PATCH 136/192] [loc] update Pollock for the new x64 only Poedit installation directory * Oh, and thanks a lot Microsoft for introducing a major .NET regression that prevents file system monitoring from working on anything but the system drive, and causing me to waste a full day trying to sort it out, without success. With this utter bullshit, you have cemented my choice of going with anything but .NET, when creating utility applications in the future... --- res/loc/pollock/Pollock.cs | 22 ++++++++++++++++------ res/loc/pollock/Pollock.csproj | 17 ++++++++++++++--- res/loc/pollock/Pollock.sln | 16 ++++++++-------- res/loc/pollock/app.config | 2 +- res/loc/rufus.loc | 2 +- src/rufus.rc | 10 +++++----- 6 files changed, 45 insertions(+), 24 deletions(-) diff --git a/res/loc/pollock/Pollock.cs b/res/loc/pollock/Pollock.cs index 44af459a..7207e934 100644 --- a/res/loc/pollock/Pollock.cs +++ b/res/loc/pollock/Pollock.cs @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Poedit <-> rufus.loc conversion utility - * Copyright © 2018-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2018-2026 Pete Batard <pete@akeo.ie> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,7 +43,7 @@ using System.Windows.Forms; [assembly: AssemblyProduct("Pollock")] [assembly: AssemblyCopyright("Copyright © 2018-2024 Pete Batard <pete@akeo.ie>")] [assembly: AssemblyTrademark("GNU GPLv3")] -[assembly: AssemblyVersion("1.6.*")] +[assembly: AssemblyVersion("1.7.*")] namespace pollock { @@ -126,6 +126,7 @@ namespace pollock private static bool in_progress = false; private static bool in_on_change = false; private static double speed = 0.0f; + private static FileSystemWatcher watcher; /// <summary> /// Wait for a key to be pressed. @@ -929,7 +930,6 @@ namespace pollock // // Main entrypoint. // - [STAThread] static void Main(string[] args) { // Fix needed for Windows 7 to download from github SSL @@ -948,6 +948,15 @@ namespace pollock Console.WriteLine($"{app_name} {version_str} - Poedit to rufus.loc conversion utility"); Console.WriteLine(); + // Microsoft BROKE FileSystemWatcher on non system drives sometime in the past two years + // (can't detect any changes if not) so make sure the dir is on the system drive. + if (!app_dir.StartsWith(Path.GetPathRoot(Environment.SystemDirectory))) + { + Console.WriteLine("ERROR: The directory where you run this executable MUST reside somewhere on your C:\\ drive."); + Console.WriteLine("This annoying regression is brought to you by the Microsoft .NET team - Thank you Microsoft!"); + goto Exit; + } + string loc_url = "https://github.com/pbatard/rufus/raw/master/res/loc/rufus.loc"; string ver_url = "https://rufus.ie/Loc.ver"; string rufus_url = null; @@ -1189,15 +1198,16 @@ Retry: goto Exit; // Watch for file modifications - FileSystemWatcher watcher = new FileSystemWatcher(); + watcher = new FileSystemWatcher(); + watcher.Error += (s, e) => Console.WriteLine($"FSW Error: {e.GetException()}"); watcher.Path = app_dir; - watcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite; + watcher.NotifyFilter = NotifyFilters.CreationTime | NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.Size; watcher.Filter = po_file; watcher.Changed += new FileSystemEventHandler(OnChanged); watcher.EnableRaisingEvents = true; // Open the file in PoEdit if we can - var poedit = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + @"\Poedit\Poedit.exe"; + var poedit = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Poedit\Poedit.exe"; if (File.Exists(poedit)) { Console.WriteLine(); diff --git a/res/loc/pollock/Pollock.csproj b/res/loc/pollock/Pollock.csproj index ab2e74c0..d19a421e 100644 --- a/res/loc/pollock/Pollock.csproj +++ b/res/loc/pollock/Pollock.csproj @@ -8,27 +8,31 @@ <OutputType>Exe</OutputType> <RootNamespace>pollock</RootNamespace> <AssemblyName>pollock</AssemblyName> - <TargetFrameworkVersion>v4.8</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <TargetFrameworkProfile /> </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> + <PlatformTarget>x64</PlatformTarget> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> + <LangVersion>8.0</LangVersion> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugType>pdbonly</DebugType> + <PlatformTarget>x64</PlatformTarget> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> + <LangVersion>8.0</LangVersion> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> @@ -55,6 +59,13 @@ <ItemGroup> <None Include="app.config" /> </ItemGroup> + <ItemGroup> + <BootstrapperPackage Include=".NETFramework,Version=v4.8"> + <Visible>False</Visible> + <ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName> + <Install>true</Install> + </BootstrapperPackage> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Target Name="PostBuildMacros"> <GetAssemblyIdentity AssemblyFiles="$(TargetPath)"> diff --git a/res/loc/pollock/Pollock.sln b/res/loc/pollock/Pollock.sln index 602c1777..601e6b5c 100644 --- a/res/loc/pollock/Pollock.sln +++ b/res/loc/pollock/Pollock.sln @@ -1,20 +1,20 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27703.2035 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.37111.16 d17.14 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pollock", "Pollock.csproj", "{759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}.Release|Any CPU.Build.0 = Release|Any CPU + {759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}.Debug|x64.ActiveCfg = Debug|x64 + {759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}.Debug|x64.Build.0 = Debug|x64 + {759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}.Release|x64.ActiveCfg = Release|x64 + {759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/res/loc/pollock/app.config b/res/loc/pollock/app.config index 3e0e37cf..eca069e4 100644 --- a/res/loc/pollock/app.config +++ b/res/loc/pollock/app.config @@ -1,3 +1,3 @@ <?xml version="1.0" encoding="utf-8"?> <configuration> -<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration> +<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1"/></startup></configuration> diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index e262b456..ca8e5d1d 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -3,7 +3,7 @@ ######################################################################### # List of all languages included in this file (with version) -# • v4.14 "en-US" "English (English)" +# • v4.14 "en-US" "English (English)" # • v4.5 "ar-SA" "Arabic (العربية)" # • v3.22 "bg-BG" "Bulgarian (Български)" # • v4.5 "zh-CN" "Chinese Simplified (简体中文)" diff --git a/src/rufus.rc b/src/rufus.rc index e2cb19ff..4aa71aa0 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.14.2326" +CAPTION "Rufus 4.14.2327" 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,14,2326,0 - PRODUCTVERSION 4,14,2326,0 + FILEVERSION 4,14,2327,0 + PRODUCTVERSION 4,14,2327,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.14.2326" + VALUE "FileVersion", "4.14.2327" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2326" + VALUE "ProductVersion", "4.14.2327" END END BLOCK "VarFileInfo" From 4a38a142425ee60fe70dce92f85c6485e34090e3 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 19 Mar 2026 12:26:10 +0000 Subject: [PATCH 137/192] [loc] update Pollock to perform our own file monitoring * Polling works and I don't like being taken for a fool by Microsoft. Gotta wonder how much AI was involved in recent .NET updates... --- res/loc/pollock/Pollock.cs | 112 ++++++++++++++++--------------------- src/rufus.rc | 10 ++-- 2 files changed, 52 insertions(+), 70 deletions(-) diff --git a/res/loc/pollock/Pollock.cs b/res/loc/pollock/Pollock.cs index 7207e934..79814033 100644 --- a/res/loc/pollock/Pollock.cs +++ b/res/loc/pollock/Pollock.cs @@ -43,7 +43,7 @@ using System.Windows.Forms; [assembly: AssemblyProduct("Pollock")] [assembly: AssemblyCopyright("Copyright © 2018-2024 Pete Batard <pete@akeo.ie>")] [assembly: AssemblyTrademark("GNU GPLv3")] -[assembly: AssemblyVersion("1.7.*")] +[assembly: AssemblyVersion("1.8.*")] namespace pollock { @@ -124,9 +124,7 @@ namespace pollock private static int download_status; private static int console_x_pos; private static bool in_progress = false; - private static bool in_on_change = false; private static double speed = 0.0f; - private static FileSystemWatcher watcher; /// <summary> /// Wait for a key to be pressed. @@ -884,49 +882,6 @@ namespace pollock return (response == ConsoleKey.Y); } - // Event handler for FileSystemWatcher. As usual, this is a completely BACKWARDS - // implementation by Microsoft that has to be worked around with timers and stuff... - private static void OnChanged(object source, FileSystemEventArgs e) - { - if (in_on_change) - return; - in_on_change = true; - FileInfo file = new FileInfo(e.FullPath); - FileStream stream = null; - if (file.LastWriteTime >= last_changed.AddMilliseconds(250)) - { - // File may still be locked by Poedit => detect that - bool file_locked = true; - do - { - try - { - stream = file.Open(FileMode.Open, FileAccess.Read, FileShare.None); - file_locked = false; - } - catch (IOException) - { - if (cancel_requested) - break; - Thread.Sleep(100); - } - finally - { - if (!file_locked) - { - if (stream != null) - stream.Close(); - last_changed = file.LastWriteTime; - Console.Write(file.LastWriteTime.ToLongTimeString() + " - "); - UpdateLocFile(ParsePoFile(e.FullPath)); - } - } - } - while (file_locked); - } - in_on_change = false; - } - // // Main entrypoint. // @@ -948,15 +903,6 @@ namespace pollock Console.WriteLine($"{app_name} {version_str} - Poedit to rufus.loc conversion utility"); Console.WriteLine(); - // Microsoft BROKE FileSystemWatcher on non system drives sometime in the past two years - // (can't detect any changes if not) so make sure the dir is on the system drive. - if (!app_dir.StartsWith(Path.GetPathRoot(Environment.SystemDirectory))) - { - Console.WriteLine("ERROR: The directory where you run this executable MUST reside somewhere on your C:\\ drive."); - Console.WriteLine("This annoying regression is brought to you by the Microsoft .NET team - Thank you Microsoft!"); - goto Exit; - } - string loc_url = "https://github.com/pbatard/rufus/raw/master/res/loc/rufus.loc"; string ver_url = "https://rufus.ie/Loc.ver"; string rufus_url = null; @@ -1197,15 +1143,6 @@ Retry: if (maintainer_mode) goto Exit; - // Watch for file modifications - watcher = new FileSystemWatcher(); - watcher.Error += (s, e) => Console.WriteLine($"FSW Error: {e.GetException()}"); - watcher.Path = app_dir; - watcher.NotifyFilter = NotifyFilters.CreationTime | NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.Size; - watcher.Filter = po_file; - watcher.Changed += new FileSystemEventHandler(OnChanged); - watcher.EnableRaisingEvents = true; - // Open the file in PoEdit if we can var poedit = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Poedit\Poedit.exe"; if (File.Exists(poedit)) @@ -1237,7 +1174,52 @@ Retry: Console.SetCursorPosition(0, Console.CursorTop - 1); Console.WriteLine("Running Poedit... "); DateTime launch_date = DateTime.Now; - process.WaitForExit(); + + // Somehow, Palp... I mean, Microsoft broke FileSystemWatcher, so perform our own file system monitoring + var info = new FileInfo(po_file); + var length = info.Length; + var write_time = info.LastWriteTime; + var create_time = info.CreationTime; + while (!process.WaitForExit(500)) + { + info = new FileInfo(po_file); + if (info.Length != length || info.LastWriteTime != write_time || info.CreationTime != create_time) + { + FileStream stream = null; + if (info.LastWriteTime >= last_changed.AddMilliseconds(250)) + { + // File may still be locked by Poedit => detect that + bool file_locked = true; + do + { + try + { + stream = info.Open(FileMode.Open, FileAccess.Read, FileShare.None); + file_locked = false; + } + catch (IOException) + { + if (cancel_requested) + break; + Thread.Sleep(100); + } + finally + { + if (!file_locked) + { + if (stream != null) + stream.Close(); + last_changed = info.LastWriteTime; + Console.Write(info.LastWriteTime.ToLongTimeString() + " - "); + UpdateLocFile(ParsePoFile(info.FullName)); + } + } + } + while (file_locked); + } + } + } + Console.WriteLine($"Poedit {((DateTime.Now - launch_date).Milliseconds < 100? "is already running (?)..." : "was closed.")}"); // Delete the .mo files which we don't need var dir = new DirectoryInfo(app_dir); diff --git a/src/rufus.rc b/src/rufus.rc index 4aa71aa0..1296ce88 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.14.2327" +CAPTION "Rufus 4.14.2328" 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,14,2327,0 - PRODUCTVERSION 4,14,2327,0 + FILEVERSION 4,14,2328,0 + PRODUCTVERSION 4,14,2328,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.14.2327" + VALUE "FileVersion", "4.14.2328" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2327" + VALUE "ProductVersion", "4.14.2328" END END BLOCK "VarFileInfo" From fa6c02f6771e51562c6e17ab0f3adfb50ab3ab3a Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Fri, 20 Mar 2026 15:27:21 +0000 Subject: [PATCH 138/192] [loc] fix a whitespace issues for English * Also revert the adding of single quotes in MSG_332, as it may create issues. --- res/loc/rufus.loc | 4 ++-- src/rufus.rc | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index ca8e5d1d..cce6317d 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -586,7 +586,7 @@ t MSG_328 "Customize Windows installation?" t MSG_329 "Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0" t MSG_330 "Remove requirement for an online Microsoft account" t MSG_331 "Disable data collection (Skip privacy questions)" -t MSG_332 "Prevent 'Windows To Go' from accessing internal disks" +t MSG_332 "Prevent Windows To Go from accessing internal disks" t MSG_333 "Create a local account with username:" t MSG_334 "Set regional options to the same values as this user's" t MSG_335 "Disable BitLocker automatic device encryption" @@ -622,7 +622,7 @@ t MSG_354 "Rufus has found an updated version of the DBX files used to perform U t MSG_355 "⚠SILENTLY⚠ erase disk and install:" t MSG_356 "You have selected to use the \"silent\" Windows installation option.\n\n" "This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the " - "first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n\nIf this is not what you want, please select 'No'" + "first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n\nIf this is not what you want, please select 'No' " "to go back and uncheck the option.\nOtherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." t MSG_358 "Unsupported image location" t MSG_359 "You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n\n" diff --git a/src/rufus.rc b/src/rufus.rc index 1296ce88..4ac6b882 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.14.2328" +CAPTION "Rufus 4.14.2329" 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,14,2328,0 - PRODUCTVERSION 4,14,2328,0 + FILEVERSION 4,14,2329,0 + PRODUCTVERSION 4,14,2329,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.14.2328" + VALUE "FileVersion", "4.14.2329" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2328" + VALUE "ProductVersion", "4.14.2329" END END BLOCK "VarFileInfo" From 71daa2871f5efcd95476d7d929f131559279fcfc Mon Sep 17 00:00:00 2001 From: Aldis Tutins <alibaba@inbox.lv> Date: Mon, 23 Mar 2026 18:29:30 +0000 Subject: [PATCH 139/192] [loc] update Latvian translation to latest --- res/loc/po/lv-LV.po | 144 ++++++++++++++++++++++++++++++++++++++++---- res/loc/rufus.loc | 31 ++++++++-- src/rufus.rc | 10 +-- 3 files changed, 164 insertions(+), 21 deletions(-) diff --git a/res/loc/po/lv-LV.po b/res/loc/po/lv-LV.po index 7c9f0c59..de54ea2b 100644 --- a/res/loc/po/lv-LV.po +++ b/res/loc/po/lv-LV.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-05-14 16:22+0100\n" -"PO-Revision-Date: 2024-05-14 16:22+0100\n" +"POT-Creation-Date: 2026-03-23 18:24+0000\n" +"PO-Revision-Date: 2026-03-23 18:25+0000\n" "Last-Translator: \n" "Language-Team: \n" "Language: lv_LV\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Latvian (Latviešu)\n" "X-Rufus-LCID: 0x0426\n" -"X-Generator: Poedit 3.4.4\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -846,7 +846,7 @@ msgstr "Nav sadaļas" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Fiksētās sadaļas apjoma izvēle uz USB nesēja. Ja nav fiksētās sadaļas ievadiet 0." @@ -888,13 +888,13 @@ msgstr "Citai programmai vai procesam ir piekļuve šai ierīcei. Vienalga vēla #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Rufus noteica, ka mēģinat veidot Windows To Go disku formātā 1809 ISO\n" +"Rufus noteica, ka mēģinat veidot 'Windows To Go' disku formātā 1809 ISO\n" "\n" "Atsaucoties uz *MICROSOFT BUG*, šis nesējs var izsaukt Windows ielādes kļūdu (BSOD), šādā gadījumā nepieciešams manuāli samainīt 'WppRecorder.sys' failu uz 1803 versiju.\n" "\n" @@ -1796,6 +1796,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Neizdevās atvērt vai izlasīt '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Instalēšanas laikā izmantojiet SkuSiPolicy.p7b (skatiet KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "QoL uzlabojumi (attiecas uz Copilot, OneDrive, Outlook, Fast Startup utt.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Pielietot Windows kastomizāciju: %s" @@ -1846,15 +1854,15 @@ msgstr "Pastāvīgs žurnāls" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Lai instalēt MS-DOS no Microsoft vietnes nepieciešams lejuplādēt papildus failu («diskcopy.dll»):\n" -"- Izvēlieties «Jā», lai pieslēgties pie Interneta un failu lejuplādēt.\n" -"- Izvēlieties «Nē», lai atcelt darbību.\n" +"Lai izmantotu šo funkciju, no Microsoft ir jālejupielādē papildu fails ('%s'):\n" +"- Izvēlieties 'Jā', lai pieslēgties pie Interneta un failu lejuplādēt.\n" +"- Izvēlieties 'Nē', lai atcelt darbību.\n" "\n" "Piezīme. Fails tiks lejuplādēts programmas mapē, ja tas jau eksistē, tiks izmantots atkārtoti." @@ -1920,6 +1928,118 @@ msgstr "Atpakot arhīva failus: %s" msgid "Use Rufus MBR" msgstr "Izmantot Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Izmantojiet Windows CA 2023' parakstītus ielādētājus (nepieciešams saderīgs dators)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Notiek UEFI ielādētāja atsaukšanas pārbaude..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Notiek UEFI DBX atjauninājumu pārbaude..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "Pieejams DBX atjauninājums" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus ir atradis atjauninātu DBX failu versiju, ko izmanto, lai veiktu UEFI Secure Boot atsaukšanas pārbaudes. Vai vēlaties lejupielādēt šo atjauninājumu?\n" +"- Izvēlieties 'Jā', lai pieslēgties internetam un lejupielādēt šo saturu\n" +"- Izvēlieties 'Nē', lai atceltu darbību\n" +"\n" +"Piezīme. Faili tiks lejupielādēti programmas direktorijā un ja tādi jau ir, tie tiks automātiski izmantoti atkārtoti." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠KLUSĀ⚠ diska dzēšana un instalācija:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Ir izvēlēta \"klusā\" Windows instalēšanas opcija.\n" +"\n" +"Šī ir uzlabota opcija, kas paredzēta tiem, kuri vēlas izveidot datu nesēju, kas lietotājam Windows instalēšanas laikā neko neprasa un BEZNOSACĪJUMĀ DZĒŠ pirmo atrasto disku. Ja neesat piesardzīgs, šīs opcijas izmantošana var izraisīt NEATGRIEZENISKU DATU ZAUDĒJUMU!\n" +"\n" +"Ja tas nav tas, ko vēlaties, izvēlieties 'Nē', lai atgrieztos un noņemiet atzīmi no opcijas.\n" +"Pretējā gadījumā, ja izvēlaties 'Jā', tad PIEKRĪTAT atbildībai par iespējamo datu zudumu." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Neatbalstīta instalācijas atrašanās vieta" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Nevar izmantot instalāciju, kas atrodas mērķa diskā, jo šis disks tiks pilnībā izdzēsts. Tas ir tas pats, kas mēģināt zāģēt zaru, uz kura sēdi!\n" +"\n" +"Pārvietojiet instalāciju uz citu vietu un mēģiniet vēlreiz." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Šo opciju var atstāt iespējotu pat tad, ja ir TPM vai vairāk RAM, jo šī opcija tikai apiet iestatīšanas prasības un faktiski neliedz OS Windows izmantot visu pieejamo aparatūru." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Lai šī opcija darbotos, instalēšanas laikā OBLIGĀTI jāatvieno tīkls/internets!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Automātiski uz Windows iestatīšanas jautājumiem, kas saistīti datu koplietošanai ar Microsoft, atbilde būs 'nē' tā vietā, lai prasīt lietotājam." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Šī opcija ir jāatstāj iespējota, ja vien 'Windows To Go' nevar piekļūt iekšējiem diskiem un klusi veikt neatgriezeniskus failu sistēmas jauninājumus." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Automātiski izveidos lokālo kontu ar norādīto lietotājvārdu, izmantojot tukšu paroli, kas būs jāmaina nākamajā pieteikšanās reizē." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Dublēs reģionālos iestatījumus no šī datora (tastatūra, laika josla, valūta), tā vietā, lai prasīt lietotājam." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Nešifrēs sistēmas disku, ja vien to neaktivizēs lietotājs." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Izmantojiet šo opciju tikai tad, ja zināt, kas ir S-Mode, un saprotat, ka sistēma var tikt bloķēta S-režīmā pat pēc pilnīgas Windows dzēšanas un atkārtotas instalēšanas." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Izmantojiet šo opciju, ja sistēma, kurā plānojat instalēt sistēmu Windows, izmanto pilnībā atjauninātus Secure Boot sertifikātus. Ja nepieciešams, sistēmas atjaunināšanai varat izmantot Mosby." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Izmantojiet šo opciju, ja vēlaties atsaukt papildu potenciāli nedrošos Windows ielādētājus, taču var arī novērst standarta Windows multivides palaišanu." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "\"Quality of Life\" uzlabojumi: Tiks atspējota lielākā daļu nevēlamo funkciju, ko Microsoft mēģina uzspiest lietotājiem." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Ja izmantojat šo opciju, atvienojiet visus diskus no mērķa datora, izņemot to, kurā vēlaties instalēt OS Windows, kā arī neatstājiet multividi, kuru nevēlaties dzēst, pievienotu nevienam no datoriem." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index cce6317d..9c3995a1 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -22,7 +22,7 @@ # • v4.5 "it-IT" "Italian (Italiano)" # • v4.5 "ja-JP" "Japanese (日本語)" # • v4.5 "ko-KR" "Korean (한국어)" -# • v4.5 "lv-LV" "Latvian (Latviešu)" +# • v4.14 "lv-LV" "Latvian (Latviešu)" # • v3.22 "lt-LT" "Lithuanian (Lietuvių)" # • v3.22 "ms-MY" "Malay (Bahasa Malaysia)" # • v4.5 "nb-NO" "Norwegian (Norsk)" @@ -8215,7 +8215,7 @@ t MSG_922 "UEFI Shell ISO 다운로드" ######################################################################### l "lv-LV" "Latvian (Latviešu)" 0x0426 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -8403,7 +8403,7 @@ t MSG_129 "Tikko tika izveidots nesējs ar UEFI:NTFS ielādi. Atcerieties, lai p t MSG_130 "Windows virtuālā attēla izvēle" t MSG_131 "Šis ISO satur vairāku Windows OS virtuālos attēlus.\nIzvēlieties virtuālo attēlu, kuru vēlaties izmantot instalācijai:" t MSG_132 "Citai programmai vai procesam ir piekļuve šai ierīcei. Vienalga vēlaties formatēt?" -t MSG_133 "Rufus noteica, ka mēģinat veidot Windows To Go disku formātā 1809 ISO\n\nAtsaucoties uz *MICROSOFT BUG*, šis nesējs var izsaukt Windows ielādes kļūdu (BSOD), šādā gadījumā nepieciešams manuāli samainīt 'WppRecorder.sys' failu uz 1803 versiju.\n\nRufus automātiski nemaina šo failu, jo 'WppRecorder.sys' ir Microsoft īpašums, un legāli ievietot failu programmā nav iespējams..." +t MSG_133 "Rufus noteica, ka mēģinat veidot 'Windows To Go' disku formātā 1809 ISO\n\nAtsaucoties uz *MICROSOFT BUG*, šis nesējs var izsaukt Windows ielādes kļūdu (BSOD), šādā gadījumā nepieciešams manuāli samainīt 'WppRecorder.sys' failu uz 1803 versiju.\n\nRufus automātiski nemaina šo failu, jo 'WppRecorder.sys' ir Microsoft īpašums, un legāli ievietot failu programmā nav iespējams..." t MSG_134 "Tā kā par ielādes sadaļu tika izvēlēts MBR, Rufus var izveidot sadaļu ar apjomu līdz 2 TB, pēc kā paliks %s brīvi pieejamas diska vietas papildus sadaļām.\n\nVēlaties turpināt?" t MSG_135 "Versija" t MSG_136 "Laidiens" @@ -8590,6 +8590,8 @@ t MSG_319 "Ignorēt ielādes marķeri" t MSG_320 "Atjauno sadaļas izkārtojumu (%s)..." t MSG_321 "Izvēlētais virtuālais attēls ir ISOHybrid, bet tā veidotājs nav izveidojis ISO/Failu kopēšanas .\nTiks izmantots DD virtuālā attēla kopēšanas režīms." t MSG_322 "Neizdevās atvērt vai izlasīt '%s'" +t MSG_323 "Instalēšanas laikā izmantojiet SkuSiPolicy.p7b (skatiet KB5042562)" +t MSG_324 "QoL uzlabojumi (attiecas uz Copilot, OneDrive, Outlook, Fast Startup utt.)" t MSG_325 "Pielietot Windows kastomizāciju: %s" t MSG_326 "Lietotāja opciju pielietošana..." t MSG_327 "Windows lietotāju pieredze" @@ -8602,7 +8604,7 @@ t MSG_333 "Izveidot lokālo kontu ar lietotājvārdu:" t MSG_334 "Izvēlēties reģionālos uzstādījumus kā šim lietotājam" t MSG_335 "Atslēgt automātisko šifrēšanu ar BitLocker" t MSG_336 "Pastāvīgs žurnāls" -t MSG_337 "Lai izmantotu šo funkciju, no Microsoft ir jālejupielādē papildu fails («%s»):\n- Izvēlieties «Jā», lai pieslēgties pie Interneta un failu lejuplādēt.\n- Izvēlieties «Nē», lai atcelt darbību.\n\nPiezīme. Fails tiks lejuplādēts programmas mapē, ja tas jau eksistē, tiks izmantots atkārtoti." +t MSG_337 "Lai izmantotu šo funkciju, no Microsoft ir jālejupielādē papildu fails ('%s'):\n- Izvēlieties 'Jā', lai pieslēgties pie Interneta un failu lejuplādēt.\n- Izvēlieties 'Nē', lai atcelt darbību.\n\nPiezīme. Fails tiks lejuplādēts programmas mapē, ja tas jau eksistē, tiks izmantots atkārtoti." t MSG_338 "Pamanīts atceltais UEFI ielādes ieraksts" t MSG_339 "Rufus konstatēja Jūsu izvēlētais ISO-fails satur atceltu UEFI ielādes ierakstu, kurš izdos %s, ja būs ieslēgta drošā ielāde pilnīgi jauninātajā UEFI sistēmā.\n\n- Ja šis ISO fails ir iegūts no nedrošiem avotiem, vajag ņemt vērā, ka tas var saturēt UEFI ļaunatūru un censties no tā nestartēt.\n- Ja fails iegūts no droša avota, būtu jāatrod jaunāka versija, kurai nerādīs šādu brīdinājumu." t MSG_340 "a \"Drošības pārkāpuma\" ekrāns" @@ -8615,6 +8617,27 @@ t MSG_346 "Ierobežot Windows tikai S režīmā (NESADERĪGS ar tiešsaistes kon t MSG_347 "Eksperta režīms" t MSG_348 "Atpakot arhīva failus: %s" t MSG_349 "Izmantot Rufus MBR" +t MSG_350 "Izmantojiet Windows CA 2023' parakstītus ielādētājus (nepieciešams saderīgs dators)" +t MSG_351 "Notiek UEFI ielādētāja atsaukšanas pārbaude..." +t MSG_352 "Notiek UEFI DBX atjauninājumu pārbaude..." +t MSG_353 "Pieejams DBX atjauninājums" +t MSG_354 "Rufus ir atradis atjauninātu DBX failu versiju, ko izmanto, lai veiktu UEFI Secure Boot atsaukšanas pārbaudes. Vai vēlaties lejupielādēt šo atjauninājumu?\n- Izvēlieties 'Jā', lai pieslēgties internetam un lejupielādēt šo saturu\n- Izvēlieties 'Nē', lai atceltu darbību\n\nPiezīme. Faili tiks lejupielādēti programmas direktorijā un ja tādi jau ir, tie tiks automātiski izmantoti atkārtoti." +t MSG_355 "⚠KLUSĀ⚠ diska dzēšana un instalācija:" +t MSG_356 "Ir izvēlēta \"klusā\" Windows instalēšanas opcija.\n\nŠī ir uzlabota opcija, kas paredzēta tiem, kuri vēlas izveidot datu nesēju, kas lietotājam Windows instalēšanas laikā neko neprasa un BEZNOSACĪJUMĀ DZĒŠ pirmo atrasto disku. Ja neesat piesardzīgs, šīs opcijas izmantošana var izraisīt NEATGRIEZENISKU DATU ZAUDĒJUMU!\n\nJa tas nav tas, ko vēlaties, izvēlieties 'Nē', lai atgrieztos un noņemiet atzīmi no opcijas.\nPretējā gadījumā, ja izvēlaties 'Jā', tad PIEKRĪTAT atbildībai par iespējamo datu zudumu." +t MSG_358 "Neatbalstīta instalācijas atrašanās vieta" +t MSG_359 "Nevar izmantot instalāciju, kas atrodas mērķa diskā, jo šis disks tiks pilnībā izdzēsts. Tas ir tas pats, kas mēģināt zāģēt zaru, uz kura sēdi!\n\nPārvietojiet instalāciju uz citu vietu un mēģiniet vēlreiz." +t MSG_360 "Šo opciju var atstāt iespējotu pat tad, ja ir TPM vai vairāk RAM, jo šī opcija tikai apiet iestatīšanas prasības un faktiski neliedz OS Windows izmantot visu pieejamo aparatūru." +t MSG_361 "Lai šī opcija darbotos, instalēšanas laikā OBLIGĀTI jāatvieno tīkls/internets!" +t MSG_362 "Automātiski uz Windows iestatīšanas jautājumiem, kas saistīti datu koplietošanai ar Microsoft, atbilde būs 'nē' tā vietā, lai prasīt lietotājam." +t MSG_363 "Šī opcija ir jāatstāj iespējota, ja vien 'Windows To Go' nevar piekļūt iekšējiem diskiem un klusi veikt neatgriezeniskus failu sistēmas jauninājumus." +t MSG_364 "Automātiski izveidos lokālo kontu ar norādīto lietotājvārdu, izmantojot tukšu paroli, kas būs jāmaina nākamajā pieteikšanās reizē." +t MSG_365 "Dublēs reģionālos iestatījumus no šī datora (tastatūra, laika josla, valūta), tā vietā, lai prasīt lietotājam." +t MSG_366 "Nešifrēs sistēmas disku, ja vien to neaktivizēs lietotājs." +t MSG_367 "Izmantojiet šo opciju tikai tad, ja zināt, kas ir S-Mode, un saprotat, ka sistēma var tikt bloķēta S-režīmā pat pēc pilnīgas Windows dzēšanas un atkārtotas instalēšanas." +t MSG_368 "Izmantojiet šo opciju, ja sistēma, kurā plānojat instalēt sistēmu Windows, izmanto pilnībā atjauninātus Secure Boot sertifikātus. Ja nepieciešams, sistēmas atjaunināšanai varat izmantot Mosby." +t MSG_369 "Izmantojiet šo opciju, ja vēlaties atsaukt papildu potenciāli nedrošos Windows ielādētājus, taču var arī novērst standarta Windows multivides palaišanu." +t MSG_370 "\"Quality of Life\" uzlabojumi: Tiks atspējota lielākā daļu nevēlamo funkciju, ko Microsoft mēģina uzspiest lietotājiem." +t MSG_371 "Ja izmantojat šo opciju, atvienojiet visus diskus no mērķa datora, izņemot to, kurā vēlaties instalēt OS Windows, kā arī neatstājiet multividi, kuru nevēlaties dzēst, pievienotu nevienam no datoriem." t MSG_900 "Rufus ir instruments ar kura palīdzību var formatēt un izveidot USB ielādes ierīces uz tādiem nesējiem, kā USB pieslēguma zibatmiņas, atmiņas kartes u.c." t MSG_901 "Oficiālā mājas lapa: %s" t MSG_902 "Sākotnējais kods: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 4ac6b882..5641c4ba 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.14.2329" +CAPTION "Rufus 4.14.2330" 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,14,2329,0 - PRODUCTVERSION 4,14,2329,0 + FILEVERSION 4,14,2330,0 + PRODUCTVERSION 4,14,2330,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.14.2329" + VALUE "FileVersion", "4.14.2330" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2329" + VALUE "ProductVersion", "4.14.2330" END END BLOCK "VarFileInfo" From 94964ced6a62561877fea095a91e036683923f9b Mon Sep 17 00:00:00 2001 From: Richard Kahl <richard.kahl@seznam.cz> Date: Mon, 23 Mar 2026 18:36:35 +0000 Subject: [PATCH 140/192] [loc] update Czech translation to latest --- res/loc/po/cs-CZ.po | 150 +++++++++++++++++++++++++++++++++++++++----- res/loc/rufus.loc | 31 +++++++-- src/rufus.rc | 10 +-- 3 files changed, 167 insertions(+), 24 deletions(-) diff --git a/res/loc/po/cs-CZ.po b/res/loc/po/cs-CZ.po index 4a2dcac8..68f1bffa 100644 --- a/res/loc/po/cs-CZ.po +++ b/res/loc/po/cs-CZ.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-04-25 20:58+0200\n" -"PO-Revision-Date: 2024-04-25 21:23+0200\n" +"POT-Creation-Date: 2026-03-23 18:33+0000\n" +"PO-Revision-Date: 2026-03-23 18:33+0000\n" "Last-Translator: \n" "Language-Team: \n" "Language: cs_CZ\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Czech (Čeština)\n" "X-Rufus-LCID: 0x0405\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -310,7 +310,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -395,7 +395,7 @@ msgstr "Zařízení USB (Obecné)" #. • MSG_046 msgid "%s (Disk %d) [%s]" -msgstr "%s (Disk %d) [%s]" +msgstr "" #. • MSG_047 #. @@ -848,7 +848,7 @@ msgstr "Ne trvalý" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Nastavte velikost trvalého oddílu pro živá média USB. Nastavení velikosti 0 zakáže trvalý oddíl." @@ -890,17 +890,17 @@ msgstr "K tomuto disku přistupuje jiný program nebo proces. Chcete ho přesto #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Rufus zjistil, že se pokoušíte vytvořit Windows To Go médií založené na 1809 ISO.\n" +"Rufus zjistil, že se pokoušíte vytvořit médium „Windows To Go“ založené na 1809 ISO.\n" "\n" -"Vzhledem k tomu, že *MICROSOFT BUG*, toto médium se při spouštění systému Windows zhroutí (Blue Screen), pokud soubor „WppRecorder.sys“ ručně nenahradíte verzí 1803.\n" +"Kvůli chybě *MICROSOFT BUG* dojde k pádu tohoto média během spouštění systému Windows (modrá obrazovka smrti), pokud ručně nenahradíte soubor 'WppRecorder.sys' verzí 1803..\n" "\n" -"Důvodem proč Rufus nemůže automaticky opravit, je, že soubor „WppRecorder.sys“ je souborem chráněným autorskými právy společnosti Microsoft, takže nemůžeme legálně vložit kopii souboru do aplikace..." +"Všimněte si také, že důvod, proč to Rufus nemůže automaticky opravit za vás, je ten, že „WppRecorder.sys“ je soubor chráněný autorským právem společnosti Microsoft, takže nemůžeme legálně vložit kopii souboru do aplikace..." #. • MSG_134 msgid "" @@ -1799,6 +1799,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Nelze otevřít nebo přečíst soubor '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Při instalaci použijte SkuSiPolicy.p7b (viz KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "QoL vylepšení (neinstaluje Copilota, OneDrive, Outlook, rychlé spuštění atd.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Použití přizpůsobení systému Windows: %s" @@ -1849,17 +1857,17 @@ msgstr "Trvalý protokol" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Pro instalaci systému MS-DOS je nutné stáhnout další soubor ('diskcopy.dll') od společnosti Microsoft:\n" -"- Vyberte 'Ano' pro připojení k internetu a stažení\n" +"Další soubor ('%s') je nutné stáhnout ze stránek společnosti Microsoft, aby bylo možné tuto funkci používat:\n" +"- Výběrem možnosti \"Ano\" se připojíte k Internetu a stáhnete ji.\n" "- Výběrem možnosti \"Ne\" operaci zrušíte\n" "\n" -"Poznámka: Soubor bude stažen do adresáře aplikace a bude automaticky znovu použit, pokud je přítomen." +"Poznámka: Soubor bude stažen do adresáře aplikace a bude automaticky znovu použit, pokud je přítomen.." #. • MSG_338 msgid "Revoked UEFI bootloader detected" @@ -1923,6 +1931,118 @@ msgstr "Rozbalení archivních souborů: %s" msgid "Use Rufus MBR" msgstr "Použijte Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Použití zavaděčů s podpisem \"Windows CA 2023\" (vyžaduje kompatibilní cílový počítač)." + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Kontrola zrušení zavaděče UEFI..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Kontrola aktualizací UEFI DBX..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "DBX aktualizace k dispozici" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus našel aktualizovanou verzi souborů DBX používaných k provádění kontrol odvolání UEFI Secure Boot. Chcete stáhnout tuto aktualizaci?\n" +"- Chcete-li se připojit k Internetu a stáhnout tento obsah, vyberte možnost \"Ano\".\n" +"- Výběrem možnosti \"Ne\" operaci zrušíte\n" +"\n" +"Poznámka: Soubory budou staženy do adresáře aplikace a budou automaticky znovu použity, pokud jsou k dispozici." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠TICHÁ⚠ vymazat disk a nainstalovat:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Zvolili jste použití možnosti \"tichá“ instalace systému Windows.\n" +"\n" +"Toto je pokročilá možnost vyhrazená pro uživatele, kteří chtějí vytvořit médium, jež během instalace Windows uživatele nevyzve k potvrzení a BEZPODMÍNEČNĚ VYMAŽE první detekovaný disk v cílovém systému. Pokud si nedáte pozor, použití této volby může mít za následek NEVRATNOU ZTRÁTU VŠECH DAT!\n" +"\n" +"Pokud to není to, co chcete, vyberte 'Ne' pro návrat zpět a zrušte zaškrtnutí této možnosti.\n" +"V opačném případě, pokud zvolíte \"Ano, souhlasíte s tím, že veškerou odpovědnost za případnou ztrátu dat ponesete VY." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Nepodporované umístění obrázku" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Nemůžete použít obraz umístěný na cílové jednotce, protože tato jednotka bude zcela vymazána. Je to stejné, jako když se snažíte uříznout větev, na které sedíte!\n" +"\n" +"Přesuňte prosím obrázek na jiné místo a zkuste to znovu." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Je bezpečné ponechat tuto možnost povolenou i v případě, že máte TPM nebo více RAM, protože tato možnost pouze obchází požadavky na nastavení a ve skutečnosti nebrání systému Windows používat veškerý dostupný hardware." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Aby tato možnost fungovala, MUSÍ být během instalace odpojena síť/internet!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Automaticky odpovídat 'ne' na otázky nastavení systému Windows týkající se sdílení dat se společností Microsoft namísto dotazování uživatele." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Tuto možnost byste měli ponechat povolenou, pokud vám nevadí, že 'Windows To Go' přistupuje k interním diskům a tiše provádí nevratné aktualizace souborového systému." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Automaticky vytvořit místní účet se zadaným uživatelským jménem, s prázdným heslem, které bude nutné změnit při příštím přihlášení." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Převzít místní nastavení z tohoto počítače (klávesnice, časové pásmo, měna) bez nutnosti zásahu uživatele." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Nešifrovat systémový disk bez výslovného požadavku uživatele." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Tuto možnost použijte pouze v případě, že víte, co je S-Mode, a chápete, že váš systém může být uzamčen v S-Mode i po úplném vymazání a přeinstalaci systému Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Tuto možnost použijte, pokud systém, do kterého plánujete nainstalovat systém Windows, používá plně aktuální certifikáty Secure Boot. V případě potřeby se můžete podívat na možnost aktualizace systému pomocí nástroje Mosby = More Secure Secure Boot." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Tuto možnost použijte, pokud chcete odebrat další potenciálně nebezpečné zavaděče systému Windows, které však mohou zabránit i zavádění standardních médií systému Windows." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "\"Vylepšení komfortu uživatele\" vylepšení: Zakázat většinu nežádoucích funkcí, které se Microsoft snaží vnucovat koncovým uživatelům." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Pokud použijete tuto možnost, ujistěte se, že jste od cílového počítače odpojili všechny disky kromě toho, na který chcete nainstalovat systém Windows, a nenechávejte médium připojené k žádnému počítači, který nechcete vymazat." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 9c3995a1..f52868dd 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -9,7 +9,7 @@ # • v4.5 "zh-CN" "Chinese Simplified (简体中文)" # • v4.5 "zh-TW" "Chinese Traditional (正體中文)" # • v4.5 "hr-HR" "Croatian (Hrvatski)" -# • v4.5 "cs-CZ" "Czech (Čeština)" +# • v4.14 "cs-CZ" "Czech (Čeština)" # • v4.5 "da-DK" "Danish (Dansk)" # • v4.5 "nl-NL" "Dutch (Nederlands)" # • v4.5 "fi-FI" "Finnish (Suomi)" @@ -2777,7 +2777,7 @@ t MSG_922 "Preuzmite ISO-ove UEFI ljuske" ######################################################################### l "cs-CZ" "Czech (Čeština)" 0x0405 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -2962,7 +2962,7 @@ t MSG_129 "Vytvořili jste médium, které používá zavaděč UEFI: NTFS. Pama t MSG_130 "Vybrat obrazu systému Windows" t MSG_131 "ISO obsahuje více obrazů Windows..\nVyberte prosím obraz, který chcete použít pro tuto instalaci:" t MSG_132 "K tomuto disku přistupuje jiný program nebo proces. Chcete ho přesto formátovat?" -t MSG_133 "Rufus zjistil, že se pokoušíte vytvořit Windows To Go médií založené na 1809 ISO.\n\nVzhledem k tomu, že *MICROSOFT BUG*, toto médium se při spouštění systému Windows zhroutí (Blue Screen), pokud soubor „WppRecorder.sys“ ručně nenahradíte verzí 1803.\n\nDůvodem proč Rufus nemůže automaticky opravit, je, že soubor „WppRecorder.sys“ je souborem chráněným autorskými právy společnosti Microsoft, takže nemůžeme legálně vložit kopii souboru do aplikace..." +t MSG_133 "Rufus zjistil, že se pokoušíte vytvořit médium „Windows To Go“ založené na 1809 ISO.\n\nKvůli chybě *MICROSOFT BUG* dojde k pádu tohoto média během spouštění systému Windows (modrá obrazovka smrti), pokud ručně nenahradíte soubor 'WppRecorder.sys' verzí 1803..\n\nVšimněte si také, že důvod, proč to Rufus nemůže automaticky opravit za vás, je ten, že „WppRecorder.sys“ je soubor chráněný autorským právem společnosti Microsoft, takže nemůžeme legálně vložit kopii souboru do aplikace..." t MSG_134 "Pro schéma oddílu byla vybráno MBR, Rufus na tomto médiu vytvořit pouze oddíl o velikosti až 2 TB, což ponechá místo na disku %s nedostupné.\n\nJste si jistý, že chcete pokračovat?" t MSG_135 "Verze" t MSG_136 "Vydání" @@ -3148,6 +3148,8 @@ t MSG_319 "Ignorovat Boot Marker" t MSG_320 "Obnovení rozložení oddílu (%s)..." t MSG_321 "Vybraný obraz je ISOHybrid, ale jeho tvůrci ho neudělali kompatibilní s režimem kopírování ISO/File..\nV důsledku toho bude vynucen režim zápisu obrázků DD." t MSG_322 "Nelze otevřít nebo přečíst soubor '%s'" +t MSG_323 "Při instalaci použijte SkuSiPolicy.p7b (viz KB5042562)" +t MSG_324 "QoL vylepšení (neinstaluje Copilota, OneDrive, Outlook, rychlé spuštění atd.)" t MSG_325 "Použití přizpůsobení systému Windows: %s" t MSG_326 "Použití uživatelských možností..." t MSG_327 "Uživatelské prostředí systému Windows" @@ -3160,7 +3162,7 @@ t MSG_333 "Vytvořte místní účet s uživatelským jménem:" t MSG_334 "Nastavení regionálních voleb na stejné hodnoty jako u tohoto uživatele" t MSG_335 "Zakázání automatického šifrování zařízení nástrojem BitLocker" t MSG_336 "Trvalý protokol" -t MSG_337 "Pro použití této funkce je nutné stáhnout další soubor ('%s') od společnosti Microsoft::\n- Vyberte 'Ano' pro připojení k internetu a stažení\n- Výběrem možnosti \"Ne\" operaci zrušíte\n\nPoznámka: Soubor bude stažen do adresáře aplikace a bude automaticky znovu použit, pokud je přítomen." +t MSG_337 "Další soubor ('%s') je nutné stáhnout ze stránek společnosti Microsoft, aby bylo možné tuto funkci používat:\n- Výběrem možnosti \"Ano\" se připojíte k Internetu a stáhnete ji.\n- Výběrem možnosti \"Ne\" operaci zrušíte\n\nPoznámka: Soubor bude stažen do adresáře aplikace a bude automaticky znovu použit, pokud je přítomen.." t MSG_338 "Byl zjištěn odvolaný zavaděč UEFI" t MSG_339 "Rufus zjistil, že vámi vybraný ISO obsahuje zavaděč UEFI, který byl odvolán a který vytvoří %s, když je v plně aktuálním systému UEFI povoleno Secure Boot.\n\n- Pokud jste tento obraz ISO získali z nerenomovaného zdroje, měli byste zvážit možnost, že by mohl obsahovat malware UEFI a vyhnout se bootování z něj.\n- Pokud jste jej získali z důvěryhodného zdroje, měli byste se pokusit najít aktuálnější verzi, která toto varování nevyvolá." t MSG_340 "obrazovka \"Porušení zabezpečení\"" @@ -3173,6 +3175,27 @@ t MSG_346 "Omezit Windows na S-Mode (NEKOMPATIBILNÍ s online vynecháním účt t MSG_347 "Expertní režim" t MSG_348 "Rozbalení archivních souborů: %s" t MSG_349 "Použijte Rufus MBR" +t MSG_350 "Použití zavaděčů s podpisem \"Windows CA 2023\" (vyžaduje kompatibilní cílový počítač)." +t MSG_351 "Kontrola zrušení zavaděče UEFI..." +t MSG_352 "Kontrola aktualizací UEFI DBX..." +t MSG_353 "DBX aktualizace k dispozici" +t MSG_354 "Rufus našel aktualizovanou verzi souborů DBX používaných k provádění kontrol odvolání UEFI Secure Boot. Chcete stáhnout tuto aktualizaci?\n- Chcete-li se připojit k Internetu a stáhnout tento obsah, vyberte možnost \"Ano\".\n- Výběrem možnosti \"Ne\" operaci zrušíte\n\nPoznámka: Soubory budou staženy do adresáře aplikace a budou automaticky znovu použity, pokud jsou k dispozici." +t MSG_355 "⚠TICHÁ⚠ vymazat disk a nainstalovat:" +t MSG_356 "Zvolili jste použití možnosti \"tichá“ instalace systému Windows.\n\nToto je pokročilá možnost vyhrazená pro uživatele, kteří chtějí vytvořit médium, jež během instalace Windows uživatele nevyzve k potvrzení a BEZPODMÍNEČNĚ VYMAŽE první detekovaný disk v cílovém systému. Pokud si nedáte pozor, použití této volby může mít za následek NEVRATNOU ZTRÁTU VŠECH DAT!\n\nPokud to není to, co chcete, vyberte 'Ne' pro návrat zpět a zrušte zaškrtnutí této možnosti.\nV opačném případě, pokud zvolíte \"Ano, souhlasíte s tím, že veškerou odpovědnost za případnou ztrátu dat ponesete VY." +t MSG_358 "Nepodporované umístění obrázku" +t MSG_359 "Nemůžete použít obraz umístěný na cílové jednotce, protože tato jednotka bude zcela vymazána. Je to stejné, jako když se snažíte uříznout větev, na které sedíte!\n\nPřesuňte prosím obrázek na jiné místo a zkuste to znovu." +t MSG_360 "Je bezpečné ponechat tuto možnost povolenou i v případě, že máte TPM nebo více RAM, protože tato možnost pouze obchází požadavky na nastavení a ve skutečnosti nebrání systému Windows používat veškerý dostupný hardware." +t MSG_361 "Aby tato možnost fungovala, MUSÍ být během instalace odpojena síť/internet!" +t MSG_362 "Automaticky odpovídat 'ne' na otázky nastavení systému Windows týkající se sdílení dat se společností Microsoft namísto dotazování uživatele." +t MSG_363 "Tuto možnost byste měli ponechat povolenou, pokud vám nevadí, že 'Windows To Go' přistupuje k interním diskům a tiše provádí nevratné aktualizace souborového systému." +t MSG_364 "Automaticky vytvořit místní účet se zadaným uživatelským jménem, s prázdným heslem, které bude nutné změnit při příštím přihlášení." +t MSG_365 "Převzít místní nastavení z tohoto počítače (klávesnice, časové pásmo, měna) bez nutnosti zásahu uživatele." +t MSG_366 "Nešifrovat systémový disk bez výslovného požadavku uživatele." +t MSG_367 "Tuto možnost použijte pouze v případě, že víte, co je S-Mode, a chápete, že váš systém může být uzamčen v S-Mode i po úplném vymazání a přeinstalaci systému Windows." +t MSG_368 "Tuto možnost použijte, pokud systém, do kterého plánujete nainstalovat systém Windows, používá plně aktuální certifikáty Secure Boot. V případě potřeby se můžete podívat na možnost aktualizace systému pomocí nástroje Mosby = More Secure Secure Boot." +t MSG_369 "Tuto možnost použijte, pokud chcete odebrat další potenciálně nebezpečné zavaděče systému Windows, které však mohou zabránit i zavádění standardních médií systému Windows." +t MSG_370 "\"Vylepšení komfortu uživatele\" vylepšení: Zakázat většinu nežádoucích funkcí, které se Microsoft snaží vnucovat koncovým uživatelům." +t MSG_371 "Pokud použijete tuto možnost, ujistěte se, že jste od cílového počítače odpojili všechny disky kromě toho, na který chcete nainstalovat systém Windows, a nenechávejte médium připojené k žádnému počítači, který nechcete vymazat." t MSG_900 "Rufus je nástroj, který pomáhá formátovat a vytvářet bootovací USB flash disky, jako jsou USB klíče, paměťové karty atd." t MSG_901 "Oficiální stránky: %s" t MSG_902 "Zdrojový kód: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 5641c4ba..51e8c8f1 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.14.2330" +CAPTION "Rufus 4.14.2331" 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,14,2330,0 - PRODUCTVERSION 4,14,2330,0 + FILEVERSION 4,14,2331,0 + PRODUCTVERSION 4,14,2331,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.14.2330" + VALUE "FileVersion", "4.14.2331" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2330" + VALUE "ProductVersion", "4.14.2331" END END BLOCK "VarFileInfo" From f2a55b98f390c0668bbb61f259854bbb6f1eef39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=95=D1=80?= =?UTF-8?q?=D0=BE=D1=85=D0=B8=D0=BD?= <erodim@mail.ru> Date: Mon, 23 Mar 2026 18:42:28 +0000 Subject: [PATCH 141/192] [loc] update Russian translation to latest --- res/loc/po/ru-RU.po | 119 +++++++++++++++++++++++++++++++++++++++----- res/loc/rufus.loc | 29 +++++++++-- src/rufus.rc | 10 ++-- 3 files changed, 138 insertions(+), 20 deletions(-) diff --git a/res/loc/po/ru-RU.po b/res/loc/po/ru-RU.po index 8861b865..c7f41270 100644 --- a/res/loc/po/ru-RU.po +++ b/res/loc/po/ru-RU.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2025-11-12 17:40+0000\n" -"PO-Revision-Date: 2025-11-12 17:42+0000\n" +"POT-Creation-Date: 2026-03-23 18:41+0000\n" +"PO-Revision-Date: 2026-03-23 18:41+0000\n" "Last-Translator: \n" "Language-Team: \n" "Language: ru_RU\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Russian (Русский)\n" "X-Rufus-LCID: 0x0419, 0x0819\n" -"X-Generator: Poedit 3.8\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -888,15 +888,15 @@ msgstr "К этому диску обращается другая програ #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Rufus обнаружил, что вы пытаетесь создать носитель Windows To Go на основе ISO 1809.\n" +"Вы пытаетесь создать носитель Windows To Go на основе ISO 1809.\n" "\n" -"Из-за *ОШИБКИ MICROSOFT* этот носитель будет давать сбой при загрузке Windows (BSOD), если вы вручную не замените файл WppRecorder.sys версией 1803.\n" +"Из-за *ОШИБКИ MICROSOFT* этот носитель будет давать сбой (BSOD) при загрузке Windows, если вы вручную не замените файл WppRecorder.sys версией 1803.\n" "\n" "Rufus не может это исправить автоматически, так как WppRecorder.sys - это файл Microsoft, защищённый авторскими правами, поэтому мы не можем легально встраивать в приложение его копию." @@ -1799,6 +1799,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Не удалось открыть или прочитать '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Применить SkuSiPolicy.p7b при установке (см. KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Улучшить жизнь (не принуждать к Copilot, OneDrive, Outlook, быстрому запуску и т.д.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Применение настройки Windows: %s" @@ -1924,20 +1932,20 @@ msgid "Use Rufus MBR" msgstr "Использовать MBR Rufus" #. • MSG_350 -msgid "Use 'Windows CA 2023' signed bootloaders (requires a compatible target PC)" -msgstr "" +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Использовать загрузчики, подписанные 'Windows CA 2023' (требуется совместимый целевой компьютер)" #. • MSG_351 msgid "Checking for UEFI bootloader revocation..." -msgstr "" +msgstr "Проверка отзыва загрузчика UEFI..." #. • MSG_352 msgid "Checking for UEFI DBX updates..." -msgstr "" +msgstr "Проверка обновлений UEFI DBX..." #. • MSG_353 msgid "DBX update available" -msgstr "" +msgstr "Доступно обновление DBX" #. • MSG_354 msgid "" @@ -1947,6 +1955,93 @@ msgid "" "\n" "Note: The files will be downloaded in the application's directory and will be reused automatically if present." msgstr "" +"Обнаружена обновлённая версия файлов DBX, используемых для проверки отзыва безопасной загрузки UEFI. Загрузить это обновление?\n" +"- 'Да': подключиться к Интернету и загрузить этот контент.\n" +"- 'Нет': отменить операцию\n" +"\n" +"* Файлы будут загружены в папку приложения с автоматической перезаписью имеющихся." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠ТИХО⚠ стереть диск и установить:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Вы выбрали вариант \"тихой\" установки Windows.\n" +"\n" +"Это параметр для тех, кто хочет создать носитель, который не запрашивает реакций пользователя при установке Windows и, следовательно, БЕЗУСЛОВНО УДАЛЯЕТ первый обнаруженный диск в целевой системе. Если вы не будете осторожны, использование этой опции может привести к НЕОБРАТИМОЙ ПОТЕРЕ ДАННЫХ!\n" +"\n" +"Если это не то, что вам нужно, выберите 'Нет', чтобы вернуться назад и снять флажок с этой опции.\n" +"При выборе 'Да' вы соглашаетесь, что вся ответственность за любую потерю данных будет полностью лежать на ВАС." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Неподдерживаемое расположение образа" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Нельзя использовать образ, расположенный на целевом диске, поскольку этот диск будет полностью удалён. Это то же самое, как пилить сук, на котором сидишь!\n" +"\n" +"Переместите образ в другое место и повторите попытку." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Эту опцию безопасно оставлять включённой, даже если у вас есть модуль TPM или больше ОЗУ, поскольку данная опция только обходит требования установки и фактически не мешает Windows использовать все доступное оборудование." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Чтобы эта опция работала, сеть/Интернет ДОЛЖНЫ быть отключены во время установки!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Автоматически отвечать 'Нет' на вопросы установщика Windows, касающиеся обмена данными с Microsoft, вместо того, чтобы запрашивать это у пользователя." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Эту опцию следует оставить включённой, если только вас не устраивает доступ Windows To Go к внутренним дискам и автоматическое выполнение необратимых обновлений файловой системы." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Автоматически создавать локальную учётную запись с указанным именем пользователя, используя пустой пароль, который необходимо будет изменить при следующем входе в систему." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Дублировать региональные настройки с этого компьютера (клавиатура, часовой пояс, валюта) вместо запроса пользователя." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Не шифровать системный диск, если это явно не заявлено пользователем." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Используйте эту опцию, только если вы знаете, что такое S-Mode, и понимаете, что ваша система может быть заблокирована в S-Mode даже после того, как вы полностью удалите и переустановите Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Используйте эту опцию, если система, в которой вы планируете установить Windows, использует полностью актуальные сертификаты безопасной загрузки. При необходимости вы можете использовать Mosby для обновления системы." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Используйте эту опцию, чтобы отозвать дополнительные потенциально небезопасные загрузчики Windows, но с возможностью предотвращения загрузки стандартных носителей Windows." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Улучшить жизнь: отключить большинство нежелательных функций, которые Microsoft пытается навязать пользователям." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Если вы используете эту опцию, обязательно отключите от целевого компьютера все диски, кроме того, на котором вы хотите установить Windows, а также не оставляйте носитель подключённым к любому компьютеру, с которого вы не хотите стирать данные." #. • MSG_900 #. diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index f52868dd..1eb83adc 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -31,7 +31,7 @@ # • v4.5 "pt-BR" "Portuguese Brazilian (Português do Brasil)" # • v4.5 "pt-PT" "Portuguese Standard (Português)" # • v4.5 "ro-RO" "Romanian (Română)" -# • v4.5 "ru-RU" "Russian (Русский)" +# • v4.14 "ru-RU" "Russian (Русский)" # • v4.5 "sr-RS" "Serbian (Srpski)" # • v4.5 "sk-SK" "Slovak (Slovensky)" # • v4.5 "sl-SI" "Slovenian (Slovenščina)" @@ -12012,7 +12012,7 @@ t MSG_922 "Descarcă UEFI Shell ISO-uri" ######################################################################### l "ru-RU" "Russian (Русский)" 0x0419, 0x0819 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -12205,7 +12205,7 @@ t MSG_129 "Вы только что создали носитель с загр t MSG_130 "Выбор образа Windows" t MSG_131 "Этот файл ISO содержит несколько образов Windows.\nВыберите образ, который Вы хотите использовать для этой установки:" t MSG_132 "К этому диску обращается другая программа или процесс. Всё равно настаиваете на форматировании?" -t MSG_133 "Rufus обнаружил, что вы пытаетесь создать носитель Windows To Go на основе ISO 1809.\n\nИз-за *ОШИБКИ MICROSOFT* этот носитель будет давать сбой при загрузке Windows (BSOD), если вы вручную не замените файл WppRecorder.sys версией 1803.\n\nRufus не может это исправить автоматически, так как WppRecorder.sys - это файл Microsoft, защищённый авторскими правами, поэтому мы не можем легально встраивать в приложение его копию." +t MSG_133 "Вы пытаетесь создать носитель Windows To Go на основе ISO 1809.\n\nИз-за *ОШИБКИ MICROSOFT* этот носитель будет давать сбой (BSOD) при загрузке Windows, если вы вручную не замените файл WppRecorder.sys версией 1803.\n\nRufus не может это исправить автоматически, так как WppRecorder.sys - это файл Microsoft, защищённый авторскими правами, поэтому мы не можем легально встраивать в приложение его копию." t MSG_134 "Поскольку для схемы разделов выбрана MBR, на этом носителе Rufus может создать только раздел размером до 2 ТБ, а %s дискового пространства останутся недоступными.\n\nВы действительно хотите продолжить?" t MSG_135 "Версия" t MSG_136 "Выпуск" @@ -12392,6 +12392,8 @@ t MSG_319 "Игнорировать загрузочный маркер" t MSG_320 "Обновление макета разделов (%s)..." t MSG_321 "Выбранный образ - ISOHybrid, но создатели не сделали его совместимым с режимом копирования ISO/файла.\nИз-за этого будет применён режим записи образа DD." t MSG_322 "Не удалось открыть или прочитать '%s'" +t MSG_323 "Применить SkuSiPolicy.p7b при установке (см. KB5042562)" +t MSG_324 "Улучшить жизнь (не принуждать к Copilot, OneDrive, Outlook, быстрому запуску и т.д.)" t MSG_325 "Применение настройки Windows: %s" t MSG_326 "Применение параметров пользователя..." t MSG_327 "Опыт использования Windows" @@ -12417,6 +12419,27 @@ t MSG_346 "Ограничить Windows S-режимом (НЕСОВМЕСТИМ t MSG_347 "Экспертный режим" t MSG_348 "Распаковка архивов: %s" t MSG_349 "Использовать MBR Rufus" +t MSG_350 "Использовать загрузчики, подписанные 'Windows CA 2023' (требуется совместимый целевой компьютер)" +t MSG_351 "Проверка отзыва загрузчика UEFI..." +t MSG_352 "Проверка обновлений UEFI DBX..." +t MSG_353 "Доступно обновление DBX" +t MSG_354 "Обнаружена обновлённая версия файлов DBX, используемых для проверки отзыва безопасной загрузки UEFI. Загрузить это обновление?\n- 'Да': подключиться к Интернету и загрузить этот контент.\n- 'Нет': отменить операцию\n\n* Файлы будут загружены в папку приложения с автоматической перезаписью имеющихся." +t MSG_355 "⚠ТИХО⚠ стереть диск и установить:" +t MSG_356 "Вы выбрали вариант \"тихой\" установки Windows.\n\nЭто параметр для тех, кто хочет создать носитель, который не запрашивает реакций пользователя при установке Windows и, следовательно, БЕЗУСЛОВНО УДАЛЯЕТ первый обнаруженный диск в целевой системе. Если вы не будете осторожны, использование этой опции может привести к НЕОБРАТИМОЙ ПОТЕРЕ ДАННЫХ!\n\nЕсли это не то, что вам нужно, выберите 'Нет', чтобы вернуться назад и снять флажок с этой опции.\nПри выборе 'Да' вы соглашаетесь, что вся ответственность за любую потерю данных будет полностью лежать на ВАС." +t MSG_358 "Неподдерживаемое расположение образа" +t MSG_359 "Нельзя использовать образ, расположенный на целевом диске, поскольку этот диск будет полностью удалён. Это то же самое, как пилить сук, на котором сидишь!\n\nПереместите образ в другое место и повторите попытку." +t MSG_360 "Эту опцию безопасно оставлять включённой, даже если у вас есть модуль TPM или больше ОЗУ, поскольку данная опция только обходит требования установки и фактически не мешает Windows использовать все доступное оборудование." +t MSG_361 "Чтобы эта опция работала, сеть/Интернет ДОЛЖНЫ быть отключены во время установки!" +t MSG_362 "Автоматически отвечать 'Нет' на вопросы установщика Windows, касающиеся обмена данными с Microsoft, вместо того, чтобы запрашивать это у пользователя." +t MSG_363 "Эту опцию следует оставить включённой, если только вас не устраивает доступ Windows To Go к внутренним дискам и автоматическое выполнение необратимых обновлений файловой системы." +t MSG_364 "Автоматически создавать локальную учётную запись с указанным именем пользователя, используя пустой пароль, который необходимо будет изменить при следующем входе в систему." +t MSG_365 "Дублировать региональные настройки с этого компьютера (клавиатура, часовой пояс, валюта) вместо запроса пользователя." +t MSG_366 "Не шифровать системный диск, если это явно не заявлено пользователем." +t MSG_367 "Используйте эту опцию, только если вы знаете, что такое S-Mode, и понимаете, что ваша система может быть заблокирована в S-Mode даже после того, как вы полностью удалите и переустановите Windows." +t MSG_368 "Используйте эту опцию, если система, в которой вы планируете установить Windows, использует полностью актуальные сертификаты безопасной загрузки. При необходимости вы можете использовать Mosby для обновления системы." +t MSG_369 "Используйте эту опцию, чтобы отозвать дополнительные потенциально небезопасные загрузчики Windows, но с возможностью предотвращения загрузки стандартных носителей Windows." +t MSG_370 "Улучшить жизнь: отключить большинство нежелательных функций, которые Microsoft пытается навязать пользователям." +t MSG_371 "Если вы используете эту опцию, обязательно отключите от целевого компьютера все диски, кроме того, на котором вы хотите установить Windows, а также не оставляйте носитель подключённым к любому компьютеру, с которого вы не хотите стирать данные." t MSG_900 "Rufus - это утилита для форматирования и создания загрузочных флеш-накопителей USB." t MSG_901 "Официальный сайт: %s" t MSG_902 "Исходный код: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 51e8c8f1..6e1fd231 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.14.2331" +CAPTION "Rufus 4.14.2332" 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,14,2331,0 - PRODUCTVERSION 4,14,2331,0 + FILEVERSION 4,14,2332,0 + PRODUCTVERSION 4,14,2332,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.14.2331" + VALUE "FileVersion", "4.14.2332" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2331" + VALUE "ProductVersion", "4.14.2332" END END BLOCK "VarFileInfo" From cba3cae1e06e93877b5b69b288d789718c4dff5c Mon Sep 17 00:00:00 2001 From: Sopor <sopor@users.noreply.github.com> Date: Mon, 23 Mar 2026 18:46:02 +0000 Subject: [PATCH 142/192] [loc] update Swedish translation to latest --- res/loc/po/sv-SE.po | 134 +++++++++++++++++++++++++++++++++++++++++--- res/loc/rufus.loc | 27 ++++++++- src/rufus.rc | 10 ++-- 3 files changed, 157 insertions(+), 14 deletions(-) diff --git a/res/loc/po/sv-SE.po b/res/loc/po/sv-SE.po index a7d1ef4c..6c3a726a 100644 --- a/res/loc/po/sv-SE.po +++ b/res/loc/po/sv-SE.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2025-09-23 20:25+0100\n" -"PO-Revision-Date: 2025-09-23 20:25+0100\n" +"POT-Creation-Date: 2026-03-23 18:43+0000\n" +"PO-Revision-Date: 2026-03-23 18:43+0000\n" "Last-Translator: \n" "Language-Team: \n" "Language: sv_SE\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Swedish (Svenska)\n" "X-Rufus-LCID: 0x041d, 0x081d\n" -"X-Generator: Poedit 3.7\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -309,7 +309,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -845,7 +845,7 @@ msgstr "Ej bestående" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Ställ in den bestående partitionens storlek för live USB-media. Om du ställer in storleken till 0 inaktiveras den bestående partitionen." @@ -887,7 +887,7 @@ msgstr "Ett annat program eller process använder denna enheten Vill du ändå f #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" @@ -1796,6 +1796,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Det går inte att öppna eller läsa '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Verkställ SkuSiPolicy.p7b vid installationen (se KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Förbättringar av användarupplevelsen (tvinga inte på Copilot, OneDrive, Outlook, Snabbstart osv.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Verkställer Windows-anpassning: %s" @@ -1920,6 +1928,118 @@ msgstr "Extraherar arkivfiler: %s" msgid "Use Rufus MBR" msgstr "Använd Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Använd bootloaders signerade med ’Windows CA 2023’ (kräver en kompatibel mål‑PC)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Kontrollerar om UEFI‑bootloadern är återkallad..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Söker efter UEFI‑DBX‑uppdateringar..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "DBX‑uppdatering tillgänglig" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus har hittat en uppdaterad version av de DBX‑filer som används för att utföra UEFI Secure Boot‑återkallelsekontroller. Vill du ladda ned denna uppdatering?\n" +"- Välj ”Ja” för att ansluta till Internet och ladda ner innehållet\n" +"- Välj ”Nej” för att avbryta åtgärden\n" +"\n" +"Obs: Filerna laddas ner till programmets katalog och återanvänds automatiskt om de redan finns." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "Radera disken i ⚠TYST LÄGE⚠ och installera:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Du har valt alternativet ”tyst läge” för Windows‑installationen.\n" +"\n" +"Detta är ett avancerat alternativ, avsett för personer som vill skapa installationsmedia som inte visar några dialogrutor under Windows‑installationen och därför OVILLKORLIGT RADERAR den första upptäckta disken på målsystemet. Om du inte är försiktig kan användning av detta alternativ leda till OÅTERKALLELIG FÖRLUST AV DATA!\n" +"\n" +"Om detta inte är vad du vill, välj ”Nej” för att gå tillbaka och avmarkera alternativet.\n" +"Annars, om du väljer ”Ja”, godkänner du att hela ansvaret för eventuell dataförlust ligger på DIG." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Platsen för avbilden stöds inte" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Du kan inte använda en avbildning som ligger på målenheten, eftersom den enheten kommer att raderas helt. Det är som att försöka såga av grenen du sitter på!\n" +"\n" +"Flytta avbildningen till en annan plats och försök igen." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Det är säkert att lämna det här alternativet aktiverat även om du har en TPM eller mer RAM, eftersom det endast kringgår installationskraven och inte hindrar Windows från att använda all tillgänglig hårdvara." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "För att det här alternativet ska fungera måste nätverket/Internet vara frånkopplat under installationen!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Svara automatiskt ’nej’ på Windows‑installationsfrågorna som rör delning av data med Microsoft, i stället för att fråga användaren." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Du bör lämna det här alternativet aktiverat, om du inte är okej med att ’Windows To Go’ får åtkomst till interna diskar och tyst utför oåterkalleliga filsystemuppgraderingar." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Skapa automatiskt ett lokalt konto med det angivna användarnamnet, med ett tomt lösenord som måste ändras vid nästa inloggning." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Duplicera de regionala inställningarna från den här datorn (tangentbord, tidszon, valuta) i stället för att fråga användaren." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Kryptera inte systemdisken, om det inte uttryckligen begärs av användaren." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Använd det här alternativet endast om du vet vad S‑läge är och förstår att ditt system kan låsas i S‑läge även efter att du helt har raderat och installerat om Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Använd det här alternativet om systemet du planerar att installera Windows på använder helt uppdaterade Secure Boot‑certifikat. Vid behov kan du använda ’Mosby’ för att uppdatera systemet." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Använd det här alternativet om du vill återkalla ytterligare potentiellt osäkra Windows‑startprogram, men med risken att även förhindra att standard‑Windowsmedia kan starta." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Förbättringar för bättre användarupplevelse: Inaktivera de flesta av de oönskade funktioner som Microsoft försöker tvinga på slutanvändare." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Om du använder det här alternativet måste du se till att koppla bort alla diskar från måldatorn, förutom den du vill installera Windows på, och inte lämna mediet anslutet till någon dator som du inte vill radera." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 1eb83adc..bc61f2cb 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -36,7 +36,7 @@ # • v4.5 "sk-SK" "Slovak (Slovensky)" # • v4.5 "sl-SI" "Slovenian (Slovenščina)" # • v4.5 "es-ES" "Spanish (Español)" -# • v4.5 "sv-SE" "Swedish (Svenska)" +# • v4.14 "sv-SE" "Swedish (Svenska)" # • v4.5 "th-TH" "Thai (ไทย)" # • v4.5 "tr-TR" "Turkish (Türkçe)" # • v4.5 "uk-UA" "Ukrainian (Українська)" @@ -14137,7 +14137,7 @@ t MSG_922 "Descargar ISO de UEFI Shell" ######################################################################### l "sv-SE" "Swedish (Svenska)" 0x041d, 0x081d -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -14503,6 +14503,8 @@ t MSG_319 "Ignorera startmarkör" t MSG_320 "Uppdaterar partitionslayout (%s)..." t MSG_321 "Avbilden du har valt är en ISOHybrid, men den som skapade filen har inte gjort den kompatibelt med ISO/Filkopieringsläge.\nDärför kommer skrivläget DD-avbild att användas." t MSG_322 "Det går inte att öppna eller läsa '%s'" +t MSG_323 "Verkställ SkuSiPolicy.p7b vid installationen (se KB5042562)" +t MSG_324 "Förbättringar av användarupplevelsen (tvinga inte på Copilot, OneDrive, Outlook, Snabbstart osv.)" t MSG_325 "Verkställer Windows-anpassning: %s" t MSG_326 "Verkställer användaralternativ..." t MSG_327 "Windows användarupplevelse" @@ -14528,6 +14530,27 @@ t MSG_346 "Begränsa Windows till S-läge (INKOMPATIBEL med förbikoppling av on t MSG_347 "Expertläge" t MSG_348 "Extraherar arkivfiler: %s" t MSG_349 "Använd Rufus MBR" +t MSG_350 "Använd bootloaders signerade med ’Windows CA 2023’ (kräver en kompatibel mål‑PC)" +t MSG_351 "Kontrollerar om UEFI‑bootloadern är återkallad..." +t MSG_352 "Söker efter UEFI‑DBX‑uppdateringar..." +t MSG_353 "DBX‑uppdatering tillgänglig" +t MSG_354 "Rufus har hittat en uppdaterad version av de DBX‑filer som används för att utföra UEFI Secure Boot‑återkallelsekontroller. Vill du ladda ned denna uppdatering?\n- Välj ”Ja” för att ansluta till Internet och ladda ner innehållet\n- Välj ”Nej” för att avbryta åtgärden\n\nObs: Filerna laddas ner till programmets katalog och återanvänds automatiskt om de redan finns." +t MSG_355 "Radera disken i ⚠TYST LÄGE⚠ och installera:" +t MSG_356 "Du har valt alternativet ”tyst läge” för Windows‑installationen.\n\nDetta är ett avancerat alternativ, avsett för personer som vill skapa installationsmedia som inte visar några dialogrutor under Windows‑installationen och därför OVILLKORLIGT RADERAR den första upptäckta disken på målsystemet. Om du inte är försiktig kan användning av detta alternativ leda till OÅTERKALLELIG FÖRLUST AV DATA!\n\nOm detta inte är vad du vill, välj ”Nej” för att gå tillbaka och avmarkera alternativet.\nAnnars, om du väljer ”Ja”, godkänner du att hela ansvaret för eventuell dataförlust ligger på DIG." +t MSG_358 "Platsen för avbilden stöds inte" +t MSG_359 "Du kan inte använda en avbildning som ligger på målenheten, eftersom den enheten kommer att raderas helt. Det är som att försöka såga av grenen du sitter på!\n\nFlytta avbildningen till en annan plats och försök igen." +t MSG_360 "Det är säkert att lämna det här alternativet aktiverat även om du har en TPM eller mer RAM, eftersom det endast kringgår installationskraven och inte hindrar Windows från att använda all tillgänglig hårdvara." +t MSG_361 "För att det här alternativet ska fungera måste nätverket/Internet vara frånkopplat under installationen!" +t MSG_362 "Svara automatiskt ’nej’ på Windows‑installationsfrågorna som rör delning av data med Microsoft, i stället för att fråga användaren." +t MSG_363 "Du bör lämna det här alternativet aktiverat, om du inte är okej med att ’Windows To Go’ får åtkomst till interna diskar och tyst utför oåterkalleliga filsystemuppgraderingar." +t MSG_364 "Skapa automatiskt ett lokalt konto med det angivna användarnamnet, med ett tomt lösenord som måste ändras vid nästa inloggning." +t MSG_365 "Duplicera de regionala inställningarna från den här datorn (tangentbord, tidszon, valuta) i stället för att fråga användaren." +t MSG_366 "Kryptera inte systemdisken, om det inte uttryckligen begärs av användaren." +t MSG_367 "Använd det här alternativet endast om du vet vad S‑läge är och förstår att ditt system kan låsas i S‑läge även efter att du helt har raderat och installerat om Windows." +t MSG_368 "Använd det här alternativet om systemet du planerar att installera Windows på använder helt uppdaterade Secure Boot‑certifikat. Vid behov kan du använda ’Mosby’ för att uppdatera systemet." +t MSG_369 "Använd det här alternativet om du vill återkalla ytterligare potentiellt osäkra Windows‑startprogram, men med risken att även förhindra att standard‑Windowsmedia kan starta." +t MSG_370 "Förbättringar för bättre användarupplevelse: Inaktivera de flesta av de oönskade funktioner som Microsoft försöker tvinga på slutanvändare." +t MSG_371 "Om du använder det här alternativet måste du se till att koppla bort alla diskar från måldatorn, förutom den du vill installera Windows på, och inte lämna mediet anslutet till någon dator som du inte vill radera." t MSG_900 "Rufus är ett program som hjälper dig formatera och skapa startbara USB-diskar, så som USB-minnen, minneskort, etc." t MSG_901 "Officiell webbplats: %s" t MSG_902 "Källkod: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 6e1fd231..469894d4 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.14.2332" +CAPTION "Rufus 4.14.2333" 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,14,2332,0 - PRODUCTVERSION 4,14,2332,0 + FILEVERSION 4,14,2333,0 + PRODUCTVERSION 4,14,2333,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.14.2332" + VALUE "FileVersion", "4.14.2333" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2332" + VALUE "ProductVersion", "4.14.2333" END END BLOCK "VarFileInfo" From 1b4edc9c2433c3e349617d4c36cf5a675da63fd1 Mon Sep 17 00:00:00 2001 From: Suttirak Mattayawerakiat <raksuttirak2@gmail.com> Date: Mon, 23 Mar 2026 18:52:18 +0000 Subject: [PATCH 143/192] [loc] update Thai translation to latest --- res/loc/po/th-TH.po | 168 +++++++++++++++++++++++++++++++++++++------- res/loc/rufus.loc | 40 ++++++++--- src/rufus.rc | 10 +-- 3 files changed, 181 insertions(+), 37 deletions(-) diff --git a/res/loc/po/th-TH.po b/res/loc/po/th-TH.po index d89a4503..389ed973 100644 --- a/res/loc/po/th-TH.po +++ b/res/loc/po/th-TH.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-04-26 10:51+0700\n" -"PO-Revision-Date: 2024-04-26 18:32+0700\n" +"POT-Creation-Date: 2026-03-22 11:42+0700\n" +"PO-Revision-Date: 2026-03-22 14:37+0700\n" "Last-Translator: \n" "Language-Team: \n" "Language: th_TH\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Thai (ไทย)\n" "X-Rufus-LCID: 0x041e\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -573,9 +573,9 @@ msgstr "" "ซึ่งอาจทำให้เมนูการบูตไม่สามารถแสดงผลได้ถูกต้อง\n" "\n" "Rufus สามารถดาวน์โหลดเวอร์ชันที่ใหม่กว่าให้คุณได้:\n" -"- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n" -"- เลือก 'No' เพื่อใช้อิมเมจไฟล์อันเดิม\n" -"หากไม่รู้จะเลือกวิธีใด ให้เลือก 'Yes'\n" +"- เลือก 'ใช่ (Yes)' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n" +"- เลือก 'ไม่ใช่ (No)' เพื่อใช้อิมเมจไฟล์อันเดิม\n" +"หากไม่รู้จะเลือกวิธีใด ให้เลือก 'ใช่ (Yes)'\n" "\n" "หมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และเมื่อไฟล์ '%s มีแล้ว ไฟล์จะถูกเลือกใช้โดยอัตโนมัติ" @@ -700,8 +700,8 @@ msgstr "" "เนื่องจากไฟล์นี้มีขนาดใหญ่กว่า 100 KB และพบเจอได้ใน ISO: %s ซึ่งไม่ได้รวมไว้ในโปรแกรม Rufus\n" "\n" "Rufus สามารถดาวน์โหลดไฟล์ดังกล่าวให้คุณได้:\n" -"- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n" -"- เลือก 'No' คุณต้องการคัดลอกไฟล์ดังกล่าวด้วยตัวเอง\n" +"- เลือก 'ใช่ (Yes)' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n" +"- เลือก 'ไม่ใช่ (No)' คุณต้องการคัดลอกไฟล์ดังกล่าวด้วยตัวเอง\n" "\n" "หมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และเมื่อไฟล์ '%s มีแล้ว ไฟล์จะถูกเลือกใช้โดยอัตโนมัติ" @@ -767,8 +767,8 @@ msgstr "" "อิมเมจนี้ใช้ Syslinux %s%s แต่โปรแกรมนี้มีเฉพาะไฟล์ติดตั้งของ Syslinux %s%s \n" "\n" "โดยเวอร์ชันใหม่ของ Syslinux อาจไม่รองรับกับรุ่นที่ต่างกันไปไฟล์จำนวน 2 ไฟล์ต่อไปนี้จะถูกดาวน์โหลดจากอินเทอร์เน็ต ('ldlinux.sys' and 'ldlinux.bss'):\n" -"- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n" -"- เลือก 'No' เมื่อคุณต้องการคัดลอกไฟล์ดังกล่าวด้วยตัวเอง\n" +"- เลือก 'ใช่ (Yes)' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n" +"- เลือก 'ไม่ใช่ (No)' เมื่อคุณต้องการคัดลอกไฟล์ดังกล่าวด้วยตัวเอง\n" "\n" "หมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และไฟล์ จะถูกเลือกใช้โดยอัตโนมัติ" @@ -793,9 +793,9 @@ msgstr "" "อิมเมจนี้ใช้ Grub %s แต่โปรแกรมนี้มีเฉพาะไฟล์ติดตั้งของ Grub %s \n" "\n" "โดยเวอร์ชันใหม่ของ Grub อาจไม่รองรับกับรุ่นที่ต่างกันไป Rufus สามารถค้นหาอิมเมจของ Grub เวอร์ชันล่าสุด ('core.img') ที่เข้ากันได้กับอิมเมจไฟล์ที่คุณเลือก:\n" -"- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n" -"- เลือก 'No' เพื่อใช้เวอร์ชันปัจจุบันที่ติดมากับ Rufus\n" -"-เลือก 'Cancel' เพื่อยกเลิกการดำเนินการนี้\n" +"- เลือก 'ใช่ (Yes)' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n" +"- เลือก 'ไม่ใช่ (No)' เพื่อใช้เวอร์ชันปัจจุบันที่ติดมากับ Rufus\n" +"-เลือก 'ยกเลิก (Cancel)' เพื่อยกเลิกการดำเนินการนี้\n" "\n" "หมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และไฟล์จะถูกเลือกใช้โดยอัตโนมัติหากไม่พบไฟล์ที่ใหม่กว่า ไฟล์เวอร์ชันปัจจุบันจะถูกใช้แทน" @@ -846,7 +846,7 @@ msgstr "ไม่มี Persistent" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "ตั้งค่าขนาดของพาร์ติชันสำหรับ Live USB media (ตั้งขนาดเป็น 0 เพื่อปิดการทำงานของ persistent partition)" @@ -888,7 +888,7 @@ msgstr "ไดรฟ์นี้กำลังถูกใช้งานอย #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" @@ -1796,6 +1796,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "ไม่สามารถเปิดหรืออ่าน '%s' ได้" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "เปิดใช้งาน SkuSiPolicy.p7b ในการติดตั้ง (ดูที่ KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "การปรับปรุงคุณภาพการใช้งาน/QoL (ยกเลิกการบังคับใช้: Copilot, OneDrive, Outlook, Fast Startup, เป็นต้น)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "ปรับใช้งานการปรับแต่งขั้นตอนการติดตั้ง Windows: %s" @@ -1846,15 +1854,15 @@ msgstr "Log แบบถาวร" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"มีความจำเป็นต้องดาวน์โหลดไฟล์ ('diskcopy.dll') จาก Microsoft เพื่อติดตั้ง MS-DOS:\n" -"- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n" -"- เลือก 'No' เพื่อยกเลิก\n" +"มีความจำเป็นต้องดาวน์โหลดไฟล์ ('%s') จาก Microsoft เพื่อใช้ฟีเจอร์นี้:\n" +"- เลือก 'ใช่ (Yes)' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n" +"- เลือก 'ไม่ใช่ (No)' เพื่อยกเลิก\n" "\n" "หมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และเมื่อไฟล์ '%s มีแล้ว ไฟล์จะถูกเลือกใช้โดยอัตโนมัติ" @@ -1892,7 +1900,7 @@ msgstr "อิมเมจ VHDX ที่ไม่บีบอัด" #. • MSG_344 msgid "Full Flash Update Image" -msgstr "" +msgstr "ไฟล์อิมเมจสำหรับ Full Flash Update" #. • MSG_345 msgid "" @@ -1901,8 +1909,8 @@ msgid "" "- Select 'No' to cancel the operation" msgstr "" "มีความจำเป็นต้องดาวน์โหลดข้อมูลเพิ่มเติมจาก Microsoft เพื่อใช้งานฟังก์ชั่นนี้:\n" -"- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n" -"- เลือก 'No' เพื่อยกเลิก" +"- เลือก 'ใช่ (Yes)' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n" +"- เลือก 'ไม่ใช่ (No)' เพื่อยกเลิก" #. • MSG_346 msgid "Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)" @@ -1920,6 +1928,118 @@ msgstr "กำลังแตกไฟล์: %s" msgid "Use Rufus MBR" msgstr "Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "ใช้งานบูตโหลดเดอร์ที่รับรองโดย 'Windows CA 2023' (ตัวเครื่องคอมพิวเตอร์ปลายทางต้องรองรับด้วย)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "กำลังตรวจสอบการเพิกถอนสิทธิ์ของบูตโหลดเดอร์แบบ UEFI..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "กำลังตรวจสอบการอัปเดตรายการเพิกถอนสิทธิ์ของ UEFI (DBX)..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "มีการอัปเดตรายการเพิกถอนสิทธิ์ (DBX) พร้อมใช้งานแล้ว" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus ตรวจเจอเวอร์ชั่นอัพเดตที่ใหม่กว่าของไฟล์ DBX ซึ่งใช้สำหรับตรวจสอบการเพิกถอนสิทธิ์ของ UEFI Secure Boot คุณต้องการดาวน์โหลดไฟล์อัพเดตหรือไม่?\n" +"- เลือก 'ใช่ (Yes)' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n" +"- เลือก 'ไม่ใช่ (No)' เพื่อยกเลิกการดำเนินการ\n" +"\n" +"หมายเหตุ: ไฟล์จะถูกดาวน์โหลดลงในไดเรกทอรีของแอปพลิเคชัน และจะถูกนำกลับมาใช้ใหม่โดยอัตโนมัติหากมีไฟล์อยู่แล้ว" + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠จะไม่มีการถามยืนยันซ้ำ⚠ ลบข้อมูลดิสก์ แล้วติดตั้ง:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"คุณเลือกที่จะใช้งานตัวเลือก การติดตั้ง Windows \"แบบเงียบ\"\n" +"\n" +"นี่คือตัวเลือกขั้นสูง ซึ่งสงวนไว้สำหรับผู้ที่ต้องการสร้างสื่อติดตั้งที่จะไม่ถามผู้ใช้ในระหว่างการติดตั้ง Windows ดังนั้นมันจะลบข้อมูลในดิสก์ตัวแรกที่ตรวจพบในระบบปลายทาง **โดยไม่มีเงื่อนไข** หากคุณไม่ระมัดระวัง การใช้ตัวเลือกนี้อาจส่งผลให้ **เกิดการสูญเสียข้อมูลอย่างถาวรและไม่สามารถกู้คืนได้!**\n" +"\n" +"หากนี่ไม่ใช่สิ่งที่คุณต้องการ โปรดเลือก 'ไม่ใช่ (No)' เพื่อย้อนกลับและยกเลิกการเลือกตัวเลือกดังกล่าว\n" +"มิฉะนั้น หากคุณเลือก 'ใช่ (Yes)' คุณยอมรับว่าความรับผิดชอบทั้งหมดต่อการสูญหายของข้อมูลใดๆ จะตกอยู่ที่ตัวคุณแต่เพียงผู้เดียว" + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "ไม่รองรับตำแหน่งที่ตั้งของไฟล์อิมเมจ" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"คุณไม่สามารถใช้ไฟล์อิมเมจที่อยู่ในไดรฟ์เป้าหมายได้ เนื่องจากไดรฟ์นั้นกำลังจะถูกลบข้อมูลทั้งหมด มันก็เหมือนกับการพยายามทำลายที่มั่นตัวเองอยู่นั่นแหละ!\n" +"\n" +"โปรดย้ายอิมเมจไปยังตำแหน่งอื่นแล้วลองใหม่อีกครั้ง" + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "การเปิดตัวเลือกนี้ทิ้งไว้มีความปลอดภัย ถึงแม้ว่าคุณจะมี TPM หรือแรมที่มากกว่าก็ตาม ตัวเลือกนี้มีผลแค่การข้าม ข้อกำหนดในการติดตั้ง เท่านั้น ไม่ได้ลดทอนการทำงานของ Windows ในการดึงประสิทธิภาพฮาร์ดแวร์มาใช้อย่างเต็มที่" + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "เพื่อให้ตัวเลือกนี้ทำงานได้ จะต้องปิดการเชื่อมต่อเครือข่าย/อินเทอร์เน็ตขณะทำการติดตั้งก่อน" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "ตอบ 'ไม่ใช่ (no)' โดยอัตโนมัติ สำหรับคำถามในการตั้งค่า Windows ที่เกี่ยวกับการแชร์ข้อมูลให้กับ Microsoft โดยไม่ต้องเด้งถามผู้ใช้" + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "คุณควรจะเปิดตัวเลือกนี้ทิ้งไว้ ยกเว้นว่าคุณจะยอมรับได้หาก 'Windows To Go' เข้าถึงดิสก์ภายในเครื่อง และทำการอัปเกรดระบบไฟล์โดยอัตโนมัติ ซึ่งเป็นการดำเนินการที่ไม่สามารถย้อนกลับได้" + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "สร้างบัญชีผู้ใช้ภายในเครื่อง (Local account) ตามชื่อที่ระบุโดยอัตโนมัติ ซึ่งจะไม่มีรหัสผ่าน และอาจจะต้องเปลี่ยนรหัสเมื่อเข้าสู่ระบบครั้งถัดไป" + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "คัดลอกการตั้งค่าภูมิภาคจากพีซีปัจจุบัน (ภาษาแป้นพิมพ์, โซนเวลา, สกุลเงิน, ฯลฯ) โดยไม่ต้องเด้งถามผู้ใช้" + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "อย่าเข้ารหัสดิสก์ระบบ นอกเหนือจากว่าจะเป็นผู้ใช้งานจะเป็นผู้สั่งให้เข้ารหัสเอง" + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "โปรดใช้ตัวเลือกนี้เฉพาะในกรณีที่คุณทราบว่า S-Mode คืออะไร และเข้าใจว่าระบบของคุณอาจถูกล็อกให้อยู่ใน S-Mode ต่อไป แม้ว่าคุณจะทำการล้างข้อมูลทั้งหมดและติดตั้ง Windows ใหม่แล้วก็ตาม" + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "ใช้ตัวเลือกนี้หากระบบที่คุณต้องการติดตั้ง Windows มีการใช้ใบรับรอง Secure Boot ที่อัปเดตเป็นเวอร์ชันล่าสุดแล้ว หากจำเป็น คุณสามารถศึกษาการใช้เครื่องมือ 'Mosby' เพื่อทำการอัปเดตระบบของคุณได้" + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "ใช้ตัวเลือกนี้หากคุณต้องการเพิกถอนสิทธิ์บูตโหลดเดอร์ของ Windows เพิ่มเติมที่อาจจะไม่ปลอดภัย แต่โปรดทราบว่ามีความเสี่ยงที่จะทำให้สื่อติดตั้ง Windows มาตรฐานทั่วไปไม่สามารถบูตได้ด้วยเช่นกัน" + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "\"การปรับปรุงคุณภาพการใช้งาน (Quality of Life)\": ปิดการใช้งานคุณสมบัติส่วนใหญ่ที่ไม่พึงประสงค์ที่ Microsoft พยายามบังคับให้ผู้ใช้งานทั่วไปต้องใช้" + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "ถ้าหากคุณเลือกตัวเลือกนี้ กรุณาเช็คให้มั่นใจว่าคุณถอดดิสก์ที่เชื่อมกับพีซีเป้าหมาย เหลือไว้เฉพาะดิสก์ที่คุณต้องการจะติดตั้ง Windows เท่านั้น และห้ามเสียบตัวติดตั้ง (เช่น แฟลชไดรฟ์) ทิ้งไว้ในคอมพิวเตอร์เครื่องใดก็ตามที่คุณไม่ต้องการให้ข้อมูลถูกลบ\"" + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index bc61f2cb..c6916f14 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -37,7 +37,7 @@ # • v4.5 "sl-SI" "Slovenian (Slovenščina)" # • v4.5 "es-ES" "Spanish (Español)" # • v4.14 "sv-SE" "Swedish (Svenska)" -# • v4.5 "th-TH" "Thai (ไทย)" +# • v4.14 "th-TH" "Thai (ไทย)" # • v4.5 "tr-TR" "Turkish (Türkçe)" # • v4.5 "uk-UA" "Ukrainian (Українська)" # • v4.5 "vi-VN" "Vietnamese (Tiếng Việt)" @@ -14573,7 +14573,7 @@ t MSG_922 "Ladda ner UEFI-skal ISO-filer" ######################################################################### l "th-TH" "Thai (ไทย)" 0x041e -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -14711,7 +14711,7 @@ t MSG_080 "Rufus พบว่าขณะนี้ Windows กำลังดำ t MSG_081 "ไม่รองรับอิมเมจไฟล์นี้" t MSG_082 "อิมเมจไฟล์นี้ไม่สามารถบูตได้ หรืออาจจะมีการใช้วิธีการบูตอื่นๆ ที่ Rufus ไม่รองรับ" t MSG_083 "แทนที่ %s?" -t MSG_084 "ไฟล์ ISO นี้อาจมีการใช้เวอร์ชันที่ล้าสมัยของ '%s'\nซึ่งอาจทำให้เมนูการบูตไม่สามารถแสดงผลได้ถูกต้อง\n\nRufus สามารถดาวน์โหลดเวอร์ชันที่ใหม่กว่าให้คุณได้:\n- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n- เลือก 'No' เพื่อใช้อิมเมจไฟล์อันเดิม\nหากไม่รู้จะเลือกวิธีใด ให้เลือก 'Yes'\n\nหมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และเมื่อไฟล์ '%s มีแล้ว ไฟล์จะถูกเลือกใช้โดยอัตโนมัติ" +t MSG_084 "ไฟล์ ISO นี้อาจมีการใช้เวอร์ชันที่ล้าสมัยของ '%s'\nซึ่งอาจทำให้เมนูการบูตไม่สามารถแสดงผลได้ถูกต้อง\n\nRufus สามารถดาวน์โหลดเวอร์ชันที่ใหม่กว่าให้คุณได้:\n- เลือก 'ใช่ (Yes)' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n- เลือก 'ไม่ใช่ (No)' เพื่อใช้อิมเมจไฟล์อันเดิม\nหากไม่รู้จะเลือกวิธีใด ให้เลือก 'ใช่ (Yes)'\n\nหมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และเมื่อไฟล์ '%s มีแล้ว ไฟล์จะถูกเลือกใช้โดยอัตโนมัติ" t MSG_085 "กำลังดาวน์โหลด %s" t MSG_086 "ยังไม่ได้เลือกอิมเมจไฟล์" t MSG_087 "สำหรับ %s NAND" @@ -14730,7 +14730,7 @@ t MSG_100 "ไฟล์ ISO นี้ประกอบไปด้วยไฟ t MSG_101 "ไม่รองรับรูปแบบ WIM" t MSG_102 "ระบบปฏิบัติการของคุณไม่สามารถแตกไฟล์แบบ WIM ได้ โดยไฟล์ WIM จำเป็นที่ต้องใช้ในการสร้าง Windows 7 ให้บูตได้แบบ EFI และ Windows Vista บน USB ซึ่งแก้ไขได้โดยการติดตั้ง 7-Zip เวอร์ชันล่าสุด\nต้องการเปิดหน้าดาวน์โหลด 7-zip หรือไม่?" t MSG_103 "ดาวน์โหลด %s?" -t MSG_104 "%s หรือใหม่กว่า จำเป็นต้องมี '%s' ติดตั้งไว้\nเนื่องจากไฟล์นี้มีขนาดใหญ่กว่า 100 KB และพบเจอได้ใน ISO: %s ซึ่งไม่ได้รวมไว้ในโปรแกรม Rufus\n\nRufus สามารถดาวน์โหลดไฟล์ดังกล่าวให้คุณได้:\n- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n- เลือก 'No' คุณต้องการคัดลอกไฟล์ดังกล่าวด้วยตัวเอง\n\nหมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และเมื่อไฟล์ '%s มีแล้ว ไฟล์จะถูกเลือกใช้โดยอัตโนมัติ" +t MSG_104 "%s หรือใหม่กว่า จำเป็นต้องมี '%s' ติดตั้งไว้\nเนื่องจากไฟล์นี้มีขนาดใหญ่กว่า 100 KB และพบเจอได้ใน ISO: %s ซึ่งไม่ได้รวมไว้ในโปรแกรม Rufus\n\nRufus สามารถดาวน์โหลดไฟล์ดังกล่าวให้คุณได้:\n- เลือก 'ใช่ (Yes)' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n- เลือก 'ไม่ใช่ (No)' คุณต้องการคัดลอกไฟล์ดังกล่าวด้วยตัวเอง\n\nหมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และเมื่อไฟล์ '%s มีแล้ว ไฟล์จะถูกเลือกใช้โดยอัตโนมัติ" t MSG_105 "การยกเลิกอาจทำให้อุปกรณ์ไม่สามารถใช้การได้ !\nหากคุณยืนยันที่จะยกเลิก คลิกที่ปุ่ม ใช่" t MSG_106 "กรุณาเลือกโฟลเดอร์" t MSG_107 "ไฟล์ทั้งหมด" @@ -14739,9 +14739,9 @@ t MSG_110 "MS-DOS ไม่สามารถบูตจากไดรฟ์ t MSG_111 "ไม่รองรับขนาดของคลัสเตอร์นี้" t MSG_112 "การฟอร์แมต UDF volume ขนาดใหญ่อาจใช้เวลานาน โดยความเร็วการฟอร์แมต USB 2.0 โดยประมาณคือ %d:%02d ซึ่งในระหว่างการฟอร์แมตแถบแสดงความคืบหน้าอาจหยุดนิ่ง โปรดรอ!" t MSG_113 "UDF volume ขนาดใหญ่" -t MSG_114 "อิมเมจนี้ใช้ Syslinux %s%s แต่โปรแกรมนี้มีเฉพาะไฟล์ติดตั้งของ Syslinux %s%s \n\nโดยเวอร์ชันใหม่ของ Syslinux อาจไม่รองรับกับรุ่นที่ต่างกันไปไฟล์จำนวน 2 ไฟล์ต่อไปนี้จะถูกดาวน์โหลดจากอินเทอร์เน็ต ('ldlinux.sys' and 'ldlinux.bss'):\n- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n- เลือก 'No' เมื่อคุณต้องการคัดลอกไฟล์ดังกล่าวด้วยตัวเอง\n\nหมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และไฟล์ จะถูกเลือกใช้โดยอัตโนมัติ" +t MSG_114 "อิมเมจนี้ใช้ Syslinux %s%s แต่โปรแกรมนี้มีเฉพาะไฟล์ติดตั้งของ Syslinux %s%s \n\nโดยเวอร์ชันใหม่ของ Syslinux อาจไม่รองรับกับรุ่นที่ต่างกันไปไฟล์จำนวน 2 ไฟล์ต่อไปนี้จะถูกดาวน์โหลดจากอินเทอร์เน็ต ('ldlinux.sys' and 'ldlinux.bss'):\n- เลือก 'ใช่ (Yes)' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n- เลือก 'ไม่ใช่ (No)' เมื่อคุณต้องการคัดลอกไฟล์ดังกล่าวด้วยตัวเอง\n\nหมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และไฟล์ จะถูกเลือกใช้โดยอัตโนมัติ" t MSG_115 "จำเป็นต้องดาวน์โหลดไฟล์" -t MSG_116 "อิมเมจนี้ใช้ Grub %s แต่โปรแกรมนี้มีเฉพาะไฟล์ติดตั้งของ Grub %s \n\nโดยเวอร์ชันใหม่ของ Grub อาจไม่รองรับกับรุ่นที่ต่างกันไป Rufus สามารถค้นหาอิมเมจของ Grub เวอร์ชันล่าสุด ('core.img') ที่เข้ากันได้กับอิมเมจไฟล์ที่คุณเลือก:\n- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n- เลือก 'No' เพื่อใช้เวอร์ชันปัจจุบันที่ติดมากับ Rufus\n-เลือก 'Cancel' เพื่อยกเลิกการดำเนินการนี้\n\nหมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และไฟล์จะถูกเลือกใช้โดยอัตโนมัติหากไม่พบไฟล์ที่ใหม่กว่า ไฟล์เวอร์ชันปัจจุบันจะถูกใช้แทน" +t MSG_116 "อิมเมจนี้ใช้ Grub %s แต่โปรแกรมนี้มีเฉพาะไฟล์ติดตั้งของ Grub %s \n\nโดยเวอร์ชันใหม่ของ Grub อาจไม่รองรับกับรุ่นที่ต่างกันไป Rufus สามารถค้นหาอิมเมจของ Grub เวอร์ชันล่าสุด ('core.img') ที่เข้ากันได้กับอิมเมจไฟล์ที่คุณเลือก:\n- เลือก 'ใช่ (Yes)' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n- เลือก 'ไม่ใช่ (No)' เพื่อใช้เวอร์ชันปัจจุบันที่ติดมากับ Rufus\n-เลือก 'ยกเลิก (Cancel)' เพื่อยกเลิกการดำเนินการนี้\n\nหมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และไฟล์จะถูกเลือกใช้โดยอัตโนมัติหากไม่พบไฟล์ที่ใหม่กว่า ไฟล์เวอร์ชันปัจจุบันจะถูกใช้แทน" t MSG_117 "ตัวติดตั้ง Windows มาตรฐาน" t MSG_119 "คุณสมบัติไดรฟ์ขั้นสูง" t MSG_120 "คุณสมบัติการฟอร์แมตขั้นสูง" @@ -14944,6 +14944,8 @@ t MSG_319 "ละเว้นการทำ Boot Marker" t MSG_320 "กำลังรีเฟรชเค้าโครงพาร์ติชัน (%s)..." t MSG_321 "อิมเมจไฟล์ที่คุณใช้เป็นแบบ ISOHybrid แต่ผู้ผลิตไม่ได้ทำให้รองรับกับการคัดลอกไฟล์ ISO\nนั่นทำให้โหมดการเขียนแบบ DD image writing จะถูกเรียกใช้งาน" t MSG_322 "ไม่สามารถเปิดหรืออ่าน '%s' ได้" +t MSG_323 "เปิดใช้งาน SkuSiPolicy.p7b ในการติดตั้ง (ดูที่ KB5042562)" +t MSG_324 "การปรับปรุงคุณภาพการใช้งาน/QoL (ยกเลิกการบังคับใช้: Copilot, OneDrive, Outlook, Fast Startup, เป็นต้น)" t MSG_325 "ปรับใช้งานการปรับแต่งขั้นตอนการติดตั้ง Windows: %s" t MSG_326 "ปรับใช้งานการตั้งค่าของผู้ใช้..." t MSG_327 "โปรแกรมประสบการณ์ผู้ใช้งาน Windows" @@ -14956,18 +14958,40 @@ t MSG_333 "สร้างบัญชีผู้ใช้ด้วยชื่ t MSG_334 "ตั้งค่าภูมิภาคให้ตรงกับค่าที่ใช้บนคอมพิวเตอร์เครื่องนี้" t MSG_335 "ยกเลิกการใช้ BitLocker เข้ารหัสอุปกรณ์อัตโนมัติ" t MSG_336 "Log แบบถาวร" -t MSG_337 "มีความจำเป็นต้องดาวน์โหลดไฟล์ ('%s') จาก Microsoft เพื่อใช้ฟีเจอร์นี้:\n- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n- เลือก 'No' เพื่อยกเลิก\n\nหมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และเมื่อไฟล์ '%s มีแล้ว ไฟล์จะถูกเลือกใช้โดยอัตโนมัติ" +t MSG_337 "มีความจำเป็นต้องดาวน์โหลดไฟล์ ('%s') จาก Microsoft เพื่อใช้ฟีเจอร์นี้:\n- เลือก 'ใช่ (Yes)' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n- เลือก 'ไม่ใช่ (No)' เพื่อยกเลิก\n\nหมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และเมื่อไฟล์ '%s มีแล้ว ไฟล์จะถูกเลือกใช้โดยอัตโนมัติ" t MSG_338 "ตรวจพบ UEFI bootloader ที่ถูกเพิกถอน" t MSG_339 "Rufus ตรวจพบว่าไฟล์ ISO ที่คุณเลือกมี UEFI bootloader ที่ถูกเพิกถอน ซึ่งตุณอาจจะเจอกับ%s เมื่อ SecureBoot เปิดใช้งานบนระบบ UEFI ที่ทันสมัย\n\n- ถ้าคุณได้ไฟล์ ISO นี้มาจากแหล่งที่ไม่น่าเชื่อถือ คุณควรตระหนักถึงความเป็นไปได้ที่ไฟล์ดังกล่าวอาจมี UEFI malware และหลีกเลี่ยงการบูตจากอิมเมจดังกล่าว\n- ถ้าคุณได้ไฟล์ ISO นี้มาจากแหล่งที่เชื่อถือได้ คุณควรพยายามค้นหาเวอร์ชันที่ทันสมัยกว่านี้ ซึ่งจะไม่ทำให้เกิดคำเตือนนี้" t MSG_340 "หน้าจอ \"Security Violation\"" t MSG_341 "หน้าจอ Windows Recovery (จอฟ้า; BSOD) พร้อมกับ '%s'" t MSG_342 "อิมเมจ VHDX ที่ถูกบีบอัด" t MSG_343 "อิมเมจ VHDX ที่ไม่บีบอัด" -t MSG_345 "มีความจำเป็นต้องดาวน์โหลดข้อมูลเพิ่มเติมจาก Microsoft เพื่อใช้งานฟังก์ชั่นนี้:\n- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n- เลือก 'No' เพื่อยกเลิก" +t MSG_344 "ไฟล์อิมเมจสำหรับ Full Flash Update" +t MSG_345 "มีความจำเป็นต้องดาวน์โหลดข้อมูลเพิ่มเติมจาก Microsoft เพื่อใช้งานฟังก์ชั่นนี้:\n- เลือก 'ใช่ (Yes)' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n- เลือก 'ไม่ใช่ (No)' เพื่อยกเลิก" t MSG_346 "จำกัด Windows ให้อยู่ใน S-Mode (ไม่รองรับการยกเลิกการบังคับใช้บัญชี Microsoft)" t MSG_347 "โหมดผู้เชี่ยวชาญ" t MSG_348 "กำลังแตกไฟล์: %s" t MSG_349 "Rufus MBR" +t MSG_350 "ใช้งานบูตโหลดเดอร์ที่รับรองโดย 'Windows CA 2023' (ตัวเครื่องคอมพิวเตอร์ปลายทางต้องรองรับด้วย)" +t MSG_351 "กำลังตรวจสอบการเพิกถอนสิทธิ์ของบูตโหลดเดอร์แบบ UEFI..." +t MSG_352 "กำลังตรวจสอบการอัปเดตรายการเพิกถอนสิทธิ์ของ UEFI (DBX)..." +t MSG_353 "มีการอัปเดตรายการเพิกถอนสิทธิ์ (DBX) พร้อมใช้งานแล้ว" +t MSG_354 "Rufus ตรวจเจอเวอร์ชั่นอัพเดตที่ใหม่กว่าของไฟล์ DBX ซึ่งใช้สำหรับตรวจสอบการเพิกถอนสิทธิ์ของ UEFI Secure Boot คุณต้องการดาวน์โหลดไฟล์อัพเดตหรือไม่?\n- เลือก 'ใช่ (Yes)' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\n- เลือก 'ไม่ใช่ (No)' เพื่อยกเลิกการดำเนินการ\n\nหมายเหตุ: ไฟล์จะถูกดาวน์โหลดลงในไดเรกทอรีของแอปพลิเคชัน และจะถูกนำกลับมาใช้ใหม่โดยอัตโนมัติหากมีไฟล์อยู่แล้ว" +t MSG_355 "⚠จะไม่มีการถามยืนยันซ้ำ⚠ ลบข้อมูลดิสก์ แล้วติดตั้ง:" +t MSG_356 "คุณเลือกที่จะใช้งานตัวเลือก การติดตั้ง Windows \"แบบเงียบ\"\n\nนี่คือตัวเลือกขั้นสูง ซึ่งสงวนไว้สำหรับผู้ที่ต้องการสร้างสื่อติดตั้งที่จะไม่ถามผู้ใช้ในระหว่างการติดตั้ง Windows ดังนั้นมันจะลบข้อมูลในดิสก์ตัวแรกที่ตรวจพบในระบบปลายทาง **โดยไม่มีเงื่อนไข** หากคุณไม่ระมัดระวัง การใช้ตัวเลือกนี้อาจส่งผลให้ **เกิดการสูญเสียข้อมูลอย่างถาวรและไม่สามารถกู้คืนได้!**\n\nหากนี่ไม่ใช่สิ่งที่คุณต้องการ โปรดเลือก 'ไม่ใช่ (No)' เพื่อย้อนกลับและยกเลิกการเลือกตัวเลือกดังกล่าว\nมิฉะนั้น หากคุณเลือก 'ใช่ (Yes)' คุณยอมรับว่าความรับผิดชอบทั้งหมดต่อการสูญหายของข้อมูลใดๆ จะตกอยู่ที่ตัวคุณแต่เพียงผู้เดียว" +t MSG_358 "ไม่รองรับตำแหน่งที่ตั้งของไฟล์อิมเมจ" +t MSG_359 "คุณไม่สามารถใช้ไฟล์อิมเมจที่อยู่ในไดรฟ์เป้าหมายได้ เนื่องจากไดรฟ์นั้นกำลังจะถูกลบข้อมูลทั้งหมด มันก็เหมือนกับการพยายามทำลายที่มั่นตัวเองอยู่นั่นแหละ!\n\nโปรดย้ายอิมเมจไปยังตำแหน่งอื่นแล้วลองใหม่อีกครั้ง" +t MSG_360 "การเปิดตัวเลือกนี้ทิ้งไว้มีความปลอดภัย ถึงแม้ว่าคุณจะมี TPM หรือแรมที่มากกว่าก็ตาม ตัวเลือกนี้มีผลแค่การข้าม ข้อกำหนดในการติดตั้ง เท่านั้น ไม่ได้ลดทอนการทำงานของ Windows ในการดึงประสิทธิภาพฮาร์ดแวร์มาใช้อย่างเต็มที่" +t MSG_361 "เพื่อให้ตัวเลือกนี้ทำงานได้ จะต้องปิดการเชื่อมต่อเครือข่าย/อินเทอร์เน็ตขณะทำการติดตั้งก่อน" +t MSG_362 "ตอบ 'ไม่ใช่ (no)' โดยอัตโนมัติ สำหรับคำถามในการตั้งค่า Windows ที่เกี่ยวกับการแชร์ข้อมูลให้กับ Microsoft โดยไม่ต้องเด้งถามผู้ใช้" +t MSG_363 "คุณควรจะเปิดตัวเลือกนี้ทิ้งไว้ ยกเว้นว่าคุณจะยอมรับได้หาก 'Windows To Go' เข้าถึงดิสก์ภายในเครื่อง และทำการอัปเกรดระบบไฟล์โดยอัตโนมัติ ซึ่งเป็นการดำเนินการที่ไม่สามารถย้อนกลับได้" +t MSG_364 "สร้างบัญชีผู้ใช้ภายในเครื่อง (Local account) ตามชื่อที่ระบุโดยอัตโนมัติ ซึ่งจะไม่มีรหัสผ่าน และอาจจะต้องเปลี่ยนรหัสเมื่อเข้าสู่ระบบครั้งถัดไป" +t MSG_365 "คัดลอกการตั้งค่าภูมิภาคจากพีซีปัจจุบัน (ภาษาแป้นพิมพ์, โซนเวลา, สกุลเงิน, ฯลฯ) โดยไม่ต้องเด้งถามผู้ใช้" +t MSG_366 "อย่าเข้ารหัสดิสก์ระบบ นอกเหนือจากว่าจะเป็นผู้ใช้งานจะเป็นผู้สั่งให้เข้ารหัสเอง" +t MSG_367 "โปรดใช้ตัวเลือกนี้เฉพาะในกรณีที่คุณทราบว่า S-Mode คืออะไร และเข้าใจว่าระบบของคุณอาจถูกล็อกให้อยู่ใน S-Mode ต่อไป แม้ว่าคุณจะทำการล้างข้อมูลทั้งหมดและติดตั้ง Windows ใหม่แล้วก็ตาม" +t MSG_368 "ใช้ตัวเลือกนี้หากระบบที่คุณต้องการติดตั้ง Windows มีการใช้ใบรับรอง Secure Boot ที่อัปเดตเป็นเวอร์ชันล่าสุดแล้ว หากจำเป็น คุณสามารถศึกษาการใช้เครื่องมือ 'Mosby' เพื่อทำการอัปเดตระบบของคุณได้" +t MSG_369 "ใช้ตัวเลือกนี้หากคุณต้องการเพิกถอนสิทธิ์บูตโหลดเดอร์ของ Windows เพิ่มเติมที่อาจจะไม่ปลอดภัย แต่โปรดทราบว่ามีความเสี่ยงที่จะทำให้สื่อติดตั้ง Windows มาตรฐานทั่วไปไม่สามารถบูตได้ด้วยเช่นกัน" +t MSG_370 "\"การปรับปรุงคุณภาพการใช้งาน (Quality of Life)\": ปิดการใช้งานคุณสมบัติส่วนใหญ่ที่ไม่พึงประสงค์ที่ Microsoft พยายามบังคับให้ผู้ใช้งานทั่วไปต้องใช้" +t MSG_371 "ถ้าหากคุณเลือกตัวเลือกนี้ กรุณาเช็คให้มั่นใจว่าคุณถอดดิสก์ที่เชื่อมกับพีซีเป้าหมาย เหลือไว้เฉพาะดิสก์ที่คุณต้องการจะติดตั้ง Windows เท่านั้น และห้ามเสียบตัวติดตั้ง (เช่น แฟลชไดรฟ์) ทิ้งไว้ในคอมพิวเตอร์เครื่องใดก็ตามที่คุณไม่ต้องการให้ข้อมูลถูกลบ\"" t MSG_900 "Rufus คือ โปรแกรมที่ช่วยฟอร์แมต และสร้างไดรฟ์บูต USB จาก USB keys, pendrives, memory sticks เป็นต้น" t MSG_901 "เว็บไซต์ทางการ: %s" t MSG_902 "ซอร์สโค้ด: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 469894d4..5566f5af 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.14.2333" +CAPTION "Rufus 4.14.2334" 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,14,2333,0 - PRODUCTVERSION 4,14,2333,0 + FILEVERSION 4,14,2334,0 + PRODUCTVERSION 4,14,2334,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.14.2333" + VALUE "FileVersion", "4.14.2334" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2333" + VALUE "ProductVersion", "4.14.2334" END END BLOCK "VarFileInfo" From e5398294d40671d0a72f87567a0b110a46256107 Mon Sep 17 00:00:00 2001 From: Thomas De Rocker <thomasderocker@outlook.com> Date: Mon, 23 Mar 2026 19:05:42 +0000 Subject: [PATCH 144/192] [loc] update Dutch translation to latest --- res/loc/po/nl-NL.po | 154 +++++++++++++++++++++++++++++++++++++++----- res/loc/rufus.loc | 32 +++++++-- src/rufus.rc | 10 +-- 3 files changed, 171 insertions(+), 25 deletions(-) diff --git a/res/loc/po/nl-NL.po b/res/loc/po/nl-NL.po index a25ffaca..cfb131c1 100644 --- a/res/loc/po/nl-NL.po +++ b/res/loc/po/nl-NL.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-04-26 11:15+0200\n" -"PO-Revision-Date: 2024-04-26 11:44+0200\n" +"POT-Creation-Date: 2026-03-23 18:59+0000\n" +"PO-Revision-Date: 2026-03-23 19:01+0000\n" "Last-Translator: \n" "Language-Team: \n" "Language: nl_NL\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Dutch (Nederlands)\n" "X-Rufus-LCID: 0x0413, 0x0813\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -137,7 +137,7 @@ msgstr "Nee" #. • IDD_LOG → IDD_LOG msgid "Log" -msgstr "" +msgstr "Logboek" #. • IDD_LOG → IDC_LOG_CLEAR msgid "Clear" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -846,7 +846,7 @@ msgstr "Geen persistentie" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "De grootte van de persistente partitie instellen voor live USB-media. De grootte op 0 instellen schakelt de persistente partitie uit." @@ -888,17 +888,17 @@ msgstr "Een ander programma of proces gebruikt deze schijf. Wilt u ze toch forma #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Rufus heeft gedetecteerd dat u probeert om een Windows To Go medium aan te maken gebaseerd op een 1809-ISO\n" +"Rufus heeft vastgesteld dat u probeert een ‘Windows To Go’-medium te maken op basis van een 1809-ISO.\n" "\n" -"Door een *MICROSOFT-BUG* zal dit medium crashen tijdens het opstarten van Windows (Blue Screen Of Death), tenzij u manueel het bestand 'WppRecorder.sys' vervangt door een 1803-versie.\n" +"Vanwege een *MICROSOFT-BUG* zal dit medium tijdens het opstarten van Windows crashen (Blue Screen Of Death), tenzij u het bestand ‘WppRecorder.sys’ handmatig vervangt door een versie uit 1803.\n" "\n" -"Merk ook op dat Rufus dit voor u niet automatisch kan oplossen omdat 'WppRecorder.sys' een Microsoft-auteursrecht heeft, dus we kunnen geen kopie van het bestand in de toepassing inbedden op een legale manier..." +"Houd er ook rekening mee dat Rufus dit niet automatisch voor u kan oplossen omdat ‘WppRecorder.sys’ een door Microsoft auteursrechtelijk beschermd bestand is, waardoor we wettelijk gezien geen kopie van het bestand in de applicatie mogen opnemen..." #. • MSG_134 msgid "" @@ -1795,6 +1795,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Kan '%s' niet openen of lezen" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "SkuSiPolicy.p7b toepassen tijdens installatie (zie KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Verbeteringen in de gebruikersvriendelijkheid (Copilot, Onedrive, Outlook, Fast Startup, enz niet forceren)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Windows aanpassen: %s" @@ -1845,17 +1853,17 @@ msgstr "" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Er moet een extra bestand ('diskcopy.dll') worden gedownload van Microsoft om MS-DOS te installeren:\n" -"- Selecteer 'Ja' om verbinding te maken met internet en het bestand te downloaden\n" -"- Selecteer 'Nee' om de bewerking te annuleren\n" +"Om deze functie te kunnen gebruiken, moet u een extra bestand (‘%s’) downloaden van Microsoft:\n" +"- Selecteer ‘Ja’ om verbinding te maken met internet en het bestand te downloaden\n" +"- Selecteer ‘Nee’ om de handeling te annuleren\n" "\n" -"Opmerking: het bestand wordt gedownload in de map van de toepassing en wordt automatisch opnieuw gebruikt als het aanwezig is." +"Opmerking: het bestand wordt gedownload naar de map van de toepassing en wordt automatisch opnieuw gebruikt als het daar al aanwezig is." #. • MSG_338 msgid "Revoked UEFI bootloader detected" @@ -1919,6 +1927,120 @@ msgstr "Archiefbestanden uitpakken: %s" msgid "Use Rufus MBR" msgstr "Rufus MBR gebruiken" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "'Windows CA 2023' signed bootloaders gebruiken (alleen voor compatibele doel-pc's)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Controleren of de UEFI-bootloader is ingetrokken..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Controleren op updates voor UEFI DBX..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "Update voor DBX beschikbaar" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus heeft een bijgewerkte versie gevonden van de DBX-bestanden die worden gebruikt voor het controleren van de intrekking van UEFI Secure Boot. Wilt u deze update downloaden?\n" +"- Selecteer ‘Ja’ om verbinding te maken met internet en deze inhoud te downloaden\n" +"- Selecteer ‘Nee’ om de bewerking te annuleren\n" +"\n" +"Opmerking: de bestanden worden gedownload naar de map van de toepassing en worden automatisch opnieuw gebruikt als ze daar al aanwezig zijn.\n" +"\n" +"Vertaald met DeepL.com (gratis versie)" + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠STIL⚠ schijf wissen en installeren:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"U hebt ervoor gekozen om de “stille” Windows-installatieoptie te gebruiken.\n" +"\n" +"Dit is een geavanceerde optie, bedoeld voor gebruikers die installatiemedia willen maken waarbij de gebruiker tijdens de Windows-installatie niet om bevestiging wordt gevraagd en waarbij de eerste gedetecteerde schijf op het doelsysteem daarom ONVOORWAARDELIJK WORDT GEWIST. Als u niet voorzichtig bent, kan het gebruik van deze optie leiden tot ONOMKEERBAAR GEGEVENSVERLIES!\n" +"\n" +"Als dit niet is wat u wilt, selecteer dan ‘Nee’ om terug te gaan en vink de optie uit.\n" +"Anders, als u ‘Ja’ selecteert, gaat u ermee akkoord dat de volledige verantwoordelijkheid voor eventueel gegevensverlies volledig bij uzelf ligt." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Locatie van image niet ondersteund" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"U kunt geen image gebruiken die op de doelschijf staat, aangezien die schijf volledig zal worden gewist. Dat is hetzelfde als proberen de tak door te zagen waarop u zit!\n" +"\n" +"Verplaats de image naar een andere locatie en probeer het opnieuw." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "U kunt deze optie gerust ingeschakeld laten, zelfs als u een TPM of meer RAM-geheugen hebt, aangezien deze optie alleen de installatievereisten omzeilt en niet daadwerkelijk verhindert dat Windows alle beschikbare hardware gebruikt." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Om deze optie te laten werken, MOET de netwerk-/internetverbinding tijdens de installatie uitgeschakeld zijn!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Beantwoord de vragen in de Windows-installatieprocedure over het delen van gegevens met Microsoft automatisch met ‘nee’, in plaats van de gebruiker hierom te vragen." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Laat deze optie ingeschakeld, tenzij u ermee akkoord gaat dat ‘Windows To Go’ toegang krijgt tot interne schijven en in de achtergrond onomkeerbare upgrades van het bestandssysteem uitvoert." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Maak automatisch een lokaal account aan met de opgegeven gebruikersnaam en een leeg wachtwoord, dat bij de volgende aanmelding moet worden gewijzigd." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Kopieer de regionale instellingen van deze pc (toetsenbord, tijdzone, valuta), in plaats van de gebruiker hierom te vragen." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "De systeemschijf niet versleutelen, tenzij de gebruiker hier uitdrukkelijk om vraagt." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Gebruik deze optie alleen als u weet wat S-Mode is en u zich ervan bewust bent dat uw systeem mogelijk in S-Mode blijft staan, zelfs nadat u Windows volledig hebt gewist en opnieuw hebt geïnstalleerd." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Gebruik deze optie als het systeem waarop u Windows wilt installeren, volledig bijgewerkte Secure Boot-certificaten gebruikt. Indien nodig kunt u overwegen om ‘Mosby’ te gebruiken om uw systeem bij te werken." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Gebruik deze optie als u extra, mogelijk onveilige Windows-bootloaders wilt uitschakelen, maar houd er rekening mee dat hierdoor mogelijk ook standaard Windows-media niet meer kunnen opstarten." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Verbeteringen op het gebied van levenskwaliteit: schakel de meeste ongewenste functies uit die Microsoft eindgebruikers probeert op te dringen." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Als u deze optie gebruikt, zorg er dan voor dat u alle schijven van de doelcomputer loskoppelt, behalve de schijf waarop u Windows wilt installeren, en laat het installatiemedium niet aangesloten op een computer die u niet wilt wissen." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index c6916f14..0e511bdf 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -11,7 +11,7 @@ # • v4.5 "hr-HR" "Croatian (Hrvatski)" # • v4.14 "cs-CZ" "Czech (Čeština)" # • v4.5 "da-DK" "Danish (Dansk)" -# • v4.5 "nl-NL" "Dutch (Nederlands)" +# • v4.14 "nl-NL" "Dutch (Nederlands)" # • v4.5 "fi-FI" "Finnish (Suomi)" # • v4.14 "fr-FR" "French (Français)" # • v4.5 "de-DE" "German (Deutsch)" @@ -3628,7 +3628,7 @@ t MSG_922 "Hent UEFI Shell ISOer" ######################################################################### l "nl-NL" "Dutch (Nederlands)" 0x0413, 0x0813 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -3663,6 +3663,7 @@ t IDD_LICENSE "Rufus-licentie" g IDD_LOG t IDCANCEL "Sluiten" +t IDD_LOG "Logboek" t IDC_LOG_CLEAR "Wissen" t IDC_LOG_SAVE "Opslaan" @@ -3813,7 +3814,7 @@ t MSG_129 "U hebt net een medium aangemaakt dat de UEFI:NTFS-bootloader gebruikt t MSG_130 "Windows-image selectie" t MSG_131 "Deze ISO bevat meerdere Windows-images.\nSelecteer de image die u wilt gebruiken voor deze installatie:" t MSG_132 "Een ander programma of proces gebruikt deze schijf. Wilt u ze toch formatteren?" -t MSG_133 "Rufus heeft gedetecteerd dat u probeert om een Windows To Go medium aan te maken gebaseerd op een 1809-ISO\n\nDoor een *MICROSOFT-BUG* zal dit medium crashen tijdens het opstarten van Windows (Blue Screen Of Death), tenzij u manueel het bestand 'WppRecorder.sys' vervangt door een 1803-versie.\n\nMerk ook op dat Rufus dit voor u niet automatisch kan oplossen omdat 'WppRecorder.sys' een Microsoft-auteursrecht heeft, dus we kunnen geen kopie van het bestand in de toepassing inbedden op een legale manier..." +t MSG_133 "Rufus heeft vastgesteld dat u probeert een ‘Windows To Go’-medium te maken op basis van een 1809-ISO.\n\nVanwege een *MICROSOFT-BUG* zal dit medium tijdens het opstarten van Windows crashen (Blue Screen Of Death), tenzij u het bestand ‘WppRecorder.sys’ handmatig vervangt door een versie uit 1803.\n\nHoud er ook rekening mee dat Rufus dit niet automatisch voor u kan oplossen omdat ‘WppRecorder.sys’ een door Microsoft auteursrechtelijk beschermd bestand is, waardoor we wettelijk gezien geen kopie van het bestand in de applicatie mogen opnemen..." t MSG_134 "Omdat MBR geselecteerd werd als partitie-indeling, kan Rufus slechts een partitie tot 2 TB aanmaken op dit medium, wat %s schijfruimte onbeschikbaar zal laten.\n\nWeet u zeker dat u wilt doorgaan?" t MSG_135 "Versie" t MSG_137 "Editie" @@ -3998,6 +3999,8 @@ t MSG_319 "Opstartmarkering negeren" t MSG_320 "Partitie-layout verversen (%s)..." t MSG_321 "De image die u hebt geselecteerd is een ISOHybrid, maar de makers ervan hebben hem niet compatibel gemaakt met de ISO/bestandskopieermodus.\nAls gevolg daarvan zal de DD-image schrijfmodus worden afgedwongen." t MSG_322 "Kan '%s' niet openen of lezen" +t MSG_323 "SkuSiPolicy.p7b toepassen tijdens installatie (zie KB5042562)" +t MSG_324 "Verbeteringen in de gebruikersvriendelijkheid (Copilot, Onedrive, Outlook, Fast Startup, enz niet forceren)" t MSG_325 "Windows aanpassen: %s" t MSG_326 "Gebruikersopties toepassen..." t MSG_327 "Windows gebruikerservaring" @@ -4009,7 +4012,7 @@ t MSG_332 "Voorkomen dat Windows To Go toegang heeft tot interne schijven" t MSG_333 "Lokale account met gebruikersnaam aanmaken:" t MSG_334 "Regionale opties op dezelfde waarden als deze gebruiker instellen" t MSG_335 "Automatische Bitlocker-apparaatversleuteling uitschakelen" -t MSG_337 "Om deze functie te kunnen gebruiken, moet u een extra bestand ('%s') downloaden van Microsoft:\n- Selecteer 'Ja' om verbinding te maken met internet en het bestand te downloaden\n- Selecteer 'Nee' om de bewerking te annuleren\n\nOpmerking: het bestand wordt gedownload in de map van de toepassing en wordt automatisch opnieuw gebruikt als het aanwezig is." +t MSG_337 "Om deze functie te kunnen gebruiken, moet u een extra bestand (‘%s’) downloaden van Microsoft:\n- Selecteer ‘Ja’ om verbinding te maken met internet en het bestand te downloaden\n- Selecteer ‘Nee’ om de handeling te annuleren\n\nOpmerking: het bestand wordt gedownload naar de map van de toepassing en wordt automatisch opnieuw gebruikt als het daar al aanwezig is." t MSG_338 "Ingetrokken UEFI-bootloader gedetecteerd" t MSG_339 "Rufus heeft gedetecteerd dat de ISO die u hebt geselecteerd een UEFI-bootloader bevat die is ingetrokken en %s zal produceren wanneer Secure Boot is ingeschakeld op een volledig bijgewerkt UEFI-systeem.\n\n- Als u deze ISO-image hebt verkregen van een niet-vertrouwde bron, houdt u best rekening met de mogelijkheid dat het UEFI-malware bevat en vermijdt u om ervan op te starten.\n- Als u het van een betrouwbare bron hebt verkregen, moet u proberen een meer up-to-date versie te vinden die deze waarschuwing niet produceert." t MSG_340 "een \"Security Violation\"-scherm" @@ -4022,6 +4025,27 @@ t MSG_346 "Windows beperken tot S-Modus (NIET COMPATIBEL met omzeiling voor onli t MSG_347 "Expert-modus" t MSG_348 "Archiefbestanden uitpakken: %s" t MSG_349 "Rufus MBR gebruiken" +t MSG_350 "'Windows CA 2023' signed bootloaders gebruiken (alleen voor compatibele doel-pc's)" +t MSG_351 "Controleren of de UEFI-bootloader is ingetrokken..." +t MSG_352 "Controleren op updates voor UEFI DBX..." +t MSG_353 "Update voor DBX beschikbaar" +t MSG_354 "Rufus heeft een bijgewerkte versie gevonden van de DBX-bestanden die worden gebruikt voor het controleren van de intrekking van UEFI Secure Boot. Wilt u deze update downloaden?\n- Selecteer ‘Ja’ om verbinding te maken met internet en deze inhoud te downloaden\n- Selecteer ‘Nee’ om de bewerking te annuleren\n\nOpmerking: de bestanden worden gedownload naar de map van de toepassing en worden automatisch opnieuw gebruikt als ze daar al aanwezig zijn.\n\nVertaald met DeepL.com (gratis versie)" +t MSG_355 "⚠STIL⚠ schijf wissen en installeren:" +t MSG_356 "U hebt ervoor gekozen om de “stille” Windows-installatieoptie te gebruiken.\n\nDit is een geavanceerde optie, bedoeld voor gebruikers die installatiemedia willen maken waarbij de gebruiker tijdens de Windows-installatie niet om bevestiging wordt gevraagd en waarbij de eerste gedetecteerde schijf op het doelsysteem daarom ONVOORWAARDELIJK WORDT GEWIST. Als u niet voorzichtig bent, kan het gebruik van deze optie leiden tot ONOMKEERBAAR GEGEVENSVERLIES!\n\nAls dit niet is wat u wilt, selecteer dan ‘Nee’ om terug te gaan en vink de optie uit.\nAnders, als u ‘Ja’ selecteert, gaat u ermee akkoord dat de volledige verantwoordelijkheid voor eventueel gegevensverlies volledig bij uzelf ligt." +t MSG_358 "Locatie van image niet ondersteund" +t MSG_359 "U kunt geen image gebruiken die op de doelschijf staat, aangezien die schijf volledig zal worden gewist. Dat is hetzelfde als proberen de tak door te zagen waarop u zit!\n\nVerplaats de image naar een andere locatie en probeer het opnieuw." +t MSG_360 "U kunt deze optie gerust ingeschakeld laten, zelfs als u een TPM of meer RAM-geheugen hebt, aangezien deze optie alleen de installatievereisten omzeilt en niet daadwerkelijk verhindert dat Windows alle beschikbare hardware gebruikt." +t MSG_361 "Om deze optie te laten werken, MOET de netwerk-/internetverbinding tijdens de installatie uitgeschakeld zijn!" +t MSG_362 "Beantwoord de vragen in de Windows-installatieprocedure over het delen van gegevens met Microsoft automatisch met ‘nee’, in plaats van de gebruiker hierom te vragen." +t MSG_363 "Laat deze optie ingeschakeld, tenzij u ermee akkoord gaat dat ‘Windows To Go’ toegang krijgt tot interne schijven en in de achtergrond onomkeerbare upgrades van het bestandssysteem uitvoert." +t MSG_364 "Maak automatisch een lokaal account aan met de opgegeven gebruikersnaam en een leeg wachtwoord, dat bij de volgende aanmelding moet worden gewijzigd." +t MSG_365 "Kopieer de regionale instellingen van deze pc (toetsenbord, tijdzone, valuta), in plaats van de gebruiker hierom te vragen." +t MSG_366 "De systeemschijf niet versleutelen, tenzij de gebruiker hier uitdrukkelijk om vraagt." +t MSG_367 "Gebruik deze optie alleen als u weet wat S-Mode is en u zich ervan bewust bent dat uw systeem mogelijk in S-Mode blijft staan, zelfs nadat u Windows volledig hebt gewist en opnieuw hebt geïnstalleerd." +t MSG_368 "Gebruik deze optie als het systeem waarop u Windows wilt installeren, volledig bijgewerkte Secure Boot-certificaten gebruikt. Indien nodig kunt u overwegen om ‘Mosby’ te gebruiken om uw systeem bij te werken." +t MSG_369 "Gebruik deze optie als u extra, mogelijk onveilige Windows-bootloaders wilt uitschakelen, maar houd er rekening mee dat hierdoor mogelijk ook standaard Windows-media niet meer kunnen opstarten." +t MSG_370 "Verbeteringen op het gebied van levenskwaliteit: schakel de meeste ongewenste functies uit die Microsoft eindgebruikers probeert op te dringen." +t MSG_371 "Als u deze optie gebruikt, zorg er dan voor dat u alle schijven van de doelcomputer loskoppelt, behalve de schijf waarop u Windows wilt installeren, en laat het installatiemedium niet aangesloten op een computer die u niet wilt wissen." t MSG_900 "Rufus is een programma dat helpt bij het formatteren en aanmaken van opstartbare USB-flash-drives, zoals USB-sticks, geheugensticks, enz." t MSG_901 "Officiële site: %s" t MSG_902 "Broncode: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 5566f5af..39ba986e 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.14.2334" +CAPTION "Rufus 4.14.2335" 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,14,2334,0 - PRODUCTVERSION 4,14,2334,0 + FILEVERSION 4,14,2335,0 + PRODUCTVERSION 4,14,2335,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.14.2334" + VALUE "FileVersion", "4.14.2335" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2334" + VALUE "ProductVersion", "4.14.2335" END END BLOCK "VarFileInfo" From da599641a5b41c64e9eb23591aff21a9bdfdf6b6 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 24 Mar 2026 14:09:52 +0000 Subject: [PATCH 145/192] [togo] support recent versions of bcdboot and add support for 2023 CA * Recent bcdboot introduced the /bootex and /offline parameters for the use of the 2023 CA signed bootloaders. * When /offline is not set, it also automatically attempts to use the 2023 CA bootloaders, regardless of whether they are available from the source repository or not, which results in errors with Windows 10 ISOs. * To compensate for that, we now detect if we use a modern bcdboot and always use /offline if that is the case, so that we can tell it explicitly whether to use the EX/2023-CA signed bootloaders or not. * Also create the \EFI\Microsoft\Boot\ directory on the ESP, since bcdboot doesn't create it on its own, yet tries to copy files there. * Closes #2940. --- src/rufus.c | 18 ++++++++++++++---- src/rufus.h | 11 +++++++---- src/rufus.rc | 10 +++++----- src/wue.c | 24 +++++++++++++++++++----- 4 files changed, 45 insertions(+), 18 deletions(-) diff --git a/src/rufus.c b/src/rufus.c index 4b89b9fb..479f39d3 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1,4 +1,4 @@ -/* +/* * Rufus: The Reliable USB Formatting Utility * Copyright © 2011-2026 Pete Batard <pete@akeo.ie> * @@ -108,7 +108,7 @@ extern const char *bootmgr_efi_name, *efi_dirname, *efi_bootname[ARCH_MAX]; * Globals */ OPENED_LIBRARIES_VARS; -RUFUS_UPDATE update = { { 0,0,0 },{ 0,0 }, NULL, NULL }; +RUFUS_UPDATE update = { 0 }; HINSTANCE hMainInstance; HWND hMainDialog, hMultiToolbar, hSaveToolbar, hHashToolbar, hAdvancedDeviceToolbar, hAdvancedFormatToolbar, hUpdatesDlg = NULL; HFONT hInfoFont = NULL, hSectionHeaderFont = NULL; @@ -123,7 +123,7 @@ USHORT NativeMachine = IMAGE_FILE_MACHINE_UNKNOWN; HWND hDeviceList, hPartitionScheme, hTargetSystem, hFileSystem, hClusterSize, hLabel, hBootType, hNBPasses, hLog = NULL; HWND hImageOption, hLogDialog = NULL, hProgress = NULL, hFidoDlg = NULL; HANDLE dialog_handle = NULL, format_thread = NULL; -BOOL is_x86_64, use_own_c32[NB_OLD_C32] = { FALSE, FALSE }, mbr_selected_by_user = FALSE, lock_drive = TRUE; +BOOL is_x86_64, use_own_c32[NB_OLD_C32] = { 0 }, mbr_selected_by_user = FALSE, lock_drive = TRUE; BOOL op_in_progress = TRUE, right_to_left_mode = FALSE, has_uefi_csm = FALSE, its_a_me_mario = FALSE; BOOL enable_HDDs = FALSE, enable_VHDs = TRUE, enable_ntfs_compression = FALSE, no_confirmation_on_cancel = FALSE; BOOL advanced_mode_device, advanced_mode_format, allow_dual_uefi_bios, detect_fakes, enable_vmdk, force_large_fat32; @@ -131,7 +131,7 @@ BOOL usb_debug, use_fake_units, preserve_timestamps = FALSE, fast_zeroing = FALS BOOL zero_drive = FALSE, list_non_usb_removable_drives = FALSE, enable_file_indexing, large_drive = FALSE; BOOL write_as_image = FALSE, write_as_esp = FALSE, use_vds = FALSE, ignore_boot_marker = FALSE, save_image = FALSE; BOOL appstore_version = FALSE, is_vds_available = TRUE, persistent_log = FALSE, has_ffu_support = FALSE; -BOOL expert_mode = FALSE, use_rufus_mbr = TRUE; +BOOL expert_mode = FALSE, use_rufus_mbr = TRUE, bcdboot_supports_ex = FALSE; float fScale = 1.0f; int dialog_showing = 0, selection_default = BT_IMAGE, persistence_unit_selection = -1, imop_win_sel = 0; int default_fs, fs_type, boot_type, partition_type, target_type; @@ -1636,6 +1636,11 @@ static DWORD WINAPI BootCheckThread(LPVOID param) StrArrayAdd(&selection.choices, lmprintf(MSG_324), TRUE); StrArrayAdd(&selection.tooltips, lmprintf(MSG_370), TRUE); MAP_BIT(UNATTEND_QOL_ENHANCEMENTS); + if (img_report.win_version.build >= 26200 && bcdboot_supports_ex) { + StrArrayAdd(&selection.choices, lmprintf(MSG_350), TRUE); + StrArrayAdd(&selection.tooltips, lmprintf(MSG_368), TRUE); + MAP_BIT(UNATTEND_USE_MS2023_BOOTLOADERS); + } } if (expert_mode) { StrArrayAdd(&selection.choices, lmprintf(MSG_346), TRUE); @@ -3836,6 +3841,11 @@ skip_args_processing: static_sprintf(tmp_path, "%s\\dism\\FfuProvider.dll", sysnative_dir); has_ffu_support = (_accessU(tmp_path, 0) == 0); + // Detect if bcdboot supports the /offline /bootex options (v10.0.26100.0 or later) + static_sprintf(tmp_path, "%s\\bcdboot.exe", sysnative_dir); + bcdboot_supports_ex = (version_to_uint64(GetExecutableVersion(tmp_path)) >= 0x000A000065F40000); + uprintf("Detected bcdboot %s EX options", bcdboot_supports_ex ? "with" : "without"); + relaunch: ubprintf("Localization set to '%s'", selected_locale->txt[0]); right_to_left_mode = ((selected_locale->ctrl_id) & LOC_RIGHT_TO_LEFT); diff --git a/src/rufus.h b/src/rufus.h index a91b45c9..54b8553f 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -658,11 +658,14 @@ enum WindowsVersion { }; typedef struct { - DWORD Major; - DWORD Minor; - DWORD Micro; - DWORD Nano; + WORD Major; + WORD Minor; + WORD Micro; + WORD Nano; } version_t; +static __inline uint64_t version_to_uint64(version_t* ver) { + return (uint64_t)ver->Major << 48 | (uint64_t)ver->Minor << 32 | (uint64_t)ver->Micro << 16 | ver->Nano; +} typedef struct { DWORD Version; diff --git a/src/rufus.rc b/src/rufus.rc index 39ba986e..817bd750 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.14.2335" +CAPTION "Rufus 4.14.2336" 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,14,2335,0 - PRODUCTVERSION 4,14,2335,0 + FILEVERSION 4,14,2336,0 + PRODUCTVERSION 4,14,2336,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.14.2335" + VALUE "FileVersion", "4.14.2336" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2335" + VALUE "ProductVersion", "4.14.2336" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index f7b83f0b..44a009cb 100644 --- a/src/wue.c +++ b/src/wue.c @@ -50,7 +50,7 @@ int unattend_edition_index = 1; char *unattend_xml_path = NULL, unattend_username[MAX_USERNAME_LENGTH]; uint32_t removable_section[2] = { 0, 0 }; -extern BOOL validate_md5sum; +extern BOOL validate_md5sum, bcdboot_supports_ex; extern uint64_t md5sum_totalbytes; extern StrArray modified_files; extern const char* efi_archname[ARCH_MAX]; @@ -957,7 +957,8 @@ out: /// <returns>TRUE on success, FALSE on error.</returns> BOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp) { - char *ms_efi = NULL, wim_path[4 * MAX_PATH], cmd[MAX_PATH]; + char *ms_efi = NULL, wim_path[4 * MAX_PATH], cmd[MAX_PATH], path[MAX_PATH]; + BOOL use_bootex = FALSE; ULONG cluster_size; uprintf("Windows To Go mode selected"); @@ -1015,11 +1016,24 @@ BOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp) // We invoke the 'bcdboot' command from the host, as the one from the drive produces problems (#558) // and of course, we couldn't invoke an ARM64 'bcdboot' binary on an x86 host anyway... - // Also, since Rufus should (usually) be running as a 32 bit app, on 64 bit systems, we need to use + // Also, since Rufus may be running as a 32 bit app, on 64 bit systems, we need to use // 'C:\Windows\Sysnative' and not 'C:\Windows\System32' to invoke bcdboot, as 'C:\Windows\System32' // will get converted to 'C:\Windows\SysWOW64' behind the scenes, and there is no bcdboot.exe there. + // Finally, due to the whole _EX mess, we have to detect if the system bcdboot supports the /offline + // option, and if it does, whether the target has `Windows\Boot\EFI_EX\` so that we don't let bcdboot + // attempt to use the _EX files and fail. See https://github.com/pbatard/rufus/issues/2940. uprintf("Enabling boot using command:"); - static_sprintf(cmd, "%s\\bcdboot.exe %s\\Windows /v /f %s /s %s", sysnative_dir, drive_name, + // Create the EFI\Microsoft\Boot\ directory on the ESP, since bcdboot is apparently unable to do that! + static_sprintf(path, "%s\\EFI\\Microsoft\\Boot", (use_esp) ? ms_efi : drive_name); + _mkdirExU(path); + // The default of recent bcdboot is to try to use the EX files (even if they don't exist) unless + // /offline is specified *without* /bootex, which of course results in an error if, say, we try + // to create a Windows 10 Windows To Go drive on an up to date Windows platform. + // So we need to specify /offline and /bootex very carefully. + static_sprintf(path, "%s\\Windows\\Boot\\EFI_EX", drive_name); + use_bootex = (bcdboot_supports_ex && (unattend_xml_flags & UNATTEND_USE_MS2023_BOOTLOADERS) && PathFileExistsU(path)); + static_sprintf(cmd, "%s\\bcdboot.exe %s\\Windows /v %s%s/f %s /s %s", sysnative_dir, drive_name, + bcdboot_supports_ex ? "/offline " : "", use_bootex ? "/bootex " : "", HAS_BOOTMGR_BIOS(img_report) ? (HAS_BOOTMGR_EFI(img_report) ? "ALL" : "BIOS") : "UEFI", (use_esp) ? ms_efi : drive_name); // I don't believe we can ever have a stray '%' in cmd, but just in case... @@ -1304,7 +1318,7 @@ BOOL ApplyWindowsCustomization(char drive_letter, int flags) UpdateProgressWithInfoForce(OP_PATCH, MSG_325, 103, PATCH_PROGRESS_TOTAL); } - if (flags & UNATTEND_USE_MS2023_BOOTLOADERS) { + if ((flags & UNATTEND_USE_MS2023_BOOTLOADERS) && !(flags & UNATTEND_WINDOWS_TO_GO)) { if_assert_fails(update_boot_wim) goto out; if (GetTempDirNameU(temp_dir, APPLICATION_NAME, 0, tmp_path[1]) == 0) { From 4803a80a2e3219cbf1dd14600422bfa119f22307 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 24 Mar 2026 23:56:43 +0000 Subject: [PATCH 146/192] [ui] fix overlapping tooltips on the WUE dialog * Whelp, in typical Microsoft fashion, you have to do your own convoluted mouse handling if you want this to work as expected, since mouse messages related to tooltips are only being natively processed for the main dialog thread. * Also clean up/harmonize existing stdlg.c code. --- src/rufus.h | 8 ++-- src/rufus.rc | 10 ++--- src/stdlg.c | 118 ++++++++++++++++++++++++++++++++------------------- 3 files changed, 85 insertions(+), 51 deletions(-) diff --git a/src/rufus.h b/src/rufus.h index 54b8553f..84eceaf2 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -513,7 +513,7 @@ typedef struct { * EXT_DECL(my_extensions, "default.std", __VA_GROUP__("*.std", "*.other"), __VA_GROUP__("Standard type", "Other Type")); * to define an 'ext_t my_extensions' variable initialized with the relevant attributes. */ -typedef struct ext_t { +typedef struct { size_t count; const char* filename; const char** extension; @@ -820,8 +820,10 @@ extern BOOL CreateTaskbarList(void); extern BOOL SetTaskbarProgressState(TASKBAR_PROGRESS_FLAGS tbpFlags); extern BOOL SetTaskbarProgressValue(ULONGLONG ullCompleted, ULONGLONG ullTotal); extern INT_PTR CreateAboutBox(void); -extern BOOL CreateTooltip(HWND hControl, const char* message, int duration); -extern void DestroyTooltip(HWND hWnd); +extern BOOL CreateTooltipEx(HWND hDlg, HWND hControl, const char* message, int duration); +#define CreateTooltip(hControl, message, duration) CreateTooltipEx(hMainDialog, hControl, message, duration) +extern void PopTooltip(HWND hControl); +extern void DestroyTooltip(HWND hControl); extern void DestroyAllTooltips(void); extern int NotificationEx(int type, const char* dont_display_setting, const notification_info* more_info, const char* title, const char* format, ...); #define Notification(type, title, ...) NotificationEx(type, NULL, NULL, title, __VA_ARGS__) diff --git a/src/rufus.rc b/src/rufus.rc index 817bd750..5de7ea09 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.14.2336" +CAPTION "Rufus 4.14.2337" 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,14,2336,0 - PRODUCTVERSION 4,14,2336,0 + FILEVERSION 4,14,2337,0 + PRODUCTVERSION 4,14,2337,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.14.2336" + VALUE "FileVersion", "4.14.2337" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2336" + VALUE "ProductVersion", "4.14.2337" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index 029612c4..2ba6b00f 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -90,6 +90,12 @@ static int update_settings_reposition_ids[] = { }; static const SETTEXTEX friggin_microsoft_unicode_amateurs = { ST_DEFAULT, CP_UTF8 }; static WNDPROC update_original_proc = NULL; +static struct { + HWND hTip; // Tooltip handle + HWND hCtrl; // Handle of the control the tooltip belongs to + WNDPROC original_proc; + LPWSTR wstring; +} ttlist[MAX_TOOLTIPS] = { 0 }; /* * https://blogs.msdn.microsoft.com/oldnewthing/20040802-00/?p=38283/ @@ -922,7 +928,7 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam } // Set tooltips, if any if (i < (int)selection_data.options->tooltips.Index) - CreateTooltip(hCtrl, selection_data.options->tooltips.String[i], -1); + CreateTooltipEx(hDlg, hCtrl, selection_data.options->tooltips.String[i], -1); } // If our maximum line's width is greater than the default, set a nonzero delta width dw = (mw <= dw) ? 0 : mw - dw; @@ -1085,11 +1091,34 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam return (INT_PTR)FALSE; } +/* + * Because we're not in the main dialog thread, we must handle our own tooltip popping + * when the mouse switches to a different control, else we get overlapping tooltips due + * to Windows not automatically forwarding mouse events to child dialogs. + */ +LRESULT CALLBACK SelectionTooltipPopper(int nCode, WPARAM wParam, LPARAM lParam) +{ + static HWND hPreviousCtrl = NULL; + MOUSEHOOKSTRUCT* mhs; + + // Get the control over which the mouse resides and check if it changed. + if (nCode == HC_ACTION && wParam == WM_MOUSEMOVE) { + mhs = (MOUSEHOOKSTRUCT*)lParam; + if (hPreviousCtrl != mhs->hwnd) { + PopTooltip(hPreviousCtrl); + hPreviousCtrl = mhs->hwnd; + } + + } + return CallNextHookEx(NULL, nCode, wParam, lParam); +} + /* * Display an item selection dialog */ int SelectionDialog(char* title, char* message, selection_dialog_options_t* options) { + HHOOK hook; int ret; assert(options != NULL); @@ -1100,7 +1129,9 @@ int SelectionDialog(char* title, char* message, selection_dialog_options_t* opti if (options->style == 0) options->style = BS_AUTORADIOBUTTON; assert ((options->style == BS_AUTORADIOBUTTON || options->style == BS_AUTOCHECKBOX)); + hook = SetWindowsHookEx(WH_MOUSE, SelectionTooltipPopper, NULL, GetCurrentThreadId()); ret = (int)MyDialogBox(hMainInstance, IDD_SELECTION, hMainDialog, SelectionCallback); + UnhookWindowsHookEx(hook); dialog_showing--; return ret; @@ -1114,7 +1145,7 @@ INT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa LRESULT loc; int i, dh, r = -1; // Prevent resizing - static LRESULT disabled[9] = { HTLEFT, HTRIGHT, HTTOP, HTBOTTOM, HTSIZE, + static LRESULT disabled[] = { HTLEFT, HTRIGHT, HTTOP, HTBOTTOM, HTSIZE, HTTOPLEFT, HTTOPRIGHT, HTBOTTOMLEFT, HTBOTTOMRIGHT }; static HBRUSH background_brush, separator_brush; // To use the system message font @@ -1190,17 +1221,15 @@ INT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa case WM_CTLCOLORSTATIC: // Change the background colour for static text and icon SetBkMode((HDC)wParam, TRANSPARENT); - if ((HWND)lParam == GetDlgItem(hDlg, IDC_NOTIFICATION_LINE)) { + if ((HWND)lParam == GetDlgItem(hDlg, IDC_NOTIFICATION_LINE)) return (INT_PTR)separator_brush; - } return (INT_PTR)background_brush; case WM_NCHITTEST: // Check coordinates to prevent resize actions loc = DefWindowProc(hDlg, message, wParam, lParam); - for (i = 0; i < 9; i++) { - if (loc == disabled[i]) { + for (i = 0; i < ARRAYSIZE(disabled); i++) { + if (loc == disabled[i]) return (INT_PTR)TRUE; - } } return (INT_PTR)FALSE; case WM_NCDESTROY: @@ -1233,23 +1262,14 @@ void ListDialog(char* title, char* message, char** items, int size) dialog_showing--; } -static struct { - HWND hTip; // Tooltip handle - HWND hCtrl; // Handle of the control the tooltip belongs to - WNDPROC original_proc; - LPWSTR wstring; -} ttlist[MAX_TOOLTIPS] = { {0} }; - -INT_PTR CALLBACK TooltipCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK TooltipCallback(HWND hControl, UINT message, WPARAM wParam, LPARAM lParam) { LPNMTTDISPINFOW lpnmtdi; int i = MAX_TOOLTIPS; // Make sure we have an original proc - for (i=0; i<MAX_TOOLTIPS; i++) { - if (ttlist[i].hTip == hDlg) break; - } - if (i == MAX_TOOLTIPS) + for (i = 0; i < MAX_TOOLTIPS && ttlist[i].hTip != hControl; i++); + if (i >= MAX_TOOLTIPS) return (INT_PTR)FALSE; switch (message) { @@ -1260,17 +1280,18 @@ INT_PTR CALLBACK TooltipCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lpnmtdi->lpszText = ttlist[i].wstring; // Don't ask me WHY we need to clear RTLREADING for RTL multiline text to look good lpnmtdi->uFlags &= ~TTF_RTLREADING; - SendMessage(hDlg, TTM_SETMAXTIPWIDTH, 0, (LPARAM)(int)(150.0f * fScale)); + SendMessage(hControl, TTM_SETMAXTIPWIDTH, 0, (LPARAM)(int)(150.0f * fScale)); return (INT_PTR)TRUE; } break; } #ifdef _DEBUG - // comctl32 causes issues if the tooltips are not being manipulated from the same thread as their parent controls - if (GetCurrentThreadId() != MainThreadId) + // comctl32 causes issues if the tooltips are not being manipulated from the same thread as + // their parent controls. See https://github.com/pbatard/rufus/issues/764. + if (GetCurrentThreadId() != GetWindowThreadProcessId(hControl, NULL)) uprintf("WARNING: Tooltip callback is being called from wrong thread"); #endif - return CallWindowProc(ttlist[i].original_proc, hDlg, message, wParam, lParam); + return CallWindowProc(ttlist[i].original_proc, hControl, message, wParam, lParam); } /* @@ -1278,22 +1299,19 @@ INT_PTR CALLBACK TooltipCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM * duration sets the duration in ms. Use -1 for default * message is an UTF-8 string */ -BOOL CreateTooltip(HWND hControl, const char* message, int duration) +BOOL CreateTooltipEx(HWND hDialog, HWND hControl, const char* message, int duration) { - TOOLINFOW toolInfo = {0}; + TOOLINFOW toolInfo = { 0 }; int i; - if ( (hControl == NULL) || (message == NULL) ) { + if ( (hControl == NULL) || (message == NULL) ) return FALSE; - } // Destroy existing tooltip if any DestroyTooltip(hControl); // Find an empty slot - for (i=0; i<MAX_TOOLTIPS; i++) { - if (ttlist[i].hTip == NULL) break; - } + for (i = 0; i < MAX_TOOLTIPS && ttlist[i].hTip != NULL; i++); if (i >= MAX_TOOLTIPS) { uprintf("Maximum number of tooltips reached (%d)\n", MAX_TOOLTIPS); return FALSE; @@ -1302,12 +1320,11 @@ BOOL CreateTooltip(HWND hControl, const char* message, int duration) // Create the tooltip window ttlist[i].hTip = CreateWindowEx(right_to_left_mode ? WS_EX_LAYOUTRTL : 0, TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hMainDialog, NULL, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hDialog, NULL, hMainInstance, NULL); - if (ttlist[i].hTip == NULL) { + if (ttlist[i].hTip == NULL) return FALSE; - } SetDarkTheme(ttlist[i].hTip); ttlist[i].hCtrl = hControl; @@ -1323,7 +1340,7 @@ BOOL CreateTooltip(HWND hControl, const char* message, int duration) // Associate the tooltip to the control toolInfo.cbSize = sizeof(toolInfo); toolInfo.hwnd = ttlist[i].hTip; // Set to the tooltip itself to ease up subclassing - toolInfo.uFlags = TTF_IDISHWND | TTF_SUBCLASS | ((right_to_left_mode)?TTF_RTLREADING:0); + toolInfo.uFlags = TTF_IDISHWND | TTF_SUBCLASS | ((right_to_left_mode) ? TTF_RTLREADING : 0); // set TTF_NOTBUTTON and TTF_CENTERTIP if it isn't a button if (!(SendMessage(hControl, WM_GETDLGCODE, 0, 0) & DLGC_BUTTON)) toolInfo.uFlags |= 0x80000000L | TTF_CENTERTIP; @@ -1335,16 +1352,30 @@ BOOL CreateTooltip(HWND hControl, const char* message, int duration) return TRUE; } -/* Destroy a tooltip. hCtrl = handle of the control the tooltip is associated with */ +/* + * "Pop" (stop displaying) the tooltip associated with a specific control. + * Does nothing if the control i NULL or doesn't have an associated tooltip. + */ +void PopTooltip(HWND hControl) +{ + int i; + if (hControl == NULL) + return; + for (i = 0; i < MAX_TOOLTIPS && ttlist[i].hCtrl != hControl; i++); + if (i < MAX_TOOLTIPS) + SendMessage(ttlist[i].hTip, TTM_POP, 0, 0); +} + +/* Destroy a tooltip. hControl = handle of the control the tooltip is associated with */ void DestroyTooltip(HWND hControl) { int i; - if (hControl == NULL) return; - for (i=0; i<MAX_TOOLTIPS; i++) { - if (ttlist[i].hCtrl == hControl) break; - } - if (i >= MAX_TOOLTIPS) return; + if (hControl == NULL) + return; + for (i = 0; i < MAX_TOOLTIPS && ttlist[i].hCtrl != hControl; i++); + if (i >= MAX_TOOLTIPS) + return; DestroyWindow(ttlist[i].hTip); safe_free(ttlist[i].wstring); ttlist[i].original_proc = NULL; @@ -1356,8 +1387,9 @@ void DestroyAllTooltips(void) { int i, j; - for (i=0, j=0; i<MAX_TOOLTIPS; i++) { - if (ttlist[i].hTip == NULL) continue; + for (i = 0, j = 0; i < MAX_TOOLTIPS; i++) { + if (ttlist[i].hTip == NULL) + continue; j++; DestroyWindow(ttlist[i].hTip); safe_free(ttlist[i].wstring); @@ -2134,7 +2166,7 @@ LPCDLGTEMPLATE GetDialogTemplate(int Dialog_ID) wBuf = (WCHAR*)rcTemplate; wBuf = &wBuf[14]; // Move to class name // Skip class name and title - for (i = 0; i<2; i++) { + for (i = 0; i < 2; i++) { if (*wBuf == 0xFFFF) wBuf = &wBuf[2]; // Ordinal else From 984c952d540cd9411dd716fa211ffe7cb1a23e26 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 25 Mar 2026 00:32:51 +0000 Subject: [PATCH 147/192] [wue] fix username field not showing for Windows 10 Windows To Go * This fixes a regression introduced in 92a8926c18ba6ab56c01422123cbe886ce9f964f with the index elements. * Also update microsoft/setup-msbuild Action to v3 (Closes #2942). --- .github/workflows/codeql.yml | 2 +- .github/workflows/coverity.yml | 2 +- .github/workflows/setup.yml | 2 +- .github/workflows/vs2022.yml | 2 +- src/rufus.c | 10 +++++----- src/rufus.rc | 10 +++++----- src/stdlg.c | 36 +++++++++++++++++----------------- 7 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 2d487b41..132541b4 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -49,7 +49,7 @@ jobs: languages: cpp - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 + uses: microsoft/setup-msbuild@v3 with: msbuild-architecture: x64 diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index ecfa023a..fa324ed3 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -45,7 +45,7 @@ jobs: run: echo "${{github.workspace}}/cov-analysis-win64/bin" >> $GITHUB_PATH - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 + uses: microsoft/setup-msbuild@v3 - name: Build with Coverity run: | diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml index 83ba9e24..e3ed3f89 100644 --- a/.github/workflows/setup.yml +++ b/.github/workflows/setup.yml @@ -22,7 +22,7 @@ jobs: uses: actions/checkout@v6 - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 + uses: microsoft/setup-msbuild@v3 with: msbuild-architecture: x64 diff --git a/.github/workflows/vs2022.yml b/.github/workflows/vs2022.yml index f19f80d3..f27cd3fb 100644 --- a/.github/workflows/vs2022.yml +++ b/.github/workflows/vs2022.yml @@ -46,7 +46,7 @@ jobs: submodules: recursive - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 + uses: microsoft/setup-msbuild@v3 with: msbuild-architecture: x64 diff --git a/src/rufus.c b/src/rufus.c index 479f39d3..19e79efc 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1624,7 +1624,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) } StrArrayAdd(&selection.choices, lmprintf(MSG_333), TRUE); StrArrayAdd(&selection.tooltips, lmprintf(MSG_364), TRUE); - selection.username_index = _log2(b); + selection.username_index = _log2(b) + 1; MAP_BIT(UNATTEND_SET_USER); StrArrayAdd(&selection.choices, lmprintf(MSG_334), TRUE); StrArrayAdd(&selection.tooltips, lmprintf(MSG_365), TRUE); @@ -1708,15 +1708,15 @@ static DWORD WINAPI BootCheckThread(LPVOID param) } StrArrayAdd(&selection.choices, lmprintf(MSG_333), TRUE); StrArrayAdd(&selection.tooltips, lmprintf(MSG_364), TRUE); - selection.username_index = _log2(b); + selection.username_index = _log2(b) + 1; MAP_BIT(UNATTEND_SET_USER); StrArrayAdd(&selection.choices, lmprintf(MSG_334), TRUE); StrArrayAdd(&selection.tooltips, lmprintf(MSG_365), TRUE); - selection.regional_index = _log2(b); + selection.regional_index = _log2(b) + 1; MAP_BIT(UNATTEND_DUPLICATE_LOCALE); StrArrayAdd(&selection.choices, lmprintf(MSG_331), TRUE); StrArrayAdd(&selection.tooltips, lmprintf(MSG_362), TRUE); - selection.privacy_index = _log2(b); + selection.privacy_index = _log2(b) + 1; MAP_BIT(UNATTEND_NO_DATA_COLLECTION); if (IS_WINDOWS_11(img_report)) { StrArrayAdd(&selection.choices, lmprintf(MSG_335), TRUE); @@ -1727,7 +1727,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) MAP_BIT(UNATTEND_QOL_ENHANCEMENTS); StrArrayAdd(&selection.choices, lmprintf(MSG_355), TRUE); StrArrayAdd(&selection.tooltips, lmprintf(MSG_371), TRUE); - selection.edition_index = _log2(b); + selection.edition_index = _log2(b) + 1; MAP_BIT(UNATTEND_SILENT_INSTALL); if (img_report.win_version.build >= 26200) { StrArrayAdd(&selection.choices, lmprintf(MSG_350), TRUE); diff --git a/src/rufus.rc b/src/rufus.rc index 5de7ea09..abaebe87 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.14.2337" +CAPTION "Rufus 4.14.2338" 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,14,2337,0 - PRODUCTVERSION 4,14,2337,0 + FILEVERSION 4,14,2338,0 + PRODUCTVERSION 4,14,2338,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.14.2337" + VALUE "FileVersion", "4.14.2338" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2337" + VALUE "ProductVersion", "4.14.2338" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index 2ba6b00f..675635e0 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -917,10 +917,10 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam SetWindowTextU(hCtrl, str); ShowWindow(hCtrl, SW_SHOW); // Compute the maximum line's width (with some extra for the username and edition fields) - if (i == selection_data.options->username_index) { + if (i == selection_data.options->username_index - 1) { static_sprintf(str, "%s __%s__", selection_data.options->choices.String[i], base_username); mw = max(mw, GetTextSize(hCtrl, str).cx); - } else if (i == selection_data.options->edition_index) { + } else if (i == selection_data.options->edition_index - 1) { mw = max(mw, GetTextSize(hCtrl, str).cx + GetComboBoxMinWidth(GetDlgItem(hDlg, IDC_SELECTION_EDITION), &edition_name)); } else { @@ -949,10 +949,10 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam // If required, set up the the username edit box if (selection_data.options->username_index > 0) { unattend_username[0] = 0; - hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->username_index); + hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->username_index - 1); GetClientRect(hCtrl, &rc); ResizeMoveCtrl(hDlg, hCtrl, 0, 0, - (rc.left - rc.right) + GetTextSize(hCtrl, selection_data.options->choices.String[selection_data.options->username_index]).cx + ddw, 0, 1.0f); + (rc.left - rc.right) + GetTextSize(hCtrl, selection_data.options->choices.String[selection_data.options->username_index - 1]).cx + ddw, 0, 1.0f); GetWindowRect(hCtrl, &rc); SetWindowPos(GetDlgItem(hDlg, IDC_SELECTION_USERNAME), hCtrl, rc.left, rc.top, 0, 0, SWP_NOMOVE | SWP_NOSIZE); hCtrl = GetDlgItem(hDlg, IDC_SELECTION_USERNAME); @@ -967,10 +967,10 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam // If required, set up the the edition combo box if (selection_data.options->edition_index > 0 && edition_name.String != NULL && edition_name.Index > 0) { - hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index); + hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index - 1); GetClientRect(hCtrl, &rc); ResizeMoveCtrl(hDlg, hCtrl, 0, 0, - (rc.left - rc.right) + GetTextSize(hCtrl, selection_data.options->choices.String[selection_data.options->edition_index]).cx + ddw, 0, 1.0f); + (rc.left - rc.right) + GetTextSize(hCtrl, selection_data.options->choices.String[selection_data.options->edition_index - 1]).cx + ddw, 0, 1.0f); GetWindowRect(hCtrl, &rc); SetWindowPos(GetDlgItem(hDlg, IDC_SELECTION_EDITION), hCtrl, rc.left, rc.top, 0, 0, SWP_NOMOVE | SWP_NOSIZE); hCtrl = GetDlgItem(hDlg, IDC_SELECTION_EDITION); @@ -1008,10 +1008,10 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam if (selection_data.options->edition_index > 0 && selection_data.options->username_index > 0 && selection_data.options->regional_index > 0 && selection_data.options->privacy_index > 0) { // Should be the same condition as the one in WM_COMMAND - BOOL enable = Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->username_index)) && - Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->regional_index)) && - Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->privacy_index)); - EnableWindow(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index), enable); + BOOL enable = Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->username_index - 1)) && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->regional_index - 1)) && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->privacy_index - 1)); + EnableWindow(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index - 1), enable); EnableWindow(GetDlgItem(hDlg, IDC_SELECTION_EDITION), enable); } @@ -1044,13 +1044,13 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam // Check if local account + regional settings + data collection checkboxes are clicked and enable/disable the silent install option if (selection_data.options->edition_index > 0 && selection_data.options->username_index > 0 && selection_data.options->edition_index > 0 && selection_data.options->regional_index > 0 && - (command - IDC_SELECTION_CHOICE1 == selection_data.options->username_index || - command - IDC_SELECTION_CHOICE1 == selection_data.options->regional_index || - command - IDC_SELECTION_CHOICE1 == selection_data.options->privacy_index)) { - BOOL enable = Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->username_index)) && - Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->regional_index)) && - Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->privacy_index)); - hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index); + (command - IDC_SELECTION_CHOICE1 == selection_data.options->username_index - 1 || + command - IDC_SELECTION_CHOICE1 == selection_data.options->regional_index - 1 || + command - IDC_SELECTION_CHOICE1 == selection_data.options->privacy_index - 1)) { + BOOL enable = Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->username_index - 1)) && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->regional_index - 1)) && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->privacy_index - 1)); + hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index - 1); if (!enable && IsWindowEnabled(hCtrl)) { silent_install_checked = (Button_GetCheck(hCtrl) == BST_CHECKED); Button_SetCheck(hCtrl, FALSE); @@ -1064,7 +1064,7 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam case IDOK: // Produce a big scary warning if the silent install option was selected if (selection_data.options->edition_index > 0 && - Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index)) && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index - 1)) && Notification(MB_YESNO | MB_ICONWARNING, APPLICATION_NAME, lmprintf(MSG_356)) != IDYES) break; for (r = 0, i = 0, m = 1; i < nDialogItems; i++, m <<= 1) From cb8b8a6b25816f063dcc8486811e994e38a93338 Mon Sep 17 00:00:00 2001 From: Itiel <itiel_yn8@walla.co.il> Date: Wed, 25 Mar 2026 16:15:03 +0000 Subject: [PATCH 148/192] [loc] update Hebrew translation to latest --- res/loc/po/he-IL.po | 150 +++++++++++++++++++++++++++++++++++++++----- res/loc/rufus.loc | 39 +++++++++--- src/rufus.rc | 10 +-- 3 files changed, 171 insertions(+), 28 deletions(-) diff --git a/res/loc/po/he-IL.po b/res/loc/po/he-IL.po index a448c58d..0929a986 100644 --- a/res/loc/po/he-IL.po +++ b/res/loc/po/he-IL.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-04-25 21:07+0300\n" -"PO-Revision-Date: 2024-04-26 01:31+0300\n" +"POT-Creation-Date: 2026-03-25 13:31+0000\n" +"PO-Revision-Date: 2026-03-25 13:32+0000\n" "Last-Translator: \n" "Language-Team: \n" "Language: he_IL\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Hebrew (עברית)\n" "X-Rufus-LCID: 0x040d\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -577,7 +577,7 @@ msgstr "" "- יש לבחור 'לא' כדי להשאיר את קובץ ה־ISO ללא שינויים\n" "אם לא ברור לך מה לעשות, כדאי לבחור באפשרות 'כן'.\n" "\n" -"הערה: הקובץ החדש יירד לספרייה בה ממוקם היישום וכל עוד ש־'%s' קיים שם, Rufus ישתמש בו באופן אוטומטי במידת הצורך." +"הערה: הקובץ החדש יורד לספרייה בה ממוקם היישום וכל עוד ש־'%s' קיים שם, Rufus ישתמש בו באופן אוטומטי במידת הצורך." #. • MSG_085 msgid "Downloading %s" @@ -771,7 +771,7 @@ msgstr "" "- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד את הקבצים האלו\n" "- יש לבחור 'לא' כדי לבטל את הפעולה\n" "\n" -"הערה: הקבצים יירדו לספרייה בה ממוקם היישום וכל עוד קבצים אלו יהיו שם, Rufus ישתמש בהם באופן אוטומטי במידת הצורך." +"הערה: הקבצים יורדו לספרייה בה ממוקם היישום וכל עוד הקבצים יהיו שם, Rufus ישתמש בהם באופן אוטומטי במידת הצורך." #. • MSG_115 msgid "Download required" @@ -798,7 +798,7 @@ msgstr "" "- יש לבחור 'לא' כדי להשתמש בגרסת ברירת המחדל מ־Rufus\n" "- יש לבחור 'ביטול' כדי לבטל את הפעולה\n" "\n" -"הערה: הקובץ יירד לספרייה בה ממוקם היישום ו־Rufus ישתמש בו באופן אוטומטי במידת הצורך. אם לא תימצא התאמה באינטרנט, Rufus ישתמש בגרסה ברירת המחדל." +"הערה: הקובץ יורד לספרייה בה ממוקם היישום ו־Rufus ישתמש בו באופן אוטומטי במידת הצורך. אם לא תימצא התאמה באינטרנט, Rufus ישתמש בגרסה ברירת המחדל." #. • MSG_117 msgid "Standard Windows installation" @@ -847,7 +847,7 @@ msgstr "ללא" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "הגדרת גודל המחיצה הקבועה עבור מדיית Live USB. הגדרת הגודל ל־0 מבטלת את המחיצה הקבועה." @@ -889,7 +889,7 @@ msgstr "יישום או תהליך אחר משתמש בכונן זה. האם ב #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" @@ -1137,7 +1137,7 @@ msgstr "קובץ תמונה שגוי עבור אפשרות האתחול שנבח #. • MSG_188 msgid "The current image doesn't match the boot option selected. Please use a different image or choose a different boot option." -msgstr "קובץ התמונה הנוכחי אינו מתאים לאפשרות האתחול שנבחרה. נא להשתמש בקובץ תמונה אחר או לבחור באפשרות אתחול אחרת.." +msgstr "קובץ התמונה הנוכחי אינו מתאים לאפשרות האתחול שנבחרה. נא להשתמש בקובץ תמונה אחר או לבחור באפשרות אתחול אחרת." #. • MSG_189 msgid "This ISO image is not compatible with the selected filesystem" @@ -1804,6 +1804,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "לא ניתן לפתוח או לקרוא את '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "החלת SkuSiPolicy.p7b בזמן ההתקנה (יש לעיין ב־KB5042562 למידע נוסף)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "שיפורי QoL (לא לכפות Copilot, OneDrive, Outlook, Fast Startup וכו')" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "מחיל התאמה אישית של Windows‏: %s" @@ -1846,7 +1854,7 @@ msgstr "הגדרת אפשרויות האזור לאותם ערכים כמו של #. • MSG_335 msgid "Disable BitLocker automatic device encryption" -msgstr "השבתת הצפנת מכשיר אוטומטית של BitLocker" +msgstr "השבתת הצפנה אוטומטית של המכשיר באמצעות BitLocker" #. • MSG_336 msgid "Persistent log" @@ -1854,17 +1862,17 @@ msgstr "יומן קבוע" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"יש להוריד קובץ נוסף ('diskcopy.dll') מ־Microsoft על מנת להתקין MS-DOS:\n" +"יש להוריד קובץ נוסף ('%s') מ־Microsoft כדי להשתמש בתכונה זו:\n" "- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד אותו\n" "- יש לבחור 'לא' כדי לבטל את הפעולה\n" "\n" -"הערה: הקובץ יירד לספרייה בה ממוקם היישום וכל עוד הקובץ יהיה שם, Rufus ישתמש בו באופן אוטומטי במידת הצורך." +"הערה: הקובץ יורד לספרייה בה ממוקם היישום וכל עוד הקובץ יהיה שם, Rufus ישתמש בו באופן אוטומטי במידת הצורך." #. • MSG_338 msgid "Revoked UEFI bootloader detected" @@ -1928,6 +1936,118 @@ msgstr "מחלץ קובצי ארכיון: %s" msgid "Use Rufus MBR" msgstr "שימוש ב־MBR של Rufus" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "שימוש במנהלי אתחול חתומים 'Windows CA 2023' (דורש מחשב יעד נתמך)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "בודק אחר ביטול תוקף של מנהל אתחול UEFI..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "בודק אחר עדכונים ל־UEFI DBX..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "עדכון DBX זמין" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus איתר גרסה מעודכנת של קובצי DBX המשמשים לבצע בדיקות ביטול תוקף של UEFI Secure Boot. האם ברצונך להוריד את העדכון הזה?\n" +"- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד את התוכן הזה\n" +"- יש לבחור 'לא' כדי לבטל פעולה זו\n" +"\n" +"הערה: הקבצים יורדו לספרייה בה ממוקם היישום וכל עוד הקבצים יהיו שם, Rufus ישתמש בהם באופן אוטומטי במידת הצורך." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "איפוס הדיסק והתקנה ⚠באופן שקט⚠:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"בחרת להשתמש באפשרות התקנת Windows באופן \"שקט\".\n" +"\n" +"זוהי אפשרות מתקדמת, המיועדת לאנשים שרוצים ליצור מדיה שלא מציגה שום בקשות או שאלות מהמשתמש במהלך התקנת Windows, ולכן *מוחקת ומאפסת ללא התראה מוקדמת* את הדיסק הראשון שמזוהה במערכת היעד. אם לא נזהרים, שימוש באפשרות זו עלול לגרום *לאובדן נתונים בלתי הפיך*!\n" +"\n" +"אם זה לא מה שרצית, נא לבחור 'לא' כדי לחזור אחורה ולבטל הסימון של האפשרות הזאת.\n" +"אחרת, אם האפשרות 'כן' תיבחר, מקובל עליך שכל האחריות לכל אובדן הנתונים יהיה *עליך בלבד*." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "מיקום קובץ תמונה לא נתמך" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"לא ניתן לבחור בקובץ תמונה הממוקם בכונן היעד, מכיוון שכונן זה עומד להימחק ולהתאפס לחלוטין. זה אותו הדבר כמו לנסות לנסר את הענף שעליו יושבים!\n" +"\n" +"נא להעביר את קובץ התמונה למיקום שונה ולנסות שוב." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "אפשר להשאיר את האפשרות הזו מופעלת בבטחה גם אם יש לך TPM או יותר זיכרון RAM, מכיוון שהיא רק עוקפת את דרישות ההתקנה ואינה מונעת מ־Windows להשתמש בכל החומרה הזמינה." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "כדי שאפשרות זו תעבוד, *חייבים* להתנתק מהרשת/אינטרנט במהלך ההתקנה!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "עונה באופן אוטומטי 'לא' לשאלות ההתקנה של Windows הנוגעות לשיתוף נתונים עם Microsoft, במקום לבקש קלט מהמשתמש." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "כדאי להשאיר אפשרות זו מופעלת, אלא אם כן מקובל עליך ש־Windows To Go יקבל גישה לדיסקים פנימיים ויבצע שדרוגי מערכת קבצים בלתי הפיכים באופן שקט." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "יצירה אוטומטית של חשבון מקומי עם שם משתמש שמצוין מראש, תוך שימוש בסיסמה ריקה שתצטרך להיות מוחלפת בהתחברות הבאה." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "שכפול הגדרות האזור מהמחשב הזה (מקלדת, אזור זמן, מטבע), במקום לבקש קלט מהמשתמש." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "לא להצפין את דיסק המערכת, אלא אם המשתמש מבקש זאת באופן מפורש." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "יש להשתמש באפשרות זו רק אם ידוע לך מהו S-Mode, ומובן לך שהמערכת שלך עשויה להישאר נעולה ב־S-Mode גם לאחר מחיקה מלאה והתקנה מחדש של Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "יש להשתמש באפשרות זו אם המערכת שבה מתוכננת ההתקנה של Windows משתמשת בתעודות Secure Boot מעודכנות לחלוטין. אם יש צורך, ניתן לנסות להשתמש ב־Mosby כדי לעדכן את המערכת." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "יש להשתמש באפשרות זו אם ברצונך לאסור את השימוש במנהלי אתחול נוספים של Windows שעשויים להיות לא בטוחים, בידיעה שיש בכך גם סיכון שמדיות סטנדרטיות של Windows לא ייטענו." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "שיפורי \"Quality of Life\": השבתת רוב התכונות הבלתי רצויות ש־Microsoft מנסה לכפות על משתמשי קצה." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "אם משתמשים באפשרות זו, יש לוודא שכל הכוננים במחשב היעד מנותקים, מלבד הכונן שבו רוצים להתקין את Windows, וכן לא להשאיר את המדיה מחוברת למחשב שאותו לא רוצים למחוק." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 0e511bdf..1ba43e5e 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -16,7 +16,7 @@ # • v4.14 "fr-FR" "French (Français)" # • v4.5 "de-DE" "German (Deutsch)" # • v4.5 "el-GR" "Greek (Ελληνικά)" -# • v4.5 "he-IL" "Hebrew (עברית)" +# • v4.14 "he-IL" "Hebrew (עברית)" # • v4.5 "hu-HU" "Hungarian (Magyar)" # • v3.22 "id-ID" "Indonesian (Bahasa Indonesia)" # • v4.5 "it-IT" "Italian (Italiano)" @@ -5752,7 +5752,7 @@ t MSG_922 "Κατεβάστε τα ISO Shell UEFI" ######################################################################### l "he-IL" "Hebrew (עברית)" 0x040d -v 4.5 +v 4.14 b "en-US" a "r" @@ -5893,7 +5893,7 @@ t MSG_080 "Rufus זיהה ש־Windows עדיין מרוקן את החוצצים t MSG_081 "קובץ לא נתמך" t MSG_082 "קובץ תמונה זה לא ניתן לאתחול, או שהוא משתמש בשיטת כיווץ או אתחול שלא נתמכת על־ידי Rufus..." t MSG_083 "האם להחליף את %s?" -t MSG_084 "נראה שקובץ ה־ISO הזה משתמש בגרסה מיושנת של '%s'.\nלפיכך, ייתכן שתפריטי האתחול לא יוצגו כראוי.\n\nRufus יכול להוריד גרסה חדשה יותר כדי לתקן בעיה זו:\n- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד את הקובץ\n- יש לבחור 'לא' כדי להשאיר את קובץ ה־ISO ללא שינויים\nאם לא ברור לך מה לעשות, כדאי לבחור באפשרות 'כן'.\n\nהערה: הקובץ החדש יירד לספרייה בה ממוקם היישום וכל עוד ש־'%s' קיים שם, Rufus ישתמש בו באופן אוטומטי במידת הצורך." +t MSG_084 "נראה שקובץ ה־ISO הזה משתמש בגרסה מיושנת של '%s'.\nלפיכך, ייתכן שתפריטי האתחול לא יוצגו כראוי.\n\nRufus יכול להוריד גרסה חדשה יותר כדי לתקן בעיה זו:\n- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד את הקובץ\n- יש לבחור 'לא' כדי להשאיר את קובץ ה־ISO ללא שינויים\nאם לא ברור לך מה לעשות, כדאי לבחור באפשרות 'כן'.\n\nהערה: הקובץ החדש יורד לספרייה בה ממוקם היישום וכל עוד ש־'%s' קיים שם, Rufus ישתמש בו באופן אוטומטי במידת הצורך." t MSG_085 "מוריד את %s" t MSG_086 "לא נבחר קובץ תמונה" t MSG_087 "עבור %s NAND" @@ -5924,9 +5924,9 @@ t MSG_110 "MS-DOS לא יכול לעלות באתחול מכונן המשתמש t MSG_111 "גודל אשכול לא תואם" t MSG_112 "אתחול אמצעי אחסון גדולים מסוג UDF עשוי לארוך זמן רב. במהירויות של USB 2.0, זמן האתחול המשוער הוא: %d:%02d, ובזמן הזה מד ההתקדמות ייראה קפוא. נא להיות סבלני!" t MSG_113 "אמצעי אחסון UDF גדול" -t MSG_114 "קובץ תמונה זה משתמש ב־Syslinux %s%s אבל יישום זה כולל רק את קובצי ההתקנה עבור Syslinux %s%s.\n\nמכיוון שגרסאות חדשות של Syslinux אינן תואמות אחת לשניה ובלתי אפשרי ש־Rufus יכלול את כולן, יש להוריד 2 קבצים נוספים מהאינטרנט ('ldlinux.sys' ו־'ldlinux.bss'):\n- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד את הקבצים האלו\n- יש לבחור 'לא' כדי לבטל את הפעולה\n\nהערה: הקבצים יירדו לספרייה בה ממוקם היישום וכל עוד קבצים אלו יהיו שם, Rufus ישתמש בהם באופן אוטומטי במידת הצורך." +t MSG_114 "קובץ תמונה זה משתמש ב־Syslinux %s%s אבל יישום זה כולל רק את קובצי ההתקנה עבור Syslinux %s%s.\n\nמכיוון שגרסאות חדשות של Syslinux אינן תואמות אחת לשניה ובלתי אפשרי ש־Rufus יכלול את כולן, יש להוריד 2 קבצים נוספים מהאינטרנט ('ldlinux.sys' ו־'ldlinux.bss'):\n- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד את הקבצים האלו\n- יש לבחור 'לא' כדי לבטל את הפעולה\n\nהערה: הקבצים יורדו לספרייה בה ממוקם היישום וכל עוד הקבצים יהיו שם, Rufus ישתמש בהם באופן אוטומטי במידת הצורך." t MSG_115 "נדרשת הורדה" -t MSG_116 "קובץ תמונה זה משתמש ב־Grub %s אבל היישום כולל רק את קובצי ההתקנה עבור Grub %s.\n\nמכיוון שגרסאות שונות של Grub עשויות שלא להיות תואמות אחת לשניה ובלתי אפשרי ש־Rufus יכלול את כולן, Rufus ינסה למצוא גרסה של קובץ ההתקנה של Grub‏ ('core.img') המתאימה לזו שבקובץ התמונה שלך:\n- יש לבחור 'כן' כדי להתחבר לאינטרנט ולנסות להוריד אותה\n- יש לבחור 'לא' כדי להשתמש בגרסת ברירת המחדל מ־Rufus\n- יש לבחור 'ביטול' כדי לבטל את הפעולה\n\nהערה: הקובץ יירד לספרייה בה ממוקם היישום ו־Rufus ישתמש בו באופן אוטומטי במידת הצורך. אם לא תימצא התאמה באינטרנט, Rufus ישתמש בגרסה ברירת המחדל." +t MSG_116 "קובץ תמונה זה משתמש ב־Grub %s אבל היישום כולל רק את קובצי ההתקנה עבור Grub %s.\n\nמכיוון שגרסאות שונות של Grub עשויות שלא להיות תואמות אחת לשניה ובלתי אפשרי ש־Rufus יכלול את כולן, Rufus ינסה למצוא גרסה של קובץ ההתקנה של Grub‏ ('core.img') המתאימה לזו שבקובץ התמונה שלך:\n- יש לבחור 'כן' כדי להתחבר לאינטרנט ולנסות להוריד אותה\n- יש לבחור 'לא' כדי להשתמש בגרסת ברירת המחדל מ־Rufus\n- יש לבחור 'ביטול' כדי לבטל את הפעולה\n\nהערה: הקובץ יורד לספרייה בה ממוקם היישום ו־Rufus ישתמש בו באופן אוטומטי במידת הצורך. אם לא תימצא התאמה באינטרנט, Rufus ישתמש בגרסה ברירת המחדל." t MSG_117 "התקנת Windows רגילה" t MSG_119 "מאפייני כונן מתקדמים" t MSG_120 "אפשרויות אתחול מתקדמות" @@ -5995,7 +5995,7 @@ t MSG_184 "לצורך יצירת סטטיסטיקת שימוש פרטית, יי t MSG_185 "תהליך העדכון:" t MSG_186 "Rufus לא מתקין או מפעיל שירותים ברקע, לכן חיפוש אחר עדכונים יתבצע רק כשהיישום הראשי פועל.\\line\nכמובן שנדרשת גישה לאינטרנט כדי לחפש עדכונים." t MSG_187 "קובץ תמונה שגוי עבור אפשרות האתחול שנבחרה" -t MSG_188 "קובץ התמונה הנוכחי אינו מתאים לאפשרות האתחול שנבחרה. נא להשתמש בקובץ תמונה אחר או לבחור באפשרות אתחול אחרת.." +t MSG_188 "קובץ התמונה הנוכחי אינו מתאים לאפשרות האתחול שנבחרה. נא להשתמש בקובץ תמונה אחר או לבחור באפשרות אתחול אחרת." t MSG_189 "קובץ ה־ISO הזה אינו מותאם למערכת הקבצים שנבחרה" t MSG_190 "זוהה כונן שאינו תואם" t MSG_191 "מעבר כתיבה" @@ -6138,6 +6138,8 @@ t MSG_319 "מצב התעלמות מסמן האתחול (Boot Marker)" t MSG_320 "מרענן את מבנה המחיצות (%s)..." t MSG_321 "קובץ התמונה שבחרת הוא מסוג ISOHybrid, אבל היוצרים שלו לא תכננו אותו בצורה שיהיה נתמך במצב העתקת קבצים מ־ISO.\nכתוצאה מכך, ייאכף שימוש במצב כתיבה כקובץ תמונה DD." t MSG_322 "לא ניתן לפתוח או לקרוא את '%s'" +t MSG_323 "החלת SkuSiPolicy.p7b בזמן ההתקנה (יש לעיין ב־KB5042562 למידע נוסף)" +t MSG_324 "שיפורי QoL (לא לכפות Copilot, OneDrive, Outlook, Fast Startup וכו')" t MSG_325 "מחיל התאמה אישית של Windows‏: %s" t MSG_326 "מחיל אפשרויות משתמש..." t MSG_327 "חוויית המשתמש של Windows" @@ -6148,9 +6150,9 @@ t MSG_331 "השבתת איסוף נתונים (דילוג על שאלות של t MSG_332 "למנוע מ־Windows To Go לגשת לדיסקים פנימיים" t MSG_333 "יצירת חשבון מקומי עם שם המשתמש:" t MSG_334 "הגדרת אפשרויות האזור לאותם ערכים כמו של משתמש זה" -t MSG_335 "השבתת הצפנת מכשיר אוטומטית של BitLocker" +t MSG_335 "השבתת הצפנה אוטומטית של המכשיר באמצעות BitLocker" t MSG_336 "יומן קבוע" -t MSG_337 "יש להוריד קובץ נוסף ('%s') ממיקרוסופט כדי להשתמש בתכונה זו:\n- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד אותו\n- יש לבחור 'לא' כדי לבטל את הפעולה\n\nהערה: הקובץ יירד לספרייה בה ממוקם היישום וכל עוד הקובץ יהיה שם, Rufus ישתמש בו באופן אוטומטי במידת הצורך." +t MSG_337 "יש להוריד קובץ נוסף ('%s') מ־Microsoft כדי להשתמש בתכונה זו:\n- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד אותו\n- יש לבחור 'לא' כדי לבטל את הפעולה\n\nהערה: הקובץ יורד לספרייה בה ממוקם היישום וכל עוד הקובץ יהיה שם, Rufus ישתמש בו באופן אוטומטי במידת הצורך." t MSG_338 "אותר מנהל אתחול UEFI שנאסר לשימוש" t MSG_339 "Rufus איתר שקובץ ה־ISO שבחרת מכיל מנהל אתחול UEFI שנאסר לשימוש ושיציג %s, כאשר Secure Boot מופעל על מערכת UEFI מעודכנת לחלוטין.\n\n- אם השגת את קובץ תמונת ISO זה ממקור מפוקפק, כדאי לשקול את האפשרות שייתכן שהוא מכיל נוזקת UEFI, ולהימנע מלאתחל ממנו.\n- אם השגת אותה ממקור מהימן, כדאי לנסות לאתר גרסה יותר עדכנית, שלא תציג אזהרה זו." t MSG_340 "מסך \"הפרת אבטחה\"" @@ -6163,6 +6165,27 @@ t MSG_346 "הגבלת ההתקנה של Windows למצב S-Mode (אינו נתמ t MSG_347 "מצב מומחה" t MSG_348 "מחלץ קובצי ארכיון: %s" t MSG_349 "שימוש ב־MBR של Rufus" +t MSG_350 "שימוש במנהלי אתחול חתומים 'Windows CA 2023' (דורש מחשב יעד נתמך)" +t MSG_351 "בודק אחר ביטול תוקף של מנהל אתחול UEFI..." +t MSG_352 "בודק אחר עדכונים ל־UEFI DBX..." +t MSG_353 "עדכון DBX זמין" +t MSG_354 "Rufus איתר גרסה מעודכנת של קובצי DBX המשמשים לבצע בדיקות ביטול תוקף של UEFI Secure Boot. האם ברצונך להוריד את העדכון הזה?\n- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד את התוכן הזה\n- יש לבחור 'לא' כדי לבטל פעולה זו\n\nהערה: הקבצים יורדו לספרייה בה ממוקם היישום וכל עוד הקבצים יהיו שם, Rufus ישתמש בהם באופן אוטומטי במידת הצורך." +t MSG_355 "איפוס הדיסק והתקנה ⚠באופן שקט⚠:" +t MSG_356 "בחרת להשתמש באפשרות התקנת Windows באופן \"שקט\".\n\nזוהי אפשרות מתקדמת, המיועדת לאנשים שרוצים ליצור מדיה שלא מציגה שום בקשות או שאלות מהמשתמש במהלך התקנת Windows, ולכן *מוחקת ומאפסת ללא התראה מוקדמת* את הדיסק הראשון שמזוהה במערכת היעד. אם לא נזהרים, שימוש באפשרות זו עלול לגרום *לאובדן נתונים בלתי הפיך*!\n\nאם זה לא מה שרצית, נא לבחור 'לא' כדי לחזור אחורה ולבטל הסימון של האפשרות הזאת.\nאחרת, אם האפשרות 'כן' תיבחר, מקובל עליך שכל האחריות לכל אובדן הנתונים יהיה *עליך בלבד*." +t MSG_358 "מיקום קובץ תמונה לא נתמך" +t MSG_359 "לא ניתן לבחור בקובץ תמונה הממוקם בכונן היעד, מכיוון שכונן זה עומד להימחק ולהתאפס לחלוטין. זה אותו הדבר כמו לנסות לנסר את הענף שעליו יושבים!\n\nנא להעביר את קובץ התמונה למיקום שונה ולנסות שוב." +t MSG_360 "אפשר להשאיר את האפשרות הזו מופעלת בבטחה גם אם יש לך TPM או יותר זיכרון RAM, מכיוון שהיא רק עוקפת את דרישות ההתקנה ואינה מונעת מ־Windows להשתמש בכל החומרה הזמינה." +t MSG_361 "כדי שאפשרות זו תעבוד, *חייבים* להתנתק מהרשת/אינטרנט במהלך ההתקנה!" +t MSG_362 "עונה באופן אוטומטי 'לא' לשאלות ההתקנה של Windows הנוגעות לשיתוף נתונים עם Microsoft, במקום לבקש קלט מהמשתמש." +t MSG_363 "כדאי להשאיר אפשרות זו מופעלת, אלא אם כן מקובל עליך ש־Windows To Go יקבל גישה לדיסקים פנימיים ויבצע שדרוגי מערכת קבצים בלתי הפיכים באופן שקט." +t MSG_364 "יצירה אוטומטית של חשבון מקומי עם שם משתמש שמצוין מראש, תוך שימוש בסיסמה ריקה שתצטרך להיות מוחלפת בהתחברות הבאה." +t MSG_365 "שכפול הגדרות האזור מהמחשב הזה (מקלדת, אזור זמן, מטבע), במקום לבקש קלט מהמשתמש." +t MSG_366 "לא להצפין את דיסק המערכת, אלא אם המשתמש מבקש זאת באופן מפורש." +t MSG_367 "יש להשתמש באפשרות זו רק אם ידוע לך מהו S-Mode, ומובן לך שהמערכת שלך עשויה להישאר נעולה ב־S-Mode גם לאחר מחיקה מלאה והתקנה מחדש של Windows." +t MSG_368 "יש להשתמש באפשרות זו אם המערכת שבה מתוכננת ההתקנה של Windows משתמשת בתעודות Secure Boot מעודכנות לחלוטין. אם יש צורך, ניתן לנסות להשתמש ב־Mosby כדי לעדכן את המערכת." +t MSG_369 "יש להשתמש באפשרות זו אם ברצונך לאסור את השימוש במנהלי אתחול נוספים של Windows שעשויים להיות לא בטוחים, בידיעה שיש בכך גם סיכון שמדיות סטנדרטיות של Windows לא ייטענו." +t MSG_370 "שיפורי \"Quality of Life\": השבתת רוב התכונות הבלתי רצויות ש־Microsoft מנסה לכפות על משתמשי קצה." +t MSG_371 "אם משתמשים באפשרות זו, יש לוודא שכל הכוננים במחשב היעד מנותקים, מלבד הכונן שבו רוצים להתקין את Windows, וכן לא להשאיר את המדיה מחוברת למחשב שאותו לא רוצים למחוק." t MSG_900 "Rufus הוא כלי המסייע באתחול ויצירת כונני הבזק מסוג USB הניתנים לאתחול, כמו דיסק און קי, כרטיסי זיכרון וכו׳." t MSG_901 "האתר הרשמי: %s" t MSG_902 "קוד מקור: %s" diff --git a/src/rufus.rc b/src/rufus.rc index abaebe87..5b521417 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.14.2338" +CAPTION "Rufus 4.14.2339" 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,14,2338,0 - PRODUCTVERSION 4,14,2338,0 + FILEVERSION 4,14,2339,0 + PRODUCTVERSION 4,14,2339,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.14.2338" + VALUE "FileVersion", "4.14.2339" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2338" + VALUE "ProductVersion", "4.14.2339" END END BLOCK "VarFileInfo" From 8799c492b339181377932e7c30867f93b4b81b08 Mon Sep 17 00:00:00 2001 From: Hugo Carvalho <hugokarvalho@hotmail.com> Date: Wed, 25 Mar 2026 16:23:47 +0000 Subject: [PATCH 149/192] [loc] update Portuguese (Portugal) translation to latest --- res/loc/po/pt-PT.po | 288 +++++++++++++++++++++++++++++++------------- res/loc/rufus.loc | 143 +++++++++++++--------- src/rufus.rc | 10 +- 3 files changed, 292 insertions(+), 149 deletions(-) diff --git a/res/loc/po/pt-PT.po b/res/loc/po/pt-PT.po index 740fe1b6..e54228cf 100644 --- a/res/loc/po/pt-PT.po +++ b/res/loc/po/pt-PT.po @@ -1,11 +1,11 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-05-20 22:00+0100\n" -"PO-Revision-Date: 2024-05-20 22:37+0100\n" +"POT-Creation-Date: 2026-03-24 11:49+0000\n" +"PO-Revision-Date: 2026-03-25 13:24+0000\n" "Last-Translator: Hugo Carvalho <hugokarvalho@hotmail.com>\n" -"Language-Team: Portuguese <hugokarvalho@hotmail.com>\n" +"Language-Team: \n" "Language: pt_PT\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -13,15 +13,15 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Portuguese Standard (Português)\n" "X-Rufus-LCID: 0x0816\n" -"X-Generator: Poedit 3.4.4\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" -msgstr "Propriedades do dispositivo" +msgstr "Propriedades da unidade" #. • IDD_DIALOG → IDS_DEVICE_TXT msgid "Device" -msgstr "Dispositivo/Disco" +msgstr "Dispositivo" #. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT msgid "Boot selection" @@ -37,7 +37,7 @@ msgstr "Opções da Imagem" #. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT msgid "Partition scheme" -msgstr "Esquema de partição" +msgstr "Esquema de partições" #. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT msgid "Target system" @@ -149,11 +149,11 @@ msgstr "Guardar" #. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY msgid "Update policy and settings" -msgstr "Configuração e política das atualizações" +msgstr "Definições e política das atualizações" #. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP msgid "Settings" -msgstr "Configurações" +msgstr "Definições" #. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT msgid "Check for updates" @@ -169,25 +169,25 @@ msgstr "Procurar" #. • IDD_NEW_VERSION → IDD_NEW_VERSION msgid "Check For Updates - Rufus" -msgstr "Procurar atualizações de Rufus" +msgstr "Procurar atualizações - Rufus" #. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT msgid "A newer version is available. Please download the latest version!" -msgstr "Nova versão disponível. Por favor, descarregue a última versão!" +msgstr "Está disponível uma versão mais recente. Descarregue a última versão!" #. • IDD_NEW_VERSION → IDC_WEBSITE msgid "Click here to go to the website" -msgstr "Clique aqui para aceder ao Site de Rufus" +msgstr "Clicar aqui para aceder à página do Rufus" #. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP msgid "Release Notes" -msgstr "Notas relativas a esta versão" +msgstr "Notas de lançamento" #. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP #. • IDD_NEW_VERSION → IDC_DOWNLOAD #. • MSG_040 msgid "Download" -msgstr "Transferir" +msgstr "Descarregar" #. • MSG_001 msgid "Other instance detected" @@ -199,7 +199,7 @@ msgid "" "Please close the first application before running another one." msgstr "" "Outra instância da aplicação Rufus está em execução.\n" -"Feche a primeira intância da aplicação antes de iniciar outra." +"Feche a primeira instância da aplicação antes de iniciar outra." #. • MSG_003 msgid "" @@ -211,7 +211,7 @@ msgstr "" #. • MSG_004 msgid "Rufus update policy" -msgstr "Atualização de Rufus" +msgstr "Política de atualização do Rufus" #. • MSG_005 msgid "Do you want to allow Rufus to check for application updates online?" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -385,7 +385,7 @@ msgstr "Erro: %s" #. • MSG_044 msgid "File download" -msgstr "Transferência de ficheiro" +msgstr "Descarga de ficheiro" #. • MSG_045 msgid "USB Storage Device (Generic)" @@ -551,7 +551,7 @@ msgstr "Tipo de imagem não suportada" #. • MSG_082 msgid "This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus..." -msgstr "Esta imagem não é inicializável ou então usa um método de arranque ou compressão não suportado." +msgstr "Esta imagem não é de arranque ou utiliza um método de arranque ou compressão que não é suportado pelo Rufus..." #. • MSG_083 msgid "Replace %s?" @@ -572,17 +572,17 @@ msgstr "" "Esta imagem ISO usa uma versão obsoleta do ficheiro '%s'.\n" "Isto pode fazer com que o menu de arranque não seja exibido corretamente.\n" "\n" -"O Rufus pode transferir uma versão mais recente para resolver este problema:\n" -"- Selecione 'Sim' para ligar-se à Internet e transferir o ficheiro\n" +"O Rufus pode descarregar uma versão mais recente para resolver este problema:\n" +"- Selecione 'Sim' para ligar-se à Internet e descarregar o ficheiro\n" "- Selecione 'Não' para deixar o ficheiro ISO tal como está\n" "Se não sabe o que fazer, é recomendado selecionar 'Sim'.\n" "\n" -"Nota: O novo ficheiro será transferido para a pasta atual, e se o ficheiro\n" +"Nota: O novo ficheiro será descarregado para a pasta atual, e se o ficheiro\n" " '%s' já existir, será substituído automaticamente." #. • MSG_085 msgid "Downloading %s" -msgstr "A transferir %s" +msgstr "A descarregar %s" #. • MSG_086 msgid "No image selected" @@ -613,7 +613,7 @@ msgstr "ISO não suportado" #. • MSG_091 msgid "When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS." -msgstr "Quando usa UEFI como tipo de destino, só são suportadas imagens ISO inicializáveis tipo EFI. Selecione uma imagem ISO inicializável do tipo EFI ou altere o tipo de destino para BIOS." +msgstr "Ao utilizar o tipo de destino UEFI, apenas são suportadas imagens ISO de arranque por EFI. Selecione uma imagem ISO de arranque por EFI ou defina o tipo de destino para BIOS." #. • MSG_092 msgid "Unsupported filesystem" @@ -625,7 +625,7 @@ msgid "" "\n" "This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions." msgstr "" -"IMPORTANTE: ESTA DRIVE CONTÉM VÁRIAS PARTIÇÕES!!\n" +"IMPORTANTE: ESTA UNIDADE CONTÉM VÁRIAS PARTIÇÕES!!\n" "\n" "Isto pode incluir partições/volumes que não estão listados ou invisíveis a partir do Windows. Caso queira prosseguir, é responsável por qualquer perda de dados nessas partições." @@ -639,7 +639,7 @@ msgstr "Imagem DD" #. • MSG_096 msgid "The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO." -msgstr "O sistema de ficheiros selecionado não pode ser usado com este tipo de ISO. Por favor, selecione um sistema de ficheiros diferente ou use um ISO diferente." +msgstr "O sistema de ficheiros selecionado não pode ser usado com este tipo de ISO. Selecione um sistema de ficheiros diferente ou use um ISO diferente." #. • MSG_097 msgid "'%s' can only be applied if the file system is NTFS." @@ -676,12 +676,12 @@ msgid "" "Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\n" "Do you want to visit the 7-zip download page?" msgstr "" -"Não é possível extrair ficheiros comprimidos WIM. A extração WIM é necessária para criar dispositivos USB inicializável tipo EFI com Windows 7 e Windows Vista. Para corrigir, instale uma versão recente do 7-Zip.\n" +"Não é possível extrair ficheiros comprimidos WIM. A extração WIM é necessária para criar dispositivos USB de arranque tipo EFI com Windows 7 e Windows Vista. Para corrigir, instale uma versão recente do 7-Zip.\n" "Quer visitar a página de transferências do 7-Zip?" #. • MSG_103 msgid "Download %s?" -msgstr "Pretende transferir %s?" +msgstr "Descarregar %s?" #. • MSG_104 #. @@ -701,11 +701,11 @@ msgstr "" "Dado que este ficheiro tem mais de 100 KB e está sempre presente nas \n" "imagens ISO %s, Rufus não o inclui na sua distribuição.\n" "\n" -"O Rufus pode transferir o ficheiro em falta:\n" -"- Selecione 'Sim' transferir o ficheiro\n" -"- Selecione 'Não' se deseja mais tarde copiar manualmente este ficheiro para a unidade\n" +"O Rufus pode descarregar o ficheiro em falta:\n" +"- Selecionar 'Sim' para descarregar o ficheiro\n" +"- Selecionar 'Não' se pretende copiar manualmente este ficheiro para a unidade mais tarde\n" "\n" -"Nota: O novo ficheiro será transferido para a pasta atual, e se o ficheiro\n" +"Nota: O novo ficheiro será descarregado para a pasta atual, e se o ficheiro\n" " '%s' já existir, será substituído automaticamente." #. • MSG_105 @@ -769,15 +769,15 @@ msgid "" msgstr "" "Esta imagem usa Syslinux %s%s mas a aplicação inclui apenas os ficheiros de instalação para Syslinux %s%s.\n" "\n" -"Como as diferentes versões de Syslinux podem não ser compatíveis entre si e não é possível o Rufus incluir todas elas, dois ficheiros adicionais devem ser transferidos ('ldlinux.sys' e 'ldlinux.bss'):\n" -"- Selecione 'Sim' para transferir os ficheiros\n" -"- Selecione 'Não' para cancelar\n" +"Como as diferentes versões de Syslinux podem não ser compatíveis entre si e não é possível o Rufus incluir todas elas, dois ficheiros adicionais devem ser descarregados ('ldlinux.sys' e 'ldlinux.bss'):\n" +"- Selecionar 'Sim' para descarregar os ficheiros\n" +"- Selecionar 'Não' para cancelar\n" "\n" -"Nota: Os ficheiros serão transferidos para a pasta atual da aplicação e serão usados automaticamente se presentes." +"Nota: Os ficheiros serão descarregados para a pasta atual da aplicação e serão usados automaticamente se presentes." #. • MSG_115 msgid "Download required" -msgstr "Transferência" +msgstr "Descarregar" #. • MSG_116 #. @@ -796,11 +796,11 @@ msgstr "" "Esta imagem usa Grub %s mas a aplicação inclui apenas os ficheiros de instalação para Grub %s.\n" "\n" "As diferentes versões de Grub podem não ser compatíveis entre si e não é possível incluir todas elas. Rufus irá tentar localizar para a versão de Grub o ficheiro de instalação ('core.img') que coincida com o da imagem:\n" -"- Selecione 'Sim' para tentar transferir\n" -"- Selecione 'Não' para usar a versão padrão do Rufus\n" -"- Selecione 'Cancelar' para abortar a operação\n" +"- Selecionar 'Sim' para tentar descarregar\n" +"- Selecionar 'Não' para usar a versão padrão do Rufus\n" +"- Selecionar 'Cancelar' para abortar a operação\n" "\n" -"Nota: O ficheiro será transferido para a pasta atual da aplicação e será usado automaticamente sempre que presente. Se não for possível encontrar online, a versão padrão será utilizada." +"Nota: O ficheiro será descarregado para a pasta atual da aplicação e será usado automaticamente sempre que presente. Se não for possível encontrar online, a versão padrão será utilizada." #. • MSG_117 msgid "Standard Windows installation" @@ -849,7 +849,7 @@ msgstr "Nenhuma" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Defina o tamanho da partição persistente para a unidade USB. Definir o tamanho como 0 desabilita a partição persistente." @@ -891,17 +891,17 @@ msgstr "Outro programa ou processo está a aceder a esta unidade. Mesmo assim, p #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Rufus detetou que está a tentar criar um disco Windows To Go com base num ISO da versão 1809.\n" +"O Rufus detetou que está a tentar criar um disco Windows To Go com base num ISO da versão 1809.\n" "\n" -"Devido a um *BUG da MICROSOFT*, este disco irá bloquear durante a inicialização do Windows (Ecrã Azul da Morte), a menos que substitua manualmente o ficheiro 'WppRecorder.sys' por um da versão 1803.\n" +"Devido a um *BUG da MICROSOFT*, este disco irá bloquear durante o arranque do Windows (Ecrã Azul da Morte), a menos que substitua manualmente o ficheiro 'WppRecorder.sys' por um da versão 1803.\n" "\n" -"Tenha em atenção também que a razão pela qual o Rufus não pode corrigir automaticamente é que 'WppRecorder.sys' é um ficheiro protegido por direitos de autor da Microsoft, portanto, não podemos incorporar legalmente uma cópia do ficheiro no Rufus..." +"Tenha em atenção também que a razão pela qual o Rufus não consegue corrigir isto automaticamente é que o 'WppRecorder.sys' é um ficheiro protegido por direitos de autor da Microsoft, portanto, não podemos incorporar legalmente uma cópia do ficheiro no Rufus..." #. • MSG_134 msgid "" @@ -943,11 +943,11 @@ msgstr "Voltar" #. • MSG_142 msgid "Please wait..." -msgstr "Por favor, aguarde..." +msgstr "Aguarde..." #. • MSG_143 msgid "Download using a browser" -msgstr "Transferir no browser" +msgstr "Descarregar no navegador" #. • MSG_144 msgid "Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it." @@ -959,15 +959,15 @@ msgstr "É necessário o PowerShell 3.0 ou posterior para executar este script." #. • MSG_146 msgid "Do you want to go online and download it?" -msgstr "Pretende ligar e fazer a transferência?" +msgstr "Ir à Internet e fazer a descarga?" #. • MSG_148 msgid "Running download script..." -msgstr "A executar script da transferência..." +msgstr "A executar script da descarga..." #. • MSG_149 msgid "Download ISO Image" -msgstr "Transferir imagem ISO" +msgstr "Descarregar imagem ISO" #. • MSG_150 msgid "Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise." @@ -1037,7 +1037,7 @@ msgstr "Método a usar para tornar a unidade inicializável" #. • MSG_165 msgid "Click to select or download an image..." -msgstr "Clique para selecionar ou transferir uma imagem.." +msgstr "Clique para selecionar ou descarregar uma imagem.." #. • MSG_166 msgid "Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)" @@ -1086,7 +1086,7 @@ msgstr "Versão %d.%d (Build %d)" #. • MSG_176 msgid "English translation: Pete Batard <mailto:pete@akeo.ie>" -msgstr "Tradução para Português Europeu: Dinis Medeiros, Fernando Baptista" +msgstr "Tradução para Português Europeu: Dinis Medeiros, Fernando Baptista, Hugo Carvalho" #. • MSG_177 msgid "Report bugs or request enhancements at:" @@ -1162,11 +1162,11 @@ msgstr "Leitura" #. • MSG_193 msgid "Downloaded %s" -msgstr "Transferido %s" +msgstr "Descarregado %s" #. • MSG_194 msgid "Could not download %s" -msgstr "Não é possível transferir %s" +msgstr "Não é possível descarregar %s" #. • MSG_195 #. @@ -1200,7 +1200,7 @@ msgstr "Esta funcionalidade não está disponível nesta plataforma." #. • MSG_201 msgid "Cancelling - Please wait..." -msgstr "A cancelar - por favor aguarde..." +msgstr "A cancelar - aguarde..." #. • MSG_202 msgid "Scanning image..." @@ -1257,7 +1257,7 @@ msgstr "Operação cancelada" #. • MSG_212 msgid "Failed" -msgstr "A operação FALHOU" +msgstr "Falha" #. • MSG_213 #. @@ -1397,17 +1397,17 @@ msgid "" "\n" "The download will be deleted. Please check the log for more details." msgstr "" -"A assinatura da atualização transferida não foi validada. Isto pode significar que o seu sistema está configurado incorretamente para validação de assinaturas ou indicar uma transferência maliciosa.\n" +"Não é possível validar a assinatura da atualização descarregada. Isto pode significar que o seu sistema não está configurado corretamente para a validação de assinaturas ou indicar que se trata de um ficheiro malicioso.\n" "\n" -"O ficheiro transferido será eliminado. Por favor, verifique o registo para mais detalhes." +"O ficheiro descarregado será eliminado. Consulte o registo para obter mais detalhes." #. • MSG_241 msgid "Downloading: %s" -msgstr "A transferir: %s" +msgstr "A descarregar: %s" #. • MSG_242 msgid "Failed to download file." -msgstr "Erro ao transferir o ficheiro." +msgstr "Erro ao descarregar o ficheiro." #. • MSG_243 msgid "Checking for Rufus updates..." @@ -1415,11 +1415,11 @@ msgstr "Procurar atualizações de Rufus..." #. • MSG_244 msgid "Updates: Unable to connect to the internet" -msgstr "Atualizações: Não é possível ligar à Internet" +msgstr "Atualizações: Não foi possível ligar à Internet" #. • MSG_245 msgid "Updates: Unable to access version data" -msgstr "Atualizações: Impossível aceder aos dados da versão" +msgstr "Atualizações: Não foi possível aceder aos dados da versão" #. • MSG_246 msgid "A new version of Rufus is available!" @@ -1597,7 +1597,7 @@ msgstr "Assinatura inválida" #. • MSG_284 msgid "The downloaded executable is missing a digital signature." -msgstr "Está em falta uma assinatura digital no executável transferido." +msgstr "Está em falta uma assinatura digital no executável descarregado." #. • MSG_285 msgid "" @@ -1605,7 +1605,7 @@ msgid "" "This is not a signature we recognize and could indicate some form of malicious activity...\n" "Are you sure you want to run this file?" msgstr "" -"O executável transferido está assinado por '%s'.\n" +"O executável descarregado está assinado por '%s'.\n" "Não é uma assinatura reconhecida e poderá indiciar algum tipo de atividade mal intencionada...\n" "Tem a certeza de que pretende executar este ficheiro?" @@ -1677,7 +1677,7 @@ msgid "" msgstr "" "O ficheiro ISO selecionado não corresponde ao tamanho declarado: faltam %s de dados!\n" "\n" -"Se obteve este ficheiro da Internet, deve tentar transferir uma nova cópia e verificar se os checksums MD5 ou SHA correspondem aos oficiais.\n" +"Se obteve este ficheiro da Internet, deve tentar descarregar uma nova cópia e verificar se os checksums MD5 ou SHA correspondem aos oficiais.\n" "\n" "Para calcular o MD5 ou SHA com Rufus, clique no botão (✓)." @@ -1691,13 +1691,13 @@ msgid "" "\n" "In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details." msgstr "" -"Não foi possível ao Rufus confirmar que a data e hora da atualização transferida é mais recente que a do executável atual.\n" +"Não foi possível ao Rufus confirmar que a data e hora da atualização descarregada é mais recente que a do executável atual.\n" "\n" -"Para evitar possíveis cenários de ataque informático, o processo de atualização foi cancelado e o ficheiro transferido será apagado. Para mais detalhes, verifique o registo." +"Para evitar possíveis cenários de ataque informático, o processo de atualização foi cancelado e o ficheiro descarregado será apagado. Para mais detalhes, verifique o registo." #. • MSG_301 msgid "Show application settings" -msgstr "Mostrar configurações da aplicação" +msgstr "Mostrar definições da aplicação" #. • MSG_302 msgid "Show information about this application" @@ -1796,6 +1796,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Não foi possível abrir ou ler '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Aplicar o ficheiro SkuSiPolicy.p7b na instalação (ver KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Melhorias na QoL (não forçar o Copilot, o OneDrive, o Outlook, o Arranque Rápido, etc.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "A aplicar personalização do Windows: %s" @@ -1846,17 +1854,17 @@ msgstr "Registo permanente (log)" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Um ficheiro adicional ('diskcopy.dll') deve ser transferido da Microsoft para instalar o MS-DOS:\n" -"- Selecione 'Sim' para se ligar à Internet e descarregá-lo\n" -"- Selecione 'Não' para cancelar a operação\n" +"Um ficheiro adicional ('%s') deve ser descarregado da Microsoft para utilizar esta funcionalidade:\n" +"- Selecionar 'Sim' para se ligar à Internet e descarregá-lo\n" +"- Selecionar 'Não' para cancelar a operação\n" "\n" -"Nota: O ficheiro será transferido para a pasta da aplicação e será reutilizado automaticamente se estiver presente." +"Nota: O ficheiro será descarregado para a pasta da aplicação e será reutilizado automaticamente se estiver presente." #. • MSG_338 msgid "Revoked UEFI bootloader detected" @@ -1900,9 +1908,9 @@ msgid "" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation" msgstr "" -"É necessário transferir alguns dados adicionais da Microsoft para usar esta funcionalidade:\n" -"- Selecione 'Sim' para se ligar à Internet e descarregá-los\n" -"- Selecione 'Não' para cancelar a operação" +"É necessário descarregar alguns dados adicionais da Microsoft para usar esta funcionalidade:\n" +"- Selecionar 'Sim' para se ligar à Internet e descarregá-los\n" +"- Selecionar 'Não' para cancelar a operação" #. • MSG_346 msgid "Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)" @@ -1920,15 +1928,127 @@ msgstr "A extrair ficheiros de arquivo: %s" msgid "Use Rufus MBR" msgstr "Usar o MBR do Rufus" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Utilizar carregadores de arranque assinados pelo 'Windows CA 2023' (requer um PC de destino compatível)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "A verificar se o carregador de arranque UEFI foi revogado..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "A verificar se existem atualizações do UEFI DBX..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "Atualização do DBX disponível" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"O Rufus encontrou uma versão atualizada dos ficheiros DBX utilizados para realizar verificações de revogação do Arranque Seguro UEFI. Pretende descarregar esta atualização?\n" +"- Selecionar 'Sim' para se ligar à Internet e descarregar este conteúdo\n" +"- Selecionar 'Não' para cancelar a operação\n" +"\n" +"Nota: Os ficheiros serão descarregados para o diretório da aplicação e serão reutilizados automaticamente, caso já existam." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠SILENCIOSAMENTE⚠ apagar o disco e instalar:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Selecionou a opção de instalação \"silenciosa\" do Windows.\n" +"\n" +"Esta é uma opção avançada, reservada a quem pretende criar um suporte que não apresente mensagens ao utilizador durante a instalação do Windows e que, por conseguinte, APAGA INCONDICIONALMENTE o primeiro disco detetado no sistema de destino. Se não tiver cuidado, a utilização desta opção pode resultar em PERDA IRREVERSÍVEL DE DADOS!\n" +"\n" +"Se não é isso que pretende, selecione 'Não' para voltar atrás e desmarcar a opção.\n" +"Caso contrário, se selecionar 'Sim', concorda que toda a responsabilidade por qualquer perda de dados será inteiramente SUA." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Localização da imagem não suportada" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Não pode utilizar uma imagem que se encontre na unidade de destino, uma vez que essa unidade vai ser completamente apagada. É o mesmo que tentar serrar o ramo em que está sentado!\n" +"\n" +"Mova a imagem para um local diferente e tente novamente." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "É seguro manter esta opção ativada, mesmo que tenha um TPM ou mais memória RAM, uma vez que esta opção apenas ignora os requisitos de configuração e não impede, de facto, que o Windows utilize todo o hardware disponível." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Para que esta opção funcione, a ligação à rede/Internet TEM de ser desligada durante a instalação!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Responda automaticamente 'não' às perguntas da instalação do Windows relacionadas com a partilha de dados com a Microsoft, em vez de solicitar a confirmação do utilizador." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Deve manter esta opção ativada, a menos que não se importe que o \"Windows To Go\" aceda aos discos internos e realize atualizações irreversíveis do sistema de ficheiros sem aviso prévio." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Criar automaticamente uma conta local com o nome de utilizador especificado, utilizando uma palavra-passe em branco que terá de ser alterada no próximo início de sessão." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Copiar as definições regionais deste computador (teclado, fuso horário, moeda), em vez de solicitar a confirmação do utilizador." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Não encriptar o disco do sistema, a menos que o utilizador o solicite explicitamente." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Utilizar esta opção apenas se souber o que é o Modo S e compreender que o seu sistema poderá ficar bloqueado no Modo S, mesmo após apagar completamente e reinstalar o Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Utilizar esta opção se o sistema no qual pretende instalar o Windows estiver a utilizar certificados de Arranque Seguro totalmente atualizados. Se necessário, pode considerar a utilização do 'Mosby' para atualizar o seu sistema." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Utilizar esta opção se pretender revogar carregadores de arranque do Windows adicionais que possam ser inseguros, mas tendo em conta que isso poderá também impedir o arranque a partir de suportes de instalação padrão do Windows." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Melhorias na \"Qualidade de Vida\": Desativa a maioria das funcionalidades indesejadas que a Microsoft está a tentar impor aos utilizadores finais." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Se utilizar esta opção, certifique-se de que desliga todos os discos do computador de destino, exceto aquele em que pretende instalar o Windows, e não deixe o suporte ligado a nenhum computador que não pretenda apagar." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application msgid "Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc." -msgstr "Rufus é um utilitário que ajuda a formatar e a criar unidades USB inicializáveis, tais como dispositivos USB/pendrives, cartões de memória, etc." +msgstr "O Rufus é um utilitário que ajuda a formatar e a criar unidades USB inicializáveis, tais como dispositivos USB/pendrives, cartões de memória, etc." #. • MSG_901 msgid "Official site: %s" -msgstr "Site oficial: %s" +msgstr "Página oficial: %s" #. • MSG_902 msgid "Source Code: %s" @@ -1953,13 +2073,13 @@ msgstr "" #. #. Keyword for "boot" will be used for search in the Windows Store msgid "Boot" -msgstr "Inicializável" +msgstr "Arranque" #. • MSG_910 #. #. This and subsequent messages will be listed in the 'Features' section of the Windows Store page msgid "Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" -msgstr "Formatar dispositivos USB, cartão de memória e drives virtuais em FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" +msgstr "Formatar dispositivos USB, cartão de memória e unidades virtuais em FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" #. • MSG_911 msgid "Create FreeDOS bootable USB drives" @@ -2003,8 +2123,8 @@ msgstr "Executar verificações de blocos inválidos, incluindo a deteção de u #. • MSG_921 msgid "Download official Microsoft Windows retail ISOs" -msgstr "Transferir ISOs oficiais do Microsoft Windows Retail" +msgstr "Descarregar ISOs oficiais do Microsoft Windows Retail" #. • MSG_922 msgid "Download UEFI Shell ISOs" -msgstr "Transferir ISOs de UEFI Shell" +msgstr "Descarregar ISOs de UEFI Shell" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 1ba43e5e..601c857e 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -16,7 +16,7 @@ # • v4.14 "fr-FR" "French (Français)" # • v4.5 "de-DE" "German (Deutsch)" # • v4.5 "el-GR" "Greek (Ελληνικά)" -# • v4.14 "he-IL" "Hebrew (עברית)" +# • v4.14 "he-IL" "Hebrew (עברית)" # • v4.5 "hu-HU" "Hungarian (Magyar)" # • v3.22 "id-ID" "Indonesian (Bahasa Indonesia)" # • v4.5 "it-IT" "Italian (Italiano)" @@ -29,7 +29,7 @@ # • v4.5 "fa-IR" "Persian (پارسی)" # • v4.5 "pl-PL" "Polish (Polski)" # • v4.5 "pt-BR" "Portuguese Brazilian (Português do Brasil)" -# • v4.5 "pt-PT" "Portuguese Standard (Português)" +# • v4.14 "pt-PT" "Portuguese Standard (Português)" # • v4.5 "ro-RO" "Romanian (Română)" # • v4.14 "ru-RU" "Russian (Русский)" # • v4.5 "sr-RS" "Serbian (Srpski)" @@ -11222,7 +11222,7 @@ t MSG_922 "Baixar ISOs do Shell UEFI" ######################################################################### l "pt-PT" "Portuguese Standard (Português)" 0x0816 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -11230,12 +11230,12 @@ t IDD_ABOUTBOX "Acerca do Rufus" t IDC_ABOUT_LICENSE "Licença" g IDD_DIALOG -t IDS_DRIVE_PROPERTIES_TXT "Propriedades do dispositivo" -t IDS_DEVICE_TXT "Dispositivo/Disco" +t IDS_DRIVE_PROPERTIES_TXT "Propriedades da unidade" +t IDS_DEVICE_TXT "Dispositivo" t IDS_BOOT_SELECTION_TXT "Tipo de arranque" t IDC_SELECT "Selecionar" t IDS_IMAGE_OPTION_TXT "Opções da Imagem" -t IDS_PARTITION_TYPE_TXT "Esquema de partição" +t IDS_PARTITION_TYPE_TXT "Esquema de partições" t IDS_TARGET_SYSTEM_TXT "Sistema do destino" t IDC_LIST_USB_HDD "Mostrar unidades USB" t IDC_OLD_BIOS_FIXES "Opções de compatibilidade para BIOS antigas" @@ -11263,12 +11263,12 @@ t IDC_LOG_SAVE "Guardar" g IDD_NEW_VERSION t IDCANCEL "Fechar" -t IDD_NEW_VERSION "Procurar atualizações de Rufus" -t IDS_NEW_VERSION_AVAIL_TXT "Nova versão disponível. Por favor, descarregue a última versão!" -t IDC_WEBSITE "Clique aqui para aceder ao Site de Rufus" -t IDS_NEW_VERSION_NOTES_GRP "Notas relativas a esta versão" -t IDS_NEW_VERSION_DOWNLOAD_GRP "Transferir" -t IDC_DOWNLOAD "Transferir" +t IDD_NEW_VERSION "Procurar atualizações - Rufus" +t IDS_NEW_VERSION_AVAIL_TXT "Está disponível uma versão mais recente. Descarregue a última versão!" +t IDC_WEBSITE "Clicar aqui para aceder à página do Rufus" +t IDS_NEW_VERSION_NOTES_GRP "Notas de lançamento" +t IDS_NEW_VERSION_DOWNLOAD_GRP "Descarregar" +t IDC_DOWNLOAD "Descarregar" g IDD_NOTIFICATION t IDC_MORE_INFO "Mais informações" @@ -11277,16 +11277,16 @@ t IDNO "Não" g IDD_UPDATE_POLICY t IDCANCEL "Fechar" -t IDD_UPDATE_POLICY "Configuração e política das atualizações" -t IDS_UPDATE_SETTINGS_GRP "Configurações" +t IDD_UPDATE_POLICY "Definições e política das atualizações" +t IDS_UPDATE_SETTINGS_GRP "Definições" t IDS_UPDATE_FREQUENCY_TXT "Procurar atualizações" t IDS_INCLUDE_BETAS_TXT "Incluir versões de teste" t IDC_CHECK_NOW "Procurar" t MSG_001 "Foi detetada outra instância da aplicação" -t MSG_002 "Outra instância da aplicação Rufus está em execução.\nFeche a primeira intância da aplicação antes de iniciar outra." +t MSG_002 "Outra instância da aplicação Rufus está em execução.\nFeche a primeira instância da aplicação antes de iniciar outra." t MSG_003 "AVISO: TODOS OS DADOS EM %s SERÃO ELIMINADOS.\nPara continuar, prima OK. Para sair da operação, prima CANCELAR." -t MSG_004 "Atualização de Rufus" +t MSG_004 "Política de atualização do Rufus" t MSG_005 "Permitir que Rufus procure atualizações na Internet?" t MSG_006 "Fechar" t MSG_007 "Cancelar" @@ -11313,11 +11313,11 @@ t MSG_036 "Imagem ISO" t MSG_037 "Aplicação" t MSG_038 "Abortar" t MSG_039 "Iniciar" -t MSG_040 "Transferir" +t MSG_040 "Descarregar" t MSG_041 "Operação cancelada pelo utilizador" t MSG_042 "Erro" t MSG_043 "Erro: %s" -t MSG_044 "Transferência de ficheiro" +t MSG_044 "Descarga de ficheiro" t MSG_045 "Dispositivo de armazenamento USB (Genérico)" t MSG_046 "%s (Disco %d) [%s]" t MSG_047 "Várias partições" @@ -11355,29 +11355,29 @@ t MSG_078 "Impossível montar o volume GUID." t MSG_079 "O dispositivo não está pronto." t MSG_080 "Rufus detetou que o Windows ainda está a limpar o buffer interno no dispositivo USB.\n\nDependendo da velocidade do dispositivo USB, esta operação pode demorar muito tempo a terminar, especialmente para ficheiros grandes.\n\nRecomendamos que deixe o Windows terminar para evitar corrompimentos; No entanto, se não quiser esperar, pode simplesmente desligar o dispositivo..." t MSG_081 "Tipo de imagem não suportada" -t MSG_082 "Esta imagem não é inicializável ou então usa um método de arranque ou compressão não suportado." +t MSG_082 "Esta imagem não é de arranque ou utiliza um método de arranque ou compressão que não é suportado pelo Rufus..." t MSG_083 "Substituir %s?" -t MSG_084 "Esta imagem ISO usa uma versão obsoleta do ficheiro '%s'.\nIsto pode fazer com que o menu de arranque não seja exibido corretamente.\n\nO Rufus pode transferir uma versão mais recente para resolver este problema:\n- Selecione 'Sim' para ligar-se à Internet e transferir o ficheiro\n- Selecione 'Não' para deixar o ficheiro ISO tal como está\nSe não sabe o que fazer, é recomendado selecionar 'Sim'.\n\nNota: O novo ficheiro será transferido para a pasta atual, e se o ficheiro\n '%s' já existir, será substituído automaticamente." -t MSG_085 "A transferir %s" +t MSG_084 "Esta imagem ISO usa uma versão obsoleta do ficheiro '%s'.\nIsto pode fazer com que o menu de arranque não seja exibido corretamente.\n\nO Rufus pode descarregar uma versão mais recente para resolver este problema:\n- Selecione 'Sim' para ligar-se à Internet e descarregar o ficheiro\n- Selecione 'Não' para deixar o ficheiro ISO tal como está\nSe não sabe o que fazer, é recomendado selecionar 'Sim'.\n\nNota: O novo ficheiro será descarregado para a pasta atual, e se o ficheiro\n '%s' já existir, será substituído automaticamente." +t MSG_085 "A descarregar %s" t MSG_086 "Nenhuma imagem selecionada" t MSG_087 "para %s TIPO" t MSG_088 "Imagem demasiado grande" t MSG_089 "A imagem é demasiado grande para o destino selecionado." t MSG_090 "ISO não suportado" -t MSG_091 "Quando usa UEFI como tipo de destino, só são suportadas imagens ISO inicializáveis tipo EFI. Selecione uma imagem ISO inicializável do tipo EFI ou altere o tipo de destino para BIOS." +t MSG_091 "Ao utilizar o tipo de destino UEFI, apenas são suportadas imagens ISO de arranque por EFI. Selecione uma imagem ISO de arranque por EFI ou defina o tipo de destino para BIOS." t MSG_092 "Sistema de ficheiros não suportado" -t MSG_093 "IMPORTANTE: ESTA DRIVE CONTÉM VÁRIAS PARTIÇÕES!!\n\nIsto pode incluir partições/volumes que não estão listados ou invisíveis a partir do Windows. Caso queira prosseguir, é responsável por qualquer perda de dados nessas partições." +t MSG_093 "IMPORTANTE: ESTA UNIDADE CONTÉM VÁRIAS PARTIÇÕES!!\n\nIsto pode incluir partições/volumes que não estão listados ou invisíveis a partir do Windows. Caso queira prosseguir, é responsável por qualquer perda de dados nessas partições." t MSG_094 "Várias partições detetadas" t MSG_095 "Imagem DD" -t MSG_096 "O sistema de ficheiros selecionado não pode ser usado com este tipo de ISO. Por favor, selecione um sistema de ficheiros diferente ou use um ISO diferente." +t MSG_096 "O sistema de ficheiros selecionado não pode ser usado com este tipo de ISO. Selecione um sistema de ficheiros diferente ou use um ISO diferente." t MSG_097 "'%s' apenas pode ser aplicado se o sistema de ficheiros for NTFS." t MSG_098 "IMPORTANTE: Está a tentar instalar 'Windows To Go', mas a drive de destino não tem o atributos 'FIXO'. Por isso o Windows provalvelmente irá parar durante o arranque, uma vez que não está preparado para trabalhar em drives que tenham o atributo de 'AMOVÍVEL'.\n\nDeseja continuar mesmo assim?\n\nNota: O atributo 'FIXO/AMOVÍVEL' é uma propriedade do hardware que apenas pode se alterado através de ferramentas do fabricante da drive. No entanto, estas ferramentas na MAIORIA dos CASOS, NUNCA são fornecidas aos utilizadores..." t MSG_099 "Limitação de sistema de ficheiros" t MSG_100 "Esta imagem ISO contém um ficheiro com mais de 4 GB, que ultrapassa o tamanho máximo permitido para o sistema de ficheiros FAT ou FAT32." t MSG_101 "O suporte para ficheiro WIM não está disponível" -t MSG_102 "Não é possível extrair ficheiros comprimidos WIM. A extração WIM é necessária para criar dispositivos USB inicializável tipo EFI com Windows 7 e Windows Vista. Para corrigir, instale uma versão recente do 7-Zip.\nQuer visitar a página de transferências do 7-Zip?" -t MSG_103 "Pretende transferir %s?" -t MSG_104 "%s ou posterior requer que esteja instalado o ficheiro '%s'.\nDado que este ficheiro tem mais de 100 KB e está sempre presente nas \nimagens ISO %s, Rufus não o inclui na sua distribuição.\n\nO Rufus pode transferir o ficheiro em falta:\n- Selecione 'Sim' transferir o ficheiro\n- Selecione 'Não' se deseja mais tarde copiar manualmente este ficheiro para a unidade\n\nNota: O novo ficheiro será transferido para a pasta atual, e se o ficheiro\n '%s' já existir, será substituído automaticamente." +t MSG_102 "Não é possível extrair ficheiros comprimidos WIM. A extração WIM é necessária para criar dispositivos USB de arranque tipo EFI com Windows 7 e Windows Vista. Para corrigir, instale uma versão recente do 7-Zip.\nQuer visitar a página de transferências do 7-Zip?" +t MSG_103 "Descarregar %s?" +t MSG_104 "%s ou posterior requer que esteja instalado o ficheiro '%s'.\nDado que este ficheiro tem mais de 100 KB e está sempre presente nas \nimagens ISO %s, Rufus não o inclui na sua distribuição.\n\nO Rufus pode descarregar o ficheiro em falta:\n- Selecionar 'Sim' para descarregar o ficheiro\n- Selecionar 'Não' se pretende copiar manualmente este ficheiro para a unidade mais tarde\n\nNota: O novo ficheiro será descarregado para a pasta atual, e se o ficheiro\n '%s' já existir, será substituído automaticamente." t MSG_105 "Se cancelar agora pode deixar o dispositivo INUTILIZADO.\nSe pretende mesmo cancelar, selecione SIM. Caso contrário, selecione NÃO." t MSG_106 "Selecione a pasta" t MSG_107 "Todos os ficheiros" @@ -11387,9 +11387,9 @@ t MSG_110 "MS-DOS não arranca de um disco com um tamanho de cluster de 64 kilob t MSG_111 "Tamanho de cluster incompatível" t MSG_112 "Formatar um volume UDF de tamanho grande pode demorar muito tempo. À velocidade de USB 2.0, o tempo estimado de formatação é de %d:%02d, durante o qual a barra de progresso parecerá \"congelada\". Por favor, seja paciente!" t MSG_113 "Volume UDF de tamanho grande" -t MSG_114 "Esta imagem usa Syslinux %s%s mas a aplicação inclui apenas os ficheiros de instalação para Syslinux %s%s.\n\nComo as diferentes versões de Syslinux podem não ser compatíveis entre si e não é possível o Rufus incluir todas elas, dois ficheiros adicionais devem ser transferidos ('ldlinux.sys' e 'ldlinux.bss'):\n- Selecione 'Sim' para transferir os ficheiros\n- Selecione 'Não' para cancelar\n\nNota: Os ficheiros serão transferidos para a pasta atual da aplicação e serão usados automaticamente se presentes." -t MSG_115 "Transferência" -t MSG_116 "Esta imagem usa Grub %s mas a aplicação inclui apenas os ficheiros de instalação para Grub %s.\n\nAs diferentes versões de Grub podem não ser compatíveis entre si e não é possível incluir todas elas. Rufus irá tentar localizar para a versão de Grub o ficheiro de instalação ('core.img') que coincida com o da imagem:\n- Selecione 'Sim' para tentar transferir\n- Selecione 'Não' para usar a versão padrão do Rufus\n- Selecione 'Cancelar' para abortar a operação\n\nNota: O ficheiro será transferido para a pasta atual da aplicação e será usado automaticamente sempre que presente. Se não for possível encontrar online, a versão padrão será utilizada." +t MSG_114 "Esta imagem usa Syslinux %s%s mas a aplicação inclui apenas os ficheiros de instalação para Syslinux %s%s.\n\nComo as diferentes versões de Syslinux podem não ser compatíveis entre si e não é possível o Rufus incluir todas elas, dois ficheiros adicionais devem ser descarregados ('ldlinux.sys' e 'ldlinux.bss'):\n- Selecionar 'Sim' para descarregar os ficheiros\n- Selecionar 'Não' para cancelar\n\nNota: Os ficheiros serão descarregados para a pasta atual da aplicação e serão usados automaticamente se presentes." +t MSG_115 "Descarregar" +t MSG_116 "Esta imagem usa Grub %s mas a aplicação inclui apenas os ficheiros de instalação para Grub %s.\n\nAs diferentes versões de Grub podem não ser compatíveis entre si e não é possível incluir todas elas. Rufus irá tentar localizar para a versão de Grub o ficheiro de instalação ('core.img') que coincida com o da imagem:\n- Selecionar 'Sim' para tentar descarregar\n- Selecionar 'Não' para usar a versão padrão do Rufus\n- Selecionar 'Cancelar' para abortar a operação\n\nNota: O ficheiro será descarregado para a pasta atual da aplicação e será usado automaticamente sempre que presente. Se não for possível encontrar online, a versão padrão será utilizada." t MSG_117 "Instalação padrão do Windows" t MSG_119 "propriedades avançadas da unidade" t MSG_120 "opções avançadas de formatação" @@ -11405,7 +11405,7 @@ t MSG_129 "Acabou de criar um disco que usa o carregador de inicialização UEFI t MSG_130 "Seleção de imagem do Windows" t MSG_131 "Este ISO contém várias imagens do Windows.\nPor favor, selecione a imagem que pretende usar para esta instalação:" t MSG_132 "Outro programa ou processo está a aceder a esta unidade. Mesmo assim, pretende formatá-la?" -t MSG_133 "Rufus detetou que está a tentar criar um disco Windows To Go com base num ISO da versão 1809.\n\nDevido a um *BUG da MICROSOFT*, este disco irá bloquear durante a inicialização do Windows (Ecrã Azul da Morte), a menos que substitua manualmente o ficheiro 'WppRecorder.sys' por um da versão 1803.\n\nTenha em atenção também que a razão pela qual o Rufus não pode corrigir automaticamente é que 'WppRecorder.sys' é um ficheiro protegido por direitos de autor da Microsoft, portanto, não podemos incorporar legalmente uma cópia do ficheiro no Rufus..." +t MSG_133 "O Rufus detetou que está a tentar criar um disco Windows To Go com base num ISO da versão 1809.\n\nDevido a um *BUG da MICROSOFT*, este disco irá bloquear durante o arranque do Windows (Ecrã Azul da Morte), a menos que substitua manualmente o ficheiro 'WppRecorder.sys' por um da versão 1803.\n\nTenha em atenção também que a razão pela qual o Rufus não consegue corrigir isto automaticamente é que o 'WppRecorder.sys' é um ficheiro protegido por direitos de autor da Microsoft, portanto, não podemos incorporar legalmente uma cópia do ficheiro no Rufus..." t MSG_134 "Uma vez que foi selecionado o MBR para o esquema de partição, o Rufus só pode criar uma partição de até 2 TB neste disco, o que deixará %s de espaço em disco indisponível.\n\nTem a certeza de que pretende continuar?" t MSG_135 "Versão" t MSG_136 "Lançamento" @@ -11414,13 +11414,13 @@ t MSG_138 "Idioma" t MSG_139 "Arquitetura" t MSG_140 "Continuar" t MSG_141 "Voltar" -t MSG_142 "Por favor, aguarde..." -t MSG_143 "Transferir no browser" +t MSG_142 "Aguarde..." +t MSG_143 "Descarregar no navegador" t MSG_144 "A transferência de ISOs do Windows não está disponível porque a Microsoft alterou o seu site para evitá-la." t MSG_145 "É necessário o PowerShell 3.0 ou posterior para executar este script." -t MSG_146 "Pretende ligar e fazer a transferência?" -t MSG_148 "A executar script da transferência..." -t MSG_149 "Transferir imagem ISO" +t MSG_146 "Ir à Internet e fazer a descarga?" +t MSG_148 "A executar script da descarga..." +t MSG_149 "Descarregar imagem ISO" t MSG_150 "Tipo de computador com o qual pretende usar esta unidade inicializável. É da sua responsabilidade determinar se o computador é do tipo BIOS ou UEFI antes de começar a criar a unidade, pois pode falhar no arranque." t MSG_151 "'UEFI-CSM' significa que o dispositivo inicializará apenas no modo de emulação da BIOS (também conhecido como 'Legacy Mode') em UEFI e não no modo UEFI nativo." t MSG_152 "'não CSM' significa que o dispositivo inicializará apenas no modo UEFI nativo, e não no modo de emulação da BIOS (também conhecido como 'Legacy Mode')." @@ -11436,7 +11436,7 @@ t MSG_161 "Verificação de erros no dispositivo com o padrão de teste" t MSG_162 "Desmarque esta opção para usar o método de formatação \"lento\"" t MSG_163 "Método a usar para criar partições" t MSG_164 "Método a usar para tornar a unidade inicializável" -t MSG_165 "Clique para selecionar ou transferir uma imagem.." +t MSG_165 "Clique para selecionar ou descarregar uma imagem.." t MSG_166 "Selecione esta opção para permitir a exibição de caracteres acentuados e atribuir um ícone para a unidade (cria um ficheiro autorun.inf)" t MSG_167 "Instalar um carregador de arranque UEFI, que irá efetuar a validação do ficheiro MD5Sum do suporte de dados" t MSG_169 "Criar uma partição extra oculta e tentar alinhar limites das partições. Isto pode melhorar a deteção de USB inicializável para as BIOS antigas." @@ -11446,7 +11446,7 @@ t MSG_172 "Assinatura do ficheiro inválida" t MSG_173 "Clique para selecionar..." t MSG_174 "Rufus - O utilitário de confiança para formatação USB" t MSG_175 "Versão %d.%d (Build %d)" -t MSG_176 "Tradução para Português Europeu: Dinis Medeiros, Fernando Baptista" +t MSG_176 "Tradução para Português Europeu: Dinis Medeiros, Fernando Baptista, Hugo Carvalho" t MSG_177 "Para reportar erros ou sugerir melhorias, visite:" t MSG_178 "Direitos de autor adicionais:" t MSG_179 "Politica de atualização:" @@ -11463,14 +11463,14 @@ t MSG_189 "Esta imagem ISO não é compatível com o sistema de ficheiros seleci t MSG_190 "Detetada unidade incompatível" t MSG_191 "Escrita" t MSG_192 "Leitura" -t MSG_193 "Transferido %s" -t MSG_194 "Não é possível transferir %s" +t MSG_193 "Descarregado %s" +t MSG_194 "Não é possível descarregar %s" t MSG_195 "A usar a versão incorporada do(s) ficheiro(s) %s" t MSG_196 "IMPORTANTE: ESTA DRIVE USA UM TAMANHO DE SECTOR NÃO CONVENCIONAL!\n\nAs drives convencionais usam o tamanho de sector de 512-byte mas esta drive usa %d-byte. Em muitos casos, isto implica que NÃO será possível fazer arranque com esta drive.\nRufus pode tentar criar uma drive inicializável, mas SEM GARANTIA que funcione." t MSG_197 "Detetado tamanho de sector não standard" t MSG_198 "'Windows To Go' apenas pode ser instalado numa drive com partição GPT se o atributo FIXO estiver selecionado. A drive atual não foi detetada como FIXO." t MSG_199 "Esta funcionalidade não está disponível nesta plataforma." -t MSG_201 "A cancelar - por favor aguarde..." +t MSG_201 "A cancelar - aguarde..." t MSG_202 "A analisar a imagem..." t MSG_203 "Ocorreu um erro ao analisar a imagem" t MSG_204 "Foi detetado um ficheiro %s obsoleto" @@ -11481,7 +11481,7 @@ t MSG_208 "%d dispositivo encontrado" t MSG_209 "%d dispositivos encontrados" t MSG_210 "PRONTO" t MSG_211 "Operação cancelada" -t MSG_212 "A operação FALHOU" +t MSG_212 "Falha" t MSG_213 "A iniciar a nova aplicação..." t MSG_214 "Erro ao iniciar a nova aplicação" t MSG_215 "%s aberto" @@ -11509,12 +11509,12 @@ t MSG_236 "Blocos com erro: A verificar com padrão aleatório" t MSG_237 "Blocos com erro: A verificar com padrão 0x%02X" t MSG_238 "A criar partições (%s)..." t MSG_239 "A apagar partições (%s)..." -t MSG_240 "A assinatura da atualização transferida não foi validada. Isto pode significar que o seu sistema está configurado incorretamente para validação de assinaturas ou indicar uma transferência maliciosa.\n\nO ficheiro transferido será eliminado. Por favor, verifique o registo para mais detalhes." -t MSG_241 "A transferir: %s" -t MSG_242 "Erro ao transferir o ficheiro." +t MSG_240 "Não é possível validar a assinatura da atualização descarregada. Isto pode significar que o seu sistema não está configurado corretamente para a validação de assinaturas ou indicar que se trata de um ficheiro malicioso.\n\nO ficheiro descarregado será eliminado. Consulte o registo para obter mais detalhes." +t MSG_241 "A descarregar: %s" +t MSG_242 "Erro ao descarregar o ficheiro." t MSG_243 "Procurar atualizações de Rufus..." -t MSG_244 "Atualizações: Não é possível ligar à Internet" -t MSG_245 "Atualizações: Impossível aceder aos dados da versão" +t MSG_244 "Atualizações: Não foi possível ligar à Internet" +t MSG_245 "Atualizações: Não foi possível aceder aos dados da versão" t MSG_246 "Está disponível uma nova versão de Rufus!" t MSG_247 "Não foi encontrada uma nova versão de Rufus" t MSG_248 "Foram apagadas as chaves de registo da aplicação" @@ -11553,8 +11553,8 @@ t MSG_280 "Disco ou imagem ISO" t MSG_281 "%s (selecionar)" t MSG_282 "Bloqueio exclusivo do dispositivo USB" t MSG_283 "Assinatura inválida" -t MSG_284 "Está em falta uma assinatura digital no executável transferido." -t MSG_285 "O executável transferido está assinado por '%s'.\nNão é uma assinatura reconhecida e poderá indiciar algum tipo de atividade mal intencionada...\nTem a certeza de que pretende executar este ficheiro?" +t MSG_284 "Está em falta uma assinatura digital no executável descarregado." +t MSG_285 "O executável descarregado está assinado por '%s'.\nNão é uma assinatura reconhecida e poderá indiciar algum tipo de atividade mal intencionada...\nTem a certeza de que pretende executar este ficheiro?" t MSG_286 "A limpar disco: %s" t MSG_287 "Detecção de unidades removíveis não-USB" t MSG_288 "Sem privilégios de administrador" @@ -11567,10 +11567,10 @@ t MSG_294 "Esta versão do Windows já não é suportada por Rufus.\nA última v t MSG_295 "Aviso: versão não oficial" t MSG_296 "Esta versão de Rufus NÃO foi desenvolvida pelo autor oficial.\n\nTem a certeza de que pretende executar?" t MSG_297 "Detetado ISO truncado" -t MSG_298 "O ficheiro ISO selecionado não corresponde ao tamanho declarado: faltam %s de dados!\n\nSe obteve este ficheiro da Internet, deve tentar transferir uma nova cópia e verificar se os checksums MD5 ou SHA correspondem aos oficiais.\n\nPara calcular o MD5 ou SHA com Rufus, clique no botão (✓)." +t MSG_298 "O ficheiro ISO selecionado não corresponde ao tamanho declarado: faltam %s de dados!\n\nSe obteve este ficheiro da Internet, deve tentar descarregar uma nova cópia e verificar se os checksums MD5 ou SHA correspondem aos oficiais.\n\nPara calcular o MD5 ou SHA com Rufus, clique no botão (✓)." t MSG_299 "Erro de validação da data/hora" -t MSG_300 "Não foi possível ao Rufus confirmar que a data e hora da atualização transferida é mais recente que a do executável atual.\n\nPara evitar possíveis cenários de ataque informático, o processo de atualização foi cancelado e o ficheiro transferido será apagado. Para mais detalhes, verifique o registo." -t MSG_301 "Mostrar configurações da aplicação" +t MSG_300 "Não foi possível ao Rufus confirmar que a data e hora da atualização descarregada é mais recente que a do executável atual.\n\nPara evitar possíveis cenários de ataque informático, o processo de atualização foi cancelado e o ficheiro descarregado será apagado. Para mais detalhes, verifique o registo." +t MSG_301 "Mostrar definições da aplicação" t MSG_302 "Mostrar informações acerca da aplicação" t MSG_303 "Mostrar registo de eventos" t MSG_304 "Criar imagem do disco do dispositivo selecionado" @@ -11592,6 +11592,8 @@ t MSG_319 "Ignorar marcador de arranque" t MSG_320 "A atualizar a estrutura da partição (%s)..." t MSG_321 "A imagem que selecionou é ISOHybrid mas os criadores não a tornaram compatível com o modo de cópia ISO/Ficheiro.\nComo resultado, será aplicado o modo de gravação da imagem DD." t MSG_322 "Não foi possível abrir ou ler '%s'" +t MSG_323 "Aplicar o ficheiro SkuSiPolicy.p7b na instalação (ver KB5042562)" +t MSG_324 "Melhorias na QoL (não forçar o Copilot, o OneDrive, o Outlook, o Arranque Rápido, etc.)" t MSG_325 "A aplicar personalização do Windows: %s" t MSG_326 "A aplicar as opções do utilizador..." t MSG_327 "Experiência do Utilizador Windows" @@ -11604,7 +11606,7 @@ t MSG_333 "Criar uma conta local com o nome de utilizador:" t MSG_334 "Definir as opções regionais com os mesmos valores deste utilizador" t MSG_335 "Desativar a encriptação automática BitLocker" t MSG_336 "Registo permanente (log)" -t MSG_337 "Um ficheiro adicional ('%s') deve ser transferido da Microsoft para utilizar esta funcionalidade:\n- Selecione 'Sim' para se ligar à Internet e descarregá-lo\n- Selecione 'Não' para cancelar a operação\n\nNota: O ficheiro será transferido para a pasta da aplicação e será reutilizado automaticamente se estiver presente." +t MSG_337 "Um ficheiro adicional ('%s') deve ser descarregado da Microsoft para utilizar esta funcionalidade:\n- Selecionar 'Sim' para se ligar à Internet e descarregá-lo\n- Selecionar 'Não' para cancelar a operação\n\nNota: O ficheiro será descarregado para a pasta da aplicação e será reutilizado automaticamente se estiver presente." t MSG_338 "Detetado carregador de arranque UEFI revogado" t MSG_339 "O Rufus detetou que a ISO que selecionou contém um carregador de arranque UEFI que foi revogado e que produzirá %s, quando o Arranque Seguro está ativado num sistema UEFI totalmente atualizado.\n\n- Se obteve esta imagem ISO de uma fonte não segura, deve considerar a possibilidade de que a mesma possa conter malware UEFI e evitar arrancar a partir dela.\n- Se a obteve de uma fonte segura, deve tentar localizar uma versão mais atualizada, que não produza este aviso." t MSG_340 "um ecrã de \"Violação de Segurança\"" @@ -11612,18 +11614,39 @@ t MSG_341 "um ecrã de recuperação do Windows (BSOD) com '%s'" t MSG_342 "Imagem VHDX comprimida" t MSG_343 "Imagem VHD não comprimida" t MSG_344 "Imagem de atualização completa" -t MSG_345 "É necessário transferir alguns dados adicionais da Microsoft para usar esta funcionalidade:\n- Selecione 'Sim' para se ligar à Internet e descarregá-los\n- Selecione 'Não' para cancelar a operação" +t MSG_345 "É necessário descarregar alguns dados adicionais da Microsoft para usar esta funcionalidade:\n- Selecionar 'Sim' para se ligar à Internet e descarregá-los\n- Selecionar 'Não' para cancelar a operação" t MSG_346 "Restringir o Windows ao modo S (INCOMPATÍVEL com o ignorar da conta online)" t MSG_347 "Modo avançado" t MSG_348 "A extrair ficheiros de arquivo: %s" t MSG_349 "Usar o MBR do Rufus" -t MSG_900 "Rufus é um utilitário que ajuda a formatar e a criar unidades USB inicializáveis, tais como dispositivos USB/pendrives, cartões de memória, etc." -t MSG_901 "Site oficial: %s" +t MSG_350 "Utilizar carregadores de arranque assinados pelo 'Windows CA 2023' (requer um PC de destino compatível)" +t MSG_351 "A verificar se o carregador de arranque UEFI foi revogado..." +t MSG_352 "A verificar se existem atualizações do UEFI DBX..." +t MSG_353 "Atualização do DBX disponível" +t MSG_354 "O Rufus encontrou uma versão atualizada dos ficheiros DBX utilizados para realizar verificações de revogação do Arranque Seguro UEFI. Pretende descarregar esta atualização?\n- Selecionar 'Sim' para se ligar à Internet e descarregar este conteúdo\n- Selecionar 'Não' para cancelar a operação\n\nNota: Os ficheiros serão descarregados para o diretório da aplicação e serão reutilizados automaticamente, caso já existam." +t MSG_355 "⚠SILENCIOSAMENTE⚠ apagar o disco e instalar:" +t MSG_356 "Selecionou a opção de instalação \"silenciosa\" do Windows.\n\nEsta é uma opção avançada, reservada a quem pretende criar um suporte que não apresente mensagens ao utilizador durante a instalação do Windows e que, por conseguinte, APAGA INCONDICIONALMENTE o primeiro disco detetado no sistema de destino. Se não tiver cuidado, a utilização desta opção pode resultar em PERDA IRREVERSÍVEL DE DADOS!\n\nSe não é isso que pretende, selecione 'Não' para voltar atrás e desmarcar a opção.\nCaso contrário, se selecionar 'Sim', concorda que toda a responsabilidade por qualquer perda de dados será inteiramente SUA." +t MSG_358 "Localização da imagem não suportada" +t MSG_359 "Não pode utilizar uma imagem que se encontre na unidade de destino, uma vez que essa unidade vai ser completamente apagada. É o mesmo que tentar serrar o ramo em que está sentado!\n\nMova a imagem para um local diferente e tente novamente." +t MSG_360 "É seguro manter esta opção ativada, mesmo que tenha um TPM ou mais memória RAM, uma vez que esta opção apenas ignora os requisitos de configuração e não impede, de facto, que o Windows utilize todo o hardware disponível." +t MSG_361 "Para que esta opção funcione, a ligação à rede/Internet TEM de ser desligada durante a instalação!" +t MSG_362 "Responda automaticamente 'não' às perguntas da instalação do Windows relacionadas com a partilha de dados com a Microsoft, em vez de solicitar a confirmação do utilizador." +t MSG_363 "Deve manter esta opção ativada, a menos que não se importe que o \"Windows To Go\" aceda aos discos internos e realize atualizações irreversíveis do sistema de ficheiros sem aviso prévio." +t MSG_364 "Criar automaticamente uma conta local com o nome de utilizador especificado, utilizando uma palavra-passe em branco que terá de ser alterada no próximo início de sessão." +t MSG_365 "Copiar as definições regionais deste computador (teclado, fuso horário, moeda), em vez de solicitar a confirmação do utilizador." +t MSG_366 "Não encriptar o disco do sistema, a menos que o utilizador o solicite explicitamente." +t MSG_367 "Utilizar esta opção apenas se souber o que é o Modo S e compreender que o seu sistema poderá ficar bloqueado no Modo S, mesmo após apagar completamente e reinstalar o Windows." +t MSG_368 "Utilizar esta opção se o sistema no qual pretende instalar o Windows estiver a utilizar certificados de Arranque Seguro totalmente atualizados. Se necessário, pode considerar a utilização do 'Mosby' para atualizar o seu sistema." +t MSG_369 "Utilizar esta opção se pretender revogar carregadores de arranque do Windows adicionais que possam ser inseguros, mas tendo em conta que isso poderá também impedir o arranque a partir de suportes de instalação padrão do Windows." +t MSG_370 "Melhorias na \"Qualidade de Vida\": Desativa a maioria das funcionalidades indesejadas que a Microsoft está a tentar impor aos utilizadores finais." +t MSG_371 "Se utilizar esta opção, certifique-se de que desliga todos os discos do computador de destino, exceto aquele em que pretende instalar o Windows, e não deixe o suporte ligado a nenhum computador que não pretenda apagar." +t MSG_900 "O Rufus é um utilitário que ajuda a formatar e a criar unidades USB inicializáveis, tais como dispositivos USB/pendrives, cartões de memória, etc." +t MSG_901 "Página oficial: %s" t MSG_902 "Código fonte: %s" t MSG_903 "Alterações: %s" t MSG_904 "Este software está licenciado sob os termos da GNU Public License (GPL) versão 3.\nConsulte https://www.gnu.org/licenses/gpl-3.0.html para mais detalhes." -t MSG_905 "Inicializável" -t MSG_910 "Formatar dispositivos USB, cartão de memória e drives virtuais em FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" +t MSG_905 "Arranque" +t MSG_910 "Formatar dispositivos USB, cartão de memória e unidades virtuais em FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" t MSG_911 "Criar unidades USB inicializáveis FreeDOS" t MSG_912 "Criar unidades inicializáveis a partir de ISOs inicializáveis (Windows, Linux, etc.)" t MSG_913 "Criar unidades inicializáveis a partir de imagens de disco inicializáveis, inclusive de imagens compactadas" @@ -11634,8 +11657,8 @@ t MSG_917 "Crie partições persistentes para Linux" t MSG_918 "Criar imagens VHD/DD do dispositivo selecionado" t MSG_919 "Calcular checksums MD5, SHA-1, SHA-256 e SHA-512 da imagem selecionada" t MSG_920 "Executar verificações de blocos inválidos, incluindo a deteção de unidades flash \"falsas\"" -t MSG_921 "Transferir ISOs oficiais do Microsoft Windows Retail" -t MSG_922 "Transferir ISOs de UEFI Shell" +t MSG_921 "Descarregar ISOs oficiais do Microsoft Windows Retail" +t MSG_922 "Descarregar ISOs de UEFI Shell" ######################################################################### l "ro-RO" "Romanian (Română)" 0x0418, 0x0818 diff --git a/src/rufus.rc b/src/rufus.rc index 5b521417..f6dedec3 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.14.2339" +CAPTION "Rufus 4.14.2340" 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,14,2339,0 - PRODUCTVERSION 4,14,2339,0 + FILEVERSION 4,14,2340,0 + PRODUCTVERSION 4,14,2340,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.14.2339" + VALUE "FileVersion", "4.14.2340" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2339" + VALUE "ProductVersion", "4.14.2340" END END BLOCK "VarFileInfo" From 265a1b85be7d53b7f0197400196e236d69055759 Mon Sep 17 00:00:00 2001 From: Mehmetali Kuran <mehmetalikuran@gmail.com> Date: Wed, 25 Mar 2026 16:27:49 +0000 Subject: [PATCH 150/192] update Turkish translation to latest --- res/loc/po/tr-TR.po | 144 ++++++++++++++++++++++++++++++++++++++++---- res/loc/rufus.loc | 31 ++++++++-- src/rufus.rc | 10 +-- 3 files changed, 164 insertions(+), 21 deletions(-) diff --git a/res/loc/po/tr-TR.po b/res/loc/po/tr-TR.po index 27dd91de..1b4d7b96 100644 --- a/res/loc/po/tr-TR.po +++ b/res/loc/po/tr-TR.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-04-28 09:05+0300\n" -"PO-Revision-Date: 2024-04-28 09:32+0300\n" +"POT-Creation-Date: 2026-03-23 20:10+0300\n" +"PO-Revision-Date: 2026-03-25 16:24+0000\n" "Last-Translator: \n" "Language-Team: \n" "Language: tr_TR\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Turkish (Türkçe)\n" "X-Rufus-LCID: 0x041F\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "TB" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "PB" @@ -846,7 +846,7 @@ msgstr "Kalıcı bölüm yok" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Canlı USB ortamı için kalıcı disk bölümünün boyutunu ayarlayın. Boyutu 0 olarak ayarlamak, kalıcı bölümü devre dışı bırakır." @@ -888,17 +888,17 @@ msgstr "Başka bir program ya da işlem bu sürücüye erişiyor. Yine de biçim #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Rufus, 1809 ISO tabanlı bir Windows To Go ortamı oluşturmaya çalıştığınızı algıladı.\n" +"Rufus, 1809 ISO'suna dayalı bir 'Windows To Go' medyası oluşturmaya çalıştığınızı algıladıi.\n" "\n" -"Bir *MICROSOFT HATASI* nedeniyle, 'WppRecorder.sys' dosyasını 1803 sürümüyle el ile değiştirmediğiniz sürece, bu medya Windows açılışında (Ölü Mavi Ekran) çökecektir.\n" +"*Bir MICROSOFT HATASI* nedeniyle, 'WppRecorder.sys' dosyasının 1803 sürümünündekini el ile değiştirmediğiniz sürece bu medya Windows önyüklemesi sırasında çökecektir (Mavi Ekran Hatası).\n" "\n" -"Ayrıca, Rufus'un bunu sizin için otomatik olarak çözememesinin nedeninin 'WppRecorder.sys' dosyasının Microsoft'un telif hakkı olan bir dosya olduğunu ve bu nedenle dosyanın yasal olarak bir kopyasını uygulamaya koyamayacağımızı unutmayın..." +"Ayrıca, Rufus'un bunu sizin için otomatik olarak düzeltememesinin nedeni, 'WppRecorder.sys' dosyasının Microsoft'un telif hakkıyla korunan bir dosyası olması ve bu nedenle dosyanın bir kopyasını uygulamaya yasal olarak yerleştiremememizdir..." #. • MSG_134 msgid "" @@ -1795,6 +1795,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "'%s' açılamıyor veya okunamıyor" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "SkuSiPolicy.p7b yükleme sırasında uygulansın (Bakınız KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "QoL(Yaşam Kalitesi) iyileştirmeleri (Copilot, OneDrive, Outlook, Hızlı Başlat vb. dayatılmasın)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Windows özelleştirmesi uygulanıyor: %s" @@ -1845,13 +1853,13 @@ msgstr "Kalıcı günlük" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"MS-DOS'u yüklemek için Microsoft'tan ek bir dosyanın ('diskcopy.dll') indirilmesi gerekir:\n" +"Bu özelliği kullanmak için Microsoft'tan ek bir dosyanın ('%s') indirilmesi gerekmektedir:\n" "- İnternete bağlanıp indirmek için 'Evet'i seçin\n" "- İşlemden vazgeçmek için 'Hayır'ı seçin\n" "\n" @@ -1919,6 +1927,118 @@ msgstr "Arşiv dosyaları çıkarılıyor: %s" msgid "Use Rufus MBR" msgstr "Rufus MBR'yi kullanın" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "'Windows CA 2023' imzalı önyükleyicileri kullanılsın (Uyumlu bir hedef bilgisayar gerektirir)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "UEFI önyükleyicisinin etkinlik durumu kontrol ediliyor..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "UEFI DBX güncellemeleri kontrol ediliyor..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "DBX güncellemesi mevcut" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus, UEFI Güvenli Önyükleme etkinlik durum kontrollerini gerçekleştirmek için kullanılan DBX dosyalarının güncellenmiş bir sürümünü buldu. Bu güncellemeyi indirmek ister misiniz?\n" +"- İnternete bağlanmak ve bu içeriği indirmek için 'Evet'i seçin\n" +"- İşlemden vazgeçmek için 'Hayır'ı seçin\n" +"\n" +"Not: Dosyalar uygulamanın dizinine indirilecek ve mevcutsa otomatik olarak yeniden kullanılacaktır." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠SESSİZCE⚠ diski silin ve yükleyin:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"\"silent\" Katılımsız Windows kurulum seçeneğini kullanmayı seçtiniz.\n" +"\n" +"Bu, Windows kurulumu sırasında kullanıcıya sorulmayan ve bu nedenle hedef sistemdeki ilk algılanan diski KOŞULSUZ OLARAK SİLEN bir ortam oluşturmak isteyenler için ayrılmış gelişmiş bir seçenektir. Dikkatli olmazsanız, bu seçeneği kullanmak GERİ DÖNÜŞÜ OLMAYAN VERİ KAYBINA neden olabilir!\n" +"\n" +"Bunu istemiyorsanız, geri dönmek ve seçeneğin işaretini kaldırmak için lütfen 'Hayır'ı seçin.\n" +"Aksi takdirde, 'Evet'i seçerseniz, herhangi bir veri kaybından doğacak tüm sorumluluğun tamamen SİZDE olacağınıı kabul etmiş olursunuz." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Desteklenmeyen yansı konumu" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Hedef sürücüde bulunan bir yansıyı, sürücü tamamen silineceğinden dolayı kullanamazsınız. Bu, oturduğunuz dalı kesmeye çalışmakla aynı şey!\n" +"\n" +"Lütfen yansıyı farklı bir konuma taşıyın ve yeniden deneyin." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "TPM veya daha fazla RAM'iniz olsa bile bu seçeneği etkin bırakmak güvenlidir, çünkü bu seçenek yalnızca kurulum gereksinimlerini atlar ve Windows'un mevcut tüm donanımı kullanmasını fiilen engellemez." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Bu seçeneğin çalışması için kurulum sırasında Ağ/Internet bağlantısının KESİLMESİ GEREKMEKTEDİR!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Windows kurulumunda Microsoft ile veri paylaşımıyla ilgili sorulara kullanıcıya sormak yerine otomatik olarak 'hayır' yanıtını verilsin." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "'Windows To Go'nun dahili disklere erişmesine ve geri döndürülemez dosya sistemi yükseltmeleri gerçekleştirmesine istemiyorsanız, bu seçeneği etkin bırakmalısınız." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Belirtilen kullanıcı adıyla otomatik olarak yerel bir hesap oluşturur; bu hesapta, bir sonraki oturum açmada değiştirilmesi gerekecek boş bir parola kullanılacaktır." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Kullanıcıdan onay istemek yerine, bu bilgisayardaki bölgesel ayarları (klavye, saat dilimi, para birimi) kopyalansın." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Kullanıcı tarafından özellikle tercih edilmediği sürece sistem diskini şifrelemeyin." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Bu seçeneği yalnızca S-Modu'nun ne olduğunu biliyorsanız ve Windows'u tamamen silip yeniden yükledikten sonra bile sisteminizin S-Modu'nda kilitli kalabileceğini anlıyorsanız kullanın." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Windows'u kurmayı planladığınız sistemde tamamen güncel Güvenli Önyükleme sertifikaları kullanılıyorsa bu seçeneği kullanın. Gerekirse, sisteminizi güncellemek için 'Mosby'yi kullanmayı düşünebilirsiniz." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Potansiyel olarak güvenli olmayan ek Windows önyükleme yükleyicilerinden vazgeçmek istiyorsanız, ancak bu işlem standart Windows medyalarının önyüklemesini de engelleme olasılığı varsa bu seçeneği kullanın." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "\"Yaşam Kalitesi\" iyileştirmeleri: Microsoft'un son kullanıcılara zorla dayatmaya çalıştığı istenmeyen özelliklerin çoğunu devre dışı bırakın." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Bu seçeneği kullanıyorsanız, lütfen Windows'u kurmak istediğiniz disk dışındaki, hedef bilgisayardaki tüm diskleri çıkarın ve silmek istemediğiniz hiçbir bilgisayara disk takılı bırakmayın." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 601c857e..9fb5a648 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -38,7 +38,7 @@ # • v4.5 "es-ES" "Spanish (Español)" # • v4.14 "sv-SE" "Swedish (Svenska)" # • v4.14 "th-TH" "Thai (ไทย)" -# • v4.5 "tr-TR" "Turkish (Türkçe)" +# • v4.14 "tr-TR" "Turkish (Türkçe)" # • v4.5 "uk-UA" "Ukrainian (Українська)" # • v4.5 "vi-VN" "Vietnamese (Tiếng Việt)" @@ -15083,7 +15083,7 @@ t MSG_922 "ดาวน์โหลดไฟล์ ISO ของ UEFI Shell" ######################################################################### l "tr-TR" "Turkish (Türkçe)" 0x041F -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -15269,7 +15269,7 @@ t MSG_129 "Az önce UEFI:NTFS önyükleyicisini kullanan bir ortam yarattınız. t MSG_130 "Windows yansı seçimi" t MSG_131 "Bu ISO birden çok Windows iyansısı içeriyor.\nLütfen bu yükleme için kullanmak istediğiniz yansıyı seçin:" t MSG_132 "Başka bir program ya da işlem bu sürücüye erişiyor. Yine de biçimlendirmek ister misiniz?" -t MSG_133 "Rufus, 1809 ISO tabanlı bir Windows To Go ortamı oluşturmaya çalıştığınızı algıladı.\n\nBir *MICROSOFT HATASI* nedeniyle, 'WppRecorder.sys' dosyasını 1803 sürümüyle el ile değiştirmediğiniz sürece, bu medya Windows açılışında (Ölü Mavi Ekran) çökecektir.\n\nAyrıca, Rufus'un bunu sizin için otomatik olarak çözememesinin nedeninin 'WppRecorder.sys' dosyasının Microsoft'un telif hakkı olan bir dosya olduğunu ve bu nedenle dosyanın yasal olarak bir kopyasını uygulamaya koyamayacağımızı unutmayın..." +t MSG_133 "Rufus, 1809 ISO'suna dayalı bir 'Windows To Go' medyası oluşturmaya çalıştığınızı algıladıi.\n\n*Bir MICROSOFT HATASI* nedeniyle, 'WppRecorder.sys' dosyasının 1803 sürümünündekini el ile değiştirmediğiniz sürece bu medya Windows önyüklemesi sırasında çökecektir (Mavi Ekran Hatası).\n\nAyrıca, Rufus'un bunu sizin için otomatik olarak düzeltememesinin nedeni, 'WppRecorder.sys' dosyasının Microsoft'un telif hakkıyla korunan bir dosyası olması ve bu nedenle dosyanın bir kopyasını uygulamaya yasal olarak yerleştiremememizdir..." t MSG_134 "MBR, bölüm şeması için seçildiğinden, Rufus bu ortam üzerinde yalnızca 2 TB'a kadar bölüm oluşturabilir ve bu da %s disk alanını kullanılamaz duruma getirir.\n\nDevam etmek istediğine emin misin?" t MSG_135 "Sürüm" t MSG_136 "Yayın" @@ -15456,6 +15456,8 @@ t MSG_319 "Önyükleme İşaretleyicisini Yoksay" t MSG_320 "Bölüm düzeni yenileniyor (%s)..." t MSG_321 "Seçtiğiniz yansı bir ISOHybrid, ancak yansı ISO/Dosya kopyalama modu ile uyumlu hale olrak oluşturulmamış.\nSonuç olarak, DD yansısı yazma modu uygulanacaktır." t MSG_322 "'%s' açılamıyor veya okunamıyor" +t MSG_323 "SkuSiPolicy.p7b yükleme sırasında uygulansın (Bakınız KB5042562)" +t MSG_324 "QoL(Yaşam Kalitesi) iyileştirmeleri (Copilot, OneDrive, Outlook, Hızlı Başlat vb. dayatılmasın)" t MSG_325 "Windows özelleştirmesi uygulanıyor: %s" t MSG_326 "Kullanıcı seçenekleri uygulanıyor..." t MSG_327 "Windows Kullanıcı Deneyimi" @@ -15468,7 +15470,7 @@ t MSG_333 "Kullanıcı adı ile yerel bir hesap oluşturun:" t MSG_334 "Bölgesel seçenekleri bu kullanıcınınkiyle aynı değerlere ayarlayın" t MSG_335 "BitLocker otomatik cihaz şifrelemesini devre dışı bırakın" t MSG_336 "Kalıcı günlük" -t MSG_337 "Bu özelliği kullanmak için Microsoft'tan ek bir dosyanın ('%s') indirilmesi gerekir:\n- İnternete bağlanıp indirmek için 'Evet'i seçin\n- İşlemden vazgeçmek için 'Hayır'ı seçin\n\nNot: Dosya uygulamanın dizinine indirilecek ve varsa otomatik olarak yeniden kullanılacaktır." +t MSG_337 "Bu özelliği kullanmak için Microsoft'tan ek bir dosyanın ('%s') indirilmesi gerekmektedir:\n- İnternete bağlanıp indirmek için 'Evet'i seçin\n- İşlemden vazgeçmek için 'Hayır'ı seçin\n\nNot: Dosya uygulamanın dizinine indirilecek ve varsa otomatik olarak yeniden kullanılacaktır." t MSG_338 "İptal edilen UEFI önyükleyici algılandı" t MSG_339 "Rufus, seçtiğiniz ISO'nun iptal edilmiş bir UEFI önyükleyici içerdiğini ve tamamen güncel bir UEFI sisteminde Güvenli Önyükleme etkinleştirildiğinde %s oluşturacağını algıladı.\n\n- Bu ISO görüntüsünü saygın olmayan bir kaynaktan aldıysanız, bunun UEFI kötü amaçlı yazılım içerme olasılığını göz önünde bulundurmalı ve bu görüntüden önyükleme yapmaktan kaçınmalısınız.\n- Eğer güvenilir bir kaynaktan aldıysanız bu uyarıyı vermeyecek daha güncel bir versiyon bulmaya çalışmalısınız." t MSG_340 "\"Güvenlik İhlali\" ekranı" @@ -15481,6 +15483,27 @@ t MSG_346 "Windows'u S-Mode ile Kısıtlayın (çevrimiçi hesap atlamayla UYUMS t MSG_347 "Uzman Modu" t MSG_348 "Arşiv dosyaları çıkarılıyor: %s" t MSG_349 "Rufus MBR'yi kullanın" +t MSG_350 "'Windows CA 2023' imzalı önyükleyicileri kullanılsın (Uyumlu bir hedef bilgisayar gerektirir)" +t MSG_351 "UEFI önyükleyicisinin etkinlik durumu kontrol ediliyor..." +t MSG_352 "UEFI DBX güncellemeleri kontrol ediliyor..." +t MSG_353 "DBX güncellemesi mevcut" +t MSG_354 "Rufus, UEFI Güvenli Önyükleme etkinlik durum kontrollerini gerçekleştirmek için kullanılan DBX dosyalarının güncellenmiş bir sürümünü buldu. Bu güncellemeyi indirmek ister misiniz?\n- İnternete bağlanmak ve bu içeriği indirmek için 'Evet'i seçin\n- İşlemden vazgeçmek için 'Hayır'ı seçin\n\nNot: Dosyalar uygulamanın dizinine indirilecek ve mevcutsa otomatik olarak yeniden kullanılacaktır." +t MSG_355 "⚠SESSİZCE⚠ diski silin ve yükleyin:" +t MSG_356 "\"silent\" Katılımsız Windows kurulum seçeneğini kullanmayı seçtiniz.\n\nBu, Windows kurulumu sırasında kullanıcıya sorulmayan ve bu nedenle hedef sistemdeki ilk algılanan diski KOŞULSUZ OLARAK SİLEN bir ortam oluşturmak isteyenler için ayrılmış gelişmiş bir seçenektir. Dikkatli olmazsanız, bu seçeneği kullanmak GERİ DÖNÜŞÜ OLMAYAN VERİ KAYBINA neden olabilir!\n\nBunu istemiyorsanız, geri dönmek ve seçeneğin işaretini kaldırmak için lütfen 'Hayır'ı seçin.\nAksi takdirde, 'Evet'i seçerseniz, herhangi bir veri kaybından doğacak tüm sorumluluğun tamamen SİZDE olacağınıı kabul etmiş olursunuz." +t MSG_358 "Desteklenmeyen yansı konumu" +t MSG_359 "Hedef sürücüde bulunan bir yansıyı, sürücü tamamen silineceğinden dolayı kullanamazsınız. Bu, oturduğunuz dalı kesmeye çalışmakla aynı şey!\n\nLütfen yansıyı farklı bir konuma taşıyın ve yeniden deneyin." +t MSG_360 "TPM veya daha fazla RAM'iniz olsa bile bu seçeneği etkin bırakmak güvenlidir, çünkü bu seçenek yalnızca kurulum gereksinimlerini atlar ve Windows'un mevcut tüm donanımı kullanmasını fiilen engellemez." +t MSG_361 "Bu seçeneğin çalışması için kurulum sırasında Ağ/Internet bağlantısının KESİLMESİ GEREKMEKTEDİR!" +t MSG_362 "Windows kurulumunda Microsoft ile veri paylaşımıyla ilgili sorulara kullanıcıya sormak yerine otomatik olarak 'hayır' yanıtını verilsin." +t MSG_363 "'Windows To Go'nun dahili disklere erişmesine ve geri döndürülemez dosya sistemi yükseltmeleri gerçekleştirmesine istemiyorsanız, bu seçeneği etkin bırakmalısınız." +t MSG_364 "Belirtilen kullanıcı adıyla otomatik olarak yerel bir hesap oluşturur; bu hesapta, bir sonraki oturum açmada değiştirilmesi gerekecek boş bir parola kullanılacaktır." +t MSG_365 "Kullanıcıdan onay istemek yerine, bu bilgisayardaki bölgesel ayarları (klavye, saat dilimi, para birimi) kopyalansın." +t MSG_366 "Kullanıcı tarafından özellikle tercih edilmediği sürece sistem diskini şifrelemeyin." +t MSG_367 "Bu seçeneği yalnızca S-Modu'nun ne olduğunu biliyorsanız ve Windows'u tamamen silip yeniden yükledikten sonra bile sisteminizin S-Modu'nda kilitli kalabileceğini anlıyorsanız kullanın." +t MSG_368 "Windows'u kurmayı planladığınız sistemde tamamen güncel Güvenli Önyükleme sertifikaları kullanılıyorsa bu seçeneği kullanın. Gerekirse, sisteminizi güncellemek için 'Mosby'yi kullanmayı düşünebilirsiniz." +t MSG_369 "Potansiyel olarak güvenli olmayan ek Windows önyükleme yükleyicilerinden vazgeçmek istiyorsanız, ancak bu işlem standart Windows medyalarının önyüklemesini de engelleme olasılığı varsa bu seçeneği kullanın." +t MSG_370 "\"Yaşam Kalitesi\" iyileştirmeleri: Microsoft'un son kullanıcılara zorla dayatmaya çalıştığı istenmeyen özelliklerin çoğunu devre dışı bırakın." +t MSG_371 "Bu seçeneği kullanıyorsanız, lütfen Windows'u kurmak istediğiniz disk dışındaki, hedef bilgisayardaki tüm diskleri çıkarın ve silmek istemediğiniz hiçbir bilgisayara disk takılı bırakmayın." t MSG_900 "Rufus, USB anahtar/bellekler, hafıza kartları vb. USB sürücüleri, biçimlendirmeye ve önyüklemeli hale getirmeye yardımcı olan bir araçtır." t MSG_901 "Resmi site: %s" t MSG_902 "Kaynak Kodu: %s" diff --git a/src/rufus.rc b/src/rufus.rc index f6dedec3..2ff0ea31 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.14.2340" +CAPTION "Rufus 4.14.2341" 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,14,2340,0 - PRODUCTVERSION 4,14,2340,0 + FILEVERSION 4,14,2341,0 + PRODUCTVERSION 4,14,2341,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.14.2340" + VALUE "FileVersion", "4.14.2341" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2340" + VALUE "ProductVersion", "4.14.2341" END END BLOCK "VarFileInfo" From 12e7486b8bf0f144c21c0ff4ddffaab5a040b9e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Csizmadia?= <gabor.csizmadia@hotmail.hu> Date: Fri, 27 Mar 2026 16:39:05 +0000 Subject: [PATCH 151/192] [loc] update Hungarian translation to latest --- res/loc/po/hu-HU.po | 146 ++++++++++++++++++++++++++++++++++++++++---- res/loc/rufus.loc | 35 +++++++++-- src/rufus.rc | 10 +-- 3 files changed, 167 insertions(+), 24 deletions(-) diff --git a/res/loc/po/hu-HU.po b/res/loc/po/hu-HU.po index 3a571227..58a58d8b 100644 --- a/res/loc/po/hu-HU.po +++ b/res/loc/po/hu-HU.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-05-09 13:01+0200\n" -"PO-Revision-Date: 2024-05-10 10:46+0100\n" +"POT-Creation-Date: 2026-03-26 23:05+0100\n" +"PO-Revision-Date: 2026-03-27 00:00+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: hu_HU\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Hungarian (Magyar)\n" "X-Rufus-LCID: 0x040e\n" -"X-Generator: Poedit 3.4.4\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -111,7 +111,7 @@ msgstr "A Rufus névjegye" #. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE msgid "License" -msgstr "Licensz" +msgstr "Licenc" #. • IDD_ABOUTBOX → IDOK msgid "OK" @@ -119,7 +119,7 @@ msgstr "" #. • IDD_LICENSE → IDD_LICENSE msgid "Rufus License" -msgstr "Rufus Licensz" +msgstr "Rufus Licenc" #. • IDD_NOTIFICATION → IDC_MORE_INFO msgid "More information" @@ -309,7 +309,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -847,7 +847,7 @@ msgstr "Kikapcsolva" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Állítsd be a tartós partíció méretét a Live USB adathordozóhoz. A méret 0-ra állításával letiltod a tartós partíciót." @@ -889,13 +889,13 @@ msgstr "Egy másik alkalmazás vagy folyamat használja ezt az eszközt. Így is #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"A Rufus észlelte, hogy egy 1809-es verziójú ISO alapján kíséreltél meg egy Windows To Go meghajtót készíteni\n" +"A Rufus észlelte, hogy egy 1809-es verziójú ISO alapján kíséreltél meg egy Windows To Go meghajtót készíteni.\n" "\n" "Egy *MICROSOFT HIBA* miatt ez a meghajtó a Windows indulása során össze fog omlani (kék halál), hacsak nem cseréled ki manuálisan a 'WppRecorder.sys' fájlt egy 1803-as verzióra.\n" "\n" @@ -1797,6 +1797,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Nem lehet megnyitni vagy olvasni ezt: '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "SkuSiPolicy.p7b alkalmazása a telepítésen (Lásd: KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "QoL fejlesztések (Ne erőltesse ezeket: Copilot, OneDrive, Outlook, Gyors rendszerindítás stb.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Windows testreszabás alkalmazása: %s" @@ -1847,17 +1855,17 @@ msgstr "Tartós naplózás" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Az MS-DOS telepítéséhez egy további fájlt ('diskcopy.dll') kell letölteni a Microsofttól:\n" +"A funkció használatához egy további fájlt ('%s') kell letölteni a Microsofttól:\n" "- Válaszd az 'Igen' gombot az internethez történő kapcsolódáshoz, és a fájl letöltéséhez\n" "- Válaszd a 'Nem' gombot a művelet megszakításához\n" "\n" -"Megjegyzés: A fájl a program mappájába lesz letöltve, és automatikusan újra lesz használva, ha létezik." +"Megjegyzés: A fájl az alkalmazás mappájába lesz letöltve, és automatikusan újra lesz használva, ha létezik." #. • MSG_338 msgid "Revoked UEFI bootloader detected" @@ -1921,6 +1929,118 @@ msgstr "Archív fájlok kibontása: %s" msgid "Use Rufus MBR" msgstr "Rufus MBR használata" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "A 'Windows CA 2023' tanúsítvánnyal aláírt rendszerbetöltők használata (Kompatibilis célszámítógép szükséges)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "UEFI rendszerbetöltő visszavonásának ellenőrzése..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "UEFI DBX frissítések keresése..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "DBX frissítés elérhető" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"A Rufus talált frissített verziót az UEFI Secure Boot visszavonási ellenőrzéséhez használt DBX fájlokból. Szeretnéd letölteni ezt a frissítést?\n" +"- Válaszd az 'Igen' gombot az internethez történő kapcsolódáshoz, és a fájlok letöltéséhez\n" +"- Válaszd a 'Nem' gombot a művelet megszakításához\n" +"\n" +"Megjegyzés: A fájlok az alkalmazás mappájába lesznek letöltve, és automatikusan újra lesznek használva, ha léteznek." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠CSENDESEN⚠ törölje a lemezt és telepítse ezt:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"A \"csendes\" Windows telepítési beállítást választottad.\n" +"\n" +"Ez egy haladó szintű beállítás azok számára, akik olyan adathordozót szeretnének készíteni, ami nem tesz fel kérdéseket a Windows telepítése során, ezért FELTÉTEL NÉLKÜL TÖRLI az elsőként észlelt lemezt a célrendszeren. Ha nem vagy elővigyázatos, ennek a beállításnak a használata VISSZAFORDÍTHATATLAN ADATVESZTÉST okozhat!\n" +"\n" +"Ha nem ezt szeretnéd, akkor válaszd a 'Nem' gombot a visszalépéshez, és töröld ezt a beállítást.\n" +"Egyébként, ha az 'Igen' gombot választod, akkor beleegyezel abba, hogy bármilyen adatvesztésért teljes mértékben TÉGED fog terhelni a felelősség." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Nem támogatott kép hely" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Nem használhatsz célmeghajtón lévő képet, mivel az a meghajtó teljesen törölve lesz. Ez ugyanaz, mint magad alatt vágni a fát!\n" +"\n" +"Kérlek, helyezd át a képet egy másik helyre, és próbáld újra." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Ezt a beállítást biztonságosan engedélyezve hagyhatod akkor is, ha rendelkezel TPM-mel vagy több RAM-mal, mivel ez a beállítás csak a telepítési követelményeket kerüli meg, és valójában nem akadályozza meg, hogy a Windows az összes elérhető hardvert használja." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Ezen funkció működéséhez a hálózatot/internetet le KELL választanod a telepítés idejére!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Automatikus 'nem' válasz a Windows telepítő azon kérdéseire, amelyek az adatok Microsoft számára történő adatmegosztással kapcsolatosak, a felhasználó megkérdezése helyett." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Hagyd bekapcsolva ezt a beállítást, kivéve, ha beleegyezel abba, hogy a 'Windows To Go' hozzáférjen a belső lemezekhez és csendben visszafordíthatatlan fájlrendszer-frissítéseket hajtson végre." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Automatikusan létrehoz egy helyi fiókot a megadott felhasználónévvel, üres jelszót használva, amit a következő belépéskor meg kell változtatni." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "A területi beállítások másolása erről a számítógépről (billentyűzet, időzóna, pénznem), a felhasználó megkérdezése helyett." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Ne titkosítsa a rendszerlemezt amíg a felhasználó kifejezetten nem kéri." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Csak akkor használd ezt a beállítást, ha tudod, mi az az S mód, és megértetted, hogy a rendszered beragadhat az S módba még a Windows teljes törlése és újratelepítése esetén is." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Használd ezt a beállítást, ha olyan rendszerre szeretnéd telepíteni a Windows-t, ami teljesen naprakész Secure Boot tanúsítványokat használ. Szükség esetén a 'Mosby' segítségével frissítheted a rendszeredet." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Használd ezt a beállítást, ha szeretnél visszavonni további, potenciálisan nem biztonságos Windows rendszerbetöltőket. Emiatt előfordulhat, hogy a sztenderd Windows adathordozó sem fog elindulni." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "\"Quality of Life\" fejlesztések: Letiltja a legtöbb nem kívánt funkciót, amit a Microsoft próbál ráerőltetni a végfelhasználókra." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Ha ezt a beállítást használod, győződj meg arról, hogy minden lemezt leválasztottál a célszámítógépről, kivéve azt az egyet, amelyikre a Windows telepítését szeretnéd, és ne hagyd az adathordozót csatlakoztatva olyan számítógéphez, amit nem akarsz törölni." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 9fb5a648..f1a854ca 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -17,7 +17,7 @@ # • v4.5 "de-DE" "German (Deutsch)" # • v4.5 "el-GR" "Greek (Ελληνικά)" # • v4.14 "he-IL" "Hebrew (עברית)" -# • v4.5 "hu-HU" "Hungarian (Magyar)" +# • v4.14 "hu-HU" "Hungarian (Magyar)" # • v3.22 "id-ID" "Indonesian (Bahasa Indonesia)" # • v4.5 "it-IT" "Italian (Italiano)" # • v4.5 "ja-JP" "Japanese (日本語)" @@ -6208,12 +6208,12 @@ t MSG_922 "הורדת קובצי ISO של מעטפת UEFI" #########################################################################v l "hu-HU" "Hungarian (Magyar)" 0x040e -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX t IDD_ABOUTBOX "A Rufus névjegye" -t IDC_ABOUT_LICENSE "Licensz" +t IDC_ABOUT_LICENSE "Licenc" g IDD_DIALOG t IDS_DRIVE_PROPERTIES_TXT "Meghajtó tulajdonságai" @@ -6239,7 +6239,7 @@ t IDC_START "Indítás" g IDD_LICENSE t IDCANCEL "Bezárás" -t IDD_LICENSE "Rufus Licensz" +t IDD_LICENSE "Rufus Licenc" g IDD_LOG t IDCANCEL "Bezárás" @@ -6395,7 +6395,7 @@ t MSG_129 "Egy UEFI:NTFS bootloaderrel rendelkező adathordozót készítettél. t MSG_130 "Windows kép kiválasztása" t MSG_131 "Ez az ISO több Windows képet is tartalmaz.\nKérlek, válaszd ki azt a képet, amelyet használni szeretnél a telepítéshez:" t MSG_132 "Egy másik alkalmazás vagy folyamat használja ezt az eszközt. Így is formázni szeretnéd?" -t MSG_133 "A Rufus észlelte, hogy egy 1809-es verziójú ISO alapján kíséreltél meg egy Windows To Go meghajtót készíteni\n\nEgy *MICROSOFT HIBA* miatt ez a meghajtó a Windows indulása során össze fog omlani (kék halál), hacsak nem cseréled ki manuálisan a 'WppRecorder.sys' fájlt egy 1803-as verzióra.\n\nVedd figyelembe azt is, hogy a Rufus azért nem tudja automatikusan kijavítani ezt, mert a 'WppRecorder.sys' a Microsoft jogvédett fájlja, ezért nem tudjuk törvényesen beágyazni a fájl másolatát az alkalmazásba..." +t MSG_133 "A Rufus észlelte, hogy egy 1809-es verziójú ISO alapján kíséreltél meg egy Windows To Go meghajtót készíteni.\n\nEgy *MICROSOFT HIBA* miatt ez a meghajtó a Windows indulása során össze fog omlani (kék halál), hacsak nem cseréled ki manuálisan a 'WppRecorder.sys' fájlt egy 1803-as verzióra.\n\nVedd figyelembe azt is, hogy a Rufus azért nem tudja automatikusan kijavítani ezt, mert a 'WppRecorder.sys' a Microsoft jogvédett fájlja, ezért nem tudjuk törvényesen beágyazni a fájl másolatát az alkalmazásba..." t MSG_134 "Mivel MBR lett kiválasztva partíciós sémaként, a Rufus legfeljebb 2 TB-os partíciót tud létrehozni ezen az adathordozón, amellyel így %s lemezterület elérhetetlenné válik.\n\nBiztosan folytatni szeretnéd?" t MSG_135 "Verzió" t MSG_136 "Kiadás" @@ -6583,6 +6583,8 @@ t MSG_319 "Boot Marker figyelmen kívül hagyása" t MSG_320 "Partíció elrendezés frissítése (%s)..." t MSG_321 "A kiválasztott képfájl egy ISOHybrid képfájl, de a készítői nem tették kompatibilissé az ISO (fájlmásolás) móddal.\nEmiatt a DD képfájl írási mód lesz kényszerítve." t MSG_322 "Nem lehet megnyitni vagy olvasni ezt: '%s'" +t MSG_323 "SkuSiPolicy.p7b alkalmazása a telepítésen (Lásd: KB5042562)" +t MSG_324 "QoL fejlesztések (Ne erőltesse ezeket: Copilot, OneDrive, Outlook, Gyors rendszerindítás stb.)" t MSG_325 "Windows testreszabás alkalmazása: %s" t MSG_326 "Felhasználói beállítások alkalmazása..." t MSG_327 "Windows Felhasználói Élmény" @@ -6595,7 +6597,7 @@ t MSG_333 "Helyi fiók létrehozása ezzel a felhasználónévvel:" t MSG_334 "A jelenlegi felhasználó területi beállításainak használata" t MSG_335 "BitLocker automatikus eszköz titkosítás letiltása" t MSG_336 "Tartós naplózás" -t MSG_337 "A funkció használatához egy további fájlt ('%s') kell letölteni a Microsofttól:\n- Válaszd az 'Igen' gombot az internethez történő kapcsolódáshoz, és a fájl letöltéséhez\n- Válaszd a 'Nem' gombot a művelet megszakításához\n\nMegjegyzés: A fájl a program mappájába lesz letöltve, és automatikusan újra lesz használva, ha létezik." +t MSG_337 "A funkció használatához egy további fájlt ('%s') kell letölteni a Microsofttól:\n- Válaszd az 'Igen' gombot az internethez történő kapcsolódáshoz, és a fájl letöltéséhez\n- Válaszd a 'Nem' gombot a művelet megszakításához\n\nMegjegyzés: A fájl az alkalmazás mappájába lesz letöltve, és automatikusan újra lesz használva, ha létezik." t MSG_338 "Visszavont UEFI rendszerbetöltő detektálva" t MSG_339 "A Rufus észlelte, hogy a kiválasztott ISO egy olyan UEFI rendszerbetöltőt tartalmaz, amelyet visszavontak, és ha a Secure Boot engedélyezve van egy teljesen naprakész UEFI rendszeren, akkor ehhez vezet: %s.\n\n- Ha ezt az ISO képet nem megbízható forrásból szerezted be, akkor számolnod kell azzal a lehetőséggel, hogy UEFI kártevőt tartalmazhat, és elkerülendő az erről történő rendszerindítás.\n- Ha megbízható forrásból szerezted be, akkor próbálj meg egy naprakészebb verziót találni, amelyre ez a figyelmeztetés nem jelenik meg." t MSG_340 "\"Security Violation\" képernyő" @@ -6608,6 +6610,27 @@ t MSG_346 "Windows korlátozása S módra (NEM KOMPATIBILIS az online Microsoft- t MSG_347 "Szakértő mód" t MSG_348 "Archív fájlok kibontása: %s" t MSG_349 "Rufus MBR használata" +t MSG_350 "A 'Windows CA 2023' tanúsítvánnyal aláírt rendszerbetöltők használata (Kompatibilis célszámítógép szükséges)" +t MSG_351 "UEFI rendszerbetöltő visszavonásának ellenőrzése..." +t MSG_352 "UEFI DBX frissítések keresése..." +t MSG_353 "DBX frissítés elérhető" +t MSG_354 "A Rufus talált frissített verziót az UEFI Secure Boot visszavonási ellenőrzéséhez használt DBX fájlokból. Szeretnéd letölteni ezt a frissítést?\n- Válaszd az 'Igen' gombot az internethez történő kapcsolódáshoz, és a fájlok letöltéséhez\n- Válaszd a 'Nem' gombot a művelet megszakításához\n\nMegjegyzés: A fájlok az alkalmazás mappájába lesznek letöltve, és automatikusan újra lesznek használva, ha léteznek." +t MSG_355 "⚠CSENDESEN⚠ törölje a lemezt és telepítse ezt:" +t MSG_356 "A \"csendes\" Windows telepítési beállítást választottad.\n\nEz egy haladó szintű beállítás azok számára, akik olyan adathordozót szeretnének készíteni, ami nem tesz fel kérdéseket a Windows telepítése során, ezért FELTÉTEL NÉLKÜL TÖRLI az elsőként észlelt lemezt a célrendszeren. Ha nem vagy elővigyázatos, ennek a beállításnak a használata VISSZAFORDÍTHATATLAN ADATVESZTÉST okozhat!\n\nHa nem ezt szeretnéd, akkor válaszd a 'Nem' gombot a visszalépéshez, és töröld ezt a beállítást.\nEgyébként, ha az 'Igen' gombot választod, akkor beleegyezel abba, hogy bármilyen adatvesztésért teljes mértékben TÉGED fog terhelni a felelősség." +t MSG_358 "Nem támogatott kép hely" +t MSG_359 "Nem használhatsz célmeghajtón lévő képet, mivel az a meghajtó teljesen törölve lesz. Ez ugyanaz, mint magad alatt vágni a fát!\n\nKérlek, helyezd át a képet egy másik helyre, és próbáld újra." +t MSG_360 "Ezt a beállítást biztonságosan engedélyezve hagyhatod akkor is, ha rendelkezel TPM-mel vagy több RAM-mal, mivel ez a beállítás csak a telepítési követelményeket kerüli meg, és valójában nem akadályozza meg, hogy a Windows az összes elérhető hardvert használja." +t MSG_361 "Ezen funkció működéséhez a hálózatot/internetet le KELL választanod a telepítés idejére!" +t MSG_362 "Automatikus 'nem' válasz a Windows telepítő azon kérdéseire, amelyek az adatok Microsoft számára történő adatmegosztással kapcsolatosak, a felhasználó megkérdezése helyett." +t MSG_363 "Hagyd bekapcsolva ezt a beállítást, kivéve, ha beleegyezel abba, hogy a 'Windows To Go' hozzáférjen a belső lemezekhez és csendben visszafordíthatatlan fájlrendszer-frissítéseket hajtson végre." +t MSG_364 "Automatikusan létrehoz egy helyi fiókot a megadott felhasználónévvel, üres jelszót használva, amit a következő belépéskor meg kell változtatni." +t MSG_365 "A területi beállítások másolása erről a számítógépről (billentyűzet, időzóna, pénznem), a felhasználó megkérdezése helyett." +t MSG_366 "Ne titkosítsa a rendszerlemezt amíg a felhasználó kifejezetten nem kéri." +t MSG_367 "Csak akkor használd ezt a beállítást, ha tudod, mi az az S mód, és megértetted, hogy a rendszered beragadhat az S módba még a Windows teljes törlése és újratelepítése esetén is." +t MSG_368 "Használd ezt a beállítást, ha olyan rendszerre szeretnéd telepíteni a Windows-t, ami teljesen naprakész Secure Boot tanúsítványokat használ. Szükség esetén a 'Mosby' segítségével frissítheted a rendszeredet." +t MSG_369 "Használd ezt a beállítást, ha szeretnél visszavonni további, potenciálisan nem biztonságos Windows rendszerbetöltőket. Emiatt előfordulhat, hogy a sztenderd Windows adathordozó sem fog elindulni." +t MSG_370 "\"Quality of Life\" fejlesztések: Letiltja a legtöbb nem kívánt funkciót, amit a Microsoft próbál ráerőltetni a végfelhasználókra." +t MSG_371 "Ha ezt a beállítást használod, győződj meg arról, hogy minden lemezt leválasztottál a célszámítógépről, kivéve azt az egyet, amelyikre a Windows telepítését szeretnéd, és ne hagyd az adathordozót csatlakoztatva olyan számítógéphez, amit nem akarsz törölni." t MSG_900 "A Rufus egy segédprogram, amellyel bootolható USB flash meghajtókat formázhat és készíthet, például USB kulcsokat/pendrive-okat, memóriakártyákat, stb." t MSG_901 "Hivatalos oldal: %s" t MSG_902 "Forráskód: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 2ff0ea31..5bbd2cb3 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.14.2341" +CAPTION "Rufus 4.14.2342" 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,14,2341,0 - PRODUCTVERSION 4,14,2341,0 + FILEVERSION 4,14,2342,0 + PRODUCTVERSION 4,14,2342,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.14.2341" + VALUE "FileVersion", "4.14.2342" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2341" + VALUE "ProductVersion", "4.14.2342" END END BLOCK "VarFileInfo" From c3e51fe2acd79588038097d505a95741bab3d5ed Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 30 Mar 2026 12:00:25 +0100 Subject: [PATCH 152/192] [loc] fix Pollock typos --- res/loc/ChangeLog.txt | 2 +- res/loc/pollock/Pollock.cs | 4 ++-- src/rufus.rc | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/res/loc/ChangeLog.txt b/res/loc/ChangeLog.txt index 3c09ba05..c0c8b585 100644 --- a/res/loc/ChangeLog.txt +++ b/res/loc/ChangeLog.txt @@ -3,7 +3,7 @@ rufus.loc since its original version. To edit a translation, please make sure to follow: https://github.com/pbatard/rufus/wiki/Localization#Editing_an_existing_translation -Or simply download https://files.akeo.ie/pollock/pollock-1.6.exe and follow its directions. +Or simply download https://files.akeo.ie/pollock/pollock-1.8.exe and follow its directions. o v4.14 (2026.??.??) // NB: I used Google translate to update the following message, so please check for accuracy! diff --git a/res/loc/pollock/Pollock.cs b/res/loc/pollock/Pollock.cs index 79814033..a532e824 100644 --- a/res/loc/pollock/Pollock.cs +++ b/res/loc/pollock/Pollock.cs @@ -1101,7 +1101,7 @@ Retry: else { var old_loc_file = $"rufus-{list[index][2]}.loc"; - Console.WriteLine($"Note: This language is at v{list[index][2]} but the English base it at v{list[0][2]}."); + Console.WriteLine($"Note: This language is at v{list[index][2]} but the English base is at v{list[0][2]}."); Console.Write($"Checking for the presence of '{old_loc_file}' to compute the differences... "); if (File.Exists(old_loc_file)) { @@ -1151,7 +1151,7 @@ Retry: // Console.WriteLine("Please press any key to launch Poedit and edit the PO file."); Console.WriteLine("*************************************************************************************"); Console.WriteLine($"* The {list[index][0]} translation file ({list[index][1]}) is now ready to be edited in Poedit."); - Console.WriteLine("* Please look for entries highlited in orange - they are the ones requiring an update."); + Console.WriteLine("* Please look for entries highlighted in orange: they are the ones requiring an update."); Console.WriteLine("*"); Console.WriteLine("* Whenever you save your changes in Poedit, a new 'rufus.loc' will be generated so"); Console.WriteLine($"* that you can test it with '{rufus_file}' in the same directory."); diff --git a/src/rufus.rc b/src/rufus.rc index 5bbd2cb3..604819af 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.14.2342" +CAPTION "Rufus 4.14.2343" 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,14,2342,0 - PRODUCTVERSION 4,14,2342,0 + FILEVERSION 4,14,2343,0 + PRODUCTVERSION 4,14,2343,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.14.2342" + VALUE "FileVersion", "4.14.2343" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2342" + VALUE "ProductVersion", "4.14.2343" END END BLOCK "VarFileInfo" From 4d39ef99e28c27dadafc3b2d4ae26748819f0d92 Mon Sep 17 00:00:00 2001 From: Ben Gamer <boiben609@gmail.com> Date: Mon, 30 Mar 2026 12:27:39 +0100 Subject: [PATCH 153/192] [loc] update Croatian to latest --- res/loc/po/hr-HR.po | 148 +++++++++++++++++++++++++++++++++++++++----- res/loc/rufus.loc | 31 ++++++++-- src/rufus.rc | 10 +-- 3 files changed, 166 insertions(+), 23 deletions(-) diff --git a/res/loc/po/hr-HR.po b/res/loc/po/hr-HR.po index 66124d36..eaac4486 100644 --- a/res/loc/po/hr-HR.po +++ b/res/loc/po/hr-HR.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-05-09 18:57+0200\n" -"PO-Revision-Date: 2024-05-09 19:30+0200\n" +"POT-Creation-Date: 2026-03-29 14:57+0200\n" +"PO-Revision-Date: 2026-03-29 15:44+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: hr_HR\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Croatian (Hrvatski)\n" "X-Rufus-LCID: 0x041a, 0x081a, 0x101a\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -306,7 +306,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -844,7 +844,7 @@ msgstr "Bez trajne particije" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Zadaj veličinu trajne particije za \"live\" USB medij. Ako je zadana veličina 0, isključuje se trajna particija." @@ -886,17 +886,17 @@ msgstr "Drugi program ili proces pristupa pogonu. Da li ipak želiš formatirati #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Rufus je otkrio da pokušavate kreirati \"Windows To Go\" medij baziran na verziji 1809 ISO.\n" +"Rufus je otkrio da pokušavate stvoriti 'Windows To Go' medij na temelju 1809 ISO datoteke.\n" "\n" -"Zbog *MICROSOFT BUG-a*, doći će do fatalne greške kod podizanja Windows-a (Blue Screen Of Death), osim ako ne zamijenite datoteku 'WppRecorder.sys' s verzijom 1803.\n" +"Zbog *MICROSOFTOVE GREŠKE*, ovaj medij će se srušiti tijekom pokretanja sustava Windows (BSOD), osim ako ručno zamijenite datoteku 'WppRecorder.sys' s verzijom 1803.\n" "\n" -"Rufus nije u mogućnosti ispraviti problem jer datoteka 'WppRecorder.sys' podliježe Microsoft \"copyright-u\", tako da bi to bilo ilegalno." +"Rufus ne može automatski popraviti ovo za vas jer je 'WppRecorder.sys' datoteka zaštićena autorskim pravima tvrtke Microsoft, pa ne možemo legalno ugraditi kopiju datoteke u aplikaciju..." #. • MSG_134 msgid "" @@ -1793,6 +1793,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Nije moguće otvoriti ili pročitati '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Primijenite SkuSiPolicy.p7b prilikom instalacije (vidi KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "QoL poboljšanja (Nemojte forsirati Copilot, OneDrive, Outlook, Fast Startup, itd.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Primjena prilagodbe sustava Windows: %s" @@ -1843,17 +1851,17 @@ msgstr "Stalni zapisnik" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Dodatnu datoteku ('diskcopy.dll') potrebno je preuzeti s Microsofta da biste instalirali MS-DOS:\n" -"- Odaberite 'Da' za spajanje na Internet i preuzimanje\n" +"Za korištenje ove značajke potrebno je preuzeti dodatnu datoteku ('%s') od Microsofta:\n" +"- Odaberite 'Da' za povezivanje s internetom i preuzimanje\n" "- Odaberite 'Ne' za poništavanje operacije\n" "\n" -"Napomena: Datoteka će se preuzeti u imenik aplikacije i automatski će se ponovno koristiti ako postoji." +"Napomena: Datoteka će se preuzeti u direktorij aplikacije i automatski će se ponovno koristiti ako postoji." #. • MSG_338 msgid "Revoked UEFI bootloader detected" @@ -1917,6 +1925,118 @@ msgstr "Izdvajanje arhivskih datoteka: %s" msgid "Use Rufus MBR" msgstr "Koristiti Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Koristi 'Windows CA 2023' potpisane bootloadere (potrebno je kompatibilno ciljno računalo)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Provjera za opoziva UEFI bootloadera..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Provjera ažuriranja za UEFI DBX..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "DBX ažuriranje dostupno" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus je pronašao ažuriranu verziju DBX datoteka koje se koriste za izvođenje provjera opoziva UEFI Secure Boot-a. Želite li preuzeti ovo ažuriranje?\n" +"- Odaberite 'Da' za povezivanje s internetom i preuzimanje ovog sadržaja\n" +"- Odaberite 'Ne' za otkazivanje operacije\n" +"\n" +"Napomena: Datoteke će se preuzeti u direktorij aplikacije i automatski će se ponovno koristiti ako postoje." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠TIHO⚠ izbriši disk i instaliraj:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Odabrali ste korištenje \"tihe\" opcije instalacije sustava Windows.\n" +"\n" +"Ovo je napredna opcija, rezervirana za ljude koji žele stvoriti medij koji ne obavještava korisnika tijekom instalacije sustava Windows i stoga BEZUVJETNO BRIŠE prvi otkriveni disk na sustavu. Ako niste oprezni, korištenje ove opcije može rezultirati NEPOVRATNIM GUBITKOM PODATAKA!\n" +"\n" +"Ako to ne želite, molim odaberite 'Ne' za povratak i poništite odabir opcije.\n" +"Suprotno, ako odaberete 'Da', slažete se da će sva odgovornost za bilo kakav gubitak podataka biti isključivo na VAMA." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Nepodržana lokacija slike" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Ne možete koristiti sliku koja se nalazi na ciljnom disku, jer će taj disk biti potpuno izbrisan. To je isto kao da pokušavate prepiliti granu na kojoj sjedite!\n" +"\n" +"Premjestite sliku na drugu lokaciju i pokušajte ponovno." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Sigurno je ostaviti ovu opciju omogućenu čak i ako imate TPM ili više RAM-a, jer ova opcija samo zaobilazi zahtjeve za postavljanje i zapravo ne sprječava Windows da koristi sav dostupan hardver." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Da bi ova opcija radila, mreža/internet MORA biti isključeni tijekom instalacije!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Automatski odgovori s 'ne' na pitanja tijekom postavljanju sustava Windowsa koja se odnose na dijeljenje podataka s Microsoftom, umjesto da to pita korisnika." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Ovu opciju biste trebali ostaviti omogućenu, osim ako vam ne smeta da 'Windows To Go' pristupa internim diskovima i tiho izvršava nepovratne nadogradnje datotečnog sustava." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Automatski stvori lokalni račun s navedenim korisničkim imenom, koristeći praznu lozinku koju će trebati promijeniti pri prvoj prijavi." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Duplicirajte regionalne postavke s ovog računala (tipkovnica, vremenska zona, valuta), umjesto da pita korisnika." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Ne šifrirajte sistemski disk, osim ako to korisnik izričito zatraži." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Koristite ovu opciju samo ako znate što je S-Mode i razumijete da vaš sustav možda bude zaključan u S-Modeu čak i nakon što potpuno izbrišete i ponovno instalirate Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Koristite ovu opciju ako sustav na koji planirate instalirati Windows koristi potpuno ažurirane Secure Boot certifikate. Ako je potrebno, možete pogledati u korištenje 'Mosby' za ažuriranje sustava." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Koristite ovu opciju ako želite opozvati dodatne potencijalno nesigurne Windows bootloadere, ali s mogućnošću sprječavanja pokretanja standardnih Windows medija." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "\"kvalitete života\" poboljšanja: Onemogućite većinu neželjenih značajki koje Microsoft pokušava forcirati na korisnicima." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Ako koristite ovu opciju, obavezno odspojite svaki disk od ciljnog računala, osim onog na koji želite instalirati Windows, i ne ostavljajte medij priključen u bilo koj računalo koje ne želite izbrisati." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index f1a854ca..317baea5 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -8,7 +8,7 @@ # • v3.22 "bg-BG" "Bulgarian (Български)" # • v4.5 "zh-CN" "Chinese Simplified (简体中文)" # • v4.5 "zh-TW" "Chinese Traditional (正體中文)" -# • v4.5 "hr-HR" "Croatian (Hrvatski)" +# • v4.14 "hr-HR" "Croatian (Hrvatski)" # • v4.14 "cs-CZ" "Czech (Čeština)" # • v4.5 "da-DK" "Danish (Dansk)" # • v4.14 "nl-NL" "Dutch (Nederlands)" @@ -2357,7 +2357,7 @@ t MSG_922 "下載 UEFI Shell 映像檔" ######################################################################### l "hr-HR" "Croatian (Hrvatski)" 0x041a, 0x081a, 0x101a -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -2545,7 +2545,7 @@ t MSG_129 "Kreirali ste medij koji koristi UEFI:NTFS bootloader. Da bi ste boot- t MSG_130 "Odabir Windows slike" t MSG_131 "Ova ISO datoteka sadrži više Windows slika.\nOdaberite sliku koju želite koristiti za instalaciju:" t MSG_132 "Drugi program ili proces pristupa pogonu. Da li ipak želiš formatirati pogon?" -t MSG_133 "Rufus je otkrio da pokušavate kreirati \"Windows To Go\" medij baziran na verziji 1809 ISO.\n\nZbog *MICROSOFT BUG-a*, doći će do fatalne greške kod podizanja Windows-a (Blue Screen Of Death), osim ako ne zamijenite datoteku 'WppRecorder.sys' s verzijom 1803.\n\nRufus nije u mogućnosti ispraviti problem jer datoteka 'WppRecorder.sys' podliježe Microsoft \"copyright-u\", tako da bi to bilo ilegalno." +t MSG_133 "Rufus je otkrio da pokušavate stvoriti 'Windows To Go' medij na temelju 1809 ISO datoteke.\n\nZbog *MICROSOFTOVE GREŠKE*, ovaj medij će se srušiti tijekom pokretanja sustava Windows (BSOD), osim ako ručno zamijenite datoteku 'WppRecorder.sys' s verzijom 1803.\n\nRufus ne može automatski popraviti ovo za vas jer je 'WppRecorder.sys' datoteka zaštićena autorskim pravima tvrtke Microsoft, pa ne možemo legalno ugraditi kopiju datoteke u aplikaciju..." t MSG_134 "Odabrali ste MBR za shemu particije. Rufus može kreirati maksimalnu partiticiju do 2 TB na ovom mediju, ostaje %s diska neiskorišteno.\n\nJeste li sigurni da želite nastaviti?" t MSG_135 "Verzija" t MSG_136 "Podverzija" @@ -2732,6 +2732,8 @@ t MSG_319 "Zanemari Boot Marker" t MSG_320 "Osvježavam raspored particija (%s)..." t MSG_321 "Slika koju ste odabrali je \"ISOHybrid\", ali nije kompatibilna s \"ISO/File\" mod kopiranja.\nZbog toga će DD mod zapisivanja slike biti korišten." t MSG_322 "Nije moguće otvoriti ili pročitati '%s'" +t MSG_323 "Primijenite SkuSiPolicy.p7b prilikom instalacije (vidi KB5042562)" +t MSG_324 "QoL poboljšanja (Nemojte forsirati Copilot, OneDrive, Outlook, Fast Startup, itd.)" t MSG_325 "Primjena prilagodbe sustava Windows: %s" t MSG_326 "Primjena korisničkih mogućnosti..." t MSG_327 "Korisničko iskustvo sustava Windows" @@ -2744,7 +2746,7 @@ t MSG_333 "Stvorite lokalni račun s korisničkim imenom:" t MSG_334 "Postavljanje regionalnih mogućnosti na iste vrijednosti kao i vrijednosti ovog korisnika" t MSG_335 "Onemogući BitLocker automatsko šifriranje uređaja" t MSG_336 "Stalni zapisnik" -t MSG_337 "Za korištenje ove značajke potrebno je preuzeti dodatnu datoteku ('%s') s Microsofta:\n- Odaberite 'Da' za spajanje na Internet i preuzimanje\n- Odaberite 'Ne' za poništavanje operacije\n\nNapomena: Datoteka će se preuzeti u imenik aplikacije i automatski će se ponovno koristiti ako postoji." +t MSG_337 "Za korištenje ove značajke potrebno je preuzeti dodatnu datoteku ('%s') od Microsofta:\n- Odaberite 'Da' za povezivanje s internetom i preuzimanje\n- Odaberite 'Ne' za poništavanje operacije\n\nNapomena: Datoteka će se preuzeti u direktorij aplikacije i automatski će se ponovno koristiti ako postoji." t MSG_338 "Otkriven opozvani UEFI pokretački program" t MSG_339 "Rufus je otkrio da ISO koji ste odabrali sadrži UEFI bootloader koji je opozvan i koji će proizvesti %s, kada je Secure Boot omogućen na potpuno ažuriranom UEFI sustavu.\n\n- Ako ste nabavili ovu ISO sliku iz izvora koji nije renomiran, trebali biste razmotriti mogućnost da ona sadrži zlonamjerni softver UEFI i izbjegavati pokretanje ga.\n- Ako ste ga dobili od pouzdanog izvora, trebali biste pokušati locirati noviju verziju koja neće proizvesti ovo upozorenje." t MSG_340 "zaslon \"Sigurnosna povreda\"" @@ -2757,6 +2759,27 @@ t MSG_346 "Ograniči Windows na S-Mode (NEKOMPATIBILNO s mrežnim zaobilaženjem t MSG_347 "Stručnog načina rada" t MSG_348 "Izdvajanje arhivskih datoteka: %s" t MSG_349 "Koristiti Rufus MBR" +t MSG_350 "Koristi 'Windows CA 2023' potpisane bootloadere (potrebno je kompatibilno ciljno računalo)" +t MSG_351 "Provjera za opoziva UEFI bootloadera..." +t MSG_352 "Provjera ažuriranja za UEFI DBX..." +t MSG_353 "DBX ažuriranje dostupno" +t MSG_354 "Rufus je pronašao ažuriranu verziju DBX datoteka koje se koriste za izvođenje provjera opoziva UEFI Secure Boot-a. Želite li preuzeti ovo ažuriranje?\n- Odaberite 'Da' za povezivanje s internetom i preuzimanje ovog sadržaja\n- Odaberite 'Ne' za otkazivanje operacije\n\nNapomena: Datoteke će se preuzeti u direktorij aplikacije i automatski će se ponovno koristiti ako postoje." +t MSG_355 "⚠TIHO⚠ izbriši disk i instaliraj:" +t MSG_356 "Odabrali ste korištenje \"tihe\" opcije instalacije sustava Windows.\n\nOvo je napredna opcija, rezervirana za ljude koji žele stvoriti medij koji ne obavještava korisnika tijekom instalacije sustava Windows i stoga BEZUVJETNO BRIŠE prvi otkriveni disk na sustavu. Ako niste oprezni, korištenje ove opcije može rezultirati NEPOVRATNIM GUBITKOM PODATAKA!\n\nAko to ne želite, molim odaberite 'Ne' za povratak i poništite odabir opcije.\nSuprotno, ako odaberete 'Da', slažete se da će sva odgovornost za bilo kakav gubitak podataka biti isključivo na VAMA." +t MSG_358 "Nepodržana lokacija slike" +t MSG_359 "Ne možete koristiti sliku koja se nalazi na ciljnom disku, jer će taj disk biti potpuno izbrisan. To je isto kao da pokušavate prepiliti granu na kojoj sjedite!\n\nPremjestite sliku na drugu lokaciju i pokušajte ponovno." +t MSG_360 "Sigurno je ostaviti ovu opciju omogućenu čak i ako imate TPM ili više RAM-a, jer ova opcija samo zaobilazi zahtjeve za postavljanje i zapravo ne sprječava Windows da koristi sav dostupan hardver." +t MSG_361 "Da bi ova opcija radila, mreža/internet MORA biti isključeni tijekom instalacije!" +t MSG_362 "Automatski odgovori s 'ne' na pitanja tijekom postavljanju sustava Windowsa koja se odnose na dijeljenje podataka s Microsoftom, umjesto da to pita korisnika." +t MSG_363 "Ovu opciju biste trebali ostaviti omogućenu, osim ako vam ne smeta da 'Windows To Go' pristupa internim diskovima i tiho izvršava nepovratne nadogradnje datotečnog sustava." +t MSG_364 "Automatski stvori lokalni račun s navedenim korisničkim imenom, koristeći praznu lozinku koju će trebati promijeniti pri prvoj prijavi." +t MSG_365 "Duplicirajte regionalne postavke s ovog računala (tipkovnica, vremenska zona, valuta), umjesto da pita korisnika." +t MSG_366 "Ne šifrirajte sistemski disk, osim ako to korisnik izričito zatraži." +t MSG_367 "Koristite ovu opciju samo ako znate što je S-Mode i razumijete da vaš sustav možda bude zaključan u S-Modeu čak i nakon što potpuno izbrišete i ponovno instalirate Windows." +t MSG_368 "Koristite ovu opciju ako sustav na koji planirate instalirati Windows koristi potpuno ažurirane Secure Boot certifikate. Ako je potrebno, možete pogledati u korištenje 'Mosby' za ažuriranje sustava." +t MSG_369 "Koristite ovu opciju ako želite opozvati dodatne potencijalno nesigurne Windows bootloadere, ali s mogućnošću sprječavanja pokretanja standardnih Windows medija." +t MSG_370 "\"kvalitete života\" poboljšanja: Onemogućite većinu neželjenih značajki koje Microsoft pokušava forcirati na korisnicima." +t MSG_371 "Ako koristite ovu opciju, obavezno odspojite svaki disk od ciljnog računala, osim onog na koji želite instalirati Windows, i ne ostavljajte medij priključen u bilo koj računalo koje ne želite izbrisati." t MSG_900 "Rufus je aplikacija koja olakšava formatiranje i stvaranje USB pokretačkih jedinica." t MSG_901 "Službena stranica: %s" t MSG_902 "Šifra izvora: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 604819af..abbd33e3 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.14.2343" +CAPTION "Rufus 4.14.2344" 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,14,2343,0 - PRODUCTVERSION 4,14,2343,0 + FILEVERSION 4,14,2344,0 + PRODUCTVERSION 4,14,2344,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.14.2343" + VALUE "FileVersion", "4.14.2344" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2343" + VALUE "ProductVersion", "4.14.2344" END END BLOCK "VarFileInfo" From c81f3cfb5ead1a15cbc0410f5e6c46a4b55c070a Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 30 Mar 2026 20:01:20 +0100 Subject: [PATCH 154/192] [iso] add support for El-Torito UEFI image extraction * Mostly for Lenovo UEFI firmware update ISOs, that use MBR partitioned HDD emulation El-Torito images --- src/iso.c | 32 +++++++++++++++++++++++++++++++- src/libcdio/iso9660/iso9660_fs.c | 22 ++++++++++++++-------- src/rufus.rc | 10 +++++----- 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/src/iso.c b/src/iso.c index f82401df..bc53bae8 100644 --- a/src/iso.c +++ b/src/iso.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * ISO file extraction - * Copyright © 2011-2024 Pete Batard <pete@akeo.ie> + * Copyright © 2011-2026 Pete Batard <pete@akeo.ie> * Based on libcdio's iso & udf samples: * Copyright © 2003-2014 Rocky Bernstein <rocky@gnu.org> * @@ -66,6 +66,9 @@ _Static_assert(256 * KB >= ISO_BLOCKSIZE, "Can't set PROGRESS_THRESHOLD"); #define ISO_EXTENSION_MASK (ISO_EXTENSION_ALL & (enable_joliet ? ISO_EXTENSION_ALL : ~ISO_EXTENSION_JOLIET) & \ (enable_rockridge ? ISO_EXTENSION_ALL : ~ISO_EXTENSION_ROCK_RIDGE)) +// Is an MBR partition type for a FAT12/FAT16/FAT32 partition? +#define IS_FAT_TYPE(x) ((x) == 0x01 || (x) == 0x04 || (x) == 0x06 || (x) == 0x0b || (x) == 0x0c || (x) == 0x0e) + // Needed for UDF ISO access CdIo_t* cdio_open (const char* psz_source, driver_id_t driver_id) {return NULL;} void cdio_destroy (CdIo_t* p_cdio) {} @@ -387,6 +390,10 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const (safe_stricmp(&psz_basename[strlen(psz_basename) - 4], ".img") == 0)) static_strcpy(img_report.efi_img_path, psz_fullpath); + // Special case for Lenovo UEFI firmware update ISOs, that use emulated El-Torito HDD images + if (!HAS_EFI_IMG(img_report) && stricmp(psz_fullpath, "/[BOOT]/0-Boot-HardDisk.img") == 0) + static_strcpy(img_report.efi_img_path, psz_fullpath); + // Check for the EFI boot entries. Note that because of Bazzite maintainers' disregard for end users // (evidenced in https://github.com/ublue-os/bazzite/issues/4374) and Fedora's disregards for standards // (evidenced in pushing for '/efi/fedora/' to store bootloaders, instead of sticking to '/efi/boot/') @@ -1876,6 +1883,20 @@ BOOL HasEfiImgBootLoaders(void) uprintf("Error reading ISO-9660 file %s at LSN %lu", img_report.efi_img_path, (long unsigned int)p_private->lsn); goto out; } + // Try to skip to first FAT partition, if working with an MBR partitioned image + if (p_private->buf[0x1fe] == 0x55 && p_private->buf[0x1ff] == 0xaa && + p_private->buf[0x1be] == 0x80 && IS_FAT_TYPE(p_private->buf[0x1c2])) { + uint32_t lba = *((uint32_t*)&p_private->buf[0x1c6]); + if (lba % 4 != 0) { + uprintf("Error: First MBR partition doesn't map to ISO-9660 sector"); + goto out; + } + p_private->lsn += lba / 4; + if (iso9660_iso_seek_read(p_private->p_iso, p_private->buf, p_private->lsn, ISO_NB_BLOCKS) != ISO_NB_BLOCKS * ISO_BLOCKSIZE) { + uprintf("Error reading ISO-9660 file %s at LSN %lu", img_report.efi_img_path, (long unsigned int)p_private->lsn); + goto out; + } + } lf_fs = libfat_open(iso9660_readfat, (intptr_t)p_private); if (lf_fs == NULL) { uprintf("FAT access error"); @@ -1960,6 +1981,15 @@ BOOL DumpFatDir(const char* path, int32_t cluster) uprintf("Error reading ISO-9660 file %s at LSN %lu", img_report.efi_img_path, (long unsigned int)p_private->lsn); goto out; } + // Try to skip to first FAT partition, if working with an MBR partitioned image + if (p_private->buf[0x1fe] == 0x55 && p_private->buf[0x1ff] == 0xaa && + p_private->buf[0x1be] == 0x80 && IS_FAT_TYPE(p_private->buf[0x1c2])) { + p_private->lsn += *((uint32_t*)&p_private->buf[0x1c6]) / 4; + if (iso9660_iso_seek_read(p_private->p_iso, p_private->buf, p_private->lsn, ISO_NB_BLOCKS) != ISO_NB_BLOCKS * ISO_BLOCKSIZE) { + uprintf("Error reading ISO-9660 file %s at LSN %lu", img_report.efi_img_path, (long unsigned int)p_private->lsn); + goto out; + } + } lf_fs = libfat_open(iso9660_readfat, (intptr_t)p_private); if (lf_fs == NULL) { uprintf("FAT access error"); diff --git a/src/libcdio/iso9660/iso9660_fs.c b/src/libcdio/iso9660/iso9660_fs.c index 6ef7c4b5..e67bada7 100644 --- a/src/libcdio/iso9660/iso9660_fs.c +++ b/src/libcdio/iso9660/iso9660_fs.c @@ -88,6 +88,7 @@ struct _iso9660_s { M2RAW_SECTOR_SIZE (2336). */ struct { + uint8_t type; /**< Type of El-Torito bootable image */ uint32_t lsn; /**< Start LSN of an El-Torito bootable image */ uint32_t num_sectors; /**< Number of virtual sectors occupied by the bootable image */ @@ -537,7 +538,8 @@ iso9660_ifs_read_superblock (iso9660_t *p_iso, for (j = 0, k = 0; j < (ISO_BLOCKSIZE / sizeof(iso9660_br_t)) && k < MAX_BOOT_IMAGES; j++) { - if (br[j].boot_id == 0x88 && br[j].media_type == 0) { + if (br[j].boot_id == 0x88 && (br[j].media_type & 0x0F) <= 4) { + p_iso->boot_img[k].type = br[j].media_type & 0x0F; p_iso->boot_img[k].lsn = uint32_from_le(br[j].image_lsn); p_iso->boot_img[k++].num_sectors = uint16_from_le(br[j].num_sectors); } @@ -1497,15 +1499,16 @@ iso9660_fs_stat_translate (CdIo_t *p_cdio, const char psz_path[]) iso9660_stat_t * iso9660_ifs_stat_translate (iso9660_t *p_iso, const char psz_path[]) { - /* Special case for virtual El-Torito boot images ('/[BOOT]/#-Boot-NoEmul.img') */ + /* Special case for virtual El-Torito boot images ('/[BOOT]/#-Boot-######.img') */ if (psz_path && p_iso && p_iso->boot_img[0].lsn != 0) { /* Work on a path without leading slash */ const char* path = (psz_path[0] == '/') ? &psz_path[1] : psz_path; if ((_cdio_strnicmp(path, "[BOOT]/", 7) == 0) && - (_cdio_stricmp(&path[8], "-Boot-NoEmul.img") == 0)) { + (_cdio_strnicmp(&path[8], "-Boot-", 6) == 0) && + (_cdio_strnicmp(&path[strlen(path) - 4], ".img", 4) == 0)) { int index = path[7] - '0'; iso9660_stat_t* p_stat; - if (strlen(path) < 24) + if (strlen(path) < 20) return NULL; cdio_assert(MAX_BOOT_IMAGES <= 10); if ((path[7] < '0') || (path[7] > '0' + MAX_BOOT_IMAGES - 1)) @@ -1679,6 +1682,9 @@ iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[]) CdioISO9660FileList_t * iso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[]) { + /* Similar to what 7-zip uses in Archive/Iso/IsoIn.cpp */ + static const char* const eltorito_media_name[] = + { "NoEmul", "1.2M", "1.44M", "2.88M", "HardDisk" }; int i; iso9660_dir_t *p_iso9660_dir; iso9660_stat_t *p_iso9660_stat = NULL; @@ -1701,13 +1707,13 @@ iso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[]) if (_cdio_strnicmp(path, "[BOOT]", 6) == 0 && (path[6] == '\0' || path[6] == '/')) { retval = _cdio_list_new(); for (i = 0; i < MAX_BOOT_IMAGES && p_iso->boot_img[i].lsn != 0; i++) { - p_iso9660_stat = calloc(1, sizeof(iso9660_stat_t) + 18); + p_iso9660_stat = calloc(1, sizeof(iso9660_stat_t) + 24); if (!p_iso9660_stat) { - cdio_warn("Couldn't calloc(1, %d)", (int)sizeof(iso9660_stat_t) + 18); + cdio_warn("Couldn't calloc(1, %d)", (int)sizeof(iso9660_stat_t) + 24); break; } - strcpy(p_iso9660_stat->filename, "#-Boot-NoEmul.img"); - p_iso9660_stat->filename[0] = '0' + i; + snprintf(p_iso9660_stat->filename, 24, "%d-Boot-%s.img", i, + eltorito_media_name[p_iso->boot_img[i].type]); p_iso9660_stat->type = _STAT_FILE; p_iso9660_stat->lsn = p_iso->boot_img[i].lsn; p_iso9660_stat->total_size = p_iso->boot_img[i].num_sectors * VIRTUAL_SECTORSIZE; diff --git a/src/rufus.rc b/src/rufus.rc index abbd33e3..ab740b70 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.14.2344" +CAPTION "Rufus 4.14.2345" 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,14,2344,0 - PRODUCTVERSION 4,14,2344,0 + FILEVERSION 4,14,2345,0 + PRODUCTVERSION 4,14,2345,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.14.2344" + VALUE "FileVersion", "4.14.2345" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2344" + VALUE "ProductVersion", "4.14.2345" END END BLOCK "VarFileInfo" From 51638bf84e15b625b5bdc3ed6a46be61f4037baa Mon Sep 17 00:00:00 2001 From: Thilo Langbein <mail@thilo-langbein.de> Date: Tue, 31 Mar 2026 16:33:05 +0100 Subject: [PATCH 155/192] [loc] update German translation to latest --- res/loc/po/de-DE.po | 134 ++++++++++++++++++++++++++++++++++++++++++-- res/loc/rufus.loc | 29 +++++++++- src/rufus.rc | 10 ++-- 3 files changed, 159 insertions(+), 14 deletions(-) diff --git a/res/loc/po/de-DE.po b/res/loc/po/de-DE.po index b8a8e950..83b7a3d8 100644 --- a/res/loc/po/de-DE.po +++ b/res/loc/po/de-DE.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2025-11-12 17:32+0000\n" -"PO-Revision-Date: 2025-11-12 17:32+0000\n" +"POT-Creation-Date: 2026-03-31 16:34+0100\n" +"PO-Revision-Date: 2026-03-31 16:34+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: de_DE\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: German (Deutsch)\n" "X-Rufus-LCID: 0x0407, 0x0807, 0x0c07, 0x1007, 0x1407\n" -"X-Generator: Poedit 3.8\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -889,7 +889,7 @@ msgstr "Ein anderer Prozess bzw. ein anderes Programm verwendet das Laufwerk ger #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" @@ -1794,7 +1794,15 @@ msgstr "" #. • MSG_322 msgid "Unable to open or read '%s'" -msgstr "'%' kann nicht geöffnet/gelesen werden" +msgstr "'%s' kann nicht geöffnet/gelesen werden" + +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "SkuSiPolicy.p7b auf Installation anwenden. (Siehe KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Komfort-Einstellungen (Copilot, OneDrive, Outlook und Schnellstart nicht aktivieren)" #. • MSG_325 msgid "Applying Windows customization: %s" @@ -1920,6 +1928,120 @@ msgstr "Archivdatei extrahieren: %s" msgid "Use Rufus MBR" msgstr "Rufus MBR verwenden" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Den \"Windows CA 2023\" signierten Bootloader verwenden. Ein kompatibler Computer ist erforderlich!" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Auf gesperrte UEFI-Bootloader prüfen..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Prüfe auf UEFI DBX-Aktualisierungen..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "DBX-Update verfügbar" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus hat eine aktualisierte Version der DBX-Dateien gefunden, die für die Überprüfung der UEFI-Secure-Boot-Widerrufsstatus verwendet werden. Möchten Sie dieses Update herunterladen?\n" +"- Wählen Sie „Ja“, um eine Verbindung zum Internet herzustellen und diesen Inhalt herunterzuladen.\n" +"- Wählen Sie „Nein“, um den Vorgang abzubrechen.\n" +"\n" +"Hinweis: Die Dateien werden in das Verzeichnis der Anwendung heruntergeladen und bei Vorhandensein automatisch wiederverwendet.\n" +"\n" +"Übersetzt mit DeepL.com (kostenlose Version)" + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠AUTOMATISCH⚠ Laufwerk löschen und installieren:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Sie haben die „automatische“ Windows-Installationsoption ausgewählt.\n" +"\n" +"Dies ist eine Option für Fortgeschrittene, die für Benutzer gedacht ist, die ein Installationsmedium erstellen möchten, das den Benutzer während der Windows-Installation nicht auffordert, Eingaben vorzunehmen, und daher die erste erkannte Festplatte auf dem Zielsystem AUTOMATISCH LÖSCHT. Wenn Sie nicht vorsichtig sind, kann die Verwendung dieser Option zu UNWIDERRUFLICHEM DATENVERLUST führen!\n" +"\n" +"Wenn Sie dies nicht wollen, wählen Sie bitte „Nein“, um zurückzugehen und die Option zu deaktivieren.\n" +"Andernfalls erklären Sie sich mit der Auswahl von „Ja“ damit einverstanden, dass die gesamte Verantwortung für etwaige Datenverluste ausschließlich bei IHNEN liegt." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Nicht unterstützter Abbild-Standort" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Sie können kein Image verwenden, das sich auf dem Ziellaufwerk befindet, da dieses Laufwerk vollständig gelöscht wird. Das ist so, als würde man versuchen, den Ast abzusägen, auf dem man sitzt!\n" +"\n" +"Bitte verschieben Sie das Image an einen anderen Speicherort und versuchen Sie es erneut." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Sie können diese Option aktiviert lassen, auch wenn Sie über ein TPM oder mehr Arbeitsspeicher verfügen, da diese Option lediglich die Installationsanforderungen umgeht und Windows nicht daran hindert, die gesamte verfügbare Hardware zu nutzen." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Damit diese Option funktioniert, MUSS die Netzwerk-/Internetverbindung während der Installation unterbrochen sein!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Beantwortet die Fragen des Windows-Setups bezüglich der Weitergabe von Daten an Microsoft automatisch mit „Nein“, anstatt den Benutzer dazu aufzufordern." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Sie sollten diese Option aktiviert lassen, es sei denn, Sie haben nichts dagegen, dass „Windows To Go“ auf interne Festplatten zugreift und im Hintergrund irreversible Dateisystem-Upgrades durchführt." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Erstellt automatisch ein lokales Konto mit dem angegebenen Benutzernamen und einem leeren Passwort, das bei der nächsten Anmeldung geändert werden muss." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Die regionalen Einstellungen dieses PCs (Tastatur, Zeitzone, Währung) übernehmen, anstatt den Benutzer dazu aufzufordern." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Nicht die Systemfestplatte verschlüsseln, es sei denn, der Benutzer wünscht dies ausdrücklich." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Verwenden Sie diese Option nur, wenn Sie wissen, was der S-Modus ist, und sich darüber im Klaren sind, dass Ihr System möglicherweise auch nach einer vollständigen Löschung und Neuinstallation von Windows im S-Modus verbleibt." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Verwenden Sie diese Option, wenn das System, auf dem Sie Windows installieren möchten, über vollständig aktuelle Secure-Boot-Zertifikate verfügt. Bei Bedarf können Sie die Verwendung von „Mosby“ in Betracht ziehen, um Ihr System zu aktualisieren." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Verwenden Sie diese Option, wenn Sie weitere potenziell unsichere Windows-Bootloader deaktivieren möchten, wobei jedoch die Möglichkeit besteht, dass auch Standard-Windows-Datenträger nicht mehr booten." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Komfort-Funktion: Deaktiviert die meisten unerwünschten Funktionen, die Microsoft den Endnutzern aufzuzwingen versucht." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Wenn Sie diese Option verwenden, stellen Sie bitte sicher, dass Sie alle Festplatten vom Ziel-PC trennen, mit Ausnahme derjenigen, auf der Sie Windows installieren möchten, und dass Sie den Datenträger nicht in einem PC stecken lassen, den Sie nicht löschen möchten." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 317baea5..f93518f4 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -14,7 +14,7 @@ # • v4.14 "nl-NL" "Dutch (Nederlands)" # • v4.5 "fi-FI" "Finnish (Suomi)" # • v4.14 "fr-FR" "French (Français)" -# • v4.5 "de-DE" "German (Deutsch)" +# • v4.14 "de-DE" "German (Deutsch)" # • v4.5 "el-GR" "Greek (Ελληνικά)" # • v4.14 "he-IL" "Hebrew (עברית)" # • v4.14 "hu-HU" "Hungarian (Magyar)" @@ -4952,7 +4952,7 @@ t MSG_922 "Téléchargez des images ISOs du Shell UEFI" ######################################################################### l "de-DE" "German (Deutsch)" 0x0407, 0x0807, 0x0c07, 0x1007, 0x1407 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -5312,7 +5312,9 @@ t MSG_318 "Standardmäßige Thread-Priorität: %d" t MSG_319 "Boot-Markierung ignorieren" t MSG_320 "Liste der Partitionen aktualisieren (%s)..." t MSG_321 "Das ausgewählte Image ist vom Typ ISOHybrid, aber der Ersteller hat es nicht mit dem ISO/Dateikopiermodus kompatibel gemacht.\nDeswegen wird der DD-Schreibmodus verwendet." -t MSG_322 "'%' kann nicht geöffnet/gelesen werden" +t MSG_322 "'%s' kann nicht geöffnet/gelesen werden" +t MSG_323 "SkuSiPolicy.p7b auf Installation anwenden. (Siehe KB5042562)" +t MSG_324 "Komfort-Einstellungen (Copilot, OneDrive, Outlook und Schnellstart nicht aktivieren)" t MSG_325 "Windows-Anpassungen anwenden: %s" t MSG_326 "Benutzereinstellungen anwenden..." t MSG_327 "Windows-Benutzererfahrung" @@ -5338,6 +5340,27 @@ t MSG_346 "Windows im S-Modus (nicht kompatibel mit Online Konto-Umgehung)" t MSG_347 "Expertenmodus" t MSG_348 "Archivdatei extrahieren: %s" t MSG_349 "Rufus MBR verwenden" +t MSG_350 "Den \"Windows CA 2023\" signierten Bootloader verwenden. Ein kompatibler Computer ist erforderlich!" +t MSG_351 "Auf gesperrte UEFI-Bootloader prüfen..." +t MSG_352 "Prüfe auf UEFI DBX-Aktualisierungen..." +t MSG_353 "DBX-Update verfügbar" +t MSG_354 "Rufus hat eine aktualisierte Version der DBX-Dateien gefunden, die für die Überprüfung der UEFI-Secure-Boot-Widerrufsstatus verwendet werden. Möchten Sie dieses Update herunterladen?\n- Wählen Sie „Ja“, um eine Verbindung zum Internet herzustellen und diesen Inhalt herunterzuladen.\n- Wählen Sie „Nein“, um den Vorgang abzubrechen.\n\nHinweis: Die Dateien werden in das Verzeichnis der Anwendung heruntergeladen und bei Vorhandensein automatisch wiederverwendet.\n\nÜbersetzt mit DeepL.com (kostenlose Version)" +t MSG_355 "⚠AUTOMATISCH⚠ Laufwerk löschen und installieren:" +t MSG_356 "Sie haben die „automatische“ Windows-Installationsoption ausgewählt.\n\nDies ist eine Option für Fortgeschrittene, die für Benutzer gedacht ist, die ein Installationsmedium erstellen möchten, das den Benutzer während der Windows-Installation nicht auffordert, Eingaben vorzunehmen, und daher die erste erkannte Festplatte auf dem Zielsystem AUTOMATISCH LÖSCHT. Wenn Sie nicht vorsichtig sind, kann die Verwendung dieser Option zu UNWIDERRUFLICHEM DATENVERLUST führen!\n\nWenn Sie dies nicht wollen, wählen Sie bitte „Nein“, um zurückzugehen und die Option zu deaktivieren.\nAndernfalls erklären Sie sich mit der Auswahl von „Ja“ damit einverstanden, dass die gesamte Verantwortung für etwaige Datenverluste ausschließlich bei IHNEN liegt." +t MSG_358 "Nicht unterstützter Abbild-Standort" +t MSG_359 "Sie können kein Image verwenden, das sich auf dem Ziellaufwerk befindet, da dieses Laufwerk vollständig gelöscht wird. Das ist so, als würde man versuchen, den Ast abzusägen, auf dem man sitzt!\n\nBitte verschieben Sie das Image an einen anderen Speicherort und versuchen Sie es erneut." +t MSG_360 "Sie können diese Option aktiviert lassen, auch wenn Sie über ein TPM oder mehr Arbeitsspeicher verfügen, da diese Option lediglich die Installationsanforderungen umgeht und Windows nicht daran hindert, die gesamte verfügbare Hardware zu nutzen." +t MSG_361 "Damit diese Option funktioniert, MUSS die Netzwerk-/Internetverbindung während der Installation unterbrochen sein!" +t MSG_362 "Beantwortet die Fragen des Windows-Setups bezüglich der Weitergabe von Daten an Microsoft automatisch mit „Nein“, anstatt den Benutzer dazu aufzufordern." +t MSG_363 "Sie sollten diese Option aktiviert lassen, es sei denn, Sie haben nichts dagegen, dass „Windows To Go“ auf interne Festplatten zugreift und im Hintergrund irreversible Dateisystem-Upgrades durchführt." +t MSG_364 "Erstellt automatisch ein lokales Konto mit dem angegebenen Benutzernamen und einem leeren Passwort, das bei der nächsten Anmeldung geändert werden muss." +t MSG_365 "Die regionalen Einstellungen dieses PCs (Tastatur, Zeitzone, Währung) übernehmen, anstatt den Benutzer dazu aufzufordern." +t MSG_366 "Nicht die Systemfestplatte verschlüsseln, es sei denn, der Benutzer wünscht dies ausdrücklich." +t MSG_367 "Verwenden Sie diese Option nur, wenn Sie wissen, was der S-Modus ist, und sich darüber im Klaren sind, dass Ihr System möglicherweise auch nach einer vollständigen Löschung und Neuinstallation von Windows im S-Modus verbleibt." +t MSG_368 "Verwenden Sie diese Option, wenn das System, auf dem Sie Windows installieren möchten, über vollständig aktuelle Secure-Boot-Zertifikate verfügt. Bei Bedarf können Sie die Verwendung von „Mosby“ in Betracht ziehen, um Ihr System zu aktualisieren." +t MSG_369 "Verwenden Sie diese Option, wenn Sie weitere potenziell unsichere Windows-Bootloader deaktivieren möchten, wobei jedoch die Möglichkeit besteht, dass auch Standard-Windows-Datenträger nicht mehr booten." +t MSG_370 "Komfort-Funktion: Deaktiviert die meisten unerwünschten Funktionen, die Microsoft den Endnutzern aufzuzwingen versucht." +t MSG_371 "Wenn Sie diese Option verwenden, stellen Sie bitte sicher, dass Sie alle Festplatten vom Ziel-PC trennen, mit Ausnahme derjenigen, auf der Sie Windows installieren möchten, und dass Sie den Datenträger nicht in einem PC stecken lassen, den Sie nicht löschen möchten." t MSG_900 "Rufus ist ein Werkzeug, das beim Formatieren und Erstellen bootfähiger USB-Flash-Laufwerke wie USB-Sticks, Speichersticks usw. hilft." t MSG_901 "Offizielle Website: %s" t MSG_902 "Quellcode: %s" diff --git a/src/rufus.rc b/src/rufus.rc index ab740b70..dcb60c65 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.14.2345" +CAPTION "Rufus 4.14.2346" 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,14,2345,0 - PRODUCTVERSION 4,14,2345,0 + FILEVERSION 4,14,2346,0 + PRODUCTVERSION 4,14,2346,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.14.2345" + VALUE "FileVersion", "4.14.2346" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2345" + VALUE "ProductVersion", "4.14.2346" END END BLOCK "VarFileInfo" From 25036e0417b0db66ef186dc834ce41a99180b435 Mon Sep 17 00:00:00 2001 From: Jiawei Wang <me@jwang.link> Date: Tue, 31 Mar 2026 16:49:20 +0100 Subject: [PATCH 156/192] [loc] update Simplified Chinese translation to latest --- res/loc/po/zh-CN.po | 138 +++++++++++++++++++++++++++++++++++++++++--- res/loc/rufus.loc | 27 ++++++++- src/rufus.rc | 10 ++-- 3 files changed, 159 insertions(+), 16 deletions(-) diff --git a/res/loc/po/zh-CN.po b/res/loc/po/zh-CN.po index 0ace1d99..c831a062 100644 --- a/res/loc/po/zh-CN.po +++ b/res/loc/po/zh-CN.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-04-28 10:38+0800\n" -"PO-Revision-Date: 2024-04-28 10:59+0800\n" +"POT-Creation-Date: 2026-03-31 15:46+0800\n" +"PO-Revision-Date: 2026-03-31 16:20+0800\n" "Last-Translator: \n" "Language-Team: \n" "Language: zh_CN\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Chinese Simplified (简体中文)\n" "X-Rufus-LCID: 0x0804, 0x1004\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.4.4\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -850,7 +850,7 @@ msgstr "无持久分区" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "设置Live USB驱动器的持久分区大小。设置为零将禁用持久分区。" @@ -892,7 +892,7 @@ msgstr "另一程序正在使用此驱动器。您仍然要格式化它吗?" #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" @@ -1801,6 +1801,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "无法打开或读取 '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "安装时应用 SkuSiPolicy.p7b(参见 KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "优化使用体验(不强制启用 Copilot、OneDrive、Outlook、快速启动等)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "正在应用 Windows 设置: %s" @@ -1851,13 +1859,13 @@ msgstr "持久化日志" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"必须从微软下载额外的文件(\"diskcopy.dll\"),以安装 MS-DOS:\n" +"必须从 Microsoft 下载附加文件(“%s”)才能使用此功能:\n" "- 选择 '是' 连接网络并下载这些文件\n" "- 选择 '否' 取消此项操作\n" "\n" @@ -1925,6 +1933,118 @@ msgstr "正在解压文件: %s" msgid "Use Rufus MBR" msgstr "使用 Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "使用'Windows CA 2023'签名的引导加载程序(需要目标电脑兼容)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "正在检查 UEFI 引导加载程序吊销状态…" + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "正在检查 UEFI DBX 更新…" + +#. • MSG_353 +msgid "DBX update available" +msgstr "有可用的 DBX 更新" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus 发现了 DBX 文件的更新版本(用于检查 UEFI 安全启动吊销情况)。是否下载此更新?\n" +"- 选择'是'以连接互联网并下载该内容\n" +"- 选择'否'以取消操作\n" +"\n" +"注意:该文件将下载到应用程序所在目录,若文件已存在则会自动复用。" + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠静默⚠擦除磁盘并安装:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"您已选择使用\"静默\"Windows 安装选项。\n" +"\n" +"这是一个高级选项,适用于希望创建在 Windows 安装过程中不提示用户、无条件擦除目标系统上首个检测到磁盘的安装介质的用户。如果操作不慎,使用此选项可能导致不可逆的数据丢失!\n" +"\n" +"如果这不是您想要的,请选择'否'返回并取消勾选该选项。\n" +"否则,如果您选择'是',即表示您同意承担数据丢失的全部责任。" + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "不支持的映像位置" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"您不能使用位于目标驱动器上的映像,因为该驱动器将被完全擦除。这就好比坐在树枝上锯树枝!\n" +"\n" +"请将映像移动到其他位置后重试。" + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "即使您的电脑配备了 TPM 或拥有充足的内存,启用此选项也是安全的,因为该选项仅绕过安装程序的硬件要求检查,并不会阻止 Windows 使用所有可用硬件。" + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "要使此选项生效,安装过程中必须断开网络/互联网连接!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "自动对 Windows 安装过程中有关与 Microsoft 共享数据的问题回答'否',而非提示用户手动选择。" + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "建议保持此选项启用,除非您允许 'Windows To Go' 访问内部磁盘并静默执行不可逆的文件系统升级。" + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "使用指定的用户名自动创建本地账户,初始密码为空,用户在下次登录时需要更改密码。" + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "从当前电脑复制区域设置(键盘布局、时区、货币格式),而非提示用户手动选择。" + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "除非用户明确要求,不加密系统磁盘。" + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "仅在您了解什么是 S 模式、并理解即使完全擦除并重新安装 Windows 后系统仍可能被锁定在 S 模式下的情况下,才使用此选项。" + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "如果您计划安装 Windows 的系统已使用完全最新的安全启动证书,请使用此选项。如有需要,您可以考虑使用 'Mosby' 来更新您的系统。" + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "如果您希望吊销更多可能不安全的 Windows 引导加载程序,请使用此选项,但请注意这也可能导致标准 Windows 安装介质无法启动。" + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "优化使用体验:禁用 Microsoft 试图强加给用户的大部分不必要功能。" + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "如果您使用此选项,请务必断开目标电脑上除要安装 Windows 的磁盘以外的所有磁盘,同时不要将该安装介质插在任何您不想被擦除数据的电脑上。" + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index f93518f4..a5ea87bd 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -6,7 +6,7 @@ # • v4.14 "en-US" "English (English)" # • v4.5 "ar-SA" "Arabic (العربية)" # • v3.22 "bg-BG" "Bulgarian (Български)" -# • v4.5 "zh-CN" "Chinese Simplified (简体中文)" +# • v4.14 "zh-CN" "Chinese Simplified (简体中文)" # • v4.5 "zh-TW" "Chinese Traditional (正體中文)" # • v4.14 "hr-HR" "Croatian (Hrvatski)" # • v4.14 "cs-CZ" "Czech (Čeština)" @@ -1513,7 +1513,7 @@ t MSG_922 "Изтегляне на UEFI Shell образи" ######################################################################### l "zh-CN" "Chinese Simplified (简体中文)" 0x0804, 0x1004 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -1888,6 +1888,8 @@ t MSG_319 "忽视启动标记(Boot Marker)" t MSG_320 "刷新分区布局 (%s)..." t MSG_321 "您选择了一个 ISOHybrid 镜像文件,但此文件与 ISO/File 复制模式不兼容。\n因此强制使用DD镜像写入模式。" t MSG_322 "无法打开或读取 '%s'" +t MSG_323 "安装时应用 SkuSiPolicy.p7b(参见 KB5042562)" +t MSG_324 "优化使用体验(不强制启用 Copilot、OneDrive、Outlook、快速启动等)" t MSG_325 "正在应用 Windows 设置: %s" t MSG_326 "正在应用用户设置..." t MSG_327 "Windows 用户体验" @@ -1913,6 +1915,27 @@ t MSG_346 "将 Windows 限制为 S 模式(与绕过在线账户功能不兼容 t MSG_347 "专家模式" t MSG_348 "正在解压文件: %s" t MSG_349 "使用 Rufus MBR" +t MSG_350 "使用'Windows CA 2023'签名的引导加载程序(需要目标电脑兼容)" +t MSG_351 "正在检查 UEFI 引导加载程序吊销状态…" +t MSG_352 "正在检查 UEFI DBX 更新…" +t MSG_353 "有可用的 DBX 更新" +t MSG_354 "Rufus 发现了 DBX 文件的更新版本(用于检查 UEFI 安全启动吊销情况)。是否下载此更新?\n- 选择'是'以连接互联网并下载该内容\n- 选择'否'以取消操作\n\n注意:该文件将下载到应用程序所在目录,若文件已存在则会自动复用。" +t MSG_355 "⚠静默⚠擦除磁盘并安装:" +t MSG_356 "您已选择使用\"静默\"Windows 安装选项。\n\n这是一个高级选项,适用于希望创建在 Windows 安装过程中不提示用户、无条件擦除目标系统上首个检测到磁盘的安装介质的用户。如果操作不慎,使用此选项可能导致不可逆的数据丢失!\n\n如果这不是您想要的,请选择'否'返回并取消勾选该选项。\n否则,如果您选择'是',即表示您同意承担数据丢失的全部责任。" +t MSG_358 "不支持的映像位置" +t MSG_359 "您不能使用位于目标驱动器上的映像,因为该驱动器将被完全擦除。这就好比坐在树枝上锯树枝!\n\n请将映像移动到其他位置后重试。" +t MSG_360 "即使您的电脑配备了 TPM 或拥有充足的内存,启用此选项也是安全的,因为该选项仅绕过安装程序的硬件要求检查,并不会阻止 Windows 使用所有可用硬件。" +t MSG_361 "要使此选项生效,安装过程中必须断开网络/互联网连接!" +t MSG_362 "自动对 Windows 安装过程中有关与 Microsoft 共享数据的问题回答'否',而非提示用户手动选择。" +t MSG_363 "建议保持此选项启用,除非您允许 'Windows To Go' 访问内部磁盘并静默执行不可逆的文件系统升级。" +t MSG_364 "使用指定的用户名自动创建本地账户,初始密码为空,用户在下次登录时需要更改密码。" +t MSG_365 "从当前电脑复制区域设置(键盘布局、时区、货币格式),而非提示用户手动选择。" +t MSG_366 "除非用户明确要求,不加密系统磁盘。" +t MSG_367 "仅在您了解什么是 S 模式、并理解即使完全擦除并重新安装 Windows 后系统仍可能被锁定在 S 模式下的情况下,才使用此选项。" +t MSG_368 "如果您计划安装 Windows 的系统已使用完全最新的安全启动证书,请使用此选项。如有需要,您可以考虑使用 'Mosby' 来更新您的系统。" +t MSG_369 "如果您希望吊销更多可能不安全的 Windows 引导加载程序,请使用此选项,但请注意这也可能导致标准 Windows 安装介质无法启动。" +t MSG_370 "优化使用体验:禁用 Microsoft 试图强加给用户的大部分不必要功能。" +t MSG_371 "如果您使用此选项,请务必断开目标电脑上除要安装 Windows 的磁盘以外的所有磁盘,同时不要将该安装介质插在任何您不想被擦除数据的电脑上。" t MSG_900 "Rufus 是一个帮助您格式化并创建可启动 USB 驱动器(如 U 盘和存储卡)的工具。" t MSG_901 "官方网站: %s" t MSG_902 "源代码: %s" diff --git a/src/rufus.rc b/src/rufus.rc index dcb60c65..c1620aa3 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.14.2346" +CAPTION "Rufus 4.14.2347" 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,14,2346,0 - PRODUCTVERSION 4,14,2346,0 + FILEVERSION 4,14,2347,0 + PRODUCTVERSION 4,14,2347,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.14.2346" + VALUE "FileVersion", "4.14.2347" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2346" + VALUE "ProductVersion", "4.14.2347" END END BLOCK "VarFileInfo" From dd493ada28aaf56f4586b67156b76a71ba6129b5 Mon Sep 17 00:00:00 2001 From: Maison da Silva <maison.dasilva@outlook.com> Date: Tue, 31 Mar 2026 00:50:08 -0300 Subject: [PATCH 157/192] [loc] update Portuguese (Brazilian) translator contact e-mail * Closes #2946. --- res/loc/po/pt-BR.po | 2 +- res/loc/rufus.loc | 2 +- src/rufus.rc | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/res/loc/po/pt-BR.po b/res/loc/po/pt-BR.po index 6ae65be0..4b329f2e 100644 --- a/res/loc/po/pt-BR.po +++ b/res/loc/po/pt-BR.po @@ -1086,7 +1086,7 @@ msgstr "Versão %d.%d (Build %d)" #. • MSG_176 msgid "English translation: Pete Batard <mailto:pete@akeo.ie>" -msgstr "Tradutores:\\line• Tiago Rinaldi <mailto:trinaldi@gmail.com>\\line• Chateaubriand Vieira Moura <mailto:chateaubriand@ifse.com.br>\\line• Maison da Silva <mailto:maisonmdsgreen@hotmail.com>\\line• Marcos Mello <mailto:marcosfrm@gmail.com>" +msgstr "Tradutores:\\line• Tiago Rinaldi <mailto:trinaldi@gmail.com>\\line• Chateaubriand Vieira Moura <mailto:chateaubriand@ifse.com.br>\\line• Maison da Silva <mailto:maison.dasilva@outlook.com>\\line• Marcos Mello <mailto:marcosfrm@gmail.com>" #. • MSG_177 msgid "Report bugs or request enhancements at:" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index a5ea87bd..5f56a9af 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -11121,7 +11121,7 @@ t MSG_172 "Assinatura do download inválida" t MSG_173 "Clique para selecionar..." t MSG_174 "Rufus - O Utilitário de Formatação USB Confiável" t MSG_175 "Versão %d.%d (Build %d)" -t MSG_176 "Tradutores:\\line• Tiago Rinaldi <mailto:trinaldi@gmail.com>\\line• Chateaubriand Vieira Moura <mailto:chateaubriand@ifse.com.br>\\line• Maison da Silva <mailto:maisonmdsgreen@hotmail.com>\\line• Marcos Mello <mailto:marcosfrm@gmail.com>" +t MSG_176 "Tradutores:\\line• Tiago Rinaldi <mailto:trinaldi@gmail.com>\\line• Chateaubriand Vieira Moura <mailto:chateaubriand@ifse.com.br>\\line• Maison da Silva <mailto:maison.dasilva@outlook.com>\\line• Marcos Mello <mailto:marcosfrm@gmail.com>" t MSG_177 "Relate bugs ou solicite aprimoramentos em:" t MSG_178 "Direitos Autorais Adicionais:" t MSG_179 "Política de Atualização:" diff --git a/src/rufus.rc b/src/rufus.rc index c1620aa3..b1900220 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.14.2347" +CAPTION "Rufus 4.14.2348" 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,14,2347,0 - PRODUCTVERSION 4,14,2347,0 + FILEVERSION 4,14,2348,0 + PRODUCTVERSION 4,14,2348,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.14.2347" + VALUE "FileVersion", "4.14.2348" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2347" + VALUE "ProductVersion", "4.14.2348" END END BLOCK "VarFileInfo" From 860adf3bde984a79681cd4e2fbd61923988e2f06 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 1 Apr 2026 13:45:28 +0100 Subject: [PATCH 158/192] [wue] remove all dialogs from silent installs without Ethernet * Without this, the silent/automated installs could still be interrupted by the "let's connect you to a network" dialog. --- src/rufus.h | 2 +- src/rufus.rc | 10 +++++----- src/wue.c | 14 ++++++++++---- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/rufus.h b/src/rufus.h index 84eceaf2..01f5268e 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -697,7 +697,7 @@ typedef struct { #define UNATTEND_WINPE_SETUP_MASK (UNATTEND_SECUREBOOT_TPM_MINRAM | UNATTEND_SILENT_INSTALL) #define UNATTEND_SPECIALIZE_DEPLOYMENT_MASK (UNATTEND_NO_ONLINE_ACCOUNT | UNATTEND_QOL_ENHANCEMENTS) -#define UNATTEND_OOBE_SHELL_SETUP_MASK (UNATTEND_NO_DATA_COLLECTION | UNATTEND_SET_USER | UNATTEND_DUPLICATE_LOCALE) +#define UNATTEND_OOBE_SHELL_SETUP_MASK (UNATTEND_NO_DATA_COLLECTION | UNATTEND_SET_USER | UNATTEND_DUPLICATE_LOCALE | UNATTEND_SILENT_INSTALL) #define UNATTEND_OOBE_INTERNATIONAL_MASK (UNATTEND_DUPLICATE_LOCALE) #define UNATTEND_OOBE_MASK (UNATTEND_OOBE_SHELL_SETUP_MASK | UNATTEND_OOBE_INTERNATIONAL_MASK | UNATTEND_DISABLE_BITLOCKER | \ UNATTEND_USE_MS2023_BOOTLOADERS | UNATTEND_APPLY_SKUSIPOLICY | UNATTEND_QOL_ENHANCEMENTS) diff --git a/src/rufus.rc b/src/rufus.rc index b1900220..b0c4289e 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.14.2348" +CAPTION "Rufus 4.14.2349" 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,14,2348,0 - PRODUCTVERSION 4,14,2348,0 + FILEVERSION 4,14,2349,0 + PRODUCTVERSION 4,14,2349,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.14.2348" + VALUE "FileVersion", "4.14.2349" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2348" + VALUE "ProductVersion", "4.14.2349" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index 44a009cb..57aaf528 100644 --- a/src/wue.c +++ b/src/wue.c @@ -300,14 +300,20 @@ char* CreateUnattendXml(int arch, int flags) fprintf(fd, " <component name=\"Microsoft-Windows-Shell-Setup\" processorArchitecture=\"%s\" language=\"neutral\" " "xmlns:wcm=\"http://schemas.microsoft.com/WMIConfig/2002/State\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " "publicKeyToken=\"31bf3856ad364e35\" versionScope=\"nonSxS\">\n", xml_arch_names[arch]); - // https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-oobe-protectyourpc - // It is really super disingenuous of Microsoft to call this option "ProtectYourPC", when it's really only about - // data collection. But of course, if it was called "AllowDataCollection", everyone would turn it off... - if (flags & UNATTEND_NO_DATA_COLLECTION) { + // We should always have UNATTEND_NO_DATA_COLLECTION if UNATTEND_SILENT_INSTALL is set but whatever... + if (flags & (UNATTEND_NO_DATA_COLLECTION | UNATTEND_SILENT_INSTALL)) { uprintf("• Disable data collection"); fprintf(fd, " <OOBE>\n"); fprintf(fd, " <HideEULAPage>true</HideEULAPage>\n"); + // https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-oobe-protectyourpc + // It is really super disingenuous of Microsoft to call this option "ProtectYourPC", when it's really only about + // data collection. But of course, if it was called "AllowDataCollection", everyone would turn it off... fprintf(fd, " <ProtectYourPC>3</ProtectYourPC>\n"); + // Without these, the "Let's connect you to a network" can appear in silent installs when Ethernet is disconnected. + if (flags & UNATTEND_SILENT_INSTALL) { + fprintf(fd, " <HideOnlineAccountScreens>true</HideOnlineAccountScreens>\n"); + fprintf(fd, " <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>\n"); + } fprintf(fd, " </OOBE>\n"); } if (flags & UNATTEND_DUPLICATE_LOCALE) { From e8207ea98227764ac6290b80d67d39e9d0bd5c1e Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 1 Apr 2026 18:24:01 +0100 Subject: [PATCH 159/192] [iso] reduce the auto-expand size for El-Torito images * Well, thinking that OEMs would do the right thing and only use 0/1 as image size *if* the actual size is more than 0xffff sectors (i.e. 128 MB) was obviously never going to end well and Lenovo/Nero chose not to bother. * We therefore reduce the watershed point to 8 MB. * Also improve logging and avoid reopening an ISO. --- src/iso.c | 34 +++++++++++--------------------- src/libcdio/driver/logging.c | 3 ++- src/libcdio/iso9660/iso9660_fs.c | 17 +++++++++------- src/rufus.h | 4 ++-- src/rufus.rc | 10 +++++----- 5 files changed, 30 insertions(+), 38 deletions(-) diff --git a/src/iso.c b/src/iso.c index bc53bae8..b1e56c82 100644 --- a/src/iso.c +++ b/src/iso.c @@ -1241,7 +1241,7 @@ BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan) scan_only = scan; if (!scan_only) spacing = ""; - cdio_log_set_handler(log_handler); + cdio_log_set_handler((scan_only && !usb_debug) ? NULL : log_handler); psz_extract_dir = dest_dir; // Change progress style to marquee for scanning if (scan_only) { @@ -1427,7 +1427,7 @@ out: img_report.sl_version_str); } } - if (!IS_EFI_BOOTABLE(img_report) && HAS_EFI_IMG(img_report) && HasEfiImgBootLoaders()) { + if (!IS_EFI_BOOTABLE(img_report) && HAS_EFI_IMG(img_report) && HasEfiImgBootLoaders(p_iso)) { img_report.has_efi = 0x8000; } if (HAS_WINPE(img_report)) { @@ -1517,7 +1517,7 @@ out: static_sprintf(path, "%s\\EFI\\boot\\bootx64.efi", dest_dir); DeleteFileU(path); } - DumpFatDir(dest_dir, 0); + DumpFatDir(p_iso, dest_dir, 0); } if (HAS_SYSLINUX(img_report)) { static_sprintf(path, "%s\\syslinux.cfg", dest_dir); @@ -1847,10 +1847,10 @@ int iso9660_readfat(intptr_t pp, void *buf, size_t secsize, libfat_sector_t sec) /* * Returns TRUE if an EFI bootloader exists in the img. */ -BOOL HasEfiImgBootLoaders(void) +BOOL HasEfiImgBootLoaders(void* iso) { BOOL ret = FALSE; - iso9660_t* p_iso = NULL; + iso9660_t* p_iso = (iso9660_t*)iso; iso9660_stat_t* p_statbuf = NULL; iso9660_readfat_private* p_private = NULL; int32_t dc, c; @@ -1859,14 +1859,9 @@ BOOL HasEfiImgBootLoaders(void) char bootloader_name[16]; int i; - if ((image_path == NULL) || !HAS_EFI_IMG(img_report)) + if ((p_iso == NULL) || !HAS_EFI_IMG(img_report)) return FALSE; - p_iso = iso9660_open_ext(image_path, ISO_EXTENSION_MASK); - if (p_iso == NULL) { - uprintf("Could not open image '%s' as an ISO-9660 file system", image_path); - goto out; - } p_statbuf = iso9660_ifs_stat_translate(p_iso, img_report.efi_img_path); if (p_statbuf == NULL) { uprintf("Could not get ISO-9660 file information for file %s", img_report.efi_img_path); @@ -1932,12 +1927,11 @@ out: if (lf_fs != NULL) libfat_close(lf_fs); iso9660_stat_free(p_statbuf); - iso9660_close(p_iso); safe_free(p_private); return ret; } -BOOL DumpFatDir(const char* path, int32_t cluster) +BOOL DumpFatDir(void* iso, const char* path, int32_t cluster) { // We don't have concurrent calls to this function, so a static lf_fs is fine static struct libfat_filesystem *lf_fs = NULL; @@ -1949,7 +1943,7 @@ BOOL DumpFatDir(const char* path, int32_t cluster) libfat_diritem_t diritem = { 0 }; libfat_dirpos_t dirpos = { cluster, -1, 0 }; libfat_sector_t s; - iso9660_t* p_iso = NULL; + iso9660_t* p_iso = (iso9660_t*)iso; iso9660_stat_t* p_statbuf = NULL; iso9660_readfat_private* p_private = NULL; @@ -1958,13 +1952,8 @@ BOOL DumpFatDir(const char* path, int32_t cluster) if (cluster == 0) { // Root dir => Perform init stuff - if (image_path == NULL) + if (iso == NULL || image_path == NULL) return FALSE; - p_iso = iso9660_open_ext(image_path, ISO_EXTENSION_MASK); - if (p_iso == NULL) { - uprintf("Could not open image '%s' as an ISO-9660 file system", image_path); - goto out; - } p_statbuf = iso9660_ifs_stat_translate(p_iso, img_report.efi_img_path); if (p_statbuf == NULL) { uprintf("Could not get ISO-9660 file information for file %s", img_report.efi_img_path); @@ -2015,7 +2004,7 @@ BOOL DumpFatDir(const char* path, int32_t cluster) uprintf("Could not create directory '%s': %s", target, WindowsErrorString()); continue; } - if (!DumpFatDir(target, dirpos.cluster)) + if (!DumpFatDir(p_iso, target, dirpos.cluster)) goto out; } else if (!PathFileExistsU(target)) { // Need to figure out if it's a .conf file (Damn you Solus!!) @@ -2067,8 +2056,7 @@ out: libfat_close(lf_fs); lf_fs = NULL; } - iso9660_stat_free(p_statbuf);; - iso9660_close(p_iso); + iso9660_stat_free(p_statbuf); safe_free(p_private); } safe_closehandle(handle); diff --git a/src/libcdio/driver/logging.c b/src/libcdio/driver/logging.c index b89ab37a..ab3fd2be 100644 --- a/src/libcdio/driver/logging.c +++ b/src/libcdio/driver/logging.c @@ -120,7 +120,8 @@ cdio_logv(cdio_log_level_t level, const char format[], va_list args) vsnprintf(buf, sizeof(buf)-1, format, args); - _handler(level, buf); + if (_handler) + _handler(level, buf); in_recursion = 0; } diff --git a/src/libcdio/iso9660/iso9660_fs.c b/src/libcdio/iso9660/iso9660_fs.c index e67bada7..6abde7da 100644 --- a/src/libcdio/iso9660/iso9660_fs.c +++ b/src/libcdio/iso9660/iso9660_fs.c @@ -63,6 +63,10 @@ /* Maximum number of El-Torito boot images we keep an index for */ #define MAX_BOOT_IMAGES 8 +/* El-Torito media types, similar to what 7-zip uses in Archive/Iso/IsoIn.cpp */ +static const char* const eltorito_media_name[] = +{ "NoEmul", "1.2M", "1.44M", "2.88M", "HardDisk" }; + /** Implementation of iso9660_t type */ struct _iso9660_s { cdio_header_t header; /**< Internal header - MUST come first. */ @@ -561,12 +565,14 @@ iso9660_ifs_read_superblock (iso9660_t *p_iso, next_lsn = p_iso->boot_img[k].lsn; } /* If the image has a sector size of 0 or 1 and theres' more than */ - /* 0xffff sectors to the next LSN, assume it needs expansion. */ + /* 0x1000 sectors (8 MB) to the next LSN, assume it needs expansion. */ if (p_iso->boot_img[j].num_sectors <= 1 && - (next_lsn - p_iso->boot_img[j].lsn) >= 0x4000) { + (next_lsn - p_iso->boot_img[j].lsn) >= 0x1000) { p_iso->boot_img[j].num_sectors = - (next_lsn - p_iso->boot_img[j].lsn) * 4; -// cdio_warn("Auto-expanding the size of %d-Boot-NoEmul.img", j); + (next_lsn - p_iso->boot_img[j].lsn) * 4; + cdio_warn("Auto-expanding the size of %d-Boot-%s.img to %d KB", + j, eltorito_media_name[p_iso->boot_img[j].type], + (next_lsn - p_iso->boot_img[j].lsn) * 2); } } } @@ -1682,9 +1688,6 @@ iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[]) CdioISO9660FileList_t * iso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[]) { - /* Similar to what 7-zip uses in Archive/Iso/IsoIn.cpp */ - static const char* const eltorito_media_name[] = - { "NoEmul", "1.2M", "1.44M", "2.88M", "HardDisk" }; int i; iso9660_dir_t *p_iso9660_dir; iso9660_stat_t *p_iso9660_stat = NULL; diff --git a/src/rufus.h b/src/rufus.h index 01f5268e..faaa8ea0 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -836,8 +836,8 @@ extern BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan); extern BOOL ExtractZip(const char* src_zip, const char* dest_dir); extern int64_t ExtractISOFile(const char* iso, const char* iso_file, const char* dest_file, DWORD attributes); extern uint32_t ReadISOFileToBuffer(const char* iso, const char* iso_file, uint8_t** buf); -extern BOOL HasEfiImgBootLoaders(void); -extern BOOL DumpFatDir(const char* path, int32_t cluster); +extern BOOL HasEfiImgBootLoaders(void* iso); +extern BOOL DumpFatDir(void* iso, const char* path, int32_t cluster); extern BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int fs); extern uint16_t GetSyslinuxVersion(char* buf, size_t buf_size, char** ext); extern BOOL SetAutorun(const char* path); diff --git a/src/rufus.rc b/src/rufus.rc index b0c4289e..fa47d125 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.14.2349" +CAPTION "Rufus 4.14.2350" 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,14,2349,0 - PRODUCTVERSION 4,14,2349,0 + FILEVERSION 4,14,2350,0 + PRODUCTVERSION 4,14,2350,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.14.2349" + VALUE "FileVersion", "4.14.2350" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2349" + VALUE "ProductVersion", "4.14.2350" END END BLOCK "VarFileInfo" From b890d1562822b1d2598ef24685c6cfc5caa1ee31 Mon Sep 17 00:00:00 2001 From: Forcipal Boniness <forcipal_boniness@aleeas.com> Date: Sun, 5 Apr 2026 22:41:56 +0100 Subject: [PATCH 160/192] [loc] update Indonesian translation to latest --- res/loc/po/id-ID.po | 234 +++++++++++++++++++++++++++++++++++++++----- res/loc/rufus.loc | 45 +++++++-- src/rufus.rc | 10 +- 3 files changed, 253 insertions(+), 36 deletions(-) diff --git a/res/loc/po/id-ID.po b/res/loc/po/id-ID.po index cbb61a28..104a7a29 100644 --- a/res/loc/po/id-ID.po +++ b/res/loc/po/id-ID.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 3.22\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2023-03-16 16:28+0700\n" -"PO-Revision-Date: 2023-03-17 14:13+0000\n" +"POT-Creation-Date: 2026-04-05 13:10+0700\n" +"PO-Revision-Date: 2026-04-05 22:37+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: id_ID\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Indonesian (Bahasa Indonesia)\n" "X-Rufus-LCID: 0x0421\n" -"X-Generator: Poedit 3.2.2\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -54,13 +54,11 @@ msgstr "Daftar USB Hard Drives" msgid "Add fixes for old BIOSes (extra partition, align, etc.)" msgstr "Tambah perbaikan untuk BIOS lama (partisi ekstra, penyesuaian, dll.)" -#. • IDD_DIALOG → IDC_RUFUS_MBR +#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION #. -#. 'MBR': See http://en.wikipedia.org/wiki/Master_boot_record -#. Rufus can install it's own custom MBR (the Rufus MBR), which also allows users to -#. specify a custom disk ID for the BIOS. The tooltip for this control is MSG_167. -msgid "Use Rufus MBR with BIOS ID" -msgstr "Gunakan MBR Rufus dengan ID BIOS" +#. It is acceptable to drop the "runtime" if you are running out of space +msgid "Enable runtime UEFI media validation" +msgstr "Aktifkan validasi media UEFI runtime" #. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT msgid "Format Options" @@ -72,7 +70,7 @@ msgstr "Sistem berkas" #. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT msgid "Cluster size" -msgstr "Ukuran klatser" +msgstr "Ukuran klaster" #. • IDD_DIALOG → IDS_LABEL_TXT msgid "Volume label" @@ -310,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -698,7 +696,7 @@ msgid "" "\n" "Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically." msgstr "" -"%s atau yang lebih baru memerlukan berkas '%s' untuk diinstal.\n" +"%s atau yang lebih baru memerlukan berkas '%s' untuk diinstal.\n" "Karena berkas ini berukuran lebih dari 100 KB, dan selalu ada pada ISO images %s, berkas ini tidak tersematkan didalam Rufus.\n" "\n" "Rufus dapat mengunduh berkas yang hilang ini untuk Anda:\n" @@ -848,7 +846,7 @@ msgstr "Tanpa persisten" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Atur ukuran partisi persisten untuk media USB live. Mengatur ukuran ke 0 akan menonaktifkan partisi persisten." @@ -890,7 +888,7 @@ msgstr "Program atau proses lain sedang mengakses drive ini. Apakah Anda tetap i #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" @@ -1043,16 +1041,8 @@ msgid "Check this box to allow the display of international labels and set a dev msgstr "Centang kotak ini untuk menampilkan label internasional dan menyetel ikon perangkat (membuat autorun.inf)" #. • MSG_167 -msgid "Install an MBR that allows boot selection and can masquerade the BIOS USB drive ID" -msgstr "Menginstal MBR memungkinkan untuk boot dan dapat memanipulasi ID perangkat USB di BIOS" - -#. • MSG_168 -msgid "" -"Try to masquerade first bootable USB drive (usually 0x80) as a different disk.\n" -"This should only be necessary if you install Windows XP and have more than one disk." -msgstr "" -"Mencoba menyamarkan perangkat USB bootable pertama (biasanya 0x80) sebagai disk yang berbeda.\n" -"Biasanya hanya diperlukan jika Anda memasang Windows XP dan memiliki lebih dari satu disk." +msgid "Install a UEFI bootloader, that will perform MD5Sum file validation of the media" +msgstr "Instal bootloader UEFI yang akan memvalidasi MD5Sum dari media" #. • MSG_169 msgid "" @@ -1802,6 +1792,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Tidak dapat membuka atau membaca '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Aktifkan SkuSiPolicy.p7b ketika instalasi (lihat KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Peningkatan QoL (Tidak memaksakan Copilot, OneDrive, Outlook, Fast Startup, dll.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Menerapkan kustomisasi Windows: %s" @@ -1850,6 +1848,192 @@ msgstr "Matikan enkripsi perangkat otomatis BitLocker" msgid "Persistent log" msgstr "Catatan yang tetap/persistent" +#. • MSG_337 +msgid "" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" +"- Select 'Yes' to connect to the Internet and download it\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The file will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Berkas tambahan ('%s') dari Microsoft diperlukan untuk menggunakan fitur tersebut\n" +"- Pilih 'Ya' untuk mengunduh\n" +"- Pilih 'Tidak' untuk membatalkan\n" +"\n" +"Catatan: Berkas tersebut akan disimpan pada folder aplikasi dan akan digunakan di kemudian hari secara otomatis." + +#. • MSG_338 +msgid "Revoked UEFI bootloader detected" +msgstr "Terdeteksi pembatalan bootloader UEFI" + +#. • MSG_339 +msgid "" +"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\n" +"\n" +"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\n" +"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning." +msgstr "" +"Rufus mendeteksi bahwa ISO yang dipilih terdapat bootloader UEFI yang dibatalkan dan dapat memberikan peringatan %s, ketika Secure Boot diaktifkan pada UEFI system terbaru.\n" +"\n" +"- Kalau berkas ISO ini didapatkan dari sumber yang tidak terpercaya, terdapat kemungkinan ada malware UEFI dan hindarilah menggunakan image ini.\n" +"- Kalau berkas ISO ini didapatkan dari sumber yang terpercaya, carilah versi yang lebih baru yang tidak memberikan peringatan ini." + +#. • MSG_340 +msgid "a \"Security Violation\" screen" +msgstr "layar \"Security Violation\"" + +#. • MSG_341 +msgid "a Windows Recovery Screen (BSOD) with '%s'" +msgstr "Windows Recovery Screen (BSOD) dengan '%s'" + +#. • MSG_342 +msgid "Compressed VHDX Image" +msgstr "VHDX Image terkompresi" + +#. • MSG_343 +msgid "Uncompressed VHD Image" +msgstr "VHDX Image tidak terkompresi" + +#. • MSG_344 +msgid "Full Flash Update Image" +msgstr "Full Flash Update Image" + +#. • MSG_345 +msgid "" +"Some additional data must be downloaded from Microsoft to use this functionality:\n" +"- Select 'Yes' to connect to the Internet and download it\n" +"- Select 'No' to cancel the operation" +msgstr "" +"Data tambahan perlu diunduh dari Microsoft untuk menggunakan fungsi ini:\n" +"- Pilih 'Ya' untuk menyambungkan ke Internet dan mencoba untuk mengunduhnya\n" +"- Pilih 'Tidak' untuk membatalkan operasi" + +#. • MSG_346 +msgid "Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)" +msgstr "Batasi Windows menjadi S-Mode (TIDAK KOMPATIBEL dengan bypass akun online)" + +#. • MSG_347 +msgid "Expert Mode" +msgstr "Mode Expert" + +#. • MSG_348 +msgid "Extracting archive files: %s" +msgstr "Mengekstrak berkas arsip: %s" + +#. • MSG_349 +msgid "Use Rufus MBR" +msgstr "Gunakan Rufus MBR" + +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Gunakan bootloader 'Windows CA 2023' (Membutuhkan PC yang kompatibel)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Sedang cek pembatalan bootloader UEFI..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Sedang cek pembaruan UEFI DBX..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "Pembaruan DBX tersedia" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus menemukan pembaruan berkas DBX yang digunakan untuk mengecek pembatalan UEFI Secure Boot. Apakah anda ingin mengunduhnya?\n" +"- Pilih 'Ya' untuk menyambungkan ke Internet dan mencoba untuk mengunduhnya\n" +"- Pilih 'Tidak' untuk membatalkan operasi" + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "Hapus disk secara ⚠SILENT⚠ dan instal:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Anda memilih untuk menggunakan opsi instalasi Windows secara \"silent\".\n" +"\n" +"Ini adalah pilihan lanjutan, yang diperuntukkan untuk membuat media yang tidak memberikan pilihan ketika instalasi Windows dan akan MENGHAPUS TANPA TERKECUALI disk yang terdeteksi pertama kali pada system. Kalau tidak berhati-hati, menggunakan pilihan ini akan menyebabkan KEHILANGAN DATA PERMANEN!\n" +"\n" +"Kalau Anda tidak menginginkan ini, pilih 'Tidak' untuk kembali dan membatalkan pilihan tersebut.\n" +"Kalau Anda memilih 'Ya', Anda yakin dan bertanggungjawab untuk kehilangan data yang terjadi." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Anda tidak dapat menggunakan berkas image yang terletak pada penyimpanan tujuan, karena penyimpanan tersebut akan dihapus seluruhnya.\n" +"\n" +"Tolong pindahkan berkas image tersebut ke lokasi yang lain dan coba lagi." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Pilihan ini aman untuk digunakan walaupun terdapat TPM atau RAM berlebih, karena pilihan ini hanya melewati persyaratan awal dan tidak menghentikan Windows untuk menggunakan seluruh hardware yang tersedia." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Supaya pilihan ini dapat digunakan, Anda HARUS memutuskan Internet ketika instalasi~" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Secara otomatis akan memilih 'Tidak' pada pertanyaan setup Windows terkait dengan pembagian data dengan Microsoft, tanpa menanyakan pada user." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Anda sebaiknya menyalakan opsi ini, kecuali jika Anda ingin 'Windows To Go' untuk mengakses disk internal dan melakukan pembaruan sistem yang tidak dapat diubah secara diam-diam." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Buat akun local dengan nama user pilihan, menggunakan password kosong yang perlu diubah di proses logon selanjutnya." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Gunakan pengaturan regional dari PC ini (keyboard, zona waktu, mata uang), tanpa menanyakan kepada user." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Tidak mengenkripsi disk sistem, kecuali diminta oleh user." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Gunakan pilihan ini jika Anda mengetahui S-Mode dan mengerti bahwa sistem Anda akan dikunci menjadi S-Mode walaupun sudah menghapus dan instal ulang Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Gunakan pilihan ini jika Anda ingin menginstal Windows menggunakan sertifikat Secure Boot terbaru. Jika dibutuhkan, Anda dapat menggunakan 'Mosby\" untuk memperbarui sistem." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Gunakan pilihan ini jika Anda ingin membatalkan penggunaan bootloader Windows yang tidak aman, tapi dengan potensi mencegah media Windows standar untuk booting." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Peningkatan \"Quality of Life\": menonaktifkan fitur Microsoft yang tidak diinginkan." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Jika Anda menggunakan pilihan ini, mohon untuk mencabut semua disk dari PC tujuan agar tidak terjadi kehilangan data, kecuali disk yang digunakan untuk menginstal Windows." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 5f56a9af..1cb65bc2 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -18,7 +18,7 @@ # • v4.5 "el-GR" "Greek (Ελληνικά)" # • v4.14 "he-IL" "Hebrew (עברית)" # • v4.14 "hu-HU" "Hungarian (Magyar)" -# • v3.22 "id-ID" "Indonesian (Bahasa Indonesia)" +# • v4.14 "id-ID" "Indonesian (Bahasa Indonesia)" # • v4.5 "it-IT" "Italian (Italiano)" # • v4.5 "ja-JP" "Japanese (日本語)" # • v4.5 "ko-KR" "Korean (한국어)" @@ -6721,7 +6721,7 @@ t MSG_922 "UEFI Shell ISO képfájlok letöltése" ######################################################################### l "id-ID" "Indonesian (Bahasa Indonesia)" 0x0421 -v 3.22 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -6739,10 +6739,10 @@ t IDS_PARTITION_TYPE_TXT "Skema partisi" t IDS_TARGET_SYSTEM_TXT "Sistem target" t IDC_LIST_USB_HDD "Daftar USB Hard Drives" t IDC_OLD_BIOS_FIXES "Tambah perbaikan untuk BIOS lama (partisi ekstra, penyesuaian, dll.)" -t IDC_UEFI_MEDIA_VALIDATION "Aktifkan validasi media UEFI waktu proses" +t IDC_UEFI_MEDIA_VALIDATION "Aktifkan validasi media UEFI runtime" t IDS_FORMAT_OPTIONS_TXT "Opsi Format" t IDS_FILE_SYSTEM_TXT "Sistem berkas" -t IDS_CLUSTER_SIZE_TXT "Ukuran klatser" +t IDS_CLUSTER_SIZE_TXT "Ukuran klaster" t IDS_LABEL_TXT "Label volume" t IDC_QUICK_FORMAT "Format cepat" t IDC_BAD_BLOCKS "Periksa blok buruk pada perangkat" @@ -6935,8 +6935,7 @@ t MSG_163 "Metode yang akan digunakan untuk membuat partisi" t MSG_164 "Metode yang akan digunakan untuk membuat perangkat bootable" t MSG_165 "Klik untuk memilih sebuah image..." t MSG_166 "Centang kotak ini untuk menampilkan label internasional dan menyetel ikon perangkat (membuat autorun.inf)" -t MSG_167 "Menginstal MBR memungkinkan untuk boot dan dapat memanipulasi ID perangkat USB di BIOS" -t MSG_168 "Mencoba menyamarkan perangkat USB bootable pertama (biasanya 0x80) sebagai disk yang berbeda.\nBiasanya hanya diperlukan jika Anda memasang Windows XP dan memiliki lebih dari satu disk." +t MSG_167 "Instal bootloader UEFI yang akan memvalidasi MD5Sum dari media" t MSG_169 "Membuat partisi tersembunyi tambahan dan memcoba menyelaraskan batas partisi.\nUpaya ini dapat memperbaiki deteksi boot bagi BIOS versi lama." t MSG_170 "Aktifkan pencantuman USB Hard Drive enclosures. RESIKO DITANGGUNG ANDA SENDIRI!!!" t MSG_171 "Mulai operasi format.\nTindakan ini akan MENGHAPUS semua data pada target!" @@ -7088,6 +7087,8 @@ t MSG_319 "Abaikan Penanda Boot" t MSG_320 "Menyegarkan tata letak partisi (%s)..." t MSG_321 "Gambar yang Anda pilih adalah ISOHybrid, tetapi pembuatnya belum membuatnya kompatibel dengan mode salin ISO/Berkas.\nAkibatnya, mode penulisan DD image akan diberlakukan." t MSG_322 "Tidak dapat membuka atau membaca '%s'" +t MSG_323 "Aktifkan SkuSiPolicy.p7b ketika instalasi (lihat KB5042562)" +t MSG_324 "Peningkatan QoL (Tidak memaksakan Copilot, OneDrive, Outlook, Fast Startup, dll.)" t MSG_325 "Menerapkan kustomisasi Windows: %s" t MSG_326 "Menerapkan pilihan pengguna..." t MSG_327 "Pengalaman Pengguna Windows" @@ -7100,6 +7101,38 @@ t MSG_333 "Buat akun lokal dengan username:" t MSG_334 "Atur pilihan wilayah sama seperti pengguna saat ini" t MSG_335 "Matikan enkripsi perangkat otomatis BitLocker" t MSG_336 "Catatan yang tetap/persistent" +t MSG_337 "Berkas tambahan ('%s') dari Microsoft diperlukan untuk menggunakan fitur tersebut\n- Pilih 'Ya' untuk mengunduh\n- Pilih 'Tidak' untuk membatalkan\n\nCatatan: Berkas tersebut akan disimpan pada folder aplikasi dan akan digunakan di kemudian hari secara otomatis." +t MSG_338 "Terdeteksi pembatalan bootloader UEFI" +t MSG_339 "Rufus mendeteksi bahwa ISO yang dipilih terdapat bootloader UEFI yang dibatalkan dan dapat memberikan peringatan %s, ketika Secure Boot diaktifkan pada UEFI system terbaru.\n\n- Kalau berkas ISO ini didapatkan dari sumber yang tidak terpercaya, terdapat kemungkinan ada malware UEFI dan hindarilah menggunakan image ini.\n- Kalau berkas ISO ini didapatkan dari sumber yang terpercaya, carilah versi yang lebih baru yang tidak memberikan peringatan ini." +t MSG_340 "layar \"Security Violation\"" +t MSG_341 "Windows Recovery Screen (BSOD) dengan '%s'" +t MSG_342 "VHDX Image terkompresi" +t MSG_343 "VHDX Image tidak terkompresi" +t MSG_345 "Data tambahan perlu diunduh dari Microsoft untuk menggunakan fungsi ini:\n- Pilih 'Ya' untuk menyambungkan ke Internet dan mencoba untuk mengunduhnya\n- Pilih 'Tidak' untuk membatalkan operasi" +t MSG_346 "Batasi Windows menjadi S-Mode (TIDAK KOMPATIBEL dengan bypass akun online)" +t MSG_347 "Mode Expert" +t MSG_348 "Mengekstrak berkas arsip: %s" +t MSG_349 "Gunakan Rufus MBR" +t MSG_350 "Gunakan bootloader 'Windows CA 2023' (Membutuhkan PC yang kompatibel)" +t MSG_351 "Sedang cek pembatalan bootloader UEFI..." +t MSG_352 "Sedang cek pembaruan UEFI DBX..." +t MSG_353 "Pembaruan DBX tersedia" +t MSG_354 "Rufus menemukan pembaruan berkas DBX yang digunakan untuk mengecek pembatalan UEFI Secure Boot. Apakah anda ingin mengunduhnya?\n- Pilih 'Ya' untuk menyambungkan ke Internet dan mencoba untuk mengunduhnya\n- Pilih 'Tidak' untuk membatalkan operasi" +t MSG_355 "Hapus disk secara ⚠SILENT⚠ dan instal:" +t MSG_356 "Anda memilih untuk menggunakan opsi instalasi Windows secara \"silent\".\n\nIni adalah pilihan lanjutan, yang diperuntukkan untuk membuat media yang tidak memberikan pilihan ketika instalasi Windows dan akan MENGHAPUS TANPA TERKECUALI disk yang terdeteksi pertama kali pada system. Kalau tidak berhati-hati, menggunakan pilihan ini akan menyebabkan KEHILANGAN DATA PERMANEN!\n\nKalau Anda tidak menginginkan ini, pilih 'Tidak' untuk kembali dan membatalkan pilihan tersebut.\nKalau Anda memilih 'Ya', Anda yakin dan bertanggungjawab untuk kehilangan data yang terjadi." +t MSG_359 "Anda tidak dapat menggunakan berkas image yang terletak pada penyimpanan tujuan, karena penyimpanan tersebut akan dihapus seluruhnya.\n\nTolong pindahkan berkas image tersebut ke lokasi yang lain dan coba lagi." +t MSG_360 "Pilihan ini aman untuk digunakan walaupun terdapat TPM atau RAM berlebih, karena pilihan ini hanya melewati persyaratan awal dan tidak menghentikan Windows untuk menggunakan seluruh hardware yang tersedia." +t MSG_361 "Supaya pilihan ini dapat digunakan, Anda HARUS memutuskan Internet ketika instalasi~" +t MSG_362 "Secara otomatis akan memilih 'Tidak' pada pertanyaan setup Windows terkait dengan pembagian data dengan Microsoft, tanpa menanyakan pada user." +t MSG_363 "Anda sebaiknya menyalakan opsi ini, kecuali jika Anda ingin 'Windows To Go' untuk mengakses disk internal dan melakukan pembaruan sistem yang tidak dapat diubah secara diam-diam." +t MSG_364 "Buat akun local dengan nama user pilihan, menggunakan password kosong yang perlu diubah di proses logon selanjutnya." +t MSG_365 "Gunakan pengaturan regional dari PC ini (keyboard, zona waktu, mata uang), tanpa menanyakan kepada user." +t MSG_366 "Tidak mengenkripsi disk sistem, kecuali diminta oleh user." +t MSG_367 "Gunakan pilihan ini jika Anda mengetahui S-Mode dan mengerti bahwa sistem Anda akan dikunci menjadi S-Mode walaupun sudah menghapus dan instal ulang Windows." +t MSG_368 "Gunakan pilihan ini jika Anda ingin menginstal Windows menggunakan sertifikat Secure Boot terbaru. Jika dibutuhkan, Anda dapat menggunakan 'Mosby\" untuk memperbarui sistem." +t MSG_369 "Gunakan pilihan ini jika Anda ingin membatalkan penggunaan bootloader Windows yang tidak aman, tapi dengan potensi mencegah media Windows standar untuk booting." +t MSG_370 "Peningkatan \"Quality of Life\": menonaktifkan fitur Microsoft yang tidak diinginkan." +t MSG_371 "Jika Anda menggunakan pilihan ini, mohon untuk mencabut semua disk dari PC tujuan agar tidak terjadi kehilangan data, kecuali disk yang digunakan untuk menginstal Windows." t MSG_900 "Rufus adalah alat yang membantu untuk memformat dan membuat perangkat USB flash menjadi bootable, seperti USB flashdisk, kartu memori, dll." t MSG_901 "Situs resmi: %s" t MSG_902 "Kode Sumber: %s" diff --git a/src/rufus.rc b/src/rufus.rc index fa47d125..daab8ee1 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.14.2350" +CAPTION "Rufus 4.14.2351" 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,14,2350,0 - PRODUCTVERSION 4,14,2350,0 + FILEVERSION 4,14,2351,0 + PRODUCTVERSION 4,14,2351,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.14.2350" + VALUE "FileVersion", "4.14.2351" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2350" + VALUE "ProductVersion", "4.14.2351" END END BLOCK "VarFileInfo" From 9cdaa1037511a893bb136e7114ebaa9529e337fe Mon Sep 17 00:00:00 2001 From: Marcos Mello <marcosfrm@gmail.com> Date: Sun, 5 Apr 2026 22:46:18 +0100 Subject: [PATCH 161/192] [loc] update Brazilian Portuguese translation to latest --- res/loc/po/pt-BR.po | 142 ++++++++++++++++++++++++++++++++++++++++---- res/loc/rufus.loc | 29 ++++++++- src/rufus.rc | 10 ++-- 3 files changed, 163 insertions(+), 18 deletions(-) diff --git a/res/loc/po/pt-BR.po b/res/loc/po/pt-BR.po index 4b329f2e..9a9a6a67 100644 --- a/res/loc/po/pt-BR.po +++ b/res/loc/po/pt-BR.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-05-01 14:24-0300\n" -"PO-Revision-Date: 2024-05-04 12:06+0100\n" +"POT-Creation-Date: 2026-04-05 16:42-0300\n" +"PO-Revision-Date: 2026-04-05 22:44+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: pt_BR\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Portuguese Brazilian (Português do Brasil)\n" "X-Rufus-LCID: 0x0416\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -849,7 +849,7 @@ msgstr "Sem persistência" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Defina o tamanho da partição persistente para mídia USB ativa. Definir o tamanho como 0 desativa a partição persistente." @@ -891,14 +891,16 @@ msgstr "Outro programa ou processo está acessando esta unidade. Você quer form #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" "Rufus detectou que você está tentando criar uma mídia do Windows To Go com base em uma ISO 1809.\n" -"Devido a um *MICROSOFT BUG*, esta mídia irá travar durante a inicialização do Windows (Tela Azul da Morte), a menos que você substitua manualmente o arquivo 'WppRecorder.sys' por uma versão 1803.\n" +"\n" +"Devido a um *BUG DA MICROSOFT*, esta mídia irá travar durante a inicialização do Windows (Tela Azul da Morte), a menos que você substitua manualmente o arquivo 'WppRecorder.sys' por uma versão 1803.\n" +"\n" "Observe também que a razão pela qual o Rufus não pode corrigir isso automaticamente para você é que 'WppRecorder.sys' é um arquivo protegido por direitos autorais da Microsoft, portanto, não podemos incorporar legalmente uma cópia do arquivo no aplicativo..." #. • MSG_134 @@ -1796,6 +1798,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Impossível abrir ou ler '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Aplicar SkuSiPolicy.p7b na instalação (Ver KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Melhorias QoL (Não forçar Copilot, OneDrive, Outlook, Fast Startup, etc.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Aplicando a personalização do Windows: %s" @@ -1846,13 +1856,13 @@ msgstr "Registo persistente" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Um arquivo adicional ('diskcopy.dll') precisa ser baixado da Microsoft para instalar o MS-DOS:\n" +"Um arquivo adicional ('%s') precisa ser baixado da Microsoft para usar este recurso:\n" "- Selecione 'Sim' para se conectar à Internet e baixá-lo\n" "- Selecione 'Não' para cancelar a operação\n" "\n" @@ -1920,6 +1930,118 @@ msgstr "Extraindo arquivos: %s" msgid "Use Rufus MBR" msgstr "Usar MBR do Rufus" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Usar carregadores de inicialização assinados com 'Windows CA 2023' (Requer um PC de destino compatível)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Verificando revogação de carregadores de inicialização UEFI..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Verificando atualizações do UEFI DBX..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "Atualização do DBX disponível" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus encontrou uma versão atualizada dos arquivos DBX usados para realizar verificações de revogação do UEFI Secure Boot. Você quer baixar esta atualização?\n" +"- Selecione 'Sim' para se conectar à Internet e baixar este conteúdo\n" +"- Selecione 'Não' para cancelar a operação\n" +"\n" +"Nota: Os arquivos serão baixados no diretório da aplicação e serão reutilizados automaticamente caso presentes." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠SILENCIOSAMENTE⚠ apagar o disco e instalar:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Você selecionou a opção de instalação \"silenciosa\" do Windows.\n" +"\n" +"Esta é uma opção avançada, reservada para quem pretende criar uma mídia que não questiona o usuário durante a instalação do Windows e que, portanto, INCONDICIONALMENTE APAGA o primeiro disco detectado no sistema de destino. Se você não for cuidadoso, usar esta opção pode resultar em PERDA IRREVERSÍVEL DE DADOS!\n" +"\n" +"Se não for isso que você deseja, por favor selecione 'Não' para voltar atrás e desmarcar a opção.\n" +"Do contrário, se você selecionar 'Sim', concorda que toda a responsabilidade por qualquer perda de dados será inteiramente SUA." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Localização da imagem não suportada" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Você não pode usar uma imagem que está localizada na unidade de destino, já que a unidade será completamente apagada. É a mesma coisa que tentar serrar o galho em que você está sentado!\n" +"\n" +"Por favor mova a imagem para um local diferente e tente novamente." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "É seguro deixar esta opção ativada mesmo que você tenha um TPM ou mais RAM, visto que esta opção apenas ignora os requisitos e não impede, de fato, que o Windows utilize todo o hardware disponível." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Para esta opção funcionar, a rede/Internet PRECISA ser desconectada durante a instalação!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Responde automaticamente 'não' às perguntas da instalação do Windows relacionadas ao compartilhamento de dados com a Microsoft em vez de solicitar confirmação do usuário." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Você deve deixar esta opção ativada a menos que não se importe com o 'Windows To Go' acessando os discos internos e realizando silenciosamente atualizações irreversíveis no sistema de arquivos." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Cria automaticamente uma conta local com o nome de usuário especificado, usando uma senha em branco que deverá ser alterada no próximo logon." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Duplica as opções regionais deste PC (teclado, fuso horário, moeda), ao invés de pedir confirmação do usuário." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Não encripta o disco do sistema, a menos que explicitamente solicitado pelo usuário." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Use esta opção apenas se você souber o que é o modo S e compreender que seu sistema poderá ficar travado no modo S mesmo depois de apagar completamente e reinstalar o Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Use esta opção se o sistema onde você pretende instalar o Windows está usando certificados atualizados do Secure Boot. Se necessário, você pode considerar usar o 'Mosby' para atualizar seu sistema." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Use esta opção se você quiser revogar carregadores de inicialização do Windows adicionais potencialmente inseguros, mas com o risco de também impedir que mídias padrão do Windows iniciem." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Melhorias \"Quality of Life\": Desativa a maioria dos recursos indesejados que a Microsoft está tentando forçar sobre os usuários." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Se você usar esta opção, por favor certifique-se de desconectar todos os discos do PC de destino, exceto aquele em que deseja instalar o Windows, bem como não deixar a mídia conectada em qualquer PC que você não queira apagar." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 1cb65bc2..b19222a7 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -28,7 +28,7 @@ # • v4.5 "nb-NO" "Norwegian (Norsk)" # • v4.5 "fa-IR" "Persian (پارسی)" # • v4.5 "pl-PL" "Polish (Polski)" -# • v4.5 "pt-BR" "Portuguese Brazilian (Português do Brasil)" +# • v4.14 "pt-BR" "Portuguese Brazilian (Português do Brasil)" # • v4.14 "pt-PT" "Portuguese Standard (Português)" # • v4.5 "ro-RO" "Romanian (Română)" # • v4.14 "ru-RU" "Russian (Русский)" @@ -10930,7 +10930,7 @@ t MSG_922 "Ściągnij obrazy ISO UEFI Shell" ######################################################################### l "pt-BR" "Portuguese Brazilian (Português do Brasil)" 0x0416 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -11113,7 +11113,7 @@ t MSG_129 "Você acabou de criar uma mídia que usa o carregador de inicializaç t MSG_130 "Seleção de imagem do Windows" t MSG_131 "Este ISO contém várias imagens do Windows.\nPor favor, selecione a imagem que você deseja usar para esta instalação:" t MSG_132 "Outro programa ou processo está acessando esta unidade. Você quer formatá-lo mesmo assim?" -t MSG_133 "Rufus detectou que você está tentando criar uma mídia do Windows To Go com base em uma ISO 1809.\nDevido a um *MICROSOFT BUG*, esta mídia irá travar durante a inicialização do Windows (Tela Azul da Morte), a menos que você substitua manualmente o arquivo 'WppRecorder.sys' por uma versão 1803.\nObserve também que a razão pela qual o Rufus não pode corrigir isso automaticamente para você é que 'WppRecorder.sys' é um arquivo protegido por direitos autorais da Microsoft, portanto, não podemos incorporar legalmente uma cópia do arquivo no aplicativo..." +t MSG_133 "Rufus detectou que você está tentando criar uma mídia do Windows To Go com base em uma ISO 1809.\n\nDevido a um *BUG DA MICROSOFT*, esta mídia irá travar durante a inicialização do Windows (Tela Azul da Morte), a menos que você substitua manualmente o arquivo 'WppRecorder.sys' por uma versão 1803.\n\nObserve também que a razão pela qual o Rufus não pode corrigir isso automaticamente para você é que 'WppRecorder.sys' é um arquivo protegido por direitos autorais da Microsoft, portanto, não podemos incorporar legalmente uma cópia do arquivo no aplicativo..." t MSG_134 "Como o MBR foi selecionado para o esquema de partição, o Rufus só pode criar uma partição de até 2 TB nessa mídia, o que deixará %s de espaço em disco indisponível.\n\nVocê tem certeza que quer continuar?" t MSG_135 "Versão" t MSG_136 "Lançamento" @@ -11300,6 +11300,8 @@ t MSG_319 "Ignorar marcador de inicialização" t MSG_320 "Atualizando o layout da partição (%s)..." t MSG_321 "A imagem que você selecionou é uma ISOHybrid, mas os criadores não a tornaram compatível com o modo de cópia ISO/Arquivo.\nComo resultado, o modo de gravação de imagem DD será aplicado." t MSG_322 "Impossível abrir ou ler '%s'" +t MSG_323 "Aplicar SkuSiPolicy.p7b na instalação (Ver KB5042562)" +t MSG_324 "Melhorias QoL (Não forçar Copilot, OneDrive, Outlook, Fast Startup, etc.)" t MSG_325 "Aplicando a personalização do Windows: %s" t MSG_326 "Aplicando opções do usuário..." t MSG_327 "Experiência do Usuário do Windows" @@ -11325,6 +11327,27 @@ t MSG_346 "Restringir Windows ao modo S (INCOMPATÍVEL com remoção de exigênc t MSG_347 "Modo Especialista" t MSG_348 "Extraindo arquivos: %s" t MSG_349 "Usar MBR do Rufus" +t MSG_350 "Usar carregadores de inicialização assinados com 'Windows CA 2023' (Requer um PC de destino compatível)" +t MSG_351 "Verificando revogação de carregadores de inicialização UEFI..." +t MSG_352 "Verificando atualizações do UEFI DBX..." +t MSG_353 "Atualização do DBX disponível" +t MSG_354 "Rufus encontrou uma versão atualizada dos arquivos DBX usados para realizar verificações de revogação do UEFI Secure Boot. Você quer baixar esta atualização?\n- Selecione 'Sim' para se conectar à Internet e baixar este conteúdo\n- Selecione 'Não' para cancelar a operação\n\nNota: Os arquivos serão baixados no diretório da aplicação e serão reutilizados automaticamente caso presentes." +t MSG_355 "⚠SILENCIOSAMENTE⚠ apagar o disco e instalar:" +t MSG_356 "Você selecionou a opção de instalação \"silenciosa\" do Windows.\n\nEsta é uma opção avançada, reservada para quem pretende criar uma mídia que não questiona o usuário durante a instalação do Windows e que, portanto, INCONDICIONALMENTE APAGA o primeiro disco detectado no sistema de destino. Se você não for cuidadoso, usar esta opção pode resultar em PERDA IRREVERSÍVEL DE DADOS!\n\nSe não for isso que você deseja, por favor selecione 'Não' para voltar atrás e desmarcar a opção.\nDo contrário, se você selecionar 'Sim', concorda que toda a responsabilidade por qualquer perda de dados será inteiramente SUA." +t MSG_358 "Localização da imagem não suportada" +t MSG_359 "Você não pode usar uma imagem que está localizada na unidade de destino, já que a unidade será completamente apagada. É a mesma coisa que tentar serrar o galho em que você está sentado!\n\nPor favor mova a imagem para um local diferente e tente novamente." +t MSG_360 "É seguro deixar esta opção ativada mesmo que você tenha um TPM ou mais RAM, visto que esta opção apenas ignora os requisitos e não impede, de fato, que o Windows utilize todo o hardware disponível." +t MSG_361 "Para esta opção funcionar, a rede/Internet PRECISA ser desconectada durante a instalação!" +t MSG_362 "Responde automaticamente 'não' às perguntas da instalação do Windows relacionadas ao compartilhamento de dados com a Microsoft em vez de solicitar confirmação do usuário." +t MSG_363 "Você deve deixar esta opção ativada a menos que não se importe com o 'Windows To Go' acessando os discos internos e realizando silenciosamente atualizações irreversíveis no sistema de arquivos." +t MSG_364 "Cria automaticamente uma conta local com o nome de usuário especificado, usando uma senha em branco que deverá ser alterada no próximo logon." +t MSG_365 "Duplica as opções regionais deste PC (teclado, fuso horário, moeda), ao invés de pedir confirmação do usuário." +t MSG_366 "Não encripta o disco do sistema, a menos que explicitamente solicitado pelo usuário." +t MSG_367 "Use esta opção apenas se você souber o que é o modo S e compreender que seu sistema poderá ficar travado no modo S mesmo depois de apagar completamente e reinstalar o Windows." +t MSG_368 "Use esta opção se o sistema onde você pretende instalar o Windows está usando certificados atualizados do Secure Boot. Se necessário, você pode considerar usar o 'Mosby' para atualizar seu sistema." +t MSG_369 "Use esta opção se você quiser revogar carregadores de inicialização do Windows adicionais potencialmente inseguros, mas com o risco de também impedir que mídias padrão do Windows iniciem." +t MSG_370 "Melhorias \"Quality of Life\": Desativa a maioria dos recursos indesejados que a Microsoft está tentando forçar sobre os usuários." +t MSG_371 "Se você usar esta opção, por favor certifique-se de desconectar todos os discos do PC de destino, exceto aquele em que deseja instalar o Windows, bem como não deixar a mídia conectada em qualquer PC que você não queira apagar." t MSG_900 "Rufus é um utilitário que ajuda a formatar e a criar unidades flash USB inicializáveis, tais como pendrives USB, cartões de memória, etc." t MSG_901 "Site oficial: %s" t MSG_902 "Código fonte: %s" diff --git a/src/rufus.rc b/src/rufus.rc index daab8ee1..ad38c099 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.14.2351" +CAPTION "Rufus 4.14.2352" 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,14,2351,0 - PRODUCTVERSION 4,14,2351,0 + FILEVERSION 4,14,2352,0 + PRODUCTVERSION 4,14,2352,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.14.2351" + VALUE "FileVersion", "4.14.2352" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2351" + VALUE "ProductVersion", "4.14.2352" END END BLOCK "VarFileInfo" From 355b344256dc7afe3f6d637fa41475a98ac905d6 Mon Sep 17 00:00:00 2001 From: Christos Alvanos <chrisalvanos17@gmail.com> Date: Tue, 7 Apr 2026 17:21:00 +0100 Subject: [PATCH 162/192] [loc] update Greek translation to latest --- res/loc/po/el-GR.po | 154 +++++++++++++++++++++++++++++++++++++++----- res/loc/rufus.loc | 31 +++++++-- src/rufus.rc | 10 +-- 3 files changed, 169 insertions(+), 26 deletions(-) diff --git a/res/loc/po/el-GR.po b/res/loc/po/el-GR.po index b42b11f0..4d2f7224 100644 --- a/res/loc/po/el-GR.po +++ b/res/loc/po/el-GR.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-05-09 12:52+0300\n" -"PO-Revision-Date: 2024-05-09 13:07+0300\n" +"POT-Creation-Date: 2026-04-06 20:42-0700\n" +"PO-Revision-Date: 2026-04-06 21:30-0700\n" "Last-Translator: \n" "Language-Team: \n" "Language: el_GR\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Greek (Ελληνικά)\n" "X-Rufus-LCID: 0x0408\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -115,7 +115,7 @@ msgstr "Άδεια χρήσης" #. • IDD_ABOUTBOX → IDOK msgid "OK" -msgstr "OK" +msgstr "" #. • IDD_LICENSE → IDD_LICENSE msgid "Rufus License" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -843,7 +843,7 @@ msgstr "Ανενεργό" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Ορίστε το μέγεθος του μόνιμου διαμερίσματος για USB με δυνατότητα εκκίνησης. Η ρύθμιση του μεγέθους σε 0 απενεργοποιεί το μόνιμο διαμέρισμα." @@ -885,17 +885,17 @@ msgstr "Ένα άλλο πρόγραμμα ή διαδικασία έχει πρ #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Το Rufus έχει εντοπίσει ότι προσπαθείτε να δημιουργήσετε ένα μέσο Windows To Go βάσει ενός ISO 1809.\n" +"Το Rufus εντόπισε ότι προσπαθείτε να δημιουργήσετε ένα μέσο \"Windows To Go\" με βάση ένα ISO 1809.\n" "\n" -"Λόγω ενός * MICROSOFT BUG *, αυτό το μέσο θα καταρρεύσει κατά την εκκίνηση των Windows (Blue Screen Of Death), εκτός αν αλλάξετε με το χέρι το αρχείο 'WppRecorder.sys' με εκδοχή 1803.\n" +"Λόγω ενός *ΣΦΑΛΜΑΤΟΣ ΤΗΣ MICROSOFT*, αυτό το μέσο θα παρουσιάσει σφάλμα κατά την εκκίνηση των Windows (Blue Screen of Death), εκτός εάν αντικαταστήσετε χειροκίνητα το αρχείο \"WppRecorder.sys\" με μια έκδοση 1803.\n" "\n" -"Επίσης, σημειώστε ότι ο λόγος για τον οποίο ο Rufus δεν μπορεί να διορθώσει αυτόματα αυτό για εσάς είναι ότι το \"WppRecorder.sys\" είναι αρχείο Microsoft που προστατεύεται από πνευματικά δικαιώματα, επομένως δεν μπορούμε να ενσωματώσουμε νόμιμα ένα αντίγραφο του αρχείου στην εφαρμογή ..." +"Σημειώστε επίσης ότι ο λόγος για τον οποίο ο Rufus δεν μπορεί να διορθώσει αυτόματα αυτό το πρόβλημα για εσάς είναι ότι το \"WppRecorder.sys\" είναι ένα αρχείο που προστατεύεται από πνευματικά δικαιώματα της Microsoft, επομένως δεν μπορούμε να ενσωματώσουμε νόμιμα ένα αντίγραφο του αρχείου στην εφαρμογή..." #. • MSG_134 msgid "" @@ -1792,6 +1792,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Δεν είναι δυνατό το άνοιγμα ή η ανάγνωση του '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Εφαρμογή SkuSiPolicy.p7b κατά την εγκατάσταση (Δείτε KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Βελτιώσεις QoL (χωρίς υποχρεωτική επιβολή του Copilot, του OneDrive, του Outlook, Fast Startup κ.λπ.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Εφαρμογή προσαρμογής των Windows: %s" @@ -1842,17 +1850,17 @@ msgstr "Διατήρηση log" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Πρέπει να γίνει λήψη ενός πρόσθετου αρχείου ('diskcopy.dll') από τη Microsoft για να εγκαταστήσετε το MS-DOS:\n" -"- Επιλέξτε 'Ναι' για να συνδεθείτε στο Internet και να το κατεβάσετε\n" -"- Επιλέξτε 'Όχι' για να ακυρώσετε τη λειτουργία\n" +"Πρέπει να κατεβάσετε ένα επιπλέον αρχείο ('%s') από τη Microsoft για να χρησιμοποιηθεί αυτή η λειτουργία:\n" +"-Επιλέξτε «Ναι» για να συνδεθείτε στο Internet και να το κατεβάσετε\n" +"-Επιλέξτε «Όχι» για να ακυρώσετε τη λειτουργία\n" "\n" -"Σημείωση: Το αρχείο θα ληφθεί στον κατάλογο της εφαρμογής και θα επαναχρησιμοποιηθεί αυτόματα εάν υπάρχει." +"Σημείωση: Το αρχείο θα κατέβει στον φάκελο της εφαρμογής και θα χρησιμοποιείται ξανά αυτόματα αν υπάρχει." #. • MSG_338 msgid "Revoked UEFI bootloader detected" @@ -1888,7 +1896,7 @@ msgstr "Μη συμπιεσμένη εικόνα VHDX" #. • MSG_344 msgid "Full Flash Update Image" -msgstr "Full Flash Update Image" +msgstr "" #. • MSG_345 msgid "" @@ -1916,6 +1924,118 @@ msgstr "Εξαγωγή αρχείων: %s" msgid "Use Rufus MBR" msgstr "Χρησιμοποίηση του Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Χρησιμοποιήστε bootloader υπογεγραμμένα με «Windows CA 2023» (Απαιτεί συμβατό υπολογιστή)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Έλεγχος για ανάκληση UEFI bootloader..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Έλεγχος για ενημερώσεις UEFI DBX..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "Διαθέσιμη ενημέρωση DBX" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Το Rufus εντόπισε μια ενημερωμένη έκδοση των αρχείων DBX που χρησιμοποιούνται για την εκτέλεση ελέγχων ανάκλησης UEFI Secure Boot. Θέλετε να κάνετε λήψη αυτής της ενημέρωσης;\n" +"- Επιλέξτε 'Ναι' για να συνδεθείτε στο Διαδίκτυο και να κατεβάσετε αυτό το περιεχόμενο\n" +"- Επιλέξτε 'Όχι' για να ακυρώσετε τη λειτουργία\n" +"\n" +"Σημείωση: Τα αρχεία θα ληφθούν στον κατάλογο της εφαρμογής και θα επαναχρησιμοποιηθούν αυτόματα, εάν υπάρχουν." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠ΣΙΩΠΗΛΑ⚠ διαγραφή δίσκου και εγκατάσταση:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Έχετε επιλέξει να χρησιμοποιήσετε την επιλογή \"αθόρυβης\" εγκατάστασης των Windows.\n" +"\n" +"Αυτή είναι μια προηγμένη επιλογή, που προορίζεται για άτομα που θέλουν να δημιουργήσουν μέσα που δεν ενημερώνουν τον χρήστη κατά την εγκατάσταση των Windows και επομένως ΔΙΑΓΡΑΦΟΥΝ ΑΝΕΥ ΟΡΩΝ τον πρώτο δίσκο που ανιχνεύεται στο σύστημα-στόχο. Εάν δεν είστε προσεκτικοί, η χρήση αυτής της επιλογής μπορεί να οδηγήσει σε ΜΗ ΑΝΑΣΤΡΕΨΙΜΗ ΑΠΩΛΕΙΑ ΔΕΔΟΜΕΝΩΝ!\n" +"\n" +"Εάν αυτό δεν είναι αυτό που θέλετε, επιλέξτε \"Όχι\" για να επιστρέψετε και καταργήστε την επιλογή της επιλογής.\n" +"Διαφορετικά, εάν επιλέξετε \"Ναι\", συμφωνείτε ότι ολόκληρη η ευθύνη για οποιαδήποτε απώλεια δεδομένων θα βαρύνει αποκλειστικά ΕΣΑΣ." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Μη υποστηριζόμενη τοποθεσία εικόνας" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Δεν μπορείτε να χρησιμοποιήσετε μια εικόνα που βρίσκεται στη μονάδα δίσκου προορισμού, καθώς αυτή η μονάδα δίσκου θα διαγραφεί εντελώς. Είναι το ίδιο με το να προσπαθείτε να κόψετε το κλαδί στο οποίο βρίσκεστε!\n" +"\n" +"Μετακινήστε την εικόνα σε διαφορετική θέση και προσπαθήστε ξανά." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Είναι ασφαλές να αφήσετε αυτήν την επιλογή ενεργοποιημένη ακόμα κι αν έχετε TPM ή περισσότερη μνήμη RAM, καθώς αυτή η επιλογή παρακάμπτει μόνο τις απαιτήσεις εγκατάστασης και δεν εμποδίζει στην πραγματικότητα τα Windows να χρησιμοποιούν όλο το διαθέσιμο υλικό." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Για να λειτουργήσει αυτή η επιλογή, ΠΡΕΠΕΙ να έχετε αποσυνδέσει το δίκτυο/Internet κατά την εγκατάσταση!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Απαντήστε αυτόματα με «όχι» στις ερωτήσεις εγκατάστασης των Windows σχετικά με την κοινή χρήση δεδομένων με τη Microsoft, αντί να ζητήσετε από τον χρήστη να απαντήσει." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Θα πρέπει να αφήσετε αυτήν την επιλογή ενεργοποιημένη, εκτός εάν συμφωνείτε με την πρόσβαση των \"Windows To Go\" στους εσωτερικούς δίσκους και την αθόρυβη εκτέλεση μη αναστρέψιμων αναβαθμίσεων συστήματος αρχείων." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Δημιουργήστε αυτόματα έναν τοπικό λογαριασμό με το καθορισμένο όνομα χρήστη, χρησιμοποιώντας έναν κενό κωδικό πρόσβασης που θα πρέπει να αλλάξει στην επόμενη σύνδεση." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Αντιγράψτε τις ρυθμίσεις περιοχής από αυτόν τον υπολογιστή (πληκτρολόγιο, ζώνη ώρας, νόμισμα) αντί να ζητηθεί από τον χρήστη." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Μην κρυπτογραφείτε τον δίσκο συστήματος, εκτός εάν σας το ζητήσει ρητά ο χρήστης." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Χρησιμοποιήστε αυτήν την επιλογή μόνο εάν γνωρίζετε τι είναι η λειτουργία S-Mode και κατανοείτε ότι το σύστημά σας ενδέχεται να είναι κλειδωμένο σε αυτήν ακόμα και μετά την πλήρη διαγραφή και επανεγκατάσταση των Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Χρησιμοποιήστε αυτήν την επιλογή εάν το σύστημα στο οποίο σκοπεύετε να εγκαταστήσετε τα Windows χρησιμοποιεί πλήρως ενημερωμένα πιστοποιητικά Secure Boot. Εάν χρειάζεται, μπορείτε να εξετάσετε το ενδεχόμενο χρήσης του 'Mosby' για την ενημέρωση του συστήματός σας." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Χρησιμοποιήστε αυτήν την επιλογή εάν θέλετε να ανακαλέσετε επιπλέον ενδεχομένως μη ασφαλή προγράμματα εκκίνησης των Windows, αλλά με την πιθανότητα να αποτρέψετε και την εκκίνηση τυπικών μέσων των Windows." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Βελτιώσεις «ποιότητας ζωής»: Απενεργοποιήστε τις περισσότερες ανεπιθύμητες λειτουργίες που η Microsoft προσπαθεί να επιβάλλει στους χρήστες." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Εάν χρησιμοποιήσετε αυτήν την επιλογή, βεβαιωθείτε ότι έχετε αποσυνδέσει κάθε δίσκο από τον υπολογιστή, εκτός από αυτόν στον οποίο θέλετε να εγκαταστήσετε τα Windows, και μην αφήνετε το μέσο συνδεδεμένο σε κάποιο υπολογιστή που δεν θέλετε να διαγράψετε." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index b19222a7..db117326 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -15,7 +15,7 @@ # • v4.5 "fi-FI" "Finnish (Suomi)" # • v4.14 "fr-FR" "French (Français)" # • v4.14 "de-DE" "German (Deutsch)" -# • v4.5 "el-GR" "Greek (Ελληνικά)" +# • v4.14 "el-GR" "Greek (Ελληνικά)" # • v4.14 "he-IL" "Hebrew (עברית)" # • v4.14 "hu-HU" "Hungarian (Magyar)" # • v4.14 "id-ID" "Indonesian (Bahasa Indonesia)" @@ -5405,7 +5405,7 @@ t MSG_922 "UEFI-Shell-ISOs herunterladen" ######################################################################### l "el-GR" "Greek (Ελληνικά)" 0x0408 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -5589,7 +5589,7 @@ t MSG_129 "Μόλις δημιουργήσατε ένα μέσο που χρησ t MSG_130 "Επιλογή αρχείου Windows" t MSG_131 "Αυτό το ISO περιέχει πολλά ειδώλια των Windows.\nΕπιλέξτε το αρχειο που θέλετε να χρησιμοποιήσετε για αυτήν την εγκατάσταση:" t MSG_132 "Ένα άλλο πρόγραμμα ή διαδικασία έχει πρόσβαση σε αυτήν τη μονάδα δίσκου. Θέλετε να το διαμορφώσετε ούτως ή άλλως;" -t MSG_133 "Το Rufus έχει εντοπίσει ότι προσπαθείτε να δημιουργήσετε ένα μέσο Windows To Go βάσει ενός ISO 1809.\n\nΛόγω ενός * MICROSOFT BUG *, αυτό το μέσο θα καταρρεύσει κατά την εκκίνηση των Windows (Blue Screen Of Death), εκτός αν αλλάξετε με το χέρι το αρχείο 'WppRecorder.sys' με εκδοχή 1803.\n\nΕπίσης, σημειώστε ότι ο λόγος για τον οποίο ο Rufus δεν μπορεί να διορθώσει αυτόματα αυτό για εσάς είναι ότι το \"WppRecorder.sys\" είναι αρχείο Microsoft που προστατεύεται από πνευματικά δικαιώματα, επομένως δεν μπορούμε να ενσωματώσουμε νόμιμα ένα αντίγραφο του αρχείου στην εφαρμογή ..." +t MSG_133 "Το Rufus εντόπισε ότι προσπαθείτε να δημιουργήσετε ένα μέσο \"Windows To Go\" με βάση ένα ISO 1809.\n\nΛόγω ενός *ΣΦΑΛΜΑΤΟΣ ΤΗΣ MICROSOFT*, αυτό το μέσο θα παρουσιάσει σφάλμα κατά την εκκίνηση των Windows (Blue Screen of Death), εκτός εάν αντικαταστήσετε χειροκίνητα το αρχείο \"WppRecorder.sys\" με μια έκδοση 1803.\n\nΣημειώστε επίσης ότι ο λόγος για τον οποίο ο Rufus δεν μπορεί να διορθώσει αυτόματα αυτό το πρόβλημα για εσάς είναι ότι το \"WppRecorder.sys\" είναι ένα αρχείο που προστατεύεται από πνευματικά δικαιώματα της Microsoft, επομένως δεν μπορούμε να ενσωματώσουμε νόμιμα ένα αντίγραφο του αρχείου στην εφαρμογή..." t MSG_134 "Επειδή το MBR έχει επιλεγεί για το σχήμα διαμέρισης, ο Rufus μπορεί να δημιουργήσει ένα διαμέρισμα έως 2 TB μόνο σε αυτό το μέσο, το οποίο θα αφήσει το %s χώρου στο δίσκο μη διαθέσιμο.\n\nΕίστε σίγουροι οτι θέλετε να συνεχίσετε?" t MSG_135 "Εκδοχή" t MSG_136 "Κυκλοφορία" @@ -5776,6 +5776,8 @@ t MSG_319 "Αγνοήστε τον Boot marker" t MSG_320 "Ανανέωση διάταξης διαμερισμάτων (%s)..." t MSG_321 "Η εικόνα που επιλέξατε είναι ISOHybrid, αλλά οι δημιουργοί της δεν την έχουν κάνει συμβατή με τη λειτουργία αντιγραφής ISO/Αρχείου.\nΩς αποτέλεσμα, θα επιβληθεί η λειτουργία εγγραφής εικόνας DD." t MSG_322 "Δεν είναι δυνατό το άνοιγμα ή η ανάγνωση του '%s'" +t MSG_323 "Εφαρμογή SkuSiPolicy.p7b κατά την εγκατάσταση (Δείτε KB5042562)" +t MSG_324 "Βελτιώσεις QoL (χωρίς υποχρεωτική επιβολή του Copilot, του OneDrive, του Outlook, Fast Startup κ.λπ.)" t MSG_325 "Εφαρμογή προσαρμογής των Windows: %s" t MSG_326 "Εφαρμογή επιλογών χρήστη..." t MSG_327 "Εμπειρία χρήστη των Windows" @@ -5788,7 +5790,7 @@ t MSG_333 "Δημιουργήστε έναν τοπικό λογαριασμό t MSG_334 "Ορίστε τις τοπικές επιλογές στις ίδιες τιμές με αυτές του χρήστη" t MSG_335 "Απενεργοποιήστε την αυτόματη κρυπτογράφηση συσκευής BitLocker" t MSG_336 "Διατήρηση log" -t MSG_337 "Πρέπει να κάνετε λήψη ενός επιπλέον αρχείου ('%s') από τη Microsoft για να χρησιμοποιήσετε αυτήν τη λειτουργία:\n- Επιλέξτε 'Ναι' για να συνδεθείτε στο Internet και να το κατεβάσετε\n- Επιλέξτε 'Όχι' για να ακυρώσετε τη λειτουργία\n\nΣημείωση: Το αρχείο θα ληφθεί στον κατάλογο της εφαρμογής και θα επαναχρησιμοποιηθεί αυτόματα εάν υπάρχει." +t MSG_337 "Πρέπει να κατεβάσετε ένα επιπλέον αρχείο ('%s') από τη Microsoft για να χρησιμοποιηθεί αυτή η λειτουργία:\n-Επιλέξτε «Ναι» για να συνδεθείτε στο Internet και να το κατεβάσετε\n-Επιλέξτε «Όχι» για να ακυρώσετε τη λειτουργία\n\nΣημείωση: Το αρχείο θα κατέβει στον φάκελο της εφαρμογής και θα χρησιμοποιείται ξανά αυτόματα αν υπάρχει." t MSG_338 "Εντοπίστηκε ανακληθέν bootloader UEFI" t MSG_339 "Ο Rufus εντόπισε ότι το ISO που επιλέξατε περιέχει έναν bootloader UEFI που έχει ανακληθεί και θα παράγει %s, όταν η Ασφαλής Εκκίνηση είναι ενεργοποιημένη σε ένα πλήρως ενημερωμένο σύστημα UEFI.\n\n- Εάν λάβατε αυτήν την εικόνα ISO από μη αξιόπιστη πηγή, θα πρέπει να εξετάσετε το ενδεχόμενο να περιέχει κακόβουλο λογισμικό UEFI και να αποφύγετε την εκκίνηση από αυτό.\n- Εάν το λάβατε από αξιόπιστη πηγή, θα πρέπει να προσπαθήσετε να εντοπίσετε μια πιο ενημερωμένη έκδοση, η οποία δεν θα παράγει αυτήν την προειδοποίηση." t MSG_340 "μια οθόνη \"Παραβίαση ασφαλείας\"" @@ -5800,6 +5802,27 @@ t MSG_346 "Περιορισμός των Windows σε S-Mode (ΑΣΥΜΒΑΤΟ t MSG_347 "Λειτουργία ειδικού" t MSG_348 "Εξαγωγή αρχείων: %s" t MSG_349 "Χρησιμοποίηση του Rufus MBR" +t MSG_350 "Χρησιμοποιήστε bootloader υπογεγραμμένα με «Windows CA 2023» (Απαιτεί συμβατό υπολογιστή)" +t MSG_351 "Έλεγχος για ανάκληση UEFI bootloader..." +t MSG_352 "Έλεγχος για ενημερώσεις UEFI DBX..." +t MSG_353 "Διαθέσιμη ενημέρωση DBX" +t MSG_354 "Το Rufus εντόπισε μια ενημερωμένη έκδοση των αρχείων DBX που χρησιμοποιούνται για την εκτέλεση ελέγχων ανάκλησης UEFI Secure Boot. Θέλετε να κάνετε λήψη αυτής της ενημέρωσης;\n- Επιλέξτε 'Ναι' για να συνδεθείτε στο Διαδίκτυο και να κατεβάσετε αυτό το περιεχόμενο\n- Επιλέξτε 'Όχι' για να ακυρώσετε τη λειτουργία\n\nΣημείωση: Τα αρχεία θα ληφθούν στον κατάλογο της εφαρμογής και θα επαναχρησιμοποιηθούν αυτόματα, εάν υπάρχουν." +t MSG_355 "⚠ΣΙΩΠΗΛΑ⚠ διαγραφή δίσκου και εγκατάσταση:" +t MSG_356 "Έχετε επιλέξει να χρησιμοποιήσετε την επιλογή \"αθόρυβης\" εγκατάστασης των Windows.\n\nΑυτή είναι μια προηγμένη επιλογή, που προορίζεται για άτομα που θέλουν να δημιουργήσουν μέσα που δεν ενημερώνουν τον χρήστη κατά την εγκατάσταση των Windows και επομένως ΔΙΑΓΡΑΦΟΥΝ ΑΝΕΥ ΟΡΩΝ τον πρώτο δίσκο που ανιχνεύεται στο σύστημα-στόχο. Εάν δεν είστε προσεκτικοί, η χρήση αυτής της επιλογής μπορεί να οδηγήσει σε ΜΗ ΑΝΑΣΤΡΕΨΙΜΗ ΑΠΩΛΕΙΑ ΔΕΔΟΜΕΝΩΝ!\n\nΕάν αυτό δεν είναι αυτό που θέλετε, επιλέξτε \"Όχι\" για να επιστρέψετε και καταργήστε την επιλογή της επιλογής.\nΔιαφορετικά, εάν επιλέξετε \"Ναι\", συμφωνείτε ότι ολόκληρη η ευθύνη για οποιαδήποτε απώλεια δεδομένων θα βαρύνει αποκλειστικά ΕΣΑΣ." +t MSG_358 "Μη υποστηριζόμενη τοποθεσία εικόνας" +t MSG_359 "Δεν μπορείτε να χρησιμοποιήσετε μια εικόνα που βρίσκεται στη μονάδα δίσκου προορισμού, καθώς αυτή η μονάδα δίσκου θα διαγραφεί εντελώς. Είναι το ίδιο με το να προσπαθείτε να κόψετε το κλαδί στο οποίο βρίσκεστε!\n\nΜετακινήστε την εικόνα σε διαφορετική θέση και προσπαθήστε ξανά." +t MSG_360 "Είναι ασφαλές να αφήσετε αυτήν την επιλογή ενεργοποιημένη ακόμα κι αν έχετε TPM ή περισσότερη μνήμη RAM, καθώς αυτή η επιλογή παρακάμπτει μόνο τις απαιτήσεις εγκατάστασης και δεν εμποδίζει στην πραγματικότητα τα Windows να χρησιμοποιούν όλο το διαθέσιμο υλικό." +t MSG_361 "Για να λειτουργήσει αυτή η επιλογή, ΠΡΕΠΕΙ να έχετε αποσυνδέσει το δίκτυο/Internet κατά την εγκατάσταση!" +t MSG_362 "Απαντήστε αυτόματα με «όχι» στις ερωτήσεις εγκατάστασης των Windows σχετικά με την κοινή χρήση δεδομένων με τη Microsoft, αντί να ζητήσετε από τον χρήστη να απαντήσει." +t MSG_363 "Θα πρέπει να αφήσετε αυτήν την επιλογή ενεργοποιημένη, εκτός εάν συμφωνείτε με την πρόσβαση των \"Windows To Go\" στους εσωτερικούς δίσκους και την αθόρυβη εκτέλεση μη αναστρέψιμων αναβαθμίσεων συστήματος αρχείων." +t MSG_364 "Δημιουργήστε αυτόματα έναν τοπικό λογαριασμό με το καθορισμένο όνομα χρήστη, χρησιμοποιώντας έναν κενό κωδικό πρόσβασης που θα πρέπει να αλλάξει στην επόμενη σύνδεση." +t MSG_365 "Αντιγράψτε τις ρυθμίσεις περιοχής από αυτόν τον υπολογιστή (πληκτρολόγιο, ζώνη ώρας, νόμισμα) αντί να ζητηθεί από τον χρήστη." +t MSG_366 "Μην κρυπτογραφείτε τον δίσκο συστήματος, εκτός εάν σας το ζητήσει ρητά ο χρήστης." +t MSG_367 "Χρησιμοποιήστε αυτήν την επιλογή μόνο εάν γνωρίζετε τι είναι η λειτουργία S-Mode και κατανοείτε ότι το σύστημά σας ενδέχεται να είναι κλειδωμένο σε αυτήν ακόμα και μετά την πλήρη διαγραφή και επανεγκατάσταση των Windows." +t MSG_368 "Χρησιμοποιήστε αυτήν την επιλογή εάν το σύστημα στο οποίο σκοπεύετε να εγκαταστήσετε τα Windows χρησιμοποιεί πλήρως ενημερωμένα πιστοποιητικά Secure Boot. Εάν χρειάζεται, μπορείτε να εξετάσετε το ενδεχόμενο χρήσης του 'Mosby' για την ενημέρωση του συστήματός σας." +t MSG_369 "Χρησιμοποιήστε αυτήν την επιλογή εάν θέλετε να ανακαλέσετε επιπλέον ενδεχομένως μη ασφαλή προγράμματα εκκίνησης των Windows, αλλά με την πιθανότητα να αποτρέψετε και την εκκίνηση τυπικών μέσων των Windows." +t MSG_370 "Βελτιώσεις «ποιότητας ζωής»: Απενεργοποιήστε τις περισσότερες ανεπιθύμητες λειτουργίες που η Microsoft προσπαθεί να επιβάλλει στους χρήστες." +t MSG_371 "Εάν χρησιμοποιήσετε αυτήν την επιλογή, βεβαιωθείτε ότι έχετε αποσυνδέσει κάθε δίσκο από τον υπολογιστή, εκτός από αυτόν στον οποίο θέλετε να εγκαταστήσετε τα Windows, και μην αφήνετε το μέσο συνδεδεμένο σε κάποιο υπολογιστή που δεν θέλετε να διαγράψετε." t MSG_900 "Το Rufus είναι ένα βοηθητικό πρόγραμμα που βοηθά στη διαμόρφωση και τη δημιουργία μονάδων flash USB με δυνατότητα εκκίνησης, όπως κλειδιά USB/pendrives,κάρτες μνήμης κ.λπ." t MSG_901 "Επίσημος ιστότοπος: %s" t MSG_902 "Πηγαίος κώδικας: %s" diff --git a/src/rufus.rc b/src/rufus.rc index ad38c099..841e863e 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.14.2352" +CAPTION "Rufus 4.14.2353" 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,14,2352,0 - PRODUCTVERSION 4,14,2352,0 + FILEVERSION 4,14,2353,0 + PRODUCTVERSION 4,14,2353,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.14.2352" + VALUE "FileVersion", "4.14.2353" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2352" + VALUE "ProductVersion", "4.14.2353" END END BLOCK "VarFileInfo" From 6d7d469b688e2f6c1dd73f3989c1b8d0b32b7827 Mon Sep 17 00:00:00 2001 From: Mike Handberg Hovedskov <mikehovedskov@gmail.com> Date: Tue, 7 Apr 2026 17:23:54 +0100 Subject: [PATCH 163/192] [loc] update Danish translation to latest --- res/loc/po/da-DK.po | 140 ++++++++++++++++++++++++++++++++++++++++---- res/loc/rufus.loc | 29 ++++++++- src/rufus.rc | 10 ++-- 3 files changed, 161 insertions(+), 18 deletions(-) diff --git a/res/loc/po/da-DK.po b/res/loc/po/da-DK.po index 7ab4e046..0cac8cb1 100644 --- a/res/loc/po/da-DK.po +++ b/res/loc/po/da-DK.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-04-25 13:41-0700\n" -"PO-Revision-Date: 2024-04-25 14:34-0700\n" +"POT-Creation-Date: 2026-04-06 21.43+0200\n" +"PO-Revision-Date: 2026-04-06 22:38+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: da_DK\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Danish (Dansk)\n" "X-Rufus-LCID: 0x0406\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -309,7 +309,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -847,7 +847,7 @@ msgstr "Ingen partition" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Indstil størrelsen for den vedvarende partition til live USB media. Ved at vælge størrelsen 0 slår man den vedvarende partition fra." @@ -889,13 +889,13 @@ msgstr "Et andet program eller en proces er i gang med at tilgå dette drev. Vil #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Rufus har opdaget, at du forsøger at oprette et Windows To Go medie baseret på en 1908 ISO.\n" +"Rufus har opdaget, at du forsøger at oprette et Windows To Go medie baseret på en 1809 ISO.\n" "\n" "På grund af en *MICROSOFT BUG* vil dette medie fejle under Windows boot (Blue Screen of Death) medmindre du manuelt erstatter filen 'WppRecorder.sys' med en 1803-version.\n" "\n" @@ -1798,6 +1798,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Ude af stand til at åbne eller læse '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Påfør SkuSiPolicy.p7b efter installationen (Se KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Livskvalitets forbedringer (Ikke påtving Copilot, OneDrive, Outlook, Fast Startup, osv.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Anvender Windows tilpasninger : %s" @@ -1848,13 +1856,13 @@ msgstr "Vedvarende log" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"En ekstra fil ('diskcopy.dll') skal hentes fra Microsoft for at installere MS-DOS:\n" +"En yderligere fil ('%s') skal downloades fra Microsoft for at bruge denne funktion:\n" "- Vælg 'Ja' for at tilslutte til internettet og hente den\n" "- Vælg 'Nej' for at afbryde operationen\n" "\n" @@ -1922,6 +1930,118 @@ msgstr "Udpakker arkiv filer: %s" msgid "Use Rufus MBR" msgstr "Brug Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Brug 'Windows CA 2023' signerede bootloaders (Kræver en kompatibel PC)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Tjekker for UEFI bootloader tilbagekaldelse..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Tjekker for UEFI DBX opdateringer..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "DBX opdatering tilgængelig" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus har fundet en opdateret version af DBX filerne som bruges til at udføre UEFI Secure Boot tilbagekaldelses tjek. Vil du hente denne opdatering?\n" +"- Vælg 'Ja' for at forbinde til internettet og hente disse filer\n" +"- Vælg 'Nej' for at afbryde operationen\n" +"\n" +"Note: Filerne vil blive hentet i programmets mappe og vil blive genbrugt automatisk hvis tilstede." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠STILLE⚠ slet disk og installer:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Du har valgt at bruge den \"stille\" Windows installations valgmulighed.\n" +"\n" +"Dette er en advanceret valgmulighed, som er reserveret for personer som vil lave et media som ikke prompter brugeren under Windows installationen, og vil derfor UBETINGET SLETTE den første disk som er opdaget på systemet. Hvis du ikke er forsigtig, så kan denne valgmulighed resultere i UOPRETTELIG DATA TAB!\n" +"\n" +"Hvis dette ikke er noget du vil have, så vælg 'Nej' for at gå tilbage og fravælge denne valgmulighed.\n" +"Ellers, hvis du vælger 'Ja', er du enig i at alt ansvaret for enhver data tab ligger på DIG." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Billedeplaceringen er ikke understøttet" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Du kan ikke bruge et billed som er placeret på det valgte drev, da drevet vil blive fuldstændig slettet. Det er som at save i den græn man sidder på!\n" +"\n" +"Vær venlig at flytte billedet til en anden placering og prøv igen." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Det er sikkert at have denne indstilling slået til, selv hvis du har en TPM eller mere RAM, da denne valgmulighed kun springer setup kravene over, og forhindre ikke Windows i at bruge alt tilgængelig hardware." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "For at denne indstilling virker, SKAL netværk/internettet slåes fra under installationen!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Automatisk svar 'nej' til alle spørgsmål under Windows opsætningen som vedrører at dele data med Microsoft, i stedet for at prompte brugeren." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Du bør lade denne indstilling være aktiveret, med mindre du er okay med at 'Windows To Go' tilgår de interne diske og udføre uoprettelig fil systems opgraderinger lydløst." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Automatisk opret en local burger, med det specificerede brugernavn, med en tom adganskode som skal laves om næste gang der logges ind." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Dupliker de regionale indstillinger fra denne PC (tastatur, tidszone, valuta), i stedet for at prompte brugeren." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Krypter ikke system disken, med mindre brugeren specifikt har bedt om det." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Brug denne indstilling hvis du ved hvad S-Mode er, og forstår at dit system muligvis bliver låst fast i S-Mode, selv efter en komplet sletning og reinstallering af Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Brug denne indstilling hvis det system du har planlagt at installere Windows på, har fuldt opdateret Secure Boot certifikater. Om nødvendigt, kan du se på at bruge 'Mosby' til at opdatere dit system." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Brug denne instilling hvis du vil tilbagekalde yderligere potentielt usikre Windows bootloaders, men med risiko for at forhindre normale Windows medier fra at boote." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "\"Livskvalitets\" forbedringer: Deaktiver de fleste uønskede funktioner Microsoft prøver at tvinge slutbrugerne til at bruge." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Hvis du burger denne indstilling, sørg for at alle diske, på nær den som du vil installere Windows på er frakoblet, og ikke lade mediet side i en PC du ikke vil slette." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index db117326..b8a8b654 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -10,7 +10,7 @@ # • v4.5 "zh-TW" "Chinese Traditional (正體中文)" # • v4.14 "hr-HR" "Croatian (Hrvatski)" # • v4.14 "cs-CZ" "Czech (Čeština)" -# • v4.5 "da-DK" "Danish (Dansk)" +# • v4.14 "da-DK" "Danish (Dansk)" # • v4.14 "nl-NL" "Dutch (Nederlands)" # • v4.5 "fi-FI" "Finnish (Suomi)" # • v4.14 "fr-FR" "French (Français)" @@ -3263,7 +3263,7 @@ t MSG_922 "Stažení souborů UEFI Shell ISO" ######################################################################### l "da-DK" "Danish (Dansk)" 0x0406 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -3445,7 +3445,7 @@ t MSG_129 "Du hare lige oprettet et medie, der bruger UEFI:NTFS bootloader. Husk t MSG_130 "Windows billedvalg" t MSG_131 "Denne ISO indeholder flere Windows-billeder.\nVælg venligt billedet, du vil bruge til denne installation:" t MSG_132 "Et andet program eller en proces er i gang med at tilgå dette drev. Vil du formatere det alligevel?" -t MSG_133 "Rufus har opdaget, at du forsøger at oprette et Windows To Go medie baseret på en 1908 ISO.\n\nPå grund af en *MICROSOFT BUG* vil dette medie fejle under Windows boot (Blue Screen of Death) medmindre du manuelt erstatter filen 'WppRecorder.sys' med en 1803-version.\n\nBemærk også, at årsagen til, at Rufus ikke automatisk kan løse dette for dig, er at 'WppRecorder.sys' er en Microsoft-ophavsretlig beskyttet fil, så vi kan ikke lovligt inkludere en kopi af filen i applikationen..." +t MSG_133 "Rufus har opdaget, at du forsøger at oprette et Windows To Go medie baseret på en 1809 ISO.\n\nPå grund af en *MICROSOFT BUG* vil dette medie fejle under Windows boot (Blue Screen of Death) medmindre du manuelt erstatter filen 'WppRecorder.sys' med en 1803-version.\n\nBemærk også, at årsagen til, at Rufus ikke automatisk kan løse dette for dig, er at 'WppRecorder.sys' er en Microsoft-ophavsretlig beskyttet fil, så vi kan ikke lovligt inkludere en kopi af filen i applikationen..." t MSG_134 "Fordi MBR er udvalgt for partitionsordning, kan Rufus kun oprette en partition op til 2 TB på dette medie, hvilket gør %s af diskplads utilgængelig.\n\nEr du sikker, du vil fortsætte?" t MSG_136 "Udgave" t MSG_138 "Sprog" @@ -3625,6 +3625,8 @@ t MSG_319 "Ignorer boot markering" t MSG_320 "Genindlæser partition layout (%s)" t MSG_321 "Det valgte billede er et ISOHybrid, men dets skabere har ikke gjort det kompatibelt med ISO / Fil kopi måde.\nDerfor bruges DD-billedskrivningstilstand." t MSG_322 "Ude af stand til at åbne eller læse '%s'" +t MSG_323 "Påfør SkuSiPolicy.p7b efter installationen (Se KB5042562)" +t MSG_324 "Livskvalitets forbedringer (Ikke påtving Copilot, OneDrive, Outlook, Fast Startup, osv.)" t MSG_325 "Anvender Windows tilpasninger : %s" t MSG_326 "Anvender bruger valgmuligheder..." t MSG_327 "Windows Bruger Oplevelse" @@ -3650,6 +3652,27 @@ t MSG_346 "Begræns Windows til S-Mode (Inkompatibel med Online bruger bypass)" t MSG_347 "Ekspert Tilstand" t MSG_348 "Udpakker arkiv filer: %s" t MSG_349 "Brug Rufus MBR" +t MSG_350 "Brug 'Windows CA 2023' signerede bootloaders (Kræver en kompatibel PC)" +t MSG_351 "Tjekker for UEFI bootloader tilbagekaldelse..." +t MSG_352 "Tjekker for UEFI DBX opdateringer..." +t MSG_353 "DBX opdatering tilgængelig" +t MSG_354 "Rufus har fundet en opdateret version af DBX filerne som bruges til at udføre UEFI Secure Boot tilbagekaldelses tjek. Vil du hente denne opdatering?\n- Vælg 'Ja' for at forbinde til internettet og hente disse filer\n- Vælg 'Nej' for at afbryde operationen\n\nNote: Filerne vil blive hentet i programmets mappe og vil blive genbrugt automatisk hvis tilstede." +t MSG_355 "⚠STILLE⚠ slet disk og installer:" +t MSG_356 "Du har valgt at bruge den \"stille\" Windows installations valgmulighed.\n\nDette er en advanceret valgmulighed, som er reserveret for personer som vil lave et media som ikke prompter brugeren under Windows installationen, og vil derfor UBETINGET SLETTE den første disk som er opdaget på systemet. Hvis du ikke er forsigtig, så kan denne valgmulighed resultere i UOPRETTELIG DATA TAB!\n\nHvis dette ikke er noget du vil have, så vælg 'Nej' for at gå tilbage og fravælge denne valgmulighed.\nEllers, hvis du vælger 'Ja', er du enig i at alt ansvaret for enhver data tab ligger på DIG." +t MSG_358 "Billedeplaceringen er ikke understøttet" +t MSG_359 "Du kan ikke bruge et billed som er placeret på det valgte drev, da drevet vil blive fuldstændig slettet. Det er som at save i den græn man sidder på!\n\nVær venlig at flytte billedet til en anden placering og prøv igen." +t MSG_360 "Det er sikkert at have denne indstilling slået til, selv hvis du har en TPM eller mere RAM, da denne valgmulighed kun springer setup kravene over, og forhindre ikke Windows i at bruge alt tilgængelig hardware." +t MSG_361 "For at denne indstilling virker, SKAL netværk/internettet slåes fra under installationen!" +t MSG_362 "Automatisk svar 'nej' til alle spørgsmål under Windows opsætningen som vedrører at dele data med Microsoft, i stedet for at prompte brugeren." +t MSG_363 "Du bør lade denne indstilling være aktiveret, med mindre du er okay med at 'Windows To Go' tilgår de interne diske og udføre uoprettelig fil systems opgraderinger lydløst." +t MSG_364 "Automatisk opret en local burger, med det specificerede brugernavn, med en tom adganskode som skal laves om næste gang der logges ind." +t MSG_365 "Dupliker de regionale indstillinger fra denne PC (tastatur, tidszone, valuta), i stedet for at prompte brugeren." +t MSG_366 "Krypter ikke system disken, med mindre brugeren specifikt har bedt om det." +t MSG_367 "Brug denne indstilling hvis du ved hvad S-Mode er, og forstår at dit system muligvis bliver låst fast i S-Mode, selv efter en komplet sletning og reinstallering af Windows." +t MSG_368 "Brug denne indstilling hvis det system du har planlagt at installere Windows på, har fuldt opdateret Secure Boot certifikater. Om nødvendigt, kan du se på at bruge 'Mosby' til at opdatere dit system." +t MSG_369 "Brug denne instilling hvis du vil tilbagekalde yderligere potentielt usikre Windows bootloaders, men med risiko for at forhindre normale Windows medier fra at boote." +t MSG_370 "\"Livskvalitets\" forbedringer: Deaktiver de fleste uønskede funktioner Microsoft prøver at tvinge slutbrugerne til at bruge." +t MSG_371 "Hvis du burger denne indstilling, sørg for at alle diske, på nær den som du vil installere Windows på er frakoblet, og ikke lade mediet side i en PC du ikke vil slette." t MSG_900 "Rufus er et værktøj, der hjælper med at formatere og skabe startbare USB-flashdrev, såsom USB-nøgler/USB-pinde, USB-stik, osv." t MSG_901 "Officiel side: %s" t MSG_902 "Kildekode: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 841e863e..0e9246c6 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.14.2353" +CAPTION "Rufus 4.14.2354" 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,14,2353,0 - PRODUCTVERSION 4,14,2353,0 + FILEVERSION 4,14,2354,0 + PRODUCTVERSION 4,14,2354,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.14.2353" + VALUE "FileVersion", "4.14.2354" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2353" + VALUE "ProductVersion", "4.14.2354" END END BLOCK "VarFileInfo" From c90f76f2bc558f75e6368ac19f8d8ca94855ef1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Ljubi=C4=8Di=C4=87?= <ljubimilos@gmail.com> Date: Wed, 8 Apr 2026 01:41:56 +0100 Subject: [PATCH 164/192] [loc] update Serbian translation --- res/loc/po/sr-RS.po | 144 ++++++++++++++++++++++++++++++++++++++++---- res/loc/rufus.loc | 29 ++++++++- src/rufus.rc | 10 +-- 3 files changed, 163 insertions(+), 20 deletions(-) diff --git a/res/loc/po/sr-RS.po b/res/loc/po/sr-RS.po index a325ca9c..c8b851b0 100644 --- a/res/loc/po/sr-RS.po +++ b/res/loc/po/sr-RS.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-05-10 22:14+0200\n" -"PO-Revision-Date: 2024-05-10 22:25+0200\n" +"POT-Creation-Date: 2026-04-07 01:00+0200\n" +"PO-Revision-Date: 2026-04-07 22:18+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: sr_RS\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Serbian (Srpski)\n" "X-Rufus-LCID: 0x241a, 0x081a, 0x181a, 0x2c1a, 0x701a, 0x7c1a\n" -"X-Generator: Poedit 3.4.4\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -846,7 +846,7 @@ msgstr "Bez stalne veličine" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Izaberite veličinu stalne particije za live USB datoteku. Podešavanjem na 0 onemogućava stalnu particiju." @@ -888,7 +888,7 @@ msgstr "NEki drugi program koristi uređaj. Da li idalje želiš da ga formatira #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" @@ -1795,6 +1795,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Nije moguće otvoriti ili pročitati '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Primenite SkuSiPolicy.p7b prilikom instalacije (pogledajte KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Poboljšanja „QoL“ (Ne forsirajte Copilot, OneDrive, Outlook, brzo pokretanje itd.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Premena prilagođavanja Winodows-a" @@ -1845,17 +1853,17 @@ msgstr "Trajna evidencija" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Додатна датотека ('diskcopy.dll') мора да се преузме са Microsoft-a да би се инсталирао MS-DOS:\n" -"- Изаберите „Да“ да бисте се повезали на Интернет и преузели га\n" -"- Изаберите „Не“ да бисте отказали операцију\n" +"Dodatna datoteka („%s“) mora biti preuzeta od kompanije Microsoft da biste koristili ovu funkciju:\n" +"- Izaberite „Da“ da biste se povezali na internet i preuzeli je\n" +"- Izaberite „Ne“ da biste otkazali operaciju\n" "\n" -"Напомена: Датотека ће бити преузета у директоријум апликације и аутоматски ће се поново користити ако постоји." +"Napomena: Datoteka će biti preuzeta u direktorijum aplikacije i biće automatski ponovo korišćena ako postoji." #. • MSG_338 msgid "Revoked UEFI bootloader detected" @@ -1919,6 +1927,118 @@ msgstr "Распакивање архивских датотека: %s" msgid "Use Rufus MBR" msgstr "Koritsti Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Koristite bootloadere potpisane od strane 'Windows CA 2023' (potreban je kompatibilan ciljni računar)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Proverava opoziv UEFI bootloadera..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Proverava ažuriranja za UEFI DBX..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "Dostupno ažuriranje DBX-a" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus je pronašao ažuriranu verziju DBX datoteka koje se koriste za izvođenje proverava opoziva UEFI Secure Boot-a. Želite li preuzeti ovo ažuriranje?\n" +"- Odaberite 'Da' da biste se povezali na internet i preuzeli ovaj sadržaj\n" +"- Odaberite 'Ne' da biste otkazali operaciju\n" +"\n" +"Napomena: Datoteke će biti preuzete u folderu aplikacije i automatski će se ponovo koristiti ako postoje." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠TIHO⚠ obriši disk i instaliraj:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Izabrali ste opciju „tihe“ instalacije sistema Windows.\n" +"\n" +"Ovo je napredna opcija, rezervisana za ljude koji žele da kreiraju medije koji ne obaveštavaju korisnika tokom instalacije sistema Windows i stoga BEZUSLOVNO BRIŠU prvi detektovani disk na ciljnom sistemu. Ako niste pažljivi, korišćenje ove opcije može dovesti do NEPOVRATNOG GUBITKA PODATAKA!\n" +"\n" +"Ako ovo nije ono što želite, izaberite „Ne“ da biste se vratili i opozvali izbor opcije.\n" +"U suprotnom, ako izaberete „Da“, slažete se da će sva odgovornost za bilo kakav gubitak podataka biti u potpunosti na VAMA." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Nepodržana lokacija slike" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Ne možete koristiti sliku koja se nalazi na ciljnom disku, jer će taj disk biti potpuno obrisan. To je isto kao i pokušaj da sečete granu na kojoj sedite!\n" +"\n" +"Molimo vas da premestite sliku na drugu lokaciju i pokušate ponovo." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Bezbedno je ostaviti ovu opciju omogućenu čak i ako imate TPM ili više RAM-a, jer ova opcija samo zaobilazi zahteve za podešavanje i zapravo ne sprečava Windows da koristi sav dostupan hardver." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Da bi ova opcija funkcionisala, mreža/internet MORA biti isključen tokom instalacije!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Automatski odgovori sa „ne“ na pitanja o podešavanju sistema Windows u vezi sa deljenjem podataka sa kompanijom Microsoft, umesto da to pita korisnika." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Trebalo bi da ostavite ovu opciju omogućenu, osim ako vam ne smeta da „Windows To Go“ pristupa internim diskovima i tiho izvršava nepovratne nadogradnje sistema datoteka." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Automatski kreirajte lokalni nalog sa navedenim korisničkim imenom, koristeći praznu lozinku koju će biti potrebno promeniti pri sledećem prijavljivanju." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Duplirajte regionalna podešavanja sa ovog računara (tastatura, vremenska zona, valuta), umesto da pitate korisnika." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Ne enkriptuj sistemski disk, osim ako to korisnik eksplicitno ne zahteva." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Koristite ovu opciju samo ako znate šta je S-režim i razumete da vaš sistem može biti zaključan u S-režimu čak i nakon što potpuno obrišete i ponovo instalirate Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Koristite ovu opciju ako sistem na koji planirate da instalirate Windows koristi potpuno ažurirane sertifikate za bezbedno pokretanje (Secure Boot). Ako je potrebno, možete razmotriti korišćenje „Mosby“-ja za ažuriranje sistema." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Koristite ovu opciju ako želite da opozovete dodatne potencijalno nebezbedne Windows pokretačke programe, ali sa mogućnošću da sprečite i pokretanje standardnih Windows medija." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Poboljšanja „Kvaliteta života“: Onemogućite većinu neželjenih funkcija koje Majkrosoft pokušava da nametne krajnjim korisnicima." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Ako koristite ovu opciju, obavezno isključite svaki disk sa ciljnog računara, osim onog na koji želite da instalirate Windows, kao i da ne ostavljate medijum priključen na bilo koji računar koji ne želite da obrišete." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index b8a8b654..6660d5ea 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -32,7 +32,7 @@ # • v4.14 "pt-PT" "Portuguese Standard (Português)" # • v4.5 "ro-RO" "Romanian (Română)" # • v4.14 "ru-RU" "Russian (Русский)" -# • v4.5 "sr-RS" "Serbian (Srpski)" +# • v4.14 "sr-RS" "Serbian (Srpski)" # • v4.5 "sk-SK" "Slovak (Slovensky)" # • v4.5 "sl-SI" "Slovenian (Slovenščina)" # • v4.5 "es-ES" "Spanish (Español)" @@ -12726,7 +12726,7 @@ t MSG_922 "Загрузка ISO-образов оболочки UEFI" ######################################################################### l "sr-RS" "Serbian (Srpski)" 0x241a, 0x081a, 0x181a, 0x2c1a, 0x701a, 0x7c1a -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -13100,6 +13100,8 @@ t MSG_319 "Ignoriši boot marker" t MSG_320 "Osvežavanje participnog rasporeda (%s)..." t MSG_321 "Slika koju si odabrao je ISOHibrid, ali njeni kreatori ga nisu napravili kompatibilnim sa ISO/File copy mode-om.\nKao rezultat toga, DD režim pisanje slike će biti primenjen." t MSG_322 "Nije moguće otvoriti ili pročitati '%s'" +t MSG_323 "Primenite SkuSiPolicy.p7b prilikom instalacije (pogledajte KB5042562)" +t MSG_324 "Poboljšanja „QoL“ (Ne forsirajte Copilot, OneDrive, Outlook, brzo pokretanje itd.)" t MSG_325 "Premena prilagođavanja Winodows-a" t MSG_326 "Primena korisničkih opcija..." t MSG_327 "Windows-ovo korisnicko iskustvo" @@ -13112,7 +13114,7 @@ t MSG_333 "Kreiraj lokalni nalog sa imenom:" t MSG_334 "Stavi regionalnu opciju na istu vrednost kao i ovaj korisnik" t MSG_335 "Onemogući BitLocker automatsku enkripciju uređaja" t MSG_336 "Trajna evidencija" -t MSG_337 "Додатна датотека („%s“) мора да се преузме са Microsoft-а да бисте користили ову функцију:\n- Изаберите „Да“ да бисте се повезали на Интернет и преузели га\n- Изаберите „Не“ да бисте отказали операцију\n\nНапомена: Датотека ће бити преузета у директоријум апликације и аутоматски ће се поново користити ако постоји." +t MSG_337 "Dodatna datoteka („%s“) mora biti preuzeta od kompanije Microsoft da biste koristili ovu funkciju:\n- Izaberite „Da“ da biste se povezali na internet i preuzeli je\n- Izaberite „Ne“ da biste otkazali operaciju\n\nNapomena: Datoteka će biti preuzeta u direktorijum aplikacije i biće automatski ponovo korišćena ako postoji." t MSG_338 "Откривен је опозвани UEFI покретач" t MSG_339 "Руфус је открио да ISO који сте изабрали садржи UEFI покретач који је опозван и који ће произвести %s када је безбедно покретање омогућено на потпуно ажурираном UEFI систему.\n\n- Ако сте ову ISO слику добили од неугледног извора, требало би да размотрите могућност да садржи UEIFI малвер и избегавајте покретање са њега.\n- Ако сте га добили од поузданог извора, покушајте да пронађете новију верзију, која неће произвести ово упозорење." t MSG_340 "екран „Нарушавање безбедности“" @@ -13125,6 +13127,27 @@ t MSG_346 "Ограничите Виндовс на С-Моде (НИЈЕ КОМ t MSG_347 "Ekspertni Rezim" t MSG_348 "Распакивање архивских датотека: %s" t MSG_349 "Koritsti Rufus MBR" +t MSG_350 "Koristite bootloadere potpisane od strane 'Windows CA 2023' (potreban je kompatibilan ciljni računar)" +t MSG_351 "Proverava opoziv UEFI bootloadera..." +t MSG_352 "Proverava ažuriranja za UEFI DBX..." +t MSG_353 "Dostupno ažuriranje DBX-a" +t MSG_354 "Rufus je pronašao ažuriranu verziju DBX datoteka koje se koriste za izvođenje proverava opoziva UEFI Secure Boot-a. Želite li preuzeti ovo ažuriranje?\n- Odaberite 'Da' da biste se povezali na internet i preuzeli ovaj sadržaj\n- Odaberite 'Ne' da biste otkazali operaciju\n\nNapomena: Datoteke će biti preuzete u folderu aplikacije i automatski će se ponovo koristiti ako postoje." +t MSG_355 "⚠TIHO⚠ obriši disk i instaliraj:" +t MSG_356 "Izabrali ste opciju „tihe“ instalacije sistema Windows.\n\nOvo je napredna opcija, rezervisana za ljude koji žele da kreiraju medije koji ne obaveštavaju korisnika tokom instalacije sistema Windows i stoga BEZUSLOVNO BRIŠU prvi detektovani disk na ciljnom sistemu. Ako niste pažljivi, korišćenje ove opcije može dovesti do NEPOVRATNOG GUBITKA PODATAKA!\n\nAko ovo nije ono što želite, izaberite „Ne“ da biste se vratili i opozvali izbor opcije.\nU suprotnom, ako izaberete „Da“, slažete se da će sva odgovornost za bilo kakav gubitak podataka biti u potpunosti na VAMA." +t MSG_358 "Nepodržana lokacija slike" +t MSG_359 "Ne možete koristiti sliku koja se nalazi na ciljnom disku, jer će taj disk biti potpuno obrisan. To je isto kao i pokušaj da sečete granu na kojoj sedite!\n\nMolimo vas da premestite sliku na drugu lokaciju i pokušate ponovo." +t MSG_360 "Bezbedno je ostaviti ovu opciju omogućenu čak i ako imate TPM ili više RAM-a, jer ova opcija samo zaobilazi zahteve za podešavanje i zapravo ne sprečava Windows da koristi sav dostupan hardver." +t MSG_361 "Da bi ova opcija funkcionisala, mreža/internet MORA biti isključen tokom instalacije!" +t MSG_362 "Automatski odgovori sa „ne“ na pitanja o podešavanju sistema Windows u vezi sa deljenjem podataka sa kompanijom Microsoft, umesto da to pita korisnika." +t MSG_363 "Trebalo bi da ostavite ovu opciju omogućenu, osim ako vam ne smeta da „Windows To Go“ pristupa internim diskovima i tiho izvršava nepovratne nadogradnje sistema datoteka." +t MSG_364 "Automatski kreirajte lokalni nalog sa navedenim korisničkim imenom, koristeći praznu lozinku koju će biti potrebno promeniti pri sledećem prijavljivanju." +t MSG_365 "Duplirajte regionalna podešavanja sa ovog računara (tastatura, vremenska zona, valuta), umesto da pitate korisnika." +t MSG_366 "Ne enkriptuj sistemski disk, osim ako to korisnik eksplicitno ne zahteva." +t MSG_367 "Koristite ovu opciju samo ako znate šta je S-režim i razumete da vaš sistem može biti zaključan u S-režimu čak i nakon što potpuno obrišete i ponovo instalirate Windows." +t MSG_368 "Koristite ovu opciju ako sistem na koji planirate da instalirate Windows koristi potpuno ažurirane sertifikate za bezbedno pokretanje (Secure Boot). Ako je potrebno, možete razmotriti korišćenje „Mosby“-ja za ažuriranje sistema." +t MSG_369 "Koristite ovu opciju ako želite da opozovete dodatne potencijalno nebezbedne Windows pokretačke programe, ali sa mogućnošću da sprečite i pokretanje standardnih Windows medija." +t MSG_370 "Poboljšanja „Kvaliteta života“: Onemogućite većinu neželjenih funkcija koje Majkrosoft pokušava da nametne krajnjim korisnicima." +t MSG_371 "Ako koristite ovu opciju, obavezno isključite svaki disk sa ciljnog računara, osim onog na koji želite da instalirate Windows, kao i da ne ostavljate medijum priključen na bilo koji računar koji ne želite da obrišete." t MSG_900 "Rufus je uslužni program koji pomaže u formatiranju i kreiranju USB fleš diskova koji se mogu pokretati, kao što su USB ključevi, memorijski štapići itd." t MSG_901 "Zvaničan sajt: %s" t MSG_902 "Izvorni kod: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 0e9246c6..c8922751 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.14.2354" +CAPTION "Rufus 4.14.2355" 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,14,2354,0 - PRODUCTVERSION 4,14,2354,0 + FILEVERSION 4,14,2355,0 + PRODUCTVERSION 4,14,2355,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.14.2354" + VALUE "FileVersion", "4.14.2355" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2354" + VALUE "ProductVersion", "4.14.2355" END END BLOCK "VarFileInfo" From 578477636e2276ddfc85634a23238b61d38637d1 Mon Sep 17 00:00:00 2001 From: Jakub Zieciak <jakub.zieciak@gmail.com> Date: Wed, 8 Apr 2026 01:48:21 +0100 Subject: [PATCH 165/192] [loc] update Norwegian and Polish translations to latest --- res/loc/po/nb-NO.po | 143 +++++++++++++++++++++++++++++++++++++---- res/loc/po/pl-PL.po | 150 +++++++++++++++++++++++++++++++++++++++----- res/loc/rufus.loc | 58 +++++++++++++++-- src/rufus.rc | 10 +-- 4 files changed, 324 insertions(+), 37 deletions(-) diff --git a/res/loc/po/nb-NO.po b/res/loc/po/nb-NO.po index e2dbc6f7..624e698f 100644 --- a/res/loc/po/nb-NO.po +++ b/res/loc/po/nb-NO.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-05-09 19:38+0100\n" -"PO-Revision-Date: 2024-05-09 19:44+0100\n" +"POT-Creation-Date: 2026-04-07 23:05-0700\n" +"PO-Revision-Date: 2026-04-07 23:19-0700\n" "Last-Translator: \n" "Language-Team: \n" "Language: nb_NO\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Norwegian (Norsk)\n" "X-Rufus-LCID: 0x0414\n" -"X-Generator: Poedit 3.4.4\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -846,7 +846,7 @@ msgstr "Ingen varighet" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Still størrelsen på den vedvarende partisjonen for live USB media. Angir størrelsen til 0 deaktiverer den vedvarende partisjonen." @@ -887,8 +887,9 @@ msgid "Another program or process is accessing this drive. Do you want to format msgstr "Et annet program eller en prosess holder tilgang til denne disken. Vil du formatere det uansett?" #. • MSG_133 +#, fuzzy msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" @@ -1795,6 +1796,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Kan ikke åpne eller lese '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Bruk SkuSiPolicy.p7b under installasjon (se KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "QoL‑forbedringer (ikke påtving Copilot, OneDrive, Outlook, Hurtig oppstart osv.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Utfører tilpasning av Windows: %s" @@ -1845,14 +1854,14 @@ msgstr "Behold log" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"En ekstra fil ('diskcopy.dll') må lastes ned fra Microsoft for å installere MS-DOS:\n" -"- Velg \"Ja\" for å koble til Internett og laste den ned\n" +"En ekstra fil ('%s') må lastes ned fra Microsoft for å bruke denne funksjonen:\n" +"- Velg 'Ja' for å koble til Internett og laste den ned\n" "- Velg 'Nei' for å avbryte operasjonen\n" "\n" "Merk: Filen vil bli lastet ned i programmets katalog og vil automatisk bli gjenbrukt hvis den er tilstede." @@ -1891,7 +1900,7 @@ msgstr "Ukomprimert VHD-imaget" #. • MSG_344 msgid "Full Flash Update Image" -msgstr "Full Flash Update Image" +msgstr "" #. • MSG_345 msgid "" @@ -1919,6 +1928,118 @@ msgstr "Pakker ut arkivfiler: %s" msgid "Use Rufus MBR" msgstr "Bruk Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Bruk bootloaders signert med «Windows CA 2023» (krever en kompatibel target‑PC)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Søker etter tilbakekalling av UEFI‑bootloader…" + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Søker etter UEFI‑DBX‑oppdateringer..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "UEFI‑DBX‑oppdatering tilgjengelig" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus har funnet en oppdatert versjon av DBX‑filene som brukes til å utføre tilbakekallingssjekk for UEFI Secure Boot. Vil du laste ned denne oppdateringen?\n" +"– Velg «Ja» for å koble til Internett og laste ned innholdet\n" +"– Velg «Nei» for å avbryte operasjonen\n" +"\n" +"Merk: Filene lastes ned til programmets katalog og vil automatisk bli gjenbrukt hvis de allerede finnes." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠STILLEMODUS⚠ slett disk og installer:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Du har valgt alternativet for «stille» Windows‑installasjon.\n" +"\n" +"Dette er et avansert alternativ, beregnet for brukere som ønsker å opprette installasjonsmedier som ikke viser noen spørsmål under Windows‑installasjonen, og som derfor UBETINGET SLETTER den første oppdagede disken på målsystemet. Uforsiktig bruk av dette alternativet kan føre til UGJENKALLELIG TAP AV DATA!\n" +"\n" +"Hvis dette ikke er det du ønsker, velg «Nei» for å gå tilbake og fjerne avmerkingen for dette alternativet.\n" +"Hvis du derimot velger «Ja», bekrefter du at alt ansvar for eventuell datatap fullt og helt ligger hos DEG." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Ugyldig bildelokasjon" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Du kan ikke bruke et bilde som er lagret på måldisken, siden denne disken vil bli fullstendig slettet. Det tilsvarer å sage av grenen du sitter på!\n" +"\n" +"Flytt bildet til en annen plassering og prøv igjen." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Det er trygt å la dette alternativet være aktivert selv om systemet har TPM eller mer RAM, siden alternativet kun omgår installasjonskravene og ikke hindrer Windows i å bruke all tilgjengelig maskinvare." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "For at dette alternativet skal fungere, MÅ nettverk/Internett være frakoblet under installasjonen!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Svar automatisk «nei» på Windows‑installasjonsspørsmål som gjelder deling av data med Microsoft, i stedet for å spørre brukeren." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Dette alternativet bør være aktivert, med mindre du aksepterer at «Windows To Go» får tilgang til interne disker og i stillhet utfører irreversible filsystemoppgraderinger." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Opprett automatisk en lokal konto med angitt brukernavn og tomt passord, som må endres ved neste pålogging." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Dupliser regionale innstillinger fra denne PC‑en (tastatur, tidssone, valuta) i stedet for å spørre brukeren." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Ikke krypter systemdisken, med mindre brukeren uttrykkelig ber om det." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Bruk dette alternativet kun hvis du vet hva S‑modus er, og forstår at systemet kan forbli låst i S‑modus selv etter full sletting av disken og ny installasjon av Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Bruk dette alternativet dersom systemet du planlegger å installere Windows på, bruker fullt oppdaterte Secure Boot‑sertifikater. Ved behov kan du vurdere å bruke «Mosby» for å oppdatere systemet." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Bruk dette alternativet hvis du ønsker å tilbakekalle flere potensielt usikre Windows‑bootloaders, men vær oppmerksom på at dette også kan hindre standard Windows‑medier i å starte." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "«Quality of Life»-forbedringer: Deaktiverer de fleste uønskede funksjonene Microsoft forsøker å påtvinge sluttbrukere." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Hvis du bruker dette alternativet, sørg for å koble fra alle disker fra mål‑PC‑en unntatt den du vil installere Windows på, og pass på at installasjonsmediet ikke er koblet til noen PC du ikke ønsker å slette." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/po/pl-PL.po b/res/loc/po/pl-PL.po index 303214be..2bab771e 100644 --- a/res/loc/po/pl-PL.po +++ b/res/loc/po/pl-PL.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-08-13 12:38+0100\n" -"PO-Revision-Date: 2024-08-13 13:22+0100\n" +"POT-Creation-Date: 2026-04-07 22:23-0700\n" +"PO-Revision-Date: 2026-04-07 23:04-0700\n" "Last-Translator: \n" "Language-Team: \n" "Language: pl_PL\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Polish (Polski)\n" "X-Rufus-LCID: 0x0415\n" -"X-Generator: Poedit 3.4.4\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -846,7 +846,7 @@ msgstr "Brak trwałości" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Ustaw rozmiar stałej partycji dla nośnika live USB. Ustawienie rozmiaru na 0 wyłącza trwałą partycję." @@ -888,17 +888,17 @@ msgstr "Inny program lub proces używa tego dysku. Czy chcesz go sformatować mi #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Rufus wykrył, że próbujesz utworzyć nośnik \"Windows To Go\" bazujący na ISO 1809.\n" +"Rufus wykrył, że próbujesz utworzyć nośnik „Windows To Go” na podstawie obrazu ISO systemu Windows 10 w wersji 1809.\n" "\n" -"Z powodu *BŁĘDU MICROSOFTU*, ten nośnik ulegnie awarii podczas rozruchu systemu (Blue Screen of Death), chyba że ręcznie zastąpisz plik \"WppRecorder.sys\" wersją z 1803.\n" +"Z powodu BŁĘDU PO STRONIE MICROSOFTU taki nośnik spowoduje awarię systemu podczas uruchamiania Windows (Blue Screen), chyba że ręcznie zastąpisz plik „WppRecorder.sys” jego wersją z wydania 1803.\n" "\n" -"Należy również pamiętać, że powodem, dla którego Rufus nie może automatycznie rozwiązać tego problemu, jest to, że \"WppRecorder.sys” jest plikiem chronionym prawem autorskim firmy Microsoft, więc nie możemy zgodnie z prawem osadzić kopii pliku w aplikacji." +"Zauważ również, że powodem, dla którego Rufus nie może automatycznie naprawić tego problemu, jest fakt, iż plik „WppRecorder.sys” jest objęty prawami autorskimi firmy Microsoft, więc nie możemy legalnie dołączyć jego kopii do aplikacji." #. • MSG_134 msgid "" @@ -1795,6 +1795,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Nie można otworzyć '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Zastosuj SkuSiPolicy.p7b przy instalacji (Patrz KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Usprawnienia „QoL” (Nie wymuszaj Copilot, OneDrive, Outlook, Szybki Startup, itp.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Zastosuj niestandardowe ustawienia Windows: %s" @@ -1845,17 +1853,17 @@ msgstr "Stały dziennik (log)" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Dodatkowy plik (\"diskcopy.dll\") musi zostać pobrany od Microsoft, żeby zainstalować MS-DOS:\n" -"- Wybierz opcję \"Tak\", aby pobrać pliku z internetu\n" -"- Wybierz opcję \"Nie\", aby anulować operację\n" +"Aby skorzystać z tej funkcji, należy pobrać z firmy Microsoft dodatkowy plik ('%s'):\n" +"– Wybierz „Tak”, aby połączyć się z Internetem i pobrać ten plik\n" +"– Wybierz „Nie”, aby anulować operację\n" "\n" -"Uwaga: Plik zostanie pobrany do folderu aplikacji i będzie użyty ponownie, gdy będzie dostępny." +"Uwaga: Plik zostanie pobrany do katalogu aplikacji i będzie automatycznie ponownie wykorzystywany, jeśli będzie już obecny." #. • MSG_338 msgid "Revoked UEFI bootloader detected" @@ -1919,6 +1927,118 @@ msgstr "Wypakowywanie plików z archiwum: %s" msgid "Use Rufus MBR" msgstr "Użyj Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Użyj programów rozruchowych (bootloaderów) podpisanych przez „Windows CA 2023” (wymaga kompatybilnego komputera docelowego)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Sprawdzanie unieważnienia programu rozruchowego UEFI…" + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Sprawdzanie aktualizacji bazy UEFI DBX…" + +#. • MSG_353 +msgid "DBX update available" +msgstr "Dostępna aktualizacja DBX" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus wykrył zaktualizowaną wersję plików DBX używanych do sprawdzania unieważnień w UEFI Secure Boot. Czy chcesz pobrać tę aktualizację?\n" +"– Wybierz „Tak”, aby połączyć się z Internetem i pobrać tę zawartość\n" +"– Wybierz „Nie”, aby anulować operację\n" +"\n" +"Uwaga: Pliki zostaną pobrane do katalogu aplikacji i będą automatycznie ponownie wykorzystywane, jeśli już tam się znajdują." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠AUTOMATYCZNIE I BEZ POTWIERDZENIA⚠ wymaż dysk i zainstaluj:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Wybrałeś opcję „cichej” instalacji systemu Windows.\n" +"\n" +"Jest to opcja zaawansowana, przeznaczona dla osób, które chcą utworzyć nośnik instalacyjny niewyświetlający żadnych monitów podczas instalacji systemu Windows, a co za tym idzie BEZWARUNKOWO WYMAZUJĄCY pierwszy wykryty dysk w systemie docelowym. Jeśli nie zachowasz ostrożności, użycie tej opcji może doprowadzić do NIEODWRACALNEJ UTRATY DANYCH!\n" +"\n" +"Jeśli nie o to ci chodzi, wybierz „Nie”, aby wrócić i odznaczyć tę opcję.\n" +"W przeciwnym razie, wybierając „Tak”, zgadzasz się, że cała odpowiedzialność za ewentualną utratę danych spoczywa WYŁĄCZNIE na TOBIE." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Nieobsługiwana lokacja obrazu" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Nie możesz użyć obrazu, który znajduje się na dysku docelowym, ponieważ ten dysk zostanie całkowicie wymazany. To dokładnie to samo, co próba piłowania gałęzi, na której się siedzi!\n" +"\n" +"Przenieś obraz w inne miejsce i spróbuj ponownie." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Można bezpiecznie pozostawić tę opcję włączoną, nawet jeśli posiadasz moduł TPM lub większą ilość pamięci RAM, ponieważ opcja ta jedynie omija wymagania instalatora i w rzeczywistości nie uniemożliwia systemowi Windows korzystania z całego dostępnego sprzętu." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Aby ta opcja działała poprawnie, podczas instalacji połączenie sieciowe / internetowe MUSI być odłączone!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Automatycznie odpowiadaj „nie” na pytania instalatora systemu Windows dotyczące udostępniania danych firmie Microsoft, zamiast wyświetlać je użytkownikowi." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Należy pozostawić tę opcję włączoną, chyba że akceptujesz sytuację, w której „Windows To Go” uzyskuje dostęp do wewnętrznych dysków i po cichu przeprowadza nieodwracalne aktualizacje systemu plików." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Automatycznie utwórz konto lokalne o podanej nazwie użytkownika, używając pustego hasła, które będzie musiało zostać zmienione przy następnym logowaniu." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Automatycznie skopiuj ustawienia regionalne z tego komputera (klawiatura, strefa czasowa, waluta), zamiast pytać użytkownika." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Nie szyfruj dysku systemowego, chyba że użytkownik wyraźnie tego zażąda." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Używaj tej opcji tylko wtedy, gdy wiesz, czym jest tryb S (S‑Mode), i rozumiesz, że system może pozostać zablokowany w trybie S nawet po całkowitym wymazaniu dysku i ponownej instalacji systemu Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Użyj tej opcji, jeśli system, na którym planujesz zainstalować system Windows, korzysta z w pełni aktualnych certyfikatów Secure Boot. W razie potrzeby możesz skorzystać z narzędzia „Mosby”, aby zaktualizować swój system." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Użyj tej opcji, jeśli chcesz unieważnić dodatkowe, potencjalnie niebezpieczne programy rozruchowe systemu Windows, mając jednak świadomość, że może to również uniemożliwić uruchamianie standardowych nośników instalacyjnych Windows." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Usprawnienia jakości życia („Quality of Life”): wyłączenie większości niechcianych funkcji, które Microsoft próbuje narzucać użytkownikom końcowym." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Jeśli korzystasz z tej opcji, upewnij się, że odłączyłeś wszystkie dyski od komputera docelowego z wyjątkiem tego, na którym chcesz zainstalować system Windows, oraz że nie pozostawiasz nośnika podłączonego do żadnego komputera, którego nie chcesz wymazać." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 6660d5ea..e92767f5 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -25,9 +25,9 @@ # • v4.14 "lv-LV" "Latvian (Latviešu)" # • v3.22 "lt-LT" "Lithuanian (Lietuvių)" # • v3.22 "ms-MY" "Malay (Bahasa Malaysia)" -# • v4.5 "nb-NO" "Norwegian (Norsk)" +# • v4.14 "nb-NO" "Norwegian (Norsk)" # • v4.5 "fa-IR" "Persian (پارسی)" -# • v4.5 "pl-PL" "Polish (Polski)" +# • v4.14 "pl-PL" "Polish (Polski)" # • v4.14 "pt-BR" "Portuguese Brazilian (Português do Brasil)" # • v4.14 "pt-PT" "Portuguese Standard (Português)" # • v4.5 "ro-RO" "Romanian (Română)" @@ -9715,7 +9715,7 @@ t MSG_922 "Muat turun ISO Shell UEFI" ######################################################################### l "nb-NO" "Norwegian (Norsk)" 0x0414 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -10082,6 +10082,8 @@ t MSG_319 "Ignorer oppstartsmarkør" t MSG_320 "Forfriskende partisjonsoppsett (%s)..." t MSG_321 "Bildet du har valgt er en ISOHybrid, men skaperne har ikke gjort det kompatibelt med ISO / File copy modus.\nSom et resultat vil DD-skrivemodus bli håndhevet." t MSG_322 "Kan ikke åpne eller lese '%s'" +t MSG_323 "Bruk SkuSiPolicy.p7b under installasjon (se KB5042562)" +t MSG_324 "QoL‑forbedringer (ikke påtving Copilot, OneDrive, Outlook, Hurtig oppstart osv.)" t MSG_325 "Utfører tilpasning av Windows: %s" t MSG_326 "Aktiverer brukertilpasninger..." t MSG_327 "Windows brukeropplevelse" @@ -10106,6 +10108,27 @@ t MSG_346 "Begrens Windows til S-modus (INKOMPATIBEL med online kontoomgåelse)" t MSG_347 "Ekspert modus" t MSG_348 "Pakker ut arkivfiler: %s" t MSG_349 "Bruk Rufus MBR" +t MSG_350 "Bruk bootloaders signert med «Windows CA 2023» (krever en kompatibel target‑PC)" +t MSG_351 "Søker etter tilbakekalling av UEFI‑bootloader…" +t MSG_352 "Søker etter UEFI‑DBX‑oppdateringer..." +t MSG_353 "UEFI‑DBX‑oppdatering tilgjengelig" +t MSG_354 "Rufus har funnet en oppdatert versjon av DBX‑filene som brukes til å utføre tilbakekallingssjekk for UEFI Secure Boot. Vil du laste ned denne oppdateringen?\n– Velg «Ja» for å koble til Internett og laste ned innholdet\n– Velg «Nei» for å avbryte operasjonen\n\nMerk: Filene lastes ned til programmets katalog og vil automatisk bli gjenbrukt hvis de allerede finnes." +t MSG_355 "⚠STILLEMODUS⚠ slett disk og installer:" +t MSG_356 "Du har valgt alternativet for «stille» Windows‑installasjon.\n\nDette er et avansert alternativ, beregnet for brukere som ønsker å opprette installasjonsmedier som ikke viser noen spørsmål under Windows‑installasjonen, og som derfor UBETINGET SLETTER den første oppdagede disken på målsystemet. Uforsiktig bruk av dette alternativet kan føre til UGJENKALLELIG TAP AV DATA!\n\nHvis dette ikke er det du ønsker, velg «Nei» for å gå tilbake og fjerne avmerkingen for dette alternativet.\nHvis du derimot velger «Ja», bekrefter du at alt ansvar for eventuell datatap fullt og helt ligger hos DEG." +t MSG_358 "Ugyldig bildelokasjon" +t MSG_359 "Du kan ikke bruke et bilde som er lagret på måldisken, siden denne disken vil bli fullstendig slettet. Det tilsvarer å sage av grenen du sitter på!\n\nFlytt bildet til en annen plassering og prøv igjen." +t MSG_360 "Det er trygt å la dette alternativet være aktivert selv om systemet har TPM eller mer RAM, siden alternativet kun omgår installasjonskravene og ikke hindrer Windows i å bruke all tilgjengelig maskinvare." +t MSG_361 "For at dette alternativet skal fungere, MÅ nettverk/Internett være frakoblet under installasjonen!" +t MSG_362 "Svar automatisk «nei» på Windows‑installasjonsspørsmål som gjelder deling av data med Microsoft, i stedet for å spørre brukeren." +t MSG_363 "Dette alternativet bør være aktivert, med mindre du aksepterer at «Windows To Go» får tilgang til interne disker og i stillhet utfører irreversible filsystemoppgraderinger." +t MSG_364 "Opprett automatisk en lokal konto med angitt brukernavn og tomt passord, som må endres ved neste pålogging." +t MSG_365 "Dupliser regionale innstillinger fra denne PC‑en (tastatur, tidssone, valuta) i stedet for å spørre brukeren." +t MSG_366 "Ikke krypter systemdisken, med mindre brukeren uttrykkelig ber om det." +t MSG_367 "Bruk dette alternativet kun hvis du vet hva S‑modus er, og forstår at systemet kan forbli låst i S‑modus selv etter full sletting av disken og ny installasjon av Windows." +t MSG_368 "Bruk dette alternativet dersom systemet du planlegger å installere Windows på, bruker fullt oppdaterte Secure Boot‑sertifikater. Ved behov kan du vurdere å bruke «Mosby» for å oppdatere systemet." +t MSG_369 "Bruk dette alternativet hvis du ønsker å tilbakekalle flere potensielt usikre Windows‑bootloaders, men vær oppmerksom på at dette også kan hindre standard Windows‑medier i å starte." +t MSG_370 "«Quality of Life»-forbedringer: Deaktiverer de fleste uønskede funksjonene Microsoft forsøker å påtvinge sluttbrukere." +t MSG_371 "Hvis du bruker dette alternativet, sørg for å koble fra alle disker fra mål‑PC‑en unntatt den du vil installere Windows på, og pass på at installasjonsmediet ikke er koblet til noen PC du ikke ønsker å slette." t MSG_900 "Rufus er et verktøy som hjelper til med å formatere og lage oppstartbare USB-stasjoner, for eksempel USB-minnepinner, USB-harddisker, og lignende." t MSG_901 "Offisiell webside: %s" t MSG_902 "Kildekode: %s" @@ -10559,7 +10582,7 @@ t MSG_922 "ISO های پوسته UEFI را دانلود کنید" ######################################################################### l "pl-PL" "Polish (Polski)" 0x0415 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -10744,7 +10767,7 @@ t MSG_129 "Właśnie utworzyłeś nośnik, który używa bootloadera UEFI:NTFS. t MSG_130 "Wybór obrazu Windows" t MSG_131 "To ISO zawiera wiele obrazów Windows.\nWybierz obraz, którego chcesz użyć dla tej instalacji:" t MSG_132 "Inny program lub proces używa tego dysku. Czy chcesz go sformatować mimo to?" -t MSG_133 "Rufus wykrył, że próbujesz utworzyć nośnik \"Windows To Go\" bazujący na ISO 1809.\n\nZ powodu *BŁĘDU MICROSOFTU*, ten nośnik ulegnie awarii podczas rozruchu systemu (Blue Screen of Death), chyba że ręcznie zastąpisz plik \"WppRecorder.sys\" wersją z 1803.\n\nNależy również pamiętać, że powodem, dla którego Rufus nie może automatycznie rozwiązać tego problemu, jest to, że \"WppRecorder.sys” jest plikiem chronionym prawem autorskim firmy Microsoft, więc nie możemy zgodnie z prawem osadzić kopii pliku w aplikacji." +t MSG_133 "Rufus wykrył, że próbujesz utworzyć nośnik „Windows To Go” na podstawie obrazu ISO systemu Windows 10 w wersji 1809.\n\nZ powodu BŁĘDU PO STRONIE MICROSOFTU taki nośnik spowoduje awarię systemu podczas uruchamiania Windows (Blue Screen), chyba że ręcznie zastąpisz plik „WppRecorder.sys” jego wersją z wydania 1803.\n\nZauważ również, że powodem, dla którego Rufus nie może automatycznie naprawić tego problemu, jest fakt, iż plik „WppRecorder.sys” jest objęty prawami autorskimi firmy Microsoft, więc nie możemy legalnie dołączyć jego kopii do aplikacji." t MSG_134 "Ponieważ MBR został wybrany jako schemat partycji, Rufus może utworzyć partycję o rozmiarze do 2 TB na tym nośniku, co spowoduje, że %s miejsca na dysku będzie niedostępne.\n\nJesteś pewien, że chcesz kontynuować?" t MSG_135 "Wersja" t MSG_136 "Wydanie" @@ -10931,6 +10954,8 @@ t MSG_319 "Zignoruj znacznik 'boot'" t MSG_320 "Odświeżanie układu partycji (%s)..." t MSG_321 "Obraz, który został wybrany jest Hybrydą ISO i nie jest zgodny z trybem kopiowania ISO.\nWynikiem tego będzie przymusowe zapisywanie w trybie DD." t MSG_322 "Nie można otworzyć '%s'" +t MSG_323 "Zastosuj SkuSiPolicy.p7b przy instalacji (Patrz KB5042562)" +t MSG_324 "Usprawnienia „QoL” (Nie wymuszaj Copilot, OneDrive, Outlook, Szybki Startup, itp.)" t MSG_325 "Zastosuj niestandardowe ustawienia Windows: %s" t MSG_326 "Aplikowanie ustawień użytkownika..." t MSG_328 "Niestandardowe ustawienia Windows?" @@ -10942,7 +10967,7 @@ t MSG_333 "Stwórz konto lokalne o nazwie użytkownika:" t MSG_334 "Ustaw taką samą lokalizację i wartości jak obecny użytkownik" t MSG_335 "Dezaktywuj automatyczne szyfrowanie BitLocker" t MSG_336 "Stały dziennik (log)" -t MSG_337 "Aby móc korzystać z tej funkcji, należy pobrać dodatkowy plik (\"%s\") z witryny firmy Microsoft:\n- Wybierz opcję \"Tak\", aby pobrać pliku z internetu\n- Wybierz opcję \"Nie\", aby anulować operację\n\nUwaga: Plik zostanie pobrany do folderu aplikacji i będzie użyty ponownie, gdy będzie dostępny." +t MSG_337 "Aby skorzystać z tej funkcji, należy pobrać z firmy Microsoft dodatkowy plik ('%s'):\n– Wybierz „Tak”, aby połączyć się z Internetem i pobrać ten plik\n– Wybierz „Nie”, aby anulować operację\n\nUwaga: Plik zostanie pobrany do katalogu aplikacji i będzie automatycznie ponownie wykorzystywany, jeśli będzie już obecny." t MSG_338 "Wykryto unieważniony bootloader UEFI" t MSG_339 "Rufus wykrył, że wybrany plik ISO zawiera bootloader UEFI, który został unieważniony, i który wygeneruje %s. gdy włączony zostanie \"Secure Boot\" w pełni zaktualizowanym systemie UEFI.\n\n- Jeśli uzyskałeś ten obraz ISO z niezaufanego źródła, powinieneś rozważyć możliwość, że może on zawierać złośliwe oprogramowanie dla UEFI i unikać jego uruchamiania.\n- Jeśli uzyskałeś go z zaufanego źródła, powinieneś spróbować znaleźć nowszą wersję, która nie wygeneruje tego ostrzeżenia." t MSG_340 "ekran \"Naruszenie Bezpieczeństwa\"" @@ -10955,6 +10980,27 @@ t MSG_346 "Ogranicz system Windows do trybu S (NIEZGODNY z obejściem konta onli t MSG_347 "Tryb eksperta" t MSG_348 "Wypakowywanie plików z archiwum: %s" t MSG_349 "Użyj Rufus MBR" +t MSG_350 "Użyj programów rozruchowych (bootloaderów) podpisanych przez „Windows CA 2023” (wymaga kompatybilnego komputera docelowego)" +t MSG_351 "Sprawdzanie unieważnienia programu rozruchowego UEFI…" +t MSG_352 "Sprawdzanie aktualizacji bazy UEFI DBX…" +t MSG_353 "Dostępna aktualizacja DBX" +t MSG_354 "Rufus wykrył zaktualizowaną wersję plików DBX używanych do sprawdzania unieważnień w UEFI Secure Boot. Czy chcesz pobrać tę aktualizację?\n– Wybierz „Tak”, aby połączyć się z Internetem i pobrać tę zawartość\n– Wybierz „Nie”, aby anulować operację\n\nUwaga: Pliki zostaną pobrane do katalogu aplikacji i będą automatycznie ponownie wykorzystywane, jeśli już tam się znajdują." +t MSG_355 "⚠AUTOMATYCZNIE I BEZ POTWIERDZENIA⚠ wymaż dysk i zainstaluj:" +t MSG_356 "Wybrałeś opcję „cichej” instalacji systemu Windows.\n\nJest to opcja zaawansowana, przeznaczona dla osób, które chcą utworzyć nośnik instalacyjny niewyświetlający żadnych monitów podczas instalacji systemu Windows, a co za tym idzie BEZWARUNKOWO WYMAZUJĄCY pierwszy wykryty dysk w systemie docelowym. Jeśli nie zachowasz ostrożności, użycie tej opcji może doprowadzić do NIEODWRACALNEJ UTRATY DANYCH!\n\nJeśli nie o to ci chodzi, wybierz „Nie”, aby wrócić i odznaczyć tę opcję.\nW przeciwnym razie, wybierając „Tak”, zgadzasz się, że cała odpowiedzialność za ewentualną utratę danych spoczywa WYŁĄCZNIE na TOBIE." +t MSG_358 "Nieobsługiwana lokacja obrazu" +t MSG_359 "Nie możesz użyć obrazu, który znajduje się na dysku docelowym, ponieważ ten dysk zostanie całkowicie wymazany. To dokładnie to samo, co próba piłowania gałęzi, na której się siedzi!\n\nPrzenieś obraz w inne miejsce i spróbuj ponownie." +t MSG_360 "Można bezpiecznie pozostawić tę opcję włączoną, nawet jeśli posiadasz moduł TPM lub większą ilość pamięci RAM, ponieważ opcja ta jedynie omija wymagania instalatora i w rzeczywistości nie uniemożliwia systemowi Windows korzystania z całego dostępnego sprzętu." +t MSG_361 "Aby ta opcja działała poprawnie, podczas instalacji połączenie sieciowe / internetowe MUSI być odłączone!" +t MSG_362 "Automatycznie odpowiadaj „nie” na pytania instalatora systemu Windows dotyczące udostępniania danych firmie Microsoft, zamiast wyświetlać je użytkownikowi." +t MSG_363 "Należy pozostawić tę opcję włączoną, chyba że akceptujesz sytuację, w której „Windows To Go” uzyskuje dostęp do wewnętrznych dysków i po cichu przeprowadza nieodwracalne aktualizacje systemu plików." +t MSG_364 "Automatycznie utwórz konto lokalne o podanej nazwie użytkownika, używając pustego hasła, które będzie musiało zostać zmienione przy następnym logowaniu." +t MSG_365 "Automatycznie skopiuj ustawienia regionalne z tego komputera (klawiatura, strefa czasowa, waluta), zamiast pytać użytkownika." +t MSG_366 "Nie szyfruj dysku systemowego, chyba że użytkownik wyraźnie tego zażąda." +t MSG_367 "Używaj tej opcji tylko wtedy, gdy wiesz, czym jest tryb S (S‑Mode), i rozumiesz, że system może pozostać zablokowany w trybie S nawet po całkowitym wymazaniu dysku i ponownej instalacji systemu Windows." +t MSG_368 "Użyj tej opcji, jeśli system, na którym planujesz zainstalować system Windows, korzysta z w pełni aktualnych certyfikatów Secure Boot. W razie potrzeby możesz skorzystać z narzędzia „Mosby”, aby zaktualizować swój system." +t MSG_369 "Użyj tej opcji, jeśli chcesz unieważnić dodatkowe, potencjalnie niebezpieczne programy rozruchowe systemu Windows, mając jednak świadomość, że może to również uniemożliwić uruchamianie standardowych nośników instalacyjnych Windows." +t MSG_370 "Usprawnienia jakości życia („Quality of Life”): wyłączenie większości niechcianych funkcji, które Microsoft próbuje narzucać użytkownikom końcowym." +t MSG_371 "Jeśli korzystasz z tej opcji, upewnij się, że odłączyłeś wszystkie dyski od komputera docelowego z wyjątkiem tego, na którym chcesz zainstalować system Windows, oraz że nie pozostawiasz nośnika podłączonego do żadnego komputera, którego nie chcesz wymazać." t MSG_900 "Rufus to narzędzie, które pomaga formatować i tworzyć dyski rozruchowe flash USB, takie jak klucze USB, pendrive-y itp." t MSG_901 "Oficjalna strona: %s" t MSG_902 "Kod źródłowy: %s" diff --git a/src/rufus.rc b/src/rufus.rc index c8922751..f6e53760 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.14.2355" +CAPTION "Rufus 4.14.2356" 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,14,2355,0 - PRODUCTVERSION 4,14,2355,0 + FILEVERSION 4,14,2356,0 + PRODUCTVERSION 4,14,2356,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.14.2355" + VALUE "FileVersion", "4.14.2356" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2355" + VALUE "ProductVersion", "4.14.2356" END END BLOCK "VarFileInfo" From 58a0c71f957bab59241ba2f7345dba1ac4d5dee9 Mon Sep 17 00:00:00 2001 From: "Marco A. Ramirez Madrid" <rastrillin@hotmail.com> Date: Wed, 8 Apr 2026 01:53:32 +0100 Subject: [PATCH 166/192] [loc] update Spanish translation to latest --- res/loc/po/es-ES.po | 148 +++++++++++++++++++++++++++++++++++++++----- res/loc/rufus.loc | 31 ++++++++-- src/rufus.rc | 10 +-- 3 files changed, 166 insertions(+), 23 deletions(-) diff --git a/res/loc/po/es-ES.po b/res/loc/po/es-ES.po index 3dfb16cb..6f3d5b3e 100644 --- a/res/loc/po/es-ES.po +++ b/res/loc/po/es-ES.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-05-09 12:54-0300\n" -"PO-Revision-Date: 2024-05-09 12:58-0300\n" +"POT-Creation-Date: 2026-04-07 17:57-0300\n" +"PO-Revision-Date: 2026-04-07 18:56-0300\n" "Last-Translator: \n" "Language-Team: \n" "Language: es_ES\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Spanish (Español)\n" "X-Rufus-LCID: 0x040a, 0x080a, 0x0c0a, 0x100a, 0x140a, 0x180a, 0x1c0a, 0x200a, 0x240a, 0x280a, 0x2c0a, 0x300a, 0x340a, 0x380a, 0x3c0a, 0x400a, 0x440a, 0x480a, 0x4c0a, 0x500a, 0x540a, 0x580a\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -849,7 +849,7 @@ msgstr "No persistente" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Establece el tamaño de la partición persistente para el medio USB autoarrancable. Estableciendo un valor 0 deshabilita la partición persistente." @@ -891,17 +891,17 @@ msgstr "Otro programa o proceso está accediendo a esta unidad. ¿Deseas formate #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Rufus ha detectado que estás intentando crear un medio en Windows To Go basado en la ISO 1809.\n" +"Rufus ha detectado que estás intentando crear un medio Windows To Go basado en la ISO 1809.\n" "\n" -"Debido a un *FALLO DE MICROSOFT*, este medio no arrancará al iniciar Windows (Pantallazo Azul de la Muerte), a no ser que manualmente reemplaces el fichero 'WppRecorder.sys' con la versión 1803.\n" +"Debido a un *FALLO DE MICROSOFT*, este medio se bloqueará durante el arranque de Windows (Pantalla Azul de la Muerte), a menos que reemplaces manualmente el archivo 'WppRecorder.sys' con la versión 1803.\n" "\n" -"Ten en cuenta que el motivo por el que Rufus no puede arreglar esto automáticamente es debido a que el fichero 'WppRecorder.sys' es un fichero con copyright, por lo que legalmente no podemos añadir una copia del fichero en la aplicación..." +"Ten en cuenta que el motivo por el que Rufus no puede corregir esto automáticamente es que 'WppRecorder.sys' es un archivo con derechos de autor de Microsoft, por lo que legalmente no podemos incluir una copia en la aplicación..." #. • MSG_134 msgid "" @@ -1798,6 +1798,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "No se puede abrir o leer '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Aplicar SkuSiPolicy.p7b durante la instalación (ver KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Mejoras \"QoL\" (no forzar Copilot, OneDrive, Outlook, Inicio rápido, etc.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Aplicando personalización de Windows: %s" @@ -1848,17 +1856,17 @@ msgstr "Registro persistente" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Se debe descargar un archivo adicional ('diskcopy.dll') de Microsoft para instalar MS-DOS:\n" +"Se debe descargar un archivo adicional ('%s') de Microsoft para usar esta función:\n" "- Seleccione 'Sí' para conectarse a Internet y descargarlo\n" -"- Seleccione 'No' para cancelar la operación.\n" +"- Seleccione 'No' para cancelar la operación\n" "\n" -"Nota: El archivo se descargará en el directorio de la aplicación y se reutilizará automáticamente si está presente." +"Nota: El archivo se descargará en la carpeta de la aplicación y se reutilizará automáticamente si está presente." #. • MSG_338 msgid "Revoked UEFI bootloader detected" @@ -1922,6 +1930,118 @@ msgstr "Extrayendo archivos comprimidos: %s" msgid "Use Rufus MBR" msgstr "Utilice Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Usar cargadores de arranque firmados con 'Windows CA 2023' (requiere una PC de destino compatible)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Comprobando la revocación del cargador de arranque UEFI..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Comprobando actualizaciones de UEFI DBX..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "Actualización de DBX disponible" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus ha encontrado una versión actualizada de los archivos DBX utilizados para realizar comprobaciones de revocación de Secure Boot en UEFI. ¿Desea descargar esta actualización?\n" +"- Seleccione 'Sí' para conectarse a Internet y descargar este contenido\n" +"- Seleccione 'No' para cancelar la operación\n" +"\n" +"Nota: Los archivos se descargarán en la carpeta de la aplicación y se reutilizarán automáticamente si están presentes." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠EN SILENCIO⚠ borrar el disco e instalar:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Ha seleccionado usar la opción de instalación \"silenciosa\" de Windows.\n" +"\n" +"Esta es una opción avanzada, reservada para personas que desean crear un medio que no solicite interacción del usuario durante la instalación de Windows y que, por lo tanto, BORRA INCONDICIONALMENTE el primer disco detectado en el sistema de destino. Si no tiene cuidado, usar esta opción puede resultar en UNA PÉRDIDA DE DATOS IRREVERSIBLE.\n" +"\n" +"Si esto no es lo que desea, seleccione 'No' para volver atrás y desmarcar la opción.\n" +"De lo contrario, si selecciona 'Sí', usted acepta que toda la responsabilidad por cualquier pérdida de datos recaerá únicamente en USTED." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Ubicación de imagen no compatible" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"No puede usar una imagen que esté ubicada en la unidad de destino, ya que esa unidad va a ser completamente borrada. Es lo mismo que intentar serrar la rama en la que está sentado.\n" +"\n" +"Por favor, mueva la imagen a una ubicación diferente e inténtelo de nuevo." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Es seguro dejar esta opción habilitada incluso si tiene un TPM o más memoria RAM, ya que esta opción solo omite los requisitos de instalación y no impide que Windows utilice todo el hardware disponible." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Para que esta opción funcione, la red/Internet DEBE estar desconectada durante la instalación." + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Responder automáticamente 'No' a las preguntas de instalación de Windows relacionadas con el uso compartido de datos con Microsoft, en lugar de solicitárselo al usuario." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Debe dejar esta opción habilitada, a menos que esté de acuerdo con que 'Windows To Go' acceda a los discos internos y realice en silencio actualizaciones irreversibles del sistema de archivos." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Crear automáticamente una cuenta local con el nombre de usuario especificado, utilizando una contraseña vacía que deberá cambiarse en el próximo inicio de sesión." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Duplicar la configuración regional de esta PC (teclado, zona horaria, moneda), en lugar de solicitársela al usuario." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "No cifrar el disco del sistema, a menos que el usuario lo solicite explícitamente." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Use esta opción solo si sabe qué es el Modo S y entiende que su sistema puede quedar bloqueado en Modo S incluso después de borrar completamente e reinstalar Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Use esta opción si el sistema en el que planea instalar Windows utiliza certificados de Secure Boot completamente actualizados. Si es necesario, puede considerar usar 'Mosby' para actualizar su sistema." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Use esta opción si desea revocar cargadores de arranque adicionales de Windows que puedan ser inseguros, pero con la posibilidad de que también se impida que los medios estándar de Windows arranquen." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Mejoras de \"Calidad de Vida\": Deshabilitar la mayoría de las funciones no deseadas que Microsoft intenta imponer a los usuarios finales." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Si usa esta opción, asegúrese de desconectar todos los discos de la PC de destino, excepto aquel en el que desea instalar Windows, así como de no dejar el medio conectado en ninguna PC que no desee borrar." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index e92767f5..1145a4ba 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -35,7 +35,7 @@ # • v4.14 "sr-RS" "Serbian (Srpski)" # • v4.5 "sk-SK" "Slovak (Slovensky)" # • v4.5 "sl-SI" "Slovenian (Slovenščina)" -# • v4.5 "es-ES" "Spanish (Español)" +# • v4.14 "es-ES" "Spanish (Español)" # • v4.14 "sv-SE" "Swedish (Svenska)" # • v4.14 "th-TH" "Thai (ไทย)" # • v4.14 "tr-TR" "Turkish (Türkçe)" @@ -14057,7 +14057,7 @@ t MSG_922 "Prenos UEFI Shell ISOs" ######################################################################### l "es-ES" "Spanish (Español)" 0x040a, 0x080a, 0x0c0a, 0x100a, 0x140a, 0x180a, 0x1c0a, 0x200a, 0x240a, 0x280a, 0x2c0a, 0x300a, 0x340a, 0x380a, 0x3c0a, 0x400a, 0x440a, 0x480a, 0x4c0a, 0x500a, 0x540a, 0x580a -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -14236,7 +14236,7 @@ t MSG_129 "Has creado un sistema que usa un bootloader UEFI:NTFS. Por favor, rec t MSG_130 "Selección de imagen de Windows" t MSG_131 "Esta ISO contiene múltiples imágenes de Windows.\nPor favor, seleccione la imagen que desea usar para esta instalación:" t MSG_132 "Otro programa o proceso está accediendo a esta unidad. ¿Deseas formatearlo de todas formas?" -t MSG_133 "Rufus ha detectado que estás intentando crear un medio en Windows To Go basado en la ISO 1809.\n\nDebido a un *FALLO DE MICROSOFT*, este medio no arrancará al iniciar Windows (Pantallazo Azul de la Muerte), a no ser que manualmente reemplaces el fichero 'WppRecorder.sys' con la versión 1803.\n\nTen en cuenta que el motivo por el que Rufus no puede arreglar esto automáticamente es debido a que el fichero 'WppRecorder.sys' es un fichero con copyright, por lo que legalmente no podemos añadir una copia del fichero en la aplicación..." +t MSG_133 "Rufus ha detectado que estás intentando crear un medio Windows To Go basado en la ISO 1809.\n\nDebido a un *FALLO DE MICROSOFT*, este medio se bloqueará durante el arranque de Windows (Pantalla Azul de la Muerte), a menos que reemplaces manualmente el archivo 'WppRecorder.sys' con la versión 1803.\n\nTen en cuenta que el motivo por el que Rufus no puede corregir esto automáticamente es que 'WppRecorder.sys' es un archivo con derechos de autor de Microsoft, por lo que legalmente no podemos incluir una copia en la aplicación..." t MSG_134 "Debido a que has seleccionado MBR para el sistema de particiones, Rufus sólo puede crear una partición de hasta 2TB en este dispositivo, lo que dejará %s del disco no disponibles.\n\n¿Estas seguro de que deseas continuar?" t MSG_135 "Versión" t MSG_136 "Emisión" @@ -14423,6 +14423,8 @@ t MSG_319 "Ignorar marca de arranque (Boot Marker)" t MSG_320 "Actualizando disposición de partición (%s)..." t MSG_321 "La imagen seleccionada es ISOHybrid, pero sus creadores no la han creado compatible con el modo de copia ISO/FILE.\nPor consiguiente, se forzará el modo de escritura de imágenes DD." t MSG_322 "No se puede abrir o leer '%s'" +t MSG_323 "Aplicar SkuSiPolicy.p7b durante la instalación (ver KB5042562)" +t MSG_324 "Mejoras \"QoL\" (no forzar Copilot, OneDrive, Outlook, Inicio rápido, etc.)" t MSG_325 "Aplicando personalización de Windows: %s" t MSG_326 "Aplicando opciones de usuario..." t MSG_327 "Experiencia de usuario de Windows" @@ -14435,7 +14437,7 @@ t MSG_333 "Crear una cuenta local con nombre de usuario:" t MSG_334 "Establezca las opciones regionales en los mismos valores que las de este usuario" t MSG_335 "Deshabilitar el cifrado automático de dispositivos BitLocker" t MSG_336 "Registro persistente" -t MSG_337 "Se debe descargar un archivo adicional ('%s') de Microsoft para usar esta función:\n- Seleccione 'Sí' para conectarse a Internet y descargarlo\n- Seleccione 'No' para cancelar la operación.\n\nNota: El archivo se descargará en el directorio de la aplicación y se reutilizará automáticamente si está presente." +t MSG_337 "Se debe descargar un archivo adicional ('%s') de Microsoft para usar esta función:\n- Seleccione 'Sí' para conectarse a Internet y descargarlo\n- Seleccione 'No' para cancelar la operación\n\nNota: El archivo se descargará en la carpeta de la aplicación y se reutilizará automáticamente si está presente." t MSG_338 "Se detectó un gestor de arranque UEFI revocado" t MSG_339 "Rufus detectó que el ISO que seleccionó contiene un gestor de arranque UEFI que ha sido revocado y que producirá %s, cuando el arranque seguro esté habilitado en un sistema UEFI completamente actualizado.\n\n- Si obtuvo esta imagen ISO de una fuente no confiable, debe considerar la posibilidad de que contenga malware UEFI y evitar arrancar desde allí.\n- Si lo obtuvo de una fuente confiable, debe intentar localizar una versión más actualizada, que no producirá esta advertencia." t MSG_340 "una pantalla de \"violación de seguridad\"" @@ -14448,6 +14450,27 @@ t MSG_346 "Restringir Windows al Modo S (INCOMPATIBLE con la omisión de cuenta t MSG_347 "Modo experto" t MSG_348 "Extrayendo archivos comprimidos: %s" t MSG_349 "Utilice Rufus MBR" +t MSG_350 "Usar cargadores de arranque firmados con 'Windows CA 2023' (requiere una PC de destino compatible)" +t MSG_351 "Comprobando la revocación del cargador de arranque UEFI..." +t MSG_352 "Comprobando actualizaciones de UEFI DBX..." +t MSG_353 "Actualización de DBX disponible" +t MSG_354 "Rufus ha encontrado una versión actualizada de los archivos DBX utilizados para realizar comprobaciones de revocación de Secure Boot en UEFI. ¿Desea descargar esta actualización?\n- Seleccione 'Sí' para conectarse a Internet y descargar este contenido\n- Seleccione 'No' para cancelar la operación\n\nNota: Los archivos se descargarán en la carpeta de la aplicación y se reutilizarán automáticamente si están presentes." +t MSG_355 "⚠EN SILENCIO⚠ borrar el disco e instalar:" +t MSG_356 "Ha seleccionado usar la opción de instalación \"silenciosa\" de Windows.\n\nEsta es una opción avanzada, reservada para personas que desean crear un medio que no solicite interacción del usuario durante la instalación de Windows y que, por lo tanto, BORRA INCONDICIONALMENTE el primer disco detectado en el sistema de destino. Si no tiene cuidado, usar esta opción puede resultar en UNA PÉRDIDA DE DATOS IRREVERSIBLE.\n\nSi esto no es lo que desea, seleccione 'No' para volver atrás y desmarcar la opción.\nDe lo contrario, si selecciona 'Sí', usted acepta que toda la responsabilidad por cualquier pérdida de datos recaerá únicamente en USTED." +t MSG_358 "Ubicación de imagen no compatible" +t MSG_359 "No puede usar una imagen que esté ubicada en la unidad de destino, ya que esa unidad va a ser completamente borrada. Es lo mismo que intentar serrar la rama en la que está sentado.\n\nPor favor, mueva la imagen a una ubicación diferente e inténtelo de nuevo." +t MSG_360 "Es seguro dejar esta opción habilitada incluso si tiene un TPM o más memoria RAM, ya que esta opción solo omite los requisitos de instalación y no impide que Windows utilice todo el hardware disponible." +t MSG_361 "Para que esta opción funcione, la red/Internet DEBE estar desconectada durante la instalación." +t MSG_362 "Responder automáticamente 'No' a las preguntas de instalación de Windows relacionadas con el uso compartido de datos con Microsoft, en lugar de solicitárselo al usuario." +t MSG_363 "Debe dejar esta opción habilitada, a menos que esté de acuerdo con que 'Windows To Go' acceda a los discos internos y realice en silencio actualizaciones irreversibles del sistema de archivos." +t MSG_364 "Crear automáticamente una cuenta local con el nombre de usuario especificado, utilizando una contraseña vacía que deberá cambiarse en el próximo inicio de sesión." +t MSG_365 "Duplicar la configuración regional de esta PC (teclado, zona horaria, moneda), en lugar de solicitársela al usuario." +t MSG_366 "No cifrar el disco del sistema, a menos que el usuario lo solicite explícitamente." +t MSG_367 "Use esta opción solo si sabe qué es el Modo S y entiende que su sistema puede quedar bloqueado en Modo S incluso después de borrar completamente e reinstalar Windows." +t MSG_368 "Use esta opción si el sistema en el que planea instalar Windows utiliza certificados de Secure Boot completamente actualizados. Si es necesario, puede considerar usar 'Mosby' para actualizar su sistema." +t MSG_369 "Use esta opción si desea revocar cargadores de arranque adicionales de Windows que puedan ser inseguros, pero con la posibilidad de que también se impida que los medios estándar de Windows arranquen." +t MSG_370 "Mejoras de \"Calidad de Vida\": Deshabilitar la mayoría de las funciones no deseadas que Microsoft intenta imponer a los usuarios finales." +t MSG_371 "Si usa esta opción, asegúrese de desconectar todos los discos de la PC de destino, excepto aquel en el que desea instalar Windows, así como de no dejar el medio conectado en ninguna PC que no desee borrar." t MSG_900 "Rufus es una utilidad que le ayuda a formatear y crear dispositivos flash booteables, como «pendrives», tarjetas de memoria, etcétera." t MSG_901 "Sitio oficial %s" t MSG_902 "Código fuente %s" diff --git a/src/rufus.rc b/src/rufus.rc index f6e53760..14def5c3 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.14.2356" +CAPTION "Rufus 4.14.2357" 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,14,2356,0 - PRODUCTVERSION 4,14,2356,0 + FILEVERSION 4,14,2357,0 + PRODUCTVERSION 4,14,2357,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.14.2356" + VALUE "FileVersion", "4.14.2357" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2356" + VALUE "ProductVersion", "4.14.2357" END END BLOCK "VarFileInfo" From 3186373d70684ea3aa8aeb2bbf92a46a5bf7fdd8 Mon Sep 17 00:00:00 2001 From: MasterVito <mv@mvaop.ir> Date: Fri, 10 Apr 2026 13:45:00 +0100 Subject: [PATCH 167/192] [loc] update Persian translation to latest --- res/loc/po/fa-IR.po | 149 +++++++++++++++++++++++++++++++++++++++----- res/loc/rufus.loc | 33 ++++++++-- src/rufus.rc | 10 +-- 3 files changed, 168 insertions(+), 24 deletions(-) diff --git a/res/loc/po/fa-IR.po b/res/loc/po/fa-IR.po index 0db1fd2c..591021df 100644 --- a/res/loc/po/fa-IR.po +++ b/res/loc/po/fa-IR.po @@ -1,10 +1,10 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-04-29 19:24+0300\n" -"PO-Revision-Date: 2025-02-13 12:00+0000\n" -"Last-Translator: MasterVito <mv@mvaop.ir>\n" +"POT-Creation-Date: 2026-03-22 07:20+0300\n" +"PO-Revision-Date: 2026-04-09 21:48+0330\n" +"Last-Translator: \n" "Language-Team: \n" "Language: fa_IR\n" "MIME-Version: 1.0\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Persian (پارسی)\n" "X-Rufus-LCID: 0x0429\n" -"X-Generator: Poedit 3.5\n" +"X-Generator: Poedit 3.8\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -319,7 +319,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -858,7 +858,7 @@ msgstr "غیرفعال" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "برای ایجاد live USB با قابلیت ذخیره‌سازی اطلاعات، اندازه پارتیشن پایدار را تعیین کنید. در این حالت، اطلاعات با راه‌اندازی مجدد (ریست) از بین نخواهد رفت. برای غیرفعال کردن عدد صفر (۰) را وارد کنید." @@ -900,15 +900,15 @@ msgstr "برنامه دیگری در حال استفاده از این درای #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" "Rufus تشخیص داده است که شما می‌خواهید با ISO ورژن 1809 درایوی با قابلیت «Windows To Go» ایجاد کنید.\n" -"به دلیل باگی که شرکت مایکروسافت در این مورد دارد؛ در هنگام راه‌اندازی ویندوز به خطای «Blue Screen Of Death» خواهید خورد. برای رفع این مشکل می‌توانید فایل 'WppRecorder.sys' را با ورژن 1803 جایگزین کنید.\n" -"همچنین در نظر داشته باشید به دلیل اینکه کپی‌رایت فایل 'WppRecorder.sys' برای مایکروسافت است؛ Rufus نمی‌تواند به صورت خودکار این مشکل را برای شما برطرف کند و این فایل را در برنامه خود قرار دهد." +"به دلیل باگی که شرکت مایکروسافت در این مورد دارد؛ در هنگام راه‌اندازی ویندوز به خطای «Blue Screen Of Death» برخورد خواهید کرد. برای رفع این مشکل می‌توانید فایل 'WppRecorder.sys' را با ورژن 1803 جایگزین کنید.\n" +"همچنین در نظر داشته باشید به دلیل اینکه حق نشر فایل 'WppRecorder.sys' برای مایکروسافت است؛ Rufus نمی‌تواند به صورت خودکار این مشکل را برای شما برطرف کند و این فایل را در برنامه خود قرار دهد." #. • MSG_134 msgid "" @@ -1094,7 +1094,7 @@ msgstr "نسخه %d.%d (Build %d)" #. • MSG_176 msgid "English translation: Pete Batard <mailto:pete@akeo.ie>" -msgstr "ترجمه فارسی:\\line‏ •مستر ویتو <mailto:mv@mvaop.ir>\\line‏ •ضیاءالدین عظیمی <mailto:s.zia.azimi@gmail.com>" +msgstr "ترجمه فارسی:\\line‏ •روبی <mailto:mv@mvaop.ir>\\line‏ •ضیاءالدین عظیمی <mailto:s.zia.azimi@gmail.com>" #. • MSG_177 msgid "Report bugs or request enhancements at:" @@ -1800,6 +1800,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "باز کردن یا خواندن %s ممکن نیست" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "اعمال کردن SkuSiPolicy.p7b در هنگام نصب کردن (نگاه کردن به KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "بهبود های QoL (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "اعمال سفارشی سازی ویندوز: %s" @@ -1850,17 +1858,17 @@ msgstr "لیست مداوم" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"فایل دیگری ('diskcopy.dll:) نیاز است دانلود شود از مایکروسافت برای نصب MS-DOS:\n" +"برای استفاده از این ویژگی، باید یک فایل اضافی ('%s') از مایکروسافت دانلود شود:\n" "- انتخاب :'بله' برای وصل شدن به اینترنت و دانلود آن\n" "- انتخاب 'نه' برای کنسل کردن این کار\n" "\n" -"نکته: فایل در مکان نرم افزار دانلود میشود و دوباره استفاده میشود درصورت انجام مجدد این کار." +"نکته: فایل در مکان نرم افزار دانلود میشود و درصورت نیاز دوباره استفاده خواهد شد." #. • MSG_338 msgid "Revoked UEFI bootloader detected" @@ -1922,6 +1930,119 @@ msgstr "استراج کردن فایل های آرشیو: %s" msgid "Use Rufus MBR" msgstr "استفاده از Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "استفاده از بوتلودر امضا شده 'Windows CA 2023' (نیازمند به یک کامپیوتر سازگار است)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "درحال بررسی برای بوتلودر UEFI باطل." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "درحال بررسی بروزرسانی برای UEFI DBX..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "آپدیت DBX موجود است" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus یک نسخه بروزرسانی شده از فایل های DBX که در ابطال بررسی های UEFI Secure Boot استفاده میشوند پیدا کرده است, آیا میخواهید این بروزرسانی را بارگیری کنید؟ \n" +"- انتخاب 'بله' برای وصل شدن به اینترنت و دانلود آن\n" +"- انتخاب 'نه' برای کنسل این عملیات\n" +"\n" +"نکته: فایل در مکان نرم افزار دانلود میشود و درصورت نیاز دوباره استفاده خواهد شد." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠مخفیانه⚠ دیسک را پاک کن و نصب کن:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"شما انتخاب کرده‌اید که از گزینه نصب ویندوز «مخفیانه» استفاده کنید.\n" +"\n" +"این یک گزینه پیشرفته است که برای افرادی در نظر گرفته شده است که می‌خواهند مدیا ایجاد کنند که در حین نصب ویندوز به کاربر اطلاع ندهد و بنابراین بدون قید و شرط اولین دیسک شناسایی شده روی سیستم هدف را پاک کند. اگر مراقب نباشید، استفاده از این گزینه می‌تواند منجر به از دست رفتن غیرقابل برگشت داده‌ ها شود!\n" +"\n" +"اگر این چیزی نیست که می‌خواهید، لطفاً برای بازگشت و برداشتن تیک گزینه، «خیر» را انتخاب کنید.\n" +"\n" +"در غیر این صورت، اگر «بله» را انتخاب کنید، موافقید که تمام مسئولیت هرگونه از دست رفتن داده‌ ها کاملاً بر عهده شما خواهد بود." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "محل پشتیبانی نشده ایمیج (Image)" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"شما نمیتوانید از این ایمیج که در درایو موردنظر است استفاده کنید. زیرا این درایو قرار است کاملا پاک شود, مثل این میماند که میخواهید شاخه درختی که بر روی آن نشسته اید را ببرید! \n" +"\n" +"لطفا ایمیج را به یه محل دیگه منتقل کنید و دوباره تلاش کنید." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "روشن گزاشتن این گزینه امن است زیرا حتی اگر TPM و یا RAM بیشتر داشته باشید, زیرا که این گزینه فقط باعث دور زدن الزامات نصب میباشد و باعث جلوگیری ویندوز از استفاده نکردن از تمامی سخت افزار موجود نمیشود." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "برای اینکه این گزینه کار کند, باید اینترنت/شبکه در هنگام نصب قطع باشد!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "بصورت خودکار به سوالات ارسال داده به مایکروسافت 'نه' بگو, بجای اینکه از کاربر درخواست کنی." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "شما باید این گزینه را فعال بگزارید, مگراینکه میخواهید 'Windows To Go' به دیسک داخلی دسترسی داشته باشد و بصورت مخفیانه بروزرسانی غیرقابل برگشت در File System انجام دهد." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "به طور خودکار یک حساب محلی با نام کاربری مشخص شده ایجاد می‌کند، با استفاده از یک رمز عبور خالی که باید در ورود بعدی تغییر کند." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "تنظیمات منطقه ای را از همین کامپیوتر (کیبورد, وقت منطقه ای, واحد پول), بجای اینکه از کاربر پرسیده شود." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "هارد سیستم را رمزگزاری نکن, مگر اینکه کاربر صریحاً درخواست کرده باشد." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "از این گزینه فقط در صورتی که میدانید S-Mode چیست و میدانید که ممکن است سیستم شما در حالت S-Mode قفل شود حتی بعد از اینکه شما کاملا ویندوز را پاک و دوباره نصب کردید استفاده کنید." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "از این گزینه درصورتی استفاده کنید که سیستمی که میخواهید بر روی آن ویندوز نصب کنید از آخرین گواهینامه های Secure Boot دارا است, درصورت نیاز, میتواند با استفاده از 'Mosby' سیستم خود را بروزرسانی کنید." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "از این گزینه فقط درصورتی که میخواهید بوتلودر های ناامن ویندوز را لغو کنید, اما با پتانسیل جلوگیری از بوت شدن ویندوز مدیا استاندارد." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "\"Quality of Life\"" + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "اگر میخواهید از این گزینه استفاده کنید, لطفا تمامی دیسک ها از کامپیوتر موردنظر قطع کنید, بجز آنکه میخواهید ویندوز را در آن نصب کنید, و همچنین فلش را به کامپیوتری که نمی‌خواهید اطلاعاتش پاک شود، متصل نگذارید." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 1145a4ba..c20fe07d 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -26,7 +26,7 @@ # • v3.22 "lt-LT" "Lithuanian (Lietuvių)" # • v3.22 "ms-MY" "Malay (Bahasa Malaysia)" # • v4.14 "nb-NO" "Norwegian (Norsk)" -# • v4.5 "fa-IR" "Persian (پارسی)" +# • v4.14 "fa-IR" "Persian (پارسی)" # • v4.14 "pl-PL" "Polish (Polski)" # • v4.14 "pt-BR" "Portuguese Brazilian (Português do Brasil)" # • v4.14 "pt-PT" "Portuguese Standard (Português)" @@ -10151,7 +10151,7 @@ t MSG_922 "Last ned UEFI kommandolinje ISOer" ######################################################################### l "fa-IR" "Persian (پارسی)" 0x0429 -v 4.5 +v 4.14 b "en-US" a "r" @@ -10348,7 +10348,7 @@ t MSG_129 "شما درایو UEFI:NTFS ایجاد کردید. لطفا به یا t MSG_130 "انتخاب ایمیج (Image) ویندوز" t MSG_131 "این فایل ISO چند ایمیج (Image) مختلف ویندوز دارد.\nلطفا ایمیجی که می‌خواهید نصب کنید را انتخاب کنید:" t MSG_132 "برنامه دیگری در حال استفاده از این درایو است. آیا می‌خواهید در هر صورت این درایو را فرمت کنید؟" -t MSG_133 "Rufus تشخیص داده است که شما می‌خواهید با ISO ورژن 1809 درایوی با قابلیت «Windows To Go» ایجاد کنید.\nبه دلیل باگی که شرکت مایکروسافت در این مورد دارد؛ در هنگام راه‌اندازی ویندوز به خطای «Blue Screen Of Death» خواهید خورد. برای رفع این مشکل می‌توانید فایل 'WppRecorder.sys' را با ورژن 1803 جایگزین کنید.\nهمچنین در نظر داشته باشید به دلیل اینکه کپی‌رایت فایل 'WppRecorder.sys' برای مایکروسافت است؛ Rufus نمی‌تواند به صورت خودکار این مشکل را برای شما برطرف کند و این فایل را در برنامه خود قرار دهد." +t MSG_133 "Rufus تشخیص داده است که شما می‌خواهید با ISO ورژن 1809 درایوی با قابلیت «Windows To Go» ایجاد کنید.\nبه دلیل باگی که شرکت مایکروسافت در این مورد دارد؛ در هنگام راه‌اندازی ویندوز به خطای «Blue Screen Of Death» برخورد خواهید کرد. برای رفع این مشکل می‌توانید فایل 'WppRecorder.sys' را با ورژن 1803 جایگزین کنید.\nهمچنین در نظر داشته باشید به دلیل اینکه حق نشر فایل 'WppRecorder.sys' برای مایکروسافت است؛ Rufus نمی‌تواند به صورت خودکار این مشکل را برای شما برطرف کند و این فایل را در برنامه خود قرار دهد." t MSG_134 "چون MBR برای ساختار پارتیشن انتخاب شده است؛ Rufus تنها می‌تواند پارتیشن با حداکثر ظرفیت 2TB روی این دیسک ایجاد کند. بنابراین %s از ظرفیت دیسک در دسترس نخواهد بود.\nآیا برای ادامه این عملیات مطمئن هستید؟" t MSG_135 "نسخه" t MSG_136 "انتشار" @@ -10389,7 +10389,7 @@ t MSG_172 "امضای فایل دانلود شده معتبر نیست" t MSG_173 "برای انتخاب کلیک کنید..." t MSG_174 "Rufus، ابزاری کاربردی و قابل‌اطمینان برای فرمت کردن درایوهای USB" t MSG_175 "نسخه %d.%d (Build %d)" -t MSG_176 "ترجمه فارسی:\\line‏ •مستر ویتو <mailto:mv@mvaop.ir>\\line‏ •ضیاءالدین عظیمی <mailto:s.zia.azimi@gmail.com>" +t MSG_176 "ترجمه فارسی:\\line‏ •روبی <mailto:mv@mvaop.ir>\\line‏ •ضیاءالدین عظیمی <mailto:s.zia.azimi@gmail.com>" t MSG_177 "گزارش اشکال (Bug) یا درخواست قابلیت جدید و بهبود نرم‌افزار در:" t MSG_178 "حقوق نشر دیگران:" t MSG_179 "سیاست به‌روزرسانی:" @@ -10536,6 +10536,8 @@ t MSG_319 "Boot Marker را نادیده بگیرید" t MSG_320 "در حال تازه کردن طرح پارتیشن (%s)..." t MSG_321 "تصویری که انتخاب کرده‌اید ISOHybrid است، اما سازندگان آن آنرا با حالت کپی ISO/File سازگار نکرده‌اند.\nدر نتیجه حالت نوشتن تصویر DD اعمال خواهد شد." t MSG_322 "باز کردن یا خواندن %s ممکن نیست" +t MSG_323 "اعمال کردن SkuSiPolicy.p7b در هنگام نصب کردن (نگاه کردن به KB5042562)" +t MSG_324 "بهبود های QoL (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" t MSG_325 "اعمال سفارشی سازی ویندوز: %s" t MSG_326 "اعمال گزینه های کاربر..." t MSG_327 "تجربه کاربری ویندوز" @@ -10548,7 +10550,7 @@ t MSG_333 "یک حساب کاربری محلی با نام کاربری ایجا t MSG_334 "گزینه های منطقه ای را روی همان مقادیر این کاربر تنظیم کنید" t MSG_335 "رمزگذاری خودکار دستگاه BitLocker را غیرفعال کنید" t MSG_336 "لیست مداوم" -t MSG_337 "برای استفاده از این ویژگی، باید یک فایل اضافی ('%s') از مایکروسافت دانلود شود:\n- انتخاب :'بله' برای وصل شدن به اینترنت و دانلود آن\n- انتخاب 'نه' برای کنسل کردن این کار\n\nنکته: فایل در مکان نرم افزار دانلود میشود و دوباره استفاده میشود درصورت انجام مجدد این کار." +t MSG_337 "برای استفاده از این ویژگی، باید یک فایل اضافی ('%s') از مایکروسافت دانلود شود:\n- انتخاب :'بله' برای وصل شدن به اینترنت و دانلود آن\n- انتخاب 'نه' برای کنسل کردن این کار\n\nنکته: فایل در مکان نرم افزار دانلود میشود و درصورت نیاز دوباره استفاده خواهد شد." t MSG_338 "بوت لودر UEFI کنسل شده شناسایی شد" t MSG_339 "Rufus متوجه شده که فایل ISO که انتخاب کردید دارای UEFI بوت لودری است که لفو شده و باعث %s, درصورتی که بوت امن فعال شده بر روی سیستم کاملا اپدیت شده UEFI\v\v- اگه شما این فایل ISO رو از یک جای غیر قابل اعتماد دریافت کردید ممکن است این فایل دارای ویروس UEFI باشد و نباید آنرا بوت کرد \n\v- اگه شما شما از جای مورد اغفماد دریافت کردیدش, میتونید تلاش کنید برای پیدا کردن نسخه جدیدتر, با اینکار دیگر این هشتار را دریافت نمیکنید." t MSG_340 "یک صفحه \"مشکلی امنیتی\"" @@ -10560,6 +10562,27 @@ t MSG_346 "مجبور کردن ویندوز به S-Mode ( دارای مشکلا t MSG_347 "بخش حرفه ای" t MSG_348 "استراج کردن فایل های آرشیو: %s" t MSG_349 "استفاده از Rufus MBR" +t MSG_350 "استفاده از بوتلودر امضا شده 'Windows CA 2023' (نیازمند به یک کامپیوتر سازگار است)" +t MSG_351 "درحال بررسی برای بوتلودر UEFI باطل." +t MSG_352 "درحال بررسی بروزرسانی برای UEFI DBX..." +t MSG_353 "آپدیت DBX موجود است" +t MSG_354 "Rufus یک نسخه بروزرسانی شده از فایل های DBX که در ابطال بررسی های UEFI Secure Boot استفاده میشوند پیدا کرده است, آیا میخواهید این بروزرسانی را بارگیری کنید؟ \n- انتخاب 'بله' برای وصل شدن به اینترنت و دانلود آن\n- انتخاب 'نه' برای کنسل این عملیات\n\nنکته: فایل در مکان نرم افزار دانلود میشود و درصورت نیاز دوباره استفاده خواهد شد." +t MSG_355 "⚠مخفیانه⚠ دیسک را پاک کن و نصب کن:" +t MSG_356 "شما انتخاب کرده‌اید که از گزینه نصب ویندوز «مخفیانه» استفاده کنید.\n\nاین یک گزینه پیشرفته است که برای افرادی در نظر گرفته شده است که می‌خواهند مدیا ایجاد کنند که در حین نصب ویندوز به کاربر اطلاع ندهد و بنابراین بدون قید و شرط اولین دیسک شناسایی شده روی سیستم هدف را پاک کند. اگر مراقب نباشید، استفاده از این گزینه می‌تواند منجر به از دست رفتن غیرقابل برگشت داده‌ ها شود!\n\nاگر این چیزی نیست که می‌خواهید، لطفاً برای بازگشت و برداشتن تیک گزینه، «خیر» را انتخاب کنید.\n\nدر غیر این صورت، اگر «بله» را انتخاب کنید، موافقید که تمام مسئولیت هرگونه از دست رفتن داده‌ ها کاملاً بر عهده شما خواهد بود." +t MSG_358 "محل پشتیبانی نشده ایمیج (Image)" +t MSG_359 "شما نمیتوانید از این ایمیج که در درایو موردنظر است استفاده کنید. زیرا این درایو قرار است کاملا پاک شود, مثل این میماند که میخواهید شاخه درختی که بر روی آن نشسته اید را ببرید! \n\nلطفا ایمیج را به یه محل دیگه منتقل کنید و دوباره تلاش کنید." +t MSG_360 "روشن گزاشتن این گزینه امن است زیرا حتی اگر TPM و یا RAM بیشتر داشته باشید, زیرا که این گزینه فقط باعث دور زدن الزامات نصب میباشد و باعث جلوگیری ویندوز از استفاده نکردن از تمامی سخت افزار موجود نمیشود." +t MSG_361 "برای اینکه این گزینه کار کند, باید اینترنت/شبکه در هنگام نصب قطع باشد!" +t MSG_362 "بصورت خودکار به سوالات ارسال داده به مایکروسافت 'نه' بگو, بجای اینکه از کاربر درخواست کنی." +t MSG_363 "شما باید این گزینه را فعال بگزارید, مگراینکه میخواهید 'Windows To Go' به دیسک داخلی دسترسی داشته باشد و بصورت مخفیانه بروزرسانی غیرقابل برگشت در File System انجام دهد." +t MSG_364 "به طور خودکار یک حساب محلی با نام کاربری مشخص شده ایجاد می‌کند، با استفاده از یک رمز عبور خالی که باید در ورود بعدی تغییر کند." +t MSG_365 "تنظیمات منطقه ای را از همین کامپیوتر (کیبورد, وقت منطقه ای, واحد پول), بجای اینکه از کاربر پرسیده شود." +t MSG_366 "هارد سیستم را رمزگزاری نکن, مگر اینکه کاربر صریحاً درخواست کرده باشد." +t MSG_367 "از این گزینه فقط در صورتی که میدانید S-Mode چیست و میدانید که ممکن است سیستم شما در حالت S-Mode قفل شود حتی بعد از اینکه شما کاملا ویندوز را پاک و دوباره نصب کردید استفاده کنید." +t MSG_368 "از این گزینه درصورتی استفاده کنید که سیستمی که میخواهید بر روی آن ویندوز نصب کنید از آخرین گواهینامه های Secure Boot دارا است, درصورت نیاز, میتواند با استفاده از 'Mosby' سیستم خود را بروزرسانی کنید." +t MSG_369 "از این گزینه فقط درصورتی که میخواهید بوتلودر های ناامن ویندوز را لغو کنید, اما با پتانسیل جلوگیری از بوت شدن ویندوز مدیا استاندارد." +t MSG_370 "\"Quality of Life\"" +t MSG_371 "اگر میخواهید از این گزینه استفاده کنید, لطفا تمامی دیسک ها از کامپیوتر موردنظر قطع کنید, بجز آنکه میخواهید ویندوز را در آن نصب کنید, و همچنین فلش را به کامپیوتری که نمی‌خواهید اطلاعاتش پاک شود، متصل نگذارید." t MSG_900 "Rufus ابزاری است که به فرمت و ایجاد درایوهای فلش USB قابل بوت، مانند کلیدهای USB/pendrives، مموری استیک ها و غیره به شما کمک می کند." t MSG_901 "سایت رسمی: %s" t MSG_902 "منبع کد: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 14def5c3..7bf1e095 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.14.2357" +CAPTION "Rufus 4.14.2358" 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,14,2357,0 - PRODUCTVERSION 4,14,2357,0 + FILEVERSION 4,14,2358,0 + PRODUCTVERSION 4,14,2358,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.14.2357" + VALUE "FileVersion", "4.14.2358" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2357" + VALUE "ProductVersion", "4.14.2358" END END BLOCK "VarFileInfo" From 847dee9759ffb2909a077af1fa6ad9c90086b8a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=94=E6=9C=88=E9=9B=A8?= <samidare3desu@gmail.com> Date: Fri, 10 Apr 2026 14:02:32 +0100 Subject: [PATCH 168/192] [loc] update Japanese translation to latest --- res/loc/po/ja-JP.po | 140 ++++++++++++++++++++++++++++++++++++++++---- res/loc/rufus.loc | 29 ++++++++- src/rufus.rc | 10 ++-- 3 files changed, 161 insertions(+), 18 deletions(-) diff --git a/res/loc/po/ja-JP.po b/res/loc/po/ja-JP.po index 751de4f9..a49b2727 100644 --- a/res/loc/po/ja-JP.po +++ b/res/loc/po/ja-JP.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-05-09 21:04+0900\n" -"PO-Revision-Date: 2024-05-09 22:07+0900\n" +"POT-Creation-Date: 2026-04-03 17:56+0900\n" +"PO-Revision-Date: 2026-04-10 21:59+0900\n" "Last-Translator: \n" "Language-Team: \n" "Language: ja_JP\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Japanese (日本語)\n" "X-Rufus-LCID: 0x0411\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -847,7 +847,7 @@ msgstr "保存領域なし" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "ライブ USB メディアの保存領域のサイズを設定します。 サイズを 0 に設定すると保存領域が無効になります。保存領域は「Persistent パーティション」「Persistence 機能」とも言われます。" @@ -889,13 +889,13 @@ msgstr "別のプログラムまたはプロセスがこのドライブにアク #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"1809 バージョンの ISO を使用して Windows To Go のメディアを作成しようとしていることを検出しました。\n" +"Rufusは1809 バージョンの ISO を使用して Windows To Go のメディアを作成しようとしていることを検出しました。\n" "\n" "このメディアは、“WppRecorder.sys” を 1803 バージョンのファイルに手動で置き換えない限り、Windowsのブート中にクラッシュ (ブルースクリーン) します。これは * Microsoftのバグ * によるものです。\n" "\n" @@ -1799,6 +1799,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "'%s'の読み取り" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "インストール時にSkuSiPolicy.p7bを適応する(KB5042562を参照)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "利便性向上パッチ(Microsoftの各種ソフトウェアの無効化)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Windowsカスタムを適応: %s" @@ -1849,13 +1857,13 @@ msgstr "永続ログ" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"MS-DOSをインストールするにはMicrosoftから追加のファイル(diskcopy.dll)をダウンロードする必要があります。\n" +"この機能を使用するには、Microsoft から追加のファイル ('%s') をダウンロードする必要があります:\n" "- はいを選択すると、インターネットに接続しダウンロードします。\n" "- いいえを選択すると、キャンセルします\n" "\n" @@ -1923,6 +1931,118 @@ msgstr "ファイルを展開中: %s" msgid "Use Rufus MBR" msgstr "Rufus MBRを使用する" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Windows CA 2023署名のブートローダーを使用する (対応するPCが必要です)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "UEFIブートローダーの有効性を確認中..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "UEFI DBXのアップデートをチェック中..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "DBXのアップデートが利用可能です。" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"UEFIセキュアブートの有効性チェックに使用するDBXファイルの新しいバージョンを発見しました。ダウンロードしますか?\n" +"- はいを選択すると、インターネットに接続しダウンロードします。\n" +"- いいえを選択すると、キャンセルします\n" +"\n" +"注意:ファイルはアプリケーションのディレクトリへダウンロードされ、今後自動的に再利用されます。" + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠サイレント⚠ ディスクの削除とインストール:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Windowsのサイレントインストールオプションを選択しました。\n" +"\n" +"これはWindowsのインストールを完全自動化するための高度なオプションであり、システムが最初に検知したディスクを無条件に削除します。操作を誤ると予期せぬデータ喪失を引き起こす可能性があります!\n" +"\n" +"このオプションを選択したことによるいかなるデータの喪失も自己責任となることに同意する場合、[はい]を選択してください。\n" +"同意しない場合は[いいえ]を選択し、このオプションのチェックを外してください。" + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "サポートされていないイメージのロケーション" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"ターゲットドライブに配置されたファイルは書き込み時に完全に削除されるため、このファイルを使用することはできません。\n" +"\n" +"ファイルを移動し再試行してください。" + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "このオプションはセットアップの要件のみをスキップし、Windowsの機能には影響を与えないため、TPMや十分なRAMがある場合でも有効化しておくことが推奨されます。" + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "このオプションを利用するためにはインストール時にネットワークから確実に接続解除されなければなりません!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Windowsのインストール時にMicrosoftのデータ収集オプションに自動的に[いいえ]と回答します。" + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Windows To Goが内部ディスクにアクセスし不可逆なアップグレードを行うことを了承しない限りこのオプションを有効にすることが推奨されます。" + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "指定されたユーザー名で自動的にローカルアカウントを作成します。パスワードは空欄の為、ログイン時に変更が必要です。" + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "このPCの地域設定(キーボード、タイムゾーン、通貨設定)をコピーすることでユーザー入力を省略します。" + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "ユーザーの明示的な操作がない限りシステムディスクを暗号化しません。" + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Sモードの仕組みとWindowsをクリーンインストールしてもSモードが残る可能性を理解している場合のみこのオプションを有効にしてください。" + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "最新のセキュアブート証明でWindowsを使用する場合はこのオプションを有効化してください。必要に応じてMosbyを使ってシステムを更新することもできます。" + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "危険な可能性のあるWindowsブートローダーを無効化したい場合このオプションを有効化してください。ただし、通常のWindowsメディアが起動しなくなる可能性があります。" + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Microsoftが強制する不要な機能の大半を無効化することにより利便性を向上します。" + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "このオプションを使用する場合はWindowsをインストールするディスク以外を全て取り外して、削除しないメディアを残さないでください。" + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index c20fe07d..da3c1ad5 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -20,7 +20,7 @@ # • v4.14 "hu-HU" "Hungarian (Magyar)" # • v4.14 "id-ID" "Indonesian (Bahasa Indonesia)" # • v4.5 "it-IT" "Italian (Italiano)" -# • v4.5 "ja-JP" "Japanese (日本語)" +# • v4.14 "ja-JP" "Japanese (日本語)" # • v4.5 "ko-KR" "Korean (한국어)" # • v4.14 "lv-LV" "Latvian (Latviešu)" # • v3.22 "lt-LT" "Lithuanian (Lietuvių)" @@ -7613,7 +7613,7 @@ t MSG_922 "Scarica le ISO della shell UEFI" ###################################################################### l "ja-JP" "Japanese (日本語)" 0x0411 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -7800,7 +7800,7 @@ t MSG_129 "UEFI:NTFS ブートローダーを使用するメディアを作成 t MSG_130 "Windows イメージの選択" t MSG_131 "この ISO には複数の Windows イメージが含まれます。\nこのインストールに使用したいイメージを選択してください。" t MSG_132 "別のプログラムまたはプロセスがこのドライブにアクセスしています。このままフォーマットしますか?" -t MSG_133 "1809 バージョンの ISO を使用して Windows To Go のメディアを作成しようとしていることを検出しました。\n\nこのメディアは、“WppRecorder.sys” を 1803 バージョンのファイルに手動で置き換えない限り、Windowsのブート中にクラッシュ (ブルースクリーン) します。これは * Microsoftのバグ * によるものです。\n\n“WppRecorder.sys” は Microsoft の著作権で保護されたファイルであり、アプリケーションにファイルのコピーを合法的に埋め込めないため、Rufus が自動的にこの不具合を修正することはできません。" +t MSG_133 "Rufusは1809 バージョンの ISO を使用して Windows To Go のメディアを作成しようとしていることを検出しました。\n\nこのメディアは、“WppRecorder.sys” を 1803 バージョンのファイルに手動で置き換えない限り、Windowsのブート中にクラッシュ (ブルースクリーン) します。これは * Microsoftのバグ * によるものです。\n\n“WppRecorder.sys” は Microsoft の著作権で保護されたファイルであり、アプリケーションにファイルのコピーを合法的に埋め込めないため、Rufus が自動的にこの不具合を修正することはできません。" t MSG_134 "パーティション構成に MBR が選択されているため、Rufus はこのメディア上に最大 2 TB のパーティションしか作成できません。そのため、%s のディスク容量が使用できなくなります。\n\n続けますか?" t MSG_135 "バージョン" t MSG_136 "リリース" @@ -7987,6 +7987,8 @@ t MSG_319 "Boot Maker を無視" t MSG_320 "パーティション レイアウトを更新中 (%s)" t MSG_321 "選択されたイメージはハイブリッド ISO 形式ですが、 ISO イメージ モード / ファイル コピー モードと互換性がありません。\nそのため、書き込みには DD イメージ モードが適用されます。" t MSG_322 "'%s'の読み取り" +t MSG_323 "インストール時にSkuSiPolicy.p7bを適応する(KB5042562を参照)" +t MSG_324 "利便性向上パッチ(Microsoftの各種ソフトウェアの無効化)" t MSG_325 "Windowsカスタムを適応: %s" t MSG_326 "ユーザー設定を適応中..." t MSG_327 "Windows ユーザーエクスペリエンス" @@ -8012,6 +8014,27 @@ t MSG_346 "WindowsのSモードを強制する(オンラインアカウント要 t MSG_347 "エキスパートモード" t MSG_348 "ファイルを展開中: %s" t MSG_349 "Rufus MBRを使用する" +t MSG_350 "Windows CA 2023署名のブートローダーを使用する (対応するPCが必要です)" +t MSG_351 "UEFIブートローダーの有効性を確認中..." +t MSG_352 "UEFI DBXのアップデートをチェック中..." +t MSG_353 "DBXのアップデートが利用可能です。" +t MSG_354 "UEFIセキュアブートの有効性チェックに使用するDBXファイルの新しいバージョンを発見しました。ダウンロードしますか?\n- はいを選択すると、インターネットに接続しダウンロードします。\n- いいえを選択すると、キャンセルします\n\n注意:ファイルはアプリケーションのディレクトリへダウンロードされ、今後自動的に再利用されます。" +t MSG_355 "⚠サイレント⚠ ディスクの削除とインストール:" +t MSG_356 "Windowsのサイレントインストールオプションを選択しました。\n\nこれはWindowsのインストールを完全自動化するための高度なオプションであり、システムが最初に検知したディスクを無条件に削除します。操作を誤ると予期せぬデータ喪失を引き起こす可能性があります!\n\nこのオプションを選択したことによるいかなるデータの喪失も自己責任となることに同意する場合、[はい]を選択してください。\n同意しない場合は[いいえ]を選択し、このオプションのチェックを外してください。" +t MSG_358 "サポートされていないイメージのロケーション" +t MSG_359 "ターゲットドライブに配置されたファイルは書き込み時に完全に削除されるため、このファイルを使用することはできません。\n\nファイルを移動し再試行してください。" +t MSG_360 "このオプションはセットアップの要件のみをスキップし、Windowsの機能には影響を与えないため、TPMや十分なRAMがある場合でも有効化しておくことが推奨されます。" +t MSG_361 "このオプションを利用するためにはインストール時にネットワークから確実に接続解除されなければなりません!" +t MSG_362 "Windowsのインストール時にMicrosoftのデータ収集オプションに自動的に[いいえ]と回答します。" +t MSG_363 "Windows To Goが内部ディスクにアクセスし不可逆なアップグレードを行うことを了承しない限りこのオプションを有効にすることが推奨されます。" +t MSG_364 "指定されたユーザー名で自動的にローカルアカウントを作成します。パスワードは空欄の為、ログイン時に変更が必要です。" +t MSG_365 "このPCの地域設定(キーボード、タイムゾーン、通貨設定)をコピーすることでユーザー入力を省略します。" +t MSG_366 "ユーザーの明示的な操作がない限りシステムディスクを暗号化しません。" +t MSG_367 "Sモードの仕組みとWindowsをクリーンインストールしてもSモードが残る可能性を理解している場合のみこのオプションを有効にしてください。" +t MSG_368 "最新のセキュアブート証明でWindowsを使用する場合はこのオプションを有効化してください。必要に応じてMosbyを使ってシステムを更新することもできます。" +t MSG_369 "危険な可能性のあるWindowsブートローダーを無効化したい場合このオプションを有効化してください。ただし、通常のWindowsメディアが起動しなくなる可能性があります。" +t MSG_370 "Microsoftが強制する不要な機能の大半を無効化することにより利便性を向上します。" +t MSG_371 "このオプションを使用する場合はWindowsをインストールするディスク以外を全て取り外して、削除しないメディアを残さないでください。" t MSG_900 "Rufus (ルーファス) とは、起動可能なUSBフラッシュドライブ(USBメモリなど)を作成したり、フォーマットをするためのソフトウェアです。" t MSG_901 "公式サイト: %s" t MSG_902 "ソースコード: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 7bf1e095..678cc401 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.14.2358" +CAPTION "Rufus 4.14.2359" 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,14,2358,0 - PRODUCTVERSION 4,14,2358,0 + FILEVERSION 4,14,2359,0 + PRODUCTVERSION 4,14,2359,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.14.2358" + VALUE "FileVersion", "4.14.2359" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2358" + VALUE "ProductVersion", "4.14.2359" END END BLOCK "VarFileInfo" From 6f32d59666eedd3a84918554b449a3d840f806ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=BE=D1=81=D1=82=D1=8F=D0=BD=D1=82=D0=B8=D0=BD=20?= =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D1=96=D0=B9=D0=BE=D0=B2=D0=B8=D1=87?= <mind.converter@gmail.com> Date: Sat, 11 Apr 2026 19:37:56 +0100 Subject: [PATCH 169/192] [loc] update Ukrainian translation to latest * Also fix a missing apostrophe in MSG_356 for English. --- res/loc/po/uk-UA.po | 142 ++++++++++++++++++++++++++++++++++++++++---- res/loc/rufus.loc | 33 ++++++++-- src/rufus.rc | 10 ++-- 3 files changed, 164 insertions(+), 21 deletions(-) diff --git a/res/loc/po/uk-UA.po b/res/loc/po/uk-UA.po index dc93bf4b..2fdeaa56 100644 --- a/res/loc/po/uk-UA.po +++ b/res/loc/po/uk-UA.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-07-23 23:38+0300\n" -"PO-Revision-Date: 2024-07-23 23:42+0300\n" +"POT-Creation-Date: 2026-04-03 21:31+0300\n" +"PO-Revision-Date: 2026-04-10 21:29+0300\n" "Last-Translator: \n" "Language-Team: \n" "Language: uk_UA\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Ukrainian (Українська)\n" "X-Rufus-LCID: 0x0422\n" -"X-Generator: Poedit 3.4.4\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "Тб" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "Пб" @@ -846,7 +846,7 @@ msgstr "Деактивовано" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Встановіть розмір розділу збереження для Live USB-накопичувача. Щоб вимкнути розділ збереження встановіть розмір 0." @@ -888,13 +888,13 @@ msgstr "Інша програма чи процес отримують дост #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Rufus виявив, що ви намагаєтесь створити носій Windows To Go, заснований на версії ISO 1809\n" +"Rufus виявив, що ви намагаєтесь створити носій Windows To Go, заснований на версії ISO 1809.\n" "\n" "Через *ПОМИЛКУ MICROSOFT* цей носій буде припиняти роботу під час завантаження Windows (Синій екран смерті), доки ви вручну не перенесете файл 'WppRecorder.sys' з версії 1803.\n" "\n" @@ -1504,7 +1504,7 @@ msgstr "Видалення каталога '%s'" #. • MSG_265 msgid "VMWare disk detection" -msgstr "Виявлено диск VMWare" +msgstr "Виявлення дисків VMWare" #. • MSG_266 msgid "Dual UEFI/BIOS mode" @@ -1795,6 +1795,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Неможливо відкрити чи прочитати '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Застосувати SkuSiPolicy.p7b під час встановлення (дивись KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Покращення QoL (виключено Copilot, OneDrive, Outlook, Fast Startup, тощо)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Застосування налаштувань Windows: %s" @@ -1845,13 +1853,13 @@ msgstr "Постійний журнал" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Необхідно завантажити додатковий файл ('diskcopy.dll') з сайту Microsoft для встановлення MS-DOS:\n" +"Щоб скористатися цією функцією, необхідно завантажити додатковий файл ('%s') з веб-сайту Microsoft:\n" "- Виберіть 'Так' для з'єднання з інтернетом та його завантаження\n" "- Виберіть 'Ні' для скасування операції\n" "\n" @@ -1919,6 +1927,118 @@ msgstr "Видобування архівованих файлів: %s" msgid "Use Rufus MBR" msgstr "Використовувати Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Використати завантажувач з підписом 'Windows CA 2023' (потребує сумісне обладнання)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Перевірка відкликання завантажувача UEFI..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Перевірка оновлень UEFI DBX..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "Доступне оновлення DBX" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus знайшов оновлену версію файлів DBX, що використовуються для перевірки відкликання завантажувача UEFI. Чи хочете ви їх завантажити?\n" +"- Виберіть 'Так', щоб завантажити файл з інтернету\n" +"- Виберіть 'Ні', щоб скасувати операцію\n" +"\n" +"Примітка: Файли будуть завантажені в поточний каталог додатку і будуть використовуватися повторно за необхідності." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠ТИХЕ⚠ видалення та встановлення:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Ви вибрали \"тихе\" встановлення Windows.\n" +"\n" +"Це додаткова опція, призначена для тих, хто хоче створити завантажувальний диск, який не відволікає користувача під час встановлення Windows, тому ПРИМУСОВО СТИРАЄ перший виявлений диск у цільовій системі. Необачне використання цього параметра може привести до БЕЗПОВОРОТНОЇ ВТРАТИ ДАНИХ!\n" +"\n" +"Якщо це не те, чого ви прагнете, будь ласка, виберіть 'Ні', щоб повернутись назад і деактивувати цю опцію.\n" +"В іншому випадку, якщо ви виберете 'Так', - ви ПОВНІСТЮ берете на себе відповідальність за можливу втрату інформації." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Непідтримуване розташування образа" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Ви не можете використовувати образ, що знаходиться на цільовому диску, так як цей диск буде повністю очищено. Як то кажуть \"не розхитуй човна, бо вивернешся\"!\n" +"\n" +"Будь ласка, перемістіть образ в інше місце і спробуйте знову." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Безпечно залишати цю опцію ввімкненою, навіть якщо у вас є TPM чи достатня кількість ОЗП, оскільки ця функція лише обходить вимоги до обладнання та не забороняє Windows використовувати всі наявні ресурси." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Щоб ця опція працювала необхідно вимкнути доступ до інтернету/мережі!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Автоматично відповідати 'ні' на запитання Windows, щодо обміну даними з Microsoft за користувача." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Залиште цю опцію ввімкненою, щоб заборонити 'Windows To Go' доступ до внутрішніх дисків та виконання непомітних безповоротних змін у файловій системі." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Автоматично створити локальний обліковий запис з заданим іменем користувача, використовуючи порожній пароль, який необхідно буде змінити під час наступного входу в систему." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Скопіювати регіональні налаштування з цього ПК (розкладка клавіатури, часовий пояс, валюти) замість того, щоб запитувати користувача." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Не шифрувати системний диск, окрім випадків, коли цього вимагає користувач." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Ввімкніть цю опцію, якщо знаєте, що таке S-Mode та розумієте, що ваша система може бути заблокована в S-Mode навіть після повної очистки та перевстановлення Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Ввімкніть цю опцію, якщо система, на яку ви плануєте встановити Windows має оновлені сертифікати завантажувача. За потреби, ви можете розглянути можливість використання 'Mosby' для оновлення системи." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Ввімкніть цю опцію, якщо хочете відкликати додаткові потенційно небезпечні завантажувачі Windows, але з можливістю також запобігти завантаженню стандартних носіїв Windows." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Покращення \"Quality of Life\": Вимкнення більшості небажаних функцій, які Microsoft намагається нав'язати кінцевому користувачу." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "За використання цієї функції відключіть від ПК будь-які диски за виключенням того, на який ви хочете встановити Windows, а, також, не залишайте носій підключеним до будь-якого ПК, дані з якого ви не хочете стерти." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index da3c1ad5..a5630988 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -39,7 +39,7 @@ # • v4.14 "sv-SE" "Swedish (Svenska)" # • v4.14 "th-TH" "Thai (ไทย)" # • v4.14 "tr-TR" "Turkish (Türkçe)" -# • v4.5 "uk-UA" "Ukrainian (Українська)" +# • v4.14 "uk-UA" "Ukrainian (Українська)" # • v4.5 "vi-VN" "Vietnamese (Tiếng Việt)" ######################################################################### @@ -623,7 +623,7 @@ t MSG_355 "⚠SILENTLY⚠ erase disk and install:" t MSG_356 "You have selected to use the \"silent\" Windows installation option.\n\n" "This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the " "first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n\nIf this is not what you want, please select 'No' " - "to go back and uncheck the option.\nOtherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." + "to go back and uncheck the option.\nOtherwise, if you select 'Yes', you agree that the whole responsibility for any data loss will be entirely with YOU." t MSG_358 "Unsupported image location" t MSG_359 "You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n\n" "Please move the image to a different location and try again." @@ -15858,7 +15858,7 @@ t MSG_922 "UEFI Shell ISO'larını indirin" ######################################################################### l "uk-UA" "Ukrainian (Українська)" 0x0422 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -16051,7 +16051,7 @@ t MSG_129 "Ви тільки що створили носій, що викори t MSG_130 "Вибір образу Windows" t MSG_131 "Цей ISO містить декілька образів Windows.\nБудь ласка, виберіть образ, котрий ви хочете використати для встановлення:" t MSG_132 "Інша програма чи процес отримують доступ до цього диска. Ви все одно бажаєте форматувати його?" -t MSG_133 "Rufus виявив, що ви намагаєтесь створити носій Windows To Go, заснований на версії ISO 1809\n\nЧерез *ПОМИЛКУ MICROSOFT* цей носій буде припиняти роботу під час завантаження Windows (Синій екран смерті), доки ви вручну не перенесете файл 'WppRecorder.sys' з версії 1803.\n\nТакож зауважте, що Rufus не може автоматично виправити цю помилку через те, що файл 'WppRecorder.sys' захищено авторським правом Microsoft, тому ми не можемо легально вставити копію файла в додаток..." +t MSG_133 "Rufus виявив, що ви намагаєтесь створити носій Windows To Go, заснований на версії ISO 1809.\n\nЧерез *ПОМИЛКУ MICROSOFT* цей носій буде припиняти роботу під час завантаження Windows (Синій екран смерті), доки ви вручну не перенесете файл 'WppRecorder.sys' з версії 1803.\n\nТакож зауважте, що Rufus не може автоматично виправити цю помилку через те, що файл 'WppRecorder.sys' захищено авторським правом Microsoft, тому ми не можемо легально вставити копію файла в додаток..." t MSG_134 "Через те, що для схеми розділів вибрано MBR, Rufus може створити розділ на цьому носії лише розміром до 2 Тб, що не дозволить використовувати %s дискового простору.\n\nВи бажаєте продовжити?" t MSG_135 "Версія" t MSG_136 "Реліз" @@ -16180,7 +16180,7 @@ t MSG_261 "Запис образа: %s" t MSG_262 "Підтримка ISO" t MSG_263 "Використання ПРАВИЛЬНОГО розміру одиниць" t MSG_264 "Видалення каталога '%s'" -t MSG_265 "Виявлено диск VMWare" +t MSG_265 "Виявлення дисків VMWare" t MSG_266 "Подвійний режим UEFI/BIOS" t MSG_267 "Застосування Windows-образа: %s" t MSG_268 "Застосування Windows-образа..." @@ -16238,6 +16238,8 @@ t MSG_319 "Ігнорувати Boot Marker" t MSG_320 "Оновлення макета розділу (%s)..." t MSG_321 "Вибраний образ має властивості ISOHybrid, проте його автор не потурбувався про сумісність з режимом копіювання ISO-файлів.\nЯк результат, буде примусово застосовано режим запису образів DD." t MSG_322 "Неможливо відкрити чи прочитати '%s'" +t MSG_323 "Застосувати SkuSiPolicy.p7b під час встановлення (дивись KB5042562)" +t MSG_324 "Покращення QoL (виключено Copilot, OneDrive, Outlook, Fast Startup, тощо)" t MSG_325 "Застосування налаштувань Windows: %s" t MSG_326 "Застосування параметрів користувача..." t MSG_327 "Інтерфейс користувача Windows" @@ -16263,6 +16265,27 @@ t MSG_346 "Обмежити Windows до S-Mode (НЕСУМІСНО з обхо t MSG_347 "Просунутий режим" t MSG_348 "Видобування архівованих файлів: %s" t MSG_349 "Використовувати Rufus MBR" +t MSG_350 "Використати завантажувач з підписом 'Windows CA 2023' (потребує сумісне обладнання)" +t MSG_351 "Перевірка відкликання завантажувача UEFI..." +t MSG_352 "Перевірка оновлень UEFI DBX..." +t MSG_353 "Доступне оновлення DBX" +t MSG_354 "Rufus знайшов оновлену версію файлів DBX, що використовуються для перевірки відкликання завантажувача UEFI. Чи хочете ви їх завантажити?\n- Виберіть 'Так', щоб завантажити файл з інтернету\n- Виберіть 'Ні', щоб скасувати операцію\n\nПримітка: Файли будуть завантажені в поточний каталог додатку і будуть використовуватися повторно за необхідності." +t MSG_355 "⚠ТИХЕ⚠ видалення та встановлення:" +t MSG_356 "Ви вибрали \"тихе\" встановлення Windows.\n\nЦе додаткова опція, призначена для тих, хто хоче створити завантажувальний диск, який не відволікає користувача під час встановлення Windows, тому ПРИМУСОВО СТИРАЄ перший виявлений диск у цільовій системі. Необачне використання цього параметра може привести до БЕЗПОВОРОТНОЇ ВТРАТИ ДАНИХ!\n\nЯкщо це не те, чого ви прагнете, будь ласка, виберіть 'Ні', щоб повернутись назад і деактивувати цю опцію.\nВ іншому випадку, якщо ви виберете 'Так', - ви ПОВНІСТЮ берете на себе відповідальність за можливу втрату інформації." +t MSG_358 "Непідтримуване розташування образа" +t MSG_359 "Ви не можете використовувати образ, що знаходиться на цільовому диску, так як цей диск буде повністю очищено. Як то кажуть \"не розхитуй човна, бо вивернешся\"!\n\nБудь ласка, перемістіть образ в інше місце і спробуйте знову." +t MSG_360 "Безпечно залишати цю опцію ввімкненою, навіть якщо у вас є TPM чи достатня кількість ОЗП, оскільки ця функція лише обходить вимоги до обладнання та не забороняє Windows використовувати всі наявні ресурси." +t MSG_361 "Щоб ця опція працювала необхідно вимкнути доступ до інтернету/мережі!" +t MSG_362 "Автоматично відповідати 'ні' на запитання Windows, щодо обміну даними з Microsoft за користувача." +t MSG_363 "Залиште цю опцію ввімкненою, щоб заборонити 'Windows To Go' доступ до внутрішніх дисків та виконання непомітних безповоротних змін у файловій системі." +t MSG_364 "Автоматично створити локальний обліковий запис з заданим іменем користувача, використовуючи порожній пароль, який необхідно буде змінити під час наступного входу в систему." +t MSG_365 "Скопіювати регіональні налаштування з цього ПК (розкладка клавіатури, часовий пояс, валюти) замість того, щоб запитувати користувача." +t MSG_366 "Не шифрувати системний диск, окрім випадків, коли цього вимагає користувач." +t MSG_367 "Ввімкніть цю опцію, якщо знаєте, що таке S-Mode та розумієте, що ваша система може бути заблокована в S-Mode навіть після повної очистки та перевстановлення Windows." +t MSG_368 "Ввімкніть цю опцію, якщо система, на яку ви плануєте встановити Windows має оновлені сертифікати завантажувача. За потреби, ви можете розглянути можливість використання 'Mosby' для оновлення системи." +t MSG_369 "Ввімкніть цю опцію, якщо хочете відкликати додаткові потенційно небезпечні завантажувачі Windows, але з можливістю також запобігти завантаженню стандартних носіїв Windows." +t MSG_370 "Покращення \"Quality of Life\": Вимкнення більшості небажаних функцій, які Microsoft намагається нав'язати кінцевому користувачу." +t MSG_371 "За використання цієї функції відключіть від ПК будь-які диски за виключенням того, на який ви хочете встановити Windows, а, також, не залишайте носій підключеним до будь-якого ПК, дані з якого ви не хочете стерти." t MSG_900 "Rufus це утиліта, яка допомагає форматувати та створювати завантажувальні флешки, картки пам'яті, тощо." t MSG_901 "Офіційний сайт: %s" t MSG_902 "Сирцевий код: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 678cc401..d534a131 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.14.2359" +CAPTION "Rufus 4.14.2360" 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,14,2359,0 - PRODUCTVERSION 4,14,2359,0 + FILEVERSION 4,14,2360,0 + PRODUCTVERSION 4,14,2360,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.14.2359" + VALUE "FileVersion", "4.14.2360" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2359" + VALUE "ProductVersion", "4.14.2360" END END BLOCK "VarFileInfo" From b5de282b8b14caed99c0fc5ec29488fd0d1a5333 Mon Sep 17 00:00:00 2001 From: Niko <niko@nikolan.net> Date: Sat, 11 Apr 2026 19:42:54 +0100 Subject: [PATCH 170/192] [loc] update Bulgarian translation to latest --- res/loc/po/bg-BG.po | 266 +++++++++++++++++++++++++++++++++++++------- res/loc/rufus.loc | 61 +++++++--- src/rufus.rc | 10 +- 3 files changed, 279 insertions(+), 58 deletions(-) diff --git a/res/loc/po/bg-BG.po b/res/loc/po/bg-BG.po index 822c85b8..3822b3de 100644 --- a/res/loc/po/bg-BG.po +++ b/res/loc/po/bg-BG.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 3.22\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2023-03-23 15:50+0000\n" -"PO-Revision-Date: 2023-03-23 15:53+0000\n" +"POT-Creation-Date: 2026-04-11 12:52+0300\n" +"PO-Revision-Date: 2026-04-11 13:47+0300\n" "Last-Translator: \n" "Language-Team: \n" "Language: bg_BG\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Bulgarian (Български)\n" "X-Rufus-LCID: 0x0402\n" -"X-Generator: Poedit 3.2.2\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -54,13 +54,11 @@ msgstr "Изброяване на USB дискове" msgid "Add fixes for old BIOSes (extra partition, align, etc.)" msgstr "Добави поправки за стари BIOS-и" -#. • IDD_DIALOG → IDC_RUFUS_MBR +#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION #. -#. 'MBR': See http://en.wikipedia.org/wiki/Master_boot_record -#. Rufus can install it's own custom MBR (the Rufus MBR), which also allows users to -#. specify a custom disk ID for the BIOS. The tooltip for this control is MSG_167. -msgid "Use Rufus MBR with BIOS ID" -msgstr "Използвай Rufus MBR с BIOS ID" +#. It is acceptable to drop the "runtime" if you are running out of space +msgid "Enable runtime UEFI media validation" +msgstr "Активиране на валидиране на UEFI носителя по време на работа" #. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT msgid "Format Options" @@ -209,7 +207,7 @@ msgid "" "To continue with this operation, click OK. To quit click CANCEL." msgstr "" "ВНИМАНИЕ: ВСИЧКАТА ИНФОРМАЦИЯ НА УСТРОЙСТВО '%s' ЩЕ БЪДЕ УНИЩОЖЕНА.\n" -"За да продължите с тази операция, натиснете OK. За да я прекратите, натиснете CANCEL." +"За да продължите с тази операция, натиснете OK. За да я прекратите, натиснете ОТКАЖИ." #. • MSG_004 msgid "Rufus update policy" @@ -310,7 +308,7 @@ msgstr "ТБ" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "ПБ" @@ -553,7 +551,7 @@ msgstr "Неподдържан образ" #. • MSG_082 msgid "This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus..." -msgstr "Този образ не е зареждащ или използва зареждащ или компресиращ метод който не се поддържа от Rufus.." +msgstr "Този образ не е зареждащ или използва зареждащ или компресиращ метод който не се поддържа от Rufus..." #. • MSG_083 msgid "Replace %s?" @@ -575,9 +573,9 @@ msgstr "" "Поради тази причина стартиращите менюта може да не бъдат изобразени правилно.\n" "\n" "По-нова версия може да бъде изтеглена от Rufus, за да отстрани този проблем:\n" -"- Изберете 'Yes', за да се свържете с интернет и да изтеглите необходимият файл\n" -"- Изберете 'No', за да продължите с настоящият ISO файл\n" -"Ако не знаете какво да правите, е препоръчително да изберете 'Yes'.\n" +"- Изберете 'Да', за да се свържете с интернет и да изтеглите необходимият файл\n" +"- Изберете 'Не', за да продължите с настоящият ISO файл\n" +"Ако не знаете какво да правите, е препоръчително да изберете 'Да'.\n" "\n" "Бележка: Този файл ще бъде изтеглен в настоящата директория и щом '%s' е наличен, процесът ще продължи автоматично." @@ -702,8 +700,8 @@ msgstr "" "Тъй като този файл е повече от 100 KB в размер и винаги присъства на %s ISO образи, той не е включен в Rufus.\n" "\n" "Rufus може да изтегли липсващият файл за вас:\n" -"- Изберете 'Yes', за да се свържете с интернет и да изтеглите файла\n" -"- Изберете 'No', ако искате ръчно да копирате този файл\n" +"- Изберете 'Да', за да се свържете с интернет и да изтеглите файла\n" +"- Изберете 'Не', ако искате ръчно да копирате този файл\n" "\n" "Бележка: Този файл ще бъде изтеглен в настоящата директория и щом '%s' е наличен, процесът ще продължи автоматично." @@ -769,8 +767,8 @@ msgstr "" "Този образ използва Syslinux %s%s, но тази програма включва само инсталационни файлове за Syslinux %s%s.\n" "\n" "Тъй като новите версии на Syslinux не са съвместими една с друга и няма да е възможно Rufus да ги включи всичките, два допълнителни файла трябва да бъдат изтеглени от Интернет ('ldlinux.sys' и 'ldlinux.bss'):\n" -"- Изберете 'Yes', за да се свържете с интернет и да изтеглите тези файлове\n" -"- Изберете 'No', за да прекратите тази операция\n" +"- Изберете 'Да', за да се свържете с интернет и да изтеглите тези файлове\n" +"- Изберете 'Не', за да прекратите тази операция\n" "\n" "Бележка: Тези файлове ще бъдат изтеглени в настоящата директория на програмата и ще бъдат използвани автоматично щом са налични." @@ -795,9 +793,9 @@ msgstr "" "Този образ използва GRUB %s Но приложението съдържа само инсталацйонните файлове за GRUB %s.\n" "\n" " Тъй като различните версии на GRUB може да не са съвместими една с друга и не е възможно да се включат всички, Rufus ще опита да намери версия на GRUB инсталационният файл ('core.img'), който съвпада с този от вашият образ: \n" -"- Изберете 'Yes', за да се свържете с интернет и да я изтеглите\n" -"- Изберете 'No', за да използвате версията по подразбиране на Rufus\n" -"- Изберете 'Cancel', за да прекратите операцията\n" +"- Изберете 'Да', за да се свържете с интернет и да я изтеглите\n" +"- Изберете 'Не', за да използвате версията по подразбиране на Rufus\n" +"- Изберете 'Откажи', за да прекратите операцията\n" "\n" "Забележка: Файлът ще бъде изтеглен в настоящата директория и ще бъде използван автоматично, щом е наличен. Ако не е намерено съвпадение, ще бъде използвана версията по подразбиране." @@ -848,7 +846,7 @@ msgstr "Без устойчивост" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Задайте размера на устойчивия дял за \"живото\" USB устройство. Ако го зададете на 0, устойчивия дял ще бъде изключен." @@ -890,17 +888,17 @@ msgstr "Друга програма или процес използва тов #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Rufus забеляза, че се опитвате да създадете носител с \"Windows To Go\", базиран на 1809 ISO.\n" +"Rufus установи, че се опитвате да създадете носител с \"Windows To Go\", базиран на ISO с версия 1809.\n" "\n" -"Поради *MICROSOFT BUG*, този носител ще крашне при зареждане на Windows (Син екран на смъртта), ако не замените ръчно файла 'WppRecorder.sys' със същия от версия 1803.\n" +"Поради *БЪГ НА MICROSOFT*, този носител ще крашне при зареждане на Windows (Син екран на смъртта), освен ако не замените ръчно файла 'WppRecorder.sys' с версията от 1803.\n" "\n" -"Забележка: Rufus не може автоматично да поправи това, защото файлът 'WppRecorder.sys' е запазен с авторско право от Microsoft, поради което не можем да съхраняваме легално копие на този файл в програмата..." +"Забележка: Rufus не може автоматично да поправи това, тъй като файлът 'WppRecorder.sys' е обект на авторско право на Microsoft и не можем законно да включим копие от него в приложението..." #. • MSG_134 msgid "" @@ -1043,16 +1041,8 @@ msgid "Check this box to allow the display of international labels and set a dev msgstr "Сложете тази отметка за да разрешите показването на интернационални етикети и да зададете икона на устройството (създава autorun.inf)" #. • MSG_167 -msgid "Install an MBR that allows boot selection and can masquerade the BIOS USB drive ID" -msgstr "Инсталира MBR, който позволява избор на операционна система и може да маскира BIOS USB устройствения ИД" - -#. • MSG_168 -msgid "" -"Try to masquerade first bootable USB drive (usually 0x80) as a different disk.\n" -"This should only be necessary if you install Windows XP and have more than one disk." -msgstr "" -"Опитва да маскираш първото USB устройство(обикновено 0x80) като различен диск.\n" -"Това би трябвало да е необходимо само ако инсталирате Windows XP и имате повече от един диск." +msgid "Install a UEFI bootloader, that will perform MD5Sum file validation of the media" +msgstr "Инсталиране на UEFI bootloader, който извършва MD5 проверка на файловете на носителя" #. • MSG_169 msgid "" @@ -1095,7 +1085,7 @@ msgstr "Версия %d.%d (Build %d)" #. • MSG_176 msgid "English translation: Pete Batard <mailto:pete@akeo.ie>" -msgstr "Български превод:\\line• Krasimir Nevenov <mailto:berzabel@yahoo.com>\\line• Kaloyan Nikolov <mailto:kotipuka01@gmail.com>" +msgstr "Български превод:\\line• Krasimir Nevenov <mailto:berzabel@yahoo.com>\\line• Kaloyan Nikolov <mailto:kotipuka01@gmail.com>\\line• Niko <mailto:niko@nikolan.net>" #. • MSG_177 msgid "Report bugs or request enhancements at:" @@ -1734,7 +1724,7 @@ msgstr "Бързо нулиране на устройството: %s" #. • MSG_307 msgid "this may take a while" -msgstr "Това може да отнеме време" +msgstr "това може да отнеме време" #. • MSG_308 msgid "VHD detection" @@ -1806,6 +1796,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Неуспешно отваряне или прочитане на '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Прилагане на SkuSiPolicy.p7b по време на инсталация (вж. KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Подобрения за улеснение (без принудително активиране на Copilot, OneDrive, Outlook, Fast Startup и др.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Прилагане на персонализации на Windows: %s" @@ -1854,6 +1852,194 @@ msgstr "Изключване на автоматичното криптиран msgid "Persistent log" msgstr "Устойчив лог" +#. • MSG_337 +msgid "" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" +"- Select 'Yes' to connect to the Internet and download it\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The file will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"За да използвате тази функция, трябва да бъде изтеглен допълнителен файл ('%s') от Microsoft:\n" +"- Изберете 'Да', за да се свържете с интернет и да го изтеглите\n" +"- Изберете 'Не', за да отмените операцията\n" +"\n" +"Забележка: Файлът ще бъде изтеглен в директорията на приложението и ще бъде използван повторно автоматично, ако вече е наличен." + +#. • MSG_338 +msgid "Revoked UEFI bootloader detected" +msgstr "Открит е анулиран UEFI bootloader" + +#. • MSG_339 +msgid "" +"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\n" +"\n" +"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\n" +"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning." +msgstr "" +"Rufus откри, че избраният ISO образ съдържа UEFI bootloader, който е анулиран и който ще доведе до %s, когато Secure Boot е активиран на напълно актуална UEFI система.\n" +"\n" +"- Ако сте получили този ISO образ от ненадежден източник, трябва да обмислите възможността той да съдържа UEFI зловреден софтуер и да избягвате зареждане от него.\n" +"- Ако сте го получили от доверен източник, трябва да потърсите по-нова версия, която няма да предизвиква това предупреждение." + +#. • MSG_340 +msgid "a \"Security Violation\" screen" +msgstr "екран \"Security Violation\"" + +#. • MSG_341 +msgid "a Windows Recovery Screen (BSOD) with '%s'" +msgstr "Windows Recovery екран (BSOD) с '%s'" + +#. • MSG_342 +msgid "Compressed VHDX Image" +msgstr "Компресиран VHDX образ" + +#. • MSG_343 +msgid "Uncompressed VHD Image" +msgstr "Некомпресиран VHD образ" + +#. • MSG_344 +msgid "Full Flash Update Image" +msgstr "Full Flash Update образ" + +#. • MSG_345 +msgid "" +"Some additional data must be downloaded from Microsoft to use this functionality:\n" +"- Select 'Yes' to connect to the Internet and download it\n" +"- Select 'No' to cancel the operation" +msgstr "" +"За да използвате тази функционалност, трябва да бъдат изтеглени допълнителни данни от Microsoft:\n" +"- Изберете 'Да', за да се свържете с интернет и да ги изтеглите\n" +"- Изберете 'Не', за да отмените операцията" + +#. • MSG_346 +msgid "Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)" +msgstr "Ограничаване на Windows до S режим (НЕСЪВМЕСТИМО с заобикаляне на онлайн акаунт)" + +#. • MSG_347 +msgid "Expert Mode" +msgstr "Експертен режим" + +#. • MSG_348 +msgid "Extracting archive files: %s" +msgstr "Извличане на файлове от архив: %s" + +#. • MSG_349 +msgid "Use Rufus MBR" +msgstr "Използване на MBR на Rufus" + +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Използване на подписани с 'Windows CA 2023' bootloader-и (изисква съвместим целеви компютър)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Проверка за анулирани UEFI bootloader-и..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Проверка за актуализации на UEFI DBX..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "Налична е актуализация на DBX" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus откри актуализирана версия на DBX файловете, използвани за проверка на анулирани UEFI Secure Boot заредители. Желаете ли да изтеглите тази актуализация?\n" +"- Изберете 'Да', за да се свържете с интернет и да изтеглите това съдържание\n" +"- Изберете 'Не', за да отмените операцията\n" +"\n" +"Забележка: Файловете ще бъдат изтеглени в директорията на приложението и ще бъдат използвани повторно автоматично, ако са налични." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠ТИХО⚠ изтриване на диска и инсталиране:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Избрахте опцията за \"тиха\" инсталация на Windows.\n" +"\n" +"Това е разширена настройка, предназначена за потребители, които желаят да създадат носител, който не изисква намеса по време на инсталацията и съответно БЕЗУСЛОВНО ИЗТРИВА първия открит диск на целевата система. Ако не бъдете внимателни, използването на тази опция може да доведе до НЕВЪЗВРАТИМА ЗАГУБА НА ДАННИ!\n" +"\n" +"Ако не желаете това, моля, изберете 'Не', за да се върнете назад и да премахнете отметката от тази опция.\n" +"В противен случай, избирайки 'Да', вие се съгласявате, че цялата отговорност за всякаква загуба на данни ще бъде ИЗЦЯЛО ВАША." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Неподдържано местоположение на образа" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Не можете да използвате образ, който се намира върху целевото устройство, тъй като това устройство ще бъде напълно изтрито. Това е същото като да се опитвате да отрежете клона, на който седите!\n" +"\n" +"Моля, преместете образа на друго място и опитайте отново." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Безопасно е да оставите тази опция включена, дори ако имате TPM или повече RAM, тъй като тя само заобикаля изискванията на инсталатора и не пречи на Windows да използва целия наличен хардуер." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "За да работи тази опция, мрежата/интернет ТРЯБВА да бъдат прекъснати по време на инсталацията!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Автоматично отговаряне с 'не' на въпросите от инсталацията на Windows, свързани със споделянето на данни с Microsoft, вместо да се изисква намеса от потребителя." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Трябва да оставите тази опция включена, освен ако нямате нищо против 'Windows To Go' да осъществява достъп до вътрешните дискове и тихомълком да извършва невъзвратими ъпгрейди на файловата система." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Автоматично създаване на локален акаунт с указаното потребителско име, използвайки празна парола, която ще трябва да бъде променена при следващото влизане." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Дублиране на регионалните настройки от този компютър (клавиатура, часова зона, валута), вместо да се изисква намеса от потребителя." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Системният диск да не се криптира, освен ако това не е изрично поискано от потребителя." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Използвайте тази опция само ако знаете какво е S режим и разбирате, че системата ви може да остане заключена в S режим дори след като напълно изтриете и преинсталирате Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Използвайте тази опция, ако системата, на която планирате да инсталирате Windows, използва напълно актуални сертификати за Secure Boot. Ако е необходимо, можете да проучите възможността за използване на 'Mosby' за актуализиране на вашата система." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Използвайте тази опция, ако желаете да анулирате допълнителни потенциално опасни Windows bootloader-и, но с риск това да попречи на зареждането и на стандартни инсталационни носители на Windows." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Подобрения за по-лесна работа: Изключване на повечето нежелани функции, които Microsoft се опитва да наложи на потребителите." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Ако използвате тази опция, моля, уверете се, че сте изключили всеки диск от целевия компютър, освен този, на който искате да инсталирате Windows, както и че не сте оставили носителя включен в компютър, който не желаете да бъде изтрит." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index a5630988..6ae11986 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -5,7 +5,7 @@ # List of all languages included in this file (with version) # • v4.14 "en-US" "English (English)" # • v4.5 "ar-SA" "Arabic (العربية)" -# • v3.22 "bg-BG" "Bulgarian (Български)" +# • v4.14 "bg-BG" "Bulgarian (Български)" # • v4.14 "zh-CN" "Chinese Simplified (简体中文)" # • v4.5 "zh-TW" "Chinese Traditional (正體中文)" # • v4.14 "hr-HR" "Croatian (Hrvatski)" @@ -1098,7 +1098,7 @@ t MSG_922 "قم بتنزيل UEFI Shell ISOs" ###################################################################### l "bg-BG" "Bulgarian (Български)" 0x0402 -v 3.22 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -1116,7 +1116,7 @@ t IDS_PARTITION_TYPE_TXT "Дялова схема" t IDS_TARGET_SYSTEM_TXT "Целева система" t IDC_LIST_USB_HDD "Изброяване на USB дискове" t IDC_OLD_BIOS_FIXES "Добави поправки за стари BIOS-и" -t IDC_UEFI_MEDIA_VALIDATION "Активиране на валидирането на UEFI медия по време на изпълнение" +t IDC_UEFI_MEDIA_VALIDATION "Активиране на валидиране на UEFI носителя по време на работа" t IDS_FORMAT_OPTIONS_TXT "Опции за форматиране" t IDS_FILE_SYSTEM_TXT "Файлова система" t IDS_CLUSTER_SIZE_TXT "Размер на клъстера" @@ -1162,7 +1162,7 @@ t IDC_CHECK_NOW "Провери сега" t MSG_001 "Засечена е друга инстанция" t MSG_002 "Засечено е друго работещо Rufus приложение.\nМоля, затворете първото приложение преди да стартирате ново." -t MSG_003 "ВНИМАНИЕ: ВСИЧКАТА ИНФОРМАЦИЯ НА УСТРОЙСТВО '%s' ЩЕ БЪДЕ УНИЩОЖЕНА.\nЗа да продължите с тази операция, натиснете OK. За да я прекратите, натиснете CANCEL." +t MSG_003 "ВНИМАНИЕ: ВСИЧКАТА ИНФОРМАЦИЯ НА УСТРОЙСТВО '%s' ЩЕ БЪДЕ УНИЩОЖЕНА.\nЗа да продължите с тази операция, натиснете OK. За да я прекратите, натиснете ОТКАЖИ." t MSG_004 "Rufus политика за актуализации" t MSG_005 "Желаете ли да разрешите на Rufus да проверява за актуализации в интернет?" t MSG_006 "Затвори" @@ -1243,7 +1243,7 @@ t MSG_080 "Rufus засече, че Windows все още прочиства в t MSG_081 "Неподдържан образ" t MSG_082 "Този образ не е зареждащ или използва зареждащ или компресиращ метод който не се поддържа от Rufus..." t MSG_083 "Заместване на %s ?" -t MSG_084 "Изглежда, че този ISO образ използва стара версия на '%s'.\nПоради тази причина стартиращите менюта може да не бъдат изобразени правилно.\n\nПо-нова версия може да бъде изтеглена от Rufus, за да отстрани този проблем:\n- Изберете 'Yes', за да се свържете с интернет и да изтеглите необходимият файл\n- Изберете 'No', за да продължите с настоящият ISO файл\nАко не знаете какво да правите, е препоръчително да изберете 'Yes'.\n\nБележка: Този файл ще бъде изтеглен в настоящата директория и щом '%s' е наличен, процесът ще продължи автоматично." +t MSG_084 "Изглежда, че този ISO образ използва стара версия на '%s'.\nПоради тази причина стартиращите менюта може да не бъдат изобразени правилно.\n\nПо-нова версия може да бъде изтеглена от Rufus, за да отстрани този проблем:\n- Изберете 'Да', за да се свържете с интернет и да изтеглите необходимият файл\n- Изберете 'Не', за да продължите с настоящият ISO файл\nАко не знаете какво да правите, е препоръчително да изберете 'Да'.\n\nБележка: Този файл ще бъде изтеглен в настоящата директория и щом '%s' е наличен, процесът ще продължи автоматично." t MSG_085 "Изтегляне %s" t MSG_086 "Не е избран образ" t MSG_087 "за %s NAND" @@ -1263,7 +1263,7 @@ t MSG_100 "Този ISO образ съдържа файл по голям от t MSG_101 "Липсваща WIM подръжка" t MSG_102 "Вашата платформа не може да извлече файлове от WIM архивите. WIM извличането е необходимо за създаване на EFI стартиращи Windows 7 и Windows Vista USB устройства. Може да поправите това като инсталирате последната версия на 7-Zip.\nИскате ли да посетите страницата за изтегляне на 7-zip?" t MSG_103 "Изтегляне на %s?" -t MSG_104 "%s или по-нов изисква '%s' файл да бъде инсталиран.\nТъй като този файл е повече от 100 KB в размер и винаги присъства на %s ISO образи, той не е включен в Rufus.\n\nRufus може да изтегли липсващият файл за вас:\n- Изберете 'Yes', за да се свържете с интернет и да изтеглите файла\n- Изберете 'No', ако искате ръчно да копирате този файл\n\nБележка: Този файл ще бъде изтеглен в настоящата директория и щом '%s' е наличен, процесът ще продължи автоматично." +t MSG_104 "%s или по-нов изисква '%s' файл да бъде инсталиран.\nТъй като този файл е повече от 100 KB в размер и винаги присъства на %s ISO образи, той не е включен в Rufus.\n\nRufus може да изтегли липсващият файл за вас:\n- Изберете 'Да', за да се свържете с интернет и да изтеглите файла\n- Изберете 'Не', ако искате ръчно да копирате този файл\n\nБележка: Този файл ще бъде изтеглен в настоящата директория и щом '%s' е наличен, процесът ще продължи автоматично." t MSG_105 "Прекратяването може да остави устройството в НЕИЗПОЛЗВАЕМО състояние.\nАко сте сигурни, че искате да прекратите, натиснете YES. В противен случай, натиснете NO." t MSG_106 "Моля изберете папка" t MSG_107 "Всички файлове" @@ -1273,9 +1273,9 @@ t MSG_110 "MS-DOS не може да стартира от устройство t MSG_111 "Несъвместим размер на клъстера" t MSG_112 "Форматирането на големи UDF томове може да отнеме много време. При USB 2.0 скорости, изчисленото време за форматиране е %d:%02d, при което процесната лента ще изглежда като замръзнала. Моля, бъдете търпеливи!" t MSG_113 "Голям UDF дял" -t MSG_114 "Този образ използва Syslinux %s%s, но тази програма включва само инсталационни файлове за Syslinux %s%s.\n\nТъй като новите версии на Syslinux не са съвместими една с друга и няма да е възможно Rufus да ги включи всичките, два допълнителни файла трябва да бъдат изтеглени от Интернет ('ldlinux.sys' и 'ldlinux.bss'):\n- Изберете 'Yes', за да се свържете с интернет и да изтеглите тези файлове\n- Изберете 'No', за да прекратите тази операция\n\nБележка: Тези файлове ще бъдат изтеглени в настоящата директория на програмата и ще бъдат използвани автоматично щом са налични." +t MSG_114 "Този образ използва Syslinux %s%s, но тази програма включва само инсталационни файлове за Syslinux %s%s.\n\nТъй като новите версии на Syslinux не са съвместими една с друга и няма да е възможно Rufus да ги включи всичките, два допълнителни файла трябва да бъдат изтеглени от Интернет ('ldlinux.sys' и 'ldlinux.bss'):\n- Изберете 'Да', за да се свържете с интернет и да изтеглите тези файлове\n- Изберете 'Не', за да прекратите тази операция\n\nБележка: Тези файлове ще бъдат изтеглени в настоящата директория на програмата и ще бъдат използвани автоматично щом са налични." t MSG_115 "Необходимо е изтегляне" -t MSG_116 "Този образ използва GRUB %s Но приложението съдържа само инсталацйонните файлове за GRUB %s.\n\n Тъй като различните версии на GRUB може да не са съвместими една с друга и не е възможно да се включат всички, Rufus ще опита да намери версия на GRUB инсталационният файл ('core.img'), който съвпада с този от вашият образ: \n- Изберете 'Yes', за да се свържете с интернет и да я изтеглите\n- Изберете 'No', за да използвате версията по подразбиране на Rufus\n- Изберете 'Cancel', за да прекратите операцията\n\nЗабележка: Файлът ще бъде изтеглен в настоящата директория и ще бъде използван автоматично, щом е наличен. Ако не е намерено съвпадение, ще бъде използвана версията по подразбиране." +t MSG_116 "Този образ използва GRUB %s Но приложението съдържа само инсталацйонните файлове за GRUB %s.\n\n Тъй като различните версии на GRUB може да не са съвместими една с друга и не е възможно да се включат всички, Rufus ще опита да намери версия на GRUB инсталационният файл ('core.img'), който съвпада с този от вашият образ: \n- Изберете 'Да', за да се свържете с интернет и да я изтеглите\n- Изберете 'Не', за да използвате версията по подразбиране на Rufus\n- Изберете 'Откажи', за да прекратите операцията\n\nЗабележка: Файлът ще бъде изтеглен в настоящата директория и ще бъде използван автоматично, щом е наличен. Ако не е намерено съвпадение, ще бъде използвана версията по подразбиране." t MSG_117 "Стандартна Windows инсталация" t MSG_118 "Windows To Go (Windows за USB Flash устройство)" t MSG_119 "разширени свойства на устройството" @@ -1292,7 +1292,7 @@ t MSG_129 "Създадохте носител, който използва UEFI t MSG_130 "Избор на образ на Windows" t MSG_131 "Този ISO съдържа няколко образа на Windows.\nМоля, изберете образа, който искате да използвате за тази инсталация:" t MSG_132 "Друга програма или процес използва това устройство. Наистина ли искате да го форматирате?" -t MSG_133 "Rufus забеляза, че се опитвате да създадете носител с \"Windows To Go\", базиран на 1809 ISO.\n\nПоради *MICROSOFT BUG*, този носител ще крашне при зареждане на Windows (Син екран на смъртта), ако не замените ръчно файла 'WppRecorder.sys' със същия от версия 1803.\n\nЗабележка: Rufus не може автоматично да поправи това, защото файлът 'WppRecorder.sys' е запазен с авторско право от Microsoft, поради което не можем да съхраняваме легално копие на този файл в програмата..." +t MSG_133 "Rufus установи, че се опитвате да създадете носител с \"Windows To Go\", базиран на ISO с версия 1809.\n\nПоради *БЪГ НА MICROSOFT*, този носител ще крашне при зареждане на Windows (Син екран на смъртта), освен ако не замените ръчно файла 'WppRecorder.sys' с версията от 1803.\n\nЗабележка: Rufus не може автоматично да поправи това, тъй като файлът 'WppRecorder.sys' е обект на авторско право на Microsoft и не можем законно да включим копие от него в приложението..." t MSG_134 "Тъй като за схемата за дял е избрано MBR, Rufus може да създаде дял до максимум 2 ТБ на този носител, което ще остави %s дисково пространство неизползвано.\n\nНаистина ли искате да продължите?" t MSG_135 "Версия" t MSG_136 "Издание" @@ -1325,8 +1325,7 @@ t MSG_163 "Метод по който ще бъдат създадени дял t MSG_164 "Метод, който ще бъде използван, за да се направи устройството стартиращо" t MSG_165 "Натиснете, за да изберете или изтеглите образ..." t MSG_166 "Сложете тази отметка за да разрешите показването на интернационални етикети и да зададете икона на устройството (създава autorun.inf)" -t MSG_167 "Инсталира MBR, който позволява избор на операционна система и може да маскира BIOS USB устройствения ИД" -t MSG_168 "Опитва да маскираш първото USB устройство(обикновено 0x80) като различен диск.\nТова би трябвало да е необходимо само ако инсталирате Windows XP и имате повече от един диск." +t MSG_167 "Инсталиране на UEFI bootloader, който извършва MD5 проверка на файловете на носителя" t MSG_169 "Създай допълнителен скрит дял и опитай да подредиш границите на дяловете.\nТова може да подобри засичането на стартиращи системи при по-стари версии на BIOS." t MSG_170 "Разреши изброяването на USB хард дискови заграждения. ИЗПОЛЗВАЙТЕ НА СВОЙ РИСК!!!" t MSG_171 "Стартиране на форматиращата операция.\nТова ще УНИЩОЖИ всякаква информация на целта!" @@ -1334,7 +1333,7 @@ t MSG_172 "Невалиден подпис на изтеглянето" t MSG_173 "Натиснете тук за да изберете..." t MSG_174 "Rufus - Надеждната USB форматираща програма" t MSG_175 "Версия %d.%d (Build %d)" -t MSG_176 "Български превод:\\line• Krasimir Nevenov <mailto:berzabel@yahoo.com>\\line• Kaloyan Nikolov <mailto:kotipuka01@gmail.com>" +t MSG_176 "Български превод:\\line• Krasimir Nevenov <mailto:berzabel@yahoo.com>\\line• Kaloyan Nikolov <mailto:kotipuka01@gmail.com>\\line• Niko <mailto:niko@nikolan.net>" t MSG_177 "Докладвайте за проблем или поискайте подобрения на:" t MSG_178 "Допълнителни авторски права:" t MSG_179 "Политика за актуализации:" @@ -1465,7 +1464,7 @@ t MSG_303 "Покажи регистъра" t MSG_304 "Създай дисков образ на избраното устройство" t MSG_305 "Използвайте тази опция, за да изберете дали искате да използвате това устройство, за да инсталирате Windows на друг диск, или за да създадете преносима инсталация на Windows на това устройство (Windows To Go)." t MSG_306 "Бързо нулиране на устройството: %s" -t MSG_307 "Това може да отнеме време" +t MSG_307 "това може да отнеме време" t MSG_308 "Засичане на VHD" t MSG_309 "Компресиран архив" t MSG_310 "ISO-то, което сте избрали, използва UEFI и е достатъчно малко да бъде записано като EFI System Partition (ESP). Записването в ESP, вместо в обикновен дял, може да е по-подходящо за някои типове инсталации.\n\nМоля, изберете режимът, който искате да използвате, за да запишете този образ:" @@ -1481,6 +1480,8 @@ t MSG_319 "Игнорирай Boot маркер" t MSG_320 "Обновяване на дяловете (%s)..." t MSG_321 "Образът, който сте избрали, е ISOHybrid, но създателите му не са го направили съвместим с ISO/File режим на копиране.\nЗатова ще бъде използван DD метод на записване на образа." t MSG_322 "Неуспешно отваряне или прочитане на '%s'" +t MSG_323 "Прилагане на SkuSiPolicy.p7b по време на инсталация (вж. KB5042562)" +t MSG_324 "Подобрения за улеснение (без принудително активиране на Copilot, OneDrive, Outlook, Fast Startup и др.)" t MSG_325 "Прилагане на персонализации на Windows: %s" t MSG_326 "Прилагане на настройки на потребителя..." t MSG_328 "Персонализиране на инсталацията на Windows?" @@ -1492,6 +1493,40 @@ t MSG_333 "Създаване на локален акаунт с потреби t MSG_334 "Задаване на регионални настройки със същите стойности, като на този потребител" t MSG_335 "Изключване на автоматичното криптиране на устройството с BitLocker" t MSG_336 "Устойчив лог" +t MSG_337 "За да използвате тази функция, трябва да бъде изтеглен допълнителен файл ('%s') от Microsoft:\n- Изберете 'Да', за да се свържете с интернет и да го изтеглите\n- Изберете 'Не', за да отмените операцията\n\nЗабележка: Файлът ще бъде изтеглен в директорията на приложението и ще бъде използван повторно автоматично, ако вече е наличен." +t MSG_338 "Открит е анулиран UEFI bootloader" +t MSG_339 "Rufus откри, че избраният ISO образ съдържа UEFI bootloader, който е анулиран и който ще доведе до %s, когато Secure Boot е активиран на напълно актуална UEFI система.\n\n- Ако сте получили този ISO образ от ненадежден източник, трябва да обмислите възможността той да съдържа UEFI зловреден софтуер и да избягвате зареждане от него.\n- Ако сте го получили от доверен източник, трябва да потърсите по-нова версия, която няма да предизвиква това предупреждение." +t MSG_340 "екран \"Security Violation\"" +t MSG_341 "Windows Recovery екран (BSOD) с '%s'" +t MSG_342 "Компресиран VHDX образ" +t MSG_343 "Некомпресиран VHD образ" +t MSG_344 "Full Flash Update образ" +t MSG_345 "За да използвате тази функционалност, трябва да бъдат изтеглени допълнителни данни от Microsoft:\n- Изберете 'Да', за да се свържете с интернет и да ги изтеглите\n- Изберете 'Не', за да отмените операцията" +t MSG_346 "Ограничаване на Windows до S режим (НЕСЪВМЕСТИМО с заобикаляне на онлайн акаунт)" +t MSG_347 "Експертен режим" +t MSG_348 "Извличане на файлове от архив: %s" +t MSG_349 "Използване на MBR на Rufus" +t MSG_350 "Използване на подписани с 'Windows CA 2023' bootloader-и (изисква съвместим целеви компютър)" +t MSG_351 "Проверка за анулирани UEFI bootloader-и..." +t MSG_352 "Проверка за актуализации на UEFI DBX..." +t MSG_353 "Налична е актуализация на DBX" +t MSG_354 "Rufus откри актуализирана версия на DBX файловете, използвани за проверка на анулирани UEFI Secure Boot заредители. Желаете ли да изтеглите тази актуализация?\n- Изберете 'Да', за да се свържете с интернет и да изтеглите това съдържание\n- Изберете 'Не', за да отмените операцията\n\nЗабележка: Файловете ще бъдат изтеглени в директорията на приложението и ще бъдат използвани повторно автоматично, ако са налични." +t MSG_355 "⚠ТИХО⚠ изтриване на диска и инсталиране:" +t MSG_356 "Избрахте опцията за \"тиха\" инсталация на Windows.\n\nТова е разширена настройка, предназначена за потребители, които желаят да създадат носител, който не изисква намеса по време на инсталацията и съответно БЕЗУСЛОВНО ИЗТРИВА първия открит диск на целевата система. Ако не бъдете внимателни, използването на тази опция може да доведе до НЕВЪЗВРАТИМА ЗАГУБА НА ДАННИ!\n\nАко не желаете това, моля, изберете 'Не', за да се върнете назад и да премахнете отметката от тази опция.\nВ противен случай, избирайки 'Да', вие се съгласявате, че цялата отговорност за всякаква загуба на данни ще бъде ИЗЦЯЛО ВАША." +t MSG_358 "Неподдържано местоположение на образа" +t MSG_359 "Не можете да използвате образ, който се намира върху целевото устройство, тъй като това устройство ще бъде напълно изтрито. Това е същото като да се опитвате да отрежете клона, на който седите!\n\nМоля, преместете образа на друго място и опитайте отново." +t MSG_360 "Безопасно е да оставите тази опция включена, дори ако имате TPM или повече RAM, тъй като тя само заобикаля изискванията на инсталатора и не пречи на Windows да използва целия наличен хардуер." +t MSG_361 "За да работи тази опция, мрежата/интернет ТРЯБВА да бъдат прекъснати по време на инсталацията!" +t MSG_362 "Автоматично отговаряне с 'не' на въпросите от инсталацията на Windows, свързани със споделянето на данни с Microsoft, вместо да се изисква намеса от потребителя." +t MSG_363 "Трябва да оставите тази опция включена, освен ако нямате нищо против 'Windows To Go' да осъществява достъп до вътрешните дискове и тихомълком да извършва невъзвратими ъпгрейди на файловата система." +t MSG_364 "Автоматично създаване на локален акаунт с указаното потребителско име, използвайки празна парола, която ще трябва да бъде променена при следващото влизане." +t MSG_365 "Дублиране на регионалните настройки от този компютър (клавиатура, часова зона, валута), вместо да се изисква намеса от потребителя." +t MSG_366 "Системният диск да не се криптира, освен ако това не е изрично поискано от потребителя." +t MSG_367 "Използвайте тази опция само ако знаете какво е S режим и разбирате, че системата ви може да остане заключена в S режим дори след като напълно изтриете и преинсталирате Windows." +t MSG_368 "Използвайте тази опция, ако системата, на която планирате да инсталирате Windows, използва напълно актуални сертификати за Secure Boot. Ако е необходимо, можете да проучите възможността за използване на 'Mosby' за актуализиране на вашата система." +t MSG_369 "Използвайте тази опция, ако желаете да анулирате допълнителни потенциално опасни Windows bootloader-и, но с риск това да попречи на зареждането и на стандартни инсталационни носители на Windows." +t MSG_370 "Подобрения за по-лесна работа: Изключване на повечето нежелани функции, които Microsoft се опитва да наложи на потребителите." +t MSG_371 "Ако използвате тази опция, моля, уверете се, че сте изключили всеки диск от целевия компютър, освен този, на който искате да инсталирате Windows, както и че не сте оставили носителя включен в компютър, който не желаете да бъде изтрит." t MSG_900 "Rufus е програма, с която можете лесно да форматирате и създавате стартиращи USB устройства, карти с памет и др." t MSG_901 "Официален сайт: %s" t MSG_902 "Изходен код: %s" diff --git a/src/rufus.rc b/src/rufus.rc index d534a131..9c715063 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.14.2360" +CAPTION "Rufus 4.14.2361" 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,14,2360,0 - PRODUCTVERSION 4,14,2360,0 + FILEVERSION 4,14,2361,0 + PRODUCTVERSION 4,14,2361,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.14.2360" + VALUE "FileVersion", "4.14.2361" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2360" + VALUE "ProductVersion", "4.14.2361" END END BLOCK "VarFileInfo" From 7ede01d61d70408cbe952190ff9616d5597f55a0 Mon Sep 17 00:00:00 2001 From: Na Jiyoun <true.sys@hotmail.com> Date: Mon, 13 Apr 2026 12:18:54 +0100 Subject: [PATCH 171/192] [loc] update Korean translation to latest --- res/loc/po/ko-KR.po | 150 +++++++++++++++++++++++++++++++++++++++----- res/loc/rufus.loc | 31 +++++++-- src/rufus.rc | 10 +-- 3 files changed, 167 insertions(+), 24 deletions(-) diff --git a/res/loc/po/ko-KR.po b/res/loc/po/ko-KR.po index cdf4cc22..b69391fe 100644 --- a/res/loc/po/ko-KR.po +++ b/res/loc/po/ko-KR.po @@ -1,11 +1,11 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2025-08-26 05:39+0900\n" -"PO-Revision-Date: 2026-01-28 21:33+0000\n" -"Last-Translator: VenusGirl <venusgirl@outlook.com>\n" -"Language-Team: 비너스걸 <https://venusgirls.tistory.com/>\n" +"POT-Creation-Date: 2026-04-12 03:37+0900\n" +"PO-Revision-Date: 2026-04-12 03:58+0900\n" +"Last-Translator: \n" +"Language-Team: \n" "Language: ko_KR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Korean (한국어)\n" "X-Rufus-LCID: 0x0412\n" -"X-Generator: Poedit 3.8\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -846,7 +846,7 @@ msgstr "영구적 아님" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "라이브 USB 미디어의 영구 파티션 크기를 설정합니다. 크기를 0으로 설정하면 영구 파티션이 비활성화됩니다." @@ -888,17 +888,17 @@ msgstr "다른 프로그램 또는 프로세스가 이 드라이브에 액세스 #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Rufus가 1809 ISO를 기반으로 Windows To Go 미디어를 만들려고 하는 것을 감지했습니다.\n" +"Rufus에서 현재 1809 버전 ISO를 기반으로 'Windows To Go' 미디어를 생성하려는 것을 감지했습니다.\n" "\n" -"*MICROSOFT BUG*로 인해 수동으로 'WppRecorder.sys' 파일을 1803 버전으로 교체하지 않으면 Windows 부팅 중 이 미디어가 충돌합니다.\n" +"\"Microsoft의 버그\"로 인해, 사용자가 직접 'WppRecorder.sys' 파일을 1803 버전으로 교체하지 않으면 이 미디어는 Windows 부팅 중에 충돌(블루스크린)을 일으킵니다.\n" "\n" -"또한 Rufus가 이 문제를 자동으로 해결할 수 없는 이유는 'WppRecorder.sys'가 Microsoft의 저작권이 있는 파일이기 때문에 해당 파일의 복사본을 응용 프로그램에 법적으로 포함할 수 없기 때문입니다..." +"또한 Rufus가 이를 자동으로 수정해 드리지 못하는 이유는 'WppRecorder.sys' 파일이 Microsoft의 저작권 보호를 받는 파일이기 때문입니다. 따라서 법적으로 해당 파일의 복사본을 애플리케이션에 포함할 수 없음을 양해 바랍니다." #. • MSG_134 msgid "" @@ -1795,6 +1795,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "'%s'을(를) 열거나 읽을 수 없습니다" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "설치 시 SkuSiPolicy.p7b 적용 (KB5042562 참조)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "QoL 개선 사항 (Copilot, OneDrive, Outlook, Fast Startup 등을 강제하지 않음)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Windows 사용자 지정 적용 중: %s" @@ -1852,10 +1860,10 @@ msgid "" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" "이 기능을 사용하려면 Microsoft에서 추가 파일('%s')을 다운로드해야 합니다:\n" -"- 인터넷에 연결하여 다운로드하려면 '예'를 선택합니다\n" -"- 작업을 취소하려면 '아니요'를 선택합니다\n" +"- 인터넷에 연결하여 다운로드하려면 '예'를 선택하세요.\n" +"- 작업을 취소하려면 '아니요'를 선택하세요.\n" "\n" -"참고: 해당 파일은 응용 프로그램의 디렉터리에 다운로드되며 존재하는 경우 자동으로 재사용됩니다." +"참고: 파일은 프로그램 실행 디렉토리에 다운로드되며, 파일이 존재하면 자동으로 재사용됩니다." #. • MSG_338 msgid "Revoked UEFI bootloader detected" @@ -1919,6 +1927,118 @@ msgstr "압축 파일 추출 중: %s" msgid "Use Rufus MBR" msgstr "Rufus MBR 사용" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "'Windows CA 2023' 서명 부트로더 사용 (호환되는 대상 PC 필요)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "UEFI 부트로더 취소 여부 확인 중..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "UEFI DBX 업데이트 확인 중..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "DBX 업데이트 사용 가능" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus가 UEFI 보안 부팅 취소 확인에 사용되는 최신 버전의 DBX 파일을 찾았습니다. 이 업데이트를 다운로드하시겠습니까?\n" +"- 인터넷에 연결하여 파일을 다운로드하려면 '예'를 선택하세요.\n" +"- 작업을 취소하려면 '아니오'를 선택하세요.\n" +"\n" +"참고: 파일은 프로그램 실행 디렉토리에 다운로드되며, 파일이 존재하면 자동으로 재사용됩니다." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠경고⚠ 묻지 않고 디스크 삭제 및 설치:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"\"무경고(silent)\" Windows 설치 옵션을 선택하셨습니다.\n" +"\n" +"이것은 고급 옵션으로, Windows 설치 중에 사용자에게 확인 과정을 거치지 않고 대상 시스템에서 처음 감지된 디스크를 \"무조건 삭제\"하는 미디어를 만들려는 분들을 위한 기능입니다. 주의하지 않으면 이 옵션 사용으로 인해 \"되돌릴 수 없는 데이터 손실\"이 발생할 수 있습니다!\n" +"\n" +"이것을 원치 않으시면 '아니오'를 선택하여 돌아가서 해당 옵션의 체크를 해제하십시오.\n" +"반대로 '예'를 선택하신다면, 발생하는 모든 데이터 손실에 대한 전적인 책임은 \"사용자 본인\"에게 있음에 동의하는 것으로 간주합니다." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "지원되지 않는 이미지 위치" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"대상 드라이브가 완전히 삭제될 예정이므로, 해당 드라이브에 있는 이미지는 사용할 수 없습니다. 이는 마치 본인이 앉아 있는 나뭇가지를 톱질하는 것과 같습니다!\n" +"\n" +"이미지 파일을 다른 위치로 이동한 후 다시 시도해 주세요." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "TPM이나 넉넉한 RAM을 보유하고 있더라도 이 옵션을 활성화된 상태로 두는 것이 안전합니다. 이 옵션은 설치 요구 사항을 우회할 뿐이며, Windows가 사용 가능한 모든 하드웨어를 사용하는 것을 실제로 방해하지는 않기 때문입니다." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "이 옵션이 작동하려면 설치 중에 반드시 네트워크/인터넷 연결을 해제해야 합니다!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Microsoft와의 데이터 공유에 관한 Windows 설정 질문에 사용자에게 묻는 대신 자동으로 '아니오'라고 응답합니다." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "'Windows To Go'가 내부 디스크에 액세스하여 예고 없이 되돌릴 수 없는 파일 시스템 업그레이드를 수행하는 것에 동의하지 않는다면, 이 옵션을 활성화된 상태로 두어야 합니다." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "지정된 사용자 이름으로 로컬 계정을 자동으로 생성합니다. 암호는 빈 값으로 설정되며 다음 로그온 시 변경해야 합니다." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "사용자에게 묻는 대신 이 PC의 지역 설정(키보드, 시간대, 통화)을 그대로 복제합니다." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "사용자가 명시적으로 요청하지 않는 한 시스템 디스크를 암호화하지 않습니다." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "S-Mode가 무엇인지 알고 있으며, Windows를 완전히 삭제하고 재설치한 후에도 시스템이 S-Mode로 고정될 수 있음을 이해하는 경우에만 이 옵션을 사용하십시오." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Windows를 설치하려는 시스템이 최신 보안 부팅 인증서를 사용 중인 경우 이 옵션을 사용하십시오. 필요한 경우 'Mosby'를 사용하여 시스템을 업데이트할 수 있습니다." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "잠재적으로 안전하지 않은 추가 Windows 부트로더를 차단하려는 경우 이 옵션을 사용하십시오. 단, 표준 Windows 미디어의 부팅도 차단될 가능성이 있습니다." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "\"Quality of Life(QoL)\" 개선 사항: Microsoft가 사용자에게 강제하려는 원치 않는 기능 대부분을 비활성화합니다." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "이 옵션을 사용하는 경우, Windows를 설치할 디스크를 제외한 대상 PC의 모든 디스크를 분해(연결 해제)했는지 확인하십시오. 또한, 데이터 삭제를 원치 않는 PC에는 미디어를 연결된 상태로 두지 마십시오." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 6ae11986..938ad875 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -21,7 +21,7 @@ # • v4.14 "id-ID" "Indonesian (Bahasa Indonesia)" # • v4.5 "it-IT" "Italian (Italiano)" # • v4.14 "ja-JP" "Japanese (日本語)" -# • v4.5 "ko-KR" "Korean (한국어)" +# • v4.14 "ko-KR" "Korean (한국어)" # • v4.14 "lv-LV" "Latvian (Latviešu)" # • v3.22 "lt-LT" "Lithuanian (Lietuvių)" # • v3.22 "ms-MY" "Malay (Bahasa Malaysia)" @@ -8092,7 +8092,7 @@ t MSG_922 "UEFIシェルのISOをダウンロードします。" ######################################################################### l "ko-KR" "Korean (한국어)" 0x0412 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -8280,7 +8280,7 @@ t MSG_129 "UEFI:NTFS 부트 로더를 사용하는 미디어를 방금 만들었 t MSG_130 "Windows 이미지 선택" t MSG_131 "이 ISO에는 여러 개의 Windows 이미지가 포함되어 있습니다.\n이 설치에 사용할 이미지를 선택하세요:" t MSG_132 "다른 프로그램 또는 프로세스가 이 드라이브에 액세스하고 있습니다. 포맷하시겠습니까?" -t MSG_133 "Rufus가 1809 ISO를 기반으로 Windows To Go 미디어를 만들려고 하는 것을 감지했습니다.\n\n*MICROSOFT BUG*로 인해 수동으로 'WppRecorder.sys' 파일을 1803 버전으로 교체하지 않으면 Windows 부팅 중 이 미디어가 충돌합니다.\n\n또한 Rufus가 이 문제를 자동으로 해결할 수 없는 이유는 'WppRecorder.sys'가 Microsoft의 저작권이 있는 파일이기 때문에 해당 파일의 복사본을 응용 프로그램에 법적으로 포함할 수 없기 때문입니다..." +t MSG_133 "Rufus에서 현재 1809 버전 ISO를 기반으로 'Windows To Go' 미디어를 생성하려는 것을 감지했습니다.\n\n\"Microsoft의 버그\"로 인해, 사용자가 직접 'WppRecorder.sys' 파일을 1803 버전으로 교체하지 않으면 이 미디어는 Windows 부팅 중에 충돌(블루스크린)을 일으킵니다.\n\n또한 Rufus가 이를 자동으로 수정해 드리지 못하는 이유는 'WppRecorder.sys' 파일이 Microsoft의 저작권 보호를 받는 파일이기 때문입니다. 따라서 법적으로 해당 파일의 복사본을 애플리케이션에 포함할 수 없음을 양해 바랍니다." t MSG_134 "파티션 구성표에서 MBR이 선택되었기 때문에 Rufus는 이 미디어에 최대 2TB의 파티션만 만들 수 있으며, 이로 인해 %s의 디스크 공간을 사용할 수 없게 됩니다.\n\n계속하시겠습니까?" t MSG_135 "버전" t MSG_136 "릴리즈" @@ -8467,6 +8467,8 @@ t MSG_319 "부팅 마커 무시" t MSG_320 "파티션 레이아웃 (%s)을 새로 고치는 중..." t MSG_321 "선택한 이미지는 ISO 하이브리드이지만 제작자가 ISO/파일 복사 모드와 호환되도록 만들지 않았습니다.\n이에 따라 DD 이미지 쓰기 모드가 적용됩니다." t MSG_322 "'%s'을(를) 열거나 읽을 수 없습니다" +t MSG_323 "설치 시 SkuSiPolicy.p7b 적용 (KB5042562 참조)" +t MSG_324 "QoL 개선 사항 (Copilot, OneDrive, Outlook, Fast Startup 등을 강제하지 않음)" t MSG_325 "Windows 사용자 지정 적용 중: %s" t MSG_326 "사용자 옵션을 적용하는 중..." t MSG_327 "Windows 사용자 환경" @@ -8479,7 +8481,7 @@ t MSG_333 "사용자 이름으로 로컬 계정 만들기:" t MSG_334 "이 사용자의 값과 동일한 값을 사용하여 국가별 옵션 설정" t MSG_335 "BitLocker 자동 장치 암호화 사용 안 함" t MSG_336 "영구 로그" -t MSG_337 "이 기능을 사용하려면 Microsoft에서 추가 파일('%s')을 다운로드해야 합니다:\n- 인터넷에 연결하여 다운로드하려면 '예'를 선택합니다\n- 작업을 취소하려면 '아니요'를 선택합니다\n\n참고: 해당 파일은 응용 프로그램의 디렉터리에 다운로드되며 존재하는 경우 자동으로 재사용됩니다." +t MSG_337 "이 기능을 사용하려면 Microsoft에서 추가 파일('%s')을 다운로드해야 합니다:\n- 인터넷에 연결하여 다운로드하려면 '예'를 선택하세요.\n- 작업을 취소하려면 '아니요'를 선택하세요.\n\n참고: 파일은 프로그램 실행 디렉토리에 다운로드되며, 파일이 존재하면 자동으로 재사용됩니다." t MSG_338 "취소된 UEFI 부트로더가 탐지됨" t MSG_339 "Rufus는 사용자가 선택한 ISO에 취소된 UEFI 부트로더가 포함되어 있으며, 이는 완전히 최신 UEFI 시스템에서 보안 부팅이 활성화된 경우에 %s을(를) 생성한다는 것을 감지했습니다.\n\n- 평판이 좋지 않은 소스에서 이 ISO 이미지를 가져온 경우 UEFI 멀웨어가 포함되어 있을 가능성을 고려하고 부팅을 피해야 합니다.\n- 신뢰할 수 있는 소스에서 가져온 경우에는 보다 최신 버전을 찾아야 합니다. 그러면 이 경고가 발생하지 않습니다.." t MSG_340 "\"보안 위반\" 화면" @@ -8492,6 +8494,27 @@ t MSG_346 "Windows를 S-Mode로 제한 (온라인 계정 우회와 호환되지 t MSG_347 "전문가 모드" t MSG_348 "압축 파일 추출 중: %s" t MSG_349 "Rufus MBR 사용" +t MSG_350 "'Windows CA 2023' 서명 부트로더 사용 (호환되는 대상 PC 필요)" +t MSG_351 "UEFI 부트로더 취소 여부 확인 중..." +t MSG_352 "UEFI DBX 업데이트 확인 중..." +t MSG_353 "DBX 업데이트 사용 가능" +t MSG_354 "Rufus가 UEFI 보안 부팅 취소 확인에 사용되는 최신 버전의 DBX 파일을 찾았습니다. 이 업데이트를 다운로드하시겠습니까?\n- 인터넷에 연결하여 파일을 다운로드하려면 '예'를 선택하세요.\n- 작업을 취소하려면 '아니오'를 선택하세요.\n\n참고: 파일은 프로그램 실행 디렉토리에 다운로드되며, 파일이 존재하면 자동으로 재사용됩니다." +t MSG_355 "⚠경고⚠ 묻지 않고 디스크 삭제 및 설치:" +t MSG_356 "\"무경고(silent)\" Windows 설치 옵션을 선택하셨습니다.\n\n이것은 고급 옵션으로, Windows 설치 중에 사용자에게 확인 과정을 거치지 않고 대상 시스템에서 처음 감지된 디스크를 \"무조건 삭제\"하는 미디어를 만들려는 분들을 위한 기능입니다. 주의하지 않으면 이 옵션 사용으로 인해 \"되돌릴 수 없는 데이터 손실\"이 발생할 수 있습니다!\n\n이것을 원치 않으시면 '아니오'를 선택하여 돌아가서 해당 옵션의 체크를 해제하십시오.\n반대로 '예'를 선택하신다면, 발생하는 모든 데이터 손실에 대한 전적인 책임은 \"사용자 본인\"에게 있음에 동의하는 것으로 간주합니다." +t MSG_358 "지원되지 않는 이미지 위치" +t MSG_359 "대상 드라이브가 완전히 삭제될 예정이므로, 해당 드라이브에 있는 이미지는 사용할 수 없습니다. 이는 마치 본인이 앉아 있는 나뭇가지를 톱질하는 것과 같습니다!\n\n이미지 파일을 다른 위치로 이동한 후 다시 시도해 주세요." +t MSG_360 "TPM이나 넉넉한 RAM을 보유하고 있더라도 이 옵션을 활성화된 상태로 두는 것이 안전합니다. 이 옵션은 설치 요구 사항을 우회할 뿐이며, Windows가 사용 가능한 모든 하드웨어를 사용하는 것을 실제로 방해하지는 않기 때문입니다." +t MSG_361 "이 옵션이 작동하려면 설치 중에 반드시 네트워크/인터넷 연결을 해제해야 합니다!" +t MSG_362 "Microsoft와의 데이터 공유에 관한 Windows 설정 질문에 사용자에게 묻는 대신 자동으로 '아니오'라고 응답합니다." +t MSG_363 "'Windows To Go'가 내부 디스크에 액세스하여 예고 없이 되돌릴 수 없는 파일 시스템 업그레이드를 수행하는 것에 동의하지 않는다면, 이 옵션을 활성화된 상태로 두어야 합니다." +t MSG_364 "지정된 사용자 이름으로 로컬 계정을 자동으로 생성합니다. 암호는 빈 값으로 설정되며 다음 로그온 시 변경해야 합니다." +t MSG_365 "사용자에게 묻는 대신 이 PC의 지역 설정(키보드, 시간대, 통화)을 그대로 복제합니다." +t MSG_366 "사용자가 명시적으로 요청하지 않는 한 시스템 디스크를 암호화하지 않습니다." +t MSG_367 "S-Mode가 무엇인지 알고 있으며, Windows를 완전히 삭제하고 재설치한 후에도 시스템이 S-Mode로 고정될 수 있음을 이해하는 경우에만 이 옵션을 사용하십시오." +t MSG_368 "Windows를 설치하려는 시스템이 최신 보안 부팅 인증서를 사용 중인 경우 이 옵션을 사용하십시오. 필요한 경우 'Mosby'를 사용하여 시스템을 업데이트할 수 있습니다." +t MSG_369 "잠재적으로 안전하지 않은 추가 Windows 부트로더를 차단하려는 경우 이 옵션을 사용하십시오. 단, 표준 Windows 미디어의 부팅도 차단될 가능성이 있습니다." +t MSG_370 "\"Quality of Life(QoL)\" 개선 사항: Microsoft가 사용자에게 강제하려는 원치 않는 기능 대부분을 비활성화합니다." +t MSG_371 "이 옵션을 사용하는 경우, Windows를 설치할 디스크를 제외한 대상 PC의 모든 디스크를 분해(연결 해제)했는지 확인하십시오. 또한, 데이터 삭제를 원치 않는 PC에는 미디어를 연결된 상태로 두지 마십시오." t MSG_900 "Rufus는 USB 메모리 및 플래시 드라이브를 포맷하고 부팅할 수 있도록 만드는 도구입니다." t MSG_901 "공식 사이트: %s" t MSG_902 "소스 코드: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 9c715063..38dde070 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.14.2361" +CAPTION "Rufus 4.14.2362" 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,14,2361,0 - PRODUCTVERSION 4,14,2361,0 + FILEVERSION 4,14,2362,0 + PRODUCTVERSION 4,14,2362,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.14.2361" + VALUE "FileVersion", "4.14.2362" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2361" + VALUE "ProductVersion", "4.14.2362" END END BLOCK "VarFileInfo" From 9fc9aacd9d143f998b670ec22cd29ecd02242227 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 14 Apr 2026 13:24:56 +0100 Subject: [PATCH 172/192] [wue] use a heavier approach when disabling frickin' Microsoft Teams with QoL * Also disable "suggested content" (*ads*) in the menu when QoL is selected. --- src/rufus.rc | 10 +++++----- src/wue.c | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/rufus.rc b/src/rufus.rc index 38dde070..26e8a804 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.14.2362" +CAPTION "Rufus 4.14.2363" 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,14,2362,0 - PRODUCTVERSION 4,14,2362,0 + FILEVERSION 4,14,2363,0 + PRODUCTVERSION 4,14,2363,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.14.2362" + VALUE "FileVersion", "4.14.2363" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2362" + VALUE "ProductVersion", "4.14.2363" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index 57aaf528..d9b701af 100644 --- a/src/wue.c +++ b/src/wue.c @@ -273,10 +273,16 @@ char* CreateUnattendXml(int arch, int flags) "\"Remove-Item -Path $env:SystemRoot\\SysWOW64\\OneDriveSetup.exe -Force -Confirm:$false;", TRUE); // Remove Outlook. How the frig is forcing Outlook on users legal when MS got pinned for bundling IE with Windows? StrArrayAdd(&commands, "PowerShell -NonInteractive -WindowStyle Hidden -Command " - "\"Get-AppxProvisionedPackage -Online | Where-Object {$_.PackageName -like '*OutlookForWindows*'} |" + "\"Get-AppxProvisionedPackage -Online | Where-Object {$_.PackageName -like '*Outlook*'} |" " Remove-AppxProvisionedPackage -Online\"", TRUE); StrArrayAdd(&commands, "PowerShell -NonInteractive -WindowStyle Hidden -Command " - "\"Get-AppxPackage -AllUsers *OutlookForWindows* | Remove-AppxPackage -AllUsers\"", TRUE); + "\"Get-AppxPackage -AllUsers *Outlook* | Remove-AppxPackage -AllUsers\"", TRUE); + // Same for Teams. Also: "HEY, MICROSOFT, SCREW YOU!!!!" + StrArrayAdd(&commands, "PowerShell -NonInteractive -WindowStyle Hidden -Command " + "\"Get-AppxProvisionedPackage -Online | Where-Object {$_.PackageName -like '*Teams*'} |" + " Remove-AppxProvisionedPackage -Online\"", TRUE); + StrArrayAdd(&commands, "PowerShell -NonInteractive -WindowStyle Hidden -Command " + "\"Get-AppxPackage -AllUsers *Teams* | Remove-AppxPackage -AllUsers\"", TRUE); } // Now that we have all the commands to run, create the RunSynchronous section. for (order = 1; order <= (int)commands.Index; order++) { @@ -377,7 +383,6 @@ char* CreateUnattendXml(int arch, int flags) // through a full Windows Update cycle. if (flags & UNATTEND_APPLY_SKUSIPOLICY) { uprintf("• Apply SkuSiPolicy.p7b"); - // TODO: Could we hide this using PowerShell? StrArrayAdd(&commands, "cmd /c mountvol S: /S &amp;&amp; " "copy %WINDIR%\\system32\\SecureBootUpdates\\SkuSiPolicy.p7b S:\\EFI\\Microsoft\\Boot &amp;&amp; " "mountvol S: /D", TRUE); @@ -399,6 +404,11 @@ char* CreateUnattendXml(int arch, int flags) // Disable Windows Phone and similarly pushed unwanted crap StrArrayAdd(&commands, "reg add \"HKLM\\Software\\Policies\\Microsoft\\Windows\\CloudContent\" " "/v DisableWindowsConsumerFeatures /t REG_DWORD /d 1 /f", TRUE); + // Disable ads in menu + StrArrayAdd(&commands, "reg add \"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" " + "/v SystemPaneSuggestionsEnabled /t REG_DWORD /d 0 /f", TRUE); + StrArrayAdd(&commands, "reg add \"HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Search\" " + "/v BingSearchEnabled /t REG_DWORD /d 0 /f", TRUE); // Disable News StrArrayAdd(&commands, "reg add \"HKLM\\Software\\Policies\\Microsoft\\Dsh\" " "/v AllowNewsAndInterests /t REG_DWORD /d 0 /f", TRUE); From 770d05c758879ea5307701683e5a01a44048dbe0 Mon Sep 17 00:00:00 2001 From: Dayking Cheng <dayking@unikoshardware.com> Date: Tue, 14 Apr 2026 13:28:04 +0100 Subject: [PATCH 173/192] [loc] update Traditional Chinese translation to latest --- res/loc/po/zh-TW.po | 144 ++++++++++++++++++++++++++++++++++++++++---- res/loc/rufus.loc | 33 ++++++++-- src/rufus.rc | 10 +-- 3 files changed, 166 insertions(+), 21 deletions(-) diff --git a/res/loc/po/zh-TW.po b/res/loc/po/zh-TW.po index dbec848a..e405f062 100644 --- a/res/loc/po/zh-TW.po +++ b/res/loc/po/zh-TW.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-05-25 18:11+0800\n" -"PO-Revision-Date: 2024-05-25 20:05+0800\n" +"POT-Creation-Date: 2026-04-14 02:06+0800\n" +"PO-Revision-Date: 2026-04-14 03:18+0800\n" "Last-Translator: \n" "Language-Team: \n" "Language: zh_TW\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Chinese Traditional (正體中文)\n" "X-Rufus-LCID: 0x0404, 0x0c04, 0x1404, 0x7c04\n" -"X-Generator: Poedit 3.4.4\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -843,7 +843,7 @@ msgstr "不固定" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "設定 live USB 的固定磁區大小。大小設定為 0 則移除固定磁區。" @@ -885,7 +885,7 @@ msgstr "另一個程式或程序正在使用此裝置,要繼續格式化?" #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" @@ -893,7 +893,7 @@ msgid "" msgstr "" "Rufus 偵測到您將要建立 'Windows To Go' 1809 版本。\n" "\n" -"由於微軟的程式錯誤,您將無法正常開機 (藍白當機),除非您自行更換 'WppRecorder.sys' 成 1803 版本。\n" +"由於微軟的程式錯誤,您將無法正常開機 (藍底白字當機),除非您自行更換 'WppRecorder.sys' 成 1803 版本。\n" "\n" "此檔案版權擁有者為微軟,Rufus 愛莫能助..." @@ -1790,6 +1790,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "無法開啟或讀取 '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "在安裝時套用 SkuSiPolicy.p7b (參閱 KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Windows 體驗改善 (不強制安裝 Copilot、OneDrive、Outlook、 快速啟動等功能)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "正在套用 Windows 客製化設定:%s" @@ -1840,13 +1848,13 @@ msgstr "持久化日誌" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"必須從微軟下載額外的 'diskcopy.dll' 檔案,才能安裝 MS-DOS:\n" +"必須從 Microsoft 下載附加檔案 (“%s”) 才能使用此功能:\n" "- 選 '是' 將連線到網路並進行下載\n" "- 選 '否' 將取消操作\n" "\n" @@ -1914,6 +1922,120 @@ msgstr "正在擷取封存檔案: %s" msgid "Use Rufus MBR" msgstr "使用 Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "使用以 Windows CA 2023 簽署的開機引導程式 (需搭配相容的電腦)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "正在檢查 UEFI 開機引導程式是否被撤銷…" + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "正在檢查 UEFI DBX 更新…" + +#. • MSG_353 +msgid "DBX update available" +msgstr "有可用的 DBX 更新" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus 發現用於執行 UEFI 安全開機撤銷檢查的 DBX 檔案更新版本,是否下載此更新?\n" +"- 選擇 '是': 將連線到網路並進行下載\n" +"- 選擇 '否': 取消此操作\n" +"\n" +"註: 該檔案將被下載到 Rufus 所在的資料夾中,如果已存在將會自動使用。" + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "以 ⚠靜默模式⚠ 清除磁碟並進行安裝:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes', you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"你已選擇使用 \"靜默\" Windows 安裝選項。\n" +"\n" +"此為進階選項,僅供希望建立在安裝 Windows 過程中不提示使用者的安裝媒體之使用者使用,過程中會直接清除目標系統中偵測到的第一顆磁碟。\n" +"\n" +"若操作不慎,此選項可能導致發生無法復原的資料遺失!\n" +"\n" +"如果這不是你想要的結果,請選擇 '否' 返回並取消勾選此選項。\n" +"若你選擇 '是',表示你了解且同意承擔所有可能發生的資料遺失風險。" + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "不支援的映像檔位置" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"你無法使用位於目標磁碟上的映像檔,因為該磁碟將會被完全清除。這就像是試圖鋸斷自己正坐著的樹枝一樣!\n" +"\n" +"請將映像檔移至其它位置後再試一次。" + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "即使支援 TPM 或有更大的記憶體容量,保持啟用此選項也是安全的,因為此選項僅會略過硬體安裝需求,並不會影響 Windows 使用所有可用的硬體資源。" + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "為了讓此選項生效,安裝過程中必須切斷網路連線!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "自動拒絕 Windows 初始化中與微軟共享資料的相關問題,而非提示使用者進行選擇。" + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "除非你可以接受 'Windows To Go' 存取內部磁碟,並在未經提示的情況下執行不可逆的檔案系統升級,否則建議保持啟用此選項。" + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "自動以指定的使用者名稱建立本機帳戶,並設定空白密碼,該密碼需在下次登入時進行變更。" + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "複製此電腦的區域設定 (鍵盤、時區、貨幣),而非提示使用者進行選擇。" + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "除非使用者明確要求,否則不要加密系統磁碟。" + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "僅在你了解 S 模式是什麼,且知道即使完全清除並重新安裝 Windows,系統仍可能被鎖定在 S 模式的情況下使用此選項。" + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "若你打算安裝 Windows 的系統已完整更新過安全開機憑證,請使用此選項。若有需要,你可以考慮使用 'Mosby' 來更新系統。" + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "如果你希望撤銷更多可能不安全的 Windows 開機引導程式,請使用此選項,但此操作有可能導致標準 Windows 安裝媒體無法開機。" + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Windows 體驗增強: 停用微軟試圖強制提供給終端使用者的大多數不必要功能。" + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "如果你使用此選項,請確保目標電腦中除了要安裝 Windows 的磁碟以外,其它所有磁碟都已斷開連接,並且不要將安裝媒體插在任何你不想被清除資料的電腦上。" + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application @@ -1994,7 +2116,7 @@ msgstr "計算被選取映像的 MD5、SHA-1、SHA-256 和 SHA-512 檢查碼" #. • MSG_920 msgid "Perform bad blocks checks, including detection of \"fake\" flash drives" msgstr "" -"執行壞軌檢查,包括對”假“USB 快閃磁碟\n" +"執行壞軌檢查,包括對 ”假“ USB 快閃磁碟\n" "的偵測" #. • MSG_921 diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 938ad875..f2661da1 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -7,7 +7,7 @@ # • v4.5 "ar-SA" "Arabic (العربية)" # • v4.14 "bg-BG" "Bulgarian (Български)" # • v4.14 "zh-CN" "Chinese Simplified (简体中文)" -# • v4.5 "zh-TW" "Chinese Traditional (正體中文)" +# • v4.14 "zh-TW" "Chinese Traditional (正體中文)" # • v4.14 "hr-HR" "Croatian (Hrvatski)" # • v4.14 "cs-CZ" "Czech (Čeština)" # • v4.14 "da-DK" "Danish (Dansk)" @@ -1993,7 +1993,7 @@ t MSG_922 "下载 UEFI Shell 镜像" ######################################################################### l "zh-TW" "Chinese Traditional (正體中文)" 0x0404, 0x0c04, 0x1404, 0x7c04 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -2181,7 +2181,7 @@ t MSG_129 "你已建立使用 UEFI:NTFS 開機引導程式的裝置。如要使 t MSG_130 "Windows 映像檔選擇" t MSG_131 "此 ISO 包含多個 Windows 映像\n請選擇要安裝的映像:" t MSG_132 "另一個程式或程序正在使用此裝置,要繼續格式化?" -t MSG_133 "Rufus 偵測到您將要建立 'Windows To Go' 1809 版本。\n\n由於微軟的程式錯誤,您將無法正常開機 (藍白當機),除非您自行更換 'WppRecorder.sys' 成 1803 版本。\n\n此檔案版權擁有者為微軟,Rufus 愛莫能助..." +t MSG_133 "Rufus 偵測到您將要建立 'Windows To Go' 1809 版本。\n\n由於微軟的程式錯誤,您將無法正常開機 (藍底白字當機),除非您自行更換 'WppRecorder.sys' 成 1803 版本。\n\n此檔案版權擁有者為微軟,Rufus 愛莫能助..." t MSG_134 "由於選擇使用 MBR 磁區,Rufus 最大只能建立 2 TB 磁區,而剩下空間 %s 將無法使用\n\n請確認是否繼續?" t MSG_135 "版本" t MSG_136 "發布版本" @@ -2368,6 +2368,8 @@ t MSG_319 "忽略 Boot Marker" t MSG_320 "正在重新整理磁區分割 (%s)..." t MSG_321 "你選擇的映像檔是 ISOHybrid,但是檔案作者沒有使之與 ISO/檔案複製模式相容。\n因此強制使用 DD 映像寫入模式。" t MSG_322 "無法開啟或讀取 '%s'" +t MSG_323 "在安裝時套用 SkuSiPolicy.p7b (參閱 KB5042562)" +t MSG_324 "Windows 體驗改善 (不強制安裝 Copilot、OneDrive、Outlook、 快速啟動等功能)" t MSG_325 "正在套用 Windows 客製化設定:%s" t MSG_326 "正在套用使用者設定..." t MSG_327 "Windows 使用者體驗" @@ -2380,7 +2382,7 @@ t MSG_333 "使用此使用者名建立一個本機帳戶:" t MSG_334 "使用目前用戶的區域設定" t MSG_335 "關閉 BitLocker 自動設備加密" t MSG_336 "持久化日誌" -t MSG_337 "必須從 Microsoft 下載附加檔案(“%s”)才能使用此功能:\n- 選 '是' 將連線到網路並進行下載\n- 選 '否' 將取消操作\n\n註: 該檔案將被下載到 Rufus 所在的資料夾中,如果已存在將會自動使用。" +t MSG_337 "必須從 Microsoft 下載附加檔案 (“%s”) 才能使用此功能:\n- 選 '是' 將連線到網路並進行下載\n- 選 '否' 將取消操作\n\n註: 該檔案將被下載到 Rufus 所在的資料夾中,如果已存在將會自動使用。" t MSG_338 "偵測到被撤銷的 UEFI 開機引導程式" t MSG_339 "Rufus 偵測到選取的 ISO 包含一個被撤銷的 UEFI 開機引導程式,當你在完全更新的 UEFI 系統上啟用安全開機時,將產生 %s。\n\n- 如果你從無法信任的來源取得這個 ISO 映像,應該考慮到它可能包含 UEFI 惡意程式,並避免以此進行開機。\n- 如果你從可以信任的來源取得,應該嘗試找到一個更新的版本,才不會出現這個警告。" t MSG_340 "一個 \"安全違規\" 畫面" @@ -2393,6 +2395,27 @@ t MSG_346 "將 Windows 限制為 S-模式 (不相容繞過線上帳號)。" t MSG_347 "專家模式" t MSG_348 "正在擷取封存檔案: %s" t MSG_349 "使用 Rufus MBR" +t MSG_350 "使用以 Windows CA 2023 簽署的開機引導程式 (需搭配相容的電腦)" +t MSG_351 "正在檢查 UEFI 開機引導程式是否被撤銷…" +t MSG_352 "正在檢查 UEFI DBX 更新…" +t MSG_353 "有可用的 DBX 更新" +t MSG_354 "Rufus 發現用於執行 UEFI 安全開機撤銷檢查的 DBX 檔案更新版本,是否下載此更新?\n- 選擇 '是': 將連線到網路並進行下載\n- 選擇 '否': 取消此操作\n\n註: 該檔案將被下載到 Rufus 所在的資料夾中,如果已存在將會自動使用。" +t MSG_355 "以 ⚠靜默模式⚠ 清除磁碟並進行安裝:" +t MSG_356 "你已選擇使用 \"靜默\" Windows 安裝選項。\n\n此為進階選項,僅供希望建立在安裝 Windows 過程中不提示使用者的安裝媒體之使用者使用,過程中會直接清除目標系統中偵測到的第一顆磁碟。\n\n若操作不慎,此選項可能導致發生無法復原的資料遺失!\n\n如果這不是你想要的結果,請選擇 '否' 返回並取消勾選此選項。\n若你選擇 '是',表示你了解且同意承擔所有可能發生的資料遺失風險。" +t MSG_358 "不支援的映像檔位置" +t MSG_359 "你無法使用位於目標磁碟上的映像檔,因為該磁碟將會被完全清除。這就像是試圖鋸斷自己正坐著的樹枝一樣!\n\n請將映像檔移至其它位置後再試一次。" +t MSG_360 "即使支援 TPM 或有更大的記憶體容量,保持啟用此選項也是安全的,因為此選項僅會略過硬體安裝需求,並不會影響 Windows 使用所有可用的硬體資源。" +t MSG_361 "為了讓此選項生效,安裝過程中必須切斷網路連線!" +t MSG_362 "自動拒絕 Windows 初始化中與微軟共享資料的相關問題,而非提示使用者進行選擇。" +t MSG_363 "除非你可以接受 'Windows To Go' 存取內部磁碟,並在未經提示的情況下執行不可逆的檔案系統升級,否則建議保持啟用此選項。" +t MSG_364 "自動以指定的使用者名稱建立本機帳戶,並設定空白密碼,該密碼需在下次登入時進行變更。" +t MSG_365 "複製此電腦的區域設定 (鍵盤、時區、貨幣),而非提示使用者進行選擇。" +t MSG_366 "除非使用者明確要求,否則不要加密系統磁碟。" +t MSG_367 "僅在你了解 S 模式是什麼,且知道即使完全清除並重新安裝 Windows,系統仍可能被鎖定在 S 模式的情況下使用此選項。" +t MSG_368 "若你打算安裝 Windows 的系統已完整更新過安全開機憑證,請使用此選項。若有需要,你可以考慮使用 'Mosby' 來更新系統。" +t MSG_369 "如果你希望撤銷更多可能不安全的 Windows 開機引導程式,請使用此選項,但此操作有可能導致標準 Windows 安裝媒體無法開機。" +t MSG_370 "Windows 體驗增強: 停用微軟試圖強制提供給終端使用者的大多數不必要功能。" +t MSG_371 "如果你使用此選項,請確保目標電腦中除了要安裝 Windows 的磁碟以外,其它所有磁碟都已斷開連接,並且不要將安裝媒體插在任何你不想被清除資料的電腦上。" t MSG_900 "Rufus 是個能格式化並製作可開機 USB 快閃磁碟 (如 USB 隨身碟等) 的工具。" t MSG_901 "官方網站: %s" t MSG_902 "原始碼: %s" @@ -2409,7 +2432,7 @@ t MSG_916 "為沒有 TPM 或安全開機功能的電腦建立 Windows 11 安裝 t MSG_917 "建立持續性 Linux 磁區" t MSG_918 "為選取的磁碟機建立 VHD/DD 映像檔" t MSG_919 "計算被選取映像的 MD5、SHA-1、SHA-256 和 SHA-512 檢查碼" -t MSG_920 "執行壞軌檢查,包括對”假“USB 快閃磁碟\n的偵測" +t MSG_920 "執行壞軌檢查,包括對 ”假“ USB 快閃磁碟\n的偵測" t MSG_921 "下載微軟官方 Windows 映像檔" t MSG_922 "下載 UEFI Shell 映像檔" diff --git a/src/rufus.rc b/src/rufus.rc index 26e8a804..16289189 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.14.2363" +CAPTION "Rufus 4.14.2364" 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,14,2363,0 - PRODUCTVERSION 4,14,2363,0 + FILEVERSION 4,14,2364,0 + PRODUCTVERSION 4,14,2364,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.14.2363" + VALUE "FileVersion", "4.14.2364" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2363" + VALUE "ProductVersion", "4.14.2364" END END BLOCK "VarFileInfo" From bca7974d3e1923d6fa14f85f598aba3c09e4e797 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 14 Apr 2026 14:03:59 +0100 Subject: [PATCH 174/192] [wue] trim the local account name string * Closes #2950. --- src/parser.c | 19 +++++++++++++++++++ src/rufus.h | 1 + src/rufus.rc | 10 +++++----- src/stdlg.c | 2 ++ 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/parser.c b/src/parser.c index 875a63e4..f2ad5532 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1321,6 +1321,25 @@ void filter_chars(char* str, const char* rem, const char rep) } } +/* + * Trim all leadings and trailing whitespaces + */ +void trim(char* str) +{ + size_t l; + char* p; + + if (str == NULL) + return; + l = strlen(str); + if (l < 1) + return; + while (isspace(str[l - 1])) + str[--l] = '\0'; + for (p = str; *p != '\0' && isspace(*p); p++, l--); + memmove(str, p, l + 1); +} + /* * Remove all instances of substring 'sub' form string 'src. * The returned string is allocated and must be freed by the caller. diff --git a/src/rufus.h b/src/rufus.h index faaa8ea0..578e033e 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -876,6 +876,7 @@ extern char* insert_section_data(const char* filename, const char* section, cons extern char* replace_in_token_data(const char* filename, const char* token, const char* src, const char* rep, BOOL dos2unix); extern char* replace_char(const char* src, const char c, const char* rep); extern void filter_chars(char* str, const char* rem, const char rep); +extern void trim(char* str); extern char* remove_substr(const char* src, const char* sub); extern void parse_update(char* buf, size_t len); extern void* get_data_from_asn1(const uint8_t* buf, size_t buf_len, const char* oid_str, uint8_t asn1_type, size_t* data_len); diff --git a/src/rufus.rc b/src/rufus.rc index 16289189..c4aef711 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.14.2364" +CAPTION "Rufus 4.14.2365" 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,14,2364,0 - PRODUCTVERSION 4,14,2364,0 + FILEVERSION 4,14,2365,0 + PRODUCTVERSION 4,14,2365,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.14.2364" + VALUE "FileVersion", "4.14.2365" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2364" + VALUE "ProductVersion", "4.14.2365" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index 675635e0..02ae6dc3 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -1077,6 +1077,8 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam if (strchr(username_invalid_chars, unattend_username[i]) != NULL) unattend_username[i] = '_'; } + // Also remove leading and trailing whitespaces (https://github.com/pbatard/rufus/issues/2950) + trim(unattend_username); } if (selection_data.options->edition_index > 0) unattend_edition_index = (int)ComboBox_GetCurItemData(GetDlgItem(hDlg, IDC_SELECTION_EDITION)); From 353f78f1dddf811c42c36f6d85ab1d47899a19d6 Mon Sep 17 00:00:00 2001 From: Ahmed Rasnaama <ahmedrasnaama@gmail.com> Date: Tue, 14 Apr 2026 14:06:04 +0100 Subject: [PATCH 175/192] [loc] update Arabic translation to latest --- res/loc/po/ar-SA.po | 149 +++++++++++++++++++++++++++++++++++++++----- res/loc/rufus.loc | 34 ++++++++-- src/rufus.rc | 10 +-- 3 files changed, 169 insertions(+), 24 deletions(-) diff --git a/res/loc/po/ar-SA.po b/res/loc/po/ar-SA.po index b7e2fad1..dd7cb218 100644 --- a/res/loc/po/ar-SA.po +++ b/res/loc/po/ar-SA.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-04-26 10:29+0100\n" -"PO-Revision-Date: 2024-04-29 10:22+0100\n" +"POT-Creation-Date: 2026-04-14 08:09+0100\n" +"PO-Revision-Date: 2026-04-14 13:45+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: ar_SA\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Arabic (العربية)\n" "X-Rufus-LCID: 0x0401, 0x0801, 0x0c01, 0x1001, 0x1401, 0x1801, 0x1c01, 0x2001, 0x2401, 0x2801, 0x2c01, 0x3001, 0x3401, 0x3801, 0x3c01, 0x4001\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -310,7 +310,7 @@ msgstr "ت.ب" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "ب.ب" @@ -811,7 +811,7 @@ msgstr "التثبيت القياسي لنظام التشغيل Windows" #. http://en.wikipedia.org/wiki/Windows_To_Go in your language. #. Otherwise, you may add a parenthesis eg. "Windows To Go (<hint at what it does>)" msgid "Windows To Go" -msgstr "Windows To Go" +msgstr "ويندوز المحمول (Windows To Go)" #. • MSG_119 msgid "advanced drive properties" @@ -848,7 +848,7 @@ msgstr "لا استمرارية" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "حدد حجم التقسيم المستمر لجهاز ال USB الحي, تحديد الحجم بقيمة 0 سيعطل التقسيم المستمر." @@ -890,17 +890,17 @@ msgstr "هذا القرص يستخدم من قبل برنامج آخر. هل ت #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"لقد قام Rufus بإكتشاف أنك تحاول إنشاء وسائط Windows To Go بناءً على ISO 1809\n" +"اكتشف برنامج روفوس Rufus أنك تحاول إنشاء وسائط \"Windows To Go\" باستخدام ملف ISO من إصدار 1809.\n" "\n" -"بسبب عيب في Microsoft, سوف تتوقف الوسائط خلال إقلاع Windows (شاشة الموت الزرقاء) ما لم تقم يدوياً بإستبدال ملف 'WppRecorder.sys' بإصدار 1803.\n" +"بسبب خلل برمجي في مايكروسوفت، ستتعطل هذه الوسائط أثناء تشغيل ويندوز (شاشة الموت الزرقاء)، ما لم تستبدل الملف \"WppRecorder.sys\" يدويًا بنسخة من إصدار 1803.\n" "\n" -"يرجى العلم أن سبب عدم إمكانية Rufus من إصلاح المشكلة تلقائيا هو أن ملف 'WppRecorder.sys' محفوظ الحقوق ل Microsoft, لذلك لا يمكننا تضمين نسخة من الملف في التطبيق..." +"يُرجى العلم أيضًا أن سبب عدم قدرة روفوس Rufus على إصلاح هذه المشكلة تلقائيًا هو أن الملف \"WppRecorder.sys\" محمي بحقوق الطبع والنشر لمايكروسوفت، لذا لا يمكننا قانونيًا تضمين نسخة منه في التطبيق." #. • MSG_134 msgid "" @@ -1798,6 +1798,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "غير قادر على فتح أو قراءة '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "قم بتطبيق SkuSiPolicy.p7b عند التثبيت (ألق نظرة على KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "تحسينات جودة الحياة QoL (لا تفرض استخدام Copilot أو OneDrive أو Outlook أو Fast Startup، إلخ..)." + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "جاري تطبيق تخصيصات ويندوز: %s" @@ -1848,13 +1856,13 @@ msgstr "سجل متواصل" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"يجب تنزيل ملف إضافي ('diskcopy.dll') من Microsoft لتثبيت MS-DOS:\n" +"يجب تنزيل ملف إضافي ('%s') من مايكروسفت Microsoft لاستخدام هذه الميزة:\n" "- حدد \"نعم\" للاتصال بالإنترنت وتنزيله\n" "- اختر \"لا\" لإلغاء العملية\n" "\n" @@ -1908,7 +1916,7 @@ msgstr "" #. • MSG_346 msgid "Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)" -msgstr "تقييد Windows على الوضع \"S\" (S-Mode، غير متوافق مع تجاوز الحساب عبر الإنترنت)" +msgstr "تقييد Windows على الوضع \"S-Mode\" (غير متوافق مع تجاوز الحساب عبر الإنترنت)" #. • MSG_347 msgid "Expert Mode" @@ -1922,6 +1930,119 @@ msgstr "استخراج ملفات الأرشيف: %s" msgid "Use Rufus MBR" msgstr "استخدم Refus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "استخدم برامج الإقلاع المُوَقع \"Windows CA 2023\" (يتطلب أن يكون جهاز كمبيوتر المستهدف متوافقا)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "جارٍ التحقق من إلغاء صلاحية برنامج الإقلاع UEFI bootloader..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "جارٍ التحقق من وجود تحديثات لـ UEFI DBX..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "تحديث الـ DBX متوفر" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"عثر روفوس Rufus على نسخة محدثة من ملفات DBX المستخدمة لإجراء فحوصات إلغاء التمهيد الآمن لـ UEFI. هل ترغب بتنزيل هذا التحديث؟\n" +"- اختر «نعم» للاتصال بالإنترنت وتنزيل هذا المحتوى\n" +"- اختر «لا» لإلغاء العملية\n" +"\n" +"ملاحظة: سيتم تنزيل الملفات في مجلد التطبيق، وسيتم إعادة استخدامها تلقائيًا في حال وجودها." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠بصمت⚠ امسح القرص وقم بالتثبيت:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes', you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"لقد اخترتَ استخدام خيار التثبيت الصامت لنظام ويندوز.\n" +"\n" +"حذار: هذا خيار متقدم، مخصص لمن يرغبون في إنشاء وسائط تثبيت لا تُطالب المستخدم بأي إجراء أثناء تثبيت ويندوز، وبالتالي ** تمسح القرص الأول المُكتشف على النظام المستهدف مسحًا تامًا **. في حال عدم توخي الحذر، قد يؤدي استخدام هذا الخيار إلى فقدان البيانات بشكل لا رجعة فيه!\n" +"\n" +"إذا لم يكن هذا ما تريده، يُرجى اختيار \"لا\" للعودة وإلغاء تحديد الخيار.\n" +"\n" +"أما إذا اخترتَ \"نعم\"، فأنتَ تُقرّ بأنك تتحمل كامل المسؤولية عن أي فقدان للبيانات." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "موقع الصورة غير مدعوم" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"لا يمكنك استخدام صورة موجودة على القرص المستهدف، لأن هذا القرص سيُمسح بالكامل. الأمر أشبه بمحاولة قطع الغصن الذي تجلس عليه!\n" +"\n" +"يرجى نقل الصورة إلى قرص آخر ثم المحاولة مرة أخرى." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "من الآمن ترك هذا الخيار مفعلاً حتى لو لم يكن لديك وحدة TPM أو المزيد من ذاكرة الوصول العشوائي، لأن هذا الخيار يتجاوز متطلبات الإعداد فقط ولا يمنع نظام التشغيل Windows فعليًا من استخدام جميع الأجهزة المتاحة." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "لكي يعمل هذا الخيار، يجب فصل شبكة الإنترنت أثناء التثبيت!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "قم بالإجابة تلقائيًا بـ \"لا\" على أسئلة إعداد ويندوز Windows المتعلقة بمشاركة البيانات مع مايكروسفت Microsoft، بدلاً من مطالبة المستخدم بذلك." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "يجب عليك ترك هذا الخيار مفعلاً، إلا إذا كنت موافقًا على وصول \"Windows To Go\" إلى الأقراص الداخلية والإجراء بصمت ترقيات نظام الملفات التي لا رجعة فيها." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "إنشاء حساب محلي تلقائيًا باسم المستخدم المحدد، باستخدام كلمة مرور فارغة والتي يجب تغييرها عند تسجيل الدخول التالي." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "قم بإستخدم نفس الإعدادات الإقليمية لهذا الكمبيوتر (لوحة المفاتيح، المنطقة الزمنية، العملة)، بدلاً من مطالبة المستخدم." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "لا تقم بتشفير قرص النظام، إلا إذا طلب المستخدم ذلك صراحةً." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "حذار: استخدم هذا الخيار فقط إذا كنت تعرف ما هو الوضع S-Mode وتفهم أن نظامك قد يظل عالقًا في الوضع S-Mode حتى بعد مسح نظام التشغيل ويندوز Windows وإعادة تثبيته بالكامل." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "استخدم هذا الخيار إذا كان النظام الذي تنوي تثبيت ويندوز عليه يستخدم شهادات التمهيد الآمن Secure Boot المحدثة بالكامل. إذا لزم الأمر، يمكنك البحث في استخدام \"موسبي\" Mosby لتحديث نظامك." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "استخدم هذا الخيار إذا كنت ترغب في إلغاء برامج اقلاع نظام التشغيل ويندوز الإضافية التي يحتمل أن تكون غير آمنة bootloaders، ولكن هذا يمكن أن يمنع وسائط ويندوز القياسية من الإقلاع أيضًا." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "تحسينات \"جودة الحياة\": تعطيل معظم الميزات غير المرغوب فيها التي تحاول مايكروسوفت فرضها على المستخدمين." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "إذا كنت تستخدم هذا الخيار، فيرجى التأكد من فصل كل الأقراص عن جهاز الكمبيوتر المستهدف، باستثناء القرص الذي تريد تثبيت نظام التشغيل ويندوز Windows عليه، وكذلك عدم ترك هذه الفلاشة موصولة بأي جهاز كمبيوتر لا تريد مسحه." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index f2661da1..d133686e 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -4,7 +4,7 @@ # List of all languages included in this file (with version) # • v4.14 "en-US" "English (English)" -# • v4.5 "ar-SA" "Arabic (العربية)" +# • v4.14 "ar-SA" "Arabic (العربية)" # • v4.14 "bg-BG" "Bulgarian (Български)" # • v4.14 "zh-CN" "Chinese Simplified (简体中文)" # • v4.14 "zh-TW" "Chinese Traditional (正體中文)" @@ -667,7 +667,7 @@ t MSG_922 "Download UEFI Shell ISOs" ######################################################################### l "ar-SA" "Arabic (العربية)" 0x0401, 0x0801, 0x0c01, 0x1001, 0x1401, 0x1801, 0x1c01, 0x2001, 0x2401, 0x2801, 0x2c01, 0x3001, 0x3401, 0x3801, 0x3c01, 0x4001 -v 4.5 +v 4.14 b "en-US" a "r" @@ -849,6 +849,7 @@ t MSG_114 "تستخدم هذه الصورة Syslinux %s%s لكن هذا التط t MSG_115 "التنزيل من الانترنت مطلوب" t MSG_116 "هذه الصورة (image) تستعمل Grub %s لكن التطبيق يحتوي فقط على ملفات تثبيت Grub %s.\n\nبما أن إصدارات Grub المختلفة قد لا تتوافق مع بعضهاالبعض، وبما أنه لا يمكن ضمها كلها، فسيحاول Rufus تحديد مكان إصدار من ملف تثبيت Grub ('core.img') يتوافق مع الموجود في صورتك:\n- إختر 'نعم' للاتصال بلالأنترنت ومحاولة تنزيله\n- إختر 'لا' لاستعمال الإصدار الافتراضي من Rufus\n- إختر 'إلغاء' لوقف العملية\n\nملاحظة: سيتم تنزيل الملف في المجلد الحالي للتطبيق و سيستعمل تلقائيا إذا كان موجداً. إذا لم يتم العثور على إصدار موافق، فسيُستعمل الإصدار الافتراضي كبديل." t MSG_117 "التثبيت القياسي لنظام التشغيل Windows" +t MSG_118 "ويندوز المحمول (Windows To Go)" t MSG_119 "خصائص محرك الأقراص المتقدّمة" t MSG_120 "خيارات التهّيئة المتقدّمة" t MSG_121 "أظهار %s" @@ -863,7 +864,7 @@ t MSG_129 "لقد قمت لتوك بإنشاء وسائط تستخدم محمل t MSG_130 "اختيار صورة Windows" t MSG_131 "يحتوي ملف ISO هذا على العديد من صور Windows.\nالرجاء تحديد الصورة التي ترغب في استخدامها لهذا التثبيت:" t MSG_132 "هذا القرص يستخدم من قبل برنامج آخر. هل تود التهيئة على أية حال ؟" -t MSG_133 "لقد قام Rufus بإكتشاف أنك تحاول إنشاء وسائط Windows To Go بناءً على ISO 1809\n\nبسبب عيب في Microsoft, سوف تتوقف الوسائط خلال إقلاع Windows (شاشة الموت الزرقاء) ما لم تقم يدوياً بإستبدال ملف 'WppRecorder.sys' بإصدار 1803.\n\nيرجى العلم أن سبب عدم إمكانية Rufus من إصلاح المشكلة تلقائيا هو أن ملف 'WppRecorder.sys' محفوظ الحقوق ل Microsoft, لذلك لا يمكننا تضمين نسخة من الملف في التطبيق..." +t MSG_133 "اكتشف برنامج روفوس Rufus أنك تحاول إنشاء وسائط \"Windows To Go\" باستخدام ملف ISO من إصدار 1809.\n\nبسبب خلل برمجي في مايكروسوفت، ستتعطل هذه الوسائط أثناء تشغيل ويندوز (شاشة الموت الزرقاء)، ما لم تستبدل الملف \"WppRecorder.sys\" يدويًا بنسخة من إصدار 1803.\n\nيُرجى العلم أيضًا أن سبب عدم قدرة روفوس Rufus على إصلاح هذه المشكلة تلقائيًا هو أن الملف \"WppRecorder.sys\" محمي بحقوق الطبع والنشر لمايكروسوفت، لذا لا يمكننا قانونيًا تضمين نسخة منه في التطبيق." t MSG_134 "بسبب إختيار نظام التجزئة MBR, Rufus(Rufus) قادر فقط على إنشاء تجزئة لغاية 2 TB على هذه الوسائط, الذي سوف يؤدي إلى عدم توفر %s من مساحة القرص.\n\nهل تريد المتابعة ؟" t MSG_135 "الإصدار" t MSG_136 "الإطلاق" @@ -1051,6 +1052,8 @@ t MSG_319 "تجاهل علامة الإقلاع" t MSG_320 "جاري تحديث تخطيط القسم (%s) ..." t MSG_321 "الصورة التي حددتها هي ISO-Hybrid (هجينة) ، لكن منشئوها لم يجعلوها متوافقة مع وضع نسخ ملف ISO. \nنتيجة لذلك ، سيتم فرض وضع DD لكتابة الصورة." t MSG_322 "غير قادر على فتح أو قراءة '%s'" +t MSG_323 "قم بتطبيق SkuSiPolicy.p7b عند التثبيت (ألق نظرة على KB5042562)" +t MSG_324 "تحسينات جودة الحياة QoL (لا تفرض استخدام Copilot أو OneDrive أو Outlook أو Fast Startup، إلخ..)." t MSG_325 "جاري تطبيق تخصيصات ويندوز: %s" t MSG_326 "جاري تطبيق خيارات المستخدم ..." t MSG_327 "تجربة مستخدم ويندوز" @@ -1063,7 +1066,7 @@ t MSG_333 "قم بإنشاء حساب محلي باسم المستخدم:" t MSG_334 "قم بتعيين الخيارات الإقليمية لتطابق خيارات المستخدم الحالي" t MSG_335 "تعطيل التشفير التلقائي BitLocker للجهاز" t MSG_336 "سجل متواصل" -t MSG_337 "يجب تنزيل ملف إضافي ('%s') من Microsoft لاستخدام هذه الميزة:\n- حدد \"نعم\" للاتصال بالإنترنت وتنزيله\n- اختر \"لا\" لإلغاء العملية\n\nملاحظة: سيتم تنزيل الملف في مجلد التطبيق وسيتم إعادة استخدامه تلقائيًا إذا كان موجودًا." +t MSG_337 "يجب تنزيل ملف إضافي ('%s') من مايكروسفت Microsoft لاستخدام هذه الميزة:\n- حدد \"نعم\" للاتصال بالإنترنت وتنزيله\n- اختر \"لا\" لإلغاء العملية\n\nملاحظة: سيتم تنزيل الملف في مجلد التطبيق وسيتم إعادة استخدامه تلقائيًا إذا كان موجودًا." t MSG_338 "تم اكتشاف أداة تحميل التشغيل UEFI التي تم إبطالها سابقا" t MSG_339 "اكتشف Rufus أن ملف ISO الذي حددته يحتوي على أداة تحميل التشغيل UEFI التي تم إبطالها سابقا والتي ستنتج %s، عند تمكين Secure Boot محدث بالكامل على نظام UEFI .\n\n- إذا حصلت على صورة ISO هذه من مصدر غير حسن السمعة، فيجب أن تفكر في احتمالية احتوائها على برامج UEFI ضارة وتجنب التشغيل منها.\n- إذا حصلت على صورة ISO هذه من مصدر موثوق به، فعليك محاولة العثور على إصدار أكثر حداثة، والذي لن ينتج عنه هذا التحذير." t MSG_340 "شاشة \"الانتهاكات الأمنية\"" @@ -1072,10 +1075,31 @@ t MSG_342 "صورة VHDX مضغوطة" t MSG_343 "صورة VHD غير مضغوطة" t MSG_344 "صورة (image) لتحديث فلاشة كاملة (FFU)" t MSG_345 "يجب تنزيل بعض البيانات الإضافية من Microsoft لاستخدام هذه الوظيفة:\n- اختر \"نعم\" للاتصال بالإنترنت وتنزيلها\n- اختر \"لا\" لإلغاء العملية" -t MSG_346 "تقييد Windows على الوضع \"S\" (S-Mode، غير متوافق مع تجاوز الحساب عبر الإنترنت)" +t MSG_346 "تقييد Windows على الوضع \"S-Mode\" (غير متوافق مع تجاوز الحساب عبر الإنترنت)" t MSG_347 "وضع الخبير" t MSG_348 "استخراج ملفات الأرشيف: %s" t MSG_349 "استخدم Refus MBR" +t MSG_350 "استخدم برامج الإقلاع المُوَقع \"Windows CA 2023\" (يتطلب أن يكون جهاز كمبيوتر المستهدف متوافقا)" +t MSG_351 "جارٍ التحقق من إلغاء صلاحية برنامج الإقلاع UEFI bootloader..." +t MSG_352 "جارٍ التحقق من وجود تحديثات لـ UEFI DBX..." +t MSG_353 "تحديث الـ DBX متوفر" +t MSG_354 "عثر روفوس Rufus على نسخة محدثة من ملفات DBX المستخدمة لإجراء فحوصات إلغاء التمهيد الآمن لـ UEFI. هل ترغب بتنزيل هذا التحديث؟\n- اختر «نعم» للاتصال بالإنترنت وتنزيل هذا المحتوى\n- اختر «لا» لإلغاء العملية\n\nملاحظة: سيتم تنزيل الملفات في مجلد التطبيق، وسيتم إعادة استخدامها تلقائيًا في حال وجودها." +t MSG_355 "⚠بصمت⚠ امسح القرص وقم بالتثبيت:" +t MSG_356 "لقد اخترتَ استخدام خيار التثبيت الصامت لنظام ويندوز.\n\nحذار: هذا خيار متقدم، مخصص لمن يرغبون في إنشاء وسائط تثبيت لا تُطالب المستخدم بأي إجراء أثناء تثبيت ويندوز، وبالتالي ** تمسح القرص الأول المُكتشف على النظام المستهدف مسحًا تامًا **. في حال عدم توخي الحذر، قد يؤدي استخدام هذا الخيار إلى فقدان البيانات بشكل لا رجعة فيه!\n\nإذا لم يكن هذا ما تريده، يُرجى اختيار \"لا\" للعودة وإلغاء تحديد الخيار.\n\nأما إذا اخترتَ \"نعم\"، فأنتَ تُقرّ بأنك تتحمل كامل المسؤولية عن أي فقدان للبيانات." +t MSG_358 "موقع الصورة غير مدعوم" +t MSG_359 "لا يمكنك استخدام صورة موجودة على القرص المستهدف، لأن هذا القرص سيُمسح بالكامل. الأمر أشبه بمحاولة قطع الغصن الذي تجلس عليه!\n\nيرجى نقل الصورة إلى قرص آخر ثم المحاولة مرة أخرى." +t MSG_360 "من الآمن ترك هذا الخيار مفعلاً حتى لو لم يكن لديك وحدة TPM أو المزيد من ذاكرة الوصول العشوائي، لأن هذا الخيار يتجاوز متطلبات الإعداد فقط ولا يمنع نظام التشغيل Windows فعليًا من استخدام جميع الأجهزة المتاحة." +t MSG_361 "لكي يعمل هذا الخيار، يجب فصل شبكة الإنترنت أثناء التثبيت!" +t MSG_362 "قم بالإجابة تلقائيًا بـ \"لا\" على أسئلة إعداد ويندوز Windows المتعلقة بمشاركة البيانات مع مايكروسفت Microsoft، بدلاً من مطالبة المستخدم بذلك." +t MSG_363 "يجب عليك ترك هذا الخيار مفعلاً، إلا إذا كنت موافقًا على وصول \"Windows To Go\" إلى الأقراص الداخلية والإجراء بصمت ترقيات نظام الملفات التي لا رجعة فيها." +t MSG_364 "إنشاء حساب محلي تلقائيًا باسم المستخدم المحدد، باستخدام كلمة مرور فارغة والتي يجب تغييرها عند تسجيل الدخول التالي." +t MSG_365 "قم بإستخدم نفس الإعدادات الإقليمية لهذا الكمبيوتر (لوحة المفاتيح، المنطقة الزمنية، العملة)، بدلاً من مطالبة المستخدم." +t MSG_366 "لا تقم بتشفير قرص النظام، إلا إذا طلب المستخدم ذلك صراحةً." +t MSG_367 "حذار: استخدم هذا الخيار فقط إذا كنت تعرف ما هو الوضع S-Mode وتفهم أن نظامك قد يظل عالقًا في الوضع S-Mode حتى بعد مسح نظام التشغيل ويندوز Windows وإعادة تثبيته بالكامل." +t MSG_368 "استخدم هذا الخيار إذا كان النظام الذي تنوي تثبيت ويندوز عليه يستخدم شهادات التمهيد الآمن Secure Boot المحدثة بالكامل. إذا لزم الأمر، يمكنك البحث في استخدام \"موسبي\" Mosby لتحديث نظامك." +t MSG_369 "استخدم هذا الخيار إذا كنت ترغب في إلغاء برامج اقلاع نظام التشغيل ويندوز الإضافية التي يحتمل أن تكون غير آمنة bootloaders، ولكن هذا يمكن أن يمنع وسائط ويندوز القياسية من الإقلاع أيضًا." +t MSG_370 "تحسينات \"جودة الحياة\": تعطيل معظم الميزات غير المرغوب فيها التي تحاول مايكروسوفت فرضها على المستخدمين." +t MSG_371 "إذا كنت تستخدم هذا الخيار، فيرجى التأكد من فصل كل الأقراص عن جهاز الكمبيوتر المستهدف، باستثناء القرص الذي تريد تثبيت نظام التشغيل ويندوز Windows عليه، وكذلك عدم ترك هذه الفلاشة موصولة بأي جهاز كمبيوتر لا تريد مسحه." t MSG_900 "برنامج Rufus هو أداة تساعد في تنسيق وإنشاء أقراص الإقلاع USB، مثل مفاتيح USB، بطاقات الذاكرة، وغيرها." t MSG_901 "الموقع الرسمي: %s" t MSG_902 "كود المصدر: %s" diff --git a/src/rufus.rc b/src/rufus.rc index c4aef711..f8cc8e4e 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.14.2365" +CAPTION "Rufus 4.14.2366" 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,14,2365,0 - PRODUCTVERSION 4,14,2365,0 + FILEVERSION 4,14,2366,0 + PRODUCTVERSION 4,14,2366,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.14.2365" + VALUE "FileVersion", "4.14.2366" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2365" + VALUE "ProductVersion", "4.14.2366" END END BLOCK "VarFileInfo" From 74efb16c9dace064fdd32666d2ab9d9c4efc4906 Mon Sep 17 00:00:00 2001 From: Kiril Razguliajev <kiril.razguliajev@stud.vilniustech.lt> Date: Sat, 18 Apr 2026 00:42:51 +0100 Subject: [PATCH 176/192] [loc] update Lithuanian translation to latest --- res/loc/po/lt-LT.po | 269 ++++++++++++++++++++++++++++++++++++++++---- res/loc/rufus.loc | 41 ++++++- src/rufus.rc | 10 +- 3 files changed, 290 insertions(+), 30 deletions(-) diff --git a/res/loc/po/lt-LT.po b/res/loc/po/lt-LT.po index e4ee34f9..e450eeff 100644 --- a/res/loc/po/lt-LT.po +++ b/res/loc/po/lt-LT.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 3.22\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2023-04-25 13:16+0100\n" -"PO-Revision-Date: 2023-04-25 13:48+0100\n" +"POT-Creation-Date: 2026-04-17 17:59+0300\n" +"PO-Revision-Date: 2026-04-18 00:01+0300\n" "Last-Translator: \n" "Language-Team: \n" "Language: lt_LT\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Lithuanian (Lietuvių)\n" "X-Rufus-LCID: 0x0427\n" -"X-Generator: Poedit 3.2.2\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -54,13 +54,12 @@ msgstr "Išvardinti USB kietuosius diskus" msgid "Add fixes for old BIOSes (extra partition, align, etc.)" msgstr "Pataisos seniems BIOS (papildomas skaidinys, ir kt.)" -#. • IDD_DIALOG → IDC_RUFUS_MBR +#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION #. -#. 'MBR': See http://en.wikipedia.org/wiki/Master_boot_record -#. Rufus can install it's own custom MBR (the Rufus MBR), which also allows users to -#. specify a custom disk ID for the BIOS. The tooltip for this control is MSG_167. -msgid "Use Rufus MBR with BIOS ID" -msgstr "Naudoti Rufus MBR su BIOS ID" +#. It is acceptable to drop the "runtime" if you are running out of space +#, fuzzy +msgid "Enable runtime UEFI media validation" +msgstr "Įgalinti vykdymo laiko UEFI laikmenos patvirtinimą" #. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT msgid "Format Options" @@ -310,7 +309,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -848,7 +847,7 @@ msgstr "Be išlikimo" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Nustatykite išliekamojo skaidinio dydį gyvai USB laikmenai. Nustačius 0 dydį, išliekamasis skaidinys išjungiamas." @@ -889,8 +888,9 @@ msgid "Another program or process is accessing this drive. Do you want to format msgstr "Kita programa arba procesas kreipiasi į šį diską. Ar vis tiek norite jį formatuoti?" #. • MSG_133 +#, fuzzy msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" @@ -1043,17 +1043,10 @@ msgid "Check this box to allow the display of international labels and set a dev msgstr "Pažymėkite šį langelį, norėdami įgalinti tarptautinių žymių rodymą ir įrenginio piktogramos nustatymą (sukuria autorun.inf)" #. • MSG_167 -msgid "Install an MBR that allows boot selection and can masquerade the BIOS USB drive ID" +#, fuzzy +msgid "Install a UEFI bootloader, that will perform MD5Sum file validation of the media" msgstr "Įdiegia MBR, kuris įgalina įkrovos pasirinkimą ir gali maskuoti BIOS USB disko ID" -#. • MSG_168 -msgid "" -"Try to masquerade first bootable USB drive (usually 0x80) as a different disk.\n" -"This should only be necessary if you install Windows XP and have more than one disk." -msgstr "" -"Bandyti maskuoti pirmą įkraunamą USB diską (paprastai 0x80) kaip kitą diską.\n" -"To turėtų prireikti tik jei diegsite Windows XP ir bus daugiau nei vienas diskas." - #. • MSG_169 msgid "" "Create an extra hidden partition and try to align partitions boundaries.\n" @@ -1805,6 +1798,16 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Nepavyksta atidaryti arba perskaityti \"%s\"" +#. • MSG_323 +#, fuzzy +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Diegimo metu pritaikykite SkuSiPolicy.p7b (žr. KB5042562)" + +#. • MSG_324 +#, fuzzy +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "QoL patobulinimai (Neverskite Copilot, OneDrive, Outlook, Greitas Paleidimas, etc.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Windows tinkinimo taikymas: %s" @@ -1853,6 +1856,228 @@ msgstr "BitLocker automatinio įrenginių šifravimo išjungimas" msgid "Persistent log" msgstr "Nuolatinis žurnalas" +#. • MSG_337 +#, fuzzy +msgid "" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" +"- Select 'Yes' to connect to the Internet and download it\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The file will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Papildomas failas ('%s') turi būti atsisiųstas iš Microsoft, kad naudotis šią funkcija:\n" +"- Pasirinkite 'Taip' kad prisijungtumėte prie Interneto ir atsisiųstumėte jį\n" +"- Pasirinkite 'Ne' kad atšaukti operacija\n" +"\n" +"Pastaba: Failas bus atsisiųstas į programos katalogą ir, jei ten jau yra, bus automatiškai panaudotas." + +#. • MSG_338 +#, fuzzy +msgid "Revoked UEFI bootloader detected" +msgstr "Aptikta panaikinta UEFI įkrovos tvarkyklė" + +#. • MSG_339 +#, fuzzy +msgid "" +"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\n" +"\n" +"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\n" +"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning." +msgstr "" +"Rufus aptiko, kad šis pasirinktas ISO tūri UEFI įkrovos programa kuris buvo panaikintas ir kuris kurs %s, kai visiškai atnaujintoje EUFI sistemoje yra įjungtas saugus įkrovimas.\n" +"\n" +"- Jei ši ISO atvaizdą gavote iš nepatikimo šaltinio, turėtumėte apsvarstyti galimybę, kad jame gali būti UEFI kenkėjiška programa, ir vengti paleisti sistemą iš jos.\n" +"- Jei gavote iš patikimo šaltinio, turėtumėte pabandyti rasti naujesnę versiją, kuri nesukels šio įspėjimo." + +#. • MSG_340 +#, fuzzy +msgid "a \"Security Violation\" screen" +msgstr "ekranas \"Saugumo pažeidimas\"" + +#. • MSG_341 +#, fuzzy +msgid "a Windows Recovery Screen (BSOD) with '%s'" +msgstr "Windows atkūrimo ekranas (BSOD) su pranešimu '%s'" + +#. • MSG_342 +#, fuzzy +msgid "Compressed VHDX Image" +msgstr "Suspaustas VHDX Atvaizdas" + +#. • MSG_343 +#, fuzzy +msgid "Uncompressed VHD Image" +msgstr "Nesuspaustas VHD Atvaizdas" + +#. • MSG_344 +#, fuzzy +msgid "Full Flash Update Image" +msgstr "Pilnas Flash Atnaujinimo Atvaizdas" + +#. • MSG_345 +#, fuzzy +msgid "" +"Some additional data must be downloaded from Microsoft to use this functionality:\n" +"- Select 'Yes' to connect to the Internet and download it\n" +"- Select 'No' to cancel the operation" +msgstr "" +"Reikia atsisiųsti papildomų duomenų iš Microsoft, kad naudotis šią funkciją:\n" +"- Pasirinkite 'Taip' kad prisijungtumėte prie Interneto ir atsisiųstumėte jį\n" +"- Pasirinkite 'Ne' kad atšaukti operacija" + +#. • MSG_346 +#, fuzzy +msgid "Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)" +msgstr "Apriboti Windows iki S-režimo (NESUDERINAMA su internetinės paskyros apėjimu)" + +#. • MSG_347 +#, fuzzy +msgid "Expert Mode" +msgstr "Eksperto režimas" + +#. • MSG_348 +#, fuzzy +msgid "Extracting archive files: %s" +msgstr "Išskleiskite failus iš čia: %s" + +#. • MSG_349 +#, fuzzy +msgid "Use Rufus MBR" +msgstr "Naudokit Rufus MBR" + +#. • MSG_350 +#, fuzzy +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Naudokite 'Windows CA 2023' pasirašytus įkrovos tvarkyklės (Reikalingas suderinamas tikslinis kompiuteris)" + +#. • MSG_351 +#, fuzzy +msgid "Checking for UEFI bootloader revocation..." +msgstr "Tikrinama, ar nėra UEFI įkrovos tvarkyklės atšaukimo..." + +#. • MSG_352 +#, fuzzy +msgid "Checking for UEFI DBX updates..." +msgstr "Ieškoma UEFI DBX atnaujinimų..." + +#. • MSG_353 +#, fuzzy +msgid "DBX update available" +msgstr "DBX atnaujinimas pasiekimas" + +#. • MSG_354 +#, fuzzy +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus rado atnaujintą DBX failų versija, naudojamų UEFI saugaus įkrovimo atšaukimo patikrinimams atlikti. Ar norite atsisiųsti šį atnaujinimą?\n" +"- Pasirinkite 'Taip' kad prisijungtumėte prie Interneto ir atsisiųstumėte jį\n" +"- Pasirinkite 'Ne' kad atšaukti operacija\n" +"\n" +"Pastaba: Failas bus atsisiųstas į programos katalogą ir, jei ten jau yra, bus automatiškai panaudotas." + +#. • MSG_355 +#, fuzzy +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠TYLIAI⚠ ištrinti diską ir įdiegti:" + +#. • MSG_356 +#, fuzzy +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes', you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Jūs pasirinkote naudotis \"tylioji\" Windows diegimo parinkti.\n" +"\n" +"Tai išplėstinė parinktis, skirta žmonėms, norintiems sukurti laikmeną, kuri neragina vartotojo diegiant „Windows“ ir todėl BE SĄLYGŲ IŠTRINA pirmąjį aptiktą diską tikslinėje sistemoje. Jei nebūsite atsargūs, naudodami šią parinktį galite NEATGRĄŽINAMAI PRARASTI DUOMENIS!\n" +"\n" +"Jei to nenorite, pasirinkite 'Ne', kad grįžtumėte ir panaikintumėte parinkties žymėjimą.\n" +"Priešingu atveju, jei pasirinksite 'Taip', sutinkate, kad visa atsakomybė už bet kokį duomenų praradimą teks JUMS." + +#. • MSG_358 +#, fuzzy +msgid "Unsupported image location" +msgstr "Nepalaikoma atvaizdo vieta" + +#. • MSG_359 +#, fuzzy +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Negalite naudoti atvaizdo, esančio paskirties diske, nes tas diskas bus visiškai ištrintas. Tai tas pats, kas bandyti pjauti šaką, ant kurios sėdite!\n" +"\n" +"Perkelkite atvaizdą į kitą vietą ir bandykite dar kartą." + +#. • MSG_360 +#, fuzzy +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Šią parinktį galima palikti įjungtą, net jei turite TPM ar daugiau RAM, nes ši parinktis tik apeina sąrankos reikalavimus ir iš tikrųjų netrukdo „Windows“ naudoti visos turimos aparatinės įrangos." + +#. • MSG_361 +#, fuzzy +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Kad ši parinktis veiktų, diegimo metu BŪTINA atjungti tinklą/Internetą!" + +#. • MSG_362 +#, fuzzy +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Automatiškai atsakyti 'Ne' į Windows sąrankos klausimus, susijusius su duomenų bendrinimu su Microsoft, užuot raginus vartotoją tai padaryti." + +#. • MSG_363 +#, fuzzy +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Šią parinktį turėtumėte palikti įjungtą, nebent sutinkate, kad 'Windows To Go' pasiektų vidinius diskus ir tyliai atliktų nepakeičiama failų sistemos atnaujinimą." + +#. • MSG_364 +#, fuzzy +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Automatiškai sukurti vietinę paskyrą su nurodytu vartotojo vardu, naudojant tuščią slaptažodį, kurį reikės pakeisti kito prisijungimo metu." + +#. • MSG_365 +#, fuzzy +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Nukopijuokite regioninius nustatymus iš šio kompiuterio (klaviatūrą, laiko juostą, valiutą), užuot raginę vartotoją juos pakeisti." + +#. • MSG_366 +#, fuzzy +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Nešifruokite sistemos disko, nebent to aiškiai paprašytų vartotojas." + +#. • MSG_367 +#, fuzzy +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Šią parinktį naudokite tik tuo atveju, jei žinote, kas yra S-režimas, ir suprantate, kad jūsų sistema gali būti užrakinta S-režime net ir visiškai ištrynus ir iš naujo įdiegus 'Windows'." + +#. • MSG_368 +#, fuzzy +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Naudokite šią parinktį, jei sistema, kurioje planuojate įdiegti Windows, naudoja visiškai atnaujintus „Saugaus Įkrovimo“ sertifikatus. Jei reikia, galite apsvarstyti galimybę atnaujinti sistemą naudodami 'Mosby'." + +#. • MSG_369 +#, fuzzy +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Naudokite šią parinktį, jei norite atšaukti papildomus potencialiai nesaugius Windows įkrovos tvarkykles, tačiau taip pat galite neleisti paleisti standartinės Windows laikmenos." + +#. • MSG_370 +#, fuzzy +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "\"Quality of Life\" patobulinimai: Išjunkite daugumą nepageidaujamų funkcijų, kurias Microsoft bando primesti galutiniams vartotojams." + +#. • MSG_371 +#, fuzzy +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Jei naudojate šią parinktį, būtinai atjunkite visus diskus nuo tikslinio kompiuterio, išskyrus tą, kuriame norite įdiegti Windows, ir nepalikite laikmenos prijungtos prie kompiuterio, kurio nenorite ištrinti." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index d133686e..aa36ca8c 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -23,7 +23,7 @@ # • v4.14 "ja-JP" "Japanese (日本語)" # • v4.14 "ko-KR" "Korean (한국어)" # • v4.14 "lv-LV" "Latvian (Latviešu)" -# • v3.22 "lt-LT" "Lithuanian (Lietuvių)" +# • v4.14 "lt-LT" "Lithuanian (Lietuvių)" # • v3.22 "ms-MY" "Malay (Bahasa Malaysia)" # • v4.14 "nb-NO" "Norwegian (Norsk)" # • v4.14 "fa-IR" "Persian (پارسی)" @@ -9029,7 +9029,7 @@ t MSG_922 "Lejupielādē UEFI OS ISO failus" ######################################################################### l "lt-LT" "Lithuanian (Lietuvių)" 0x0427 -v 3.22 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -9250,7 +9250,6 @@ t MSG_164 "Būdas, kuris bus naudojamas padaryti diską įkraunamą" t MSG_165 "Spauskite, jei norite pasirinkti ar atsisiųsti atvaizdą..." t MSG_166 "Pažymėkite šį langelį, norėdami įgalinti tarptautinių žymių rodymą ir įrenginio piktogramos nustatymą (sukuria autorun.inf)" t MSG_167 "Įdiegia MBR, kuris įgalina įkrovos pasirinkimą ir gali maskuoti BIOS USB disko ID" -t MSG_168 "Bandyti maskuoti pirmą įkraunamą USB diską (paprastai 0x80) kaip kitą diską.\nTo turėtų prireikti tik jei diegsite Windows XP ir bus daugiau nei vienas diskas." t MSG_169 "Sukurti papildomą slaptą skaidinį ir bandyti sulygiuoti skaidinių ribas.\nTai gali pagerinti įkrovos aptikimą su senais BIOSais." t MSG_170 "Įgalinti išorinių USB kietųjų diskų pateiktį. NAUDOTI SAVO RIZIKA!!!" t MSG_171 "Pradėti formatavimą.\nTai SUNAIKINS visus duomenis paskirtyje!" @@ -9404,6 +9403,8 @@ t MSG_319 "Nepasyti įkrovos žymės" t MSG_320 "Atnaujinamas skaidinių išdėstymas (%s)..." t MSG_321 "Jūsų pasirinktas atvaizdas yra \"ISOHybrid\" atvaizdas, tačiau jo kūrėjai nepadarė jo suderinamu su ISO/failų kopijavimo režimu.\nDėl to bus įgalintas DD atvaizdo įrašymo režimas." t MSG_322 "Nepavyksta atidaryti arba perskaityti \"%s\"" +t MSG_323 "Diegimo metu pritaikykite SkuSiPolicy.p7b (žr. KB5042562)" +t MSG_324 "QoL patobulinimai (Neverskite Copilot, OneDrive, Outlook, Greitas Paleidimas, etc.)" t MSG_325 "Windows tinkinimo taikymas: %s" t MSG_326 "Vartotojo parinkčių taikymas..." t MSG_327 "Windows vartotojo patirtis" @@ -9416,6 +9417,40 @@ t MSG_333 "Sukurkite vietinę paskyrą naudodami vartotojo vardą:" t MSG_334 "Regiono parinkčių nustatymas į tas pačias reikšmes kaip ir šio vartotojo" t MSG_335 "BitLocker automatinio įrenginių šifravimo išjungimas" t MSG_336 "Nuolatinis žurnalas" +t MSG_337 "Papildomas failas ('%s') turi būti atsisiųstas iš Microsoft, kad naudotis šią funkcija:\n- Pasirinkite 'Taip' kad prisijungtumėte prie Interneto ir atsisiųstumėte jį\n- Pasirinkite 'Ne' kad atšaukti operacija\n\nPastaba: Failas bus atsisiųstas į programos katalogą ir, jei ten jau yra, bus automatiškai panaudotas." +t MSG_338 "Aptikta panaikinta UEFI įkrovos tvarkyklė" +t MSG_339 "Rufus aptiko, kad šis pasirinktas ISO tūri UEFI įkrovos programa kuris buvo panaikintas ir kuris kurs %s, kai visiškai atnaujintoje EUFI sistemoje yra įjungtas saugus įkrovimas.\n\n- Jei ši ISO atvaizdą gavote iš nepatikimo šaltinio, turėtumėte apsvarstyti galimybę, kad jame gali būti UEFI kenkėjiška programa, ir vengti paleisti sistemą iš jos.\n- Jei gavote iš patikimo šaltinio, turėtumėte pabandyti rasti naujesnę versiją, kuri nesukels šio įspėjimo." +t MSG_340 "ekranas \"Saugumo pažeidimas\"" +t MSG_341 "Windows atkūrimo ekranas (BSOD) su pranešimu '%s'" +t MSG_342 "Suspaustas VHDX Atvaizdas" +t MSG_343 "Nesuspaustas VHD Atvaizdas" +t MSG_344 "Pilnas Flash Atnaujinimo Atvaizdas" +t MSG_345 "Reikia atsisiųsti papildomų duomenų iš Microsoft, kad naudotis šią funkciją:\n- Pasirinkite 'Taip' kad prisijungtumėte prie Interneto ir atsisiųstumėte jį\n- Pasirinkite 'Ne' kad atšaukti operacija" +t MSG_346 "Apriboti Windows iki S-režimo (NESUDERINAMA su internetinės paskyros apėjimu)" +t MSG_347 "Eksperto režimas" +t MSG_348 "Išskleiskite failus iš čia: %s" +t MSG_349 "Naudokit Rufus MBR" +t MSG_350 "Naudokite 'Windows CA 2023' pasirašytus įkrovos tvarkyklės (Reikalingas suderinamas tikslinis kompiuteris)" +t MSG_351 "Tikrinama, ar nėra UEFI įkrovos tvarkyklės atšaukimo..." +t MSG_352 "Ieškoma UEFI DBX atnaujinimų..." +t MSG_353 "DBX atnaujinimas pasiekimas" +t MSG_354 "Rufus rado atnaujintą DBX failų versija, naudojamų UEFI saugaus įkrovimo atšaukimo patikrinimams atlikti. Ar norite atsisiųsti šį atnaujinimą?\n- Pasirinkite 'Taip' kad prisijungtumėte prie Interneto ir atsisiųstumėte jį\n- Pasirinkite 'Ne' kad atšaukti operacija\n\nPastaba: Failas bus atsisiųstas į programos katalogą ir, jei ten jau yra, bus automatiškai panaudotas." +t MSG_355 "⚠TYLIAI⚠ ištrinti diską ir įdiegti:" +t MSG_356 "Jūs pasirinkote naudotis \"tylioji\" Windows diegimo parinkti.\n\nTai išplėstinė parinktis, skirta žmonėms, norintiems sukurti laikmeną, kuri neragina vartotojo diegiant „Windows“ ir todėl BE SĄLYGŲ IŠTRINA pirmąjį aptiktą diską tikslinėje sistemoje. Jei nebūsite atsargūs, naudodami šią parinktį galite NEATGRĄŽINAMAI PRARASTI DUOMENIS!\n\nJei to nenorite, pasirinkite 'Ne', kad grįžtumėte ir panaikintumėte parinkties žymėjimą.\nPriešingu atveju, jei pasirinksite 'Taip', sutinkate, kad visa atsakomybė už bet kokį duomenų praradimą teks JUMS." +t MSG_358 "Nepalaikoma atvaizdo vieta" +t MSG_359 "Negalite naudoti atvaizdo, esančio paskirties diske, nes tas diskas bus visiškai ištrintas. Tai tas pats, kas bandyti pjauti šaką, ant kurios sėdite!\n\nPerkelkite atvaizdą į kitą vietą ir bandykite dar kartą." +t MSG_360 "Šią parinktį galima palikti įjungtą, net jei turite TPM ar daugiau RAM, nes ši parinktis tik apeina sąrankos reikalavimus ir iš tikrųjų netrukdo „Windows“ naudoti visos turimos aparatinės įrangos." +t MSG_361 "Kad ši parinktis veiktų, diegimo metu BŪTINA atjungti tinklą/Internetą!" +t MSG_362 "Automatiškai atsakyti 'Ne' į Windows sąrankos klausimus, susijusius su duomenų bendrinimu su Microsoft, užuot raginus vartotoją tai padaryti." +t MSG_363 "Šią parinktį turėtumėte palikti įjungtą, nebent sutinkate, kad 'Windows To Go' pasiektų vidinius diskus ir tyliai atliktų nepakeičiama failų sistemos atnaujinimą." +t MSG_364 "Automatiškai sukurti vietinę paskyrą su nurodytu vartotojo vardu, naudojant tuščią slaptažodį, kurį reikės pakeisti kito prisijungimo metu." +t MSG_365 "Nukopijuokite regioninius nustatymus iš šio kompiuterio (klaviatūrą, laiko juostą, valiutą), užuot raginę vartotoją juos pakeisti." +t MSG_366 "Nešifruokite sistemos disko, nebent to aiškiai paprašytų vartotojas." +t MSG_367 "Šią parinktį naudokite tik tuo atveju, jei žinote, kas yra S-režimas, ir suprantate, kad jūsų sistema gali būti užrakinta S-režime net ir visiškai ištrynus ir iš naujo įdiegus 'Windows'." +t MSG_368 "Naudokite šią parinktį, jei sistema, kurioje planuojate įdiegti Windows, naudoja visiškai atnaujintus „Saugaus Įkrovimo“ sertifikatus. Jei reikia, galite apsvarstyti galimybę atnaujinti sistemą naudodami 'Mosby'." +t MSG_369 "Naudokite šią parinktį, jei norite atšaukti papildomus potencialiai nesaugius Windows įkrovos tvarkykles, tačiau taip pat galite neleisti paleisti standartinės Windows laikmenos." +t MSG_370 "\"Quality of Life\" patobulinimai: Išjunkite daugumą nepageidaujamų funkcijų, kurias Microsoft bando primesti galutiniams vartotojams." +t MSG_371 "Jei naudojate šią parinktį, būtinai atjunkite visus diskus nuo tikslinio kompiuterio, išskyrus tą, kuriame norite įdiegti Windows, ir nepalikite laikmenos prijungtos prie kompiuterio, kurio nenorite ištrinti." t MSG_900 "Rufus programa leidžia suženklinti ir sukurti sistemų paleidimo laikmenas, kaip pvz. USB atmintukus, atminties korteles ir pan." t MSG_901 "Oficiali svetainė: %s" t MSG_902 "Šaltinio kodas: %s" diff --git a/src/rufus.rc b/src/rufus.rc index f8cc8e4e..d9c9de10 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.14.2366" +CAPTION "Rufus 4.14.2367" 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,14,2366,0 - PRODUCTVERSION 4,14,2366,0 + FILEVERSION 4,14,2367,0 + PRODUCTVERSION 4,14,2367,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.14.2366" + VALUE "FileVersion", "4.14.2367" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2366" + VALUE "ProductVersion", "4.14.2367" END END BLOCK "VarFileInfo" From d10fabe0f166d57d32a551b707d650c48edd904b Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Sat, 18 Apr 2026 16:18:42 +0100 Subject: [PATCH 177/192] [misc] update the Bitdefender VHD detection * Looks like Bitdefender may have changed the label of their hidden VHD, so use a less subtle approach and filter any VHD under 32 MB that stars with "Bitdefender". * Closes #2953. --- src/dev.c | 3 +-- src/rufus.rc | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/dev.c b/src/dev.c index c8bee183..49a64570 100644 --- a/src/dev.c +++ b/src/dev.c @@ -473,7 +473,6 @@ BOOL GetDevices(DWORD devnum) }; const char* usb_speed_name[USB_SPEED_MAX] = { "USB", "USB 1.0", "USB 1.1", "USB 2.0", "USB 3.0", "USB 3.1" }; const char* windows_sandbox_vhd_label = "PortableBaseLayer"; - const char* bitdefender_label = "Bitdefender Partition"; // Hash table and String Array used to match a Device ID with the parent hub's Device Interface Path htab_table htab_devid = HTAB_EMPTY; StrArray dev_if_path = { 0 }; @@ -968,7 +967,7 @@ BOOL GetDevices(DWORD devnum) break; } // Bitdefender now uses a special 32 MB VHD - if (props.is_VHD && safe_strcmp(label, bitdefender_label) == 0 && GetDriveSize(drive_index) <= 32 * MB) { + if (props.is_VHD && safe_strnicmp(label, "Bitdefender", 11) == 0 && GetDriveSize(drive_index) <= 32 * MB) { uprintf("Device eliminated because it is a Bitdefender VHD"); safe_free(devint_detail_data); break; diff --git a/src/rufus.rc b/src/rufus.rc index d9c9de10..7eb6e307 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.14.2367" +CAPTION "Rufus 4.14.2368" 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,14,2367,0 - PRODUCTVERSION 4,14,2367,0 + FILEVERSION 4,14,2368,0 + PRODUCTVERSION 4,14,2368,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.14.2367" + VALUE "FileVersion", "4.14.2368" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2367" + VALUE "ProductVersion", "4.14.2368" END END BLOCK "VarFileInfo" From 3a58ed2d341938f5a75cd9857f491102b9418059 Mon Sep 17 00:00:00 2001 From: Guesty <f10945yt@hotmail.com> Date: Sat, 18 Apr 2026 22:35:36 +0100 Subject: [PATCH 178/192] [loc] update Italian translation to latest --- res/loc/po/it-IT.po | 185 ++++++++++++++++++++++++++++++++++++-------- res/loc/rufus.loc | 40 ++++++++-- src/rufus.rc | 10 +-- 3 files changed, 191 insertions(+), 44 deletions(-) diff --git a/res/loc/po/it-IT.po b/res/loc/po/it-IT.po index 911eb83a..9bfc8fd9 100644 --- a/res/loc/po/it-IT.po +++ b/res/loc/po/it-IT.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-05-12 12:06+0100\n" -"PO-Revision-Date: 2024-05-12 12:12+0100\n" +"POT-Creation-Date: 2026-04-18 11:43-0700\n" +"PO-Revision-Date: 2026-04-18 13:50-0700\n" "Last-Translator: \n" "Language-Team: \n" "Language: it_IT\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Italian (Italiano)\n" "X-Rufus-LCID: 0x0410, 0x0810\n" -"X-Generator: Poedit 3.4.4\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -66,7 +66,7 @@ msgstr "Opzioni formattazione" #. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT msgid "File system" -msgstr "" +msgstr "Sistema di file" #. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT msgid "Cluster size" @@ -115,7 +115,7 @@ msgstr "Licenza" #. • IDD_ABOUTBOX → IDOK msgid "OK" -msgstr "" +msgstr "OK" #. • IDD_LICENSE → IDD_LICENSE msgid "Rufus License" @@ -133,7 +133,7 @@ msgstr "Sì" #. • IDD_NOTIFICATION → IDNO #. • MSG_009 msgid "No" -msgstr "" +msgstr "No" #. • IDD_LOG → IDD_LOG msgid "Log" @@ -187,7 +187,7 @@ msgstr "Informazioni versione" #. • IDD_NEW_VERSION → IDC_DOWNLOAD #. • MSG_040 msgid "Download" -msgstr "" +msgstr "Scarica" #. • MSG_001 msgid "Other instance detected" @@ -286,31 +286,31 @@ msgstr "byte" #. #. *Short* version of the kilobyte size suffix msgid "KB" -msgstr "" +msgstr "KB" #. • MSG_022 #. #. *Short* version of the megabyte size suffix msgid "MB" -msgstr "" +msgstr "MB" #. • MSG_023 #. #. *Short* version of the gigabyte size suffix msgid "GB" -msgstr "" +msgstr "GB" #. • MSG_024 #. #. *Short* version of the terabyte size suffix msgid "TB" -msgstr "" +msgstr "TB" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" -msgstr "" +msgstr "PB" #. • MSG_027 msgid "kilobytes" @@ -336,7 +336,7 @@ msgstr "BIOS (o UEFI CSM)" #. • MSG_032 msgid "UEFI (non CSM)" -msgstr "" +msgstr "UEFI (senza CSM)" #. • MSG_033 msgid "BIOS or UEFI" @@ -769,8 +769,7 @@ msgstr "" "Poiché le nuove versioni di Syslinux non sono compatibili con le precedenti e non sarebbe possibile per Rufus includerle tutte, devono essere scaricati da internet due file aggiuntivi ('ldlinux.sys' e 'ldlinux.bss'):\n" "- Seleziona 'Sì' per collegarti a internet e scaricare questi due file\n" "- Seleziona 'No' per annullare l'operazione\n" -"\n" -"Nota: questi file verranno scaricati nella cartella corrente dell'applicazione e se presenti verranno riusati automaticamente." +"Nota: i file verranno scaricati nella cartella attuale dell'applicazione e verranno riusati automaticamente se presenti." #. • MSG_115 msgid "Download required" @@ -790,14 +789,14 @@ msgid "" "\n" "Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used." msgstr "" -"Questa immagine usa Grub %s ma l'applicazione include solo i file di installazione per Grub %s.\n" +"Questa immagine utilizza Grub %s, ma l'applicazione include solo i file di installazione per Grub %s.\n" "\n" -"Questa differente versione di Grub potrebbe non essere compatibile con l'altra, e non è possibile includere i file di installazione. Rufus tenterà di trovare una versione dei file di installazione di Grub ('core.img') che corrisponda a quella dell'immagine.\n" -"- Seleziona 'Sì' per collegarti a internet e tentare il download\n" -"- Seleziona 'No' per usare la versione predefinita di Rufus\n" -"- Seleziona 'Annulla' per interrompere l'operazione.\n" +"Poiché le diverse versioni di Grub potrebbero non essere compatibili tra loro e non è possibile includerle tutte, Rufus tenterà di individuare una versione del file di installazione di Grub (\"core.img\") che corrisponda a quella presente nella tua immagine:\n" +"- Seleziona “Sì” per connetterti a Internet e tentare di scaricarlo\n" +"- Seleziona “No” per utilizzare la versione predefinita di Rufus\n" +"- Seleziona “Annulla” per interrompere l'operazione\n" "\n" -"Note: i file verranno scaricati nella cartella attuale dell'applicazione e verranno riusati automaticamente se presenti. Se non sarà trovata online nessuna corrispondenza, verrà usata la versione predefinita." +"Nota: il file verrà scaricato nella directory corrente dell'applicazione e verrà riutilizzato automaticamente se presente. Se online non viene trovata alcuna corrispondenza, verrà utilizzata la versione predefinita." #. • MSG_117 msgid "Standard Windows installation" @@ -809,7 +808,7 @@ msgstr "Installazione Windows standard" #. http://en.wikipedia.org/wiki/Windows_To_Go in your language. #. Otherwise, you may add a parenthesis eg. "Windows To Go (<hint at what it does>)" msgid "Windows To Go" -msgstr "" +msgstr "Windows To Go" #. • MSG_119 msgid "advanced drive properties" @@ -846,7 +845,7 @@ msgstr "No persistenza" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "" "Imposta la dimensione della partizione persistente per il media USB live.\n" @@ -893,17 +892,17 @@ msgstr "" #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Rufus ha rilevato che stai tentando di creare un media 'Windows To Go' basato su una ISO 1809.\n" +"Rufus ha rilevato che stai tentando di creare un supporto “Windows To Go” basato su un'immagine ISO della versione Windows 10 1809.\n" "\n" -"A causa di un *BUG MICROSOFT*, questo supporto si arresta in modo anomalo durante l'avvio di Windows (Blue Screen Of Death), a meno che non si sostituisca manualmente il file 'WppRecorder.sys' con una versione 1803.\n" +"A causa di un *BUG DI MICROSOFT*, questo supporto andrà in crash durante l'avvio di Windows (BSOD), a meno che non sostituisca manualmente il file “WppRecorder.sys” con una versione 1803.\n" "\n" -"Nota inoltre che il motivo per cui Rufus non può risolvere automaticamente questo problema è che 'WppRecorder.sys' è un file protetto da copyright di Microsoft, quindi non è possibile incorporare legalmente una copia del file nell'applicazione..." +"Tieni inoltre presente che il motivo per cui Rufus non può risolvere automaticamente questo problema è che “WppRecorder.sys” è un file protetto da copyright di Microsoft, quindi non possiamo legalmente incorporarne una copia nell'applicazione..." #. • MSG_134 msgid "" @@ -921,7 +920,7 @@ msgstr "Versione" #. • MSG_136 msgid "Release" -msgstr "" +msgstr "Pubblicazione" #. • MSG_137 msgid "Edition" @@ -1800,6 +1799,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Impossibile aprire o leggere '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Applicare SkuSiPolicy.p7b all'inizio dell'installazione (vedere KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Miglioramenti della QoL (Non forzare Copilot, OneDrive, Outlook, avvio rapido, ecc.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Applicando personalizzazione Windows: %s" @@ -1850,17 +1857,17 @@ msgstr "Log persistente" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Per installare MS-DOS è necessario scaricare da Microsoft un file aggiuntivo (\"diskcopy.dll\"):\n" +"Per utilizzare questa funzionalità, è necessario scaricare un file aggiuntivo ('%s') da Microsoft:\n" "- Seleziona 'Sì' per connettersi ad internet e scaricarlo\n" "- Seleziona 'No' per annullare l'operazione\n" "\n" -"Nota: il file verrà scaricato nella cartella dell'applicazione e se presente verrà riutilizzato automaticamente." +"Nota: il file verrà scaricato nella directory dell'applicazione e, se presente, verrà riutilizzato automaticamente." #. • MSG_338 msgid "Revoked UEFI bootloader detected" @@ -1924,6 +1931,118 @@ msgstr "Estrazione file archivio: %s" msgid "Use Rufus MBR" msgstr "Usa MBR Rufus" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Utilizza bootloader firmati 'Windows CA 2023' (Richiede PC compatibile)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Verifica della revoca del bootloader UEFI..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Verifica degli aggiornamenti UEFI DBX..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "Aggiornamento DBX disponibile" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus ha trovato una verzione aggiornamentato dei fili DBX usati per eseguire la verifica di revoca per UEFI Secure Boot. Vuoi scaricare questo aggiornamento?\n" +"- Seleziona \"Sì\" per connettere all'Internet e scaricare questo contenuto\n" +"- Seleziona \"No\" per cancellare l'operazione\n" +"\n" +"Nota: " + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "Cancella disco e installa ⚠SILENZIOSA⚠:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes', you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Hai scelto di utilizzare l'opzione di installazione “silenziosa” di Windows.\n" +"\n" +"Si tratta di un'opzione avanzata, riservata a chi desidera creare un supporto che non richieda l'intervento dell'utente durante l'installazione di Windows e che, di conseguenza, CANCELLI INCONDIZIONATAMENTE il primo disco rilevato sul sistema di destinazione. Se non presti la dovuta attenzione, l'utilizzo di questa opzione può causare una PERDITA IRREVERSIBILE DI DATI!\n" +"\n" +"Se non è questo ciò che desideri, seleziona “No” per tornare indietro e deselezionare l'opzione.\n" +"Altrimenti, selezionando “Sì”, accetti che l'intera responsabilità per qualsiasi perdita di dati ricada interamente su di TE." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Percorso immagine non sopportato." + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Non puoi usare un'immagine che si trova nell'unità di destinazione, poiché tale unità verrà completamente formattata. È come cercare di segare il ramo su cui sei seduto!\n" +"\n" +"Sposta l'immagine in una posizione diversa e riprova." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "È consigliabile lasciare questa opzione attivata anche se si dispone di un TPM o di più RAM, poiché essa si limita a ignorare i requisiti di configurazione e non impedisce effettivamente a Windows di utilizzare tutto l'hardware disponibile." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Affinché questa opzione funzioni, è NECESSARIO disconnettere la rete/Internet durante l'installazione!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Rispondere automaticamente “no” alle domande della procedura di installazione di Windows relative alla condivisione dei dati con Microsoft, invece di chiedere conferma all'utente." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Ti consigliamo di lasciare questa opzione abilitata, a meno che tu non abbia nulla in contrario al fatto che \"Windows To Go\" acceda ai dischi interni ed esegua in modo silenzioso aggiornamenti irreversibili del file system." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Crea automaticamente un account locale con il nome utente specificato, utilizzando una password vuota che dovrà essere modificata al prossimo accesso." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Duplica le impostazioni regionali di questo PC (tastiera, fuso orario, valuta), invece di chiedere conferma all'utente." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Don't encrypt the system disk, unless explicitly requested by the user." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Utilizza questa opzione solo se sai cos'è la modalità S e sei consapevole del fatto che il tuo sistema potrebbe rimanere bloccato in modalità S anche dopo aver cancellato completamente e reinstallato Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Utilizza questa opzione se il sistema su cui intendi installare Windows utilizza certificati Secure Boot completamente aggiornati. Se necessario, puoi valutare l'utilizzo di \"Mosby\" per aggiornare il tuo sistema." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Utilizza questa opzione se desideri revocare ulteriori bootloader di Windows potenzialmente non sicuri, tenendo presente che ciò potrebbe impedire l'avvio anche dei supporti standard di Windows." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Miglioramenti alla “QoL”: disattiva la maggior parte delle funzionalità indesiderate che Microsoft sta cercando di imporre agli utenti finali." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Se si utilizza questa opzione, assicurarsi di scollegare tutti i dischi dal PC di destinazione, tranne quello su cui si desidera installare Windows, e di non lasciare il supporto collegato a nessun PC che non si desidera cancellare." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index aa36ca8c..a8ac067c 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -19,7 +19,7 @@ # • v4.14 "he-IL" "Hebrew (עברית)" # • v4.14 "hu-HU" "Hungarian (Magyar)" # • v4.14 "id-ID" "Indonesian (Bahasa Indonesia)" -# • v4.5 "it-IT" "Italian (Italiano)" +# • v4.14 "it-IT" "Italian (Italiano)" # • v4.14 "ja-JP" "Japanese (日本語)" # • v4.14 "ko-KR" "Korean (한국어)" # • v4.14 "lv-LV" "Latvian (Latviešu)" @@ -7282,7 +7282,7 @@ t MSG_922 "Unduh Shell ISO UEFI" ######################################################################### l "it-IT" "Italian (Italiano)" 0x0410, 0x0810 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -7301,6 +7301,7 @@ t IDC_LIST_USB_HDD "Elenco unità disco USB" t IDC_OLD_BIOS_FIXES "Aggiungi correzioni per vecchi BIOS (partizioni extra, allineamento, etc)" t IDC_UEFI_MEDIA_VALIDATION "Abilita convalida multimediale UEFI in runtime" t IDS_FORMAT_OPTIONS_TXT "Opzioni formattazione" +t IDS_FILE_SYSTEM_TXT "Sistema di file" t IDS_CLUSTER_SIZE_TXT "Dimensione cluster" t IDS_LABEL_TXT "Etichetta volume" t IDC_QUICK_FORMAT "Formattazione rapida" @@ -7326,6 +7327,8 @@ t IDD_NEW_VERSION "Rufus - Controllo aggiornamenti" t IDS_NEW_VERSION_AVAIL_TXT "È disponibile una nuova versione. Scarica la versione aggiornata!" t IDC_WEBSITE "Fai clic qui per visitare il sito web" t IDS_NEW_VERSION_NOTES_GRP "Informazioni versione" +t IDS_NEW_VERSION_DOWNLOAD_GRP "Scarica" +t IDC_DOWNLOAD "Scarica" g IDD_NOTIFICATION t IDC_MORE_INFO "Altre informazioni" @@ -7364,6 +7367,7 @@ t MSG_028 "megabyte" t MSG_029 "Predefinito" t MSG_030 "%s (predefinito)" t MSG_031 "BIOS (o UEFI CSM)" +t MSG_032 "UEFI (senza CSM)" t MSG_033 "BIOS o UEFI" t MSG_034 "%d passaggio" t MSG_035 "%d passaggi %s" @@ -7371,6 +7375,7 @@ t MSG_036 "Immagine ISO" t MSG_037 "Applicazione" t MSG_038 "Annulla" t MSG_039 "Esegui" +t MSG_040 "Scarica" t MSG_041 "Operazione annullata dall'utente" t MSG_042 "Errore" t MSG_043 "Errore: %s" @@ -7444,9 +7449,9 @@ t MSG_110 "Non si può avviare MS-DOS da una unità che usa una dimensione del c t MSG_111 "Dimensione cluster incompatibile" t MSG_112 "La formattazione di un volume UDF di grandi dimensioni può richiedere molto tempo. In modo USB 2.0, il tempo stimato per la formattazione sarà di %d:%02d, durante il quale la barra di progresso non verrà aggiornata. Attendi il completamento dell'operazione!" t MSG_113 "Volume UDF di grandi dimensioni" -t MSG_114 "Questa immagine usa Syslinux %s%s ma questa applicazione include solo i file di installazione per Syslinux %s%s.\n\nPoiché le nuove versioni di Syslinux non sono compatibili con le precedenti e non sarebbe possibile per Rufus includerle tutte, devono essere scaricati da internet due file aggiuntivi ('ldlinux.sys' e 'ldlinux.bss'):\n- Seleziona 'Sì' per collegarti a internet e scaricare questi due file\n- Seleziona 'No' per annullare l'operazione\n\nNota: questi file verranno scaricati nella cartella corrente dell'applicazione e se presenti verranno riusati automaticamente." +t MSG_114 "Questa immagine usa Syslinux %s%s ma questa applicazione include solo i file di installazione per Syslinux %s%s.\n\nPoiché le nuove versioni di Syslinux non sono compatibili con le precedenti e non sarebbe possibile per Rufus includerle tutte, devono essere scaricati da internet due file aggiuntivi ('ldlinux.sys' e 'ldlinux.bss'):\n- Seleziona 'Sì' per collegarti a internet e scaricare questi due file\n- Seleziona 'No' per annullare l'operazione\nNota: i file verranno scaricati nella cartella attuale dell'applicazione e verranno riusati automaticamente se presenti." t MSG_115 "Richiede download" -t MSG_116 "Questa immagine usa Grub %s ma l'applicazione include solo i file di installazione per Grub %s.\n\nQuesta differente versione di Grub potrebbe non essere compatibile con l'altra, e non è possibile includere i file di installazione. Rufus tenterà di trovare una versione dei file di installazione di Grub ('core.img') che corrisponda a quella dell'immagine.\n- Seleziona 'Sì' per collegarti a internet e tentare il download\n- Seleziona 'No' per usare la versione predefinita di Rufus\n- Seleziona 'Annulla' per interrompere l'operazione.\n\nNote: i file verranno scaricati nella cartella attuale dell'applicazione e verranno riusati automaticamente se presenti. Se non sarà trovata online nessuna corrispondenza, verrà usata la versione predefinita." +t MSG_116 "Questa immagine utilizza Grub %s, ma l'applicazione include solo i file di installazione per Grub %s.\n\nPoiché le diverse versioni di Grub potrebbero non essere compatibili tra loro e non è possibile includerle tutte, Rufus tenterà di individuare una versione del file di installazione di Grub (\"core.img\") che corrisponda a quella presente nella tua immagine:\n- Seleziona “Sì” per connetterti a Internet e tentare di scaricarlo\n- Seleziona “No” per utilizzare la versione predefinita di Rufus\n- Seleziona “Annulla” per interrompere l'operazione\n\nNota: il file verrà scaricato nella directory corrente dell'applicazione e verrà riutilizzato automaticamente se presente. Se online non viene trovata alcuna corrispondenza, verrà utilizzata la versione predefinita." t MSG_117 "Installazione Windows standard" t MSG_119 "opzioni avanzate unità" t MSG_120 "opzioni avanzate formattazione" @@ -7462,9 +7467,10 @@ t MSG_129 "Hai appena creato un media che utilizza il bootloader UEFI:NTFS.\nRic t MSG_130 "Selezione immagine Windows" t MSG_131 "Questa immagine ISO contiene più immagini di Windows.\nSeleziona l'immagine che vuoi usare per questa installazione:" t MSG_132 "Un altro programma o processo sta accedendo a questa unità.\nVuoi formattare comunque l'unità?" -t MSG_133 "Rufus ha rilevato che stai tentando di creare un media 'Windows To Go' basato su una ISO 1809.\n\nA causa di un *BUG MICROSOFT*, questo supporto si arresta in modo anomalo durante l'avvio di Windows (Blue Screen Of Death), a meno che non si sostituisca manualmente il file 'WppRecorder.sys' con una versione 1803.\n\nNota inoltre che il motivo per cui Rufus non può risolvere automaticamente questo problema è che 'WppRecorder.sys' è un file protetto da copyright di Microsoft, quindi non è possibile incorporare legalmente una copia del file nell'applicazione..." +t MSG_133 "Rufus ha rilevato che stai tentando di creare un supporto “Windows To Go” basato su un'immagine ISO della versione Windows 10 1809.\n\nA causa di un *BUG DI MICROSOFT*, questo supporto andrà in crash durante l'avvio di Windows (BSOD), a meno che non sostituisca manualmente il file “WppRecorder.sys” con una versione 1803.\n\nTieni inoltre presente che il motivo per cui Rufus non può risolvere automaticamente questo problema è che “WppRecorder.sys” è un file protetto da copyright di Microsoft, quindi non possiamo legalmente incorporarne una copia nell'applicazione..." t MSG_134 "Poiché è stato selezionato 'MBR' per lo schema partizione, Rufus può creare su questo supporto solo una partizione fino ad un massimo di 2 TB, che lascerà %s di spazio su disco non disponibile.\n\nSei sicuro di voler continuare?" t MSG_135 "Versione" +t MSG_136 "Pubblicazione" t MSG_137 "Edizione" t MSG_138 "Lingua" t MSG_139 "Architettura" @@ -7648,6 +7654,8 @@ t MSG_319 "Ignora marcatore boot" t MSG_320 "Aggiornamento layout partizione (%s)..." t MSG_321 "L'immagine selezionata è una ISO ibrida, ma i suoi creatori non l'hanno resa compatibile con la modalità di copia ISO/file.\nDi conseguenza, verrà applicata la modalità di scrittura delle immagini DD." t MSG_322 "Impossibile aprire o leggere '%s'" +t MSG_323 "Applicare SkuSiPolicy.p7b all'inizio dell'installazione (vedere KB5042562)" +t MSG_324 "Miglioramenti della QoL (Non forzare Copilot, OneDrive, Outlook, avvio rapido, ecc.)" t MSG_325 "Applicando personalizzazione Windows: %s" t MSG_326 "Applicando opzioni utente..." t MSG_327 "Esperienza utente Windows" @@ -7660,7 +7668,7 @@ t MSG_333 "Crea account locale con nome utente:" t MSG_334 "Imposta opzioni regionali agli stessi valori di questo utente" t MSG_335 "Disabilita la crittografia automatica dei dispositivi BitLocker" t MSG_336 "Log persistente" -t MSG_337 "Per utilizzare questa funzionalità è necessario scaricare un file aggiuntivo ('%s') da Microsoft:\n- Seleziona 'Sì' per connettersi ad internet e scaricarlo\n- Seleziona 'No' per annullare l'operazione\n\nNota: il file verrà scaricato nella cartella dell'applicazione e se presente verrà riutilizzato automaticamente." +t MSG_337 "Per utilizzare questa funzionalità, è necessario scaricare un file aggiuntivo ('%s') da Microsoft:\n- Seleziona 'Sì' per connettersi ad internet e scaricarlo\n- Seleziona 'No' per annullare l'operazione\n\nNota: il file verrà scaricato nella directory dell'applicazione e, se presente, verrà riutilizzato automaticamente." t MSG_338 "Rilevato bootloader UEFI revocato" t MSG_339 "Rufus ha rilevato che l'ISO selezionata contiene un bootloader UEFI che è stato revocato e che quando Secure Boot è abilitato su un sistema UEFI completamente aggiornato produrrà %s. \n\n- Se hai ottenuto questa immagine ISO da una sorgente non affidabile, dovresti considerare la possibilità che possa contenere malware UEFI ed evitare di eseguire l'avvio da esso.\n- Se l'hai ottenuto da una sorgente attendibile, dovresti provare a cercare una versione più aggiornata, che non genererà questo avviso." t MSG_340 "una schermata \"Violazione sicurezza\"" @@ -7673,6 +7681,26 @@ t MSG_346 "Limita Windows alla modalità S (INCOMPATIBILE con il bypass dell'acc t MSG_347 "Modalità esperto" t MSG_348 "Estrazione file archivio: %s" t MSG_349 "Usa MBR Rufus" +t MSG_350 "Utilizza bootloader firmati 'Windows CA 2023' (Richiede PC compatibile)" +t MSG_351 "Verifica della revoca del bootloader UEFI..." +t MSG_352 "Verifica degli aggiornamenti UEFI DBX..." +t MSG_353 "Aggiornamento DBX disponibile" +t MSG_354 "Rufus ha trovato una verzione aggiornamentato dei fili DBX usati per eseguire la verifica di revoca per UEFI Secure Boot. Vuoi scaricare questo aggiornamento?\n- Seleziona \"Sì\" per connettere all'Internet e scaricare questo contenuto\n- Seleziona \"No\" per cancellare l'operazione\n\nNota: " +t MSG_355 "Cancella disco e installa ⚠SILENZIOSA⚠:" +t MSG_356 "Hai scelto di utilizzare l'opzione di installazione “silenziosa” di Windows.\n\nSi tratta di un'opzione avanzata, riservata a chi desidera creare un supporto che non richieda l'intervento dell'utente durante l'installazione di Windows e che, di conseguenza, CANCELLI INCONDIZIONATAMENTE il primo disco rilevato sul sistema di destinazione. Se non presti la dovuta attenzione, l'utilizzo di questa opzione può causare una PERDITA IRREVERSIBILE DI DATI!\n\nSe non è questo ciò che desideri, seleziona “No” per tornare indietro e deselezionare l'opzione.\nAltrimenti, selezionando “Sì”, accetti che l'intera responsabilità per qualsiasi perdita di dati ricada interamente su di TE." +t MSG_358 "Percorso immagine non sopportato." +t MSG_359 "Non puoi usare un'immagine che si trova nell'unità di destinazione, poiché tale unità verrà completamente formattata. È come cercare di segare il ramo su cui sei seduto!\n\nSposta l'immagine in una posizione diversa e riprova." +t MSG_360 "È consigliabile lasciare questa opzione attivata anche se si dispone di un TPM o di più RAM, poiché essa si limita a ignorare i requisiti di configurazione e non impedisce effettivamente a Windows di utilizzare tutto l'hardware disponibile." +t MSG_361 "Affinché questa opzione funzioni, è NECESSARIO disconnettere la rete/Internet durante l'installazione!" +t MSG_362 "Rispondere automaticamente “no” alle domande della procedura di installazione di Windows relative alla condivisione dei dati con Microsoft, invece di chiedere conferma all'utente." +t MSG_363 "Ti consigliamo di lasciare questa opzione abilitata, a meno che tu non abbia nulla in contrario al fatto che \"Windows To Go\" acceda ai dischi interni ed esegua in modo silenzioso aggiornamenti irreversibili del file system." +t MSG_364 "Crea automaticamente un account locale con il nome utente specificato, utilizzando una password vuota che dovrà essere modificata al prossimo accesso." +t MSG_365 "Duplica le impostazioni regionali di questo PC (tastiera, fuso orario, valuta), invece di chiedere conferma all'utente." +t MSG_367 "Utilizza questa opzione solo se sai cos'è la modalità S e sei consapevole del fatto che il tuo sistema potrebbe rimanere bloccato in modalità S anche dopo aver cancellato completamente e reinstallato Windows." +t MSG_368 "Utilizza questa opzione se il sistema su cui intendi installare Windows utilizza certificati Secure Boot completamente aggiornati. Se necessario, puoi valutare l'utilizzo di \"Mosby\" per aggiornare il tuo sistema." +t MSG_369 "Utilizza questa opzione se desideri revocare ulteriori bootloader di Windows potenzialmente non sicuri, tenendo presente che ciò potrebbe impedire l'avvio anche dei supporti standard di Windows." +t MSG_370 "Miglioramenti alla “QoL”: disattiva la maggior parte delle funzionalità indesiderate che Microsoft sta cercando di imporre agli utenti finali." +t MSG_371 "Se si utilizza questa opzione, assicurarsi di scollegare tutti i dischi dal PC di destinazione, tranne quello su cui si desidera installare Windows, e di non lasciare il supporto collegato a nessun PC che non si desidera cancellare." t MSG_900 "Rufus è un programma che ti aiuta a formattare e creare una unità flash USB avviabile, come una unità USB, memory stick, ecc." t MSG_901 "Sito ufficiale: %s" t MSG_902 "Codice sorgente: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 7eb6e307..862ba6b9 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.14.2368" +CAPTION "Rufus 4.14.2369" 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,14,2368,0 - PRODUCTVERSION 4,14,2368,0 + FILEVERSION 4,14,2369,0 + PRODUCTVERSION 4,14,2369,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.14.2368" + VALUE "FileVersion", "4.14.2369" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2368" + VALUE "ProductVersion", "4.14.2369" END END BLOCK "VarFileInfo" From 001258cf14e1adb8efd6d41ad0acc3ed9944b2d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kub=C3=A1nik?= <martin.kubanik@gmail.com> Date: Mon, 20 Apr 2026 00:54:22 +0100 Subject: [PATCH 179/192] [loc] update Slovak translation to latest --- res/loc/po/sk-SK.po | 152 +++++++++++++++++++++++++++++++++++++++----- res/loc/rufus.loc | 39 +++++++++--- src/rufus.rc | 10 +-- 3 files changed, 172 insertions(+), 29 deletions(-) diff --git a/res/loc/po/sk-SK.po b/res/loc/po/sk-SK.po index c9916203..01f6026e 100644 --- a/res/loc/po/sk-SK.po +++ b/res/loc/po/sk-SK.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-05-12 10:18+0200\n" -"PO-Revision-Date: 2024-05-12 10:38+0200\n" +"POT-Creation-Date: 2026-04-17 06:04+0200\n" +"PO-Revision-Date: 2026-04-19 10:24+0200\n" "Last-Translator: martinco78\n" "Language-Team: \n" "Language: sk_SK\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Slovak (Slovensky)\n" "X-Rufus-LCID: 0x041B\n" -"X-Generator: Poedit 3.4.4\n" +"X-Generator: Poedit 3.6\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -153,7 +153,7 @@ msgstr "Zásady a nastavenia aktualizácií" #. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP msgid "Settings" -msgstr "Nastavenia automatických aktualizácií" +msgstr "Nastavenia" #. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT msgid "Check for updates" @@ -310,7 +310,7 @@ msgstr "TB" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "PB" @@ -852,7 +852,7 @@ msgstr "Bez partície" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Nastavte veľkosť trvalej partície pre Live USB médium. Nastavením hodnoty na 0 zakážete trvalú partíciu." @@ -894,15 +894,15 @@ msgstr "Prístup k tejto jednotke má iný program alebo proces. Chcete ho napri #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Program Rufus zistil, že sa pokúšate vytvoriť Windows To Go médium založeného na 1809 ISO.\n" +"Program Rufus zistil, že sa pokúšate vytvoriť „Windows To Go\" médium založeného na 1809 ISO.\n" "\n" -"Kvôli *MICROSOFT BUG*, toto médium môže zlyhať počas zavádzania systému Windows (modrá obrazovka smrti), pokiaľ manuálne nenahradíte súbor „WppRecorder. sys\" verziou 1803.\n" +"Kvôli „MICROSOFT BUG*, toto médium môže zlyhať počas zavádzania systému Windows (modrá obrazovka smrti), pokiaľ manuálne nenahradíte súbor „WppRecorder. sys\" verziou 1803.\n" "\n" "Dôvodom, prečo program Rufus nemôže automaticky toto opraviť to, že súbor „WppRecorder.sys\" je chránený súbor spoločnosti Microsoft, takže nie je legálne vložiť kópiu súboru do aplikácie..." @@ -1093,7 +1093,7 @@ msgstr "Verzia %d.%d (Build %d)" #. • MSG_176 msgid "English translation: Pete Batard <mailto:pete@akeo.ie>" -msgstr "Do slovenčiny preložil martinco78 <mailto:martinco78@azet.sk>" +msgstr "Do slovenčiny preložil martinco78 <mailto:martin.kubanik@gmail.com>" #. • MSG_177 msgid "Report bugs or request enhancements at:" @@ -1796,13 +1796,21 @@ msgid "" "The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\n" "As a result, DD image writing mode will be enforced." msgstr "" -"Obráz, ktorý ste vybrali, je ISOHybrid a nie je kompatibilný s ISO/režim kopírovania súboru.\n" +"Obraz, ktorý ste vybrali, je ISOHybrid a nie je kompatibilný s ISO/režim kopírovania súboru.\n" "V dôsledku toho sa vynúti režim zápisu obrazu DD." #. • MSG_322 msgid "Unable to open or read '%s'" msgstr "Nedá sa otvoriť alebo prečítať „%s\"" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Použiť SkuSiPolicy.p7b pri inštalácii (pozri KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "QoL vylepšenia (nenúťte Copilot, OneDrive, Outlook, Fast Startup a podobne)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Použitie prispôsobenia systému Windows: %s" @@ -1821,11 +1829,11 @@ msgstr "Prajete si prispôsobiť inštaláciu systému Windows?" #. • MSG_329 msgid "Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0" -msgstr "Odstrániť požiadavku pre 4GB+ RAM, Secure Boot a TPM 2.0" +msgstr "Odstrániť požiadavky pre 4GB+ RAM, Secure Boot a TPM 2.0" #. • MSG_330 msgid "Remove requirement for an online Microsoft account" -msgstr "Odstrániť požiadavky na online konto Microsoft" +msgstr "Odstrániť požiadavku na online konto Microsoft" #. • MSG_331 msgid "Disable data collection (Skip privacy questions)" @@ -1853,13 +1861,13 @@ msgstr "Trvalý záznam činností" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Pre inštaláciu systému MS-DOS je potrebné prevziať od spoločnosti Microsoft ďalší súbor („diskcopy.dll\"):\n" +"Na použitie tejto funkcie je potrebné prevziať od spoločnosti Microsoft ďalší súbor („%s“):\n" "- Výberom možnosti „Áno\" ho stiahnete z internetu\n" "- Výberom možnosti „Nie\" zrušíte operáciu\n" "\n" @@ -1927,6 +1935,118 @@ msgstr "Extrahovanie archívnych súborov: %s" msgid "Use Rufus MBR" msgstr "Použiť Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Použiť podpísané bootloadery „Windows CA 2023\" (vyžaduje kompatibilný cieľový PC)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Prebieha kontrola zrušenia UEFI zavádzača..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Prebieha kontrola aktualizácie pre UEFI DBX..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "Dostupná aktualizácia DBX" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus našiel aktualizovanú verziu DBX súborov používaných na kontrolu odvolávania UEFI Secure Boot. Chcete si stiahnuť túto aktualizáciu?\n" +"- Vyberte „Áno\" ak chcete tieto súbory stiahnuť\n" +"- Vyberte „Nie\" pre zrušenie operácie\n" +"\n" +"Poznámka: Súbory budú stiahnuté do adresára aplikácie a budú automaticky znovu použité, ak budú prítomné." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠BEZ UPOZORNENIA⚠ vymažte disk a nainštaluje:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes', you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Vybrali ste možnosť „tichá\" inštalácia Windows.\n" +"\n" +"Ide o pokročilú možnosť, vyhradenú pre ľudí, ktorí chcú vytvárať médiá, ktoré počas inštalácie Windows neupozorňujú používateľa a teda BEZPODMIENEČNE VYMAŽÚ prvý zistený disk na cieľovom systéme. Ak nebudete opatrní, pri tejto možnosti môže dôjsť k NEVRATNEJ STRATE DÁT!\n" +"\n" +"Ak to nie je to, čo chcete, vyberte prosím „Nie\", aby ste sa vrátili späť a odškrtli túto možnosť.\n" +"Inak, ak zvolíte „Áno\", súhlasíte, že plná zodpovednosť za akúkoľvek stratu dát bude úplne na VÁS." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Nepodporované umiestnenie obrazu" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Nemôžete použiť obraz, ktorý sa nachádza na cieľovom disku, pretože tento disk bude úplne vymazaný. Je to to isté, ako keby ste sa snažili rezať konár, na ktorom sedíte!\n" +"\n" +"Prosím, presuňte tento obraz do iného umiestnenia a skúste to znova." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Je bezpečné nechať túto možnosť zapnutú aj v prípade, že máte TPM alebo viac RAM, pretože táto možnosť len obchádza požiadavky na nastavenie a v skutočnosti nebráni Windows v používaní všetkého dostupného hardvéru." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Aby táto možnosť fungovala, sieť/internet MUSIA byť počas inštalácie odpojené!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Automaticky odpovedá „NIE\" na otázky týkajúce sa Windows zdieľania dát s Microsoftom, namiesto toho, aby vyzývali používateľa." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Túto možnosť by ste mali nechať zapnutú, pokiaľ vám nevadí, že „Windows To Go\" pristupuje k interným diskom a potichu vykonáva nezvratné aktualizácie súborového systému." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Automaticky vytvorí lokálny účet s určeným používateľským menom s prázdnym heslom, ktoré bude potrebné zmeniť pri ďalšom prihlásení." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Duplikuje regionálne nastavenia z tohto PC (klávesnica, časové pásmo, mena) namiesto toho, aby výzýval používateľa." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Nešifrujte systémový disk, pokiaľ to používateľ výslovne nepožiada." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Použite túto možnosť len vtedy, ak viete, čo je S-Mode a chápete, že váš systém môže byť uzamknutý v S-Mode aj po úplnom vymazaní a preinštalovaní Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Použite túto možnosť, ak systém ktorý plánujete nainštalovať Windows, používa plne aktuálne certifikáty Secure Boot. Ak je to potrebné, môžete zvážiť použitie „Mosby\" na aktualizáciu systému." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Použite túto možnosť, ak chcete zrušiť ďalšie potenciálne nebezpečné bootloadery Windows, ale zároveň potenciálne zabrániť spusteniu štandardných Windows médií." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Vylepšenia „kvality života\": Vypne väčšinu nežiaducich funkcií, ktoré sa Microsoft snaží vnútiť koncovým používateľom." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Ak použijete túto možnosť, uistite sa, že máte odpojené všetky disky od cieľového PC, okrem toho na ktorý chcete nainštalovať systém Windows. Taktiež nenechávajte médium pripojené k žiadnemu PC, ktorý nechcete vymazať." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index a8ac067c..8517b472 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -33,7 +33,7 @@ # • v4.5 "ro-RO" "Romanian (Română)" # • v4.14 "ru-RU" "Russian (Русский)" # • v4.14 "sr-RS" "Serbian (Srpski)" -# • v4.5 "sk-SK" "Slovak (Slovensky)" +# • v4.14 "sk-SK" "Slovak (Slovensky)" # • v4.5 "sl-SI" "Slovenian (Slovenščina)" # • v4.14 "es-ES" "Spanish (Español)" # • v4.14 "sv-SE" "Swedish (Svenska)" @@ -13429,7 +13429,7 @@ t MSG_922 "Preuzmite UEFI Shell ISOs" ######################################################################### l "sk-SK" "Slovak (Slovensky)" 0x041B -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -13485,7 +13485,7 @@ t IDNO "Nie" g IDD_UPDATE_POLICY t IDCANCEL "Zatvoriť" t IDD_UPDATE_POLICY "Zásady a nastavenia aktualizácií" -t IDS_UPDATE_SETTINGS_GRP "Nastavenia automatických aktualizácií" +t IDS_UPDATE_SETTINGS_GRP "Nastavenia" t IDS_UPDATE_FREQUENCY_TXT "Skontrolovať aktualizácie" t IDS_INCLUDE_BETAS_TXT "Zahrnúť beta verzie" t IDC_CHECK_NOW "Skontrolovať" @@ -13615,7 +13615,7 @@ t MSG_129 "Práve ste vytvorili médium, ktoré používa UEFI: NTFS bootloader. t MSG_130 "Výber obrázkov systému Windows" t MSG_131 "Tento ISO obsahuje viac obrazov Windows.\nProsím, vyberte obrázok, ktorý chcete použiť pre túto inštaláciu:" t MSG_132 "Prístup k tejto jednotke má iný program alebo proces. Chcete ho napriek tomu naformátovať?" -t MSG_133 "Program Rufus zistil, že sa pokúšate vytvoriť Windows To Go médium založeného na 1809 ISO.\n\nKvôli *MICROSOFT BUG*, toto médium môže zlyhať počas zavádzania systému Windows (modrá obrazovka smrti), pokiaľ manuálne nenahradíte súbor „WppRecorder. sys\" verziou 1803.\n\nDôvodom, prečo program Rufus nemôže automaticky toto opraviť to, že súbor „WppRecorder.sys\" je chránený súbor spoločnosti Microsoft, takže nie je legálne vložiť kópiu súboru do aplikácie..." +t MSG_133 "Program Rufus zistil, že sa pokúšate vytvoriť „Windows To Go\" médium založeného na 1809 ISO.\n\nKvôli „MICROSOFT BUG*, toto médium môže zlyhať počas zavádzania systému Windows (modrá obrazovka smrti), pokiaľ manuálne nenahradíte súbor „WppRecorder. sys\" verziou 1803.\n\nDôvodom, prečo program Rufus nemôže automaticky toto opraviť to, že súbor „WppRecorder.sys\" je chránený súbor spoločnosti Microsoft, takže nie je legálne vložiť kópiu súboru do aplikácie..." t MSG_134 "Pretože bola vybraná MBR schéma disku, program Rufus môže na tomto médiu vytvoriť partíciu iba do veľkosti 2 TB a zvyšných %s na disku ostane nedostupných.\n\nNaozaj chcete pokračovať?" t MSG_135 "Verzia" t MSG_136 "Poznámky k vydaniu" @@ -13656,7 +13656,7 @@ t MSG_172 "Neplatný podpis stiahnutého súboru" t MSG_173 "Stlačením vybrať..." t MSG_174 "Rufus - Spoľahlivý program pre formátovanie USB" t MSG_175 "Verzia %d.%d (Build %d)" -t MSG_176 "Do slovenčiny preložil martinco78 <mailto:martinco78@azet.sk>" +t MSG_176 "Do slovenčiny preložil martinco78 <mailto:martin.kubanik@gmail.com>" t MSG_177 "Oznámenie chýb alebo žiadosti o zlepšenie programu:" t MSG_178 "Doplnkové Copyrighty:" t MSG_179 "Zásady aktuálizácií:" @@ -13800,14 +13800,16 @@ t MSG_317 "ID disku" t MSG_318 "Predvolená priorita vlákna: %d" t MSG_319 "Ignorovať zavádzaciu značku" t MSG_320 "Obnovuje sa rozloženie oblasti (%s)..." -t MSG_321 "Obráz, ktorý ste vybrali, je ISOHybrid a nie je kompatibilný s ISO/režim kopírovania súboru.\nV dôsledku toho sa vynúti režim zápisu obrazu DD." +t MSG_321 "Obraz, ktorý ste vybrali, je ISOHybrid a nie je kompatibilný s ISO/režim kopírovania súboru.\nV dôsledku toho sa vynúti režim zápisu obrazu DD." t MSG_322 "Nedá sa otvoriť alebo prečítať „%s\"" +t MSG_323 "Použiť SkuSiPolicy.p7b pri inštalácii (pozri KB5042562)" +t MSG_324 "QoL vylepšenia (nenúťte Copilot, OneDrive, Outlook, Fast Startup a podobne)" t MSG_325 "Použitie prispôsobenia systému Windows: %s" t MSG_326 "Použitie používateľských nastavení..." t MSG_327 "Používateľská skúsenosť so systémom Windows" t MSG_328 "Prajete si prispôsobiť inštaláciu systému Windows?" -t MSG_329 "Odstrániť požiadavku pre 4GB+ RAM, Secure Boot a TPM 2.0" -t MSG_330 "Odstrániť požiadavky na online konto Microsoft" +t MSG_329 "Odstrániť požiadavky pre 4GB+ RAM, Secure Boot a TPM 2.0" +t MSG_330 "Odstrániť požiadavku na online konto Microsoft" t MSG_331 "Zakázať zhromažďovanie údajov (preskočiť otázky týkajúce sa ochrany osobných údajov)" t MSG_332 "Zabrániť funkcii Windows To Go v prístupe na interné disky" t MSG_333 "Vytvorte si lokálny účet s používateľským menom:" @@ -13827,6 +13829,27 @@ t MSG_346 "Obmedziť systém Windows s režimom S (NEKOMPATIBILNÝ s obídením t MSG_347 "Expertný režim" t MSG_348 "Extrahovanie archívnych súborov: %s" t MSG_349 "Použiť Rufus MBR" +t MSG_350 "Použiť podpísané bootloadery „Windows CA 2023\" (vyžaduje kompatibilný cieľový PC)" +t MSG_351 "Prebieha kontrola zrušenia UEFI zavádzača..." +t MSG_352 "Prebieha kontrola aktualizácie pre UEFI DBX..." +t MSG_353 "Dostupná aktualizácia DBX" +t MSG_354 "Rufus našiel aktualizovanú verziu DBX súborov používaných na kontrolu odvolávania UEFI Secure Boot. Chcete si stiahnuť túto aktualizáciu?\n- Vyberte „Áno\" ak chcete tieto súbory stiahnuť\n- Vyberte „Nie\" pre zrušenie operácie\n\nPoznámka: Súbory budú stiahnuté do adresára aplikácie a budú automaticky znovu použité, ak budú prítomné." +t MSG_355 "⚠BEZ UPOZORNENIA⚠ vymažte disk a nainštaluje:" +t MSG_356 "Vybrali ste možnosť „tichá\" inštalácia Windows.\n\nIde o pokročilú možnosť, vyhradenú pre ľudí, ktorí chcú vytvárať médiá, ktoré počas inštalácie Windows neupozorňujú používateľa a teda BEZPODMIENEČNE VYMAŽÚ prvý zistený disk na cieľovom systéme. Ak nebudete opatrní, pri tejto možnosti môže dôjsť k NEVRATNEJ STRATE DÁT!\n\nAk to nie je to, čo chcete, vyberte prosím „Nie\", aby ste sa vrátili späť a odškrtli túto možnosť.\nInak, ak zvolíte „Áno\", súhlasíte, že plná zodpovednosť za akúkoľvek stratu dát bude úplne na VÁS." +t MSG_358 "Nepodporované umiestnenie obrazu" +t MSG_359 "Nemôžete použiť obraz, ktorý sa nachádza na cieľovom disku, pretože tento disk bude úplne vymazaný. Je to to isté, ako keby ste sa snažili rezať konár, na ktorom sedíte!\n\nProsím, presuňte tento obraz do iného umiestnenia a skúste to znova." +t MSG_360 "Je bezpečné nechať túto možnosť zapnutú aj v prípade, že máte TPM alebo viac RAM, pretože táto možnosť len obchádza požiadavky na nastavenie a v skutočnosti nebráni Windows v používaní všetkého dostupného hardvéru." +t MSG_361 "Aby táto možnosť fungovala, sieť/internet MUSIA byť počas inštalácie odpojené!" +t MSG_362 "Automaticky odpovedá „NIE\" na otázky týkajúce sa Windows zdieľania dát s Microsoftom, namiesto toho, aby vyzývali používateľa." +t MSG_363 "Túto možnosť by ste mali nechať zapnutú, pokiaľ vám nevadí, že „Windows To Go\" pristupuje k interným diskom a potichu vykonáva nezvratné aktualizácie súborového systému." +t MSG_364 "Automaticky vytvorí lokálny účet s určeným používateľským menom s prázdnym heslom, ktoré bude potrebné zmeniť pri ďalšom prihlásení." +t MSG_365 "Duplikuje regionálne nastavenia z tohto PC (klávesnica, časové pásmo, mena) namiesto toho, aby výzýval používateľa." +t MSG_366 "Nešifrujte systémový disk, pokiaľ to používateľ výslovne nepožiada." +t MSG_367 "Použite túto možnosť len vtedy, ak viete, čo je S-Mode a chápete, že váš systém môže byť uzamknutý v S-Mode aj po úplnom vymazaní a preinštalovaní Windows." +t MSG_368 "Použite túto možnosť, ak systém ktorý plánujete nainštalovať Windows, používa plne aktuálne certifikáty Secure Boot. Ak je to potrebné, môžete zvážiť použitie „Mosby\" na aktualizáciu systému." +t MSG_369 "Použite túto možnosť, ak chcete zrušiť ďalšie potenciálne nebezpečné bootloadery Windows, ale zároveň potenciálne zabrániť spusteniu štandardných Windows médií." +t MSG_370 "Vylepšenia „kvality života\": Vypne väčšinu nežiaducich funkcií, ktoré sa Microsoft snaží vnútiť koncovým používateľom." +t MSG_371 "Ak použijete túto možnosť, uistite sa, že máte odpojené všetky disky od cieľového PC, okrem toho na ktorý chcete nainštalovať systém Windows. Taktiež nenechávajte médium pripojené k žiadnemu PC, ktorý nechcete vymazať." t MSG_900 "Rufus je utilita, ktorá vám pomôže naformátovať a vytvoriť bootovacie jednotky USB Flash, ako sú napr. USB kľúče, pamäťové karty, atď." t MSG_901 "Oficiálna stránka: %s" t MSG_902 "Zdrojový kód: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 862ba6b9..e6bec4c3 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.14.2369" +CAPTION "Rufus 4.14.2370" 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,14,2369,0 - PRODUCTVERSION 4,14,2369,0 + FILEVERSION 4,14,2370,0 + PRODUCTVERSION 4,14,2370,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.14.2369" + VALUE "FileVersion", "4.14.2370" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2369" + VALUE "ProductVersion", "4.14.2370" END END BLOCK "VarFileInfo" From a4f0e8748eb447dab5ecff6e62ba878390c79949 Mon Sep 17 00:00:00 2001 From: Riku Brander <brander.riku@gmail.com> Date: Mon, 20 Apr 2026 00:58:17 +0100 Subject: [PATCH 180/192] [loc] update Finnish translation to latest --- res/loc/po/fi-FI.po | 148 +++++++++++++++++++++++++++++++++++++++----- res/loc/rufus.loc | 33 ++++++++-- src/rufus.rc | 10 +-- 3 files changed, 167 insertions(+), 24 deletions(-) diff --git a/res/loc/po/fi-FI.po b/res/loc/po/fi-FI.po index 48ef3427..958f4ebc 100644 --- a/res/loc/po/fi-FI.po +++ b/res/loc/po/fi-FI.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-05-14 12:47+0300\n" -"PO-Revision-Date: 2024-05-14 14:07+0300\n" +"POT-Creation-Date: 2026-04-19 21:57+0300\n" +"PO-Revision-Date: 2026-04-19 23:58+0300\n" "Last-Translator: \n" "Language-Team: \n" "Language: fi_FI\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Finnish (Suomi)\n" "X-Rufus-LCID: 0x040B\n" -"X-Generator: Poedit 3.4.4\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -846,7 +846,7 @@ msgstr "Ei pysyvää osiota" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Aseta pysyvän osion koko 'live USB' -tietovälineitä varten. Koon asettaminen arvoon 0 poistaa pysyvän osion käytöstä." @@ -888,17 +888,17 @@ msgstr "Jokin toinen ohjelma tai prosessi käyttää tätä levyä parhaillaan. #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Rufus on havainnut, että yrität luoda Windows to Go -tietovälinettä joka pohjautuu 1809 ISO-levykuvaan.\n" +"Rufus on havainnut, että yrität luoda 'Windows To Go' -tietovälinettä joka pohjautuu 1809 ISO-levykuvaan.\n" "\n" -"*MICROSOFTIN OHJELMOINTIVIRHEEN* vuoksi tämä tietoväline kaatuu Windowsin käynnistyksen aikana (Blue Screen Of Death), ellet manuaalisesti korvaa 'WppRecorder.sys' -tiedostoa 1803-versiolla.\n" +"*MICROSOFTIN OHJELMOINTIVIRHEEN* vuoksi tämä tietoväline kaatuu Windowsin käynnistyksen aikana (keskeytysvirhe), ellet manuaalisesti korvaa 'WppRecorder.sys' -tiedostoa 1803-versiolla.\n" "\n" -"Huomaathan, että 'WppRecorder.sys' on Microsoftin tekijänoikeudellinen tiedosto ja täten Rufus ei voi automaattisesti korjata tätä virhettä, sillä emme voi tarjota kyseistä tiedostoa sovelluksemme kautta lakiteknisistä syistä..." +"Huomaathan, että 'WppRecorder.sys' on Microsoftin tekijänoikeudellinen tiedosto. Rufus ei voi automaattisesti korjata tätä virhettä, sillä emme voi tarjota kyseistä tiedostoa sovelluksen kautta lakiteknisistä syistä..." #. • MSG_134 msgid "" @@ -1795,6 +1795,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Ei voitu avata tai lukea kohdetta '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Ota käyttöön SkuSiPolicy.p7b-käytäntö asennuksen yhteydessä (Katso KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "QoL-parannukset (Älä pakota ominaisuuksia Copilot, OneDrive, Outlook, Fast Startup jne.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Asetetaan Windowsin mukautusasetuksia: %s" @@ -1845,17 +1853,17 @@ msgstr "Pysyvä lokitiedosto" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Uusi tiedosto ('diskcopy.dll') on ladattava Microsoftilta MS-DOSin asennusta varten:\n" +"Tämän ominaisuuden käyttö vaatii Microsoftilta ladattavan lisätiedoston ('%s'):\n" "- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi sen\n" "- Valitse 'Ei' peruuttaaksesi toiminnon\n" "\n" -"Huomio: Tiedosto ladataan sovelluksen kansioon ja sitä uudelleenkäytetään automaattisesti, jos se on jo olemassa." +"Huomio: Tiedosto ladataan sovelluskansioon ja sitä voidaan uudelleenkäyttää automaattisesti." #. • MSG_338 msgid "Revoked UEFI bootloader detected" @@ -1905,7 +1913,7 @@ msgstr "" #. • MSG_346 msgid "Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)" -msgstr "Rajoita Windows S Mode-tilaan (EI YHTEENSOPIVA verkkotilin ohituksen kanssa)" +msgstr "Rajoita Windows käyttämään S Mode -tilaa (EI YHTEENSOPIVA verkkotilin ohituksen kanssa)" #. • MSG_347 msgid "Expert Mode" @@ -1919,6 +1927,118 @@ msgstr "Puretaan tiedostoarkistoja: %s" msgid "Use Rufus MBR" msgstr "Rufusin MBR:n käyttö" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Käytä 'Windows CA 2023' -allekirjoitettuja käynnistyslataajia (Vaatii yhteensopivan kohdetietokoneen)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Tarkistetaan, onko UEFI-käynnistyslataaja mitätöity..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Tarkistetaan UEFI DBX-tietokannan päivityksiä..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "DBX-päivitys saatavilla" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus on havainnut päivitetyn version DBX-tiedostoista, joita käytetään UEFI Secure Boot -mitätöintitarkistuksissa. Haluatko ladata päivityksen?\n" +"- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi sisällön\n" +"- Valitse 'Ei' peruuttaaksesi toiminnon\n" +"\n" +"Huomio: Tiedostot ladataan sovelluskansioon ja niitä voidaan uudelleenkäyttää automaattisesti." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "Tyhjennä levy ja suorita asennus ⚠VALVOMATTA⚠:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes', you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Olet valinnut Windows-asennustavan, joka tapahtuu \"valvomatta\".\n" +"\n" +"Tämä on edistyneille käyttäjille suunnattu toiminto luoden tietovälineen, joka ei vaadi mitään käyttäjän syötettä asennuksen aikana ja täten TYHJENTÄÄ VAROITUKSETTA ensimmäisen havaitun levyn kohdejärjestelmässä. Jos et ole tarkkana, voi tämä valinta johtaa PERUUTTAMATTOMAAN TIEDON MENETYKSEEN!\n" +"\n" +"Jos et halua käyttää tätä ominaisuutta, valitse 'Ei' palataksesi ja poista valintaruudun valinta.\n" +"Valitsemalla 'Kyllä' hyväksyt, että mahdollinen tietojen menetys on täysin SINUN vastuullasi." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Levykuvan sijaintia ei tueta" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Et voi käyttää kohdeasemalle tallennettua levykuvaa, sillä tämä asema tyhjennetään kokonaisuudessaan. Se on vähän kuin omaa oksaansa sahaisi!\n" +"\n" +"Siirrä levykuva eri sijaintiin ja yritä uudelleen." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Voit turvallisesti käyttää tätä valintaa, vaikka sinulta löytyisi TPM tai enemmän keskusmuistia, sillä se sivuuttaa ainoastaan asennusvaatimuksen eikä rajoita Windowsia käyttämästä saatavilla olevaa laitteistoa." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Tämän valinnan toiminta VAATII verkon/internetin kytkemisen pois päältä asennuksen ajaksi!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Vastaa automaattisesti käyttäjältä kysymättä 'ei' Windowsin asennusvalintoihin, jotka liittyvät tiedon jakamiseen Microsoftin kanssa." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Tämä valinta kannattaa pitää valittuna, ellet halua sallia 'Windows to Go' -asennukselle pääsyä sisäisiin levyihin ja valvomatonta, peruuttamatonta tiedostojärjestelmien päivitystä." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Luo automaattisesti paikallinen tili määritetyllä käyttäjänimellä ja tyhjällä salasanalla, joka tulee vaihtaa seuraavan sisäänkirjautumisen yhteydessä." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Kopioi alueelliset asetukset (näppäimistö, aikavyöhyke, valuutta) tästä tietokoneesta käyttäjältä kysymisen sijaan." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Älä salaa järjestelmälevyä, ellei käyttäjä sitä erikseen pyydä." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Käytä tätä valintaa vain, jos tiedät mitä S Mode -tila tarkoittaa ja ymmärrät, että järjestelmäsi voi lukittua S Mode -tilaan vaikka poistaisit ja uudelleenasentaisit Windowsin kokonaan." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Käytä tätä valintaa, jos Windows-asennuksen kohdetietokoneesta löytyy täysin ajan tasalla olevat Secure Boot -sertifikaatit. Voit halutessasi tutustua 'Mosby'-ohjelmaan päivitystä varten." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Käytä tätä valintaa, jos haluat mitätöidä useampia mahdollisesti vaarallisia Windows-käynnistyslataajia, mutta samalla mahdollisesti estäen myös joidenkin normaalien Windows-tietovälineiden käynnistymisen." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "\"Quality of Life\" -parannukset: Poista käytöstä useimmat ei-halutut ominaisuudet, joita Microsoft yrittää pakottaa käyttäjiä väkisin käyttämään." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Jos käytät tätä valintaa, varmistathan, että kaikki levyt on irroitettu kohdetietokoneesta lukuunottamatta haluttua Windows-asennuksen kohdelevyä. Älä myöskään jätä tietovälinettä yhdistetyksi sellaiseen tietokoneeseen, jonka levyjä et halua tyhjennettävän." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 8517b472..b769b258 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -12,7 +12,7 @@ # • v4.14 "cs-CZ" "Czech (Čeština)" # • v4.14 "da-DK" "Danish (Dansk)" # • v4.14 "nl-NL" "Dutch (Nederlands)" -# • v4.5 "fi-FI" "Finnish (Suomi)" +# • v4.14 "fi-FI" "Finnish (Suomi)" # • v4.14 "fr-FR" "French (Français)" # • v4.14 "de-DE" "German (Deutsch)" # • v4.14 "el-GR" "Greek (Ελληνικά)" @@ -4219,7 +4219,7 @@ t MSG_922 "UEFI Shell ISO's downloaden" ######################################################################### l "fi-FI" "Finnish (Suomi)" 0x040B -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -4406,7 +4406,7 @@ t MSG_129 "Loit juuri tietovälineen, joka käyttää UEFI:NTFS -käynnistyslata t MSG_130 "Windows-levykuvan valinta" t MSG_131 "Tämä ISO-tiedosto sisältää useita Windows-levykuvia.\nValitse levykuva, jota haluat käyttää tähän asennukseen:" t MSG_132 "Jokin toinen ohjelma tai prosessi käyttää tätä levyä parhaillaan. Haluatko silti alustaa sen?" -t MSG_133 "Rufus on havainnut, että yrität luoda Windows to Go -tietovälinettä joka pohjautuu 1809 ISO-levykuvaan.\n\n*MICROSOFTIN OHJELMOINTIVIRHEEN* vuoksi tämä tietoväline kaatuu Windowsin käynnistyksen aikana (Blue Screen Of Death), ellet manuaalisesti korvaa 'WppRecorder.sys' -tiedostoa 1803-versiolla.\n\nHuomaathan, että 'WppRecorder.sys' on Microsoftin tekijänoikeudellinen tiedosto ja täten Rufus ei voi automaattisesti korjata tätä virhettä, sillä emme voi tarjota kyseistä tiedostoa sovelluksemme kautta lakiteknisistä syistä..." +t MSG_133 "Rufus on havainnut, että yrität luoda 'Windows To Go' -tietovälinettä joka pohjautuu 1809 ISO-levykuvaan.\n\n*MICROSOFTIN OHJELMOINTIVIRHEEN* vuoksi tämä tietoväline kaatuu Windowsin käynnistyksen aikana (keskeytysvirhe), ellet manuaalisesti korvaa 'WppRecorder.sys' -tiedostoa 1803-versiolla.\n\nHuomaathan, että 'WppRecorder.sys' on Microsoftin tekijänoikeudellinen tiedosto. Rufus ei voi automaattisesti korjata tätä virhettä, sillä emme voi tarjota kyseistä tiedostoa sovelluksen kautta lakiteknisistä syistä..." t MSG_134 "Koska osion tyypiksi on valittu MBR, voi Rufus luoda vain maksimissaan 2 TB:n kokoisen osion tälle tietovälineelle jättäen %s levytilaa käyttökelvottomaksi.\n\nHaluatko varmasti jatkaa?" t MSG_135 "Versio" t MSG_136 "Julkaisu" @@ -4593,6 +4593,8 @@ t MSG_319 "Sivuuta Boot Marker" t MSG_320 "Päivitetään osioiden sijoittelua (%s)..." t MSG_321 "Valitsemasi levykuva on ISOHybrid-muotoinen, mutta sen tekijät eivät ole tehneet siitä yhteensopivaa ISO/tiedostotyyppisen kopiointitilan kanssa.\nTämän vuoksi käyttöön otetaan DD-kuvan kirjoitustila." t MSG_322 "Ei voitu avata tai lukea kohdetta '%s'" +t MSG_323 "Ota käyttöön SkuSiPolicy.p7b-käytäntö asennuksen yhteydessä (Katso KB5042562)" +t MSG_324 "QoL-parannukset (Älä pakota ominaisuuksia Copilot, OneDrive, Outlook, Fast Startup jne.)" t MSG_325 "Asetetaan Windowsin mukautusasetuksia: %s" t MSG_326 "Asetetaan käyttäjäasetuksia..." t MSG_327 "Windows-käyttäjäkokemus" @@ -4605,7 +4607,7 @@ t MSG_333 "Luo paikallinen käyttäjätili käyttäjänimellä:" t MSG_334 "Aseta alueelliset vaihtoehdot samoihin asetuksiin kuin nykyisellä käyttäjällä" t MSG_335 "Poista käytöstä automaattinen laitteen BitLocker-salaus" t MSG_336 "Pysyvä lokitiedosto" -t MSG_337 "Tämän ominaisuuden käyttämiseksi Microsoftilta on ladattava lisätiedosto ('%s'):\n- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi sen\n- Valitse 'Ei' peruuttaaksesi toiminnon\n\nHuomio: Tiedosto ladataan sovelluksen kansioon ja sitä uudelleenkäytetään automaattisesti, jos se on jo olemassa." +t MSG_337 "Tämän ominaisuuden käyttö vaatii Microsoftilta ladattavan lisätiedoston ('%s'):\n- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi sen\n- Valitse 'Ei' peruuttaaksesi toiminnon\n\nHuomio: Tiedosto ladataan sovelluskansioon ja sitä voidaan uudelleenkäyttää automaattisesti." t MSG_338 "Mitätöity UEFI-käynnistyslataaja havaittu" t MSG_339 "Rufus havaitsi, että käyttämäsi ISO-levykuva sisältää UEFI-käynnistyslataajan, joka on mitätöity ja tulee aiheuttamaan %s Secure Bootin ollessa päällä ajantasaisessa UEFI-kokoonpanossa.\n\n- Jos olet hankkinut tämän ISO-levykuvan ei-luotettavasta lähteestä, huomioi UEFI-haittaohjelmien mahdollisuus ja vältä siltä käynnistämistä.\n- Jos olet hankkinut sen luotettavasta lähteestä, sinun tulisi yrittää etsiä uudempi versio, joka ei aiheuta tätä varoitusta." t MSG_340 "\"Turvallisuusrikkomus\"-näkymän" @@ -4614,10 +4616,31 @@ t MSG_342 "Pakattu VHDX-levykuva" t MSG_343 "Pakkaamaton VHD-levykuva" t MSG_344 "Full Flash Update -levykuva" t MSG_345 "Tämän toiminnon käyttäminen vaatii lisätiedostojen lataamista Microsoftilta:\n- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi ne\n- Valitse 'Ei' peruuttaaksesi toiminnon" -t MSG_346 "Rajoita Windows S Mode-tilaan (EI YHTEENSOPIVA verkkotilin ohituksen kanssa)" +t MSG_346 "Rajoita Windows käyttämään S Mode -tilaa (EI YHTEENSOPIVA verkkotilin ohituksen kanssa)" t MSG_347 "Asiantuntijatila" t MSG_348 "Puretaan tiedostoarkistoja: %s" t MSG_349 "Rufusin MBR:n käyttö" +t MSG_350 "Käytä 'Windows CA 2023' -allekirjoitettuja käynnistyslataajia (Vaatii yhteensopivan kohdetietokoneen)" +t MSG_351 "Tarkistetaan, onko UEFI-käynnistyslataaja mitätöity..." +t MSG_352 "Tarkistetaan UEFI DBX-tietokannan päivityksiä..." +t MSG_353 "DBX-päivitys saatavilla" +t MSG_354 "Rufus on havainnut päivitetyn version DBX-tiedostoista, joita käytetään UEFI Secure Boot -mitätöintitarkistuksissa. Haluatko ladata päivityksen?\n- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi sisällön\n- Valitse 'Ei' peruuttaaksesi toiminnon\n\nHuomio: Tiedostot ladataan sovelluskansioon ja niitä voidaan uudelleenkäyttää automaattisesti." +t MSG_355 "Tyhjennä levy ja suorita asennus ⚠VALVOMATTA⚠:" +t MSG_356 "Olet valinnut Windows-asennustavan, joka tapahtuu \"valvomatta\".\n\nTämä on edistyneille käyttäjille suunnattu toiminto luoden tietovälineen, joka ei vaadi mitään käyttäjän syötettä asennuksen aikana ja täten TYHJENTÄÄ VAROITUKSETTA ensimmäisen havaitun levyn kohdejärjestelmässä. Jos et ole tarkkana, voi tämä valinta johtaa PERUUTTAMATTOMAAN TIEDON MENETYKSEEN!\n\nJos et halua käyttää tätä ominaisuutta, valitse 'Ei' palataksesi ja poista valintaruudun valinta.\nValitsemalla 'Kyllä' hyväksyt, että mahdollinen tietojen menetys on täysin SINUN vastuullasi." +t MSG_358 "Levykuvan sijaintia ei tueta" +t MSG_359 "Et voi käyttää kohdeasemalle tallennettua levykuvaa, sillä tämä asema tyhjennetään kokonaisuudessaan. Se on vähän kuin omaa oksaansa sahaisi!\n\nSiirrä levykuva eri sijaintiin ja yritä uudelleen." +t MSG_360 "Voit turvallisesti käyttää tätä valintaa, vaikka sinulta löytyisi TPM tai enemmän keskusmuistia, sillä se sivuuttaa ainoastaan asennusvaatimuksen eikä rajoita Windowsia käyttämästä saatavilla olevaa laitteistoa." +t MSG_361 "Tämän valinnan toiminta VAATII verkon/internetin kytkemisen pois päältä asennuksen ajaksi!" +t MSG_362 "Vastaa automaattisesti käyttäjältä kysymättä 'ei' Windowsin asennusvalintoihin, jotka liittyvät tiedon jakamiseen Microsoftin kanssa." +t MSG_363 "Tämä valinta kannattaa pitää valittuna, ellet halua sallia 'Windows to Go' -asennukselle pääsyä sisäisiin levyihin ja valvomatonta, peruuttamatonta tiedostojärjestelmien päivitystä." +t MSG_364 "Luo automaattisesti paikallinen tili määritetyllä käyttäjänimellä ja tyhjällä salasanalla, joka tulee vaihtaa seuraavan sisäänkirjautumisen yhteydessä." +t MSG_365 "Kopioi alueelliset asetukset (näppäimistö, aikavyöhyke, valuutta) tästä tietokoneesta käyttäjältä kysymisen sijaan." +t MSG_366 "Älä salaa järjestelmälevyä, ellei käyttäjä sitä erikseen pyydä." +t MSG_367 "Käytä tätä valintaa vain, jos tiedät mitä S Mode -tila tarkoittaa ja ymmärrät, että järjestelmäsi voi lukittua S Mode -tilaan vaikka poistaisit ja uudelleenasentaisit Windowsin kokonaan." +t MSG_368 "Käytä tätä valintaa, jos Windows-asennuksen kohdetietokoneesta löytyy täysin ajan tasalla olevat Secure Boot -sertifikaatit. Voit halutessasi tutustua 'Mosby'-ohjelmaan päivitystä varten." +t MSG_369 "Käytä tätä valintaa, jos haluat mitätöidä useampia mahdollisesti vaarallisia Windows-käynnistyslataajia, mutta samalla mahdollisesti estäen myös joidenkin normaalien Windows-tietovälineiden käynnistymisen." +t MSG_370 "\"Quality of Life\" -parannukset: Poista käytöstä useimmat ei-halutut ominaisuudet, joita Microsoft yrittää pakottaa käyttäjiä väkisin käyttämään." +t MSG_371 "Jos käytät tätä valintaa, varmistathan, että kaikki levyt on irroitettu kohdetietokoneesta lukuunottamatta haluttua Windows-asennuksen kohdelevyä. Älä myöskään jätä tietovälinettä yhdistetyksi sellaiseen tietokoneeseen, jonka levyjä et halua tyhjennettävän." t MSG_900 "Rufus on ohjelma, joka auttaa alustamaan ja luomaan boottaavia USB-laitteita, kuten esimerkiksi USB-avaimia, muistitikkuja jne." t MSG_901 "Virallinen sivusto: %s" t MSG_902 "Lähdekoodi: %s" diff --git a/src/rufus.rc b/src/rufus.rc index e6bec4c3..d3bafae9 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.14.2370" +CAPTION "Rufus 4.14.2371" 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,14,2370,0 - PRODUCTVERSION 4,14,2370,0 + FILEVERSION 4,14,2371,0 + PRODUCTVERSION 4,14,2371,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.14.2370" + VALUE "FileVersion", "4.14.2371" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2370" + VALUE "ProductVersion", "4.14.2371" END END BLOCK "VarFileInfo" From 2414335217eb5c0992434cbd6f77e9ea80aea0e7 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Tue, 21 Apr 2026 11:56:01 +0100 Subject: [PATCH 181/192] [misc] update ChangeLog for BETA * Also remove some TODOs we don't plan to address. --- ChangeLog.txt | 14 ++++++++++++++ src/iso.c | 1 - src/rufus.rc | 10 +++++----- src/vhd.c | 1 - 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 142da25b..a83698cb 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,17 @@ +o Version 4.14 (2026.04.??) + 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 (refer to KB5042562) + - 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 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 + 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 + o Version 4.13 (2026.02.17) [BUGFIX RELEASE] Fix UEFI:NTFS not selecting the proper driver for ARM/ARM64 Update embedded GRUB to v2.14 diff --git a/src/iso.c b/src/iso.c index b1e56c82..952c80bd 100644 --- a/src/iso.c +++ b/src/iso.c @@ -2065,7 +2065,6 @@ out: return ret; } -// TODO: If we can't get save to ISO from virtdisk, we might as well drop this static DWORD WINAPI OpticalDiscSaveImageThread(void* param) { BOOL s; diff --git a/src/rufus.rc b/src/rufus.rc index d3bafae9..0d7c33ec 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.14.2371" +CAPTION "Rufus 4.14.2372" 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,14,2371,0 - PRODUCTVERSION 4,14,2371,0 + FILEVERSION 4,14,2372,0 + PRODUCTVERSION 4,14,2372,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.14.2371" + VALUE "FileVersion", "4.14.2372" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2371" + VALUE "ProductVersion", "4.14.2372" END END BLOCK "VarFileInfo" diff --git a/src/vhd.c b/src/vhd.c index d9003b43..d0faa1f5 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -499,7 +499,6 @@ static DWORD WINAPI VhdSaveImageThread(void* param) // be used as DD images. if (img_save->Type == VIRTUAL_STORAGE_TYPE_DEVICE_VHD) flags |= CREATE_VIRTUAL_DISK_FLAG_FULL_PHYSICAL_ALLOCATION; - // TODO: Use CREATE_VIRTUAL_DISK_FLAG_PREVENT_WRITES_TO_SOURCE_DISK? overlapped.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL); From 967747399aa2a8ef9e07fc853e048ba393089588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=E1=BA=A7n=20Th=C3=A1i=20An?= <igl.antrnn@gmail.com> Date: Thu, 23 Apr 2026 16:18:17 +0100 Subject: [PATCH 182/192] [loc] update Vietnamese translation to latest --- res/loc/po/vi-VN.po | 120 ++++++++++++++++++++++++++++++++++++++------ res/loc/rufus.loc | 33 +++++++++--- src/rufus.rc | 10 ++-- 3 files changed, 136 insertions(+), 27 deletions(-) diff --git a/res/loc/po/vi-VN.po b/res/loc/po/vi-VN.po index 7fbf34d2..f8c66515 100644 --- a/res/loc/po/vi-VN.po +++ b/res/loc/po/vi-VN.po @@ -1,9 +1,9 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2025-06-21 21:57+0700\n" -"PO-Revision-Date: 2025-06-21 22:47+0700\n" +"POT-Creation-Date: 2026-04-22 21:20+0700\n" +"PO-Revision-Date: 2026-04-23 16:15+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: vi_VN\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Vietnamese (Tiếng Việt)\n" "X-Rufus-LCID: 0x042A\n" -"X-Generator: Poedit 3.6\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -846,7 +846,7 @@ msgstr "Không cố định" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Đặt kích thước phân vùng cố định cho live USB. Đặt kích thước là 0 để bỏ phân vùng cố định." @@ -888,7 +888,7 @@ msgstr "Có một chương trình hoặc tiến trình khác đang truy cập #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" @@ -896,7 +896,7 @@ msgid "" msgstr "" "Rufus nhận thấy bạn đang cố gắng tạo ổ đĩa Windows To Go dựa vào ISO phiên bản 1809.\n" "\n" -"Bởi vì một *LỖI CỦA MICROSOFT*, ổ đĩa này sẽ bị lỗi trong quá trình khởi động Windows (Màn hình xanh chết chóc), trừ khi bạn thay thế thủ công file 'WppRecorder.sys' của phiên bản 1803.\n" +"Bởi vì một *LỖI CỦA MICROSOFT*, ổ đĩa này sẽ bị lỗi trong quá trình khởi động Windows (Màn hình xanh chết chóc), trừ khi bạn tự tay thay thế file 'WppRecorder.sys' của phiên bản 1803.\n" "\n" "Cũng xin lưu ý rằng Rufus không thể tự động sửa lỗi này vì file 'WppRecorder.sys' thuộc bản quyền của Microsoft, vì vậy chúng tôi không thể nhúng file này vào chương trình..." @@ -1085,7 +1085,7 @@ msgstr "Phiên bản %d.%d (Bản dựng %d)" #. • MSG_176 msgid "English translation: Pete Batard <mailto:pete@akeo.ie>" -msgstr "Bản dịch Tiếng Việt:\\line• thanhtai2009 <mailto:thanhtai2009@outlook.com>\\line• caobach <mailto:caobach@gmail.com>\\line• Nguyễn Quang Minh (MinhNQ101) <mailto:admin@quangminh.name.vn>" +msgstr "Bản dịch Tiếng Việt:\\line• thanhtai2009 <mailto:thanhtai2009@outlook.com>\\line• caobach <mailto:caobach@gmail.com>\\line• Nguyễn Quang Minh (MinhNQ101) <mailto:admin@quangminh.name.vn>\\line• Trần Thái An <mailto:igl.antrnn@gmail.com>" #. • MSG_177 msgid "Report bugs or request enhancements at:" @@ -1727,7 +1727,7 @@ msgstr "điều này có thể mất một thời gian" #. • MSG_308 msgid "VHD detection" -msgstr "phát hiện VHD" +msgstr "Phát hiện VHD" #. • MSG_309 msgid "Compressed archive" @@ -1795,6 +1795,14 @@ msgstr "" msgid "Unable to open or read '%s'" msgstr "Không thể mở hoặc đọc '%s'" +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Áp dụng SkuSiPolicy.p7b trong khi cài đặt (Xem KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Những cải \"QoL\" (Không ép buộc Copilot, OneDrive, Outlook, Khởi động Nhanh, v.v.)" + #. • MSG_325 msgid "Applying Windows customization: %s" msgstr "Đang áp dụng tuỳ biến Windows: %s" @@ -1805,7 +1813,7 @@ msgstr "Đang áp dụng các cài đặt người dùng..." #. • MSG_327 msgid "Windows User Experience" -msgstr "" +msgstr "Trải nghiệm Người dùng Windows" #. • MSG_328 msgid "Customize Windows installation?" @@ -1845,13 +1853,13 @@ msgstr "Nhật ký lưu vĩnh viễn" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Một tệp tin bổ sung ('diskcopy.dll') phải được tải về từ Microsoft để cài đặt MS-DOS:\n" +"Một tệp tin bổ sung ('%s') cần được tải xuống từ Microsoft để sử dụng tính năng này:\n" "- Chọn 'Có' để kết nối tới Internet và tải nó xuống\n" "- Chọn 'Không' để huỷ tiến trình\n" "\n" @@ -1920,8 +1928,8 @@ msgid "Use Rufus MBR" msgstr "Sử dụng Rufus MBR" #. • MSG_350 -msgid "Use 'Windows UEFI CA 2023' signed bootloaders [EXPERIMENTAL]" -msgstr "Sử dụng bootloader đã được ký bởi chứng chỉ “Windows UEFI CA 2023” (TÍNH NĂNG THỬ NGHIỆM)" +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Sử dụng bootloader đã được ký bởi chứng chỉ “Windows UEFI CA 2023” (Cần có PC tương thích)" #. • MSG_351 msgid "Checking for UEFI bootloader revocation..." @@ -1949,6 +1957,88 @@ msgstr "" "\n" "Lưu ý: Các tệp sẽ được tải về thư mục của ứng dụng và sẽ tự động được sử dụng lại nếu đã có sẵn." +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "Xoá sạch ổ cứng và cài đặt ⚠MỘT CÁCH ÂM THẦM⚠:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes', you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Bạn đã lựa chọn phương thức cài đặt Windows \"im lặng\".\n" +"\n" +"Đây là một tuỳ chọn nâng cao, dành riêng cho những người muốn tạo một bản cài đặt không thông báo cho người dung xuyên suốt quá trình cài đặt Windows và qua đó XOÁ SẠCH VÔ ĐIỀU KIỆN ổ đĩa được nhận diện đầu tiên. Nếu bạn không cẩn than, sử dụng tuỳ chọn nào có thể gây ra MẤT HOÀN TOÀN DỮ LIỆU\n" +"\n" +"Nếu đó không phải thứ bạn muốn, vui long chọn 'Không' để quay trở lại và huỷ chọn tuỳ chọn đó.\n" +"Thay vào đó, nếu bạn chọn 'Có', bạn chấp thuận rằng mọi trách nhiệm về dữ liệu bị mất hoàn toàn thuộc về BẠN." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Vị trí tập tin ảnh đĩa không được hỗ trợ" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Bạn không thể sử dụng một ảnh đĩa nằm trên thiết bị mục tiêu, vì thiết bị đó sẽ bị xoá hoàn toàn. Nó giống như việc bạn tự chặt cành cây mà bạn đang đứng lên vậy!\n" +"\n" +"Vui lòng di chuyển ảnh đĩa tới một vị trí khác và thử lại." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Việc bật tuỳ chọn này là hoàn toàn an toàn kể cả khi bạn có TPM hay nhiều RAM hơn, vì tuỳ chọn này chỉ bỏ qua nhừng yêu cầu cài đặt và không ngăn Windows sử dụng mọi tài nguyên phần cứng có thể." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Để tuỳ chọn này có hiệu quả, các mạng PHẢI được ngắt kết nối trong quá trình cài đặt!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Tự động trả lời 'không' cho những câu hỏi liên quan tới việc chia sẻ dữ liệu cho Microsoft, thay vì thông báo cho người dùng." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Bạn nên để tuỳ chọn này ở mức 'Bật', trừ khi bạn ổn với việc Windows To Go truy cập vào các thiết bị nội bộ và âm thầm tạo ra những bản cập nhật hệ thống không thể hoàn tác." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Tự động tạo một tài khoản nội bộ với tên người dùng đã nêu, cùng một mật khẩu rỗng sẽ cần phải thay đổi trong lần đăng nhập tiếp theo." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Sao chép những cài đặt về vùng từ PC này (bàn phím, múi giờ, đơn vị), thay vì thông báo cho người dùng." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Không mã hoá ổ đĩa hệ thống, trừ khi được người dùng đích danh yêu cầu." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Chỉ sử dụng tuỳ chọn này khi bạn biết S-Mode là gì và bạn hiểu rằng hệ thống của bạn có thể bị khoá ở S-Mode kể cả khi bạn xoá sạch và cài đặt lại Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Dùng tuỳ chọn này nếu hệ thống bạn muốn cài đặt Windows đang sử dụng những chứng chỉ Secure Boot (chế độ khởi động bảo mật) mới nhất. Nếu cần thiết, bạn có thể tìm hiểu việc dùng 'Mosby' để cập nhật hệ thống của bạn." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Dùng tuỳ chọn này nếu bạn muốn thu hồi những trình khởi động Windows có nguy cơ, nhưng cũng có khả năng ngăn ảnh đĩa Windows cơ bản khởi động." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Những nâng cấp \"tiện ích trải nghiệm\": Vô hiệu hoá đa số những tính năng không mong muốn Microsoft đang cố nhồi nhét cho người dùng." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Nếu bạn sử dụng tuỳ chọn này, hãy chắc chắn rằng bạn đã ngắt kết nối tất cả các ổ đĩa khỏi PC đích, ngoại trừ ổ bạn muốn cài Windows, cũng như là không cắm ảnh đĩa vào bất kì PC nào bạn không muốn xoá sạch." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index b769b258..57dcc025 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -40,7 +40,7 @@ # • v4.14 "th-TH" "Thai (ไทย)" # • v4.14 "tr-TR" "Turkish (Türkçe)" # • v4.14 "uk-UA" "Ukrainian (Українська)" -# • v4.5 "vi-VN" "Vietnamese (Tiếng Việt)" +# • v4.14 "vi-VN" "Vietnamese (Tiếng Việt)" ######################################################################### l "en-US" "English (English)" 0x0409, 0x0809, 0x0c09, 0x1009, 0x1409, 0x1809, 0x1c09, 0x2009, 0x2409, 0x2809, 0x2c09, 0x3009, 0x3409, 0x3809, 0x3c09, 0x4009, 0x4409, 0x4809 @@ -16522,7 +16522,7 @@ t MSG_922 "Завантаження командної оболонки UEFI ISO ######################################################################### l "vi-VN" "Vietnamese (Tiếng Việt)" 0x042A -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -16705,7 +16705,7 @@ t MSG_129 "Bạn vừa mới tạo ổ đĩa sử dung UEFI:NTFS bootloader. Hã t MSG_130 "Chọn file ảnh Windows" t MSG_131 "File ISO này chứa nhiều tệp ảnh Windows.\nHãy chọn tệp ảnh bạn muốn sử dung cho việc cài đặt này:" t MSG_132 "Có một chương trình hoặc tiến trình khác đang truy cập ổ. Bạn vẫn muốn định dạng ổ đĩa?" -t MSG_133 "Rufus nhận thấy bạn đang cố gắng tạo ổ đĩa Windows To Go dựa vào ISO phiên bản 1809.\n\nBởi vì một *LỖI CỦA MICROSOFT*, ổ đĩa này sẽ bị lỗi trong quá trình khởi động Windows (Màn hình xanh chết chóc), trừ khi bạn thay thế thủ công file 'WppRecorder.sys' của phiên bản 1803.\n\nCũng xin lưu ý rằng Rufus không thể tự động sửa lỗi này vì file 'WppRecorder.sys' thuộc bản quyền của Microsoft, vì vậy chúng tôi không thể nhúng file này vào chương trình..." +t MSG_133 "Rufus nhận thấy bạn đang cố gắng tạo ổ đĩa Windows To Go dựa vào ISO phiên bản 1809.\n\nBởi vì một *LỖI CỦA MICROSOFT*, ổ đĩa này sẽ bị lỗi trong quá trình khởi động Windows (Màn hình xanh chết chóc), trừ khi bạn tự tay thay thế file 'WppRecorder.sys' của phiên bản 1803.\n\nCũng xin lưu ý rằng Rufus không thể tự động sửa lỗi này vì file 'WppRecorder.sys' thuộc bản quyền của Microsoft, vì vậy chúng tôi không thể nhúng file này vào chương trình..." t MSG_134 "Bởi vì MBR được chọn để định dạng phân vùng, Rufus chỉ có thể tạo phân vùng tới 2 TB cho ổ đĩa này, việc này sẽ bỏ phí %s không được sử dung.\n\nBạn có muốn tiếp tục?" t MSG_135 "Phiên bản" t MSG_136 "Phát hành" @@ -16746,7 +16746,7 @@ t MSG_172 "Chữ kí tải xuống không hợp lệ" t MSG_173 "Nhấn để chọn..." t MSG_174 "Rufus - Tiện ích Định dạng USB Đáng tin cậy" t MSG_175 "Phiên bản %d.%d (Bản dựng %d)" -t MSG_176 "Bản dịch Tiếng Việt:\\line• thanhtai2009 <mailto:thanhtai2009@outlook.com>\\line• caobach <mailto:caobach@gmail.com>\\line• Nguyễn Quang Minh (MinhNQ101) <mailto:admin@quangminh.name.vn>" +t MSG_176 "Bản dịch Tiếng Việt:\\line• thanhtai2009 <mailto:thanhtai2009@outlook.com>\\line• caobach <mailto:caobach@gmail.com>\\line• Nguyễn Quang Minh (MinhNQ101) <mailto:admin@quangminh.name.vn>\\line• Trần Thái An <mailto:igl.antrnn@gmail.com>" t MSG_177 "Báo lỗi hoặc yêu cầu cải tiến tại:" t MSG_178 "Các bản quyền bổ sung:" t MSG_179 "Chính sách cập nhật:" @@ -16877,7 +16877,7 @@ t MSG_304 "Tạo file ảnh ổ đĩa từ thiết bị được chọn" t MSG_305 "Sử dụng tùy chọn này để chỉ thị rằng hoặc bạn muốn cài Windows lên một ổ đĩa khác, hoặc nếu bạn muốn chạy Windows trực tiếp từ thiết bị này (Windows To Go)." t MSG_306 "Đang ghi đè nhanh giá trị 0 lên ổ đĩa: %s" t MSG_307 "điều này có thể mất một thời gian" -t MSG_308 "phát hiện VHD" +t MSG_308 "Phát hiện VHD" t MSG_309 "Lưu trữ đã nén" t MSG_310 "ISO bạn đã chọn sử dụng UEFI và đủ nhỏ để ghi dưới dạng Phân vùng hệ thống EFI (ESP). Ghi vào một ESP, thay vì ghi vào một phân vùng dữ liệu chung chiếm toàn bộ đĩa, có thể thích hợp hơn đối với một số loại cài đặt.\n\nVui lòng chọn chế độ mà bạn muốn sử dụng để viết hình ảnh này:" t MSG_311 "Sử dụng %s (tại cửa sổ chính của phần mềm) để thực thi." @@ -16892,8 +16892,11 @@ t MSG_319 "Bỏ qua đánh dấu khởi động" t MSG_320 "Đang làm mới bố cục phân vùng (%s)..." t MSG_321 "Hình ảnh bạn đã chọn là một ISOHybrid, nhưng những người tạo ra nó đã không làm cho nó tương thích với chế độ sao chép ISO/Tệp.\nDo đó, chế độ ghi hình ảnh DD sẽ được thực thi." t MSG_322 "Không thể mở hoặc đọc '%s'" +t MSG_323 "Áp dụng SkuSiPolicy.p7b trong khi cài đặt (Xem KB5042562)" +t MSG_324 "Những cải \"QoL\" (Không ép buộc Copilot, OneDrive, Outlook, Khởi động Nhanh, v.v.)" t MSG_325 "Đang áp dụng tuỳ biến Windows: %s" t MSG_326 "Đang áp dụng các cài đặt người dùng..." +t MSG_327 "Trải nghiệm Người dùng Windows" t MSG_328 "Tuỳ biến cài đặt Windows?" t MSG_329 "Loại bỏ yêu cầu 4GB+ RAM, Secure Boot và TPM 2.0" t MSG_330 "Loại bỏ yêu cầu tài khoản Microsoft trực tuyến" @@ -16903,7 +16906,7 @@ t MSG_333 "Tạo tài khoản nội bộ với tên người dùng:" t MSG_334 "Đặt các cài đặt địa phương cùng giá trị với người dùng hiện tại" t MSG_335 "Vô hiệu tự động mã hoá thiết bị BitLocker" t MSG_336 "Nhật ký lưu vĩnh viễn" -t MSG_337 "Một tệp tin bổ sung ('%s') từ Microsoft để sử dụng tính năng này:\n- Chọn 'Có' để kết nối tới Internet và tải nó xuống\n- Chọn 'Không' để huỷ tiến trình\n\nGhi chú: Tệp tin sẽ được tải xuống tại đường dẫn của phần mềm và sẽ được tự động tái sử dụng nếu có sẵn." +t MSG_337 "Một tệp tin bổ sung ('%s') cần được tải xuống từ Microsoft để sử dụng tính năng này:\n- Chọn 'Có' để kết nối tới Internet và tải nó xuống\n- Chọn 'Không' để huỷ tiến trình\n\nGhi chú: Tệp tin sẽ được tải xuống tại đường dẫn của phần mềm và sẽ được tự động tái sử dụng nếu có sẵn." t MSG_338 "Đã phát hiện bộ khởi động UEFI bị thu hồi" t MSG_339 "Rufus đã phát hiện ra rằng tệp ISO bạn đã chọn có chứa một bộ khởi động UEFI đã bị thu hồi và nó sẽ tạo ra %s, khi Secure Boot được kích hoạt trên một hệ thống UEFI được cập nhật đầy đủ và mới nhất.\n\n- Nếu bạn sở hữu tệp ISO này từ một nguồn không đáng tin cậy, bạn nên cân nhắc khả năng có thể chứa mã độc UEFI và tránh khởi động từ nó.\n- Nếu bạn sở hữu từ một nguồn uy tín, bạn nên thử tìm một bản mới hơn, theo đó cảnh báo này sẽ không hiện ra." t MSG_340 "một màn hình \"Vi phạm Bảo mật\"" @@ -16916,11 +16919,27 @@ t MSG_346 "Giới hạn Windows vào S-Mode (KHÔNG TƯƠNG THÍCH với việc t MSG_347 "Chế độ Chuyên nghiệp" t MSG_348 "Đang giải nén tệp lưu trữ: %s" t MSG_349 "Sử dụng Rufus MBR" -t MSG_350 "Sử dụng bootloader đã được ký bởi chứng chỉ “Windows UEFI CA 2023” (TÍNH NĂNG THỬ NGHIỆM)" +t MSG_350 "Sử dụng bootloader đã được ký bởi chứng chỉ “Windows UEFI CA 2023” (Cần có PC tương thích)" t MSG_351 "Đang kiểm tra trạng thái thu hồi của bootloader UEFI..." t MSG_352 "Đang kiểm tra cập nhật cơ sở dữ liệu chặn (DBX) của UEFI…" t MSG_353 "Đã phát hiện bản cập nhật DBX của UEFI" t MSG_354 "Rufus đã phát hiện phiên bản cập nhật của các tệp DBX, được dùng để kiểm tra thu hồi Secure Boot trong UEFI. Bạn có muốn tải bản cập nhật này không?\n- Chọn “Có” để kết nối Internet và tải nội dung này.\n- Chọn “Không” để hủy thao tác.\n\nLưu ý: Các tệp sẽ được tải về thư mục của ứng dụng và sẽ tự động được sử dụng lại nếu đã có sẵn." +t MSG_355 "Xoá sạch ổ cứng và cài đặt ⚠MỘT CÁCH ÂM THẦM⚠:" +t MSG_356 "Bạn đã lựa chọn phương thức cài đặt Windows \"im lặng\".\n\nĐây là một tuỳ chọn nâng cao, dành riêng cho những người muốn tạo một bản cài đặt không thông báo cho người dung xuyên suốt quá trình cài đặt Windows và qua đó XOÁ SẠCH VÔ ĐIỀU KIỆN ổ đĩa được nhận diện đầu tiên. Nếu bạn không cẩn than, sử dụng tuỳ chọn nào có thể gây ra MẤT HOÀN TOÀN DỮ LIỆU\n\nNếu đó không phải thứ bạn muốn, vui long chọn 'Không' để quay trở lại và huỷ chọn tuỳ chọn đó.\nThay vào đó, nếu bạn chọn 'Có', bạn chấp thuận rằng mọi trách nhiệm về dữ liệu bị mất hoàn toàn thuộc về BẠN." +t MSG_358 "Vị trí tập tin ảnh đĩa không được hỗ trợ" +t MSG_359 "Bạn không thể sử dụng một ảnh đĩa nằm trên thiết bị mục tiêu, vì thiết bị đó sẽ bị xoá hoàn toàn. Nó giống như việc bạn tự chặt cành cây mà bạn đang đứng lên vậy!\n\nVui lòng di chuyển ảnh đĩa tới một vị trí khác và thử lại." +t MSG_360 "Việc bật tuỳ chọn này là hoàn toàn an toàn kể cả khi bạn có TPM hay nhiều RAM hơn, vì tuỳ chọn này chỉ bỏ qua nhừng yêu cầu cài đặt và không ngăn Windows sử dụng mọi tài nguyên phần cứng có thể." +t MSG_361 "Để tuỳ chọn này có hiệu quả, các mạng PHẢI được ngắt kết nối trong quá trình cài đặt!" +t MSG_362 "Tự động trả lời 'không' cho những câu hỏi liên quan tới việc chia sẻ dữ liệu cho Microsoft, thay vì thông báo cho người dùng." +t MSG_363 "Bạn nên để tuỳ chọn này ở mức 'Bật', trừ khi bạn ổn với việc Windows To Go truy cập vào các thiết bị nội bộ và âm thầm tạo ra những bản cập nhật hệ thống không thể hoàn tác." +t MSG_364 "Tự động tạo một tài khoản nội bộ với tên người dùng đã nêu, cùng một mật khẩu rỗng sẽ cần phải thay đổi trong lần đăng nhập tiếp theo." +t MSG_365 "Sao chép những cài đặt về vùng từ PC này (bàn phím, múi giờ, đơn vị), thay vì thông báo cho người dùng." +t MSG_366 "Không mã hoá ổ đĩa hệ thống, trừ khi được người dùng đích danh yêu cầu." +t MSG_367 "Chỉ sử dụng tuỳ chọn này khi bạn biết S-Mode là gì và bạn hiểu rằng hệ thống của bạn có thể bị khoá ở S-Mode kể cả khi bạn xoá sạch và cài đặt lại Windows." +t MSG_368 "Dùng tuỳ chọn này nếu hệ thống bạn muốn cài đặt Windows đang sử dụng những chứng chỉ Secure Boot (chế độ khởi động bảo mật) mới nhất. Nếu cần thiết, bạn có thể tìm hiểu việc dùng 'Mosby' để cập nhật hệ thống của bạn." +t MSG_369 "Dùng tuỳ chọn này nếu bạn muốn thu hồi những trình khởi động Windows có nguy cơ, nhưng cũng có khả năng ngăn ảnh đĩa Windows cơ bản khởi động." +t MSG_370 "Những nâng cấp \"tiện ích trải nghiệm\": Vô hiệu hoá đa số những tính năng không mong muốn Microsoft đang cố nhồi nhét cho người dùng." +t MSG_371 "Nếu bạn sử dụng tuỳ chọn này, hãy chắc chắn rằng bạn đã ngắt kết nối tất cả các ổ đĩa khỏi PC đích, ngoại trừ ổ bạn muốn cài Windows, cũng như là không cắm ảnh đĩa vào bất kì PC nào bạn không muốn xoá sạch." t MSG_900 "Rufus là một tiện ích giúp định dạng và tạo khả năng khởi động cho các thiết bị USB, ví dụ như thẻ USB/đĩa di động, thẻ nhớ, v.v..." t MSG_901 "Trang web chính thức: %s" t MSG_902 "Mã nguồn: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 0d7c33ec..74a23d9a 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.14.2372" +CAPTION "Rufus 4.14.2373" 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,14,2372,0 - PRODUCTVERSION 4,14,2372,0 + FILEVERSION 4,14,2373,0 + PRODUCTVERSION 4,14,2373,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.14.2372" + VALUE "FileVersion", "4.14.2373" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2372" + VALUE "ProductVersion", "4.14.2373" END END BLOCK "VarFileInfo" From fa3c942434d0f4d2c5623089628be2729ff13749 Mon Sep 17 00:00:00 2001 From: Andrei Ilas <ilas.andrei99@gmail.com> Date: Mon, 27 Apr 2026 18:02:40 +0100 Subject: [PATCH 183/192] [loc] update Romanian translation to latest --- res/loc/po/ro-RO.po | 182 ++++++++++++++++++++++++++++++++++++-------- res/loc/rufus.loc | 54 +++++++++---- src/rufus.rc | 10 +-- 3 files changed, 194 insertions(+), 52 deletions(-) diff --git a/res/loc/po/ro-RO.po b/res/loc/po/ro-RO.po index d02a28bb..5e8e0046 100644 --- a/res/loc/po/ro-RO.po +++ b/res/loc/po/ro-RO.po @@ -1,11 +1,11 @@ msgid "" msgstr "" -"Project-Id-Version: 4.5\n" +"Project-Id-Version: 4.14\n" "Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2024-04-25 21:23+0300\n" -"PO-Revision-Date: 2024-04-25 22:00+0300\n" +"POT-Creation-Date: 2026-04-27 17:51+0100\n" +"PO-Revision-Date: 2026-04-27 17:56+0100\n" "Last-Translator: \n" -"Language-Team: \n" +"Language-Team: Andrei Ilas\n" "Language: ro_RO\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -13,7 +13,7 @@ msgstr "" "X-Poedit-SourceCharset: UTF-8\n" "X-Rufus-LanguageName: Romanian (Română)\n" "X-Rufus-LCID: 0x0418, 0x0818\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.9\n" #. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT msgid "Drive Properties" @@ -308,7 +308,7 @@ msgstr "" #. • MSG_025 #. -#. *Short* version of the pentabyte size suffix +#. *Short* version of the petabyte size suffix msgid "PB" msgstr "" @@ -846,7 +846,7 @@ msgstr "Fără persistență" #. • MSG_125 #. -#. Tooltips used for the peristence size slider and edit control +#. Tooltips used for the persistence size slider and edit control msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." msgstr "Setați dimensiunea partiției persistente pentru dispozitivul USB live. Setarea mărimii la 0 va dezactiva partiția persistentă." @@ -888,13 +888,13 @@ msgstr "Un alt program sau proces utilizează această unitate. Doriți să o fo #. • MSG_133 msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" "\n" "Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" "\n" "Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." msgstr "" -"Rufus a observat că încercați să creați un media Windows To Go bazat pe un ISO cu versiunea 1809.\n" +"Rufus a observat că încercați să creați un media 'Windows To Go' bazat pe un ISO cu versiunea 1809.\n" "\n" "Din cauza unui *BUG MICROSOFT*, acest media va eșua în timpul pornirii Windows (Blue Screen Of Death), cu excepția cazului în care înlocuiți manual fișierul 'WppRecorder.sys' cu o versiune 1803.\n" "\n" @@ -1793,7 +1793,15 @@ msgstr "" #. • MSG_322 msgid "Unable to open or read '%s'" -msgstr "Nu se poate deschide sau citii '%s'" +msgstr "Nu se poate deschide sau citi '%s'" + +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Aplică SkuSiPolicy.p7b la instalare (Vezi KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Îmbunătățiri QoL (Fără Copilot, OneDrive, Outlook, pornire rapidă forțată, etc.)" #. • MSG_325 msgid "Applying Windows customization: %s" @@ -1801,7 +1809,7 @@ msgstr "Aplicând modificări la Windows: %s" #. • MSG_326 msgid "Applying user options..." -msgstr "Aplicând optiuni de utilizator..." +msgstr "Aplicând opțiuni de utilizator..." #. • MSG_327 msgid "Windows User Experience" @@ -1813,7 +1821,7 @@ msgstr "Doriți să modificați instalația de Windows?" #. • MSG_329 msgid "Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0" -msgstr "Elimină necesitatea de 4GB+ RAM, Bootare Securizată si TPM 2.0" +msgstr "Elimină necesitatea de 4GB+ RAM, Bootare Securizată și TPM 2.0" #. • MSG_330 msgid "Remove requirement for an online Microsoft account" @@ -1821,7 +1829,7 @@ msgstr "Elimină necesitatea pentru un cont Microsoft" #. • MSG_331 msgid "Disable data collection (Skip privacy questions)" -msgstr "Blochează colectarea de date (Sari peste întrebările de intimitate)" +msgstr "Dezactivează colectarea de date (Sari peste întrebările de confidențialitate)" #. • MSG_332 msgid "Prevent Windows To Go from accessing internal disks" @@ -1829,11 +1837,11 @@ msgstr "Blochează Windows To Go de la accesarea discurilor interne" #. • MSG_333 msgid "Create a local account with username:" -msgstr "Crează un cont local cu nume de utilizator:" +msgstr "Creează un cont local cu nume de utilizator:" #. • MSG_334 msgid "Set regional options to the same values as this user's" -msgstr "Serează opțiunile regionale să aibă aceleași valori ca acestui utilizator" +msgstr "Setează opțiunile regionale să aibă aceleași valori ca ale acestui utilizator" #. • MSG_335 msgid "Disable BitLocker automatic device encryption" @@ -1845,17 +1853,17 @@ msgstr "Logare persistentă" #. • MSG_337 msgid "" -"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\n" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation\n" "\n" "Note: The file will be downloaded in the application's directory and will be reused automatically if present." msgstr "" -"Un fișier adițional ('diskcopy.dll') trebuie să fie descărcat de la Microsoft pentru a instala MS-DOS:\n" -"- Selectează 'Da' ca să te conectezi la Internet și să le descarci\n" -"- Selectează 'Nu' pentru a anula operațiunea\n" +"Un fișier suplimentar ('%s') trebuie descărcat de la Microsoft pentru a utiliza această funcție:\n" +"- Selectați 'Da' pentru a vă conecta la Internet și a-l descărca\n" +"- Selectați 'Nu' pentru a anula operațiunea\n" "\n" -"Notiță: Acest fișier va fi descărcat in aceeași locație cu aplicația și va fi reutilizat automat dacă este prezent." +"Notă: Fișierul va fi descărcat în directorul aplicației și va fi reutilizat automat dacă este prezent." #. • MSG_338 msgid "Revoked UEFI bootloader detected" @@ -1868,10 +1876,10 @@ msgid "" "- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\n" "- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning." msgstr "" -"Rufus a detectat că fișierul ISO care lai selectat conține un bootloader UEFI care nu este permis si ar produce %s, cand Secure Boot este activat pe un system UEFI actualizat.\n" +"Rufus a detectat că fișierul ISO selectat conține un bootloader UEFI care a fost revocat și care va produce %s, când Secure Boot este activat pe un sistem UEFI complet actualizat.\n" "\n" -"- Dacă ai făcut rost de aceasta imagine ISO de la o sursă de neîncredere, este recomandat să consideri posibilitatea că ar putea conține malware UEFI ce nu ar permite pornirea de la aceasta.\n" -"- Dacă ai făcut rost de aceasta de la o sursă de încredere, ar putea fi necesară căutarea unei versiuni mai noi, care nu ar produce acest avertisment." +"- Dacă ați obținut această imagine ISO dintr-o sursă nesigură, luați în considerare posibilitatea că ar putea conține malware UEFI și evitați pornirea de pe aceasta.\n" +"- Dacă ați obținut-o dintr-o sursă de încredere, încercați să găsiți o versiune mai recentă, care să nu producă acest avertisment." #. • MSG_340 msgid "a \"Security Violation\" screen" @@ -1899,9 +1907,9 @@ msgid "" "- Select 'Yes' to connect to the Internet and download it\n" "- Select 'No' to cancel the operation" msgstr "" -"Niște date adiționale trebuie descărcate de la Microsoft pentru a folosii această funție:\n" -"- Selectează 'Da' ca să te conectezi la Internet și să le descarci\n" -"- Selectează 'Nu' pentru a anula operațiunea" +"Unele date suplimentare trebuie descărcate de la Microsoft pentru a folosi această funcție:\n" +"- Selectați 'Da' pentru a vă conecta la Internet și a le descărca\n" +"- Selectați 'Nu' pentru a anula operațiunea" #. • MSG_346 msgid "Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)" @@ -1919,6 +1927,118 @@ msgstr "Extractând fișiere arhivate: %s" msgid "Use Rufus MBR" msgstr "Folosește Rufus MBR" +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Folosește bootloadere semnate cu 'Windows CA 2023' (necesită un PC compatibil)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Se verifică revocarea bootloaderului UEFI..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Se verifică actualizările DBX UEFI..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "Actualizare DBX disponibilă" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus a găsit o versiune actualizată a fișierelor DBX folosite pentru verificările de revocare Secure Boot UEFI. Doriți să descărcați această actualizare?\n" +"- Selectați „Da” pentru a vă conecta la internet și a descărca acest conținut\n" +"- Selectați „Nu” pentru a anula operațiunea\n" +"\n" +"Notă: Fișierele vor fi descărcate în directorul aplicației și vor fi reutilizate automat, dacă există." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠ȘTERGE SILENȚIOS⚠ discul și instalează:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes', you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Ați selectat opțiunea de instalare Windows \"silențioasă\".\n" +"\n" +"Aceasta este o opțiune avansată, rezervată persoanelor care doresc să creeze suporturi media care nu solicită utilizatorilor informații în timpul instalării Windows și, prin urmare, ȘTERGE NECONDIȚIONAT primul disc detectat pe sistemul țintă. Dacă nu sunteți atenți, utilizarea acestei opțiuni poate duce la PIERDERI IREVERSIBILE DE DATE!\n" +"\n" +"Dacă acest lucru nu este ceea ce doriți, selectați „Nu” pentru a reveni și a debifa opțiunea.\n" +"În caz contrar, dacă selectați „Da”, sunteți de acord că întreaga responsabilitate pentru orice pierdere de date vă va aparține în întregime." + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Locație imagine neacceptată" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Nu puteți folosi o imagine aflată pe unitatea țintă, deoarece acea unitate va fi complet ștearsă. Este același lucru cu încercarea de a tăia creanga pe care stai!\n" +"\n" +"Mută imaginea într-o altă locație și încearcă din nou." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Este sigur să lăsați această opțiune activată chiar dacă aveți un TPM sau mai multă memorie RAM, deoarece aceasta ocolește doar cerințele de configurare și nu împiedică Windows să utilizeze tot hardware-ul disponibil." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Pentru ca această opțiune să funcționeze, rețeaua/Internetul TREBUIE să fie deconectat în timpul instalării!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Răspunde automat cu 'Nu' la întrebările de instalare Windows legate de partajarea datelor cu Microsoft, în loc să întrebe utilizatorul." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Lăsați această opțiune activată dacă nu doriți ca 'Windows To Go' să acceseze discurile interne și să efectueze actualizări ireversibile ale sistemului de fișiere fără avertizare." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Creează automat un cont local cu numele de utilizator specificat, folosind o parolă goală care va trebui schimbată la prima autentificare." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Preia setările regionale de pe acest PC (tastatură, fus orar, monedă), în loc să întrebe utilizatorul." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Nu cripta discul de sistem, cu excepția cazului în care utilizatorul solicită explicit acest lucru." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Folosiți această opțiune doar dacă știți ce este S-Mode și acceptați că sistemul poate rămâne blocat în S-Mode chiar și după reinstalarea completă a Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Folosiți această opțiune dacă sistemul pe care intenționați să instalați Windows utilizează certificate Secure Boot complet actualizate. Dacă este necesar, puteți folosi 'Mosby' pentru a actualiza sistemul." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Folosiți această opțiune pentru a revoca bootloadere Windows potențial nesigure suplimentare, cu riscul de a împiedica și pornirea suporturilor Windows standard." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Îmbunătățiri \"Quality of Life\": Dezactivează majoritatea funcțiilor nedorite pe care Microsoft încearcă să le impună utilizatorilor finali." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Dacă folosiți această opțiune, asigurați-vă că deconectați toate discurile de la computerul țintă, cu excepția celui pe care doriți să instalați Windows, și nu lăsați suportul conectat la niciun computer pe care nu doriți să îl ștergeți." + #. • MSG_900 #. #. The following messages are for the Windows Store listing only and are not used by the application @@ -1927,11 +2047,11 @@ msgstr "Rufus este un utilitar care ajută la formatarea și crearea de drive-ur #. • MSG_901 msgid "Official site: %s" -msgstr "Site official: %s" +msgstr "Site oficial: %s" #. • MSG_902 msgid "Source Code: %s" -msgstr "Codul Sursei: %s" +msgstr "Cod sursă: %s" #. • MSG_903 msgid "ChangeLog: %s" @@ -1945,14 +2065,14 @@ msgid "" "This application is licensed under the terms of the GNU Public License (GPL) version 3.\n" "See https://www.gnu.org/licenses/gpl-3.0.en.html for details." msgstr "" -"Această aplicație este sub liciența și termenii și condițiile ale lui GNU Public License (GPL) versiunea a 3-a.\n" -"Vazi https://www.gnu.org/licenses/gpl-3.0.en.html pentru detalii." +"Această aplicație este licențiată conform termenilor GNU Public License (GPL) versiunea 3.\n" +"Vezi https://www.gnu.org/licenses/gpl-3.0.en.html pentru detalii." #. • MSG_905 #. #. Keyword for "boot" will be used for search in the Windows Store msgid "Boot" -msgstr "Bootează" +msgstr "" #. • MSG_910 #. diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 57dcc025..a4866c3a 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -30,7 +30,7 @@ # • v4.14 "pl-PL" "Polish (Polski)" # • v4.14 "pt-BR" "Portuguese Brazilian (Português do Brasil)" # • v4.14 "pt-PT" "Portuguese Standard (Português)" -# • v4.5 "ro-RO" "Romanian (Română)" +# • v4.14 "ro-RO" "Romanian (Română)" # • v4.14 "ru-RU" "Russian (Русский)" # • v4.14 "sr-RS" "Serbian (Srpski)" # • v4.14 "sk-SK" "Slovak (Slovensky)" @@ -12139,7 +12139,7 @@ t MSG_922 "Descarregar ISOs de UEFI Shell" ######################################################################### l "ro-RO" "Romanian (Română)" 0x0418, 0x0818 -v 4.5 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -12325,7 +12325,7 @@ t MSG_129 "Tocmai ați creat un media care utilizează bootloader-ul UEFI:NTFS. t MSG_130 "Selectare imagine Windows" t MSG_131 "Acest ISO conține mai multe imagini Windows.\nVă rugăm să selectați imaginea pe care doriți să o utilizați pentru această instalare:" t MSG_132 "Un alt program sau proces utilizează această unitate. Doriți să o formatați oricum?" -t MSG_133 "Rufus a observat că încercați să creați un media Windows To Go bazat pe un ISO cu versiunea 1809.\n\nDin cauza unui *BUG MICROSOFT*, acest media va eșua în timpul pornirii Windows (Blue Screen Of Death), cu excepția cazului în care înlocuiți manual fișierul 'WppRecorder.sys' cu o versiune 1803.\n\nDe asemenea, rețineți că motivul pentru care Rufus nu poate remedia automat acest lucru pentru dvs. este că 'WppRecorder.sys' este un fișier Microsoft protejat prin drepturi de autor, deci nu putem încorpora în mod legal o copie a fișierului în aplicație..." +t MSG_133 "Rufus a observat că încercați să creați un media 'Windows To Go' bazat pe un ISO cu versiunea 1809.\n\nDin cauza unui *BUG MICROSOFT*, acest media va eșua în timpul pornirii Windows (Blue Screen Of Death), cu excepția cazului în care înlocuiți manual fișierul 'WppRecorder.sys' cu o versiune 1803.\n\nDe asemenea, rețineți că motivul pentru care Rufus nu poate remedia automat acest lucru pentru dvs. este că 'WppRecorder.sys' este un fișier Microsoft protejat prin drepturi de autor, deci nu putem încorpora în mod legal o copie a fișierului în aplicație..." t MSG_134 "Deoarece MBR a fost selectat pentru schema de partiționare, Rufus poate crea doar o partiție de până la 2 TB pe acest suport media, ceea ce va lăsa %s spațiu de disc indisponibil.\n\nSigur doriți să continuați?" t MSG_135 "Versiune" t MSG_136 "Lansare" @@ -12511,38 +12511,60 @@ t MSG_318 "Prioritate implicită pentru firul de execuție: %d" t MSG_319 "Ignorare Boot Marker" t MSG_320 "Se reîmprospătează așezarea partițiilor (%s)..." t MSG_321 "Imaginea selectată este de tip ISOHybrid, însă creatorii acesteia nu au făcut-o să fie compatibilă cu modul ISO/Copiere fișiere.\nDrept urmare, modul imagine DD va fi aplicat." -t MSG_322 "Nu se poate deschide sau citii '%s'" +t MSG_322 "Nu se poate deschide sau citi '%s'" +t MSG_323 "Aplică SkuSiPolicy.p7b la instalare (Vezi KB5042562)" +t MSG_324 "Îmbunătățiri QoL (Fără Copilot, OneDrive, Outlook, pornire rapidă forțată, etc.)" t MSG_325 "Aplicând modificări la Windows: %s" -t MSG_326 "Aplicând optiuni de utilizator..." +t MSG_326 "Aplicând opțiuni de utilizator..." t MSG_327 "Experiența utilizatorului de Windows" t MSG_328 "Doriți să modificați instalația de Windows?" -t MSG_329 "Elimină necesitatea de 4GB+ RAM, Bootare Securizată si TPM 2.0" +t MSG_329 "Elimină necesitatea de 4GB+ RAM, Bootare Securizată și TPM 2.0" t MSG_330 "Elimină necesitatea pentru un cont Microsoft" -t MSG_331 "Blochează colectarea de date (Sari peste întrebările de intimitate)" +t MSG_331 "Dezactivează colectarea de date (Sari peste întrebările de confidențialitate)" t MSG_332 "Blochează Windows To Go de la accesarea discurilor interne" -t MSG_333 "Crează un cont local cu nume de utilizator:" -t MSG_334 "Serează opțiunile regionale să aibă aceleași valori ca acestui utilizator" +t MSG_333 "Creează un cont local cu nume de utilizator:" +t MSG_334 "Setează opțiunile regionale să aibă aceleași valori ca ale acestui utilizator" t MSG_335 "Blochează BitLocker de la encriptarea automată a dispozitivului" t MSG_336 "Logare persistentă" -t MSG_337 "Un fișier adițional ('%s') trebuie să fie descărcat de la Microsoft pentru a utiliza această funcție:\n- Selectează 'Da' ca să te conectezi la Internet și să le descarci\n- Selectează 'Nu' pentru a anula operațiunea\n\nNotiță: Acest fișier va fi descărcat in aceeași locație cu aplicația și va fi reutilizat automat dacă este prezent." +t MSG_337 "Un fișier suplimentar ('%s') trebuie descărcat de la Microsoft pentru a utiliza această funcție:\n- Selectați 'Da' pentru a vă conecta la Internet și a-l descărca\n- Selectați 'Nu' pentru a anula operațiunea\n\nNotă: Fișierul va fi descărcat în directorul aplicației și va fi reutilizat automat dacă este prezent." t MSG_338 "Bootloader UEFI nepermis detectat" -t MSG_339 "Rufus a detectat că fișierul ISO care lai selectat conține un bootloader UEFI care nu este permis si ar produce %s, cand Secure Boot este activat pe un system UEFI actualizat.\n\n- Dacă ai făcut rost de aceasta imagine ISO de la o sursă de neîncredere, este recomandat să consideri posibilitatea că ar putea conține malware UEFI ce nu ar permite pornirea de la aceasta.\n- Dacă ai făcut rost de aceasta de la o sursă de încredere, ar putea fi necesară căutarea unei versiuni mai noi, care nu ar produce acest avertisment." +t MSG_339 "Rufus a detectat că fișierul ISO selectat conține un bootloader UEFI care a fost revocat și care va produce %s, când Secure Boot este activat pe un sistem UEFI complet actualizat.\n\n- Dacă ați obținut această imagine ISO dintr-o sursă nesigură, luați în considerare posibilitatea că ar putea conține malware UEFI și evitați pornirea de pe aceasta.\n- Dacă ați obținut-o dintr-o sursă de încredere, încercați să găsiți o versiune mai recentă, care să nu producă acest avertisment." t MSG_340 "un ecran de \"Încălcare de Securitate\"" t MSG_341 "un ecran de Recuperare Windows (BSOD) cu '%s'" t MSG_342 "Imagine VHDX comprimată" t MSG_343 "Imagine VHD necomprimată" t MSG_344 "Flash complet de imagine de actualizare" -t MSG_345 "Niște date adiționale trebuie descărcate de la Microsoft pentru a folosii această funție:\n- Selectează 'Da' ca să te conectezi la Internet și să le descarci\n- Selectează 'Nu' pentru a anula operațiunea" +t MSG_345 "Unele date suplimentare trebuie descărcate de la Microsoft pentru a folosi această funcție:\n- Selectați 'Da' pentru a vă conecta la Internet și a le descărca\n- Selectați 'Nu' pentru a anula operațiunea" t MSG_346 "Restricționează Windows la S-Mode (INCOMPATIBIL cu bypass-ul pentru un cont online)" t MSG_347 "Mod expert" t MSG_348 "Extractând fișiere arhivate: %s" t MSG_349 "Folosește Rufus MBR" +t MSG_350 "Folosește bootloadere semnate cu 'Windows CA 2023' (necesită un PC compatibil)" +t MSG_351 "Se verifică revocarea bootloaderului UEFI..." +t MSG_352 "Se verifică actualizările DBX UEFI..." +t MSG_353 "Actualizare DBX disponibilă" +t MSG_354 "Rufus a găsit o versiune actualizată a fișierelor DBX folosite pentru verificările de revocare Secure Boot UEFI. Doriți să descărcați această actualizare?\n- Selectați „Da” pentru a vă conecta la internet și a descărca acest conținut\n- Selectați „Nu” pentru a anula operațiunea\n\nNotă: Fișierele vor fi descărcate în directorul aplicației și vor fi reutilizate automat, dacă există." +t MSG_355 "⚠ȘTERGE SILENȚIOS⚠ discul și instalează:" +t MSG_356 "Ați selectat opțiunea de instalare Windows \"silențioasă\".\n\nAceasta este o opțiune avansată, rezervată persoanelor care doresc să creeze suporturi media care nu solicită utilizatorilor informații în timpul instalării Windows și, prin urmare, ȘTERGE NECONDIȚIONAT primul disc detectat pe sistemul țintă. Dacă nu sunteți atenți, utilizarea acestei opțiuni poate duce la PIERDERI IREVERSIBILE DE DATE!\n\nDacă acest lucru nu este ceea ce doriți, selectați „Nu” pentru a reveni și a debifa opțiunea.\nÎn caz contrar, dacă selectați „Da”, sunteți de acord că întreaga responsabilitate pentru orice pierdere de date vă va aparține în întregime." +t MSG_358 "Locație imagine neacceptată" +t MSG_359 "Nu puteți folosi o imagine aflată pe unitatea țintă, deoarece acea unitate va fi complet ștearsă. Este același lucru cu încercarea de a tăia creanga pe care stai!\n\nMută imaginea într-o altă locație și încearcă din nou." +t MSG_360 "Este sigur să lăsați această opțiune activată chiar dacă aveți un TPM sau mai multă memorie RAM, deoarece aceasta ocolește doar cerințele de configurare și nu împiedică Windows să utilizeze tot hardware-ul disponibil." +t MSG_361 "Pentru ca această opțiune să funcționeze, rețeaua/Internetul TREBUIE să fie deconectat în timpul instalării!" +t MSG_362 "Răspunde automat cu 'Nu' la întrebările de instalare Windows legate de partajarea datelor cu Microsoft, în loc să întrebe utilizatorul." +t MSG_363 "Lăsați această opțiune activată dacă nu doriți ca 'Windows To Go' să acceseze discurile interne și să efectueze actualizări ireversibile ale sistemului de fișiere fără avertizare." +t MSG_364 "Creează automat un cont local cu numele de utilizator specificat, folosind o parolă goală care va trebui schimbată la prima autentificare." +t MSG_365 "Preia setările regionale de pe acest PC (tastatură, fus orar, monedă), în loc să întrebe utilizatorul." +t MSG_366 "Nu cripta discul de sistem, cu excepția cazului în care utilizatorul solicită explicit acest lucru." +t MSG_367 "Folosiți această opțiune doar dacă știți ce este S-Mode și acceptați că sistemul poate rămâne blocat în S-Mode chiar și după reinstalarea completă a Windows." +t MSG_368 "Folosiți această opțiune dacă sistemul pe care intenționați să instalați Windows utilizează certificate Secure Boot complet actualizate. Dacă este necesar, puteți folosi 'Mosby' pentru a actualiza sistemul." +t MSG_369 "Folosiți această opțiune pentru a revoca bootloadere Windows potențial nesigure suplimentare, cu riscul de a împiedica și pornirea suporturilor Windows standard." +t MSG_370 "Îmbunătățiri \"Quality of Life\": Dezactivează majoritatea funcțiilor nedorite pe care Microsoft încearcă să le impună utilizatorilor finali." +t MSG_371 "Dacă folosiți această opțiune, asigurați-vă că deconectați toate discurile de la computerul țintă, cu excepția celui pe care doriți să instalați Windows, și nu lăsați suportul conectat la niciun computer pe care nu doriți să îl ștergeți." t MSG_900 "Rufus este un utilitar care ajută la formatarea și crearea de drive-uri USB bootabile, precum cheile sau pendriverele USB, unități de memorie, etc." -t MSG_901 "Site official: %s" -t MSG_902 "Codul Sursei: %s" +t MSG_901 "Site oficial: %s" +t MSG_902 "Cod sursă: %s" t MSG_903 "Listă de schimbări: %s" -t MSG_904 "Această aplicație este sub liciența și termenii și condițiile ale lui GNU Public License (GPL) versiunea a 3-a.\nVazi https://www.gnu.org/licenses/gpl-3.0.en.html pentru detalii." -t MSG_905 "Bootează" +t MSG_904 "Această aplicație este licențiată conform termenilor GNU Public License (GPL) versiunea 3.\nVezi https://www.gnu.org/licenses/gpl-3.0.en.html pentru detalii." t MSG_910 "Formatează USB, card flash si drive-uri virtuale la FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" t MSG_911 "Crează drive USB bootabil FreeDOS" t MSG_912 "Crează drive-uri bootabile de la ISO-uri bootabile (Windows, Linux, etc.)" diff --git a/src/rufus.rc b/src/rufus.rc index 74a23d9a..4873592c 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.14.2373" +CAPTION "Rufus 4.14.2374" 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,14,2373,0 - PRODUCTVERSION 4,14,2373,0 + FILEVERSION 4,14,2374,0 + PRODUCTVERSION 4,14,2374,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.14.2373" + VALUE "FileVersion", "4.14.2374" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2373" + VALUE "ProductVersion", "4.14.2374" END END BLOCK "VarFileInfo" From 611c6a18f8a8994e32deea62bb324923e50c0115 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 29 Apr 2026 17:35:04 +0100 Subject: [PATCH 184/192] [iso] improve GRUB 2.0 bootloader detection * Mostly to avoid 'Image has an unknown Master Boot Record' with Ubuntu. * Also the usual cleanup and GitHub Actions bump. --- .github/workflows/lock.yml | 2 +- ChangeLog.txt | 10 +++++----- src/ms-sys/br.c | 10 +++++++++- src/rufus.rc | 10 +++++----- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 9f85edcf..b2e77d6c 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -9,7 +9,7 @@ jobs: lock: runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@v5 + - uses: dessant/lock-threads@v6 with: github-token: ${{ secrets.GITHUB_TOKEN }} issue-inactive-days: '90' diff --git a/ChangeLog.txt b/ChangeLog.txt index a83698cb..4579128e 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,12 +1,12 @@ o Version 4.14 (2026.04.??) 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 (refer to KB5042562) - - Add tooltips for all the dialog options + - 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 disk partitioning + 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 Fix potential errors during creation of Windows To Go media, due to the use of new versions of bcdboot diff --git a/src/ms-sys/br.c b/src/ms-sys/br.c index c432e422..4fe7d28c 100644 --- a/src/ms-sys/br.c +++ b/src/ms-sys/br.c @@ -180,7 +180,15 @@ int is_grub2_mbr(FILE *fp) #include "mbr_grub2.h" return - contains_data(fp, 0x0, mbr_grub2_0x0, sizeof(mbr_grub2_0x0)) && + contains_data(fp, 0x0, &mbr_grub2_0x0[0x0], 0x2) && + contains_data(fp, 0x64, &mbr_grub2_0x0[0x64], 0x2) && + contains_data(fp, 0x68, &mbr_grub2_0x0[0x68], 0x2c) && + contains_data(fp, 0x96, &mbr_grub2_0x0[0x96], 0x29) && + contains_data(fp, 0xc1, &mbr_grub2_0x0[0xc1], 0x7) && + contains_data(fp, 0xca, &mbr_grub2_0x0[0xca], 0x1f) && + contains_data(fp, 0xeb, &mbr_grub2_0x0[0xeb], 0x2b) && + contains_data(fp, 0x118, &mbr_grub2_0x0[0x118], 0x7) && + contains_data(fp, 0x121, &mbr_grub2_0x0[0x121], sizeof(mbr_grub2_0x0) - 0x121) && is_br(fp); } /* is_grub2_mbr */ diff --git a/src/rufus.rc b/src/rufus.rc index 4873592c..617c017c 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.14.2374" +CAPTION "Rufus 4.14.2375" 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,14,2374,0 - PRODUCTVERSION 4,14,2374,0 + FILEVERSION 4,14,2375,0 + PRODUCTVERSION 4,14,2375,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.14.2374" + VALUE "FileVersion", "4.14.2375" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2374" + VALUE "ProductVersion", "4.14.2375" END END BLOCK "VarFileInfo" From 82d7a30fe7c71f59f9183f338ad8907bac0c7663 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 30 Apr 2026 00:15:49 +0100 Subject: [PATCH 185/192] [iso] improve Isolinux bootloader detection * Mostly to avoid 'Image has an unknown Master Boot Record' with Debian and other Isolinux based distros. --- .vs/ms-sys.vcxproj | 1 + .vs/ms-sys.vcxproj.filters | 3 +++ src/drive.c | 1 + src/ms-sys/br.c | 11 +++++++++++ src/ms-sys/inc/br.h | 4 ++++ src/ms-sys/inc/mbr_isolinux.h | 28 ++++++++++++++++++++++++++++ src/rufus.rc | 10 +++++----- 7 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 src/ms-sys/inc/mbr_isolinux.h diff --git a/.vs/ms-sys.vcxproj b/.vs/ms-sys.vcxproj index 1679bf4f..796de1c8 100644 --- a/.vs/ms-sys.vcxproj +++ b/.vs/ms-sys.vcxproj @@ -73,6 +73,7 @@ <ClInclude Include="..\src\ms-sys\inc\mbr_gpt_syslinux.h" /> <ClInclude Include="..\src\ms-sys\inc\mbr_grub.h" /> <ClInclude Include="..\src\ms-sys\inc\mbr_grub2.h" /> + <ClInclude Include="..\src\ms-sys\inc\mbr_isolinux.h" /> <ClInclude Include="..\src\ms-sys\inc\mbr_kolibri.h" /> <ClInclude Include="..\src\ms-sys\inc\mbr_msg_rufus.h" /> <ClInclude Include="..\src\ms-sys\inc\mbr_reactos.h" /> diff --git a/.vs/ms-sys.vcxproj.filters b/.vs/ms-sys.vcxproj.filters index d8dc4d00..bd8636b5 100644 --- a/.vs/ms-sys.vcxproj.filters +++ b/.vs/ms-sys.vcxproj.filters @@ -158,6 +158,9 @@ <ClInclude Include="..\src\ms-sys\inc\mbr_msg_rufus.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="..\src\ms-sys\inc\mbr_isolinux.h"> + <Filter>Header Files</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <ClCompile Include="..\src\ms-sys\br.c"> diff --git a/src/drive.c b/src/drive.c index 88ae92cb..c7073a93 100644 --- a/src/drive.c +++ b/src/drive.c @@ -1432,6 +1432,7 @@ const struct {int (*fn)(FILE *fp); char* str;} known_mbr[] = { { is_win7_mbr, "Windows 7" }, { is_rufus_mbr, "Rufus" }, { is_syslinux_mbr, "Syslinux" }, + { is_isolinux_mbr, "Isolinux" }, { is_reactos_mbr, "ReactOS" }, { is_kolibrios_mbr, "KolibriOS" }, { is_grub4dos_mbr, "Grub4DOS" }, diff --git a/src/ms-sys/br.c b/src/ms-sys/br.c index 4fe7d28c..ff7b4d44 100644 --- a/src/ms-sys/br.c +++ b/src/ms-sys/br.c @@ -210,6 +210,17 @@ int is_syslinux_mbr(FILE *fp) is_br(fp); } /* is_syslinux_mbr */ +int is_isolinux_mbr(FILE* fp) +{ +#include "mbr_isolinux.h" + + return + contains_data(fp, 0x20, &mbr_isolinux_0x0[0], 0x48) && + (contains_data(fp, 0x80, &mbr_isolinux_0x0[0x60], sizeof(mbr_isolinux_0x0) - 0x60) || + contains_data(fp, 0x82, &mbr_isolinux_0x0[0x60], sizeof(mbr_isolinux_0x0) - 0x60)) && + is_br(fp); +} /* is_isolinux_mbr */ + int is_syslinux_gpt_mbr(FILE *fp) { #include "mbr_gpt_syslinux.h" diff --git a/src/ms-sys/inc/br.h b/src/ms-sys/inc/br.h index 98cc3826..45c53a0f 100644 --- a/src/ms-sys/inc/br.h +++ b/src/ms-sys/inc/br.h @@ -78,6 +78,10 @@ int is_kolibrios_mbr(FILE *fp); FALSE.The file position will change when this function is called! */ int is_syslinux_mbr(FILE *fp); +/* returns TRUE if the file has an isolinux master boot record, otherwise + FALSE.The file position will change when this function is called! */ +int is_isolinux_mbr(FILE* fp); + /* returns TRUE if the file has a syslinux GPT master boot record, otherwise FALSE.The file position will change when this function is called! */ int is_syslinux_gpt_mbr(FILE *fp); diff --git a/src/ms-sys/inc/mbr_isolinux.h b/src/ms-sys/inc/mbr_isolinux.h new file mode 100644 index 00000000..eb1fd113 --- /dev/null +++ b/src/ms-sys/inc/mbr_isolinux.h @@ -0,0 +1,28 @@ +/* This version is found on most Isolinux based distros */ +unsigned char mbr_isolinux_0x0[] = { + 0x33, 0xed, 0xfa, 0x8e, 0xd5, 0xbc, 0x00, 0x7c, 0xfb, 0xfc, 0x66, 0x31, + 0xdb, 0x66, 0x31, 0xc9, 0x66, 0x53, 0x66, 0x51, 0x06, 0x57, 0x8e, 0xdd, + 0x8e, 0xc5, 0x52, 0xbe, 0x00, 0x7c, 0xbf, 0x00, 0x06, 0xb9, 0x00, 0x01, + 0xf3, 0xa5, 0xea, 0x4b, 0x06, 0x00, 0x00, 0x52, 0xb4, 0x41, 0xbb, 0xaa, + 0x55, 0x31, 0xc9, 0x30, 0xf6, 0xf9, 0xcd, 0x13, 0x72, 0x16, 0x81, 0xfb, + 0x55, 0xaa, 0x75, 0x10, 0x83, 0xe1, 0x01, 0x74, 0x0b, 0x66, 0xc7, 0x06, + 0xf1, 0x06, 0xb4, 0x42, 0xeb, 0x15, 0xeb, 0x00, 0x5a, 0x51, 0xb4, 0x08, + 0xcd, 0x13, 0x83, 0xe1, 0x3f, 0x5b, 0x51, 0x0f, 0xb6, 0xc6, 0x40, 0x50, + 0xf7, 0xe1, 0x53, 0x52, 0x50, 0xbb, 0x00, 0x7c, 0xb9, 0x04, 0x00, 0x66, + 0xa1, 0xb0, 0x07, 0xe8, 0x44, 0x00, 0x0f, 0x82, 0x80, 0x00, 0x66, 0x40, + 0x80, 0xc7, 0x02, 0xe2, 0xf2, 0x66, 0x81, 0x3e, 0x40, 0x7c, 0xfb, 0xc0, + 0x78, 0x70, 0x75, 0x09, 0xfa, 0xbc, 0xec, 0x7b, 0xea, 0x44, 0x7c, 0x00, + 0x00, 0xe8, 0x83, 0x00, 0x69, 0x73, 0x6f, 0x6c, 0x69, 0x6e, 0x75, 0x78, + 0x2e, 0x62, 0x69, 0x6e, 0x20, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, + 0x20, 0x6f, 0x72, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x75, 0x70, 0x74, 0x2e, + 0x0d, 0x0a, 0x66, 0x60, 0x66, 0x31, 0xd2, 0x66, 0x03, 0x06, 0xf8, 0x7b, + 0x66, 0x13, 0x16, 0xfc, 0x7b, 0x66, 0x52, 0x66, 0x50, 0x06, 0x53, 0x6a, + 0x01, 0x6a, 0x10, 0x89, 0xe6, 0x66, 0xf7, 0x36, 0xe8, 0x7b, 0xc0, 0xe4, + 0x06, 0x88, 0xe1, 0x88, 0xc5, 0x92, 0xf6, 0x36, 0xee, 0x7b, 0x88, 0xc6, + 0x08, 0xe1, 0x41, 0xb8, 0x01, 0x02, 0x8a, 0x16, 0xf2, 0x7b, 0xcd, 0x13, + 0x8d, 0x64, 0x10, 0x66, 0x61, 0xc3, 0xe8, 0x1e, 0x00, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x2e, 0x0d, 0x0a, 0x5e, 0xac, 0xb4, 0x0e, 0x8a, 0x3e, 0x62, 0x04, 0xb3, + 0x07, 0xcd, 0x10, 0x3c, 0x0a, 0x75, 0xf1, 0xcd, 0x18, 0xf4, 0xeb, 0xfd +}; diff --git a/src/rufus.rc b/src/rufus.rc index 617c017c..3b3b3484 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.14.2375" +CAPTION "Rufus 4.14.2376" 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,14,2375,0 - PRODUCTVERSION 4,14,2375,0 + FILEVERSION 4,14,2376,0 + PRODUCTVERSION 4,14,2376,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.14.2375" + VALUE "FileVersion", "4.14.2376" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2375" + VALUE "ProductVersion", "4.14.2376" END END BLOCK "VarFileInfo" From f53ee063b64986d88a65b25fec13667a01834013 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 30 Apr 2026 11:44:05 +0100 Subject: [PATCH 186/192] Rufus 4.14 (Build 2377) --- ChangeLog.txt | 3 ++- res/appstore/listing/listing.csv | 37 +++++++++++++++++++++----------- res/loc/rufus.loc | 2 ++ src/rufus.rc | 10 ++++----- 4 files changed, 33 insertions(+), 19 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 4579128e..f49392a5 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,4 +1,4 @@ -o Version 4.14 (2026.04.??) +o Version 4.14 (2026.04.30) 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 @@ -9,6 +9,7 @@ o Version 4.14 (2026.04.??) 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 diff --git a/res/appstore/listing/listing.csv b/res/appstore/listing/listing.csv index c9fedf99..2880ae7f 100644 --- a/res/appstore/listing/listing.csv +++ b/res/appstore/listing/listing.csv @@ -77,12 +77,12 @@ • Zmiany: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus é um utilitário que ajuda a formatar e a criar unidades flash USB inicializáveis, tais como pendrives USB, cartões de memória, etc. • Site oficial: https://rufus.ie • Código fonte: https://github.com/pbatard/rufus -• Registro de alterações: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus é um utilitário que ajuda a formatar e a criar unidades USB inicializáveis, tais como dispositivos USB/pendrives, cartões de memória, etc. -• Site oficial: https://rufus.ie +• Registro de alterações: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","O Rufus é um utilitário que ajuda a formatar e a criar unidades USB inicializáveis, tais como dispositivos USB/pendrives, cartões de memória, etc. +• Página oficial: https://rufus.ie • Código fonte: https://github.com/pbatard/rufus • Alterações: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus este un utilitar care ajută la formatarea și crearea de drive-uri USB bootabile, precum cheile sau pendriverele USB, unități de memorie, etc. -• Site official: https://rufus.ie -• Codul Sursei: https://github.com/pbatard/rufus +• Site oficial: https://rufus.ie +• Cod sursă: https://github.com/pbatard/rufus • Listă de schimbări: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus - это утилита для форматирования и создания загрузочных флеш-накопителей USB. • Официальный сайт: https://rufus.ie • Исходный код: https://github.com/pbatard/rufus @@ -114,8 +114,19 @@ • 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","• Fix UEFI:NTFS not selecting the proper driver for ARM/ARM64 -• Update embedded GRUB to v2.14",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"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",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "Title","4","Text","Rufus",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "ShortTitle","5","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "SortTitle","6","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, @@ -150,8 +161,8 @@ Se https://www.gnu.org/licenses/gpl-3.0.html for mer informasjon.","این بر برای جزئیات به https://www.gnu.org/licenses/gpl-3.0.html مراجعه کنید.","Ta aplikacja jest objęta licencją na warunkach licencji publicznej GNU (GPL) w wersji 3. Z obacz https://www.gnu.org/licenses/gpl-3.0.html, aby uzyskać szczegółowe informacje.","Este software está licenciado sob os termos da GNU Public License (GPL) versão 3. Consulte https://www.gnu.org/licenses/gpl-3.0.pt-br.html para mais detalhes.","Este software está licenciado sob os termos da GNU Public License (GPL) versão 3. -Consulte https://www.gnu.org/licenses/gpl-3.0.html para mais detalhes.","Această aplicație este sub liciența și termenii și condițiile ale lui GNU Public License (GPL) versiunea a 3-a. -Vazi https://www.gnu.org/licenses/gpl-3.0.en.html pentru detalii.","Это приложение распространяется по лицензии GNU Public License (GPL) версии 3. +Consulte https://www.gnu.org/licenses/gpl-3.0.html para mais detalhes.","Această aplicație este licențiată conform termenilor GNU Public License (GPL) versiunea 3. +Vezi https://www.gnu.org/licenses/gpl-3.0.en.html pentru detalii.","Это приложение распространяется по лицензии GNU Public License (GPL) версии 3. Подробнее см. https://www.gnu.org/licenses/gpl-3.0.ru.html.","Ova aplikacija je licencirana pod uslovima GNU Javne licence (GPL) verzije 3. Pogledajte https://www.gnu.org/licenses/gpl-3.0.en.html za više informacija.","Táto aplikácia je licencovaná podľa podmienok GNU Public License (GPL) verzia 3. Podrobnosti nájdete na https://www.gnu.org/licenses/gpl-3.0.html.","Ta aplikacija je licencirana pod pogoji GNU Javne licence (GPL) različice 3. @@ -256,7 +267,7 @@ Xem tại https://www.gnu.org/licenses/gpl-3.0.html để biết thêm chi tiế "OptionalPromo358x358","611","Relative path (or URL to file in Partner Center)","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "OptionalPromo1000x800","612","Relative path (or URL to file in Partner Center)","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "OptionalPromo414x180","613","Relative path (or URL to file in Partner Center)","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -"Feature1","700","Text","","Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","تهيئة USB وبطاقة الفلاش ومحركات الأقراص الافتراضية إلى FAT / FAT32 / NTFS / UDF / exFAT / ReFS / ext2 / ext3","Форматиране на USB, карти памет и виртуални устройства с FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","将 U 盘、存储卡或虚拟驱动器格式化为 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 格式","將隨身碟、記憶卡或虛擬光碟機格式化為 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 格式","Formatirajte USB, flash karticu i virtualne pogone na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formátování USB, flash karet a virtuálních jednotek na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formater USB, flash kort og virtuelle drev til FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","USB, flashkaart en virtuele schijven formatteren naar FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Alusta USB-asemia, muistikortteja ja virtuaalisia asemia muotoon FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatez des périphériques USB, des cartes flash et des disques virtuels en FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatieren von USB, Flash-Karte und virtuellen Laufwerken in FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Μορφοποίηση USB, κάρτας flash και εικονικών μονάδων δίσκου σε FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","אתחול USB, כרטיסי זיכרון וכוננים וירטואליים ל־FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","USB, flash memóriakártyák és virtuális meghajtók formázása FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 fájlrendszerre","Format USB, kartu flash dan penyimpanan maya ke FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatta USB, flash card e unità virtuali in FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","USBメモリやSDカード、仮想ドライブをFAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3でフォーマットします。","USB, 플래시 카드 및 가상 드라이브를 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3로 포맷","Formatē USB, atmiņas kartes un virtuālos diskus formātos FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Suformatuokite USB, flash kortelę ir virtualius diskus į FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatkan USB, kad flash dan pemacu maya kepada FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formater USB, minnekort og virtuelle disker til FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","فرمت USB، فلش کارت و درایوهای مجازی به FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Sformatuj nośnik używając: FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatar dispositivos USB, cartões flash e discos virtuais com FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatar dispositivos USB, cartão de memória e drives virtuais em FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatează USB, card flash si drive-uri virtuale la FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Форматирование USB, флешек и виртуальных дисков в FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatiraj USB, flash kartice, i virtualne diskove u FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Naformátujte USB, kartu a virtuálne disky do FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatiranje USB, bliskavice in virtualnih pogonov na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatee USB, tarjetas flash y unidades virtuales a FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatera USB-enheter, flash-kort och virtuella enheter till FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","ฟอร์แมต USB, แฟลชการ์ด หรือไดรฟ์เสมือน ให้อยู่ในรูปแบบของ FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","USB, flash kart ve sanal sürücüleri FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 olarak biçimlendirin","Форматування USB-накопичувачів, флешок, карток пам'яті у FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Định dạng USB, thẻ nhớ hoặc ổ nhớ ảo với FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" +"Feature1","700","Text","","Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","تهيئة USB وبطاقة الفلاش ومحركات الأقراص الافتراضية إلى FAT / FAT32 / NTFS / UDF / exFAT / ReFS / ext2 / ext3","Форматиране на USB, карти памет и виртуални устройства с FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","将 U 盘、存储卡或虚拟驱动器格式化为 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 格式","將隨身碟、記憶卡或虛擬光碟機格式化為 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 格式","Formatirajte USB, flash karticu i virtualne pogone na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formátování USB, flash karet a virtuálních jednotek na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formater USB, flash kort og virtuelle drev til FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","USB, flashkaart en virtuele schijven formatteren naar FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Alusta USB-asemia, muistikortteja ja virtuaalisia asemia muotoon FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatez des périphériques USB, des cartes flash et des disques virtuels en FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatieren von USB, Flash-Karte und virtuellen Laufwerken in FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Μορφοποίηση USB, κάρτας flash και εικονικών μονάδων δίσκου σε FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","אתחול USB, כרטיסי זיכרון וכוננים וירטואליים ל־FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","USB, flash memóriakártyák és virtuális meghajtók formázása FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 fájlrendszerre","Format USB, kartu flash dan penyimpanan maya ke FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatta USB, flash card e unità virtuali in FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","USBメモリやSDカード、仮想ドライブをFAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3でフォーマットします。","USB, 플래시 카드 및 가상 드라이브를 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3로 포맷","Formatē USB, atmiņas kartes un virtuālos diskus formātos FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Suformatuokite USB, flash kortelę ir virtualius diskus į FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatkan USB, kad flash dan pemacu maya kepada FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formater USB, minnekort og virtuelle disker til FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","فرمت USB، فلش کارت و درایوهای مجازی به FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Sformatuj nośnik używając: FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatar dispositivos USB, cartões flash e discos virtuais com FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatar dispositivos USB, cartão de memória e unidades virtuais em FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatează USB, card flash si drive-uri virtuale la FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Форматирование USB, флешек и виртуальных дисков в FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatiraj USB, flash kartice, i virtualne diskove u FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Naformátujte USB, kartu a virtuálne disky do FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatiranje USB, bliskavice in virtualnih pogonov na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatee USB, tarjetas flash y unidades virtuales a FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Formatera USB-enheter, flash-kort och virtuella enheter till FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","ฟอร์แมต USB, แฟลชการ์ด หรือไดรฟ์เสมือน ให้อยู่ในรูปแบบของ FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","USB, flash kart ve sanal sürücüleri FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 olarak biçimlendirin","Форматування USB-накопичувачів, флешок, карток пам'яті у FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3","Định dạng USB, thẻ nhớ hoặc ổ nhớ ảo với FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" "Feature2","701","Text","","Create FreeDOS bootable USB drives","إنشاء محركات أقراص USB قابلة للإقلاع من FreeDOS","Създаване на FreeDOS стартиращ USB устройства","创建 FreeDOS 可启动驱动器","建立 FreeDOS 可開機隨身碟","Stvaranje FreeDOS USB pogona za pokretanje","Vytvoření bootovacích disků USB se systémem FreeDOS","Lav FreeDOS opstartsbare USB drev","FreeDOS opstartbare USB-schijven aanmaken","Luo boottaavia FreeDOS USB-asemia","Créez des disques amorçable FreeDOS","FreeDOS-bootfähige USB-Laufwerke erstellen","Δημιουργήστε μονάδες USB με δυνατότητα εκκίνησης FreeDOS","יצירת כונני USB הניתנים לאתחול של FreeDOS","Bootolható FreeDOS USB meghajtó készítése","Buat perangkat USB FreeDOS yang dapat di boot","Crea unità USB avviabili FreeDOS","FreeDOSの起動可能ドライブを作成します。","FreeDOS 부팅 가능한 USB 드라이브 만들기","Izveido FreeDOS ielādes USB ierīces","Sukurkite FreeDOS įkrovos USB diskus","Buat pemacu USB boleh boot FreeDOS","Lag FreeDos oppstartbar USB stick","درایوهای USB قابل بوت FreeDOS را ایجاد کنید","Stwórz nośnik rozruchowy USB FreeDOS","Criar discos USB inicializáveis FreeDOS","Criar unidades USB inicializáveis FreeDOS","Crează drive USB bootabil FreeDOS","Создание загрузочных USB-дисков FreeDOS","Kreiraj FreeDOS butabilni USB disk","Vytvorte bootovacie usb zariadenia FreeDOS","Ustvarite FreeDOS zagonske USB pogone","Crear unidades USB de arranque FreeDOS","Skapa FreeDOS startbara USB-enheter","สร้าง USB ไดรฟ์บูตสำหรับระบบ FreeDOS","FreeDOS önyüklenebilir USB sürücüleri oluşturun","Створення завантажувальних пристроїв FreeDOS","Tạo USB có thể khởi động với FreeDOS" "Feature3","702","Text","","Create bootable drives from bootable ISOs (Windows, Linux, etc.)","إنشاء محركات أقراص قابلة للإقلاع من ملفات ISO القابلة للإقلاع (Windows و Linux وما إلى ذلك)","Създаване на стартиращи устройства от ISO образи (Windows, Linux и др.)","从可启动 ISO 文件 (Windows 和 Linux 等) 创建可启动驱动器","從可開機 ISO 檔案 (Windows 和 Linux 等) 建立可開機隨身碟","Stvaranje pogona za pokretanje iz ISO-ova za pokretanje (Windows, Linux itd.)","Vytváření bootovacích jednotek ze zaváděcích ISO (Windows, Linux atd.)","Lav opstartsbarer drev fra opstartsbarer ISOer (Window, Linux, osv.)","Opstartbare schijven aanmaken via opstartbare ISO's (Windows, Linux, enz)","Luo käynnistysasemia boottaavista ISO-kuvista (Windows, Linux jne.)","Créez des disques amorçables à partir d'images ISOs (Windows, Linux, etc.)","Erstellen bootfähiger Laufwerke aus bootfähigen ISOs (Windows, Linux etc.)","Δημιουργήστε εκκινήσιμες μονάδες από ISO με δυνατότητα εκκίνησης (Windows, Linux, κ.λπ.)","יצירת כוננים הניתנים לאתחול מקובצי ISO הניתנים לאתחול (Windows‏, Linux וכו')","Bootolható meghajtók készítése bootolható ISO képfájlokból (Windows, Linux, stb.)","Buat perangkat yang dapat di boot dari ISO (Windows, Linux, dll.)","Crea unità avviabili da ISO avviabili (Windows, Linux, ecc.)","WindowsやLinuxなどのISOファイルから起動可能ドライブを作成します。","부팅 가능한 ISO (Windows, Linux 등)에서 부팅 가능한 드라이브 만들기","Izveido ielādes ierīces no ISO failiem (Windows, Linux, u.c.)","Sukurkite įkrovos diskus iš įkrovos ISO (Windows, Linux ir kt.)","Buat pemacu boleh boot daripada ISO boleh boot (Windows, Linux, dll.)","Lag oppstartabar enhet/disk fra ISOer (Windows, Linux, etc.)","ایجاد درایوهای قابل بوت از ISOهای قابل بوت (ویندوز، لینوکس و غیره)","Twórz dyski rozruchowe z obrazów ISO (Windows, Linux itp.)","Criar discos inicializáveis a partir de ISOs inicializáveis (Windows, Linux, etc.)","Criar unidades inicializáveis a partir de ISOs inicializáveis (Windows, Linux, etc.)","Crează drive-uri bootabile de la ISO-uri bootabile (Windows, Linux, etc.)","Создание загрузочных дисков из загрузочных образов ISO (Windows, Linux и т.д.)","Kreirajte disk jedinice za pokretanje sistema od ISO-a koji se mogu pokretanja sistema (Windows, Linux itd.)","Vytvorte bootovacie jednotky z ISO súborov (Windows, Linux atď.)","Ustvarite zagonske pogone iz zagonskih ISO-jev (Windows, Linux itd.)","Cree unidades de arranque desde ISO de arranque (Windows, Linux, etc.)","Skapa startbara enheter från startbara ISO-filer (Windows, Linux, etc.)","สร้าง USB ไดรฟ์บูตจากไฟล์ ISO ที่บูตได้ (เช่น ไฟล์ติดตั้ง Windows หรือ Linux เป็นต้น)","Önyüklenebilir ISO'lardan önyüklenebilir sürücüler oluşturun (Windows, Linux, vb.)","Створення завантажувальних пристроїв з завантажувальних образів (Windows, Linux, тощо)","Tạo ổ đĩa có thể khởi động từ các file ISO có thể khởi động (Windows, Linux, v.v...)" "Feature4","703","Text","","Create bootable drives from bootable disk images, including compressed ones","إنشاء محركات أقراص قابلة للإقلاع من صور الأقراص القابلة للإقلاع ، بما في ذلك الأقراص المضغوطة","Създаване на стартиращи устройства от образи, включително компресирани такива","从可启动硬盘镜像 (包括压缩镜像) 创建可启动驱动器","從可開機硬碟映像檔 (包括壓縮映像檔) 建立可開機隨身碟","Stvaranje pogona za pokretanje iz slika diska za pokretanje, uključujući komprimirane","Vytváření zaváděcích jednotek ze zaváděcích obrazů disků, včetně komprimovaných","Lav opstartsbarer drev fra opstartsbarer disk billeder, inklusiv komprimerede billeder","Opstartbare schijven aanmaken van opstartbare schijf-images, inclusief gecomprimeerde images","Luo käynnistysasemia boottaavista levykuvista, pakatut kuvat mukaanlukien","Créez des disques amorçables à partir d'images disque, y compris à partir d'images compressées","Erstellen bootfähiger Laufwerke aus bootfähigen Festplatten-Images, einschließlich komprimierter Images","Δημιουργήστε μονάδες εκκίνησης από εικόνες δίσκου με δυνατότητα εκκίνησης, συμπεριλαμβανομένων συμπιεσμένων","יצירת כוננים הניתנים לאתחול מקובצי תמונת דיסק הניתנים לאתחול, כולל קבצים דחוסים","Bootolható meghajtók készítése bootolható lemez képfájlokból, beleértve a tömörítetteket is","Buat perangkat yang dapat di boot dari Disk Image, termasuk yang Disk Image yang terkompresi","Crea unità avviabili da immagini disco avviabili, incluse quelle compresse","圧縮済みのものを含むディスクイメージから起動可能ドライブを作成します。","압축된 이미지를 포함하여 부팅 가능한 디스크 이미지에서 부팅 가능한 드라이브 만들기","Izveido ielādes ierīces no ielādes disku virtuālajiem attēliem, tai skaitā arī no saspiestajiem","Sukurkite įkrovos diskus iš įkrovos disko vaizdų, įskaitant suspaustus","Buat pemacu boleh boot daripada imej cakera boleh boot, termasuk yang dimampatkan","Lag oppstartbare disker fra images, inkludert komprimerte sådan","درایوهای قابل بوت را از تصاویر دیسک قابل بوت، از جمله موارد فشرده، ایجاد کنید","Twórz dyski rozruchowe z obrazów dysków, włączając skompresowane","Criar discos inicializáveis a partir de imagens de disco inicializáveis, inclusive de imagens compactadas","Criar unidades inicializáveis a partir de imagens de disco inicializáveis, inclusive de imagens compactadas","Crează drive-uri de la imagini de disc bootabile, incluzând cele compresate","Создание загрузочных дисков из образов загрузочных дисков, в том числе сжатых","Kreiranje disk jedinica za pokretanje sistema sa slika diska koji se može pokretanja, uključujući kompresovane","Vytvorte bootovacie jednotky z diskových obrazov, vrátane tých komprimovaných","Ustvarite zagonske pogone iz slik diska, ki jih je mogoče zagnati, vključno s stisnjenimi","Cree unidades de arranque a partir de imágenes de disco de arranque, incluidas las comprimidas","Skapa startbara enheter från startbara diskavbildningar, inklusive komprimerade","สร้างไดรฟ์บูตจากดิสก์อิมเมจที่บูตได้ (รองรับไฟล์ดิสก์อิมเมจที่ถูกบีบอัด)","Sıkıştırılmış olanlar da dahil olmak üzere önyüklenebilir disk yansısından önyüklenebilir sürücüler oluşturun","Створення завантажувальних пристроїв з завантажувальних образів, у тому числі стиснутих","Tạo ổ đĩa có thể khởi động từ các tệp đĩa có thể khởi động, bao gồm cả tệp nén" @@ -266,10 +277,10 @@ Xem tại https://www.gnu.org/licenses/gpl-3.0.html để biết thêm chi tiế "Feature8","707","Text","","Create persistent Linux partitions","إنشاء Persistent Linux partitions","Създаване на устойчиви Linux дялове","创建持久 Linux 分区","建立持續性 Linux 磁區","Stvaranje trajnih Linux particija","Vytvoření trvalých oddílů systému Linux","Lav vedvarende Linux adskillelser","Persistent Linux partities aanmaken","Luo pysyviä Linux-osioita","Créez des partitions persistentes pour Linux","Persistente Linux-Partitionen erstellen","Δημιουργήστε μόνιμα διαμερίσματα Linux","יצירת מחיצות Linux קבועות","Tartós Linux partíciók készítése","Buat partisi Linux yang tetap/persistent","Crea partizioni persistenti Linux","記録用Linuxパーティションを作成します。","영구 리눅스 파티션 만들기","Izveido pastāvīgas Linux partīcijas","Sukurkite nuolatinius Linux skaidinius","Buat partition Linux berterusan","Lag persistente Linux partisjoner","ایجاد پارتیشن های لینوکس دائمی","Utwórz trwałe partycje Linux","Criar partições persistentes para Linux","Crie partições persistentes para Linux","Crează partiție de Linux persistentă","Создание постоянных разделов Linux","Kreiranje upornih Linux particija","Vytvorte trvalé oblasti systému Linux","Ustvarjanje trajnih Linux particij","Crear particiones persistentes de Linux","Skapa beständiga Linux-partitioner","สร้าง Linux partition แบบ persistent","Kalıcı Linux bölümleri oluşturun","Створення розділу збереження Linux","Tạo phân vùng Linux liên tục" "Feature9","708","Text","","Create VHD/DD images of the selected drive","إنشاء صور VHD / DD لمحرك الأقراص المحدد","Създаване на VHD/DD образи на избраното устройство","为选择的驱动器创建 VHD/DD 镜像","為選取的磁碟機建立 VHD/DD 映像檔","Stvaranje VHD/DD slika odabranog pogona","Vytvoření obrazů VHD/DD z vybrané jednotky","Lav VHD/DD billeder af det valgte drev","VHD/DD-images van de geselecteerde schijf aanmaken","Luo VHD/DD-kuvia valitusta asemasta","Créez des images VHD/DD du périphérique sélectionné","VHD/DD-Images des ausgewählten Laufwerks erstellen","Δημιουργήστε εικόνες VHD/DD της επιλεγμένης μονάδας δίσκου","יצירת קובצי תמונה מסוג VHD/DD של הכונן שנבחר","VHD/DD képfájl készítése a kiválasztott meghajtóról","Buat image VHD/DD dari penyimpanan yang dipilih","Crea immagini VHD/DD dell'unità selezionata","選択されたドライブのVHD/DDイメージを作成します。","선택한 드라이브의 VHD/DD 이미지 만들기","Izveido izvēlētā diska VHD/DD virtuālos attēlus","Sukurkite pasirinkto disko VHD / DD vaizdus","Buat imej VHD/DD bagi pemacu yang dipilih","Lag VHD/DD speilinger av valgt disk","تصاویر VHD/DD از درایو انتخاب شده ایجاد کنید","Stwórz obraz VHD/DD z wybranego dysku","Criar imagens VHD/DD do dispositivo selecionado","Criar imagens VHD/DD do dispositivo selecionado","Crează imagini VHD/DD de pe drive-ul selectat","Создание образов VHD/DD выбранного диска","Kreiranje VHD/DD slika izabrane disk jedinice","Vytvorte obrazy VHD/DD z vybratej jednotky","Ustvarjanje VHD/DD slik izbranega pogona","Cree imágenes VHD/DD de la unidad seleccionada","Skapa VHD/DD-avbilder av den valda enheten","สร้างอิมเมจไฟล์แบบ VHD/DD จากไดรฟ์ที่เลือก","Seçilen sürücünün VHD/DD yansılarını oluşturun","Створення образів VHD/DD з вибраних дисків","Tạo tệp VHD/DD từ ổ đĩa đã chọn" "Feature10","709","Text","","Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image","حساب المجاميع الإختبارية MD5 و SHA-1 و SHA-256 و SHA-512 للصورة المحددة","Изчисляване на MD5, SHA-1, SHA-256 и SHA-512 чексуми на избраният образ","计算被选择镜像的 MD5、SHA-1、SHA-256 和 SHA-512 校验码","計算被選取映像的 MD5、SHA-1、SHA-256 和 SHA-512 檢查碼","Izračunajte kontrolne zbrojeve odabrane slike MD5, SHA-1, SHA-256 i SHA-512","Výpočet kontrolních součtů MD5, SHA-1, SHA-256 a SHA-512 vybraného obrazu","Beregn MD5, SHA-1, SHA-256 og SHA-512 checksums af det valgte billede","MD5, SHA-1, SHA-256 en SHA-512 controlesommen berekenen van de geselecteerde image","Laske MD5, SHA-1, SHA-256 ja SHA-512 tarkistussummia valitusta levykuvasta","Calculez les sommes de contrôle MD5, SHA-1, SHA-256 et SHA-512 de l'image sélectionnée","Berechnung von MD5-, SHA-1-, SHA-256- und SHA-512-Prüfsummen für das ausgewählte Image","Υπολογίστε τα αθροίσματα ελέγχου MD5, SHA-1, SHA-256 και SHA-512 της επιλεγμένης εικόνας","חישוב סיכומי ביקורת מסוג MD5,‏ SHA-1,‏ SHA-256 ו־SHA-512 של קובץ התמונה שנבחרה","A kiválasztott képfájl MD5, SHA-1, SHA-256 és SHA-512 ellenőrző összegének kiszámítása","Hitung checksum MD5, SHA-1, SHA-256 dan SHA-512 dari image yang dipilih","Calcola i checksum MD5, SHA-1, SHA-256 e SHA-512 dell'immagine selezionata","選択されたイメージのMD5、SHA-1、SHA-256及びSHA-512チェックサムを計算します。","선택한 이미지의 MD5, SHA-1, SHA-256 및 SHA-512 체크섬 계산","Izskaitļo izvēlētā virtuālā attēla MD5, SHA-1, SHA-256 un SHA-512 kontrolsummas","Apskaičiuokite pasirinkto vaizdo MD5, SHA-1, SHA-256 ir SHA-512 kontrolines sumas","Kira MD5, SHA-1, SHA-256 dan SHA-512 checksum imej yang dipilih","Kalkuler MD5, SHA-1, SHA-256 og SHA-512 sjekksummer fra valgt speiling","MD5، SHA-1، SHA-256 و SHA-512 را برای تصویر انتخابی محاسبه کنید","Oblicz sumy kontrolne MD5, SHA-1, SHA-256 i SHA-512 dla wybranego obrazu","Calcular somas de verificação MD5, SHA-1, SHA-256 e SHA-512 da imagem selecionada","Calcular checksums MD5, SHA-1, SHA-256 e SHA-512 da imagem selecionada","Compută MD5, SHA-1, SHA-256 și SHA-512 suma de control ale imaginilor selectate","Вычисление контрольных сумм MD5, SHA-1, SHA-256 и SHA-512 выбранного образа","Izračunajte MD5, SHA-1, SHA-256 i SHA-512 kontrolne preglede izabrane slike","Vypočítajte kontrolné súčty vybratého obrazu (MD5, SHA-1, SHA-256 a SHA-512)","Račun MD5, SHA-1, SHA-256 in SHA-512 kontrolni vsoti izbrane slike","Calcule las sumas de comprobación MD5, SHA-1, SHA-256 y SHA-512 de la imagen seleccionada","Beräkna kontrollsummor MD5, SHA-1, SHA-256 och SHA-512 för den valda avbilden","คำนวณรหัส MD5, SHA-1, SHA-256, SHA-512 ของไฟล์อิมเมจที่เลือก","Seçilen yansının MD5, SHA-1, SHA-256 ve SHA-512 sağlama toplamlarını hesaplayın","Обчислення контрольних сум MD5, SHA-1, SHA-256 та SHA-512 для вибраних образів","Tính tổng kiểm MD5, SHA-1, SHA-256 và SHA-512 của tệp đã chọn" -"Feature11","710","Text","","Perform bad blocks checks, including detection of ""fake"" flash drives","إجراء فحوصات كتل تالفة ، بما في ذلك الكشف عن محركات أقراص فلاش ""زائفة\","Проверяване за лоши блокове, включително засичане на ""фалшиви"" устройства","执行坏块检查,包括对”假“U盘的检测","執行壞軌檢查,包括對”假“USB 快閃磁碟 +"Feature11","710","Text","","Perform bad blocks checks, including detection of ""fake"" flash drives","إجراء فحوصات كتل تالفة ، بما في ذلك الكشف عن محركات أقراص فلاش ""زائفة\","Проверяване за лоши блокове, включително засичане на ""фалшиви"" устройства","执行坏块检查,包括对”假“U盘的检测","執行壞軌檢查,包括對 ”假“ USB 快閃磁碟 的偵測","Izvršite provjere loših blokova, uključujući otkrivanje ""lažnih"" flash pogona","Provést kontrolu vadných bloků, včetně detekce ""falešných"" bloků. flash disky","Udøv dårlige blokke tjeks, inklusiv opdagelse af ""falske"" flashdrev","Controles uitvoeren op slechte blokken, inclusief detectie van ""valse"" flashdrives","Suorita viallisten lohkojen tarkistuksia, sisältäen ""valheellisten"" muistitikkujen tunnistamisen","Executez un test de mauvais secteurs avec detection des ""fake drives\","Durchführung von Prüfungen auf fehlerhafte Blöcke, einschließlich der Erkennung von ""gefälschten"" Flash-Laufwerken","Εκτελέστε ελέγχους εσφαλμένων block, συμπεριλαμβανομένου του εντοπισμού ""ψευδών"" μονάδων flash","ביצוע בדיקות אחר בלוקים (אזורים) פגומים, כולל זיהוי של כונני הבזק ""מזוייפים\","Hibás blokkok ellenőrzése, beleértve a ""hamis"" flash meghajtók detektálását","Lakukan cek Blok yang buruk, termasuk deteksi USB Flash Disk ""PALSU\","Esegui controlli dei blocchi danneggiati, incluso il rilevamento di unità flash ""false\","不良ブロックチェック及び容量詐欺ドライブの検知を行います。","""위조"" 플래시 드라이브 감지를 포함하여 불량 블록 검사 수행","Izpilda bojāto bloku pārbaudi ieskaitot ""falsificēto"" nesēju noteikšanu","Atlikite blogų blokų patikrinimus, įskaitant ""netikrų"" flash diskų aptikimą","Melakukan pemeriksaan blok buruk, termasuk pengesanan pemacu kilat ""palsu\","Utfør sjekk for dårlige sektorer, inkludert sjekk for forfalskede flash disker","بررسی بلوک های بد، از جمله تشخیص درایوهای فلش ""جعلی"" را انجام دهید","Sprawdź dysk pod względem spójności danych lub wykryj ""nieoryginalny"" pendrive","Executar verificações de blocos defeituosos, incluindo detecção de unidades flash ""falsificadas\","Executar verificações de blocos inválidos, incluindo a deteção de unidades flash ""falsas\","Verifică blocuri rele, incluzând detectarea de drive-uri flash ""false\","Проверка на плохие блоки, обнаружение ""поддельных"" флешек","Izvršite provere loših blokova, uključujući otkrivanje ""lažnih"" fleš diskova","Vykonajte kontroly zlých blokov vrátane detekcie „falošných"" prenosných diskov","Izvajanje preverjanj slabih blokov, vključno z odkrivanjem »lažnih« bliskavic","Realice comprobaciones de bloques defectuosos, incluida la detección de unidades flash ""falsas\","Utför kontroll av trasiga block, inklusive upptäckt av ""falska"" USB-minnen","ตรวจสอบจุดบกพร่อง รวมไปถึงการทดสอบแฟลชไดรฟ์ว่าเป็น ""ของปลอม"" หรือไม่","""Sahte"" flash sürücülerin tespiti de dahil olmak üzere hatalı blok kontrolleri gerçekleştirin","Перевірка дисків (включаючи фальшиві диски)","Thực hiện kiểm tra điểm lỗi, bao gồm phát hiện ổ đĩa ""giả\" -"Feature12","711","Text","","Download official Microsoft Windows retail ISOs","قم بتنزيل ملفات ISO الرسمية الخاصة بـ Microsoft Windows","Изтегляне на официални Microsoft Windows ISO образи","下载微软官方 Windows 镜像","下載微軟官方 Windows 映像檔","Preuzimanje službenih ISO-ova za maloprodaju sustava Microsoft Windows","Stažení oficiálních souborů ISO systému Microsoft Windows","Hent officielle Microsoft Windows detail ISOer","Officiële Microsoft Windows retail ISO's downloaden","Lataa virallisia Microsoft Windowsin jälleenmyyntiversion ISO-levykuvia","Téléchargez des images ISOs commerciales officielles de Microsoft Windows","Offizielle Microsoft Windows-ISOs herunterladen","Κατεβάστε τα επίσημα retail ISO των Microsoft Windows","הורדת קובצי ה־ISO הקמעונאיים הרשמיים של Microsoft Windows","Hivatalos Microsoft Windows kiskereskedelmi ISO képfájlok letöltése","Unduh ISO Microsoft Windows resmi","Scarica le ISO ufficiali di Microsoft Windows","マイクロソフト公式のWindows ISOをダウンロードします。","공식 Microsoft Windows 리테일 ISO 다운로드","Lejupielādē oficiālos Microsoft ISO failus","Atsisiųskite oficialius Microsoft Windows mažmeninės prekybos ISO","Muat turun rasmi ISO runcit Microsoft Windows","Last ned offisielle Windows ISOer","ISO های رسمی ماکروسافت را دریافت کنید","Pobierz oficjalny obraz ISO systemu Microsoft Windows","Baixar ISOs oficiais do Microsoft Windows","Transferir ISOs oficiais do Microsoft Windows Retail","Descarcă un Microsoft Windows ISO oficial de vânzare","Загрузка официальных ISO-образов Windows","Preuzmite zvanične Microsoft Windows maloprodajne ISO-ove","Stiahnite si oficiálne ISO pre Microsoft Windows","Prenos uradnih Microsoft Windows maloprodaja ISOs","Descargue los ISO oficiales de Microsoft Windows","Ladda ner officiella Microsoft Windows ISO-filer","ดาวน์โหลดไฟล์ ISO ของ Microsoft Windows จากเว็บไซต์ทางการของ Microsoft","Resmi Microsoft Windows Retail ISO'larını indirin","Завантаження офіційних образів Microsoft Windows","Tải xuống các tệp Microsoft Windows ISO bán lẻ chính thức" -"Feature13","712","Text","","Download UEFI Shell ISOs","قم بتنزيل UEFI Shell ISOs","Изтегляне на UEFI Shell образи","下载 UEFI Shell 镜像","下載 UEFI Shell 映像檔","Preuzmite ISO-ove UEFI ljuske","Stažení souborů UEFI Shell ISO","Hent UEFI Shell ISOer","UEFI Shell ISO's downloaden","Lataa UEFI Shell ISO-levykuvia","Téléchargez des images ISOs du Shell UEFI","UEFI-Shell-ISOs herunterladen","Κατεβάστε τα ISO Shell UEFI","הורדת קובצי ISO של מעטפת UEFI","UEFI Shell ISO képfájlok letöltése","Unduh Shell ISO UEFI","Scarica le ISO della shell UEFI","UEFIシェルのISOをダウンロードします。","UEFI Shell ISO 다운로드","Lejupielādē UEFI OS ISO failus","Atsisiųskite UEFI Shell ISO","Muat turun ISO Shell UEFI","Last ned UEFI kommandolinje ISOer","ISO های پوسته UEFI را دانلود کنید","Ściągnij obrazy ISO UEFI Shell","Baixar ISOs do Shell UEFI","Transferir ISOs de UEFI Shell","Descarcă UEFI Shell ISO-uri","Загрузка ISO-образов оболочки UEFI","Preuzmite UEFI Shell ISOs","Stiahnite UEFI Shell ISO","Prenos UEFI Shell ISOs","Descargar ISO de UEFI Shell","Ladda ner UEFI-skal ISO-filer","ดาวน์โหลดไฟล์ ISO ของ UEFI Shell","UEFI Shell ISO'larını indirin","Завантаження командної оболонки UEFI ISO","Tải xuống các tệp UEFI Shell ISO" +"Feature12","711","Text","","Download official Microsoft Windows retail ISOs","قم بتنزيل ملفات ISO الرسمية الخاصة بـ Microsoft Windows","Изтегляне на официални Microsoft Windows ISO образи","下载微软官方 Windows 镜像","下載微軟官方 Windows 映像檔","Preuzimanje službenih ISO-ova za maloprodaju sustava Microsoft Windows","Stažení oficiálních souborů ISO systému Microsoft Windows","Hent officielle Microsoft Windows detail ISOer","Officiële Microsoft Windows retail ISO's downloaden","Lataa virallisia Microsoft Windowsin jälleenmyyntiversion ISO-levykuvia","Téléchargez des images ISOs commerciales officielles de Microsoft Windows","Offizielle Microsoft Windows-ISOs herunterladen","Κατεβάστε τα επίσημα retail ISO των Microsoft Windows","הורדת קובצי ה־ISO הקמעונאיים הרשמיים של Microsoft Windows","Hivatalos Microsoft Windows kiskereskedelmi ISO képfájlok letöltése","Unduh ISO Microsoft Windows resmi","Scarica le ISO ufficiali di Microsoft Windows","マイクロソフト公式のWindows ISOをダウンロードします。","공식 Microsoft Windows 리테일 ISO 다운로드","Lejupielādē oficiālos Microsoft ISO failus","Atsisiųskite oficialius Microsoft Windows mažmeninės prekybos ISO","Muat turun rasmi ISO runcit Microsoft Windows","Last ned offisielle Windows ISOer","ISO های رسمی ماکروسافت را دریافت کنید","Pobierz oficjalny obraz ISO systemu Microsoft Windows","Baixar ISOs oficiais do Microsoft Windows","Descarregar ISOs oficiais do Microsoft Windows Retail","Descarcă un Microsoft Windows ISO oficial de vânzare","Загрузка официальных ISO-образов Windows","Preuzmite zvanične Microsoft Windows maloprodajne ISO-ove","Stiahnite si oficiálne ISO pre Microsoft Windows","Prenos uradnih Microsoft Windows maloprodaja ISOs","Descargue los ISO oficiales de Microsoft Windows","Ladda ner officiella Microsoft Windows ISO-filer","ดาวน์โหลดไฟล์ ISO ของ Microsoft Windows จากเว็บไซต์ทางการของ Microsoft","Resmi Microsoft Windows Retail ISO'larını indirin","Завантаження офіційних образів Microsoft Windows","Tải xuống các tệp Microsoft Windows ISO bán lẻ chính thức" +"Feature13","712","Text","","Download UEFI Shell ISOs","قم بتنزيل UEFI Shell ISOs","Изтегляне на UEFI Shell образи","下载 UEFI Shell 镜像","下載 UEFI Shell 映像檔","Preuzmite ISO-ove UEFI ljuske","Stažení souborů UEFI Shell ISO","Hent UEFI Shell ISOer","UEFI Shell ISO's downloaden","Lataa UEFI Shell ISO-levykuvia","Téléchargez des images ISOs du Shell UEFI","UEFI-Shell-ISOs herunterladen","Κατεβάστε τα ISO Shell UEFI","הורדת קובצי ISO של מעטפת UEFI","UEFI Shell ISO képfájlok letöltése","Unduh Shell ISO UEFI","Scarica le ISO della shell UEFI","UEFIシェルのISOをダウンロードします。","UEFI Shell ISO 다운로드","Lejupielādē UEFI OS ISO failus","Atsisiųskite UEFI Shell ISO","Muat turun ISO Shell UEFI","Last ned UEFI kommandolinje ISOer","ISO های پوسته UEFI را دانلود کنید","Ściągnij obrazy ISO UEFI Shell","Baixar ISOs do Shell UEFI","Descarregar ISOs de UEFI Shell","Descarcă UEFI Shell ISO-uri","Загрузка ISO-образов оболочки UEFI","Preuzmite UEFI Shell ISOs","Stiahnite UEFI Shell ISO","Prenos UEFI Shell ISOs","Descargar ISO de UEFI Shell","Ladda ner UEFI-skal ISO-filer","ดาวน์โหลดไฟล์ ISO ของ UEFI Shell","UEFI Shell ISO'larını indirin","Завантаження командної оболонки UEFI ISO","Tải xuống các tệp UEFI Shell ISO" "Feature14","713","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "Feature15","714","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "Feature16","715","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, @@ -299,7 +310,7 @@ Xem tại https://www.gnu.org/licenses/gpl-3.0.html để biết thêm chi tiế "RecommendedHardwareReq9","858","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "RecommendedHardwareReq10","859","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "RecommendedHardwareReq11","860","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -"SearchTerm1","900","Text","Boot","Boot","الإقلاع (Boot)","","启动","啟動","","","","Opstarten","Boottaus","Amorçable","","","בוט","","","Avvio","起動","부팅","Ielāde","Batas","","Oppstart","راه‌اندازی","","Inicialização","Inicializável","Bootează","Загрузочный","","boot","Zagon","Arranque","Uppstart","","Önyükle","Отримати","Khởi động" +"SearchTerm1","900","Text","Boot","Boot","الإقلاع (Boot)","","启动","啟動","","","","Opstarten","Boottaus","Amorçable","","","בוט","","","Avvio","起動","부팅","Ielāde","Batas","","Oppstart","راه‌اندازی","","Inicialização","Arranque","","Загрузочный","","boot","Zagon","Arranque","Uppstart","","Önyükle","Отримати","Khởi động" "SearchTerm2","901","Text","USB",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "SearchTerm3","902","Text","ISO",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "SearchTerm4","903","Text","Windows",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index a4866c3a..a9efb244 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -14317,6 +14317,8 @@ t MSG_346 "Omejite Windows na S-način (NEZDRUŽLJIVO z obvodom spletnega račun t MSG_347 "Strokovni način" t MSG_348 "Ekstrahiranje arhivskih datotek: %s" t MSG_349 "Uporabite Rufus MBR" +t MSG_355 "⚠TIHO⚠ izbrišite disk in namestite:" +t MSG_356 "Izbrali ste možnost \"tihe\" namestitve sistema Windows.\n\nTo je napredna možnost, namenjena uporabnikom, ki želijo ustvariti namestitveni nosilec, ki med namestitvijo sistema Windows ne prikazuje pozivov in zato BREZ POGOJEV IZBRISE prvi zaznan disk v ciljnem sistemu. Če niste previdni, lahko uporaba te možnosti povzroči NEPOPRAVLJIVO IZGUBO PODATKOV!\n\nČe tega ne želite, izberite \"Ne\", da se vrnete nazaj in odkljukate to možnost.\nV nasprotnem primeru, če izberete \"Da\", se strinjate, da boste za morebitno izgubo podatkov v celoti odgovorni VI." t MSG_900 "Rufus je program za formatiranje in ustvarjanje zagonskih naprav USB." t MSG_901 "Uradna stran: %s" t MSG_902 "Šifra vira: %s" diff --git a/src/rufus.rc b/src/rufus.rc index 3b3b3484..11153597 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.14.2376" +CAPTION "Rufus 4.14.2377" 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,14,2376,0 - PRODUCTVERSION 4,14,2376,0 + FILEVERSION 4,14,2377,0 + PRODUCTVERSION 4,14,2377,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.14.2376" + VALUE "FileVersion", "4.14.2377" 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.14.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2376" + VALUE "ProductVersion", "4.14.2377" END END BLOCK "VarFileInfo" From 69e5c4c7175eb1f1d2df7eddd6617c2cb9b35eea Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Sun, 3 May 2026 21:22:52 +0100 Subject: [PATCH 187/192] [wue] fix first option always being checked by default * This fixes a regression introduced in 92a8926c18ba6ab56c01422123cbe886ce9f964f. * Closes #2965. * Also update version to rufus-next. --- configure | 20 ++++++++++---------- configure.ac | 2 +- src/rufus.rc | 12 ++++++------ src/stdlg.c | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/configure b/configure index 8f8dcb92..4f617edd 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for rufus 4.14. +# Generated by GNU Autoconf 2.71 for rufus 4.15. # # Report bugs to <https://github.com/pbatard/rufus/issues>. # @@ -611,8 +611,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rufus' PACKAGE_TARNAME='rufus' -PACKAGE_VERSION='4.14' -PACKAGE_STRING='rufus 4.14' +PACKAGE_VERSION='4.15' +PACKAGE_STRING='rufus 4.15' PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues' PACKAGE_URL='https://rufus.ie' @@ -1269,7 +1269,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rufus 4.14 to adapt to many kinds of systems. +\`configure' configures rufus 4.15 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1336,7 +1336,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rufus 4.14:";; + short | recursive ) echo "Configuration of rufus 4.15:";; esac cat <<\_ACEOF @@ -1428,7 +1428,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rufus configure 4.14 +rufus configure 4.15 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1504,7 +1504,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rufus $as_me 4.14, which was +It was created by rufus $as_me 4.15, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2767,7 +2767,7 @@ fi # Define the identity of the package. PACKAGE='rufus' - VERSION='4.14' + VERSION='4.15' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -5313,7 +5313,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rufus $as_me 4.14, which was +This file was extended by rufus $as_me 4.15, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5369,7 +5369,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -rufus config.status 4.14 +rufus config.status 4.15 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 94f0e09b..b80d3404 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([rufus], [4.14], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) +AC_INIT([rufus], [4.15], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies]) AC_CONFIG_SRCDIR([src/rufus.c]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/src/rufus.rc b/src/rufus.rc index 11153597..d8b5b6e5 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.14.2377" +CAPTION "Rufus 4.15.2378" 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,14,2377,0 - PRODUCTVERSION 4,14,2377,0 + FILEVERSION 4,15,2378,0 + PRODUCTVERSION 4,15,2378,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.14.2377" + VALUE "FileVersion", "4.15.2378" 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.14.exe" + VALUE "OriginalFilename", "rufus-4.15.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.14.2377" + VALUE "ProductVersion", "4.15.2378" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index 02ae6dc3..da9cad1d 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -1002,7 +1002,7 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam // Set the default selection for (i = 0, m = 1; i < nDialogItems; i++, m <<= 1) Button_SetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), - (selection_data.options->mask == 0 && i == 0) || + (selection_data.options->style == BS_AUTORADIOBUTTON && selection_data.options->mask == 0 && i == 0) || (selection_data.options->mask != 0 && (m & selection_data.options->mask) ? BST_CHECKED : BST_UNCHECKED)); // Set the default state of the silent install option if available if (selection_data.options->edition_index > 0 && selection_data.options->username_index > 0 && From 5782ea8ecb215c8bc0d7de27d549816b17dabe17 Mon Sep 17 00:00:00 2001 From: "good work, great work" <ignatev.ilya.yt@gmail.com> Date: Thu, 30 Apr 2026 17:18:58 +0100 Subject: [PATCH 188/192] [loc] update Malay translation to latest * Closes #2961. --- res/loc/po/ms-MY.po | 4078 ++++++++++++++++++++++--------------------- res/loc/rufus.loc | 48 +- src/rufus.rc | 10 +- 3 files changed, 2178 insertions(+), 1958 deletions(-) diff --git a/res/loc/po/ms-MY.po b/res/loc/po/ms-MY.po index 5f387d4a..8ac35f44 100644 --- a/res/loc/po/ms-MY.po +++ b/res/loc/po/ms-MY.po @@ -1,1947 +1,2131 @@ -msgid "" -msgstr "" -"Project-Id-Version: 3.22\n" -"Report-Msgid-Bugs-To: pete@akeo.ie\n" -"POT-Creation-Date: 2023-04-25 13:26+0100\n" -"PO-Revision-Date: 2023-04-25 13:33+0100\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: ms_MY\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Poedit-SourceCharset: UTF-8\n" -"X-Rufus-LanguageName: Malay (Bahasa Malaysia)\n" -"X-Rufus-LCID: 0x043e, 0x083e\n" -"X-Generator: Poedit 3.2.2\n" - -#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT -msgid "Drive Properties" -msgstr "Sifat cakera" - -#. • IDD_DIALOG → IDS_DEVICE_TXT -msgid "Device" -msgstr "Peranti" - -#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT -msgid "Boot selection" -msgstr "Jenis boot" - -#. • IDD_DIALOG → IDC_SELECT -msgid "Select" -msgstr "Pilih" - -#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT -msgid "Image Option" -msgstr "Pilihan Imej" - -#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT -msgid "Partition scheme" -msgstr "Skema partisyen" - -#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT -msgid "Target system" -msgstr "Sistem yang akan dipasang" - -#. • IDD_DIALOG → IDC_LIST_USB_HDD -msgid "List USB Hard Drives" -msgstr "Senaraikan Cakera Keras USB" - -#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES -#. -#. It is acceptable to drop the parenthesis () if you are running out of space -#. as there is a tooltip (MSG_169) providing these details. -msgid "Add fixes for old BIOSes (extra partition, align, etc.)" -msgstr "Tambah pembaikan untuk BIOS lama" - -#. • IDD_DIALOG → IDC_RUFUS_MBR -#. -#. 'MBR': See http://en.wikipedia.org/wiki/Master_boot_record -#. Rufus can install it's own custom MBR (the Rufus MBR), which also allows users to -#. specify a custom disk ID for the BIOS. The tooltip for this control is MSG_167. -msgid "Use Rufus MBR with BIOS ID" -msgstr "Guna MBR Rufus dengan BIOS ID" - -#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT -msgid "Format Options" -msgstr "Pilihan format" - -#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT -msgid "File system" -msgstr "Sistem fail" - -#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT -msgid "Cluster size" -msgstr "Saiz gugusan" - -#. • IDD_DIALOG → IDS_LABEL_TXT -msgid "Volume label" -msgstr "Label jilid baharu" - -#. • IDD_DIALOG → IDC_QUICK_FORMAT -msgid "Quick format" -msgstr "Format pantas" - -#. • IDD_DIALOG → IDC_BAD_BLOCKS -msgid "Check device for bad blocks" -msgstr "Semak peranti untuk blok rosak" - -#. • IDD_DIALOG → IDC_EXTENDED_LABEL -msgid "Create extended label and icon files" -msgstr "Cipta label lanjut dan fail ikon" - -#. • IDD_DIALOG → IDS_STATUS_TXT -msgid "Status" -msgstr "" - -#. • IDD_DIALOG → IDCANCEL -#. • IDD_LICENSE → IDCANCEL -#. • IDD_LOG → IDCANCEL -#. • IDD_UPDATE_POLICY → IDCANCEL -#. • IDD_NEW_VERSION → IDCANCEL -#. • MSG_006 -msgid "Close" -msgstr "Tutup" - -#. • IDD_DIALOG → IDC_START -msgid "Start" -msgstr "Mula" - -#. • IDD_ABOUTBOX → IDD_ABOUTBOX -msgid "About Rufus" -msgstr "Mengenai Rufus" - -#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE -msgid "License" -msgstr "Lesen" - -#. • IDD_ABOUTBOX → IDOK -msgid "OK" -msgstr "" - -#. • IDD_LICENSE → IDD_LICENSE -msgid "Rufus License" -msgstr "Lesen Rufus" - -#. • IDD_NOTIFICATION → IDC_MORE_INFO -msgid "More information" -msgstr "Maklumat lanjut" - -#. • IDD_NOTIFICATION → IDYES -#. • MSG_008 -msgid "Yes" -msgstr "Ya" - -#. • IDD_NOTIFICATION → IDNO -#. • MSG_009 -msgid "No" -msgstr "Tidak" - -#. • IDD_LOG → IDD_LOG -msgid "Log" -msgstr "" - -#. • IDD_LOG → IDC_LOG_CLEAR -msgid "Clear" -msgstr "Padam" - -#. • IDD_LOG → IDC_LOG_SAVE -msgid "Save" -msgstr "Simpan" - -#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY -msgid "Update policy and settings" -msgstr "Kemaskini dasar dan tetapan" - -#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP -msgid "Settings" -msgstr "Tetapan" - -#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT -msgid "Check for updates" -msgstr "Semak untuk versi baharu" - -#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT -msgid "Include beta versions" -msgstr "Termasuk versi beta" - -#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW -msgid "Check Now" -msgstr "Semak sekarang" - -#. • IDD_NEW_VERSION → IDD_NEW_VERSION -msgid "Check For Updates - Rufus" -msgstr "Semak untuk versi baharu - Rufus" - -#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT -msgid "A newer version is available. Please download the latest version!" -msgstr "Terdapat versi Rufus yang baharu. Sila muat turun versi yang terkini!" - -#. • IDD_NEW_VERSION → IDC_WEBSITE -msgid "Click here to go to the website" -msgstr "Klik di sini untuk ke laman sesawang Rufus" - -#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP -msgid "Release Notes" -msgstr "Maklumat versi terbaharu" - -#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP -#. • IDD_NEW_VERSION → IDC_DOWNLOAD -#. • MSG_040 -msgid "Download" -msgstr "Muat turun" - -#. • MSG_001 -msgid "Other instance detected" -msgstr "Proses Rufus lain dikesan" - -#. • MSG_002 -msgid "" -"Another Rufus application is running.\n" -"Please close the first application before running another one." -msgstr "" -"Terdapat aplikasi Rufus sedang berjalan.\n" -"Sila tutup aplikasi tersebut sebelum melancarkan aplikasi Rufus baharu." - -#. • MSG_003 -msgid "" -"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\n" -"To continue with this operation, click OK. To quit click CANCEL." -msgstr "" -"AMARAN: SEMUA DATA DI DALAM PERANTI '%s' AKAN DIPADAM.\n" -"Jika hendak teruskan, klik OK. Untuk berhenti, klik BATAL." - -#. • MSG_004 -msgid "Rufus update policy" -msgstr "Dasar kemas kini Rufus" - -#. • MSG_005 -msgid "Do you want to allow Rufus to check for application updates online?" -msgstr "Adakah anda mahu membenarkan Rufus menyemak untuk versi baharu dalam talian?" - -#. • MSG_007 -msgid "Cancel" -msgstr "Batal" - -#. • MSG_010 -msgid "Bad blocks found" -msgstr "Blok rosak dijumpai" - -#. • MSG_011 -msgid "" -"Check completed: %d bad block(s) found\n" -" %d read error(s)\n" -" %d write error(s)\n" -" %d corruption error(s)" -msgstr "" -"Semak selesai: %d blok rosak dijumpai\n" -" %d ralat membaca\n" -" %d ralat menulis\n" -" %d ralat korupsi" - -#. • MSG_012 -#. -#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile -msgid "" -"%s\n" -"A more detailed report can be found in:\n" -"%s" -msgstr "" -"%s\n" -"Laporan lebih terperinci boleh dijumpai di:\n" -"%s" - -#. • MSG_013 -msgid "Disabled" -msgstr "Nyahaktif" - -#. • MSG_014 -msgid "Daily" -msgstr "Harian" - -#. • MSG_015 -msgid "Weekly" -msgstr "Mingguan" - -#. • MSG_016 -msgid "Monthly" -msgstr "Bulanan" - -#. • MSG_017 -msgid "Custom" -msgstr "Tetapan sendiri" - -#. • MSG_018 -msgid "Your version: %d.%d (Build %d)" -msgstr "Versi anda: %d.%d (Binaan %d)" - -#. • MSG_019 -msgid "Latest version: %d.%d (Build %d)" -msgstr "Versi terkini: %d.%d (Binaan %d)" - -#. • MSG_020 -#. • MSG_026 -msgid "bytes" -msgstr "bait" - -#. • MSG_021 -#. -#. *Short* version of the kilobyte size suffix -msgid "KB" -msgstr "" - -#. • MSG_022 -#. -#. *Short* version of the megabyte size suffix -msgid "MB" -msgstr "" - -#. • MSG_023 -#. -#. *Short* version of the gigabyte size suffix -msgid "GB" -msgstr "" - -#. • MSG_024 -#. -#. *Short* version of the terabyte size suffix -msgid "TB" -msgstr "" - -#. • MSG_025 -#. -#. *Short* version of the pentabyte size suffix -msgid "PB" -msgstr "" - -#. • MSG_027 -msgid "kilobytes" -msgstr "kilobait" - -#. • MSG_028 -msgid "megabytes" -msgstr "megabait" - -#. • MSG_029 -msgid "Default" -msgstr "Tetapan asal" - -#. • MSG_030 -#. -#. This gets appended to the file system, cluster size, etc. -msgid "%s (Default)" -msgstr "%s (Tetapan asal)" - -#. • MSG_031 -msgid "BIOS (or UEFI-CSM)" -msgstr "BIOS (atau UEFI-CSM)" - -#. • MSG_032 -msgid "UEFI (non CSM)" -msgstr "UEFI (bukan CSM)" - -#. • MSG_033 -msgid "BIOS or UEFI" -msgstr "BIOS atau UEFI" - -#. • MSG_034 -#. -#. Number of bad block check passes (singular for 1 pass) -msgid "%d pass" -msgstr "%d kali lulus" - -#. • MSG_035 -#. -#. Number of bad block check passes (plural for 2 or more passes). -#. See MSG_087 for the message that %s gets replaced with. -msgid "%d passes %s" -msgstr "%d kali lulus %s" - -#. • MSG_036 -msgid "ISO Image" -msgstr "Imej ISO" - -#. • MSG_037 -msgid "Application" -msgstr "Aplikasi" - -#. • MSG_038 -msgid "Abort" -msgstr "Batal" - -#. • MSG_039 -msgid "Launch" -msgstr "Mula" - -#. • MSG_041 -msgid "Operation cancelled by the user" -msgstr "Operasi dibatalkan oleh pengguna" - -#. • MSG_042 -msgid "Error" -msgstr "Ralat" - -#. • MSG_043 -msgid "Error: %s" -msgstr "Ralat: %s" - -#. • MSG_044 -msgid "File download" -msgstr "Muat turun fail" - -#. • MSG_045 -msgid "USB Storage Device (Generic)" -msgstr "Peranti storan USB (Generik)" - -#. • MSG_046 -msgid "%s (Disk %d) [%s]" -msgstr "%s (Cakera %d) [%s]" - -#. • MSG_047 -#. -#. Used when a drive is detected that contains more than one partition -msgid "Multiple Partitions" -msgstr "Beberapa Partisyen" - -#. • MSG_048 -msgid "Rufus - Flushing buffers" -msgstr "Rufus - 'Flush' penimbal" - -#. • MSG_049 -msgid "Rufus - Cancellation" -msgstr "Rufus - Pembatalan" - -#. • MSG_050 -msgid "Success." -msgstr "Berjaya." - -#. • MSG_051 -msgid "Undetermined error while formatting." -msgstr "Ralat yang tidak dapat ditentukan ketika memformat." - -#. • MSG_052 -msgid "Cannot use the selected file system for this media." -msgstr "Tidak boleh menggunakan sistem fail yang dipilih untuk media ini." - -#. • MSG_053 -msgid "Access to the device is denied." -msgstr "Akses kepada peranti dinafikan." - -#. • MSG_054 -msgid "Media is write protected." -msgstr "Tidak boleh menulis data ke peranti (Dilindungi)" - -#. • MSG_055 -msgid "The device is in use by another process. Please close any other process that may be accessing the device." -msgstr "Peranti ini digunakan oleh proses lain. Sila tutup mana-mana program yang mungkin menggunakan peranti ini." - -#. • MSG_056 -msgid "Quick format is not available for this device." -msgstr "Format pantas tidak boleh digunakan pada peranti ini." - -#. • MSG_057 -msgid "The volume label is invalid." -msgstr "Label jilid tidak sah." - -#. • MSG_058 -msgid "The device handle is invalid." -msgstr "Pengendali peranti tidak sah." - -#. • MSG_059 -msgid "The selected cluster size is not valid for this device." -msgstr "Saiz gugusan yang dipilih tidak boleh digunakan pada peranti ini." - -#. • MSG_060 -msgid "The volume size is invalid." -msgstr "Saiz jilid tidak sah." - -#. • MSG_061 -msgid "Please insert a removable media in drive." -msgstr "Sila masukkan media boleh alih ke dalam pemacu." - -#. • MSG_062 -msgid "An unsupported command was received." -msgstr "Arahan yang tidak disokong diterima." - -#. • MSG_063 -msgid "Memory allocation error." -msgstr "Kesilapan peruntukkan memori." - -#. • MSG_064 -msgid "Read error." -msgstr "Kesilapan membaca." - -#. • MSG_065 -msgid "Write error." -msgstr "Kesilapan menulis." - -#. • MSG_066 -msgid "Installation failure" -msgstr "Kegagalan memasang" - -#. • MSG_067 -msgid "Could not open media. It may be in use by another process. Please re-plug the media and try again." -msgstr "Media tidak boleh dibuka. Ia mungkin digunakan dalam proses yang lain. Sila cabut dan masukkan semula dan cuba sekali lagi." - -#. • MSG_068 -msgid "Could not partition drive." -msgstr "Tidak boleh partition drive." - -#. • MSG_069 -msgid "Could not copy files to target drive." -msgstr "Tidak boleh meyalin fail kepada pemacu." - -#. • MSG_070 -msgid "Cancelled by user." -msgstr "Dibatalkan oleh pengguna." - -#. • MSG_071 -#. -#. See http://en.wikipedia.org/wiki/Thread_%28computing%29 -msgid "Unable to start thread." -msgstr "Proses-proses kecil tidak boleh dimulakan." - -#. • MSG_072 -msgid "Bad blocks check didn't complete." -msgstr "Penyemakan blok rosak tidak dapat diselesaikan." - -#. • MSG_073 -msgid "ISO image scan failure." -msgstr "Kegagalan imbasan imej ISO." - -#. • MSG_074 -msgid "ISO image extraction failure." -msgstr "Pengekstrakan imej ISO gagal." - -#. • MSG_075 -msgid "Unable to remount volume." -msgstr "Tidak dapat melekap semula jilid." - -#. • MSG_076 -msgid "Unable to patch/setup files for boot." -msgstr "Tidak dapat menyediakan fail-fail untuk boot." - -#. • MSG_077 -msgid "Unable to assign a drive letter." -msgstr "Tidak dapat menetapkan huruf pemacu." - -#. • MSG_078 -msgid "Can't mount GUID volume." -msgstr "Tidak boleh lekap jilid GUID." - -#. • MSG_079 -msgid "The device is not ready." -msgstr "Peranti ini tidak sedia untuk digunakan." - -#. • MSG_080 -msgid "" -"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\n" -"\n" -"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\n" -"\n" -"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device..." -msgstr "" -"Rufus mengesan bahawa Windows masih lagi menarik penimbal ke dalam peranti USB.\n" -"\n" -"Bergantung kepada kelajuan peranti USB anda, operasi ini mungkin mengambil masa yang amat lama.Terutamanya untuk fail besar.\n" -"\n" -"Kami cadangkan anda biarkan proses Windows untuk tamat dahulu supaya mengelakkan korupsi.Namun, jika anda kesuntukan masa, anda boleh cabutkan peranti anda..." - -#. • MSG_081 -msgid "Unsupported image" -msgstr "Imej tidak disokong" - -#. • MSG_082 -msgid "This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus..." -msgstr "Imej ini sama ada tidak boleh boot, atau ia menggunakan kaedah boot atau mampatan yang tidak disokong oleh Rufus..." - -#. • MSG_083 -msgid "Replace %s?" -msgstr "Gantikan %s?" - -#. • MSG_084 -msgid "" -"This ISO image seems to use an obsolete version of '%s'.\n" -"Boot menus may not display properly because of this.\n" -"\n" -"A newer version can be downloaded by Rufus to fix this issue:\n" -"- Choose 'Yes' to connect to the internet and download the file\n" -"- Choose 'No' to leave the existing ISO file unmodified\n" -"If you don't know what to do, you should select 'Yes'.\n" -"\n" -"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically." -msgstr "" -"Imej ISO ini menggunakan versi '%s' yang telah lapuk.\n" -"Oleh sebab ini, menu boot mungkin tidak dipaparkan dengan betul.\n" -"\n" -"Versi yang lebih baharu boleh dimuat turun oleh Rufus untuk memperbaiki isu ini:\n" -"- Pilih 'Ya' untuk menyambung ke internet dan muat turun fail tersebut\n" -"- Pilih 'Tidak' untuk tidak mengubahsuai fail ISO yang digunakan\n" -"Jika anda tidak pasti apa yang perlu dilakukan, pilih 'Ya'.\n" -"\n" -"Perhatian: Fail yang dimuat turun akan disimpan di dalam direktori bersamaan dengan Rufus dan apabila terdapat '%s' , ia akan digunakan secara automatik." - -#. • MSG_085 -msgid "Downloading %s" -msgstr "Sedang memuat turun %s" - -#. • MSG_086 -msgid "No image selected" -msgstr "Tiada imej yang dipilih" - -#. • MSG_087 -#. -#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu -#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other -#. words, this message should mean "for a flash memory device of type %s". *Please* try to keep -#. the translation as short as possible so that it won't result in an overly large dropdown... -#. If you prefer, it's okay to use "type" or "device" instead of "NAND" (e.g. "for TLC type"). -#. See also MSG_035. -msgid "for %s NAND" -msgstr "untuk %s NAND" - -#. • MSG_088 -msgid "Image is too big" -msgstr "Imej terlalu besar" - -#. • MSG_089 -msgid "The image is too big for the selected target." -msgstr "Imej ini terlalu besar untuk sasaran yang dipilih." - -#. • MSG_090 -msgid "Unsupported ISO" -msgstr "ISO tidak disokong" - -#. • MSG_091 -msgid "When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS." -msgstr "Apabila menggunakan jenis sasaran UEFI , hanya imej boot jenis EFI sahaja disokong. Sila pilih ISO boot jenis EFI atau tukarkan jenis sasaran kepada BIOS." - -#. • MSG_092 -msgid "Unsupported filesystem" -msgstr "Sistem fail tidak disokong" - -#. • MSG_093 -msgid "" -"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\n" -"\n" -"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions." -msgstr "" -"PENTING: PERANTI INI MEMPUNYAI BEBERAPA PARTISYEN!!\n" -"\n" -"Ini mungkin termasuk partisyen/jilid yang tidak disenaraikan atau tidak boleh dilihat dari Windows. Jika anda mahu meneruskannya, anda bertanggungjawab ke atas kehilangan data dalam partisyen tersebut." - -#. • MSG_094 -msgid "Multiple partitions detected" -msgstr "Beberapa partisyen dikesan" - -#. • MSG_095 -msgid "DD Image" -msgstr "DD Imej" - -#. • MSG_096 -msgid "The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO." -msgstr "Sistem fail yang sedang dipilih tidak boleh digunakan dengan jenis ISO ini. Sila pilih sistem fail berlainan atau gunakan ISO berlainan." - -#. • MSG_097 -msgid "'%s' can only be applied if the file system is NTFS." -msgstr "'Windows To Go' hanya boleh digunakan jika sistem fail adalah NTFS." - -#. • MSG_098 -msgid "" -"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\n" -"\n" -"Do you still want to proceed?\n" -"\n" -"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public..." -msgstr "" -"PENTING: Anda cuba memasang 'Windows To Go', tetapi pemacu sasaran anda tidak mempunyai atribut 'FIXED'. Disebabkan ini Windows akan berkemungkinan besar sangkut sepanjang but, kerana Microsoft tidak merekanya untuk berfungsi dengan pemacu yang sebaliknya mempunyai atribut 'REMOVABLE'.\n" -"\n" -"Adakah anda masih mahu teruskan?\n" -"\n" -"Nota: Atribut 'FIXED/REMOVABLE'adalah sifat perkakasan yang hanya boleh ditukar menggunakan alatan tersuai daripada pengilang pemacu. Bagaimanapun alatan tersebut adalah HAMPIR TIDAK AKAN diberikan kepada umum..." - -#. • MSG_099 -msgid "Filesystem limitation" -msgstr "Had sistem fail" - -#. • MSG_100 -msgid "This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system." -msgstr "Imej ISO ini mengandungi fail yang lebih besar daripada 4 GB iaitu saiz maksima yang dibenarkan untuk sistem fail FAT atau FAT32." - -#. • MSG_101 -msgid "Missing WIM support" -msgstr "Tiada sokongan WIM" - -#. • MSG_102 -msgid "" -"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\n" -"Do you want to visit the 7-zip download page?" -msgstr "" -"Platform anda tidak boleh mengekstrak fail daripada arkib WIM. Ini diperlukan untuk mencipta cakera boot EFI Windows 7 dan Windows Vista. Anda boleh membaikinya dengan cara mendapatkan versi 7-Zip terbaharu.\n" -"Adakah anda mahu ke halaman muat turun 7-zip?" - -#. • MSG_103 -msgid "Download %s?" -msgstr "Muat turun %s?" - -#. • MSG_104 -#. -#. Example: "Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this -#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)" -msgid "" -"%s or later requires a '%s' file to be installed.\n" -"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\n" -"\n" -"Rufus can download the missing file for you:\n" -"- Select 'Yes' to connect to the internet and download the file\n" -"- Select 'No' if you want to manually copy this file on the drive later\n" -"\n" -"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically." -msgstr "" -"%s atau kemudian memerlukan fail '%s' di komputer anda.\n" -"Oleh sebab fail tersebut lebih besar daripada 100 KB dan sentiasa ada dalam imej %s, Ia tidak termasuk dalam Rufus.\n" -"\n" -"Rufus boleh memuat turun fail tersebut untuk anda:\n" -"- Pilih 'Ya' untuk muat turun fail tersebut\n" -"- Pilih 'Tidak' jika anda mahu menyalin fail tersebut secara manual ke cakera ini pada masa lain\n" -"\n" -"Perhatian: Fail akan dimuat turun ke direktori bersamaan Rufus dan apabila '%s' ada di sana, ia akan digunakan semula secara automatik." - -#. • MSG_105 -msgid "" -"Cancelling may leave the device in an UNUSABLE state.\n" -"If you are sure you want to cancel, click YES. Otherwise, click NO." -msgstr "" -"Pembatalan boleh menyebabkan peranti ini TIDAK BOLEH DIGUNAKAN SEMULA.\n" -"Jika anda pasti anda mahu membatalkannya, klik Ya. Sebaliknya, klik Tidak." - -#. • MSG_106 -msgid "Please select folder" -msgstr "Sila pilih folder" - -#. • MSG_107 -msgid "All files" -msgstr "Semua fail" - -#. • MSG_108 -msgid "Rufus log" -msgstr "Log Rufus" - -#. • MSG_109 -msgid "0x%02X (Disk %d)" -msgstr "0x%02X (Cakera %d)" - -#. • MSG_110 -#. -#. "Cluster size" should be the same as the label for IDS_CLUSTER_SIZE_TXT -#. "kilobytes" should be the same as in MSG_027 -msgid "" -"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\n" -"Please change the Cluster size or use FreeDOS." -msgstr "" -"MS-DOS tidak boleh boot daripada cakera yang menggunakan saiz gugusan 64 kilobait.\n" -"Sila tukarkan saiz gugusan atau gunakan FreeDOS." - -#. • MSG_111 -msgid "Incompatible Cluster size" -msgstr "Saiz gugusan tidak sesuai" - -#. • MSG_112 -#. -#. "%d:%02d" is a duration (mins:secs) -msgid "Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!" -msgstr "Pemformatan jilid UDF yang besar mengambil masa yang amat lama. Pada kelajuan USB 2.0, anggaran masa pemformatan adalah %d:%02d, dimana bar kemajuan akan kelihatan seperti ia tidak bergerak. Sila bersabar!" - -#. • MSG_113 -msgid "Large UDF volume" -msgstr "Jilid UDF besar" - -#. • MSG_114 -msgid "" -"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\n" -"\n" -"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\n" -"- Select 'Yes' to connect to the Internet and download these files\n" -"- Select 'No' to cancel the operation\n" -"\n" -"Note: The files will be downloaded in the current application directory and will be reused automatically if present." -msgstr "" -"Imej ini menggunakan Syslinux %s%s tetapi aplikasi ini hanya mempunyai fail pemasangan untukSyslinux %s%s.\n" -"\n" -"Oleh kerana versi-versi baharu Syslinux tidak serasi dengan satu sama lain, maka tidakwajar Rufus menyediakan semuanya, dua fail tambahan perlu dimuat turun dariInternet ('ldlinux.sys' dan 'ldlinux.bss'):\n" -"- Pilih 'Ya' untuk menyambung ke Internet dan memuat turun fail tersebut\n" -"- Pilih 'Tidak' untuk membatalkan operasi\n" -"\n" -"NOTA:Fail akan dimuat turun ke dalam direktori aplikasi ini dan akan digunakan semulasecara automatik sekiranya sedia ada." - -#. • MSG_115 -msgid "Download required" -msgstr "Muat turun diperlukan" - -#. • MSG_116 -#. -#. You should be able to test this message with Super Grub2 Disk ISO: -#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB) -msgid "" -"This image uses Grub %s but the application only includes the installation files for Grub %s.\n" -"\n" -"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\n" -"- Select 'Yes' to connect to the Internet and attempt to download it\n" -"- Select 'No' to use the default version from Rufus\n" -"- Select 'Cancel' to abort the operation\n" -"\n" -"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used." -msgstr "" -"Imej ini menggunakan Grub %s tetapi aplikasi hanya termasuk fail pemasangan untuk Grub %s.\n" -"\n" -"Sepertimana versi Grub berlainan mungkin tidak sesuai antara satu sama lain, dan ianya tidak mungkin untuk memasukkan mereka semua, Rufus akan cuba mengesan versi fail pemasangan Grub ('core.img') yang sepadan dengan salah satu daripada imej anda:\n" -"- Pilih 'Ya' untuk bersambung ke Internet dan cuba memuat turunnya\n" -"- Pilih 'Tidak' untuk menggunakan versi lalai dari Rufus\n" -"- Pilih 'Batal' untuk membatalkan operasi\n" -"\n" -"Nota: Fail akan dimuat turun dalam direktori aplikasi semasa dan akan digunakan semula secara automatik jika ada. Jika tiada padanan boleh dijumpai dalam talian, versi lalai akan digunakan." - -#. • MSG_117 -msgid "Standard Windows installation" -msgstr "Pemasangan Windows biasa" - -#. • MSG_118 -#. -#. Only translate this message *if* Microsoft has a specific name for -#. http://en.wikipedia.org/wiki/Windows_To_Go in your language. -#. Otherwise, you may add a parenthesis eg. "Windows To Go (<hint at what it does>)" -msgid "Windows To Go" -msgstr "" - -#. • MSG_119 -msgid "advanced drive properties" -msgstr "pilihan tambahan pemacu" - -#. • MSG_120 -msgid "advanced format options" -msgstr "pilihan format tambahan" - -#. • MSG_121 -msgid "Show %s" -msgstr "Tunjuk %s" - -#. • MSG_122 -msgid "Hide %s" -msgstr "Sembunyi %s" - -#. • MSG_123 -#. -#. A persistent partitions can be used with "Live" USB media to store data. -#. It means that data can be preserved across reboots on "Live" USB drives. -#. To test this feature, please download and select 'casper_test.iso' from: -#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso -msgid "Persistent partition size" -msgstr "Saiz pemetakan berterusan (persistence partition)" - -#. • MSG_124 -#. -#. This message appears in the persistence 'Size' control when the slider is set to 0. -#. It is okay to use "No partition" or "None" or "Deactivated" to indicate that a persistent partition will not be -#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width). -msgid "No persistence" -msgstr "Tidak berterusan" - -#. • MSG_125 -#. -#. Tooltips used for the peristence size slider and edit control -msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." -msgstr "Mengeset saiz pemetakan berterusan (persistent partition) untuk media 'live USB'. Setkan saiz kepada 0 untuk melumpuhkan pemetakan berterusan." - -#. • MSG_126 -msgid "Set the partition size units." -msgstr "Set saiz unit pemetakan." - -#. • MSG_127 -msgid "Do not show this message again" -msgstr "Henti papar mesej ini" - -#. • MSG_128 -msgid "Important notice about %s" -msgstr "Notis penting berkenaan %s" - -#. • MSG_129 -msgid "" -"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\n" -"For details on why this is necessary, see the 'More Information' button below." -msgstr "" -"Anda telah menghasilkan media yang menggunakan bootloader UEFI:NTFS. ANDA PERLU MEMATIKAN PILIHAN SECURE BOOT.\n" -"Untuk mengetahui dengan lebih lanjut, sila klik butang 'Maklumat Lanjut' di bawah." - -#. • MSG_130 -msgid "Windows image selection" -msgstr "Pemilihan imej Windows" - -#. • MSG_131 -msgid "" -"This ISO contains multiple Windows images.\n" -"Please select the image you wish to use for this installation:" -msgstr "" -"ISO ini mengandungi beberapa imej Windows.\n" -"Sila pilih imej yang anda ingin gunakan untuk pemasangan:" - -#. • MSG_132 -msgid "Another program or process is accessing this drive. Do you want to format it anyway?" -msgstr "Terdapat program atau proses lain sedang mencapai pemacu ini. Adakah anda mahu memformatnya juga?" - -#. • MSG_133 -msgid "" -"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\n" -"\n" -"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" -"\n" -"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." -msgstr "" -"Rufus telah mengesan bahawa anda sedang mencuba untuk mencipta media Windows To Go berasaskan imej ISO 1809.\n" -"\n" -"Memandangkan terdapat pepijat dari MICROSOFT, media ini akan menghadapi masalah (Blue Scree Of Death) semasa memulakan Windows, melainkan anda menukar fail 'WppRecorder.sys' kepada versi 1803.\n" -"\n" -"Sila ambil perhatian. Rufus tidak akan membaiki masalah ini kerana 'WppRecorder.sys' adalah hak cipta milik Microsoft dan kami tidak dapat menyertakan salinan fail berkenaan bersama-sama aplikasi ini..." - -#. • MSG_134 -msgid "" -"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\n" -"\n" -"Are you sure you want to continue?" -msgstr "" -"Memandangkan skema pemetakan MBR telah dipilih, Rufus akan menghasilkan petak storan media dengan saiz maksimum 2 TB, di mana %s ruang cakera adalah tidak tersedia.\n" -"\n" -"Adakah anda pasti ingin meneruskan operasi?" - -#. • MSG_135 -msgid "Version" -msgstr "Versi" - -#. • MSG_136 -msgid "Release" -msgstr "Keluaran" - -#. • MSG_137 -msgid "Edition" -msgstr "Edisi" - -#. • MSG_138 -msgid "Language" -msgstr "Bahasa" - -#. • MSG_139 -msgid "Architecture" -msgstr "Kerangka" - -#. • MSG_140 -msgid "Continue" -msgstr "Terus" - -#. • MSG_141 -msgid "Back" -msgstr "Undur" - -#. • MSG_142 -msgid "Please wait..." -msgstr "Sila tunggu..." - -#. • MSG_143 -msgid "Download using a browser" -msgstr "Muat turun menggunakan pelayar web" - -#. • MSG_144 -msgid "Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it." -msgstr "Muat turun ISO Windows tidak tersedia kerana Microsoft telah mengubah laman web mereka untuk menghalangnya." - -#. • MSG_145 -msgid "PowerShell 3.0 or later is required to run this script." -msgstr "PowerShell 3.0 atau versi lebih baru diperlukan untuk menjalankan skrip ini." - -#. • MSG_146 -msgid "Do you want to go online and download it?" -msgstr "Adakah anda ingin ke dalam talian dan memuat turun?" - -#. • MSG_148 -msgid "Running download script..." -msgstr "Menjalankan skrip untuk memuat turun..." - -#. • MSG_149 -msgid "Download ISO Image" -msgstr "Memuat turun imej ISO" - -#. • MSG_150 -msgid "Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise." -msgstr "Jenis komputer yang anda merancang untuk menggunakan cakera \"bootable\" ini. Adalah menjadi tanggungjawab anda untuk menentukan sama ada sasaran anda adalah jenis BIOS atau UEFI sebelum anda wujudkan cakera tersebut, kerana ia mungkin gagal untuk boot." - -#. • MSG_151 -#. -#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings. -msgid "'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode." -msgstr "'UEFI-CSM' bermaksud peranti hanya akan boot di dalam mod emulasi BIOS (juga dikenali sebagai 'Legacy Mode') dibawah UEFI, dan bukan dalam mod asli UEFI." - -#. • MSG_152 -msgid "'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode')." -msgstr "'bukan CSM' bermaksud peranti hanya akan boot di dalam mod asli UEFI, dan bukan di mod emulasi BIOS (juga dikenali sebagai 'Legacy Mode')." - -#. • MSG_153 -msgid "Test pattern: 0x%02X" -msgstr "Uji corak: 0x%02X" - -#. • MSG_154 -msgid "Test pattern: 0x%02X, 0x%02X" -msgstr "Uji corak: 0x%02X, 0x%02X" - -#. • MSG_155 -msgid "Test pattern: 0x%02X, 0x%02X, 0x%02X" -msgstr "Uji corak: 0x%02X, 0x%02X, 0x%02X" - -#. • MSG_156 -msgid "Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X" -msgstr "Uji corak: 0x%02X, 0x%02X, 0x%02X, 0x%02X" - -#. • MSG_157 -msgid "Sets the target filesystem" -msgstr "Menetapkan sistem fail sasaran" - -#. • MSG_158 -msgid "Minimum size that a block of data will occupy in the filesystem" -msgstr "Saiz minima satu blok data akan gunakan dalam sistem fail" - -#. • MSG_159 -msgid "" -"Use this field to set the drive label.\n" -"International characters are accepted." -msgstr "" -"Gunakan ini untuk tetapkan label cakera.\n" -"Huruf antarabangsa boleh digunakan." - -#. • MSG_160 -msgid "Toggle advanced options" -msgstr "Togel pilihan lanjutan" - -#. • MSG_161 -msgid "Check the device for bad blocks using a test pattern" -msgstr "Semak peranti untuk blok rosak menggunakan corak ujian" - -#. • MSG_162 -msgid "Uncheck this box to use the \"slow\" format method" -msgstr "Nyahtanda kotak ini untuk menggunakan kaedah pemformatan perlahan" - -#. • MSG_163 -msgid "Method that will be used to create partitions" -msgstr "Kaedah yang digunakan untuk mencipta partisyen" - -#. • MSG_164 -msgid "Method that will be used to make the drive bootable" -msgstr "Kaedah yang digunakan untuk membuat cakera boot" - -#. • MSG_165 -msgid "Click to select or download an image..." -msgstr "Klik untuk memilih atau memuat turun imej..." - -#. • MSG_166 -msgid "Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)" -msgstr "Klik kotak ini untuk membenarkan paparan label antarabangsa dan menetapkan ikon cakera (akan membuat fail autorun.inf)" - -#. • MSG_167 -msgid "Install an MBR that allows boot selection and can masquerade the BIOS USB drive ID" -msgstr "Memasang MBR yang membenarkan pilihan boot dan mampu menyamar ID BIOS USB" - -#. • MSG_168 -msgid "" -"Try to masquerade first bootable USB drive (usually 0x80) as a different disk.\n" -"This should only be necessary if you install Windows XP and have more than one disk." -msgstr "" -"Cuba menyamarkan cakera USB boot (biasanya 0x80) sebagai cakera lain.\n" -"Ini hanya diperlukan jika anda memasang Windows XP dan mempunyai lebih daripada satu cakera." - -#. • MSG_169 -msgid "" -"Create an extra hidden partition and try to align partitions boundaries.\n" -"This can improve boot detection for older BIOSes." -msgstr "" -"Ciptakan partisyen tambahan tersembunyi dan cuba melaraskan sempadan partisyen.\n" -"Ini boleh mempertingkatkan pengesanan boot untuk BIOS lama." - -#. • MSG_170 -msgid "Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!" -msgstr "Membolehkan penyenaraian pagaran cakera keras USB. GUNAKAN ATAS RISIKO SENDIRI!!!" - -#. • MSG_171 -msgid "" -"Start the formatting operation.\n" -"This will DESTROY any data on the target!" -msgstr "" -"Mulakan operasi pemformatan.\n" -"Ini akan MEMADAMKAN semua data pada sasaran!" - -#. • MSG_172 -#. -#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the -#. public key that is embedded in the application. This message appears in an error dialog if the validation fails. -msgid "Invalid download signature" -msgstr "Tandatangan digital muat turun tidak sah" - -#. • MSG_173 -msgid "Click to select..." -msgstr "Klik untuk memilih..." - -#. • MSG_174 -msgid "Rufus - The Reliable USB Formatting Utility" -msgstr "Rufus - Utiliti pemformatan USB yang dipercayai" - -#. • MSG_175 -msgid "Version %d.%d (Build %d)" -msgstr "Versi %d.%d (Build %d)" - -#. • MSG_176 -msgid "English translation: Pete Batard <mailto:pete@akeo.ie>" -msgstr "" -"Terjemahan Bahasa Malaysia:\\line\n" -"• Muhammad Aman <mailto:aman.tifli@gmail.com>\\line\n" -"• VGPlayer <mailto:razman90a@yahoo.com.my>\\line\n" -"• Mohamad Ikhwan bin Kori <mailto:ikhwankori@gmail.com>" - -#. • MSG_177 -msgid "Report bugs or request enhancements at:" -msgstr "Laporkan masalah atau cadangan penambahbaikan di:" - -#. • MSG_178 -msgid "Additional Copyrights:" -msgstr "Hak cipta tambahan:" - -#. • MSG_179 -msgid "Update Policy:" -msgstr "Polisi kemaskini:" - -#. • MSG_180 -msgid "If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):" -msgstr "Jika anda pilih untuk membenarkan perisian ini menyemak untuk aplikasi versi baharu, anda bersetuju untuk membenarkan pelayan kami mengumpulkan maklumat berikut:" - -#. • MSG_181 -msgid "Your operating system's architecture and version" -msgstr "Versi dan kerangka sistem operasi" - -#. • MSG_182 -msgid "The version of the application you use" -msgstr "Versi aplikasi yang anda gunakan" - -#. • MSG_183 -msgid "Your IP address" -msgstr "Alamat IP anda" - -#. • MSG_184 -msgid "For the purpose of generating private usage statistics, we may keep the information collected, \\b for at most a year\\b0 . However, we will not willingly disclose any of this individual data to third parties." -msgstr "Untuk tujuan menjana statistik penggunaan peribadi , kami mungkin menyimpan maklumat yang dikumpulkan, \\b untuk sekurang-kurangnya setahun\\b0 . Namun, kami tidak rela untuk mendedahkan maklumat ini kepada mana-mana pihak ketiga." - -#. • MSG_185 -msgid "Update Process:" -msgstr "Proses mengemas kini:" - -#. • MSG_186 -msgid "" -"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\line\n" -"Internet access is of course required when checking for updates." -msgstr "" -"Rufus tidak memasang atau menjalankan servis di latar belakang. Oleh itu, semakan kemas kini hanya dijalankan apabila aplikasi utama berjalan.\\line\n" -"Akses internet diperlukan untuk menyemak untuk versi baru." - -#. • MSG_187 -msgid "Invalid image for selected boot option" -msgstr "Imej tidak sah untuk pilihan boot yang dipilih" - -#. • MSG_188 -msgid "The current image doesn't match the boot option selected. Please use a different image or choose a different boot option." -msgstr "Imej\ttidak serasi dengan pilihan boot yang dipilih. Sila gunakan imej lain atau pilih pilihan boot lain." - -#. • MSG_189 -msgid "This ISO image is not compatible with the selected filesystem" -msgstr "Imej ISO ini tidak serasi dengan sistem fail yang dipilih" - -#. • MSG_190 -msgid "Incompatible drive detected" -msgstr "Pemacu tidak serasi dikesan" - -#. • MSG_191 -#. -#. Used in MSG_235 -msgid "Write pass" -msgstr "Melepasi tulisan" - -#. • MSG_192 -#. -#. Used in MSG_235 -msgid "Read pass" -msgstr "Melepasi bacaan" - -#. • MSG_193 -msgid "Downloaded %s" -msgstr "Muat turun %s" - -#. • MSG_194 -msgid "Could not download %s" -msgstr "Tidak boleh muat turun %s" - -#. • MSG_195 -#. -#. Example: "Using embedded version of Grub2 file(s)" -msgid "Using embedded version of %s file(s)" -msgstr "Menggunakan %s fail versi dibenam" - -#. • MSG_196 -msgid "" -"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\n" -"\n" -"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\n" -"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work." -msgstr "" -"PENTING: PEMACU INI MENGGUNAKAN SAIZ SEKTOR BUKAN PIAWAIAN!\n" -"\n" -"Pemacu konvensional mengunakan saiz sektor 512 bait tetapi pemacu ini menggunakan %d bait. Dalam banyak kes, ini bermaksud anda TIDAK akan mampu untuk but dari pemacu ini.\n" -"Rufus boleh cuba untuk mencipta pemacu boleh but, tetapi TIDAK ADA JAMINAN ianya akan berfungsi." - -#. • MSG_197 -msgid "Nonstandard sector size detected" -msgstr "Saiz sektor bukan standard dikesan" - -#. • MSG_198 -msgid "'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED." -msgstr "'Windows To Go' hanya boleh dipasang dalam pemacu berpartisyen GPT jika ia mempunyai set atribut 'FIXED'. Pemacu semasa tidak dikesan sebagai 'FIXED'." - -#. • MSG_199 -msgid "This feature is not available on this platform." -msgstr "Ciri ini tidak tersedia di platform ini." - -#. • MSG_201 -msgid "Cancelling - Please wait..." -msgstr "Sedang membatalkan - Sila tunggu..." - -#. • MSG_202 -msgid "Scanning image..." -msgstr "Mengimbas imej..." - -#. • MSG_203 -msgid "Failed to scan image" -msgstr "Imbasan imej gagal" - -#. • MSG_204 -#. -#. %s is the name of an obsolete Syslinux .c32 module. Example: "Obsolete vesamenu.c32 detected" -msgid "Obsolete %s detected" -msgstr "%s lapuk dikesan" - -#. • MSG_205 -#. -#. Display the name of the image selected. eg: "Using image: en_win7_x64_sp1.iso" -msgid "Using image: %s" -msgstr "Menggunakan imej: %s" - -#. • MSG_206 -#. -#. Example: "Missing ldlinux.c32 file" -msgid "Missing %s file" -msgstr "Tidak menjumpai fail %s" - -#. • MSG_207 -#. -#. The name proposed by Windows' Computer Management → Disk Management when you try to format -#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png. -msgid "New Volume" -msgstr "Jilid baharu" - -#. • MSG_208 -#. -#. Singular. Example: "1 device found" -msgid "%d device found" -msgstr "%d peranti dijumpai" - -#. • MSG_209 -#. -#. Plural. Example: "3 devices found" -msgid "%d devices found" -msgstr "%d peranti dijumpai" - -#. • MSG_210 -msgid "READY" -msgstr "SEDIA" - -#. • MSG_211 -msgid "Cancelled" -msgstr "DIBATALKAN" - -#. • MSG_212 -msgid "Failed" -msgstr "GAGAL" - -#. • MSG_213 -#. -#. Used when a new update has been downloaded and launched -msgid "Launching new application..." -msgstr "Melancarkan aplikasi baru..." - -#. • MSG_214 -msgid "Failed to launch new application" -msgstr "Gagal untuk melancarkan aplikasi baru" - -#. • MSG_215 -#. -#. Example: "Opened some_file.txt" -msgid "Opened %s" -msgstr "%s dibuka" - -#. • MSG_216 -#. -#. Example: "Saved rufus.log" -msgid "Saved %s" -msgstr "%s disimpan" - -#. • MSG_217 -#. -#. Formatting status -msgid "Formatting: %s" -msgstr "Pemformatan: %s" - -#. • MSG_218 -msgid "Creating file system: Task %d/%d completed" -msgstr "Mencipta sistem fail: Tugas %d/%d selesai" - -#. • MSG_219 -msgid "NTFS Fixup: %d%% completed" -msgstr "Pembaikian NTFS: %d%% selesai" - -#. • MSG_220 -#. -#. Parameter: the file system and an estimated duration in mins and secs. -#. Example: "Formatting (UDF) - Estimated duration 3:21..." -#. If "estimated duration" is too long, just use "estimated" or an abbreviation -msgid "Formatting (%s) - estimated duration %d:%02d..." -msgstr "Pemformatan (%s) - Jangka masa anggaran %d:%02d..." - -#. • MSG_221 -msgid "Setting label (%s)..." -msgstr "Menetapkan Label (%s)..." - -#. • MSG_222 -#. -#. Example: "Formatting (FAT32)..." -msgid "Formatting (%s)..." -msgstr "Pemformatan (%s)..." - -#. • MSG_223 -msgid "NTFS Fixup (Checkdisk)..." -msgstr "Pembaikian NTFS (Periksa cakera)..." - -#. • MSG_224 -msgid "Clearing MBR/PBR/GPT structures..." -msgstr "Memadam struktur MBR/PBR/GPT..." - -#. • MSG_225 -msgid "Requesting disk access..." -msgstr "Meminta akses cakera..." - -#. • MSG_226 -msgid "Analyzing existing boot records..." -msgstr "Menganalisis rekod boot sedia ada..." - -#. • MSG_227 -msgid "Closing existing volume..." -msgstr "Menutup jilid sedia ada..." - -#. • MSG_228 -msgid "Writing Master Boot Record..." -msgstr "Menulis \"Rekod master boot\"..." - -#. • MSG_229 -msgid "Writing Partition Boot Record..." -msgstr "Menulis \"Rekod boot partisyen\"..." - -#. • MSG_230 -msgid "Copying DOS files..." -msgstr "Menyalin fail DOS..." - -#. • MSG_231 -msgid "Copying ISO files: %s" -msgstr "Menyalin fail ISO: %s" - -#. • MSG_232 -msgid "Win7 EFI boot setup (%s)..." -msgstr "Persediaan boot EFI Win7 (%s)..." - -#. • MSG_233 -msgid "Finalizing, please wait..." -msgstr "Menyiapkan, sila tunggu..." - -#. • MSG_234 -#. -#. Takes a Syslinux version as parameter. -#. Example: "Installing Syslinux v5.10..." -msgid "Installing Syslinux %s..." -msgstr "Memasang Syslinux %s..." - -#. • MSG_235 -#. -#. Bad blocks status. Example: "Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)" -#. See MSG_191 & MSG_192 for "Write pass"/"Read pass" translation. -msgid "Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)" -msgstr "Blok rosak: %s %d/%d - %0.2f%% (%d/%d/%d kesilapan)" - -#. • MSG_236 -msgid "Bad Blocks: Testing with random pattern" -msgstr "Blok rosak: menguji dengan corak rawak" - -#. • MSG_237 -msgid "Bad Blocks: Testing with pattern 0x%02X" -msgstr "Blok rosak: Menguji dengan corak 0x%02X" - -#. • MSG_238 -#. -#. Example: "Partitioning (MBR)..." -msgid "Partitioning (%s)..." -msgstr "Mempartisyenkan (%s)..." - -#. • MSG_239 -msgid "Deleting partitions (%s)..." -msgstr "Memadam partisyen (%s)..." - -#. • MSG_240 -#. -#. This message has to do with the signature validation that Rufus uses when downloading an update. -msgid "" -"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\n" -"\n" -"The download will be deleted. Please check the log for more details." -msgstr "" -"Tandatangan untuk pengemaskinian telah dimuat turun tidak dapat disahkan. Ini boleh bermakna bahawa sistem anda dikonfigurasi dengan salah untuk pengesahan tandatangan atau menunjukkan fail yang dimuat turun berisi dengan virus\n" -"\n" -"Fail yang dimuat turun akan dihapuskan. Sila periksa log untuk maklumat lanjut." - -#. • MSG_241 -msgid "Downloading: %s" -msgstr "Memuat turun: %s" - -#. • MSG_242 -msgid "Failed to download file." -msgstr "Gagal memuat turun fail." - -#. • MSG_243 -msgid "Checking for Rufus updates..." -msgstr "Memeriksa untuk kemas kini Rufus..." - -#. • MSG_244 -msgid "Updates: Unable to connect to the internet" -msgstr "Kemas kini: Tidak dapat menyambung ke internet" - -#. • MSG_245 -msgid "Updates: Unable to access version data" -msgstr "Kemas kini: Tidak dapat mengakses data versi" - -#. • MSG_246 -msgid "A new version of Rufus is available!" -msgstr "Versi baru Rufus boleh didapati!" - -#. • MSG_247 -msgid "No new version of Rufus was found" -msgstr "Tiada versi baru Rufus didapati" - -#. • MSG_248 -msgid "Application registry keys successfully deleted" -msgstr "Kekunci daftar aplikasi berjaya dipadam" - -#. • MSG_249 -msgid "Failed to delete application registry keys" -msgstr "Gagal memadam kekunci daftar aplikasi" - -#. • MSG_250 -#. -#. Example: "Fixed disk detection enabled", "ISO size check disabled", etc. -msgid "%s enabled" -msgstr "%s dibolehkan" - -#. • MSG_251 -msgid "%s disabled" -msgstr "%s tidak dibolehkan" - -#. • MSG_252 -msgid "Size checks" -msgstr "Menyemak saiz" - -#. • MSG_253 -msgid "Hard disk detection" -msgstr "Pengesanan cakera keras" - -#. • MSG_254 -msgid "Force large FAT32 formatting" -msgstr "Memaksa pemformatan FAT32 besar" - -#. • MSG_255 -msgid "NoDriveTypeAutorun will be deleted on exit" -msgstr "NoDriveTypeAutorun akan dipadam apabila keluar" - -#. • MSG_256 -msgid "Fake drive detection" -msgstr "Pengesanan cakera palsu" - -#. • MSG_257 -msgid "Joliet support" -msgstr "Sokongan Joliet" - -#. • MSG_258 -msgid "Rock Ridge support" -msgstr "Sokongan Rock Ridge" - -#. • MSG_259 -msgid "Force update" -msgstr "Paksa kemas kini" - -#. • MSG_260 -msgid "NTFS compression" -msgstr "Mampatan NTFS" - -#. • MSG_261 -msgid "Writing image: %s" -msgstr "Menulis imej: %s" - -#. • MSG_262 -#. -#. Cheat mode message to disable ISO Support, so that only DD images can be opened -msgid "ISO Support" -msgstr "Sokongan ISO" - -#. • MSG_263 -#. -#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination! -msgid "Use PROPER size units" -msgstr "Guna saiz seunit yang BETUL" - -#. • MSG_264 -msgid "Deleting directory '%s'" -msgstr "Memadam direktori '%s'" - -#. • MSG_265 -msgid "VMWare disk detection" -msgstr "Pengesanan cakera VMWare" - -#. • MSG_266 -msgid "Dual UEFI/BIOS mode" -msgstr "Mod dwi UEFI/BIOS" - -#. • MSG_267 -msgid "Applying Windows image: %s" -msgstr "Menggunakan imej Windows: %s" - -#. • MSG_268 -msgid "Applying Windows image..." -msgstr "Menggunakan imej Windows..." - -#. • MSG_269 -msgid "Preserve timestamps" -msgstr "Mengekalkan cap masa" - -#. • MSG_270 -msgid "USB debug" -msgstr "Nyahpijat USB" - -#. • MSG_271 -msgid "Computing image checksums: %s" -msgstr "Mengira semak tambah imej: %s" - -#. • MSG_272 -msgid "Compute the MD5, SHA1 and SHA256 checksums for the selected image" -msgstr "Mengira semak tambah MD5, SHA1 dan SHA256 imej dipilih" - -#. • MSG_273 -msgid "Change the application language" -msgstr "Menukar bahasa aplikasi" - -#. • MSG_274 -msgid "%s image detected" -msgstr "%s imej dikesan" - -#. • MSG_275 -#. -#. '%s' will be replaced with your translations for MSG_036 ("ISO Image") and MSG_095 ("DD Image") -msgid "" -"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\n" -"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\n" -"However, if you encounter issues during boot, you can try writing this image again in %s mode.\n" -"\n" -"Please select the mode that you want to use to write this image:" -msgstr "" -"Imej yang anda telah pilih adalah imej 'ISOHybrid'. Ini bermaksud ia boleh ditulis sama ada dalam %s mod (salinan fail) atau %s mod (imej cakera).\n" -"Rufus galakkan menggunakan mod %s, jadi anda selalu mempunyai akses penuh ke pemacu selepas menulisnya.\n" -"Bagaimanapun, jika anda menghadapi isu-isu semasa boot, anda boleh cuba menulis imej ini lagi dalam mod %s.\n" -"\n" -"Sila pilih mod yang anda mahu guna untuk menulis imej ini:" - -#. • MSG_276 -#. -#. '%s' will be replaced with your translation for MSG_036 ("ISO Image") -msgid "Write in %s mode (Recommended)" -msgstr "Menulis dalam mod %s (Digalakkan)" - -#. • MSG_277 -#. -#. '%s' will be replaced with your translation for MSG_095 ("DD Image") -msgid "Write in %s mode" -msgstr "Menulis dalam mod %s" - -#. • MSG_278 -msgid "Checking for conflicting processes..." -msgstr "Menyemak proses yang berkonflik." - -#. • MSG_279 -msgid "Non bootable" -msgstr "Tidak boleh boot" - -#. • MSG_280 -msgid "Disk or ISO image" -msgstr "Cakera atau imej ISO" - -#. • MSG_281 -msgid "%s (Please select)" -msgstr "%s (Sila pilih)" - -#. • MSG_282 -msgid "Exclusive USB drive locking" -msgstr "Penguncian pemacu USB eksklusif" - -#. • MSG_283 -msgid "Invalid signature" -msgstr "Tandatangan tidak sah" - -#. • MSG_284 -msgid "The downloaded executable is missing a digital signature." -msgstr "'Executable' yang dimuat turun kehilangan tandatangan digital." - -#. • MSG_285 -msgid "" -"The downloaded executable is signed by '%s'.\n" -"This is not a signature we recognize and could indicate some form of malicious activity...\n" -"Are you sure you want to run this file?" -msgstr "" -"'Executable' yang dimuat turun ditandatangani oleh '%s'.\n" -"Ini bukannya tandatangan yang kami kenal dan boleh menunjukkan beberapa bentuk aktiviti berniat jahat...\n" -"Adakah anda pasti anda mahu menjalankan fail ini?" - -#. • MSG_286 -msgid "Zeroing drive: %s" -msgstr "Mensifarkan pemacu: %s" - -#. • MSG_287 -msgid "Detection of non-USB removable drives" -msgstr "Mengesan cakera bukan USB" - -#. • MSG_288 -msgid "Missing elevated privileges" -msgstr "Hilang hak kebenaran istimewa" - -#. • MSG_289 -msgid "This application can only run with elevated privileges" -msgstr "Aplikasi ini hanya boleh digunakan apabila diberikan hak kebenaran istimewa" - -#. • MSG_290 -msgid "File Indexing" -msgstr "Pengindeksan Fail" - -#. • MSG_291 -msgid "Version selection" -msgstr "Pemilihan versi" - -#. • MSG_292 -msgid "Please select the version of Windows you want to install:" -msgstr "Sila pilih versi Windows yang anda ingin memasang:" - -#. • MSG_293 -msgid "Unsupported Windows version" -msgstr "Versi Windows tidak disokong" - -#. • MSG_294 -msgid "" -"This version of Windows is no longer supported by Rufus.\n" -"The last version of Rufus compatible with this platform is v%d.%d." -msgstr "" -"Versi Windows ini tidak lagi disokong oleh Rufus.\n" -"Versi terakhir Rufus yang serasi dengan platform ini ialah v%d.%d." - -#. • MSG_295 -msgid "Warning: Unofficial version" -msgstr "Amaran: versi bukan rasmi" - -#. • MSG_296 -msgid "" -"This version of Rufus was not produced by its official developer(s).\n" -"\n" -"Are you sure you want to run it?" -msgstr "" -"Versi Rufus ini bukan dibuat oleh pemaju-pemaju rasmi Rufus. \n" -"\n" -"Adakan anda yakin ingin menggunakannya?" - -#. • MSG_297 -msgid "Truncated ISO detected" -msgstr "ISO yang dipenggal dikesan" - -#. • MSG_298 -msgid "" -"The ISO file you have selected does not match its declared size: %s of data is missing!\n" -"\n" -"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\n" -"\n" -"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button." -msgstr "" -"Saiz fail ISO yang anda pilih adalah tidak sama dengan saiz yang diisytiharkan oleh fail ISO ini. %s data telah hilang!\n" -"\n" -"Jika fail ini diperolehi dari intenet, anda sepatutnya muat turun semula fail ini dan sahkan bahawa tandatangan MD5 atau SHA adalah sama dengan versi yang rasmi.\n" -"\n" -"Anda boleh dapatkan MD5 atau SHA fail yang dipilih ini dengan menekan butang (✓). Kemudian anda perlu membandingkan dengan MD5 atau SHA daripada fail yang rasmi." - -#. • MSG_299 -msgid "Timestamp validation error" -msgstr "Ralat validasi cap waktu" - -#. • MSG_300 -msgid "" -"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\n" -"\n" -"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details." -msgstr "" -"Rufus tidak dapat mengesahkan bahawa kemas kini yang dimuat turun adalah lebih baru daripada aplikasi yang dijalankan sekarang.\n" -"\n" -"Untuk mengelakkan daripada senario dimana PC diserang dengan virus, proses kemaskini telah dibatalkan dan fail yang telah dimuat turun akan dipadam. Sila semak log untuk maklumat lanjut." - -#. • MSG_301 -msgid "Show application settings" -msgstr "Tunjuk tetapan aplikasi" - -#. • MSG_302 -msgid "Show information about this application" -msgstr "Paparkan maklumat tentang aplikasi ini" - -#. • MSG_303 -msgid "Show the log" -msgstr "Paparkan log" - -#. • MSG_304 -msgid "Create a disk image of the selected device" -msgstr "Cipta imej cakera untuk peranti yang dipilih" - -#. • MSG_305 -msgid "Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go)." -msgstr "Pilih pilihan ini jika anda mahu memasang Windows pada komputer lain atau ingin menggunakan Windows terus daripada cakera/media ini (Windows To Go)" - -#. • MSG_306 -#. -#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START. -#. It's the same as MSG_286 but with a process that *may* be faster, hence the name. -msgid "Fast-zeroing drive: %s" -msgstr "Mensifarkan pemacu 'Fast': %s" - -#. • MSG_307 -msgid "this may take a while" -msgstr "ini mungkin mengambil sedikit masa" - -#. • MSG_308 -msgid "VHD detection" -msgstr "Pengesanan VHD" - -#. • MSG_309 -msgid "Compressed archive" -msgstr "Arkib termampat" - -#. • MSG_310 -msgid "" -"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\n" -"\n" -"Please select the mode that you want to use to write this image:" -msgstr "" -"ISO yang anda pilih menggunakan UEFI dan cukup kecil untuk ditulis sebagai Partition Sistem EFI (ESP). Menulis kepada ESP, bukannya menulis kepada partition data generik yang menduduki keseluruhan cakera, boleh menjadi lebih baik untuk beberapa jenis pemasangan.\n" -"\n" -"Sila pilih mod yang anda mahu gunakan untuk menulis imej ini:" - -#. • MSG_311 -msgid "Use %s (in the main application window) to enable." -msgstr "Gunakan %s (dalam tetingkap aplikasi utama) untuk mendayakan." - -#. • MSG_312 -msgid "Extra hashes (SHA512)" -msgstr "Cincangan tambahan (SHA512)" - -#. • MSG_313 -msgid "Save to VHD" -msgstr "Simpan ke VHD" - -#. • MSG_314 -msgid "Compute image checksums" -msgstr "Pengiraan semakan imej" - -#. • MSG_315 -msgid "Multiple buttons" -msgstr "Pelbagai butang" - -#. • MSG_316 -msgid "Number of passes" -msgstr "Bilangan pas" - -#. • MSG_317 -msgid "Disk ID" -msgstr "ID Cakera" - -#. • MSG_318 -msgid "Default thread priority: %d" -msgstr "Keutamaan benang lalai: %d" - -#. • MSG_319 -msgid "Ignore Boot Marker" -msgstr "Abaikan penanda but" - -#. • MSG_320 -msgid "Refreshing partition layout (%s)..." -msgstr "Tataletak partition yang menyegarkan (%s)..." - -#. • MSG_321 -msgid "" -"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\n" -"As a result, DD image writing mode will be enforced." -msgstr "" -"Imej yang anda pilih ialah ISOHybrid, tetapi penciptanya tidak menjadikannya serasi dengan mod salinan ISO/Fail.\n" -"Akibatnya, mod penulisan imej DD akan dikuatkuasakan." - -#. • MSG_322 -msgid "Unable to open or read '%s'" -msgstr "Tidak dapat membuka atau membaca '%s'" - -#. • MSG_325 -msgid "Applying Windows customization: %s" -msgstr "Menggunakan penyesuaian Windows: %s" - -#. • MSG_326 -msgid "Applying user options..." -msgstr "Menggunakan pilihan pengguna..." - -#. • MSG_327 -msgid "Windows User Experience" -msgstr "Pengalaman Pengguna Windows" - -#. • MSG_328 -msgid "Customize Windows installation?" -msgstr "Sesuaikan pemasangan Windows?" - -#. • MSG_329 -msgid "Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0" -msgstr "Alih keluar keperluan untuk 4GB+ RAM, But Selamat dan TPM 2.0" - -#. • MSG_330 -msgid "Remove requirement for an online Microsoft account" -msgstr "Alih keluar keperluan untuk akaun Microsoft dalam talian" - -#. • MSG_331 -msgid "Disable data collection (Skip privacy questions)" -msgstr "Nyahdayakan pengumpulan data (Langkau soalan privasi)" - -#. • MSG_332 -msgid "Prevent Windows To Go from accessing internal disks" -msgstr "Halang Windows To Go daripada mengakses cakera dalaman" - -#. • MSG_333 -msgid "Create a local account with username:" -msgstr "Buat akaun tempatan dengan nama pengguna:" - -#. • MSG_334 -msgid "Set regional options to the same values as this user's" -msgstr "Mengesetkan opsyen rantau kepada nilai yang sama seperti pengguna ini" - -#. • MSG_335 -msgid "Disable BitLocker automatic device encryption" -msgstr "Lumpuhkan penyulitan peranti automatik BitLocker" - -#. • MSG_336 -msgid "Persistent log" -msgstr "Log berterusan" - -#. • MSG_900 -#. -#. The following messages are for the Windows Store listing only and are not used by the application -msgid "Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc." -msgstr "Rufus adalah utiliti yang membantu memformat dan mencipta pemacu kilat USB boot, seperti pemacu pen/kekunci USB, kayu memori, dan lain-lain." - -#. • MSG_901 -msgid "Official site: %s" -msgstr "Laman rasmi: %s" - -#. • MSG_902 -msgid "Source Code: %s" -msgstr "Kod Sumber: %s" - -#. • MSG_903 -msgid "ChangeLog: %s" -msgstr "" - -#. • MSG_904 -#. -#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html) -#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here. -msgid "" -"This application is licensed under the terms of the GNU Public License (GPL) version 3.\n" -"See https://www.gnu.org/licenses/gpl-3.0.en.html for details." -msgstr "" -"Permohonan ini dilesenkan di bawah syarat-syarat Lesen Awam GNU (GPL) versi 3.\n" -"Lihat https://www.gnu.org/licenses/gpl-3.0.html untuk butiran." - -#. • MSG_905 -#. -#. Keyword for "boot" will be used for search in the Windows Store -msgid "Boot" -msgstr "" - -#. • MSG_910 -#. -#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page -msgid "Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" -msgstr "Formatkan USB, kad flash dan pemacu maya kepada FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" - -#. • MSG_911 -msgid "Create FreeDOS bootable USB drives" -msgstr "Buat pemacu USB boleh boot FreeDOS" - -#. • MSG_912 -msgid "Create bootable drives from bootable ISOs (Windows, Linux, etc.)" -msgstr "Buat pemacu boleh boot daripada ISO boleh boot (Windows, Linux, dll.)" - -#. • MSG_913 -msgid "Create bootable drives from bootable disk images, including compressed ones" -msgstr "Buat pemacu boleh boot daripada imej cakera boleh boot, termasuk yang dimampatkan" - -#. • MSG_914 -msgid "Create BIOS or UEFI bootable drives, including UEFI bootable NTFS" -msgstr "Buat pemacu boleh boot BIOS atau UEFI, termasuk NTFS boleh boot UEFI" - -#. • MSG_915 -msgid "Create 'Windows To Go' drives" -msgstr "Buat pemacu 'Windows To Go'" - -#. • MSG_916 -msgid "Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot" -msgstr "Buat pemacu pemasangan Windows 11 untuk PC yang tidak mempunyai TPM atau But Selamat" - -#. • MSG_917 -msgid "Create persistent Linux partitions" -msgstr "Buat partition Linux berterusan" - -#. • MSG_918 -msgid "Create VHD/DD images of the selected drive" -msgstr "Buat imej VHD/DD bagi pemacu yang dipilih" - -#. • MSG_919 -msgid "Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image" -msgstr "Kira MD5, SHA-1, SHA-256 dan SHA-512 checksum imej yang dipilih" - -#. • MSG_920 -msgid "Perform bad blocks checks, including detection of \"fake\" flash drives" -msgstr "Melakukan pemeriksaan blok buruk, termasuk pengesanan pemacu kilat \"palsu\"" - -#. • MSG_921 -msgid "Download official Microsoft Windows retail ISOs" -msgstr "Muat turun rasmi ISO runcit Microsoft Windows" - -#. • MSG_922 -msgid "Download UEFI Shell ISOs" -msgstr "Muat turun ISO Shell UEFI" +msgid "" +msgstr "" +"Project-Id-Version: 4.14\n" +"Report-Msgid-Bugs-To: pete@akeo.ie\n" +"POT-Creation-Date: 2026-04-30 21:19+0300\n" +"PO-Revision-Date: 2026-04-30 21:44+0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: ms_MY\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Rufus-LanguageName: Malay (Bahasa Malaysia)\n" +"X-Rufus-LCID: 0x043e, 0x083e\n" +"X-Generator: Poedit 3.6\n" + +#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT +msgid "Drive Properties" +msgstr "Sifat cakera" + +#. • IDD_DIALOG → IDS_DEVICE_TXT +msgid "Device" +msgstr "Peranti" + +#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT +msgid "Boot selection" +msgstr "Jenis boot" + +#. • IDD_DIALOG → IDC_SELECT +msgid "Select" +msgstr "Pilih" + +#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT +msgid "Image Option" +msgstr "Pilihan Imej" + +#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT +msgid "Partition scheme" +msgstr "Skema partisyen" + +#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT +msgid "Target system" +msgstr "Sistem yang akan dipasang" + +#. • IDD_DIALOG → IDC_LIST_USB_HDD +msgid "List USB Hard Drives" +msgstr "Senaraikan Cakera Keras USB" + +#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES +#. +#. It is acceptable to drop the parenthesis () if you are running out of space +#. as there is a tooltip (MSG_169) providing these details. +msgid "Add fixes for old BIOSes (extra partition, align, etc.)" +msgstr "Tambah pembaikan untuk BIOS lama" + +#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION +#. +#. It is acceptable to drop the "runtime" if you are running out of space +msgid "Enable runtime UEFI media validation" +msgstr "Dayakan pengesahan media UEFI masa jalan" + +#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT +msgid "Format Options" +msgstr "Pilihan format" + +#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT +msgid "File system" +msgstr "Sistem fail" + +#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT +msgid "Cluster size" +msgstr "Saiz gugusan" + +#. • IDD_DIALOG → IDS_LABEL_TXT +msgid "Volume label" +msgstr "Label jilid baharu" + +#. • IDD_DIALOG → IDC_QUICK_FORMAT +msgid "Quick format" +msgstr "Format pantas" + +#. • IDD_DIALOG → IDC_BAD_BLOCKS +msgid "Check device for bad blocks" +msgstr "Semak peranti untuk blok rosak" + +#. • IDD_DIALOG → IDC_EXTENDED_LABEL +msgid "Create extended label and icon files" +msgstr "Cipta label lanjut dan fail ikon" + +#. • IDD_DIALOG → IDS_STATUS_TXT +msgid "Status" +msgstr "" + +#. • IDD_DIALOG → IDCANCEL +#. • IDD_LICENSE → IDCANCEL +#. • IDD_LOG → IDCANCEL +#. • IDD_UPDATE_POLICY → IDCANCEL +#. • IDD_NEW_VERSION → IDCANCEL +#. • MSG_006 +msgid "Close" +msgstr "Tutup" + +#. • IDD_DIALOG → IDC_START +msgid "Start" +msgstr "Mula" + +#. • IDD_ABOUTBOX → IDD_ABOUTBOX +msgid "About Rufus" +msgstr "Mengenai Rufus" + +#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE +msgid "License" +msgstr "Lesen" + +#. • IDD_ABOUTBOX → IDOK +msgid "OK" +msgstr "" + +#. • IDD_LICENSE → IDD_LICENSE +msgid "Rufus License" +msgstr "Lesen Rufus" + +#. • IDD_NOTIFICATION → IDC_MORE_INFO +msgid "More information" +msgstr "Maklumat lanjut" + +#. • IDD_NOTIFICATION → IDYES +#. • MSG_008 +msgid "Yes" +msgstr "Ya" + +#. • IDD_NOTIFICATION → IDNO +#. • MSG_009 +msgid "No" +msgstr "Tidak" + +#. • IDD_LOG → IDD_LOG +msgid "Log" +msgstr "" + +#. • IDD_LOG → IDC_LOG_CLEAR +msgid "Clear" +msgstr "Padam" + +#. • IDD_LOG → IDC_LOG_SAVE +msgid "Save" +msgstr "Simpan" + +#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY +msgid "Update policy and settings" +msgstr "Kemaskini dasar dan tetapan" + +#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP +msgid "Settings" +msgstr "Tetapan" + +#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT +msgid "Check for updates" +msgstr "Semak untuk versi baharu" + +#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT +msgid "Include beta versions" +msgstr "Termasuk versi beta" + +#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW +msgid "Check Now" +msgstr "Semak sekarang" + +#. • IDD_NEW_VERSION → IDD_NEW_VERSION +msgid "Check For Updates - Rufus" +msgstr "Semak untuk versi baharu - Rufus" + +#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT +msgid "A newer version is available. Please download the latest version!" +msgstr "Terdapat versi Rufus yang baharu. Sila muat turun versi yang terkini!" + +#. • IDD_NEW_VERSION → IDC_WEBSITE +msgid "Click here to go to the website" +msgstr "Klik di sini untuk ke laman sesawang Rufus" + +#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP +msgid "Release Notes" +msgstr "Maklumat versi terbaharu" + +#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP +#. • IDD_NEW_VERSION → IDC_DOWNLOAD +#. • MSG_040 +msgid "Download" +msgstr "Muat turun" + +#. • MSG_001 +msgid "Other instance detected" +msgstr "Proses Rufus lain dikesan" + +#. • MSG_002 +msgid "" +"Another Rufus application is running.\n" +"Please close the first application before running another one." +msgstr "" +"Terdapat aplikasi Rufus sedang berjalan.\n" +"Sila tutup aplikasi tersebut sebelum melancarkan aplikasi Rufus baharu." + +#. • MSG_003 +msgid "" +"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\n" +"To continue with this operation, click OK. To quit click CANCEL." +msgstr "" +"AMARAN: SEMUA DATA DI DALAM PERANTI '%s' AKAN DIPADAM.\n" +"Jika hendak teruskan, klik OK. Untuk berhenti, klik BATAL." + +#. • MSG_004 +msgid "Rufus update policy" +msgstr "Dasar kemas kini Rufus" + +#. • MSG_005 +msgid "Do you want to allow Rufus to check for application updates online?" +msgstr "Adakah anda mahu membenarkan Rufus menyemak untuk versi baharu dalam talian?" + +#. • MSG_007 +msgid "Cancel" +msgstr "Batal" + +#. • MSG_010 +msgid "Bad blocks found" +msgstr "Blok rosak dijumpai" + +#. • MSG_011 +msgid "" +"Check completed: %d bad block(s) found\n" +" %d read error(s)\n" +" %d write error(s)\n" +" %d corruption error(s)" +msgstr "" +"Semak selesai: %d blok rosak dijumpai\n" +" %d ralat membaca\n" +" %d ralat menulis\n" +" %d ralat korupsi" + +#. • MSG_012 +#. +#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile +msgid "" +"%s\n" +"A more detailed report can be found in:\n" +"%s" +msgstr "" +"%s\n" +"Laporan lebih terperinci boleh dijumpai di:\n" +"%s" + +#. • MSG_013 +msgid "Disabled" +msgstr "Nyahaktif" + +#. • MSG_014 +msgid "Daily" +msgstr "Harian" + +#. • MSG_015 +msgid "Weekly" +msgstr "Mingguan" + +#. • MSG_016 +msgid "Monthly" +msgstr "Bulanan" + +#. • MSG_017 +msgid "Custom" +msgstr "Tetapan sendiri" + +#. • MSG_018 +msgid "Your version: %d.%d (Build %d)" +msgstr "Versi anda: %d.%d (Binaan %d)" + +#. • MSG_019 +msgid "Latest version: %d.%d (Build %d)" +msgstr "Versi terkini: %d.%d (Binaan %d)" + +#. • MSG_020 +#. • MSG_026 +msgid "bytes" +msgstr "bait" + +#. • MSG_021 +#. +#. *Short* version of the kilobyte size suffix +msgid "KB" +msgstr "" + +#. • MSG_022 +#. +#. *Short* version of the megabyte size suffix +msgid "MB" +msgstr "" + +#. • MSG_023 +#. +#. *Short* version of the gigabyte size suffix +msgid "GB" +msgstr "" + +#. • MSG_024 +#. +#. *Short* version of the terabyte size suffix +msgid "TB" +msgstr "" + +#. • MSG_025 +#. +#. *Short* version of the petabyte size suffix +msgid "PB" +msgstr "" + +#. • MSG_027 +msgid "kilobytes" +msgstr "kilobait" + +#. • MSG_028 +msgid "megabytes" +msgstr "megabait" + +#. • MSG_029 +msgid "Default" +msgstr "Tetapan asal" + +#. • MSG_030 +#. +#. This gets appended to the file system, cluster size, etc. +msgid "%s (Default)" +msgstr "%s (Tetapan asal)" + +#. • MSG_031 +msgid "BIOS (or UEFI-CSM)" +msgstr "BIOS (atau UEFI-CSM)" + +#. • MSG_032 +msgid "UEFI (non CSM)" +msgstr "UEFI (bukan CSM)" + +#. • MSG_033 +msgid "BIOS or UEFI" +msgstr "BIOS atau UEFI" + +#. • MSG_034 +#. +#. Number of bad block check passes (singular for 1 pass) +msgid "%d pass" +msgstr "%d kali lulus" + +#. • MSG_035 +#. +#. Number of bad block check passes (plural for 2 or more passes). +#. See MSG_087 for the message that %s gets replaced with. +msgid "%d passes %s" +msgstr "%d kali lulus %s" + +#. • MSG_036 +msgid "ISO Image" +msgstr "Imej ISO" + +#. • MSG_037 +msgid "Application" +msgstr "Aplikasi" + +#. • MSG_038 +msgid "Abort" +msgstr "Batal" + +#. • MSG_039 +msgid "Launch" +msgstr "Mula" + +#. • MSG_041 +msgid "Operation cancelled by the user" +msgstr "Operasi dibatalkan oleh pengguna" + +#. • MSG_042 +msgid "Error" +msgstr "Ralat" + +#. • MSG_043 +msgid "Error: %s" +msgstr "Ralat: %s" + +#. • MSG_044 +msgid "File download" +msgstr "Muat turun fail" + +#. • MSG_045 +msgid "USB Storage Device (Generic)" +msgstr "Peranti storan USB (Generik)" + +#. • MSG_046 +msgid "%s (Disk %d) [%s]" +msgstr "%s (Cakera %d) [%s]" + +#. • MSG_047 +#. +#. Used when a drive is detected that contains more than one partition +msgid "Multiple Partitions" +msgstr "Beberapa Partisyen" + +#. • MSG_048 +msgid "Rufus - Flushing buffers" +msgstr "Rufus - 'Flush' penimbal" + +#. • MSG_049 +msgid "Rufus - Cancellation" +msgstr "Rufus - Pembatalan" + +#. • MSG_050 +msgid "Success." +msgstr "Berjaya." + +#. • MSG_051 +msgid "Undetermined error while formatting." +msgstr "Ralat yang tidak dapat ditentukan ketika memformat." + +#. • MSG_052 +msgid "Cannot use the selected file system for this media." +msgstr "Tidak boleh menggunakan sistem fail yang dipilih untuk media ini." + +#. • MSG_053 +msgid "Access to the device is denied." +msgstr "Akses kepada peranti dinafikan." + +#. • MSG_054 +msgid "Media is write protected." +msgstr "Tidak boleh menulis data ke peranti (Dilindungi)" + +#. • MSG_055 +msgid "The device is in use by another process. Please close any other process that may be accessing the device." +msgstr "Peranti ini digunakan oleh proses lain. Sila tutup mana-mana program yang mungkin menggunakan peranti ini." + +#. • MSG_056 +msgid "Quick format is not available for this device." +msgstr "Format pantas tidak boleh digunakan pada peranti ini." + +#. • MSG_057 +msgid "The volume label is invalid." +msgstr "Label jilid tidak sah." + +#. • MSG_058 +msgid "The device handle is invalid." +msgstr "Pengendali peranti tidak sah." + +#. • MSG_059 +msgid "The selected cluster size is not valid for this device." +msgstr "Saiz gugusan yang dipilih tidak boleh digunakan pada peranti ini." + +#. • MSG_060 +msgid "The volume size is invalid." +msgstr "Saiz jilid tidak sah." + +#. • MSG_061 +msgid "Please insert a removable media in drive." +msgstr "Sila masukkan media boleh alih ke dalam pemacu." + +#. • MSG_062 +msgid "An unsupported command was received." +msgstr "Arahan yang tidak disokong diterima." + +#. • MSG_063 +msgid "Memory allocation error." +msgstr "Kesilapan peruntukkan memori." + +#. • MSG_064 +msgid "Read error." +msgstr "Kesilapan membaca." + +#. • MSG_065 +msgid "Write error." +msgstr "Kesilapan menulis." + +#. • MSG_066 +msgid "Installation failure" +msgstr "Kegagalan memasang" + +#. • MSG_067 +msgid "Could not open media. It may be in use by another process. Please re-plug the media and try again." +msgstr "Media tidak boleh dibuka. Ia mungkin digunakan dalam proses yang lain. Sila cabut dan masukkan semula dan cuba sekali lagi." + +#. • MSG_068 +msgid "Could not partition drive." +msgstr "Tidak boleh partition drive." + +#. • MSG_069 +msgid "Could not copy files to target drive." +msgstr "Tidak boleh meyalin fail kepada pemacu." + +#. • MSG_070 +msgid "Cancelled by user." +msgstr "Dibatalkan oleh pengguna." + +#. • MSG_071 +#. +#. See http://en.wikipedia.org/wiki/Thread_%28computing%29 +msgid "Unable to start thread." +msgstr "Proses-proses kecil tidak boleh dimulakan." + +#. • MSG_072 +msgid "Bad blocks check didn't complete." +msgstr "Penyemakan blok rosak tidak dapat diselesaikan." + +#. • MSG_073 +msgid "ISO image scan failure." +msgstr "Kegagalan imbasan imej ISO." + +#. • MSG_074 +msgid "ISO image extraction failure." +msgstr "Pengekstrakan imej ISO gagal." + +#. • MSG_075 +msgid "Unable to remount volume." +msgstr "Tidak dapat melekap semula jilid." + +#. • MSG_076 +msgid "Unable to patch/setup files for boot." +msgstr "Tidak dapat menyediakan fail-fail untuk boot." + +#. • MSG_077 +msgid "Unable to assign a drive letter." +msgstr "Tidak dapat menetapkan huruf pemacu." + +#. • MSG_078 +msgid "Can't mount GUID volume." +msgstr "Tidak boleh lekap jilid GUID." + +#. • MSG_079 +msgid "The device is not ready." +msgstr "Peranti ini tidak sedia untuk digunakan." + +#. • MSG_080 +msgid "" +"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\n" +"\n" +"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\n" +"\n" +"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device..." +msgstr "" +"Rufus mengesan bahawa Windows masih lagi menarik penimbal ke dalam peranti USB.\n" +"\n" +"Bergantung kepada kelajuan peranti USB anda, operasi ini mungkin mengambil masa yang amat lama.Terutamanya untuk fail besar.\n" +"\n" +"Kami cadangkan anda biarkan proses Windows untuk tamat dahulu supaya mengelakkan korupsi.Namun, jika anda kesuntukan masa, anda boleh cabutkan peranti anda..." + +#. • MSG_081 +msgid "Unsupported image" +msgstr "Imej tidak disokong" + +#. • MSG_082 +msgid "This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus..." +msgstr "Imej ini sama ada tidak boleh boot, atau ia menggunakan kaedah boot atau mampatan yang tidak disokong oleh Rufus..." + +#. • MSG_083 +msgid "Replace %s?" +msgstr "Gantikan %s?" + +#. • MSG_084 +msgid "" +"This ISO image seems to use an obsolete version of '%s'.\n" +"Boot menus may not display properly because of this.\n" +"\n" +"A newer version can be downloaded by Rufus to fix this issue:\n" +"- Choose 'Yes' to connect to the internet and download the file\n" +"- Choose 'No' to leave the existing ISO file unmodified\n" +"If you don't know what to do, you should select 'Yes'.\n" +"\n" +"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically." +msgstr "" +"Imej ISO ini menggunakan versi '%s' yang telah lapuk.\n" +"Oleh sebab ini, menu boot mungkin tidak dipaparkan dengan betul.\n" +"\n" +"Versi yang lebih baharu boleh dimuat turun oleh Rufus untuk memperbaiki isu ini:\n" +"- Pilih 'Ya' untuk menyambung ke internet dan muat turun fail tersebut\n" +"- Pilih 'Tidak' untuk tidak mengubahsuai fail ISO yang digunakan\n" +"Jika anda tidak pasti apa yang perlu dilakukan, pilih 'Ya'.\n" +"\n" +"Perhatian: Fail yang dimuat turun akan disimpan di dalam direktori bersamaan dengan Rufus dan apabila terdapat '%s' , ia akan digunakan secara automatik." + +#. • MSG_085 +msgid "Downloading %s" +msgstr "Sedang memuat turun %s" + +#. • MSG_086 +msgid "No image selected" +msgstr "Tiada imej yang dipilih" + +#. • MSG_087 +#. +#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu +#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other +#. words, this message should mean "for a flash memory device of type %s". *Please* try to keep +#. the translation as short as possible so that it won't result in an overly large dropdown... +#. If you prefer, it's okay to use "type" or "device" instead of "NAND" (e.g. "for TLC type"). +#. See also MSG_035. +msgid "for %s NAND" +msgstr "untuk %s NAND" + +#. • MSG_088 +msgid "Image is too big" +msgstr "Imej terlalu besar" + +#. • MSG_089 +msgid "The image is too big for the selected target." +msgstr "Imej ini terlalu besar untuk sasaran yang dipilih." + +#. • MSG_090 +msgid "Unsupported ISO" +msgstr "ISO tidak disokong" + +#. • MSG_091 +msgid "When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS." +msgstr "Apabila menggunakan jenis sasaran UEFI , hanya imej boot jenis EFI sahaja disokong. Sila pilih ISO boot jenis EFI atau tukarkan jenis sasaran kepada BIOS." + +#. • MSG_092 +msgid "Unsupported filesystem" +msgstr "Sistem fail tidak disokong" + +#. • MSG_093 +msgid "" +"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\n" +"\n" +"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions." +msgstr "" +"PENTING: PERANTI INI MEMPUNYAI BEBERAPA PARTISYEN!!\n" +"\n" +"Ini mungkin termasuk partisyen/jilid yang tidak disenaraikan atau tidak boleh dilihat dari Windows. Jika anda mahu meneruskannya, anda bertanggungjawab ke atas kehilangan data dalam partisyen tersebut." + +#. • MSG_094 +msgid "Multiple partitions detected" +msgstr "Beberapa partisyen dikesan" + +#. • MSG_095 +msgid "DD Image" +msgstr "DD Imej" + +#. • MSG_096 +msgid "The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO." +msgstr "Sistem fail yang sedang dipilih tidak boleh digunakan dengan jenis ISO ini. Sila pilih sistem fail berlainan atau gunakan ISO berlainan." + +#. • MSG_097 +msgid "'%s' can only be applied if the file system is NTFS." +msgstr "'Windows To Go' hanya boleh digunakan jika sistem fail adalah NTFS." + +#. • MSG_098 +msgid "" +"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\n" +"\n" +"Do you still want to proceed?\n" +"\n" +"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public..." +msgstr "" +"PENTING: Anda cuba memasang 'Windows To Go', tetapi pemacu sasaran anda tidak mempunyai atribut 'FIXED'. Disebabkan ini Windows akan berkemungkinan besar sangkut sepanjang but, kerana Microsoft tidak merekanya untuk berfungsi dengan pemacu yang sebaliknya mempunyai atribut 'REMOVABLE'.\n" +"\n" +"Adakah anda masih mahu teruskan?\n" +"\n" +"Nota: Atribut 'FIXED/REMOVABLE'adalah sifat perkakasan yang hanya boleh ditukar menggunakan alatan tersuai daripada pengilang pemacu. Bagaimanapun alatan tersebut adalah HAMPIR TIDAK AKAN diberikan kepada umum..." + +#. • MSG_099 +msgid "Filesystem limitation" +msgstr "Had sistem fail" + +#. • MSG_100 +msgid "This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system." +msgstr "Imej ISO ini mengandungi fail yang lebih besar daripada 4 GB iaitu saiz maksima yang dibenarkan untuk sistem fail FAT atau FAT32." + +#. • MSG_101 +msgid "Missing WIM support" +msgstr "Tiada sokongan WIM" + +#. • MSG_102 +msgid "" +"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\n" +"Do you want to visit the 7-zip download page?" +msgstr "" +"Platform anda tidak boleh mengekstrak fail daripada arkib WIM. Ini diperlukan untuk mencipta cakera boot EFI Windows 7 dan Windows Vista. Anda boleh membaikinya dengan cara mendapatkan versi 7-Zip terbaharu.\n" +"Adakah anda mahu ke halaman muat turun 7-zip?" + +#. • MSG_103 +msgid "Download %s?" +msgstr "Muat turun %s?" + +#. • MSG_104 +#. +#. Example: "Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this +#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)" +msgid "" +"%s or later requires a '%s' file to be installed.\n" +"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\n" +"\n" +"Rufus can download the missing file for you:\n" +"- Select 'Yes' to connect to the internet and download the file\n" +"- Select 'No' if you want to manually copy this file on the drive later\n" +"\n" +"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically." +msgstr "" +"%s atau kemudian memerlukan fail '%s' di komputer anda.\n" +"Oleh sebab fail tersebut lebih besar daripada 100 KB dan sentiasa ada dalam imej %s, Ia tidak termasuk dalam Rufus.\n" +"\n" +"Rufus boleh memuat turun fail tersebut untuk anda:\n" +"- Pilih 'Ya' untuk muat turun fail tersebut\n" +"- Pilih 'Tidak' jika anda mahu menyalin fail tersebut secara manual ke cakera ini pada masa lain\n" +"\n" +"Perhatian: Fail akan dimuat turun ke direktori bersamaan Rufus dan apabila '%s' ada di sana, ia akan digunakan semula secara automatik." + +#. • MSG_105 +msgid "" +"Cancelling may leave the device in an UNUSABLE state.\n" +"If you are sure you want to cancel, click YES. Otherwise, click NO." +msgstr "" +"Pembatalan boleh menyebabkan peranti ini TIDAK BOLEH DIGUNAKAN SEMULA.\n" +"Jika anda pasti anda mahu membatalkannya, klik Ya. Sebaliknya, klik Tidak." + +#. • MSG_106 +msgid "Please select folder" +msgstr "Sila pilih folder" + +#. • MSG_107 +msgid "All files" +msgstr "Semua fail" + +#. • MSG_108 +msgid "Rufus log" +msgstr "Log Rufus" + +#. • MSG_109 +msgid "0x%02X (Disk %d)" +msgstr "0x%02X (Cakera %d)" + +#. • MSG_110 +#. +#. "Cluster size" should be the same as the label for IDS_CLUSTER_SIZE_TXT +#. "kilobytes" should be the same as in MSG_027 +msgid "" +"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\n" +"Please change the Cluster size or use FreeDOS." +msgstr "" +"MS-DOS tidak boleh boot daripada cakera yang menggunakan saiz gugusan 64 kilobait.\n" +"Sila tukarkan saiz gugusan atau gunakan FreeDOS." + +#. • MSG_111 +msgid "Incompatible Cluster size" +msgstr "Saiz gugusan tidak sesuai" + +#. • MSG_112 +#. +#. "%d:%02d" is a duration (mins:secs) +msgid "Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!" +msgstr "Pemformatan jilid UDF yang besar mengambil masa yang amat lama. Pada kelajuan USB 2.0, anggaran masa pemformatan adalah %d:%02d, dimana bar kemajuan akan kelihatan seperti ia tidak bergerak. Sila bersabar!" + +#. • MSG_113 +msgid "Large UDF volume" +msgstr "Jilid UDF besar" + +#. • MSG_114 +msgid "" +"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\n" +"\n" +"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\n" +"- Select 'Yes' to connect to the Internet and download these files\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the current application directory and will be reused automatically if present." +msgstr "" +"Imej ini menggunakan Syslinux %s%s tetapi aplikasi ini hanya mempunyai fail pemasangan untukSyslinux %s%s.\n" +"\n" +"Oleh kerana versi-versi baharu Syslinux tidak serasi dengan satu sama lain, maka tidakwajar Rufus menyediakan semuanya, dua fail tambahan perlu dimuat turun dariInternet ('ldlinux.sys' dan 'ldlinux.bss'):\n" +"- Pilih 'Ya' untuk menyambung ke Internet dan memuat turun fail tersebut\n" +"- Pilih 'Tidak' untuk membatalkan operasi\n" +"\n" +"NOTA:Fail akan dimuat turun ke dalam direktori aplikasi ini dan akan digunakan semulasecara automatik sekiranya sedia ada." + +#. • MSG_115 +msgid "Download required" +msgstr "Muat turun diperlukan" + +#. • MSG_116 +#. +#. You should be able to test this message with Super Grub2 Disk ISO: +#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB) +msgid "" +"This image uses Grub %s but the application only includes the installation files for Grub %s.\n" +"\n" +"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\n" +"- Select 'Yes' to connect to the Internet and attempt to download it\n" +"- Select 'No' to use the default version from Rufus\n" +"- Select 'Cancel' to abort the operation\n" +"\n" +"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used." +msgstr "" +"Imej ini menggunakan Grub %s tetapi aplikasi hanya termasuk fail pemasangan untuk Grub %s.\n" +"\n" +"Sepertimana versi Grub berlainan mungkin tidak sesuai antara satu sama lain, dan ianya tidak mungkin untuk memasukkan mereka semua, Rufus akan cuba mengesan versi fail pemasangan Grub ('core.img') yang sepadan dengan salah satu daripada imej anda:\n" +"- Pilih 'Ya' untuk bersambung ke Internet dan cuba memuat turunnya\n" +"- Pilih 'Tidak' untuk menggunakan versi lalai dari Rufus\n" +"- Pilih 'Batal' untuk membatalkan operasi\n" +"\n" +"Nota: Fail akan dimuat turun dalam direktori aplikasi semasa dan akan digunakan semula secara automatik jika ada. Jika tiada padanan boleh dijumpai dalam talian, versi lalai akan digunakan." + +#. • MSG_117 +msgid "Standard Windows installation" +msgstr "Pemasangan Windows biasa" + +#. • MSG_118 +#. +#. Only translate this message *if* Microsoft has a specific name for +#. http://en.wikipedia.org/wiki/Windows_To_Go in your language. +#. Otherwise, you may add a parenthesis eg. "Windows To Go (<hint at what it does>)" +msgid "Windows To Go" +msgstr "" + +#. • MSG_119 +msgid "advanced drive properties" +msgstr "pilihan tambahan pemacu" + +#. • MSG_120 +msgid "advanced format options" +msgstr "pilihan format tambahan" + +#. • MSG_121 +msgid "Show %s" +msgstr "Tunjuk %s" + +#. • MSG_122 +msgid "Hide %s" +msgstr "Sembunyi %s" + +#. • MSG_123 +#. +#. A persistent partitions can be used with "Live" USB media to store data. +#. It means that data can be preserved across reboots on "Live" USB drives. +#. To test this feature, please download and select 'casper_test.iso' from: +#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso +msgid "Persistent partition size" +msgstr "Saiz pemetakan berterusan (persistence partition)" + +#. • MSG_124 +#. +#. This message appears in the persistence 'Size' control when the slider is set to 0. +#. It is okay to use "No partition" or "None" or "Deactivated" to indicate that a persistent partition will not be +#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width). +msgid "No persistence" +msgstr "Tidak berterusan" + +#. • MSG_125 +#. +#. Tooltips used for the persistence size slider and edit control +msgid "Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition." +msgstr "Mengeset saiz pemetakan berterusan (persistent partition) untuk media 'live USB'. Setkan saiz kepada 0 untuk melumpuhkan pemetakan berterusan." + +#. • MSG_126 +msgid "Set the partition size units." +msgstr "Set saiz unit pemetakan." + +#. • MSG_127 +msgid "Do not show this message again" +msgstr "Henti papar mesej ini" + +#. • MSG_128 +msgid "Important notice about %s" +msgstr "Notis penting berkenaan %s" + +#. • MSG_129 +msgid "" +"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\n" +"For details on why this is necessary, see the 'More Information' button below." +msgstr "" +"Anda telah menghasilkan media yang menggunakan bootloader UEFI:NTFS. ANDA PERLU MEMATIKAN PILIHAN SECURE BOOT.\n" +"Untuk mengetahui dengan lebih lanjut, sila klik butang 'Maklumat Lanjut' di bawah." + +#. • MSG_130 +msgid "Windows image selection" +msgstr "Pemilihan imej Windows" + +#. • MSG_131 +msgid "" +"This ISO contains multiple Windows images.\n" +"Please select the image you wish to use for this installation:" +msgstr "" +"ISO ini mengandungi beberapa imej Windows.\n" +"Sila pilih imej yang anda ingin gunakan untuk pemasangan:" + +#. • MSG_132 +msgid "Another program or process is accessing this drive. Do you want to format it anyway?" +msgstr "Terdapat program atau proses lain sedang mencapai pemacu ini. Adakah anda mahu memformatnya juga?" + +#. • MSG_133 +msgid "" +"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\n" +"\n" +"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\n" +"\n" +"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application..." +msgstr "" +"Rufus telah mengesan bahawa anda sedang mencuba untuk mencipta media Windows To Go berasaskan imej ISO 1809.\n" +"\n" +"Memandangkan terdapat pepijat dari MICROSOFT, media ini akan menghadapi masalah (Blue Screen Of Death) semasa memulakan Windows, melainkan anda menukar fail 'WppRecorder.sys' kepada versi 1803.\n" +"\n" +"Sila ambil perhatian. Rufus tidak akan membaiki masalah ini kerana 'WppRecorder.sys' adalah hak cipta milik Microsoft dan kami tidak dapat menyertakan salinan fail berkenaan bersama-sama aplikasi ini..." + +#. • MSG_134 +msgid "" +"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\n" +"\n" +"Are you sure you want to continue?" +msgstr "" +"Memandangkan skema pemetakan MBR telah dipilih, Rufus akan menghasilkan petak storan media dengan saiz maksimum 2 TB, di mana %s ruang cakera adalah tidak tersedia.\n" +"\n" +"Adakah anda pasti ingin meneruskan operasi?" + +#. • MSG_135 +msgid "Version" +msgstr "Versi" + +#. • MSG_136 +msgid "Release" +msgstr "Keluaran" + +#. • MSG_137 +msgid "Edition" +msgstr "Edisi" + +#. • MSG_138 +msgid "Language" +msgstr "Bahasa" + +#. • MSG_139 +msgid "Architecture" +msgstr "Kerangka" + +#. • MSG_140 +msgid "Continue" +msgstr "Terus" + +#. • MSG_141 +msgid "Back" +msgstr "Undur" + +#. • MSG_142 +msgid "Please wait..." +msgstr "Sila tunggu..." + +#. • MSG_143 +msgid "Download using a browser" +msgstr "Muat turun menggunakan pelayar web" + +#. • MSG_144 +msgid "Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it." +msgstr "Muat turun ISO Windows tidak tersedia kerana Microsoft telah mengubah laman web mereka untuk menghalangnya." + +#. • MSG_145 +msgid "PowerShell 3.0 or later is required to run this script." +msgstr "PowerShell 3.0 atau versi lebih baru diperlukan untuk menjalankan skrip ini." + +#. • MSG_146 +msgid "Do you want to go online and download it?" +msgstr "Adakah anda ingin ke dalam talian dan memuat turun?" + +#. • MSG_148 +msgid "Running download script..." +msgstr "Menjalankan skrip untuk memuat turun..." + +#. • MSG_149 +msgid "Download ISO Image" +msgstr "Memuat turun imej ISO" + +#. • MSG_150 +msgid "Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise." +msgstr "Jenis komputer yang anda merancang untuk menggunakan cakera \"bootable\" ini. Adalah menjadi tanggungjawab anda untuk menentukan sama ada sasaran anda adalah jenis BIOS atau UEFI sebelum anda wujudkan cakera tersebut, kerana ia mungkin gagal untuk boot." + +#. • MSG_151 +#. +#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings. +msgid "'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode." +msgstr "'UEFI-CSM' bermaksud peranti hanya akan boot di dalam mod emulasi BIOS (juga dikenali sebagai 'Legacy Mode') dibawah UEFI, dan bukan dalam mod asli UEFI." + +#. • MSG_152 +msgid "'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode')." +msgstr "'bukan CSM' bermaksud peranti hanya akan boot di dalam mod asli UEFI, dan bukan di mod emulasi BIOS (juga dikenali sebagai 'Legacy Mode')." + +#. • MSG_153 +msgid "Test pattern: 0x%02X" +msgstr "Uji corak: 0x%02X" + +#. • MSG_154 +msgid "Test pattern: 0x%02X, 0x%02X" +msgstr "Uji corak: 0x%02X, 0x%02X" + +#. • MSG_155 +msgid "Test pattern: 0x%02X, 0x%02X, 0x%02X" +msgstr "Uji corak: 0x%02X, 0x%02X, 0x%02X" + +#. • MSG_156 +msgid "Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X" +msgstr "Uji corak: 0x%02X, 0x%02X, 0x%02X, 0x%02X" + +#. • MSG_157 +msgid "Sets the target filesystem" +msgstr "Menetapkan sistem fail sasaran" + +#. • MSG_158 +msgid "Minimum size that a block of data will occupy in the filesystem" +msgstr "Saiz minima satu blok data akan gunakan dalam sistem fail" + +#. • MSG_159 +msgid "" +"Use this field to set the drive label.\n" +"International characters are accepted." +msgstr "" +"Gunakan ini untuk tetapkan label cakera.\n" +"Huruf antarabangsa boleh digunakan." + +#. • MSG_160 +msgid "Toggle advanced options" +msgstr "Togel pilihan lanjutan" + +#. • MSG_161 +msgid "Check the device for bad blocks using a test pattern" +msgstr "Semak peranti untuk blok rosak menggunakan corak ujian" + +#. • MSG_162 +msgid "Uncheck this box to use the \"slow\" format method" +msgstr "Nyahtanda kotak ini untuk menggunakan kaedah pemformatan perlahan" + +#. • MSG_163 +msgid "Method that will be used to create partitions" +msgstr "Kaedah yang digunakan untuk mencipta partisyen" + +#. • MSG_164 +msgid "Method that will be used to make the drive bootable" +msgstr "Kaedah yang digunakan untuk membuat cakera boot" + +#. • MSG_165 +msgid "Click to select or download an image..." +msgstr "Klik untuk memilih atau memuat turun imej..." + +#. • MSG_166 +msgid "Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)" +msgstr "Klik kotak ini untuk membenarkan paparan label antarabangsa dan menetapkan ikon cakera (akan membuat fail autorun.inf)" + +#. • MSG_167 +msgid "Install a UEFI bootloader, that will perform MD5Sum file validation of the media" +msgstr "Pasang pemuat but UEFI, yang akan melakukan pengesahan fail MD5Sum terhadap media" + +#. • MSG_169 +msgid "" +"Create an extra hidden partition and try to align partitions boundaries.\n" +"This can improve boot detection for older BIOSes." +msgstr "" +"Ciptakan partisyen tambahan tersembunyi dan cuba melaraskan sempadan partisyen.\n" +"Ini boleh mempertingkatkan pengesanan boot untuk BIOS lama." + +#. • MSG_170 +msgid "Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!" +msgstr "Membolehkan penyenaraian pagaran cakera keras USB. GUNAKAN ATAS RISIKO SENDIRI!!!" + +#. • MSG_171 +msgid "" +"Start the formatting operation.\n" +"This will DESTROY any data on the target!" +msgstr "" +"Mulakan operasi pemformatan.\n" +"Ini akan MEMADAMKAN semua data pada sasaran!" + +#. • MSG_172 +#. +#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the +#. public key that is embedded in the application. This message appears in an error dialog if the validation fails. +msgid "Invalid download signature" +msgstr "Tandatangan digital muat turun tidak sah" + +#. • MSG_173 +msgid "Click to select..." +msgstr "Klik untuk memilih..." + +#. • MSG_174 +msgid "Rufus - The Reliable USB Formatting Utility" +msgstr "Rufus - Utiliti pemformatan USB yang dipercayai" + +#. • MSG_175 +msgid "Version %d.%d (Build %d)" +msgstr "Versi %d.%d (Build %d)" + +#. • MSG_176 +msgid "English translation: Pete Batard <mailto:pete@akeo.ie>" +msgstr "" +"Terjemahan Bahasa Malaysia:\\line\n" +"• Muhammad Aman <mailto:aman.tifli@gmail.com>\\line\n" +"• VGPlayer <mailto:razman90a@yahoo.com.my>\\line\n" +"• Mohamad Ikhwan bin Kori <mailto:ikhwankori@gmail.com>\\line\n" +"• Ilya Ignatev <mailto:ignatev.ilya.yt@gmail.com>" + +#. • MSG_177 +msgid "Report bugs or request enhancements at:" +msgstr "Laporkan masalah atau cadangan penambahbaikan di:" + +#. • MSG_178 +msgid "Additional Copyrights:" +msgstr "Hak cipta tambahan:" + +#. • MSG_179 +msgid "Update Policy:" +msgstr "Polisi kemaskini:" + +#. • MSG_180 +msgid "If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):" +msgstr "Jika anda pilih untuk membenarkan perisian ini menyemak untuk aplikasi versi baharu, anda bersetuju untuk membenarkan pelayan kami mengumpulkan maklumat berikut:" + +#. • MSG_181 +msgid "Your operating system's architecture and version" +msgstr "Versi dan kerangka sistem operasi" + +#. • MSG_182 +msgid "The version of the application you use" +msgstr "Versi aplikasi yang anda gunakan" + +#. • MSG_183 +msgid "Your IP address" +msgstr "Alamat IP anda" + +#. • MSG_184 +msgid "For the purpose of generating private usage statistics, we may keep the information collected, \\b for at most a year\\b0 . However, we will not willingly disclose any of this individual data to third parties." +msgstr "Untuk tujuan menjana statistik penggunaan peribadi , kami mungkin menyimpan maklumat yang dikumpulkan, \\b untuk sekurang-kurangnya setahun\\b0 . Namun, kami tidak rela untuk mendedahkan maklumat ini kepada mana-mana pihak ketiga." + +#. • MSG_185 +msgid "Update Process:" +msgstr "Proses mengemas kini:" + +#. • MSG_186 +msgid "" +"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\line\n" +"Internet access is of course required when checking for updates." +msgstr "" +"Rufus tidak memasang atau menjalankan servis di latar belakang. Oleh itu, semakan kemas kini hanya dijalankan apabila aplikasi utama berjalan.\\line\n" +"Akses internet diperlukan untuk menyemak untuk versi baru." + +#. • MSG_187 +msgid "Invalid image for selected boot option" +msgstr "Imej tidak sah untuk pilihan boot yang dipilih" + +#. • MSG_188 +msgid "The current image doesn't match the boot option selected. Please use a different image or choose a different boot option." +msgstr "Imej\ttidak serasi dengan pilihan boot yang dipilih. Sila gunakan imej lain atau pilih pilihan boot lain." + +#. • MSG_189 +msgid "This ISO image is not compatible with the selected filesystem" +msgstr "Imej ISO ini tidak serasi dengan sistem fail yang dipilih" + +#. • MSG_190 +msgid "Incompatible drive detected" +msgstr "Pemacu tidak serasi dikesan" + +#. • MSG_191 +#. +#. Used in MSG_235 +msgid "Write pass" +msgstr "Melepasi tulisan" + +#. • MSG_192 +#. +#. Used in MSG_235 +msgid "Read pass" +msgstr "Melepasi bacaan" + +#. • MSG_193 +msgid "Downloaded %s" +msgstr "Muat turun %s" + +#. • MSG_194 +msgid "Could not download %s" +msgstr "Tidak boleh muat turun %s" + +#. • MSG_195 +#. +#. Example: "Using embedded version of Grub2 file(s)" +msgid "Using embedded version of %s file(s)" +msgstr "Menggunakan %s fail versi dibenam" + +#. • MSG_196 +msgid "" +"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\n" +"\n" +"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\n" +"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work." +msgstr "" +"PENTING: PEMACU INI MENGGUNAKAN SAIZ SEKTOR BUKAN PIAWAIAN!\n" +"\n" +"Pemacu konvensional mengunakan saiz sektor 512 bait tetapi pemacu ini menggunakan %d bait. Dalam banyak kes, ini bermaksud anda TIDAK akan mampu untuk but dari pemacu ini.\n" +"Rufus boleh cuba untuk mencipta pemacu boleh but, tetapi TIDAK ADA JAMINAN ianya akan berfungsi." + +#. • MSG_197 +msgid "Nonstandard sector size detected" +msgstr "Saiz sektor bukan standard dikesan" + +#. • MSG_198 +msgid "'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED." +msgstr "'Windows To Go' hanya boleh dipasang dalam pemacu berpartisyen GPT jika ia mempunyai set atribut 'FIXED'. Pemacu semasa tidak dikesan sebagai 'FIXED'." + +#. • MSG_199 +msgid "This feature is not available on this platform." +msgstr "Ciri ini tidak tersedia di platform ini." + +#. • MSG_201 +msgid "Cancelling - Please wait..." +msgstr "Sedang membatalkan - Sila tunggu..." + +#. • MSG_202 +msgid "Scanning image..." +msgstr "Mengimbas imej..." + +#. • MSG_203 +msgid "Failed to scan image" +msgstr "Imbasan imej gagal" + +#. • MSG_204 +#. +#. %s is the name of an obsolete Syslinux .c32 module. Example: "Obsolete vesamenu.c32 detected" +msgid "Obsolete %s detected" +msgstr "%s lapuk dikesan" + +#. • MSG_205 +#. +#. Display the name of the image selected. eg: "Using image: en_win7_x64_sp1.iso" +msgid "Using image: %s" +msgstr "Menggunakan imej: %s" + +#. • MSG_206 +#. +#. Example: "Missing ldlinux.c32 file" +msgid "Missing %s file" +msgstr "Tidak menjumpai fail %s" + +#. • MSG_207 +#. +#. The name proposed by Windows' Computer Management → Disk Management when you try to format +#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png. +msgid "New Volume" +msgstr "Jilid baharu" + +#. • MSG_208 +#. +#. Singular. Example: "1 device found" +msgid "%d device found" +msgstr "%d peranti dijumpai" + +#. • MSG_209 +#. +#. Plural. Example: "3 devices found" +msgid "%d devices found" +msgstr "%d peranti dijumpai" + +#. • MSG_210 +msgid "READY" +msgstr "SEDIA" + +#. • MSG_211 +msgid "Cancelled" +msgstr "DIBATALKAN" + +#. • MSG_212 +msgid "Failed" +msgstr "GAGAL" + +#. • MSG_213 +#. +#. Used when a new update has been downloaded and launched +msgid "Launching new application..." +msgstr "Melancarkan aplikasi baru..." + +#. • MSG_214 +msgid "Failed to launch new application" +msgstr "Gagal untuk melancarkan aplikasi baru" + +#. • MSG_215 +#. +#. Example: "Opened some_file.txt" +msgid "Opened %s" +msgstr "%s dibuka" + +#. • MSG_216 +#. +#. Example: "Saved rufus.log" +msgid "Saved %s" +msgstr "%s disimpan" + +#. • MSG_217 +#. +#. Formatting status +msgid "Formatting: %s" +msgstr "Pemformatan: %s" + +#. • MSG_218 +msgid "Creating file system: Task %d/%d completed" +msgstr "Mencipta sistem fail: Tugas %d/%d selesai" + +#. • MSG_219 +msgid "NTFS Fixup: %d%% completed" +msgstr "Pembaikian NTFS: %d%% selesai" + +#. • MSG_220 +#. +#. Parameter: the file system and an estimated duration in mins and secs. +#. Example: "Formatting (UDF) - Estimated duration 3:21..." +#. If "estimated duration" is too long, just use "estimated" or an abbreviation +msgid "Formatting (%s) - estimated duration %d:%02d..." +msgstr "Pemformatan (%s) - Jangka masa anggaran %d:%02d..." + +#. • MSG_221 +msgid "Setting label (%s)..." +msgstr "Menetapkan Label (%s)..." + +#. • MSG_222 +#. +#. Example: "Formatting (FAT32)..." +msgid "Formatting (%s)..." +msgstr "Pemformatan (%s)..." + +#. • MSG_223 +msgid "NTFS Fixup (Checkdisk)..." +msgstr "Pembaikian NTFS (Periksa cakera)..." + +#. • MSG_224 +msgid "Clearing MBR/PBR/GPT structures..." +msgstr "Memadam struktur MBR/PBR/GPT..." + +#. • MSG_225 +msgid "Requesting disk access..." +msgstr "Meminta akses cakera..." + +#. • MSG_226 +msgid "Analyzing existing boot records..." +msgstr "Menganalisis rekod boot sedia ada..." + +#. • MSG_227 +msgid "Closing existing volume..." +msgstr "Menutup jilid sedia ada..." + +#. • MSG_228 +msgid "Writing Master Boot Record..." +msgstr "Menulis \"Rekod master boot\"..." + +#. • MSG_229 +msgid "Writing Partition Boot Record..." +msgstr "Menulis \"Rekod boot partisyen\"..." + +#. • MSG_230 +msgid "Copying DOS files..." +msgstr "Menyalin fail DOS..." + +#. • MSG_231 +msgid "Copying ISO files: %s" +msgstr "Menyalin fail ISO: %s" + +#. • MSG_232 +msgid "Win7 EFI boot setup (%s)..." +msgstr "Persediaan boot EFI Win7 (%s)..." + +#. • MSG_233 +msgid "Finalizing, please wait..." +msgstr "Menyiapkan, sila tunggu..." + +#. • MSG_234 +#. +#. Takes a Syslinux version as parameter. +#. Example: "Installing Syslinux v5.10..." +msgid "Installing Syslinux %s..." +msgstr "Memasang Syslinux %s..." + +#. • MSG_235 +#. +#. Bad blocks status. Example: "Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)" +#. See MSG_191 & MSG_192 for "Write pass"/"Read pass" translation. +msgid "Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)" +msgstr "Blok rosak: %s %d/%d - %0.2f%% (%d/%d/%d kesilapan)" + +#. • MSG_236 +msgid "Bad Blocks: Testing with random pattern" +msgstr "Blok rosak: menguji dengan corak rawak" + +#. • MSG_237 +msgid "Bad Blocks: Testing with pattern 0x%02X" +msgstr "Blok rosak: Menguji dengan corak 0x%02X" + +#. • MSG_238 +#. +#. Example: "Partitioning (MBR)..." +msgid "Partitioning (%s)..." +msgstr "Mempartisyenkan (%s)..." + +#. • MSG_239 +msgid "Deleting partitions (%s)..." +msgstr "Memadam partisyen (%s)..." + +#. • MSG_240 +#. +#. This message has to do with the signature validation that Rufus uses when downloading an update. +msgid "" +"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\n" +"\n" +"The download will be deleted. Please check the log for more details." +msgstr "" +"Tandatangan untuk pengemaskinian telah dimuat turun tidak dapat disahkan. Ini boleh bermakna bahawa sistem anda dikonfigurasi dengan salah untuk pengesahan tandatangan atau menunjukkan fail yang dimuat turun berisi dengan virus\n" +"\n" +"Fail yang dimuat turun akan dihapuskan. Sila periksa log untuk maklumat lanjut." + +#. • MSG_241 +msgid "Downloading: %s" +msgstr "Memuat turun: %s" + +#. • MSG_242 +msgid "Failed to download file." +msgstr "Gagal memuat turun fail." + +#. • MSG_243 +msgid "Checking for Rufus updates..." +msgstr "Memeriksa untuk kemas kini Rufus..." + +#. • MSG_244 +msgid "Updates: Unable to connect to the internet" +msgstr "Kemas kini: Tidak dapat menyambung ke internet" + +#. • MSG_245 +msgid "Updates: Unable to access version data" +msgstr "Kemas kini: Tidak dapat mengakses data versi" + +#. • MSG_246 +msgid "A new version of Rufus is available!" +msgstr "Versi baru Rufus boleh didapati!" + +#. • MSG_247 +msgid "No new version of Rufus was found" +msgstr "Tiada versi baru Rufus didapati" + +#. • MSG_248 +msgid "Application registry keys successfully deleted" +msgstr "Kekunci daftar aplikasi berjaya dipadam" + +#. • MSG_249 +msgid "Failed to delete application registry keys" +msgstr "Gagal memadam kekunci daftar aplikasi" + +#. • MSG_250 +#. +#. Example: "Fixed disk detection enabled", "ISO size check disabled", etc. +msgid "%s enabled" +msgstr "%s dibolehkan" + +#. • MSG_251 +msgid "%s disabled" +msgstr "%s tidak dibolehkan" + +#. • MSG_252 +msgid "Size checks" +msgstr "Menyemak saiz" + +#. • MSG_253 +msgid "Hard disk detection" +msgstr "Pengesanan cakera keras" + +#. • MSG_254 +msgid "Force large FAT32 formatting" +msgstr "Memaksa pemformatan FAT32 besar" + +#. • MSG_255 +msgid "NoDriveTypeAutorun will be deleted on exit" +msgstr "NoDriveTypeAutorun akan dipadam apabila keluar" + +#. • MSG_256 +msgid "Fake drive detection" +msgstr "Pengesanan cakera palsu" + +#. • MSG_257 +msgid "Joliet support" +msgstr "Sokongan Joliet" + +#. • MSG_258 +msgid "Rock Ridge support" +msgstr "Sokongan Rock Ridge" + +#. • MSG_259 +msgid "Force update" +msgstr "Paksa kemas kini" + +#. • MSG_260 +msgid "NTFS compression" +msgstr "Mampatan NTFS" + +#. • MSG_261 +msgid "Writing image: %s" +msgstr "Menulis imej: %s" + +#. • MSG_262 +#. +#. Cheat mode message to disable ISO Support, so that only DD images can be opened +msgid "ISO Support" +msgstr "Sokongan ISO" + +#. • MSG_263 +#. +#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination! +msgid "Use PROPER size units" +msgstr "Guna saiz seunit yang BETUL" + +#. • MSG_264 +msgid "Deleting directory '%s'" +msgstr "Memadam direktori '%s'" + +#. • MSG_265 +msgid "VMWare disk detection" +msgstr "Pengesanan cakera VMWare" + +#. • MSG_266 +msgid "Dual UEFI/BIOS mode" +msgstr "Mod dwi UEFI/BIOS" + +#. • MSG_267 +msgid "Applying Windows image: %s" +msgstr "Menggunakan imej Windows: %s" + +#. • MSG_268 +msgid "Applying Windows image..." +msgstr "Menggunakan imej Windows..." + +#. • MSG_269 +msgid "Preserve timestamps" +msgstr "Mengekalkan cap masa" + +#. • MSG_270 +msgid "USB debug" +msgstr "Nyahpijat USB" + +#. • MSG_271 +msgid "Computing image checksums: %s" +msgstr "Mengira semak tambah imej: %s" + +#. • MSG_272 +msgid "Compute the MD5, SHA1 and SHA256 checksums for the selected image" +msgstr "Mengira semak tambah MD5, SHA1 dan SHA256 imej dipilih" + +#. • MSG_273 +msgid "Change the application language" +msgstr "Menukar bahasa aplikasi" + +#. • MSG_274 +msgid "%s image detected" +msgstr "%s imej dikesan" + +#. • MSG_275 +#. +#. '%s' will be replaced with your translations for MSG_036 ("ISO Image") and MSG_095 ("DD Image") +msgid "" +"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\n" +"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\n" +"However, if you encounter issues during boot, you can try writing this image again in %s mode.\n" +"\n" +"Please select the mode that you want to use to write this image:" +msgstr "" +"Imej yang anda telah pilih adalah imej 'ISOHybrid'. Ini bermaksud ia boleh ditulis sama ada dalam %s mod (salinan fail) atau %s mod (imej cakera).\n" +"Rufus galakkan menggunakan mod %s, jadi anda selalu mempunyai akses penuh ke pemacu selepas menulisnya.\n" +"Bagaimanapun, jika anda menghadapi isu-isu semasa boot, anda boleh cuba menulis imej ini lagi dalam mod %s.\n" +"\n" +"Sila pilih mod yang anda mahu guna untuk menulis imej ini:" + +#. • MSG_276 +#. +#. '%s' will be replaced with your translation for MSG_036 ("ISO Image") +msgid "Write in %s mode (Recommended)" +msgstr "Menulis dalam mod %s (Digalakkan)" + +#. • MSG_277 +#. +#. '%s' will be replaced with your translation for MSG_095 ("DD Image") +msgid "Write in %s mode" +msgstr "Menulis dalam mod %s" + +#. • MSG_278 +msgid "Checking for conflicting processes..." +msgstr "Menyemak proses yang berkonflik." + +#. • MSG_279 +msgid "Non bootable" +msgstr "Tidak boleh boot" + +#. • MSG_280 +msgid "Disk or ISO image" +msgstr "Cakera atau imej ISO" + +#. • MSG_281 +msgid "%s (Please select)" +msgstr "%s (Sila pilih)" + +#. • MSG_282 +msgid "Exclusive USB drive locking" +msgstr "Penguncian pemacu USB eksklusif" + +#. • MSG_283 +msgid "Invalid signature" +msgstr "Tandatangan tidak sah" + +#. • MSG_284 +msgid "The downloaded executable is missing a digital signature." +msgstr "'Executable' yang dimuat turun kehilangan tandatangan digital." + +#. • MSG_285 +msgid "" +"The downloaded executable is signed by '%s'.\n" +"This is not a signature we recognize and could indicate some form of malicious activity...\n" +"Are you sure you want to run this file?" +msgstr "" +"'Executable' yang dimuat turun ditandatangani oleh '%s'.\n" +"Ini bukannya tandatangan yang kami kenal dan boleh menunjukkan beberapa bentuk aktiviti berniat jahat...\n" +"Adakah anda pasti anda mahu menjalankan fail ini?" + +#. • MSG_286 +msgid "Zeroing drive: %s" +msgstr "Mensifarkan pemacu: %s" + +#. • MSG_287 +msgid "Detection of non-USB removable drives" +msgstr "Mengesan cakera bukan USB" + +#. • MSG_288 +msgid "Missing elevated privileges" +msgstr "Hilang hak kebenaran istimewa" + +#. • MSG_289 +msgid "This application can only run with elevated privileges" +msgstr "Aplikasi ini hanya boleh digunakan apabila diberikan hak kebenaran istimewa" + +#. • MSG_290 +msgid "File Indexing" +msgstr "Pengindeksan Fail" + +#. • MSG_291 +msgid "Version selection" +msgstr "Pemilihan versi" + +#. • MSG_292 +msgid "Please select the version of Windows you want to install:" +msgstr "Sila pilih versi Windows yang anda ingin memasang:" + +#. • MSG_293 +msgid "Unsupported Windows version" +msgstr "Versi Windows tidak disokong" + +#. • MSG_294 +msgid "" +"This version of Windows is no longer supported by Rufus.\n" +"The last version of Rufus compatible with this platform is v%d.%d." +msgstr "" +"Versi Windows ini tidak lagi disokong oleh Rufus.\n" +"Versi terakhir Rufus yang serasi dengan platform ini ialah v%d.%d." + +#. • MSG_295 +msgid "Warning: Unofficial version" +msgstr "Amaran: versi bukan rasmi" + +#. • MSG_296 +msgid "" +"This version of Rufus was not produced by its official developer(s).\n" +"\n" +"Are you sure you want to run it?" +msgstr "" +"Versi Rufus ini bukan dibuat oleh pemaju-pemaju rasmi Rufus. \n" +"\n" +"Adakan anda yakin ingin menggunakannya?" + +#. • MSG_297 +msgid "Truncated ISO detected" +msgstr "ISO yang dipenggal dikesan" + +#. • MSG_298 +msgid "" +"The ISO file you have selected does not match its declared size: %s of data is missing!\n" +"\n" +"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\n" +"\n" +"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button." +msgstr "" +"Saiz fail ISO yang anda pilih adalah tidak sama dengan saiz yang diisytiharkan oleh fail ISO ini. %s data telah hilang!\n" +"\n" +"Jika fail ini diperolehi dari intenet, anda sepatutnya muat turun semula fail ini dan sahkan bahawa tandatangan MD5 atau SHA adalah sama dengan versi yang rasmi.\n" +"\n" +"Anda boleh dapatkan MD5 atau SHA fail yang dipilih ini dengan menekan butang (✓). Kemudian anda perlu membandingkan dengan MD5 atau SHA daripada fail yang rasmi." + +#. • MSG_299 +msgid "Timestamp validation error" +msgstr "Ralat validasi cap waktu" + +#. • MSG_300 +msgid "" +"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\n" +"\n" +"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details." +msgstr "" +"Rufus tidak dapat mengesahkan bahawa kemas kini yang dimuat turun adalah lebih baru daripada aplikasi yang dijalankan sekarang.\n" +"\n" +"Untuk mengelakkan daripada senario dimana PC diserang dengan virus, proses kemaskini telah dibatalkan dan fail yang telah dimuat turun akan dipadam. Sila semak log untuk maklumat lanjut." + +#. • MSG_301 +msgid "Show application settings" +msgstr "Tunjuk tetapan aplikasi" + +#. • MSG_302 +msgid "Show information about this application" +msgstr "Paparkan maklumat tentang aplikasi ini" + +#. • MSG_303 +msgid "Show the log" +msgstr "Paparkan log" + +#. • MSG_304 +msgid "Create a disk image of the selected device" +msgstr "Cipta imej cakera untuk peranti yang dipilih" + +#. • MSG_305 +msgid "Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go)." +msgstr "Pilih pilihan ini jika anda mahu memasang Windows pada komputer lain atau ingin menggunakan Windows terus daripada cakera/media ini (Windows To Go)" + +#. • MSG_306 +#. +#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START. +#. It's the same as MSG_286 but with a process that *may* be faster, hence the name. +msgid "Fast-zeroing drive: %s" +msgstr "Mensifarkan pemacu 'Fast': %s" + +#. • MSG_307 +msgid "this may take a while" +msgstr "ini mungkin mengambil sedikit masa" + +#. • MSG_308 +msgid "VHD detection" +msgstr "Pengesanan VHD" + +#. • MSG_309 +msgid "Compressed archive" +msgstr "Arkib termampat" + +#. • MSG_310 +msgid "" +"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\n" +"\n" +"Please select the mode that you want to use to write this image:" +msgstr "" +"ISO yang anda pilih menggunakan UEFI dan cukup kecil untuk ditulis sebagai Partition Sistem EFI (ESP). Menulis kepada ESP, bukannya menulis kepada partition data generik yang menduduki keseluruhan cakera, boleh menjadi lebih baik untuk beberapa jenis pemasangan.\n" +"\n" +"Sila pilih mod yang anda mahu gunakan untuk menulis imej ini:" + +#. • MSG_311 +msgid "Use %s (in the main application window) to enable." +msgstr "Gunakan %s (dalam tetingkap aplikasi utama) untuk mendayakan." + +#. • MSG_312 +msgid "Extra hashes (SHA512)" +msgstr "Cincangan tambahan (SHA512)" + +#. • MSG_313 +msgid "Save to VHD" +msgstr "Simpan ke VHD" + +#. • MSG_314 +msgid "Compute image checksums" +msgstr "Pengiraan semakan imej" + +#. • MSG_315 +msgid "Multiple buttons" +msgstr "Pelbagai butang" + +#. • MSG_316 +msgid "Number of passes" +msgstr "Bilangan pas" + +#. • MSG_317 +msgid "Disk ID" +msgstr "ID Cakera" + +#. • MSG_318 +msgid "Default thread priority: %d" +msgstr "Keutamaan benang lalai: %d" + +#. • MSG_319 +msgid "Ignore Boot Marker" +msgstr "Abaikan penanda but" + +#. • MSG_320 +msgid "Refreshing partition layout (%s)..." +msgstr "Tataletak partition yang menyegarkan (%s)..." + +#. • MSG_321 +msgid "" +"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\n" +"As a result, DD image writing mode will be enforced." +msgstr "" +"Imej yang anda pilih ialah ISOHybrid, tetapi penciptanya tidak menjadikannya serasi dengan mod salinan ISO/Fail.\n" +"Akibatnya, mod penulisan imej DD akan dikuatkuasakan." + +#. • MSG_322 +msgid "Unable to open or read '%s'" +msgstr "Tidak dapat membuka atau membaca '%s'" + +#. • MSG_323 +msgid "Apply SkuSiPolicy.p7b on installation (See KB5042562)" +msgstr "Guna SkuSiPolicy.p7b semasa pemasangan (Lihat KB5042562)" + +#. • MSG_324 +msgid "QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)" +msgstr "Penambahbaikan QoL (Jangan paksa Copilot, OneDrive, Outlook, Fast Startup, dll.)" + +#. • MSG_325 +msgid "Applying Windows customization: %s" +msgstr "Menggunakan penyesuaian Windows: %s" + +#. • MSG_326 +msgid "Applying user options..." +msgstr "Menggunakan pilihan pengguna..." + +#. • MSG_327 +msgid "Windows User Experience" +msgstr "Pengalaman Pengguna Windows" + +#. • MSG_328 +msgid "Customize Windows installation?" +msgstr "Sesuaikan pemasangan Windows?" + +#. • MSG_329 +msgid "Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0" +msgstr "Alih keluar keperluan untuk 4GB+ RAM, But Selamat dan TPM 2.0" + +#. • MSG_330 +msgid "Remove requirement for an online Microsoft account" +msgstr "Alih keluar keperluan untuk akaun Microsoft dalam talian" + +#. • MSG_331 +msgid "Disable data collection (Skip privacy questions)" +msgstr "Nyahdayakan pengumpulan data (Langkau soalan privasi)" + +#. • MSG_332 +msgid "Prevent Windows To Go from accessing internal disks" +msgstr "Halang Windows To Go daripada mengakses cakera dalaman" + +#. • MSG_333 +msgid "Create a local account with username:" +msgstr "Buat akaun tempatan dengan nama pengguna:" + +#. • MSG_334 +msgid "Set regional options to the same values as this user's" +msgstr "Mengesetkan opsyen rantau kepada nilai yang sama seperti pengguna ini" + +#. • MSG_335 +msgid "Disable BitLocker automatic device encryption" +msgstr "Lumpuhkan penyulitan peranti automatik BitLocker" + +#. • MSG_336 +msgid "Persistent log" +msgstr "Log berterusan" + +#. • MSG_337 +msgid "" +"An additional file ('%s') must be downloaded from Microsoft to use this feature:\n" +"- Select 'Yes' to connect to the Internet and download it\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The file will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Fail tambahan ('%s') mesti dimuat turun dari Microsoft untuk menggunakan ciri ini:\n" +"- Pilih 'Ya' untuk menyambung ke Internet dan memuat turunnya\n" +"- Pilih 'Tidak' untuk membatalkan operasi\n" +"\n" +"Nota: Fail akan dimuat turun ke dalam direktori aplikasi dan akan digunakan semula secara automatik jika tersedia." + +#. • MSG_338 +msgid "Revoked UEFI bootloader detected" +msgstr "Pemuat but UEFI yang dibatalkan dikesan" + +#. • MSG_339 +msgid "" +"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\n" +"\n" +"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\n" +"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning." +msgstr "" +"Rufus mengesan bahawa ISO yang anda pilih mengandungi pemuat but UEFI yang telah ditarik balik dan akan menghasilkan %s, apabila Secure Boot diaktifkan pada sistem UEFI yang terkini sepenuhnya.\n" +"\n" +"- Jika anda memperoleh imej ISO ini daripada sumber yang tidak dipercayai, anda harus mempertimbangkan kemungkinan ia mengandungi perisian hasad UEFI dan elakkan daripada membuat but daripadanya.\n" +"- Jika anda memperolehnya daripada sumber yang dipercayai, anda harus cuba mencari versi yang lebih terkini, yang tidak akan menghasilkan amaran ini." + +#. • MSG_340 +msgid "a \"Security Violation\" screen" +msgstr "skrin \"Pelanggaran Keselamatan\"" + +#. • MSG_341 +msgid "a Windows Recovery Screen (BSOD) with '%s'" +msgstr "skrin Pemulihan Windows (BSOD) dengan '%s'" + +#. • MSG_342 +msgid "Compressed VHDX Image" +msgstr "Imej VHDX Termampat" + +#. • MSG_343 +msgid "Uncompressed VHD Image" +msgstr "Imej VHD Tidak Termampat" + +#. • MSG_344 +msgid "Full Flash Update Image" +msgstr "Imej Kemas Kini Denyar Penuh" + +#. • MSG_345 +msgid "" +"Some additional data must be downloaded from Microsoft to use this functionality:\n" +"- Select 'Yes' to connect to the Internet and download it\n" +"- Select 'No' to cancel the operation" +msgstr "" +"Beberapa data tambahan mesti dimuat turun dari Microsoft untuk menggunakan fungsi ini:\n" +"- Pilih 'Ya' untuk menyambung ke Internet dan memuat turunnya\n" +"- Pilih 'Tidak' untuk membatalkan operasi" + +#. • MSG_346 +msgid "Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)" +msgstr "Sekat Windows ke S-Mode (TIDAK SERASI dengan pintasan akaun dalam talian)" + +#. • MSG_347 +msgid "Expert Mode" +msgstr "Mod Pakar" + +#. • MSG_348 +msgid "Extracting archive files: %s" +msgstr "Mengekstrak fail arkib: %s" + +#. • MSG_349 +msgid "Use Rufus MBR" +msgstr "Guna MBR Rufus" + +#. • MSG_350 +msgid "Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)" +msgstr "Guna pemuat but bertandatangan 'Windows CA 2023' (Memerlukan PC sasaran yang serasi)" + +#. • MSG_351 +msgid "Checking for UEFI bootloader revocation..." +msgstr "Sedang memeriksa penarikan balik pemuat but UEFI..." + +#. • MSG_352 +msgid "Checking for UEFI DBX updates..." +msgstr "Sedang memeriksa kemas kini DBX UEFI..." + +#. • MSG_353 +msgid "DBX update available" +msgstr "Kemas kini DBX tersedia" + +#. • MSG_354 +msgid "" +"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\n" +"- Select 'Yes' to connect to the Internet and download this content\n" +"- Select 'No' to cancel the operation\n" +"\n" +"Note: The files will be downloaded in the application's directory and will be reused automatically if present." +msgstr "" +"Rufus telah menemui versi kemas kini fail DBX yang digunakan untuk melakukan pemeriksaan penarikan balik Secure Boot UEFI. Adakah anda mahu memuat turun kemas kini ini?\n" +"- Pilih 'Ya' untuk menyambung ke Internet dan memuat turun kandungan ini\n" +"- Pilih 'Tidak' untuk membatalkan operasi\n" +"\n" +"Nota: Fail akan dimuat turun ke dalam direktori aplikasi dan akan digunakan semula secara automatik jika tersedia." + +#. • MSG_355 +msgid "⚠SILENTLY⚠ erase disk and install:" +msgstr "⚠SECARA SENYAP⚠ padam cakera dan pasang:" + +#. • MSG_356 +msgid "" +"You have selected to use the \"silent\" Windows installation option.\n" +"\n" +"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\n" +"\n" +"If this is not what you want, please select 'No' to go back and uncheck the option.\n" +"Otherwise, if you select 'Yes', you agree that the whole responsibility for any data loss will be entirely with YOU." +msgstr "" +"Anda telah memilih untuk menggunakan pilihan pemasangan Windows \"senyap\".\n" +"\n" +"Ini adalah pilihan lanjutan, dikhaskan untuk mereka yang ingin mencipta media yang tidak meminta pengguna semasa pemasangan Windows dan oleh itu MEMADAM SECARA TANPA SYARAT cakera pertama yang dikesan pada sistem sasaran. Jika anda tidak berhati-hati, menggunakan pilihan ini boleh mengakibatkan KEHILANGAN DATA YANG TIDAK BOLEH DIUNDURKAN!" + +#. • MSG_358 +msgid "Unsupported image location" +msgstr "Lokasi imej tidak disokong" + +#. • MSG_359 +msgid "" +"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\n" +"\n" +"Please move the image to a different location and try again." +msgstr "" +"Anda tidak boleh menggunakan imej yang terletak pada pemacu sasaran, kerana pemacu tersebut akan dipadam sepenuhnya. Ia sama seperti cuba menggergaji dahan yang anda duduki!\n" +"\n" +"Sila pindahkan imej ke lokasi lain dan cuba lagi." + +#. • MSG_360 +msgid "It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available." +msgstr "Adalah selamat untuk membiarkan pilihan ini didayakan walaupun anda mempunyai TPM atau lebih RAM, kerana pilihan ini hanya memintas keperluan persediaan dan tidak benar-benar menghalang Windows daripada menggunakan semua perkakasan yang tersedia." + +#. • MSG_361 +msgid "For this option to work, network/Internet MUST be disconnected during installation!" +msgstr "Untuk pilihan ini berfungsi, rangkaian/Internet MESTI diputuskan semasa pemasangan!" + +#. • MSG_362 +msgid "Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user." +msgstr "Secara automatik jawab 'tidak' kepada soalan persediaan Windows berkaitan perkongsian data dengan Microsoft, dan bukannya meminta pengguna." + +#. • MSG_363 +msgid "You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades." +msgstr "Anda sepatutnya membiarkan pilihan ini didayakan, melainkan anda okay dengan 'Windows To Go' mengakses cakera dalaman dan secara senyap melakukan peningkatan sistem fail yang tidak boleh diundurkan." + +#. • MSG_364 +msgid "Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon." +msgstr "Secara automatik mencipta akaun tempatan dengan nama pengguna yang ditentukan, menggunakan kata laluan kosong yang perlu ditukar pada log masuk seterusnya." + +#. • MSG_365 +msgid "Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user." +msgstr "Salin tetapan rantau dari PC ini (papan kekunci, zon waktu, mata wang), dan bukannya meminta pengguna." + +#. • MSG_366 +msgid "Don't encrypt the system disk, unless explicitly requested by the user." +msgstr "Jangan suliikan cakera sistem, melainkan diminta secara jelas oleh pengguna." + +#. • MSG_367 +msgid "Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows." +msgstr "Guna pilihan ini hanya jika anda tahu apa itu S-Mode dan faham bahawa sistem anda mungkin dikunci ke S-Mode walaupun selepas anda memadam sepenuhnya dan memasang semula Windows." + +#. • MSG_368 +msgid "Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system." +msgstr "Guna pilihan ini jika sistem yang anda rancang untuk memasang Windows menggunakan sijil Secure Boot yang terkini sepenuhnya. Jika perlu, anda boleh melihat penggunaan 'Mosby' untuk mengemas kini sistem anda." + +#. • MSG_369 +msgid "Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting." +msgstr "Guna pilihan ini jika anda ingin menarik balik pemuat but Windows tambahan yang mungkin tidak selamat, tetapi dengan potensi juga menghalang media Windows standard daripada membuat but." + +#. • MSG_370 +msgid "\"Quality of Life\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users." +msgstr "Penambahbaikan \"Kualiti Hidup\": Lumpuhkan kebanyakan ciri yang tidak diingini yang Microsoft cuba paksa kepada pengguna akhir." + +#. • MSG_371 +msgid "If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase." +msgstr "Jika anda menggunakan pilihan ini, sila pastikan untuk memutuskan setiap cakera dari PC sasaran, kecuali yang anda ingin pasangkan Windows, serta jangan biarkan media dipasang ke mana-mana PC yang anda tidak mahu padamkan." + +#. • MSG_900 +#. +#. The following messages are for the Windows Store listing only and are not used by the application +msgid "Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc." +msgstr "Rufus adalah utiliti yang membantu memformat dan mencipta pemacu kilat USB boot, seperti pemacu pen/kekunci USB, kayu memori, dan lain-lain." + +#. • MSG_901 +msgid "Official site: %s" +msgstr "Laman rasmi: %s" + +#. • MSG_902 +msgid "Source Code: %s" +msgstr "Kod Sumber: %s" + +#. • MSG_903 +msgid "ChangeLog: %s" +msgstr "Log Perubahan: %s" + +#. • MSG_904 +#. +#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html) +#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here. +msgid "" +"This application is licensed under the terms of the GNU Public License (GPL) version 3.\n" +"See https://www.gnu.org/licenses/gpl-3.0.en.html for details." +msgstr "" +"Permohonan ini dilesenkan di bawah syarat-syarat Lesen Awam GNU (GPL) versi 3.\n" +"Lihat https://www.gnu.org/licenses/gpl-3.0.html untuk butiran." + +#. • MSG_905 +#. +#. Keyword for "boot" will be used for search in the Windows Store +msgid "Boot" +msgstr "" + +#. • MSG_910 +#. +#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page +msgid "Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" +msgstr "Formatkan USB, kad flash dan pemacu maya kepada FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" + +#. • MSG_911 +msgid "Create FreeDOS bootable USB drives" +msgstr "Buat pemacu USB boleh boot FreeDOS" + +#. • MSG_912 +msgid "Create bootable drives from bootable ISOs (Windows, Linux, etc.)" +msgstr "Buat pemacu boleh boot daripada ISO boleh boot (Windows, Linux, dll.)" + +#. • MSG_913 +msgid "Create bootable drives from bootable disk images, including compressed ones" +msgstr "Buat pemacu boleh boot daripada imej cakera boleh boot, termasuk yang dimampatkan" + +#. • MSG_914 +msgid "Create BIOS or UEFI bootable drives, including UEFI bootable NTFS" +msgstr "Buat pemacu boleh boot BIOS atau UEFI, termasuk NTFS boleh boot UEFI" + +#. • MSG_915 +msgid "Create 'Windows To Go' drives" +msgstr "Buat pemacu 'Windows To Go'" + +#. • MSG_916 +msgid "Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot" +msgstr "Buat pemacu pemasangan Windows 11 untuk PC yang tidak mempunyai TPM atau But Selamat" + +#. • MSG_917 +msgid "Create persistent Linux partitions" +msgstr "Buat partition Linux berterusan" + +#. • MSG_918 +msgid "Create VHD/DD images of the selected drive" +msgstr "Buat imej VHD/DD bagi pemacu yang dipilih" + +#. • MSG_919 +msgid "Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image" +msgstr "Kira MD5, SHA-1, SHA-256 dan SHA-512 checksum imej yang dipilih" + +#. • MSG_920 +msgid "Perform bad blocks checks, including detection of \"fake\" flash drives" +msgstr "Melakukan pemeriksaan blok buruk, termasuk pengesanan pemacu kilat \"palsu\"" + +#. • MSG_921 +msgid "Download official Microsoft Windows retail ISOs" +msgstr "Muat turun rasmi ISO runcit Microsoft Windows" + +#. • MSG_922 +msgid "Download UEFI Shell ISOs" +msgstr "Muat turun ISO Shell UEFI" diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index a9efb244..0a8c385e 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -24,7 +24,7 @@ # • v4.14 "ko-KR" "Korean (한국어)" # • v4.14 "lv-LV" "Latvian (Latviešu)" # • v4.14 "lt-LT" "Lithuanian (Lietuvių)" -# • v3.22 "ms-MY" "Malay (Bahasa Malaysia)" +# • v4.14 "ms-MY" "Malay (Bahasa Malaysia)" # • v4.14 "nb-NO" "Norwegian (Norsk)" # • v4.14 "fa-IR" "Persian (پارسی)" # • v4.14 "pl-PL" "Polish (Polski)" @@ -9524,7 +9524,7 @@ t MSG_922 "Atsisiųskite UEFI Shell ISO" ######################################################################### l "ms-MY" "Malay (Bahasa Malaysia)" 0x043e, 0x083e -v 3.22 +v 4.14 b "en-US" g IDD_ABOUTBOX @@ -9709,7 +9709,7 @@ t MSG_129 "Anda telah menghasilkan media yang menggunakan bootloader UEFI:NTFS. t MSG_130 "Pemilihan imej Windows" t MSG_131 "ISO ini mengandungi beberapa imej Windows.\nSila pilih imej yang anda ingin gunakan untuk pemasangan:" t MSG_132 "Terdapat program atau proses lain sedang mencapai pemacu ini. Adakah anda mahu memformatnya juga?" -t MSG_133 "Rufus telah mengesan bahawa anda sedang mencuba untuk mencipta media Windows To Go berasaskan imej ISO 1809.\n\nMemandangkan terdapat pepijat dari MICROSOFT, media ini akan menghadapi masalah (Blue Scree Of Death) semasa memulakan Windows, melainkan anda menukar fail 'WppRecorder.sys' kepada versi 1803.\n\nSila ambil perhatian. Rufus tidak akan membaiki masalah ini kerana 'WppRecorder.sys' adalah hak cipta milik Microsoft dan kami tidak dapat menyertakan salinan fail berkenaan bersama-sama aplikasi ini..." +t MSG_133 "Rufus telah mengesan bahawa anda sedang mencuba untuk mencipta media Windows To Go berasaskan imej ISO 1809.\n\nMemandangkan terdapat pepijat dari MICROSOFT, media ini akan menghadapi masalah (Blue Screen Of Death) semasa memulakan Windows, melainkan anda menukar fail 'WppRecorder.sys' kepada versi 1803.\n\nSila ambil perhatian. Rufus tidak akan membaiki masalah ini kerana 'WppRecorder.sys' adalah hak cipta milik Microsoft dan kami tidak dapat menyertakan salinan fail berkenaan bersama-sama aplikasi ini..." t MSG_134 "Memandangkan skema pemetakan MBR telah dipilih, Rufus akan menghasilkan petak storan media dengan saiz maksimum 2 TB, di mana %s ruang cakera adalah tidak tersedia.\n\nAdakah anda pasti ingin meneruskan operasi?" t MSG_135 "Versi" t MSG_136 "Keluaran" @@ -9742,8 +9742,7 @@ t MSG_163 "Kaedah yang digunakan untuk mencipta partisyen" t MSG_164 "Kaedah yang digunakan untuk membuat cakera boot" t MSG_165 "Klik untuk memilih atau memuat turun imej..." t MSG_166 "Klik kotak ini untuk membenarkan paparan label antarabangsa dan menetapkan ikon cakera (akan membuat fail autorun.inf)" -t MSG_167 "Memasang MBR yang membenarkan pilihan boot dan mampu menyamar ID BIOS USB" -t MSG_168 "Cuba menyamarkan cakera USB boot (biasanya 0x80) sebagai cakera lain.\nIni hanya diperlukan jika anda memasang Windows XP dan mempunyai lebih daripada satu cakera." +t MSG_167 "Pasang pemuat but UEFI, yang akan melakukan pengesahan fail MD5Sum terhadap media" t MSG_169 "Ciptakan partisyen tambahan tersembunyi dan cuba melaraskan sempadan partisyen.\nIni boleh mempertingkatkan pengesanan boot untuk BIOS lama." t MSG_170 "Membolehkan penyenaraian pagaran cakera keras USB. GUNAKAN ATAS RISIKO SENDIRI!!!" t MSG_171 "Mulakan operasi pemformatan.\nIni akan MEMADAMKAN semua data pada sasaran!" @@ -9751,7 +9750,7 @@ t MSG_172 "Tandatangan digital muat turun tidak sah" t MSG_173 "Klik untuk memilih..." t MSG_174 "Rufus - Utiliti pemformatan USB yang dipercayai" t MSG_175 "Versi %d.%d (Build %d)" -t MSG_176 "Terjemahan Bahasa Malaysia:\\line\n• Muhammad Aman <mailto:aman.tifli@gmail.com>\\line\n• VGPlayer <mailto:razman90a@yahoo.com.my>\\line\n• Mohamad Ikhwan bin Kori <mailto:ikhwankori@gmail.com>" +t MSG_176 "Terjemahan Bahasa Malaysia:\\line\n• Muhammad Aman <mailto:aman.tifli@gmail.com>\\line\n• VGPlayer <mailto:razman90a@yahoo.com.my>\\line\n• Mohamad Ikhwan bin Kori <mailto:ikhwankori@gmail.com>\\line\n• Ilya Ignatev <mailto:ignatev.ilya.yt@gmail.com>" t MSG_177 "Laporkan masalah atau cadangan penambahbaikan di:" t MSG_178 "Hak cipta tambahan:" t MSG_179 "Polisi kemaskini:" @@ -9897,6 +9896,8 @@ t MSG_319 "Abaikan penanda but" t MSG_320 "Tataletak partition yang menyegarkan (%s)..." t MSG_321 "Imej yang anda pilih ialah ISOHybrid, tetapi penciptanya tidak menjadikannya serasi dengan mod salinan ISO/Fail.\nAkibatnya, mod penulisan imej DD akan dikuatkuasakan." t MSG_322 "Tidak dapat membuka atau membaca '%s'" +t MSG_323 "Guna SkuSiPolicy.p7b semasa pemasangan (Lihat KB5042562)" +t MSG_324 "Penambahbaikan QoL (Jangan paksa Copilot, OneDrive, Outlook, Fast Startup, dll.)" t MSG_325 "Menggunakan penyesuaian Windows: %s" t MSG_326 "Menggunakan pilihan pengguna..." t MSG_327 "Pengalaman Pengguna Windows" @@ -9909,9 +9910,44 @@ t MSG_333 "Buat akaun tempatan dengan nama pengguna:" t MSG_334 "Mengesetkan opsyen rantau kepada nilai yang sama seperti pengguna ini" t MSG_335 "Lumpuhkan penyulitan peranti automatik BitLocker" t MSG_336 "Log berterusan" +t MSG_337 "Fail tambahan ('%s') mesti dimuat turun dari Microsoft untuk menggunakan ciri ini:\n- Pilih 'Ya' untuk menyambung ke Internet dan memuat turunnya\n- Pilih 'Tidak' untuk membatalkan operasi\n\nNota: Fail akan dimuat turun ke dalam direktori aplikasi dan akan digunakan semula secara automatik jika tersedia." +t MSG_338 "Pemuat but UEFI yang dibatalkan dikesan" +t MSG_339 "Rufus mengesan bahawa ISO yang anda pilih mengandungi pemuat but UEFI yang telah ditarik balik dan akan menghasilkan %s, apabila Secure Boot diaktifkan pada sistem UEFI yang terkini sepenuhnya.\n\n- Jika anda memperoleh imej ISO ini daripada sumber yang tidak dipercayai, anda harus mempertimbangkan kemungkinan ia mengandungi perisian hasad UEFI dan elakkan daripada membuat but daripadanya.\n- Jika anda memperolehnya daripada sumber yang dipercayai, anda harus cuba mencari versi yang lebih terkini, yang tidak akan menghasilkan amaran ini." +t MSG_340 "skrin \"Pelanggaran Keselamatan\"" +t MSG_341 "skrin Pemulihan Windows (BSOD) dengan '%s'" +t MSG_342 "Imej VHDX Termampat" +t MSG_343 "Imej VHD Tidak Termampat" +t MSG_344 "Imej Kemas Kini Denyar Penuh" +t MSG_345 "Beberapa data tambahan mesti dimuat turun dari Microsoft untuk menggunakan fungsi ini:\n- Pilih 'Ya' untuk menyambung ke Internet dan memuat turunnya\n- Pilih 'Tidak' untuk membatalkan operasi" +t MSG_346 "Sekat Windows ke S-Mode (TIDAK SERASI dengan pintasan akaun dalam talian)" +t MSG_347 "Mod Pakar" +t MSG_348 "Mengekstrak fail arkib: %s" +t MSG_349 "Guna MBR Rufus" +t MSG_350 "Guna pemuat but bertandatangan 'Windows CA 2023' (Memerlukan PC sasaran yang serasi)" +t MSG_351 "Sedang memeriksa penarikan balik pemuat but UEFI..." +t MSG_352 "Sedang memeriksa kemas kini DBX UEFI..." +t MSG_353 "Kemas kini DBX tersedia" +t MSG_354 "Rufus telah menemui versi kemas kini fail DBX yang digunakan untuk melakukan pemeriksaan penarikan balik Secure Boot UEFI. Adakah anda mahu memuat turun kemas kini ini?\n- Pilih 'Ya' untuk menyambung ke Internet dan memuat turun kandungan ini\n- Pilih 'Tidak' untuk membatalkan operasi\n\nNota: Fail akan dimuat turun ke dalam direktori aplikasi dan akan digunakan semula secara automatik jika tersedia." +t MSG_355 "⚠SECARA SENYAP⚠ padam cakera dan pasang:" +t MSG_356 "Anda telah memilih untuk menggunakan pilihan pemasangan Windows \"senyap\".\n\nIni adalah pilihan lanjutan, dikhaskan untuk mereka yang ingin mencipta media yang tidak meminta pengguna semasa pemasangan Windows dan oleh itu MEMADAM SECARA TANPA SYARAT cakera pertama yang dikesan pada sistem sasaran. Jika anda tidak berhati-hati, menggunakan pilihan ini boleh mengakibatkan KEHILANGAN DATA YANG TIDAK BOLEH DIUNDURKAN!" +t MSG_358 "Lokasi imej tidak disokong" +t MSG_359 "Anda tidak boleh menggunakan imej yang terletak pada pemacu sasaran, kerana pemacu tersebut akan dipadam sepenuhnya. Ia sama seperti cuba menggergaji dahan yang anda duduki!\n\nSila pindahkan imej ke lokasi lain dan cuba lagi." +t MSG_360 "Adalah selamat untuk membiarkan pilihan ini didayakan walaupun anda mempunyai TPM atau lebih RAM, kerana pilihan ini hanya memintas keperluan persediaan dan tidak benar-benar menghalang Windows daripada menggunakan semua perkakasan yang tersedia." +t MSG_361 "Untuk pilihan ini berfungsi, rangkaian/Internet MESTI diputuskan semasa pemasangan!" +t MSG_362 "Secara automatik jawab 'tidak' kepada soalan persediaan Windows berkaitan perkongsian data dengan Microsoft, dan bukannya meminta pengguna." +t MSG_363 "Anda sepatutnya membiarkan pilihan ini didayakan, melainkan anda okay dengan 'Windows To Go' mengakses cakera dalaman dan secara senyap melakukan peningkatan sistem fail yang tidak boleh diundurkan." +t MSG_364 "Secara automatik mencipta akaun tempatan dengan nama pengguna yang ditentukan, menggunakan kata laluan kosong yang perlu ditukar pada log masuk seterusnya." +t MSG_365 "Salin tetapan rantau dari PC ini (papan kekunci, zon waktu, mata wang), dan bukannya meminta pengguna." +t MSG_366 "Jangan suliikan cakera sistem, melainkan diminta secara jelas oleh pengguna." +t MSG_367 "Guna pilihan ini hanya jika anda tahu apa itu S-Mode dan faham bahawa sistem anda mungkin dikunci ke S-Mode walaupun selepas anda memadam sepenuhnya dan memasang semula Windows." +t MSG_368 "Guna pilihan ini jika sistem yang anda rancang untuk memasang Windows menggunakan sijil Secure Boot yang terkini sepenuhnya. Jika perlu, anda boleh melihat penggunaan 'Mosby' untuk mengemas kini sistem anda." +t MSG_369 "Guna pilihan ini jika anda ingin menarik balik pemuat but Windows tambahan yang mungkin tidak selamat, tetapi dengan potensi juga menghalang media Windows standard daripada membuat but." +t MSG_370 "Penambahbaikan \"Kualiti Hidup\": Lumpuhkan kebanyakan ciri yang tidak diingini yang Microsoft cuba paksa kepada pengguna akhir." +t MSG_371 "Jika anda menggunakan pilihan ini, sila pastikan untuk memutuskan setiap cakera dari PC sasaran, kecuali yang anda ingin pasangkan Windows, serta jangan biarkan media dipasang ke mana-mana PC yang anda tidak mahu padamkan." t MSG_900 "Rufus adalah utiliti yang membantu memformat dan mencipta pemacu kilat USB boot, seperti pemacu pen/kekunci USB, kayu memori, dan lain-lain." t MSG_901 "Laman rasmi: %s" t MSG_902 "Kod Sumber: %s" +t MSG_903 "Log Perubahan: %s" t MSG_904 "Permohonan ini dilesenkan di bawah syarat-syarat Lesen Awam GNU (GPL) versi 3.\nLihat https://www.gnu.org/licenses/gpl-3.0.html untuk butiran." t MSG_910 "Formatkan USB, kad flash dan pemacu maya kepada FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3" t MSG_911 "Buat pemacu USB boleh boot FreeDOS" diff --git a/src/rufus.rc b/src/rufus.rc index d8b5b6e5..b3873de4 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.2378" +CAPTION "Rufus 4.15.2379" 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,2378,0 - PRODUCTVERSION 4,15,2378,0 + FILEVERSION 4,15,2379,0 + PRODUCTVERSION 4,15,2379,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.2378" + VALUE "FileVersion", "4.15.2379" 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.2378" + VALUE "ProductVersion", "4.15.2379" END END BLOCK "VarFileInfo" From dea9451869fcddc7f0a96850dc6085d296a23ae5 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 6 May 2026 14:00:52 +0100 Subject: [PATCH 189/192] [wue] fix Silent Windows installation failing at 75% in most cases * Well, our super-smart way of presenting users with the disk partitioning dialog, so that they could provide disk drivers instead of seeing their installation drive scratched, was once again foiled by Windows Setup being an ass when it comes to assigning drive letters. * First of all, along with S:, U: and X: you don't want to use D: as the drive letter as it only works if your target drive is "unclean", but, more importantly, the drive letter assignation process, as designed by Microsoft, ONLY EVER WORKS FOR FIXED DRIVES, and is not designed to be used with USB drives that are of type REMOVABLE. But of course, since Microsoft duplicated the drive assignation in 2 steps, one before the file copy and one after, and they only validate that the drive being mapped is of type FIXED in the latter, you don't get the error early, where you'd be able to catch it or at least make some sense of it, but MUCH, MUCH LATER... * And that is the reason why pretty much everybody who tries the new silent install ends up with an error at 75% during the file copy phase, since this is when Windows Setup performs its SECOND remapping of the drive letter and actually tests if the drive is of a type it can bloody handle! Oh and since our fastest test media are all UAS/SSD-based FIXED drives, this is what we used during our extensive testing of the silent installation feature, and the reason why we never saw the issue in the first place. * Our fix therefore is to drop the letter assignation altogether, since we'll never be able to use it with the vast majority of consumer USB drive, and instead switch to trying to relabel the UEFI:NTFS partition, or at least the partition at [disk 1, partition 2] where it is expected to reside (yeah, don't ask me why Microsoft starts numbering disks at 0 but partitions at 1), since this should be an one-step operation that works regardless of your drive is of type FIXED or REMOVABLE. * Testing for the UEFI:NTFS partition should also help us bail out the partition screen on systems where the user forgot to disconnect all the disks they don't want to see scratched (since, in most cases these would be data disks without a second partition) thereby helping prevent unwanted data loss. This should also bail to disk partitioning for people who want to split WIMs rather than use UEFI:NTFS, but it's their problem. Full silent install is for UEFI:NTFS only. * Finally, on some systems that have card readers that Windows Setup happens to map as formal disks (in my experience, this seems to be the exception rather than the rule), we will also bail out to the disk partition screen, even if the card reader is empty, but there's really only so much we can accomplish to address all system scenarios with the limited commands we have at our disposal during unattended partitioning. Since our priority is to prevent data loss, as well as show the partition screen whenever it is needed, we consider this annoyance as a small trade-off, especially as these users should be able to disable card readers from their UEFI setting. Again, our silent installation process expects that the user will have disconnected ALL disks except the one they want to install Windows on and that includes card readers). If that is not the case, all bets are off, and we will try to show the partition screen, to make the user aware of the deviation. * Closes #2960. --- src/drive.c | 6 ++---- src/rufus.rc | 10 +++++----- src/wue.c | 18 ++++++++++++------ 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/drive.c b/src/drive.c index c7073a93..0b9a27eb 100644 --- a/src/drive.c +++ b/src/drive.c @@ -2478,10 +2478,8 @@ BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL m DriveLayoutEx.PartitionEntry[i].Gpt.PartitionType = PARTITION_MICROSOFT_DATA; // Prevent a drive letter from being assigned to the UEFI:NTFS partition DriveLayoutEx.PartitionEntry[i].Gpt.Attributes = GPT_BASIC_DATA_ATTRIBUTE_NO_DRIVE_LETTER; -#if !defined(_DEBUG) - // Also make the partition read-only for release versions - DriveLayoutEx.PartitionEntry[i].Gpt.Attributes += GPT_BASIC_DATA_ATTRIBUTE_READ_ONLY; -#endif + // NB: We no longer make the partition read-only as we need to be able to edit + // its label for WUE's silent install no-disk/extra-disk detection. } else if (wcscmp(SelectedDrive.Partition[i].Name, L"EFI System Partition") == 0) DriveLayoutEx.PartitionEntry[i].Gpt.PartitionType = PARTITION_GENERIC_ESP; else if (wcscmp(SelectedDrive.Partition[i].Name, L"Linux Persistence") == 0) diff --git a/src/rufus.rc b/src/rufus.rc index b3873de4..e96ddd1b 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.2379" +CAPTION "Rufus 4.15.2380" 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,2379,0 - PRODUCTVERSION 4,15,2379,0 + FILEVERSION 4,15,2380,0 + PRODUCTVERSION 4,15,2380,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.2379" + VALUE "FileVersion", "4.15.2380" 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.2379" + VALUE "ProductVersion", "4.15.2380" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index d9b701af..f5cb354c 100644 --- a/src/wue.c +++ b/src/wue.c @@ -153,18 +153,24 @@ char* CreateUnattendXml(int arch, int flags) if (flags & UNATTEND_DISABLE_BITLOCKER) fprintf(fd, " <DisableEncryptedDiskProvisioning>true</DisableEncryptedDiskProvisioning>\n"); // The following ensures that we display the disk selection screen if only the boot media is - // available (i.e. if the system does not see any target for installation). In that case the - // letter assignment below fails and the UI is displayed allowing the user to provide drivers. - // This also prevents the install media from being scratched, when it's the only disk. + // available (i.e. if the system does not see any target for installation) or (in most cases) + // if the user happens to have more than one disk connected besides the instal USB. In that + // case the label assignment below fails and the UI is displayed allowing the user to provide + // drivers or pick their target disk explicitly. + // This also prevents the install media from being scratched. // With a special mention to Claude AI, that explicitly said this could not be accomplished... + // Note that this may result in the disk partition screen being produced on systems that have + // card readers, but we'd rather inconvenience a few people, to prevent potential data loss, + // than the opposite. Also note that you do *NOT* want to try to use drive letter mapping for + // the detection here, as if your drive isn't of type FIXED, the file copy steps bails out at + // 75%. See https://github.com/pbatard/rufus/issues/2960 for more details. fprintf(fd, " <Disk wcm:action=\"modify\">\n"); fprintf(fd, " <DiskID>1</DiskID> \n"); fprintf(fd, " <ModifyPartitions>\n"); fprintf(fd, " <ModifyPartition wcm:action=\"modify\">\n"); fprintf(fd, " <Order>1</Order>\n"); - fprintf(fd, " <PartitionID>1</PartitionID>\n"); - // You REALLY don't want to use 'U' for the drive letter below. Don't ask me how I know!!! - fprintf(fd, " <Letter>D</Letter>\n"); + fprintf(fd, " <PartitionID>2</PartitionID>\n"); + fprintf(fd, " <Label>RUFUS_BOOT</Label>\n"); fprintf(fd, " </ModifyPartition>\n"); fprintf(fd, " </ModifyPartitions>\n"); fprintf(fd, " </Disk>\n"); From 704d146f22b22a24f423171a8e5d47b49fcb0277 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Thu, 7 May 2026 18:28:21 +0100 Subject: [PATCH 190/192] [ui] fix an infinite loop when using Windows ISOs that contain multiple WIMs * SelectionDialog() was calling GetEditions() unconditionally, which, in the case of an image with multiple WIMs, produced a new re-entrant call to SelectionDialog() to select the WIM, thereby producing a new call to GetEditions() and an infinite loop. * This unconditional call also had the (minor) side effect of calling wim_open() against ISOs without WIMs, such as Linux ones, resulting in 'Could not open WIM: 43' log errors. * Fix this by making sure that: - GetEditions() is only called when needed. - SelectionDialog() is re-entrant, to at least one level. --- src/rufus.rc | 10 ++--- src/stdlg.c | 118 ++++++++++++++++++++++++++------------------------- 2 files changed, 65 insertions(+), 63 deletions(-) diff --git a/src/rufus.rc b/src/rufus.rc index e96ddd1b..bc793832 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.2380" +CAPTION "Rufus 4.15.2381" 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,2380,0 - PRODUCTVERSION 4,15,2380,0 + FILEVERSION 4,15,2381,0 + PRODUCTVERSION 4,15,2381,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.2380" + VALUE "FileVersion", "4.15.2381" 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.2380" + VALUE "ProductVersion", "4.15.2381" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index da9cad1d..22da210c 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -58,11 +58,13 @@ static struct { char **szDialogItem; int nDialogItems; } list_data = { 0 }; +// The selection dialog can be re-entered so we need two data instances + an index static struct { char* szMessageText; char* szMessageTitle; selection_dialog_options_t* options; -} selection_data = { 0 }; +} selection_data[2] = { 0 }; +static int s = -1; static struct { HICON hMessageIcon; char* szMessageText; @@ -846,22 +848,20 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam // https://learn.microsoft.com/en-us/previous-versions/cc722458(v=technet.10)#user-name-policies static const char* username_invalid_chars = "/\\[]:;|=,+*?<>\""; // Prevent resizing - static LRESULT disabled[9] = { HTLEFT, HTRIGHT, HTTOP, HTBOTTOM, HTSIZE, + static const LRESULT disabled[9] = { HTLEFT, HTRIGHT, HTTOP, HTBOTTOM, HTSIZE, HTTOPLEFT, HTTOPRIGHT, HTBOTTOMLEFT, HTBOTTOMRIGHT }; - static HBRUSH background_brush, separator_brush; static HFONT hDlgFont = NULL; - static BOOL silent_install_checked = FALSE; char username[128] = { 0 }, str[MAX_PATH]; int i, m, dw, dh, r = -1, mw; DWORD size = sizeof(username); LRESULT loc; - // To use the system message font - NONCLIENTMETRICS ncm; + NONCLIENTMETRICS ncm; // To use the system message font RECT rc, rc2; HWND hCtrl; HDC hDC; - assert(selection_data.options != NULL); - int nDialogItems = selection_data.options->choices.Index; + assert(s < ARRAYSIZE(selection_data)); + assert(selection_data[s].options != NULL); + int nDialogItems = selection_data[s].options->choices.Index; switch (message) { case WM_INITDIALOG: @@ -877,7 +877,7 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam } // Switch to checkboxes or some other style if requested for (i = 0; i < nDialogItems; i++) - Button_SetStyle(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), selection_data.options->style, TRUE); + Button_SetStyle(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), selection_data[s].options->style, TRUE); // Get the system message box font. See http://stackoverflow.com/a/6057761 if (hDlgFont == NULL) { ncm.cbSize = sizeof(ncm); @@ -893,8 +893,6 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam SendMessage(GetDlgItem(hDlg, IDNO), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0)); apply_localization(IDD_SELECTION, hDlg); - background_brush = GetSysColorBrush(COLOR_WINDOW); - separator_brush = GetSysColorBrush(COLOR_3DLIGHT); SetTitleBarIcon(hDlg); CenterDialog(hDlg, NULL); @@ -904,31 +902,33 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam mw = rc.right - rc.left - ddw; // ddw seems to work okay as a fudge dw = mw; - r = GetEditions(&edition_name, &edition_index); + // NB: GetEdition() may cause SelectionDialog() to be re-entered! + if (selection_data[s].options->edition_index > 0) + r = GetEditions(&edition_name, &edition_index); // Change the default icon and set the text Static_SetIcon(GetDlgItem(hDlg, IDC_SELECTION_ICON), LoadIcon(NULL, IDI_QUESTION)); - SetWindowTextU(hDlg, selection_data.szMessageTitle); + SetWindowTextU(hDlg, selection_data[s].szMessageTitle); SetWindowTextU(GetDlgItem(hDlg, IDCANCEL), lmprintf(MSG_007)); - SetWindowTextU(GetDlgItem(hDlg, IDC_SELECTION_TEXT), selection_data.szMessageText); + SetWindowTextU(GetDlgItem(hDlg, IDC_SELECTION_TEXT), selection_data[s].szMessageText); for (i = 0; i < nDialogItems; i++) { hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i); - static_strcpy(str, selection_data.options->choices.String[i]); + static_strcpy(str, selection_data[s].options->choices.String[i]); SetWindowTextU(hCtrl, str); ShowWindow(hCtrl, SW_SHOW); // Compute the maximum line's width (with some extra for the username and edition fields) - if (i == selection_data.options->username_index - 1) { - static_sprintf(str, "%s __%s__", selection_data.options->choices.String[i], base_username); + if (i == selection_data[s].options->username_index - 1) { + static_sprintf(str, "%s __%s__", selection_data[s].options->choices.String[i], base_username); mw = max(mw, GetTextSize(hCtrl, str).cx); - } else if (i == selection_data.options->edition_index - 1) { + } else if (i == selection_data[s].options->edition_index - 1) { mw = max(mw, GetTextSize(hCtrl, str).cx + GetComboBoxMinWidth(GetDlgItem(hDlg, IDC_SELECTION_EDITION), &edition_name)); } else { mw = max(mw, GetTextSize(hCtrl, str).cx); } // Set tooltips, if any - if (i < (int)selection_data.options->tooltips.Index) - CreateTooltipEx(hDlg, hCtrl, selection_data.options->tooltips.String[i], -1); + if (i < (int)selection_data[s].options->tooltips.Index) + CreateTooltipEx(hDlg, hCtrl, selection_data[s].options->tooltips.String[i], -1); } // If our maximum line's width is greater than the default, set a nonzero delta width dw = (mw <= dw) ? 0 : mw - dw; @@ -939,7 +939,7 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam SelectFont(hDC, hDlgFont); // Yes, you *MUST* reapply the font to the DC, even after SetWindowText! GetWindowRect(hCtrl, &rc); dh = rc.bottom - rc.top; - DrawTextU(hDC, selection_data.szMessageText, -1, &rc, DT_CALCRECT | DT_WORDBREAK); + DrawTextU(hDC, selection_data[s].szMessageText, -1, &rc, DT_CALCRECT | DT_WORDBREAK); dh = rc.bottom - rc.top - dh; safe_release_dc(hCtrl, hDC); ResizeMoveCtrl(hDlg, hCtrl, 0, 0, 0, dh, 1.0f); @@ -947,12 +947,12 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), 0, dh, dw, 0, 1.0f); // If required, set up the the username edit box - if (selection_data.options->username_index > 0) { + if (selection_data[s].options->username_index > 0) { unattend_username[0] = 0; - hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->username_index - 1); + hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data[s].options->username_index - 1); GetClientRect(hCtrl, &rc); ResizeMoveCtrl(hDlg, hCtrl, 0, 0, - (rc.left - rc.right) + GetTextSize(hCtrl, selection_data.options->choices.String[selection_data.options->username_index - 1]).cx + ddw, 0, 1.0f); + (rc.left - rc.right) + GetTextSize(hCtrl, selection_data[s].options->choices.String[selection_data[s].options->username_index - 1]).cx + ddw, 0, 1.0f); GetWindowRect(hCtrl, &rc); SetWindowPos(GetDlgItem(hDlg, IDC_SELECTION_USERNAME), hCtrl, rc.left, rc.top, 0, 0, SWP_NOMOVE | SWP_NOSIZE); hCtrl = GetDlgItem(hDlg, IDC_SELECTION_USERNAME); @@ -966,11 +966,11 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam } // If required, set up the the edition combo box - if (selection_data.options->edition_index > 0 && edition_name.String != NULL && edition_name.Index > 0) { - hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index - 1); + if (selection_data[s].options->edition_index > 0 && edition_name.String != NULL && edition_name.Index > 0) { + hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data[s].options->edition_index - 1); GetClientRect(hCtrl, &rc); ResizeMoveCtrl(hDlg, hCtrl, 0, 0, - (rc.left - rc.right) + GetTextSize(hCtrl, selection_data.options->choices.String[selection_data.options->edition_index - 1]).cx + ddw, 0, 1.0f); + (rc.left - rc.right) + GetTextSize(hCtrl, selection_data[s].options->choices.String[selection_data[s].options->edition_index - 1]).cx + ddw, 0, 1.0f); GetWindowRect(hCtrl, &rc); SetWindowPos(GetDlgItem(hDlg, IDC_SELECTION_EDITION), hCtrl, rc.left, rc.top, 0, 0, SWP_NOMOVE | SWP_NOSIZE); hCtrl = GetDlgItem(hDlg, IDC_SELECTION_EDITION); @@ -1002,16 +1002,16 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam // Set the default selection for (i = 0, m = 1; i < nDialogItems; i++, m <<= 1) Button_SetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), - (selection_data.options->style == BS_AUTORADIOBUTTON && selection_data.options->mask == 0 && i == 0) || - (selection_data.options->mask != 0 && (m & selection_data.options->mask) ? BST_CHECKED : BST_UNCHECKED)); + (selection_data[s].options->style == BS_AUTORADIOBUTTON && selection_data[s].options->mask == 0 && i == 0) || + (selection_data[s].options->mask != 0 && (m & selection_data[s].options->mask) ? BST_CHECKED : BST_UNCHECKED)); // Set the default state of the silent install option if available - if (selection_data.options->edition_index > 0 && selection_data.options->username_index > 0 && - selection_data.options->regional_index > 0 && selection_data.options->privacy_index > 0) { + if (selection_data[s].options->edition_index > 0 && selection_data[s].options->username_index > 0 && + selection_data[s].options->regional_index > 0 && selection_data[s].options->privacy_index > 0) { // Should be the same condition as the one in WM_COMMAND - BOOL enable = Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->username_index - 1)) && - Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->regional_index - 1)) && - Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->privacy_index - 1)); - EnableWindow(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index - 1), enable); + BOOL enable = Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data[s].options->username_index - 1)) && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data[s].options->regional_index - 1)) && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data[s].options->privacy_index - 1)); + EnableWindow(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data[s].options->edition_index - 1), enable); EnableWindow(GetDlgItem(hDlg, IDC_SELECTION_EDITION), enable); } @@ -1022,35 +1022,35 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam case WM_CTLCOLORSTATIC: // Change the background colour for static text and icon SetBkMode((HDC)wParam, TRANSPARENT); - if ((HWND)lParam == GetDlgItem(hDlg, IDC_NOTIFICATION_LINE)) { - return (INT_PTR)separator_brush; - } - return (INT_PTR)background_brush; + if ((HWND)lParam == GetDlgItem(hDlg, IDC_NOTIFICATION_LINE)) + return (INT_PTR)GetSysColorBrush(COLOR_3DLIGHT); + return (INT_PTR)GetSysColorBrush(COLOR_WINDOW); case WM_NCHITTEST: // Check coordinates to prevent resize actions loc = DefWindowProc(hDlg, message, wParam, lParam); for (i = 0; i < 9; i++) { - if (loc == disabled[i]) { + if (loc == disabled[i]) return (INT_PTR)TRUE; - } } return (INT_PTR)FALSE; case WM_NCDESTROY: - safe_delete_object(hDlgFont); + if (s == 0) + safe_delete_object(hDlgFont); break; case WM_COMMAND: + BOOL silent_install_checked = FALSE; WORD command = LOWORD(wParam); if (command >= IDC_SELECTION_CHOICE1 && command < IDC_SELECTION_CHOICEMAX) { // Check if local account + regional settings + data collection checkboxes are clicked and enable/disable the silent install option - if (selection_data.options->edition_index > 0 && selection_data.options->username_index > 0 && - selection_data.options->edition_index > 0 && selection_data.options->regional_index > 0 && - (command - IDC_SELECTION_CHOICE1 == selection_data.options->username_index - 1 || - command - IDC_SELECTION_CHOICE1 == selection_data.options->regional_index - 1 || - command - IDC_SELECTION_CHOICE1 == selection_data.options->privacy_index - 1)) { - BOOL enable = Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->username_index - 1)) && - Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->regional_index - 1)) && - Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->privacy_index - 1)); - hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index - 1); + if (selection_data[s].options->edition_index > 0 && selection_data[s].options->username_index > 0 && + selection_data[s].options->edition_index > 0 && selection_data[s].options->regional_index > 0 && + (command - IDC_SELECTION_CHOICE1 == selection_data[s].options->username_index - 1 || + command - IDC_SELECTION_CHOICE1 == selection_data[s].options->regional_index - 1 || + command - IDC_SELECTION_CHOICE1 == selection_data[s].options->privacy_index - 1)) { + BOOL enable = Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data[s].options->username_index - 1)) && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data[s].options->regional_index - 1)) && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data[s].options->privacy_index - 1)); + hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data[s].options->edition_index - 1); if (!enable && IsWindowEnabled(hCtrl)) { silent_install_checked = (Button_GetCheck(hCtrl) == BST_CHECKED); Button_SetCheck(hCtrl, FALSE); @@ -1063,14 +1063,14 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam } else switch (LOWORD(wParam)) { case IDOK: // Produce a big scary warning if the silent install option was selected - if (selection_data.options->edition_index > 0 && - Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index - 1)) && + if (selection_data[s].options->edition_index > 0 && + Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data[s].options->edition_index - 1)) && Notification(MB_YESNO | MB_ICONWARNING, APPLICATION_NAME, lmprintf(MSG_356)) != IDYES) break; for (r = 0, i = 0, m = 1; i < nDialogItems; i++, m <<= 1) if (Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i)) == BST_CHECKED) r += m; - if (selection_data.options->username_index > 0) { + if (selection_data[s].options->username_index > 0) { GetWindowTextU(GetDlgItem(hDlg, IDC_SELECTION_USERNAME), unattend_username, MAX_USERNAME_LENGTH); // Perform string sanitization (NB: GetWindowTextU always terminates the string) for (i = 0; unattend_username[i] != 0; i++) { @@ -1080,7 +1080,7 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam // Also remove leading and trailing whitespaces (https://github.com/pbatard/rufus/issues/2950) trim(unattend_username); } - if (selection_data.options->edition_index > 0) + if (selection_data[s].options->edition_index > 0) unattend_edition_index = (int)ComboBox_GetCurItemData(GetDlgItem(hDlg, IDC_SELECTION_EDITION)); // Fall through case IDNO: @@ -1125,15 +1125,17 @@ int SelectionDialog(char* title, char* message, selection_dialog_options_t* opti assert(options != NULL); dialog_showing++; - selection_data.szMessageTitle = title; - selection_data.szMessageText = message; - selection_data.options = options; + s++; + selection_data[s].szMessageTitle = title; + selection_data[s].szMessageText = message; + selection_data[s].options = options; if (options->style == 0) options->style = BS_AUTORADIOBUTTON; assert ((options->style == BS_AUTORADIOBUTTON || options->style == BS_AUTOCHECKBOX)); hook = SetWindowsHookEx(WH_MOUSE, SelectionTooltipPopper, NULL, GetCurrentThreadId()); ret = (int)MyDialogBox(hMainInstance, IDD_SELECTION, hMainDialog, SelectionCallback); UnhookWindowsHookEx(hook); + s--; dialog_showing--; return ret; From 74b11028144156e3e932811435d177f34d4246ac Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Mon, 18 May 2026 16:20:35 +0100 Subject: [PATCH 191/192] [wue] add more forbidden local account names * Per https://learn.microsoft.com/en-us/archive/technet-wiki/13813.localized-names-for-administrator-account-in-windows#list-of-languages-that-localize-the-administrator-account-name Windows may localise the 'Administrator' account, so names like 'Administrador' need to be filtered out. * Also add a few more account names that are likely to be problematic. * Closes #2974. --- src/rufus.rc | 10 +++++----- src/wue.c | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/rufus.rc b/src/rufus.rc index bc793832..86663753 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.2381" +CAPTION "Rufus 4.15.2382" 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,2381,0 - PRODUCTVERSION 4,15,2381,0 + FILEVERSION 4,15,2382,0 + PRODUCTVERSION 4,15,2382,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.2381" + VALUE "FileVersion", "4.15.2382" 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.2381" + VALUE "ProductVersion", "4.15.2382" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index f5cb354c..fe870f6b 100644 --- a/src/wue.c +++ b/src/wue.c @@ -108,7 +108,11 @@ out: char* CreateUnattendXml(int arch, int flags) { const static char* xml_arch_names[5] = { "x86", "amd64", "arm", "arm64" }; - const static char* unallowed_account_names[] = { "Administrator", "Guest", "KRBTGT", "Local", "NONE" }; + const static char* unallowed_account_names[] = { + // From https://learn.microsoft.com/en-us/archive/technet-wiki/13813.localized-names-for-administrator-account-in-windows + "Administrator", "Järjestelmänvalvoja", "Administrateur", "Rendszergazda", "Administrador", "Администратор", "Administratör", + "Guest", "DefaultAccount", "WDAGUtilityAccount", "HelpAssistant", "KRBTGT", "Local", "NONE", "SYSTEM" + }; static char path[MAX_PATH], tmp[MAX_PATH]; char* tzstr; FILE* fd; From ffab56f2efac4ef43de7092cbdb5217a74b85998 Mon Sep 17 00:00:00 2001 From: Pete Batard <pete@akeo.ie> Date: Wed, 3 Jun 2026 16:45:39 +0100 Subject: [PATCH 192/192] [core] improve WriteFileWithRetry() * Cancelling now takes precedence over retries. * Simplify the code and use an OVERLAPPED for re-positioning. --- src/rufus.rc | 10 +++++----- src/stdio.c | 33 +++++++++++++-------------------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/src/rufus.rc b/src/rufus.rc index 86663753..4dbc562d 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.2382" +CAPTION "Rufus 4.15.2383" 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,2382,0 - PRODUCTVERSION 4,15,2382,0 + FILEVERSION 4,15,2383,0 + PRODUCTVERSION 4,15,2383,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.2382" + VALUE "FileVersion", "4.15.2383" 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.2382" + VALUE "ProductVersion", "4.15.2383" END END BLOCK "VarFileInfo" diff --git a/src/stdio.c b/src/stdio.c index 042622d3..c7861c65 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -36,6 +36,7 @@ #include "rufus.h" #include "ntdll.h" +#include "winio.h" #include "missing.h" #include "settings.h" #include "resource.h" @@ -614,28 +615,23 @@ HANDLE CreateFileWithTimeout(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwS BOOL WriteFileWithRetry(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, DWORD nNumRetries) { - DWORD nTry; - BOOL readFilePointer; - LARGE_INTEGER liFilePointer, liZero = { { 0,0 } }; - DWORD NumberOfBytesWritten; + static const LARGE_INTEGER liZero = { { 0,0 } }; + DWORD nTry, NumberOfBytesWritten; + NOW_THATS_WHAT_I_CALL_AN_OVERLAPPED overlapped = { 0 }; if (lpNumberOfBytesWritten == NULL) lpNumberOfBytesWritten = &NumberOfBytesWritten; - // Need to get the current file pointer in case we need to retry - readFilePointer = SetFilePointerEx(hFile, liZero, &liFilePointer, FILE_CURRENT); - if (!readFilePointer) - uprintf("WARNING: Could not read file pointer %s", WindowsErrorString()); + // Need to get the current file pointer for retry + if (!SetFilePointerEx(hFile, liZero, (PLARGE_INTEGER)&overlapped.Offset, FILE_CURRENT)) { + uprintf("ERROR: Could not set file offset %s", WindowsErrorString()); + return FALSE; + } if (nNumRetries == 0) nNumRetries = 1; - for (nTry = 1; nTry <= nNumRetries; nTry++) { - // Need to rewind our file position on retry - if we can't even do that, just give up - if ((nTry > 1) && (!SetFilePointerEx(hFile, liFilePointer, NULL, FILE_BEGIN))) { - uprintf("Could not set file pointer - Aborting"); - break; - } - if (WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, NULL)) { + for (nTry = 1; nTry <= nNumRetries && (HRESULT_CODE(ErrorStatus) != ERROR_CANCELLED); nTry++) { + if (WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, (LPOVERLAPPED)&overlapped)) { LastWriteError = 0; if (nNumberOfBytesToWrite == *lpNumberOfBytesWritten) return TRUE; @@ -648,18 +644,15 @@ BOOL WriteFileWithRetry(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWr } else { uprintf("Write error %s", WindowsErrorString()); LastWriteError = RUFUS_ERROR(GetLastError()); - if (LastWriteError == RUFUS_ERROR(ERROR_DISK_FULL)) + if (LastWriteError == RUFUS_ERROR(ERROR_DISK_FULL) || HRESULT_CODE(ErrorStatus) == ERROR_CANCELLED) break; } - // If we can't reposition for the next run, just abort - if (!readFilePointer) - break; if (nTry < nNumRetries) { uprintf("Retrying in %d seconds...", WRITE_TIMEOUT / 1000); Sleep(WRITE_TIMEOUT); } } - if (SCODE_CODE(GetLastError()) == ERROR_SUCCESS) + if (SCODE_CODE(GetLastError()) == ERROR_SUCCESS && HRESULT_CODE(ErrorStatus) != ERROR_CANCELLED) SetLastError(RUFUS_ERROR(ERROR_WRITE_FAULT)); return FALSE; }