mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Aaru.Filesystems] Reformat and cleanup.
This commit is contained in:
@@ -39,7 +39,7 @@ namespace Aaru.Filesystems;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public sealed partial class exFAT
|
||||
{
|
||||
const string FS_TYPE = "exfat";
|
||||
readonly Guid _oemFlashParameterGuid = new("0A0C7E46-3399-4021-90C8-FA6D389C4BA2");
|
||||
readonly byte[] _signature = "EXFAT "u8.ToArray();
|
||||
const string FS_TYPE = "exfat";
|
||||
}
|
||||
@@ -39,10 +39,16 @@ namespace Aaru.Filesystems;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public sealed partial class exFAT
|
||||
{
|
||||
#region Nested type: VolumeFlags
|
||||
|
||||
[Flags]
|
||||
enum VolumeFlags : ushort
|
||||
{
|
||||
SecondFatActive = 1, VolumeDirty = 2, MediaFailure = 4,
|
||||
SecondFatActive = 1,
|
||||
VolumeDirty = 2,
|
||||
MediaFailure = 4,
|
||||
ClearToZero = 8
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -46,6 +46,8 @@ namespace Aaru.Filesystems;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public sealed partial class exFAT
|
||||
{
|
||||
#region IFilesystem Members
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool Identify(IMediaImage imagePlugin, Partition partition)
|
||||
{
|
||||
@@ -119,7 +121,7 @@ public sealed partial class exFAT
|
||||
AppendLine();
|
||||
|
||||
sb.AppendFormat(Localization.Volume_serial_number_0_X8, vbr.volumeSerial).AppendLine();
|
||||
sb.AppendFormat(Localization.BIOS_drive_is_0, vbr.drive).AppendLine();
|
||||
sb.AppendFormat(Localization.BIOS_drive_is_0, vbr.drive).AppendLine();
|
||||
|
||||
if(vbr.flags.HasFlag(VolumeFlags.SecondFatActive))
|
||||
sb.AppendLine(Localization.Second_FAT_is_in_use);
|
||||
@@ -130,16 +132,16 @@ public sealed partial class exFAT
|
||||
if(vbr.flags.HasFlag(VolumeFlags.MediaFailure))
|
||||
sb.AppendLine(Localization.Underlying_media_presented_errors);
|
||||
|
||||
int count = 1;
|
||||
var count = 1;
|
||||
|
||||
foreach(OemParameter parameter in parametersTable.parameters)
|
||||
{
|
||||
if(parameter.OemParameterType == _oemFlashParameterGuid)
|
||||
{
|
||||
sb.AppendFormat(Localization.OEM_Parameters_0, count).AppendLine();
|
||||
sb.AppendFormat(Localization.OEM_Parameters_0, count).AppendLine();
|
||||
sb.AppendFormat("\t" + Localization._0_bytes_in_erase_block, parameter.eraseBlockSize).AppendLine();
|
||||
sb.AppendFormat("\t" + Localization._0_bytes_per_page, parameter.pageSize).AppendLine();
|
||||
sb.AppendFormat("\t" + Localization._0_spare_blocks, parameter.spareBlocks).AppendLine();
|
||||
sb.AppendFormat("\t" + Localization._0_bytes_per_page, parameter.pageSize).AppendLine();
|
||||
sb.AppendFormat("\t" + Localization._0_spare_blocks, parameter.spareBlocks).AppendLine();
|
||||
|
||||
sb.AppendFormat("\t" + Localization._0_nanoseconds_random_access_time, parameter.randomAccessTime).
|
||||
AppendLine();
|
||||
@@ -168,4 +170,6 @@ public sealed partial class exFAT
|
||||
|
||||
information = sb.ToString();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -40,6 +40,51 @@ namespace Aaru.Filesystems;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public sealed partial class exFAT
|
||||
{
|
||||
#region Nested type: ChecksumSector
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct ChecksumSector
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
|
||||
public readonly uint[] checksum;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Nested type: OemParameter
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct OemParameter
|
||||
{
|
||||
public readonly Guid OemParameterType;
|
||||
public readonly uint eraseBlockSize;
|
||||
public readonly uint pageSize;
|
||||
public readonly uint spareBlocks;
|
||||
public readonly uint randomAccessTime;
|
||||
public readonly uint programTime;
|
||||
public readonly uint readCycleTime;
|
||||
public readonly uint writeCycleTime;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||
public readonly byte[] reserved;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Nested type: OemParameterTable
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct OemParameterTable
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
|
||||
public readonly OemParameter[] parameters;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public readonly byte[] padding;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Nested type: VolumeBootRecord
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct VolumeBootRecord
|
||||
{
|
||||
@@ -71,34 +116,5 @@ public sealed partial class exFAT
|
||||
public readonly ushort bootSignature;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct OemParameter
|
||||
{
|
||||
public readonly Guid OemParameterType;
|
||||
public readonly uint eraseBlockSize;
|
||||
public readonly uint pageSize;
|
||||
public readonly uint spareBlocks;
|
||||
public readonly uint randomAccessTime;
|
||||
public readonly uint programTime;
|
||||
public readonly uint readCycleTime;
|
||||
public readonly uint writeCycleTime;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||
public readonly byte[] reserved;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct OemParameterTable
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
|
||||
public readonly OemParameter[] parameters;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public readonly byte[] padding;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
readonly struct ChecksumSector
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
|
||||
public readonly uint[] checksum;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -40,10 +40,16 @@ namespace Aaru.Filesystems;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public sealed partial class exFAT : IFilesystem
|
||||
{
|
||||
#region IFilesystem Members
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name => Localization.exFAT_Name;
|
||||
|
||||
/// <inheritdoc />
|
||||
public Guid Id => new("8271D088-1533-4CB3-AC28-D802B68BB95C");
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Author => Authors.NataliaPortillo;
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user