Move all localizable strings from Aaru.Filesystems project to resources.

This commit is contained in:
2022-11-28 02:59:53 +00:00
parent 119ceea01d
commit c67c6dcc8f
108 changed files with 13507 additions and 2025 deletions

View File

@@ -49,6 +49,7 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of the AO-DOS filesystem</summary>
public sealed class AODOS : IFilesystem
{
const string FS_TYPE = "aodos";
readonly byte[] _identifier =
{
0x20, 0x41, 0x4F, 0x2D, 0x44, 0x4F, 0x53, 0x20
@@ -56,13 +57,13 @@ public sealed class AODOS : IFilesystem
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public string Name => "Alexander Osipov DOS file system";
public string Name => Localization.AODOS_Name;
/// <inheritdoc />
public Guid Id => new("668E5039-9DDD-442A-BE1B-A315D6E38E26");
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -104,11 +105,11 @@ public sealed class AODOS : IFilesystem
var sbInformation = new StringBuilder();
sbInformation.AppendLine("Alexander Osipov DOS file system");
sbInformation.AppendLine(Localization.Alexander_Osipov_DOS_file_system);
XmlFsType = new FileSystemType
{
Type = "Alexander Osipov DOS file system",
Type = FS_TYPE,
Clusters = imagePlugin.Info.Sectors,
ClusterSize = imagePlugin.Info.SectorSize,
Files = bb.files,
@@ -119,10 +120,11 @@ public sealed class AODOS : IFilesystem
Bootable = true
};
sbInformation.AppendFormat("{0} files on volume", bb.files).AppendLine();
sbInformation.AppendFormat("{0} used sectors on volume", bb.usedSectors).AppendLine();
sbInformation.AppendFormat(Localization._0_files_on_volume, bb.files).AppendLine();
sbInformation.AppendFormat(Localization._0_used_sectors_on_volume, bb.usedSectors).AppendLine();
sbInformation.AppendFormat("Disk name: {0}", StringHandlers.CToString(bb.volumeLabel, Encoding)).AppendLine();
sbInformation.AppendFormat(Localization.Disk_name_0, StringHandlers.CToString(bb.volumeLabel, Encoding)).
AppendLine();
information = sbInformation.ToString();
}

View File

@@ -55,11 +55,11 @@ public sealed class APFS : IFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Apple File System";
public string Name => Localization.APFS_Name;
/// <inheritdoc />
public Guid Id => new("A4060F9D-2909-42E2-9D95-DB31FA7EA797");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -116,12 +116,12 @@ public sealed class APFS : IFilesystem
if(nxSb.magic != APFS_CONTAINER_MAGIC)
return;
sbInformation.AppendLine("Apple File System");
sbInformation.AppendLine(Localization.Apple_File_System);
sbInformation.AppendLine();
sbInformation.AppendFormat("{0} bytes per block", nxSb.blockSize).AppendLine();
sbInformation.AppendFormat(Localization._0_bytes_per_block, nxSb.blockSize).AppendLine();
sbInformation.AppendFormat("Container has {0} bytes in {1} blocks", nxSb.containerBlocks * nxSb.blockSize,
nxSb.containerBlocks).AppendLine();
sbInformation.AppendFormat(Localization.Container_has_0_bytes_in_1_blocks,
nxSb.containerBlocks * nxSb.blockSize, nxSb.containerBlocks).AppendLine();
information = sbInformation.ToString();
@@ -130,10 +130,12 @@ public sealed class APFS : IFilesystem
Bootable = false,
Clusters = nxSb.containerBlocks,
ClusterSize = nxSb.blockSize,
Type = "Apple File System"
Type = FS_TYPE
};
}
const string FS_TYPE = "apfs";
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ContainerSuperBlock
{

View File

@@ -58,6 +58,7 @@
<Compile Include="AppleHFS\Enums.cs"/>
<Compile Include="AppleHFS\Info.cs"/>
<Compile Include="AppleHFS\Structs.cs"/>
<Compile Include="Authors.cs"/>
<Compile Include="FATX\Consts.cs"/>
<Compile Include="FATX\Dir.cs"/>
<Compile Include="FATX\FATX.cs"/>
@@ -86,6 +87,11 @@
<Compile Include="ISO9660\PathTable.cs"/>
<Compile Include="ISO9660\Super.cs"/>
<Compile Include="ISO9660\Xattr.cs"/>
<Compile Include="Localization\Localization.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Localization.resx</DependentUpon>
</Compile>
<Compile Include="Opera\Consts.cs"/>
<Compile Include="Opera\Dir.cs"/>
<Compile Include="Opera\File.cs"/>
@@ -238,5 +244,9 @@
<Link>LICENSE.LGPL</Link>
</EmbeddedResource>
<EmbeddedResource Include="CPM\cpmdefs.xml"/>
<EmbeddedResource Update="Localization\Localization.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Localization.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>

View File

@@ -1,6 +1,6 @@
<wpf:ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xml:space="preserve">
<wpf:ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xml:space="preserve">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=applecommon/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=appledos/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=applehfs/@EntryIndexedValue">True</s:Boolean>
@@ -19,5 +19,7 @@
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=iso9660_005Cconsts/@EntryIndexedValue">True</s:Boolean>
<s:Boolean
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=iso9660_005Cstructs/@EntryIndexedValue">True</s:Boolean>
<s:Boolean
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=localization/@EntryIndexedValue">True</s:Boolean>
<s:Boolean
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=opera/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@@ -66,16 +66,18 @@ public sealed class AcornADFS : IFilesystem
/// <summary>Old directory format magic number, "Hugo"</summary>
const uint OLD_DIR_MAGIC = 0x6F677548;
const string FS_TYPE = "adfs";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public string Name => "Acorn Advanced Disc Filing System";
public string Name => Localization.AcornADFS_Name;
/// <inheritdoc />
public Guid Id => new("BAFC1E50-9C64-4CD3-8400-80628CC27AFA");
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
// TODO: BBC Master hard disks are untested...
/// <inheritdoc />
@@ -362,7 +364,7 @@ public sealed class AcornADFS : IFilesystem
Bootable = oldMap1.boot != 0, // Or not?
Clusters = bytes / imagePlugin.Info.SectorSize,
ClusterSize = imagePlugin.Info.SectorSize,
Type = "Acorn Advanced Disc Filing System"
Type = FS_TYPE
};
if(ArrayHelpers.ArrayIsNullOrEmpty(namebytes))
@@ -446,18 +448,18 @@ public sealed class AcornADFS : IFilesystem
}
}
sbInformation.AppendLine("Acorn Advanced Disc Filing System");
sbInformation.AppendLine(Localization.Acorn_Advanced_Disc_Filing_System);
sbInformation.AppendLine();
sbInformation.AppendFormat("{0} bytes per sector", imagePlugin.Info.SectorSize).AppendLine();
sbInformation.AppendFormat("Volume has {0} bytes", bytes).AppendLine();
sbInformation.AppendFormat(Localization._0_bytes_per_sector, imagePlugin.Info.SectorSize).AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_bytes, bytes).AppendLine();
sbInformation.AppendFormat("Volume name: {0}", StringHandlers.CToString(namebytes, Encoding)).
sbInformation.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(namebytes, Encoding)).
AppendLine();
if(oldMap1.discId > 0)
{
XmlFsType.VolumeSerial = $"{oldMap1.discId:X4}";
sbInformation.AppendFormat("Volume ID: {0:X4}", oldMap1.discId).AppendLine();
sbInformation.AppendFormat(Localization.Volume_ID_0_X4, oldMap1.discId).AppendLine();
}
if(!ArrayHelpers.ArrayIsNullOrEmpty(namebytes))
@@ -565,34 +567,34 @@ public sealed class AcornADFS : IFilesystem
XmlFsType = new FileSystemType();
sbInformation.AppendLine("Acorn Advanced Disc Filing System");
sbInformation.AppendLine(Localization.Acorn_Advanced_Disc_Filing_System);
sbInformation.AppendLine();
sbInformation.AppendFormat("Version {0}", drSb.format_version).AppendLine();
sbInformation.AppendFormat("{0} bytes per sector", 1 << drSb.log2secsize).AppendLine();
sbInformation.AppendFormat("{0} sectors per track", drSb.spt).AppendLine();
sbInformation.AppendFormat("{0} heads", drSb.heads).AppendLine();
sbInformation.AppendFormat("Density code: {0}", drSb.density).AppendLine();
sbInformation.AppendFormat("Skew: {0}", drSb.skew).AppendLine();
sbInformation.AppendFormat("Boot option: {0}", drSb.bootoption).AppendLine();
sbInformation.AppendFormat(Localization.Version_0, drSb.format_version).AppendLine();
sbInformation.AppendFormat(Localization._0_bytes_per_sector, 1 << drSb.log2secsize).AppendLine();
sbInformation.AppendFormat(Localization._0_sectors_per_track, drSb.spt).AppendLine();
sbInformation.AppendFormat(Localization._0_heads, drSb.heads).AppendLine();
sbInformation.AppendFormat(Localization.Density_code_0, drSb.density).AppendLine();
sbInformation.AppendFormat(Localization.Skew_0, drSb.skew).AppendLine();
sbInformation.AppendFormat(Localization.Boot_option_0, drSb.bootoption).AppendLine();
// TODO: What the hell is this field refering to?
sbInformation.AppendFormat("Root starts at frag {0}", drSb.root).AppendLine();
sbInformation.AppendFormat(Localization.Root_starts_at_frag_0, drSb.root).AppendLine();
//sbInformation.AppendFormat("Root is {0} bytes long", drSb.root_size).AppendLine();
sbInformation.AppendFormat("Volume has {0} bytes in {1} zones", bytes, zones).AppendLine();
sbInformation.AppendFormat("Volume flags: 0x{0:X4}", drSb.flags).AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_bytes_in_1_zones, bytes, zones).AppendLine();
sbInformation.AppendFormat(Localization.Volume_flags_0_X4, drSb.flags).AppendLine();
if(drSb.disc_id > 0)
{
XmlFsType.VolumeSerial = $"{drSb.disc_id:X4}";
sbInformation.AppendFormat("Volume ID: {0:X4}", drSb.disc_id).AppendLine();
sbInformation.AppendFormat(Localization.Volume_ID_0_X4, drSb.disc_id).AppendLine();
}
if(!ArrayHelpers.ArrayIsNullOrEmpty(drSb.disc_name))
{
string discname = StringHandlers.CToString(drSb.disc_name, Encoding);
XmlFsType.VolumeName = discname;
sbInformation.AppendFormat("Volume name: {0}", discname).AppendLine();
sbInformation.AppendFormat(Localization.Volume_name_0, discname).AppendLine();
}
information = sbInformation.ToString();
@@ -600,7 +602,7 @@ public sealed class AcornADFS : IFilesystem
XmlFsType.Bootable |= drSb.bootoption != 0; // Or not?
XmlFsType.Clusters = bytes / (ulong)(1 << drSb.log2secsize);
XmlFsType.ClusterSize = (uint)(1 << drSb.log2secsize);
XmlFsType.Type = "Acorn Advanced Disc Filing System";
XmlFsType.Type = FS_TYPE;
}
static byte AcornMapChecksum(byte[] data, int length)

View File

@@ -55,16 +55,21 @@ public sealed class AmigaDOSPlugin : IFilesystem
const uint TYPE_HEADER = 2;
const uint SUBTYPE_ROOT = 1;
const string FS_TYPE_OFS = "aofs";
const string FS_TYPE_FFS = "affs";
const string FS_TYPE_OFS2 = "aofs2";
const string FS_TYPE_FFS2 = "affs2";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public string Name => "Amiga DOS filesystem";
public string Name => Localization.AmigaDOSPlugin_Name;
/// <inheritdoc />
public Guid Id => new("3c882400-208c-427d-a086-9119852a1bc7");
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -118,7 +123,7 @@ public sealed class AmigaDOSPlugin : IFilesystem
if(bsum == bblk.checksum)
{
bRootPtr = bblk.root_ptr + partition.Start;
AaruConsole.DebugWriteLine("AmigaDOS plugin", "Bootblock points to {0} as Rootblock", bRootPtr);
AaruConsole.DebugWriteLine("AmigaDOS plugin", Localization.Bootblock_points_to_0_as_Rootblock, bRootPtr);
}
ulong[] rootPtrs =
@@ -134,7 +139,7 @@ public sealed class AmigaDOSPlugin : IFilesystem
// So to handle even number of sectors
foreach(ulong rootPtr in rootPtrs.Where(rootPtr => rootPtr < partition.End && rootPtr >= partition.Start))
{
AaruConsole.DebugWriteLine("AmigaDOS plugin", "Searching for Rootblock in sector {0}", rootPtr);
AaruConsole.DebugWriteLine("AmigaDOS plugin", Localization.Searching_for_Rootblock_in_sector_0, rootPtr);
errno = imagePlugin.ReadSector(rootPtr, out sector);
@@ -211,7 +216,7 @@ public sealed class AmigaDOSPlugin : IFilesystem
if(bsum == bootBlk.checksum)
{
bRootPtr = bootBlk.root_ptr + partition.Start;
AaruConsole.DebugWriteLine("AmigaDOS plugin", "Bootblock points to {0} as Rootblock", bRootPtr);
AaruConsole.DebugWriteLine("AmigaDOS plugin", Localization.Bootblock_points_to_0_as_Rootblock, bRootPtr);
}
ulong[] rootPtrs =
@@ -231,7 +236,7 @@ public sealed class AmigaDOSPlugin : IFilesystem
// So to handle even number of sectors
foreach(ulong rootPtr in rootPtrs.Where(rootPtr => rootPtr < partition.End && rootPtr >= partition.Start))
{
AaruConsole.DebugWriteLine("AmigaDOS plugin", "Searching for Rootblock in sector {0}", rootPtr);
AaruConsole.DebugWriteLine("AmigaDOS plugin", Localization.Searching_for_Rootblock_in_sector_0, rootPtr);
errno = imagePlugin.ReadSector(rootPtr, out rootBlockSector);
@@ -300,91 +305,92 @@ public sealed class AmigaDOSPlugin : IFilesystem
switch(bootBlk.diskType & 0xFF)
{
case 0:
sbInformation.Append("Amiga Original File System");
XmlFsType.Type = "Amiga OFS";
sbInformation.Append(Localization.Amiga_Original_File_System);
XmlFsType.Type = FS_TYPE_OFS;
break;
case 1:
sbInformation.Append("Amiga Fast File System");
XmlFsType.Type = "Amiga FFS";
sbInformation.Append(Localization.Amiga_Fast_File_System);
XmlFsType.Type = FS_TYPE_FFS;
break;
case 2:
sbInformation.Append("Amiga Original File System with international characters");
XmlFsType.Type = "Amiga OFS";
sbInformation.Append(Localization.Amiga_Original_File_System_with_international_characters);
XmlFsType.Type = FS_TYPE_OFS;
break;
case 3:
sbInformation.Append("Amiga Fast File System with international characters");
XmlFsType.Type = "Amiga FFS";
sbInformation.Append(Localization.Amiga_Fast_File_System_with_international_characters);
XmlFsType.Type = FS_TYPE_FFS;
break;
case 4:
sbInformation.Append("Amiga Original File System with directory cache");
XmlFsType.Type = "Amiga OFS";
sbInformation.Append(Localization.Amiga_Original_File_System_with_directory_cache);
XmlFsType.Type = FS_TYPE_OFS;
break;
case 5:
sbInformation.Append("Amiga Fast File System with directory cache");
XmlFsType.Type = "Amiga FFS";
sbInformation.Append(Localization.Amiga_Fast_File_System_with_directory_cache);
XmlFsType.Type = FS_TYPE_FFS;
break;
case 6:
sbInformation.Append("Amiga Original File System with long filenames");
XmlFsType.Type = "Amiga OFS2";
sbInformation.Append(Localization.Amiga_Original_File_System_with_long_filenames);
XmlFsType.Type = FS_TYPE_OFS2;
break;
case 7:
sbInformation.Append("Amiga Fast File System with long filenames");
XmlFsType.Type = "Amiga FFS2";
sbInformation.Append(Localization.Amiga_Fast_File_System_with_long_filenames);
XmlFsType.Type = FS_TYPE_FFS2;
break;
}
if((bootBlk.diskType & 0x6D754600) == 0x6D754600)
sbInformation.Append(", with multi-user patches");
sbInformation.Append(Localization.with_multi_user_patches);
sbInformation.AppendLine();
sbInformation.AppendFormat("Volume name: {0}", diskName).AppendLine();
sbInformation.AppendFormat(Localization.Volume_name_0, diskName).AppendLine();
if(bootBlk.checksum == bsum)
{
var sha1Ctx = new Sha1Context();
sha1Ctx.Update(bootBlk.bootCode);
sbInformation.AppendLine("Volume is bootable");
sbInformation.AppendFormat("Boot code SHA1 is {0}", sha1Ctx.End()).AppendLine();
sbInformation.AppendLine(Localization.Volume_is_bootable);
sbInformation.AppendFormat(Localization.Boot_code_SHA1_0, sha1Ctx.End()).AppendLine();
}
if(rootBlk.bitmapFlag == 0xFFFFFFFF)
sbInformation.AppendLine("Volume bitmap is valid");
sbInformation.AppendLine(Localization.Volume_bitmap_is_valid);
if(rootBlk.bitmapExtensionBlock != 0x00000000 &&
rootBlk.bitmapExtensionBlock != 0xFFFFFFFF)
sbInformation.AppendFormat("Bitmap extension at block {0}", rootBlk.bitmapExtensionBlock).AppendLine();
sbInformation.AppendFormat(Localization.Bitmap_extension_at_block_0, rootBlk.bitmapExtensionBlock).
AppendLine();
if((bootBlk.diskType & 0xFF) == 4 ||
(bootBlk.diskType & 0xFF) == 5)
sbInformation.AppendFormat("Directory cache starts at block {0}", rootBlk.extension).AppendLine();
sbInformation.AppendFormat(Localization.Directory_cache_starts_at_block_0, rootBlk.extension).AppendLine();
ulong blocks = (partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize / blockSize;
sbInformation.AppendFormat("Volume block size is {0} bytes", blockSize).AppendLine();
sbInformation.AppendFormat("Volume has {0} blocks", blocks).AppendLine();
sbInformation.AppendFormat(Localization.Volume_block_size_is_0_bytes, blockSize).AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_blocks, blocks).AppendLine();
sbInformation.AppendFormat("Volume created on {0}",
sbInformation.AppendFormat(Localization.Volume_created_on_0,
DateHandlers.AmigaToDateTime(rootBlk.cDays, rootBlk.cMins, rootBlk.cTicks)).
AppendLine();
sbInformation.AppendFormat("Volume last modified on {0}",
sbInformation.AppendFormat(Localization.Volume_last_modified_on_0,
DateHandlers.AmigaToDateTime(rootBlk.vDays, rootBlk.vMins, rootBlk.vTicks)).
AppendLine();
sbInformation.AppendFormat("Volume root directory last modified on on {0}",
sbInformation.AppendFormat(Localization.Volume_root_directory_last_modified_on_0,
DateHandlers.AmigaToDateTime(rootBlk.rDays, rootBlk.rMins, rootBlk.rTicks)).
AppendLine();
sbInformation.AppendFormat("Root block checksum is 0x{0:X8}", rootBlk.checksum).AppendLine();
sbInformation.AppendFormat(Localization.Root_block_checksum_is_0, rootBlk.checksum).AppendLine();
information = sbInformation.ToString();
XmlFsType.CreationDate = DateHandlers.AmigaToDateTime(rootBlk.cDays, rootBlk.cMins, rootBlk.cTicks);

View File

@@ -51,59 +51,63 @@ static partial class AppleCommon
return null;
var sb = new StringBuilder();
sb.AppendLine("Boot Block:");
sb.AppendLine(Localization.Boot_Block);
if((bb.bbVersion & 0x8000) > 0)
{
sb.AppendLine("Boot block is in new format.");
sb.AppendLine(Localization.Boot_block_is_in_new_format);
if((bb.bbVersion & 0x4000) > 0)
{
sb.AppendLine("Boot block should be executed.");
sb.AppendLine(Localization.Boot_block_should_be_executed);
if((bb.bbVersion & 0x2000) > 0)
sb.AppendFormat("System heap will be extended by {0} bytes and a {1} fraction of the available RAM",
bb.bbSysHeapExtra, bb.bbSysHeapFract).AppendLine();
sb.
AppendFormat(Localization.System_heap_will_be_extended_by_0_bytes_and_a_1_fraction_of_the_available_RAM,
bb.bbSysHeapExtra, bb.bbSysHeapFract).AppendLine();
}
}
else if((bb.bbVersion & 0xFF) == 0x0D)
sb.AppendLine("Boot block should be executed.");
sb.AppendLine(Localization.Boot_block_should_be_executed);
switch(bb.bbPageFlags)
{
case > 0:
sb.AppendLine("Allocate secondary sound buffer at boot.");
sb.AppendLine(Localization.Allocate_secondary_sound_buffer_at_boot);
break;
case < 0:
sb.AppendLine("Allocate secondary sound and video buffers at boot.");
sb.AppendLine(Localization.Allocate_secondary_sound_and_video_buffers_at_boot);
break;
}
sb.AppendFormat("System filename: {0}", StringHandlers.PascalToString(bb.bbSysName, encoding)).AppendLine();
sb.AppendFormat("Finder filename: {0}", StringHandlers.PascalToString(bb.bbShellName, encoding)).AppendLine();
sb.AppendFormat("Debugger filename: {0}", StringHandlers.PascalToString(bb.bbDbg1Name, encoding)).AppendLine();
sb.AppendFormat("Disassembler filename: {0}", StringHandlers.PascalToString(bb.bbDbg2Name, encoding)).
sb.AppendFormat(Localization.System_filename_0, StringHandlers.PascalToString(bb.bbSysName, encoding)).
AppendLine();
sb.AppendFormat("Startup screen filename: {0}", StringHandlers.PascalToString(bb.bbScreenName, encoding)).
sb.AppendFormat(Localization.Finder_filename_0, StringHandlers.PascalToString(bb.bbShellName, encoding)).
AppendLine();
sb.AppendFormat("First program to execute at boot: {0}",
sb.AppendFormat(Localization.Debugger_filename_0, StringHandlers.PascalToString(bb.bbDbg1Name, encoding)).
AppendLine();
sb.AppendFormat(Localization.Disassembler_filename_0, StringHandlers.PascalToString(bb.bbDbg2Name, encoding)).
AppendLine();
sb.AppendFormat(Localization.Startup_screen_filename_0,
StringHandlers.PascalToString(bb.bbScreenName, encoding)).AppendLine();
sb.AppendFormat(Localization.First_program_to_execute_at_boot_0,
StringHandlers.PascalToString(bb.bbHelloName, encoding)).AppendLine();
sb.AppendFormat("Clipboard filename: {0}", StringHandlers.PascalToString(bb.bbScrapName, encoding)).
sb.AppendFormat(Localization.Clipboard_filename_0, StringHandlers.PascalToString(bb.bbScrapName, encoding)).
AppendLine();
sb.AppendFormat("Maximum opened files: {0}", bb.bbCntFCBs * 4).AppendLine();
sb.AppendFormat("Event queue size: {0}", bb.bbCntEvts).AppendLine();
sb.AppendFormat("Heap size with 128KiB of RAM: {0} bytes", bb.bb128KSHeap).AppendLine();
sb.AppendFormat("Heap size with 256KiB of RAM: {0} bytes", bb.bb256KSHeap).AppendLine();
sb.AppendFormat("Heap size with 512KiB of RAM or more: {0} bytes", bb.bbSysHeapSize).AppendLine();
sb.AppendFormat(Localization.Maximum_opened_files_0, bb.bbCntFCBs * 4).AppendLine();
sb.AppendFormat(Localization.Event_queue_size_0, bb.bbCntEvts).AppendLine();
sb.AppendFormat(Localization.Heap_size_with_128KiB_of_RAM_0_bytes, bb.bb128KSHeap).AppendLine();
sb.AppendFormat(Localization.Heap_size_with_256KiB_of_RAM_0_bytes, bb.bb256KSHeap).AppendLine();
sb.AppendFormat(Localization.Heap_size_with_512KiB_of_RAM_or_more_0_bytes, bb.bbSysHeapSize).AppendLine();
return sb.ToString();
}

View File

@@ -42,27 +42,29 @@ namespace Aaru.Filesystems;
/// <summary>Implements the Apple DOS 3 filesystem</summary>
public sealed partial class AppleDOS : IReadOnlyFilesystem
{
bool _debug;
IMediaImage _device;
bool _mounted;
int _sectorsPerTrack;
ulong _start;
ulong _totalFileEntries;
bool _track1UsedByFiles;
bool _track2UsedByFiles;
uint _usedSectors;
Vtoc _vtoc;
// Do not translate
const string FS_TYPE = "appledos";
bool _debug;
IMediaImage _device;
bool _mounted;
int _sectorsPerTrack;
ulong _start;
ulong _totalFileEntries;
bool _track1UsedByFiles;
bool _track2UsedByFiles;
uint _usedSectors;
Vtoc _vtoc;
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Apple DOS File System";
public string Name => Localization.AppleDOS_Name;
/// <inheritdoc />
public Guid Id => new("8658A1E9-B2E7-4BCC-9638-157A31B0A700\n");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public IEnumerable<(string name, Type type, string description)> SupportedOptions =>

View File

@@ -83,20 +83,21 @@ public sealed partial class AppleDOS
_vtoc = Marshal.ByteArrayToStructureLittleEndian<Vtoc>(vtocB);
sb.AppendLine("Apple DOS File System");
sb.AppendLine(Localization.AppleDOS_Name);
sb.AppendLine();
sb.AppendFormat("Catalog starts at sector {0} of track {1}", _vtoc.catalogSector, _vtoc.catalogTrack).
sb.AppendFormat(Localization.Catalog_starts_at_sector_0_of_track_1, _vtoc.catalogSector, _vtoc.catalogTrack).
AppendLine();
sb.AppendFormat("File system initialized by DOS release {0}", _vtoc.dosRelease).AppendLine();
sb.AppendFormat("Disk volume number {0}", _vtoc.volumeNumber).AppendLine();
sb.AppendFormat("Sectors allocated at most in track {0}", _vtoc.lastAllocatedSector).AppendLine();
sb.AppendFormat("{0} tracks in volume", _vtoc.tracks).AppendLine();
sb.AppendFormat("{0} sectors per track", _vtoc.sectorsPerTrack).AppendLine();
sb.AppendFormat("{0} bytes per sector", _vtoc.bytesPerSector).AppendLine();
sb.AppendFormat(Localization.File_system_initialized_by_DOS_release_0, _vtoc.dosRelease).AppendLine();
sb.AppendFormat(Localization.Disk_volume_number_0, _vtoc.volumeNumber).AppendLine();
sb.AppendFormat(Localization.Sectors_allocated_at_most_in_track_0, _vtoc.lastAllocatedSector).AppendLine();
sb.AppendFormat(Localization._0_tracks_in_volume, _vtoc.tracks).AppendLine();
sb.AppendFormat(Localization._0_sectors_per_track, _vtoc.sectorsPerTrack).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_sector, _vtoc.bytesPerSector).AppendLine();
sb.AppendFormat("Track allocation is {0}", _vtoc.allocationDirection > 0 ? "forward" : "reverse").AppendLine();
sb.AppendLine(_vtoc.allocationDirection > 0 ? Localization.Track_allocation_is_forward
: Localization.Track_allocation_is_reverse);
information = sb.ToString();
@@ -105,7 +106,7 @@ public sealed partial class AppleDOS
Bootable = true,
Clusters = imagePlugin.Info.Sectors,
ClusterSize = imagePlugin.Info.SectorSize,
Type = "Apple DOS"
Type = FS_TYPE
};
}
}

View File

@@ -56,21 +56,21 @@ public sealed partial class AppleDOS
if(_device.Info.Sectors != 455 &&
_device.Info.Sectors != 560)
{
AaruConsole.DebugWriteLine("Apple DOS plugin", "Incorrect device size.");
AaruConsole.DebugWriteLine("Apple DOS plugin", Localization.Incorrect_device_size);
return ErrorNumber.InOutError;
}
if(_start > 0)
{
AaruConsole.DebugWriteLine("Apple DOS plugin", "Partitions are not supported.");
AaruConsole.DebugWriteLine("Apple DOS plugin", Localization.Partitions_are_not_supported);
return ErrorNumber.InOutError;
}
if(_device.Info.SectorSize != 256)
{
AaruConsole.DebugWriteLine("Apple DOS plugin", "Incorrect sector size.");
AaruConsole.DebugWriteLine("Apple DOS plugin", Localization.Incorrect_sector_size);
return ErrorNumber.InOutError;
}
@@ -93,7 +93,7 @@ public sealed partial class AppleDOS
if(error != ErrorNumber.NoError)
{
AaruConsole.DebugWriteLine("Apple DOS plugin", "Unable to read catalog.");
AaruConsole.DebugWriteLine("Apple DOS plugin", Localization.Unable_to_read_catalog);
return error;
}
@@ -102,7 +102,7 @@ public sealed partial class AppleDOS
if(error != ErrorNumber.NoError)
{
AaruConsole.DebugWriteLine("Apple DOS plugin", "Unable cache all files.");
AaruConsole.DebugWriteLine("Apple DOS plugin", Localization.Unable_cache_all_files);
return error;
}
@@ -116,7 +116,7 @@ public sealed partial class AppleDOS
Files = (ulong)_catalogCache.Count,
FilesSpecified = true,
FreeClustersSpecified = true,
Type = "Apple DOS"
Type = FS_TYPE
};
XmlFsType.FreeClusters = XmlFsType.Clusters - _usedSectors;
@@ -152,7 +152,7 @@ public sealed partial class AppleDOS
FilenameLength = 30,
Files = (ulong)_catalogCache.Count,
PluginId = Id,
Type = "Apple DOS"
Type = FS_TYPE
};
stat.FreeFiles = _totalFileEntries - stat.Files;

View File

@@ -49,9 +49,9 @@ public sealed partial class AppleHFS : IFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Apple Hierarchical File System";
public string Name => Localization.Name_Apple_Hierarchical_File_System;
/// <inheritdoc />
public Guid Id => new("36405F8D-0D26-6ECC-0BBB-1D5225FF404F");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
}

View File

@@ -51,4 +51,7 @@ public sealed partial class AppleHFS
const uint kCatalogFileCnid = 4;
/// <summary>File number of the bad allocation block file.</summary>
const uint kBadBlocksFileCnid = 5;
// Do not translate
const string FS_TYPE = "hfs";
}

View File

@@ -169,111 +169,111 @@ public sealed partial class AppleHFS
MasterDirectoryBlock mdb = Marshal.ByteArrayToStructureBigEndian<MasterDirectoryBlock>(mdbSector);
sb.AppendLine("Apple Hierarchical File System");
sb.AppendLine(Localization.Name_Apple_Hierarchical_File_System);
sb.AppendLine();
if(apmFromHddOnCd)
sb.AppendLine("HFS uses 512 bytes/sector while device uses 2048 bytes/sector.").AppendLine();
sb.AppendLine(Localization.HFS_uses_512_bytes_sector_while_device_uses_2048_bytes_sector).AppendLine();
sb.AppendLine("Master Directory Block:");
sb.AppendFormat("Creation date: {0}", DateHandlers.MacToDateTime(mdb.drCrDate)).AppendLine();
sb.AppendFormat("Last modification date: {0}", DateHandlers.MacToDateTime(mdb.drLsMod)).AppendLine();
sb.AppendLine(Localization.Master_Directory_Block);
sb.AppendFormat(Localization.Creation_date_0, DateHandlers.MacToDateTime(mdb.drCrDate)).AppendLine();
sb.AppendFormat(Localization.Last_modification_date_0, DateHandlers.MacToDateTime(mdb.drLsMod)).AppendLine();
if(mdb.drVolBkUp > 0)
{
sb.AppendFormat("Last backup date: {0}", DateHandlers.MacToDateTime(mdb.drVolBkUp)).AppendLine();
sb.AppendFormat("Backup sequence number: {0}", mdb.drVSeqNum).AppendLine();
sb.AppendFormat(Localization.Last_backup_date_0, DateHandlers.MacToDateTime(mdb.drVolBkUp)).AppendLine();
sb.AppendFormat(Localization.Backup_sequence_number_0, mdb.drVSeqNum).AppendLine();
}
else
sb.AppendLine("Volume has never been backed up");
sb.AppendLine(Localization.Volume_has_never_been_backed_up);
if(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.HardwareLock))
sb.AppendLine("Volume is locked by hardware.");
sb.AppendLine(Localization.Volume_is_locked_by_hardware);
sb.AppendLine(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.Unmounted) ? "Volume was unmonted."
: "Volume is mounted.");
sb.AppendLine(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.Unmounted) ? Localization.Volume_was_unmonted
: Localization.Volume_is_mounted);
if(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.SparedBadBlocks))
sb.AppendLine("Volume has spared bad blocks.");
sb.AppendLine(Localization.Volume_has_spared_bad_blocks);
if(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.DoesNotNeedCache))
sb.AppendLine("Volume does not need cache.");
sb.AppendLine(Localization.Volume_does_not_need_cache);
if(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.BootInconsistent))
sb.AppendLine("Boot volume is inconsistent.");
sb.AppendLine(Localization.Boot_volume_is_inconsistent);
if(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.ReusedIds))
sb.AppendLine("There are reused CNIDs.");
sb.AppendLine(Localization.There_are_reused_CNIDs);
if(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.Journaled))
sb.AppendLine("Volume is journaled.");
sb.AppendLine(Localization.Volume_is_journaled);
if(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.Inconsistent))
sb.AppendLine("Volume is seriously inconsistent.");
sb.AppendLine(Localization.Volume_is_seriously_inconsistent);
if(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.SoftwareLock))
sb.AppendLine("Volume is locked by software.");
sb.AppendLine(Localization.Volume_is_locked_by_software);
sb.AppendFormat("{0} files on root directory", mdb.drNmFls).AppendLine();
sb.AppendFormat("{0} directories on root directory", mdb.drNmRtDirs).AppendLine();
sb.AppendFormat("{0} files on volume", mdb.drFilCnt).AppendLine();
sb.AppendFormat("{0} directories on volume", mdb.drDirCnt).AppendLine();
sb.AppendFormat("Volume write count: {0}", mdb.drWrCnt).AppendLine();
sb.AppendFormat(Localization._0_files_on_root_directory, mdb.drNmFls).AppendLine();
sb.AppendFormat(Localization._0_directories_on_root_directory, mdb.drNmRtDirs).AppendLine();
sb.AppendFormat(Localization._0_files_on_volume, mdb.drFilCnt).AppendLine();
sb.AppendFormat(Localization._0_directories_on_volume, mdb.drDirCnt).AppendLine();
sb.AppendFormat(Localization.Volume_write_count_0, mdb.drWrCnt).AppendLine();
sb.AppendFormat("Volume bitmap starting sector (in 512-bytes): {0}", mdb.drVBMSt).AppendLine();
sb.AppendFormat("Next allocation block: {0}.", mdb.drAllocPtr).AppendLine();
sb.AppendFormat("{0} volume allocation blocks.", mdb.drNmAlBlks).AppendLine();
sb.AppendFormat("{0} bytes per allocation block.", mdb.drAlBlkSiz).AppendLine();
sb.AppendFormat("{0} bytes to allocate when extending a file.", mdb.drClpSiz).AppendLine();
sb.AppendFormat("{0} bytes to allocate when extending a Extents B-Tree.", mdb.drXTClpSiz).AppendLine();
sb.AppendFormat("{0} bytes to allocate when extending a Catalog B-Tree.", mdb.drCTClpSiz).AppendLine();
sb.AppendFormat("Sector of first allocation block: {0}", mdb.drAlBlSt).AppendLine();
sb.AppendFormat("Next unused CNID: {0}", mdb.drNxtCNID).AppendLine();
sb.AppendFormat("{0} unused allocation blocks.", mdb.drFreeBks).AppendLine();
sb.AppendFormat(Localization.Volume_bitmap_starting_sector_in_512_bytes_0, mdb.drVBMSt).AppendLine();
sb.AppendFormat(Localization.Next_allocation_block_0, mdb.drAllocPtr).AppendLine();
sb.AppendFormat(Localization._0_volume_allocation_blocks, mdb.drNmAlBlks).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_allocation_block, mdb.drAlBlkSiz).AppendLine();
sb.AppendFormat(Localization._0_bytes_to_allocate_when_extending_a_file, mdb.drClpSiz).AppendLine();
sb.AppendFormat(Localization._0_bytes_to_allocate_when_extending_a_Extents_B_Tree, mdb.drXTClpSiz).AppendLine();
sb.AppendFormat(Localization._0_bytes_to_allocate_when_extending_a_Catalog_B_Tree, mdb.drCTClpSiz).AppendLine();
sb.AppendFormat(Localization.Sector_of_first_allocation_block_0, mdb.drAlBlSt).AppendLine();
sb.AppendFormat(Localization.Next_unused_CNID_0, mdb.drNxtCNID).AppendLine();
sb.AppendFormat(Localization._0_unused_allocation_blocks, mdb.drFreeBks).AppendLine();
sb.AppendFormat("{0} bytes in the Extents B-Tree", mdb.drXTFlSize).AppendLine();
sb.AppendFormat("{0} bytes in the Catalog B-Tree", mdb.drCTFlSize).AppendLine();
sb.AppendFormat(Localization._0_bytes_in_the_Extents_B_Tree, mdb.drXTFlSize).AppendLine();
sb.AppendFormat(Localization._0_bytes_in_the_Catalog_B_Tree, mdb.drCTFlSize).AppendLine();
sb.AppendFormat("Volume name: {0}", StringHandlers.PascalToString(mdb.drVN, Encoding)).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.PascalToString(mdb.drVN, Encoding)).AppendLine();
sb.AppendLine("Finder info:");
sb.AppendFormat("CNID of bootable system's directory: {0}", mdb.drFndrInfo0).AppendLine();
sb.AppendFormat("CNID of first-run application's directory: {0}", mdb.drFndrInfo1).AppendLine();
sb.AppendFormat("CNID of previously opened directory: {0}", mdb.drFndrInfo2).AppendLine();
sb.AppendFormat("CNID of bootable Mac OS 8 or 9 directory: {0}", mdb.drFndrInfo3).AppendLine();
sb.AppendFormat("CNID of bootable Mac OS X directory: {0}", mdb.drFndrInfo5).AppendLine();
sb.AppendLine(Localization.Finder_info);
sb.AppendFormat(Localization.CNID_of_bootable_system_directory_0, mdb.drFndrInfo0).AppendLine();
sb.AppendFormat(Localization.CNID_of_first_run_application_directory_0, mdb.drFndrInfo1).AppendLine();
sb.AppendFormat(Localization.CNID_of_previously_opened_directory_0, mdb.drFndrInfo2).AppendLine();
sb.AppendFormat(Localization.CNID_of_bootable_Mac_OS_8_or_9_directory_0, mdb.drFndrInfo3).AppendLine();
sb.AppendFormat(Localization.CNID_of_bootable_Mac_OS_X_directory_0, mdb.drFndrInfo5).AppendLine();
if(mdb.drFndrInfo6 != 0 &&
mdb.drFndrInfo7 != 0)
sb.AppendFormat("Mac OS X Volume ID: {0:X8}{1:X8}", mdb.drFndrInfo6, mdb.drFndrInfo7).AppendLine();
sb.AppendFormat(Localization.Mac_OS_X_Volume_ID_0_1, mdb.drFndrInfo6, mdb.drFndrInfo7).AppendLine();
if(mdb.drEmbedSigWord == AppleCommon.HFSP_MAGIC)
{
sb.AppendLine("Volume wraps a HFS+ volume.");
sb.AppendFormat("Starting block of the HFS+ volume: {0}", mdb.xdrStABNt).AppendLine();
sb.AppendFormat("Allocations blocks of the HFS+ volume: {0}", mdb.xdrNumABlks).AppendLine();
sb.AppendLine(Localization.Volume_wraps_a_HFS_Plus_volume);
sb.AppendFormat(Localization.Starting_block_of_the_HFS_Plus_volume_0, mdb.xdrStABNt).AppendLine();
sb.AppendFormat(Localization.Allocations_blocks_of_the_HFS_Plus_volume_0, mdb.xdrNumABlks).AppendLine();
}
else
{
sb.AppendFormat("{0} blocks in volume cache", mdb.drVCSize).AppendLine();
sb.AppendFormat("{0} blocks in volume bitmap cache", mdb.drVBMCSize).AppendLine();
sb.AppendFormat("{0} blocks in volume common cache", mdb.drCtlCSize).AppendLine();
sb.AppendFormat(Localization._0_blocks_in_volume_cache, mdb.drVCSize).AppendLine();
sb.AppendFormat(Localization._0_blocks_in_volume_bitmap_cache, mdb.drVBMCSize).AppendLine();
sb.AppendFormat(Localization._0_blocks_in_volume_common_cache, mdb.drCtlCSize).AppendLine();
}
string bootBlockInfo = AppleCommon.GetBootBlockInformation(bbSector, Encoding);
if(bootBlockInfo != null)
{
sb.AppendLine("Volume is bootable.");
sb.AppendLine(Localization.Volume_is_bootable);
sb.AppendLine();
sb.AppendLine(bootBlockInfo);
}
else if(mdb.drFndrInfo0 != 0 ||
mdb.drFndrInfo3 != 0 ||
mdb.drFndrInfo5 != 0)
sb.AppendLine("Volume is bootable.");
sb.AppendLine(Localization.Volume_is_bootable);
else
sb.AppendLine("Volume is not bootable.");
sb.AppendLine(Localization.Volume_is_not_bootable);
information = sb.ToString();
@@ -309,7 +309,7 @@ public sealed partial class AppleHFS
XmlFsType.ModificationDateSpecified = true;
}
XmlFsType.Type = "HFS";
XmlFsType.Type = FS_TYPE;
XmlFsType.VolumeName = StringHandlers.PascalToString(mdb.drVN, Encoding);
if(mdb.drFndrInfo6 != 0 &&

View File

@@ -47,16 +47,18 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of Apple Hierarchical File System Plus (HFS+)</summary>
public sealed class AppleHFSPlus : IFilesystem
{
const string FS_TYPE_HFSP = "hfsplus";
const string FS_TYPE_HFSX = "hfsx";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Apple HFS+ filesystem";
public string Name => Localization.AppleHFSPlus_Name;
/// <inheritdoc />
public Guid Id => new("36405F8D-0D26-6EBE-436F-62F0586B4F08");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -181,17 +183,17 @@ public sealed class AppleHFSPlus : IFilesystem
switch(vh.signature)
{
case 0x482B:
sb.AppendLine("HFS+ filesystem.");
sb.AppendLine(Localization.HFS_filesystem);
break;
case 0x4858:
sb.AppendLine("HFSX filesystem.");
sb.AppendLine(Localization.HFSX_filesystem);
break;
}
if(wrapped)
sb.AppendLine("Volume is wrapped inside an HFS volume.");
sb.AppendLine(Localization.Volume_is_wrapped_inside_an_HFS_volume);
byte[] tmp = new byte[0x400];
Array.Copy(vhSector, 0x400, tmp, 0, 0x400);
@@ -201,76 +203,80 @@ public sealed class AppleHFSPlus : IFilesystem
if(vh.version is 4 or 5)
{
sb.AppendFormat("Filesystem version is {0}.", vh.version).AppendLine();
sb.AppendFormat(Localization.Filesystem_version_is_0, vh.version).AppendLine();
if((vh.attributes & 0x80) == 0x80)
sb.AppendLine("Volume is locked on hardware.");
sb.AppendLine(Localization.Volume_is_locked_on_hardware);
if((vh.attributes & 0x100) == 0x100)
sb.AppendLine("Volume is unmounted.");
sb.AppendLine(Localization.Volume_is_unmounted);
if((vh.attributes & 0x200) == 0x200)
sb.AppendLine("There are bad blocks in the extents file.");
sb.AppendLine(Localization.There_are_bad_blocks_in_the_extents_file);
if((vh.attributes & 0x400) == 0x400)
sb.AppendLine("Volume does not require cache.");
sb.AppendLine(Localization.Volume_does_not_require_cache);
if((vh.attributes & 0x800) == 0x800)
sb.AppendLine("Volume state is inconsistent.");
sb.AppendLine(Localization.Volume_state_is_inconsistent);
if((vh.attributes & 0x1000) == 0x1000)
sb.AppendLine("CNIDs are reused.");
sb.AppendLine(Localization.There_are_reused_CNIDs);
if((vh.attributes & 0x2000) == 0x2000)
sb.AppendLine("Volume is journaled.");
sb.AppendLine(Localization.Volume_is_journaled);
if((vh.attributes & 0x8000) == 0x8000)
sb.AppendLine("Volume is locked on software.");
sb.AppendLine(Localization.Volume_is_locked_on_software);
sb.AppendFormat("Implementation that last mounted the volume: \"{0}\".",
sb.AppendFormat(Localization.Implementation_that_last_mounted_the_volume_0,
Encoding.ASCII.GetString(vh.lastMountedVersion)).AppendLine();
if((vh.attributes & 0x2000) == 0x2000)
sb.AppendFormat("Journal starts at allocation block {0}.", vh.journalInfoBlock).AppendLine();
sb.AppendFormat(Localization.Journal_starts_at_allocation_block_0, vh.journalInfoBlock).AppendLine();
sb.AppendFormat("Creation date: {0}", DateHandlers.MacToDateTime(vh.createDate)).AppendLine();
sb.AppendFormat("Last modification date: {0}", DateHandlers.MacToDateTime(vh.modifyDate)).AppendLine();
sb.AppendFormat(Localization.Creation_date_0, DateHandlers.MacToDateTime(vh.createDate)).AppendLine();
sb.AppendFormat(Localization.Last_modification_date_0, DateHandlers.MacToDateTime(vh.modifyDate)).
AppendLine();
if(vh.backupDate > 0)
sb.AppendFormat("Last backup date: {0}", DateHandlers.MacToDateTime(vh.backupDate)).AppendLine();
sb.AppendFormat(Localization.Last_backup_date_0, DateHandlers.MacToDateTime(vh.backupDate)).
AppendLine();
else
sb.AppendLine("Volume has never been backed up");
sb.AppendLine(Localization.Volume_has_never_been_backed_up);
if(vh.backupDate > 0)
sb.AppendFormat("Last check date: {0}", DateHandlers.MacToDateTime(vh.checkedDate)).AppendLine();
sb.AppendFormat(Localization.Last_check_date_0, DateHandlers.MacToDateTime(vh.checkedDate)).
AppendLine();
else
sb.AppendLine("Volume has never been checked up");
sb.AppendLine(Localization.Volume_has_never_been_checked_up);
sb.AppendFormat("{0} files on volume.", vh.fileCount).AppendLine();
sb.AppendFormat("{0} folders on volume.", vh.folderCount).AppendLine();
sb.AppendFormat("{0} bytes per allocation block.", vh.blockSize).AppendLine();
sb.AppendFormat("{0} allocation blocks.", vh.totalBlocks).AppendLine();
sb.AppendFormat("{0} free blocks.", vh.freeBlocks).AppendLine();
sb.AppendFormat("Next allocation block: {0}.", vh.nextAllocation).AppendLine();
sb.AppendFormat("Resource fork clump size: {0} bytes.", vh.rsrcClumpSize).AppendLine();
sb.AppendFormat("Data fork clump size: {0} bytes.", vh.dataClumpSize).AppendLine();
sb.AppendFormat("Next unused CNID: {0}.", vh.nextCatalogID).AppendLine();
sb.AppendFormat("Volume has been mounted writable {0} times.", vh.writeCount).AppendLine();
sb.AppendFormat("Allocation File is {0} bytes.", vh.allocationFile_logicalSize).AppendLine();
sb.AppendFormat("Extents File is {0} bytes.", vh.extentsFile_logicalSize).AppendLine();
sb.AppendFormat("Catalog File is {0} bytes.", vh.catalogFile_logicalSize).AppendLine();
sb.AppendFormat("Attributes File is {0} bytes.", vh.attributesFile_logicalSize).AppendLine();
sb.AppendFormat("Startup File is {0} bytes.", vh.startupFile_logicalSize).AppendLine();
sb.AppendLine("Finder info:");
sb.AppendFormat("CNID of bootable system's directory: {0}", vh.drFndrInfo0).AppendLine();
sb.AppendFormat("CNID of first-run application's directory: {0}", vh.drFndrInfo1).AppendLine();
sb.AppendFormat("CNID of previously opened directory: {0}", vh.drFndrInfo2).AppendLine();
sb.AppendFormat("CNID of bootable Mac OS 8 or 9 directory: {0}", vh.drFndrInfo3).AppendLine();
sb.AppendFormat("CNID of bootable Mac OS X directory: {0}", vh.drFndrInfo5).AppendLine();
sb.AppendFormat(Localization._0_files_on_volume, vh.fileCount).AppendLine();
sb.AppendFormat(Localization._0_folders_on_volume, vh.folderCount).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_allocation_block, vh.blockSize).AppendLine();
sb.AppendFormat(Localization._0_allocation_blocks, vh.totalBlocks).AppendLine();
sb.AppendFormat(Localization._0_free_blocks, vh.freeBlocks).AppendLine();
sb.AppendFormat(Localization.Next_allocation_block_0, vh.nextAllocation).AppendLine();
sb.AppendFormat(Localization.Resource_fork_clump_size_0_bytes, vh.rsrcClumpSize).AppendLine();
sb.AppendFormat(Localization.Data_fork_clump_size_0_bytes, vh.dataClumpSize).AppendLine();
sb.AppendFormat(Localization.Next_unused_CNID_0, vh.nextCatalogID).AppendLine();
sb.AppendFormat(Localization.Volume_has_been_mounted_writable_0_times, vh.writeCount).AppendLine();
sb.AppendFormat(Localization.Allocation_File_is_0_bytes, vh.allocationFile_logicalSize).AppendLine();
sb.AppendFormat(Localization.Extents_File_is_0_bytes, vh.extentsFile_logicalSize).AppendLine();
sb.AppendFormat(Localization.Catalog_File_is_0_bytes, vh.catalogFile_logicalSize).AppendLine();
sb.AppendFormat(Localization.Attributes_File_is_0_bytes, vh.attributesFile_logicalSize).AppendLine();
sb.AppendFormat(Localization.Startup_File_is_0_bytes, vh.startupFile_logicalSize).AppendLine();
sb.AppendLine(Localization.Finder_info);
sb.AppendFormat(Localization.CNID_of_bootable_system_directory_0, vh.drFndrInfo0).AppendLine();
sb.AppendFormat(Localization.CNID_of_first_run_application_directory_0, vh.drFndrInfo1).AppendLine();
sb.AppendFormat(Localization.CNID_of_previously_opened_directory_0, vh.drFndrInfo2).AppendLine();
sb.AppendFormat(Localization.CNID_of_bootable_Mac_OS_8_or_9_directory_0, vh.drFndrInfo3).AppendLine();
sb.AppendFormat(Localization.CNID_of_bootable_Mac_OS_X_directory_0, vh.drFndrInfo5).AppendLine();
if(vh.drFndrInfo6 != 0 &&
vh.drFndrInfo7 != 0)
sb.AppendFormat("Mac OS X Volume ID: {0:X8}{1:X8}", vh.drFndrInfo6, vh.drFndrInfo7).AppendLine();
sb.AppendFormat(Localization.Mac_OS_X_Volume_ID_0_1, vh.drFndrInfo6, vh.drFndrInfo7).AppendLine();
XmlFsType = new FileSystemType();
@@ -304,8 +310,8 @@ public sealed class AppleHFSPlus : IFilesystem
XmlFsType.Type = vh.signature switch
{
0x482B => "HFS+",
0x4858 => "HFSX",
0x482B => FS_TYPE_HFSP,
0x4858 => FS_TYPE_HFSX,
_ => XmlFsType.Type
};
@@ -317,8 +323,8 @@ public sealed class AppleHFSPlus : IFilesystem
}
else
{
sb.AppendFormat("Filesystem version is {0}.", vh.version).AppendLine();
sb.AppendLine("This version is not supported yet.");
sb.AppendFormat(Localization.Filesystem_version_is_0, vh.version).AppendLine();
sb.AppendLine(Localization.This_version_is_not_supported_yet);
}
information = sb.ToString();

View File

@@ -65,13 +65,13 @@ public sealed partial class AppleMFS : IReadOnlyFilesystem
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public string Name => "Apple Macintosh File System";
public string Name => Localization.AppleMFS_Name;
/// <inheritdoc />
public Guid Id => new("36405F8D-0D26-4066-6538-5DBF5D065C3A");
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
// TODO: Implement Finder namespace (requires decoding Desktop database)
/// <inheritdoc />

View File

@@ -48,4 +48,7 @@ public sealed partial class AppleMFS
const int BMAP_FREE = 0;
const int BMAP_LAST = 1;
const int BMAP_DIR = 0xFFF;
// Do not translate
const string FS_TYPE = "mfs";
}

View File

@@ -379,7 +379,7 @@ public sealed partial class AppleMFS
if(_blockMap[nextBlock] == BMAP_FREE)
{
AaruConsole.ErrorWriteLine("File truncated at block {0}", nextBlock);
AaruConsole.ErrorWriteLine(Localization.File_truncated_at_block_0, nextBlock);
break;
}

View File

@@ -103,57 +103,57 @@ public sealed partial class AppleMFS
Array.Copy(mdbSector, 0x024, variableSize, 0, mdb.drVNSiz + 1);
mdb.drVN = StringHandlers.PascalToString(variableSize, Encoding);
sb.AppendLine("Apple Macintosh File System");
sb.AppendLine(Localization.AppleMFS_Name);
sb.AppendLine();
sb.AppendLine("Master Directory Block:");
sb.AppendFormat("Creation date: {0}", DateHandlers.MacToDateTime(mdb.drCrDate)).AppendLine();
sb.AppendFormat("Last backup date: {0}", DateHandlers.MacToDateTime(mdb.drLsBkUp)).AppendLine();
sb.AppendLine(Localization.Master_Directory_Block);
sb.AppendFormat(Localization.Creation_date_0, DateHandlers.MacToDateTime(mdb.drCrDate)).AppendLine();
sb.AppendFormat(Localization.Last_backup_date_0, DateHandlers.MacToDateTime(mdb.drLsBkUp)).AppendLine();
if(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.HardwareLock))
sb.AppendLine("Volume is locked by hardware.");
sb.AppendLine(Localization.Volume_is_locked_by_hardware);
sb.AppendLine(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.Unmounted) ? "Volume was unmonted."
: "Volume is mounted.");
sb.AppendLine(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.Unmounted) ? Localization.Volume_was_unmonted
: Localization.Volume_is_mounted);
if(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.SparedBadBlocks))
sb.AppendLine("Volume has spared bad blocks.");
sb.AppendLine(Localization.Volume_has_spared_bad_blocks);
if(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.DoesNotNeedCache))
sb.AppendLine("Volume does not need cache.");
sb.AppendLine(Localization.Volume_does_not_need_cache);
if(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.BootInconsistent))
sb.AppendLine("Boot volume is inconsistent.");
sb.AppendLine(Localization.Boot_volume_is_inconsistent);
if(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.ReusedIds))
sb.AppendLine("There are reused CNIDs.");
sb.AppendLine(Localization.There_are_reused_CNIDs);
if(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.Inconsistent))
sb.AppendLine("Volume is seriously inconsistent.");
sb.AppendLine(Localization.Volume_is_seriously_inconsistent);
if(mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.SoftwareLock))
sb.AppendLine("Volume is locked by software.");
sb.AppendLine(Localization.Volume_is_locked_by_software);
sb.AppendFormat("{0} files on volume", mdb.drNmFls).AppendLine();
sb.AppendFormat("First directory sector: {0}", mdb.drDirSt).AppendLine();
sb.AppendFormat("{0} sectors in directory.", mdb.drBlLen).AppendLine();
sb.AppendFormat("{0} volume allocation blocks.", mdb.drNmAlBlks + 1).AppendLine();
sb.AppendFormat("Size of allocation blocks: {0} bytes", mdb.drAlBlkSiz).AppendLine();
sb.AppendFormat("{0} bytes to allocate.", mdb.drClpSiz).AppendLine();
sb.AppendFormat("First allocation block (#2) starts in sector {0}.", mdb.drAlBlSt).AppendLine();
sb.AppendFormat("Next unused file number: {0}", mdb.drNxtFNum).AppendLine();
sb.AppendFormat("{0} unused allocation blocks.", mdb.drFreeBks).AppendLine();
sb.AppendFormat("Volume name: {0}", mdb.drVN).AppendLine();
sb.AppendFormat(Localization._0_files_on_volume, mdb.drNmFls).AppendLine();
sb.AppendFormat(Localization.First_directory_sector_0, mdb.drDirSt).AppendLine();
sb.AppendFormat(Localization._0_sectors_in_directory, mdb.drBlLen).AppendLine();
sb.AppendFormat(Localization._0_volume_allocation_blocks, mdb.drNmAlBlks + 1).AppendLine();
sb.AppendFormat(Localization.Size_of_allocation_blocks_0_bytes, mdb.drAlBlkSiz).AppendLine();
sb.AppendFormat(Localization._0_bytes_to_allocate, mdb.drClpSiz).AppendLine();
sb.AppendFormat(Localization.First_allocation_block_number_two_starts_in_sector_0, mdb.drAlBlSt).AppendLine();
sb.AppendFormat(Localization.Next_unused_file_number_0, mdb.drNxtFNum).AppendLine();
sb.AppendFormat(Localization._0_unused_allocation_blocks, mdb.drFreeBks).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, mdb.drVN).AppendLine();
string bootBlockInfo = AppleCommon.GetBootBlockInformation(bbSector, Encoding);
if(bootBlockInfo != null)
{
sb.AppendLine("Volume is bootable.");
sb.AppendLine(Localization.Volume_is_bootable);
sb.AppendLine();
sb.AppendLine(bootBlockInfo);
}
else
sb.AppendLine("Volume is not bootable.");
sb.AppendLine(Localization.Volume_is_not_bootable);
information = sb.ToString();
@@ -179,7 +179,7 @@ public sealed partial class AppleMFS
XmlFsType.FilesSpecified = true;
XmlFsType.FreeClusters = mdb.drFreeBks;
XmlFsType.FreeClustersSpecified = true;
XmlFsType.Type = "MFS";
XmlFsType.Type = FS_TYPE;
XmlFsType.VolumeName = mdb.drVN;
}
}

View File

@@ -204,7 +204,7 @@ public sealed partial class AppleMFS
XmlFsType.FilesSpecified = true;
XmlFsType.FreeClusters = _volMdb.drFreeBks;
XmlFsType.FreeClustersSpecified = true;
XmlFsType.Type = "MFS";
XmlFsType.Type = FS_TYPE;
XmlFsType.VolumeName = _volMdb.drVN;
return ErrorNumber.NoError;
@@ -232,7 +232,7 @@ public sealed partial class AppleMFS
Files = _volMdb.drNmFls,
FreeBlocks = _volMdb.drFreeBks,
PluginId = Id,
Type = "Apple MFS"
Type = FS_TYPE
};
stat.FreeFiles = uint.MaxValue - stat.Files;

View File

@@ -62,11 +62,11 @@ public sealed class AtheOS : IFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "AtheOS Filesystem";
public string Name => Localization.AtheOS_Name;
/// <inheritdoc />
public Guid Id => new("AAB2C4F1-DC07-49EE-A948-576CC51B58C5");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -123,51 +123,51 @@ public sealed class AtheOS : IFilesystem
SuperBlock afsSb = Marshal.ByteArrayToStructureLittleEndian<SuperBlock>(sbSector);
sb.AppendLine("Atheos filesystem");
sb.AppendLine(Localization.Atheos_filesystem);
if(afsSb.flags == 1)
sb.AppendLine("Filesystem is read-only");
sb.AppendLine(Localization.Filesystem_is_read_only);
sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(afsSb.name, Encoding)).AppendLine();
sb.AppendFormat("{0} bytes per block", afsSb.block_size).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(afsSb.name, Encoding)).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_block, afsSb.block_size).AppendLine();
sb.AppendFormat("{0} blocks in volume ({1} bytes)", afsSb.num_blocks, afsSb.num_blocks * afsSb.block_size).
sb.AppendFormat(Localization._0_blocks_in_volume_1_bytes, afsSb.num_blocks,
afsSb.num_blocks * afsSb.block_size).AppendLine();
sb.AppendFormat(Localization._0_used_blocks_1_bytes, afsSb.used_blocks, afsSb.used_blocks * afsSb.block_size).
AppendLine();
sb.AppendFormat("{0} used blocks ({1} bytes)", afsSb.used_blocks, afsSb.used_blocks * afsSb.block_size).
AppendLine();
sb.AppendFormat(Localization._0_bytes_per_i_node, afsSb.inode_size).AppendLine();
sb.AppendFormat("{0} bytes per i-node", afsSb.inode_size).AppendLine();
sb.AppendFormat("{0} blocks per allocation group ({1} bytes)", afsSb.blocks_per_ag,
sb.AppendFormat(Localization._0_blocks_per_allocation_group_1_bytes, afsSb.blocks_per_ag,
afsSb.blocks_per_ag * afsSb.block_size).AppendLine();
sb.AppendFormat("{0} allocation groups in volume", afsSb.num_ags).AppendLine();
sb.AppendFormat(Localization._0_allocation_groups_in_volume, afsSb.num_ags).AppendLine();
sb.AppendFormat("Journal resides in block {0} of allocation group {1} and runs for {2} blocks ({3} bytes)",
sb.AppendFormat(Localization.Journal_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
afsSb.log_blocks_start, afsSb.log_blocks_ag, afsSb.log_blocks_len,
afsSb.log_blocks_len * afsSb.block_size).AppendLine();
sb.AppendFormat("Journal starts in byte {0} and has {1} bytes in {2} blocks", afsSb.log_start, afsSb.log_size,
afsSb.log_valid_blocks).AppendLine();
sb.AppendFormat(Localization.Journal_starts_in_byte_0_and_has_1_bytes_in_2_blocks, afsSb.log_start,
afsSb.log_size, afsSb.log_valid_blocks).AppendLine();
sb.
AppendFormat("Root folder's i-node resides in block {0} of allocation group {1} and runs for {2} blocks ({3} bytes)",
AppendFormat(Localization.Root_folder_s_i_node_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
afsSb.root_dir_start, afsSb.root_dir_ag, afsSb.root_dir_len,
afsSb.root_dir_len * afsSb.block_size).AppendLine();
sb.
AppendFormat("Directory containing files scheduled for deletion's i-node resides in block {0} of allocation group {1} and runs for {2} blocks ({3} bytes)",
AppendFormat(Localization.Directory_containing_files_scheduled_for_deletion_i_node_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
afsSb.deleted_start, afsSb.deleted_ag, afsSb.deleted_len,
afsSb.deleted_len * afsSb.block_size).AppendLine();
sb.
AppendFormat("Indices' i-node resides in block {0} of allocation group {1} and runs for {2} blocks ({3} bytes)",
AppendFormat(Localization.Indices_i_node_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
afsSb.indices_start, afsSb.indices_ag, afsSb.indices_len,
afsSb.indices_len * afsSb.block_size).AppendLine();
sb.AppendFormat("{0} blocks for bootloader ({1} bytes)", afsSb.boot_size, afsSb.boot_size * afsSb.block_size).
AppendLine();
sb.AppendFormat(Localization._0_blocks_for_bootloader_1_bytes, afsSb.boot_size,
afsSb.boot_size * afsSb.block_size).AppendLine();
information = sb.ToString();
@@ -178,11 +178,13 @@ public sealed class AtheOS : IFilesystem
Dirty = false,
FreeClusters = (ulong)(afsSb.num_blocks - afsSb.used_blocks),
FreeClustersSpecified = true,
Type = "AtheOS filesystem",
Type = FS_TYPE,
VolumeName = StringHandlers.CToString(afsSb.name, Encoding)
};
}
const string FS_TYPE = "atheos";
/// <summary>Be superblock</summary>
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct SuperBlock

View File

@@ -0,0 +1,37 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : Authors.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru.Filesystems.
//
// --[ 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 <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
using System.Diagnostics.CodeAnalysis;
namespace Aaru.Filesystems;
[SuppressMessage("ReSharper", "InconsistentNaming")]
static class Authors
{
internal const string NataliaPortillo = "Natalia Portillo";
}

View File

@@ -68,11 +68,11 @@ public sealed class BeFS : IFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Be Filesystem";
public string Name => Localization.BeFS_Name;
/// <inheritdoc />
public Guid Id => new("dc8572b3-b6ad-46e4-8de9-cbe123ff6672");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -170,7 +170,7 @@ public sealed class BeFS : IFilesystem
besb = littleEndian ? Marshal.ByteArrayToStructureLittleEndian<SuperBlock>(sbSector)
: Marshal.ByteArrayToStructureBigEndian<SuperBlock>(sbSector);
sb.AppendLine(littleEndian ? "Little-endian BeFS" : "Big-endian BeFS");
sb.AppendLine(littleEndian ? Localization.Little_endian_BeFS : Localization.Big_endian_BeFS);
if(besb.magic1 != BEFS_MAGIC1 ||
besb.fs_byte_order != BEFS_ENDIAN ||
@@ -180,65 +180,69 @@ public sealed class BeFS : IFilesystem
besb.indices_len != 1 ||
1 << (int)besb.block_shift != besb.block_size)
{
sb.AppendLine("Superblock seems corrupt, following information may be incorrect");
sb.AppendFormat("Magic 1: 0x{0:X8} (Should be 0x42465331)", besb.magic1).AppendLine();
sb.AppendFormat("Magic 2: 0x{0:X8} (Should be 0xDD121031)", besb.magic2).AppendLine();
sb.AppendFormat("Magic 3: 0x{0:X8} (Should be 0x15B6830E)", besb.magic3).AppendLine();
sb.AppendLine(Localization.Superblock_seems_corrupt_following_information_may_be_incorrect);
sb.AppendFormat(Localization.Magic_one_0_Should_be_0x42465331, besb.magic1).AppendLine();
sb.AppendFormat(Localization.Magic_two_0_Should_be_0xDD121031, besb.magic2).AppendLine();
sb.AppendFormat(Localization.Magic_three_0_Should_be_0x15B6830E, besb.magic3).AppendLine();
sb.AppendFormat("Filesystem endianness: 0x{0:X8} (Should be 0x42494745)", besb.fs_byte_order).AppendLine();
sb.AppendFormat(Localization.Filesystem_endianness_0_Should_be_0x42494745, besb.fs_byte_order).AppendLine();
sb.AppendFormat("Root folder's i-node size: {0} blocks (Should be 1)", besb.root_dir_len).AppendLine();
sb.AppendFormat("Indices' i-node size: {0} blocks (Should be 1)", besb.indices_len).AppendLine();
sb.AppendFormat(Localization.Root_folder_i_node_size_0_blocks_Should_be_one, besb.root_dir_len).
AppendLine();
sb.AppendFormat("1 << block_shift == block_size => 1 << {0} == {1} (Should be {2})", besb.block_shift,
1 << (int)besb.block_shift, besb.block_size).AppendLine();
sb.AppendFormat(Localization.Indices_i_node_size_0_blocks_Should_be_one, besb.indices_len).AppendLine();
sb.AppendFormat(Localization.blockshift_0_1_should_be_2, besb.block_shift, 1 << (int)besb.block_shift,
besb.block_size).AppendLine();
}
switch(besb.flags)
{
case BEFS_CLEAN:
sb.AppendLine(besb.log_start == besb.log_end ? "Filesystem is clean" : "Filesystem is dirty");
sb.AppendLine(besb.log_start == besb.log_end ? Localization.Filesystem_is_clean
: Localization.Filesystem_is_dirty);
break;
case BEFS_DIRTY:
sb.AppendLine("Filesystem is dirty");
sb.AppendLine(Localization.Filesystem_is_dirty);
break;
default:
sb.AppendFormat("Unknown flags: {0:X8}", besb.flags).AppendLine();
sb.AppendFormat(Localization.Unknown_flags_0_X8, besb.flags).AppendLine();
break;
}
sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(besb.name, Encoding)).AppendLine();
sb.AppendFormat("{0} bytes per block", besb.block_size).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(besb.name, Encoding)).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_block, besb.block_size).AppendLine();
sb.AppendFormat("{0} blocks in volume ({1} bytes)", besb.num_blocks, besb.num_blocks * besb.block_size).
sb.AppendFormat(Localization._0_blocks_in_volume_1_bytes, besb.num_blocks, besb.num_blocks * besb.block_size).
AppendLine();
sb.AppendFormat("{0} used blocks ({1} bytes)", besb.used_blocks, besb.used_blocks * besb.block_size).
sb.AppendFormat(Localization._0_used_blocks_1_bytes, besb.used_blocks, besb.used_blocks * besb.block_size).
AppendLine();
sb.AppendFormat("{0} bytes per i-node", besb.inode_size).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_i_node, besb.inode_size).AppendLine();
sb.AppendFormat("{0} blocks per allocation group ({1} bytes)", besb.blocks_per_ag,
sb.AppendFormat(Localization._0_blocks_per_allocation_group_1_bytes, besb.blocks_per_ag,
besb.blocks_per_ag * besb.block_size).AppendLine();
sb.AppendFormat("{0} allocation groups in volume", besb.num_ags).AppendLine();
sb.AppendFormat(Localization._0_allocation_groups_in_volume, besb.num_ags).AppendLine();
sb.AppendFormat("Journal resides in block {0} of allocation group {1} and runs for {2} blocks ({3} bytes)",
sb.AppendFormat(Localization.Journal_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
besb.log_blocks_start, besb.log_blocks_ag, besb.log_blocks_len,
besb.log_blocks_len * besb.block_size).AppendLine();
sb.AppendFormat("Journal starts in byte {0} and ends in byte {1}", besb.log_start, besb.log_end).AppendLine();
sb.AppendFormat(Localization.Journal_starts_in_byte_0_and_ends_in_byte_1, besb.log_start, besb.log_end).
AppendLine();
sb.
AppendFormat("Root folder's i-node resides in block {0} of allocation group {1} and runs for {2} blocks ({3} bytes)",
AppendFormat(Localization.Root_folder_s_i_node_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
besb.root_dir_start, besb.root_dir_ag, besb.root_dir_len, besb.root_dir_len * besb.block_size).
AppendLine();
sb.
AppendFormat("Indices' i-node resides in block {0} of allocation group {1} and runs for {2} blocks ({3} bytes)",
AppendFormat(Localization.Indices_i_node_resides_in_block_0_of_allocation_group_1_and_runs_for_2_blocks_3_bytes,
besb.indices_start, besb.indices_ag, besb.indices_len, besb.indices_len * besb.block_size).
AppendLine();
@@ -251,11 +255,13 @@ public sealed class BeFS : IFilesystem
Dirty = besb.flags == BEFS_DIRTY,
FreeClusters = (ulong)(besb.num_blocks - besb.used_blocks),
FreeClustersSpecified = true,
Type = "BeFS",
Type = FS_TYPE,
VolumeName = StringHandlers.CToString(besb.name, Encoding)
};
}
const string FS_TYPE = "befs";
/// <summary>Be superblock</summary>
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct SuperBlock

View File

@@ -49,16 +49,18 @@ public sealed class BTRFS : IFilesystem
/// <summary>BTRFS magic "_BHRfS_M"</summary>
const ulong BTRFS_MAGIC = 0x4D5F53665248425F;
const string FS_TYPE = "btrfs";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "B-tree file system";
public string Name => Localization.BTRFS_Name;
/// <inheritdoc />
public Guid Id => new("C904CF15-5222-446B-B7DB-02EAC5D781B3");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -175,27 +177,27 @@ public sealed class BTRFS : IFilesystem
AaruConsole.DebugWriteLine("BTRFS Plugin", "btrfsSb.dev_item.uuid = {0}", btrfsSb.dev_item.uuid);
AaruConsole.DebugWriteLine("BTRFS Plugin", "btrfsSb.label = {0}", btrfsSb.label);
sbInformation.AppendLine("B-tree filesystem");
sbInformation.AppendFormat("UUID: {0}", btrfsSb.uuid).AppendLine();
sbInformation.AppendFormat("This superblock resides on physical block {0}", btrfsSb.pba).AppendLine();
sbInformation.AppendFormat("Root tree starts at LBA {0}", btrfsSb.root_lba).AppendLine();
sbInformation.AppendFormat("Chunk tree starts at LBA {0}", btrfsSb.chunk_lba).AppendLine();
sbInformation.AppendFormat("Log tree starts at LBA {0}", btrfsSb.log_lba).AppendLine();
sbInformation.AppendLine(Localization.B_tree_filesystem);
sbInformation.AppendFormat(Localization.UUID_0, btrfsSb.uuid).AppendLine();
sbInformation.AppendFormat(Localization.This_superblock_resides_on_physical_block_0, btrfsSb.pba).AppendLine();
sbInformation.AppendFormat(Localization.Root_tree_starts_at_LBA_0, btrfsSb.root_lba).AppendLine();
sbInformation.AppendFormat(Localization.Chunk_tree_starts_at_LBA_0, btrfsSb.chunk_lba).AppendLine();
sbInformation.AppendFormat(Localization.Log_tree_starts_at_LBA_0, btrfsSb.log_lba).AppendLine();
sbInformation.AppendFormat("Volume has {0} bytes spanned in {1} devices", btrfsSb.total_bytes,
sbInformation.AppendFormat(Localization.Volume_has_0_bytes_spanned_in_1_devices, btrfsSb.total_bytes,
btrfsSb.num_devices).AppendLine();
sbInformation.AppendFormat("Volume has {0} bytes used", btrfsSb.bytes_used).AppendLine();
sbInformation.AppendFormat("{0} bytes/sector", btrfsSb.sectorsize).AppendLine();
sbInformation.AppendFormat("{0} bytes/node", btrfsSb.nodesize).AppendLine();
sbInformation.AppendFormat("{0} bytes/leaf", btrfsSb.leafsize).AppendLine();
sbInformation.AppendFormat("{0} bytes/stripe", btrfsSb.stripesize).AppendLine();
sbInformation.AppendFormat("Flags: 0x{0:X}", btrfsSb.flags).AppendLine();
sbInformation.AppendFormat("Compatible flags: 0x{0:X}", btrfsSb.compat_flags).AppendLine();
sbInformation.AppendFormat("Read-only compatible flags: 0x{0:X}", btrfsSb.compat_ro_flags).AppendLine();
sbInformation.AppendFormat("Incompatible flags: 0x{0:X}", btrfsSb.incompat_flags).AppendLine();
sbInformation.AppendFormat("Device's UUID: {0}", btrfsSb.dev_item.uuid).AppendLine();
sbInformation.AppendFormat("Volume label: {0}", btrfsSb.label).AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_bytes_used, btrfsSb.bytes_used).AppendLine();
sbInformation.AppendFormat(Localization._0_bytes_sector, btrfsSb.sectorsize).AppendLine();
sbInformation.AppendFormat(Localization._0_bytes_node, btrfsSb.nodesize).AppendLine();
sbInformation.AppendFormat(Localization._0_bytes_leaf, btrfsSb.leafsize).AppendLine();
sbInformation.AppendFormat(Localization._0_bytes_stripe, btrfsSb.stripesize).AppendLine();
sbInformation.AppendFormat(Localization.Flags_0, btrfsSb.flags).AppendLine();
sbInformation.AppendFormat(Localization.Compatible_flags_0, btrfsSb.compat_flags).AppendLine();
sbInformation.AppendFormat(Localization.Read_only_compatible_flags_0, btrfsSb.compat_ro_flags).AppendLine();
sbInformation.AppendFormat(Localization.Incompatible_flags_0, btrfsSb.incompat_flags).AppendLine();
sbInformation.AppendFormat(Localization.Device_UUID_0, btrfsSb.dev_item.uuid).AppendLine();
sbInformation.AppendFormat(Localization.Volume_label_0, btrfsSb.label).AppendLine();
information = sbInformation.ToString();
@@ -207,7 +209,7 @@ public sealed class BTRFS : IFilesystem
VolumeName = btrfsSb.label,
VolumeSerial = $"{btrfsSb.uuid}",
VolumeSetIdentifier = $"{btrfsSb.dev_item.device_uuid}",
Type = Name
Type = FS_TYPE
};
XmlFsType.FreeClusters = XmlFsType.Clusters - (btrfsSb.bytes_used / btrfsSb.sectorsize);

View File

@@ -48,16 +48,17 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of the filesystem used in 8-bit Commodore microcomputers</summary>
public sealed class CBM : IFilesystem
{
const string FS_TYPE = "cbmfs";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public string Name => "Commodore file system";
public string Name => Localization.CBM_Name;
/// <inheritdoc />
public Guid Id => new("D104744E-A376-450C-BAC0-1347C93F983B");
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -114,11 +115,11 @@ public sealed class CBM : IFilesystem
var sbInformation = new StringBuilder();
sbInformation.AppendLine("Commodore file system");
sbInformation.AppendLine(Localization.Commodore_file_system);
XmlFsType = new FileSystemType
{
Type = "Commodore file system",
Type = FS_TYPE,
Clusters = imagePlugin.Info.Sectors,
ClusterSize = 256
};
@@ -132,27 +133,28 @@ public sealed class CBM : IFilesystem
Header cbmHdr = Marshal.ByteArrayToStructureLittleEndian<Header>(sector);
sbInformation.AppendFormat("Directory starts at track {0} sector {1}", cbmHdr.directoryTrack,
sbInformation.AppendFormat(Localization.Directory_starts_at_track_0_sector_1, cbmHdr.directoryTrack,
cbmHdr.directorySector).AppendLine();
sbInformation.AppendFormat("Disk DOS Version: {0}", Encoding.ASCII.GetString(new[]
sbInformation.AppendFormat(Localization.Disk_DOS_Version_0, Encoding.ASCII.GetString(new[]
{
cbmHdr.diskDosVersion
})).AppendLine();
sbInformation.AppendFormat("DOS Version: {0}", Encoding.ASCII.GetString(new[]
sbInformation.AppendFormat(Localization.DOS_Version_0, Encoding.ASCII.GetString(new[]
{
cbmHdr.dosVersion
})).AppendLine();
sbInformation.AppendFormat("Disk Version: {0}", Encoding.ASCII.GetString(new[]
sbInformation.AppendFormat(Localization.Disk_Version_0, Encoding.ASCII.GetString(new[]
{
cbmHdr.diskVersion
})).AppendLine();
sbInformation.AppendFormat("Disk ID: {0}", cbmHdr.diskId).AppendLine();
sbInformation.AppendFormat(Localization.Disk_ID_0, cbmHdr.diskId).AppendLine();
sbInformation.AppendFormat("Disk name: {0}", StringHandlers.CToString(cbmHdr.name, Encoding)).AppendLine();
sbInformation.AppendFormat(Localization.Disk_name_0, StringHandlers.CToString(cbmHdr.name, Encoding)).
AppendLine();
XmlFsType.VolumeName = StringHandlers.CToString(cbmHdr.name, Encoding);
XmlFsType.VolumeSerial = $"{cbmHdr.diskId}";
@@ -166,20 +168,21 @@ public sealed class CBM : IFilesystem
BAM cbmBam = Marshal.ByteArrayToStructureLittleEndian<BAM>(sector);
sbInformation.AppendFormat("Directory starts at track {0} sector {1}", cbmBam.directoryTrack,
sbInformation.AppendFormat(Localization.Directory_starts_at_track_0_sector_1, cbmBam.directoryTrack,
cbmBam.directorySector).AppendLine();
sbInformation.AppendFormat("Disk DOS type: {0}",
sbInformation.AppendFormat(Localization.Disk_DOS_type_0,
Encoding.ASCII.GetString(BitConverter.GetBytes(cbmBam.dosType))).AppendLine();
sbInformation.AppendFormat("DOS Version: {0}", Encoding.ASCII.GetString(new[]
sbInformation.AppendFormat(Localization.DOS_Version_0, Encoding.ASCII.GetString(new[]
{
cbmBam.dosVersion
})).AppendLine();
sbInformation.AppendFormat("Disk ID: {0}", cbmBam.diskId).AppendLine();
sbInformation.AppendFormat(Localization.Disk_ID_0, cbmBam.diskId).AppendLine();
sbInformation.AppendFormat("Disk name: {0}", StringHandlers.CToString(cbmBam.name, Encoding)).AppendLine();
sbInformation.AppendFormat(Localization.Disk_name_0, StringHandlers.CToString(cbmBam.name, Encoding)).
AppendLine();
XmlFsType.VolumeName = StringHandlers.CToString(cbmBam.name, Encoding);
XmlFsType.VolumeSerial = $"{cbmBam.diskId}";

View File

@@ -86,11 +86,11 @@ public sealed partial class CPM : IReadOnlyFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "CP/M File System";
public string Name => Localization.CPM_Name;
/// <inheritdoc />
public Guid Id => new("AA2B8585-41DF-4E3B-8A35-D1A935E2F8A1");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public IEnumerable<(string name, Type type, string description)> SupportedOptions =>

View File

@@ -36,6 +36,9 @@ namespace Aaru.Filesystems;
public sealed partial class CPM
{
// Do not translate
const string FS_TYPE = "cpmfs";
/// <summary>Enumerates the format identification byte used by CP/M-86</summary>
enum FormatByte : byte
{

View File

@@ -301,7 +301,7 @@ public sealed partial class CPM
_workingDefinition.skew = 2;
_workingDefinition.sofs = 0;
AaruConsole.DebugWriteLine("CP/M Plugin", "Found Amstrad superblock.");
AaruConsole.DebugWriteLine("CP/M Plugin", Localization.Found_Amstrad_superblock);
}
}
}
@@ -369,7 +369,7 @@ public sealed partial class CPM
imagePlugin.ReadSectors(firstDirectorySector + partition.Start, directoryLength,
out directory);
AaruConsole.DebugWriteLine("CP/M Plugin", "Found CP/M-86 hard disk superblock.");
AaruConsole.DebugWriteLine("CP/M Plugin", Localization.Found_CPM_86_hard_disk_superblock);
// Build a CP/M disk definition
_workingDefinition = new CpmDefinition
@@ -889,7 +889,7 @@ public sealed partial class CPM
imagePlugin.ReadSectors(firstDirectorySector86 + partition.Start, directoryLength,
out directory);
AaruConsole.DebugWriteLine("CP/M Plugin", "Found CP/M-86 floppy identifier.");
AaruConsole.DebugWriteLine("CP/M Plugin", Localization.Found_CPM_86_floppy_identifier);
}
}
}
@@ -899,7 +899,7 @@ public sealed partial class CPM
{
if(CheckDir(directory))
{
AaruConsole.DebugWriteLine("CP/M Plugin", "First directory block seems correct.");
AaruConsole.DebugWriteLine("CP/M Plugin", Localization.First_directory_block_seems_correct);
return true;
}
@@ -911,13 +911,13 @@ public sealed partial class CPM
if(!_cpmFound)
{
// Load all definitions
AaruConsole.DebugWriteLine("CP/M Plugin", "Trying to load definitions.");
AaruConsole.DebugWriteLine("CP/M Plugin", Localization.Trying_to_load_definitions);
if(LoadDefinitions() &&
_definitions?.definitions != null &&
_definitions.definitions.Count > 0)
{
AaruConsole.DebugWriteLine("CP/M Plugin", "Trying all known definitions.");
AaruConsole.DebugWriteLine("CP/M Plugin", Localization.Trying_all_known_definitions);
foreach(CpmDefinition def in from def in _definitions.definitions let sectors =
(ulong)(def.cylinders * def.sides * def.sectorsPerTrack)
@@ -925,7 +925,7 @@ public sealed partial class CPM
def.bytesPerSector == imagePlugin.Info.SectorSize select def)
{
// Definition seems to describe current disk, at least, same number of volume sectors and bytes per sector
AaruConsole.DebugWriteLine("CP/M Plugin", "Trying definition \"{0}\"", def.comment);
AaruConsole.DebugWriteLine("CP/M Plugin", Localization.Trying_definition_0, def.comment);
ulong offset;
if(def.sofs != 0)
@@ -977,7 +977,8 @@ public sealed partial class CPM
StringComparison.InvariantCultureIgnoreCase) == 0)
{
AaruConsole.DebugWriteLine("CP/M Plugin",
"Don't know how to handle COLUMBIA ordering, not proceeding with this definition.");
Localization.
Dont_know_how_to_handle_COLUMBIA_ordering_not_proceeding_with_this_definition);
continue;
}
@@ -987,14 +988,16 @@ public sealed partial class CPM
0)
{
AaruConsole.DebugWriteLine("CP/M Plugin",
"Don't know how to handle EAGLE ordering, not proceeding with this definition.");
Localization.
Don_know_how_to_handle_EAGLE_ordering_not_proceeding_with_this_definition);
continue;
}
else
{
AaruConsole.DebugWriteLine("CP/M Plugin",
"Unknown order type \"{0}\", not proceeding with this definition.",
Localization.
Unknown_order_type_0_not_proceeding_with_this_definition,
def.order);
continue;
@@ -1021,7 +1024,8 @@ public sealed partial class CPM
if(def.evenOdd)
AaruConsole.DebugWriteLine("CP/M Plugin",
"Definition contains EVEN-ODD field, with unknown meaning, detection may be wrong.");
Localization.
Definition_contains_EVEN_ODD_field_with_unknown_meaning_detection_may_be_wrong);
// Complement of the directory bytes if needed
if(def.complement)
@@ -1031,7 +1035,7 @@ public sealed partial class CPM
// Check the directory
if(CheckDir(directory))
{
AaruConsole.DebugWriteLine("CP/M Plugin", "Definition \"{0}\" has a correct directory",
AaruConsole.DebugWriteLine("CP/M Plugin", Localization.Definition_0_has_a_correct_directory,
def.comment);
// Build a Disc Parameter Block
@@ -1146,23 +1150,23 @@ public sealed partial class CPM
return;
var sb = new StringBuilder();
sb.AppendLine("CP/M filesystem");
sb.AppendLine(Localization.CPM_filesystem);
if(!string.IsNullOrEmpty(_workingDefinition.comment))
sb.AppendFormat("Identified as {0}", _workingDefinition.comment).AppendLine();
sb.AppendFormat(Localization.Identified_as_0, _workingDefinition.comment).AppendLine();
sb.AppendFormat("Volume block is {0} bytes", 128 << _dpb.bsh).AppendLine();
sb.AppendFormat(Localization.Volume_block_is_0_bytes, 128 << _dpb.bsh).AppendLine();
if(_dpb.dsm > 0)
sb.AppendFormat("Volume contains {0} blocks ({1} bytes)", _dpb.dsm, _dpb.dsm * (128 << _dpb.bsh)).
sb.AppendFormat(Localization.Volume_contains_0_blocks_1_bytes, _dpb.dsm, _dpb.dsm * (128 << _dpb.bsh)).
AppendLine();
sb.AppendFormat("Volume contains {0} directory entries", _dpb.drm + 1).AppendLine();
sb.AppendFormat(Localization.Volume_contains_0_directory_entries, _dpb.drm + 1).AppendLine();
if(_workingDefinition.sofs > 0)
sb.AppendFormat("Volume reserves {0} sectors for system", _workingDefinition.sofs).AppendLine();
sb.AppendFormat(Localization.Volume_reserves_0_sectors_for_system, _workingDefinition.sofs).AppendLine();
else
sb.AppendFormat("Volume reserves {1} tracks ({0} sectors) for system",
sb.AppendFormat(Localization.Volume_reserves_1_tracks_0_sectors_for_system,
_workingDefinition.ofs * _workingDefinition.sectorsPerTrack, _workingDefinition.ofs).
AppendLine();
@@ -1171,7 +1175,7 @@ public sealed partial class CPM
int interleaveSide1 = _workingDefinition.side1.sectorIds[1] - _workingDefinition.side1.sectorIds[0];
if(interleaveSide1 > 1)
sb.AppendFormat("Side 0 uses {0}:1 software interleaving", interleaveSide1).AppendLine();
sb.AppendFormat(Localization.Side_zero_uses_0_one_software_interleaving, interleaveSide1).AppendLine();
}
if(_workingDefinition.sides == 2)
@@ -1181,28 +1185,30 @@ public sealed partial class CPM
int interleaveSide2 = _workingDefinition.side2.sectorIds[1] - _workingDefinition.side2.sectorIds[0];
if(interleaveSide2 > 1)
sb.AppendFormat("Side 1 uses {0}:1 software interleaving", interleaveSide2).AppendLine();
sb.AppendFormat(Localization.Side_one_uses_0_one_software_interleaving, interleaveSide2).
AppendLine();
}
switch(_workingDefinition.order)
{
case "SIDES":
sb.AppendLine("Head changes after each whole track");
sb.AppendLine(Localization.Head_changes_after_each_whole_track);
break;
case "CYLINDERS":
sb.AppendLine("Head changes after whole side");
sb.AppendLine(Localization.Head_changes_after_whole_side);
break;
default:
sb.AppendFormat("Unknown how {0} side ordering works", _workingDefinition.order).AppendLine();
sb.AppendFormat(Localization.Unknown_how_0_side_ordering_works, _workingDefinition.order).
AppendLine();
break;
}
}
if(_workingDefinition.skew > 0)
sb.AppendFormat("Device uses {0}:1 hardware interleaving", _workingDefinition.skew).AppendLine();
sb.AppendFormat(Localization.Device_uses_0_one_hardware_interleaving, _workingDefinition.skew).AppendLine();
if(_workingDefinition.sofs > 0)
sb.AppendFormat("BSH {0} BLM {1} EXM {2} DSM {3} DRM {4} AL0 {5:X2}H AL1 {6:X2}H SOFS {7}", _dpb.bsh,
@@ -1214,19 +1220,21 @@ public sealed partial class CPM
AppendLine();
if(_label != null)
sb.AppendFormat("Volume label {0}", _label).AppendLine();
sb.AppendFormat(Localization.Volume_label_0, _label).AppendLine();
if(_standardTimestamps)
sb.AppendLine("Volume uses standard CP/M timestamps");
sb.AppendLine(Localization.Volume_uses_standard_CPM_timestamps);
if(_thirdPartyTimestamps)
sb.AppendLine("Volume uses third party timestamps");
sb.AppendLine(Localization.Volume_uses_third_party_timestamps);
if(_labelCreationDate != null)
sb.AppendFormat("Volume created on {0}", DateHandlers.CpmToDateTime(_labelCreationDate)).AppendLine();
sb.AppendFormat(Localization.Volume_created_on_0, DateHandlers.CpmToDateTime(_labelCreationDate)).
AppendLine();
if(_labelUpdateDate != null)
sb.AppendFormat("Volume updated on {0}", DateHandlers.CpmToDateTime(_labelUpdateDate)).AppendLine();
sb.AppendFormat(Localization.Volume_updated_on_0, DateHandlers.CpmToDateTime(_labelUpdateDate)).
AppendLine();
XmlFsType = new FileSystemType();
XmlFsType.Bootable |= _workingDefinition.sofs > 0 || _workingDefinition.ofs > 0;
@@ -1249,7 +1257,7 @@ public sealed partial class CPM
XmlFsType.ModificationDateSpecified = true;
}
XmlFsType.Type = "CP/M";
XmlFsType.Type = FS_TYPE;
XmlFsType.VolumeName = _label;
information = sb.ToString();

View File

@@ -105,7 +105,7 @@ public sealed partial class CPM
_workingDefinition.side1.sectorIds.Length + _workingDefinition.side2.sectorIds.Length;
// TODO: Implement CYLINDERS ordering
AaruConsole.DebugWriteLine("CP/M Plugin", "CYLINDERS ordering not yet implemented.");
AaruConsole.DebugWriteLine("CP/M Plugin", Localization.CYLINDERS_ordering_not_yet_implemented);
return ErrorNumber.NotImplemented;
}
@@ -115,7 +115,8 @@ public sealed partial class CPM
0)
{
AaruConsole.DebugWriteLine("CP/M Plugin",
"Don't know how to handle COLUMBIA ordering, not proceeding with this definition.");
Localization.
Dont_know_how_to_handle_COLUMBIA_ordering_not_proceeding_with_this_definition);
return ErrorNumber.NotImplemented;
}
@@ -124,14 +125,15 @@ public sealed partial class CPM
else if(string.Compare(_workingDefinition.order, "EAGLE", StringComparison.InvariantCultureIgnoreCase) == 0)
{
AaruConsole.DebugWriteLine("CP/M Plugin",
"Don't know how to handle EAGLE ordering, not proceeding with this definition.");
Localization.
Don_know_how_to_handle_EAGLE_ordering_not_proceeding_with_this_definition);
return ErrorNumber.NotImplemented;
}
else
{
AaruConsole.DebugWriteLine("CP/M Plugin",
"Unknown order type \"{0}\", not proceeding with this definition.",
Localization.Unknown_order_type_0_not_proceeding_with_this_definition,
_workingDefinition.order);
return ErrorNumber.NotSupported;
@@ -144,7 +146,7 @@ public sealed partial class CPM
if(_workingDefinition.sides == 1 ||
string.Compare(_workingDefinition.order, "SIDES", StringComparison.InvariantCultureIgnoreCase) == 0)
{
AaruConsole.DebugWriteLine("CP/M Plugin", "Deinterleaving whole volume.");
AaruConsole.DebugWriteLine("CP/M Plugin", Localization.Deinterleaving_whole_volume);
for(int p = 0; p <= (int)(partition.End - partition.Start); p++)
{
@@ -169,7 +171,7 @@ public sealed partial class CPM
int sectorsPerBlock = 0;
Dictionary<ulong, byte[]> allocationBlocks = new();
AaruConsole.DebugWriteLine("CP/M Plugin", "Creating allocation blocks.");
AaruConsole.DebugWriteLine("CP/M Plugin", Localization.Creating_allocation_blocks);
// For each volume sector
for(ulong a = 0; a < (ulong)deinterleavedSectors.Count; a++)
@@ -204,7 +206,7 @@ public sealed partial class CPM
allocationBlocks.Add(blockNo++, sector);
}
AaruConsole.DebugWriteLine("CP/M Plugin", "Reading directory.");
AaruConsole.DebugWriteLine("CP/M Plugin", Localization.Reading_directory);
int dirOff;
int dirSectors = (_dpb.drm + 1) * 32 / _workingDefinition.bytesPerSector;
@@ -243,7 +245,7 @@ public sealed partial class CPM
_labelUpdateDate = null;
_passwordCache = new Dictionary<string, byte[]>();
AaruConsole.DebugWriteLine("CP/M Plugin", "Traversing directory.");
AaruConsole.DebugWriteLine("CP/M Plugin", Localization.Traversing_directory);
// For each directory entry
for(int dOff = 0; dOff < directory.Length; dOff += 32)
@@ -777,7 +779,7 @@ public sealed partial class CPM
_cpmStat.Files = (ulong)_fileCache.Count;
_cpmStat.FreeBlocks = _cpmStat.Blocks - (ulong)usedBlocks;
_cpmStat.PluginId = Id;
_cpmStat.Type = "CP/M filesystem";
_cpmStat.Type = FS_TYPE;
// Generate XML info
XmlFsType = new FileSystemType
@@ -788,7 +790,7 @@ public sealed partial class CPM
FilesSpecified = true,
FreeClusters = _cpmStat.FreeBlocks,
FreeClustersSpecified = true,
Type = "CP/M filesystem"
Type = FS_TYPE
};
if(_labelCreationDate != null)

View File

@@ -59,11 +59,11 @@ public sealed class Cram : IFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Cram filesystem";
public string Name => Localization.Cram_Name;
/// <inheritdoc />
public Guid Id => new("F8F6E46F-7A2A-48E3-9C0A-46AF4DC29E09");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -111,20 +111,23 @@ public sealed class Cram : IFilesystem
var sbInformation = new StringBuilder();
sbInformation.AppendLine("Cram file system");
sbInformation.AppendLine(littleEndian ? "Little-endian" : "Big-endian");
sbInformation.AppendFormat("Volume edition {0}", crSb.edition).AppendLine();
sbInformation.AppendFormat("Volume name: {0}", StringHandlers.CToString(crSb.name, Encoding)).AppendLine();
sbInformation.AppendFormat("Volume has {0} bytes", crSb.size).AppendLine();
sbInformation.AppendFormat("Volume has {0} blocks", crSb.blocks).AppendLine();
sbInformation.AppendFormat("Volume has {0} files", crSb.files).AppendLine();
sbInformation.AppendLine(Localization.Cram_file_system);
sbInformation.AppendLine(littleEndian ? Localization.Little_endian : Localization.Big_endian);
sbInformation.AppendFormat(Localization.Volume_edition_0, crSb.edition).AppendLine();
sbInformation.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(crSb.name, Encoding)).
AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_bytes, crSb.size).AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_blocks, crSb.blocks).AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_files, crSb.files).AppendLine();
information = sbInformation.ToString();
XmlFsType = new FileSystemType
{
VolumeName = StringHandlers.CToString(crSb.name, Encoding),
Type = "Cram file system",
Type = FS_TYPE,
Clusters = crSb.blocks,
Files = crSb.files,
FilesSpecified = true,
@@ -133,6 +136,8 @@ public sealed class Cram : IFilesystem
};
}
const string FS_TYPE = "cramfs";
enum CramCompression : ushort
{
Zlib = 1, Lzma = 2, Lzo = 3,

View File

@@ -46,6 +46,7 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of the filesystem described in ECMA-67</summary>
public sealed class ECMA67 : IFilesystem
{
const string FS_TYPE = "ecma67";
readonly byte[] _magic =
{
0x56, 0x4F, 0x4C
@@ -54,13 +55,13 @@ public sealed class ECMA67 : IFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "ECMA-67";
public string Name => Localization.ECMA67_Name;
/// <inheritdoc />
public Guid Id => new("62A2D44A-CBC1-4377-B4B6-28C5C92034A1");
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -98,14 +99,16 @@ public sealed class ECMA67 : IFilesystem
VolumeLabel vol = Marshal.ByteArrayToStructureLittleEndian<VolumeLabel>(sector);
sbInformation.AppendLine("ECMA-67");
sbInformation.AppendLine(Localization.ECMA_67);
sbInformation.AppendFormat("Volume name: {0}", Encoding.ASCII.GetString(vol.volumeIdentifier)).AppendLine();
sbInformation.AppendFormat("Volume owner: {0}", Encoding.ASCII.GetString(vol.owner)).AppendLine();
sbInformation.AppendFormat(Localization.Volume_name_0, Encoding.ASCII.GetString(vol.volumeIdentifier)).
AppendLine();
sbInformation.AppendFormat(Localization.Volume_owner_0, Encoding.ASCII.GetString(vol.owner)).AppendLine();
XmlFsType = new FileSystemType
{
Type = "ECMA-67",
Type = FS_TYPE,
ClusterSize = 256,
Clusters = partition.End - partition.Start + 1,
VolumeName = Encoding.ASCII.GetString(vol.volumeIdentifier)

View File

@@ -51,16 +51,18 @@ public sealed class EFS : IFilesystem
const uint EFS_MAGIC = 0x00072959;
const uint EFS_MAGIC_NEW = 0x0007295A;
const string FS_TYPE = "efs";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Extent File System Plugin";
public string Name => Localization.EFS_Name;
/// <inheritdoc />
public Guid Id => new("52A43F90-9AF3-4391-ADFE-65598DEEABAB");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -90,8 +92,8 @@ public sealed class EFS : IFilesystem
Superblock sb = Marshal.ByteArrayToStructureBigEndian<Superblock>(sbpiece);
AaruConsole.DebugWriteLine("EFS plugin", "magic at 0x{0:X3} = 0x{1:X8} (expected 0x{2:X8} or 0x{3:X8})",
0x200, sb.sb_magic, EFS_MAGIC, EFS_MAGIC_NEW);
AaruConsole.DebugWriteLine("EFS plugin", Localization.magic_at_0_equals_1_expected_2_or_3, 0x200,
sb.sb_magic, EFS_MAGIC, EFS_MAGIC_NEW);
if(sb.sb_magic is EFS_MAGIC or EFS_MAGIC_NEW)
return true;
@@ -113,8 +115,8 @@ public sealed class EFS : IFilesystem
Superblock sb = Marshal.ByteArrayToStructureBigEndian<Superblock>(sector);
AaruConsole.DebugWriteLine("EFS plugin", "magic at {0} = 0x{1:X8} (expected 0x{2:X8} or 0x{3:X8})", 1,
sb.sb_magic, EFS_MAGIC, EFS_MAGIC_NEW);
AaruConsole.DebugWriteLine("EFS plugin", Localization.magic_at_0_equals_1_expected_2_or_3, 1, sb.sb_magic,
EFS_MAGIC, EFS_MAGIC_NEW);
if(sb.sb_magic is EFS_MAGIC or EFS_MAGIC_NEW)
return true;
@@ -156,8 +158,8 @@ public sealed class EFS : IFilesystem
efsSb = Marshal.ByteArrayToStructureBigEndian<Superblock>(sbpiece);
AaruConsole.DebugWriteLine("EFS plugin", "magic at 0x{0:X3} = 0x{1:X8} (expected 0x{2:X8} or 0x{3:X8})",
0x200, efsSb.sb_magic, EFS_MAGIC, EFS_MAGIC_NEW);
AaruConsole.DebugWriteLine("EFS plugin", Localization.magic_at_0_X3_equals_1_expected_2_or_3, 0x200,
efsSb.sb_magic, EFS_MAGIC, EFS_MAGIC_NEW);
}
else
{
@@ -176,7 +178,7 @@ public sealed class EFS : IFilesystem
efsSb = Marshal.ByteArrayToStructureBigEndian<Superblock>(sector);
AaruConsole.DebugWriteLine("EFS plugin", "magic at {0} = 0x{1:X8} (expected 0x{2:X8} or 0x{3:X8})", 1,
AaruConsole.DebugWriteLine("EFS plugin", Localization.magic_at_0_equals_1_expected_2_or_3, 1,
efsSb.sb_magic, EFS_MAGIC, EFS_MAGIC_NEW);
}
@@ -186,44 +188,44 @@ public sealed class EFS : IFilesystem
var sb = new StringBuilder();
sb.AppendLine("SGI extent filesystem");
sb.AppendLine(Localization.SGI_extent_filesystem);
if(efsSb.sb_magic == EFS_MAGIC_NEW)
sb.AppendLine("New version");
sb.AppendLine(Localization.New_version);
sb.AppendFormat("Filesystem size: {0} basic blocks", efsSb.sb_size).AppendLine();
sb.AppendFormat("First cylinder group starts at block {0}", efsSb.sb_firstcg).AppendLine();
sb.AppendFormat("Cylinder group size: {0} basic blocks", efsSb.sb_cgfsize).AppendLine();
sb.AppendFormat("{0} inodes per cylinder group", efsSb.sb_cgisize).AppendLine();
sb.AppendFormat("{0} sectors per track", efsSb.sb_sectors).AppendLine();
sb.AppendFormat("{0} heads per cylinder", efsSb.sb_heads).AppendLine();
sb.AppendFormat("{0} cylinder groups", efsSb.sb_ncg).AppendLine();
sb.AppendFormat("Volume created on {0}", DateHandlers.UnixToDateTime(efsSb.sb_time)).AppendLine();
sb.AppendFormat("{0} bytes on bitmap", efsSb.sb_bmsize).AppendLine();
sb.AppendFormat("{0} free blocks", efsSb.sb_tfree).AppendLine();
sb.AppendFormat("{0} free inodes", efsSb.sb_tinode).AppendLine();
sb.AppendFormat(Localization.Filesystem_size_0_basic_blocks, efsSb.sb_size).AppendLine();
sb.AppendFormat(Localization.First_cylinder_group_starts_at_block_0, efsSb.sb_firstcg).AppendLine();
sb.AppendFormat(Localization.Cylinder_group_size_0_basic_blocks, efsSb.sb_cgfsize).AppendLine();
sb.AppendFormat(Localization._0_inodes_per_cylinder_group, efsSb.sb_cgisize).AppendLine();
sb.AppendFormat(Localization._0_sectors_per_track, efsSb.sb_sectors).AppendLine();
sb.AppendFormat(Localization._0_heads_per_cylinder, efsSb.sb_heads).AppendLine();
sb.AppendFormat(Localization._0_cylinder_groups, efsSb.sb_ncg).AppendLine();
sb.AppendFormat(Localization.Volume_created_on_0, DateHandlers.UnixToDateTime(efsSb.sb_time)).AppendLine();
sb.AppendFormat(Localization._0_bytes_on_bitmap, efsSb.sb_bmsize).AppendLine();
sb.AppendFormat(Localization._0_free_blocks, efsSb.sb_tfree).AppendLine();
sb.AppendFormat(Localization._0_free_inodes, efsSb.sb_tinode).AppendLine();
if(efsSb.sb_bmblock > 0)
sb.AppendFormat("Bitmap resides at block {0}", efsSb.sb_bmblock).AppendLine();
sb.AppendFormat(Localization.Bitmap_resides_at_block_0, efsSb.sb_bmblock).AppendLine();
if(efsSb.sb_replsb > 0)
sb.AppendFormat("Replacement superblock resides at block {0}", efsSb.sb_replsb).AppendLine();
sb.AppendFormat(Localization.Replacement_superblock_resides_at_block_0, efsSb.sb_replsb).AppendLine();
if(efsSb.sb_lastinode > 0)
sb.AppendFormat("Last inode allocated: {0}", efsSb.sb_lastinode).AppendLine();
sb.AppendFormat(Localization.Last_inode_allocated_0, efsSb.sb_lastinode).AppendLine();
if(efsSb.sb_dirty > 0)
sb.AppendLine("Volume is dirty");
sb.AppendLine(Localization.Volume_is_dirty);
sb.AppendFormat("Checksum: 0x{0:X8}", efsSb.sb_checksum).AppendLine();
sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(efsSb.sb_fname, Encoding)).AppendLine();
sb.AppendFormat("Volume pack: {0}", StringHandlers.CToString(efsSb.sb_fpack, Encoding)).AppendLine();
sb.AppendFormat(Localization.Checksum_0_X8, efsSb.sb_checksum).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(efsSb.sb_fname, Encoding)).AppendLine();
sb.AppendFormat(Localization.Volume_pack_0, StringHandlers.CToString(efsSb.sb_fpack, Encoding)).AppendLine();
information = sb.ToString();
XmlFsType = new FileSystemType
{
Type = "Extent File System",
Type = FS_TYPE,
ClusterSize = 512,
Clusters = (ulong)efsSb.sb_size,
FreeClusters = (ulong)efsSb.sb_tfree,

View File

@@ -62,11 +62,11 @@ public sealed class F2FS : IFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "F2FS Plugin";
public string Name => Localization.F2FS_Name;
/// <inheritdoc />
public Guid Id => new("82B0920F-5F0D-4063-9F57-ADE0AE02ECE5");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -135,36 +135,36 @@ public sealed class F2FS : IFilesystem
var sb = new StringBuilder();
sb.AppendLine("F2FS filesystem");
sb.AppendFormat("Version {0}.{1}", f2fsSb.major_ver, f2fsSb.minor_ver).AppendLine();
sb.AppendFormat("{0} bytes per sector", 1 << (int)f2fsSb.log_sectorsize).AppendLine();
sb.AppendLine(Localization.F2FS_filesystem);
sb.AppendFormat(Localization.Version_0_1, f2fsSb.major_ver, f2fsSb.minor_ver).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_sector, 1 << (int)f2fsSb.log_sectorsize).AppendLine();
sb.AppendFormat("{0} sectors ({1} bytes) per block", 1 << (int)f2fsSb.log_sectors_per_block,
1 << (int)f2fsSb.log_blocksize).AppendLine();
sb.AppendFormat(Localization._0_sectors_1_bytes_per_block, 1 << (int)f2fsSb.log_sectors_per_block,
1 << (int)f2fsSb.log_blocksize).AppendLine();
sb.AppendFormat("{0} blocks per segment", f2fsSb.log_blocks_per_seg).AppendLine();
sb.AppendFormat("{0} blocks in volume", f2fsSb.block_count).AppendLine();
sb.AppendFormat("{0} segments per section", f2fsSb.segs_per_sec).AppendLine();
sb.AppendFormat("{0} sections per zone", f2fsSb.secs_per_zone).AppendLine();
sb.AppendFormat("{0} sections", f2fsSb.section_count).AppendLine();
sb.AppendFormat("{0} segments", f2fsSb.segment_count).AppendLine();
sb.AppendFormat("Root directory resides on inode {0}", f2fsSb.root_ino).AppendLine();
sb.AppendFormat("Volume UUID: {0}", f2fsSb.uuid).AppendLine();
sb.AppendFormat(Localization._0_blocks_per_segment, f2fsSb.log_blocks_per_seg).AppendLine();
sb.AppendFormat(Localization._0_blocks_in_volume, f2fsSb.block_count).AppendLine();
sb.AppendFormat(Localization._0_segments_per_section, f2fsSb.segs_per_sec).AppendLine();
sb.AppendFormat(Localization._0_sections_per_zone, f2fsSb.secs_per_zone).AppendLine();
sb.AppendFormat(Localization._0_sections, f2fsSb.section_count).AppendLine();
sb.AppendFormat(Localization._0_segments, f2fsSb.segment_count).AppendLine();
sb.AppendFormat(Localization.Root_directory_resides_on_inode_0, f2fsSb.root_ino).AppendLine();
sb.AppendFormat(Localization.Volume_UUID_0, f2fsSb.uuid).AppendLine();
sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(f2fsSb.volume_name, Encoding.Unicode, true)).
sb.AppendFormat(Localization.Volume_name_0,
StringHandlers.CToString(f2fsSb.volume_name, Encoding.Unicode, true)).AppendLine();
sb.AppendFormat(Localization.Volume_last_mounted_on_kernel_version_0, StringHandlers.CToString(f2fsSb.version)).
AppendLine();
sb.AppendFormat("Volume last mounted on kernel version: {0}", StringHandlers.CToString(f2fsSb.version)).
AppendLine();
sb.AppendFormat("Volume created on kernel version: {0}", StringHandlers.CToString(f2fsSb.init_version)).
sb.AppendFormat(Localization.Volume_created_on_kernel_version_0, StringHandlers.CToString(f2fsSb.init_version)).
AppendLine();
information = sb.ToString();
XmlFsType = new FileSystemType
{
Type = "F2FS filesystem",
Type = FS_TYPE,
SystemIdentifier = Encoding.ASCII.GetString(f2fsSb.version),
Clusters = f2fsSb.block_count,
ClusterSize = (uint)(1 << (int)f2fsSb.log_blocksize),
@@ -174,6 +174,8 @@ public sealed class F2FS : IFilesystem
};
}
const string FS_TYPE = "f2fs";
[StructLayout(LayoutKind.Sequential, Pack = 1), SuppressMessage("ReSharper", "InconsistentNaming")]
readonly struct Superblock
{

View File

@@ -82,7 +82,7 @@ public sealed partial class FAT
if(useHumanBpb)
{
AaruConsole.DebugWriteLine("FAT plugin", "Using Human68k BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_Human68k_BPB);
fakeBpb.jump = humanBpb.jump;
fakeBpb.oem_name = humanBpb.oem_name;
@@ -190,7 +190,7 @@ public sealed partial class FAT
fat32Bpb is { spfat: 0, signature: 0x29 } &&
Encoding.ASCII.GetString(fat32Bpb.fs_type) == "FAT32 ")
{
AaruConsole.DebugWriteLine("FAT plugin", "Using FAT32 BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_FAT32_BPB);
minBootNearJump = 0x58;
return BpbKind.LongFat32;
@@ -200,7 +200,7 @@ public sealed partial class FAT
correctSpcFat32Short &&
shortFat32Bpb is { fats_no: <= 2, sectors: 0 } and { spfat: 0, signature: 0x28 })
{
AaruConsole.DebugWriteLine("FAT plugin", "Using short FAT32 BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_short_FAT32_BPB);
minBootNearJump = 0x57;
@@ -214,7 +214,7 @@ public sealed partial class FAT
msxBpb.spfat > 0 &&
Encoding.ASCII.GetString(msxBpb.vol_id) == "VOL_ID")
{
AaruConsole.DebugWriteLine("FAT plugin", "Using MSX BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_MSX_BPB);
useMsxBpb = true;
}
else if(bitsInBpsApricot == 1 &&
@@ -224,7 +224,7 @@ public sealed partial class FAT
apricotBpb.mainBPB.spfat > 0 &&
apricotBpb.partitionCount == 0)
{
AaruConsole.DebugWriteLine("FAT plugin", "Using Apricot BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_Apricot_BPB);
useApricotBpb = true;
}
else if(bitsInBpsDos40 == 1 &&
@@ -238,13 +238,13 @@ public sealed partial class FAT
if(ebpb.big_sectors <= partition.End - partition.Start + 1)
if(ebpb.signature == 0x29 || andosOemCorrect)
{
AaruConsole.DebugWriteLine("FAT plugin", "Using DOS 4.0 BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_DOS_4_0_BPB);
useExtendedBpb = true;
minBootNearJump = 0x3C;
}
else
{
AaruConsole.DebugWriteLine("FAT plugin", "Using DOS 3.4 BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_DOS_3_4_BPB);
userShortExtendedBpb = true;
minBootNearJump = 0x29;
}
@@ -252,13 +252,13 @@ public sealed partial class FAT
else if(ebpb.sectors <= partition.End - partition.Start + 1)
if(ebpb.signature == 0x29 || andosOemCorrect)
{
AaruConsole.DebugWriteLine("FAT plugin", "Using DOS 4.0 BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_DOS_4_0_BPB);
useExtendedBpb = true;
minBootNearJump = 0x3C;
}
else
{
AaruConsole.DebugWriteLine("FAT plugin", "Using DOS 3.4 BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_DOS_3_4_BPB);
userShortExtendedBpb = true;
minBootNearJump = 0x29;
}
@@ -273,7 +273,7 @@ public sealed partial class FAT
dos33Bpb.big_sectors > 0 &&
dos33Bpb.big_sectors <= partition.End - partition.Start + 1)
{
AaruConsole.DebugWriteLine("FAT plugin", "Using DOS 3.3 BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_DOS_3_3_BPB);
useDos33Bpb = true;
minBootNearJump = 0x22;
}
@@ -286,12 +286,12 @@ public sealed partial class FAT
Encoding.ASCII.GetString(dos33Bpb.oem_name) != "NEXT ") ||
partition.Type is "GEM" or "BGM")
{
AaruConsole.DebugWriteLine("FAT plugin", "Using Atari BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_Atari_BPB);
useAtariBpb = true;
}
else
{
AaruConsole.DebugWriteLine("FAT plugin", "Using DOS 3.3 BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_DOS_3_3_BPB);
useDos33Bpb = true;
minBootNearJump = 0x22;
}
@@ -300,7 +300,7 @@ public sealed partial class FAT
if(dos32Bpb.hsectors <= partition.Start &&
dos32Bpb.hsectors + dos32Bpb.sectors == dos32Bpb.total_sectors)
{
AaruConsole.DebugWriteLine("FAT plugin", "Using DOS 3.2 BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_DOS_3_2_BPB);
useDos32Bpb = true;
minBootNearJump = 0x1E;
}
@@ -310,12 +310,12 @@ public sealed partial class FAT
(atariBpb.jump[0] == 0xE9 && atariBpb.jump[1] == 0x00 &&
Encoding.ASCII.GetString(dos33Bpb.oem_name) != "NEXT "))
{
AaruConsole.DebugWriteLine("FAT plugin", "Using Atari BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_Atari_BPB);
useAtariBpb = true;
}
else
{
AaruConsole.DebugWriteLine("FAT plugin", "Using DOS 3.0 BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_DOS_3_0_BPB);
useDos3Bpb = true;
minBootNearJump = 0x1C;
}
@@ -325,12 +325,12 @@ public sealed partial class FAT
(atariBpb.jump[0] == 0xE9 && atariBpb.jump[1] == 0x00 &&
Encoding.ASCII.GetString(dos33Bpb.oem_name) != "NEXT "))
{
AaruConsole.DebugWriteLine("FAT plugin", "Using Atari BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_Atari_BPB);
useAtariBpb = true;
}
else
{
AaruConsole.DebugWriteLine("FAT plugin", "Using DOS 2.0 BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_DOS_2_0_BPB);
useDos2Bpb = true;
minBootNearJump = 0x16;
}
@@ -400,7 +400,7 @@ public sealed partial class FAT
fat1Sector0[1] == 0xFF &&
validRootDir)
{
AaruConsole.DebugWriteLine("FAT plugin", "Using DEC Rainbow hardcoded BPB.");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_DEC_Rainbow_hardcoded_BPB);
fakeBpb.bps = 512;
fakeBpb.spc = 1;
fakeBpb.rsectors = 20;
@@ -440,7 +440,7 @@ public sealed partial class FAT
case 0xE5:
if(imagePlugin.Info is { Sectors: 2002, SectorSize: 128 })
{
AaruConsole.DebugWriteLine("FAT plugin", "Using hardcoded BPB.");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_hardcoded_BPB);
fakeBpb.bps = 128;
fakeBpb.spc = 4;
fakeBpb.rsectors = 1;
@@ -459,7 +459,7 @@ public sealed partial class FAT
switch(imagePlugin.Info.Sectors)
{
case 4004 when imagePlugin.Info.SectorSize == 128:
AaruConsole.DebugWriteLine("FAT plugin", "Using hardcoded BPB.");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_hardcoded_BPB);
fakeBpb.bps = 128;
fakeBpb.spc = 4;
fakeBpb.rsectors = 4;
@@ -474,7 +474,7 @@ public sealed partial class FAT
break;
case 2002 when imagePlugin.Info.SectorSize == 128:
AaruConsole.DebugWriteLine("FAT plugin", "Using hardcoded BPB.");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_hardcoded_BPB);
fakeBpb.bps = 128;
fakeBpb.spc = 4;
fakeBpb.rsectors = 4;
@@ -495,7 +495,7 @@ public sealed partial class FAT
switch(imagePlugin.Info.Sectors)
{
case 320 when imagePlugin.Info.SectorSize == 512:
AaruConsole.DebugWriteLine("FAT plugin", "Using hardcoded BPB for 5.25\" SSDD.");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_hardcoded_BPB_for_5_25_SSDD);
fakeBpb.bps = 512;
fakeBpb.spc = 1;
fakeBpb.rsectors = 1;
@@ -510,7 +510,7 @@ public sealed partial class FAT
break;
case 2002 when imagePlugin.Info.SectorSize == 128:
AaruConsole.DebugWriteLine("FAT plugin", "Using hardcoded BPB.");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_hardcoded_BPB);
fakeBpb.bps = 128;
fakeBpb.spc = 4;
fakeBpb.rsectors = 1;
@@ -525,7 +525,7 @@ public sealed partial class FAT
break;
case 1232 when imagePlugin.Info.SectorSize == 1024:
AaruConsole.DebugWriteLine("FAT plugin", "Using hardcoded BPB.");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_hardcoded_BPB);
fakeBpb.bps = 1024;
fakeBpb.spc = 1;
fakeBpb.rsectors = 1;
@@ -540,7 +540,7 @@ public sealed partial class FAT
break;
case 616 when imagePlugin.Info.SectorSize == 1024:
AaruConsole.DebugWriteLine("FAT plugin", "Using hardcoded BPB.");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_hardcoded_BPB);
fakeBpb.bps = 1024;
fakeBpb.spc = 1;
fakeBpb.rsectors = 1;
@@ -554,7 +554,7 @@ public sealed partial class FAT
break;
case 720 when imagePlugin.Info.SectorSize == 128:
AaruConsole.DebugWriteLine("FAT plugin", "Using hardcoded BPB.");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_hardcoded_BPB);
fakeBpb.bps = 128;
fakeBpb.spc = 2;
fakeBpb.rsectors = 54;
@@ -569,7 +569,7 @@ public sealed partial class FAT
break;
case 640 when imagePlugin.Info.SectorSize == 512:
AaruConsole.DebugWriteLine("FAT plugin", "Using hardcoded BPB for 5.25\" DSDD.");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_hardcoded_BPB_for_5_25_DSDD);
fakeBpb.bps = 512;
fakeBpb.spc = 2;
fakeBpb.rsectors = 1;
@@ -589,7 +589,7 @@ public sealed partial class FAT
case 0xFF:
if(imagePlugin.Info is { Sectors: 640, SectorSize: 512 })
{
AaruConsole.DebugWriteLine("FAT plugin", "Using hardcoded BPB for 5.25\" DSDD.");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Using_hardcoded_BPB_for_5_25_DSDD);
fakeBpb.bps = 512;
fakeBpb.spc = 2;
fakeBpb.rsectors = 1;

View File

@@ -220,4 +220,9 @@ public sealed partial class FAT
/// <summary>FAT32.IFS &gt;= 0.97 indicator for critical EAs present</summary>
CriticalEa = 0x80
}
const string FS_TYPE_FAT_PLUS = "fatplus";
const string FS_TYPE_FAT32 = "fat32";
const string FS_TYPE_FAT16 = "fat16";
const string FS_TYPE_FAT12 = "fat12";
}

View File

@@ -247,7 +247,7 @@ public sealed partial class FAT
if(name == "" &&
extension == "")
{
AaruConsole.DebugWriteLine("FAT filesystem", "Found empty filename in {0}", path);
AaruConsole.DebugWriteLine("FAT filesystem", Localization.Found_empty_filename_in_0, path);
if(!_debug ||
dirent is { size: > 0, start_cluster: 0 })

View File

@@ -72,11 +72,11 @@ public sealed partial class FAT : IReadOnlyFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Microsoft File Allocation Table";
public string Name => Localization.FAT_Name;
/// <inheritdoc />
public Guid Id => new("33513B2C-0D26-0D2D-32C3-79D8611158E0");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public IEnumerable<(string name, Type type, string description)> SupportedOptions =>
@@ -86,19 +86,19 @@ public sealed partial class FAT : IReadOnlyFilesystem
public Dictionary<string, string> Namespaces => new()
{
{
"dos", "DOS (8.3 all uppercase)"
"dos", Localization.DOS_8_3_all_uppercase
},
{
"nt", "Windows NT (8.3 mixed case)"
"nt", Localization.Windows_NT_8_3_mixed_case
},
{
"os2", "OS/2 .LONGNAME extended attribute"
"os2", Localization.OS2_LONGNAME_extended_attribute
},
{
"ecs", "Use LFN when available with fallback to .LONGNAME (default)"
"ecs", Localization.Use_LFN_when_available_with_fallback_to_LONGNAME_default
},
{
"lfn", "Long file names"
"lfn", Localization.Long_file_names
}
};

View File

@@ -407,7 +407,7 @@ public sealed partial class FAT
fat2SectorNo == 0)
return false;
AaruConsole.DebugWriteLine("FAT plugin", "2nd fat starts at = {0}", fat2SectorNo);
AaruConsole.DebugWriteLine("FAT plugin", Localization.Second_fat_starts_at_0, fat2SectorNo);
errno = imagePlugin.ReadSector(fat2SectorNo, out byte[] fat2Sector);
@@ -489,95 +489,99 @@ public sealed partial class FAT
if(fat32Bpb.version != 0)
{
sb.AppendLine("FAT+");
XmlFsType.Type = "FAT+";
sb.AppendLine(Localization.FAT_Plus);
XmlFsType.Type = FS_TYPE_FAT_PLUS;
}
else
{
sb.AppendLine("Microsoft FAT32");
XmlFsType.Type = "FAT32";
sb.AppendLine(Localization.Microsoft_FAT32);
XmlFsType.Type = FS_TYPE_FAT32;
}
if(fat32Bpb.oem_name != null)
if(fat32Bpb.oem_name[5] == 0x49 &&
fat32Bpb.oem_name[6] == 0x48 &&
fat32Bpb.oem_name[7] == 0x43)
sb.AppendLine("Volume has been modified by Windows 9x/Me Volume Tracker.");
sb.AppendLine(Localization.Volume_has_been_modified_by_Windows_9x_Me_Volume_Tracker);
else
XmlFsType.SystemIdentifier = StringHandlers.CToString(fat32Bpb.oem_name);
if(!string.IsNullOrEmpty(XmlFsType.SystemIdentifier))
sb.AppendFormat("OEM Name: {0}", XmlFsType.SystemIdentifier.Trim()).AppendLine();
sb.AppendFormat(Localization.OEM_name_0, XmlFsType.SystemIdentifier.Trim()).AppendLine();
sb.AppendFormat("{0} bytes per sector.", fat32Bpb.bps).AppendLine();
sb.AppendFormat("{0} sectors per cluster.", fat32Bpb.spc).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_sector, fat32Bpb.bps).AppendLine();
sb.AppendFormat(Localization._0_sectors_per_cluster, fat32Bpb.spc).AppendLine();
XmlFsType.ClusterSize = (uint)(fat32Bpb.bps * fat32Bpb.spc);
sb.AppendFormat("{0} sectors reserved between BPB and FAT.", fat32Bpb.rsectors).AppendLine();
sb.AppendFormat(Localization._0_sectors_reserved_between_BPB_and_FAT, fat32Bpb.rsectors).AppendLine();
if(fat32Bpb is { big_sectors: 0, signature: 0x28 })
{
sb.AppendFormat("{0} sectors on volume ({1} bytes).", shortFat32Bpb.huge_sectors,
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, shortFat32Bpb.huge_sectors,
shortFat32Bpb.huge_sectors * shortFat32Bpb.bps).AppendLine();
XmlFsType.Clusters = shortFat32Bpb.huge_sectors / shortFat32Bpb.spc;
}
else if(fat32Bpb.sectors == 0)
{
sb.AppendFormat("{0} sectors on volume ({1} bytes).", fat32Bpb.big_sectors,
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, fat32Bpb.big_sectors,
fat32Bpb.big_sectors * fat32Bpb.bps).AppendLine();
XmlFsType.Clusters = fat32Bpb.big_sectors / fat32Bpb.spc;
}
else
{
sb.AppendFormat("{0} sectors on volume ({1} bytes).", fat32Bpb.sectors,
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, fat32Bpb.sectors,
fat32Bpb.sectors * fat32Bpb.bps).AppendLine();
XmlFsType.Clusters = (ulong)(fat32Bpb.sectors / fat32Bpb.spc);
}
sb.AppendFormat("{0} clusters on volume.", XmlFsType.Clusters).AppendLine();
sb.AppendFormat("Media descriptor: 0x{0:X2}", fat32Bpb.media).AppendLine();
sb.AppendFormat("{0} sectors per FAT.", fat32Bpb.big_spfat).AppendLine();
sb.AppendFormat("{0} sectors per track.", fat32Bpb.sptrk).AppendLine();
sb.AppendFormat("{0} heads.", fat32Bpb.heads).AppendLine();
sb.AppendFormat("{0} hidden sectors before BPB.", fat32Bpb.hsectors).AppendLine();
sb.AppendFormat("Cluster of root directory: {0}", fat32Bpb.root_cluster).AppendLine();
sb.AppendFormat("Sector of FSINFO structure: {0}", fat32Bpb.fsinfo_sector).AppendLine();
sb.AppendFormat("Sector of backup FAT32 parameter block: {0}", fat32Bpb.backup_sector).AppendLine();
sb.AppendFormat("Drive number: 0x{0:X2}", fat32Bpb.drive_no).AppendLine();
sb.AppendFormat("Volume Serial Number: 0x{0:X8}", fat32Bpb.serial_no).AppendLine();
sb.AppendFormat(Localization._0_clusters_on_volume, XmlFsType.Clusters).AppendLine();
sb.AppendFormat(Localization.Media_descriptor_0, fat32Bpb.media).AppendLine();
sb.AppendFormat(Localization._0_sectors_per_FAT, fat32Bpb.big_spfat).AppendLine();
sb.AppendFormat(Localization._0_sectors_per_track, fat32Bpb.sptrk).AppendLine();
sb.AppendFormat(Localization._0_heads, fat32Bpb.heads).AppendLine();
sb.AppendFormat(Localization._0_hidden_sectors_before_BPB, fat32Bpb.hsectors).AppendLine();
sb.AppendFormat(Localization.Cluster_of_root_directory_0, fat32Bpb.root_cluster).AppendLine();
sb.AppendFormat(Localization.Sector_of_FSINFO_structure_0, fat32Bpb.fsinfo_sector).AppendLine();
sb.AppendFormat(Localization.Sector_of_backup_FAT32_parameter_block_0, fat32Bpb.backup_sector).
AppendLine();
sb.AppendFormat(Localization.Drive_number_0, fat32Bpb.drive_no).AppendLine();
sb.AppendFormat(Localization.Volume_Serial_Number_0, fat32Bpb.serial_no).AppendLine();
XmlFsType.VolumeSerial = $"{fat32Bpb.serial_no:X8}";
if((fat32Bpb.flags & 0xF8) == 0x00)
{
if((fat32Bpb.flags & 0x01) == 0x01)
{
sb.AppendLine("Volume should be checked on next mount.");
sb.AppendLine(Localization.Volume_should_be_checked_on_next_mount);
XmlFsType.Dirty = true;
}
if((fat32Bpb.flags & 0x02) == 0x02)
sb.AppendLine("Disk surface should be on next mount.");
sb.AppendLine(Localization.Disk_surface_should_be_on_next_mount);
}
if((fat32Bpb.mirror_flags & 0x80) == 0x80)
sb.AppendFormat("FATs are out of sync. FAT #{0} is in use.", fat32Bpb.mirror_flags & 0xF).
sb.AppendFormat(Localization.FATs_are_out_of_sync_FAT_0_is_in_use, fat32Bpb.mirror_flags & 0xF).
AppendLine();
else
sb.AppendLine("All copies of FAT are the same.");
sb.AppendLine(Localization.All_copies_of_FAT_are_the_same);
if((fat32Bpb.mirror_flags & 0x6F20) == 0x6F20)
sb.AppendLine("DR-DOS will boot this FAT32 using CHS.");
sb.AppendLine(Localization.DR_DOS_will_boot_this_FAT32_using_CHS);
else if((fat32Bpb.mirror_flags & 0x4F20) == 0x4F20)
sb.AppendLine("DR-DOS will boot this FAT32 using LBA.");
sb.AppendLine(Localization.DR_DOS_will_boot_this_FAT32_using_LBA);
if(fat32Bpb.signature == 0x29)
{
XmlFsType.VolumeName = StringHandlers.SpacePaddedToString(fat32Bpb.volume_label, Encoding);
XmlFsType.VolumeName = XmlFsType.VolumeName?.Replace("\0", "");
sb.AppendFormat("Filesystem type: {0}", Encoding.ASCII.GetString(fat32Bpb.fs_type)).AppendLine();
sb.AppendFormat(Localization.Filesystem_type_0, Encoding.ASCII.GetString(fat32Bpb.fs_type)).
AppendLine();
bootChk = Sha1Context.Data(fat32Bpb.boot_code, out _);
}
@@ -615,13 +619,13 @@ public sealed partial class FAT
{
if(fsInfo.free_clusters < 0xFFFFFFFF)
{
sb.AppendFormat("{0} free clusters", fsInfo.free_clusters).AppendLine();
sb.AppendFormat(Localization._0_free_clusters, fsInfo.free_clusters).AppendLine();
XmlFsType.FreeClusters = fsInfo.free_clusters;
XmlFsType.FreeClustersSpecified = true;
}
if(fsInfo.last_cluster is > 2 and < 0xFFFFFFFF)
sb.AppendFormat("Last allocated cluster {0}", fsInfo.last_cluster).AppendLine();
sb.AppendFormat(Localization.Last_allocated_cluster_0, fsInfo.last_cluster).AppendLine();
}
}
@@ -642,13 +646,13 @@ public sealed partial class FAT
XmlFsType.Bootable = true;
var atariSb = new StringBuilder();
atariSb.AppendFormat("cmdload will be loaded with value {0:X4}h",
atariSb.AppendFormat(Localization.cmdload_will_be_loaded_with_value_0,
BigEndianBitConverter.ToUInt16(bpbSector, 0x01E)).AppendLine();
atariSb.AppendFormat("Boot program will be loaded at address {0:X4}h", atariBpb.ldaaddr).
atariSb.AppendFormat(Localization.Boot_program_will_be_loaded_at_address_0, atariBpb.ldaaddr).
AppendLine();
atariSb.AppendFormat("FAT and directory will be cached at address {0:X4}h", atariBpb.fatbuf).
atariSb.AppendFormat(Localization.FAT_and_directory_will_be_cached_at_address_0, atariBpb.fatbuf).
AppendLine();
if(atariBpb.ldmode == 0)
@@ -666,10 +670,10 @@ public sealed partial class FAT
else
filename = fname + "." + extension;
atariSb.AppendFormat("Boot program resides in file \"{0}\"", filename).AppendLine();
atariSb.AppendFormat(Localization.Boot_program_resides_in_file_0, filename).AppendLine();
}
else
atariSb.AppendFormat("Boot program starts in sector {0} and is {1} sectors long ({2} bytes)",
atariSb.AppendFormat(Localization.Boot_program_starts_in_sector_0_and_is_1_sectors_long_2_bytes,
atariBpb.ssect, atariBpb.sectcnt, atariBpb.sectcnt * atariBpb.bps).
AppendLine();
@@ -785,35 +789,35 @@ public sealed partial class FAT
switch(bpbKind)
{
case BpbKind.Atari:
sb.AppendLine("Atari FAT12");
sb.AppendLine(Localization.Atari_FAT12);
break;
case BpbKind.Apricot:
sb.AppendLine("Apricot FAT12");
sb.AppendLine(Localization.Apricot_FAT12);
break;
case BpbKind.Human:
sb.AppendLine("Human68k FAT12");
sb.AppendLine(Localization.Human68k_FAT12);
break;
default:
sb.AppendLine("Microsoft FAT12");
sb.AppendLine(Localization.Microsoft_FAT12);
break;
}
XmlFsType.Type = "FAT12";
XmlFsType.Type = FS_TYPE_FAT12;
}
else if(isFat16)
{
sb.AppendLine(bpbKind switch
{
BpbKind.Atari => "Atari FAT16",
BpbKind.Human => "Human68k FAT16",
_ => "Microsoft FAT16"
BpbKind.Atari => Localization.Atari_FAT16,
BpbKind.Human => Localization.Human68k_FAT16,
_ => Localization.Microsoft_FAT16
});
XmlFsType.Type = "FAT16";
XmlFsType.Type = FS_TYPE_FAT12;
}
if(bpbKind == BpbKind.Atari)
@@ -821,7 +825,7 @@ public sealed partial class FAT
if(atariBpb.serial_no[0] == 0x49 &&
atariBpb.serial_no[1] == 0x48 &&
atariBpb.serial_no[2] == 0x43)
sb.AppendLine("Volume has been modified by Windows 9x/Me Volume Tracker.");
sb.AppendLine(Localization.Volume_has_been_modified_by_Windows_9x_Me_Volume_Tracker);
else
XmlFsType.VolumeSerial = $"{atariBpb.serial_no[0]:X2}{atariBpb.serial_no[1]:X2}{
atariBpb.serial_no[2]:X2}";
@@ -836,7 +840,7 @@ public sealed partial class FAT
if(fakeBpb.oem_name[5] == 0x49 &&
fakeBpb.oem_name[6] == 0x48 &&
fakeBpb.oem_name[7] == 0x43)
sb.AppendLine("Volume has been modified by Windows 9x/Me Volume Tracker.");
sb.AppendLine(Localization.Volume_has_been_modified_by_Windows_9x_Me_Volume_Tracker);
else
XmlFsType.SystemIdentifier = fakeBpb.oem_name[0] switch
{
@@ -868,74 +872,76 @@ public sealed partial class FAT
}
if(XmlFsType.SystemIdentifier != null)
sb.AppendFormat("OEM Name: {0}", XmlFsType.SystemIdentifier.Trim()).AppendLine();
sb.AppendFormat(Localization.OEM_name_0, XmlFsType.SystemIdentifier.Trim()).AppendLine();
sb.AppendFormat("{0} bytes per sector.", fakeBpb.bps).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_sector, fakeBpb.bps).AppendLine();
if(bpbKind != BpbKind.Human)
if(fakeBpb.sectors == 0)
sb.AppendFormat("{0} sectors on volume ({1} bytes).", fakeBpb.big_sectors,
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, fakeBpb.big_sectors,
fakeBpb.big_sectors * fakeBpb.bps).AppendLine();
else
sb.AppendFormat("{0} sectors on volume ({1} bytes).", fakeBpb.sectors,
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, fakeBpb.sectors,
fakeBpb.sectors * fakeBpb.bps).AppendLine();
else
sb.AppendFormat("{0} sectors on volume ({1} bytes).",
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes,
clusters * humanBpb.bpc / imagePlugin.Info.SectorSize, clusters * humanBpb.bpc).
AppendLine();
XmlFsType.Clusters = clusters;
sb.AppendFormat("{0} sectors per cluster.", fakeBpb.spc).AppendLine();
sb.AppendFormat("{0} clusters on volume.", XmlFsType.Clusters).AppendLine();
sb.AppendFormat(Localization._0_sectors_per_cluster, fakeBpb.spc).AppendLine();
sb.AppendFormat(Localization._0_clusters_on_volume, XmlFsType.Clusters).AppendLine();
XmlFsType.ClusterSize = (uint)(fakeBpb.bps * fakeBpb.spc);
sb.AppendFormat("{0} sectors reserved between BPB and FAT.", fakeBpb.rsectors).AppendLine();
sb.AppendFormat("{0} FATs.", fakeBpb.fats_no).AppendLine();
sb.AppendFormat("{0} entries on root directory.", fakeBpb.root_ent).AppendLine();
sb.AppendFormat(Localization._0_sectors_reserved_between_BPB_and_FAT, fakeBpb.rsectors).AppendLine();
sb.AppendFormat(Localization._0_FATs, fakeBpb.fats_no).AppendLine();
sb.AppendFormat(Localization._0_entries_on_root_directory, fakeBpb.root_ent).AppendLine();
if(fakeBpb.media > 0)
sb.AppendFormat("Media descriptor: 0x{0:X2}", fakeBpb.media).AppendLine();
sb.AppendFormat(Localization.Media_descriptor_0, fakeBpb.media).AppendLine();
sb.AppendFormat("{0} sectors per FAT.", fakeBpb.spfat).AppendLine();
sb.AppendFormat(Localization._0_sectors_per_FAT, fakeBpb.spfat).AppendLine();
if(fakeBpb.sptrk is > 0 and < 64 &&
fakeBpb.heads is > 0 and < 256)
{
sb.AppendFormat("{0} sectors per track.", fakeBpb.sptrk).AppendLine();
sb.AppendFormat("{0} heads.", fakeBpb.heads).AppendLine();
sb.AppendFormat(Localization._0_sectors_per_track, fakeBpb.sptrk).AppendLine();
sb.AppendFormat(Localization._0_heads, fakeBpb.heads).AppendLine();
}
if(fakeBpb.hsectors <= partition.Start)
sb.AppendFormat("{0} hidden sectors before BPB.", fakeBpb.hsectors).AppendLine();
sb.AppendFormat(Localization._0_hidden_sectors_before_BPB, fakeBpb.hsectors).AppendLine();
if(fakeBpb.signature is 0x28 or 0x29 || andosOemCorrect)
{
sb.AppendFormat("Drive number: 0x{0:X2}", fakeBpb.drive_no).AppendLine();
sb.AppendFormat(Localization.Drive_number_0, fakeBpb.drive_no).AppendLine();
if(XmlFsType.VolumeSerial != null)
sb.AppendFormat("Volume Serial Number: {0}", XmlFsType.VolumeSerial).AppendLine();
sb.AppendFormat(Localization.Volume_Serial_Number_0, XmlFsType.VolumeSerial).AppendLine();
if((fakeBpb.flags & 0xF8) == 0x00)
{
if((fakeBpb.flags & 0x01) == 0x01)
{
sb.AppendLine("Volume should be checked on next mount.");
sb.AppendLine(Localization.Volume_should_be_checked_on_next_mount);
XmlFsType.Dirty = true;
}
if((fakeBpb.flags & 0x02) == 0x02)
sb.AppendLine("Disk surface should be on next mount.");
sb.AppendLine(Localization.Disk_surface_should_be_on_next_mount);
}
if(fakeBpb.signature == 0x29 || andosOemCorrect)
{
XmlFsType.VolumeName = StringHandlers.SpacePaddedToString(fakeBpb.volume_label, Encoding);
XmlFsType.VolumeName = XmlFsType.VolumeName?.Replace("\0", "");
sb.AppendFormat("Filesystem type: {0}", Encoding.ASCII.GetString(fakeBpb.fs_type)).AppendLine();
sb.AppendFormat(Localization.Filesystem_type_0, Encoding.ASCII.GetString(fakeBpb.fs_type)).
AppendLine();
}
}
else if(bpbKind == BpbKind.Atari &&
XmlFsType.VolumeSerial != null)
sb.AppendFormat("Volume Serial Number: {0}", XmlFsType.VolumeSerial).AppendLine();
sb.AppendFormat(Localization.Volume_Serial_Number_0, XmlFsType.VolumeSerial).AppendLine();
bootChk = Sha1Context.Data(fakeBpb.boot_code, out _);
@@ -1028,26 +1034,26 @@ public sealed partial class FAT
XmlFsType.CreationDate = XmlFsType.CreationDate.AddMilliseconds(entry.ctime_ms * 10);
XmlFsType.CreationDateSpecified = true;
sb.AppendFormat("Volume created on {0}", XmlFsType.CreationDate).AppendLine();
sb.AppendFormat(Localization.Volume_created_on_0, XmlFsType.CreationDate).AppendLine();
}
if(entry is { mtime: > 0, mdate: > 0 })
{
XmlFsType.ModificationDate = DateHandlers.DosToDateTime(entry.mdate, entry.mtime);
XmlFsType.ModificationDateSpecified = true;
sb.AppendFormat("Volume last modified on {0}", XmlFsType.ModificationDate).AppendLine();
sb.AppendFormat(Localization.Volume_last_modified_on_0, XmlFsType.ModificationDate).AppendLine();
}
if(entry.adate > 0)
sb.AppendFormat("Volume last accessed on {0:d}", DateHandlers.DosToDateTime(entry.adate, 0)).
AppendLine();
sb.AppendFormat(Localization.Volume_last_accessed_on_0_d,
DateHandlers.DosToDateTime(entry.adate, 0)).AppendLine();
break;
}
}
if(!string.IsNullOrEmpty(XmlFsType.VolumeName))
sb.AppendFormat("Volume label: {0}", XmlFsType.VolumeName).AppendLine();
sb.AppendFormat(Localization.Volume_label_0, XmlFsType.VolumeName).AppendLine();
if(XmlFsType.Bootable)
{
@@ -1076,14 +1082,14 @@ public sealed partial class FAT
}
}
sb.AppendLine("Volume is bootable");
sb.AppendFormat("Boot code's SHA1: {0}", bootChk).AppendLine();
sb.AppendLine(Localization.Volume_is_bootable);
sb.AppendFormat(Localization.Boot_code_SHA1_0, bootChk).AppendLine();
string bootName = _knownBootHashes.FirstOrDefault(t => t.hash == bootChk).name;
if(string.IsNullOrWhiteSpace(bootName))
sb.AppendLine("Unknown boot code.");
sb.AppendLine(Localization.Unknown_boot_code);
else
sb.AppendFormat("Boot code corresponds to {0}", bootName).AppendLine();
sb.AppendFormat(Localization.Boot_code_corresponds_to_0, bootName).AppendLine();
}
information = sb.ToString();

View File

@@ -97,7 +97,7 @@ public sealed partial class FAT
default: return ErrorNumber.InvalidArgument;
}
AaruConsole.DebugWriteLine("FAT plugin", "Reading BPB");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Reading_BPB);
uint sectorsPerBpb = imagePlugin.Info.SectorSize < 512 ? 512 / imagePlugin.Info.SectorSize : 1;
@@ -166,7 +166,7 @@ public sealed partial class FAT
fat32Bpb.sptrk /= 4;
}
XmlFsType.Type = fat32Bpb.version != 0 ? "FAT+" : "FAT32";
XmlFsType.Type = fat32Bpb.version != 0 ? FS_TYPE_FAT_PLUS : FS_TYPE_FAT32;
if(fat32Bpb.oem_name != null &&
(fat32Bpb.oem_name[5] != 0x49 || fat32Bpb.oem_name[6] != 0x48 || fat32Bpb.oem_name[7] != 0x43))
@@ -377,9 +377,9 @@ public sealed partial class FAT
}
if(_fat12)
XmlFsType.Type = "FAT12";
XmlFsType.Type = FS_TYPE_FAT12;
else if(_fat16)
XmlFsType.Type = "FAT16";
XmlFsType.Type = FS_TYPE_FAT16;
if(bpbKind == BpbKind.Atari)
{
@@ -702,7 +702,7 @@ public sealed partial class FAT
if(name == "" &&
extension == "")
{
AaruConsole.DebugWriteLine("FAT filesystem", "Found empty filename in root directory");
AaruConsole.DebugWriteLine("FAT filesystem", Localization.Found_empty_filename_in_root_directory);
if(!_debug ||
entry is { size: > 0, start_cluster: 0 })
@@ -773,49 +773,15 @@ public sealed partial class FAT
switch(bpbKind)
{
case BpbKind.Hardcoded:
_statfs.Type = $"Microsoft FAT{(_fat16 ? "16" : "12")}";
break;
case BpbKind.Atari:
_statfs.Type = $"Atari FAT{(_fat16 ? "16" : "12")}";
break;
case BpbKind.Msx:
_statfs.Type = $"MSX FAT{(_fat16 ? "16" : "12")}";
break;
case BpbKind.Dos2:
case BpbKind.Dos3:
case BpbKind.Dos32:
case BpbKind.Dos33:
case BpbKind.ShortExtended:
case BpbKind.Extended:
_statfs.Type = $"Microsoft FAT{(_fat16 ? "16" : "12")}";
break;
case BpbKind.ShortFat32:
case BpbKind.LongFat32:
_statfs.Type = XmlFsType.Type == "FAT+" ? "FAT+" : "Microsoft FAT32";
_statfs.Type = XmlFsType.Type == FS_TYPE_FAT_PLUS ? FS_TYPE_FAT_PLUS : FS_TYPE_FAT32;
break;
case BpbKind.Andos:
_statfs.Type = $"ANDOS FAT{(_fat16 ? "16" : "12")}";
default:
_statfs.Type = _fat16 ? FS_TYPE_FAT16 : FS_TYPE_FAT12;
break;
case BpbKind.Apricot:
_statfs.Type = $"Apricot FAT{(_fat16 ? "16" : "12")}";
break;
case BpbKind.DecRainbow:
_statfs.Type = $"DEC FAT{(_fat16 ? "16" : "12")}";
break;
case BpbKind.Human:
_statfs.Type = $"Human68k FAT{(_fat16 ? "16" : "12")}";
break;
default: throw new ArgumentOutOfRangeException();
}
_bytesPerCluster = _sectorsPerCluster * imagePlugin.Info.SectorSize;
@@ -827,7 +793,7 @@ public sealed partial class FAT
if(_fat12)
{
AaruConsole.DebugWriteLine("FAT plugin", "Reading FAT12");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Reading_FAT12);
errno = imagePlugin.ReadSectors(_fatFirstSector, _sectorsPerFat, out byte[] fatBytes);
@@ -880,14 +846,14 @@ public sealed partial class FAT
}
else if(_fat16)
{
AaruConsole.DebugWriteLine("FAT plugin", "Reading FAT16");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Reading_FAT16);
errno = imagePlugin.ReadSectors(_fatFirstSector, _sectorsPerFat, out byte[] fatBytes);
if(errno != ErrorNumber.NoError)
return errno;
AaruConsole.DebugWriteLine("FAT plugin", "Casting FAT");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Casting_FAT);
firstFatEntries = MemoryMarshal.Cast<byte, ushort>(fatBytes).ToArray();
errno = imagePlugin.ReadSectors(_fatFirstSector + _sectorsPerFat, _sectorsPerFat, out fatBytes);
@@ -895,7 +861,7 @@ public sealed partial class FAT
if(errno != ErrorNumber.NoError)
return errno;
AaruConsole.DebugWriteLine("FAT plugin", "Casting FAT");
AaruConsole.DebugWriteLine("FAT plugin", Localization.Casting_FAT);
secondFatEntries = MemoryMarshal.Cast<byte, ushort>(fatBytes).ToArray();
if(firstFatEntries.Any(entry => entry < FAT16_RESERVED && entry > _statfs.Blocks))

View File

@@ -59,6 +59,9 @@ public sealed partial class XboxFatPlugin
const ushort FAT16_RESERVED = 0xFFF0;
const ushort FAT_RESERVED = 1;
// Do not translate
const string FS_TYPE = "fatx";
[Flags]
enum Attributes : byte
{

View File

@@ -66,11 +66,11 @@ public sealed partial class XboxFatPlugin : IReadOnlyFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "FATX Filesystem Plugin";
public string Name => Localization.XboxFatPlugin_Name;
/// <inheritdoc />
public Guid Id => new("ED27A721-4A17-4649-89FD-33633B46E228");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public ErrorNumber ListXAttr(string path, out List<string> xattrs)

View File

@@ -88,28 +88,28 @@ public sealed partial class XboxFatPlugin
var sb = new StringBuilder();
sb.AppendLine("FATX filesystem");
sb.AppendLine(Localization.FATX_filesystem);
sb.AppendFormat("{0} logical sectors ({1} bytes) per physical sector", logicalSectorsPerPhysicalSectors,
sb.AppendFormat(Localization._0_logical_sectors_1_bytes_per_physical_sector, logicalSectorsPerPhysicalSectors,
logicalSectorsPerPhysicalSectors * imagePlugin.Info.SectorSize).AppendLine();
sb.AppendFormat("{0} sectors ({1} bytes) per cluster", fatxSb.sectorsPerCluster,
sb.AppendFormat(Localization._0_sectors_1_bytes_per_cluster, fatxSb.sectorsPerCluster,
fatxSb.sectorsPerCluster * logicalSectorsPerPhysicalSectors * imagePlugin.Info.SectorSize).
AppendLine();
sb.AppendFormat("Root directory starts on cluster {0}", fatxSb.rootDirectoryCluster).AppendLine();
sb.AppendFormat(Localization.Root_directory_starts_on_cluster_0, fatxSb.rootDirectoryCluster).AppendLine();
string volumeLabel = StringHandlers.CToString(fatxSb.volumeLabel,
bigEndian ? Encoding.BigEndianUnicode : Encoding.Unicode, true);
sb.AppendFormat("Volume label: {0}", volumeLabel).AppendLine();
sb.AppendFormat("Volume serial: {0:X8}", fatxSb.id).AppendLine();
sb.AppendFormat(Localization.Volume_label_0, volumeLabel).AppendLine();
sb.AppendFormat(Localization.Volume_serial_0_X8, fatxSb.id).AppendLine();
information = sb.ToString();
XmlFsType = new FileSystemType
{
Type = "FATX filesystem",
Type = FS_TYPE,
ClusterSize = (uint)(fatxSb.sectorsPerCluster * logicalSectorsPerPhysicalSectors *
imagePlugin.Info.SectorSize),
VolumeName = volumeLabel,

View File

@@ -63,7 +63,7 @@ public sealed partial class XboxFatPlugin
if(imagePlugin.Info.SectorSize < 512)
return ErrorNumber.InvalidArgument;
AaruConsole.DebugWriteLine("Xbox FAT plugin", "Reading superblock");
AaruConsole.DebugWriteLine("Xbox FAT plugin", Localization.Reading_superblock);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, out byte[] sector);
@@ -82,7 +82,8 @@ public sealed partial class XboxFatPlugin
return ErrorNumber.InvalidArgument;
AaruConsole.DebugWriteLine("Xbox FAT plugin",
_littleEndian ? "Filesystem is little endian" : "Filesystem is big endian");
_littleEndian ? Localization.Filesystem_is_little_endian
: Localization.Filesystem_is_big_endian);
int logicalSectorsPerPhysicalSectors = partition.Offset == 0 && _littleEndian ? 8 : 1;
@@ -95,7 +96,7 @@ public sealed partial class XboxFatPlugin
XmlFsType = new FileSystemType
{
Type = "FATX filesystem",
Type = Localization.FATX_filesystem,
ClusterSize = (uint)(_superblock.sectorsPerCluster * logicalSectorsPerPhysicalSectors *
imagePlugin.Info.SectorSize),
VolumeName = volumeLabel,
@@ -137,7 +138,7 @@ public sealed partial class XboxFatPlugin
if(_statfs.Blocks > MAX_XFAT16_CLUSTERS)
{
AaruConsole.DebugWriteLine("Xbox FAT plugin", "Reading FAT32");
AaruConsole.DebugWriteLine("Xbox FAT plugin", Localization.Reading_FAT32);
fatSize = (uint)((_statfs.Blocks + 1) * sizeof(uint) / imagePlugin.Info.SectorSize);
@@ -151,14 +152,14 @@ public sealed partial class XboxFatPlugin
fatSize = (uint)(fatClusters * 4096 / imagePlugin.Info.SectorSize);
AaruConsole.DebugWriteLine("Xbox FAT plugin", "FAT is {0} sectors", fatSize);
AaruConsole.DebugWriteLine("Xbox FAT plugin", Localization.FAT_is_0_sectors, fatSize);
errno = imagePlugin.ReadSectors(_fatStartSector, fatSize, out buffer);
if(errno != ErrorNumber.NoError)
return errno;
AaruConsole.DebugWriteLine("Xbox FAT plugin", "Casting FAT");
AaruConsole.DebugWriteLine("Xbox FAT plugin", Localization.Casting_FAT);
_fat32 = MemoryMarshal.Cast<byte, uint>(buffer).ToArray();
if(!_littleEndian)
@@ -172,7 +173,7 @@ public sealed partial class XboxFatPlugin
}
else
{
AaruConsole.DebugWriteLine("Xbox FAT plugin", "Reading FAT16");
AaruConsole.DebugWriteLine("Xbox FAT plugin", Localization.Reading_FAT16);
fatSize = (uint)((_statfs.Blocks + 1) * sizeof(ushort) / imagePlugin.Info.SectorSize);
@@ -186,14 +187,14 @@ public sealed partial class XboxFatPlugin
fatSize = (uint)(fatClusters * 4096 / imagePlugin.Info.SectorSize);
AaruConsole.DebugWriteLine("Xbox FAT plugin", "FAT is {0} sectors", fatSize);
AaruConsole.DebugWriteLine("Xbox FAT plugin", Localization.FAT_is_0_sectors, fatSize);
errno = imagePlugin.ReadSectors(_fatStartSector, fatSize, out buffer);
if(errno != ErrorNumber.NoError)
return errno;
AaruConsole.DebugWriteLine("Xbox FAT plugin", "Casting FAT");
AaruConsole.DebugWriteLine("Xbox FAT plugin", Localization.Casting_FAT);
_fat16 = MemoryMarshal.Cast<byte, ushort>(buffer).ToArray();
if(!_littleEndian)
@@ -222,7 +223,7 @@ public sealed partial class XboxFatPlugin
byte[] rootDirectoryBuffer = new byte[_bytesPerCluster * rootDirectoryClusters.Length];
AaruConsole.DebugWriteLine("Xbox FAT plugin", "Reading root directory");
AaruConsole.DebugWriteLine("Xbox FAT plugin", Localization.Reading_root_directory);
for(int i = 0; i < rootDirectoryClusters.Length; i++)
{

View File

@@ -101,11 +101,11 @@ public sealed class FFSPlugin : IFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "BSD Fast File System (aka UNIX File System, UFS)";
public string Name => Localization.FFSPlugin_Name;
/// <inheritdoc />
public Guid Id => new("CC90D342-05DB-48A8-988C-C1FE000034A3");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -152,6 +152,9 @@ public sealed class FFSPlugin : IFilesystem
}
}
const string FS_TYPE_UFS = "ufs";
const string FS_TYPE_UFS2 = "ufs2";
/// <inheritdoc />
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
{
@@ -207,7 +210,7 @@ public sealed class FFSPlugin : IFilesystem
if(magic == 0)
{
information = "Not a UFS filesystem, I shouldn't have arrived here!";
information = Localization.Not_a_UFS_filesystem_I_shouldnt_have_arrived_here;
return;
}
@@ -217,45 +220,45 @@ public sealed class FFSPlugin : IFilesystem
switch(magic)
{
case UFS_MAGIC:
sbInformation.AppendLine("UFS filesystem");
XmlFsType.Type = "UFS";
sbInformation.AppendLine(Localization.UFS_filesystem);
XmlFsType.Type = FS_TYPE_UFS;
break;
case UFS_CIGAM:
sbInformation.AppendLine("Big-endian UFS filesystem");
XmlFsType.Type = "UFS";
sbInformation.AppendLine(Localization.Big_endian_UFS_filesystem);
XmlFsType.Type = FS_TYPE_UFS;
break;
case UFS_MAGIC_BW:
sbInformation.AppendLine("BorderWare UFS filesystem");
XmlFsType.Type = "UFS";
sbInformation.AppendLine(Localization.BorderWare_UFS_filesystem);
XmlFsType.Type = FS_TYPE_UFS;
break;
case UFS_CIGAM_BW:
sbInformation.AppendLine("Big-endian BorderWare UFS filesystem");
XmlFsType.Type = "UFS";
sbInformation.AppendLine(Localization.Big_endian_BorderWare_UFS_filesystem);
XmlFsType.Type = FS_TYPE_UFS;
break;
case UFS2_MAGIC:
sbInformation.AppendLine("UFS2 filesystem");
XmlFsType.Type = "UFS2";
sbInformation.AppendLine(Localization.UFS2_filesystem);
XmlFsType.Type = FS_TYPE_UFS2;
break;
case UFS2_CIGAM:
sbInformation.AppendLine("Big-endian UFS2 filesystem");
XmlFsType.Type = "UFS2";
sbInformation.AppendLine(Localization.Big_endian_UFS2_filesystem);
XmlFsType.Type = FS_TYPE_UFS2;
break;
case UFS_BAD_MAGIC:
sbInformation.AppendLine("Incompletely initialized UFS filesystem");
sbInformation.AppendLine("BEWARE!!! Following information may be completely wrong!");
XmlFsType.Type = "UFS";
sbInformation.AppendLine(Localization.Incompletely_initialized_UFS_filesystem);
sbInformation.AppendLine(Localization.BEWARE_Following_information_may_be_completely_wrong);
XmlFsType.Type = FS_TYPE_UFS;
break;
case UFS_BAD_CIGAM:
sbInformation.AppendLine("Incompletely initialized big-endian UFS filesystem");
sbInformation.AppendLine("BEWARE!!! Following information may be completely wrong!");
XmlFsType.Type = "UFS";
sbInformation.AppendLine(Localization.Incompletely_initialized_big_endian_UFS_filesystem);
sbInformation.AppendLine(Localization.BEWARE_Following_information_may_be_completely_wrong);
XmlFsType.Type = FS_TYPE_UFS;
break;
}
@@ -382,214 +385,224 @@ public sealed class FFSPlugin : IFilesystem
if(!fs_type_ufs2)
{
sbInformation.AppendLine("There are a lot of variants of UFS using overlapped values on same fields");
sbInformation.AppendLine(Localization.
There_are_a_lot_of_variants_of_UFS_using_overlapped_values_on_same_fields);
sbInformation.
AppendLine("I will try to guess which one it is, but unless it's UFS2, I may be surely wrong");
sbInformation.AppendLine(Localization.
I_will_try_to_guess_which_one_it_is_but_unless_its_UFS2_I_may_be_surely_wrong);
}
if(fs_type_42bsd)
sbInformation.AppendLine("Guessed as 42BSD FFS");
sbInformation.AppendLine(Localization.Guessed_as_42BSD_FFS);
if(fs_type_43bsd)
sbInformation.AppendLine("Guessed as 43BSD FFS");
sbInformation.AppendLine(Localization.Guessed_as_43BSD_FFS);
if(fs_type_44bsd)
sbInformation.AppendLine("Guessed as 44BSD FFS");
sbInformation.AppendLine(Localization.Guessed_as_44BSD_FFS);
if(fs_type_sun)
sbInformation.AppendLine("Guessed as SunOS FFS");
sbInformation.AppendLine(Localization.Guessed_as_SunOS_FFS);
if(fs_type_sun86)
sbInformation.AppendLine("Guessed as SunOS/x86 FFS");
sbInformation.AppendLine(Localization.Guessed_as_SunOS_x86_FFS);
if(fs_type_ufs)
sbInformation.AppendLine("Guessed as UFS");
sbInformation.AppendLine(Localization.Guessed_as_UFS);
if(fs_type_42bsd)
sbInformation.AppendFormat("Linked list of filesystems: 0x{0:X8}", sb.fs_link).AppendLine();
sbInformation.AppendFormat(Localization.Linked_list_of_filesystems_0, sb.fs_link).AppendLine();
sbInformation.AppendFormat("Superblock LBA: {0}", sb.fs_sblkno).AppendLine();
sbInformation.AppendFormat("Cylinder-block LBA: {0}", sb.fs_cblkno).AppendLine();
sbInformation.AppendFormat("inode-block LBA: {0}", sb.fs_iblkno).AppendLine();
sbInformation.AppendFormat("First data block LBA: {0}", sb.fs_dblkno).AppendLine();
sbInformation.AppendFormat("Cylinder group offset in cylinder: {0}", sb.fs_old_cgoffset).AppendLine();
sbInformation.AppendFormat(Localization.Superblock_LBA_0, sb.fs_sblkno).AppendLine();
sbInformation.AppendFormat(Localization.Cylinder_block_LBA_0, sb.fs_cblkno).AppendLine();
sbInformation.AppendFormat(Localization.inode_block_LBA_0, sb.fs_iblkno).AppendLine();
sbInformation.AppendFormat(Localization.First_data_block_LBA_0, sb.fs_dblkno).AppendLine();
sbInformation.AppendFormat(Localization.Cylinder_group_offset_in_cylinder_0, sb.fs_old_cgoffset).AppendLine();
sbInformation.AppendFormat("Volume last written on {0}", DateHandlers.UnixToDateTime(sb.fs_old_time)).
sbInformation.AppendFormat(Localization.Volume_last_written_on_0, DateHandlers.UnixToDateTime(sb.fs_old_time)).
AppendLine();
XmlFsType.ModificationDate = DateHandlers.UnixToDateTime(sb.fs_old_time);
XmlFsType.ModificationDateSpecified = true;
sbInformation.AppendFormat("{0} blocks in volume ({1} bytes)", sb.fs_old_size,
sbInformation.AppendFormat(Localization._0_blocks_in_volume_1_bytes, sb.fs_old_size,
(long)sb.fs_old_size * sb.fs_fsize).AppendLine();
XmlFsType.Clusters = (ulong)sb.fs_old_size;
XmlFsType.ClusterSize = (uint)sb.fs_fsize;
sbInformation.AppendFormat("{0} data blocks in volume ({1} bytes)", sb.fs_old_dsize,
sbInformation.AppendFormat(Localization._0_data_blocks_in_volume_1_bytes, sb.fs_old_dsize,
(long)sb.fs_old_dsize * sb.fs_fsize).AppendLine();
sbInformation.AppendFormat("{0} cylinder groups in volume", sb.fs_ncg).AppendLine();
sbInformation.AppendFormat("{0} bytes in a basic block", sb.fs_bsize).AppendLine();
sbInformation.AppendFormat("{0} bytes in a frag block", sb.fs_fsize).AppendLine();
sbInformation.AppendFormat("{0} frags in a block", sb.fs_frag).AppendLine();
sbInformation.AppendFormat("{0}% of blocks must be free", sb.fs_minfree).AppendLine();
sbInformation.AppendFormat("{0}ms for optimal next block", sb.fs_old_rotdelay).AppendLine();
sbInformation.AppendFormat(Localization._0_cylinder_groups_in_volume, sb.fs_ncg).AppendLine();
sbInformation.AppendFormat(Localization._0_bytes_in_a_basic_block, sb.fs_bsize).AppendLine();
sbInformation.AppendFormat(Localization._0_bytes_in_a_frag_block, sb.fs_fsize).AppendLine();
sbInformation.AppendFormat(Localization._0_frags_in_a_block, sb.fs_frag).AppendLine();
sbInformation.AppendFormat(Localization._0_of_blocks_must_be_free, sb.fs_minfree).AppendLine();
sbInformation.AppendFormat(Localization._0_ms_for_optimal_next_block, sb.fs_old_rotdelay).AppendLine();
sbInformation.AppendFormat("disk rotates {0} times per second ({1}rpm)", sb.fs_old_rps, sb.fs_old_rps * 60).
AppendLine();
sbInformation.
AppendFormat(Localization.Disk_rotates_0_times_per_second_1_rpm, sb.fs_old_rps, sb.fs_old_rps * 60).
AppendLine();
/* sbInformation.AppendFormat("fs_bmask: 0x{0:X8}", sb.fs_bmask).AppendLine();
sbInformation.AppendFormat("fs_fmask: 0x{0:X8}", sb.fs_fmask).AppendLine();
sbInformation.AppendFormat("fs_bshift: 0x{0:X8}", sb.fs_bshift).AppendLine();
sbInformation.AppendFormat("fs_fshift: 0x{0:X8}", sb.fs_fshift).AppendLine();*/
sbInformation.AppendFormat("{0} contiguous blocks at maximum", sb.fs_maxcontig).AppendLine();
sbInformation.AppendFormat("{0} blocks per cylinder group at maximum", sb.fs_maxbpg).AppendLine();
sbInformation.AppendFormat("Superblock is {0} bytes", sb.fs_sbsize).AppendLine();
sbInformation.AppendFormat("NINDIR: 0x{0:X8}", sb.fs_nindir).AppendLine();
sbInformation.AppendFormat("INOPB: 0x{0:X8}", sb.fs_inopb).AppendLine();
sbInformation.AppendFormat("NSPF: 0x{0:X8}", sb.fs_old_nspf).AppendLine();
sbInformation.AppendFormat(Localization._0_contiguous_blocks_at_maximum, sb.fs_maxcontig).AppendLine();
sbInformation.AppendFormat(Localization._0_blocks_per_cylinder_group_at_maximum, sb.fs_maxbpg).AppendLine();
sbInformation.AppendFormat(Localization.Superblock_is_0_bytes, sb.fs_sbsize).AppendLine();
sbInformation.AppendFormat(Localization.NINDIR_0, sb.fs_nindir).AppendLine();
sbInformation.AppendFormat(Localization.INOPB_0, sb.fs_inopb).AppendLine();
sbInformation.AppendFormat(Localization.NSPF_0, sb.fs_old_nspf).AppendLine();
switch(sb.fs_optim)
{
case 0:
sbInformation.AppendLine("Filesystem will minimize allocation time");
sbInformation.AppendLine(Localization.Filesystem_will_minimize_allocation_time);
break;
case 1:
sbInformation.AppendLine("Filesystem will minimize volume fragmentation");
sbInformation.AppendLine(Localization.Filesystem_will_minimize_volume_fragmentation);
break;
default:
sbInformation.AppendFormat("Unknown optimization value: 0x{0:X8}", sb.fs_optim).AppendLine();
sbInformation.AppendFormat(Localization.Unknown_optimization_value_0, sb.fs_optim).AppendLine();
break;
}
if(fs_type_sun)
sbInformation.AppendFormat("{0} sectors/track", sb.fs_old_npsect).AppendLine();
sbInformation.AppendFormat(Localization._0_sectors_track, sb.fs_old_npsect).AppendLine();
else if(fs_type_sun86)
sbInformation.AppendFormat("Volume state on {0}", DateHandlers.UnixToDateTime(sb.fs_old_npsect)).
sbInformation.AppendFormat(Localization.Volume_state_on_0, DateHandlers.UnixToDateTime(sb.fs_old_npsect)).
AppendLine();
sbInformation.AppendFormat("Hardware sector interleave: {0}", sb.fs_old_interleave).AppendLine();
sbInformation.AppendFormat("Sector 0 skew: {0}/track", sb.fs_old_trackskew).AppendLine();
sbInformation.AppendFormat(Localization.Hardware_sector_interleave_0, sb.fs_old_interleave).AppendLine();
sbInformation.AppendFormat(Localization.Sector_zero_skew_0_track, sb.fs_old_trackskew).AppendLine();
switch(fs_type_43bsd)
{
case false when sb is { fs_id_1: > 0, fs_id_2: > 0 }:
sbInformation.AppendFormat("Volume ID: 0x{0:X8}{1:X8}", sb.fs_id_1, sb.fs_id_2).AppendLine();
sbInformation.AppendFormat(Localization.Volume_ID_0_X8_1_X8, sb.fs_id_1, sb.fs_id_2).AppendLine();
break;
case true when sb is { fs_id_1: > 0, fs_id_2: > 0 }:
sbInformation.AppendFormat("{0} µsec for head switch", sb.fs_id_1).AppendLine();
sbInformation.AppendFormat("{0} µsec for track-to-track seek", sb.fs_id_2).AppendLine();
sbInformation.AppendFormat(Localization._0_µsec_for_head_switch, sb.fs_id_1).AppendLine();
sbInformation.AppendFormat(Localization._0_µsec_for_track_to_track_seek, sb.fs_id_2).AppendLine();
break;
}
sbInformation.AppendFormat("Cylinder group summary LBA: {0}", sb.fs_old_csaddr).AppendLine();
sbInformation.AppendFormat("{0} bytes in cylinder group summary", sb.fs_cssize).AppendLine();
sbInformation.AppendFormat("{0} bytes in cylinder group", sb.fs_cgsize).AppendLine();
sbInformation.AppendFormat("{0} tracks/cylinder", sb.fs_old_ntrak).AppendLine();
sbInformation.AppendFormat("{0} sectors/track", sb.fs_old_nsect).AppendLine();
sbInformation.AppendFormat("{0} sectors/cylinder", sb.fs_old_spc).AppendLine();
sbInformation.AppendFormat("{0} cylinder in volume", sb.fs_old_ncyl).AppendLine();
sbInformation.AppendFormat("{0} cylinders/group", sb.fs_old_cpg).AppendLine();
sbInformation.AppendFormat("{0} inodes per cylinder group", sb.fs_ipg).AppendLine();
sbInformation.AppendFormat("{0} blocks per group", sb.fs_fpg / sb.fs_frag).AppendLine();
sbInformation.AppendFormat("{0} directories", sb.fs_old_cstotal.cs_ndir).AppendLine();
sbInformation.AppendFormat(Localization.Cylinder_group_summary_LBA_0, sb.fs_old_csaddr).AppendLine();
sbInformation.AppendFormat(Localization._0_bytes_in_cylinder_group_summary, sb.fs_cssize).AppendLine();
sbInformation.AppendFormat(Localization._0_bytes_in_cylinder_group, sb.fs_cgsize).AppendLine();
sbInformation.AppendFormat(Localization._0_tracks_cylinder, sb.fs_old_ntrak).AppendLine();
sbInformation.AppendFormat(Localization._0_sectors_track, sb.fs_old_nsect).AppendLine();
sbInformation.AppendFormat(Localization._0_sectors_cylinder, sb.fs_old_spc).AppendLine();
sbInformation.AppendFormat(Localization._0_cylinders_in_volume, sb.fs_old_ncyl).AppendLine();
sbInformation.AppendFormat(Localization._0_cylinders_group, sb.fs_old_cpg).AppendLine();
sbInformation.AppendFormat(Localization._0_inodes_per_cylinder_group, sb.fs_ipg).AppendLine();
sbInformation.AppendFormat(Localization._0_blocks_per_group, sb.fs_fpg / sb.fs_frag).AppendLine();
sbInformation.AppendFormat(Localization._0_directories, sb.fs_old_cstotal.cs_ndir).AppendLine();
sbInformation.AppendFormat("{0} free blocks ({1} bytes)", sb.fs_old_cstotal.cs_nbfree,
sbInformation.AppendFormat(Localization._0_free_blocks_1_bytes, sb.fs_old_cstotal.cs_nbfree,
(long)sb.fs_old_cstotal.cs_nbfree * sb.fs_fsize).AppendLine();
XmlFsType.FreeClusters = (ulong)sb.fs_old_cstotal.cs_nbfree;
XmlFsType.FreeClustersSpecified = true;
sbInformation.AppendFormat("{0} free inodes", sb.fs_old_cstotal.cs_nifree).AppendLine();
sbInformation.AppendFormat("{0} free frags", sb.fs_old_cstotal.cs_nffree).AppendLine();
sbInformation.AppendFormat(Localization._0_free_inodes, sb.fs_old_cstotal.cs_nifree).AppendLine();
sbInformation.AppendFormat(Localization._0_free_frags, sb.fs_old_cstotal.cs_nffree).AppendLine();
if(sb.fs_fmod == 1)
{
sbInformation.AppendLine("Superblock is under modification");
sbInformation.AppendLine(Localization.Superblock_is_under_modification);
XmlFsType.Dirty = true;
}
if(sb.fs_clean == 1)
sbInformation.AppendLine("Volume is clean");
sbInformation.AppendLine(Localization.Volume_is_clean);
if(sb.fs_ronly == 1)
sbInformation.AppendLine("Volume is read-only");
sbInformation.AppendLine(Localization.Volume_is_read_only);
sbInformation.AppendFormat("Volume flags: 0x{0:X2}", sb.fs_flags).AppendLine();
sbInformation.AppendFormat(Localization.Volume_flags_0_X2, sb.fs_flags).AppendLine();
if(fs_type_ufs)
sbInformation.AppendFormat("Volume last mounted on \"{0}\"", StringHandlers.CToString(sb.fs_fsmnt)).
sbInformation.AppendFormat(Localization.Volume_last_mounted_at_0, StringHandlers.CToString(sb.fs_fsmnt)).
AppendLine();
else if(fs_type_ufs2)
{
sbInformation.AppendFormat("Volume last mounted on \"{0}\"", StringHandlers.CToString(sb.fs_fsmnt)).
sbInformation.AppendFormat(Localization.Volume_last_mounted_at_0, StringHandlers.CToString(sb.fs_fsmnt)).
AppendLine();
sbInformation.AppendFormat("Volume name: \"{0}\"", StringHandlers.CToString(sb.fs_volname)).AppendLine();
sbInformation.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(sb.fs_volname)).
AppendLine();
XmlFsType.VolumeName = StringHandlers.CToString(sb.fs_volname);
sbInformation.AppendFormat("Volume ID: 0x{0:X16}", sb.fs_swuid).AppendLine();
sbInformation.AppendFormat(Localization.Volume_ID_0_X16, sb.fs_swuid).AppendLine();
//xmlFSType.VolumeSerial = string.Format("{0:X16}", sb.fs_swuid);
sbInformation.AppendFormat("Last searched cylinder group: {0}", sb.fs_cgrotor).AppendLine();
sbInformation.AppendFormat("{0} contiguously allocated directories", sb.fs_contigdirs).AppendLine();
sbInformation.AppendFormat("Standard superblock LBA: {0}", sb.fs_sblkno).AppendLine();
sbInformation.AppendFormat("{0} directories", sb.fs_cstotal.cs_ndir).AppendLine();
sbInformation.AppendFormat(Localization.Last_searched_cylinder_group_0, sb.fs_cgrotor).AppendLine();
sbInformation.AppendFormat("{0} free blocks ({1} bytes)", sb.fs_cstotal.cs_nbfree,
sbInformation.AppendFormat(Localization._0_contiguously_allocated_directories, sb.fs_contigdirs).
AppendLine();
sbInformation.AppendFormat(Localization.Standard_superblock_LBA_0, sb.fs_sblkno).AppendLine();
sbInformation.AppendFormat(Localization._0_directories, sb.fs_cstotal.cs_ndir).AppendLine();
sbInformation.AppendFormat(Localization._0_free_blocks_1_bytes, sb.fs_cstotal.cs_nbfree,
sb.fs_cstotal.cs_nbfree * sb.fs_fsize).AppendLine();
XmlFsType.FreeClusters = (ulong)sb.fs_cstotal.cs_nbfree;
XmlFsType.FreeClustersSpecified = true;
sbInformation.AppendFormat("{0} free inodes", sb.fs_cstotal.cs_nifree).AppendLine();
sbInformation.AppendFormat("{0} free frags", sb.fs_cstotal.cs_nffree).AppendLine();
sbInformation.AppendFormat("{0} free clusters", sb.fs_cstotal.cs_numclusters).AppendLine();
sbInformation.AppendFormat(Localization._0_free_inodes, sb.fs_cstotal.cs_nifree).AppendLine();
sbInformation.AppendFormat(Localization._0_free_frags, sb.fs_cstotal.cs_nffree).AppendLine();
sbInformation.AppendFormat(Localization._0_free_clusters, sb.fs_cstotal.cs_numclusters).AppendLine();
sbInformation.AppendFormat("Volume last written on {0}", DateHandlers.UnixToDateTime(sb.fs_time)).
sbInformation.AppendFormat(Localization.Volume_last_written_on_0, DateHandlers.UnixToDateTime(sb.fs_time)).
AppendLine();
XmlFsType.ModificationDate = DateHandlers.UnixToDateTime(sb.fs_time);
XmlFsType.ModificationDateSpecified = true;
sbInformation.AppendFormat("{0} blocks ({1} bytes)", sb.fs_size, sb.fs_size * sb.fs_fsize).AppendLine();
sbInformation.AppendFormat(Localization._0_blocks_1_bytes, sb.fs_size, sb.fs_size * sb.fs_fsize).
AppendLine();
XmlFsType.Clusters = (ulong)sb.fs_size;
sbInformation.AppendFormat("{0} data blocks ({1} bytes)", sb.fs_dsize, sb.fs_dsize * sb.fs_fsize).
sbInformation.AppendFormat(Localization._0_data_blocks_1_bytes, sb.fs_dsize, sb.fs_dsize * sb.fs_fsize).
AppendLine();
sbInformation.AppendFormat("Cylinder group summary area LBA: {0}", sb.fs_csaddr).AppendLine();
sbInformation.AppendFormat("{0} blocks pending of being freed", sb.fs_pendingblocks).AppendLine();
sbInformation.AppendFormat("{0} inodes pending of being freed", sb.fs_pendinginodes).AppendLine();
sbInformation.AppendFormat(Localization.Cylinder_group_summary_area_LBA_0, sb.fs_csaddr).AppendLine();
sbInformation.AppendFormat(Localization._0_blocks_pending_of_being_freed, sb.fs_pendingblocks).AppendLine();
sbInformation.AppendFormat(Localization._0_inodes_pending_of_being_freed, sb.fs_pendinginodes).AppendLine();
}
if(fs_type_sun)
sbInformation.AppendFormat("Volume state on {0}", DateHandlers.UnixToDateTime(sb.fs_old_npsect)).
sbInformation.AppendFormat(Localization.Volume_state_on_0, DateHandlers.UnixToDateTime(sb.fs_old_npsect)).
AppendLine();
else if(fs_type_sun86)
sbInformation.AppendFormat("{0} sectors/track", sb.fs_state).AppendLine();
sbInformation.AppendFormat(Localization._0_sectors_track, sb.fs_state).AppendLine();
else if(fs_type_44bsd)
{
sbInformation.AppendFormat("{0} blocks on cluster summary array", sb.fs_contigsumsize).AppendLine();
sbInformation.AppendFormat(Localization._0_blocks_on_cluster_summary_array, sb.fs_contigsumsize).
AppendLine();
sbInformation.AppendFormat("Maximum length of a symbolic link: {0}", sb.fs_maxsymlinklen).AppendLine();
sbInformation.AppendFormat(Localization.Maximum_length_of_a_symbolic_link_0, sb.fs_maxsymlinklen).
AppendLine();
sbInformation.AppendFormat("A file can be {0} bytes at max", sb.fs_maxfilesize).AppendLine();
sbInformation.AppendFormat(Localization.A_file_can_be_0_bytes_at_max, sb.fs_maxfilesize).AppendLine();
sbInformation.AppendFormat("Volume state on {0}", DateHandlers.UnixToDateTime(sb.fs_state)).AppendLine();
sbInformation.AppendFormat(Localization.Volume_state_on_0, DateHandlers.UnixToDateTime(sb.fs_state)).
AppendLine();
}
if(sb.fs_old_nrpos > 0)
sbInformation.AppendFormat("{0} rotational positions", sb.fs_old_nrpos).AppendLine();
sbInformation.AppendFormat(Localization._0_rotational_positions, sb.fs_old_nrpos).AppendLine();
if(sb.fs_old_rotbloff > 0)
sbInformation.AppendFormat("{0} blocks per rotation", sb.fs_old_rotbloff).AppendLine();
sbInformation.AppendFormat(Localization._0_blocks_per_rotation, sb.fs_old_rotbloff).AppendLine();
information = sbInformation.ToString();
}

View File

@@ -53,16 +53,18 @@ public sealed class Fossil : IFilesystem
// Fossil header starts at 128KiB
const ulong HEADER_POS = 128 * 1024;
const string FS_TYPE = "fossil";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Fossil Filesystem Plugin";
public string Name => Localization.Fossil_Name;
/// <inheritdoc />
public Guid Id => new("932BF104-43F6-494F-973C-45EF58A51DA9");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -79,8 +81,7 @@ public sealed class Fossil : IFilesystem
Header hdr = Marshal.ByteArrayToStructureBigEndian<Header>(sector);
AaruConsole.DebugWriteLine("Fossil plugin", "magic at 0x{0:X8} (expected 0x{1:X8})", hdr.magic,
FOSSIL_HDR_MAGIC);
AaruConsole.DebugWriteLine("Fossil plugin", Localization.magic_at_0_expected_1, hdr.magic, FOSSIL_HDR_MAGIC);
return hdr.magic == FOSSIL_HDR_MAGIC;
}
@@ -104,24 +105,23 @@ public sealed class Fossil : IFilesystem
Header hdr = Marshal.ByteArrayToStructureBigEndian<Header>(sector);
AaruConsole.DebugWriteLine("Fossil plugin", "magic at 0x{0:X8} (expected 0x{1:X8})", hdr.magic,
FOSSIL_HDR_MAGIC);
AaruConsole.DebugWriteLine("Fossil plugin", Localization.magic_at_0_expected_1, hdr.magic, FOSSIL_HDR_MAGIC);
var sb = new StringBuilder();
sb.AppendLine("Fossil");
sb.AppendFormat("Filesystem version {0}", hdr.version).AppendLine();
sb.AppendFormat("{0} bytes per block", hdr.blockSize).AppendLine();
sb.AppendFormat("Superblock resides in block {0}", hdr.super).AppendLine();
sb.AppendFormat("Labels resides in block {0}", hdr.label).AppendLine();
sb.AppendFormat("Data starts at block {0}", hdr.data).AppendLine();
sb.AppendFormat("Volume has {0} blocks", hdr.end).AppendLine();
sb.AppendLine(Localization.Fossil_filesystem);
sb.AppendFormat(Localization.Filesystem_version_0, hdr.version).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_block, hdr.blockSize).AppendLine();
sb.AppendFormat(Localization.Superblock_resides_in_block_0, hdr.super).AppendLine();
sb.AppendFormat(Localization.Labels_resides_in_block_0, hdr.label).AppendLine();
sb.AppendFormat(Localization.Data_starts_at_block_0, hdr.data).AppendLine();
sb.AppendFormat(Localization.Volume_has_0_blocks, hdr.end).AppendLine();
ulong sbLocation = (hdr.super * (hdr.blockSize / imagePlugin.Info.SectorSize)) + partition.Start;
XmlFsType = new FileSystemType
{
Type = "Fossil filesystem",
Type = FS_TYPE,
ClusterSize = hdr.blockSize,
Clusters = hdr.end
};
@@ -131,18 +131,17 @@ public sealed class Fossil : IFilesystem
imagePlugin.ReadSector(sbLocation, out sector);
SuperBlock fsb = Marshal.ByteArrayToStructureBigEndian<SuperBlock>(sector);
AaruConsole.DebugWriteLine("Fossil plugin", "magic 0x{0:X8} (expected 0x{1:X8})", fsb.magic,
FOSSIL_SB_MAGIC);
AaruConsole.DebugWriteLine("Fossil plugin", Localization.magic_0_expected_1, fsb.magic, FOSSIL_SB_MAGIC);
if(fsb.magic == FOSSIL_SB_MAGIC)
{
sb.AppendFormat("Epoch low {0}", fsb.epochLow).AppendLine();
sb.AppendFormat("Epoch high {0}", fsb.epochHigh).AppendLine();
sb.AppendFormat("Next QID {0}", fsb.qid).AppendLine();
sb.AppendFormat("Active root block {0}", fsb.active).AppendLine();
sb.AppendFormat("Next root block {0}", fsb.next).AppendLine();
sb.AppendFormat("Current root block {0}", fsb.current).AppendLine();
sb.AppendFormat("Volume label: \"{0}\"", StringHandlers.CToString(fsb.name, Encoding)).AppendLine();
sb.AppendFormat(Localization.Epoch_low_0, fsb.epochLow).AppendLine();
sb.AppendFormat(Localization.Epoch_high_0, fsb.epochHigh).AppendLine();
sb.AppendFormat(Localization.Next_QID_0, fsb.qid).AppendLine();
sb.AppendFormat(Localization.Active_root_block_0, fsb.active).AppendLine();
sb.AppendFormat(Localization.Next_root_block_0, fsb.next).AppendLine();
sb.AppendFormat(Localization.Current_root_block_0, fsb.current).AppendLine();
sb.AppendFormat(Localization.Volume_label_0, StringHandlers.CToString(fsb.name, Encoding)).AppendLine();
XmlFsType.VolumeName = StringHandlers.CToString(fsb.name, Encoding);
}
}

View File

@@ -57,16 +57,18 @@ public sealed class HAMMER : IFilesystem
const uint HAMMER_VOLHDR_SIZE = 1928;
const int HAMMER_BIGBLOCK_SIZE = 8192 * 1024;
const string FS_TYPE = "hammer";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "HAMMER Filesystem";
public string Name => Localization.HAMMER_Name;
/// <inheritdoc />
public Guid Id => new("91A188BF-5FD7-4677-BBD3-F59EBA9C864D");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -113,40 +115,42 @@ public sealed class HAMMER : IFilesystem
? Marshal.ByteArrayToStructureLittleEndian<SuperBlock>(sbSector)
: Marshal.ByteArrayToStructureBigEndian<SuperBlock>(sbSector);
sb.AppendLine("HAMMER filesystem");
sb.AppendLine(Localization.HAMMER_filesystem);
sb.AppendFormat("Volume version: {0}", superBlock.vol_version).AppendLine();
sb.AppendFormat(Localization.Volume_version_0, superBlock.vol_version).AppendLine();
sb.AppendFormat("Volume {0} of {1} on this filesystem", superBlock.vol_no + 1, superBlock.vol_count).
sb.AppendFormat(Localization.Volume_0_of_1_on_this_filesystem, superBlock.vol_no + 1, superBlock.vol_count).
AppendLine();
sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(superBlock.vol_label, Encoding)).AppendLine();
sb.AppendFormat("Volume serial: {0}", superBlock.vol_fsid).AppendLine();
sb.AppendFormat("Filesystem type: {0}", superBlock.vol_fstype).AppendLine();
sb.AppendFormat("Boot area starts at {0}", superBlock.vol_bot_beg).AppendLine();
sb.AppendFormat("Memory log starts at {0}", superBlock.vol_mem_beg).AppendLine();
sb.AppendFormat("First volume buffer starts at {0}", superBlock.vol_buf_beg).AppendLine();
sb.AppendFormat("Volume ends at {0}", superBlock.vol_buf_end).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(superBlock.vol_label, Encoding)).
AppendLine();
sb.AppendFormat(Localization.Volume_serial_0, superBlock.vol_fsid).AppendLine();
sb.AppendFormat(Localization.Filesystem_type_0, superBlock.vol_fstype).AppendLine();
sb.AppendFormat(Localization.Boot_area_starts_at_0, superBlock.vol_bot_beg).AppendLine();
sb.AppendFormat(Localization.Memory_log_starts_at_0, superBlock.vol_mem_beg).AppendLine();
sb.AppendFormat(Localization.First_volume_buffer_starts_at_0, superBlock.vol_buf_beg).AppendLine();
sb.AppendFormat(Localization.Volume_ends_at_0, superBlock.vol_buf_end).AppendLine();
XmlFsType = new FileSystemType
{
Clusters = partition.Size / HAMMER_BIGBLOCK_SIZE,
ClusterSize = HAMMER_BIGBLOCK_SIZE,
Dirty = false,
Type = "HAMMER",
Type = FS_TYPE,
VolumeName = StringHandlers.CToString(superBlock.vol_label, Encoding),
VolumeSerial = superBlock.vol_fsid.ToString()
};
if(superBlock.vol_no == superBlock.vol_rootvol)
{
sb.AppendFormat("Filesystem contains {0} \"big-blocks\" ({1} bytes)", superBlock.vol0_stat_bigblocks,
sb.AppendFormat(Localization.Filesystem_contains_0_big_blocks_1_bytes, superBlock.vol0_stat_bigblocks,
superBlock.vol0_stat_bigblocks * HAMMER_BIGBLOCK_SIZE).AppendLine();
sb.AppendFormat("Filesystem has {0} \"big-blocks\" free ({1} bytes)", superBlock.vol0_stat_freebigblocks,
sb.AppendFormat(Localization.Filesystem_has_0_big_blocks_free_1_bytes, superBlock.vol0_stat_freebigblocks,
superBlock.vol0_stat_freebigblocks * HAMMER_BIGBLOCK_SIZE).AppendLine();
sb.AppendFormat("Filesystem has {0} inode used", superBlock.vol0_stat_inodes).AppendLine();
sb.AppendFormat(Localization.Filesystem_has_0_inodes_used, superBlock.vol0_stat_inodes).AppendLine();
XmlFsType.Clusters = (ulong)superBlock.vol0_stat_bigblocks;
XmlFsType.FreeClusters = (ulong)superBlock.vol0_stat_freebigblocks;

View File

@@ -48,16 +48,17 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of IBM's High Performance File System (HPFS)</summary>
public sealed class HPFS : IFilesystem
{
const string FS_TYPE = "hpfs";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "OS/2 High Performance File System";
public string Name => Localization.HPFS_Name;
/// <inheritdoc />
public Guid Id => new("33513B2C-f590-4acb-8bf2-0b1d5e19dec5");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -117,123 +118,124 @@ public sealed class HPFS : IFilesystem
sp.magic1 != 0xF9911849 ||
sp.magic2 != 0xFA5229C5)
{
sb.AppendLine("This may not be HPFS, following information may be not correct.");
sb.AppendFormat("File system type: \"{0}\" (Should be \"HPFS \")", bpb.fs_type).AppendLine();
sb.AppendFormat("Superblock magic1: 0x{0:X8} (Should be 0xF995E849)", hpfsSb.magic1).AppendLine();
sb.AppendFormat("Superblock magic2: 0x{0:X8} (Should be 0xFA53E9C5)", hpfsSb.magic2).AppendLine();
sb.AppendFormat("Spareblock magic1: 0x{0:X8} (Should be 0xF9911849)", sp.magic1).AppendLine();
sb.AppendFormat("Spareblock magic2: 0x{0:X8} (Should be 0xFA5229C5)", sp.magic2).AppendLine();
sb.AppendLine(Localization.This_may_not_be_HPFS_following_information_may_be_not_correct);
sb.AppendFormat(Localization.File_system_type_0_Should_be_HPFS, bpb.fs_type).AppendLine();
sb.AppendFormat(Localization.Superblock_magic1_0_Should_be_0xF995E849, hpfsSb.magic1).AppendLine();
sb.AppendFormat(Localization.Superblock_magic2_0_Should_be_0xFA53E9C5, hpfsSb.magic2).AppendLine();
sb.AppendFormat(Localization.Spareblock_magic1_0_Should_be_0xF9911849, sp.magic1).AppendLine();
sb.AppendFormat(Localization.Spareblock_magic2_0_Should_be_0xFA5229C5, sp.magic2).AppendLine();
}
sb.AppendFormat("OEM name: {0}", StringHandlers.CToString(bpb.oem_name)).AppendLine();
sb.AppendFormat("{0} bytes per sector", bpb.bps).AppendLine();
sb.AppendFormat(Localization.OEM_name_0, StringHandlers.CToString(bpb.oem_name)).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_sector, bpb.bps).AppendLine();
// sb.AppendFormat("{0} sectors per cluster", hpfs_bpb.spc).AppendLine();
// sb.AppendFormat("{0} reserved sectors", hpfs_bpb.rsectors).AppendLine();
// sb.AppendFormat("{0} FATs", hpfs_bpb.fats_no).AppendLine();
// sb.AppendFormat("{0} entries on root directory", hpfs_bpb.root_ent).AppendLine();
// sb.AppendFormat("{0} mini sectors on volume", hpfs_bpb.sectors).AppendLine();
sb.AppendFormat("Media descriptor: 0x{0:X2}", bpb.media).AppendLine();
sb.AppendFormat(Localization.Media_descriptor_0, bpb.media).AppendLine();
// sb.AppendFormat("{0} sectors per FAT", hpfs_bpb.spfat).AppendLine();
// sb.AppendFormat("{0} sectors per track", hpfs_bpb.sptrk).AppendLine();
// sb.AppendFormat("{0} heads", hpfs_bpb.heads).AppendLine();
sb.AppendFormat("{0} sectors hidden before BPB", bpb.hsectors).AppendLine();
sb.AppendFormat(Localization._0_sectors_hidden_before_BPB, bpb.hsectors).AppendLine();
sb.AppendFormat("{0} sectors on volume ({1} bytes)", hpfsSb.sectors, hpfsSb.sectors * bpb.bps).AppendLine();
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, hpfsSb.sectors, hpfsSb.sectors * bpb.bps).
AppendLine();
// sb.AppendFormat("{0} sectors on volume ({1} bytes)", hpfs_bpb.big_sectors, hpfs_bpb.big_sectors * hpfs_bpb.bps).AppendLine();
sb.AppendFormat("BIOS Drive Number: 0x{0:X2}", bpb.drive_no).AppendLine();
sb.AppendFormat("NT Flags: 0x{0:X2}", bpb.nt_flags).AppendLine();
sb.AppendFormat("Signature: 0x{0:X2}", bpb.signature).AppendLine();
sb.AppendFormat("Serial number: 0x{0:X8}", bpb.serial_no).AppendLine();
sb.AppendFormat("Volume label: {0}", StringHandlers.CToString(bpb.volume_label, Encoding)).AppendLine();
sb.AppendFormat(Localization.BIOS_drive_number_0, bpb.drive_no).AppendLine();
sb.AppendFormat(Localization.NT_Flags_0, bpb.nt_flags).AppendLine();
sb.AppendFormat(Localization.Signature_0, bpb.signature).AppendLine();
sb.AppendFormat(Localization.Serial_number_0, bpb.serial_no).AppendLine();
sb.AppendFormat(Localization.Volume_label_0, StringHandlers.CToString(bpb.volume_label, Encoding)).AppendLine();
// sb.AppendFormat("Filesystem type: \"{0}\"", hpfs_bpb.fs_type).AppendLine();
DateTime lastChk = DateHandlers.UnixToDateTime(hpfsSb.last_chkdsk);
DateTime lastOptim = DateHandlers.UnixToDateTime(hpfsSb.last_optim);
sb.AppendFormat("HPFS version: {0}", hpfsSb.version).AppendLine();
sb.AppendFormat("Functional version: {0}", hpfsSb.func_version).AppendLine();
sb.AppendFormat("Sector of root directory FNode: {0}", hpfsSb.root_fnode).AppendLine();
sb.AppendFormat("{0} sectors are marked bad", hpfsSb.badblocks).AppendLine();
sb.AppendFormat("Sector of free space bitmaps: {0}", hpfsSb.bitmap_lsn).AppendLine();
sb.AppendFormat("Sector of bad blocks list: {0}", hpfsSb.badblock_lsn).AppendLine();
sb.AppendFormat(Localization.HPFS_version_0, hpfsSb.version).AppendLine();
sb.AppendFormat(Localization.Functional_version_0, hpfsSb.func_version).AppendLine();
sb.AppendFormat(Localization.Sector_of_root_directory_FNode_0, hpfsSb.root_fnode).AppendLine();
sb.AppendFormat(Localization._0_sectors_are_marked_bad, hpfsSb.badblocks).AppendLine();
sb.AppendFormat(Localization.Sector_of_free_space_bitmaps_0, hpfsSb.bitmap_lsn).AppendLine();
sb.AppendFormat(Localization.Sector_of_bad_blocks_list_0, hpfsSb.badblock_lsn).AppendLine();
if(hpfsSb.last_chkdsk > 0)
sb.AppendFormat("Date of last integrity check: {0}", lastChk).AppendLine();
sb.AppendFormat(Localization.Date_of_last_integrity_check_0, lastChk).AppendLine();
else
sb.AppendLine("Filesystem integrity has never been checked");
sb.AppendLine(Localization.Filesystem_integrity_has_never_been_checked);
if(hpfsSb.last_optim > 0)
sb.AppendFormat("Date of last optimization {0}", lastOptim).AppendLine();
sb.AppendFormat(Localization.Date_of_last_optimization_0, lastOptim).AppendLine();
else
sb.AppendLine("Filesystem has never been optimized");
sb.AppendLine(Localization.Filesystem_has_never_been_optimized);
sb.AppendFormat("Directory band has {0} sectors", hpfsSb.dband_sectors).AppendLine();
sb.AppendFormat("Directory band starts at sector {0}", hpfsSb.dband_start).AppendLine();
sb.AppendFormat("Directory band ends at sector {0}", hpfsSb.dband_last).AppendLine();
sb.AppendFormat("Sector of directory band bitmap: {0}", hpfsSb.dband_bitmap).AppendLine();
sb.AppendFormat("Sector of ACL directory: {0}", hpfsSb.acl_start).AppendLine();
sb.AppendFormat(Localization.Directory_band_has_0_sectors, hpfsSb.dband_sectors).AppendLine();
sb.AppendFormat(Localization.Directory_band_starts_at_sector_0, hpfsSb.dband_start).AppendLine();
sb.AppendFormat(Localization.Directory_band_ends_at_sector_0, hpfsSb.dband_last).AppendLine();
sb.AppendFormat(Localization.Sector_of_directory_band_bitmap_0, hpfsSb.dband_bitmap).AppendLine();
sb.AppendFormat(Localization.Sector_of_ACL_directory_0, hpfsSb.acl_start).AppendLine();
sb.AppendFormat("Sector of Hotfix directory: {0}", sp.hotfix_start).AppendLine();
sb.AppendFormat("{0} used Hotfix entries", sp.hotfix_used).AppendLine();
sb.AppendFormat("{0} total Hotfix entries", sp.hotfix_entries).AppendLine();
sb.AppendFormat("{0} free spare DNodes", sp.spare_dnodes_free).AppendLine();
sb.AppendFormat("{0} total spare DNodes", sp.spare_dnodes).AppendLine();
sb.AppendFormat("Sector of codepage directory: {0}", sp.codepage_lsn).AppendLine();
sb.AppendFormat("{0} codepages used in the volume", sp.codepages).AppendLine();
sb.AppendFormat("SuperBlock CRC32: {0:X8}", sp.sb_crc32).AppendLine();
sb.AppendFormat("SpareBlock CRC32: {0:X8}", sp.sp_crc32).AppendLine();
sb.AppendFormat(Localization.Sector_of_Hotfix_directory_0, sp.hotfix_start).AppendLine();
sb.AppendFormat(Localization._0_used_Hotfix_entries, sp.hotfix_used).AppendLine();
sb.AppendFormat(Localization._0_total_Hotfix_entries, sp.hotfix_entries).AppendLine();
sb.AppendFormat(Localization._0_free_spare_DNodes, sp.spare_dnodes_free).AppendLine();
sb.AppendFormat(Localization._0_total_spare_DNodes, sp.spare_dnodes).AppendLine();
sb.AppendFormat(Localization.Sector_of_codepage_directory_0, sp.codepage_lsn).AppendLine();
sb.AppendFormat(Localization._0_codepages_used_in_the_volume, sp.codepages).AppendLine();
sb.AppendFormat(Localization.SuperBlock_CRC32_0, sp.sb_crc32).AppendLine();
sb.AppendFormat(Localization.SpareBlock_CRC32_0, sp.sp_crc32).AppendLine();
sb.AppendLine("Flags:");
sb.AppendLine((sp.flags1 & 0x01) == 0x01 ? "Filesystem is dirty." : "Filesystem is clean.");
sb.AppendLine(Localization.Flags);
sb.AppendLine((sp.flags1 & 0x01) == 0x01 ? Localization.Filesystem_is_dirty : Localization.Filesystem_is_clean);
if((sp.flags1 & 0x02) == 0x02)
sb.AppendLine("Spare directory blocks are in use");
sb.AppendLine(Localization.Spare_directory_blocks_are_in_use);
if((sp.flags1 & 0x04) == 0x04)
sb.AppendLine("Hotfixes are in use");
sb.AppendLine(Localization.Hotfixes_are_in_use);
if((sp.flags1 & 0x08) == 0x08)
sb.AppendLine("Disk contains bad sectors");
sb.AppendLine(Localization.Disk_contains_bad_sectors);
if((sp.flags1 & 0x10) == 0x10)
sb.AppendLine("Disk has a bad bitmap");
sb.AppendLine(Localization.Disk_has_a_bad_bitmap);
if((sp.flags1 & 0x20) == 0x20)
sb.AppendLine("Filesystem was formatted fast");
sb.AppendLine(Localization.Filesystem_was_formatted_fast);
if((sp.flags1 & 0x40) == 0x40)
sb.AppendLine("Unknown flag 0x40 on flags1 is active");
sb.AppendLine(Localization.Unknown_flag_0x40_on_flags1_is_active);
if((sp.flags1 & 0x80) == 0x80)
sb.AppendLine("Filesystem has been mounted by an old IFS");
sb.AppendLine(Localization.Filesystem_has_been_mounted_by_an_old_IFS);
if((sp.flags2 & 0x01) == 0x01)
sb.AppendLine("Install DASD limits");
sb.AppendLine(Localization.Install_DASD_limits);
if((sp.flags2 & 0x02) == 0x02)
sb.AppendLine("Resync DASD limits");
sb.AppendLine(Localization.Resync_DASD_limits);
if((sp.flags2 & 0x04) == 0x04)
sb.AppendLine("DASD limits are operational");
sb.AppendLine(Localization.DASD_limits_are_operational);
if((sp.flags2 & 0x08) == 0x08)
sb.AppendLine("Multimedia is active");
sb.AppendLine(Localization.Multimedia_is_active);
if((sp.flags2 & 0x10) == 0x10)
sb.AppendLine("DCE ACLs are active");
sb.AppendLine(Localization.DCE_ACLs_are_active);
if((sp.flags2 & 0x20) == 0x20)
sb.AppendLine("DASD limits are dirty");
sb.AppendLine(Localization.DASD_limits_are_dirty);
if((sp.flags2 & 0x40) == 0x40)
sb.AppendLine("Unknown flag 0x40 on flags2 is active");
sb.AppendLine(Localization.Unknown_flag_0x40_on_flags2_is_active);
if((sp.flags2 & 0x80) == 0x80)
sb.AppendLine("Unknown flag 0x80 on flags2 is active");
sb.AppendLine(Localization.Unknown_flag_0x80_on_flags2_is_active);
XmlFsType = new FileSystemType();
@@ -245,14 +247,14 @@ public sealed class HPFS : IFilesystem
{
XmlFsType.Bootable = true;
string bootChk = Sha1Context.Data(bpb.boot_code, out byte[] _);
sb.AppendLine("Volume is bootable");
sb.AppendFormat("Boot code's SHA1: {0}", bootChk).AppendLine();
sb.AppendLine(Localization.Volume_is_bootable);
sb.AppendFormat(Localization.Boot_code_SHA1_0, bootChk).AppendLine();
}
XmlFsType.Dirty |= (sp.flags1 & 0x01) == 0x01;
XmlFsType.Clusters = hpfsSb.sectors;
XmlFsType.ClusterSize = bpb.bps;
XmlFsType.Type = "HPFS";
XmlFsType.Type = FS_TYPE;
XmlFsType.VolumeName = StringHandlers.CToString(bpb.volume_label, Encoding);
XmlFsType.VolumeSerial = $"{bpb.serial_no:X8}";
XmlFsType.SystemIdentifier = StringHandlers.CToString(bpb.oem_name);

View File

@@ -46,4 +46,7 @@ public sealed partial class HPOFS
{
0x56, 0x4F, 0x4C, 0x49, 0x4E, 0x46, 0x4F, 0x20
};
// Do not translate
const string FS_TYPE = "hpofs";
}

View File

@@ -48,9 +48,9 @@ public sealed partial class HPOFS : IFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "High Performance Optical File System";
public string Name => Localization.HPOFS_Name;
/// <inheritdoc />
public Guid Id => new("1b72dcd5-d031-4757-8a9f-8d2fb18c59e2");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
}

View File

@@ -179,35 +179,38 @@ public sealed partial class HPOFS
AaruConsole.DebugWriteLine("HPOFS Plugin", "vib.filler is empty? = {0}",
ArrayHelpers.ArrayIsNullOrEmpty(vib.filler));
sb.AppendLine("High Performance Optical File System");
sb.AppendFormat("OEM name: {0}", StringHandlers.SpacePaddedToString(bpb.oem_name)).AppendLine();
sb.AppendFormat("{0} bytes per sector", bpb.bps).AppendLine();
sb.AppendFormat("{0} sectors per cluster", bpb.spc).AppendLine();
sb.AppendFormat("Media descriptor: 0x{0:X2}", bpb.media).AppendLine();
sb.AppendFormat("{0} sectors per track", bpb.sptrk).AppendLine();
sb.AppendFormat("{0} heads", bpb.heads).AppendLine();
sb.AppendFormat("{0} sectors hidden before BPB", bpb.hsectors).AppendLine();
sb.AppendFormat("{0} sectors on volume ({1} bytes)", mib.sectors, mib.sectors * bpb.bps).AppendLine();
sb.AppendFormat("BIOS Drive Number: 0x{0:X2}", bpb.drive_no).AppendLine();
sb.AppendFormat("Serial number: 0x{0:X8}", mib.serial).AppendLine();
sb.AppendLine(Localization.HPOFS_Name);
sb.AppendFormat(Localization.OEM_name_0, StringHandlers.SpacePaddedToString(bpb.oem_name)).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_sector, bpb.bps).AppendLine();
sb.AppendFormat(Localization._0_sectors_per_cluster, bpb.spc).AppendLine();
sb.AppendFormat(Localization.Media_descriptor_0, bpb.media).AppendLine();
sb.AppendFormat(Localization._0_sectors_per_track, bpb.sptrk).AppendLine();
sb.AppendFormat(Localization._0_heads, bpb.heads).AppendLine();
sb.AppendFormat(Localization._0_sectors_hidden_before_BPB, bpb.hsectors).AppendLine();
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, mib.sectors, mib.sectors * bpb.bps).AppendLine();
sb.AppendFormat(Localization.BIOS_drive_number_0, bpb.drive_no).AppendLine();
sb.AppendFormat(Localization.Serial_number_0, mib.serial).AppendLine();
sb.AppendFormat("Volume label: {0}", StringHandlers.SpacePaddedToString(mib.volumeLabel, Encoding)).
sb.AppendFormat(Localization.Volume_label_0, StringHandlers.SpacePaddedToString(mib.volumeLabel, Encoding)).
AppendLine();
sb.AppendFormat("Volume comment: {0}", StringHandlers.SpacePaddedToString(mib.comment, Encoding)).AppendLine();
sb.AppendFormat("Volume owner: {0}", StringHandlers.SpacePaddedToString(vib.owner, Encoding)).AppendLine();
sb.AppendFormat("Volume created on {0}", DateHandlers.DosToDateTime(mib.creationDate, mib.creationTime)).
sb.AppendFormat(Localization.Volume_comment_0, StringHandlers.SpacePaddedToString(mib.comment, Encoding)).
AppendLine();
sb.AppendFormat("Volume uses {0} codepage {1}",
mib.codepageType is > 0 and < 3 ? mib.codepageType == 2 ? "EBCDIC" : "ASCII" : "Unknown",
mib.codepage).AppendLine();
sb.AppendFormat(Localization.Volume_owner_0, StringHandlers.SpacePaddedToString(vib.owner, Encoding)).
AppendLine();
sb.AppendFormat("RPS level: {0}", mib.rps).AppendLine();
sb.AppendFormat("Filesystem version: {0}.{1}", mib.major, mib.minor).AppendLine();
sb.AppendFormat("Volume can be filled up to {0}%", vib.percentFull).AppendLine();
sb.AppendFormat(Localization.Volume_created_on_0,
DateHandlers.DosToDateTime(mib.creationDate, mib.creationTime)).AppendLine();
sb.AppendFormat(Localization.Volume_uses_0_codepage_1,
mib.codepageType is > 0 and < 3
? mib.codepageType == 2 ? Localization.EBCDIC : Localization.ASCII
: Localization.Unknown_codepage, mib.codepage).AppendLine();
sb.AppendFormat(Localization.RPS_level_0, mib.rps).AppendLine();
sb.AppendFormat(Localization.Filesystem_version_0_1, mib.major, mib.minor).AppendLine();
sb.AppendFormat(Localization.Volume_can_be_filled_up_to_0, vib.percentFull).AppendLine();
XmlFsType = new FileSystemType
{
@@ -216,7 +219,7 @@ public sealed partial class HPOFS
CreationDate = DateHandlers.DosToDateTime(mib.creationDate, mib.creationTime),
CreationDateSpecified = true,
DataPreparerIdentifier = StringHandlers.SpacePaddedToString(vib.owner, Encoding),
Type = "HPOFS",
Type = FS_TYPE,
VolumeName = StringHandlers.SpacePaddedToString(mib.volumeLabel, Encoding),
VolumeSerial = $"{mib.serial:X8}",
SystemIdentifier = StringHandlers.SpacePaddedToString(bpb.oem_name)

View File

@@ -47,4 +47,8 @@ public sealed partial class ISO9660
Normal, Vms, Joliet,
Rrip, Romeo
}
const string FS_TYPE_HSF = "hfs";
const string FS_TYPE_CDI = "cdi";
const string FS_TYPE_ISO = "iso9660";
}

View File

@@ -156,7 +156,7 @@ public sealed partial class ISO9660
}
catch(Exception e)
{
AaruConsole.DebugWriteLine("ISO9660 plugin", "Exception reading CD-i audio file");
AaruConsole.DebugWriteLine("ISO9660 plugin", Localization.Exception_reading_CD_i_audio_file);
AaruConsole.DebugWriteLine("ISO9660 plugin", "{0}", e);
return ErrorNumber.UnexpectedException;

View File

@@ -71,7 +71,7 @@ public sealed partial class ISO9660 : IReadOnlyFilesystem
/// <inheritdoc />
public Guid Id => new("d812f4d3-c357-400d-90fd-3b22ef786aa8");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public IEnumerable<(string name, Type type, string description)> SupportedOptions =>

View File

@@ -134,10 +134,10 @@ public sealed partial class ISO9660
while(true)
{
AaruConsole.DebugWriteLine("ISO9660 plugin", "Processing VD loop no. {0}", counter);
AaruConsole.DebugWriteLine("ISO9660 plugin", Localization.Processing_VD_loop_no_0, counter);
// Seek to Volume Descriptor
AaruConsole.DebugWriteLine("ISO9660 plugin", "Reading sector {0}", 16 + counter + partition.Start);
AaruConsole.DebugWriteLine("ISO9660 plugin", Localization.Reading_sector_0, 16 + counter + partition.Start);
errno = imagePlugin.ReadSector(16 + counter + partition.Start, out byte[] vdSectorTmp);
if(errno != ErrorNumber.NoError)
@@ -178,7 +178,7 @@ public sealed partial class ISO9660
{
bvd = Marshal.ByteArrayToStructureLittleEndian<BootRecord>(vdSector, hsOff, 2048 - hsOff);
bootSpec = "Unknown";
bootSpec = Localization.Unknown_specification;
if(Encoding.GetString(bvd.Value.system_id)[..23] == "EL TORITO SPECIFICATION")
{
@@ -219,7 +219,7 @@ public sealed partial class ISO9660
jolietvd = svd;
else
AaruConsole.WriteLine("ISO9660 plugin",
"Found unknown supplementary volume descriptor");
Localization.Found_unknown_supplementary_volume_descriptor);
}
else
evd = true;
@@ -247,7 +247,7 @@ public sealed partial class ISO9660
hsvd == null &&
fsvd == null)
{
information = "ERROR: Could not find primary volume descriptor";
information = Localization.ERROR_Could_not_find_primary_volume_descriptor;
return;
}
@@ -513,9 +513,9 @@ public sealed partial class ISO9660
if(refareas.Count > 0)
{
suspInformation.AppendLine("----------------------------------------");
suspInformation.AppendLine("SYSTEM USE SHARING PROTOCOL INFORMATION:");
suspInformation.AppendLine("----------------------------------------");
suspInformation.AppendLine(Localization.SYSTEM_USE_SHARING_PROTOCOL_INFORMATION_border);
suspInformation.AppendLine(Localization.SYSTEM_USE_SHARING_PROTOCOL_INFORMATION);
suspInformation.AppendLine(Localization.SYSTEM_USE_SHARING_PROTOCOL_INFORMATION_border);
counter = 1;
@@ -529,10 +529,10 @@ public sealed partial class ISO9660
string extSrc = Encoding.GetString(erb, Marshal.SizeOf<ReferenceArea>() + er.id_len + er.des_len,
er.src_len);
suspInformation.AppendFormat("Extension: {0}", counter).AppendLine();
suspInformation.AppendFormat("\tID: {0}, version {1}", extId, er.ext_ver).AppendLine();
suspInformation.AppendFormat("\tDescription: {0}", extDes).AppendLine();
suspInformation.AppendFormat("\tSource: {0}", extSrc).AppendLine();
suspInformation.AppendFormat(Localization.Extension_0, counter).AppendLine();
suspInformation.AppendFormat("\t" + Localization.ID_0_version_1, extId, er.ext_ver).AppendLine();
suspInformation.AppendFormat("\t" + Localization.Description_0, extDes).AppendLine();
suspInformation.AppendFormat("\t" + Localization.Source_0, extSrc).AppendLine();
counter++;
}
}
@@ -546,134 +546,146 @@ public sealed partial class ISO9660
Saturn.IPBin? saturn = Saturn.DecodeIPBin(ipbinSector);
Dreamcast.IPBin? dreamcast = Dreamcast.DecodeIPBin(ipbinSector);
string fsFormat;
if(highSierraInfo)
fsFormat = "High Sierra Format";
isoMetadata.AppendLine(Localization.High_Sierra_Format_file_system);
else if(cdiInfo)
fsFormat = "CD-i";
isoMetadata.AppendLine(Localization.CD_i_file_system);
else
fsFormat = "ISO9660";
isoMetadata.AppendFormat("{0} file system", fsFormat).AppendLine();
isoMetadata.AppendLine(Localization.ISO9660_file_system);
if(xaExtensions)
isoMetadata.AppendLine("CD-ROM XA extensions present.");
isoMetadata.AppendLine(Localization.CD_ROM_XA_extensions_present);
if(amiga)
isoMetadata.AppendLine("Amiga extensions present.");
isoMetadata.AppendLine(Localization.Amiga_extensions_present);
if(apple)
isoMetadata.AppendLine("Apple extensions present.");
isoMetadata.AppendLine(Localization.Apple_extensions_present);
if(jolietvd != null)
isoMetadata.AppendLine("Joliet extensions present.");
isoMetadata.AppendLine(Localization.Joliet_extensions_present);
if(susp)
isoMetadata.AppendLine("System Use Sharing Protocol present.");
isoMetadata.AppendLine(Localization.System_Use_Sharing_Protocol_present);
if(rrip)
isoMetadata.AppendLine("Rock Ridge Interchange Protocol present.");
isoMetadata.AppendLine(Localization.Rock_Ridge_Interchange_Protocol_present);
if(aaip)
isoMetadata.AppendLine("Arbitrary Attribute Interchange Protocol present.");
isoMetadata.AppendLine(Localization.Arbitrary_Attribute_Interchange_Protocol_present);
if(ziso)
isoMetadata.AppendLine("zisofs compression present.");
isoMetadata.AppendLine(Localization.zisofs_compression_present);
if(evd)
isoMetadata.AppendLine("Contains Enhanced Volume Descriptor.");
isoMetadata.AppendLine(Localization.Contains_Enhanced_Volume_Descriptor);
if(vpd)
isoMetadata.AppendLine("Contains Volume Partition Descriptor.");
isoMetadata.AppendLine(Localization.Contains_Volume_Partition_Descriptor);
if(bvd != null)
isoMetadata.AppendFormat("Disc bootable following {0} specifications.", bootSpec).AppendLine();
isoMetadata.AppendFormat(Localization.Disc_bootable_following_0_specifications, bootSpec).AppendLine();
if(segaCd != null)
{
isoMetadata.AppendLine("This is a SegaCD / MegaCD disc.");
isoMetadata.AppendLine(Localization.This_is_a_SegaCD_MegaCD_disc);
isoMetadata.AppendLine(CD.Prettify(segaCd));
}
if(saturn != null)
{
isoMetadata.AppendLine("This is a Sega Saturn disc.");
isoMetadata.AppendLine(Localization.This_is_a_Sega_Saturn_disc);
isoMetadata.AppendLine(Saturn.Prettify(saturn));
}
if(dreamcast != null)
{
isoMetadata.AppendLine("This is a Sega Dreamcast disc.");
isoMetadata.AppendLine(Localization.This_is_a_Sega_Dreamcast_disc);
isoMetadata.AppendLine(Dreamcast.Prettify(dreamcast));
}
isoMetadata.AppendFormat("{0}------------------------------", cdiInfo ? "---------------" : "").AppendLine();
if(cdiInfo)
{
isoMetadata.AppendLine(Localization.FILE_STRUCTURE_VOLUME_DESCRIPTOR_INFORMATION_border);
isoMetadata.AppendLine(Localization.FILE_STRUCTURE_VOLUME_DESCRIPTOR_INFORMATION);
isoMetadata.AppendLine(Localization.FILE_STRUCTURE_VOLUME_DESCRIPTOR_INFORMATION_border);
}
else
{
isoMetadata.AppendLine(Localization.VOLUME_DESCRIPTOR_INFORMATION_border);
isoMetadata.AppendLine(Localization.VOLUME_DESCRIPTOR_INFORMATION);
isoMetadata.AppendLine(Localization.VOLUME_DESCRIPTOR_INFORMATION_border);
}
isoMetadata.AppendFormat("{0}VOLUME DESCRIPTOR INFORMATION:", cdiInfo ? "FILE STRUCTURE " : "").AppendLine();
isoMetadata.AppendFormat(Localization.System_identifier_0, decodedVd.SystemIdentifier).AppendLine();
isoMetadata.AppendFormat(Localization.Volume_identifier_0, decodedVd.VolumeIdentifier).AppendLine();
isoMetadata.AppendFormat(Localization.Volume_set_identifier_0, decodedVd.VolumeSetIdentifier).AppendLine();
isoMetadata.AppendFormat(Localization.Publisher_identifier_0, decodedVd.PublisherIdentifier).AppendLine();
isoMetadata.AppendFormat("{0}------------------------------", cdiInfo ? "---------------" : "").AppendLine();
isoMetadata.AppendFormat(Localization.Data_preparer_identifier_0, decodedVd.DataPreparerIdentifier).
AppendLine();
isoMetadata.AppendFormat("System identifier: {0}", decodedVd.SystemIdentifier).AppendLine();
isoMetadata.AppendFormat("Volume identifier: {0}", decodedVd.VolumeIdentifier).AppendLine();
isoMetadata.AppendFormat("Volume set identifier: {0}", decodedVd.VolumeSetIdentifier).AppendLine();
isoMetadata.AppendFormat("Publisher identifier: {0}", decodedVd.PublisherIdentifier).AppendLine();
isoMetadata.AppendFormat("Data preparer identifier: {0}", decodedVd.DataPreparerIdentifier).AppendLine();
isoMetadata.AppendFormat("Application identifier: {0}", decodedVd.ApplicationIdentifier).AppendLine();
isoMetadata.AppendFormat("Volume creation date: {0}", decodedVd.CreationTime).AppendLine();
isoMetadata.AppendFormat(Localization.Application_identifier_0, decodedVd.ApplicationIdentifier).AppendLine();
isoMetadata.AppendFormat(Localization.Volume_creation_date_0, decodedVd.CreationTime).AppendLine();
if(decodedVd.HasModificationTime)
isoMetadata.AppendFormat("Volume modification date: {0}", decodedVd.ModificationTime).AppendLine();
isoMetadata.AppendFormat(Localization.Volume_modification_date_0, decodedVd.ModificationTime).AppendLine();
else
isoMetadata.AppendFormat("Volume has not been modified.").AppendLine();
isoMetadata.AppendFormat(Localization.Volume_has_not_been_modified).AppendLine();
if(decodedVd.HasExpirationTime)
isoMetadata.AppendFormat("Volume expiration date: {0}", decodedVd.ExpirationTime).AppendLine();
isoMetadata.AppendFormat(Localization.Volume_expiration_date_0, decodedVd.ExpirationTime).AppendLine();
else
isoMetadata.AppendFormat("Volume does not expire.").AppendLine();
isoMetadata.AppendFormat(Localization.Volume_does_not_expire).AppendLine();
if(decodedVd.HasEffectiveTime)
isoMetadata.AppendFormat("Volume effective date: {0}", decodedVd.EffectiveTime).AppendLine();
isoMetadata.AppendFormat(Localization.Volume_effective_date_0, decodedVd.EffectiveTime).AppendLine();
else
isoMetadata.AppendFormat("Volume has always been effective.").AppendLine();
isoMetadata.AppendFormat(Localization.Volume_has_always_been_effective).AppendLine();
isoMetadata.AppendFormat("Volume has {0} blocks of {1} bytes each", decodedVd.Blocks, decodedVd.BlockSize).
AppendLine();
isoMetadata.
AppendFormat(Localization.Volume_has_0_blocks_of_1_bytes_each, decodedVd.Blocks, decodedVd.BlockSize).
AppendLine();
if(jolietvd != null)
{
isoMetadata.AppendLine("-------------------------------------");
isoMetadata.AppendLine("JOLIET VOLUME DESCRIPTOR INFORMATION:");
isoMetadata.AppendLine("-------------------------------------");
isoMetadata.AppendFormat("System identifier: {0}", decodedJolietVd.SystemIdentifier).AppendLine();
isoMetadata.AppendFormat("Volume identifier: {0}", decodedJolietVd.VolumeIdentifier).AppendLine();
isoMetadata.AppendLine(Localization.JOLIET_VOLUME_DESCRIPTOR_INFORMATION_border);
isoMetadata.AppendLine(Localization.JOLIET_VOLUME_DESCRIPTOR_INFORMATION);
isoMetadata.AppendLine(Localization.JOLIET_VOLUME_DESCRIPTOR_INFORMATION_border);
isoMetadata.AppendFormat(Localization.System_identifier_0, decodedJolietVd.SystemIdentifier).AppendLine();
isoMetadata.AppendFormat(Localization.Volume_identifier_0, decodedJolietVd.VolumeIdentifier).AppendLine();
isoMetadata.AppendFormat("Volume set identifier: {0}", decodedJolietVd.VolumeSetIdentifier).AppendLine();
isoMetadata.AppendFormat("Publisher identifier: {0}", decodedJolietVd.PublisherIdentifier).AppendLine();
isoMetadata.AppendFormat("Data preparer identifier: {0}", decodedJolietVd.DataPreparerIdentifier).
isoMetadata.AppendFormat(Localization.Volume_set_identifier_0, decodedJolietVd.VolumeSetIdentifier).
AppendLine();
isoMetadata.AppendFormat("Application identifier: {0}", decodedJolietVd.ApplicationIdentifier).AppendLine();
isoMetadata.AppendFormat(Localization.Publisher_identifier_0, decodedJolietVd.PublisherIdentifier).
AppendLine();
isoMetadata.AppendFormat("Volume creation date: {0}", decodedJolietVd.CreationTime).AppendLine();
isoMetadata.AppendFormat(Localization.Data_preparer_identifier_0, decodedJolietVd.DataPreparerIdentifier).
AppendLine();
isoMetadata.AppendFormat(Localization.Application_identifier_0, decodedJolietVd.ApplicationIdentifier).
AppendLine();
isoMetadata.AppendFormat(Localization.Volume_creation_date_0, decodedJolietVd.CreationTime).AppendLine();
if(decodedJolietVd.HasModificationTime)
isoMetadata.AppendFormat("Volume modification date: {0}", decodedJolietVd.ModificationTime).
isoMetadata.AppendFormat(Localization.Volume_modification_date_0, decodedJolietVd.ModificationTime).
AppendLine();
else
isoMetadata.AppendFormat("Volume has not been modified.").AppendLine();
isoMetadata.AppendFormat(Localization.Volume_has_not_been_modified).AppendLine();
if(decodedJolietVd.HasExpirationTime)
isoMetadata.AppendFormat("Volume expiration date: {0}", decodedJolietVd.ExpirationTime).AppendLine();
isoMetadata.AppendFormat(Localization.Volume_expiration_date_0, decodedJolietVd.ExpirationTime).
AppendLine();
else
isoMetadata.AppendFormat("Volume does not expire.").AppendLine();
isoMetadata.AppendFormat(Localization.Volume_does_not_expire).AppendLine();
if(decodedJolietVd.HasEffectiveTime)
isoMetadata.AppendFormat("Volume effective date: {0}", decodedJolietVd.EffectiveTime).AppendLine();
isoMetadata.AppendFormat(Localization.Volume_effective_date_0, decodedJolietVd.EffectiveTime).
AppendLine();
else
isoMetadata.AppendFormat("Volume has always been effective.").AppendLine();
isoMetadata.AppendFormat(Localization.Volume_has_always_been_effective).AppendLine();
}
if(torito != null)
@@ -714,60 +726,63 @@ public sealed partial class ISO9660
imagePlugin.ReadSectors(initialEntry.load_rba + partition.Start, initialEntry.sector_count,
out bootImage);
isoMetadata.AppendLine("----------------------");
isoMetadata.AppendLine("EL TORITO INFORMATION:");
isoMetadata.AppendLine("----------------------");
isoMetadata.AppendLine(Localization.EL_TORITO_INFORMATION_border);
isoMetadata.AppendLine(Localization.EL_TORITO_INFORMATION);
isoMetadata.AppendLine(Localization.EL_TORITO_INFORMATION_border);
isoMetadata.AppendLine("Initial entry:");
isoMetadata.AppendFormat("\tDeveloper ID: {0}", Encoding.GetString(valentry.developer_id)).AppendLine();
isoMetadata.AppendLine(Localization.Initial_entry);
isoMetadata.AppendFormat("\t" + Localization.Developer_ID_0, Encoding.GetString(valentry.developer_id)).
AppendLine();
if(initialEntry.bootable == ElToritoIndicator.Bootable)
{
isoMetadata.AppendFormat("\tBootable on {0}", valentry.platform_id).AppendLine();
isoMetadata.AppendFormat("\t" + Localization.Bootable_on_0, valentry.platform_id).AppendLine();
isoMetadata.AppendFormat("\tBootable image starts at sector {0} and runs for {1} sectors",
isoMetadata.AppendFormat("\t" + Localization.Bootable_image_starts_at_sector_0_and_runs_for_1_sectors,
initialEntry.load_rba, initialEntry.sector_count).AppendLine();
if(valentry.platform_id == ElToritoPlatform.x86)
isoMetadata.AppendFormat("\tBootable image will be loaded at segment {0:X4}h",
isoMetadata.AppendFormat("\t" + Localization.Bootable_image_will_be_loaded_at_segment_0,
initialEntry.load_seg == 0 ? 0x7C0 : initialEntry.load_seg).AppendLine();
else
isoMetadata.AppendFormat("\tBootable image will be loaded at 0x{0:X8}",
isoMetadata.AppendFormat("\t" + Localization.Bootable_image_will_be_loaded_at_0,
(uint)initialEntry.load_seg * 10).AppendLine();
switch(initialEntry.boot_type)
{
case ElToritoEmulation.None:
isoMetadata.AppendLine("\tImage uses no emulation");
isoMetadata.AppendLine("\t" + Localization.Image_uses_no_emulation);
break;
case ElToritoEmulation.Md2Hd:
isoMetadata.AppendLine("\tImage emulates a 5.25\" high-density (MD2HD, 1.2Mb) floppy");
isoMetadata.AppendLine("\t" + Localization.Image_emulates_a_high_density_MD2HD_floppy);
break;
case ElToritoEmulation.Mf2Hd:
isoMetadata.AppendLine("\tImage emulates a 3.5\" high-density (MF2HD, 1.44Mb) floppy");
isoMetadata.AppendLine("\t" + Localization.Image_emulates_a_high_density_MF2HD_floppy);
break;
case ElToritoEmulation.Mf2Ed:
isoMetadata.AppendLine("\tImage emulates a 3.5\" extra-density (MF2ED, 2.88Mb) floppy");
isoMetadata.AppendLine("\t" + Localization.Image_emulates_a_extra_density_MF2ED_floppy);
break;
default:
isoMetadata.AppendFormat("\tImage uses unknown emulation type {0}",
isoMetadata.AppendFormat("\t" + Localization.Image_uses_unknown_emulation_type_0,
(byte)initialEntry.boot_type).AppendLine();
break;
}
isoMetadata.AppendFormat("\tSystem type: 0x{0:X2}", initialEntry.system_type).AppendLine();
isoMetadata.AppendFormat("\t" + Localization.System_type_0, initialEntry.system_type).AppendLine();
if(bootImage != null)
isoMetadata.AppendFormat("\tBootable image's SHA1: {0}", Sha1Context.Data(bootImage, out _)).
AppendLine();
isoMetadata.
AppendFormat("\t" + Localization.Bootable_image_SHA1_0, Sha1Context.Data(bootImage, out _)).
AppendLine();
}
else
isoMetadata.AppendLine("\tNot bootable");
isoMetadata.AppendLine("\t" + Localization.Not_bootable);
toritoOff += EL_TORITO_ENTRY_SIZE;
@@ -783,10 +798,11 @@ public sealed partial class ISO9660
toritoOff += EL_TORITO_ENTRY_SIZE;
isoMetadata.AppendFormat("Boot section {0}:", sectionCounter);
isoMetadata.AppendFormat(Localization.Boot_section_0, sectionCounter);
isoMetadata.AppendFormat("\tSection ID: {0}", Encoding.GetString(sectionHeader.identifier)).
AppendLine();
isoMetadata.
AppendFormat("\t" + Localization.Section_ID_0, Encoding.GetString(sectionHeader.identifier)).
AppendLine();
for(int entryCounter = 1; entryCounter <= sectionHeader.entries && toritoOff < vdSector.Length;
entryCounter++)
@@ -797,7 +813,7 @@ public sealed partial class ISO9660
toritoOff += EL_TORITO_ENTRY_SIZE;
isoMetadata.AppendFormat("\tEntry {0}:", entryCounter);
isoMetadata.AppendFormat("\t" + Localization.Entry_0, entryCounter);
if(sectionEntry.bootable == ElToritoIndicator.Bootable)
{
@@ -807,66 +823,69 @@ public sealed partial class ISO9660
imagePlugin.ReadSectors(sectionEntry.load_rba + partition.Start, sectionEntry.sector_count,
out bootImage);
isoMetadata.AppendFormat("\t\tBootable on {0}", sectionHeader.platform_id).AppendLine();
isoMetadata.AppendFormat("\t\t" + Localization.Bootable_on_0, sectionHeader.platform_id).
AppendLine();
isoMetadata.AppendFormat("\t\tBootable image starts at sector {0} and runs for {1} sectors",
sectionEntry.load_rba, sectionEntry.sector_count).AppendLine();
isoMetadata.
AppendFormat("\t\t" + Localization.Bootable_image_starts_at_sector_0_and_runs_for_1_sectors,
sectionEntry.load_rba, sectionEntry.sector_count).AppendLine();
if(valentry.platform_id == ElToritoPlatform.x86)
isoMetadata.AppendFormat("\t\tBootable image will be loaded at segment {0:X4}h",
isoMetadata.AppendFormat("\t\t" + Localization.Bootable_image_will_be_loaded_at_segment_0,
sectionEntry.load_seg == 0 ? 0x7C0 : sectionEntry.load_seg).
AppendLine();
else
isoMetadata.AppendFormat("\t\tBootable image will be loaded at 0x{0:X8}",
isoMetadata.AppendFormat("\t\t" + Localization.Bootable_image_will_be_loaded_at_0,
(uint)sectionEntry.load_seg * 10).AppendLine();
switch((ElToritoEmulation)((byte)sectionEntry.boot_type & 0xF))
{
case ElToritoEmulation.None:
isoMetadata.AppendLine("\t\tImage uses no emulation");
isoMetadata.AppendLine("\t\t" + Localization.Image_uses_no_emulation);
break;
case ElToritoEmulation.Md2Hd:
isoMetadata.
AppendLine("\t\tImage emulates a 5.25\" high-density (MD2HD, 1.2Mb) floppy");
isoMetadata.AppendLine("\t\t" + Localization.
Image_emulates_a_high_density_MD2HD_floppy);
break;
case ElToritoEmulation.Mf2Hd:
isoMetadata.
AppendLine("\t\tImage emulates a 3.5\" high-density (MF2HD, 1.44Mb) floppy");
isoMetadata.AppendLine("\t\t" + Localization.
Image_emulates_a_high_density_MF2HD_floppy);
break;
case ElToritoEmulation.Mf2Ed:
isoMetadata.
AppendLine("\t\tImage emulates a 3.5\" extra-density (MF2ED, 2.88Mb) floppy");
isoMetadata.AppendLine("\t\t" + Localization.
Image_emulates_a_extra_density_MF2ED_floppy);
break;
default:
isoMetadata.AppendFormat("\t\tImage uses unknown emulation type {0}",
isoMetadata.AppendFormat("\t\t" + Localization.Image_uses_unknown_emulation_type_0,
(byte)initialEntry.boot_type).AppendLine();
break;
}
isoMetadata.AppendFormat("\t\tSelection criteria type: {0}",
isoMetadata.AppendFormat("\t\t" + Localization.Selection_criteria_type_0,
sectionEntry.selection_criteria_type).AppendLine();
isoMetadata.AppendFormat("\t\tSystem type: 0x{0:X2}", sectionEntry.system_type).AppendLine();
isoMetadata.AppendFormat("\t\t" + Localization.System_type_0, sectionEntry.system_type).
AppendLine();
if(bootImage != null)
isoMetadata.AppendFormat("\t\tBootable image's SHA1: {0}",
isoMetadata.AppendFormat("\t\t" + Localization.Bootable_image_SHA1_0,
Sha1Context.Data(bootImage, out _)).AppendLine();
}
else
isoMetadata.AppendLine("\t\tNot bootable");
isoMetadata.AppendLine("\t\t" + Localization.Not_bootable);
var flags = (ElToritoFlags)((byte)sectionEntry.boot_type & 0xF0);
if(flags.HasFlag(ElToritoFlags.ATAPI))
isoMetadata.AppendLine("\t\tImage contains ATAPI drivers");
isoMetadata.AppendLine("\t\t" + Localization.Image_contains_ATAPI_drivers);
if(flags.HasFlag(ElToritoFlags.SCSI))
isoMetadata.AppendLine("\t\tImage contains SCSI drivers");
isoMetadata.AppendLine("\t\t" + Localization.Image_contains_SCSI_drivers);
if(!flags.HasFlag(ElToritoFlags.Continued))
continue;
@@ -894,7 +913,12 @@ public sealed partial class ISO9660
if(refareas.Count > 0)
isoMetadata.Append(suspInformation);
XmlFsType.Type = fsFormat;
if(_highSierra)
XmlFsType.Type = FS_TYPE_HSF;
else if(_cdi)
XmlFsType.Type = FS_TYPE_CDI;
else
XmlFsType.Type = FS_TYPE_ISO;
if(jolietvd != null)
{

View File

@@ -71,17 +71,20 @@ public sealed partial class ISO9660
switch(data.Length)
{
case 2048:
AaruConsole.DebugWriteLine("ISO9660 Plugin", "Sector {0}, Cooked, Mode 0/1 / Mode 2 Form 1",
AaruConsole.DebugWriteLine("ISO9660 Plugin",
Localization.tor_Sector_0_Cooked_Mode_zero_one_Mode_two_Form_one,
realSector);
break;
case 2324:
AaruConsole.DebugWriteLine("ISO9660 Plugin", "Sector {0}, Cooked, Mode 2 Form 2", realSector);
AaruConsole.DebugWriteLine("ISO9660 Plugin", Localization.tor_Sector_0_Cooked_Mode_two_Form_two,
realSector);
break;
case 2336:
AaruConsole.DebugWriteLine("ISO9660 Plugin",
"Sector {0}, Cooked, Mode 2 Form {1}, File Number {2}, Channel Number {3}, Submode {4}, Coding Information {5}",
Localization.
tor_Sector_0_Cooked_Mode_two_Form_1_File_Number_2_Channel_Number_3_Submode_4_Coding_Information_5,
realSector,
((Mode2Submode)data[2]).HasFlag(Mode2Submode.Form2) ? 2 : 1, data[0],
data[1], (Mode2Submode)data[2], data[3]);
@@ -90,17 +93,18 @@ public sealed partial class ISO9660
case 2352 when data[0] != 0x00 || data[1] != 0xFF || data[2] != 0xFF || data[3] != 0xFF ||
data[4] != 0xFF || data[5] != 0xFF || data[6] != 0xFF || data[7] != 0xFF ||
data[8] != 0xFF || data[9] != 0xFF || data[10] != 0xFF || data[11] != 0x00:
AaruConsole.DebugWriteLine("ISO9660 Plugin", "Sector {0}, Raw, Audio", realSector);
AaruConsole.DebugWriteLine("ISO9660 Plugin", Localization.tor_Sector_0_Raw_Audio, realSector);
break;
case 2352 when data[15] != 2:
AaruConsole.DebugWriteLine("ISO9660 Plugin", "Sector {0} ({1:X2}:{2:X2}:{3:X2}), Raw, Mode {4}",
AaruConsole.DebugWriteLine("ISO9660 Plugin", Localization.tor_Sector_0_1_2_3_Raw_Mode_4,
realSector, data[12], data[13], data[14], data[15]);
break;
case 2352:
AaruConsole.DebugWriteLine("ISO9660 Plugin",
"Sector {0} ({1:X2}:{2:X2}:{3:X2}), Raw, Mode 2 Form {4}, File Number {5}, Channel Number {6}, Submode {7}, Coding Information {8}",
Localization.
tor_Sector_0_1_2_3_Raw_Mode_two_Form_4_File_Number_5_Channel_Number_6_Submode_7_Coding_Information_8,
realSector, data[12], data[13], data[14],
((Mode2Submode)data[18]).HasFlag(Mode2Submode.Form2) ? 2 : 1,
data[16], data[17], (Mode2Submode)data[18], data[19]);
@@ -142,18 +146,20 @@ public sealed partial class ISO9660
switch(data.Length)
{
case 2048:
AaruConsole.DebugWriteLine("ISO9660 Plugin", "Sector {0}, Cooked, Mode 0/1 / Mode 2 Form 1",
AaruConsole.DebugWriteLine("ISO9660 Plugin",
Localization.tor_Sector_0_Cooked_Mode_zero_one_Mode_two_Form_one,
dstSector);
break;
case 2324:
AaruConsole.DebugWriteLine("ISO9660 Plugin", "Sector {0}, Cooked, Mode 2 Form 2",
dstSector);
AaruConsole.DebugWriteLine("ISO9660 Plugin",
Localization.tor_Sector_0_Cooked_Mode_two_Form_two, dstSector);
break;
case 2336:
AaruConsole.DebugWriteLine("ISO9660 Plugin",
"Sector {0}, Cooked, Mode 2 Form {1}, File Number {2}, Channel Number {3}, Submode {4}, Coding Information {5}",
Localization.
tor_Sector_0_Cooked_Mode_two_Form_1_File_Number_2_Channel_Number_3_Submode_4_Coding_Information_5,
dstSector,
((Mode2Submode)data[2]).HasFlag(Mode2Submode.Form2) ? 2 : 1,
data[0], data[1], (Mode2Submode)data[2], data[3]);
@@ -162,18 +168,19 @@ public sealed partial class ISO9660
case 2352 when data[0] != 0x00 || data[1] != 0xFF || data[2] != 0xFF || data[3] != 0xFF ||
data[4] != 0xFF || data[5] != 0xFF || data[6] != 0xFF || data[7] != 0xFF ||
data[8] != 0xFF || data[9] != 0xFF || data[10] != 0xFF || data[11] != 0x00:
AaruConsole.DebugWriteLine("ISO9660 Plugin", "Sector {0}, Raw, Audio", dstSector);
AaruConsole.DebugWriteLine("ISO9660 Plugin", Localization.tor_Sector_0_Raw_Audio,
dstSector);
break;
case 2352 when data[15] != 2:
AaruConsole.DebugWriteLine("ISO9660 Plugin",
"Sector {0} ({1:X2}:{2:X2}:{3:X2}), Raw, Mode {4}", dstSector,
data[12], data[13], data[14], data[15]);
AaruConsole.DebugWriteLine("ISO9660 Plugin", Localization.tor_Sector_0_1_2_3_Raw_Mode_4,
dstSector, data[12], data[13], data[14], data[15]);
break;
case 2352:
AaruConsole.DebugWriteLine("ISO9660 Plugin",
"Sector {0} ({1:X2}:{2:X2}:{3:X2}), Raw, Mode 2 Form {4}, File Number {5}, Channel Number {6}, Submode {7}, Coding Information {8}",
Localization.
tor_Sector_0_1_2_3_Raw_Mode_two_Form_4_File_Number_5_Channel_Number_6_Submode_7_Coding_Information_8,
dstSector, data[12], data[13], data[14],
((Mode2Submode)data[18]).HasFlag(Mode2Submode.Form2) ? 2 : 1,
data[16], data[17], (Mode2Submode)data[18], data[19]);

View File

@@ -44,7 +44,7 @@ public sealed partial class ISO9660
data.Length == 0)
return null;
List<PathTableEntryInternal> table = new List<PathTableEntryInternal>();
List<PathTableEntryInternal> table = new();
int off = 0;
@@ -90,7 +90,7 @@ public sealed partial class ISO9660
if(data is null)
return null;
List<PathTableEntryInternal> table = new List<PathTableEntryInternal>();
List<PathTableEntryInternal> table = new();
int off = 0;

View File

@@ -135,10 +135,10 @@ public sealed partial class ISO9660
while(true)
{
AaruConsole.DebugWriteLine("ISO9660 plugin", "Processing VD loop no. {0}", counter);
AaruConsole.DebugWriteLine("ISO9660 plugin", Localization.Processing_VD_loop_no_0, counter);
// Seek to Volume Descriptor
AaruConsole.DebugWriteLine("ISO9660 plugin", "Reading sector {0}", 16 + counter + partition.Start);
AaruConsole.DebugWriteLine("ISO9660 plugin", Localization.Reading_sector_0, 16 + counter + partition.Start);
errno = imagePlugin.ReadSector(16 + counter + partition.Start, out byte[] vdSectorTmp);
if(errno != ErrorNumber.NoError)
@@ -215,7 +215,7 @@ public sealed partial class ISO9660
jolietvd = svd;
else
AaruConsole.DebugWriteLine("ISO9660 plugin",
"Found unknown supplementary volume descriptor");
Localization.Found_unknown_supplementary_volume_descriptor);
if(_debug)
svdSectors.Add(16 + counter + partition.Start);
@@ -258,7 +258,7 @@ public sealed partial class ISO9660
hsvd == null &&
fsvd == null)
{
AaruConsole.ErrorWriteLine("ERROR: Could not find primary volume descriptor");
AaruConsole.ErrorWriteLine(Localization.ERROR_Could_not_find_primary_volume_descriptor);
return ErrorNumber.InvalidArgument;
}
@@ -294,7 +294,7 @@ public sealed partial class ISO9660
if(errno != ErrorNumber.NoError)
pathTableData = null;
fsFormat = "High Sierra Format";
fsFormat = FS_TYPE_HSF;
pathTableMsbLocation = hsvd.Value.mandatory_path_table_msb;
pathTableLsbLocation = hsvd.Value.mandatory_path_table_lsb;
@@ -308,7 +308,7 @@ public sealed partial class ISO9660
if(errno != ErrorNumber.NoError)
pathTableData = null;
fsFormat = "CD-i";
fsFormat = FS_TYPE_CDI;
pathTableMsbLocation = fsvd.Value.path_table_addr;
@@ -325,7 +325,7 @@ public sealed partial class ISO9660
if(errno != ErrorNumber.NoError)
pathTableData = null;
fsFormat = "ISO9660";
fsFormat = FS_TYPE_ISO;
pathTableMsbLocation = pvd.Value.type_m_path_table;
pathTableLsbLocation = pvd.Value.type_l_path_table;
@@ -368,7 +368,8 @@ public sealed partial class ISO9660
rootLocation != _pathTable[0].Extent)
{
AaruConsole.DebugWriteLine("ISO9660 plugin",
"Path table and PVD do not point to the same location for the root directory!");
Localization.
Path_table_and_PVD_do_not_point_to_the_same_location_for_the_root_directory);
errno = ReadSector(rootLocation, out byte[] firstRootSector);
@@ -397,7 +398,8 @@ public sealed partial class ISO9660
if(pvdWrongRoot)
{
AaruConsole.DebugWriteLine("ISO9660 plugin",
"PVD does not point to correct root directory, checking path table...");
Localization.
PVD_does_not_point_to_correct_root_directory_checking_path_table);
bool pathTableWrongRoot = false;
@@ -424,7 +426,7 @@ public sealed partial class ISO9660
if(pathTableWrongRoot)
{
AaruConsole.ErrorWriteLine("Cannot find root directory...");
AaruConsole.ErrorWriteLine(Localization.Cannot_find_root_directory);
return ErrorNumber.InvalidArgument;
}

View File

@@ -52,16 +52,18 @@ public sealed class JFS : IFilesystem
const uint JFS_BOOT_BLOCKS_SIZE = 0x8000;
const uint JFS_MAGIC = 0x3153464A;
const string FS_TYPE = "jfs";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "JFS Plugin";
public string Name => Localization.JFS_Name;
/// <inheritdoc />
public Guid Id => new("D3BE2A41-8F28-4055-94DC-BB6C72A0E9C4");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -101,96 +103,96 @@ public sealed class JFS : IFilesystem
SuperBlock jfsSb = Marshal.ByteArrayToStructureLittleEndian<SuperBlock>(sector);
sb.AppendLine("JFS filesystem");
sb.AppendFormat("Version {0}", jfsSb.s_version).AppendLine();
sb.AppendFormat("{0} blocks of {1} bytes", jfsSb.s_size, jfsSb.s_bsize).AppendLine();
sb.AppendFormat("{0} blocks per allocation group", jfsSb.s_agsize).AppendLine();
sb.AppendLine(Localization.JFS_filesystem);
sb.AppendFormat(Localization.Version_0, jfsSb.s_version).AppendLine();
sb.AppendFormat(Localization._0_blocks_of_1_bytes, jfsSb.s_size, jfsSb.s_bsize).AppendLine();
sb.AppendFormat(Localization._0_blocks_per_allocation_group, jfsSb.s_agsize).AppendLine();
if(jfsSb.s_flags.HasFlag(Flags.Unicode))
sb.AppendLine("Volume uses Unicode for directory entries");
sb.AppendLine(Localization.Volume_uses_Unicode_for_directory_entries);
if(jfsSb.s_flags.HasFlag(Flags.RemountRO))
sb.AppendLine("Volume remounts read-only on error");
sb.AppendLine(Localization.Volume_remounts_read_only_on_error);
if(jfsSb.s_flags.HasFlag(Flags.Continue))
sb.AppendLine("Volume continues on error");
sb.AppendLine(Localization.Volume_continues_on_error);
if(jfsSb.s_flags.HasFlag(Flags.Panic))
sb.AppendLine("Volume panics on error");
sb.AppendLine(Localization.Volume_panics_on_error);
if(jfsSb.s_flags.HasFlag(Flags.UserQuota))
sb.AppendLine("Volume has user quotas enabled");
sb.AppendLine(Localization.Volume_has_user_quotas_enabled);
if(jfsSb.s_flags.HasFlag(Flags.GroupQuota))
sb.AppendLine("Volume has group quotas enabled");
sb.AppendLine(Localization.Volume_has_group_quotas_enabled);
if(jfsSb.s_flags.HasFlag(Flags.NoJournal))
sb.AppendLine("Volume is not using any journal");
sb.AppendLine(Localization.Volume_is_not_using_any_journal);
if(jfsSb.s_flags.HasFlag(Flags.Discard))
sb.AppendLine("Volume sends TRIM/UNMAP commands to underlying device");
sb.AppendLine(Localization.Volume_sends_TRIM_UNMAP_commands_to_underlying_device);
if(jfsSb.s_flags.HasFlag(Flags.GroupCommit))
sb.AppendLine("Volume commits in groups of 1");
sb.AppendLine(Localization.Volume_commits_in_groups_of_1);
if(jfsSb.s_flags.HasFlag(Flags.LazyCommit))
sb.AppendLine("Volume commits lazy");
sb.AppendLine(Localization.Volume_commits_lazy);
if(jfsSb.s_flags.HasFlag(Flags.Temporary))
sb.AppendLine("Volume does not commit to log");
sb.AppendLine(Localization.Volume_does_not_commit_to_log);
if(jfsSb.s_flags.HasFlag(Flags.InlineLog))
sb.AppendLine("Volume has log withing itself");
sb.AppendLine(Localization.Volume_has_log_withing_itself);
if(jfsSb.s_flags.HasFlag(Flags.InlineMoving))
sb.AppendLine("Volume has log withing itself and is moving it out");
sb.AppendLine(Localization.Volume_has_log_withing_itself_and_is_moving_it_out);
if(jfsSb.s_flags.HasFlag(Flags.BadSAIT))
sb.AppendLine("Volume has bad current secondary ait");
sb.AppendLine(Localization.Volume_has_bad_current_secondary_ait);
if(jfsSb.s_flags.HasFlag(Flags.Sparse))
sb.AppendLine("Volume supports sparse files");
sb.AppendLine(Localization.Volume_supports_sparse_files);
if(jfsSb.s_flags.HasFlag(Flags.DASDEnabled))
sb.AppendLine("Volume has DASD limits enabled");
sb.AppendLine(Localization.Volume_has_DASD_limits_enabled);
if(jfsSb.s_flags.HasFlag(Flags.DASDPrime))
sb.AppendLine("Volume primes DASD on boot");
sb.AppendLine(Localization.Volume_primes_DASD_on_boot);
if(jfsSb.s_flags.HasFlag(Flags.SwapBytes))
sb.AppendLine("Volume is in a big-endian system");
sb.AppendLine(Localization.Volume_is_in_a_big_endian_system);
if(jfsSb.s_flags.HasFlag(Flags.DirIndex))
sb.AppendLine("Volume has persistent indexes");
sb.AppendLine(Localization.Volume_has_persistent_indexes);
if(jfsSb.s_flags.HasFlag(Flags.Linux))
sb.AppendLine("Volume supports Linux");
sb.AppendLine(Localization.Volume_supports_Linux);
if(jfsSb.s_flags.HasFlag(Flags.DFS))
sb.AppendLine("Volume supports DCE DFS LFS");
sb.AppendLine(Localization.Volume_supports_DCE_DFS_LFS);
if(jfsSb.s_flags.HasFlag(Flags.OS2))
sb.AppendLine("Volume supports OS/2, and is case insensitive");
sb.AppendLine(Localization.Volume_supports_OS2_and_is_case_insensitive);
if(jfsSb.s_flags.HasFlag(Flags.AIX))
sb.AppendLine("Volume supports AIX");
sb.AppendLine(Localization.Volume_supports_AIX);
if(jfsSb.s_state != 0)
sb.AppendLine("Volume is dirty");
sb.AppendLine(Localization.Volume_is_dirty);
sb.AppendFormat("Volume was last updated on {0}",
sb.AppendFormat(Localization.Volume_was_last_updated_on_0_,
DateHandlers.UnixUnsignedToDateTime(jfsSb.s_time.tv_sec, jfsSb.s_time.tv_nsec)).AppendLine();
if(jfsSb.s_version == 1)
sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(jfsSb.s_fpack, Encoding)).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(jfsSb.s_fpack, Encoding)).AppendLine();
else
sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(jfsSb.s_label, Encoding)).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(jfsSb.s_label, Encoding)).AppendLine();
sb.AppendFormat("Volume UUID: {0}", jfsSb.s_uuid).AppendLine();
sb.AppendFormat(Localization.Volume_UUID_0, jfsSb.s_uuid).AppendLine();
XmlFsType = new FileSystemType
{
Type = "JFS filesystem",
Type = FS_TYPE,
Clusters = jfsSb.s_size,
ClusterSize = jfsSb.s_bsize,
Bootable = true,

View File

@@ -50,16 +50,18 @@ public sealed class LIF : IFilesystem
{
const uint LIF_MAGIC = 0x8000;
const string FS_TYPE = "hplif";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "HP Logical Interchange Format Plugin";
public string Name => Localization.LIF_Name;
/// <inheritdoc />
public Guid Id => new("41535647-77A5-477B-9206-DA727ACDC704");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -73,7 +75,7 @@ public sealed class LIF : IFilesystem
return false;
SystemBlock lifSb = Marshal.ByteArrayToStructureBigEndian<SystemBlock>(sector);
AaruConsole.DebugWriteLine("LIF plugin", "magic 0x{0:X8} (expected 0x{1:X8})", lifSb.magic, LIF_MAGIC);
AaruConsole.DebugWriteLine("LIF plugin", Localization.magic_0_expected_1, lifSb.magic, LIF_MAGIC);
return lifSb.magic == LIF_MAGIC;
}
@@ -99,24 +101,24 @@ public sealed class LIF : IFilesystem
var sb = new StringBuilder();
sb.AppendLine("HP Logical Interchange Format");
sb.AppendFormat("Directory starts at cluster {0}", lifSb.directoryStart).AppendLine();
sb.AppendFormat("LIF identifier: {0}", lifSb.lifId).AppendLine();
sb.AppendFormat("Directory size: {0} clusters", lifSb.directorySize).AppendLine();
sb.AppendFormat("LIF version: {0}", lifSb.lifVersion).AppendLine();
sb.AppendLine(Localization.HP_Logical_Interchange_Format);
sb.AppendFormat(Localization.Directory_starts_at_cluster_0, lifSb.directoryStart).AppendLine();
sb.AppendFormat(Localization.LIF_identifier_0, lifSb.lifId).AppendLine();
sb.AppendFormat(Localization.Directory_size_0_clusters, lifSb.directorySize).AppendLine();
sb.AppendFormat(Localization.LIF_version_0, lifSb.lifVersion).AppendLine();
// How is this related to volume size? I have only CDs to test and makes no sense there
sb.AppendFormat("{0} tracks", lifSb.tracks).AppendLine();
sb.AppendFormat("{0} heads", lifSb.heads).AppendLine();
sb.AppendFormat("{0} sectors", lifSb.sectors).AppendLine();
sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(lifSb.volumeLabel, Encoding)).AppendLine();
sb.AppendFormat("Volume created on {0}", DateHandlers.LifToDateTime(lifSb.creationDate)).AppendLine();
sb.AppendFormat(Localization._0_tracks, lifSb.tracks).AppendLine();
sb.AppendFormat(Localization._0_heads, lifSb.heads).AppendLine();
sb.AppendFormat(Localization._0_sectors, lifSb.sectors).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(lifSb.volumeLabel, Encoding)).AppendLine();
sb.AppendFormat(Localization.Volume_created_on_0, DateHandlers.LifToDateTime(lifSb.creationDate)).AppendLine();
information = sb.ToString();
XmlFsType = new FileSystemType
{
Type = "HP Logical Interchange Format",
Type = FS_TYPE,
ClusterSize = 256,
Clusters = partition.Size / 256,
CreationDate = DateHandlers.LifToDateTime(lifSb.creationDate),

View File

@@ -110,4 +110,6 @@ public sealed partial class LisaFS
/// <summary>Erased?</summary>
KilledObject = 15
}
const string FS_TYPE = "lisafs";
}

View File

@@ -438,7 +438,7 @@ public sealed partial class LisaFS
{
if(_fileSizeCache.TryGetValue(fileId, out int realSize))
if(realSize > temp.Length)
AaruConsole.ErrorWriteLine("File {0} gets truncated.", fileId);
AaruConsole.ErrorWriteLine(Localization.File_0_gets_truncated, fileId);
buf = temp;

View File

@@ -68,7 +68,7 @@ public sealed partial class LisaFS
DecodeTag(tag, out LisaTag.PriamTag searchTag);
AaruConsole.DebugWriteLine("LisaFS plugin", "Sector {0}, file ID 0x{1:X4}", i, searchTag.FileId);
AaruConsole.DebugWriteLine("LisaFS plugin", Localization.Sector_0_file_ID_1, i, searchTag.FileId);
if(beforeMddf == -1 &&
searchTag.FileId == FILEID_LOADER_SIGNED)
@@ -92,7 +92,7 @@ public sealed partial class LisaFS
datasize = BigEndianBitConverter.ToUInt16(sector, 0x7E)
};
AaruConsole.DebugWriteLine("LisaFS plugin", "Current sector = {0}", i);
AaruConsole.DebugWriteLine("LisaFS plugin", Localization.Current_sector_0, i);
AaruConsole.DebugWriteLine("LisaFS plugin", "mddf.mddf_block = {0}", infoMddf.mddf_block);
AaruConsole.DebugWriteLine("LisaFS plugin", "Disk size = {0} sectors", imagePlugin.Info.Sectors);
AaruConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size = {0} sectors", infoMddf.vol_size);
@@ -155,7 +155,7 @@ public sealed partial class LisaFS
DecodeTag(tag, out LisaTag.PriamTag searchTag);
AaruConsole.DebugWriteLine("LisaFS plugin", "Sector {0}, file ID 0x{1:X4}", i, searchTag.FileId);
AaruConsole.DebugWriteLine("LisaFS plugin", Localization.Sector_0_file_ID_1, i, searchTag.FileId);
if(beforeMddf == -1 &&
searchTag.FileId == FILEID_LOADER_SIGNED)
@@ -330,55 +330,55 @@ public sealed partial class LisaFS
break;
default:
sb.AppendFormat("Unknown LisaFS version {0}", infoMddf.fsversion).AppendLine();
sb.AppendFormat(Localization.Unknown_LisaFS_version_0, infoMddf.fsversion).AppendLine();
break;
}
sb.AppendFormat("Volume name: \"{0}\"", infoMddf.volname).AppendLine();
sb.AppendFormat("Volume password: \"{0}\"", infoMddf.password).AppendLine();
sb.AppendFormat("Volume ID: 0x{0:X16}", infoMddf.volid).AppendLine();
sb.AppendFormat("Backup volume ID: 0x{0:X16}", infoMddf.backup_volid).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, infoMddf.volname).AppendLine();
sb.AppendFormat(Localization.Volume_password_0, infoMddf.password).AppendLine();
sb.AppendFormat(Localization.Volume_ID_0_X16, infoMddf.volid).AppendLine();
sb.AppendFormat(Localization.Backup_volume_ID_0, infoMddf.backup_volid).AppendLine();
sb.AppendFormat("Master copy ID: 0x{0:X8}", infoMddf.master_copy_id).AppendLine();
sb.AppendFormat(Localization.Master_copy_ID_0, infoMddf.master_copy_id).AppendLine();
sb.AppendFormat("Volume is number {0} of {1}", infoMddf.volnum, infoMddf.vol_sequence).AppendLine();
sb.AppendFormat(Localization.Volume_is_number_0_of_1, infoMddf.volnum, infoMddf.vol_sequence).AppendLine();
sb.AppendFormat("Serial number of Lisa computer that created this volume: {0}", infoMddf.machine_id).
AppendLine();
sb.AppendFormat(Localization.Serial_number_of_Lisa_computer_that_created_this_volume_0,
infoMddf.machine_id).AppendLine();
sb.AppendFormat("Serial number of Lisa computer that can use this volume's software {0}",
sb.AppendFormat(Localization.Serial_number_of_Lisa_computer_that_can_use_this_volume_software_0,
infoMddf.serialization).AppendLine();
sb.AppendFormat("Volume created on {0}", infoMddf.dtvc).AppendLine();
sb.AppendFormat("Some timestamp, says {0}", infoMddf.dtcc).AppendLine();
sb.AppendFormat("Volume backed up on {0}", infoMddf.dtvb).AppendLine();
sb.AppendFormat("Volume scavenged on {0}", infoMddf.dtvs).AppendLine();
sb.AppendFormat("MDDF is in block {0}", infoMddf.mddf_block + beforeMddf).AppendLine();
sb.AppendFormat("There are {0} reserved blocks before volume", beforeMddf).AppendLine();
sb.AppendFormat("{0} blocks minus one", infoMddf.volsize_minus_one).AppendLine();
sb.AppendFormat(Localization.Volume_created_on_0, infoMddf.dtvc).AppendLine();
sb.AppendFormat(Localization.Volume_catalog_created_on_0, infoMddf.dtcc).AppendLine();
sb.AppendFormat(Localization.Volume_backed_up_on_0, infoMddf.dtvb).AppendLine();
sb.AppendFormat(Localization.Volume_scavenged_on_0, infoMddf.dtvs).AppendLine();
sb.AppendFormat(Localization.MDDF_is_in_block_0, infoMddf.mddf_block + beforeMddf).AppendLine();
sb.AppendFormat(Localization.There_are_0_reserved_blocks_before_volume, beforeMddf).AppendLine();
sb.AppendFormat(Localization._0_blocks_minus_one, infoMddf.volsize_minus_one).AppendLine();
sb.AppendFormat("{0} blocks minus one minus MDDF offset", infoMddf.volsize_minus_mddf_minus_one).
sb.AppendFormat(Localization._0_blocks_minus_one_minus_MDDF_offset, infoMddf.volsize_minus_mddf_minus_one).
AppendLine();
sb.AppendFormat("{0} blocks in volume", infoMddf.vol_size).AppendLine();
sb.AppendFormat("{0} bytes per sector (uncooked)", infoMddf.blocksize).AppendLine();
sb.AppendFormat("{0} bytes per sector", infoMddf.datasize).AppendLine();
sb.AppendFormat("{0} blocks per cluster", infoMddf.clustersize).AppendLine();
sb.AppendFormat("{0} blocks in filesystem", infoMddf.fs_size).AppendLine();
sb.AppendFormat("{0} files in volume", infoMddf.filecount).AppendLine();
sb.AppendFormat("{0} blocks free", infoMddf.freecount).AppendLine();
sb.AppendFormat("{0} bytes in LisaInfo", infoMddf.label_size).AppendLine();
sb.AppendFormat("Filesystem overhead: {0}", infoMddf.fs_overhead).AppendLine();
sb.AppendFormat("Scavenger result code: 0x{0:X8}", infoMddf.result_scavenge).AppendLine();
sb.AppendFormat("Boot code: 0x{0:X8}", infoMddf.boot_code).AppendLine();
sb.AppendFormat("Boot environment: 0x{0:X8}", infoMddf.boot_environ).AppendLine();
sb.AppendFormat("Overmount stamp: 0x{0:X16}", infoMddf.overmount_stamp).AppendLine();
sb.AppendFormat(Localization._0_blocks_in_volume, infoMddf.vol_size).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_sector_uncooked, infoMddf.blocksize).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_sector, infoMddf.datasize).AppendLine();
sb.AppendFormat(Localization._0_blocks_per_cluster, infoMddf.clustersize).AppendLine();
sb.AppendFormat(Localization._0_blocks_in_filesystem, infoMddf.fs_size).AppendLine();
sb.AppendFormat(Localization._0_files_in_volume, infoMddf.filecount).AppendLine();
sb.AppendFormat(Localization._0_blocks_free, infoMddf.freecount).AppendLine();
sb.AppendFormat(Localization._0_bytes_in_LisaInfo, infoMddf.label_size).AppendLine();
sb.AppendFormat(Localization.Filesystem_overhead_0, infoMddf.fs_overhead).AppendLine();
sb.AppendFormat(Localization.Scavenger_result_code_0, infoMddf.result_scavenge).AppendLine();
sb.AppendFormat(Localization.Boot_code_0, infoMddf.boot_code).AppendLine();
sb.AppendFormat(Localization.Boot_environment_0, infoMddf.boot_environ).AppendLine();
sb.AppendFormat(Localization.Overmount_stamp_0, infoMddf.overmount_stamp).AppendLine();
sb.AppendFormat("S-Records start at {0} and spans for {1} blocks",
sb.AppendFormat(Localization.S_Records_start_at_0_and_spans_for_1_blocks,
infoMddf.srec_ptr + infoMddf.mddf_block + beforeMddf, infoMddf.srec_len).AppendLine();
sb.AppendLine(infoMddf.vol_left_mounted == 0 ? "Volume is clean" : "Volume is dirty");
sb.AppendLine(infoMddf.vol_left_mounted == 0 ? Localization.Volume_is_clean : Localization.Volume_is_dirty);
information = sb.ToString();
@@ -404,7 +404,7 @@ public sealed partial class LisaFS
XmlFsType.FilesSpecified = true;
XmlFsType.FreeClusters = infoMddf.freecount;
XmlFsType.FreeClustersSpecified = true;
XmlFsType.Type = "LisaFS";
XmlFsType.Type = FS_TYPE;
XmlFsType.VolumeName = infoMddf.volname;
XmlFsType.VolumeSerial = $"{infoMddf.volid:X16}";

View File

@@ -61,7 +61,7 @@ public sealed partial class LisaFS : IReadOnlyFilesystem
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
// TODO: Implement Lisa 7/7 namespace (needs decoding {!CATALOG} file)
/// <inheritdoc />

View File

@@ -61,7 +61,7 @@ public sealed partial class LisaFS
// However with some effort the code may be modified to ignore them.
if(_device.Info.ReadableSectorTags?.Contains(SectorTagType.AppleSectorTag) != true)
{
AaruConsole.DebugWriteLine("LisaFS plugin", "Underlying device does not support Lisa tags");
AaruConsole.DebugWriteLine("LisaFS plugin", Localization.Underlying_device_does_not_support_Lisa_tags);
return ErrorNumber.InOutError;
}
@@ -69,7 +69,7 @@ public sealed partial class LisaFS
// Minimal LisaOS disk is 3.5" single sided double density, 800 sectors
if(_device.Info.Sectors < 800)
{
AaruConsole.DebugWriteLine("LisaFS plugin", "Device is too small");
AaruConsole.DebugWriteLine("LisaFS plugin", Localization.Device_is_too_small);
return ErrorNumber.InOutError;
}
@@ -87,7 +87,7 @@ public sealed partial class LisaFS
DecodeTag(tag, out LisaTag.PriamTag searchTag);
AaruConsole.DebugWriteLine("LisaFS plugin", "Sector {0}, file ID 0x{1:X4}", i, searchTag.FileId);
AaruConsole.DebugWriteLine("LisaFS plugin", Localization.Sector_0_file_ID_1, i, searchTag.FileId);
if(_volumePrefix == _device.Info.Sectors &&
searchTag.FileId == FILEID_LOADER_SIGNED)
@@ -194,7 +194,7 @@ public sealed partial class LisaFS
_mddf.blocksize < _device.Info.SectorSize ||
_mddf.datasize != _device.Info.SectorSize)
{
AaruConsole.DebugWriteLine("LisaFS plugin", "Incorrect MDDF found");
AaruConsole.DebugWriteLine("LisaFS plugin", Localization.Incorrect_MDDF_found);
return ErrorNumber.InvalidArgument;
}
@@ -203,19 +203,20 @@ public sealed partial class LisaFS
switch(_mddf.fsversion)
{
case LISA_V1:
AaruConsole.DebugWriteLine("LisaFS plugin", "Mounting LisaFS v1");
AaruConsole.DebugWriteLine("LisaFS plugin", Localization.Mounting_LisaFS_v1);
break;
case LISA_V2:
AaruConsole.DebugWriteLine("LisaFS plugin", "Mounting LisaFS v2");
AaruConsole.DebugWriteLine("LisaFS plugin", Localization.Mounting_LisaFS_v2);
break;
case LISA_V3:
AaruConsole.DebugWriteLine("LisaFS plugin", "Mounting LisaFS v3");
AaruConsole.DebugWriteLine("LisaFS plugin", Localization.Mounting_LisaFS_v3);
break;
default:
AaruConsole.ErrorWriteLine("Cannot mount LisaFS version {0}", _mddf.fsversion.ToString());
AaruConsole.ErrorWriteLine(Localization.Cannot_mount_LisaFS_version_0,
_mddf.fsversion.ToString());
return ErrorNumber.NotSupported;
}
@@ -243,7 +244,7 @@ public sealed partial class LisaFS
if(error != ErrorNumber.NoError)
{
AaruConsole.ErrorWriteLine("Error {0} reading S-Records file.", error);
AaruConsole.ErrorWriteLine(Localization.Error_0_reading_S_Records_file, error);
return error;
}
@@ -260,7 +261,7 @@ public sealed partial class LisaFS
if(error != ErrorNumber.NoError)
{
AaruConsole.DebugWriteLine("LisaFS plugin", "Cannot read Catalog File, error {0}",
AaruConsole.DebugWriteLine("LisaFS plugin", Localization.Cannot_read_Catalog_File_error_0,
error.ToString());
_mounted = false;
@@ -275,7 +276,7 @@ public sealed partial class LisaFS
if(error != ErrorNumber.NoError)
{
AaruConsole.DebugWriteLine("LisaFS plugin", "Unable to read boot blocks");
AaruConsole.DebugWriteLine("LisaFS plugin", Localization.Unable_to_read_boot_blocks);
_mounted = false;
return error;
@@ -285,7 +286,7 @@ public sealed partial class LisaFS
if(error != ErrorNumber.NoError)
{
AaruConsole.DebugWriteLine("LisaFS plugin", "Unable to read boot loader");
AaruConsole.DebugWriteLine("LisaFS plugin", Localization.Unable_to_read_boot_loader);
_mounted = false;
return error;
@@ -295,7 +296,7 @@ public sealed partial class LisaFS
if(error != ErrorNumber.NoError)
{
AaruConsole.DebugWriteLine("LisaFS plugin", "Unable to read MDDF");
AaruConsole.DebugWriteLine("LisaFS plugin", Localization.Unable_to_read_MDDF);
_mounted = false;
return error;
@@ -305,7 +306,7 @@ public sealed partial class LisaFS
if(error != ErrorNumber.NoError)
{
AaruConsole.DebugWriteLine("LisaFS plugin", "Unable to read volume bitmap");
AaruConsole.DebugWriteLine("LisaFS plugin", Localization.Unable_to_read_volume_bitmap);
_mounted = false;
return error;
@@ -315,7 +316,7 @@ public sealed partial class LisaFS
if(error != ErrorNumber.NoError)
{
AaruConsole.DebugWriteLine("LisaFS plugin", "Unable to read S-Records file");
AaruConsole.DebugWriteLine("LisaFS plugin", Localization.Unable_to_read_S_Records_file);
_mounted = false;
return error;
@@ -345,20 +346,20 @@ public sealed partial class LisaFS
XmlFsType.FilesSpecified = true;
XmlFsType.FreeClusters = _mddf.freecount;
XmlFsType.FreeClustersSpecified = true;
XmlFsType.Type = "LisaFS";
XmlFsType.Type = FS_TYPE;
XmlFsType.VolumeName = _mddf.volname;
XmlFsType.VolumeSerial = $"{_mddf.volid:X16}";
return ErrorNumber.NoError;
}
AaruConsole.DebugWriteLine("LisaFS plugin", "Not a Lisa filesystem");
AaruConsole.DebugWriteLine("LisaFS plugin", Localization.Not_a_Lisa_filesystem);
return ErrorNumber.NotSupported;
}
catch(Exception ex)
{
AaruConsole.ErrorWriteLine("Exception {0}, {1}, {2}", ex.Message, ex.InnerException, ex.StackTrace);
AaruConsole.ErrorWriteLine(Localization.Exception_0_1_2, ex.Message, ex.InnerException, ex.StackTrace);
return ErrorNumber.InOutError;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -82,16 +82,18 @@ public sealed class Locus : IFilesystem
const uint LOCUS_MAGIC_OLD = 0xFFEEDDCC;
const uint LOCUS_CIGAM_OLD = 0xCCDDEEFF;
const string FS_TYPE = "locus";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Locus Filesystem Plugin";
public string Name => Localization.Locus_Name;
/// <inheritdoc />
public Guid Id => new("1A70B30A-437D-479A-88E1-D0C9C1797FF4");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -119,7 +121,7 @@ public sealed class Locus : IFilesystem
Superblock locusSb = Marshal.ByteArrayToStructureLittleEndian<Superblock>(sector);
AaruConsole.DebugWriteLine("Locus plugin", "magic at {1} = 0x{0:X8}", locusSb.s_magic, location);
AaruConsole.DebugWriteLine("Locus plugin", Localization.magic_at_1_equals_0, locusSb.s_magic, location);
if(locusSb.s_magic is LOCUS_MAGIC or LOCUS_CIGAM or LOCUS_MAGIC_OLD or LOCUS_CIGAM_OLD)
return true;
@@ -177,7 +179,8 @@ public sealed class Locus : IFilesystem
var sb = new StringBuilder();
sb.AppendLine(locusSb.s_magic == LOCUS_MAGIC_OLD ? "Locus filesystem (old)" : "Locus filesystem");
sb.AppendLine(locusSb.s_magic == LOCUS_MAGIC_OLD ? Localization.Locus_filesystem_old
: Localization.Locus_filesystem);
int blockSize = locusSb.s_version == Version.SB_SB4096 ? 4096 : 1024;
@@ -209,65 +212,66 @@ public sealed class Locus : IFilesystem
AaruConsole.DebugWriteLine("Locus plugin", "LocusSb.s_fmod = {0}", locusSb.s_fmod);
AaruConsole.DebugWriteLine("Locus plugin", "LocusSb.s_version = {0}", locusSb.s_version);
sb.AppendFormat("Superblock last modified on {0}", DateHandlers.UnixToDateTime(locusSb.s_time)).AppendLine();
sb.AppendFormat("Volume has {0} blocks of {1} bytes each (total {2} bytes)", locusSb.s_fsize, blockSize,
locusSb.s_fsize * blockSize).AppendLine();
sb.AppendFormat("{0} blocks free ({1} bytes)", locusSb.s_tfree, locusSb.s_tfree * blockSize).AppendLine();
sb.AppendFormat("I-node list uses {0} blocks", locusSb.s_isize).AppendLine();
sb.AppendFormat("{0} free inodes", locusSb.s_tinode).AppendLine();
sb.AppendFormat("Next free inode search will start at inode {0}", locusSb.s_lasti).AppendLine();
sb.AppendFormat("There are an estimate of {0} free inodes before next search start", locusSb.s_nbehind).
sb.AppendFormat(Localization.Superblock_last_modified_on_0, DateHandlers.UnixToDateTime(locusSb.s_time)).
AppendLine();
sb.AppendFormat(Localization.Volume_has_0_blocks_of_1_bytes_each_total_2_bytes, locusSb.s_fsize, blockSize,
locusSb.s_fsize * blockSize).AppendLine();
sb.AppendFormat(Localization._0_blocks_free_1_bytes, locusSb.s_tfree, locusSb.s_tfree * blockSize).AppendLine();
sb.AppendFormat(Localization.Inode_list_uses_0_blocks, locusSb.s_isize).AppendLine();
sb.AppendFormat(Localization._0_free_inodes, locusSb.s_tinode).AppendLine();
sb.AppendFormat(Localization.Next_free_inode_search_will_start_at_inode_0, locusSb.s_lasti).AppendLine();
sb.AppendFormat(Localization.There_are_an_estimate_of_0_free_inodes_before_next_search_start,
locusSb.s_nbehind).AppendLine();
if(locusSb.s_flags.HasFlag(Flags.SB_RDONLY))
sb.AppendLine("Read-only volume");
sb.AppendLine(Localization.Read_only_volume);
if(locusSb.s_flags.HasFlag(Flags.SB_CLEAN))
sb.AppendLine("Clean volume");
sb.AppendLine(Localization.Clean_volume);
if(locusSb.s_flags.HasFlag(Flags.SB_DIRTY))
sb.AppendLine("Dirty volume");
sb.AppendLine(Localization.Dirty_volume);
if(locusSb.s_flags.HasFlag(Flags.SB_RMV))
sb.AppendLine("Removable volume");
sb.AppendLine(Localization.Removable_volume);
if(locusSb.s_flags.HasFlag(Flags.SB_PRIMPACK))
sb.AppendLine("This is the primary pack");
sb.AppendLine(Localization.This_is_the_primary_pack);
if(locusSb.s_flags.HasFlag(Flags.SB_REPLTYPE))
sb.AppendLine("Replicated volume");
sb.AppendLine(Localization.Replicated_volume);
if(locusSb.s_flags.HasFlag(Flags.SB_USER))
sb.AppendLine("User replicated volume");
sb.AppendLine(Localization.User_replicated_volume);
if(locusSb.s_flags.HasFlag(Flags.SB_BACKBONE))
sb.AppendLine("Backbone volume");
sb.AppendLine(Localization.Backbone_volume);
if(locusSb.s_flags.HasFlag(Flags.SB_NFS))
sb.AppendLine("NFS volume");
sb.AppendLine(Localization.NFS_volume);
if(locusSb.s_flags.HasFlag(Flags.SB_BYHAND))
sb.AppendLine("Volume inhibits automatic fsck");
sb.AppendLine(Localization.Volume_inhibits_automatic_fsck);
if(locusSb.s_flags.HasFlag(Flags.SB_NOSUID))
sb.AppendLine("Set-uid/set-gid is disabled");
sb.AppendLine(Localization.Set_uid_set_gid_is_disabled);
if(locusSb.s_flags.HasFlag(Flags.SB_SYNCW))
sb.AppendLine("Volume uses synchronous writes");
sb.AppendLine(Localization.Volume_uses_synchronous_writes);
sb.AppendFormat("Volume label: {0}", s_fsmnt).AppendLine();
sb.AppendFormat("Physical volume name: {0}", s_fpack).AppendLine();
sb.AppendFormat("Global File System number: {0}", locusSb.s_gfs).AppendLine();
sb.AppendFormat("Global File System pack number {0}", locusSb.s_gfspack).AppendLine();
sb.AppendFormat(Localization.Volume_label_0, s_fsmnt).AppendLine();
sb.AppendFormat(Localization.Physical_volume_name_0, s_fpack).AppendLine();
sb.AppendFormat(Localization.Global_File_System_number_0, locusSb.s_gfs).AppendLine();
sb.AppendFormat(Localization.Global_File_System_pack_number_0, locusSb.s_gfspack).AppendLine();
information = sb.ToString();
XmlFsType = new FileSystemType
{
Type = "Locus filesystem",
Type = FS_TYPE,
ClusterSize = (uint)blockSize,
Clusters = (ulong)locusSb.s_fsize,

View File

@@ -54,16 +54,18 @@ public sealed class MicroDOS : IFilesystem
const ushort MAGIC = 0xA72E;
const ushort MAGIC2 = 0x530C;
const string FS_TYPE = "microdos";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "MicroDOS file system";
public string Name => Localization.MicroDOS_Name;
/// <inheritdoc />
public Guid Id => new("9F9A364A-1A27-48A3-B730-7A7122000324");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -99,18 +101,18 @@ public sealed class MicroDOS : IFilesystem
Block0 block0 = Marshal.ByteArrayToStructureLittleEndian<Block0>(bk0);
sb.AppendLine("MicroDOS filesystem");
sb.AppendFormat("Volume has {0} blocks ({1} bytes)", block0.blocks, block0.blocks * 512).AppendLine();
sb.AppendLine(Localization.MicroDOS_filesystem);
sb.AppendFormat(Localization.Volume_has_0_blocks_1_bytes, block0.blocks, block0.blocks * 512).AppendLine();
sb.AppendFormat("Volume has {0} blocks used ({1} bytes)", block0.usedBlocks, block0.usedBlocks * 512).
sb.AppendFormat(Localization.Volume_has_0_blocks_used_1_bytes, block0.usedBlocks, block0.usedBlocks * 512).
AppendLine();
sb.AppendFormat("Volume contains {0} files", block0.files).AppendLine();
sb.AppendFormat("First used block is {0}", block0.firstUsedBlock).AppendLine();
sb.AppendFormat(Localization.Volume_contains_0_files, block0.files).AppendLine();
sb.AppendFormat(Localization.First_used_block_is_0, block0.firstUsedBlock).AppendLine();
XmlFsType = new FileSystemType
{
Type = "MicroDOS",
Type = FS_TYPE,
ClusterSize = 512,
Clusters = block0.blocks,
Files = block0.files,

View File

@@ -68,17 +68,20 @@ public sealed class MinixFS : IFilesystem
const ushort MINIX2_CIGAM2 = 0x7824;
/// <summary>Minix v3, 60 char filenames</summary>
const ushort MINIX3_CIGAM = 0x5A4D;
const string FS_TYPE_V1 = "minix";
const string FS_TYPE_V2 = "minix2";
const string FS_TYPE_V3 = "minix3";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Minix Filesystem";
public string Name => Localization.MinixFS_Name;
/// <inheritdoc />
public Guid Id => new("FE248C3B-B727-4AE5-A39F-79EA9A07D4B3");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -167,19 +170,19 @@ public sealed class MinixFS : IFilesystem
{
case MINIX3_MAGIC:
case MINIX3_CIGAM:
minixVersion = "Minix v3 filesystem";
XmlFsType.Type = "Minix v3";
minixVersion = Localization.Minix_v3_filesystem;
XmlFsType.Type = FS_TYPE_V3;
break;
case MINIX2_MAGIC:
case MINIX2_CIGAM:
minixVersion = "Minix 3 v2 filesystem";
XmlFsType.Type = "Minix 3 v2";
minixVersion = Localization.Minix_3_v2_filesystem;
XmlFsType.Type = FS_TYPE_V3;
break;
default:
minixVersion = "Minix 3 v1 filesystem";
XmlFsType.Type = "Minix 3 v1";
minixVersion = Localization.Minix_3_v1_filesystem;
XmlFsType.Type = FS_TYPE_V3;
break;
}
@@ -194,58 +197,58 @@ public sealed class MinixFS : IFilesystem
{
case MINIX_MAGIC:
filenamesize = 14;
minixVersion = "Minix v1 filesystem";
minixVersion = Localization.Minix_v1_filesystem;
littleEndian = true;
XmlFsType.Type = "Minix v1";
XmlFsType.Type = FS_TYPE_V1;
break;
case MINIX_MAGIC2:
filenamesize = 30;
minixVersion = "Minix v1 filesystem";
minixVersion = Localization.Minix_v1_filesystem;
littleEndian = true;
XmlFsType.Type = "Minix v1";
XmlFsType.Type = FS_TYPE_V1;
break;
case MINIX2_MAGIC:
filenamesize = 14;
minixVersion = "Minix v2 filesystem";
minixVersion = Localization.Minix_v2_filesystem;
littleEndian = true;
XmlFsType.Type = "Minix v2";
XmlFsType.Type = FS_TYPE_V2;
break;
case MINIX2_MAGIC2:
filenamesize = 30;
minixVersion = "Minix v2 filesystem";
minixVersion = Localization.Minix_v2_filesystem;
littleEndian = true;
XmlFsType.Type = "Minix v2";
XmlFsType.Type = FS_TYPE_V2;
break;
case MINIX_CIGAM:
filenamesize = 14;
minixVersion = "Minix v1 filesystem";
minixVersion = Localization.Minix_v1_filesystem;
littleEndian = false;
XmlFsType.Type = "Minix v1";
XmlFsType.Type = FS_TYPE_V1;
break;
case MINIX_CIGAM2:
filenamesize = 30;
minixVersion = "Minix v1 filesystem";
minixVersion = Localization.Minix_v1_filesystem;
littleEndian = false;
XmlFsType.Type = "Minix v1";
XmlFsType.Type = FS_TYPE_V1;
break;
case MINIX2_CIGAM:
filenamesize = 14;
minixVersion = "Minix v2 filesystem";
minixVersion = Localization.Minix_v2_filesystem;
littleEndian = false;
XmlFsType.Type = "Minix v2";
XmlFsType.Type = FS_TYPE_V2;
break;
case MINIX2_CIGAM2:
filenamesize = 30;
minixVersion = "Minix v2 filesystem";
minixVersion = Localization.Minix_v2_filesystem;
littleEndian = false;
XmlFsType.Type = "Minix v2";
XmlFsType.Type = FS_TYPE_V2;
break;
default: return;
@@ -262,27 +265,29 @@ public sealed class MinixFS : IFilesystem
mnxSb.s_blocksize = 1024;
sb.AppendLine(minixVersion);
sb.AppendFormat("{0} chars in filename", filenamesize).AppendLine();
sb.AppendFormat(Localization._0_chars_in_filename, filenamesize).AppendLine();
if(mnxSb.s_zones > 0) // On V2
sb.AppendFormat("{0} zones on volume ({1} bytes)", mnxSb.s_zones, mnxSb.s_zones * 1024).AppendLine();
sb.AppendFormat(Localization._0_zones_on_volume_1_bytes, mnxSb.s_zones, mnxSb.s_zones * 1024).
AppendLine();
else
sb.AppendFormat("{0} zones on volume ({1} bytes)", mnxSb.s_nzones, mnxSb.s_nzones * 1024).AppendLine();
sb.AppendFormat(Localization._0_zones_on_volume_1_bytes, mnxSb.s_nzones, mnxSb.s_nzones * 1024).
AppendLine();
sb.AppendFormat("{0} bytes/block", mnxSb.s_blocksize).AppendLine();
sb.AppendFormat("{0} inodes on volume", mnxSb.s_ninodes).AppendLine();
sb.AppendFormat(Localization._0_bytes_block, mnxSb.s_blocksize).AppendLine();
sb.AppendFormat(Localization._0_inodes_on_volume, mnxSb.s_ninodes).AppendLine();
sb.AppendFormat("{0} blocks on inode map ({1} bytes)", mnxSb.s_imap_blocks,
sb.AppendFormat(Localization._0_blocks_on_inode_map_1_bytes, mnxSb.s_imap_blocks,
mnxSb.s_imap_blocks * mnxSb.s_blocksize).AppendLine();
sb.AppendFormat("{0} blocks on zone map ({1} bytes)", mnxSb.s_zmap_blocks,
sb.AppendFormat(Localization._0_blocks_on_zone_map_1_bytes, mnxSb.s_zmap_blocks,
mnxSb.s_zmap_blocks * mnxSb.s_blocksize).AppendLine();
sb.AppendFormat("First data zone: {0}", mnxSb.s_firstdatazone).AppendLine();
sb.AppendFormat(Localization.First_data_zone_0, mnxSb.s_firstdatazone).AppendLine();
//sb.AppendFormat("log2 of blocks/zone: {0}", mnx_sb.s_log_zone_size).AppendLine(); // Apparently 0
sb.AppendFormat("{0} bytes maximum per file", mnxSb.s_max_size).AppendLine();
sb.AppendFormat("On-disk filesystem version: {0}", mnxSb.s_disk_version).AppendLine();
sb.AppendFormat(Localization._0_bytes_maximum_per_file, mnxSb.s_max_size).AppendLine();
sb.AppendFormat(Localization.On_disk_filesystem_version_0, mnxSb.s_disk_version).AppendLine();
XmlFsType.ClusterSize = mnxSb.s_blocksize;
XmlFsType.Clusters = mnxSb.s_zones > 0 ? mnxSb.s_zones : mnxSb.s_nzones;
@@ -293,26 +298,28 @@ public sealed class MinixFS : IFilesystem
: Marshal.ByteArrayToStructureBigEndian<SuperBlock>(minixSbSector);
sb.AppendLine(minixVersion);
sb.AppendFormat("{0} chars in filename", filenamesize).AppendLine();
sb.AppendFormat(Localization._0_chars_in_filename, filenamesize).AppendLine();
if(mnxSb.s_zones > 0) // On V2
sb.AppendFormat("{0} zones on volume ({1} bytes)", mnxSb.s_zones, mnxSb.s_zones * 1024).AppendLine();
sb.AppendFormat(Localization._0_zones_on_volume_1_bytes, mnxSb.s_zones, mnxSb.s_zones * 1024).
AppendLine();
else
sb.AppendFormat("{0} zones on volume ({1} bytes)", mnxSb.s_nzones, mnxSb.s_nzones * 1024).AppendLine();
sb.AppendFormat(Localization._0_zones_on_volume_1_bytes, mnxSb.s_nzones, mnxSb.s_nzones * 1024).
AppendLine();
sb.AppendFormat("{0} inodes on volume", mnxSb.s_ninodes).AppendLine();
sb.AppendFormat(Localization._0_inodes_on_volume, mnxSb.s_ninodes).AppendLine();
sb.AppendFormat("{0} blocks on inode map ({1} bytes)", mnxSb.s_imap_blocks, mnxSb.s_imap_blocks * 1024).
AppendLine();
sb.AppendFormat(Localization._0_blocks_on_inode_map_1_bytes, mnxSb.s_imap_blocks,
mnxSb.s_imap_blocks * 1024).AppendLine();
sb.AppendFormat("{0} blocks on zone map ({1} bytes)", mnxSb.s_zmap_blocks, mnxSb.s_zmap_blocks * 1024).
AppendLine();
sb.AppendFormat(Localization._0_blocks_on_zone_map_1_bytes, mnxSb.s_zmap_blocks,
mnxSb.s_zmap_blocks * 1024).AppendLine();
sb.AppendFormat("First data zone: {0}", mnxSb.s_firstdatazone).AppendLine();
sb.AppendFormat(Localization.First_data_zone_0, mnxSb.s_firstdatazone).AppendLine();
//sb.AppendFormat("log2 of blocks/zone: {0}", mnx_sb.s_log_zone_size).AppendLine(); // Apparently 0
sb.AppendFormat("{0} bytes maximum per file", mnxSb.s_max_size).AppendLine();
sb.AppendFormat("Filesystem state: {0:X4}", mnxSb.s_state).AppendLine();
sb.AppendFormat(Localization._0_bytes_maximum_per_file, mnxSb.s_max_size).AppendLine();
sb.AppendFormat(Localization.Filesystem_state_0, mnxSb.s_state).AppendLine();
XmlFsType.ClusterSize = 1024;
XmlFsType.Clusters = mnxSb.s_zones > 0 ? mnxSb.s_zones : mnxSb.s_nzones;
}

View File

@@ -51,16 +51,18 @@ public sealed class NILFS2 : IFilesystem
const ushort NILFS2_MAGIC = 0x3434;
const uint NILFS2_SUPER_OFFSET = 1024;
const string FS_TYPE = "nilfs2";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "NILFS2 Plugin";
public string Name => Localization.NILFS2_Name;
/// <inheritdoc />
public Guid Id => new("35224226-C5CC-48B5-8FFD-3781E91E86B6");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -128,32 +130,38 @@ public sealed class NILFS2 : IFilesystem
var sb = new StringBuilder();
sb.AppendLine("NILFS2 filesystem");
sb.AppendFormat("Version {0}.{1}", nilfsSb.rev_level, nilfsSb.minor_rev_level).AppendLine();
sb.AppendFormat("{0} bytes per block", 1 << (int)(nilfsSb.log_block_size + 10)).AppendLine();
sb.AppendFormat("{0} bytes in volume", nilfsSb.dev_size).AppendLine();
sb.AppendFormat("{0} blocks per segment", nilfsSb.blocks_per_segment).AppendLine();
sb.AppendFormat("{0} segments", nilfsSb.nsegments).AppendLine();
sb.AppendLine(Localization.NILFS2_filesystem);
sb.AppendFormat(Localization.Version_0_1, nilfsSb.rev_level, nilfsSb.minor_rev_level).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_block, 1 << (int)(nilfsSb.log_block_size + 10)).AppendLine();
sb.AppendFormat(Localization._0_bytes_in_volume, nilfsSb.dev_size).AppendLine();
sb.AppendFormat(Localization._0_blocks_per_segment, nilfsSb.blocks_per_segment).AppendLine();
sb.AppendFormat(Localization._0_segments, nilfsSb.nsegments).AppendLine();
if(nilfsSb.creator_os == 0)
sb.AppendLine("Filesystem created on Linux");
sb.AppendLine(Localization.Filesystem_created_on_Linux);
else
sb.AppendFormat("Creator OS code: {0}", nilfsSb.creator_os).AppendLine();
sb.AppendFormat(Localization.Creator_OS_code_0, nilfsSb.creator_os).AppendLine();
sb.AppendFormat("{0} bytes per inode", nilfsSb.inode_size).AppendLine();
sb.AppendFormat("Volume UUID: {0}", nilfsSb.uuid).AppendLine();
sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(nilfsSb.volume_name, Encoding)).AppendLine();
sb.AppendFormat("Volume created on {0}", DateHandlers.UnixUnsignedToDateTime(nilfsSb.ctime)).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_inode, nilfsSb.inode_size).AppendLine();
sb.AppendFormat(Localization.Volume_UUID_0, nilfsSb.uuid).AppendLine();
sb.AppendFormat("Volume last mounted on {0}", DateHandlers.UnixUnsignedToDateTime(nilfsSb.mtime)).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(nilfsSb.volume_name, Encoding)).
AppendLine();
sb.AppendFormat("Volume last written on {0}", DateHandlers.UnixUnsignedToDateTime(nilfsSb.wtime)).AppendLine();
sb.AppendFormat(Localization.Volume_created_on_0, DateHandlers.UnixUnsignedToDateTime(nilfsSb.ctime)).
AppendLine();
sb.AppendFormat(Localization.Volume_last_mounted_on_0, DateHandlers.UnixUnsignedToDateTime(nilfsSb.mtime)).
AppendLine();
sb.AppendFormat(Localization.Volume_last_written_on_0, DateHandlers.UnixUnsignedToDateTime(nilfsSb.wtime)).
AppendLine();
information = sb.ToString();
XmlFsType = new FileSystemType
{
Type = "NILFS2 filesystem",
Type = FS_TYPE,
ClusterSize = (uint)(1 << (int)(nilfsSb.log_block_size + 10)),
VolumeName = StringHandlers.CToString(nilfsSb.volume_name, Encoding),
VolumeSerial = nilfsSb.uuid.ToString(),

View File

@@ -48,16 +48,17 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of the New Technology File System (NTFS)</summary>
public sealed class NTFS : IFilesystem
{
const string FS_TYPE = "ntfs";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "New Technology File System (NTFS)";
public string Name => Localization.NTFS_Name;
/// <inheritdoc />
public Guid Id => new("33513B2C-1e6d-4d21-a660-0bbc789c3871");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -106,43 +107,44 @@ public sealed class NTFS : IFilesystem
BiosParameterBlock ntfsBb = Marshal.ByteArrayToStructureLittleEndian<BiosParameterBlock>(ntfsBpb);
sb.AppendFormat("{0} bytes per sector", ntfsBb.bps).AppendLine();
sb.AppendFormat("{0} sectors per cluster ({1} bytes)", ntfsBb.spc, ntfsBb.spc * ntfsBb.bps).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_sector, ntfsBb.bps).AppendLine();
sb.AppendFormat(Localization._0_sectors_per_cluster_1_bytes, ntfsBb.spc, ntfsBb.spc * ntfsBb.bps).AppendLine();
// sb.AppendFormat("{0} reserved sectors", ntfs_bb.rsectors).AppendLine();
// sb.AppendFormat("{0} FATs", ntfs_bb.fats_no).AppendLine();
// sb.AppendFormat("{0} entries in the root folder", ntfs_bb.root_ent).AppendLine();
// sb.AppendFormat("{0} sectors on volume (small)", ntfs_bb.sml_sectors).AppendLine();
sb.AppendFormat("Media descriptor: 0x{0:X2}", ntfsBb.media).AppendLine();
sb.AppendFormat(Localization.Media_descriptor_0, ntfsBb.media).AppendLine();
// sb.AppendFormat("{0} sectors per FAT", ntfs_bb.spfat).AppendLine();
sb.AppendFormat("{0} sectors per track", ntfsBb.sptrk).AppendLine();
sb.AppendFormat("{0} heads", ntfsBb.heads).AppendLine();
sb.AppendFormat("{0} hidden sectors before filesystem", ntfsBb.hsectors).AppendLine();
sb.AppendFormat(Localization._0_sectors_per_track, ntfsBb.sptrk).AppendLine();
sb.AppendFormat(Localization._0_heads, ntfsBb.heads).AppendLine();
sb.AppendFormat(Localization._0_hidden_sectors_before_filesystem, ntfsBb.hsectors).AppendLine();
// sb.AppendFormat("{0} sectors on volume (big)", ntfs_bb.big_sectors).AppendLine();
sb.AppendFormat("BIOS drive number: 0x{0:X2}", ntfsBb.drive_no).AppendLine();
sb.AppendFormat(Localization.BIOS_drive_number_0, ntfsBb.drive_no).AppendLine();
// sb.AppendFormat("NT flags: 0x{0:X2}", ntfs_bb.nt_flags).AppendLine();
// sb.AppendFormat("Signature 1: 0x{0:X2}", ntfs_bb.signature1).AppendLine();
sb.AppendFormat("{0} sectors on volume ({1} bytes)", ntfsBb.sectors, ntfsBb.sectors * ntfsBb.bps).AppendLine();
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, ntfsBb.sectors, ntfsBb.sectors * ntfsBb.bps).
AppendLine();
sb.AppendFormat("Cluster where $MFT starts: {0}", ntfsBb.mft_lsn).AppendLine();
sb.AppendFormat("Cluster where $MFTMirr starts: {0}", ntfsBb.mftmirror_lsn).AppendLine();
sb.AppendFormat(Localization.Cluster_where_MFT_starts_0, ntfsBb.mft_lsn).AppendLine();
sb.AppendFormat(Localization.Cluster_where_MFTMirr_starts_0, ntfsBb.mftmirror_lsn).AppendLine();
if(ntfsBb.mft_rc_clusters > 0)
sb.AppendFormat("{0} clusters per MFT record ({1} bytes)", ntfsBb.mft_rc_clusters,
sb.AppendFormat(Localization._0_clusters_per_MFT_record_1_bytes, ntfsBb.mft_rc_clusters,
ntfsBb.mft_rc_clusters * ntfsBb.bps * ntfsBb.spc).AppendLine();
else
sb.AppendFormat("{0} bytes per MFT record", 1 << -ntfsBb.mft_rc_clusters).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_MFT_record, 1 << -ntfsBb.mft_rc_clusters).AppendLine();
if(ntfsBb.index_blk_cts > 0)
sb.AppendFormat("{0} clusters per Index block ({1} bytes)", ntfsBb.index_blk_cts,
sb.AppendFormat(Localization._0_clusters_per_Index_block_1_bytes, ntfsBb.index_blk_cts,
ntfsBb.index_blk_cts * ntfsBb.bps * ntfsBb.spc).AppendLine();
else
sb.AppendFormat("{0} bytes per Index block", 1 << -ntfsBb.index_blk_cts).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_Index_block, 1 << -ntfsBb.index_blk_cts).AppendLine();
sb.AppendFormat("Volume serial number: {0:X16}", ntfsBb.serial_no).AppendLine();
sb.AppendFormat(Localization.Volume_serial_number_0_X16, ntfsBb.serial_no).AppendLine();
// sb.AppendFormat("Signature 2: 0x{0:X4}", ntfs_bb.signature2).AppendLine();
@@ -155,14 +157,14 @@ public sealed class NTFS : IFilesystem
{
XmlFsType.Bootable = true;
string bootChk = Sha1Context.Data(ntfsBb.boot_code, out _);
sb.AppendLine("Volume is bootable");
sb.AppendFormat("Boot code's SHA1: {0}", bootChk).AppendLine();
sb.AppendLine(Localization.Volume_is_bootable);
sb.AppendFormat(Localization.Boot_code_SHA1_0, bootChk).AppendLine();
}
XmlFsType.ClusterSize = (uint)(ntfsBb.spc * ntfsBb.bps);
XmlFsType.Clusters = (ulong)(ntfsBb.sectors / ntfsBb.spc);
XmlFsType.VolumeSerial = $"{ntfsBb.serial_no:X16}";
XmlFsType.Type = "NTFS";
XmlFsType.Type = FS_TYPE;
information = sb.ToString();
}

View File

@@ -46,16 +46,18 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of the filesystem used by Nintendo Gamecube and Wii discs</summary>
public sealed class NintendoPlugin : IFilesystem
{
const string FS_TYPE_NGC = "ngcfs";
const string FS_TYPE_WII = "wiifs";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Nintendo optical filesystems";
public string Name => Localization.NintendoPlugin_Name;
/// <inheritdoc />
public Guid Id => new("4675fcb4-4418-4288-9e4a-33d6a4ac1126");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -260,142 +262,140 @@ public sealed class NintendoPlugin : IFilesystem
AaruConsole.DebugWriteLine("Nintendo plugin", "australiaAge = {0}", fields.AustraliaAge);
AaruConsole.DebugWriteLine("Nintendo plugin", "koreaAge = {0}", fields.KoreaAge);
sbInformation.AppendLine("Nintendo optical filesystem");
sbInformation.AppendLine(wii ? "Nintendo Wii Optical Disc" : "Nintendo GameCube Optical Disc");
sbInformation.AppendFormat("Disc ID is {0}", fields.DiscId).AppendLine();
sbInformation.AppendFormat("Disc is a {0} disc", DiscTypeToString(fields.DiscType)).AppendLine();
sbInformation.AppendFormat("Disc region is {0}", RegionCodeToString(fields.RegionCode)).AppendLine();
sbInformation.AppendFormat("Published by {0}", PublisherCodeToString(fields.PublisherCode)).AppendLine();
sbInformation.AppendLine(Localization.Nintendo_optical_filesystem);
sbInformation.AppendLine(wii ? Localization.Nintendo_Wii_Optical_Disc
: Localization.Nintendo_GameCube_Optical_Disc);
sbInformation.AppendFormat(Localization.Disc_ID_is_0, fields.DiscId).AppendLine();
sbInformation.AppendFormat(Localization.Disc_is_a_0_disc, DiscTypeToString(fields.DiscType)).AppendLine();
sbInformation.AppendFormat(Localization.Disc_region_is_0, RegionCodeToString(fields.RegionCode)).AppendLine();
sbInformation.AppendFormat(Localization.Published_by_0, PublisherCodeToString(fields.PublisherCode)).
AppendLine();
if(fields.DiscNumber > 0)
sbInformation.AppendFormat("Disc number {0} of a multi-disc set", fields.DiscNumber + 1).AppendLine();
if(fields.Streaming)
sbInformation.AppendLine("Disc is prepared for audio streaming");
if(fields.StreamBufferSize > 0)
sbInformation.AppendFormat("Audio streaming buffer size is {0} bytes", fields.StreamBufferSize).
sbInformation.AppendFormat(Localization.Disc_number_0_of_a_multi_disc_set, fields.DiscNumber + 1).
AppendLine();
sbInformation.AppendFormat("Title: {0}", fields.Title).AppendLine();
if(fields.Streaming)
sbInformation.AppendLine(Localization.Disc_is_prepared_for_audio_streaming);
if(fields.StreamBufferSize > 0)
sbInformation.AppendFormat(Localization.Audio_streaming_buffer_size_is_0_bytes, fields.StreamBufferSize).
AppendLine();
sbInformation.AppendFormat(Localization.Title_0, fields.Title).AppendLine();
if(wii)
{
for(int i = 0; i < fields.FirstPartitions.Length; i++)
sbInformation.AppendFormat("First {0} partition starts at sector {1}",
sbInformation.AppendFormat(Localization.First_0_partition_starts_at_sector_1,
PartitionTypeToString(fields.FirstPartitions[i].Type),
fields.FirstPartitions[i].Offset / 2048).AppendLine();
for(int i = 0; i < fields.SecondPartitions.Length; i++)
sbInformation.AppendFormat("Second {0} partition starts at sector {1}",
sbInformation.AppendFormat(Localization.Second_0_partition_starts_at_sector_1,
PartitionTypeToString(fields.SecondPartitions[i].Type),
fields.SecondPartitions[i].Offset / 2048).AppendLine();
for(int i = 0; i < fields.ThirdPartitions.Length; i++)
sbInformation.AppendFormat("Third {0} partition starts at sector {1}",
sbInformation.AppendFormat(Localization.Third_0_partition_starts_at_sector_1,
PartitionTypeToString(fields.ThirdPartitions[i].Type),
fields.ThirdPartitions[i].Offset / 2048).AppendLine();
for(int i = 0; i < fields.FourthPartitions.Length; i++)
sbInformation.AppendFormat("Fourth {0} partition starts at sector {1}",
sbInformation.AppendFormat(Localization.Fourth_0_partition_starts_at_sector_1,
PartitionTypeToString(fields.FourthPartitions[i].Type),
fields.FourthPartitions[i].Offset / 2048).AppendLine();
// sbInformation.AppendFormat("Region byte is {0}", fields.region).AppendLine();
if((fields.JapanAge & 0x80) != 0x80)
sbInformation.AppendFormat("Japan age rating is {0}", fields.JapanAge).AppendLine();
sbInformation.AppendFormat(Localization.Japan_age_rating_is_0, fields.JapanAge).AppendLine();
if((fields.UsaAge & 0x80) != 0x80)
sbInformation.AppendFormat("ESRB age rating is {0}", fields.UsaAge).AppendLine();
sbInformation.AppendFormat(Localization.ESRB_age_rating_is_0, fields.UsaAge).AppendLine();
if((fields.GermanAge & 0x80) != 0x80)
sbInformation.AppendFormat("German age rating is {0}", fields.GermanAge).AppendLine();
sbInformation.AppendFormat(Localization.German_age_rating_is_0, fields.GermanAge).AppendLine();
if((fields.PegiAge & 0x80) != 0x80)
sbInformation.AppendFormat("PEGI age rating is {0}", fields.PegiAge).AppendLine();
sbInformation.AppendFormat(Localization.PEGI_age_rating_is_0, fields.PegiAge).AppendLine();
if((fields.FinlandAge & 0x80) != 0x80)
sbInformation.AppendFormat("Finland age rating is {0}", fields.FinlandAge).AppendLine();
sbInformation.AppendFormat(Localization.Finland_age_rating_is_0, fields.FinlandAge).AppendLine();
if((fields.PortugalAge & 0x80) != 0x80)
sbInformation.AppendFormat("Portugal age rating is {0}", fields.PortugalAge).AppendLine();
sbInformation.AppendFormat(Localization.Portugal_age_rating_is_0, fields.PortugalAge).AppendLine();
if((fields.UkAge & 0x80) != 0x80)
sbInformation.AppendFormat("UK age rating is {0}", fields.UkAge).AppendLine();
sbInformation.AppendFormat(Localization.UK_age_rating_is_0, fields.UkAge).AppendLine();
if((fields.AustraliaAge & 0x80) != 0x80)
sbInformation.AppendFormat("Australia age rating is {0}", fields.AustraliaAge).AppendLine();
sbInformation.AppendFormat(Localization.Australia_age_rating_is_0, fields.AustraliaAge).AppendLine();
if((fields.KoreaAge & 0x80) != 0x80)
sbInformation.AppendFormat("Korea age rating is {0}", fields.KoreaAge).AppendLine();
sbInformation.AppendFormat(Localization.Korea_age_rating_is_0, fields.KoreaAge).AppendLine();
}
else
sbInformation.AppendFormat("FST starts at {0} and has {1} bytes", fields.FstOff, fields.FstSize).
sbInformation.AppendFormat(Localization.FST_starts_at_0_and_has_1_bytes, fields.FstOff, fields.FstSize).
AppendLine();
information = sbInformation.ToString();
XmlFsType.Bootable = true;
XmlFsType.Clusters = imagePlugin.Info.Sectors * imagePlugin.Info.SectorSize / 2048;
XmlFsType.ClusterSize = 2048;
XmlFsType.Type = wii ? "Nintendo Wii filesystem" : "Nintendo Gamecube filesystem";
XmlFsType.Type = wii ? FS_TYPE_WII : FS_TYPE_NGC;
XmlFsType.VolumeName = fields.Title;
XmlFsType.VolumeSerial = fields.DiscId;
}
static string DiscTypeToString(string discType)
static string DiscTypeToString(string discType) => discType switch
{
switch(discType)
{
case "C": return "Commodore 64 Virtual Console";
case "D": return "Demo";
case "E": return "Neo-Geo Virtual Console";
case "F": return "NES Virtual Console";
case "G": return "Gamecube";
case "H": return "Wii channel";
case "J": return "Super Nintendo Virtual Console";
case "L": return "Master System Virtual Console";
case "M": return "Megadrive Virtual Console";
case "N": return "Nintendo 64 Virtual Console";
case "P": return "Promotional or TurboGrafx Virtual Console";
case "Q": return "TurboGrafx CD Virtual Console";
case "R":
case "S": return "Wii";
case "U": return "Utility";
case "W": return "WiiWare";
case "X": return "MSX Virtual Console or WiiWare demo";
case "0":
case "1": return "Diagnostic";
case "4": return "Wii Backup";
case "_": return "WiiFit";
}
"C" => Localization.Commodore_64_Virtual_Console,
"D" => Localization.Demo,
"E" => Localization.Neo_Geo_Virtual_Console,
"F" => Localization.NES_Virtual_Console,
"G" => Localization.Gamecube,
"H" => Localization.Wii_channel,
"J" => Localization.Super_Nintendo_Virtual_Console,
"L" => Localization.Master_System_Virtual_Console,
"M" => Localization.Megadrive_Virtual_Console,
"N" => Localization.Nintendo_64_Virtual_Console,
"P" => Localization.Promotional_or_TurboGrafx_Virtual_Console,
"Q" => Localization.TurboGrafx_CD_Virtual_Console,
"R" => Localization.Wii,
"S" => Localization.Wii,
"U" => Localization.Utility,
"W" => Localization.WiiWare,
"X" => Localization.MSX_Virtual_Console_or_WiiWare_demo,
"0" => Localization.Diagnostic,
"1" => Localization.Diagnostic,
"4" => Localization.Wii_Backup,
"_" => Localization.WiiFit,
_ => string.Format(Localization.unknown_type_0, discType)
};
return $"unknown type '{discType}'";
}
static string RegionCodeToString(string regionCode)
static string RegionCodeToString(string regionCode) => regionCode switch
{
switch(regionCode)
{
case "A": return "any region";
case "D": return "Germany";
case "N":
case "E": return "USA";
case "F": return "France";
case "I": return "Italy";
case "J": return "Japan";
case "K":
case "Q": return "Korea";
case "L":
case "M":
case "P": return "PAL";
case "R": return "Russia";
case "S": return "Spain";
case "T": return "Taiwan";
case "U": return "Australia";
}
return $"unknown code '{regionCode}'";
}
"A" => Localization.NintendoPlugin_RegionCodeToString_any_region,
"D" => Localization.NintendoPlugin_RegionCodeToString_Germany,
"N" => Localization.NintendoPlugin_RegionCodeToString_USA,
"E" => Localization.NintendoPlugin_RegionCodeToString_USA,
"F" => Localization.NintendoPlugin_RegionCodeToString_France,
"I" => Localization.NintendoPlugin_RegionCodeToString_Italy,
"J" => Localization.NintendoPlugin_RegionCodeToString_Japan,
"K" => Localization.NintendoPlugin_RegionCodeToString_Korea,
"Q" => Localization.NintendoPlugin_RegionCodeToString_Korea,
"L" => Localization.NintendoPlugin_RegionCodeToString_PAL,
"M" => Localization.NintendoPlugin_RegionCodeToString_PAL,
"P" => Localization.NintendoPlugin_RegionCodeToString_PAL,
"R" => Localization.NintendoPlugin_RegionCodeToString_Russia,
"S" => Localization.NintendoPlugin_RegionCodeToString_Spain,
"T" => Localization.NintendoPlugin_RegionCodeToString_Taiwan,
"U" => Localization.NintendoPlugin_RegionCodeToString_Australia,
_ => string.Format(Localization.NintendoPlugin_RegionCodeToString_unknown_region_code_0, regionCode)
};
[SuppressMessage("ReSharper", "StringLiteralTypo")]
static string PublisherCodeToString(string publisherCode) => publisherCode switch
@@ -421,15 +421,15 @@ public sealed class NintendoPlugin : IFilesystem
"4Q" => "Disney Interactive",
"GD" => "Square Enix",
"7D" => "Sierra",
_ => $"Unknown publisher '{publisherCode}'"
_ => string.Format(Localization.Unknown_publisher_0, publisherCode)
};
static string PartitionTypeToString(uint type) => type switch
{
0 => "data",
1 => "update",
2 => "channel",
_ => $"unknown type {type}"
0 => Localization.data,
1 => Localization.update,
2 => Localization.channel,
_ => string.Format(Localization.unknown_partition_type_0, type)
};
struct NintendoFields

View File

@@ -56,16 +56,17 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of DEC's On-Disk Structure, aka the ODS filesystem</summary>
public sealed class ODS : IFilesystem
{
const string FS_TYPE = "files11";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Files-11 On-Disk Structure";
public string Name => Localization.ODS_Name;
/// <inheritdoc />
public Guid Id => new("de20633c-8021-4384-aeb0-83b0df14491f");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -85,7 +86,7 @@ public sealed class ODS : IFilesystem
Array.Copy(hbSector, 0x1F0, magicB, 0, 12);
string magic = Encoding.ASCII.GetString(magicB);
AaruConsole.DebugWriteLine("Files-11 plugin", "magic: \"{0}\"", magic);
AaruConsole.DebugWriteLine("Files-11 plugin", Localization.magic_0, magic);
if(magic is "DECFILE11A " or "DECFILE11B ")
return true;
@@ -105,7 +106,7 @@ public sealed class ODS : IFilesystem
Array.Copy(hbSector, 0x3F0, magicB, 0, 12);
magic = Encoding.ASCII.GetString(magicB);
AaruConsole.DebugWriteLine("Files-11 plugin", "unaligned magic: \"{0}\"", magic);
AaruConsole.DebugWriteLine("Files-11 plugin", Localization.unaligned_magic_0, magic);
return magic is "DECFILE11A " or "DECFILE11B ";
}
@@ -151,89 +152,93 @@ public sealed class ODS : IFilesystem
if((homeblock.struclev & 0xFF00) != 0x0200 ||
(homeblock.struclev & 0xFF) != 1 ||
StringHandlers.CToString(homeblock.format) != "DECFILE11B ")
sb.AppendLine("The following information may be incorrect for this volume.");
sb.AppendLine(Localization.The_following_information_may_be_incorrect_for_this_volume);
if(homeblock.resfiles < 5 ||
homeblock.devtype != 0)
sb.AppendLine("This volume may be corrupted.");
sb.AppendLine(Localization.This_volume_may_be_corrupted);
sb.AppendFormat("Volume format is {0}", StringHandlers.SpacePaddedToString(homeblock.format, Encoding)).
AppendLine();
sb.AppendFormat(Localization.Volume_format_is_0,
StringHandlers.SpacePaddedToString(homeblock.format, Encoding)).AppendLine();
sb.AppendFormat("Volume is Level {0} revision {1}", (homeblock.struclev & 0xFF00) >> 8,
sb.AppendFormat(Localization.Volume_is_Level_0_revision_1, (homeblock.struclev & 0xFF00) >> 8,
homeblock.struclev & 0xFF).AppendLine();
sb.AppendFormat("Lowest structure in the volume is Level {0}, revision {1}",
sb.AppendFormat(Localization.Lowest_structure_in_the_volume_is_Level_0_revision_1,
(homeblock.lowstruclev & 0xFF00) >> 8, homeblock.lowstruclev & 0xFF).AppendLine();
sb.AppendFormat("Highest structure in the volume is Level {0}, revision {1}",
sb.AppendFormat(Localization.Highest_structure_in_the_volume_is_Level_0_revision_1,
(homeblock.highstruclev & 0xFF00) >> 8, homeblock.highstruclev & 0xFF).AppendLine();
sb.AppendFormat("{0} sectors per cluster ({1} bytes)", homeblock.cluster, homeblock.cluster * 512).AppendLine();
sb.AppendFormat("This home block is on sector {0} (VBN {1})", homeblock.homelbn, homeblock.homevbn).
sb.AppendFormat(Localization._0_sectors_per_cluster_1_bytes, homeblock.cluster, homeblock.cluster * 512).
AppendLine();
sb.AppendFormat("Secondary home block is on sector {0} (VBN {1})", homeblock.alhomelbn, homeblock.alhomevbn).
sb.AppendFormat(Localization.This_home_block_is_on_sector_0_VBN_1, homeblock.homelbn, homeblock.homevbn).
AppendLine();
sb.AppendFormat("Volume bitmap starts in sector {0} (VBN {1})", homeblock.ibmaplbn, homeblock.ibmapvbn).
sb.AppendFormat(Localization.Secondary_home_block_is_on_sector_0_VBN_1, homeblock.alhomelbn,
homeblock.alhomevbn).AppendLine();
sb.AppendFormat(Localization.Volume_bitmap_starts_in_sector_0_VBN_1, homeblock.ibmaplbn, homeblock.ibmapvbn).
AppendLine();
sb.AppendFormat("Volume bitmap runs for {0} sectors ({1} bytes)", homeblock.ibmapsize,
sb.AppendFormat(Localization.Volume_bitmap_runs_for_0_sectors_1_bytes, homeblock.ibmapsize,
homeblock.ibmapsize * 512).AppendLine();
sb.AppendFormat("Backup INDEXF.SYS;1 is in sector {0} (VBN {1})", homeblock.altidxlbn, homeblock.altidxvbn).
sb.AppendFormat(Localization.Backup_INDEXF_SYS_is_in_sector_0_VBN_1, homeblock.altidxlbn, homeblock.altidxvbn).
AppendLine();
sb.AppendFormat("{0} maximum files on the volume", homeblock.maxfiles).AppendLine();
sb.AppendFormat("{0} reserved files", homeblock.resfiles).AppendLine();
sb.AppendFormat(Localization._0_maximum_files_on_the_volume, homeblock.maxfiles).AppendLine();
sb.AppendFormat(Localization._0_reserved_files, homeblock.resfiles).AppendLine();
if(homeblock is { rvn: > 0, setcount: > 0 } &&
StringHandlers.CToString(homeblock.strucname) != " ")
sb.AppendFormat("Volume is {0} of {1} in set \"{2}\".", homeblock.rvn, homeblock.setcount,
sb.AppendFormat(Localization.Volume_is_0_of_1_in_set_2, homeblock.rvn, homeblock.setcount,
StringHandlers.SpacePaddedToString(homeblock.strucname, Encoding)).AppendLine();
sb.AppendFormat("Volume owner is \"{0}\" (ID 0x{1:X8})",
sb.AppendFormat(Localization.Volume_owner_is_0_ID_1,
StringHandlers.SpacePaddedToString(homeblock.ownername, Encoding), homeblock.volowner).
AppendLine();
sb.AppendFormat("Volume label: \"{0}\"", StringHandlers.SpacePaddedToString(homeblock.volname, Encoding)).
sb.AppendFormat(Localization.Volume_label_0, StringHandlers.SpacePaddedToString(homeblock.volname, Encoding)).
AppendLine();
sb.AppendFormat("Drive serial number: 0x{0:X8}", homeblock.serialnum).AppendLine();
sb.AppendFormat("Volume was created on {0}", DateHandlers.VmsToDateTime(homeblock.credate)).AppendLine();
sb.AppendFormat(Localization.Drive_serial_number_0, homeblock.serialnum).AppendLine();
sb.AppendFormat(Localization.Volume_was_created_on_0, DateHandlers.VmsToDateTime(homeblock.credate)).
AppendLine();
if(homeblock.revdate > 0)
sb.AppendFormat("Volume was last modified on {0}", DateHandlers.VmsToDateTime(homeblock.revdate)).
sb.AppendFormat(Localization.Volume_was_last_modified_on_0, DateHandlers.VmsToDateTime(homeblock.revdate)).
AppendLine();
if(homeblock.copydate > 0)
sb.AppendFormat("Volume copied on {0}", DateHandlers.VmsToDateTime(homeblock.copydate)).AppendLine();
sb.AppendFormat(Localization.Volume_copied_on_0, DateHandlers.VmsToDateTime(homeblock.copydate)).
AppendLine();
sb.AppendFormat("Checksums: 0x{0:X4} and 0x{1:X4}", homeblock.checksum1, homeblock.checksum2).AppendLine();
sb.AppendLine("Flags:");
sb.AppendFormat("Window: {0}", homeblock.window).AppendLine();
sb.AppendFormat("Cached directories: {0}", homeblock.lru_lim).AppendLine();
sb.AppendFormat("Default allocation: {0} blocks", homeblock.extend).AppendLine();
sb.AppendFormat(Localization.Checksums_0_and_1, homeblock.checksum1, homeblock.checksum2).AppendLine();
sb.AppendLine(Localization.Flags);
sb.AppendFormat(Localization.Window_0, homeblock.window).AppendLine();
sb.AppendFormat(Localization.Cached_directories_0, homeblock.lru_lim).AppendLine();
sb.AppendFormat(Localization.Default_allocation_0_blocks, homeblock.extend).AppendLine();
if((homeblock.volchar & 0x01) == 0x01)
sb.AppendLine("Readings should be verified");
sb.AppendLine(Localization.Readings_should_be_verified);
if((homeblock.volchar & 0x02) == 0x02)
sb.AppendLine("Writings should be verified");
sb.AppendLine(Localization.Writings_should_be_verified);
if((homeblock.volchar & 0x04) == 0x04)
sb.AppendLine("Files should be erased or overwritten when deleted");
sb.AppendLine(Localization.Files_should_be_erased_or_overwritten_when_deleted);
if((homeblock.volchar & 0x08) == 0x08)
sb.AppendLine("Highwater mark is to be disabled");
sb.AppendLine(Localization.Highwater_mark_is_to_be_disabled);
if((homeblock.volchar & 0x10) == 0x10)
sb.AppendLine("Classification checks are enabled");
sb.AppendLine(Localization.Classification_checks_are_enabled);
sb.AppendLine("Volume permissions (r = read, w = write, c = create, d = delete)");
sb.AppendLine("System, owner, group, world");
sb.AppendLine(Localization.Volume_permissions_r_read_w_write_c_create_d_delete);
sb.AppendLine(Localization.System_owner_group_world);
// System
sb.Append((homeblock.protect & 0x1000) == 0x1000 ? "-" : "r");
@@ -261,14 +266,14 @@ public sealed class ODS : IFilesystem
sb.AppendLine();
sb.AppendLine("Unknown structures:");
sb.AppendFormat("Security mask: 0x{0:X8}", homeblock.sec_mask).AppendLine();
sb.AppendFormat("File protection: 0x{0:X4}", homeblock.fileprot).AppendLine();
sb.AppendFormat("Record protection: 0x{0:X4}", homeblock.recprot).AppendLine();
sb.AppendLine(Localization.Unknown_structures);
sb.AppendFormat(Localization.Security_mask_0, homeblock.sec_mask).AppendLine();
sb.AppendFormat(Localization.File_protection_0, homeblock.fileprot).AppendLine();
sb.AppendFormat(Localization.Record_protection_0, homeblock.recprot).AppendLine();
XmlFsType = new FileSystemType
{
Type = "FILES-11",
Type = FS_TYPE,
ClusterSize = (uint)(homeblock.cluster * 512),
Clusters = partition.Size / (ulong)(homeblock.cluster * 512),
VolumeName = StringHandlers.SpacePaddedToString(homeblock.volname, Encoding),

View File

@@ -55,4 +55,6 @@ public sealed partial class OperaFS
File = 2, Special = 6, Directory = 7,
LastEntryInBlock = 0x40000000, LastEntry = 0x80000000
}
const string FS_TYPE = "opera";
}

View File

@@ -88,53 +88,55 @@ public sealed partial class OperaFS
if(Encoding.ASCII.GetString(sb.sync_bytes) != SYNC)
return;
superBlockMetadata.AppendFormat("Opera filesystem disc.").AppendLine();
superBlockMetadata.AppendFormat(Localization.Opera_filesystem_disc).AppendLine();
if(!string.IsNullOrEmpty(StringHandlers.CToString(sb.volume_label, Encoding)))
superBlockMetadata.AppendFormat("Volume label: {0}", StringHandlers.CToString(sb.volume_label, Encoding)).
AppendLine();
superBlockMetadata.
AppendFormat(Localization.Volume_label_0, StringHandlers.CToString(sb.volume_label, Encoding)).
AppendLine();
if(!string.IsNullOrEmpty(StringHandlers.CToString(sb.volume_comment, Encoding)))
superBlockMetadata.
AppendFormat("Volume comment: {0}", StringHandlers.CToString(sb.volume_comment, Encoding)).AppendLine();
AppendFormat(Localization.Volume_comment_0, StringHandlers.CToString(sb.volume_comment, Encoding)).
AppendLine();
superBlockMetadata.AppendFormat("Volume identifier: 0x{0:X8}", sb.volume_id).AppendLine();
superBlockMetadata.AppendFormat("Block size: {0} bytes", sb.block_size).AppendLine();
superBlockMetadata.AppendFormat(Localization.Volume_identifier_0_X8, sb.volume_id).AppendLine();
superBlockMetadata.AppendFormat(Localization.Block_size_0_bytes, sb.block_size).AppendLine();
if(imagePlugin.Info.SectorSize is 2336 or 2352 or 2448)
{
if(sb.block_size != 2048)
superBlockMetadata.
AppendFormat("WARNING: Filesystem indicates {0} bytes/block while device indicates {1} bytes/block",
AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_block,
sb.block_size, 2048);
}
else if(imagePlugin.Info.SectorSize != sb.block_size)
superBlockMetadata.
AppendFormat("WARNING: Filesystem indicates {0} bytes/block while device indicates {1} bytes/block",
AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_block,
sb.block_size, imagePlugin.Info.SectorSize);
superBlockMetadata.
AppendFormat("Volume size: {0} blocks, {1} bytes", sb.block_count, sb.block_size * sb.block_count).
AppendFormat(Localization.Volume_size_0_blocks_1_bytes, sb.block_count, sb.block_size * sb.block_count).
AppendLine();
if(sb.block_count > imagePlugin.Info.Sectors)
superBlockMetadata.
AppendFormat("WARNING: Filesystem indicates {0} blocks while device indicates {1} blocks",
AppendFormat(Localization.WARNING__Filesystem_indicates_0_blocks_while_device_indicates_1_blocks,
sb.block_count, imagePlugin.Info.Sectors);
superBlockMetadata.AppendFormat("Root directory identifier: 0x{0:X8}", sb.root_dirid).AppendLine();
superBlockMetadata.AppendFormat("Root directory block size: {0} bytes", sb.rootdir_bsize).AppendLine();
superBlockMetadata.AppendFormat(Localization.Root_directory_identifier_0, sb.root_dirid).AppendLine();
superBlockMetadata.AppendFormat(Localization.Root_directory_block_size_0_bytes, sb.rootdir_bsize).AppendLine();
superBlockMetadata.AppendFormat("Root directory size: {0} blocks, {1} bytes", sb.rootdir_blocks,
superBlockMetadata.AppendFormat(Localization.Root_directory_size_0_blocks_1_bytes, sb.rootdir_blocks,
sb.rootdir_bsize * sb.rootdir_blocks).AppendLine();
superBlockMetadata.AppendFormat("Last root directory copy: {0}", sb.last_root_copy).AppendLine();
superBlockMetadata.AppendFormat(Localization.Last_root_directory_copy_0, sb.last_root_copy).AppendLine();
information = superBlockMetadata.ToString();
XmlFsType = new FileSystemType
{
Type = "Opera",
Type = FS_TYPE,
VolumeName = StringHandlers.CToString(sb.volume_label, Encoding),
ClusterSize = sb.block_size,
Clusters = sb.block_count

View File

@@ -57,11 +57,11 @@ public sealed partial class OperaFS : IReadOnlyFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Opera Filesystem Plugin";
public string Name => Localization.OperaFS_Name;
/// <inheritdoc />
public Guid Id => new("0ec84ec7-eae6-4196-83fe-943b3fe46dbd");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public ErrorNumber ListXAttr(string path, out List<string> xattrs)

View File

@@ -76,7 +76,7 @@ public sealed partial class OperaFS
XmlFsType = new FileSystemType
{
Type = "Opera",
Type = FS_TYPE,
VolumeName = StringHandlers.CToString(sb.volume_label, Encoding),
ClusterSize = sb.block_size,
Clusters = sb.block_count,
@@ -95,7 +95,7 @@ public sealed partial class OperaFS
Serial32 = sb.volume_id
},
PluginId = Id,
Type = "Opera"
Type = FS_TYPE
};
_image = imagePlugin;

View File

@@ -43,16 +43,17 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of the PC-Engine CD file headers</summary>
public sealed class PCEnginePlugin : IFilesystem
{
const string FS_TYPE = "pcengine";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "PC Engine CD Plugin";
public string Name => Localization.PCEnginePlugin_Name;
/// <inheritdoc />
public Guid Id => new("e5ee6d7c-90fa-49bd-ac89-14ef750b8af3");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -79,7 +80,7 @@ public sealed class PCEnginePlugin : IFilesystem
XmlFsType = new FileSystemType
{
Type = "PC Engine filesystem",
Type = FS_TYPE,
Clusters = (partition.End - partition.Start + 1) / imagePlugin.Info.SectorSize * 2048,
ClusterSize = 2048
};

View File

@@ -48,16 +48,18 @@ namespace Aaru.Filesystems;
public sealed class PCFX : IFilesystem
{
const string IDENTIFIER = "PC-FX:Hu_CD-ROM ";
const string FS_TYPE = "pcfx";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "PC-FX Plugin";
public string Name => Localization.PCFX_Name;
/// <inheritdoc />
public Guid Id => new("8BC27CCE-D9E9-48F8-BA93-C66A86EB565A");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -107,28 +109,28 @@ public sealed class PCFX : IFilesystem
}
var sb = new StringBuilder();
sb.AppendLine("PC-FX executable:");
sb.AppendFormat("Identifier: {0}", StringHandlers.CToString(header.signature, Encoding)).AppendLine();
sb.AppendFormat("Copyright: {0}", StringHandlers.CToString(header.copyright, Encoding)).AppendLine();
sb.AppendFormat("Title: {0}", StringHandlers.CToString(header.title, Encoding)).AppendLine();
sb.AppendFormat("Maker ID: {0}", StringHandlers.CToString(header.makerId, Encoding)).AppendLine();
sb.AppendFormat("Maker name: {0}", StringHandlers.CToString(header.makerName, Encoding)).AppendLine();
sb.AppendFormat("Volume number: {0}", header.volumeNumber).AppendLine();
sb.AppendFormat("Country code: {0}", header.country).AppendLine();
sb.AppendFormat("Version: {0}.{1}", header.minorVersion, header.majorVersion).AppendLine();
sb.AppendLine(Localization.PC_FX_executable);
sb.AppendFormat(Localization.Identifier_0, StringHandlers.CToString(header.signature, Encoding)).AppendLine();
sb.AppendFormat(Localization.Copyright_0, StringHandlers.CToString(header.copyright, Encoding)).AppendLine();
sb.AppendFormat(Localization.Title_0, StringHandlers.CToString(header.title, Encoding)).AppendLine();
sb.AppendFormat(Localization.Maker_ID_0, StringHandlers.CToString(header.makerId, Encoding)).AppendLine();
sb.AppendFormat(Localization.Maker_name_0, StringHandlers.CToString(header.makerName, Encoding)).AppendLine();
sb.AppendFormat(Localization.Volume_number_0, header.volumeNumber).AppendLine();
sb.AppendFormat(Localization.Country_code_0, header.country).AppendLine();
sb.AppendFormat(Localization.Version_0_1, header.minorVersion, header.majorVersion).AppendLine();
if(date != null)
sb.AppendFormat("Dated {0}", dateTime).AppendLine();
sb.AppendFormat(Localization.Dated_0, dateTime).AppendLine();
sb.AppendFormat("Load {0} sectors from sector {1}", header.loadCount, header.loadOffset).AppendLine();
sb.AppendFormat(Localization.Load_0_sectors_from_sector_1, header.loadCount, header.loadOffset).AppendLine();
sb.AppendFormat("Load at 0x{0:X8} and jump to 0x{1:X8}", header.loadAddress, header.entryPoint).AppendLine();
sb.AppendFormat(Localization.Load_at_0_and_jump_to_1, header.loadAddress, header.entryPoint).AppendLine();
information = sb.ToString();
XmlFsType = new FileSystemType
{
Type = "PC-FX",
Type = FS_TYPE,
Clusters = partition.Length,
ClusterSize = 2048,
Bootable = true,

View File

@@ -59,16 +59,18 @@ public sealed class PFS : IFilesystem
/// <summary>Identifier for multi-user PFS</summary>
const uint MUPFS_DISK = 0x6D755046;
const string FS_TYPE = "pfs";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Professional File System";
public string Name => Localization.PFS_Name;
/// <inheritdoc />
public Guid Id => new("68DE769E-D957-406A-8AE4-3781CA8CDA77");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -105,40 +107,43 @@ public sealed class PFS : IFilesystem
{
case AFS_DISK:
case MUAF_DISK:
sbInformation.Append("Professional File System v1");
XmlFsType.Type = "PFS v1";
sbInformation.Append(Localization.Professional_File_System_v1);
XmlFsType.Type = FS_TYPE;
break;
case PFS2_DISK:
sbInformation.Append("Professional File System v2");
XmlFsType.Type = "PFS v2";
sbInformation.Append(Localization.Professional_File_System_v2);
XmlFsType.Type = FS_TYPE;
break;
case PFS_DISK:
case MUPFS_DISK:
sbInformation.Append("Professional File System v3");
XmlFsType.Type = "PFS v3";
sbInformation.Append(Localization.Professional_File_System_v3);
XmlFsType.Type = FS_TYPE;
break;
}
if(rootBlock.diskType is MUAF_DISK or MUPFS_DISK)
sbInformation.Append(", with multi-user support");
sbInformation.Append(Localization.with_multi_user_support);
sbInformation.AppendLine();
sbInformation.AppendFormat("Volume name: {0}", StringHandlers.PascalToString(rootBlock.diskname, Encoding)).
AppendLine();
sbInformation.
AppendFormat(Localization.Volume_name_0, StringHandlers.PascalToString(rootBlock.diskname, Encoding)).
AppendLine();
sbInformation.AppendFormat("Volume has {0} free sectors of {1}", rootBlock.blocksfree, rootBlock.diskSize).
AppendLine();
sbInformation.
AppendFormat(Localization.Volume_has_0_free_sectors_of_1, rootBlock.blocksfree, rootBlock.diskSize).
AppendLine();
sbInformation.AppendFormat("Volume created on {0}",
sbInformation.AppendFormat(Localization.Volume_created_on_0,
DateHandlers.AmigaToDateTime(rootBlock.creationday, rootBlock.creationminute,
rootBlock.creationtick)).AppendLine();
if(rootBlock.extension > 0)
sbInformation.AppendFormat("Root block extension resides at block {0}", rootBlock.extension).AppendLine();
sbInformation.AppendFormat(Localization.Root_block_extension_resides_at_block_0, rootBlock.extension).
AppendLine();
information = sbInformation.ToString();

View File

@@ -89,11 +89,11 @@ public sealed class ProDOSPlugin : IFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Apple ProDOS filesystem";
public string Name => Localization.ProDOSPlugin_Name;
/// <inheritdoc />
public Guid Id => new("43874265-7B8A-4739-BCF7-07F80D5932BF");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -250,8 +250,8 @@ public sealed class ProDOSPlugin : IFilesystem
AaruConsole.DebugWriteLine("ProDOS plugin", "temp_timestamp = 0x{0:X8}", tempTimestamp);
AaruConsole.DebugWriteLine("ProDOS plugin",
"Datetime field year {0}, month {1}, day {2}, hour {3}, minute {4}.", year,
month, day, hour, minute);
Localization.Datetime_field_year_0_month_1_day_2_hour_3_minute_4, year, month,
day, hour, minute);
rootDirectoryKeyBlock.header.creation_time = new DateTime(year, month, day, hour, minute, 0);
dateCorrect = true;
@@ -272,64 +272,71 @@ public sealed class ProDOSPlugin : IFilesystem
rootDirectoryKeyBlock.header.total_blocks = BitConverter.ToUInt16(rootDirectoryKeyBlockBytes, 0x29);
if(apmFromHddOnCd)
sbInformation.AppendLine("ProDOS uses 512 bytes/sector while devices uses 2048 bytes/sector.").AppendLine();
sbInformation.AppendLine(Localization.ProDOS_uses_512_bytes_sector_while_devices_uses_2048_bytes_sector).
AppendLine();
if(rootDirectoryKeyBlock.header.version != VERSION1 ||
rootDirectoryKeyBlock.header.min_version != VERSION1)
{
sbInformation.AppendLine("Warning! Detected unknown ProDOS version ProDOS filesystem.");
sbInformation.AppendLine("All of the following information may be incorrect");
sbInformation.AppendLine(Localization.Warning_Detected_unknown_ProDOS_version_ProDOS_filesystem);
sbInformation.AppendLine(Localization.All_of_the_following_information_may_be_incorrect);
}
if(rootDirectoryKeyBlock.header.version == VERSION1)
sbInformation.AppendLine("ProDOS version 1 used to create this volume.");
sbInformation.AppendLine(Localization.ProDOS_version_one_used_to_create_this_volume);
else
sbInformation.AppendFormat("Unknown ProDOS version with field {0} used to create this volume.",
sbInformation.AppendFormat(Localization.Unknown_ProDOS_version_with_field_0_used_to_create_this_volume,
rootDirectoryKeyBlock.header.version).AppendLine();
if(rootDirectoryKeyBlock.header.min_version == VERSION1)
sbInformation.AppendLine("ProDOS version 1 at least required for reading this volume.");
sbInformation.AppendLine(Localization.ProDOS_version_one_at_least_required_for_reading_this_volume);
else
sbInformation.
AppendFormat("Unknown ProDOS version with field {0} is at least required for reading this volume.",
AppendFormat(Localization.Unknown_ProDOS_version_with_field_0_is_at_least_required_for_reading_this_volume,
rootDirectoryKeyBlock.header.min_version).AppendLine();
sbInformation.AppendFormat("Volume name is {0}", rootDirectoryKeyBlock.header.volume_name).AppendLine();
sbInformation.AppendFormat(Localization.Volume_name_is_0, rootDirectoryKeyBlock.header.volume_name).
AppendLine();
if(dateCorrect)
sbInformation.AppendFormat("Volume created on {0}", rootDirectoryKeyBlock.header.creation_time).
sbInformation.AppendFormat(Localization.Volume_created_on_0, rootDirectoryKeyBlock.header.creation_time).
AppendLine();
sbInformation.AppendFormat("{0} bytes per directory entry", rootDirectoryKeyBlock.header.entry_length).
sbInformation.
AppendFormat(Localization._0_bytes_per_directory_entry, rootDirectoryKeyBlock.header.entry_length).
AppendLine();
sbInformation.
AppendFormat(Localization._0_entries_per_directory_block, rootDirectoryKeyBlock.header.entries_per_block).
AppendLine();
sbInformation.AppendFormat(Localization._0_files_in_root_directory, rootDirectoryKeyBlock.header.file_count).
AppendLine();
sbInformation.AppendFormat("{0} entries per directory block", rootDirectoryKeyBlock.header.entries_per_block).
sbInformation.AppendFormat(Localization._0_blocks_in_volume, rootDirectoryKeyBlock.header.total_blocks).
AppendLine();
sbInformation.AppendFormat("{0} files in root directory", rootDirectoryKeyBlock.header.file_count).AppendLine();
sbInformation.AppendFormat("{0} blocks in volume", rootDirectoryKeyBlock.header.total_blocks).AppendLine();
sbInformation.AppendFormat("Bitmap starts at block {0}", rootDirectoryKeyBlock.header.bit_map_pointer).
sbInformation.AppendFormat(Localization.Bitmap_starts_at_block_0, rootDirectoryKeyBlock.header.bit_map_pointer).
AppendLine();
if((rootDirectoryKeyBlock.header.access & READ_ATTRIBUTE) == READ_ATTRIBUTE)
sbInformation.AppendLine("Volume can be read");
sbInformation.AppendLine(Localization.Volume_can_be_read);
if((rootDirectoryKeyBlock.header.access & WRITE_ATTRIBUTE) == WRITE_ATTRIBUTE)
sbInformation.AppendLine("Volume can be written");
sbInformation.AppendLine(Localization.Volume_can_be_written);
if((rootDirectoryKeyBlock.header.access & RENAME_ATTRIBUTE) == RENAME_ATTRIBUTE)
sbInformation.AppendLine("Volume can be renamed");
sbInformation.AppendLine(Localization.Volume_can_be_renamed);
if((rootDirectoryKeyBlock.header.access & DESTROY_ATTRIBUTE) == DESTROY_ATTRIBUTE)
sbInformation.AppendLine("Volume can be destroyed");
sbInformation.AppendLine(Localization.Volume_can_be_destroyed);
if((rootDirectoryKeyBlock.header.access & BACKUP_ATTRIBUTE) == BACKUP_ATTRIBUTE)
sbInformation.AppendLine("Volume must be backed up");
sbInformation.AppendLine(Localization.Volume_must_be_backed_up);
// TODO: Fix mask
if((rootDirectoryKeyBlock.header.access & RESERVED_ATTRIBUTE_MASK) != 0)
AaruConsole.DebugWriteLine("ProDOS plugin", "Reserved attributes are set: {0:X2}",
AaruConsole.DebugWriteLine("ProDOS plugin", Localization.Reserved_attributes_are_set_0,
rootDirectoryKeyBlock.header.access);
information = sbInformation.ToString();
@@ -340,7 +347,7 @@ public sealed class ProDOSPlugin : IFilesystem
Files = rootDirectoryKeyBlock.header.file_count,
FilesSpecified = true,
Clusters = rootDirectoryKeyBlock.header.total_blocks,
Type = "ProDOS"
Type = FS_TYPE
};
XmlFsType.ClusterSize = (uint)((partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize /
@@ -353,6 +360,8 @@ public sealed class ProDOSPlugin : IFilesystem
XmlFsType.CreationDateSpecified = true;
}
const string FS_TYPE = "prodos";
/// <summary>ProDOS directory entry, decoded structure</summary>
[SuppressMessage("ReSharper", "InconsistentNaming")]
struct Entry

View File

@@ -59,11 +59,11 @@ public sealed class QNX4 : IFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "QNX4 Plugin";
public string Name => Localization.QNX4_Name;
/// <inheritdoc />
public Guid Id => new("E73A63FA-B5B0-48BF-BF82-DA5F0A8170D2");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -196,11 +196,13 @@ public sealed class QNX4 : IFilesystem
AaruConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_status = {0}", qnxSb.altBoot.di_status);
*/
information = $"QNX4 filesystem\nCreated on {DateHandlers.UnixUnsignedToDateTime(qnxSb.rootDir.di_ftime)}\n";
information = Localization.QNX4_filesystem + "\n" +
string.Format(Localization.Created_on_0,
DateHandlers.UnixUnsignedToDateTime(qnxSb.rootDir.di_ftime)) + "\n";
XmlFsType = new FileSystemType
{
Type = "QNX4 filesystem",
Type = FS_TYPE,
Clusters = partition.Length,
ClusterSize = 512,
CreationDate = DateHandlers.UnixUnsignedToDateTime(qnxSb.rootDir.di_ftime),
@@ -212,6 +214,8 @@ public sealed class QNX4 : IFilesystem
XmlFsType.Bootable |= qnxSb.boot.di_size != 0 || qnxSb.altBoot.di_size != 0;
}
const string FS_TYPE = "qnx4";
struct Extent
{
public uint Block;

View File

@@ -50,16 +50,18 @@ public sealed class QNX6 : IFilesystem
const uint QNX6_BOOT_BLOCKS_SIZE = 0x2000;
const uint QNX6_MAGIC = 0x68191122;
const string FS_TYPE = "qnx6";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "QNX6 Plugin";
public string Name => Localization.QNX6_Name;
/// <inheritdoc />
public Guid Id => new("3E610EA2-4D08-4D70-8947-830CD4C74FC0");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -120,19 +122,19 @@ public sealed class QNX6 : IFilesystem
if(audi)
{
sb.AppendLine("QNX6 (Audi) filesystem");
sb.AppendFormat("Checksum: 0x{0:X8}", audiSb.checksum).AppendLine();
sb.AppendFormat("Serial: 0x{0:X16}", audiSb.checksum).AppendLine();
sb.AppendFormat("{0} bytes per block", audiSb.blockSize).AppendLine();
sb.AppendFormat("{0} inodes free of {1}", audiSb.freeInodes, audiSb.numInodes).AppendLine();
sb.AppendLine(Localization.QNX6_Audi_filesystem);
sb.AppendFormat(Localization.Checksum_0_X8, audiSb.checksum).AppendLine();
sb.AppendFormat(Localization.Serial_0_X16, audiSb.checksum).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_block, audiSb.blockSize).AppendLine();
sb.AppendFormat(Localization._0_inodes_free_of_1, audiSb.freeInodes, audiSb.numInodes).AppendLine();
sb.AppendFormat("{0} blocks ({1} bytes) free of {2} ({3} bytes)", audiSb.freeBlocks,
sb.AppendFormat(Localization._0_blocks_1_bytes_free_of_2_3_bytes, audiSb.freeBlocks,
audiSb.freeBlocks * audiSb.blockSize, audiSb.numBlocks,
audiSb.numBlocks * audiSb.blockSize).AppendLine();
XmlFsType = new FileSystemType
{
Type = "QNX6 (Audi) filesystem",
Type = FS_TYPE,
Clusters = audiSb.numBlocks,
ClusterSize = audiSb.blockSize,
Bootable = true,
@@ -150,26 +152,26 @@ public sealed class QNX6 : IFilesystem
return;
}
sb.AppendLine("QNX6 filesystem");
sb.AppendFormat("Checksum: 0x{0:X8}", qnxSb.checksum).AppendLine();
sb.AppendFormat("Serial: 0x{0:X16}", qnxSb.checksum).AppendLine();
sb.AppendFormat("Created on {0}", DateHandlers.UnixUnsignedToDateTime(qnxSb.ctime)).AppendLine();
sb.AppendFormat("Last mounted on {0}", DateHandlers.UnixUnsignedToDateTime(qnxSb.atime)).AppendLine();
sb.AppendFormat("Flags: 0x{0:X8}", qnxSb.flags).AppendLine();
sb.AppendFormat("Version1: 0x{0:X4}", qnxSb.version1).AppendLine();
sb.AppendFormat("Version2: 0x{0:X4}", qnxSb.version2).AppendLine();
sb.AppendLine(Localization.QNX6_filesystem);
sb.AppendFormat(Localization.Checksum_0_X8, qnxSb.checksum).AppendLine();
sb.AppendFormat(Localization.Serial_0_X16, qnxSb.checksum).AppendLine();
sb.AppendFormat(Localization.Created_on_0, DateHandlers.UnixUnsignedToDateTime(qnxSb.ctime)).AppendLine();
sb.AppendFormat(Localization.Last_mounted_on_0, DateHandlers.UnixUnsignedToDateTime(qnxSb.atime)).AppendLine();
sb.AppendFormat(Localization.Flags_0_X8, qnxSb.flags).AppendLine();
sb.AppendFormat(Localization.Version1_0_X4, qnxSb.version1).AppendLine();
sb.AppendFormat(Localization.Version2_0_X4, qnxSb.version2).AppendLine();
//sb.AppendFormat("Volume ID: \"{0}\"", CurrentEncoding.GetString(qnxSb.volumeid)).AppendLine();
sb.AppendFormat("{0} bytes per block", qnxSb.blockSize).AppendLine();
sb.AppendFormat("{0} inodes free of {1}", qnxSb.freeInodes, qnxSb.numInodes).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_block, qnxSb.blockSize).AppendLine();
sb.AppendFormat(Localization._0_inodes_free_of_1, qnxSb.freeInodes, qnxSb.numInodes).AppendLine();
sb.AppendFormat("{0} blocks ({1} bytes) free of {2} ({3} bytes)", qnxSb.freeBlocks,
sb.AppendFormat(Localization._0_blocks_1_bytes_free_of_2_3_bytes, qnxSb.freeBlocks,
qnxSb.freeBlocks * qnxSb.blockSize, qnxSb.numBlocks, qnxSb.numBlocks * qnxSb.blockSize).
AppendLine();
XmlFsType = new FileSystemType
{
Type = "QNX6 filesystem",
Type = FS_TYPE,
Clusters = qnxSb.numBlocks,
ClusterSize = qnxSb.blockSize,
Bootable = true,

View File

@@ -51,16 +51,18 @@ public sealed class RBF : IFilesystem
const uint RBF_SYNC = 0x4372757A;
const uint RBF_CNYS = 0x7A757243;
const string FS_TYPE = "rbf";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "OS-9 Random Block File Plugin";
public string Name => Localization.RBF_Name;
/// <inheritdoc />
public Guid Id => new("E864E45B-0B52-4D29-A858-7BDFA9199FB2");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -97,8 +99,7 @@ public sealed class RBF : IFilesystem
IdSector rbfSb = Marshal.ByteArrayToStructureBigEndian<IdSector>(sector);
NewIdSector rbf9000Sb = Marshal.ByteArrayToStructureBigEndian<NewIdSector>(sector);
AaruConsole.DebugWriteLine("RBF plugin",
"magic at {0} = 0x{1:X8} or 0x{2:X8} (expected 0x{3:X8} or 0x{4:X8})", location,
AaruConsole.DebugWriteLine("RBF plugin", Localization.magic_at_0_equals_1_or_2_expected_3_or_4, location,
rbfSb.dd_sync, rbf9000Sb.rid_sync, RBF_SYNC, RBF_CNYS);
if(rbfSb.dd_sync == RBF_SYNC ||
@@ -143,8 +144,7 @@ public sealed class RBF : IFilesystem
rbfSb = Marshal.ByteArrayToStructureBigEndian<IdSector>(sector);
rbf9000Sb = Marshal.ByteArrayToStructureBigEndian<NewIdSector>(sector);
AaruConsole.DebugWriteLine("RBF plugin",
"magic at {0} = 0x{1:X8} or 0x{2:X8} (expected 0x{3:X8} or 0x{4:X8})", location,
AaruConsole.DebugWriteLine("RBF plugin", Localization.magic_at_0_equals_1_or_2_expected_3_or_4, location,
rbfSb.dd_sync, rbf9000Sb.rid_sync, RBF_SYNC, RBF_CNYS);
if(rbfSb.dd_sync == RBF_SYNC ||
@@ -162,56 +162,63 @@ public sealed class RBF : IFilesystem
var sb = new StringBuilder();
sb.AppendLine("OS-9 Random Block File");
sb.AppendLine(Localization.OS_9_Random_Block_File);
if(rbf9000Sb.rid_sync == RBF_SYNC)
{
sb.AppendFormat("Volume ID: {0:X8}", rbf9000Sb.rid_diskid).AppendLine();
sb.AppendFormat("{0} blocks in volume", rbf9000Sb.rid_totblocks).AppendLine();
sb.AppendFormat("{0} cylinders", rbf9000Sb.rid_cylinders).AppendLine();
sb.AppendFormat("{0} blocks in cylinder 0", rbf9000Sb.rid_cyl0size).AppendLine();
sb.AppendFormat("{0} blocks per cylinder", rbf9000Sb.rid_cylsize).AppendLine();
sb.AppendFormat("{0} heads", rbf9000Sb.rid_heads).AppendLine();
sb.AppendFormat("{0} bytes per block", rbf9000Sb.rid_blocksize).AppendLine();
sb.AppendFormat(Localization.Volume_ID_0_X8, rbf9000Sb.rid_diskid).AppendLine();
sb.AppendFormat(Localization._0_blocks_in_volume, rbf9000Sb.rid_totblocks).AppendLine();
sb.AppendFormat(Localization._0_cylinders, rbf9000Sb.rid_cylinders).AppendLine();
sb.AppendFormat(Localization._0_blocks_in_cylinder_zero, rbf9000Sb.rid_cyl0size).AppendLine();
sb.AppendFormat(Localization._0_blocks_per_cylinder, rbf9000Sb.rid_cylsize).AppendLine();
sb.AppendFormat(Localization._0_heads, rbf9000Sb.rid_heads).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_block, rbf9000Sb.rid_blocksize).AppendLine();
// TODO: Convert to flags?
sb.AppendLine((rbf9000Sb.rid_format & 0x01) == 0x01 ? "Disk is double sided" : "Disk is single sided");
sb.AppendLine((rbf9000Sb.rid_format & 0x01) == 0x01 ? Localization.Disk_is_double_sided
: Localization.Disk_is_single_sided);
sb.AppendLine((rbf9000Sb.rid_format & 0x02) == 0x02 ? "Disk is double density" : "Disk is single density");
sb.AppendLine((rbf9000Sb.rid_format & 0x02) == 0x02 ? Localization.Disk_is_double_density
: Localization.Disk_is_single_density);
if((rbf9000Sb.rid_format & 0x10) == 0x10)
sb.AppendLine("Disk is 384 TPI");
sb.AppendLine(Localization.Disk_is_384_TPI);
else if((rbf9000Sb.rid_format & 0x08) == 0x08)
sb.AppendLine("Disk is 192 TPI");
sb.AppendLine(Localization.Disk_is_192_TPI);
else if((rbf9000Sb.rid_format & 0x04) == 0x04)
sb.AppendLine("Disk is 96 TPI or 135 TPI");
sb.AppendLine(Localization.Disk_is_96_TPI_or_135_TPI);
else
sb.AppendLine("Disk is 48 TPI");
sb.AppendLine(Localization.Disk_is_48_TPI);
sb.AppendFormat("Allocation bitmap descriptor starts at block {0}",
sb.AppendFormat(Localization.Allocation_bitmap_descriptor_starts_at_block_0,
rbf9000Sb.rid_bitmap == 0 ? 1 : rbf9000Sb.rid_bitmap).AppendLine();
if(rbf9000Sb.rid_firstboot > 0)
sb.AppendFormat("Debugger descriptor starts at block {0}", rbf9000Sb.rid_firstboot).AppendLine();
sb.AppendFormat(Localization.Debugger_descriptor_starts_at_block_0, rbf9000Sb.rid_firstboot).
AppendLine();
if(rbf9000Sb.rid_bootfile > 0)
sb.AppendFormat("Boot file descriptor starts at block {0}", rbf9000Sb.rid_bootfile).AppendLine();
sb.AppendFormat(Localization.Boot_file_descriptor_starts_at_block_0, rbf9000Sb.rid_bootfile).
AppendLine();
sb.AppendFormat("Root directory descriptor starts at block {0}", rbf9000Sb.rid_rootdir).AppendLine();
sb.AppendFormat("Disk is owned by group {0} user {1}", rbf9000Sb.rid_group, rbf9000Sb.rid_owner).
sb.AppendFormat(Localization.Root_directory_descriptor_starts_at_block_0, rbf9000Sb.rid_rootdir).
AppendLine();
sb.AppendFormat("Volume was created on {0}", DateHandlers.UnixToDateTime(rbf9000Sb.rid_ctime)).AppendLine();
sb.AppendFormat(Localization.Disk_is_owned_by_group_0_user_1, rbf9000Sb.rid_group, rbf9000Sb.rid_owner).
AppendLine();
sb.AppendFormat("Volume's identification block was last written on {0}",
sb.AppendFormat(Localization.Volume_was_created_on_0, DateHandlers.UnixToDateTime(rbf9000Sb.rid_ctime)).
AppendLine();
sb.AppendFormat(Localization.Volume_identification_block_was_last_written_on_0,
DateHandlers.UnixToDateTime(rbf9000Sb.rid_mtime)).AppendLine();
sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(rbf9000Sb.rid_name, Encoding)).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(rbf9000Sb.rid_name, Encoding)).
AppendLine();
XmlFsType = new FileSystemType
{
Type = "OS-9 Random Block File",
Type = FS_TYPE,
Bootable = rbf9000Sb.rid_bootfile > 0,
ClusterSize = rbf9000Sb.rid_blocksize,
Clusters = rbf9000Sb.rid_totblocks,
@@ -225,51 +232,58 @@ public sealed class RBF : IFilesystem
}
else
{
sb.AppendFormat("Volume ID: {0:X4}", rbfSb.dd_dsk).AppendLine();
sb.AppendFormat("{0} blocks in volume", LSNToUInt32(rbfSb.dd_tot)).AppendLine();
sb.AppendFormat("{0} tracks", rbfSb.dd_tks).AppendLine();
sb.AppendFormat("{0} sectors per track", rbfSb.dd_spt).AppendLine();
sb.AppendFormat("{0} bytes per sector", 256 << rbfSb.dd_lsnsize).AppendLine();
sb.AppendFormat(Localization.Volume_ID_0_X4, rbfSb.dd_dsk).AppendLine();
sb.AppendFormat(Localization._0_blocks_in_volume, LSNToUInt32(rbfSb.dd_tot)).AppendLine();
sb.AppendFormat(Localization._0_tracks, rbfSb.dd_tks).AppendLine();
sb.AppendFormat(Localization._0_sectors_per_track, rbfSb.dd_spt).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_sector, 256 << rbfSb.dd_lsnsize).AppendLine();
sb.AppendFormat("{0} sectors per cluster ({1} bytes)", rbfSb.dd_bit,
sb.AppendFormat(Localization._0_sectors_per_cluster_1_bytes, rbfSb.dd_bit,
rbfSb.dd_bit * (256 << rbfSb.dd_lsnsize)).AppendLine();
// TODO: Convert to flags?
sb.AppendLine((rbfSb.dd_fmt & 0x01) == 0x01 ? "Disk is double sided" : "Disk is single sided");
sb.AppendLine((rbfSb.dd_fmt & 0x02) == 0x02 ? "Disk is double density" : "Disk is single density");
sb.AppendLine((rbfSb.dd_fmt & 0x01) == 0x01 ? Localization.Disk_is_double_sided
: Localization.Disk_is_single_sided);
sb.AppendLine((rbfSb.dd_fmt & 0x02) == 0x02 ? Localization.Disk_is_double_density
: Localization.Disk_is_single_density);
if((rbfSb.dd_fmt & 0x10) == 0x10)
sb.AppendLine("Disk is 384 TPI");
sb.AppendLine(Localization.Disk_is_384_TPI);
else if((rbfSb.dd_fmt & 0x08) == 0x08)
sb.AppendLine("Disk is 192 TPI");
sb.AppendLine(Localization.Disk_is_192_TPI);
else if((rbfSb.dd_fmt & 0x04) == 0x04)
sb.AppendLine("Disk is 96 TPI or 135 TPI");
sb.AppendLine(Localization.Disk_is_96_TPI_or_135_TPI);
else
sb.AppendLine("Disk is 48 TPI");
sb.AppendLine(Localization.Disk_is_48_TPI);
sb.AppendFormat("Allocation bitmap descriptor starts at block {0}",
sb.AppendFormat(Localization.Allocation_bitmap_descriptor_starts_at_block_0,
rbfSb.dd_maplsn == 0 ? 1 : rbfSb.dd_maplsn).AppendLine();
sb.AppendFormat("{0} bytes in allocation bitmap", rbfSb.dd_map).AppendLine();
sb.AppendFormat(Localization._0_bytes_in_allocation_bitmap, rbfSb.dd_map).AppendLine();
if(LSNToUInt32(rbfSb.dd_bt) > 0 &&
rbfSb.dd_bsz > 0)
sb.AppendFormat("Boot file starts at block {0} and has {1} bytes", LSNToUInt32(rbfSb.dd_bt),
sb.AppendFormat(Localization.Boot_file_starts_at_block_0_and_has_1_bytes, LSNToUInt32(rbfSb.dd_bt),
rbfSb.dd_bsz).AppendLine();
sb.AppendFormat("Root directory descriptor starts at block {0}", LSNToUInt32(rbfSb.dd_dir)).AppendLine();
sb.AppendFormat(Localization.Root_directory_descriptor_starts_at_block_0, LSNToUInt32(rbfSb.dd_dir)).
AppendLine();
sb.AppendFormat("Disk is owned by user {0}", rbfSb.dd_own).AppendLine();
sb.AppendFormat("Volume was created on {0}", DateHandlers.Os9ToDateTime(rbfSb.dd_dat)).AppendLine();
sb.AppendFormat("Volume attributes: {0:X2}", rbfSb.dd_att).AppendLine();
sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(rbfSb.dd_nam, Encoding)).AppendLine();
sb.AppendFormat(Localization.Disk_is_owned_by_user_0, rbfSb.dd_own).AppendLine();
sb.AppendFormat("Path descriptor options: {0}", StringHandlers.CToString(rbfSb.dd_opt, Encoding)).
sb.AppendFormat(Localization.Volume_was_created_on_0, DateHandlers.Os9ToDateTime(rbfSb.dd_dat)).
AppendLine();
sb.AppendFormat(Localization.Volume_attributes_0, rbfSb.dd_att).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(rbfSb.dd_nam, Encoding)).AppendLine();
sb.AppendFormat(Localization.Path_descriptor_options_0, StringHandlers.CToString(rbfSb.dd_opt, Encoding)).
AppendLine();
XmlFsType = new FileSystemType
{
Type = "OS-9 Random Block File",
Type = FS_TYPE,
Bootable = LSNToUInt32(rbfSb.dd_bt) > 0 && rbfSb.dd_bsz > 0,
ClusterSize = (uint)(rbfSb.dd_bit * (256 << rbfSb.dd_lsnsize)),
Clusters = LSNToUInt32(rbfSb.dd_tot),

View File

@@ -49,16 +49,17 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of the DEC RT-11 filesystem</summary>
public sealed class RT11 : IFilesystem
{
const string FS_TYPE = "rt11";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "RT-11 file system";
public string Name => Localization.RT11_Name;
/// <inheritdoc />
public Guid Id => new("DB3E2F98-8F98-463C-8126-E937843DA024");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -110,21 +111,22 @@ public sealed class RT11 : IFilesystem
for(int i = 0; i < 512; i += 2)
check += BitConverter.ToUInt16(hbSector, i);
sb.AppendFormat("Volume format is {0}", StringHandlers.SpacePaddedToString(homeblock.format, Encoding.ASCII)).
sb.AppendFormat(Localization.Volume_format_is_0,
StringHandlers.SpacePaddedToString(homeblock.format, Encoding.ASCII)).AppendLine();
sb.AppendFormat(Localization._0_sectors_per_cluster_1_bytes, homeblock.cluster, homeblock.cluster * 512).
AppendLine();
sb.AppendFormat("{0} sectors per cluster ({1} bytes)", homeblock.cluster, homeblock.cluster * 512).AppendLine();
sb.AppendFormat("First directory segment starts at block {0}", homeblock.rootBlock).AppendLine();
sb.AppendFormat("Volume owner is \"{0}\"", Encoding.GetString(homeblock.ownername).TrimEnd()).AppendLine();
sb.AppendFormat("Volume label: \"{0}\"", Encoding.GetString(homeblock.volname).TrimEnd()).AppendLine();
sb.AppendFormat("Checksum: 0x{0:X4} (calculated 0x{1:X4})", homeblock.checksum, check).AppendLine();
sb.AppendFormat(Localization.First_directory_segment_starts_at_block_0, homeblock.rootBlock).AppendLine();
sb.AppendFormat(Localization.Volume_owner_is_0, Encoding.GetString(homeblock.ownername).TrimEnd()).AppendLine();
sb.AppendFormat(Localization.Volume_label_0, Encoding.GetString(homeblock.volname).TrimEnd()).AppendLine();
sb.AppendFormat(Localization.Checksum_0_calculated_1, homeblock.checksum, check).AppendLine();
imagePlugin.ReadSector(0, out byte[] bootBlock);
XmlFsType = new FileSystemType
{
Type = "RT-11",
Type = FS_TYPE,
ClusterSize = (uint)(homeblock.cluster * 512),
Clusters = homeblock.cluster,
VolumeName = StringHandlers.SpacePaddedToString(homeblock.volname, Encoding),

View File

@@ -49,12 +49,14 @@ namespace Aaru.Filesystems;
public sealed class ReFS : IFilesystem
{
const uint FSRS = 0x53525346;
const string FS_TYPE = "refs";
readonly byte[] _signature =
{
0x52, 0x65, 0x46, 0x53, 0x00, 0x00, 0x00, 0x00
};
/// <inheritdoc />
public string Name => "Resilient File System plugin";
public string Name => Localization.ReFS_Name;
/// <inheritdoc />
public Guid Id => new("37766C4E-EBF5-4113-A712-B758B756ABD6");
/// <inheritdoc />
@@ -62,7 +64,7 @@ public sealed class ReFS : IFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -147,20 +149,20 @@ public sealed class ReFS : IFilesystem
var sb = new StringBuilder();
sb.AppendLine("Microsoft Resilient File System");
sb.AppendFormat("Volume uses {0} bytes per sector", vhdr.bytesPerSector).AppendLine();
sb.AppendLine(Localization.Microsoft_Resilient_File_System);
sb.AppendFormat(Localization.Volume_uses_0_bytes_per_sector, vhdr.bytesPerSector).AppendLine();
sb.AppendFormat("Volume uses {0} sectors per cluster ({1} bytes)", vhdr.sectorsPerCluster,
sb.AppendFormat(Localization.Volume_uses_0_sectors_per_cluster_1_bytes, vhdr.sectorsPerCluster,
vhdr.sectorsPerCluster * vhdr.bytesPerSector).AppendLine();
sb.AppendFormat("Volume has {0} sectors ({1} bytes)", vhdr.sectors, vhdr.sectors * vhdr.bytesPerSector).
sb.AppendFormat(Localization.Volume_has_0_sectors_1_bytes, vhdr.sectors, vhdr.sectors * vhdr.bytesPerSector).
AppendLine();
information = sb.ToString();
XmlFsType = new FileSystemType
{
Type = "Resilient File System",
Type = FS_TYPE,
ClusterSize = vhdr.bytesPerSector * vhdr.sectorsPerCluster,
Clusters = vhdr.sectors / vhdr.sectorsPerCluster
};

View File

@@ -49,6 +49,8 @@ public sealed class Reiser : IFilesystem
{
const uint REISER_SUPER_OFFSET = 0x10000;
const string FS_TYPE = "reiserfs";
readonly byte[] _magic35 =
{
0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x46, 0x73, 0x00, 0x00
@@ -67,11 +69,11 @@ public sealed class Reiser : IFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Reiser Filesystem Plugin";
public string Name => Localization.Reiser_Name;
/// <inheritdoc />
public Guid Id => new("1D8CD8B8-27E6-410F-9973-D16409225FBA");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -143,46 +145,41 @@ public sealed class Reiser : IFilesystem
var sb = new StringBuilder();
if(_magic35.SequenceEqual(reiserSb.magic))
sb.AppendLine("Reiser 3.5 filesystem");
sb.AppendLine(Localization.Reiser_3_5_filesystem);
else if(_magic36.SequenceEqual(reiserSb.magic))
sb.AppendLine("Reiser 3.6 filesystem");
sb.AppendLine(Localization.Reiser_3_6_filesystem);
else if(_magicJr.SequenceEqual(reiserSb.magic))
sb.AppendLine("Reiser Jr. filesystem");
sb.AppendLine(Localization.Reiser_Jr_filesystem);
sb.AppendFormat("Volume has {0} blocks with {1} blocks free", reiserSb.block_count, reiserSb.free_blocks).
AppendLine();
sb.AppendFormat(Localization.Volume_has_0_blocks_with_1_blocks_free, reiserSb.block_count,
reiserSb.free_blocks).AppendLine();
sb.AppendFormat("{0} bytes per block", reiserSb.blocksize).AppendLine();
sb.AppendFormat("Root directory resides on block {0}", reiserSb.root_block).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_block, reiserSb.blocksize).AppendLine();
sb.AppendFormat(Localization.Root_directory_resides_on_block_0, reiserSb.root_block).AppendLine();
if(reiserSb.umount_state == 2)
sb.AppendLine("Volume has not been cleanly umounted");
sb.AppendLine(Localization.Volume_has_not_been_cleanly_umounted);
sb.AppendFormat("Volume last checked on {0}", DateHandlers.UnixUnsignedToDateTime(reiserSb.last_check)).
AppendLine();
sb.AppendFormat(Localization.Volume_last_checked_on_0,
DateHandlers.UnixUnsignedToDateTime(reiserSb.last_check)).AppendLine();
if(reiserSb.version >= 2)
{
sb.AppendFormat("Volume UUID: {0}", reiserSb.uuid).AppendLine();
sb.AppendFormat("Volume name: {0}", Encoding.GetString(reiserSb.label)).AppendLine();
sb.AppendFormat(Localization.Volume_UUID_0, reiserSb.uuid).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, Encoding.GetString(reiserSb.label)).AppendLine();
}
information = sb.ToString();
XmlFsType = new FileSystemType();
if(_magic35.SequenceEqual(reiserSb.magic))
XmlFsType.Type = "Reiser 3.5 filesystem";
else if(_magic36.SequenceEqual(reiserSb.magic))
XmlFsType.Type = "Reiser 3.6 filesystem";
else if(_magicJr.SequenceEqual(reiserSb.magic))
XmlFsType.Type = "Reiser Jr. filesystem";
XmlFsType.ClusterSize = reiserSb.blocksize;
XmlFsType.Clusters = reiserSb.block_count;
XmlFsType.FreeClusters = reiserSb.free_blocks;
XmlFsType.FreeClustersSpecified = true;
XmlFsType.Dirty = reiserSb.umount_state == 2;
XmlFsType = new FileSystemType
{
Type = FS_TYPE,
ClusterSize = reiserSb.blocksize,
Clusters = reiserSb.block_count,
FreeClusters = reiserSb.free_blocks,
FreeClustersSpecified = true,
Dirty = reiserSb.umount_state == 2
};
if(reiserSb.version < 2)
return;

View File

@@ -49,6 +49,8 @@ public sealed class Reiser4 : IFilesystem
{
const uint REISER4_SUPER_OFFSET = 0x10000;
const string FS_TYPE = "reiser4";
readonly byte[] _magic =
{
0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
@@ -59,11 +61,11 @@ public sealed class Reiser4 : IFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Reiser4 Filesystem Plugin";
public string Name => Localization.Reiser4_Name;
/// <inheritdoc />
public Guid Id => new("301F2D00-E8D5-4F04-934E-81DFB21D15BA");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -131,17 +133,17 @@ public sealed class Reiser4 : IFilesystem
var sb = new StringBuilder();
sb.AppendLine("Reiser 4 filesystem");
sb.AppendFormat("{0} bytes per block", reiserSb.blocksize).AppendLine();
sb.AppendFormat("Volume disk format: {0}", reiserSb.diskformat).AppendLine();
sb.AppendFormat("Volume UUID: {0}", reiserSb.uuid).AppendLine();
sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(reiserSb.label, Encoding)).AppendLine();
sb.AppendLine(Localization.Reiser_4_filesystem);
sb.AppendFormat(Localization._0_bytes_per_block, reiserSb.blocksize).AppendLine();
sb.AppendFormat(Localization.Volume_disk_format_0, reiserSb.diskformat).AppendLine();
sb.AppendFormat(Localization.Volume_UUID_0, reiserSb.uuid).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(reiserSb.label, Encoding)).AppendLine();
information = sb.ToString();
XmlFsType = new FileSystemType
{
Type = "Reiser 4 filesystem",
Type = FS_TYPE,
ClusterSize = reiserSb.blocksize,
Clusters = (partition.End - partition.Start) * imagePlugin.Info.SectorSize / reiserSb.blocksize,
VolumeName = StringHandlers.CToString(reiserSb.label, Encoding),

View File

@@ -51,16 +51,18 @@ public sealed class SFS : IFilesystem
/// <summary>Identifier for SFS v2</summary>
const uint SFS2_MAGIC = 0x53465302;
const string FS_TYPE = "sfs";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "SmartFileSystem";
public string Name => Localization.SFS_Name;
/// <inheritdoc />
public Guid Id => new("26550C19-3671-4A2D-BC2F-F20CEB7F48DC");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -92,39 +94,40 @@ public sealed class SFS : IFilesystem
var sbInformation = new StringBuilder();
sbInformation.AppendLine("SmartFileSystem");
sbInformation.AppendLine(Localization.SmartFileSystem);
sbInformation.AppendFormat("Volume version {0}", rootBlock.version).AppendLine();
sbInformation.AppendFormat(Localization.Volume_version_0, rootBlock.version).AppendLine();
sbInformation.AppendFormat("Volume starts on device byte {0} and ends on byte {1}", rootBlock.firstbyte,
sbInformation.AppendFormat(Localization.Volume_starts_on_device_byte_0_and_ends_on_byte_1, rootBlock.firstbyte,
rootBlock.lastbyte).AppendLine();
sbInformation.
AppendFormat("Volume has {0} blocks of {1} bytes each", rootBlock.totalblocks, rootBlock.blocksize).
AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_blocks_of_1_bytes_each, rootBlock.totalblocks,
rootBlock.blocksize).AppendLine();
sbInformation.AppendFormat("Volume created on {0}",
sbInformation.AppendFormat(Localization.Volume_created_on_0,
DateHandlers.UnixUnsignedToDateTime(rootBlock.datecreated).AddYears(8)).AppendLine();
sbInformation.AppendFormat("Bitmap starts in block {0}", rootBlock.bitmapbase).AppendLine();
sbInformation.AppendFormat(Localization.Bitmap_starts_in_block_0, rootBlock.bitmapbase).AppendLine();
sbInformation.AppendFormat("Admin space container starts in block {0}", rootBlock.adminspacecontainer).
sbInformation.AppendFormat(Localization.Admin_space_container_starts_in_block_0, rootBlock.adminspacecontainer).
AppendLine();
sbInformation.AppendFormat("Root object container starts in block {0}", rootBlock.rootobjectcontainer).
sbInformation.AppendFormat(Localization.Root_object_container_starts_in_block_0, rootBlock.rootobjectcontainer).
AppendLine();
sbInformation.AppendFormat("Root node of the extent B-tree resides in block {0}", rootBlock.extentbnoderoot).
AppendLine();
sbInformation.
AppendFormat(Localization.Root_node_of_the_extent_B_tree_resides_in_block_0, rootBlock.extentbnoderoot).
AppendLine();
sbInformation.AppendFormat("Root node of the object B-tree resides in block {0}", rootBlock.objectnoderoot).
AppendLine();
sbInformation.
AppendFormat(Localization.Root_node_of_the_object_B_tree_resides_in_block_0, rootBlock.objectnoderoot).
AppendLine();
if(rootBlock.bits.HasFlag(Flags.CaseSensitive))
sbInformation.AppendLine("Volume is case sensitive");
sbInformation.AppendLine(Localization.Volume_is_case_sensitive);
if(rootBlock.bits.HasFlag(Flags.RecycledFolder))
sbInformation.AppendLine("Volume moves deleted files to a recycled folder");
sbInformation.AppendLine(Localization.Volume_moves_deleted_files_to_a_recycled_folder);
information = sbInformation.ToString();
@@ -134,7 +137,7 @@ public sealed class SFS : IFilesystem
CreationDateSpecified = true,
Clusters = rootBlock.totalblocks,
ClusterSize = rootBlock.blocksize,
Type = "SmartFileSystem"
Type = FS_TYPE
};
}

View File

@@ -47,16 +47,17 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of the Solar OS filesystem</summary>
public sealed class SolarFS : IFilesystem
{
const string FS_TYPE = "solarfs";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Solar_OS filesystem";
public string Name => Localization.SolarFS_Name;
/// <inheritdoc />
public Guid Id => new("EA3101C1-E777-4B4F-B5A3-8C57F50F6E65");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -144,35 +145,35 @@ public sealed class SolarFS : IFilesystem
AaruConsole.DebugWriteLine("SolarFS plugin", "BPB.vol_name: \"{0}\"", bpb.vol_name);
AaruConsole.DebugWriteLine("SolarFS plugin", "BPB.fs_type: \"{0}\"", bpb.fs_type);
sb.AppendLine("Solar_OS filesystem");
sb.AppendFormat("Media descriptor: 0x{0:X2}", bpb.media).AppendLine();
sb.AppendFormat("{0} bytes per sector", bpb.bps).AppendLine();
sb.AppendLine(Localization.Solar_OS_filesystem);
sb.AppendFormat(Localization.Media_descriptor_0, bpb.media).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_sector, bpb.bps).AppendLine();
if(imagePlugin.Info.SectorSize is 2336 or 2352 or 2448)
{
if(bpb.bps != imagePlugin.Info.SectorSize)
sb.
AppendFormat("WARNING: Filesystem describes a {0} bytes/sector, while device describes a {1} bytes/sector",
AppendFormat(Localization.WARNING_Filesystem_describes_a_0_bytes_sector_while_device_describes_a_1_bytes_sector,
bpb.bps, 2048).AppendLine();
}
else if(bpb.bps != imagePlugin.Info.SectorSize)
sb.
AppendFormat("WARNING: Filesystem describes a {0} bytes/sector, while device describes a {1} bytes/sector",
AppendFormat(Localization.WARNING_Filesystem_describes_a_0_bytes_sector_while_device_describes_a_1_bytes_sector,
bpb.bps, imagePlugin.Info.SectorSize).AppendLine();
sb.AppendFormat("{0} sectors on volume ({1} bytes)", bpb.sectors, bpb.sectors * bpb.bps).AppendLine();
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, bpb.sectors, bpb.sectors * bpb.bps).AppendLine();
if(bpb.sectors > imagePlugin.Info.Sectors)
sb.AppendFormat("WARNING: Filesystem describes a {0} sectors volume, bigger than device ({1} sectors)",
sb.AppendFormat(Localization.WARNING_Filesystem_describes_a_0_sectors_volume_bigger_than_device_1_sectors,
bpb.sectors, imagePlugin.Info.Sectors);
sb.AppendFormat("{0} heads", bpb.heads).AppendLine();
sb.AppendFormat("{0} sectors per track", bpb.sptrk).AppendLine();
sb.AppendFormat("Volume name: {0}", bpb.vol_name).AppendLine();
sb.AppendFormat(Localization._0_heads, bpb.heads).AppendLine();
sb.AppendFormat(Localization._0_sectors_per_track, bpb.sptrk).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, bpb.vol_name).AppendLine();
XmlFsType = new FileSystemType
{
Type = "SolarFS",
Type = FS_TYPE,
Clusters = bpb.sectors,
ClusterSize = bpb.bps,
VolumeName = bpb.vol_name

View File

@@ -50,16 +50,18 @@ public sealed class Squash : IFilesystem
const uint SQUASH_MAGIC = 0x73717368;
const uint SQUASH_CIGAM = 0x68737173;
const string FS_TYPE = "squashfs";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Squash filesystem";
public string Name => Localization.Squash_Name;
/// <inheritdoc />
public Guid Id => new("F8F6E46F-7A2A-48E3-9C0A-46AF4DC29E09");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -107,46 +109,48 @@ public sealed class Squash : IFilesystem
var sbInformation = new StringBuilder();
sbInformation.AppendLine("Squash file system");
sbInformation.AppendLine(littleEndian ? "Little-endian" : "Big-endian");
sbInformation.AppendFormat("Volume version {0}.{1}", sqSb.s_major, sqSb.s_minor).AppendLine();
sbInformation.AppendFormat("Volume has {0} bytes", sqSb.bytes_used).AppendLine();
sbInformation.AppendFormat("Volume has {0} bytes per block", sqSb.block_size).AppendLine();
sbInformation.AppendLine(Localization.Squash_file_system);
sbInformation.AppendLine(littleEndian ? Localization.Little_endian : Localization.Big_endian);
sbInformation.AppendFormat(Localization.Volume_version_0_1, sqSb.s_major, sqSb.s_minor).AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_bytes, sqSb.bytes_used).AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_bytes_per_block, sqSb.block_size).AppendLine();
sbInformation.AppendFormat("Volume created on {0}", DateHandlers.UnixUnsignedToDateTime(sqSb.mkfs_time)).
AppendLine();
sbInformation.
AppendFormat(Localization.Volume_created_on_0, DateHandlers.UnixUnsignedToDateTime(sqSb.mkfs_time)).
AppendLine();
sbInformation.AppendFormat("Volume has {0} inodes", sqSb.inodes).AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_inodes, sqSb.inodes).AppendLine();
switch(sqSb.compression)
{
case (ushort)SquashCompression.Lz4:
sbInformation.AppendLine("Volume is compressed using LZ4");
sbInformation.AppendLine(Localization.Volume_is_compressed_using_LZ4);
break;
case (ushort)SquashCompression.Lzo:
sbInformation.AppendLine("Volume is compressed using LZO");
sbInformation.AppendLine(Localization.Volume_is_compressed_using_LZO);
break;
case (ushort)SquashCompression.Lzma:
sbInformation.AppendLine("Volume is compressed using LZMA");
sbInformation.AppendLine(Localization.Volume_is_compressed_using_LZMA);
break;
case (ushort)SquashCompression.Xz:
sbInformation.AppendLine("Volume is compressed using XZ");
sbInformation.AppendLine(Localization.Volume_is_compressed_using_XZ);
break;
case (ushort)SquashCompression.Zlib:
sbInformation.AppendLine("Volume is compressed using GZIP");
sbInformation.AppendLine(Localization.Volume_is_compressed_using_GZIP);
break;
case (ushort)SquashCompression.Zstd:
sbInformation.AppendLine("Volume is compressed using Zstandard");
sbInformation.AppendLine(Localization.Volume_is_compressed_using_Zstandard);
break;
default:
sbInformation.AppendFormat("Volume is compressed using unknown algorithm {0}", sqSb.compression).
AppendLine();
sbInformation.
AppendFormat(Localization.Volume_is_compressed_using_unknown_algorithm_0, sqSb.compression).
AppendLine();
break;
}
@@ -155,7 +159,7 @@ public sealed class Squash : IFilesystem
XmlFsType = new FileSystemType
{
Type = "Squash file system",
Type = FS_TYPE,
CreationDate = DateHandlers.UnixUnsignedToDateTime(sqSb.mkfs_time),
CreationDateSpecified = true,
Clusters = (partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize / sqSb.block_size,

View File

@@ -77,11 +77,11 @@ public sealed class SysVfs : IFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "UNIX System V filesystem";
public string Name => Localization.SysVfs_Name;
/// <inheritdoc />
public Guid Id => new("9B8D016A-8561-400E-A12A-A198283C211D");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -190,6 +190,12 @@ public sealed class SysVfs : IFilesystem
return false;
}
const string FS_TYPE_XENIX = "xenixfs";
const string FS_TYPE_SVR4 = "sysv_r4";
const string FS_TYPE_SVR2 = "sysv_r2";
const string FS_TYPE_COHERENT = "coherent";
const string FS_TYPE_UNIX7 = "unix7fs";
/// <inheritdoc />
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
{
@@ -452,30 +458,30 @@ public sealed class SysVfs : IFilesystem
}
uint bs = 512;
sb.AppendLine("XENIX filesystem");
XmlFsType.Type = "XENIX fs";
sb.AppendLine(Localization.XENIX_filesystem);
XmlFsType.Type = FS_TYPE_XENIX;
switch(xnx_sb.s_type)
{
case 1:
sb.AppendLine("512 bytes per block");
sb.AppendLine(Localization._512_bytes_per_block);
XmlFsType.ClusterSize = 512;
break;
case 2:
sb.AppendLine("1024 bytes per block");
sb.AppendLine(Localization._1024_bytes_per_block);
bs = 1024;
XmlFsType.ClusterSize = 1024;
break;
case 3:
sb.AppendLine("2048 bytes per block");
sb.AppendLine(Localization._2048_bytes_per_block);
bs = 2048;
XmlFsType.ClusterSize = 2048;
break;
default:
sb.AppendFormat("Unknown s_type value: 0x{0:X8}", xnx_sb.s_type).AppendLine();
sb.AppendFormat(Localization.Unknown_s_type_value_0, xnx_sb.s_type).AppendLine();
break;
}
@@ -484,44 +490,49 @@ public sealed class SysVfs : IFilesystem
{
if(bs != 2048)
sb.
AppendFormat("WARNING: Filesystem indicates {0} bytes/block while device indicates {1} bytes/sector",
AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_sector,
bs, 2048).AppendLine();
}
else
{
if(bs != imagePlugin.Info.SectorSize)
sb.
AppendFormat("WARNING: Filesystem indicates {0} bytes/block while device indicates {1} bytes/sector",
AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_sector,
bs, imagePlugin.Info.SectorSize).AppendLine();
}
sb.AppendFormat("{0} zones on volume ({1} bytes)", xnx_sb.s_fsize, xnx_sb.s_fsize * bs).AppendLine();
sb.AppendFormat(Localization._0_zones_on_volume_1_bytes, xnx_sb.s_fsize, xnx_sb.s_fsize * bs).AppendLine();
sb.AppendFormat("{0} free zones on volume ({1} bytes)", xnx_sb.s_tfree, xnx_sb.s_tfree * bs).AppendLine();
sb.AppendFormat("{0} free blocks on list ({1} bytes)", xnx_sb.s_nfree, xnx_sb.s_nfree * bs).AppendLine();
sb.AppendFormat("{0} blocks per cylinder ({1} bytes)", xnx_sb.s_cylblks, xnx_sb.s_cylblks * bs).
sb.AppendFormat(Localization._0_free_zones_on_volume_1_bytes, xnx_sb.s_tfree, xnx_sb.s_tfree * bs).
AppendLine();
sb.AppendFormat("{0} blocks per gap ({1} bytes)", xnx_sb.s_gapblks, xnx_sb.s_gapblks * bs).AppendLine();
sb.AppendFormat("First data zone: {0}", xnx_sb.s_isize).AppendLine();
sb.AppendFormat("{0} free inodes on volume", xnx_sb.s_tinode).AppendLine();
sb.AppendFormat("{0} free inodes on list", xnx_sb.s_ninode).AppendLine();
sb.AppendFormat(Localization._0_free_blocks_on_list_1_bytes, xnx_sb.s_nfree, xnx_sb.s_nfree * bs).
AppendLine();
sb.AppendFormat(Localization._0_blocks_per_cylinder_1_bytes, xnx_sb.s_cylblks, xnx_sb.s_cylblks * bs).
AppendLine();
sb.AppendFormat(Localization._0_blocks_per_gap_1_bytes, xnx_sb.s_gapblks, xnx_sb.s_gapblks * bs).
AppendLine();
sb.AppendFormat(Localization.First_data_zone_0, xnx_sb.s_isize).AppendLine();
sb.AppendFormat(Localization._0_free_inodes_on_volume, xnx_sb.s_tinode).AppendLine();
sb.AppendFormat(Localization._0_free_inodes_on_list, xnx_sb.s_ninode).AppendLine();
if(xnx_sb.s_flock > 0)
sb.AppendLine("Free block list is locked");
sb.AppendLine(Localization.Free_block_list_is_locked);
if(xnx_sb.s_ilock > 0)
sb.AppendLine("inode cache is locked");
sb.AppendLine(Localization.inode_cache_is_locked);
if(xnx_sb.s_fmod > 0)
sb.AppendLine("Superblock is being modified");
sb.AppendLine(Localization.Superblock_is_being_modified);
if(xnx_sb.s_ronly > 0)
sb.AppendLine("Volume is mounted read-only");
sb.AppendLine(Localization.Volume_is_mounted_read_only);
sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UnixToDateTime(xnx_sb.s_time)).AppendLine();
sb.AppendFormat(Localization.Superblock_last_updated_on_0, DateHandlers.UnixToDateTime(xnx_sb.s_time)).
AppendLine();
if(xnx_sb.s_time != 0)
{
@@ -529,15 +540,15 @@ public sealed class SysVfs : IFilesystem
XmlFsType.ModificationDateSpecified = true;
}
sb.AppendFormat("Volume name: {0}", xnx_sb.s_fname).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, xnx_sb.s_fname).AppendLine();
XmlFsType.VolumeName = xnx_sb.s_fname;
sb.AppendFormat("Pack name: {0}", xnx_sb.s_fpack).AppendLine();
sb.AppendFormat(Localization.Pack_name_0, xnx_sb.s_fpack).AppendLine();
if(xnx_sb.s_clean == 0x46)
sb.AppendLine("Volume is clean");
sb.AppendLine(Localization.Volume_is_clean);
else
{
sb.AppendLine("Volume is dirty");
sb.AppendLine(Localization.Volume_is_dirty);
XmlFsType.Dirty = true;
}
}
@@ -578,7 +589,7 @@ public sealed class SysVfs : IFilesystem
break;
default:
sb.AppendFormat("Unknown s_type value: 0x{0:X8}", sysv_sb.s_type).AppendLine();
sb.AppendFormat(Localization.Unknown_s_type_value_0, sysv_sb.s_type).AppendLine();
break;
}
@@ -613,8 +624,8 @@ public sealed class SysVfs : IFilesystem
sysv_sb.s_fname = StringHandlers.CToString(sysv_strings, Encoding);
Array.Copy(sb_sector, 0x1BC + offset, sysv_strings, 0, 6);
sysv_sb.s_fpack = StringHandlers.CToString(sysv_strings, Encoding);
sb.AppendLine("System V Release 4 filesystem");
XmlFsType.Type = "SVR4 fs";
sb.AppendLine(Localization.System_V_Release_4_filesystem);
XmlFsType.Type = FS_TYPE_SVR4;
}
else
{
@@ -639,8 +650,8 @@ public sealed class SysVfs : IFilesystem
sysv_sb.s_fname = StringHandlers.CToString(sysv_strings, Encoding);
Array.Copy(sb_sector, 0x1B6 + offset, sysv_strings, 0, 6);
sysv_sb.s_fpack = StringHandlers.CToString(sysv_strings, Encoding);
sb.AppendLine("System V Release 2 filesystem");
XmlFsType.Type = "SVR2 fs";
sb.AppendLine(Localization.System_V_Release_2_filesystem);
XmlFsType.Type = FS_TYPE_SVR2;
}
if(bigEndian)
@@ -660,38 +671,43 @@ public sealed class SysVfs : IFilesystem
sysv_sb.s_tinode = Swapping.Swap(sysv_sb.s_tinode);
}
sb.AppendFormat("{0} bytes per block", bs).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_block, bs).AppendLine();
XmlFsType.Clusters = sysv_sb.s_fsize;
sb.AppendFormat("{0} zones on volume ({1} bytes)", sysv_sb.s_fsize, sysv_sb.s_fsize * bs).AppendLine();
sb.AppendFormat("{0} free zones on volume ({1} bytes)", sysv_sb.s_tfree, sysv_sb.s_tfree * bs).AppendLine();
sb.AppendFormat("{0} free blocks on list ({1} bytes)", sysv_sb.s_nfree, sysv_sb.s_nfree * bs).AppendLine();
sb.AppendFormat("{0} blocks per cylinder ({1} bytes)", sysv_sb.s_cylblks, sysv_sb.s_cylblks * bs).
sb.AppendFormat(Localization._0_zones_on_volume_1_bytes, sysv_sb.s_fsize, sysv_sb.s_fsize * bs).
AppendLine();
sb.AppendFormat("{0} blocks per gap ({1} bytes)", sysv_sb.s_gapblks, sysv_sb.s_gapblks * bs).AppendLine();
sb.AppendFormat(Localization._0_free_zones_on_volume_1_bytes, sysv_sb.s_tfree, sysv_sb.s_tfree * bs).
AppendLine();
sb.AppendFormat("First data zone: {0}", sysv_sb.s_isize).AppendLine();
sb.AppendFormat("{0} free inodes on volume", sysv_sb.s_tinode).AppendLine();
sb.AppendFormat("{0} free inodes on list", sysv_sb.s_ninode).AppendLine();
sb.AppendFormat(Localization._0_free_blocks_on_list_1_bytes, sysv_sb.s_nfree, sysv_sb.s_nfree * bs).
AppendLine();
sb.AppendFormat(Localization._0_blocks_per_cylinder_1_bytes, sysv_sb.s_cylblks, sysv_sb.s_cylblks * bs).
AppendLine();
sb.AppendFormat(Localization._0_blocks_per_gap_1_bytes, sysv_sb.s_gapblks, sysv_sb.s_gapblks * bs).
AppendLine();
sb.AppendFormat(Localization.First_data_zone_0, sysv_sb.s_isize).AppendLine();
sb.AppendFormat(Localization._0_free_inodes_on_volume, sysv_sb.s_tinode).AppendLine();
sb.AppendFormat(Localization._0_free_inodes_on_list, sysv_sb.s_ninode).AppendLine();
if(sysv_sb.s_flock > 0)
sb.AppendLine("Free block list is locked");
sb.AppendLine(Localization.Free_block_list_is_locked);
if(sysv_sb.s_ilock > 0)
sb.AppendLine("inode cache is locked");
sb.AppendLine(Localization.inode_cache_is_locked);
if(sysv_sb.s_fmod > 0)
sb.AppendLine("Superblock is being modified");
sb.AppendLine(Localization.Superblock_is_being_modified);
if(sysv_sb.s_ronly > 0)
sb.AppendLine("Volume is mounted read-only");
sb.AppendLine(Localization.Volume_is_mounted_read_only);
sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UnixUnsignedToDateTime(sysv_sb.s_time)).
AppendLine();
sb.AppendFormat(Localization.Superblock_last_updated_on_0,
DateHandlers.UnixUnsignedToDateTime(sysv_sb.s_time)).AppendLine();
if(sysv_sb.s_time != 0)
{
@@ -699,15 +715,15 @@ public sealed class SysVfs : IFilesystem
XmlFsType.ModificationDateSpecified = true;
}
sb.AppendFormat("Volume name: {0}", sysv_sb.s_fname).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, sysv_sb.s_fname).AppendLine();
XmlFsType.VolumeName = sysv_sb.s_fname;
sb.AppendFormat("Pack name: {0}", sysv_sb.s_fpack).AppendLine();
sb.AppendFormat(Localization.Pack_name_0, sysv_sb.s_fpack).AppendLine();
if(sysv_sb.s_state == 0x7C269D38 - sysv_sb.s_time)
sb.AppendLine("Volume is clean");
sb.AppendLine(Localization.Volume_is_clean);
else
{
sb.AppendLine("Volume is dirty");
sb.AppendLine(Localization.Volume_is_dirty);
XmlFsType.Dirty = true;
}
}
@@ -740,40 +756,43 @@ public sealed class SysVfs : IFilesystem
Array.Copy(sb_sector, 0x1EA, coh_strings, 0, 6);
coh_sb.s_fpack = StringHandlers.CToString(coh_strings, Encoding);
XmlFsType.Type = "Coherent fs";
XmlFsType.Type = FS_TYPE_COHERENT;
XmlFsType.ClusterSize = 512;
XmlFsType.Clusters = coh_sb.s_fsize;
sb.AppendLine("Coherent UNIX filesystem");
sb.AppendLine(Localization.Coherent_UNIX_filesystem);
if(imagePlugin.Info.SectorSize != 512)
sb.AppendFormat("WARNING: Filesystem indicates {0} bytes/block while device indicates {1} bytes/sector",
512, 2048).AppendLine();
sb.
AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_sector,
512, 2048).AppendLine();
sb.AppendFormat("{0} zones on volume ({1} bytes)", coh_sb.s_fsize, coh_sb.s_fsize * 512).AppendLine();
sb.AppendFormat(Localization._0_zones_on_volume_1_bytes, coh_sb.s_fsize, coh_sb.s_fsize * 512).AppendLine();
sb.AppendFormat("{0} free zones on volume ({1} bytes)", coh_sb.s_tfree, coh_sb.s_tfree * 512).AppendLine();
sb.AppendFormat(Localization._0_free_zones_on_volume_1_bytes, coh_sb.s_tfree, coh_sb.s_tfree * 512).
AppendLine();
sb.AppendFormat("{0} free blocks on list ({1} bytes)", coh_sb.s_nfree, coh_sb.s_nfree * 512).AppendLine();
sb.AppendFormat(Localization._0_free_blocks_on_list_1_bytes, coh_sb.s_nfree, coh_sb.s_nfree * 512).
AppendLine();
sb.AppendFormat("First data zone: {0}", coh_sb.s_isize).AppendLine();
sb.AppendFormat("{0} free inodes on volume", coh_sb.s_tinode).AppendLine();
sb.AppendFormat("{0} free inodes on list", coh_sb.s_ninode).AppendLine();
sb.AppendFormat(Localization.First_data_zone_0, coh_sb.s_isize).AppendLine();
sb.AppendFormat(Localization._0_free_inodes_on_volume, coh_sb.s_tinode).AppendLine();
sb.AppendFormat(Localization._0_free_inodes_on_list, coh_sb.s_ninode).AppendLine();
if(coh_sb.s_flock > 0)
sb.AppendLine("Free block list is locked");
sb.AppendLine(Localization.Free_block_list_is_locked);
if(coh_sb.s_ilock > 0)
sb.AppendLine("inode cache is locked");
sb.AppendLine(Localization.inode_cache_is_locked);
if(coh_sb.s_fmod > 0)
sb.AppendLine("Superblock is being modified");
sb.AppendLine(Localization.Superblock_is_being_modified);
if(coh_sb.s_ronly > 0)
sb.AppendLine("Volume is mounted read-only");
sb.AppendLine(Localization.Volume_is_mounted_read_only);
sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UnixUnsignedToDateTime(coh_sb.s_time)).
AppendLine();
sb.AppendFormat(Localization.Superblock_last_updated_on_0,
DateHandlers.UnixUnsignedToDateTime(coh_sb.s_time)).AppendLine();
if(coh_sb.s_time != 0)
{
@@ -781,9 +800,9 @@ public sealed class SysVfs : IFilesystem
XmlFsType.ModificationDateSpecified = true;
}
sb.AppendFormat("Volume name: {0}", coh_sb.s_fname).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, coh_sb.s_fname).AppendLine();
XmlFsType.VolumeName = coh_sb.s_fname;
sb.AppendFormat("Pack name: {0}", coh_sb.s_fpack).AppendLine();
sb.AppendFormat(Localization.Pack_name_0, coh_sb.s_fpack).AppendLine();
}
if(sys7th)
@@ -814,38 +833,42 @@ public sealed class SysVfs : IFilesystem
Array.Copy(sb_sector, 0x1B2, sys7_strings, 0, 6);
v7_sb.s_fpack = StringHandlers.CToString(sys7_strings, Encoding);
XmlFsType.Type = "UNIX 7th Edition fs";
XmlFsType.Type = FS_TYPE_UNIX7;
XmlFsType.ClusterSize = 512;
XmlFsType.Clusters = v7_sb.s_fsize;
sb.AppendLine("UNIX 7th Edition filesystem");
sb.AppendLine(Localization.UNIX_7th_Edition_filesystem);
if(imagePlugin.Info.SectorSize != 512)
sb.AppendFormat("WARNING: Filesystem indicates {0} bytes/block while device indicates {1} bytes/sector",
512, 2048).AppendLine();
sb.
AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_sector,
512, 2048).AppendLine();
sb.AppendFormat("{0} zones on volume ({1} bytes)", v7_sb.s_fsize, v7_sb.s_fsize * 512).AppendLine();
sb.AppendFormat(Localization._0_zones_on_volume_1_bytes, v7_sb.s_fsize, v7_sb.s_fsize * 512).AppendLine();
sb.AppendFormat("{0} free zones on volume ({1} bytes)", v7_sb.s_tfree, v7_sb.s_tfree * 512).AppendLine();
sb.AppendFormat(Localization._0_free_zones_on_volume_1_bytes, v7_sb.s_tfree, v7_sb.s_tfree * 512).
AppendLine();
sb.AppendFormat("{0} free blocks on list ({1} bytes)", v7_sb.s_nfree, v7_sb.s_nfree * 512).AppendLine();
sb.AppendFormat("First data zone: {0}", v7_sb.s_isize).AppendLine();
sb.AppendFormat("{0} free inodes on volume", v7_sb.s_tinode).AppendLine();
sb.AppendFormat("{0} free inodes on list", v7_sb.s_ninode).AppendLine();
sb.AppendFormat(Localization._0_free_blocks_on_list_1_bytes, v7_sb.s_nfree, v7_sb.s_nfree * 512).
AppendLine();
sb.AppendFormat(Localization.First_data_zone_0, v7_sb.s_isize).AppendLine();
sb.AppendFormat(Localization._0_free_inodes_on_volume, v7_sb.s_tinode).AppendLine();
sb.AppendFormat(Localization._0_free_inodes_on_list, v7_sb.s_ninode).AppendLine();
if(v7_sb.s_flock > 0)
sb.AppendLine("Free block list is locked");
sb.AppendLine(Localization.Free_block_list_is_locked);
if(v7_sb.s_ilock > 0)
sb.AppendLine("inode cache is locked");
sb.AppendLine(Localization.inode_cache_is_locked);
if(v7_sb.s_fmod > 0)
sb.AppendLine("Superblock is being modified");
sb.AppendLine(Localization.Superblock_is_being_modified);
if(v7_sb.s_ronly > 0)
sb.AppendLine("Volume is mounted read-only");
sb.AppendLine(Localization.Volume_is_mounted_read_only);
sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UnixUnsignedToDateTime(v7_sb.s_time)).
AppendLine();
sb.AppendFormat(Localization.Superblock_last_updated_on_0,
DateHandlers.UnixUnsignedToDateTime(v7_sb.s_time)).AppendLine();
if(v7_sb.s_time != 0)
{
@@ -853,9 +876,9 @@ public sealed class SysVfs : IFilesystem
XmlFsType.ModificationDateSpecified = true;
}
sb.AppendFormat("Volume name: {0}", v7_sb.s_fname).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, v7_sb.s_fname).AppendLine();
XmlFsType.VolumeName = v7_sb.s_fname;
sb.AppendFormat("Pack name: {0}", v7_sb.s_fpack).AppendLine();
sb.AppendFormat(Localization.Pack_name_0, v7_sb.s_fpack).AppendLine();
}
information = sb.ToString();

View File

@@ -59,4 +59,6 @@ public sealed partial class PascalPlugin
/// <summary>Security, not used</summary>
Secure
}
const string FS_TYPE = "ucsd";
}

View File

@@ -184,17 +184,19 @@ public sealed partial class PascalPlugin
if(volEntry.Files < 0)
return;
sbInformation.AppendFormat("Volume record spans from block {0} to block {1}", volEntry.FirstBlock,
sbInformation.AppendFormat(Localization.Volume_record_spans_from_block_0_to_block_1, volEntry.FirstBlock,
volEntry.LastBlock).AppendLine();
sbInformation.AppendFormat("Volume name: {0}", StringHandlers.PascalToString(volEntry.VolumeName, Encoding)).
AppendLine();
sbInformation.
AppendFormat(Localization.Volume_name_0, StringHandlers.PascalToString(volEntry.VolumeName, Encoding)).
AppendLine();
sbInformation.AppendFormat("Volume has {0} blocks", volEntry.Blocks).AppendLine();
sbInformation.AppendFormat("Volume has {0} files", volEntry.Files).AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_blocks, volEntry.Blocks).AppendLine();
sbInformation.AppendFormat(Localization.Volume_has_0_files, volEntry.Files).AppendLine();
sbInformation.AppendFormat("Volume last booted at {0}", DateHandlers.UcsdPascalToDateTime(volEntry.LastBoot)).
AppendLine();
sbInformation.
AppendFormat(Localization.Volume_last_booted_at_0, DateHandlers.UcsdPascalToDateTime(volEntry.LastBoot)).
AppendLine();
information = sbInformation.ToString();
@@ -207,7 +209,7 @@ public sealed partial class PascalPlugin
ClusterSize = imagePlugin.Info.SectorSize,
Files = (ulong)volEntry.Files,
FilesSpecified = true,
Type = "UCSD Pascal",
Type = FS_TYPE,
VolumeName = StringHandlers.PascalToString(volEntry.VolumeName, Encoding)
};
}

View File

@@ -140,7 +140,7 @@ public sealed partial class PascalPlugin
ClusterSize = _device.Info.SectorSize,
Files = (ulong)_mountedVolEntry.Files,
FilesSpecified = true,
Type = "UCSD Pascal",
Type = FS_TYPE,
VolumeName = StringHandlers.PascalToString(_mountedVolEntry.VolumeName, Encoding)
};
@@ -168,7 +168,7 @@ public sealed partial class PascalPlugin
Files = (ulong)_mountedVolEntry.Files,
FreeBlocks = 0,
PluginId = Id,
Type = "UCSD Pascal"
Type = FS_TYPE
};
stat.FreeBlocks = (ulong)(_mountedVolEntry.Blocks - (_mountedVolEntry.LastBlock - _mountedVolEntry.FirstBlock));

View File

@@ -57,13 +57,13 @@ public sealed partial class PascalPlugin : IReadOnlyFilesystem
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public string Name => "U.C.S.D. Pascal filesystem";
public string Name => Localization.PascalPlugin_Name;
/// <inheritdoc />
public Guid Id => new("B0AC2CB5-72AA-473A-9200-270B5A2C2D53");
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public ErrorNumber ListXAttr(string path, out List<string> xattrs)

View File

@@ -62,11 +62,11 @@ public sealed class UDF : IFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "Universal Disk Format";
public string Name => Localization.UDF_Name;
/// <inheritdoc />
public Guid Id => new("83976FEC-A91B-464B-9293-56C719461BAB");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -228,7 +228,7 @@ public sealed class UDF : IFilesystem
var sbInformation = new StringBuilder();
sbInformation.AppendLine("Universal Disk Format");
sbInformation.AppendLine(Localization.Universal_Disk_Format);
var anchor = new AnchorVolumeDescriptorPointer();
@@ -349,48 +349,49 @@ public sealed class UDF : IFilesystem
else
lvid = new LogicalVolumeIntegrityDescriptor();
sbInformation.AppendFormat("Volume is number {0} of {1}", pvd.volumeSequenceNumber,
sbInformation.AppendFormat(Localization.Volume_is_number_0_of_1, pvd.volumeSequenceNumber,
pvd.maximumVolumeSequenceNumber).AppendLine();
sbInformation.AppendFormat("Volume set identifier: {0}",
sbInformation.AppendFormat(Localization.Volume_set_identifier_0,
StringHandlers.DecompressUnicode(pvd.volumeSetIdentifier)).AppendLine();
sbInformation.AppendFormat("Volume name: {0}", StringHandlers.DecompressUnicode(lvd.logicalVolumeIdentifier)).
sbInformation.
AppendFormat(Localization.Volume_name_0, StringHandlers.DecompressUnicode(lvd.logicalVolumeIdentifier)).
AppendLine();
sbInformation.AppendFormat(Localization.Volume_uses_0_bytes_per_block, lvd.logicalBlockSize).AppendLine();
sbInformation.AppendFormat(Localization.Volume_was_last_written_in_0, EcmaToDateTime(lvid.recordingDateTime)).
AppendLine();
sbInformation.AppendFormat("Volume uses {0} bytes per block", lvd.logicalBlockSize).AppendLine();
sbInformation.AppendFormat(Localization.Volume_contains_0_partitions, lvid.numberOfPartitions).AppendLine();
sbInformation.AppendFormat("Volume was last written in {0}", EcmaToDateTime(lvid.recordingDateTime)).
AppendLine();
sbInformation.
AppendFormat(Localization.Volume_contains_0_files_and_1_directories, lvidiu.files, lvidiu.directories).
AppendLine();
sbInformation.AppendFormat("Volume contains {0} partitions", lvid.numberOfPartitions).AppendLine();
sbInformation.AppendFormat("Volume contains {0} files and {1} directories", lvidiu.files, lvidiu.directories).
AppendLine();
sbInformation.AppendFormat("Volume conforms to {0}",
sbInformation.AppendFormat(Localization.Volume_conforms_to_0,
Encoding.GetString(lvd.domainIdentifier.identifier).TrimEnd('\u0000')).AppendLine();
sbInformation.AppendFormat("Volume was last written by: {0}",
sbInformation.AppendFormat(Localization.Volume_was_last_written_by_0,
Encoding.GetString(pvd.implementationIdentifier.identifier).TrimEnd('\u0000')).
AppendLine();
sbInformation.AppendFormat("Volume requires UDF version {0}.{1:X2} to be read",
sbInformation.AppendFormat(Localization.Volume_requires_UDF_version_0_1_to_be_read,
Convert.ToInt32($"{(lvidiu.minimumReadUDF & 0xFF00) >> 8}", 10),
Convert.ToInt32($"{lvidiu.minimumReadUDF & 0xFF}", 10)).AppendLine();
sbInformation.AppendFormat("Volume requires UDF version {0}.{1:X2} to be written to",
sbInformation.AppendFormat(Localization.Volume_requires_UDF_version_0_1_to_be_written_to,
Convert.ToInt32($"{(lvidiu.minimumWriteUDF & 0xFF00) >> 8}", 10),
Convert.ToInt32($"{lvidiu.minimumWriteUDF & 0xFF}", 10)).AppendLine();
sbInformation.AppendFormat("Volume cannot be written by any UDF version higher than {0}.{1:X2}",
sbInformation.AppendFormat(Localization.Volume_cannot_be_written_by_any_UDF_version_higher_than_0_1,
Convert.ToInt32($"{(lvidiu.maximumWriteUDF & 0xFF00) >> 8}", 10),
Convert.ToInt32($"{lvidiu.maximumWriteUDF & 0xFF}", 10)).AppendLine();
XmlFsType = new FileSystemType
{
Type = $"UDF v{Convert.ToInt32($"{(lvidiu.maximumWriteUDF & 0xFF00) >> 8}", 10)}.{
Convert.ToInt32($"{lvidiu.maximumWriteUDF & 0xFF}", 10):X2}",
Type = FS_TYPE,
ApplicationIdentifier = Encoding.GetString(pvd.implementationIdentifier.identifier).TrimEnd('\u0000'),
ClusterSize = lvd.logicalBlockSize,
ModificationDate = EcmaToDateTime(lvid.recordingDateTime),
@@ -409,6 +410,8 @@ public sealed class UDF : IFilesystem
information = sbInformation.ToString();
}
const string FS_TYPE = "udf";
static DateTime EcmaToDateTime(Timestamp timestamp) => DateHandlers.EcmaToDateTime(timestamp.typeAndZone,
timestamp.year, timestamp.month, timestamp.day, timestamp.hour, timestamp.minute, timestamp.second,
timestamp.centiseconds, timestamp.hundredsMicroseconds, timestamp.microseconds);

View File

@@ -62,16 +62,18 @@ public sealed class UNICOS : IFilesystem
const ulong UNICOS_MAGIC = 0x6e6331667331636e;
const ulong UNICOS_SECURE = 0xcd076d1771d670cd;
const string FS_TYPE = "unicos";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "UNICOS Filesystem Plugin";
public string Name => Localization.UNICOS_Name;
/// <inheritdoc />
public Guid Id => new("61712F04-066C-44D5-A2A0-1E44C66B33F0");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -97,7 +99,7 @@ public sealed class UNICOS : IFilesystem
Superblock unicosSb = Marshal.ByteArrayToStructureBigEndian<Superblock>(sector);
AaruConsole.DebugWriteLine("UNICOS plugin", "magic = 0x{0:X16} (expected 0x{1:X16})", unicosSb.s_magic,
AaruConsole.DebugWriteLine("UNICOS plugin", Localization.magic_equals_0_expected_1, unicosSb.s_magic,
UNICOS_MAGIC);
return unicosSb.s_magic == UNICOS_MAGIC;
@@ -132,29 +134,31 @@ public sealed class UNICOS : IFilesystem
var sb = new StringBuilder();
sb.AppendLine("UNICOS filesystem");
sb.AppendLine(Localization.UNICOS_filesystem);
if(unicosSb.s_secure == UNICOS_SECURE)
sb.AppendLine("Volume is secure");
sb.AppendLine(Localization.Volume_is_secure);
sb.AppendFormat("Volume contains {0} partitions", unicosSb.s_npart).AppendLine();
sb.AppendFormat("{0} bytes per sector", unicosSb.s_iounit).AppendLine();
sb.AppendLine("4096 bytes per block");
sb.AppendFormat("{0} data blocks in volume", unicosSb.s_fsize).AppendLine();
sb.AppendFormat("Root resides on inode {0}", unicosSb.s_root).AppendLine();
sb.AppendFormat("{0} inodes in volume", unicosSb.s_isize).AppendLine();
sb.AppendFormat("Volume last updated on {0}", DateHandlers.UnixToDateTime(unicosSb.s_time)).AppendLine();
sb.AppendFormat(Localization.Volume_contains_0_partitions, unicosSb.s_npart).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_sector, unicosSb.s_iounit).AppendLine();
sb.AppendLine(Localization._4096_bytes_per_block);
sb.AppendFormat(Localization._0_data_blocks_in_volume, unicosSb.s_fsize).AppendLine();
sb.AppendFormat(Localization.Root_resides_on_inode_0, unicosSb.s_root).AppendLine();
sb.AppendFormat(Localization._0_inodes_in_volume, unicosSb.s_isize).AppendLine();
sb.AppendFormat(Localization.Volume_last_updated_on_0, DateHandlers.UnixToDateTime(unicosSb.s_time)).
AppendLine();
if(unicosSb.s_error > 0)
sb.AppendFormat("Volume is dirty, error code = 0x{0:X16}", unicosSb.s_error).AppendLine();
sb.AppendFormat(Localization.Volume_is_dirty_error_code_equals_0, unicosSb.s_error).AppendLine();
sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(unicosSb.s_fname, Encoding)).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(unicosSb.s_fname, Encoding)).AppendLine();
information = sb.ToString();
XmlFsType = new FileSystemType
{
Type = "UNICOS filesystem",
Type = FS_TYPE,
ClusterSize = 4096,
Clusters = (ulong)unicosSb.s_fsize,
VolumeName = StringHandlers.CToString(unicosSb.s_fname, Encoding),

View File

@@ -49,16 +49,18 @@ public sealed class BFS : IFilesystem
{
const uint BFS_MAGIC = 0x1BADFACE;
const string FS_TYPE = "bfs";
/// <inheritdoc />
public FileSystemType XmlFsType { get; private set; }
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "UNIX Boot filesystem";
public string Name => Localization.BFS_Name;
/// <inheritdoc />
public Guid Id => new("1E6E0DA6-F7E4-494C-80C6-CB5929E96155");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -116,17 +118,17 @@ public sealed class BFS : IFilesystem
AaruConsole.DebugWriteLine("BFS plugin", "bfs_sb.s_fsname: 0x{0}", bfsSb.s_fsname);
AaruConsole.DebugWriteLine("BFS plugin", "bfs_sb.s_volume: 0x{0}", bfsSb.s_volume);
sb.AppendLine("UNIX Boot filesystem");
sb.AppendLine(Localization.UNIX_Boot_Filesystem);
sb.AppendFormat("Volume goes from byte {0} to byte {1}, for {2} bytes", bfsSb.s_start, bfsSb.s_end,
sb.AppendFormat(Localization.Volume_goes_from_byte_0_to_byte_1_for_2_bytes, bfsSb.s_start, bfsSb.s_end,
bfsSb.s_end - bfsSb.s_start).AppendLine();
sb.AppendFormat("Filesystem name: {0}", bfsSb.s_fsname).AppendLine();
sb.AppendFormat("Volume name: {0}", bfsSb.s_volume).AppendLine();
sb.AppendFormat(Localization.Filesystem_name_0, bfsSb.s_fsname).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, bfsSb.s_volume).AppendLine();
XmlFsType = new FileSystemType
{
Type = "BFS",
Type = FS_TYPE,
VolumeName = bfsSb.s_volume,
ClusterSize = imagePlugin.Info.SectorSize,
Clusters = partition.End - partition.Start + 1

View File

@@ -58,11 +58,11 @@ public sealed class VMfs : IFilesystem
/// <inheritdoc />
public Encoding Encoding { get; private set; }
/// <inheritdoc />
public string Name => "VMware filesystem";
public string Name => Localization.VMfs_Name;
/// <inheritdoc />
public Guid Id => new("EE52BDB8-B49C-4122-A3DA-AD21CBE79843");
/// <inheritdoc />
public string Author => "Natalia Portillo";
public string Author => Authors.NataliaPortillo;
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
@@ -85,6 +85,8 @@ public sealed class VMfs : IFilesystem
return magic == VMFS_MAGIC;
}
const string FS_TYPE = "vmfs";
/// <inheritdoc />
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
{
@@ -100,32 +102,32 @@ public sealed class VMfs : IFilesystem
var sbInformation = new StringBuilder();
sbInformation.AppendLine("VMware file system");
sbInformation.AppendLine(Localization.VMware_file_system);
uint ctimeSecs = (uint)(volInfo.ctime / 1000000);
uint ctimeNanoSecs = (uint)(volInfo.ctime % 1000000);
uint mtimeSecs = (uint)(volInfo.mtime / 1000000);
uint mtimeNanoSecs = (uint)(volInfo.mtime % 1000000);
sbInformation.AppendFormat("Volume version {0}", volInfo.version).AppendLine();
sbInformation.AppendFormat(Localization.Volume_version_0, volInfo.version).AppendLine();
sbInformation.AppendFormat("Volume name {0}", StringHandlers.CToString(volInfo.name, Encoding)).AppendLine();
sbInformation.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(volInfo.name, Encoding)).
AppendLine();
sbInformation.AppendFormat("Volume size {0} bytes", volInfo.size * 256).AppendLine();
sbInformation.AppendFormat("Volume UUID {0}", volInfo.uuid).AppendLine();
sbInformation.AppendFormat(Localization.Volume_size_0_bytes, volInfo.size * 256).AppendLine();
sbInformation.AppendFormat(Localization.Volume_UUID_0, volInfo.uuid).AppendLine();
sbInformation.
AppendFormat("Volume created on {0}", DateHandlers.UnixUnsignedToDateTime(ctimeSecs, ctimeNanoSecs)).
AppendLine();
sbInformation.AppendFormat(Localization.Volume_created_on_0,
DateHandlers.UnixUnsignedToDateTime(ctimeSecs, ctimeNanoSecs)).AppendLine();
sbInformation.AppendFormat("Volume last modified on {0}",
sbInformation.AppendFormat(Localization.Volume_last_modified_on_0,
DateHandlers.UnixUnsignedToDateTime(mtimeSecs, mtimeNanoSecs)).AppendLine();
information = sbInformation.ToString();
XmlFsType = new FileSystemType
{
Type = "VMware file system",
Type = FS_TYPE,
CreationDate = DateHandlers.UnixUnsignedToDateTime(ctimeSecs, ctimeNanoSecs),
CreationDateSpecified = true,
ModificationDate = DateHandlers.UnixUnsignedToDateTime(mtimeSecs, mtimeNanoSecs),

Some files were not shown because too many files have changed in this diff Show More