Compare commits

...
Author SHA1 Message Date
Mounir IDRASSI 7ad75a81ca Windows: Fix compilation error caused by latest MacOSX change. 2016-08-17 22:38:14 +02:00
Mounir IDRASSI f84dc7b78f Windows Boot: update EFI Boot Loader file after correction made to wrong password error message. 2016-08-17 22:18:03 +02:00
Mounir IDRASSI 882525b879 Add reference of new algorithms introduced in version 1.18 (Camellia, Streebog, Kuznyechik and GOST-89) 2016-08-17 22:18:02 +02:00
Mounir IDRASSI 24e233ea2e Update License.txt with additional copyrights. 2016-08-17 22:18:01 +02:00
Mounir IDRASSI c6d5b30704 MacOSX: fix compiler warning about ALIGN macro being already defined 2016-08-17 22:18:01 +02:00
Mounir IDRASSI 0dc3cb7cd1 Add reference to VeraCrypt-DCS EFI Boot loader in Readme. Update copyrights. 2016-08-17 17:06:21 +02:00
Mounir IDRASSI d4192bf863 Windows: Increase text size limit in RichEdit control to avoid truncating Legal Notices text when displayed. 2016-08-17 17:06:20 +02:00
Mounir IDRASSI 8c963356cb Windows Bootloader: Update EFI bootloader files built using the latest source modifications 2016-08-17 17:06:19 +02:00
Mounir IDRASSI 20c723e242 Windows: correct handle failure of TranslateVolumeID function (should not happen anyway). 2016-08-17 17:06:18 +02:00
Mounir IDRASSI 3ddb499280 Update 1.18 release date 2016-08-17 08:55:56 +02:00
Mounir IDRASSI b56e8c5c4b Linux/MacOSX: Add Streebog to the list of supported hash algorithms used for key derivation. 2016-08-17 08:36:33 +02:00
Mounir IDRASSI d8a7de8ffb Linux: Disable Kernel crypto if volume encrypted using Kuznyechik or Magma 2016-08-17 08:36:33 +02:00
Mounir IDRASSI 7695b8ada0 Linux: Add parameter to Makefile for enabling SSSE3 and SSE4.1 support in compiler 2016-08-17 08:36:32 +02:00
Mounir IDRASSI a72c7bcd6a Linux: fix compilation error on Streebog.c if SSE4.1 not enabled in compiler 2016-08-17 08:36:31 +02:00
Mounir IDRASSI 2780ac962e Linux: fix various compilation issues under Linux. 2016-08-17 00:08:18 +02:00
Mounir IDRASSI e47f94cb43 Windows: modification to make Coverity happy! 2016-08-16 19:58:48 +02:00
Mounir IDRASSI 625259d226 Fix compilation error in Streebog code caused by latest changes. 2016-08-16 12:42:44 +02:00
Mounir IDRASSI 2fef14ff76 Increment version to 1.18. Update user guide PDF file. 2016-08-16 10:19:39 +02:00
Mounir IDRASSI ce76957a10 Windows: Fix various issues detected by static analysis. 2016-08-16 10:04:07 +02:00
Mounir IDRASSI 1bf219b0dc Windows: fix SetupAPI issue on some machines where it fails to handle properly AddReg/DelReg operations during System encryption/decryption wizard. 2016-08-16 00:56:15 +02:00
Mounir IDRASSI a7056a6ac3 Windows: in system encryption setting dialog, put the checkbox for hiding at the bottom to keep the Note text coherent. 2016-08-15 19:06:26 +02:00
Mounir IDRASSI bba8a5be32 Language Files: update polish translation 2016-08-15 18:53:52 +02:00
Mounir IDRASSI 1e429d1fbf Language XML files: add new fields. 2016-08-15 18:53:50 +02:00
Mounir IDRASSI 5d5a645083 Windows: fix error caused by requesting large number of random bytes when writing randomly generated data to unused/reserved header areas. 2016-08-15 14:19:11 +02:00
Mounir IDRASSI 1506916487 Linux: avoid overflow when specifying TiB size in command line 2016-08-15 13:18:06 +02:00
Mounir IDRASSIandGitHub 2db742f465 Merge pull request #75 from oceanBT/revert-66-patch-1
Linux: added TiB support to text mode.
2016-08-15 13:10:01 +02:00
Mounir IDRASSI 8bc8f7c66e Documentation update. 2016-08-15 01:09:22 +02:00
Mounir IDRASSI 99d5145c24 Language XML files: update XML files with new fields and some changes. 2016-08-15 01:09:20 +02:00
Mounir IDRASSI 24560eae1d Windows: fill unused/reserved header areas with the result of encryption of random data instead of the encryption of zeros for better entropy of resulting random data. 2016-08-15 01:09:20 +02:00
Mounir IDRASSI 67031da928 Windows: Add DCS EFI Bootloader files that are signed. Add certificates and powershell script to update Secure Boot configuration. 2016-08-15 01:09:19 +02:00
Mounir IDRASSI 87ee61bcb1 Windows: in EFI encryption wizard, always select "Single Boot" by default since it is the only choice. 2016-08-15 01:09:19 +02:00
kavsrfandMounir IDRASSI 83885c1ebb Windows: Synchronize file with changes done in EFI Bootloader DCS. 2016-08-15 01:09:18 +02:00
Mounir IDRASSI 2d72e42c6c Windows: Implement Rescue Disk support for EFI system encryption 2016-08-15 01:09:17 +02:00
Mounir IDRASSI 71a38563ae Windows: various fixes for XZip library bugs 2016-08-15 01:09:17 +02:00
Mounir IDRASSI 4cf9db9f95 Windows: Add XZip library files (http://www.codeproject.com/Articles/4135/XZip-and-XUnzip-Add-zip-and-or-unzip-to-your-app-w) 2016-08-15 01:09:16 +02:00
Mounir IDRASSI c4d4ade9d0 Windows: Show only supported encryption algorithm in the system encryption wizard for MBR 2016-08-15 01:09:16 +02:00
Mounir IDRASSI d127393897 Windows: Add new crypto files to legacy VC++ 2008 project. 2016-08-15 01:09:15 +02:00
Mounir IDRASSI b51d8f5386 Windows: fix Windows 10 hibernate issue when EFI system encryption is active. 2016-08-15 01:09:15 +02:00
Mounir IDRASSI b146e235f8 Windows: align buffers used for keys to avoid issues when SSE used. 2016-08-15 01:09:14 +02:00
Mounir IDRASSI 07ee8c1069 Windows: Implement support for EFI system encryption in Windows GUI. 2016-08-15 01:09:13 +02:00
AlexandMounir IDRASSI 246233c402 Windows EFI Bootloader: modifications to prepare EFI system encryption support (common files with DcsBoot) 2016-08-15 01:09:12 +02:00
Mounir IDRASSI 58cff70724 Linux/MacOSX: Add help text for GOST89 and Kuznyechik 2016-08-15 01:09:12 +02:00
Mounir IDRASSI e90e24b30b Windows: Add support for Streebog (hash) and kuznyechik (encryption) 2016-08-15 01:09:11 +02:00
Mounir IDRASSI 0b2c8b09c6 Windows: Add Magma cipher (GOST-89) 2016-08-15 01:09:10 +02:00
Mounir IDRASSI 460f552a41 Windows Driver: Add extra traces and enable tracing in release build if DEBUG_TRACE defined. 2016-08-15 01:09:10 +02:00
Mounir IDRASSI 9bfe4780d4 Language XML files: add new fields related to UEFI and newly added ciphers. 2016-08-15 01:09:08 +02:00
Mounir IDRASSI f26ce59fb5 User Guide: further corrections and modifications to match online documentation. 2016-08-15 01:09:07 +02:00
Mounir IDRASSI f32f65d4f7 Linux/MacOSX: Similar fix to Windows one. Write fake hidden volume header that is created from same data format as legitimate one in order to metigate attack that are able to detect the presence of TrueCrypt/VeraCrypt hidden volumes (reported by Ivanov Alexey Mikhailovich from Moscow, Russia) 2016-08-15 01:09:06 +02:00
Mounir IDRASSI 5b381ce7d7 Windows: Fix vulnerability inherited from TrueCrypt that allows an attacker to detect with high probability if a hidden volume is present. Vulnerability reported by Ivanov Alexey Mikhailovich. 2016-08-15 01:09:05 +02:00
Mounir IDRASSI 3fb2eedab8 Linux: Enable gcc AES-NI built-in functions and adapt Hyper-V AES detection code to gcc. 2016-08-08 00:11:22 +02:00
Mounir IDRASSI fe31cf5b83 Crypto: Use Hyper-V AES-NI detection workaround when displaying AES hardware availability in GUI. 2016-07-29 22:40:44 +02:00
Mounir IDRASSI 2389561406 Windows: Use new Windows API to mitigate dll hijacking attacks. 2016-07-29 22:40:43 +02:00
Mounir IDRASSI a7f1ba05b4 Windows: Enhance protection against dll hijacking attacks following new report by Stefan Kanthak. 2016-07-26 00:53:18 +02:00
Mounir IDRASSI 3aaf5c7045 Windows: solve benchmark issue for Whirlpool which caused wrong numbers when a 1GB buffer is chosen. 2016-07-25 08:26:09 +02:00
Mounir IDRASSI 73703095b2 User Guide: Update User Guide odt file to match online documentation and FAQ. 2016-07-24 23:55:08 +02:00
Mounir IDRASSI 0fca588275 Crypto: Workaround for AES-NI issue under Hyper-V on Windows Server 2008 R2 which masks AES-NI from applications although it is available. 2016-07-24 23:48:07 +02:00
Mounir IDRASSI 2dbf366184 Language XML files: remove UTF-8 BOM from Dutch language file. 2016-06-27 00:21:53 +02:00
Mounir IDRASSI ed81267291 Language XML files: update to Dutch translation by Peter Tak. 2016-06-27 00:13:00 +02:00
oceanBTandGitHub 1a8ce8a611 added TiB size unit 2016-06-23 21:53:24 +02:00
Mounir IDRASSI c5b766969a Windows:solve compilation error under VC++ 2008 by using extern "C" only when needed. 2016-06-20 12:10:08 +02:00
Mounir IDRASSI 00eb49443a Crypto: Optimize 64-bit implementation of Whirlpool based on idea from compression function in Botan library. 2016-06-20 12:10:07 +02:00
Mounir IDRASSI 45617a3285 Linux/MacOSX: Solve compilation error linked to Camellia cipher addition. 2016-06-19 00:38:20 +02:00
Mounir IDRASSI 85cab3b85f Windows Driver: use more reliable way to correctly set path to VC++ 2010 in driver build batch file. 2016-06-18 19:17:19 +02:00
Mounir IDRASSI e4efd6820a Windows Driver: add declaration of missing intrinsic _mm_setr_epi32 (to be used by upcoming implementation) 2016-06-18 01:44:48 +02:00
Mounir IDRASSI 2faa1290c0 Windows Driver: save FPU state in 32-bit mode before run Whirlpool SSE implementation to avoid issues (https://msdn.microsoft.com/fr-fr/library/ff565388(v=vs.85).aspx) 2016-06-17 23:52:03 +02:00
Mounir IDRASSI bdc5782f16 Windows: Better heuristics for evaluating Pre-Boot PRF performance 2016-06-17 19:04:04 +02:00
Mounir IDRASSI 42373efcfd Windows: Use Visual C++ 2010 instead of Visual C++ 2008. 2016-06-17 15:50:47 +02:00
Mounir IDRASSI 6ae982cccf Update intrinsic support and cpu detection. 2016-06-17 15:50:46 +02:00
Mounir IDRASSI 842dce0e1b Language XML files: add new fields related to enhanced benchmark dialog 2016-06-17 15:50:44 +02:00
Mounir IDRASSI 27b53c6ff4 Windows: Add Hash and PRF benchmarks to the benchmark dialog. 2016-06-17 15:50:44 +02:00
Mounir IDRASSI aeb4e8a13a Windows: make Camellia help link open dedicated documentation page 2016-06-17 15:50:42 +02:00
Mounir IDRASSI c7756befee Language XML files: update German translation (Ettore Atalan) 2016-06-17 15:50:40 +02:00
Mounir IDRASSI 21d567f731 Crypto: make Serpent source code use the same rotl32/rotr32 primitives as the other files. 2016-06-17 15:50:40 +02:00
Mounir IDRASSI d4e95293d9 Windows: fix compiler warnings 2016-06-17 15:50:39 +02:00
Mounir IDRASSI 76d3bc631e Crypto: Add support for Japanese encryption standard Camellia, including for system encryption. 2016-06-02 00:12:00 +02:00
Mounir IDRASSI 99c4031d89 Windows: better implementation for support of smart card PIN in command line. Supported now also on Format. 2016-05-29 01:33:18 +02:00
Mounir IDRASSI a0d8b8a3b7 Linux/MacOSX: Implement passing smart card PIN as command line argument (--token-pin switch) 2016-05-29 01:33:17 +02:00
Mounir IDRASSI 3f806010d2 Windows: fix detection of Visual Studio version to activate assembly optimizations. 2016-05-24 07:34:13 +02:00
Mounir IDRASSI 94fdcdf18b Merge pull request #69 from anarchyonline/master
MacOSX: Added two line to enable support for retina ui on retina Macs.
2016-05-24 07:28:49 +02:00
AO 2bb419f92c Added two line to enable support for retina ui on retina Macs. 2016-05-20 16:22:42 +02:00
Mounir IDRASSI 635c3b7af7 Readme.txt:Fix wxWidget expected directory for OSX install 2016-05-19 19:39:01 +02:00
Mounir IDRASSI 6954b7c3ef Merge pull request #68 from strazzere/master
Fix wxWidget expected directory for OSX install in Readme
2016-05-19 19:33:59 +02:00
Tim Strazzere 2bb0cbe16e Fix wxWidget expected directory for OSX install 2016-05-18 14:03:40 -07:00
Mounir IDRASSI cdaeef20ce Language XML files: in German translation, replace PIM description "Personal Iterations Multiplier" by "Persönlicher IterationsMultiplikator".(Ettore Atalan) 2016-05-15 17:22:01 +02:00
Mounir IDRASSI ec4a0af41c Language XML files: update German translation (Ettore Atalan) 2016-05-14 22:51:32 +02:00
Mounir IDRASSI 37d7c75db8 Remove UTF8 BOM from language XML files 2016-05-14 13:47:38 +02:00
Mounir IDRASSI 1ad1c293a3 Language XML files: Update Arabic translation (contributed by Ali Khojah) 2016-05-14 13:25:32 +02:00
Mounir IDRASSI 085ab96abd Merge pull request #67 from veracrypt/revert-66-patch-1
Revert "Makefile: fix build under gcc6"
2016-05-13 22:36:05 +02:00
Mounir IDRASSI 438753522e Revert "Makefile: fix build under gcc6" 2016-05-13 22:34:33 +02:00
Mounir IDRASSI fc69e2541e Merge pull request #66 from FadeMind/patch-1
Makefile: fix build under gcc6
2016-05-13 22:28:35 +02:00
Mounir IDRASSI 942cf1635a Linux: Fix gcc-6 compilation errors. 2016-05-13 22:27:16 +02:00
Tomasz Przybył bf47711ee7 Makefile: fix build under gcc6
Veracrypt for build under GCC6 required using compatibility flag `-std=c++98` against change default C++ frontend in GCC6.

The C++ frontend now defaults to C++14 standard instead of C++98 it has
been defaulting to previously, for compiling older C++ code that might
require either explicitly compiling with selected older C++ standards,
or might require some code adjustment, see
http://gcc.gnu.org/gcc-6/porting_to.html for details.  The experimental
C++17 support has been enhanced in this release.

from: https://gcc.gnu.org/ml/gcc-announce/2016/msg00000.html
2016-05-13 08:39:22 +02:00
Mounir IDRASSI 723768137b Language XML files: fix some files. 2016-05-10 22:53:55 +02:00
Mounir IDRASSI 268ef2d8e9 Merge pull request #61 from davidfoerster/normalize-line-terminators
Normalize line terminators
2016-05-10 22:34:27 +02:00
David Foerster 5f47d8b6f1 Fix space before tab 2016-05-10 22:24:06 +02:00
David Foerster 11716ed2da Remove trailing whitespace 2016-05-10 22:18:34 +02:00
David Foerster 1910751558 Fix issues with .gitattributes
- Revert accidentally converted binary file
2016-05-10 21:58:40 +02:00
David Foerster fc37cc4a02 Normalize all line terminators 2016-05-10 20:20:14 +02:00
David Foerster 98b04198c6 Add .gitattributes file 2016-05-10 20:19:18 +02:00
Mounir IDRASSI 6d61f06a53 Update documentation with latest changes (changelog, wait dialog option). 2016-05-05 16:48:10 +02:00
Mounir IDRASSI 53aabf3f14 Windows: Add option and command line switch to hide waiting dialog when performing operations. 2016-05-05 16:48:05 +02:00
Mounir IDRASSI fb9a49cb1a Windows: convert some files encoding from UTF-16 to UTF-8 to be similar to other files. 2016-05-05 16:47:59 +02:00
Mounir IDRASSI fede2cfa18 Windows: Add checkbox in "VeraCrypt Format" to skip Rescue Disk verification during system encryption wizard 2016-05-05 16:47:55 +02:00
Mounir IDRASSI fc89bf6e2c Windows: Fix compilation error caused by previous commit 2016-05-05 01:12:51 +02:00
Mounir IDRASSI b261177b8f Windows/Linux/MacOSX: Set maximum PIM value to 2147468 in order to avoid having negative values for iterations count using the formula 15000 + (PIM x 1000). Add specific error message to XML language files. 2016-05-04 13:14:05 +02:00
Mounir IDRASSI 0b914c8f5d Merge pull request #55 from davidfoerster/xdg-config-paths
Use XDG_CONFIG_HOME to determine the path of the configuration
2016-05-02 07:19:29 +02:00
Mounir IDRASSI 650d913f51 Add User Guide in OpenDocument format and Update its PDF. 2016-05-02 07:14:59 +02:00
David Foerster faea63cb3c Use scoped instead of raw pointer 2016-05-01 23:31:07 +02:00
David Foerster 0c51cfa5f6 Reset bogus executable permissions 2016-05-01 23:29:43 +02:00
Mounir IDRASSI 570645a845 Language XML files: update German translation (Ettore Atalan) 2016-05-01 17:30:27 +02:00
Mounir IDRASSI 275ac8622a Language XML files: add new fields related to Volume ID feature. 2016-04-28 23:06:20 +02:00
Mounir IDRASSI 99de8a6dcd Windows: Only use A: and B: for mounting when no other free drive letter available or when explicitly chosen by user. This avoid side effects when mounting volumes as removable media and automatic drive selection (e.g. A: become invisible in explorer after closing all explorer instances although it is still mounted). 2016-04-28 23:06:11 +02:00
Mounir IDRASSI 91e3843732 Windows: resize Volume ID field on favorites dialog to display full value of ID 2016-04-28 23:06:06 +02:00
Mounir IDRASSI 32b42cff14 Windows: Display Volume ID of a System Favorite even if it is disconnected 2016-04-28 23:06:01 +02:00
Mounir IDRASSI 0163dfdcab Windows: Reduce memory usage of Rescue Disk for cascades by 1KB. 2016-04-20 00:48:30 +02:00
Mounir IDRASSI 1396269d57 Windows: Add option to avoid PIM prompt in pre-boot authentication by storing PIM value unencrypted in MBR. 2016-04-20 00:48:20 +02:00
Mounir IDRASSI bd9105794b Windows: Resize some controls and dialogs to fix text truncation for some non-English languages. 2016-04-20 00:48:10 +02:00
Mounir IDRASSI e51aafb499 Windows: fix keys parts not shown in system encryption wizard when the display keys checkbox is checked. This occurred when the "Display pool content" in the previous wizard page was unchecked before clicking Next. 2016-04-17 00:59:01 +02:00
Mounir IDRASSI 133afdc9e6 Windows: Add missing GUI modification from previous Volume ID commit 2016-04-17 00:58:58 +02:00
Mounir IDRASSI f5606a44a6 Windows: Finalize implementation of the new volume ID mechanism. Use SHA-256 instead of SHA-512 to compute volume ID to reduce string size and make more convenient to use. 2016-04-14 08:53:41 +02:00
Mounir IDRASSI 60575d9a49 Windows: start implementation of volume ID mechanism that will be used to identify VeraCrypt disk volumes instead of device name. 2016-04-08 23:53:49 +02:00
Mounir IDRASSI 409c0f79be Windows: allow drag-n-drop of files and receiving Explorer restart message when VeraCrypt running as elevated process. 2016-04-08 23:53:42 +02:00
Mounir IDRASSI 09b22c175b Windows Setup: Add missing Apache files used by the installer 2016-04-08 23:53:36 +02:00
David Foerster af327b49aa Use wx-provided wrapper around *getenv() 2016-04-01 08:29:17 +02:00
David Foerster 7d7c09e718 Use XDG_CONFIG_HOME to determine the path of the configuration
Adhere to XDG Desktop Specification and use the environment variable
XDG_CONFIG_HOME to determine location of configuration files on *all*
platforms. If it is unset or empty resort to platform-specific defaults.

On Windows and OS X, `wxStandardPaths` provides correct defaults (equal
to the previous hard-coded paths) but on Linux and other Unices
`~/.config/appinfo` would be better than `~/.appinfo`. This means we
treat those platforms as a special case. It also means that we may need
to fall back to the legacy location if it exists but the new location
doesn't.
2016-03-31 12:36:21 +02:00
David Foerster 39eae0e4c3 Remove some trailing whitespace 2016-03-31 12:24:41 +02:00
Mounir IDRASSI dc1593d60f Windows: reduce CPU usage by caching WNetGetConnection calls result for 2 seconds. 2016-03-24 01:36:12 +01:00
Mounir IDRASSI 1e204da223 Windows: Don't use the foreground setting code if the window is already foreground 2016-03-24 01:36:08 +01:00
Mounir IDRASSI ece26c7481 Windows: Implement passing smart card PIN as command line argument (/tokenpin switch) when explicitly mounting a volume. 2016-03-24 01:36:03 +01:00
Mounir IDRASSI 6738cba617 Windows: Better alignment for Group Boxes in favorites management dialog 2016-03-20 01:26:32 +01:00
Axel KöllhoferandMounir IDRASSI 1290e7836f Linux/MacOSX: Fix build error when using strict wxWidgets library that doesn't allow implicit conversions. 2016-03-20 01:26:28 +01:00
Mounir IDRASSI 646679da4d Linux: Completely fix gcc-5 "Invalid characters encountered" issue on mount. It was caused by an issue of gcc-5 STL implementation that is causing char* pointers retrieved from std::string using c_str method to become invalid in the child of a child process (after two fork calls). The workaround is to first copy the std:string values in the child before calling the second fork. 2016-03-18 16:27:29 +01:00
Mounir IDRASSI fd26f49958 Linux: fix mount failure with "Invalid characters encountered" error when building using gcc-5 by disabling the new C++ ABI. For this to work, wxWidgets static library must be built and used by VeraCrypt by specifying WXSTATIC=1 in make command line. 2016-03-17 14:09:59 +01:00
Mounir IDRASSI 8bfc7f1caa Windows: Correctly disable/enable the "Display PIM" checkbox in the favorites configuration dialog 2016-03-17 14:09:55 +01:00
Mounir IDRASSI 8580464e51 Language XML files: correct some entries to match English version 2016-03-17 14:09:51 +01:00
Mounir IDRASSI fffb3bde7a Linux: fix compilation error 2016-02-22 07:57:03 +01:00
Mounir IDRASSI facfda73eb Linux: fix mount issue on Fedora 23 by forcing the creation of a default loop device. 2016-02-22 00:34:36 +01:00
Mounir IDRASSI 50f85b4512 Windows bootloader: try to fix boot issues on some machines by increasing required memory by 1 KiB 2016-02-22 00:34:33 +01:00
Mounir IDRASSI e175adcd46 Windows: correct static inline declaration to solve Windows compilation error 2016-02-22 00:34:30 +01:00
Mounir IDRASSI 0c0ea60b77 Linux & MacOSX: better implementation for TC_THROW_FATAL_EXCEPTION to use __builtin_trap when available. 2016-02-21 10:59:16 +01:00
Mounir IDRASSI 87df2fd2fc Crypto: update Whirlpool implementation using latest code from Crypto++. 2016-02-21 10:59:13 +01:00
Mounir IDRASSI faf00ca1e0 MacOSX: Correctly detect newer versions of OSXFuse 2016-02-21 10:59:11 +01:00
Mounir IDRASSI b331668c06 Windows:Correct explanatory text in VeraCrypt Expander to reader "Mount" instead of "Start". 2016-02-20 02:05:48 +01:00
Mounir IDRASSI 8e8e273e11 Windows: Correctly remove driver file veracrypt.sys during uninstall on Windows 64-bit. Implement deleting locked files after machine reboot. 2016-02-20 02:05:45 +01:00
Mounir IDRASSI 6452fb3693 Language files: update French XML file with exFAT references. 2016-02-20 02:05:43 +01:00
Mounir IDRASSI 348a45132b Language files: Update German translation for PIM shortcut and exFAT references. 2016-02-20 02:05:41 +01:00
Mounir IDRASSI 3c87c095c3 Windows: use buffer with known maximum length as input to FakeDosNameForDevice 2016-02-16 23:21:45 +01:00
Mounir IDRASSI 2724d7880d Language XML files: update Russian XML file by Dmitry Yerokhin. 2016-02-16 23:21:42 +01:00
Mounir IDRASSI 26e2d22d62 MacOSX: increment bundle version to 1.17.22 2016-02-14 10:29:58 +01:00
Mounir IDRASSI a144e2167d MacOSX: increment installer version to 1.17. 2016-02-14 09:15:13 +01:00
Mounir IDRASSI 2b4003cc81 Increment version to 1.17. Update user guide PDF file. 2016-02-14 09:03:13 +01:00
Mounir IDRASSI 1f87e64127 Windows: handle rare case where size of disk can't be retrieved using IOCTL_DISK_GET_PARTITION_INFO_EX. use IOCTL_DISK_GET_DRIVE_GEOMETRY in such case and add workaround to display correctly partitions in dialog even if disk size is not available. 2016-02-13 22:14:40 +01:00
Mounir IDRASSI d7d4c98775 Windows: Add colors (Red, Yellow, Green) to the collected randomness indicator depending on how much entropy was gathered. Code re-factoring. 2016-02-12 00:04:31 +01:00
Mounir IDRASSI 89d238bb32 Window: fix regression that caused only a single keyfile to be taken into account. 2016-02-12 00:04:28 +01:00
Mounir IDRASSI 7fee9a04c4 Windows: Avoid updating configuration after opening keyfile file dialog when /quit switch used without preferences parameter. 2016-02-12 00:04:25 +01:00
Mounir IDRASSI 39fb2edc25 Linux/MacOSX: add progress bar for mouse collected entropy in GUI of volume creation wizard. Add mutex protection in event handler for shared counter variable 2016-02-09 00:52:28 +01:00
Mounir IDRASSI 0863924483 Linux/MacOSX: add progress bar for mouse collected entropy in GUI for keyfile generator and for random poll enrichment 2016-02-08 01:39:50 +01:00
Mounir IDRASSI 8e2793085e Windows: Continuation of fix for wrong update of configuration XML file. 2016-02-08 01:39:47 +01:00
Mounir IDRASSI 8518d55834 Windows Driver: if saving volume header fails, don't mark operation as successful so that it will be retried later. 2016-02-07 02:39:45 +01:00
Mounir IDRASSI ae7ec4802a Windows:Fix various issues and warnings reported by static code analysis tool Coverity. 2016-02-07 02:39:43 +01:00
Mounir IDRASSI 229bd668f4 Merge pull request #44 from makomi/master
Language files: Update German translation
2016-02-03 00:53:44 +01:00
Matthias Kolja Miehl 13a0473cf9 Language files: Update German translation 2016-02-02 20:10:25 +00:00
Mounir IDRASSI 49d61632f9 Language Files: update polish translation 2016-02-02 01:02:16 +01:00
Mounir IDRASSI 4a7a9f4dd2 Windows: Don't try to mount using cached passwords if password and/or keyfile are specified in the command line. 2016-02-02 00:47:15 +01:00
Mounir IDRASSI ce8a9becdf Windows:Center the text of the random pool displayed in the keyfile generator dialog. 2016-02-01 00:13:55 +01:00
Mounir IDRASSI 5aec655b8b Windows: solve bootloader compilation error 2016-01-31 23:42:11 +01:00
Mounir IDRASSI 2c0776e987 Language XML files: update XML files with newly added field 2016-01-31 23:30:36 +01:00
Mounir IDRASSI 203c7aa015 Windows: Fix link issue in Debug configuration for Setup project. 2016-01-31 23:30:32 +01:00
Mounir IDRASSI fe234e08ee Windows: Fix buffer overrun issue introduce by the Unicode rewrite. 2016-01-31 23:30:29 +01:00
Mounir IDRASSI 77885de85e Windows: Implement GUI indicator for entropy collected from mouse movements. 2016-01-31 23:30:27 +01:00
Mounir IDRASSI b407512248 MacOSX: Support creation exFAT volumes on OSX using the built-in command newfs_exfat 2016-01-30 00:48:20 +01:00
Mounir IDRASSI dde3dcf14d Language XML files: update German translation (Ettore Atalan) 2016-01-29 00:50:29 +01:00
Mounir IDRASSI 926721d54e Windows Bootloader: Always hide password/PIM values with '*' after ENTER is hit, even if F5 was pressed to display password/PIM. 2016-01-29 00:50:27 +01:00
Mounir IDRASSI 24b2dfc0d5 Language XML files: update exFAT message translation in Korea, Russian and Chinese. 2016-01-28 13:11:27 +01:00
Mounir IDRASSI ef0906bc83 Language Files: update polish translation 2016-01-28 12:29:20 +01:00
Mounir IDRASSI 90def2ee5a Language XML files:update German translation 2016-01-28 00:51:48 +01:00
Mounir IDRASSI 1ca60754b2 Language XML file: correct errors in some English texts. 2016-01-28 00:30:40 +01:00
Mounir IDRASSI f63e34e0f9 Language XML files: update with new fields. Reoder node so that new additions are at the bottom. This makes it easier for Crowdin.com import. 2016-01-27 01:13:51 +01:00
Mounir IDRASSI dcb8390bb2 Windows/Linux: Implement exFAT support. 2016-01-27 01:13:46 +01:00
Mounir IDRASSI 9f5b5445d7 Linux/MacOSX: Update command line help text to reflect that we can now specify in filesystem when creating a new volume. 2016-01-26 01:47:29 +01:00
Mounir IDRASSI d53b48bdf0 Linux/MacOSX: fix issue creating volumes using command line with a filesystem other than FAT. 2016-01-26 01:29:45 +01:00
Mounir IDRASSI 84ee7076d9 Linux/MacOSX: remove unecessary XML resource string replacement of %hs, not needed since Unicode rewrite. 2016-01-25 01:46:37 +01:00
Mounir IDRASSI 5a555deb74 Linux/MacOSX: fix wrong AskYesNo method parameters use caused by mistake in parenthesis use. 2016-01-25 01:46:34 +01:00
Mounir IDRASSI b8a2e808c6 MacOSX: Add PIM value validity checks to workaround wxWidget bug that makes wxTextValidator useless when applied to a text control with password attribute (http://trac.wxwidgets.org/ticket/17185). 2016-01-25 01:46:32 +01:00
Mounir IDRASSI e9d3ba0b11 Linux/MacOSX: update --size entry in command line help text. 2016-01-24 02:58:50 +01:00
Mounir IDRASSI c86697f51b Linux/MacOSX: Support K/M/G/T suffixes for --size switch to indicate unit to use for size value (KiloByte, MegaByte, GigaByte and TeraByte respectively) 2016-01-24 02:41:49 +01:00
Mounir IDRASSI 5a09d17c45 Windows: hide PIM is VeraCrypt Expander the same way as in other places 2016-01-20 21:45:40 +01:00
Mounir IDRASSI c95940cfc6 Readme.txt: update libfuse URL to new Github location. 2016-01-20 21:42:39 +01:00
Mounir IDRASSI b12e8b6943 Merge pull request #41 from ReadmeCritic/master
Update README to point to new libfuse URL
2016-01-20 21:37:04 +01:00
ReadmeCritic cd65f78a62 Update README URLs based on HTTP redirects 2016-01-20 11:34:24 -08:00
Mounir IDRASSI bda7a1d0bd Copyright: update dates to include 2016. 2016-01-20 00:53:24 +01:00
Mounir IDRASSI 43f5fae2ee Windows:Fix issue with the display of legal notices text. Regression caused by the latest Unicode modifications. 2016-01-20 00:53:08 +01:00
Mounir IDRASSI f9fa0191ec Linux/MacOSX:solve issue of --stdin option not handling correctly passwords that contain a space character (reported and fixed by Codeplex user horsley1953) 2016-01-20 00:53:02 +01:00
Mounir IDRASSI 8a2d9c4120 Windows: solve Expander GUI issues caused by latest Unicode modifications. 2016-01-18 21:40:16 +01:00
Mounir IDRASSI 90957cd9d9 MacOSX: Ensure that time-stamping is always activated when performing code signing by using --timestamp switch. 2016-01-17 14:55:13 +01:00
Mounir IDRASSI 3cda204626 Windows: avoid leaking location of selected keyfiles by clearing global variable used to store multiple file selection path. 2016-01-17 10:52:31 +01:00
Mounir IDRASSI 59afc2c4d9 Cryptography: Divide mount and boot times by 2 using a pre-computation of values used in PRF HMac calculation (thanks to Xavier de Carné de Carnavalet for finding this optimization). 2016-01-17 10:52:29 +01:00
Mounir IDRASSI dd1e62ebcd Windows: Add SHA-256 EV Code Signing using the new GlobalSign certificate on top of the SHA-1 code signing. Create new SHA256 test code signing certificate and update test signing script. 2016-01-17 10:52:26 +01:00
Mounir IDRASSI a6c6c3dc4a Language files: Update German translation (contributed by Ettore Atalan) 2016-01-14 23:02:07 +01:00
Mounir IDRASSI 66a5671e3b Language Files: update polish translation 2016-01-14 23:02:05 +01:00
Mounir IDRASSI e858d93a8e MacOSX: use native OSX byte swapping routines used in hash functions to improve speed. 2016-01-11 01:04:54 +01:00
Mounir IDRASSI e40774f546 Linux/MacOSX: Show better error message when the PKCS#11 library can't be loaded 2016-01-10 23:59:17 +01:00
Mounir IDRASSI fe38d6f52c Language XML files: update XML files with newly added field 2016-01-10 20:45:22 +01:00
Mounir IDRASSI 8586c51016 Windows: Avoid wrong update of configuration XML file caused by not using the correct window handle to get some GUI fields content. Some code cleanup. 2016-01-10 20:45:18 +01:00
Mounir IDRASSI fb430c403b Windows: Don't show disconnected network drives in the list of available drives. Add option to make them available for mounting if needed. 2016-01-10 20:45:15 +01:00
Mounir IDRASSI 5597a1e390 Language files: fix mistake in previous German translation commit where a "\nDAS" was replaced by "\DAS" 2016-01-10 20:45:10 +01:00
Mounir IDRASSI 3b1eebbfad Language files: various enhancements to German translation (contributed by Ettore Atalan) 2016-01-09 21:44:03 +01:00
Mounir IDRASSI 80ba722497 Windows: increase the size of the field IDC_PREF_CACHE_PIM in the preferences dialog to avoid truncation when using a language other then English 2016-01-04 02:55:18 +01:00
Mounir IDRASSI 52d9838978 Language Files: update polish translation 2016-01-04 02:55:15 +01:00
Mounir IDRASSI 7a15ff2083 Windows: Enhance fix for dll hijacking vulnerability affecting installer (CVE-2016-1281) 2016-01-04 02:37:37 +01:00
Mounir IDRASSI 0600ae7d1c Language XML files: update XML files with newly added fields. 2016-01-04 02:37:33 +01:00
Mounir IDRASSI 29d46b749d Windows: Add keyboard shortcut alt+i for checking "Use PIM" in various dialogs like password dialog. 2016-01-04 02:37:29 +01:00
Mounir IDRASSI ea8e8e517e Linux: Restore Nautilus fix that was mistakenly removed by Whirlpool optimization commit 2016-01-03 09:30:21 +01:00
Mounir IDRASSI 723fcfa64d Windows Driver: Remove unwanted ':' character at the end of volume device name. This was causing a crash in Kaspersky Internet Security 2016 when a program is run from a VeraCrypt volume. 2016-01-03 00:15:11 +01:00
Mounir IDRASSI 6e1f5cfe4b Windows: use compiler intrinsic for some functions used in cryptographic primitives to ensure maximum performance. 2016-01-03 00:15:08 +01:00
Mounir IDRASSI 5872be28a2 Windows: Fix Dll hijacking vulnerability affecting installer that allows arbitrary code execution with elevation of privilege (CVE-2016-1281) 2016-01-03 00:15:05 +01:00
Mounir IDRASSI 6cb1eefc49 Windows: sign binaries using both SHA-1 and SHA-256 for maximum compatibility. Add requirement for Windows SDK 8.1 that contains signtool.exe version that enables this. 2016-01-03 00:15:02 +01:00
Mounir IDRASSI 4181283f29 Cryptography: Set 16-byte alignment for KEY_INFO structure that is used as input for Whirlpool hash. This helps improve performance. 2016-01-03 00:14:59 +01:00
Mounir IDRASSI bb66dac8e6 Cryptography: correct Whirlpool compilation error on Big Endian platforms. 2016-01-03 00:14:54 +01:00
Mounir IDRASSI 0c2c0a846d Cryptography: Optimize Whirlpool implementation by using public domain assembly code developed by Wei Dai 2015-12-31 01:56:19 +01:00
Mounir IDRASSI d462806ea9 Windows: Make benchmark batch file run a PRF measurement only when associated container file is present. 2015-12-31 01:56:16 +01:00
Mounir IDRASSI 859c111d01 Readme: Make Readme.txt identical to README.md. 2015-12-25 20:30:53 +01:00
Mounir IDRASSI 82f372ef4f README: Add reference to UPX as a dependency on Windows in README.md. 2015-12-25 20:29:12 +01:00
Mounir IDRASSI 5a2c8af7ec Merge pull request #38 from makomi/master
Readme: fix markdown syntax, typos, and format
2015-12-25 20:22:30 +01:00
Matthias Kolja Miehl 2e9c630ab1 Readme: fix markdown syntax, typos, and format 2015-12-22 05:49:41 +00:00
Mounir IDRASSI 2fd699cc66 Windows Driver: wipe cached PIM values when passwords are wiped. 2015-12-21 01:53:29 +01:00
Mounir IDRASSI fcfcd1a2c4 Language XML files: update XML files with newly added fields. 2015-12-21 01:19:08 +01:00
Mounir IDRASSI 8f6c08330a Windows: Implement PIM caching, both for system encryption and for normal volumes. Add options to activate it in the Preferences and System Settings. 2015-12-21 01:19:04 +01:00
Mounir IDRASSI 7832d712fd Windows: solve issue with system favorites not being able to mount at A: 2015-12-16 23:38:44 +01:00
Mounir IDRASSI 3610d2c2ec Language files: various fixes to German translation (contributed by Ettore Atalan) 2015-12-10 17:19:41 +01:00
Mounir IDRASSI 9a39164ed5 Language files: update German XML file (contributed by Ettore Atalan) 2015-12-09 23:24:53 +01:00
Mounir IDRASSI 4f17e0cfe9 MacOSX: Customize dmg file using VeraCrypt new logo 2015-12-06 11:51:23 +01:00
Mounir IDRASSI c1f1c643ff MacOSX: Add possibility in build script to reuse existing wxWidgets compiled library 2015-12-06 11:51:11 +01:00
Mounir IDRASSI 8e56e138cc Windows Rescue Disk: when decryption paused/finished, display message to indicate that header is being updated 2015-12-05 19:35:45 +01:00
Mounir IDRASSI 1cf826dbad Windows: Correct issue with some of new bitmaps that didn't render correctly. 2015-12-05 19:35:42 +01:00
Mounir IDRASSI 13c6f2948e Windows: use new icons an graphics contributed by Andreas Becker (https://github.com/veracrypt/VeraCrypt/issues/9#issuecomment-118353850) 2015-12-05 00:07:13 +01:00
Mounir IDRASSI 533b7e1eb8 Linux/MacOSX: use new icons contributed by Andreas Becker (https://github.com/veracrypt/VeraCrypt/issues/9#issuecomment-118353850) 2015-12-04 22:20:45 +01:00
Mounir IDRASSI 3a9db8d98c Linux: fix Nautilus not detected as file manager on some Gnome based destributions. 2015-12-04 22:20:42 +01:00
Mounir IDRASSI 613ea66c95 Merge pull request #35 from netdcy/patch-1
Update Language.zh-cn.xml
2015-11-30 14:03:07 +01:00
Mounir IDRASSI efa436974d Linux/MacOSX: Implement Unicode passwords suppport. Make validation of parameters in GUI more robust. 2015-11-30 13:58:19 +01:00
Mounir IDRASSI cfadb231d2 Linux/MacOSX: Solve compilation issue following Windows Unicode rewrite 2015-11-30 13:58:15 +01:00
netdcy 2d4781be24 Update Language.zh-cn.xml
Add translations.
2015-11-30 13:22:40 +08:00
Mounir IDRASSI e0408eee74 Language files: update German XML file (Dulla) 2015-11-28 10:36:19 +01:00
Mounir IDRASSI 96d8c65ab4 Language Files: update polish translation 2015-11-26 19:23:14 +01:00
Mounir IDRASSI 9666dda282 Windows: solve GUI issues caused by using ANSI string instead of UNICODE ones. Remove Unused functions. 2015-11-26 19:23:11 +01:00
Mounir IDRASSI 2408edb239 Windows Language files: update language XML files with added new fields. 2015-11-26 01:45:01 +01:00
Mounir IDRASSI 10d77be0d2 Windows: Support creating Traveler Disk when running in Portable Mode 2015-11-26 01:44:56 +01:00
Mounir IDRASSI 59611b8b37 Windows: solve crash caused by system function FormatMessage failure on rare cases. 2015-11-26 01:44:54 +01:00
Mounir IDRASSI 90bd57fe40 Windows: Full UNICODE rewrite and implement support for UNICODE passwords. 2015-11-26 01:44:52 +01:00
Mounir IDRASSI ec7d96fcb7 Windows Bootloader: Avoid displaying empty new line between password and PIM after filling password field with dummy '*'. 2015-11-26 01:44:46 +01:00
Mounir IDRASSI c53fd7ef0c Windows Driver: solve compilation error in Debug build caused by a missing variable. 2015-11-26 01:44:43 +01:00
Mounir IDRASSI d40eedeaaf Language XML files: More fixes for language files following import into Crowdin. 2015-11-26 01:44:40 +01:00
Mounir IDRASSI 1c55894e1d Language XML files: harmonize XML language files ad solve few issues. 2015-11-08 09:49:04 +01:00
Mounir IDRASSI 7322ebbc83 Merge pull request #31 from initbar/master
Update Language.ko.xml (by Herbert Shin)
2015-11-03 00:21:27 +01:00
Brehret Nish c69bd27f78 Update Language.ko.xml #30 2015-11-01 22:51:39 -05:00
Brehret Nish 6691cc0c06 Fix Language.ko.xml 2015-11-01 05:05:03 -05:00
Brehret Nish 3eb383d4a5 Update Language.ko.xml 2015-11-01 04:27:54 -05:00
Brehret Nish 14eaa9006c Update Language.ko.xml 2015-11-01 03:47:08 -05:00
Mounir IDRASSI 4a09511372 Language XML files: update Russian XML file by Dmitry Yerokhin. 2015-10-27 20:47:58 +01:00
Mounir IDRASSI ebbbde8964 Windows: workaround to solve false positive detection by some anti-virus software. 2015-10-27 20:47:56 +01:00
Mounir IDRASSI 62de77e2c8 Windows: fix wrong translation for "Reset" button in hotkeys dialog 2015-10-27 20:47:53 +01:00
Mounir IDRASSI c863f3769e Language XML file: correct some fields and shorten some of them to avoid being truncated in GUI 2015-10-27 20:47:50 +01:00
Mounir IDRASSI 1d844c4557 Language Files: update polish translation 2015-10-20 16:13:10 +02:00
Mounir IDRASSI 908fa17e0f Merge pull request #29 from netdcy/master
Update Language.zh-cn.xml
2015-10-19 13:03:59 +02:00
netdcy 01fda292e6 Update Language.zh-cn.xml
Change some punctuation from English to Chinese.
Minor fixes.
2015-10-19 16:30:53 +08:00
Mounir IDRASSI 4ff727d702 Language XML files: add some missing fields 2015-10-18 17:21:53 +02:00
Mounir IDRASSI 97701eb2e9 Windows: Ensure focus is always set to the drive list upon startup 2015-10-18 16:17:09 +02:00
Mounir IDRASSI 0a69062c6b Language XML files: remove unused ID. 2015-10-18 16:17:07 +02:00
Mounir IDRASSI d5e7426181 Merge pull request #27 from Zhangjintao/master
Update Language.zh-cn.xml (By zhangjintao)
2015-10-18 16:05:52 +02:00
Mounir IDRASSI 41819270bb Windows: Solve lost focus for application after displaying the waiting dialog 2015-10-15 01:36:15 +02:00
Mounir IDRASSI 8342d0d616 Windows Rescue Disk: compress bootloader for rescue disk in several more cases because of its growing size. 2015-10-15 01:36:12 +02:00
Mounir IDRASSI 19483d2097 Windows Bootloader: Protect password/PIM length by filling the fields to their maximum length with '*' after ENTER is hit 2015-10-15 01:36:10 +02:00
Mounir IDRASSI 225acf4a22 Windows: resize some GUI fields to avoid text truncation with non US languages (e.g. German) 2015-10-15 01:36:07 +02:00
Mounir IDRASSI fb67b54787 Language files: update German XML file with anonymous contribution (Dulla) 2015-10-15 01:36:04 +02:00
Mounir IDRASSI 23b69537a5 Windows: Set bPrebootPasswordDlgMode to FALSE at the correct code location. 2015-10-15 01:36:02 +02:00
Mounir IDRASSI ee3fa19ed9 Windows: correct wrong ID for keyfiles button in password dialog 2015-10-15 01:35:59 +02:00
Mounir IDRASSI f274f5bdc5 Windows: solve issue on VeraCryptExpander where if TB radio button was checked, it will remain checked even if GB, MB or KB is are checked. 2015-10-15 01:35:57 +02:00
Mounir IDRASSI 5a8eee91c3 Language Files: update polish translation 2015-10-15 01:35:54 +02:00
Zhangjintao 647a7e047a Update Language.zh-cn.xml 2015-10-12 08:34:16 +08:00
Zhangjintao dadfebc6c3 Update Language.zh-cn.xml
Update Simplified Chinese translation.
2015-10-11 15:32:53 +08:00
Mounir IDRASSI 8748013f7d Increment version to 1.16. Update user guide PDF file. 2015-10-07 12:56:09 +02:00
Mounir IDRASSI 63091cd29c Windows Language files: update language XML files with added new fields. 2015-10-07 12:56:05 +02:00
Mounir IDRASSI 9a6fc789eb Windows: Add option to disable detection of "Evil Maid" attacks. This is helpful for users who have software running the modifies the bootloader, like FLEXnet. 2015-10-07 12:56:01 +02:00
Mounir IDRASSI f3c91cb05c Windows: Don’t try to mount using empty password when default keyfile configured or keyfile specified in command line. Add option in default keyfiles dialog to restore the old behavior. 2015-10-07 12:55:58 +02:00
Mounir IDRASSI 13058fd638 Windows: fix failure to restore volume header from an external file if custom PIM used or PRF different from default one. Also default PRF is correct set in password dialog for restore operation. 2015-10-05 04:31:19 +02:00
Mounir IDRASSI c94f8c9b63 Windows Driver: Modify fix for CVE-2015-7358 to solve side effects on Windows mount manager while still making it hard to abuse drive letter handling. 2015-10-05 04:31:17 +02:00
Mounir IDRASSI ea451c7241 Windows Driver: remove allocation of unused variables 2015-10-05 04:31:15 +02:00
Mounir IDRASSI 4682f9b235 Windows: remove wrong check for return value of MultiByteToWideChar 2015-10-05 04:31:13 +02:00
Mounir IDRASSI 185e421114 Increment version to 1.15. Update user guide PDF file. 2015-09-26 17:44:31 +02:00
Mounir IDRASSI a3437067ac Windows Language files: update language XML files with added new fields. 2015-09-26 17:44:23 +02:00
Mounir IDRASSI f07121f830 Windows: rename "Performance..." menu to "Performance/Driver Configuration" since we added IOCTL option 2015-09-26 17:44:12 +02:00
Mounir IDRASSI f41be7399b Windows: Support specifying volumes size using TB in GUI as it is the case in command line. 2015-09-26 17:44:09 +02:00
Mounir IDRASSI 307568f631 Windows Driver: remove unnecessary variables declaration and use in MountManagerMount. 2015-09-26 17:44:06 +02:00
Mounir IDRASSI 9b24da3398 Windows Driver: Fix inherited TrueCrypt local elevation of privilege vulnerability caused by abusing the drive letter symbolic link creation facilities to remap the main system drive. Thanks to James Forshaw (Google) for reporting this issue and for helping implementing the fix. 2015-09-26 17:44:03 +02:00
Mounir IDRASSI b7f9df6e4f Windows Driver: Fix inherited TrueCrypt local elevation of privilege vulnerability caused by incorrect impersonation token handling. Reported and fixed by James Forshaw (Google) 2015-09-26 17:44:00 +02:00
Mounir IDRASSI fda4d3f820 Windows: Allow Application key to open context menu on drive letters list. 2015-09-26 17:43:57 +02:00
Mounir IDRASSI 0eec3bc349 Windows Installer: check newly added files if they are used before resuming installation. Avoid using driver handle to check if we are using system encryption. 2015-09-26 17:43:54 +02:00
Mounir IDRASSI d98367f53b Window: Solve Unicode issues in GUI (e.g. Chinese text not always displayed correctly) by using Unicode API for dialogs and window message handling. 2015-09-26 17:43:51 +02:00
Mounir IDRASSI 03de885b13 Windows: Set keyboard focus to PIM field when "Use PIM" is checked. 2015-09-26 17:43:47 +02:00
Mounir IDRASSI 6b3a26bc40 Windows: Add extra check in GetDiskDeviceDriveLetter for code clarity 2015-09-26 17:43:43 +02:00
Mounir IDRASSI e8ea23e719 Windows: fix regression that made Favorite fail to load a logon. 2015-09-26 17:43:35 +02:00
Mounir IDRASSI c447b45d45 Increment version to 1.14. Update user guide PDF file. 2015-09-16 18:35:57 +02:00
Mounir IDRASSI d904c2758f Windows Language files: update language XML files with added new fields. 2015-09-16 18:35:51 +02:00
Mounir IDRASSI 9e1e128b14 Windows: Add functionality to verify Rescue Disk ISO image file. 2015-09-16 01:33:19 +02:00
Mounir IDRASSI 52c7445a79 Windows: Correctly detect presence of CD/DVD recorder during the creation of Rescue Disk. Check only CD/DVD drives and removable media when looking for rescue disk during its verification. 2015-09-16 01:33:16 +02:00
Mounir IDRASSI db80c02342 Windows: Add option to explicitly support extended disk IOCTLs and disable this support by default. This will avoid having issue with software that doesn't handle correctly partial IOCTL_STORAGE_QUERY_PROPERTY support. 2015-09-16 01:33:14 +02:00
Mounir IDRASSI 4d7dc3ba25 Windows: first implementation of CLI support for creating volumes. 2015-09-16 01:33:11 +02:00
Mounir IDRASSI 85c1bc34e3 Linux/MacOSX: workaround bug in old versions of g++ that are confused by methods having the same name and one of them used as wxWidgets event handler callback. 2015-09-14 00:48:37 +02:00
Mounir IDRASSI 24f3b5230c Linux/MacOSX: Mask/unmask PIM value in GUI the same way as the password 2015-09-13 23:51:06 +02:00
Mounir IDRASSI 7e73208e62 Windows Bootloader: Fix Rescue Disk issue when Cascades and SHA256 used. It was caused by the bootloader becoming too big in this case with PIM implementation (larger than the limit of 31232 bytes). We also increase memory requirement for this case 2015-09-13 01:15:13 +02:00
Mounir IDRASSI 22152878f8 Windows Bootloader: pass correct compressed data size to decompressor and use shorter string to keep a valid memory layout for boot sector. 2015-09-13 01:14:17 +02:00
Mounir IDRASSI 89a7fad16d Windows: avoid freezing the wait dialog by setting its parent to desktop when having lengthy driver calls (like mounting) 2015-09-11 00:38:52 +02:00
Mounir IDRASSI fe6ea62363 Windows: Don't offer creating a restore point if it is disabled in Windows. 2015-09-10 01:44:17 +02:00
Mounir IDRASSI 957ff20f37 Windows: Implement waiting dialog for Mount All Favorites Volumes operation. 2015-09-10 01:44:14 +02:00
Mounir IDRASSI ec7b5cd7e6 Windows: Implement waiting dialog for Dismount operations to avoid freezing GUI when dismounting takes long time. 2015-09-10 01:44:12 +02:00
Mounir IDRASSI c55e08b31e Windows: When no language selected by user, explicitly use English as default one unless VeraCrypt is in portable mode. 2015-09-10 01:44:09 +02:00
Mounir IDRASSI 09db742c3e Windows: Add missing IDC_COPY_EXPANDER control definition 2015-09-10 01:44:06 +02:00
Mounir IDRASSI a36cf1f01e Windows Traveler Disk Setup: Include Volume Expander. Force selection of target directory through Browse button. Use Unicode functions for handling the creation files. 2015-09-08 01:08:24 +02:00
Mounir IDRASSI a9882a6689 Windows: Don't use RegDeleteKeyEx since it's not supported on Windows XP. 2015-09-08 01:08:22 +02:00
Mounir IDRASSI 0bd265cbde Windows: Launch Format/Expander wizards from VeraCrypt.exe using executable binaries with the same architecture. 2015-09-07 01:40:51 +02:00
Mounir IDRASSI 9fc98b5ea3 Windows: take into account default PRF and TrueCrypt Mode in "Volume Tools" operations. 2015-09-06 20:31:10 +02:00
Mounir IDRASSI 13bfb2db59 Windows: Installer and Traveler Disk Setup both always copy 32-bit and 64-bit executable binaries. 2015-09-06 20:31:07 +02:00
Mounir IDRASSI e445863ae4 Windows: Save/Restore last selected drive in drivers list only when saving history is enabled. 2015-09-06 20:31:04 +02:00
Mounir IDRASSI 42a7a17cb9 Windows Installer: better handling for updating system favorite service from 1.0f-2 (solve Windows 10 issue) . Remove extra VeraCrypt files that may remain after uninstalling it. 2015-09-06 20:31:01 +02:00
Mounir IDRASSI adc3274395 Language files: adaptations of XML files to be recognized correctly by Transifex 2015-09-01 01:37:02 +02:00
Mounir IDRASSI 249d747a53 Windows: Increase width of plain text size static control to accommodate larger text 2015-09-01 01:37:00 +02:00
Mounir IDRASSI f2b40ba5b5 Language files: update XML files with new fields. 2015-09-01 01:36:57 +02:00
Mounir IDRASSI 4470d11c39 Merge pull request #18 from LouisTakePILLz/master
Linux/MacOSX: Support supplying password to VeraCrypt via pipe (stdin)
2015-08-31 01:56:56 +02:00
LouisTakePILLz 9582d8fbcb Add stdin-supplied password support 2015-08-30 19:45:01 -04:00
Mounir IDRASSI 90f9194558 Windows: Support setting volume label in Explorer through mount option. Support using favorite label as label in Explorer. 2015-08-31 00:30:58 +02:00
Mounir IDRASSI dc6c279339 Windows Driver: Protect captured subject context during processing of user access token. 2015-08-31 00:30:56 +02:00
Mounir IDRASSI 2f2cb6b7ae Windows: compact columns size of view reports used in Benchmark and Devices dialogs 2015-08-31 00:30:53 +02:00
Mounir IDRASSI 8dc1dd2fb4 Windows bootloader: Mask/unmask PIM value in bootloader the same way as the password 2015-08-28 19:32:29 +02:00
Mounir IDRASSI 86dc27dcb8 Windows: Treat the PIM like a password and make it visible when "Display password" is checked. 2015-08-28 01:54:53 +02:00
Mounir IDRASSI cfb591a9e9 Windows: Correctly display the password edit "black dot" instead of a '*' when showing it then hiding it. 2015-08-27 02:18:47 +02:00
Mounir IDRASSI 8c0fadc068 Language XML translations: use correct abbreviation for VeraCrypt Rescue Disk (VRD instead of TRD) 2015-08-27 02:18:44 +02:00
Mounir IDRASSI ad3b8eca69 Windows: Protect against using a container file as its own keyfile. Normalizing path names to never use '/' but always '\'. 2015-08-27 02:18:40 +02:00
Mounir IDRASSI 20cb199e55 Windows: Solve various issues in HotKeys assignment dialog by ensuring that keys are detected only when the assignment edit has the focus and also by taking a key into account only once even if it remains pressed contently (this solves issue http://sourceforge.net/p/veracrypt/discussion/technical/thread/6597c91a) 2015-08-27 02:18:36 +02:00
Mounir IDRASSI ef94506c34 Windows: Solve wrong PKCS-5 PRF label disabled in dialog for Add/Remove Keyfiles and Remove All Keyfiles 2015-08-16 21:29:00 +02:00
Mounir IDRASSI 55a267a171 Windows: Solve UI language change not taken into account for new install unless a preference is changed. Code refactoring. 2015-08-16 17:58:06 +02:00
Mounir IDRASSI ba9af46662 Language XML: use correct abbreviation for VeraCrypt Rescue Disk (VRD instead of TRD) 2015-08-14 01:58:45 +02:00
Mounir IDRASSI fa66a059d9 Windows Driver: support returning StorageDeviceProperty through IOCTL_STORAGE_QUERY_PROPERTY. 2015-08-14 01:58:42 +02:00
Mounir IDRASSI 1d36a1cd05 Windows: solve issue of option "Cache password in driver memory" not read on startup, making it always disabled unless a mount is attempted. 2015-08-14 01:58:39 +02:00
Mounir IDRASSI 5db8cdb98f Increment version to 1.13 2015-08-09 13:56:51 +02:00
Mounir IDRASSI 0cf2885e84 Windows: better error code when IOCTL_STORAGE_QUERY_PROPERTY type is not supported 2015-08-09 01:38:34 +02:00
Mounir IDRASSI f9c3bcd384 Windows: Solve crash of TOR when run from VeraCrypt volume by explicitly returning error code when unsupported IOCTL_STORAGE_QUERY_PROPERTY parameter encountered. 2015-08-09 00:17:46 +02:00
Mounir IDRASSI 96520e22bd Linux: modify official build script to use different build directories for wxWidgets console and GUI builds. 2015-08-06 12:31:32 +02:00
Mounir IDRASSI ff0ab2da93 Linux: Correct formating of license displayed in the installer 2015-08-06 12:31:28 +02:00
Mounir IDRASSI 174f7f498a Increment version to 1.12. Update user guide PDF file. 2015-08-06 00:04:29 +02:00
Mounir IDRASSI 041024fbb9 Update license information to reflect the use of a dual license Apache 2.0 and TrueCrypt 3.0. 2015-08-06 00:04:25 +02:00
Mounir IDRASSI a23943694b Language files: Remove duplicated entry in XML files. 2015-08-06 00:04:10 +02:00
Mounir IDRASSI e760d69bfd Language files: update French XML file. remove duplicated field. 2015-08-06 00:04:00 +02:00
Mounir IDRASSI c2d0d5e344 Windows: Add extra checks for bootloader tampering. 2015-08-06 00:03:56 +02:00
Mounir IDRASSI a06c41c5c9 Language files: update German XML file with anonymous contribution (Maria) 2015-07-31 17:39:37 +02:00
YanandMounir IDRASSI ee511e95b2 typo fix 2015-07-31 17:39:34 +02:00
YanandMounir IDRASSI 8454c23fcc Updated Russian translation 2015-07-31 17:39:30 +02:00
Mounir IDRASSI 2aa558d6f4 Language files: update German XML file to replace Volumen by Volume 2015-07-30 22:47:01 +02:00
Mounir IDRASSI 0eeff69332 Language Files: update polish translation 2015-07-30 01:37:51 +02:00
Mounir IDRASSI 1a897f8714 Language files: Update German translation received from anonymous contributor. 2015-07-30 00:51:02 +02:00
Mounir IDRASSI d94304f419 Language files: add new field related to bootloader fingerprint checking 2015-07-29 00:33:17 +02:00
Mounir IDRASSI 4535aee30f Language files: Update Polish translation received from anonymous contributor. 2015-07-29 00:33:13 +02:00
Mounir IDRASSI 6ca598f841 Windows: Implement Evil-Maid-Attack detection mechanism. Write the correct bootloader when changing the system encryption password: this enables to recover if an attack is detected. 2015-07-29 00:33:10 +02:00
Mounir IDRASSI 69a8ad5bba Linux/MacOSX: remove unused variable. 2015-07-25 23:59:01 +02:00
Mounir IDRASSI 78aa7de9bc Language files: update XML language files with new fields 2015-07-25 19:46:10 +02:00
Mounir IDRASSI 94ccaf1ab4 Linux: solve compilation error on OpenSUSE when linking against system wxWidgets. OpenSUSE enables STL in wxWidgets which causes the error because implicit casts are not available. 2015-07-25 13:39:50 +02:00
Mounir IDRASSI 4fcf5c921c Linux: Add "new-hash" switch for changing PRF and remove "current-hash" switch which didin't fit the change password/keyfile logic. 2015-07-19 11:29:47 +02:00
Mounir IDRASSI 5158953428 User Interface enhancements for PIM 2015-07-19 11:29:45 +02:00
Mounir IDRASSI 63818bcaa4 Windows: Don't offer "None" as wipe mode when real wipe is explicitly needed (like in Decoy system partition wipe case) 2015-07-14 16:58:30 +02:00
Mounir IDRASSI 88ef238593 Windows: in encryption wizard, clicking "Previous" in the "Large File Support" page should take to password page if PIM not enabled. 2015-07-14 15:47:38 +02:00
Mounir IDRASSI 046513b7c9 Windows: solve issue introduced by the new "Use PIM" checkbox that caused error when trying to encrypt system (the wizard was executing a wrong page) 2015-07-14 14:03:20 +02:00
Mounir IDRASSI 7d6cd0c92d Windows: on 64-bit Windows, more System favorite service from SysWoW64 to System32 since now all binaries are native 64-bit on 64-bit machines. 2015-07-13 23:35:23 +02:00
Mounir IDRASSI 103018b367 Windows: Fix memory access issues when processing language XML files. Avoid writing to locked memory resource which can trigger crash. 2015-07-13 23:35:20 +02:00
Mounir IDRASSI 52146825de Windows: workaround to solve system favorites failing to mount because underlying drive takes long time to be recognized by Windows. 2015-07-13 23:35:17 +02:00
Mounir IDRASSI a43a5ebb21 Windows: Modify PIM parts in GUI to make it easier to use. Users must explicitly check "User PIM" to enable its use. 2015-07-13 23:35:15 +02:00
Mounir IDRASSI 8fc08b1e46 Windows: Solve failure to create hidden volume when PIM used for outer volume. Correctly wipe password variable from memory. 2015-07-13 23:35:11 +02:00
Mounir IDRASSI b23cbf384f Windows: Set longer wait hint time for System Favorites Service to avoid being killed by Windows. Add extra system event logs to help trace any issues (there is no leak issue because this is done in case of System Favorite service which is only enabled when system is encrypted). 2015-07-13 23:35:08 +02:00
Mounir IDRASSI 2d0d4b06b1 Linux: Solve compilation warning (unused variables, pointer cast) 2015-07-11 01:58:39 +02:00
Mounir IDRASSI 944b6aa53f Linux: Solve error when building against dynamic wxWidgets library, especially under Ubuntu. 2015-07-11 01:58:36 +02:00
Mounir IDRASSI 6ef41abdd2 Use Pim name for internal variables instead of the old name Pin 2015-07-11 01:58:34 +02:00
Mounir IDRASSI 7a01453f00 Windows: Fix old issue inherited from TrueCrypt by initializing COM library before instantiating UAC COM object used for changing password. This issue made it impossible to change the password of a volume requiring administrative privileges. 2015-07-08 22:16:04 +02:00
Mounir IDRASSI b809cf62ae Windows: Disable Set Key Header Algorithm item in "Volumes" menu when the system partition is selected by the user using "Select Device" 2015-07-08 22:16:01 +02:00
Mounir IDRASSI 0ddd19d4ab Windows: Disable menu item for changing system header key derivation algorithm until it's actually implemented 2015-07-07 08:13:34 +02:00
Mounir IDRASSI 6a78f7eae2 Windows: better logic for FormatEx function call. To be replaced in the future by Microsoft COM interfaces. 2015-07-06 01:19:23 +02:00
Mounir IDRASSI 724043be0b Windows: Display source location of errors in order to help diagnose issues reported by users 2015-07-06 01:19:21 +02:00
Mounir IDRASSI c3b77fba25 Linux: Support checking/reparing mounted filesystem on KDE when xterm not available 2015-07-04 17:48:20 +02:00
Mounir IDRASSI 218f63b4b6 Windows: re-size some controls to avoid text truncation. 2015-07-03 23:27:40 +02:00
Mounir IDRASSI b4b51bd909 Windows: Solve privacy issue inherited from TrueCrypt and linked to the update of configuration and history XML files everytime VeraCrypt main window is opened, even if there was no modifications. This could give information about the usage of VeraCrypt. Now, configuration and history XML files are updated only when there are modifications. 2015-07-03 02:12:28 +02:00
Mounir IDRASSI bef713de1a Language XML: Add newlines to PIM Help Text to make clearer for reading 2015-07-03 02:12:25 +02:00
Mounir IDRASSI 8f4b970dc1 Windows: Explicitly use internal PKCS#11 headers for building 2015-07-03 02:12:22 +02:00
Mounir IDRASSI 439e0a9588 Linux/MacOSX: Add dedicated PIM page in the volume creation wizard. Correct PIM value check logic. 2015-06-28 20:25:22 +02:00
Mounir IDRASSI da8aec4292 Linux: don't ask for PIM if TrueCryptMode enabled, both in command line and GUI 2015-06-26 22:07:17 +02:00
Mounir IDRASSI d73df9bbd4 Linux: if a keyfile is specified in the command line without a password, don't try to mount using an empty password unless its TrueCryptMode or an empty password has been explicitly specified. 2015-06-24 23:58:52 +02:00
Mounir IDRASSI d734ce4635 Linux/MacOSX: solve GUI layout issues although the volume creation wizard still has issues 2015-06-24 23:35:30 +02:00
Mounir IDRASSI 2cd39b37c2 Linux/MacOSX: restore normal file mode to some source files 2015-06-24 15:33:23 +02:00
Mounir IDRASSI ea27cace41 Linux: solve bug when "-tc" command line switch is not followed by another switch. In this case, the value coming after the "-tc" switch was ignored from processing. 2015-06-24 15:33:20 +02:00
Mounir IDRASSI 9913af3a8e Linux/MacOSX: first dynamic mode implementation 2015-06-24 15:33:16 +02:00
Mounir IDRASSI f927ce9b58 Windows: Add a dedicate page for volume PIM in the volume creation wizard 2015-06-21 20:47:01 +02:00
Mounir IDRASSI 5d9d49e989 Windows: in "VeraCrypt Format.exe", erase the volume PIM value after the process is finished to avoid displaying it again if the user starts a new creation process right after 2015-06-19 18:32:03 +02:00
Mounir IDRASSI d31466ae7a Windows: If PIM of a volume is changed and if it is a favorite or system favorite, automatically update favorite or system favorite XML file with the new value. 2015-06-19 18:31:59 +02:00
Mounir IDRASSI 7d55b028f2 Windows: Use "PIM" instead of "PIN" in favorites XML file 2015-06-19 18:31:53 +02:00
Mounir IDRASSI 44234a0ccc Windows installer: solve Windows XP 32-bit incompatibility issue introduced previously. 2015-06-12 00:01:12 +02:00
Mounir IDRASSI 6be12f4889 Windows: Implement waiting dialog for Auto-Mount Devices operations to avoid freezing GUI. 2015-06-10 01:13:56 +02:00
Mounir IDRASSI b7eadfd310 Windows: solve installer issue on Windows 10 caused by failure to overwrite VeraCrypt driver file. 2015-06-10 01:13:53 +02:00
Mounir IDRASSI a7a8d57bca Windows: rename PIN to PIM to avoid confusion. Better error messages. 2015-06-08 01:16:34 +02:00
Mounir IDRASSI 00cd134720 Windows: Add command line switch parameter for temporary caching of password during favorites mounting (/cache favorites). Correct implementation of "/cache y". 2015-06-08 01:16:29 +02:00
Mounir IDRASSI c3c1bdd29d Windows: Add support for PIN in favorites. Several enhancements to GUI handling of Dynamic Mode. 2015-06-07 01:38:34 +02:00
Mounir IDRASSI 550e2bcf3b Windows: fix buffer overrun issue when parsing language XML file 2015-05-31 08:09:46 +02:00
Mounir IDRASSI 57343ce04c Windows: reorder command line switched with alphabetical order for better help display 2015-05-29 02:22:12 +02:00
Mounir IDRASSI fdc2143bfa Windows: workaround FormatEx keeping references on formatted volume by adding extra delays. 2015-05-29 02:22:08 +02:00
Mounir IDRASSI 5867250820 Windows: Display VeraCrypt version information when the command line switch /help is used. 2015-05-29 02:22:05 +02:00
Mounir IDRASSI 70215e3682 Windows: GUI modifications around PIN field 2015-05-27 01:01:53 +02:00
Mounir IDRASSI 8ebf5ac605 Windows: first implementation of dynamic mode 2015-05-26 01:38:15 +02:00
Mounir IDRASSI 85e5e383f9 Windows: solve 64-bit compilation warnings after checking that they are harmless. 2015-05-26 01:38:11 +02:00
Mounir IDRASSI a8651ac014 Language files: update XML language files with new fields 2015-05-22 22:59:00 +02:00
Mounir IDRASSI 1c08ea01f1 Windows Setup: Integrate 64-bit builds of exe files into the installer. Only install 64-bit exe files on Windows 64-bit. This gives a boot in performance for encryption/decryption of partitions/drives on Windows 64-bit. 2015-05-22 22:58:55 +02:00
Mounir IDRASSI 0d23312886 Windows: Modifications to build 64-bit versions of VeraCrypt.exe & "VeraCrypt Format.exe". 2015-05-22 22:58:51 +02:00
Mounir IDRASSI c44c1ac9ce Windows: make random generator function compatible with 64-bit execution environment 2015-05-22 12:00:23 +02:00
Mounir IDRASSI 32ba1ebcff Windows: Correctly detect switch user and RDP disconnect as session locking so that autodismount could be performed when it's enabled in the preferences 2015-05-22 12:00:20 +02:00
Mounir IDRASSI 138d22a254 Windows: remove crash dump analysis functionality. It didn't always work and it required external debugging tools. 2015-05-22 12:00:17 +02:00
Mounir IDRASSI 330bed0c42 Windows: correct typo in help text 2015-05-22 12:00:13 +02:00
Mounir IDRASSI f72125ea71 Windows: First implementation of non-system volumes decryption. 2015-05-17 12:16:16 +02:00
Mounir IDRASSI 4695920b41 Language XML: Use correct links in displayed message. 2015-05-15 00:02:41 +02:00
Mounir IDRASSI e95c075f0c Windows driver: avoid race condition by using IoAttachDeviceToDeviceStackSafe instead IoAttachDeviceToDeviceStack. Set BootArgs.CryptoInfoLength to 0 after clearing boot memory. 2015-05-15 00:02:38 +02:00
Mounir IDRASSI 4a5154e750 Windows Driver: fix wrongly reported bad sectors by chkdsk caused by a bug in IOCTL_DISK_VERIFY. There was no real issue in sectors. 2015-05-10 01:26:18 +02:00
Mounir IDRASSI b3646b3237 Windows: Solve detection issue when resuming encryption. Add separate logic for manual selection of device and display error message in case of failure. 2015-05-06 23:31:37 +02:00
Mounir IDRASSI 061292130d Windows: When resuming in-place encryption, add manual selection of partition possible. Display wait dialog when performing detection. 2015-05-04 00:06:26 +02:00
Mounir IDRASSI d1c1aa369c Windows: Make the Format wizard work again when launched from VeraCrypt menu. 2015-05-03 15:47:31 +02:00
Mounir IDRASSI 7d52dda67c Windows Driver: Implement querying physical sector size of veraCrypt volume through IOCTL_STORAGE_QUERY_PROPERTY 2015-05-03 15:47:29 +02:00
Mounir IDRASSI 0f2d32f011 Windows: enable showing/hiding password for system encryption in Windows UI and in the bootloader (F5 key). This will be helpful to diagnose issues with non-US versions of Windows. 2015-05-03 15:47:25 +02:00
Mounir IDRASSI a1f1e34789 Windows: Modify custom window class names to less generic value in order to avoid collision with existing class names. 2015-05-03 15:47:22 +02:00
Mounir IDRASSI eac440ae9e Windows: Support A: and B: as driver letters for mounting volumes. 2015-04-27 23:59:53 +02:00
Mounir IDRASSI dc3bc64b86 Windows: Better command line handling to make it more strict and robust. This avoids issues when using wrong syntax. 2015-04-27 23:59:49 +02:00
Mounir IDRASSI 9ccb8a97af Linux: in command line, support hash algorithm names without '-' as on Windows ("sha256", "sha512", "ripemd160") 2015-04-26 00:05:22 +02:00
Mounir IDRASSI bf8e07966b Language XML: update German translation 2015-04-26 00:05:18 +02:00
Mounir IDRASSI 093fada00b Language XML: add new IDC_PREF_TEMP_CACHE_ON_MULTIPLE_MOUNT field to translations 2015-04-19 22:00:16 +02:00
Mounir IDRASSI 4890a65106 Windows: solve translation issue with IDM_DEFAULT_MOUNT_PARAMETERS menu item 2015-04-19 22:00:11 +02:00
Mounir IDRASSI 2ec75c5f8e Linux: Correct wxWidgets assert warnings when displaying about/LegalNotice dialogs. This didn't happen with official binaries because the library used disables asserts. 2015-04-19 16:31:28 +02:00
Mounir IDRASSI 29501638d1 Windows: lower position of "Never save history" checkbox to avoid wrong clicks 2015-04-19 16:12:57 +02:00
Mounir IDRASSI 856395962b Linux installer: Add support for kdesudo and correct usage of konsole external call. 2015-04-19 16:12:53 +02:00
Mounir IDRASSI bb2149aac8 Windows: add a test code-signing certificate and a batch file to sign binaries and the installer with it. 2015-04-11 00:32:20 +02:00
Mounir IDRASSI 8e4a68af3b MacOSX: Set properly the version in the bundle and the installation package. Allow downgrading using older installers. 2015-04-06 19:50:30 +02:00
Mounir IDRASSI 4a8040735b MacOSX: Correctly handle OSX dock "reopen-application" event and Cocoa openFiles message instead of the deprecated Carbon "open-document" event 2015-04-06 19:50:27 +02:00
Mounir IDRASSI ae28d51016 Linux/MaxOSX: correctly detect type of internal exceptions 2015-04-06 19:50:24 +02:00
Mounir IDRASSI 32f11001c0 MacOSX: solve issue volumes not auto-dismounting when quitting VeraCrypt. restore main VeraCrypt window if is in background when we need to display various dialogs 2015-04-06 19:50:21 +02:00
Mounir IDRASSI a0ebc22d1f Windows: update projects build dependencies in Visual Studio solution files 2015-04-06 06:16:43 +02:00
Mounir IDRASSI 9159a0777d Language: Update language XML files 2015-04-06 06:16:40 +02:00
Mounir IDRASSI 0718a4ec20 Increment VeraCrypt version to 1.0f-2 2015-04-06 00:22:48 +02:00
Mounir IDRASSI f2cda804dc Update user guide PDF 2015-04-06 00:22:45 +02:00
Mounir IDRASSI b68fec97ea Windows: Require upgrading rescue disk since we changed bootloader in 1.0f-2 2015-04-06 00:22:42 +02:00
Mounir IDRASSI eefaefccc0 Windows: use secure string functions 2015-04-06 00:22:39 +02:00
Mounir IDRASSI 2784652ab8 Windows vulnerability fix: CryptAcquireContext vulnerability fix. Add checks to random generator to abort in case of error and display a diagnose message to the user. 2015-04-06 00:22:36 +02:00
Mounir IDRASSI a284922ce4 Linux/MacOSX: Always add the source location when system exception occur in order to help diagnose users issues. 2015-04-05 14:25:15 +02:00
Mounir IDRASSI c4d30b34ba Linux/MacOSX: correctly handle some internal exception classes that were missed by the WaitDialog class. 2015-04-05 14:25:12 +02:00
Mounir IDRASSI a5203dd006 Windows Setup: Avoid potential issues by correctly initializing variables and checking memory allocation. 2015-04-05 14:25:09 +02:00
Mounir IDRASSI 474505d704 Linux: solve mount point permission issues for some users where the non-FAT volumes were only mounted in read-only mode 2015-03-23 09:07:58 +01:00
Mounir IDRASSI d3db2548b5 Windows: correctly handle WIN32 LastError when mounting. Harmonize file access checks between GUI and console. Skip ERROR_SHARING_VIOLATION in primary check in order to let the driver handle it more thoroughly. 2015-03-19 00:16:38 +01:00
Mounir IDRASSI f397f70fbe Windows Setup: When clicking uninstall link, launch Windows Add/Remove program instead of uninstall directly in order to avoid being flagged as legacy application by the Windows Program Compatibility Assistant (see number 5 in Microsoft UI Design Standard https://msdn.microsoft.com/en-us/library/ms954377.aspx) 2015-03-17 22:13:52 +01:00
Mounir IDRASSI ae5867f8b1 Windows Setup: remove other VeraCrypt references for registry. 2015-03-16 08:45:19 +01:00
Mounir IDRASSI ec4be21492 Windows Setup: implement removal of special LEGACY_VERACRYPT registry keys. 2015-03-15 23:46:12 +01:00
Mounir IDRASSI ed604cf0f3 Windows: VeraCrypt reference from various registry locations. Uninstall old VeraCrypt COM interfaces that were left after upgrading. 2015-03-13 18:09:21 +01:00
Mounir IDRASSI ef196b5ca5 Add Coverity define to avoid false positives during Static Code Analysis when TC_THROW_FATAL_EXCEPTION is used in the code 2015-03-08 20:14:33 +01:00
Mounir IDRASSI 279c99fdf8 Linux/MacOSX: Load preferences if only volume path is given in command line and GUI mode enabled. 2015-03-08 20:14:30 +01:00
Mounir IDRASSI f80f7d47d5 Windows: Avoid temporary caching password when mounting multiple favorites. Add option to activate this if needed. 2015-03-04 00:27:04 +01:00
Mounir IDRASSI 8e6707cc22 Windows: if TrueCrypt volume created with a version prior to 6.0, display this version in the error message to help users understand why it is not working. 2015-03-02 00:23:58 +01:00
Mounir IDRASSI f09f8e3a31 Windows Bootloader: Display message after entering password to inform user that the password is being processed. Without this, users coming from TrueCrypt think that the system is freezed since they expect it to boot quickly. 2015-03-02 00:23:55 +01:00
Mounir IDRASSI 21be04cb6e Update test containers and benchmark script to support hidden containers and measure wrong password time 2015-02-28 22:47:41 +01:00
Mounir IDRASSI ba1e9c8f4d Linux/MacOSX: A configuration option for default hash and default TrueCrypt mode used for mounting volumes (Menu Settings -> Default Mount Parameters). Implement priority of command line arguments over default values. 2015-02-28 17:03:38 +01:00
Mounir IDRASSI 6e73a8a393 Linux/MacOSX: Modify wxFormBuilder generated files directly to solve the 'X' icon not closing some dialog because we can't workaround wxFormBuilder bug without introducing other issues (the correct SetExtraStyle call must be present at the beginning of the constructor, so it must be present in the generated files). Each time we generated new sources, Forms.cpp must be manually modify it to keep this correction. 2015-02-27 18:07:36 +01:00
Mounir IDRASSI 176bec1bb2 Revert "Linux/MacOSX: solve the 'X' icon not closing some dialog. This was caused by a bug of wxFormBuilder that calls SetExtraStyle without taking care of the previous value."
This reverts commit 400fd599f812b057b0674f2ae0e0141e7c35a332.
2015-02-27 18:07:33 +01:00
Mounir IDRASSI 31b238872e Readme.md: indicate that on MacOSX building a console-only binary is not supported. 2015-02-25 22:57:15 +01:00
Mounir IDRASSI b730e965c5 Readme.txt: indicate that on MacOSX building a console-only binary is not supported. 2015-02-25 22:54:39 +01:00
Mounir IDRASSI a916135f3c Windows: Use default hash in the options of hidden volume protection 2015-02-25 09:09:03 +01:00
Mounir IDRASSI b2020c9fb7 Language XML: change the wording of password error messages to reflect the possibility of a wrong PRF. Replace "VeraCrypt volume" by "valid volume" since TrueCrypt is also supported. 2015-02-24 12:11:55 +01:00
Mounir IDRASSI 188b459d28 Windows: remove topmost and system modal properties from the wait dialog so that it doesn't disturb other applications. 2015-02-24 00:41:59 +01:00
Mounir IDRASSI 39bf211ebe Add test containers and Windows benchmark script for mount performance 2015-02-24 00:41:56 +01:00
Mounir IDRASSI 06af5ce7fd Windows: check password length for outer volume during hidden volume creation to avoid potential plausible deniability issues. 2015-02-22 21:29:42 +01:00
Mounir IDRASSI 7fb5af6ada Windows: Add menu option to set default hash and default TrueCrypt mode used for mounting volumes (Menu Settings -> Default Mount Parameters) 2015-02-22 01:03:22 +01:00
Mounir IDRASSI cb9859fa0e Speed and memory usage optimization for key derivation based on patches by Nils Maier. 20% improvement on 64-bit CPU for SHA512 and SHA256, 11% for Whirlpool and 13% for RIPEMD-160. 2015-02-22 01:03:19 +01:00
Mounir IDRASSI 717ffadf93 Windows Installer: don't add link to VeraCryptExpander in the desktop. 2015-02-16 00:19:39 +01:00
Mounir IDRASSI 419586d4a2 Language: update German XML with translation contributed by H. Sauer 2015-02-16 00:19:37 +01:00
Mounir IDRASSI 450cde5fac Language: update French translation (contributed by Thierry T.) 2015-02-16 00:19:34 +01:00
Mounir IDRASSI b2d119f781 Language: Update language XML files with new added fields 2015-02-16 00:19:32 +01:00
Mounir IDRASSI 7818c0e0e3 Window: add menu entry for launching VeraCryptExpander 2015-02-16 00:19:28 +01:00
Mounir IDRASSI 86529dadde Linux/MacOSX: solve the 'X' icon not closing some dialog. This was caused by a bug of wxFormBuilder that calls SetExtraStyle without taking care of the previous value. 2015-02-16 00:19:24 +01:00
Mounir IDRASSI 544c55debc Linux: Perform a quick NTFS formatting by adding the "-f" switch to mkfs.ntfs. Without this, the creation of big NTFS volumes takes ages. The code already takes care of the empty sectors by encrypting them with different key to randomize plaintext. 2015-02-13 16:18:00 +01:00
Mounir IDRASSI 2b826843de Windows: Add VeraCryptExpander.exe to the Windows installer. 2015-02-13 12:31:16 +01:00
Mounir IDRASSI b920bb2a6a Linux: modify installer script to make it run when the "less" command doesn't support the -X argument (Busybox case) 2015-02-11 09:02:41 +01:00
Mounir IDRASSI 5012e0941a Linux: Add graphical installer support when xterm is not available (Linux Mint case) 2015-02-10 12:45:36 +01:00
Mounir IDRASSI 1eb8aec9fa Language: update German translation (contributed by H.S.) 2015-02-10 12:45:33 +01:00
Mounir IDRASSI 2b8aa2df16 Windows: Solve PIN blocked issue when trying to mount a volume right after configuring the PKCS#11 module. Always ensure that we are using a valid window handle as a parent. 2015-02-09 11:01:26 +01:00
Mounir IDRASSI 5f252f2c50 Static Code Analysis: check return of remove function and display message when it fails. 2015-02-09 11:01:23 +01:00
Mounir IDRASSI d5f34ad49d Static Code Analysis: Avoid over-flaw in arithmetic operations by adding more checks. Add extra checks. Solve various issues. 2015-02-09 11:01:21 +01:00
Mounir IDRASSI 608e86c7bc Static Code Analysis: solve issues in Expander. Use real random values for wipe buffers. 2015-02-09 11:01:18 +01:00
Mounir IDRASSI 516da2229d Static Code Analysis: in Windows Driver, avoid using uninitialized stack memory as random and use proper random value for wipe operation. Solve potential double-free issue. 2015-02-09 11:01:16 +01:00
Mounir IDRASSI 28a9eaf0e3 Static Code Analysis: code potential memory leaks in inflate.c used by the setup. 2015-02-09 11:01:13 +01:00
Mounir IDRASSI de0c30dded Static Code Analysis: handle unused variables more properly. Catch STL exception. Add more checks. Add proper cast to arithmetic operations. 2015-02-09 11:01:11 +01:00
Mounir IDRASSI 1ab00f3e3c Static Code Analysis: Correct memory leaks. Add more checks. 2015-02-09 11:01:08 +01:00
Mounir IDRASSI 651bea29b4 Static Code Analysis: clarify macros definition and use. 2015-02-09 11:01:06 +01:00
Mounir IDRASSI 4e03adc2e7 Static Code Analysis: Add more checks. Avoid unhandled ATL exceptions by checking memory allocation. Avoid throwing exception in File constructor and simplify code. 2015-02-09 11:01:03 +01:00
Mounir IDRASSI d1a3316e44 Linux: solve rare issue where VeraCrypt wrongly reports that another instance is already running. That happens when VeraCrypt doesn't close cleanly upon shutdown/reboot and on the next startup another process is running with the same PID as VeraCrypt before shutdow/reboot. 2015-02-08 17:57:00 +01:00
Mounir IDRASSI 2c96d17748 Linux/MacOSX: mark RIPEMD-160 as deprecated like it's the case on Windows. It will no more be available for the creation of volumes. 2015-02-08 16:20:40 +01:00
Mounir IDRASSI ad4af09d88 Linux: When not under Gnome/KDE, use xdg-open to open the mounted volume if it is available. 2015-02-08 16:20:37 +01:00
Mounir IDRASSI 96b39a5973 Windows: retry UAC prompt operation in case of failure. This avoids cancel the whole operation if the user is not in front of the machine during UAC prompt (this happens ofter during in-place encryption of big NTFS partitions). 2015-02-08 10:07:44 +01:00
Mounir IDRASSI b16cfa959d Windows: rename VeraCryptExpander project in the global solution 2015-02-08 10:07:41 +01:00
Mounir IDRASSI f98a691933 Windows Setup: implement removal of non-empty directories to avoid errors during uninstall. 2015-02-08 10:07:38 +01:00
Mounir IDRASSI 35497f87a7 Activate support of mounting TrueCrypt system partitions. 2015-02-08 10:07:36 +01:00
Mounir IDRASSI d01fa11983 Linux/MacOSX: use command line values of TrueCryptMode and PRF as defaults for the password dialog 2015-02-08 10:07:33 +01:00
Mounir IDRASSI 3d8d088b06 Windows: use command line values of TrueCryptMode and PRF as defaults for the password dialog 2015-02-08 10:07:30 +01:00
Mounir IDRASSI 89a9763b11 Windows: Correct displaying wrong TrueCrypt mode in volume properties when SHA-256 is used. Issue reported and fixed by user Ache on CodePlex (https://veracrypt.codeplex.com/workitem/65) 2015-01-23 01:41:31 +01:00
Mounir IDRASSI 1efb782666 Windows: Add first version of VeraCryptExpander who is based on extcv. Minor modification to Mount.c to avoid link errors when building VeraCryptExpander. 2015-01-20 12:42:04 +01:00
Mounir IDRASSI 38f3fc816a Windows: use the same waiting message in dialog resource as it is in the language XML file. 2015-01-20 12:41:55 +01:00
Mounir IDRASSI 3794df4f31 Update the FAQ section of the user guide to include TrueCrypt support information. 2015-01-06 00:19:03 +01:00
Mounir IDRASSI 3502681f77 Clarify the waiting dialog message. 2015-01-05 23:08:38 +01:00
Mounir IDRASSI 8252cc3ec7 Linux/MacOSX: Add support for TrueCrypt 6.x as it was done on Windows. 2015-01-04 23:59:22 +01:00
Mounir IDRASSI 6a254778e2 Linux/MacOSX: Add wait dialog to the benchmark computation. Correct handling of wait dialog call when changing password and creating volumes. 2015-01-04 23:53:35 +01:00
Mounir IDRASSI 41607d126a Linux/MacOSX: make the cancel button work on the preferences dialog. 2015-01-04 19:28:42 +01:00
Mounir IDRASSI f53554a46a Increment version to 1.0f-1 and update language files and PDF with information about TrueCrypt 6.0 support. 2015-01-04 16:29:40 +01:00
Mounir IDRASSI 03e64e842a Language XML: correct error message to show that we support TrueCrypt 6.0 and above. 2015-01-04 16:29:36 +01:00
Mounir IDRASSI 2894bade88 Windows: better display of volume information and benchmark results. 2015-01-04 16:29:34 +01:00
Mounir IDRASSI cc02c78a8c Windows Driver: add TrueCrypt mode of mounted volumes to the output of TC_IOCTL_GET_MOUNTED_VOLUMES 2015-01-04 16:29:31 +01:00
Mounir IDRASSI 4f56a0a53d Windows: Add support for TrueCrypt 6.x since its format (v4) is identical to 7.x apart from the sector size field which we already handle correctly. 2015-01-04 16:29:29 +01:00
Mounir IDRASSI cbc28bd4fe Linux/MacOSX: change cascade encryption naming format in the UI as it was done on Windows. 2015-01-04 00:55:36 +01:00
Mounir IDRASSI 9a31c23881 Linux/MacOSX: workaround for wxWidgets bug in the method wxTextEntry::IsEmpty that made it impossible to enter a one digit size for the volume. 2015-01-03 23:54:12 +01:00
Mounir IDRASSI 55b3400afa Windows: change cascade encryption naming format to reflex mathematical composition of the encryption algorithm, thus being more clear. For example AES(Twofish(Serpent)) instead of AES-Twofish-Serpent. 2015-01-03 23:54:09 +01:00
Mounir IDRASSI 8f5fd67ff3 Windows: solve XP issue where the installer has missing/blacked out text boxes. 2015-01-03 00:29:02 +01:00
Mounir IDRASSI ad9b40d599 Linux: solve link error on recent Ubuntu when using shared wxWidgets. 2015-01-02 17:12:36 +01:00
Mounir IDRASSI 271d39d942 User Guide: add documentation for /hash command line switch on Windows that is used to specify the PRF of a volume. 2015-01-02 17:12:34 +01:00
Mounir IDRASSI 696166c9d4 Readme: add makeself to the build requirements for Linux. 2015-01-02 14:55:04 +01:00
Mounir IDRASSI aba8840625 Update the user guide with new screenshots and an entry for TrueCrypt compatibility 2014-12-31 01:01:14 +01:00
Mounir IDRASSI ac981c62c5 Increment version to 1.0f and update language XML files with new fields. 2014-12-31 01:01:11 +01:00
Mounir IDRASSI 41c12afefd Windows driver: don't fail if the PRF recovered from boot memory is not recognized in case we are dealing with a restored bootloader coming from a version prior to 1.0f. 2014-12-30 22:31:37 +01:00
Mounir IDRASSI 7c050d681d Linux/MacOSX: code refactoring and cleanup. 2014-12-30 19:57:08 +01:00
Mounir IDRASSI c178e325b8 Linux/MacOSX: Implement TrueCrypt conversion and loading support. Correct many GTK issues linked to multi-threaded origine of events by implementing an automatic mechanism for handling such requests in the main thread. 2014-12-30 17:06:20 +01:00
Mounir IDRASSI 8d787dcd71 Windows: propose only hash algorithm that support system encryption when the user select the option to a partition as an encrypted system partition. 2014-12-28 23:27:59 +01:00
Mounir IDRASSI 25c3d15ed7 Windows: support loading TrueCrypt volumes. Implement converting TrueCrypt volumes to VeraCrypt using the change password functionality. 2014-12-28 23:27:56 +01:00
Mounir IDRASSI ec9ff0fc1d Windows: make the wait dialog wider to accommodate long messages 2014-12-28 23:27:53 +01:00
Mounir IDRASSI 9a228ff045 Windows: use the selected hash algorithm when resuming interrupted process. This reduces volume opening time. 2014-12-28 23:27:51 +01:00
Mounir IDRASSI a8cc93f995 Windows: implement wait dialog for benchmark operation. 2014-12-28 23:27:48 +01:00
Mounir IDRASSI 2b1a166d23 Linux/MacOSX: Add possibility to choose 1-pass wipe mode without changing the default wipe mode (3-pass). 2014-12-28 23:27:46 +01:00
Mounir IDRASSI a27792cfcf Windows: Add possibility to choose 1-pass wipe mode in all cases without changing the default wipe mode. 2014-12-28 23:27:43 +01:00
Mounir IDRASSI e18f3cf381 Windows: use the correct parent window when changing the password of the encrypted system partition. 2014-12-27 13:39:26 +01:00
Mounir IDRASSI f4c864e88e Windows: implement wait dialog for the backup/restore header operations. 2014-12-27 13:39:24 +01:00
Mounir IDRASSI a8112b8373 Windows: use the correct window handle for creating message boxes. This became important after the introduction of the wait dialog in order to avoid having message boxes behind the wait dialog. 2014-12-27 13:39:22 +01:00
Mounir IDRASSI 2dbbd6b9d2 Windows: implement wait dialog for the change password operation. 2014-12-27 13:39:18 +01:00
Mounir IDRASSI c92d51e040 Windows: make the wait dialog mechanism more generic in order to reuse it more widely across VeraCrypt. 2014-12-27 13:39:16 +01:00
Mounir IDRASSI 258ba629a2 Windows: workaround freezing of waiting dialog but setting its parent to the desktop and making all mount calls in a separate thread. DeviceIoControl is making our like hard because it doesn't behave as a normal system call and it blocks our window message loop even when called from a separate thread. 2014-12-26 16:55:21 +01:00
Mounir IDRASSI d90d9f0c40 Linux/MacOSX: Implement waiting dialog for lengthy operations in order to have a better user experience. 2014-12-26 00:51:52 +01:00
Mounir IDRASSI bbcc944855 Windows: resize hot keys dialog to avoid displaying scroll-bars. 2014-12-22 01:02:55 +01:00
Mounir IDRASSI e1157ea935 Windows: Solve issue of some dialogs not showing up and that was caused by wrong handling of WM_NOTIFY messages. This behavior appeared after switching to Windows visual styles. 2014-12-22 01:02:53 +01:00
Mounir IDRASSI 9267450346 MacOSX: Increment installer version to 1.0f-BETA3 2014-12-21 00:30:23 +01:00
Mounir IDRASSI bb5e96a679 Linux: update the embedded data index inside the installer because the license content became bigger. 2014-12-20 22:36:10 +01:00
Mounir IDRASSI b8373ae933 Linux: Update license file displayed in the installer. 2014-12-20 21:38:07 +01:00
Mounir IDRASSI 5ef923f26c Increment version to 1.0f-BETA3 and update language XML files with new fields. 2014-12-20 19:33:55 +01:00
Mounir IDRASSI 7a89f0f0e1 Linux/MacOSX: Add a donation menu entry 2014-12-20 17:37:36 +01:00
Mounir IDRASSI 496701851f Linux/MacOSX: remove calls to non existent class VolumeLayoutV1Hidden 2014-12-20 15:48:00 +01:00
Mounir IDRASSI 4b9f8b232b Reduce time for reporting wrong password by removing support for legacy hidden format because it was never functional and it was superseded by current hidden format. 2014-12-20 15:31:24 +01:00
Mounir IDRASSI 02cbecff64 Windows: Add a donation menu entry 2014-12-20 15:31:22 +01:00
Mounir IDRASSI fbe1bbaffd Windows: Add missing PRF selection combobox in password page of Format program wizard. 2014-12-20 10:12:37 +01:00
Mounir IDRASSI 94737b2a7a Windows: change command line switch for PRF selection to /hash in order to match its value on Linux/MacOSX. Support hash names with and without the '-' character. 2014-12-19 18:41:43 +01:00
Mounir IDRASSI 07156b6c09 Linux/MacOSX: Enhance performance by implementing the possibility to choose the correct hash algorithm of volumes during various operations (mount, change password...), both using the GUI and the command line. 2014-12-19 18:41:41 +01:00
Mounir IDRASSI 18dc75ee62 Correct small typo in language XML file. 2014-12-19 15:25:53 +01:00
Mounir IDRASSI a3f7bcf45b Windows: replace stricmp by _stricmp to remove compilation warning 2014-12-17 12:15:01 +01:00
Mounir IDRASSI c98400a2b7 Windows: in silent mode, don't show the wait dialog during mount operation 2014-12-17 12:14:59 +01:00
Mounir IDRASSI 5b151492bd Windows: Remove Truecrypt name is error message. 2014-12-17 12:14:58 +01:00
Mounir IDRASSI c27461572c Windows: Enhance performance by implementing the possibility to choose the correct hash algorithm of volumes during various operations (mount, change password...). In case of system encryption, slightly speedup Windows startup time by making the driver pickup the correct hash algorithm used for the encryption. 2014-12-16 00:17:59 +01:00
Mounir IDRASSI 6349162303 Windows: display a wait dialog during the lengthy opening of a volume. There is still a freeze in the GUI even though the call to DeviceIoControl is done in a separate thread which can't be explained. Maybe if we had an asynchronous Device Driver call, things would better. 2014-12-16 00:17:57 +01:00
Mounir IDRASSI e935ec55dd Windows: Enable Visual Styles for a modern look-and-feel 2014-12-16 00:17:55 +01:00
Mounir IDRASSI d328269492 Linux/macOSX: always display random gathering dialog/interface before performing sensitive operations that needs good quality random. 2014-12-11 18:31:41 +01:00
Mounir IDRASSI 134ef04140 Windows: always display random gathering dialog when UserEnrichRandomPool is called instead of once per application run. This is implemented through the call SetRandomPoolEnrichedByUserStatus(FALSE) at the begining of sensitive operations instead of changing UserEnrichRandomPool because in the same call there can be many calls to UserEnrichRandomPool which can result in displaying the dialog many times. 2014-12-11 18:31:39 +01:00
Mounir IDRASSI c8c8cc517d Linux/MacOSX: Implement generating more than one keyfile, specifying the size of the generated keyfiles and letting VeraCrypt choose random size values. 2014-12-11 18:31:38 +01:00
Mounir IDRASSI e673006969 Update license text to show VeraCrypt name while maintaining the TrueCrypt license. 2014-12-11 18:31:35 +01:00
Mounir IDRASSI 520d885840 Correct XML syntax for symbols '<' and '>' 2014-12-11 18:31:34 +01:00
Mounir IDRASSI eb9cb16aeb Windows: Implement specifying the size of the generated keyfiles and also letting VeraCrypt choose random size values. 2014-12-11 18:31:32 +01:00
Mounir IDRASSI 32e72d1117 Implement function RandgetBytesFull that enables generating random bytes of any length. 2014-12-11 18:31:30 +01:00
Mounir IDRASSI fd0e434087 Windows: correct lock issue in RandgetBytes by releasing critical section in case of error. 2014-12-11 18:31:29 +01:00
Mounir IDRASSI 84a279a83f Windows Driver: change inherited TrueCrypt constants in kernel objects tags by VeraCrypt specific values. These are used in crash dumps analysis and during debugging. 2014-12-11 18:31:27 +01:00
Mounir IDRASSI 9a6b371c96 MacOSX/Linux: Solve truncated text in some Wizard windows by defining a large enough minimum size. 2014-12-07 22:40:27 +01:00
Mounir IDRASSI 078614fbce Windows: Implement creation of multiple keyfiles at once. 2014-12-07 22:40:25 +01:00
Mounir IDRASSI ec327c006e Windows: implement auto-dismount option when session is locked 2014-12-07 22:40:23 +01:00
Mounir IDRASSI 03afe1224a Windows: correct issue in handling "More information on keyfiles" link that caused a crash on some machines 2014-12-04 13:47:37 +01:00
Mounir IDRASSI 11013ce71e Linux/macOSX: handle project URLs using the new values 2014-12-04 13:47:35 +01:00
Mounir IDRASSI a185b540bd Windows: put back the tutorial prompt since we now have online documentation. 2014-12-04 13:47:33 +01:00
Mounir IDRASSI a5df5d981a Windows: correct issue in displaying PDF of User Guide. 2014-12-04 13:47:31 +01:00
Mounir IDRASSI dfff927389 Windows: update URLs to points to the online documentation. Use a dedicated donation link. 2014-12-04 13:47:30 +01:00
Mounir IDRASSI e6ebc63c66 Update VeraCrypt User Guide 2014-12-01 00:34:16 +01:00
Mounir IDRASSI f31c7b3a88 Add test vectors for HMAC-SHA256 and PBKDF2-HMAC-SHA256 2014-12-01 00:34:13 +01:00
Mounir IDRASSI bc9005968a Windows: Avoid calling RegCloseKey on an invalid handle. 2014-11-11 19:25:05 +01:00
Mounir IDRASSI b2438b5029 Windows: close file handle if the call to GetFileSize fails. 2014-11-10 23:11:12 +01:00
Mounir IDRASSI 51fa86b246 Copy license file to the top of git repository 2014-11-08 23:59:26 +01:00
Mounir IDRASSI b5dfe9c9ed Add copy of src/Reader.txt to make Github happy 2014-11-08 23:42:51 +01:00
Mounir IDRASSI c3353c71d4 Readme: Add more MacOSX specific details concerning the build of VeraCrypt following users feedback 2014-11-08 23:24:59 +01:00
Mounir IDRASSI de93034485 MacOSX: add shell script to perform build under MacOSX 2014-11-08 23:24:57 +01:00
Mounir IDRASSI f1a596109b Linux/MacOSX: solve compilation warning by explicitly converting wxCStrData to (const wchar_t*) 2014-11-08 23:24:54 +01:00
Mounir IDRASSI 2c6e9fc15c Replace deprecated wxTextValidator::SetBellOnError whose logic whose inverted by the new wxTextValidator::SuppressBellOnError. Since its used in constructor only for TC_WINDOWS, we do the same in the destructor. 2014-11-08 23:24:51 +01:00
Mounir IDRASSI ce7fab744b MacOSX: fix warning by displacing declaration of variable used only under Linux 2014-11-08 23:24:49 +01:00
Mounir IDRASSI 65e4b3a91b Remove unused functions from GfMul.c 2014-11-08 23:24:46 +01:00
Mounir IDRASSI 2cdfbd2703 Linux/MacOSX: Remove static size values from GUI in order to let wxWidgets calculate the best size (the "Fit" method ensure this). Fix truncation of text is some dialogs. 2014-11-08 23:24:44 +01:00
Mounir IDRASSI 81b9e28993 Linux: Add shell script to perform VeraCrypt full build 2014-11-08 23:24:41 +01:00
Mounir IDRASSI d7498fae01 Linux/MacOSX: add newline at the end of Pkcs5.c to remove gcc warning 2014-11-08 23:24:38 +01:00
Mounir IDRASSI 3c471383d9 Linux/MacOSX: adapt code to the changes in PRF functions prototypes 2014-11-08 23:24:36 +01:00
Mounir IDRASSI 0a09314336 Correct typo in language XML file. 2014-11-08 23:24:33 +01:00
Mounir IDRASSI b0bb124772 Bootloader: reduce the size of Serpent implementation when used as the single cipher. We need this because to save space for the new features to come. 2014-11-08 23:24:30 +01:00
Mounir IDRASSI f7d8e565b4 Windows Driver Sanity check: check that the password length passed from the bootloader is less than or equal to 64 before using it. 2014-11-08 23:24:27 +01:00
Mounir IDRASSI 3f2e20e339 Simplify code handling iterations count: in boot mode, we'll set the correct iterations count inside derive_u_sha256 and derive_u_ripemd160 depending in the value of the iterations parameter. On normal mode, we use normal values of iterations count. Removes the special test parameter from RIPEMD160 functions. 2014-11-08 23:24:25 +01:00
Mounir IDRASSI 714a2ce0ae Bootloader: in function ReadVolumeHeader, arrays dk and masterKey have the same size and they are never needed at the same time. So, we can minimize stack memory usage by using only one array instead of two. At the end of the function, the array is erased securely. 2014-11-08 23:24:22 +01:00
Mounir IDRASSI c1378f781a Bootloader: optimize code size in single cipher mode by manually inlining EAInit, EAGetFirst and EAGetKeySize, and by removing the loop in ReadVolumeHeader that tests for encryption algorithms. 2014-11-08 23:24:19 +01:00
Mounir IDRASSI c61f8c70de Bootloader code optimization: remove code in HMAC implementation in case of boot compilation that is never called since passwords are always less than 64-byte length. We leave it in Windows compilation because it is used to check the implementation against test vectors. 2014-11-08 23:24:17 +01:00
Mounir IDRASSI e1a0826ef5 Linux: remove workaround for wxFileType::GetOpenCommand bug in handling path with spaces because it was fixed in wxWidgets 3.0 and this workaround causes problems. 2014-11-08 23:24:14 +01:00
Mounir IDRASSI 9c1ddff7e3 Linux: Support NTFS formatting of volume. We use mkfs.ntfs so it needs to be installed on the system. 2014-11-08 23:24:11 +01:00
Mounir IDRASSI ea03100d9e Linux/MacOSX : fix encryption/decryption issues with hard drives that have a sector size bigger than 512. Now, we use the sector size as the minimum unit for data fragment encryption/decryption. 2014-11-08 23:24:09 +01:00
Mounir IDRASSI 067394d110 MacOSX : Support hard drives with a large sector size ( > 512). 2014-11-08 23:24:06 +01:00
Mounir IDRASSI f05f6a00a6 Integrate SHA-256 support into Linux/MacOSX code. Set PRF priority to SHA-512 -> Whirlpool -> SHA-256 -> RIPEMD-160 . 2014-11-08 23:24:03 +01:00
Mounir IDRASSI 905a3ff4a5 Small code size optimization for RIPEMD-160 when compiled for boot encryption. 2014-11-08 23:24:01 +01:00
Mounir IDRASSI 922a09b634 Use HashForSystemEncryption to check if the algorithm is supported for system partition encryption because we have now two supported algorithms. 2014-11-08 23:23:58 +01:00
Mounir IDRASSI f043e6cbf0 Display only allowed hashes when encrypting the system partition (now, SHA-256 and RIPEMD-160). 2014-11-08 23:23:56 +01:00
Mounir IDRASSI 68f16dae24 Implement support for creating and booting encrypted partition using SHA-256. Support SHA-256 for normal volumes as well. 2014-11-08 23:23:53 +01:00
Mounir IDRASSI f38cf0b694 Add support for SHA-256 in key derivation for bootloader encryption. Create separate bootloader images for SHA-256 and RIPEMD-160. Set SHA-256 as the default PRF for boot encryption and SHA-512 as default PRF for all other cases. Depricate RIPEMD-160. 2014-11-08 23:23:50 +01:00
Mounir IDRASSI bd7d151abf Add SHA-256 source specific for upcoming bootloader build because of its small size. It was derived from the libtomcrypt public domain source. 2014-11-08 23:23:48 +01:00
Mounir IDRASSI 2fe23a3fa3 Correctly support reinstalling the same version. Overwrite the bootloader if the same version detected. 2014-11-08 23:23:45 +01:00
Mounir IDRASSI effb5c7c1e Windows vulnerability fix : finally make bootloader decompressor more robust and secure by adding multiple checks and validation code. This solves the issue found by the Open Crypt Audit project. Note that we had to switch to the slow implementation of the function decode in order to keep the size of the decompressor code under 2K. 2014-11-08 23:23:42 +01:00
Mounir IDRASSI 50ca9fe46f Optimization to reduce code size of derive_u_ripemd160. Useful for boatloader. 2014-11-08 23:23:40 +01:00
Mounir IDRASSI 0178a6d33f Optimize code space and solve the Serpent issue (https://sourceforge.net/p/veracrypt/discussion/technical/thread/fb09633a/#6406) by removing key length parameter from serpent_set_key and twofish_set_key 2014-11-08 23:23:37 +01:00
Mounir IDRASSI 411e8599f3 Call RegCloseKey only if handle is valid. 2014-11-08 23:23:34 +01:00
Mounir IDRASSI b80ee2b7b9 Windows : display the correct tray icon when explorer is restarted (i.e. after an explorer crash). 2014-11-08 23:23:31 +01:00
Mounir IDRASSI 8a028aca45 Use absolute path in ShellExecute call that was missed when the security fix for Microsoft Security Advisory 2269637 was implemented. 2014-11-08 23:23:28 +01:00
Mounir IDRASSI fb12b635ed Update Readme.txt to include more accurate build instructions for Linux and MacOSX 2014-11-08 23:23:25 +01:00
Mounir IDRASSI d761e95133 MacOSX : increment MacOSX installer version to 1.0e 2014-11-08 23:23:22 +01:00
Mounir IDRASSI f7d783dda8 Adapt certain functions in the case of Windows bootloader in order to make its size as small as possible. 2014-11-08 23:23:19 +01:00
Mounir IDRASSI ccbc2cff0b Increment version to 1.0e for the next release 2014-11-08 23:23:17 +01:00
Mounir IDRASSI 809394d383 Include language xml files in the setup 2014-11-08 23:23:13 +01:00
Mounir IDRASSI 7c501359b3 Windows vulnerability fix: correct some integer overflow issues using the IntSafe library. Detected by the Open Crypto Audit project 2014-11-08 23:23:10 +01:00
Mounir IDRASSI f82e16f0a1 Windows vulnerability fix: correct checking device name to avoid possible bypass attack detected by the Open Crypto Audit project 2014-11-08 23:23:08 +01:00
Mounir IDRASSI 4fa4d6d227 Windows vulnerability fix: correct possible BSOD attack targeted towards GetWipePassCount() / WipeBuffer() found by the Open Crypto Audit Project. 2014-11-08 23:23:05 +01:00
Mounir IDRASSI e0efb36f33 Revert previous modification on boad-loader decompressor because it increased its size and it became impossible to include it with the SERPENT version of bootloader. The decompressor and the compressed bootloader are copied twice (original and backup) in the 63 first sectors of the hard drive (32K), thus the size limitation.
This reverts commit 154235d589222e3c31cda05aa53e73ab69a89a6e.
2014-11-08 23:23:02 +01:00
Mounir IDRASSI ef4355acf8 Windows vulnerability fix : make boot-loader decompressor more robust and secure by adding multiple checks and validation code. Note that we had to switch to the slow implementation of the function decode in order to keep the size of the decompressor code under 2K. 2014-11-08 23:22:59 +01:00
Mounir IDRASSI 5fcb262539 Windows vulnerability fix : clear sensitive data in Windows kernel driver by using burjn instead of memset 2014-11-08 23:22:57 +01:00
Mounir IDRASSI d6aa653648 Windows vulnerability fix : avoid kernel pointer disclosure through a call to TC_IOCTL_GET_SYSTEM_DRIVE_DUMP_CONFIG but restricting this call to Kernel Mode. 2014-11-08 23:22:54 +01:00
Mounir IDRASSI 6de2c143b9 Windows : Specify "IDRIX" in signtool for the subject of the code signing certificate. 2014-11-08 23:22:51 +01:00
Mounir IDRASSI 9083f95db0 Remove driver version test that is non application to VeraCrypt and that was wrongly inherited from TrueCrypt. 2014-11-08 23:22:49 +01:00
Mounir IDRASSI 03cf7cc566 Correctly handle dialogs from previous versions that used 'TRUE' instead of 'VERA' as a value for GWLP_USERDATA. 2014-11-08 23:22:46 +01:00
Mounir IDRASSI f158df394e Windows : correct bug in construction of Format.exe path that prevented the new volume wizard to launch. 2014-11-08 23:22:43 +01:00
Mounir IDRASSI bb7ef68040 MacOSX : Update Main Makefile to used the new package name that include the version. 2014-11-08 23:22:41 +01:00
Mounir IDRASSI 37891c2bb0 MacOSX : Add detection of MacFUSE compatibility layer in installer. Change package name to include version in order to avoid specifying manually the title of the installer window. 2014-11-08 23:22:38 +01:00
Mounir IDRASSI 3e2cf28d92 MacOSX : Correct typos in Main Makefile 2014-11-08 23:22:35 +01:00
Mounir IDRASSI 92af806488 MacOSX : change OSXFuse error message to indicate the MacFUSE compatibility layer is needed. 2014-11-08 23:22:32 +01:00
Mounir IDRASSI ce44ad4c57 MacOSX : modify Makefile to automatically build and sign the MacOSX installer for VeraCrypt. 2014-11-08 23:22:29 +01:00
Mounir IDRASSI a857f6c087 MacOSX : add Packages project that creates the MacOSX installer for VeraCrypt 2014-11-08 23:22:27 +01:00
Mounir IDRASSI 0d6443e05a MacOSX : Since we link directly with OSXFuse, change error message to indicate that OSXFuse 2.3+ is needed. 2014-11-08 23:22:24 +01:00
Mounir IDRASSI 41a31ac76f MacOSX : Copy console version of VeraCrypt inside the bundle under the name veracrypt_console. 2014-11-08 23:22:21 +01:00
Mounir IDRASSI 4fefd61cee MacOSX : Update Fuse error message to display OSXFUSE requirement alongside MacFuse. 2014-11-08 23:22:19 +01:00
Mounir IDRASSI 8ee17fd727 MacOSX : Support detection of OSXFUSE and the presence of MacFUSE compatibility layer. 2014-11-08 23:22:16 +01:00
Mounir IDRASSI 7aceaf124e MacOSX : copy the help pdf into the VeraCrypt bundle during package creation 2014-11-08 23:22:13 +01:00
Mounir IDRASSI f143182cbc MacOSX : correct the name of dmg file used by the rm command 2014-11-08 23:22:10 +01:00
Mounir IDRASSI f94707e4ef MacOSX : correct compilation issue caused by system API deprication and use of new wxWidgets. 2014-11-08 23:22:08 +01:00
Mounir IDRASSI 73bf608efc MacOSX : Correct issue of compiling assembly files in both 32-bit and 64-bit mode. Modify Makefiles to correct compilation process using latest Xcode. 2014-11-08 23:22:05 +01:00
Mounir IDRASSI 6688c9d85a MacOSX : add icns file to be used by VeraCrypt bundle 2014-11-08 23:22:02 +01:00
Mounir IDRASSI e8fbc912ce MacOSX : add nasm binary to be used instead of the native one because of the limitations of the version shipped by Apple 2014-11-08 23:22:00 +01:00
Mounir IDRASSI 80a26745a6 Linux GUI : hide the wipe choice during volume creation. Remove extra content from wipe choice list. 2014-11-08 23:21:57 +01:00
Mounir IDRASSI 88b4628c34 Correct message in Linux VeraCrypt installer to replace truecrypt-uninstall.sh by veracrypt-uninstall.sh 2014-11-08 23:21:54 +01:00
Mounir IDRASSI ee9f3101fd Correct compilation error under Linux introduced in latest commit 2014-11-08 23:21:52 +01:00
Mounir IDRASSI cb6dad6bd2 Linux/MacOSX port of manual selection of number of passes for volume header over-write operation. 2014-11-08 23:21:49 +01:00
Mounir IDRASSI 4d8d59c23d Add description string for the new wipe mode WIPE_MODE_256 in language files. 2014-11-08 23:21:46 +01:00
Mounir IDRASSI 1c11ee428d Add option in select the number of passes for volume header over-writing. By default, it is set to 3 but it can be increased to 256 passes (which can lead to a delay of many hours for a single password change operation). 2014-11-08 23:21:43 +01:00
Mounir IDRASSI 97154aaf51 Lower number of times we overwrite volume header during the encryption of a partition if the user choose to wipe the driver. Latest studies show that even one pass is enough to make data irretrievable. A value of 3 is a conservative approach that enhance performance without scarifying security. http://www.infosecisland.com/blogview/16130-The-Urban-Legend-of-Multipass-Hard-Disk-Overwrite.html http://digital-forensics.sans.org/blog/2009/01/15/overwriting-hard-drive-data/ 2014-11-08 23:21:40 +01:00
Mounir IDRASSI 1ddae20932 Correct Linux compilation after removing legacy cryptographic code. 2014-11-08 23:21:38 +01:00
Mounir IDRASSI a5c1978eef Remove remaining legacy cryptographic algorithms that are never used by VeraCrypt. 2014-11-08 23:21:35 +01:00
Mounir IDRASSI 75f7808719 Remove deprecated/legacy cryptographic algorithms and encryption modes that are never used by VeraCrypt. This will speed up volumes opening in many cases. 2014-11-08 23:21:32 +01:00
Mounir IDRASSI 0594532cf1 Mount.c : call burn directly in szFileName instead of (&szFileName). This was not an issue because the compiler returns the same address for both, but for the sake of clarity it had to be corrected. 2014-11-08 23:21:30 +01:00
Mounir IDRASSI c220db0128 Static Code Analysis : Generalize the use of Safe String functions. Add some NULL pointer checks. Avoid false-positive detection in AppendMenu (MF_SEPARATOR) calls by setting the last parameter to "" instead of NULL. 2014-11-08 23:21:27 +01:00
Mounir IDRASSI c01f392a7b Static Code Analysis : Use Safe String function in Dlgcode.c. Add byte size parameter in various functions to help implement secure handling of strings. 2014-11-08 23:21:24 +01:00
Mounir IDRASSI bbc738c490 Static Code Analysis : Add various NULL pointers checks 2014-11-08 23:21:21 +01:00
Mounir IDRASSI 8bf58486af Static Code Analysis : Add NULL pointers checks on the result of ATL string conversion. Avoid some conversions by using UNICODE functions directly. 2014-11-08 23:21:18 +01:00
Mounir IDRASSI ba733dd032 Use Safe String functions in Registry.c and add a unicode version of WriteLocalMachineRegistryDword function to avoid doing conversions when used. 2014-11-08 23:21:16 +01:00
Mounir IDRASSI 016edc150b Static Code Analysis : Use Safe String functions in Setup code to avoid potential security issues. 2014-11-08 23:21:13 +01:00
Mounir IDRASSI 5c1db9d0e1 Static Code Analysis : Add check on the return of strtok inside mkfulldir_internal to avoid warning. 2014-11-08 23:21:10 +01:00
Mounir IDRASSI f3625a080f Static Code Analysis: Correctly initialize variables to avoid false-positive detection in the boot code. 2014-11-08 23:21:07 +01:00
Mounir IDRASSI 3137d36d9a Static Code Analysis : Use Safe string functions inside VeraCrypt Device Driver to avoid potential security issues. Add many checks for NULL pointers to handle low memory use cases. 2014-11-08 23:21:04 +01:00
Mounir IDRASSI 516fda09a7 Remove test inherited from TrueCrypt because it's always true since we inherited from version 0x71a 2014-11-08 23:21:02 +01:00
Mounir IDRASSI 626a3aedd7 Disable posting the results of minidump analysis until a dedicated URL is put in place. 2014-11-08 23:20:59 +01:00
Mounir IDRASSI c7c8e28655 Disable crash handling until we put in place a dedicated URL for posting crash information. 2014-11-08 23:20:56 +01:00
Mounir IDRASSI 469f1dba40 Remove unused label. 2014-11-08 23:20:53 +01:00
Mounir IDRASSI 515495f2f3 Static Code Analysis : Correctly initialize member variable in HostDevice constructor 2014-11-08 23:20:51 +01:00
Mounir IDRASSI 7bb812af66 Static Code Analysis : Avoid using invalidate integer value received from GetFileSize. 2014-11-08 23:20:48 +01:00
Mounir IDRASSI 9d027b02b9 Static Code Analysis : fix usage of strncpy and sscanf. 2014-11-08 23:20:45 +01:00
Mounir IDRASSI 899a22b840 Static Code Analysis : fix various memory leaks. 2014-11-08 23:20:43 +01:00
Mounir IDRASSI 5281e2d3b9 Static Code Analysis : fix resource leakage by ensuring that all Windows handles are released properly 2014-11-08 23:20:40 +01:00
Mounir IDRASSI 2a288a7e12 Static Code Analysis : Avoid potential overflow when parsing language file by specifying width for 's' conversion specifier 2014-11-08 23:20:37 +01:00
Mounir IDRASSI f67748ae8e Static Code Analysis : fix non-absolute DLL/process loads that can be hijacked (Microsoft Security Advisory 2269637). 2014-11-08 23:20:35 +01:00
Mounir IDRASSI d6817f941a Static Code Analysis : Add virtual attribute to destructor of classes that have virtual methods inherited from a base class 2014-11-08 23:20:32 +01:00
Mounir IDRASSI f19cfb3361 Static Code Analysis : Correctly initialize member variables in various constructors 2014-11-08 23:20:29 +01:00
Mounir IDRASSI 9bb962c8bb Fix password memory leak inside the Device driver in boot encryption mode. 2014-11-08 23:20:27 +01:00
Mounir IDRASSI 0dda93ca47 Avoid changing metadata (ownership, permission,etc) of /usr when unpacking VeraCrypt tar package 2014-11-08 23:20:24 +01:00
Mounir IDRASSI c2d4bf6207 Set the Execute bit for VeraCrypt uninstall script before copying it to the tar package 2014-11-08 23:20:22 +01:00
Mounir IDRASSI a9404c2bff Remove VeraCrypt version number from Readme.txt. 2014-11-08 23:20:19 +01:00
Mounir IDRASSI 5218b6dfe8 Add VeraCrypt specific Linux packaging code in Makefiles and add various helper scripts. The original TrueCrypt sources didn't contain anything about this. 2014-11-08 23:20:17 +01:00
Mounir IDRASSI 41a22ca4e7 Change namespace from TrueCrypt to VeraCrypt. Rename method from Resources Resources::GetTrueCryptIcon to Resources::GetVeraCryptIcon. 2014-11-08 23:20:14 +01:00
Mounir IDRASSI 17823cb58c Update wxFormBuild file to latest version (3.5 beta) and generate new Forms.cpp/Forms.h files. 2014-11-08 23:20:11 +01:00
Mounir IDRASSI a81790329f Point to the SourceForge website instead of idrix.fr for the application link. Remove OS parameter is URL constructed under Linux/MacOSX 2014-11-08 23:20:08 +01:00
Mounir IDRASSI 4b6594325f Update wxWidgets compilation flags in order to be compatible with wxWidgets 3.0 and remove unneeded dependencies to ensure maximum compatibility. 2014-11-08 23:20:06 +01:00
Mounir IDRASSI e1de322ed3 Replace 'TRUE' by 'VERA' in some GUI constants and comments 2014-11-08 23:20:03 +01:00
Mounir IDRASSI b6dc9e9e15 Change legacy version check in newly added Linux/MacOSX sources from 0x600 (TrueCrypt) to 0x10b 2014-11-08 23:20:01 +01:00
Mounir IDRASSI b9e34c30e8 Require to upgrade rescue disk if upgrading from version 1.0a of VeraCrypt instead of version 6.0a (left over from TrueCrypt). Does anyone still uses VeraCrypt 1.0a??? 2014-11-08 23:19:58 +01:00
Mounir IDRASSI 95c6072a57 Modify language files from TrueCrypt to make them compatible with VeraCrypt. Set supported version to 1.0d. 2014-11-08 23:19:55 +01:00
Mounir IDRASSI 859393caf1 Add original TrueCrypt 7.1a translation language files 2014-11-08 23:19:51 +01:00
Mounir IDRASSI 437cbd9c8b Remove some legacy code inherited from True and that doesn't apply to VeraCrypt 2014-11-08 23:19:47 +01:00
Mounir IDRASSI f34d894f6e Detect correctly VeraCrypt rescue disk by looking for the little-endian encoding of "Vera" instead of "True". 2014-11-08 23:19:44 +01:00
Mounir IDRASSI 7875d3ec3f Set volume header to 'VERA' instead of 'TRUE' in newly added Linux/MacOSX code 2014-11-08 23:19:42 +01:00
Mounir IDRASSI f701dc1c29 Correct typos introduced inadvertently 2014-11-08 23:19:39 +01:00
Mounir IDRASSI bacd720279 Correct values of RIPEMD160 iterations count to be identical to Windows ones (defined in function get_pkcs5_iteration_count) 2014-11-08 23:19:36 +01:00
Mounir IDRASSI 31fd16979f Change TrueCrypt to VeraCrypt in some comments 2014-11-08 23:19:34 +01:00
Mounir IDRASSI 4d12001e10 Adapt Makefiles for VeraCrypt. Use PKCS#11 headers from source tree is not specified elsewhere. 2014-11-08 23:19:32 +01:00
Mounir IDRASSI 084a8ee85c wxWidgets 3.0 compatibility modifications 2014-11-08 23:19:29 +01:00
Mounir IDRASSI c386beb69c Adapt newly added Linux/MacOSX code to the modification of key derivation introduced by VeraCrypt 2014-11-08 23:19:27 +01:00
Mounir IDRASSI be4ca4bac6 Replace TrueCrypt from Linux/MacOSX mount point names 2014-11-08 23:19:24 +01:00
Mounir IDRASSI 0c95ed3691 Add PKCS#11 2.20 headers to the source tree 2014-11-08 23:19:22 +01:00
Mounir IDRASSI a27f345832 Set the publisher to IDRIX in the uninstaller registry key. 2014-11-08 23:19:20 +01:00
Mounir IDRASSI 08e653c926 Increment VeraCrypt version to 1.0d 2014-11-08 23:19:17 +01:00
Mounir IDRASSI 751a454e6c Correct issue in handling hidden system partitions that made it impossible to verify their password. 2014-11-08 23:19:15 +01:00
Mounir IDRASSI 9b19baf73e use burn instead of memset when clearing RIPEMD context to ensure the compiler won't optimize it 2014-11-08 23:19:13 +01:00
Mounir IDRASSI 5ebd79745d Use calloc directly instead of combining malloc and ZeroMemory 2014-11-08 23:19:10 +01:00
Mounir IDRASSI 1763e8a2ba Correct minor bug in ReadRegistryString function 2014-11-08 23:19:08 +01:00
Mounir IDRASSI 49f679ca53 Change PBKDF Iterations count from TrueCrypt values to VeraCrypt values. 2014-11-08 23:19:06 +01:00
Mounir IDRASSI edc9f36322 Replace TrueCrypt references in added sources and resources by VeraCrypt ones. 2014-11-08 23:19:03 +01:00
Mounir IDRASSI 34370b9933 Add TrueCrypt MacOSX icon (icns) 2014-11-08 23:19:01 +01:00
Mounir IDRASSI 7ffce028d0 Add TrueCrypt 7.1a MacOSX/Linux specific source files. 2014-11-08 23:18:59 +01:00
Mounir IDRASSI 97011f179c Increment VeraCrypt version to 1.0c 2014-11-08 23:18:55 +01:00
Mounir IDRASSI 235f0b85ea Set correctly the minimum required version in volumes header (this value must always follow the current program version). This solves also the hidden volume issue. 2014-11-08 23:18:53 +01:00
Mounir IDRASSI 52c6cad745 Increment VeraCrypt version to 1.0b 2014-11-08 23:18:51 +01:00
Mounir IDRASSI a8fecdcbb7 restore TrueCrypt reference in license header 2014-11-08 23:18:49 +01:00
Mounir IDRASSI 1c419739a2 Only position legacy flag if the first release of VeraCrypt is detected 2014-11-08 23:18:47 +01:00
Mounir IDRASSI 593d1a3edc Update RIPEMD160 implementation in Windows Bootloaded to benefit from the compiler 32-bit integer 2014-11-08 23:18:44 +01:00
Mounir IDRASSI 0f70b56942 Update Readme file to remove TrueCrypt references and to describe VeraCrypt specific signing and packaging batch file. 2014-11-08 23:18:42 +01:00
610 changed files with 266169 additions and 96977 deletions
+50
View File
@@ -0,0 +1,50 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Explicitly declare text files that could be normalized and converted
# to native line endings on checkout. However, as per the policy they're
# supposed to have LF endings on all platforms.
*.[ch] text diff=cpp eol=lf
*.[ch]pp text diff=cpp eol=lf
*.asm text eol=lf
Makefile text eol=lf
*.make text eol=lf
*.mk text eol=lf
*.inc text eol=lf
*.md text eol=lf
*.xml text eol=lf
*.xpm text -diff -merge eol=lf
*.pem text -diff -merge eol=lf
*.cer text -diff -merge eol=lf
*.manifest text eol=lf
*.sh text eol=lf
*.txt text eol=lf
*.html text diff=html eol=lf
*.idl text eol=lf
*.fbp text eol=lf
*.rgs text eol=lf
*.pkgproj text eol=lf
Sources text eol=lf
# Declare files that will always have LF line endings on checkout.
*.desktop text eol=lf
# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf
*.vcproj text eol=crlf
*.rc text eol=crlf
*.bat text eol=crlf
*.cmd text eol=crlf
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.pdf binary
*.bmp binary
*.ico binary
*.od[fgpst] binary
*.hc binary
*.icns binary
*.rtf binary
*.bz2 binary
*.pfx binary
+503
View File
@@ -0,0 +1,503 @@
TrueCrypt License Version 3.0
Software distributed under this license is distributed on an "AS
IS" BASIS WITHOUT WARRANTIES OF ANY KIND. THE AUTHORS AND
DISTRIBUTORS OF THE SOFTWARE DISCLAIM ANY LIABILITY. ANYONE WHO
USES, COPIES, MODIFIES, OR (RE)DISTRIBUTES ANY PART OF THE
SOFTWARE IS, BY SUCH ACTION(S), ACCEPTING AND AGREEING TO BE
BOUND BY ALL TERMS AND CONDITIONS OF THIS LICENSE. IF YOU DO NOT
ACCEPT THEM, DO NOT USE, COPY, MODIFY, NOR (RE)DISTRIBUTE THE
SOFTWARE, NOR ANY PART(S) THEREOF.
I. Definitions
1. "This Product" means the work (including, but not limited to,
source code, graphics, texts, and accompanying files) made
available under and governed by this version of this license
("License"), as may be indicated by, but is not limited to,
copyright notice(s) attached to or included in the work.
2. "You" means (and "Your" refers to) an individual or a legal
entity (e.g., a non-profit organization, commercial
organization, government agency, etc.) exercising permissions
granted by this License.
3. "Modification" means (and "modify" refers to) any alteration
of This Product, including, but not limited to, addition to or
deletion from the substance or structure of This Product,
translation into another language, repackaging, alteration or
removal of any file included with This Product, and addition of
any new files to This Product.
4. "Your Product" means This Product modified by You, or any
work You derive from (or base on) any part of This Product. In
addition, "Your Product" means any work in which You include any
(modified or unmodified) portion of This Product. However, if
the work in which you include it is an aggregate software
distribution (such as an operating system distribution or a
cover CD-ROM of a magazine) containing multiple separate
products, then the term "Your Product" includes only those
products (in the aggregate software distribution) that use,
include, or depend on a modified or unmodified version of This
Product (and the term "Your Product" does not include the whole
aggregate software distribution). For the purposes of this
License, a product suite consisting of two or more products is
considered a single product (operating system distributions and
cover media of magazines are not considered product suites).
5. "Distribution" means (and "distribute" refers to), regardless
of means or methods, conveyance, transfer, providing, or making
available of This/Your Product or portions thereof to third
parties (including, but not limited to, making This/Your
Product, or portions thereof, available for download to third
parties, whether or not any third party has downloaded the
product, or any portion thereof, made available for download).
II. Use, Copying, and Distribution of This Product
1. Provided that You comply with all applicable terms and
conditions of this License, You may make copies of This Product
(unmodified) and distribute copies of This Product (unmodified)
that are not included in another product forming Your Product
(except as permitted under Chapter III). Note: For terms and
conditions for copying and distribution of modified versions of
This Product, see Chapter III.
2. Provided that You comply with all applicable terms and
conditions of this License, You may use This Product freely (see
also Chapter III) on any number of computers/systems for non-
commercial and/or commercial purposes.
III. Modification, Derivation, and Inclusion in Other Products
1. If all conditions specified in the following paragraphs in
this Chapter (III) are met (for exceptions, see Section III.2)
and if You comply with all other applicable terms and conditions
of this License, You may modify This Product (thus forming Your
Product), derive new works from This Product or portions thereof
(thus forming Your Product), include This Product or portions
thereof in another product (thus forming Your Product, unless
defined otherwise in Chapter I), and You may use (for non-
commercial and/or commercial purposes), copy, and/or distribute
Your Product.
a. The name of Your Product (or of Your modified version of
This Product) must not contain the name TrueCrypt (for
example, the following names are not allowed: TrueCrypt,
TrueCrypt+, TrueCrypt Professional, iTrueCrypt, etc.) nor
any other names confusingly similar to the name TrueCrypt
(e.g., True-Crypt, True Crypt, TruKrypt, etc.)
All occurrences of the name TrueCrypt that could reasonably
be considered to identify Your Product must be removed from
Your Product and from any associated materials. Logo(s)
included in (or attached to) Your Product (and in/to
associated materials) must not incorporate and must not be
confusingly similar to any of the TrueCrypt logos
(including, but not limited to, the non-textual logo
consisting primarily of a key in stylized form) or
portion(s) thereof. All graphics contained in This Product
(logos, icons, etc.) must be removed from Your Product (or
from Your modified version of This Product) and from any
associated materials.
b. The following phrases must be removed from Your Product
and from any associated materials, except the text of this
License: "A TrueCrypt Foundation Release", "Released by
TrueCrypt Foundation", "This is a TrueCrypt Foundation
release."
c. Phrase "Based on TrueCrypt, freely available at
http://www.truecrypt.org/" must be displayed by Your Product
(if technically feasible) and contained in its
documentation. Alternatively, if This Product or its portion
You included in Your Product constitutes only a minor
portion of Your Product, phrase "Portions of this product
are based in part on TrueCrypt, freely available at
http://www.truecrypt.org/" may be displayed instead. In each
of the cases mentioned above in this paragraph,
"http://www.truecrypt.org/" must be a hyperlink (if
technically feasible) pointing to http://www.truecrypt.org/
and You may freely choose the location within the user
interface (if there is any) of Your Product (e.g., an
"About" window, etc.) and the way in which Your Product will
display the respective phrase.
Your Product (and any associated materials, e.g., the
documentation, the content of the official web site of Your
Product, etc.) must not present any Internet address
containing the domain name truecrypt.org (or any domain name
that forwards to the domain name truecrypt.org) in a manner
that might suggest that it is where information about Your
Product may be obtained or where bugs found in Your Product
may be reported or where support for Your Product may be
available or otherwise attempt to indicate that the domain
name truecrypt.org is associated with Your Product.
d. The complete source code of Your Product must be freely
and publicly available (for exceptions, see Section III.2)
at least until You cease to distribute Your Product. This
condition can be met in one or both of the following ways:
(i) You include the complete source code of Your Product
with every copy of Your Product that You make and distribute
and You make all such copies of Your Product available to
the general public free of charge, and/or (ii) You include
information (valid and correct at least until You cease to
distribute Your Product) about where the complete source
code of Your Product can be obtained free of charge (e.g.,
an Internet address) or for a reasonable reproduction fee
with every copy of Your Product that You make and distribute
and, if there is a web site officially associated with Your
Product, You include the aforementioned information about
the source code on a freely and publicly accessible web
page to which such web site links via an easily viewable
hyperlink (at least until You cease to distribute Your
Product).
The source code of Your Product must not be deliberately
obfuscated and it must not be in an intermediate form (e.g.,
the output of a preprocessor). Source code means the
preferred form in which a programmer would usually modify
the program.
Portions of the source code of Your Product not contained in
This Product (e.g., portions added by You in creating Your
Product, whether created by You or by third parties) must be
available under license(s) that (however, see also
Subsection III.1.e) allow(s) anyone to modify and derive new
works from the portions of the source code that are not
contained in This Product and to use, copy, and redistribute
such modifications and/or derivative works. The license(s)
must be perpetual, non-exclusive, royalty-free, no-charge,
and worldwide, and must not invalidate, weaken, restrict,
interpret, amend, modify, interfere with or otherwise affect
any part, term, provision, or clause of this License. The
text(s) of the license(s) must be included with every copy
of Your Product that You make and distribute.
e. You must not change the license terms of This Product in
any way (adding any new terms is considered changing the
license terms even if the original terms are retained),
which means, e.g., that no part of This Product may be put
under another license. You must keep intact all the legal
notices contained in the source code files. You must include
the following items with every copy of Your Product that You
make and distribute: a clear and conspicuous notice stating
that Your Product or portion(s) thereof is/are governed by
this version of the TrueCrypt License, a verbatim copy of
this version of the TrueCrypt License (as contained herein),
a clear and conspicuous notice containing information about
where the included copy of the License can be found, and an
appropriate copyright notice.
2. You are not obligated to comply with Subsection III.1.d if
Your Product is not distributed (i.e., Your Product is available
only to You).
IV. Disclaimer of Liability, Disclaimer of Warranty,
Indemnification
You expressly acknowledge and agree to the following:
1. IN NO EVENT WILL ANY (CO)AUTHOR OF THIS PRODUCT, OR ANY
APPLICABLE INTELLECTUAL-PROPERTY OWNER, OR ANY OTHER PARTY WHO
MAY COPY AND/OR (RE)DISTRIBUTE THIS PRODUCT OR PORTIONS THEREOF,
AS MAY BE PERMITTED HEREIN, BE LIABLE TO YOU OR TO ANY OTHER
PARTY FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO, ANY
DIRECT, INDIRECT, GENERAL, SPECIAL, INCIDENTAL, PUNITIVE,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, CORRUPTION OR LOSS OF DATA, ANY LOSSES SUSTAINED BY YOU OR
THIRD PARTIES, A FAILURE OF THIS PRODUCT TO OPERATE WITH ANY
OTHER PRODUCT, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR
BUSINESS INTERRUPTION), WHETHER IN CONTRACT, STRICT LIABILITY,
TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE) OR OTHERWISE,
ARISING OUT OF THE USE, COPYING, MODIFICATION, OR
(RE)DISTRIBUTION OF THIS PRODUCT (OR A PORTION THEREOF) OR OF
YOUR PRODUCT (OR A PORTION THEREOF), OR INABILITY TO USE THIS
PRODUCT (OR A PORTION THEREOF), EVEN IF SUCH DAMAGES (OR THE
POSSIBILITY OF SUCH DAMAGES) ARE/WERE PREDICTABLE OR KNOWN TO
ANY (CO)AUTHOR, INTELLECTUAL-PROPERTY OWNER, OR ANY OTHER PARTY.
2. THIS PRODUCT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND, WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT
LIMITED TO, THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE ENTIRE RISK AS TO
THE QUALITY AND PERFORMANCE OF THIS PRODUCT IS WITH YOU. SHOULD
THIS PRODUCT PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
NECESSARY SERVICING, REPAIR, OR CORRECTION.
3. THIS PRODUCT MAY INCORPORATE IMPLEMENTATIONS OF CRYPTOGRAPHIC
ALGORITHMS THAT ARE REGULATED (E.G., SUBJECT TO EXPORT/IMPORT
CONTROL REGULATIONS) OR ILLEGAL IN SOME COUNTRIES. IT IS SOLELY
YOUR RESPONSIBILITY TO VERIFY THAT IT IS LEGAL TO IMPORT AND/OR
(RE)EXPORT AND/OR USE THIS PRODUCT (OR PORTIONS THEREOF) IN
COUNTRIES WHERE YOU INTEND TO USE IT AND/OR TO WHICH YOU INTEND
TO IMPORT IT AND/OR FROM WHICH YOU INTEND TO EXPORT IT, AND IT
IS SOLELY YOUR RESPONSIBILITY TO COMPLY WITH ANY APPLICABLE
REGULATIONS, RESTRICTIONS, AND LAWS.
4. YOU SHALL INDEMNIFY, DEFEND AND HOLD ALL (CO)AUTHORS OF THIS
PRODUCT, AND APPLICABLE INTELLECTUAL-PROPERTY OWNERS, HARMLESS
FROM AND AGAINST ANY AND ALL LIABILITY, DAMAGES, LOSSES,
SETTLEMENTS, PENALTIES, FINES, COSTS, EXPENSES (INCLUDING
REASONABLE ATTORNEYS' FEES), DEMANDS, CAUSES OF ACTION, CLAIMS,
ACTIONS, PROCEEDINGS, AND SUITS, DIRECTLY RELATED TO OR ARISING
OUT OF YOUR USE, INABILITY TO USE, COPYING, (RE)DISTRIBUTION,
IMPORT AND/OR (RE)EXPORT OF THIS PRODUCT (OR PORTIONS THEREOF)
AND/OR YOUR BREACH OF ANY TERM OF THIS LICENSE.
V. Trademarks
This License does not grant permission to use trademarks
associated with (or applying to) This Product, except for fair
use as defined by applicable law and except for use expressly
permitted or required by this License. Any attempt otherwise to
use trademarks associated with (or applying to) This Product
automatically and immediately terminates Your rights under This
License and may constitute trademark infringement (which may be
prosecuted).
VI. General Terms and Conditions, Miscellaneous Provisions
1. ANYONE WHO USES AND/OR COPIES AND/OR MODIFIES AND/OR CREATES
DERIVATIVE WORKS OF AND/OR (RE)DISTRIBUTES THIS PRODUCT, OR ANY
PORTION(S) THEREOF, IS, BY SUCH ACTION(S), AGREEING TO BE BOUND
BY AND ACCEPTING ALL TERMS AND CONDITIONS OF THIS LICENSE (AND
THE RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS LICENSE).
IF YOU DO NOT ACCEPT (AND AGREE TO BE BOUND BY) ALL TERMS AND
CONDITIONS OF THIS LICENSE, DO NOT USE, COPY, MODIFY, CREATE
DERIVATIVE WORKS OF, NOR (RE)DISTRIBUTE THIS PRODUCT, NOR ANY
PORTION(S) THEREOF.
2. YOU MAY NOT USE, MODIFY, COPY, CREATE DERIVATIVE WORKS OF,
(RE)DISTRIBUTE, OR SUBLICENSE THIS PRODUCT, OR PORTION(S)
THEREOF, EXCEPT AS EXPRESSLY PROVIDED IN THIS LICENSE (EVEN IF
APPLICABLE LAW GIVES YOU MORE RIGHTS). ANY ATTEMPT (EVEN IF
PERMITTED BY APPLICABLE LAW) OTHERWISE TO USE, MODIFY, COPY,
CREATE DERIVATIVE WORKS OF, (RE)DISTRIBUTE, OR SUBLICENSE THIS
PRODUCT, OR PORTION(S) THEREOF, AUTOMATICALLY AND IMMEDIATELY
TERMINATES YOUR RIGHTS UNDER THIS LICENSE AND CAN CONSTITUTE
COPYRIGHT INFRINGEMENT (WHICH MAY BE PROSECUTED). ANY CONDITIONS
AND RESTRICTIONS CONTAINED IN THIS LICENSE ARE ALSO LIMITATIONS
ON THE SCOPE OF THIS LICENSE AND ALSO DEFINE THE SCOPE OF YOUR
RIGHTS UNDER THIS LICENSE. YOUR FAILURE TO COMPLY WITH THE TERMS
AND CONDITIONS OF THIS LICENSE OR FAILURE TO PERFORM ANY
APPLICABLE OBLIGATION IMPOSED BY THIS LICENSE AUTOMATICALLY AND
IMMEDIATELY TERMINATES YOUR RIGHTS UNDER THIS LICENSE AND CAN
CAUSE OR BE CONSIDERED COPYRIGHT INFRINGEMENT (WHICH MAY BE
PROSECUTED). NOTHING IN THIS LICENSE SHALL IMPLY OR BE CONSTRUED
AS A PROMISE, OBLIGATION, OR COVENANT NOT TO SUE FOR COPYRIGHT
OR TRADEMARK INFRINGEMENT IF YOU DO NOT COMPLY WITH THE TERMS
AND CONDITIONS OF THIS LICENSE.
3. This License does not constitute or imply a waiver of any
intellectual property rights except as may be otherwise
expressly provided in this License. This License does not
transfer, assign, or convey any intellectual property rights
(e.g., it does not transfer ownership of copyrights or
trademarks).
4. Subject to the terms and conditions of this License, You may
allow a third party to use Your copy of This Product (or a copy
that You make and distribute, or Your Product) provided that the
third party explicitly accepts and agrees to be bound by all
terms and conditions of this License and the third party is not
prohibited from using This Product (or portions thereof) by this
License (see, e.g., Section VI.7) or by applicable law. However,
You are not obligated to ensure that the third party accepts
(and agrees to be bound by all terms of) this License if You
distribute only the self-extracting package (containing This
Product) that does not allow the user to install (nor extract)
the files contained in the package until he or she accepts and
agrees to be bound by all terms and conditions of this License.
5. Without specific prior written permission from the authors of
This Product (or from their common representative), You must not
use the name of This Product, the names of the authors of This
Product, or the names of the legal entities (or informal groups)
of which the authors were/are members/employees, to endorse or
promote Your Product or any work in which You include a modified
or unmodified version of This Product, or to endorse or promote
You or Your affiliates, or in a way that might suggest that Your
Product (or any work in which You include a modified or
unmodified version of This Product), You, or Your affiliates
is/are endorsed by one or more authors of This Product, or in a
way that might suggest that one or more authors of This Product
is/are affiliated with You (or Your affiliates) or directly
participated in the creation of Your Product or of any work in
which You include a modified or unmodified version of This
Product.
6. IF YOU ARE NOT SURE WHETHER YOU UNDERSTAND ALL PARTS OF THIS
LICENSE OR IF YOU ARE NOT SURE WHETHER YOU CAN COMPLY WITH ALL
TERMS AND CONDITIONS OF THIS LICENSE, YOU MUST NOT USE, COPY,
MODIFY, CREATE DERIVATIVE WORKS OF, NOR (RE)DISTRIBUTE THIS
PRODUCT, NOR ANY PORTION(S) OF IT. YOU SHOULD CONSULT WITH A
LAWYER.
7. IF (IN RELEVANT CONTEXT) ANY PROVISION OF CHAPTER IV OF THIS
LICENSE IS UNENFORCEABLE, INVALID, OR PROHIBITED UNDER
APPLICABLE LAW IN YOUR JURISDICTION, YOU HAVE NO RIGHTS UNDER
THIS LICENSE AND YOU MUST NOT USE, COPY, MODIFY, CREATE
DERIVATIVE WORKS OF, NOR (RE)DISTRIBUTE THIS PRODUCT, NOR ANY
PORTION(S) THEREOF.
8. Except as otherwise provided in this License, if any
provision of this License, or a portion thereof, is found to be
invalid or unenforceable under applicable law, it shall not
affect the validity or enforceability of the remainder of this
License, and such invalid or unenforceable provision shall be
construed to reflect the original intent of the provision and
shall be enforced to the maximum extent permitted by applicable
law so as to effect the original intent of the provision as
closely as possible.
____________________________________________________________
Third-Party Licenses
This Product contains components that were created by third
parties and that are governed by third-party licenses, which are
contained hereinafter (separated by lines consisting of
underscores). Each of the third-party licenses applies only to
(portions of) the source code file(s) in which the third-party
license is contained or in which it is explicitly referenced,
and to compiled or otherwise processed forms of such source
code. None of the third-party licenses applies to This Product
as a whole, even when it uses terms such as "product",
"program", or any other equivalent terms/phrases. This Product
as a whole is governed by the TrueCrypt License (see above).
Some of the third-party components have been modified by the
authors of This Product. Unless otherwise stated, such
modifications and additions are governed by the TrueCrypt
License (see above). Note: Unless otherwise stated, graphics and
files that are not part of the source code are governed by the
TrueCrypt License.
____________________________________________________________
License agreement for Encryption for the Masses.
Copyright (C) 1998-2000 Paul Le Roux. All Rights Reserved.
This product can be copied and distributed free of charge,
including source code.
You may modify this product and source code, and distribute such
modifications, and you may derive new works based on this
product, provided that:
1. Any product which is simply derived from this product cannot
be called E4M, or Encryption for the Masses.
2. If you use any of the source code in your product, and your
product is distributed with source code, you must include this
notice with those portions of this source code that you use.
Or,
If your product is distributed in binary form only, you must
display on any packaging, and marketing materials which
reference your product, a notice which states:
"This product uses components written by Paul Le Roux
<pleroux@swprofessionals.com>"
3. If you use any of the source code originally by Eric Young,
you must in addition follow his terms and conditions.
4. Nothing requires that you accept this License, as you have
not signed it. However, nothing else grants you permission to
modify or distribute the product or its derivative works.
These actions are prohibited by law if you do not accept this
License.
5. If any of these license terms is found to be to broad in
scope, and declared invalid by any court or legal process, you
agree that all other terms shall not be so affected, and shall
remain valid and enforceable.
6. THIS PROGRAM IS DISTRIBUTED FREE OF CHARGE, THEREFORE THERE
IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. UNLESS OTHERWISE STATED THE PROGRAM IS PROVIDED
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS
WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE
COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
7. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE THE PROGRAM, INCLUDING BUT NOT LIMITED TO LOSS
OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH
ANY OTHER PROGRAMS, EVEN IF SUCH HOLDER OR OTHER PARTY HAD
PREVIOUSLY BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
____________________________________________________________
Copyright (c) 1998-2008, Brian Gladman, Worcester, UK.
All rights reserved.
LICENSE TERMS
The free distribution and use of this software is allowed (with
or without changes) provided that:
1. source code distributions include the above copyright
notice, this list of conditions and the following
disclaimer;
2. binary distributions include the above copyright notice,
this list of conditions and the following disclaimer in
their documentation;
3. the name of the copyright holder is not used to endorse
products built using this software without specific written
permission.
DISCLAIMER
This software is provided 'as is' with no explicit or implied
warranties in respect of its properties, including, but not
limited to, correctness and/or fitness for purpose.
____________________________________________________________
Copyright (C) 2002-2004 Mark Adler, all rights reserved
version 1.8, 9 Jan 2004
This software is provided 'as-is', without any express or
implied warranty. In no event will the author be held liable
for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you
use this software in a product, an acknowledgment in the
product documentation would be appreciated but is not
required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
____________________________________________________________
+277
View File
@@ -0,0 +1,277 @@
This archive contains the source code of VeraCrypt.
It is based on original TrueCrypt 7.1a with security enhancements and modifications.
Important
=========
You may use the source code contained in this archive only if you accept and
agree to the license terms contained in the file 'License.txt', which is
included in this archive.
Note that the license specifies, for example, that a derived work must not be
called 'TrueCrypt' or 'VeraCrypt'
Contents
========
I. Windows
Requirements for Building VeraCrypt for Windows
Instructions for Building VeraCrypt for Windows
Instructions for Signing and Packaging VeraCrypt for Windows
II. Linux and Mac OS X
Requirements for Building VeraCrypt for Linux and Mac OS X
Instructions for Building VeraCrypt for Linux and Mac OS X
Mac OS X specifics
III. FreeBSD and OpenSolaris
IV. Third-Party Developers (Contributors)
V. Legal Information
VI. Further Information
I. Windows
==========
Requirements for Building VeraCrypt for Windows:
------------------------------------------------
- Microsoft Visual C++ 2010 SP1 (Professional Edition or compatible)
- Microsoft Visual C++ 1.52 (available from MSDN Subscriber Downloads)
- Microsoft Windows SDK for Windows 7.1 (configured for Visual C++ 2010)
- Microsoft Windows SDK for Windows 8.1 (needed for SHA-256 code signing)
- Microsoft Windows Driver Kit 7.1.0 (build 7600.16385.1)
- RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) 2.20
header files (available at ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20)
- NASM assembler 2.08 or compatible
- gzip compressor
- upx packer (available at http://upx.sourceforge.net/)
IMPORTANT:
The 64-bit editions of Windows Vista and later versions of Windows, and in
some cases (e.g. playback of HD DVD content) also the 32-bit editions, do not
allow the VeraCrypt driver to run without an appropriate digital signature.
Therefore, all .sys files in official VeraCrypt binary packages are digitally
signed with the digital certificate of the IDRIX, which was
issued by Thawte certification authority. At the end of each official .exe and
.sys file, there are embedded digital signatures and all related certificates
(i.e. all certificates in the relevant certification chain, such as the
certification authority certificates, CA-MS cross-certificate, and the
IDRIX certificate).
Keep this in mind if you compile VeraCrypt
and compare your binaries with the official binaries. If your binaries are
unsigned, the sizes of the official binaries will usually be approximately
10 KB greater than sizes of your binaries (there may be further differences
if you use a different version of the compiler, or if you install a different
or no service pack for Visual Studio, or different hotfixes for it, or if you
use different versions of the required SDKs).
Instructions for Building VeraCrypt for Windows:
------------------------------------------------
1) Create an environment variable 'MSVC16_ROOT' pointing to the folder 'MSVC15'
extracted from the Visual C++ 1.52 self-extracting package.
Note: The 16-bit installer MSVC15\SETUP.EXE cannot be run on 64-bit Windows,
but it is actually not necessary to run it. You only need to extract the
folder 'MSVC15', which contains the 32-bit binaries required to build the
VeraCrypt Boot Loader.
2) If you have installed the Windows Driver Development Kit in another
directory than '%SYSTEMDRIVE%\WinDDK', create an environment variable
'WINDDK_ROOT' pointing to the DDK installation directory.
3) Copy the PKCS #11 header files to a standard include path or create an
environment variable 'PKCS11_INC' pointing to the directory where
the PKCS #11 header files are installed.
4) Open the solution file 'VeraCrypt.sln' in Microsoft Visual Studio 2010.
5) Select 'All' as the active solution configuration.
6) Build the solution.
7) If successful, there should be newly built VeraCrypt binaries in the
'Release' folder.
Instructions for Signing and Packaging VeraCrypt for Windows:
-------------------------------------------------------------
First, create an environment variable 'WSDK81' pointing to the Windows SDK
for Windows 8.1 installation directory.
The folder "Signing" contains a batch file (sign.bat) that will sign all
VeraCrypt components using a code signing certificate present on the
certificate store and also build the final installation setup.
The batch file suppose that the code signing certificate is issued by Thawt.
This is the case for IDRIX's certificate. If yours is issued by another CA,
then you should put the Root and Intermediate certificates in the "Signing"
folder and then modify sign.bat accordingly.
VeraCrypt EFI Boot Loader:
--------------------------
VeraCrypt source code contains pre-built EFI binaries under src\Boot\EFI.
The source code of VeraCrypt EFI Boot Loader is licensed under LGPL and
it is available at https://github.com/veracrypt/VeraCrypt-DCS.
For build instructions, please refer to the file src\Boot\EFI\Readme.txt.
II. Linux and Mac OS X
======================
Requirements for Building VeraCrypt for Linux and Mac OS X:
-----------------------------------------------------------
- GNU Make
- GNU C++ Compiler 4.0 or compatible
- Apple Xcode (Mac OS X only)
- NASM assembler 2.08 or compatible (x86/x64 architecture only)
- pkg-config
- makeself (Linux only)
- wxWidgets 3.0 shared library and header files installed or
wxWidgets 3.0 library source code (available at http://www.wxwidgets.org)
- FUSE library and header files (available at https://github.com/libfuse/libfuse
and https://osxfuse.github.io/)
- RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) 2.20
header files (available at ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20).
They are already included in the source tree under the directory PKCS11 but
it is possible to override it using the environment variable 'PKCS11_INC'.
Instructions for Building VeraCrypt for Linux and Mac OS X:
-----------------------------------------------------------
1) Change the current directory to the root of the VeraCrypt source code.
2) If you have no wxWidgets shared library installed, run the following
command to configure the wxWidgets static library for VeraCrypt and to
build it:
$ make WXSTATIC=1 WX_ROOT=/usr/src/wxWidgets wxbuild
The variable WX_ROOT must point to the location of the source code of the
wxWidgets library. Output files will be placed in the './wxrelease/'
directory.
3) To build VeraCrypt, run the following command:
$ make
or if you have no wxWidgets shared library installed:
$ make WXSTATIC=1
4) If successful, the VeraCrypt executable should be located in the directory
'Main'.
By default, a universal executable supporting both graphical and text user
interface (through the switch --text) is built.
On Linux, a console-only executable, which requires no GUI library, can be
built using the 'NOGUI' parameter:
$ make NOGUI=1 WXSTATIC=1 WX_ROOT=/usr/src/wxWidgets wxbuild
$ make NOGUI=1 WXSTATIC=1
On MacOSX, building a console-only executable is not supported.
Mac OS X specifics:
-----------------------------------------------------------
Under MacOSX, the SDK for OSX 10.7 is used by default. To use another version
of the SDK (i.e. 10.6), you can export the environment variable VC_OSX_TARGET:
$ export VC_OSX_TARGET=10.6
Before building under MacOSX, pkg-config must be installed if not yet available.
Get it from http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz and
compile using the following commands :
$ ./configure --with-internal-glib
$ make
$ sudo make install
After making sure pkg-config is available, download and install OSXFuse from
https://osxfuse.github.io/ (MacFUSE compatibility layer must selected)
The script build_veracrypt_macosx.sh available under "src/Build" performs the
full build of VeraCrypt including the creation of the installer pkg. It expects
to find the wxWidgets 3.0.2 sources at the same level as where you put
VeraCrypt sources (i.e. if "src" path is "/Users/joe/Projects/VeraCrypt/src"
then wxWidgets should be at "/Users/joe/Projects/wxWidgets-3.0.2")
The build process uses Code Signing certificates whose ID is specified in
src/Main/Main.make (lines 167 & 169). You'll have to modify these lines to put
the ID of your Code Signing certificates or comment them if you don't have one.
Because of incompatibility issues with OSXFUSE, the SDK 10.9 generates a
VeraCrypt binary that has issues communicating with the OSXFUSE kernel extension.
Thus, we recommend to use the SDK 10.8 or earlier for building VeraCrypt.
III. FreeBSD and OpenSolaris
============================
FreeBSD and OpenSolaris are not yet supported.
IV. Third-Party Developers (Contributors)
=========================================
If you intend to implement a feature, please contact us first to make sure:
1) That the feature has not been implemented (we may have already implemented
it, but haven't released the code yet).
2) That the feature is acceptable.
3) Whether we need help of third-party developers with implementing the feature.
Information on how to contact us can be found at:
https://veracrypt.codeplex.com/
V. Legal Information
====================
Copyright Information
---------------------
This software as a whole:
Copyright (c) 2013-2016 IDRIX. All rights reserved.
Portions of this software:
Copyright (c) 2013-2016 IDRIX. All rights reserved.
Copyright (c) 2003-2012 TrueCrypt Developers Association. All rights reserved.
Copyright (c) 1998-2000 Paul Le Roux. All rights reserved.
Copyright (c) 1998-2008 Brian Gladman, Worcester, UK. All rights reserved.
Copyright (c) 2002-2004 Mark Adler. All rights reserved.
Copyright (c) 2016 Disk Cryptography Services for EFI (DCS), Alex Kolotnikov
Copyright (c) 1990-2002 Info-ZIP. All rights reserved.
Copyright (c) 2013, Alexey Degtyarev. All rights reserved.
For more information, please see the legal notices attached to parts of the
source code.
Trademark Information
---------------------
Any trademarks contained in the source code, binaries, and/or in the
documentation, are the sole property of their respective owners.
VI. Further Information
=======================
http://www.veracrypt.fr
+321
View File
@@ -0,0 +1,321 @@
@echo off
setlocal
call :freedrive mydriveletter && goto :cont
echo ERROR: No free drive letter found.
goto :exit
:cont
echo Using drive letter %mydriveletter%: for our tests
echo.
IF NOT EXIST test.sha512.hc GOTO :whirlpool
rem Get start time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Mount SHA-512 container (Normal)
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.sha512.hc /hash sha512 /l %mydriveletter% /password test /q /silent /m ro
rem Get end time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Get elapsed time:
set /A elapsed=end-start
rem Show elapsed time:
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
if %hh% lss 10 set hh=0%hh%
if %mm% lss 10 set mm=0%mm%
if %ss% lss 10 set ss=0%ss%
if %cc% lss 10 set cc=0%cc%
echo SHA-512 (Normal) = %hh%:%mm%:%ss%,%cc%
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
rem Get start time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Mount SHA-512 container (Hidden)
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.sha512.hc /hash sha512 /l %mydriveletter% /password testhidden /q /silent /m ro
rem Get end time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Get elapsed time:
set /A elapsed=end-start
rem Show elapsed time:
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
if %hh% lss 10 set hh=0%hh%
if %mm% lss 10 set mm=0%mm%
if %ss% lss 10 set ss=0%ss%
if %cc% lss 10 set cc=0%cc%
echo SHA-512 (Hidden) = %hh%:%mm%:%ss%,%cc%
echo.
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
:whirlpool
IF NOT EXIST test.whirlpool.hc GOTO :sha256
rem Get start time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Mount Whirlpool container (Normal).
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.whirlpool.hc /hash whirlpool /l %mydriveletter% /password test /q /silent /m ro
rem Get end time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Get elapsed time:
set /A elapsed=end-start
rem Show elapsed time:
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
if %hh% lss 10 set hh=0%hh%
if %mm% lss 10 set mm=0%mm%
if %ss% lss 10 set ss=0%ss%
if %cc% lss 10 set cc=0%cc%
echo Whirlpool (Normal) = %hh%:%mm%:%ss%,%cc%
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
rem Get start time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Mount Whirlpool container (Hidden).
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.whirlpool.hc /hash whirlpool /l %mydriveletter% /password testhidden /q /silent /m ro
rem Get end time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Get elapsed time:
set /A elapsed=end-start
rem Show elapsed time:
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
if %hh% lss 10 set hh=0%hh%
if %mm% lss 10 set mm=0%mm%
if %ss% lss 10 set ss=0%ss%
if %cc% lss 10 set cc=0%cc%
echo Whirlpool (Hidden) = %hh%:%mm%:%ss%,%cc%
echo.
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
:sha256
IF NOT EXIST test.sha256.hc GOTO :ripemd160
rem Get start time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Mount SHA-256 container (Normal)
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.sha256.hc /hash sha256 /l %mydriveletter% /password test /q /silent /m ro
rem Get end time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Get elapsed time:
set /A elapsed=end-start
rem Show elapsed time:
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
if %hh% lss 10 set hh=0%hh%
if %mm% lss 10 set mm=0%mm%
if %ss% lss 10 set ss=0%ss%
if %cc% lss 10 set cc=0%cc%
echo SHA-256 (Normal) = %hh%:%mm%:%ss%,%cc%
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
rem Get start time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Mount SHA-256 container (Hidden)
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.sha256.hc /hash sha256 /l %mydriveletter% /password testhidden /q /silent /m ro
rem Get end time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Get elapsed time:
set /A elapsed=end-start
rem Show elapsed time:
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
if %hh% lss 10 set hh=0%hh%
if %mm% lss 10 set mm=0%mm%
if %ss% lss 10 set ss=0%ss%
if %cc% lss 10 set cc=0%cc%
echo SHA-256 (Hidden) = %hh%:%mm%:%ss%,%cc%
echo.
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
:ripemd160
IF NOT EXIST test.ripemd160.hc GOTO :autodetect
rem Get start time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Mount RIPEMD-160 container (Normal)
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.ripemd160.hc /hash ripemd160 /l %mydriveletter% /password test /q /silent /m ro
rem Get end time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Get elapsed time:
set /A elapsed=end-start
rem Show elapsed time:
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
if %hh% lss 10 set hh=0%hh%
if %mm% lss 10 set mm=0%mm%
if %ss% lss 10 set ss=0%ss%
if %cc% lss 10 set cc=0%cc%
echo RIPEMD-160 (Normal) = %hh%:%mm%:%ss%,%cc%
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
rem Get start time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Mount RIPEMD-160 container (Hidden)
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.ripemd160.hc /hash ripemd160 /l %mydriveletter% /password testhidden /q /silent /m ro
rem Get end time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Get elapsed time:
set /A elapsed=end-start
rem Show elapsed time:
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
if %hh% lss 10 set hh=0%hh%
if %mm% lss 10 set mm=0%mm%
if %ss% lss 10 set ss=0%ss%
if %cc% lss 10 set cc=0%cc%
echo RIPEMD-160 (Hidden) = %hh%:%mm%:%ss%,%cc%
echo.
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
:autodetect
call :availablevolume testvolume && goto :contautodetect
goto :exit
:contautodetect
rem Get start time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Try to mount with a wrong password and PRF autodetection
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume %testvolume% /l %mydriveletter% /password wrongpassword /q /silent /m ro
rem Get end time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Get elapsed time:
set /A elapsed=end-start
rem Show elapsed time:
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
if %hh% lss 10 set hh=0%hh%
if %mm% lss 10 set mm=0%mm%
if %ss% lss 10 set ss=0%ss%
if %cc% lss 10 set cc=0%cc%
echo Wrong Password (PRF Auto-detection)= %hh%:%mm%:%ss%,%cc%
echo.
goto :exit
rem Finds a free drive letter.
rem
rem Parameters:
rem %1 = Output variable name.
rem
rem Example:
rem call :freedrive mydriveletter && goto :cont
rem echo ERROR: No free drive letter found.
rem goto :EOF
rem :cont
rem echo Found drive letter: %mydriveletter%
:freedrive
setlocal EnableDelayedExpansion
set exitcode=0
set "output_var=%~1"
for %%i in (C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z) do (
set "drive=%%i:"
rem If 'subst' fails, the drive letter is already in use.
rem This way we can even detect optical drives that have a drive
rem letter but no media in them, a case that goes undetected when
rem using 'if exist'.
subst !drive! %SystemDrive%\ >nul
if !errorlevel! == 0 (
subst !drive! /d >nul
set "drive=%%i"
goto :freedrive0
)
)
set exitcode=1
set drive=
:freedrive0
endlocal & set "%output_var%=%drive%" & exit /b %exitcode%
:availablevolume
setlocal EnableDelayedExpansion
set exitcode=0
set "output_var=%~1"
for %%i in (test.sha512.hc,test.sha256.hc,test.whirlpool.hc,test.ripemd160.hc) do (
if exist %%i (
set "volume=%%i"
goto :availablevolume0
)
)
set exitcode=1
set volume=
:availablevolume0
endlocal & set "%output_var%=%volume%" & exit /b %exitcode%
:exit
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+35
View File
@@ -0,0 +1,35 @@
The source code for VeraCrypt EFI bootloader files is available at: https://github.com/veracrypt/VeraCrypt-DCS
Use tag "VeraCrypt_1.18" to extract the sources that were used when building VeraCrypt 1.18.
VeraCrypt-DCS uses EDK II as its UEFI development environement.
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
* 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
* 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
Secure Boot:
In order to allow VeraCrypt EFI bootloader to run when EFI Secure Boot is enabled, VeraCrypt EFI bootloader files are signed
using a custom key whose public part can be loader into Secure Boot to allow the verification of VeraCrypt EFI files.
below are instruction to update Secure Boot configuration:
1. Enter BIOS configuration
2. Switch Secure boot to setup mode (or custom mode). It deletes PK (platform certificate) and allows to load DCS platform key.
3. Boot Windows
4. execute from admin command prompt
powershell -File sb_set_siglists.ps1
It sets in PK (platform key) - DCS_platform
It sets in KEK (key exchange key) - DCS_key_exchange
It sets in db - DCS_sign MicWinProPCA2011_2011-10-19 MicCorUEFCA2011_2011-06-27
All DCS modules are protected by DCS_sign.
All Windows modules are protected by MicWinProPCA2011_2011-10-19
All SHIM(linux) modules are protected by MicCorUEFCA2011_2011-06-27
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3
View File
@@ -0,0 +1,3 @@
Apart from DCS certificates, there are two public DB entries - one for Windows and one for the UEFI Certificate Authority (CA).
Windows DB: http://www.microsoft.com/pkiops/certs/MicWinProPCA2011_2011-10-19.crt
UEFI DB: http://www.microsoft.com/pkiops/certs/MicCorUEFCA2011_2011-06-27.crt
+22
View File
@@ -0,0 +1,22 @@
Set-ExecutionPolicy Bypass -Force
Import-Module secureboot
Set-SecureBootUEFI -Name PK -Time 2015-09-11 -Content $null
Set-SecureBootUEFI -Name KEK -Time 2015-09-11 -Content $null
Set-SecureBootUEFI -Name db -Time 2015-09-11 -Content $null
Set-SecureBootUEFI -Name dbx -Time 2015-09-11 -Content $null
Write-Host "Setting self-signed PK..."
Set-SecureBootUEFI -Time 2016-08-08T00:00:00Z -ContentFilePath siglists\DCS_platform_SigList.bin -SignedFilePath siglists\DCS_platform_SigList_Serialization.bin.p7 -Name PK
Write-Host "Setting PK-signed KEK..."
Set-SecureBootUEFI -Time 2016-08-08T00:00:00Z -ContentFilePath siglists\DCS_key_exchange_SigList.bin -SignedFilePath siglists\DCS_key_exchange_SigList_Serialization.bin.p7 -Name KEK
Write-Host "Setting KEK-signed DCS cert in db..."
Set-SecureBootUEFI -Time 2016-08-08T00:00:00Z -ContentFilePath siglists\DCS_sign_SigList.bin -SignedFilePath siglists\DCS_sign_SigList_Serialization.bin.p7 -Name db
Write-Host "Setting KEK-signed MS cert in db..."
Set-SecureBootUEFI -Time 2016-08-08T00:00:00Z -ContentFilePath siglists\MicWinProPCA2011_2011-10-19_SigList.bin -SignedFilePath siglists\MicWinProPCA2011_2011-10-19_SigList_Serialization.bin.p7 -Name db -AppendWrite:$true
Write-Host "Setting KEK-signed MS UEFI cert in db..."
Set-SecureBootUEFI -Time 2016-08-08T00:00:00Z -ContentFilePath siglists\MicCorUEFCA2011_2011-06-27_SigList.bin -SignedFilePath siglists\MicCorUEFCA2011_2011-06-27_SigList_Serialization.bin.p7 -Name db -AppendWrite:$true
Binary file not shown.
Binary file not shown.
Binary file not shown.
+32 -28
View File
@@ -1,28 +1,32 @@
/* /*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved. Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
Governed by the TrueCrypt License 3.0 the full text of which is contained in by the TrueCrypt License 3.0.
the file License.txt included in TrueCrypt binary and source code distribution
packages. Modifications and additions to the original source code (contained in this file)
*/ and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
#ifndef TC_HEADER_Boot_Bios contained in the file License.txt included in VeraCrypt binary and source
#define TC_HEADER_Boot_Bios code distribution packages.
*/
#include "Platform.h"
#ifndef TC_HEADER_Boot_Bios
#define TC_LB_SIZE_BIT_SHIFT_DIVISOR 9 #define TC_HEADER_Boot_Bios
#define TC_FIRST_BIOS_DRIVE 0x80 #include "Platform.h"
#define TC_LAST_BIOS_DRIVE 0x8f
#define TC_INVALID_BIOS_DRIVE (TC_FIRST_BIOS_DRIVE - 1) #define TC_LB_SIZE_BIT_SHIFT_DIVISOR 9
enum #define TC_FIRST_BIOS_DRIVE 0x80
{ #define TC_LAST_BIOS_DRIVE 0x8f
BiosResultSuccess = 0x00, #define TC_INVALID_BIOS_DRIVE (TC_FIRST_BIOS_DRIVE - 1)
BiosResultInvalidFunction = 0x01
}; enum
{
typedef byte BiosResult; BiosResultSuccess = 0x00,
BiosResultInvalidFunction = 0x01
#endif // TC_HEADER_Boot_Bios };
typedef byte BiosResult;
#endif // TC_HEADER_Boot_Bios
+250 -242
View File
@@ -1,242 +1,250 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="9.00" Version="9.00"
Name="Boot" Name="Boot"
ProjectGUID="{8B7F059F-E4C7-4E11-88F5-EE8B8433072E}" ProjectGUID="{8B7F059F-E4C7-4E11-88F5-EE8B8433072E}"
RootNamespace="Boot" RootNamespace="Boot"
Keyword="MakeFileProj" Keyword="MakeFileProj"
TargetFrameworkVersion="131072" TargetFrameworkVersion="131072"
> >
<Platforms> <Platforms>
<Platform <Platform
Name="Win32" Name="Win32"
/> />
</Platforms> </Platforms>
<ToolFiles> <ToolFiles>
</ToolFiles> </ToolFiles>
<Configurations> <Configurations>
<Configuration <Configuration
Name="Release|Win32" Name="Release|Win32"
OutputDirectory="$(ConfigurationName)" OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="0" ConfigurationType="0"
> >
<Tool <Tool
Name="VCNMakeTool" Name="VCNMakeTool"
BuildCommandLine="md Release 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1&#x0D;&#x0A;&#x0D;&#x0A;md Release_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES&#x0D;&#x0A;&#x0D;&#x0A;md Release_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT&#x0D;&#x0A;&#x0D;&#x0A;md Release_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH&#x0D;&#x0A;&#x0D;&#x0A;md Rescue 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1" BuildCommandLine="md Release 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1&#x0D;&#x0A;&#x0D;&#x0A;md Release_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Release_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES&#x0D;&#x0A;&#x0D;&#x0A;md Release_AES_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Release_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT&#x0D;&#x0A;&#x0D;&#x0A;md Release_Serpent_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Release_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH&#x0D;&#x0A;&#x0D;&#x0A;md Release_Twofish_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Release_Camellia 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA&#x0D;&#x0A;&#x0D;&#x0A;md Release_Camellia_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Rescue 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_AES_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Serpent_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Twofish_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Camellia 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Camellia_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1 SINGLE_PRF=SHA2"
ReBuildCommandLine="del /q /s Release &gt;NUL:&#x0D;&#x0A;md Release 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_AES &gt;NUL:&#x0D;&#x0A;md Release_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Serpent &gt;NUL:&#x0D;&#x0A;md Release_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Twofish &gt;NUL:&#x0D;&#x0A;md Release_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue &gt;NUL:&#x0D;&#x0A;md Rescue 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_AES &gt;NUL:&#x0D;&#x0A;md Rescue_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Serpent &gt;NUL:&#x0D;&#x0A;md Rescue_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Twofish &gt;NUL:&#x0D;&#x0A;md Rescue_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1" ReBuildCommandLine="del /q /s Release &gt;NUL:&#x0D;&#x0A;md Release 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_SHA2 &gt;NUL:&#x0D;&#x0A;md Release_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_AES &gt;NUL:&#x0D;&#x0A;md Release_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_AES_SHA2 &gt;NUL:&#x0D;&#x0A;md Release_AES_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Serpent &gt;NUL:&#x0D;&#x0A;md Release_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Serpent_SHA2 &gt;NUL:&#x0D;&#x0A;md Release_Serpent_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Twofish &gt;NUL:&#x0D;&#x0A;md Release_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Twofish_SHA2 &gt;NUL:&#x0D;&#x0A;md Release_Twofish_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Camellia &gt;NUL:&#x0D;&#x0A;md Release_Camellia 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Camellia_SHA2 &gt;NUL:&#x0D;&#x0A;md Release_Camellia_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue &gt;NUL:&#x0D;&#x0A;md Rescue 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_SHA2 &gt;NUL:&#x0D;&#x0A;md Rescue_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_AES &gt;NUL:&#x0D;&#x0A;md Rescue_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_AES_SHA2 &gt;NUL:&#x0D;&#x0A;md Rescue_AES_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Serpent &gt;NUL:&#x0D;&#x0A;md Rescue_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Serpent_SHA2 &gt;NUL:&#x0D;&#x0A;md Rescue_Serpent_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Twofish &gt;NUL:&#x0D;&#x0A;md Rescue_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Twofish_SHA2 &gt;NUL:&#x0D;&#x0A;md Rescue_Twofish_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Camellia &gt;NUL:&#x0D;&#x0A;md Rescue_Camellia 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Camellia_SHA2 &gt;NUL:&#x0D;&#x0A;md Rescue_Camellia_SHA2 2&gt;NUL:&#x0D;&#x0A;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 Rescue Rescue_AES Rescue_Serpent Rescue_Twofish &gt;NUL:" CleanCommandLine="del /q /s Release Release_AES Release_Serpent Release_Twofish Release_Camellia Rescue Rescue_AES Rescue_Serpent Rescue_Twofish Rescue_Camellia &gt;NUL:&#x0D;&#x0A;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 &gt;NUL:&#x0D;&#x0A;"
Output="Release\BootLoader.com" Output="Release\BootLoader.com"
PreprocessorDefinitions="WIN32;NDEBUG" PreprocessorDefinitions="WIN32;NDEBUG"
IncludeSearchPath="&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)\Common&quot;;&quot;$(SolutionDir)\Crypto&quot;;&quot;$(MSVC16_ROOT)\Include&quot;" IncludeSearchPath="&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)\Common&quot;;&quot;$(SolutionDir)\Crypto&quot;;&quot;$(MSVC16_ROOT)\Include&quot;"
ForcedIncludes="" ForcedIncludes=""
AssemblySearchPath="" AssemblySearchPath=""
ForcedUsingAssemblies="" ForcedUsingAssemblies=""
CompileAsManaged="" CompileAsManaged=""
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="Release Loader|Win32" Name="Release Loader|Win32"
OutputDirectory="$(ConfigurationName)" OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="0" ConfigurationType="0"
> >
<Tool <Tool
Name="VCNMakeTool" Name="VCNMakeTool"
BuildCommandLine="md Release 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1&#x0D;&#x0A;&#x0D;&#x0A;md Release_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES&#x0D;&#x0A;&#x0D;&#x0A;md Release_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT&#x0D;&#x0A;&#x0D;&#x0A;md Release_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH" BuildCommandLine="md Release 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1&#x0D;&#x0A;&#x0D;&#x0A;md Release_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES&#x0D;&#x0A;&#x0D;&#x0A;md Release_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT&#x0D;&#x0A;&#x0D;&#x0A;md Release_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH"
ReBuildCommandLine="del /q /s Release &gt;NUL:&#x0D;&#x0A;md Release 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_AES &gt;NUL:&#x0D;&#x0A;md Release_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Serpent &gt;NUL:&#x0D;&#x0A;md Release_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Twofish &gt;NUL:&#x0D;&#x0A;md Release_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH" ReBuildCommandLine="del /q /s Release &gt;NUL:&#x0D;&#x0A;md Release 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_AES &gt;NUL:&#x0D;&#x0A;md Release_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Serpent &gt;NUL:&#x0D;&#x0A;md Release_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Twofish &gt;NUL:&#x0D;&#x0A;md Release_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH"
CleanCommandLine="del /q /s Release Release_AES Release_Serpent Release_Twofish &gt;NUL:" CleanCommandLine="del /q /s Release Release_AES Release_Serpent Release_Twofish &gt;NUL:"
Output="Release\BootLoader.com" Output="Release\BootLoader.com"
PreprocessorDefinitions="WIN32;NDEBUG" PreprocessorDefinitions="WIN32;NDEBUG"
IncludeSearchPath="&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)\Common&quot;;&quot;$(SolutionDir)\Crypto&quot;;&quot;$(MSVC16_ROOT)\Include&quot;" IncludeSearchPath="&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)\Common&quot;;&quot;$(SolutionDir)\Crypto&quot;;&quot;$(MSVC16_ROOT)\Include&quot;"
ForcedIncludes="" ForcedIncludes=""
AssemblySearchPath="" AssemblySearchPath=""
ForcedUsingAssemblies="" ForcedUsingAssemblies=""
CompileAsManaged="" CompileAsManaged=""
/> />
</Configuration> </Configuration>
</Configurations> </Configurations>
<References> <References>
</References> </References>
<Files> <Files>
<Filter <Filter
Name="Source Files" Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
> >
<File <File
RelativePath=".\BootConfig.cpp" RelativePath=".\BootConfig.cpp"
> >
</File> </File>
<File <File
RelativePath=".\BootConsoleIo.cpp" RelativePath=".\BootConsoleIo.cpp"
> >
</File> </File>
<File <File
RelativePath=".\BootCrt.asm" RelativePath=".\BootCrt.asm"
> >
</File> </File>
<File <File
RelativePath=".\BootDebug.cpp" RelativePath=".\BootDebug.cpp"
> >
</File> </File>
<File <File
RelativePath=".\BootDiskIo.cpp" RelativePath=".\BootDiskIo.cpp"
> >
</File> </File>
<File <File
RelativePath=".\BootEncryptedIo.cpp" RelativePath=".\BootEncryptedIo.cpp"
> >
</File> </File>
<File <File
RelativePath=".\BootMain.cpp" RelativePath=".\BootMain.cpp"
> >
</File> </File>
<File <File
RelativePath=".\BootMemory.cpp" RelativePath=".\BootMemory.cpp"
> >
</File> </File>
<File <File
RelativePath=".\BootSector.asm" RelativePath=".\BootSector.asm"
> >
</File> </File>
<File <File
RelativePath=".\Decompressor.c" RelativePath=".\Decompressor.c"
> >
</File> </File>
<File <File
RelativePath=".\IntFilter.cpp" RelativePath=".\IntFilter.cpp"
> >
</File> </File>
<File <File
RelativePath=".\Platform.cpp" RelativePath=".\Platform.cpp"
> >
</File> </File>
<Filter <Filter
Name="Common" Name="Common"
> >
<File <File
RelativePath="..\..\Common\Crc.c" RelativePath="..\..\Common\Crc.c"
> >
</File> </File>
<File <File
RelativePath="..\..\Common\Crypto.c" RelativePath="..\..\Common\Crypto.c"
> >
</File> </File>
<File <File
RelativePath="..\..\Common\Endian.c" RelativePath="..\..\Common\Endian.c"
> >
</File> </File>
<File <File
RelativePath="..\..\Common\Pkcs5.c" RelativePath="..\..\Common\Pkcs5.c"
> >
</File> </File>
<File <File
RelativePath="..\..\Common\Volumes.c" RelativePath="..\..\Common\Volumes.c"
> >
</File> </File>
<File <File
RelativePath="..\..\Common\Xts.c" RelativePath="..\..\Common\Xts.c"
> >
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="Crypto" Name="Crypto"
> >
<File <File
RelativePath="..\..\Crypto\Aes_hw_cpu.asm" RelativePath="..\..\Crypto\Aes_hw_cpu.asm"
> >
</File> </File>
<File <File
RelativePath="..\..\Crypto\AesSmall.c" RelativePath="..\..\Crypto\AesSmall.c"
> >
</File> </File>
<File <File
RelativePath="..\..\Crypto\AesSmall_x86.asm" RelativePath="..\..\Crypto\AesSmall_x86.asm"
> >
</File> </File>
<File <File
RelativePath="..\..\Crypto\Rmd160.c" RelativePath="..\..\Crypto\CamelliaSmall.c"
> >
</File> </File>
<File <File
RelativePath="..\..\Crypto\Serpent.c" RelativePath="..\..\Crypto\Rmd160.c"
> >
</File> </File>
<File <File
RelativePath="..\..\Crypto\Twofish.c" RelativePath="..\..\Crypto\Serpent.c"
> >
</File> </File>
</Filter> <File
</Filter> RelativePath="..\..\Crypto\Sha2Small.c"
<Filter >
Name="Header Files" </File>
Filter="h;hpp;hxx;hm;inl;inc;xsd" <File
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" RelativePath="..\..\Crypto\Twofish.c"
> >
<File </File>
RelativePath=".\Bios.h" </Filter>
> </Filter>
</File> <Filter
<File Name="Header Files"
RelativePath=".\BootCommon.h" Filter="h;hpp;hxx;hm;inl;inc;xsd"
> UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
</File> >
<File <File
RelativePath=".\BootConfig.h" RelativePath=".\Bios.h"
> >
</File> </File>
<File <File
RelativePath=".\BootConsoleIo.h" RelativePath=".\BootCommon.h"
> >
</File> </File>
<File <File
RelativePath=".\BootDebug.h" RelativePath=".\BootConfig.h"
> >
</File> </File>
<File <File
RelativePath=".\BootDefs.h" RelativePath=".\BootConsoleIo.h"
> >
</File> </File>
<File <File
RelativePath=".\BootDiskIo.h" RelativePath=".\BootDebug.h"
> >
</File> </File>
<File <File
RelativePath=".\BootEncryptedIo.h" RelativePath=".\BootDefs.h"
> >
</File> </File>
<File <File
RelativePath=".\BootMain.h" RelativePath=".\BootDiskIo.h"
> >
</File> </File>
<File <File
RelativePath=".\BootMemory.h" RelativePath=".\BootEncryptedIo.h"
> >
</File> </File>
<File <File
RelativePath=".\BootStrings.h" RelativePath=".\BootMain.h"
> >
</File> </File>
<File <File
RelativePath=".\IntFilter.h" RelativePath=".\BootMemory.h"
> >
</File> </File>
<File <File
RelativePath=".\Platform.h" RelativePath=".\BootStrings.h"
> >
</File> </File>
</Filter> <File
<Filter RelativePath=".\IntFilter.h"
Name="Build Files" >
> </File>
<File <File
RelativePath=".\Makefile" RelativePath=".\Platform.h"
> >
</File> </File>
</Filter> </Filter>
</Files> <Filter
<Globals> Name="Build Files"
</Globals> >
</VisualStudioProject> <File
RelativePath=".\Makefile"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
+273
View File
@@ -0,0 +1,273 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release Loader|Win32">
<Configuration>Release Loader</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{8B7F059F-E4C7-4E11-88F5-EE8B8433072E}</ProjectGuid>
<RootNamespace>Boot</RootNamespace>
<Keyword>MakeFileProj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">md Release 2&gt;NUL:
nmake.exe /nologo RELEASE=1
md Release_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2
md Release_AES 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES
md Release_AES_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2
md Release_Serpent 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT
md Release_Serpent_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2
md Release_Twofish 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH
md Release_Twofish_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2
md Release_Camellia 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA
md Release_Camellia_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA SINGLE_PRF=SHA2
md Rescue 2&gt;NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1
md Rescue_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2
md Rescue_AES 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1
md Rescue_AES_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2
md Rescue_Serpent 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1
md Rescue_Serpent_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2
md Rescue_Twofish 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1
md Rescue_Twofish_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2
md Rescue_Camellia 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1
md Rescue_Camellia_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1 SINGLE_PRF=SHA2</NMakeBuildCommandLine>
<NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">del /q /s Release &gt;NUL:
md Release 2&gt;NUL:
nmake.exe /nologo RELEASE=1
del /q /s Release_SHA2 &gt;NUL:
md Release_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2
del /q /s Release_AES &gt;NUL:
md Release_AES 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES
del /q /s Release_AES_SHA2 &gt;NUL:
md Release_AES_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2
del /q /s Release_Serpent &gt;NUL:
md Release_Serpent 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT
del /q /s Release_Serpent_SHA2 &gt;NUL:
md Release_Serpent_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2
del /q /s Release_Twofish &gt;NUL:
md Release_Twofish 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH
del /q /s Release_Twofish_SHA2 &gt;NUL:
md Release_Twofish_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2
del /q /s Release_Camellia &gt;NUL:
md Release_Camellia 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA
del /q /s Release_Camellia_SHA2 &gt;NUL:
md Release_Camellia_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA SINGLE_PRF=SHA2
del /q /s Rescue &gt;NUL:
md Rescue 2&gt;NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1
del /q /s Rescue_SHA2 &gt;NUL:
md Rescue_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2
del /q /s Rescue_AES &gt;NUL:
md Rescue_AES 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1
del /q /s Rescue_AES_SHA2 &gt;NUL:
md Rescue_AES_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2
del /q /s Rescue_Serpent &gt;NUL:
md Rescue_Serpent 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1
del /q /s Rescue_Serpent_SHA2 &gt;NUL:
md Rescue_Serpent_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2
del /q /s Rescue_Twofish &gt;NUL:
md Rescue_Twofish 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1
del /q /s Rescue_Twofish_SHA2 &gt;NUL:
md Rescue_Twofish_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2
del /q /s Rescue_Camellia &gt;NUL:
md Rescue_Camellia 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1
del /q /s Rescue_Camellia_SHA2 &gt;NUL:
md Rescue_Camellia_SHA2 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1 SINGLE_PRF=SHA2</NMakeReBuildCommandLine>
<NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">del /q /s Release Release_AES Release_Serpent Release_Twofish Release_Camellia Rescue Rescue_AES Rescue_Serpent Rescue_Twofish Rescue_Camellia &gt;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 &gt;NUL:
</NMakeCleanCommandLine>
<NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\BootLoader.com</NMakeOutput>
<NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir);$(SolutionDir)\Common;$(SolutionDir)\Crypto;$(MSVC16_ROOT)\Include;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
<NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
<NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
<NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(Configuration)\</IntDir>
<NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">md Release 2&gt;NUL:
nmake.exe /nologo RELEASE=1
md Release_AES 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES
md Release_Serpent 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT
md Release_Twofish 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH</NMakeBuildCommandLine>
<NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">del /q /s Release &gt;NUL:
md Release 2&gt;NUL:
nmake.exe /nologo RELEASE=1
del /q /s Release_AES &gt;NUL:
md Release_AES 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES
del /q /s Release_Serpent &gt;NUL:
md Release_Serpent 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT
del /q /s Release_Twofish &gt;NUL:
md Release_Twofish 2&gt;NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH</NMakeReBuildCommandLine>
<NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">del /q /s Release Release_AES Release_Serpent Release_Twofish &gt;NUL:</NMakeCleanCommandLine>
<NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">Release\BootLoader.com</NMakeOutput>
<NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(SolutionDir);$(SolutionDir)\Common;$(SolutionDir)\Crypto;$(MSVC16_ROOT)\Include;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
<NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
<NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
<NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
</PropertyGroup>
<ItemDefinitionGroup>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="BootConfig.cpp" />
<ClCompile Include="BootConsoleIo.cpp" />
<ClCompile Include="BootDebug.cpp" />
<ClCompile Include="BootDiskIo.cpp" />
<ClCompile Include="BootEncryptedIo.cpp" />
<ClCompile Include="BootMain.cpp" />
<ClCompile Include="BootMemory.cpp" />
<ClCompile Include="Decompressor.c" />
<ClCompile Include="IntFilter.cpp" />
<ClCompile Include="Platform.cpp" />
<ClCompile Include="..\..\Common\Crc.c" />
<ClCompile Include="..\..\Common\Crypto.c" />
<ClCompile Include="..\..\Common\Endian.c" />
<ClCompile Include="..\..\Common\Pkcs5.c" />
<ClCompile Include="..\..\Common\Volumes.c" />
<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" />
</ItemGroup>
<ItemGroup>
<None Include="BootCrt.asm" />
<None Include="BootSector.asm" />
<None Include="..\..\Crypto\Aes_hw_cpu.asm" />
<None Include="..\..\Crypto\AesSmall_x86.asm" />
<None Include="Makefile" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Bios.h" />
<ClInclude Include="BootCommon.h" />
<ClInclude Include="BootConfig.h" />
<ClInclude Include="BootConsoleIo.h" />
<ClInclude Include="BootDebug.h" />
<ClInclude Include="BootDefs.h" />
<ClInclude Include="BootDiskIo.h" />
<ClInclude Include="BootEncryptedIo.h" />
<ClInclude Include="BootMain.h" />
<ClInclude Include="BootMemory.h" />
<ClInclude Include="BootStrings.h" />
<ClInclude Include="IntFilter.h" />
<ClInclude Include="Platform.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+148
View File
@@ -0,0 +1,148 @@
<?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="Source Files\Common">
<UniqueIdentifier>{851ac58e-36e0-4dfa-a208-6da2330f5959}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\Crypto">
<UniqueIdentifier>{76da5bdb-fe11-430a-8667-2fe7f9ac3667}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Build Files">
<UniqueIdentifier>{732efef1-4474-4845-aa74-17b852cc0f2e}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="BootConfig.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BootConsoleIo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BootDebug.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BootDiskIo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BootEncryptedIo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BootMain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BootMemory.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Decompressor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="IntFilter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Platform.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\Common\Crc.c">
<Filter>Source Files\Common</Filter>
</ClCompile>
<ClCompile Include="..\..\Common\Crypto.c">
<Filter>Source Files\Common</Filter>
</ClCompile>
<ClCompile Include="..\..\Common\Endian.c">
<Filter>Source Files\Common</Filter>
</ClCompile>
<ClCompile Include="..\..\Common\Pkcs5.c">
<Filter>Source Files\Common</Filter>
</ClCompile>
<ClCompile Include="..\..\Common\Volumes.c">
<Filter>Source Files\Common</Filter>
</ClCompile>
<ClCompile Include="..\..\Common\Xts.c">
<Filter>Source Files\Common</Filter>
</ClCompile>
<ClCompile Include="..\..\Crypto\AesSmall.c">
<Filter>Source Files\Crypto</Filter>
</ClCompile>
<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>
<ClCompile Include="..\..\Crypto\Sha2Small.c">
<Filter>Source Files\Crypto</Filter>
</ClCompile>
<ClCompile Include="..\..\Crypto\Twofish.c">
<Filter>Source Files\Crypto</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="BootCrt.asm">
<Filter>Source Files</Filter>
</None>
<None Include="BootSector.asm">
<Filter>Source Files</Filter>
</None>
<None Include="..\..\Crypto\Aes_hw_cpu.asm">
<Filter>Source Files\Crypto</Filter>
</None>
<None Include="..\..\Crypto\AesSmall_x86.asm">
<Filter>Source Files\Crypto</Filter>
</None>
<None Include="Makefile">
<Filter>Build Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Bios.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="BootCommon.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="BootConfig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="BootConsoleIo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="BootDebug.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="BootDefs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="BootDiskIo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="BootEncryptedIo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="BootMain.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="BootMemory.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="BootStrings.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="IntFilter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Platform.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
+3
View File
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
+214 -78
View File
@@ -1,78 +1,214 @@
/* /*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved. Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
Governed by the TrueCrypt License 3.0 the full text of which is contained in by the TrueCrypt License 3.0.
the file License.txt included in TrueCrypt binary and source code distribution
packages. Modifications and additions to the original source code (contained in this file)
*/ and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
#ifndef TC_HEADER_Boot_BootCommon contained in the file License.txt included in VeraCrypt binary and source
#define TC_HEADER_Boot_BootCommon code distribution packages.
*/
#include "Common/Password.h"
#include "BootDefs.h" #ifndef TC_HEADER_Boot_BootCommon
#define TC_HEADER_Boot_BootCommon
// 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 0x060a #include "Common/Password.h"
#include "BootDefs.h"
#define TC_BOOT_LOADER_AREA_SIZE (TC_BOOT_LOADER_AREA_SECTOR_COUNT * TC_SECTOR_SIZE_BIOS)
// The user will be advised to upgrade the rescue disk if upgrading from the following or any previous version
#define TC_BOOT_VOLUME_HEADER_SECTOR (TC_BOOT_LOADER_AREA_SECTOR_COUNT - 1) #define TC_RESCUE_DISK_UPGRADE_NOTICE_MAX_VERSION 0x0117
#define TC_BOOT_VOLUME_HEADER_SECTOR_OFFSET (TC_BOOT_VOLUME_HEADER_SECTOR * TC_SECTOR_SIZE_BIOS)
#define TC_BOOT_LOADER_AREA_SIZE (TC_BOOT_LOADER_AREA_SECTOR_COUNT * TC_SECTOR_SIZE_BIOS)
#define TC_CD_BOOTSECTOR_OFFSET 0xd000
#define TC_CD_BOOT_LOADER_SECTOR 26 #define TC_BOOT_VOLUME_HEADER_SECTOR (TC_BOOT_LOADER_AREA_SECTOR_COUNT - 1)
#define TC_BOOT_VOLUME_HEADER_SECTOR_OFFSET (TC_BOOT_VOLUME_HEADER_SECTOR * TC_SECTOR_SIZE_BIOS)
#define TC_ORIG_BOOT_LOADER_BACKUP_SECTOR TC_BOOT_LOADER_AREA_SECTOR_COUNT
#define TC_ORIG_BOOT_LOADER_BACKUP_SECTOR_OFFSET (TC_ORIG_BOOT_LOADER_BACKUP_SECTOR * TC_SECTOR_SIZE_BIOS) #define TC_CD_BOOTSECTOR_OFFSET 0xd000
#define TC_CD_BOOT_LOADER_SECTOR 26
#define TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR (TC_ORIG_BOOT_LOADER_BACKUP_SECTOR + TC_BOOT_LOADER_AREA_SECTOR_COUNT)
#define TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR_OFFSET (TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR * TC_SECTOR_SIZE_BIOS) #define TC_ORIG_BOOT_LOADER_BACKUP_SECTOR TC_BOOT_LOADER_AREA_SECTOR_COUNT
#define TC_ORIG_BOOT_LOADER_BACKUP_SECTOR_OFFSET (TC_ORIG_BOOT_LOADER_BACKUP_SECTOR * TC_SECTOR_SIZE_BIOS)
#define TC_MBR_SECTOR 0
#define TC_MAX_MBR_BOOT_CODE_SIZE 440 #define TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR (TC_ORIG_BOOT_LOADER_BACKUP_SECTOR + TC_BOOT_LOADER_AREA_SECTOR_COUNT)
#define TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR_OFFSET (TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR * TC_SECTOR_SIZE_BIOS)
#define TC_MAX_EXTRA_BOOT_PARTITION_SIZE (512UL * 1024UL * 1024UL)
#define TC_MBR_SECTOR 0
#define TC_MAX_MBR_BOOT_CODE_SIZE 440
#pragma pack (1)
#define TC_MAX_EXTRA_BOOT_PARTITION_SIZE (512UL * 1024UL * 1024UL)
typedef struct
{
byte Flags; #pragma pack (1)
} BootSectorConfiguration;
typedef struct
{
// Modifying this value can introduce incompatibility with previous versions byte Flags;
#define TC_BOOT_LOADER_ARGS_OFFSET 0x10 } BootSectorConfiguration;
typedef struct
{ // Modifying this value can introduce incompatibility with previous versions
// Modifying this structure can introduce incompatibility with previous versions #define TC_BOOT_LOADER_ARGS_OFFSET 0x10
char Signature[8];
uint16 BootLoaderVersion; typedef struct
uint16 CryptoInfoOffset; {
uint16 CryptoInfoLength; // Modifying this structure can introduce incompatibility with previous versions
uint32 HeaderSaltCrc32; char Signature[8];
Password BootPassword; uint16 BootLoaderVersion;
uint64 HiddenSystemPartitionStart; uint16 CryptoInfoOffset;
uint64 DecoySystemPartitionStart; uint16 CryptoInfoLength;
uint32 Flags; uint32 HeaderSaltCrc32;
uint32 BootDriveSignature; Password BootPassword;
uint64 HiddenSystemPartitionStart;
uint32 BootArgumentsCrc32; uint64 DecoySystemPartitionStart;
uint32 Flags;
} BootArguments; uint32 BootDriveSignature;
// Modifying these values can introduce incompatibility with previous versions uint32 BootArgumentsCrc32;
#define TC_BOOT_ARGS_FLAG_EXTRA_BOOT_PARTITION 0x1
} BootArguments;
#pragma pack ()
// Modifying these values can introduce incompatibility with previous versions
// Boot arguments signature should not be defined as a static string #define TC_BOOT_ARGS_FLAG_EXTRA_BOOT_PARTITION 0x1
// Modifying these values can introduce incompatibility with previous versions
#define TC_SET_BOOT_ARGUMENTS_SIGNATURE(SG) do { SG[0] = 'T'; SG[1] = 'R'; SG[2] = 'U'; SG[3] = 'E'; SG[4] = 0x11; SG[5] = 0x23; SG[6] = 0x45; SG[7] = 0x66; } while (FALSE) #pragma pack ()
#define TC_IS_BOOT_ARGUMENTS_SIGNATURE(SG) (SG[0] == 'T' && SG[1] == 'R' && SG[2] == 'U' && SG[3] == 'E' && SG[4] == 0x11 && SG[5] == 0x23 && SG[6] == 0x45 && SG[7] == 0x66)
// Boot arguments signature should not be defined as a static string
// Modifying these values can introduce incompatibility with previous versions
#endif // TC_HEADER_Boot_BootCommon #define TC_SET_BOOT_ARGUMENTS_SIGNATURE(SG) do { SG[0] = 'T'; SG[1] = 'R'; SG[2] = 'U'; SG[3] = 'E'; SG[4] = 0x11; SG[5] = 0x23; SG[6] = 0x45; SG[7] = 0x66; } while (FALSE)
#define TC_IS_BOOT_ARGUMENTS_SIGNATURE(SG) (SG[0] == 'T' && SG[1] == 'R' && SG[2] == 'U' && SG[3] == 'E' && SG[4] == 0x11 && SG[5] == 0x23 && SG[6] == 0x45 && SG[7] == 0x66)
#if defined(_MSC_VER) && !defined(TC_WINDOWS_BOOT)
#define DCS_DISK_ENTRY_LIST_HEADER_SIGN SIGNATURE_64 ('D','C','S','D','E','L','S','T')
#define DE_IDX_CRYPTOHEADER 0
#define DE_IDX_LIST 1
#define DE_IDX_DISKID 2
#define DE_IDX_MAINGPTHDR 3
#define DE_IDX_MAINGPTENTRYS 4
#define DE_IDX_ALTGPTHDR 5
#define DE_IDX_ALTGPTENTRYS 6
#define DE_IDX_EXEC 7
#define DE_IDX_PWDCACHE 8
#define DE_IDX_RND 9
#define DE_IDX_TOTAL 10
static_assert(DE_IDX_TOTAL <= 15, "DE_IDX_TOTAL too big");
enum DcsDiskEntryTypes {
DE_Unused = 0,
DE_Sectors,
DE_List,
DE_DISKID,
DE_ExecParams,
DE_PwdCache,
DE_Rnd
};
#pragma pack(1)
typedef struct _SECREGION_BOOT_PARAMS {
uint64 Ptr;
uint32 Size;
uint32 Crc;
} SECREGION_BOOT_PARAMS;
typedef struct {
uint32 Data1;
uint16 Data2;
uint16 Data3;
byte Data4[8];
} DCS_GUID;
// DE types
typedef struct _DCS_DISK_ENTRY_SECTORS {
uint32 Type;
uint32 Offset; // Offset in memory
uint64 Reserved;
uint64 Start; // Start on disk (byte)
uint64 Length; // length on disk (byte)
} DCS_DISK_ENTRY_SECTORS;
static_assert(sizeof(DCS_DISK_ENTRY_SECTORS) == 32, "Wrong size DCS_DISK_ENTRY_SECTORS");
typedef struct _DCS_DISK_ENTRY_PARAMS {
uint32 Type;
uint32 Offset;
uint64 Reserved[2];
uint64 Length; // size of data
} DCS_DISK_ENTRY_PARAMS;
static_assert(sizeof(DCS_DISK_ENTRY_PARAMS) == 32, "Wrong size DCS_DISK_ENTRY_PARAMS");
typedef struct _DCS_DISK_ENTRY_DISKID {
uint32 Type;
uint32 MbrID;
uint64 ReservedDiskId;
DCS_GUID GptID;
} DCS_DISK_ENTRY_DISKID;
static_assert(sizeof(DCS_DISK_ENTRY_DISKID) == 32, "Wrong size DCS_DISK_ENTRY_DISKID");
#pragma warning(disable:4201)
typedef struct _DCS_DISK_ENTRY {
union {
struct {
uint32 Type;
uint32 Offset;
byte reserved[16];
uint64 Length; // size of structure at Offset
};
DCS_DISK_ENTRY_SECTORS Sectors;
DCS_DISK_ENTRY_DISKID DiskId;
DCS_DISK_ENTRY_PARAMS Prm;
};
} DCS_DISK_ENTRY;
#pragma warning(default:4201)
static_assert(sizeof(DCS_DISK_ENTRY) == 32, "Wrong size DCS_DISK_ENTRY");
// Static compile time checks field offsets
#ifndef FIELD_OFFSET
#define FIELD_OFFSET(t, f) ((UINTN)(&((t*)0)->f))
#endif
static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Type) == FIELD_OFFSET(DCS_DISK_ENTRY_SECTORS, Type), "Wrong Type offset");
static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Type) == FIELD_OFFSET(DCS_DISK_ENTRY_DISKID, Type), "Wrong Type offset");
static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Type) == FIELD_OFFSET(DCS_DISK_ENTRY_PARAMS, Type), "Wrong Type offset");
static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Length) == FIELD_OFFSET(DCS_DISK_ENTRY_SECTORS, Length), "Wrong Length offset");
static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Length) == FIELD_OFFSET(DCS_DISK_ENTRY_PARAMS, Length), "Wrong Length offset");
static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Offset) == FIELD_OFFSET(DCS_DISK_ENTRY_SECTORS, Offset), "Wrong Offset offset");
static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Offset) == FIELD_OFFSET(DCS_DISK_ENTRY_PARAMS, Offset), "Wrong Offset offset");
// DE type specific data
// DE List
typedef struct _DCS_DISK_ENTRY_LIST {
// EFI_TABLE_HEADER
uint64 Signature;
uint32 Revision;
uint32 HeaderSize; //< The size, in bytes, of the entire table including the EFI_TABLE_HEADER.
uint32 CRC32; //< The 32-bit CRC for the entire table. This value is computed by setting this field to 0, and computing the 32-bit CRC for HeaderSize bytes.
uint32 Reserved; //< Reserved field that must be set to 0.
//
uint32 Count;
uint32 DataSize;
//
DCS_DISK_ENTRY DE[15];
} DCS_DISK_ENTRY_LIST;
static_assert(sizeof(DCS_DISK_ENTRY_LIST) == 512, "Wrong size DCS_DISK_ENTRY_LIST");
typedef struct _DCS_DEP_EXEC {
DCS_GUID ExecPartGuid;
uint16 ExecCmd[248];
} DCS_DEP_EXEC;
static_assert(sizeof(DCS_DEP_EXEC) == 512, "Wrong size DCS_DEP_EXEC");
#define DCS_DEP_PWD_CACHE_SIGN SIGNATURE_64 ('P','W','D','C','A','C','H','E')
typedef struct _DCS_DEP_PWD_CACHE {
uint64 Sign;
uint32 CRC;
uint32 Count;
Password Pwd[4];
int32 Pim[4];
byte pad[512 - 8 - 4 - 4 - (sizeof(Password) + 4) * 4];
} DCS_DEP_PWD_CACHE;
static_assert(sizeof(DCS_DEP_PWD_CACHE) == 512, "Wrong size DCS_DEP_PWD_CACHE");
#pragma pack()
#endif // #if !defined(TC_WINDOWS_BOOT)
#endif // TC_HEADER_Boot_BootCommon
+102 -90
View File
@@ -1,90 +1,102 @@
/* /*
Copyright (c) 2008-2012 TrueCrypt Developers Association. All rights reserved. Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
Governed by the TrueCrypt License 3.0 the full text of which is contained in by the TrueCrypt License 3.0.
the file License.txt included in TrueCrypt binary and source code distribution
packages. Modifications and additions to the original source code (contained in this file)
*/ and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
#include "BootConfig.h" contained in the file License.txt included in VeraCrypt binary and source
code distribution packages.
byte BootSectorFlags; */
byte BootLoaderDrive; #include "BootConfig.h"
byte BootDrive;
bool BootDriveGeometryValid = false; byte BootSectorFlags;
bool PreventNormalSystemBoot = false;
bool PreventBootMenu = false; byte BootLoaderDrive;
char CustomUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH + 1]; byte BootDrive;
uint32 OuterVolumeBackupHeaderCrc; bool BootDriveGeometryValid = false;
bool PreventNormalSystemBoot = false;
bool BootStarted = false; bool PreventBootMenu = false;
char CustomUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH + 1];
DriveGeometry BootDriveGeometry; uint32 OuterVolumeBackupHeaderCrc;
CRYPTO_INFO *BootCryptoInfo; bool BootStarted = false;
Partition EncryptedVirtualPartition;
DriveGeometry BootDriveGeometry;
Partition ActivePartition;
Partition PartitionFollowingActive; CRYPTO_INFO *BootCryptoInfo;
bool ExtraBootPartitionPresent = false; Partition EncryptedVirtualPartition;
uint64 HiddenVolumeStartUnitNo;
uint64 HiddenVolumeStartSector; Partition ActivePartition;
Partition PartitionFollowingActive;
#ifndef TC_WINDOWS_BOOT_RESCUE_DISK_MODE bool ExtraBootPartitionPresent = false;
uint64 PimValueOrHiddenVolumeStartUnitNo; // reuse this variable for stored PIM value to reduce memory usage
void ReadBootSectorUserConfiguration () uint64 HiddenVolumeStartSector;
{
byte userConfig; #ifndef TC_WINDOWS_BOOT_RESCUE_DISK_MODE
AcquireSectorBuffer(); void ReadBootSectorUserConfiguration ()
{
if (ReadWriteMBR (false, BootLoaderDrive, true) != BiosResultSuccess) byte userConfig;
goto ret;
AcquireSectorBuffer();
userConfig = SectorBuffer[TC_BOOT_SECTOR_USER_CONFIG_OFFSET];
if (ReadWriteMBR (false, BootLoaderDrive, true) != BiosResultSuccess)
#ifdef TC_WINDOWS_BOOT_AES goto ret;
EnableHwEncryption (!(userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION));
#endif userConfig = SectorBuffer[TC_BOOT_SECTOR_USER_CONFIG_OFFSET];
PreventBootMenu = (userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_ESC); #ifdef TC_WINDOWS_BOOT_AES
EnableHwEncryption (!(userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION));
memcpy (CustomUserMessage, SectorBuffer + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET, TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH); #endif
CustomUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH] = 0;
PreventBootMenu = (userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_ESC);
if (userConfig & TC_BOOT_USER_CFG_FLAG_SILENT_MODE)
{ memcpy (CustomUserMessage, SectorBuffer + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET, TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH);
if (CustomUserMessage[0]) CustomUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH] = 0;
{
InitVideoMode(); if (userConfig & TC_BOOT_USER_CFG_FLAG_SILENT_MODE)
Print (CustomUserMessage); {
} if (CustomUserMessage[0])
{
DisableScreenOutput(); InitVideoMode();
} Print (CustomUserMessage);
}
OuterVolumeBackupHeaderCrc = *(uint32 *) (SectorBuffer + TC_BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET);
DisableScreenOutput();
ret: }
ReleaseSectorBuffer();
} if (userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_PIM)
{
PimValueOrHiddenVolumeStartUnitNo.LowPart = 0;
BiosResult UpdateBootSectorConfiguration (byte drive) memcpy (&PimValueOrHiddenVolumeStartUnitNo.LowPart, SectorBuffer + TC_BOOT_SECTOR_PIM_VALUE_OFFSET, TC_BOOT_SECTOR_PIM_VALUE_SIZE);
{ }
AcquireSectorBuffer(); else
PimValueOrHiddenVolumeStartUnitNo.LowPart = -1;
BiosResult result = ReadWriteMBR (false, drive);
if (result != BiosResultSuccess) OuterVolumeBackupHeaderCrc = *(uint32 *) (SectorBuffer + TC_BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET);
goto ret;
ret:
SectorBuffer[TC_BOOT_SECTOR_CONFIG_OFFSET] = BootSectorFlags; ReleaseSectorBuffer();
result = ReadWriteMBR (true, drive); }
ret:
ReleaseSectorBuffer(); BiosResult UpdateBootSectorConfiguration (byte drive)
return result; {
} AcquireSectorBuffer();
#endif // !TC_WINDOWS_BOOT_RESCUE_DISK_MODE BiosResult result = ReadWriteMBR (false, drive);
if (result != BiosResultSuccess)
goto ret;
SectorBuffer[TC_BOOT_SECTOR_CONFIG_OFFSET] = BootSectorFlags;
result = ReadWriteMBR (true, drive);
ret:
ReleaseSectorBuffer();
return result;
}
#endif // !TC_WINDOWS_BOOT_RESCUE_DISK_MODE
+46 -42
View File
@@ -1,42 +1,46 @@
/* /*
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved. Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
Governed by the TrueCrypt License 3.0 the full text of which is contained in by the TrueCrypt License 3.0.
the file License.txt included in TrueCrypt binary and source code distribution
packages. Modifications and additions to the original source code (contained in this file)
*/ and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
#ifndef TC_HEADER_Boot_BootConfig contained in the file License.txt included in VeraCrypt binary and source
#define TC_HEADER_Boot_BootConfig code distribution packages.
*/
#include "Crypto.h"
#include "Platform.h" #ifndef TC_HEADER_Boot_BootConfig
#include "BootDiskIo.h" #define TC_HEADER_Boot_BootConfig
extern byte BootSectorFlags; #include "Crypto.h"
#include "Platform.h"
extern byte BootLoaderDrive; #include "BootDiskIo.h"
extern byte BootDrive;
extern bool BootDriveGeometryValid; extern byte BootSectorFlags;
extern DriveGeometry BootDriveGeometry;
extern bool PreventNormalSystemBoot; extern byte BootLoaderDrive;
extern bool PreventBootMenu; extern byte BootDrive;
extern char CustomUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH + 1]; extern bool BootDriveGeometryValid;
extern uint32 OuterVolumeBackupHeaderCrc; extern DriveGeometry BootDriveGeometry;
extern bool PreventNormalSystemBoot;
extern bool BootStarted; extern bool PreventBootMenu;
extern char CustomUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH + 1];
extern CRYPTO_INFO *BootCryptoInfo; extern uint32 OuterVolumeBackupHeaderCrc;
extern Partition EncryptedVirtualPartition;
extern bool BootStarted;
extern Partition ActivePartition;
extern Partition PartitionFollowingActive; extern CRYPTO_INFO *BootCryptoInfo;
extern bool ExtraBootPartitionPresent; extern Partition EncryptedVirtualPartition;
extern uint64 HiddenVolumeStartUnitNo;
extern uint64 HiddenVolumeStartSector; extern Partition ActivePartition;
extern Partition PartitionFollowingActive;
extern bool ExtraBootPartitionPresent;
void ReadBootSectorUserConfiguration (); extern uint64 PimValueOrHiddenVolumeStartUnitNo; // reuse this variable for stored PIM value to reduce memory usage
BiosResult UpdateBootSectorConfiguration (byte drive); extern uint64 HiddenVolumeStartSector;
#endif // TC_HEADER_Boot_BootConfig
void ReadBootSectorUserConfiguration ();
BiosResult UpdateBootSectorConfiguration (byte drive);
#endif // TC_HEADER_Boot_BootConfig
+339 -330
View File
@@ -1,330 +1,339 @@
/* /*
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved. Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
Governed by the TrueCrypt License 3.0 the full text of which is contained in by the TrueCrypt License 3.0.
the file License.txt included in TrueCrypt binary and source code distribution
packages. Modifications and additions to the original source code (contained in this file)
*/ and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
#include "Platform.h" contained in the file License.txt included in VeraCrypt binary and source
#include "Bios.h" code distribution packages.
#include "BootConsoleIo.h" */
#include "BootDebug.h"
#include "BootStrings.h" #include "Platform.h"
#include "Bios.h"
#include "BootConsoleIo.h"
static int ScreenOutputDisabled = 0; #include "BootDebug.h"
#include "BootStrings.h"
void DisableScreenOutput ()
{
++ScreenOutputDisabled; static int ScreenOutputDisabled = 0;
}
void DisableScreenOutput ()
{
void EnableScreenOutput () ++ScreenOutputDisabled;
{ }
--ScreenOutputDisabled;
}
void EnableScreenOutput ()
{
void PrintChar (char c) --ScreenOutputDisabled;
{ }
#ifdef TC_BOOT_TRACING_ENABLED
WriteDebugPort (c);
#endif void PrintChar (char c)
{
if (ScreenOutputDisabled) #ifdef TC_BOOT_TRACING_ENABLED
return; WriteDebugPort (c);
#endif
__asm
{ if (ScreenOutputDisabled)
mov bx, 7 return;
mov al, c
mov ah, 0xe __asm
int 0x10 {
} mov bx, 7
} mov al, c
mov ah, 0xe
int 0x10
void PrintCharAtCursor (char c) }
{ }
if (ScreenOutputDisabled)
return;
void PrintCharAtCursor (char c)
__asm {
{ if (ScreenOutputDisabled)
mov bx, 7 return;
mov al, c
mov cx, 1 __asm
mov ah, 0xa {
int 0x10 mov bx, 7
} mov al, c
} mov cx, 1
mov ah, 0xa
int 0x10
void Print (const char *str) }
{ }
char c;
while (c = *str++)
PrintChar (c); void Print (const char *str)
} {
char c;
while (c = *str++)
void Print (uint32 number) PrintChar (c);
{ }
char str[12];
int pos = 0;
while (number >= 10) void Print (uint32 number)
{ {
str[pos++] = (char) (number % 10) + '0'; char str[12];
number /= 10; int pos = 0;
} while (number >= 10)
str[pos] = (char) (number % 10) + '0'; {
str[pos++] = (char) (number % 10) + '0';
while (pos >= 0) number /= 10;
PrintChar (str[pos--]); }
} str[pos] = (char) (number % 10) + '0';
while (pos >= 0)
void Print (const uint64 &number) PrintChar (str[pos--]);
{ }
if (number.HighPart == 0)
Print (number.LowPart);
else void Print (const uint64 &number)
PrintHex (number); {
} if (number.HighPart == 0)
Print (number.LowPart);
else
void PrintHex (byte b) PrintHex (number);
{ }
PrintChar (((b >> 4) >= 0xA ? 'A' - 0xA : '0') + (b >> 4));
PrintChar (((b & 0xF) >= 0xA ? 'A' - 0xA : '0') + (b & 0xF));
} void PrintHex (byte b)
{
PrintChar (((b >> 4) >= 0xA ? 'A' - 0xA : '0') + (b >> 4));
void PrintHex (uint16 data) PrintChar (((b & 0xF) >= 0xA ? 'A' - 0xA : '0') + (b & 0xF));
{ }
PrintHex (byte (data >> 8));
PrintHex (byte (data));
} void PrintHex (uint16 data)
{
PrintHex (byte (data >> 8));
void PrintHex (uint32 data) PrintHex (byte (data));
{ }
PrintHex (uint16 (data >> 16));
PrintHex (uint16 (data));
} void PrintHex (uint32 data)
{
PrintHex (uint16 (data >> 16));
void PrintHex (const uint64 &data) PrintHex (uint16 (data));
{ }
PrintHex (data.HighPart);
PrintHex (data.LowPart);
} void PrintHex (const uint64 &data)
{
void PrintRepeatedChar (char c, int n) PrintHex (data.HighPart);
{ PrintHex (data.LowPart);
while (n-- > 0) }
PrintChar (c);
} void PrintRepeatedChar (char c, int n)
{
while (n-- > 0)
void PrintEndl () PrintChar (c);
{ }
Print ("\r\n");
}
void PrintEndl ()
{
void PrintEndl (int cnt) Print ("\r\n");
{ }
while (cnt-- > 0)
PrintEndl ();
} void PrintEndl (int cnt)
{
while (cnt-- > 0)
void Beep () PrintEndl ();
{ }
PrintChar (7);
}
void Beep ()
{
void InitVideoMode () PrintChar (7);
{ }
if (ScreenOutputDisabled)
return;
void InitVideoMode ()
__asm {
{ if (ScreenOutputDisabled)
// Text mode 80x25 return;
mov ax, 3
int 0x10 __asm
{
// Page 0 // Text mode 80x25
mov ax, 0x500 mov ax, 3
int 0x10 int 0x10
}
} // Page 0
mov ax, 0x500
int 0x10
void ClearScreen () }
{ }
if (ScreenOutputDisabled)
return;
void ClearScreen ()
__asm {
{ if (ScreenOutputDisabled)
// White text on black return;
mov bh, 7
xor cx, cx __asm
mov dx, 0x184f {
mov ax, 0x600 // White text on black
int 0x10 mov bh, 7
xor cx, cx
// Cursor at 0,0 mov dx, 0x184f
xor bh, bh mov ax, 0x600
xor dx, dx int 0x10
mov ah, 2
int 0x10 // Cursor at 0,0
} xor bh, bh
} xor dx, dx
mov ah, 2
int 0x10
void PrintBackspace () }
{ }
PrintChar (TC_BIOS_CHAR_BACKSPACE);
PrintCharAtCursor (' ');
} void PrintBackspace ()
{
PrintChar (TC_BIOS_CHAR_BACKSPACE);
void PrintError (const char *message) PrintCharAtCursor (' ');
{ }
Print (TC_BOOT_STR_ERROR);
Print (message);
PrintEndl(); void PrintError (const char *message)
Beep(); {
} Print (TC_BOOT_STR_ERROR);
Print (message);
PrintEndl();
void PrintErrorNoEndl (const char *message) Beep();
{ }
Print (TC_BOOT_STR_ERROR);
Print (message);
Beep(); void PrintErrorNoEndl (const char *message)
} {
Print (TC_BOOT_STR_ERROR);
Print (message);
byte GetShiftFlags () Beep();
{ }
byte flags;
__asm
{ byte GetShiftFlags ()
mov ah, 2 {
int 0x16 byte flags;
mov flags, al __asm
} {
mov ah, 2
return flags; int 0x16
} mov flags, al
}
byte GetKeyboardChar () return flags;
{ }
return GetKeyboardChar (nullptr);
}
byte GetKeyboardChar ()
{
byte GetKeyboardChar (byte *scanCode) return GetKeyboardChar (nullptr);
{ }
// Work around potential BIOS bugs (Windows boot manager polls the keystroke buffer)
while (!IsKeyboardCharAvailable());
byte GetKeyboardChar (byte *scanCode)
byte asciiCode; {
byte scan; // Work around potential BIOS bugs (Windows boot manager polls the keystroke buffer)
__asm while (!IsKeyboardCharAvailable());
{
mov ah, 0 byte asciiCode;
int 0x16 byte scan;
mov asciiCode, al __asm
mov scan, ah {
} mov ah, 0
int 0x16
if (scanCode) mov asciiCode, al
*scanCode = scan; mov scan, ah
}
return asciiCode;
} if (scanCode)
*scanCode = scan;
bool IsKeyboardCharAvailable () return asciiCode;
{ }
bool available = false;
__asm
{ bool IsKeyboardCharAvailable ()
mov ah, 1 {
int 0x16 bool available = false;
jz not_avail __asm
mov available, true {
not_avail: mov ah, 1
} int 0x16
jz not_avail
return available; mov available, true
} not_avail:
}
bool EscKeyPressed () return available;
{ }
if (IsKeyboardCharAvailable ())
{
byte keyScanCode; bool EscKeyPressed ()
GetKeyboardChar (&keyScanCode); {
return keyScanCode == TC_BIOS_KEY_ESC; if (IsKeyboardCharAvailable ())
} {
byte keyScanCode;
return false; GetKeyboardChar (&keyScanCode);
} return keyScanCode == TC_BIOS_KEY_ESC;
}
void ClearBiosKeystrokeBuffer () return false;
{ }
__asm
{
push es void ClearBiosKeystrokeBuffer ()
xor ax, ax {
mov es, ax __asm
mov di, 0x41e {
mov cx, 32 push es
cld xor ax, ax
rep stosb mov es, ax
pop es mov di, 0x41e
} mov cx, 32
} cld
rep stosb
pop es
bool IsPrintable (char c) }
{ }
return c >= ' ' && c <= '~';
}
bool IsPrintable (char c)
{
int GetString (char *buffer, size_t bufferSize) return c >= ' ' && c <= '~';
{ }
byte c;
byte scanCode; bool IsDigit (char c)
size_t pos = 0; {
return c >= '0' && c <= '9';
while (pos < bufferSize) }
{
c = GetKeyboardChar (&scanCode);
int GetString (char *buffer, size_t bufferSize)
if (scanCode == TC_BIOS_KEY_ENTER) {
break; byte c;
byte scanCode;
if (scanCode == TC_BIOS_KEY_ESC) size_t pos = 0;
return 0;
while (pos < bufferSize)
buffer[pos++] = c; {
PrintChar (IsPrintable (c) ? c : ' '); c = GetKeyboardChar (&scanCode);
}
if (scanCode == TC_BIOS_KEY_ENTER)
return pos; break;
}
if (scanCode == TC_BIOS_KEY_ESC)
return 0;
buffer[pos++] = c;
PrintChar (IsPrintable (c) ? c : ' ');
}
return pos;
}
+72 -67
View File
@@ -1,67 +1,72 @@
/* /*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved. Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
Governed by the TrueCrypt License 3.0 the full text of which is contained in by the TrueCrypt License 3.0.
the file License.txt included in TrueCrypt binary and source code distribution
packages. Modifications and additions to the original source code (contained in this file)
*/ and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
#ifndef TC_HEADER_Boot_BootConsoleIo contained in the file License.txt included in VeraCrypt binary and source
#define TC_HEADER_Boot_BootConsoleIo code distribution packages.
*/
#include "Platform.h"
#ifndef TC_HEADER_Boot_BootConsoleIo
#define TC_DEBUG_PORT 0 #define TC_HEADER_Boot_BootConsoleIo
#define TC_BIOS_KEY_ESC 1 #include "Platform.h"
#define TC_BIOS_KEY_BACKSPACE 14
#define TC_BIOS_KEY_ENTER 28 #define TC_DEBUG_PORT 0
#define TC_BIOS_KEY_F1 0x3b
#define TC_BIOS_KEY_F2 0x3c #define TC_BIOS_KEY_ESC 1
#define TC_BIOS_KEY_F3 0x3d #define TC_BIOS_KEY_BACKSPACE 14
#define TC_BIOS_KEY_F4 0x3e #define TC_BIOS_KEY_ENTER 28
#define TC_BIOS_KEY_F5 0x3f #define TC_BIOS_KEY_F1 0x3b
#define TC_BIOS_KEY_F6 0x40 #define TC_BIOS_KEY_F2 0x3c
#define TC_BIOS_KEY_F7 0x41 #define TC_BIOS_KEY_F3 0x3d
#define TC_BIOS_KEY_F8 0x42 #define TC_BIOS_KEY_F4 0x3e
#define TC_BIOS_KEY_F9 0x43 #define TC_BIOS_KEY_F5 0x3f
#define TC_BIOS_KEY_F10 0x44 #define TC_BIOS_KEY_F6 0x40
#define TC_BIOS_KEY_F7 0x41
#define TC_BIOS_SHIFTMASK_CAPSLOCK (1 << 6) #define TC_BIOS_KEY_F8 0x42
#define TC_BIOS_SHIFTMASK_LSHIFT (1 << 1) #define TC_BIOS_KEY_F9 0x43
#define TC_BIOS_SHIFTMASK_RSHIFT (1 << 0) #define TC_BIOS_KEY_F10 0x44
#define TC_BIOS_CHAR_BACKSPACE 8 #define TC_BIOS_SHIFTMASK_CAPSLOCK (1 << 6)
#define TC_BIOS_SHIFTMASK_LSHIFT (1 << 1)
#define TC_BIOS_MAX_CHARS_PER_LINE 80 #define TC_BIOS_SHIFTMASK_RSHIFT (1 << 0)
void Beep (); #define TC_BIOS_CHAR_BACKSPACE 8
void ClearBiosKeystrokeBuffer ();
void ClearScreen (); #define TC_BIOS_MAX_CHARS_PER_LINE 80
void DisableScreenOutput ();
void EnableScreenOutput (); void Beep ();
bool EscKeyPressed (); void ClearBiosKeystrokeBuffer ();
byte GetKeyboardChar (); void ClearScreen ();
byte GetKeyboardChar (byte *scanCode); void DisableScreenOutput ();
byte GetShiftFlags (); void EnableScreenOutput ();
int GetString (char *buffer, size_t bufferSize); bool EscKeyPressed ();
void InitVideoMode (); byte GetKeyboardChar ();
bool IsKeyboardCharAvailable (); byte GetKeyboardChar (byte *scanCode);
bool IsPrintable (char c); byte GetShiftFlags ();
void Print (const char *str); int GetString (char *buffer, size_t bufferSize);
void Print (uint32 number); void InitVideoMode ();
void Print (const uint64 &number); bool IsKeyboardCharAvailable ();
void PrintBackspace (); bool IsPrintable (char c);
void PrintChar (char c); bool IsDigit (char c);
void PrintCharAtCursor (char c); void Print (const char *str);
void PrintEndl (); void Print (uint32 number);
void PrintEndl (int cnt); void Print (const uint64 &number);
void PrintRepeatedChar (char c, int n); void PrintBackspace ();
void PrintError (const char *message); void PrintChar (char c);
void PrintErrorNoEndl (const char *message); void PrintCharAtCursor (char c);
void PrintHex (byte b); void PrintEndl ();
void PrintHex (uint16 data); void PrintEndl (int cnt);
void PrintHex (uint32 data); void PrintRepeatedChar (char c, int n);
void PrintHex (const uint64 &data); void PrintError (const char *message);
void PrintErrorNoEndl (const char *message);
#endif // TC_HEADER_Boot_BootConsoleIo void PrintHex (byte b);
void PrintHex (uint16 data);
void PrintHex (uint32 data);
void PrintHex (const uint64 &data);
#endif // TC_HEADER_Boot_BootConsoleIo
+27 -23
View File
@@ -1,23 +1,27 @@
; ;
; Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved. ; Derived from source code of TrueCrypt 7.1a, which is
; ; Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
; Governed by the TrueCrypt License 3.0 the full text of which is contained in ; by the TrueCrypt License 3.0.
; the file License.txt included in TrueCrypt binary and source code distribution ;
; packages. ; Modifications and additions to the original source code (contained in this file)
; ; and all other portions of this file are Copyright (c) 2013-2016 IDRIX
; and are governed by the Apache License 2.0 the full text of which is
.MODEL tiny, C ; contained in the file License.txt included in VeraCrypt binary and source
.386 ; code distribution packages.
;
INCLUDE BootDefs.i
.MODEL tiny, C
EXTERNDEF main:NEAR .386
_TEXT SEGMENT INCLUDE BootDefs.i
ORG TC_COM_EXECUTABLE_OFFSET
EXTERNDEF main:NEAR
start:
jmp main _TEXT SEGMENT
ORG TC_COM_EXECUTABLE_OFFSET
_TEXT ENDS
END start start:
jmp main
_TEXT ENDS
END start
+181 -177
View File
@@ -1,177 +1,181 @@
/* /*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved. Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
Governed by the TrueCrypt License 3.0 the full text of which is contained in by the TrueCrypt License 3.0.
the file License.txt included in TrueCrypt binary and source code distribution
packages. Modifications and additions to the original source code (contained in this file)
*/ and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
#include "Platform.h" contained in the file License.txt included in VeraCrypt binary and source
#include "Bios.h" code distribution packages.
#include "BootConsoleIo.h" */
#include "BootDefs.h"
#include "BootDiskIo.h" #include "Platform.h"
#include "BootDebug.h" #include "Bios.h"
#include "BootConsoleIo.h"
#include "BootDefs.h"
#ifdef TC_BOOT_TRACING_ENABLED #include "BootDiskIo.h"
#include "BootDebug.h"
void InitDebugPort ()
{
__asm #ifdef TC_BOOT_TRACING_ENABLED
{
mov dx, TC_DEBUG_PORT void InitDebugPort ()
mov ah, 1 {
int 0x17 __asm
mov dx, TC_DEBUG_PORT {
mov ah, 0xe2 mov dx, TC_DEBUG_PORT
int 0x17 mov ah, 1
} int 0x17
} mov dx, TC_DEBUG_PORT
mov ah, 0xe2
int 0x17
void WriteDebugPort (byte dataByte) }
{ }
__asm
{
mov al, dataByte void WriteDebugPort (byte dataByte)
mov dx, TC_DEBUG_PORT {
mov ah, 0 __asm
int 0x17 {
} mov al, dataByte
} mov dx, TC_DEBUG_PORT
mov ah, 0
#endif // TC_BOOT_TRACING_ENABLED int 0x17
}
}
#ifdef TC_BOOT_DEBUG_ENABLED
#endif // TC_BOOT_TRACING_ENABLED
extern "C" void PrintDebug (uint32 debugVal)
{
Print (debugVal); #ifdef TC_BOOT_DEBUG_ENABLED
PrintEndl();
} extern "C" void PrintDebug (uint32 debugVal)
{
Print (debugVal);
void PrintVal (const char *message, const uint32 value, bool newLine, bool hex) PrintEndl();
{ }
Print (message);
Print (": ");
void PrintVal (const char *message, const uint32 value, bool newLine, bool hex)
if (hex) {
PrintHex (value); Print (message);
else Print (": ");
Print (value);
if (hex)
if (newLine) PrintHex (value);
PrintEndl(); else
} Print (value);
if (newLine)
void PrintVal (const char *message, const uint64 &value, bool newLine, bool hex) PrintEndl();
{ }
Print (message);
Print (": ");
PrintHex (value); void PrintVal (const char *message, const uint64 &value, bool newLine, bool hex)
if (newLine) {
PrintEndl(); Print (message);
} Print (": ");
PrintHex (value);
if (newLine)
void PrintHexDump (byte *mem, size_t size, uint16 *memSegment) PrintEndl();
{ }
const size_t width = 16;
for (size_t pos = 0; pos < size; )
{ void PrintHexDump (byte *mem, size_t size, uint16 *memSegment)
for (int pass = 1; pass <= 2; ++pass) {
{ const size_t width = 16;
size_t i; for (size_t pos = 0; pos < size; )
for (i = 0; i < width && pos < size; ++i) {
{ for (int pass = 1; pass <= 2; ++pass)
byte dataByte; {
if (memSegment) size_t i;
{ for (i = 0; i < width && pos < size; ++i)
__asm {
{ byte dataByte;
push es if (memSegment)
mov si, ss:memSegment {
mov es, ss:[si] __asm
mov si, ss:mem {
add si, pos push es
mov al, es:[si] mov si, ss:memSegment
mov dataByte, al mov es, ss:[si]
pop es mov si, ss:mem
} add si, pos
pos++; mov al, es:[si]
} mov dataByte, al
else pop es
dataByte = mem[pos++]; }
pos++;
if (pass == 1) }
{ else
PrintHex (dataByte); dataByte = mem[pos++];
PrintChar (' ');
} if (pass == 1)
else {
PrintChar (IsPrintable (dataByte) ? dataByte : '.'); PrintHex (dataByte);
} PrintChar (' ');
}
if (pass == 1) else
{ PrintChar (IsPrintable (dataByte) ? dataByte : '.');
pos -= i; }
PrintChar (' ');
} if (pass == 1)
} {
pos -= i;
PrintEndl (); PrintChar (' ');
} }
} }
PrintEndl ();
void PrintHexDump (uint16 memSegment, uint16 memOffset, size_t size) }
{ }
PrintHexDump ((byte *) memOffset, size, &memSegment);
}
void PrintHexDump (uint16 memSegment, uint16 memOffset, size_t size)
#endif // TC_BOOT_DEBUG_ENABLED {
PrintHexDump ((byte *) memOffset, size, &memSegment);
}
#ifdef TC_BOOT_STACK_CHECKING_ENABLED
#endif // TC_BOOT_DEBUG_ENABLED
extern "C" char end[];
static void PrintStackInfo () #ifdef TC_BOOT_STACK_CHECKING_ENABLED
{
uint16 spReg; extern "C" char end[];
__asm mov spReg, sp
static void PrintStackInfo ()
Print ("Stack: "); Print (TC_BOOT_LOADER_STACK_TOP - spReg); {
Print ("/"); Print (TC_BOOT_LOADER_STACK_TOP - (uint16) end); uint16 spReg;
} __asm mov spReg, sp
Print ("Stack: "); Print (TC_BOOT_LOADER_STACK_TOP - spReg);
void CheckStack () Print ("/"); Print (TC_BOOT_LOADER_STACK_TOP - (uint16) end);
{ }
uint16 spReg;
__asm mov spReg, sp
void CheckStack ()
if (*(uint32 *) end != 0x12345678UL || spReg < (uint16) end) {
{ uint16 spReg;
__asm cli __asm mov spReg, sp
__asm mov sp, TC_BOOT_LOADER_STACK_TOP
if (*(uint32 *) end != 0x12345678UL || spReg < (uint16) end)
PrintError ("Stack overflow"); {
TC_THROW_FATAL_EXCEPTION; __asm cli
} __asm mov sp, TC_BOOT_LOADER_STACK_TOP
}
PrintError ("Stack overflow");
TC_THROW_FATAL_EXCEPTION;
void InitStackChecker () }
{ }
*(uint32 *) end = 0x12345678UL;
PrintStackInfo(); void InitStackChecker ()
PrintEndl(); {
} *(uint32 *) end = 0x12345678UL;
#endif // TC_BOOT_STACK_CHECKING_ENABLED PrintStackInfo();
PrintEndl();
}
#endif // TC_BOOT_STACK_CHECKING_ENABLED
+60 -56
View File
@@ -1,56 +1,60 @@
/* /*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved. Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
Governed by the TrueCrypt License 3.0 the full text of which is contained in by the TrueCrypt License 3.0.
the file License.txt included in TrueCrypt binary and source code distribution
packages. Modifications and additions to the original source code (contained in this file)
*/ and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
#ifndef TC_HEADER_Boot_BootDebug contained in the file License.txt included in VeraCrypt binary and source
#define TC_HEADER_Boot_BootDebug code distribution packages.
*/
#include "Platform.h"
#include "BootConsoleIo.h" #ifndef TC_HEADER_Boot_BootDebug
#define TC_HEADER_Boot_BootDebug
#if 0
# define TC_BOOT_DEBUG_ENABLED #include "Platform.h"
#endif #include "BootConsoleIo.h"
#if 0 || defined (TC_BOOT_DEBUG_ENABLED) #if 0
# define TC_BOOT_STACK_CHECKING_ENABLED # define TC_BOOT_DEBUG_ENABLED
extern "C" void CheckStack (); #endif
#else
# define CheckStack() #if 0 || defined (TC_BOOT_DEBUG_ENABLED)
#endif # define TC_BOOT_STACK_CHECKING_ENABLED
extern "C" void CheckStack ();
#if 0 #else
# define TC_BOOT_TRACING_ENABLED # define CheckStack()
# if 1 #endif
# define TC_TRACE_INT13
# endif #if 0
# if 0 # define TC_BOOT_TRACING_ENABLED
# define TC_TRACE_INT15 # if 1
# endif # define TC_TRACE_INT13
#endif # endif
# if 0
#ifdef TC_BOOT_DEBUG_ENABLED # define TC_TRACE_INT15
# define trace_point do { Print(__FILE__); PrintChar (':'); Print (TC_TO_STRING (__LINE__)); PrintEndl(); } while (false) # endif
# define trace_val(VAL) PrintVal (#VAL, VAL); #endif
# define trace_hex(VAL) do { Print (#VAL), PrintChar (':'); PrintHex (VAL); PrintEndl(); } while (false)
# define assert(COND) do { if (!(COND)) { trace_point; __asm jmp $ } } while (false) #ifdef TC_BOOT_DEBUG_ENABLED
#else # define trace_point do { Print(__FILE__); PrintChar (':'); Print (TC_TO_STRING (__LINE__)); PrintEndl(); } while (false)
# define trace_point # define trace_val(VAL) PrintVal (#VAL, VAL);
# define trace_val(VAL) # define trace_hex(VAL) do { Print (#VAL), PrintChar (':'); PrintHex (VAL); PrintEndl(); } while (false)
# define trace_hex(VAL) # define assert(COND) do { if (!(COND)) { trace_point; __asm jmp $ } } while (false)
# define assert(COND) #else
#endif # define trace_point
# define trace_val(VAL)
void InitDebugPort (); # define trace_hex(VAL)
void InitStackChecker (); # define assert(COND)
void WriteDebugPort (byte dataByte); #endif
void PrintHexDump (byte *mem, size_t size, uint16 *memSegment = nullptr);
void PrintHexDump (uint16 memSegment, uint16 memOffset, size_t size); void InitDebugPort ();
void PrintVal (const char *message, const uint32 value, bool newLine = true, bool hex = false); void InitStackChecker ();
void PrintVal (const char *message, const uint64 &value, bool newLine = true, bool hex = false); void WriteDebugPort (byte dataByte);
void PrintHexDump (byte *mem, size_t size, uint16 *memSegment = nullptr);
#endif // TC_HEADER_Boot_BootDebug 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);
#endif // TC_HEADER_Boot_BootDebug
+210 -188
View File
@@ -1,188 +1,210 @@
/* /*
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved. Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
Governed by the TrueCrypt License 3.0 the full text of which is contained in by the TrueCrypt License 3.0.
the file License.txt included in TrueCrypt binary and source code distribution
packages. Modifications and additions to the original source code (contained in this file)
*/ and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
#ifndef TC_HEADER_Boot_BootDefs contained in the file License.txt included in VeraCrypt binary and source
#define TC_HEADER_Boot_BootDefs code distribution packages.
*/
// Total memory required (CODE + DATA + BSS + STACK + 0x100) in KBytes - determined from linker map.
#define TC__BOOT_MEMORY_REQUIRED 42 #ifndef TC_HEADER_Boot_BootDefs
#define TC_HEADER_Boot_BootDefs
#ifdef TC_WINDOWS_BOOT_SINGLE_CIPHER_MODE
# undef TC__BOOT_MEMORY_REQUIRED // Total memory required (CODE + DATA + BSS + STACK + 0x100) in KBytes - determined from linker map.
#define TC__BOOT_MEMORY_REQUIRED 43
# ifdef TC_WINDOWS_BOOT_AES
# ifdef TC_WINDOWS_BOOT_RESCUE_DISK_MODE #ifdef TC_WINDOWS_BOOT_SINGLE_CIPHER_MODE
# define TC__BOOT_MEMORY_REQUIRED 30 # undef TC__BOOT_MEMORY_REQUIRED
# else
# define TC__BOOT_MEMORY_REQUIRED 28 # ifdef TC_WINDOWS_BOOT_AES
# endif # ifdef TC_WINDOWS_BOOT_RESCUE_DISK_MODE
# elif defined (TC_WINDOWS_BOOT_SERPENT) # define TC__BOOT_MEMORY_REQUIRED 31
# define TC__BOOT_MEMORY_REQUIRED 32 # else
# elif defined (TC_WINDOWS_BOOT_TWOFISH) # define TC__BOOT_MEMORY_REQUIRED 29
# define TC__BOOT_MEMORY_REQUIRED 40 # endif
# endif # elif defined (TC_WINDOWS_BOOT_SERPENT)
# define TC__BOOT_MEMORY_REQUIRED 33
#if 0 # elif defined (TC_WINDOWS_BOOT_TWOFISH)
# undef TC__BOOT_MEMORY_REQUIRED # define TC__BOOT_MEMORY_REQUIRED 41
# define TC__BOOT_MEMORY_REQUIRED 60 # elif defined (TC_WINDOWS_BOOT_CAMELLIA)
#endif # define TC__BOOT_MEMORY_REQUIRED 31
# endif
#endif
#if 0
// Modifying this value can introduce incompatibility with previous versions # undef TC__BOOT_MEMORY_REQUIRED
#define TC__BOOT_LOADER_SEGMENT TC_HEX (9000) // Some buggy BIOS routines fail if CS bits 0-10 are not zero # define TC__BOOT_MEMORY_REQUIRED 60
#endif
#if TC__BOOT_MEMORY_REQUIRED <= 32
# define TC__BOOT_LOADER_SEGMENT_LOW (TC__BOOT_LOADER_SEGMENT - 32 * 1024 / 16) #endif
#else
# define TC__BOOT_LOADER_SEGMENT_LOW (TC__BOOT_LOADER_SEGMENT - 64 * 1024 / 16) // Modifying this value can introduce incompatibility with previous versions
#endif #define TC__BOOT_LOADER_SEGMENT TC_HEX (9000) // Some buggy BIOS routines fail if CS bits 0-10 are not zero
#define TC__COM_EXECUTABLE_OFFSET TC_HEX (100) #if TC__BOOT_MEMORY_REQUIRED <= 32
# define TC__BOOT_LOADER_SEGMENT_LOW (TC__BOOT_LOADER_SEGMENT - 32 * 1024 / 16)
#define TC__BOOT_LOADER_LOWMEM_SEGMENT TC_HEX (2000) #else
#define TC__BOOT_LOADER_BUFFER_SEGMENT TC_HEX (4000) # define TC__BOOT_LOADER_SEGMENT_LOW (TC__BOOT_LOADER_SEGMENT - 64 * 1024 / 16)
#define TC__BOOT_LOADER_ALT_SEGMENT TC_HEX (6000) #endif
#define TC__BOOT_LOADER_STACK_TOP (TC_BOOT_MEMORY_REQUIRED * TC_UNSIGNED (1024) - 4) #define TC__COM_EXECUTABLE_OFFSET TC_HEX (100)
#define TC__LB_SIZE 512 #define TC__BOOT_LOADER_LOWMEM_SEGMENT TC_HEX (2000)
#define TC__BOOT_LOADER_AREA_SECTOR_COUNT 63 #define TC__BOOT_LOADER_BUFFER_SEGMENT TC_HEX (4000)
#define TC__BOOT_LOADER_ALT_SEGMENT TC_HEX (6000)
#define TC__BOOT_SECTOR_VERSION_OFFSET 430
#define TC__BOOT_SECTOR_LOADER_LENGTH_OFFSET 432 #define TC__BOOT_LOADER_STACK_TOP (TC_BOOT_MEMORY_REQUIRED * TC_UNSIGNED (1024) - 4)
#define TC__BOOT_SECTOR_LOADER_CHECKSUM_OFFSET 434
#define TC__BOOT_SECTOR_USER_CONFIG_OFFSET 438 #define TC__LB_SIZE 512
#define TC__BOOT_SECTOR_CONFIG_OFFSET 439 // The last byte that is reserved for the boot loader #define TC__BOOT_LOADER_AREA_SECTOR_COUNT 63
#define TC__BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH 24 #define TC__BOOT_SECTOR_VERSION_OFFSET 430
#define TC__BOOT_SECTOR_USER_MESSAGE_OFFSET (TC__BOOT_SECTOR_VERSION_OFFSET - TC__BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH) #define TC__BOOT_SECTOR_LOADER_LENGTH_OFFSET 432
#define TC__BOOT_SECTOR_LOADER_CHECKSUM_OFFSET 434
#define TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_SIZE 4 #define TC__BOOT_SECTOR_USER_CONFIG_OFFSET 438
#define TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET (TC__BOOT_SECTOR_USER_MESSAGE_OFFSET - TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_SIZE) #define TC__BOOT_SECTOR_CONFIG_OFFSET 439 // The last byte that is reserved for the boot loader
#define TC__BOOT_LOADER_DECOMPRESSOR_START_SECTOR 2 #define TC__BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH 24
#define TC__BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT 4 #define TC__BOOT_SECTOR_USER_MESSAGE_OFFSET (TC__BOOT_SECTOR_VERSION_OFFSET - TC__BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH)
#define TC__BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE 32768
#define TC__BOOT_LOADER_COMPRESSED_BUFFER_OFFSET (TC_COM_EXECUTABLE_OFFSET + 3072) #define TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_SIZE 4
#define TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET (TC__BOOT_SECTOR_USER_MESSAGE_OFFSET - TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_SIZE)
#define TC__BOOT_LOADER_START_SECTOR (TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR + TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT)
#define TC__MAX_BOOT_LOADER_SECTOR_COUNT (TC_BOOT_LOADER_AREA_SECTOR_COUNT - TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT - 2) #define TC__BOOT_SECTOR_PIM_VALUE_SIZE 2
#define TC__MAX_BOOT_LOADER_DECOMPRESSED_SIZE ((TC_BOOT_LOADER_AREA_SECTOR_COUNT - 2) * TC_LB_SIZE) #define TC__BOOT_SECTOR_PIM_VALUE_OFFSET (TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET - TC__BOOT_SECTOR_PIM_VALUE_SIZE)
#define TC__BOOT_LOADER_BACKUP_SECTOR_COUNT 30 #define TC__BOOT_LOADER_DECOMPRESSOR_START_SECTOR 2
#define TC__BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT 4
#define TC__GZIP_HEADER_SIZE 10 #define TC__BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE 32768
#define TC__BOOT_LOADER_COMPRESSED_BUFFER_OFFSET (TC_COM_EXECUTABLE_OFFSET + 3072)
#define TC__BOOT_CFG_FLAG_AREA_SIZE 1 // In bytes
#define TC__BOOT_LOADER_START_SECTOR (TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR + TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT)
// If you add more flags, revise TC__BOOT_CFG_FLAG_AREA_SIZE #define TC__MAX_BOOT_LOADER_SECTOR_COUNT (TC_BOOT_LOADER_AREA_SECTOR_COUNT - TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT - 2)
#define TC__BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE TC_HEX (02) #define TC__MAX_BOOT_LOADER_DECOMPRESSED_SIZE ((TC_BOOT_LOADER_AREA_SECTOR_COUNT - 2) * TC_LB_SIZE)
#define TC__BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER TC_HEX (04)
#define TC__BOOT_CFG_FLAG_RESCUE_DISABLE_HW_ENCRYPTION TC_HEX (10) #define TC__BOOT_LOADER_BACKUP_SECTOR_COUNT 30
#define TC__BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER TC_HEX (20)
#define TC__BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE (TC_HEX (40) + TC_HEX (80)) #define TC__GZIP_HEADER_SIZE 10
// Modifying the following values can introduce incompatibility with previous versions #define TC__BOOT_CFG_FLAG_AREA_SIZE 1 // In bytes
#define TC__BOOT_USER_CFG_FLAG_SILENT_MODE TC_HEX (01)
#define TC__BOOT_USER_CFG_FLAG_DISABLE_ESC TC_HEX (02) // If you add more flags, revise TC__BOOT_CFG_FLAG_AREA_SIZE
#define TC__BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION TC_HEX (04) #define TC__BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE TC_HEX (02)
#define TC__BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER TC_HEX (04)
// The following items are treated as a 2-bit value (apply TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE to obtain the value) #define TC__BOOT_CFG_FLAG_RESCUE_DISABLE_HW_ENCRYPTION TC_HEX (10)
#define TC__HIDDEN_OS_CREATION_PHASE_NONE 0 #define TC__BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER TC_HEX (20)
#define TC__HIDDEN_OS_CREATION_PHASE_CLONING TC_HEX (40) // The boot loader is to copy the content of the system partition to the hidden volume #define TC__BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE (TC_HEX (40) + TC_HEX (80))
#define TC__HIDDEN_OS_CREATION_PHASE_WIPING TC_HEX (80) // The boot loader has successfully copied the content of the system partition to the hidden volume. The original OS is to be wiped now.
#define TC__HIDDEN_OS_CREATION_PHASE_WIPED (TC_HEX (40) + TC_HEX (80)) // The original OS has been wiped. The user is required to install a new OS (decoy OS) on the system partition now. // Modifying the following values can introduce incompatibility with previous versions
#define TC__BOOT_USER_CFG_FLAG_SILENT_MODE TC_HEX (01)
#define TC__BOOT_USER_CFG_FLAG_DISABLE_ESC TC_HEX (02)
#ifdef TC_ASM_PREPROCESS #define TC__BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION TC_HEX (04)
#define TC__BOOT_USER_CFG_FLAG_DISABLE_PIM TC_HEX (08)
#define TC_HEX(N) 0##N##h #define TC__BOOT_USER_CFG_FLAG_STORE_HASH TC_HEX (10)
#define TC_UNSIGNED(N) N
// The following items are treated as a 2-bit value (apply TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE to obtain the value)
TC_BOOT_MEMORY_REQUIRED = TC__BOOT_MEMORY_REQUIRED #define TC__HIDDEN_OS_CREATION_PHASE_NONE 0
TC_BOOT_LOADER_SEGMENT = TC__BOOT_LOADER_SEGMENT #define TC__HIDDEN_OS_CREATION_PHASE_CLONING TC_HEX (40) // The boot loader is to copy the content of the system partition to the hidden volume
TC_BOOT_LOADER_SEGMENT_LOW = TC__BOOT_LOADER_SEGMENT_LOW #define TC__HIDDEN_OS_CREATION_PHASE_WIPING TC_HEX (80) // The boot loader has successfully copied the content of the system partition to the hidden volume. The original OS is to be wiped now.
TC_COM_EXECUTABLE_OFFSET = TC__COM_EXECUTABLE_OFFSET #define TC__HIDDEN_OS_CREATION_PHASE_WIPED (TC_HEX (40) + TC_HEX (80)) // The original OS has been wiped. The user is required to install a new OS (decoy OS) on the system partition now.
TC_BOOT_LOADER_LOWMEM_SEGMENT = TC__BOOT_LOADER_LOWMEM_SEGMENT
TC_BOOT_LOADER_BUFFER_SEGMENT = TC__BOOT_LOADER_BUFFER_SEGMENT
TC_BOOT_LOADER_ALT_SEGMENT = TC__BOOT_LOADER_ALT_SEGMENT #ifdef TC_ASM_PREPROCESS
TC_BOOT_LOADER_STACK_TOP = TC__BOOT_LOADER_STACK_TOP
TC_LB_SIZE = TC__LB_SIZE #define TC_HEX(N) 0##N##h
TC_BOOT_LOADER_AREA_SECTOR_COUNT = TC__BOOT_LOADER_AREA_SECTOR_COUNT #define TC_UNSIGNED(N) N
TC_BOOT_SECTOR_LOADER_LENGTH_OFFSET = TC__BOOT_SECTOR_LOADER_LENGTH_OFFSET
TC_BOOT_SECTOR_LOADER_CHECKSUM_OFFSET = TC__BOOT_SECTOR_LOADER_CHECKSUM_OFFSET TC_BOOT_MEMORY_REQUIRED = TC__BOOT_MEMORY_REQUIRED
TC_BOOT_SECTOR_CONFIG_OFFSET = TC__BOOT_SECTOR_CONFIG_OFFSET TC_BOOT_LOADER_SEGMENT = TC__BOOT_LOADER_SEGMENT
TC_BOOT_SECTOR_USER_CONFIG_OFFSET = TC__BOOT_SECTOR_USER_CONFIG_OFFSET TC_BOOT_LOADER_SEGMENT_LOW = TC__BOOT_LOADER_SEGMENT_LOW
TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR = TC__BOOT_LOADER_DECOMPRESSOR_START_SECTOR TC_COM_EXECUTABLE_OFFSET = TC__COM_EXECUTABLE_OFFSET
TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT = TC__BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT TC_BOOT_LOADER_LOWMEM_SEGMENT = TC__BOOT_LOADER_LOWMEM_SEGMENT
TC_BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE = TC__BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE TC_BOOT_LOADER_BUFFER_SEGMENT = TC__BOOT_LOADER_BUFFER_SEGMENT
TC_BOOT_LOADER_COMPRESSED_BUFFER_OFFSET = TC__BOOT_LOADER_COMPRESSED_BUFFER_OFFSET TC_BOOT_LOADER_ALT_SEGMENT = TC__BOOT_LOADER_ALT_SEGMENT
TC_BOOT_LOADER_START_SECTOR = TC__BOOT_LOADER_START_SECTOR TC_BOOT_LOADER_STACK_TOP = TC__BOOT_LOADER_STACK_TOP
TC_MAX_BOOT_LOADER_SECTOR_COUNT = TC__MAX_BOOT_LOADER_SECTOR_COUNT TC_LB_SIZE = TC__LB_SIZE
TC_MAX_BOOT_LOADER_DECOMPRESSED_SIZE = TC__MAX_BOOT_LOADER_DECOMPRESSED_SIZE TC_BOOT_LOADER_AREA_SECTOR_COUNT = TC__BOOT_LOADER_AREA_SECTOR_COUNT
TC_BOOT_LOADER_BACKUP_SECTOR_COUNT = TC__BOOT_LOADER_BACKUP_SECTOR_COUNT TC_BOOT_SECTOR_LOADER_LENGTH_OFFSET = TC__BOOT_SECTOR_LOADER_LENGTH_OFFSET
TC_GZIP_HEADER_SIZE = TC__GZIP_HEADER_SIZE TC_BOOT_SECTOR_LOADER_CHECKSUM_OFFSET = TC__BOOT_SECTOR_LOADER_CHECKSUM_OFFSET
TC_BOOT_CFG_FLAG_AREA_SIZE = TC__BOOT_CFG_FLAG_AREA_SIZE TC_BOOT_SECTOR_CONFIG_OFFSET = TC__BOOT_SECTOR_CONFIG_OFFSET
TC_BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE = TC__BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE TC_BOOT_SECTOR_USER_CONFIG_OFFSET = TC__BOOT_SECTOR_USER_CONFIG_OFFSET
TC_BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER = TC__BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR = TC__BOOT_LOADER_DECOMPRESSOR_START_SECTOR
TC_BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER = TC__BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT = TC__BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT
TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE = TC__BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE TC_BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE = TC__BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE
TC_BOOT_USER_CFG_FLAG_SILENT_MODE = TC__BOOT_USER_CFG_FLAG_SILENT_MODE TC_BOOT_LOADER_COMPRESSED_BUFFER_OFFSET = TC__BOOT_LOADER_COMPRESSED_BUFFER_OFFSET
TC_HIDDEN_OS_CREATION_PHASE_NONE = TC__HIDDEN_OS_CREATION_PHASE_NONE TC_BOOT_LOADER_START_SECTOR = TC__BOOT_LOADER_START_SECTOR
TC_HIDDEN_OS_CREATION_PHASE_CLONING = TC__HIDDEN_OS_CREATION_PHASE_CLONING TC_MAX_BOOT_LOADER_SECTOR_COUNT = TC__MAX_BOOT_LOADER_SECTOR_COUNT
TC_HIDDEN_OS_CREATION_PHASE_WIPING = TC__HIDDEN_OS_CREATION_PHASE_WIPING TC_MAX_BOOT_LOADER_DECOMPRESSED_SIZE = TC__MAX_BOOT_LOADER_DECOMPRESSED_SIZE
TC_HIDDEN_OS_CREATION_PHASE_WIPED = TC__HIDDEN_OS_CREATION_PHASE_WIPED TC_BOOT_LOADER_BACKUP_SECTOR_COUNT = TC__BOOT_LOADER_BACKUP_SECTOR_COUNT
TC_GZIP_HEADER_SIZE = TC__GZIP_HEADER_SIZE
#else // TC_ASM_PREPROCESS TC_BOOT_CFG_FLAG_AREA_SIZE = TC__BOOT_CFG_FLAG_AREA_SIZE
TC_BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE = TC__BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE
#define TC_HEX(N) 0x##N TC_BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER = TC__BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER
#define TC_UNSIGNED(N) N##U TC_BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER = TC__BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER
TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE = TC__BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE
#define TC_BOOT_MEMORY_REQUIRED TC__BOOT_MEMORY_REQUIRED TC_BOOT_USER_CFG_FLAG_SILENT_MODE = TC__BOOT_USER_CFG_FLAG_SILENT_MODE
#define TC_BOOT_LOADER_SEGMENT TC__BOOT_LOADER_SEGMENT TC_HIDDEN_OS_CREATION_PHASE_NONE = TC__HIDDEN_OS_CREATION_PHASE_NONE
#define TC_COM_EXECUTABLE_OFFSET TC__COM_EXECUTABLE_OFFSET TC_HIDDEN_OS_CREATION_PHASE_CLONING = TC__HIDDEN_OS_CREATION_PHASE_CLONING
#define TC_BOOT_LOADER_LOWMEM_SEGMENT TC__BOOT_LOADER_LOWMEM_SEGMENT TC_HIDDEN_OS_CREATION_PHASE_WIPING = TC__HIDDEN_OS_CREATION_PHASE_WIPING
#define TC_BOOT_LOADER_BUFFER_SEGMENT TC__BOOT_LOADER_BUFFER_SEGMENT TC_HIDDEN_OS_CREATION_PHASE_WIPED = TC__HIDDEN_OS_CREATION_PHASE_WIPED
#define TC_BOOT_LOADER_ALT_SEGMENT TC__BOOT_LOADER_ALT_SEGMENT
#define TC_BOOT_LOADER_STACK_TOP (TC__BOOT_LOADER_STACK_TOP) #else // TC_ASM_PREPROCESS
#define TC_BOOT_LOADER_AREA_SECTOR_COUNT TC__BOOT_LOADER_AREA_SECTOR_COUNT
#define TC_BOOT_SECTOR_USER_MESSAGE_OFFSET TC__BOOT_SECTOR_USER_MESSAGE_OFFSET #define TC_HEX(N) 0x##N
#define TC_BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_SIZE TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_SIZE #define TC_UNSIGNED(N) N##U
#define TC_BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET
#define TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH TC__BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH #define TC_BOOT_MEMORY_REQUIRED TC__BOOT_MEMORY_REQUIRED
#define TC_BOOT_SECTOR_VERSION_OFFSET TC__BOOT_SECTOR_VERSION_OFFSET #define TC_BOOT_LOADER_SEGMENT TC__BOOT_LOADER_SEGMENT
#define TC_BOOT_SECTOR_LOADER_LENGTH_OFFSET TC__BOOT_SECTOR_LOADER_LENGTH_OFFSET #define TC_COM_EXECUTABLE_OFFSET TC__COM_EXECUTABLE_OFFSET
#define TC_BOOT_SECTOR_LOADER_CHECKSUM_OFFSET TC__BOOT_SECTOR_LOADER_CHECKSUM_OFFSET #define TC_BOOT_LOADER_LOWMEM_SEGMENT TC__BOOT_LOADER_LOWMEM_SEGMENT
#define TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR TC__BOOT_LOADER_DECOMPRESSOR_START_SECTOR #define TC_BOOT_LOADER_BUFFER_SEGMENT TC__BOOT_LOADER_BUFFER_SEGMENT
#define TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT TC__BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT #define TC_BOOT_LOADER_ALT_SEGMENT TC__BOOT_LOADER_ALT_SEGMENT
#define TC_BOOT_SECTOR_CONFIG_OFFSET TC__BOOT_SECTOR_CONFIG_OFFSET #define TC_BOOT_LOADER_STACK_TOP (TC__BOOT_LOADER_STACK_TOP)
#define TC_BOOT_SECTOR_USER_CONFIG_OFFSET TC__BOOT_SECTOR_USER_CONFIG_OFFSET #define TC_BOOT_LOADER_AREA_SECTOR_COUNT TC__BOOT_LOADER_AREA_SECTOR_COUNT
#define TC_BOOT_LOADER_START_SECTOR TC__BOOT_LOADER_START_SECTOR #define TC_BOOT_SECTOR_USER_MESSAGE_OFFSET TC__BOOT_SECTOR_USER_MESSAGE_OFFSET
#define TC_LB_SIZE TC__LB_SIZE #define TC_BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_SIZE TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_SIZE
#define TC_MAX_BOOT_LOADER_SECTOR_COUNT TC__MAX_BOOT_LOADER_SECTOR_COUNT #define TC_BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET
#define TC_MAX_BOOT_LOADER_DECOMPRESSED_SIZE TC__MAX_BOOT_LOADER_DECOMPRESSED_SIZE #define TC_BOOT_SECTOR_PIM_VALUE_SIZE TC__BOOT_SECTOR_PIM_VALUE_SIZE
#define TC_BOOT_LOADER_BACKUP_SECTOR_COUNT TC__BOOT_LOADER_BACKUP_SECTOR_COUNT #define TC_BOOT_SECTOR_PIM_VALUE_OFFSET TC__BOOT_SECTOR_PIM_VALUE_OFFSET
#define TC_GZIP_HEADER_SIZE TC__GZIP_HEADER_SIZE #define TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH TC__BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH
#define TC_BOOT_CFG_FLAG_AREA_SIZE TC__BOOT_CFG_FLAG_AREA_SIZE #define TC_BOOT_SECTOR_VERSION_OFFSET TC__BOOT_SECTOR_VERSION_OFFSET
#define TC_BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE TC__BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE #define TC_BOOT_SECTOR_LOADER_LENGTH_OFFSET TC__BOOT_SECTOR_LOADER_LENGTH_OFFSET
#define TC_BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER TC__BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER #define TC_BOOT_SECTOR_LOADER_CHECKSUM_OFFSET TC__BOOT_SECTOR_LOADER_CHECKSUM_OFFSET
#define TC_BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER TC__BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER #define TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR TC__BOOT_LOADER_DECOMPRESSOR_START_SECTOR
#define TC_BOOT_CFG_FLAG_RESCUE_DISABLE_HW_ENCRYPTION TC__BOOT_CFG_FLAG_RESCUE_DISABLE_HW_ENCRYPTION #define TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT TC__BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT
#define TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE TC__BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE #define TC_BOOT_SECTOR_CONFIG_OFFSET TC__BOOT_SECTOR_CONFIG_OFFSET
#define TC_BOOT_USER_CFG_FLAG_SILENT_MODE TC__BOOT_USER_CFG_FLAG_SILENT_MODE #define TC_BOOT_SECTOR_USER_CONFIG_OFFSET TC__BOOT_SECTOR_USER_CONFIG_OFFSET
#define TC_BOOT_USER_CFG_FLAG_DISABLE_ESC TC__BOOT_USER_CFG_FLAG_DISABLE_ESC #define TC_BOOT_LOADER_START_SECTOR TC__BOOT_LOADER_START_SECTOR
#define TC_BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION TC__BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION #define TC_LB_SIZE TC__LB_SIZE
#define TC_HIDDEN_OS_CREATION_PHASE_NONE TC__HIDDEN_OS_CREATION_PHASE_NONE #define TC_MAX_BOOT_LOADER_SECTOR_COUNT TC__MAX_BOOT_LOADER_SECTOR_COUNT
#define TC_HIDDEN_OS_CREATION_PHASE_CLONING TC__HIDDEN_OS_CREATION_PHASE_CLONING #define TC_MAX_BOOT_LOADER_DECOMPRESSED_SIZE TC__MAX_BOOT_LOADER_DECOMPRESSED_SIZE
#define TC_HIDDEN_OS_CREATION_PHASE_WIPING TC__HIDDEN_OS_CREATION_PHASE_WIPING #define TC_BOOT_LOADER_BACKUP_SECTOR_COUNT TC__BOOT_LOADER_BACKUP_SECTOR_COUNT
#define TC_HIDDEN_OS_CREATION_PHASE_WIPED TC__HIDDEN_OS_CREATION_PHASE_WIPED #define TC_GZIP_HEADER_SIZE TC__GZIP_HEADER_SIZE
#define TC_BOOT_CFG_FLAG_AREA_SIZE TC__BOOT_CFG_FLAG_AREA_SIZE
#endif // TC_ASM_PREPROCESS #define TC_BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE TC__BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE
#define TC_BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER TC__BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER
#endif // TC_HEADER_Boot_BootDefs #define TC_BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER TC__BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER
#define TC_BOOT_CFG_FLAG_RESCUE_DISABLE_HW_ENCRYPTION TC__BOOT_CFG_FLAG_RESCUE_DISABLE_HW_ENCRYPTION
#define TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE TC__BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE
#define TC_BOOT_USER_CFG_FLAG_SILENT_MODE TC__BOOT_USER_CFG_FLAG_SILENT_MODE
#define TC_BOOT_USER_CFG_FLAG_DISABLE_ESC TC__BOOT_USER_CFG_FLAG_DISABLE_ESC
#define TC_BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION TC__BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION
#define TC_BOOT_USER_CFG_FLAG_DISABLE_PIM TC__BOOT_USER_CFG_FLAG_DISABLE_PIM
#define TC_BOOT_USER_CFG_FLAG_STORE_HASH TC__BOOT_USER_CFG_FLAG_STORE_HASH
#define TC_HIDDEN_OS_CREATION_PHASE_NONE TC__HIDDEN_OS_CREATION_PHASE_NONE
#define TC_HIDDEN_OS_CREATION_PHASE_CLONING TC__HIDDEN_OS_CREATION_PHASE_CLONING
#define TC_HIDDEN_OS_CREATION_PHASE_WIPING TC__HIDDEN_OS_CREATION_PHASE_WIPING
#define TC_HIDDEN_OS_CREATION_PHASE_WIPED TC__HIDDEN_OS_CREATION_PHASE_WIPED
#endif // TC_ASM_PREPROCESS
#define EFI_BOOTARGS_REGIONS_LOW 0x90000, 0x88000, 0x80000
#define EFI_BOOTARGS_REGIONS_HIGH \
0x100000, 0x200000, 0x300000, 0x400000, 0x500000, 0x600000, 0x700000, 0x800000, \
0x900000, 0xA00000, 0xB00000, 0xC00000, 0xD00000, 0xE00000, 0xF00000, 0x1000000
#define EFI_BOOTARGS_REGIONS EFI_BOOTARGS_REGIONS_LOW, EFI_BOOTARGS_REGIONS_HIGH
#endif // TC_HEADER_Boot_BootDefs
+491 -487
View File
@@ -1,487 +1,491 @@
/* /*
Copyright (c) 2008-2011 TrueCrypt Developers Association. All rights reserved. Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
Governed by the TrueCrypt License 3.0 the full text of which is contained in by the TrueCrypt License 3.0.
the file License.txt included in TrueCrypt binary and source code distribution
packages. Modifications and additions to the original source code (contained in this file)
*/ and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
#include "Bios.h" contained in the file License.txt included in VeraCrypt binary and source
#include "BootConsoleIo.h" code distribution packages.
#include "BootConfig.h" */
#include "BootDebug.h"
#include "BootDefs.h" #include "Bios.h"
#include "BootDiskIo.h" #include "BootConsoleIo.h"
#include "BootStrings.h" #include "BootConfig.h"
#include "BootDebug.h"
#include "BootDefs.h"
byte SectorBuffer[TC_LB_SIZE]; #include "BootDiskIo.h"
#include "BootStrings.h"
#ifdef TC_BOOT_DEBUG_ENABLED
static bool SectorBufferInUse = false;
byte SectorBuffer[TC_LB_SIZE];
void AcquireSectorBuffer ()
{ #ifdef TC_BOOT_DEBUG_ENABLED
if (SectorBufferInUse) static bool SectorBufferInUse = false;
TC_THROW_FATAL_EXCEPTION;
void AcquireSectorBuffer ()
SectorBufferInUse = true; {
} if (SectorBufferInUse)
TC_THROW_FATAL_EXCEPTION;
void ReleaseSectorBuffer () SectorBufferInUse = true;
{ }
SectorBufferInUse = false;
}
void ReleaseSectorBuffer ()
#endif {
SectorBufferInUse = false;
}
bool IsLbaSupported (byte drive)
{ #endif
static byte CachedDrive = TC_INVALID_BIOS_DRIVE;
static bool CachedStatus;
uint16 result = 0; bool IsLbaSupported (byte drive)
{
if (CachedDrive == drive) static byte CachedDrive = TC_INVALID_BIOS_DRIVE;
goto ret; static bool CachedStatus;
uint16 result = 0;
__asm
{ if (CachedDrive == drive)
mov bx, 0x55aa goto ret;
mov dl, drive
mov ah, 0x41 __asm
int 0x13 {
jc err mov bx, 0x55aa
mov result, bx mov dl, drive
err: mov ah, 0x41
} int 0x13
jc err
CachedDrive = drive; mov result, bx
CachedStatus = (result == 0xaa55); err:
ret: }
return CachedStatus;
} CachedDrive = drive;
CachedStatus = (result == 0xaa55);
ret:
void PrintDiskError (BiosResult error, bool write, byte drive, const uint64 *sector, const ChsAddress *chs) return CachedStatus;
{ }
PrintEndl();
Print (write ? "Write" : "Read"); Print (" error:");
Print (error); void PrintDiskError (BiosResult error, bool write, byte drive, const uint64 *sector, const ChsAddress *chs)
Print (" Drive:"); {
Print (drive ^ 0x80); PrintEndl();
Print (write ? "Write" : "Read"); Print (" error:");
if (sector) Print (error);
{ Print (" Drive:");
Print (" Sector:"); Print (drive ^ 0x80);
Print (*sector);
} if (sector)
{
if (chs) Print (" Sector:");
{ Print (*sector);
Print (" CHS:"); }
Print (*chs);
} if (chs)
{
PrintEndl(); Print (" CHS:");
Beep(); Print (*chs);
} }
PrintEndl();
void Print (const ChsAddress &chs) Beep();
{ }
Print (chs.Cylinder);
PrintChar ('/');
Print (chs.Head); void Print (const ChsAddress &chs)
PrintChar ('/'); {
Print (chs.Sector); Print (chs.Cylinder);
} PrintChar ('/');
Print (chs.Head);
PrintChar ('/');
void PrintSectorCountInMB (const uint64 &sectorCount) Print (chs.Sector);
{ }
Print (sectorCount >> (TC_LB_SIZE_BIT_SHIFT_DIVISOR + 2)); Print (" MB ");
}
void PrintSectorCountInMB (const uint64 &sectorCount)
{
BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, byte drive, const ChsAddress &chs, byte sectorCount, bool silent) Print (sectorCount >> (TC_LB_SIZE_BIT_SHIFT_DIVISOR + 2)); Print (" MB ");
{ }
CheckStack();
byte cylinderLow = (byte) chs.Cylinder; BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, byte drive, const ChsAddress &chs, byte sectorCount, bool silent)
byte sector = chs.Sector; {
sector |= byte (chs.Cylinder >> 2) & 0xc0; CheckStack();
byte function = write ? 0x03 : 0x02;
byte cylinderLow = (byte) chs.Cylinder;
BiosResult result; byte sector = chs.Sector;
byte tryCount = TC_MAX_BIOS_DISK_IO_RETRIES; sector |= byte (chs.Cylinder >> 2) & 0xc0;
byte function = write ? 0x03 : 0x02;
do
{ BiosResult result;
result = BiosResultSuccess; byte tryCount = TC_MAX_BIOS_DISK_IO_RETRIES;
__asm do
{ {
push es result = BiosResultSuccess;
mov ax, bufferSegment
mov es, ax __asm
mov bx, bufferOffset {
mov dl, drive push es
mov ch, cylinderLow mov ax, bufferSegment
mov si, chs mov es, ax
mov dh, [si].Head mov bx, bufferOffset
mov cl, sector mov dl, drive
mov al, sectorCount mov ch, cylinderLow
mov ah, function mov si, chs
int 0x13 mov dh, [si].Head
jnc ok // If CF=0, ignore AH to prevent issues caused by potential bugs in BIOSes mov cl, sector
mov result, ah mov al, sectorCount
ok: mov ah, function
pop es int 0x13
} jnc ok // If CF=0, ignore AH to prevent issues caused by potential bugs in BIOSes
mov result, ah
if (result == BiosResultEccCorrected) ok:
result = BiosResultSuccess; pop es
}
// Some BIOSes report I/O errors prematurely in some cases
} while (result != BiosResultSuccess && --tryCount != 0); if (result == BiosResultEccCorrected)
result = BiosResultSuccess;
if (!silent && result != BiosResultSuccess)
PrintDiskError (result, write, drive, nullptr, &chs); // Some BIOSes report I/O errors prematurely in some cases
} while (result != BiosResultSuccess && --tryCount != 0);
return result;
} if (!silent && result != BiosResultSuccess)
PrintDiskError (result, write, drive, nullptr, &chs);
BiosResult ReadWriteSectors (bool write, byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent) return result;
{ }
uint16 codeSeg;
__asm mov codeSeg, cs
return ReadWriteSectors (write, codeSeg, (uint16) buffer, drive, chs, sectorCount, silent); BiosResult ReadWriteSectors (bool write, byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent)
} {
uint16 codeSeg;
__asm mov codeSeg, cs
BiosResult ReadSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent) return ReadWriteSectors (write, codeSeg, (uint16) buffer, drive, chs, sectorCount, silent);
{ }
return ReadWriteSectors (false, buffer, drive, chs, sectorCount, silent);
}
BiosResult ReadSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent)
{
BiosResult WriteSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent) return ReadWriteSectors (false, buffer, drive, chs, sectorCount, silent);
{ }
return ReadWriteSectors (true, buffer, drive, chs, sectorCount, silent);
}
BiosResult WriteSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent)
{
static BiosResult ReadWriteSectors (bool write, BiosLbaPacket &dapPacket, byte drive, const uint64 &sector, uint16 sectorCount, bool silent) return ReadWriteSectors (true, buffer, drive, chs, sectorCount, silent);
{ }
CheckStack();
if (!IsLbaSupported (drive)) static BiosResult ReadWriteSectors (bool write, BiosLbaPacket &dapPacket, byte drive, const uint64 &sector, uint16 sectorCount, bool silent)
{ {
DriveGeometry geometry; CheckStack();
BiosResult result = GetDriveGeometry (drive, geometry, silent); if (!IsLbaSupported (drive))
if (result != BiosResultSuccess) {
return result; DriveGeometry geometry;
ChsAddress chs; BiosResult result = GetDriveGeometry (drive, geometry, silent);
LbaToChs (geometry, sector, chs); if (result != BiosResultSuccess)
return ReadWriteSectors (write, (uint16) (dapPacket.Buffer >> 16), (uint16) dapPacket.Buffer, drive, chs, sectorCount, silent); return result;
}
ChsAddress chs;
dapPacket.Size = sizeof (dapPacket); LbaToChs (geometry, sector, chs);
dapPacket.Reserved = 0; return ReadWriteSectors (write, (uint16) (dapPacket.Buffer >> 16), (uint16) dapPacket.Buffer, drive, chs, sectorCount, silent);
dapPacket.SectorCount = sectorCount; }
dapPacket.Sector = sector;
dapPacket.Size = sizeof (dapPacket);
byte function = write ? 0x43 : 0x42; dapPacket.Reserved = 0;
dapPacket.SectorCount = sectorCount;
BiosResult result; dapPacket.Sector = sector;
byte tryCount = TC_MAX_BIOS_DISK_IO_RETRIES;
byte function = write ? 0x43 : 0x42;
do
{ BiosResult result;
result = BiosResultSuccess; byte tryCount = TC_MAX_BIOS_DISK_IO_RETRIES;
__asm do
{ {
mov bx, 0x55aa result = BiosResultSuccess;
mov dl, drive
mov si, [dapPacket] __asm
mov ah, function {
xor al, al mov bx, 0x55aa
int 0x13 mov dl, drive
jnc ok // If CF=0, ignore AH to prevent issues caused by potential bugs in BIOSes mov si, [dapPacket]
mov result, ah mov ah, function
ok: xor al, al
} int 0x13
jnc ok // If CF=0, ignore AH to prevent issues caused by potential bugs in BIOSes
if (result == BiosResultEccCorrected) mov result, ah
result = BiosResultSuccess; ok:
}
// Some BIOSes report I/O errors prematurely in some cases
} while (result != BiosResultSuccess && --tryCount != 0); if (result == BiosResultEccCorrected)
result = BiosResultSuccess;
if (!silent && result != BiosResultSuccess)
PrintDiskError (result, write, drive, &sector); // Some BIOSes report I/O errors prematurely in some cases
} while (result != BiosResultSuccess && --tryCount != 0);
return result;
} if (!silent && result != BiosResultSuccess)
PrintDiskError (result, write, drive, &sector);
static BiosResult ReadWriteSectors (bool write, byte *buffer, byte drive, const uint64 &sector, uint16 sectorCount, bool silent) return result;
{ }
BiosLbaPacket dapPacket;
dapPacket.Buffer = (uint32) buffer;
return ReadWriteSectors (write, dapPacket, drive, sector, sectorCount, silent); static BiosResult ReadWriteSectors (bool write, byte *buffer, byte drive, const uint64 &sector, uint16 sectorCount, bool silent)
} {
BiosLbaPacket dapPacket;
dapPacket.Buffer = (uint32) buffer;
BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 &sector, uint16 sectorCount, bool silent) return ReadWriteSectors (write, dapPacket, drive, sector, sectorCount, silent);
{ }
BiosLbaPacket dapPacket;
dapPacket.Buffer = ((uint32) bufferSegment << 16) | bufferOffset;
return ReadWriteSectors (write, dapPacket, drive, sector, sectorCount, silent); BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 &sector, uint16 sectorCount, bool silent)
} {
BiosLbaPacket dapPacket;
BiosResult ReadSectors (uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 &sector, uint16 sectorCount, bool silent) dapPacket.Buffer = ((uint32) bufferSegment << 16) | bufferOffset;
{ return ReadWriteSectors (write, dapPacket, drive, sector, sectorCount, silent);
return ReadWriteSectors (false, bufferSegment, bufferOffset, drive, sector, sectorCount, silent); }
}
BiosResult ReadSectors (uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 &sector, uint16 sectorCount, bool silent)
{
BiosResult ReadSectors (byte *buffer, byte drive, const uint64 &sector, uint16 sectorCount, bool silent) return ReadWriteSectors (false, bufferSegment, bufferOffset, drive, sector, sectorCount, silent);
{ }
BiosResult result;
uint16 codeSeg;
__asm mov codeSeg, cs BiosResult ReadSectors (byte *buffer, byte drive, const uint64 &sector, uint16 sectorCount, bool silent)
{
result = ReadSectors (BootStarted ? codeSeg : TC_BOOT_LOADER_ALT_SEGMENT, (uint16) buffer, drive, sector, sectorCount, silent); BiosResult result;
uint16 codeSeg;
// Alternative segment is used to prevent memory corruption caused by buggy BIOSes __asm mov codeSeg, cs
if (!BootStarted)
CopyMemory (TC_BOOT_LOADER_ALT_SEGMENT, (uint16) buffer, buffer, sectorCount * TC_LB_SIZE); result = ReadSectors (BootStarted ? codeSeg : TC_BOOT_LOADER_ALT_SEGMENT, (uint16) buffer, drive, sector, sectorCount, silent);
return result; // Alternative segment is used to prevent memory corruption caused by buggy BIOSes
} if (!BootStarted)
CopyMemory (TC_BOOT_LOADER_ALT_SEGMENT, (uint16) buffer, buffer, sectorCount * TC_LB_SIZE);
BiosResult WriteSectors (byte *buffer, byte drive, const uint64 &sector, uint16 sectorCount, bool silent) return result;
{ }
return ReadWriteSectors (true, buffer, drive, sector, sectorCount, silent);
}
BiosResult WriteSectors (byte *buffer, byte drive, const uint64 &sector, uint16 sectorCount, bool silent)
{
BiosResult GetDriveGeometry (byte drive, DriveGeometry &geometry, bool silent) return ReadWriteSectors (true, buffer, drive, sector, sectorCount, silent);
{ }
CheckStack();
byte maxCylinderLow, maxHead, maxSector; BiosResult GetDriveGeometry (byte drive, DriveGeometry &geometry, bool silent)
BiosResult result; {
__asm CheckStack();
{
push es byte maxCylinderLow, maxHead, maxSector;
mov dl, drive BiosResult result;
mov ah, 0x08 __asm
int 0x13 {
push es
mov result, ah mov dl, drive
mov maxCylinderLow, ch mov ah, 0x08
mov maxSector, cl int 0x13
mov maxHead, dh
pop es mov result, ah
} mov maxCylinderLow, ch
mov maxSector, cl
if (result == BiosResultSuccess) mov maxHead, dh
{ pop es
geometry.Cylinders = (maxCylinderLow | (uint16 (maxSector & 0xc0) << 2)) + 1; }
geometry.Heads = maxHead + 1;
geometry.Sectors = maxSector & ~0xc0; if (result == BiosResultSuccess)
} {
else if (!silent) geometry.Cylinders = (maxCylinderLow | (uint16 (maxSector & 0xc0) << 2)) + 1;
{ geometry.Heads = maxHead + 1;
Print ("Drive "); geometry.Sectors = maxSector & ~0xc0;
Print (drive ^ 0x80); }
Print (" not found: "); else if (!silent)
PrintErrorNoEndl (""); {
Print (result); Print ("Drive ");
PrintEndl(); Print (drive ^ 0x80);
} Print (" not found: ");
PrintErrorNoEndl ("");
return result; Print (result);
} PrintEndl();
}
void ChsToLba (const DriveGeometry &geometry, const ChsAddress &chs, uint64 &lba) return result;
{ }
lba.HighPart = 0;
lba.LowPart = (uint32 (chs.Cylinder) * geometry.Heads + chs.Head) * geometry.Sectors + chs.Sector - 1;
} void ChsToLba (const DriveGeometry &geometry, const ChsAddress &chs, uint64 &lba)
{
lba.HighPart = 0;
void LbaToChs (const DriveGeometry &geometry, const uint64 &lba, ChsAddress &chs) lba.LowPart = (uint32 (chs.Cylinder) * geometry.Heads + chs.Head) * geometry.Sectors + chs.Sector - 1;
{ }
chs.Sector = (byte) ((lba.LowPart % geometry.Sectors) + 1);
uint32 ch = lba.LowPart / geometry.Sectors;
chs.Head = (byte) (ch % geometry.Heads); void LbaToChs (const DriveGeometry &geometry, const uint64 &lba, ChsAddress &chs)
chs.Cylinder = (uint16) (ch / geometry.Heads); {
} chs.Sector = (byte) ((lba.LowPart % geometry.Sectors) + 1);
uint32 ch = lba.LowPart / geometry.Sectors;
chs.Head = (byte) (ch % geometry.Heads);
void PartitionEntryMBRToPartition (const PartitionEntryMBR &partEntry, Partition &partition) chs.Cylinder = (uint16) (ch / geometry.Heads);
{ }
partition.Active = partEntry.BootIndicator == 0x80;
partition.EndSector.HighPart = 0;
partition.EndSector.LowPart = partEntry.StartLBA + partEntry.SectorCountLBA - 1; void PartitionEntryMBRToPartition (const PartitionEntryMBR &partEntry, Partition &partition)
partition.SectorCount.HighPart = 0; {
partition.SectorCount.LowPart = partEntry.SectorCountLBA; partition.Active = partEntry.BootIndicator == 0x80;
partition.StartSector.HighPart = 0; partition.EndSector.HighPart = 0;
partition.StartSector.LowPart = partEntry.StartLBA; partition.EndSector.LowPart = partEntry.StartLBA + partEntry.SectorCountLBA - 1;
partition.Type = partEntry.Type; partition.SectorCount.HighPart = 0;
} partition.SectorCount.LowPart = partEntry.SectorCountLBA;
partition.StartSector.HighPart = 0;
partition.StartSector.LowPart = partEntry.StartLBA;
BiosResult ReadWriteMBR (bool write, byte drive, bool silent) partition.Type = partEntry.Type;
{ }
uint64 mbrSector;
mbrSector.HighPart = 0;
mbrSector.LowPart = 0; BiosResult ReadWriteMBR (bool write, byte drive, bool silent)
{
if (write) uint64 mbrSector;
return WriteSectors (SectorBuffer, drive, mbrSector, 1, silent); mbrSector.HighPart = 0;
mbrSector.LowPart = 0;
return ReadSectors (SectorBuffer, drive, mbrSector, 1, silent); // Uses alternative segment
} if (write)
return WriteSectors (SectorBuffer, drive, mbrSector, 1, silent);
BiosResult GetDrivePartitions (byte drive, Partition *partitionArray, size_t partitionArrayCapacity, size_t &partitionCount, bool activeOnly, Partition *findPartitionFollowingThis, bool silent) return ReadSectors (SectorBuffer, drive, mbrSector, 1, silent); // Uses alternative segment
{ }
Partition *followingPartition;
Partition tmpPartition;
BiosResult GetDrivePartitions (byte drive, Partition *partitionArray, size_t partitionArrayCapacity, size_t &partitionCount, bool activeOnly, Partition *findPartitionFollowingThis, bool silent)
if (findPartitionFollowingThis) {
{ Partition *followingPartition;
assert (partitionArrayCapacity == 1); Partition tmpPartition;
partitionArrayCapacity = 0xff;
followingPartition = partitionArray; if (findPartitionFollowingThis)
partitionArray = &tmpPartition; {
assert (partitionArrayCapacity == 1);
followingPartition->Drive = TC_INVALID_BIOS_DRIVE; partitionArrayCapacity = 0xff;
followingPartition->StartSector.LowPart = 0xFFFFffffUL; followingPartition = partitionArray;
} partitionArray = &tmpPartition;
AcquireSectorBuffer(); followingPartition->Drive = TC_INVALID_BIOS_DRIVE;
BiosResult result = ReadWriteMBR (false, drive, silent); followingPartition->StartSector.LowPart = 0xFFFFffffUL;
ReleaseSectorBuffer(); }
partitionCount = 0; AcquireSectorBuffer();
BiosResult result = ReadWriteMBR (false, drive, silent);
MBR *mbr = (MBR *) SectorBuffer; ReleaseSectorBuffer();
if (result != BiosResultSuccess || mbr->Signature != 0xaa55)
return result; partitionCount = 0;
PartitionEntryMBR mbrPartitions[4]; MBR *mbr = (MBR *) SectorBuffer;
memcpy (mbrPartitions, mbr->Partitions, sizeof (mbrPartitions)); if (result != BiosResultSuccess || mbr->Signature != 0xaa55)
size_t partitionArrayPos = 0, partitionNumber; return result;
for (partitionNumber = 0; PartitionEntryMBR mbrPartitions[4];
partitionNumber < array_capacity (mbrPartitions) && partitionArrayPos < partitionArrayCapacity; memcpy (mbrPartitions, mbr->Partitions, sizeof (mbrPartitions));
++partitionNumber) size_t partitionArrayPos = 0, partitionNumber;
{
const PartitionEntryMBR &partEntry = mbrPartitions[partitionNumber]; for (partitionNumber = 0;
partitionNumber < array_capacity (mbrPartitions) && partitionArrayPos < partitionArrayCapacity;
if (partEntry.SectorCountLBA > 0) ++partitionNumber)
{ {
Partition &partition = partitionArray[partitionArrayPos]; const PartitionEntryMBR &partEntry = mbrPartitions[partitionNumber];
PartitionEntryMBRToPartition (partEntry, partition);
if (partEntry.SectorCountLBA > 0)
if (activeOnly && !partition.Active) {
continue; Partition &partition = partitionArray[partitionArrayPos];
PartitionEntryMBRToPartition (partEntry, partition);
partition.Drive = drive;
partition.Number = partitionArrayPos; if (activeOnly && !partition.Active)
continue;
if (partEntry.Type == 0x5 || partEntry.Type == 0xf) // Extended partition
{ partition.Drive = drive;
if (IsLbaSupported (drive)) partition.Number = partitionArrayPos;
{
// Find all extended partitions if (partEntry.Type == 0x5 || partEntry.Type == 0xf) // Extended partition
uint64 firstExtStartLBA = partition.StartSector; {
uint64 extStartLBA = partition.StartSector; if (IsLbaSupported (drive))
MBR *extMbr = (MBR *) SectorBuffer; {
// Find all extended partitions
while (partitionArrayPos < partitionArrayCapacity && uint64 firstExtStartLBA = partition.StartSector;
(result = ReadSectors ((byte *) extMbr, drive, extStartLBA, 1, silent)) == BiosResultSuccess uint64 extStartLBA = partition.StartSector;
&& extMbr->Signature == 0xaa55) MBR *extMbr = (MBR *) SectorBuffer;
{
if (extMbr->Partitions[0].SectorCountLBA > 0) while (partitionArrayPos < partitionArrayCapacity &&
{ (result = ReadSectors ((byte *) extMbr, drive, extStartLBA, 1, silent)) == BiosResultSuccess
Partition &logPart = partitionArray[partitionArrayPos]; && extMbr->Signature == 0xaa55)
PartitionEntryMBRToPartition (extMbr->Partitions[0], logPart); {
logPart.Drive = drive; if (extMbr->Partitions[0].SectorCountLBA > 0)
{
logPart.Number = partitionArrayPos; Partition &logPart = partitionArray[partitionArrayPos];
logPart.Primary = false; PartitionEntryMBRToPartition (extMbr->Partitions[0], logPart);
logPart.Drive = drive;
logPart.StartSector.LowPart += extStartLBA.LowPart;
logPart.EndSector.LowPart += extStartLBA.LowPart; logPart.Number = partitionArrayPos;
logPart.Primary = false;
if (findPartitionFollowingThis)
{ logPart.StartSector.LowPart += extStartLBA.LowPart;
if (logPart.StartSector.LowPart > findPartitionFollowingThis->EndSector.LowPart logPart.EndSector.LowPart += extStartLBA.LowPart;
&& logPart.StartSector.LowPart < followingPartition->StartSector.LowPart)
{ if (findPartitionFollowingThis)
*followingPartition = logPart; {
} if (logPart.StartSector.LowPart > findPartitionFollowingThis->EndSector.LowPart
} && logPart.StartSector.LowPart < followingPartition->StartSector.LowPart)
else {
++partitionArrayPos; *followingPartition = logPart;
} }
}
// Secondary extended else
if (extMbr->Partitions[1].Type != 0x5 && extMbr->Partitions[1].Type == 0xf ++partitionArrayPos;
|| extMbr->Partitions[1].SectorCountLBA == 0) }
break;
// Secondary extended
extStartLBA.LowPart = extMbr->Partitions[1].StartLBA + firstExtStartLBA.LowPart; if (extMbr->Partitions[1].Type != 0x5 && extMbr->Partitions[1].Type == 0xf
} || extMbr->Partitions[1].SectorCountLBA == 0)
} break;
}
else extStartLBA.LowPart = extMbr->Partitions[1].StartLBA + firstExtStartLBA.LowPart;
{ }
partition.Primary = true; }
}
if (findPartitionFollowingThis) else
{ {
if (partition.StartSector.LowPart > findPartitionFollowingThis->EndSector.LowPart partition.Primary = true;
&& partition.StartSector.LowPart < followingPartition->StartSector.LowPart)
{ if (findPartitionFollowingThis)
*followingPartition = partition; {
} if (partition.StartSector.LowPart > findPartitionFollowingThis->EndSector.LowPart
} && partition.StartSector.LowPart < followingPartition->StartSector.LowPart)
else {
++partitionArrayPos; *followingPartition = partition;
} }
} }
} else
++partitionArrayPos;
partitionCount = partitionArrayPos; }
return result; }
} }
partitionCount = partitionArrayPos;
bool GetActivePartition (byte drive) return result;
{ }
size_t partCount;
if (GetDrivePartitions (drive, &ActivePartition, 1, partCount, true) != BiosResultSuccess || partCount < 1) bool GetActivePartition (byte drive)
{ {
ActivePartition.Drive = TC_INVALID_BIOS_DRIVE; size_t partCount;
PrintError (TC_BOOT_STR_NO_BOOT_PARTITION);
return false; if (GetDrivePartitions (drive, &ActivePartition, 1, partCount, true) != BiosResultSuccess || partCount < 1)
} {
ActivePartition.Drive = TC_INVALID_BIOS_DRIVE;
return true; PrintError (TC_BOOT_STR_NO_BOOT_PARTITION);
} return false;
}
return true;
}
+120 -116
View File
@@ -1,116 +1,120 @@
/* /*
Copyright (c) 2008-2011 TrueCrypt Developers Association. All rights reserved. Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
Governed by the TrueCrypt License 3.0 the full text of which is contained in by the TrueCrypt License 3.0.
the file License.txt included in TrueCrypt binary and source code distribution
packages. Modifications and additions to the original source code (contained in this file)
*/ and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
#ifndef TC_HEADER_Boot_BootDiskIo contained in the file License.txt included in VeraCrypt binary and source
#define TC_HEADER_Boot_BootDiskIo code distribution packages.
*/
#include "Bios.h"
#include "BootDebug.h" #ifndef TC_HEADER_Boot_BootDiskIo
#include "BootDefs.h" #define TC_HEADER_Boot_BootDiskIo
#define TC_MAX_BIOS_DISK_IO_RETRIES 5 #include "Bios.h"
#include "BootDebug.h"
enum #include "BootDefs.h"
{
BiosResultEccCorrected = 0x11 #define TC_MAX_BIOS_DISK_IO_RETRIES 5
};
enum
#pragma pack(1) {
BiosResultEccCorrected = 0x11
struct PartitionEntryMBR };
{
byte BootIndicator; #pragma pack(1)
byte StartHead; struct PartitionEntryMBR
byte StartCylSector; {
byte StartCylinder; byte BootIndicator;
byte Type; byte StartHead;
byte StartCylSector;
byte EndHead; byte StartCylinder;
byte EndSector;
byte EndCylinder; byte Type;
uint32 StartLBA; byte EndHead;
uint32 SectorCountLBA; byte EndSector;
}; byte EndCylinder;
struct MBR uint32 StartLBA;
{ uint32 SectorCountLBA;
byte Code[446]; };
PartitionEntryMBR Partitions[4];
uint16 Signature; struct MBR
}; {
byte Code[446];
struct BiosLbaPacket PartitionEntryMBR Partitions[4];
{ uint16 Signature;
byte Size; };
byte Reserved;
uint16 SectorCount; struct BiosLbaPacket
uint32 Buffer; {
uint64 Sector; byte Size;
}; byte Reserved;
uint16 SectorCount;
#pragma pack() uint32 Buffer;
uint64 Sector;
};
struct ChsAddress
{ #pragma pack()
uint16 Cylinder;
byte Head;
byte Sector; struct ChsAddress
}; {
uint16 Cylinder;
struct Partition byte Head;
{ byte Sector;
byte Number; };
byte Drive;
bool Active; struct Partition
uint64 EndSector; {
bool Primary; byte Number;
uint64 SectorCount; byte Drive;
uint64 StartSector; bool Active;
byte Type; uint64 EndSector;
}; bool Primary;
uint64 SectorCount;
struct DriveGeometry uint64 StartSector;
{ byte Type;
uint16 Cylinders; };
byte Heads;
byte Sectors; struct DriveGeometry
}; {
uint16 Cylinders;
byte Heads;
#ifdef TC_BOOT_DEBUG_ENABLED byte Sectors;
void AcquireSectorBuffer (); };
void ReleaseSectorBuffer ();
#else
# define AcquireSectorBuffer() #ifdef TC_BOOT_DEBUG_ENABLED
# define ReleaseSectorBuffer() void AcquireSectorBuffer ();
#endif void ReleaseSectorBuffer ();
#else
void ChsToLba (const DriveGeometry &geometry, const ChsAddress &chs, uint64 &lba); # define AcquireSectorBuffer()
bool GetActivePartition (byte drive); # define ReleaseSectorBuffer()
BiosResult GetDriveGeometry (byte drive, DriveGeometry &geometry, bool silent = false); #endif
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); void ChsToLba (const DriveGeometry &geometry, const ChsAddress &chs, uint64 &lba);
void LbaToChs (const DriveGeometry &geometry, const uint64 &lba, ChsAddress &chs); bool GetActivePartition (byte drive);
void Print (const ChsAddress &chs); BiosResult GetDriveGeometry (byte drive, DriveGeometry &geometry, bool silent = false);
void PrintDiskError (BiosResult error, bool write, byte drive, const uint64 *sector, const ChsAddress *chs = nullptr); BiosResult GetDrivePartitions (byte drive, Partition *partitionArray, size_t partitionArrayCapacity, size_t &partitionCount, bool activeOnly = false, Partition *findPartitionFollowingThis = nullptr, bool silent = false);
void PrintSectorCountInMB (const uint64 &sectorCount); bool IsLbaSupported (byte drive);
BiosResult ReadWriteMBR (bool write, byte drive, bool silent = false); void LbaToChs (const DriveGeometry &geometry, const uint64 &lba, ChsAddress &chs);
BiosResult ReadSectors (uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 &sector, uint16 sectorCount, bool silent = false); void Print (const ChsAddress &chs);
BiosResult ReadSectors (byte *buffer, byte drive, const uint64 &sector, uint16 sectorCount, bool silent = false); void PrintDiskError (BiosResult error, bool write, byte drive, const uint64 *sector, const ChsAddress *chs = nullptr);
BiosResult ReadSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent = false); void PrintSectorCountInMB (const uint64 &sectorCount);
BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 &sector, uint16 sectorCount, bool silent); BiosResult ReadWriteMBR (bool write, byte drive, bool silent = false);
BiosResult WriteSectors (byte *buffer, byte drive, const uint64 &sector, uint16 sectorCount, bool silent = false); BiosResult ReadSectors (uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 &sector, uint16 sectorCount, bool silent = false);
BiosResult WriteSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent = false); BiosResult ReadSectors (byte *buffer, byte drive, const uint64 &sector, uint16 sectorCount, bool silent = false);
BiosResult ReadSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent = false);
extern byte SectorBuffer[TC_LB_SIZE]; BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 &sector, uint16 sectorCount, bool silent);
BiosResult WriteSectors (byte *buffer, byte drive, const uint64 &sector, uint16 sectorCount, bool silent = false);
#endif // TC_HEADER_Boot_BootDiskIo BiosResult WriteSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent = false);
extern byte SectorBuffer[TC_LB_SIZE];
#endif // TC_HEADER_Boot_BootDiskIo
+132 -128
View File
@@ -1,128 +1,132 @@
/* /*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved. Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
Governed by the TrueCrypt License 3.0 the full text of which is contained in by the TrueCrypt License 3.0.
the file License.txt included in TrueCrypt binary and source code distribution
packages. Modifications and additions to the original source code (contained in this file)
*/ and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
#include "Crypto.h" contained in the file License.txt included in VeraCrypt binary and source
#include "Platform.h" code distribution packages.
#include "BootConfig.h" */
#include "BootDebug.h"
#include "BootDefs.h" #include "Crypto.h"
#include "BootDiskIo.h" #include "Platform.h"
#include "BootEncryptedIo.h" #include "BootConfig.h"
#include "BootDebug.h"
#include "BootDefs.h"
BiosResult ReadEncryptedSectors (uint16 destSegment, uint16 destOffset, byte drive, uint64 sector, uint16 sectorCount) #include "BootDiskIo.h"
{ #include "BootEncryptedIo.h"
BiosResult result;
bool decrypt = true;
BiosResult ReadEncryptedSectors (uint16 destSegment, uint16 destOffset, byte drive, uint64 sector, uint16 sectorCount)
if (BootCryptoInfo->hiddenVolume) {
{ BiosResult result;
if (ReadWritePartiallyCoversEncryptedArea (sector, sectorCount)) bool decrypt = true;
return BiosResultInvalidFunction;
if (BootCryptoInfo->hiddenVolume)
if (sector >= EncryptedVirtualPartition.StartSector && sector <= EncryptedVirtualPartition.EndSector) {
{ if (ReadWritePartiallyCoversEncryptedArea (sector, sectorCount))
// Remap the request to the hidden volume return BiosResultInvalidFunction;
sector -= EncryptedVirtualPartition.StartSector;
sector += HiddenVolumeStartSector; if (sector >= EncryptedVirtualPartition.StartSector && sector <= EncryptedVirtualPartition.EndSector)
} {
else // Remap the request to the hidden volume
decrypt = false; sector -= EncryptedVirtualPartition.StartSector;
} sector += HiddenVolumeStartSector;
}
result = ReadSectors (destSegment, destOffset, drive, sector, sectorCount); else
decrypt = false;
if (result != BiosResultSuccess || !decrypt) }
return result;
result = ReadSectors (destSegment, destOffset, drive, sector, sectorCount);
if (BootCryptoInfo->hiddenVolume)
{ if (result != BiosResultSuccess || !decrypt)
// Convert sector number to data unit number of the hidden volume return result;
sector -= HiddenVolumeStartSector;
sector += HiddenVolumeStartUnitNo; if (BootCryptoInfo->hiddenVolume)
} {
// Convert sector number to data unit number of the hidden volume
if (drive == EncryptedVirtualPartition.Drive) sector -= HiddenVolumeStartSector;
{ sector += PimValueOrHiddenVolumeStartUnitNo;
while (sectorCount-- > 0) }
{
if (BootCryptoInfo->hiddenVolume if (drive == EncryptedVirtualPartition.Drive)
|| (sector >= EncryptedVirtualPartition.StartSector && sector <= EncryptedVirtualPartition.EndSector)) {
{ while (sectorCount-- > 0)
AcquireSectorBuffer(); {
CopyMemory (destSegment, destOffset, SectorBuffer, TC_LB_SIZE); if (BootCryptoInfo->hiddenVolume
|| (sector >= EncryptedVirtualPartition.StartSector && sector <= EncryptedVirtualPartition.EndSector))
DecryptDataUnits (SectorBuffer, &sector, 1, BootCryptoInfo); {
AcquireSectorBuffer();
CopyMemory (SectorBuffer, destSegment, destOffset, TC_LB_SIZE); CopyMemory (destSegment, destOffset, SectorBuffer, TC_LB_SIZE);
ReleaseSectorBuffer();
} DecryptDataUnits (SectorBuffer, &sector, 1, BootCryptoInfo);
++sector; CopyMemory (SectorBuffer, destSegment, destOffset, TC_LB_SIZE);
destOffset += TC_LB_SIZE; ReleaseSectorBuffer();
} }
}
++sector;
return result; destOffset += TC_LB_SIZE;
} }
}
BiosResult WriteEncryptedSectors (uint16 sourceSegment, uint16 sourceOffset, byte drive, uint64 sector, uint16 sectorCount) return result;
{ }
BiosResult result;
AcquireSectorBuffer();
uint64 dataUnitNo; BiosResult WriteEncryptedSectors (uint16 sourceSegment, uint16 sourceOffset, byte drive, uint64 sector, uint16 sectorCount)
uint64 writeOffset; {
BiosResult result = BiosResultSuccess;
dataUnitNo = sector; AcquireSectorBuffer();
writeOffset.HighPart = 0; uint64 dataUnitNo;
writeOffset.LowPart = 0; uint64 writeOffset;
if (BootCryptoInfo->hiddenVolume) dataUnitNo = sector;
{ writeOffset.HighPart = 0;
if (ReadWritePartiallyCoversEncryptedArea (sector, sectorCount)) writeOffset.LowPart = 0;
return BiosResultInvalidFunction;
if (BootCryptoInfo->hiddenVolume)
// Remap the request to the hidden volume {
writeOffset = HiddenVolumeStartSector; if (ReadWritePartiallyCoversEncryptedArea (sector, sectorCount))
writeOffset -= EncryptedVirtualPartition.StartSector; return BiosResultInvalidFunction;
dataUnitNo -= EncryptedVirtualPartition.StartSector;
dataUnitNo += HiddenVolumeStartUnitNo; // Remap the request to the hidden volume
} writeOffset = HiddenVolumeStartSector;
writeOffset -= EncryptedVirtualPartition.StartSector;
while (sectorCount-- > 0) dataUnitNo -= EncryptedVirtualPartition.StartSector;
{ dataUnitNo += PimValueOrHiddenVolumeStartUnitNo;
CopyMemory (sourceSegment, sourceOffset, SectorBuffer, TC_LB_SIZE); }
if (drive == EncryptedVirtualPartition.Drive && sector >= EncryptedVirtualPartition.StartSector && sector <= EncryptedVirtualPartition.EndSector) while (sectorCount-- > 0)
{ {
EncryptDataUnits (SectorBuffer, &dataUnitNo, 1, BootCryptoInfo); CopyMemory (sourceSegment, sourceOffset, SectorBuffer, TC_LB_SIZE);
}
if (drive == EncryptedVirtualPartition.Drive && sector >= EncryptedVirtualPartition.StartSector && sector <= EncryptedVirtualPartition.EndSector)
result = WriteSectors (SectorBuffer, drive, sector + writeOffset, 1); {
EncryptDataUnits (SectorBuffer, &dataUnitNo, 1, BootCryptoInfo);
if (result != BiosResultSuccess) }
break;
result = WriteSectors (SectorBuffer, drive, sector + writeOffset, 1);
++sector;
++dataUnitNo; if (result != BiosResultSuccess)
sourceOffset += TC_LB_SIZE; break;
}
++sector;
ReleaseSectorBuffer(); ++dataUnitNo;
return result; sourceOffset += TC_LB_SIZE;
} }
ReleaseSectorBuffer();
static bool ReadWritePartiallyCoversEncryptedArea (const uint64 &sector, uint16 sectorCount) return result;
{ }
uint64 readWriteEnd = sector + --sectorCount;
return ((sector < EncryptedVirtualPartition.StartSector && readWriteEnd >= EncryptedVirtualPartition.StartSector) static bool ReadWritePartiallyCoversEncryptedArea (const uint64 &sector, uint16 sectorCount)
|| (sector >= EncryptedVirtualPartition.StartSector && readWriteEnd > EncryptedVirtualPartition.EndSector)); {
} uint64 readWriteEnd = sector + --sectorCount;
return ((sector < EncryptedVirtualPartition.StartSector && readWriteEnd >= EncryptedVirtualPartition.StartSector)
|| (sector >= EncryptedVirtualPartition.StartSector && readWriteEnd > EncryptedVirtualPartition.EndSector));
}
+22 -18
View File
@@ -1,18 +1,22 @@
/* /*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved. Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
Governed by the TrueCrypt License 3.0 the full text of which is contained in by the TrueCrypt License 3.0.
the file License.txt included in TrueCrypt binary and source code distribution
packages. Modifications and additions to the original source code (contained in this file)
*/ and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
#ifndef TC_HEADER_Boot_BootEncryptionIo contained in the file License.txt included in VeraCrypt binary and source
#define TC_HEADER_Boot_BootEncryptionIo code distribution packages.
*/
#include "Platform.h"
#ifndef TC_HEADER_Boot_BootEncryptionIo
BiosResult ReadEncryptedSectors (uint16 destSegment, uint16 destOffset, byte drive, uint64 sector, uint16 sectorCount); #define TC_HEADER_Boot_BootEncryptionIo
BiosResult WriteEncryptedSectors (uint16 sourceSegment, uint16 sourceOffset, byte drive, uint64 sector, uint16 sectorCount);
static bool ReadWritePartiallyCoversEncryptedArea (const uint64 &sector, uint16 sectorCount); #include "Platform.h"
#endif // TC_HEADER_Boot_BootEncryptionIo BiosResult ReadEncryptedSectors (uint16 destSegment, uint16 destOffset, byte drive, uint64 sector, uint16 sectorCount);
BiosResult WriteEncryptedSectors (uint16 sourceSegment, uint16 sourceOffset, byte drive, uint64 sector, uint16 sectorCount);
static bool ReadWritePartiallyCoversEncryptedArea (const uint64 &sector, uint16 sectorCount);
#endif // TC_HEADER_Boot_BootEncryptionIo
+1269 -1151
View File
File diff suppressed because it is too large Load Diff
+34 -30
View File
@@ -1,30 +1,34 @@
/* /*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved. Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
Governed by the TrueCrypt License 3.0 the full text of which is contained in by the TrueCrypt License 3.0.
the file License.txt included in TrueCrypt binary and source code distribution
packages. Modifications and additions to the original source code (contained in this file)
*/ and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
#ifndef TC_HEADER_Boot_BootMain contained in the file License.txt included in VeraCrypt binary and source
#define TC_HEADER_Boot_BootMain code distribution packages.
*/
#include "TCdefs.h"
#include "Platform.h" #ifndef TC_HEADER_Boot_BootMain
#define TC_HEADER_Boot_BootMain
static byte AskPassword (Password &password);
static int AskSelection (const char *options[], size_t optionCount); #include "TCdefs.h"
static bool AskYesNo (const char *message); #include "Platform.h"
static byte BootEncryptedDrive ();
static void BootMenu (); static byte AskPassword (Password &password, int& pim);
static void ExecuteBootSector (byte drive, byte *sectorBuffer); static int AskSelection (const char *options[], size_t optionCount);
static void InitScreen (); static bool AskYesNo (const char *message);
static bool IsMenuKey (byte scanCode); static byte BootEncryptedDrive ();
static bool MountVolume (byte drive, byte &exitKey); static void BootMenu ();
static bool OpenVolume (byte drive, Password &password, CRYPTO_INFO **cryptoInfo, uint32 *headerSaltCrc32 = nullptr, bool skipNormal = false, bool skipHidden = false); static void ExecuteBootSector (byte drive, byte *sectorBuffer);
static void PrintMainMenu (); static void InitScreen ();
static void RepairMenu (); static bool IsMenuKey (byte scanCode);
static bool MountVolume (byte drive, byte &exitKey);
#define TC_MENU_KEY_REPAIR TC_BIOS_KEY_F8 static bool OpenVolume (byte drive, Password &password, CRYPTO_INFO **cryptoInfo, uint32 *headerSaltCrc32 = nullptr, bool skipNormal = false, bool skipHidden = false);
static void PrintMainMenu ();
#endif // TC_HEADER_Boot_BootMain static void RepairMenu ();
#define TC_MENU_KEY_REPAIR TC_BIOS_KEY_F8
#endif // TC_HEADER_Boot_BootMain
+86 -82
View File
@@ -1,82 +1,86 @@
/* /*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved. Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
Governed by the TrueCrypt License 3.0 the full text of which is contained in by the TrueCrypt License 3.0.
the file License.txt included in TrueCrypt binary and source code distribution
packages. Modifications and additions to the original source code (contained in this file)
*/ and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
#include "BootDefs.h" contained in the file License.txt included in VeraCrypt binary and source
#include "BootMemory.h" code distribution packages.
*/
static uint32 MemoryMapContValue;
#include "BootDefs.h"
static bool GetMemoryMapEntry (BiosMemoryMapEntry &entry) #include "BootMemory.h"
{
static const uint32 function = 0x0000E820UL; static uint32 MemoryMapContValue;
static const uint32 magic = 0x534D4150UL;
static const uint32 bufferSize = sizeof (BiosMemoryMapEntry); static bool GetMemoryMapEntry (BiosMemoryMapEntry &entry)
{
bool carry = false; static const uint32 function = 0x0000E820UL;
uint32 resultMagic; static const uint32 magic = 0x534D4150UL;
uint32 resultSize; static const uint32 bufferSize = sizeof (BiosMemoryMapEntry);
__asm bool carry = false;
{ uint32 resultMagic;
push es uint32 resultSize;
lea di, function __asm
TC_ASM_MOV_EAX_DI {
lea di, MemoryMapContValue push es
TC_ASM_MOV_EBX_DI
lea di, bufferSize lea di, function
TC_ASM_MOV_ECX_DI TC_ASM_MOV_EAX_DI
lea di, magic lea di, MemoryMapContValue
TC_ASM_MOV_EDX_DI TC_ASM_MOV_EBX_DI
lea di, MemoryMapContValue lea di, bufferSize
TC_ASM_MOV_DI_ECX TC_ASM_MOV_ECX_DI
lea di, magic
// Use alternative segment to prevent memory corruption caused by buggy BIOSes TC_ASM_MOV_EDX_DI
push TC_BOOT_LOADER_ALT_SEGMENT lea di, MemoryMapContValue
pop es TC_ASM_MOV_DI_ECX
mov di, 0
// Use alternative segment to prevent memory corruption caused by buggy BIOSes
int 0x15 push TC_BOOT_LOADER_ALT_SEGMENT
jnc no_carry pop es
mov carry, true mov di, 0
no_carry:
int 0x15
lea di, resultMagic jnc no_carry
TC_ASM_MOV_DI_EAX mov carry, true
lea di, MemoryMapContValue no_carry:
TC_ASM_MOV_DI_EBX
lea di, resultSize lea di, resultMagic
TC_ASM_MOV_DI_ECX TC_ASM_MOV_DI_EAX
lea di, MemoryMapContValue
pop es TC_ASM_MOV_DI_EBX
} lea di, resultSize
TC_ASM_MOV_DI_ECX
CopyMemory (TC_BOOT_LOADER_ALT_SEGMENT, 0, &entry, sizeof (entry));
pop es
// BIOS may set CF at the end of the list }
if (carry)
MemoryMapContValue = 0; CopyMemory (TC_BOOT_LOADER_ALT_SEGMENT, 0, &entry, sizeof (entry));
return resultMagic == magic && resultSize == bufferSize; // BIOS may set CF at the end of the list
} if (carry)
MemoryMapContValue = 0;
bool GetFirstBiosMemoryMapEntry (BiosMemoryMapEntry &entry) return resultMagic == magic && resultSize == bufferSize;
{ }
MemoryMapContValue = 0;
return GetMemoryMapEntry (entry);
} bool GetFirstBiosMemoryMapEntry (BiosMemoryMapEntry &entry)
{
MemoryMapContValue = 0;
bool GetNextBiosMemoryMapEntry (BiosMemoryMapEntry &entry) return GetMemoryMapEntry (entry);
{ }
if (MemoryMapContValue == 0)
return false;
bool GetNextBiosMemoryMapEntry (BiosMemoryMapEntry &entry)
return GetMemoryMapEntry (entry); {
} if (MemoryMapContValue == 0)
return false;
return GetMemoryMapEntry (entry);
}
+28 -24
View File
@@ -1,24 +1,28 @@
/* /*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved. Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
Governed by the TrueCrypt License 3.0 the full text of which is contained in by the TrueCrypt License 3.0.
the file License.txt included in TrueCrypt binary and source code distribution
packages. Modifications and additions to the original source code (contained in this file)
*/ and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
#include "Platform.h" contained in the file License.txt included in VeraCrypt binary and source
#include "Bios.h" code distribution packages.
*/
#pragma pack(1)
#include "Platform.h"
struct BiosMemoryMapEntry #include "Bios.h"
{
uint64 BaseAddress; #pragma pack(1)
uint64 Length;
uint32 Type; struct BiosMemoryMapEntry
}; {
uint64 BaseAddress;
#pragma pack() uint64 Length;
uint32 Type;
bool GetFirstBiosMemoryMapEntry (BiosMemoryMapEntry &entry); };
bool GetNextBiosMemoryMapEntry (BiosMemoryMapEntry &entry);
#pragma pack()
bool GetFirstBiosMemoryMapEntry (BiosMemoryMapEntry &entry);
bool GetNextBiosMemoryMapEntry (BiosMemoryMapEntry &entry);
+244 -237
View File
@@ -1,237 +1,244 @@
; ;
; Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved. ; Derived from source code of TrueCrypt 7.1a, which is
; ; Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
; Governed by the TrueCrypt License 3.0 the full text of which is contained in ; by the TrueCrypt License 3.0.
; the file License.txt included in TrueCrypt binary and source code distribution ;
; packages. ; Modifications and additions to the original source code (contained in this file)
; ; and all other portions of this file are Copyright (c) 2013-2016 IDRIX
; and are governed by the Apache License 2.0 the full text of which is
.MODEL tiny ; contained in the file License.txt included in VeraCrypt binary and source
.386 ; code distribution packages.
_TEXT SEGMENT USE16 ;
INCLUDE BootDefs.i .MODEL tiny
.386
ORG 7C00h ; Standard boot sector offset _TEXT SEGMENT USE16
start: INCLUDE BootDefs.i
; BIOS executes boot sector from 0:7C00 or 7C0:0000 (default CD boot loader address).
; Far jump to the next instruction sets IP to the standard offset 7C00. ORG 7C00h ; Standard boot sector offset
db 0EAh ; jmp 0:main
dw main, 0 start:
; BIOS executes boot sector from 0:7C00 or 7C0:0000 (default CD boot loader address).
loader_name_msg: ; Far jump to the next instruction sets IP to the standard offset 7C00.
db ' VeraCrypt Boot Loader', 13, 10, 0 db 0EAh ; jmp 0:main
dw main, 0
main:
cli loader_name_msg:
xor ax, ax db ' VeraCrypt Boot Loader', 13, 10, 0
mov ds, ax
mov ss, ax main:
mov sp, 7C00h cli
sti xor ax, ax
mov ds, ax
; Display boot loader name mov ss, ax
test byte ptr [start + TC_BOOT_SECTOR_USER_CONFIG_OFFSET], TC_BOOT_USER_CFG_FLAG_SILENT_MODE mov sp, 7C00h
jnz skip_loader_name_msg sti
lea si, loader_name_msg ; Display boot loader name
call print test byte ptr [start + TC_BOOT_SECTOR_USER_CONFIG_OFFSET], TC_BOOT_USER_CFG_FLAG_SILENT_MODE
skip_loader_name_msg: jnz skip_loader_name_msg
; Determine boot loader segment lea si, loader_name_msg
mov ax, TC_BOOT_LOADER_SEGMENT call print
skip_loader_name_msg:
; Check available memory
cmp word ptr [ds:413h], TC_BOOT_LOADER_SEGMENT / 1024 * 16 + TC_BOOT_MEMORY_REQUIRED ; Determine boot loader segment
jge memory_ok mov ax, TC_BOOT_LOADER_SEGMENT
mov ax, TC_BOOT_LOADER_SEGMENT_LOW ; Check available memory
cmp word ptr [ds:413h], TC_BOOT_LOADER_SEGMENT / 1024 * 16 + TC_BOOT_MEMORY_REQUIRED
cmp word ptr [ds:413h], TC_BOOT_LOADER_SEGMENT_LOW / 1024 * 16 + TC_BOOT_MEMORY_REQUIRED jge memory_ok
jge memory_ok
mov ax, TC_BOOT_LOADER_SEGMENT_LOW
; Insufficient memory
mov ax, TC_BOOT_LOADER_LOWMEM_SEGMENT cmp word ptr [ds:413h], TC_BOOT_LOADER_SEGMENT_LOW / 1024 * 16 + TC_BOOT_MEMORY_REQUIRED
jge memory_ok
memory_ok:
mov es, ax ; Insufficient memory
mov ax, TC_BOOT_LOADER_LOWMEM_SEGMENT
; Clear BSS section
xor al, al memory_ok:
mov di, TC_COM_EXECUTABLE_OFFSET mov es, ax
mov cx, TC_BOOT_MEMORY_REQUIRED * 1024 - TC_COM_EXECUTABLE_OFFSET - 1
cld ; Clear BSS section
rep stosb xor al, al
mov di, TC_COM_EXECUTABLE_OFFSET
mov ax, es mov cx, TC_BOOT_MEMORY_REQUIRED * 1024 - TC_COM_EXECUTABLE_OFFSET - 1
sub ax, TC_BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE / 16 ; Decompressor segment cld
mov es, ax rep stosb
; Load decompressor mov ax, es
mov cl, TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR sub ax, TC_BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE / 16 ; Decompressor segment
retry_backup: mov es, ax
mov al, TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT
mov bx, TC_COM_EXECUTABLE_OFFSET ; Load decompressor
call read_sectors mov cl, TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR
retry_backup:
; Decompressor checksum mov al, TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT
xor ebx, ebx mov bx, TC_COM_EXECUTABLE_OFFSET
mov si, TC_COM_EXECUTABLE_OFFSET call read_sectors
mov cx, TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT * TC_LB_SIZE
call checksum ; Decompressor checksum
push ebx xor ebx, ebx
mov si, TC_COM_EXECUTABLE_OFFSET
; Load compressed boot loader mov cx, TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT * TC_LB_SIZE
mov bx, TC_BOOT_LOADER_COMPRESSED_BUFFER_OFFSET call checksum
mov cl, TC_BOOT_LOADER_START_SECTOR push ebx
mov al, TC_MAX_BOOT_LOADER_SECTOR_COUNT
; Load compressed boot loader
test backup_loader_used, 1 mov bx, TC_BOOT_LOADER_COMPRESSED_BUFFER_OFFSET
jz non_backup mov cl, TC_BOOT_LOADER_START_SECTOR
mov al, TC_BOOT_LOADER_BACKUP_SECTOR_COUNT - TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT mov al, TC_MAX_BOOT_LOADER_SECTOR_COUNT
mov cl, TC_BOOT_LOADER_START_SECTOR + TC_BOOT_LOADER_BACKUP_SECTOR_COUNT
test backup_loader_used, 1
non_backup: jz non_backup
call read_sectors mov al, TC_BOOT_LOADER_BACKUP_SECTOR_COUNT - TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT
mov cl, TC_BOOT_LOADER_START_SECTOR + TC_BOOT_LOADER_BACKUP_SECTOR_COUNT
; Boot loader checksum
pop ebx non_backup:
mov si, TC_BOOT_LOADER_COMPRESSED_BUFFER_OFFSET call read_sectors
mov cx, word ptr [start + TC_BOOT_SECTOR_LOADER_LENGTH_OFFSET]
call checksum ; Boot loader checksum
pop ebx
; Verify checksum mov si, TC_BOOT_LOADER_COMPRESSED_BUFFER_OFFSET
cmp ebx, dword ptr [start + TC_BOOT_SECTOR_LOADER_CHECKSUM_OFFSET] mov cx, word ptr [start + TC_BOOT_SECTOR_LOADER_LENGTH_OFFSET]
je checksum_ok call checksum
; Checksum incorrect - try using backup if available ; Verify checksum
test backup_loader_used, 1 cmp ebx, dword ptr [start + TC_BOOT_SECTOR_LOADER_CHECKSUM_OFFSET]
jnz loader_damaged je checksum_ok
mov backup_loader_used, 1 ; Checksum incorrect - try using backup if available
mov cl, TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR + TC_BOOT_LOADER_BACKUP_SECTOR_COUNT test backup_loader_used, 1
jnz loader_damaged
test TC_BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE, byte ptr [start + TC_BOOT_SECTOR_CONFIG_OFFSET]
jnz retry_backup mov backup_loader_used, 1
mov cl, TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR + TC_BOOT_LOADER_BACKUP_SECTOR_COUNT
loader_damaged:
lea si, loader_damaged_msg test TC_BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE, byte ptr [start + TC_BOOT_SECTOR_CONFIG_OFFSET]
call print jnz retry_backup
lea si, loader_name_msg
call print loader_damaged:
jmp $ lea si, loader_damaged_msg
checksum_ok: call print
lea si, loader_name_msg
; Set up decompressor segment call print
mov ax, es jmp $
mov ds, ax checksum_ok:
cli
mov ss, ax ; Set up decompressor segment
mov sp, TC_BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE mov ax, es
sti mov ds, ax
cli
push dx mov ss, ax
mov sp, TC_BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE
; Decompress boot loader sti
push TC_BOOT_LOADER_COMPRESSED_BUFFER_OFFSET + TC_GZIP_HEADER_SIZE ; Compressed data
push TC_MAX_BOOT_LOADER_DECOMPRESSED_SIZE ; Output buffer size push dx
push TC_BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE + TC_COM_EXECUTABLE_OFFSET ; Output buffer
; Decompress boot loader
push cs mov cx, word ptr [start + TC_BOOT_SECTOR_LOADER_LENGTH_OFFSET]
push decompressor_ret sub cx, TC_GZIP_HEADER_SIZE
push es push cx ; Compressed data size
push TC_COM_EXECUTABLE_OFFSET push TC_BOOT_LOADER_COMPRESSED_BUFFER_OFFSET + TC_GZIP_HEADER_SIZE ; Compressed data
retf push TC_MAX_BOOT_LOADER_DECOMPRESSED_SIZE ; Output buffer size
decompressor_ret: push TC_BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE + TC_COM_EXECUTABLE_OFFSET ; Output buffer
add sp, 6 push cs
pop dx push decompressor_ret
push es
; Restore boot sector segment push TC_COM_EXECUTABLE_OFFSET
push cs retf
pop ds decompressor_ret:
; Check decompression result add sp, 8
test ax, ax pop dx
jz decompression_ok
; Restore boot sector segment
lea si, loader_damaged_msg push cs
call print pop ds
jmp $
decompression_ok: ; Check decompression result
test ax, ax
; DH = boot sector flags jz decompression_ok
mov dh, byte ptr [start + TC_BOOT_SECTOR_CONFIG_OFFSET]
lea si, loader_damaged_msg
; Set up boot loader segment call print
mov ax, es jmp $
add ax, TC_BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE / 16 decompression_ok:
mov es, ax
mov ds, ax ; DH = boot sector flags
cli mov dh, byte ptr [start + TC_BOOT_SECTOR_CONFIG_OFFSET]
mov ss, ax
mov sp, TC_BOOT_LOADER_STACK_TOP ; Set up boot loader segment
sti mov ax, es
add ax, TC_BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE / 16
; Execute boot loader mov es, ax
push es mov ds, ax
push TC_COM_EXECUTABLE_OFFSET cli
retf mov ss, ax
mov sp, TC_BOOT_LOADER_STACK_TOP
; Print string sti
print:
xor bx, bx ; Execute boot loader
mov ah, 0eh push es
cld push TC_COM_EXECUTABLE_OFFSET
retf
@@: lodsb
test al, al ; Print string
jz print_end print:
xor bx, bx
int 10h mov ah, 0eh
jmp @B cld
print_end: @@: lodsb
ret test al, al
jz print_end
; Read sectors of the first cylinder
read_sectors: int 10h
mov ch, 0 ; Cylinder jmp @B
mov dh, 0 ; Head
; DL = drive number passed from BIOS print_end:
mov ah, 2 ret
int 13h
jnc read_ok ; Read sectors of the first cylinder
read_sectors:
lea si, disk_error_msg mov ch, 0 ; Cylinder
call print mov dh, 0 ; Head
read_ok: ; DL = drive number passed from BIOS
ret mov ah, 2
int 13h
; Calculate checksum jnc read_ok
checksum:
push ds lea si, disk_error_msg
push es call print
pop ds read_ok:
xor eax, eax ret
cld
; Calculate checksum
@@: lodsb checksum:
add ebx, eax push ds
rol ebx, 1 push es
loop @B pop ds
xor eax, eax
pop ds cld
ret
@@: lodsb
backup_loader_used db 0 add ebx, eax
rol ebx, 1
disk_error_msg db 'Disk error', 13, 10, 7, 0 loop @B
loader_damaged_msg db 7, 'Loader damaged! Use Rescue Disk: Repair Options > Restore', 0
pop ds
ORG 7C00h + 510 ret
dw 0AA55h ; Boot sector signature
backup_loader_used db 0
_TEXT ENDS
END start disk_error_msg db 'Disk error', 13, 10, 7, 0
loader_damaged_msg db 7, 'Loader damaged! Repair with Rescue Disk', 0
ORG 7C00h + 510
dw 0AA55h ; Boot sector signature
_TEXT ENDS
END start
+20 -16
View File
@@ -1,16 +1,20 @@
/* /*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved. Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
Governed by the TrueCrypt License 3.0 the full text of which is contained in by the TrueCrypt License 3.0.
the file License.txt included in TrueCrypt binary and source code distribution
packages. Modifications and additions to the original source code (contained in this file)
*/ and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
#ifndef TC_HEADER_Boot_BootStrings contained in the file License.txt included in VeraCrypt binary and source
#define TC_HEADER_Boot_BootStrings code distribution packages.
*/
#define TC_BOOT_STR_ERROR "Error: "
#define TC_BOOT_STR_NO_BOOT_PARTITION "No bootable partition found" #ifndef TC_HEADER_Boot_BootStrings
#define TC_BOOT_STR_UPGRADE_BIOS "- Upgrade BIOS\r\n- Use a different motherboard model/brand\r\n" #define TC_HEADER_Boot_BootStrings
#endif // TC_HEADER_Boot_BootStrings #define TC_BOOT_STR_ERROR "Error: "
#define TC_BOOT_STR_NO_BOOT_PARTITION "No bootable partition found"
#define TC_BOOT_STR_UPGRADE_BIOS "- Upgrade BIOS\r\n- Use a different motherboard model/brand\r\n"
#endif // TC_HEADER_Boot_BootStrings
+472 -436
View File
@@ -1,436 +1,472 @@
/* /*
puff.c puff.c
Copyright (C) 2002-2004 Mark Adler, all rights reserved Copyright (C) 2002-2004 Mark Adler, all rights reserved
version 1.8, 9 Jan 2004 version 1.8, 9 Jan 2004
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages warranty. In no event will the author be held liable for any damages
arising from the use of this software. arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions: freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not 1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be in a product, an acknowledgment in the product documentation would be
appreciated but is not required. appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be 2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software. misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Mark Adler madler@alumni.caltech.edu Mark Adler madler@alumni.caltech.edu
*/ */
/* Adapted for TrueCrypt */ /* Adapted for TrueCrypt */
/* Adapted for VeraCrypt */
#define local static /* for local function definitions */
#define NIL ((unsigned char *)0) /* for no output option */ #define local static /* for local function definitions */
#define NIL ((unsigned char *)0) /* for no output option */
/*
* Maximums for allocations and loops. It is not useful to change these -- /*
* they are fixed by the deflate format. * Maximums for allocations and loops. It is not useful to change these --
*/ * they are fixed by the deflate format.
#define MAXBITS 15 /* maximum bits in a code */ */
#define MAXLCODES 286 /* maximum number of literal/length codes */ #define MAXBITS 15 /* maximum bits in a code */
#define MAXDCODES 30 /* maximum number of distance codes */ #define MAXLCODES 286 /* maximum number of literal/length codes */
#define MAXCODES (MAXLCODES+MAXDCODES) /* maximum codes lengths to read */ #define MAXDCODES 30 /* maximum number of distance codes */
#define FIXLCODES 288 /* number of fixed literal/length codes */ #define MAXCODES (MAXLCODES+MAXDCODES) /* maximum codes lengths to read */
#define FIXLCODES 288 /* number of fixed literal/length codes */
/* input and output state */
struct state { /* input and output state */
/* output state */ struct state {
unsigned char *out; /* output buffer */ /* output state */
unsigned int outlen; /* available space at out */ unsigned char *out; /* output buffer */
unsigned int outcnt; /* bytes written to out so far */ unsigned int outlen; /* available space at out */
unsigned int outcnt; /* bytes written to out so far */
/* input state */
unsigned char *in; /* input buffer */ /* input state */
unsigned int incnt; /* bytes read so far */ unsigned char *in; /* input buffer */
int bitbuf; /* bit buffer */ unsigned int inlen; /* available input at in */
int bitcnt; /* number of bits in bit buffer */ unsigned int incnt; /* bytes read so far */
}; int bitbuf; /* bit buffer */
int bitcnt; /* number of bits in bit buffer */
};
local int bits(struct state *s, int need)
{
long val; /* bit accumulator (can use up to 20 bits) */ local int bits(struct state *s, int need)
{
/* load at least need bits into val */ long val; /* bit accumulator (can use up to 20 bits) */
val = s->bitbuf;
while (s->bitcnt < need) { /* load at least need bits into val */
val |= (long)(s->in[s->incnt++]) << s->bitcnt; /* load eight bits */ val = s->bitbuf;
s->bitcnt += 8; while (s->bitcnt < need) {
} val |= (long)(s->in[s->incnt++]) << s->bitcnt; /* load eight bits */
s->bitcnt += 8;
/* drop need bits and update buffer, always zero to seven bits left */ }
s->bitbuf = (int)(val >> need);
s->bitcnt -= need; /* drop need bits and update buffer, always zero to seven bits left */
s->bitbuf = (int)(val >> need);
/* return need bits, zeroing the bits above that */ s->bitcnt -= need;
return (int)(val & ((1L << need) - 1));
} /* return need bits, zeroing the bits above that */
return (int)(val & ((1L << need) - 1));
}
local int stored(struct state *s)
{
unsigned len; /* length of stored block */ local int stored(struct state *s)
{
/* discard leftover bits from current byte (assumes s->bitcnt < 8) */ unsigned len; /* length of stored block */
s->bitbuf = 0;
s->bitcnt = 0; /* discard leftover bits from current byte (assumes s->bitcnt < 8) */
s->bitbuf = 0;
/* get length and check against its one's complement */ s->bitcnt = 0;
len = s->in[s->incnt++];
len |= s->in[s->incnt++] << 8; if (s->incnt + 4 > s->inlen)
if (s->in[s->incnt++] != (~len & 0xff) || return 2; /* not enough input */
s->in[s->incnt++] != ((~len >> 8) & 0xff))
return -2; /* didn't match complement! */ /* get length and check against its one's complement */
len = s->in[s->incnt++];
/* copy len bytes from in to out */ len |= s->in[s->incnt++] << 8;
if (s->out != NIL) { if (s->in[s->incnt++] != (~len & 0xff) ||
if (s->outcnt + len > s->outlen) s->in[s->incnt++] != ((~len >> 8) & 0xff))
return 1; /* not enough output space */ return -2; /* didn't match complement! */
while (len--)
s->out[s->outcnt++] = s->in[s->incnt++]; if (s->incnt + len > s->inlen)
} return 2; /* not enough input */
else { /* just scanning */
s->outcnt += len; /* copy len bytes from in to out */
s->incnt += len; if (s->out != NIL) {
} if (s->outcnt + len > s->outlen)
return 1; /* not enough output space */
/* done with a valid stored block */ while (len--)
return 0; s->out[s->outcnt++] = s->in[s->incnt++];
} }
else { /* just scanning */
s->outcnt += len;
struct huffman { s->incnt += len;
short *count; /* number of symbols of each length */ }
short *symbol; /* canonically ordered symbols */
}; /* done with a valid stored block */
return 0;
}
#ifdef SLOW
local int decode(struct state *s, struct huffman *h)
{ struct huffman {
int len; /* current number of bits in code */ short *count; /* number of symbols of each length */
int code; /* len bits being decoded */ short *symbol; /* canonically ordered symbols */
int first; /* first code of length len */ };
int count; /* number of codes of length len */
int index; /* index of first code of length len in symbol table */ /* reduce code size by using slow version of the decompressor */
#define SLOW
code = first = index = 0;
for (len = 1; len <= MAXBITS; len++) { #ifdef SLOW
code |= bits(s, 1); /* get next bit */ local int decode(struct state *s, struct huffman *h)
count = h->count[len]; {
if (code < first + count) /* if length len, return symbol */ int len; /* current number of bits in code */
return h->symbol[index + (code - first)]; int code; /* len bits being decoded */
index += count; /* else update for next length */ int first; /* first code of length len */
first += count; int count; /* number of codes of length len */
first <<= 1; int index; /* index of first code of length len in symbol table */
code <<= 1;
} code = first = index = 0;
return -9; /* ran out of codes */ for (len = 1; len <= MAXBITS; len++) {
} code |= bits(s, 1); /* get next bit */
count = h->count[len];
/* if (code < first + count) /* if length len, return symbol */
* A faster version of decode() for real applications of this code. It's not return h->symbol[index + (code - first)];
* as readable, but it makes puff() twice as fast. And it only makes the code index += count; /* else update for next length */
* a few percent larger. first += count;
*/ first <<= 1;
#else /* !SLOW */ code <<= 1;
local int decode(struct state *s, struct huffman *h) }
{ return -9; /* ran out of codes */
int len; /* current number of bits in code */ }
int code; /* len bits being decoded */
int first; /* first code of length len */ /*
int count; /* number of codes of length len */ * A faster version of decode() for real applications of this code. It's not
int index; /* index of first code of length len in symbol table */ * as readable, but it makes puff() twice as fast. And it only makes the code
int bitbuf; /* bits from stream */ * a few percent larger.
int left; /* bits left in next or left to process */ */
short *next; /* next number of codes */ #else /* !SLOW */
local int decode(struct state *s, struct huffman *h)
bitbuf = s->bitbuf; {
left = s->bitcnt; int len; /* current number of bits in code */
code = first = index = 0; int code; /* len bits being decoded */
len = 1; int first; /* first code of length len */
next = h->count + 1; int count; /* number of codes of length len */
while (1) { int index; /* index of first code of length len in symbol table */
while (left--) { int bitbuf; /* bits from stream */
code |= bitbuf & 1; int left; /* bits left in next or left to process */
bitbuf >>= 1; short *next; /* next number of codes */
count = *next++;
if (code < first + count) { /* if length len, return symbol */ bitbuf = s->bitbuf;
s->bitbuf = bitbuf; left = s->bitcnt;
s->bitcnt = (s->bitcnt - len) & 7; code = first = index = 0;
return h->symbol[index + (code - first)]; len = 1;
} next = h->count + 1;
index += count; /* else update for next length */ while (1) {
first += count; while (left--) {
first <<= 1; code |= bitbuf & 1;
code <<= 1; bitbuf >>= 1;
len++; count = *next++;
} if (code < first + count) { /* if length len, return symbol */
left = (MAXBITS+1) - len; s->bitbuf = bitbuf;
if (left == 0) break; s->bitcnt = (s->bitcnt - len) & 7;
bitbuf = s->in[s->incnt++]; return h->symbol[index + (code - first)];
if (left > 8) left = 8; }
} index += count; /* else update for next length */
return -9; /* ran out of codes */ first += count;
} first <<= 1;
#endif /* SLOW */ code <<= 1;
len++;
}
local int construct(struct huffman *h, short *length, int n) left = (MAXBITS+1) - len;
{ if (left == 0) break;
int symbol; /* current symbol when stepping through length[] */ bitbuf = s->in[s->incnt++];
int len; /* current length when stepping through h->count[] */ if (left > 8) left = 8;
int left; /* number of possible codes left of current length */ }
short offs[MAXBITS+1]; /* offsets in symbol table for each length */ return -9; /* ran out of codes */
}
/* count number of codes of each length */ #endif /* SLOW */
for (len = 0; len <= MAXBITS; len++)
h->count[len] = 0;
for (symbol = 0; symbol < n; symbol++) local int construct(struct huffman *h, short *length, int n)
(h->count[length[symbol]])++; /* assumes lengths are within bounds */ {
if (h->count[0] == n) /* no codes! */ int symbol; /* current symbol when stepping through length[] */
return 0; /* complete, but decode() will fail */ int len; /* current length when stepping through h->count[] */
int left; /* number of possible codes left of current length */
/* check for an over-subscribed or incomplete set of lengths */ short offs[MAXBITS+1]; /* offsets in symbol table for each length */
left = 1; /* one possible code of zero length */
for (len = 1; len <= MAXBITS; len++) { /* count number of codes of each length */
left <<= 1; /* one more bit, double codes left */ for (len = 0; len <= MAXBITS; len++)
left -= h->count[len]; /* deduct count from possible codes */ h->count[len] = 0;
if (left < 0) return left; /* over-subscribed--return negative */ for (symbol = 0; symbol < n; symbol++)
} /* left > 0 means incomplete */ (h->count[length[symbol]])++; /* assumes lengths are within bounds */
if (h->count[0] == n) /* no codes! */
/* generate offsets into symbol table for each length for sorting */ return 0; /* complete, but decode() will fail */
offs[1] = 0;
for (len = 1; len < MAXBITS; len++) /* check for an over-subscribed or incomplete set of lengths */
offs[len + 1] = offs[len] + h->count[len]; left = 1; /* one possible code of zero length */
for (len = 1; len <= MAXBITS; len++) {
/* left <<= 1; /* one more bit, double codes left */
* put symbols in table sorted by length, by symbol order within each left -= h->count[len]; /* deduct count from possible codes */
* length if (left < 0) return left; /* over-subscribed--return negative */
*/ } /* left > 0 means incomplete */
for (symbol = 0; symbol < n; symbol++)
if (length[symbol] != 0) /* generate offsets into symbol table for each length for sorting */
h->symbol[offs[length[symbol]]++] = symbol; offs[1] = 0;
for (len = 1; len < MAXBITS; len++)
/* return zero for complete set, positive for incomplete set */ offs[len + 1] = offs[len] + h->count[len];
return left;
} /*
* put symbols in table sorted by length, by symbol order within each
* length
local int codes(struct state *s, */
struct huffman *lencode, for (symbol = 0; symbol < n; symbol++)
struct huffman *distcode) if (length[symbol] != 0)
{ h->symbol[offs[length[symbol]]++] = symbol;
int symbol; /* decoded symbol */
int len; /* length for copy */ /* return zero for complete set, positive for incomplete set */
unsigned dist; /* distance for copy */ return left;
static const short lens[29] = { /* Size base for length codes 257..285 */ }
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258};
static const short lext[29] = { /* Extra bits for length codes 257..285 */ local int codes(struct state *s,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, struct huffman *lencode,
3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0}; struct huffman *distcode)
static const short dists[30] = { /* Offset base for distance codes 0..29 */ {
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, int symbol; /* decoded symbol */
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, int len; /* length for copy */
8193, 12289, 16385, 24577}; unsigned dist; /* distance for copy */
static const short dext[30] = { /* Extra bits for distance codes 0..29 */ static const short lens[29] = { /* Size base for length codes 257..285 */
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258};
12, 12, 13, 13}; static const short lext[29] = { /* Extra bits for length codes 257..285 */
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
/* decode literals and length/distance pairs */ 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0};
do { static const short dists[30] = { /* Offset base for distance codes 0..29 */
symbol = decode(s, lencode); 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
if (symbol < 0) return symbol; /* invalid symbol */ 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
if (symbol < 256) { /* literal: symbol is the byte */ 8193, 12289, 16385, 24577};
/* write out the literal */ static const short dext[30] = { /* Extra bits for distance codes 0..29 */
if (s->out != NIL) { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
if (s->outcnt == s->outlen) return 1; 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
s->out[s->outcnt] = symbol; 12, 12, 13, 13};
}
s->outcnt++; /* decode literals and length/distance pairs */
} do {
else if (symbol > 256) { /* length */ symbol = decode(s, lencode);
/* get and compute length */ if (symbol < 0) return symbol; /* invalid symbol */
symbol -= 257; if (symbol < 256) { /* literal: symbol is the byte */
if (symbol >= 29) return -9; /* invalid fixed code */ /* write out the literal */
len = lens[symbol] + bits(s, lext[symbol]); if (s->out != NIL) {
if (s->outcnt == s->outlen) return 1;
/* get and check distance */ s->out[s->outcnt] = symbol;
symbol = decode(s, distcode); }
if (symbol < 0) return symbol; /* invalid symbol */ s->outcnt++;
dist = dists[symbol] + bits(s, dext[symbol]); }
if (dist > s->outcnt) else if (symbol > 256) { /* length */
return -10; /* distance too far back */ /* get and compute length */
symbol -= 257;
/* copy length bytes from distance bytes back */ if (symbol >= 29) return -9; /* invalid fixed code */
if (s->out != NIL) { len = lens[symbol] + bits(s, lext[symbol]);
if (s->outcnt + len > s->outlen) return 1;
while (len--) { /* get and check distance */
s->out[s->outcnt] = s->out[s->outcnt - dist]; symbol = decode(s, distcode);
s->outcnt++; if (symbol < 0) return symbol; /* invalid symbol */
} dist = dists[symbol] + bits(s, dext[symbol]);
} if (dist > s->outcnt)
else return -10; /* distance too far back */
s->outcnt += len;
} /* copy length bytes from distance bytes back */
} while (symbol != 256); /* end of block symbol */ if (s->out != NIL) {
if (s->outcnt + len > s->outlen) return 1;
/* done with a valid fixed or dynamic block */ while (len--) {
return 0; s->out[s->outcnt] = s->out[s->outcnt - dist];
} s->outcnt++;
}
}
local int fixed(struct state *s) else
{ s->outcnt += len;
static int virgin = 1; }
static short lencnt[MAXBITS+1], lensym[FIXLCODES]; } while (symbol != 256); /* end of block symbol */
static short distcnt[MAXBITS+1], distsym[MAXDCODES];
static struct huffman lencode = {lencnt, lensym}; /* done with a valid fixed or dynamic block */
static struct huffman distcode = {distcnt, distsym}; return 0;
}
/* build fixed huffman tables if first call (may not be thread safe) */
if (virgin) {
int symbol; local int fixed(struct state *s)
short lengths[FIXLCODES]; {
static int virgin = 1;
/* literal/length table */ static short lencnt[MAXBITS+1], lensym[FIXLCODES];
for (symbol = 0; symbol < 144; symbol++) static short distcnt[MAXBITS+1], distsym[MAXDCODES];
lengths[symbol] = 8; static struct huffman lencode = {lencnt, lensym};
for (; symbol < 256; symbol++) static struct huffman distcode = {distcnt, distsym};
lengths[symbol] = 9;
for (; symbol < 280; symbol++) /* build fixed huffman tables if first call (may not be thread safe) */
lengths[symbol] = 7; if (virgin) {
for (; symbol < FIXLCODES; symbol++) int symbol;
lengths[symbol] = 8; short lengths[FIXLCODES];
construct(&lencode, lengths, FIXLCODES);
/* literal/length table */
/* distance table */ for (symbol = 0; symbol < 144; symbol++)
for (symbol = 0; symbol < MAXDCODES; symbol++) lengths[symbol] = 8;
lengths[symbol] = 5; for (; symbol < 256; symbol++)
construct(&distcode, lengths, MAXDCODES); lengths[symbol] = 9;
for (; symbol < 280; symbol++)
/* do this just once */ lengths[symbol] = 7;
virgin = 0; for (; symbol < FIXLCODES; symbol++)
} lengths[symbol] = 8;
construct(&lencode, lengths, FIXLCODES);
/* decode data until end-of-block code */
return codes(s, &lencode, &distcode); /* distance table */
} for (symbol = 0; symbol < MAXDCODES; symbol++)
lengths[symbol] = 5;
construct(&distcode, lengths, MAXDCODES);
local int dynamic(struct state *s)
{ /* do this just once */
int nlen, ndist, ncode; /* number of lengths in descriptor */ virgin = 0;
int index; /* index of lengths[] */ }
int err; /* construct() return value */
short lengths[MAXCODES]; /* descriptor code lengths */ /* decode data until end-of-block code */
short lencnt[MAXBITS+1], lensym[MAXLCODES]; /* lencode memory */ return codes(s, &lencode, &distcode);
short distcnt[MAXBITS+1], distsym[MAXDCODES]; /* distcode memory */ }
struct huffman lencode = {lencnt, lensym}; /* length code */
struct huffman distcode = {distcnt, distsym}; /* distance code */
static const short order[19] = /* permutation of code length codes */ local int dynamic(struct state *s)
{16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; {
int nlen, ndist, ncode; /* number of lengths in descriptor */
/* get number of lengths in each table, check lengths */ int index; /* index of lengths[] */
nlen = bits(s, 5) + 257; int err; /* construct() return value */
ndist = bits(s, 5) + 1; short lengths[MAXCODES]; /* descriptor code lengths */
ncode = bits(s, 4) + 4; short lencnt[MAXBITS+1], lensym[MAXLCODES]; /* lencode memory */
if (nlen > MAXLCODES || ndist > MAXDCODES) short distcnt[MAXBITS+1], distsym[MAXDCODES]; /* distcode memory */
return -3; /* bad counts */ struct huffman lencode = {lencnt, lensym}; /* length code */
struct huffman distcode = {distcnt, distsym}; /* distance code */
/* read code length code lengths (really), missing lengths are zero */ static const short order[19] = /* permutation of code length codes */
for (index = 0; index < ncode; index++) {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
lengths[order[index]] = bits(s, 3);
for (; index < 19; index++) /* get number of lengths in each table, check lengths */
lengths[order[index]] = 0; nlen = bits(s, 5) + 257;
ndist = bits(s, 5) + 1;
/* build huffman table for code lengths codes (use lencode temporarily) */ ncode = bits(s, 4) + 4;
err = construct(&lencode, lengths, 19); if (nlen > MAXLCODES || ndist > MAXDCODES)
if (err != 0) return -4; /* require complete code set here */ return -3; /* bad counts */
/* read length/literal and distance code length tables */ /* read code length code lengths (really), missing lengths are zero */
index = 0; for (index = 0; index < ncode; index++)
while (index < nlen + ndist) { lengths[order[index]] = bits(s, 3);
int symbol; /* decoded value */ for (; index < 19; index++)
int len; /* last length to repeat */ lengths[order[index]] = 0;
symbol = decode(s, &lencode); /* build huffman table for code lengths codes (use lencode temporarily) */
if (symbol < 16) /* length in 0..15 */ err = construct(&lencode, lengths, 19);
lengths[index++] = symbol; if (err != 0) return -4; /* require complete code set here */
else { /* repeat instruction */
len = 0; /* assume repeating zeros */ /* read length/literal and distance code length tables */
if (symbol == 16) { /* repeat last length 3..6 times */ index = 0;
if (index == 0) return -5; /* no last length! */ while (index < nlen + ndist) {
len = lengths[index - 1]; /* last length */ int symbol; /* decoded value */
symbol = 3 + bits(s, 2); int len; /* last length to repeat */
}
else if (symbol == 17) /* repeat zero 3..10 times */ symbol = decode(s, &lencode);
symbol = 3 + bits(s, 3); if (symbol < 0)
else /* == 18, repeat zero 11..138 times */ return symbol; /* invalid symbol */
symbol = 11 + bits(s, 7); if (symbol < 16) /* length in 0..15 */
if (index + symbol > nlen + ndist) lengths[index++] = symbol;
return -6; /* too many lengths! */ else { /* repeat instruction */
while (symbol--) /* repeat last or zero symbol times */ len = 0; /* assume repeating zeros */
lengths[index++] = len; switch(symbol)
} {
} case 16: { /* repeat last length 3..6 times */
if (index == 0) return -5; /* no last length! */
/* build huffman table for literal/length codes */ len = lengths[index - 1]; /* last length */
err = construct(&lencode, lengths, nlen); symbol = 3 + bits(s, 2);
if (err < 0 || (err > 0 && nlen - lencode.count[0] != 1)) break;
return -7; /* only allow incomplete codes if just one code */ }
case 17: /* repeat zero 3..10 times */
/* build huffman table for distance codes */ symbol = 3 + bits(s, 3);
err = construct(&distcode, lengths + nlen, ndist); break;
if (err < 0 || (err > 0 && ndist - distcode.count[0] != 1)) default: /* == 18, repeat zero 11..138 times */
return -8; /* only allow incomplete codes if just one code */ symbol = 11 + bits(s, 7);
break;
/* decode data until end-of-block code */ }
return codes(s, &lencode, &distcode); if ((index + symbol > nlen + ndist))
} return -6; /* too many lengths! */
while (symbol--) /* repeat last or zero symbol times */
lengths[index++] = len;
void _acrtused () { } }
}
// Decompress deflated data
int far main ( /* check for end-of-block code -- there better be one! */
unsigned char *dest, /* pointer to destination pointer */ if (lengths[256] == 0)
unsigned int destlen, /* amount of output space */ return -9;
unsigned char *source) /* pointer to source data pointer */
{ /* build huffman table for literal/length codes */
struct state s; /* input/output state */ err = construct(&lencode, lengths, nlen);
int last, type; /* block information */ if (err < 0 || (err > 0 && nlen - lencode.count[0] != 1))
int err; /* return value */ return -7; /* only allow incomplete codes if just one code */
/* initialize output state */ /* build huffman table for distance codes */
s.out = dest; err = construct(&distcode, lengths + nlen, ndist);
s.outlen = destlen; /* ignored if dest is NIL */ if (err < 0 || (err > 0 && ndist - distcode.count[0] != 1))
s.outcnt = 0; return -8; /* only allow incomplete codes if just one code */
/* initialize input state */ /* decode data until end-of-block code */
s.in = source; return codes(s, &lencode, &distcode);
s.incnt = 0; }
s.bitbuf = 0;
s.bitcnt = 0;
void _acrtused () { }
/* process blocks until last block or error */
do { // Decompress deflated data
last = bits(&s, 1); /* one if last block */ int far main (
type = bits(&s, 2); /* block type 0..3 */ unsigned char *dest, /* pointer to destination pointer */
err = type == 0 ? stored(&s) : unsigned int destlen, /* amount of output space */
(type == 1 ? fixed(&s) : unsigned char *source, /* pointer to source data pointer */
(type == 2 ? dynamic(&s) : unsigned int sourcelen)
-1)); /* type == 3, invalid */ {
if (err != 0) break; /* return with error */ struct state s; /* input/output state */
} while (!last); int last, type; /* block information */
int err; /* return value */
return err;
} /* initialize output state */
s.out = dest;
s.outlen = destlen; /* ignored if dest is NIL */
s.outcnt = 0;
/* initialize input state */
s.in = source;
s.inlen = sourcelen;
s.incnt = 0;
s.bitbuf = 0;
s.bitcnt = 0;
/* process blocks until last block or error */
do {
last = bits(&s, 1); /* one if last block */
type = bits(&s, 2); /* block type 0..3 */
switch(type)
{
case 0:
err = stored(&s);
break;
case 1:
err = fixed(&s);
break;
case 2:
err = dynamic(&s);
break;
default:
err = -1; /* type == 3, invalid */
break;
}
if (err != 0) break; /* return with error */
} while (!last);
return err;
}

Some files were not shown because too many files have changed in this diff Show More