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

Function test_MD_be

src/md.c:66–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66static int test_MD_be(const disk_t *disk_car, const struct mdp_superblock_s *sb, const partition_t *partition, const int dump_ind)
67{
68 if(be32(sb->md_magic)!=(unsigned int)MD_SB_MAGIC)
69 return 1;
70#ifndef DISABLED_FOR_FRAMAC
71 log_info("\nRaid magic value at %u/%u/%u\n",
72 offset2cylinder(disk_car,partition->part_offset),
73 offset2head(disk_car,partition->part_offset),
74 offset2sector(disk_car,partition->part_offset));
75 log_info("Raid apparent size: %llu sectors\n", (long long unsigned)(sb->size<<1));
76 if(be32(sb->major_version)==0)
77 {
78 /* chunk_size may be 0 */
79 log_info("Raid chunk size: %llu bytes\n",(long long unsigned)be32(sb->chunk_size));
80 }
81#endif
82 if(be32(sb->major_version)>1)
83 return 1;
84 if(dump_ind!=0)
85 {
86 /* There is a little offset ... */
87 dump_log(sb,DEFAULT_SECTOR_SIZE);
88 }
89 return 0;
90}
91
92static void set_MD_info(const struct mdp_superblock_s *sb, partition_t *partition, const int verbose)
93{

Callers 2

check_MDFunction · 0.85
recover_MDFunction · 0.85

Calls 4

offset2cylinderFunction · 0.85
offset2headFunction · 0.85
offset2sectorFunction · 0.85
dump_logFunction · 0.85

Tested by

no test coverage detected