|
|
1.1.1.6 root 1: /* Legal Notice: The source code contained in this file has been derived from
2: the source code of Encryption for the Masses 2.02a, which is Copyright (c)
3: 1998-99 Paul Le Roux and which is covered by the 'License Agreement for
4: Encryption for the Masses'. Modifications and additions to that source code
1.1.1.7 root 5: contained in this file are Copyright (c) 2004-2006 TrueCrypt Foundation and
1.1.1.8 ! root 6: Copyright (c) 2004 TrueCrypt Team, and are covered by TrueCrypt License 2.1
1.1.1.6 root 7: the full text of which is contained in the file License.txt included in
8: TrueCrypt binary and source code distribution archives. */
1.1 root 9:
10: typedef struct fatparams_t
11: {
12: char volume_name[11];
1.1.1.3 root 13: unsigned int num_sectors; /* total number of sectors */
1.1 root 14: int cluster_count; /* number of clusters */
15: int size_root_dir; /* size of the root directory in bytes */
16: int size_fat; /* size of FAT */
17: int fats;
1.1.1.6 root 18: unsigned int create_time;
1.1 root 19: int media;
20: int cluster_size;
21: int fat_length;
22: int dir_entries;
23: int sector_size;
24: int hidden;
1.1.1.6 root 25: __int16 reserved;
1.1 root 26: int sectors;
1.1.1.6 root 27: unsigned int total_sect;
1.1 root 28:
29: int heads;
30: int secs_track;
31:
32: } fatparams;
33:
34:
35: struct msdos_boot_sector
36: {
37: unsigned char boot_jump[3]; /* Boot strap short or near jump */
38: char system_id[8]; /* Name - can be used to special case
39: partition manager volumes */
40: unsigned char sector_size[2]; /* bytes per logical sector */
41: unsigned char cluster_size; /* sectors/cluster */
42: unsigned short reserved;/* reserved sectors */
43: unsigned char fats; /* number of FATs */
44: unsigned char dir_entries[2]; /* root directory entries */
45: unsigned char sectors[2]; /* number of sectors */
46: unsigned char media; /* media code */
47: unsigned short fat_length; /* sectors/FAT */
48: unsigned short secs_track; /* sectors per track */
49: unsigned short heads; /* number of heads */
1.1.1.6 root 50: unsigned __int32 hidden; /* hidden sectors */
51: unsigned __int32 total_sect; /* number of sectors (if sectors == 0) */
1.1 root 52: unsigned char drive_number; /* BIOS drive number */
53: unsigned char RESERVED; /* Unused */
1.1.1.6 root 54: unsigned char ext_boot_sign; /* 0x29 if fields below exist (DOS 3.3+) */
1.1 root 55: unsigned char volume_id[4]; /* Volume ID number */
56: char volume_label[11]; /* Volume label */
1.1.1.6 root 57: char fs_type[8]; /* Typically FAT12, FAT16, or FAT32 */
1.1 root 58: unsigned char boot_code[448]; /* Boot code (or message) */
59: unsigned short boot_sign; /* 0xAA55 */
60: };
61:
62:
63: void GetFatParams ( fatparams *ft );
64: void PutBoot ( fatparams *ft , unsigned char *boot );
1.1.1.7 root 65: int FormatFat (unsigned __int64 startSector, fatparams * ft, void * dev, PCRYPTO_INFO cryptoInfo, BOOL quickFormat);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.