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

Function check_APFS

src/apfs.c:46–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46int check_APFS(disk_t *disk_car, partition_t *partition)
47{
48 unsigned char *buffer=(unsigned char*)MALLOC(APFS_SUPERBLOCK_SIZE);
49 const nx_superblock_t* sb=(const nx_superblock_t *)buffer;
50 if(disk_car->pread(disk_car, buffer, APFS_SUPERBLOCK_SIZE, partition->part_offset) != APFS_SUPERBLOCK_SIZE)
51 {
52 free(buffer);
53 return 1;
54 }
55 if(test_APFS(sb, partition)!=0)
56 {
57 free(buffer);
58 return 1;
59 }
60 set_APFS_info(sb, partition);
61 free(buffer);
62 return 0;
63}
64
65int recover_APFS(const disk_t *disk, const nx_superblock_t *sb, partition_t *partition, const int verbose, const int dump_ind)
66{

Callers 2

check_part_gptFunction · 0.85
check_part_noneFunction · 0.85

Calls 3

MALLOCFunction · 0.85
test_APFSFunction · 0.85
set_APFS_infoFunction · 0.85

Tested by

no test coverage detected