diff --git a/.idea/.idea.Aaru/.idea/contentModel.xml b/.idea/.idea.Aaru/.idea/contentModel.xml index d43beb218..79ff8c7a5 100644 --- a/.idea/.idea.Aaru/.idea/contentModel.xml +++ b/.idea/.idea.Aaru/.idea/contentModel.xml @@ -3,8 +3,10 @@ + + @@ -769,7 +771,12 @@ - + + + + + + diff --git a/Aaru.Filesystems/Aaru.Filesystems.csproj b/Aaru.Filesystems/Aaru.Filesystems.csproj index 8b9f7bb12..220d3092d 100644 --- a/Aaru.Filesystems/Aaru.Filesystems.csproj +++ b/Aaru.Filesystems/Aaru.Filesystems.csproj @@ -79,7 +79,10 @@ - + + + + diff --git a/Aaru.Filesystems/HPOFS/Consts.cs b/Aaru.Filesystems/HPOFS/Consts.cs new file mode 100644 index 000000000..4de35c099 --- /dev/null +++ b/Aaru.Filesystems/HPOFS/Consts.cs @@ -0,0 +1,50 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Consts.cs +// Author(s) : Natalia Portillo +// +// 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 . +// +// ---------------------------------------------------------------------------- +// 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 + }; + } +} \ No newline at end of file diff --git a/Aaru.Filesystems/HPOFS/HPOFS.cs b/Aaru.Filesystems/HPOFS/HPOFS.cs new file mode 100644 index 000000000..6c2fb6576 --- /dev/null +++ b/Aaru.Filesystems/HPOFS/HPOFS.cs @@ -0,0 +1,50 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : HPOFS.cs +// Author(s) : Natalia Portillo +// +// 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 . +// +// ---------------------------------------------------------------------------- +// 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"; + } +} \ No newline at end of file diff --git a/Aaru.Filesystems/HPOFS.cs b/Aaru.Filesystems/HPOFS/Info.cs similarity index 58% rename from Aaru.Filesystems/HPOFS.cs rename to Aaru.Filesystems/HPOFS/Info.cs index 5ff58e638..a92702f92 100644 --- a/Aaru.Filesystems/HPOFS.cs +++ b/Aaru.Filesystems/HPOFS/Info.cs @@ -1,8 +1,8 @@ -// /*************************************************************************** +// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // -// Filename : HPOFS.cs +// Filename : Info.cs // Author(s) : Natalia Portillo // // 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(); } - - /// BIOS Parameter Block, at sector 0, little-endian - [StructLayout(LayoutKind.Sequential, Pack = 1)] - struct BiosParameterBlock - { - /// 0x000, Jump to boot code - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] - public readonly byte[] jump; - /// 0x003, OEM Name, 8 bytes, space-padded - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public readonly byte[] oem_name; - /// 0x00B, Bytes per sector - public readonly ushort bps; - /// 0x00D, Sectors per cluster - public readonly byte spc; - /// 0x00E, Reserved sectors between BPB and... does it have sense in HPFS? - public readonly ushort rsectors; - /// 0x010, Number of FATs... seriously? - public readonly byte fats_no; - /// 0x011, Number of entries on root directory... ok - public readonly ushort root_ent; - /// 0x013, Sectors in volume... doubt it - public readonly ushort sectors; - /// 0x015, Media descriptor - public readonly byte media; - /// 0x016, Sectors per FAT... again - public readonly ushort spfat; - /// 0x018, Sectors per track... you're kidding - public readonly ushort sptrk; - /// 0x01A, Heads... stop! - public readonly ushort heads; - /// 0x01C, Hidden sectors before BPB - public readonly uint hsectors; - /// 0x024, Sectors in volume if > 65535... - public readonly uint big_sectors; - /// 0x028, Drive number - public readonly byte drive_no; - /// 0x029, Volume flags? - public readonly byte nt_flags; - /// 0x02A, EPB signature, 0x29 - public readonly byte signature; - /// 0x02B, Volume serial number - public readonly uint serial_no; - /// 0x02F, Volume label, 11 bytes, space-padded - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)] - public readonly byte[] volume_label; - /// 0x03A, Filesystem type, 8 bytes, space-padded ("HPFS ") - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public readonly byte[] fs_type; - /// Boot code. - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 442)] - public readonly byte[] boot_code; - /// 0x1F8, Unknown - public readonly uint unknown; - /// 0x1FC, Unknown - public readonly ushort unknown2; - /// 0x1FE, 0xAA55 - public readonly ushort signature2; - } - - /// Media Information Block, at sector 13, big-endian - [StructLayout(LayoutKind.Sequential, Pack = 1)] - struct MediaInformationBlock - { - /// Block identifier "MEDINFO " - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public readonly byte[] blockId; - /// Volume label - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] - public readonly byte[] volumeLabel; - /// Volume comment - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 160)] - public readonly byte[] comment; - /// Volume serial number - public readonly uint serial; - /// Volume creation date, DOS format - public readonly ushort creationDate; - /// Volume creation time, DOS format - public readonly ushort creationTime; - /// Codepage type: 1 ASCII, 2 EBCDIC - public readonly ushort codepageType; - /// Codepage - public readonly ushort codepage; - /// RPS level - public readonly uint rps; - /// Coincides with bytes per sector, and bytes per cluster, need more media - public readonly ushort bps; - /// Coincides with bytes per sector, and bytes per cluster, need more media - public readonly ushort bpc; - /// Unknown, empty - public readonly uint unknown2; - /// Sectors (or clusters) - public readonly uint sectors; - /// Unknown, coincides with bps but changing it makes nothing - public readonly uint unknown3; - /// Empty? - public readonly ulong unknown4; - /// Format major version - public readonly ushort major; - /// Format minor version - public readonly ushort minor; - /// Empty? - public readonly uint unknown5; - /// Unknown, non-empty - public readonly uint unknown6; - /// Empty - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] - public readonly byte[] filler; - } - - /// Volume Information Block, at sector 14, big-endian - [StructLayout(LayoutKind.Sequential, Pack = 1)] - struct VolumeInformationBlock - { - /// Block identifier "VOLINFO " - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public readonly byte[] blockId; - /// Unknown - public readonly uint unknown; - /// Unknown - public readonly uint unknown2; - /// Unknown - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)] - public readonly byte[] unknown3; - /// Unknown, space-padded string - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] - public readonly byte[] unknown4; - /// Owner, space-padded string - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] - public readonly byte[] owner; - /// Unknown, space-padded string - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public readonly byte[] unknown5; - /// Unknown, empty? - public readonly uint unknown6; - /// Maximum percent full - public readonly ushort percentFull; - /// Unknown, empty? - public readonly ushort unknown7; - /// Empty - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 384)] - public readonly byte[] filler; - } } } \ No newline at end of file diff --git a/Aaru.Filesystems/HPOFS/Structs.cs b/Aaru.Filesystems/HPOFS/Structs.cs new file mode 100644 index 000000000..a7ff5fd0d --- /dev/null +++ b/Aaru.Filesystems/HPOFS/Structs.cs @@ -0,0 +1,182 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Structs.cs +// Author(s) : Natalia Portillo +// +// 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 . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2020 Natalia Portillo +// ****************************************************************************/ + +using System.Runtime.InteropServices; + +namespace Aaru.Filesystems +{ + public partial class HPOFS + { + /// BIOS Parameter Block, at sector 0, little-endian + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct BiosParameterBlock + { + /// 0x000, Jump to boot code + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public readonly byte[] jump; + /// 0x003, OEM Name, 8 bytes, space-padded + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public readonly byte[] oem_name; + /// 0x00B, Bytes per sector + public readonly ushort bps; + /// 0x00D, Sectors per cluster + public readonly byte spc; + /// 0x00E, Reserved sectors between BPB and... does it have sense in HPFS? + public readonly ushort rsectors; + /// 0x010, Number of FATs... seriously? + public readonly byte fats_no; + /// 0x011, Number of entries on root directory... ok + public readonly ushort root_ent; + /// 0x013, Sectors in volume... doubt it + public readonly ushort sectors; + /// 0x015, Media descriptor + public readonly byte media; + /// 0x016, Sectors per FAT... again + public readonly ushort spfat; + /// 0x018, Sectors per track... you're kidding + public readonly ushort sptrk; + /// 0x01A, Heads... stop! + public readonly ushort heads; + /// 0x01C, Hidden sectors before BPB + public readonly uint hsectors; + /// 0x024, Sectors in volume if > 65535... + public readonly uint big_sectors; + /// 0x028, Drive number + public readonly byte drive_no; + /// 0x029, Volume flags? + public readonly byte nt_flags; + /// 0x02A, EPB signature, 0x29 + public readonly byte signature; + /// 0x02B, Volume serial number + public readonly uint serial_no; + /// 0x02F, Volume label, 11 bytes, space-padded + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)] + public readonly byte[] volume_label; + /// 0x03A, Filesystem type, 8 bytes, space-padded ("HPFS ") + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public readonly byte[] fs_type; + /// Boot code. + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 442)] + public readonly byte[] boot_code; + /// 0x1F8, Unknown + public readonly uint unknown; + /// 0x1FC, Unknown + public readonly ushort unknown2; + /// 0x1FE, 0xAA55 + public readonly ushort signature2; + } + + /// Media Information Block, at sector 13, big-endian + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct MediaInformationBlock + { + /// Block identifier "MEDINFO " + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public readonly byte[] blockId; + /// Volume label + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public readonly byte[] volumeLabel; + /// Volume comment + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 160)] + public readonly byte[] comment; + /// Volume serial number + public readonly uint serial; + /// Volume creation date, DOS format + public readonly ushort creationDate; + /// Volume creation time, DOS format + public readonly ushort creationTime; + /// Codepage type: 1 ASCII, 2 EBCDIC + public readonly ushort codepageType; + /// Codepage + public readonly ushort codepage; + /// RPS level + public readonly uint rps; + /// Coincides with bytes per sector, and bytes per cluster, need more media + public readonly ushort bps; + /// Coincides with bytes per sector, and bytes per cluster, need more media + public readonly ushort bpc; + /// Unknown, empty + public readonly uint unknown2; + /// Sectors (or clusters) + public readonly uint sectors; + /// Unknown, coincides with bps but changing it makes nothing + public readonly uint unknown3; + /// Empty? + public readonly ulong unknown4; + /// Format major version + public readonly ushort major; + /// Format minor version + public readonly ushort minor; + /// Empty? + public readonly uint unknown5; + /// Unknown, non-empty + public readonly uint unknown6; + /// Empty + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] + public readonly byte[] filler; + } + + /// Volume Information Block, at sector 14, big-endian + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct VolumeInformationBlock + { + /// Block identifier "VOLINFO " + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public readonly byte[] blockId; + /// Unknown + public readonly uint unknown; + /// Unknown + public readonly uint unknown2; + /// Unknown + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)] + public readonly byte[] unknown3; + /// Unknown, space-padded string + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public readonly byte[] unknown4; + /// Owner, space-padded string + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public readonly byte[] owner; + /// Unknown, space-padded string + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public readonly byte[] unknown5; + /// Unknown, empty? + public readonly uint unknown6; + /// Maximum percent full + public readonly ushort percentFull; + /// Unknown, empty? + public readonly ushort unknown7; + /// Empty + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 384)] + public readonly byte[] filler; + } + } +} \ No newline at end of file diff --git a/codealike.json b/codealike.json index 3de5babb4..958f2854f 100644 --- a/codealike.json +++ b/codealike.json @@ -1 +1 @@ -{"projectId":"3d08ad4b-d856-4bee-8f9d-91bc47feb013","projectName":"Aaru"} \ No newline at end of file +{"projectId":"3d08ad4b-d856-4bee-8f9d-91bc47feb013","projectName":"DiscImageChef","neverTrack":false} \ No newline at end of file