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

116 lines
4.8 KiB
C#
Raw Normal View History

// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// 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/>.
//
// ----------------------------------------------------------------------------
2018-12-29 17:34:38 +00:00
// Copyright © 2011-2019 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
using System.Runtime.InteropServices;
namespace DiscImageChef.Filesystems.ISO9660
{
public partial class ISO9660
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ElToritoBootRecord
{
2019-07-31 19:53:47 +01:00
public readonly byte type;
2018-06-22 08:08:38 +01:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
2019-07-31 19:53:47 +01:00
public readonly byte[] id;
public readonly byte version;
2018-06-22 08:08:38 +01:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
2019-07-31 19:53:47 +01:00
public readonly byte[] system_id;
2018-06-22 08:08:38 +01:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
2019-07-31 19:53:47 +01:00
public readonly byte[] boot_id;
public readonly uint catalog_sector;
2018-06-22 08:08:38 +01:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1974)]
2019-07-31 19:53:47 +01:00
public readonly byte[] boot_use;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ElToritoValidationEntry
{
2019-07-31 19:53:47 +01:00
public readonly ElToritoIndicator header_id;
public readonly ElToritoPlatform platform_id;
public readonly ushort reserved;
2018-06-22 08:08:38 +01:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)]
2019-07-31 19:53:47 +01:00
public readonly byte[] developer_id;
public readonly ushort checksum;
public readonly ushort signature;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ElToritoInitialEntry
{
2019-07-31 19:53:47 +01:00
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;
2018-06-22 08:08:38 +01:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
2019-07-31 19:53:47 +01:00
public readonly byte[] reserved2;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ElToritoSectionHeaderEntry
{
2019-07-31 19:53:47 +01:00
public readonly ElToritoIndicator header_id;
public readonly ElToritoPlatform platform_id;
public readonly ushort entries;
2018-06-22 08:08:38 +01:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)]
2019-07-31 19:53:47 +01:00
public readonly byte[] identifier;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ElToritoSectionEntry
{
2019-07-31 19:53:47 +01:00
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;
2018-06-22 08:08:38 +01:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 19)]
2019-07-31 19:53:47 +01:00
public readonly byte[] selection_criterias;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ElToritoSectionEntryExtension
{
2019-07-31 19:53:47 +01:00
public readonly ElToritoIndicator extension_indicator;
public readonly ElToritoFlags extension_flags;
2018-06-22 08:08:38 +01:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 30)]
2019-07-31 19:53:47 +01:00
public readonly byte[] selection_criterias;
}
}
2017-12-19 20:33:03 +00:00
}