Function to calculate CHS geomatry for recovery calculate() integrate()

Files Recovery Software
Home Contact Details Customer Support Download Demo Products  

 
 

To recover the specified file, the functions calculate() and integrate() are called within the function. The coding of the function calculate() has been given below:

/* Function To calculate the CHS Geomatry For The Recovery */

void calculate(unsigned int start,unsigned int *cylinder,
unsigned int *head,unsigned int *sector)
{
unsigned int temp;
*cylinder=0;
*head=1;
*sector=14;

if(start<5)
*sector=14+start;
else
{
temp= (start-4)/18;
if(temp>0)
{
if(temp%2==0)
*head=0;
else
*head=1;
*cylinder+=1+temp/2;
}
else
{
*head=0;
*cylinder=1;
}
*sector=(start-4)%18;
}

/// Display The CHS of The File to Be Recovered \\\
gotoxy(10,23);
cprintf("Cylinder = %u, Head = %u, Sector = %u",
*cylinder,*head,*sector);
}

Comments on coding:

The function calculate() is to calculate the Cylinder, Head and Sector information for the file to be recovered. After calculation the Cylinder, Head and Sector numbers are displayed on the screen.

The coding for the function integrate() has been given below:

/* Integrate File and Save the Recovered File To the Specified Path and File name */

void integrate(long unsigned int size, unsigned int cylinder, unsigned int head, unsigned int sector)
{
void clear_the_line(unsigned int);

/* Function to Verify The Sector for Errors */

int verify_the_sector(unsigned int, unsigned int, unsigned int);

int status;
char buf[512],*Filename_with_path;
struct diskinfo_t dinfo;
unsigned int result;
FILE *fp;

unsigned int left,i;
unsigned int sec;

Previous page

page 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20


page 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33

Next page
 
 
Data Recovery Book
 
Chapter 1 An Overview of Data Recovery
Chapter 2 Introduction of Hard Disks
Chapter 3 Logical Approach to Disks and OS
Chapter 4 Number Systems
Chapter 5 Introduction of C Programming
Chapter 6 Introduction to Computer Basics
Chapter 7 Necessary DOS Commands
Chapter 8 Disk-BIOS Functions and Interrupts Handling With C
Chapter 9 Handling Large Hard Disks
Chapter 10 Data Recovery From Corrupted Floppy
Chapter 11 Making Backups
Chapter 12 Reading and Modifying MBR with Programming
Chapter 13 Reading and Modifying DBR with Programming
Chapter 14 Programming for “Raw File” Recovery
Chapter 15 Programming for Data Wipers
Chapter 16 Developing more Utilities for Disks
Appendix Glossary of Data Recovery Terms
 
 

 

Pro Data Doctor

Home

Products

Contact Details

Customer Support

Download Demo

Terms and Conditions

 
Pro Data Doctor