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

Function check_HFSP

src/hfsp.c:55–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55int check_HFSP(disk_t *disk_car,partition_t *partition,const int verbose)
56{
57 unsigned char *buffer=(unsigned char*)MALLOC(HFSP_BOOT_SECTOR_SIZE);
58 if(disk_car->pread(disk_car, buffer, HFSP_BOOT_SECTOR_SIZE, partition->part_offset + 0x400) != HFSP_BOOT_SECTOR_SIZE)
59 {
60 free(buffer);
61 return 1;
62 }
63 if(test_HFSP(disk_car,(struct hfsp_vh *)buffer,partition,verbose,0)!=0)
64 {
65 free(buffer);
66 return 1;
67 }
68 set_HFSP_info(partition, (const struct hfsp_vh *)buffer);
69 if(disk_car->pread(disk_car, buffer, HFSP_BOOT_SECTOR_SIZE,
70 partition->part_offset + partition->part_size - 0x400) == HFSP_BOOT_SECTOR_SIZE &&
71 test_HFSP(disk_car,(struct hfsp_vh *)buffer,partition,verbose,0)==0)
72 {
73 strcat(partition->info, " + Backup");
74 }
75 free(buffer);
76 return 0;
77}
78
79int recover_HFSP(disk_t *disk_car, const struct hfsp_vh *vh, partition_t *partition, const int verbose, const int dump_ind, const int backup)
80{

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_HFSPFunction · 0.85
set_HFSP_infoFunction · 0.85

Tested by

no test coverage detected