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

Function check_HFS

src/hfs.c:40–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38static void set_HFS_info(partition_t *partition, const hfs_mdb_t *hfs_mdb);
39
40int check_HFS(disk_t *disk_car,partition_t *partition,const int verbose)
41{
42 unsigned char *buffer=(unsigned char*)MALLOC(HFS_SUPERBLOCK_SIZE);
43 if(disk_car->pread(disk_car, buffer, HFS_SUPERBLOCK_SIZE, partition->part_offset + 0x400) != HFS_SUPERBLOCK_SIZE)
44 {
45 free(buffer);
46 return 1;
47 }
48 if(test_HFS(disk_car,(hfs_mdb_t *)buffer,partition,verbose,0)!=0)
49 {
50 free(buffer);
51 return 1;
52 }
53 set_HFS_info(partition,(hfs_mdb_t *)buffer);
54 free(buffer);
55 return 0;
56}
57
58int recover_HFS(const disk_t *disk_car, const hfs_mdb_t *hfs_mdb,partition_t *partition,const int verbose, const int dump_ind, const int backup)
59{

Callers 4

check_part_gptFunction · 0.85
check_part_macFunction · 0.85
check_part_noneFunction · 0.85
check_part_i386Function · 0.85

Calls 3

MALLOCFunction · 0.85
test_HFSFunction · 0.85
set_HFS_infoFunction · 0.85

Tested by

no test coverage detected