/*L'information de 512 bytes pour remplir espace de mauvais secteur */
/// J'avais l'habitude 512 zéros pour remplir espace de 512 bytes \\\
static char dbuf2[512] =
"00000000000000000000000000000000" "00000000000000000000000000000000" "00000000000000000000000000000000" "00000000000000000000000000000000" "00000000000000000000000000000000" "00000000000000000000000000000000" "00000000000000000000000000000000" "00000000000000000000000000000000" "00000000000000000000000000000000" "00000000000000000000000000000000" "00000000000000000000000000000000" "00000000000000000000000000000000" "00000000000000000000000000000000" "00000000000000000000000000000000" "00000000000000000000000000000000" "00000000000000000000000000000000";
FILE *tt;
clrscr();
printf("\n Écrire le nom du dossier avec le chemin pour stocker les données temporairement\n");
gets(filename);
if((tt=fopen(filename,"wb"))==NULL)
{
printf("N'a pas pu créer le dossier, n'appuie sur aucune touche POUR SORTIR");
getch();
exit(0);
}
printf("\n Système de initialisation de disquette…\n");
/// Initialiser le système de disque \\\
for(i=0; i<3; i++)
{
regs.h.ah = 0x00; /* Remettre à zéro le système de disque*/
regs.h.dl = 0x00; /* Disquette a : */
int86(0x13, ®s, ®s);
}
for(track=0;track<=79;track++)
{
for(head=0;head<=1;head++)
{
for(sector=1;sector<=18;sector++)
{
dinfo.drive = 0; /* nombre d'entraînement pour A : */
dinfo.head = head; /* nombre principal de disque */
dinfo.track = track; /* nombre de voie */
dinfo.sector = sector; /* nombre de secteur */
dinfo.nsectors = 1; /* compte de secteur */
dinfo.buffer = dbuf; /* amortisseur de données */
result = _bios_disk(_DISK_READ, &dinfo);
if ((result & 0xff00) == 0)
{
for(i=0;i<512;i++)
fprintf(tt,"%c",dbuf[i] & 0xff);
}
else
{
printf("Ne peut pas lire le lecteur A, statut=
0x%02x\t%d\t%d\t%d\n", result, head, track, sector);
/* Si le secteur n'est pas lisible, occuper 512 bytes par dbuf2 */
fwrite(dbuf2,512,1,tt);
}
printf("Voie de lecture= %d Head= %d Sector= %d\n",
track, head, sector);
}
}
}
}
Sample Chapters from book DATA RECOVERY WITH AND WITHOUT PROGRAMMING by Author Tarun Tyagi, translated using machine translation. See original English contents on Data recovery book pages. |
|
Publishers of the Book
Number of Pages
ISBN
Price of the Book
|
BPB Publications, New Delhi, India
540
81-7656-922-4
$69.00 (Including Shipping Charges, Cost of Book and Other expenses, Free Source Code CD included with the Book)
|
 |
|
|