summaryrefslogtreecommitdiffstats
path: root/src/parti386.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2010-11-29 07:38:53 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2010-11-29 07:38:53 +0100
commit4b6c36b87494901b942ce45af8f7d37f88b4202b (patch)
tree65ca92bd530896440902a6c596d1c5cfdfb2b148 /src/parti386.c
parent3487a5c6037e9b2eba333716db78007a9e309984 (diff)
Try to locate truecrypt logical partition by using the logical partition entry.
Diffstat (limited to 'src/parti386.c')
-rw-r--r--src/parti386.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/parti386.c b/src/parti386.c
index f39b9ad..7f0a98c 100644
--- a/src/parti386.c
+++ b/src/parti386.c
@@ -612,6 +612,33 @@ static list_part_t *get_ext_data_i386(disk_t *disk_car, list_part_t *list_part,
return list_part;
}
+int recover_i386_logical(disk_t *disk, const unsigned char *buffer, partition_t *partition)
+{
+ const struct partition_dos *p=pt_offset_const(buffer,0);
+ if(partition->arch!=&arch_i386)
+ return 1;
+ if(is_extended(p->sys_ind))
+ p=pt_offset_const(buffer,1);
+ switch(p->sys_ind)
+ {
+ case P_12FAT:
+ case P_16FAT:
+ case P_16FATBD:
+ case P_16FATBD_LBA:
+ case P_NTFS:
+ case P_32FAT:
+ case P_32FAT_LBA:
+ break;
+ default:
+ return 1;
+ }
+ if(partition->part_offset==0)
+ return 1;
+ i386_entry2partition(disk, partition->part_offset, partition, p, STATUS_DELETED, 0, 0, 0);
+ partition->order=NO_ORDER;
+ return 0;
+}
+
static int test_MBR_over(disk_t *disk_car,list_part_t *list_part)
{/* Test if partitions overlap */
int res=0;