Program to unhide the hidden partition

Data Recovery PRO DATA DOCTOR

Home | Order Online | Downloads | Contact Us | Software Knowledgebase

it | es | pt | fr | de | jp | kr | cn | ru | nl | gr


Writing program to Unhide the Partition

The program to unhide the hidden partition works just opposite to the program which hides the program. In this program we subtract 16 (0x10) from the value of file system indicator byte of the hidden partition.

The coding of the program in as follows:

/* Program to unhide the partition hidden by the previous program */

#include <bios.h>
#include <stdio.h>

int main(void)
{
struct diskinfo_t dinfo;
int result, tohide;
int i;
static char dbuf[512];/* Data buffer */
clrscr();

dinfo.drive = 0x80; /* drive number for
First Hard Disk */
dinfo.head = 0; /* disk head number */
dinfo.track = 0; /* track number */
dinfo.sector = 1; /* sector number */
dinfo.nsectors = 1; /* sector count */
dinfo.buffer = dbuf; /* data buffer */

result = _bios_disk(_DISK_READ, &dinfo);

if ((result & 0xff00) == 0)
{
printf("The Partition Codes of Four Partition
Entries are, 0x%02x, 0x%02x, 0x%02x And 0x%02x.\n",
dbuf[450] & 0xff, dbuf[466] & 0xff,
dbuf[482] & 0xff, dbuf[498] & 0xff);

textcolor(15);
gotoxy(5,5);
cprintf("Partition Entry in MBR is as follows:");
gotoxy(10,7);cprintf("1. "); showtype(dbuf[450] & 0xff);
gotoxy(10,8);cprintf("2. "); showtype(dbuf[466] & 0xff);
gotoxy(10,9);cprintf("3. "); showtype(dbuf[482] & 0xff);
gotoxy(10,10);cprintf("4. "); showtype(dbuf[498] & 0xff);

/* Get the Use input to unhide the partition */

gotoxy(1,15);printf("Enter The partition no., Which to
unhide, Or Press any other key to
Exit... ");

tohide=getche();

switch(tohide)
{

/* Unhide first partition of partition table */

case '1':
dbuf[450] = dbuf[450] -16;
result = _bios_disk(_DISK_WRITE, &dinfo);
break;

/* Unhide second partition of partition table */
case '2':
dbuf[466] = dbuf[466]-16;
result = _bios_disk(_DISK_WRITE, &dinfo);
break;

/* Unhide third partition of partition table */
case '3':
dbuf[482] = dbuf[482] -16;
result = _bios_disk(_DISK_WRITE, &dinfo);
break;

/* Unhide fourth partition of partition table */
case '4':
dbuf[498] = dbuf[498]-16;
result = _bios_disk(_DISK_WRITE, &dinfo);
break;

default:
exit(0);

}

if ((result & 0xff00) == 0)
{
printf("\n\nThe New Partition Codes of Four Partition
Entries are, 0x%02x, 0x%02x, 0x%02x And 0x%02x.\n",
dbuf[450] & 0xff, dbuf[466] & 0xff,
dbuf[482] & 0xff, dbuf[498] & 0xff);
getch();
}
else
{
printf("Cannot Change the Byte, status = 0x%02x\n",
result);
getch();
}
}
return 0;
}

 

Comments on Program

Be careful while giving the partition number to unhide. If the number of partition is entered wrong by mistake, the file system information of that partition will be changed and partition may become inaccessible. However the program previously discussed to hide the partitions, may help you to cure the file system indicator byte of that partition.

Sample Chapters from book DATA RECOVERY WITH AND WITHOUT PROGRAMMING by Author Tarun Tyagi
Data Recovery with & without Programming


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)





Buy Data recovery Book

Previous page

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

Next page

© Copyright 2002-2005 DataDoctor.Biz

Home | Contact us | Downloads | Services | Terms and conditions | Site map

Website Data Recovery | recuperación de Datos | Récupération de données | Datenrettung | Recupero dati | データ復旧 | 데이터 복구 | 数据恢复 | Восстановление данных | De terugwinning van gegevens | Ανάκτηση δεδομένων
Sitemap Site map1 2 3 4 | Spanish1 2 3 | French1 2 3 | German1 2 3 | Italian1 2 3 | Portuguese1 2 3 | Japanese1 2 3 | Korean1 2 3 | Chinese1 2 3 | Russian1 2 3 | Dutch1 2 3 | Greek1 2 3
Data Recovery Book English | Spanish | French | German | Italian | Portuguese | Japanese | Korean | Chinese | Russian | Dutch | Greek