mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
* DiscImageChef.Filters/PCExchange.cs:
Removed debug messages. * DiscImageChef.Filesystems/FAT.cs: Corrected syntax bug. * DiscImageChef.Filters/Filters.cs: Corrected handling of "No filter". * DiscImageChef.Filesystems/AmigaDOS.cs: Corrected detection of FFS on hard disks and FFS with block sizes > sector size.
This commit is contained in:
@@ -200,9 +200,14 @@ namespace DiscImageChef.Filesystems
|
||||
ulong root_ptr = BigEndianBitConverter.ToUInt32(sector, 0x08);
|
||||
DicConsole.DebugWriteLine("AmigaDOS plugin", "Bootblock points to {0} as Rootblock", root_ptr);
|
||||
|
||||
root_ptr = (partitionEnd - partitionStart) / 2 + partitionStart + 1;
|
||||
if(root_ptr == 0)
|
||||
{
|
||||
root_ptr = (partitionEnd - partitionStart) / 2 + partitionStart;
|
||||
|
||||
DicConsole.DebugWriteLine("AmigaDOS plugin", "Nonetheless, going to block {0} for Rootblock", root_ptr);
|
||||
DicConsole.DebugWriteLine("AmigaDOS plugin", "Nonetheless, going to block {0} for Rootblock", root_ptr);
|
||||
}
|
||||
else
|
||||
root_ptr += partitionStart;
|
||||
|
||||
if(root_ptr >= partitionEnd)
|
||||
return false;
|
||||
@@ -212,8 +217,15 @@ namespace DiscImageChef.Filesystems
|
||||
uint type = BigEndianBitConverter.ToUInt32(sector, 0x00);
|
||||
uint hashTableSize = BigEndianBitConverter.ToUInt32(sector, 0x0C);
|
||||
|
||||
if((0x18 + hashTableSize * 4 + 196) > sector.Length)
|
||||
return false;
|
||||
uint blockSize = 0x18 + hashTableSize * 4 + 196;
|
||||
uint sectorsPerBlock = (uint)(blockSize / sector.Length);
|
||||
if(blockSize % sector.Length > 0)
|
||||
sectorsPerBlock++;
|
||||
|
||||
sector = imagePlugin.ReadSectors(root_ptr, sectorsPerBlock);
|
||||
|
||||
//if((0x18 + hashTableSize * 4 + 196) > sector.Length)
|
||||
// return false;
|
||||
|
||||
uint sec_type = BigEndianBitConverter.ToUInt32(sector, (int)(0x18 + hashTableSize * 4 + 196));
|
||||
|
||||
@@ -225,7 +237,30 @@ namespace DiscImageChef.Filesystems
|
||||
StringBuilder sbInformation = new StringBuilder();
|
||||
|
||||
byte[] BootBlockSectors = imagePlugin.ReadSectors(0 + partitionStart, 2);
|
||||
byte[] RootBlockSector = imagePlugin.ReadSector((partitionEnd - partitionStart) / 2 + partitionStart + 1);
|
||||
|
||||
ulong root_ptr = BigEndianBitConverter.ToUInt32(BootBlockSectors, 0x08);
|
||||
DicConsole.DebugWriteLine("AmigaDOS plugin", "Bootblock points to {0} as Rootblock", root_ptr);
|
||||
|
||||
if(root_ptr == 0)
|
||||
{
|
||||
root_ptr = (partitionEnd - partitionStart) / 2 + partitionStart;
|
||||
|
||||
DicConsole.DebugWriteLine("AmigaDOS plugin", "Nonetheless, going to block {0} for Rootblock", root_ptr);
|
||||
}
|
||||
else
|
||||
root_ptr += partitionStart;
|
||||
|
||||
byte[] RootBlockSector = imagePlugin.ReadSector(root_ptr);
|
||||
|
||||
uint hashTableSize = BigEndianBitConverter.ToUInt32(RootBlockSector, 0x0C);
|
||||
|
||||
uint blockSize = 0x18 + hashTableSize * 4 + 196;
|
||||
uint sectorsPerBlock = (uint)(blockSize / RootBlockSector.Length);
|
||||
if(blockSize % RootBlockSector.Length > 0)
|
||||
sectorsPerBlock++;
|
||||
|
||||
RootBlockSector = imagePlugin.ReadSectors(root_ptr, sectorsPerBlock);
|
||||
|
||||
byte[] diskName = new byte[32];
|
||||
|
||||
BootBlock bootBlk = new BootBlock();
|
||||
|
||||
@@ -216,7 +216,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(fat32_signature == "FAT32 ")
|
||||
{
|
||||
// TODO: Check with a real FAT+ to see where the version is set
|
||||
if(bpb_sector[0x2A] == 1 || (bpb_sector[0x2B] == 1)
|
||||
if(bpb_sector[0x2A] == 1 || bpb_sector[0x2B] == 1)
|
||||
{
|
||||
sb.AppendLine("FAT+"); // Seems easy, check reading
|
||||
xmlFSType.Type = "FAT+";
|
||||
|
||||
@@ -73,7 +73,6 @@ namespace DiscImageChef.Filters
|
||||
{
|
||||
if(filter.UUID != new Guid("12345678-AAAA-BBBB-CCCC-123456789000"))
|
||||
{
|
||||
System.Console.WriteLine("Trying filter {0}", filter.Name);
|
||||
if(filter.Identify(path))
|
||||
{
|
||||
Filter foundFilter = (Filter)filter.GetType().GetConstructor(Type.EmptyTypes).Invoke(new object[] { });
|
||||
@@ -87,6 +86,14 @@ namespace DiscImageChef.Filters
|
||||
noFilter = filter;
|
||||
}
|
||||
|
||||
if(noFilter.Identify(path))
|
||||
{
|
||||
noFilter.Open(path);
|
||||
|
||||
if(noFilter.IsOpened())
|
||||
return noFilter;
|
||||
}
|
||||
|
||||
return noFilter;
|
||||
}
|
||||
|
||||
|
||||
@@ -189,7 +189,6 @@ namespace DiscImageChef.Filters
|
||||
|
||||
public override bool Identify(byte[] buffer)
|
||||
{
|
||||
System.Console.WriteLine("parentFolder");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -201,11 +200,8 @@ namespace DiscImageChef.Filters
|
||||
|
||||
public override bool Identify(string path)
|
||||
{
|
||||
System.Console.WriteLine("parentFolder");
|
||||
string parentFolder = Path.GetDirectoryName(path);
|
||||
|
||||
System.Console.WriteLine("parentFolder {0}", parentFolder);
|
||||
|
||||
if(!File.Exists(Path.Combine(parentFolder, FinderInfo)))
|
||||
return false;
|
||||
|
||||
@@ -314,12 +310,6 @@ namespace DiscImageChef.Filters
|
||||
dataLen = new FileInfo(dataPath).Length;
|
||||
rsrcLen = new FileInfo(rsrcPath).Length;
|
||||
|
||||
System.Console.WriteLine("dataPath = {0}", dataPath);
|
||||
System.Console.WriteLine("rsrcPath = {0}", rsrcPath);
|
||||
System.Console.WriteLine("dataLen = {0}", dataLen);
|
||||
System.Console.WriteLine("rsrcLen = {0}", rsrcLen);
|
||||
System.Console.WriteLine("basePath = {0}", basePath);
|
||||
|
||||
basePath = path;
|
||||
opened = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user