MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / log_fat_info

Function log_fat_info

src/fat.c:186–220  ·  view source on GitHub ↗

@ @ requires \valid_read(fh1); @*/

Source from the content-addressed store, hash-verified

184 @ requires \valid_read(fh1);
185 @*/
186static int log_fat_info(const struct fat_boot_sector*fh1, const upart_type_t upart_type, const unsigned int sector_size)
187{
188#ifndef DISABLED_FOR_FRAMAC
189 log_info("sector_size %u\n", fat_sector_size(fh1));
190 log_info("cluster_size %u\n", fh1->sectors_per_cluster);
191 log_info("reserved %u\n", le16(fh1->reserved));
192 log_info("fats %u\n", fh1->fats);
193 log_info("dir_entries %u\n", get_dir_entries(fh1));
194 log_info("sectors %u\n", fat_sectors(fh1));
195 log_info("media %02X\n", fh1->media);
196 log_info("fat_length %u\n", le16(fh1->fat_length));
197 log_info("secs_track %u\n", le16(fh1->secs_track));
198 log_info("heads %u\n", le16(fh1->heads));
199 log_info("hidden %u\n", (unsigned int)le32(fh1->hidden));
200 log_info("total_sect %u\n", (unsigned int)le32(fh1->total_sect));
201 if(upart_type==UP_FAT32)
202 {
203 log_info("fat32_length %u\n", (unsigned int)le32(fh1->fat32_length));
204 log_info("flags %04X\n", le16(fh1->flags));
205 log_info("version %u.%u\n", fh1->version[0], fh1->version[1]);
206 log_info("root_cluster %u\n", (unsigned int)le32(fh1->root_cluster));
207 log_info("info_sector %u\n", le16(fh1->info_sector));
208 log_info("backup_boot %u\n", le16(fh1->backup_boot));
209 if(fat32_get_free_count((const unsigned char*)fh1,sector_size)==0xFFFFFFFF)
210 log_info("free_count uninitialised\n");
211 else
212 log_info("free_count %lu\n",fat32_get_free_count((const unsigned char*)fh1,sector_size));
213 if(fat32_get_next_free((const unsigned char*)fh1,sector_size)==0xFFFFFFFF)
214 log_info("next_free uninitialised\n");
215 else
216 log_info("next_free %lu\n",fat32_get_next_free((const unsigned char*)fh1,sector_size));
217 }
218#endif
219 return 0;
220}
221
222int log_fat2_info(const struct fat_boot_sector*fh1, const struct fat_boot_sector*fh2, const upart_type_t upart_type, const unsigned int sector_size)
223{

Callers 1

check_FATFunction · 0.85

Calls 5

fat_sector_sizeFunction · 0.85
get_dir_entriesFunction · 0.85
fat_sectorsFunction · 0.85
fat32_get_free_countFunction · 0.85
fat32_get_next_freeFunction · 0.85

Tested by

no test coverage detected