Files
Aaru/Aaru.Core/Checksum.cs

806 lines
23 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
// ----------------------------------------------------------------------------
//
* 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
// Filename : Checksum.cs
// 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
//
// Component : Core algorithms.
* 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 ] ----------------------------------------------------------
//
2018-12-29 15:26:00 +00:00
// Multithread checksumming and hashing.
* 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/>.
//
// ----------------------------------------------------------------------------
2024-12-19 10:45:18 +00:00
// Copyright © 2011-2025 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
2017-12-19 19:33:46 +00:00
using System;
* 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.Collections.Generic;
2017-12-19 19:33:46 +00:00
using System.Threading;
2020-02-27 00:33:26 +00:00
using Aaru.Checksums;
using Aaru.CommonTypes.AaruMetadata;
2020-02-27 00:33:26 +00:00
using Aaru.CommonTypes.Interfaces;
* 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.Core;
2022-03-06 13:29:38 +00:00
/// <summary>Enabled checksums</summary>
[Flags]
public enum EnableChecksum
{
/// <summary>Enables Adler-32</summary>
Adler32 = 1,
/// <summary>Enables CRC-16</summary>
Crc16 = 2,
/// <summary>Enables CRC-32</summary>
Crc32 = 4,
/// <summary>Enables CRC-64</summary>
Crc64 = 8,
/// <summary>Enables MD5</summary>
Md5 = 16,
/// <summary>Enables SHA1</summary>
Sha1 = 64,
/// <summary>Enables SHA2-256</summary>
Sha256 = 128,
/// <summary>Enables SHA2-384</summary>
Sha384 = 256,
/// <summary>Enables SHA2-512</summary>
Sha512 = 512,
/// <summary>Enables SpamSum</summary>
SpamSum = 1024,
/// <summary>Enables Fletcher-16</summary>
Fletcher16 = 2048,
/// <summary>Enables Fletcher-32</summary>
Fletcher32 = 4096,
/// <summary>Enables all known checksums</summary>
2022-03-07 07:36:44 +00:00
All = Adler32 | Crc16 | Crc32 | Crc64 | Md5 | Sha1 | Sha256 | Sha384 | Sha512 | SpamSum | Fletcher16 | Fletcher32
2022-03-06 13:29:38 +00:00
}
/// <summary>Checksums and hashes data, with different algorithms, multithreaded</summary>
public sealed class Checksum
* 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
readonly IChecksum _adler32Ctx;
readonly IChecksum _crc16Ctx;
readonly IChecksum _crc32Ctx;
readonly IChecksum _crc64Ctx;
readonly EnableChecksum _enabled;
readonly IChecksum _f16Ctx;
readonly IChecksum _f32Ctx;
readonly IChecksum _md5Ctx;
readonly IChecksum _sha1Ctx;
readonly IChecksum _sha256Ctx;
readonly IChecksum _sha384Ctx;
readonly IChecksum _sha512Ctx;
readonly IChecksum _ssCtx;
HashPacket _adlerPkt;
Thread _adlerThread;
HashPacket _crc16Pkt;
Thread _crc16Thread;
HashPacket _crc32Pkt;
Thread _crc32Thread;
HashPacket _crc64Pkt;
Thread _crc64Thread;
HashPacket _f16Pkt;
Thread _f16Thread;
HashPacket _f32Pkt;
Thread _f32Thread;
HashPacket _md5Pkt;
Thread _md5Thread;
HashPacket _sha1Pkt;
Thread _sha1Thread;
HashPacket _sha256Pkt;
Thread _sha256Thread;
HashPacket _sha384Pkt;
Thread _sha384Thread;
HashPacket _sha512Pkt;
Thread _sha512Thread;
HashPacket _spamsumPkt;
Thread _spamsumThread;
/// <summary>Initializes an instance of the checksum operations</summary>
/// <param name="enabled">Enabled checksums</param>
public Checksum(EnableChecksum enabled = EnableChecksum.All)
{
2022-03-06 13:29:38 +00:00
_enabled = enabled;
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Adler32))
{
_adler32Ctx = new Adler32Context();
_adlerPkt = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = _adler32Ctx
};
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Crc16))
{
2023-10-05 02:31:59 +01:00
_crc16Ctx = new CRC16IbmContext();
2022-03-06 13:29:38 +00:00
_crc16Pkt = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = _crc16Ctx
};
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Crc32))
{
_crc32Ctx = new Crc32Context();
2022-03-06 13:29:38 +00:00
_crc32Pkt = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = _crc32Ctx
};
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Crc64))
{
_crc64Ctx = new Crc64Context();
2022-03-06 13:29:38 +00:00
_crc64Pkt = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = _crc64Ctx
};
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Md5))
{
_md5Ctx = new Md5Context();
2022-03-06 13:29:38 +00:00
_md5Pkt = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = _md5Ctx
};
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Sha1))
{
_sha1Ctx = new Sha1Context();
2022-03-06 13:29:38 +00:00
_sha1Pkt = new HashPacket
{
Context = _sha1Ctx
};
* 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(enabled.HasFlag(EnableChecksum.Sha256))
* 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
_sha256Ctx = new Sha256Context();
2022-03-06 13:29:38 +00:00
_sha256Pkt = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = _sha256Ctx
};
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Sha384))
{
_sha384Ctx = new Sha384Context();
2022-03-06 13:29:38 +00:00
_sha384Pkt = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = _sha384Ctx
};
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Sha512))
{
_sha512Ctx = new Sha512Context();
2022-03-06 13:29:38 +00:00
_sha512Pkt = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = _sha512Ctx
};
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.SpamSum))
{
_ssCtx = new SpamSumContext();
2022-03-06 13:29:38 +00:00
_spamsumPkt = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = _ssCtx
};
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Fletcher16))
{
_f16Ctx = new Fletcher16Context();
2022-03-06 13:29:38 +00:00
_f16Pkt = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = _f16Ctx
};
}
2016-04-19 02:11:47 +01:00
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Fletcher32))
{
_f32Ctx = new Fletcher32Context();
2022-03-06 13:29:38 +00:00
_f32Pkt = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = _f32Ctx
};
}
2022-03-06 13:29:38 +00:00
_adlerThread = new Thread(UpdateHash);
_crc16Thread = new Thread(UpdateHash);
_crc32Thread = new Thread(UpdateHash);
_crc64Thread = new Thread(UpdateHash);
_md5Thread = new Thread(UpdateHash);
_sha1Thread = new Thread(UpdateHash);
_sha256Thread = new Thread(UpdateHash);
_sha384Thread = new Thread(UpdateHash);
_sha512Thread = new Thread(UpdateHash);
_spamsumThread = new Thread(UpdateHash);
_f16Thread = new Thread(UpdateHash);
_f32Thread = new Thread(UpdateHash);
}
2022-03-06 13:29:38 +00:00
/// <summary>Updates the checksum with new data</summary>
/// <param name="data">New data</param>
public void Update(byte[] data)
{
if(_enabled.HasFlag(EnableChecksum.Adler32))
{
_adlerPkt.Data = data;
_adlerThread.Start(_adlerPkt);
}
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Crc16))
{
_crc16Pkt.Data = data;
_crc16Thread.Start(_crc16Pkt);
}
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Crc32))
{
_crc32Pkt.Data = data;
_crc32Thread.Start(_crc32Pkt);
}
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Crc64))
{
_crc64Pkt.Data = data;
_crc64Thread.Start(_crc64Pkt);
}
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Md5))
{
_md5Pkt.Data = data;
_md5Thread.Start(_md5Pkt);
}
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Sha1))
{
_sha1Pkt.Data = data;
_sha1Thread.Start(_sha1Pkt);
}
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Sha256))
{
_sha256Pkt.Data = data;
_sha256Thread.Start(_sha256Pkt);
}
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Sha384))
{
_sha384Pkt.Data = data;
_sha384Thread.Start(_sha384Pkt);
}
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Sha512))
{
_sha512Pkt.Data = data;
_sha512Thread.Start(_sha512Pkt);
}
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.SpamSum))
{
_spamsumPkt.Data = data;
_spamsumThread.Start(_spamsumPkt);
}
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Fletcher16))
{
_f16Pkt.Data = data;
_f16Thread.Start(_f16Pkt);
* 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(_enabled.HasFlag(EnableChecksum.Fletcher32))
* 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
_f32Pkt.Data = data;
_f32Thread.Start(_f32Pkt);
}
* 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
while(_adlerThread.IsAlive ||
_crc16Thread.IsAlive ||
_crc32Thread.IsAlive ||
_crc64Thread.IsAlive ||
_md5Thread.IsAlive ||
_sha1Thread.IsAlive ||
_sha256Thread.IsAlive ||
_sha384Thread.IsAlive ||
_sha512Thread.IsAlive ||
_spamsumThread.IsAlive ||
_f16Thread.IsAlive ||
_f32Thread.IsAlive) {}
2024-05-01 04:05:22 +01:00
if(_enabled.HasFlag(EnableChecksum.Adler32)) _adlerThread = new Thread(UpdateHash);
2024-05-01 04:05:22 +01:00
if(_enabled.HasFlag(EnableChecksum.Crc16)) _crc16Thread = new Thread(UpdateHash);
2024-05-01 04:05:22 +01:00
if(_enabled.HasFlag(EnableChecksum.Crc32)) _crc32Thread = new Thread(UpdateHash);
2024-05-01 04:05:22 +01:00
if(_enabled.HasFlag(EnableChecksum.Crc16)) _crc64Thread = new Thread(UpdateHash);
2024-05-01 04:05:22 +01:00
if(_enabled.HasFlag(EnableChecksum.Md5)) _md5Thread = new Thread(UpdateHash);
2024-05-01 04:05:22 +01:00
if(_enabled.HasFlag(EnableChecksum.Sha1)) _sha1Thread = new Thread(UpdateHash);
2024-05-01 04:05:22 +01:00
if(_enabled.HasFlag(EnableChecksum.Sha256)) _sha256Thread = new Thread(UpdateHash);
2024-05-01 04:05:22 +01:00
if(_enabled.HasFlag(EnableChecksum.Sha384)) _sha384Thread = new Thread(UpdateHash);
2024-05-01 04:05:22 +01:00
if(_enabled.HasFlag(EnableChecksum.Sha512)) _sha512Thread = new Thread(UpdateHash);
2022-03-06 13:29:38 +00:00
2024-05-01 04:05:22 +01:00
if(_enabled.HasFlag(EnableChecksum.SpamSum)) _spamsumThread = new Thread(UpdateHash);
2024-05-01 04:05:22 +01:00
if(_enabled.HasFlag(EnableChecksum.Fletcher16)) _f16Thread = new Thread(UpdateHash);
2022-03-06 13:29:38 +00:00
2024-05-01 04:05:22 +01:00
if(_enabled.HasFlag(EnableChecksum.Fletcher32)) _f32Thread = new Thread(UpdateHash);
2022-03-06 13:29:38 +00:00
}
/// <summary>Finishes the checksums</summary>
/// <returns>Returns the checksum results</returns>
public List<CommonTypes.AaruMetadata.Checksum> End()
2022-03-06 13:29:38 +00:00
{
2024-05-01 04:39:38 +01:00
List<CommonTypes.AaruMetadata.Checksum> chks = [];
if(_enabled.HasFlag(EnableChecksum.Adler32))
2023-10-03 22:57:50 +01:00
{
chks.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.Adler32,
2022-03-06 13:29:38 +00:00
Value = _adler32Ctx.End()
});
2023-10-03 22:57:50 +01:00
}
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Crc16))
2023-10-03 22:57:50 +01:00
{
chks.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.CRC16,
2022-03-06 13:29:38 +00:00
Value = _crc16Ctx.End()
});
2023-10-03 22:57:50 +01:00
}
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Crc32))
2023-10-03 22:57:50 +01:00
{
chks.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.CRC32,
2022-03-06 13:29:38 +00:00
Value = _crc32Ctx.End()
});
2023-10-03 22:57:50 +01:00
}
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Crc64))
2023-10-03 22:57:50 +01:00
{
chks.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.CRC64,
2022-03-06 13:29:38 +00:00
Value = _crc64Ctx.End()
});
2023-10-03 22:57:50 +01:00
}
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Md5))
2023-10-03 22:57:50 +01:00
{
chks.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.Md5,
2022-03-06 13:29:38 +00:00
Value = _md5Ctx.End()
});
2023-10-03 22:57:50 +01:00
}
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Sha1))
2023-10-03 22:57:50 +01:00
{
chks.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.Sha1,
2022-03-06 13:29:38 +00:00
Value = _sha1Ctx.End()
});
2023-10-03 22:57:50 +01:00
}
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Sha256))
2023-10-03 22:57:50 +01:00
{
chks.Add(new CommonTypes.AaruMetadata.Checksum
2022-03-06 13:29:38 +00:00
{
Type = ChecksumType.Sha256,
2022-03-06 13:29:38 +00:00
Value = _sha256Ctx.End()
});
2023-10-03 22:57:50 +01:00
}
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Sha384))
2023-10-03 22:57:50 +01:00
{
chks.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.Sha384,
2022-03-06 13:29:38 +00:00
Value = _sha384Ctx.End()
});
2023-10-03 22:57:50 +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
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Sha512))
2023-10-03 22:57:50 +01:00
{
chks.Add(new CommonTypes.AaruMetadata.Checksum
2022-03-06 13:29:38 +00:00
{
Type = ChecksumType.Sha512,
2022-03-06 13:29:38 +00:00
Value = _sha512Ctx.End()
});
2023-10-03 22:57:50 +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
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.SpamSum))
2023-10-03 22:57:50 +01:00
{
chks.Add(new CommonTypes.AaruMetadata.Checksum
2022-03-06 13:29:38 +00:00
{
Type = ChecksumType.SpamSum,
2022-03-06 13:29:38 +00:00
Value = _ssCtx.End()
});
2023-10-03 22:57:50 +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
2022-03-06 13:29:38 +00:00
if(_enabled.HasFlag(EnableChecksum.Fletcher16))
2023-10-03 22:57:50 +01:00
{
chks.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.Fletcher16,
2022-03-06 13:29:38 +00:00
Value = _f16Ctx.End()
});
2023-10-03 22:57:50 +01:00
}
2024-05-01 04:05:22 +01:00
if(!_enabled.HasFlag(EnableChecksum.Fletcher32)) return chks;
chks.Add(new CommonTypes.AaruMetadata.Checksum
2022-03-06 13:29:38 +00:00
{
Type = ChecksumType.Fletcher32,
2022-03-06 13:29:38 +00:00
Value = _f32Ctx.End()
});
2022-03-06 13:29:38 +00:00
return chks;
}
internal static List<CommonTypes.AaruMetadata.Checksum> GetChecksums(
byte[] data, EnableChecksum enabled = EnableChecksum.All)
2022-03-06 13:29:38 +00:00
{
IChecksum adler32CtxData = null;
IChecksum crc16CtxData = null;
IChecksum crc32CtxData = null;
IChecksum crc64CtxData = null;
IChecksum md5CtxData = null;
IChecksum sha1CtxData = null;
IChecksum sha256CtxData = null;
IChecksum sha384CtxData = null;
IChecksum sha512CtxData = null;
IChecksum ssctxData = null;
IChecksum f16CtxData = null;
IChecksum f32CtxData = null;
var adlerThreadData = new Thread(UpdateHash);
var crc16ThreadData = new Thread(UpdateHash);
var crc32ThreadData = new Thread(UpdateHash);
var crc64ThreadData = new Thread(UpdateHash);
var md5ThreadData = new Thread(UpdateHash);
var sha1ThreadData = new Thread(UpdateHash);
var sha256ThreadData = new Thread(UpdateHash);
var sha384ThreadData = new Thread(UpdateHash);
var sha512ThreadData = new Thread(UpdateHash);
var spamsumThreadData = new Thread(UpdateHash);
var f16ThreadData = new Thread(UpdateHash);
var f32ThreadData = new Thread(UpdateHash);
if(enabled.HasFlag(EnableChecksum.Adler32))
{
adler32CtxData = new Adler32Context();
var adlerPktData = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = adler32CtxData,
Data = data
};
2022-03-06 13:29:38 +00:00
adlerThreadData.Start(adlerPktData);
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Crc16))
{
2023-10-05 02:31:59 +01:00
crc16CtxData = new CRC16IbmContext();
2022-03-06 13:29:38 +00:00
var crc16PktData = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = crc16CtxData,
Data = data
};
2022-03-06 13:29:38 +00:00
crc16ThreadData.Start(crc16PktData);
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Crc32))
{
crc32CtxData = new Crc32Context();
2022-03-06 13:29:38 +00:00
var crc32PktData = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = crc32CtxData,
Data = data
};
2022-03-06 13:29:38 +00:00
crc32ThreadData.Start(crc32PktData);
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Crc64))
{
crc64CtxData = new Crc64Context();
2022-03-06 13:29:38 +00:00
var crc64PktData = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = crc64CtxData,
Data = data
};
2022-03-06 13:29:38 +00:00
crc64ThreadData.Start(crc64PktData);
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Md5))
{
md5CtxData = new Md5Context();
2022-03-06 13:29:38 +00:00
var md5PktData = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = md5CtxData,
Data = data
};
2022-03-06 13:29:38 +00:00
md5ThreadData.Start(md5PktData);
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Sha1))
{
sha1CtxData = new Sha1Context();
2022-03-06 13:29:38 +00:00
var sha1PktData = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = sha1CtxData,
Data = data
};
2022-03-06 13:29:38 +00:00
sha1ThreadData.Start(sha1PktData);
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Sha256))
{
sha256CtxData = new Sha256Context();
2022-03-06 13:29:38 +00:00
var sha256PktData = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = sha256CtxData,
Data = data
};
2022-03-06 13:29:38 +00:00
sha256ThreadData.Start(sha256PktData);
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Sha384))
{
sha384CtxData = new Sha384Context();
2022-03-06 13:29:38 +00:00
var sha384PktData = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = sha384CtxData,
Data = data
};
2022-03-06 13:29:38 +00:00
sha384ThreadData.Start(sha384PktData);
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Sha512))
{
sha512CtxData = new Sha512Context();
2022-03-06 13:29:38 +00:00
var sha512PktData = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = sha512CtxData,
Data = data
};
2022-03-06 13:29:38 +00:00
sha512ThreadData.Start(sha512PktData);
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.SpamSum))
{
ssctxData = new SpamSumContext();
2022-03-06 13:29:38 +00:00
var spamsumPktData = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = ssctxData,
Data = data
};
2022-03-06 13:29:38 +00:00
spamsumThreadData.Start(spamsumPktData);
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Fletcher16))
{
f16CtxData = new Fletcher16Context();
2018-06-22 08:08:38 +01:00
2022-03-06 13:29:38 +00:00
var f16PktData = new HashPacket
{
Context = f16CtxData,
Data = data
};
f16ThreadData.Start(f16PktData);
}
* 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(enabled.HasFlag(EnableChecksum.Fletcher32))
{
f32CtxData = new Fletcher32Context();
* 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
var f32PktData = new HashPacket
{
2022-03-06 13:29:38 +00:00
Context = f32CtxData,
Data = data
};
2022-03-06 13:29:38 +00:00
f32ThreadData.Start(f32PktData);
}
2022-03-06 13:29:38 +00:00
while(adlerThreadData.IsAlive ||
crc16ThreadData.IsAlive ||
crc32ThreadData.IsAlive ||
crc64ThreadData.IsAlive ||
md5ThreadData.IsAlive ||
sha1ThreadData.IsAlive ||
sha256ThreadData.IsAlive ||
sha384ThreadData.IsAlive ||
sha512ThreadData.IsAlive ||
spamsumThreadData.IsAlive ||
f16ThreadData.IsAlive ||
f32ThreadData.IsAlive) {}
2024-05-01 04:39:38 +01:00
List<CommonTypes.AaruMetadata.Checksum> dataChecksums = [];
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Adler32))
2023-10-03 22:57:50 +01:00
{
dataChecksums.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.Adler32,
2022-03-06 13:29:38 +00:00
Value = adler32CtxData.End()
});
2023-10-03 22:57:50 +01:00
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Crc16))
2023-10-03 22:57:50 +01:00
{
dataChecksums.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.CRC16,
2022-03-06 13:29:38 +00:00
Value = crc16CtxData.End()
});
2023-10-03 22:57:50 +01:00
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Crc32))
2023-10-03 22:57:50 +01:00
{
dataChecksums.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.CRC32,
2022-03-06 13:29:38 +00:00
Value = crc32CtxData.End()
});
2023-10-03 22:57:50 +01:00
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Crc64))
2023-10-03 22:57:50 +01:00
{
dataChecksums.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.CRC64,
2022-03-06 13:29:38 +00:00
Value = crc64CtxData.End()
});
2023-10-03 22:57:50 +01:00
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Md5))
2023-10-03 22:57:50 +01:00
{
dataChecksums.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.Md5,
2022-03-06 13:29:38 +00:00
Value = md5CtxData.End()
});
2023-10-03 22:57:50 +01:00
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Sha1))
2023-10-03 22:57:50 +01:00
{
dataChecksums.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.Sha1,
2022-03-06 13:29:38 +00:00
Value = sha1CtxData.End()
});
2023-10-03 22:57:50 +01:00
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Sha256))
2023-10-03 22:57:50 +01:00
{
dataChecksums.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.Sha256,
2022-03-06 13:29:38 +00:00
Value = sha256CtxData.End()
});
2023-10-03 22:57:50 +01:00
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Sha384))
2023-10-03 22:57:50 +01:00
{
dataChecksums.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.Sha384,
2022-03-06 13:29:38 +00:00
Value = sha384CtxData.End()
});
2023-10-03 22:57:50 +01:00
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Sha512))
2023-10-03 22:57:50 +01:00
{
dataChecksums.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.Sha512,
2022-03-06 13:29:38 +00:00
Value = sha512CtxData.End()
});
2023-10-03 22:57:50 +01:00
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.SpamSum))
2023-10-03 22:57:50 +01:00
{
dataChecksums.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.SpamSum,
2022-03-06 13:29:38 +00:00
Value = ssctxData.End()
});
2023-10-03 22:57:50 +01:00
}
2022-03-06 13:29:38 +00:00
if(enabled.HasFlag(EnableChecksum.Fletcher16))
2023-10-03 22:57:50 +01:00
{
dataChecksums.Add(new CommonTypes.AaruMetadata.Checksum
{
Type = ChecksumType.Fletcher16,
2022-03-06 13:29:38 +00:00
Value = f16CtxData.End()
});
2023-10-03 22:57:50 +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
2024-05-01 04:05:22 +01:00
if(!enabled.HasFlag(EnableChecksum.Fletcher32)) return dataChecksums;
dataChecksums.Add(new CommonTypes.AaruMetadata.Checksum
* 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
{
Type = ChecksumType.Fletcher32,
Value = f32CtxData.End()
});
* 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 dataChecksums;
* 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
2023-10-03 22:57:50 +01:00
#region Threading helpers
2022-03-06 13:29:38 +00:00
struct HashPacket
{
public IChecksum Context;
public byte[] Data;
}
static void UpdateHash(object packet) => ((HashPacket)packet).Context.Update(((HashPacket)packet).Data);
2023-10-03 22:57:50 +01:00
#endregion Threading helpers
}