Writing a program for Raw File Recovery to Recover the Microsoft Word Files

Files Recovery Software
Home Contact Details Customer Support Download Demo Products  

 
 

Writing a program for Raw File Recovery

The coding of the program for Raw File Recovery of Microsoft Word files (.DOC Extension) has been given next. The program searches for the files in the sectors of the disk and saves the recovered file automatically by creating the name of file automatically.

The path specified by the user to save the files is used as destination path to save the recovered data. If the destination directory does not exist, program can create the destination up to one directory level.

The recovery program given here supports even the large size disks to search and recover the data. The program has been written to search the data in the second physical hard disk.

/* Raw File Recovery Program to Recover the Microsoft Word Files */

#include<stdio.h>
#include<dos.h>

/* Structure to be used by getdrivegeometry function using INT 13H Extension, Function Number 0x48. */

struct geometry
{
unsigned int size ; /* (call) size of Buffer */
unsigned int flags ; /* Information Flags */
unsigned long cyl ; /* Number of Physical
Cylinders on Drive */
unsigned long heads ;/* Number of Physical
Heads on Drive */

unsigned long spt ; /* Number of Physical
Sectors Per Track */
unsigned long sectors[2] ; /* Total Number of
Sectors on Drive */
unsigned int bps ; /* Bytes Per Sector */
} ;

/* Structure of Disk Address packet format, to be used by the readabsolutesectors Function */

struct diskaddrpacket
{
char packetsize ; /* Size of Packet, generally 10H */
char reserved ; /* Reserved (0) */
int blockcount ; /* Number of Blocks to Transfer */
char far *bufferaddress ; /* address to Transfer
Buffer */
unsigned long blocknumber[2] ; /* Starting Absolute
Block Number */
} ;

///// Function to get Drive Parameters \\\\\

unsigned long getdrivegeometry (int drive)
{
union REGS i, o ;
struct SREGS s ;
struct geometry g = { 26, 0, 0, 0, 0, 0, 0, 0 } ;

i.h.ah = 0x48 ; /* Function Number 0x48 */
i.h.dl = drive; /* Drive Number */
i.x.si = FP_OFF ( (void far*)&g ) ;
s.ds = FP_SEG ( (void far*)&g ) ;

/* Invoke the specified function number of INT 13H
extension with Segment Register Values */

int86x ( 0x13, &i, &o, &s ) ;

printf("\n Head = %lu, Sectors Per Track = %lu, Cylinder = %lu\n",
g.heads,g.spt,g.cyl);

/* If get drive Geometry function Fails, Display Error Message and Exit */

if(g.spt==0)
{
printf("\n Get Drive Geometry Function Fails....");
printf("\n Extensions Not Supported, Press any Key to
Exit...");
getch();
exit(1);
}

return *g.sectors; /* Return The Number of
Sectors on Drive */

}

unsigned long file_size=0, i=0;
unsigned long start_file=0, end_file=0;
unsigned long Sectors_in_HDD2=0, loop=0;
char buffer[512], filename[80], temp[8];
char path[80];
unsigned int result,num=0;

Previous page

page 1 | 2 | 3 | 4 | 5 | 6

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