Split HPOFS.

This commit is contained in:
2020-04-02 19:30:21 +01:00
parent 801611f682
commit ed964bfe73
7 changed files with 299 additions and 173 deletions

View File

@@ -3,8 +3,10 @@
<component name="ContentModelStore">
<e p="$APPLICATION_CONFIG_DIR$/consoles/db" t="IncludeRecursive" />
<e p="$APPLICATION_PLUGINS_DIR$/puppet/lib/stubs" t="IncludeRecursive" />
<e p="$APPLICATION_CONFIG_DIR$/scratches" t="IncludeRecursive" />
<e p="$USER_HOME$/.Rider2019.3/system/extResources" t="IncludeRecursive" />
<e p="$USER_HOME$/.Rider2019.3/system/resharper-host/local/Transient/ReSharperHost/v193/SolutionCaches/_Aaru.232757112.00" t="ExcludeRecursive" />
<e p="$USER_HOME$/.config/git/ignore" t="IncludeRecursive" />
<e p="$PROJECT_DIR$" t="IncludeFlat">
<e p=".git/info/exclude" t="IncludeRecursive" />
<e p=".git/modules/Aaru.Checksums/info/exclude" t="IncludeRecursive" />
@@ -769,7 +771,12 @@
<e p="Fossil.cs" t="Include" />
<e p="HAMMER.cs" t="Include" />
<e p="HPFS.cs" t="Include" />
<e p="HPOFS.cs" t="Include" />
<e p="HPOFS" t="Include">
<e p="Consts.cs" t="Include" />
<e p="HPOFS.cs" t="Include" />
<e p="Info.cs" t="Include" />
<e p="Structs.cs" t="Include" />
</e>
<e p="ISO9660" t="Include">
<e p="Consts" t="Include">
<e p="AAIP.cs" t="Include" />

View File

@@ -79,7 +79,10 @@
<Compile Include="FAT\Structs.cs" />
<Compile Include="FAT\Super.cs" />
<Compile Include="FAT\Xattr.cs" />
<Compile Include="HPOFS.cs" />
<Compile Include="HPOFS\Consts.cs" />
<Compile Include="HPOFS\HPOFS.cs" />
<Compile Include="HPOFS\Info.cs" />
<Compile Include="HPOFS\Structs.cs" />
<Compile Include="ISO9660\Consts\Internal.cs" />
<Compile Include="ISO9660\Date.cs" />
<Compile Include="ISO9660\Dir.cs" />

View File

@@ -0,0 +1,50 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : Consts.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : High Performance Optical File System plugin.
//
// --[ Description ] ----------------------------------------------------------
//
// High Performance Optical File System constants.
//
// --[ 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-2020 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Filesystems
{
public partial class HPOFS
{
readonly byte[] hpofsType =
{
0x48, 0x50, 0x4F, 0x46, 0x53, 0x00, 0x00, 0x00
};
readonly byte[] medinfoSignature =
{
0x4D, 0x45, 0x44, 0x49, 0x4E, 0x46, 0x4F, 0x20
};
readonly byte[] volinfoSignature =
{
0x56, 0x4F, 0x4C, 0x49, 0x4E, 0x46, 0x4F, 0x20
};
}
}

View File

@@ -0,0 +1,50 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : HPOFS.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : High Performance Optical File System plugin.
//
// --[ Description ] ----------------------------------------------------------
//
// High Performance Optical File System.
//
// --[ 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-2020 Natalia Portillo
// ****************************************************************************/
using System;
using System.Text;
using Aaru.CommonTypes.Interfaces;
using Schemas;
namespace Aaru.Filesystems
{
// Information from test floppy images created with OS/2 HPOFS 2.0
// Need to get IBM document GA32-0224 -> IBM 3995 Optical Library Dataserver Products: Optical Disk Format
public partial class HPOFS : IFilesystem
{
public FileSystemType XmlFsType { get; private set; }
public Encoding Encoding { get; private set; }
public string Name => "High Performance Optical File System";
public Guid Id => new Guid("1b72dcd5-d031-4757-8a9f-8d2fb18c59e2");
public string Author => "Natalia Portillo";
}
}

View File

@@ -1,8 +1,8 @@
// /***************************************************************************
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : HPOFS.cs
// Filename : Info.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : High Performance Optical File System plugin.
@@ -31,41 +31,18 @@
// Copyright © 2011-2020 Natalia Portillo
// ****************************************************************************/
using System;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using Aaru.CommonTypes;
using Aaru.CommonTypes.Interfaces;
using Aaru.Console;
using Aaru.Helpers;
using Schemas;
using Marshal = Aaru.Helpers.Marshal;
namespace Aaru.Filesystems
{
// Information from test floppy images created with OS/2 HPOFS 2.0
// Need to get IBM document GA32-0224 -> IBM 3995 Optical Library Dataserver Products: Optical Disk Format
public class HPOFS : IFilesystem
public partial class HPOFS
{
readonly byte[] hpofsType =
{
0x48, 0x50, 0x4F, 0x46, 0x53, 0x00, 0x00, 0x00
};
readonly byte[] medinfoSignature =
{
0x4D, 0x45, 0x44, 0x49, 0x4E, 0x46, 0x4F, 0x20
};
readonly byte[] volinfoSignature =
{
0x56, 0x4F, 0x4C, 0x49, 0x4E, 0x46, 0x4F, 0x20
};
public FileSystemType XmlFsType { get; private set; }
public Encoding Encoding { get; private set; }
public string Name => "High Performance Optical File System";
public Guid Id => new Guid("1b72dcd5-d031-4757-8a9f-8d2fb18c59e2");
public string Author => "Natalia Portillo";
public bool Identify(IMediaImage imagePlugin, Partition partition)
{
if(16 + partition.Start >= partition.End)
@@ -232,148 +209,5 @@ namespace Aaru.Filesystems
information = sb.ToString();
}
/// <summary>BIOS Parameter Block, at sector 0, little-endian</summary>
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct BiosParameterBlock
{
/// <summary>0x000, Jump to boot code</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public readonly byte[] jump;
/// <summary>0x003, OEM Name, 8 bytes, space-padded</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public readonly byte[] oem_name;
/// <summary>0x00B, Bytes per sector</summary>
public readonly ushort bps;
/// <summary>0x00D, Sectors per cluster</summary>
public readonly byte spc;
/// <summary>0x00E, Reserved sectors between BPB and... does it have sense in HPFS?</summary>
public readonly ushort rsectors;
/// <summary>0x010, Number of FATs... seriously?</summary>
public readonly byte fats_no;
/// <summary>0x011, Number of entries on root directory... ok</summary>
public readonly ushort root_ent;
/// <summary>0x013, Sectors in volume... doubt it</summary>
public readonly ushort sectors;
/// <summary>0x015, Media descriptor</summary>
public readonly byte media;
/// <summary>0x016, Sectors per FAT... again</summary>
public readonly ushort spfat;
/// <summary>0x018, Sectors per track... you're kidding</summary>
public readonly ushort sptrk;
/// <summary>0x01A, Heads... stop!</summary>
public readonly ushort heads;
/// <summary>0x01C, Hidden sectors before BPB</summary>
public readonly uint hsectors;
/// <summary>0x024, Sectors in volume if &gt; 65535...</summary>
public readonly uint big_sectors;
/// <summary>0x028, Drive number</summary>
public readonly byte drive_no;
/// <summary>0x029, Volume flags?</summary>
public readonly byte nt_flags;
/// <summary>0x02A, EPB signature, 0x29</summary>
public readonly byte signature;
/// <summary>0x02B, Volume serial number</summary>
public readonly uint serial_no;
/// <summary>0x02F, Volume label, 11 bytes, space-padded</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
public readonly byte[] volume_label;
/// <summary>0x03A, Filesystem type, 8 bytes, space-padded ("HPFS ")</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public readonly byte[] fs_type;
/// <summary>Boot code.</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 442)]
public readonly byte[] boot_code;
/// <summary>0x1F8, Unknown</summary>
public readonly uint unknown;
/// <summary>0x1FC, Unknown</summary>
public readonly ushort unknown2;
/// <summary>0x1FE, 0xAA55</summary>
public readonly ushort signature2;
}
/// <summary>Media Information Block, at sector 13, big-endian</summary>
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct MediaInformationBlock
{
/// <summary>Block identifier "MEDINFO "</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public readonly byte[] blockId;
/// <summary>Volume label</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] volumeLabel;
/// <summary>Volume comment</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 160)]
public readonly byte[] comment;
/// <summary>Volume serial number</summary>
public readonly uint serial;
/// <summary>Volume creation date, DOS format</summary>
public readonly ushort creationDate;
/// <summary>Volume creation time, DOS format</summary>
public readonly ushort creationTime;
/// <summary>Codepage type: 1 ASCII, 2 EBCDIC</summary>
public readonly ushort codepageType;
/// <summary>Codepage</summary>
public readonly ushort codepage;
/// <summary>RPS level</summary>
public readonly uint rps;
/// <summary>Coincides with bytes per sector, and bytes per cluster, need more media</summary>
public readonly ushort bps;
/// <summary>Coincides with bytes per sector, and bytes per cluster, need more media</summary>
public readonly ushort bpc;
/// <summary>Unknown, empty</summary>
public readonly uint unknown2;
/// <summary>Sectors (or clusters)</summary>
public readonly uint sectors;
/// <summary>Unknown, coincides with bps but changing it makes nothing</summary>
public readonly uint unknown3;
/// <summary>Empty?</summary>
public readonly ulong unknown4;
/// <summary>Format major version</summary>
public readonly ushort major;
/// <summary>Format minor version</summary>
public readonly ushort minor;
/// <summary>Empty?</summary>
public readonly uint unknown5;
/// <summary>Unknown, non-empty</summary>
public readonly uint unknown6;
/// <summary>Empty</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)]
public readonly byte[] filler;
}
/// <summary>Volume Information Block, at sector 14, big-endian</summary>
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct VolumeInformationBlock
{
/// <summary>Block identifier "VOLINFO "</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public readonly byte[] blockId;
/// <summary>Unknown</summary>
public readonly uint unknown;
/// <summary>Unknown</summary>
public readonly uint unknown2;
/// <summary>Unknown</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)]
public readonly byte[] unknown3;
/// <summary>Unknown, space-padded string</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] unknown4;
/// <summary>Owner, space-padded string</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] owner;
/// <summary>Unknown, space-padded string</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public readonly byte[] unknown5;
/// <summary>Unknown, empty?</summary>
public readonly uint unknown6;
/// <summary>Maximum percent full</summary>
public readonly ushort percentFull;
/// <summary>Unknown, empty?</summary>
public readonly ushort unknown7;
/// <summary>Empty</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 384)]
public readonly byte[] filler;
}
}
}

View File

@@ -0,0 +1,182 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : Structs.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : High Performance Optical File System plugin.
//
// --[ Description ] ----------------------------------------------------------
//
// High Performance Optical File System structures.
//
// --[ 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-2020 Natalia Portillo
// ****************************************************************************/
using System.Runtime.InteropServices;
namespace Aaru.Filesystems
{
public partial class HPOFS
{
/// <summary>BIOS Parameter Block, at sector 0, little-endian</summary>
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct BiosParameterBlock
{
/// <summary>0x000, Jump to boot code</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public readonly byte[] jump;
/// <summary>0x003, OEM Name, 8 bytes, space-padded</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public readonly byte[] oem_name;
/// <summary>0x00B, Bytes per sector</summary>
public readonly ushort bps;
/// <summary>0x00D, Sectors per cluster</summary>
public readonly byte spc;
/// <summary>0x00E, Reserved sectors between BPB and... does it have sense in HPFS?</summary>
public readonly ushort rsectors;
/// <summary>0x010, Number of FATs... seriously?</summary>
public readonly byte fats_no;
/// <summary>0x011, Number of entries on root directory... ok</summary>
public readonly ushort root_ent;
/// <summary>0x013, Sectors in volume... doubt it</summary>
public readonly ushort sectors;
/// <summary>0x015, Media descriptor</summary>
public readonly byte media;
/// <summary>0x016, Sectors per FAT... again</summary>
public readonly ushort spfat;
/// <summary>0x018, Sectors per track... you're kidding</summary>
public readonly ushort sptrk;
/// <summary>0x01A, Heads... stop!</summary>
public readonly ushort heads;
/// <summary>0x01C, Hidden sectors before BPB</summary>
public readonly uint hsectors;
/// <summary>0x024, Sectors in volume if &gt; 65535...</summary>
public readonly uint big_sectors;
/// <summary>0x028, Drive number</summary>
public readonly byte drive_no;
/// <summary>0x029, Volume flags?</summary>
public readonly byte nt_flags;
/// <summary>0x02A, EPB signature, 0x29</summary>
public readonly byte signature;
/// <summary>0x02B, Volume serial number</summary>
public readonly uint serial_no;
/// <summary>0x02F, Volume label, 11 bytes, space-padded</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
public readonly byte[] volume_label;
/// <summary>0x03A, Filesystem type, 8 bytes, space-padded ("HPFS ")</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public readonly byte[] fs_type;
/// <summary>Boot code.</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 442)]
public readonly byte[] boot_code;
/// <summary>0x1F8, Unknown</summary>
public readonly uint unknown;
/// <summary>0x1FC, Unknown</summary>
public readonly ushort unknown2;
/// <summary>0x1FE, 0xAA55</summary>
public readonly ushort signature2;
}
/// <summary>Media Information Block, at sector 13, big-endian</summary>
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct MediaInformationBlock
{
/// <summary>Block identifier "MEDINFO "</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public readonly byte[] blockId;
/// <summary>Volume label</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] volumeLabel;
/// <summary>Volume comment</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 160)]
public readonly byte[] comment;
/// <summary>Volume serial number</summary>
public readonly uint serial;
/// <summary>Volume creation date, DOS format</summary>
public readonly ushort creationDate;
/// <summary>Volume creation time, DOS format</summary>
public readonly ushort creationTime;
/// <summary>Codepage type: 1 ASCII, 2 EBCDIC</summary>
public readonly ushort codepageType;
/// <summary>Codepage</summary>
public readonly ushort codepage;
/// <summary>RPS level</summary>
public readonly uint rps;
/// <summary>Coincides with bytes per sector, and bytes per cluster, need more media</summary>
public readonly ushort bps;
/// <summary>Coincides with bytes per sector, and bytes per cluster, need more media</summary>
public readonly ushort bpc;
/// <summary>Unknown, empty</summary>
public readonly uint unknown2;
/// <summary>Sectors (or clusters)</summary>
public readonly uint sectors;
/// <summary>Unknown, coincides with bps but changing it makes nothing</summary>
public readonly uint unknown3;
/// <summary>Empty?</summary>
public readonly ulong unknown4;
/// <summary>Format major version</summary>
public readonly ushort major;
/// <summary>Format minor version</summary>
public readonly ushort minor;
/// <summary>Empty?</summary>
public readonly uint unknown5;
/// <summary>Unknown, non-empty</summary>
public readonly uint unknown6;
/// <summary>Empty</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)]
public readonly byte[] filler;
}
/// <summary>Volume Information Block, at sector 14, big-endian</summary>
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct VolumeInformationBlock
{
/// <summary>Block identifier "VOLINFO "</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public readonly byte[] blockId;
/// <summary>Unknown</summary>
public readonly uint unknown;
/// <summary>Unknown</summary>
public readonly uint unknown2;
/// <summary>Unknown</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)]
public readonly byte[] unknown3;
/// <summary>Unknown, space-padded string</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] unknown4;
/// <summary>Owner, space-padded string</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] owner;
/// <summary>Unknown, space-padded string</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public readonly byte[] unknown5;
/// <summary>Unknown, empty?</summary>
public readonly uint unknown6;
/// <summary>Maximum percent full</summary>
public readonly ushort percentFull;
/// <summary>Unknown, empty?</summary>
public readonly ushort unknown7;
/// <summary>Empty</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 384)]
public readonly byte[] filler;
}
}
}

View File

@@ -1 +1 @@
{"projectId":"3d08ad4b-d856-4bee-8f9d-91bc47feb013","projectName":"Aaru"}
{"projectId":"3d08ad4b-d856-4bee-8f9d-91bc47feb013","projectName":"DiscImageChef","neverTrack":false}