1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 11:08:02 -06:00

Windows Driver: enhance detection of FAT volumes.

This commit is contained in:
Mounir IDRASSI
2017-05-27 20:15:23 +02:00
parent a8e511c212
commit 0e2c129854
2 changed files with 18 additions and 6 deletions

View File

@@ -1353,12 +1353,14 @@ NTSTATUS ProcessMainDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION Ex
switch (BE64 (*(uint64 *) readBuffer)) switch (BE64 (*(uint64 *) readBuffer))
{ {
case 0xEB52904E54465320: // NTFS case 0xEB52904E54465320: // NTFS
case 0xEB3C904D53444F53: // FAT16 case 0xEB3C904D53444F53: // FAT16/FAT32
case 0xEB58904D53444F53: // FAT32 case 0xEB58904D53444F53: // FAT32
case 0xEB76904558464154: // exFAT case 0xEB76904558464154: // exFAT
case 0x0000005265465300: // ReFS case 0x0000005265465300: // ReFS
case 0xEB58906D6B66732E: // FAT by mkfs.fat case 0xEB58906D6B66732E: // FAT32 mkfs.fat
case 0xEB58906D6B646F73: // FAT by mkfs.vfat/mkdosfs case 0xEB58906D6B646F73: // FAT32 mkfs.vfat/mkdosfs
case 0xEB3C906D6B66732E: // FAT16/FAT12 mkfs.fat
case 0xEB3C906D6B646F73: // FAT16/FAT12 mkfs.vfat/mkdosfs
opentest->FilesystemDetected = TRUE; opentest->FilesystemDetected = TRUE;
break; break;
} }

View File

@@ -739,7 +739,9 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
switch (fsId) switch (fsId)
{ {
case 0xEB3C904D53444F53: // FAT16 case 0xEB3C904D53444F53: // FAT16/FAT12
case 0xEB3C906D6B66732E: // mkfs.fat
case 0xEB3C906D6B646F73: // mkfs.vfat/mkdosfs
// workaround for FAT32 formatting by TrueCrypt/VeraCrypt // workaround for FAT32 formatting by TrueCrypt/VeraCrypt
if (memcmp (readBuffer + 0x52, "FAT32 ", 8) == 0) if (memcmp (readBuffer + 0x52, "FAT32 ", 8) == 0)
{ {
@@ -748,8 +750,16 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
} }
else else
{ {
Extension->PartitionType = PARTITION_FAT_16; if (memcmp (readBuffer + 0x36, "FAT12 ", 8) == 0)
Dump ("FAT16 detected\n"); {
Extension->PartitionType = PARTITION_FAT_12;
Dump ("FAT12 detected\n");
}
else
{
Extension->PartitionType = PARTITION_FAT_16;
Dump ("FAT16 detected\n");
}
} }
break; break;
case 0xEB58906D6B66732E: // mkfs.fat case 0xEB58906D6B66732E: // mkfs.fat