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

Function check_BSD

src/bsd.c:108–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108int check_BSD(disk_t *disk_car,partition_t *partition,const int verbose, const unsigned int max_partitions)
109{
110 unsigned char *buffer;
111 buffer=(unsigned char*)MALLOC(BSD_DISKLABEL_SIZE);
112 if(disk_car->pread(disk_car, buffer, BSD_DISKLABEL_SIZE, partition->part_offset + 0x200) != BSD_DISKLABEL_SIZE)
113 {
114 free(buffer);
115 return 1;
116 }
117 if(test_BSD(disk_car,(const struct disklabel*)buffer,partition,verbose,0,max_partitions))
118 {
119 free(buffer);
120 return 1;
121 }
122 set_part_name(partition,((const struct disklabel*)buffer)->d_packname,16);
123 free(buffer);
124 return 0;
125}
126
127int recover_BSD(const disk_t *disk_car, const struct disklabel*bsd_header,partition_t *partition,const int verbose, const int dump_ind)
128{

Callers 2

check_part_noneFunction · 0.85
check_part_i386Function · 0.85

Calls 3

MALLOCFunction · 0.85
test_BSDFunction · 0.85
set_part_nameFunction · 0.85

Tested by

no test coverage detected