28 |
uint32_t reserved; |
uint32_t reserved; |
29 |
uint32_t osx_folder; |
uint32_t osx_folder; |
30 |
uint8_t id[8]; |
uint8_t id[8]; |
31 |
} __attribute__((__packed__)); |
} PACKED; |
32 |
|
|
33 |
struct hfs_mdb { |
struct hfs_mdb { |
34 |
uint8_t signature[2]; |
uint8_t signature[2]; |
58 |
uint8_t embed_sig[2]; |
uint8_t embed_sig[2]; |
59 |
uint16_t embed_startblock; |
uint16_t embed_startblock; |
60 |
uint16_t embed_blockcount; |
uint16_t embed_blockcount; |
61 |
} __attribute__((__packed__)); |
} PACKED; |
62 |
|
|
63 |
struct hfsplus_bnode_descriptor { |
struct hfsplus_bnode_descriptor { |
64 |
uint32_t next; |
uint32_t next; |
67 |
uint8_t height; |
uint8_t height; |
68 |
uint16_t num_recs; |
uint16_t num_recs; |
69 |
uint16_t reserved; |
uint16_t reserved; |
70 |
} __attribute__((__packed__)); |
} PACKED; |
71 |
|
|
72 |
struct hfsplus_bheader_record { |
struct hfsplus_bheader_record { |
73 |
uint16_t depth; |
uint16_t depth; |
76 |
uint32_t leaf_head; |
uint32_t leaf_head; |
77 |
uint32_t leaf_tail; |
uint32_t leaf_tail; |
78 |
uint16_t node_size; |
uint16_t node_size; |
79 |
} __attribute__((__packed__)); |
} PACKED; |
80 |
|
|
81 |
struct hfsplus_catalog_key { |
struct hfsplus_catalog_key { |
82 |
uint16_t key_len; |
uint16_t key_len; |
83 |
uint32_t parent_id; |
uint32_t parent_id; |
84 |
uint16_t unicode_len; |
uint16_t unicode_len; |
85 |
uint8_t unicode[255 * 2]; |
uint8_t unicode[255 * 2]; |
86 |
} __attribute__((__packed__)); |
} PACKED; |
87 |
|
|
88 |
struct hfsplus_extent { |
struct hfsplus_extent { |
89 |
uint32_t start_block; |
uint32_t start_block; |
90 |
uint32_t block_count; |
uint32_t block_count; |
91 |
} __attribute__((__packed__)); |
} PACKED; |
92 |
|
|
93 |
#define HFSPLUS_EXTENT_COUNT 8 |
#define HFSPLUS_EXTENT_COUNT 8 |
94 |
struct hfsplus_fork { |
struct hfsplus_fork { |
96 |
uint32_t clump_size; |
uint32_t clump_size; |
97 |
uint32_t total_blocks; |
uint32_t total_blocks; |
98 |
struct hfsplus_extent extents[HFSPLUS_EXTENT_COUNT]; |
struct hfsplus_extent extents[HFSPLUS_EXTENT_COUNT]; |
99 |
} __attribute__((__packed__)); |
} PACKED; |
100 |
|
|
101 |
struct hfsplus_vol_header { |
struct hfsplus_vol_header { |
102 |
uint8_t signature[2]; |
uint8_t signature[2]; |
125 |
struct hfsplus_fork cat_file; |
struct hfsplus_fork cat_file; |
126 |
struct hfsplus_fork attr_file; |
struct hfsplus_fork attr_file; |
127 |
struct hfsplus_fork start_file; |
struct hfsplus_fork start_file; |
128 |
} __attribute__((__packed__)); |
} PACKED; |
129 |
|
|
130 |
#define HFS_SUPERBLOCK_OFFSET 0x400 |
#define HFS_SUPERBLOCK_OFFSET 0x400 |
131 |
#define HFS_NODE_LEAF 0xff |
#define HFS_NODE_LEAF 0xff |
132 |
#define HFSPLUS_POR_CNID 1 |
#define HFSPLUS_POR_CNID 1 |
133 |
|
|
134 |
int volume_id_probe_hfs_hfsplus(struct volume_id *id, uint64_t off) |
int FAST_FUNC volume_id_probe_hfs_hfsplus(struct volume_id *id /*,uint64_t off*/) |
135 |
{ |
{ |
136 |
|
uint64_t off = 0; |
137 |
unsigned blocksize; |
unsigned blocksize; |
138 |
unsigned cat_block; |
unsigned cat_block; |
139 |
unsigned ext_block_start; |
unsigned ext_block_start; |