1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
struct exfat_super_block { uint8_t jump[3]; /* 0x00 jmp and nop instructions */ uint8_t oem_name[8]; /* 0x03 "EXFAT " */ uint8_t __unused1[53]; /* 0x0B always 0 */ le64_t sector_start; /* 0x40 partition first sector */ le64_t sector_count; /* 0x48 partition sectors count */ le32_t fat_sector_start; /* 0x50 FAT first sector */ le32_t fat_sector_count; /* 0x54 FAT sectors count */ le32_t cluster_sector_start; /* 0x58 first cluster sector */ le32_t cluster_count; /* 0x5C total clusters count */ le32_t rootdir_cluster; /* 0x60 first cluster of the root dir */ le32_t volume_serial; /* 0x64 volume serial number */ struct /* 0x68 FS version */ { uint8_t minor; uint8_t major; } version; le16_t volume_state; /* 0x6A volume state flags */ uint8_t sector_bits; /* 0x6C sector size as (1 << n) */ uint8_t spc_bits; /* 0x6D sectors per cluster as (1 << n) */ uint8_t fat_count; /* 0x6E always 1 */ uint8_t drive_no; /* 0x6F always 0x80 */ uint8_t allocated_percent; /* 0x70 percentage of allocated space */ uint8_t __unused2[397]; /* 0x71 always 0 */ le16_t boot_signature; /* the value of 0xAA55 */ } struct exfat_entry /* common container for all entries */ { uint8_t type; /* any of EXFAT_ENTRY_xxx */ uint8_t data[31]; } struct exfat_entry_bitmap /* allocated clusters bitmap */ { uint8_t type; /* EXFAT_ENTRY_BITMAP */ uint8_t __unknown1[19]; le32_t start_cluster; le64_t size; /* in bytes */ } struct exfat_entry_upcase /* upper case translation table */ { uint8_t type; /* EXFAT_ENTRY_UPCASE */ uint8_t __unknown1[3]; le32_t checksum; uint8_t __unknown2[12]; le32_t start_cluster; le64_t size; /* in bytes */ } struct exfat_entry_label /* volume label */ { uint8_t type; /* EXFAT_ENTRY_LABEL */ uint8_t length; /* number of characters */ le16_t name[EXFAT_ENAME_MAX]; /* in UTF-16LE */ } struct exfat_entry_meta1 /* file or directory info (part 1) */ { uint8_t type; /* EXFAT_ENTRY_FILE */ uint8_t continuations; le16_t checksum; le16_t attrib; /* combination of EXFAT_ATTRIB_xxx */ le16_t __unknown1; le16_t crtime, crdate; /* creation date and time */ le16_t mtime, mdate; /* latest modification date and time */ le16_t atime, adate; /* latest access date and time */ uint8_t crtime_cs; /* creation time in cs (centiseconds) */ uint8_t mtime_cs; /* latest modification time in cs */ uint8_t __unknown2[10]; } struct exfat_entry_meta2 /* file or directory info (part 2) */ { uint8_t type; /* EXFAT_ENTRY_FILE_INFO */ uint8_t flags; /* combination of EXFAT_FLAG_xxx */ uint8_t __unknown1; uint8_t name_length; le16_t name_hash; le16_t __unknown2; le64_t real_size; /* in bytes, equals to size */ uint8_t __unknown3[4]; le32_t start_cluster; le64_t size; /* in bytes, equals to real_size */ } struct exfat_entry_name /* file or directory name */ { uint8_t type; /* EXFAT_ENTRY_FILE_NAME */ uint8_t __unknown; le16_t name[EXFAT_ENAME_MAX]; /* in UTF-16LE */ } |