From 11716ed2dacbb104f8f59867fe66f2c0a6984291 Mon Sep 17 00:00:00 2001 From: David Foerster Date: Tue, 10 May 2016 22:16:32 +0200 Subject: Remove trailing whitespace --- src/Boot/Windows/Bios.h | 2 +- src/Boot/Windows/BootCommon.h | 2 +- src/Boot/Windows/BootConfig.cpp | 2 +- src/Boot/Windows/BootConfig.h | 2 +- src/Boot/Windows/BootConsoleIo.cpp | 8 +++--- src/Boot/Windows/BootConsoleIo.h | 2 +- src/Boot/Windows/BootCrt.asm | 2 +- src/Boot/Windows/BootDebug.cpp | 6 ++-- src/Boot/Windows/BootDebug.h | 2 +- src/Boot/Windows/BootDefs.h | 6 ++-- src/Boot/Windows/BootDiskIo.cpp | 12 ++++---- src/Boot/Windows/BootDiskIo.h | 2 +- src/Boot/Windows/BootEncryptedIo.cpp | 2 +- src/Boot/Windows/BootEncryptedIo.h | 2 +- src/Boot/Windows/BootMain.cpp | 22 +++++++------- src/Boot/Windows/BootMain.h | 2 +- src/Boot/Windows/BootMemory.cpp | 4 +-- src/Boot/Windows/BootMemory.h | 2 +- src/Boot/Windows/BootSector.asm | 56 ++++++++++++++++++------------------ src/Boot/Windows/BootStrings.h | 2 +- src/Boot/Windows/IntFilter.cpp | 18 ++++++------ src/Boot/Windows/IntFilter.h | 2 +- src/Boot/Windows/Makefile | 14 ++++----- src/Boot/Windows/Platform.cpp | 14 ++++----- src/Boot/Windows/Platform.h | 4 +-- 25 files changed, 96 insertions(+), 96 deletions(-) (limited to 'src/Boot') diff --git a/src/Boot/Windows/Bios.h b/src/Boot/Windows/Bios.h index dd2da6be..e6f9ec89 100644 --- a/src/Boot/Windows/Bios.h +++ b/src/Boot/Windows/Bios.h @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source diff --git a/src/Boot/Windows/BootCommon.h b/src/Boot/Windows/BootCommon.h index 1dc86560..0d4f710d 100644 --- a/src/Boot/Windows/BootCommon.h +++ b/src/Boot/Windows/BootCommon.h @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source diff --git a/src/Boot/Windows/BootConfig.cpp b/src/Boot/Windows/BootConfig.cpp index 75baf19e..3e41d610 100644 --- a/src/Boot/Windows/BootConfig.cpp +++ b/src/Boot/Windows/BootConfig.cpp @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source diff --git a/src/Boot/Windows/BootConfig.h b/src/Boot/Windows/BootConfig.h index 0a06a987..428d713c 100644 --- a/src/Boot/Windows/BootConfig.h +++ b/src/Boot/Windows/BootConfig.h @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source diff --git a/src/Boot/Windows/BootConsoleIo.cpp b/src/Boot/Windows/BootConsoleIo.cpp index 8b5a1905..2fee84fc 100644 --- a/src/Boot/Windows/BootConsoleIo.cpp +++ b/src/Boot/Windows/BootConsoleIo.cpp @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source @@ -84,7 +84,7 @@ void Print (uint32 number) number /= 10; } str[pos] = (char) (number % 10) + '0'; - + while (pos >= 0) PrintChar (str[pos--]); } @@ -251,7 +251,7 @@ byte GetKeyboardChar (byte *scanCode) mov asciiCode, al mov scan, ah } - + if (scanCode) *scanCode = scan; @@ -327,7 +327,7 @@ int GetString (char *buffer, size_t bufferSize) if (scanCode == TC_BIOS_KEY_ENTER) break; - + if (scanCode == TC_BIOS_KEY_ESC) return 0; diff --git a/src/Boot/Windows/BootConsoleIo.h b/src/Boot/Windows/BootConsoleIo.h index b95036d5..52a054fe 100644 --- a/src/Boot/Windows/BootConsoleIo.h +++ b/src/Boot/Windows/BootConsoleIo.h @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source diff --git a/src/Boot/Windows/BootCrt.asm b/src/Boot/Windows/BootCrt.asm index fd2c2ef0..92ac1563 100644 --- a/src/Boot/Windows/BootCrt.asm +++ b/src/Boot/Windows/BootCrt.asm @@ -3,7 +3,7 @@ ; Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed ; by the TrueCrypt License 3.0. ; -; Modifications and additions to the original source code (contained in this file) +; 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 ; contained in the file License.txt included in VeraCrypt binary and source diff --git a/src/Boot/Windows/BootDebug.cpp b/src/Boot/Windows/BootDebug.cpp index 2c796437..dd0863a0 100644 --- a/src/Boot/Windows/BootDebug.cpp +++ b/src/Boot/Windows/BootDebug.cpp @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source @@ -61,12 +61,12 @@ void PrintVal (const char *message, const uint32 value, bool newLine, bool hex) { Print (message); Print (": "); - + if (hex) PrintHex (value); else Print (value); - + if (newLine) PrintEndl(); } diff --git a/src/Boot/Windows/BootDebug.h b/src/Boot/Windows/BootDebug.h index a10c7fec..e7ae4134 100644 --- a/src/Boot/Windows/BootDebug.h +++ b/src/Boot/Windows/BootDebug.h @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source diff --git a/src/Boot/Windows/BootDefs.h b/src/Boot/Windows/BootDefs.h index 2e69d5a3..1fc923ae 100644 --- a/src/Boot/Windows/BootDefs.h +++ b/src/Boot/Windows/BootDefs.h @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source @@ -42,9 +42,9 @@ #define TC__BOOT_LOADER_SEGMENT TC_HEX (9000) // Some buggy BIOS routines fail if CS bits 0-10 are not zero #if TC__BOOT_MEMORY_REQUIRED <= 32 -# define TC__BOOT_LOADER_SEGMENT_LOW (TC__BOOT_LOADER_SEGMENT - 32 * 1024 / 16) +# define TC__BOOT_LOADER_SEGMENT_LOW (TC__BOOT_LOADER_SEGMENT - 32 * 1024 / 16) #else -# define TC__BOOT_LOADER_SEGMENT_LOW (TC__BOOT_LOADER_SEGMENT - 64 * 1024 / 16) +# define TC__BOOT_LOADER_SEGMENT_LOW (TC__BOOT_LOADER_SEGMENT - 64 * 1024 / 16) #endif #define TC__COM_EXECUTABLE_OFFSET TC_HEX (100) diff --git a/src/Boot/Windows/BootDiskIo.cpp b/src/Boot/Windows/BootDiskIo.cpp index bf3fe9fc..15d6f711 100644 --- a/src/Boot/Windows/BootDiskIo.cpp +++ b/src/Boot/Windows/BootDiskIo.cpp @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source @@ -201,7 +201,7 @@ static BiosResult ReadWriteSectors (bool write, BiosLbaPacket &dapPacket, byte d dapPacket.Sector = sector; byte function = write ? 0x43 : 0x42; - + BiosResult result; byte tryCount = TC_MAX_BIOS_DISK_IO_RETRIES; @@ -261,7 +261,7 @@ BiosResult ReadSectors (byte *buffer, byte drive, const uint64 §or, uint16 s BiosResult result; uint16 codeSeg; __asm mov codeSeg, cs - + result = ReadSectors (BootStarted ? codeSeg : TC_BOOT_LOADER_ALT_SEGMENT, (uint16) buffer, drive, sector, sectorCount, silent); // Alternative segment is used to prevent memory corruption caused by buggy BIOSes @@ -389,13 +389,13 @@ BiosResult GetDrivePartitions (byte drive, Partition *partitionArray, size_t par PartitionEntryMBR mbrPartitions[4]; memcpy (mbrPartitions, mbr->Partitions, sizeof (mbrPartitions)); size_t partitionArrayPos = 0, partitionNumber; - + for (partitionNumber = 0; partitionNumber < array_capacity (mbrPartitions) && partitionArrayPos < partitionArrayCapacity; ++partitionNumber) { const PartitionEntryMBR &partEntry = mbrPartitions[partitionNumber]; - + if (partEntry.SectorCountLBA > 0) { Partition &partition = partitionArray[partitionArrayPos]; @@ -486,6 +486,6 @@ bool GetActivePartition (byte drive) PrintError (TC_BOOT_STR_NO_BOOT_PARTITION); return false; } - + return true; } diff --git a/src/Boot/Windows/BootDiskIo.h b/src/Boot/Windows/BootDiskIo.h index b09220a8..ad9d1437 100644 --- a/src/Boot/Windows/BootDiskIo.h +++ b/src/Boot/Windows/BootDiskIo.h @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source diff --git a/src/Boot/Windows/BootEncryptedIo.cpp b/src/Boot/Windows/BootEncryptedIo.cpp index 84a4bf14..63fd0f47 100644 --- a/src/Boot/Windows/BootEncryptedIo.cpp +++ b/src/Boot/Windows/BootEncryptedIo.cpp @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source diff --git a/src/Boot/Windows/BootEncryptedIo.h b/src/Boot/Windows/BootEncryptedIo.h index 6402e705..d27ec9ea 100644 --- a/src/Boot/Windows/BootEncryptedIo.h +++ b/src/Boot/Windows/BootEncryptedIo.h @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source diff --git a/src/Boot/Windows/BootMain.cpp b/src/Boot/Windows/BootMain.cpp index 24acd23f..57697a4f 100644 --- a/src/Boot/Windows/BootMain.cpp +++ b/src/Boot/Windows/BootMain.cpp @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source @@ -72,7 +72,7 @@ static void PrintMainMenu () Print ((BootSectorFlags & TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE) != TC_HIDDEN_OS_CREATION_PHASE_NONE ? "Boot Non-Hidden System (Boot Manager)" : "Skip Authentication (Boot Manager)"); - + #else // TC_WINDOWS_BOOT_RESCUE_DISK_MODE Print ("Skip Authentication (Boot Manager)"); @@ -184,7 +184,7 @@ static byte AskPassword (Password &password, int& pim) ClearBiosKeystrokeBuffer(); PrintEndl(); - + break; case TC_BIOS_KEY_BACKSPACE: @@ -262,7 +262,7 @@ static byte AskPassword (Password &password, int& pim) ClearBiosKeystrokeBuffer(); PrintEndl(); - + return TC_BIOS_KEY_ENTER; case TC_BIOS_KEY_BACKSPACE: @@ -301,7 +301,7 @@ static byte AskPassword (Password &password, int& pim) pim = 10*pim + (asciiCode - '0'); pos++; - + if (hidePassword) asciiCode = '*'; if (pos < MAX_PIM) PrintChar (asciiCode); @@ -343,7 +343,7 @@ static bool OpenVolume (byte drive, Password &password, int pim, CRYPTO_INFO **c int volumeType; bool hiddenVolume; uint64 headerSec; - + AcquireSectorBuffer(); for (volumeType = 1; volumeType <= 2; ++volumeType) @@ -479,7 +479,7 @@ static bool MountVolume (byte drive, byte &exitKey, bool skipNormal, bool skipHi EncryptedVirtualPartition.Drive = BootDrive; EncryptedVirtualPartition.StartSector = BootCryptoInfo->EncryptedAreaStart >> TC_LB_SIZE_BIT_SHIFT_DIVISOR; - + PimValueOrHiddenVolumeStartUnitNo = EncryptedVirtualPartition.StartSector; HiddenVolumeStartSector = PartitionFollowingActive.StartSector; HiddenVolumeStartSector += EncryptedVirtualPartition.StartSector; @@ -535,7 +535,7 @@ static byte BootEncryptedDrive () if (!MountVolume (BootDrive, exitKey, PreventNormalSystemBoot, false)) return exitKey; - + if (!CheckMemoryRequirements ()) goto err; @@ -765,7 +765,7 @@ static bool CopySystemPartitionToHiddenVolume (byte drive, byte &exitKey) EncryptDataUnits (SectorBuffer, &s, 1, BootCryptoInfo); CopyMemory (SectorBuffer, TC_BOOT_LOADER_BUFFER_SEGMENT, i * TC_LB_SIZE, TC_LB_SIZE); - } + } ReleaseSectorBuffer(); @@ -875,7 +875,7 @@ static void DecryptDrive (byte drive) DecryptDataUnits (SectorBuffer, &s, 1, BootCryptoInfo); CopyMemory (SectorBuffer, TC_BOOT_LOADER_BUFFER_SEGMENT, i * TC_LB_SIZE, TC_LB_SIZE); - } + } ReleaseSectorBuffer(); @@ -1250,7 +1250,7 @@ void main () exitKey = BootEncryptedDrive(); #else // TC_WINDOWS_BOOT_RESCUE_DISK_MODE - + PrintMainMenu(); exitKey = BootEncryptedDrive(); diff --git a/src/Boot/Windows/BootMain.h b/src/Boot/Windows/BootMain.h index 2f212a18..0f89179a 100644 --- a/src/Boot/Windows/BootMain.h +++ b/src/Boot/Windows/BootMain.h @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source diff --git a/src/Boot/Windows/BootMemory.cpp b/src/Boot/Windows/BootMemory.cpp index 505b731a..5729142f 100644 --- a/src/Boot/Windows/BootMemory.cpp +++ b/src/Boot/Windows/BootMemory.cpp @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source @@ -44,7 +44,7 @@ static bool GetMemoryMapEntry (BiosMemoryMapEntry &entry) push TC_BOOT_LOADER_ALT_SEGMENT pop es mov di, 0 - + int 0x15 jnc no_carry mov carry, true diff --git a/src/Boot/Windows/BootMemory.h b/src/Boot/Windows/BootMemory.h index d4ad1561..d08e88ac 100644 --- a/src/Boot/Windows/BootMemory.h +++ b/src/Boot/Windows/BootMemory.h @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source diff --git a/src/Boot/Windows/BootSector.asm b/src/Boot/Windows/BootSector.asm index 0518414f..833ff616 100644 --- a/src/Boot/Windows/BootSector.asm +++ b/src/Boot/Windows/BootSector.asm @@ -3,7 +3,7 @@ ; Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed ; by the TrueCrypt License 3.0. ; -; Modifications and additions to the original source code (contained in this file) +; 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 ; contained in the file License.txt included in VeraCrypt binary and source @@ -26,9 +26,9 @@ start: loader_name_msg: db ' VeraCrypt Boot Loader', 13, 10, 0 - + main: - cli + cli xor ax, ax mov ds, ax mov ss, ax @@ -49,12 +49,12 @@ skip_loader_name_msg: ; Check available memory cmp word ptr [ds:413h], TC_BOOT_LOADER_SEGMENT / 1024 * 16 + TC_BOOT_MEMORY_REQUIRED jge memory_ok - + mov ax, TC_BOOT_LOADER_SEGMENT_LOW - + cmp word ptr [ds:413h], TC_BOOT_LOADER_SEGMENT_LOW / 1024 * 16 + TC_BOOT_MEMORY_REQUIRED jge memory_ok - + ; Insufficient memory mov ax, TC_BOOT_LOADER_LOWMEM_SEGMENT @@ -67,11 +67,11 @@ memory_ok: mov cx, TC_BOOT_MEMORY_REQUIRED * 1024 - TC_COM_EXECUTABLE_OFFSET - 1 cld rep stosb - + mov ax, es sub ax, TC_BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE / 16 ; Decompressor segment mov es, ax - + ; Load decompressor mov cl, TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR retry_backup: @@ -85,17 +85,17 @@ retry_backup: mov cx, TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT * TC_LB_SIZE call checksum push ebx - + ; Load compressed boot loader mov bx, TC_BOOT_LOADER_COMPRESSED_BUFFER_OFFSET mov cl, TC_BOOT_LOADER_START_SECTOR mov al, TC_MAX_BOOT_LOADER_SECTOR_COUNT - + test backup_loader_used, 1 jz non_backup 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 - + non_backup: call read_sectors @@ -104,21 +104,21 @@ non_backup: mov si, TC_BOOT_LOADER_COMPRESSED_BUFFER_OFFSET mov cx, word ptr [start + TC_BOOT_SECTOR_LOADER_LENGTH_OFFSET] call checksum - + ; Verify checksum - cmp ebx, dword ptr [start + TC_BOOT_SECTOR_LOADER_CHECKSUM_OFFSET] + cmp ebx, dword ptr [start + TC_BOOT_SECTOR_LOADER_CHECKSUM_OFFSET] je checksum_ok ; Checksum incorrect - try using backup if available test backup_loader_used, 1 jnz loader_damaged - + mov backup_loader_used, 1 mov cl, TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR + TC_BOOT_LOADER_BACKUP_SECTOR_COUNT - + test TC_BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE, byte ptr [start + TC_BOOT_SECTOR_CONFIG_OFFSET] jnz retry_backup - + loader_damaged: lea si, loader_damaged_msg call print @@ -134,9 +134,9 @@ checksum_ok: mov ss, ax mov sp, TC_BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE sti - + push dx - + ; Decompress boot loader mov cx, word ptr [start + TC_BOOT_SECTOR_LOADER_LENGTH_OFFSET] sub cx, TC_GZIP_HEADER_SIZE @@ -154,7 +154,7 @@ decompressor_ret: add sp, 8 pop dx - + ; Restore boot sector segment push cs pop ds @@ -170,7 +170,7 @@ decompression_ok: ; DH = boot sector flags mov dh, byte ptr [start + TC_BOOT_SECTOR_CONFIG_OFFSET] - + ; Set up boot loader segment mov ax, es add ax, TC_BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE / 16 @@ -185,17 +185,17 @@ decompression_ok: push es push TC_COM_EXECUTABLE_OFFSET retf - + ; Print string print: xor bx, bx mov ah, 0eh cld - + @@: lodsb test al, al jz print_end - + int 10h jmp @B @@ -210,12 +210,12 @@ read_sectors: mov ah, 2 int 13h jnc read_ok - + lea si, disk_error_msg call print read_ok: ret - + ; Calculate checksum checksum: push ds @@ -223,17 +223,17 @@ checksum: pop ds xor eax, eax cld - + @@: lodsb add ebx, eax rol ebx, 1 loop @B - + pop ds ret backup_loader_used db 0 - + disk_error_msg db 'Disk error', 13, 10, 7, 0 loader_damaged_msg db 7, 'Loader damaged! Repair with Rescue Disk', 0 diff --git a/src/Boot/Windows/BootStrings.h b/src/Boot/Windows/BootStrings.h index 99c4dc4f..6c5d7847 100644 --- a/src/Boot/Windows/BootStrings.h +++ b/src/Boot/Windows/BootStrings.h @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source diff --git a/src/Boot/Windows/IntFilter.cpp b/src/Boot/Windows/IntFilter.cpp index d9cd92df..4a39fd14 100644 --- a/src/Boot/Windows/IntFilter.cpp +++ b/src/Boot/Windows/IntFilter.cpp @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source @@ -98,7 +98,7 @@ bool Int13Filter () if (ReEntryCount == 0 && drive == EncryptedVirtualPartition.Drive) { BiosResult result; - + if (function == 0x3) result = WriteEncryptedSectors (regs.ES, regs.BX, drive, sector, sectorCount); else @@ -126,7 +126,7 @@ bool Int13Filter () case 0x43: // Write sectors LBA { byte drive = (byte) regs.DX; - + BiosLbaPacket lba; CopyMemory (regs.DS, regs.SI, (byte *) &lba, sizeof (lba)); @@ -141,7 +141,7 @@ bool Int13Filter () if (ReEntryCount == 0 && drive == EncryptedVirtualPartition.Drive) { BiosResult result; - + uint16 segment = (uint16) (lba.Buffer >> 16); uint16 offset = (uint16) lba.Buffer; @@ -524,7 +524,7 @@ void IntFilterEntry () popf leave add sp, 2 - jmp cs:OriginalInt13Handler + jmp cs:OriginalInt13Handler pass15: popad @@ -554,7 +554,7 @@ static void Int15FilterEntry () pushf cmp ax, 0xe820 // Get system memory map je filter - + popf leave jmp cs:OriginalInt15Handler @@ -600,7 +600,7 @@ bool InstallInterruptFilters () // Save original INT 13 handler xor ax, ax mov es, ax - + mov si, 0x13 * 4 lea di, OriginalInt13Handler @@ -608,14 +608,14 @@ bool InstallInterruptFilters () mov [di], ax mov ax, es:[si + 2] mov [di + 2], ax - + // Install INT 13 filter lea ax, Int13FilterEntry mov es:[si], ax mov es:[si + 2], cs // Save original INT 15 handler - mov si, 0x15 * 4 + mov si, 0x15 * 4 lea di, OriginalInt15Handler mov ax, es:[si] diff --git a/src/Boot/Windows/IntFilter.h b/src/Boot/Windows/IntFilter.h index 1ef42512..3f3a486a 100644 --- a/src/Boot/Windows/IntFilter.h +++ b/src/Boot/Windows/IntFilter.h @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source diff --git a/src/Boot/Windows/Makefile b/src/Boot/Windows/Makefile index 65e668cb..8377520b 100644 --- a/src/Boot/Windows/Makefile +++ b/src/Boot/Windows/Makefile @@ -3,7 +3,7 @@ # Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed # by the TrueCrypt License 3.0. # -# Modifications and additions to the original source code (contained in this file) +# 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 # contained in the file License.txt included in VeraCrypt binary and source @@ -111,7 +111,7 @@ env: set INCLUDE=. set LIB=. set LIBPATH=. - + clean: -del /q /s $(OBJDIR) >NUL: @@ -133,7 +133,7 @@ clean: $(CC) $(CFLAGS) /c "$(SRCDIR)\$<" set PATH=$(ENVPATH) cd .. - + {..\..\Common}.c{$(OUTDIR)}.obj: cd $(OBJDIR) set PATH=. @@ -147,7 +147,7 @@ clean: $(CC) $(CFLAGS) /c "$(SRCDIR)\$<" set PATH=$(ENVPATH) cd .. - + .cpp{$(OUTDIR)}.obj: cd $(OBJDIR) set PATH=. @@ -161,7 +161,7 @@ $(OUTDIR)\BootDefs.i: BootDefs.h $(CC) $(CFLAGS) /D TC_ASM_PREPROCESS /P /EP "$(SRCDIR)\BootDefs.h" set PATH=$(ENVPATH) cd .. - + $(OUTDIR)\BootSector.bin: $(OUTDIR)\BootSector.obj cd $(OBJDIR) $(LD) $(LFLAGS) BootSector.obj,BootSector.bin,,,, >NUL: @@ -177,7 +177,7 @@ $(OUTDIR)\Decompressor.com: $(OUTDIR)\BootCrt.obj $(OUTDIR)\Decompressor.obj $(OUTDIR)\$(PROJ).$(TARGETEXT): $(OBJS) @echo Linking... cd $(OBJDIR) - + echo >NUL: @<<$(PROJ).crf2 $(PROJ).$(TARGETEXT) @@ -189,7 +189,7 @@ $(LIBS) del $(PROJ).crf >NUL: 2>NUL: for %F in ($(**F)) do @echo %F + >>$(PROJ).crf type $(PROJ).crf2 >>$(PROJ).crf - + $(LD) $(LFLAGS) @$(PROJ).crf del $(PROJ).crf $(PROJ).crf2 diff --git a/src/Boot/Windows/Platform.cpp b/src/Boot/Windows/Platform.cpp index 316e71b3..0a45bba6 100644 --- a/src/Boot/Windows/Platform.cpp +++ b/src/Boot/Windows/Platform.cpp @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source @@ -83,7 +83,7 @@ uint64 operator>> (const uint64 &a, int shiftCount) while (shiftCount--) { r.LowPart >>= 1; - + if ((byte) r.HighPart & 1) r.LowPart |= 0x80000000UL; @@ -96,7 +96,7 @@ uint64 operator>> (const uint64 &a, int shiftCount) uint64 operator<< (const uint64 &a, int shiftCount) { uint64 r = a; - + while (shiftCount--) r += r; @@ -148,9 +148,9 @@ bool TestInt64 () a += b; a -= b; - + ++a; - + b = b + (uint32) 1UL; c = (a - ((a + b) >> 32) - (uint32) 1UL); @@ -214,11 +214,11 @@ bool RegionsIntersect (const uint64 &start1, uint32 length1, const uint64 &start { uint64 end1 = start1 + length1 - 1UL; uint64 intersectEnd = (end1 <= end2) ? end1 : end2; - + uint64 intersectStart = (start1 >= start2) ? start1 : start2; if (intersectStart > intersectEnd) return false; - + return (intersectEnd + 1UL - intersectStart).LowPart != 0; } diff --git a/src/Boot/Windows/Platform.h b/src/Boot/Windows/Platform.h index 879b1c39..a8e83bec 100644 --- a/src/Boot/Windows/Platform.h +++ b/src/Boot/Windows/Platform.h @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + 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 contained in the file License.txt included in VeraCrypt binary and source @@ -37,7 +37,7 @@ typedef UINT64_STRUCT uint64; #define TC_ASM_EMIT(A,B) __asm _emit 0x##A __asm _emit 0x##B #define TC_ASM_EMIT3(A,B,C) __asm _emit 0x##A __asm _emit 0x##B __asm _emit 0x##C -#define TC_ASM_EMIT4(A,B,C,D) __asm _emit 0x##A __asm _emit 0x##B __asm _emit 0x##C __asm _emit 0x##D +#define TC_ASM_EMIT4(A,B,C,D) __asm _emit 0x##A __asm _emit 0x##B __asm _emit 0x##C __asm _emit 0x##D #define TC_ASM_MOV_EAX_DI TC_ASM_EMIT3 (66, 8B, 05) #define TC_ASM_MOV_EBX_DI TC_ASM_EMIT3 (66, 8B, 1D) -- cgit v1.2.3