mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 11:14:25 +00:00
[Refactor] Replace byte array initializations with string literals for improved readability
This commit is contained in:
@@ -67,19 +67,13 @@ public static class MMC
|
|||||||
const string MODULE_NAME = "Media detection";
|
const string MODULE_NAME = "Media detection";
|
||||||
|
|
||||||
static readonly byte[] _ps3Id =
|
static readonly byte[] _ps3Id =
|
||||||
[
|
"PlayStation3\0\0\0\0"u8.ToArray();
|
||||||
0x50, 0x6C, 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x33, 0x00, 0x00, 0x00, 0x00
|
|
||||||
];
|
|
||||||
|
|
||||||
static readonly byte[] _ps4Id =
|
static readonly byte[] _ps4Id =
|
||||||
[
|
"PlayStation4\0\0\0\0"u8.ToArray();
|
||||||
0x50, 0x6C, 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x34, 0x00, 0x00, 0x00, 0x00
|
|
||||||
];
|
|
||||||
|
|
||||||
static readonly byte[] _ps5Id =
|
static readonly byte[] _ps5Id =
|
||||||
[
|
"PlayStation5\0\0\0\0"u8.ToArray();
|
||||||
0x50, 0x6C, 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x35, 0x00, 0x00, 0x00, 0x00
|
|
||||||
];
|
|
||||||
|
|
||||||
static readonly byte[] _operaId = [0x01, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x01];
|
static readonly byte[] _operaId = [0x01, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x01];
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,6 @@ public sealed partial class HPOFS
|
|||||||
// Do not translate
|
// Do not translate
|
||||||
const string FS_TYPE = "hpofs";
|
const string FS_TYPE = "hpofs";
|
||||||
readonly byte[] _medinfoSignature = "MEDINFO "u8.ToArray();
|
readonly byte[] _medinfoSignature = "MEDINFO "u8.ToArray();
|
||||||
readonly byte[] _type = [0x48, 0x50, 0x4F, 0x46, 0x53, 0x00, 0x00, 0x00];
|
readonly byte[] _type = "HPOFS\0\0\0"u8.ToArray();
|
||||||
readonly byte[] _volinfoSignature = "VOLINFO "u8.ToArray();
|
readonly byte[] _volinfoSignature = "VOLINFO "u8.ToArray();
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,5 @@ public sealed partial class QNX4
|
|||||||
{
|
{
|
||||||
const string FS_TYPE = "qnx4";
|
const string FS_TYPE = "qnx4";
|
||||||
readonly byte[] _rootDirFname =
|
readonly byte[] _rootDirFname =
|
||||||
[
|
"/\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"u8.ToArray();
|
||||||
0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
@@ -35,5 +35,5 @@ public sealed partial class ReFS
|
|||||||
const uint FSRS = 0x53525346;
|
const uint FSRS = 0x53525346;
|
||||||
|
|
||||||
const string FS_TYPE = "refs";
|
const string FS_TYPE = "refs";
|
||||||
readonly byte[] _signature = [0x52, 0x65, 0x46, 0x53, 0x00, 0x00, 0x00, 0x00];
|
readonly byte[] _signature = "ReFS\0\0\0\0"u8.ToArray();
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ public sealed partial class Reiser
|
|||||||
|
|
||||||
const string FS_TYPE = "reiserfs";
|
const string FS_TYPE = "reiserfs";
|
||||||
|
|
||||||
readonly byte[] _magic35 = [0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x46, 0x73, 0x00, 0x00];
|
readonly byte[] _magic35 = "ReIsErFs\0\0"u8.ToArray();
|
||||||
readonly byte[] _magic36 = [0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x32, 0x46, 0x73, 0x00];
|
readonly byte[] _magic36 = "ReIsEr2Fs\0"u8.ToArray();
|
||||||
readonly byte[] _magicJr = [0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x33, 0x46, 0x73, 0x00];
|
readonly byte[] _magicJr = "ReIsEr3Fs\0"u8.ToArray();
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,5 @@ public sealed partial class Reiser4
|
|||||||
const string FS_TYPE = "reiser4";
|
const string FS_TYPE = "reiser4";
|
||||||
|
|
||||||
readonly byte[] _magic =
|
readonly byte[] _magic =
|
||||||
[
|
"ReIsEr4\0\0\0\0\0\0\0\0\0"u8.ToArray();
|
||||||
0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
@@ -38,8 +38,5 @@ public sealed partial class UDF
|
|||||||
{
|
{
|
||||||
const string FS_TYPE = "udf";
|
const string FS_TYPE = "udf";
|
||||||
readonly byte[] _magic =
|
readonly byte[] _magic =
|
||||||
[
|
"*OSTA UDF Compliant\0\0\0\0"u8.ToArray();
|
||||||
0x2A, 0x4F, 0x53, 0x54, 0x41, 0x20, 0x55, 0x44, 0x46, 0x20, 0x43, 0x6F, 0x6D, 0x70, 0x6C, 0x69, 0x61, 0x6E,
|
|
||||||
0x74, 0x00, 0x00, 0x00, 0x00
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
@@ -39,5 +39,5 @@ public sealed partial class DiskDupe
|
|||||||
const uint TRACKMAP_OFFSET = 100;
|
const uint TRACKMAP_OFFSET = 100;
|
||||||
|
|
||||||
/// <summary>The header identification string</summary>
|
/// <summary>The header identification string</summary>
|
||||||
readonly byte[] _headerMagic = [0x49, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00];
|
readonly byte[] _headerMagic = "IM\0\0\0\0\0\0\0\0"u8.ToArray();
|
||||||
}
|
}
|
||||||
@@ -35,7 +35,5 @@ namespace Aaru.Images;
|
|||||||
public sealed partial class Nhdr0
|
public sealed partial class Nhdr0
|
||||||
{
|
{
|
||||||
readonly byte[] _signature =
|
readonly byte[] _signature =
|
||||||
[
|
"T98HDDIMAGE.R0\0"u8.ToArray();
|
||||||
0x54, 0x39, 0x38, 0x48, 0x44, 0x44, 0x49, 0x4D, 0x41, 0x47, 0x45, 0x2E, 0x52, 0x30, 0x00
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
@@ -67,8 +67,5 @@ public sealed partial class Partimage
|
|||||||
const uint MAX_CACHE_SIZE = 16777216;
|
const uint MAX_CACHE_SIZE = 16777216;
|
||||||
const uint MAX_CACHED_SECTORS = MAX_CACHE_SIZE / 512;
|
const uint MAX_CACHED_SECTORS = MAX_CACHE_SIZE / 512;
|
||||||
readonly byte[] _partimageMagic =
|
readonly byte[] _partimageMagic =
|
||||||
[
|
"PaRtImAgE-VoLuMe\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"u8.ToArray();
|
||||||
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
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
@@ -34,5 +34,5 @@ namespace Aaru.Images;
|
|||||||
|
|
||||||
public sealed partial class Virtual98
|
public sealed partial class Virtual98
|
||||||
{
|
{
|
||||||
readonly byte[] _signature = [0x56, 0x48, 0x44, 0x31, 0x2E, 0x30, 0x30, 0x00];
|
readonly byte[] _signature = "VHD1.00\0"u8.ToArray();
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user