Files
Aaru/Aaru.Filesystems/ISO9660/Structs/ElTorito.cs

115 lines
4.6 KiB
C#
Raw Normal View History

// /***************************************************************************
2020-02-27 12:31:25 +00:00
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : ElTorito.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : ISO9660 filesystem plugin.
//
// --[ Description ] ----------------------------------------------------------
//
// El Torito extensions 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/>.
//
// ----------------------------------------------------------------------------
2022-02-18 10:02:53 +00:00
// Copyright © 2011-2022 Natalia Portillo
// In the loving memory of Facunda "Tata" Suárez Domínguez, R.I.P. 2019/07/24
// ****************************************************************************/
2017-12-19 19:33:46 +00:00
2022-03-07 07:36:44 +00:00
using System.Runtime.InteropServices;
namespace Aaru.Filesystems;
2022-03-06 13:29:38 +00:00
public sealed partial class ISO9660
{
2022-03-06 13:29:38 +00:00
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ElToritoBootRecord
{
2022-03-06 13:29:38 +00:00
public readonly byte type;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public readonly byte[] id;
public readonly byte version;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] system_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] boot_id;
public readonly uint catalog_sector;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1974)]
public readonly byte[] boot_use;
}
2022-03-06 13:29:38 +00:00
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ElToritoValidationEntry
{
public readonly ElToritoIndicator header_id;
public readonly ElToritoPlatform platform_id;
public readonly ushort reserved;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)]
public readonly byte[] developer_id;
public readonly ushort checksum;
public readonly ushort signature;
}
2022-03-06 13:29:38 +00:00
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ElToritoInitialEntry
{
public readonly ElToritoIndicator bootable;
public ElToritoEmulation boot_type;
public readonly ushort load_seg;
public readonly byte system_type;
public readonly byte reserved1;
public readonly ushort sector_count;
public readonly uint load_rba;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public readonly byte[] reserved2;
}
2022-03-06 13:29:38 +00:00
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ElToritoSectionHeaderEntry
{
public readonly ElToritoIndicator header_id;
public readonly ElToritoPlatform platform_id;
public readonly ushort entries;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)]
public readonly byte[] identifier;
}
2022-03-06 13:29:38 +00:00
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ElToritoSectionEntry
{
public readonly ElToritoIndicator bootable;
public readonly ElToritoEmulation boot_type;
public readonly ushort load_seg;
public readonly byte system_type;
public readonly byte reserved1;
public readonly ushort sector_count;
public readonly uint load_rba;
public readonly byte selection_criteria_type;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 19)]
public readonly byte[] selection_criterias;
}
2022-03-06 13:29:38 +00:00
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ElToritoSectionEntryExtension
{
public readonly ElToritoIndicator extension_indicator;
public readonly ElToritoFlags extension_flags;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 30)]
public readonly byte[] selection_criterias;
}
2017-12-19 20:33:03 +00:00
}