diff --git a/Aaru.Checksums b/Aaru.Checksums index 99535bcd7..c26d833e6 160000 --- a/Aaru.Checksums +++ b/Aaru.Checksums @@ -1 +1 @@ -Subproject commit 99535bcd71e68cb08fc4446aefacfb16d8dce769 +Subproject commit c26d833e6aa1997d202944b1e657abe055dea8bf diff --git a/Aaru.CommonTypes b/Aaru.CommonTypes index 77acc07c7..0312d5a81 160000 --- a/Aaru.CommonTypes +++ b/Aaru.CommonTypes @@ -1 +1 @@ -Subproject commit 77acc07c72a54731f0dd5fb24bc2a2ead04dabf3 +Subproject commit 0312d5a812ef70583c6cd0440718b25707fff3fa diff --git a/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs b/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs index 3cc70838a..943f502f9 100644 --- a/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs +++ b/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs @@ -45,40 +45,13 @@ namespace Aaru.Core.Devices.Dumping; public partial class Dump { - static readonly byte[] _sfcExtension = - { - 0x53, 0x46, 0x43 - }; - - static readonly byte[] _genesisExtension = - { - 0x42, 0x49, 0x4E - }; - - static readonly byte[] _smsExtension = - { - 0x53, 0x4D, 0x53 - }; - - static readonly byte[] _z64Extension = - { - 0x5A, 0x36, 0x34 - }; - - static readonly byte[] _gbExtension = - { - 0x47, 0x42, 0x20 - }; - - static readonly byte[] _gbcExtension = - { - 0x47, 0x42, 0x43 - }; - - static readonly byte[] _gbaExtension = - { - 0x47, 0x42, 0x41 - }; + static readonly byte[] _sfcExtension = "SFC"u8.ToArray(); + static readonly byte[] _genesisExtension = "BIN"u8.ToArray(); + static readonly byte[] _smsExtension = "SMS"u8.ToArray(); + static readonly byte[] _z64Extension = "Z64"u8.ToArray(); + static readonly byte[] _gbExtension = "GB "u8.ToArray(); + static readonly byte[] _gbcExtension = "GBC"u8.ToArray(); + static readonly byte[] _gbaExtension = "GBA"u8.ToArray(); /// Dumps a game cartridge using a Retrode adapter void Retrode() diff --git a/Aaru.Core/Devices/Dumping/PlayStationPortable/PlayStationPortable.cs b/Aaru.Core/Devices/Dumping/PlayStationPortable/PlayStationPortable.cs index af4a66d2d..b5815e816 100644 --- a/Aaru.Core/Devices/Dumping/PlayStationPortable/PlayStationPortable.cs +++ b/Aaru.Core/Devices/Dumping/PlayStationPortable/PlayStationPortable.cs @@ -42,14 +42,8 @@ namespace Aaru.Core.Devices.Dumping; public partial class Dump { - static readonly byte[] _fatSignature = - { - 0x46, 0x41, 0x54, 0x31, 0x36, 0x20, 0x20, 0x20 - }; - static readonly byte[] _isoExtension = - { - 0x49, 0x53, 0x4F - }; + static readonly byte[] _fatSignature = "FAT16 "u8.ToArray(); + static readonly byte[] _isoExtension = "ISO"u8.ToArray(); /// Dumps a CFW PlayStation Portable UMD void PlayStationPortable() diff --git a/Aaru.Core/Media/Detection/MMC.cs b/Aaru.Core/Media/Detection/MMC.cs index fee5cb8da..b04ad4d2f 100644 --- a/Aaru.Core/Media/Detection/MMC.cs +++ b/Aaru.Core/Media/Detection/MMC.cs @@ -91,31 +91,11 @@ public static class MMC }; /// Present on first two seconds of second track, says "COPYRIGHT BANDAI" - static readonly byte[] _playdiaCopyright = - { - 0x43, 0x4F, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x42, 0x41, 0x4E, 0x44, 0x41, 0x49 - }; - - static readonly byte[] _pcEngineSignature = - { - 0x50, 0x43, 0x20, 0x45, 0x6E, 0x67, 0x69, 0x6E, 0x65, 0x20, 0x43, 0x44, 0x2D, 0x52, 0x4F, 0x4D, 0x20, 0x53, - 0x59, 0x53, 0x54, 0x45, 0x4D - }; - - static readonly byte[] _pcFxSignature = - { - 0x50, 0x43, 0x2D, 0x46, 0x58, 0x3A, 0x48, 0x75, 0x5F, 0x43, 0x44, 0x2D, 0x52, 0x4F, 0x4D - }; - + static readonly byte[] _playdiaCopyright = "COPYRIGHT BANDAI"u8.ToArray(); + static readonly byte[] _pcEngineSignature = "PC Engine CD-ROM SYSTEM"u8.ToArray(); + static readonly byte[] _pcFxSignature = "PC-FX:Hu_CD-ROM"u8.ToArray(); static readonly byte[] _atariSignature = - { - 0x54, 0x41, 0x49, 0x52, 0x54, 0x41, 0x49, 0x52, 0x54, 0x41, 0x49, 0x52, 0x54, 0x41, 0x49, 0x52, 0x54, 0x41, - 0x49, 0x52, 0x54, 0x41, 0x49, 0x52, 0x54, 0x41, 0x49, 0x52, 0x54, 0x41, 0x49, 0x52, 0x54, 0x41, 0x49, 0x52, - 0x54, 0x41, 0x49, 0x52, 0x54, 0x41, 0x49, 0x52, 0x54, 0x41, 0x49, 0x52, 0x54, 0x41, 0x49, 0x52, 0x54, 0x41, - 0x49, 0x52, 0x54, 0x41, 0x49, 0x52, 0x54, 0x41, 0x49, 0x52, 0x54, 0x41, 0x52, 0x41, 0x20, 0x49, 0x50, 0x41, - 0x52, 0x50, 0x56, 0x4F, 0x44, 0x45, 0x44, 0x20, 0x54, 0x41, 0x20, 0x41, 0x45, 0x48, 0x44, 0x41, 0x52, 0x45, - 0x41, 0x20, 0x52, 0x54 - }; + "TAIRTAIRTAIRTAIRTAIRTAIRTAIRTAIRTAIRTAIRTAIRTAIRTAIRTAIRTAIRTAIRTARA IPARPVODED TA AEHDAREA RT"u8.ToArray(); /// This is some kind of header. Every 10 bytes there's an audio byte. static readonly byte[] _videoNowColorFrameMarker = diff --git a/Aaru.Decoders b/Aaru.Decoders index abbde2d4f..c58d1f226 160000 --- a/Aaru.Decoders +++ b/Aaru.Decoders @@ -1 +1 @@ -Subproject commit abbde2d4fe4ea1b13ac4c0ddfe2f2639ebe6462c +Subproject commit c58d1f22613f43ae0e879ab592da9bd13a26fc13 diff --git a/Aaru.Filesystems/AODOS/Consts.cs b/Aaru.Filesystems/AODOS/Consts.cs index a83a737f0..9532102e1 100644 --- a/Aaru.Filesystems/AODOS/Consts.cs +++ b/Aaru.Filesystems/AODOS/Consts.cs @@ -38,9 +38,6 @@ namespace Aaru.Filesystems; /// Implements detection of the AO-DOS filesystem public sealed partial class AODOS { - const string FS_TYPE = "aodos"; - readonly byte[] _identifier = - { - 0x20, 0x41, 0x4F, 0x2D, 0x44, 0x4F, 0x53, 0x20 - }; + const string FS_TYPE = "aodos"; + readonly byte[] _identifier = " AO-DOS "u8.ToArray(); } \ No newline at end of file diff --git a/Aaru.Filesystems/ECMA67/Consts.cs b/Aaru.Filesystems/ECMA67/Consts.cs index cef72aecf..2709424d0 100644 --- a/Aaru.Filesystems/ECMA67/Consts.cs +++ b/Aaru.Filesystems/ECMA67/Consts.cs @@ -36,9 +36,6 @@ namespace Aaru.Filesystems; /// Implements detection of the filesystem described in ECMA-67 public sealed partial class ECMA67 { - const string FS_TYPE = "ecma67"; - readonly byte[] _magic = - { - 0x56, 0x4F, 0x4C - }; + const string FS_TYPE = "ecma67"; + readonly byte[] _magic = "VOL"u8.ToArray(); } \ No newline at end of file diff --git a/Aaru.Filesystems/HPOFS/Consts.cs b/Aaru.Filesystems/HPOFS/Consts.cs index a06c74acf..6e2befa23 100644 --- a/Aaru.Filesystems/HPOFS/Consts.cs +++ b/Aaru.Filesystems/HPOFS/Consts.cs @@ -34,14 +34,8 @@ public sealed partial class HPOFS { 0x48, 0x50, 0x4F, 0x46, 0x53, 0x00, 0x00, 0x00 }; - readonly byte[] _medinfoSignature = - { - 0x4D, 0x45, 0x44, 0x49, 0x4E, 0x46, 0x4F, 0x20 - }; - readonly byte[] _volinfoSignature = - { - 0x56, 0x4F, 0x4C, 0x49, 0x4E, 0x46, 0x4F, 0x20 - }; + readonly byte[] _medinfoSignature = "MEDINFO "u8.ToArray(); + readonly byte[] _volinfoSignature = "VOLINFO "u8.ToArray(); // Do not translate const string FS_TYPE = "hpofs"; diff --git a/Aaru.Filesystems/exFAT/Consts.cs b/Aaru.Filesystems/exFAT/Consts.cs index ca986958e..6773477c8 100644 --- a/Aaru.Filesystems/exFAT/Consts.cs +++ b/Aaru.Filesystems/exFAT/Consts.cs @@ -39,12 +39,7 @@ namespace Aaru.Filesystems; // ReSharper disable once InconsistentNaming public sealed partial class exFAT { - readonly Guid _oemFlashParameterGuid = new("0A0C7E46-3399-4021-90C8-FA6D389C4BA2"); - - readonly byte[] _signature = - { - 0x45, 0x58, 0x46, 0x41, 0x54, 0x20, 0x20, 0x20 - }; - + readonly Guid _oemFlashParameterGuid = new("0A0C7E46-3399-4021-90C8-FA6D389C4BA2"); + readonly byte[] _signature = "EXFAT "u8.ToArray(); const string FS_TYPE = "exfat"; } \ No newline at end of file diff --git a/Aaru.Filters/AppleDouble.cs b/Aaru.Filters/AppleDouble.cs index 1e9da49b4..f1f878938 100644 --- a/Aaru.Filters/AppleDouble.cs +++ b/Aaru.Filters/AppleDouble.cs @@ -47,38 +47,19 @@ namespace Aaru.Filters; [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class AppleDouble : IFilter { - const uint MAGIC = 0x00051607; - const uint VERSION = 0x00010000; - const uint VERSION2 = 0x00020000; - readonly byte[] _dosHome = - { - 0x4D, 0x53, 0x2D, 0x44, 0x4F, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 - }; - - readonly byte[] _macintoshHome = - { - 0x4D, 0x61, 0x63, 0x69, 0x6E, 0x74, 0x6F, 0x73, 0x68, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 - }; - readonly byte[] _osxHome = - { - 0x4D, 0x61, 0x63, 0x20, 0x4F, 0x53, 0x20, 0x58, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 - }; - readonly byte[] _proDosHome = - { - 0x50, 0x72, 0x6F, 0x44, 0x4F, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 - }; - readonly byte[] _unixHome = - { - 0x55, 0x6E, 0x69, 0x78, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 - }; - readonly byte[] _vmsHome = - { - 0x56, 0x41, 0x58, 0x20, 0x56, 0x4D, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 - }; - Entry _dataFork; - Header _header; - string _headerPath; - Entry _rsrcFork; + const uint MAGIC = 0x00051607; + const uint VERSION = 0x00010000; + const uint VERSION2 = 0x00020000; + readonly byte[] _dosHome = "MS-DOS "u8.ToArray(); + readonly byte[] _macintoshHome = "Macintosh "u8.ToArray(); + readonly byte[] _osxHome = "Mac OS X "u8.ToArray(); + readonly byte[] _proDosHome = "ProDOS "u8.ToArray(); + readonly byte[] _unixHome = "Unix "u8.ToArray(); + readonly byte[] _vmsHome = "VAX VMS "u8.ToArray(); + Entry _dataFork; + Header _header; + string _headerPath; + Entry _rsrcFork; /// public string Name => Localization.AppleDouble_Name; diff --git a/Aaru.Filters/AppleSingle.cs b/Aaru.Filters/AppleSingle.cs index e12ca2d68..0f0364ee2 100644 --- a/Aaru.Filters/AppleSingle.cs +++ b/Aaru.Filters/AppleSingle.cs @@ -47,40 +47,21 @@ namespace Aaru.Filters; [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class AppleSingle : IFilter { - const uint MAGIC = 0x00051600; - const uint VERSION = 0x00010000; - const uint VERSION2 = 0x00020000; - readonly byte[] _dosHome = - { - 0x4D, 0x53, 0x2D, 0x44, 0x4F, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 - }; - - readonly byte[] _macintoshHome = - { - 0x4D, 0x61, 0x63, 0x69, 0x6E, 0x74, 0x6F, 0x73, 0x68, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 - }; - readonly byte[] _osxHome = - { - 0x4D, 0x61, 0x63, 0x20, 0x4F, 0x53, 0x20, 0x58, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 - }; - readonly byte[] _proDosHome = - { - 0x50, 0x72, 0x6F, 0x44, 0x4F, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 - }; - readonly byte[] _unixHome = - { - 0x55, 0x6E, 0x69, 0x78, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 - }; - readonly byte[] _vmsHome = - { - 0x56, 0x41, 0x58, 0x20, 0x56, 0x4D, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 - }; - byte[] _bytes; - Entry _dataFork; - Header _header; - bool _isBytes, _isStream, _isPath; - Entry _rsrcFork; - Stream _stream; + const uint MAGIC = 0x00051600; + const uint VERSION = 0x00010000; + const uint VERSION2 = 0x00020000; + readonly byte[] _dosHome = "MS-DOS "u8.ToArray(); + readonly byte[] _macintoshHome = "Macintosh "u8.ToArray(); + readonly byte[] _osxHome = "Mac OS X "u8.ToArray(); + readonly byte[] _proDosHome = "ProDOS "u8.ToArray(); + readonly byte[] _unixHome = "Unix "u8.ToArray(); + readonly byte[] _vmsHome = "VAX VMS "u8.ToArray(); + byte[] _bytes; + Entry _dataFork; + Header _header; + bool _isBytes, _isStream, _isPath; + Entry _rsrcFork; + Stream _stream; /// public string Name => Localization.AppleSingle_Name; diff --git a/Aaru.Images/Alcohol120/Constants.cs b/Aaru.Images/Alcohol120/Constants.cs index 799a17ba6..42a8c0ae9 100644 --- a/Aaru.Images/Alcohol120/Constants.cs +++ b/Aaru.Images/Alcohol120/Constants.cs @@ -34,9 +34,6 @@ namespace Aaru.DiscImages; public sealed partial class Alcohol120 { - const byte MAXIMUM_SUPPORTED_VERSION = 1; - readonly byte[] _alcoholSignature = - { - 0x4d, 0x45, 0x44, 0x49, 0x41, 0x20, 0x44, 0x45, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x4f, 0x52 - }; + const byte MAXIMUM_SUPPORTED_VERSION = 1; + readonly byte[] _alcoholSignature = "MEDIA DESCRIPTOR"u8.ToArray(); } \ No newline at end of file diff --git a/Aaru.Images/AppleNIB/Constants.cs b/Aaru.Images/AppleNIB/Constants.cs index b26cf09b9..bd675ba80 100644 --- a/Aaru.Images/AppleNIB/Constants.cs +++ b/Aaru.Images/AppleNIB/Constants.cs @@ -53,27 +53,17 @@ public sealed partial class AppleNib { 0, 7, 14, 6, 13, 5, 12, 4, 11, 3, 10, 2, 9, 1, 8, 15 }; - readonly byte[] _driString = - { - 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[] _driString = "COPYRIGHT (C) 1979, DIGITAL RESEARCH"u8.ToArray(); readonly byte[] _pascalSign = { 0x08, 0xA5, 0x0F, 0x29 }; - readonly byte[] _pascalString = - { - 0x53, 0x59, 0x53, 0x54, 0x45, 0x2E, 0x41, 0x50, 0x50, 0x4C, 0x45 - }; + readonly byte[] _pascalString = "SYSTE.APPLE"u8.ToArray(); readonly byte[] _pascal2Sign = { 0xFF, 0xA2, 0x00, 0x8E }; - readonly byte[] _prodosString = - { - 0x50, 0x52, 0x4F, 0x44, 0x4F, 0x53 - }; + readonly byte[] _prodosString = "PRODOS"u8.ToArray(); readonly ulong[] _proDosSkewing = { 0, 8, 1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15 diff --git a/Aaru.Images/BlindWrite4/Constants.cs b/Aaru.Images/BlindWrite4/Constants.cs index a4a1d9ac1..f29e92492 100644 --- a/Aaru.Images/BlindWrite4/Constants.cs +++ b/Aaru.Images/BlindWrite4/Constants.cs @@ -35,8 +35,5 @@ namespace Aaru.DiscImages; public sealed partial class BlindWrite4 { /// "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 - }; + readonly byte[] _bw4Signature = "BLINDWRITE TOC FILE"u8.ToArray(); } \ No newline at end of file diff --git a/Aaru.Images/BlindWrite5/Constants.cs b/Aaru.Images/BlindWrite5/Constants.cs index d5df3ecd2..f90d82d96 100644 --- a/Aaru.Images/BlindWrite5/Constants.cs +++ b/Aaru.Images/BlindWrite5/Constants.cs @@ -35,13 +35,7 @@ namespace Aaru.DiscImages; public sealed partial class BlindWrite5 { /// "BWT5 STREAM FOOT" - readonly byte[] _bw5Footer = - { - 0x42, 0x57, 0x54, 0x35, 0x20, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4D, 0x20, 0x46, 0x4F, 0x4F, 0x54 - }; + readonly byte[] _bw5Footer = "BWT5 STREAM FOOT"u8.ToArray(); /// "BWT5 STREAM SIGN" - readonly byte[] _bw5Signature = - { - 0x42, 0x57, 0x54, 0x35, 0x20, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4D, 0x20, 0x53, 0x49, 0x47, 0x4E - }; + readonly byte[] _bw5Signature = "BWT5 STREAM SIGN"u8.ToArray(); } \ No newline at end of file diff --git a/Aaru.Images/CHD/CHD.cs b/Aaru.Images/CHD/CHD.cs index d31cfa830..3c7da83e7 100644 --- a/Aaru.Images/CHD/CHD.cs +++ b/Aaru.Images/CHD/CHD.cs @@ -48,10 +48,7 @@ namespace Aaru.DiscImages; public sealed partial class Chd : IOpticalMediaImage, IVerifiableImage { /// "MComprHD" - readonly byte[] _chdTag = - { - 0x4D, 0x43, 0x6F, 0x6D, 0x70, 0x72, 0x48, 0x44 - }; + readonly byte[] _chdTag = "MComprHD"u8.ToArray(); SectorBuilder _sectorBuilder; uint _bytesPerHunk; byte[] _cis; diff --git a/Aaru.Images/CopyTape/Write.cs b/Aaru.Images/CopyTape/Write.cs index 56fda10f7..91d3cf487 100644 --- a/Aaru.Images/CopyTape/Write.cs +++ b/Aaru.Images/CopyTape/Write.cs @@ -177,7 +177,7 @@ public sealed partial class CopyTape return false; } - byte[] footer = Encoding.ASCII.GetBytes("CPTP:EOT\n"); + byte[] footer = "CPTP:EOT\n"u8.ToArray(); _dataStream.Write(footer, 0, footer.Length); _dataStream.Flush(); @@ -231,7 +231,7 @@ public sealed partial class CopyTape return false; } - byte[] marker = Encoding.ASCII.GetBytes("CPTP:MRK\n"); + byte[] marker = "CPTP:MRK\n"u8.ToArray(); _dataStream.Write(marker, 0, marker.Length); diff --git a/Aaru.Images/DIM/Constants.cs b/Aaru.Images/DIM/Constants.cs index b73750bbe..899069f66 100644 --- a/Aaru.Images/DIM/Constants.cs +++ b/Aaru.Images/DIM/Constants.cs @@ -36,8 +36,5 @@ public sealed partial class Dim { /// Start of data sectors in disk image, should be 0x100 const uint DATA_OFFSET = 0x100; - readonly byte[] _headerId = - { - 0x44, 0x49, 0x46, 0x43, 0x20, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x20, 0x20 - }; + readonly byte[] _headerId = "DIFC HEADER "u8.ToArray(); } \ No newline at end of file diff --git a/Aaru.Images/DriDiskCopy/Write.cs b/Aaru.Images/DriDiskCopy/Write.cs index 769409376..a5c7df257 100644 --- a/Aaru.Images/DriDiskCopy/Write.cs +++ b/Aaru.Images/DriDiskCopy/Write.cs @@ -34,7 +34,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; using Aaru.CommonTypes; using Aaru.CommonTypes.AaruMetadata; using Aaru.CommonTypes.Enums; @@ -109,7 +108,7 @@ public sealed partial class DriDiskCopy } }; - Array.Copy(Encoding.ASCII.GetBytes("DiskImage 2.01 (C) 1990,1991 Digital Research Inc"), 0, _footer.signature, + Array.Copy("DiskImage 2.01 (C) 1990,1991 Digital Research Inc"u8.ToArray(), 0, _footer.signature, 0, 49); _footer.bpbcopy = _footer.bpb; diff --git a/Aaru.Images/Parallels/Constants.cs b/Aaru.Images/Parallels/Constants.cs index d993f0650..03cb2c1d5 100644 --- a/Aaru.Images/Parallels/Constants.cs +++ b/Aaru.Images/Parallels/Constants.cs @@ -37,19 +37,13 @@ namespace Aaru.DiscImages; [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed partial class Parallels { - const uint PARALLELS_VERSION = 2; - const uint PARALLELS_INUSE = 0x746F6E59; - const uint PARALLELS_CLOSED = 0x312E3276; - const uint PARALLELS_EMPTY = 0x00000001; - const uint MAX_CACHE_SIZE = 16777216; - const uint MAX_CACHED_SECTORS = MAX_CACHE_SIZE / 512; - const uint DEFAULT_CLUSTER_SIZE = 1048576; - readonly byte[] _extMagic = - { - 0x57, 0x69, 0x74, 0x68, 0x6F, 0x75, 0x46, 0x72, 0x65, 0x53, 0x70, 0x61, 0x63, 0x45, 0x78, 0x74 - }; - readonly byte[] _magic = - { - 0x57, 0x69, 0x74, 0x68, 0x6F, 0x75, 0x74, 0x46, 0x72, 0x65, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65 - }; + const uint PARALLELS_VERSION = 2; + const uint PARALLELS_INUSE = 0x746F6E59; + const uint PARALLELS_CLOSED = 0x312E3276; + const uint PARALLELS_EMPTY = 0x00000001; + const uint MAX_CACHE_SIZE = 16777216; + const uint MAX_CACHED_SECTORS = MAX_CACHE_SIZE / 512; + const uint DEFAULT_CLUSTER_SIZE = 1048576; + readonly byte[] _extMagic = "WithouFreSpacExt"u8.ToArray(); + readonly byte[] _magic = "WithoutFreeSpace"u8.ToArray(); } \ No newline at end of file diff --git a/Aaru.Images/PartClone/Constants.cs b/Aaru.Images/PartClone/Constants.cs index 9cb63e6af..8e153fad9 100644 --- a/Aaru.Images/PartClone/Constants.cs +++ b/Aaru.Images/PartClone/Constants.cs @@ -34,15 +34,9 @@ namespace Aaru.DiscImages; public sealed partial class PartClone { - const int CRC_SIZE = 4; - const uint MAX_CACHE_SIZE = 16777216; - 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 - }; + const int CRC_SIZE = 4; + const uint MAX_CACHE_SIZE = 16777216; + const uint MAX_CACHED_SECTORS = MAX_CACHE_SIZE / 512; + readonly byte[] _biTmAgIc = "BiTmAgIc"u8.ToArray(); + readonly byte[] _partCloneMagic = "partclone-image"u8.ToArray(); } \ No newline at end of file diff --git a/Aaru.Images/SuperCardPro/Constants.cs b/Aaru.Images/SuperCardPro/Constants.cs index 852b9e319..1dd48abc5 100644 --- a/Aaru.Images/SuperCardPro/Constants.cs +++ b/Aaru.Images/SuperCardPro/Constants.cs @@ -37,15 +37,9 @@ public sealed partial class SuperCardPro /// SuperCardPro footer signature: "FPCS" const uint FOOTER_SIGNATURE = 0x53435046; /// SuperCardPro header signature: "SCP" - readonly byte[] _scpSignature = - { - 0x53, 0x43, 0x50 - }; + readonly byte[] _scpSignature = "SCP"u8.ToArray(); /// SuperCardPro track header signature: "TRK" - readonly byte[] _trkSignature = - { - 0x54, 0x52, 0x4B - }; + readonly byte[] _trkSignature = "TRK"u8.ToArray(); /// SuperCardPro device default capture resolution: 25 nanoseconds. const ushort DEFAULT_RESOLUTION = 25000; diff --git a/Aaru.Images/UkvFdi/Constants.cs b/Aaru.Images/UkvFdi/Constants.cs index 0b4583796..ee746d8bf 100644 --- a/Aaru.Images/UkvFdi/Constants.cs +++ b/Aaru.Images/UkvFdi/Constants.cs @@ -34,8 +34,5 @@ namespace Aaru.DiscImages; public sealed partial class UkvFdi { - readonly byte[] _signature = - { - 0x46, 0x44, 0x49 - }; + readonly byte[] _signature = "FDI"u8.ToArray(); } \ No newline at end of file diff --git a/Aaru.Images/VMware/Constants.cs b/Aaru.Images/VMware/Constants.cs index d82584925..341dc5c1c 100644 --- a/Aaru.Images/VMware/Constants.cs +++ b/Aaru.Images/VMware/Constants.cs @@ -39,7 +39,6 @@ public sealed partial class VMware { const uint VMWARE_EXTENT_MAGIC = 0x564D444B; const uint VMWARE_COW_MAGIC = 0x44574F43; - const string VM_TYPE_CUSTOM = "custom"; const string VM_TYPE_MONO_SPARSE = "monolithicSparse"; const string VM_TYPE_MONO_FLAT = "monolithicFlat"; @@ -58,9 +57,7 @@ public sealed partial class VMware const string VMFS_TYPE_RAW = "vmfsRaw"; const string VMFS_TYPE = "vmfs"; const string VM_TYPE_STREAM = "streamOptimized"; - const string DDF_MAGIC = "# Disk DescriptorFile"; - const string REGEX_VERSION = @"^\s*version\s*=\s*(?\d+)$"; const string REGEX_CID = @"^\s*CID\s*=\s*(?[0123456789abcdef]{8})$"; const string REGEX_CID_PARENT = @"^\s*parentCID\s*=\s*(?[0123456789abcdef]{8})$"; @@ -68,27 +65,20 @@ public sealed partial class VMware @"^\s*createType\s*=\s*\""(?custom|monolithicSparse|monolithicFlat|twoGbMaxExtentSparse|twoGbMaxExtentFlat|fullDevice|partitionedDevice|vmfs|vmfsPreallocated|vmfsEagerZeroedThick|vmfsThin|vmfsSparse|vmfsRDM|vmfsRawDeviceMap|vmfsRDMP|vmfsPassthroughRawDeviceMap|vmfsRaw|streamOptimized)\""$"; const string REGEX_EXTENT = @"^\s*(?(RW|RDONLY|NOACCESS))\s+(?\d+)\s+(?(FLAT|SPARSE|ZERO|VMFS|VMFSSPARSE|VMFSRDM|VMFSRAW))\s+\""(?.+)\""(\s*(?\d+))?$"; - const string REGEX_DDB_TYPE = @"^\s*ddb\.adapterType\s*=\s*\""(?ide|buslogic|lsilogic|legacyESX)\""$"; - const string REGEX_DDB_SECTORS = @"^\s*ddb\.geometry\.sectors\s*=\s*\""(?\d+)\""$"; - const string REGEX_DDB_HEADS = @"^\s*ddb\.geometry\.heads\s*=\s*\""(?\d+)\""$"; - const string REGEX_DDB_CYLINDERS = @"^\s*ddb\.geometry\.cylinders\s*=\s*\""(?\d+)\""$"; - const string PARENT_REGEX = @"^\s*parentFileNameHint\s*=\s*\""(?.+)\""$"; - - const uint FLAGS_VALID_NEW_LINE = 0x01; - const uint FLAGS_USE_REDUNDANT_TABLE = 0x02; - const uint FLAGS_ZERO_GRAIN_GTE = 0x04; - const uint FLAGS_COMPRESSION = 0x10000; - const uint FLAGS_MARKERS = 0x20000; - - const ushort COMPRESSION_NONE = 0; - const ushort COMPRESSION_DEFLATE = 1; - - const uint MAX_CACHE_SIZE = 16777216; - const uint SECTOR_SIZE = 512; - 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 - }; + const string REGEX_DDB_TYPE = @"^\s*ddb\.adapterType\s*=\s*\""(?ide|buslogic|lsilogic|legacyESX)\""$"; + const string REGEX_DDB_SECTORS = @"^\s*ddb\.geometry\.sectors\s*=\s*\""(?\d+)\""$"; + const string REGEX_DDB_HEADS = @"^\s*ddb\.geometry\.heads\s*=\s*\""(?\d+)\""$"; + const string REGEX_DDB_CYLINDERS = @"^\s*ddb\.geometry\.cylinders\s*=\s*\""(?\d+)\""$"; + const string PARENT_REGEX = @"^\s*parentFileNameHint\s*=\s*\""(?.+)\""$"; + const uint FLAGS_VALID_NEW_LINE = 0x01; + const uint FLAGS_USE_REDUNDANT_TABLE = 0x02; + const uint FLAGS_ZERO_GRAIN_GTE = 0x04; + const uint FLAGS_COMPRESSION = 0x10000; + const uint FLAGS_MARKERS = 0x20000; + const ushort COMPRESSION_NONE = 0; + const ushort COMPRESSION_DEFLATE = 1; + const uint MAX_CACHE_SIZE = 16777216; + const uint SECTOR_SIZE = 512; + const uint MAX_CACHED_SECTORS = MAX_CACHE_SIZE / SECTOR_SIZE; + readonly byte[] _ddfMagicBytes = "# Disk DescriptorFile"u8.ToArray(); } \ No newline at end of file diff --git a/Aaru.Tests/Checksums/Adler32.cs b/Aaru.Tests/Checksums/Adler32.cs index 48871c5ea..f54c0941c 100644 --- a/Aaru.Tests/Checksums/Adler32.cs +++ b/Aaru.Tests/Checksums/Adler32.cs @@ -44,6 +44,7 @@ public class Adler32 }; static readonly byte[] _expectedRandom = { + // ReSharper disable once UseUtf8StringLiteral 0x37, 0x28, 0xd1, 0x86 }; diff --git a/Aaru.Tests/Checksums/CRC16CCITT.cs b/Aaru.Tests/Checksums/CRC16CCITT.cs index 2051f2eaf..f5d6343ab 100644 --- a/Aaru.Tests/Checksums/CRC16CCITT.cs +++ b/Aaru.Tests/Checksums/CRC16CCITT.cs @@ -43,6 +43,7 @@ public class Crc16Ccitt }; static readonly byte[] _expectedRandom = { + // ReSharper disable once UseUtf8StringLiteral 0x36, 0x40 }; static readonly byte[] _expectedRandom15 = diff --git a/Aaru.Tests/Checksums/CRC16IBM.cs b/Aaru.Tests/Checksums/CRC16IBM.cs index 1ffe8432e..3f6102adb 100644 --- a/Aaru.Tests/Checksums/CRC16IBM.cs +++ b/Aaru.Tests/Checksums/CRC16IBM.cs @@ -44,6 +44,7 @@ public class Crc16Ibm }; static readonly byte[] _expectedRandom = { + // ReSharper disable once UseUtf8StringLiteral 0x2d, 0x6d }; static readonly byte[] _expectedRandom15 = diff --git a/Aaru.Tests/Checksums/CRC32.cs b/Aaru.Tests/Checksums/CRC32.cs index 62c7e189b..06dba8b9d 100644 --- a/Aaru.Tests/Checksums/CRC32.cs +++ b/Aaru.Tests/Checksums/CRC32.cs @@ -44,6 +44,7 @@ public class Crc32 }; static readonly byte[] _expectedRandom = { + // ReSharper disable once UseUtf8StringLiteral 0x2b, 0x6e, 0x68, 0x54 }; static readonly byte[] _expectedRandom15 = diff --git a/Aaru.Tests/Devices/MultiMediaCard/CSD.cs b/Aaru.Tests/Devices/MultiMediaCard/CSD.cs index 66bcb745a..49d4c0387 100644 --- a/Aaru.Tests/Devices/MultiMediaCard/CSD.cs +++ b/Aaru.Tests/Devices/MultiMediaCard/CSD.cs @@ -4,6 +4,8 @@ using Aaru.Helpers; using FluentAssertions.Execution; using NUnit.Framework; +// ReSharper disable UseUtf8StringLiteral + namespace Aaru.Tests.Devices.MultiMediaCard; [TestFixture] diff --git a/Aaru.Tests/Devices/SecureDigital/CSD.cs b/Aaru.Tests/Devices/SecureDigital/CSD.cs index b1964e6fc..736c549a6 100644 --- a/Aaru.Tests/Devices/SecureDigital/CSD.cs +++ b/Aaru.Tests/Devices/SecureDigital/CSD.cs @@ -42,6 +42,7 @@ public class CSD readonly byte[] speeds = { + // ReSharper disable once UseUtf8StringLiteral 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50 };