mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
* DiscImageChef.DiscImages/QED.cs:
Correct calculation of tables. * DiscImageChef.DiscImages/VDI.cs: Correct IBM reading. * DiscImageChef.Filesystems/FAT.cs: Not all FAT16 implementations set media descriptor correctly. * DiscImageChef/Commands/Compare.cs: Do not reuse FiltersList, for some reason same filter is being returned already opened.
This commit is contained in:
@@ -245,19 +245,19 @@ namespace DiscImageChef.ImagePlugins
|
|||||||
DicConsole.DebugWriteLine("QED plugin", "qHdr.clusterSectors = {0}", clusterSectors);
|
DicConsole.DebugWriteLine("QED plugin", "qHdr.clusterSectors = {0}", clusterSectors);
|
||||||
DicConsole.DebugWriteLine("QED plugin", "qHdr.tableSize = {0}", tableSize);
|
DicConsole.DebugWriteLine("QED plugin", "qHdr.tableSize = {0}", tableSize);
|
||||||
|
|
||||||
byte[] l1Table_b = new byte[tableSize];
|
byte[] l1Table_b = new byte[tableSize * 8];
|
||||||
stream.Seek((long)qHdr.l1_table_offset, SeekOrigin.Begin);
|
stream.Seek((long)qHdr.l1_table_offset, SeekOrigin.Begin);
|
||||||
stream.Read(l1Table_b, 0, (int)tableSize);
|
stream.Read(l1Table_b, 0, (int)tableSize * 8);
|
||||||
l1Table = new ulong[tableSize / 8];
|
l1Table = new ulong[tableSize];
|
||||||
DicConsole.DebugWriteLine("QED plugin", "Reading L1 table");
|
DicConsole.DebugWriteLine("QED plugin", "Reading L1 table");
|
||||||
for(long i = 0; i < l1Table.LongLength; i++)
|
for(long i = 0; i < l1Table.LongLength; i++)
|
||||||
l1Table[i] = BitConverter.ToUInt64(l1Table_b, (int)(i * 8));
|
l1Table[i] = BitConverter.ToUInt64(l1Table_b, (int)(i * 8));
|
||||||
|
|
||||||
l1Mask = 0;
|
l1Mask = 0;
|
||||||
int c = 0;
|
int c = 0;
|
||||||
clusterBits = ctz32(qHdr.cluster_size);
|
clusterBits = ctz32(qHdr.cluster_size);
|
||||||
l2Mask = tableSize - 1;
|
l2Mask = (tableSize - 1) << clusterBits;
|
||||||
l1Shift = clusterBits + ctz32(tableSize);
|
l1Shift = clusterBits + ctz32(tableSize);
|
||||||
|
|
||||||
for(int i = 0; i < 64; i++)
|
for(int i = 0; i < 64; i++)
|
||||||
{
|
{
|
||||||
@@ -281,7 +281,7 @@ namespace DiscImageChef.ImagePlugins
|
|||||||
DicConsole.DebugWriteLine("QED plugin", "qHdr.l2Mask = {0:X}", l2Mask);
|
DicConsole.DebugWriteLine("QED plugin", "qHdr.l2Mask = {0:X}", l2Mask);
|
||||||
DicConsole.DebugWriteLine("QED plugin", "qHdr.sectorMask = {0:X}", sectorMask);
|
DicConsole.DebugWriteLine("QED plugin", "qHdr.sectorMask = {0:X}", sectorMask);
|
||||||
|
|
||||||
maxL2TableCache = MaxCacheSize / (tableSize / 8);
|
maxL2TableCache = MaxCacheSize / (tableSize);
|
||||||
maxClusterCache = MaxCacheSize / qHdr.cluster_size;
|
maxClusterCache = MaxCacheSize / qHdr.cluster_size;
|
||||||
|
|
||||||
imageStream = stream;
|
imageStream = stream;
|
||||||
@@ -328,13 +328,13 @@ namespace DiscImageChef.ImagePlugins
|
|||||||
|
|
||||||
if(!l2TableCache.TryGetValue(l1Off, out l2Table))
|
if(!l2TableCache.TryGetValue(l1Off, out l2Table))
|
||||||
{
|
{
|
||||||
l2Table = new ulong[tableSize / 8];
|
l2Table = new ulong[tableSize];
|
||||||
imageStream.Seek((long)l1Table[l1Off], SeekOrigin.Begin);
|
imageStream.Seek((long)l1Table[l1Off], SeekOrigin.Begin);
|
||||||
byte[] l2Table_b = new byte[tableSize];
|
byte[] l2Table_b = new byte[tableSize * 8];
|
||||||
imageStream.Read(l2Table_b, 0, (int)tableSize);
|
imageStream.Read(l2Table_b, 0, (int)tableSize * 8);
|
||||||
DicConsole.DebugWriteLine("QED plugin", "Reading L2 table #{0}", l1Off);
|
DicConsole.DebugWriteLine("QED plugin", "Reading L2 table #{0}", l1Off);
|
||||||
for(long i = 0; i < l2Table.LongLength; i++)
|
for(long i = 0; i < l2Table.LongLength; i++)
|
||||||
l2Table[i] = BitConverter.ToUInt64(l2Table_b, (int)(i * 8));
|
l2Table[i] = BitConverter.ToUInt64(l2Table_b, (int)(i * 8));
|
||||||
|
|
||||||
if(l2TableCache.Count >= maxL2TableCache)
|
if(l2TableCache.Count >= maxL2TableCache)
|
||||||
l2TableCache.Clear();
|
l2TableCache.Clear();
|
||||||
@@ -344,7 +344,7 @@ namespace DiscImageChef.ImagePlugins
|
|||||||
|
|
||||||
ulong l2Off = (byteAddress & l2Mask) >> clusterBits;
|
ulong l2Off = (byteAddress & l2Mask) >> clusterBits;
|
||||||
|
|
||||||
ulong offset = l2Table[l2Off];
|
ulong offset = l2Table[l2Off];
|
||||||
|
|
||||||
sector = new byte[512];
|
sector = new byte[512];
|
||||||
|
|
||||||
|
|||||||
@@ -194,11 +194,12 @@ namespace DiscImageChef.DiscImages
|
|||||||
DicConsole.DebugWriteLine("VirtualBox plugin", "vHdr.parentUuid = {0}", vHdr.parentUuid);
|
DicConsole.DebugWriteLine("VirtualBox plugin", "vHdr.parentUuid = {0}", vHdr.parentUuid);
|
||||||
|
|
||||||
DicConsole.DebugWriteLine("VirtualBox plugin", "Reading Image Block Map");
|
DicConsole.DebugWriteLine("VirtualBox plugin", "Reading Image Block Map");
|
||||||
|
stream.Seek(vHdr.offsetBlocks, SeekOrigin.Begin);
|
||||||
IBM = new uint[vHdr.blocks];
|
IBM = new uint[vHdr.blocks];
|
||||||
byte[] IBM_b = new byte[vHdr.blocks * 4];
|
byte[] IBM_b = new byte[vHdr.blocks * 4];
|
||||||
stream.Read(IBM_b, 0, IBM_b.Length);
|
stream.Read(IBM_b, 0, IBM_b.Length);
|
||||||
for(int i = 0; i < IBM.Length; i++)
|
for(int i = 0; i < IBM.Length; i++)
|
||||||
IBM[i] = BitConverter.ToUInt32(IBM_b, i * 4);
|
IBM[i] = BitConverter.ToUInt32(IBM_b, i * 4);
|
||||||
|
|
||||||
sectorCache = new Dictionary<ulong, byte[]>();
|
sectorCache = new Dictionary<ulong, byte[]>();
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ namespace DiscImageChef.Filesystems
|
|||||||
|
|
||||||
if((first_fat_entry & 0xFFFFFFF0) == 0xFFFFFFF0) // Seems to be FAT16
|
if((first_fat_entry & 0xFFFFFFF0) == 0xFFFFFFF0) // Seems to be FAT16
|
||||||
{
|
{
|
||||||
if((first_fat_entry & 0xFF) == media_descriptor)
|
if((first_fat_entry & 0xFF) == media_descriptor || (first_fat_entry & 0xFF) == 0xF0)
|
||||||
return true; // It MUST be FAT16, or... maybe not :S
|
return true; // It MUST be FAT16, or... maybe not :S
|
||||||
}
|
}
|
||||||
else if((first_fat_entry & 0x00FFFFF0) == 0x00FFFFF0)
|
else if((first_fat_entry & 0x00FFFFF0) == 0x00FFFFF0)
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ namespace DiscImageChef.Commands
|
|||||||
|
|
||||||
FiltersList filtersList = new FiltersList();
|
FiltersList filtersList = new FiltersList();
|
||||||
Filter inputFilter1 = filtersList.GetFilter(options.InputFile1);
|
Filter inputFilter1 = filtersList.GetFilter(options.InputFile1);
|
||||||
|
filtersList = new FiltersList();
|
||||||
Filter inputFilter2 = filtersList.GetFilter(options.InputFile2);
|
Filter inputFilter2 = filtersList.GetFilter(options.InputFile2);
|
||||||
|
|
||||||
if(inputFilter1 == null)
|
if(inputFilter1 == null)
|
||||||
|
|||||||
Reference in New Issue
Block a user