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

Function test_rfs4

src/rfs.c:118–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118static int test_rfs4(const disk_t *disk_car, const struct reiser4_master_sb *sb, const partition_t *partition, const int verbose)
119{
120 if (memcmp(sb->magic,REISERFS4_SUPER_MAGIC,sizeof(REISERFS4_SUPER_MAGIC)) != 0)
121 return 1;
122 if(verbose>0)
123 log_info("\nReiserFS Marker at %u/%u/%u\n", offset2cylinder(disk_car,partition->part_offset),offset2head(disk_car,partition->part_offset),offset2sector(disk_car,partition->part_offset));
124 /*
125 * sanity checks.
126 */
127 if (le16(sb->blocksize) != 4096)
128 return (1);
129 /* if a value > 4096 become legal, the code will break while reading the filesystem size (read out of bound) */
130 return 0;
131}
132
133int recover_rfs(const disk_t *disk_car, const struct reiserfs_super_block *sb,partition_t *partition,const int verbose, const int dump_ind)
134{

Callers 2

check_rfsFunction · 0.85
recover_rfsFunction · 0.85

Calls 3

offset2cylinderFunction · 0.85
offset2headFunction · 0.85
offset2sectorFunction · 0.85

Tested by

no test coverage detected