Files
Aaru/Aaru/Commands/Device/DeviceReport.cs

1597 lines
78 KiB
C#
Raw Normal View History

2017-05-19 20:28:49 +01:00
// /***************************************************************************
2020-02-27 12:31:25 +00:00
// Aaru Data Preservation Suite
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). * DiscImageChef.Metadata/DeviceReport.cs: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DumpMedia.cs: Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/CreateSidecar.cs: Moved checksum generation to a separate class. * CICMMetadata: Added support for ADIP. * DiscImageChef.CommonTypes/MediaType.cs: Added parameters of UDO media. Moved DataPlay outside of Iomega, as it's not from that manufacturer. Added missing Exatape media and corrected 160m XL one. Added SyJet media. Added all ECMA defined magneto-optical (sectors calculated from specifications, unchecked). Added PD media. Added Imation 320Gb RDX. Added generic USB flash drives. * DiscImageChef.Decoders/SCSI/Enums.cs: Make enumerations public. * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Devices/Device/Constructor.cs: Trim space padded strings on SCSI INQUIRY. * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: Added PREVENT ALLOW MEDIUM REMOVAL. Added START STOP UNIT. * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: Rename NEC methods. * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: Corrected Pioneer transfer length calculation. * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: Renamed Plextor methods. * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with MMC same name but different command. * DiscImageChef.Devices/DiscImageChef.Devices.csproj: Set platform target to x86 (does it really matter?). * DiscImageChef.Devices/Linux/Command.cs: Reduced allocation for readlink() to current kernel MAX_PATH. * DiscImageChef.Devices/Linux/Enums.cs: Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves commands not working on 32-bit environments. * DiscImageChef.DiscImages/ZZZRawImage.cs: Changed ECMA-184 and ECMA-183 enums. * DiscImageChef.Metadata/Dimensions.cs: Added all ECMA defined magneto-opticals. Added PD media. Added 320Gb RDX. Corrected Exatape 160m XL. Added Exatape 22m and 28m. * DiscImageChef.Metadata/MediaType.cs: Added 356mm magneto-optical media. Changed ECMA-184 and ECMA-183 enums. Added USB generic flash drive. * DiscImageChef/Commands/DeviceInfo.cs: Corrected SCSI INQUIRY naming. Corrected SCSI MODE SENSE (6) parameters. Reduced SCSI MODE SENSE timeout, some devices just get stuck with unsupported MODE SENSE commanda and must be left to timeout. Changed FUJITSU vendor string comparison. * DiscImageChef/Commands/MediaInfo.cs: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). Changed some error WriteLine() to debug ones. Too much verbosity. Added DVD media type decoding from PFI. Found a drive that dumps ADIP, enabling it again (not decoded). * DiscImageChef/Commands/MediaScan.cs: Added option to generate ImgBurn compatible log to media-scan command. * DiscImageChef/DiscImageChef.csproj: Moved checksum generation to a separate class. Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Main.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Options.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. Added option to generate ImgBurn compatible log to media-scan command.
2016-01-31 08:05:56 +00:00
// ----------------------------------------------------------------------------
//
// Filename : DeviceReport.cs
* LICENSE.MIT: * LICENSE.LGPL: Added LICENSE files for LGPL and MIT licenses. * DiscImageChef.Devices/Enums.cs: * DiscImageChef.Partitions/MBR.cs: * DiscImageChef.Partitions/RDB.cs: * DiscImageChef.DiscImages/GDI.cs: * DiscImageChef.Partitions/Sun.cs: * DiscImageChef.DiscImages/VHD.cs: * DiscImageChef.Partitions/GPT.cs: * DiscImageChef.Filesystems/FFS.cs: * DiscImageChef.Filesystems/FAT.cs: * DiscImageChef.Partitions/NeXT.cs: * DiscImageChef.Devices/Command.cs: * DiscImageChef.DiscImages/Nero.cs: * DiscImageChef.Decoders/CD/PMA.cs: * DiscImageChef.Decoders/CD/TOC.cs: * DiscImageChef.Filesystems/BFS.cs: * DiscImageChef.Filesystems/ODS.cs: * DiscImageChef.Helpers/PrintHex.cs: * DiscImageChef.Helpers/Swapping.cs: * DiscImageChef.Decoders/DVD/PRI.cs: * DiscImageChef.Decoders/DVD/DMI.cs: * DiscImageChef.Decoders/DVD/DDS.cs: * DiscImageChef.Decoders/DVD/RMD.cs: * DiscImageChef.Decoders/DVD/UDI.cs: * DiscImageChef.Partitions/Atari.cs: * DiscImageChef.Decoders/DVD/BCA.cs: * DiscImageChef.Filesystems/SysV.cs: * DiscImageChef.Filesystems/HPFS.cs: * DiscImageChef.Filesystems/NTFS.cs: * DiscImageChef.Filesystems/APFS.cs: * DiscImageChef.Decoders/DVD/PFI.cs: * DiscImageChef.Decoders/CD/ATIP.cs: * DiscImageChef.Filesystems/Acorn.cs: * DiscImageChef.DiscImages/CDRWin.cs: * DiscImageChef.DiscImages/CDRDAO.cs: * DiscImageChef.Filesystems/BTRFS.cs: * DiscImageChef.Decoders/Xbox/DMI.cs: * DiscImageChef.Helpers/ArrayFill.cs: * DiscImageChef.Settings/Settings.cs: * DiscImageChef.Filesystems/Opera.cs: * DiscImageChef.Filesystems/extFS.cs: * DiscImageChef.Decoders/DVD/CPRM.cs: * DiscImageChef.Decoders/DVD/ADIP.cs: * DiscImageChef.Decoders/CD/Enums.cs: * DiscImageChef.Decoders/DVD/AACS.cs: * DiscImageChef.Decoders/SCSI/EVPD.cs: * DiscImageChef.Filesystems/ProDOS.cs: * DiscImageChef.Metadata/MediaType.cs: * DiscImageChef.Console/DicConsole.cs: * DiscImageChef.Decoders/DVD/Spare.cs: * DiscImageChef.Filesystems/ext2FS.cs: * DiscImageChef.Decoders/DVD/Enums.cs: * DiscImageChef.Filesystems/Symbian.cs: * DiscImageChef.Decoders/SCSI/Types.cs: * DiscImageChef.Filesystems/UNIXBFS.cs: * DiscImageChef.DiscImages/TeleDisk.cs: * DiscImageChef.Decoders/SCSI/Sense.cs: * DiscImageChef.Decoders/CD/FullTOC.cs: * DiscImageChef.Decoders/Blu-ray/DI.cs: * DiscImageChef.Decoders/ATA/Errors.cs: * DiscImageChef.Filesystems/ISO9660.cs: * DiscImageChef.Filesystems/MinixFS.cs: * DiscImageChef.Devices/Linux/Enums.cs: * DiscImageChef.Filesystems/SolarFS.cs: * DiscImageChef.Filesystems/Structs.cs: * DiscImageChef.DiscImages/Apple2MG.cs: * DiscImageChef.Decoders/SCSI/Modes.cs: * DiscImageChef.Metadata/Dimensions.cs: * DiscImageChef.Partitions/AppleMap.cs: * DiscImageChef.Decoders/Floppy/ISO.cs: * DiscImageChef.Decoders/DVD/Layers.cs: * DiscImageChef.Decoders/CD/Session.cs: * DiscImageChef.Decoders/SCSI/Enums.cs: * DiscImageChef.Filesystems/Nintendo.cs: * DiscImageChef.Helpers/DateHandlers.cs: * DiscImageChef.Filesystems/AmigaDOS.cs: * DiscImageChef.DiscImages/ImageInfo.cs: * DiscImageChef.Checksums/MD5Context.cs: * DiscImageChef.Devices/Linux/Extern.cs: * DiscImageChef.Filesystems/AppleHFS.cs: * DiscImageChef.Filesystems/AppleMFS.cs: * DiscImageChef.Helpers/ArrayIsEmpty.cs: * DiscImageChef.Decoders/Blu-ray/BCA.cs: * DiscImageChef.Decoders/Blu-ray/DDS.cs: * DiscImageChef.Filesystems/PCEngine.cs: * DiscImageChef.Decoders/ATA/Identify.cs: * DiscImageChef.Devices/Linux/Command.cs: * DiscImageChef.Devices/FreeBSD/Enums.cs: * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Metadata/DeviceReport.cs: * DiscImageChef.Decoders/Floppy/Amiga.cs: * DiscImageChef.Devices/Linux/Structs.cs: * DiscImageChef.Devices/Windows/Enums.cs: * DiscImageChef.Decoders/DVD/CSS&CPRM.cs: * DiscImageChef.Checksums/SHA1Context.cs: * DiscImageChef.DiscImages/DiskCopy42.cs: * DiscImageChef.Partitions/PartPlugin.cs: * DiscImageChef.CommonTypes/Partition.cs: * DiscImageChef.Decoders/Floppy/Enums.cs: * DiscImageChef.CommonTypes/MediaType.cs: * DiscImageChef.Decoders/Floppy/Apple2.cs: * DiscImageChef.Devices/Windows/Extern.cs: * DiscImageChef.Decoders/SCSI/MMC/CPRM.cs: * DiscImageChef.Helpers/StringHandlers.cs: * DiscImageChef.DiscImages/ImagePlugin.cs: * DiscImageChef.Checksums/CRC64Context.cs: * DiscImageChef.Checksums/CRC32Context.cs: * DiscImageChef.DiscImages/ZZZRawImage.cs: * DiscImageChef.Checksums/CRC16Context.cs: * DiscImageChef.Filesystems/LisaFS/Dir.cs: * DiscImageChef.Decoders/DVD/Cartridge.cs: * DiscImageChef.Decoders/Blu-ray/Spare.cs: * DiscImageChef.Filesystems/Filesystem.cs: * DiscImageChef.Decoders/SCSI/MMC/AACS.cs: * DiscImageChef.Devices/FreeBSD/Extern.cs: * DiscImageChef.Devices/Device/Commands.cs: * DiscImageChef.Checksums/SHA384Context.cs: * DiscImageChef.Devices/FreeBSD/Command.cs: * DiscImageChef.Checksums/SHA512Context.cs: * DiscImageChef.Decoders/SCSI/MMC/Enums.cs: * DiscImageChef.Devices/Windows/Command.cs: * DiscImageChef.Devices/FreeBSD/Structs.cs: * DiscImageChef.Devices/Windows/Structs.cs: * DiscImageChef.Filesystems/LisaFS/Info.cs: * DiscImageChef.Checksums/SHA256Context.cs: * DiscImageChef.Filesystems/LisaFS/File.cs: * DiscImageChef.Filesystems/AppleHFSPlus.cs: * DiscImageChef.Filesystems/LisaFS/Super.cs: * DiscImageChef.Filesystems/LisaFS/Xattr.cs: * DiscImageChef.Checksums/Adler32Context.cs: * DiscImageChef.Decoders/Floppy/System34.cs: * DiscImageChef.Checksums/SpamSumContext.cs: * DiscImageChef.Decoders/SCSI/MMC/Hybrid.cs: * DiscImageChef.Devices/Device/Variables.cs: * DiscImageChef.Filesystems/LisaFS/Consts.cs: * DiscImageChef.Filesystems/LisaFS/LisaFS.cs: * DiscImageChef.Decoders/Floppy/Commodore.cs: * DiscImageChef.Checksums/FletcherContext.cs: * DiscImageChef.Filesystems/LisaFS/Extent.cs: * DiscImageChef.Devices/Device/Destructor.cs: * DiscImageChef.Decoders/Floppy/AppleSony.cs: * DiscImageChef.Filesystems/LisaFS/Structs.cs: * DiscImageChef.Decoders/SCSI/VendorString.cs: * DiscImageChef.Decoders/SCSI/MMC/Features.cs: * DiscImageChef.Devices/Device/Constructor.cs: * DiscImageChef.Checksums/RIPEMD160Context.cs: * DiscImageChef.Decoders/CD/CDTextOnLeadIn.cs: * DiscImageChef.Decoders/Blu-ray/Cartridge.cs: * DiscImageChef.Decoders/Floppy/System3740.cs: * DiscImageChef.Filesystems/LisaFS/Encoding.cs: * DiscImageChef.Decoders/SCSI/ModesEncoders.cs: * DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.Helpers/BigEndianBitConverter.cs: * DiscImageChef.Decoders/Floppy/Perpendicular.cs: * DiscImageChef.Decoders/SCSI/SSC/BlockLimits.cs: * DiscImageChef.Decoders/SCSI/MMC/WriteProtect.cs: * DiscImageChef.Devices/Device/ScsiCommands/HP.cs: * DiscImageChef.Devices/Device/AtaCommands/Cfa.cs: * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: * DiscImageChef.Helpers/EndianAwareBinaryReader.cs: * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: * DiscImageChef.Devices/Device/AtaCommands/MCPT.cs: * DiscImageChef.Devices/Device/ScsiCommands/SSC.cs: * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: * DiscImageChef.Devices/Device/ScsiCommands/SMC.cs: * DiscImageChef.Devices/Device/ScsiCommands/SBC.cs: * DiscImageChef.Metadata/Properties/AssemblyInfo.cs: * DiscImageChef.Devices/Device/AtaCommands/Atapi.cs: * DiscImageChef.Devices/Device/AtaCommands/Ata28.cs: * DiscImageChef.Devices/Device/AtaCommands/Smart.cs: * DiscImageChef.Decoders/SCSI/SSC/DensitySupport.cs: * DiscImageChef.Devices/Device/AtaCommands/Ata48.cs: * DiscImageChef.Decoders/SCSI/MMC/DiscInformation.cs: * DiscImageChef.Devices/Device/AtaCommands/AtaCHS.cs: * DiscImageChef.Devices/Device/ScsiCommands/SyQuest.cs: * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: * DiscImageChef.Devices/Device/ScsiCommands/Plasmon.cs: * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: * DiscImageChef.Devices/Device/ScsiCommands/Adaptec.cs: * DiscImageChef.Devices/Device/ScsiCommands/Fujitsu.cs: * DiscImageChef.Devices/Device/ScsiCommands/HL-DT-ST.cs: * DiscImageChef.Devices/Device/ScsiCommands/Certance.cs: * DiscImageChef.Decoders/SCSI/DiscStructureCapabilities.cs: * DiscImageChef.Devices/Device/ScsiCommands/ArchiveCorp.cs: Relicensed as LGPL. Updated standard header. * DiscImageChef/Main.cs: * DiscImageChef/Plugins.cs: * DiscImageChef/Options.cs: * DiscImageChef/Commands/Ls.cs: * DiscImageChef/Core/IBGLog.cs: * DiscImageChef/Core/MHDDLog.cs: * DiscImageChef/AssemblyInfo.cs: * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/Decode.cs: * DiscImageChef/Core/Statistics.cs: * DiscImageChef/Commands/Verify.cs: * DiscImageChef/Commands/Formats.cs: * DiscImageChef/Commands/Entropy.cs: * DiscImageChef/Commands/Compare.cs: * DiscImageChef.Interop/DetectOS.cs: * DiscImageChef/Commands/Analyze.cs: * DiscImageChef/Commands/Commands.cs: * DiscImageChef/Commands/PrintHex.cs: * DiscImageChef/Commands/Checksum.cs: * DiscImageChef/DetectImageFormat.cs: * DiscImageChef/Commands/DumpMedia.cs: * DiscImageChef/Commands/Benchmark.cs: * DiscImageChef/Commands/Configure.cs: * DiscImageChef/Commands/MediaInfo.cs: * DiscImageChef.Interop/PlatformID.cs: * DiscImageChef/Commands/MediaScan.cs: * DiscImageChef/Commands/Statistics.cs: * DiscImageChef/Commands/DeviceInfo.cs: * DiscImageChef.Checksums/ReedSolomon.cs: * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef/Commands/ExtractFiles.cs: * DiscImageChef.Checksums/CDChecksums.cs: * DiscImageChef/Commands/CreateSidecar.cs: Updated standard header. * DiscImageChef.Checksums/DiscImageChef.Checksums.csproj: Relicensed project as LGPL. Updated standard header. Embed license as resource. * DiscImageChef.Console/DiscImageChef.Console.csproj: * DiscImageChef.Devices/DiscImageChef.Devices.csproj: * DiscImageChef.Helpers/DiscImageChef.Helpers.csproj: * DiscImageChef.Settings/DiscImageChef.Settings.csproj: * DiscImageChef.Decoders/DiscImageChef.Decoders.csproj: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: * DiscImageChef.DiscImages/DiscImageChef.DiscImages.csproj: * DiscImageChef.Filesystems/DiscImageChef.Filesystems.csproj: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Relicensed as LGPL. Updated standard header. Embed license as resource. * DiscImageChef/DiscImageChef.csproj: * DiscImageChef.Interop/DiscImageChef.Interop.csproj: Updated standard header. Embed license as resource.
2016-07-28 18:13:49 +01:00
// Author(s) : Natalia Portillo <claunia@claunia.com>
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). * DiscImageChef.Metadata/DeviceReport.cs: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DumpMedia.cs: Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/CreateSidecar.cs: Moved checksum generation to a separate class. * CICMMetadata: Added support for ADIP. * DiscImageChef.CommonTypes/MediaType.cs: Added parameters of UDO media. Moved DataPlay outside of Iomega, as it's not from that manufacturer. Added missing Exatape media and corrected 160m XL one. Added SyJet media. Added all ECMA defined magneto-optical (sectors calculated from specifications, unchecked). Added PD media. Added Imation 320Gb RDX. Added generic USB flash drives. * DiscImageChef.Decoders/SCSI/Enums.cs: Make enumerations public. * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Devices/Device/Constructor.cs: Trim space padded strings on SCSI INQUIRY. * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: Added PREVENT ALLOW MEDIUM REMOVAL. Added START STOP UNIT. * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: Rename NEC methods. * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: Corrected Pioneer transfer length calculation. * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: Renamed Plextor methods. * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with MMC same name but different command. * DiscImageChef.Devices/DiscImageChef.Devices.csproj: Set platform target to x86 (does it really matter?). * DiscImageChef.Devices/Linux/Command.cs: Reduced allocation for readlink() to current kernel MAX_PATH. * DiscImageChef.Devices/Linux/Enums.cs: Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves commands not working on 32-bit environments. * DiscImageChef.DiscImages/ZZZRawImage.cs: Changed ECMA-184 and ECMA-183 enums. * DiscImageChef.Metadata/Dimensions.cs: Added all ECMA defined magneto-opticals. Added PD media. Added 320Gb RDX. Corrected Exatape 160m XL. Added Exatape 22m and 28m. * DiscImageChef.Metadata/MediaType.cs: Added 356mm magneto-optical media. Changed ECMA-184 and ECMA-183 enums. Added USB generic flash drive. * DiscImageChef/Commands/DeviceInfo.cs: Corrected SCSI INQUIRY naming. Corrected SCSI MODE SENSE (6) parameters. Reduced SCSI MODE SENSE timeout, some devices just get stuck with unsupported MODE SENSE commanda and must be left to timeout. Changed FUJITSU vendor string comparison. * DiscImageChef/Commands/MediaInfo.cs: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). Changed some error WriteLine() to debug ones. Too much verbosity. Added DVD media type decoding from PFI. Found a drive that dumps ADIP, enabling it again (not decoded). * DiscImageChef/Commands/MediaScan.cs: Added option to generate ImgBurn compatible log to media-scan command. * DiscImageChef/DiscImageChef.csproj: Moved checksum generation to a separate class. Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Main.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Options.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. Added option to generate ImgBurn compatible log to media-scan command.
2016-01-31 08:05:56 +00:00
//
2020-03-11 21:56:55 +00:00
// Component : Commands.
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). * DiscImageChef.Metadata/DeviceReport.cs: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DumpMedia.cs: Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/CreateSidecar.cs: Moved checksum generation to a separate class. * CICMMetadata: Added support for ADIP. * DiscImageChef.CommonTypes/MediaType.cs: Added parameters of UDO media. Moved DataPlay outside of Iomega, as it's not from that manufacturer. Added missing Exatape media and corrected 160m XL one. Added SyJet media. Added all ECMA defined magneto-optical (sectors calculated from specifications, unchecked). Added PD media. Added Imation 320Gb RDX. Added generic USB flash drives. * DiscImageChef.Decoders/SCSI/Enums.cs: Make enumerations public. * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Devices/Device/Constructor.cs: Trim space padded strings on SCSI INQUIRY. * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: Added PREVENT ALLOW MEDIUM REMOVAL. Added START STOP UNIT. * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: Rename NEC methods. * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: Corrected Pioneer transfer length calculation. * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: Renamed Plextor methods. * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with MMC same name but different command. * DiscImageChef.Devices/DiscImageChef.Devices.csproj: Set platform target to x86 (does it really matter?). * DiscImageChef.Devices/Linux/Command.cs: Reduced allocation for readlink() to current kernel MAX_PATH. * DiscImageChef.Devices/Linux/Enums.cs: Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves commands not working on 32-bit environments. * DiscImageChef.DiscImages/ZZZRawImage.cs: Changed ECMA-184 and ECMA-183 enums. * DiscImageChef.Metadata/Dimensions.cs: Added all ECMA defined magneto-opticals. Added PD media. Added 320Gb RDX. Corrected Exatape 160m XL. Added Exatape 22m and 28m. * DiscImageChef.Metadata/MediaType.cs: Added 356mm magneto-optical media. Changed ECMA-184 and ECMA-183 enums. Added USB generic flash drive. * DiscImageChef/Commands/DeviceInfo.cs: Corrected SCSI INQUIRY naming. Corrected SCSI MODE SENSE (6) parameters. Reduced SCSI MODE SENSE timeout, some devices just get stuck with unsupported MODE SENSE commanda and must be left to timeout. Changed FUJITSU vendor string comparison. * DiscImageChef/Commands/MediaInfo.cs: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). Changed some error WriteLine() to debug ones. Too much verbosity. Added DVD media type decoding from PFI. Found a drive that dumps ADIP, enabling it again (not decoded). * DiscImageChef/Commands/MediaScan.cs: Added option to generate ImgBurn compatible log to media-scan command. * DiscImageChef/DiscImageChef.csproj: Moved checksum generation to a separate class. Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Main.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Options.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. Added option to generate ImgBurn compatible log to media-scan command.
2016-01-31 08:05:56 +00:00
//
// --[ Description ] ----------------------------------------------------------
//
2020-03-11 21:56:55 +00:00
// Implements the 'report' command.
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). * DiscImageChef.Metadata/DeviceReport.cs: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DumpMedia.cs: Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/CreateSidecar.cs: Moved checksum generation to a separate class. * CICMMetadata: Added support for ADIP. * DiscImageChef.CommonTypes/MediaType.cs: Added parameters of UDO media. Moved DataPlay outside of Iomega, as it's not from that manufacturer. Added missing Exatape media and corrected 160m XL one. Added SyJet media. Added all ECMA defined magneto-optical (sectors calculated from specifications, unchecked). Added PD media. Added Imation 320Gb RDX. Added generic USB flash drives. * DiscImageChef.Decoders/SCSI/Enums.cs: Make enumerations public. * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Devices/Device/Constructor.cs: Trim space padded strings on SCSI INQUIRY. * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: Added PREVENT ALLOW MEDIUM REMOVAL. Added START STOP UNIT. * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: Rename NEC methods. * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: Corrected Pioneer transfer length calculation. * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: Renamed Plextor methods. * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with MMC same name but different command. * DiscImageChef.Devices/DiscImageChef.Devices.csproj: Set platform target to x86 (does it really matter?). * DiscImageChef.Devices/Linux/Command.cs: Reduced allocation for readlink() to current kernel MAX_PATH. * DiscImageChef.Devices/Linux/Enums.cs: Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves commands not working on 32-bit environments. * DiscImageChef.DiscImages/ZZZRawImage.cs: Changed ECMA-184 and ECMA-183 enums. * DiscImageChef.Metadata/Dimensions.cs: Added all ECMA defined magneto-opticals. Added PD media. Added 320Gb RDX. Corrected Exatape 160m XL. Added Exatape 22m and 28m. * DiscImageChef.Metadata/MediaType.cs: Added 356mm magneto-optical media. Changed ECMA-184 and ECMA-183 enums. Added USB generic flash drive. * DiscImageChef/Commands/DeviceInfo.cs: Corrected SCSI INQUIRY naming. Corrected SCSI MODE SENSE (6) parameters. Reduced SCSI MODE SENSE timeout, some devices just get stuck with unsupported MODE SENSE commanda and must be left to timeout. Changed FUJITSU vendor string comparison. * DiscImageChef/Commands/MediaInfo.cs: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). Changed some error WriteLine() to debug ones. Too much verbosity. Added DVD media type decoding from PFI. Found a drive that dumps ADIP, enabling it again (not decoded). * DiscImageChef/Commands/MediaScan.cs: Added option to generate ImgBurn compatible log to media-scan command. * DiscImageChef/DiscImageChef.csproj: Moved checksum generation to a separate class. Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Main.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Options.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. Added option to generate ImgBurn compatible log to media-scan command.
2016-01-31 08:05:56 +00:00
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
2022-02-18 10:02:53 +00:00
// Copyright © 2011-2022 Natalia Portillo
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). * DiscImageChef.Metadata/DeviceReport.cs: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DumpMedia.cs: Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/CreateSidecar.cs: Moved checksum generation to a separate class. * CICMMetadata: Added support for ADIP. * DiscImageChef.CommonTypes/MediaType.cs: Added parameters of UDO media. Moved DataPlay outside of Iomega, as it's not from that manufacturer. Added missing Exatape media and corrected 160m XL one. Added SyJet media. Added all ECMA defined magneto-optical (sectors calculated from specifications, unchecked). Added PD media. Added Imation 320Gb RDX. Added generic USB flash drives. * DiscImageChef.Decoders/SCSI/Enums.cs: Make enumerations public. * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Devices/Device/Constructor.cs: Trim space padded strings on SCSI INQUIRY. * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: Added PREVENT ALLOW MEDIUM REMOVAL. Added START STOP UNIT. * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: Rename NEC methods. * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: Corrected Pioneer transfer length calculation. * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: Renamed Plextor methods. * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with MMC same name but different command. * DiscImageChef.Devices/DiscImageChef.Devices.csproj: Set platform target to x86 (does it really matter?). * DiscImageChef.Devices/Linux/Command.cs: Reduced allocation for readlink() to current kernel MAX_PATH. * DiscImageChef.Devices/Linux/Enums.cs: Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves commands not working on 32-bit environments. * DiscImageChef.DiscImages/ZZZRawImage.cs: Changed ECMA-184 and ECMA-183 enums. * DiscImageChef.Metadata/Dimensions.cs: Added all ECMA defined magneto-opticals. Added PD media. Added 320Gb RDX. Corrected Exatape 160m XL. Added Exatape 22m and 28m. * DiscImageChef.Metadata/MediaType.cs: Added 356mm magneto-optical media. Changed ECMA-184 and ECMA-183 enums. Added USB generic flash drive. * DiscImageChef/Commands/DeviceInfo.cs: Corrected SCSI INQUIRY naming. Corrected SCSI MODE SENSE (6) parameters. Reduced SCSI MODE SENSE timeout, some devices just get stuck with unsupported MODE SENSE commanda and must be left to timeout. Changed FUJITSU vendor string comparison. * DiscImageChef/Commands/MediaInfo.cs: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). Changed some error WriteLine() to debug ones. Too much verbosity. Added DVD media type decoding from PFI. Found a drive that dumps ADIP, enabling it again (not decoded). * DiscImageChef/Commands/MediaScan.cs: Added option to generate ImgBurn compatible log to media-scan command. * DiscImageChef/DiscImageChef.csproj: Moved checksum generation to a separate class. Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Main.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Options.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. Added option to generate ImgBurn compatible log to media-scan command.
2016-01-31 08:05:56 +00:00
// ****************************************************************************/
* LICENSE.MIT: * LICENSE.LGPL: Added LICENSE files for LGPL and MIT licenses. * DiscImageChef.Devices/Enums.cs: * DiscImageChef.Partitions/MBR.cs: * DiscImageChef.Partitions/RDB.cs: * DiscImageChef.DiscImages/GDI.cs: * DiscImageChef.Partitions/Sun.cs: * DiscImageChef.DiscImages/VHD.cs: * DiscImageChef.Partitions/GPT.cs: * DiscImageChef.Filesystems/FFS.cs: * DiscImageChef.Filesystems/FAT.cs: * DiscImageChef.Partitions/NeXT.cs: * DiscImageChef.Devices/Command.cs: * DiscImageChef.DiscImages/Nero.cs: * DiscImageChef.Decoders/CD/PMA.cs: * DiscImageChef.Decoders/CD/TOC.cs: * DiscImageChef.Filesystems/BFS.cs: * DiscImageChef.Filesystems/ODS.cs: * DiscImageChef.Helpers/PrintHex.cs: * DiscImageChef.Helpers/Swapping.cs: * DiscImageChef.Decoders/DVD/PRI.cs: * DiscImageChef.Decoders/DVD/DMI.cs: * DiscImageChef.Decoders/DVD/DDS.cs: * DiscImageChef.Decoders/DVD/RMD.cs: * DiscImageChef.Decoders/DVD/UDI.cs: * DiscImageChef.Partitions/Atari.cs: * DiscImageChef.Decoders/DVD/BCA.cs: * DiscImageChef.Filesystems/SysV.cs: * DiscImageChef.Filesystems/HPFS.cs: * DiscImageChef.Filesystems/NTFS.cs: * DiscImageChef.Filesystems/APFS.cs: * DiscImageChef.Decoders/DVD/PFI.cs: * DiscImageChef.Decoders/CD/ATIP.cs: * DiscImageChef.Filesystems/Acorn.cs: * DiscImageChef.DiscImages/CDRWin.cs: * DiscImageChef.DiscImages/CDRDAO.cs: * DiscImageChef.Filesystems/BTRFS.cs: * DiscImageChef.Decoders/Xbox/DMI.cs: * DiscImageChef.Helpers/ArrayFill.cs: * DiscImageChef.Settings/Settings.cs: * DiscImageChef.Filesystems/Opera.cs: * DiscImageChef.Filesystems/extFS.cs: * DiscImageChef.Decoders/DVD/CPRM.cs: * DiscImageChef.Decoders/DVD/ADIP.cs: * DiscImageChef.Decoders/CD/Enums.cs: * DiscImageChef.Decoders/DVD/AACS.cs: * DiscImageChef.Decoders/SCSI/EVPD.cs: * DiscImageChef.Filesystems/ProDOS.cs: * DiscImageChef.Metadata/MediaType.cs: * DiscImageChef.Console/DicConsole.cs: * DiscImageChef.Decoders/DVD/Spare.cs: * DiscImageChef.Filesystems/ext2FS.cs: * DiscImageChef.Decoders/DVD/Enums.cs: * DiscImageChef.Filesystems/Symbian.cs: * DiscImageChef.Decoders/SCSI/Types.cs: * DiscImageChef.Filesystems/UNIXBFS.cs: * DiscImageChef.DiscImages/TeleDisk.cs: * DiscImageChef.Decoders/SCSI/Sense.cs: * DiscImageChef.Decoders/CD/FullTOC.cs: * DiscImageChef.Decoders/Blu-ray/DI.cs: * DiscImageChef.Decoders/ATA/Errors.cs: * DiscImageChef.Filesystems/ISO9660.cs: * DiscImageChef.Filesystems/MinixFS.cs: * DiscImageChef.Devices/Linux/Enums.cs: * DiscImageChef.Filesystems/SolarFS.cs: * DiscImageChef.Filesystems/Structs.cs: * DiscImageChef.DiscImages/Apple2MG.cs: * DiscImageChef.Decoders/SCSI/Modes.cs: * DiscImageChef.Metadata/Dimensions.cs: * DiscImageChef.Partitions/AppleMap.cs: * DiscImageChef.Decoders/Floppy/ISO.cs: * DiscImageChef.Decoders/DVD/Layers.cs: * DiscImageChef.Decoders/CD/Session.cs: * DiscImageChef.Decoders/SCSI/Enums.cs: * DiscImageChef.Filesystems/Nintendo.cs: * DiscImageChef.Helpers/DateHandlers.cs: * DiscImageChef.Filesystems/AmigaDOS.cs: * DiscImageChef.DiscImages/ImageInfo.cs: * DiscImageChef.Checksums/MD5Context.cs: * DiscImageChef.Devices/Linux/Extern.cs: * DiscImageChef.Filesystems/AppleHFS.cs: * DiscImageChef.Filesystems/AppleMFS.cs: * DiscImageChef.Helpers/ArrayIsEmpty.cs: * DiscImageChef.Decoders/Blu-ray/BCA.cs: * DiscImageChef.Decoders/Blu-ray/DDS.cs: * DiscImageChef.Filesystems/PCEngine.cs: * DiscImageChef.Decoders/ATA/Identify.cs: * DiscImageChef.Devices/Linux/Command.cs: * DiscImageChef.Devices/FreeBSD/Enums.cs: * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Metadata/DeviceReport.cs: * DiscImageChef.Decoders/Floppy/Amiga.cs: * DiscImageChef.Devices/Linux/Structs.cs: * DiscImageChef.Devices/Windows/Enums.cs: * DiscImageChef.Decoders/DVD/CSS&CPRM.cs: * DiscImageChef.Checksums/SHA1Context.cs: * DiscImageChef.DiscImages/DiskCopy42.cs: * DiscImageChef.Partitions/PartPlugin.cs: * DiscImageChef.CommonTypes/Partition.cs: * DiscImageChef.Decoders/Floppy/Enums.cs: * DiscImageChef.CommonTypes/MediaType.cs: * DiscImageChef.Decoders/Floppy/Apple2.cs: * DiscImageChef.Devices/Windows/Extern.cs: * DiscImageChef.Decoders/SCSI/MMC/CPRM.cs: * DiscImageChef.Helpers/StringHandlers.cs: * DiscImageChef.DiscImages/ImagePlugin.cs: * DiscImageChef.Checksums/CRC64Context.cs: * DiscImageChef.Checksums/CRC32Context.cs: * DiscImageChef.DiscImages/ZZZRawImage.cs: * DiscImageChef.Checksums/CRC16Context.cs: * DiscImageChef.Filesystems/LisaFS/Dir.cs: * DiscImageChef.Decoders/DVD/Cartridge.cs: * DiscImageChef.Decoders/Blu-ray/Spare.cs: * DiscImageChef.Filesystems/Filesystem.cs: * DiscImageChef.Decoders/SCSI/MMC/AACS.cs: * DiscImageChef.Devices/FreeBSD/Extern.cs: * DiscImageChef.Devices/Device/Commands.cs: * DiscImageChef.Checksums/SHA384Context.cs: * DiscImageChef.Devices/FreeBSD/Command.cs: * DiscImageChef.Checksums/SHA512Context.cs: * DiscImageChef.Decoders/SCSI/MMC/Enums.cs: * DiscImageChef.Devices/Windows/Command.cs: * DiscImageChef.Devices/FreeBSD/Structs.cs: * DiscImageChef.Devices/Windows/Structs.cs: * DiscImageChef.Filesystems/LisaFS/Info.cs: * DiscImageChef.Checksums/SHA256Context.cs: * DiscImageChef.Filesystems/LisaFS/File.cs: * DiscImageChef.Filesystems/AppleHFSPlus.cs: * DiscImageChef.Filesystems/LisaFS/Super.cs: * DiscImageChef.Filesystems/LisaFS/Xattr.cs: * DiscImageChef.Checksums/Adler32Context.cs: * DiscImageChef.Decoders/Floppy/System34.cs: * DiscImageChef.Checksums/SpamSumContext.cs: * DiscImageChef.Decoders/SCSI/MMC/Hybrid.cs: * DiscImageChef.Devices/Device/Variables.cs: * DiscImageChef.Filesystems/LisaFS/Consts.cs: * DiscImageChef.Filesystems/LisaFS/LisaFS.cs: * DiscImageChef.Decoders/Floppy/Commodore.cs: * DiscImageChef.Checksums/FletcherContext.cs: * DiscImageChef.Filesystems/LisaFS/Extent.cs: * DiscImageChef.Devices/Device/Destructor.cs: * DiscImageChef.Decoders/Floppy/AppleSony.cs: * DiscImageChef.Filesystems/LisaFS/Structs.cs: * DiscImageChef.Decoders/SCSI/VendorString.cs: * DiscImageChef.Decoders/SCSI/MMC/Features.cs: * DiscImageChef.Devices/Device/Constructor.cs: * DiscImageChef.Checksums/RIPEMD160Context.cs: * DiscImageChef.Decoders/CD/CDTextOnLeadIn.cs: * DiscImageChef.Decoders/Blu-ray/Cartridge.cs: * DiscImageChef.Decoders/Floppy/System3740.cs: * DiscImageChef.Filesystems/LisaFS/Encoding.cs: * DiscImageChef.Decoders/SCSI/ModesEncoders.cs: * DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.Helpers/BigEndianBitConverter.cs: * DiscImageChef.Decoders/Floppy/Perpendicular.cs: * DiscImageChef.Decoders/SCSI/SSC/BlockLimits.cs: * DiscImageChef.Decoders/SCSI/MMC/WriteProtect.cs: * DiscImageChef.Devices/Device/ScsiCommands/HP.cs: * DiscImageChef.Devices/Device/AtaCommands/Cfa.cs: * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: * DiscImageChef.Helpers/EndianAwareBinaryReader.cs: * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: * DiscImageChef.Devices/Device/AtaCommands/MCPT.cs: * DiscImageChef.Devices/Device/ScsiCommands/SSC.cs: * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: * DiscImageChef.Devices/Device/ScsiCommands/SMC.cs: * DiscImageChef.Devices/Device/ScsiCommands/SBC.cs: * DiscImageChef.Metadata/Properties/AssemblyInfo.cs: * DiscImageChef.Devices/Device/AtaCommands/Atapi.cs: * DiscImageChef.Devices/Device/AtaCommands/Ata28.cs: * DiscImageChef.Devices/Device/AtaCommands/Smart.cs: * DiscImageChef.Decoders/SCSI/SSC/DensitySupport.cs: * DiscImageChef.Devices/Device/AtaCommands/Ata48.cs: * DiscImageChef.Decoders/SCSI/MMC/DiscInformation.cs: * DiscImageChef.Devices/Device/AtaCommands/AtaCHS.cs: * DiscImageChef.Devices/Device/ScsiCommands/SyQuest.cs: * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: * DiscImageChef.Devices/Device/ScsiCommands/Plasmon.cs: * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: * DiscImageChef.Devices/Device/ScsiCommands/Adaptec.cs: * DiscImageChef.Devices/Device/ScsiCommands/Fujitsu.cs: * DiscImageChef.Devices/Device/ScsiCommands/HL-DT-ST.cs: * DiscImageChef.Devices/Device/ScsiCommands/Certance.cs: * DiscImageChef.Decoders/SCSI/DiscStructureCapabilities.cs: * DiscImageChef.Devices/Device/ScsiCommands/ArchiveCorp.cs: Relicensed as LGPL. Updated standard header. * DiscImageChef/Main.cs: * DiscImageChef/Plugins.cs: * DiscImageChef/Options.cs: * DiscImageChef/Commands/Ls.cs: * DiscImageChef/Core/IBGLog.cs: * DiscImageChef/Core/MHDDLog.cs: * DiscImageChef/AssemblyInfo.cs: * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/Decode.cs: * DiscImageChef/Core/Statistics.cs: * DiscImageChef/Commands/Verify.cs: * DiscImageChef/Commands/Formats.cs: * DiscImageChef/Commands/Entropy.cs: * DiscImageChef/Commands/Compare.cs: * DiscImageChef.Interop/DetectOS.cs: * DiscImageChef/Commands/Analyze.cs: * DiscImageChef/Commands/Commands.cs: * DiscImageChef/Commands/PrintHex.cs: * DiscImageChef/Commands/Checksum.cs: * DiscImageChef/DetectImageFormat.cs: * DiscImageChef/Commands/DumpMedia.cs: * DiscImageChef/Commands/Benchmark.cs: * DiscImageChef/Commands/Configure.cs: * DiscImageChef/Commands/MediaInfo.cs: * DiscImageChef.Interop/PlatformID.cs: * DiscImageChef/Commands/MediaScan.cs: * DiscImageChef/Commands/Statistics.cs: * DiscImageChef/Commands/DeviceInfo.cs: * DiscImageChef.Checksums/ReedSolomon.cs: * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef/Commands/ExtractFiles.cs: * DiscImageChef.Checksums/CDChecksums.cs: * DiscImageChef/Commands/CreateSidecar.cs: Updated standard header. * DiscImageChef.Checksums/DiscImageChef.Checksums.csproj: Relicensed project as LGPL. Updated standard header. Embed license as resource. * DiscImageChef.Console/DiscImageChef.Console.csproj: * DiscImageChef.Devices/DiscImageChef.Devices.csproj: * DiscImageChef.Helpers/DiscImageChef.Helpers.csproj: * DiscImageChef.Settings/DiscImageChef.Settings.csproj: * DiscImageChef.Decoders/DiscImageChef.Decoders.csproj: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: * DiscImageChef.DiscImages/DiscImageChef.DiscImages.csproj: * DiscImageChef.Filesystems/DiscImageChef.Filesystems.csproj: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Relicensed as LGPL. Updated standard header. Embed license as resource. * DiscImageChef/DiscImageChef.csproj: * DiscImageChef.Interop/DiscImageChef.Interop.csproj: Updated standard header. Embed license as resource.
2016-07-28 18:13:49 +01:00
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). * DiscImageChef.Metadata/DeviceReport.cs: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DumpMedia.cs: Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/CreateSidecar.cs: Moved checksum generation to a separate class. * CICMMetadata: Added support for ADIP. * DiscImageChef.CommonTypes/MediaType.cs: Added parameters of UDO media. Moved DataPlay outside of Iomega, as it's not from that manufacturer. Added missing Exatape media and corrected 160m XL one. Added SyJet media. Added all ECMA defined magneto-optical (sectors calculated from specifications, unchecked). Added PD media. Added Imation 320Gb RDX. Added generic USB flash drives. * DiscImageChef.Decoders/SCSI/Enums.cs: Make enumerations public. * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Devices/Device/Constructor.cs: Trim space padded strings on SCSI INQUIRY. * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: Added PREVENT ALLOW MEDIUM REMOVAL. Added START STOP UNIT. * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: Rename NEC methods. * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: Corrected Pioneer transfer length calculation. * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: Renamed Plextor methods. * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with MMC same name but different command. * DiscImageChef.Devices/DiscImageChef.Devices.csproj: Set platform target to x86 (does it really matter?). * DiscImageChef.Devices/Linux/Command.cs: Reduced allocation for readlink() to current kernel MAX_PATH. * DiscImageChef.Devices/Linux/Enums.cs: Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves commands not working on 32-bit environments. * DiscImageChef.DiscImages/ZZZRawImage.cs: Changed ECMA-184 and ECMA-183 enums. * DiscImageChef.Metadata/Dimensions.cs: Added all ECMA defined magneto-opticals. Added PD media. Added 320Gb RDX. Corrected Exatape 160m XL. Added Exatape 22m and 28m. * DiscImageChef.Metadata/MediaType.cs: Added 356mm magneto-optical media. Changed ECMA-184 and ECMA-183 enums. Added USB generic flash drive. * DiscImageChef/Commands/DeviceInfo.cs: Corrected SCSI INQUIRY naming. Corrected SCSI MODE SENSE (6) parameters. Reduced SCSI MODE SENSE timeout, some devices just get stuck with unsupported MODE SENSE commanda and must be left to timeout. Changed FUJITSU vendor string comparison. * DiscImageChef/Commands/MediaInfo.cs: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). Changed some error WriteLine() to debug ones. Too much verbosity. Added DVD media type decoding from PFI. Found a drive that dumps ADIP, enabling it again (not decoded). * DiscImageChef/Commands/MediaScan.cs: Added option to generate ImgBurn compatible log to media-scan command. * DiscImageChef/DiscImageChef.csproj: Moved checksum generation to a separate class. Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Main.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Options.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. Added option to generate ImgBurn compatible log to media-scan command.
2016-01-31 08:05:56 +00:00
using System;
using System.Collections.Generic;
using System.CommandLine;
2022-04-10 12:54:04 +01:00
using System.CommandLine.NamingConventionBinder;
using System.IO;
using System.Linq;
using System.Threading;
2020-02-27 00:33:26 +00:00
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Interop;
using Aaru.CommonTypes.Metadata;
using Aaru.CommonTypes.Structs.Devices.ATA;
using Aaru.CommonTypes.Structs.Devices.SCSI;
using Aaru.Console;
using Aaru.Core;
using Aaru.Database;
using Aaru.Database.Models;
using Aaru.Decoders.SCSI;
using Aaru.Decoders.SCSI.MMC;
2020-07-20 15:43:52 +01:00
using Aaru.Helpers;
using Aaru.Localization;
using Newtonsoft.Json;
2021-09-13 18:08:44 +01:00
using Spectre.Console;
using Command = System.CommandLine.Command;
2020-02-27 00:33:26 +00:00
using DeviceReport = Aaru.Core.Devices.Report.DeviceReport;
2021-09-13 18:08:44 +01:00
using Profile = Aaru.Decoders.SCSI.MMC.Profile;
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). * DiscImageChef.Metadata/DeviceReport.cs: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DumpMedia.cs: Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/CreateSidecar.cs: Moved checksum generation to a separate class. * CICMMetadata: Added support for ADIP. * DiscImageChef.CommonTypes/MediaType.cs: Added parameters of UDO media. Moved DataPlay outside of Iomega, as it's not from that manufacturer. Added missing Exatape media and corrected 160m XL one. Added SyJet media. Added all ECMA defined magneto-optical (sectors calculated from specifications, unchecked). Added PD media. Added Imation 320Gb RDX. Added generic USB flash drives. * DiscImageChef.Decoders/SCSI/Enums.cs: Make enumerations public. * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Devices/Device/Constructor.cs: Trim space padded strings on SCSI INQUIRY. * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: Added PREVENT ALLOW MEDIUM REMOVAL. Added START STOP UNIT. * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: Rename NEC methods. * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: Corrected Pioneer transfer length calculation. * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: Renamed Plextor methods. * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with MMC same name but different command. * DiscImageChef.Devices/DiscImageChef.Devices.csproj: Set platform target to x86 (does it really matter?). * DiscImageChef.Devices/Linux/Command.cs: Reduced allocation for readlink() to current kernel MAX_PATH. * DiscImageChef.Devices/Linux/Enums.cs: Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves commands not working on 32-bit environments. * DiscImageChef.DiscImages/ZZZRawImage.cs: Changed ECMA-184 and ECMA-183 enums. * DiscImageChef.Metadata/Dimensions.cs: Added all ECMA defined magneto-opticals. Added PD media. Added 320Gb RDX. Corrected Exatape 160m XL. Added Exatape 22m and 28m. * DiscImageChef.Metadata/MediaType.cs: Added 356mm magneto-optical media. Changed ECMA-184 and ECMA-183 enums. Added USB generic flash drive. * DiscImageChef/Commands/DeviceInfo.cs: Corrected SCSI INQUIRY naming. Corrected SCSI MODE SENSE (6) parameters. Reduced SCSI MODE SENSE timeout, some devices just get stuck with unsupported MODE SENSE commanda and must be left to timeout. Changed FUJITSU vendor string comparison. * DiscImageChef/Commands/MediaInfo.cs: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). Changed some error WriteLine() to debug ones. Too much verbosity. Added DVD media type decoding from PFI. Found a drive that dumps ADIP, enabling it again (not decoded). * DiscImageChef/Commands/MediaScan.cs: Added option to generate ImgBurn compatible log to media-scan command. * DiscImageChef/DiscImageChef.csproj: Moved checksum generation to a separate class. Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Main.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Options.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. Added option to generate ImgBurn compatible log to media-scan command.
2016-01-31 08:05:56 +00:00
namespace Aaru.Commands.Device;
2022-03-07 07:36:44 +00:00
sealed class DeviceReportCommand : Command
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). * DiscImageChef.Metadata/DeviceReport.cs: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DumpMedia.cs: Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/CreateSidecar.cs: Moved checksum generation to a separate class. * CICMMetadata: Added support for ADIP. * DiscImageChef.CommonTypes/MediaType.cs: Added parameters of UDO media. Moved DataPlay outside of Iomega, as it's not from that manufacturer. Added missing Exatape media and corrected 160m XL one. Added SyJet media. Added all ECMA defined magneto-optical (sectors calculated from specifications, unchecked). Added PD media. Added Imation 320Gb RDX. Added generic USB flash drives. * DiscImageChef.Decoders/SCSI/Enums.cs: Make enumerations public. * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Devices/Device/Constructor.cs: Trim space padded strings on SCSI INQUIRY. * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: Added PREVENT ALLOW MEDIUM REMOVAL. Added START STOP UNIT. * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: Rename NEC methods. * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: Corrected Pioneer transfer length calculation. * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: Renamed Plextor methods. * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with MMC same name but different command. * DiscImageChef.Devices/DiscImageChef.Devices.csproj: Set platform target to x86 (does it really matter?). * DiscImageChef.Devices/Linux/Command.cs: Reduced allocation for readlink() to current kernel MAX_PATH. * DiscImageChef.Devices/Linux/Enums.cs: Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves commands not working on 32-bit environments. * DiscImageChef.DiscImages/ZZZRawImage.cs: Changed ECMA-184 and ECMA-183 enums. * DiscImageChef.Metadata/Dimensions.cs: Added all ECMA defined magneto-opticals. Added PD media. Added 320Gb RDX. Corrected Exatape 160m XL. Added Exatape 22m and 28m. * DiscImageChef.Metadata/MediaType.cs: Added 356mm magneto-optical media. Changed ECMA-184 and ECMA-183 enums. Added USB generic flash drive. * DiscImageChef/Commands/DeviceInfo.cs: Corrected SCSI INQUIRY naming. Corrected SCSI MODE SENSE (6) parameters. Reduced SCSI MODE SENSE timeout, some devices just get stuck with unsupported MODE SENSE commanda and must be left to timeout. Changed FUJITSU vendor string comparison. * DiscImageChef/Commands/MediaInfo.cs: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). Changed some error WriteLine() to debug ones. Too much verbosity. Added DVD media type decoding from PFI. Found a drive that dumps ADIP, enabling it again (not decoded). * DiscImageChef/Commands/MediaScan.cs: Added option to generate ImgBurn compatible log to media-scan command. * DiscImageChef/DiscImageChef.csproj: Moved checksum generation to a separate class. Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Main.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Options.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. Added option to generate ImgBurn compatible log to media-scan command.
2016-01-31 08:05:56 +00:00
{
public DeviceReportCommand() : base("report", UI.Device_Report_Command_Description)
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). * DiscImageChef.Metadata/DeviceReport.cs: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DumpMedia.cs: Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/CreateSidecar.cs: Moved checksum generation to a separate class. * CICMMetadata: Added support for ADIP. * DiscImageChef.CommonTypes/MediaType.cs: Added parameters of UDO media. Moved DataPlay outside of Iomega, as it's not from that manufacturer. Added missing Exatape media and corrected 160m XL one. Added SyJet media. Added all ECMA defined magneto-optical (sectors calculated from specifications, unchecked). Added PD media. Added Imation 320Gb RDX. Added generic USB flash drives. * DiscImageChef.Decoders/SCSI/Enums.cs: Make enumerations public. * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Devices/Device/Constructor.cs: Trim space padded strings on SCSI INQUIRY. * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: Added PREVENT ALLOW MEDIUM REMOVAL. Added START STOP UNIT. * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: Rename NEC methods. * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: Corrected Pioneer transfer length calculation. * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: Renamed Plextor methods. * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with MMC same name but different command. * DiscImageChef.Devices/DiscImageChef.Devices.csproj: Set platform target to x86 (does it really matter?). * DiscImageChef.Devices/Linux/Command.cs: Reduced allocation for readlink() to current kernel MAX_PATH. * DiscImageChef.Devices/Linux/Enums.cs: Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves commands not working on 32-bit environments. * DiscImageChef.DiscImages/ZZZRawImage.cs: Changed ECMA-184 and ECMA-183 enums. * DiscImageChef.Metadata/Dimensions.cs: Added all ECMA defined magneto-opticals. Added PD media. Added 320Gb RDX. Corrected Exatape 160m XL. Added Exatape 22m and 28m. * DiscImageChef.Metadata/MediaType.cs: Added 356mm magneto-optical media. Changed ECMA-184 and ECMA-183 enums. Added USB generic flash drive. * DiscImageChef/Commands/DeviceInfo.cs: Corrected SCSI INQUIRY naming. Corrected SCSI MODE SENSE (6) parameters. Reduced SCSI MODE SENSE timeout, some devices just get stuck with unsupported MODE SENSE commanda and must be left to timeout. Changed FUJITSU vendor string comparison. * DiscImageChef/Commands/MediaInfo.cs: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). Changed some error WriteLine() to debug ones. Too much verbosity. Added DVD media type decoding from PFI. Found a drive that dumps ADIP, enabling it again (not decoded). * DiscImageChef/Commands/MediaScan.cs: Added option to generate ImgBurn compatible log to media-scan command. * DiscImageChef/DiscImageChef.csproj: Moved checksum generation to a separate class. Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Main.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Options.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. Added option to generate ImgBurn compatible log to media-scan command.
2016-01-31 08:05:56 +00:00
{
2022-03-06 13:29:38 +00:00
AddArgument(new Argument<string>
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). * DiscImageChef.Metadata/DeviceReport.cs: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DumpMedia.cs: Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/CreateSidecar.cs: Moved checksum generation to a separate class. * CICMMetadata: Added support for ADIP. * DiscImageChef.CommonTypes/MediaType.cs: Added parameters of UDO media. Moved DataPlay outside of Iomega, as it's not from that manufacturer. Added missing Exatape media and corrected 160m XL one. Added SyJet media. Added all ECMA defined magneto-optical (sectors calculated from specifications, unchecked). Added PD media. Added Imation 320Gb RDX. Added generic USB flash drives. * DiscImageChef.Decoders/SCSI/Enums.cs: Make enumerations public. * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Devices/Device/Constructor.cs: Trim space padded strings on SCSI INQUIRY. * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: Added PREVENT ALLOW MEDIUM REMOVAL. Added START STOP UNIT. * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: Rename NEC methods. * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: Corrected Pioneer transfer length calculation. * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: Renamed Plextor methods. * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with MMC same name but different command. * DiscImageChef.Devices/DiscImageChef.Devices.csproj: Set platform target to x86 (does it really matter?). * DiscImageChef.Devices/Linux/Command.cs: Reduced allocation for readlink() to current kernel MAX_PATH. * DiscImageChef.Devices/Linux/Enums.cs: Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves commands not working on 32-bit environments. * DiscImageChef.DiscImages/ZZZRawImage.cs: Changed ECMA-184 and ECMA-183 enums. * DiscImageChef.Metadata/Dimensions.cs: Added all ECMA defined magneto-opticals. Added PD media. Added 320Gb RDX. Corrected Exatape 160m XL. Added Exatape 22m and 28m. * DiscImageChef.Metadata/MediaType.cs: Added 356mm magneto-optical media. Changed ECMA-184 and ECMA-183 enums. Added USB generic flash drive. * DiscImageChef/Commands/DeviceInfo.cs: Corrected SCSI INQUIRY naming. Corrected SCSI MODE SENSE (6) parameters. Reduced SCSI MODE SENSE timeout, some devices just get stuck with unsupported MODE SENSE commanda and must be left to timeout. Changed FUJITSU vendor string comparison. * DiscImageChef/Commands/MediaInfo.cs: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). Changed some error WriteLine() to debug ones. Too much verbosity. Added DVD media type decoding from PFI. Found a drive that dumps ADIP, enabling it again (not decoded). * DiscImageChef/Commands/MediaScan.cs: Added option to generate ImgBurn compatible log to media-scan command. * DiscImageChef/DiscImageChef.csproj: Moved checksum generation to a separate class. Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Main.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Options.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. Added option to generate ImgBurn compatible log to media-scan command.
2016-01-31 08:05:56 +00:00
{
2022-03-06 13:29:38 +00:00
Arity = ArgumentArity.ExactlyOne,
Description = UI.Device_path,
2022-03-06 13:29:38 +00:00
Name = "device-path"
});
2022-04-10 12:54:04 +01:00
Add(new Option<bool>(new[]
{
"--trap-disc", "-t"
}, () => false, UI.Device_report_using_trap_disc));
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
Handler = CommandHandler.Create(GetType().GetMethod(nameof(Invoke)));
}
2022-03-06 13:29:38 +00:00
public static int Invoke(bool debug, bool verbose, string devicePath, bool trapDisc)
{
MainClass.PrintCopyright();
2022-03-06 13:29:38 +00:00
if(debug)
{
2022-03-06 13:29:38 +00:00
IAnsiConsole stderrConsole = AnsiConsole.Create(new AnsiConsoleSettings
2021-09-13 18:08:44 +01:00
{
Out = new AnsiConsoleOutput(System.Console.Error)
2022-03-06 13:29:38 +00:00
});
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
AaruConsole.DebugWriteLineEvent += (format, objects) =>
{
if(objects is null)
stderrConsole.MarkupLine(format);
else
stderrConsole.MarkupLine(format, objects);
};
}
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
if(verbose)
AaruConsole.WriteEvent += (format, objects) =>
{
if(objects is null)
AnsiConsole.Markup(format);
else
AnsiConsole.Markup(format, objects);
};
2022-03-06 13:29:38 +00:00
Statistics.AddCommand("device-report");
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). * DiscImageChef.Metadata/DeviceReport.cs: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DumpMedia.cs: Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/CreateSidecar.cs: Moved checksum generation to a separate class. * CICMMetadata: Added support for ADIP. * DiscImageChef.CommonTypes/MediaType.cs: Added parameters of UDO media. Moved DataPlay outside of Iomega, as it's not from that manufacturer. Added missing Exatape media and corrected 160m XL one. Added SyJet media. Added all ECMA defined magneto-optical (sectors calculated from specifications, unchecked). Added PD media. Added Imation 320Gb RDX. Added generic USB flash drives. * DiscImageChef.Decoders/SCSI/Enums.cs: Make enumerations public. * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Devices/Device/Constructor.cs: Trim space padded strings on SCSI INQUIRY. * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: Added PREVENT ALLOW MEDIUM REMOVAL. Added START STOP UNIT. * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: Rename NEC methods. * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: Corrected Pioneer transfer length calculation. * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: Renamed Plextor methods. * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with MMC same name but different command. * DiscImageChef.Devices/DiscImageChef.Devices.csproj: Set platform target to x86 (does it really matter?). * DiscImageChef.Devices/Linux/Command.cs: Reduced allocation for readlink() to current kernel MAX_PATH. * DiscImageChef.Devices/Linux/Enums.cs: Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves commands not working on 32-bit environments. * DiscImageChef.DiscImages/ZZZRawImage.cs: Changed ECMA-184 and ECMA-183 enums. * DiscImageChef.Metadata/Dimensions.cs: Added all ECMA defined magneto-opticals. Added PD media. Added 320Gb RDX. Corrected Exatape 160m XL. Added Exatape 22m and 28m. * DiscImageChef.Metadata/MediaType.cs: Added 356mm magneto-optical media. Changed ECMA-184 and ECMA-183 enums. Added USB generic flash drive. * DiscImageChef/Commands/DeviceInfo.cs: Corrected SCSI INQUIRY naming. Corrected SCSI MODE SENSE (6) parameters. Reduced SCSI MODE SENSE timeout, some devices just get stuck with unsupported MODE SENSE commanda and must be left to timeout. Changed FUJITSU vendor string comparison. * DiscImageChef/Commands/MediaInfo.cs: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). Changed some error WriteLine() to debug ones. Too much verbosity. Added DVD media type decoding from PFI. Found a drive that dumps ADIP, enabling it again (not decoded). * DiscImageChef/Commands/MediaScan.cs: Added option to generate ImgBurn compatible log to media-scan command. * DiscImageChef/DiscImageChef.csproj: Moved checksum generation to a separate class. Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Main.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Options.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. Added option to generate ImgBurn compatible log to media-scan command.
2016-01-31 08:05:56 +00:00
2022-03-06 13:29:38 +00:00
AaruConsole.DebugWriteLine("Device-Report command", "--debug={0}", debug);
AaruConsole.DebugWriteLine("Device-Report command", "--device={0}", devicePath);
AaruConsole.DebugWriteLine("Device-Report command", "--verbose={0}", verbose);
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). * DiscImageChef.Metadata/DeviceReport.cs: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DumpMedia.cs: Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/CreateSidecar.cs: Moved checksum generation to a separate class. * CICMMetadata: Added support for ADIP. * DiscImageChef.CommonTypes/MediaType.cs: Added parameters of UDO media. Moved DataPlay outside of Iomega, as it's not from that manufacturer. Added missing Exatape media and corrected 160m XL one. Added SyJet media. Added all ECMA defined magneto-optical (sectors calculated from specifications, unchecked). Added PD media. Added Imation 320Gb RDX. Added generic USB flash drives. * DiscImageChef.Decoders/SCSI/Enums.cs: Make enumerations public. * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Devices/Device/Constructor.cs: Trim space padded strings on SCSI INQUIRY. * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: Added PREVENT ALLOW MEDIUM REMOVAL. Added START STOP UNIT. * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: Rename NEC methods. * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: Corrected Pioneer transfer length calculation. * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: Renamed Plextor methods. * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with MMC same name but different command. * DiscImageChef.Devices/DiscImageChef.Devices.csproj: Set platform target to x86 (does it really matter?). * DiscImageChef.Devices/Linux/Command.cs: Reduced allocation for readlink() to current kernel MAX_PATH. * DiscImageChef.Devices/Linux/Enums.cs: Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves commands not working on 32-bit environments. * DiscImageChef.DiscImages/ZZZRawImage.cs: Changed ECMA-184 and ECMA-183 enums. * DiscImageChef.Metadata/Dimensions.cs: Added all ECMA defined magneto-opticals. Added PD media. Added 320Gb RDX. Corrected Exatape 160m XL. Added Exatape 22m and 28m. * DiscImageChef.Metadata/MediaType.cs: Added 356mm magneto-optical media. Changed ECMA-184 and ECMA-183 enums. Added USB generic flash drive. * DiscImageChef/Commands/DeviceInfo.cs: Corrected SCSI INQUIRY naming. Corrected SCSI MODE SENSE (6) parameters. Reduced SCSI MODE SENSE timeout, some devices just get stuck with unsupported MODE SENSE commanda and must be left to timeout. Changed FUJITSU vendor string comparison. * DiscImageChef/Commands/MediaInfo.cs: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). Changed some error WriteLine() to debug ones. Too much verbosity. Added DVD media type decoding from PFI. Found a drive that dumps ADIP, enabling it again (not decoded). * DiscImageChef/Commands/MediaScan.cs: Added option to generate ImgBurn compatible log to media-scan command. * DiscImageChef/DiscImageChef.csproj: Moved checksum generation to a separate class. Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Main.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Options.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. Added option to generate ImgBurn compatible log to media-scan command.
2016-01-31 08:05:56 +00:00
2022-03-06 13:29:38 +00:00
if(devicePath.Length == 2 &&
devicePath[1] == ':' &&
devicePath[0] != '/' &&
char.IsLetter(devicePath[0]))
devicePath = "\\\\.\\" + char.ToUpper(devicePath[0]) + ':';
2019-12-07 19:54:27 +00:00
var dev = Devices.Device.Create(devicePath, out ErrorNumber devErrno);
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). * DiscImageChef.Metadata/DeviceReport.cs: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DumpMedia.cs: Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/CreateSidecar.cs: Moved checksum generation to a separate class. * CICMMetadata: Added support for ADIP. * DiscImageChef.CommonTypes/MediaType.cs: Added parameters of UDO media. Moved DataPlay outside of Iomega, as it's not from that manufacturer. Added missing Exatape media and corrected 160m XL one. Added SyJet media. Added all ECMA defined magneto-optical (sectors calculated from specifications, unchecked). Added PD media. Added Imation 320Gb RDX. Added generic USB flash drives. * DiscImageChef.Decoders/SCSI/Enums.cs: Make enumerations public. * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Devices/Device/Constructor.cs: Trim space padded strings on SCSI INQUIRY. * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: Added PREVENT ALLOW MEDIUM REMOVAL. Added START STOP UNIT. * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: Rename NEC methods. * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: Corrected Pioneer transfer length calculation. * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: Renamed Plextor methods. * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with MMC same name but different command. * DiscImageChef.Devices/DiscImageChef.Devices.csproj: Set platform target to x86 (does it really matter?). * DiscImageChef.Devices/Linux/Command.cs: Reduced allocation for readlink() to current kernel MAX_PATH. * DiscImageChef.Devices/Linux/Enums.cs: Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves commands not working on 32-bit environments. * DiscImageChef.DiscImages/ZZZRawImage.cs: Changed ECMA-184 and ECMA-183 enums. * DiscImageChef.Metadata/Dimensions.cs: Added all ECMA defined magneto-opticals. Added PD media. Added 320Gb RDX. Corrected Exatape 160m XL. Added Exatape 22m and 28m. * DiscImageChef.Metadata/MediaType.cs: Added 356mm magneto-optical media. Changed ECMA-184 and ECMA-183 enums. Added USB generic flash drive. * DiscImageChef/Commands/DeviceInfo.cs: Corrected SCSI INQUIRY naming. Corrected SCSI MODE SENSE (6) parameters. Reduced SCSI MODE SENSE timeout, some devices just get stuck with unsupported MODE SENSE commanda and must be left to timeout. Changed FUJITSU vendor string comparison. * DiscImageChef/Commands/MediaInfo.cs: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). Changed some error WriteLine() to debug ones. Too much verbosity. Added DVD media type decoding from PFI. Found a drive that dumps ADIP, enabling it again (not decoded). * DiscImageChef/Commands/MediaScan.cs: Added option to generate ImgBurn compatible log to media-scan command. * DiscImageChef/DiscImageChef.csproj: Moved checksum generation to a separate class. Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Main.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Options.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. Added option to generate ImgBurn compatible log to media-scan command.
2016-01-31 08:05:56 +00:00
switch(dev)
2022-03-06 13:29:38 +00:00
{
case null:
AaruConsole.ErrorWriteLine(string.Format(UI.Could_not_open_device_error_0, devErrno));
2019-12-07 19:54:27 +00:00
return (int)devErrno;
case Devices.Remote.Device remoteDev:
Statistics.AddRemote(remoteDev.RemoteApplication, remoteDev.RemoteVersion,
remoteDev.RemoteOperatingSystem, remoteDev.RemoteOperatingSystemVersion,
remoteDev.RemoteArchitecture);
2019-12-07 19:54:27 +00:00
break;
2022-03-06 13:29:38 +00:00
}
if(dev.Error)
2022-03-06 13:29:38 +00:00
{
AaruConsole.ErrorWriteLine(Error.Print(dev.LastError));
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). * DiscImageChef.Metadata/DeviceReport.cs: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DumpMedia.cs: Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/CreateSidecar.cs: Moved checksum generation to a separate class. * CICMMetadata: Added support for ADIP. * DiscImageChef.CommonTypes/MediaType.cs: Added parameters of UDO media. Moved DataPlay outside of Iomega, as it's not from that manufacturer. Added missing Exatape media and corrected 160m XL one. Added SyJet media. Added all ECMA defined magneto-optical (sectors calculated from specifications, unchecked). Added PD media. Added Imation 320Gb RDX. Added generic USB flash drives. * DiscImageChef.Decoders/SCSI/Enums.cs: Make enumerations public. * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Devices/Device/Constructor.cs: Trim space padded strings on SCSI INQUIRY. * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: Added PREVENT ALLOW MEDIUM REMOVAL. Added START STOP UNIT. * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: Rename NEC methods. * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: Corrected Pioneer transfer length calculation. * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: Renamed Plextor methods. * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with MMC same name but different command. * DiscImageChef.Devices/DiscImageChef.Devices.csproj: Set platform target to x86 (does it really matter?). * DiscImageChef.Devices/Linux/Command.cs: Reduced allocation for readlink() to current kernel MAX_PATH. * DiscImageChef.Devices/Linux/Enums.cs: Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves commands not working on 32-bit environments. * DiscImageChef.DiscImages/ZZZRawImage.cs: Changed ECMA-184 and ECMA-183 enums. * DiscImageChef.Metadata/Dimensions.cs: Added all ECMA defined magneto-opticals. Added PD media. Added 320Gb RDX. Corrected Exatape 160m XL. Added Exatape 22m and 28m. * DiscImageChef.Metadata/MediaType.cs: Added 356mm magneto-optical media. Changed ECMA-184 and ECMA-183 enums. Added USB generic flash drive. * DiscImageChef/Commands/DeviceInfo.cs: Corrected SCSI INQUIRY naming. Corrected SCSI MODE SENSE (6) parameters. Reduced SCSI MODE SENSE timeout, some devices just get stuck with unsupported MODE SENSE commanda and must be left to timeout. Changed FUJITSU vendor string comparison. * DiscImageChef/Commands/MediaInfo.cs: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). Changed some error WriteLine() to debug ones. Too much verbosity. Added DVD media type decoding from PFI. Found a drive that dumps ADIP, enabling it again (not decoded). * DiscImageChef/Commands/MediaScan.cs: Added option to generate ImgBurn compatible log to media-scan command. * DiscImageChef/DiscImageChef.csproj: Moved checksum generation to a separate class. Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Main.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Options.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. Added option to generate ImgBurn compatible log to media-scan command.
2016-01-31 08:05:56 +00:00
2022-03-06 13:29:38 +00:00
return (int)ErrorNumber.CannotOpenDevice;
}
2022-03-06 13:29:38 +00:00
Statistics.AddDevice(dev);
bool isAdmin = dev is Devices.Remote.Device remoteDev2 ? remoteDev2.IsAdmin : DetectOS.IsAdmin;
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
if(!isAdmin)
{
AaruConsole.ErrorWriteLine(UI.Device_report_must_be_run_as_admin);
AaruConsole.ErrorWriteLine(UI.Not_continuing);
2022-03-06 13:29:38 +00:00
return (int)ErrorNumber.NotPermitted;
}
2022-03-06 13:29:38 +00:00
var report = new DeviceReportV2
{
Manufacturer = dev.Manufacturer,
Model = dev.Model,
Revision = dev.FirmwareRevision,
Type = dev.Type
};
bool removable = false;
2022-03-06 13:29:38 +00:00
string jsonFile;
2022-11-13 19:38:03 +00:00
switch(string.IsNullOrWhiteSpace(dev.Manufacturer))
{
case false when !string.IsNullOrWhiteSpace(dev.FirmwareRevision):
jsonFile = dev.Manufacturer + "_" + dev.Model + "_" + dev.FirmwareRevision + ".json";
break;
case false:
jsonFile = dev.Manufacturer + "_" + dev.Model + ".json";
break;
default:
{
if(!string.IsNullOrWhiteSpace(dev.FirmwareRevision))
jsonFile = dev.Model + "_" + dev.FirmwareRevision + ".json";
else
jsonFile = dev.Model + ".json";
break;
}
}
2022-03-06 13:29:38 +00:00
jsonFile = jsonFile.Replace('\\', '_').Replace('/', '_').Replace('?', '_');
if(trapDisc && dev.ScsiType != PeripheralDeviceTypes.MultiMediaDevice)
{
AaruConsole.ErrorWriteLine(UI.Device_does_not_report_with_trap_discs);
2022-03-06 13:29:38 +00:00
return (int)ErrorNumber.InvalidArgument;
}
2022-03-06 13:29:38 +00:00
var reporter = new DeviceReport(dev);
2022-03-06 13:29:38 +00:00
if(dev.IsUsb)
if(AnsiConsole.Confirm($"[italic]{UI.Is_the_device_natively_USB}[/]"))
{
Core.Spectre.ProgressSingleSpinner(ctx =>
{
ctx.AddTask(Localization.Core.Querying_USB_information).IsIndeterminate();
2022-03-06 13:29:38 +00:00
report.USB = reporter.UsbReport();
});
report.USB.RemovableMedia = AnsiConsole.Confirm($"[italic]{UI.Is_the_media_removable}[/]");
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
removable = report.USB.RemovableMedia;
}
2022-03-06 13:29:38 +00:00
if(dev.IsFireWire)
if(AnsiConsole.Confirm($"[italic]{UI.Is_the_device_natively_FireWire}[/]"))
{
Core.Spectre.ProgressSingleSpinner(ctx =>
{
2022-03-06 13:29:38 +00:00
ctx.AddTask("Querying FireWire information...").IsIndeterminate();
report.FireWire = reporter.FireWireReport();
});
2021-09-13 18:08:44 +01:00
report.FireWire.RemovableMedia = AnsiConsole.Confirm($"[italic]{UI.Is_the_media_removable}[/]");
2022-03-06 13:29:38 +00:00
removable = report.FireWire.RemovableMedia;
}
2022-03-06 13:29:38 +00:00
if(dev.IsPcmcia)
Core.Spectre.ProgressSingleSpinner(ctx =>
2022-03-06 13:29:38 +00:00
{
ctx.AddTask(Localization.Core.Querying_PCMCIA_information).IsIndeterminate();
2022-03-06 13:29:38 +00:00
report.PCMCIA = reporter.PcmciaReport();
});
byte[] buffer = Array.Empty<byte>();
string mediumTypeName;
string mediumModel;
switch(dev.Type)
{
case DeviceType.ATA:
{
Core.Spectre.ProgressSingleSpinner(ctx =>
2021-09-13 18:08:44 +01:00
{
ctx.AddTask(Localization.Core.Querying_ATA_IDENTIFY).IsIndeterminate();
2022-03-06 13:29:38 +00:00
dev.AtaIdentify(out buffer, out _, dev.Timeout, out _);
2021-09-13 18:08:44 +01:00
});
2022-03-06 13:29:38 +00:00
if(!Identify.Decode(buffer).HasValue)
break;
2022-03-06 13:29:38 +00:00
report.ATA = new Ata
{
Identify = DeviceReport.ClearIdentify(buffer)
};
if(report.ATA.IdentifyDevice == null)
break;
if((ushort)report.ATA.IdentifyDevice?.GeneralConfiguration == 0x848A)
{
report.CompactFlash = true;
removable = false;
}
else if(!removable &&
report.ATA.IdentifyDevice?.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.
Removable) == true)
removable = AnsiConsole.Confirm($"[italic]{UI.Is_the_media_removable}[/]");
2022-03-06 13:29:38 +00:00
if(removable)
{
AaruConsole.WriteLine(UI.Please_remove_any_media);
2022-03-06 13:29:38 +00:00
System.Console.ReadKey(true);
2022-03-06 13:29:38 +00:00
Core.Spectre.ProgressSingleSpinner(ctx =>
2021-09-13 18:08:44 +01:00
{
ctx.AddTask(Localization.Core.Querying_ATA_IDENTIFY).IsIndeterminate();
2021-09-13 18:08:44 +01:00
dev.AtaIdentify(out buffer, out _, dev.Timeout, out _);
});
2022-03-06 13:29:38 +00:00
report.ATA.Identify = DeviceReport.ClearIdentify(buffer);
List<TestedMedia> mediaTests = new();
while(AnsiConsole.Confirm($"[italic]{UI.Do_you_have_media_you_can_insert}[/]"))
2019-12-07 19:54:27 +00:00
{
AaruConsole.WriteLine(UI.Please_insert_it_in_the_drive);
System.Console.ReadKey(true);
mediumTypeName = AnsiConsole.Ask<string>(UI.Please_write_description_of_media_type);
mediumModel = AnsiConsole.Ask<string>(UI.Please_write_media_model);
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
TestedMedia mediaTest = reporter.ReportAtaMedia();
mediaTest.MediumTypeName = mediumTypeName;
mediaTest.Model = mediumModel;
2022-03-06 13:29:38 +00:00
mediaTests.Add(mediaTest);
}
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
report.ATA.RemovableMedias = mediaTests;
}
else
report.ATA.ReadCapabilities = reporter.ReportAta(report.ATA.IdentifyDevice.Value);
2022-03-06 13:29:38 +00:00
break;
}
2022-03-06 13:29:38 +00:00
case DeviceType.MMC:
report.MultiMediaCard = reporter.MmcSdReport();
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
break;
case DeviceType.SecureDigital:
report.SecureDigital = reporter.MmcSdReport();
2022-03-06 13:29:38 +00:00
break;
case DeviceType.NVMe: throw new NotImplementedException(Localization.Core.NVMe_devices_not_yet_supported);
2022-03-06 13:29:38 +00:00
case DeviceType.ATAPI:
Core.Spectre.ProgressSingleSpinner(ctx =>
2022-03-06 13:29:38 +00:00
{
ctx.AddTask(Localization.Core.Querying_ATAPI_IDENTIFY).IsIndeterminate();
2022-03-06 13:29:38 +00:00
dev.AtapiIdentify(out buffer, out _, dev.Timeout, out _);
});
2022-03-06 13:29:38 +00:00
if(Identify.Decode(buffer).HasValue)
report.ATAPI = new Ata
{
Identify = DeviceReport.ClearIdentify(buffer)
};
2022-03-06 13:29:38 +00:00
goto case DeviceType.SCSI;
case DeviceType.SCSI:
switch(dev.ScsiType)
{
case PeripheralDeviceTypes.DirectAccess:
case PeripheralDeviceTypes.SequentialAccess:
case PeripheralDeviceTypes.WriteOnceDevice:
case PeripheralDeviceTypes.MultiMediaDevice:
case PeripheralDeviceTypes.OpticalDevice:
case PeripheralDeviceTypes.BridgingExpander
when dev.Model.StartsWith("MDM", StringComparison.Ordinal) ||
dev.Model.StartsWith("MDH", StringComparison.Ordinal):
case PeripheralDeviceTypes.SCSIZonedBlockDevice: break;
default:
2019-09-19 16:39:32 +01:00
{
AaruConsole.ErrorWriteLine(UI.Unsupported_device_type_for_report);
2022-03-06 13:29:38 +00:00
throw new IOException();
}
}
2022-03-06 13:29:38 +00:00
if(!dev.IsUsb &&
!dev.IsFireWire &&
dev.IsRemovable)
removable = AnsiConsole.Confirm($"[italic]{UI.Is_the_media_removable_flash_is_not}[/]");
2022-03-06 13:29:38 +00:00
if(removable)
{
switch(dev.ScsiType)
{
case PeripheralDeviceTypes.MultiMediaDevice:
case PeripheralDeviceTypes.BridgingExpander
when dev.Model.StartsWith("MDM", StringComparison.Ordinal) ||
dev.Model.StartsWith("MDH", StringComparison.Ordinal):
2022-03-06 13:29:38 +00:00
dev.AllowMediumRemoval(out buffer, dev.Timeout, out _);
dev.EjectTray(out buffer, dev.Timeout, out _);
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
break;
case PeripheralDeviceTypes.SequentialAccess:
dev.SpcAllowMediumRemoval(out buffer, dev.Timeout, out _);
2021-09-13 18:08:44 +01:00
Core.Spectre.ProgressSingleSpinner(ctx =>
2022-03-06 13:29:38 +00:00
{
ctx.AddTask(UI.Asking_drive_to_unload_tape).IsIndeterminate();
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
dev.Unload(out buffer, dev.Timeout, out _);
});
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
break;
}
AaruConsole.WriteLine(UI.Please_remove_any_media);
2019-12-07 19:54:27 +00:00
System.Console.ReadKey(true);
2022-03-06 13:29:38 +00:00
}
2022-03-06 13:29:38 +00:00
report.SCSI = reporter.ReportScsiInquiry();
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
if(report.SCSI == null)
break;
2022-03-06 13:29:38 +00:00
report.SCSI.EVPDPages =
reporter.ReportEvpdPages(StringHandlers.CToString(report.SCSI.Inquiry?.VendorIdentification)?.
Trim().ToLowerInvariant());
2022-03-06 13:29:38 +00:00
reporter.ReportScsiModes(ref report, out byte[] cdromMode, out MediumTypes mediumType);
2022-03-06 13:29:38 +00:00
string mediumManufacturer;
byte[] senseBuffer = Array.Empty<byte>();
bool sense = true;
2022-03-06 13:29:38 +00:00
switch(dev.ScsiType)
{
case PeripheralDeviceTypes.MultiMediaDevice:
{
2022-03-06 13:29:38 +00:00
if(dev.IsUsb &&
2022-03-16 11:47:00 +00:00
mediumType is MediumTypes.UnknownBlockDevice or MediumTypes.ReadOnlyBlockDevice
or MediumTypes.ReadWriteBlockDevice)
2022-03-06 13:29:38 +00:00
goto default;
2022-03-06 13:29:38 +00:00
bool iomegaRev = dev.Manufacturer.ToLowerInvariant() == "iomega" && dev.Model.
2022-03-07 07:36:44 +00:00
ToLowerInvariant().StartsWith("rrd", StringComparison.OrdinalIgnoreCase);
2022-03-06 13:29:38 +00:00
if(trapDisc)
{
if(iomegaRev)
{
AaruConsole.ErrorWriteLine(UI.Device_does_not_report_with_trap_discs);
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
return (int)ErrorNumber.InvalidArgument;
}
if(!AnsiConsole.Confirm($"[italic]{UI.Sure_report_trap_disc}[/]"))
2022-03-06 13:29:38 +00:00
return (int)ErrorNumber.NoError;
if(!AnsiConsole.Confirm($"[italic]{UI.Do_you_have_audio_trap_disc}[/]"))
2022-03-06 13:29:38 +00:00
{
AaruConsole.ErrorWriteLine(UI.Please_burn_audio_trap_disc);
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
return (int)ErrorNumber.NoError;
}
2022-03-06 13:29:38 +00:00
if(AnsiConsole.Confirm($"[italic]{UI.Do_you_have_GD_ROM_disc}[/]"))
2022-03-06 13:29:38 +00:00
reporter.ReportGdRomSwapTrick(ref report);
else
2022-03-06 13:29:38 +00:00
return (int)ErrorNumber.NoError;
}
else
{
List<string> mediaTypes = new();
report.SCSI.MultiMediaDevice = new Mmc
{
2022-03-06 13:29:38 +00:00
ModeSense2AData = cdromMode,
Features = reporter.ReportMmcFeatures()
};
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
if(report.SCSI.MultiMediaDevice.Features?.BinaryData != null)
{
Features.SeparatedFeatures ftr =
Features.Separate(report.SCSI.MultiMediaDevice.Features.BinaryData);
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
if(ftr.Descriptors != null)
2022-11-15 01:35:06 +00:00
foreach(Profile prof in from desc in ftr.Descriptors where desc.Code == 0x0000
select Features.Decode_0000(desc.Data) into ftr0000
where ftr0000 != null from prof in ftr0000.Value.Profiles
select prof)
switch(prof.Number)
{
case ProfileNumber.CDROM:
case ProfileNumber.CDR:
case ProfileNumber.CDRW:
mediaTypes.Add("CD-ROM");
mediaTypes.Add("Audio CD");
mediaTypes.Add("Enhanced CD (aka E-CD, CD-Plus or CD+)");
mediaTypes.Add("CD-R");
mediaTypes.Add("CD-RW Ultra Speed (marked 16x or higher)");
mediaTypes.Add("CD-RW High Speed (marked between 8x and 12x)");
mediaTypes.Add("CD-RW (marked 4x or lower)");
break;
case ProfileNumber.DVDRWRes:
case ProfileNumber.DVDRWSeq:
case ProfileNumber.DVDRDLSeq:
case ProfileNumber.DVDRDLJump:
case ProfileNumber.DVDRWDL:
case ProfileNumber.DVDDownload:
case ProfileNumber.DVDRWPlus:
case ProfileNumber.DVDRPlus:
case ProfileNumber.DVDRSeq:
case ProfileNumber.DVDRWDLPlus:
case ProfileNumber.DVDRDLPlus:
case ProfileNumber.DVDROM:
mediaTypes.Add("DVD-ROM");
mediaTypes.Add("DVD-R");
mediaTypes.Add("DVD-RW");
mediaTypes.Add("DVD+R");
mediaTypes.Add("DVD+RW");
mediaTypes.Add("DVD-R DL");
mediaTypes.Add("DVD+R DL");
mediaTypes.Add("Nintendo GameCube game");
mediaTypes.Add("Nintendo Wii game");
break;
case ProfileNumber.DVDRAM:
mediaTypes.Add("DVD-RAM (1st gen, marked 2.6Gb or 5.2Gb)");
mediaTypes.Add("DVD-RAM (2nd gen, marked 4.7Gb or 9.4Gb)");
break;
case ProfileNumber.DDCDROM:
case ProfileNumber.DDCDR:
case ProfileNumber.DDCDRW:
mediaTypes.Add("DDCD-ROM");
mediaTypes.Add("DDCD-R");
mediaTypes.Add("DDCD-RW");
break;
case ProfileNumber.BDROM:
case ProfileNumber.BDRSeq:
case ProfileNumber.BDRRdm:
case ProfileNumber.BDRE:
mediaTypes.Add("BD-ROM");
mediaTypes.Add("BD-R HTL (not LTH)");
mediaTypes.Add("BD-RE");
mediaTypes.Add("BD-R LTH");
mediaTypes.Add("BD-R Triple Layer (100Gb)");
mediaTypes.Add("BD-R Quad Layer (128Gb)");
mediaTypes.Add("Ultra HD Blu-ray movie");
mediaTypes.Add("PlayStation 3 game");
mediaTypes.Add("PlayStation 4 game");
mediaTypes.Add("PlayStation 5 game");
mediaTypes.Add("Xbox One game");
mediaTypes.Add("Nintendo Wii U game");
break;
case ProfileNumber.HDDVDROM:
case ProfileNumber.HDDVDR:
case ProfileNumber.HDDVDRW:
case ProfileNumber.HDDVDRDL:
case ProfileNumber.HDDVDRWDL:
mediaTypes.Add("HD DVD-ROM");
mediaTypes.Add("HD DVD-R");
mediaTypes.Add("HD DVD-RW");
break;
case ProfileNumber.HDDVDRAM:
mediaTypes.Add("HD DVD-RAM");
break;
}
2022-03-06 13:29:38 +00:00
}
2022-03-06 13:29:38 +00:00
if(cdromMode != null &&
!iomegaRev)
{
mediaTypes.Add("CD-ROM");
mediaTypes.Add("Audio CD");
mediaTypes.Add("Enhanced CD (aka E-CD, CD-Plus or CD+)");
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
if(report.SCSI.MultiMediaDevice.ModeSense2A.ReadCDR)
mediaTypes.Add("CD-R");
2022-03-06 13:29:38 +00:00
if(report.SCSI.MultiMediaDevice.ModeSense2A.ReadCDRW)
{
2022-03-06 13:29:38 +00:00
mediaTypes.Add("CD-RW Ultra Speed (marked 16x or higher)");
mediaTypes.Add("CD-RW High Speed (marked between 8x and 12x)");
mediaTypes.Add("CD-RW (marked 4x or lower)");
}
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
if(report.SCSI.MultiMediaDevice.ModeSense2A.ReadDVDROM)
mediaTypes.Add("DVD-ROM");
2022-03-06 13:29:38 +00:00
if(report.SCSI.MultiMediaDevice.ModeSense2A.ReadDVDRAM)
{
mediaTypes.Add("DVD-RAM (1st gen, marked 2.6Gb or 5.2Gb)");
mediaTypes.Add("DVD-RAM (2nd gen, marked 4.7Gb or 9.4Gb)");
}
2022-03-06 13:29:38 +00:00
if(report.SCSI.MultiMediaDevice.ModeSense2A.ReadDVDR)
mediaTypes.Add("DVD-R");
}
if(report.SCSI.MultiMediaDevice.Features != null &&
!iomegaRev)
{
if(report.SCSI.MultiMediaDevice.Features.CanReadBD ||
report.SCSI.MultiMediaDevice.Features.CanReadBDR ||
report.SCSI.MultiMediaDevice.Features.CanReadBDRE1 ||
report.SCSI.MultiMediaDevice.Features.CanReadBDRE2 ||
report.SCSI.MultiMediaDevice.Features.CanReadBDROM ||
report.SCSI.MultiMediaDevice.Features.CanReadOldBDR ||
report.SCSI.MultiMediaDevice.Features.CanReadOldBDRE ||
report.SCSI.MultiMediaDevice.Features.CanReadOldBDROM)
{
2022-03-06 13:29:38 +00:00
mediaTypes.Add("BD-ROM");
mediaTypes.Add("BD-R HTL (not LTH)");
mediaTypes.Add("BD-RE");
mediaTypes.Add("BD-R LTH");
mediaTypes.Add("BD-R Triple Layer (100Gb)");
mediaTypes.Add("BD-R Quad Layer (128Gb)");
mediaTypes.Add("Ultra HD Blu-ray movie");
mediaTypes.Add("PlayStation 3 game");
mediaTypes.Add("PlayStation 4 game");
mediaTypes.Add("PlayStation 5 game");
mediaTypes.Add("Xbox One game");
mediaTypes.Add("Nintendo Wii U game");
}
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
if(report.SCSI.MultiMediaDevice.Features.CanReadCD ||
report.SCSI.MultiMediaDevice.Features.MultiRead)
{
mediaTypes.Add("CD-ROM");
mediaTypes.Add("Audio CD");
2022-03-06 13:29:38 +00:00
mediaTypes.Add("Enhanced CD (aka E-CD, CD-Plus or CD+)");
mediaTypes.Add("CD-R");
mediaTypes.Add("CD-RW Ultra Speed (marked 16x or higher)");
mediaTypes.Add("CD-RW High Speed (marked between 8x and 12x)");
mediaTypes.Add("CD-RW (marked 4x or lower)");
}
2022-03-06 13:29:38 +00:00
if(report.SCSI.MultiMediaDevice.Features.CanReadCDMRW)
mediaTypes.Add("CD-MRW");
2022-03-06 13:29:38 +00:00
if(report.SCSI.MultiMediaDevice.Features.CanReadDDCD)
{
2022-03-06 13:29:38 +00:00
mediaTypes.Add("DDCD-ROM");
mediaTypes.Add("DDCD-R");
mediaTypes.Add("DDCD-RW");
}
2022-03-06 13:29:38 +00:00
if(report.SCSI.MultiMediaDevice.Features.CanReadDVD ||
report.SCSI.MultiMediaDevice.Features.DVDMultiRead ||
report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusR ||
report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusRDL ||
report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusRW ||
report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusRWDL)
{
mediaTypes.Add("DVD-ROM");
mediaTypes.Add("DVD-R");
mediaTypes.Add("DVD-RW");
mediaTypes.Add("DVD+R");
mediaTypes.Add("DVD+RW");
mediaTypes.Add("DVD-R DL");
mediaTypes.Add("DVD+R DL");
mediaTypes.Add("Nintendo GameCube game");
mediaTypes.Add("Nintendo Wii game");
mediaTypes.Add("DVD-RAM (1st gen, marked 2.6Gb or 5.2Gb)");
mediaTypes.Add("DVD-RAM (2nd gen, marked 4.7Gb or 9.4Gb)");
}
2022-03-06 13:29:38 +00:00
if(report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusMRW)
mediaTypes.Add("DVD+MRW");
2022-03-06 13:29:38 +00:00
if(report.SCSI.MultiMediaDevice.Features.CanReadHDDVD ||
report.SCSI.MultiMediaDevice.Features.CanReadHDDVDR)
{
2022-03-06 13:29:38 +00:00
mediaTypes.Add("HD DVD-ROM");
mediaTypes.Add("HD DVD-R");
mediaTypes.Add("HD DVD-RW");
}
2022-03-06 13:29:38 +00:00
if(report.SCSI.MultiMediaDevice.Features.CanReadHDDVDRAM)
mediaTypes.Add("HD DVD-RAM");
}
2022-03-06 13:29:38 +00:00
if(iomegaRev)
{
mediaTypes.Add("REV 35Gb");
mediaTypes.Add("REV 70Gb");
mediaTypes.Add("REV 120Gb");
}
2022-03-06 13:29:38 +00:00
// Very old CD drives do not contain mode page 2Ah neither GET CONFIGURATION, so just try all CDs on them
// Also don't get confident, some drives didn't know CD-RW but are able to read them
if(mediaTypes.Count == 0 ||
mediaTypes.Contains("CD-ROM"))
{
mediaTypes.Add("CD-ROM");
mediaTypes.Add("Audio CD");
mediaTypes.Add("CD-R");
mediaTypes.Add("CD-RW Ultra Speed (marked 16x or higher)");
mediaTypes.Add("CD-RW High Speed (marked between 8x and 12x)");
mediaTypes.Add("CD-RW (marked 4x or lower)");
mediaTypes.Add("Enhanced CD (aka E-CD, CD-Plus or CD+)");
}
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
mediaTypes = mediaTypes.Distinct().ToList();
mediaTypes.Sort();
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
bool tryPlextor = false, tryHldtst = false, tryPioneer = false, tryNec = false,
tryMediaTekF106 = false;
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
tryPlextor |= dev.Manufacturer.ToLowerInvariant() == "plextor";
tryHldtst |= dev.Manufacturer.ToLowerInvariant() == "hl-dt-st";
tryPioneer |= dev.Manufacturer.ToLowerInvariant() == "pioneer";
tryNec |= dev.Manufacturer.ToLowerInvariant() == "nec";
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
if(!iomegaRev)
{
if(!tryPlextor)
tryPlextor |=
AnsiConsole.
Confirm($"[italic]{UI.Do_you_want_to_try_Plextor_commands} [red]{UI.This_is_dangerous}[/][/]",
2022-03-06 13:29:38 +00:00
false);
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
if(!tryNec)
tryNec |=
AnsiConsole.
Confirm($"[italic]{UI.Do_you_want_to_try_NEC_commands} [red]{UI.This_is_dangerous}[/][/]",
2022-03-06 13:29:38 +00:00
false);
2022-03-06 13:29:38 +00:00
if(!tryPioneer)
tryPioneer |=
AnsiConsole.
Confirm($"[italic]{UI.Do_you_want_to_try_Pioneer_commands} [red]{UI.This_is_dangerous}[/][/]",
2022-03-06 13:29:38 +00:00
false);
2022-03-06 13:29:38 +00:00
if(!tryHldtst)
tryHldtst |=
AnsiConsole.
Confirm($"[italic]{UI.Do_you_want_to_try_HLDTST_commands} [red]{UI.This_is_dangerous}[/][/]",
2022-03-06 13:29:38 +00:00
false);
2022-03-06 13:29:38 +00:00
tryMediaTekF106 =
AnsiConsole.
Confirm($"[italic]{UI.Do_you_want_to_try_MediaTek_commands} [red]{UI.This_is_dangerous}[/][/]",
2022-03-06 13:29:38 +00:00
false);
}
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
if(dev.Model.StartsWith("PD-", StringComparison.Ordinal))
mediaTypes.Add("PD-650");
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
List<TestedMedia> mediaTests = new();
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
foreach(string mediaType in mediaTypes)
{
if(!AnsiConsole.Confirm($"[italic]{string.Format(UI.Do_you_have_a_0_disc, mediaType)
}[/]"))
2022-03-06 13:29:38 +00:00
continue;
2019-12-07 19:54:27 +00:00
AaruConsole.WriteLine(UI.Please_insert_it_in_the_drive);
System.Console.ReadKey(true);
bool mediaIsRecognized = true;
Core.Spectre.ProgressSingleSpinner(ctx =>
2022-03-06 13:29:38 +00:00
{
ctx.AddTask(Localization.Core.Waiting_for_drive_to_become_ready).IsIndeterminate();
2022-03-06 13:29:38 +00:00
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
2022-03-06 13:29:38 +00:00
if(!sense)
return;
2022-03-06 13:29:38 +00:00
DecodedSense? decSense = Sense.Decode(senseBuffer);
2022-03-06 13:29:38 +00:00
if(decSense.HasValue)
switch(decSense.Value.ASC)
{
case 0x3A:
{
int leftRetries = 50;
2022-03-06 13:29:38 +00:00
while(leftRetries > 0)
{
Thread.Sleep(2000);
2022-03-07 07:36:44 +00:00
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
2022-03-06 13:29:38 +00:00
if(!sense)
break;
leftRetries--;
}
2022-03-06 13:29:38 +00:00
AaruConsole.WriteLine();
mediaIsRecognized &= !sense;
break;
}
// These should be trapped by the OS but seems in some cases they're not
case 0x04 when decSense.Value.ASCQ == 0x01:
{
int leftRetries = 50;
2022-03-06 13:29:38 +00:00
while(leftRetries > 0)
{
2022-03-06 13:29:38 +00:00
Thread.Sleep(2000);
2019-12-07 19:54:27 +00:00
2022-03-07 07:36:44 +00:00
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
if(!sense)
break;
2022-03-06 13:29:38 +00:00
leftRetries--;
}
2022-03-06 13:29:38 +00:00
AaruConsole.WriteLine();
2022-03-06 13:29:38 +00:00
mediaIsRecognized &= !sense;
break;
}
case 0x28:
{
int leftRetries = 50;
2022-03-06 13:29:38 +00:00
while(leftRetries > 0)
{
Thread.Sleep(2000);
2022-03-07 07:36:44 +00:00
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
2022-03-06 13:29:38 +00:00
if(!sense)
break;
leftRetries--;
}
2022-03-06 13:29:38 +00:00
AaruConsole.WriteLine();
2022-03-06 13:29:38 +00:00
mediaIsRecognized &= !sense;
break;
}
2022-03-06 13:29:38 +00:00
default:
AaruConsole.DebugWriteLine("Device-Report command",
Localization.Core.Device_not_ready_Sense,
2022-03-07 07:36:44 +00:00
decSense.Value.SenseKey, decSense.Value.ASC,
decSense.Value.ASCQ);
2022-03-06 13:29:38 +00:00
mediaIsRecognized = false;
break;
}
2022-03-06 13:29:38 +00:00
else
{
AaruConsole.DebugWriteLine("Device-Report command",
Localization.Core.
Got_sense_status_but_no_sense_buffer);
2022-03-06 13:29:38 +00:00
mediaIsRecognized = false;
}
});
var mediaTest = new TestedMedia();
if(mediaIsRecognized)
{
mediaTest = reporter.ReportMmcMedia(mediaType, tryPlextor, tryPioneer, tryNec,
tryHldtst, tryMediaTekF106);
if(mediaTest is null)
continue;
2022-03-07 07:36:44 +00:00
if((mediaTest.SupportsReadLong == true || mediaTest.SupportsReadLong16 == true) &&
mediaTest.LongBlockSize == mediaTest.BlockSize &&
AnsiConsole.Confirm($"[italic]{Localization.Core.Try_to_find_SCSI_READ_LONG_size
}[/]"))
2022-03-06 13:29:38 +00:00
AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(),
new PercentageColumn()).Start(ctx =>
{
ProgressTask task =
ctx.AddTask(Localization.Core.Trying_to_READ_LONG);
2022-03-06 13:29:38 +00:00
task.MaxValue = ushort.MaxValue;
for(ushort i = (ushort)mediaTest.BlockSize;; i++)
2022-03-06 13:29:38 +00:00
{
task.Description =
string.
Format(Localization.Core.Trying_READ_LONG_with_size_0,
i);
2022-03-06 13:29:38 +00:00
task.Value = i;
sense = mediaTest.SupportsReadLong16 == true
2022-03-07 07:36:44 +00:00
? dev.ReadLong16(out buffer, out senseBuffer,
false, 0, i, dev.Timeout, out _)
: dev.ReadLong10(out buffer, out senseBuffer,
false, false, 0, i, dev.Timeout,
out _);
2022-03-06 13:29:38 +00:00
if(!sense)
{
mediaTest.LongBlockSize = i;
break;
}
if(i == ushort.MaxValue)
break;
}
});
if(mediaTest.SupportsReadLong == true &&
mediaTest.LongBlockSize != mediaTest.BlockSize)
{
Core.Spectre.ProgressSingleSpinner(ctx =>
{
ctx.AddTask(Localization.Core.Trying_SCSI_READ_LONG_10).IsIndeterminate();
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0,
2022-03-07 07:36:44 +00:00
(ushort)mediaTest.LongBlockSize, dev.Timeout, out _);
2022-03-06 13:29:38 +00:00
});
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
if(!sense)
mediaTest.ReadLong10Data = buffer;
}
2022-03-06 13:29:38 +00:00
if(mediaTest.SupportsReadLong16 == true &&
mediaTest.LongBlockSize != mediaTest.BlockSize)
{
Core.Spectre.ProgressSingleSpinner(ctx =>
2022-03-06 13:29:38 +00:00
{
ctx.AddTask(Localization.Core.Trying_SCSI_READ_LONG_16).IsIndeterminate();
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
sense = dev.ReadLong16(out buffer, out senseBuffer, false, 0,
2022-03-07 07:36:44 +00:00
mediaTest.LongBlockSize.Value, dev.Timeout, out _);
2022-03-06 13:29:38 +00:00
});
if(!sense)
mediaTest.ReadLong16Data = buffer;
}
}
mediaTest.MediumTypeName = mediaType;
mediaTest.MediaIsRecognized = mediaIsRecognized;
mediaTests.Add(mediaTest);
dev.AllowMediumRemoval(out buffer, dev.Timeout, out _);
dev.EjectTray(out buffer, dev.Timeout, out _);
}
report.SCSI.MultiMediaDevice.TestedMedia = mediaTests;
}
}
break;
case PeripheralDeviceTypes.SequentialAccess:
{
report.SCSI.SequentialDevice = reporter.ReportScsiSsc();
List<TestedSequentialMedia> seqTests = new();
while(AnsiConsole.Confirm($"[italic]{UI.Do_you_have_media_you_can_insert}[/]"))
2022-03-06 13:29:38 +00:00
{
AaruConsole.WriteLine(UI.Please_insert_it_in_the_drive);
System.Console.ReadKey(true);
2022-03-06 13:29:38 +00:00
mediumTypeName = AnsiConsole.Ask<string>(UI.Please_write_description_of_media_type);
2022-03-06 13:29:38 +00:00
mediumManufacturer =
AnsiConsole.Ask<string>(Localization.Core.Please_write_media_manufacturer);
2022-03-06 13:29:38 +00:00
mediumModel = AnsiConsole.Ask<string>(UI.Please_write_media_model);
2022-03-06 13:29:38 +00:00
bool mediaIsRecognized = true;
2022-03-06 13:29:38 +00:00
Core.Spectre.ProgressSingleSpinner(ctx =>
2022-03-06 13:29:38 +00:00
{
ctx.AddTask(Localization.Core.Waiting_for_drive_to_become_ready).IsIndeterminate();
2022-03-06 13:29:38 +00:00
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
AaruConsole.DebugWriteLine("Device reporting", "sense = {0}", sense);
if(!sense)
return;
DecodedSense? decSense = Sense.Decode(senseBuffer);
if(decSense.HasValue)
switch(decSense.Value.ASC)
{
case 0x3A:
{
int leftRetries = 50;
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
while(leftRetries > 0)
{
Thread.Sleep(2000);
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
if(!sense)
break;
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
leftRetries--;
}
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
AaruConsole.WriteLine();
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
mediaIsRecognized &= !sense;
break;
}
2022-03-06 13:29:38 +00:00
// These should be trapped by the OS but seems in some cases they're not
case 0x04 when decSense.Value.ASCQ == 0x01:
{
int leftRetries = 50;
2022-03-06 13:29:38 +00:00
while(leftRetries > 0)
2021-09-13 18:08:44 +01:00
{
2022-03-06 13:29:38 +00:00
Thread.Sleep(2000);
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
2022-03-06 13:29:38 +00:00
if(!sense)
break;
leftRetries--;
}
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
AaruConsole.WriteLine();
mediaIsRecognized &= !sense;
break;
}
case 0x28:
{
int leftRetries = 50;
2022-03-06 13:29:38 +00:00
while(leftRetries > 0)
2021-09-13 18:08:44 +01:00
{
2022-03-06 13:29:38 +00:00
Thread.Sleep(2000);
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
if(!sense)
break;
leftRetries--;
}
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
AaruConsole.WriteLine();
2022-03-06 13:29:38 +00:00
mediaIsRecognized &= !sense;
break;
}
2022-03-06 13:29:38 +00:00
default:
AaruConsole.DebugWriteLine("Device-Report command",
Localization.Core.Device_not_ready_Sense,
2022-03-06 13:29:38 +00:00
decSense.Value.SenseKey, decSense.Value.ASC,
decSense.Value.ASCQ);
2022-03-06 13:29:38 +00:00
mediaIsRecognized = false;
2022-03-06 13:29:38 +00:00
break;
}
else
{
AaruConsole.DebugWriteLine("Device-Report command",
Localization.Core.Got_sense_status_but_no_sense_buffer);
2022-03-06 13:29:38 +00:00
mediaIsRecognized = false;
}
});
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
var seqTest = new TestedSequentialMedia();
if(mediaIsRecognized)
seqTest = reporter.ReportSscMedia();
seqTest.MediumTypeName = mediumTypeName;
seqTest.Manufacturer = mediumManufacturer;
seqTest.Model = mediumModel;
seqTest.MediaIsRecognized = mediaIsRecognized;
2022-03-06 13:29:38 +00:00
seqTests.Add(seqTest);
Core.Spectre.ProgressSingleSpinner(ctx =>
{
ctx.AddTask(UI.Asking_drive_to_unload_tape).IsIndeterminate();
2022-03-06 13:29:38 +00:00
dev.SpcAllowMediumRemoval(out buffer, dev.Timeout, out _);
dev.Unload(out buffer, dev.Timeout, out _);
});
}
2022-03-06 13:29:38 +00:00
report.SCSI.SequentialDevice.TestedMedia = seqTests;
}
2022-03-06 13:29:38 +00:00
break;
case PeripheralDeviceTypes.BridgingExpander
when dev.Model.StartsWith("MDM", StringComparison.Ordinal) ||
dev.Model.StartsWith("MDH", StringComparison.Ordinal):
{
List<string> mediaTypes = new()
{
Localization.Core.Media_Type_Name_MMD_140A,
Localization.Core.Media_Type_Name_MDW_60,
Localization.Core.Media_Type_Name_MDW_74,
Localization.Core.Media_Type_Name_MDW_80,
Localization.Core.Media_Type_Name_MiniDisc
2022-03-06 13:29:38 +00:00
};
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
mediaTypes.Sort();
2022-03-06 13:29:38 +00:00
List<TestedMedia> mediaTests = new();
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
foreach(string mediaType in mediaTypes)
{
if(!AnsiConsole.Confirm($"[italic]{string.Format(UI.Do_you_have_a_0_disc, mediaType)}[/]"))
2022-03-06 13:29:38 +00:00
continue;
2021-09-13 18:08:44 +01:00
AaruConsole.WriteLine(UI.Please_insert_it_in_the_drive);
2021-09-13 18:08:44 +01:00
System.Console.ReadKey(true);
2021-09-13 18:08:44 +01:00
bool mediaIsRecognized = true;
2019-12-07 19:54:27 +00:00
Core.Spectre.ProgressSingleSpinner(ctx =>
2022-03-06 13:29:38 +00:00
{
ctx.AddTask(Localization.Core.Waiting_for_drive_to_become_ready).IsIndeterminate();
2022-03-06 13:29:38 +00:00
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
if(!sense)
return;
DecodedSense? decSense = Sense.Decode(senseBuffer);
if(decSense.HasValue)
switch(decSense.Value.ASC)
2019-09-19 16:39:32 +01:00
{
2022-03-06 13:29:38 +00:00
case 0x3A:
{
int leftRetries = 50;
2022-03-06 13:29:38 +00:00
while(leftRetries > 0)
{
2022-03-06 13:29:38 +00:00
Thread.Sleep(2000);
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
if(!sense)
break;
2022-03-06 13:29:38 +00:00
leftRetries--;
}
2022-03-06 13:29:38 +00:00
mediaIsRecognized &= !sense;
2022-03-06 13:29:38 +00:00
break;
}
2022-03-06 13:29:38 +00:00
// These should be trapped by the OS but seems in some cases they're not
case 0x04 when decSense.Value.ASCQ == 0x01:
{
int leftRetries = 50;
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
while(leftRetries > 0)
{
Thread.Sleep(2000);
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
if(!sense)
break;
leftRetries--;
}
2022-03-06 13:29:38 +00:00
mediaIsRecognized &= !sense;
break;
}
case 0x28:
{
int leftRetries = 50;
2022-03-06 13:29:38 +00:00
while(leftRetries > 0)
{
2022-03-06 13:29:38 +00:00
Thread.Sleep(2000);
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
if(!sense)
break;
2022-03-06 13:29:38 +00:00
leftRetries--;
}
2022-03-06 13:29:38 +00:00
mediaIsRecognized &= !sense;
2022-03-06 13:29:38 +00:00
break;
}
default:
AaruConsole.DebugWriteLine("Device-Report command",
Localization.Core.Device_not_ready_Sense,
2022-03-06 13:29:38 +00:00
decSense.Value.SenseKey, decSense.Value.ASC,
decSense.Value.ASCQ);
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
mediaIsRecognized = false;
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
break;
}
else
{
AaruConsole.DebugWriteLine("Device-Report command",
Localization.Core.Got_sense_status_but_no_sense_buffer);
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
mediaIsRecognized = false;
}
});
var mediaTest = new TestedMedia();
if(mediaIsRecognized)
{
mediaTest = reporter.ReportScsiMedia();
if(mediaTest is null)
continue;
if((mediaTest.SupportsReadLong == true || mediaTest.SupportsReadLong16 == true) &&
mediaTest.LongBlockSize == mediaTest.BlockSize &&
AnsiConsole.Confirm($"[italic]{Localization.Core.Try_to_find_SCSI_READ_LONG_size
}[/]"))
2022-03-06 13:29:38 +00:00
AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(),
new PercentageColumn()).Start(ctx =>
{
ProgressTask task =
ctx.AddTask(Localization.Core.Trying_to_READ_LONG);
2022-03-06 13:29:38 +00:00
task.MaxValue = ushort.MaxValue;
2021-09-13 18:08:44 +01:00
for(ushort i = (ushort)mediaTest.BlockSize;; i++)
2022-03-06 13:29:38 +00:00
{
task.Value = i;
task.Description =
string.
Format(Localization.Core.Trying_READ_LONG_with_size_0,
i);
2022-03-06 13:29:38 +00:00
sense = mediaTest.SupportsReadLong16 == true
2022-03-07 07:36:44 +00:00
? dev.ReadLong16(out buffer, out senseBuffer, false,
0, i, dev.Timeout, out _)
: dev.ReadLong10(out buffer, out senseBuffer, false,
false, 0, i, dev.Timeout, out _);
2022-03-06 13:29:38 +00:00
if(!sense)
{
mediaTest.LongBlockSize = i;
break;
}
if(i == ushort.MaxValue)
break;
}
AaruConsole.WriteLine();
});
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
if(mediaTest.SupportsReadLong == true &&
mediaTest.LongBlockSize != mediaTest.BlockSize)
{
Core.Spectre.ProgressSingleSpinner(ctx =>
2022-03-06 13:29:38 +00:00
{
ctx.AddTask(Localization.Core.Trying_SCSI_READ_LONG_10).IsIndeterminate();
2022-03-06 13:29:38 +00:00
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0,
(ushort)mediaTest.LongBlockSize, dev.Timeout, out _);
});
2022-03-06 13:29:38 +00:00
if(!sense)
mediaTest.ReadLong10Data = buffer;
}
2022-03-06 13:29:38 +00:00
if(mediaTest.SupportsReadLong16 == true &&
mediaTest.LongBlockSize != mediaTest.BlockSize)
{
Core.Spectre.ProgressSingleSpinner(ctx =>
{
ctx.AddTask(Localization.Core.Trying_SCSI_READ_LONG_16).IsIndeterminate();
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
sense = dev.ReadLong16(out buffer, out senseBuffer, false, 0,
(ushort)mediaTest.LongBlockSize, dev.Timeout, out _);
});
2022-03-06 13:29:38 +00:00
if(!sense)
mediaTest.ReadLong16Data = buffer;
}
}
if(mediaType == Localization.Core.Media_Type_Name_MMD_140A)
mediaTest.MediumTypeName = "MMD-140A";
else if(mediaType == Localization.Core.Media_Type_Name_MDW_60)
mediaTest.MediumTypeName = "MDW-60";
else if(mediaType == Localization.Core.Media_Type_Name_MDW_74)
mediaTest.MediumTypeName = "MDW-74";
else if(mediaType == Localization.Core.Media_Type_Name_MDW_80)
mediaTest.MediumTypeName = "MDW-80";
else if(mediaType == Localization.Core.Media_Type_Name_MiniDisc)
mediaTest.MediumTypeName = "MiniDisc";
2022-03-06 13:29:38 +00:00
mediaTest.Manufacturer = "SONY";
mediaTest.MediaIsRecognized = mediaIsRecognized;
mediaTests.Add(mediaTest);
2022-03-06 13:29:38 +00:00
dev.AllowMediumRemoval(out buffer, dev.Timeout, out _);
dev.EjectTray(out buffer, dev.Timeout, out _);
}
2022-03-06 13:29:38 +00:00
report.SCSI.RemovableMedias = mediaTests;
}
2022-03-06 13:29:38 +00:00
break;
default:
{
if(removable)
{
2021-09-13 18:08:44 +01:00
List<TestedMedia> mediaTests = new();
while(AnsiConsole.Confirm($"[italic]{UI.Do_you_have_media_you_can_insert}[/]"))
{
AaruConsole.WriteLine(UI.Please_insert_it_in_the_drive);
System.Console.ReadKey(true);
mediumTypeName = AnsiConsole.Ask<string>(UI.Please_write_description_of_media_type);
2022-03-06 13:29:38 +00:00
mediumManufacturer =
AnsiConsole.Ask<string>(Localization.Core.Please_write_media_manufacturer);
2022-03-06 13:29:38 +00:00
mediumModel = AnsiConsole.Ask<string>(UI.Please_write_media_model);
2022-03-06 13:29:38 +00:00
bool mediaIsRecognized = true;
Core.Spectre.ProgressSingleSpinner(ctx =>
{
ctx.AddTask(Localization.Core.Waiting_for_drive_to_become_ready).IsIndeterminate();
2021-09-13 18:08:44 +01:00
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
if(!sense)
return;
DecodedSense? decSense = Sense.Decode(senseBuffer);
if(decSense.HasValue)
switch(decSense.Value.ASC)
{
case 0x3A:
{
int leftRetries = 20;
while(leftRetries > 0)
{
Thread.Sleep(2000);
2021-09-13 18:08:44 +01:00
2022-03-07 07:36:44 +00:00
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
if(!sense)
break;
leftRetries--;
}
mediaIsRecognized &= !sense;
break;
}
case 0x04 when decSense.Value.ASCQ == 0x01:
{
int leftRetries = 20;
while(leftRetries > 0)
{
Thread.Sleep(2000);
2021-09-13 18:08:44 +01:00
2022-03-07 07:36:44 +00:00
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
if(!sense)
break;
leftRetries--;
}
mediaIsRecognized &= !sense;
break;
}
default:
mediaIsRecognized = false;
break;
}
else
mediaIsRecognized = false;
2021-09-13 18:08:44 +01:00
});
var mediaTest = new TestedMedia();
if(mediaIsRecognized)
{
mediaTest = reporter.ReportScsiMedia();
2022-03-07 07:36:44 +00:00
if((mediaTest.SupportsReadLong == true || mediaTest.SupportsReadLong16 == true) &&
mediaTest.LongBlockSize == mediaTest.BlockSize &&
AnsiConsole.Confirm($"[italic]{Localization.Core.Try_to_find_SCSI_READ_LONG_size
}[/]"))
2021-09-13 18:08:44 +01:00
AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(),
new PercentageColumn()).Start(ctx =>
{
ProgressTask task =
ctx.AddTask(Localization.Core.Trying_to_READ_LONG);
2021-09-13 18:08:44 +01:00
task.MaxValue = ushort.MaxValue;
for(ushort i = (ushort)mediaTest.BlockSize;; i++)
2021-09-13 18:08:44 +01:00
{
task.Value = i;
task.Description =
string.
Format(Localization.Core.Trying_READ_LONG_with_size_0,
i);
2021-09-13 18:08:44 +01:00
sense = mediaTest.SupportsReadLong16 == true
2022-03-07 07:36:44 +00:00
? dev.ReadLong16(out buffer, out senseBuffer,
false, 0, i, dev.Timeout, out _)
: dev.ReadLong10(out buffer, out senseBuffer,
false, false, 0, i, dev.Timeout,
out _);
2021-09-13 18:08:44 +01:00
if(!sense)
{
mediaTest.LongBlockSize = i;
2021-09-13 18:08:44 +01:00
break;
}
2021-09-13 18:08:44 +01:00
if(i == ushort.MaxValue)
break;
}
2021-09-13 18:08:44 +01:00
AaruConsole.WriteLine();
});
if(mediaTest.SupportsReadLong == true &&
mediaTest.LongBlockSize != mediaTest.BlockSize)
{
Core.Spectre.ProgressSingleSpinner(ctx =>
2021-09-13 18:08:44 +01:00
{
ctx.AddTask(Localization.Core.Trying_SCSI_READ_LONG_10).IsIndeterminate();
2021-09-13 18:08:44 +01:00
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0,
2022-03-07 07:36:44 +00:00
(ushort)mediaTest.LongBlockSize, dev.Timeout, out _);
2021-09-13 18:08:44 +01:00
});
if(!sense)
mediaTest.ReadLong10Data = buffer;
}
if(mediaTest.SupportsReadLong16 == true &&
mediaTest.LongBlockSize != mediaTest.BlockSize)
{
Core.Spectre.ProgressSingleSpinner(ctx =>
2021-09-13 18:08:44 +01:00
{
ctx.AddTask(Localization.Core.Trying_SCSI_READ_LONG_16).IsIndeterminate();
2021-09-13 18:08:44 +01:00
sense = dev.ReadLong16(out buffer, out senseBuffer, false, 0,
2022-03-07 07:36:44 +00:00
(ushort)mediaTest.LongBlockSize, dev.Timeout, out _);
2021-09-13 18:08:44 +01:00
});
if(!sense)
mediaTest.ReadLong16Data = buffer;
}
}
2022-03-06 13:29:38 +00:00
mediaTest.MediumTypeName = mediumTypeName;
mediaTest.Manufacturer = mediumManufacturer;
mediaTest.Model = mediumModel;
mediaTest.MediaIsRecognized = mediaIsRecognized;
2022-03-06 13:29:38 +00:00
mediaTests.Add(mediaTest);
dev.AllowMediumRemoval(out buffer, dev.Timeout, out _);
dev.EjectTray(out buffer, dev.Timeout, out _);
}
report.SCSI.RemovableMedias = mediaTests;
}
2022-03-06 13:29:38 +00:00
else
{
2022-03-06 13:29:38 +00:00
report.SCSI.ReadCapabilities = reporter.ReportScsi();
2022-03-06 13:29:38 +00:00
if((report.SCSI.ReadCapabilities.SupportsReadLong == true ||
report.SCSI.ReadCapabilities.SupportsReadLong16 == true) &&
report.SCSI.ReadCapabilities.LongBlockSize == report.SCSI.ReadCapabilities.BlockSize)
if(AnsiConsole.Confirm($"[italic]{Localization.Core.Try_to_find_SCSI_READ_LONG_size
}[/]"))
2022-03-06 13:29:38 +00:00
AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(),
new PercentageColumn()).Start(ctx =>
{
ProgressTask task =
ctx.AddTask(Localization.Core.Trying_to_READ_LONG);
2022-03-06 13:29:38 +00:00
task.MaxValue = ushort.MaxValue;
2019-12-07 19:54:27 +00:00
for(ushort i = (ushort)report.SCSI.ReadCapabilities.BlockSize;; i++)
{
2022-03-06 13:29:38 +00:00
task.Value = i;
task.Description =
string.
Format(Localization.Core.Trying_READ_LONG_with_size_0,
i);
2022-03-07 07:36:44 +00:00
sense = report.SCSI.ReadCapabilities.SupportsReadLong16 == true
? dev.ReadLong16(out buffer, out senseBuffer, false,
0, i, dev.Timeout, out _)
: dev.ReadLong10(out buffer, out senseBuffer, false,
false, 0, i, dev.Timeout, out _);
if(!sense)
2021-09-13 18:08:44 +01:00
{
2022-03-06 13:29:38 +00:00
report.SCSI.ReadCapabilities.LongBlockSize = i;
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
break;
}
2022-03-06 13:29:38 +00:00
if(i == ushort.MaxValue)
break;
}
2022-03-06 13:29:38 +00:00
AaruConsole.WriteLine();
});
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
if(report.SCSI.ReadCapabilities.SupportsReadLong == true &&
report.SCSI.ReadCapabilities.LongBlockSize != report.SCSI.ReadCapabilities.BlockSize)
{
Core.Spectre.ProgressSingleSpinner(ctx =>
{
ctx.AddTask(Localization.Core.Trying_SCSI_READ_LONG_10).IsIndeterminate();
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0,
(ushort)report.SCSI.ReadCapabilities.LongBlockSize,
dev.Timeout, out _);
});
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
if(!sense)
report.SCSI.ReadCapabilities.ReadLong10Data = buffer;
}
2022-03-06 13:29:38 +00:00
if(report.SCSI.ReadCapabilities.SupportsReadLong16 == true &&
report.SCSI.ReadCapabilities.LongBlockSize != report.SCSI.ReadCapabilities.BlockSize)
{
Core.Spectre.ProgressSingleSpinner(ctx =>
{
ctx.AddTask(Localization.Core.Trying_SCSI_READ_LONG_16).IsIndeterminate();
2021-09-13 18:08:44 +01:00
2022-03-06 13:29:38 +00:00
sense = dev.ReadLong16(out buffer, out senseBuffer, false, 0,
report.SCSI.ReadCapabilities.LongBlockSize.Value,
dev.Timeout, out _);
});
2022-03-06 13:29:38 +00:00
if(!sense)
report.SCSI.ReadCapabilities.ReadLong16Data = buffer;
}
}
2022-03-06 13:29:38 +00:00
break;
}
2022-03-06 13:29:38 +00:00
}
2022-03-06 13:29:38 +00:00
break;
default: throw new NotSupportedException(Localization.Core.Unknown_device_type);
2022-03-06 13:29:38 +00:00
}
* commandline: * DiscImageChef.Settings/Settings.cs: * DiscImageChef.Settings/docs/README.txt: * DiscImageChef.Settings/packages.config: * DiscImageChef.Settings/docs/LICENSE.txt: * DiscImageChef.Settings/docs/ChangeLog.txt: * DiscImageChef.Settings/docs/mono/index.xml: * DiscImageChef.Settings/docs/html/index.html: * DiscImageChef.Settings/Properties/AssemblyInfo.cs: * DiscImageChef.Settings/DiscImageChef.Settings.csproj: * DiscImageChef.Settings/docs/mono/ns-Claunia.PropertyList.xml: * DiscImageChef.Settings/docs/mono/Claunia.PropertyList/UID.xml: * DiscImageChef.Settings/docs/html/Claunia.PropertyList/UID.html: * DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSSet.xml: * DiscImageChef.Settings/docs/html/Claunia.PropertyList/index.html: * DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSSet.html: * DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSDate.xml: * DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSData.xml: * DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSDate.html: * DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSData.html: * DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSArray.xml: * DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSNumber.xml: * DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSString.xml: * DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSObject.xml: * DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSArray.html: * DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSNumber.html: * DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSString.html: * DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSObject.html: * DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSDictionary.xml: * DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSDictionary.html: * DiscImageChef.Settings/docs/mono/Claunia.PropertyList/PropertyListParser.xml: * DiscImageChef.Settings/docs/html/Claunia.PropertyList/PropertyListParser.html: * DiscImageChef.Settings/docs/mono/Claunia.PropertyList/XmlPropertyListParser.xml: * DiscImageChef.Settings/docs/html/Claunia.PropertyList/XmlPropertyListParser.html: * DiscImageChef.Settings/docs/mono/Claunia.PropertyList/ASCIIPropertyListParser.xml: * DiscImageChef.Settings/docs/html/Claunia.PropertyList/ASCIIPropertyListParser.html: * DiscImageChef.Settings/docs/mono/Claunia.PropertyList/BinaryPropertyListParser.xml: * DiscImageChef.Settings/docs/mono/Claunia.PropertyList/BinaryPropertyListWriter.xml: * DiscImageChef.Settings/docs/html/Claunia.PropertyList/BinaryPropertyListWriter.html: * DiscImageChef.Settings/docs/html/Claunia.PropertyList/BinaryPropertyListParser.html: * DiscImageChef.Settings/docs/mono/Claunia.PropertyList/PropertyListFormatException.xml: * DiscImageChef.Settings/docs/html/Claunia.PropertyList/PropertyListFormatException.html: Added supports for settings * DiscImageChef/Commands/Configure.cs: Added support for settings. * DiscImageChef/Core/Statistics.cs: * DiscImageChef/Commands/Verify.cs: * DiscImageChef/Commands/Entropy.cs: * DiscImageChef/Commands/Formats.cs: * DiscImageChef/Commands/PrintHex.cs: * DiscImageChef/Commands/MediaInfo.cs: * DiscImageChef/Commands/Statistics.cs: Added statistics. * DiscImageChef.Decoders/SCSI/Inquiry.cs: Corrected bug on inquiry decoding. * DiscImageChef.Decoders/SCSI/Modes.cs: Corrected bug on decoding mode page 2Ah without write performance descriptors. Corrected bug when there is a vendor page 0 in mode sense decoding. * DiscImageChef.Devices/Device/Constructor.cs: Corrected detecting USB or FireWire attached CD/DVD/BD and tape drives. Try ATA identify on USB or FireWire that don't have SCSI INQUIRY. * DiscImageChef.DiscImages/CDRWin.cs: Corrected CD-ROM XA vs CD-ROM detection. * DiscImageChef.Partitions/AppleMap.cs: Corrected big endian working. Added debug output. * DiscImageChef.sln: Added supports for settings. * DiscImageChef/Commands/Decode.cs: * DiscImageChef/Commands/Analyze.cs: * DiscImageChef/Commands/Compare.cs: * DiscImageChef/Commands/Checksum.cs: * DiscImageChef/Commands/Benchmark.cs: * DiscImageChef/Commands/DeviceInfo.cs: * DiscImageChef/Commands/CreateSidecar.cs: Added statistics. * DiscImageChef/Commands/DeviceReport.cs: Added statistics. Correct handling empty inquiry string fields. Suppose it is not removable, til proved wrong. Corrected MODE SENSE (6/10) detection and calling order. If device is MMC type but reports neither mode page 2Ah neither GET CONFIGURATION, try all CDs (old drives work like that). Try reading Lead-In and Lead-Out in Audio CD using Audio READ CD commands. Corrected READ LONG information handling, some drives return 2s-complement in 32 bit. Upper 16 bits are ignored. Added support for DVD raw block (37856 bytes). Check READ LONG up to 36 times the cooked block size. That should be enough to detect huge blocked media (like DVD and BD) without taking ages. If READ LONG size had to be bruteforced, and debug is activated, save the result. * DiscImageChef/Commands/DumpMedia.cs: Added statistics. Corrected READ LONG information handling, some drives return 2s-complement in 32 bit. Upper 16 bits are ignored. Start trying with 64 blocks at a time. Some drives report to be able to read 255 at a time, but they really don't, they take a lot longer to read. * DiscImageChef/Commands/MediaScan.cs: Added statistics. Start trying with 64 blocks at a time. Some drives report to be able to read 255 at a time, but they really don't, they take a lot longer to read. * DiscImageChef/DiscImageChef.csproj: Added support for settings. Added statistics. * DiscImageChef/Main.cs: * DiscImageChef/Options.cs: Added support for settings. Added statistics.
2016-02-03 18:58:11 +00:00
2022-03-06 13:29:38 +00:00
var jsonFs = new FileStream(jsonFile, FileMode.Create);
var jsonSw = new StreamWriter(jsonFs);
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
jsonSw.Write(JsonConvert.SerializeObject(report, Formatting.Indented, new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore
}));
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
jsonSw.Close();
jsonFs.Close();
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). * DiscImageChef.Metadata/DeviceReport.cs: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DumpMedia.cs: Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/CreateSidecar.cs: Moved checksum generation to a separate class. * CICMMetadata: Added support for ADIP. * DiscImageChef.CommonTypes/MediaType.cs: Added parameters of UDO media. Moved DataPlay outside of Iomega, as it's not from that manufacturer. Added missing Exatape media and corrected 160m XL one. Added SyJet media. Added all ECMA defined magneto-optical (sectors calculated from specifications, unchecked). Added PD media. Added Imation 320Gb RDX. Added generic USB flash drives. * DiscImageChef.Decoders/SCSI/Enums.cs: Make enumerations public. * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Devices/Device/Constructor.cs: Trim space padded strings on SCSI INQUIRY. * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: Added PREVENT ALLOW MEDIUM REMOVAL. Added START STOP UNIT. * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: Rename NEC methods. * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: Corrected Pioneer transfer length calculation. * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: Renamed Plextor methods. * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with MMC same name but different command. * DiscImageChef.Devices/DiscImageChef.Devices.csproj: Set platform target to x86 (does it really matter?). * DiscImageChef.Devices/Linux/Command.cs: Reduced allocation for readlink() to current kernel MAX_PATH. * DiscImageChef.Devices/Linux/Enums.cs: Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves commands not working on 32-bit environments. * DiscImageChef.DiscImages/ZZZRawImage.cs: Changed ECMA-184 and ECMA-183 enums. * DiscImageChef.Metadata/Dimensions.cs: Added all ECMA defined magneto-opticals. Added PD media. Added 320Gb RDX. Corrected Exatape 160m XL. Added Exatape 22m and 28m. * DiscImageChef.Metadata/MediaType.cs: Added 356mm magneto-optical media. Changed ECMA-184 and ECMA-183 enums. Added USB generic flash drive. * DiscImageChef/Commands/DeviceInfo.cs: Corrected SCSI INQUIRY naming. Corrected SCSI MODE SENSE (6) parameters. Reduced SCSI MODE SENSE timeout, some devices just get stuck with unsupported MODE SENSE commanda and must be left to timeout. Changed FUJITSU vendor string comparison. * DiscImageChef/Commands/MediaInfo.cs: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). Changed some error WriteLine() to debug ones. Too much verbosity. Added DVD media type decoding from PFI. Found a drive that dumps ADIP, enabling it again (not decoded). * DiscImageChef/Commands/MediaScan.cs: Added option to generate ImgBurn compatible log to media-scan command. * DiscImageChef/DiscImageChef.csproj: Moved checksum generation to a separate class. Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Main.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Options.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. Added option to generate ImgBurn compatible log to media-scan command.
2016-01-31 08:05:56 +00:00
using(var ctx = AaruContext.Create(Settings.Settings.LocalDbPath))
2022-03-06 13:29:38 +00:00
{
ctx.Reports.Add(new Report(report));
ctx.SaveChanges();
}
2018-11-27 01:42:38 +00:00
2022-03-06 13:29:38 +00:00
// TODO:
if(Settings.Settings.Current.ShareReports)
2022-03-06 13:29:38 +00:00
Remote.SubmitReport(report);
2019-12-07 19:54:27 +00:00
2022-03-06 13:29:38 +00:00
return (int)ErrorNumber.NoError;
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). * DiscImageChef.Metadata/DeviceReport.cs: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: Added command to guess drive and media parameters and output an XML report of them. * DiscImageChef/Commands/DumpMedia.cs: Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/CreateSidecar.cs: Moved checksum generation to a separate class. * CICMMetadata: Added support for ADIP. * DiscImageChef.CommonTypes/MediaType.cs: Added parameters of UDO media. Moved DataPlay outside of Iomega, as it's not from that manufacturer. Added missing Exatape media and corrected 160m XL one. Added SyJet media. Added all ECMA defined magneto-optical (sectors calculated from specifications, unchecked). Added PD media. Added Imation 320Gb RDX. Added generic USB flash drives. * DiscImageChef.Decoders/SCSI/Enums.cs: Make enumerations public. * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Devices/Device/Constructor.cs: Trim space padded strings on SCSI INQUIRY. * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: Added PREVENT ALLOW MEDIUM REMOVAL. Added START STOP UNIT. * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: Rename NEC methods. * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: Corrected Pioneer transfer length calculation. * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: Renamed Plextor methods. * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with MMC same name but different command. * DiscImageChef.Devices/DiscImageChef.Devices.csproj: Set platform target to x86 (does it really matter?). * DiscImageChef.Devices/Linux/Command.cs: Reduced allocation for readlink() to current kernel MAX_PATH. * DiscImageChef.Devices/Linux/Enums.cs: Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves commands not working on 32-bit environments. * DiscImageChef.DiscImages/ZZZRawImage.cs: Changed ECMA-184 and ECMA-183 enums. * DiscImageChef.Metadata/Dimensions.cs: Added all ECMA defined magneto-opticals. Added PD media. Added 320Gb RDX. Corrected Exatape 160m XL. Added Exatape 22m and 28m. * DiscImageChef.Metadata/MediaType.cs: Added 356mm magneto-optical media. Changed ECMA-184 and ECMA-183 enums. Added USB generic flash drive. * DiscImageChef/Commands/DeviceInfo.cs: Corrected SCSI INQUIRY naming. Corrected SCSI MODE SENSE (6) parameters. Reduced SCSI MODE SENSE timeout, some devices just get stuck with unsupported MODE SENSE commanda and must be left to timeout. Changed FUJITSU vendor string comparison. * DiscImageChef/Commands/MediaInfo.cs: Added method to calculate MediaType from SCSI parameters (mode, density, medium type, device type, etc). Changed some error WriteLine() to debug ones. Too much verbosity. Added DVD media type decoding from PFI. Found a drive that dumps ADIP, enabling it again (not decoded). * DiscImageChef/Commands/MediaScan.cs: Added option to generate ImgBurn compatible log to media-scan command. * DiscImageChef/DiscImageChef.csproj: Moved checksum generation to a separate class. Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Main.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. * DiscImageChef/Options.cs: Added command to guess drive and media parameters and output an XML report of them. Added preliminary command to dump media. Only SCSI for now. CDs and tapes are not supported. Errors are blalanty ignored. Options are incomplete. Not yet usable. Added option to generate ImgBurn compatible log to media-scan command.
2016-01-31 08:05:56 +00:00
}
2020-07-20 04:34:16 +01:00
}