/* Write New Information to MBR *\
/* To write the values to MBR partition table,
Uncomment the biosdisk function given below */
// biosdisk ( 3, 0x80, 0, 0, 1, 1, &p ) ;
display(); /* Display the Modified
Comments on coding:
The program given above is a sample program to show how we can modify the values of partition table entry of MBR. If you want to modify the values of partition entry for such logical partitions, which lie in extended partition, you have to modify the values in partition table of Extended MBR.
The values which have been given here to modify the partition table entry are just for demonstrate, how to modify. Never modify partition table with illegal or illogical values. By doing so the entire partition may become inaccessible.
The structure partition is used to read the partition entry from partition table and structure part to read MBR. To actually make the modifications in partition table uncomment the biosdisk( ) function.
If you want to modify the values of starting and ending, sectors and cylinder numbers of the partition, calculate the values, as described in the comments of the program to read and display the partition table of MBR, discussed in the starting of this chapter.
|Sample Chapters from book DATA RECOVERY WITH AND WITHOUT PROGRAMMING by Author Tarun Tyagi
Publishers of the Book
Number of Pages
Price of the Book
BPB Publications, New Delhi, India
$69.00 (Including Shipping Charges, Cost of Book and Other expenses, Free Source Code CD included with the Book)