Files
Aaru/Aaru.Partitions/DEC.cs

123 lines
4.3 KiB
C#
Raw Normal View History

2017-05-19 20:28:49 +01:00
// /***************************************************************************
2020-02-27 12:31:25 +00:00
// Aaru Data Preservation Suite
* DiscImageChef.Helpers/BigEndianStructure.cs: * DiscImageChef.Helpers/DiscImageChef.Helpers.csproj: Added code that directly marshals from a big-endian byte array. But untested with nested structures. * DiscImageChef.Partitions/Acorn.cs: Added support for Acorn FileCore partition, closes #4. * DiscImageChef.Partitions/BSD.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/DEC.cs: Added support for DEC disklabels, closes #11. * DiscImageChef.Partitions/DragonFlyBSD.cs: Added support for DragonFly BSD 64-bit disklabels. * DiscImageChef.Partitions/PC98.cs: Added support for NEC PC-9800 partitions. * DiscImageChef.Partitions/RioKarma.cs: Added support for Rio Karma partitions. * DiscImageChef.Partitions/SGI.cs: Added support for SGI DVHs, closes #9. * DiscImageChef.Partitions/UNIX.cs: Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * TODO: * README.md: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: Added support for Acorn FileCore partition, closes #4. Added support for DEC disklabels, closes #11. Added support for SGI DVHs, closes #9. Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Added support for DragonFly BSD 64-bit disklabels. Added support for NEC PC-9800 partitions. Added support for Rio Karma partitions. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/GPT.cs: Added new partition type UUIDs. * DiscImageChef.Partitions/MBR.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/Sun.cs: Added new partition types. Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
// ----------------------------------------------------------------------------
//
// Filename : DEC.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Partitioning scheme plugins.
//
// --[ Description ] ----------------------------------------------------------
//
// Manages DEC disklabels.
//
// --[ 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/>.
//
// ----------------------------------------------------------------------------
2024-12-19 10:45:18 +00:00
// Copyright © 2011-2025 Natalia Portillo
* DiscImageChef.Helpers/BigEndianStructure.cs: * DiscImageChef.Helpers/DiscImageChef.Helpers.csproj: Added code that directly marshals from a big-endian byte array. But untested with nested structures. * DiscImageChef.Partitions/Acorn.cs: Added support for Acorn FileCore partition, closes #4. * DiscImageChef.Partitions/BSD.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/DEC.cs: Added support for DEC disklabels, closes #11. * DiscImageChef.Partitions/DragonFlyBSD.cs: Added support for DragonFly BSD 64-bit disklabels. * DiscImageChef.Partitions/PC98.cs: Added support for NEC PC-9800 partitions. * DiscImageChef.Partitions/RioKarma.cs: Added support for Rio Karma partitions. * DiscImageChef.Partitions/SGI.cs: Added support for SGI DVHs, closes #9. * DiscImageChef.Partitions/UNIX.cs: Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * TODO: * README.md: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: Added support for Acorn FileCore partition, closes #4. Added support for DEC disklabels, closes #11. Added support for SGI DVHs, closes #9. Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Added support for DragonFly BSD 64-bit disklabels. Added support for NEC PC-9800 partitions. Added support for Rio Karma partitions. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/GPT.cs: Added new partition type UUIDs. * DiscImageChef.Partitions/MBR.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/Sun.cs: Added new partition types. Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
// ****************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
* DiscImageChef.Helpers/BigEndianStructure.cs: * DiscImageChef.Helpers/DiscImageChef.Helpers.csproj: Added code that directly marshals from a big-endian byte array. But untested with nested structures. * DiscImageChef.Partitions/Acorn.cs: Added support for Acorn FileCore partition, closes #4. * DiscImageChef.Partitions/BSD.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/DEC.cs: Added support for DEC disklabels, closes #11. * DiscImageChef.Partitions/DragonFlyBSD.cs: Added support for DragonFly BSD 64-bit disklabels. * DiscImageChef.Partitions/PC98.cs: Added support for NEC PC-9800 partitions. * DiscImageChef.Partitions/RioKarma.cs: Added support for Rio Karma partitions. * DiscImageChef.Partitions/SGI.cs: Added support for SGI DVHs, closes #9. * DiscImageChef.Partitions/UNIX.cs: Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * TODO: * README.md: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: Added support for Acorn FileCore partition, closes #4. Added support for DEC disklabels, closes #11. Added support for SGI DVHs, closes #9. Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Added support for DragonFly BSD 64-bit disklabels. Added support for NEC PC-9800 partitions. Added support for Rio Karma partitions. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/GPT.cs: Added new partition type UUIDs. * DiscImageChef.Partitions/MBR.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/Sun.cs: Added new partition types. Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
using System.Runtime.InteropServices;
using Aaru.CommonTypes.Enums;
2020-02-27 00:33:26 +00:00
using Aaru.CommonTypes.Interfaces;
using Marshal = Aaru.Helpers.Marshal;
* DiscImageChef.Helpers/BigEndianStructure.cs: * DiscImageChef.Helpers/DiscImageChef.Helpers.csproj: Added code that directly marshals from a big-endian byte array. But untested with nested structures. * DiscImageChef.Partitions/Acorn.cs: Added support for Acorn FileCore partition, closes #4. * DiscImageChef.Partitions/BSD.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/DEC.cs: Added support for DEC disklabels, closes #11. * DiscImageChef.Partitions/DragonFlyBSD.cs: Added support for DragonFly BSD 64-bit disklabels. * DiscImageChef.Partitions/PC98.cs: Added support for NEC PC-9800 partitions. * DiscImageChef.Partitions/RioKarma.cs: Added support for Rio Karma partitions. * DiscImageChef.Partitions/SGI.cs: Added support for SGI DVHs, closes #9. * DiscImageChef.Partitions/UNIX.cs: Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * TODO: * README.md: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: Added support for Acorn FileCore partition, closes #4. Added support for DEC disklabels, closes #11. Added support for SGI DVHs, closes #9. Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Added support for DragonFly BSD 64-bit disklabels. Added support for NEC PC-9800 partitions. Added support for Rio Karma partitions. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/GPT.cs: Added new partition type UUIDs. * DiscImageChef.Partitions/MBR.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/Sun.cs: Added new partition types. Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
namespace Aaru.Partitions;
2022-03-06 13:29:38 +00:00
/// <inheritdoc />
/// <summary>Implements decoding of DEC disklabels</summary>
public sealed class DEC : IPartition
{
const int PT_MAGIC = 0x032957;
const int PT_VALID = 1;
* DiscImageChef.Helpers/BigEndianStructure.cs: * DiscImageChef.Helpers/DiscImageChef.Helpers.csproj: Added code that directly marshals from a big-endian byte array. But untested with nested structures. * DiscImageChef.Partitions/Acorn.cs: Added support for Acorn FileCore partition, closes #4. * DiscImageChef.Partitions/BSD.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/DEC.cs: Added support for DEC disklabels, closes #11. * DiscImageChef.Partitions/DragonFlyBSD.cs: Added support for DragonFly BSD 64-bit disklabels. * DiscImageChef.Partitions/PC98.cs: Added support for NEC PC-9800 partitions. * DiscImageChef.Partitions/RioKarma.cs: Added support for Rio Karma partitions. * DiscImageChef.Partitions/SGI.cs: Added support for SGI DVHs, closes #9. * DiscImageChef.Partitions/UNIX.cs: Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * TODO: * README.md: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: Added support for Acorn FileCore partition, closes #4. Added support for DEC disklabels, closes #11. Added support for SGI DVHs, closes #9. Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Added support for DragonFly BSD 64-bit disklabels. Added support for NEC PC-9800 partitions. Added support for Rio Karma partitions. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/GPT.cs: Added new partition type UUIDs. * DiscImageChef.Partitions/MBR.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/Sun.cs: Added new partition types. Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
#region Nested type: Label
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct Label
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 440)]
public readonly byte[] padding;
public readonly int pt_magic;
public readonly int pt_valid;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public readonly Partition[] pt_part;
}
#endregion
#region Nested type: Partition
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct Partition
{
public readonly int pi_nblocks;
public readonly uint pi_blkoff;
}
#endregion
#region IPartition Members
2022-03-06 13:29:38 +00:00
/// <inheritdoc />
public string Name => Localization.DEC_Name;
2022-03-06 13:29:38 +00:00
/// <inheritdoc />
public Guid Id => new("58CEC3B7-3B93-4D47-86EE-D6DADE9D444F");
2022-03-06 13:29:38 +00:00
/// <inheritdoc />
2023-10-05 01:52:48 +01:00
public string Author => Authors.NATALIA_PORTILLO;
2022-03-06 13:29:38 +00:00
/// <inheritdoc />
2022-03-07 07:36:44 +00:00
public bool GetInformation(IMediaImage imagePlugin, out List<CommonTypes.Partition> partitions, ulong sectorOffset)
2022-03-06 13:29:38 +00:00
{
2024-05-01 04:39:38 +01:00
partitions = [];
2020-02-29 18:03:35 +00:00
2024-05-01 04:05:22 +01:00
if(31 + sectorOffset >= imagePlugin.Info.Sectors) return false;
* DiscImageChef.Helpers/BigEndianStructure.cs: * DiscImageChef.Helpers/DiscImageChef.Helpers.csproj: Added code that directly marshals from a big-endian byte array. But untested with nested structures. * DiscImageChef.Partitions/Acorn.cs: Added support for Acorn FileCore partition, closes #4. * DiscImageChef.Partitions/BSD.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/DEC.cs: Added support for DEC disklabels, closes #11. * DiscImageChef.Partitions/DragonFlyBSD.cs: Added support for DragonFly BSD 64-bit disklabels. * DiscImageChef.Partitions/PC98.cs: Added support for NEC PC-9800 partitions. * DiscImageChef.Partitions/RioKarma.cs: Added support for Rio Karma partitions. * DiscImageChef.Partitions/SGI.cs: Added support for SGI DVHs, closes #9. * DiscImageChef.Partitions/UNIX.cs: Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * TODO: * README.md: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: Added support for Acorn FileCore partition, closes #4. Added support for DEC disklabels, closes #11. Added support for SGI DVHs, closes #9. Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Added support for DragonFly BSD 64-bit disklabels. Added support for NEC PC-9800 partitions. Added support for Rio Karma partitions. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/GPT.cs: Added new partition type UUIDs. * DiscImageChef.Partitions/MBR.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/Sun.cs: Added new partition types. Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
ErrorNumber errno = imagePlugin.ReadSector(31 + sectorOffset, false, out byte[] sector, out _);
* DiscImageChef.Helpers/BigEndianStructure.cs: * DiscImageChef.Helpers/DiscImageChef.Helpers.csproj: Added code that directly marshals from a big-endian byte array. But untested with nested structures. * DiscImageChef.Partitions/Acorn.cs: Added support for Acorn FileCore partition, closes #4. * DiscImageChef.Partitions/BSD.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/DEC.cs: Added support for DEC disklabels, closes #11. * DiscImageChef.Partitions/DragonFlyBSD.cs: Added support for DragonFly BSD 64-bit disklabels. * DiscImageChef.Partitions/PC98.cs: Added support for NEC PC-9800 partitions. * DiscImageChef.Partitions/RioKarma.cs: Added support for Rio Karma partitions. * DiscImageChef.Partitions/SGI.cs: Added support for SGI DVHs, closes #9. * DiscImageChef.Partitions/UNIX.cs: Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * TODO: * README.md: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: Added support for Acorn FileCore partition, closes #4. Added support for DEC disklabels, closes #11. Added support for SGI DVHs, closes #9. Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Added support for DragonFly BSD 64-bit disklabels. Added support for NEC PC-9800 partitions. Added support for Rio Karma partitions. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/GPT.cs: Added new partition type UUIDs. * DiscImageChef.Partitions/MBR.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/Sun.cs: Added new partition types. Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
2024-05-01 04:05:22 +01:00
if(errno != ErrorNumber.NoError || sector.Length < 512) return false;
* DiscImageChef.Helpers/BigEndianStructure.cs: * DiscImageChef.Helpers/DiscImageChef.Helpers.csproj: Added code that directly marshals from a big-endian byte array. But untested with nested structures. * DiscImageChef.Partitions/Acorn.cs: Added support for Acorn FileCore partition, closes #4. * DiscImageChef.Partitions/BSD.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/DEC.cs: Added support for DEC disklabels, closes #11. * DiscImageChef.Partitions/DragonFlyBSD.cs: Added support for DragonFly BSD 64-bit disklabels. * DiscImageChef.Partitions/PC98.cs: Added support for NEC PC-9800 partitions. * DiscImageChef.Partitions/RioKarma.cs: Added support for Rio Karma partitions. * DiscImageChef.Partitions/SGI.cs: Added support for SGI DVHs, closes #9. * DiscImageChef.Partitions/UNIX.cs: Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * TODO: * README.md: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: Added support for Acorn FileCore partition, closes #4. Added support for DEC disklabels, closes #11. Added support for SGI DVHs, closes #9. Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Added support for DragonFly BSD 64-bit disklabels. Added support for NEC PC-9800 partitions. Added support for Rio Karma partitions. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/GPT.cs: Added new partition type UUIDs. * DiscImageChef.Partitions/MBR.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/Sun.cs: Added new partition types. Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
2022-03-06 13:29:38 +00:00
Label table = Marshal.ByteArrayToStructureLittleEndian<Label>(sector);
* DiscImageChef.Helpers/BigEndianStructure.cs: * DiscImageChef.Helpers/DiscImageChef.Helpers.csproj: Added code that directly marshals from a big-endian byte array. But untested with nested structures. * DiscImageChef.Partitions/Acorn.cs: Added support for Acorn FileCore partition, closes #4. * DiscImageChef.Partitions/BSD.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/DEC.cs: Added support for DEC disklabels, closes #11. * DiscImageChef.Partitions/DragonFlyBSD.cs: Added support for DragonFly BSD 64-bit disklabels. * DiscImageChef.Partitions/PC98.cs: Added support for NEC PC-9800 partitions. * DiscImageChef.Partitions/RioKarma.cs: Added support for Rio Karma partitions. * DiscImageChef.Partitions/SGI.cs: Added support for SGI DVHs, closes #9. * DiscImageChef.Partitions/UNIX.cs: Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * TODO: * README.md: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: Added support for Acorn FileCore partition, closes #4. Added support for DEC disklabels, closes #11. Added support for SGI DVHs, closes #9. Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Added support for DragonFly BSD 64-bit disklabels. Added support for NEC PC-9800 partitions. Added support for Rio Karma partitions. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/GPT.cs: Added new partition type UUIDs. * DiscImageChef.Partitions/MBR.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/Sun.cs: Added new partition types. Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
2024-05-01 04:05:22 +01:00
if(table.pt_magic != PT_MAGIC || table.pt_valid != PT_VALID) return false;
* DiscImageChef.Helpers/BigEndianStructure.cs: * DiscImageChef.Helpers/DiscImageChef.Helpers.csproj: Added code that directly marshals from a big-endian byte array. But untested with nested structures. * DiscImageChef.Partitions/Acorn.cs: Added support for Acorn FileCore partition, closes #4. * DiscImageChef.Partitions/BSD.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/DEC.cs: Added support for DEC disklabels, closes #11. * DiscImageChef.Partitions/DragonFlyBSD.cs: Added support for DragonFly BSD 64-bit disklabels. * DiscImageChef.Partitions/PC98.cs: Added support for NEC PC-9800 partitions. * DiscImageChef.Partitions/RioKarma.cs: Added support for Rio Karma partitions. * DiscImageChef.Partitions/SGI.cs: Added support for SGI DVHs, closes #9. * DiscImageChef.Partitions/UNIX.cs: Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * TODO: * README.md: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: Added support for Acorn FileCore partition, closes #4. Added support for DEC disklabels, closes #11. Added support for SGI DVHs, closes #9. Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Added support for DragonFly BSD 64-bit disklabels. Added support for NEC PC-9800 partitions. Added support for Rio Karma partitions. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/GPT.cs: Added new partition type UUIDs. * DiscImageChef.Partitions/MBR.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/Sun.cs: Added new partition types. Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
2022-03-06 13:29:38 +00:00
ulong counter = 0;
* DiscImageChef.Helpers/BigEndianStructure.cs: * DiscImageChef.Helpers/DiscImageChef.Helpers.csproj: Added code that directly marshals from a big-endian byte array. But untested with nested structures. * DiscImageChef.Partitions/Acorn.cs: Added support for Acorn FileCore partition, closes #4. * DiscImageChef.Partitions/BSD.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/DEC.cs: Added support for DEC disklabels, closes #11. * DiscImageChef.Partitions/DragonFlyBSD.cs: Added support for DragonFly BSD 64-bit disklabels. * DiscImageChef.Partitions/PC98.cs: Added support for NEC PC-9800 partitions. * DiscImageChef.Partitions/RioKarma.cs: Added support for Rio Karma partitions. * DiscImageChef.Partitions/SGI.cs: Added support for SGI DVHs, closes #9. * DiscImageChef.Partitions/UNIX.cs: Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * TODO: * README.md: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: Added support for Acorn FileCore partition, closes #4. Added support for DEC disklabels, closes #11. Added support for SGI DVHs, closes #9. Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Added support for DragonFly BSD 64-bit disklabels. Added support for NEC PC-9800 partitions. Added support for Rio Karma partitions. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/GPT.cs: Added new partition type UUIDs. * DiscImageChef.Partitions/MBR.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/Sun.cs: Added new partition types. Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
2022-03-06 13:29:38 +00:00
foreach(CommonTypes.Partition part in table.pt_part.Select(entry => new CommonTypes.Partition
{
Start = entry.pi_blkoff,
Offset = (ulong)(entry.pi_blkoff * sector.Length),
Size = (ulong)entry.pi_nblocks,
Length = (ulong)(entry.pi_nblocks * sector.Length),
Sequence = counter,
Scheme = Name
2024-05-01 04:05:22 +01:00
})
.Where(static part => part.Size > 0))
* DiscImageChef.Helpers/BigEndianStructure.cs: * DiscImageChef.Helpers/DiscImageChef.Helpers.csproj: Added code that directly marshals from a big-endian byte array. But untested with nested structures. * DiscImageChef.Partitions/Acorn.cs: Added support for Acorn FileCore partition, closes #4. * DiscImageChef.Partitions/BSD.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/DEC.cs: Added support for DEC disklabels, closes #11. * DiscImageChef.Partitions/DragonFlyBSD.cs: Added support for DragonFly BSD 64-bit disklabels. * DiscImageChef.Partitions/PC98.cs: Added support for NEC PC-9800 partitions. * DiscImageChef.Partitions/RioKarma.cs: Added support for Rio Karma partitions. * DiscImageChef.Partitions/SGI.cs: Added support for SGI DVHs, closes #9. * DiscImageChef.Partitions/UNIX.cs: Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * TODO: * README.md: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: Added support for Acorn FileCore partition, closes #4. Added support for DEC disklabels, closes #11. Added support for SGI DVHs, closes #9. Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Added support for DragonFly BSD 64-bit disklabels. Added support for NEC PC-9800 partitions. Added support for Rio Karma partitions. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/GPT.cs: Added new partition type UUIDs. * DiscImageChef.Partitions/MBR.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/Sun.cs: Added new partition types. Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
{
2022-03-06 13:29:38 +00:00
partitions.Add(part);
counter++;
* DiscImageChef.Helpers/BigEndianStructure.cs: * DiscImageChef.Helpers/DiscImageChef.Helpers.csproj: Added code that directly marshals from a big-endian byte array. But untested with nested structures. * DiscImageChef.Partitions/Acorn.cs: Added support for Acorn FileCore partition, closes #4. * DiscImageChef.Partitions/BSD.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/DEC.cs: Added support for DEC disklabels, closes #11. * DiscImageChef.Partitions/DragonFlyBSD.cs: Added support for DragonFly BSD 64-bit disklabels. * DiscImageChef.Partitions/PC98.cs: Added support for NEC PC-9800 partitions. * DiscImageChef.Partitions/RioKarma.cs: Added support for Rio Karma partitions. * DiscImageChef.Partitions/SGI.cs: Added support for SGI DVHs, closes #9. * DiscImageChef.Partitions/UNIX.cs: Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * TODO: * README.md: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: Added support for Acorn FileCore partition, closes #4. Added support for DEC disklabels, closes #11. Added support for SGI DVHs, closes #9. Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Added support for DragonFly BSD 64-bit disklabels. Added support for NEC PC-9800 partitions. Added support for Rio Karma partitions. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/GPT.cs: Added new partition type UUIDs. * DiscImageChef.Partitions/MBR.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/Sun.cs: Added new partition types. Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
}
2022-03-06 13:29:38 +00:00
return true;
}
#endregion
* DiscImageChef.Helpers/BigEndianStructure.cs: * DiscImageChef.Helpers/DiscImageChef.Helpers.csproj: Added code that directly marshals from a big-endian byte array. But untested with nested structures. * DiscImageChef.Partitions/Acorn.cs: Added support for Acorn FileCore partition, closes #4. * DiscImageChef.Partitions/BSD.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/DEC.cs: Added support for DEC disklabels, closes #11. * DiscImageChef.Partitions/DragonFlyBSD.cs: Added support for DragonFly BSD 64-bit disklabels. * DiscImageChef.Partitions/PC98.cs: Added support for NEC PC-9800 partitions. * DiscImageChef.Partitions/RioKarma.cs: Added support for Rio Karma partitions. * DiscImageChef.Partitions/SGI.cs: Added support for SGI DVHs, closes #9. * DiscImageChef.Partitions/UNIX.cs: Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * TODO: * README.md: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: Added support for Acorn FileCore partition, closes #4. Added support for DEC disklabels, closes #11. Added support for SGI DVHs, closes #9. Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Added support for DragonFly BSD 64-bit disklabels. Added support for NEC PC-9800 partitions. Added support for Rio Karma partitions. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/GPT.cs: Added new partition type UUIDs. * DiscImageChef.Partitions/MBR.cs: Moved BSD partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. Moved UNIX partitions from inside MBR code to separate code, as they can (and do) appear on other architectures as the only scheme. * DiscImageChef.Partitions/Sun.cs: Added new partition types. Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
}