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

Function check_OS2MB

src/fat.c:1103–1130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1101}
1102
1103int check_OS2MB(disk_t *disk, partition_t *partition, const int verbose)
1104{
1105 unsigned char *buffer=(unsigned char *)MALLOC(disk->sector_size);
1106 if((unsigned)disk->pread(disk, buffer, disk->sector_size, partition->part_offset) != disk->sector_size)
1107 {
1108#ifndef DISABLED_FOR_FRAMAC
1109 screen_buffer_add("check_OS2MB: Read error\n");
1110 log_error("check_OS2MB: Read error\n");
1111#endif
1112 free(buffer);
1113 return 1;
1114 }
1115 if(test_OS2MB(disk,(const struct fat_boot_sector *)buffer,partition,verbose,0)!=0)
1116 {
1117#ifndef DISABLED_FOR_FRAMAC
1118 if(verbose>0)
1119 {
1120 log_info("\n\ntest_OS2MB()\n");
1121 log_partition(disk, partition);
1122 }
1123#endif
1124 free(buffer);
1125 return 1;
1126 }
1127 partition->upart_type=UP_OS2MB;
1128 free(buffer);
1129 return 0;
1130}
1131
1132int recover_OS2MB(const disk_t *disk, const struct fat_boot_sector*fat_header, partition_t *partition, const int verbose, const int dump_ind)
1133{

Callers 1

check_part_noneFunction · 0.85

Calls 4

MALLOCFunction · 0.85
screen_buffer_addFunction · 0.85
test_OS2MBFunction · 0.85
log_partitionFunction · 0.85

Tested by

no test coverage detected