|
|
1.1 root 1: /*
2: Copyright (c) 2008 TrueCrypt Foundation. All rights reserved.
3:
4: Governed by the TrueCrypt License 2.4 the full text of which is contained
5: in the file License.txt included in TrueCrypt binary and source code
6: distribution packages.
7: */
8:
9: #ifndef TC_HEADER_Boot_BootCommon
10: #define TC_HEADER_Boot_BootCommon
11:
12: #include "Password.h"
13: #include "BootDefs.h"
14:
15:
16: #define TC_BOOT_LOADER_AREA_SIZE (TC_BOOT_LOADER_AREA_SECTOR_COUNT * SECTOR_SIZE)
17:
18: #define TC_BOOT_VOLUME_HEADER_SECTOR (TC_BOOT_LOADER_AREA_SECTOR_COUNT - 1)
19: #define TC_BOOT_VOLUME_HEADER_SECTOR_OFFSET (TC_BOOT_VOLUME_HEADER_SECTOR * SECTOR_SIZE)
20:
21: #define TC_CD_BOOTSECTOR_OFFSET 0xd000
22: #define TC_CD_BOOT_LOADER_SECTOR 26
23:
24: #define TC_ORIG_BOOT_LOADER_BACKUP_SECTOR TC_BOOT_LOADER_AREA_SECTOR_COUNT
25: #define TC_ORIG_BOOT_LOADER_BACKUP_SECTOR_OFFSET (TC_ORIG_BOOT_LOADER_BACKUP_SECTOR * SECTOR_SIZE)
26:
27: #define TC_MBR_SECTOR 0
28: #define TC_MAX_MBR_BOOT_CODE_SIZE 440
29:
30:
31: #pragma pack (1)
32:
33: typedef struct
34: {
35: byte Flags;
36: } BootSectorConfiguration;
37:
38:
39: // Modifying this value can introduce incompatibility with previous versions
40: #define TC_BOOT_LOADER_ARGS_OFFSET 0x10
41:
42: typedef struct
43: {
44: // Modifying this structure can introduce incompatibility with previous versions
45: char Signature[8];
46: uint16 BootLoaderVersion;
47: uint16 CryptoInfoOffset;
48: uint16 CryptoInfoLength;
49: uint32 HeaderSaltCrc32;
50: Password BootPassword;
51: } BootArguments;
52:
53: #pragma pack ()
54:
55: // Boot arguments signature should not be defined as a static string
56: // Modifying these values can introduce incompatibility with previous versions
57: #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)
58: #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)
59:
60:
61: #endif // TC_HEADER_Boot_BootCommon
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.