Fix cluster start calculation for FAT32.

This commit is contained in:
2019-04-28 17:44:47 +01:00
parent 7b3d5d3f11
commit baf6f46eb2
4 changed files with 11 additions and 18 deletions

View File

@@ -115,16 +115,14 @@ namespace DiscImageChef.Filesystems.FAT
for(int i = 0; i < clusters.Length; i++)
{
byte[] buffer =
image.ReadSectors(firstClusterSector + (ulong)((clusters[i] - (fat32 ? 2 : 0)) * sectorsPerCluster),
sectorsPerCluster);
byte[] buffer = image.ReadSectors(firstClusterSector + clusters[i] * sectorsPerCluster,
sectorsPerCluster);
Array.Copy(buffer, 0, directoryBuffer, i * bytesPerCluster, bytesPerCluster);
}
currentDirectory = new Dictionary<string, CompleteDirectoryEntry>();
byte[] lastLfnName = null;
byte lastLfnChecksum = 0;
List<string> LFNs = new List<string>();
byte[] lastLfnName = null;
byte lastLfnChecksum = 0;
for(int pos = 0; pos < directoryBuffer.Length; pos += Marshal.SizeOf<DirectoryEntry>())
{