diff options
Diffstat (limited to 'src/Boot')
80 files changed, 178 insertions, 429 deletions
diff --git a/src/Boot/EFI/DcsBoot.efi b/src/Boot/EFI/DcsBoot.efi Binary files differindex 0fcd48e3..02884df9 100644 --- a/src/Boot/EFI/DcsBoot.efi +++ b/src/Boot/EFI/DcsBoot.efi diff --git a/src/Boot/EFI/DcsBoot32.efi b/src/Boot/EFI/DcsBoot32.efi Binary files differdeleted file mode 100644 index 48db0ca5..00000000 --- a/src/Boot/EFI/DcsBoot32.efi +++ /dev/null diff --git a/src/Boot/EFI/DcsCfg.efi b/src/Boot/EFI/DcsCfg.efi Binary files differindex 03c9761e..82dc446a 100644 --- a/src/Boot/EFI/DcsCfg.efi +++ b/src/Boot/EFI/DcsCfg.efi diff --git a/src/Boot/EFI/DcsCfg32.efi b/src/Boot/EFI/DcsCfg32.efi Binary files differdeleted file mode 100644 index 22cc0d5a..00000000 --- a/src/Boot/EFI/DcsCfg32.efi +++ /dev/null diff --git a/src/Boot/EFI/DcsInfo.efi b/src/Boot/EFI/DcsInfo.efi Binary files differindex 6be1cb8f..15810f4d 100644 --- a/src/Boot/EFI/DcsInfo.efi +++ b/src/Boot/EFI/DcsInfo.efi diff --git a/src/Boot/EFI/DcsInfo32.efi b/src/Boot/EFI/DcsInfo32.efi Binary files differdeleted file mode 100644 index 006adfb6..00000000 --- a/src/Boot/EFI/DcsInfo32.efi +++ /dev/null diff --git a/src/Boot/EFI/DcsInt.efi b/src/Boot/EFI/DcsInt.efi Binary files differindex a0c2975a..3816327a 100644 --- a/src/Boot/EFI/DcsInt.efi +++ b/src/Boot/EFI/DcsInt.efi diff --git a/src/Boot/EFI/DcsInt32.efi b/src/Boot/EFI/DcsInt32.efi Binary files differdeleted file mode 100644 index 991885f9..00000000 --- a/src/Boot/EFI/DcsInt32.efi +++ /dev/null diff --git a/src/Boot/EFI/DcsRe.efi b/src/Boot/EFI/DcsRe.efi Binary files differindex 070cc97c..599f7026 100644 --- a/src/Boot/EFI/DcsRe.efi +++ b/src/Boot/EFI/DcsRe.efi diff --git a/src/Boot/EFI/DcsRe32.efi b/src/Boot/EFI/DcsRe32.efi Binary files differdeleted file mode 100644 index c4f2013b..00000000 --- a/src/Boot/EFI/DcsRe32.efi +++ /dev/null diff --git a/src/Boot/EFI/LegacySpeaker.efi b/src/Boot/EFI/LegacySpeaker.efi Binary files differindex a1d14eb2..034c760b 100644 --- a/src/Boot/EFI/LegacySpeaker.efi +++ b/src/Boot/EFI/LegacySpeaker.efi diff --git a/src/Boot/EFI/LegacySpeaker32.efi b/src/Boot/EFI/LegacySpeaker32.efi Binary files differdeleted file mode 100644 index 1ec5ba69..00000000 --- a/src/Boot/EFI/LegacySpeaker32.efi +++ /dev/null diff --git a/src/Boot/EFI/Readme.txt b/src/Boot/EFI/Readme.txt index 43e29986..ed732bc2 100644 --- a/src/Boot/EFI/Readme.txt +++ b/src/Boot/EFI/Readme.txt @@ -1,17 +1,16 @@ The source code for VeraCrypt EFI bootloader files is available at: https://github.com/veracrypt/VeraCrypt-DCS -VeraCrypt-DCS uses EDK II as its UEFI development environement. +VeraCrypt-DCS uses EDK II as its UEFI development environment. VeraCrypt-DCS is licensed under LGPL: https://github.com/veracrypt/VeraCrypt-DCS/blob/master/LICENSE Here the steps to build VeraCrypt-DCS (Visual Studio 2010 SP1 should be installed) - * Clone EDK: git clone https://github.com/tianocore/tianocore.github.io.git edk2 + * Clone EDK: git clone https://github.com/tianocore/edk2.git edk2 * Switch to UDK2015 branche: git checkout UDK2015 - * Clone VeraCrypt-DCS as DcsPkg inside edk2 folder: git clone https://github.com/veracrypt/VeraCrypt-DCS.git DcsPkg + * Clone VeraCrypt-DCS as DcsPkg inside edk2 folder: git clone https://github.com/veracrypt/VeraCrypt-DCS.git DcsPkg * Switch to VeraCrypt_1.18 branche: git checkout VeraCrypt_1.18 * Setup EDK by typing edksetup.bat at the root of folder edk2 * change directoty to DcsPkg and then type setenv.bat. * change directory to DcsPkg\Library\VeraCryptLib and then type mklinks_src.bat: you will be asked to provide the path to VeraCrypt src folder. * change directory to DcsPkg and then type dcs_bld.bat X64Rel * After the build is finished, EFI bootloader files will be present at edk2\Build\DcsPkg\RELEASE_VS2010x86\X64 -
\ No newline at end of file diff --git a/src/Boot/Windows/Bios.h b/src/Boot/Windows/Bios.h index 7085e7a2..a8a3c731 100644 --- a/src/Boot/Windows/Bios.h +++ b/src/Boot/Windows/Bios.h @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. @@ -28,6 +28,6 @@ enum BiosResultTimeout = 0x80 }; -typedef byte BiosResult; +typedef uint8 BiosResult; #endif // TC_HEADER_Boot_Bios diff --git a/src/Boot/Windows/Boot.vcproj b/src/Boot/Windows/Boot.vcproj deleted file mode 100644 index c73b099e..00000000 --- a/src/Boot/Windows/Boot.vcproj +++ /dev/null @@ -1,250 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="Boot" - ProjectGUID="{8B7F059F-E4C7-4E11-88F5-EE8B8433072E}" - RootNamespace="Boot" - Keyword="MakeFileProj" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory="$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="0" - > - <Tool - Name="VCNMakeTool" - BuildCommandLine="md Release 2>NUL:
nmake.exe /nologo RELEASE=1

md Release_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2

md Release_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES

md Release_AES_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2

md Release_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT

md Release_Serpent_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2

md Release_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH

md Release_Twofish_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2

md Release_Camellia 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA

md Release_Camellia_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA SINGLE_PRF=SHA2

md Rescue 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1

md Rescue_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2

md Rescue_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1

md Rescue_AES_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2

md Rescue_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1

md Rescue_Serpent_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2

md Rescue_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1

md Rescue_Twofish_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2

md Rescue_Camellia 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1

md Rescue_Camellia_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1 SINGLE_PRF=SHA2" - ReBuildCommandLine="del /q /s Release >NUL:
md Release 2>NUL:
nmake.exe /nologo RELEASE=1

del /q /s Release_SHA2 >NUL:
md Release_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2

del /q /s Release_AES >NUL:
md Release_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES

del /q /s Release_AES_SHA2 >NUL:
md Release_AES_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2

del /q /s Release_Serpent >NUL:
md Release_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT

del /q /s Release_Serpent_SHA2 >NUL:
md Release_Serpent_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2

del /q /s Release_Twofish >NUL:
md Release_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH

del /q /s Release_Twofish_SHA2 >NUL:
md Release_Twofish_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2

del /q /s Release_Camellia >NUL:
md Release_Camellia 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA

del /q /s Release_Camellia_SHA2 >NUL:
md Release_Camellia_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA SINGLE_PRF=SHA2

del /q /s Rescue >NUL:
md Rescue 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1

del /q /s Rescue_SHA2 >NUL:
md Rescue_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2

del /q /s Rescue_AES >NUL:
md Rescue_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1

del /q /s Rescue_AES_SHA2 >NUL:
md Rescue_AES_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2

del /q /s Rescue_Serpent >NUL:
md Rescue_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1

del /q /s Rescue_Serpent_SHA2 >NUL:
md Rescue_Serpent_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2

del /q /s Rescue_Twofish >NUL:
md Rescue_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1

del /q /s Rescue_Twofish_SHA2 >NUL:
md Rescue_Twofish_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2

del /q /s Rescue_Camellia >NUL:
md Rescue_Camellia 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1

del /q /s Rescue_Camellia_SHA2 >NUL:
md Rescue_Camellia_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1 SINGLE_PRF=SHA2" - CleanCommandLine="del /q /s Release Release_AES Release_Serpent Release_Twofish Release_Camellia Rescue Rescue_AES Rescue_Serpent Rescue_Twofish Rescue_Camellia >NUL:
del /q /s Release_SHA2 Release_AES_SHA2 Release_Serpent_SHA2 Release_Twofish_SHA2 Release_Camellia_SHA2 Rescue_SHA2 Rescue_AES_SHA2 Rescue_Serpent_SHA2 Rescue_Twofish_SHA2 Rescue_Camellia_SHA2 >NUL:
" - Output="Release\BootLoader.com" - PreprocessorDefinitions="WIN32;NDEBUG" - IncludeSearchPath=""$(SolutionDir)";"$(SolutionDir)\Common";"$(SolutionDir)\Crypto";"$(MSVC16_ROOT)\Include"" - ForcedIncludes="" - AssemblySearchPath="" - ForcedUsingAssemblies="" - CompileAsManaged="" - /> - </Configuration> - <Configuration - Name="Release Loader|Win32" - OutputDirectory="$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="0" - > - <Tool - Name="VCNMakeTool" - BuildCommandLine="md Release 2>NUL:
nmake.exe /nologo RELEASE=1

md Release_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES

md Release_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT

md Release_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH" - ReBuildCommandLine="del /q /s Release >NUL:
md Release 2>NUL:
nmake.exe /nologo RELEASE=1

del /q /s Release_AES >NUL:
md Release_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES

del /q /s Release_Serpent >NUL:
md Release_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT

del /q /s Release_Twofish >NUL:
md Release_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH" - CleanCommandLine="del /q /s Release Release_AES Release_Serpent Release_Twofish >NUL:" - Output="Release\BootLoader.com" - PreprocessorDefinitions="WIN32;NDEBUG" - IncludeSearchPath=""$(SolutionDir)";"$(SolutionDir)\Common";"$(SolutionDir)\Crypto";"$(MSVC16_ROOT)\Include"" - ForcedIncludes="" - AssemblySearchPath="" - ForcedUsingAssemblies="" - CompileAsManaged="" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\BootConfig.cpp" - > - </File> - <File - RelativePath=".\BootConsoleIo.cpp" - > - </File> - <File - RelativePath=".\BootCrt.asm" - > - </File> - <File - RelativePath=".\BootDebug.cpp" - > - </File> - <File - RelativePath=".\BootDiskIo.cpp" - > - </File> - <File - RelativePath=".\BootEncryptedIo.cpp" - > - </File> - <File - RelativePath=".\BootMain.cpp" - > - </File> - <File - RelativePath=".\BootMemory.cpp" - > - </File> - <File - RelativePath=".\BootSector.asm" - > - </File> - <File - RelativePath=".\Decompressor.c" - > - </File> - <File - RelativePath=".\IntFilter.cpp" - > - </File> - <File - RelativePath=".\Platform.cpp" - > - </File> - <Filter - Name="Common" - > - <File - RelativePath="..\..\Common\Crc.c" - > - </File> - <File - RelativePath="..\..\Common\Crypto.c" - > - </File> - <File - RelativePath="..\..\Common\Endian.c" - > - </File> - <File - RelativePath="..\..\Common\Pkcs5.c" - > - </File> - <File - RelativePath="..\..\Common\Volumes.c" - > - </File> - <File - RelativePath="..\..\Common\Xts.c" - > - </File> - </Filter> - <Filter - Name="Crypto" - > - <File - RelativePath="..\..\Crypto\Aes_hw_cpu.asm" - > - </File> - <File - RelativePath="..\..\Crypto\AesSmall.c" - > - </File> - <File - RelativePath="..\..\Crypto\AesSmall_x86.asm" - > - </File> - <File - RelativePath="..\..\Crypto\CamelliaSmall.c" - > - </File> - <File - RelativePath="..\..\Crypto\Rmd160.c" - > - </File> - <File - RelativePath="..\..\Crypto\Serpent.c" - > - </File> - <File - RelativePath="..\..\Crypto\Sha2Small.c" - > - </File> - <File - RelativePath="..\..\Crypto\Twofish.c" - > - </File> - </Filter> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath=".\Bios.h" - > - </File> - <File - RelativePath=".\BootCommon.h" - > - </File> - <File - RelativePath=".\BootConfig.h" - > - </File> - <File - RelativePath=".\BootConsoleIo.h" - > - </File> - <File - RelativePath=".\BootDebug.h" - > - </File> - <File - RelativePath=".\BootDefs.h" - > - </File> - <File - RelativePath=".\BootDiskIo.h" - > - </File> - <File - RelativePath=".\BootEncryptedIo.h" - > - </File> - <File - RelativePath=".\BootMain.h" - > - </File> - <File - RelativePath=".\BootMemory.h" - > - </File> - <File - RelativePath=".\BootStrings.h" - > - </File> - <File - RelativePath=".\IntFilter.h" - > - </File> - <File - RelativePath=".\Platform.h" - > - </File> - </Filter> - <Filter - Name="Build Files" - > - <File - RelativePath=".\Makefile" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/Boot/Windows/Boot.vcxproj b/src/Boot/Windows/Boot.vcxproj index 68d5d270..b9a04d80 100644 --- a/src/Boot/Windows/Boot.vcxproj +++ b/src/Boot/Windows/Boot.vcxproj @@ -222,6 +222,7 @@ nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH</NMakeReBuildCommandLine> <ItemDefinitionGroup> </ItemDefinitionGroup> <ItemGroup> + <ClCompile Include="..\..\Crypto\blake2s-ref.c" /> <ClCompile Include="BootConfig.cpp" /> <ClCompile Include="BootConsoleIo.cpp" /> <ClCompile Include="BootDebug.cpp" /> @@ -240,7 +241,6 @@ nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH</NMakeReBuildCommandLine> <ClCompile Include="..\..\Common\Xts.c" /> <ClCompile Include="..\..\Crypto\AesSmall.c" /> <ClCompile Include="..\..\Crypto\CamelliaSmall.c" /> - <ClCompile Include="..\..\Crypto\Rmd160.c" /> <ClCompile Include="..\..\Crypto\Serpent.c" /> <ClCompile Include="..\..\Crypto\Sha2Small.c" /> <ClCompile Include="..\..\Crypto\Twofish.c" /> diff --git a/src/Boot/Windows/Boot.vcxproj.filters b/src/Boot/Windows/Boot.vcxproj.filters index 1a60ac81..24d23894 100644 --- a/src/Boot/Windows/Boot.vcxproj.filters +++ b/src/Boot/Windows/Boot.vcxproj.filters @@ -74,9 +74,6 @@ <ClCompile Include="..\..\Crypto\CamelliaSmall.c"> <Filter>Source Files\Crypto</Filter> </ClCompile> - <ClCompile Include="..\..\Crypto\Rmd160.c"> - <Filter>Source Files\Crypto</Filter> - </ClCompile> <ClCompile Include="..\..\Crypto\Serpent.c"> <Filter>Source Files\Crypto</Filter> </ClCompile> @@ -86,6 +83,9 @@ <ClCompile Include="..\..\Crypto\Twofish.c"> <Filter>Source Files\Crypto</Filter> </ClCompile> + <ClCompile Include="..\..\Crypto\blake2s-ref.c"> + <Filter>Source Files\Crypto</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <None Include="BootCrt.asm"> diff --git a/src/Boot/Windows/BootCommon.h b/src/Boot/Windows/BootCommon.h index b77b8802..38cd4361 100644 --- a/src/Boot/Windows/BootCommon.h +++ b/src/Boot/Windows/BootCommon.h @@ -3,8 +3,8 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + Modifications and additions to the original source code (contained in this file) + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. @@ -17,7 +17,7 @@ #include "BootDefs.h" // The user will be advised to upgrade the rescue disk if upgrading from the following or any previous version -#define TC_RESCUE_DISK_UPGRADE_NOTICE_MAX_VERSION 0x0123 +#define TC_RESCUE_DISK_UPGRADE_NOTICE_MAX_VERSION 0x0125 #define TC_BOOT_LOADER_AREA_SIZE (TC_BOOT_LOADER_AREA_SECTOR_COUNT * TC_SECTOR_SIZE_BIOS) @@ -43,7 +43,7 @@ typedef struct { - byte Flags; + uint8 Flags; } BootSectorConfiguration; @@ -120,7 +120,7 @@ typedef struct { uint32 Data1; uint16 Data2; uint16 Data3; - byte Data4[8]; + uint8 Data4[8]; } DCS_GUID; // DE types @@ -155,7 +155,7 @@ typedef struct _DCS_DISK_ENTRY { struct { uint32 Type; uint32 Offset; - byte reserved[16]; + uint8 reserved[16]; uint64 Length; // size of structure at Offset }; DCS_DISK_ENTRY_SECTORS Sectors; @@ -178,7 +178,7 @@ CSTATIC_ASSERT(FIELD_OFFSET(DCS_DISK_ENTRY, Length) == FIELD_OFFSET(DCS_DISK_ENT CSTATIC_ASSERT(FIELD_OFFSET(DCS_DISK_ENTRY, Offset) == FIELD_OFFSET(DCS_DISK_ENTRY_SECTORS, Offset), Wrong_Offset_offset); CSTATIC_ASSERT(FIELD_OFFSET(DCS_DISK_ENTRY, Offset) == FIELD_OFFSET(DCS_DISK_ENTRY_PARAMS, Offset), Wrong_Offset_offset); -// DE type specific data +// DE type specific data // DE List typedef struct _DCS_DISK_ENTRY_LIST { // EFI_TABLE_HEADER @@ -208,7 +208,7 @@ typedef struct _DCS_DEP_PWD_CACHE { uint32 Count; PasswordLegacy Pwd[4]; int32 Pim[4]; - byte pad[512 - 8 - 4 - 4 - (sizeof(PasswordLegacy) + 4) * 4]; + uint8 pad[512 - 8 - 4 - 4 - (sizeof(PasswordLegacy) + 4) * 4]; } DCS_DEP_PWD_CACHE; CSTATIC_ASSERT(sizeof(DCS_DEP_PWD_CACHE) == 512, Wrong_size_DCS_DEP_PWD_CACHE); #pragma pack() diff --git a/src/Boot/Windows/BootConfig.cpp b/src/Boot/Windows/BootConfig.cpp index 0412d082..77286f92 100644 --- a/src/Boot/Windows/BootConfig.cpp +++ b/src/Boot/Windows/BootConfig.cpp @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. @@ -12,10 +12,10 @@ #include "BootConfig.h" -byte BootSectorFlags; +uint8 BootSectorFlags; -byte BootLoaderDrive; -byte BootDrive; +uint8 BootLoaderDrive; +uint8 BootDrive; bool BootDriveGeometryValid = false; bool PreventNormalSystemBoot = false; bool PreventBootMenu = false; @@ -39,7 +39,7 @@ uint64 HiddenVolumeStartSector; void ReadBootSectorUserConfiguration () { - byte userConfig; + uint8 userConfig; AcquireSectorBuffer(); @@ -83,7 +83,7 @@ ret: } -BiosResult UpdateBootSectorConfiguration (byte drive) +BiosResult UpdateBootSectorConfiguration (uint8 drive) { uint64 mbrSector; mbrSector.HighPart = 0; diff --git a/src/Boot/Windows/BootConfig.h b/src/Boot/Windows/BootConfig.h index b66dc233..27270c56 100644 --- a/src/Boot/Windows/BootConfig.h +++ b/src/Boot/Windows/BootConfig.h @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. @@ -17,10 +17,10 @@ #include "Platform.h" #include "BootDiskIo.h" -extern byte BootSectorFlags; +extern uint8 BootSectorFlags; -extern byte BootLoaderDrive; -extern byte BootDrive; +extern uint8 BootLoaderDrive; +extern uint8 BootDrive; extern bool BootDriveGeometryValid; extern DriveGeometry BootDriveGeometry; extern bool PreventNormalSystemBoot; @@ -41,6 +41,6 @@ extern uint64 HiddenVolumeStartSector; void ReadBootSectorUserConfiguration (); -BiosResult UpdateBootSectorConfiguration (byte drive); +BiosResult UpdateBootSectorConfiguration (uint8 drive); #endif // TC_HEADER_Boot_BootConfig diff --git a/src/Boot/Windows/BootConsoleIo.cpp b/src/Boot/Windows/BootConsoleIo.cpp index 9148f5c9..e1dea4ed 100644 --- a/src/Boot/Windows/BootConsoleIo.cpp +++ b/src/Boot/Windows/BootConsoleIo.cpp @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. @@ -101,7 +101,7 @@ void Print (const uint64 &number) } -void PrintHex (byte b) +void PrintHex (uint8 b) { PrintChar (((b >> 4) >= 0xA ? 'A' - 0xA : '0') + (b >> 4)); PrintChar (((b & 0xF) >= 0xA ? 'A' - 0xA : '0') + (b & 0xF)); @@ -110,8 +110,8 @@ void PrintHex (byte b) void PrintHex (uint16 data) { - PrintHex (byte (data >> 8)); - PrintHex (byte (data)); + PrintHex (uint8 (data >> 8)); + PrintHex (uint8 (data)); } @@ -219,9 +219,9 @@ void PrintErrorNoEndl (const char *message) } -byte GetShiftFlags () +uint8 GetShiftFlags () { - byte flags; + uint8 flags; __asm { mov ah, 2 @@ -233,7 +233,7 @@ byte GetShiftFlags () } -byte GetKeyboardChar () +uint8 GetKeyboardChar () { return GetKeyboardChar (nullptr); } @@ -253,20 +253,20 @@ inline void Sleep () } */ -byte GetKeyboardChar (byte *scanCode) +uint8 GetKeyboardChar (uint8 *scanCode) { // Work around potential BIOS bugs (Windows boot manager polls the keystroke buffer) while (!IsKeyboardCharAvailable()) { // reduce CPU usage by halting CPU until the next external interrupt is fired __asm - { + { hlt } } - byte asciiCode; - byte scan; + uint8 asciiCode; + uint8 scan; __asm { mov ah, 0 @@ -302,7 +302,7 @@ bool EscKeyPressed () { if (IsKeyboardCharAvailable ()) { - byte keyScanCode; + uint8 keyScanCode; GetKeyboardChar (&keyScanCode); return keyScanCode == TC_BIOS_KEY_ESC; } @@ -346,8 +346,8 @@ bool IsDigit (char c) int GetString (char *buffer, size_t bufferSize) { - byte c; - byte scanCode; + uint8 c; + uint8 scanCode; size_t pos = 0; while (pos < bufferSize) diff --git a/src/Boot/Windows/BootConsoleIo.h b/src/Boot/Windows/BootConsoleIo.h index 349782eb..99ae860d 100644 --- a/src/Boot/Windows/BootConsoleIo.h +++ b/src/Boot/Windows/BootConsoleIo.h @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. @@ -45,9 +45,9 @@ void ClearScreen (); void DisableScreenOutput (); void EnableScreenOutput (); bool EscKeyPressed (); -byte GetKeyboardChar (); -byte GetKeyboardChar (byte *scanCode); -byte GetShiftFlags (); +uint8 GetKeyboardChar (); +uint8 GetKeyboardChar (uint8 *scanCode); +uint8 GetShiftFlags (); int GetString (char *buffer, size_t bufferSize); void InitVideoMode (); bool IsKeyboardCharAvailable (); @@ -64,7 +64,7 @@ void PrintEndl (int cnt); void PrintRepeatedChar (char c, int n); void PrintError (const char *message); void PrintErrorNoEndl (const char *message); -void PrintHex (byte b); +void PrintHex (uint8 b); void PrintHex (uint16 data); void PrintHex (uint32 data); void PrintHex (const uint64 &data); diff --git a/src/Boot/Windows/BootDebug.cpp b/src/Boot/Windows/BootDebug.cpp index bea063c1..9295cd31 100644 --- a/src/Boot/Windows/BootDebug.cpp +++ b/src/Boot/Windows/BootDebug.cpp @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. @@ -34,7 +34,7 @@ void InitDebugPort () } -void WriteDebugPort (byte dataByte) +void WriteDebugPort (uint8 dataByte) { __asm { @@ -82,7 +82,7 @@ void PrintVal (const char *message, const uint64 &value, bool newLine, bool hex) } -void PrintHexDump (byte *mem, size_t size, uint16 *memSegment) +void PrintHexDump (uint8 *mem, size_t size, uint16 *memSegment) { const size_t width = 16; for (size_t pos = 0; pos < size; ) @@ -92,7 +92,7 @@ void PrintHexDump (byte *mem, size_t size, uint16 *memSegment) size_t i; for (i = 0; i < width && pos < size; ++i) { - byte dataByte; + uint8 dataByte; if (memSegment) { __asm @@ -134,7 +134,7 @@ void PrintHexDump (byte *mem, size_t size, uint16 *memSegment) void PrintHexDump (uint16 memSegment, uint16 memOffset, size_t size) { - PrintHexDump ((byte *) memOffset, size, &memSegment); + PrintHexDump ((uint8 *) memOffset, size, &memSegment); } #endif // TC_BOOT_DEBUG_ENABLED diff --git a/src/Boot/Windows/BootDebug.h b/src/Boot/Windows/BootDebug.h index f94ab900..febb12af 100644 --- a/src/Boot/Windows/BootDebug.h +++ b/src/Boot/Windows/BootDebug.h @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. @@ -51,8 +51,8 @@ void InitDebugPort (); void InitStackChecker (); -void WriteDebugPort (byte dataByte); -void PrintHexDump (byte *mem, size_t size, uint16 *memSegment = nullptr); +void WriteDebugPort (uint8 dataByte); +void PrintHexDump (uint8 *mem, size_t size, uint16 *memSegment = nullptr); void PrintHexDump (uint16 memSegment, uint16 memOffset, size_t size); void PrintVal (const char *message, const uint32 value, bool newLine = true, bool hex = false); void PrintVal (const char *message, const uint64 &value, bool newLine = true, bool hex = false); diff --git a/src/Boot/Windows/BootDefs.h b/src/Boot/Windows/BootDefs.h index 3d65f0a0..8191fb71 100644 --- a/src/Boot/Windows/BootDefs.h +++ b/src/Boot/Windows/BootDefs.h @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. diff --git a/src/Boot/Windows/BootDiskIo.cpp b/src/Boot/Windows/BootDiskIo.cpp index 437c462e..f9ac359a 100644 --- a/src/Boot/Windows/BootDiskIo.cpp +++ b/src/Boot/Windows/BootDiskIo.cpp @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. @@ -19,7 +19,7 @@ #include "BootStrings.h" -byte SectorBuffer[TC_LB_SIZE]; +uint8 SectorBuffer[TC_LB_SIZE]; #ifdef TC_BOOT_DEBUG_ENABLED static bool SectorBufferInUse = false; @@ -41,9 +41,9 @@ void ReleaseSectorBuffer () #endif -bool IsLbaSupported (byte drive) +bool IsLbaSupported (uint8 drive) { - static byte CachedDrive = TC_INVALID_BIOS_DRIVE; + static uint8 CachedDrive = TC_INVALID_BIOS_DRIVE; static bool CachedStatus; uint16 result = 0; @@ -68,7 +68,7 @@ ret: } -void PrintDiskError (BiosResult error, bool write, byte drive, const uint64 *sector, const ChsAddress *chs) +void PrintDiskError (BiosResult error, bool write, uint8 drive, const uint64 *sector, const ChsAddress *chs) { PrintEndl(); Print (write ? "Write" : "Read"); Print (" error:"); @@ -109,17 +109,17 @@ void PrintSectorCountInMB (const uint64 §orCount) } -BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, byte drive, const ChsAddress &chs, byte sectorCount, bool silent) +BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, uint8 drive, const ChsAddress &chs, uint8 sectorCount, bool silent) { CheckStack(); - byte cylinderLow = (byte) chs.Cylinder; - byte sector = chs.Sector; - sector |= byte (chs.Cylinder >> 2) & 0xc0; - byte function = write ? 0x03 : 0x02; + uint8 cylinderLow = (uint8) chs.Cylinder; + uint8 sector = chs.Sector; + sector |= uint8 (chs.Cylinder >> 2) & 0xc0; + uint8 function = write ? 0x03 : 0x02; BiosResult result; - byte tryCount = TC_MAX_BIOS_DISK_IO_RETRIES; + uint8 tryCount = TC_MAX_BIOS_DISK_IO_RETRIES; do { @@ -159,20 +159,20 @@ BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffs #ifdef TC_WINDOWS_BOOT_RESCUE_DISK_MODE -BiosResult ReadWriteSectors (bool write, byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent) +BiosResult ReadWriteSectors (bool write, uint8 *buffer, uint8 drive, const ChsAddress &chs, uint8 sectorCount, bool silent) { uint16 codeSeg; __asm mov codeSeg, cs return ReadWriteSectors (write, codeSeg, (uint16) buffer, drive, chs, sectorCount, silent); } -BiosResult ReadSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent) +BiosResult ReadSectors (uint8 *buffer, uint8 drive, const ChsAddress &chs, uint8 sectorCount, bool silent) { return ReadWriteSectors (false, buffer, drive, chs, sectorCount, silent); } #if 0 -BiosResult WriteSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent) +BiosResult WriteSectors (uint8 *buffer, uint8 drive, const ChsAddress &chs, uint8 sectorCount, bool silent) { return ReadWriteSectors (true, buffer, drive, chs, sectorCount, silent); } @@ -180,7 +180,7 @@ BiosResult WriteSectors (byte *buffer, byte drive, const ChsAddress &chs, byte s #endif -static BiosResult ReadWriteSectors (bool write, BiosLbaPacket &dapPacket, byte drive, const uint64 §or, uint16 sectorCount, bool silent) +static BiosResult ReadWriteSectors (bool write, BiosLbaPacket &dapPacket, uint8 drive, const uint64 §or, uint16 sectorCount, bool silent) { CheckStack(); @@ -202,10 +202,10 @@ static BiosResult ReadWriteSectors (bool write, BiosLbaPacket &dapPacket, byte d dapPacket.SectorCount = sectorCount; dapPacket.Sector = sector; - byte function = write ? 0x43 : 0x42; + uint8 function = write ? 0x43 : 0x42; BiosResult result; - byte tryCount = TC_MAX_BIOS_DISK_IO_RETRIES; + uint8 tryCount = TC_MAX_BIOS_DISK_IO_RETRIES; do { @@ -237,7 +237,7 @@ static BiosResult ReadWriteSectors (bool write, BiosLbaPacket &dapPacket, byte d } -BiosResult ReadWriteSectors (bool write, byte *buffer, byte drive, const uint64 §or, uint16 sectorCount, bool silent) +BiosResult ReadWriteSectors (bool write, uint8 *buffer, uint8 drive, const uint64 §or, uint16 sectorCount, bool silent) { BiosLbaPacket dapPacket; dapPacket.Buffer = (uint32) buffer; @@ -245,20 +245,20 @@ BiosResult ReadWriteSectors (bool write, byte *buffer, byte drive, const uint64 } -BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 §or, uint16 sectorCount, bool silent) +BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, uint8 drive, const uint64 §or, uint16 sectorCount, bool silent) { BiosLbaPacket dapPacket; dapPacket.Buffer = ((uint32) bufferSegment << 16) | bufferOffset; return ReadWriteSectors (write, dapPacket, drive, sector, sectorCount, silent); } -BiosResult ReadSectors (uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 §or, uint16 sectorCount, bool silent) +BiosResult ReadSectors (uint16 bufferSegment, uint16 bufferOffset, uint8 drive, const uint64 §or, uint16 sectorCount, bool silent) { return ReadWriteSectors (false, bufferSegment, bufferOffset, drive, sector, sectorCount, silent); } -BiosResult ReadSectors (byte *buffer, byte drive, const uint64 §or, uint16 sectorCount, bool silent) +BiosResult ReadSectors (uint8 *buffer, uint8 drive, const uint64 §or, uint16 sectorCount, bool silent) { BiosResult result; uint16 codeSeg; @@ -274,17 +274,17 @@ BiosResult ReadSectors (byte *buffer, byte drive, const uint64 §or, uint16 s } -BiosResult WriteSectors (byte *buffer, byte drive, const uint64 §or, uint16 sectorCount, bool silent) +BiosResult WriteSectors (uint8 *buffer, uint8 drive, const uint64 §or, uint16 sectorCount, bool silent) { return ReadWriteSectors (true, buffer, drive, sector, sectorCount, silent); } -BiosResult GetDriveGeometry (byte drive, DriveGeometry &geometry, bool silent) +BiosResult GetDriveGeometry (uint8 drive, DriveGeometry &geometry, bool silent) { CheckStack(); - byte maxCylinderLow, maxHead, maxSector; + uint8 maxCylinderLow, maxHead, maxSector; BiosResult result; __asm { @@ -329,9 +329,9 @@ void ChsToLba (const DriveGeometry &geometry, const ChsAddress &chs, uint64 &lba void LbaToChs (const DriveGeometry &geometry, const uint64 &lba, ChsAddress &chs) { - chs.Sector = (byte) ((lba.LowPart % geometry.Sectors) + 1); + chs.Sector = (uint8) ((lba.LowPart % geometry.Sectors) + 1); uint32 ch = lba.LowPart / geometry.Sectors; - chs.Head = (byte) (ch % geometry.Heads); + chs.Head = (uint8) (ch % geometry.Heads); chs.Cylinder = (uint16) (ch / geometry.Heads); } @@ -349,7 +349,7 @@ void PartitionEntryMBRToPartition (const PartitionEntryMBR &partEntry, Partition } -BiosResult ReadWriteMBR (bool write, byte drive, bool silent) +BiosResult ReadWriteMBR (bool write, uint8 drive, bool silent) { uint64 mbrSector; mbrSector.HighPart = 0; @@ -362,7 +362,7 @@ BiosResult ReadWriteMBR (bool write, byte drive, bool silent) } -BiosResult GetDrivePartitions (byte drive, Partition *partitionArray, size_t partitionArrayCapacity, size_t &partitionCount, bool activeOnly, Partition *findPartitionFollowingThis, bool silent) +BiosResult GetDrivePartitions (uint8 drive, Partition *partitionArray, size_t partitionArrayCapacity, size_t &partitionCount, bool activeOnly, Partition *findPartitionFollowingThis, bool silent) { Partition *followingPartition; Partition tmpPartition; @@ -419,7 +419,7 @@ BiosResult GetDrivePartitions (byte drive, Partition *partitionArray, size_t par MBR *extMbr = (MBR *) SectorBuffer; while (partitionArrayPos < partitionArrayCapacity && - (result = ReadSectors ((byte *) extMbr, drive, extStartLBA, 1, silent)) == BiosResultSuccess + (result = ReadSectors ((uint8 *) extMbr, drive, extStartLBA, 1, silent)) == BiosResultSuccess && extMbr->Signature == 0xaa55) { if (extMbr->Partitions[0].SectorCountLBA > 0) @@ -478,7 +478,7 @@ BiosResult GetDrivePartitions (byte drive, Partition *partitionArray, size_t par } -bool GetActivePartition (byte drive) +bool GetActivePartition (uint8 drive) { size_t partCount; diff --git a/src/Boot/Windows/BootDiskIo.h b/src/Boot/Windows/BootDiskIo.h index 621acd8f..7936430c 100644 --- a/src/Boot/Windows/BootDiskIo.h +++ b/src/Boot/Windows/BootDiskIo.h @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. @@ -28,17 +28,17 @@ enum struct PartitionEntryMBR { - byte BootIndicator; + uint8 BootIndicator; - byte StartHead; - byte StartCylSector; - byte StartCylinder; + uint8 StartHead; + uint8 StartCylSector; + uint8 StartCylinder; - byte Type; + uint8 Type; - byte EndHead; - byte EndSector; - byte EndCylinder; + uint8 EndHead; + uint8 EndSector; + uint8 EndCylinder; uint32 StartLBA; uint32 SectorCountLBA; @@ -46,15 +46,15 @@ struct PartitionEntryMBR struct MBR { - byte Code[446]; + uint8 Code[446]; PartitionEntryMBR Partitions[4]; uint16 Signature; }; struct BiosLbaPacket { - byte Size; - byte Reserved; + uint8 Size; + uint8 Reserved; uint16 SectorCount; uint32 Buffer; uint64 Sector; @@ -66,27 +66,27 @@ struct BiosLbaPacket struct ChsAddress { uint16 Cylinder; - byte Head; - byte Sector; + uint8 Head; + uint8 Sector; }; struct Partition { - byte Number; - byte Drive; + uint8 Number; + uint8 Drive; bool Active; uint64 EndSector; bool Primary; uint64 SectorCount; uint64 StartSector; - byte Type; + uint8 Type; }; struct DriveGeometry { uint16 Cylinders; - byte Heads; - byte Sectors; + uint8 Heads; + uint8 Sectors; }; @@ -99,23 +99,23 @@ void ReleaseSectorBuffer (); #endif void ChsToLba (const DriveGeometry &geometry, const ChsAddress &chs, uint64 &lba); -bool GetActivePartition (byte drive); -BiosResult GetDriveGeometry (byte drive, DriveGeometry &geometry, bool silent = false); -BiosResult GetDrivePartitions (byte drive, Partition *partitionArray, size_t partitionArrayCapacity, size_t &partitionCount, bool activeOnly = false, Partition *findPartitionFollowingThis = nullptr, bool silent = false); -bool IsLbaSupported (byte drive); +bool GetActivePartition (uint8 drive); +BiosResult GetDriveGeometry (uint8 drive, DriveGeometry &geometry, bool silent = false); +BiosResult GetDrivePartitions (uint8 drive, Partition *partitionArray, size_t partitionArrayCapacity, size_t &partitionCount, bool activeOnly = false, Partition *findPartitionFollowingThis = nullptr, bool silent = false); +bool IsLbaSupported (uint8 drive); void LbaToChs (const DriveGeometry &geometry, const uint64 &lba, ChsAddress &chs); void Print (const ChsAddress &chs); -void PrintDiskError (BiosResult error, bool write, byte drive, const uint64 *sector, const ChsAddress *chs = nullptr); +void PrintDiskError (BiosResult error, bool write, uint8 drive, const uint64 *sector, const ChsAddress *chs = nullptr); void PrintSectorCountInMB (const uint64 §orCount); -BiosResult ReadWriteMBR (bool write, byte drive, bool silent = false); -BiosResult ReadSectors (uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 §or, uint16 sectorCount, bool silent = false); -BiosResult ReadSectors (byte *buffer, byte drive, const uint64 §or, uint16 sectorCount, bool silent = false); -BiosResult ReadSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent = false); -BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 §or, uint16 sectorCount, bool silent); -BiosResult ReadWriteSectors (bool write, byte *buffer, byte drive, const uint64 §or, uint16 sectorCount, bool silent); -BiosResult WriteSectors (byte *buffer, byte drive, const uint64 §or, uint16 sectorCount, bool silent = false); -BiosResult WriteSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent = false); - -extern byte SectorBuffer[TC_LB_SIZE]; +BiosResult ReadWriteMBR (bool write, uint8 drive, bool silent = false); +BiosResult ReadSectors (uint16 bufferSegment, uint16 bufferOffset, uint8 drive, const uint64 §or, uint16 sectorCount, bool silent = false); +BiosResult ReadSectors (uint8 *buffer, uint8 drive, const uint64 §or, uint16 sectorCount, bool silent = false); +BiosResult ReadSectors (uint8 *buffer, uint8 drive, const ChsAddress &chs, uint8 sectorCount, bool silent = false); +BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, uint8 drive, const uint64 §or, uint16 sectorCount, bool silent); +BiosResult ReadWriteSectors (bool write, uint8 *buffer, uint8 drive, const uint64 §or, uint16 sectorCount, bool silent); +BiosResult WriteSectors (uint8 *buffer, uint8 drive, const uint64 §or, uint16 sectorCount, bool silent = false); +BiosResult WriteSectors (uint8 *buffer, uint8 drive, const ChsAddress &chs, uint8 sectorCount, bool silent = false); + +extern uint8 SectorBuffer[TC_LB_SIZE]; #endif // TC_HEADER_Boot_BootDiskIo diff --git a/src/Boot/Windows/BootEncryptedIo.cpp b/src/Boot/Windows/BootEncryptedIo.cpp index 8ca55635..731fae44 100644 --- a/src/Boot/Windows/BootEncryptedIo.cpp +++ b/src/Boot/Windows/BootEncryptedIo.cpp @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. @@ -19,7 +19,7 @@ #include "BootEncryptedIo.h" -BiosResult ReadEncryptedSectors (uint16 destSegment, uint16 destOffset, byte drive, uint64 sector, uint16 sectorCount) +BiosResult ReadEncryptedSectors (uint16 destSegment, uint16 destOffset, uint8 drive, uint64 sector, uint16 sectorCount) { BiosResult result; bool decrypt = true; @@ -76,7 +76,7 @@ BiosResult ReadEncryptedSectors (uint16 destSegment, uint16 destOffset, byte dri } -BiosResult WriteEncryptedSectors (uint16 sourceSegment, uint16 sourceOffset, byte drive, uint64 sector, uint16 sectorCount) +BiosResult WriteEncryptedSectors (uint16 sourceSegment, uint16 sourceOffset, uint8 drive, uint64 sector, uint16 sectorCount) { BiosResult result = BiosResultSuccess; AcquireSectorBuffer(); diff --git a/src/Boot/Windows/BootEncryptedIo.h b/src/Boot/Windows/BootEncryptedIo.h index d1c9e5f3..1ada93ec 100644 --- a/src/Boot/Windows/BootEncryptedIo.h +++ b/src/Boot/Windows/BootEncryptedIo.h @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. @@ -15,8 +15,8 @@ #include "Platform.h" -BiosResult ReadEncryptedSectors (uint16 destSegment, uint16 destOffset, byte drive, uint64 sector, uint16 sectorCount); -BiosResult WriteEncryptedSectors (uint16 sourceSegment, uint16 sourceOffset, byte drive, uint64 sector, uint16 sectorCount); +BiosResult ReadEncryptedSectors (uint16 destSegment, uint16 destOffset, uint8 drive, uint64 sector, uint16 sectorCount); +BiosResult WriteEncryptedSectors (uint16 sourceSegment, uint16 sourceOffset, uint8 drive, uint64 sector, uint16 sectorCount); static bool ReadWritePartiallyCoversEncryptedArea (const uint64 §or, uint16 sectorCount); #endif // TC_HEADER_Boot_BootEncryptionIo diff --git a/src/Boot/Windows/BootMain.cpp b/src/Boot/Windows/BootMain.cpp index 8bfbe4b3..9f4b8613 100644 --- a/src/Boot/Windows/BootMain.cpp +++ b/src/Boot/Windows/BootMain.cpp @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. @@ -84,7 +84,7 @@ static void PrintMainMenu () } -static bool IsMenuKey (byte scanCode) +static bool IsMenuKey (uint8 scanCode) { #ifdef TC_WINDOWS_BOOT_RESCUE_DISK_MODE return scanCode == TC_MENU_KEY_REPAIR; @@ -149,12 +149,12 @@ static int AskSelection (const char *options[], size_t optionCount) } -static byte AskPassword (Password &password, int& pim) +static uint8 AskPassword (Password &password, int& pim) { size_t pos = 0; - byte scanCode; - byte asciiCode; - byte hidePassword = 1; + uint8 scanCode; + uint8 asciiCode; + uint8 hidePassword = 1; pim = 0; @@ -312,7 +312,7 @@ static byte AskPassword (Password &password, int& pim) } -static void ExecuteBootSector (byte drive, byte *sectorBuffer) +static void ExecuteBootSector (uint8 drive, uint8 *sectorBuffer) { Print ("Booting...\r\n"); CopyMemory (sectorBuffer, 0x0000, 0x7c00, TC_LB_SIZE); @@ -338,7 +338,7 @@ static void ExecuteBootSector (byte drive, byte *sectorBuffer) } -static bool OpenVolume (byte drive, Password &password, int pim, CRYPTO_INFO **cryptoInfo, uint32 *headerSaltCrc32, bool skipNormal, bool skipHidden) +static bool OpenVolume (uint8 drive, Password &password, int pim, CRYPTO_INFO **cryptoInfo, uint32 *headerSaltCrc32, bool skipNormal, bool skipHidden) { int volumeType; bool hiddenVolume; @@ -369,7 +369,7 @@ static bool OpenVolume (byte drive, Password &password, int pim, CRYPTO_INFO **c if (ReadSectors (SectorBuffer, drive, headerSec, 1) != BiosResultSuccess) continue; - if (ReadVolumeHeader (!hiddenVolume, (char *) SectorBuffer, &password, pim, cryptoInfo, nullptr) == ERR_SUCCESS) + if (ReadVolumeHeader (!hiddenVolume, SectorBuffer, &password, pim, cryptoInfo, nullptr) == ERR_SUCCESS) { // Prevent opening a non-system hidden volume if (hiddenVolume && !((*cryptoInfo)->HeaderFlags & TC_HEADER_FLAG_ENCRYPTED_SYSTEM)) @@ -420,7 +420,7 @@ static bool CheckMemoryRequirements () } -static bool MountVolume (byte drive, byte &exitKey, bool skipNormal, bool skipHidden) +static bool MountVolume (uint8 drive, uint8 &exitKey, bool skipNormal, bool skipHidden) { BootArguments *bootArguments = (BootArguments *) TC_BOOT_LOADER_ARGS_OFFSET; int incorrectPasswordCount = 0, pim = 0; @@ -499,7 +499,7 @@ static bool MountVolume (byte drive, byte &exitKey, bool skipNormal, bool skipHi } -static bool GetSystemPartitions (byte drive) +static bool GetSystemPartitions (uint8 drive) { size_t partCount; @@ -524,10 +524,10 @@ static bool GetSystemPartitions (byte drive) } -static byte BootEncryptedDrive () +static uint8 BootEncryptedDrive () { BootArguments *bootArguments = (BootArguments *) TC_BOOT_LOADER_ARGS_OFFSET; - byte exitKey; + uint8 exitKey; BootCryptoInfo = NULL; if (!GetSystemPartitions (BootDrive)) @@ -556,7 +556,7 @@ static byte BootEncryptedDrive () if (!InstallInterruptFilters()) goto err; - bootArguments->BootArgumentsCrc32 = GetCrc32 ((byte *) bootArguments, (byte *) &bootArguments->BootArgumentsCrc32 - (byte *) bootArguments); + bootArguments->BootArgumentsCrc32 = GetCrc32 ((uint8 *) bootArguments, (uint8 *) &bootArguments->BootArgumentsCrc32 - (uint8 *) bootArguments); while (true) { @@ -587,7 +587,7 @@ err: EncryptedVirtualPartition.Drive = TC_INVALID_BIOS_DRIVE; EraseMemory ((void *) TC_BOOT_LOADER_ARGS_OFFSET, sizeof (BootArguments)); - byte scanCode; + uint8 scanCode; GetKeyboardChar (&scanCode); return scanCode; } @@ -601,7 +601,7 @@ static void BootMenu () size_t partitionCount; size_t bootablePartitionCount = 0; - for (byte drive = TC_FIRST_BIOS_DRIVE; drive <= TC_LAST_BIOS_DRIVE; ++drive) + for (uint8 drive = TC_FIRST_BIOS_DRIVE; drive <= TC_LAST_BIOS_DRIVE; ++drive) { if (GetDrivePartitions (drive, partitions, array_capacity (partitions), partitionCount, false, nullptr, true) == BiosResultSuccess) { @@ -689,7 +689,7 @@ static void BootMenu () #ifndef TC_WINDOWS_BOOT_RESCUE_DISK_MODE -static bool CopySystemPartitionToHiddenVolume (byte drive, byte &exitKey) +static bool CopySystemPartitionToHiddenVolume (uint8 drive, uint8 &exitKey) { bool status = false; @@ -812,9 +812,9 @@ ret: #else // TC_WINDOWS_BOOT_RESCUE_DISK_MODE -static void DecryptDrive (byte drive) +static void DecryptDrive (uint8 drive) { - byte exitKey; + uint8 exitKey; if (!MountVolume (drive, exitKey, false, true)) return; @@ -917,7 +917,7 @@ askBadSectorSkip: CRYPTO_INFO *headerCryptoInfo = crypto_open(); while (ReadSectors (SectorBuffer, drive, headerSector, 1) != BiosResultSuccess); - if (ReadVolumeHeader (TRUE, (char *) SectorBuffer, &bootArguments->BootPassword, (int) (bootArguments->Flags >> 16), NULL, headerCryptoInfo) == 0) + if (ReadVolumeHeader (TRUE, SectorBuffer, &bootArguments->BootPassword, (int) (bootArguments->Flags >> 16), NULL, headerCryptoInfo) == 0) { DecryptBuffer (SectorBuffer + HEADER_ENCRYPTED_DATA_OFFSET, HEADER_ENCRYPTED_DATA_SIZE, headerCryptoInfo); @@ -925,7 +925,7 @@ askBadSectorSkip: for (int i = 7; i >= 0; --i) { - SectorBuffer[TC_HEADER_OFFSET_ENCRYPTED_AREA_LENGTH + i] = (byte) encryptedAreaLength.LowPart; + SectorBuffer[TC_HEADER_OFFSET_ENCRYPTED_AREA_LENGTH + i] = (uint8) encryptedAreaLength.LowPart; encryptedAreaLength = encryptedAreaLength >> 8; } @@ -933,7 +933,7 @@ askBadSectorSkip: for (i = 3; i >= 0; --i) { - SectorBuffer[TC_HEADER_OFFSET_HEADER_CRC + i] = (byte) headerCrc32; + SectorBuffer[TC_HEADER_OFFSET_HEADER_CRC + i] = (uint8) headerCrc32; headerCrc32 >>= 8; } @@ -1020,7 +1020,7 @@ static void RepairMenu () sector.HighPart = 0; ChsAddress chs; - byte mbrPartTable[TC_LB_SIZE - TC_MAX_MBR_BOOT_CODE_SIZE]; + uint8 mbrPartTable[TC_LB_SIZE - TC_MAX_MBR_BOOT_CODE_SIZE]; AcquireSectorBuffer(); for (int i = (selection == RestoreVolumeHeader ? TC_BOOT_VOLUME_HEADER_SECTOR : TC_MBR_SECTOR); @@ -1073,7 +1073,7 @@ static void RepairMenu () Password password; int pim; - byte exitKey = AskPassword (password, pim); + uint8 exitKey = AskPassword (password, pim); if (exitKey != TC_BIOS_KEY_ENTER) goto abort; @@ -1094,7 +1094,7 @@ static void RepairMenu () AcquireSectorBuffer(); CopyMemory (TC_BOOT_LOADER_BUFFER_SEGMENT, 0, SectorBuffer, TC_LB_SIZE); - if (ReadVolumeHeader (TRUE, (char *) SectorBuffer, &password, pim, &cryptoInfo, nullptr) == 0) + if (ReadVolumeHeader (TRUE, SectorBuffer, &password, pim, &cryptoInfo, nullptr) == 0) { if (validHeaderPresent) { @@ -1221,13 +1221,13 @@ void main () while (true) { - byte exitKey; + uint8 exitKey; InitScreen(); #ifndef TC_WINDOWS_BOOT_RESCUE_DISK_MODE // Hidden system setup - byte hiddenSystemCreationPhase = BootSectorFlags & TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE; + uint8 hiddenSystemCreationPhase = BootSectorFlags & TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE; if (hiddenSystemCreationPhase != TC_HIDDEN_OS_CREATION_PHASE_NONE) { diff --git a/src/Boot/Windows/BootMain.h b/src/Boot/Windows/BootMain.h index 52d5c8cc..77a662b4 100644 --- a/src/Boot/Windows/BootMain.h +++ b/src/Boot/Windows/BootMain.h @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. @@ -16,16 +16,16 @@ #include "TCdefs.h" #include "Platform.h" -static byte AskPassword (Password &password, int& pim); +static uint8 AskPassword (Password &password, int& pim); static int AskSelection (const char *options[], size_t optionCount); static bool AskYesNo (const char *message); -static byte BootEncryptedDrive (); +static uint8 BootEncryptedDrive (); static void BootMenu (); -static void ExecuteBootSector (byte drive, byte *sectorBuffer); +static void ExecuteBootSector (uint8 drive, uint8 *sectorBuffer); static void InitScreen (); -static bool IsMenuKey (byte scanCode); -static bool MountVolume (byte drive, byte &exitKey); -static bool OpenVolume (byte drive, Password &password, CRYPTO_INFO **cryptoInfo, uint32 *headerSaltCrc32 = nullptr, bool skipNormal = false, bool skipHidden = false); +static bool IsMenuKey (uint8 scanCode); +static bool MountVolume (uint8 drive, uint8 &exitKey); +static bool OpenVolume (uint8 drive, Password &password, CRYPTO_INFO **cryptoInfo, uint32 *headerSaltCrc32 = nullptr, bool skipNormal = false, bool skipHidden = false); static void PrintMainMenu (); static void RepairMenu (); diff --git a/src/Boot/Windows/BootMemory.cpp b/src/Boot/Windows/BootMemory.cpp index 9eed757f..2fedb308 100644 --- a/src/Boot/Windows/BootMemory.cpp +++ b/src/Boot/Windows/BootMemory.cpp @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. diff --git a/src/Boot/Windows/BootMemory.h b/src/Boot/Windows/BootMemory.h index 183c4469..96f56374 100644 --- a/src/Boot/Windows/BootMemory.h +++ b/src/Boot/Windows/BootMemory.h @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. diff --git a/src/Boot/Windows/BootStrings.h b/src/Boot/Windows/BootStrings.h index b7cfe703..4d0dd3b4 100644 --- a/src/Boot/Windows/BootStrings.h +++ b/src/Boot/Windows/BootStrings.h @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. diff --git a/src/Boot/Windows/IntFilter.cpp b/src/Boot/Windows/IntFilter.cpp index 9e5c8536..5ec07622 100644 --- a/src/Boot/Windows/IntFilter.cpp +++ b/src/Boot/Windows/IntFilter.cpp @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. @@ -38,7 +38,7 @@ bool Int13Filter () static int ReEntryCount = -1; ++ReEntryCount; - byte function = (byte) (regs.AX >> 8); + uint8 function = (uint8) (regs.AX >> 8); #ifdef TC_TRACE_INT13 DisableScreenOutput(); @@ -63,14 +63,14 @@ bool Int13Filter () case 0x2: // Read sectors case 0x3: // Write sectors { - byte drive = (byte) regs.DX; + uint8 drive = (uint8) regs.DX; ChsAddress chs; chs.Cylinder = ((regs.CX << 2) & 0x300) | (regs.CX >> 8); chs.Head = regs.DX >> 8; chs.Sector = regs.CX & 0x3f; - byte sectorCount = (byte) regs.AX; + uint8 sectorCount = (uint8) regs.AX; #ifdef TC_TRACE_INT13 PrintVal (": Drive", drive - TC_FIRST_BIOS_DRIVE, false); @@ -125,10 +125,10 @@ bool Int13Filter () case 0x42: // Read sectors LBA case 0x43: // Write sectors LBA { - byte drive = (byte) regs.DX; + uint8 drive = (uint8) regs.DX; BiosLbaPacket lba; - CopyMemory (regs.DS, regs.SI, (byte *) &lba, sizeof (lba)); + CopyMemory (regs.DS, regs.SI, (uint8 *) &lba, sizeof (lba)); #ifdef TC_TRACE_INT13 PrintVal (": Drive", drive - TC_FIRST_BIOS_DRIVE, false); @@ -337,7 +337,7 @@ bool Int15Filter () } else { - CopyMemory ((byte *) &BiosMemoryMap[IntRegisters.EBX], IntRegisters.ES, IntRegisters.DI, sizeof (BiosMemoryMap[0])); + CopyMemory ((uint8 *) &BiosMemoryMap[IntRegisters.EBX], IntRegisters.ES, IntRegisters.DI, sizeof (BiosMemoryMap[0])); IntRegisters.Flags &= ~TC_X86_CARRY_FLAG; IntRegisters.EAX = 0x534D4150UL; @@ -380,7 +380,7 @@ bool Int15Filter () #ifdef TC_TRACE_INT15 BiosMemoryMapEntry entry; - CopyMemory (IntRegisters.ES, IntRegisters.DI, (byte *) &entry, sizeof (entry)); + CopyMemory (IntRegisters.ES, IntRegisters.DI, (uint8 *) &entry, sizeof (entry)); PrintHex (entry.Type); PrintChar (' '); PrintHex (entry.BaseAddress); PrintChar (' '); PrintHex (entry.Length); PrintChar (' '); diff --git a/src/Boot/Windows/IntFilter.h b/src/Boot/Windows/IntFilter.h index 65b0c7ce..e9625b64 100644 --- a/src/Boot/Windows/IntFilter.h +++ b/src/Boot/Windows/IntFilter.h @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. diff --git a/src/Boot/Windows/Makefile b/src/Boot/Windows/Makefile index 1966a3cb..d08e1f50 100644 --- a/src/Boot/Windows/Makefile +++ b/src/Boot/Windows/Makefile @@ -46,7 +46,7 @@ CFLAGS = $(CFLAGS) /D TC_WINDOWS_BOOT_SINGLE_CIPHER_MODE /D TC_WINDOWS_BOOT_$(SI OBJDIR = $(OBJDIR)_$(SINGLE_PRF) CFLAGS = $(CFLAGS) /D TC_WINDOWS_BOOT_$(SINGLE_PRF) !else -CFLAGS = $(CFLAGS) /D TC_WINDOWS_BOOT_RIPEMD160 +CFLAGS = $(CFLAGS) /D TC_WINDOWS_BOOT_BLAKE2S !endif OUTDIR = $(OBJDIR) @@ -85,7 +85,7 @@ OBJS = $(OBJS) $(OUTDIR)\Xts.obj !if "$(SINGLE_PRF)" == "SHA2" OBJS = $(OBJS) $(OUTDIR)\Sha2Small.obj !else -OBJS = $(OBJS) $(OUTDIR)\Rmd160.obj +OBJS = $(OBJS) $(OUTDIR)\blake2s-ref.obj !endif !if !DEFINED (SINGLE_CIPHER) @@ -196,7 +196,7 @@ $(LIBS) $(LD) $(LFLAGS) @$(PROJ).crf del $(PROJ).crf $(PROJ).crf2 -# Compress the Rescue Disk botloader for Cascades and Serpent since it is too big (size > 31232 bytes) +# Compress the Rescue Disk bootloader for Cascades and Serpent since it is too big (size > 31232 bytes) #!if DEFINED(RESCUE_DISK) && (!DEFINED (SINGLE_CIPHER) || ("$(SINGLE_CIPHER)" == "SERPENT") || ("$(SINGLE_CIPHER)" == "CAMELLIA")) upx $(PROJ).$(TARGETEXT) #!endif diff --git a/src/Boot/Windows/Platform.cpp b/src/Boot/Windows/Platform.cpp index 046fa4a4..f592e26d 100644 --- a/src/Boot/Windows/Platform.cpp +++ b/src/Boot/Windows/Platform.cpp @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. @@ -84,7 +84,7 @@ uint64 operator>> (const uint64 &a, int shiftCount) { r.LowPart >>= 1; - if ((byte) r.HighPart & 1) + if ((uint8) r.HighPart & 1) r.LowPart |= 0x80000000UL; r.HighPart >>= 1; diff --git a/src/Boot/Windows/Platform.h b/src/Boot/Windows/Platform.h index 1c41ec03..cec9d0c7 100644 --- a/src/Boot/Windows/Platform.h +++ b/src/Boot/Windows/Platform.h @@ -4,7 +4,7 @@ by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. diff --git a/src/Boot/Windows/Release/BootLoader.com.gz b/src/Boot/Windows/Release/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..23c921f8 --- /dev/null +++ b/src/Boot/Windows/Release/BootLoader.com.gz diff --git a/src/Boot/Windows/Release/BootSector.bin b/src/Boot/Windows/Release/BootSector.bin Binary files differnew file mode 100644 index 00000000..556a2036 --- /dev/null +++ b/src/Boot/Windows/Release/BootSector.bin diff --git a/src/Boot/Windows/Release/Decompressor.com b/src/Boot/Windows/Release/Decompressor.com Binary files differnew file mode 100644 index 00000000..14b4e5d4 --- /dev/null +++ b/src/Boot/Windows/Release/Decompressor.com diff --git a/src/Boot/Windows/Release_AES/BootLoader.com.gz b/src/Boot/Windows/Release_AES/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..ab262fed --- /dev/null +++ b/src/Boot/Windows/Release_AES/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_AES/BootSector.bin b/src/Boot/Windows/Release_AES/BootSector.bin Binary files differnew file mode 100644 index 00000000..7d041a36 --- /dev/null +++ b/src/Boot/Windows/Release_AES/BootSector.bin diff --git a/src/Boot/Windows/Release_AES_SHA2/BootLoader.com.gz b/src/Boot/Windows/Release_AES_SHA2/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..25a89b3e --- /dev/null +++ b/src/Boot/Windows/Release_AES_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_AES_SHA2/BootSector.bin b/src/Boot/Windows/Release_AES_SHA2/BootSector.bin Binary files differnew file mode 100644 index 00000000..7d041a36 --- /dev/null +++ b/src/Boot/Windows/Release_AES_SHA2/BootSector.bin diff --git a/src/Boot/Windows/Release_Camellia/BootLoader.com.gz b/src/Boot/Windows/Release_Camellia/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..5cf49d63 --- /dev/null +++ b/src/Boot/Windows/Release_Camellia/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_Camellia/BootSector.bin b/src/Boot/Windows/Release_Camellia/BootSector.bin Binary files differnew file mode 100644 index 00000000..9ff1b39e --- /dev/null +++ b/src/Boot/Windows/Release_Camellia/BootSector.bin diff --git a/src/Boot/Windows/Release_Camellia_SHA2/BootLoader.com.gz b/src/Boot/Windows/Release_Camellia_SHA2/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..2a231431 --- /dev/null +++ b/src/Boot/Windows/Release_Camellia_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_Camellia_SHA2/BootSector.bin b/src/Boot/Windows/Release_Camellia_SHA2/BootSector.bin Binary files differnew file mode 100644 index 00000000..9ff1b39e --- /dev/null +++ b/src/Boot/Windows/Release_Camellia_SHA2/BootSector.bin diff --git a/src/Boot/Windows/Release_SHA2/BootLoader.com.gz b/src/Boot/Windows/Release_SHA2/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..33413df5 --- /dev/null +++ b/src/Boot/Windows/Release_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_SHA2/BootSector.bin b/src/Boot/Windows/Release_SHA2/BootSector.bin Binary files differnew file mode 100644 index 00000000..556a2036 --- /dev/null +++ b/src/Boot/Windows/Release_SHA2/BootSector.bin diff --git a/src/Boot/Windows/Release_Serpent/BootLoader.com.gz b/src/Boot/Windows/Release_Serpent/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..7f330347 --- /dev/null +++ b/src/Boot/Windows/Release_Serpent/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_Serpent/BootSector.bin b/src/Boot/Windows/Release_Serpent/BootSector.bin Binary files differnew file mode 100644 index 00000000..8020da87 --- /dev/null +++ b/src/Boot/Windows/Release_Serpent/BootSector.bin diff --git a/src/Boot/Windows/Release_Serpent_SHA2/BootLoader.com.gz b/src/Boot/Windows/Release_Serpent_SHA2/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..50592bba --- /dev/null +++ b/src/Boot/Windows/Release_Serpent_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_Serpent_SHA2/BootSector.bin b/src/Boot/Windows/Release_Serpent_SHA2/BootSector.bin Binary files differnew file mode 100644 index 00000000..8020da87 --- /dev/null +++ b/src/Boot/Windows/Release_Serpent_SHA2/BootSector.bin diff --git a/src/Boot/Windows/Release_Twofish/BootLoader.com.gz b/src/Boot/Windows/Release_Twofish/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..64d147af --- /dev/null +++ b/src/Boot/Windows/Release_Twofish/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_Twofish/BootSector.bin b/src/Boot/Windows/Release_Twofish/BootSector.bin Binary files differnew file mode 100644 index 00000000..eff8e12a --- /dev/null +++ b/src/Boot/Windows/Release_Twofish/BootSector.bin diff --git a/src/Boot/Windows/Release_Twofish_SHA2/BootLoader.com.gz b/src/Boot/Windows/Release_Twofish_SHA2/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..8b4664fe --- /dev/null +++ b/src/Boot/Windows/Release_Twofish_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_Twofish_SHA2/BootSector.bin b/src/Boot/Windows/Release_Twofish_SHA2/BootSector.bin Binary files differnew file mode 100644 index 00000000..eff8e12a --- /dev/null +++ b/src/Boot/Windows/Release_Twofish_SHA2/BootSector.bin diff --git a/src/Boot/Windows/Rescue/BootLoader.com.gz b/src/Boot/Windows/Rescue/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..a12b1cab --- /dev/null +++ b/src/Boot/Windows/Rescue/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue/BootSector.bin b/src/Boot/Windows/Rescue/BootSector.bin Binary files differnew file mode 100644 index 00000000..556a2036 --- /dev/null +++ b/src/Boot/Windows/Rescue/BootSector.bin diff --git a/src/Boot/Windows/Rescue_AES/BootLoader.com.gz b/src/Boot/Windows/Rescue_AES/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..edbe080b --- /dev/null +++ b/src/Boot/Windows/Rescue_AES/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_AES/BootSector.bin b/src/Boot/Windows/Rescue_AES/BootSector.bin Binary files differnew file mode 100644 index 00000000..9ff1b39e --- /dev/null +++ b/src/Boot/Windows/Rescue_AES/BootSector.bin diff --git a/src/Boot/Windows/Rescue_AES_SHA2/BootLoader.com.gz b/src/Boot/Windows/Rescue_AES_SHA2/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..c10db1c7 --- /dev/null +++ b/src/Boot/Windows/Rescue_AES_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_AES_SHA2/BootSector.bin b/src/Boot/Windows/Rescue_AES_SHA2/BootSector.bin Binary files differnew file mode 100644 index 00000000..9ff1b39e --- /dev/null +++ b/src/Boot/Windows/Rescue_AES_SHA2/BootSector.bin diff --git a/src/Boot/Windows/Rescue_Camellia/BootLoader.com.gz b/src/Boot/Windows/Rescue_Camellia/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..c260583a --- /dev/null +++ b/src/Boot/Windows/Rescue_Camellia/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_Camellia/BootSector.bin b/src/Boot/Windows/Rescue_Camellia/BootSector.bin Binary files differnew file mode 100644 index 00000000..9ff1b39e --- /dev/null +++ b/src/Boot/Windows/Rescue_Camellia/BootSector.bin diff --git a/src/Boot/Windows/Rescue_Camellia_SHA2/BootLoader.com.gz b/src/Boot/Windows/Rescue_Camellia_SHA2/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..04c98ddb --- /dev/null +++ b/src/Boot/Windows/Rescue_Camellia_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_Camellia_SHA2/BootSector.bin b/src/Boot/Windows/Rescue_Camellia_SHA2/BootSector.bin Binary files differnew file mode 100644 index 00000000..9ff1b39e --- /dev/null +++ b/src/Boot/Windows/Rescue_Camellia_SHA2/BootSector.bin diff --git a/src/Boot/Windows/Rescue_SHA2/BootLoader.com.gz b/src/Boot/Windows/Rescue_SHA2/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..fdddea41 --- /dev/null +++ b/src/Boot/Windows/Rescue_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_SHA2/BootSector.bin b/src/Boot/Windows/Rescue_SHA2/BootSector.bin Binary files differnew file mode 100644 index 00000000..556a2036 --- /dev/null +++ b/src/Boot/Windows/Rescue_SHA2/BootSector.bin diff --git a/src/Boot/Windows/Rescue_Serpent/BootLoader.com.gz b/src/Boot/Windows/Rescue_Serpent/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..27b9418a --- /dev/null +++ b/src/Boot/Windows/Rescue_Serpent/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_Serpent/BootSector.bin b/src/Boot/Windows/Rescue_Serpent/BootSector.bin Binary files differnew file mode 100644 index 00000000..8020da87 --- /dev/null +++ b/src/Boot/Windows/Rescue_Serpent/BootSector.bin diff --git a/src/Boot/Windows/Rescue_Serpent_SHA2/BootLoader.com.gz b/src/Boot/Windows/Rescue_Serpent_SHA2/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..5fbde6fc --- /dev/null +++ b/src/Boot/Windows/Rescue_Serpent_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_Serpent_SHA2/BootSector.bin b/src/Boot/Windows/Rescue_Serpent_SHA2/BootSector.bin Binary files differnew file mode 100644 index 00000000..8020da87 --- /dev/null +++ b/src/Boot/Windows/Rescue_Serpent_SHA2/BootSector.bin diff --git a/src/Boot/Windows/Rescue_Twofish/BootLoader.com.gz b/src/Boot/Windows/Rescue_Twofish/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..06df2b66 --- /dev/null +++ b/src/Boot/Windows/Rescue_Twofish/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_Twofish/BootSector.bin b/src/Boot/Windows/Rescue_Twofish/BootSector.bin Binary files differnew file mode 100644 index 00000000..eff8e12a --- /dev/null +++ b/src/Boot/Windows/Rescue_Twofish/BootSector.bin diff --git a/src/Boot/Windows/Rescue_Twofish_SHA2/BootLoader.com.gz b/src/Boot/Windows/Rescue_Twofish_SHA2/BootLoader.com.gz Binary files differnew file mode 100644 index 00000000..375de162 --- /dev/null +++ b/src/Boot/Windows/Rescue_Twofish_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_Twofish_SHA2/BootSector.bin b/src/Boot/Windows/Rescue_Twofish_SHA2/BootSector.bin Binary files differnew file mode 100644 index 00000000..eff8e12a --- /dev/null +++ b/src/Boot/Windows/Rescue_Twofish_SHA2/BootSector.bin |