* commandline:

* DiscImageChef.Filesystems/FAT.cs:
	  Correct null volume label and oem string

	* DiscImageChef.Filesystems/NTFS.cs:
	  Some NTFS do not contain signature1.

	* DiscImageChef.Metadata/MediaType.cs:
	  Added XML name for iomega ZIP.

	* DiscImageChef/Commands/Analyze.cs:
	* DiscImageChef/Commands/CreateSidecar.cs:
	  Check multiple partitioning schemes.

	* DiscImageChef/Commands/DumpMedia.cs:
	  Check multiple partitioning schemes.
	Do not add interface data to sidecar for removable devices.
	Add dump hardware to sidecar for remocable block devices.
This commit is contained in:
2016-02-05 00:01:09 +00:00
parent 5f5d59f783
commit ab24c63d4b
10 changed files with 105 additions and 51 deletions

View File

@@ -1,3 +1,8 @@
2016-02-05 Natalia Portillo <claunia@claunia.com>
* commandline:
2016-02-04 Natalia Portillo <claunia@claunia.com> 2016-02-04 Natalia Portillo <claunia@claunia.com>
* commandline: * commandline:

View File

@@ -1,3 +1,11 @@
2016-02-05 Natalia Portillo <claunia@claunia.com>
* FAT.cs:
Correct null volume label and oem string
* NTFS.cs:
Some NTFS do not contain signature1.
2016-02-04 Natalia Portillo <claunia@claunia.com> 2016-02-04 Natalia Portillo <claunia@claunia.com>
* FFS.cs: * FFS.cs:

View File

@@ -244,7 +244,7 @@ namespace DiscImageChef.Plugins
dosString = new byte[8]; dosString = new byte[8];
Array.Copy(bpb_sector, 0x03, dosString, 0, 8); Array.Copy(bpb_sector, 0x03, dosString, 0, 8);
BPB.OEMName = Encoding.ASCII.GetString(dosString); BPB.OEMName = StringHandlers.CToString(dosString);
BPB.bps = BitConverter.ToUInt16(bpb_sector, 0x0B); BPB.bps = BitConverter.ToUInt16(bpb_sector, 0x0B);
BPB.spc = bpb_sector[0x0D]; BPB.spc = bpb_sector[0x0D];
BPB.rsectors = BitConverter.ToUInt16(bpb_sector, 0x0E); BPB.rsectors = BitConverter.ToUInt16(bpb_sector, 0x0E);
@@ -272,10 +272,10 @@ namespace DiscImageChef.Plugins
FAT32PB.serial_no = BitConverter.ToUInt32(bpb_sector, 0x43); FAT32PB.serial_no = BitConverter.ToUInt32(bpb_sector, 0x43);
dosString = new byte[11]; dosString = new byte[11];
Array.Copy(bpb_sector, 0x47, dosString, 0, 11); Array.Copy(bpb_sector, 0x47, dosString, 0, 11);
FAT32PB.volume_label = Encoding.ASCII.GetString(dosString); FAT32PB.volume_label = StringHandlers.CToString(dosString);
dosString = new byte[8]; dosString = new byte[8];
Array.Copy(bpb_sector, 0x52, dosString, 0, 8); Array.Copy(bpb_sector, 0x52, dosString, 0, 8);
FAT32PB.fs_type = Encoding.ASCII.GetString(dosString); FAT32PB.fs_type = StringHandlers.CToString(dosString);
} }
else else
{ {
@@ -285,10 +285,10 @@ namespace DiscImageChef.Plugins
EPB.serial_no = BitConverter.ToUInt32(bpb_sector, 0x27); EPB.serial_no = BitConverter.ToUInt32(bpb_sector, 0x27);
dosString = new byte[11]; dosString = new byte[11];
Array.Copy(bpb_sector, 0x2B, dosString, 0, 11); Array.Copy(bpb_sector, 0x2B, dosString, 0, 11);
EPB.volume_label = Encoding.ASCII.GetString(dosString); EPB.volume_label = StringHandlers.CToString(dosString);
dosString = new byte[8]; dosString = new byte[8];
Array.Copy(bpb_sector, 0x36, dosString, 0, 8); Array.Copy(bpb_sector, 0x36, dosString, 0, 8);
EPB.fs_type = Encoding.ASCII.GetString(dosString); EPB.fs_type = StringHandlers.CToString(dosString);
} }
sb.AppendFormat("OEM Name: {0}", BPB.OEMName).AppendLine(); sb.AppendFormat("OEM Name: {0}", BPB.OEMName).AppendLine();
@@ -335,6 +335,7 @@ namespace DiscImageChef.Plugins
} }
sb.AppendFormat("Volume label: {0}", EPB.volume_label).AppendLine(); sb.AppendFormat("Volume label: {0}", EPB.volume_label).AppendLine();
if(!string.IsNullOrEmpty(EPB.volume_label))
xmlFSType.VolumeName = EPB.volume_label; xmlFSType.VolumeName = EPB.volume_label;
sb.AppendFormat("Filesystem type: {0}", EPB.fs_type).AppendLine(); sb.AppendFormat("Filesystem type: {0}", EPB.fs_type).AppendLine();
} }
@@ -354,6 +355,7 @@ namespace DiscImageChef.Plugins
} }
sb.AppendFormat("Volume label: {0}", EPB.volume_label).AppendLine(); sb.AppendFormat("Volume label: {0}", EPB.volume_label).AppendLine();
if(!string.IsNullOrEmpty(EPB.volume_label))
xmlFSType.VolumeName = EPB.volume_label; xmlFSType.VolumeName = EPB.volume_label;
sb.AppendFormat("Filesystem type: {0}", EPB.fs_type).AppendLine(); sb.AppendFormat("Filesystem type: {0}", EPB.fs_type).AppendLine();
} }

View File

@@ -57,8 +57,8 @@ namespace DiscImageChef.Plugins
return false; return false;
byte[] eigth_bytes = new byte[8]; byte[] eigth_bytes = new byte[8];
byte signature1, fats_no; byte fats_no;
UInt16 spfat, signature2; UInt16 spfat, signature;
string oem_name; string oem_name;
byte[] ntfs_bpb = imagePlugin.ReadSector(0 + partitionStart); byte[] ntfs_bpb = imagePlugin.ReadSector(0 + partitionStart);
@@ -79,15 +79,9 @@ namespace DiscImageChef.Plugins
if (spfat != 0) if (spfat != 0)
return false; return false;
signature1 = ntfs_bpb[0x026]; signature = BitConverter.ToUInt16(ntfs_bpb, 0x1FE);
if (signature1 != 0x80)
return false;
signature2 = BitConverter.ToUInt16(ntfs_bpb, 0x1FE);
return signature2 == 0xAA55;
return signature == 0xAA55;
} }
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information) public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)

View File

@@ -1,3 +1,8 @@
2016-02-05 Natalia Portillo <claunia@claunia.com>
* MediaType.cs:
Added XML name for iomega ZIP.
2016-02-04 Natalia Portillo <claunia@claunia.com> 2016-02-04 Natalia Portillo <claunia@claunia.com>
* Dimensions.cs: * Dimensions.cs:

View File

@@ -652,6 +652,18 @@ namespace DiscImageChef.Metadata
DiscType = "CD"; DiscType = "CD";
DiscSubType = "3DO"; DiscSubType = "3DO";
break; break;
case CommonTypes.MediaType.ZIP100:
DiscType = "Iomega ZIP";
DiscSubType = "Iomega ZIP100";
break;
case CommonTypes.MediaType.ZIP250:
DiscType = "Iomega ZIP";
DiscSubType = "Iomega ZIP250";
break;
case CommonTypes.MediaType.ZIP750:
DiscType = "Iomega ZIP";
DiscSubType = "Iomega ZIP750";
break;
default: default:
DiscType = "Unknown"; DiscType = "Unknown";
DiscSubType = "Unknown"; DiscSubType = "Unknown";

View File

@@ -1,3 +1,14 @@
2016-02-05 Natalia Portillo <claunia@claunia.com>
* Commands/Analyze.cs:
* Commands/CreateSidecar.cs:
Check multiple partitioning schemes.
* Commands/DumpMedia.cs:
Check multiple partitioning schemes.
Do not add interface data to sidecar for removable devices.
Add dump hardware to sidecar for remocable block devices.
2016-02-04 Natalia Portillo <claunia@claunia.com> 2016-02-04 Natalia Portillo <claunia@claunia.com>
* Commands/DumpMedia.cs: * Commands/DumpMedia.cs:

View File

@@ -124,7 +124,6 @@ namespace DiscImageChef.Commands
partition_scheme = _partplugin.Name; partition_scheme = _partplugin.Name;
partitions.AddRange(_partitions); partitions.AddRange(_partitions);
Core.Statistics.AddPartition(_partplugin.Name); Core.Statistics.AddPartition(_partplugin.Name);
break;
} }
} }

View File

@@ -510,9 +510,8 @@ namespace DiscImageChef.Commands
if (_partplugin.GetInformation(_imageFormat, out _partitions)) if (_partplugin.GetInformation(_imageFormat, out _partitions))
{ {
partitions = _partitions; partitions.AddRange(_partitions);
Core.Statistics.AddPartition(_partplugin.Name); Core.Statistics.AddPartition(_partplugin.Name);
break;
} }
} }

View File

@@ -1311,7 +1311,7 @@ namespace DiscImageChef.Commands
sidecar.OpticalDisc[0].Image.format = "Raw disk image (sector by sector copy)"; sidecar.OpticalDisc[0].Image.format = "Raw disk image (sector by sector copy)";
sidecar.OpticalDisc[0].Image.Value = options.OutputPrefix + ".bin"; sidecar.OpticalDisc[0].Image.Value = options.OutputPrefix + ".bin";
sidecar.OpticalDisc[0].Sessions = 1; sidecar.OpticalDisc[0].Sessions = 1;
sidecar.OpticalDisc[0].Tracks = new []{1}; sidecar.OpticalDisc[0].Tracks = new[]{1};
sidecar.OpticalDisc[0].Track = new Schemas.TrackType[1]; sidecar.OpticalDisc[0].Track = new Schemas.TrackType[1];
sidecar.OpticalDisc[0].Track[0] = new Schemas.TrackType(); sidecar.OpticalDisc[0].Track[0] = new Schemas.TrackType();
sidecar.OpticalDisc[0].Track[0].BytesPerSector = (int)blockSize; sidecar.OpticalDisc[0].Track[0].BytesPerSector = (int)blockSize;
@@ -1389,7 +1389,7 @@ namespace DiscImageChef.Commands
if (blockSize == 512) if (blockSize == 512)
{ {
// Long sector sizes for 512-byte magneto-opticals // Long sector sizes for 512-byte magneto-opticals
foreach (ushort testSize in new []{ 600, 610, 630 }) foreach (ushort testSize in new[]{ 600, 610, 630 })
{ {
testSense = dev.ReadLong16(out readBuffer, out senseBuf, false, 0, testSize, dev.Timeout, out duration); testSense = dev.ReadLong16(out readBuffer, out senseBuf, false, 0, testSize, dev.Timeout, out duration);
if (!testSense && !dev.Error) if (!testSense && !dev.Error)
@@ -1816,7 +1816,7 @@ namespace DiscImageChef.Commands
unreadableSectors = tmpList; unreadableSectors = tmpList;
repeatRetry: repeatRetry:
ulong [] tmpArray = unreadableSectors.ToArray(); ulong[] tmpArray = unreadableSectors.ToArray();
foreach (ulong badSector in tmpArray) foreach (ulong badSector in tmpArray)
{ {
if (aborted) if (aborted)
@@ -1897,8 +1897,8 @@ namespace DiscImageChef.Commands
Decoders.SCSI.Modes.DecodedMode? currentMode = null; Decoders.SCSI.Modes.DecodedMode? currentMode = null;
Decoders.SCSI.Modes.ModePage? currentModePage = null; Decoders.SCSI.Modes.ModePage? currentModePage = null;
byte [] md6 = null; byte[] md6 = null;
byte [] md10 = null; byte[] md10 = null;
if (!runningPersistent && options.Persistent) if (!runningPersistent && options.Persistent)
{ {
@@ -1913,7 +1913,7 @@ namespace DiscImageChef.Commands
currentMode = Decoders.SCSI.Modes.DecodeMode6(readBuffer, dev.SCSIType); currentMode = Decoders.SCSI.Modes.DecodeMode6(readBuffer, dev.SCSIType);
if (currentMode.HasValue) if (currentMode.HasValue)
currentModePage = currentMode.Value.Pages [0]; currentModePage = currentMode.Value.Pages[0];
if (dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) if (dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
{ {
@@ -1924,11 +1924,11 @@ namespace DiscImageChef.Commands
Decoders.SCSI.Modes.DecodedMode md = new Decoders.SCSI.Modes.DecodedMode(); Decoders.SCSI.Modes.DecodedMode md = new Decoders.SCSI.Modes.DecodedMode();
md.Header = new Decoders.SCSI.Modes.ModeHeader(); md.Header = new Decoders.SCSI.Modes.ModeHeader();
md.Pages = new Decoders.SCSI.Modes.ModePage [1]; md.Pages = new Decoders.SCSI.Modes.ModePage[1];
md.Pages [0] = new Decoders.SCSI.Modes.ModePage(); md.Pages[0] = new Decoders.SCSI.Modes.ModePage();
md.Pages [0].Page = 0x01; md.Pages[0].Page = 0x01;
md.Pages [0].Subpage = 0x00; md.Pages[0].Subpage = 0x00;
md.Pages [0].PageResponse = Decoders.SCSI.Modes.EncodeModePage_01_MMC(pgMMC); md.Pages[0].PageResponse = Decoders.SCSI.Modes.EncodeModePage_01_MMC(pgMMC);
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.SCSIType); md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.SCSIType);
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.SCSIType); md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.SCSIType);
} }
@@ -1948,11 +1948,11 @@ namespace DiscImageChef.Commands
Decoders.SCSI.Modes.DecodedMode md = new Decoders.SCSI.Modes.DecodedMode(); Decoders.SCSI.Modes.DecodedMode md = new Decoders.SCSI.Modes.DecodedMode();
md.Header = new Decoders.SCSI.Modes.ModeHeader(); md.Header = new Decoders.SCSI.Modes.ModeHeader();
md.Pages = new Decoders.SCSI.Modes.ModePage [1]; md.Pages = new Decoders.SCSI.Modes.ModePage[1];
md.Pages [0] = new Decoders.SCSI.Modes.ModePage(); md.Pages[0] = new Decoders.SCSI.Modes.ModePage();
md.Pages [0].Page = 0x01; md.Pages[0].Page = 0x01;
md.Pages [0].Subpage = 0x00; md.Pages[0].Subpage = 0x00;
md.Pages [0].PageResponse = Decoders.SCSI.Modes.EncodeModePage_01(pg); md.Pages[0].PageResponse = Decoders.SCSI.Modes.EncodeModePage_01(pg);
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.SCSIType); md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.SCSIType);
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.SCSIType); md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.SCSIType);
} }
@@ -1974,8 +1974,8 @@ namespace DiscImageChef.Commands
{ {
Decoders.SCSI.Modes.DecodedMode md = new Decoders.SCSI.Modes.DecodedMode(); Decoders.SCSI.Modes.DecodedMode md = new Decoders.SCSI.Modes.DecodedMode();
md.Header = new Decoders.SCSI.Modes.ModeHeader(); md.Header = new Decoders.SCSI.Modes.ModeHeader();
md.Pages = new Decoders.SCSI.Modes.ModePage [1]; md.Pages = new Decoders.SCSI.Modes.ModePage[1];
md.Pages [0] = currentModePage.Value; md.Pages[0] = currentModePage.Value;
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.SCSIType); md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.SCSIType);
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.SCSIType); md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.SCSIType);
@@ -2030,7 +2030,7 @@ namespace DiscImageChef.Commands
if (!_imageFormat.OpenImage(options.OutputPrefix + ".bin")) if (!_imageFormat.OpenImage(options.OutputPrefix + ".bin"))
_imageFormat = null; _imageFormat = null;
} }
catch (Exception ex) catch
{ {
_imageFormat = null; _imageFormat = null;
} }
@@ -2045,9 +2045,8 @@ namespace DiscImageChef.Commands
if (_partplugin.GetInformation(_imageFormat, out _partitions)) if (_partplugin.GetInformation(_imageFormat, out _partitions))
{ {
partitions = _partitions; partitions.AddRange(_partitions);
Core.Statistics.AddPartition(_partplugin.Name); Core.Statistics.AddPartition(_partplugin.Name);
break;
} }
} }
@@ -2152,7 +2151,7 @@ namespace DiscImageChef.Commands
// TODO: Implement layers // TODO: Implement layers
//sidecar.OpticalDisc[0].Layers = new LayersType(); //sidecar.OpticalDisc[0].Layers = new LayersType();
sidecar.OpticalDisc[0].Sessions = 1; sidecar.OpticalDisc[0].Sessions = 1;
sidecar.OpticalDisc[0].Tracks = new []{1}; sidecar.OpticalDisc[0].Tracks = new[]{1};
sidecar.OpticalDisc[0].Track = new Schemas.TrackType[1]; sidecar.OpticalDisc[0].Track = new Schemas.TrackType[1];
sidecar.OpticalDisc[0].Track[0] = new Schemas.TrackType(); sidecar.OpticalDisc[0].Track[0] = new Schemas.TrackType();
sidecar.OpticalDisc[0].Track[0].BytesPerSector = (int)blockSize; sidecar.OpticalDisc[0].Track[0].BytesPerSector = (int)blockSize;
@@ -2169,7 +2168,7 @@ namespace DiscImageChef.Commands
sidecar.OpticalDisc[0].Track[0].Size = (long)(blocks * blockSize); sidecar.OpticalDisc[0].Track[0].Size = (long)(blocks * blockSize);
sidecar.OpticalDisc[0].Track[0].StartSector = 0; sidecar.OpticalDisc[0].Track[0].StartSector = 0;
if (xmlFileSysInfo != null) if (xmlFileSysInfo != null)
sidecar.OpticalDisc [0].Track [0].FileSystemInformation = xmlFileSysInfo; sidecar.OpticalDisc[0].Track[0].FileSystemInformation = xmlFileSysInfo;
switch (dskType) switch (dskType)
{ {
case MediaType.DDCD: case MediaType.DDCD:
@@ -2224,6 +2223,8 @@ namespace DiscImageChef.Commands
sidecar.BlockMedia[0].Image = new ImageType(); sidecar.BlockMedia[0].Image = new ImageType();
sidecar.BlockMedia[0].Image.format = "Raw disk image (sector by sector copy)"; sidecar.BlockMedia[0].Image.format = "Raw disk image (sector by sector copy)";
sidecar.BlockMedia[0].Image.Value = options.OutputPrefix + ".bin"; sidecar.BlockMedia[0].Image.Value = options.OutputPrefix + ".bin";
if (!dev.IsRemovable || dev.IsUSB)
{
if (dev.Type == DeviceType.ATAPI) if (dev.Type == DeviceType.ATAPI)
sidecar.BlockMedia[0].Interface = "ATAPI"; sidecar.BlockMedia[0].Interface = "ATAPI";
else if (dev.IsUSB) else if (dev.IsUSB)
@@ -2232,6 +2233,7 @@ namespace DiscImageChef.Commands
sidecar.BlockMedia[0].Interface = "FireWire"; sidecar.BlockMedia[0].Interface = "FireWire";
else else
sidecar.BlockMedia[0].Interface = "SCSI"; sidecar.BlockMedia[0].Interface = "SCSI";
}
sidecar.BlockMedia[0].LogicalBlocks = (long)blocks; sidecar.BlockMedia[0].LogicalBlocks = (long)blocks;
sidecar.BlockMedia[0].LogicalBlockSize = (int)blockSize; sidecar.BlockMedia[0].LogicalBlockSize = (int)blockSize;
sidecar.BlockMedia[0].Manufacturer = dev.Manufacturer; sidecar.BlockMedia[0].Manufacturer = dev.Manufacturer;
@@ -2240,6 +2242,23 @@ namespace DiscImageChef.Commands
sidecar.BlockMedia[0].Size = (long)(blocks * blockSize); sidecar.BlockMedia[0].Size = (long)(blocks * blockSize);
if (xmlFileSysInfo != null) if (xmlFileSysInfo != null)
sidecar.BlockMedia[0].FileSystemInformation = xmlFileSysInfo; sidecar.BlockMedia[0].FileSystemInformation = xmlFileSysInfo;
if (dev.IsRemovable)
{
sidecar.BlockMedia[0].DumpHardwareArray = new DumpHardwareType[1];
sidecar.BlockMedia[0].DumpHardwareArray[0] = new DumpHardwareType();
sidecar.BlockMedia[0].DumpHardwareArray[0].Extents = new ExtentType[1];
sidecar.BlockMedia[0].DumpHardwareArray[0].Extents[0] = new ExtentType();
sidecar.BlockMedia[0].DumpHardwareArray[0].Extents[0].Start = 0;
sidecar.BlockMedia[0].DumpHardwareArray[0].Extents[0].End = (int)(blocks - 1);
sidecar.BlockMedia[0].DumpHardwareArray[0].Manufacturer = dev.Manufacturer;
sidecar.BlockMedia[0].DumpHardwareArray[0].Model = dev.Model;
sidecar.BlockMedia[0].DumpHardwareArray[0].Revision = dev.Revision;
sidecar.BlockMedia[0].DumpHardwareArray[0].Software = new SoftwareType();
sidecar.BlockMedia[0].DumpHardwareArray[0].Software.Name = "DiscImageChef";
sidecar.BlockMedia[0].DumpHardwareArray[0].Software.OperatingSystem = dev.PlatformID.ToString();
sidecar.BlockMedia[0].DumpHardwareArray[0].Software.Version = typeof(MainClass).Assembly.GetName().Version.ToString();
}
} }
} }