|
|
1.1 root 1: /* 1.1.1.7 root 2: Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved. 1.1 root 3: 1.1.1.8 ! root 4: Governed by the TrueCrypt License 3.0 the full text of which is contained in 1.1.1.7 root 5: the file License.txt included in TrueCrypt binary and source code distribution 6: packages. 1.1 root 7: */ 8: 9: #include "BootConfig.h" 10: 11: byte BootSectorFlags; 12: 13: byte BootLoaderDrive; 14: byte BootDrive; 15: bool BootDriveGeometryValid = false; 1.1.1.3 root 16: bool PreventNormalSystemBoot = false; 17: bool PreventBootMenu = false; 18: char CustomUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH + 1]; 1.1.1.4 root 19: uint32 OuterVolumeBackupHeaderCrc; 1.1.1.3 root 20: 21: bool BootStarted = false; 1.1.1.2 root 22: 1.1 root 23: DriveGeometry BootDriveGeometry; 24: 25: CRYPTO_INFO *BootCryptoInfo; 26: Partition EncryptedVirtualPartition; 1.1.1.2 root 27: 28: Partition ActivePartition; 29: Partition PartitionFollowingActive; 1.1.1.6 root 30: bool ExtraBootPartitionPresent = false; 1.1.1.2 root 31: uint64 HiddenVolumeStartUnitNo; 32: uint64 HiddenVolumeStartSector; 33: 1.1.1.3 root 34: #ifndef TC_WINDOWS_BOOT_RESCUE_DISK_MODE 35: 36: void ReadBootSectorUserConfiguration () 37: { 38: byte userConfig; 39: 40: AcquireSectorBuffer(); 41: 42: if (ReadWriteMBR (false, BootLoaderDrive, true) != BiosResultSuccess) 43: goto ret; 44: 45: userConfig = SectorBuffer[TC_BOOT_SECTOR_USER_CONFIG_OFFSET]; 1.1.1.8 ! root 46: ! 47: #ifdef TC_WINDOWS_BOOT_AES ! 48: EnableHwEncryption (!(userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION)); ! 49: #endif ! 50: 1.1.1.3 root 51: PreventBootMenu = (userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_ESC); 52: 53: memcpy (CustomUserMessage, SectorBuffer + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET, TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH); 54: CustomUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH] = 0; 55: 56: if (userConfig & TC_BOOT_USER_CFG_FLAG_SILENT_MODE) 57: { 58: if (CustomUserMessage[0]) 59: Print (CustomUserMessage); 60: 61: DisableScreenOutput(); 62: } 1.1.1.8 ! root 63: 1.1.1.4 root 64: OuterVolumeBackupHeaderCrc = *(uint32 *) (SectorBuffer + TC_BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET); 1.1.1.3 root 65: 66: ret: 67: ReleaseSectorBuffer(); 68: } 69: 70: 1.1.1.2 root 71: BiosResult UpdateBootSectorConfiguration (byte drive) 72: { 73: AcquireSectorBuffer(); 74: 75: BiosResult result = ReadWriteMBR (false, drive); 76: if (result != BiosResultSuccess) 77: goto ret; 78: 79: SectorBuffer[TC_BOOT_SECTOR_CONFIG_OFFSET] = BootSectorFlags; 80: result = ReadWriteMBR (true, drive); 81: 82: ret: 83: ReleaseSectorBuffer(); 84: return result; 85: } 1.1.1.3 root 86: 87: #endif // !TC_WINDOWS_BOOT_RESCUE_DISK_MODE
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.