diff --git a/.idea/.idea.DiscImageChef/.idea/contentModel.xml b/.idea/.idea.DiscImageChef/.idea/contentModel.xml index d197a7bee..8a44f449f 100644 --- a/.idea/.idea.DiscImageChef/.idea/contentModel.xml +++ b/.idea/.idea.DiscImageChef/.idea/contentModel.xml @@ -968,7 +968,6 @@ - diff --git a/DiscImageChef.Checksums/Adler32Context.cs b/DiscImageChef.Checksums/Adler32Context.cs index b750d6a00..d320bbf70 100644 --- a/DiscImageChef.Checksums/Adler32Context.cs +++ b/DiscImageChef.Checksums/Adler32Context.cs @@ -178,9 +178,6 @@ namespace DiscImageChef.Checksums /// /// Data buffer. /// Byte array of the hash value. - public static string Data(byte[] data, out byte[] hash) - { - return Data(data, (uint)data.Length, out hash); - } + public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash); } } \ No newline at end of file diff --git a/DiscImageChef.Checksums/CRC16Context.cs b/DiscImageChef.Checksums/CRC16Context.cs index abafc28ae..e07302d65 100644 --- a/DiscImageChef.Checksums/CRC16Context.cs +++ b/DiscImageChef.Checksums/CRC16Context.cs @@ -152,10 +152,8 @@ namespace DiscImageChef.Checksums /// /// File path. /// Byte array of the hash value. - public static string File(string filename, out byte[] hash) - { - return File(filename, out hash, CRC16_IBM_POLY, CRC16_IBM_SEED); - } + public static string File(string filename, out byte[] hash) => + File(filename, out hash, CRC16_IBM_POLY, CRC16_IBM_SEED); /// /// Gets the hash of a file in hexadecimal and as a byte array. @@ -204,10 +202,8 @@ namespace DiscImageChef.Checksums /// Data buffer. /// Length of the data buffer to hash. /// Byte array of the hash value. - public static string Data(byte[] data, uint len, out byte[] hash) - { - return Data(data, len, out hash, CRC16_IBM_POLY, CRC16_IBM_SEED); - } + public static string Data(byte[] data, uint len, out byte[] hash) => + Data(data, len, out hash, CRC16_IBM_POLY, CRC16_IBM_SEED); /// /// Gets the hash of the specified data buffer. @@ -253,9 +249,6 @@ namespace DiscImageChef.Checksums /// /// Data buffer. /// Byte array of the hash value. - public static string Data(byte[] data, out byte[] hash) - { - return Data(data, (uint)data.Length, out hash); - } + public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash); } } \ No newline at end of file diff --git a/DiscImageChef.Checksums/CRC32Context.cs b/DiscImageChef.Checksums/CRC32Context.cs index 00981dd81..898669f30 100644 --- a/DiscImageChef.Checksums/CRC32Context.cs +++ b/DiscImageChef.Checksums/CRC32Context.cs @@ -152,10 +152,8 @@ namespace DiscImageChef.Checksums /// /// File path. /// Byte array of the hash value. - public static string File(string filename, out byte[] hash) - { - return File(filename, out hash, CRC32_ISO_POLY, CRC32_ISO_SEED); - } + public static string File(string filename, out byte[] hash) => + File(filename, out hash, CRC32_ISO_POLY, CRC32_ISO_SEED); /// /// Gets the hash of a file in hexadecimal and as a byte array. @@ -203,10 +201,8 @@ namespace DiscImageChef.Checksums /// Data buffer. /// Length of the data buffer to hash. /// Byte array of the hash value. - public static string Data(byte[] data, uint len, out byte[] hash) - { - return Data(data, len, out hash, CRC32_ISO_POLY, CRC32_ISO_SEED); - } + public static string Data(byte[] data, uint len, out byte[] hash) => + Data(data, len, out hash, CRC32_ISO_POLY, CRC32_ISO_SEED); /// /// Gets the hash of the specified data buffer. @@ -252,9 +248,6 @@ namespace DiscImageChef.Checksums /// /// Data buffer. /// Byte array of the hash value. - public static string Data(byte[] data, out byte[] hash) - { - return Data(data, (uint)data.Length, out hash); - } + public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash); } } \ No newline at end of file diff --git a/DiscImageChef.Checksums/CRC64Context.cs b/DiscImageChef.Checksums/CRC64Context.cs index 3c19c4f05..7882d03f0 100644 --- a/DiscImageChef.Checksums/CRC64Context.cs +++ b/DiscImageChef.Checksums/CRC64Context.cs @@ -152,10 +152,8 @@ namespace DiscImageChef.Checksums /// /// File path. /// Byte array of the hash value. - public static string File(string filename, out byte[] hash) - { - return File(filename, out hash, CRC64_ECMA_POLY, CRC64_ECMA_SEED); - } + public static string File(string filename, out byte[] hash) => + File(filename, out hash, CRC64_ECMA_POLY, CRC64_ECMA_SEED); /// /// Gets the hash of a file in hexadecimal and as a byte array. @@ -203,10 +201,8 @@ namespace DiscImageChef.Checksums /// Data buffer. /// Length of the data buffer to hash. /// Byte array of the hash value. - public static string Data(byte[] data, uint len, out byte[] hash) - { - return Data(data, len, out hash, CRC64_ECMA_POLY, CRC64_ECMA_SEED); - } + public static string Data(byte[] data, uint len, out byte[] hash) => + Data(data, len, out hash, CRC64_ECMA_POLY, CRC64_ECMA_SEED); /// /// Gets the hash of the specified data buffer. @@ -252,9 +248,6 @@ namespace DiscImageChef.Checksums /// /// Data buffer. /// Byte array of the hash value. - public static string Data(byte[] data, out byte[] hash) - { - return Data(data, (uint)data.Length, out hash); - } + public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash); } } \ No newline at end of file diff --git a/DiscImageChef.Checksums/FletcherContext.cs b/DiscImageChef.Checksums/FletcherContext.cs index de56cc622..3dcd7acde 100644 --- a/DiscImageChef.Checksums/FletcherContext.cs +++ b/DiscImageChef.Checksums/FletcherContext.cs @@ -180,10 +180,7 @@ namespace DiscImageChef.Checksums /// /// Data buffer. /// Byte array of the hash value. - public static string Data(byte[] data, out byte[] hash) - { - return Data(data, (uint)data.Length, out hash); - } + public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash); } /// @@ -327,9 +324,6 @@ namespace DiscImageChef.Checksums /// /// Data buffer. /// Byte array of the hash value. - public static string Data(byte[] data, out byte[] hash) - { - return Data(data, (uint)data.Length, out hash); - } + public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash); } } \ No newline at end of file diff --git a/DiscImageChef.Checksums/MD5Context.cs b/DiscImageChef.Checksums/MD5Context.cs index a6374998f..b1f76a3c7 100644 --- a/DiscImageChef.Checksums/MD5Context.cs +++ b/DiscImageChef.Checksums/MD5Context.cs @@ -147,9 +147,6 @@ namespace DiscImageChef.Checksums /// /// Data buffer. /// Byte array of the hash value. - public static string Data(byte[] data, out byte[] hash) - { - return Data(data, (uint)data.Length, out hash); - } + public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash); } } \ No newline at end of file diff --git a/DiscImageChef.Checksums/RIPEMD160Context.cs b/DiscImageChef.Checksums/RIPEMD160Context.cs index c889558a7..91663985a 100644 --- a/DiscImageChef.Checksums/RIPEMD160Context.cs +++ b/DiscImageChef.Checksums/RIPEMD160Context.cs @@ -149,10 +149,7 @@ namespace DiscImageChef.Checksums /// /// Data buffer. /// Byte array of the hash value. - public static string Data(byte[] data, out byte[] hash) - { - return Data(data, (uint)data.Length, out hash); - } + public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash); } } diff --git a/DiscImageChef.Checksums/ReedSolomon.cs b/DiscImageChef.Checksums/ReedSolomon.cs index f4530cd2c..eb3f11c03 100644 --- a/DiscImageChef.Checksums/ReedSolomon.cs +++ b/DiscImageChef.Checksums/ReedSolomon.cs @@ -176,10 +176,7 @@ namespace DiscImageChef.Checksums return x; } - static int Min(int a, int b) - { - return a < b ? a : b; - } + static int Min(int a, int b) => a < b ? a : b; static void Clear(ref int[] a, int n) { diff --git a/DiscImageChef.Checksums/Register.cs b/DiscImageChef.Checksums/Register.cs index 776b274f6..ed0e2f527 100644 --- a/DiscImageChef.Checksums/Register.cs +++ b/DiscImageChef.Checksums/Register.cs @@ -52,44 +52,20 @@ namespace DiscImageChef.Checksums .Where(t => t.IsClass).ToList(); } - public List GetAllFilesystemPlugins() - { - return null; - } + public List GetAllFilesystemPlugins() => null; - public List GetAllFilterPlugins() - { - return null; - } + public List GetAllFilterPlugins() => null; - public List GetAllFloppyImagePlugins() - { - return null; - } + public List GetAllFloppyImagePlugins() => null; - public List GetAllMediaImagePlugins() - { - return null; - } + public List GetAllMediaImagePlugins() => null; - public List GetAllPartitionPlugins() - { - return null; - } + public List GetAllPartitionPlugins() => null; - public List GetAllReadOnlyFilesystemPlugins() - { - return null; - } + public List GetAllReadOnlyFilesystemPlugins() => null; - public List GetAllWritableFloppyImagePlugins() - { - return null; - } + public List GetAllWritableFloppyImagePlugins() => null; - public List GetAllWritableImagePlugins() - { - return null; - } + public List GetAllWritableImagePlugins() => null; } } \ No newline at end of file diff --git a/DiscImageChef.Checksums/SHA1Context.cs b/DiscImageChef.Checksums/SHA1Context.cs index ca34ba5ac..5dde5f749 100644 --- a/DiscImageChef.Checksums/SHA1Context.cs +++ b/DiscImageChef.Checksums/SHA1Context.cs @@ -147,9 +147,6 @@ namespace DiscImageChef.Checksums /// /// Data buffer. /// Byte array of the hash value. - public static string Data(byte[] data, out byte[] hash) - { - return Data(data, (uint)data.Length, out hash); - } + public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash); } } \ No newline at end of file diff --git a/DiscImageChef.Checksums/SHA256Context.cs b/DiscImageChef.Checksums/SHA256Context.cs index 80f4e1ad1..ad1d6fd2a 100644 --- a/DiscImageChef.Checksums/SHA256Context.cs +++ b/DiscImageChef.Checksums/SHA256Context.cs @@ -147,9 +147,6 @@ namespace DiscImageChef.Checksums /// /// Data buffer. /// Byte array of the hash value. - public static string Data(byte[] data, out byte[] hash) - { - return Data(data, (uint)data.Length, out hash); - } + public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash); } } \ No newline at end of file diff --git a/DiscImageChef.Checksums/SHA384Context.cs b/DiscImageChef.Checksums/SHA384Context.cs index 9335b31c1..10cb1412f 100644 --- a/DiscImageChef.Checksums/SHA384Context.cs +++ b/DiscImageChef.Checksums/SHA384Context.cs @@ -147,9 +147,6 @@ namespace DiscImageChef.Checksums /// /// Data buffer. /// Byte array of the hash value. - public static string Data(byte[] data, out byte[] hash) - { - return Data(data, (uint)data.Length, out hash); - } + public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash); } } \ No newline at end of file diff --git a/DiscImageChef.Checksums/SHA512Context.cs b/DiscImageChef.Checksums/SHA512Context.cs index 372137d88..bcddd007d 100644 --- a/DiscImageChef.Checksums/SHA512Context.cs +++ b/DiscImageChef.Checksums/SHA512Context.cs @@ -147,9 +147,6 @@ namespace DiscImageChef.Checksums /// /// Data buffer. /// Byte array of the hash value. - public static string Data(byte[] data, out byte[] hash) - { - return Data(data, (uint)data.Length, out hash); - } + public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash); } } \ No newline at end of file diff --git a/DiscImageChef.Checksums/SpamSumContext.cs b/DiscImageChef.Checksums/SpamSumContext.cs index f011187e0..81d9d0d87 100644 --- a/DiscImageChef.Checksums/SpamSumContext.cs +++ b/DiscImageChef.Checksums/SpamSumContext.cs @@ -60,10 +60,10 @@ namespace DiscImageChef.Checksums //"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; readonly byte[] b64 = { - 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, - 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, - 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x30, 0x31, - 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2B, 0x2F + 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, + 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, + 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, + 0x7A, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2B, 0x2F }; FuzzyState self; @@ -110,11 +110,7 @@ namespace DiscImageChef.Checksums /// /// Returns a byte array of the hash value. /// - public byte[] Final() - { - // SpamSum does not have a binary representation, or so it seems - throw new NotImplementedException("SpamSum does not have a binary representation."); - } + public byte[] Final() => throw new NotImplementedException("SpamSum does not have a binary representation."); /// /// Returns a base64 representation of the hash value. @@ -159,21 +155,12 @@ namespace DiscImageChef.Checksums self.Roll.H3 ^= c; } - uint roll_sum() - { - return self.Roll.H1 + self.Roll.H2 + self.Roll.H3; - } + uint roll_sum() => self.Roll.H1 + self.Roll.H2 + self.Roll.H3; /* A simple non-rolling hash, based on the FNV hash. */ - static uint sum_hash(byte c, uint h) - { - return (h * HASH_PRIME) ^ c; - } + static uint sum_hash(byte c, uint h) => (h * HASH_PRIME) ^ c; - static uint SSDEEP_BS(uint index) - { - return MIN_BLOCKSIZE << (int)index; - } + static uint SSDEEP_BS(uint index) => MIN_BLOCKSIZE << (int)index; void fuzzy_try_fork_blockhash() { @@ -394,22 +381,16 @@ namespace DiscImageChef.Checksums /// Gets the hash of a file /// /// File path. - public static byte[] File(string filename) - { - // SpamSum does not have a binary representation, or so it seems + public static byte[] File(string filename) => throw new NotImplementedException("SpamSum does not have a binary representation."); - } /// /// Gets the hash of a file in hexadecimal and as a byte array. /// /// File path. /// Byte array of the hash value. - public static string File(string filename, out byte[] hash) - { - // SpamSum does not have a binary representation, or so it seems + public static string File(string filename, out byte[] hash) => throw new NotImplementedException("Not yet implemented."); - } /// /// Gets the hash of the specified data buffer. @@ -435,10 +416,7 @@ namespace DiscImageChef.Checksums /// Data buffer. /// null /// Base64 representation of SpamSum $blocksize:$hash:$hash - public static string Data(byte[] data, out byte[] hash) - { - return Data(data, (uint)data.Length, out hash); - } + public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash); // Converts an ASCII null-terminated string to .NET string static string CToString(byte[] cString) diff --git a/DiscImageChef.CommonTypes/Enums/DeviceType.cs b/DiscImageChef.CommonTypes/Enums/DeviceType.cs index d8b37fd81..49efef201 100644 --- a/DiscImageChef.CommonTypes/Enums/DeviceType.cs +++ b/DiscImageChef.CommonTypes/Enums/DeviceType.cs @@ -35,6 +35,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + namespace DiscImageChef.CommonTypes.Enums { public enum DeviceType diff --git a/DiscImageChef.CommonTypes/Extents/ExtentsByte.cs b/DiscImageChef.CommonTypes/Extents/ExtentsByte.cs index bbd65eaa2..6227129d9 100644 --- a/DiscImageChef.CommonTypes/Extents/ExtentsByte.cs +++ b/DiscImageChef.CommonTypes/Extents/ExtentsByte.cs @@ -228,10 +228,7 @@ namespace DiscImageChef.CommonTypes.Extents /// last element /// /// Array of - public Tuple[] ToArray() - { - return backend.ToArray(); - } + public Tuple[] ToArray() => backend.ToArray(); /// /// Gets the first element of the extent that contains the specified item diff --git a/DiscImageChef.CommonTypes/Extents/ExtentsInt.cs b/DiscImageChef.CommonTypes/Extents/ExtentsInt.cs index 7eb64c1ba..5c1fd40d7 100644 --- a/DiscImageChef.CommonTypes/Extents/ExtentsInt.cs +++ b/DiscImageChef.CommonTypes/Extents/ExtentsInt.cs @@ -228,10 +228,7 @@ namespace DiscImageChef.CommonTypes.Extents /// last element /// /// Array of - public Tuple[] ToArray() - { - return backend.ToArray(); - } + public Tuple[] ToArray() => backend.ToArray(); /// /// Gets the first element of the extent that contains the specified item diff --git a/DiscImageChef.CommonTypes/Extents/ExtentsLong.cs b/DiscImageChef.CommonTypes/Extents/ExtentsLong.cs index b137cbc5e..cda536f78 100644 --- a/DiscImageChef.CommonTypes/Extents/ExtentsLong.cs +++ b/DiscImageChef.CommonTypes/Extents/ExtentsLong.cs @@ -228,10 +228,7 @@ namespace DiscImageChef.CommonTypes.Extents /// last element /// /// Array of - public Tuple[] ToArray() - { - return backend.ToArray(); - } + public Tuple[] ToArray() => backend.ToArray(); /// /// Gets the first element of the extent that contains the specified item diff --git a/DiscImageChef.CommonTypes/Extents/ExtentsSByte.cs b/DiscImageChef.CommonTypes/Extents/ExtentsSByte.cs index f7f2bcae0..31a23e0e7 100644 --- a/DiscImageChef.CommonTypes/Extents/ExtentsSByte.cs +++ b/DiscImageChef.CommonTypes/Extents/ExtentsSByte.cs @@ -228,10 +228,7 @@ namespace DiscImageChef.CommonTypes.Extents /// last element /// /// Array of - public Tuple[] ToArray() - { - return backend.ToArray(); - } + public Tuple[] ToArray() => backend.ToArray(); /// /// Gets the first element of the extent that contains the specified item diff --git a/DiscImageChef.CommonTypes/Extents/ExtentsShort.cs b/DiscImageChef.CommonTypes/Extents/ExtentsShort.cs index 13491ed2b..5e09cd3af 100644 --- a/DiscImageChef.CommonTypes/Extents/ExtentsShort.cs +++ b/DiscImageChef.CommonTypes/Extents/ExtentsShort.cs @@ -228,10 +228,7 @@ namespace DiscImageChef.CommonTypes.Extents /// last element /// /// Array of - public Tuple[] ToArray() - { - return backend.ToArray(); - } + public Tuple[] ToArray() => backend.ToArray(); /// /// Gets the first element of the extent that contains the specified item diff --git a/DiscImageChef.CommonTypes/Extents/ExtentsUInt.cs b/DiscImageChef.CommonTypes/Extents/ExtentsUInt.cs index 5892fe76c..2c80f799b 100644 --- a/DiscImageChef.CommonTypes/Extents/ExtentsUInt.cs +++ b/DiscImageChef.CommonTypes/Extents/ExtentsUInt.cs @@ -228,10 +228,7 @@ namespace DiscImageChef.CommonTypes.Extents /// last element /// /// Array of - public Tuple[] ToArray() - { - return backend.ToArray(); - } + public Tuple[] ToArray() => backend.ToArray(); /// /// Gets the first element of the extent that contains the specified item diff --git a/DiscImageChef.CommonTypes/Extents/ExtentsULong.cs b/DiscImageChef.CommonTypes/Extents/ExtentsULong.cs index 683de421a..8540a0aea 100644 --- a/DiscImageChef.CommonTypes/Extents/ExtentsULong.cs +++ b/DiscImageChef.CommonTypes/Extents/ExtentsULong.cs @@ -228,10 +228,7 @@ namespace DiscImageChef.CommonTypes.Extents /// last element /// /// Array of - public Tuple[] ToArray() - { - return backend.ToArray(); - } + public Tuple[] ToArray() => backend.ToArray(); /// /// Gets the first element of the extent that contains the specified item diff --git a/DiscImageChef.CommonTypes/Extents/ExtentsUShort.cs b/DiscImageChef.CommonTypes/Extents/ExtentsUShort.cs index a2ee9a1bd..cec53bbd3 100644 --- a/DiscImageChef.CommonTypes/Extents/ExtentsUShort.cs +++ b/DiscImageChef.CommonTypes/Extents/ExtentsUShort.cs @@ -228,10 +228,7 @@ namespace DiscImageChef.CommonTypes.Extents /// last element /// /// Array of - public Tuple[] ToArray() - { - return backend.ToArray(); - } + public Tuple[] ToArray() => backend.ToArray(); /// /// Gets the first element of the extent that contains the specified item diff --git a/DiscImageChef.CommonTypes/Filters.cs b/DiscImageChef.CommonTypes/Filters.cs index 642ffc6b4..297c4389f 100644 --- a/DiscImageChef.CommonTypes/Filters.cs +++ b/DiscImageChef.CommonTypes/Filters.cs @@ -106,9 +106,6 @@ namespace DiscImageChef.CommonTypes /// Gets all known filters /// /// Known filters - public SortedDictionary GetFiltersList() - { - return Filters; - } + public SortedDictionary GetFiltersList() => Filters; } } \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Geometry.cs b/DiscImageChef.CommonTypes/Geometry.cs index 3e1f1ca58..6ea550953 100644 --- a/DiscImageChef.CommonTypes/Geometry.cs +++ b/DiscImageChef.CommonTypes/Geometry.cs @@ -117,21 +117,18 @@ namespace DiscImageChef.CommonTypes public static MediaType GetMediaType( (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding encoding, bool - variableSectorsPerTrack) geometry) - { - return (from geom in KnownGeometries - where geom.cylinders == geometry.cylinders && geom.heads == geometry.heads && - geom.sectorsPerTrack == geometry.sectorsPerTrack && - geom.bytesPerSector == geometry.bytesPerSector && - geom.encoding == geometry.encoding && - geom.variableSectorsPerTrack == geometry.variableSectorsPerTrack - select geom.type).FirstOrDefault(); - } + variableSectorsPerTrack) geometry) => + (from geom in KnownGeometries + where geom.cylinders == geometry.cylinders && + geom.heads == geometry.heads && + geom.sectorsPerTrack == geometry.sectorsPerTrack && + geom.bytesPerSector == geometry.bytesPerSector && + geom.encoding == geometry.encoding && + geom.variableSectorsPerTrack == geometry.variableSectorsPerTrack + select geom.type).FirstOrDefault(); public static (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding encoding - , bool variableSectorsPerTrack, MediaType type) GetGeometry(MediaType mediaType) - { - return (from geom in KnownGeometries where geom.type == mediaType select geom).FirstOrDefault(); - } + , bool variableSectorsPerTrack, MediaType type) GetGeometry(MediaType mediaType) => + (from geom in KnownGeometries where geom.type == mediaType select geom).FirstOrDefault(); } } \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Interfaces/IPluginRegister.cs b/DiscImageChef.CommonTypes/Interfaces/IPluginRegister.cs index 711e70b04..e95f72c44 100644 --- a/DiscImageChef.CommonTypes/Interfaces/IPluginRegister.cs +++ b/DiscImageChef.CommonTypes/Interfaces/IPluginRegister.cs @@ -44,55 +44,55 @@ namespace DiscImageChef.CommonTypes.Interfaces public interface IPluginRegister { /// - /// Gets all checksum plugins + /// Gets all checksum plugins /// /// List of checksum plugins List GetAllChecksumPlugins(); /// - /// Gets all filesystem plugins + /// Gets all filesystem plugins /// /// List of filesystem plugins List GetAllFilesystemPlugins(); /// - /// Gets all filter plugins + /// Gets all filter plugins /// /// List of filter plugins List GetAllFilterPlugins(); /// - /// Gets all floppy image plugins + /// Gets all floppy image plugins /// /// List of floppy image plugins List GetAllFloppyImagePlugins(); /// - /// Gets all media image plugins + /// Gets all media image plugins /// /// List of media image plugins List GetAllMediaImagePlugins(); /// - /// Gets all partition plugins + /// Gets all partition plugins /// /// List of partition plugins List GetAllPartitionPlugins(); /// - /// Gets all read-only filesystem plugins + /// Gets all read-only filesystem plugins /// /// List of read-only filesystem plugins List GetAllReadOnlyFilesystemPlugins(); /// - /// Gets all writable floppy image plugins + /// Gets all writable floppy image plugins /// /// List of writable floppy image plugins List GetAllWritableFloppyImagePlugins(); /// - /// Gets all writable media image plugins + /// Gets all writable media image plugins /// /// List of writable media image plugins List GetAllWritableImagePlugins(); diff --git a/DiscImageChef.CommonTypes/Interop/DetectOS.cs b/DiscImageChef.CommonTypes/Interop/DetectOS.cs index c51ecd918..350034e24 100644 --- a/DiscImageChef.CommonTypes/Interop/DetectOS.cs +++ b/DiscImageChef.CommonTypes/Interop/DetectOS.cs @@ -63,6 +63,28 @@ namespace DiscImageChef.CommonTypes.Interop GetRealPlatformID() == PlatformID.Win32Windows || GetRealPlatformID() == PlatformID.WinCE || GetRealPlatformID() == PlatformID.WindowsPhone || GetRealPlatformID() == PlatformID.Xbox; + public static bool IsAdmin + { + get + { + if(!IsWindows) return Environment.UserName == "root"; + + bool isAdmin; + WindowsIdentity user = null; + try + { + user = WindowsIdentity.GetCurrent(); + WindowsPrincipal principal = new WindowsPrincipal(user); + isAdmin = principal.IsInRole(WindowsBuiltInRole.Administrator); + } + catch(UnauthorizedAccessException ex) { isAdmin = false; } + catch(Exception ex) { isAdmin = false; } + finally { user?.Dispose(); } + + return isAdmin; + } + } + [DllImport("libc", SetLastError = true)] static extern int uname(out utsname name); @@ -276,28 +298,6 @@ namespace DiscImageChef.CommonTypes.Interop } } - public static bool IsAdmin - { - get - { - if(!IsWindows) return Environment.UserName == "root"; - - bool isAdmin; - WindowsIdentity user = null; - try - { - user = WindowsIdentity.GetCurrent(); - WindowsPrincipal principal = new WindowsPrincipal(user); - isAdmin = principal.IsInRole(WindowsBuiltInRole.Administrator); - } - catch(UnauthorizedAccessException ex) { isAdmin = false; } - catch(Exception ex) { isAdmin = false; } - finally { user?.Dispose(); } - - return isAdmin; - } - } - /// /// POSIX uname structure, size from OSX, big enough to handle extra fields /// diff --git a/DiscImageChef.CommonTypes/Interop/Version.cs b/DiscImageChef.CommonTypes/Interop/Version.cs index c50a26d8e..3dfbe4f89 100644 --- a/DiscImageChef.CommonTypes/Interop/Version.cs +++ b/DiscImageChef.CommonTypes/Interop/Version.cs @@ -48,10 +48,7 @@ namespace DiscImageChef.CommonTypes.Interop /// Gets version string /// /// Version - public static string GetVersion() - { - return typeof(Version).Assembly.GetName().Version.ToString(); - } + public static string GetVersion() => typeof(Version).Assembly.GetName().Version.ToString(); public static string GetNetCoreVersion() { diff --git a/DiscImageChef.CommonTypes/MediaType.cs b/DiscImageChef.CommonTypes/MediaType.cs index a58c0fd4a..465c38b98 100644 --- a/DiscImageChef.CommonTypes/MediaType.cs +++ b/DiscImageChef.CommonTypes/MediaType.cs @@ -269,7 +269,7 @@ namespace DiscImageChef.CommonTypes /// Sega/Yamaha recordable Gigabyte Disc GDR = 153, SegaCard = 154, - MilCD = 155, + MilCD = 155, #endregion Sega game media, types 150 to 169 #region Other game media, types 170 to 179 diff --git a/DiscImageChef.CommonTypes/Metadata/Statistics.cs b/DiscImageChef.CommonTypes/Metadata/Statistics.cs index 8363d4d5c..236996f8a 100644 --- a/DiscImageChef.CommonTypes/Metadata/Statistics.cs +++ b/DiscImageChef.CommonTypes/Metadata/Statistics.cs @@ -68,15 +68,15 @@ namespace DiscImageChef.CommonTypes.Metadata public class StatsDto { - public List Commands { get; set; } - public List OperatingSystems { get; set; } - public List Versions { get; set; } - public List Filesystems { get; set; } - public List Partitions { get; set; } - public List MediaFormats { get; set; } - public List Filters { get; set; } - public List Devices { get; set; } - public List Medias { get; set; } + public List Commands { get; set; } + public List OperatingSystems { get; set; } + public List Versions { get; set; } + public List Filesystems { get; set; } + public List Partitions { get; set; } + public List MediaFormats { get; set; } + public List Filters { get; set; } + public List Devices { get; set; } + public List Medias { get; set; } } public class CommandsStats diff --git a/DiscImageChef.CommonTypes/Metadata/Version.cs b/DiscImageChef.CommonTypes/Metadata/Version.cs index b9b71172e..0284f6061 100644 --- a/DiscImageChef.CommonTypes/Metadata/Version.cs +++ b/DiscImageChef.CommonTypes/Metadata/Version.cs @@ -47,14 +47,12 @@ namespace DiscImageChef.CommonTypes.Metadata /// Gets XML software type for the running version /// /// XML software type - public static SoftwareType GetSoftwareType() - { - return new SoftwareType + public static SoftwareType GetSoftwareType() => + new SoftwareType { Name = "DiscImageChef", OperatingSystem = DetectOS.GetRealPlatformID().ToString(), Version = typeof(Version).Assembly.GetName().Version.ToString() }; - } } } \ No newline at end of file diff --git a/DiscImageChef.CommonTypes/Partition.cs b/DiscImageChef.CommonTypes/Partition.cs index f28b0a4cb..f933081e3 100644 --- a/DiscImageChef.CommonTypes/Partition.cs +++ b/DiscImageChef.CommonTypes/Partition.cs @@ -71,20 +71,11 @@ namespace DiscImageChef.CommonTypes /// /// Partition to compare with /// 0 if both partitions start and end at the same sector - public bool Equals(Partition other) - { - return Start == other.Start && Length == other.Length; - } + public bool Equals(Partition other) => Start == other.Start && Length == other.Length; - public override bool Equals(object obj) - { - return obj is Partition partition && Equals(partition); - } + public override bool Equals(object obj) => obj is Partition partition && Equals(partition); - public override int GetHashCode() - { - return Start.GetHashCode() + End.GetHashCode(); - } + public override int GetHashCode() => Start.GetHashCode() + End.GetHashCode(); /// /// Compares this partition with another and returns an integer that indicates whether the current partition precedes, @@ -102,39 +93,21 @@ namespace DiscImageChef.CommonTypes } // Define the equality operator. - public static bool operator ==(Partition operand1, Partition operand2) - { - return operand1.Equals(operand2); - } + public static bool operator ==(Partition operand1, Partition operand2) => operand1.Equals(operand2); // Define the inequality operator. - public static bool operator !=(Partition operand1, Partition operand2) - { - return !operand1.Equals(operand2); - } + public static bool operator !=(Partition operand1, Partition operand2) => !operand1.Equals(operand2); // Define the is greater than operator. - public static bool operator >(Partition operand1, Partition operand2) - { - return operand1.CompareTo(operand2) == 1; - } + public static bool operator >(Partition operand1, Partition operand2) => operand1.CompareTo(operand2) == 1; // Define the is less than operator. - public static bool operator <(Partition operand1, Partition operand2) - { - return operand1.CompareTo(operand2) == -1; - } + public static bool operator <(Partition operand1, Partition operand2) => operand1.CompareTo(operand2) == -1; // Define the is greater than or equal to operator. - public static bool operator >=(Partition operand1, Partition operand2) - { - return operand1.CompareTo(operand2) >= 0; - } + public static bool operator >=(Partition operand1, Partition operand2) => operand1.CompareTo(operand2) >= 0; // Define the is less than or equal to operator. - public static bool operator <=(Partition operand1, Partition operand2) - { - return operand1.CompareTo(operand2) <= 0; - } + public static bool operator <=(Partition operand1, Partition operand2) => operand1.CompareTo(operand2) <= 0; } } \ No newline at end of file diff --git a/DiscImageChef.Compression/TeleDiskLzh.cs b/DiscImageChef.Compression/TeleDiskLzh.cs index 65f7e0bad..524c514b5 100644 --- a/DiscImageChef.Compression/TeleDiskLzh.cs +++ b/DiscImageChef.Compression/TeleDiskLzh.cs @@ -80,40 +80,42 @@ namespace DiscImageChef.Compression /* decoder table */ readonly byte[] d_code = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, - 0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D, 0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F, 0x10, 0x10, - 0x10, 0x10, 0x11, 0x11, 0x11, 0x11, 0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13, 0x14, 0x14, 0x14, 0x14, - 0x15, 0x15, 0x15, 0x15, 0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17, 0x18, 0x18, 0x19, 0x19, 0x1A, 0x1A, - 0x1B, 0x1B, 0x1C, 0x1C, 0x1D, 0x1D, 0x1E, 0x1E, 0x1F, 0x1F, 0x20, 0x20, 0x21, 0x21, 0x22, 0x22, 0x23, 0x23, - 0x24, 0x24, 0x25, 0x25, 0x26, 0x26, 0x27, 0x27, 0x28, 0x28, 0x29, 0x29, 0x2A, 0x2A, 0x2B, 0x2B, 0x2C, 0x2C, - 0x2D, 0x2D, 0x2E, 0x2E, 0x2F, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, - 0x3C, 0x3D, 0x3E, 0x3F + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, + 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D, 0x0E, + 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F, 0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11, 0x12, 0x12, + 0x12, 0x12, 0x13, 0x13, 0x13, 0x13, 0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15, 0x16, 0x16, 0x16, + 0x16, 0x17, 0x17, 0x17, 0x17, 0x18, 0x18, 0x19, 0x19, 0x1A, 0x1A, 0x1B, 0x1B, 0x1C, 0x1C, 0x1D, 0x1D, + 0x1E, 0x1E, 0x1F, 0x1F, 0x20, 0x20, 0x21, 0x21, 0x22, 0x22, 0x23, 0x23, 0x24, 0x24, 0x25, 0x25, 0x26, + 0x26, 0x27, 0x27, 0x28, 0x28, 0x29, 0x29, 0x2A, 0x2A, 0x2B, 0x2B, 0x2C, 0x2C, 0x2D, 0x2D, 0x2E, 0x2E, + 0x2F, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, + 0x3F }; readonly byte[] d_len = { - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08 + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08 }; readonly Stream inStream; diff --git a/DiscImageChef.Core/Benchmark.cs b/DiscImageChef.Core/Benchmark.cs index 4c79f56ad..8042341b4 100644 --- a/DiscImageChef.Core/Benchmark.cs +++ b/DiscImageChef.Core/Benchmark.cs @@ -361,7 +361,8 @@ namespace DiscImageChef.Core results.SeparateTime += (end - start).TotalSeconds; #endregion MD5 -#if !NETSTANDARD2_0 + #if !NETSTANDARD2_0 + #region RIPEMD160 ctx = new Ripemd160Context(); ms.Seek(0, SeekOrigin.Begin); @@ -393,7 +394,8 @@ namespace DiscImageChef.Core }); results.SeparateTime += (end - start).TotalSeconds; #endregion RIPEMD160 -#endif + + #endif #region SHA1 ctx = new Sha1Context(); diff --git a/DiscImageChef.Core/Checksum.cs b/DiscImageChef.Core/Checksum.cs index f3c2aaf6a..2dfa2b034 100644 --- a/DiscImageChef.Core/Checksum.cs +++ b/DiscImageChef.Core/Checksum.cs @@ -42,14 +42,14 @@ namespace DiscImageChef.Core [Flags] public enum EnableChecksum { - Adler32 = 1, - Crc16 = 2, - Crc32 = 4, - Crc64 = 8, - Md5 = 16, -#if !NETSTANDARD2_0 - Ripemd160 = 32, -#endif + Adler32 = 1, + Crc16 = 2, + Crc32 = 4, + Crc64 = 8, + Md5 = 16, + #if !NETSTANDARD2_0 + Ripemd160 = 32, + #endif Sha1 = 64, Sha256 = 128, Sha384 = 256, @@ -57,12 +57,11 @@ namespace DiscImageChef.Core SpamSum = 1024, Fletcher16 = 2048, Fletcher32 = 4096, - All = Adler32 | Crc16 | Crc32 | Crc64 | Md5 | -#if !NETSTANDARD2_0 + All = Adler32 | Crc16 | Crc32 | Crc64 | Md5 | + #if !NETSTANDARD2_0 Ripemd160 | -#endif - Sha1 | Sha256 | Sha384 | Sha512 | SpamSum | - Fletcher16 | Fletcher32 + #endif + Sha1 | Sha256 | Sha384 | Sha512 | SpamSum | Fletcher16 | Fletcher32 } /// @@ -92,11 +91,6 @@ namespace DiscImageChef.Core IChecksum md5Ctx; HashPacket md5Pkt; Thread md5Thread; -#if !NETSTANDARD2_0 - IChecksum ripemd160Ctx; - HashPacket ripemd160Pkt; - Thread ripemd160Thread; -#endif IChecksum sha1Ctx; HashPacket sha1Pkt; Thread sha1Thread; @@ -147,13 +141,13 @@ namespace DiscImageChef.Core md5Pkt = new HashPacket {Context = md5Ctx}; } -#if !NETSTANDARD2_0 + #if !NETSTANDARD2_0 if(enabled.HasFlag(EnableChecksum.Ripemd160)) { ripemd160Ctx = new Ripemd160Context(); ripemd160Pkt = new HashPacket {Context = ripemd160Ctx}; } -#endif + #endif if(enabled.HasFlag(EnableChecksum.Sha1)) { @@ -197,21 +191,21 @@ namespace DiscImageChef.Core f32Pkt = new HashPacket {Context = f32Ctx}; } - adlerThread = new Thread(UpdateHash); - crc16Thread = new Thread(UpdateHash); - crc32Thread = new Thread(UpdateHash); - crc64Thread = new Thread(UpdateHash); - md5Thread = new Thread(UpdateHash); -#if !NETSTANDARD2_0 + adlerThread = new Thread(UpdateHash); + crc16Thread = new Thread(UpdateHash); + crc32Thread = new Thread(UpdateHash); + crc64Thread = new Thread(UpdateHash); + md5Thread = new Thread(UpdateHash); + #if !NETSTANDARD2_0 ripemd160Thread = new Thread(UpdateHash); -#endif - 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); + #endif + 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); } public void Update(byte[] data) @@ -246,13 +240,13 @@ namespace DiscImageChef.Core md5Thread.Start(md5Pkt); } -#if !NETSTANDARD2_0 + #if !NETSTANDARD2_0 if(enabled.HasFlag(EnableChecksum.Ripemd160)) { ripemd160Pkt.Data = data; ripemd160Thread.Start(ripemd160Pkt); } -#endif + #endif if(enabled.HasFlag(EnableChecksum.Sha1)) { @@ -296,30 +290,29 @@ namespace DiscImageChef.Core f32Thread.Start(f32Pkt); } - while(adlerThread.IsAlive || crc16Thread.IsAlive || crc32Thread.IsAlive || crc64Thread.IsAlive || - md5Thread.IsAlive || -#if !NETSTANDARD2_0 + while(adlerThread.IsAlive || crc16Thread.IsAlive || crc32Thread.IsAlive || crc64Thread.IsAlive || + md5Thread.IsAlive || + #if !NETSTANDARD2_0 ripemd160Thread.IsAlive || -#endif - sha1Thread.IsAlive || sha256Thread.IsAlive || - sha384Thread.IsAlive || sha512Thread.IsAlive || spamsumThread.IsAlive || f16Thread.IsAlive || - f32Thread.IsAlive) { } + #endif + sha1Thread.IsAlive || sha256Thread.IsAlive || sha384Thread.IsAlive || sha512Thread.IsAlive || + spamsumThread.IsAlive || f16Thread.IsAlive || f32Thread.IsAlive) { } - if(enabled.HasFlag(EnableChecksum.SpamSum)) adlerThread = new Thread(UpdateHash); - if(enabled.HasFlag(EnableChecksum.SpamSum)) crc16Thread = new Thread(UpdateHash); - if(enabled.HasFlag(EnableChecksum.SpamSum)) crc32Thread = new Thread(UpdateHash); - if(enabled.HasFlag(EnableChecksum.SpamSum)) crc64Thread = new Thread(UpdateHash); - if(enabled.HasFlag(EnableChecksum.SpamSum)) md5Thread = new Thread(UpdateHash); -#if !NETSTANDARD2_0 + if(enabled.HasFlag(EnableChecksum.SpamSum)) adlerThread = new Thread(UpdateHash); + if(enabled.HasFlag(EnableChecksum.SpamSum)) crc16Thread = new Thread(UpdateHash); + if(enabled.HasFlag(EnableChecksum.SpamSum)) crc32Thread = new Thread(UpdateHash); + if(enabled.HasFlag(EnableChecksum.SpamSum)) crc64Thread = new Thread(UpdateHash); + if(enabled.HasFlag(EnableChecksum.SpamSum)) md5Thread = new Thread(UpdateHash); + #if !NETSTANDARD2_0 if(enabled.HasFlag(EnableChecksum.SpamSum)) ripemd160Thread = new Thread(UpdateHash); -#endif - if(enabled.HasFlag(EnableChecksum.SpamSum)) sha1Thread = new Thread(UpdateHash); - if(enabled.HasFlag(EnableChecksum.SpamSum)) sha256Thread = new Thread(UpdateHash); - if(enabled.HasFlag(EnableChecksum.SpamSum)) sha384Thread = new Thread(UpdateHash); - if(enabled.HasFlag(EnableChecksum.SpamSum)) sha512Thread = new Thread(UpdateHash); - if(enabled.HasFlag(EnableChecksum.SpamSum)) spamsumThread = new Thread(UpdateHash); - if(enabled.HasFlag(EnableChecksum.SpamSum)) f16Thread = new Thread(UpdateHash); - if(enabled.HasFlag(EnableChecksum.SpamSum)) f32Thread = new Thread(UpdateHash); + #endif + if(enabled.HasFlag(EnableChecksum.SpamSum)) sha1Thread = new Thread(UpdateHash); + if(enabled.HasFlag(EnableChecksum.SpamSum)) sha256Thread = new Thread(UpdateHash); + if(enabled.HasFlag(EnableChecksum.SpamSum)) sha384Thread = new Thread(UpdateHash); + if(enabled.HasFlag(EnableChecksum.SpamSum)) sha512Thread = new Thread(UpdateHash); + if(enabled.HasFlag(EnableChecksum.SpamSum)) spamsumThread = new Thread(UpdateHash); + if(enabled.HasFlag(EnableChecksum.SpamSum)) f16Thread = new Thread(UpdateHash); + if(enabled.HasFlag(EnableChecksum.SpamSum)) f32Thread = new Thread(UpdateHash); } public List End() @@ -358,13 +351,13 @@ namespace DiscImageChef.Core chks.Add(chk); } -#if !NETSTANDARD2_0 + #if !NETSTANDARD2_0 if(enabled.HasFlag(EnableChecksum.Ripemd160)) { chk = new ChecksumType {type = ChecksumTypeType.ripemd160, Value = ripemd160Ctx.End()}; chks.Add(chk); } -#endif + #endif if(enabled.HasFlag(EnableChecksum.Sha1)) { @@ -412,37 +405,37 @@ namespace DiscImageChef.Core internal static List GetChecksums(byte[] data, EnableChecksum enabled = EnableChecksum.All) { - IChecksum adler32CtxData = null; - IChecksum crc16CtxData = null; - IChecksum crc32CtxData = null; - IChecksum crc64CtxData = null; - IChecksum md5CtxData = null; -#if !NETSTANDARD2_0 + IChecksum adler32CtxData = null; + IChecksum crc16CtxData = null; + IChecksum crc32CtxData = null; + IChecksum crc64CtxData = null; + IChecksum md5CtxData = null; + #if !NETSTANDARD2_0 IChecksum ripemd160CtxData = null; -#endif - IChecksum sha1CtxData = null; - IChecksum sha256CtxData = null; - IChecksum sha384CtxData = null; - IChecksum sha512CtxData = null; - IChecksum ssctxData = null; - IChecksum f16CtxData = null; - IChecksum f32CtxData = null; + #endif + IChecksum sha1CtxData = null; + IChecksum sha256CtxData = null; + IChecksum sha384CtxData = null; + IChecksum sha512CtxData = null; + IChecksum ssctxData = null; + IChecksum f16CtxData = null; + IChecksum f32CtxData = null; - Thread adlerThreadData = new Thread(UpdateHash); - Thread crc16ThreadData = new Thread(UpdateHash); - Thread crc32ThreadData = new Thread(UpdateHash); - Thread crc64ThreadData = new Thread(UpdateHash); - Thread md5ThreadData = new Thread(UpdateHash); -#if !NETSTANDARD2_0 + Thread adlerThreadData = new Thread(UpdateHash); + Thread crc16ThreadData = new Thread(UpdateHash); + Thread crc32ThreadData = new Thread(UpdateHash); + Thread crc64ThreadData = new Thread(UpdateHash); + Thread md5ThreadData = new Thread(UpdateHash); + #if !NETSTANDARD2_0 Thread ripemd160ThreadData = new Thread(UpdateHash); -#endif - Thread sha1ThreadData = new Thread(UpdateHash); - Thread sha256ThreadData = new Thread(UpdateHash); - Thread sha384ThreadData = new Thread(UpdateHash); - Thread sha512ThreadData = new Thread(UpdateHash); - Thread spamsumThreadData = new Thread(UpdateHash); - Thread f16ThreadData = new Thread(UpdateHash); - Thread f32ThreadData = new Thread(UpdateHash); + #endif + Thread sha1ThreadData = new Thread(UpdateHash); + Thread sha256ThreadData = new Thread(UpdateHash); + Thread sha384ThreadData = new Thread(UpdateHash); + Thread sha512ThreadData = new Thread(UpdateHash); + Thread spamsumThreadData = new Thread(UpdateHash); + Thread f16ThreadData = new Thread(UpdateHash); + Thread f32ThreadData = new Thread(UpdateHash); if(enabled.HasFlag(EnableChecksum.Adler32)) { @@ -479,14 +472,14 @@ namespace DiscImageChef.Core md5ThreadData.Start(md5PktData); } -#if !NETSTANDARD2_0 + #if !NETSTANDARD2_0 if(enabled.HasFlag(EnableChecksum.Ripemd160)) { ripemd160CtxData = new Ripemd160Context(); HashPacket ripemd160PktData = new HashPacket {Context = ripemd160CtxData, Data = data}; ripemd160ThreadData.Start(ripemd160PktData); } -#endif + #endif if(enabled.HasFlag(EnableChecksum.Sha1)) { @@ -537,13 +530,13 @@ namespace DiscImageChef.Core f32ThreadData.Start(f32PktData); } - while(adlerThreadData.IsAlive || crc16ThreadData.IsAlive || crc32ThreadData.IsAlive || - crc64ThreadData.IsAlive || md5ThreadData.IsAlive || -#if !NETSTANDARD2_0 + while(adlerThreadData.IsAlive || crc16ThreadData.IsAlive || crc32ThreadData.IsAlive || + crc64ThreadData.IsAlive || md5ThreadData.IsAlive || + #if !NETSTANDARD2_0 ripemd160ThreadData.IsAlive || -#endif - sha1ThreadData.IsAlive || sha256ThreadData.IsAlive || sha384ThreadData.IsAlive || - sha512ThreadData.IsAlive || spamsumThreadData.IsAlive || f16ThreadData.IsAlive || + #endif + sha1ThreadData.IsAlive || sha256ThreadData.IsAlive || sha384ThreadData.IsAlive || + sha512ThreadData.IsAlive || spamsumThreadData.IsAlive || f16ThreadData.IsAlive || f32ThreadData.IsAlive) { } List dataChecksums = new List(); @@ -579,13 +572,13 @@ namespace DiscImageChef.Core dataChecksums.Add(chk); } -#if !NETSTANDARD2_0 + #if !NETSTANDARD2_0 if(enabled.HasFlag(EnableChecksum.Ripemd160)) { chk = new ChecksumType {type = ChecksumTypeType.ripemd160, Value = ripemd160CtxData.End()}; dataChecksums.Add(chk); } -#endif + #endif if(enabled.HasFlag(EnableChecksum.Sha1)) { @@ -631,6 +624,11 @@ namespace DiscImageChef.Core return dataChecksums; } + #if !NETSTANDARD2_0 + IChecksum ripemd160Ctx; + HashPacket ripemd160Pkt; + Thread ripemd160Thread; + #endif #region Threading helpers struct HashPacket diff --git a/DiscImageChef.Core/DataFile.cs b/DiscImageChef.Core/DataFile.cs index 4d43b9acd..29a76ea67 100644 --- a/DiscImageChef.Core/DataFile.cs +++ b/DiscImageChef.Core/DataFile.cs @@ -68,10 +68,7 @@ namespace DiscImageChef.Core /// Offset of where data will be read /// How many bytes to read /// How many bytes were read - public int Read(byte[] array, int offset, int count) - { - return dataFs.Read(array, offset, count); - } + public int Read(byte[] array, int offset, int count) => dataFs.Read(array, offset, count); /// /// Seeks to the specified block @@ -79,10 +76,7 @@ namespace DiscImageChef.Core /// Block to seek to /// Block size in bytes /// Position - public long Seek(ulong block, ulong blockSize) - { - return dataFs.Seek((long)(block * blockSize), SeekOrigin.Begin); - } + public long Seek(ulong block, ulong blockSize) => dataFs.Seek((long)(block * blockSize), SeekOrigin.Begin); /// /// Seeks to specified byte position @@ -90,10 +84,7 @@ namespace DiscImageChef.Core /// Byte position /// Where to count for position /// Position - public long Seek(ulong offset, SeekOrigin origin) - { - return dataFs.Seek((long)offset, origin); - } + public long Seek(ulong offset, SeekOrigin origin) => dataFs.Seek((long)offset, origin); /// /// Seeks to specified byte position @@ -101,10 +92,7 @@ namespace DiscImageChef.Core /// Byte position /// Where to count for position /// Position - public long Seek(long offset, SeekOrigin origin) - { - return dataFs.Seek(offset, origin); - } + public long Seek(long offset, SeekOrigin origin) => dataFs.Seek(offset, origin); /// /// Writes data at current position diff --git a/DiscImageChef.Core/Devices/Dumping/ATA.cs b/DiscImageChef.Core/Devices/Dumping/ATA.cs index 6490781b5..beb97c5cf 100644 --- a/DiscImageChef.Core/Devices/Dumping/ATA.cs +++ b/DiscImageChef.Core/Devices/Dumping/ATA.cs @@ -46,7 +46,6 @@ using DiscImageChef.Core.Logging; using DiscImageChef.Decoders.ATA; using DiscImageChef.Decoders.PCMCIA; using DiscImageChef.Devices; -using DiscImageChef.Filters; using Schemas; using MediaType = DiscImageChef.CommonTypes.MediaType; using Tuple = DiscImageChef.Decoders.PCMCIA.Tuple; diff --git a/DiscImageChef.Core/Devices/Dumping/SBC.cs b/DiscImageChef.Core/Devices/Dumping/SBC.cs index e720beb7e..394212e97 100644 --- a/DiscImageChef.Core/Devices/Dumping/SBC.cs +++ b/DiscImageChef.Core/Devices/Dumping/SBC.cs @@ -46,7 +46,6 @@ using DiscImageChef.Console; using DiscImageChef.Core.Logging; using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; -using DiscImageChef.Filters; using Schemas; using MediaType = DiscImageChef.CommonTypes.MediaType; using TrackType = DiscImageChef.CommonTypes.Enums.TrackType; @@ -498,9 +497,7 @@ namespace DiscImageChef.Core.Devices.Dumping pgMmc = new Modes.ModePage_01_MMC {PS = false, ReadRetryCount = 32, Parameter = 0x00}; currentModePage = new Modes.ModePage { - Page = 0x01, - Subpage = 0x00, - PageResponse = Modes.EncodeModePage_01_MMC(pgMmc) + Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01_MMC(pgMmc) }; } else @@ -521,9 +518,7 @@ namespace DiscImageChef.Core.Devices.Dumping currentModePage = new Modes.ModePage { - Page = 0x01, - Subpage = 0x00, - PageResponse = Modes.EncodeModePage_01(pg) + Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01(pg) }; } } @@ -569,9 +564,7 @@ namespace DiscImageChef.Core.Devices.Dumping { new Modes.ModePage { - Page = 0x01, - Subpage = 0x00, - PageResponse = Modes.EncodeModePage_01(pg) + Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01(pg) } } }; @@ -634,8 +627,7 @@ namespace DiscImageChef.Core.Devices.Dumping { Modes.DecodedMode md = new Modes.DecodedMode { - Header = new Modes.ModeHeader(), - Pages = new[] {currentModePage.Value} + Header = new Modes.ModeHeader(), Pages = new[] {currentModePage.Value} }; md6 = Modes.EncodeMode6(md, dev.ScsiType); md10 = Modes.EncodeMode10(md, dev.ScsiType); @@ -672,7 +664,7 @@ namespace DiscImageChef.Core.Devices.Dumping if(!ret && !force) { - dumpLog.WriteLine($"Cannot write USB descriptors."); + dumpLog.WriteLine("Cannot write USB descriptors."); throw new ArgumentException(outputPlugin.ErrorMessage); } } @@ -688,7 +680,7 @@ namespace DiscImageChef.Core.Devices.Dumping if(!ret && !force) { - dumpLog.WriteLine($"Cannot write ATAPI IDENTIFY PACKET DEVICE."); + dumpLog.WriteLine("Cannot write ATAPI IDENTIFY PACKET DEVICE."); throw new ArgumentException(outputPlugin.ErrorMessage); } } @@ -702,7 +694,7 @@ namespace DiscImageChef.Core.Devices.Dumping if(!ret && !force) { - dumpLog.WriteLine($"Cannot write SCSI INQUIRY."); + dumpLog.WriteLine("Cannot write SCSI INQUIRY."); throw new ArgumentException(outputPlugin.ErrorMessage); } @@ -723,7 +715,7 @@ namespace DiscImageChef.Core.Devices.Dumping if(!ret && !force) { - dumpLog.WriteLine($"Cannot write SCSI MODE SENSE (10)."); + dumpLog.WriteLine("Cannot write SCSI MODE SENSE (10)."); throw new ArgumentException(outputPlugin.ErrorMessage); } } @@ -744,7 +736,7 @@ namespace DiscImageChef.Core.Devices.Dumping if(!ret && !force) { - dumpLog.WriteLine($"Cannot write SCSI MODE SENSE (6)."); + dumpLog.WriteLine("Cannot write SCSI MODE SENSE (6)."); throw new ArgumentException(outputPlugin.ErrorMessage); } } diff --git a/DiscImageChef.Core/Devices/Dumping/SSC.cs b/DiscImageChef.Core/Devices/Dumping/SSC.cs index 122fc438f..d9f398865 100644 --- a/DiscImageChef.Core/Devices/Dumping/SSC.cs +++ b/DiscImageChef.Core/Devices/Dumping/SSC.cs @@ -652,8 +652,7 @@ namespace DiscImageChef.Core.Devices.Dumping // TODO: Implement device firmware revision sidecar.BlockMedia[0].Image = new ImageType { - format = "Raw disk image (sector by sector copy)", - Value = outputPrefix + ".bin" + format = "Raw disk image (sector by sector copy)", Value = outputPrefix + ".bin" }; sidecar.BlockMedia[0].LogicalBlocks = (long)blocks; sidecar.BlockMedia[0].Size = (long)currentSize; diff --git a/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs b/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs index eee2fb5f7..2acdaa9c5 100644 --- a/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs +++ b/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs @@ -45,7 +45,6 @@ using DiscImageChef.Console; using DiscImageChef.Core.Logging; using DiscImageChef.Decoders.MMC; using DiscImageChef.Devices; -using DiscImageChef.Filters; using Schemas; using MediaType = DiscImageChef.CommonTypes.MediaType; @@ -488,9 +487,7 @@ namespace DiscImageChef.Core.Devices.Dumping { cidDump = new DumpType { - Image = outputPath, - Size = cid.Length, - Checksums = Checksum.GetChecksums(cid).ToArray() + Image = outputPath, Size = cid.Length, Checksums = Checksum.GetChecksums(cid).ToArray() }; ret = @@ -511,9 +508,7 @@ namespace DiscImageChef.Core.Devices.Dumping { csdDump = new DumpType { - Image = outputPath, - Size = csd.Length, - Checksums = Checksum.GetChecksums(csd).ToArray() + Image = outputPath, Size = csd.Length, Checksums = Checksum.GetChecksums(csd).ToArray() }; ret = @@ -534,9 +529,7 @@ namespace DiscImageChef.Core.Devices.Dumping { sidecar.BlockMedia[0].MultiMediaCard.ExtendedCSD = new DumpType { - Image = outputPath, - Size = ecsd.Length, - Checksums = Checksum.GetChecksums(ecsd).ToArray() + Image = outputPath, Size = ecsd.Length, Checksums = Checksum.GetChecksums(ecsd).ToArray() }; ret = outputPlugin.WriteMediaTag(ecsd, MediaTagType.MMC_ExtendedCSD); @@ -553,9 +546,7 @@ namespace DiscImageChef.Core.Devices.Dumping { ocrDump = new DumpType { - Image = outputPath, - Size = ocr.Length, - Checksums = Checksum.GetChecksums(ocr).ToArray() + Image = outputPath, Size = ocr.Length, Checksums = Checksum.GetChecksums(ocr).ToArray() }; ret = @@ -576,9 +567,7 @@ namespace DiscImageChef.Core.Devices.Dumping { sidecar.BlockMedia[0].SecureDigital.SCR = new DumpType { - Image = outputPath, - Size = scr.Length, - Checksums = Checksum.GetChecksums(scr).ToArray() + Image = outputPath, Size = scr.Length, Checksums = Checksum.GetChecksums(scr).ToArray() }; ret = outputPlugin.WriteMediaTag(scr, MediaTagType.SD_SCR); diff --git a/DiscImageChef.Core/Devices/Dumping/XGD.cs b/DiscImageChef.Core/Devices/Dumping/XGD.cs index d47227cd7..97a7dc601 100644 --- a/DiscImageChef.Core/Devices/Dumping/XGD.cs +++ b/DiscImageChef.Core/Devices/Dumping/XGD.cs @@ -48,7 +48,6 @@ using DiscImageChef.Decoders.DVD; using DiscImageChef.Decoders.SCSI; using DiscImageChef.Decoders.Xbox; using DiscImageChef.Devices; -using DiscImageChef.Filters; using Schemas; using MediaType = DiscImageChef.CommonTypes.MediaType; using TrackType = DiscImageChef.CommonTypes.Enums.TrackType; @@ -746,9 +745,7 @@ namespace DiscImageChef.Core.Devices.Dumping pgMmc = new Modes.ModePage_01_MMC {PS = false, ReadRetryCount = 0x20, Parameter = 0x00}; currentModePage = new Modes.ModePage { - Page = 0x01, - Subpage = 0x00, - PageResponse = Modes.EncodeModePage_01_MMC(pgMmc) + Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01_MMC(pgMmc) }; } @@ -825,8 +822,7 @@ namespace DiscImageChef.Core.Devices.Dumping { Modes.DecodedMode md = new Modes.DecodedMode { - Header = new Modes.ModeHeader(), - Pages = new[] {currentModePage.Value} + Header = new Modes.ModeHeader(), Pages = new[] {currentModePage.Value} }; md6 = Modes.EncodeMode6(md, dev.ScsiType); md10 = Modes.EncodeMode10(md, dev.ScsiType); @@ -914,9 +910,7 @@ namespace DiscImageChef.Core.Devices.Dumping sidecar.OpticalDisc[0].Layers = new LayersType { - type = LayersTypeType.OTP, - typeSpecified = true, - Sectors = new SectorsType[1] + type = LayersTypeType.OTP, typeSpecified = true, Sectors = new SectorsType[1] }; sidecar.OpticalDisc[0].Layers.Sectors[0] = new SectorsType {Value = (long)layerBreak}; sidecar.OpticalDisc[0].Sessions = 1; diff --git a/DiscImageChef.Core/Devices/Info/Plextor.cs b/DiscImageChef.Core/Devices/Info/Plextor.cs index 3ac6ac84c..0fe49358f 100644 --- a/DiscImageChef.Core/Devices/Info/Plextor.cs +++ b/DiscImageChef.Core/Devices/Info/Plextor.cs @@ -52,12 +52,12 @@ namespace DiscImageChef.Core.Devices.Info public bool HidesSessions; public bool Hiding; public bool IsDvd; - public ushort PoweRecLast; - public ushort PoweRecMax; - public ushort PoweRecSelected; public bool PoweRec; public bool PoweRecEnabled; + public ushort PoweRecLast; + public ushort PoweRecMax; public ushort PoweRecRecommendedSpeed; + public ushort PoweRecSelected; public bool SecuRec; public bool SilentMode; public bool SilentModeEnabled; diff --git a/DiscImageChef.Core/Devices/ReaderSCSI.cs b/DiscImageChef.Core/Devices/ReaderSCSI.cs index 9a9c7b57c..144b18515 100644 --- a/DiscImageChef.Core/Devices/ReaderSCSI.cs +++ b/DiscImageChef.Core/Devices/ReaderSCSI.cs @@ -53,10 +53,7 @@ namespace DiscImageChef.Core.Devices bool syqReadLong10; bool syqReadLong6; - ulong ScsiGetBlocks() - { - return ScsiGetBlockSize() ? 0 : Blocks; - } + ulong ScsiGetBlocks() => ScsiGetBlockSize() ? 0 : Blocks; bool ScsiFindReadCommand() { diff --git a/DiscImageChef.Core/Devices/Report/DeviceReport.cs b/DiscImageChef.Core/Devices/Report/DeviceReport.cs index 30c5bdda7..b44b1ec2f 100644 --- a/DiscImageChef.Core/Devices/Report/DeviceReport.cs +++ b/DiscImageChef.Core/Devices/Report/DeviceReport.cs @@ -29,18 +29,19 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using DiscImageChef.Devices; namespace DiscImageChef.Core.Devices.Report { public partial class DeviceReport { + bool debug; Device dev; - bool debug; public DeviceReport(Device device, bool debug) { - this.dev = device; + dev = device; this.debug = debug; } } diff --git a/DiscImageChef.Core/Devices/Scanning/NVMe.cs b/DiscImageChef.Core/Devices/Scanning/NVMe.cs index b016b6bb5..3f97d537f 100644 --- a/DiscImageChef.Core/Devices/Scanning/NVMe.cs +++ b/DiscImageChef.Core/Devices/Scanning/NVMe.cs @@ -37,9 +37,7 @@ namespace DiscImageChef.Core.Devices.Scanning { public static class Nvme { - public static ScanResults Scan(string mhddLogPath, string ibgLogPath, string devicePath, Device dev) - { + public static ScanResults Scan(string mhddLogPath, string ibgLogPath, string devicePath, Device dev) => throw new NotImplementedException("NVMe devices not yet supported."); - } } } \ No newline at end of file diff --git a/DiscImageChef.Core/PrintScsiModePages.cs b/DiscImageChef.Core/PrintScsiModePages.cs index 82d8c4803..b320edf68 100644 --- a/DiscImageChef.Core/PrintScsiModePages.cs +++ b/DiscImageChef.Core/PrintScsiModePages.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using DiscImageChef.Console; using DiscImageChef.Decoders.SCSI; diff --git a/DiscImageChef.Core/Sidecar/BlockMedia.cs b/DiscImageChef.Core/Sidecar/BlockMedia.cs index ea3dab3f2..fd2d6616d 100644 --- a/DiscImageChef.Core/Sidecar/BlockMedia.cs +++ b/DiscImageChef.Core/Sidecar/BlockMedia.cs @@ -103,7 +103,8 @@ namespace DiscImageChef.Core Identify = new DumpType { Checksums = - Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.ATAPI_IDENTIFY)).ToArray(), + Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.ATAPI_IDENTIFY)) + .ToArray(), Size = image.ReadDiskTag(MediaTagType.ATAPI_IDENTIFY).Length } }; @@ -113,8 +114,9 @@ namespace DiscImageChef.Core { Identify = new DumpType { - Checksums = - Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.ATA_IDENTIFY)).ToArray(), + Checksums = Checksum + .GetChecksums(image.ReadDiskTag(MediaTagType.ATA_IDENTIFY)) + .ToArray(), Size = image.ReadDiskTag(MediaTagType.ATA_IDENTIFY).Length } }; @@ -166,8 +168,9 @@ namespace DiscImageChef.Core { Inquiry = new DumpType { - Checksums = - Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SCSI_INQUIRY)).ToArray(), + Checksums = Checksum + .GetChecksums(image.ReadDiskTag(MediaTagType.SCSI_INQUIRY)) + .ToArray(), Size = image.ReadDiskTag(MediaTagType.SCSI_INQUIRY).Length } }; @@ -240,8 +243,8 @@ namespace DiscImageChef.Core sidecar.BlockMedia[0].MultiMediaCard = new MultiMediaCardType(); sidecar.BlockMedia[0].MultiMediaCard.ExtendedCSD = new DumpType { - Checksums = - Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.MMC_ExtendedCSD)).ToArray(), + Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.MMC_ExtendedCSD)) + .ToArray(), Size = image.ReadDiskTag(MediaTagType.MMC_ExtendedCSD).Length }; break; @@ -249,8 +252,8 @@ namespace DiscImageChef.Core if(sidecar.BlockMedia[0].USB == null) sidecar.BlockMedia[0].USB = new USBType(); sidecar.BlockMedia[0].USB.Descriptors = new DumpType { - Checksums = - Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.USB_Descriptors)).ToArray(), + Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.USB_Descriptors)) + .ToArray(), Size = image.ReadDiskTag(MediaTagType.USB_Descriptors).Length }; break; diff --git a/DiscImageChef.Core/Sidecar/BlockTape.cs b/DiscImageChef.Core/Sidecar/BlockTape.cs index 4a5300732..611164c32 100644 --- a/DiscImageChef.Core/Sidecar/BlockTape.cs +++ b/DiscImageChef.Core/Sidecar/BlockTape.cs @@ -52,12 +52,11 @@ namespace DiscImageChef.Core { new BlockMediaType { - Image = new ImageType - { - format = "Directory", - offsetSpecified = false, - Value = folderName - }, + Image = + new ImageType + { + format = "Directory", offsetSpecified = false, Value = folderName + }, Sequence = new SequenceType {MediaTitle = folderName, MediaSequence = 1, TotalMedia = 1}, PhysicalBlockSize = blockSize, diff --git a/DiscImageChef.Core/Sidecar/OpticalDisc.cs b/DiscImageChef.Core/Sidecar/OpticalDisc.cs index f3c0d69a6..2a41aba2a 100644 --- a/DiscImageChef.Core/Sidecar/OpticalDisc.cs +++ b/DiscImageChef.Core/Sidecar/OpticalDisc.cs @@ -282,9 +282,10 @@ namespace DiscImageChef.Core { new BorderType { - Image = Path.GetFileName(imagePath), - Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.CD_LeadIn)).ToArray(), - Size = image.ReadDiskTag(MediaTagType.CD_LeadIn).Length + Image = Path.GetFileName(imagePath), + Checksums = Checksum + .GetChecksums(image.ReadDiskTag(MediaTagType.CD_LeadIn)).ToArray(), + Size = image.ReadDiskTag(MediaTagType.CD_LeadIn).Length } }; break; @@ -301,8 +302,10 @@ namespace DiscImageChef.Core { Image = Path.GetFileName(imagePath), Checksums = - Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.Xbox_SecuritySector)) - .ToArray(), + Checksum + .GetChecksums(image.ReadDiskTag(MediaTagType + .Xbox_SecuritySector)) + .ToArray(), Size = image.ReadDiskTag(MediaTagType.Xbox_SecuritySector).Length } } @@ -616,8 +619,7 @@ namespace DiscImageChef.Core { xmlTrk.FileSystemInformation[0] = new PartitionType { - EndSector = (int)xmlTrk.EndSector, - StartSector = (int)xmlTrk.StartSector + EndSector = (int)xmlTrk.EndSector, StartSector = (int)xmlTrk.StartSector }; List lstFs = new List(); @@ -703,8 +705,7 @@ namespace DiscImageChef.Core Serial = image.Info.DriveSerialNumber, Software = new SoftwareType { - Name = image.Info.Application, - Version = image.Info.ApplicationVersion + Name = image.Info.Application, Version = image.Info.ApplicationVersion } } }; diff --git a/DiscImageChef.Core/Statistics.cs b/DiscImageChef.Core/Statistics.cs index be8fd16e8..121e4599c 100644 --- a/DiscImageChef.Core/Statistics.cs +++ b/DiscImageChef.Core/Statistics.cs @@ -37,7 +37,6 @@ using System.IO; using System.Linq; using System.Net; using System.Threading; -using System.Xml; using System.Xml.Serialization; using DiscImageChef.CommonTypes.Interop; using DiscImageChef.CommonTypes.Metadata; @@ -45,7 +44,6 @@ using DiscImageChef.Database; using DiscImageChef.Database.Models; using Newtonsoft.Json; using Device = DiscImageChef.Devices.Device; -using Formatting = Newtonsoft.Json.Formatting; using MediaType = DiscImageChef.CommonTypes.MediaType; using OperatingSystem = DiscImageChef.Database.Models.OperatingSystem; using Version = DiscImageChef.Database.Models.Version; @@ -70,7 +68,6 @@ namespace DiscImageChef.Core public static void LoadStats() { if(File.Exists(Path.Combine(Settings.Settings.StatsPath, "Statistics.xml"))) - { try { Stats allStats = new Stats(); @@ -424,7 +421,6 @@ namespace DiscImageChef.Core { // Do not care about it } - } if(Settings.Settings.Current.Stats == null) return; diff --git a/DiscImageChef.Database/Migrations/20181127001622_AddDeviceBasicFields.cs b/DiscImageChef.Database/Migrations/20181127001622_AddDeviceBasicFields.cs index a0c23ea68..bab4a08f3 100644 --- a/DiscImageChef.Database/Migrations/20181127001622_AddDeviceBasicFields.cs +++ b/DiscImageChef.Database/Migrations/20181127001622_AddDeviceBasicFields.cs @@ -6,45 +6,24 @@ namespace DiscImageChef.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.AddColumn( - name: "Manufacturer", - table: "Reports", - nullable: true); + migrationBuilder.AddColumn("Manufacturer", "Reports", nullable: true); - migrationBuilder.AddColumn( - name: "Model", - table: "Reports", - nullable: true); + migrationBuilder.AddColumn("Model", "Reports", nullable: true); - migrationBuilder.AddColumn( - name: "Revision", - table: "Reports", - nullable: true); + migrationBuilder.AddColumn("Revision", "Reports", nullable: true); - migrationBuilder.AddColumn( - name: "Type", - table: "Reports", - nullable: false, - defaultValue: 0); + migrationBuilder.AddColumn("Type", "Reports", nullable: false, defaultValue: 0); } protected override void Down(MigrationBuilder migrationBuilder) { - migrationBuilder.DropColumn( - name: "Manufacturer", - table: "Reports"); + migrationBuilder.DropColumn("Manufacturer", "Reports"); - migrationBuilder.DropColumn( - name: "Model", - table: "Reports"); + migrationBuilder.DropColumn("Model", "Reports"); - migrationBuilder.DropColumn( - name: "Revision", - table: "Reports"); + migrationBuilder.DropColumn("Revision", "Reports"); - migrationBuilder.DropColumn( - name: "Type", - table: "Reports"); + migrationBuilder.DropColumn("Type", "Reports"); } } -} +} \ No newline at end of file diff --git a/DiscImageChef.Database/Migrations/20181223214411_UseBinaryDataForIdentifyInquiryAndModesInReports.cs b/DiscImageChef.Database/Migrations/20181223214411_UseBinaryDataForIdentifyInquiryAndModesInReports.cs index c4d391edf..6d535fa58 100644 --- a/DiscImageChef.Database/Migrations/20181223214411_UseBinaryDataForIdentifyInquiryAndModesInReports.cs +++ b/DiscImageChef.Database/Migrations/20181223214411_UseBinaryDataForIdentifyInquiryAndModesInReports.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace DiscImageChef.Database.Migrations { @@ -7,84 +6,75 @@ namespace DiscImageChef.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.DropTable( - name: "ModePage_2A"); + migrationBuilder.DropTable("ModePage_2A"); - migrationBuilder.AddColumn( - name: "ModeSense2AData", - table: "Mmc", - nullable: true); + migrationBuilder.AddColumn("ModeSense2AData", "Mmc", nullable: true); } protected override void Down(MigrationBuilder migrationBuilder) { - migrationBuilder.DropColumn( - name: "ModeSense2AData", - table: "Mmc"); + migrationBuilder.DropColumn("ModeSense2AData", "Mmc"); - migrationBuilder.CreateTable( - name: "ModePage_2A", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - AccurateCDDA = table.Column(nullable: false), - AudioPlay = table.Column(nullable: false), - BCK = table.Column(nullable: false), - BUF = table.Column(nullable: false), - BufferSize = table.Column(nullable: false), - C2Pointer = table.Column(nullable: false), - CDDACommand = table.Column(nullable: false), - CMRSupported = table.Column(nullable: false), - Composite = table.Column(nullable: false), - CurrentSpeed = table.Column(nullable: false), - CurrentWriteSpeed = table.Column(nullable: false), - CurrentWriteSpeedSelected = table.Column(nullable: false), - DeinterlaveSubchannel = table.Column(nullable: false), - DigitalPort1 = table.Column(nullable: false), - DigitalPort2 = table.Column(nullable: false), - Eject = table.Column(nullable: false), - ISRC = table.Column(nullable: false), - LSBF = table.Column(nullable: false), - LeadInPW = table.Column(nullable: false), - Length = table.Column(nullable: false), - LoadingMechanism = table.Column(nullable: false), - Lock = table.Column(nullable: false), - LockState = table.Column(nullable: false), - MaxWriteSpeed = table.Column(nullable: false), - MaximumSpeed = table.Column(nullable: false), - Method2 = table.Column(nullable: false), - Mode2Form1 = table.Column(nullable: false), - Mode2Form2 = table.Column(nullable: false), - MultiSession = table.Column(nullable: false), - PS = table.Column(nullable: false), - PreventJumper = table.Column(nullable: false), - RCK = table.Column(nullable: false), - ReadBarcode = table.Column(nullable: false), - ReadCDR = table.Column(nullable: false), - ReadCDRW = table.Column(nullable: false), - ReadDVDR = table.Column(nullable: false), - ReadDVDRAM = table.Column(nullable: false), - ReadDVDROM = table.Column(nullable: false), - RotationControlSelected = table.Column(nullable: false), - SCC = table.Column(nullable: false), - SDP = table.Column(nullable: false), - SSS = table.Column(nullable: false), - SeparateChannelMute = table.Column(nullable: false), - SeparateChannelVolume = table.Column(nullable: false), - Subchannel = table.Column(nullable: false), - SupportedVolumeLevels = table.Column(nullable: false), - TestWrite = table.Column(nullable: false), - UPC = table.Column(nullable: false), - WriteCDR = table.Column(nullable: false), - WriteCDRW = table.Column(nullable: false), - WriteDVDR = table.Column(nullable: false), - WriteDVDRAM = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ModePage_2A", x => x.Id); - }); + migrationBuilder.CreateTable("ModePage_2A", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + AccurateCDDA = table.Column(nullable: false), + AudioPlay = table.Column(nullable: false), + BCK = table.Column(nullable: false), + BUF = table.Column(nullable: false), + BufferSize = table.Column(nullable: false), + C2Pointer = table.Column(nullable: false), + CDDACommand = table.Column(nullable: false), + CMRSupported = table.Column(nullable: false), + Composite = table.Column(nullable: false), + CurrentSpeed = table.Column(nullable: false), + CurrentWriteSpeed = table.Column(nullable: false), + CurrentWriteSpeedSelected = table.Column(nullable: false), + DeinterlaveSubchannel = table.Column(nullable: false), + DigitalPort1 = table.Column(nullable: false), + DigitalPort2 = table.Column(nullable: false), + Eject = table.Column(nullable: false), + ISRC = table.Column(nullable: false), + LSBF = table.Column(nullable: false), + LeadInPW = table.Column(nullable: false), + Length = table.Column(nullable: false), + LoadingMechanism = table.Column(nullable: false), + Lock = table.Column(nullable: false), + LockState = table.Column(nullable: false), + MaxWriteSpeed = table.Column(nullable: false), + MaximumSpeed = table.Column(nullable: false), + Method2 = table.Column(nullable: false), + Mode2Form1 = table.Column(nullable: false), + Mode2Form2 = table.Column(nullable: false), + MultiSession = table.Column(nullable: false), + PS = table.Column(nullable: false), + PreventJumper = table.Column(nullable: false), + RCK = table.Column(nullable: false), + ReadBarcode = table.Column(nullable: false), + ReadCDR = table.Column(nullable: false), + ReadCDRW = table.Column(nullable: false), + ReadDVDR = table.Column(nullable: false), + ReadDVDRAM = table.Column(nullable: false), + ReadDVDROM = table.Column(nullable: false), + RotationControlSelected = table.Column(nullable: false), + SCC = table.Column(nullable: false), + SDP = table.Column(nullable: false), + SSS = table.Column(nullable: false), + SeparateChannelMute = table.Column(nullable: false), + SeparateChannelVolume = table.Column(nullable: false), + Subchannel = table.Column(nullable: false), + SupportedVolumeLevels = table.Column(nullable: false), + TestWrite = table.Column(nullable: false), + UPC = table.Column(nullable: false), + WriteCDR = table.Column(nullable: false), + WriteCDRW = table.Column(nullable: false), + WriteDVDR = table.Column(nullable: false), + WriteDVDRAM = table.Column(nullable: false) + }, + constraints: table => { table.PrimaryKey("PK_ModePage_2A", x => x.Id); }); } } -} +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/CdOffset.cs b/DiscImageChef.Database/Models/CdOffset.cs index 18bf119a0..b9b4a3a6b 100644 --- a/DiscImageChef.Database/Models/CdOffset.cs +++ b/DiscImageChef.Database/Models/CdOffset.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System; using System.ComponentModel.DataAnnotations.Schema; diff --git a/DiscImageChef.Database/Models/Command.cs b/DiscImageChef.Database/Models/Command.cs index a0e9fe52e..07fa8b462 100644 --- a/DiscImageChef.Database/Models/Command.cs +++ b/DiscImageChef.Database/Models/Command.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Database.Models diff --git a/DiscImageChef.Database/Models/Device.cs b/DiscImageChef.Database/Models/Device.cs index 8f0b37a2a..7140f8249 100644 --- a/DiscImageChef.Database/Models/Device.cs +++ b/DiscImageChef.Database/Models/Device.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System; using DiscImageChef.CommonTypes.Metadata; diff --git a/DiscImageChef.Database/Models/DeviceStat.cs b/DiscImageChef.Database/Models/DeviceStat.cs index f8e3a555a..67135a805 100644 --- a/DiscImageChef.Database/Models/DeviceStat.cs +++ b/DiscImageChef.Database/Models/DeviceStat.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Database.Models diff --git a/DiscImageChef.Database/Models/Filesystem.cs b/DiscImageChef.Database/Models/Filesystem.cs index ec6526439..a76aacc2a 100644 --- a/DiscImageChef.Database/Models/Filesystem.cs +++ b/DiscImageChef.Database/Models/Filesystem.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Database.Models diff --git a/DiscImageChef.Database/Models/Filter.cs b/DiscImageChef.Database/Models/Filter.cs index e0bcffa4e..6d0c06327 100644 --- a/DiscImageChef.Database/Models/Filter.cs +++ b/DiscImageChef.Database/Models/Filter.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Database.Models diff --git a/DiscImageChef.Database/Models/Media.cs b/DiscImageChef.Database/Models/Media.cs index 65942d238..e7d93cfba 100644 --- a/DiscImageChef.Database/Models/Media.cs +++ b/DiscImageChef.Database/Models/Media.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Database.Models diff --git a/DiscImageChef.Database/Models/MediaFormat.cs b/DiscImageChef.Database/Models/MediaFormat.cs index 691bc7c49..2b120ec9f 100644 --- a/DiscImageChef.Database/Models/MediaFormat.cs +++ b/DiscImageChef.Database/Models/MediaFormat.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Database.Models diff --git a/DiscImageChef.Database/Models/OperatingSystem.cs b/DiscImageChef.Database/Models/OperatingSystem.cs index 7cc0c4144..eff40e4a2 100644 --- a/DiscImageChef.Database/Models/OperatingSystem.cs +++ b/DiscImageChef.Database/Models/OperatingSystem.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Database.Models diff --git a/DiscImageChef.Database/Models/Partition.cs b/DiscImageChef.Database/Models/Partition.cs index 82faf9c8a..48e40b358 100644 --- a/DiscImageChef.Database/Models/Partition.cs +++ b/DiscImageChef.Database/Models/Partition.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Database.Models diff --git a/DiscImageChef.Database/Models/Report.cs b/DiscImageChef.Database/Models/Report.cs index b384f3e87..8131060b7 100644 --- a/DiscImageChef.Database/Models/Report.cs +++ b/DiscImageChef.Database/Models/Report.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System; using DiscImageChef.CommonTypes.Metadata; diff --git a/DiscImageChef.Database/Models/UsbProduct.cs b/DiscImageChef.Database/Models/UsbProduct.cs index f950f4dc9..29bd1805e 100644 --- a/DiscImageChef.Database/Models/UsbProduct.cs +++ b/DiscImageChef.Database/Models/UsbProduct.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/DiscImageChef.Database/Models/UsbVendor.cs b/DiscImageChef.Database/Models/UsbVendor.cs index 90f8bd2d5..33c8f0b58 100644 --- a/DiscImageChef.Database/Models/UsbVendor.cs +++ b/DiscImageChef.Database/Models/UsbVendor.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/DiscImageChef.Database/Models/Version.cs b/DiscImageChef.Database/Models/Version.cs index a68baf2b8..7b81e325c 100644 --- a/DiscImageChef.Database/Models/Version.cs +++ b/DiscImageChef.Database/Models/Version.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Database.Models diff --git a/DiscImageChef.Decoders/ATA/Identify.cs b/DiscImageChef.Decoders/ATA/Identify.cs index 97c2153eb..c35e85e8b 100644 --- a/DiscImageChef.Decoders/ATA/Identify.cs +++ b/DiscImageChef.Decoders/ATA/Identify.cs @@ -3574,7 +3574,7 @@ namespace DiscImageChef.Decoders.ATA static byte[] ScrambleATAString(string str, int length) { - byte[] buf = new byte[length]; + byte[] buf = new byte[length]; for(int i = 0; i < length; i++) buf[i] = 0x20; if(str is null) return buf; @@ -3584,7 +3584,7 @@ namespace DiscImageChef.Decoders.ATA if(bytes.Length % 2 != 0) { byte[] tmp = new byte[bytes.Length + 1]; - tmp[tmp.Length - 1] = 0x20; + tmp[tmp.Length - 1] = 0x20; Array.Copy(bytes, 0, tmp, 0, bytes.Length); bytes = tmp; } @@ -3592,7 +3592,7 @@ namespace DiscImageChef.Decoders.ATA for(int i = 0; i < bytes.Length; i += 2) { buf[i] = bytes[i + 1]; - buf[i + 1] = bytes[i]; + buf[i + 1] = bytes[i]; } string test1 = StringHandlers.CToString(buf); diff --git a/DiscImageChef.Decoders/Blu-ray/BCA.cs b/DiscImageChef.Decoders/Blu-ray/BCA.cs index 7b70c0a5b..43c8276c5 100644 --- a/DiscImageChef.Decoders/Blu-ray/BCA.cs +++ b/DiscImageChef.Decoders/Blu-ray/BCA.cs @@ -102,10 +102,7 @@ namespace DiscImageChef.Decoders.Bluray return sb.ToString(); } - public static string Prettify(byte[] BCAResponse) - { - return Prettify(Decode(BCAResponse)); - } + public static string Prettify(byte[] BCAResponse) => Prettify(Decode(BCAResponse)); #endregion Public methods #region Public structures diff --git a/DiscImageChef.Decoders/Blu-ray/Cartridge.cs b/DiscImageChef.Decoders/Blu-ray/Cartridge.cs index 82e31d152..da60b67b8 100644 --- a/DiscImageChef.Decoders/Blu-ray/Cartridge.cs +++ b/DiscImageChef.Decoders/Blu-ray/Cartridge.cs @@ -128,10 +128,7 @@ namespace DiscImageChef.Decoders.Bluray return sb.ToString(); } - public static string Prettify(byte[] CSResponse) - { - return Prettify(Decode(CSResponse)); - } + public static string Prettify(byte[] CSResponse) => Prettify(Decode(CSResponse)); #endregion Public methods #region Public structures diff --git a/DiscImageChef.Decoders/Blu-ray/DDS.cs b/DiscImageChef.Decoders/Blu-ray/DDS.cs index 66b453c62..5d1003352 100644 --- a/DiscImageChef.Decoders/Blu-ray/DDS.cs +++ b/DiscImageChef.Decoders/Blu-ray/DDS.cs @@ -152,10 +152,7 @@ namespace DiscImageChef.Decoders.Bluray return sb.ToString(); } - public static string Prettify(byte[] DDSResponse) - { - return Prettify(Decode(DDSResponse)); - } + public static string Prettify(byte[] DDSResponse) => Prettify(Decode(DDSResponse)); #endregion Public methods #region Public structures diff --git a/DiscImageChef.Decoders/Blu-ray/DI.cs b/DiscImageChef.Decoders/Blu-ray/DI.cs index 9a9dc025b..d86482043 100644 --- a/DiscImageChef.Decoders/Blu-ray/DI.cs +++ b/DiscImageChef.Decoders/Blu-ray/DI.cs @@ -328,10 +328,7 @@ namespace DiscImageChef.Decoders.Bluray return sb.ToString(); } - public static string Prettify(byte[] DIResponse) - { - return Prettify(Decode(DIResponse)); - } + public static string Prettify(byte[] DIResponse) => Prettify(Decode(DIResponse)); #endregion Public methods #region Public structures diff --git a/DiscImageChef.Decoders/Blu-ray/Spare.cs b/DiscImageChef.Decoders/Blu-ray/Spare.cs index dfa92b6c3..a689a0a2d 100644 --- a/DiscImageChef.Decoders/Blu-ray/Spare.cs +++ b/DiscImageChef.Decoders/Blu-ray/Spare.cs @@ -104,10 +104,7 @@ namespace DiscImageChef.Decoders.Bluray return sb.ToString(); } - public static string Prettify(byte[] SAIResponse) - { - return Prettify(Decode(SAIResponse)); - } + public static string Prettify(byte[] SAIResponse) => Prettify(Decode(SAIResponse)); #endregion Public methods #region Public structures diff --git a/DiscImageChef.Decoders/CD/Sector.cs b/DiscImageChef.Decoders/CD/Sector.cs index 79b84dd27..7d7326bad 100644 --- a/DiscImageChef.Decoders/CD/Sector.cs +++ b/DiscImageChef.Decoders/CD/Sector.cs @@ -43,141 +43,151 @@ namespace DiscImageChef.Decoders.CD { public static readonly byte[] ScrambleTable = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x60, 0x00, 0x28, - 0x00, 0x1E, 0x80, 0x08, 0x60, 0x06, 0xA8, 0x02, 0xFE, 0x81, 0x80, 0x60, 0x60, 0x28, 0x28, 0x1E, 0x9E, 0x88, - 0x68, 0x66, 0xAE, 0xAA, 0xFC, 0x7F, 0x01, 0xE0, 0x00, 0x48, 0x00, 0x36, 0x80, 0x16, 0xE0, 0x0E, 0xC8, 0x04, - 0x56, 0x83, 0x7E, 0xE1, 0xE0, 0x48, 0x48, 0x36, 0xB6, 0x96, 0xF6, 0xEE, 0xC6, 0xCC, 0x52, 0xD5, 0xFD, 0x9F, - 0x01, 0xA8, 0x00, 0x7E, 0x80, 0x20, 0x60, 0x18, 0x28, 0x0A, 0x9E, 0x87, 0x28, 0x62, 0x9E, 0xA9, 0xA8, 0x7E, - 0xFE, 0xA0, 0x40, 0x78, 0x30, 0x22, 0x94, 0x19, 0xAF, 0x4A, 0xFC, 0x37, 0x01, 0xD6, 0x80, 0x5E, 0xE0, 0x38, - 0x48, 0x12, 0xB6, 0x8D, 0xB6, 0xE5, 0xB6, 0xCB, 0x36, 0xD7, 0x56, 0xDE, 0xBE, 0xD8, 0x70, 0x5A, 0xA4, 0x3B, - 0x3B, 0x53, 0x53, 0x7D, 0xFD, 0xE1, 0x81, 0x88, 0x60, 0x66, 0xA8, 0x2A, 0xFE, 0x9F, 0x00, 0x68, 0x00, 0x2E, - 0x80, 0x1C, 0x60, 0x09, 0xE8, 0x06, 0xCE, 0x82, 0xD4, 0x61, 0x9F, 0x68, 0x68, 0x2E, 0xAE, 0x9C, 0x7C, 0x69, - 0xE1, 0xEE, 0xC8, 0x4C, 0x56, 0xB5, 0xFE, 0xF7, 0x00, 0x46, 0x80, 0x32, 0xE0, 0x15, 0x88, 0x0F, 0x26, 0x84, - 0x1A, 0xE3, 0x4B, 0x09, 0xF7, 0x46, 0xC6, 0xB2, 0xD2, 0xF5, 0x9D, 0x87, 0x29, 0xA2, 0x9E, 0xF9, 0xA8, 0x42, - 0xFE, 0xB1, 0x80, 0x74, 0x60, 0x27, 0x68, 0x1A, 0xAE, 0x8B, 0x3C, 0x67, 0x51, 0xEA, 0xBC, 0x4F, 0x31, 0xF4, - 0x14, 0x47, 0x4F, 0x72, 0xB4, 0x25, 0xB7, 0x5B, 0x36, 0xBB, 0x56, 0xF3, 0x7E, 0xC5, 0xE0, 0x53, 0x08, 0x3D, - 0xC6, 0x91, 0x92, 0xEC, 0x6D, 0x8D, 0xED, 0xA5, 0x8D, 0xBB, 0x25, 0xB3, 0x5B, 0x35, 0xFB, 0x57, 0x03, 0x7E, - 0x81, 0xE0, 0x60, 0x48, 0x28, 0x36, 0x9E, 0x96, 0xE8, 0x6E, 0xCE, 0xAC, 0x54, 0x7D, 0xFF, 0x61, 0x80, 0x28, - 0x60, 0x1E, 0xA8, 0x08, 0x7E, 0x86, 0xA0, 0x62, 0xF8, 0x29, 0x82, 0x9E, 0xE1, 0xA8, 0x48, 0x7E, 0xB6, 0xA0, - 0x76, 0xF8, 0x26, 0xC2, 0x9A, 0xD1, 0xAB, 0x1C, 0x7F, 0x49, 0xE0, 0x36, 0xC8, 0x16, 0xD6, 0x8E, 0xDE, 0xE4, - 0x58, 0x4B, 0x7A, 0xB7, 0x63, 0x36, 0xA9, 0xD6, 0xFE, 0xDE, 0xC0, 0x58, 0x50, 0x3A, 0xBC, 0x13, 0x31, 0xCD, - 0xD4, 0x55, 0x9F, 0x7F, 0x28, 0x20, 0x1E, 0x98, 0x08, 0x6A, 0x86, 0xAF, 0x22, 0xFC, 0x19, 0x81, 0xCA, 0xE0, - 0x57, 0x08, 0x3E, 0x86, 0x90, 0x62, 0xEC, 0x29, 0x8D, 0xDE, 0xE5, 0x98, 0x4B, 0x2A, 0xB7, 0x5F, 0x36, 0xB8, - 0x16, 0xF2, 0x8E, 0xC5, 0xA4, 0x53, 0x3B, 0x7D, 0xD3, 0x61, 0x9D, 0xE8, 0x69, 0x8E, 0xAE, 0xE4, 0x7C, 0x4B, - 0x61, 0xF7, 0x68, 0x46, 0xAE, 0xB2, 0xFC, 0x75, 0x81, 0xE7, 0x20, 0x4A, 0x98, 0x37, 0x2A, 0x96, 0x9F, 0x2E, - 0xE8, 0x1C, 0x4E, 0x89, 0xF4, 0x66, 0xC7, 0x6A, 0xD2, 0xAF, 0x1D, 0xBC, 0x09, 0xB1, 0xC6, 0xF4, 0x52, 0xC7, - 0x7D, 0x92, 0xA1, 0xAD, 0xB8, 0x7D, 0xB2, 0xA1, 0xB5, 0xB8, 0x77, 0x32, 0xA6, 0x95, 0xBA, 0xEF, 0x33, 0x0C, - 0x15, 0xC5, 0xCF, 0x13, 0x14, 0x0D, 0xCF, 0x45, 0x94, 0x33, 0x2F, 0x55, 0xDC, 0x3F, 0x19, 0xD0, 0x0A, 0xDC, - 0x07, 0x19, 0xC2, 0x8A, 0xD1, 0xA7, 0x1C, 0x7A, 0x89, 0xE3, 0x26, 0xC9, 0xDA, 0xD6, 0xDB, 0x1E, 0xDB, 0x48, - 0x5B, 0x76, 0xBB, 0x66, 0xF3, 0x6A, 0xC5, 0xEF, 0x13, 0x0C, 0x0D, 0xC5, 0xC5, 0x93, 0x13, 0x2D, 0xCD, 0xDD, - 0x95, 0x99, 0xAF, 0x2A, 0xFC, 0x1F, 0x01, 0xC8, 0x00, 0x56, 0x80, 0x3E, 0xE0, 0x10, 0x48, 0x0C, 0x36, 0x85, - 0xD6, 0xE3, 0x1E, 0xC9, 0xC8, 0x56, 0xD6, 0xBE, 0xDE, 0xF0, 0x58, 0x44, 0x3A, 0xB3, 0x53, 0x35, 0xFD, 0xD7, - 0x01, 0x9E, 0x80, 0x68, 0x60, 0x2E, 0xA8, 0x1C, 0x7E, 0x89, 0xE0, 0x66, 0xC8, 0x2A, 0xD6, 0x9F, 0x1E, 0xE8, - 0x08, 0x4E, 0x86, 0xB4, 0x62, 0xF7, 0x69, 0x86, 0xAE, 0xE2, 0xFC, 0x49, 0x81, 0xF6, 0xE0, 0x46, 0xC8, 0x32, - 0xD6, 0x95, 0x9E, 0xEF, 0x28, 0x4C, 0x1E, 0xB5, 0xC8, 0x77, 0x16, 0xA6, 0x8E, 0xFA, 0xE4, 0x43, 0x0B, 0x71, - 0xC7, 0x64, 0x52, 0xAB, 0x7D, 0xBF, 0x61, 0xB0, 0x28, 0x74, 0x1E, 0xA7, 0x48, 0x7A, 0xB6, 0xA3, 0x36, 0xF9, - 0xD6, 0xC2, 0xDE, 0xD1, 0x98, 0x5C, 0x6A, 0xB9, 0xEF, 0x32, 0xCC, 0x15, 0x95, 0xCF, 0x2F, 0x14, 0x1C, 0x0F, - 0x49, 0xC4, 0x36, 0xD3, 0x56, 0xDD, 0xFE, 0xD9, 0x80, 0x5A, 0xE0, 0x3B, 0x08, 0x13, 0x46, 0x8D, 0xF2, 0xE5, - 0x85, 0x8B, 0x23, 0x27, 0x59, 0xDA, 0xBA, 0xDB, 0x33, 0x1B, 0x55, 0xCB, 0x7F, 0x17, 0x60, 0x0E, 0xA8, 0x04, - 0x7E, 0x83, 0x60, 0x61, 0xE8, 0x28, 0x4E, 0x9E, 0xB4, 0x68, 0x77, 0x6E, 0xA6, 0xAC, 0x7A, 0xFD, 0xE3, 0x01, - 0x89, 0xC0, 0x66, 0xD0, 0x2A, 0xDC, 0x1F, 0x19, 0xC8, 0x0A, 0xD6, 0x87, 0x1E, 0xE2, 0x88, 0x49, 0xA6, 0xB6, - 0xFA, 0xF6, 0xC3, 0x06, 0xD1, 0xC2, 0xDC, 0x51, 0x99, 0xFC, 0x6A, 0xC1, 0xEF, 0x10, 0x4C, 0x0C, 0x35, 0xC5, - 0xD7, 0x13, 0x1E, 0x8D, 0xC8, 0x65, 0x96, 0xAB, 0x2E, 0xFF, 0x5C, 0x40, 0x39, 0xF0, 0x12, 0xC4, 0x0D, 0x93, - 0x45, 0xAD, 0xF3, 0x3D, 0x85, 0xD1, 0xA3, 0x1C, 0x79, 0xC9, 0xE2, 0xD6, 0xC9, 0x9E, 0xD6, 0xE8, 0x5E, 0xCE, - 0xB8, 0x54, 0x72, 0xBF, 0x65, 0xB0, 0x2B, 0x34, 0x1F, 0x57, 0x48, 0x3E, 0xB6, 0x90, 0x76, 0xEC, 0x26, 0xCD, - 0xDA, 0xD5, 0x9B, 0x1F, 0x2B, 0x48, 0x1F, 0x76, 0x88, 0x26, 0xE6, 0x9A, 0xCA, 0xEB, 0x17, 0x0F, 0x4E, 0x84, - 0x34, 0x63, 0x57, 0x69, 0xFE, 0xAE, 0xC0, 0x7C, 0x50, 0x21, 0xFC, 0x18, 0x41, 0xCA, 0xB0, 0x57, 0x34, 0x3E, - 0x97, 0x50, 0x6E, 0xBC, 0x2C, 0x71, 0xDD, 0xE4, 0x59, 0x8B, 0x7A, 0xE7, 0x63, 0x0A, 0xA9, 0xC7, 0x3E, 0xD2, - 0x90, 0x5D, 0xAC, 0x39, 0xBD, 0xD2, 0xF1, 0x9D, 0x84, 0x69, 0xA3, 0x6E, 0xF9, 0xEC, 0x42, 0xCD, 0xF1, 0x95, - 0x84, 0x6F, 0x23, 0x6C, 0x19, 0xED, 0xCA, 0xCD, 0x97, 0x15, 0xAE, 0x8F, 0x3C, 0x64, 0x11, 0xEB, 0x4C, 0x4F, - 0x75, 0xF4, 0x27, 0x07, 0x5A, 0x82, 0xBB, 0x21, 0xB3, 0x58, 0x75, 0xFA, 0xA7, 0x03, 0x3A, 0x81, 0xD3, 0x20, - 0x5D, 0xD8, 0x39, 0x9A, 0x92, 0xEB, 0x2D, 0x8F, 0x5D, 0xA4, 0x39, 0xBB, 0x52, 0xF3, 0x7D, 0x85, 0xE1, 0xA3, - 0x08, 0x79, 0xC6, 0xA2, 0xD2, 0xF9, 0x9D, 0x82, 0xE9, 0xA1, 0x8E, 0xF8, 0x64, 0x42, 0xAB, 0x71, 0xBF, 0x64, - 0x70, 0x2B, 0x64, 0x1F, 0x6B, 0x48, 0x2F, 0x76, 0x9C, 0x26, 0xE9, 0xDA, 0xCE, 0xDB, 0x14, 0x5B, 0x4F, 0x7B, - 0x74, 0x23, 0x67, 0x59, 0xEA, 0xBA, 0xCF, 0x33, 0x14, 0x15, 0xCF, 0x4F, 0x14, 0x34, 0x0F, 0x57, 0x44, 0x3E, - 0xB3, 0x50, 0x75, 0xFC, 0x27, 0x01, 0xDA, 0x80, 0x5B, 0x20, 0x3B, 0x58, 0x13, 0x7A, 0x8D, 0xE3, 0x25, 0x89, - 0xDB, 0x26, 0xDB, 0x5A, 0xDB, 0x7B, 0x1B, 0x63, 0x4B, 0x69, 0xF7, 0x6E, 0xC6, 0xAC, 0x52, 0xFD, 0xFD, 0x81, - 0x81, 0xA0, 0x60, 0x78, 0x28, 0x22, 0x9E, 0x99, 0xA8, 0x6A, 0xFE, 0xAF, 0x00, 0x7C, 0x00, 0x21, 0xC0, 0x18, - 0x50, 0x0A, 0xBC, 0x07, 0x31, 0xC2, 0x94, 0x51, 0xAF, 0x7C, 0x7C, 0x21, 0xE1, 0xD8, 0x48, 0x5A, 0xB6, 0xBB, - 0x36, 0xF3, 0x56, 0xC5, 0xFE, 0xD3, 0x00, 0x5D, 0xC0, 0x39, 0x90, 0x12, 0xEC, 0x0D, 0x8D, 0xC5, 0xA5, 0x93, - 0x3B, 0x2D, 0xD3, 0x5D, 0x9D, 0xF9, 0xA9, 0x82, 0xFE, 0xE1, 0x80, 0x48, 0x60, 0x36, 0xA8, 0x16, 0xFE, 0x8E, - 0xC0, 0x64, 0x50, 0x2B, 0x7C, 0x1F, 0x61, 0xC8, 0x28, 0x56, 0x9E, 0xBE, 0xE8, 0x70, 0x4E, 0xA4, 0x34, 0x7B, - 0x57, 0x63, 0x7E, 0xA9, 0xE0, 0x7E, 0xC8, 0x20, 0x56, 0x98, 0x3E, 0xEA, 0x90, 0x4F, 0x2C, 0x34, 0x1D, 0xD7, - 0x49, 0x9E, 0xB6, 0xE8, 0x76, 0xCE, 0xA6, 0xD4, 0x7A, 0xDF, 0x63, 0x18, 0x29, 0xCA, 0x9E, 0xD7, 0x28, 0x5E, - 0x9E, 0xB8, 0x68, 0x72, 0xAE, 0xA5, 0xBC, 0x7B, 0x31, 0xE3, 0x54, 0x49, 0xFF, 0x76, 0xC0, 0x26, 0xD0, 0x1A, - 0xDC, 0x0B, 0x19, 0xC7, 0x4A, 0xD2, 0xB7, 0x1D, 0xB6, 0x89, 0xB6, 0xE6, 0xF6, 0xCA, 0xC6, 0xD7, 0x12, 0xDE, - 0x8D, 0x98, 0x65, 0xAA, 0xAB, 0x3F, 0x3F, 0x50, 0x10, 0x3C, 0x0C, 0x11, 0xC5, 0xCC, 0x53, 0x15, 0xFD, 0xCF, - 0x01, 0x94, 0x00, 0x6F, 0x40, 0x2C, 0x30, 0x1D, 0xD4, 0x09, 0x9F, 0x46, 0xE8, 0x32, 0xCE, 0x95, 0x94, 0x6F, - 0x2F, 0x6C, 0x1C, 0x2D, 0xC9, 0xDD, 0x96, 0xD9, 0xAE, 0xDA, 0xFC, 0x5B, 0x01, 0xFB, 0x40, 0x43, 0x70, 0x31, - 0xE4, 0x14, 0x4B, 0x4F, 0x77, 0x74, 0x26, 0xA7, 0x5A, 0xFA, 0xBB, 0x03, 0x33, 0x41, 0xD5, 0xF0, 0x5F, 0x04, - 0x38, 0x03, 0x52, 0x81, 0xFD, 0xA0, 0x41, 0xB8, 0x30, 0x72, 0x94, 0x25, 0xAF, 0x5B, 0x3C, 0x3B, 0x51, 0xD3, - 0x7C, 0x5D, 0xE1, 0xF9, 0x88, 0x42, 0xE6, 0xB1, 0x8A, 0xF4, 0x67, 0x07, 0x6A, 0x82, 0xAF, 0x21, 0xBC, 0x18, - 0x71, 0xCA, 0xA4, 0x57, 0x3B, 0x7E, 0x93, 0x60, 0x6D, 0xE8, 0x2D, 0x8E, 0x9D, 0xA4, 0x69, 0xBB, 0x6E, 0xF3, - 0x6C, 0x45, 0xED, 0xF3, 0x0D, 0x85, 0xC5, 0xA3, 0x13, 0x39, 0xCD, 0xD2, 0xD5, 0x9D, 0x9F, 0x29, 0xA8, 0x1E, - 0xFE, 0x88, 0x40, 0x66, 0xB0, 0x2A, 0xF4, 0x1F, 0x07, 0x48, 0x02, 0xB6, 0x81, 0xB6, 0xE0, 0x76, 0xC8, 0x26, - 0xD6, 0x9A, 0xDE, 0xEB, 0x18, 0x4F, 0x4A, 0xB4, 0x37, 0x37, 0x56, 0x96, 0xBE, 0xEE, 0xF0, 0x4C, 0x44, 0x35, - 0xF3, 0x57, 0x05, 0xFE, 0x83, 0x00, 0x61, 0xC0, 0x28, 0x50, 0x1E, 0xBC, 0x08, 0x71, 0xC6, 0xA4, 0x52, 0xFB, - 0x7D, 0x83, 0x61, 0xA1, 0xE8, 0x78, 0x4E, 0xA2, 0xB4, 0x79, 0xB7, 0x62, 0xF6, 0xA9, 0x86, 0xFE, 0xE2, 0xC0, - 0x49, 0x90, 0x36, 0xEC, 0x16, 0xCD, 0xCE, 0xD5, 0x94, 0x5F, 0x2F, 0x78, 0x1C, 0x22, 0x89, 0xD9, 0xA6, 0xDA, - 0xFA, 0xDB, 0x03, 0x1B, 0x41, 0xCB, 0x70, 0x57, 0x64, 0x3E, 0xAB, 0x50, 0x7F, 0x7C, 0x20, 0x21, 0xD8, 0x18, - 0x5A, 0x8A, 0xBB, 0x27, 0x33, 0x5A, 0x95, 0xFB, 0x2F, 0x03, 0x5C, 0x01, 0xF9, 0xC0, 0x42, 0xD0, 0x31, 0x9C, - 0x14, 0x69, 0xCF, 0x6E, 0xD4, 0x2C, 0x5F, 0x5D, 0xF8, 0x39, 0x82, 0x92, 0xE1, 0xAD, 0x88, 0x7D, 0xA6, 0xA1, - 0xBA, 0xF8, 0x73, 0x02, 0xA5, 0xC1, 0xBB, 0x10, 0x73, 0x4C, 0x25, 0xF5, 0xDB, 0x07, 0x1B, 0x42, 0x8B, 0x71, - 0xA7, 0x64, 0x7A, 0xAB, 0x63, 0x3F, 0x69, 0xD0, 0x2E, 0xDC, 0x1C, 0x59, 0xC9, 0xFA, 0xD6, 0xC3, 0x1E, 0xD1, - 0xC8, 0x5C, 0x56, 0xB9, 0xFE, 0xF2, 0xC0, 0x45, 0x90, 0x33, 0x2C, 0x15, 0xDD, 0xCF, 0x19, 0x94, 0x0A, 0xEF, - 0x47, 0x0C, 0x32, 0x85, 0xD5, 0xA3, 0x1F, 0x39, 0xC8, 0x12, 0xD6, 0x8D, 0x9E, 0xE5, 0xA8, 0x4B, 0x3E, 0xB7, - 0x50, 0x76, 0xBC, 0x26, 0xF1, 0xDA, 0xC4, 0x5B, 0x13, 0x7B, 0x4D, 0xE3, 0x75, 0x89, 0xE7, 0x26, 0xCA, 0x9A, - 0xD7, 0x2B, 0x1E, 0x9F, 0x48, 0x68, 0x36, 0xAE, 0x96, 0xFC, 0x6E, 0xC1, 0xEC, 0x50, 0x4D, 0xFC, 0x35, 0x81, - 0xD7, 0x20, 0x5E, 0x98, 0x38, 0x6A, 0x92, 0xAF, 0x2D, 0xBC, 0x1D, 0xB1, 0xC9, 0xB4, 0x56, 0xF7, 0x7E, 0xC6, - 0xA0, 0x52, 0xF8, 0x3D, 0x82, 0x91, 0xA1, 0xAC, 0x78, 0x7D, 0xE2, 0xA1, 0x89, 0xB8, 0x66, 0xF2, 0xAA, 0xC5, - 0xBF, 0x13, 0x30, 0x0D, 0xD4, 0x05, 0x9F, 0x43, 0x28, 0x31, 0xDE, 0x94, 0x58, 0x6F, 0x7A, 0xAC, 0x23, 0x3D, - 0xD9, 0xD1, 0x9A, 0xDC, 0x6B, 0x19, 0xEF, 0x4A, 0xCC, 0x37, 0x15, 0xD6, 0x8F, 0x1E, 0xE4, 0x08, 0x4B, 0x46, - 0xB7, 0x72, 0xF6, 0xA5, 0x86, 0xFB, 0x22, 0xC3, 0x59, 0x91, 0xFA, 0xEC, 0x43, 0x0D, 0xF1, 0xC5, 0x84, 0x53, - 0x23, 0x7D, 0xD9, 0xE1, 0x9A, 0xC8, 0x6B, 0x16, 0xAF, 0x4E, 0xFC, 0x34, 0x41, 0xD7, 0x70, 0x5E, 0xA4, 0x38, - 0x7B, 0x52, 0xA3, 0x7D, 0xB9, 0xE1, 0xB2, 0xC8, 0x75, 0x96, 0xA7, 0x2E, 0xFA, 0x9C, 0x43, 0x29, 0xF1, 0xDE, - 0xC4, 0x58, 0x53, 0x7A, 0xBD, 0xE3, 0x31, 0x89, 0xD4, 0x66, 0xDF, 0x6A, 0xD8, 0x2F, 0x1A, 0x9C, 0x0B, 0x29, - 0xC7, 0x5E, 0xD2, 0xB8, 0x5D, 0xB2, 0xB9, 0xB5, 0xB2, 0xF7, 0x35, 0x86, 0x97, 0x22, 0xEE, 0x99, 0x8C, 0x6A, - 0xE5, 0xEF, 0x0B, 0x0C, 0x07, 0x45, 0xC2, 0xB3, 0x11, 0xB5, 0xCC, 0x77, 0x15, 0xE6, 0x8F, 0x0A, 0xE4, 0x07, - 0x0B, 0x42, 0x87, 0x71, 0xA2, 0xA4, 0x79, 0xBB, 0x62, 0xF3, 0x69, 0x85, 0xEE, 0xE3, 0x0C, 0x49, 0xC5, 0xF6, - 0xD3, 0x06, 0xDD, 0xC2, 0xD9, 0x91, 0x9A, 0xEC, 0x6B, 0x0D, 0xEF, 0x45, 0x8C, 0x33, 0x25, 0xD5, 0xDB, 0x1F, - 0x1B, 0x48, 0x0B, 0x76, 0x87, 0x66, 0xE2, 0xAA, 0xC9, 0xBF, 0x16, 0xF0, 0x0E, 0xC4, 0x04, 0x53, 0x43, 0x7D, - 0xF1, 0xE1, 0x84, 0x48, 0x63, 0x76, 0xA9, 0xE6, 0xFE, 0xCA, 0xC0, 0x57, 0x10, 0x3E, 0x8C, 0x10, 0x65, 0xCC, - 0x2B, 0x15, 0xDF, 0x4F, 0x18, 0x34, 0x0A, 0x97, 0x47, 0x2E, 0xB2, 0x9C, 0x75, 0xA9, 0xE7, 0x3E, 0xCA, 0x90, - 0x57, 0x2C, 0x3E, 0x9D, 0xD0, 0x69, 0x9C, 0x2E, 0xE9, 0xDC, 0x4E, 0xD9, 0xF4, 0x5A, 0xC7, 0x7B, 0x12, 0xA3, - 0x4D, 0xB9, 0xF5, 0xB2, 0xC7, 0x35, 0x92, 0x97, 0x2D, 0xAE, 0x9D, 0xBC, 0x69, 0xB1, 0xEE, 0xF4, 0x4C, 0x47, - 0x75, 0xF2, 0xA7, 0x05, 0xBA, 0x83, 0x33, 0x21, 0xD5, 0xD8, 0x5F, 0x1A, 0xB8, 0x0B, 0x32, 0x87, 0x55, 0xA2, - 0xBF, 0x39, 0xB0, 0x12, 0xF4, 0x0D, 0x87, 0x45, 0xA2, 0xB3, 0x39, 0xB5, 0xD2, 0xF7, 0x1D, 0x86, 0x89, 0xA2, - 0xE6, 0xF9, 0x8A, 0xC2, 0xE7, 0x11, 0x8A, 0x8C, 0x67, 0x25, 0xEA, 0x9B, 0x0F, 0x2B, 0x44, 0x1F, 0x73, 0x48, - 0x25, 0xF6, 0x9B, 0x06, 0xEB, 0x42, 0xCF, 0x71, 0x94, 0x24, 0x6F, 0x5B, 0x6C, 0x3B, 0x6D, 0xD3, 0x6D, 0x9D, - 0xED, 0xA9, 0x8D, 0xBE, 0xE5, 0xB0, 0x4B, 0x34, 0x37, 0x57, 0x56, 0xBE, 0xBE, 0xF0, 0x70, 0x44, 0x24, 0x33, - 0x5B, 0x55, 0xFB, 0x7F, 0x03, 0x60, 0x01, 0xE8, 0x00, 0x4E, 0x80, 0x34, 0x60, 0x17, 0x68, 0x0E, 0xAE, 0x84, - 0x7C, 0x63, 0x61, 0xE9, 0xE8, 0x4E, 0xCE, 0xB4, 0x54, 0x77, 0x7F, 0x66, 0xA0, 0x2A, 0xF8, 0x1F, 0x02, 0x88, - 0x01, 0xA6, 0x80, 0x7A, 0xE0, 0x23, 0x08, 0x19, 0xC6, 0x8A, 0xD2, 0xE7, 0x1D, 0x8A, 0x89, 0xA7, 0x26, 0xFA, - 0x9A, 0xC3, 0x2B, 0x11, 0xDF, 0x4C, 0x58, 0x35, 0xFA, 0x97, 0x03, 0x2E, 0x81, 0xDC, 0x60, 0x59, 0xE8, 0x3A, - 0xCE, 0x93, 0x14, 0x6D, 0xCF, 0x6D, 0x94, 0x2D, 0xAF, 0x5D, 0xBC, 0x39, 0xB1, 0xD2, 0xF4, 0x5D, 0x87, 0x79, - 0xA2, 0xA2, 0xF9, 0xB9, 0x82, 0xF2, 0xE1, 0x85, 0x88, 0x63, 0x26, 0xA9, 0xDA, 0xFE, 0xDB, 0x00, 0x5B, 0x40, - 0x3B, 0x70, 0x13, 0x64, 0x0D, 0xEB, 0x45, 0x8F, 0x73, 0x24, 0x25, 0xDB, 0x5B, 0x1B, 0x7B, 0x4B, 0x63, 0x77, - 0x69, 0xE6, 0xAE, 0xCA, 0xFC, 0x57, 0x01, 0xFE, 0x80, 0x40, 0x60, 0x30, 0x28, 0x14, 0x1E, 0x8F, 0x48, 0x64, - 0x36, 0xAB, 0x56, 0xFF, 0x7E, 0xC0, 0x20, 0x50, 0x18, 0x3C, 0x0A, 0x91, 0xC7, 0x2C, 0x52, 0x9D, 0xFD, 0xA9, - 0x81, 0xBE, 0xE0, 0x70, 0x48, 0x24, 0x36, 0x9B, 0x56, 0xEB, 0x7E, 0xCF, 0x60, 0x54, 0x28, 0x3F, 0x5E, 0x90, - 0x38, 0x6C, 0x12, 0xAD, 0xCD, 0xBD, 0x95, 0xB1, 0xAF, 0x34, 0x7C, 0x17, 0x61, 0xCE, 0xA8, 0x54, 0x7E, 0xBF, - 0x60, 0x70, 0x28, 0x24, 0x1E, 0x9B, 0x48, 0x6B, 0x76, 0xAF, 0x66, 0xFC, 0x2A, 0xC1, 0xDF, 0x10, 0x58, 0x0C, - 0x3A, 0x85, 0xD3, 0x23, 0x1D, 0xD9, 0xC9, 0x9A, 0xD6, 0xEB, 0x1E, 0xCF, 0x48, 0x54, 0x36, 0xBF, 0x56, 0xF0, - 0x3E, 0xC4, 0x10, 0x53, 0x4C, 0x3D, 0xF5, 0xD1, 0x87, 0x1C, 0x62, 0x89, 0xE9, 0xA6, 0xCE, 0xFA, 0xD4, 0x43, - 0x1F, 0x71, 0xC8, 0x24, 0x56, 0x9B, 0x7E, 0xEB, 0x60, 0x4F, 0x68, 0x34, 0x2E, 0x97, 0x5C, 0x6E, 0xB9, 0xEC, - 0x72, 0xCD, 0xE5, 0x95, 0x8B, 0x2F, 0x27, 0x5C, 0x1A, 0xB9, 0xCB, 0x32, 0xD7, 0x55, 0x9E, 0xBF, 0x28, 0x70, - 0x1E, 0xA4, 0x08, 0x7B, 0x46, 0xA3, 0x72, 0xF9, 0xE5, 0x82, 0xCB, 0x21, 0x97, 0x58, 0x6E, 0xBA, 0xAC, 0x73, - 0x3D, 0xE5, 0xD1, 0x8B, 0x1C, 0x67, 0x49, 0xEA, 0xB6, 0xCF, 0x36, 0xD4, 0x16, 0xDF, 0x4E, 0xD8, 0x34, 0x5A, - 0x97, 0x7B, 0x2E, 0xA3, 0x5C, 0x79, 0xF9, 0xE2, 0xC2, 0xC9, 0x91, 0x96, 0xEC, 0x6E, 0xCD, 0xEC, 0x55, 0x8D, - 0xFF, 0x25, 0x80, 0x1B, 0x20, 0x0B, 0x58, 0x07, 0x7A, 0x82, 0xA3, 0x21, 0xB9, 0xD8, 0x72, 0xDA, 0xA5, 0x9B, - 0x3B, 0x2B, 0x53, 0x5F, 0x7D, 0xF8, 0x21, 0x82, 0x98, 0x61, 0xAA, 0xA8, 0x7F, 0x3E, 0xA0, 0x10, 0x78, 0x0C, - 0x22, 0x85, 0xD9, 0xA3, 0x1A, 0xF9, 0xCB, 0x02, 0xD7, 0x41, 0x9E, 0xB0, 0x68, 0x74, 0x2E, 0xA7, 0x5C, 0x7A, - 0xB9, 0xE3, 0x32, 0xC9, 0xD5, 0x96, 0xDF, 0x2E, 0xD8, 0x1C, 0x5A, 0x89, 0xFB, 0x26, 0xC3, 0x5A, 0xD1, 0xFB, - 0x1C, 0x43, 0x49, 0xF1, 0xF6, 0xC4, 0x46, 0xD3, 0x72, 0xDD, 0xE5, 0x99 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x60, 0x00, + 0x28, 0x00, 0x1E, 0x80, 0x08, 0x60, 0x06, 0xA8, 0x02, 0xFE, 0x81, 0x80, 0x60, 0x60, 0x28, 0x28, 0x1E, + 0x9E, 0x88, 0x68, 0x66, 0xAE, 0xAA, 0xFC, 0x7F, 0x01, 0xE0, 0x00, 0x48, 0x00, 0x36, 0x80, 0x16, 0xE0, + 0x0E, 0xC8, 0x04, 0x56, 0x83, 0x7E, 0xE1, 0xE0, 0x48, 0x48, 0x36, 0xB6, 0x96, 0xF6, 0xEE, 0xC6, 0xCC, + 0x52, 0xD5, 0xFD, 0x9F, 0x01, 0xA8, 0x00, 0x7E, 0x80, 0x20, 0x60, 0x18, 0x28, 0x0A, 0x9E, 0x87, 0x28, + 0x62, 0x9E, 0xA9, 0xA8, 0x7E, 0xFE, 0xA0, 0x40, 0x78, 0x30, 0x22, 0x94, 0x19, 0xAF, 0x4A, 0xFC, 0x37, + 0x01, 0xD6, 0x80, 0x5E, 0xE0, 0x38, 0x48, 0x12, 0xB6, 0x8D, 0xB6, 0xE5, 0xB6, 0xCB, 0x36, 0xD7, 0x56, + 0xDE, 0xBE, 0xD8, 0x70, 0x5A, 0xA4, 0x3B, 0x3B, 0x53, 0x53, 0x7D, 0xFD, 0xE1, 0x81, 0x88, 0x60, 0x66, + 0xA8, 0x2A, 0xFE, 0x9F, 0x00, 0x68, 0x00, 0x2E, 0x80, 0x1C, 0x60, 0x09, 0xE8, 0x06, 0xCE, 0x82, 0xD4, + 0x61, 0x9F, 0x68, 0x68, 0x2E, 0xAE, 0x9C, 0x7C, 0x69, 0xE1, 0xEE, 0xC8, 0x4C, 0x56, 0xB5, 0xFE, 0xF7, + 0x00, 0x46, 0x80, 0x32, 0xE0, 0x15, 0x88, 0x0F, 0x26, 0x84, 0x1A, 0xE3, 0x4B, 0x09, 0xF7, 0x46, 0xC6, + 0xB2, 0xD2, 0xF5, 0x9D, 0x87, 0x29, 0xA2, 0x9E, 0xF9, 0xA8, 0x42, 0xFE, 0xB1, 0x80, 0x74, 0x60, 0x27, + 0x68, 0x1A, 0xAE, 0x8B, 0x3C, 0x67, 0x51, 0xEA, 0xBC, 0x4F, 0x31, 0xF4, 0x14, 0x47, 0x4F, 0x72, 0xB4, + 0x25, 0xB7, 0x5B, 0x36, 0xBB, 0x56, 0xF3, 0x7E, 0xC5, 0xE0, 0x53, 0x08, 0x3D, 0xC6, 0x91, 0x92, 0xEC, + 0x6D, 0x8D, 0xED, 0xA5, 0x8D, 0xBB, 0x25, 0xB3, 0x5B, 0x35, 0xFB, 0x57, 0x03, 0x7E, 0x81, 0xE0, 0x60, + 0x48, 0x28, 0x36, 0x9E, 0x96, 0xE8, 0x6E, 0xCE, 0xAC, 0x54, 0x7D, 0xFF, 0x61, 0x80, 0x28, 0x60, 0x1E, + 0xA8, 0x08, 0x7E, 0x86, 0xA0, 0x62, 0xF8, 0x29, 0x82, 0x9E, 0xE1, 0xA8, 0x48, 0x7E, 0xB6, 0xA0, 0x76, + 0xF8, 0x26, 0xC2, 0x9A, 0xD1, 0xAB, 0x1C, 0x7F, 0x49, 0xE0, 0x36, 0xC8, 0x16, 0xD6, 0x8E, 0xDE, 0xE4, + 0x58, 0x4B, 0x7A, 0xB7, 0x63, 0x36, 0xA9, 0xD6, 0xFE, 0xDE, 0xC0, 0x58, 0x50, 0x3A, 0xBC, 0x13, 0x31, + 0xCD, 0xD4, 0x55, 0x9F, 0x7F, 0x28, 0x20, 0x1E, 0x98, 0x08, 0x6A, 0x86, 0xAF, 0x22, 0xFC, 0x19, 0x81, + 0xCA, 0xE0, 0x57, 0x08, 0x3E, 0x86, 0x90, 0x62, 0xEC, 0x29, 0x8D, 0xDE, 0xE5, 0x98, 0x4B, 0x2A, 0xB7, + 0x5F, 0x36, 0xB8, 0x16, 0xF2, 0x8E, 0xC5, 0xA4, 0x53, 0x3B, 0x7D, 0xD3, 0x61, 0x9D, 0xE8, 0x69, 0x8E, + 0xAE, 0xE4, 0x7C, 0x4B, 0x61, 0xF7, 0x68, 0x46, 0xAE, 0xB2, 0xFC, 0x75, 0x81, 0xE7, 0x20, 0x4A, 0x98, + 0x37, 0x2A, 0x96, 0x9F, 0x2E, 0xE8, 0x1C, 0x4E, 0x89, 0xF4, 0x66, 0xC7, 0x6A, 0xD2, 0xAF, 0x1D, 0xBC, + 0x09, 0xB1, 0xC6, 0xF4, 0x52, 0xC7, 0x7D, 0x92, 0xA1, 0xAD, 0xB8, 0x7D, 0xB2, 0xA1, 0xB5, 0xB8, 0x77, + 0x32, 0xA6, 0x95, 0xBA, 0xEF, 0x33, 0x0C, 0x15, 0xC5, 0xCF, 0x13, 0x14, 0x0D, 0xCF, 0x45, 0x94, 0x33, + 0x2F, 0x55, 0xDC, 0x3F, 0x19, 0xD0, 0x0A, 0xDC, 0x07, 0x19, 0xC2, 0x8A, 0xD1, 0xA7, 0x1C, 0x7A, 0x89, + 0xE3, 0x26, 0xC9, 0xDA, 0xD6, 0xDB, 0x1E, 0xDB, 0x48, 0x5B, 0x76, 0xBB, 0x66, 0xF3, 0x6A, 0xC5, 0xEF, + 0x13, 0x0C, 0x0D, 0xC5, 0xC5, 0x93, 0x13, 0x2D, 0xCD, 0xDD, 0x95, 0x99, 0xAF, 0x2A, 0xFC, 0x1F, 0x01, + 0xC8, 0x00, 0x56, 0x80, 0x3E, 0xE0, 0x10, 0x48, 0x0C, 0x36, 0x85, 0xD6, 0xE3, 0x1E, 0xC9, 0xC8, 0x56, + 0xD6, 0xBE, 0xDE, 0xF0, 0x58, 0x44, 0x3A, 0xB3, 0x53, 0x35, 0xFD, 0xD7, 0x01, 0x9E, 0x80, 0x68, 0x60, + 0x2E, 0xA8, 0x1C, 0x7E, 0x89, 0xE0, 0x66, 0xC8, 0x2A, 0xD6, 0x9F, 0x1E, 0xE8, 0x08, 0x4E, 0x86, 0xB4, + 0x62, 0xF7, 0x69, 0x86, 0xAE, 0xE2, 0xFC, 0x49, 0x81, 0xF6, 0xE0, 0x46, 0xC8, 0x32, 0xD6, 0x95, 0x9E, + 0xEF, 0x28, 0x4C, 0x1E, 0xB5, 0xC8, 0x77, 0x16, 0xA6, 0x8E, 0xFA, 0xE4, 0x43, 0x0B, 0x71, 0xC7, 0x64, + 0x52, 0xAB, 0x7D, 0xBF, 0x61, 0xB0, 0x28, 0x74, 0x1E, 0xA7, 0x48, 0x7A, 0xB6, 0xA3, 0x36, 0xF9, 0xD6, + 0xC2, 0xDE, 0xD1, 0x98, 0x5C, 0x6A, 0xB9, 0xEF, 0x32, 0xCC, 0x15, 0x95, 0xCF, 0x2F, 0x14, 0x1C, 0x0F, + 0x49, 0xC4, 0x36, 0xD3, 0x56, 0xDD, 0xFE, 0xD9, 0x80, 0x5A, 0xE0, 0x3B, 0x08, 0x13, 0x46, 0x8D, 0xF2, + 0xE5, 0x85, 0x8B, 0x23, 0x27, 0x59, 0xDA, 0xBA, 0xDB, 0x33, 0x1B, 0x55, 0xCB, 0x7F, 0x17, 0x60, 0x0E, + 0xA8, 0x04, 0x7E, 0x83, 0x60, 0x61, 0xE8, 0x28, 0x4E, 0x9E, 0xB4, 0x68, 0x77, 0x6E, 0xA6, 0xAC, 0x7A, + 0xFD, 0xE3, 0x01, 0x89, 0xC0, 0x66, 0xD0, 0x2A, 0xDC, 0x1F, 0x19, 0xC8, 0x0A, 0xD6, 0x87, 0x1E, 0xE2, + 0x88, 0x49, 0xA6, 0xB6, 0xFA, 0xF6, 0xC3, 0x06, 0xD1, 0xC2, 0xDC, 0x51, 0x99, 0xFC, 0x6A, 0xC1, 0xEF, + 0x10, 0x4C, 0x0C, 0x35, 0xC5, 0xD7, 0x13, 0x1E, 0x8D, 0xC8, 0x65, 0x96, 0xAB, 0x2E, 0xFF, 0x5C, 0x40, + 0x39, 0xF0, 0x12, 0xC4, 0x0D, 0x93, 0x45, 0xAD, 0xF3, 0x3D, 0x85, 0xD1, 0xA3, 0x1C, 0x79, 0xC9, 0xE2, + 0xD6, 0xC9, 0x9E, 0xD6, 0xE8, 0x5E, 0xCE, 0xB8, 0x54, 0x72, 0xBF, 0x65, 0xB0, 0x2B, 0x34, 0x1F, 0x57, + 0x48, 0x3E, 0xB6, 0x90, 0x76, 0xEC, 0x26, 0xCD, 0xDA, 0xD5, 0x9B, 0x1F, 0x2B, 0x48, 0x1F, 0x76, 0x88, + 0x26, 0xE6, 0x9A, 0xCA, 0xEB, 0x17, 0x0F, 0x4E, 0x84, 0x34, 0x63, 0x57, 0x69, 0xFE, 0xAE, 0xC0, 0x7C, + 0x50, 0x21, 0xFC, 0x18, 0x41, 0xCA, 0xB0, 0x57, 0x34, 0x3E, 0x97, 0x50, 0x6E, 0xBC, 0x2C, 0x71, 0xDD, + 0xE4, 0x59, 0x8B, 0x7A, 0xE7, 0x63, 0x0A, 0xA9, 0xC7, 0x3E, 0xD2, 0x90, 0x5D, 0xAC, 0x39, 0xBD, 0xD2, + 0xF1, 0x9D, 0x84, 0x69, 0xA3, 0x6E, 0xF9, 0xEC, 0x42, 0xCD, 0xF1, 0x95, 0x84, 0x6F, 0x23, 0x6C, 0x19, + 0xED, 0xCA, 0xCD, 0x97, 0x15, 0xAE, 0x8F, 0x3C, 0x64, 0x11, 0xEB, 0x4C, 0x4F, 0x75, 0xF4, 0x27, 0x07, + 0x5A, 0x82, 0xBB, 0x21, 0xB3, 0x58, 0x75, 0xFA, 0xA7, 0x03, 0x3A, 0x81, 0xD3, 0x20, 0x5D, 0xD8, 0x39, + 0x9A, 0x92, 0xEB, 0x2D, 0x8F, 0x5D, 0xA4, 0x39, 0xBB, 0x52, 0xF3, 0x7D, 0x85, 0xE1, 0xA3, 0x08, 0x79, + 0xC6, 0xA2, 0xD2, 0xF9, 0x9D, 0x82, 0xE9, 0xA1, 0x8E, 0xF8, 0x64, 0x42, 0xAB, 0x71, 0xBF, 0x64, 0x70, + 0x2B, 0x64, 0x1F, 0x6B, 0x48, 0x2F, 0x76, 0x9C, 0x26, 0xE9, 0xDA, 0xCE, 0xDB, 0x14, 0x5B, 0x4F, 0x7B, + 0x74, 0x23, 0x67, 0x59, 0xEA, 0xBA, 0xCF, 0x33, 0x14, 0x15, 0xCF, 0x4F, 0x14, 0x34, 0x0F, 0x57, 0x44, + 0x3E, 0xB3, 0x50, 0x75, 0xFC, 0x27, 0x01, 0xDA, 0x80, 0x5B, 0x20, 0x3B, 0x58, 0x13, 0x7A, 0x8D, 0xE3, + 0x25, 0x89, 0xDB, 0x26, 0xDB, 0x5A, 0xDB, 0x7B, 0x1B, 0x63, 0x4B, 0x69, 0xF7, 0x6E, 0xC6, 0xAC, 0x52, + 0xFD, 0xFD, 0x81, 0x81, 0xA0, 0x60, 0x78, 0x28, 0x22, 0x9E, 0x99, 0xA8, 0x6A, 0xFE, 0xAF, 0x00, 0x7C, + 0x00, 0x21, 0xC0, 0x18, 0x50, 0x0A, 0xBC, 0x07, 0x31, 0xC2, 0x94, 0x51, 0xAF, 0x7C, 0x7C, 0x21, 0xE1, + 0xD8, 0x48, 0x5A, 0xB6, 0xBB, 0x36, 0xF3, 0x56, 0xC5, 0xFE, 0xD3, 0x00, 0x5D, 0xC0, 0x39, 0x90, 0x12, + 0xEC, 0x0D, 0x8D, 0xC5, 0xA5, 0x93, 0x3B, 0x2D, 0xD3, 0x5D, 0x9D, 0xF9, 0xA9, 0x82, 0xFE, 0xE1, 0x80, + 0x48, 0x60, 0x36, 0xA8, 0x16, 0xFE, 0x8E, 0xC0, 0x64, 0x50, 0x2B, 0x7C, 0x1F, 0x61, 0xC8, 0x28, 0x56, + 0x9E, 0xBE, 0xE8, 0x70, 0x4E, 0xA4, 0x34, 0x7B, 0x57, 0x63, 0x7E, 0xA9, 0xE0, 0x7E, 0xC8, 0x20, 0x56, + 0x98, 0x3E, 0xEA, 0x90, 0x4F, 0x2C, 0x34, 0x1D, 0xD7, 0x49, 0x9E, 0xB6, 0xE8, 0x76, 0xCE, 0xA6, 0xD4, + 0x7A, 0xDF, 0x63, 0x18, 0x29, 0xCA, 0x9E, 0xD7, 0x28, 0x5E, 0x9E, 0xB8, 0x68, 0x72, 0xAE, 0xA5, 0xBC, + 0x7B, 0x31, 0xE3, 0x54, 0x49, 0xFF, 0x76, 0xC0, 0x26, 0xD0, 0x1A, 0xDC, 0x0B, 0x19, 0xC7, 0x4A, 0xD2, + 0xB7, 0x1D, 0xB6, 0x89, 0xB6, 0xE6, 0xF6, 0xCA, 0xC6, 0xD7, 0x12, 0xDE, 0x8D, 0x98, 0x65, 0xAA, 0xAB, + 0x3F, 0x3F, 0x50, 0x10, 0x3C, 0x0C, 0x11, 0xC5, 0xCC, 0x53, 0x15, 0xFD, 0xCF, 0x01, 0x94, 0x00, 0x6F, + 0x40, 0x2C, 0x30, 0x1D, 0xD4, 0x09, 0x9F, 0x46, 0xE8, 0x32, 0xCE, 0x95, 0x94, 0x6F, 0x2F, 0x6C, 0x1C, + 0x2D, 0xC9, 0xDD, 0x96, 0xD9, 0xAE, 0xDA, 0xFC, 0x5B, 0x01, 0xFB, 0x40, 0x43, 0x70, 0x31, 0xE4, 0x14, + 0x4B, 0x4F, 0x77, 0x74, 0x26, 0xA7, 0x5A, 0xFA, 0xBB, 0x03, 0x33, 0x41, 0xD5, 0xF0, 0x5F, 0x04, 0x38, + 0x03, 0x52, 0x81, 0xFD, 0xA0, 0x41, 0xB8, 0x30, 0x72, 0x94, 0x25, 0xAF, 0x5B, 0x3C, 0x3B, 0x51, 0xD3, + 0x7C, 0x5D, 0xE1, 0xF9, 0x88, 0x42, 0xE6, 0xB1, 0x8A, 0xF4, 0x67, 0x07, 0x6A, 0x82, 0xAF, 0x21, 0xBC, + 0x18, 0x71, 0xCA, 0xA4, 0x57, 0x3B, 0x7E, 0x93, 0x60, 0x6D, 0xE8, 0x2D, 0x8E, 0x9D, 0xA4, 0x69, 0xBB, + 0x6E, 0xF3, 0x6C, 0x45, 0xED, 0xF3, 0x0D, 0x85, 0xC5, 0xA3, 0x13, 0x39, 0xCD, 0xD2, 0xD5, 0x9D, 0x9F, + 0x29, 0xA8, 0x1E, 0xFE, 0x88, 0x40, 0x66, 0xB0, 0x2A, 0xF4, 0x1F, 0x07, 0x48, 0x02, 0xB6, 0x81, 0xB6, + 0xE0, 0x76, 0xC8, 0x26, 0xD6, 0x9A, 0xDE, 0xEB, 0x18, 0x4F, 0x4A, 0xB4, 0x37, 0x37, 0x56, 0x96, 0xBE, + 0xEE, 0xF0, 0x4C, 0x44, 0x35, 0xF3, 0x57, 0x05, 0xFE, 0x83, 0x00, 0x61, 0xC0, 0x28, 0x50, 0x1E, 0xBC, + 0x08, 0x71, 0xC6, 0xA4, 0x52, 0xFB, 0x7D, 0x83, 0x61, 0xA1, 0xE8, 0x78, 0x4E, 0xA2, 0xB4, 0x79, 0xB7, + 0x62, 0xF6, 0xA9, 0x86, 0xFE, 0xE2, 0xC0, 0x49, 0x90, 0x36, 0xEC, 0x16, 0xCD, 0xCE, 0xD5, 0x94, 0x5F, + 0x2F, 0x78, 0x1C, 0x22, 0x89, 0xD9, 0xA6, 0xDA, 0xFA, 0xDB, 0x03, 0x1B, 0x41, 0xCB, 0x70, 0x57, 0x64, + 0x3E, 0xAB, 0x50, 0x7F, 0x7C, 0x20, 0x21, 0xD8, 0x18, 0x5A, 0x8A, 0xBB, 0x27, 0x33, 0x5A, 0x95, 0xFB, + 0x2F, 0x03, 0x5C, 0x01, 0xF9, 0xC0, 0x42, 0xD0, 0x31, 0x9C, 0x14, 0x69, 0xCF, 0x6E, 0xD4, 0x2C, 0x5F, + 0x5D, 0xF8, 0x39, 0x82, 0x92, 0xE1, 0xAD, 0x88, 0x7D, 0xA6, 0xA1, 0xBA, 0xF8, 0x73, 0x02, 0xA5, 0xC1, + 0xBB, 0x10, 0x73, 0x4C, 0x25, 0xF5, 0xDB, 0x07, 0x1B, 0x42, 0x8B, 0x71, 0xA7, 0x64, 0x7A, 0xAB, 0x63, + 0x3F, 0x69, 0xD0, 0x2E, 0xDC, 0x1C, 0x59, 0xC9, 0xFA, 0xD6, 0xC3, 0x1E, 0xD1, 0xC8, 0x5C, 0x56, 0xB9, + 0xFE, 0xF2, 0xC0, 0x45, 0x90, 0x33, 0x2C, 0x15, 0xDD, 0xCF, 0x19, 0x94, 0x0A, 0xEF, 0x47, 0x0C, 0x32, + 0x85, 0xD5, 0xA3, 0x1F, 0x39, 0xC8, 0x12, 0xD6, 0x8D, 0x9E, 0xE5, 0xA8, 0x4B, 0x3E, 0xB7, 0x50, 0x76, + 0xBC, 0x26, 0xF1, 0xDA, 0xC4, 0x5B, 0x13, 0x7B, 0x4D, 0xE3, 0x75, 0x89, 0xE7, 0x26, 0xCA, 0x9A, 0xD7, + 0x2B, 0x1E, 0x9F, 0x48, 0x68, 0x36, 0xAE, 0x96, 0xFC, 0x6E, 0xC1, 0xEC, 0x50, 0x4D, 0xFC, 0x35, 0x81, + 0xD7, 0x20, 0x5E, 0x98, 0x38, 0x6A, 0x92, 0xAF, 0x2D, 0xBC, 0x1D, 0xB1, 0xC9, 0xB4, 0x56, 0xF7, 0x7E, + 0xC6, 0xA0, 0x52, 0xF8, 0x3D, 0x82, 0x91, 0xA1, 0xAC, 0x78, 0x7D, 0xE2, 0xA1, 0x89, 0xB8, 0x66, 0xF2, + 0xAA, 0xC5, 0xBF, 0x13, 0x30, 0x0D, 0xD4, 0x05, 0x9F, 0x43, 0x28, 0x31, 0xDE, 0x94, 0x58, 0x6F, 0x7A, + 0xAC, 0x23, 0x3D, 0xD9, 0xD1, 0x9A, 0xDC, 0x6B, 0x19, 0xEF, 0x4A, 0xCC, 0x37, 0x15, 0xD6, 0x8F, 0x1E, + 0xE4, 0x08, 0x4B, 0x46, 0xB7, 0x72, 0xF6, 0xA5, 0x86, 0xFB, 0x22, 0xC3, 0x59, 0x91, 0xFA, 0xEC, 0x43, + 0x0D, 0xF1, 0xC5, 0x84, 0x53, 0x23, 0x7D, 0xD9, 0xE1, 0x9A, 0xC8, 0x6B, 0x16, 0xAF, 0x4E, 0xFC, 0x34, + 0x41, 0xD7, 0x70, 0x5E, 0xA4, 0x38, 0x7B, 0x52, 0xA3, 0x7D, 0xB9, 0xE1, 0xB2, 0xC8, 0x75, 0x96, 0xA7, + 0x2E, 0xFA, 0x9C, 0x43, 0x29, 0xF1, 0xDE, 0xC4, 0x58, 0x53, 0x7A, 0xBD, 0xE3, 0x31, 0x89, 0xD4, 0x66, + 0xDF, 0x6A, 0xD8, 0x2F, 0x1A, 0x9C, 0x0B, 0x29, 0xC7, 0x5E, 0xD2, 0xB8, 0x5D, 0xB2, 0xB9, 0xB5, 0xB2, + 0xF7, 0x35, 0x86, 0x97, 0x22, 0xEE, 0x99, 0x8C, 0x6A, 0xE5, 0xEF, 0x0B, 0x0C, 0x07, 0x45, 0xC2, 0xB3, + 0x11, 0xB5, 0xCC, 0x77, 0x15, 0xE6, 0x8F, 0x0A, 0xE4, 0x07, 0x0B, 0x42, 0x87, 0x71, 0xA2, 0xA4, 0x79, + 0xBB, 0x62, 0xF3, 0x69, 0x85, 0xEE, 0xE3, 0x0C, 0x49, 0xC5, 0xF6, 0xD3, 0x06, 0xDD, 0xC2, 0xD9, 0x91, + 0x9A, 0xEC, 0x6B, 0x0D, 0xEF, 0x45, 0x8C, 0x33, 0x25, 0xD5, 0xDB, 0x1F, 0x1B, 0x48, 0x0B, 0x76, 0x87, + 0x66, 0xE2, 0xAA, 0xC9, 0xBF, 0x16, 0xF0, 0x0E, 0xC4, 0x04, 0x53, 0x43, 0x7D, 0xF1, 0xE1, 0x84, 0x48, + 0x63, 0x76, 0xA9, 0xE6, 0xFE, 0xCA, 0xC0, 0x57, 0x10, 0x3E, 0x8C, 0x10, 0x65, 0xCC, 0x2B, 0x15, 0xDF, + 0x4F, 0x18, 0x34, 0x0A, 0x97, 0x47, 0x2E, 0xB2, 0x9C, 0x75, 0xA9, 0xE7, 0x3E, 0xCA, 0x90, 0x57, 0x2C, + 0x3E, 0x9D, 0xD0, 0x69, 0x9C, 0x2E, 0xE9, 0xDC, 0x4E, 0xD9, 0xF4, 0x5A, 0xC7, 0x7B, 0x12, 0xA3, 0x4D, + 0xB9, 0xF5, 0xB2, 0xC7, 0x35, 0x92, 0x97, 0x2D, 0xAE, 0x9D, 0xBC, 0x69, 0xB1, 0xEE, 0xF4, 0x4C, 0x47, + 0x75, 0xF2, 0xA7, 0x05, 0xBA, 0x83, 0x33, 0x21, 0xD5, 0xD8, 0x5F, 0x1A, 0xB8, 0x0B, 0x32, 0x87, 0x55, + 0xA2, 0xBF, 0x39, 0xB0, 0x12, 0xF4, 0x0D, 0x87, 0x45, 0xA2, 0xB3, 0x39, 0xB5, 0xD2, 0xF7, 0x1D, 0x86, + 0x89, 0xA2, 0xE6, 0xF9, 0x8A, 0xC2, 0xE7, 0x11, 0x8A, 0x8C, 0x67, 0x25, 0xEA, 0x9B, 0x0F, 0x2B, 0x44, + 0x1F, 0x73, 0x48, 0x25, 0xF6, 0x9B, 0x06, 0xEB, 0x42, 0xCF, 0x71, 0x94, 0x24, 0x6F, 0x5B, 0x6C, 0x3B, + 0x6D, 0xD3, 0x6D, 0x9D, 0xED, 0xA9, 0x8D, 0xBE, 0xE5, 0xB0, 0x4B, 0x34, 0x37, 0x57, 0x56, 0xBE, 0xBE, + 0xF0, 0x70, 0x44, 0x24, 0x33, 0x5B, 0x55, 0xFB, 0x7F, 0x03, 0x60, 0x01, 0xE8, 0x00, 0x4E, 0x80, 0x34, + 0x60, 0x17, 0x68, 0x0E, 0xAE, 0x84, 0x7C, 0x63, 0x61, 0xE9, 0xE8, 0x4E, 0xCE, 0xB4, 0x54, 0x77, 0x7F, + 0x66, 0xA0, 0x2A, 0xF8, 0x1F, 0x02, 0x88, 0x01, 0xA6, 0x80, 0x7A, 0xE0, 0x23, 0x08, 0x19, 0xC6, 0x8A, + 0xD2, 0xE7, 0x1D, 0x8A, 0x89, 0xA7, 0x26, 0xFA, 0x9A, 0xC3, 0x2B, 0x11, 0xDF, 0x4C, 0x58, 0x35, 0xFA, + 0x97, 0x03, 0x2E, 0x81, 0xDC, 0x60, 0x59, 0xE8, 0x3A, 0xCE, 0x93, 0x14, 0x6D, 0xCF, 0x6D, 0x94, 0x2D, + 0xAF, 0x5D, 0xBC, 0x39, 0xB1, 0xD2, 0xF4, 0x5D, 0x87, 0x79, 0xA2, 0xA2, 0xF9, 0xB9, 0x82, 0xF2, 0xE1, + 0x85, 0x88, 0x63, 0x26, 0xA9, 0xDA, 0xFE, 0xDB, 0x00, 0x5B, 0x40, 0x3B, 0x70, 0x13, 0x64, 0x0D, 0xEB, + 0x45, 0x8F, 0x73, 0x24, 0x25, 0xDB, 0x5B, 0x1B, 0x7B, 0x4B, 0x63, 0x77, 0x69, 0xE6, 0xAE, 0xCA, 0xFC, + 0x57, 0x01, 0xFE, 0x80, 0x40, 0x60, 0x30, 0x28, 0x14, 0x1E, 0x8F, 0x48, 0x64, 0x36, 0xAB, 0x56, 0xFF, + 0x7E, 0xC0, 0x20, 0x50, 0x18, 0x3C, 0x0A, 0x91, 0xC7, 0x2C, 0x52, 0x9D, 0xFD, 0xA9, 0x81, 0xBE, 0xE0, + 0x70, 0x48, 0x24, 0x36, 0x9B, 0x56, 0xEB, 0x7E, 0xCF, 0x60, 0x54, 0x28, 0x3F, 0x5E, 0x90, 0x38, 0x6C, + 0x12, 0xAD, 0xCD, 0xBD, 0x95, 0xB1, 0xAF, 0x34, 0x7C, 0x17, 0x61, 0xCE, 0xA8, 0x54, 0x7E, 0xBF, 0x60, + 0x70, 0x28, 0x24, 0x1E, 0x9B, 0x48, 0x6B, 0x76, 0xAF, 0x66, 0xFC, 0x2A, 0xC1, 0xDF, 0x10, 0x58, 0x0C, + 0x3A, 0x85, 0xD3, 0x23, 0x1D, 0xD9, 0xC9, 0x9A, 0xD6, 0xEB, 0x1E, 0xCF, 0x48, 0x54, 0x36, 0xBF, 0x56, + 0xF0, 0x3E, 0xC4, 0x10, 0x53, 0x4C, 0x3D, 0xF5, 0xD1, 0x87, 0x1C, 0x62, 0x89, 0xE9, 0xA6, 0xCE, 0xFA, + 0xD4, 0x43, 0x1F, 0x71, 0xC8, 0x24, 0x56, 0x9B, 0x7E, 0xEB, 0x60, 0x4F, 0x68, 0x34, 0x2E, 0x97, 0x5C, + 0x6E, 0xB9, 0xEC, 0x72, 0xCD, 0xE5, 0x95, 0x8B, 0x2F, 0x27, 0x5C, 0x1A, 0xB9, 0xCB, 0x32, 0xD7, 0x55, + 0x9E, 0xBF, 0x28, 0x70, 0x1E, 0xA4, 0x08, 0x7B, 0x46, 0xA3, 0x72, 0xF9, 0xE5, 0x82, 0xCB, 0x21, 0x97, + 0x58, 0x6E, 0xBA, 0xAC, 0x73, 0x3D, 0xE5, 0xD1, 0x8B, 0x1C, 0x67, 0x49, 0xEA, 0xB6, 0xCF, 0x36, 0xD4, + 0x16, 0xDF, 0x4E, 0xD8, 0x34, 0x5A, 0x97, 0x7B, 0x2E, 0xA3, 0x5C, 0x79, 0xF9, 0xE2, 0xC2, 0xC9, 0x91, + 0x96, 0xEC, 0x6E, 0xCD, 0xEC, 0x55, 0x8D, 0xFF, 0x25, 0x80, 0x1B, 0x20, 0x0B, 0x58, 0x07, 0x7A, 0x82, + 0xA3, 0x21, 0xB9, 0xD8, 0x72, 0xDA, 0xA5, 0x9B, 0x3B, 0x2B, 0x53, 0x5F, 0x7D, 0xF8, 0x21, 0x82, 0x98, + 0x61, 0xAA, 0xA8, 0x7F, 0x3E, 0xA0, 0x10, 0x78, 0x0C, 0x22, 0x85, 0xD9, 0xA3, 0x1A, 0xF9, 0xCB, 0x02, + 0xD7, 0x41, 0x9E, 0xB0, 0x68, 0x74, 0x2E, 0xA7, 0x5C, 0x7A, 0xB9, 0xE3, 0x32, 0xC9, 0xD5, 0x96, 0xDF, + 0x2E, 0xD8, 0x1C, 0x5A, 0x89, 0xFB, 0x26, 0xC3, 0x5A, 0xD1, 0xFB, 0x1C, 0x43, 0x49, 0xF1, 0xF6, 0xC4, + 0x46, 0xD3, 0x72, 0xDD, 0xE5, 0x99 }; public static readonly byte[] SyncMark = - {0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00}; + { + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00 + }; public static byte[] Scramble(byte[] sector) { diff --git a/DiscImageChef.Decoders/DVD/CSS&CPRM.cs b/DiscImageChef.Decoders/DVD/CSS&CPRM.cs index b920e3204..1a6b52d0e 100644 --- a/DiscImageChef.Decoders/DVD/CSS&CPRM.cs +++ b/DiscImageChef.Decoders/DVD/CSS&CPRM.cs @@ -182,9 +182,7 @@ namespace DiscImageChef.Decoders.DVD return sb.ToString(); } - public static string PrettifyLeadInCopyright(byte[] response) - { - return PrettifyLeadInCopyright(DecodeLeadInCopyright(response)); - } + public static string PrettifyLeadInCopyright(byte[] response) => + PrettifyLeadInCopyright(DecodeLeadInCopyright(response)); } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/DVD/Cartridge.cs b/DiscImageChef.Decoders/DVD/Cartridge.cs index 96a286a0d..1e7cedba0 100644 --- a/DiscImageChef.Decoders/DVD/Cartridge.cs +++ b/DiscImageChef.Decoders/DVD/Cartridge.cs @@ -195,9 +195,6 @@ namespace DiscImageChef.Decoders.DVD return sb.ToString(); } - public static string Prettify(byte[] response) - { - return Prettify(Decode(response)); - } + public static string Prettify(byte[] response) => Prettify(Decode(response)); } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/DVD/DDS.cs b/DiscImageChef.Decoders/DVD/DDS.cs index c4478e812..61e1d97e6 100644 --- a/DiscImageChef.Decoders/DVD/DDS.cs +++ b/DiscImageChef.Decoders/DVD/DDS.cs @@ -312,9 +312,6 @@ namespace DiscImageChef.Decoders.DVD return sb.ToString(); } - public static string Prettify(byte[] response) - { - return Prettify(Decode(response)); - } + public static string Prettify(byte[] response) => Prettify(Decode(response)); } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/DVD/PFI.cs b/DiscImageChef.Decoders/DVD/PFI.cs index 8dc6fd703..c61660faf 100644 --- a/DiscImageChef.Decoders/DVD/PFI.cs +++ b/DiscImageChef.Decoders/DVD/PFI.cs @@ -1669,9 +1669,6 @@ namespace DiscImageChef.Decoders.DVD return sb.ToString(); } - public static string Prettify(byte[] response) - { - return Prettify(Decode(response)); - } + public static string Prettify(byte[] response) => Prettify(Decode(response)); } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/DVD/Spare.cs b/DiscImageChef.Decoders/DVD/Spare.cs index 8f13ad019..ca9bfa6f0 100644 --- a/DiscImageChef.Decoders/DVD/Spare.cs +++ b/DiscImageChef.Decoders/DVD/Spare.cs @@ -123,9 +123,6 @@ namespace DiscImageChef.Decoders.DVD return sb.ToString(); } - public static string Prettify(byte[] response) - { - return Prettify(Decode(response)); - } + public static string Prettify(byte[] response) => Prettify(Decode(response)); } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/Floppy/Apple2.cs b/DiscImageChef.Decoders/Floppy/Apple2.cs index 1569ebaed..3304c4e37 100644 --- a/DiscImageChef.Decoders/Floppy/Apple2.cs +++ b/DiscImageChef.Decoders/Floppy/Apple2.cs @@ -315,10 +315,7 @@ namespace DiscImageChef.Decoders.Floppy // Not Apple ][ GCR? } - public static RawSector MarshalSector(byte[] data, int offset = 0) - { - return MarshalSector(data, out _, offset); - } + public static RawSector MarshalSector(byte[] data, int offset = 0) => MarshalSector(data, out _, offset); public static RawSector MarshalSector(byte[] data, out int endOffset, int offset = 0) { @@ -351,7 +348,9 @@ namespace DiscImageChef.Decoders.Floppy sector = new[] {data[position + 7], data[position + 8]}, checksum = new[] {data[position + 9], data[position + 10]}, epilogue = new[] - {data[position + 11], data[position + 12], data[position + 13]} + { + data[position + 11], data[position + 12], data[position + 13] + } } }; @@ -492,10 +491,7 @@ namespace DiscImageChef.Decoders.Floppy return raw.ToArray(); } - public static RawTrack MarshalTrack(byte[] data, int offset = 0) - { - return MarshalTrack(data, out _, offset); - } + public static RawTrack MarshalTrack(byte[] data, int offset = 0) => MarshalTrack(data, out _, offset); public static RawTrack MarshalTrack(byte[] data, out int endOffset, int offset = 0) { @@ -565,10 +561,7 @@ namespace DiscImageChef.Decoders.Floppy return raw.ToArray(); } - public static List MarshalDisk(byte[] data, int offset = 0) - { - return MarshalDisk(data, out _, offset); - } + public static List MarshalDisk(byte[] data, int offset = 0) => MarshalDisk(data, out _, offset); public static List MarshalDisk(byte[] data, out int endOffset, int offset = 0) { @@ -589,10 +582,7 @@ namespace DiscImageChef.Decoders.Floppy return tracks; } - public static byte[] MarshalDisk(List disk) - { - return MarshalDisk(disk.ToArray()); - } + public static byte[] MarshalDisk(List disk) => MarshalDisk(disk.ToArray()); public static byte[] MarshalDisk(RawTrack[] disk) { diff --git a/DiscImageChef.Decoders/Floppy/AppleSony.cs b/DiscImageChef.Decoders/Floppy/AppleSony.cs index 90d12c1b3..c7b8899da 100644 --- a/DiscImageChef.Decoders/Floppy/AppleSony.cs +++ b/DiscImageChef.Decoders/Floppy/AppleSony.cs @@ -228,10 +228,7 @@ namespace DiscImageChef.Decoders.Floppy // Not Apple Sony GCR? } - public static RawSector MarshalSector(byte[] data, int offset = 0) - { - return MarshalSector(data, out _, offset); - } + public static RawSector MarshalSector(byte[] data, int offset = 0) => MarshalSector(data, out _, offset); public static RawSector MarshalSector(byte[] data, out int endOffset, int offset = 0) { @@ -384,10 +381,7 @@ namespace DiscImageChef.Decoders.Floppy return raw.ToArray(); } - public static RawTrack MarshalTrack(byte[] data, int offset = 0) - { - return MarshalTrack(data, out _, offset); - } + public static RawTrack MarshalTrack(byte[] data, int offset = 0) => MarshalTrack(data, out _, offset); public static RawTrack MarshalTrack(byte[] data, out int endOffset, int offset = 0) { @@ -453,10 +447,7 @@ namespace DiscImageChef.Decoders.Floppy return raw.ToArray(); } - public static List MarshalDisk(byte[] data, int offset = 0) - { - return MarshalDisk(data, out _, offset); - } + public static List MarshalDisk(byte[] data, int offset = 0) => MarshalDisk(data, out _, offset); public static List MarshalDisk(byte[] data, out int endOffset, int offset = 0) { @@ -477,10 +468,7 @@ namespace DiscImageChef.Decoders.Floppy return tracks; } - public static byte[] MarshalDisk(List disk) - { - return MarshalDisk(disk.ToArray()); - } + public static byte[] MarshalDisk(List disk) => MarshalDisk(disk.ToArray()); public static byte[] MarshalDisk(RawTrack[] disk) { diff --git a/DiscImageChef.Decoders/LisaTag.cs b/DiscImageChef.Decoders/LisaTag.cs index 140924a6e..16c3b2710 100644 --- a/DiscImageChef.Decoders/LisaTag.cs +++ b/DiscImageChef.Decoders/LisaTag.cs @@ -92,9 +92,8 @@ namespace DiscImageChef.Decoders /// /// Converts this tag to Priam DataTower format /// - public PriamTag ToPriam() - { - return new PriamTag + public PriamTag ToPriam() => + new PriamTag { AbsPage = AbsPage, Checksum = Checksum, @@ -110,14 +109,12 @@ namespace DiscImageChef.Decoders Version = Version, Volume = Volume }; - } /// /// Converts this tag to Sony format /// - public SonyTag ToSony() - { - return new SonyTag + public SonyTag ToSony() => + new SonyTag { FileId = FileId, IsFirst = IsFirst, @@ -129,7 +126,6 @@ namespace DiscImageChef.Decoders Version = Version, Volume = Volume }; - } /// /// Gets a byte array representation of this tag @@ -219,9 +215,8 @@ namespace DiscImageChef.Decoders /// /// Converts this tag to Apple Profile format /// - public ProfileTag ToProfile() - { - return new ProfileTag + public ProfileTag ToProfile() => + new ProfileTag { AbsPage = AbsPage, Checksum = Checksum, @@ -237,14 +232,12 @@ namespace DiscImageChef.Decoders Version = Version, Volume = Volume }; - } /// /// Converts this tag to Sony format /// - public SonyTag ToSony() - { - return new SonyTag + public SonyTag ToSony() => + new SonyTag { FileId = FileId, IsFirst = IsFirst, @@ -256,7 +249,6 @@ namespace DiscImageChef.Decoders Version = Version, Volume = Volume }; - } /// /// Gets a byte array representation of this tag @@ -328,9 +320,8 @@ namespace DiscImageChef.Decoders /// /// Converts this tag to Apple Profile format /// - public ProfileTag ToProfile() - { - return new ProfileTag + public ProfileTag ToProfile() => + new ProfileTag { FileId = FileId, IsFirst = IsFirst, @@ -342,14 +333,12 @@ namespace DiscImageChef.Decoders Version = Version, Volume = Volume }; - } /// /// Converts this tag to Priam DataTower format /// - public PriamTag ToPriam() - { - return new PriamTag + public PriamTag ToPriam() => + new PriamTag { FileId = FileId, IsFirst = IsFirst, @@ -361,7 +350,6 @@ namespace DiscImageChef.Decoders Version = Version, Volume = Volume }; - } /// /// Gets a byte array representation of this tag diff --git a/DiscImageChef.Decoders/MMC/CID.cs b/DiscImageChef.Decoders/MMC/CID.cs index dd64d664b..6bea671a0 100644 --- a/DiscImageChef.Decoders/MMC/CID.cs +++ b/DiscImageChef.Decoders/MMC/CID.cs @@ -181,14 +181,8 @@ namespace DiscImageChef.Decoders.MMC return sb.ToString(); } - public static string PrettifyCID(uint[] response) - { - return PrettifyCID(DecodeCID(response)); - } + public static string PrettifyCID(uint[] response) => PrettifyCID(DecodeCID(response)); - public static string PrettifyCID(byte[] response) - { - return PrettifyCID(DecodeCID(response)); - } + public static string PrettifyCID(byte[] response) => PrettifyCID(DecodeCID(response)); } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/MMC/CSD.cs b/DiscImageChef.Decoders/MMC/CSD.cs index cf82be92e..24699026c 100644 --- a/DiscImageChef.Decoders/MMC/CSD.cs +++ b/DiscImageChef.Decoders/MMC/CSD.cs @@ -561,14 +561,8 @@ namespace DiscImageChef.Decoders.MMC return sb.ToString(); } - public static string PrettifyCSD(uint[] response) - { - return PrettifyCSD(DecodeCSD(response)); - } + public static string PrettifyCSD(uint[] response) => PrettifyCSD(DecodeCSD(response)); - public static string PrettifyCSD(byte[] response) - { - return PrettifyCSD(DecodeCSD(response)); - } + public static string PrettifyCSD(byte[] response) => PrettifyCSD(DecodeCSD(response)); } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/MMC/ExtendedCSD.cs b/DiscImageChef.Decoders/MMC/ExtendedCSD.cs index eed1a0403..574181dd4 100644 --- a/DiscImageChef.Decoders/MMC/ExtendedCSD.cs +++ b/DiscImageChef.Decoders/MMC/ExtendedCSD.cs @@ -707,9 +707,6 @@ namespace DiscImageChef.Decoders.MMC return sb.ToString(); } - public static string PrettifyExtendedCSD(byte[] response) - { - return PrettifyExtendedCSD(DecodeExtendedCSD(response)); - } + public static string PrettifyExtendedCSD(byte[] response) => PrettifyExtendedCSD(DecodeExtendedCSD(response)); } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/MMC/OCR.cs b/DiscImageChef.Decoders/MMC/OCR.cs index 2d23a2dbc..5a4dcc13d 100644 --- a/DiscImageChef.Decoders/MMC/OCR.cs +++ b/DiscImageChef.Decoders/MMC/OCR.cs @@ -68,9 +68,8 @@ namespace DiscImageChef.Decoders.MMC [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] public static partial class Decoders { - public static OCR DecodeOCR(uint response) - { - return new OCR + public static OCR DecodeOCR(uint response) => + new OCR { PowerUp = (response & 0x80000000) == 0x80000000, AccessMode = (byte)((response & 0x60000000) >> 29), @@ -92,12 +91,9 @@ namespace DiscImageChef.Decoders.MMC TwoZero = (response & 0x00000100) == 0x00000100, OneSix = (response & 0x00000080) == 0x00000080 }; - } - public static OCR DecodeOCR(byte[] response) - { - return response?.Length != 4 ? null : DecodeOCR(BitConverter.ToUInt32(response, 0)); - } + public static OCR DecodeOCR(byte[] response) => + response?.Length != 4 ? null : DecodeOCR(BitConverter.ToUInt32(response, 0)); public static string PrettifyOCR(OCR ocr) { @@ -139,14 +135,8 @@ namespace DiscImageChef.Decoders.MMC return sb.ToString(); } - public static string PrettifyOCR(byte[] response) - { - return PrettifyOCR(DecodeOCR(response)); - } + public static string PrettifyOCR(byte[] response) => PrettifyOCR(DecodeOCR(response)); - public static string PrettifyOCR(uint response) - { - return PrettifyOCR(DecodeOCR(response)); - } + public static string PrettifyOCR(uint response) => PrettifyOCR(DecodeOCR(response)); } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/PCMCIA/CIS.cs b/DiscImageChef.Decoders/PCMCIA/CIS.cs index 1055a94d8..21112ca33 100644 --- a/DiscImageChef.Decoders/PCMCIA/CIS.cs +++ b/DiscImageChef.Decoders/PCMCIA/CIS.cs @@ -134,15 +134,11 @@ namespace DiscImageChef.Decoders.PCMCIA return sb.ToString(); } - public static string PrettifyDeviceGeometryTuple(Tuple tuple) - { - return PrettifyDeviceGeometryTuple(DecodeDeviceGeometryTuple(tuple)); - } + public static string PrettifyDeviceGeometryTuple(Tuple tuple) => + PrettifyDeviceGeometryTuple(DecodeDeviceGeometryTuple(tuple)); - public static string PrettifyDeviceGeometryTuple(byte[] data) - { - return PrettifyDeviceGeometryTuple(DecodeDeviceGeometryTuple(data)); - } + public static string PrettifyDeviceGeometryTuple(byte[] data) => + PrettifyDeviceGeometryTuple(DecodeDeviceGeometryTuple(data)); public static ManufacturerIdentificationTuple DecodeManufacturerIdentificationTuple(Tuple tuple) { @@ -178,15 +174,11 @@ namespace DiscImageChef.Decoders.PCMCIA return sb.ToString(); } - public static string PrettifyManufacturerIdentificationTuple(Tuple tuple) - { - return PrettifyManufacturerIdentificationTuple(DecodeManufacturerIdentificationTuple(tuple)); - } + public static string PrettifyManufacturerIdentificationTuple(Tuple tuple) => + PrettifyManufacturerIdentificationTuple(DecodeManufacturerIdentificationTuple(tuple)); - public static string PrettifyManufacturerIdentificationTuple(byte[] data) - { - return PrettifyManufacturerIdentificationTuple(DecodeManufacturerIdentificationTuple(data)); - } + public static string PrettifyManufacturerIdentificationTuple(byte[] data) => + PrettifyManufacturerIdentificationTuple(DecodeManufacturerIdentificationTuple(data)); public static Level1VersionTuple DecodeLevel1VersionTuple(Tuple tuple) { @@ -208,10 +200,7 @@ namespace DiscImageChef.Decoders.PCMCIA Level1VersionTuple tuple = new Level1VersionTuple { - Code = (TupleCodes)data[0], - Link = data[1], - MajorVersion = data[2], - MinorVersion = data[3] + Code = (TupleCodes)data[0], Link = data[1], MajorVersion = data[2], MinorVersion = data[3] }; for(int position = 4; position < data.Length; position++) @@ -278,14 +267,10 @@ namespace DiscImageChef.Decoders.PCMCIA return sb.ToString(); } - public static string PrettifyLevel1VersionTuple(Tuple tuple) - { - return PrettifyLevel1VersionTuple(DecodeLevel1VersionTuple(tuple)); - } + public static string PrettifyLevel1VersionTuple(Tuple tuple) => + PrettifyLevel1VersionTuple(DecodeLevel1VersionTuple(tuple)); - public static string PrettifyLevel1VersionTuple(byte[] data) - { - return PrettifyLevel1VersionTuple(DecodeLevel1VersionTuple(data)); - } + public static string PrettifyLevel1VersionTuple(byte[] data) => + PrettifyLevel1VersionTuple(DecodeLevel1VersionTuple(data)); } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/SCSI/EVPD.cs b/DiscImageChef.Decoders/SCSI/EVPD.cs index 535c2c49f..a147ec9a7 100644 --- a/DiscImageChef.Decoders/SCSI/EVPD.cs +++ b/DiscImageChef.Decoders/SCSI/EVPD.cs @@ -172,10 +172,7 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyPage_81(byte[] pageResponse) - { - return PrettifyPage_81(DecodePage_81(pageResponse)); - } + public static string PrettifyPage_81(byte[] pageResponse) => PrettifyPage_81(DecodePage_81(pageResponse)); public static string DefinitionToString(ScsiDefinitions definition) { @@ -430,10 +427,7 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyPage_83(byte[] pageResponse) - { - return PrettifyPage_83(DecodePage_83(pageResponse)); - } + public static string PrettifyPage_83(byte[] pageResponse) => PrettifyPage_83(DecodePage_83(pageResponse)); public static string PrettifyPage_83(Page_83? modePage) { @@ -823,10 +817,7 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyPage_84(byte[] pageResponse) - { - return PrettifyPage_84(DecodePage_84(pageResponse)); - } + public static string PrettifyPage_84(byte[] pageResponse) => PrettifyPage_84(DecodePage_84(pageResponse)); public static string PrettifyPage_84(Page_84? modePage) { @@ -955,10 +946,7 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyPage_85(byte[] pageResponse) - { - return PrettifyPage_85(DecodePage_85(pageResponse)); - } + public static string PrettifyPage_85(byte[] pageResponse) => PrettifyPage_85(DecodePage_85(pageResponse)); public static string PrettifyPage_85(Page_85? modePage) { @@ -1216,10 +1204,7 @@ namespace DiscImageChef.Decoders.SCSI }; } - public static string PrettifyPage_86(byte[] pageResponse) - { - return PrettifyPage_86(DecodePage_86(pageResponse)); - } + public static string PrettifyPage_86(byte[] pageResponse) => PrettifyPage_86(DecodePage_86(pageResponse)); public static string PrettifyPage_86(Page_86? modePage) { @@ -1384,10 +1369,7 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyPage_89(byte[] pageResponse) - { - return PrettifyPage_89(DecodePage_89(pageResponse)); - } + public static string PrettifyPage_89(byte[] pageResponse) => PrettifyPage_89(DecodePage_89(pageResponse)); // TODO: Decode ATA signature? public static string PrettifyPage_89(Page_89? modePage) @@ -1511,10 +1493,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyPage_C0_Quantum(byte[] pageResponse) - { - return PrettifyPage_C0_Quantum(DecodePage_C0_Quantum(pageResponse)); - } + public static string PrettifyPage_C0_Quantum(byte[] pageResponse) => + PrettifyPage_C0_Quantum(DecodePage_C0_Quantum(pageResponse)); public static string PrettifyPage_C0_Quantum(Page_C0_Quantum? modePage) { @@ -1593,10 +1573,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyPage_C0_C1_Certance(byte[] pageResponse) - { - return PrettifyPage_C0_C1_Certance(DecodePage_C0_C1_Certance(pageResponse)); - } + public static string PrettifyPage_C0_C1_Certance(byte[] pageResponse) => + PrettifyPage_C0_C1_Certance(DecodePage_C0_C1_Certance(pageResponse)); public static string PrettifyPage_C0_C1_Certance(Page_C0_C1_Certance? modePage) { @@ -1666,10 +1644,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyPage_C2_C3_C4_C5_C6_Certance(byte[] pageResponse) - { - return PrettifyPage_C2_C3_C4_C5_C6_Certance(DecodePage_C2_C3_C4_C5_C6_Certance(pageResponse)); - } + public static string PrettifyPage_C2_C3_C4_C5_C6_Certance(byte[] pageResponse) => + PrettifyPage_C2_C3_C4_C5_C6_Certance(DecodePage_C2_C3_C4_C5_C6_Certance(pageResponse)); public static string PrettifyPage_C2_C3_C4_C5_C6_Certance(Page_C2_C3_C4_C5_C6_Certance? modePage) { @@ -1837,10 +1813,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyPage_DF_Certance(byte[] pageResponse) - { - return PrettifyPage_DF_Certance(DecodePage_DF_Certance(pageResponse)); - } + public static string PrettifyPage_DF_Certance(byte[] pageResponse) => + PrettifyPage_DF_Certance(DecodePage_DF_Certance(pageResponse)); public static string PrettifyPage_DF_Certance(Page_DF_Certance? modePage) { @@ -2013,10 +1987,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyPage_C0_IBM(byte[] pageResponse) - { - return PrettifyPage_C0_IBM(DecodePage_C0_IBM(pageResponse)); - } + public static string PrettifyPage_C0_IBM(byte[] pageResponse) => + PrettifyPage_C0_IBM(DecodePage_C0_IBM(pageResponse)); public static string PrettifyPage_C0_IBM(Page_C0_IBM? modePage) { @@ -2084,10 +2056,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyPage_C1_IBM(byte[] pageResponse) - { - return PrettifyPage_C1_IBM(DecodePage_C1_IBM(pageResponse)); - } + public static string PrettifyPage_C1_IBM(byte[] pageResponse) => + PrettifyPage_C1_IBM(DecodePage_C1_IBM(pageResponse)); public static string PrettifyPage_C1_IBM(Page_C1_IBM? modePage) { @@ -2154,10 +2124,7 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyPage_B0(byte[] pageResponse) - { - return PrettifyPage_B0(DecodePage_B0(pageResponse)); - } + public static string PrettifyPage_B0(byte[] pageResponse) => PrettifyPage_B0(DecodePage_B0(pageResponse)); public static string PrettifyPage_B0(Page_B0? modePage) { @@ -2339,10 +2306,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyPage_C0_to_C5_HP(byte[] pageResponse) - { - return PrettifyPage_C0_to_C5_HP(DecodePage_C0_to_C5_HP(pageResponse)); - } + public static string PrettifyPage_C0_to_C5_HP(byte[] pageResponse) => + PrettifyPage_C0_to_C5_HP(DecodePage_C0_to_C5_HP(pageResponse)); public static string PrettifyPage_C0_to_C5_HP(Page_C0_to_C5_HP? modePage) { @@ -2442,10 +2407,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyPage_C0_Seagate(byte[] pageResponse) - { - return PrettifyPage_C0_Seagate(DecodePage_C0_Seagate(pageResponse)); - } + public static string PrettifyPage_C0_Seagate(byte[] pageResponse) => + PrettifyPage_C0_Seagate(DecodePage_C0_Seagate(pageResponse)); public static string PrettifyPage_C0_Seagate(Page_C0_Seagate? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Enums.cs b/DiscImageChef.Decoders/SCSI/Enums.cs index 055975389..160e4e0e9 100644 --- a/DiscImageChef.Decoders/SCSI/Enums.cs +++ b/DiscImageChef.Decoders/SCSI/Enums.cs @@ -317,9 +317,9 @@ namespace DiscImageChef.Decoders.SCSI public enum ScsiDefinitions : byte { Current = 0, - SCSI1 = 1, - CCS = 2, - SCSI2 = 3, - SCSI3 = 4 + SCSI1 = 1, + CCS = 2, + SCSI2 = 3, + SCSI3 = 4 } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/SCSI/Inquiry.cs b/DiscImageChef.Decoders/SCSI/Inquiry.cs index 364a1f5a6..7b1d3950a 100644 --- a/DiscImageChef.Decoders/SCSI/Inquiry.cs +++ b/DiscImageChef.Decoders/SCSI/Inquiry.cs @@ -67,7 +67,8 @@ namespace DiscImageChef.Decoders.SCSI return null; } - if(SCSIInquiryResponse.Length < SCSIInquiryResponse[4] + 5 && SCSIInquiryResponse.Length != SCSIInquiryResponse[4]) + if(SCSIInquiryResponse.Length < SCSIInquiryResponse[4] + 5 && + SCSIInquiryResponse.Length != SCSIInquiryResponse[4]) { DicConsole.DebugWriteLine("SCSI INQUIRY decoder", "INQUIRY response length ({0} bytes) is different than specified in length field ({1} bytes), decoded data can be incorrect, not decoding.", @@ -357,19 +358,22 @@ namespace DiscImageChef.Decoders.SCSI if(decoded.VendorIdentification != null) { length = 16; - Array.Copy(decoded.VendorIdentification, 0, buffer, 8, decoded.VendorIdentification.Length >= 8 ? 8 : decoded.VendorIdentification.Length); + Array.Copy(decoded.VendorIdentification, 0, buffer, 8, + decoded.VendorIdentification.Length >= 8 ? 8 : decoded.VendorIdentification.Length); } if(decoded.ProductIdentification != null) { length = 32; - Array.Copy(decoded.ProductIdentification, 0, buffer, 16, decoded.ProductIdentification.Length >= 16 ? 16 : decoded.ProductIdentification.Length); + Array.Copy(decoded.ProductIdentification, 0, buffer, 16, + decoded.ProductIdentification.Length >= 16 ? 16 : decoded.ProductIdentification.Length); } if(decoded.ProductRevisionLevel != null) { length = 36; - Array.Copy(decoded.ProductRevisionLevel, 0, buffer, 32, decoded.ProductRevisionLevel.Length >= 4 ? 4 : decoded.ProductRevisionLevel.Length); + Array.Copy(decoded.ProductRevisionLevel, 0, buffer, 32, + decoded.ProductRevisionLevel.Length >= 4 ? 4 : decoded.ProductRevisionLevel.Length); } if(decoded.Seagate_DriveSerialNumber != null) diff --git a/DiscImageChef.Decoders/SCSI/MMC/Features.cs b/DiscImageChef.Decoders/SCSI/MMC/Features.cs index a7d5f2d3c..55e65a9c1 100644 --- a/DiscImageChef.Decoders/SCSI/MMC/Features.cs +++ b/DiscImageChef.Decoders/SCSI/MMC/Features.cs @@ -4132,12 +4132,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC return sb.ToString(); } - public static string Prettify_001D(Feature_001D? feature) - { - return !feature.HasValue - ? null - : "Drive claims capability to read all CD formats according to OSTA Multi-Read Specification\n"; - } + public static string Prettify_001D(Feature_001D? feature) => + !feature.HasValue + ? null + : "Drive claims capability to read all CD formats according to OSTA Multi-Read Specification\n"; public static string Prettify_001E(Feature_001E? feature) { @@ -4235,10 +4233,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC return sb.ToString(); } - public static string Prettify_0022(Feature_0022? feature) - { - return !feature.HasValue ? null : "Drive supports media that require erasing before writing\n"; - } + public static string Prettify_0022(Feature_0022? feature) => + !feature.HasValue ? null : "Drive supports media that require erasing before writing\n"; public static string Prettify_0023(Feature_0023? feature) { @@ -4294,12 +4290,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC return sb.ToString(); } - public static string Prettify_0026(Feature_0026? feature) - { - return !feature.HasValue - ? null - : "Drive shall have the ability to overwrite logical blocks only in fixed sets at a time\n"; - } + public static string Prettify_0026(Feature_0026? feature) => + !feature.HasValue + ? null + : "Drive shall have the ability to overwrite logical blocks only in fixed sets at a time\n"; public static string Prettify_0027(Feature_0027? feature) { @@ -4510,10 +4504,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC return sb.ToString(); } - public static string Prettify_0030(Feature_0030? feature) - { - return !feature.HasValue ? null : "Drive can read DDCDs\n"; - } + public static string Prettify_0030(Feature_0030? feature) => + !feature.HasValue ? null : "Drive can read DDCDs\n"; public static string Prettify_0031(Feature_0031? feature) { @@ -4561,10 +4553,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC return sb.ToString(); } - public static string Prettify_0035(Feature_0035? feature) - { - return !feature.HasValue ? null : "Drive can stop a long immediate operation\n"; - } + public static string Prettify_0035(Feature_0035? feature) => + !feature.HasValue ? null : "Drive can stop a long immediate operation\n"; public static string Prettify_0037(Feature_0037? feature) { @@ -4590,10 +4580,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC return sb.ToString(); } - public static string Prettify_0038(Feature_0038? feature) - { - return !feature.HasValue ? null : "Drive can write BD-R on Pseudo-OVerwrite SRM mode\n"; - } + public static string Prettify_0038(Feature_0038? feature) => + !feature.HasValue ? null : "Drive can write BD-R on Pseudo-OVerwrite SRM mode\n"; public static string Prettify_003A(Feature_003A? feature) { @@ -4689,12 +4677,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC return sb.ToString(); } - public static string Prettify_0042(Feature_0042? feature) - { - return !feature.HasValue - ? null - : "Drive is able to detect and report defective writable unit and behave accordinly\n"; - } + public static string Prettify_0042(Feature_0042? feature) => + !feature.HasValue + ? null + : "Drive is able to detect and report defective writable unit and behave accordinly\n"; public static string Prettify_0050(Feature_0050? feature) { @@ -4749,10 +4735,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC return sb.ToString(); } - public static string Prettify_0100(Feature_0100? feature) - { - return !feature.HasValue ? null : "Drive is able to perform host and drive directed power management\n"; - } + public static string Prettify_0100(Feature_0100? feature) => + !feature.HasValue ? null : "Drive is able to perform host and drive directed power management\n"; public static string Prettify_0101(Feature_0101? feature) { @@ -4881,10 +4865,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC return sb.ToString(); } - public static string Prettify_0109(Feature_0109? feature) - { - return !feature.HasValue ? null : "Drive is able to read media serial number\n"; - } + public static string Prettify_0109(Feature_0109? feature) => + !feature.HasValue ? null : "Drive is able to read media serial number\n"; public static string Prettify_010A(Feature_010A? feature) { @@ -5059,295 +5041,121 @@ namespace DiscImageChef.Decoders.SCSI.MMC return sb.ToString(); } - public static string Prettify_0000(byte[] feature) - { - return Prettify_0000(Decode_0000(feature)); - } + public static string Prettify_0000(byte[] feature) => Prettify_0000(Decode_0000(feature)); - public static string Prettify_0001(byte[] feature) - { - return Prettify_0001(Decode_0001(feature)); - } + public static string Prettify_0001(byte[] feature) => Prettify_0001(Decode_0001(feature)); - public static string Prettify_0002(byte[] feature) - { - return Prettify_0002(Decode_0002(feature)); - } + public static string Prettify_0002(byte[] feature) => Prettify_0002(Decode_0002(feature)); - public static string Prettify_0003(byte[] feature) - { - return Prettify_0003(Decode_0003(feature)); - } + public static string Prettify_0003(byte[] feature) => Prettify_0003(Decode_0003(feature)); - public static string Prettify_0004(byte[] feature) - { - return Prettify_0004(Decode_0004(feature)); - } + public static string Prettify_0004(byte[] feature) => Prettify_0004(Decode_0004(feature)); - public static string Prettify_0010(byte[] feature) - { - return Prettify_0010(Decode_0010(feature)); - } + public static string Prettify_0010(byte[] feature) => Prettify_0010(Decode_0010(feature)); - public static string Prettify_001D(byte[] feature) - { - return Prettify_001D(Decode_001D(feature)); - } + public static string Prettify_001D(byte[] feature) => Prettify_001D(Decode_001D(feature)); - public static string Prettify_001E(byte[] feature) - { - return Prettify_001E(Decode_001E(feature)); - } + public static string Prettify_001E(byte[] feature) => Prettify_001E(Decode_001E(feature)); - public static string Prettify_001F(byte[] feature) - { - return Prettify_001F(Decode_001F(feature)); - } + public static string Prettify_001F(byte[] feature) => Prettify_001F(Decode_001F(feature)); - public static string Prettify_0020(byte[] feature) - { - return Prettify_0020(Decode_0020(feature)); - } + public static string Prettify_0020(byte[] feature) => Prettify_0020(Decode_0020(feature)); - public static string Prettify_0021(byte[] feature) - { - return Prettify_0021(Decode_0021(feature)); - } + public static string Prettify_0021(byte[] feature) => Prettify_0021(Decode_0021(feature)); - public static string Prettify_0022(byte[] feature) - { - return Prettify_0022(Decode_0022(feature)); - } + public static string Prettify_0022(byte[] feature) => Prettify_0022(Decode_0022(feature)); - public static string Prettify_0023(byte[] feature) - { - return Prettify_0023(Decode_0023(feature)); - } + public static string Prettify_0023(byte[] feature) => Prettify_0023(Decode_0023(feature)); - public static string Prettify_0024(byte[] feature) - { - return Prettify_0024(Decode_0024(feature)); - } + public static string Prettify_0024(byte[] feature) => Prettify_0024(Decode_0024(feature)); - public static string Prettify_0025(byte[] feature) - { - return Prettify_0025(Decode_0025(feature)); - } + public static string Prettify_0025(byte[] feature) => Prettify_0025(Decode_0025(feature)); - public static string Prettify_0026(byte[] feature) - { - return Prettify_0026(Decode_0026(feature)); - } + public static string Prettify_0026(byte[] feature) => Prettify_0026(Decode_0026(feature)); - public static string Prettify_0027(byte[] feature) - { - return Prettify_0027(Decode_0027(feature)); - } + public static string Prettify_0027(byte[] feature) => Prettify_0027(Decode_0027(feature)); - public static string Prettify_0028(byte[] feature) - { - return Prettify_0028(Decode_0028(feature)); - } + public static string Prettify_0028(byte[] feature) => Prettify_0028(Decode_0028(feature)); - public static string Prettify_0029(byte[] feature) - { - return Prettify_0029(Decode_0029(feature)); - } + public static string Prettify_0029(byte[] feature) => Prettify_0029(Decode_0029(feature)); - public static string Prettify_002A(byte[] feature) - { - return Prettify_002A(Decode_002A(feature)); - } + public static string Prettify_002A(byte[] feature) => Prettify_002A(Decode_002A(feature)); - public static string Prettify_002B(byte[] feature) - { - return Prettify_002B(Decode_002B(feature)); - } + public static string Prettify_002B(byte[] feature) => Prettify_002B(Decode_002B(feature)); - public static string Prettify_002C(byte[] feature) - { - return Prettify_002C(Decode_002C(feature)); - } + public static string Prettify_002C(byte[] feature) => Prettify_002C(Decode_002C(feature)); - public static string Prettify_002D(byte[] feature) - { - return Prettify_002D(Decode_002D(feature)); - } + public static string Prettify_002D(byte[] feature) => Prettify_002D(Decode_002D(feature)); - public static string Prettify_002E(byte[] feature) - { - return Prettify_002E(Decode_002E(feature)); - } + public static string Prettify_002E(byte[] feature) => Prettify_002E(Decode_002E(feature)); - public static string Prettify_002F(byte[] feature) - { - return Prettify_002F(Decode_002F(feature)); - } + public static string Prettify_002F(byte[] feature) => Prettify_002F(Decode_002F(feature)); - public static string Prettify_0030(byte[] feature) - { - return Prettify_0030(Decode_0030(feature)); - } + public static string Prettify_0030(byte[] feature) => Prettify_0030(Decode_0030(feature)); - public static string Prettify_0031(byte[] feature) - { - return Prettify_0031(Decode_0031(feature)); - } + public static string Prettify_0031(byte[] feature) => Prettify_0031(Decode_0031(feature)); - public static string Prettify_0032(byte[] feature) - { - return Prettify_0032(Decode_0032(feature)); - } + public static string Prettify_0032(byte[] feature) => Prettify_0032(Decode_0032(feature)); - public static string Prettify_0033(byte[] feature) - { - return Prettify_0033(Decode_0033(feature)); - } + public static string Prettify_0033(byte[] feature) => Prettify_0033(Decode_0033(feature)); - public static string Prettify_0035(byte[] feature) - { - return Prettify_0035(Decode_0035(feature)); - } + public static string Prettify_0035(byte[] feature) => Prettify_0035(Decode_0035(feature)); - public static string Prettify_0037(byte[] feature) - { - return Prettify_0037(Decode_0037(feature)); - } + public static string Prettify_0037(byte[] feature) => Prettify_0037(Decode_0037(feature)); - public static string Prettify_0038(byte[] feature) - { - return Prettify_0038(Decode_0038(feature)); - } + public static string Prettify_0038(byte[] feature) => Prettify_0038(Decode_0038(feature)); - public static string Prettify_003A(byte[] feature) - { - return Prettify_003A(Decode_003A(feature)); - } + public static string Prettify_003A(byte[] feature) => Prettify_003A(Decode_003A(feature)); - public static string Prettify_003B(byte[] feature) - { - return Prettify_003B(Decode_003B(feature)); - } + public static string Prettify_003B(byte[] feature) => Prettify_003B(Decode_003B(feature)); - public static string Prettify_0040(byte[] feature) - { - return Prettify_0040(Decode_0040(feature)); - } + public static string Prettify_0040(byte[] feature) => Prettify_0040(Decode_0040(feature)); - public static string Prettify_0041(byte[] feature) - { - return Prettify_0041(Decode_0041(feature)); - } + public static string Prettify_0041(byte[] feature) => Prettify_0041(Decode_0041(feature)); - public static string Prettify_0042(byte[] feature) - { - return Prettify_0042(Decode_0042(feature)); - } + public static string Prettify_0042(byte[] feature) => Prettify_0042(Decode_0042(feature)); - public static string Prettify_0050(byte[] feature) - { - return Prettify_0050(Decode_0050(feature)); - } + public static string Prettify_0050(byte[] feature) => Prettify_0050(Decode_0050(feature)); - public static string Prettify_0051(byte[] feature) - { - return Prettify_0051(Decode_0051(feature)); - } + public static string Prettify_0051(byte[] feature) => Prettify_0051(Decode_0051(feature)); - public static string Prettify_0080(byte[] feature) - { - return Prettify_0080(Decode_0080(feature)); - } + public static string Prettify_0080(byte[] feature) => Prettify_0080(Decode_0080(feature)); - public static string Prettify_0100(byte[] feature) - { - return Prettify_0100(Decode_0100(feature)); - } + public static string Prettify_0100(byte[] feature) => Prettify_0100(Decode_0100(feature)); - public static string Prettify_0101(byte[] feature) - { - return Prettify_0101(Decode_0101(feature)); - } + public static string Prettify_0101(byte[] feature) => Prettify_0101(Decode_0101(feature)); - public static string Prettify_0102(byte[] feature) - { - return Prettify_0102(Decode_0102(feature)); - } + public static string Prettify_0102(byte[] feature) => Prettify_0102(Decode_0102(feature)); - public static string Prettify_0103(byte[] feature) - { - return Prettify_0103(Decode_0103(feature)); - } + public static string Prettify_0103(byte[] feature) => Prettify_0103(Decode_0103(feature)); - public static string Prettify_0104(byte[] feature) - { - return Prettify_0104(Decode_0104(feature)); - } + public static string Prettify_0104(byte[] feature) => Prettify_0104(Decode_0104(feature)); - public static string Prettify_0105(byte[] feature) - { - return Prettify_0105(Decode_0105(feature)); - } + public static string Prettify_0105(byte[] feature) => Prettify_0105(Decode_0105(feature)); - public static string Prettify_0106(byte[] feature) - { - return Prettify_0106(Decode_0106(feature)); - } + public static string Prettify_0106(byte[] feature) => Prettify_0106(Decode_0106(feature)); - public static string Prettify_0107(byte[] feature) - { - return Prettify_0107(Decode_0107(feature)); - } + public static string Prettify_0107(byte[] feature) => Prettify_0107(Decode_0107(feature)); - public static string Prettify_0108(byte[] feature) - { - return Prettify_0108(Decode_0108(feature)); - } + public static string Prettify_0108(byte[] feature) => Prettify_0108(Decode_0108(feature)); - public static string Prettify_0109(byte[] feature) - { - return Prettify_0109(Decode_0109(feature)); - } + public static string Prettify_0109(byte[] feature) => Prettify_0109(Decode_0109(feature)); - public static string Prettify_010A(byte[] feature) - { - return Prettify_010A(Decode_010A(feature)); - } + public static string Prettify_010A(byte[] feature) => Prettify_010A(Decode_010A(feature)); - public static string Prettify_010B(byte[] feature) - { - return Prettify_010B(Decode_010B(feature)); - } + public static string Prettify_010B(byte[] feature) => Prettify_010B(Decode_010B(feature)); - public static string Prettify_010C(byte[] feature) - { - return Prettify_010C(Decode_010C(feature)); - } + public static string Prettify_010C(byte[] feature) => Prettify_010C(Decode_010C(feature)); - public static string Prettify_010D(byte[] feature) - { - return Prettify_010D(Decode_010D(feature)); - } + public static string Prettify_010D(byte[] feature) => Prettify_010D(Decode_010D(feature)); - public static string Prettify_010E(byte[] feature) - { - return Prettify_010E(Decode_010E(feature)); - } + public static string Prettify_010E(byte[] feature) => Prettify_010E(Decode_010E(feature)); - public static string Prettify_0110(byte[] feature) - { - return Prettify_0110(Decode_0110(feature)); - } + public static string Prettify_0110(byte[] feature) => Prettify_0110(Decode_0110(feature)); - public static string Prettify_0113(byte[] feature) - { - return Prettify_0113(Decode_0113(feature)); - } + public static string Prettify_0113(byte[] feature) => Prettify_0113(Decode_0113(feature)); - public static string Prettify_0142(byte[] feature) - { - return Prettify_0142(Decode_0142(feature)); - } + public static string Prettify_0142(byte[] feature) => Prettify_0142(Decode_0142(feature)); public static SeparatedFeatures Separate(byte[] response) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/00_SFF.cs b/DiscImageChef.Decoders/SCSI/Modes/00_SFF.cs index 36f7dad20..267badb1d 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/00_SFF.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/00_SFF.cs @@ -93,10 +93,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_00_SFF(byte[] pageResponse) - { - return PrettifyModePage_00_SFF(DecodeModePage_00_SFF(pageResponse)); - } + public static string PrettifyModePage_00_SFF(byte[] pageResponse) => + PrettifyModePage_00_SFF(DecodeModePage_00_SFF(pageResponse)); public static string PrettifyModePage_00_SFF(ModePage_00_SFF? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/01.cs b/DiscImageChef.Decoders/SCSI/Modes/01.cs index 434cadba5..00bc8f8dd 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/01.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/01.cs @@ -151,10 +151,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_01(byte[] pageResponse) - { - return PrettifyModePage_01(DecodeModePage_01(pageResponse)); - } + public static string PrettifyModePage_01(byte[] pageResponse) => + PrettifyModePage_01(DecodeModePage_01(pageResponse)); public static string PrettifyModePage_01(ModePage_01? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/01_MMC.cs b/DiscImageChef.Decoders/SCSI/Modes/01_MMC.cs index 2629ce5c5..c94e6d10c 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/01_MMC.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/01_MMC.cs @@ -95,10 +95,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_01_MMC(byte[] pageResponse) - { - return PrettifyModePage_01_MMC(DecodeModePage_01_MMC(pageResponse)); - } + public static string PrettifyModePage_01_MMC(byte[] pageResponse) => + PrettifyModePage_01_MMC(DecodeModePage_01_MMC(pageResponse)); public static string PrettifyModePage_01_MMC(ModePage_01_MMC? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/02.cs b/DiscImageChef.Decoders/SCSI/Modes/02.cs index d420ef1b9..bd0ce87ad 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/02.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/02.cs @@ -133,10 +133,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_02(byte[] pageResponse) - { - return PrettifyModePage_02(DecodeModePage_02(pageResponse)); - } + public static string PrettifyModePage_02(byte[] pageResponse) => + PrettifyModePage_02(DecodeModePage_02(pageResponse)); public static string PrettifyModePage_02(ModePage_02? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/03.cs b/DiscImageChef.Decoders/SCSI/Modes/03.cs index bfa9edec4..3ff17764b 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/03.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/03.cs @@ -137,10 +137,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_03(byte[] pageResponse) - { - return PrettifyModePage_03(DecodeModePage_03(pageResponse)); - } + public static string PrettifyModePage_03(byte[] pageResponse) => + PrettifyModePage_03(DecodeModePage_03(pageResponse)); public static string PrettifyModePage_03(ModePage_03? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/04.cs b/DiscImageChef.Decoders/SCSI/Modes/04.cs index 4bdc88694..052e7758e 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/04.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/04.cs @@ -120,10 +120,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_04(byte[] pageResponse) - { - return PrettifyModePage_04(DecodeModePage_04(pageResponse)); - } + public static string PrettifyModePage_04(byte[] pageResponse) => + PrettifyModePage_04(DecodeModePage_04(pageResponse)); public static string PrettifyModePage_04(ModePage_04? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/05.cs b/DiscImageChef.Decoders/SCSI/Modes/05.cs index fafb76576..e9a229fa1 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/05.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/05.cs @@ -196,10 +196,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_05(byte[] pageResponse) - { - return PrettifyModePage_05(DecodeModePage_05(pageResponse)); - } + public static string PrettifyModePage_05(byte[] pageResponse) => + PrettifyModePage_05(DecodeModePage_05(pageResponse)); public static string PrettifyModePage_05(ModePage_05? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/06.cs b/DiscImageChef.Decoders/SCSI/Modes/06.cs index 690ff8c9a..1cc4bc071 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/06.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/06.cs @@ -76,10 +76,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_06(byte[] pageResponse) - { - return PrettifyModePage_06(DecodeModePage_06(pageResponse)); - } + public static string PrettifyModePage_06(byte[] pageResponse) => + PrettifyModePage_06(DecodeModePage_06(pageResponse)); public static string PrettifyModePage_06(ModePage_06? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/07.cs b/DiscImageChef.Decoders/SCSI/Modes/07.cs index 5fa677132..6e6e8e229 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/07.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/07.cs @@ -108,10 +108,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_07(byte[] pageResponse) - { - return PrettifyModePage_07(DecodeModePage_07(pageResponse)); - } + public static string PrettifyModePage_07(byte[] pageResponse) => + PrettifyModePage_07(DecodeModePage_07(pageResponse)); public static string PrettifyModePage_07(ModePage_07? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/07_MMC.cs b/DiscImageChef.Decoders/SCSI/Modes/07_MMC.cs index bef397bc9..a74336267 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/07_MMC.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/07_MMC.cs @@ -81,10 +81,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_07_MMC(byte[] pageResponse) - { - return PrettifyModePage_07_MMC(DecodeModePage_07_MMC(pageResponse)); - } + public static string PrettifyModePage_07_MMC(byte[] pageResponse) => + PrettifyModePage_07_MMC(DecodeModePage_07_MMC(pageResponse)); public static string PrettifyModePage_07_MMC(ModePage_07_MMC? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/08.cs b/DiscImageChef.Decoders/SCSI/Modes/08.cs index ab2057d36..70a8a8e20 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/08.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/08.cs @@ -183,10 +183,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_08(byte[] pageResponse) - { - return PrettifyModePage_08(DecodeModePage_08(pageResponse)); - } + public static string PrettifyModePage_08(byte[] pageResponse) => + PrettifyModePage_08(DecodeModePage_08(pageResponse)); public static string PrettifyModePage_08(ModePage_08? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/0A.cs b/DiscImageChef.Decoders/SCSI/Modes/0A.cs index aea339dc2..fb0c1833a 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/0A.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/0A.cs @@ -223,10 +223,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_0A(byte[] pageResponse) - { - return PrettifyModePage_0A(DecodeModePage_0A(pageResponse)); - } + public static string PrettifyModePage_0A(byte[] pageResponse) => + PrettifyModePage_0A(DecodeModePage_0A(pageResponse)); public static string PrettifyModePage_0A(ModePage_0A? modePage) { @@ -420,10 +418,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_0A_S01(byte[] pageResponse) - { - return PrettifyModePage_0A_S01(DecodeModePage_0A_S01(pageResponse)); - } + public static string PrettifyModePage_0A_S01(byte[] pageResponse) => + PrettifyModePage_0A_S01(DecodeModePage_0A_S01(pageResponse)); public static string PrettifyModePage_0A_S01(ModePage_0A_S01? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/0B.cs b/DiscImageChef.Decoders/SCSI/Modes/0B.cs index a9a1d058a..263e78472 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/0B.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/0B.cs @@ -79,10 +79,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_0B(byte[] pageResponse) - { - return PrettifyModePage_0B(DecodeModePage_0B(pageResponse)); - } + public static string PrettifyModePage_0B(byte[] pageResponse) => + PrettifyModePage_0B(DecodeModePage_0B(pageResponse)); public static string PrettifyModePage_0B(ModePage_0B? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/0D.cs b/DiscImageChef.Decoders/SCSI/Modes/0D.cs index b35f09808..7b5dfec3b 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/0D.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/0D.cs @@ -86,10 +86,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_0D(byte[] pageResponse) - { - return PrettifyModePage_0D(DecodeModePage_0D(pageResponse)); - } + public static string PrettifyModePage_0D(byte[] pageResponse) => + PrettifyModePage_0D(DecodeModePage_0D(pageResponse)); public static string PrettifyModePage_0D(ModePage_0D? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/0E.cs b/DiscImageChef.Decoders/SCSI/Modes/0E.cs index f1935740e..ac9aae1f8 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/0E.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/0E.cs @@ -136,10 +136,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_0E(byte[] pageResponse) - { - return PrettifyModePage_0E(DecodeModePage_0E(pageResponse)); - } + public static string PrettifyModePage_0E(byte[] pageResponse) => + PrettifyModePage_0E(DecodeModePage_0E(pageResponse)); public static string PrettifyModePage_0E(ModePage_0E? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/0F.cs b/DiscImageChef.Decoders/SCSI/Modes/0F.cs index e4e25d419..662a9d713 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/0F.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/0F.cs @@ -105,10 +105,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_0F(byte[] pageResponse) - { - return PrettifyModePage_0F(DecodeModePage_0F(pageResponse)); - } + public static string PrettifyModePage_0F(byte[] pageResponse) => + PrettifyModePage_0F(DecodeModePage_0F(pageResponse)); public static string PrettifyModePage_0F(ModePage_0F? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/10.cs b/DiscImageChef.Decoders/SCSI/Modes/10.cs index e354559e4..4bc2f2290 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/10.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/10.cs @@ -100,10 +100,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_10(byte[] pageResponse) - { - return PrettifyModePage_10(DecodeModePage_10(pageResponse)); - } + public static string PrettifyModePage_10(byte[] pageResponse) => + PrettifyModePage_10(DecodeModePage_10(pageResponse)); public static string PrettifyModePage_10(ModePage_10? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/10_SSC.cs b/DiscImageChef.Decoders/SCSI/Modes/10_SSC.cs index e16192ced..71bd2394b 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/10_SSC.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/10_SSC.cs @@ -213,10 +213,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_10_SSC(byte[] pageResponse) - { - return PrettifyModePage_10_SSC(DecodeModePage_10_SSC(pageResponse)); - } + public static string PrettifyModePage_10_SSC(byte[] pageResponse) => + PrettifyModePage_10_SSC(DecodeModePage_10_SSC(pageResponse)); public static string PrettifyModePage_10_SSC(ModePage_10_SSC? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/11.cs b/DiscImageChef.Decoders/SCSI/Modes/11.cs index b3c07bbdd..28b83a760 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/11.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/11.cs @@ -166,10 +166,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_11(byte[] pageResponse) - { - return PrettifyModePage_11(DecodeModePage_11(pageResponse)); - } + public static string PrettifyModePage_11(byte[] pageResponse) => + PrettifyModePage_11(DecodeModePage_11(pageResponse)); public static string PrettifyModePage_11(ModePage_11? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/12_13_14.cs b/DiscImageChef.Decoders/SCSI/Modes/12_13_14.cs index 968f02cb2..abce55427 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/12_13_14.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/12_13_14.cs @@ -85,10 +85,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_12_13_14(byte[] pageResponse) - { - return PrettifyModePage_12_13_14(DecodeModePage_12_13_14(pageResponse)); - } + public static string PrettifyModePage_12_13_14(byte[] pageResponse) => + PrettifyModePage_12_13_14(DecodeModePage_12_13_14(pageResponse)); public static string PrettifyModePage_12_13_14(ModePage_12_13_14? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/1A.cs b/DiscImageChef.Decoders/SCSI/Modes/1A.cs index 17b5aebc9..5c0fa97f3 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/1A.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/1A.cs @@ -146,10 +146,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_1A(byte[] pageResponse) - { - return PrettifyModePage_1A(DecodeModePage_1A(pageResponse)); - } + public static string PrettifyModePage_1A(byte[] pageResponse) => + PrettifyModePage_1A(DecodeModePage_1A(pageResponse)); public static string PrettifyModePage_1A(ModePage_1A? modePage) { @@ -242,10 +240,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_1A_S01(byte[] pageResponse) - { - return PrettifyModePage_1A_S01(DecodeModePage_1A_S01(pageResponse)); - } + public static string PrettifyModePage_1A_S01(byte[] pageResponse) => + PrettifyModePage_1A_S01(DecodeModePage_1A_S01(pageResponse)); public static string PrettifyModePage_1A_S01(ModePage_1A_S01? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/1B.cs b/DiscImageChef.Decoders/SCSI/Modes/1B.cs index ad7d84e70..01ede31b0 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/1B.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/1B.cs @@ -97,10 +97,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_1B(byte[] pageResponse) - { - return PrettifyModePage_1B(DecodeModePage_1B(pageResponse)); - } + public static string PrettifyModePage_1B(byte[] pageResponse) => + PrettifyModePage_1B(DecodeModePage_1B(pageResponse)); public static string PrettifyModePage_1B(ModePage_1B? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/1C.cs b/DiscImageChef.Decoders/SCSI/Modes/1C.cs index 7693a6891..4064fc057 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/1C.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/1C.cs @@ -132,10 +132,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_1C(byte[] pageResponse) - { - return PrettifyModePage_1C(DecodeModePage_1C(pageResponse)); - } + public static string PrettifyModePage_1C(byte[] pageResponse) => + PrettifyModePage_1C(DecodeModePage_1C(pageResponse)); public static string PrettifyModePage_1C(ModePage_1C? modePage) { @@ -280,10 +278,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_1C_S01(byte[] pageResponse) - { - return PrettifyModePage_1C_S01(DecodeModePage_1C_S01(pageResponse)); - } + public static string PrettifyModePage_1C_S01(byte[] pageResponse) => + PrettifyModePage_1C_S01(DecodeModePage_1C_S01(pageResponse)); public static string PrettifyModePage_1C_S01(ModePage_1C_S01? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/1C_SFF.cs b/DiscImageChef.Decoders/SCSI/Modes/1C_SFF.cs index 5173f456d..3707e6bee 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/1C_SFF.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/1C_SFF.cs @@ -87,10 +87,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_1C_SFF(byte[] pageResponse) - { - return PrettifyModePage_1C_SFF(DecodeModePage_1C_SFF(pageResponse)); - } + public static string PrettifyModePage_1C_SFF(byte[] pageResponse) => + PrettifyModePage_1C_SFF(DecodeModePage_1C_SFF(pageResponse)); public static string PrettifyModePage_1C_SFF(ModePage_1C_SFF? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/1D.cs b/DiscImageChef.Decoders/SCSI/Modes/1D.cs index 58d4c6eba..bc119d723 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/1D.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/1D.cs @@ -72,10 +72,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyModePage_1D(byte[] pageResponse) - { - return PrettifyModePage_1D(DecodeModePage_1D(pageResponse)); - } + public static string PrettifyModePage_1D(byte[] pageResponse) => + PrettifyModePage_1D(DecodeModePage_1D(pageResponse)); public static string PrettifyModePage_1D(ModePage_1D? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/21_Certance.cs b/DiscImageChef.Decoders/SCSI/Modes/21_Certance.cs index 9a871c357..527085863 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/21_Certance.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/21_Certance.cs @@ -82,10 +82,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyCertanceModePage_21(byte[] pageResponse) - { - return PrettifyCertanceModePage_21(DecodeCertanceModePage_21(pageResponse)); - } + public static string PrettifyCertanceModePage_21(byte[] pageResponse) => + PrettifyCertanceModePage_21(DecodeCertanceModePage_21(pageResponse)); public static string PrettifyCertanceModePage_21(Certance_ModePage_21? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/22_Certance.cs b/DiscImageChef.Decoders/SCSI/Modes/22_Certance.cs index 99a7e46e0..e3b8ccca0 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/22_Certance.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/22_Certance.cs @@ -89,10 +89,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyCertanceModePage_22(byte[] pageResponse) - { - return PrettifyCertanceModePage_22(DecodeCertanceModePage_22(pageResponse)); - } + public static string PrettifyCertanceModePage_22(byte[] pageResponse) => + PrettifyCertanceModePage_22(DecodeCertanceModePage_22(pageResponse)); public static string PrettifyCertanceModePage_22(Certance_ModePage_22? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/24_IBM.cs b/DiscImageChef.Decoders/SCSI/Modes/24_IBM.cs index 508d8c4ff..625abf169 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/24_IBM.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/24_IBM.cs @@ -74,10 +74,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyIBMModePage_24(byte[] pageResponse) - { - return PrettifyIBMModePage_24(DecodeIBMModePage_24(pageResponse)); - } + public static string PrettifyIBMModePage_24(byte[] pageResponse) => + PrettifyIBMModePage_24(DecodeIBMModePage_24(pageResponse)); public static string PrettifyIBMModePage_24(IBM_ModePage_24? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/2A.cs b/DiscImageChef.Decoders/SCSI/Modes/2A.cs index e69e58cea..0055d4183 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/2A.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/2A.cs @@ -422,10 +422,8 @@ namespace DiscImageChef.Decoders.SCSI return buf; } - public static string PrettifyModePage_2A(byte[] pageResponse) - { - return PrettifyModePage_2A(DecodeModePage_2A(pageResponse)); - } + public static string PrettifyModePage_2A(byte[] pageResponse) => + PrettifyModePage_2A(DecodeModePage_2A(pageResponse)); public static string PrettifyModePage_2A(ModePage_2A modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/2F_IBM.cs b/DiscImageChef.Decoders/SCSI/Modes/2F_IBM.cs index 62b431799..58de6bdbc 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/2F_IBM.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/2F_IBM.cs @@ -87,10 +87,8 @@ namespace DiscImageChef.Decoders.SCSI }; } - public static string PrettifyIBMModePage_2F(byte[] pageResponse) - { - return PrettifyIBMModePage_2F(DecodeIBMModePage_2F(pageResponse)); - } + public static string PrettifyIBMModePage_2F(byte[] pageResponse) => + PrettifyIBMModePage_2F(DecodeIBMModePage_2F(pageResponse)); public static string PrettifyIBMModePage_2F(IBM_ModePage_2F? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/30_Apple.cs b/DiscImageChef.Decoders/SCSI/Modes/30_Apple.cs index 4c6054990..b1876fd63 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/30_Apple.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/30_Apple.cs @@ -44,8 +44,8 @@ namespace DiscImageChef.Decoders.SCSI #region Apple Mode Page 0x30: Apple OEM String static readonly byte[] AppleOEMString = { - 0x41, 0x50, 0x50, 0x4C, 0x45, 0x20, 0x43, 0x4F, 0x4D, 0x50, 0x55, 0x54, 0x45, 0x52, 0x2C, 0x20, 0x49, 0x4E, - 0x43, 0x2E + 0x41, 0x50, 0x50, 0x4C, 0x45, 0x20, 0x43, 0x4F, 0x4D, 0x50, 0x55, 0x54, 0x45, 0x52, 0x2C, 0x20, 0x49, + 0x4E, 0x43, 0x2E }; public static bool IsAppleModePage_30(byte[] pageResponse) diff --git a/DiscImageChef.Decoders/SCSI/Modes/3B_HP.cs b/DiscImageChef.Decoders/SCSI/Modes/3B_HP.cs index 3c70a34af..a959d7816 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/3B_HP.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/3B_HP.cs @@ -72,10 +72,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyHPModePage_3B(byte[] pageResponse) - { - return PrettifyHPModePage_3B(DecodeHPModePage_3B(pageResponse)); - } + public static string PrettifyHPModePage_3B(byte[] pageResponse) => + PrettifyHPModePage_3B(DecodeHPModePage_3B(pageResponse)); public static string PrettifyHPModePage_3B(HP_ModePage_3B? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/3C_HP.cs b/DiscImageChef.Decoders/SCSI/Modes/3C_HP.cs index 00cba9327..24ea30afe 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/3C_HP.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/3C_HP.cs @@ -94,10 +94,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyHPModePage_3C(byte[] pageResponse) - { - return PrettifyHPModePage_3C(DecodeHPModePage_3C(pageResponse)); - } + public static string PrettifyHPModePage_3C(byte[] pageResponse) => + PrettifyHPModePage_3C(DecodeHPModePage_3C(pageResponse)); public static string PrettifyHPModePage_3C(HP_ModePage_3C? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/3D_HP.cs b/DiscImageChef.Decoders/SCSI/Modes/3D_HP.cs index cd06442b5..2cdc9a94e 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/3D_HP.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/3D_HP.cs @@ -68,10 +68,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyHPModePage_3D(byte[] pageResponse) - { - return PrettifyHPModePage_3D(DecodeHPModePage_3D(pageResponse)); - } + public static string PrettifyHPModePage_3D(byte[] pageResponse) => + PrettifyHPModePage_3D(DecodeHPModePage_3D(pageResponse)); public static string PrettifyHPModePage_3D(HP_ModePage_3D? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/3D_IBM.cs b/DiscImageChef.Decoders/SCSI/Modes/3D_IBM.cs index b75920df3..6a63ca089 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/3D_IBM.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/3D_IBM.cs @@ -68,10 +68,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyIBMModePage_3D(byte[] pageResponse) - { - return PrettifyIBMModePage_3D(DecodeIBMModePage_3D(pageResponse)); - } + public static string PrettifyIBMModePage_3D(byte[] pageResponse) => + PrettifyIBMModePage_3D(DecodeIBMModePage_3D(pageResponse)); public static string PrettifyIBMModePage_3D(IBM_ModePage_3D? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/3E_Fujitsu.cs b/DiscImageChef.Decoders/SCSI/Modes/3E_Fujitsu.cs index 8908b7526..f19d2cde5 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/3E_Fujitsu.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/3E_Fujitsu.cs @@ -115,10 +115,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyFujitsuModePage_3E(byte[] pageResponse) - { - return PrettifyFujitsuModePage_3E(DecodeFujitsuModePage_3E(pageResponse)); - } + public static string PrettifyFujitsuModePage_3E(byte[] pageResponse) => + PrettifyFujitsuModePage_3E(DecodeFujitsuModePage_3E(pageResponse)); public static string PrettifyFujitsuModePage_3E(Fujitsu_ModePage_3E? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/3E_HP.cs b/DiscImageChef.Decoders/SCSI/Modes/3E_HP.cs index 1fe1563eb..a938bbf94 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/3E_HP.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/3E_HP.cs @@ -70,10 +70,8 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static string PrettifyHPModePage_3E(byte[] pageResponse) - { - return PrettifyHPModePage_3E(DecodeHPModePage_3E(pageResponse)); - } + public static string PrettifyHPModePage_3E(byte[] pageResponse) => + PrettifyHPModePage_3E(DecodeHPModePage_3E(pageResponse)); public static string PrettifyHPModePage_3E(HP_ModePage_3E? modePage) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/Mode10.cs b/DiscImageChef.Decoders/SCSI/Modes/Mode10.cs index 690cc6521..29a0b1812 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/Mode10.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/Mode10.cs @@ -130,10 +130,8 @@ namespace DiscImageChef.Decoders.SCSI return header; } - public static string PrettifyModeHeader10(byte[] modeResponse, PeripheralDeviceTypes deviceType) - { - return PrettifyModeHeader(DecodeModeHeader10(modeResponse, deviceType), deviceType); - } + public static string PrettifyModeHeader10(byte[] modeResponse, PeripheralDeviceTypes deviceType) => + PrettifyModeHeader(DecodeModeHeader10(modeResponse, deviceType), deviceType); public static DecodedMode? DecodeMode10(byte[] modeResponse, PeripheralDeviceTypes deviceType) { diff --git a/DiscImageChef.Decoders/SCSI/Modes/Mode6.cs b/DiscImageChef.Decoders/SCSI/Modes/Mode6.cs index 0c3e4b70f..89531b52a 100644 --- a/DiscImageChef.Decoders/SCSI/Modes/Mode6.cs +++ b/DiscImageChef.Decoders/SCSI/Modes/Mode6.cs @@ -89,10 +89,8 @@ namespace DiscImageChef.Decoders.SCSI return header; } - public static string PrettifyModeHeader6(byte[] modeResponse, PeripheralDeviceTypes deviceType) - { - return PrettifyModeHeader(DecodeModeHeader6(modeResponse, deviceType), deviceType); - } + public static string PrettifyModeHeader6(byte[] modeResponse, PeripheralDeviceTypes deviceType) => + PrettifyModeHeader(DecodeModeHeader6(modeResponse, deviceType), deviceType); public static DecodedMode? DecodeMode6(byte[] modeResponse, PeripheralDeviceTypes deviceType) { diff --git a/DiscImageChef.Decoders/SCSI/SSC/BlockLimits.cs b/DiscImageChef.Decoders/SCSI/SSC/BlockLimits.cs index 166459174..18456ff99 100644 --- a/DiscImageChef.Decoders/SCSI/SSC/BlockLimits.cs +++ b/DiscImageChef.Decoders/SCSI/SSC/BlockLimits.cs @@ -92,9 +92,6 @@ namespace DiscImageChef.Decoders.SCSI.SSC return sb.ToString(); } - public static string Prettify(byte[] response) - { - return Prettify(Decode(response)); - } + public static string Prettify(byte[] response) => Prettify(Decode(response)); } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/SCSI/SSC/DensitySupport.cs b/DiscImageChef.Decoders/SCSI/SSC/DensitySupport.cs index cdaf27b76..8e885673f 100644 --- a/DiscImageChef.Decoders/SCSI/SSC/DensitySupport.cs +++ b/DiscImageChef.Decoders/SCSI/SSC/DensitySupport.cs @@ -115,17 +115,12 @@ namespace DiscImageChef.Decoders.SCSI.SSC duplicate = (response[offset + 2] & 0x40) == 0x40, defaultDensity = (response[offset + 2] & 0x20) == 0x20, reserved = (byte)((response[offset + 2] & 0x1E) >> 1), - lenvalid = - (response[offset + 2] & - 0x01) == 0x01, - len = - (ushort)((response[offset + 3] << 8) + response[offset + 4]), + lenvalid = (response[offset + 2] & 0x01) == 0x01, + len = (ushort)((response[offset + 3] << 8) + response[offset + 4]), bpmm = (uint)((response[offset + 5] << 16) + (response[offset + 6] << 8) + response[offset + 7]), - width = - (ushort)((response[offset + 8] << 8) + response[offset + 9]), - tracks = - (ushort)((response[offset + 10] << 8) + response[offset + 11]), + width = (ushort)((response[offset + 8] << 8) + response[offset + 9]), + tracks = (ushort)((response[offset + 10] << 8) + response[offset + 11]), capacity = (uint)((response[offset + 12] << 24) + (response[offset + 13] << 16) + (response[offset + 14] << 8) + response[offset + 15]) }; @@ -182,10 +177,7 @@ namespace DiscImageChef.Decoders.SCSI.SSC return sb.ToString(); } - public static string PrettifyDensity(byte[] response) - { - return PrettifyDensity(DecodeDensity(response)); - } + public static string PrettifyDensity(byte[] response) => PrettifyDensity(DecodeDensity(response)); public static MediaTypeSupportHeader? DecodeMediumType(byte[] response) { @@ -272,9 +264,6 @@ namespace DiscImageChef.Decoders.SCSI.SSC return sb.ToString(); } - public static string PrettifyMediumType(byte[] response) - { - return PrettifyMediumType(DecodeMediumType(response)); - } + public static string PrettifyMediumType(byte[] response) => PrettifyMediumType(DecodeMediumType(response)); } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/SCSI/Sense.cs b/DiscImageChef.Decoders/SCSI/Sense.cs index caef98fcf..47b32b9bc 100644 --- a/DiscImageChef.Decoders/SCSI/Sense.cs +++ b/DiscImageChef.Decoders/SCSI/Sense.cs @@ -279,10 +279,7 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static FixedSense? DecodeFixed(byte[] sense) - { - return DecodeFixed(sense, out _); - } + public static FixedSense? DecodeFixed(byte[] sense) => DecodeFixed(sense, out _); public static FixedSense? DecodeFixed(byte[] sense, out string senseDescription) { @@ -325,10 +322,7 @@ namespace DiscImageChef.Decoders.SCSI return decoded; } - public static DescriptorSense? DecodeDescriptor(byte[] sense) - { - return DecodeDescriptor(sense, out _); - } + public static DescriptorSense? DecodeDescriptor(byte[] sense) => DecodeDescriptor(sense, out _); public static DescriptorSense? DecodeDescriptor(byte[] sense, out string senseDescription) { @@ -586,9 +580,8 @@ namespace DiscImageChef.Decoders.SCSI throw new NotImplementedException("Check OSD"); } - public static AtaErrorRegistersLba48 DecodeDescriptor09(byte[] descriptor) - { - return new AtaErrorRegistersLba48 + public static AtaErrorRegistersLba48 DecodeDescriptor09(byte[] descriptor) => + new AtaErrorRegistersLba48 { Error = descriptor[3], SectorCount = (ushort)((descriptor[4] << 8) + descriptor[5]), @@ -598,7 +591,6 @@ namespace DiscImageChef.Decoders.SCSI DeviceHead = descriptor[12], Status = descriptor[13] }; - } public static void DecodeDescriptor0B(byte[] descriptor) { @@ -610,15 +602,10 @@ namespace DiscImageChef.Decoders.SCSI throw new NotImplementedException("Check SBC-3"); } - public static string PrettifyDescriptor00(ulong information) - { - return $"On logical block {information}\n"; - } + public static string PrettifyDescriptor00(ulong information) => $"On logical block {information}\n"; - public static string PrettifyDescriptor00(byte[] descriptor) - { - return PrettifyDescriptor00(DecodeDescriptor00(descriptor)); - } + public static string PrettifyDescriptor00(byte[] descriptor) => + PrettifyDescriptor00(DecodeDescriptor00(descriptor)); public static string GetSenseKey(SenseKeys key) { diff --git a/DiscImageChef.Decoders/SecureDigital/CID.cs b/DiscImageChef.Decoders/SecureDigital/CID.cs index dc8877586..cd821f421 100644 --- a/DiscImageChef.Decoders/SecureDigital/CID.cs +++ b/DiscImageChef.Decoders/SecureDigital/CID.cs @@ -116,14 +116,8 @@ namespace DiscImageChef.Decoders.SecureDigital return sb.ToString(); } - public static string PrettifyCID(uint[] response) - { - return PrettifyCID(DecodeCID(response)); - } + public static string PrettifyCID(uint[] response) => PrettifyCID(DecodeCID(response)); - public static string PrettifyCID(byte[] response) - { - return PrettifyCID(DecodeCID(response)); - } + public static string PrettifyCID(byte[] response) => PrettifyCID(DecodeCID(response)); } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/SecureDigital/CSD.cs b/DiscImageChef.Decoders/SecureDigital/CSD.cs index 2cc2604d2..f4fc8ae2b 100644 --- a/DiscImageChef.Decoders/SecureDigital/CSD.cs +++ b/DiscImageChef.Decoders/SecureDigital/CSD.cs @@ -538,14 +538,8 @@ namespace DiscImageChef.Decoders.SecureDigital return sb.ToString(); } - public static string PrettifyCSD(uint[] response) - { - return PrettifyCSD(DecodeCSD(response)); - } + public static string PrettifyCSD(uint[] response) => PrettifyCSD(DecodeCSD(response)); - public static string PrettifyCSD(byte[] response) - { - return PrettifyCSD(DecodeCSD(response)); - } + public static string PrettifyCSD(byte[] response) => PrettifyCSD(DecodeCSD(response)); } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/SecureDigital/OCR.cs b/DiscImageChef.Decoders/SecureDigital/OCR.cs index f345707ff..87dfcc4f0 100644 --- a/DiscImageChef.Decoders/SecureDigital/OCR.cs +++ b/DiscImageChef.Decoders/SecureDigital/OCR.cs @@ -63,9 +63,8 @@ namespace DiscImageChef.Decoders.SecureDigital [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] public static partial class Decoders { - public static OCR DecodeOCR(uint response) - { - return new OCR + public static OCR DecodeOCR(uint response) => + new OCR { PowerUp = (response & 0x80000000) == 0x80000000, CCS = (response & 0x40000000) == 0x40000000, @@ -82,12 +81,9 @@ namespace DiscImageChef.Decoders.SecureDigital TwoSeven = (response & 0x00008000) == 0x00008000, LowPower = (response & 0x00000080) == 0x00000080 }; - } - public static OCR DecodeOCR(byte[] response) - { - return response?.Length != 4 ? null : DecodeOCR(BitConverter.ToUInt32(response, 0)); - } + public static OCR DecodeOCR(byte[] response) => + response?.Length != 4 ? null : DecodeOCR(BitConverter.ToUInt32(response, 0)); public static string PrettifyOCR(OCR ocr) { @@ -112,14 +108,8 @@ namespace DiscImageChef.Decoders.SecureDigital return sb.ToString(); } - public static string PrettifyOCR(byte[] response) - { - return PrettifyOCR(DecodeOCR(response)); - } + public static string PrettifyOCR(byte[] response) => PrettifyOCR(DecodeOCR(response)); - public static string PrettifyOCR(uint response) - { - return PrettifyOCR(DecodeOCR(response)); - } + public static string PrettifyOCR(uint response) => PrettifyOCR(DecodeOCR(response)); } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/SecureDigital/SCR.cs b/DiscImageChef.Decoders/SecureDigital/SCR.cs index 6a87855cb..4fe1438ac 100644 --- a/DiscImageChef.Decoders/SecureDigital/SCR.cs +++ b/DiscImageChef.Decoders/SecureDigital/SCR.cs @@ -159,14 +159,8 @@ namespace DiscImageChef.Decoders.SecureDigital return sb.ToString(); } - public static string PrettifySCR(uint[] response) - { - return PrettifySCR(DecodeSCR(response)); - } + public static string PrettifySCR(uint[] response) => PrettifySCR(DecodeSCR(response)); - public static string PrettifySCR(byte[] response) - { - return PrettifySCR(DecodeSCR(response)); - } + public static string PrettifySCR(byte[] response) => PrettifySCR(DecodeSCR(response)); } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/Xbox/DMI.cs b/DiscImageChef.Decoders/Xbox/DMI.cs index d193ce364..4938b89ae 100644 --- a/DiscImageChef.Decoders/Xbox/DMI.cs +++ b/DiscImageChef.Decoders/Xbox/DMI.cs @@ -282,14 +282,8 @@ namespace DiscImageChef.Decoders.Xbox return sb.ToString(); } - public static string PrettifyXbox(byte[] response) - { - return PrettifyXbox(DecodeXbox(response)); - } + public static string PrettifyXbox(byte[] response) => PrettifyXbox(DecodeXbox(response)); - public static string PrettifyXbox360(byte[] response) - { - return PrettifyXbox360(DecodeXbox360(response)); - } + public static string PrettifyXbox360(byte[] response) => PrettifyXbox360(DecodeXbox360(response)); } } \ No newline at end of file diff --git a/DiscImageChef.Decoders/Xbox/SS.cs b/DiscImageChef.Decoders/Xbox/SS.cs index ab5e568f3..b2f893056 100644 --- a/DiscImageChef.Decoders/Xbox/SS.cs +++ b/DiscImageChef.Decoders/Xbox/SS.cs @@ -461,9 +461,6 @@ namespace DiscImageChef.Decoders.Xbox return sb.ToString(); } - public static string Prettify(byte[] response) - { - return Prettify(Decode(response)); - } + public static string Prettify(byte[] response) => Prettify(Decode(response)); } } \ No newline at end of file diff --git a/DiscImageChef.Devices/Device/AtaCommands/Ata28.cs b/DiscImageChef.Devices/Device/AtaCommands/Ata28.cs index 03072f265..852d463a5 100644 --- a/DiscImageChef.Devices/Device/AtaCommands/Ata28.cs +++ b/DiscImageChef.Devices/Device/AtaCommands/Ata28.cs @@ -70,10 +70,8 @@ namespace DiscImageChef.Devices } public bool ReadDma(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, uint lba, byte count, - uint timeout, out double duration) - { - return ReadDma(out buffer, out statusRegisters, true, lba, count, timeout, out duration); - } + uint timeout, out double duration) => + ReadDma(out buffer, out statusRegisters, true, lba, count, timeout, out duration); public bool ReadDma(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, bool retry, uint lba, byte count, uint timeout, out double duration) @@ -158,10 +156,8 @@ namespace DiscImageChef.Devices } public bool Read(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, uint lba, byte count, - uint timeout, out double duration) - { - return Read(out buffer, out statusRegisters, true, lba, count, timeout, out duration); - } + uint timeout, out double duration) => + Read(out buffer, out statusRegisters, true, lba, count, timeout, out duration); public bool Read(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, bool retry, uint lba, byte count, uint timeout, out double duration) @@ -191,10 +187,8 @@ namespace DiscImageChef.Devices } public bool ReadLong(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, uint lba, uint blockSize, - uint timeout, out double duration) - { - return ReadLong(out buffer, out statusRegisters, true, lba, blockSize, timeout, out duration); - } + uint timeout, out double duration) => + ReadLong(out buffer, out statusRegisters, true, lba, blockSize, timeout, out duration); public bool ReadLong(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, bool retry, uint lba, diff --git a/DiscImageChef.Devices/Device/AtaCommands/AtaCHS.cs b/DiscImageChef.Devices/Device/AtaCommands/AtaCHS.cs index 289b9d93a..4e720b612 100644 --- a/DiscImageChef.Devices/Device/AtaCommands/AtaCHS.cs +++ b/DiscImageChef.Devices/Device/AtaCommands/AtaCHS.cs @@ -43,10 +43,8 @@ namespace DiscImageChef.Devices /// true if the command failed and contains the error registers. /// Buffer. /// Status registers. - public bool AtaIdentify(out byte[] buffer, out AtaErrorRegistersChs statusRegisters) - { - return AtaIdentify(out buffer, out statusRegisters, Timeout); - } + public bool AtaIdentify(out byte[] buffer, out AtaErrorRegistersChs statusRegisters) => + AtaIdentify(out buffer, out statusRegisters, Timeout); /// /// Sends the ATA IDENTIFY DEVICE command to the device, using default device timeout @@ -55,10 +53,8 @@ namespace DiscImageChef.Devices /// Buffer. /// Status registers. /// Duration. - public bool AtaIdentify(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, out double duration) - { - return AtaIdentify(out buffer, out statusRegisters, Timeout, out duration); - } + public bool AtaIdentify(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, out double duration) => + AtaIdentify(out buffer, out statusRegisters, Timeout, out duration); /// /// Sends the ATA IDENTIFY DEVICE command to the device @@ -67,10 +63,8 @@ namespace DiscImageChef.Devices /// Buffer. /// Status registers. /// Timeout. - public bool AtaIdentify(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, uint timeout) - { - return AtaIdentify(out buffer, out statusRegisters, timeout, out _); - } + public bool AtaIdentify(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, uint timeout) => + AtaIdentify(out buffer, out statusRegisters, timeout, out _); /// /// Sends the ATA IDENTIFY DEVICE command to the device @@ -100,10 +94,8 @@ namespace DiscImageChef.Devices public bool ReadDma(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, ushort cylinder, byte head, byte sector, byte count, uint timeout, - out double duration) - { - return ReadDma(out buffer, out statusRegisters, true, cylinder, head, sector, count, timeout, out duration); - } + out double duration) => + ReadDma(out buffer, out statusRegisters, true, cylinder, head, sector, count, timeout, out duration); public bool ReadDma(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, bool retry, ushort cylinder, byte head, byte sector, byte count, uint timeout, @@ -158,10 +150,8 @@ namespace DiscImageChef.Devices public bool Read(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, ushort cylinder, byte head, byte sector, byte count, uint timeout, - out double duration) - { - return Read(out buffer, out statusRegisters, true, cylinder, head, sector, count, timeout, out duration); - } + out double duration) => + Read(out buffer, out statusRegisters, true, cylinder, head, sector, count, timeout, out duration); public bool Read(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, bool retry, ushort cylinder, byte head, byte sector, byte count, uint timeout, @@ -192,11 +182,8 @@ namespace DiscImageChef.Devices public bool ReadLong(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, ushort cylinder, byte head, byte sector, uint blockSize, uint timeout, - out double duration) - { - return ReadLong(out buffer, out statusRegisters, true, cylinder, head, sector, blockSize, timeout, - out duration); - } + out double duration) => + ReadLong(out buffer, out statusRegisters, true, cylinder, head, sector, blockSize, timeout, out duration); public bool ReadLong(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, bool retry, ushort cylinder, @@ -249,10 +236,8 @@ namespace DiscImageChef.Devices } public bool SetFeatures(out AtaErrorRegistersChs statusRegisters, AtaFeatures feature, uint timeout, - out double duration) - { - return SetFeatures(out statusRegisters, feature, 0, 0, 0, 0, timeout, out duration); - } + out double duration) => + SetFeatures(out statusRegisters, feature, 0, 0, 0, 0, timeout, out duration); public bool SetFeatures(out AtaErrorRegistersChs statusRegisters, AtaFeatures feature, ushort cylinder, byte head, byte sector, byte sectorCount, diff --git a/DiscImageChef.Devices/Device/AtaCommands/Atapi.cs b/DiscImageChef.Devices/Device/AtaCommands/Atapi.cs index fde0d6efb..6b6c3d993 100644 --- a/DiscImageChef.Devices/Device/AtaCommands/Atapi.cs +++ b/DiscImageChef.Devices/Device/AtaCommands/Atapi.cs @@ -43,10 +43,8 @@ namespace DiscImageChef.Devices /// true if the command failed and contains the error registers. /// Buffer. /// Status registers. - public bool AtapiIdentify(out byte[] buffer, out AtaErrorRegistersChs statusRegisters) - { - return AtapiIdentify(out buffer, out statusRegisters, Timeout); - } + public bool AtapiIdentify(out byte[] buffer, out AtaErrorRegistersChs statusRegisters) => + AtapiIdentify(out buffer, out statusRegisters, Timeout); /// /// Sends the ATA IDENTIFY PACKET DEVICE command to the device, using default device timeout @@ -55,10 +53,8 @@ namespace DiscImageChef.Devices /// Buffer. /// Status registers. /// Duration. - public bool AtapiIdentify(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, out double duration) - { - return AtapiIdentify(out buffer, out statusRegisters, Timeout, out duration); - } + public bool AtapiIdentify(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, out double duration) => + AtapiIdentify(out buffer, out statusRegisters, Timeout, out duration); /// /// Sends the ATA IDENTIFY PACKET DEVICE command to the device @@ -67,10 +63,8 @@ namespace DiscImageChef.Devices /// Buffer. /// Status registers. /// Timeout. - public bool AtapiIdentify(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, uint timeout) - { - return AtapiIdentify(out buffer, out statusRegisters, timeout, out _); - } + public bool AtapiIdentify(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, uint timeout) => + AtapiIdentify(out buffer, out statusRegisters, timeout, out _); /// /// Sends the ATA IDENTIFY PACKET DEVICE command to the device diff --git a/DiscImageChef.Devices/Device/AtaCommands/MCPT.cs b/DiscImageChef.Devices/Device/AtaCommands/MCPT.cs index 0e4517d30..4cde9af10 100644 --- a/DiscImageChef.Devices/Device/AtaCommands/MCPT.cs +++ b/DiscImageChef.Devices/Device/AtaCommands/MCPT.cs @@ -38,16 +38,12 @@ namespace DiscImageChef.Devices public partial class Device { public bool EnableMediaCardPassThrough(out AtaErrorRegistersChs statusRegisters, uint timeout, - out double duration) - { - return CheckMediaCardType(1, out statusRegisters, timeout, out duration); - } + out double duration) => + CheckMediaCardType(1, out statusRegisters, timeout, out duration); public bool DisableMediaCardPassThrough(out AtaErrorRegistersChs statusRegisters, uint timeout, - out double duration) - { - return CheckMediaCardType(0, out statusRegisters, timeout, out duration); - } + out double duration) => + CheckMediaCardType(0, out statusRegisters, timeout, out duration); public bool CheckMediaCardType(byte feature, out AtaErrorRegistersChs statusRegisters, uint timeout, out double duration) diff --git a/DiscImageChef.Devices/Device/Commands.cs b/DiscImageChef.Devices/Device/Commands.cs index ef4b0c457..7cc6ec043 100644 --- a/DiscImageChef.Devices/Device/Commands.cs +++ b/DiscImageChef.Devices/Device/Commands.cs @@ -54,11 +54,9 @@ namespace DiscImageChef.Devices /// SCSI sense /// public int SendScsiCommand(byte[] cdb, ref byte[] buffer, out byte[] senseBuffer, uint timeout, - ScsiDirection direction, out double duration, out bool sense) - { - return Command.SendScsiCommand(PlatformId, FileHandle, cdb, ref buffer, out senseBuffer, timeout, direction, - out duration, out sense); - } + ScsiDirection direction, out double duration, out bool sense) => + Command.SendScsiCommand(PlatformId, FileHandle, cdb, ref buffer, out senseBuffer, timeout, direction, + out duration, out sense); /// /// Sends an ATA/ATAPI command to this device using CHS addressing @@ -80,12 +78,9 @@ namespace DiscImageChef.Devices AtaProtocol protocol, AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, - out double duration, out bool sense) - { - return Command.SendAtaCommand(PlatformId, FileHandle, registers, out errorRegisters, protocol, - transferRegister, ref buffer, timeout, transferBlocks, out duration, - out sense); - } + out double duration, out bool sense) => + Command.SendAtaCommand(PlatformId, FileHandle, registers, out errorRegisters, protocol, transferRegister, + ref buffer, timeout, transferBlocks, out duration, out sense); /// /// Sends an ATA/ATAPI command to this device using 28-bit LBA addressing @@ -107,12 +102,9 @@ namespace DiscImageChef.Devices AtaProtocol protocol, AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, - out double duration, out bool sense) - { - return Command.SendAtaCommand(PlatformId, FileHandle, registers, out errorRegisters, protocol, - transferRegister, ref buffer, timeout, transferBlocks, out duration, - out sense); - } + out double duration, out bool sense) => + Command.SendAtaCommand(PlatformId, FileHandle, registers, out errorRegisters, protocol, transferRegister, + ref buffer, timeout, transferBlocks, out duration, out sense); /// /// Sends an ATA/ATAPI command to this device using 48-bit LBA addressing @@ -134,12 +126,9 @@ namespace DiscImageChef.Devices AtaProtocol protocol, AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, - out double duration, out bool sense) - { - return Command.SendAtaCommand(PlatformId, FileHandle, registers, out errorRegisters, protocol, - transferRegister, ref buffer, timeout, transferBlocks, out duration, - out sense); - } + out double duration, out bool sense) => + Command.SendAtaCommand(PlatformId, FileHandle, registers, out errorRegisters, protocol, transferRegister, + ref buffer, timeout, transferBlocks, out duration, out sense); /// /// Sends a MMC/SD command to this device diff --git a/DiscImageChef.Devices/Device/ScsiCommands/Adaptec.cs b/DiscImageChef.Devices/Device/ScsiCommands/Adaptec.cs index 788817286..1fa6289f5 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands/Adaptec.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands/Adaptec.cs @@ -47,10 +47,8 @@ namespace DiscImageChef.Devices /// Timeout. /// Duration. public bool AdaptecTranslate(out byte[] buffer, out byte[] senseBuffer, uint lba, uint timeout, - out double duration) - { - return AdaptecTranslate(out buffer, out senseBuffer, false, lba, timeout, out duration); - } + out double duration) => + AdaptecTranslate(out buffer, out senseBuffer, false, lba, timeout, out duration); /// /// Gets the underlying drive cylinder, head and index bytes for the specified SCSI LBA. @@ -91,10 +89,9 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout. /// Duration. - public bool AdaptecSetErrorThreshold(byte threshold, out byte[] senseBuffer, uint timeout, out double duration) - { - return AdaptecSetErrorThreshold(threshold, out senseBuffer, false, timeout, out duration); - } + public bool + AdaptecSetErrorThreshold(byte threshold, out byte[] senseBuffer, uint timeout, out double duration) => + AdaptecSetErrorThreshold(threshold, out senseBuffer, false, timeout, out duration); /// /// Sets the error threshold @@ -134,10 +131,8 @@ namespace DiscImageChef.Devices /// Timeout. /// Duration. public bool AdaptecReadUsageCounter(out byte[] buffer, out byte[] senseBuffer, uint timeout, - out double duration) - { - return AdaptecReadUsageCounter(out buffer, out senseBuffer, false, timeout, out duration); - } + out double duration) => + AdaptecReadUsageCounter(out buffer, out senseBuffer, false, timeout, out duration); /// /// Requests the usage, seek and error counters, and resets them diff --git a/DiscImageChef.Devices/Device/ScsiCommands/ArchiveCorp.cs b/DiscImageChef.Devices/Device/ScsiCommands/ArchiveCorp.cs index ac3ad5dfa..636ae841b 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands/ArchiveCorp.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands/ArchiveCorp.cs @@ -73,10 +73,8 @@ namespace DiscImageChef.Devices /// Logical Block Address, starting from 1. /// Timeout. /// Duration. - public bool ArchiveCorpSeekBlock(out byte[] senseBuffer, uint lba, uint timeout, out double duration) - { - return ArchiveCorpSeekBlock(out senseBuffer, false, lba, timeout, out duration); - } + public bool ArchiveCorpSeekBlock(out byte[] senseBuffer, uint lba, uint timeout, out double duration) => + ArchiveCorpSeekBlock(out senseBuffer, false, lba, timeout, out duration); /// /// Positions the tape at the specified block address diff --git a/DiscImageChef.Devices/Device/ScsiCommands/Certance.cs b/DiscImageChef.Devices/Device/ScsiCommands/Certance.cs index 85e4a28a9..612b8f553 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands/Certance.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands/Certance.cs @@ -44,10 +44,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout. /// Duration. - public bool CertancePark(out byte[] senseBuffer, uint timeout, out double duration) - { - return CertanceParkUnpark(out senseBuffer, true, timeout, out duration); - } + public bool CertancePark(out byte[] senseBuffer, uint timeout, out double duration) => + CertanceParkUnpark(out senseBuffer, true, timeout, out duration); /// /// Unparks the load arm prior to operation @@ -55,10 +53,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout. /// Duration. - public bool CertanceUnpark(out byte[] senseBuffer, uint timeout, out double duration) - { - return CertanceParkUnpark(out senseBuffer, false, timeout, out duration); - } + public bool CertanceUnpark(out byte[] senseBuffer, uint timeout, out double duration) => + CertanceParkUnpark(out senseBuffer, false, timeout, out duration); /// /// Parks the load arm in preparation for transport or unparks it prior to operation diff --git a/DiscImageChef.Devices/Device/ScsiCommands/HP.cs b/DiscImageChef.Devices/Device/ScsiCommands/HP.cs index f496b06c9..8b428619c 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands/HP.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands/HP.cs @@ -50,11 +50,8 @@ namespace DiscImageChef.Devices /// Duration in milliseconds it took for the device to execute the command. public bool HpReadLong(out byte[] buffer, out byte[] senseBuffer, bool relAddr, uint address, ushort blockBytes, - bool pba, uint timeout, out double duration) - { - return HpReadLong(out buffer, out senseBuffer, relAddr, address, 0, blockBytes, pba, false, timeout, - out duration); - } + bool pba, uint timeout, out double duration) => + HpReadLong(out buffer, out senseBuffer, relAddr, address, 0, blockBytes, pba, false, timeout, out duration); /// /// Sends the HP READ LONG vendor command diff --git a/DiscImageChef.Devices/Device/ScsiCommands/Kreon.cs b/DiscImageChef.Devices/Device/ScsiCommands/Kreon.cs index b16cd17f4..2014e7e60 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands/Kreon.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands/Kreon.cs @@ -71,10 +71,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout. /// Duration. - public bool KreonLock(out byte[] senseBuffer, uint timeout, out double duration) - { - return KreonSetLockState(out senseBuffer, KreonLockStates.Locked, timeout, out duration); - } + public bool KreonLock(out byte[] senseBuffer, uint timeout, out double duration) => + KreonSetLockState(out senseBuffer, KreonLockStates.Locked, timeout, out duration); /// /// Sets the drive to the xtreme unlocked state @@ -83,10 +81,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout. /// Duration. - public bool KreonUnlockXtreme(out byte[] senseBuffer, uint timeout, out double duration) - { - return KreonSetLockState(out senseBuffer, KreonLockStates.Xtreme, timeout, out duration); - } + public bool KreonUnlockXtreme(out byte[] senseBuffer, uint timeout, out double duration) => + KreonSetLockState(out senseBuffer, KreonLockStates.Xtreme, timeout, out duration); /// /// Sets the drive to the wxripper unlocked state @@ -95,10 +91,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout. /// Duration. - public bool KreonUnlockWxripper(out byte[] senseBuffer, uint timeout, out double duration) - { - return KreonSetLockState(out senseBuffer, KreonLockStates.Wxripper, timeout, out duration); - } + public bool KreonUnlockWxripper(out byte[] senseBuffer, uint timeout, out double duration) => + KreonSetLockState(out senseBuffer, KreonLockStates.Wxripper, timeout, out duration); /// /// Sets the drive to the specified lock state diff --git a/DiscImageChef.Devices/Device/ScsiCommands/MMC.cs b/DiscImageChef.Devices/Device/ScsiCommands/MMC.cs index 3b478b14e..78561216c 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands/MMC.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands/MMC.cs @@ -46,11 +46,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout in seconds. /// Duration in milliseconds it took for the device to execute the command. - public bool GetConfiguration(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) - { - return GetConfiguration(out buffer, out senseBuffer, 0x0000, MmcGetConfigurationRt.All, timeout, - out duration); - } + public bool GetConfiguration(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) => + GetConfiguration(out buffer, out senseBuffer, 0x0000, MmcGetConfigurationRt.All, timeout, out duration); /// /// Sends the MMC GET CONFIGURATION command for all Features starting with specified one @@ -62,11 +59,9 @@ namespace DiscImageChef.Devices /// Timeout in seconds. /// Duration in milliseconds it took for the device to execute the command. public bool GetConfiguration(out byte[] buffer, out byte[] senseBuffer, ushort startingFeatureNumber, - uint timeout, out double duration) - { - return GetConfiguration(out buffer, out senseBuffer, startingFeatureNumber, MmcGetConfigurationRt.All, - timeout, out duration); - } + uint timeout, out double duration) => + GetConfiguration(out buffer, out senseBuffer, startingFeatureNumber, MmcGetConfigurationRt.All, timeout, + out duration); /// /// Sends the MMC GET CONFIGURATION command @@ -203,10 +198,8 @@ namespace DiscImageChef.Devices /// Start TOC from this track /// Timeout in seconds. /// Duration in milliseconds it took for the device to execute the command. - public bool ReadToc(out byte[] buffer, out byte[] senseBuffer, byte track, uint timeout, out double duration) - { - return ReadTocPmaAtip(out buffer, out senseBuffer, true, 0, track, timeout, out duration); - } + public bool ReadToc(out byte[] buffer, out byte[] senseBuffer, byte track, uint timeout, out double duration) => + ReadTocPmaAtip(out buffer, out senseBuffer, true, 0, track, timeout, out duration); /// /// Sends the MMC READ TOC/PMA/ATIP command to get formatted TOC from disc @@ -219,10 +212,8 @@ namespace DiscImageChef.Devices /// Timeout in seconds. /// Duration in milliseconds it took for the device to execute the command. public bool ReadToc(out byte[] buffer, out byte[] senseBuffer, bool msf, byte track, uint timeout, - out double duration) - { - return ReadTocPmaAtip(out buffer, out senseBuffer, msf, 0, track, timeout, out duration); - } + out double duration) => + ReadTocPmaAtip(out buffer, out senseBuffer, msf, 0, track, timeout, out duration); /// /// Sends the MMC READ TOC/PMA/ATIP command to get multi-session information, in MM:SS:FF format @@ -232,10 +223,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout in seconds. /// Duration in milliseconds it took for the device to execute the command. - public bool ReadSessionInfo(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) - { - return ReadTocPmaAtip(out buffer, out senseBuffer, true, 1, 0, timeout, out duration); - } + public bool ReadSessionInfo(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) => + ReadTocPmaAtip(out buffer, out senseBuffer, true, 1, 0, timeout, out duration); /// /// Sends the MMC READ TOC/PMA/ATIP command to get multi-session information @@ -247,10 +236,8 @@ namespace DiscImageChef.Devices /// Timeout in seconds. /// Duration in milliseconds it took for the device to execute the command. public bool ReadSessionInfo(out byte[] buffer, out byte[] senseBuffer, bool msf, uint timeout, - out double duration) - { - return ReadTocPmaAtip(out buffer, out senseBuffer, msf, 1, 0, timeout, out duration); - } + out double duration) => + ReadTocPmaAtip(out buffer, out senseBuffer, msf, 1, 0, timeout, out duration); /// /// Sends the MMC READ TOC/PMA/ATIP command to get raw TOC subchannels @@ -262,10 +249,8 @@ namespace DiscImageChef.Devices /// Timeout in seconds. /// Duration in milliseconds it took for the device to execute the command. public bool ReadRawToc(out byte[] buffer, out byte[] senseBuffer, byte sessionNumber, uint timeout, - out double duration) - { - return ReadTocPmaAtip(out buffer, out senseBuffer, true, 2, sessionNumber, timeout, out duration); - } + out double duration) => + ReadTocPmaAtip(out buffer, out senseBuffer, true, 2, sessionNumber, timeout, out duration); /// /// Sends the MMC READ TOC/PMA/ATIP command to get PMA @@ -275,10 +260,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout in seconds. /// Duration in milliseconds it took for the device to execute the command. - public bool ReadPma(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) - { - return ReadTocPmaAtip(out buffer, out senseBuffer, true, 3, 0, timeout, out duration); - } + public bool ReadPma(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) => + ReadTocPmaAtip(out buffer, out senseBuffer, true, 3, 0, timeout, out duration); /// /// Sends the MMC READ TOC/PMA/ATIP command to get ATIP @@ -288,10 +271,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout in seconds. /// Duration in milliseconds it took for the device to execute the command. - public bool ReadAtip(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) - { - return ReadTocPmaAtip(out buffer, out senseBuffer, true, 4, 0, timeout, out duration); - } + public bool ReadAtip(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) => + ReadTocPmaAtip(out buffer, out senseBuffer, true, 4, 0, timeout, out duration); /// /// Sends the MMC READ TOC/PMA/ATIP command to get Lead-In CD-TEXT @@ -301,10 +282,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout in seconds. /// Duration in milliseconds it took for the device to execute the command. - public bool ReadCdText(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) - { - return ReadTocPmaAtip(out buffer, out senseBuffer, true, 5, 0, timeout, out duration); - } + public bool ReadCdText(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) => + ReadTocPmaAtip(out buffer, out senseBuffer, true, 5, 0, timeout, out duration); /// /// Sends the MMC READ TOC/PMA/ATIP command @@ -365,11 +344,9 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout in seconds. /// Duration in milliseconds it took for the device to execute the command. - public bool ReadDiscInformation(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) - { - return ReadDiscInformation(out buffer, out senseBuffer, MmcDiscInformationDataTypes.DiscInformation, - timeout, out duration); - } + public bool ReadDiscInformation(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) => + ReadDiscInformation(out buffer, out senseBuffer, MmcDiscInformationDataTypes.DiscInformation, timeout, + out duration); /// /// Sends the MMC READ DISC INFORMATION command @@ -527,15 +504,11 @@ namespace DiscImageChef.Devices return sense; } - public bool PreventMediumRemoval(out byte[] senseBuffer, uint timeout, out double duration) - { - return PreventAllowMediumRemoval(out senseBuffer, false, true, timeout, out duration); - } + public bool PreventMediumRemoval(out byte[] senseBuffer, uint timeout, out double duration) => + PreventAllowMediumRemoval(out senseBuffer, false, true, timeout, out duration); - public bool AllowMediumRemoval(out byte[] senseBuffer, uint timeout, out double duration) - { - return PreventAllowMediumRemoval(out senseBuffer, false, false, timeout, out duration); - } + public bool AllowMediumRemoval(out byte[] senseBuffer, uint timeout, out double duration) => + PreventAllowMediumRemoval(out senseBuffer, false, false, timeout, out duration); public bool PreventAllowMediumRemoval(out byte[] senseBuffer, bool persistent, bool prevent, uint timeout, out double duration) @@ -557,25 +530,17 @@ namespace DiscImageChef.Devices return sense; } - public bool LoadTray(out byte[] senseBuffer, uint timeout, out double duration) - { - return StartStopUnit(out senseBuffer, false, 0, 0, false, true, true, timeout, out duration); - } + public bool LoadTray(out byte[] senseBuffer, uint timeout, out double duration) => + StartStopUnit(out senseBuffer, false, 0, 0, false, true, true, timeout, out duration); - public bool EjectTray(out byte[] senseBuffer, uint timeout, out double duration) - { - return StartStopUnit(out senseBuffer, false, 0, 0, false, true, false, timeout, out duration); - } + public bool EjectTray(out byte[] senseBuffer, uint timeout, out double duration) => + StartStopUnit(out senseBuffer, false, 0, 0, false, true, false, timeout, out duration); - public bool StartUnit(out byte[] senseBuffer, uint timeout, out double duration) - { - return StartStopUnit(out senseBuffer, false, 0, 0, false, false, true, timeout, out duration); - } + public bool StartUnit(out byte[] senseBuffer, uint timeout, out double duration) => + StartStopUnit(out senseBuffer, false, 0, 0, false, false, true, timeout, out duration); - public bool StopUnit(out byte[] senseBuffer, uint timeout, out double duration) - { - return StartStopUnit(out senseBuffer, false, 0, 0, false, false, false, timeout, out duration); - } + public bool StopUnit(out byte[] senseBuffer, uint timeout, out double duration) => + StartStopUnit(out senseBuffer, false, 0, 0, false, false, false, timeout, out duration); public bool StartStopUnit(out byte[] senseBuffer, bool immediate, byte formatLayer, byte powerConditions, bool changeFormatLayer, bool loadEject, bool start, uint timeout, diff --git a/DiscImageChef.Devices/Device/ScsiCommands/Plasmon.cs b/DiscImageChef.Devices/Device/ScsiCommands/Plasmon.cs index 32e29c140..13ffe7602 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands/Plasmon.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands/Plasmon.cs @@ -49,11 +49,8 @@ namespace DiscImageChef.Devices /// Timeout in seconds. /// Duration in milliseconds it took for the device to execute the command. public bool PlasmonReadLong(out byte[] buffer, out byte[] senseBuffer, bool relAddr, uint address, - ushort blockBytes, bool pba, uint timeout, out double duration) - { - return HpReadLong(out buffer, out senseBuffer, relAddr, address, 0, blockBytes, pba, false, timeout, - out duration); - } + ushort blockBytes, bool pba, uint timeout, out double duration) => + HpReadLong(out buffer, out senseBuffer, relAddr, address, 0, blockBytes, pba, false, timeout, out duration); /// /// Sends the Plasmon READ LONG vendor command @@ -75,11 +72,9 @@ namespace DiscImageChef.Devices public bool PlasmonReadLong(out byte[] buffer, out byte[] senseBuffer, bool relAddr, uint address, ushort transferLen, ushort blockBytes, bool pba, bool sectorCount, uint timeout, - out double duration) - { - return HpReadLong(out buffer, out senseBuffer, relAddr, address, transferLen, blockBytes, pba, sectorCount, - timeout, out duration); - } + out double duration) => + HpReadLong(out buffer, out senseBuffer, relAddr, address, transferLen, blockBytes, pba, sectorCount, + timeout, out duration); /// /// Retrieves the logical or physical block address for the specified diff --git a/DiscImageChef.Devices/Device/ScsiCommands/SBC.cs b/DiscImageChef.Devices/Device/ScsiCommands/SBC.cs index 41934c1b5..acfc68bbc 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands/SBC.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands/SBC.cs @@ -48,10 +48,8 @@ namespace DiscImageChef.Devices /// Starting block. /// Block size in bytes. public bool Read6(out byte[] buffer, out byte[] senseBuffer, uint lba, uint blockSize, uint timeout, - out double duration) - { - return Read6(out buffer, out senseBuffer, lba, blockSize, 1, timeout, out duration); - } + out double duration) => + Read6(out buffer, out senseBuffer, lba, blockSize, 1, timeout, out duration); /// /// Sends the SBC READ (6) command diff --git a/DiscImageChef.Devices/Device/ScsiCommands/SPC.cs b/DiscImageChef.Devices/Device/ScsiCommands/SPC.cs index 74162efc6..8c36dc69e 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands/SPC.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands/SPC.cs @@ -46,10 +46,8 @@ namespace DiscImageChef.Devices /// true if the command failed and contains the sense buffer. /// Buffer where the SCSI INQUIRY response will be stored /// Sense buffer. - public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer) - { - return ScsiInquiry(out buffer, out senseBuffer, Timeout); - } + public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer) => + ScsiInquiry(out buffer, out senseBuffer, Timeout); /// /// Sends the SPC INQUIRY command to the device using default device timeout. @@ -58,10 +56,8 @@ namespace DiscImageChef.Devices /// Buffer where the SCSI INQUIRY response will be stored /// Sense buffer. /// Duration in milliseconds it took for the device to execute the command. - public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer, out double duration) - { - return ScsiInquiry(out buffer, out senseBuffer, Timeout, out duration); - } + public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer, out double duration) => + ScsiInquiry(out buffer, out senseBuffer, Timeout, out duration); /// /// Sends the SPC INQUIRY command to the device. @@ -70,10 +66,8 @@ namespace DiscImageChef.Devices /// Buffer where the SCSI INQUIRY response will be stored /// Sense buffer. /// Timeout in seconds. - public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer, uint timeout) - { - return ScsiInquiry(out buffer, out senseBuffer, timeout, out _); - } + public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer, uint timeout) => + ScsiInquiry(out buffer, out senseBuffer, timeout, out _); /// /// Sends the SPC INQUIRY command to the device. @@ -117,10 +111,8 @@ namespace DiscImageChef.Devices /// Buffer where the SCSI INQUIRY response will be stored /// Sense buffer. /// The Extended Vital Product Data - public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer, byte page) - { - return ScsiInquiry(out buffer, out senseBuffer, page, Timeout); - } + public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer, byte page) => + ScsiInquiry(out buffer, out senseBuffer, page, Timeout); /// /// Sends the SPC INQUIRY command to the device with an Extended Vital Product Data page using default device timeout. @@ -130,10 +122,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Duration in milliseconds it took for the device to execute the command. /// The Extended Vital Product Data - public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer, byte page, out double duration) - { - return ScsiInquiry(out buffer, out senseBuffer, page, Timeout, out duration); - } + public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer, byte page, out double duration) => + ScsiInquiry(out buffer, out senseBuffer, page, Timeout, out duration); /// /// Sends the SPC INQUIRY command to the device with an Extended Vital Product Data page. @@ -143,10 +133,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout in seconds. /// The Extended Vital Product Data - public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer, byte page, uint timeout) - { - return ScsiInquiry(out buffer, out senseBuffer, page, timeout, out _); - } + public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer, byte page, uint timeout) => + ScsiInquiry(out buffer, out senseBuffer, page, timeout, out _); /// /// Sends the SPC INQUIRY command to the device with an Extended Vital Product Data page. @@ -217,11 +205,9 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout in seconds. /// Duration in milliseconds it took for the device to execute the command. - public bool ModeSense(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) - { - return ModeSense6(out buffer, out senseBuffer, false, ScsiModeSensePageControl.Current, 0, 0, timeout, - out duration); - } + public bool ModeSense(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) => + ModeSense6(out buffer, out senseBuffer, false, ScsiModeSensePageControl.Current, 0, 0, timeout, + out duration); /// /// Sends the SPC MODE SENSE(6) command to the device as introduced in SCSI-2 @@ -236,10 +222,8 @@ namespace DiscImageChef.Devices /// Page code. public bool ModeSense6(out byte[] buffer, out byte[] senseBuffer, bool dbd, ScsiModeSensePageControl pageControl, byte pageCode, uint timeout, - out double duration) - { - return ModeSense6(out buffer, out senseBuffer, dbd, pageControl, pageCode, 0, timeout, out duration); - } + out double duration) => + ModeSense6(out buffer, out senseBuffer, dbd, pageControl, pageCode, 0, timeout, out duration); /// /// Sends the SPC MODE SENSE(6) command to the device as introduced in SCSI-3 SPC-3 @@ -303,11 +287,8 @@ namespace DiscImageChef.Devices /// Page code. public bool ModeSense10(out byte[] buffer, out byte[] senseBuffer, bool dbd, ScsiModeSensePageControl pageControl, byte pageCode, uint timeout, - out double duration) - { - return ModeSense10(out buffer, out senseBuffer, false, dbd, pageControl, pageCode, 0, timeout, - out duration); - } + out double duration) => + ModeSense10(out buffer, out senseBuffer, false, dbd, pageControl, pageCode, 0, timeout, out duration); /// /// Sends the SPC MODE SENSE(10) command to the device as introduced in SCSI-3 SPC-2 @@ -321,14 +302,10 @@ namespace DiscImageChef.Devices /// Page control. /// Page code. /// If set means 64-bit LBAs are accepted by the caller. - public bool ModeSense10(out byte[] buffer, out byte[] senseBuffer, bool llbaa, - bool dbd, - ScsiModeSensePageControl pageControl, byte pageCode, uint timeout, - out double duration) - { - return ModeSense10(out buffer, out senseBuffer, llbaa, dbd, pageControl, pageCode, 0, timeout, - out duration); - } + public bool ModeSense10(out byte[] buffer, out byte[] senseBuffer, bool llbaa, bool dbd, + ScsiModeSensePageControl pageControl, byte pageCode, uint timeout, + out double duration) => + ModeSense10(out buffer, out senseBuffer, llbaa, dbd, pageControl, pageCode, 0, timeout, out duration); /// /// Sends the SPC MODE SENSE(10) command to the device as introduced in SCSI-3 SPC-3 @@ -391,10 +368,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout in seconds. /// Duration in milliseconds it took for the device to execute the command. - public bool SpcPreventMediumRemoval(out byte[] senseBuffer, uint timeout, out double duration) - { - return SpcPreventAllowMediumRemoval(out senseBuffer, ScsiPreventAllowMode.Prevent, timeout, out duration); - } + public bool SpcPreventMediumRemoval(out byte[] senseBuffer, uint timeout, out double duration) => + SpcPreventAllowMediumRemoval(out senseBuffer, ScsiPreventAllowMode.Prevent, timeout, out duration); /// /// Sends the SPC PREVENT ALLOW MEDIUM REMOVAL command to allow medium removal @@ -403,10 +378,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout in seconds. /// Duration in milliseconds it took for the device to execute the command. - public bool SpcAllowMediumRemoval(out byte[] senseBuffer, uint timeout, out double duration) - { - return SpcPreventAllowMediumRemoval(out senseBuffer, ScsiPreventAllowMode.Allow, timeout, out duration); - } + public bool SpcAllowMediumRemoval(out byte[] senseBuffer, uint timeout, out double duration) => + SpcPreventAllowMediumRemoval(out senseBuffer, ScsiPreventAllowMode.Allow, timeout, out duration); /// /// Sends the SPC PREVENT ALLOW MEDIUM REMOVAL command @@ -461,10 +434,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout in seconds. /// Duration in milliseconds it took for the device to execute the command. - public bool ReadCapacity(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) - { - return ReadCapacity(out buffer, out senseBuffer, false, 0, false, timeout, out duration); - } + public bool ReadCapacity(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) => + ReadCapacity(out buffer, out senseBuffer, false, 0, false, timeout, out duration); /// /// Sends the SPC READ CAPACITY command @@ -514,10 +485,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout in seconds. /// Duration in milliseconds it took for the device to execute the command. - public bool ReadCapacity16(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) - { - return ReadCapacity16(out buffer, out senseBuffer, 0, false, timeout, out duration); - } + public bool ReadCapacity16(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) => + ReadCapacity16(out buffer, out senseBuffer, 0, false, timeout, out duration); /// /// Sends the SPC READ CAPACITY(16) command @@ -625,11 +594,9 @@ namespace DiscImageChef.Devices public bool ReadAttribute(out byte[] buffer, out byte[] senseBuffer, ScsiAttributeAction action, byte partition, ushort firstAttribute, bool cache, uint timeout, - out double duration) - { - return ReadAttribute(out buffer, out senseBuffer, action, 0, 0, 0, partition, firstAttribute, cache, - timeout, out duration); - } + out double duration) => + ReadAttribute(out buffer, out senseBuffer, action, 0, 0, 0, partition, firstAttribute, cache, timeout, + out duration); /// /// Reads an attribute from the medium auxiliary memory @@ -643,11 +610,9 @@ namespace DiscImageChef.Devices /// Duration. public bool ReadAttribute(out byte[] buffer, out byte[] senseBuffer, ScsiAttributeAction action, ushort firstAttribute, bool cache, uint timeout, - out double duration) - { - return ReadAttribute(out buffer, out senseBuffer, action, 0, 0, 0, 0, firstAttribute, cache, timeout, - out duration); - } + out double duration) => + ReadAttribute(out buffer, out senseBuffer, action, 0, 0, 0, 0, firstAttribute, cache, timeout, + out duration); /// /// Reads an attribute from the medium auxiliary memory @@ -661,11 +626,9 @@ namespace DiscImageChef.Devices /// Duration. public bool ReadAttribute(out byte[] buffer, out byte[] senseBuffer, ScsiAttributeAction action, byte partition, - ushort firstAttribute, uint timeout, out double duration) - { - return ReadAttribute(out buffer, out senseBuffer, action, 0, 0, 0, partition, firstAttribute, false, - timeout, out duration); - } + ushort firstAttribute, uint timeout, out double duration) => + ReadAttribute(out buffer, out senseBuffer, action, 0, 0, 0, partition, firstAttribute, false, timeout, + out duration); /// /// Reads an attribute from the medium auxiliary memory @@ -677,11 +640,9 @@ namespace DiscImageChef.Devices /// Timeout. /// Duration. public bool ReadAttribute(out byte[] buffer, out byte[] senseBuffer, ScsiAttributeAction action, - ushort firstAttribute, uint timeout, out double duration) - { - return ReadAttribute(out buffer, out senseBuffer, action, 0, 0, 0, 0, firstAttribute, false, timeout, - out duration); - } + ushort firstAttribute, uint timeout, out double duration) => + ReadAttribute(out buffer, out senseBuffer, action, 0, 0, 0, 0, firstAttribute, false, timeout, + out duration); /// /// Reads an attribute from the medium auxiliary memory @@ -697,11 +658,9 @@ namespace DiscImageChef.Devices public bool ReadAttribute(out byte[] buffer, out byte[] senseBuffer, ScsiAttributeAction action, byte volume, byte partition, ushort firstAttribute, uint timeout, - out double duration) - { - return ReadAttribute(out buffer, out senseBuffer, action, 0, 0, volume, partition, firstAttribute, false, - timeout, out duration); - } + out double duration) => + ReadAttribute(out buffer, out senseBuffer, action, 0, 0, volume, partition, firstAttribute, false, timeout, + out duration); /// /// Reads an attribute from the medium auxiliary memory @@ -717,12 +676,11 @@ namespace DiscImageChef.Devices /// Duration. public bool ReadAttribute(out byte[] buffer, out byte[] senseBuffer, ScsiAttributeAction action, byte volume, - byte partition, ushort firstAttribute, bool cache, - uint timeout, out double duration) - { - return ReadAttribute(out buffer, out senseBuffer, action, 0, 0, volume, partition, firstAttribute, cache, - timeout, out duration); - } + byte partition, ushort firstAttribute, bool cache, + uint timeout, + out double duration) => + ReadAttribute(out buffer, out senseBuffer, action, 0, 0, volume, partition, firstAttribute, cache, timeout, + out duration); /// /// Sends the SPC MODE SELECT(6) command @@ -812,10 +770,8 @@ namespace DiscImageChef.Devices return sense; } - public bool RequestSense(out byte[] buffer, uint timeout, out double duration) - { - return RequestSense(false, out buffer, timeout, out duration); - } + public bool RequestSense(out byte[] buffer, uint timeout, out double duration) => + RequestSense(false, out buffer, timeout, out duration); public bool RequestSense(bool descriptor, out byte[] buffer, uint timeout, out double duration) { diff --git a/DiscImageChef.Devices/Device/ScsiCommands/SSC.cs b/DiscImageChef.Devices/Device/ScsiCommands/SSC.cs index 917330387..2f9153a90 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands/SSC.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands/SSC.cs @@ -44,10 +44,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout. /// Duration. - public bool Load(out byte[] senseBuffer, uint timeout, out double duration) - { - return LoadUnload(out senseBuffer, false, true, false, false, false, timeout, out duration); - } + public bool Load(out byte[] senseBuffer, uint timeout, out double duration) => + LoadUnload(out senseBuffer, false, true, false, false, false, timeout, out duration); /// /// Prepares the medium for ejection @@ -56,10 +54,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout. /// Duration. - public bool Unload(out byte[] senseBuffer, uint timeout, out double duration) - { - return LoadUnload(out senseBuffer, false, false, false, false, false, timeout, out duration); - } + public bool Unload(out byte[] senseBuffer, uint timeout, out double duration) => + LoadUnload(out senseBuffer, false, false, false, false, false, timeout, out duration); /// /// Prepares the medium for reading or ejection @@ -106,10 +102,8 @@ namespace DiscImageChef.Devices /// Logical block address. /// Timeout. /// Duration. - public bool Locate(out byte[] senseBuffer, uint lba, uint timeout, out double duration) - { - return Locate(out senseBuffer, false, false, true, 0, lba, timeout, out duration); - } + public bool Locate(out byte[] senseBuffer, uint lba, uint timeout, out double duration) => + Locate(out senseBuffer, false, false, true, 0, lba, timeout, out duration); /// /// Positions the medium to the specified block in the specified partition @@ -119,10 +113,8 @@ namespace DiscImageChef.Devices /// Logical block address. /// Timeout. /// Duration. - public bool Locate(out byte[] senseBuffer, byte partition, uint lba, uint timeout, out double duration) - { - return Locate(out senseBuffer, false, false, true, partition, lba, timeout, out duration); - } + public bool Locate(out byte[] senseBuffer, byte partition, uint lba, uint timeout, out double duration) => + Locate(out senseBuffer, false, false, true, partition, lba, timeout, out duration); /// /// Positions the medium to the specified block in the current partition @@ -132,10 +124,8 @@ namespace DiscImageChef.Devices /// Logical block address. /// Timeout. /// Duration. - public bool Locate(out byte[] senseBuffer, bool immediate, uint lba, uint timeout, out double duration) - { - return Locate(out senseBuffer, immediate, false, true, 0, lba, timeout, out duration); - } + public bool Locate(out byte[] senseBuffer, bool immediate, uint lba, uint timeout, out double duration) => + Locate(out senseBuffer, immediate, false, true, 0, lba, timeout, out duration); /// /// Positions the medium to the specified block in the specified partition @@ -147,10 +137,8 @@ namespace DiscImageChef.Devices /// Timeout. /// Duration. public bool Locate(out byte[] senseBuffer, bool immediate, byte partition, uint lba, uint timeout, - out double duration) - { - return Locate(out senseBuffer, immediate, false, true, partition, lba, timeout, out duration); - } + out double duration) => + Locate(out senseBuffer, immediate, false, true, partition, lba, timeout, out duration); /// /// Positions the medium to the specified object identifier @@ -197,11 +185,8 @@ namespace DiscImageChef.Devices /// Logical block address. /// Timeout. /// Duration. - public bool Locate16(out byte[] senseBuffer, ulong lba, uint timeout, out double duration) - { - return Locate16(out senseBuffer, false, false, SscLogicalIdTypes.ObjectId, false, 0, lba, timeout, - out duration); - } + public bool Locate16(out byte[] senseBuffer, ulong lba, uint timeout, out double duration) => + Locate16(out senseBuffer, false, false, SscLogicalIdTypes.ObjectId, false, 0, lba, timeout, out duration); /// /// Positions the medium to the specified block in the specified partition @@ -211,11 +196,9 @@ namespace DiscImageChef.Devices /// Logical block address. /// Timeout. /// Duration. - public bool Locate16(out byte[] senseBuffer, byte partition, ulong lba, uint timeout, out double duration) - { - return Locate16(out senseBuffer, false, true, SscLogicalIdTypes.ObjectId, false, partition, lba, timeout, - out duration); - } + public bool Locate16(out byte[] senseBuffer, byte partition, ulong lba, uint timeout, out double duration) => + Locate16(out senseBuffer, false, true, SscLogicalIdTypes.ObjectId, false, partition, lba, timeout, + out duration); /// /// Positions the medium to the specified block in the current partition @@ -225,11 +208,9 @@ namespace DiscImageChef.Devices /// Logical block address. /// Timeout. /// Duration. - public bool Locate16(out byte[] senseBuffer, bool immediate, ulong lba, uint timeout, out double duration) - { - return Locate16(out senseBuffer, immediate, false, SscLogicalIdTypes.ObjectId, false, 0, lba, timeout, - out duration); - } + public bool Locate16(out byte[] senseBuffer, bool immediate, ulong lba, uint timeout, out double duration) => + Locate16(out senseBuffer, immediate, false, SscLogicalIdTypes.ObjectId, false, 0, lba, timeout, + out duration); /// /// Positions the medium to the specified block in the specified partition @@ -241,11 +222,9 @@ namespace DiscImageChef.Devices /// Timeout. /// Duration. public bool Locate16(out byte[] senseBuffer, bool immediate, byte partition, ulong lba, uint timeout, - out double duration) - { - return Locate16(out senseBuffer, immediate, true, SscLogicalIdTypes.ObjectId, false, partition, lba, - timeout, out duration); - } + out double duration) => + Locate16(out senseBuffer, immediate, true, SscLogicalIdTypes.ObjectId, false, partition, lba, timeout, + out duration); /// /// Positions the medium to the specified object identifier @@ -318,10 +297,8 @@ namespace DiscImageChef.Devices /// Timeout. /// Duration. public bool Read6(out byte[] buffer, out byte[] senseBuffer, bool sili, uint transferLen, uint blockSize, - uint timeout, out double duration) - { - return Read6(out buffer, out senseBuffer, sili, false, transferLen, blockSize, timeout, out duration); - } + uint timeout, out double duration) => + Read6(out buffer, out senseBuffer, sili, false, transferLen, blockSize, timeout, out duration); /// /// Reads the specified number of bytes or of blocks from the medium @@ -376,11 +353,8 @@ namespace DiscImageChef.Devices /// Timeout. /// Duration. public bool Read16(out byte[] buffer, out byte[] senseBuffer, bool sili, ulong objectId, uint blocks, - uint blockSize, uint timeout, out double duration) - { - return Read16(out buffer, out senseBuffer, sili, false, 0, objectId, blocks, blockSize, timeout, - out duration); - } + uint blockSize, uint timeout, out double duration) => + Read16(out buffer, out senseBuffer, sili, false, 0, objectId, blocks, blockSize, timeout, out duration); /// /// Reads a number of fixed-length blocks starting at specified block from the specified partition @@ -396,11 +370,9 @@ namespace DiscImageChef.Devices /// Duration. public bool Read16(out byte[] buffer, out byte[] senseBuffer, bool sili, byte partition, ulong objectId, - uint blocks, uint blockSize, uint timeout, out double duration) - { - return Read16(out buffer, out senseBuffer, sili, false, partition, objectId, blocks, blockSize, timeout, - out duration); - } + uint blocks, uint blockSize, uint timeout, out double duration) => + Read16(out buffer, out senseBuffer, sili, false, partition, objectId, blocks, blockSize, timeout, + out duration); /// /// Reads a number of fixed-length blocks starting at specified object @@ -413,11 +385,8 @@ namespace DiscImageChef.Devices /// Timeout. /// Duration. public bool Read16(out byte[] buffer, out byte[] senseBuffer, ulong objectId, uint blocks, uint blockSize, - uint timeout, out double duration) - { - return Read16(out buffer, out senseBuffer, false, true, 0, objectId, blocks, blockSize, timeout, - out duration); - } + uint timeout, out double duration) => + Read16(out buffer, out senseBuffer, false, true, 0, objectId, blocks, blockSize, timeout, out duration); /// /// Reads a number of fixed-length blocks starting at specified block from the specified partition @@ -432,11 +401,9 @@ namespace DiscImageChef.Devices /// Duration. public bool Read16(out byte[] buffer, out byte[] senseBuffer, byte partition, ulong objectId, uint blocks, - uint blockSize, uint timeout, out double duration) - { - return Read16(out buffer, out senseBuffer, false, true, partition, objectId, blocks, blockSize, timeout, - out duration); - } + uint blockSize, uint timeout, out double duration) => + Read16(out buffer, out senseBuffer, false, true, partition, objectId, blocks, blockSize, timeout, + out duration); /// /// Reads a number of bytes or objects starting at specified object from the specified partition @@ -523,10 +490,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout. /// Duration. - public bool ReadPosition(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) - { - return ReadPosition(out buffer, out senseBuffer, SscPositionForms.Short, timeout, out duration); - } + public bool ReadPosition(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) => + ReadPosition(out buffer, out senseBuffer, SscPositionForms.Short, timeout, out duration); /// /// Reports current reading/writing elements position on the medium using 32 bytes response @@ -535,10 +500,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout. /// Duration. - public bool ReadPositionLong(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) - { - return ReadPosition(out buffer, out senseBuffer, SscPositionForms.Long, timeout, out duration); - } + public bool ReadPositionLong(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) => + ReadPosition(out buffer, out senseBuffer, SscPositionForms.Long, timeout, out duration); /// /// Reports current reading/writing elements position on the medium @@ -622,11 +585,8 @@ namespace DiscImageChef.Devices /// Timeout. /// Duration. public bool ReadReverse6(out byte[] buffer, out byte[] senseBuffer, uint blocks, uint blockSize, uint timeout, - out double duration) - { - return ReadReverse6(out buffer, out senseBuffer, false, false, true, blocks, blockSize, timeout, - out duration); - } + out double duration) => + ReadReverse6(out buffer, out senseBuffer, false, false, true, blocks, blockSize, timeout, out duration); /// /// Reads the specified number of bytes or of blocks from the medium, backwards @@ -640,11 +600,9 @@ namespace DiscImageChef.Devices /// Duration. public bool ReadReverse6(out byte[] buffer, out byte[] senseBuffer, bool sili, uint transferLen, uint blockSize, - uint timeout, out double duration) - { - return ReadReverse6(out buffer, out senseBuffer, false, sili, false, transferLen, blockSize, timeout, - out duration); - } + uint timeout, out double duration) => + ReadReverse6(out buffer, out senseBuffer, false, sili, false, transferLen, blockSize, timeout, + out duration); /// /// Reads the specified number of bytes or of blocks from the medium, backwards @@ -702,11 +660,9 @@ namespace DiscImageChef.Devices /// Duration. public bool ReadReverse16(out byte[] buffer, out byte[] senseBuffer, bool sili, ulong objectId, uint blocks, - uint blockSize, uint timeout, out double duration) - { - return ReadReverse16(out buffer, out senseBuffer, false, sili, false, 0, objectId, blocks, blockSize, - timeout, out duration); - } + uint blockSize, uint timeout, out double duration) => + ReadReverse16(out buffer, out senseBuffer, false, sili, false, 0, objectId, blocks, blockSize, timeout, + out duration); /// /// Reads a number of fixed-length blocks starting at specified block from the specified partition, backwards @@ -722,11 +678,9 @@ namespace DiscImageChef.Devices /// Duration. public bool ReadReverse16(out byte[] buffer, out byte[] senseBuffer, bool sili, byte partition, ulong objectId, - uint blocks, uint blockSize, uint timeout, out double duration) - { - return ReadReverse16(out buffer, out senseBuffer, false, sili, false, partition, objectId, blocks, - blockSize, timeout, out duration); - } + uint blocks, uint blockSize, uint timeout, out double duration) => + ReadReverse16(out buffer, out senseBuffer, false, sili, false, partition, objectId, blocks, blockSize, + timeout, out duration); /// /// Reads a number of fixed-length blocks starting at specified object, backwards @@ -739,11 +693,9 @@ namespace DiscImageChef.Devices /// Timeout. /// Duration. public bool ReadReverse16(out byte[] buffer, out byte[] senseBuffer, ulong objectId, uint blocks, - uint blockSize, uint timeout, out double duration) - { - return ReadReverse16(out buffer, out senseBuffer, false, false, true, 0, objectId, blocks, blockSize, - timeout, out duration); - } + uint blockSize, uint timeout, out double duration) => + ReadReverse16(out buffer, out senseBuffer, false, false, true, 0, objectId, blocks, blockSize, timeout, + out duration); /// /// Reads a number of fixed-length blocks starting at specified block from the specified partition, backwards @@ -757,11 +709,9 @@ namespace DiscImageChef.Devices /// Timeout. /// Duration. public bool ReadReverse16(out byte[] buffer, out byte[] senseBuffer, byte partition, ulong objectId, - uint blocks, uint blockSize, uint timeout, out double duration) - { - return ReadReverse16(out buffer, out senseBuffer, false, false, true, partition, objectId, blocks, - blockSize, timeout, out duration); - } + uint blocks, uint blockSize, uint timeout, out double duration) => + ReadReverse16(out buffer, out senseBuffer, false, false, true, partition, objectId, blocks, blockSize, + timeout, out duration); /// /// Reads a number of bytes or objects starting at specified object from the specified partition, backwards @@ -830,11 +780,8 @@ namespace DiscImageChef.Devices /// Timeout. /// Duration. public bool RecoverBufferedData(out byte[] buffer, out byte[] senseBuffer, uint blocks, uint blockSize, - uint timeout, out double duration) - { - return RecoverBufferedData(out buffer, out senseBuffer, false, true, blocks, blockSize, timeout, - out duration); - } + uint timeout, out double duration) => + RecoverBufferedData(out buffer, out senseBuffer, false, true, blocks, blockSize, timeout, out duration); /// /// Reads the specified number of bytes or of blocks from the device's buffer @@ -847,11 +794,9 @@ namespace DiscImageChef.Devices /// Timeout. /// Duration. public bool RecoverBufferedData(out byte[] buffer, out byte[] senseBuffer, bool sili, uint transferLen, - uint blockSize, uint timeout, out double duration) - { - return RecoverBufferedData(out buffer, out senseBuffer, sili, false, transferLen, blockSize, timeout, - out duration); - } + uint blockSize, uint timeout, out double duration) => + RecoverBufferedData(out buffer, out senseBuffer, sili, false, transferLen, blockSize, timeout, + out duration); /// /// Reads the specified number of bytes or of blocks from the device's buffer @@ -902,10 +847,9 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout. /// Duration. - public bool ReportDensitySupport(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) - { - return ReportDensitySupport(out buffer, out senseBuffer, false, false, timeout, out duration); - } + public bool + ReportDensitySupport(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) => + ReportDensitySupport(out buffer, out senseBuffer, false, false, timeout, out duration); /// /// Requests the device to return descriptors for supported densities or medium types @@ -916,10 +860,8 @@ namespace DiscImageChef.Devices /// Timeout. /// Duration. public bool ReportDensitySupport(out byte[] buffer, out byte[] senseBuffer, bool currentMedia, uint timeout, - out double duration) - { - return ReportDensitySupport(out buffer, out senseBuffer, false, currentMedia, timeout, out duration); - } + out double duration) => + ReportDensitySupport(out buffer, out senseBuffer, false, currentMedia, timeout, out duration); /// /// Requests the device to return descriptors for supported densities or medium types @@ -970,10 +912,8 @@ namespace DiscImageChef.Devices /// Sense buffer. /// Timeout. /// Duration. - public bool Rewind(out byte[] senseBuffer, uint timeout, out double duration) - { - return Rewind(out senseBuffer, false, timeout, out duration); - } + public bool Rewind(out byte[] senseBuffer, uint timeout, out double duration) => + Rewind(out senseBuffer, false, timeout, out duration); /// /// Positions the reading/writing element to the beginning of current partition diff --git a/DiscImageChef.Devices/Device/ScsiCommands/SyQuest.cs b/DiscImageChef.Devices/Device/ScsiCommands/SyQuest.cs index b497ef6d3..7c724e8f8 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands/SyQuest.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands/SyQuest.cs @@ -47,10 +47,8 @@ namespace DiscImageChef.Devices /// Starting block. /// Block size in bytes. public bool SyQuestRead6(out byte[] buffer, out byte[] senseBuffer, uint lba, uint blockSize, uint timeout, - out double duration) - { - return SyQuestRead6(out buffer, out senseBuffer, lba, blockSize, 1, false, false, timeout, out duration); - } + out double duration) => + SyQuestRead6(out buffer, out senseBuffer, lba, blockSize, 1, false, false, timeout, out duration); /// /// Sends the SyQuest READ LONG (6) command @@ -63,10 +61,8 @@ namespace DiscImageChef.Devices /// Starting block. /// Block size in bytes. public bool SyQuestReadLong6(out byte[] buffer, out byte[] senseBuffer, uint lba, uint blockSize, uint timeout, - out double duration) - { - return SyQuestRead6(out buffer, out senseBuffer, lba, blockSize, 1, false, true, timeout, out duration); - } + out double duration) => + SyQuestRead6(out buffer, out senseBuffer, lba, blockSize, 1, false, true, timeout, out duration); /// /// Sends the SyQuest READ (6) command @@ -128,10 +124,8 @@ namespace DiscImageChef.Devices /// Timeout. /// Duration. public bool SyQuestReadUsageCounter(out byte[] buffer, out byte[] senseBuffer, uint timeout, - out double duration) - { - return AdaptecReadUsageCounter(out buffer, out senseBuffer, false, timeout, out duration); - } + out double duration) => + AdaptecReadUsageCounter(out buffer, out senseBuffer, false, timeout, out duration); /// /// Sends the SyQuest READ LONG (10) command @@ -144,10 +138,8 @@ namespace DiscImageChef.Devices /// Starting block. /// Block size in bytes. public bool SyQuestReadLong10(out byte[] buffer, out byte[] senseBuffer, uint lba, uint blockSize, uint timeout, - out double duration) - { - return SyQuestRead10(out buffer, out senseBuffer, lba, blockSize, 1, false, true, timeout, out duration); - } + out double duration) => + SyQuestRead10(out buffer, out senseBuffer, lba, blockSize, 1, false, true, timeout, out duration); /// /// Sends the SyQuest READ (10) command diff --git a/DiscImageChef.Devices/Windows/ListDevices.cs b/DiscImageChef.Devices/Windows/ListDevices.cs index 35d4aee79..aeb3a457f 100644 --- a/DiscImageChef.Devices/Windows/ListDevices.cs +++ b/DiscImageChef.Devices/Windows/ListDevices.cs @@ -33,12 +33,13 @@ using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using System.Linq; using System.Runtime.InteropServices; using System.Text; using Microsoft.Win32.SafeHandles; #if !NETSTANDARD2_0 +using System.Linq; using System.Management; + #endif namespace DiscImageChef.Devices.Windows diff --git a/DiscImageChef.DiscImages/Alcohol120/Constants.cs b/DiscImageChef.DiscImages/Alcohol120/Constants.cs index 73eb68ffa..69b2a06ca 100644 --- a/DiscImageChef.DiscImages/Alcohol120/Constants.cs +++ b/DiscImageChef.DiscImages/Alcohol120/Constants.cs @@ -35,6 +35,8 @@ namespace DiscImageChef.DiscImages public partial class Alcohol120 { readonly byte[] alcoholSignature = - {0x4d, 0x45, 0x44, 0x49, 0x41, 0x20, 0x44, 0x45, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x4f, 0x52}; + { + 0x4d, 0x45, 0x44, 0x49, 0x41, 0x20, 0x44, 0x45, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x4f, 0x52 + }; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Anex86/Read.cs b/DiscImageChef.DiscImages/Anex86/Read.cs index d5d9bbbbc..ab72fc15b 100644 --- a/DiscImageChef.DiscImages/Anex86/Read.cs +++ b/DiscImageChef.DiscImages/Anex86/Read.cs @@ -60,8 +60,8 @@ namespace DiscImageChef.DiscImages handle.Free(); imageInfo.MediaType = Geometry.GetMediaType(((ushort)fdihdr.cylinders, (byte)fdihdr.heads, - (ushort)fdihdr.spt, (uint)fdihdr.bps, MediaEncoding.MFM, - false)); + (ushort)fdihdr.spt, (uint)fdihdr.bps, MediaEncoding.MFM, + false)); if(imageInfo.MediaType == MediaType.Unknown) imageInfo.MediaType = MediaType.GENERIC_HDD; DicConsole.DebugWriteLine("Anex86 plugin", "MediaType: {0}", imageInfo.MediaType); @@ -82,10 +82,7 @@ namespace DiscImageChef.DiscImages return true; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); public byte[] ReadSectors(ulong sectorAddress, uint length) { @@ -106,10 +103,7 @@ namespace DiscImageChef.DiscImages return buffer; } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -121,9 +115,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Anex86/Unsupported.cs b/DiscImageChef.DiscImages/Anex86/Unsupported.cs index 6826a3935..5162a2976 100644 --- a/DiscImageChef.DiscImages/Anex86/Unsupported.cs +++ b/DiscImageChef.DiscImages/Anex86/Unsupported.cs @@ -40,80 +40,50 @@ namespace DiscImageChef.DiscImages { public partial class Anex86 : IWritableImage { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Anex86/Write.cs b/DiscImageChef.DiscImages/Anex86/Write.cs index 7f8f67c29..c1a98e7be 100644 --- a/DiscImageChef.DiscImages/Anex86/Write.cs +++ b/DiscImageChef.DiscImages/Anex86/Write.cs @@ -210,10 +210,7 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetMetadata(ImageInfo metadata) - { - return true; - } + public bool SetMetadata(ImageInfo metadata) => true; public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { @@ -254,16 +251,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Apple2MG/Read.cs b/DiscImageChef.DiscImages/Apple2MG/Read.cs index 2b9c9a2bb..172fa3b6c 100644 --- a/DiscImageChef.DiscImages/Apple2MG/Read.cs +++ b/DiscImageChef.DiscImages/Apple2MG/Read.cs @@ -133,8 +133,12 @@ namespace DiscImageChef.DiscImages tmp[0x11035] == 16 && tmp[0x11036] == 0 && tmp[0x11037] == 1; decodedImage = new byte[imageHeader.DataSize]; offsets = imageHeader.ImageFormat == SectorOrder.Dos - ? (isDos ? deinterleave : interleave) - : (isDos ? interleave : deinterleave); + ? isDos + ? deinterleave + : interleave + : isDos + ? interleave + : deinterleave; for(int t = 0; t < 35; t++) { for(int s = 0; s < 16; s++) @@ -267,10 +271,7 @@ namespace DiscImageChef.DiscImages return true; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); public byte[] ReadSectors(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/Apple2MG/Unsupported.cs b/DiscImageChef.DiscImages/Apple2MG/Unsupported.cs index dad37222d..817408185 100644 --- a/DiscImageChef.DiscImages/Apple2MG/Unsupported.cs +++ b/DiscImageChef.DiscImages/Apple2MG/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class Apple2Mg { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Apple2MG/Write.cs b/DiscImageChef.DiscImages/Apple2MG/Write.cs index df7191208..6e8875a63 100644 --- a/DiscImageChef.DiscImages/Apple2MG/Write.cs +++ b/DiscImageChef.DiscImages/Apple2MG/Write.cs @@ -224,11 +224,7 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) - { - // Geometry is not stored in image - return true; - } + public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { @@ -242,16 +238,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/AppleDOS/Read.cs b/DiscImageChef.DiscImages/AppleDOS/Read.cs index f12c9ffad..b2a7209f3 100644 --- a/DiscImageChef.DiscImages/AppleDOS/Read.cs +++ b/DiscImageChef.DiscImages/AppleDOS/Read.cs @@ -56,8 +56,12 @@ namespace DiscImageChef.DiscImages extension = Path.GetExtension(imageFilter.GetFilename())?.ToLower(); int[] offsets = extension == ".do" - ? (isDos ? deinterleave : interleave) - : (isDos ? interleave : deinterleave); + ? isDos + ? deinterleave + : interleave + : isDos + ? interleave + : deinterleave; for(int t = 0; t < 35; t++) { @@ -80,10 +84,7 @@ namespace DiscImageChef.DiscImages return true; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); public byte[] ReadSectors(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/AppleDOS/Unsupported.cs b/DiscImageChef.DiscImages/AppleDOS/Unsupported.cs index c94ebd72d..359abcc90 100644 --- a/DiscImageChef.DiscImages/AppleDOS/Unsupported.cs +++ b/DiscImageChef.DiscImages/AppleDOS/Unsupported.cs @@ -39,15 +39,9 @@ namespace DiscImageChef.DiscImages { public partial class AppleDos { - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { - return null; - } + public bool? VerifySector(ulong sectorAddress, uint track) => null; public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -71,74 +65,45 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/AppleDOS/Write.cs b/DiscImageChef.DiscImages/AppleDOS/Write.cs index c29a9c53a..bd081af1d 100644 --- a/DiscImageChef.DiscImages/AppleDOS/Write.cs +++ b/DiscImageChef.DiscImages/AppleDOS/Write.cs @@ -86,10 +86,7 @@ namespace DiscImageChef.DiscImages return false; } - public bool WriteSector(byte[] data, ulong sectorAddress) - { - return WriteSectors(data, sectorAddress, 1); - } + public bool WriteSector(byte[] data, ulong sectorAddress) => WriteSectors(data, sectorAddress, 1); public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { @@ -152,8 +149,12 @@ namespace DiscImageChef.DiscImages byte[] tmp = new byte[deinterleaved.Length]; int[] offsets = extension == ".do" - ? (isDos ? deinterleave : interleave) - : (isDos ? interleave : deinterleave); + ? isDos + ? deinterleave + : interleave + : isDos + ? interleave + : deinterleave; for(int t = 0; t < 35; t++) { @@ -172,16 +173,9 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetMetadata(ImageInfo metadata) - { - return true; - } + public bool SetMetadata(ImageInfo metadata) => true; - public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) - { - // Geometry is not stored in image - return true; - } + public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { @@ -195,16 +189,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/AppleNIB/Constants.cs b/DiscImageChef.DiscImages/AppleNIB/Constants.cs index 8938ff5a7..e4121d59c 100644 --- a/DiscImageChef.DiscImages/AppleNIB/Constants.cs +++ b/DiscImageChef.DiscImages/AppleNIB/Constants.cs @@ -40,8 +40,9 @@ namespace DiscImageChef.DiscImages readonly ulong[] dosSkewing = {0, 7, 14, 6, 13, 5, 12, 4, 11, 3, 10, 2, 9, 1, 8, 15}; readonly byte[] dri_string = { - 0x43, 0x4F, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x28, 0x43, 0x29, 0x20, 0x31, 0x39, 0x37, 0x39, - 0x2C, 0x20, 0x44, 0x49, 0x47, 0x49, 0x54, 0x41, 0x4C, 0x20, 0x52, 0x45, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48 + 0x43, 0x4F, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x28, 0x43, 0x29, 0x20, 0x31, 0x39, 0x37, + 0x39, 0x2C, 0x20, 0x44, 0x49, 0x47, 0x49, 0x54, 0x41, 0x4C, 0x20, 0x52, 0x45, 0x53, 0x45, 0x41, 0x52, + 0x43, 0x48 }; readonly byte[] pascal_sign = {0x08, 0xA5, 0x0F, 0x29}; readonly byte[] pascal_string = {0x53, 0x59, 0x53, 0x54, 0x45, 0x2E, 0x41, 0x50, 0x50, 0x4C, 0x45}; diff --git a/DiscImageChef.DiscImages/AppleNIB/Unsupported.cs b/DiscImageChef.DiscImages/AppleNIB/Unsupported.cs index 51ea83b53..d33483251 100644 --- a/DiscImageChef.DiscImages/AppleNIB/Unsupported.cs +++ b/DiscImageChef.DiscImages/AppleNIB/Unsupported.cs @@ -39,60 +39,37 @@ namespace DiscImageChef.DiscImages { public partial class AppleNib { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -105,14 +82,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Apridisk/Constants.cs b/DiscImageChef.DiscImages/Apridisk/Constants.cs index 0e7bad222..371630a57 100644 --- a/DiscImageChef.DiscImages/Apridisk/Constants.cs +++ b/DiscImageChef.DiscImages/Apridisk/Constants.cs @@ -36,14 +36,14 @@ namespace DiscImageChef.DiscImages { readonly byte[] signature = { - 0x41, 0x43, 0x54, 0x20, 0x41, 0x70, 0x72, 0x69, 0x63, 0x6F, 0x74, 0x20, 0x64, 0x69, 0x73, 0x6B, 0x20, 0x69, - 0x6D, 0x61, 0x67, 0x65, 0x1A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00 + 0x41, 0x43, 0x54, 0x20, 0x41, 0x70, 0x72, 0x69, 0x63, 0x6F, 0x74, 0x20, 0x64, 0x69, 0x73, 0x6B, 0x20, + 0x69, 0x6D, 0x61, 0x67, 0x65, 0x1A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Apridisk/Read.cs b/DiscImageChef.DiscImages/Apridisk/Read.cs index 688ea93a8..508f74ebe 100644 --- a/DiscImageChef.DiscImages/Apridisk/Read.cs +++ b/DiscImageChef.DiscImages/Apridisk/Read.cs @@ -206,8 +206,8 @@ namespace DiscImageChef.DiscImages imageInfo.SectorsPerTrack); imageInfo.MediaType = Geometry.GetMediaType(((ushort)imageInfo.Cylinders, (byte)imageInfo.Heads, - (ushort)imageInfo.SectorsPerTrack, 512, MediaEncoding.MFM, - false)); + (ushort)imageInfo.SectorsPerTrack, 512, MediaEncoding.MFM, + false)); imageInfo.ImageSize = (ulong)stream.Length - headersizes; imageInfo.CreationTime = imageFilter.GetCreationTime(); diff --git a/DiscImageChef.DiscImages/Apridisk/Unsupported.cs b/DiscImageChef.DiscImages/Apridisk/Unsupported.cs index 56e197187..f7783d796 100644 --- a/DiscImageChef.DiscImages/Apridisk/Unsupported.cs +++ b/DiscImageChef.DiscImages/Apridisk/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class Apridisk { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Apridisk/Write.cs b/DiscImageChef.DiscImages/Apridisk/Write.cs index a6f0e7b67..e4f046a33 100644 --- a/DiscImageChef.DiscImages/Apridisk/Write.cs +++ b/DiscImageChef.DiscImages/Apridisk/Write.cs @@ -292,16 +292,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/BLU/Read.cs b/DiscImageChef.DiscImages/BLU/Read.cs index e3dfb286c..4ae3f6111 100644 --- a/DiscImageChef.DiscImages/BLU/Read.cs +++ b/DiscImageChef.DiscImages/BLU/Read.cs @@ -138,15 +138,9 @@ namespace DiscImageChef.DiscImages return true; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); public byte[] ReadSectors(ulong sectorAddress, uint length) { @@ -209,10 +203,7 @@ namespace DiscImageChef.DiscImages return buffer.ToArray(); } - public byte[] ReadSectorLong(ulong sectorAddress) - { - return ReadSectorsLong(sectorAddress, 1); - } + public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { @@ -231,10 +222,7 @@ namespace DiscImageChef.DiscImages } // TODO: Check tag checkums - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) diff --git a/DiscImageChef.DiscImages/BLU/Unsupported.cs b/DiscImageChef.DiscImages/BLU/Unsupported.cs index e99e4c7f5..d704494bf 100644 --- a/DiscImageChef.DiscImages/BLU/Unsupported.cs +++ b/DiscImageChef.DiscImages/BLU/Unsupported.cs @@ -39,55 +39,34 @@ namespace DiscImageChef.DiscImages { public partial class Blu { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress, uint track) - { - return null; - } + public bool? VerifySector(ulong sectorAddress, uint track) => null; public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, out List unknownLbas) @@ -100,9 +79,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/BLU/Write.cs b/DiscImageChef.DiscImages/BLU/Write.cs index 55eec7674..4861ad4c2 100644 --- a/DiscImageChef.DiscImages/BLU/Write.cs +++ b/DiscImageChef.DiscImages/BLU/Write.cs @@ -366,16 +366,9 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetMetadata(ImageInfo metadata) - { - return true; - } + public bool SetMetadata(ImageInfo metadata) => true; - public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) - { - // Geometry is not stored in image - return true; - } + public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { @@ -389,16 +382,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/BlindWrite4/Constants.cs b/DiscImageChef.DiscImages/BlindWrite4/Constants.cs index 72628961b..faa5f5b44 100644 --- a/DiscImageChef.DiscImages/BlindWrite4/Constants.cs +++ b/DiscImageChef.DiscImages/BlindWrite4/Constants.cs @@ -37,8 +37,8 @@ namespace DiscImageChef.DiscImages /// "BLINDWRITE TOC FILE" readonly byte[] bw4Signature = { - 0x42, 0x4C, 0x49, 0x4E, 0x44, 0x57, 0x52, 0x49, 0x54, 0x45, 0x20, 0x54, 0x4F, 0x43, 0x20, 0x46, 0x49, 0x4C, - 0x45 + 0x42, 0x4C, 0x49, 0x4E, 0x44, 0x57, 0x52, 0x49, 0x54, 0x45, 0x20, 0x54, 0x4F, 0x43, 0x20, 0x46, 0x49, + 0x4C, 0x45 }; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/BlindWrite4/Read.cs b/DiscImageChef.DiscImages/BlindWrite4/Read.cs index f29d858b0..87e28f513 100644 --- a/DiscImageChef.DiscImages/BlindWrite4/Read.cs +++ b/DiscImageChef.DiscImages/BlindWrite4/Read.cs @@ -604,9 +604,7 @@ namespace DiscImageChef.DiscImages { Session session = new Session { - SessionSequence = i, - StartTrack = uint.MaxValue, - StartSector = uint.MaxValue + SessionSequence = i, StartTrack = uint.MaxValue, StartSector = uint.MaxValue }; foreach(Track track in Tracks.Where(track => track.TrackSession == i)) @@ -689,25 +687,14 @@ namespace DiscImageChef.DiscImages } } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); - public byte[] ReadSector(ulong sectorAddress, uint track) - { - return ReadSectors(sectorAddress, 1, track); - } + public byte[] ReadSector(ulong sectorAddress, uint track) => ReadSectors(sectorAddress, 1, track); - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, track, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => + ReadSectorsTag(sectorAddress, 1, track, tag); public byte[] ReadSectors(ulong sectorAddress, uint length) { @@ -970,15 +957,9 @@ namespace DiscImageChef.DiscImages return buffer; } - public byte[] ReadSectorLong(ulong sectorAddress) - { - return ReadSectorsLong(sectorAddress, 1); - } + public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { - return ReadSectorsLong(sectorAddress, 1, track); - } + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => ReadSectorsLong(sectorAddress, 1, track); public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { @@ -1124,9 +1105,6 @@ namespace DiscImageChef.DiscImages return failingLbas.Count <= 0; } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/BlindWrite5/Constants.cs b/DiscImageChef.DiscImages/BlindWrite5/Constants.cs index 46370ca14..58484df7b 100644 --- a/DiscImageChef.DiscImages/BlindWrite5/Constants.cs +++ b/DiscImageChef.DiscImages/BlindWrite5/Constants.cs @@ -36,9 +36,13 @@ namespace DiscImageChef.DiscImages { /// "BWT5 STREAM FOOT" readonly byte[] bw5Footer = - {0x42, 0x57, 0x54, 0x35, 0x20, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4D, 0x20, 0x46, 0x4F, 0x4F, 0x54}; + { + 0x42, 0x57, 0x54, 0x35, 0x20, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4D, 0x20, 0x46, 0x4F, 0x4F, 0x54 + }; /// "BWT5 STREAM SIGN" readonly byte[] bw5Signature = - {0x42, 0x57, 0x54, 0x35, 0x20, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4D, 0x20, 0x53, 0x49, 0x47, 0x4E}; + { + 0x42, 0x57, 0x54, 0x35, 0x20, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4D, 0x20, 0x53, 0x49, 0x47, 0x4E + }; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/CDRDAO/Helpers.cs b/DiscImageChef.DiscImages/CDRDAO/Helpers.cs index b10b6833b..059e66df7 100644 --- a/DiscImageChef.DiscImages/CDRDAO/Helpers.cs +++ b/DiscImageChef.DiscImages/CDRDAO/Helpers.cs @@ -85,10 +85,8 @@ namespace DiscImageChef.DiscImages } } - static (byte minute, byte second, byte frame) LbaToMsf(ulong sector) - { - return ((byte)(sector / 75 / 60), (byte)(sector / 75 % 60), (byte)(sector % 75)); - } + static (byte minute, byte second, byte frame) LbaToMsf(ulong sector) => + ((byte)(sector / 75 / 60), (byte)(sector / 75 % 60), (byte)(sector % 75)); static string GetTrackMode(Track track) { diff --git a/DiscImageChef.DiscImages/CDRDAO/Read.cs b/DiscImageChef.DiscImages/CDRDAO/Read.cs index 2db0ef087..a9c199637 100644 --- a/DiscImageChef.DiscImages/CDRDAO/Read.cs +++ b/DiscImageChef.DiscImages/CDRDAO/Read.cs @@ -762,25 +762,14 @@ namespace DiscImageChef.DiscImages } } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); - public byte[] ReadSector(ulong sectorAddress, uint track) - { - return ReadSectors(sectorAddress, 1, track); - } + public byte[] ReadSector(ulong sectorAddress, uint track) => ReadSectors(sectorAddress, 1, track); - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, track, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => + ReadSectorsTag(sectorAddress, 1, track, tag); public byte[] ReadSectors(ulong sectorAddress, uint length) { @@ -1079,15 +1068,9 @@ namespace DiscImageChef.DiscImages return buffer; } - public byte[] ReadSectorLong(ulong sectorAddress) - { - return ReadSectorsLong(sectorAddress, 1); - } + public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { - return ReadSectorsLong(sectorAddress, 1, track); - } + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => ReadSectorsLong(sectorAddress, 1, track); public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { @@ -1195,10 +1178,7 @@ namespace DiscImageChef.DiscImages return swapped; } - public List GetSessionTracks(Session session) - { - return GetSessionTracks(session.SessionSequence); - } + public List GetSessionTracks(Session session) => GetSessionTracks(session.SessionSequence); public List GetSessionTracks(ushort session) { diff --git a/DiscImageChef.DiscImages/CDRDAO/Unsupported.cs b/DiscImageChef.DiscImages/CDRDAO/Unsupported.cs index e8711c3a9..c39fe2bcd 100644 --- a/DiscImageChef.DiscImages/CDRDAO/Unsupported.cs +++ b/DiscImageChef.DiscImages/CDRDAO/Unsupported.cs @@ -34,9 +34,6 @@ namespace DiscImageChef.DiscImages { public partial class Cdrdao { - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/CDRDAO/Write.cs b/DiscImageChef.DiscImages/CDRDAO/Write.cs index 612389654..44b28946a 100644 --- a/DiscImageChef.DiscImages/CDRDAO/Write.cs +++ b/DiscImageChef.DiscImages/CDRDAO/Write.cs @@ -683,16 +683,8 @@ namespace DiscImageChef.DiscImages } } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/CDRWin/Helpers.cs b/DiscImageChef.DiscImages/CDRWin/Helpers.cs index 9b26da505..51ba9d479 100644 --- a/DiscImageChef.DiscImages/CDRWin/Helpers.cs +++ b/DiscImageChef.DiscImages/CDRWin/Helpers.cs @@ -144,10 +144,8 @@ namespace DiscImageChef.DiscImages } } - static (byte minute, byte second, byte frame) LbaToMsf(ulong sector) - { - return ((byte)(sector / 75 / 60), (byte)(sector / 75 % 60), (byte)(sector % 75)); - } + static (byte minute, byte second, byte frame) LbaToMsf(ulong sector) => + ((byte)(sector / 75 / 60), (byte)(sector / 75 % 60), (byte)(sector % 75)); static string GetTrackMode(Track track) { diff --git a/DiscImageChef.DiscImages/CDRWin/Read.cs b/DiscImageChef.DiscImages/CDRWin/Read.cs index 5ac44f289..86300c1e1 100644 --- a/DiscImageChef.DiscImages/CDRWin/Read.cs +++ b/DiscImageChef.DiscImages/CDRWin/Read.cs @@ -92,9 +92,7 @@ namespace DiscImageChef.DiscImages // Initialize disc discimage = new CdrWinDisc { - Sessions = new List(), - Tracks = new List(), - Comment = "" + Sessions = new List(), Tracks = new List(), Comment = "" }; CdrWinTrack currenttrack = new CdrWinTrack {Indexes = new Dictionary()}; @@ -953,25 +951,14 @@ namespace DiscImageChef.DiscImages } } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); - public byte[] ReadSector(ulong sectorAddress, uint track) - { - return ReadSectors(sectorAddress, 1, track); - } + public byte[] ReadSector(ulong sectorAddress, uint track) => ReadSectors(sectorAddress, 1, track); - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, track, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => + ReadSectorsTag(sectorAddress, 1, track, tag); public byte[] ReadSectors(ulong sectorAddress, uint length) { @@ -1287,15 +1274,9 @@ namespace DiscImageChef.DiscImages return buffer; } - public byte[] ReadSectorLong(ulong sectorAddress) - { - return ReadSectorsLong(sectorAddress, 1); - } + public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { - return ReadSectorsLong(sectorAddress, 1, track); - } + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => ReadSectorsLong(sectorAddress, 1, track); public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/CDRWin/Unsupported.cs b/DiscImageChef.DiscImages/CDRWin/Unsupported.cs index 60b8eb35b..1762f4fe3 100644 --- a/DiscImageChef.DiscImages/CDRWin/Unsupported.cs +++ b/DiscImageChef.DiscImages/CDRWin/Unsupported.cs @@ -34,9 +34,6 @@ namespace DiscImageChef.DiscImages { public partial class CdrWin { - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/CDRWin/Write.cs b/DiscImageChef.DiscImages/CDRWin/Write.cs index be49a996c..5e073e1ac 100644 --- a/DiscImageChef.DiscImages/CDRWin/Write.cs +++ b/DiscImageChef.DiscImages/CDRWin/Write.cs @@ -88,9 +88,7 @@ namespace DiscImageChef.DiscImages discimage = new CdrWinDisc { - Disktype = mediaType, - Sessions = new List(), - Tracks = new List() + Disktype = mediaType, Sessions = new List(), Tracks = new List() }; trackFlags = new Dictionary(); @@ -480,22 +478,12 @@ namespace DiscImageChef.DiscImages } } - public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) - { - return WriteSectorTag(data, sectorAddress, tag); - } + public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) => + WriteSectorTag(data, sectorAddress, tag); - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; public bool SetMetadata(ImageInfo metadata) { diff --git a/DiscImageChef.DiscImages/CHD/Read.cs b/DiscImageChef.DiscImages/CHD/Read.cs index b45de9956..64a030c7b 100644 --- a/DiscImageChef.DiscImages/CHD/Read.cs +++ b/DiscImageChef.DiscImages/CHD/Read.cs @@ -44,6 +44,7 @@ using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Interfaces; using DiscImageChef.CommonTypes.Structs; using DiscImageChef.Console; +using DiscImageChef.Decoders.ATA; namespace DiscImageChef.DiscImages { @@ -901,7 +902,7 @@ namespace DiscImageChef.DiscImages break; // "IDNT" case HARD_DISK_IDENT_METADATA: - Decoders.ATA.Identify.IdentifyDevice? idnt = Decoders.ATA.Identify.Decode(meta); + Identify.IdentifyDevice? idnt = Decoders.ATA.Identify.Decode(meta); if(idnt.HasValue) { imageInfo.MediaManufacturer = idnt.Value.MediaManufacturer; diff --git a/DiscImageChef.DiscImages/CPCDSK/Constants.cs b/DiscImageChef.DiscImages/CPCDSK/Constants.cs index 22ec93655..f8357bc10 100644 --- a/DiscImageChef.DiscImages/CPCDSK/Constants.cs +++ b/DiscImageChef.DiscImages/CPCDSK/Constants.cs @@ -39,24 +39,24 @@ namespace DiscImageChef.DiscImages /// readonly byte[] cpcdskId = { - 0x4D, 0x56, 0x20, 0x2D, 0x20, 0x43, 0x50, 0x43, 0x45, 0x4D, 0x55, 0x20, 0x44, 0x69, 0x73, 0x6B, 0x2D, 0x46, - 0x69, 0x6C, 0x65 + 0x4D, 0x56, 0x20, 0x2D, 0x20, 0x43, 0x50, 0x43, 0x45, 0x4D, 0x55, 0x20, 0x44, 0x69, 0x73, 0x6B, 0x2D, + 0x46, 0x69, 0x6C, 0x65 }; /// /// Identifier for DU54 disk images, "MV - CPC format Disk Image (DU54)" /// readonly byte[] du54Id = { - 0x4D, 0x56, 0x20, 0x2D, 0x20, 0x43, 0x50, 0x43, 0x20, 0x66, 0x6F, 0x72, 0x6D, 0x61, 0x74, 0x20, 0x44, 0x69, - 0x73, 0x6B, 0x20 + 0x4D, 0x56, 0x20, 0x2D, 0x20, 0x43, 0x50, 0x43, 0x20, 0x66, 0x6F, 0x72, 0x6D, 0x61, 0x74, 0x20, 0x44, + 0x69, 0x73, 0x6B, 0x20 }; /// /// Identifier for Extended CPCEMU disk images, "EXTENDED CPC DSK File" /// readonly byte[] edskId = { - 0x45, 0x58, 0x54, 0x45, 0x4E, 0x44, 0x45, 0x44, 0x20, 0x43, 0x50, 0x43, 0x20, 0x44, 0x53, 0x4B, 0x20, 0x46, - 0x69, 0x6C, 0x65 + 0x45, 0x58, 0x54, 0x45, 0x4E, 0x44, 0x45, 0x44, 0x20, 0x43, 0x50, 0x43, 0x20, 0x44, 0x53, 0x4B, 0x20, + 0x46, 0x69, 0x6C, 0x65 }; /// /// Identifier for track information, "Track-Info\r\n" diff --git a/DiscImageChef.DiscImages/CPCDSK/Unsupported.cs b/DiscImageChef.DiscImages/CPCDSK/Unsupported.cs index e2d1186ed..fe8e3da90 100644 --- a/DiscImageChef.DiscImages/CPCDSK/Unsupported.cs +++ b/DiscImageChef.DiscImages/CPCDSK/Unsupported.cs @@ -39,70 +39,43 @@ namespace DiscImageChef.DiscImages { public partial class Cpcdsk { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -115,14 +88,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/CisCopy/Read.cs b/DiscImageChef.DiscImages/CisCopy/Read.cs index 08d177d86..6d881ac6d 100644 --- a/DiscImageChef.DiscImages/CisCopy/Read.cs +++ b/DiscImageChef.DiscImages/CisCopy/Read.cs @@ -180,10 +180,7 @@ namespace DiscImageChef.DiscImages return true; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); public byte[] ReadSectors(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/CisCopy/Unsupported.cs b/DiscImageChef.DiscImages/CisCopy/Unsupported.cs index 688c984e4..ca219bc0a 100644 --- a/DiscImageChef.DiscImages/CisCopy/Unsupported.cs +++ b/DiscImageChef.DiscImages/CisCopy/Unsupported.cs @@ -39,80 +39,48 @@ namespace DiscImageChef.DiscImages { public partial class CisCopy { - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { - return null; - } + public bool? VerifySector(ulong sectorAddress, uint track) => null; public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -136,9 +104,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/CisCopy/Write.cs b/DiscImageChef.DiscImages/CisCopy/Write.cs index bc09063d3..b8e9a7b26 100644 --- a/DiscImageChef.DiscImages/CisCopy/Write.cs +++ b/DiscImageChef.DiscImages/CisCopy/Write.cs @@ -225,16 +225,9 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetMetadata(ImageInfo metadata) - { - return true; - } + public bool SetMetadata(ImageInfo metadata) => true; - public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) - { - // Geometry is not stored in image - return true; - } + public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { @@ -248,16 +241,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/CloneCD/Helpers.cs b/DiscImageChef.DiscImages/CloneCD/Helpers.cs index 4ab96001b..58c642cfd 100644 --- a/DiscImageChef.DiscImages/CloneCD/Helpers.cs +++ b/DiscImageChef.DiscImages/CloneCD/Helpers.cs @@ -34,19 +34,12 @@ namespace DiscImageChef.DiscImages { public partial class CloneCd { - static ulong GetLba(int minute, int second, int frame) - { - return (ulong)(minute * 60 * 75 + second * 75 + frame - 150); - } + static ulong GetLba(int minute, int second, int frame) => (ulong)(minute * 60 * 75 + second * 75 + frame - 150); - static long MsfToLba((byte minute, byte second, byte frame) msf) - { - return msf.minute * 60 * 75 + msf.second * 75 + msf.frame - 150; - } + static long MsfToLba((byte minute, byte second, byte frame) msf) => + msf.minute * 60 * 75 + msf.second * 75 + msf.frame - 150; - static (byte minute, byte second, byte frame) LbaToMsf(ulong sector) - { - return ((byte)((sector + 150) / 75 / 60), (byte)((sector + 150) / 75 % 60), (byte)((sector + 150) % 75)); - } + static (byte minute, byte second, byte frame) LbaToMsf(ulong sector) => + ((byte)((sector + 150) / 75 / 60), (byte)((sector + 150) / 75 % 60), (byte)((sector + 150) % 75)); } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/CloneCD/Read.cs b/DiscImageChef.DiscImages/CloneCD/Read.cs index 7cfb4fb70..a9bd2b4d8 100644 --- a/DiscImageChef.DiscImages/CloneCD/Read.cs +++ b/DiscImageChef.DiscImages/CloneCD/Read.cs @@ -609,9 +609,7 @@ namespace DiscImageChef.DiscImages Sessions = new List(); Session currentSession = new Session { - EndTrack = uint.MinValue, - StartTrack = uint.MaxValue, - SessionSequence = 1 + EndTrack = uint.MinValue, StartTrack = uint.MaxValue, SessionSequence = 1 }; Partitions = new List(); offsetmap = new Dictionary(); @@ -647,7 +645,8 @@ namespace DiscImageChef.DiscImages { Description = track.TrackDescription, Size = - (track.TrackEndSector - track.TrackStartSector + 1) * (ulong)track.TrackRawBytesPerSector, + (track.TrackEndSector - track.TrackStartSector + 1) * + (ulong)track.TrackRawBytesPerSector, Length = track.TrackEndSector - track.TrackStartSector + 1, Sequence = track.TrackSequence, Offset = track.TrackFileOffset, @@ -731,25 +730,14 @@ namespace DiscImageChef.DiscImages } } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); - public byte[] ReadSector(ulong sectorAddress, uint track) - { - return ReadSectors(sectorAddress, 1, track); - } + public byte[] ReadSector(ulong sectorAddress, uint track) => ReadSectors(sectorAddress, 1, track); - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, track, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => + ReadSectorsTag(sectorAddress, 1, track, tag); public byte[] ReadSectors(ulong sectorAddress, uint length) { @@ -1100,15 +1088,9 @@ namespace DiscImageChef.DiscImages return buffer; } - public byte[] ReadSectorLong(ulong sectorAddress) - { - return ReadSectorsLong(sectorAddress, 1); - } + public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { - return ReadSectorsLong(sectorAddress, 1, track); - } + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => ReadSectorsLong(sectorAddress, 1, track); public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/CloneCD/Unsupported.cs b/DiscImageChef.DiscImages/CloneCD/Unsupported.cs index 6e8e4b241..d5071a415 100644 --- a/DiscImageChef.DiscImages/CloneCD/Unsupported.cs +++ b/DiscImageChef.DiscImages/CloneCD/Unsupported.cs @@ -34,9 +34,6 @@ namespace DiscImageChef.DiscImages { public partial class CloneCd { - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/CloneCD/Write.cs b/DiscImageChef.DiscImages/CloneCD/Write.cs index 929a96845..462a9221c 100644 --- a/DiscImageChef.DiscImages/CloneCD/Write.cs +++ b/DiscImageChef.DiscImages/CloneCD/Write.cs @@ -410,9 +410,9 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < toc.TrackDescriptors.Length; i++) { long alba = MsfToLba((toc.TrackDescriptors[i].Min, toc.TrackDescriptors[i].Sec, - toc.TrackDescriptors[i].Frame)); + toc.TrackDescriptors[i].Frame)); long plba = MsfToLba((toc.TrackDescriptors[i].PMIN, toc.TrackDescriptors[i].PSEC, - toc.TrackDescriptors[i].PFRAME)); + toc.TrackDescriptors[i].PFRAME)); if(alba > 405000) alba = (alba - 405000 + 300) * -1; if(plba > 405000) plba = (plba - 405000 + 300) * -1; @@ -444,10 +444,7 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetMetadata(ImageInfo metadata) - { - return true; - } + public bool SetMetadata(ImageInfo metadata) => true; public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { @@ -587,16 +584,8 @@ namespace DiscImageChef.DiscImages } } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/CopyQM/Constants.cs b/DiscImageChef.DiscImages/CopyQM/Constants.cs index 0792000b7..736b074ff 100644 --- a/DiscImageChef.DiscImages/CopyQM/Constants.cs +++ b/DiscImageChef.DiscImages/CopyQM/Constants.cs @@ -47,35 +47,38 @@ namespace DiscImageChef.DiscImages readonly uint[] copyQmCrcTable = { - 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, - 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, - 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, - 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, - 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, - 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, - 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, - 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, - 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, - 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, - 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, - 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, - 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, - 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, - 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, - 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, - 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, - 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, - 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, - 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, - 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, - 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, - 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, - 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, - 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, - 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, - 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, - 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, - 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D }; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/CopyQM/Read.cs b/DiscImageChef.DiscImages/CopyQM/Read.cs index fc418b529..fbaf10967 100644 --- a/DiscImageChef.DiscImages/CopyQM/Read.cs +++ b/DiscImageChef.DiscImages/CopyQM/Read.cs @@ -155,8 +155,8 @@ namespace DiscImageChef.DiscImages imageInfo.SectorSize = header.sectorSize; imageInfo.MediaType = Geometry.GetMediaType(((ushort)header.totalCylinders, (byte)header.heads, - header.sectorsPerTrack, (uint)header.sectorSize, - MediaEncoding.MFM, false)); + header.sectorsPerTrack, (uint)header.sectorSize, + MediaEncoding.MFM, false)); switch(imageInfo.MediaType) { @@ -187,15 +187,9 @@ namespace DiscImageChef.DiscImages return true; } - public bool? VerifyMediaImage() - { - return calculatedDataCrc == header.crc && headerChecksumOk; - } + public bool? VerifyMediaImage() => calculatedDataCrc == header.crc && headerChecksumOk; - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); public byte[] ReadSectors(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/CopyQM/Unsupported.cs b/DiscImageChef.DiscImages/CopyQM/Unsupported.cs index 670ba171a..9805f6ae5 100644 --- a/DiscImageChef.DiscImages/CopyQM/Unsupported.cs +++ b/DiscImageChef.DiscImages/CopyQM/Unsupported.cs @@ -39,80 +39,48 @@ namespace DiscImageChef.DiscImages { public partial class CopyQm { - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { - return null; - } + public bool? VerifySector(ulong sectorAddress, uint track) => null; public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) diff --git a/DiscImageChef.DiscImages/D88/Read.cs b/DiscImageChef.DiscImages/D88/Read.cs index 9e07012c5..a95f2878f 100644 --- a/DiscImageChef.DiscImages/D88/Read.cs +++ b/DiscImageChef.DiscImages/D88/Read.cs @@ -323,10 +323,7 @@ namespace DiscImageChef.DiscImages return true; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); public byte[] ReadSectors(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/D88/Unsupported.cs b/DiscImageChef.DiscImages/D88/Unsupported.cs index 56ce54752..9fab6c60c 100644 --- a/DiscImageChef.DiscImages/D88/Unsupported.cs +++ b/DiscImageChef.DiscImages/D88/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class D88 { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/DART/Read.cs b/DiscImageChef.DiscImages/DART/Read.cs index 922ad8ca7..c33928b91 100644 --- a/DiscImageChef.DiscImages/DART/Read.cs +++ b/DiscImageChef.DiscImages/DART/Read.cs @@ -287,15 +287,9 @@ namespace DiscImageChef.DiscImages return true; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); public byte[] ReadSectors(ulong sectorAddress, uint length) { @@ -333,10 +327,7 @@ namespace DiscImageChef.DiscImages return buffer; } - public byte[] ReadSectorLong(ulong sectorAddress) - { - return ReadSectorsLong(sectorAddress, 1); - } + public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/DART/Unsupported.cs b/DiscImageChef.DiscImages/DART/Unsupported.cs index eca008cd5..25dd4dc1b 100644 --- a/DiscImageChef.DiscImages/DART/Unsupported.cs +++ b/DiscImageChef.DiscImages/DART/Unsupported.cs @@ -39,60 +39,37 @@ namespace DiscImageChef.DiscImages { public partial class Dart { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -105,14 +82,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/DIM/Read.cs b/DiscImageChef.DiscImages/DIM/Read.cs index ddfabda64..bee619117 100644 --- a/DiscImageChef.DiscImages/DIM/Read.cs +++ b/DiscImageChef.DiscImages/DIM/Read.cs @@ -196,10 +196,7 @@ namespace DiscImageChef.DiscImages return true; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); public byte[] ReadSectors(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/DIM/Unsupported.cs b/DiscImageChef.DiscImages/DIM/Unsupported.cs index 3426174ea..1e17101f3 100644 --- a/DiscImageChef.DiscImages/DIM/Unsupported.cs +++ b/DiscImageChef.DiscImages/DIM/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class Dim { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/DiscFerret/Read.cs b/DiscImageChef.DiscImages/DiscFerret/Read.cs index 209a4977e..ed3ce1703 100644 --- a/DiscImageChef.DiscImages/DiscFerret/Read.cs +++ b/DiscImageChef.DiscImages/DiscFerret/Read.cs @@ -113,50 +113,31 @@ namespace DiscImageChef.DiscImages throw new NotImplementedException("Flux decoding is not yet implemented."); } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public byte[] ReadSectors(ulong sectorAddress, uint length) - { + public byte[] ReadSectors(ulong sectorAddress, uint length) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public bool? VerifySector(ulong sectorAddress) - { + public bool? VerifySector(ulong sectorAddress) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/DiscFerret/Unsupported.cs b/DiscImageChef.DiscImages/DiscFerret/Unsupported.cs index 4bdc3d818..74707689d 100644 --- a/DiscImageChef.DiscImages/DiscFerret/Unsupported.cs +++ b/DiscImageChef.DiscImages/DiscFerret/Unsupported.cs @@ -39,60 +39,38 @@ namespace DiscImageChef.DiscImages { public partial class DiscFerret { - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { + public bool? VerifyMediaImage() => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/DiscImageChef.DiscImages.csproj b/DiscImageChef.DiscImages/DiscImageChef.DiscImages.csproj index ffdcd9429..685416fbc 100644 --- a/DiscImageChef.DiscImages/DiscImageChef.DiscImages.csproj +++ b/DiscImageChef.DiscImages/DiscImageChef.DiscImages.csproj @@ -325,7 +325,6 @@ - diff --git a/DiscImageChef.DiscImages/DiscImageChef/CdEcc.cs b/DiscImageChef.DiscImages/DiscImageChef/CdEcc.cs index 5258cd815..e1f0b7299 100644 --- a/DiscImageChef.DiscImages/DiscImageChef/CdEcc.cs +++ b/DiscImageChef.DiscImages/DiscImageChef/CdEcc.cs @@ -174,10 +174,8 @@ namespace DiscImageChef.DiscImages WriteEcc(address, data, 52, 43, 86, 88, ref ecc, addressOffset, dataOffset, eccOffset + 0xAC); // Q } - static (byte minute, byte second, byte frame) LbaToMsf(long pos) - { - return ((byte)((pos + 150) / 75 / 60), (byte)((pos + 150) / 75 % 60), (byte)((pos + 150) % 75)); - } + static (byte minute, byte second, byte frame) LbaToMsf(long pos) => + ((byte)((pos + 150) / 75 / 60), (byte)((pos + 150) / 75 % 60), (byte)((pos + 150) % 75)); void ReconstructPrefix(ref byte[] sector, // must point to a full 2352-byte sector TrackType type, long lba) diff --git a/DiscImageChef.DiscImages/DiscImageChef/DiscImageChef.cs b/DiscImageChef.DiscImages/DiscImageChef/DiscImageChef.cs index ec4d0d4e2..77f0d8e44 100644 --- a/DiscImageChef.DiscImages/DiscImageChef/DiscImageChef.cs +++ b/DiscImageChef.DiscImages/DiscImageChef/DiscImageChef.cs @@ -130,7 +130,8 @@ namespace DiscImageChef.DiscImages Md5Context md5Provider; /// Cache of media tags. Dictionary mediaTags; - bool nocompress; + byte[] mode2Subheaders; + bool nocompress; /// If DDT is on-disk, this is the image stream offset at which it starts. long outMemoryDdtPosition; bool rewinded; @@ -161,7 +162,6 @@ namespace DiscImageChef.DiscImages ulong[] userDataDdt; bool writingLong; ulong writtenSectors; - byte[] mode2Subheaders; public DiscImageChef() { diff --git a/DiscImageChef.DiscImages/DiscImageChef/Properties.cs b/DiscImageChef.DiscImages/DiscImageChef/Properties.cs index bd74283de..1240a2408 100644 --- a/DiscImageChef.DiscImages/DiscImageChef/Properties.cs +++ b/DiscImageChef.DiscImages/DiscImageChef/Properties.cs @@ -61,20 +61,20 @@ namespace DiscImageChef.DiscImages new[] { ("sectors_per_block", typeof(uint), - "How many sectors to store per block (will be rounded to next power of two)", 4096U), + "How many sectors to store per block (will be rounded to next power of two)", 4096U), ("dictionary", typeof(uint), "Size, in bytes, of the LZMA dictionary", (uint)(1 << 25)), ("max_ddt_size", typeof(uint), - "Maximum size, in mebibytes, for in-memory DDT. If image needs a bigger one, it will be on-disk", - 256U), + "Maximum size, in mebibytes, for in-memory DDT. If image needs a bigger one, it will be on-disk", + 256U), ("md5", typeof(bool), "Calculate and store MD5 of image's user data", (object)false), ("sha1", typeof(bool), "Calculate and store SHA1 of image's user data", (object)false), ("sha256", typeof(bool), "Calculate and store SHA256 of image's user data", (object)false), ("spamsum", typeof(bool), "Calculate and store SpamSum of image's user data", (object)false), ("deduplicate", typeof(bool), - "Store only unique sectors. This consumes more memory and is slower, but it's enabled by default", - (object)true), + "Store only unique sectors. This consumes more memory and is slower, but it's enabled by default", + (object)true), ("nocompress", typeof(bool), - "Don't compress user data blocks. Other blocks will still be compressed", (object)false) + "Don't compress user data blocks. Other blocks will still be compressed", (object)false) }; public IEnumerable KnownExtensions => new[] {".dicf"}; public bool IsWriting { get; private set; } diff --git a/DiscImageChef.DiscImages/DiscImageChef/Read.cs b/DiscImageChef.DiscImages/DiscImageChef/Read.cs index 024b66a0f..bd5005b79 100644 --- a/DiscImageChef.DiscImages/DiscImageChef/Read.cs +++ b/DiscImageChef.DiscImages/DiscImageChef/Read.cs @@ -732,8 +732,7 @@ namespace DiscImageChef.DiscImages DumpHardwareType dump = new DumpHardwareType { - Software = new SoftwareType(), - Extents = new ExtentType[dumpEntry.extents] + Software = new SoftwareType(), Extents = new ExtentType[dumpEntry.extents] }; byte[] tmp; @@ -808,8 +807,7 @@ namespace DiscImageChef.DiscImages imageStream.Read(tmp, 0, tmp.Length); dump.Extents[j] = new ExtentType { - Start = BitConverter.ToUInt64(tmp, 0), - End = BitConverter.ToUInt64(tmp, 8) + Start = BitConverter.ToUInt64(tmp, 0), End = BitConverter.ToUInt64(tmp, 8) }; } @@ -879,8 +877,9 @@ namespace DiscImageChef.DiscImages SessionSequence = (ushort)i, StartTrack = Tracks.Where(t => t.TrackSession == i).Min(t => t.TrackSequence), EndTrack = Tracks.Where(t => t.TrackSession == i).Max(t => t.TrackSequence), - StartSector = Tracks.Where(t => t.TrackSession == i).Min(t => t.TrackStartSector), - EndSector = Tracks.Where(t => t.TrackSession == i).Max(t => t.TrackEndSector) + StartSector = + Tracks.Where(t => t.TrackSession == i).Min(t => t.TrackStartSector), + EndSector = Tracks.Where(t => t.TrackSession == i).Max(t => t.TrackEndSector) }); ulong currentTrackOffset = 0; @@ -895,7 +894,7 @@ namespace DiscImageChef.DiscImages Offset = currentTrackOffset, Start = track.TrackStartSector, Size = (track.TrackEndSector - track.TrackStartSector + 1) * - (ulong)track.TrackBytesPerSector, + (ulong)track.TrackBytesPerSector, Length = track.TrackEndSector - track.TrackStartSector + 1, Scheme = "Optical disc track" }); @@ -1033,10 +1032,7 @@ namespace DiscImageChef.DiscImages return sector; } - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); public byte[] ReadSector(ulong sectorAddress, uint track) { diff --git a/DiscImageChef.DiscImages/DiscJuggler/DiscJuggler.cs b/DiscImageChef.DiscImages/DiscJuggler/DiscJuggler.cs index a5e413c90..957905adc 100644 --- a/DiscImageChef.DiscImages/DiscJuggler/DiscJuggler.cs +++ b/DiscImageChef.DiscImages/DiscJuggler/DiscJuggler.cs @@ -30,20 +30,11 @@ // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ -using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using DiscImageChef.Checksums; -using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Interfaces; using DiscImageChef.CommonTypes.Structs; -using DiscImageChef.Console; -using Schemas; -using TrackType = DiscImageChef.CommonTypes.Enums.TrackType; namespace DiscImageChef.DiscImages { @@ -80,10 +71,5 @@ namespace DiscImageChef.DiscImages DriveFirmwareRevision = null }; } - - - - - } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/DiscJuggler/Helpers.cs b/DiscImageChef.DiscImages/DiscJuggler/Helpers.cs index 2221c3914..35298c103 100644 --- a/DiscImageChef.DiscImages/DiscJuggler/Helpers.cs +++ b/DiscImageChef.DiscImages/DiscJuggler/Helpers.cs @@ -45,6 +45,5 @@ namespace DiscImageChef.DiscImages default: return MediaType.Unknown; } } - } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/DiscJuggler/Identify.cs b/DiscImageChef.DiscImages/DiscJuggler/Identify.cs index c1f7fc483..4163392bb 100644 --- a/DiscImageChef.DiscImages/DiscJuggler/Identify.cs +++ b/DiscImageChef.DiscImages/DiscJuggler/Identify.cs @@ -68,6 +68,5 @@ namespace DiscImageChef.DiscImages // Too many tracks return descriptor[2] <= 99; } - } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/DiscJuggler/Read.cs b/DiscImageChef.DiscImages/DiscJuggler/Read.cs index 96fa08e3e..6b45340e5 100644 --- a/DiscImageChef.DiscImages/DiscJuggler/Read.cs +++ b/DiscImageChef.DiscImages/DiscJuggler/Read.cs @@ -47,7 +47,7 @@ namespace DiscImageChef.DiscImages { public partial class DiscJuggler { - public bool Open(IFilter imageFilter) + public bool Open(IFilter imageFilter) { imageStream = imageFilter.GetDataForkStream(); @@ -103,9 +103,7 @@ namespace DiscImageChef.DiscImages sessionSequence++; Session session = new Session { - SessionSequence = sessionSequence, - EndTrack = uint.MinValue, - StartTrack = uint.MaxValue + SessionSequence = sessionSequence, EndTrack = uint.MinValue, StartTrack = uint.MaxValue }; position += 15; @@ -588,25 +586,14 @@ namespace DiscImageChef.DiscImages } } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); - public byte[] ReadSector(ulong sectorAddress, uint track) - { - return ReadSectors(sectorAddress, 1, track); - } + public byte[] ReadSector(ulong sectorAddress, uint track) => ReadSectors(sectorAddress, 1, track); - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, track, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => + ReadSectorsTag(sectorAddress, 1, track, tag); public byte[] ReadSectors(ulong sectorAddress, uint length) { @@ -944,15 +931,9 @@ namespace DiscImageChef.DiscImages return buffer; } - public byte[] ReadSectorLong(ulong sectorAddress) - { - return ReadSectorsLong(sectorAddress, 1); - } + public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { - return ReadSectorsLong(sectorAddress, 1, track); - } + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => ReadSectorsLong(sectorAddress, 1, track); public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { @@ -1103,10 +1084,6 @@ namespace DiscImageChef.DiscImages return failingLbas.Count <= 0; } - public bool? VerifyMediaImage() - { - return null; - } - + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/DiskCopy42/Read.cs b/DiscImageChef.DiscImages/DiskCopy42/Read.cs index 9a743a668..9d3353e5e 100644 --- a/DiscImageChef.DiscImages/DiskCopy42/Read.cs +++ b/DiscImageChef.DiscImages/DiskCopy42/Read.cs @@ -422,15 +422,9 @@ namespace DiscImageChef.DiscImages return dataChk == header.DataChecksum && tagsChk == header.TagChecksum; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); public byte[] ReadSectors(ulong sectorAddress, uint length) { @@ -481,10 +475,7 @@ namespace DiscImageChef.DiscImages return buffer; } - public byte[] ReadSectorLong(ulong sectorAddress) - { - return ReadSectorsLong(sectorAddress, 1); - } + public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/DiskCopy42/Unsupported.cs b/DiscImageChef.DiscImages/DiskCopy42/Unsupported.cs index ed099fb37..0e0acf38e 100644 --- a/DiscImageChef.DiscImages/DiskCopy42/Unsupported.cs +++ b/DiscImageChef.DiscImages/DiskCopy42/Unsupported.cs @@ -39,15 +39,9 @@ namespace DiscImageChef.DiscImages { public partial class DiskCopy42 { - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { - return null; - } + public bool? VerifySector(ulong sectorAddress, uint track) => null; public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -71,49 +65,31 @@ namespace DiscImageChef.DiscImages return null; } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/DiskCopy42/Write.cs b/DiscImageChef.DiscImages/DiskCopy42/Write.cs index 1529c57c9..2ce3aa0dc 100644 --- a/DiscImageChef.DiscImages/DiskCopy42/Write.cs +++ b/DiscImageChef.DiscImages/DiskCopy42/Write.cs @@ -370,11 +370,7 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) - { - // Geometry is not stored in image - return true; - } + public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { @@ -388,16 +384,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/DriDiskCopy/Read.cs b/DiscImageChef.DiscImages/DriDiskCopy/Read.cs index d5b43bc37..d01723082 100644 --- a/DiscImageChef.DiscImages/DriDiskCopy/Read.cs +++ b/DiscImageChef.DiscImages/DriDiskCopy/Read.cs @@ -96,8 +96,8 @@ namespace DiscImageChef.DiscImages } imageInfo.MediaType = Geometry.GetMediaType(((ushort)imageInfo.Cylinders, (byte)imageInfo.Heads, - (ushort)imageInfo.SectorsPerTrack, imageInfo.SectorSize, - MediaEncoding.MFM, false)); + (ushort)imageInfo.SectorsPerTrack, imageInfo.SectorSize, + MediaEncoding.MFM, false)); switch(imageInfo.MediaType) { @@ -122,10 +122,7 @@ namespace DiscImageChef.DiscImages return true; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); public byte[] ReadSectors(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/DriDiskCopy/Unsupported.cs b/DiscImageChef.DiscImages/DriDiskCopy/Unsupported.cs index 234bb8288..366f4e87b 100644 --- a/DiscImageChef.DiscImages/DriDiskCopy/Unsupported.cs +++ b/DiscImageChef.DiscImages/DriDiskCopy/Unsupported.cs @@ -39,80 +39,48 @@ namespace DiscImageChef.DiscImages { public partial class DriDiskCopy { - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { - return null; - } + public bool? VerifySector(ulong sectorAddress, uint track) => null; public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -136,9 +104,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/DriDiskCopy/Write.cs b/DiscImageChef.DiscImages/DriDiskCopy/Write.cs index 7576b8ee4..446f60e82 100644 --- a/DiscImageChef.DiscImages/DriDiskCopy/Write.cs +++ b/DiscImageChef.DiscImages/DriDiskCopy/Write.cs @@ -207,16 +207,9 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetMetadata(ImageInfo metadata) - { - return true; - } + public bool SetMetadata(ImageInfo metadata) => true; - public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) - { - // Geometry is set by media type - return true; - } + public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { @@ -230,16 +223,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/GDI/Constants.cs b/DiscImageChef.DiscImages/GDI/Constants.cs index 5b1f4eff3..3e65c544c 100644 --- a/DiscImageChef.DiscImages/GDI/Constants.cs +++ b/DiscImageChef.DiscImages/GDI/Constants.cs @@ -36,7 +36,5 @@ namespace DiscImageChef.DiscImages { const string REGEX_TRACK = @"\s?(?\d+)\s+(?\d+)\s(?\d)\s(?2352|2048)\s(?.+)\s(?\d+)$"; - - } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/GDI/GDI.cs b/DiscImageChef.DiscImages/GDI/GDI.cs index 003427d13..c7f26dfa8 100644 --- a/DiscImageChef.DiscImages/GDI/GDI.cs +++ b/DiscImageChef.DiscImages/GDI/GDI.cs @@ -30,21 +30,11 @@ // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ -using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text.RegularExpressions; -using DiscImageChef.Checksums; -using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Interfaces; using DiscImageChef.CommonTypes.Structs; -using DiscImageChef.Console; -using DiscImageChef.Filters; -using Schemas; -using TrackType = DiscImageChef.CommonTypes.Enums.TrackType; namespace DiscImageChef.DiscImages { @@ -83,12 +73,5 @@ namespace DiscImageChef.DiscImages DriveFirmwareRevision = null }; } - - - - - - - } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/GDI/Identify.cs b/DiscImageChef.DiscImages/GDI/Identify.cs index aa6406af1..170bad7ac 100644 --- a/DiscImageChef.DiscImages/GDI/Identify.cs +++ b/DiscImageChef.DiscImages/GDI/Identify.cs @@ -40,7 +40,7 @@ namespace DiscImageChef.DiscImages { public partial class Gdi { - // Due to .gdi format, this method must parse whole file, ignoring errors (those will be thrown by OpenImage()). + // Due to .gdi format, this method must parse whole file, ignoring errors (those will be thrown by OpenImage()). public bool Identify(IFilter imageFilter) { try @@ -105,6 +105,5 @@ namespace DiscImageChef.DiscImages return false; } } - } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/GDI/Read.cs b/DiscImageChef.DiscImages/GDI/Read.cs index e27011ffe..0e5496ace 100644 --- a/DiscImageChef.DiscImages/GDI/Read.cs +++ b/DiscImageChef.DiscImages/GDI/Read.cs @@ -47,7 +47,7 @@ namespace DiscImageChef.DiscImages { public partial class Gdi { - public bool Open(IFilter imageFilter) + public bool Open(IFilter imageFilter) { if(imageFilter == null) return false; @@ -290,25 +290,14 @@ namespace DiscImageChef.DiscImages } } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); - public byte[] ReadSector(ulong sectorAddress, uint track) - { - return ReadSectors(sectorAddress, 1, track); - } + public byte[] ReadSector(ulong sectorAddress, uint track) => ReadSectors(sectorAddress, 1, track); - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, track, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => + ReadSectorsTag(sectorAddress, 1, track, tag); public byte[] ReadSectors(ulong sectorAddress, uint length) { @@ -601,15 +590,9 @@ namespace DiscImageChef.DiscImages return buffer; } - public byte[] ReadSectorLong(ulong sectorAddress) - { - return ReadSectorsLong(sectorAddress, 1); - } + public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { - return ReadSectorsLong(sectorAddress, 1, track); - } + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => ReadSectorsLong(sectorAddress, 1, track); public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { @@ -849,9 +832,6 @@ namespace DiscImageChef.DiscImages return failingLbas.Count <= 0; } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/GDI/Structs.cs b/DiscImageChef.DiscImages/GDI/Structs.cs index 56e967e2e..b80434d4e 100644 --- a/DiscImageChef.DiscImages/GDI/Structs.cs +++ b/DiscImageChef.DiscImages/GDI/Structs.cs @@ -75,6 +75,5 @@ namespace DiscImageChef.DiscImages /// Disk type public MediaType Disktype; } - } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/GDI/Unsupported.cs b/DiscImageChef.DiscImages/GDI/Unsupported.cs index b3dbf9a99..f1dadac36 100644 --- a/DiscImageChef.DiscImages/GDI/Unsupported.cs +++ b/DiscImageChef.DiscImages/GDI/Unsupported.cs @@ -37,10 +37,7 @@ namespace DiscImageChef.DiscImages { public partial class Gdi { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureSupportedButNotImplementedImageException("Feature not supported by image format"); - } - } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/HDCopy/Read.cs b/DiscImageChef.DiscImages/HDCopy/Read.cs index a5ceae61e..28cbf3153 100644 --- a/DiscImageChef.DiscImages/HDCopy/Read.cs +++ b/DiscImageChef.DiscImages/HDCopy/Read.cs @@ -72,8 +72,8 @@ namespace DiscImageChef.DiscImages imageInfo.LastModificationTime = imageFilter.GetLastWriteTime(); imageInfo.MediaTitle = Path.GetFileNameWithoutExtension(imageFilter.GetFilename()); imageInfo.MediaType = Geometry.GetMediaType(((ushort)imageInfo.Cylinders, 2, - (ushort)imageInfo.SectorsPerTrack, 512, MediaEncoding.MFM, - false)); + (ushort)imageInfo.SectorsPerTrack, 512, MediaEncoding.MFM, + false)); // the start offset of the track data long currentOffset = 2 + 2 * 82; diff --git a/DiscImageChef.DiscImages/HDCopy/Unsupported.cs b/DiscImageChef.DiscImages/HDCopy/Unsupported.cs index 72c57c877..35fe94c96 100644 --- a/DiscImageChef.DiscImages/HDCopy/Unsupported.cs +++ b/DiscImageChef.DiscImages/HDCopy/Unsupported.cs @@ -40,80 +40,49 @@ namespace DiscImageChef.DiscImages { public partial class HdCopy { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -126,14 +95,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/IMD/Read.cs b/DiscImageChef.DiscImages/IMD/Read.cs index b45239bc6..f18d05f09 100644 --- a/DiscImageChef.DiscImages/IMD/Read.cs +++ b/DiscImageChef.DiscImages/IMD/Read.cs @@ -160,8 +160,8 @@ namespace DiscImageChef.DiscImages mediaEncoding = MediaEncoding.FM; imageInfo.MediaType = Geometry.GetMediaType(((ushort)imageInfo.Cylinders, (byte)imageInfo.Heads, - (ushort)imageInfo.SectorsPerTrack, imageInfo.SectorSize, - mediaEncoding, false)); + (ushort)imageInfo.SectorsPerTrack, imageInfo.SectorSize, + mediaEncoding, false)); switch(imageInfo.MediaType) { @@ -185,10 +185,7 @@ namespace DiscImageChef.DiscImages return true; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); public byte[] ReadSectors(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/IMD/Unsupported.cs b/DiscImageChef.DiscImages/IMD/Unsupported.cs index 626901ca9..696b1dc16 100644 --- a/DiscImageChef.DiscImages/IMD/Unsupported.cs +++ b/DiscImageChef.DiscImages/IMD/Unsupported.cs @@ -39,80 +39,48 @@ namespace DiscImageChef.DiscImages { public partial class Imd { - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { - return null; - } + public bool? VerifySector(ulong sectorAddress, uint track) => null; public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -136,9 +104,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/KryoFlux/Read.cs b/DiscImageChef.DiscImages/KryoFlux/Read.cs index ec08dd1aa..a83e7e0aa 100644 --- a/DiscImageChef.DiscImages/KryoFlux/Read.cs +++ b/DiscImageChef.DiscImages/KryoFlux/Read.cs @@ -235,50 +235,31 @@ namespace DiscImageChef.DiscImages throw new NotImplementedException("Flux decoding is not yet implemented."); } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public byte[] ReadSectors(ulong sectorAddress, uint length) - { + public byte[] ReadSectors(ulong sectorAddress, uint length) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public bool? VerifySector(ulong sectorAddress) - { + public bool? VerifySector(ulong sectorAddress) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/KryoFlux/Unsupported.cs b/DiscImageChef.DiscImages/KryoFlux/Unsupported.cs index 0c7c27ad8..12423a835 100644 --- a/DiscImageChef.DiscImages/KryoFlux/Unsupported.cs +++ b/DiscImageChef.DiscImages/KryoFlux/Unsupported.cs @@ -39,60 +39,38 @@ namespace DiscImageChef.DiscImages { public partial class KryoFlux { - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { + public bool? VerifyMediaImage() => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/MaxiDisk/Read.cs b/DiscImageChef.DiscImages/MaxiDisk/Read.cs index 533c7f519..4049cbdf3 100644 --- a/DiscImageChef.DiscImages/MaxiDisk/Read.cs +++ b/DiscImageChef.DiscImages/MaxiDisk/Read.cs @@ -88,18 +88,15 @@ namespace DiscImageChef.DiscImages imageInfo.LastModificationTime = imageFilter.GetLastWriteTime(); imageInfo.MediaType = Geometry.GetMediaType(((ushort)imageInfo.Cylinders, (byte)imageInfo.Heads, - (ushort)imageInfo.SectorsPerTrack, imageInfo.SectorSize, - MediaEncoding.MFM, false)); + (ushort)imageInfo.SectorsPerTrack, imageInfo.SectorSize, + MediaEncoding.MFM, false)); imageInfo.XmlMediaType = XmlMediaType.BlockMedia; return true; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); public byte[] ReadSectors(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/MaxiDisk/Unsupported.cs b/DiscImageChef.DiscImages/MaxiDisk/Unsupported.cs index 4d4ce4160..9d304484a 100644 --- a/DiscImageChef.DiscImages/MaxiDisk/Unsupported.cs +++ b/DiscImageChef.DiscImages/MaxiDisk/Unsupported.cs @@ -39,80 +39,48 @@ namespace DiscImageChef.DiscImages { public partial class MaxiDisk { - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { - return null; - } + public bool? VerifySector(ulong sectorAddress, uint track) => null; public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -136,9 +104,6 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/MaxiDisk/Write.cs b/DiscImageChef.DiscImages/MaxiDisk/Write.cs index cb6196791..f22c065f1 100644 --- a/DiscImageChef.DiscImages/MaxiDisk/Write.cs +++ b/DiscImageChef.DiscImages/MaxiDisk/Write.cs @@ -221,10 +221,7 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetMetadata(ImageInfo metadata) - { - return true; - } + public bool SetMetadata(ImageInfo metadata) => true; public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { @@ -265,16 +262,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/NDIF/Unsupported.cs b/DiscImageChef.DiscImages/NDIF/Unsupported.cs index 666566fbb..01ed04f4a 100644 --- a/DiscImageChef.DiscImages/NDIF/Unsupported.cs +++ b/DiscImageChef.DiscImages/NDIF/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class Ndif { - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/NHDr0/Constants.cs b/DiscImageChef.DiscImages/NHDr0/Constants.cs index f3c985298..6d6117794 100644 --- a/DiscImageChef.DiscImages/NHDr0/Constants.cs +++ b/DiscImageChef.DiscImages/NHDr0/Constants.cs @@ -35,6 +35,8 @@ namespace DiscImageChef.DiscImages public partial class Nhdr0 { readonly byte[] signature = - {0x54, 0x39, 0x38, 0x48, 0x44, 0x44, 0x49, 0x4D, 0x41, 0x47, 0x45, 0x2E, 0x52, 0x30, 0x00}; + { + 0x54, 0x39, 0x38, 0x48, 0x44, 0x44, 0x49, 0x4D, 0x41, 0x47, 0x45, 0x2E, 0x52, 0x30, 0x00 + }; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/NHDr0/Read.cs b/DiscImageChef.DiscImages/NHDr0/Read.cs index 2c8d6cae2..c527939c2 100644 --- a/DiscImageChef.DiscImages/NHDr0/Read.cs +++ b/DiscImageChef.DiscImages/NHDr0/Read.cs @@ -79,10 +79,7 @@ namespace DiscImageChef.DiscImages return true; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); public byte[] ReadSectors(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/NHDr0/Unsupported.cs b/DiscImageChef.DiscImages/NHDr0/Unsupported.cs index 06f2e06d3..254e1daec 100644 --- a/DiscImageChef.DiscImages/NHDr0/Unsupported.cs +++ b/DiscImageChef.DiscImages/NHDr0/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class Nhdr0 { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/NHDr0/Write.cs b/DiscImageChef.DiscImages/NHDr0/Write.cs index 555d8c8c1..8389cf3f2 100644 --- a/DiscImageChef.DiscImages/NHDr0/Write.cs +++ b/DiscImageChef.DiscImages/NHDr0/Write.cs @@ -267,16 +267,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Nero/Nero.cs b/DiscImageChef.DiscImages/Nero/Nero.cs index 5dc3c58a4..2d9f032fb 100644 --- a/DiscImageChef.DiscImages/Nero/Nero.cs +++ b/DiscImageChef.DiscImages/Nero/Nero.cs @@ -73,8 +73,7 @@ namespace DiscImageChef.DiscImages imageNewFormat = false; imageInfo = new ImageInfo { - ReadableSectorTags = new List(), - ReadableMediaTags = new List() + ReadableSectorTags = new List(), ReadableMediaTags = new List() }; neroSessions = new Dictionary(); neroTracks = new Dictionary(); diff --git a/DiscImageChef.DiscImages/Nero/Read.cs b/DiscImageChef.DiscImages/Nero/Read.cs index 3f7037701..53c401369 100644 --- a/DiscImageChef.DiscImages/Nero/Read.cs +++ b/DiscImageChef.DiscImages/Nero/Read.cs @@ -122,9 +122,7 @@ namespace DiscImageChef.DiscImages neroCuesheetV1 = new NeroV1Cuesheet { - ChunkId = chunkId, - ChunkSize = chunkLength, - Entries = new List() + ChunkId = chunkId, ChunkSize = chunkLength, Entries = new List() }; byte[] tmpbuffer = new byte[8]; @@ -168,9 +166,7 @@ namespace DiscImageChef.DiscImages neroCuesheetV2 = new NeroV2Cuesheet { - ChunkId = chunkId, - ChunkSize = chunkLength, - Entries = new List() + ChunkId = chunkId, ChunkSize = chunkLength, Entries = new List() }; byte[] tmpbuffer = new byte[8]; @@ -397,9 +393,7 @@ namespace DiscImageChef.DiscImages neroCdtxt = new NeroCdText { - ChunkId = chunkId, - ChunkSize = chunkLength, - Packs = new List() + ChunkId = chunkId, ChunkSize = chunkLength, Packs = new List() }; byte[] tmpbuffer = new byte[18]; @@ -442,9 +436,7 @@ namespace DiscImageChef.DiscImages neroTaov1 = new NeroV1Tao { - ChunkId = chunkId, - ChunkSize = chunkLength, - Tracks = new List() + ChunkId = chunkId, ChunkSize = chunkLength, Tracks = new List() }; byte[] tmpbuffer = new byte[20]; @@ -507,9 +499,7 @@ namespace DiscImageChef.DiscImages neroTaov2 = new NeroV2Tao { - ChunkId = chunkId, - ChunkSize = chunkLength, - Tracks = new List() + ChunkId = chunkId, ChunkSize = chunkLength, Tracks = new List() }; byte[] tmpbuffer = new byte[32]; @@ -931,25 +921,14 @@ namespace DiscImageChef.DiscImages } } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); - public byte[] ReadSector(ulong sectorAddress, uint track) - { - return ReadSectors(sectorAddress, 1, track); - } + public byte[] ReadSector(ulong sectorAddress, uint track) => ReadSectors(sectorAddress, 1, track); - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { - return ReadSectorsTag(sectorAddress, 1, track, tag); - } + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => + ReadSectorsTag(sectorAddress, 1, track, tag); public byte[] ReadSectors(ulong sectorAddress, uint length) { @@ -1297,15 +1276,9 @@ namespace DiscImageChef.DiscImages return buffer; } - public byte[] ReadSectorLong(ulong sectorAddress) - { - return ReadSectorsLong(sectorAddress, 1); - } + public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { - return ReadSectorsLong(sectorAddress, 1, track); - } + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => ReadSectorsLong(sectorAddress, 1, track); public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { @@ -1394,10 +1367,7 @@ namespace DiscImageChef.DiscImages return buffer; } - public List GetSessionTracks(Session session) - { - return GetSessionTracks(session.SessionSequence); - } + public List GetSessionTracks(Session session) => GetSessionTracks(session.SessionSequence); public List GetSessionTracks(ushort session) { @@ -1476,9 +1446,6 @@ namespace DiscImageChef.DiscImages return failingLbas.Count <= 0; } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Parallels/Constants.cs b/DiscImageChef.DiscImages/Parallels/Constants.cs index e40b3dd20..ffab6aaad 100644 --- a/DiscImageChef.DiscImages/Parallels/Constants.cs +++ b/DiscImageChef.DiscImages/Parallels/Constants.cs @@ -42,8 +42,12 @@ namespace DiscImageChef.DiscImages const uint MAX_CACHED_SECTORS = MAX_CACHE_SIZE / 512; const uint DEFAULT_CLUSTER_SIZE = 1048576; readonly byte[] parallelsExtMagic = - {0x57, 0x69, 0x74, 0x68, 0x6F, 0x75, 0x46, 0x72, 0x65, 0x53, 0x70, 0x61, 0x63, 0x45, 0x78, 0x74}; + { + 0x57, 0x69, 0x74, 0x68, 0x6F, 0x75, 0x46, 0x72, 0x65, 0x53, 0x70, 0x61, 0x63, 0x45, 0x78, 0x74 + }; readonly byte[] parallelsMagic = - {0x57, 0x69, 0x74, 0x68, 0x6F, 0x75, 0x74, 0x46, 0x72, 0x65, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65}; + { + 0x57, 0x69, 0x74, 0x68, 0x6F, 0x75, 0x74, 0x46, 0x72, 0x65, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65 + }; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Parallels/Unsupported.cs b/DiscImageChef.DiscImages/Parallels/Unsupported.cs index 9c59c9b1e..c08c7de91 100644 --- a/DiscImageChef.DiscImages/Parallels/Unsupported.cs +++ b/DiscImageChef.DiscImages/Parallels/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class Parallels { - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Parallels/Write.cs b/DiscImageChef.DiscImages/Parallels/Write.cs index 4dace9ca2..240a2c488 100644 --- a/DiscImageChef.DiscImages/Parallels/Write.cs +++ b/DiscImageChef.DiscImages/Parallels/Write.cs @@ -252,10 +252,7 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetMetadata(ImageInfo metadata) - { - return true; - } + public bool SetMetadata(ImageInfo metadata) => true; public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { @@ -276,16 +273,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/PartClone/Constants.cs b/DiscImageChef.DiscImages/PartClone/Constants.cs index ea4886c86..1d82d0077 100644 --- a/DiscImageChef.DiscImages/PartClone/Constants.cs +++ b/DiscImageChef.DiscImages/PartClone/Constants.cs @@ -39,6 +39,8 @@ namespace DiscImageChef.DiscImages const uint MAX_CACHED_SECTORS = MAX_CACHE_SIZE / 512; readonly byte[] biTmAgIc = {0x42, 0x69, 0x54, 0x6D, 0x41, 0x67, 0x49, 0x63}; readonly byte[] partCloneMagic = - {0x70, 0x61, 0x72, 0x74, 0x63, 0x6C, 0x6F, 0x6E, 0x65, 0x2D, 0x69, 0x6D, 0x61, 0x67, 0x65}; + { + 0x70, 0x61, 0x72, 0x74, 0x63, 0x6C, 0x6F, 0x6E, 0x65, 0x2D, 0x69, 0x6D, 0x61, 0x67, 0x65 + }; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/PartClone/Unsupported.cs b/DiscImageChef.DiscImages/PartClone/Unsupported.cs index b719bbb12..b659d93f0 100644 --- a/DiscImageChef.DiscImages/PartClone/Unsupported.cs +++ b/DiscImageChef.DiscImages/PartClone/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class PartClone { - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,15 +94,10 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } // TODO: All blocks contain a CRC32 that's incompatible with current implementation. Need to check for compatibility. - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Partimage/Constants.cs b/DiscImageChef.DiscImages/Partimage/Constants.cs index 11b86c8be..32c19e8bc 100644 --- a/DiscImageChef.DiscImages/Partimage/Constants.cs +++ b/DiscImageChef.DiscImages/Partimage/Constants.cs @@ -64,8 +64,8 @@ namespace DiscImageChef.DiscImages const uint MAX_CACHED_SECTORS = MAX_CACHE_SIZE / 512; readonly byte[] partimageMagic = { - 0x50, 0x61, 0x52, 0x74, 0x49, 0x6D, 0x41, 0x67, 0x45, 0x2D, 0x56, 0x6F, 0x4C, 0x75, 0x4D, 0x65, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + 0x50, 0x61, 0x52, 0x74, 0x49, 0x6D, 0x41, 0x67, 0x45, 0x2D, 0x56, 0x6F, 0x4C, 0x75, 0x4D, 0x65, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Partimage/Unsupported.cs b/DiscImageChef.DiscImages/Partimage/Unsupported.cs index a3811b477..5c29ba140 100644 --- a/DiscImageChef.DiscImages/Partimage/Unsupported.cs +++ b/DiscImageChef.DiscImages/Partimage/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class Partimage { - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,15 +94,10 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } // TODO: All blocks contain a CRC32 that's incompatible with current implementation. Need to check for compatibility. - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/QCOW/Unsupported.cs b/DiscImageChef.DiscImages/QCOW/Unsupported.cs index 8eaeb5ba0..ad905a60c 100644 --- a/DiscImageChef.DiscImages/QCOW/Unsupported.cs +++ b/DiscImageChef.DiscImages/QCOW/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class Qcow { - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/QCOW/Write.cs b/DiscImageChef.DiscImages/QCOW/Write.cs index 8ad1a1075..986ff5d9a 100644 --- a/DiscImageChef.DiscImages/QCOW/Write.cs +++ b/DiscImageChef.DiscImages/QCOW/Write.cs @@ -288,16 +288,9 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetMetadata(ImageInfo metadata) - { - return true; - } + public bool SetMetadata(ImageInfo metadata) => true; - public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) - { - // Not stored in image - return true; - } + public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { @@ -311,16 +304,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/QCOW2/Unsupported.cs b/DiscImageChef.DiscImages/QCOW2/Unsupported.cs index 3e8cef5ca..f72907ec9 100644 --- a/DiscImageChef.DiscImages/QCOW2/Unsupported.cs +++ b/DiscImageChef.DiscImages/QCOW2/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class Qcow2 { - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/QCOW2/Write.cs b/DiscImageChef.DiscImages/QCOW2/Write.cs index 14729183c..cc4942dad 100644 --- a/DiscImageChef.DiscImages/QCOW2/Write.cs +++ b/DiscImageChef.DiscImages/QCOW2/Write.cs @@ -334,16 +334,9 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetMetadata(ImageInfo metadata) - { - return true; - } + public bool SetMetadata(ImageInfo metadata) => true; - public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) - { - // Not stored in image - return true; - } + public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { @@ -357,16 +350,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/QED/Constants.cs b/DiscImageChef.DiscImages/QED/Constants.cs index 416b47d18..e55f4342c 100644 --- a/DiscImageChef.DiscImages/QED/Constants.cs +++ b/DiscImageChef.DiscImages/QED/Constants.cs @@ -9,7 +9,7 @@ // // --[ Description ] ---------------------------------------------------------- // -// Contains constants for Anex86 disk images. +// Contains constants for QEMU Enhanced Disk images. // // --[ License ] -------------------------------------------------------------- // @@ -61,6 +61,5 @@ namespace DiscImageChef.DiscImages const uint MAX_CACHED_SECTORS = MAX_CACHE_SIZE / 512; const uint DEFAULT_CLUSTER_SIZE = 65536; const uint DEFAULT_TABLE_SIZE = 4; - } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/QED/Enums.cs b/DiscImageChef.DiscImages/QED/Enums.cs deleted file mode 100644 index 61654af64..000000000 --- a/DiscImageChef.DiscImages/QED/Enums.cs +++ /dev/null @@ -1,39 +0,0 @@ -// /*************************************************************************** -// The Disc Image Chef -// ---------------------------------------------------------------------------- -// -// Filename : Enums.cs -// Author(s) : Natalia Portillo -// -// Component : Disk image plugins. -// -// --[ Description ] ---------------------------------------------------------- -// -// Contains enumerations for Anex86 disk images. -// -// --[ License ] -------------------------------------------------------------- -// -// This library is free software; you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 2.1 of the -// License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, see . -// -// ---------------------------------------------------------------------------- -// Copyright © 2011-2019 Natalia Portillo -// ****************************************************************************/ - -namespace DiscImageChef.DiscImages -{ - public partial class Qed - { - - } -} \ No newline at end of file diff --git a/DiscImageChef.DiscImages/QED/Helpers.cs b/DiscImageChef.DiscImages/QED/Helpers.cs index 9cce2ea55..10189b892 100644 --- a/DiscImageChef.DiscImages/QED/Helpers.cs +++ b/DiscImageChef.DiscImages/QED/Helpers.cs @@ -9,7 +9,7 @@ // // --[ Description ] ---------------------------------------------------------- // -// Contains helpers for Anex86 disk images. +// Contains helpers for QEMU Enhanced Disk images. // // --[ License ] -------------------------------------------------------------- // @@ -29,10 +29,54 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + namespace DiscImageChef.DiscImages { public partial class Qed { + static bool IsPowerOfTwo(uint x) + { + while((x & 1) == 0 && x > 1) x >>= 1; + return x == 1; + } + + static int Ctz32(uint val) + { + int cnt = 0; + if((val & 0xFFFF) == 0) + { + cnt += 16; + val >>= 16; + } + + if((val & 0xFF) == 0) + { + cnt += 8; + val >>= 8; + } + + if((val & 0xF) == 0) + { + cnt += 4; + val >>= 4; + } + + if((val & 0x3) == 0) + { + cnt += 2; + val >>= 2; + } + + if((val & 0x1) == 0) + { + cnt++; + val >>= 1; + } + + if((val & 0x1) == 0) cnt++; + + return cnt; + } } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/QED/Identify.cs b/DiscImageChef.DiscImages/QED/Identify.cs index ead52dc9e..79f63b90c 100644 --- a/DiscImageChef.DiscImages/QED/Identify.cs +++ b/DiscImageChef.DiscImages/QED/Identify.cs @@ -9,7 +9,7 @@ // // --[ Description ] ---------------------------------------------------------- // -// Identifies Anex86 disk images. +// Identifies QEMU Enhanced Disk images. // // --[ License ] -------------------------------------------------------------- // @@ -56,6 +56,5 @@ namespace DiscImageChef.DiscImages return qHdr.magic == QED_MAGIC; } - } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/QED/Properties.cs b/DiscImageChef.DiscImages/QED/Properties.cs index 23215f6f5..6ef0e894a 100644 --- a/DiscImageChef.DiscImages/QED/Properties.cs +++ b/DiscImageChef.DiscImages/QED/Properties.cs @@ -9,7 +9,7 @@ // // --[ Description ] ---------------------------------------------------------- // -// Contains properties for Anex86 disk images. +// Contains properties for QEMU Enhanced Disk images. // // --[ License ] -------------------------------------------------------------- // diff --git a/DiscImageChef.DiscImages/QED/QED.cs b/DiscImageChef.DiscImages/QED/QED.cs index 7728c3a86..b0026f28b 100644 --- a/DiscImageChef.DiscImages/QED/QED.cs +++ b/DiscImageChef.DiscImages/QED/QED.cs @@ -30,17 +30,11 @@ // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ -using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Runtime.InteropServices; -using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; -using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Interfaces; using DiscImageChef.CommonTypes.Structs; -using Schemas; namespace DiscImageChef.DiscImages { @@ -90,409 +84,5 @@ namespace DiscImageChef.DiscImages DriveFirmwareRevision = null }; } - - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadDiskTag(MediaTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorLong(ulong sectorAddress) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorLong(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(Session session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public List GetSessionTracks(ushort session) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public bool? VerifySector(ulong sectorAddress) => null; - - public bool? VerifySector(ulong sectorAddress, uint track) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, - out List unknownLbas) - { - failingLbas = new List(); - unknownLbas = new List(); - for(ulong i = 0; i < imageInfo.Sectors; i++) unknownLbas.Add(i); - - return null; - } - - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) => - throw new FeatureUnsupportedImageException("Feature not supported by image format"); - - public bool? VerifyMediaImage() => null; - - public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, - uint sectorSize) - { - if(sectorSize != 512) - { - ErrorMessage = "Unsupported sector size"; - return false; - } - - if(!SupportedMediaTypes.Contains(mediaType)) - { - ErrorMessage = $"Unsupport media format {mediaType}"; - return false; - } - - // TODO: Correct this calculation - if(sectors * sectorSize / DEFAULT_CLUSTER_SIZE > uint.MaxValue) - { - ErrorMessage = "Too many sectors for selected cluster size"; - return false; - } - - imageInfo = new ImageInfo {MediaType = mediaType, SectorSize = sectorSize, Sectors = sectors}; - - try { writingStream = new FileStream(path, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None); } - catch(IOException e) - { - ErrorMessage = $"Could not create new image file, exception {e.Message}"; - return false; - } - - qHdr = new QedHeader - { - magic = QED_MAGIC, - cluster_size = DEFAULT_CLUSTER_SIZE, - table_size = DEFAULT_TABLE_SIZE, - header_size = 1, - l1_table_offset = DEFAULT_CLUSTER_SIZE, - image_size = sectors * sectorSize - }; - - clusterSectors = qHdr.cluster_size / 512; - tableSize = qHdr.cluster_size * qHdr.table_size / 8; - - l1Table = new ulong[tableSize]; - l1Mask = 0; - int c = 0; - clusterBits = Ctz32(qHdr.cluster_size); - l2Mask = (tableSize - 1) << clusterBits; - l1Shift = clusterBits + Ctz32(tableSize); - - for(int i = 0; i < 64; i++) - { - l1Mask <<= 1; - - if(c >= 64 - l1Shift) continue; - - l1Mask += 1; - c++; - } - - sectorMask = 0; - for(int i = 0; i < clusterBits; i++) sectorMask = (sectorMask << 1) + 1; - - byte[] empty = new byte[qHdr.l1_table_offset + tableSize * 8]; - writingStream.Write(empty, 0, empty.Length); - - IsWriting = true; - ErrorMessage = null; - return true; - } - - public bool WriteMediaTag(byte[] data, MediaTagType tag) - { - ErrorMessage = "Writing media tags is not supported."; - return false; - } - - public bool WriteSector(byte[] data, ulong sectorAddress) - { - if(!IsWriting) - { - ErrorMessage = "Tried to write on a non-writable image"; - return false; - } - - if(data.Length != imageInfo.SectorSize) - { - ErrorMessage = "Incorrect data size"; - return false; - } - - if(sectorAddress >= imageInfo.Sectors) - { - ErrorMessage = "Tried to write past image size"; - return false; - } - - // Ignore empty sectors - if(ArrayHelpers.ArrayIsNullOrEmpty(data)) return true; - - ulong byteAddress = sectorAddress * 512; - - ulong l1Off = (byteAddress & l1Mask) >> l1Shift; - - if((long)l1Off >= l1Table.LongLength) - throw new ArgumentOutOfRangeException(nameof(l1Off), - $"Trying to write past L1 table, position {l1Off} of a max {l1Table.LongLength}"); - - if(l1Table[l1Off] == 0) - { - writingStream.Seek(0, SeekOrigin.End); - l1Table[l1Off] = (ulong)writingStream.Position; - byte[] l2TableB = new byte[tableSize * 8]; - writingStream.Seek(0, SeekOrigin.End); - writingStream.Write(l2TableB, 0, l2TableB.Length); - } - - writingStream.Position = (long)l1Table[l1Off]; - - ulong l2Off = (byteAddress & l2Mask) >> clusterBits; - - writingStream.Seek((long)(l1Table[l1Off] + l2Off * 8), SeekOrigin.Begin); - - byte[] entry = new byte[8]; - writingStream.Read(entry, 0, 8); - ulong offset = BitConverter.ToUInt64(entry, 0); - - if(offset == 0) - { - offset = (ulong)writingStream.Length; - byte[] cluster = new byte[qHdr.cluster_size]; - entry = BitConverter.GetBytes(offset); - writingStream.Seek((long)(l1Table[l1Off] + l2Off * 8), SeekOrigin.Begin); - writingStream.Write(entry, 0, 8); - writingStream.Seek(0, SeekOrigin.End); - writingStream.Write(cluster, 0, cluster.Length); - } - - writingStream.Seek((long)(offset + (byteAddress & sectorMask)), SeekOrigin.Begin); - writingStream.Write(data, 0, data.Length); - - ErrorMessage = ""; - return true; - } - - // TODO: This can be optimized - public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) - { - if(!IsWriting) - { - ErrorMessage = "Tried to write on a non-writable image"; - return false; - } - - if(data.Length % imageInfo.SectorSize != 0) - { - ErrorMessage = "Incorrect data size"; - return false; - } - - if(sectorAddress + length > imageInfo.Sectors) - { - ErrorMessage = "Tried to write past image size"; - return false; - } - - // Ignore empty sectors - if(ArrayHelpers.ArrayIsNullOrEmpty(data)) return true; - - for(uint i = 0; i < length; i++) - { - byte[] tmp = new byte[imageInfo.SectorSize]; - Array.Copy(data, i * imageInfo.SectorSize, tmp, 0, imageInfo.SectorSize); - if(!WriteSector(tmp, sectorAddress + i)) return false; - } - - ErrorMessage = ""; - return true; - } - - public bool WriteSectorLong(byte[] data, ulong sectorAddress) - { - ErrorMessage = "Writing sectors with tags is not supported."; - return false; - } - - public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) - { - ErrorMessage = "Writing sectors with tags is not supported."; - return false; - } - - public bool SetTracks(List tracks) - { - ErrorMessage = "Unsupported feature"; - return false; - } - - public bool Close() - { - if(!IsWriting) - { - ErrorMessage = "Image is not opened for writing"; - return false; - } - - byte[] hdr = new byte[Marshal.SizeOf(typeof(QedHeader))]; - IntPtr hdrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(QedHeader))); - Marshal.StructureToPtr(qHdr, hdrPtr, true); - Marshal.Copy(hdrPtr, hdr, 0, hdr.Length); - Marshal.FreeHGlobal(hdrPtr); - - writingStream.Seek(0, SeekOrigin.Begin); - writingStream.Write(hdr, 0, hdr.Length); - - writingStream.Seek((long)qHdr.l1_table_offset, SeekOrigin.Begin); - for(long i = 0; i < l1Table.LongLength; i++) writingStream.Write(BitConverter.GetBytes(l1Table[i]), 0, 8); - - writingStream.Flush(); - writingStream.Close(); - - IsWriting = false; - ErrorMessage = ""; - return true; - } - - public bool SetMetadata(ImageInfo metadata) => true; - - public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; - - public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) - { - ErrorMessage = "Writing sectors with tags is not supported."; - return false; - } - - public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) - { - ErrorMessage = "Writing sectors with tags is not supported."; - return false; - } - - public bool SetDumpHardware(List dumpHardware) => false; - - public bool SetCicmMetadata(CICMMetadataType metadata) => false; - - static bool IsPowerOfTwo(uint x) - { - while((x & 1) == 0 && x > 1) x >>= 1; - - return x == 1; - } - - static int Ctz32(uint val) - { - int cnt = 0; - if((val & 0xFFFF) == 0) - { - cnt += 16; - val >>= 16; - } - - if((val & 0xFF) == 0) - { - cnt += 8; - val >>= 8; - } - - if((val & 0xF) == 0) - { - cnt += 4; - val >>= 4; - } - - if((val & 0x3) == 0) - { - cnt += 2; - val >>= 2; - } - - if((val & 0x1) == 0) - { - cnt++; - val >>= 1; - } - - if((val & 0x1) == 0) cnt++; - - return cnt; - } - - /// - /// QED header, big-endian - /// - [StructLayout(LayoutKind.Sequential, Pack = 1)] - struct QedHeader - { - /// - /// - /// - public uint magic; - /// - /// Cluster size in bytes - /// - public uint cluster_size; - /// - /// L1 and L2 table size in cluster - /// - public uint table_size; - /// - /// Header size in clusters - /// - public uint header_size; - /// - /// Incompatible features - /// - public ulong features; - /// - /// Compatible features - /// - public ulong compat_features; - /// - /// Self-resetting features - /// - public ulong autoclear_features; - /// - /// Offset to L1 table - /// - public ulong l1_table_offset; - /// - /// Image size - /// - public ulong image_size; - /// - /// Offset inside file to string containing backing file - /// - public ulong backing_file_offset; - /// - /// Size of - /// - public uint backing_file_size; - } } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/QED/Read.cs b/DiscImageChef.DiscImages/QED/Read.cs index 600bf7f0c..9f1b3b41e 100644 --- a/DiscImageChef.DiscImages/QED/Read.cs +++ b/DiscImageChef.DiscImages/QED/Read.cs @@ -9,7 +9,7 @@ // // --[ Description ] ---------------------------------------------------------- // -// Reads Anex86 disk images. +// Reads QEMU Enhanced Disk images. // // --[ License ] -------------------------------------------------------------- // @@ -43,7 +43,7 @@ namespace DiscImageChef.DiscImages { public partial class Qed { - public bool Open(IFilter imageFilter) + public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); stream.Seek(0, SeekOrigin.Begin); @@ -239,6 +239,5 @@ namespace DiscImageChef.DiscImages return ms.ToArray(); } - } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/QED/Structs.cs b/DiscImageChef.DiscImages/QED/Structs.cs index cf23f7eaa..62deabf75 100644 --- a/DiscImageChef.DiscImages/QED/Structs.cs +++ b/DiscImageChef.DiscImages/QED/Structs.cs @@ -9,7 +9,7 @@ // // --[ Description ] ---------------------------------------------------------- // -// Contains structures for Anex86 disk images. +// Contains structures for QEMU Enhanced Disk images. // // --[ License ] -------------------------------------------------------------- // @@ -29,10 +29,63 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + +using System.Runtime.InteropServices; + namespace DiscImageChef.DiscImages { public partial class Qed { - + /// + /// QED header, big-endian + /// + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct QedHeader + { + /// + /// + /// + public uint magic; + /// + /// Cluster size in bytes + /// + public uint cluster_size; + /// + /// L1 and L2 table size in cluster + /// + public uint table_size; + /// + /// Header size in clusters + /// + public uint header_size; + /// + /// Incompatible features + /// + public ulong features; + /// + /// Compatible features + /// + public ulong compat_features; + /// + /// Self-resetting features + /// + public ulong autoclear_features; + /// + /// Offset to L1 table + /// + public ulong l1_table_offset; + /// + /// Image size + /// + public ulong image_size; + /// + /// Offset inside file to string containing backing file + /// + public ulong backing_file_offset; + /// + /// Size of + /// + public uint backing_file_size; + } } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/QED/Unsupported.cs b/DiscImageChef.DiscImages/QED/Unsupported.cs index 68a20b8f0..b6b1c9e5f 100644 --- a/DiscImageChef.DiscImages/QED/Unsupported.cs +++ b/DiscImageChef.DiscImages/QED/Unsupported.cs @@ -9,7 +9,7 @@ // // --[ Description ] ---------------------------------------------------------- // -// Contains features unsupported by Anex86 disk images. +// Contains features unsupported by QEMU Enhanced Disk images. // // --[ License ] -------------------------------------------------------------- // @@ -29,10 +29,74 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + +using System.Collections.Generic; +using DiscImageChef.CommonTypes.Enums; +using DiscImageChef.CommonTypes.Exceptions; +using DiscImageChef.CommonTypes.Structs; + namespace DiscImageChef.DiscImages { public partial class Qed { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => + throw new FeatureUnsupportedImageException("Feature not supported by image format"); + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => + throw new FeatureUnsupportedImageException("Feature not supported by image format"); + + public byte[] ReadDiskTag(MediaTagType tag) => + throw new FeatureUnsupportedImageException("Feature not supported by image format"); + + public byte[] ReadSector(ulong sectorAddress, uint track) => + throw new FeatureUnsupportedImageException("Feature not supported by image format"); + + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => + throw new FeatureUnsupportedImageException("Feature not supported by image format"); + + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => + throw new FeatureUnsupportedImageException("Feature not supported by image format"); + + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => + throw new FeatureUnsupportedImageException("Feature not supported by image format"); + + public byte[] ReadSectorLong(ulong sectorAddress) => + throw new FeatureUnsupportedImageException("Feature not supported by image format"); + + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => + throw new FeatureUnsupportedImageException("Feature not supported by image format"); + + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => + throw new FeatureUnsupportedImageException("Feature not supported by image format"); + + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => + throw new FeatureUnsupportedImageException("Feature not supported by image format"); + + public List GetSessionTracks(Session session) => + throw new FeatureUnsupportedImageException("Feature not supported by image format"); + + public List GetSessionTracks(ushort session) => + throw new FeatureUnsupportedImageException("Feature not supported by image format"); + + public bool? VerifySector(ulong sectorAddress) => null; + + public bool? VerifySector(ulong sectorAddress, uint track) => + throw new FeatureUnsupportedImageException("Feature not supported by image format"); + + public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, + out List unknownLbas) + { + failingLbas = new List(); + unknownLbas = new List(); + for(ulong i = 0; i < imageInfo.Sectors; i++) unknownLbas.Add(i); + + return null; + } + + public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, + out List unknownLbas) => + throw new FeatureUnsupportedImageException("Feature not supported by image format"); + + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/QED/Write.cs b/DiscImageChef.DiscImages/QED/Write.cs index 963eea664..1d5f5ab6d 100644 --- a/DiscImageChef.DiscImages/QED/Write.cs +++ b/DiscImageChef.DiscImages/QED/Write.cs @@ -9,7 +9,7 @@ // // --[ Description ] ---------------------------------------------------------- // -// Writes Anex86 disk images. +// Writes QEMU Enhanced Disk images. // // --[ License ] -------------------------------------------------------------- // @@ -29,10 +29,266 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using DiscImageChef.CommonTypes; +using DiscImageChef.CommonTypes.Enums; +using DiscImageChef.CommonTypes.Structs; +using Schemas; + namespace DiscImageChef.DiscImages { public partial class Qed { + public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, + uint sectorSize) + { + if(sectorSize != 512) + { + ErrorMessage = "Unsupported sector size"; + return false; + } + if(!SupportedMediaTypes.Contains(mediaType)) + { + ErrorMessage = $"Unsupport media format {mediaType}"; + return false; + } + + // TODO: Correct this calculation + if(sectors * sectorSize / DEFAULT_CLUSTER_SIZE > uint.MaxValue) + { + ErrorMessage = "Too many sectors for selected cluster size"; + return false; + } + + imageInfo = new ImageInfo {MediaType = mediaType, SectorSize = sectorSize, Sectors = sectors}; + + try { writingStream = new FileStream(path, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None); } + catch(IOException e) + { + ErrorMessage = $"Could not create new image file, exception {e.Message}"; + return false; + } + + qHdr = new QedHeader + { + magic = QED_MAGIC, + cluster_size = DEFAULT_CLUSTER_SIZE, + table_size = DEFAULT_TABLE_SIZE, + header_size = 1, + l1_table_offset = DEFAULT_CLUSTER_SIZE, + image_size = sectors * sectorSize + }; + + clusterSectors = qHdr.cluster_size / 512; + tableSize = qHdr.cluster_size * qHdr.table_size / 8; + + l1Table = new ulong[tableSize]; + l1Mask = 0; + int c = 0; + clusterBits = Ctz32(qHdr.cluster_size); + l2Mask = (tableSize - 1) << clusterBits; + l1Shift = clusterBits + Ctz32(tableSize); + + for(int i = 0; i < 64; i++) + { + l1Mask <<= 1; + + if(c >= 64 - l1Shift) continue; + + l1Mask += 1; + c++; + } + + sectorMask = 0; + for(int i = 0; i < clusterBits; i++) sectorMask = (sectorMask << 1) + 1; + + byte[] empty = new byte[qHdr.l1_table_offset + tableSize * 8]; + writingStream.Write(empty, 0, empty.Length); + + IsWriting = true; + ErrorMessage = null; + return true; + } + + public bool WriteMediaTag(byte[] data, MediaTagType tag) + { + ErrorMessage = "Writing media tags is not supported."; + return false; + } + + public bool WriteSector(byte[] data, ulong sectorAddress) + { + if(!IsWriting) + { + ErrorMessage = "Tried to write on a non-writable image"; + return false; + } + + if(data.Length != imageInfo.SectorSize) + { + ErrorMessage = "Incorrect data size"; + return false; + } + + if(sectorAddress >= imageInfo.Sectors) + { + ErrorMessage = "Tried to write past image size"; + return false; + } + + // Ignore empty sectors + if(ArrayHelpers.ArrayIsNullOrEmpty(data)) return true; + + ulong byteAddress = sectorAddress * 512; + + ulong l1Off = (byteAddress & l1Mask) >> l1Shift; + + if((long)l1Off >= l1Table.LongLength) + throw new ArgumentOutOfRangeException(nameof(l1Off), + $"Trying to write past L1 table, position {l1Off} of a max {l1Table.LongLength}"); + + if(l1Table[l1Off] == 0) + { + writingStream.Seek(0, SeekOrigin.End); + l1Table[l1Off] = (ulong)writingStream.Position; + byte[] l2TableB = new byte[tableSize * 8]; + writingStream.Seek(0, SeekOrigin.End); + writingStream.Write(l2TableB, 0, l2TableB.Length); + } + + writingStream.Position = (long)l1Table[l1Off]; + + ulong l2Off = (byteAddress & l2Mask) >> clusterBits; + + writingStream.Seek((long)(l1Table[l1Off] + l2Off * 8), SeekOrigin.Begin); + + byte[] entry = new byte[8]; + writingStream.Read(entry, 0, 8); + ulong offset = BitConverter.ToUInt64(entry, 0); + + if(offset == 0) + { + offset = (ulong)writingStream.Length; + byte[] cluster = new byte[qHdr.cluster_size]; + entry = BitConverter.GetBytes(offset); + writingStream.Seek((long)(l1Table[l1Off] + l2Off * 8), SeekOrigin.Begin); + writingStream.Write(entry, 0, 8); + writingStream.Seek(0, SeekOrigin.End); + writingStream.Write(cluster, 0, cluster.Length); + } + + writingStream.Seek((long)(offset + (byteAddress & sectorMask)), SeekOrigin.Begin); + writingStream.Write(data, 0, data.Length); + + ErrorMessage = ""; + return true; + } + + // TODO: This can be optimized + public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) + { + if(!IsWriting) + { + ErrorMessage = "Tried to write on a non-writable image"; + return false; + } + + if(data.Length % imageInfo.SectorSize != 0) + { + ErrorMessage = "Incorrect data size"; + return false; + } + + if(sectorAddress + length > imageInfo.Sectors) + { + ErrorMessage = "Tried to write past image size"; + return false; + } + + // Ignore empty sectors + if(ArrayHelpers.ArrayIsNullOrEmpty(data)) return true; + + for(uint i = 0; i < length; i++) + { + byte[] tmp = new byte[imageInfo.SectorSize]; + Array.Copy(data, i * imageInfo.SectorSize, tmp, 0, imageInfo.SectorSize); + if(!WriteSector(tmp, sectorAddress + i)) return false; + } + + ErrorMessage = ""; + return true; + } + + public bool WriteSectorLong(byte[] data, ulong sectorAddress) + { + ErrorMessage = "Writing sectors with tags is not supported."; + return false; + } + + public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) + { + ErrorMessage = "Writing sectors with tags is not supported."; + return false; + } + + public bool SetTracks(List tracks) + { + ErrorMessage = "Unsupported feature"; + return false; + } + + public bool Close() + { + if(!IsWriting) + { + ErrorMessage = "Image is not opened for writing"; + return false; + } + + byte[] hdr = new byte[Marshal.SizeOf(typeof(QedHeader))]; + IntPtr hdrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(QedHeader))); + Marshal.StructureToPtr(qHdr, hdrPtr, true); + Marshal.Copy(hdrPtr, hdr, 0, hdr.Length); + Marshal.FreeHGlobal(hdrPtr); + + writingStream.Seek(0, SeekOrigin.Begin); + writingStream.Write(hdr, 0, hdr.Length); + + writingStream.Seek((long)qHdr.l1_table_offset, SeekOrigin.Begin); + for(long i = 0; i < l1Table.LongLength; i++) writingStream.Write(BitConverter.GetBytes(l1Table[i]), 0, 8); + + writingStream.Flush(); + writingStream.Close(); + + IsWriting = false; + ErrorMessage = ""; + return true; + } + + public bool SetMetadata(ImageInfo metadata) => true; + + public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; + + public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) + { + ErrorMessage = "Writing sectors with tags is not supported."; + return false; + } + + public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) + { + ErrorMessage = "Writing sectors with tags is not supported."; + return false; + } + + public bool SetDumpHardware(List dumpHardware) => false; + + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/RayDIM/Read.cs b/DiscImageChef.DiscImages/RayDIM/Read.cs index 5e91e6b5c..5cf8c0f8e 100644 --- a/DiscImageChef.DiscImages/RayDIM/Read.cs +++ b/DiscImageChef.DiscImages/RayDIM/Read.cs @@ -83,8 +83,8 @@ namespace DiscImageChef.DiscImages } imageInfo.MediaType = Geometry.GetMediaType(((ushort)imageInfo.Cylinders, (byte)imageInfo.Heads, - (ushort)imageInfo.SectorsPerTrack, 512, MediaEncoding.MFM, - false)); + (ushort)imageInfo.SectorsPerTrack, 512, MediaEncoding.MFM, + false)); switch(imageInfo.MediaType) { @@ -106,10 +106,7 @@ namespace DiscImageChef.DiscImages return true; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); public byte[] ReadSectors(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/RayDIM/Unsupported.cs b/DiscImageChef.DiscImages/RayDIM/Unsupported.cs index 6348f2140..7580d2d45 100644 --- a/DiscImageChef.DiscImages/RayDIM/Unsupported.cs +++ b/DiscImageChef.DiscImages/RayDIM/Unsupported.cs @@ -39,15 +39,9 @@ namespace DiscImageChef.DiscImages { public partial class RayDim { - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { - return null; - } + public bool? VerifySector(ulong sectorAddress, uint track) => null; public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -71,74 +65,45 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/RayDIM/Write.cs b/DiscImageChef.DiscImages/RayDIM/Write.cs index 1fbefd235..09f77e94b 100644 --- a/DiscImageChef.DiscImages/RayDIM/Write.cs +++ b/DiscImageChef.DiscImages/RayDIM/Write.cs @@ -170,11 +170,7 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) - { - // Geometry is set by media type - return true; - } + public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { @@ -188,17 +184,9 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; public bool Close() { @@ -237,9 +225,6 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetMetadata(ImageInfo metadata) - { - return true; - } + public bool SetMetadata(ImageInfo metadata) => true; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Register.cs b/DiscImageChef.DiscImages/Register.cs index 6a35ceca7..c02d86b8a 100644 --- a/DiscImageChef.DiscImages/Register.cs +++ b/DiscImageChef.DiscImages/Register.cs @@ -46,20 +46,11 @@ namespace DiscImageChef.DiscImages { public class Register : IPluginRegister { - public List GetAllChecksumPlugins() - { - return null; - } + public List GetAllChecksumPlugins() => null; - public List GetAllFilesystemPlugins() - { - return null; - } + public List GetAllFilesystemPlugins() => null; - public List GetAllFilterPlugins() - { - return null; - } + public List GetAllFilterPlugins() => null; public List GetAllFloppyImagePlugins() { @@ -73,15 +64,9 @@ namespace DiscImageChef.DiscImages .Where(t => t.GetInterfaces().Contains(typeof(IMediaImage))).Where(t => t.IsClass).ToList(); } - public List GetAllPartitionPlugins() - { - return null; - } + public List GetAllPartitionPlugins() => null; - public List GetAllReadOnlyFilesystemPlugins() - { - return null; - } + public List GetAllReadOnlyFilesystemPlugins() => null; public List GetAllWritableFloppyImagePlugins() { diff --git a/DiscImageChef.DiscImages/RsIde/Read.cs b/DiscImageChef.DiscImages/RsIde/Read.cs index 98bb5d5fb..87e39e8b1 100644 --- a/DiscImageChef.DiscImages/RsIde/Read.cs +++ b/DiscImageChef.DiscImages/RsIde/Read.cs @@ -38,6 +38,7 @@ using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Interfaces; +using DiscImageChef.Decoders.ATA; namespace DiscImageChef.DiscImages { @@ -74,7 +75,7 @@ namespace DiscImageChef.DiscImages { identify = new byte[512]; Array.Copy(hdr.identify, 0, identify, 0, hdr.identify.Length); - Decoders.ATA.Identify.IdentifyDevice? ataId = Decoders.ATA.Identify.Decode(identify); + Identify.IdentifyDevice? ataId = Decoders.ATA.Identify.Decode(identify); if(ataId.HasValue) { @@ -102,10 +103,7 @@ namespace DiscImageChef.DiscImages return true; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); public byte[] ReadSectors(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/RsIde/Unsupported.cs b/DiscImageChef.DiscImages/RsIde/Unsupported.cs index 9eb9f111f..00c7fdcad 100644 --- a/DiscImageChef.DiscImages/RsIde/Unsupported.cs +++ b/DiscImageChef.DiscImages/RsIde/Unsupported.cs @@ -39,75 +39,46 @@ namespace DiscImageChef.DiscImages { public partial class RsIde { - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -120,14 +91,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/RsIde/Write.cs b/DiscImageChef.DiscImages/RsIde/Write.cs index 2dabb6a83..a27c230d2 100644 --- a/DiscImageChef.DiscImages/RsIde/Write.cs +++ b/DiscImageChef.DiscImages/RsIde/Write.cs @@ -38,6 +38,7 @@ using System.Runtime.InteropServices; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Structs; +using DiscImageChef.Decoders.ATA; using Schemas; using Version = DiscImageChef.CommonTypes.Interop.Version; @@ -217,7 +218,7 @@ namespace DiscImageChef.DiscImages if(identify == null) { - Decoders.ATA.Identify.IdentifyDevice ataId = new Decoders.ATA.Identify.IdentifyDevice + Identify.IdentifyDevice ataId = new Identify.IdentifyDevice { GeneralConfiguration = Decoders.ATA.Identify.GeneralConfigurationBit.UltraFastIDE | @@ -229,7 +230,8 @@ namespace DiscImageChef.DiscImages SectorsPerTrack = (ushort)imageInfo.SectorsPerTrack, VendorWord47 = 0x80, Capabilities = - Decoders.ATA.Identify.CapabilitiesBit.DMASupport | Decoders.ATA.Identify.CapabilitiesBit.IORDY | + Decoders.ATA.Identify.CapabilitiesBit.DMASupport | + Decoders.ATA.Identify.CapabilitiesBit.IORDY | Decoders.ATA.Identify.CapabilitiesBit.LBASupport, ExtendedIdentify = Decoders.ATA.Identify.ExtendedIdentifyBit.Words54to58Valid, CurrentCylinders = (ushort)imageInfo.Cylinders, @@ -330,16 +332,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/SaveDskF/Read.cs b/DiscImageChef.DiscImages/SaveDskF/Read.cs index 5a515edb4..ff9527a2e 100644 --- a/DiscImageChef.DiscImages/SaveDskF/Read.cs +++ b/DiscImageChef.DiscImages/SaveDskF/Read.cs @@ -108,7 +108,7 @@ namespace DiscImageChef.DiscImages imageInfo.SectorSize = header.sectorSize; imageInfo.MediaType = Geometry.GetMediaType((header.cylinders, (byte)header.heads, header.sectorsPerTrack, - header.sectorSize, MediaEncoding.MFM, false)); + header.sectorSize, MediaEncoding.MFM, false)); imageInfo.XmlMediaType = XmlMediaType.BlockMedia; @@ -133,15 +133,9 @@ namespace DiscImageChef.DiscImages return true; } - public bool? VerifyMediaImage() - { - return calculatedChk == header.checksum; - } + public bool? VerifyMediaImage() => calculatedChk == header.checksum; - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); public byte[] ReadSectors(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/SaveDskF/Unsupported.cs b/DiscImageChef.DiscImages/SaveDskF/Unsupported.cs index ede36d6ca..70f7fee3a 100644 --- a/DiscImageChef.DiscImages/SaveDskF/Unsupported.cs +++ b/DiscImageChef.DiscImages/SaveDskF/Unsupported.cs @@ -39,15 +39,9 @@ namespace DiscImageChef.DiscImages { public partial class SaveDskF { - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { - return null; - } + public bool? VerifySector(ulong sectorAddress, uint track) => null; public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -71,69 +65,43 @@ namespace DiscImageChef.DiscImages return null; } - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/SaveDskF/Write.cs b/DiscImageChef.DiscImages/SaveDskF/Write.cs index 396d36751..bcc0a4b12 100644 --- a/DiscImageChef.DiscImages/SaveDskF/Write.cs +++ b/DiscImageChef.DiscImages/SaveDskF/Write.cs @@ -234,11 +234,7 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) - { - // Geometry is set by media type - return true; - } + public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { @@ -252,16 +248,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/SuperCardPro/Read.cs b/DiscImageChef.DiscImages/SuperCardPro/Read.cs index a3a52c0c7..0ea70b225 100644 --- a/DiscImageChef.DiscImages/SuperCardPro/Read.cs +++ b/DiscImageChef.DiscImages/SuperCardPro/Read.cs @@ -228,51 +228,32 @@ namespace DiscImageChef.DiscImages throw new NotImplementedException("Flux decoding is not yet implemented."); } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public byte[] ReadSectors(ulong sectorAddress, uint length) - { + public byte[] ReadSectors(ulong sectorAddress, uint length) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } - public bool? VerifySector(ulong sectorAddress) - { + public bool? VerifySector(ulong sectorAddress) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new NotImplementedException("Flux decoding is not yet implemented."); - } public bool? VerifyMediaImage() { diff --git a/DiscImageChef.DiscImages/SuperCardPro/Unsupported.cs b/DiscImageChef.DiscImages/SuperCardPro/Unsupported.cs index d69774e68..20237eb68 100644 --- a/DiscImageChef.DiscImages/SuperCardPro/Unsupported.cs +++ b/DiscImageChef.DiscImages/SuperCardPro/Unsupported.cs @@ -39,55 +39,35 @@ namespace DiscImageChef.DiscImages { public partial class SuperCardPro { - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/T98/Read.cs b/DiscImageChef.DiscImages/T98/Read.cs index fa968656b..0bfb7fdbd 100644 --- a/DiscImageChef.DiscImages/T98/Read.cs +++ b/DiscImageChef.DiscImages/T98/Read.cs @@ -74,10 +74,7 @@ namespace DiscImageChef.DiscImages return true; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); public byte[] ReadSectors(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/T98/Unsupported.cs b/DiscImageChef.DiscImages/T98/Unsupported.cs index ffbb3d988..4416665f0 100644 --- a/DiscImageChef.DiscImages/T98/Unsupported.cs +++ b/DiscImageChef.DiscImages/T98/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class T98 { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/T98/Write.cs b/DiscImageChef.DiscImages/T98/Write.cs index 5254629fa..4c739bbb8 100644 --- a/DiscImageChef.DiscImages/T98/Write.cs +++ b/DiscImageChef.DiscImages/T98/Write.cs @@ -170,11 +170,7 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) - { - // Format uses fixed geometry for heads and sectors per track, cylinders must be calculated on closing. - return true; - } + public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { @@ -188,21 +184,10 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; - public bool SetMetadata(ImageInfo metadata) - { - return true; - } + public bool SetMetadata(ImageInfo metadata) => true; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/TeleDisk/Read.cs b/DiscImageChef.DiscImages/TeleDisk/Read.cs index 5a9e34c96..e55299f20 100644 --- a/DiscImageChef.DiscImages/TeleDisk/Read.cs +++ b/DiscImageChef.DiscImages/TeleDisk/Read.cs @@ -519,25 +519,13 @@ namespace DiscImageChef.DiscImages return buffer.ToArray(); } - public byte[] ReadSectorLong(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectors(sectorAddress, 1); - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { - return ReadSectors(sectorAddress, length); - } + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => ReadSectors(sectorAddress, length); - public bool? VerifySector(ulong sectorAddress) - { - return !sectorsWhereCrcHasFailed.Contains(sectorAddress); - } + public bool? VerifySector(ulong sectorAddress) => !sectorsWhereCrcHasFailed.Contains(sectorAddress); - public bool? VerifySector(ulong sectorAddress, uint track) - { - return null; - } + public bool? VerifySector(ulong sectorAddress, uint track) => null; public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -563,10 +551,7 @@ namespace DiscImageChef.DiscImages return null; } - public bool? VerifyMediaImage() - { - return aDiskCrcHasFailed; - } + public bool? VerifyMediaImage() => aDiskCrcHasFailed; public byte[] ReadDiskTag(MediaTagType tag) { diff --git a/DiscImageChef.DiscImages/TeleDisk/Unsupported.cs b/DiscImageChef.DiscImages/TeleDisk/Unsupported.cs index ddcc3ee43..c23afdd78 100644 --- a/DiscImageChef.DiscImages/TeleDisk/Unsupported.cs +++ b/DiscImageChef.DiscImages/TeleDisk/Unsupported.cs @@ -39,54 +39,34 @@ namespace DiscImageChef.DiscImages { public partial class TeleDisk { - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/UDIF/Read.cs b/DiscImageChef.DiscImages/UDIF/Read.cs index b7e22e001..1541ee0dc 100644 --- a/DiscImageChef.DiscImages/UDIF/Read.cs +++ b/DiscImageChef.DiscImages/UDIF/Read.cs @@ -394,7 +394,8 @@ namespace DiscImageChef.DiscImages decStream = new ZlibStream(cmpMs, CompressionMode.Decompress); break; case CHUNK_TYPE_BZIP: - decStream = new BZip2Stream(cmpMs, SharpCompress.Compressors.CompressionMode.Decompress, false); + decStream = new BZip2Stream(cmpMs, SharpCompress.Compressors.CompressionMode.Decompress, + false); break; case CHUNK_TYPE_RLE: break; default: diff --git a/DiscImageChef.DiscImages/UDIF/Unsupported.cs b/DiscImageChef.DiscImages/UDIF/Unsupported.cs index 6dd0b02a6..bf33fc77c 100644 --- a/DiscImageChef.DiscImages/UDIF/Unsupported.cs +++ b/DiscImageChef.DiscImages/UDIF/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class Udif { - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/UDIF/Write.cs b/DiscImageChef.DiscImages/UDIF/Write.cs index a3b199a8b..e02146d4b 100644 --- a/DiscImageChef.DiscImages/UDIF/Write.cs +++ b/DiscImageChef.DiscImages/UDIF/Write.cs @@ -283,10 +283,16 @@ namespace DiscImageChef.DiscImages new NSDictionary { {"Attributes", "0x0050"}, - {"CFName", "whole disk (DiscImageChef : 0)"}, + { + "CFName", + "whole disk (DiscImageChef : 0)" + }, {"Data", chunkMs.ToArray()}, {"ID", "0"}, - {"Name", "whole disk (DiscImageChef : 0)"} + { + "Name", + "whole disk (DiscImageChef : 0)" + } } } } @@ -355,16 +361,9 @@ namespace DiscImageChef.DiscImages } // TODO: Comments - public bool SetMetadata(ImageInfo metadata) - { - return true; - } + public bool SetMetadata(ImageInfo metadata) => true; - public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) - { - // Not stored in image - return true; - } + public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { @@ -378,16 +377,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/UkvFdi/Unsupported.cs b/DiscImageChef.DiscImages/UkvFdi/Unsupported.cs index a8625addf..ce993f6b4 100644 --- a/DiscImageChef.DiscImages/UkvFdi/Unsupported.cs +++ b/DiscImageChef.DiscImages/UkvFdi/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class UkvFdi { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/VDI/Unsupported.cs b/DiscImageChef.DiscImages/VDI/Unsupported.cs index d9949b8e8..7d13ee68e 100644 --- a/DiscImageChef.DiscImages/VDI/Unsupported.cs +++ b/DiscImageChef.DiscImages/VDI/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class Vdi { - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/VDI/Write.cs b/DiscImageChef.DiscImages/VDI/Write.cs index 9edf22cae..7d72edb68 100644 --- a/DiscImageChef.DiscImages/VDI/Write.cs +++ b/DiscImageChef.DiscImages/VDI/Write.cs @@ -293,16 +293,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/VHD/Unsupported.cs b/DiscImageChef.DiscImages/VHD/Unsupported.cs index 1f25376c9..06c59a33e 100644 --- a/DiscImageChef.DiscImages/VHD/Unsupported.cs +++ b/DiscImageChef.DiscImages/VHD/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class Vhd { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/VHD/Write.cs b/DiscImageChef.DiscImages/VHD/Write.cs index 3836900d0..8793d9bc5 100644 --- a/DiscImageChef.DiscImages/VHD/Write.cs +++ b/DiscImageChef.DiscImages/VHD/Write.cs @@ -197,9 +197,10 @@ namespace DiscImageChef.DiscImages CreatorVersion = (uint)(((thisVersion.Major & 0xFF) << 24) + ((thisVersion.Minor & 0xFF) << 16) + ((thisVersion.Build & 0xFF) << 8) + (thisVersion.Revision & 0xFF)), - CreatorHostOs = DetectOS.GetRealPlatformID() == PlatformID.MacOSX ? CREATOR_MACINTOSH : CREATOR_WINDOWS, - DiskType = TYPE_FIXED, - UniqueId = Guid.NewGuid(), + CreatorHostOs = + DetectOS.GetRealPlatformID() == PlatformID.MacOSX ? CREATOR_MACINTOSH : CREATOR_WINDOWS, + DiskType = TYPE_FIXED, + UniqueId = Guid.NewGuid(), DiskGeometry = ((imageInfo.Cylinders & 0xFFFF) << 16) + ((imageInfo.Heads & 0xFF) << 8) + (imageInfo.SectorsPerTrack & 0xFF), @@ -238,10 +239,7 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetMetadata(ImageInfo metadata) - { - return true; - } + public bool SetMetadata(ImageInfo metadata) => true; public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { @@ -282,16 +280,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/VHDX/Read.cs b/DiscImageChef.DiscImages/VHDX/Read.cs index 95e7cf2dc..a8e674cf6 100644 --- a/DiscImageChef.DiscImages/VHDX/Read.cs +++ b/DiscImageChef.DiscImages/VHDX/Read.cs @@ -183,8 +183,7 @@ namespace DiscImageChef.DiscImages stream.Read(tmp, 0, 8); vFileParms = new VhdxFileParameters { - blockSize = BitConverter.ToUInt32(tmp, 0), - flags = BitConverter.ToUInt32(tmp, 4) + blockSize = BitConverter.ToUInt32(tmp, 0), flags = BitConverter.ToUInt32(tmp, 4) }; } else throw new Exception("File parameters not found."); diff --git a/DiscImageChef.DiscImages/VHDX/Unsupported.cs b/DiscImageChef.DiscImages/VHDX/Unsupported.cs index 0e124178d..eb130294b 100644 --- a/DiscImageChef.DiscImages/VHDX/Unsupported.cs +++ b/DiscImageChef.DiscImages/VHDX/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class Vhdx { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/VMware/Constants.cs b/DiscImageChef.DiscImages/VMware/Constants.cs index 6923ac06f..0125e92c9 100644 --- a/DiscImageChef.DiscImages/VMware/Constants.cs +++ b/DiscImageChef.DiscImages/VMware/Constants.cs @@ -86,8 +86,8 @@ namespace DiscImageChef.DiscImages const uint MAX_CACHED_SECTORS = MAX_CACHE_SIZE / SECTOR_SIZE; readonly byte[] ddfMagicBytes = { - 0x23, 0x20, 0x44, 0x69, 0x73, 0x6B, 0x20, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6F, 0x72, 0x46, - 0x69, 0x6C, 0x65 + 0x23, 0x20, 0x44, 0x69, 0x73, 0x6B, 0x20, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6F, 0x72, + 0x46, 0x69, 0x6C, 0x65 }; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/VMware/Properties.cs b/DiscImageChef.DiscImages/VMware/Properties.cs index b1023ed87..91b425796 100644 --- a/DiscImageChef.DiscImages/VMware/Properties.cs +++ b/DiscImageChef.DiscImages/VMware/Properties.cs @@ -73,7 +73,7 @@ namespace DiscImageChef.DiscImages new[] { ("adapter_type", typeof(string), - "Type of adapter type. Possible values: ide, lsilogic, buslogic, legacyESX.", "ide"), + "Type of adapter type. Possible values: ide, lsilogic, buslogic, legacyESX.", "ide"), ("hwversion", typeof(uint), "VDMK hardware version.", 4), ("sparse", typeof(bool), "Use sparse extents.", (object)false), ("split", typeof(bool), "Split data file at 2GiB.", (object)false) diff --git a/DiscImageChef.DiscImages/VMware/Structs.cs b/DiscImageChef.DiscImages/VMware/Structs.cs index 73f8d3b4d..2f69bf346 100644 --- a/DiscImageChef.DiscImages/VMware/Structs.cs +++ b/DiscImageChef.DiscImages/VMware/Structs.cs @@ -40,24 +40,23 @@ namespace DiscImageChef.DiscImages [StructLayout(LayoutKind.Sequential, Pack = 1)] struct VMwareExtentHeader { - public uint magic; - public uint version; - public uint flags; - public ulong capacity; - public ulong grainSize; - public ulong descriptorOffset; - public ulong descriptorSize; - public uint GTEsPerGT; - public ulong rgdOffset; - public ulong gdOffset; - public ulong overhead; - [MarshalAs(UnmanagedType.U1)] - public bool uncleanShutdown; - public byte singleEndLineChar; - public byte nonEndLineChar; - public byte doubleEndLineChar1; - public byte doubleEndLineChar2; - public ushort compression; + public uint magic; + public uint version; + public uint flags; + public ulong capacity; + public ulong grainSize; + public ulong descriptorOffset; + public ulong descriptorSize; + public uint GTEsPerGT; + public ulong rgdOffset; + public ulong gdOffset; + public ulong overhead; + [MarshalAs(UnmanagedType.U1)] public bool uncleanShutdown; + public byte singleEndLineChar; + public byte nonEndLineChar; + public byte doubleEndLineChar1; + public byte doubleEndLineChar2; + public ushort compression; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 433)] public byte[] padding; } @@ -88,8 +87,7 @@ namespace DiscImageChef.DiscImages public uint savedGeneration; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] reserved; - [MarshalAs(UnmanagedType.U1)] - public bool uncleanShutdown; + [MarshalAs(UnmanagedType.U1)] public bool uncleanShutdown; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 396)] public byte[] padding; } diff --git a/DiscImageChef.DiscImages/VMware/Unsupported.cs b/DiscImageChef.DiscImages/VMware/Unsupported.cs index 1542dc2b9..03161a336 100644 --- a/DiscImageChef.DiscImages/VMware/Unsupported.cs +++ b/DiscImageChef.DiscImages/VMware/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class VMware { - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/VMware/Write.cs b/DiscImageChef.DiscImages/VMware/Write.cs index fc946f6c4..3609194d3 100644 --- a/DiscImageChef.DiscImages/VMware/Write.cs +++ b/DiscImageChef.DiscImages/VMware/Write.cs @@ -284,10 +284,7 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetMetadata(ImageInfo metadata) - { - return true; - } + public bool SetMetadata(ImageInfo metadata) => true; public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { @@ -328,16 +325,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Virtual98/Read.cs b/DiscImageChef.DiscImages/Virtual98/Read.cs index 3804ce3ca..e3e94ac37 100644 --- a/DiscImageChef.DiscImages/Virtual98/Read.cs +++ b/DiscImageChef.DiscImages/Virtual98/Read.cs @@ -79,10 +79,7 @@ namespace DiscImageChef.DiscImages return true; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); public byte[] ReadSectors(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/Virtual98/Unsupported.cs b/DiscImageChef.DiscImages/Virtual98/Unsupported.cs index 82d0a39ef..92bb20798 100644 --- a/DiscImageChef.DiscImages/Virtual98/Unsupported.cs +++ b/DiscImageChef.DiscImages/Virtual98/Unsupported.cs @@ -39,80 +39,49 @@ namespace DiscImageChef.DiscImages { public partial class Virtual98 { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) @@ -125,14 +94,9 @@ namespace DiscImageChef.DiscImages } public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/Virtual98/Write.cs b/DiscImageChef.DiscImages/Virtual98/Write.cs index 47ffb2028..f07957c40 100644 --- a/DiscImageChef.DiscImages/Virtual98/Write.cs +++ b/DiscImageChef.DiscImages/Virtual98/Write.cs @@ -270,16 +270,8 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/WCDiskImage/Identify.cs b/DiscImageChef.DiscImages/WCDiskImage/Identify.cs index b76845325..7d9e7ac95 100644 --- a/DiscImageChef.DiscImages/WCDiskImage/Identify.cs +++ b/DiscImageChef.DiscImages/WCDiskImage/Identify.cs @@ -33,8 +33,8 @@ using System; using System.IO; -using System.Text; using System.Runtime.InteropServices; +using System.Text; using DiscImageChef.CommonTypes.Interfaces; namespace DiscImageChef.DiscImages @@ -46,33 +46,33 @@ namespace DiscImageChef.DiscImages Stream stream = imageFilter.GetDataForkStream(); stream.Seek(0, SeekOrigin.Begin); - if (stream.Length < 32) return false; + if(stream.Length < 32) return false; byte[] header = new byte[32]; stream.Read(header, 0, 32); IntPtr hdrPtr = Marshal.AllocHGlobal(32); Marshal.Copy(header, 0, hdrPtr, 32); - WCDiskImageFileHeader fheader = (WCDiskImageFileHeader)Marshal.PtrToStructure(hdrPtr, typeof(WCDiskImageFileHeader)); + WCDiskImageFileHeader fheader = + (WCDiskImageFileHeader)Marshal.PtrToStructure(hdrPtr, typeof(WCDiskImageFileHeader)); Marshal.FreeHGlobal(hdrPtr); /* check the signature */ - if (Encoding.ASCII.GetString(fheader.signature).TrimEnd('\x00') != WCDiskImage.fileSignature) - return false; + if(Encoding.ASCII.GetString(fheader.signature).TrimEnd('\x00') != fileSignature) return false; /* Some sanity checks on the values we just read. */ - if (fheader.version > 1) return false; + if(fheader.version > 1) return false; - if (fheader.heads < 1 || fheader.heads > 2) return false; + if(fheader.heads < 1 || fheader.heads > 2) return false; - if (fheader.sectorsPerTrack < 8 || fheader.sectorsPerTrack > 18) return false; + if(fheader.sectorsPerTrack < 8 || fheader.sectorsPerTrack > 18) return false; - if (fheader.cylinders < 1 || fheader.cylinders > 80) return false; + if(fheader.cylinders < 1 || fheader.cylinders > 80) return false; - if (fheader.extraTracks[0] > 1 || fheader.extraTracks[1] > 1 || fheader.extraTracks[2] > 1 || fheader.extraTracks[3] > 1) - return false; + if(fheader.extraTracks[0] > 1 || fheader.extraTracks[1] > 1 || fheader.extraTracks[2] > 1 || + fheader.extraTracks[3] > 1) return false; - if (((byte)fheader.extraFlags & ~0x03) != 0) return false; + if(((byte)fheader.extraFlags & ~0x03) != 0) return false; // TODO: validate all sectors // For now, having a valid header will suffice. diff --git a/DiscImageChef.DiscImages/WCDiskImage/Read.cs b/DiscImageChef.DiscImages/WCDiskImage/Read.cs index 51e5654c4..ed22d3298 100644 --- a/DiscImageChef.DiscImages/WCDiskImage/Read.cs +++ b/DiscImageChef.DiscImages/WCDiskImage/Read.cs @@ -33,18 +33,172 @@ using System; using System.IO; -using System.Text; using System.Runtime.InteropServices; +using System.Text; +using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Interfaces; using DiscImageChef.Console; -using DiscImageChef.Checksums; namespace DiscImageChef.DiscImages { public partial class WCDiskImage { + public bool Open(IFilter imageFilter) + { + string comments = string.Empty; + Stream stream = imageFilter.GetDataForkStream(); + stream.Seek(0, SeekOrigin.Begin); + + byte[] header = new byte[32]; + stream.Read(header, 0, 32); + + IntPtr hdrPtr = Marshal.AllocHGlobal(32); + Marshal.Copy(header, 0, hdrPtr, 32); + WCDiskImageFileHeader fheader = + (WCDiskImageFileHeader)Marshal.PtrToStructure(hdrPtr, typeof(WCDiskImageFileHeader)); + Marshal.FreeHGlobal(hdrPtr); + DicConsole.DebugWriteLine("d2f plugin", + "Detected WC DISK IMAGE with {0} heads, {1} tracks and {2} sectors per track.", + fheader.heads, fheader.cylinders, fheader.sectorsPerTrack); + + imageInfo.Cylinders = fheader.cylinders; + imageInfo.SectorsPerTrack = fheader.sectorsPerTrack; + imageInfo.SectorSize = 512; // only 512 bytes per sector supported + imageInfo.Heads = fheader.heads; + imageInfo.Sectors = imageInfo.Heads * imageInfo.Cylinders * imageInfo.SectorsPerTrack; + imageInfo.ImageSize = imageInfo.Sectors * imageInfo.SectorSize; + + imageInfo.XmlMediaType = XmlMediaType.BlockMedia; + + imageInfo.CreationTime = imageFilter.GetCreationTime(); + imageInfo.LastModificationTime = imageFilter.GetLastWriteTime(); + imageInfo.MediaTitle = Path.GetFileNameWithoutExtension(imageFilter.GetFilename()); + imageInfo.MediaType = Geometry.GetMediaType(((ushort)imageInfo.Cylinders, (byte)imageInfo.Heads, + (ushort)imageInfo.SectorsPerTrack, 512, MediaEncoding.MFM, + false)); + + /* buffer the entire disk in memory */ + for(int cyl = 0; cyl < imageInfo.Cylinders; cyl++) + { + for(int head = 0; head < imageInfo.Heads; head++) ReadTrack(stream, cyl, head); + } + + /* if there are extra tracks, read them as well */ + if(fheader.extraTracks[0] == 1) + { + DicConsole.DebugWriteLine("d2f plugin", "Extra track 1 (head 0) present, reading"); + ReadTrack(stream, (int)imageInfo.Cylinders, 0); + } + + if(fheader.extraTracks[1] == 1) + { + DicConsole.DebugWriteLine("d2f plugin", "Extra track 1 (head 1) present, reading"); + ReadTrack(stream, (int)imageInfo.Cylinders, 1); + } + + if(fheader.extraTracks[2] == 1) + { + DicConsole.DebugWriteLine("d2f plugin", "Extra track 2 (head 0) present, reading"); + ReadTrack(stream, (int)imageInfo.Cylinders + 1, 0); + } + + if(fheader.extraTracks[3] == 1) + { + DicConsole.DebugWriteLine("d2f plugin", "Extra track 2 (head 1) present, reading"); + ReadTrack(stream, (int)imageInfo.Cylinders + 1, 1); + } + + /* adjust number of cylinders */ + if(fheader.extraTracks[0] == 1 || fheader.extraTracks[1] == 1) imageInfo.Cylinders++; + if(fheader.extraTracks[2] == 1 || fheader.extraTracks[3] == 1) imageInfo.Cylinders++; + + /* read the comment and directory data if present */ + if(fheader.extraFlags.HasFlag(ExtraFlag.Comment)) + { + DicConsole.DebugWriteLine("d2f plugin", "Comment present, reading"); + byte[] sheaderBuffer = new byte[6]; + stream.Read(sheaderBuffer, 0, 6); + IntPtr sectPtr = Marshal.AllocHGlobal(6); + Marshal.Copy(sheaderBuffer, 0, sectPtr, 6); + WCDiskImageSectorHeader sheader = + (WCDiskImageSectorHeader)Marshal.PtrToStructure(sectPtr, typeof(WCDiskImageSectorHeader)); + Marshal.FreeHGlobal(sectPtr); + + if(sheader.flag != SectorFlag.Comment) + throw new InvalidDataException(string.Format("Invalid sector type '{0}' encountered", + sheader.flag.ToString())); + + byte[] comm = new byte[sheader.crc]; + stream.Read(comm, 0, sheader.crc); + comments += Encoding.ASCII.GetString(comm) + Environment.NewLine; + } + + if(fheader.extraFlags.HasFlag(ExtraFlag.Directory)) + { + DicConsole.DebugWriteLine("d2f plugin", "Directory listing present, reading"); + byte[] sheaderBuffer = new byte[6]; + stream.Read(sheaderBuffer, 0, 6); + IntPtr sectPtr = Marshal.AllocHGlobal(6); + Marshal.Copy(sheaderBuffer, 0, sectPtr, 6); + WCDiskImageSectorHeader sheader = + (WCDiskImageSectorHeader)Marshal.PtrToStructure(sectPtr, typeof(WCDiskImageSectorHeader)); + Marshal.FreeHGlobal(sectPtr); + + if(sheader.flag != SectorFlag.Directory) + throw new InvalidDataException(string.Format("Invalid sector type '{0}' encountered", + sheader.flag.ToString())); + + byte[] dir = new byte[sheader.crc]; + stream.Read(dir, 0, sheader.crc); + comments += Encoding.ASCII.GetString(dir); + } + + if(comments.Length > 0) imageInfo.Comments = comments; + + // save some variables for later use + fileHeader = fheader; + wcImageFilter = imageFilter; + return true; + } + + public byte[] ReadSector(ulong sectorAddress) + { + int sectorNumber = (int)(sectorAddress % imageInfo.SectorsPerTrack) + 1; + int trackNumber = (int)(sectorAddress / imageInfo.SectorsPerTrack); + int headNumber = imageInfo.Heads > 1 ? trackNumber % 2 : 0; + int cylinderNumber = imageInfo.Heads > 1 ? trackNumber / 2 : trackNumber; + + if(badSectors[(cylinderNumber, headNumber, sectorNumber)]) + { + DicConsole.DebugWriteLine("d2f plugin", "reading bad sector {0} ({1},{2},{3})", sectorAddress, + cylinderNumber, headNumber, sectorNumber); + + /* if we have sector data, return that */ + if(sectorCache.ContainsKey((cylinderNumber, headNumber, sectorNumber))) + return sectorCache[(cylinderNumber, headNumber, sectorNumber)]; + + /* otherwise, return an empty sector */ + return new byte[512]; + } + + return sectorCache[(cylinderNumber, headNumber, sectorNumber)]; + } + + public byte[] ReadSectors(ulong sectorAddress, uint length) + { + byte[] result = new byte[length * imageInfo.SectorSize]; + + if(sectorAddress + length > imageInfo.Sectors) + throw new ArgumentOutOfRangeException(nameof(length), "Requested more sectors than available"); + + for(int i = 0; i < length; i++) + ReadSector(sectorAddress + (ulong)i).CopyTo(result, i * imageInfo.SectorSize); + + return result; + } + /// /// Read a whole track and cache it /// @@ -55,42 +209,44 @@ namespace DiscImageChef.DiscImages { byte[] sectorData; byte[] crc; - short calculatedCRC; + short calculatedCRC; - for (int sect = 1; sect < imageInfo.SectorsPerTrack + 1; sect++) + for(int sect = 1; sect < imageInfo.SectorsPerTrack + 1; sect++) { /* read the sector header */ byte[] sheaderBuffer = new byte[6]; stream.Read(sheaderBuffer, 0, 6); IntPtr sectPtr = Marshal.AllocHGlobal(6); Marshal.Copy(sheaderBuffer, 0, sectPtr, 6); - WCDiskImageSectorHeader sheader = (WCDiskImageSectorHeader)Marshal.PtrToStructure(sectPtr, typeof(WCDiskImageSectorHeader)); + WCDiskImageSectorHeader sheader = + (WCDiskImageSectorHeader)Marshal.PtrToStructure(sectPtr, typeof(WCDiskImageSectorHeader)); Marshal.FreeHGlobal(sectPtr); /* validate the sector header */ - if ((sheader.cylinder != cyl) || (sheader.head != head) || (sheader.sector != sect)) - throw new InvalidDataException(String.Format("Unexpected sector encountered. Found CHS {0},{1},{2} but expected {3},{4},{5}", - sheader.cylinder, sheader.head, sheader.sector, cyl, head, sect)); + if(sheader.cylinder != cyl || sheader.head != head || sheader.sector != sect) + throw new + InvalidDataException(string.Format("Unexpected sector encountered. Found CHS {0},{1},{2} but expected {3},{4},{5}", + sheader.cylinder, sheader.head, sheader.sector, cyl, head, + sect)); sectorData = new byte[512]; /* read the sector data */ - switch (sheader.flag) + switch(sheader.flag) { case SectorFlag.Normal: /* read a normal sector and store it in cache */ stream.Read(sectorData, 0, 512); sectorCache[(cyl, head, sect)] = sectorData; Crc16Context.Data(sectorData, 512, out crc); - calculatedCRC = (short)(256 * crc[0] | crc[1]); + calculatedCRC = (short)((256 * crc[0]) | crc[1]); /* DicConsole.DebugWriteLine("d2f plugin", "CHS {0},{1},{2}: Regular sector, stored CRC=0x{3:x4}, calculated CRC=0x{4:x4}", cyl, head, sect, sheader.crc, 256 * crc[0] + crc[1]); */ badSectors[(cyl, head, sect)] = sheader.crc != calculatedCRC; - if (calculatedCRC != sheader.crc) - { - DicConsole.DebugWriteLine("d2f plugin", "CHS {0},{1},{2}: CRC mismatch: stored CRC=0x{3:x4}, calculated CRC=0x{4:x4}", - cyl, head, sect, sheader.crc, calculatedCRC); - } + if(calculatedCRC != sheader.crc) + DicConsole.DebugWriteLine("d2f plugin", + "CHS {0},{1},{2}: CRC mismatch: stored CRC=0x{3:x4}, calculated CRC=0x{4:x4}", + cyl, head, sect, sheader.crc, calculatedCRC); break; case SectorFlag.BadSector: @@ -106,169 +262,17 @@ namespace DiscImageChef.DiscImages DicConsole.DebugWriteLine("d2f plugin", "CHS {0},{1},{2}: RepeatByte sector, fill byte 0x{0:x2}", cyl, head, sect, sheader.crc & 0xff); */ - for (int i = 0; i < 512; i++) sectorData[i] = (byte)(sheader.crc & 0xff); + for(int i = 0; i < 512; i++) sectorData[i] = (byte)(sheader.crc & 0xff); sectorCache[(cyl, head, sect)] = sectorData; - badSectors[(cyl, head, sect)] = false; + badSectors[(cyl, head, sect)] = false; break; default: - throw new InvalidDataException(String.Format("Invalid sector type '{0}' encountered", sheader.flag.ToString())); + throw new InvalidDataException(string.Format("Invalid sector type '{0}' encountered", + sheader.flag.ToString())); } } } - - public bool Open(IFilter imageFilter) - { - string comments = String.Empty; - Stream stream = imageFilter.GetDataForkStream(); - stream.Seek(0, SeekOrigin.Begin); - - byte[] header = new byte[32]; - stream.Read(header, 0, 32); - - IntPtr hdrPtr = Marshal.AllocHGlobal(32); - Marshal.Copy(header, 0, hdrPtr, 32); - WCDiskImageFileHeader fheader = (WCDiskImageFileHeader)Marshal.PtrToStructure(hdrPtr, typeof(WCDiskImageFileHeader)); - Marshal.FreeHGlobal(hdrPtr); - DicConsole.DebugWriteLine("d2f plugin", - "Detected WC DISK IMAGE with {0} heads, {1} tracks and {2} sectors per track.", - fheader.heads, fheader.cylinders, fheader.sectorsPerTrack); - - imageInfo.Cylinders = (uint)fheader.cylinders; - imageInfo.SectorsPerTrack = fheader.sectorsPerTrack; - imageInfo.SectorSize = 512; // only 512 bytes per sector supported - imageInfo.Heads = fheader.heads; - imageInfo.Sectors = imageInfo.Heads * imageInfo.Cylinders * imageInfo.SectorsPerTrack; - imageInfo.ImageSize = imageInfo.Sectors * imageInfo.SectorSize; - - imageInfo.XmlMediaType = XmlMediaType.BlockMedia; - - imageInfo.CreationTime = imageFilter.GetCreationTime(); - imageInfo.LastModificationTime = imageFilter.GetLastWriteTime(); - imageInfo.MediaTitle = Path.GetFileNameWithoutExtension(imageFilter.GetFilename()); - imageInfo.MediaType = Geometry.GetMediaType(((ushort)imageInfo.Cylinders, (byte)imageInfo.Heads, - (ushort)imageInfo.SectorsPerTrack, 512, MediaEncoding.MFM, - false)); - - /* buffer the entire disk in memory */ - for (int cyl = 0; cyl < imageInfo.Cylinders; cyl++) - { - for (int head = 0; head < imageInfo.Heads; head++) - { - ReadTrack(stream, cyl, head); - } - } - - /* if there are extra tracks, read them as well */ - if (fheader.extraTracks[0] == 1) - { - DicConsole.DebugWriteLine("d2f plugin", "Extra track 1 (head 0) present, reading"); - ReadTrack(stream, (int)imageInfo.Cylinders, 0); - } - if (fheader.extraTracks[1] == 1) - { - DicConsole.DebugWriteLine("d2f plugin", "Extra track 1 (head 1) present, reading"); - ReadTrack(stream, (int)imageInfo.Cylinders, 1); - } - if (fheader.extraTracks[2] == 1) - { - DicConsole.DebugWriteLine("d2f plugin", "Extra track 2 (head 0) present, reading"); - ReadTrack(stream, (int)imageInfo.Cylinders + 1, 0); - } - if (fheader.extraTracks[3] == 1) - { - DicConsole.DebugWriteLine("d2f plugin", "Extra track 2 (head 1) present, reading"); - ReadTrack(stream, (int)imageInfo.Cylinders + 1, 1); - } - - /* adjust number of cylinders */ - if (fheader.extraTracks[0] == 1 || fheader.extraTracks[1] == 1) - imageInfo.Cylinders++; - if (fheader.extraTracks[2] == 1 || fheader.extraTracks[3] == 1) - imageInfo.Cylinders++; - - /* read the comment and directory data if present */ - if (fheader.extraFlags.HasFlag(ExtraFlag.Comment)) - { - DicConsole.DebugWriteLine("d2f plugin", "Comment present, reading"); - byte[] sheaderBuffer = new byte[6]; - stream.Read(sheaderBuffer, 0, 6); - IntPtr sectPtr = Marshal.AllocHGlobal(6); - Marshal.Copy(sheaderBuffer, 0, sectPtr, 6); - WCDiskImageSectorHeader sheader = (WCDiskImageSectorHeader)Marshal.PtrToStructure(sectPtr, typeof(WCDiskImageSectorHeader)); - Marshal.FreeHGlobal(sectPtr); - - if (sheader.flag != SectorFlag.Comment) - throw new InvalidDataException(String.Format("Invalid sector type '{0}' encountered", sheader.flag.ToString())); - - byte[] comm = new byte[sheader.crc]; - stream.Read(comm, 0, sheader.crc); - comments += Encoding.ASCII.GetString(comm) + Environment.NewLine; - } - - if (fheader.extraFlags.HasFlag(ExtraFlag.Directory)) - { - DicConsole.DebugWriteLine("d2f plugin", "Directory listing present, reading"); - byte[] sheaderBuffer = new byte[6]; - stream.Read(sheaderBuffer, 0, 6); - IntPtr sectPtr = Marshal.AllocHGlobal(6); - Marshal.Copy(sheaderBuffer, 0, sectPtr, 6); - WCDiskImageSectorHeader sheader = (WCDiskImageSectorHeader)Marshal.PtrToStructure(sectPtr, typeof(WCDiskImageSectorHeader)); - Marshal.FreeHGlobal(sectPtr); - - if (sheader.flag != SectorFlag.Directory) - throw new InvalidDataException(String.Format("Invalid sector type '{0}' encountered", sheader.flag.ToString())); - - byte[] dir = new byte[sheader.crc]; - stream.Read(dir, 0, sheader.crc); - comments += Encoding.ASCII.GetString(dir); - } - if (comments.Length > 0) - imageInfo.Comments = comments; - - // save some variables for later use - fileHeader = fheader; - wcImageFilter = imageFilter; - return true; - } - - public byte[] ReadSector(ulong sectorAddress) - { - int sectorNumber = (int)(sectorAddress % imageInfo.SectorsPerTrack) + 1; - int trackNumber = (int)(sectorAddress / imageInfo.SectorsPerTrack); - int headNumber = imageInfo.Heads > 1 ? trackNumber % 2 : 0; - int cylinderNumber = imageInfo.Heads > 1 ? trackNumber / 2 : trackNumber; - - if (badSectors[(cylinderNumber, headNumber, sectorNumber)]) - { - DicConsole.DebugWriteLine("d2f plugin", "reading bad sector {0} ({1},{2},{3})", - sectorAddress, cylinderNumber, headNumber, sectorNumber); - - /* if we have sector data, return that */ - if (sectorCache.ContainsKey((cylinderNumber, headNumber, sectorNumber))) - { - return sectorCache[(cylinderNumber, headNumber, sectorNumber)]; - } - - /* otherwise, return an empty sector */ - return new byte[512]; - } - - return sectorCache[(cylinderNumber, headNumber, sectorNumber)]; - } - - public byte[] ReadSectors(ulong sectorAddress, uint length) - { - byte[] result = new byte[length * imageInfo.SectorSize]; - - if (sectorAddress + length > imageInfo.Sectors) - throw new ArgumentOutOfRangeException(nameof(length), "Requested more sectors than available"); - - for (int i = 0; i < length; i++) - ReadSector(sectorAddress + (ulong)i).CopyTo(result, i * imageInfo.SectorSize); - - return result; - } } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/WCDiskImage/Structs.cs b/DiscImageChef.DiscImages/WCDiskImage/Structs.cs index acb14cfb6..a8928f40e 100644 --- a/DiscImageChef.DiscImages/WCDiskImage/Structs.cs +++ b/DiscImageChef.DiscImages/WCDiskImage/Structs.cs @@ -105,7 +105,7 @@ namespace DiscImageChef.DiscImages /// /// Set if a directory listing is present after the image /// - Directory = 0x02, + Directory = 0x02 } /// @@ -134,7 +134,6 @@ namespace DiscImageChef.DiscImages /// public byte cylinder; - /// /// A simple CRC16 over the data, to detect errors. /// @@ -169,7 +168,7 @@ namespace DiscImageChef.DiscImages /// Not a sector but the directory information. /// The crc field is the length of the data. /// - Directory = 0x04, + Directory = 0x04 } } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/WCDiskImage/Unsupported.cs b/DiscImageChef.DiscImages/WCDiskImage/Unsupported.cs index bdbf5d3aa..3ed222fa7 100644 --- a/DiscImageChef.DiscImages/WCDiskImage/Unsupported.cs +++ b/DiscImageChef.DiscImages/WCDiskImage/Unsupported.cs @@ -1,4 +1,3 @@ - // The Disc Image Chef // ---------------------------------------------------------------------------- // @@ -40,100 +39,64 @@ namespace DiscImageChef.DiscImages { public partial class WCDiskImage { - public byte[] ReadDiskTag(MediaTagType tag) - { + public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSector(ulong sectorAddress, uint track) - { + public byte[] ReadSector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) - { + public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) - { + public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress) - { + public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorLong(ulong sectorAddress, uint track) - { + public byte[] ReadSectorLong(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) - { + public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(Session session) - { + public List GetSessionTracks(Session session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public List GetSessionTracks(ushort session) - { + public List GetSessionTracks(ushort session) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySector(ulong sectorAddress) - { - return null; - } + public bool? VerifySector(ulong sectorAddress) => null; - public bool? VerifySector(ulong sectorAddress, uint track) - { + public bool? VerifySector(ulong sectorAddress, uint track) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, + public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { failingLbas = new List(); unknownLbas = new List(); - for (ulong i = 0; i < imageInfo.Sectors; i++) unknownLbas.Add(i); + for(ulong i = 0; i < imageInfo.Sectors; i++) unknownLbas.Add(i); return null; } - public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, - out List unknownLbas) - { + public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, + out List unknownLbas) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); - } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/WCDiskImage/WCDiskImage.cs b/DiscImageChef.DiscImages/WCDiskImage/WCDiskImage.cs index b9784c7fa..500de7d60 100644 --- a/DiscImageChef.DiscImages/WCDiskImage/WCDiskImage.cs +++ b/DiscImageChef.DiscImages/WCDiskImage/WCDiskImage.cs @@ -40,44 +40,46 @@ namespace DiscImageChef.DiscImages { public partial class WCDiskImage : IMediaImage { + public Dictionary<(int cylinder, int head, int sector), bool> badSectors = + new Dictionary<(int cylinder, int head, int sector), bool>(); /// /// The file header after the image has been opened /// WCDiskImageFileHeader fileHeader; + ImageInfo imageInfo; + + /* the sectors are cached here */ + public Dictionary<(int cylinder, int head, int sector), byte[]> sectorCache = + new Dictionary<(int cylinder, int head, int sector), byte[]>(); /// /// The ImageFilter we're reading from, after the file has been opened /// IFilter wcImageFilter; - ImageInfo imageInfo; - - /* the sectors are cached here */ - public Dictionary<(int cylinder, int head, int sector), byte[]> sectorCache = new Dictionary<(int cylinder, int head, int sector), byte[]>(); - public Dictionary<(int cylinder, int head, int sector), bool> badSectors = new Dictionary<(int cylinder, int head, int sector), bool>(); public WCDiskImage() { imageInfo = new ImageInfo { - ReadableSectorTags = new List(), - ReadableMediaTags = new List(), - HasPartitions = false, - HasSessions = false, - Version = null, - Application = null, - ApplicationVersion = null, - Creator = null, - Comments = null, - MediaManufacturer = null, - MediaModel = null, - MediaSerialNumber = null, - MediaBarcode = null, - MediaPartNumber = null, - MediaSequence = 0, - LastMediaSequence = 0, - DriveManufacturer = null, - DriveModel = null, - DriveSerialNumber = null, + ReadableSectorTags = new List(), + ReadableMediaTags = new List(), + HasPartitions = false, + HasSessions = false, + Version = null, + Application = null, + ApplicationVersion = null, + Creator = null, + Comments = null, + MediaManufacturer = null, + MediaModel = null, + MediaSerialNumber = null, + MediaBarcode = null, + MediaPartNumber = null, + MediaSequence = 0, + LastMediaSequence = 0, + DriveManufacturer = null, + DriveModel = null, + DriveSerialNumber = null, DriveFirmwareRevision = null }; } diff --git a/DiscImageChef.DiscImages/ZZZRawImage/Constants.cs b/DiscImageChef.DiscImages/ZZZRawImage/Constants.cs index 7606d3ac4..98a6826e9 100644 --- a/DiscImageChef.DiscImages/ZZZRawImage/Constants.cs +++ b/DiscImageChef.DiscImages/ZZZRawImage/Constants.cs @@ -42,8 +42,9 @@ namespace DiscImageChef.DiscImages (MediaTagType.ATA_IDENTIFY, ".identify.bin"), (MediaTagType.BD_DI, ".di.bin"), (MediaTagType.CD_ATIP, ".atip.bin"), (MediaTagType.CD_FullTOC, ".toc.bin"), (MediaTagType.CD_LeadIn, ".leadin.bin"), (MediaTagType.CD_PMA, ".pma.bin"), - (MediaTagType.CD_TEXT, ".cdtext.bin"), (MediaTagType.DCB, ".dcb.bin"), (MediaTagType.DVD_ADIP, ".adip.bin"), - (MediaTagType.DVD_BCA, ".bca.bin"), (MediaTagType.DVD_CMI, ".cmi.bin"), (MediaTagType.DVD_DMI, ".dmi.bin"), + (MediaTagType.CD_TEXT, ".cdtext.bin"), (MediaTagType.DCB, ".dcb.bin"), + (MediaTagType.DVD_ADIP, ".adip.bin"), (MediaTagType.DVD_BCA, ".bca.bin"), + (MediaTagType.DVD_CMI, ".cmi.bin"), (MediaTagType.DVD_DMI, ".dmi.bin"), (MediaTagType.DVD_MediaIdentifier, ".mid.bin"), (MediaTagType.DVD_PFI, ".pfi.bin"), (MediaTagType.DVDRAM_DDS, ".dds.bin"), (MediaTagType.DVDRAM_SpareArea, ".sai.bin"), (MediaTagType.DVDR_PFI, ".pfir.bin"), (MediaTagType.DVDR_PreRecordedInfo, ".pri.bin"), @@ -60,9 +61,10 @@ namespace DiscImageChef.DiscImages readonly (MediaTagType tag, string name)[] writeOnlySidecars = { (MediaTagType.ATAPI_IDENTIFY, ".identify.bin"), (MediaTagType.BD_BCA, ".bca.bin"), - (MediaTagType.BD_DDS, ".dds.bin"), (MediaTagType.BD_DI, ".di.bin"), (MediaTagType.BD_SpareArea, ".sai.bin"), - (MediaTagType.CD_LeadOut, ".leadout.bin"), (MediaTagType.MMC_CID, ".cid.bin"), - (MediaTagType.MMC_CSD, ".csd.bin"), (MediaTagType.MMC_OCR, ".ocr.bin") + (MediaTagType.BD_DDS, ".dds.bin"), (MediaTagType.BD_DI, ".di.bin"), + (MediaTagType.BD_SpareArea, ".sai.bin"), (MediaTagType.CD_LeadOut, ".leadout.bin"), + (MediaTagType.MMC_CID, ".cid.bin"), (MediaTagType.MMC_CSD, ".csd.bin"), + (MediaTagType.MMC_OCR, ".ocr.bin") }; } } \ No newline at end of file diff --git a/DiscImageChef.DiscImages/ZZZRawImage/Read.cs b/DiscImageChef.DiscImages/ZZZRawImage/Read.cs index 9754113ab..cc9dc6914 100644 --- a/DiscImageChef.DiscImages/ZZZRawImage/Read.cs +++ b/DiscImageChef.DiscImages/ZZZRawImage/Read.cs @@ -42,6 +42,7 @@ using DiscImageChef.CommonTypes.Exceptions; using DiscImageChef.CommonTypes.Interfaces; using DiscImageChef.CommonTypes.Structs; using DiscImageChef.Console; +using DiscImageChef.Decoders.ATA; using DiscImageChef.Decoders.CD; using DiscImageChef.Decoders.DVD; using DiscImageChef.Decoders.SCSI; @@ -849,7 +850,7 @@ namespace DiscImageChef.DiscImages // It's ATA, check tags if(mediaTags.TryGetValue(MediaTagType.ATA_IDENTIFY, out byte[] identifyBuf)) { - Decoders.ATA.Identify.IdentifyDevice? ataId = Decoders.ATA.Identify.Decode(identifyBuf); + Identify.IdentifyDevice? ataId = Decoders.ATA.Identify.Decode(identifyBuf); if(ataId.HasValue) { imageInfo.MediaType = (ushort)ataId.Value.GeneralConfiguration == 0x848A @@ -968,10 +969,7 @@ namespace DiscImageChef.DiscImages return true; } - public byte[] ReadSector(ulong sectorAddress) - { - return ReadSectors(sectorAddress, 1); - } + public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); public byte[] ReadSectors(ulong sectorAddress, uint length) { @@ -1111,10 +1109,7 @@ namespace DiscImageChef.DiscImages return failingLbas.Count <= 0; } - public bool? VerifyMediaImage() - { - return null; - } + public bool? VerifyMediaImage() => null; public List GetSessionTracks(Session session) { @@ -1319,10 +1314,7 @@ namespace DiscImageChef.DiscImages return buffer; } - public byte[] ReadSectorLong(ulong sectorAddress) - { - return ReadSectorsLong(sectorAddress, 1); - } + public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { diff --git a/DiscImageChef.DiscImages/ZZZRawImage/Write.cs b/DiscImageChef.DiscImages/ZZZRawImage/Write.cs index f6d3bdae3..c3c14505e 100644 --- a/DiscImageChef.DiscImages/ZZZRawImage/Write.cs +++ b/DiscImageChef.DiscImages/ZZZRawImage/Write.cs @@ -74,11 +74,7 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) - { - // Geometry is not stored in image - return true; - } + public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { @@ -92,17 +88,9 @@ namespace DiscImageChef.DiscImages return false; } - public bool SetDumpHardware(List dumpHardware) - { - // Not supported - return false; - } + public bool SetDumpHardware(List dumpHardware) => false; - public bool SetCicmMetadata(CICMMetadataType metadata) - { - // Not supported - return false; - } + public bool SetCicmMetadata(CICMMetadataType metadata) => false; public bool WriteMediaTag(byte[] data, MediaTagType tag) { @@ -220,9 +208,6 @@ namespace DiscImageChef.DiscImages return true; } - public bool SetMetadata(ImageInfo metadata) - { - return true; - } + public bool SetMetadata(ImageInfo metadata) => true; } } \ No newline at end of file diff --git a/DiscImageChef.EntityFramework/Program.cs b/DiscImageChef.EntityFramework/Program.cs index 5b99940cd..e3e77e854 100644 --- a/DiscImageChef.EntityFramework/Program.cs +++ b/DiscImageChef.EntityFramework/Program.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + namespace DiscImageChef.EntityFramework { class Program diff --git a/DiscImageChef.Filesystems/AppleMFS/Dir.cs b/DiscImageChef.Filesystems/AppleMFS/Dir.cs index 11b608c01..5181277b3 100644 --- a/DiscImageChef.Filesystems/AppleMFS/Dir.cs +++ b/DiscImageChef.Filesystems/AppleMFS/Dir.cs @@ -74,8 +74,7 @@ namespace DiscImageChef.Filesystems.AppleMFS { MFS_FileEntry entry = new MFS_FileEntry { - flUsrWds = new byte[16], - flFlags = (MFS_FileFlags)directoryBlocks[offset + 0] + flUsrWds = new byte[16], flFlags = (MFS_FileFlags)directoryBlocks[offset + 0] }; if(!entry.flFlags.HasFlag(MFS_FileFlags.Used)) break; diff --git a/DiscImageChef.Filesystems/FAT.cs b/DiscImageChef.Filesystems/FAT.cs index a3f580ee9..3e6b5ec5c 100644 --- a/DiscImageChef.Filesystems/FAT.cs +++ b/DiscImageChef.Filesystems/FAT.cs @@ -138,10 +138,10 @@ namespace DiscImageChef.Filesystems ("d3e93f8b82ef250db216037d827a4896dc97d2be", "TracerST"), // OEM ID: "TracerST" //("b741f85ef40288ccc8887de1f6e849009097e1c9", "Norton Utilities"), // OEM ID: "IBM PNCI", need to confirm ("c49b275537ac7237cac64d83f34d2024ae0ca96a", - "Windows NT (Spanish)"), // Need to check Windows >= 2000 (Spanish) + "Windows NT (Spanish)"), // Need to check Windows >= 2000 (Spanish) //("a48b0e4b696317eed829e960d1aa576562a4f185", "TracerST"), // Unknown OEM ID, apparently Tracer, unconfirmed ("fe477972602ba76658ff7143859045b3c4036ca5", - "iomega"), // OEM ID: "SHIPDISK", contains timedate on boot code may not be unique + "iomega"), // OEM ID: "SHIPDISK", contains timedate on boot code may not be unique ("ef79a1f33e5237827eb812dda548f0e4e916d815", "GEOS"), // OEM ID: "GEOWORKS" ("8524587ee91494cc51cc2c9d07453e84be0cdc33", "Hero Soft v1.10"), ("681a0d9d662ba368e6acb0d0bf602e1f56411144", "Human68k 2.00") @@ -2137,18 +2137,15 @@ namespace DiscImageChef.Filesystems /// Operating system. public byte operatingSystem; /// Software write protection. - [MarshalAs(UnmanagedType.U1)] - public bool writeProtected; + [MarshalAs(UnmanagedType.U1)] public bool writeProtected; /// Copy protected. - [MarshalAs(UnmanagedType.U1)] - public bool copyProtected; + [MarshalAs(UnmanagedType.U1)] public bool copyProtected; /// Boot type. public byte bootType; /// Partitions. public byte partitionCount; /// Is hard disk?. - [MarshalAs(UnmanagedType.U1)] - public bool winchester; + [MarshalAs(UnmanagedType.U1)] public bool winchester; /// Sector size. public ushort sectorSize; /// Sectors per track. @@ -2201,18 +2198,15 @@ namespace DiscImageChef.Filesystems /// Major BIOS version. public byte biosMajorVersion; /// Diagnostics enabled?. - [MarshalAs(UnmanagedType.U1)] - public bool diagnosticsFlag; + [MarshalAs(UnmanagedType.U1)] public bool diagnosticsFlag; /// Printer device. public byte prnDevice; /// Bell volume. public byte bellVolume; /// Cache enabled?. - [MarshalAs(UnmanagedType.U1)] - public bool enableCache; + [MarshalAs(UnmanagedType.U1)] public bool enableCache; /// Graphics enabled?. - [MarshalAs(UnmanagedType.U1)] - public bool enableGraphics; + [MarshalAs(UnmanagedType.U1)] public bool enableGraphics; /// Length in sectors of DOS. public byte dosLength; /// Length in sectors of FONT file. @@ -2228,8 +2222,7 @@ namespace DiscImageChef.Filesystems /// Keyboard click volume. public byte keyboardVolume; /// Auto-repeat enabled?. - [MarshalAs(UnmanagedType.U1)] - public bool autorepeat; + [MarshalAs(UnmanagedType.U1)] public bool autorepeat; /// Auto-repeat lead-in. public byte autorepeatLeadIn; /// Auto-repeat interval. @@ -2244,8 +2237,7 @@ namespace DiscImageChef.Filesystems /// Screen line width. public byte lineWidth; /// Screen disabled?. - [MarshalAs(UnmanagedType.U1)] - public bool imageOff; + [MarshalAs(UnmanagedType.U1)] public bool imageOff; /// Spare area for screen values expansion. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 13)] public byte[] spareScreen; @@ -2260,16 +2252,13 @@ namespace DiscImageChef.Filesystems /// Stop bits. public byte stopBits; /// Parity enabled?. - [MarshalAs(UnmanagedType.U1)] - public bool parityCheck; + [MarshalAs(UnmanagedType.U1)] public bool parityCheck; /// Parity type. public byte parityType; /// Xon/Xoff enabled on TX. - [MarshalAs(UnmanagedType.U1)] - public bool txXonXoff; + [MarshalAs(UnmanagedType.U1)] public bool txXonXoff; /// Xon/Xoff enabled on RX. - [MarshalAs(UnmanagedType.U1)] - public bool rxXonXoff; + [MarshalAs(UnmanagedType.U1)] public bool rxXonXoff; /// Xon character. public byte xonCharacter; /// Xoff character. @@ -2277,39 +2266,30 @@ namespace DiscImageChef.Filesystems /// Xon/Xoff buffer on RX. public ushort rxXonXoffBuffer; /// DTR/DSR enabled?. - [MarshalAs(UnmanagedType.U1)] - public bool dtrDsr; + [MarshalAs(UnmanagedType.U1)] public bool dtrDsr; /// CTS/RTS enabled?. - [MarshalAs(UnmanagedType.U1)] - public bool ctsRts; + [MarshalAs(UnmanagedType.U1)] public bool ctsRts; /// NULLs after CR. public byte nullsAfterCr; /// NULLs after 0xFF. public byte nullsAfterFF; /// Send LF after CR in serial port. - [MarshalAs(UnmanagedType.U1)] - public bool lfAfterCRSerial; + [MarshalAs(UnmanagedType.U1)] public bool lfAfterCRSerial; /// BIOS error report in serial port. - [MarshalAs(UnmanagedType.U1)] - public bool biosErrorReportSerial; + [MarshalAs(UnmanagedType.U1)] public bool biosErrorReportSerial; /// Spare area for serial port values expansion. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 13)] public byte[] spareSerial; /// Send LF after CR in parallel port. - [MarshalAs(UnmanagedType.U1)] - public bool lfAfterCrParallel; + [MarshalAs(UnmanagedType.U1)] public bool lfAfterCrParallel; /// Select line supported?. - [MarshalAs(UnmanagedType.U1)] - public bool selectLine; + [MarshalAs(UnmanagedType.U1)] public bool selectLine; /// Paper empty supported?. - [MarshalAs(UnmanagedType.U1)] - public bool paperEmpty; + [MarshalAs(UnmanagedType.U1)] public bool paperEmpty; /// Fault line supported?. - [MarshalAs(UnmanagedType.U1)] - public bool faultLine; + [MarshalAs(UnmanagedType.U1)] public bool faultLine; /// BIOS error report in parallel port. - [MarshalAs(UnmanagedType.U1)] - public bool biosErrorReportParallel; + [MarshalAs(UnmanagedType.U1)] public bool biosErrorReportParallel; /// Spare area for parallel port values expansion. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)] public byte[] spareParallel; @@ -2317,11 +2297,9 @@ namespace DiscImageChef.Filesystems [MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)] public byte[] spareWinchester; /// Parking enabled?. - [MarshalAs(UnmanagedType.U1)] - public bool parkingEnabled; + [MarshalAs(UnmanagedType.U1)] public bool parkingEnabled; /// Format protection?. - [MarshalAs(UnmanagedType.U1)] - public bool formatProtection; + [MarshalAs(UnmanagedType.U1)] public bool formatProtection; /// Spare area for RAM disk values expansion. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] spareRamDisk; diff --git a/DiscImageChef.Filesystems/LisaFS/File.cs b/DiscImageChef.Filesystems/LisaFS/File.cs index c05778e8c..97ae8f350 100644 --- a/DiscImageChef.Filesystems/LisaFS/File.cs +++ b/DiscImageChef.Filesystems/LisaFS/File.cs @@ -153,10 +153,7 @@ namespace DiscImageChef.Filesystems.LisaFS return Errno.NoError; } - Errno ReadSystemFile(short fileId, out byte[] buf) - { - return ReadSystemFile(fileId, out buf, false); - } + Errno ReadSystemFile(short fileId, out byte[] buf) => ReadSystemFile(fileId, out buf, false); Errno ReadSystemFile(short fileId, out byte[] buf, bool tags) { @@ -307,10 +304,7 @@ namespace DiscImageChef.Filesystems.LisaFS return Errno.NoError; } - Errno ReadFile(short fileId, out byte[] buf) - { - return ReadFile(fileId, out buf, false); - } + Errno ReadFile(short fileId, out byte[] buf) => ReadFile(fileId, out buf, false); Errno ReadFile(short fileId, out byte[] buf, bool tags) { diff --git a/DiscImageChef.Filesystems/Register.cs b/DiscImageChef.Filesystems/Register.cs index f75181205..75f4011f2 100644 --- a/DiscImageChef.Filesystems/Register.cs +++ b/DiscImageChef.Filesystems/Register.cs @@ -46,10 +46,7 @@ namespace DiscImageChef.Filesystems { public class Register : IPluginRegister { - public List GetAllChecksumPlugins() - { - return null; - } + public List GetAllChecksumPlugins() => null; public List GetAllFilesystemPlugins() { @@ -57,25 +54,13 @@ namespace DiscImageChef.Filesystems .Where(t => t.GetInterfaces().Contains(typeof(IFilesystem))).Where(t => t.IsClass).ToList(); } - public List GetAllFilterPlugins() - { - return null; - } + public List GetAllFilterPlugins() => null; - public List GetAllFloppyImagePlugins() - { - return null; - } + public List GetAllFloppyImagePlugins() => null; - public List GetAllMediaImagePlugins() - { - return null; - } + public List GetAllMediaImagePlugins() => null; - public List GetAllPartitionPlugins() - { - return null; - } + public List GetAllPartitionPlugins() => null; public List GetAllReadOnlyFilesystemPlugins() { @@ -84,14 +69,8 @@ namespace DiscImageChef.Filesystems .ToList(); } - public List GetAllWritableFloppyImagePlugins() - { - return null; - } + public List GetAllWritableFloppyImagePlugins() => null; - public List GetAllWritableImagePlugins() - { - return null; - } + public List GetAllWritableImagePlugins() => null; } } \ No newline at end of file diff --git a/DiscImageChef.Filesystems/UCSDPascal/File.cs b/DiscImageChef.Filesystems/UCSDPascal/File.cs index 7fd0ccce8..7d9ba291e 100644 --- a/DiscImageChef.Filesystems/UCSDPascal/File.cs +++ b/DiscImageChef.Filesystems/UCSDPascal/File.cs @@ -149,7 +149,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal Inode = 0, LastWriteTimeUtc = DateHandlers.UcsdPascalToDateTime(entry.ModificationTime), Length = (entry.LastBlock - entry.FirstBlock) * device.Info.SectorSize * multiplier + - entry.LastBytes, + entry.LastBytes, Links = 1, Mode = 0x124, UID = 0 diff --git a/DiscImageChef.Filters/OffsetStream.cs b/DiscImageChef.Filters/OffsetStream.cs index aa2870657..5a1e5012f 100644 --- a/DiscImageChef.Filters/OffsetStream.cs +++ b/DiscImageChef.Filters/OffsetStream.cs @@ -32,10 +32,10 @@ using System; using System.IO; +using Microsoft.Win32.SafeHandles; #if !NETSTANDARD2_0 using System.Security.AccessControl; #endif -using Microsoft.Win32.SafeHandles; namespace DiscImageChef.Filters { @@ -120,40 +120,6 @@ namespace DiscImageChef.Filters if(end > baseStream.Length) throw new ArgumentOutOfRangeException(nameof(end), "End is after stream end."); } -#if !NETSTANDARD2_0 - public OffsetStream(string path, FileMode mode, FileSystemRights rights, FileShare share, - int bufferSize, - FileOptions options, long start, long end) - { - if(start < 0) throw new ArgumentOutOfRangeException(nameof(start), "Start can't be a negative number."); - - if(end < 0) throw new ArgumentOutOfRangeException(nameof(end), "End can't be a negative number."); - - streamStart = start; - streamEnd = end; - - baseStream = new FileStream(path, mode, rights, share, bufferSize, options); - - if(end > baseStream.Length) throw new ArgumentOutOfRangeException(nameof(end), "End is after stream end."); - } - - public OffsetStream(string path, FileMode mode, FileSystemRights rights, FileShare share, - int bufferSize, - FileOptions options, FileSecurity fileSecurity, long start, long end) - { - if(start < 0) throw new ArgumentOutOfRangeException(nameof(start), "Start can't be a negative number."); - - if(end < 0) throw new ArgumentOutOfRangeException(nameof(end), "End can't be a negative number."); - - streamStart = start; - streamEnd = end; - - baseStream = new FileStream(path, mode, rights, share, bufferSize, options, fileSecurity); - - if(end > baseStream.Length) throw new ArgumentOutOfRangeException(nameof(end), "End is after stream end."); - } -#endif - public OffsetStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, bool useAsync, long start, long end) { @@ -350,20 +316,14 @@ namespace DiscImageChef.Filters base.Dispose(); } - public override int EndRead(IAsyncResult asyncResult) - { - return baseStream.EndRead(asyncResult); - } + public override int EndRead(IAsyncResult asyncResult) => baseStream.EndRead(asyncResult); public override void EndWrite(IAsyncResult asyncResult) { baseStream.EndWrite(asyncResult); } - public override int ReadByte() - { - return baseStream.Position == streamEnd + 1 ? -1 : baseStream.ReadByte(); - } + public override int ReadByte() => baseStream.Position == streamEnd + 1 ? -1 : baseStream.ReadByte(); public override void WriteByte(byte value) { @@ -415,5 +375,39 @@ namespace DiscImageChef.Filters baseStream.Write(buffer, offset, count); } + + #if !NETSTANDARD2_0 + public OffsetStream(string path, FileMode mode, FileSystemRights rights, FileShare share, + int bufferSize, + FileOptions options, long start, long end) + { + if(start < 0) throw new ArgumentOutOfRangeException(nameof(start), "Start can't be a negative number."); + + if(end < 0) throw new ArgumentOutOfRangeException(nameof(end), "End can't be a negative number."); + + streamStart = start; + streamEnd = end; + + baseStream = new FileStream(path, mode, rights, share, bufferSize, options); + + if(end > baseStream.Length) throw new ArgumentOutOfRangeException(nameof(end), "End is after stream end."); + } + + public OffsetStream(string path, FileMode mode, FileSystemRights rights, FileShare share, + int bufferSize, + FileOptions options, FileSecurity fileSecurity, long start, long end) + { + if(start < 0) throw new ArgumentOutOfRangeException(nameof(start), "Start can't be a negative number."); + + if(end < 0) throw new ArgumentOutOfRangeException(nameof(end), "End can't be a negative number."); + + streamStart = start; + streamEnd = end; + + baseStream = new FileStream(path, mode, rights, share, bufferSize, options, fileSecurity); + + if(end > baseStream.Length) throw new ArgumentOutOfRangeException(nameof(end), "End is after stream end."); + } + #endif } } \ No newline at end of file diff --git a/DiscImageChef.Filters/Register.cs b/DiscImageChef.Filters/Register.cs index 1cd055179..9cadfe845 100644 --- a/DiscImageChef.Filters/Register.cs +++ b/DiscImageChef.Filters/Register.cs @@ -46,15 +46,9 @@ namespace DiscImageChef.Filters { public class Register : IPluginRegister { - public List GetAllChecksumPlugins() - { - return null; - } + public List GetAllChecksumPlugins() => null; - public List GetAllFilesystemPlugins() - { - return null; - } + public List GetAllFilesystemPlugins() => null; public List GetAllFilterPlugins() { @@ -62,34 +56,16 @@ namespace DiscImageChef.Filters .Where(t => t.IsClass).ToList(); } - public List GetAllFloppyImagePlugins() - { - return null; - } + public List GetAllFloppyImagePlugins() => null; - public List GetAllMediaImagePlugins() - { - return null; - } + public List GetAllMediaImagePlugins() => null; - public List GetAllPartitionPlugins() - { - return null; - } + public List GetAllPartitionPlugins() => null; - public List GetAllReadOnlyFilesystemPlugins() - { - return null; - } + public List GetAllReadOnlyFilesystemPlugins() => null; - public List GetAllWritableFloppyImagePlugins() - { - return null; - } + public List GetAllWritableFloppyImagePlugins() => null; - public List GetAllWritableImagePlugins() - { - return null; - } + public List GetAllWritableImagePlugins() => null; } } \ No newline at end of file diff --git a/DiscImageChef.Gui/Controls/SvgImageView.cs b/DiscImageChef.Gui/Controls/SvgImageView.cs index 7dca01a63..367f56cfa 100644 --- a/DiscImageChef.Gui/Controls/SvgImageView.cs +++ b/DiscImageChef.Gui/Controls/SvgImageView.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System; using System.IO; using Eto.Drawing; @@ -38,12 +39,11 @@ namespace DiscImageChef.Gui.Controls { public class SvgImageView : ImageView { + byte[] cachedRender; Stream svgStream; public new Image Image => base.Image; - byte[] cachedRender; - public Stream SvgStream { get => svgStream; @@ -58,7 +58,7 @@ namespace DiscImageChef.Gui.Controls void Redraw() { - if(Width == -1 || Height == -1 || svgStream== null) return; + if(Width == -1 || Height == -1 || svgStream == null) return; svgStream.Position = 0; @@ -84,6 +84,7 @@ namespace DiscImageChef.Gui.Controls base.Image = new Bitmap(cachedRender); */ } + protected override void OnSizeChanged(EventArgs e) { base.OnSizeChanged(e); diff --git a/DiscImageChef.Gui/Forms/frmConsole.xeto.cs b/DiscImageChef.Gui/Forms/frmConsole.xeto.cs index c11d7fffb..096970df9 100644 --- a/DiscImageChef.Gui/Forms/frmConsole.xeto.cs +++ b/DiscImageChef.Gui/Forms/frmConsole.xeto.cs @@ -53,25 +53,37 @@ namespace DiscImageChef.Gui.Forms grdMessages.DataStore = ConsoleHandler.Entries; grdMessages.Columns.Add(new GridColumn { - DataCell = new TextBoxCell {Binding = Binding.Property(r => $"{r.Timestamp}")}, + DataCell = new TextBoxCell + { + Binding = Binding.Property(r => $"{r.Timestamp}") + }, HeaderText = "Time", Sortable = true }); grdMessages.Columns.Add(new GridColumn { - DataCell = new TextBoxCell {Binding = Binding.Property(r => r.Type)}, + DataCell = new TextBoxCell + { + Binding = Binding.Property(r => r.Type) + }, HeaderText = "Type", Sortable = true }); grdMessages.Columns.Add(new GridColumn { - DataCell = new TextBoxCell {Binding = Binding.Property(r => r.Module)}, + DataCell = new TextBoxCell + { + Binding = Binding.Property(r => r.Module) + }, HeaderText = "Module", Sortable = true }); grdMessages.Columns.Add(new GridColumn { - DataCell = new TextBoxCell {Binding = Binding.Property(r => r.Message)}, + DataCell = new TextBoxCell + { + Binding = Binding.Property(r => r.Message) + }, HeaderText = "Message", Sortable = true }); diff --git a/DiscImageChef.Gui/Panels/pnlImageInfo.xeto.cs b/DiscImageChef.Gui/Panels/pnlImageInfo.xeto.cs index 9a655d632..9e8a83b75 100644 --- a/DiscImageChef.Gui/Panels/pnlImageInfo.xeto.cs +++ b/DiscImageChef.Gui/Panels/pnlImageInfo.xeto.cs @@ -41,7 +41,6 @@ using DiscImageChef.Decoders.CD; using DiscImageChef.Decoders.DVD; using DiscImageChef.Decoders.SCSI; using DiscImageChef.Decoders.Xbox; -using DiscImageChef.Devices; using DiscImageChef.Gui.Controls; using DiscImageChef.Gui.Forms; using DiscImageChef.Gui.Tabs; diff --git a/DiscImageChef.Gui/Panels/pnlScsiInfo.xeto.cs b/DiscImageChef.Gui/Panels/pnlScsiInfo.xeto.cs index 1e41dc406..c9b0d1443 100644 --- a/DiscImageChef.Gui/Panels/pnlScsiInfo.xeto.cs +++ b/DiscImageChef.Gui/Panels/pnlScsiInfo.xeto.cs @@ -240,8 +240,8 @@ namespace DiscImageChef.Gui.Panels return; } - if((scsiInfo.MediaType == MediaType.XGD || scsiInfo.MediaType == MediaType.XGD2 || - scsiInfo.MediaType == MediaType.XGD3)) + if(scsiInfo.MediaType == MediaType.XGD || scsiInfo.MediaType == MediaType.XGD2 || + scsiInfo.MediaType == MediaType.XGD3) MessageBox.Show("Scanning Xbox discs is not yet supported.", MessageBoxType.Error); frmMediaScan scanForm = new frmMediaScan(devicePath, scsiInfo.DeviceInfo, scsiInfo); @@ -296,7 +296,7 @@ namespace DiscImageChef.Gui.Panels Button btnDump; ImageView imgMediaLogo; SvgImageView svgMediaLogo; - Button btnScan; + Button btnScan; #pragma warning restore 169 #pragma warning restore 649 #endregion diff --git a/DiscImageChef.Gui/ResourceHandler.cs b/DiscImageChef.Gui/ResourceHandler.cs index 1d4c7aeb4..3fc1d4e41 100644 --- a/DiscImageChef.Gui/ResourceHandler.cs +++ b/DiscImageChef.Gui/ResourceHandler.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.IO; using System.Reflection; @@ -36,6 +37,7 @@ namespace DiscImageChef.Gui { static class ResourceHandler { - internal static Stream GetResourceStream(string resourcePath) => Assembly.GetExecutingAssembly().GetManifestResourceStream(resourcePath); + internal static Stream GetResourceStream(string resourcePath) => + Assembly.GetExecutingAssembly().GetManifestResourceStream(resourcePath); } } \ No newline at end of file diff --git a/DiscImageChef.Gui/Tabs/tabDvdInfo.xeto.cs b/DiscImageChef.Gui/Tabs/tabDvdInfo.xeto.cs index 05c5ed5b5..7f285c79c 100644 --- a/DiscImageChef.Gui/Tabs/tabDvdInfo.xeto.cs +++ b/DiscImageChef.Gui/Tabs/tabDvdInfo.xeto.cs @@ -32,50 +32,37 @@ using System; using System.IO; -using System.Text; using DiscImageChef.CommonTypes; -using DiscImageChef.Core.Media.Info; -using DiscImageChef.Decoders.Bluray; using DiscImageChef.Decoders.DVD; -using DiscImageChef.Decoders.SCSI.MMC; -using DiscImageChef.Decoders.SCSI.SSC; -using DiscImageChef.Decoders.Xbox; -using DiscImageChef.Gui.Controls; -using DiscImageChef.Gui.Forms; -using DiscImageChef.Gui.Tabs; -using Eto.Drawing; using Eto.Forms; using Eto.Serialization.Xaml; -using BCA = DiscImageChef.Decoders.Bluray.BCA; -using Cartridge = DiscImageChef.Decoders.DVD.Cartridge; -using DDS = DiscImageChef.Decoders.DVD.DDS; -using DMI = DiscImageChef.Decoders.Xbox.DMI; -using Spare = DiscImageChef.Decoders.DVD.Spare; namespace DiscImageChef.Gui.Tabs { public class tabDvdInfo : TabPage { - byte[] DvdPfi; - byte[] DvdDmi; - byte[] DvdCmi; - byte[] HddvdCopyrightInformation; - byte[] DvdBca; byte[] DvdAacs; + byte[] DvdBca; + byte[] DvdCmi; + byte[] DvdDmi; + byte[] DvdPfi; + byte[] HddvdCopyrightInformation; public tabDvdInfo() { XamlReader.Load(this); } - internal void LoadData(MediaType mediaType, byte[] pfi, byte[] dmi, byte[] cmi, byte[] hdCopyrightInformation, byte[] bca, byte[] aacs, PFI.PhysicalFormatInformation? decodedPfi) + internal void LoadData(MediaType mediaType, byte[] pfi, byte[] dmi, byte[] cmi, + byte[] hdCopyrightInformation, + byte[] bca, byte[] aacs, PFI.PhysicalFormatInformation? decodedPfi) { - DvdPfi=pfi; - DvdDmi=dmi; - DvdCmi=cmi; - HddvdCopyrightInformation=hdCopyrightInformation; - DvdBca=bca; - DvdAacs=aacs; + DvdPfi = pfi; + DvdDmi = dmi; + DvdCmi = cmi; + HddvdCopyrightInformation = hdCopyrightInformation; + DvdBca = bca; + DvdAacs = aacs; switch(mediaType) { @@ -113,9 +100,9 @@ namespace DiscImageChef.Gui.Tabs btnSaveDvdAacs.Visible = aacs != null; Visible = grpDvdPfi.Visible || grpDvdCmi.Visible || btnSaveDvdPfi.Visible || - btnSaveDvdDmi.Visible || - btnSaveDvdCmi.Visible || btnSaveHdDvdCmi.Visible || btnSaveDvdBca.Visible || - btnSaveDvdAacs.Visible; + btnSaveDvdDmi.Visible || + btnSaveDvdCmi.Visible || btnSaveHdDvdCmi.Visible || btnSaveDvdBca.Visible || + btnSaveDvdAacs.Visible; } void SaveElement(byte[] data) @@ -165,18 +152,18 @@ namespace DiscImageChef.Gui.Tabs #region XAML controls #pragma warning disable 169 #pragma warning disable 649 - GroupBox grpDvdPfi; - TextArea txtDvdPfi; - GroupBox grpDvdCmi; - TextArea txtDvdCmi; - GroupBox grpHdDvdCmi; - TextArea txtHdDvdCmi; - Button btnSaveDvdPfi; - Button btnSaveDvdDmi; - Button btnSaveDvdCmi; - Button btnSaveHdDvdCmi; - Button btnSaveDvdBca; - Button btnSaveDvdAacs; + GroupBox grpDvdPfi; + TextArea txtDvdPfi; + GroupBox grpDvdCmi; + TextArea txtDvdCmi; + GroupBox grpHdDvdCmi; + TextArea txtHdDvdCmi; + Button btnSaveDvdPfi; + Button btnSaveDvdDmi; + Button btnSaveDvdCmi; + Button btnSaveHdDvdCmi; + Button btnSaveDvdBca; + Button btnSaveDvdAacs; #pragma warning restore 169 #pragma warning restore 649 #endregion diff --git a/DiscImageChef.Helpers/BigEndianBitConverter.cs b/DiscImageChef.Helpers/BigEndianBitConverter.cs index 3e1f3fb84..b68c19a74 100644 --- a/DiscImageChef.Helpers/BigEndianBitConverter.cs +++ b/DiscImageChef.Helpers/BigEndianBitConverter.cs @@ -55,120 +55,94 @@ namespace DiscImageChef /// The number to convert. /// A 64-bit signed integer whose value is equivalent to value. /// It is not currently implemented - public static long DoubleToInt64Bits(double value) - { - throw new NotImplementedException(); - } + public static long DoubleToInt64Bits(double value) => throw new NotImplementedException(); /// /// Returns the specified Boolean value as an array of bytes. /// /// A Boolean value. /// An array of bytes with length 1. - public static byte[] GetBytes(bool value) - { - return !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); - } + public static byte[] GetBytes(bool value) => + !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); /// /// Returns the specified Unicode character value as an array of bytes. /// /// A character to convert. /// An array of bytes with length 2. - public static byte[] GetBytes(char value) - { - return !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); - } + public static byte[] GetBytes(char value) => + !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); /// /// Returns the specified double-precision floating point value as an array of bytes. /// /// The number to convert. /// An array of bytes with length 8. - public static byte[] GetBytes(double value) - { - return !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); - } + public static byte[] GetBytes(double value) => + !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); /// /// Returns the specified single-precision floating point value as an array of bytes. /// /// The number to convert. /// An array of bytes with length 4. - public static byte[] GetBytes(float value) - { - return !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); - } + public static byte[] GetBytes(float value) => + !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); /// /// Returns the specified 32-bit signed integer value as an array of bytes. /// /// The number to convert. /// An array of bytes with length 4. - public static byte[] GetBytes(int value) - { - return !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); - } + public static byte[] GetBytes(int value) => + !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); /// /// Returns the specified 64-bit signed integer value as an array of bytes. /// /// The number to convert. /// An array of bytes with length 8. - public static byte[] GetBytes(long value) - { - return !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); - } + public static byte[] GetBytes(long value) => + !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); /// /// Returns the specified 16-bit signed integer value as an array of bytes. /// /// The number to convert. /// An array of bytes with length 2. - public static byte[] GetBytes(short value) - { - return !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); - } + public static byte[] GetBytes(short value) => + !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); /// /// Returns the specified 32-bit unsigned integer value as an array of bytes. /// /// The number to convert. /// An array of bytes with length 4. - public static byte[] GetBytes(uint value) - { - return !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); - } + public static byte[] GetBytes(uint value) => + !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); /// /// Returns the specified 64-bit unsigned integer value as an array of bytes. /// /// The number to convert. /// An array of bytes with length 8. - public static byte[] GetBytes(ulong value) - { - return !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); - } + public static byte[] GetBytes(ulong value) => + !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); /// /// Returns the specified 16-bit unsigned integer value as an array of bytes. /// /// The number to convert. /// An array of bytes with length 2. - public static byte[] GetBytes(ushort value) - { - return !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); - } + public static byte[] GetBytes(ushort value) => + !IsLittleEndian ? BitConverter.GetBytes(value) : BitConverter.GetBytes(value).Reverse().ToArray(); /// /// Converts the specified 64-bit signed integer to a double-precision floating point number. /// /// The number to convert. /// A double-precision floating point number whose value is equivalent to value. - public static double Int64BitsToDouble(long value) - { - throw new NotImplementedException(); - } + public static double Int64BitsToDouble(long value) => throw new NotImplementedException(); /// /// Returns a Boolean value converted from one byte at a specified position in a byte array. @@ -181,10 +155,7 @@ namespace DiscImageChef /// is less than zero or greater than the /// length of value minus 1. /// - public static bool ToBoolean(byte[] value, int startIndex) - { - throw new NotImplementedException(); - } + public static bool ToBoolean(byte[] value, int startIndex) => throw new NotImplementedException(); /// /// Returns a Unicode character converted from two bytes at a specified position in a byte array. @@ -198,10 +169,7 @@ namespace DiscImageChef /// is less than zero or greater than the /// length of value minus 1. /// - public static char ToChar(byte[] value, int startIndex) - { - throw new NotImplementedException(); - } + public static char ToChar(byte[] value, int startIndex) => throw new NotImplementedException(); /// /// Returns a double-precision floating point number converted from eight bytes at a specified position in a byte @@ -219,10 +187,7 @@ namespace DiscImageChef /// is less than zero or greater than the /// length of value minus 1. /// - public static double ToDouble(byte[] value, int startIndex) - { - throw new NotImplementedException(); - } + public static double ToDouble(byte[] value, int startIndex) => throw new NotImplementedException(); /// /// Returns a 16-bit signed integer converted from two bytes at a specified position in a byte array. @@ -236,12 +201,10 @@ namespace DiscImageChef /// startIndex is less than zero or greater than the length of value /// minus 1. /// - public static short ToInt16(byte[] value, int startIndex) - { - return !IsLittleEndian - ? BitConverter.ToInt16(value, startIndex) - : BitConverter.ToInt16(value.Reverse().ToArray(), value.Length - sizeof(short) - startIndex); - } + public static short ToInt16(byte[] value, int startIndex) => + !IsLittleEndian + ? BitConverter.ToInt16(value, startIndex) + : BitConverter.ToInt16(value.Reverse().ToArray(), value.Length - sizeof(short) - startIndex); /// /// Returns a 32-bit signed integer converted from four bytes at a specified position in a byte array. @@ -258,12 +221,10 @@ namespace DiscImageChef /// startIndex is less than zero or greater than the length of value /// minus 1. /// - public static int ToInt32(byte[] value, int startIndex) - { - return !IsLittleEndian - ? BitConverter.ToInt32(value, startIndex) - : BitConverter.ToInt32(value.Reverse().ToArray(), value.Length - sizeof(int) - startIndex); - } + public static int ToInt32(byte[] value, int startIndex) => + !IsLittleEndian + ? BitConverter.ToInt32(value, startIndex) + : BitConverter.ToInt32(value.Reverse().ToArray(), value.Length - sizeof(int) - startIndex); /// /// Returns a 64-bit signed integer converted from eight bytes at a specified position in a byte array. @@ -280,12 +241,10 @@ namespace DiscImageChef /// is less than zero or greater than the /// length of value minus 1. /// - public static long ToInt64(byte[] value, int startIndex) - { - return !IsLittleEndian - ? BitConverter.ToInt64(value, startIndex) - : BitConverter.ToInt64(value.Reverse().ToArray(), value.Length - sizeof(long) - startIndex); - } + public static long ToInt64(byte[] value, int startIndex) => + !IsLittleEndian + ? BitConverter.ToInt64(value, startIndex) + : BitConverter.ToInt64(value.Reverse().ToArray(), value.Length - sizeof(long) - startIndex); /// /// Returns a single-precision floating point number converted from four bytes at a specified position in a byte @@ -303,12 +262,10 @@ namespace DiscImageChef /// is less than zero or greater than the /// length of value minus 1. /// - public static float ToSingle(byte[] value, int startIndex) - { - return !IsLittleEndian - ? BitConverter.ToSingle(value, startIndex) - : BitConverter.ToSingle(value.Reverse().ToArray(), value.Length - sizeof(float) - startIndex); - } + public static float ToSingle(byte[] value, int startIndex) => + !IsLittleEndian + ? BitConverter.ToSingle(value, startIndex) + : BitConverter.ToSingle(value.Reverse().ToArray(), value.Length - sizeof(float) - startIndex); /// /// Converts the numeric value of each element of a specified array of bytes to its equivalent hexadecimal string @@ -320,10 +277,8 @@ namespace DiscImageChef /// element in value; for example, "7F-2C-4A". /// /// value is null. - public static string ToString(byte[] value) - { - return !IsLittleEndian ? BitConverter.ToString(value) : BitConverter.ToString(value.Reverse().ToArray()); - } + public static string ToString(byte[] value) => + !IsLittleEndian ? BitConverter.ToString(value) : BitConverter.ToString(value.Reverse().ToArray()); /// /// Converts the numeric value of each element of a specified subarray of bytes to its equivalent hexadecimal string @@ -340,12 +295,10 @@ namespace DiscImageChef /// startIndex is less than zero or greater than the length of value /// minus 1. /// - public static string ToString(byte[] value, int startIndex) - { - return !IsLittleEndian - ? BitConverter.ToString(value, startIndex) - : BitConverter.ToString(value.Reverse().ToArray(), startIndex); - } + public static string ToString(byte[] value, int startIndex) => + !IsLittleEndian + ? BitConverter.ToString(value, startIndex) + : BitConverter.ToString(value.Reverse().ToArray(), startIndex); /// /// Converts the numeric value of each element of a specified subarray of bytes to its equivalent hexadecimal string @@ -367,12 +320,10 @@ namespace DiscImageChef /// The combination of startIndex and length does not specify a position within /// value; that is, the startIndex parameter is greater than the length of value minus the length parameter. /// - public static string ToString(byte[] value, int startIndex, int length) - { - return !IsLittleEndian - ? BitConverter.ToString(value, startIndex, length) - : BitConverter.ToString(value.Reverse().ToArray(), startIndex, length); - } + public static string ToString(byte[] value, int startIndex, int length) => + !IsLittleEndian + ? BitConverter.ToString(value, startIndex, length) + : BitConverter.ToString(value.Reverse().ToArray(), startIndex, length); /// /// Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array. @@ -386,12 +337,10 @@ namespace DiscImageChef /// startIndex is less than zero or greater than the length of value /// minus 1. /// - public static ushort ToUInt16(byte[] value, int startIndex) - { - return !IsLittleEndian - ? BitConverter.ToUInt16(value, startIndex) - : BitConverter.ToUInt16(value.Reverse().ToArray(), value.Length - sizeof(ushort) - startIndex); - } + public static ushort ToUInt16(byte[] value, int startIndex) => + !IsLittleEndian + ? BitConverter.ToUInt16(value, startIndex) + : BitConverter.ToUInt16(value.Reverse().ToArray(), value.Length - sizeof(ushort) - startIndex); /// /// Returns a 32-bit unsigned integer converted from four bytes at a specified position in a byte array. @@ -408,12 +357,10 @@ namespace DiscImageChef /// startIndex is less than zero or greater than the length of value /// minus 1. /// - public static uint ToUInt32(byte[] value, int startIndex) - { - return !IsLittleEndian - ? BitConverter.ToUInt32(value, startIndex) - : BitConverter.ToUInt32(value.Reverse().ToArray(), value.Length - sizeof(uint) - startIndex); - } + public static uint ToUInt32(byte[] value, int startIndex) => + !IsLittleEndian + ? BitConverter.ToUInt32(value, startIndex) + : BitConverter.ToUInt32(value.Reverse().ToArray(), value.Length - sizeof(uint) - startIndex); /// /// Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a byte array. @@ -430,22 +377,16 @@ namespace DiscImageChef /// startIndex is less than zero or greater than the length of value /// minus 1. /// - public static ulong ToUInt64(byte[] value, int startIndex) - { - return !IsLittleEndian - ? BitConverter.ToUInt64(value, startIndex) - : BitConverter.ToUInt64(value.Reverse().ToArray(), value.Length - sizeof(ulong) - startIndex); - } + public static ulong ToUInt64(byte[] value, int startIndex) => + !IsLittleEndian + ? BitConverter.ToUInt64(value, startIndex) + : BitConverter.ToUInt64(value.Reverse().ToArray(), value.Length - sizeof(ulong) - startIndex); - public static Guid ToGuid(byte[] value, int startIndex) - { - return new Guid(ToUInt32(value, 0 + startIndex), ToUInt16(value, 4 + startIndex), - ToUInt16(value, 6 + startIndex), value[8 + startIndex + 0], - value[8 + startIndex + 1], - value[8 + startIndex + 2], value[8 + startIndex + 3], - value[8 + startIndex + 5], - value[8 + startIndex + 5], value[8 + startIndex + 6], - value[8 + startIndex + 7]); - } + public static Guid ToGuid(byte[] value, int startIndex) => + new Guid(ToUInt32(value, 0 + startIndex), ToUInt16(value, 4 + startIndex), + ToUInt16(value, 6 + startIndex), + value[8 + startIndex + 0], value[8 + startIndex + 1], value[8 + startIndex + 2], + value[8 + startIndex + 3], value[8 + startIndex + 5], value[8 + startIndex + 5], + value[8 + startIndex + 6], value[8 + startIndex + 7]); } } \ No newline at end of file diff --git a/DiscImageChef.Helpers/CHS.cs b/DiscImageChef.Helpers/CHS.cs index ae4c0fa5d..7d933bd3b 100644 --- a/DiscImageChef.Helpers/CHS.cs +++ b/DiscImageChef.Helpers/CHS.cs @@ -43,11 +43,9 @@ namespace DiscImageChef.Helpers /// Number of heads /// Number of sectors per track /// - public static uint ToLBA(uint cyl, uint head, uint sector, uint maxHead, uint maxSector) - { - return maxHead == 0 || maxSector == 0 - ? (cyl * 16 + head) * 63 + sector - 1 - : (cyl * maxHead + head) * maxSector + sector - 1; - } + public static uint ToLBA(uint cyl, uint head, uint sector, uint maxHead, uint maxSector) => + maxHead == 0 || maxSector == 0 + ? (cyl * 16 + head) * 63 + sector - 1 + : (cyl * maxHead + head) * maxSector + sector - 1; } } \ No newline at end of file diff --git a/DiscImageChef.Helpers/DateHandlers.cs b/DiscImageChef.Helpers/DateHandlers.cs index 8cc4d71a9..5ee2db94f 100644 --- a/DiscImageChef.Helpers/DateHandlers.cs +++ b/DiscImageChef.Helpers/DateHandlers.cs @@ -52,50 +52,35 @@ namespace DiscImageChef /// /// Macintosh timestamp (seconds since 1st Jan. 1904) /// .NET DateTime - public static DateTime MacToDateTime(ulong macTimeStamp) - { - return MacEpoch.AddTicks((long)(macTimeStamp * 10000000)); - } + public static DateTime MacToDateTime(ulong macTimeStamp) => MacEpoch.AddTicks((long)(macTimeStamp * 10000000)); /// /// Converts a Lisa timestamp to a .NET DateTime /// /// Lisa timestamp (seconds since 1st Jan. 1901) /// .NET DateTime - public static DateTime LisaToDateTime(uint lisaTimeStamp) - { - return LisaEpoch.AddSeconds(lisaTimeStamp); - } + public static DateTime LisaToDateTime(uint lisaTimeStamp) => LisaEpoch.AddSeconds(lisaTimeStamp); /// /// Converts a UNIX timestamp to a .NET DateTime /// /// UNIX timestamp (seconds since 1st Jan. 1970) /// .NET DateTime - public static DateTime UnixToDateTime(int unixTimeStamp) - { - return UnixEpoch.AddSeconds(unixTimeStamp); - } + public static DateTime UnixToDateTime(int unixTimeStamp) => UnixEpoch.AddSeconds(unixTimeStamp); /// /// Converts a UNIX timestamp to a .NET DateTime /// /// UNIX timestamp (seconds since 1st Jan. 1970) /// .NET DateTime - public static DateTime UnixToDateTime(long unixTimeStamp) - { - return UnixEpoch.AddSeconds(unixTimeStamp); - } + public static DateTime UnixToDateTime(long unixTimeStamp) => UnixEpoch.AddSeconds(unixTimeStamp); /// /// Converts a UNIX timestamp to a .NET DateTime /// /// UNIX timestamp (seconds since 1st Jan. 1970) /// .NET DateTime - public static DateTime UnixUnsignedToDateTime(uint unixTimeStamp) - { - return UnixEpoch.AddSeconds(unixTimeStamp); - } + public static DateTime UnixUnsignedToDateTime(uint unixTimeStamp) => UnixEpoch.AddSeconds(unixTimeStamp); /// /// Converts a UNIX timestamp to a .NET DateTime @@ -103,20 +88,15 @@ namespace DiscImageChef /// Seconds since 1st Jan. 1970) /// Nanoseconds /// .NET DateTime - public static DateTime UnixUnsignedToDateTime(uint seconds, uint nanoseconds) - { - return UnixEpoch.AddSeconds(seconds).AddTicks((long)nanoseconds / 100); - } + public static DateTime UnixUnsignedToDateTime(uint seconds, uint nanoseconds) => + UnixEpoch.AddSeconds(seconds).AddTicks((long)nanoseconds / 100); /// /// Converts a UNIX timestamp to a .NET DateTime /// /// UNIX timestamp (seconds since 1st Jan. 1970) /// .NET DateTime - public static DateTime UnixUnsignedToDateTime(ulong unixTimeStamp) - { - return UnixEpoch.AddSeconds(unixTimeStamp); - } + public static DateTime UnixUnsignedToDateTime(ulong unixTimeStamp) => UnixEpoch.AddSeconds(unixTimeStamp); /// /// Converts a High Sierra Format timestamp to a .NET DateTime @@ -330,10 +310,7 @@ namespace DiscImageChef /// /// Solaris high resolution timestamp /// .NET DateTime - public static DateTime UnixHrTimeToDateTime(ulong hrTimeStamp) - { - return UnixEpoch.AddTicks((long)(hrTimeStamp / 100)); - } + public static DateTime UnixHrTimeToDateTime(ulong hrTimeStamp) => UnixEpoch.AddTicks((long)(hrTimeStamp / 100)); /// /// Converts an OS-9 timestamp to .NET DateTime diff --git a/DiscImageChef.Helpers/StringHandlers.cs b/DiscImageChef.Helpers/StringHandlers.cs index 805238270..67a314a54 100644 --- a/DiscImageChef.Helpers/StringHandlers.cs +++ b/DiscImageChef.Helpers/StringHandlers.cs @@ -42,10 +42,7 @@ namespace DiscImageChef /// /// The corresponding C# string /// A null-terminated (aka C string) ASCII byte array - public static string CToString(byte[] CString) - { - return CToString(CString, Encoding.ASCII); - } + public static string CToString(byte[] CString) => CToString(CString, Encoding.ASCII); /// /// Converts a null-terminated (aka C string) byte array with the specified encoding to a C# string @@ -92,10 +89,7 @@ namespace DiscImageChef /// /// The corresponding C# string /// A length-prefixed (aka Pascal string) ASCII byte array - public static string PascalToString(byte[] PascalString) - { - return PascalToString(PascalString, Encoding.ASCII); - } + public static string PascalToString(byte[] PascalString) => PascalToString(PascalString, Encoding.ASCII); /// /// Converts a length-prefixed (aka Pascal string) ASCII byte array to a C# string @@ -129,10 +123,8 @@ namespace DiscImageChef /// /// The corresponding C# string /// A space (' ', 0x20, ASCII SPACE) padded ASCII byte array - public static string SpacePaddedToString(byte[] SpacePaddedString) - { - return SpacePaddedToString(SpacePaddedString, Encoding.ASCII); - } + public static string SpacePaddedToString(byte[] SpacePaddedString) => + SpacePaddedToString(SpacePaddedString, Encoding.ASCII); /// /// Converts a space (' ', 0x20, ASCII SPACE) padded ASCII byte array to a C# string diff --git a/DiscImageChef.Helpers/Swapping.cs b/DiscImageChef.Helpers/Swapping.cs index db5dbf634..b8defbbe8 100644 --- a/DiscImageChef.Helpers/Swapping.cs +++ b/DiscImageChef.Helpers/Swapping.cs @@ -93,15 +93,9 @@ namespace DiscImageChef return destination; } - public static uint PDPFromLittleEndian(uint x) - { - return ((x & 0xffff) << 16) | ((x & 0xffff0000) >> 16); - } + public static uint PDPFromLittleEndian(uint x) => ((x & 0xffff) << 16) | ((x & 0xffff0000) >> 16); - public static uint PDPFromBigEndian(uint x) - { - return ((x & 0xff00ff) << 8) | ((x & 0xff00ff00) >> 8); - } + public static uint PDPFromBigEndian(uint x) => ((x & 0xff00ff) << 8) | ((x & 0xff00ff00) >> 8); public static ulong Swap(ulong x) { @@ -111,20 +105,11 @@ namespace DiscImageChef return x; } - public static long Swap(long x) - { - return BitConverter.ToInt64(BitConverter.GetBytes(x).Reverse().ToArray(), 0); - } + public static long Swap(long x) => BitConverter.ToInt64(BitConverter.GetBytes(x).Reverse().ToArray(), 0); - public static ushort Swap(ushort x) - { - return (ushort)((x << 8) | (x >> 8)); - } + public static ushort Swap(ushort x) => (ushort)((x << 8) | (x >> 8)); - public static short Swap(short x) - { - return (short)((x << 8) | ((x >> 8) & 0xFF)); - } + public static short Swap(short x) => (short)((x << 8) | ((x >> 8) & 0xFF)); public static uint Swap(uint x) { diff --git a/DiscImageChef.Partitions/Apricot.cs b/DiscImageChef.Partitions/Apricot.cs index baf088ed0..93a3e8955 100644 --- a/DiscImageChef.Partitions/Apricot.cs +++ b/DiscImageChef.Partitions/Apricot.cs @@ -273,18 +273,15 @@ namespace DiscImageChef.Partitions /// Operating system. public byte operatingSystem; /// Software write protection. - [MarshalAs(UnmanagedType.U1)] - public bool writeProtected; + [MarshalAs(UnmanagedType.U1)] public bool writeProtected; /// Copy protected. - [MarshalAs(UnmanagedType.U1)] - public bool copyProtected; + [MarshalAs(UnmanagedType.U1)] public bool copyProtected; /// Boot type. public byte bootType; /// Partitions. public byte partitionCount; /// Is hard disk?. - [MarshalAs(UnmanagedType.U1)] - public bool winchester; + [MarshalAs(UnmanagedType.U1)] public bool winchester; /// Sector size. public ushort sectorSize; /// Sectors per track. @@ -337,18 +334,15 @@ namespace DiscImageChef.Partitions /// Major BIOS version. public byte biosMajorVersion; /// Diagnostics enabled?. - [MarshalAs(UnmanagedType.U1)] - public bool diagnosticsFlag; + [MarshalAs(UnmanagedType.U1)] public bool diagnosticsFlag; /// Printer device. public byte prnDevice; /// Bell volume. public byte bellVolume; /// Cache enabled?. - [MarshalAs(UnmanagedType.U1)] - public bool enableCache; + [MarshalAs(UnmanagedType.U1)] public bool enableCache; /// Graphics enabled?. - [MarshalAs(UnmanagedType.U1)] - public bool enableGraphics; + [MarshalAs(UnmanagedType.U1)] public bool enableGraphics; /// Length in sectors of DOS. public byte dosLength; /// Length in sectors of FONT file. @@ -364,8 +358,7 @@ namespace DiscImageChef.Partitions /// Keyboard click volume. public byte keyboardVolume; /// Auto-repeat enabled?. - [MarshalAs(UnmanagedType.U1)] - public bool autorepeat; + [MarshalAs(UnmanagedType.U1)] public bool autorepeat; /// Auto-repeat lead-in. public byte autorepeatLeadIn; /// Auto-repeat interval. @@ -380,8 +373,7 @@ namespace DiscImageChef.Partitions /// Screen line width. public byte lineWidth; /// Screen disabled?. - [MarshalAs(UnmanagedType.U1)] - public bool imageOff; + [MarshalAs(UnmanagedType.U1)] public bool imageOff; /// Spare area for screen values expansion. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 13)] public byte[] spareScreen; @@ -396,16 +388,13 @@ namespace DiscImageChef.Partitions /// Stop bits. public byte stopBits; /// Parity enabled?. - [MarshalAs(UnmanagedType.U1)] - public bool parityCheck; + [MarshalAs(UnmanagedType.U1)] public bool parityCheck; /// Parity type. public byte parityType; /// Xon/Xoff enabled on TX. - [MarshalAs(UnmanagedType.U1)] - public bool txXonXoff; + [MarshalAs(UnmanagedType.U1)] public bool txXonXoff; /// Xon/Xoff enabled on RX. - [MarshalAs(UnmanagedType.U1)] - public bool rxXonXoff; + [MarshalAs(UnmanagedType.U1)] public bool rxXonXoff; /// Xon character. public byte xonCharacter; /// Xoff character. @@ -413,39 +402,30 @@ namespace DiscImageChef.Partitions /// Xon/Xoff buffer on RX. public ushort rxXonXoffBuffer; /// DTR/DSR enabled?. - [MarshalAs(UnmanagedType.U1)] - public bool dtrDsr; + [MarshalAs(UnmanagedType.U1)] public bool dtrDsr; /// CTS/RTS enabled?. - [MarshalAs(UnmanagedType.U1)] - public bool ctsRts; + [MarshalAs(UnmanagedType.U1)] public bool ctsRts; /// NULLs after CR. public byte nullsAfterCr; /// NULLs after 0xFF. public byte nullsAfterFF; /// Send LF after CR in serial port. - [MarshalAs(UnmanagedType.U1)] - public bool lfAfterCRSerial; + [MarshalAs(UnmanagedType.U1)] public bool lfAfterCRSerial; /// BIOS error report in serial port. - [MarshalAs(UnmanagedType.U1)] - public bool biosErrorReportSerial; + [MarshalAs(UnmanagedType.U1)] public bool biosErrorReportSerial; /// Spare area for serial port values expansion. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 13)] public byte[] spareSerial; /// Send LF after CR in parallel port. - [MarshalAs(UnmanagedType.U1)] - public bool lfAfterCrParallel; + [MarshalAs(UnmanagedType.U1)] public bool lfAfterCrParallel; /// Select line supported?. - [MarshalAs(UnmanagedType.U1)] - public bool selectLine; + [MarshalAs(UnmanagedType.U1)] public bool selectLine; /// Paper empty supported?. - [MarshalAs(UnmanagedType.U1)] - public bool paperEmpty; + [MarshalAs(UnmanagedType.U1)] public bool paperEmpty; /// Fault line supported?. - [MarshalAs(UnmanagedType.U1)] - public bool faultLine; + [MarshalAs(UnmanagedType.U1)] public bool faultLine; /// BIOS error report in parallel port. - [MarshalAs(UnmanagedType.U1)] - public bool biosErrorReportParallel; + [MarshalAs(UnmanagedType.U1)] public bool biosErrorReportParallel; /// Spare area for parallel port values expansion. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)] public byte[] spareParallel; @@ -453,11 +433,9 @@ namespace DiscImageChef.Partitions [MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)] public byte[] spareWinchester; /// Parking enabled?. - [MarshalAs(UnmanagedType.U1)] - public bool parkingEnabled; + [MarshalAs(UnmanagedType.U1)] public bool parkingEnabled; /// Format protection?. - [MarshalAs(UnmanagedType.U1)] - public bool formatProtection; + [MarshalAs(UnmanagedType.U1)] public bool formatProtection; /// Spare area for RAM disk values expansion. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] spareRamDisk; diff --git a/DiscImageChef.Partitions/Register.cs b/DiscImageChef.Partitions/Register.cs index 5a4bdaec1..fb3ededa7 100644 --- a/DiscImageChef.Partitions/Register.cs +++ b/DiscImageChef.Partitions/Register.cs @@ -46,30 +46,15 @@ namespace DiscImageChef.Partitions { public class Register : IPluginRegister { - public List GetAllChecksumPlugins() - { - return null; - } + public List GetAllChecksumPlugins() => null; - public List GetAllFilesystemPlugins() - { - return null; - } + public List GetAllFilesystemPlugins() => null; - public List GetAllFilterPlugins() - { - return null; - } + public List GetAllFilterPlugins() => null; - public List GetAllFloppyImagePlugins() - { - return null; - } + public List GetAllFloppyImagePlugins() => null; - public List GetAllMediaImagePlugins() - { - return null; - } + public List GetAllMediaImagePlugins() => null; public List GetAllPartitionPlugins() { @@ -77,19 +62,10 @@ namespace DiscImageChef.Partitions .Where(t => t.IsClass).ToList(); } - public List GetAllReadOnlyFilesystemPlugins() - { - return null; - } + public List GetAllReadOnlyFilesystemPlugins() => null; - public List GetAllWritableFloppyImagePlugins() - { - return null; - } + public List GetAllWritableFloppyImagePlugins() => null; - public List GetAllWritableImagePlugins() - { - return null; - } + public List GetAllWritableImagePlugins() => null; } } \ No newline at end of file diff --git a/DiscImageChef.Server.Task/Program.cs b/DiscImageChef.Server.Task/Program.cs index 4749c94aa..5041ec53b 100644 --- a/DiscImageChef.Server.Task/Program.cs +++ b/DiscImageChef.Server.Task/Program.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System; using System.Data.Entity.Migrations; using System.Diagnostics; diff --git a/DiscImageChef.Server/App_Start/RouteConfig.cs b/DiscImageChef.Server/App_Start/RouteConfig.cs index de225a22a..1c7e54136 100644 --- a/DiscImageChef.Server/App_Start/RouteConfig.cs +++ b/DiscImageChef.Server/App_Start/RouteConfig.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.Web.Mvc; using System.Web.Routing; diff --git a/DiscImageChef.Server/App_Start/StatsConverter.cs b/DiscImageChef.Server/App_Start/StatsConverter.cs index b24844c73..da99fb372 100644 --- a/DiscImageChef.Server/App_Start/StatsConverter.cs +++ b/DiscImageChef.Server/App_Start/StatsConverter.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.Linq; using DiscImageChef.CommonTypes.Metadata; using DiscImageChef.Server.Models; diff --git a/DiscImageChef.Server/Controllers/HomeController.cs b/DiscImageChef.Server/Controllers/HomeController.cs index 460e74573..bbb25e280 100644 --- a/DiscImageChef.Server/Controllers/HomeController.cs +++ b/DiscImageChef.Server/Controllers/HomeController.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System; using System.IO; using System.Reflection; diff --git a/DiscImageChef.Server/Controllers/ReportController.cs b/DiscImageChef.Server/Controllers/ReportController.cs index 7bc865d16..5f599a50b 100644 --- a/DiscImageChef.Server/Controllers/ReportController.cs +++ b/DiscImageChef.Server/Controllers/ReportController.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System; using System.Collections.Generic; using System.Linq; @@ -44,10 +45,7 @@ namespace DiscImageChef.Server.Controllers { public class ReportController : Controller { - public ActionResult Index() - { - return RedirectToAction("View", "Report", new RouteValueDictionary {{"id", 1}}); - } + public ActionResult Index() => RedirectToAction("View", "Report", new RouteValueDictionary {{"id", 1}}); public ActionResult View(int? id) { diff --git a/DiscImageChef.Server/Migrations/201812232250198_UseBinaryDataForIdentifyInquiryAndModesInReports.cs b/DiscImageChef.Server/Migrations/201812232250198_UseBinaryDataForIdentifyInquiryAndModesInReports.cs index 1f8682989..7477669af 100644 --- a/DiscImageChef.Server/Migrations/201812232250198_UseBinaryDataForIdentifyInquiryAndModesInReports.cs +++ b/DiscImageChef.Server/Migrations/201812232250198_UseBinaryDataForIdentifyInquiryAndModesInReports.cs @@ -1,77 +1,74 @@ +using System.Data.Entity.Migrations; + namespace DiscImageChef.Server.Migrations { - using System; - using System.Data.Entity.Migrations; - public partial class UseBinaryDataForIdentifyInquiryAndModesInReports : DbMigration { public override void Up() { DropForeignKey("Mmcs", "ModeSense2A_Id", "ModePage_2A"); - DropIndex("dbo.Mmcs", new[] { "ModeSense2A_Id" }); + DropIndex("dbo.Mmcs", new[] {"ModeSense2A_Id"}); AddColumn("dbo.Mmcs", "ModeSense2AData", c => c.Binary()); DropColumn("dbo.Mmcs", "ModeSense2A_Id"); DropTable("dbo.ModePage_2A"); } - + public override void Down() { - CreateTable( - "dbo.ModePage_2A", - c => new - { - Id = c.Int(nullable: false, identity: true), - PS = c.Boolean(nullable: false), - MultiSession = c.Boolean(nullable: false), - Mode2Form2 = c.Boolean(nullable: false), - Mode2Form1 = c.Boolean(nullable: false), - AudioPlay = c.Boolean(nullable: false), - ISRC = c.Boolean(nullable: false), - UPC = c.Boolean(nullable: false), - C2Pointer = c.Boolean(nullable: false), - DeinterlaveSubchannel = c.Boolean(nullable: false), - Subchannel = c.Boolean(nullable: false), - AccurateCDDA = c.Boolean(nullable: false), - CDDACommand = c.Boolean(nullable: false), - LoadingMechanism = c.Byte(nullable: false), - Eject = c.Boolean(nullable: false), - PreventJumper = c.Boolean(nullable: false), - LockState = c.Boolean(nullable: false), - Lock = c.Boolean(nullable: false), - SeparateChannelMute = c.Boolean(nullable: false), - SeparateChannelVolume = c.Boolean(nullable: false), - Method2 = c.Boolean(nullable: false), - ReadCDRW = c.Boolean(nullable: false), - ReadCDR = c.Boolean(nullable: false), - WriteCDRW = c.Boolean(nullable: false), - WriteCDR = c.Boolean(nullable: false), - DigitalPort2 = c.Boolean(nullable: false), - DigitalPort1 = c.Boolean(nullable: false), - Composite = c.Boolean(nullable: false), - SSS = c.Boolean(nullable: false), - SDP = c.Boolean(nullable: false), - Length = c.Byte(nullable: false), - LSBF = c.Boolean(nullable: false), - RCK = c.Boolean(nullable: false), - BCK = c.Boolean(nullable: false), - TestWrite = c.Boolean(nullable: false), - ReadBarcode = c.Boolean(nullable: false), - ReadDVDRAM = c.Boolean(nullable: false), - ReadDVDR = c.Boolean(nullable: false), - ReadDVDROM = c.Boolean(nullable: false), - WriteDVDRAM = c.Boolean(nullable: false), - WriteDVDR = c.Boolean(nullable: false), - LeadInPW = c.Boolean(nullable: false), - SCC = c.Boolean(nullable: false), - BUF = c.Boolean(nullable: false), - RotationControlSelected = c.Byte(nullable: false), - }) - .PrimaryKey(t => t.Id); - + CreateTable("dbo.ModePage_2A", + c => new + { + Id = c.Int(false, true), + PS = c.Boolean(false), + MultiSession = c.Boolean(false), + Mode2Form2 = c.Boolean(false), + Mode2Form1 = c.Boolean(false), + AudioPlay = c.Boolean(false), + ISRC = c.Boolean(false), + UPC = c.Boolean(false), + C2Pointer = c.Boolean(false), + DeinterlaveSubchannel = c.Boolean(false), + Subchannel = c.Boolean(false), + AccurateCDDA = c.Boolean(false), + CDDACommand = c.Boolean(false), + LoadingMechanism = c.Byte(false), + Eject = c.Boolean(false), + PreventJumper = c.Boolean(false), + LockState = c.Boolean(false), + Lock = c.Boolean(false), + SeparateChannelMute = c.Boolean(false), + SeparateChannelVolume = c.Boolean(false), + Method2 = c.Boolean(false), + ReadCDRW = c.Boolean(false), + ReadCDR = c.Boolean(false), + WriteCDRW = c.Boolean(false), + WriteCDR = c.Boolean(false), + DigitalPort2 = c.Boolean(false), + DigitalPort1 = c.Boolean(false), + Composite = c.Boolean(false), + SSS = c.Boolean(false), + SDP = c.Boolean(false), + Length = c.Byte(false), + LSBF = c.Boolean(false), + RCK = c.Boolean(false), + BCK = c.Boolean(false), + TestWrite = c.Boolean(false), + ReadBarcode = c.Boolean(false), + ReadDVDRAM = c.Boolean(false), + ReadDVDR = c.Boolean(false), + ReadDVDROM = c.Boolean(false), + WriteDVDRAM = c.Boolean(false), + WriteDVDR = c.Boolean(false), + LeadInPW = c.Boolean(false), + SCC = c.Boolean(false), + BUF = c.Boolean(false), + RotationControlSelected = c.Byte(false) + }).PrimaryKey(t => t.Id); + AddColumn("dbo.Mmcs", "ModeSense2A_Id", c => c.Int()); DropColumn("dbo.Mmcs", "ModeSense2AData"); CreateIndex("dbo.Mmcs", "ModeSense2A_Id"); AddForeignKey("dbo.Mmcs", "ModeSense2A_Id", "dbo.ModePage_2A", "Id"); } } -} +} \ No newline at end of file diff --git a/DiscImageChef.Server/Migrations/Configuration.cs b/DiscImageChef.Server/Migrations/Configuration.cs index e4de350be..db98de2a7 100644 --- a/DiscImageChef.Server/Migrations/Configuration.cs +++ b/DiscImageChef.Server/Migrations/Configuration.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.Data.Entity.Migrations; using DiscImageChef.Server.Models; diff --git a/DiscImageChef.Server/Models/CdOffset.cs b/DiscImageChef.Server/Models/CdOffset.cs index 29a7f9957..dfb8d1050 100644 --- a/DiscImageChef.Server/Models/CdOffset.cs +++ b/DiscImageChef.Server/Models/CdOffset.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; diff --git a/DiscImageChef.Server/Models/Command.cs b/DiscImageChef.Server/Models/Command.cs index b968c13fc..fc756d9cc 100644 --- a/DiscImageChef.Server/Models/Command.cs +++ b/DiscImageChef.Server/Models/Command.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Server.Models diff --git a/DiscImageChef.Server/Models/Device.cs b/DiscImageChef.Server/Models/Device.cs index a623034e5..127381f66 100644 --- a/DiscImageChef.Server/Models/Device.cs +++ b/DiscImageChef.Server/Models/Device.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System; using System.ComponentModel.DataAnnotations.Schema; using DiscImageChef.CommonTypes.Metadata; diff --git a/DiscImageChef.Server/Models/DeviceItem.cs b/DiscImageChef.Server/Models/DeviceItem.cs index 6278df17d..2be4ec8bf 100644 --- a/DiscImageChef.Server/Models/DeviceItem.cs +++ b/DiscImageChef.Server/Models/DeviceItem.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + namespace DiscImageChef.Server.Models { public class DeviceItem diff --git a/DiscImageChef.Server/Models/DeviceStat.cs b/DiscImageChef.Server/Models/DeviceStat.cs index 8cdd9a7d2..215006178 100644 --- a/DiscImageChef.Server/Models/DeviceStat.cs +++ b/DiscImageChef.Server/Models/DeviceStat.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Server.Models diff --git a/DiscImageChef.Server/Models/Filesystem.cs b/DiscImageChef.Server/Models/Filesystem.cs index 2d3859d31..9bcfb7443 100644 --- a/DiscImageChef.Server/Models/Filesystem.cs +++ b/DiscImageChef.Server/Models/Filesystem.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Server.Models diff --git a/DiscImageChef.Server/Models/Filter.cs b/DiscImageChef.Server/Models/Filter.cs index 0000266f6..1d150e663 100644 --- a/DiscImageChef.Server/Models/Filter.cs +++ b/DiscImageChef.Server/Models/Filter.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Server.Models diff --git a/DiscImageChef.Server/Models/Media.cs b/DiscImageChef.Server/Models/Media.cs index 92cc31547..3fc7d3934 100644 --- a/DiscImageChef.Server/Models/Media.cs +++ b/DiscImageChef.Server/Models/Media.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Server.Models diff --git a/DiscImageChef.Server/Models/MediaFormat.cs b/DiscImageChef.Server/Models/MediaFormat.cs index 1a6555c7a..83342b81a 100644 --- a/DiscImageChef.Server/Models/MediaFormat.cs +++ b/DiscImageChef.Server/Models/MediaFormat.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Server.Models diff --git a/DiscImageChef.Server/Models/MediaItem.cs b/DiscImageChef.Server/Models/MediaItem.cs index 00a0710f8..3063e3a67 100644 --- a/DiscImageChef.Server/Models/MediaItem.cs +++ b/DiscImageChef.Server/Models/MediaItem.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + namespace DiscImageChef.Server.Models { public class MediaItem diff --git a/DiscImageChef.Server/Models/OperatingSystem.cs b/DiscImageChef.Server/Models/OperatingSystem.cs index 2324e4783..3c2b8be88 100644 --- a/DiscImageChef.Server/Models/OperatingSystem.cs +++ b/DiscImageChef.Server/Models/OperatingSystem.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Server.Models diff --git a/DiscImageChef.Server/Models/Partition.cs b/DiscImageChef.Server/Models/Partition.cs index eaad0f22e..83e64ef3b 100644 --- a/DiscImageChef.Server/Models/Partition.cs +++ b/DiscImageChef.Server/Models/Partition.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Server.Models diff --git a/DiscImageChef.Server/Models/UploadedReport.cs b/DiscImageChef.Server/Models/UploadedReport.cs index a076c37fb..3e818be64 100644 --- a/DiscImageChef.Server/Models/UploadedReport.cs +++ b/DiscImageChef.Server/Models/UploadedReport.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System; using DiscImageChef.CommonTypes.Metadata; diff --git a/DiscImageChef.Server/Models/UsbProduct.cs b/DiscImageChef.Server/Models/UsbProduct.cs index ac2945150..b19582324 100644 --- a/DiscImageChef.Server/Models/UsbProduct.cs +++ b/DiscImageChef.Server/Models/UsbProduct.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/DiscImageChef.Server/Models/UsbVendor.cs b/DiscImageChef.Server/Models/UsbVendor.cs index 9f6bb0d8d..571e8c3e2 100644 --- a/DiscImageChef.Server/Models/UsbVendor.cs +++ b/DiscImageChef.Server/Models/UsbVendor.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/DiscImageChef.Server/Models/Version.cs b/DiscImageChef.Server/Models/Version.cs index 681b4df3d..c94b67efe 100644 --- a/DiscImageChef.Server/Models/Version.cs +++ b/DiscImageChef.Server/Models/Version.cs @@ -29,6 +29,7 @@ // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ + using System.ComponentModel.DataAnnotations; namespace DiscImageChef.Server.Models diff --git a/DiscImageChef.Server/Views/Home/Index.cshtml b/DiscImageChef.Server/Views/Home/Index.cshtml index d92ea944f..21378e642 100644 --- a/DiscImageChef.Server/Views/Home/Index.cshtml +++ b/DiscImageChef.Server/Views/Home/Index.cshtml @@ -43,7 +43,8 @@ - + @ViewBag.Title