PROGRAM FOR BACKUPING THE CONTENT OF THE PART-TABLE


#include "dos.h"
#include "stdio.h"
main()
{
char buffer[512];
int i;
file *in;
biosdisk(2,128,0,0,1,1,buffer);
in=fopen("parttab.txt","wb");
printf("opened parttab.txt for writing \n");
for (i=0;i<512;i++)
putc(buffer[i],in);
fclose(in);
printf("parttab.txt now has the copy of the partition table \n");
}

Note:The above program just copies the partition-table into the file parttab.txt. After opening the file parttab.txt in 'write binary' mode the contents of the array are dumped into it. the for loop executes 512 times as each sector is 512 bytes long.
now we are having two part-tab file ,one is actual part-tab file and other is above created file. what anti-virus does is simple it checks the content of partition table.
(i.e)-------------> compare the contents of the both array of 512 bytes of char.If any character from one array does not match its corresponding one, the virus is present in the machine.

BACK



© 2002 mahesh kumar. Not All rights reserved. ;-)
Hosted by www.Geocities.ws

1